From 36b670f0a9f5dd59422a9f368dfe035d0b5f719c Mon Sep 17 00:00:00 2001 From: Ansgar Radermacher Date: Sun, 17 Jan 2016 00:21:13 +0100 Subject: Bug 484701 - [QDesigner] Refactoring - code generators, architecture exploration and component based design should be organised in common directory Bug 478797 - [model library] Decide which model library to use for C++ primitive types Change-Id: Idade4edfcf803da3528c0873aa04b754915866fd --- .../org.eclipse.papyrus.acceleo.debug/.classpath | 7 - .../org.eclipse.papyrus.acceleo.debug/.project | 28 - .../META-INF/MANIFEST.MF | 20 - .../org.eclipse.papyrus.acceleo.debug/about.html | 28 - .../build.properties | 9 - .../icons/allocation.gif | Bin 143 -> 0 bytes .../icons/deploy.gif | Bin 148 -> 0 bytes .../plugin.properties | 12 - .../org.eclipse.papyrus.acceleo.debug/plugin.xml | 74 - .../org.eclipse.papyrus.acceleo.debug/pom.xml | 14 - .../eclipse/papyrus/acceleo/debug/Activator.java | 54 - .../acceleo/debug/dialogs/TestAcceleoDialog.java | 169 - .../debug/handlers/ResetAcceleoHandler.java | 46 - .../acceleo/debug/handlers/TestAcceleoHandler.java | 57 - .../org.eclipse.papyrus.acceleo.ui/.classpath | 7 - .../org.eclipse.papyrus.acceleo.ui/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 13 - .../org.eclipse.papyrus.acceleo.ui/about.html | 28 - .../build.properties | 8 - .../icons/codegen-16x16.gif | Bin 101 -> 0 bytes .../plugin.properties | 12 - .../org.eclipse.papyrus.acceleo.ui/plugin.xml | 26 - .../codegen/org.eclipse.papyrus.acceleo.ui/pom.xml | 14 - .../org/eclipse/papyrus/acceleo/ui/Activator.java | 54 - .../codegen/org.eclipse.papyrus.acceleo/.classpath | 7 - .../codegen/org.eclipse.papyrus.acceleo/.project | 34 - .../META-INF/MANIFEST.MF | 17 - .../codegen/org.eclipse.papyrus.acceleo/about.html | 28 - .../org.eclipse.papyrus.acceleo/build.acceleo | 26 - .../org.eclipse.papyrus.acceleo/build.properties | 11 - .../org.eclipse.papyrus.acceleo/plugin.properties | 12 - .../codegen/org.eclipse.papyrus.acceleo/pom.xml | 14 - .../org/eclipse/papyrus/acceleo/AcceleoDriver.java | 438 - .../eclipse/papyrus/acceleo/AcceleoException.java | 14 - .../src/org/eclipse/papyrus/acceleo/Activator.java | 37 - .../src/org/eclipse/papyrus/acceleo/GenUtils.emtl | 2692 --- .../src/org/eclipse/papyrus/acceleo/GenUtils.mtl | 114 - .../src/org/eclipse/papyrus/acceleo/Utils.java | 27 - .../org.eclipse.papyrus.codegen.base/.classpath | 7 - .../org.eclipse.papyrus.codegen.base/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 20 - .../org.eclipse.papyrus.codegen.base/about.html | 28 - .../build.properties | 9 - .../icons/codegen-16x16.gif | Bin 101 -> 0 bytes .../plugin.properties | 12 - .../org.eclipse.papyrus.codegen.base/plugin.xml | 26 - .../org.eclipse.papyrus.codegen.base/pom.xml | 14 - .../eclipse/papyrus/codegen/base/Activator.java | 44 - .../org/eclipse/papyrus/codegen/base/GenUtils.java | 731 - .../codegen/base/HierarchyLocationStrategy.java | 46 - .../papyrus/codegen/base/ILocationStrategy.java | 14 - .../papyrus/codegen/base/IPFileSystemAccess.java | 33 - .../codegen/base/JavaIoFileSystemAccess.java | 136 - .../org/eclipse/papyrus/codegen/base/Messages.java | 15 - .../papyrus/codegen/base/ModelElementsCreator.java | 141 - .../codegen/base/ProjectBasedFileAccess.java | 158 - .../codegen/base/codesync/ChangeObject.java | 32 - .../codegen/base/codesync/ManageChangeEvents.java | 137 - .../base/codesync/RecordEventsListener.java | 110 - .../papyrus/codegen/base/messages.properties | 1 - .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 17 - .../about.html | 28 - .../build.properties | 9 - .../plugin.properties | 12 - .../plugin.xml | 6 - .../pom.xml | 14 - .../schema/languageCodegen.exsd | 84 - .../schema/languageProject.exsd | 71 - .../codegen/extensionpoints/AbstractSettings.java | 24 - .../papyrus/codegen/extensionpoints/Activator.java | 54 - .../extensionpoints/GenerationConstants.java | 31 - .../extensionpoints/GeneratorSelectionDialog.java | 122 - .../codegen/extensionpoints/ILangCodegen.java | 93 - .../codegen/extensionpoints/ILangCodegen2.java | 58 - .../extensionpoints/ILangProjectSupport.java | 58 - .../codegen/extensionpoints/LanguageCodegen.java | 214 - .../extensionpoints/LanguageProjectSupport.java | 51 - .../papyrus/codegen/extensionpoints/Messages.java | 20 - .../codegen/extensionpoints/MethodInfo.java | 124 - .../codegen/extensionpoints/SyncInformation.java | 39 - .../codegen/extensionpoints/messages.properties | 6 - .../org.eclipse.papyrus.cpp.cdtproject/.classpath | 7 - .../org.eclipse.papyrus.cpp.cdtproject/.project | 35 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 24 - .../org.eclipse.papyrus.cpp.cdtproject/about.html | 28 - .../build.properties | 8 - .../plugin.properties | 12 - .../org.eclipse.papyrus.cpp.cdtproject/plugin.xml | 18 - .../org.eclipse.papyrus.cpp.cdtproject/pom.xml | 14 - .../eclipse/papyrus/cpp/cdtproject/Activator.java | 54 - .../cpp/cdtproject/CCNamedProjectWizard.java | 47 - .../papyrus/cpp/cdtproject/CDTMainWizardPageV.java | 33 - .../papyrus/cpp/cdtproject/CDTSettings.java | 28 - .../cpp/cdtproject/CNamedProjectWizard.java | 47 - .../papyrus/cpp/cdtproject/CProjectSupport.java | 16 - .../cpp/cdtproject/C_CppProjectSupport.java | 225 - .../papyrus/cpp/cdtproject/CppProjectSupport.java | 17 - .../org.eclipse.papyrus.cpp.codegen.ui/.classpath | 7 - .../org.eclipse.papyrus.cpp.codegen.ui/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 25 - .../org.eclipse.papyrus.cpp.codegen.ui/about.html | 28 - .../build.properties | 9 - .../icons/codegen.gif | Bin 114 -> 0 bytes .../plugin.properties | 12 - .../org.eclipse.papyrus.cpp.codegen.ui/plugin.xml | 49 - .../org.eclipse.papyrus.cpp.codegen.ui/pom.xml | 14 - .../eclipse/papyrus/cpp/codegen/ui/Activator.java | 71 - .../cpp/codegen/ui/handlers/CDTprojectHandler.java | 83 - .../codegen/ui/handlers/GenerateCodeHandler.java | 123 - .../ui/preferences/CodegenPreferencePage.java | 117 - .../org.eclipse.papyrus.cpp.codegen/.classpath | 8 - .../org.eclipse.papyrus.cpp.codegen/.project | 52 - .../META-INF/MANIFEST.MF | 41 - .../org.eclipse.papyrus.cpp.codegen/about.html | 28 - .../org.eclipse.papyrus.cpp.codegen/build.acceleo | 26 - .../build.properties | 13 - .../plugin.properties | 12 - .../org.eclipse.papyrus.cpp.codegen/plugin.xml | 18 - .../org.eclipse.papyrus.cpp.codegen/pom.xml | 56 - .../org/eclipse/papyrus/cpp/codegen/Activator.java | 68 - .../org/eclipse/papyrus/cpp/codegen/Constants.java | 46 - .../papyrus/cpp/codegen/CppLangCodegen.java | 138 - .../org/eclipse/papyrus/cpp/codegen/Messages.java | 27 - .../papyrus/cpp/codegen/messages.properties | 2 - .../codegen/preferences/CppCodeGenConstants.java | 41 - .../CppCodeGenPreferenceInitializer.java | 42 - .../cpp/codegen/preferences/CppCodeGenUtils.java | 53 - .../transformation/CppLocationStrategy.java | 30 - .../transformation/CppModelElementsCreator.java | 243 - .../papyrus/cpp/codegen/utils/ClassUtils.java | 81 - .../papyrus/cpp/codegen/utils/CppGenUtils.emtl | 993 - .../papyrus/cpp/codegen/utils/CppGenUtils.java | 351 - .../papyrus/cpp/codegen/utils/CppGenUtils.mtl | 42 - .../cpp/codegen/utils/ILocateCppProject.java | 36 - .../cpp/codegen/utils/LocateCppProject.java | 140 - .../papyrus/cpp/codegen/utils/Messages.java | 18 - .../papyrus/cpp/codegen/utils/Modifier.emtl | 421 - .../papyrus/cpp/codegen/utils/Modifier.java | 189 - .../eclipse/papyrus/cpp/codegen/utils/Modifier.mtl | 15 - .../papyrus/cpp/codegen/utils/messages.properties | 4 - .../papyrus/cpp/codegen/xtend/CppAttribute.xtend | 92 - .../xtend/CppClassAttributesDeclaration.xtend | 26 - .../codegen/xtend/CppClassFriendDeclaration.xtend | 35 - .../xtend/CppClassIncludeClassDeclaration.xtend | 69 - .../codegen/xtend/CppClassIncludeDeclaration.xtend | 51 - .../xtend/CppClassInheritedDeclarations.xtend | 51 - .../xtend/CppClassOperationsDeclaration.xtend | 36 - .../xtend/CppClassOperationsImplementation.xtend | 44 - .../cpp/codegen/xtend/CppClassTypeAndEnum.xtend | 72 - .../cpp/codegen/xtend/CppClassifierGenerator.xtend | 253 - .../cpp/codegen/xtend/CppDocumentation.xtend | 49 - .../cpp/codegen/xtend/CppEnumerations.xtend | 33 - .../papyrus/cpp/codegen/xtend/CppIncludeUtil.xtend | 86 - .../cpp/codegen/xtend/CppInnerClassifiers.xtend | 58 - .../papyrus/cpp/codegen/xtend/CppOperations.xtend | 204 - .../codegen/xtend/CppPackageHeaderGenerator.xtend | 64 - .../papyrus/cpp/codegen/xtend/CppParameter.xtend | 62 - .../cpp/codegen/xtend/CppPrimitiveTypes.xtend | 49 - .../papyrus/cpp/codegen/xtend/CppTemplates.xtend | 58 - .../xtend-gen/.gitignore | 2 - .../org.eclipse.papyrus.cpp.examples/.classpath | 7 - .../org.eclipse.papyrus.cpp.examples/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 13 - .../org.eclipse.papyrus.cpp.examples/about.html | 28 - .../build.properties | 9 - .../models/examples/HelloWorldOO.di | 21 - .../models/examples/HelloWorldOO.notation | 176 - .../models/examples/HelloWorldOO.uml | 43 - .../plugin.properties | 12 - .../org.eclipse.papyrus.cpp.examples/plugin.xml | 15 - .../org.eclipse.papyrus.cpp.examples/pom.xml | 14 - .../eclipse/papyrus/cpp/examples/Activator.java | 54 - .../cpp/examples/HelloWorldOOModelWizard.java | 27 - .../org.eclipse.papyrus.cpp.profile/.classpath | 7 - .../org.eclipse.papyrus.cpp.profile/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 21 - .../org.eclipse.papyrus.cpp.profile/about.html | 28 - .../build.properties | 11 - .../icons/transfo_cpp.gif | Bin 352 -> 0 bytes .../libraries/AnsiCLibrary.di | 17 - .../libraries/AnsiCLibrary.notation | 348 - .../libraries/AnsiCLibrary.uml | 37 - .../plugin.properties | 12 - .../org.eclipse.papyrus.cpp.profile/plugin.xml | 54 - .../org.eclipse.papyrus.cpp.profile/pom.xml | 14 - .../profiles/C_Cpp.ecore | 205 - .../profiles/C_Cpp.genmodel | 196 - .../profiles/C_Cpp.profile.di | 41 - .../profiles/C_Cpp.profile.notation | 1835 -- .../profiles/C_Cpp.profile.uml | 529 - .../profiles/PapyrusC.profile.di | 38 - .../profiles/PapyrusC.profile.notation | 650 - .../profiles/PapyrusC.profile.uml | 4143 ---- .../src/org/eclipse/papyrus/C_Cpp/Array.java | 140 - .../org/eclipse/papyrus/C_Cpp/C_CppFactory.java | 268 - .../org/eclipse/papyrus/C_Cpp/C_CppPackage.java | 2980 --- .../src/org/eclipse/papyrus/C_Cpp/Const.java | 114 - .../src/org/eclipse/papyrus/C_Cpp/ConstInit.java | 86 - .../src/org/eclipse/papyrus/C_Cpp/CppInit.java | 86 - .../src/org/eclipse/papyrus/C_Cpp/CppRoot.java | 63 - .../src/org/eclipse/papyrus/C_Cpp/EAccessKind.java | 251 - .../org/eclipse/papyrus/C_Cpp/EStorageClass.java | 251 - .../org/eclipse/papyrus/C_Cpp/ExternLibrary.java | 144 - .../src/org/eclipse/papyrus/C_Cpp/External.java | 86 - .../src/org/eclipse/papyrus/C_Cpp/Friend.java | 87 - .../src/org/eclipse/papyrus/C_Cpp/Include.java | 200 - .../src/org/eclipse/papyrus/C_Cpp/Inline.java | 60 - .../eclipse/papyrus/C_Cpp/ManualGeneration.java | 89 - .../src/org/eclipse/papyrus/C_Cpp/Mutable.java | 52 - .../src/org/eclipse/papyrus/C_Cpp/NoCodeGen.java | 64 - .../src/org/eclipse/papyrus/C_Cpp/Ptr.java | 117 - .../src/org/eclipse/papyrus/C_Cpp/Ref.java | 87 - .../org/eclipse/papyrus/C_Cpp/StorageClass.java | 118 - .../src/org/eclipse/papyrus/C_Cpp/Template.java | 85 - .../org/eclipse/papyrus/C_Cpp/TemplateBinding.java | 85 - .../eclipse/papyrus/C_Cpp/TemplateParameter.java | 85 - .../src/org/eclipse/papyrus/C_Cpp/Typedef.java | 86 - .../src/org/eclipse/papyrus/C_Cpp/Union.java | 60 - .../src/org/eclipse/papyrus/C_Cpp/Variadic.java | 52 - .../src/org/eclipse/papyrus/C_Cpp/Virtual.java | 60 - .../src/org/eclipse/papyrus/C_Cpp/Visibility.java | 86 - .../org/eclipse/papyrus/C_Cpp/VisibilityKind.java | 251 - .../src/org/eclipse/papyrus/C_Cpp/Volatile.java | 104 - .../org/eclipse/papyrus/C_Cpp/impl/ArrayImpl.java | 362 - .../papyrus/C_Cpp/impl/C_CppFactoryImpl.java | 518 - .../papyrus/C_Cpp/impl/C_CppPackageImpl.java | 1464 -- .../org/eclipse/papyrus/C_Cpp/impl/ConstImpl.java | 292 - .../eclipse/papyrus/C_Cpp/impl/ConstInitImpl.java | 236 - .../eclipse/papyrus/C_Cpp/impl/CppInitImpl.java | 236 - .../eclipse/papyrus/C_Cpp/impl/CppRootImpl.java | 165 - .../papyrus/C_Cpp/impl/ExternLibraryImpl.java | 370 - .../eclipse/papyrus/C_Cpp/impl/ExternalImpl.java | 236 - .../org/eclipse/papyrus/C_Cpp/impl/FriendImpl.java | 229 - .../eclipse/papyrus/C_Cpp/impl/IncludeImpl.java | 468 - .../org/eclipse/papyrus/C_Cpp/impl/InlineImpl.java | 166 - .../papyrus/C_Cpp/impl/ManualGenerationImpl.java | 235 - .../eclipse/papyrus/C_Cpp/impl/MutableImpl.java | 157 - .../eclipse/papyrus/C_Cpp/impl/NoCodeGenImpl.java | 166 - .../org/eclipse/papyrus/C_Cpp/impl/PtrImpl.java | 299 - .../org/eclipse/papyrus/C_Cpp/impl/RefImpl.java | 229 - .../papyrus/C_Cpp/impl/StorageClassImpl.java | 296 - .../papyrus/C_Cpp/impl/TemplateBindingImpl.java | 235 - .../eclipse/papyrus/C_Cpp/impl/TemplateImpl.java | 235 - .../papyrus/C_Cpp/impl/TemplateParameterImpl.java | 235 - .../eclipse/papyrus/C_Cpp/impl/TypedefImpl.java | 236 - .../org/eclipse/papyrus/C_Cpp/impl/UnionImpl.java | 166 - .../eclipse/papyrus/C_Cpp/impl/VariadicImpl.java | 157 - .../eclipse/papyrus/C_Cpp/impl/VirtualImpl.java | 166 - .../eclipse/papyrus/C_Cpp/impl/VisibilityImpl.java | 236 - .../eclipse/papyrus/C_Cpp/impl/VolatileImpl.java | 291 - .../papyrus/C_Cpp/util/C_CppAdapterFactory.java | 584 - .../C_Cpp/util/C_CppResourceFactoryImpl.java | 50 - .../papyrus/C_Cpp/util/C_CppResourceImpl.java | 37 - .../eclipse/papyrus/C_Cpp/util/C_CppSwitch.java | 646 - .../papyrus/C_Cpp/util/C_CppXMLProcessor.java | 57 - .../org/eclipse/papyrus/cpp/profile/Activator.java | 54 - .../org/eclipse/papyrus/cpp/profile/StdStereo.java | 18 - .../codegen/org.eclipse.papyrus.cpp.test/.cproject | 114 - .../org.eclipse.papyrus.cpp.test/.gitignore | 2 - .../codegen/org.eclipse.papyrus.cpp.test/.project | 83 - .../model/TestCCodeGen.di | 29 - .../model/TestCCodeGen.notation | 151 - .../model/TestCCodeGen.uml | 187 - .../model/TestCDTintegration.di | 32 - .../model/TestCDTintegration.notation | 283 - .../model/TestCDTintegration.uml | 182 - .../org.eclipse.papyrus.texteditor.cdt/.classpath | 7 - .../org.eclipse.papyrus.texteditor.cdt/.project | 28 - .../META-INF/MANIFEST.MF | 40 - .../org.eclipse.papyrus.texteditor.cdt/about.html | 28 - .../build.properties | 10 - .../icons/texteditor.gif | Bin 133 -> 0 bytes .../icons/texteditor.xcf | Bin 888 -> 0 bytes .../plugin.properties | 14 - .../org.eclipse.papyrus.texteditor.cdt/plugin.xml | 65 - .../org.eclipse.papyrus.texteditor.cdt/pom.xml | 14 - .../eclipse/papyrus/texteditor/cdt/Activator.java | 71 - .../cdt/AddProfileAndModelLibsHandler.java | 144 - .../papyrus/texteditor/cdt/CommandSupport.java | 75 - .../texteditor/cdt/TextEditorConstants.java | 23 - .../org/eclipse/papyrus/texteditor/cdt/Utils.java | 187 - .../cdt/editor/DelegatingSourceViewer.java | 400 - .../texteditor/cdt/editor/PapyrusCDTEditor.java | 395 - .../cdt/factory/PapyrusCDTEditorFactory.java | 210 - .../cdt/handler/PapyrusCDTEditorHandler.java | 308 - .../texteditor/cdt/listener/ChangeKind.java | 7 - .../papyrus/texteditor/cdt/listener/Closure.java | 81 - .../texteditor/cdt/listener/ModelListener.java | 135 - .../cdt/listener/OperationHistoryListener.java | 76 - .../TextEditorModelSharedResource.java | 120 - .../cdt/preferences/CDTPreferenceConstants.java | 33 - .../cdt/preferences/CDTPreferenceInitializer.java | 39 - .../cdt/preferences/CDTPreferencePage.java | 64 - .../texteditor/cdt/sync/FindTransition.java | 47 - .../texteditor/cdt/sync/ObtainICElement.java | 129 - .../texteditor/cdt/sync/ParameterModifiers.java | 45 - .../cdt/sync/RevealCurrentOperation.java | 128 - .../texteditor/cdt/sync/SyncCDTtoModel.java | 635 - .../texteditor/cdt/sync/SyncModelToCDT.java | 80 - .../.classpath | 7 - .../org.eclipse.papyrus.texteditor.model/.project | 28 - .../META-INF/MANIFEST.MF | 16 - .../about.html | 28 - .../build.properties | 22 - .../model/texteditormodel.ecore | 13 - .../model/texteditormodel.genmodel | 19 - .../plugin.properties | 15 - .../plugin.xml | 27 - .../org.eclipse.papyrus.texteditor.model/pom.xml | 14 - .../model/texteditormodel/TextEditorModel.java | 191 - .../texteditormodel/TextEditorModelFactory.java | 52 - .../texteditormodel/TextEditorModelPackage.java | 310 - .../impl/TextEditorModelFactoryImpl.java | 107 - .../texteditormodel/impl/TextEditorModelImpl.java | 464 - .../impl/TextEditorModelPackageImpl.java | 255 - .../util/TextEditorModelAdapterFactory.java | 148 - .../util/TextEditorModelSwitch.java | 136 - .../.classpath | 7 - .../.project | 28 - .../META-INF/MANIFEST.MF | 25 - .../about.html | 28 - .../build.properties | 9 - .../plugin.properties | 13 - .../plugin.xml | 17 - .../pom.xml | 14 - .../resources/TextEditorFacet.custom | 41 - .../texteditor/modelexplorer/Activator.java | 73 - .../adapters/TextEditorAdapterFactory.java | 40 - .../queries/GetContainedTextEditors.java | 58 - .../modelexplorer/queries/GetTextEditorIcon.java | 35 - .../modelexplorer/queries/GetTextEditorName.java | 35 - .../queries/IsTextEditorContainer.java | 35 - .../queries/NotVisibleStructuralFeatureQuery.java | 30 - .../org.eclipse.papyrus.views.cpp/.classpath | 7 - .../codegen/org.eclipse.papyrus.views.cpp/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 33 - .../org.eclipse.papyrus.views.cpp/about.html | 28 - .../org.eclipse.papyrus.views.cpp/about.ini | 17 - .../org.eclipse.papyrus.views.cpp/build.properties | 10 - .../plugin.properties | 12 - .../org.eclipse.papyrus.views.cpp/plugin.xml | 13 - .../codegen/org.eclipse.papyrus.views.cpp/pom.xml | 14 - .../resources/icons/Papyrus_32x32.gif | Bin 518 -> 0 bytes .../resources/icons/save_edit.gif | Bin 639 -> 0 bytes .../resources/icons/transfo_cpp.gif | Bin 352 -> 0 bytes .../resources/icons/transfo_cpp_old.gif | Bin 630 -> 0 bytes .../resources/icons/undo_edit.gif | Bin 355 -> 0 bytes .../papyrus/views/cpp/AbstractCppPanelView.java | 107 - .../org/eclipse/papyrus/views/cpp/Activator.java | 160 - .../eclipse/papyrus/views/cpp/Activator.properties | 96 - .../eclipse/papyrus/views/cpp/CommandSupport.java | 81 - .../eclipse/papyrus/views/cpp/CppPanelView.java | 91 - .../views/listeners/UMLElementPanelListener.java | 90 - .../papyrus/views/panels/CppAbstractPanel.java | 447 - .../papyrus/views/panels/CppBehaviorPanel.java | 275 - .../papyrus/views/panels/CppClassPanel.java | 225 - .../papyrus/views/panels/CppDefaultPanel.java | 104 - .../views/panels/CppGeneralizationPanel.java | 268 - .../papyrus/views/panels/CppOperationPanel.java | 646 - .../papyrus/views/panels/CppPackagePanel.java | 183 - .../papyrus/views/panels/CppParameterPanel.java | 346 - .../views/panels/CppPrimitiveTypePanel.java | 167 - .../papyrus/views/panels/CppPropertyPanel.java | 384 - .../views/panels/CppTemplateBindingPanel.java | 178 - .../views/panels/CppTemplateParameterPanel.java | 181 - .../eclipse/papyrus/views/panels/PanelFactory.java | 144 - .../org.eclipse.papyrus.java-updatesite/.project | 17 - .../org.eclipse.papyrus.java-updatesite/site.xml | 29 - .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 19 - .../about.html | 28 - .../build.properties | 8 - .../icons/generate.psd | Bin 182989 -> 0 bytes .../icons/generation.png | Bin 3683 -> 0 bytes .../icons/sample.gif | Bin 983 -> 0 bytes .../plugin.properties | 18 - .../pom.xml | 14 - .../jdtsynchronizer/GeneratorPreference.java | 77 - .../generator/jdtsynchronizer/RunGenerator.java | 228 - .../jdtsynchronizer/impl/SynchJDTCommentable.java | 161 - .../impl/SynchJDTCompilationUnit.java | 95 - .../jdtsynchronizer/impl/SynchJDTField.java | 217 - .../jdtsynchronizer/impl/SynchJDTGetterSetter.java | 168 - .../jdtsynchronizer/impl/SynchJDTJavaModel.java | 73 - .../jdtsynchronizer/impl/SynchJDTJavaProject.java | 145 - .../jdtsynchronizer/impl/SynchJDTMethod.java | 387 - .../impl/SynchJDTPackageFragment.java | 112 - .../impl/SynchJDTPackageFragmentRoot.java | 120 - .../jdtsynchronizer/impl/SynchJDTType.java | 435 - .../generator/jdtsynchronizer/impl/SynchTools.java | 325 - .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 18 - .../about.html | 28 - .../build.properties | 12 - .../CreateJDTCompilationUnit_types_JDTClass.gif | Bin 223 -> 0 bytes .../CreateJDTCompilationUnit_types_JDTEnum.gif | Bin 223 -> 0 bytes ...CreateJDTCompilationUnit_types_JDTInterface.gif | Bin 223 -> 0 bytes .../CreateJDTCompilationUnit_types_JDTType.gif | Bin 223 -> 0 bytes ...eateJDTJavaModel_javaProject_JDTJavaProject.gif | Bin 223 -> 0 bytes ...packageFragmentRoots_JDTPackageFragmentRoot.gif | Bin 223 -> 0 bytes ...teJDTMember_typeParameters_JDTTypeParameter.gif | Bin 223 -> 0 bytes .../CreateJDTMethod_bodies_JDTOpaqueBody.gif | Bin 223 -> 0 bytes .../CreateJDTMethod_bodies_OpaqueMethodBody.gif | Bin 223 -> 0 bytes .../CreateJDTMethod_parameters_JDTParameter.gif | Bin 223 -> 0 bytes .../CreateJDTMethod_returnType_JDTParameter.gif | Bin 223 -> 0 bytes ...entRoot_packageFragments_JDTPackageFragment.gif | Bin 223 -> 0 bytes ...ragment_compilationUnits_JDTCompilationUnit.gif | Bin 223 -> 0 bytes ...ragment_packageFragments_JDTPackageFragment.gif | Bin 223 -> 0 bytes .../full/ctool16/CreateJDTType_fields_JDTField.gif | Bin 223 -> 0 bytes .../ctool16/CreateJDTType_methods_JDTMethod.gif | Bin 223 -> 0 bytes .../full/ctool16/CreateJDTType_types_JDTClass.gif | Bin 223 -> 0 bytes .../full/ctool16/CreateJDTType_types_JDTEnum.gif | Bin 223 -> 0 bytes .../ctool16/CreateJDTType_types_JDTInterface.gif | Bin 223 -> 0 bytes .../full/ctool16/CreateJDTType_types_JDTType.gif | Bin 223 -> 0 bytes .../icons/full/obj16/JDTClass.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTCompilationUnit.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTEnum.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTException.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTField.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTImportContainer.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTImportDeclaration.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTInterface.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTJavaElement.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTJavaModel.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTJavaProject.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTMethod.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTOpaqueBody.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTPackageFragment.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTPackageFragmentRoot.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTParameter.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JDTTypeParameter.gif | Bin 129 -> 0 bytes .../icons/full/obj16/OpaqueMethodBody.gif | Bin 129 -> 0 bytes .../icons/full/obj16/Options.gif | Bin 129 -> 0 bytes .../plugin.properties | 22 - .../plugin.xml | 22 - .../pom.xml | 14 - .../provider/GeneratoroptionsmmEditPlugin.java | 95 - ...neratoroptionsmmItemProviderAdapterFactory.java | 221 - .../provider/OptionsItemProvider.java | 164 - .../jdt/jdtmm/provider/JDTClassItemProvider.java | 135 - .../provider/JDTCompilationUnitItemProvider.java | 242 - .../jdt/jdtmm/provider/JDTEnumItemProvider.java | 135 - .../jdtmm/provider/JDTExceptionItemProvider.java | 145 - .../jdt/jdtmm/provider/JDTFieldItemProvider.java | 343 - .../provider/JDTImportContainerItemProvider.java | 135 - .../provider/JDTImportDeclarationItemProvider.java | 135 - .../jdtmm/provider/JDTInterfaceItemProvider.java | 135 - .../jdtmm/provider/JDTJavaElementItemProvider.java | 270 - .../jdtmm/provider/JDTJavaModelItemProvider.java | 181 - .../jdtmm/provider/JDTJavaProjectItemProvider.java | 232 - .../jdt/jdtmm/provider/JDTMemberItemProvider.java | 247 - .../jdtmm/provider/JDTMethodBodyItemProvider.java | 117 - .../jdt/jdtmm/provider/JDTMethodItemProvider.java | 371 - .../jdtmm/provider/JDTOpaqueBodyItemProvider.java | 153 - .../provider/JDTPackageFragmentItemProvider.java | 232 - .../JDTPackageFragmentRootItemProvider.java | 232 - .../jdtmm/provider/JDTParameterItemProvider.java | 218 - .../jdt/jdtmm/provider/JDTParentItemProvider.java | 193 - .../provider/JDTParentJavaElementItemProvider.java | 181 - .../jdt/jdtmm/provider/JDTTypeItemProvider.java | 508 - .../provider/JDTTypeParameterItemProvider.java | 135 - .../jdtmm/provider/JDTTypeRootItemProvider.java | 123 - .../jdt/jdtmm/provider/JdtmmEditPlugin.java | 115 - .../provider/JdtmmItemProviderAdapterFactory.java | 661 - .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 18 - .../about.html | 28 - .../build.properties | 12 - .../icons/full/obj16/JdtmmModelFile.gif | Bin 346 -> 0 bytes .../icons/full/wizban/NewJdtmm.gif | Bin 2462 -> 0 bytes .../plugin.properties | 53 - .../plugin.xml | 37 - .../pom.xml | 14 - .../GeneratoroptionsmmActionBarContributor.java | 441 - .../presentation/GeneratoroptionsmmEditor.java | 1884 -- .../GeneratoroptionsmmEditorPlugin.java | 96 - .../GeneratoroptionsmmModelWizard.java | 636 - .../presentation/JdtmmActionBarContributor.java | 461 - .../jdt/jdtmm/presentation/JdtmmEditor.java | 1897 -- .../jdt/jdtmm/presentation/JdtmmEditorPlugin.java | 116 - .../jdt/jdtmm/presentation/JdtmmModelWizard.java | 656 - .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 22 - .../about.html | 28 - .../build.properties | 16 - .../model/generatorOptions/generatoroptionsmm.di | 2 - .../generatorOptions/generatoroptionsmm.ecore | 12 - .../generatorOptions/generatoroptionsmm.genmodel | 40 - .../generatorOptions/generatoroptionsmm.notation | 36 - .../model/generatorOptions/generatoroptionsmm.uml | 17 - .../model/jdtmm.di | 53 - .../model/jdtmm.ecore | 243 - .../model/jdtmm.genmodel | 191 - .../model/jdtmm.notation | 3094 --- .../model/jdtmm.uml | 481 - .../model/reverse/reverseJDT.di | 29 - .../model/reverse/reverseJDT.notation | 1614 -- .../model/reverse/reverseJDT.uml | 20911 ------------------- .../plugin.properties | 19 - .../plugin.xml | 28 - .../pom.xml | 14 - .../GeneratoroptionsmmFactory.java | 57 - .../GeneratoroptionsmmPackage.java | 187 - .../metamodel/jdt/generatoroptionsmm/Options.java | 63 - .../impl/GeneratoroptionsmmFactoryImpl.java | 114 - .../impl/GeneratoroptionsmmPackageImpl.java | 229 - .../jdt/generatoroptionsmm/impl/OptionsImpl.java | 187 - .../util/GeneratoroptionsmmAdapterFactory.java | 139 - .../util/GeneratoroptionsmmSwitch.java | 131 - .../generator/metamodel/jdt/jdtmm/JDTClass.java | 37 - .../metamodel/jdt/jdtmm/JDTCompilationUnit.java | 106 - .../generator/metamodel/jdt/jdtmm/JDTEnum.java | 37 - .../metamodel/jdt/jdtmm/JDTException.java | 38 - .../generator/metamodel/jdt/jdtmm/JDTField.java | 322 - .../metamodel/jdt/jdtmm/JDTImportContainer.java | 37 - .../metamodel/jdt/jdtmm/JDTImportDeclaration.java | 37 - .../metamodel/jdt/jdtmm/JDTInterface.java | 37 - .../metamodel/jdt/jdtmm/JDTJavaElement.java | 207 - .../metamodel/jdt/jdtmm/JDTJavaModel.java | 63 - .../metamodel/jdt/jdtmm/JDTJavaProject.java | 100 - .../generator/metamodel/jdt/jdtmm/JDTMember.java | 130 - .../generator/metamodel/jdt/jdtmm/JDTMethod.java | 316 - .../metamodel/jdt/jdtmm/JDTMethodBody.java | 71 - .../metamodel/jdt/jdtmm/JDTOpaqueBody.java | 55 - .../metamodel/jdt/jdtmm/JDTPackageFragment.java | 106 - .../jdt/jdtmm/JDTPackageFragmentRoot.java | 106 - .../metamodel/jdt/jdtmm/JDTParameter.java | 193 - .../generator/metamodel/jdt/jdtmm/JDTParent.java | 111 - .../metamodel/jdt/jdtmm/JDTParentJavaElement.java | 37 - .../generator/metamodel/jdt/jdtmm/JDTType.java | 452 - .../metamodel/jdt/jdtmm/JDTTypeParameter.java | 74 - .../generator/metamodel/jdt/jdtmm/JDTTypeRoot.java | 37 - .../metamodel/jdt/jdtmm/JdtmmFactory.java | 217 - .../metamodel/jdt/jdtmm/JdtmmPackage.java | 5215 ----- .../metamodel/jdt/jdtmm/TrueFalseDefault.java | 278 - .../metamodel/jdt/jdtmm/VisibilityKind.java | 278 - .../metamodel/jdt/jdtmm/impl/JDTClassImpl.java | 61 - .../jdt/jdtmm/impl/JDTCompilationUnitImpl.java | 375 - .../metamodel/jdt/jdtmm/impl/JDTEnumImpl.java | 61 - .../metamodel/jdt/jdtmm/impl/JDTExceptionImpl.java | 62 - .../metamodel/jdt/jdtmm/impl/JDTFieldImpl.java | 749 - .../jdt/jdtmm/impl/JDTImportContainerImpl.java | 61 - .../jdt/jdtmm/impl/JDTImportDeclarationImpl.java | 61 - .../metamodel/jdt/jdtmm/impl/JDTInterfaceImpl.java | 61 - .../jdt/jdtmm/impl/JDTJavaElementImpl.java | 453 - .../metamodel/jdt/jdtmm/impl/JDTJavaModelImpl.java | 193 - .../jdt/jdtmm/impl/JDTJavaProjectImpl.java | 333 - .../metamodel/jdt/jdtmm/impl/JDTMemberImpl.java | 363 - .../jdt/jdtmm/impl/JDTMethodBodyImpl.java | 232 - .../metamodel/jdt/jdtmm/impl/JDTMethodImpl.java | 779 - .../jdt/jdtmm/impl/JDTOpaqueBodyImpl.java | 191 - .../jdt/jdtmm/impl/JDTPackageFragmentImpl.java | 376 - .../jdt/jdtmm/impl/JDTPackageFragmentRootImpl.java | 376 - .../metamodel/jdt/jdtmm/impl/JDTParameterImpl.java | 515 - .../metamodel/jdt/jdtmm/impl/JDTParentImpl.java | 254 - .../jdt/jdtmm/impl/JDTParentJavaElementImpl.java | 296 - .../metamodel/jdt/jdtmm/impl/JDTTypeImpl.java | 1117 - .../jdt/jdtmm/impl/JDTTypeParameterImpl.java | 235 - .../metamodel/jdt/jdtmm/impl/JDTTypeRootImpl.java | 61 - .../metamodel/jdt/jdtmm/impl/JdtmmFactoryImpl.java | 558 - .../metamodel/jdt/jdtmm/impl/JdtmmPackageImpl.java | 1905 -- .../jdt/jdtmm/util/JdtmmAdapterFactory.java | 595 - .../metamodel/jdt/jdtmm/util/JdtmmPreference.java | 58 - .../metamodel/jdt/jdtmm/util/JdtmmSwitch.java | 880 - .../metamodel/jdt/jdtmm/visitor/JDTVisitor.java | 39 - .../jdt/jdtmm/visitor/JDTVisitorException.java | 42 - .../metamodel/jdt/utils/DerivedNotifyingEList.java | 442 - .../.classpath | 7 - .../.project | 38 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 10 - .../about.html | 28 - .../build.properties | 8 - .../doc/rulesInheritance.di | 23 - .../doc/rulesInheritance.notation | 775 - .../doc/rulesInheritance.uml | 55 - .../plugin.properties | 19 - .../pom.xml | 14 - .../transfo/umltojdt/UmltojdtActivator.java | 71 - .../transforms/uml/algo.txt | 167 - .../transforms/uml/stereotypeUtil.qvto | 99 - .../transforms/uml/uml2jdt2.qvto | 1269 -- .../.classpath | 7 - .../org.eclipse.papyrus.java.generator.ui/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 21 - .../about.html | 28 - .../build.properties | 9 - .../icons/generate.psd | Bin 182989 -> 0 bytes .../icons/generation.png | Bin 3683 -> 0 bytes .../icons/sample.gif | Bin 983 -> 0 bytes .../plugin.properties | 19 - .../plugin.xml | 88 - .../org.eclipse.papyrus.java.generator.ui/pom.xml | 14 - .../papyrus/java/generator/ui/Activator.java | 70 - .../ui/handlers/GenerateJavaCodeHandler.java | 246 - .../ui/preference/GeneratorPreferenceImpl.java | 103 - .../ui/preference/GenericClassFieldEditor.java | 69 - .../generator/ui/preference/PackageListEditor.java | 87 - .../ui/preference/PreferenceConstants.java | 41 - .../ui/preference/PreferenceInitializer.java | 47 - .../generator/ui/preference/PreferencePage.java | 109 - .../.classpath | 7 - .../org.eclipse.papyrus.java.profile.edit/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 15 - .../about.html | 28 - .../build.properties | 16 - .../icons/full/obj16/JavaClass.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JavaMethod.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JavaPackage_.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JavaParameter.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JavaProject.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JavaProperty.gif | Bin 129 -> 0 bytes .../icons/full/obj16/JavaSrcFolder.gif | Bin 129 -> 0 bytes .../icons/full/obj16/PrimitiveType.gif | Bin 129 -> 0 bytes .../plugin.properties | 86 - .../plugin.xml | 25 - .../org.eclipse.papyrus.java.profile.edit/pom.xml | 14 - .../java/provider/JavaClassItemProvider.java | 276 - .../java/profile/java/provider/JavaEditPlugin.java | 103 - .../profile/java/provider/JavaGenItemProvider.java | 166 - .../provider/JavaItemProviderAdapterFactory.java | 421 - .../java/provider/JavaMethodItemProvider.java | 351 - .../provider/JavaNamedElementItemProvider.java | 255 - .../java/provider/JavaPackage_ItemProvider.java | 177 - .../java/provider/JavaParameterItemProvider.java | 177 - .../java/provider/JavaProjectItemProvider.java | 145 - .../java/provider/JavaPropertyItemProvider.java | 351 - .../java/provider/JavaSrcFolderItemProvider.java | 145 - .../java/provider/PrimitiveTypeItemProvider.java | 202 - .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 17 - .../about.html | 28 - .../build.properties | 16 - .../icons/full/obj16/JavaModelFile.gif | Bin 346 -> 0 bytes .../icons/full/wizban/NewJava.gif | Bin 2462 -> 0 bytes .../plugin.properties | 65 - .../plugin.xml | 39 - .../pom.xml | 14 - .../presentation/JavaActionBarContributor.java | 445 - .../java/profile/java/presentation/JavaEditor.java | 1885 -- .../java/presentation/JavaEditorPlugin.java | 104 - .../profile/java/presentation/JavaModelWizard.java | 640 - .../org.eclipse.papyrus.java.profile/.classpath | 7 - .../java/org.eclipse.papyrus.java.profile/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 17 - .../org.eclipse.papyrus.java.profile/about.html | 28 - .../build.properties | 17 - .../icons/javaprofile.gif | Bin 983 -> 0 bytes .../models/java.ecore | 112 - .../models/java.profile.di | 29 - .../models/java.profile.genmodel | 105 - .../models/java.profile.notation | 821 - .../models/java.profile.uml | 5729 ----- .../plugin.properties | 16 - .../org.eclipse.papyrus.java.profile/plugin.xml | 50 - .../java/org.eclipse.papyrus.java.profile/pom.xml | 14 - .../papyrus/java/profile/java/JavaClass.java | 209 - .../papyrus/java/profile/java/JavaFactory.java | 120 - .../eclipse/papyrus/java/profile/java/JavaGen.java | 84 - .../papyrus/java/profile/java/JavaMethod.java | 297 - .../java/profile/java/JavaNamedElement.java | 173 - .../papyrus/java/profile/java/JavaPackage.java | 2348 --- .../papyrus/java/profile/java/JavaPackage_.java | 84 - .../papyrus/java/profile/java/JavaParameter.java | 85 - .../papyrus/java/profile/java/JavaProject.java | 55 - .../papyrus/java/profile/java/JavaProperty.java | 305 - .../papyrus/java/profile/java/JavaSrcFolder.java | 55 - .../papyrus/java/profile/java/PrimitiveType.java | 113 - .../java/profile/java/TrueFalseDefault.java | 262 - .../java/profile/java/impl/JavaClassImpl.java | 486 - .../java/profile/java/impl/JavaFactoryImpl.java | 270 - .../java/profile/java/impl/JavaGenImpl.java | 240 - .../java/profile/java/impl/JavaMethodImpl.java | 670 - .../profile/java/impl/JavaNamedElementImpl.java | 424 - .../java/profile/java/impl/JavaPackageImpl.java | 978 - .../java/profile/java/impl/JavaPackage_Impl.java | 250 - .../java/profile/java/impl/JavaParameterImpl.java | 251 - .../java/profile/java/impl/JavaProjectImpl.java | 172 - .../java/profile/java/impl/JavaPropertyImpl.java | 671 - .../java/profile/java/impl/JavaSrcFolderImpl.java | 172 - .../java/profile/java/impl/PrimitiveTypeImpl.java | 311 - .../java/profile/java/util/JavaAdapterFactory.java | 321 - .../profile/java/util/JavaResourceFactoryImpl.java | 56 - .../java/profile/java/util/JavaResourceImpl.java | 34 - .../papyrus/java/profile/java/util/JavaSwitch.java | 400 - .../java/profile/java/util/JavaXMLProcessor.java | 54 - .../org.eclipse.papyrus.java.reverse.ui/.classpath | 7 - .../org.eclipse.papyrus.java.reverse.ui/.project | 28 - .../.settings/org.eclipse.core.resources.prefs | 3 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 21 - .../org.eclipse.papyrus.java.reverse.ui/about.html | 28 - .../build.properties | 11 - .../icons/associationFromProperty.gif | Bin 96 -> 0 bytes .../icons/javaReverse.gif | Bin 152 -> 0 bytes .../plugin.properties | 16 - .../org.eclipse.papyrus.java.reverse.ui/plugin.xml | 154 - .../org.eclipse.papyrus.java.reverse.ui/pom.xml | 14 - .../eclipse/papyrus/java/reverse/ui/Activator.java | 54 - .../papyrus/java/reverse/ui/DisplayReverse.java | 181 - .../java/reverse/ui/DndReverseCodeHandler.java | 246 - .../papyrus/java/reverse/ui/JavaCodeReverse.java | 287 - .../eclipse/papyrus/java/reverse/ui/Messages.java | 19 - .../java/reverse/ui/ReverseCodeHandler.java | 196 - .../papyrus/java/reverse/ui/TreeSelectionList.java | 153 - .../reverse/ui/dialog/DndReverseCodeDialog.java | 93 - .../java/reverse/ui/dialog/InputListDialog.java | 332 - .../java/reverse/ui/dialog/ReverseCodeDialog.java | 281 - .../java/reverse/ui/dnd/DropReverseCommand.java | 103 - .../java/reverse/ui/dnd/DropReverseStrategy.java | 60 - .../papyrus/java/reverse/ui/dnd/Messages.java | 19 - .../java/reverse/ui/dnd/messages.properties | 2 - .../CreateAssociationFromPropertyHandler.java | 286 - .../papyrus/java/reverse/ui/messages.properties | 2 - .../org.eclipse.papyrus.java.reverse/.classpath | 7 - .../java/org.eclipse.papyrus.java.reverse/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 17 - .../org.eclipse.papyrus.java.reverse/about.html | 28 - .../build.properties | 8 - .../plugin.properties | 16 - .../java/org.eclipse.papyrus.java.reverse/pom.xml | 14 - .../src/japa/parser/ASTParser.java | 10321 --------- .../src/japa/parser/ASTParserConstants.java | 531 - .../src/japa/parser/ASTParserTokenManager.java | 2579 --- .../src/japa/parser/JavaCharStream.java | 599 - .../src/japa/parser/JavaParser.java | 173 - .../src/japa/parser/ParseException.java | 216 - .../src/japa/parser/Token.java | 142 - .../src/japa/parser/TokenMgrError.java | 158 - .../src/japa/parser/ast/BlockComment.java | 55 - .../src/japa/parser/ast/Comment.java | 64 - .../src/japa/parser/ast/CompilationUnit.java | 177 - .../src/japa/parser/ast/ImportDeclaration.java | 133 - .../src/japa/parser/ast/LineComment.java | 55 - .../src/japa/parser/ast/Node.java | 191 - .../src/japa/parser/ast/PackageDeclaration.java | 114 - .../src/japa/parser/ast/TypeParameter.java | 114 - .../parser/ast/body/AnnotationDeclaration.java | 52 - .../ast/body/AnnotationMemberDeclaration.java | 97 - .../src/japa/parser/ast/body/BodyDeclaration.java | 63 - .../ast/body/ClassOrInterfaceDeclaration.java | 98 - .../parser/ast/body/ConstructorDeclaration.java | 121 - .../parser/ast/body/EmptyMemberDeclaration.java | 48 - .../japa/parser/ast/body/EmptyTypeDeclaration.java | 48 - .../parser/ast/body/EnumConstantDeclaration.java | 85 - .../src/japa/parser/ast/body/EnumDeclaration.java | 75 - .../src/japa/parser/ast/body/FieldDeclaration.java | 85 - .../parser/ast/body/InitializerDeclaration.java | 71 - .../src/japa/parser/ast/body/JavadocComment.java | 49 - .../japa/parser/ast/body/MethodDeclaration.java | 144 - .../src/japa/parser/ast/body/ModifierSet.java | 118 - .../src/japa/parser/ast/body/Parameter.java | 108 - .../src/japa/parser/ast/body/TypeDeclaration.java | 72 - .../japa/parser/ast/body/VariableDeclarator.java | 73 - .../japa/parser/ast/body/VariableDeclaratorId.java | 72 - .../src/japa/parser/ast/expr/AnnotationExpr.java | 36 - .../src/japa/parser/ast/expr/ArrayAccessExpr.java | 71 - .../japa/parser/ast/expr/ArrayCreationExpr.java | 106 - .../japa/parser/ast/expr/ArrayInitializerExpr.java | 62 - .../src/japa/parser/ast/expr/AssignExpr.java | 97 - .../src/japa/parser/ast/expr/BinaryExpr.java | 104 - .../japa/parser/ast/expr/BooleanLiteralExpr.java | 59 - .../src/japa/parser/ast/expr/CastExpr.java | 72 - .../src/japa/parser/ast/expr/CharLiteralExpr.java | 48 - .../src/japa/parser/ast/expr/ClassExpr.java | 61 - .../src/japa/parser/ast/expr/ConditionalExpr.java | 82 - .../japa/parser/ast/expr/DoubleLiteralExpr.java | 48 - .../src/japa/parser/ast/expr/EnclosedExpr.java | 60 - .../src/japa/parser/ast/expr/Expression.java | 38 - .../src/japa/parser/ast/expr/FieldAccessExpr.java | 85 - .../src/japa/parser/ast/expr/InstanceOfExpr.java | 72 - .../japa/parser/ast/expr/IntegerLiteralExpr.java | 54 - .../ast/expr/IntegerLiteralMinValueExpr.java | 50 - .../src/japa/parser/ast/expr/LiteralExpr.java | 35 - .../src/japa/parser/ast/expr/LongLiteralExpr.java | 55 - .../parser/ast/expr/LongLiteralMinValueExpr.java | 50 - .../japa/parser/ast/expr/MarkerAnnotationExpr.java | 60 - .../src/japa/parser/ast/expr/MemberValuePair.java | 72 - .../src/japa/parser/ast/expr/MethodCallExpr.java | 96 - .../src/japa/parser/ast/expr/NameExpr.java | 60 - .../japa/parser/ast/expr/NormalAnnotationExpr.java | 73 - .../src/japa/parser/ast/expr/NullLiteralExpr.java | 48 - .../japa/parser/ast/expr/ObjectCreationExpr.java | 109 - .../japa/parser/ast/expr/QualifiedNameExpr.java | 60 - .../ast/expr/SingleMemberAnnotationExpr.java | 71 - .../japa/parser/ast/expr/StringLiteralExpr.java | 59 - .../src/japa/parser/ast/expr/SuperExpr.java | 60 - .../src/japa/parser/ast/expr/ThisExpr.java | 60 - .../src/japa/parser/ast/expr/UnaryExpr.java | 82 - .../parser/ast/expr/VariableDeclarationExpr.java | 96 - .../src/japa/parser/ast/stmt/AssertStmt.java | 71 - .../src/japa/parser/ast/stmt/BlockStmt.java | 61 - .../src/japa/parser/ast/stmt/BreakStmt.java | 59 - .../src/japa/parser/ast/stmt/CatchClause.java | 72 - .../src/japa/parser/ast/stmt/ContinueStmt.java | 59 - .../src/japa/parser/ast/stmt/DoStmt.java | 71 - .../src/japa/parser/ast/stmt/EmptyStmt.java | 48 - .../stmt/ExplicitConstructorInvocationStmt.java | 96 - .../src/japa/parser/ast/stmt/ExpressionStmt.java | 60 - .../src/japa/parser/ast/stmt/ForStmt.java | 95 - .../src/japa/parser/ast/stmt/ForeachStmt.java | 83 - .../src/japa/parser/ast/stmt/IfStmt.java | 82 - .../src/japa/parser/ast/stmt/LabeledStmt.java | 70 - .../src/japa/parser/ast/stmt/ReturnStmt.java | 60 - .../src/japa/parser/ast/stmt/Statement.java | 38 - .../src/japa/parser/ast/stmt/SwitchEntryStmt.java | 73 - .../src/japa/parser/ast/stmt/SwitchStmt.java | 73 - .../src/japa/parser/ast/stmt/SynchronizedStmt.java | 72 - .../src/japa/parser/ast/stmt/ThrowStmt.java | 60 - .../src/japa/parser/ast/stmt/TryStmt.java | 83 - .../japa/parser/ast/stmt/TypeDeclarationStmt.java | 60 - .../src/japa/parser/ast/stmt/WhileStmt.java | 71 - .../japa/parser/ast/type/ClassOrInterfaceType.java | 83 - .../src/japa/parser/ast/type/PrimitiveType.java | 64 - .../src/japa/parser/ast/type/ReferenceType.java | 71 - .../src/japa/parser/ast/type/Type.java | 38 - .../src/japa/parser/ast/type/VoidType.java | 49 - .../src/japa/parser/ast/type/WildcardType.java | 72 - .../src/japa/parser/ast/visitor/DumpVisitor.java | 1387 -- .../japa/parser/ast/visitor/GenericVisitor.java | 280 - .../parser/ast/visitor/GenericVisitorAdapter.java | 910 - .../src/japa/parser/ast/visitor/VoidVisitor.java | 280 - .../parser/ast/visitor/VoidVisitorAdapter.java | 828 - .../src/japa/parser/java_1_5.jj | 3006 --- .../src/javagen/umlparser/ClassifierCatalog.java | 393 - .../javagen/umlparser/CompilationUnitAnalyser.java | 1245 -- .../javagen/umlparser/CreationPackageCatalog.java | 639 - .../src/javagen/umlparser/CuPrinter.java | 72 - .../javagen/umlparser/GenericSwitchVisitor.java | 665 - .../src/javagen/umlparser/GenericTransformer.java | 269 - .../src/javagen/umlparser/ImportedTypeCatalog.java | 167 - .../src/javagen/umlparser/ModelManager.java | 103 - .../src/javagen/umlparser/QualifiedName.java | 48 - .../src/javagen/umlparser/SwitchVisitor.java | 661 - .../src/javagen/umlparser/TypeAnalyser.java | 219 - .../umlparser/TypeAnalyserAndTranslator.java | 151 - .../src/javagen/umlparser/UmlParser.java | 163 - .../src/javagen/umlparser/UmlUtils.java | 1054 - .../eclipse/papyrus/java/reverse/Activator.java | 54 - .../java/reverse/utils/TypeOperationsEnhanced.java | 184 - .../org.eclipse.papyrus.java.template/.classpath | 7 - .../org.eclipse.papyrus.java.template/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 291 - .../.settings/org.eclipse.jdt.ui.prefs | 68 - .../META-INF/MANIFEST.MF | 16 - .../org.eclipse.papyrus.java.template/about.html | 26 - .../build.properties | 6 - .../org.eclipse.papyrus.java.template/plugin.xml | 11 - .../eclipse/papyrus/java/template/Activator.java | 63 - .../resolvers/BundleActivatorResolver.java | 110 - .../java/template/resolvers/RegisterResolver.java | 90 - .../org.eclipse.papyrus.fcm.profile/.classpath | 7 - .../org.eclipse.papyrus.fcm.profile/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 24 - .../org.eclipse.papyrus.fcm.profile/about.html | 28 - .../build.properties | 19 - .../icons/connector.png | Bin 228 -> 0 bytes .../icons/connector.svg | 80 - .../icons/deploy.gif | Bin 148 -> 0 bytes .../org.eclipse.papyrus.fcm.profile/icons/fcm.gif | Bin 123 -> 0 bytes .../icons/hires/connector.png | Bin 770 -> 0 bytes .../org.eclipse.papyrus.fcm.profile/icons/port.gif | Bin 95 -> 0 bytes .../icons/target.gif | Bin 111 -> 0 bytes .../model/FCM.ecore | 301 - .../model/FCM.genmodel | 176 - .../model/FCM.profile.di | 60 - .../model/FCM.profile.notation | 2897 --- .../model/FCM.profile.uml | 679 - .../palettes/palette-classdep.xml | 29 - .../palettes/palette-composite.xml | 23 - .../plugin.properties | 12 - .../org.eclipse.papyrus.fcm.profile/plugin.xml | 82 - .../org.eclipse.papyrus.fcm.profile/pom.xml | 14 - .../schema/fcmBindingHelper.exsd | 99 - .../schema/fcmEmbeddingRule.exsd | 99 - .../schema/fcmPortMappingRule.exsd | 99 - .../src/org/eclipse/papyrus/FCM/Activator.java | 65 - .../src/org/eclipse/papyrus/FCM/Assembly.java | 66 - .../src/org/eclipse/papyrus/FCM/AutoIndex.java | 60 - .../org/eclipse/papyrus/FCM/AutoIndexPerNode.java | 27 - .../src/org/eclipse/papyrus/FCM/BindTemplate.java | 78 - .../src/org/eclipse/papyrus/FCM/BindingHelper.java | 63 - .../org/eclipse/papyrus/FCM/CodeGenOptions.java | 115 - .../org/eclipse/papyrus/FCM/CompImplTemplate.java | 85 - .../org/eclipse/papyrus/FCM/CompToOOmapping.java | 63 - .../src/org/eclipse/papyrus/FCM/CompilerChain.java | 59 - .../src/org/eclipse/papyrus/FCM/ConfigOption.java | 59 - .../papyrus/FCM/ConfigurableElementInstance.java | 60 - .../src/org/eclipse/papyrus/FCM/Configuration.java | 102 - .../eclipse/papyrus/FCM/ConfigurationProperty.java | 64 - .../src/org/eclipse/papyrus/FCM/Connector.java | 115 - .../papyrus/FCM/ConnectorConfiguration.java | 86 - .../src/org/eclipse/papyrus/FCM/ContainerRule.java | 109 - .../org/eclipse/papyrus/FCM/ContainerRuleKind.java | 225 - .../eclipse/papyrus/FCM/CopyAttributeValue.java | 86 - .../org/eclipse/papyrus/FCM/DeploymentPlan.java | 86 - .../org/eclipse/papyrus/FCM/DerivedElement.java | 86 - .../src/org/eclipse/papyrus/FCM/FCMFactory.java | 376 - .../src/org/eclipse/papyrus/FCM/FCMPackage.java | 3911 ---- .../src/org/eclipse/papyrus/FCM/Flatten.java | 63 - .../src/org/eclipse/papyrus/FCM/Fragment.java | 59 - .../eclipse/papyrus/FCM/ImplementationGroup.java | 63 - .../papyrus/FCM/ImplementationProperties.java | 170 - .../org/eclipse/papyrus/FCM/InitPrecedence.java | 92 - .../eclipse/papyrus/FCM/InstanceConfigurator.java | 85 - .../eclipse/papyrus/FCM/InteractionComponent.java | 117 - .../org/eclipse/papyrus/FCM/InterceptionKind.java | 310 - .../org/eclipse/papyrus/FCM/InterceptionRule.java | 134 - .../org/eclipse/papyrus/FCM/OperatingSystem.java | 59 - .../src/org/eclipse/papyrus/FCM/Port.java | 117 - .../src/org/eclipse/papyrus/FCM/PortKind.java | 138 - .../src/org/eclipse/papyrus/FCM/ProgLanguage.java | 63 - .../org/eclipse/papyrus/FCM/RuleApplication.java | 106 - .../src/org/eclipse/papyrus/FCM/Singleton.java | 63 - .../src/org/eclipse/papyrus/FCM/Target.java | 207 - .../eclipse/papyrus/FCM/TargetArchitecture.java | 59 - .../src/org/eclipse/papyrus/FCM/Template.java | 90 - .../src/org/eclipse/papyrus/FCM/TemplatePort.java | 90 - .../papyrus/FCM/UseInstanceConfigurator.java | 89 - .../org/eclipse/papyrus/FCM/impl/AssemblyImpl.java | 165 - .../eclipse/papyrus/FCM/impl/AutoIndexImpl.java | 166 - .../papyrus/FCM/impl/AutoIndexPerNodeImpl.java | 46 - .../eclipse/papyrus/FCM/impl/BindTemplateImpl.java | 207 - .../papyrus/FCM/impl/BindingHelperImpl.java | 165 - .../papyrus/FCM/impl/CodeGenOptionsImpl.java | 291 - .../papyrus/FCM/impl/CompImplTemplateImpl.java | 235 - .../papyrus/FCM/impl/CompToOOmappingImpl.java | 165 - .../papyrus/FCM/impl/CompilerChainImpl.java | 165 - .../eclipse/papyrus/FCM/impl/ConfigOptionImpl.java | 165 - .../FCM/impl/ConfigurableElementInstanceImpl.java | 166 - .../papyrus/FCM/impl/ConfigurationImpl.java | 269 - .../FCM/impl/ConfigurationPropertyImpl.java | 166 - .../FCM/impl/ConnectorConfigurationImpl.java | 229 - .../eclipse/papyrus/FCM/impl/ConnectorImpl.java | 290 - .../papyrus/FCM/impl/ContainerRuleImpl.java | 277 - .../papyrus/FCM/impl/CopyAttributeValueImpl.java | 228 - .../papyrus/FCM/impl/DeploymentPlanImpl.java | 228 - .../papyrus/FCM/impl/DerivedElementImpl.java | 228 - .../eclipse/papyrus/FCM/impl/FCMFactoryImpl.java | 652 - .../eclipse/papyrus/FCM/impl/FCMPackageImpl.java | 2002 -- .../org/eclipse/papyrus/FCM/impl/FlattenImpl.java | 165 - .../org/eclipse/papyrus/FCM/impl/FragmentImpl.java | 165 - .../papyrus/FCM/impl/ImplementationGroupImpl.java | 165 - .../FCM/impl/ImplementationPropertiesImpl.java | 430 - .../papyrus/FCM/impl/InitPrecedenceImpl.java | 240 - .../papyrus/FCM/impl/InstanceConfiguratorImpl.java | 234 - .../papyrus/FCM/impl/InteractionComponentImpl.java | 298 - .../papyrus/FCM/impl/InterceptionRuleImpl.java | 341 - .../papyrus/FCM/impl/OperatingSystemImpl.java | 165 - .../src/org/eclipse/papyrus/FCM/impl/PortImpl.java | 334 - .../org/eclipse/papyrus/FCM/impl/PortKindImpl.java | 351 - .../eclipse/papyrus/FCM/impl/ProgLanguageImpl.java | 165 - .../papyrus/FCM/impl/RuleApplicationImpl.java | 268 - .../eclipse/papyrus/FCM/impl/SingletonImpl.java | 165 - .../papyrus/FCM/impl/TargetArchitectureImpl.java | 165 - .../org/eclipse/papyrus/FCM/impl/TargetImpl.java | 522 - .../org/eclipse/papyrus/FCM/impl/TemplateImpl.java | 229 - .../eclipse/papyrus/FCM/impl/TemplatePortImpl.java | 181 - .../FCM/impl/UseInstanceConfiguratorImpl.java | 228 - .../papyrus/FCM/util/ConnectorTypeUtil.java | 41 - .../papyrus/FCM/util/FCMAdapterFactory.java | 832 - .../papyrus/FCM/util/FCMResourceFactoryImpl.java | 50 - .../eclipse/papyrus/FCM/util/FCMResourceImpl.java | 37 - .../org/eclipse/papyrus/FCM/util/FCMSwitch.java | 938 - .../src/org/eclipse/papyrus/FCM/util/FCMUtil.java | 240 - .../eclipse/papyrus/FCM/util/FCMXMLProcessor.java | 57 - .../eclipse/papyrus/FCM/util/IBindingHelper.java | 26 - .../eclipse/papyrus/FCM/util/IEmbeddingRule.java | 31 - .../org/eclipse/papyrus/FCM/util/IMappingRule.java | 41 - .../papyrus/FCM/util/ITemplateMappingRule.java | 40 - .../src/org/eclipse/papyrus/FCM/util/MapUtil.java | 530 - .../.classpath | 7 - .../.project | 46 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 47 - .../about.html | 28 - .../about.properties | 12 - .../build.acceleo | 26 - .../build.properties | 12 - .../plugin.properties | 12 - .../plugin.xml | 15 - .../pom.xml | 14 - .../schema/externalGenerator.exsd | 109 - .../schema/instanceConfig.exsd | 109 - .../schema/language.exsd | 109 - .../schema/ooTransformation.exsd | 109 - .../schema/xtendGenerator.exsd | 109 - .../papyrus/qompass/designer/core/Activator.java | 60 - .../qompass/designer/core/CORBAtypeNames.java | 23 - .../qompass/designer/core/CommandSupport.java | 118 - .../papyrus/qompass/designer/core/ConfigUtils.java | 93 - .../qompass/designer/core/CreationUtils.java | 81 - .../papyrus/qompass/designer/core/Description.java | 83 - .../qompass/designer/core/ElementFilter.java | 7 - .../papyrus/qompass/designer/core/EnumService.java | 151 - .../eclipse/papyrus/qompass/designer/core/Log.java | 99 - .../papyrus/qompass/designer/core/Messages.java | 128 - .../qompass/designer/core/ModelManagement.java | 174 - .../qompass/designer/core/OperationUtils.java | 166 - .../papyrus/qompass/designer/core/PortInfo.java | 139 - .../papyrus/qompass/designer/core/PortUtils.java | 312 - .../qompass/designer/core/ProjectManagement.java | 55 - .../qompass/designer/core/RunnableWithResult.java | 29 - .../papyrus/qompass/designer/core/StUtils.java | 170 - .../papyrus/qompass/designer/core/Stereotypes.java | 27 - .../papyrus/qompass/designer/core/UMLTool.java | 410 - .../papyrus/qompass/designer/core/Utils.java | 471 - .../core/commands/AddMarteAndFcmProfile.java | 148 - .../core/commands/AddQompassModelLibs.java | 202 - .../designer/core/deployment/AllocUtils.java | 373 - .../designer/core/deployment/BootLoaderGen.java | 546 - .../designer/core/deployment/DepCreation.java | 646 - .../designer/core/deployment/DepPlanUtils.java | 375 - .../qompass/designer/core/deployment/DepUtils.java | 564 - .../qompass/designer/core/deployment/Deploy.java | 188 - .../designer/core/deployment/DeployConstants.java | 14 - .../designer/core/deployment/GatherConfigData.java | 64 - .../core/deployment/ImplementationChooser.java | 34 - .../designer/core/deployment/InstanceDeployer.java | 63 - .../designer/core/deployment/PartialCopy.java | 126 - .../designer/core/extensions/BindingHelperExt.java | 98 - .../designer/core/extensions/EmbeddingRule.java | 65 - .../core/extensions/ExternalGenerator.java | 64 - .../designer/core/extensions/IEmbeddingRule.java | 37 - .../core/extensions/IExternalGenerator.java | 33 - .../core/extensions/IInstanceConfigurator.java | 38 - .../qompass/designer/core/extensions/IOOTrafo.java | 97 - .../qompass/designer/core/extensions/IXtend.java | 15 - .../core/extensions/InstanceConfigurator.java | 121 - .../qompass/designer/core/extensions/OOTrafo.java | 61 - .../designer/core/extensions/XtendGenerator.java | 48 - .../designer/core/generate/GenerateCode.java | 195 - .../designer/core/generate/GenerationOptions.java | 19 - .../designer/core/listeners/DepPlanListener.java | 59 - .../designer/core/listeners/InterfaceListener.java | 64 - .../designer/core/listeners/ModelListener.java | 56 - .../designer/core/listeners/OperationListener.java | 71 - .../designer/core/listeners/ParameterListener.java | 63 - .../designer/core/listeners/PortListener.java | 77 - .../designer/core/listeners/PostCopyListener.java | 35 - .../designer/core/listeners/PreCopyListener.java | 38 - .../designer/core/make/GenerateMakefile.java | 118 - .../qompass/designer/core/make/ShowFiles.java | 104 - .../qompass/designer/core/messages.properties | 91 - .../preferences/QompassPreferenceConstants.java | 33 - .../qompass/designer/core/sync/CompImplSync.java | 451 - .../qompass/designer/core/sync/CompTypeSync.java | 55 - .../qompass/designer/core/sync/DepPlanSync.java | 147 - .../qompass/designer/core/sync/InterfaceSync.java | 141 - .../designer/core/sync/SyncBehaviorParameters.java | 44 - .../designer/core/templates/BindingUtils.java | 150 - .../designer/core/templates/ConnectorBinding.java | 455 - .../PostTemplateInstantiationListener.java | 62 - .../PreTemplateInstantiationListener.java | 94 - .../core/templates/TemplateInstantiation.java | 284 - .../designer/core/templates/TemplateUtils.java | 395 - .../core/templates/TextTemplateBinding.java | 80 - .../core/templates/XtendTemplateBinding.java | 84 - .../transformations/AbstractContainerTrafo.java | 114 - .../core/transformations/AllocTransfo.java | 93 - .../core/transformations/CompTypeTrafos.java | 127 - .../designer/core/transformations/CopyTo.java | 35 - .../core/transformations/ExecuteOOTrafo.java | 175 - .../FlattenInteractionComponents.java | 224 - .../core/transformations/InstantiateDepPlan.java | 702 - .../core/transformations/LWContainerTrafo.java | 436 - .../designer/core/transformations/LazyCopier.java | 1044 - .../core/transformations/MainModelTrafo.java | 478 - .../core/transformations/PrefixConstants.java | 57 - .../core/transformations/RuleManagement.java | 32 - .../transformations/TrafoAndCodegenPackage.java | 350 - .../transformations/TransformationContext.java | 106 - .../transformations/TransformationException.java | 28 - .../transformations/TransformationRTException.java | 33 - .../core/transformations/TransformationUtil.java | 81 - .../designer/core/transformations/UpdateUtils.java | 84 - .../connector/ConnectorReification.java | 400 - .../transformations/container/ContainerTrafo.java | 770 - .../filters/FilterRuleApplication.java | 46 - .../transformations/filters/FilterSignatures.java | 50 - .../filters/FilterStateMachines.java | 95 - .../transformations/filters/FilterTemplate.java | 75 - .../transformations/filters/FixTemplateSync.java | 56 - .../.classpath | 8 - .../.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 21 - .../about.html | 28 - .../build.properties | 8 - .../plugin.properties | 12 - .../plugin.xml | 18 - .../pom.xml | 55 - .../papyrus/qompass/designer/cpp/Activator.java | 50 - .../papyrus/qompass/designer/cpp/Constants.java | 9 - .../papyrus/qompass/designer/cpp/Messages.java | 19 - .../qompass/designer/cpp/messages.properties | 3 - .../designer/cpp/xtend/CppPortMapping.xtend | 553 - .../qompass/designer/cpp/xtend/CppUtils.xtend | 26 - .../designer/cpp/xtend/DynamicCpptoOO.xtend | 505 - .../qompass/designer/cpp/xtend/StaticCppToOO.xtend | 550 - .../xtend-gen/.gitignore | 2 - .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 14 - .../about.html | 28 - .../build.properties | 12 - .../cheatsheet/AddPorts.xml | 109 - .../cheatsheet/CodeCompilation.xml | 22 - .../cheatsheet/CodeGeneration.xml | 30 - .../cheatsheet/ComponentDev.xml | 76 - .../cheatsheet/ComponentImplementation.xml | 85 - .../cheatsheet/ComponentModel.xml | 75 - .../cheatsheet/DeploymentPlan.xml | 57 - .../cheatsheet/Main.xml | 69 - .../cheatsheet/MarteAddComponents.xml | 31 - .../cheatsheet/MarteAddPorts.xml | 21 - .../cheatsheet/MarteMain.xml | 81 - .../cheatsheet/MarteNewModel.xml | 29 - .../cheatsheet/NewModel.xml | 31 - .../cheatsheet/OpenExample.xml | 31 - .../cheatsheet/PlatformModel.xml | 51 - .../cheatsheet/Validation.xml | 35 - .../help/index.xml | 1 - .../help/tocconcepts.xml | 15 - .../help/tocdevguide.xml | 21 - .../help/tocreference.xml | 25 - .../html/concepts/bibliography.html | 60 - .../html/concepts/codegen.html | 60 - .../html/concepts/connector-container.html | 114 - .../html/concepts/input-models.html | 67 - .../html/concepts/overview.html | 55 - .../html/developer-guide/DefineNewPortKinds.html | 34 - .../html/developer-guide/createContainers.html | 44 - .../createInteractionComponents.html | 58 - .../html/developer-guide/developer.html | 57 - .../org.eclipse.papyrus.qompass.designer.core.html | 34 - .../html/img/arrow.png | Bin 741 -> 0 bytes .../html/img/connector-after-trafo.png | Bin 14202 -> 0 bytes .../html/img/connector-before-trafo.png | Bin 17169 -> 0 bytes .../html/img/connector-selection.png | Bin 48922 -> 0 bytes .../html/img/container-aggregation.png | Bin 5155 -> 0 bytes .../html/img/container-connector.png | Bin 14509 -> 0 bytes .../html/img/container-interceptor.png | Bin 5511 -> 0 bytes .../html/img/container-interceptor2.png | Bin 5025 -> 0 bytes .../html/img/container-selection.png | Bin 41152 -> 0 bytes .../html/img/deployment.pdf | Bin 41197 -> 0 bytes .../html/img/deployment.png | Bin 18047 -> 0 bytes .../html/img/logo-flex-eWare-small.png | Bin 23920 -> 0 bytes .../html/img/logo-marte.png | Bin 4584 -> 0 bytes .../html/img/logo-papyrus.png | Bin 10227 -> 0 bytes .../html/img/overview-eng.odg | Bin 21814 -> 0 bytes .../html/img/overview-eng.pdf | Bin 23896 -> 0 bytes .../html/img/overview-eng.png | Bin 31781 -> 0 bytes .../html/img/overview-eng.vsd | Bin 57344 -> 0 bytes .../html/img/qompass-0.33.jpg | Bin 22983 -> 0 bytes .../html/img/qompass.jpg | Bin 141908 -> 0 bytes .../html/img/scaled/connector-after-trafo.png | Bin 8870 -> 0 bytes .../html/img/scaled/connector-before-trafo.png | Bin 14650 -> 0 bytes .../html/img/scaled/connector-selection.png | Bin 26512 -> 0 bytes .../html/img/scaled/container-aggregation.png | Bin 8424 -> 0 bytes .../html/img/scaled/container-interceptor.png | Bin 10141 -> 0 bytes .../html/img/scaled/container-interceptor2.png | Bin 8384 -> 0 bytes .../html/img/scaled/container-selection.png | Bin 41752 -> 0 bytes .../html/img/statemachine-rule.png | Bin 18516 -> 0 bytes .../html/img/toolchain.odg | Bin 170601 -> 0 bytes .../html/img/toolchain.png | Bin 106200 -> 0 bytes .../html/img/trace2.png | Bin 49769 -> 0 bytes .../html/reference/component.html | 33 - .../html/reference/container.html | 54 - .../html/reference/interactionComponent.html | 61 - .../html/reference/port.html | 26 - .../html/reference/portKind.html | 27 - .../html/reference/trafos.html | 40 - .../html/sitestyle.css | 13 - .../model/ec3m-transformations.di | 23 - .../model/ec3m-transformations.notation | 669 - .../model/ec3m-transformations.uml | 173 - .../plugin.properties | 12 - .../plugin.xml | 30 - .../pom.xml | 14 - .../papyrus/qompass/designer/doc/Activator.java | 53 - .../toc.xml | 23 - .../.classpath | 8 - .../.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 20 - .../about.html | 28 - .../build.properties | 8 - .../plugin.properties | 12 - .../plugin.xml | 11 - .../pom.xml | 56 - .../papyrus/qompass/designer/java/Activator.java | 50 - .../papyrus/qompass/designer/java/Messages.java | 19 - .../qompass/designer/java/messages.properties | 3 - .../qompass/designer/java/xtend/JavaToOO.xtend | 548 - .../xtend-gen/.gitignore | 2 - .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 32 - .../about.html | 28 - .../build.properties | 9 - .../icons/ADLInFlowPort.gif | Bin 322 -> 0 bytes .../icons/Qompass-16x16.gif | Bin 1064 -> 0 bytes .../icons/Stereotype.gif | Bin 248 -> 0 bytes .../icons/allocation.gif | Bin 143 -> 0 bytes .../icons/depPlan.gif | Bin 104 -> 0 bytes .../icons/deploy.gif | Bin 148 -> 0 bytes .../icons/ec3m-16x16.gif | Bin 1014 -> 0 bytes .../icons/ec3m-32x32.gif | Bin 1370 -> 0 bytes .../icons/sample.gif | Bin 983 -> 0 bytes .../icons/selConnector.gif | Bin 125 -> 0 bytes .../icons/selContainer.gif | Bin 124 -> 0 bytes .../icons/sync.gif | Bin 296 -> 0 bytes .../plugin.properties | 12 - .../plugin.xml | 248 - .../pom.xml | 14 - .../papyrus/qompass/designer/ui/Activator.java | 54 - .../papyrus/qompass/designer/ui/Messages.java | 43 - .../designer/ui/dialogs/AllocationDialog.java | 311 - .../ui/dialogs/AttributeLabelProvider.java | 36 - .../designer/ui/dialogs/ChooseConfigOpt.java | 245 - .../qompass/designer/ui/dialogs/ChoosePorts.java | 244 - .../ui/dialogs/ConfigOptionLabelProvider.java | 50 - .../ui/dialogs/ConfigureInstanceDialog.java | 642 - .../designer/ui/dialogs/ConfigurePortDialog.java | 388 - .../ui/dialogs/ConnectorSelectionDialog.java | 371 - .../designer/ui/dialogs/ContainerDialog.java | 309 - .../ui/dialogs/GenerationOptionsDialog.java | 138 - .../designer/ui/dialogs/InstanceLabelProvider.java | 39 - .../dialogs/InteractiveImplementationChooser.java | 55 - .../designer/ui/dialogs/NameLabelProvider.java | 26 - .../designer/ui/dialogs/PortLabelProvider.java | 80 - .../designer/ui/dialogs/QNameLabelProvider.java | 26 - .../designer/ui/dialogs/RuleLabelProvider.java | 39 - .../ui/handlers/AddProfileAndModelLibsHandler.java | 92 - .../designer/ui/handlers/AllocateHandler.java | 90 - .../ui/handlers/ConfigureInstanceHandler.java | 129 - .../designer/ui/handlers/ConfigurePortHandler.java | 102 - .../designer/ui/handlers/CreateDepPlanHandler.java | 144 - .../ui/handlers/CreatePlatformHandler.java | 94 - .../ui/handlers/GenCollaborationUseHandler.java | 38 - .../ui/handlers/GenConnectionPatternHandler.java | 49 - .../ui/handlers/InstantiateDepPlanHandler.java | 97 - .../ui/handlers/SelectConnectorHandler.java | 88 - .../ui/handlers/SelectContainerHandler.java | 120 - .../qompass/designer/ui/handlers/SyncHandler.java | 147 - .../ui/handlers/TrafoAndCodegenHandler.java | 58 - .../qompass/designer/ui/messages.properties | 27 - .../preferences/QompassPreferenceInitializer.java | 39 - .../ui/preferences/QompassPreferencePage.java | 76 - .../.classpath | 7 - .../.project | 28 - .../META-INF/MANIFEST.MF | 17 - .../about.html | 28 - .../build.properties | 11 - .../icons/validate.gif | Bin 99 -> 0 bytes .../plugin.properties | 12 - .../plugin.xml | 290 - .../pom.xml | 14 - .../qompass/designer/validation/Activator.java | 54 - .../ValidationDelegateClientSelector.java | 25 - .../constraints/AggregationKindValid.java | 65 - .../constraints/BehaviorsWithoutSpecification.java | 65 - .../constraints/ConfigurationAttributeNotSet.java | 41 - .../constraints/ConnectorCallMultiplicity.java | 82 - .../constraints/ConnectorConnectable.java | 56 - .../validation/constraints/DuplicateOperation.java | 27 - .../constraints/ExecutorIsNotUsedAsPartName.java | 48 - .../validation/constraints/InitialEntryPoints.java | 79 - .../InstanceSpecificationSlotForAllProperties.java | 63 - .../constraints/OperationsAreImplemented.java | 47 - .../constraints/OperationsWithTwoReturnValues.java | 57 - .../constraints/PortIsCorrectlyTyped.java | 45 - .../validation/constraints/PortKindUnset.java | 43 - .../validation/constraints/SystemHasNoPorts.java | 51 - .../constraints/TemplateRefWithoutBinding.java | 81 - .../validation/constraints/UnconnectedPorts.java | 95 - .../constraints/UnconnectedProvPorts.java | 27 - .../constraints/UnconnectedReqPorts.java | 27 - .../.classpath | 7 - .../.project | 35 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 16 - .../about.html | 28 - .../build.acceleo | 26 - .../build.properties | 10 - .../plugin.properties | 12 - .../pom.xml | 14 - .../papyrus/qompass/designer/vsl/Activator.java | 54 - .../papyrus/qompass/designer/vsl/Messages.java | 17 - .../papyrus/qompass/designer/vsl/ParseVSL.emtl | 432 - .../papyrus/qompass/designer/vsl/ParseVSL.java | 185 - .../papyrus/qompass/designer/vsl/ParseVSL.mtl | 23 - .../qompass/designer/vsl/messages.properties | 3 - .../.classpath | 8 - .../.gitignore | 1 - .../.project | 40 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../ExtendedPort.java | 127 - .../HelloWorld/components/HelloWorld.cpp | 33 - .../HelloWorld/components/HelloWorld.h | 58 - .../HelloWorld/platform/MonoNode.cpp | 24 - .../HelloWorld/platform/MonoNode.h | 38 - .../META-INF/MANIFEST.MF | 28 - .../about.html | 28 - .../build.properties | 17 - .../help/modellibs-core-examples.xml | 13 - .../help/modellibs-core-library.xml | 15 - .../html/examples/hello-world.html | 174 - .../html/examples/producer-consumer.html | 125 - .../html/examples/screenshots/cmd_with_error.png | Bin 47208 -> 0 bytes .../examples/screenshots/cmd_without_error.png | Bin 80620 -> 0 bytes .../html/examples/screenshots/hw/allocate.png | Bin 18690 -> 0 bytes .../html/examples/screenshots/hw/c-cpp-view.png | Bin 60218 -> 0 bytes .../examples/screenshots/hw/configure-instance.png | Bin 28563 -> 0 bytes .../examples/screenshots/hw/deployment-plan.png | Bin 17253 -> 0 bytes .../html/examples/screenshots/hw/hello-world.png | Bin 19321 -> 0 bytes .../html/examples/screenshots/hw/platform.png | Bin 13034 -> 0 bytes .../html/examples/screenshots/hw/system.png | Bin 3521 -> 0 bytes .../html/examples/screenshots/pc/dep-plans.png | Bin 7688 -> 0 bytes .../screenshots/pc/generated-container.png | Bin 12742 -> 0 bytes .../html/examples/screenshots/pc/pull-consumer.png | Bin 23901 -> 0 bytes .../html/examples/screenshots/pc/push-consumer.png | Bin 13675 -> 0 bytes .../html/examples/screenshots/pc/push-producer.png | Bin 10169 -> 0 bytes .../html/examples/screenshots/pc/system-pull.png | Bin 17185 -> 0 bytes .../html/examples/screenshots/pc/system-push.png | Bin 10459 -> 0 bytes .../html/library/corba.html | 16 - .../html/library/core.html | 16 - .../html/library/osal.html | 16 - .../html/library/statemachine.html | 16 - .../models/examples/ClientServerTimer.di | 59 - .../models/examples/ClientServerTimer.notation | 1221 -- .../models/examples/ClientServerTimer.uml | 395 - .../models/examples/HelloWorld.di | 40 - .../models/examples/HelloWorld.notation | 574 - .../models/examples/HelloWorld.uml | 156 - .../models/examples/HelloWorldC.di | 40 - .../models/examples/HelloWorldC.notation | 528 - .../models/examples/HelloWorldC.uml | 186 - .../models/examples/HelloWorldJava.di | 40 - .../models/examples/HelloWorldJava.notation | 574 - .../models/examples/HelloWorldJava.uml | 165 - .../models/examples/ProducerConsumer.di | 53 - .../models/examples/ProducerConsumer.notation | 1541 -- .../models/examples/ProducerConsumer.uml | 453 - .../models/examples/ProducerTwoConsumers.di | 47 - .../models/examples/ProducerTwoConsumers.notation | 1655 -- .../models/examples/ProducerTwoConsumers.uml | 532 - .../examples/figs/ProducerConsumer-pullcon.png | Bin 115827 -> 0 bytes .../examples/figs/ProducerConsumer-pullcon.svg | 148 - .../models/examples/figs/ProducerConsumer-sys.pdf | Bin 41470 -> 0 bytes .../models/examples/figs/ProducerConsumer-sys.png | Bin 37205 -> 0 bytes .../models/examples/figs/ProducerConsumer-sys.svg | 127 - .../models/library/corba.di | 23 - .../models/library/corba.notation | 256 - .../models/library/corba.uml | 75 - .../models/library/core.di | 80 - .../models/library/core.notation | 5392 ----- .../models/library/core.uml | 1369 -- .../models/library/corec.di | 92 - .../models/library/corec.notation | 3896 ---- .../models/library/corec.uml | 1507 -- .../models/library/corecpp.di | 92 - .../models/library/corecpp.notation | 3896 ---- .../models/library/corecpp.uml | 1507 -- .../models/library/fifo.di | 50 - .../models/library/fifo.notation | 1865 -- .../models/library/fifo.uml | 432 - .../models/library/figs/In.png | Bin 838 -> 0 bytes .../models/library/figs/In.svg | 64 - .../models/library/figs/InOut.png | Bin 1939 -> 0 bytes .../models/library/figs/InOut.svg | 64 - .../models/library/figs/Out.png | Bin 872 -> 0 bytes .../models/library/figs/Out.svg | 58 - .../models/library/figs/Provided.png | Bin 1611 -> 0 bytes .../models/library/figs/Provided.svg | 105 - .../models/library/figs/ProvidedRequired.png | Bin 1401 -> 0 bytes .../models/library/figs/ProvidedRequired.svg | 124 - .../models/library/figs/Required.png | Bin 1190 -> 0 bytes .../models/library/figs/Required.svg | 108 - .../models/library/figs/hires/In.png | Bin 838 -> 0 bytes .../models/library/figs/hires/InOut.png | Bin 1939 -> 0 bytes .../models/library/figs/hires/Out.png | Bin 872 -> 0 bytes .../models/library/figs/hires/Provided.png | Bin 1611 -> 0 bytes .../models/library/figs/hires/ProvidedRequired.png | Bin 1401 -> 0 bytes .../models/library/figs/hires/Required.png | Bin 1190 -> 0 bytes .../models/library/figs/lowres/In.png | Bin 292 -> 0 bytes .../models/library/figs/lowres/InOut.png | Bin 467 -> 0 bytes .../models/library/figs/lowres/Out.png | Bin 303 -> 0 bytes .../models/library/figs/lowres/Provided.png | Bin 416 -> 0 bytes .../library/figs/lowres/ProvidedRequired.png | Bin 364 -> 0 bytes .../models/library/figs/lowres/Required.png | Bin 317 -> 0 bytes .../models/library/osal.di | 140 - .../models/library/osal.notation | 7725 ------- .../models/library/osal.uml | 11645 ----------- .../models/library/statemachine.di | 59 - .../models/library/statemachine.notation | 2575 --- .../models/library/statemachine.uml | 516 - .../models/library/sysinterfaces.di | 20 - .../models/library/sysinterfaces.notation | 269 - .../models/library/sysinterfaces.uml | 94 - .../models/wizardTemplates/QompassModel.di | 23 - .../models/wizardTemplates/QompassModel.notation | 119 - .../models/wizardTemplates/QompassModel.uml | 62 - .../models/wizardTemplates/QompassSimple.di | 29 - .../models/wizardTemplates/QompassSimple.notation | 51 - .../models/wizardTemplates/QompassSimple.uml | 50 - .../plugin.properties | 12 - .../plugin.xml | 156 - .../pom.xml | 55 - .../papyrus/qompass/modellibs/core/Activator.java | 60 - .../modellibs/core/HelloWorldModelWizard.java | 27 - .../core/ProducerConsumerModelWizard.java | 27 - .../BindCppIncludeToFirstActual.java | 73 - .../core/bindinghelpers/BindOperation.java | 54 - .../InstantiateCppIncludeWithItSelf.java | 74 - .../core/bindinghelpers/LoopOperations.java | 130 - .../modellibs/core/embeddingrules/AccordCall.java | 95 - .../iconfigurators/AnimServiceConfigurator.java | 68 - .../core/iconfigurators/CallEventConfigurator.java | 61 - .../modellibs/core/mappingrules/AMIcallback.java | 162 - .../modellibs/core/mappingrules/AMIpoll.java | 161 - .../modellibs/core/mappingrules/ExtendedPort.java | 132 - .../modellibs/core/mappingrules/ExtendedPort2.java | 138 - .../core/mappingrules/ProvideInterface.java | 37 - .../modellibs/core/mappingrules/PullConsumer.java | 162 - .../modellibs/core/mappingrules/PushConsumer.java | 110 - .../core/mappingrules/PushProdPullCons.java | 75 - .../modellibs/core/mappingrules/PushProducer.java | 130 - .../modellibs/core/mappingrules/TemplatePort.java | 183 - .../modellibs/core/mappingrules/UseConjIntf.java | 187 - .../modellibs/core/mappingrules/UseInterface.java | 42 - .../qompass/modellibs/core/xtend/AMIPull.xtend | 34 - .../qompass/modellibs/core/xtend/AsyncCalls.xtend | 57 - .../qompass/modellibs/core/xtend/BehaviorUtil.java | 111 - .../qompass/modellibs/core/xtend/CppUtils.xtend | 81 - .../qompass/modellibs/core/xtend/FIFO.xtend | 13 - .../modellibs/core/xtend/GlobalConstants.xtend | 56 - .../qompass/modellibs/core/xtend/Marshalling.xtend | 51 - .../modellibs/core/xtend/MultipleReceptacle.xtend | 14 - .../modellibs/core/xtend/StateMachineGen.xtend | 412 - .../modellibs/core/xtend/StateMachineUtil.java | 260 - .../core/xtend/StructBasedMarshalling.xtend | 25 - .../qompass/modellibs/core/xtend/SyncCalls.xtend | 13 - .../qompass/modellibs/core/xtend/UMLAction.xtend | 58 - .../qompass/modellibs/core/xtend/UMLChain.xtend | 91 - .../modellibs/core/xtend/UMLFlatModel2Cpp.xtend | 667 - .../modellibs/core/xtend/UMLFlattener.xtend | 556 - .../xtend-gen/.gitignore | 2 - .../.classpath | 7 - .../.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 30 - .../about.html | 28 - .../build.properties | 13 - .../icons/etool16/brkp_16x16.gif | Bin 197 -> 0 bytes .../icons/etool16/brkp_9x9.gif | Bin 179 -> 0 bytes .../icons/etool16/brkp_grp.gif | Bin 361 -> 0 bytes .../icons/etool16/brkp_grp_disabled.gif | Bin 173 -> 0 bytes .../icons/etool16/brkpd_16x16.gif | Bin 139 -> 0 bytes .../icons/etool16/brkpd_9x9.gif | Bin 123 -> 0 bytes .../icons/etool16/debug.gif | Bin 348 -> 0 bytes .../icons/etool16/properties.gif | Bin 577 -> 0 bytes .../icons/etool16/trcp_11x12.gif | Bin 313 -> 0 bytes .../icons/etool16/trcp_16x16.gif | Bin 348 -> 0 bytes .../icons/etool16/trcpd_11x12.gif | Bin 302 -> 0 bytes .../icons/etool16/trcpd_16x16.gif | Bin 316 -> 0 bytes .../plugin.properties | 12 - .../plugin.xml | 193 - .../pom.xml | 14 - .../schema/traceMechanism.exsd | 109 - .../infra/services/tracepoints/Activator.java | 90 - .../services/tracepoints/ITraceMechanism.java | 74 - .../infra/services/tracepoints/MarkerUtils.java | 84 - .../infra/services/tracepoints/Messages.java | 30 - .../infra/services/tracepoints/TraceActions.java | 206 - .../infra/services/tracepoints/TraceFunctions.java | 125 - .../infra/services/tracepoints/TraceMechanism.java | 88 - .../infra/services/tracepoints/TraceState.java | 20 - .../services/tracepoints/TracepointConstants.java | 35 - .../commands/AbstractTracepointCommand.java | 167 - .../ToggleBreakpointActivationCommand.java | 40 - .../commands/ToggleBreakpointCommand.java | 41 - .../ToggleTracepointActivationCommand.java | 41 - .../commands/ToggleTracepointCommand.java | 54 - .../commands/TracepointPropertiesCommand.java | 82 - .../tracepoints/dialogs/TraceActionSelection.java | 304 - .../handler/AbstractCommandHandler.java | 166 - .../handler/ToggleBreakpointActivationHandler.java | 33 - .../handler/ToggleBreakpointHandler.java | 33 - .../handler/ToggleTracepointActivationHandler.java | 33 - .../handler/ToggleTracepointHandler.java | 33 - .../handler/TracepointPropertiesHandler.java | 33 - .../infra/services/tracepoints/messages.properties | 15 - .../BinaryEncodedMChoiceFieldEditor.java | 134 - .../preferences/MultipleChoiceFieldEditor.java | 235 - .../preferences/TPPreferenceConstants.java | 51 - .../preferences/TPPreferenceInitializer.java | 54 - .../tracepoints/preferences/TPPreferencePage.java | 108 - .../.classpath | 8 - .../.gitignore | 1 - .../.project | 47 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 28 - .../about.html | 28 - .../build.acceleo | 26 - .../build.properties | 14 - .../help/tocconcepts.xml | 7 - .../html/images/image001.gif | Bin 2182 -> 0 bytes .../html/images/image002.gif | Bin 2123 -> 0 bytes .../html/images/image003.gif | Bin 1323 -> 0 bytes .../html/images/image004.jpg | Bin 3340 -> 0 bytes .../html/images/image005.jpg | Bin 36908 -> 0 bytes .../html/images/image006.jpg | Bin 4937 -> 0 bytes .../html/images/image007.gif | Bin 21539 -> 0 bytes .../html/images/image008.jpg | Bin 44181 -> 0 bytes .../html/images/image009.jpg | Bin 43754 -> 0 bytes .../html/userguide.htm | 213 - .../models/examples/ClientServerTraceTest.di | 76 - .../models/examples/ClientServerTraceTest.notation | 1600 -- .../models/examples/ClientServerTraceTest.uml | 398 - .../models/examples/ProducerConsumer.di | 53 - .../models/examples/ProducerConsumer.notation | 1090 - .../models/examples/ProducerConsumer.uml | 457 - .../models/examples/SampleOOTraceTest.di | 46 - .../models/examples/SampleOOTraceTest.notation | 410 - .../models/examples/SampleOOTraceTest.uml | 276 - .../models/library/tracing.di | 52 - .../models/library/tracing.notation | 1684 -- .../models/library/tracing.uml | 750 - .../plugin.properties | 12 - .../plugin.xml | 75 - .../pom.xml | 55 - .../qompass/modellibs/tracing/Activator.java | 53 - .../tracing/ClientServerTraceTestModelWizard.java | 14 - .../modellibs/tracing/IConfiguratorOTF.java | 59 - .../modellibs/tracing/IConfiguratorTrace.java | 45 - .../modellibs/tracing/QompassTraceMechanism.java | 188 - .../qompass/modellibs/tracing/StringConstants.java | 5 - .../modellibs/tracing/acceleo/TraceCout.xtend | 18 - .../modellibs/tracing/acceleo/TraceLTTng.xtend | 198 - .../modellibs/tracing/acceleo/TraceOTF.xtend | 33 - .../modellibs/tracing/acceleo/TraceUtils.java | 45 - .../xtend-gen/.gitignore | 2 - .../.classpath | 7 - .../org.eclipse.papyrus.views.tracepoints/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 7 - .../META-INF/MANIFEST.MF | 25 - .../about.html | 28 - .../build.properties | 9 - .../icons/breakpoint_view.gif | Bin 204 -> 0 bytes .../icons/gotoobj_tsk.gif | Bin 372 -> 0 bytes .../icons/skip_brkp.gif | Bin 204 -> 0 bytes .../plugin.properties | 12 - .../plugin.xml | 15 - .../org.eclipse.papyrus.views.tracepoints/pom.xml | 14 - .../papyrus/views/tracepoints/Activator.java | 80 - .../views/tracepoints/views/TraceViewImages.java | 44 - .../views/tracepoints/views/TracepointView.java | 540 - .../org.eclipse.papyrus.cpp.cdtproject/.classpath | 7 + .../org.eclipse.papyrus.cpp.cdtproject/.project | 35 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 24 + .../org.eclipse.papyrus.cpp.cdtproject/about.html | 28 + .../build.properties | 8 + .../plugin.properties | 12 + .../org.eclipse.papyrus.cpp.cdtproject/plugin.xml | 18 + .../cpp/org.eclipse.papyrus.cpp.cdtproject/pom.xml | 14 + .../eclipse/papyrus/cpp/cdtproject/Activator.java | 54 + .../cpp/cdtproject/CCNamedProjectWizard.java | 47 + .../papyrus/cpp/cdtproject/CDTMainWizardPageV.java | 33 + .../papyrus/cpp/cdtproject/CDTSettings.java | 28 + .../cpp/cdtproject/CNamedProjectWizard.java | 47 + .../papyrus/cpp/cdtproject/CProjectSupport.java | 16 + .../cpp/cdtproject/C_CppProjectSupport.java | 225 + .../papyrus/cpp/cdtproject/CppProjectSupport.java | 17 + .../org.eclipse.papyrus.cpp.codegen.ui/.classpath | 7 + .../org.eclipse.papyrus.cpp.codegen.ui/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 26 + .../org.eclipse.papyrus.cpp.codegen.ui/about.html | 28 + .../build.properties | 9 + .../icons/codegen.gif | Bin 0 -> 114 bytes .../plugin.properties | 12 + .../org.eclipse.papyrus.cpp.codegen.ui/plugin.xml | 49 + .../cpp/org.eclipse.papyrus.cpp.codegen.ui/pom.xml | 14 + .../eclipse/papyrus/cpp/codegen/ui/Activator.java | 71 + .../cpp/codegen/ui/handlers/CDTprojectHandler.java | 83 + .../codegen/ui/handlers/GenerateCodeHandler.java | 123 + .../ui/preferences/CodegenPreferencePage.java | 117 + .../cpp/org.eclipse.papyrus.cpp.codegen/.classpath | 8 + .../cpp/org.eclipse.papyrus.cpp.codegen/.project | 52 + .../META-INF/MANIFEST.MF | 41 + .../cpp/org.eclipse.papyrus.cpp.codegen/about.html | 28 + .../org.eclipse.papyrus.cpp.codegen/build.acceleo | 26 + .../build.properties | 13 + .../plugin.properties | 12 + .../cpp/org.eclipse.papyrus.cpp.codegen/plugin.xml | 18 + .../cpp/org.eclipse.papyrus.cpp.codegen/pom.xml | 56 + .../org/eclipse/papyrus/cpp/codegen/Activator.java | 68 + .../org/eclipse/papyrus/cpp/codegen/Constants.java | 46 + .../papyrus/cpp/codegen/CppLangCodegen.java | 138 + .../org/eclipse/papyrus/cpp/codegen/Messages.java | 27 + .../papyrus/cpp/codegen/messages.properties | 2 + .../codegen/preferences/CppCodeGenConstants.java | 41 + .../CppCodeGenPreferenceInitializer.java | 42 + .../cpp/codegen/preferences/CppCodeGenUtils.java | 53 + .../transformation/CppLocationStrategy.java | 30 + .../transformation/CppModelElementsCreator.java | 243 + .../papyrus/cpp/codegen/utils/ClassUtils.java | 81 + .../papyrus/cpp/codegen/utils/CppGenUtils.java | 351 + .../cpp/codegen/utils/ILocateCppProject.java | 36 + .../cpp/codegen/utils/LocateCppProject.java | 130 + .../papyrus/cpp/codegen/utils/Messages.java | 18 + .../papyrus/cpp/codegen/utils/Modifier.java | 189 + .../papyrus/cpp/codegen/utils/messages.properties | 4 + .../papyrus/cpp/codegen/xtend/CppAttribute.xtend | 92 + .../xtend/CppClassAttributesDeclaration.xtend | 26 + .../codegen/xtend/CppClassFriendDeclaration.xtend | 35 + .../xtend/CppClassIncludeClassDeclaration.xtend | 69 + .../codegen/xtend/CppClassIncludeDeclaration.xtend | 51 + .../xtend/CppClassInheritedDeclarations.xtend | 51 + .../xtend/CppClassOperationsDeclaration.xtend | 36 + .../xtend/CppClassOperationsImplementation.xtend | 44 + .../cpp/codegen/xtend/CppClassTypeAndEnum.xtend | 72 + .../cpp/codegen/xtend/CppClassifierGenerator.xtend | 253 + .../cpp/codegen/xtend/CppDocumentation.xtend | 49 + .../cpp/codegen/xtend/CppEnumerations.xtend | 33 + .../papyrus/cpp/codegen/xtend/CppIncludeUtil.xtend | 86 + .../cpp/codegen/xtend/CppInnerClassifiers.xtend | 58 + .../papyrus/cpp/codegen/xtend/CppOperations.xtend | 204 + .../codegen/xtend/CppPackageHeaderGenerator.xtend | 64 + .../papyrus/cpp/codegen/xtend/CppParameter.xtend | 62 + .../cpp/codegen/xtend/CppPrimitiveTypes.xtend | 49 + .../papyrus/cpp/codegen/xtend/CppTemplates.xtend | 58 + .../xtend-gen/.gitignore | 2 + .../org.eclipse.papyrus.cpp.examples/.classpath | 7 + .../cpp/org.eclipse.papyrus.cpp.examples/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 13 + .../org.eclipse.papyrus.cpp.examples/about.html | 28 + .../build.properties | 9 + .../models/examples/HelloWorldOO.di | 21 + .../models/examples/HelloWorldOO.notation | 176 + .../models/examples/HelloWorldOO.uml | 43 + .../plugin.properties | 12 + .../org.eclipse.papyrus.cpp.examples/plugin.xml | 15 + .../cpp/org.eclipse.papyrus.cpp.examples/pom.xml | 14 + .../eclipse/papyrus/cpp/examples/Activator.java | 54 + .../cpp/examples/HelloWorldOOModelWizard.java | 27 + .../org.eclipse.papyrus.cpp.library.ui/.classpath | 7 + .../org.eclipse.papyrus.cpp.library.ui/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 12 + .../org.eclipse.papyrus.cpp.library.ui/about.html | 28 + .../build.properties | 9 + .../icons/transfo_cpp.gif | Bin 0 -> 352 bytes .../plugin.properties | 12 + .../org.eclipse.papyrus.cpp.library.ui/plugin.xml | 13 + .../cpp/org.eclipse.papyrus.cpp.library.ui/pom.xml | 14 + .../eclipse/papyrus/cpp/library/ui/Activator.java | 50 + .../cpp/org.eclipse.papyrus.cpp.library/.classpath | 7 + .../cpp/org.eclipse.papyrus.cpp.library/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 14 + .../cpp/org.eclipse.papyrus.cpp.library/about.html | 28 + .../build.properties | 9 + .../models/AnsiCLibrary.di | 17 + .../models/AnsiCLibrary.notation | 348 + .../models/AnsiCLibrary.uml | 37 + .../plugin.properties | 12 + .../cpp/org.eclipse.papyrus.cpp.library/plugin.xml | 10 + .../cpp/org.eclipse.papyrus.cpp.library/pom.xml | 14 + .../org/eclipse/papyrus/cpp/library/Activator.java | 30 + .../org.eclipse.papyrus.cpp.profile.ui/.classpath | 7 + .../org.eclipse.papyrus.cpp.profile.ui/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 12 + .../org.eclipse.papyrus.cpp.profile.ui/about.html | 28 + .../build.properties | 9 + .../icons/transfo_cpp.gif | Bin 0 -> 352 bytes .../plugin.properties | 12 + .../org.eclipse.papyrus.cpp.profile.ui/plugin.xml | 13 + .../cpp/org.eclipse.papyrus.cpp.profile.ui/pom.xml | 14 + .../eclipse/papyrus/cpp/profile/ui/Activator.java | 50 + .../cpp/org.eclipse.papyrus.cpp.profile/.classpath | 7 + .../cpp/org.eclipse.papyrus.cpp.profile/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 18 + .../cpp/org.eclipse.papyrus.cpp.profile/about.html | 28 + .../build.properties | 10 + .../libraries/AnsiCLibrary.di | 17 + .../libraries/AnsiCLibrary.notation | 348 + .../libraries/AnsiCLibrary.uml | 37 + .../plugin.properties | 12 + .../cpp/org.eclipse.papyrus.cpp.profile/plugin.xml | 32 + .../cpp/org.eclipse.papyrus.cpp.profile/pom.xml | 14 + .../profiles/C_Cpp.ecore | 205 + .../profiles/C_Cpp.genmodel | 196 + .../profiles/C_Cpp.profile.di | 41 + .../profiles/C_Cpp.profile.notation | 1835 ++ .../profiles/C_Cpp.profile.uml | 529 + .../profiles/PapyrusC.profile.di | 38 + .../profiles/PapyrusC.profile.notation | 650 + .../profiles/PapyrusC.profile.uml | 4143 ++++ .../src/org/eclipse/papyrus/C_Cpp/Array.java | 140 + .../org/eclipse/papyrus/C_Cpp/C_CppFactory.java | 268 + .../org/eclipse/papyrus/C_Cpp/C_CppPackage.java | 2980 +++ .../src/org/eclipse/papyrus/C_Cpp/Const.java | 114 + .../src/org/eclipse/papyrus/C_Cpp/ConstInit.java | 86 + .../src/org/eclipse/papyrus/C_Cpp/CppInit.java | 86 + .../src/org/eclipse/papyrus/C_Cpp/CppRoot.java | 63 + .../src/org/eclipse/papyrus/C_Cpp/EAccessKind.java | 251 + .../org/eclipse/papyrus/C_Cpp/EStorageClass.java | 251 + .../org/eclipse/papyrus/C_Cpp/ExternLibrary.java | 144 + .../src/org/eclipse/papyrus/C_Cpp/External.java | 86 + .../src/org/eclipse/papyrus/C_Cpp/Friend.java | 87 + .../src/org/eclipse/papyrus/C_Cpp/Include.java | 200 + .../src/org/eclipse/papyrus/C_Cpp/Inline.java | 60 + .../eclipse/papyrus/C_Cpp/ManualGeneration.java | 89 + .../src/org/eclipse/papyrus/C_Cpp/Mutable.java | 52 + .../src/org/eclipse/papyrus/C_Cpp/NoCodeGen.java | 64 + .../src/org/eclipse/papyrus/C_Cpp/Ptr.java | 117 + .../src/org/eclipse/papyrus/C_Cpp/Ref.java | 87 + .../org/eclipse/papyrus/C_Cpp/StorageClass.java | 118 + .../src/org/eclipse/papyrus/C_Cpp/Template.java | 85 + .../org/eclipse/papyrus/C_Cpp/TemplateBinding.java | 85 + .../eclipse/papyrus/C_Cpp/TemplateParameter.java | 85 + .../src/org/eclipse/papyrus/C_Cpp/Typedef.java | 86 + .../src/org/eclipse/papyrus/C_Cpp/Union.java | 60 + .../src/org/eclipse/papyrus/C_Cpp/Variadic.java | 52 + .../src/org/eclipse/papyrus/C_Cpp/Virtual.java | 60 + .../src/org/eclipse/papyrus/C_Cpp/Visibility.java | 86 + .../org/eclipse/papyrus/C_Cpp/VisibilityKind.java | 251 + .../src/org/eclipse/papyrus/C_Cpp/Volatile.java | 104 + .../org/eclipse/papyrus/C_Cpp/impl/ArrayImpl.java | 362 + .../papyrus/C_Cpp/impl/C_CppFactoryImpl.java | 518 + .../papyrus/C_Cpp/impl/C_CppPackageImpl.java | 1464 ++ .../org/eclipse/papyrus/C_Cpp/impl/ConstImpl.java | 292 + .../eclipse/papyrus/C_Cpp/impl/ConstInitImpl.java | 236 + .../eclipse/papyrus/C_Cpp/impl/CppInitImpl.java | 236 + .../eclipse/papyrus/C_Cpp/impl/CppRootImpl.java | 165 + .../papyrus/C_Cpp/impl/ExternLibraryImpl.java | 370 + .../eclipse/papyrus/C_Cpp/impl/ExternalImpl.java | 236 + .../org/eclipse/papyrus/C_Cpp/impl/FriendImpl.java | 229 + .../eclipse/papyrus/C_Cpp/impl/IncludeImpl.java | 468 + .../org/eclipse/papyrus/C_Cpp/impl/InlineImpl.java | 166 + .../papyrus/C_Cpp/impl/ManualGenerationImpl.java | 235 + .../eclipse/papyrus/C_Cpp/impl/MutableImpl.java | 157 + .../eclipse/papyrus/C_Cpp/impl/NoCodeGenImpl.java | 166 + .../org/eclipse/papyrus/C_Cpp/impl/PtrImpl.java | 299 + .../org/eclipse/papyrus/C_Cpp/impl/RefImpl.java | 229 + .../papyrus/C_Cpp/impl/StorageClassImpl.java | 296 + .../papyrus/C_Cpp/impl/TemplateBindingImpl.java | 235 + .../eclipse/papyrus/C_Cpp/impl/TemplateImpl.java | 235 + .../papyrus/C_Cpp/impl/TemplateParameterImpl.java | 235 + .../eclipse/papyrus/C_Cpp/impl/TypedefImpl.java | 236 + .../org/eclipse/papyrus/C_Cpp/impl/UnionImpl.java | 166 + .../eclipse/papyrus/C_Cpp/impl/VariadicImpl.java | 157 + .../eclipse/papyrus/C_Cpp/impl/VirtualImpl.java | 166 + .../eclipse/papyrus/C_Cpp/impl/VisibilityImpl.java | 236 + .../eclipse/papyrus/C_Cpp/impl/VolatileImpl.java | 291 + .../papyrus/C_Cpp/util/C_CppAdapterFactory.java | 584 + .../C_Cpp/util/C_CppResourceFactoryImpl.java | 50 + .../papyrus/C_Cpp/util/C_CppResourceImpl.java | 37 + .../eclipse/papyrus/C_Cpp/util/C_CppSwitch.java | 646 + .../papyrus/C_Cpp/util/C_CppXMLProcessor.java | 57 + .../org/eclipse/papyrus/cpp/profile/Activator.java | 30 + .../cpp/org.eclipse.papyrus.cpp.test/.cproject | 114 + .../cpp/org.eclipse.papyrus.cpp.test/.gitignore | 2 + .../cpp/org.eclipse.papyrus.cpp.test/.project | 83 + .../model/TestCCodeGen.di | 29 + .../model/TestCCodeGen.notation | 151 + .../model/TestCCodeGen.uml | 187 + .../model/TestCDTintegration.di | 32 + .../model/TestCDTintegration.notation | 283 + .../model/TestCDTintegration.uml | 182 + .../org.eclipse.papyrus.texteditor.cdt/.classpath | 7 + .../org.eclipse.papyrus.texteditor.cdt/.project | 28 + .../META-INF/MANIFEST.MF | 35 + .../org.eclipse.papyrus.texteditor.cdt/about.html | 28 + .../build.properties | 10 + .../icons/texteditor.gif | Bin 0 -> 133 bytes .../icons/texteditor.xcf | Bin 0 -> 888 bytes .../plugin.properties | 14 + .../org.eclipse.papyrus.texteditor.cdt/plugin.xml | 49 + .../cpp/org.eclipse.papyrus.texteditor.cdt/pom.xml | 14 + .../eclipse/papyrus/texteditor/cdt/Activator.java | 71 + .../cdt/AddProfileAndModelLibsHandler.java | 144 + .../papyrus/texteditor/cdt/CommandSupport.java | 75 + .../texteditor/cdt/TextEditorConstants.java | 23 + .../org/eclipse/papyrus/texteditor/cdt/Utils.java | 187 + .../cdt/editor/DelegatingSourceViewer.java | 400 + .../texteditor/cdt/editor/PapyrusCDTEditor.java | 395 + .../cdt/factory/PapyrusCDTEditorFactory.java | 210 + .../cdt/handler/PapyrusCDTEditorHandler.java | 308 + .../texteditor/cdt/listener/ChangeKind.java | 7 + .../papyrus/texteditor/cdt/listener/Closure.java | 81 + .../texteditor/cdt/listener/ModelListener.java | 135 + .../cdt/listener/OperationHistoryListener.java | 76 + .../TextEditorModelSharedResource.java | 120 + .../cdt/preferences/CDTPreferenceConstants.java | 33 + .../cdt/preferences/CDTPreferenceInitializer.java | 39 + .../cdt/preferences/CDTPreferencePage.java | 64 + .../texteditor/cdt/sync/FindTransition.java | 47 + .../texteditor/cdt/sync/ObtainICElement.java | 129 + .../texteditor/cdt/sync/ParameterModifiers.java | 45 + .../cdt/sync/RevealCurrentOperation.java | 128 + .../texteditor/cdt/sync/SyncCDTtoModel.java | 635 + .../texteditor/cdt/sync/SyncModelToCDT.java | 80 + .../cpp/org.eclipse.papyrus.views.cpp/.classpath | 7 + .../cpp/org.eclipse.papyrus.views.cpp/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 34 + .../cpp/org.eclipse.papyrus.views.cpp/about.html | 28 + .../cpp/org.eclipse.papyrus.views.cpp/about.ini | 17 + .../org.eclipse.papyrus.views.cpp/build.properties | 10 + .../plugin.properties | 12 + .../cpp/org.eclipse.papyrus.views.cpp/plugin.xml | 13 + .../cpp/org.eclipse.papyrus.views.cpp/pom.xml | 14 + .../resources/icons/Papyrus_32x32.gif | Bin 0 -> 518 bytes .../resources/icons/save_edit.gif | Bin 0 -> 639 bytes .../resources/icons/transfo_cpp.gif | Bin 0 -> 352 bytes .../resources/icons/transfo_cpp_old.gif | Bin 0 -> 630 bytes .../resources/icons/undo_edit.gif | Bin 0 -> 355 bytes .../papyrus/views/cpp/AbstractCppPanelView.java | 107 + .../org/eclipse/papyrus/views/cpp/Activator.java | 160 + .../eclipse/papyrus/views/cpp/Activator.properties | 96 + .../eclipse/papyrus/views/cpp/CommandSupport.java | 81 + .../eclipse/papyrus/views/cpp/CppPanelView.java | 91 + .../views/listeners/UMLElementPanelListener.java | 90 + .../papyrus/views/panels/CppAbstractPanel.java | 447 + .../papyrus/views/panels/CppBehaviorPanel.java | 275 + .../papyrus/views/panels/CppClassPanel.java | 225 + .../papyrus/views/panels/CppDefaultPanel.java | 104 + .../views/panels/CppGeneralizationPanel.java | 268 + .../papyrus/views/panels/CppOperationPanel.java | 647 + .../papyrus/views/panels/CppPackagePanel.java | 183 + .../papyrus/views/panels/CppParameterPanel.java | 346 + .../views/panels/CppPrimitiveTypePanel.java | 167 + .../papyrus/views/panels/CppPropertyPanel.java | 384 + .../views/panels/CppTemplateBindingPanel.java | 178 + .../views/panels/CppTemplateParameterPanel.java | 181 + .../eclipse/papyrus/views/panels/PanelFactory.java | 144 + .../org.eclipse.papyrus.java-updatesite/.project | 17 + .../org.eclipse.papyrus.java-updatesite/site.xml | 29 + .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 19 + .../about.html | 28 + .../build.properties | 8 + .../icons/generate.psd | Bin 0 -> 182989 bytes .../icons/generation.png | Bin 0 -> 3683 bytes .../icons/sample.gif | Bin 0 -> 983 bytes .../plugin.properties | 18 + .../pom.xml | 14 + .../jdtsynchronizer/GeneratorPreference.java | 77 + .../generator/jdtsynchronizer/RunGenerator.java | 228 + .../jdtsynchronizer/impl/SynchJDTCommentable.java | 161 + .../impl/SynchJDTCompilationUnit.java | 95 + .../jdtsynchronizer/impl/SynchJDTField.java | 217 + .../jdtsynchronizer/impl/SynchJDTGetterSetter.java | 168 + .../jdtsynchronizer/impl/SynchJDTJavaModel.java | 73 + .../jdtsynchronizer/impl/SynchJDTJavaProject.java | 145 + .../jdtsynchronizer/impl/SynchJDTMethod.java | 387 + .../impl/SynchJDTPackageFragment.java | 112 + .../impl/SynchJDTPackageFragmentRoot.java | 120 + .../jdtsynchronizer/impl/SynchJDTType.java | 435 + .../generator/jdtsynchronizer/impl/SynchTools.java | 325 + .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 18 + .../about.html | 28 + .../build.properties | 12 + .../CreateJDTCompilationUnit_types_JDTClass.gif | Bin 0 -> 223 bytes .../CreateJDTCompilationUnit_types_JDTEnum.gif | Bin 0 -> 223 bytes ...CreateJDTCompilationUnit_types_JDTInterface.gif | Bin 0 -> 223 bytes .../CreateJDTCompilationUnit_types_JDTType.gif | Bin 0 -> 223 bytes ...eateJDTJavaModel_javaProject_JDTJavaProject.gif | Bin 0 -> 223 bytes ...packageFragmentRoots_JDTPackageFragmentRoot.gif | Bin 0 -> 223 bytes ...teJDTMember_typeParameters_JDTTypeParameter.gif | Bin 0 -> 223 bytes .../CreateJDTMethod_bodies_JDTOpaqueBody.gif | Bin 0 -> 223 bytes .../CreateJDTMethod_bodies_OpaqueMethodBody.gif | Bin 0 -> 223 bytes .../CreateJDTMethod_parameters_JDTParameter.gif | Bin 0 -> 223 bytes .../CreateJDTMethod_returnType_JDTParameter.gif | Bin 0 -> 223 bytes ...entRoot_packageFragments_JDTPackageFragment.gif | Bin 0 -> 223 bytes ...ragment_compilationUnits_JDTCompilationUnit.gif | Bin 0 -> 223 bytes ...ragment_packageFragments_JDTPackageFragment.gif | Bin 0 -> 223 bytes .../full/ctool16/CreateJDTType_fields_JDTField.gif | Bin 0 -> 223 bytes .../ctool16/CreateJDTType_methods_JDTMethod.gif | Bin 0 -> 223 bytes .../full/ctool16/CreateJDTType_types_JDTClass.gif | Bin 0 -> 223 bytes .../full/ctool16/CreateJDTType_types_JDTEnum.gif | Bin 0 -> 223 bytes .../ctool16/CreateJDTType_types_JDTInterface.gif | Bin 0 -> 223 bytes .../full/ctool16/CreateJDTType_types_JDTType.gif | Bin 0 -> 223 bytes .../icons/full/obj16/JDTClass.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTCompilationUnit.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTEnum.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTException.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTField.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTImportContainer.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTImportDeclaration.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTInterface.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTJavaElement.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTJavaModel.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTJavaProject.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTMethod.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTOpaqueBody.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTPackageFragment.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTPackageFragmentRoot.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTParameter.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JDTTypeParameter.gif | Bin 0 -> 129 bytes .../icons/full/obj16/OpaqueMethodBody.gif | Bin 0 -> 129 bytes .../icons/full/obj16/Options.gif | Bin 0 -> 129 bytes .../plugin.properties | 22 + .../plugin.xml | 22 + .../pom.xml | 14 + .../provider/GeneratoroptionsmmEditPlugin.java | 95 + ...neratoroptionsmmItemProviderAdapterFactory.java | 221 + .../provider/OptionsItemProvider.java | 164 + .../jdt/jdtmm/provider/JDTClassItemProvider.java | 135 + .../provider/JDTCompilationUnitItemProvider.java | 242 + .../jdt/jdtmm/provider/JDTEnumItemProvider.java | 135 + .../jdtmm/provider/JDTExceptionItemProvider.java | 145 + .../jdt/jdtmm/provider/JDTFieldItemProvider.java | 343 + .../provider/JDTImportContainerItemProvider.java | 135 + .../provider/JDTImportDeclarationItemProvider.java | 135 + .../jdtmm/provider/JDTInterfaceItemProvider.java | 135 + .../jdtmm/provider/JDTJavaElementItemProvider.java | 270 + .../jdtmm/provider/JDTJavaModelItemProvider.java | 181 + .../jdtmm/provider/JDTJavaProjectItemProvider.java | 232 + .../jdt/jdtmm/provider/JDTMemberItemProvider.java | 247 + .../jdtmm/provider/JDTMethodBodyItemProvider.java | 117 + .../jdt/jdtmm/provider/JDTMethodItemProvider.java | 371 + .../jdtmm/provider/JDTOpaqueBodyItemProvider.java | 153 + .../provider/JDTPackageFragmentItemProvider.java | 232 + .../JDTPackageFragmentRootItemProvider.java | 232 + .../jdtmm/provider/JDTParameterItemProvider.java | 218 + .../jdt/jdtmm/provider/JDTParentItemProvider.java | 193 + .../provider/JDTParentJavaElementItemProvider.java | 181 + .../jdt/jdtmm/provider/JDTTypeItemProvider.java | 508 + .../provider/JDTTypeParameterItemProvider.java | 135 + .../jdtmm/provider/JDTTypeRootItemProvider.java | 123 + .../jdt/jdtmm/provider/JdtmmEditPlugin.java | 115 + .../provider/JdtmmItemProviderAdapterFactory.java | 661 + .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 18 + .../about.html | 28 + .../build.properties | 12 + .../icons/full/obj16/JdtmmModelFile.gif | Bin 0 -> 346 bytes .../icons/full/wizban/NewJdtmm.gif | Bin 0 -> 2462 bytes .../plugin.properties | 53 + .../plugin.xml | 37 + .../pom.xml | 14 + .../GeneratoroptionsmmActionBarContributor.java | 441 + .../presentation/GeneratoroptionsmmEditor.java | 1884 ++ .../GeneratoroptionsmmEditorPlugin.java | 96 + .../GeneratoroptionsmmModelWizard.java | 636 + .../presentation/JdtmmActionBarContributor.java | 461 + .../jdt/jdtmm/presentation/JdtmmEditor.java | 1897 ++ .../jdt/jdtmm/presentation/JdtmmEditorPlugin.java | 116 + .../jdt/jdtmm/presentation/JdtmmModelWizard.java | 656 + .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 22 + .../about.html | 28 + .../build.properties | 16 + .../model/generatorOptions/generatoroptionsmm.di | 2 + .../generatorOptions/generatoroptionsmm.ecore | 12 + .../generatorOptions/generatoroptionsmm.genmodel | 40 + .../generatorOptions/generatoroptionsmm.notation | 36 + .../model/generatorOptions/generatoroptionsmm.uml | 17 + .../model/jdtmm.di | 53 + .../model/jdtmm.ecore | 243 + .../model/jdtmm.genmodel | 191 + .../model/jdtmm.notation | 3094 +++ .../model/jdtmm.uml | 481 + .../model/reverse/reverseJDT.di | 29 + .../model/reverse/reverseJDT.notation | 1614 ++ .../model/reverse/reverseJDT.uml | 20911 +++++++++++++++++++ .../plugin.properties | 19 + .../plugin.xml | 28 + .../pom.xml | 14 + .../GeneratoroptionsmmFactory.java | 57 + .../GeneratoroptionsmmPackage.java | 187 + .../metamodel/jdt/generatoroptionsmm/Options.java | 63 + .../impl/GeneratoroptionsmmFactoryImpl.java | 114 + .../impl/GeneratoroptionsmmPackageImpl.java | 229 + .../jdt/generatoroptionsmm/impl/OptionsImpl.java | 187 + .../util/GeneratoroptionsmmAdapterFactory.java | 139 + .../util/GeneratoroptionsmmSwitch.java | 131 + .../generator/metamodel/jdt/jdtmm/JDTClass.java | 37 + .../metamodel/jdt/jdtmm/JDTCompilationUnit.java | 106 + .../generator/metamodel/jdt/jdtmm/JDTEnum.java | 37 + .../metamodel/jdt/jdtmm/JDTException.java | 38 + .../generator/metamodel/jdt/jdtmm/JDTField.java | 322 + .../metamodel/jdt/jdtmm/JDTImportContainer.java | 37 + .../metamodel/jdt/jdtmm/JDTImportDeclaration.java | 37 + .../metamodel/jdt/jdtmm/JDTInterface.java | 37 + .../metamodel/jdt/jdtmm/JDTJavaElement.java | 207 + .../metamodel/jdt/jdtmm/JDTJavaModel.java | 63 + .../metamodel/jdt/jdtmm/JDTJavaProject.java | 100 + .../generator/metamodel/jdt/jdtmm/JDTMember.java | 130 + .../generator/metamodel/jdt/jdtmm/JDTMethod.java | 316 + .../metamodel/jdt/jdtmm/JDTMethodBody.java | 71 + .../metamodel/jdt/jdtmm/JDTOpaqueBody.java | 55 + .../metamodel/jdt/jdtmm/JDTPackageFragment.java | 106 + .../jdt/jdtmm/JDTPackageFragmentRoot.java | 106 + .../metamodel/jdt/jdtmm/JDTParameter.java | 193 + .../generator/metamodel/jdt/jdtmm/JDTParent.java | 111 + .../metamodel/jdt/jdtmm/JDTParentJavaElement.java | 37 + .../generator/metamodel/jdt/jdtmm/JDTType.java | 452 + .../metamodel/jdt/jdtmm/JDTTypeParameter.java | 74 + .../generator/metamodel/jdt/jdtmm/JDTTypeRoot.java | 37 + .../metamodel/jdt/jdtmm/JdtmmFactory.java | 217 + .../metamodel/jdt/jdtmm/JdtmmPackage.java | 5215 +++++ .../metamodel/jdt/jdtmm/TrueFalseDefault.java | 278 + .../metamodel/jdt/jdtmm/VisibilityKind.java | 278 + .../metamodel/jdt/jdtmm/impl/JDTClassImpl.java | 61 + .../jdt/jdtmm/impl/JDTCompilationUnitImpl.java | 375 + .../metamodel/jdt/jdtmm/impl/JDTEnumImpl.java | 61 + .../metamodel/jdt/jdtmm/impl/JDTExceptionImpl.java | 62 + .../metamodel/jdt/jdtmm/impl/JDTFieldImpl.java | 749 + .../jdt/jdtmm/impl/JDTImportContainerImpl.java | 61 + .../jdt/jdtmm/impl/JDTImportDeclarationImpl.java | 61 + .../metamodel/jdt/jdtmm/impl/JDTInterfaceImpl.java | 61 + .../jdt/jdtmm/impl/JDTJavaElementImpl.java | 453 + .../metamodel/jdt/jdtmm/impl/JDTJavaModelImpl.java | 193 + .../jdt/jdtmm/impl/JDTJavaProjectImpl.java | 333 + .../metamodel/jdt/jdtmm/impl/JDTMemberImpl.java | 363 + .../jdt/jdtmm/impl/JDTMethodBodyImpl.java | 232 + .../metamodel/jdt/jdtmm/impl/JDTMethodImpl.java | 779 + .../jdt/jdtmm/impl/JDTOpaqueBodyImpl.java | 191 + .../jdt/jdtmm/impl/JDTPackageFragmentImpl.java | 376 + .../jdt/jdtmm/impl/JDTPackageFragmentRootImpl.java | 376 + .../metamodel/jdt/jdtmm/impl/JDTParameterImpl.java | 515 + .../metamodel/jdt/jdtmm/impl/JDTParentImpl.java | 254 + .../jdt/jdtmm/impl/JDTParentJavaElementImpl.java | 296 + .../metamodel/jdt/jdtmm/impl/JDTTypeImpl.java | 1117 + .../jdt/jdtmm/impl/JDTTypeParameterImpl.java | 235 + .../metamodel/jdt/jdtmm/impl/JDTTypeRootImpl.java | 61 + .../metamodel/jdt/jdtmm/impl/JdtmmFactoryImpl.java | 558 + .../metamodel/jdt/jdtmm/impl/JdtmmPackageImpl.java | 1905 ++ .../jdt/jdtmm/util/JdtmmAdapterFactory.java | 595 + .../metamodel/jdt/jdtmm/util/JdtmmPreference.java | 58 + .../metamodel/jdt/jdtmm/util/JdtmmSwitch.java | 880 + .../metamodel/jdt/jdtmm/visitor/JDTVisitor.java | 39 + .../jdt/jdtmm/visitor/JDTVisitorException.java | 42 + .../metamodel/jdt/utils/DerivedNotifyingEList.java | 442 + .../.classpath | 7 + .../.project | 38 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 10 + .../about.html | 28 + .../build.properties | 8 + .../doc/rulesInheritance.di | 23 + .../doc/rulesInheritance.notation | 775 + .../doc/rulesInheritance.uml | 55 + .../plugin.properties | 19 + .../pom.xml | 14 + .../transfo/umltojdt/UmltojdtActivator.java | 71 + .../transforms/uml/algo.txt | 167 + .../transforms/uml/stereotypeUtil.qvto | 99 + .../transforms/uml/uml2jdt2.qvto | 1269 ++ .../.classpath | 7 + .../org.eclipse.papyrus.java.generator.ui/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 21 + .../about.html | 28 + .../build.properties | 9 + .../icons/generate.psd | Bin 0 -> 182989 bytes .../icons/generation.png | Bin 0 -> 3683 bytes .../icons/sample.gif | Bin 0 -> 983 bytes .../plugin.properties | 19 + .../plugin.xml | 88 + .../org.eclipse.papyrus.java.generator.ui/pom.xml | 14 + .../papyrus/java/generator/ui/Activator.java | 70 + .../ui/handlers/GenerateJavaCodeHandler.java | 246 + .../ui/preference/GeneratorPreferenceImpl.java | 103 + .../ui/preference/GenericClassFieldEditor.java | 69 + .../generator/ui/preference/PackageListEditor.java | 87 + .../ui/preference/PreferenceConstants.java | 41 + .../ui/preference/PreferenceInitializer.java | 47 + .../generator/ui/preference/PreferencePage.java | 109 + .../.classpath | 7 + .../org.eclipse.papyrus.java.profile.edit/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 15 + .../about.html | 28 + .../build.properties | 16 + .../icons/full/obj16/JavaClass.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JavaMethod.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JavaPackage_.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JavaParameter.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JavaProject.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JavaProperty.gif | Bin 0 -> 129 bytes .../icons/full/obj16/JavaSrcFolder.gif | Bin 0 -> 129 bytes .../icons/full/obj16/PrimitiveType.gif | Bin 0 -> 129 bytes .../plugin.properties | 86 + .../plugin.xml | 25 + .../org.eclipse.papyrus.java.profile.edit/pom.xml | 14 + .../java/provider/JavaClassItemProvider.java | 276 + .../java/profile/java/provider/JavaEditPlugin.java | 103 + .../profile/java/provider/JavaGenItemProvider.java | 166 + .../provider/JavaItemProviderAdapterFactory.java | 421 + .../java/provider/JavaMethodItemProvider.java | 351 + .../provider/JavaNamedElementItemProvider.java | 255 + .../java/provider/JavaPackage_ItemProvider.java | 177 + .../java/provider/JavaParameterItemProvider.java | 177 + .../java/provider/JavaProjectItemProvider.java | 145 + .../java/provider/JavaPropertyItemProvider.java | 351 + .../java/provider/JavaSrcFolderItemProvider.java | 145 + .../java/provider/PrimitiveTypeItemProvider.java | 202 + .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 17 + .../about.html | 28 + .../build.properties | 16 + .../icons/full/obj16/JavaModelFile.gif | Bin 0 -> 346 bytes .../icons/full/wizban/NewJava.gif | Bin 0 -> 2462 bytes .../plugin.properties | 65 + .../plugin.xml | 39 + .../pom.xml | 14 + .../presentation/JavaActionBarContributor.java | 445 + .../java/profile/java/presentation/JavaEditor.java | 1885 ++ .../java/presentation/JavaEditorPlugin.java | 104 + .../profile/java/presentation/JavaModelWizard.java | 640 + .../org.eclipse.papyrus.java.profile/.classpath | 7 + .../java/org.eclipse.papyrus.java.profile/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 17 + .../org.eclipse.papyrus.java.profile/about.html | 28 + .../build.properties | 17 + .../icons/javaprofile.gif | Bin 0 -> 983 bytes .../models/java.ecore | 112 + .../models/java.profile.di | 29 + .../models/java.profile.genmodel | 105 + .../models/java.profile.notation | 821 + .../models/java.profile.uml | 5729 +++++ .../plugin.properties | 16 + .../org.eclipse.papyrus.java.profile/plugin.xml | 50 + .../java/org.eclipse.papyrus.java.profile/pom.xml | 14 + .../papyrus/java/profile/java/JavaClass.java | 209 + .../papyrus/java/profile/java/JavaFactory.java | 120 + .../eclipse/papyrus/java/profile/java/JavaGen.java | 84 + .../papyrus/java/profile/java/JavaMethod.java | 297 + .../java/profile/java/JavaNamedElement.java | 173 + .../papyrus/java/profile/java/JavaPackage.java | 2348 +++ .../papyrus/java/profile/java/JavaPackage_.java | 84 + .../papyrus/java/profile/java/JavaParameter.java | 85 + .../papyrus/java/profile/java/JavaProject.java | 55 + .../papyrus/java/profile/java/JavaProperty.java | 305 + .../papyrus/java/profile/java/JavaSrcFolder.java | 55 + .../papyrus/java/profile/java/PrimitiveType.java | 113 + .../java/profile/java/TrueFalseDefault.java | 262 + .../java/profile/java/impl/JavaClassImpl.java | 486 + .../java/profile/java/impl/JavaFactoryImpl.java | 270 + .../java/profile/java/impl/JavaGenImpl.java | 240 + .../java/profile/java/impl/JavaMethodImpl.java | 670 + .../profile/java/impl/JavaNamedElementImpl.java | 424 + .../java/profile/java/impl/JavaPackageImpl.java | 978 + .../java/profile/java/impl/JavaPackage_Impl.java | 250 + .../java/profile/java/impl/JavaParameterImpl.java | 251 + .../java/profile/java/impl/JavaProjectImpl.java | 172 + .../java/profile/java/impl/JavaPropertyImpl.java | 671 + .../java/profile/java/impl/JavaSrcFolderImpl.java | 172 + .../java/profile/java/impl/PrimitiveTypeImpl.java | 311 + .../java/profile/java/util/JavaAdapterFactory.java | 321 + .../profile/java/util/JavaResourceFactoryImpl.java | 56 + .../java/profile/java/util/JavaResourceImpl.java | 34 + .../papyrus/java/profile/java/util/JavaSwitch.java | 400 + .../java/profile/java/util/JavaXMLProcessor.java | 54 + .../org.eclipse.papyrus.java.reverse.ui/.classpath | 7 + .../org.eclipse.papyrus.java.reverse.ui/.project | 28 + .../.settings/org.eclipse.core.resources.prefs | 3 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 21 + .../org.eclipse.papyrus.java.reverse.ui/about.html | 28 + .../build.properties | 11 + .../icons/associationFromProperty.gif | Bin 0 -> 96 bytes .../icons/javaReverse.gif | Bin 0 -> 152 bytes .../plugin.properties | 16 + .../org.eclipse.papyrus.java.reverse.ui/plugin.xml | 154 + .../org.eclipse.papyrus.java.reverse.ui/pom.xml | 14 + .../eclipse/papyrus/java/reverse/ui/Activator.java | 54 + .../papyrus/java/reverse/ui/DisplayReverse.java | 181 + .../java/reverse/ui/DndReverseCodeHandler.java | 246 + .../papyrus/java/reverse/ui/JavaCodeReverse.java | 287 + .../eclipse/papyrus/java/reverse/ui/Messages.java | 19 + .../java/reverse/ui/ReverseCodeHandler.java | 196 + .../papyrus/java/reverse/ui/TreeSelectionList.java | 153 + .../reverse/ui/dialog/DndReverseCodeDialog.java | 93 + .../java/reverse/ui/dialog/InputListDialog.java | 332 + .../java/reverse/ui/dialog/ReverseCodeDialog.java | 281 + .../java/reverse/ui/dnd/DropReverseCommand.java | 103 + .../java/reverse/ui/dnd/DropReverseStrategy.java | 60 + .../papyrus/java/reverse/ui/dnd/Messages.java | 19 + .../java/reverse/ui/dnd/messages.properties | 2 + .../CreateAssociationFromPropertyHandler.java | 286 + .../papyrus/java/reverse/ui/messages.properties | 2 + .../org.eclipse.papyrus.java.reverse/.classpath | 7 + .../java/org.eclipse.papyrus.java.reverse/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 17 + .../org.eclipse.papyrus.java.reverse/about.html | 28 + .../build.properties | 8 + .../plugin.properties | 16 + .../java/org.eclipse.papyrus.java.reverse/pom.xml | 14 + .../src/japa/parser/ASTParser.java | 10321 +++++++++ .../src/japa/parser/ASTParserConstants.java | 531 + .../src/japa/parser/ASTParserTokenManager.java | 2579 +++ .../src/japa/parser/JavaCharStream.java | 599 + .../src/japa/parser/JavaParser.java | 173 + .../src/japa/parser/ParseException.java | 216 + .../src/japa/parser/Token.java | 142 + .../src/japa/parser/TokenMgrError.java | 158 + .../src/japa/parser/ast/BlockComment.java | 55 + .../src/japa/parser/ast/Comment.java | 64 + .../src/japa/parser/ast/CompilationUnit.java | 177 + .../src/japa/parser/ast/ImportDeclaration.java | 133 + .../src/japa/parser/ast/LineComment.java | 55 + .../src/japa/parser/ast/Node.java | 191 + .../src/japa/parser/ast/PackageDeclaration.java | 114 + .../src/japa/parser/ast/TypeParameter.java | 114 + .../parser/ast/body/AnnotationDeclaration.java | 52 + .../ast/body/AnnotationMemberDeclaration.java | 97 + .../src/japa/parser/ast/body/BodyDeclaration.java | 63 + .../ast/body/ClassOrInterfaceDeclaration.java | 98 + .../parser/ast/body/ConstructorDeclaration.java | 121 + .../parser/ast/body/EmptyMemberDeclaration.java | 48 + .../japa/parser/ast/body/EmptyTypeDeclaration.java | 48 + .../parser/ast/body/EnumConstantDeclaration.java | 85 + .../src/japa/parser/ast/body/EnumDeclaration.java | 75 + .../src/japa/parser/ast/body/FieldDeclaration.java | 85 + .../parser/ast/body/InitializerDeclaration.java | 71 + .../src/japa/parser/ast/body/JavadocComment.java | 49 + .../japa/parser/ast/body/MethodDeclaration.java | 144 + .../src/japa/parser/ast/body/ModifierSet.java | 118 + .../src/japa/parser/ast/body/Parameter.java | 108 + .../src/japa/parser/ast/body/TypeDeclaration.java | 72 + .../japa/parser/ast/body/VariableDeclarator.java | 73 + .../japa/parser/ast/body/VariableDeclaratorId.java | 72 + .../src/japa/parser/ast/expr/AnnotationExpr.java | 36 + .../src/japa/parser/ast/expr/ArrayAccessExpr.java | 71 + .../japa/parser/ast/expr/ArrayCreationExpr.java | 106 + .../japa/parser/ast/expr/ArrayInitializerExpr.java | 62 + .../src/japa/parser/ast/expr/AssignExpr.java | 97 + .../src/japa/parser/ast/expr/BinaryExpr.java | 104 + .../japa/parser/ast/expr/BooleanLiteralExpr.java | 59 + .../src/japa/parser/ast/expr/CastExpr.java | 72 + .../src/japa/parser/ast/expr/CharLiteralExpr.java | 48 + .../src/japa/parser/ast/expr/ClassExpr.java | 61 + .../src/japa/parser/ast/expr/ConditionalExpr.java | 82 + .../japa/parser/ast/expr/DoubleLiteralExpr.java | 48 + .../src/japa/parser/ast/expr/EnclosedExpr.java | 60 + .../src/japa/parser/ast/expr/Expression.java | 38 + .../src/japa/parser/ast/expr/FieldAccessExpr.java | 85 + .../src/japa/parser/ast/expr/InstanceOfExpr.java | 72 + .../japa/parser/ast/expr/IntegerLiteralExpr.java | 54 + .../ast/expr/IntegerLiteralMinValueExpr.java | 50 + .../src/japa/parser/ast/expr/LiteralExpr.java | 35 + .../src/japa/parser/ast/expr/LongLiteralExpr.java | 55 + .../parser/ast/expr/LongLiteralMinValueExpr.java | 50 + .../japa/parser/ast/expr/MarkerAnnotationExpr.java | 60 + .../src/japa/parser/ast/expr/MemberValuePair.java | 72 + .../src/japa/parser/ast/expr/MethodCallExpr.java | 96 + .../src/japa/parser/ast/expr/NameExpr.java | 60 + .../japa/parser/ast/expr/NormalAnnotationExpr.java | 73 + .../src/japa/parser/ast/expr/NullLiteralExpr.java | 48 + .../japa/parser/ast/expr/ObjectCreationExpr.java | 109 + .../japa/parser/ast/expr/QualifiedNameExpr.java | 60 + .../ast/expr/SingleMemberAnnotationExpr.java | 71 + .../japa/parser/ast/expr/StringLiteralExpr.java | 59 + .../src/japa/parser/ast/expr/SuperExpr.java | 60 + .../src/japa/parser/ast/expr/ThisExpr.java | 60 + .../src/japa/parser/ast/expr/UnaryExpr.java | 82 + .../parser/ast/expr/VariableDeclarationExpr.java | 96 + .../src/japa/parser/ast/stmt/AssertStmt.java | 71 + .../src/japa/parser/ast/stmt/BlockStmt.java | 61 + .../src/japa/parser/ast/stmt/BreakStmt.java | 59 + .../src/japa/parser/ast/stmt/CatchClause.java | 72 + .../src/japa/parser/ast/stmt/ContinueStmt.java | 59 + .../src/japa/parser/ast/stmt/DoStmt.java | 71 + .../src/japa/parser/ast/stmt/EmptyStmt.java | 48 + .../stmt/ExplicitConstructorInvocationStmt.java | 96 + .../src/japa/parser/ast/stmt/ExpressionStmt.java | 60 + .../src/japa/parser/ast/stmt/ForStmt.java | 95 + .../src/japa/parser/ast/stmt/ForeachStmt.java | 83 + .../src/japa/parser/ast/stmt/IfStmt.java | 82 + .../src/japa/parser/ast/stmt/LabeledStmt.java | 70 + .../src/japa/parser/ast/stmt/ReturnStmt.java | 60 + .../src/japa/parser/ast/stmt/Statement.java | 38 + .../src/japa/parser/ast/stmt/SwitchEntryStmt.java | 73 + .../src/japa/parser/ast/stmt/SwitchStmt.java | 73 + .../src/japa/parser/ast/stmt/SynchronizedStmt.java | 72 + .../src/japa/parser/ast/stmt/ThrowStmt.java | 60 + .../src/japa/parser/ast/stmt/TryStmt.java | 83 + .../japa/parser/ast/stmt/TypeDeclarationStmt.java | 60 + .../src/japa/parser/ast/stmt/WhileStmt.java | 71 + .../japa/parser/ast/type/ClassOrInterfaceType.java | 83 + .../src/japa/parser/ast/type/PrimitiveType.java | 64 + .../src/japa/parser/ast/type/ReferenceType.java | 71 + .../src/japa/parser/ast/type/Type.java | 38 + .../src/japa/parser/ast/type/VoidType.java | 49 + .../src/japa/parser/ast/type/WildcardType.java | 72 + .../src/japa/parser/ast/visitor/DumpVisitor.java | 1387 ++ .../japa/parser/ast/visitor/GenericVisitor.java | 280 + .../parser/ast/visitor/GenericVisitorAdapter.java | 910 + .../src/japa/parser/ast/visitor/VoidVisitor.java | 280 + .../parser/ast/visitor/VoidVisitorAdapter.java | 828 + .../src/japa/parser/java_1_5.jj | 3006 +++ .../src/javagen/umlparser/ClassifierCatalog.java | 393 + .../javagen/umlparser/CompilationUnitAnalyser.java | 1245 ++ .../javagen/umlparser/CreationPackageCatalog.java | 639 + .../src/javagen/umlparser/CuPrinter.java | 72 + .../javagen/umlparser/GenericSwitchVisitor.java | 665 + .../src/javagen/umlparser/GenericTransformer.java | 269 + .../src/javagen/umlparser/ImportedTypeCatalog.java | 167 + .../src/javagen/umlparser/ModelManager.java | 103 + .../src/javagen/umlparser/QualifiedName.java | 48 + .../src/javagen/umlparser/SwitchVisitor.java | 661 + .../src/javagen/umlparser/TypeAnalyser.java | 219 + .../umlparser/TypeAnalyserAndTranslator.java | 151 + .../src/javagen/umlparser/UmlParser.java | 163 + .../src/javagen/umlparser/UmlUtils.java | 1054 + .../eclipse/papyrus/java/reverse/Activator.java | 54 + .../java/reverse/utils/TypeOperationsEnhanced.java | 184 + .../org.eclipse.papyrus.java.template/.classpath | 7 + .../org.eclipse.papyrus.java.template/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 16 + .../org.eclipse.papyrus.java.template/about.html | 26 + .../build.properties | 6 + .../org.eclipse.papyrus.java.template/plugin.xml | 11 + .../eclipse/papyrus/java/template/Activator.java | 63 + .../resolvers/BundleActivatorResolver.java | 110 + .../java/template/resolvers/RegisterResolver.java | 90 + .../org.eclipse.papyrus.codegen.base/.classpath | 7 + .../org.eclipse.papyrus.codegen.base/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 20 + .../org.eclipse.papyrus.codegen.base/about.html | 28 + .../build.properties | 8 + .../icons/codegen-16x16.gif | Bin 0 -> 101 bytes .../plugin.properties | 12 + .../org.eclipse.papyrus.codegen.base/pom.xml | 14 + .../eclipse/papyrus/codegen/base/Activator.java | 44 + .../org/eclipse/papyrus/codegen/base/GenUtils.java | 731 + .../codegen/base/HierarchyLocationStrategy.java | 46 + .../papyrus/codegen/base/ILocationStrategy.java | 14 + .../papyrus/codegen/base/IPFileSystemAccess.java | 33 + .../codegen/base/JavaIoFileSystemAccess.java | 136 + .../org/eclipse/papyrus/codegen/base/Messages.java | 15 + .../papyrus/codegen/base/ModelElementsCreator.java | 141 + .../codegen/base/ProjectBasedFileAccess.java | 158 + .../codegen/base/codesync/ChangeObject.java | 32 + .../codegen/base/codesync/ManageChangeEvents.java | 137 + .../base/codesync/RecordEventsListener.java | 110 + .../papyrus/codegen/base/messages.properties | 1 + .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 17 + .../about.html | 28 + .../build.properties | 9 + .../plugin.properties | 12 + .../plugin.xml | 6 + .../pom.xml | 14 + .../schema/languageCodegen.exsd | 84 + .../schema/languageProject.exsd | 71 + .../codegen/extensionpoints/AbstractSettings.java | 24 + .../papyrus/codegen/extensionpoints/Activator.java | 54 + .../extensionpoints/GenerationConstants.java | 31 + .../extensionpoints/GeneratorSelectionDialog.java | 122 + .../codegen/extensionpoints/ILangCodegen.java | 93 + .../codegen/extensionpoints/ILangCodegen2.java | 58 + .../extensionpoints/ILangProjectSupport.java | 58 + .../codegen/extensionpoints/LanguageCodegen.java | 214 + .../extensionpoints/LanguageProjectSupport.java | 51 + .../papyrus/codegen/extensionpoints/Messages.java | 20 + .../codegen/extensionpoints/MethodInfo.java | 124 + .../codegen/extensionpoints/SyncInformation.java | 39 + .../codegen/extensionpoints/messages.properties | 6 + .../.classpath | 7 + .../org.eclipse.papyrus.texteditor.model/.project | 28 + .../META-INF/MANIFEST.MF | 16 + .../about.html | 28 + .../build.properties | 22 + .../model/texteditormodel.ecore | 13 + .../model/texteditormodel.genmodel | 19 + .../plugin.properties | 15 + .../plugin.xml | 27 + .../org.eclipse.papyrus.texteditor.model/pom.xml | 14 + .../model/texteditormodel/TextEditorModel.java | 191 + .../texteditormodel/TextEditorModelFactory.java | 52 + .../texteditormodel/TextEditorModelPackage.java | 310 + .../impl/TextEditorModelFactoryImpl.java | 107 + .../texteditormodel/impl/TextEditorModelImpl.java | 464 + .../impl/TextEditorModelPackageImpl.java | 255 + .../util/TextEditorModelAdapterFactory.java | 148 + .../util/TextEditorModelSwitch.java | 136 + .../.classpath | 7 + .../.project | 28 + .../META-INF/MANIFEST.MF | 25 + .../about.html | 28 + .../build.properties | 9 + .../plugin.properties | 13 + .../plugin.xml | 17 + .../pom.xml | 14 + .../resources/TextEditorFacet.custom | 41 + .../texteditor/modelexplorer/Activator.java | 73 + .../adapters/TextEditorAdapterFactory.java | 40 + .../queries/GetContainedTextEditors.java | 58 + .../modelexplorer/queries/GetTextEditorIcon.java | 35 + .../modelexplorer/queries/GetTextEditorName.java | 35 + .../queries/IsTextEditorContainer.java | 35 + .../queries/NotVisibleStructuralFeatureQuery.java | 30 + .../org.eclipse.papyrus.fcm.profile/.classpath | 7 + .../org.eclipse.papyrus.fcm.profile/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 24 + .../org.eclipse.papyrus.fcm.profile/about.html | 28 + .../build.properties | 19 + .../icons/connector.png | Bin 0 -> 228 bytes .../icons/connector.svg | 80 + .../icons/deploy.gif | Bin 0 -> 148 bytes .../org.eclipse.papyrus.fcm.profile/icons/fcm.gif | Bin 0 -> 123 bytes .../icons/hires/connector.png | Bin 0 -> 770 bytes .../org.eclipse.papyrus.fcm.profile/icons/port.gif | Bin 0 -> 95 bytes .../icons/target.gif | Bin 0 -> 111 bytes .../model/FCM.ecore | 301 + .../model/FCM.genmodel | 176 + .../model/FCM.profile.di | 60 + .../model/FCM.profile.notation | 2897 +++ .../model/FCM.profile.uml | 679 + .../palettes/palette-classdep.xml | 29 + .../palettes/palette-composite.xml | 23 + .../plugin.properties | 12 + .../org.eclipse.papyrus.fcm.profile/plugin.xml | 82 + .../org.eclipse.papyrus.fcm.profile/pom.xml | 14 + .../schema/fcmBindingHelper.exsd | 99 + .../schema/fcmEmbeddingRule.exsd | 99 + .../schema/fcmPortMappingRule.exsd | 99 + .../src/org/eclipse/papyrus/FCM/Activator.java | 65 + .../src/org/eclipse/papyrus/FCM/Assembly.java | 66 + .../src/org/eclipse/papyrus/FCM/AutoIndex.java | 60 + .../org/eclipse/papyrus/FCM/AutoIndexPerNode.java | 27 + .../src/org/eclipse/papyrus/FCM/BindTemplate.java | 78 + .../src/org/eclipse/papyrus/FCM/BindingHelper.java | 63 + .../org/eclipse/papyrus/FCM/CodeGenOptions.java | 115 + .../org/eclipse/papyrus/FCM/CompImplTemplate.java | 85 + .../org/eclipse/papyrus/FCM/CompToOOmapping.java | 63 + .../src/org/eclipse/papyrus/FCM/CompilerChain.java | 59 + .../src/org/eclipse/papyrus/FCM/ConfigOption.java | 59 + .../papyrus/FCM/ConfigurableElementInstance.java | 60 + .../src/org/eclipse/papyrus/FCM/Configuration.java | 102 + .../eclipse/papyrus/FCM/ConfigurationProperty.java | 64 + .../src/org/eclipse/papyrus/FCM/Connector.java | 115 + .../papyrus/FCM/ConnectorConfiguration.java | 86 + .../src/org/eclipse/papyrus/FCM/ContainerRule.java | 109 + .../org/eclipse/papyrus/FCM/ContainerRuleKind.java | 225 + .../eclipse/papyrus/FCM/CopyAttributeValue.java | 86 + .../org/eclipse/papyrus/FCM/DeploymentPlan.java | 86 + .../org/eclipse/papyrus/FCM/DerivedElement.java | 86 + .../src/org/eclipse/papyrus/FCM/FCMFactory.java | 376 + .../src/org/eclipse/papyrus/FCM/FCMPackage.java | 3911 ++++ .../src/org/eclipse/papyrus/FCM/Flatten.java | 63 + .../src/org/eclipse/papyrus/FCM/Fragment.java | 59 + .../eclipse/papyrus/FCM/ImplementationGroup.java | 63 + .../papyrus/FCM/ImplementationProperties.java | 170 + .../org/eclipse/papyrus/FCM/InitPrecedence.java | 92 + .../eclipse/papyrus/FCM/InstanceConfigurator.java | 85 + .../eclipse/papyrus/FCM/InteractionComponent.java | 117 + .../org/eclipse/papyrus/FCM/InterceptionKind.java | 310 + .../org/eclipse/papyrus/FCM/InterceptionRule.java | 134 + .../org/eclipse/papyrus/FCM/OperatingSystem.java | 59 + .../src/org/eclipse/papyrus/FCM/Port.java | 117 + .../src/org/eclipse/papyrus/FCM/PortKind.java | 138 + .../src/org/eclipse/papyrus/FCM/ProgLanguage.java | 63 + .../org/eclipse/papyrus/FCM/RuleApplication.java | 106 + .../src/org/eclipse/papyrus/FCM/Singleton.java | 63 + .../src/org/eclipse/papyrus/FCM/Target.java | 207 + .../eclipse/papyrus/FCM/TargetArchitecture.java | 59 + .../src/org/eclipse/papyrus/FCM/Template.java | 90 + .../src/org/eclipse/papyrus/FCM/TemplatePort.java | 90 + .../papyrus/FCM/UseInstanceConfigurator.java | 89 + .../org/eclipse/papyrus/FCM/impl/AssemblyImpl.java | 165 + .../eclipse/papyrus/FCM/impl/AutoIndexImpl.java | 166 + .../papyrus/FCM/impl/AutoIndexPerNodeImpl.java | 46 + .../eclipse/papyrus/FCM/impl/BindTemplateImpl.java | 207 + .../papyrus/FCM/impl/BindingHelperImpl.java | 165 + .../papyrus/FCM/impl/CodeGenOptionsImpl.java | 291 + .../papyrus/FCM/impl/CompImplTemplateImpl.java | 235 + .../papyrus/FCM/impl/CompToOOmappingImpl.java | 165 + .../papyrus/FCM/impl/CompilerChainImpl.java | 165 + .../eclipse/papyrus/FCM/impl/ConfigOptionImpl.java | 165 + .../FCM/impl/ConfigurableElementInstanceImpl.java | 166 + .../papyrus/FCM/impl/ConfigurationImpl.java | 269 + .../FCM/impl/ConfigurationPropertyImpl.java | 166 + .../FCM/impl/ConnectorConfigurationImpl.java | 229 + .../eclipse/papyrus/FCM/impl/ConnectorImpl.java | 290 + .../papyrus/FCM/impl/ContainerRuleImpl.java | 277 + .../papyrus/FCM/impl/CopyAttributeValueImpl.java | 228 + .../papyrus/FCM/impl/DeploymentPlanImpl.java | 228 + .../papyrus/FCM/impl/DerivedElementImpl.java | 228 + .../eclipse/papyrus/FCM/impl/FCMFactoryImpl.java | 652 + .../eclipse/papyrus/FCM/impl/FCMPackageImpl.java | 2002 ++ .../org/eclipse/papyrus/FCM/impl/FlattenImpl.java | 165 + .../org/eclipse/papyrus/FCM/impl/FragmentImpl.java | 165 + .../papyrus/FCM/impl/ImplementationGroupImpl.java | 165 + .../FCM/impl/ImplementationPropertiesImpl.java | 430 + .../papyrus/FCM/impl/InitPrecedenceImpl.java | 240 + .../papyrus/FCM/impl/InstanceConfiguratorImpl.java | 234 + .../papyrus/FCM/impl/InteractionComponentImpl.java | 298 + .../papyrus/FCM/impl/InterceptionRuleImpl.java | 341 + .../papyrus/FCM/impl/OperatingSystemImpl.java | 165 + .../src/org/eclipse/papyrus/FCM/impl/PortImpl.java | 334 + .../org/eclipse/papyrus/FCM/impl/PortKindImpl.java | 351 + .../eclipse/papyrus/FCM/impl/ProgLanguageImpl.java | 165 + .../papyrus/FCM/impl/RuleApplicationImpl.java | 268 + .../eclipse/papyrus/FCM/impl/SingletonImpl.java | 165 + .../papyrus/FCM/impl/TargetArchitectureImpl.java | 165 + .../org/eclipse/papyrus/FCM/impl/TargetImpl.java | 522 + .../org/eclipse/papyrus/FCM/impl/TemplateImpl.java | 229 + .../eclipse/papyrus/FCM/impl/TemplatePortImpl.java | 181 + .../FCM/impl/UseInstanceConfiguratorImpl.java | 228 + .../papyrus/FCM/util/ConnectorTypeUtil.java | 41 + .../papyrus/FCM/util/FCMAdapterFactory.java | 832 + .../papyrus/FCM/util/FCMResourceFactoryImpl.java | 50 + .../eclipse/papyrus/FCM/util/FCMResourceImpl.java | 37 + .../org/eclipse/papyrus/FCM/util/FCMSwitch.java | 938 + .../src/org/eclipse/papyrus/FCM/util/FCMUtil.java | 240 + .../eclipse/papyrus/FCM/util/FCMXMLProcessor.java | 57 + .../eclipse/papyrus/FCM/util/IBindingHelper.java | 26 + .../eclipse/papyrus/FCM/util/IEmbeddingRule.java | 31 + .../org/eclipse/papyrus/FCM/util/IMappingRule.java | 41 + .../papyrus/FCM/util/ITemplateMappingRule.java | 40 + .../src/org/eclipse/papyrus/FCM/util/MapUtil.java | 530 + .../.classpath | 7 + .../.project | 46 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 47 + .../about.html | 28 + .../about.properties | 12 + .../build.acceleo | 26 + .../build.properties | 12 + .../plugin.properties | 12 + .../plugin.xml | 15 + .../pom.xml | 14 + .../schema/externalGenerator.exsd | 109 + .../schema/instanceConfig.exsd | 109 + .../schema/language.exsd | 109 + .../schema/ooTransformation.exsd | 109 + .../schema/xtendGenerator.exsd | 109 + .../papyrus/qompass/designer/core/Activator.java | 60 + .../qompass/designer/core/CORBAtypeNames.java | 23 + .../qompass/designer/core/CommandSupport.java | 118 + .../papyrus/qompass/designer/core/ConfigUtils.java | 93 + .../qompass/designer/core/CreationUtils.java | 81 + .../papyrus/qompass/designer/core/Description.java | 83 + .../qompass/designer/core/ElementFilter.java | 7 + .../papyrus/qompass/designer/core/EnumService.java | 151 + .../eclipse/papyrus/qompass/designer/core/Log.java | 99 + .../papyrus/qompass/designer/core/Messages.java | 128 + .../qompass/designer/core/ModelManagement.java | 174 + .../qompass/designer/core/OperationUtils.java | 166 + .../papyrus/qompass/designer/core/PortInfo.java | 139 + .../papyrus/qompass/designer/core/PortUtils.java | 312 + .../qompass/designer/core/ProjectManagement.java | 55 + .../qompass/designer/core/RunnableWithResult.java | 29 + .../papyrus/qompass/designer/core/StUtils.java | 170 + .../papyrus/qompass/designer/core/Stereotypes.java | 27 + .../papyrus/qompass/designer/core/UMLTool.java | 410 + .../papyrus/qompass/designer/core/Utils.java | 471 + .../core/commands/AddMarteAndFcmProfile.java | 148 + .../core/commands/AddQompassModelLibs.java | 202 + .../designer/core/deployment/AllocUtils.java | 373 + .../designer/core/deployment/BootLoaderGen.java | 546 + .../designer/core/deployment/DepCreation.java | 646 + .../designer/core/deployment/DepPlanUtils.java | 375 + .../qompass/designer/core/deployment/DepUtils.java | 564 + .../qompass/designer/core/deployment/Deploy.java | 188 + .../designer/core/deployment/DeployConstants.java | 14 + .../designer/core/deployment/GatherConfigData.java | 64 + .../core/deployment/ImplementationChooser.java | 34 + .../designer/core/deployment/InstanceDeployer.java | 63 + .../designer/core/deployment/PartialCopy.java | 126 + .../designer/core/extensions/BindingHelperExt.java | 98 + .../designer/core/extensions/EmbeddingRule.java | 65 + .../core/extensions/ExternalGenerator.java | 64 + .../designer/core/extensions/IEmbeddingRule.java | 37 + .../core/extensions/IExternalGenerator.java | 33 + .../core/extensions/IInstanceConfigurator.java | 38 + .../qompass/designer/core/extensions/IOOTrafo.java | 97 + .../qompass/designer/core/extensions/IXtend.java | 15 + .../core/extensions/InstanceConfigurator.java | 121 + .../qompass/designer/core/extensions/OOTrafo.java | 61 + .../designer/core/extensions/XtendGenerator.java | 48 + .../designer/core/generate/GenerateCode.java | 195 + .../designer/core/generate/GenerationOptions.java | 19 + .../designer/core/listeners/DepPlanListener.java | 59 + .../designer/core/listeners/InterfaceListener.java | 64 + .../designer/core/listeners/ModelListener.java | 56 + .../designer/core/listeners/OperationListener.java | 71 + .../designer/core/listeners/ParameterListener.java | 63 + .../designer/core/listeners/PortListener.java | 77 + .../designer/core/listeners/PostCopyListener.java | 35 + .../designer/core/listeners/PreCopyListener.java | 38 + .../designer/core/make/GenerateMakefile.java | 118 + .../qompass/designer/core/make/ShowFiles.java | 104 + .../qompass/designer/core/messages.properties | 91 + .../preferences/QompassPreferenceConstants.java | 33 + .../qompass/designer/core/sync/CompImplSync.java | 451 + .../qompass/designer/core/sync/CompTypeSync.java | 55 + .../qompass/designer/core/sync/DepPlanSync.java | 147 + .../qompass/designer/core/sync/InterfaceSync.java | 141 + .../designer/core/sync/SyncBehaviorParameters.java | 44 + .../designer/core/templates/BindingUtils.java | 150 + .../designer/core/templates/ConnectorBinding.java | 455 + .../PostTemplateInstantiationListener.java | 62 + .../PreTemplateInstantiationListener.java | 94 + .../core/templates/TemplateInstantiation.java | 284 + .../designer/core/templates/TemplateUtils.java | 395 + .../core/templates/TextTemplateBinding.java | 80 + .../core/templates/XtendTemplateBinding.java | 84 + .../transformations/AbstractContainerTrafo.java | 114 + .../core/transformations/AllocTransfo.java | 93 + .../core/transformations/CompTypeTrafos.java | 127 + .../designer/core/transformations/CopyTo.java | 35 + .../core/transformations/ExecuteOOTrafo.java | 175 + .../FlattenInteractionComponents.java | 224 + .../core/transformations/InstantiateDepPlan.java | 619 + .../designer/core/transformations/LazyCopier.java | 1044 + .../core/transformations/MainModelTrafo.java | 479 + .../core/transformations/PrefixConstants.java | 57 + .../core/transformations/RuleManagement.java | 32 + .../transformations/TrafoAndCodegenPackage.java | 351 + .../transformations/TransformationContext.java | 106 + .../transformations/TransformationException.java | 28 + .../transformations/TransformationRTException.java | 33 + .../core/transformations/TransformationUtil.java | 81 + .../designer/core/transformations/UpdateUtils.java | 84 + .../connector/ConnectorReification.java | 400 + .../transformations/container/ContainerTrafo.java | 770 + .../container/LWContainerTrafo.java | 438 + .../filters/FilterRuleApplication.java | 46 + .../transformations/filters/FilterSignatures.java | 50 + .../filters/FilterStateMachines.java | 95 + .../transformations/filters/FilterTemplate.java | 75 + .../transformations/filters/FixTemplateSync.java | 56 + .../.classpath | 8 + .../.project | 34 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 21 + .../about.html | 28 + .../build.properties | 8 + .../plugin.properties | 12 + .../plugin.xml | 18 + .../pom.xml | 55 + .../papyrus/qompass/designer/cpp/Activator.java | 50 + .../papyrus/qompass/designer/cpp/Constants.java | 9 + .../papyrus/qompass/designer/cpp/Messages.java | 19 + .../qompass/designer/cpp/messages.properties | 3 + .../designer/cpp/xtend/CppPortMapping.xtend | 553 + .../qompass/designer/cpp/xtend/CppUtils.xtend | 26 + .../designer/cpp/xtend/DynamicCpptoOO.xtend | 505 + .../qompass/designer/cpp/xtend/StaticCppToOO.xtend | 550 + .../xtend-gen/.gitignore | 2 + .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 14 + .../about.html | 28 + .../build.properties | 12 + .../cheatsheet/AddPorts.xml | 109 + .../cheatsheet/CodeCompilation.xml | 22 + .../cheatsheet/CodeGeneration.xml | 30 + .../cheatsheet/ComponentDev.xml | 76 + .../cheatsheet/ComponentImplementation.xml | 85 + .../cheatsheet/ComponentModel.xml | 75 + .../cheatsheet/DeploymentPlan.xml | 57 + .../cheatsheet/Main.xml | 69 + .../cheatsheet/MarteAddComponents.xml | 31 + .../cheatsheet/MarteAddPorts.xml | 21 + .../cheatsheet/MarteMain.xml | 81 + .../cheatsheet/MarteNewModel.xml | 29 + .../cheatsheet/NewModel.xml | 31 + .../cheatsheet/OpenExample.xml | 31 + .../cheatsheet/PlatformModel.xml | 51 + .../cheatsheet/Validation.xml | 35 + .../help/index.xml | 1 + .../help/tocconcepts.xml | 15 + .../help/tocdevguide.xml | 21 + .../help/tocreference.xml | 25 + .../html/concepts/bibliography.html | 60 + .../html/concepts/codegen.html | 60 + .../html/concepts/connector-container.html | 114 + .../html/concepts/input-models.html | 67 + .../html/concepts/overview.html | 55 + .../html/developer-guide/DefineNewPortKinds.html | 34 + .../html/developer-guide/createContainers.html | 44 + .../createInteractionComponents.html | 58 + .../html/developer-guide/developer.html | 57 + .../org.eclipse.papyrus.qompass.designer.core.html | 34 + .../html/img/arrow.png | Bin 0 -> 741 bytes .../html/img/connector-after-trafo.png | Bin 0 -> 14202 bytes .../html/img/connector-before-trafo.png | Bin 0 -> 17169 bytes .../html/img/connector-selection.png | Bin 0 -> 48922 bytes .../html/img/container-aggregation.png | Bin 0 -> 5155 bytes .../html/img/container-connector.png | Bin 0 -> 14509 bytes .../html/img/container-interceptor.png | Bin 0 -> 5511 bytes .../html/img/container-interceptor2.png | Bin 0 -> 5025 bytes .../html/img/container-selection.png | Bin 0 -> 41152 bytes .../html/img/deployment.pdf | Bin 0 -> 41197 bytes .../html/img/deployment.png | Bin 0 -> 18047 bytes .../html/img/logo-flex-eWare-small.png | Bin 0 -> 23920 bytes .../html/img/logo-marte.png | Bin 0 -> 4584 bytes .../html/img/logo-papyrus.png | Bin 0 -> 10227 bytes .../html/img/overview-eng.odg | Bin 0 -> 21814 bytes .../html/img/overview-eng.pdf | Bin 0 -> 23896 bytes .../html/img/overview-eng.png | Bin 0 -> 31781 bytes .../html/img/overview-eng.vsd | Bin 0 -> 57344 bytes .../html/img/qompass-0.33.jpg | Bin 0 -> 22983 bytes .../html/img/qompass.jpg | Bin 0 -> 141908 bytes .../html/img/scaled/connector-after-trafo.png | Bin 0 -> 8870 bytes .../html/img/scaled/connector-before-trafo.png | Bin 0 -> 14650 bytes .../html/img/scaled/connector-selection.png | Bin 0 -> 26512 bytes .../html/img/scaled/container-aggregation.png | Bin 0 -> 8424 bytes .../html/img/scaled/container-interceptor.png | Bin 0 -> 10141 bytes .../html/img/scaled/container-interceptor2.png | Bin 0 -> 8384 bytes .../html/img/scaled/container-selection.png | Bin 0 -> 41752 bytes .../html/img/statemachine-rule.png | Bin 0 -> 18516 bytes .../html/img/toolchain.odg | Bin 0 -> 170601 bytes .../html/img/toolchain.png | Bin 0 -> 106200 bytes .../html/img/trace2.png | Bin 0 -> 49769 bytes .../html/reference/component.html | 33 + .../html/reference/container.html | 54 + .../html/reference/interactionComponent.html | 61 + .../html/reference/port.html | 26 + .../html/reference/portKind.html | 27 + .../html/reference/trafos.html | 40 + .../html/sitestyle.css | 13 + .../model/ec3m-transformations.di | 23 + .../model/ec3m-transformations.notation | 669 + .../model/ec3m-transformations.uml | 173 + .../plugin.properties | 12 + .../plugin.xml | 30 + .../pom.xml | 14 + .../papyrus/qompass/designer/doc/Activator.java | 53 + .../toc.xml | 23 + .../.classpath | 8 + .../.project | 34 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 20 + .../about.html | 28 + .../build.properties | 8 + .../plugin.properties | 12 + .../plugin.xml | 11 + .../pom.xml | 56 + .../papyrus/qompass/designer/java/Activator.java | 50 + .../papyrus/qompass/designer/java/Messages.java | 19 + .../qompass/designer/java/messages.properties | 3 + .../qompass/designer/java/xtend/JavaToOO.xtend | 548 + .../xtend-gen/.gitignore | 2 + .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 33 + .../about.html | 28 + .../build.properties | 9 + .../icons/ADLInFlowPort.gif | Bin 0 -> 322 bytes .../icons/Qompass-16x16.gif | Bin 0 -> 1064 bytes .../icons/Stereotype.gif | Bin 0 -> 248 bytes .../icons/allocation.gif | Bin 0 -> 143 bytes .../icons/depPlan.gif | Bin 0 -> 104 bytes .../icons/deploy.gif | Bin 0 -> 148 bytes .../icons/ec3m-16x16.gif | Bin 0 -> 1014 bytes .../icons/ec3m-32x32.gif | Bin 0 -> 1370 bytes .../icons/sample.gif | Bin 0 -> 983 bytes .../icons/selConnector.gif | Bin 0 -> 125 bytes .../icons/selContainer.gif | Bin 0 -> 124 bytes .../icons/sync.gif | Bin 0 -> 296 bytes .../plugin.properties | 12 + .../plugin.xml | 231 + .../pom.xml | 14 + .../papyrus/qompass/designer/ui/Activator.java | 54 + .../papyrus/qompass/designer/ui/Messages.java | 43 + .../designer/ui/dialogs/AllocationDialog.java | 311 + .../ui/dialogs/AttributeLabelProvider.java | 36 + .../designer/ui/dialogs/ChooseConfigOpt.java | 245 + .../qompass/designer/ui/dialogs/ChoosePorts.java | 244 + .../ui/dialogs/ConfigOptionLabelProvider.java | 50 + .../ui/dialogs/ConfigureInstanceDialog.java | 642 + .../designer/ui/dialogs/ConfigurePortDialog.java | 388 + .../ui/dialogs/ConnectorSelectionDialog.java | 371 + .../designer/ui/dialogs/ContainerDialog.java | 309 + .../ui/dialogs/GenerationOptionsDialog.java | 138 + .../designer/ui/dialogs/InstanceLabelProvider.java | 39 + .../dialogs/InteractiveImplementationChooser.java | 55 + .../designer/ui/dialogs/NameLabelProvider.java | 26 + .../designer/ui/dialogs/PortLabelProvider.java | 80 + .../designer/ui/dialogs/QNameLabelProvider.java | 26 + .../designer/ui/dialogs/RuleLabelProvider.java | 39 + .../ui/handlers/AddProfileAndModelLibsHandler.java | 92 + .../designer/ui/handlers/AllocateHandler.java | 90 + .../ui/handlers/ConfigureInstanceHandler.java | 129 + .../designer/ui/handlers/ConfigurePortHandler.java | 102 + .../designer/ui/handlers/CreateDepPlanHandler.java | 144 + .../ui/handlers/CreatePlatformHandler.java | 94 + .../ui/handlers/GenCollaborationUseHandler.java | 38 + .../ui/handlers/GenConnectionPatternHandler.java | 49 + .../ui/handlers/InstantiateDepPlanHandler.java | 97 + .../ui/handlers/SelectConnectorHandler.java | 88 + .../ui/handlers/SelectContainerHandler.java | 120 + .../qompass/designer/ui/handlers/SyncHandler.java | 147 + .../ui/handlers/TrafoAndCodegenHandler.java | 58 + .../qompass/designer/ui/messages.properties | 27 + .../preferences/QompassPreferenceInitializer.java | 39 + .../ui/preferences/QompassPreferencePage.java | 76 + .../.classpath | 7 + .../.project | 28 + .../META-INF/MANIFEST.MF | 17 + .../about.html | 28 + .../build.properties | 11 + .../icons/validate.gif | Bin 0 -> 99 bytes .../plugin.properties | 12 + .../plugin.xml | 290 + .../pom.xml | 14 + .../qompass/designer/validation/Activator.java | 54 + .../ValidationDelegateClientSelector.java | 25 + .../constraints/AggregationKindValid.java | 65 + .../constraints/BehaviorsWithoutSpecification.java | 65 + .../constraints/ConfigurationAttributeNotSet.java | 41 + .../constraints/ConnectorCallMultiplicity.java | 82 + .../constraints/ConnectorConnectable.java | 56 + .../validation/constraints/DuplicateOperation.java | 27 + .../constraints/ExecutorIsNotUsedAsPartName.java | 48 + .../validation/constraints/InitialEntryPoints.java | 79 + .../InstanceSpecificationSlotForAllProperties.java | 63 + .../constraints/OperationsAreImplemented.java | 47 + .../constraints/OperationsWithTwoReturnValues.java | 57 + .../constraints/PortIsCorrectlyTyped.java | 45 + .../validation/constraints/PortKindUnset.java | 43 + .../validation/constraints/SystemHasNoPorts.java | 51 + .../constraints/TemplateRefWithoutBinding.java | 81 + .../validation/constraints/UnconnectedPorts.java | 95 + .../constraints/UnconnectedProvPorts.java | 27 + .../constraints/UnconnectedReqPorts.java | 27 + .../.classpath | 7 + .../.project | 35 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 16 + .../about.html | 28 + .../build.acceleo | 26 + .../build.properties | 10 + .../plugin.properties | 12 + .../pom.xml | 14 + .../papyrus/qompass/designer/vsl/Activator.java | 54 + .../papyrus/qompass/designer/vsl/Messages.java | 17 + .../papyrus/qompass/designer/vsl/ParseVSL.emtl | 432 + .../papyrus/qompass/designer/vsl/ParseVSL.java | 185 + .../papyrus/qompass/designer/vsl/ParseVSL.mtl | 23 + .../qompass/designer/vsl/messages.properties | 3 + .../.classpath | 8 + .../.gitignore | 1 + .../.project | 40 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../ExtendedPort.java | 127 + .../META-INF/MANIFEST.MF | 28 + .../about.html | 28 + .../build.properties | 17 + .../help/modellibs-core-examples.xml | 13 + .../help/modellibs-core-library.xml | 15 + .../html/examples/hello-world.html | 174 + .../html/examples/producer-consumer.html | 125 + .../html/examples/screenshots/cmd_with_error.png | Bin 0 -> 47208 bytes .../examples/screenshots/cmd_without_error.png | Bin 0 -> 80620 bytes .../html/examples/screenshots/hw/allocate.png | Bin 0 -> 18690 bytes .../html/examples/screenshots/hw/c-cpp-view.png | Bin 0 -> 60218 bytes .../examples/screenshots/hw/configure-instance.png | Bin 0 -> 28563 bytes .../examples/screenshots/hw/deployment-plan.png | Bin 0 -> 17253 bytes .../html/examples/screenshots/hw/hello-world.png | Bin 0 -> 19321 bytes .../html/examples/screenshots/hw/platform.png | Bin 0 -> 13034 bytes .../html/examples/screenshots/hw/system.png | Bin 0 -> 3521 bytes .../html/examples/screenshots/pc/dep-plans.png | Bin 0 -> 7688 bytes .../screenshots/pc/generated-container.png | Bin 0 -> 12742 bytes .../html/examples/screenshots/pc/pull-consumer.png | Bin 0 -> 23901 bytes .../html/examples/screenshots/pc/push-consumer.png | Bin 0 -> 13675 bytes .../html/examples/screenshots/pc/push-producer.png | Bin 0 -> 10169 bytes .../html/examples/screenshots/pc/system-pull.png | Bin 0 -> 17185 bytes .../html/examples/screenshots/pc/system-push.png | Bin 0 -> 10459 bytes .../html/library/corba.html | 16 + .../html/library/core.html | 16 + .../html/library/osal.html | 16 + .../html/library/statemachine.html | 16 + .../models/examples/ClientServerTimer.di | 2 + .../models/examples/ClientServerTimer.notation | 1221 ++ .../models/examples/ClientServerTimer.uml | 395 + .../models/examples/HelloWorld.di | 2 + .../models/examples/HelloWorld.notation | 968 + .../models/examples/HelloWorld.uml | 159 + .../models/examples/HelloWorldC.di | 40 + .../models/examples/HelloWorldC.notation | 528 + .../models/examples/HelloWorldC.uml | 186 + .../models/examples/HelloWorldJava.di | 40 + .../models/examples/HelloWorldJava.notation | 574 + .../models/examples/HelloWorldJava.uml | 165 + .../models/examples/ProducerConsumer.di | 2 + .../models/examples/ProducerConsumer.notation | 1541 ++ .../models/examples/ProducerConsumer.uml | 453 + .../models/examples/ProducerTwoConsumers.di | 47 + .../models/examples/ProducerTwoConsumers.notation | 1655 ++ .../models/examples/ProducerTwoConsumers.uml | 532 + .../models/examples/figs/HelloWorld-CDTeditor.png | Bin 0 -> 197154 bytes .../examples/figs/HelloWorld-OpenCDTeditor.png | Bin 0 -> 39898 bytes .../models/examples/figs/HelloWorld-classdiag.png | Bin 0 -> 71960 bytes .../models/examples/figs/HelloWorld-component.png | Bin 0 -> 126457 bytes .../models/examples/figs/HelloWorld-component.svg | 192 + .../models/examples/figs/HelloWorld-deployment.png | Bin 0 -> 128408 bytes .../models/examples/figs/HelloWorld-deployment.svg | 207 + .../models/examples/figs/HelloWorld-platform.png | Bin 0 -> 66673 bytes .../models/examples/figs/HelloWorld-platform.svg | 112 + .../models/examples/figs/HelloWorld-system.png | Bin 0 -> 11119 bytes .../models/examples/figs/HelloWorld-system.svg | 61 + .../examples/figs/ProducerConsumer-pullcon.png | Bin 0 -> 117969 bytes .../examples/figs/ProducerConsumer-pullcon.svg | 148 + .../models/examples/figs/ProducerConsumer-sys.pdf | Bin 0 -> 41470 bytes .../models/examples/figs/ProducerConsumer-sys.png | Bin 0 -> 67516 bytes .../models/examples/figs/ProducerConsumer-sys.svg | 127 + .../models/library/corba.di | 23 + .../models/library/corba.notation | 256 + .../models/library/corba.uml | 75 + .../models/library/core.di | 80 + .../models/library/core.notation | 5392 +++++ .../models/library/core.uml | 1369 ++ .../models/library/corec.di | 92 + .../models/library/corec.notation | 3896 ++++ .../models/library/corec.uml | 1507 ++ .../models/library/corecpp.di | 92 + .../models/library/corecpp.notation | 3896 ++++ .../models/library/corecpp.uml | 1507 ++ .../models/library/fifo.di | 50 + .../models/library/fifo.notation | 1865 ++ .../models/library/fifo.uml | 432 + .../models/library/figs/In.png | Bin 0 -> 838 bytes .../models/library/figs/In.svg | 64 + .../models/library/figs/InOut.png | Bin 0 -> 1939 bytes .../models/library/figs/InOut.svg | 64 + .../models/library/figs/Out.png | Bin 0 -> 872 bytes .../models/library/figs/Out.svg | 58 + .../models/library/figs/Provided.png | Bin 0 -> 1611 bytes .../models/library/figs/Provided.svg | 105 + .../models/library/figs/ProvidedRequired.png | Bin 0 -> 1401 bytes .../models/library/figs/ProvidedRequired.svg | 124 + .../models/library/figs/Required.png | Bin 0 -> 1190 bytes .../models/library/figs/Required.svg | 108 + .../models/library/figs/hires/In.png | Bin 0 -> 838 bytes .../models/library/figs/hires/InOut.png | Bin 0 -> 1939 bytes .../models/library/figs/hires/Out.png | Bin 0 -> 872 bytes .../models/library/figs/hires/Provided.png | Bin 0 -> 1611 bytes .../models/library/figs/hires/ProvidedRequired.png | Bin 0 -> 1401 bytes .../models/library/figs/hires/Required.png | Bin 0 -> 1190 bytes .../models/library/figs/lowres/In.png | Bin 0 -> 292 bytes .../models/library/figs/lowres/InOut.png | Bin 0 -> 467 bytes .../models/library/figs/lowres/Out.png | Bin 0 -> 303 bytes .../models/library/figs/lowres/Provided.png | Bin 0 -> 416 bytes .../library/figs/lowres/ProvidedRequired.png | Bin 0 -> 364 bytes .../models/library/figs/lowres/Required.png | Bin 0 -> 317 bytes .../models/library/figs/port-kinds.png | Bin 0 -> 319943 bytes .../models/library/figs/port-kinds.svg | 551 + .../models/library/osal.di | 140 + .../models/library/osal.notation | 7725 +++++++ .../models/library/osal.uml | 11645 +++++++++++ .../models/library/statemachine.di | 59 + .../models/library/statemachine.notation | 2575 +++ .../models/library/statemachine.uml | 516 + .../models/library/sysinterfaces.di | 20 + .../models/library/sysinterfaces.notation | 269 + .../models/library/sysinterfaces.uml | 94 + .../models/wizardTemplates/QompassModel.di | 23 + .../models/wizardTemplates/QompassModel.notation | 119 + .../models/wizardTemplates/QompassModel.uml | 62 + .../models/wizardTemplates/QompassSimple.di | 29 + .../models/wizardTemplates/QompassSimple.notation | 51 + .../models/wizardTemplates/QompassSimple.uml | 50 + .../plugin.properties | 12 + .../plugin.xml | 156 + .../pom.xml | 55 + .../papyrus/qompass/modellibs/core/Activator.java | 60 + .../modellibs/core/HelloWorldModelWizard.java | 27 + .../core/ProducerConsumerModelWizard.java | 27 + .../BindCppIncludeToFirstActual.java | 73 + .../core/bindinghelpers/BindOperation.java | 54 + .../InstantiateCppIncludeWithItSelf.java | 74 + .../core/bindinghelpers/LoopOperations.java | 130 + .../modellibs/core/embeddingrules/AccordCall.java | 95 + .../iconfigurators/AnimServiceConfigurator.java | 68 + .../core/iconfigurators/CallEventConfigurator.java | 61 + .../modellibs/core/mappingrules/AMIcallback.java | 162 + .../modellibs/core/mappingrules/AMIpoll.java | 161 + .../modellibs/core/mappingrules/ExtendedPort.java | 132 + .../modellibs/core/mappingrules/ExtendedPort2.java | 138 + .../core/mappingrules/ProvideInterface.java | 37 + .../modellibs/core/mappingrules/PullConsumer.java | 162 + .../modellibs/core/mappingrules/PushConsumer.java | 110 + .../core/mappingrules/PushProdPullCons.java | 75 + .../modellibs/core/mappingrules/PushProducer.java | 130 + .../modellibs/core/mappingrules/TemplatePort.java | 183 + .../modellibs/core/mappingrules/UseConjIntf.java | 187 + .../modellibs/core/mappingrules/UseInterface.java | 42 + .../qompass/modellibs/core/xtend/AMIPull.xtend | 34 + .../qompass/modellibs/core/xtend/AsyncCalls.xtend | 57 + .../qompass/modellibs/core/xtend/BehaviorUtil.java | 111 + .../qompass/modellibs/core/xtend/CppUtils.xtend | 81 + .../qompass/modellibs/core/xtend/FIFO.xtend | 13 + .../modellibs/core/xtend/GlobalConstants.xtend | 56 + .../qompass/modellibs/core/xtend/Marshalling.xtend | 51 + .../modellibs/core/xtend/MultipleReceptacle.xtend | 14 + .../modellibs/core/xtend/StateMachineGen.xtend | 412 + .../modellibs/core/xtend/StateMachineUtil.java | 260 + .../core/xtend/StructBasedMarshalling.xtend | 25 + .../qompass/modellibs/core/xtend/SyncCalls.xtend | 13 + .../qompass/modellibs/core/xtend/UMLAction.xtend | 58 + .../qompass/modellibs/core/xtend/UMLChain.xtend | 91 + .../modellibs/core/xtend/UMLFlatModel2Cpp.xtend | 667 + .../modellibs/core/xtend/UMLFlattener.xtend | 556 + .../xtend-gen/.gitignore | 2 + .../.project | 28 + .../.project | 28 + .../.classpath | 7 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 30 + .../about.html | 28 + .../build.properties | 13 + .../icons/etool16/brkp_16x16.gif | Bin 0 -> 197 bytes .../icons/etool16/brkp_9x9.gif | Bin 0 -> 179 bytes .../icons/etool16/brkp_grp.gif | Bin 0 -> 361 bytes .../icons/etool16/brkp_grp_disabled.gif | Bin 0 -> 173 bytes .../icons/etool16/brkpd_16x16.gif | Bin 0 -> 139 bytes .../icons/etool16/brkpd_9x9.gif | Bin 0 -> 123 bytes .../icons/etool16/debug.gif | Bin 0 -> 348 bytes .../icons/etool16/properties.gif | Bin 0 -> 577 bytes .../icons/etool16/trcp_11x12.gif | Bin 0 -> 313 bytes .../icons/etool16/trcp_16x16.gif | Bin 0 -> 348 bytes .../icons/etool16/trcpd_11x12.gif | Bin 0 -> 302 bytes .../icons/etool16/trcpd_16x16.gif | Bin 0 -> 316 bytes .../plugin.properties | 12 + .../plugin.xml | 193 + .../pom.xml | 14 + .../schema/traceMechanism.exsd | 109 + .../infra/services/tracepoints/Activator.java | 90 + .../services/tracepoints/ITraceMechanism.java | 74 + .../infra/services/tracepoints/MarkerUtils.java | 84 + .../infra/services/tracepoints/Messages.java | 30 + .../infra/services/tracepoints/TraceActions.java | 206 + .../infra/services/tracepoints/TraceFunctions.java | 125 + .../infra/services/tracepoints/TraceMechanism.java | 88 + .../infra/services/tracepoints/TraceState.java | 20 + .../services/tracepoints/TracepointConstants.java | 35 + .../commands/AbstractTracepointCommand.java | 167 + .../ToggleBreakpointActivationCommand.java | 40 + .../commands/ToggleBreakpointCommand.java | 41 + .../ToggleTracepointActivationCommand.java | 41 + .../commands/ToggleTracepointCommand.java | 54 + .../commands/TracepointPropertiesCommand.java | 82 + .../tracepoints/dialogs/TraceActionSelection.java | 304 + .../handler/AbstractCommandHandler.java | 166 + .../handler/ToggleBreakpointActivationHandler.java | 33 + .../handler/ToggleBreakpointHandler.java | 33 + .../handler/ToggleTracepointActivationHandler.java | 33 + .../handler/ToggleTracepointHandler.java | 33 + .../handler/TracepointPropertiesHandler.java | 33 + .../infra/services/tracepoints/messages.properties | 15 + .../BinaryEncodedMChoiceFieldEditor.java | 134 + .../preferences/MultipleChoiceFieldEditor.java | 235 + .../preferences/TPPreferenceConstants.java | 51 + .../preferences/TPPreferenceInitializer.java | 54 + .../tracepoints/preferences/TPPreferencePage.java | 108 + .../.classpath | 8 + .../.gitignore | 1 + .../.project | 47 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 28 + .../about.html | 28 + .../build.acceleo | 26 + .../build.properties | 14 + .../help/tocconcepts.xml | 7 + .../html/images/image001.gif | Bin 0 -> 2182 bytes .../html/images/image002.gif | Bin 0 -> 2123 bytes .../html/images/image003.gif | Bin 0 -> 1323 bytes .../html/images/image004.jpg | Bin 0 -> 3340 bytes .../html/images/image005.jpg | Bin 0 -> 36908 bytes .../html/images/image006.jpg | Bin 0 -> 4937 bytes .../html/images/image007.gif | Bin 0 -> 21539 bytes .../html/images/image008.jpg | Bin 0 -> 44181 bytes .../html/images/image009.jpg | Bin 0 -> 43754 bytes .../html/userguide.htm | 213 + .../models/examples/ClientServerTraceTest.di | 76 + .../models/examples/ClientServerTraceTest.notation | 1600 ++ .../models/examples/ClientServerTraceTest.uml | 398 + .../models/examples/ProducerConsumer.di | 53 + .../models/examples/ProducerConsumer.notation | 1090 + .../models/examples/ProducerConsumer.uml | 457 + .../models/examples/SampleOOTraceTest.di | 46 + .../models/examples/SampleOOTraceTest.notation | 410 + .../models/examples/SampleOOTraceTest.uml | 276 + .../models/library/tracing.di | 52 + .../models/library/tracing.notation | 1684 ++ .../models/library/tracing.uml | 750 + .../plugin.properties | 12 + .../plugin.xml | 75 + .../pom.xml | 55 + .../qompass/modellibs/tracing/Activator.java | 53 + .../tracing/ClientServerTraceTestModelWizard.java | 14 + .../modellibs/tracing/IConfiguratorOTF.java | 59 + .../modellibs/tracing/IConfiguratorTrace.java | 45 + .../modellibs/tracing/QompassTraceMechanism.java | 188 + .../qompass/modellibs/tracing/StringConstants.java | 5 + .../modellibs/tracing/acceleo/TraceCout.xtend | 18 + .../modellibs/tracing/acceleo/TraceLTTng.xtend | 198 + .../modellibs/tracing/acceleo/TraceOTF.xtend | 33 + .../modellibs/tracing/acceleo/TraceUtils.java | 45 + .../xtend-gen/.gitignore | 2 + .../.classpath | 7 + .../org.eclipse.papyrus.views.tracepoints/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 25 + .../about.html | 28 + .../build.properties | 9 + .../icons/breakpoint_view.gif | Bin 0 -> 204 bytes .../icons/gotoobj_tsk.gif | Bin 0 -> 372 bytes .../icons/skip_brkp.gif | Bin 0 -> 204 bytes .../plugin.properties | 12 + .../plugin.xml | 15 + .../org.eclipse.papyrus.views.tracepoints/pom.xml | 14 + .../papyrus/views/tracepoints/Activator.java | 80 + .../views/tracepoints/views/TraceViewImages.java | 44 + .../views/tracepoints/views/TracepointView.java | 540 + .../org.eclipse.papyrus.qompass.ui/.classpath | 7 + .../org.eclipse.papyrus.qompass.ui/.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 291 + .../.settings/org.eclipse.jdt.ui.prefs | 68 + .../META-INF/MANIFEST.MF | 19 + .../org.eclipse.papyrus.qompass.ui/about.html | 28 + .../build.properties | 9 + .../icons/qompass-16x16.gif | Bin 0 -> 1064 bytes .../plugin.properties | 12 + .../org.eclipse.papyrus.qompass.ui/plugin.xml | 30 + .../qompass/org.eclipse.papyrus.qompass.ui/pom.xml | 14 + .../org/eclipse/papyrus/qompass/ui/Activator.java | 44 + .../.project | 17 + .../build.properties | 6 + .../epl-v10.html | 304 + .../feature.properties | 143 + .../feature.xml | 107 + .../license.html | 107 + .../pom.xml | 14 + .../.project | 17 + .../build.properties | 6 + .../epl-v10.html | 304 + .../feature.properties | 143 + .../feature.xml | 56 + .../license.html | 107 + .../pom.xml | 14 + .../org.eclipse.papyrus.extra.cpp.feature/.project | 17 - .../build.properties | 6 - .../epl-v10.html | 304 - .../feature.properties | 143 - .../feature.xml | 50 - .../license.html | 107 - .../org.eclipse.papyrus.extra.cpp.feature/pom.xml | 14 - .../org.eclipse.papyrus.extra.feature/feature.xml | 6 +- .../feature.xml | 69 +- .../feature.xml | 6 +- releng/extra/pom.xml | 102 +- releng/extra/site/category.xml | 10 +- 3237 files changed, 307346 insertions(+), 309342 deletions(-) delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/icons/allocation.gif delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/icons/deploy.gif delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/plugin.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/Activator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/dialogs/TestAcceleoDialog.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/handlers/ResetAcceleoHandler.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/handlers/TestAcceleoHandler.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/icons/codegen-16x16.gif delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/plugin.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/src/org/eclipse/papyrus/acceleo/ui/Activator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/build.acceleo delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/AcceleoDriver.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/AcceleoException.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Activator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/GenUtils.emtl delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/GenUtils.mtl delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Utils.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/icons/codegen-16x16.gif delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/plugin.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Activator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/GenUtils.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/HierarchyLocationStrategy.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ILocationStrategy.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/IPFileSystemAccess.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/JavaIoFileSystemAccess.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Messages.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ModelElementsCreator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ProjectBasedFileAccess.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ChangeObject.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ManageChangeEvents.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/RecordEventsListener.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/messages.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageCodegen.exsd delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageProject.exsd delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/AbstractSettings.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Activator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GenerationConstants.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GeneratorSelectionDialog.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen2.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangProjectSupport.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageCodegen.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageProjectSupport.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Messages.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/MethodInfo.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/SyncInformation.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/messages.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/plugin.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/Activator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CCNamedProjectWizard.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTMainWizardPageV.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTSettings.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CNamedProjectWizard.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CProjectSupport.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/C_CppProjectSupport.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CppProjectSupport.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/icons/codegen.gif delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/plugin.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/Activator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/CDTprojectHandler.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/GenerateCodeHandler.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/preferences/CodegenPreferencePage.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/build.acceleo delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/plugin.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Activator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Constants.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/CppLangCodegen.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Messages.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/messages.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenConstants.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenPreferenceInitializer.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenUtils.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppLocationStrategy.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppModelElementsCreator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ClassUtils.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.emtl delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.mtl delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ILocateCppProject.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/LocateCppProject.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Messages.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.emtl delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.mtl delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/messages.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppAttribute.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassAttributesDeclaration.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassFriendDeclaration.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeClassDeclaration.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeDeclaration.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassInheritedDeclarations.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsDeclaration.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsImplementation.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassTypeAndEnum.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassifierGenerator.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppDocumentation.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppEnumerations.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppIncludeUtil.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppInnerClassifiers.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppOperations.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPackageHeaderGenerator.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppParameter.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPrimitiveTypes.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppTemplates.xtend delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/xtend-gen/.gitignore delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.di delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.notation delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.uml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/plugin.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/Activator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/HelloWorldOOModelWizard.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/icons/transfo_cpp.gif delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.di delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.notation delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.uml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/plugin.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.ecore delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.genmodel delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.di delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.notation delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.uml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.di delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.notation delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.uml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Array.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppFactory.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppPackage.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Const.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ConstInit.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppInit.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppRoot.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EAccessKind.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EStorageClass.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ExternLibrary.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/External.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Friend.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Include.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Inline.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ManualGeneration.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Mutable.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/NoCodeGen.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ptr.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ref.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/StorageClass.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Template.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateBinding.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateParameter.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Typedef.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Union.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Variadic.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Virtual.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Visibility.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/VisibilityKind.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Volatile.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ArrayImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppFactoryImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppPackageImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstInitImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppInitImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppRootImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternLibraryImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternalImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/FriendImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/IncludeImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/InlineImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ManualGenerationImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/MutableImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/NoCodeGenImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/PtrImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/RefImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/StorageClassImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateBindingImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateParameterImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TypedefImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/UnionImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VariadicImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VirtualImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VisibilityImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VolatileImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppAdapterFactory.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceFactoryImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppSwitch.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppXMLProcessor.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/cpp/profile/Activator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/cpp/profile/StdStereo.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.test/.cproject delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.test/.gitignore delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.test/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.di delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.notation delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.uml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.di delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.notation delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.uml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.gif delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.xcf delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/plugin.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Activator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/AddProfileAndModelLibsHandler.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/CommandSupport.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/TextEditorConstants.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Utils.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/DelegatingSourceViewer.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/PapyrusCDTEditor.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/factory/PapyrusCDTEditorFactory.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/handler/PapyrusCDTEditorHandler.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ChangeKind.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/Closure.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ModelListener.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/OperationHistoryListener.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/modelresource/TextEditorModelSharedResource.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceConstants.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceInitializer.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferencePage.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/FindTransition.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ObtainICElement.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ParameterModifiers.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/RevealCurrentOperation.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncCDTtoModel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncModelToCDT.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.ecore delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.genmodel delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/plugin.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelFactory.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelPackage.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelFactoryImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelPackageImpl.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelAdapterFactory.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelSwitch.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/resources/TextEditorFacet.custom delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/Activator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/adapters/TextEditorAdapterFactory.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetContainedTextEditors.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorIcon.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorName.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/IsTextEditorContainer.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/.classpath delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/.project delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/META-INF/MANIFEST.MF delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/about.html delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/about.ini delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/build.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/plugin.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/plugin.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/pom.xml delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/Papyrus_32x32.gif delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/save_edit.gif delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp.gif delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp_old.gif delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/undo_edit.gif delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/AbstractCppPanelView.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.properties delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CommandSupport.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CppPanelView.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/listeners/UMLElementPanelListener.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppAbstractPanel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppBehaviorPanel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppClassPanel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppDefaultPanel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppGeneralizationPanel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppOperationPanel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPackagePanel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppParameterPanel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPrimitiveTypePanel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPropertyPanel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateBindingPanel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateParameterPanel.java delete mode 100644 extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/PanelFactory.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java-updatesite/.project delete mode 100644 extraplugins/java/org.eclipse.papyrus.java-updatesite/site.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.classpath delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.project delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/META-INF/MANIFEST.MF delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/about.html delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/build.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generate.psd delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generation.png delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/sample.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/plugin.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/pom.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/GeneratorPreference.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/RunGenerator.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCommentable.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCompilationUnit.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTField.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTGetterSetter.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaModel.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaProject.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTMethod.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragment.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragmentRoot.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTType.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchTools.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.classpath delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.project delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/META-INF/MANIFEST.MF delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/about.html delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/build.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTClass.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTEnum.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTInterface.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTType.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaModel_javaProject_JDTJavaProject.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaProject_packageFragmentRoots_JDTPackageFragmentRoot.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMember_typeParameters_JDTTypeParameter.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_JDTOpaqueBody.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_OpaqueMethodBody.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_parameters_JDTParameter.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_returnType_JDTParameter.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragmentRoot_packageFragments_JDTPackageFragment.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_compilationUnits_JDTCompilationUnit.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_packageFragments_JDTPackageFragment.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_fields_JDTField.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_methods_JDTMethod.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTClass.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTEnum.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTInterface.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTType.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTClass.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTCompilationUnit.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTEnum.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTException.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTField.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportContainer.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportDeclaration.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTInterface.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaElement.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaModel.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaProject.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTMethod.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTOpaqueBody.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragment.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragmentRoot.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTParameter.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTTypeParameter.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/OpaqueMethodBody.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/Options.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/pom.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmEditPlugin.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmItemProviderAdapterFactory.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/OptionsItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTClassItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTCompilationUnitItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTEnumItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTExceptionItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTFieldItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportContainerItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportDeclarationItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTInterfaceItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaElementItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaModelItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaProjectItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMemberItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodBodyItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTOpaqueBodyItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentRootItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParameterItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentJavaElementItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeParameterItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeRootItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmEditPlugin.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmItemProviderAdapterFactory.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.classpath delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.project delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/META-INF/MANIFEST.MF delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/about.html delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/build.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/obj16/JdtmmModelFile.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/wizban/NewJdtmm.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/pom.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmActionBarContributor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditorPlugin.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmModelWizard.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmActionBarContributor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditorPlugin.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmModelWizard.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.classpath delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.project delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/META-INF/MANIFEST.MF delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/about.html delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/build.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.di delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.ecore delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.genmodel delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.notation delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.uml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.di delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.ecore delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.genmodel delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.notation delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.uml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.di delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.notation delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.uml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/pom.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmFactory.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmPackage.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/Options.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmFactoryImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmPackageImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/OptionsImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmAdapterFactory.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmSwitch.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTClass.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTCompilationUnit.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTEnum.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTException.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTField.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportContainer.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTInterface.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaElement.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaModel.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaProject.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMember.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethod.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethodBody.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTOpaqueBody.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragment.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragmentRoot.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParameter.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParent.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParentJavaElement.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTType.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeParameter.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeRoot.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmFactory.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmPackage.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/TrueFalseDefault.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/VisibilityKind.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTClassImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTCompilationUnitImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTEnumImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTExceptionImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTFieldImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportContainerImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportDeclarationImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTInterfaceImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaElementImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaModelImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaProjectImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMemberImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodBodyImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTOpaqueBodyImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentRootImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParameterImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentJavaElementImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeParameterImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeRootImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmFactoryImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmPackageImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmAdapterFactory.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmPreference.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmSwitch.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitorException.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/utils/DerivedNotifyingEList.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.classpath delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.project delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/META-INF/MANIFEST.MF delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/about.html delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/build.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.di delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.notation delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.uml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/plugin.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/pom.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/src/org/eclipse/papyrus/java/generator/transfo/umltojdt/UmltojdtActivator.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/algo.txt delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/stereotypeUtil.qvto delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/uml2jdt2.qvto delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/.classpath delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/.project delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/META-INF/MANIFEST.MF delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/about.html delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/build.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/icons/generate.psd delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/icons/generation.png delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/icons/sample.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/plugin.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/plugin.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/pom.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/Activator.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/handlers/GenerateJavaCodeHandler.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GeneratorPreferenceImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GenericClassFieldEditor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PackageListEditor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceConstants.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceInitializer.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferencePage.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/.classpath delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/.project delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/META-INF/MANIFEST.MF delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/about.html delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/build.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaClass.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaMethod.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaPackage_.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaParameter.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProject.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProperty.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaSrcFolder.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/PrimitiveType.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/plugin.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/plugin.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/pom.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaClassItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaEditPlugin.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaGenItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaItemProviderAdapterFactory.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaMethodItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaNamedElementItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPackage_ItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaParameterItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaProjectItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPropertyItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaSrcFolderItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/PrimitiveTypeItemProvider.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/.classpath delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/.project delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/META-INF/MANIFEST.MF delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/about.html delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/build.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/icons/full/obj16/JavaModelFile.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/icons/full/wizban/NewJava.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/plugin.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/plugin.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/pom.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaActionBarContributor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditorPlugin.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaModelWizard.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/.classpath delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/.project delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/META-INF/MANIFEST.MF delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/about.html delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/build.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/icons/javaprofile.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/models/java.ecore delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.di delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.genmodel delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.notation delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.uml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/plugin.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/plugin.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/pom.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaClass.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaFactory.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaGen.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaMethod.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaNamedElement.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage_.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaParameter.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProject.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProperty.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaSrcFolder.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/PrimitiveType.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/TrueFalseDefault.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaClassImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaFactoryImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaGenImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaMethodImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaNamedElementImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackageImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackage_Impl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaParameterImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaProjectImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPropertyImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaSrcFolderImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/PrimitiveTypeImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaAdapterFactory.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceFactoryImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceImpl.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaSwitch.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaXMLProcessor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.classpath delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.project delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.core.resources.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/META-INF/MANIFEST.MF delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/about.html delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/build.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/icons/associationFromProperty.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/icons/javaReverse.gif delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/plugin.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/plugin.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/pom.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Activator.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DisplayReverse.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DndReverseCodeHandler.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/JavaCodeReverse.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Messages.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/ReverseCodeHandler.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/TreeSelectionList.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/DndReverseCodeDialog.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/InputListDialog.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/ReverseCodeDialog.java delete mode 100755 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseCommand.java delete mode 100755 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseStrategy.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/Messages.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/messages.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/handlers/CreateAssociationFromPropertyHandler.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/messages.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/.classpath delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/.project delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/META-INF/MANIFEST.MF delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/about.html delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/build.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/plugin.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/pom.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParser.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserConstants.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserTokenManager.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaCharStream.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaParser.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ParseException.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/Token.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/TokenMgrError.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/BlockComment.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Comment.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/CompilationUnit.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/ImportDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/LineComment.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Node.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/PackageDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/TypeParameter.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationMemberDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/BodyDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ClassOrInterfaceDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ConstructorDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyMemberDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyTypeDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumConstantDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/FieldDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/InitializerDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/JavadocComment.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/MethodDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ModifierSet.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/Parameter.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/TypeDeclaration.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclarator.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclaratorId.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AnnotationExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayAccessExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayCreationExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayInitializerExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AssignExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BinaryExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BooleanLiteralExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CastExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CharLiteralExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ClassExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ConditionalExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/DoubleLiteralExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/EnclosedExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/Expression.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/FieldAccessExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/InstanceOfExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralMinValueExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LiteralExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralMinValueExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MarkerAnnotationExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MemberValuePair.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MethodCallExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NameExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NormalAnnotationExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NullLiteralExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ObjectCreationExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/QualifiedNameExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SingleMemberAnnotationExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/StringLiteralExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SuperExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ThisExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/UnaryExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/VariableDeclarationExpr.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/AssertStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BlockStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BreakStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/CatchClause.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ContinueStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/DoStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/EmptyStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExplicitConstructorInvocationStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExpressionStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForeachStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/IfStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/LabeledStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ReturnStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/Statement.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchEntryStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SynchronizedStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ThrowStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TryStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TypeDeclarationStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/WhileStmt.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ClassOrInterfaceType.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/PrimitiveType.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ReferenceType.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/Type.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/VoidType.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/WildcardType.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/DumpVisitor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitorAdapter.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitorAdapter.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/java_1_5.jj delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ClassifierCatalog.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CompilationUnitAnalyser.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CreationPackageCatalog.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CuPrinter.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericSwitchVisitor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericTransformer.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ImportedTypeCatalog.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ModelManager.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/QualifiedName.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/SwitchVisitor.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyser.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyserAndTranslator.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlParser.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlUtils.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/Activator.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/utils/TypeOperationsEnhanced.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.template/.classpath delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.template/.project delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.template/META-INF/MANIFEST.MF delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.template/about.html delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.template/build.properties delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.template/plugin.xml delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/Activator.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/BundleActivatorResolver.java delete mode 100644 extraplugins/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/RegisterResolver.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/.classpath delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/.project delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/META-INF/MANIFEST.MF delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/about.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/build.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/connector.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/connector.svg delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/deploy.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/fcm.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/hires/connector.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/port.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/target.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.ecore delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.genmodel delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/palettes/palette-classdep.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/palettes/palette-composite.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/plugin.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/plugin.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/pom.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/schema/fcmBindingHelper.exsd delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/schema/fcmEmbeddingRule.exsd delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/schema/fcmPortMappingRule.exsd delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Activator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Assembly.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndex.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndexPerNode.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindTemplate.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindingHelper.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CodeGenOptions.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompImplTemplate.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompToOOmapping.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompilerChain.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigOption.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurableElementInstance.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Configuration.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurationProperty.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Connector.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConnectorConfiguration.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRule.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRuleKind.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CopyAttributeValue.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DeploymentPlan.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DerivedElement.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMFactory.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMPackage.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Flatten.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Fragment.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationGroup.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationProperties.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InitPrecedence.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InstanceConfigurator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InteractionComponent.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionKind.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionRule.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/OperatingSystem.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Port.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/PortKind.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ProgLanguage.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/RuleApplication.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Singleton.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Target.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TargetArchitecture.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Template.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TemplatePort.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/UseInstanceConfigurator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AssemblyImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexPerNodeImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindTemplateImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindingHelperImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CodeGenOptionsImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompImplTemplateImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompToOOmappingImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompilerChainImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigOptionImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurableElementInstanceImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationPropertyImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorConfigurationImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ContainerRuleImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CopyAttributeValueImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DeploymentPlanImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DerivedElementImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMFactoryImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMPackageImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FlattenImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FragmentImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationGroupImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationPropertiesImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InitPrecedenceImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InstanceConfiguratorImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InteractionComponentImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InterceptionRuleImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/OperatingSystemImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortKindImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ProgLanguageImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/RuleApplicationImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/SingletonImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetArchitectureImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplateImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplatePortImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/UseInstanceConfiguratorImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ConnectorTypeUtil.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMAdapterFactory.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceFactoryImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceImpl.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMSwitch.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMUtil.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMXMLProcessor.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IBindingHelper.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IEmbeddingRule.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IMappingRule.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ITemplateMappingRule.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/MapUtil.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/.classpath delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/.project delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/META-INF/MANIFEST.MF delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/about.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/about.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/build.acceleo delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/build.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/plugin.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/plugin.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/pom.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/externalGenerator.exsd delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/instanceConfig.exsd delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/language.exsd delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/ooTransformation.exsd delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/xtendGenerator.exsd delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Activator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CORBAtypeNames.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CommandSupport.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ConfigUtils.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CreationUtils.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Description.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ElementFilter.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/EnumService.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Log.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Messages.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ModelManagement.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/OperationUtils.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortInfo.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortUtils.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ProjectManagement.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/RunnableWithResult.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/StUtils.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Stereotypes.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/UMLTool.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Utils.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddMarteAndFcmProfile.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddQompassModelLibs.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/AllocUtils.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/BootLoaderGen.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepCreation.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepPlanUtils.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepUtils.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/Deploy.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DeployConstants.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/GatherConfigData.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/ImplementationChooser.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/InstanceDeployer.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/PartialCopy.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/BindingHelperExt.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/EmbeddingRule.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/ExternalGenerator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IEmbeddingRule.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IExternalGenerator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IInstanceConfigurator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IOOTrafo.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IXtend.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/InstanceConfigurator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/OOTrafo.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/XtendGenerator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerateCode.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerationOptions.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/DepPlanListener.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/InterfaceListener.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ModelListener.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/OperationListener.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ParameterListener.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PortListener.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PostCopyListener.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PreCopyListener.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/GenerateMakefile.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/ShowFiles.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/messages.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/preferences/QompassPreferenceConstants.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompImplSync.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompTypeSync.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/DepPlanSync.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/InterfaceSync.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/SyncBehaviorParameters.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/BindingUtils.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/ConnectorBinding.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PostTemplateInstantiationListener.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PreTemplateInstantiationListener.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateInstantiation.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateUtils.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TextTemplateBinding.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/XtendTemplateBinding.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AbstractContainerTrafo.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AllocTransfo.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CompTypeTrafos.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CopyTo.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/ExecuteOOTrafo.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/FlattenInteractionComponents.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/InstantiateDepPlan.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/LWContainerTrafo.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/LazyCopier.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/MainModelTrafo.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/PrefixConstants.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/RuleManagement.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TrafoAndCodegenPackage.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationContext.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationException.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationRTException.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationUtil.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/UpdateUtils.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/connector/ConnectorReification.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/container/ContainerTrafo.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterRuleApplication.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterSignatures.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterStateMachines.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterTemplate.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FixTemplateSync.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/.classpath delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/.project delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/META-INF/MANIFEST.MF delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/about.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/build.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/pom.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Activator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Constants.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Messages.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/messages.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppPortMapping.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppUtils.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/DynamicCpptoOO.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/StaticCppToOO.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/xtend-gen/.gitignore delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/.classpath delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/.project delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/META-INF/MANIFEST.MF delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/about.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/build.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/AddPorts.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeCompilation.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeGeneration.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentDev.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentImplementation.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentModel.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/DeploymentPlan.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Main.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddComponents.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddPorts.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteMain.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteNewModel.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/NewModel.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/OpenExample.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/PlatformModel.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Validation.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/index.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/tocconcepts.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/tocdevguide.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/tocreference.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/bibliography.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/codegen.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/connector-container.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/input-models.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/overview.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/DefineNewPortKinds.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createContainers.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createInteractionComponents.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/developer.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/org.eclipse.papyrus.qompass.designer.core.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/arrow.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-after-trafo.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-before-trafo.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-selection.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-aggregation.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-connector.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor2.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-selection.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.pdf delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-flex-eWare-small.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-marte.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-papyrus.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.odg delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.pdf delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.vsd delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass-0.33.jpg delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass.jpg delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-after-trafo.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-before-trafo.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-selection.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-aggregation.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor2.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-selection.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/statemachine-rule.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.odg delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/trace2.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/component.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/container.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/interactionComponent.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/port.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/portKind.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/trafos.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/sitestyle.css delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/plugin.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/plugin.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/pom.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/src/org/eclipse/papyrus/qompass/designer/doc/Activator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/toc.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/.classpath delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/.project delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/META-INF/MANIFEST.MF delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/about.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/build.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/plugin.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/plugin.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/pom.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Activator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Messages.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/messages.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/xtend/JavaToOO.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/xtend-gen/.gitignore delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/.classpath delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/.project delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/META-INF/MANIFEST.MF delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/about.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/build.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/ADLInFlowPort.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/Qompass-16x16.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/Stereotype.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/allocation.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/depPlan.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/deploy.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-16x16.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-32x32.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/sample.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/selConnector.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/selContainer.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/sync.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/plugin.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/plugin.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/pom.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Activator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Messages.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AllocationDialog.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AttributeLabelProvider.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChooseConfigOpt.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChoosePorts.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigOptionLabelProvider.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigureInstanceDialog.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigurePortDialog.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConnectorSelectionDialog.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ContainerDialog.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/GenerationOptionsDialog.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InstanceLabelProvider.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InteractiveImplementationChooser.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/NameLabelProvider.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/PortLabelProvider.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/QNameLabelProvider.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/RuleLabelProvider.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AddProfileAndModelLibsHandler.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AllocateHandler.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigureInstanceHandler.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreateDepPlanHandler.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreatePlatformHandler.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenCollaborationUseHandler.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenConnectionPatternHandler.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/InstantiateDepPlanHandler.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectConnectorHandler.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectContainerHandler.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SyncHandler.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/TrafoAndCodegenHandler.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/messages.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferenceInitializer.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferencePage.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/.classpath delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/.project delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/META-INF/MANIFEST.MF delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/about.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/build.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/icons/validate.gif delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/plugin.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/plugin.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/pom.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/Activator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/ValidationDelegateClientSelector.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/AggregationKindValid.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/BehaviorsWithoutSpecification.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConfigurationAttributeNotSet.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorCallMultiplicity.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorConnectable.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/DuplicateOperation.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ExecutorIsNotUsedAsPartName.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InitialEntryPoints.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InstanceSpecificationSlotForAllProperties.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsAreImplemented.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsWithTwoReturnValues.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortIsCorrectlyTyped.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortKindUnset.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/SystemHasNoPorts.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/TemplateRefWithoutBinding.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedPorts.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedProvPorts.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedReqPorts.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/.classpath delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/.project delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/META-INF/MANIFEST.MF delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/about.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/build.acceleo delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/build.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/plugin.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/pom.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Activator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Messages.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.emtl delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.mtl delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/messages.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.classpath delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.gitignore delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.project delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/ExtendedPort.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/components/HelloWorld.cpp delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/components/HelloWorld.h delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/platform/MonoNode.cpp delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/platform/MonoNode.h delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/META-INF/MANIFEST.MF delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/about.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/build.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-examples.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-library.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/hello-world.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/producer-consumer.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_with_error.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_without_error.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/allocate.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/c-cpp-view.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/configure-instance.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/deployment-plan.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/hello-world.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/platform.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/system.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/dep-plans.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/generated-container.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/pull-consumer.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-consumer.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-producer.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-pull.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-push.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/corba.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/core.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/osal.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/statemachine.html delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.svg delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.pdf delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.svg delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.svg delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.svg delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.svg delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.svg delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.svg delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.svg delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/In.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/InOut.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Out.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Provided.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/ProvidedRequired.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Required.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/In.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/InOut.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Out.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Provided.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/ProvidedRequired.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Required.png delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.di delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.notation delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.uml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.properties delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/pom.xml delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/Activator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindCppIncludeToFirstActual.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindOperation.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/InstantiateCppIncludeWithItSelf.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/LoopOperations.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/embeddingrules/AccordCall.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/AnimServiceConfigurator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/CallEventConfigurator.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIcallback.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIpoll.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort2.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ProvideInterface.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PullConsumer.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushConsumer.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProducer.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/TemplatePort.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseConjIntf.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseInterface.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AMIPull.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AsyncCalls.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/BehaviorUtil.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/CppUtils.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/FIFO.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/GlobalConstants.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/Marshalling.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/MultipleReceptacle.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineGen.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineUtil.java delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StructBasedMarshalling.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/SyncCalls.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLAction.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLChain.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlatModel2Cpp.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlattener.xtend delete mode 100644 extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/xtend-gen/.gitignore delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.classpath delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.project delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/META-INF/MANIFEST.MF delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/about.html delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/build.properties delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_16x16.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_9x9.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp_disabled.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_16x16.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_9x9.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/debug.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/properties.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_11x12.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_16x16.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_11x12.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_16x16.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.properties delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.xml delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/pom.xml delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/schema/traceMechanism.exsd delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Activator.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/ITraceMechanism.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/MarkerUtils.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Messages.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceActions.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceFunctions.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceMechanism.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceState.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TracepointConstants.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/AbstractTracepointCommand.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointActivationCommand.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointCommand.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointActivationCommand.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointCommand.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/dialogs/TraceActionSelection.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/AbstractCommandHandler.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointActivationHandler.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointHandler.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointActivationHandler.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointHandler.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/TracepointPropertiesHandler.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/messages.properties delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/BinaryEncodedMChoiceFieldEditor.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/MultipleChoiceFieldEditor.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceConstants.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceInitializer.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferencePage.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.classpath delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.gitignore delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.project delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/META-INF/MANIFEST.MF delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/about.html delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.properties delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/help/tocconcepts.xml delete mode 100755 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image001.gif delete mode 100755 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image002.gif delete mode 100755 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image003.gif delete mode 100755 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image004.jpg delete mode 100755 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image005.jpg delete mode 100755 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image006.jpg delete mode 100755 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image007.gif delete mode 100755 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image008.jpg delete mode 100755 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image009.jpg delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/userguide.htm delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.di delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.notation delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.uml delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.di delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.notation delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.uml delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.di delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.notation delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.uml delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.di delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.notation delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.uml delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.properties delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.xml delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/pom.xml delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/Activator.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorOTF.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorTrace.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/QompassTraceMechanism.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/StringConstants.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceCout.xtend delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceLTTng.xtend delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceOTF.xtend delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceUtils.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/xtend-gen/.gitignore delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/.classpath delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/.project delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/.settings/org.eclipse.jdt.core.prefs delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/META-INF/MANIFEST.MF delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/about.html delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/build.properties delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/breakpoint_view.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/gotoobj_tsk.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/skip_brkp.gif delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.properties delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.xml delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/pom.xml delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/Activator.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TraceViewImages.java delete mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TracepointView.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/.classpath create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/.project create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/about.html create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/build.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/plugin.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/plugin.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/pom.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/Activator.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CCNamedProjectWizard.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTMainWizardPageV.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTSettings.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CNamedProjectWizard.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CProjectSupport.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/C_CppProjectSupport.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CppProjectSupport.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/.classpath create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/.project create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/about.html create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/build.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/icons/codegen.gif create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/plugin.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/plugin.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/pom.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/Activator.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/CDTprojectHandler.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/GenerateCodeHandler.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/preferences/CodegenPreferencePage.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/.classpath create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/.project create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/about.html create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/build.acceleo create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/build.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/plugin.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/plugin.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/pom.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Activator.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Constants.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/CppLangCodegen.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Messages.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/messages.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenConstants.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenPreferenceInitializer.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenUtils.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppLocationStrategy.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppModelElementsCreator.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ClassUtils.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ILocateCppProject.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/LocateCppProject.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Messages.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/messages.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppAttribute.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassAttributesDeclaration.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassFriendDeclaration.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeClassDeclaration.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeDeclaration.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassInheritedDeclarations.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsDeclaration.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsImplementation.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassTypeAndEnum.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassifierGenerator.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppDocumentation.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppEnumerations.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppIncludeUtil.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppInnerClassifiers.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppOperations.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPackageHeaderGenerator.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppParameter.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPrimitiveTypes.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppTemplates.xtend create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/xtend-gen/.gitignore create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/.classpath create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/.project create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/about.html create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/build.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.di create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.notation create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.uml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/plugin.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/plugin.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/pom.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/Activator.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/HelloWorldOOModelWizard.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/.classpath create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/.project create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/about.html create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/build.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/icons/transfo_cpp.gif create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/plugin.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/plugin.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/pom.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/src/org/eclipse/papyrus/cpp/library/ui/Activator.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.classpath create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.project create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/about.html create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/build.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/models/AnsiCLibrary.di create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/models/AnsiCLibrary.notation create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/models/AnsiCLibrary.uml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/plugin.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/plugin.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/pom.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/src/org/eclipse/papyrus/cpp/library/Activator.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/.classpath create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/.project create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/about.html create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/build.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/icons/transfo_cpp.gif create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/plugin.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/plugin.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/pom.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/src/org/eclipse/papyrus/cpp/profile/ui/Activator.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.classpath create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.project create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/about.html create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/build.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.di create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.notation create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.uml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/plugin.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/plugin.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/pom.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.ecore create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.genmodel create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.di create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.notation create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.uml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.di create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.notation create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.uml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Array.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppFactory.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppPackage.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Const.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ConstInit.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppInit.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppRoot.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EAccessKind.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EStorageClass.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ExternLibrary.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/External.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Friend.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Include.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Inline.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ManualGeneration.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Mutable.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/NoCodeGen.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ptr.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ref.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/StorageClass.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Template.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateBinding.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateParameter.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Typedef.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Union.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Variadic.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Virtual.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Visibility.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/VisibilityKind.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Volatile.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ArrayImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppFactoryImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppPackageImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstInitImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppInitImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppRootImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternLibraryImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternalImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/FriendImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/IncludeImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/InlineImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ManualGenerationImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/MutableImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/NoCodeGenImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/PtrImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/RefImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/StorageClassImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateBindingImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateParameterImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TypedefImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/UnionImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VariadicImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VirtualImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VisibilityImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VolatileImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppAdapterFactory.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceFactoryImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceImpl.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppSwitch.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppXMLProcessor.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/cpp/profile/Activator.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/.cproject create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/.gitignore create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/.project create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.di create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.notation create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.uml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.di create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.notation create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.uml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/.classpath create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/.project create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/about.html create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/build.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.gif create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.xcf create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/plugin.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/plugin.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/pom.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Activator.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/AddProfileAndModelLibsHandler.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/CommandSupport.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/TextEditorConstants.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Utils.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/DelegatingSourceViewer.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/PapyrusCDTEditor.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/factory/PapyrusCDTEditorFactory.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/handler/PapyrusCDTEditorHandler.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ChangeKind.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/Closure.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ModelListener.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/OperationHistoryListener.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/modelresource/TextEditorModelSharedResource.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceConstants.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceInitializer.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferencePage.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/FindTransition.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ObtainICElement.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ParameterModifiers.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/RevealCurrentOperation.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncCDTtoModel.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncModelToCDT.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/.classpath create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/.project create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/about.html create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/about.ini create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/build.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/plugin.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/plugin.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/pom.xml create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/Papyrus_32x32.gif create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/save_edit.gif create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp.gif create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp_old.gif create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/undo_edit.gif create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/AbstractCppPanelView.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.properties create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CommandSupport.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CppPanelView.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/listeners/UMLElementPanelListener.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppAbstractPanel.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppBehaviorPanel.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppClassPanel.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppDefaultPanel.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppGeneralizationPanel.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppOperationPanel.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPackagePanel.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppParameterPanel.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPrimitiveTypePanel.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPropertyPanel.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateBindingPanel.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateParameterPanel.java create mode 100644 extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/PanelFactory.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java-updatesite/.project create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java-updatesite/site.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.classpath create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.project create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/about.html create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/build.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generate.psd create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generation.png create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/sample.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/plugin.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/pom.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/GeneratorPreference.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/RunGenerator.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCommentable.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCompilationUnit.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTField.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTGetterSetter.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaModel.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaProject.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTMethod.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragment.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragmentRoot.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTType.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchTools.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.classpath create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.project create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/about.html create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/build.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTClass.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTEnum.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTInterface.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTType.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaModel_javaProject_JDTJavaProject.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaProject_packageFragmentRoots_JDTPackageFragmentRoot.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMember_typeParameters_JDTTypeParameter.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_JDTOpaqueBody.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_OpaqueMethodBody.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_parameters_JDTParameter.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_returnType_JDTParameter.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragmentRoot_packageFragments_JDTPackageFragment.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_compilationUnits_JDTCompilationUnit.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_packageFragments_JDTPackageFragment.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_fields_JDTField.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_methods_JDTMethod.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTClass.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTEnum.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTInterface.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTType.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTClass.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTCompilationUnit.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTEnum.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTException.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTField.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportContainer.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportDeclaration.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTInterface.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaElement.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaModel.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaProject.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTMethod.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTOpaqueBody.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragment.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragmentRoot.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTParameter.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTTypeParameter.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/OpaqueMethodBody.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/Options.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/pom.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmEditPlugin.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmItemProviderAdapterFactory.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/OptionsItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTClassItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTCompilationUnitItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTEnumItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTExceptionItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTFieldItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportContainerItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportDeclarationItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTInterfaceItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaElementItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaModelItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaProjectItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMemberItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodBodyItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTOpaqueBodyItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentRootItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParameterItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentJavaElementItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeParameterItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeRootItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmEditPlugin.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmItemProviderAdapterFactory.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.classpath create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.project create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/about.html create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/build.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/obj16/JdtmmModelFile.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/wizban/NewJdtmm.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/pom.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmActionBarContributor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditorPlugin.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmModelWizard.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmActionBarContributor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditorPlugin.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmModelWizard.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.classpath create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.project create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/about.html create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/build.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.di create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.ecore create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.genmodel create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.notation create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.uml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.di create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.ecore create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.genmodel create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.notation create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.uml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.di create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.notation create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.uml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/pom.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmFactory.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmPackage.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/Options.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmFactoryImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmPackageImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/OptionsImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmAdapterFactory.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmSwitch.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTClass.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTCompilationUnit.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTEnum.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTException.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTField.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportContainer.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTInterface.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaElement.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaModel.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaProject.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMember.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethod.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethodBody.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTOpaqueBody.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragment.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragmentRoot.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParameter.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParent.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParentJavaElement.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTType.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeParameter.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeRoot.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmFactory.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmPackage.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/TrueFalseDefault.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/VisibilityKind.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTClassImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTCompilationUnitImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTEnumImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTExceptionImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTFieldImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportContainerImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportDeclarationImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTInterfaceImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaElementImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaModelImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaProjectImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMemberImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodBodyImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTOpaqueBodyImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentRootImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParameterImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentJavaElementImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeParameterImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeRootImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmFactoryImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmPackageImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmAdapterFactory.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmPreference.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmSwitch.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitorException.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/utils/DerivedNotifyingEList.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.classpath create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.project create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/about.html create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/build.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.di create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.notation create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.uml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/plugin.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/pom.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/src/org/eclipse/papyrus/java/generator/transfo/umltojdt/UmltojdtActivator.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/algo.txt create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/stereotypeUtil.qvto create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/uml2jdt2.qvto create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.classpath create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.project create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/about.html create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/build.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/icons/generate.psd create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/icons/generation.png create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/icons/sample.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/plugin.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/plugin.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/pom.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/Activator.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/handlers/GenerateJavaCodeHandler.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GeneratorPreferenceImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GenericClassFieldEditor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PackageListEditor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceConstants.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceInitializer.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferencePage.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.classpath create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.project create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/about.html create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/build.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaClass.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaMethod.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaPackage_.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaParameter.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProject.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProperty.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaSrcFolder.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/PrimitiveType.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/plugin.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/plugin.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/pom.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaClassItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaEditPlugin.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaGenItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaItemProviderAdapterFactory.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaMethodItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaNamedElementItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPackage_ItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaParameterItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaProjectItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPropertyItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaSrcFolderItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/PrimitiveTypeItemProvider.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.classpath create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.project create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/about.html create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/build.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/icons/full/obj16/JavaModelFile.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/icons/full/wizban/NewJava.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/plugin.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/plugin.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/pom.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaActionBarContributor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditorPlugin.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaModelWizard.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.classpath create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.project create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/about.html create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/build.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/icons/javaprofile.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.ecore create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.di create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.genmodel create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.notation create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.uml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/plugin.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/plugin.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/pom.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaClass.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaFactory.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaGen.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaMethod.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaNamedElement.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage_.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaParameter.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProject.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProperty.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaSrcFolder.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/PrimitiveType.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/TrueFalseDefault.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaClassImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaFactoryImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaGenImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaMethodImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaNamedElementImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackageImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackage_Impl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaParameterImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaProjectImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPropertyImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaSrcFolderImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/PrimitiveTypeImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaAdapterFactory.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceFactoryImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceImpl.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaSwitch.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaXMLProcessor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.classpath create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.project create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.core.resources.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/about.html create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/build.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/icons/associationFromProperty.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/icons/javaReverse.gif create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/plugin.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/plugin.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/pom.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Activator.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DisplayReverse.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DndReverseCodeHandler.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/JavaCodeReverse.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Messages.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/ReverseCodeHandler.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/TreeSelectionList.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/DndReverseCodeDialog.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/InputListDialog.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/ReverseCodeDialog.java create mode 100755 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseCommand.java create mode 100755 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseStrategy.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/Messages.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/messages.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/handlers/CreateAssociationFromPropertyHandler.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/messages.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.classpath create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.project create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/about.html create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/build.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/plugin.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/pom.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParser.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserConstants.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserTokenManager.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaCharStream.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaParser.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ParseException.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/Token.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/TokenMgrError.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/BlockComment.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Comment.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/CompilationUnit.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/ImportDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/LineComment.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Node.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/PackageDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/TypeParameter.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationMemberDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/BodyDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ClassOrInterfaceDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ConstructorDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyMemberDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyTypeDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumConstantDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/FieldDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/InitializerDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/JavadocComment.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/MethodDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ModifierSet.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/Parameter.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/TypeDeclaration.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclarator.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclaratorId.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AnnotationExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayAccessExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayCreationExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayInitializerExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AssignExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BinaryExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BooleanLiteralExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CastExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CharLiteralExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ClassExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ConditionalExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/DoubleLiteralExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/EnclosedExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/Expression.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/FieldAccessExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/InstanceOfExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralMinValueExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LiteralExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralMinValueExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MarkerAnnotationExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MemberValuePair.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MethodCallExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NameExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NormalAnnotationExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NullLiteralExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ObjectCreationExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/QualifiedNameExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SingleMemberAnnotationExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/StringLiteralExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SuperExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ThisExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/UnaryExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/VariableDeclarationExpr.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/AssertStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BlockStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BreakStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/CatchClause.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ContinueStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/DoStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/EmptyStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExplicitConstructorInvocationStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExpressionStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForeachStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/IfStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/LabeledStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ReturnStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/Statement.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchEntryStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SynchronizedStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ThrowStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TryStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TypeDeclarationStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/WhileStmt.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ClassOrInterfaceType.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/PrimitiveType.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ReferenceType.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/Type.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/VoidType.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/WildcardType.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/DumpVisitor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitorAdapter.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitorAdapter.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/java_1_5.jj create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ClassifierCatalog.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CompilationUnitAnalyser.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CreationPackageCatalog.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CuPrinter.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericSwitchVisitor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericTransformer.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ImportedTypeCatalog.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ModelManager.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/QualifiedName.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/SwitchVisitor.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyser.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyserAndTranslator.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlParser.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlUtils.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/Activator.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/utils/TypeOperationsEnhanced.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.classpath create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.project create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/about.html create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/build.properties create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/plugin.xml create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/Activator.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/BundleActivatorResolver.java create mode 100644 extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/RegisterResolver.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.classpath create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.project create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/about.html create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/build.properties create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/icons/codegen-16x16.gif create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/plugin.properties create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/pom.xml create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Activator.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/GenUtils.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/HierarchyLocationStrategy.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ILocationStrategy.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/IPFileSystemAccess.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/JavaIoFileSystemAccess.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Messages.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ModelElementsCreator.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ProjectBasedFileAccess.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ChangeObject.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ManageChangeEvents.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/RecordEventsListener.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/messages.properties create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/.classpath create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/.project create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/about.html create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/build.properties create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.properties create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.xml create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/pom.xml create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageCodegen.exsd create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageProject.exsd create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/AbstractSettings.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Activator.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GenerationConstants.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GeneratorSelectionDialog.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen2.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangProjectSupport.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageCodegen.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageProjectSupport.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Messages.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/MethodInfo.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/SyncInformation.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/messages.properties create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/.classpath create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/.project create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/about.html create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/build.properties create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.ecore create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.genmodel create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/plugin.properties create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/plugin.xml create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/pom.xml create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModel.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelFactory.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelPackage.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelFactoryImpl.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelImpl.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelPackageImpl.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelAdapterFactory.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelSwitch.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.classpath create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.project create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/about.html create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/build.properties create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.properties create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.xml create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/pom.xml create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/resources/TextEditorFacet.custom create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/Activator.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/adapters/TextEditorAdapterFactory.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetContainedTextEditors.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorIcon.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorName.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/IsTextEditorContainer.java create mode 100644 extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/.classpath create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/.project create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/about.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/build.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/connector.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/connector.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/deploy.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/fcm.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/hires/connector.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/port.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/target.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.ecore create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.genmodel create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/palettes/palette-classdep.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/palettes/palette-composite.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/plugin.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/plugin.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/pom.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/schema/fcmBindingHelper.exsd create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/schema/fcmEmbeddingRule.exsd create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/schema/fcmPortMappingRule.exsd create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Activator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Assembly.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndex.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndexPerNode.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindTemplate.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindingHelper.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CodeGenOptions.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompImplTemplate.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompToOOmapping.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompilerChain.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigOption.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurableElementInstance.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Configuration.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurationProperty.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Connector.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConnectorConfiguration.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRule.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRuleKind.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CopyAttributeValue.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DeploymentPlan.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DerivedElement.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMFactory.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMPackage.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Flatten.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Fragment.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationGroup.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationProperties.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InitPrecedence.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InstanceConfigurator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InteractionComponent.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionKind.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionRule.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/OperatingSystem.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Port.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/PortKind.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ProgLanguage.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/RuleApplication.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Singleton.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Target.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TargetArchitecture.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Template.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TemplatePort.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/UseInstanceConfigurator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AssemblyImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexPerNodeImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindTemplateImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindingHelperImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CodeGenOptionsImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompImplTemplateImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompToOOmappingImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompilerChainImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigOptionImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurableElementInstanceImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationPropertyImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorConfigurationImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ContainerRuleImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CopyAttributeValueImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DeploymentPlanImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DerivedElementImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMFactoryImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMPackageImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FlattenImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FragmentImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationGroupImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationPropertiesImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InitPrecedenceImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InstanceConfiguratorImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InteractionComponentImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InterceptionRuleImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/OperatingSystemImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortKindImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ProgLanguageImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/RuleApplicationImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/SingletonImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetArchitectureImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplateImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplatePortImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/UseInstanceConfiguratorImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ConnectorTypeUtil.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMAdapterFactory.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceFactoryImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceImpl.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMSwitch.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMUtil.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMXMLProcessor.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IBindingHelper.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IEmbeddingRule.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IMappingRule.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ITemplateMappingRule.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/MapUtil.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/.classpath create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/.project create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/about.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/about.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/build.acceleo create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/build.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/plugin.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/plugin.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/pom.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/externalGenerator.exsd create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/instanceConfig.exsd create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/language.exsd create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/ooTransformation.exsd create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/xtendGenerator.exsd create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Activator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CORBAtypeNames.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CommandSupport.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ConfigUtils.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CreationUtils.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Description.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ElementFilter.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/EnumService.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Log.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Messages.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ModelManagement.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/OperationUtils.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortInfo.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortUtils.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ProjectManagement.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/RunnableWithResult.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/StUtils.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Stereotypes.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/UMLTool.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Utils.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddMarteAndFcmProfile.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddQompassModelLibs.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/AllocUtils.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/BootLoaderGen.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepCreation.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepPlanUtils.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepUtils.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/Deploy.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DeployConstants.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/GatherConfigData.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/ImplementationChooser.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/InstanceDeployer.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/PartialCopy.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/BindingHelperExt.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/EmbeddingRule.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/ExternalGenerator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IEmbeddingRule.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IExternalGenerator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IInstanceConfigurator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IOOTrafo.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IXtend.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/InstanceConfigurator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/OOTrafo.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/XtendGenerator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerateCode.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerationOptions.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/DepPlanListener.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/InterfaceListener.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ModelListener.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/OperationListener.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ParameterListener.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PortListener.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PostCopyListener.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PreCopyListener.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/GenerateMakefile.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/ShowFiles.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/messages.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/preferences/QompassPreferenceConstants.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompImplSync.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompTypeSync.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/DepPlanSync.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/InterfaceSync.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/SyncBehaviorParameters.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/BindingUtils.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/ConnectorBinding.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PostTemplateInstantiationListener.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PreTemplateInstantiationListener.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateInstantiation.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateUtils.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TextTemplateBinding.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/XtendTemplateBinding.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AbstractContainerTrafo.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AllocTransfo.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CompTypeTrafos.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CopyTo.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/ExecuteOOTrafo.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/FlattenInteractionComponents.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/InstantiateDepPlan.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/LazyCopier.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/MainModelTrafo.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/PrefixConstants.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/RuleManagement.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TrafoAndCodegenPackage.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationContext.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationException.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationRTException.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationUtil.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/UpdateUtils.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/connector/ConnectorReification.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/container/ContainerTrafo.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/container/LWContainerTrafo.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterRuleApplication.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterSignatures.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterStateMachines.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterTemplate.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FixTemplateSync.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/.classpath create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/.project create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/about.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/build.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/pom.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Activator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Constants.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Messages.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/messages.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppPortMapping.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppUtils.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/DynamicCpptoOO.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/StaticCppToOO.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/xtend-gen/.gitignore create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/.classpath create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/.project create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/about.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/build.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/AddPorts.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeCompilation.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeGeneration.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentDev.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentImplementation.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentModel.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/DeploymentPlan.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Main.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddComponents.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddPorts.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteMain.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteNewModel.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/NewModel.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/OpenExample.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/PlatformModel.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Validation.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/index.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/tocconcepts.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/tocdevguide.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/tocreference.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/bibliography.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/codegen.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/connector-container.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/input-models.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/overview.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/DefineNewPortKinds.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createContainers.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createInteractionComponents.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/developer.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/org.eclipse.papyrus.qompass.designer.core.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/arrow.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-after-trafo.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-before-trafo.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-selection.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-aggregation.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-connector.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor2.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-selection.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.pdf create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-flex-eWare-small.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-marte.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-papyrus.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.odg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.pdf create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.vsd create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass-0.33.jpg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass.jpg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-after-trafo.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-before-trafo.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-selection.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-aggregation.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor2.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-selection.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/statemachine-rule.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.odg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/trace2.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/component.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/container.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/interactionComponent.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/port.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/portKind.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/trafos.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/sitestyle.css create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/plugin.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/plugin.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/pom.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/src/org/eclipse/papyrus/qompass/designer/doc/Activator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/toc.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/.classpath create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/.project create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/about.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/build.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/plugin.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/plugin.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/pom.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Activator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Messages.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/messages.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/xtend/JavaToOO.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/xtend-gen/.gitignore create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/.classpath create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/.project create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/about.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/build.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/ADLInFlowPort.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/Qompass-16x16.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/Stereotype.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/allocation.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/depPlan.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/deploy.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-16x16.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-32x32.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/sample.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/selConnector.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/selContainer.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/sync.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/plugin.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/plugin.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/pom.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Activator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Messages.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AllocationDialog.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AttributeLabelProvider.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChooseConfigOpt.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChoosePorts.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigOptionLabelProvider.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigureInstanceDialog.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigurePortDialog.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConnectorSelectionDialog.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ContainerDialog.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/GenerationOptionsDialog.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InstanceLabelProvider.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InteractiveImplementationChooser.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/NameLabelProvider.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/PortLabelProvider.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/QNameLabelProvider.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/RuleLabelProvider.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AddProfileAndModelLibsHandler.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AllocateHandler.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigureInstanceHandler.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreateDepPlanHandler.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreatePlatformHandler.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenCollaborationUseHandler.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenConnectionPatternHandler.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/InstantiateDepPlanHandler.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectConnectorHandler.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectContainerHandler.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SyncHandler.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/TrafoAndCodegenHandler.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/messages.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferenceInitializer.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferencePage.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/.classpath create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/.project create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/about.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/build.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/icons/validate.gif create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/plugin.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/plugin.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/pom.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/Activator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/ValidationDelegateClientSelector.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/AggregationKindValid.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/BehaviorsWithoutSpecification.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConfigurationAttributeNotSet.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorCallMultiplicity.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorConnectable.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/DuplicateOperation.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ExecutorIsNotUsedAsPartName.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InitialEntryPoints.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InstanceSpecificationSlotForAllProperties.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsAreImplemented.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsWithTwoReturnValues.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortIsCorrectlyTyped.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortKindUnset.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/SystemHasNoPorts.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/TemplateRefWithoutBinding.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedPorts.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedProvPorts.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedReqPorts.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/.classpath create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/.project create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/about.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/build.acceleo create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/build.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/plugin.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/pom.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Activator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Messages.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.emtl create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.mtl create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/messages.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.classpath create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.gitignore create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.project create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/ExtendedPort.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/about.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/build.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-examples.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-library.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/hello-world.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/producer-consumer.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_with_error.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_without_error.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/allocate.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/c-cpp-view.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/configure-instance.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/deployment-plan.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/hello-world.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/platform.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/system.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/dep-plans.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/generated-container.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/pull-consumer.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-consumer.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-producer.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-pull.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-push.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/corba.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/core.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/osal.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/statemachine.html create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-CDTeditor.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-OpenCDTeditor.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-classdiag.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-component.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-component.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-deployment.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-deployment.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-platform.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-platform.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-system.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-system.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.pdf create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/In.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/InOut.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Out.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Provided.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/ProvidedRequired.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Required.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/In.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/InOut.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Out.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Provided.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/ProvidedRequired.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Required.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/port-kinds.png create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/port-kinds.svg create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.di create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.notation create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.uml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.properties create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/pom.xml create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/Activator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindCppIncludeToFirstActual.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindOperation.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/InstantiateCppIncludeWithItSelf.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/LoopOperations.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/embeddingrules/AccordCall.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/AnimServiceConfigurator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/CallEventConfigurator.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIcallback.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIpoll.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort2.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ProvideInterface.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PullConsumer.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushConsumer.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProducer.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/TemplatePort.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseConjIntf.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseInterface.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AMIPull.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AsyncCalls.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/BehaviorUtil.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/CppUtils.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/FIFO.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/GlobalConstants.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/Marshalling.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/MultipleReceptacle.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineGen.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineUtil.java create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StructBasedMarshalling.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/SyncCalls.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLAction.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLChain.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlatModel2Cpp.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlattener.xtend create mode 100644 extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/xtend-gen/.gitignore create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracebreakpoints.ui/.project create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracebreakpoints/.project create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.classpath create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.project create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/about.html create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/build.properties create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_16x16.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_9x9.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp_disabled.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_16x16.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_9x9.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/debug.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/properties.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_11x12.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_16x16.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_11x12.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_16x16.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.properties create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.xml create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/pom.xml create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/schema/traceMechanism.exsd create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Activator.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/ITraceMechanism.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/MarkerUtils.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Messages.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceActions.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceFunctions.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceMechanism.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceState.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TracepointConstants.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/AbstractTracepointCommand.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointActivationCommand.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointCommand.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointActivationCommand.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointCommand.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/dialogs/TraceActionSelection.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/AbstractCommandHandler.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointActivationHandler.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointHandler.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointActivationHandler.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointHandler.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/TracepointPropertiesHandler.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/messages.properties create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/BinaryEncodedMChoiceFieldEditor.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/MultipleChoiceFieldEditor.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceConstants.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceInitializer.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferencePage.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.classpath create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.gitignore create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.project create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/about.html create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.properties create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/help/tocconcepts.xml create mode 100755 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image001.gif create mode 100755 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image002.gif create mode 100755 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image003.gif create mode 100755 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image004.jpg create mode 100755 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image005.jpg create mode 100755 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image006.jpg create mode 100755 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image007.gif create mode 100755 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image008.jpg create mode 100755 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image009.jpg create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/userguide.htm create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.di create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.notation create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.uml create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.di create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.notation create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.uml create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.di create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.notation create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.uml create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.di create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.notation create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.uml create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.properties create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.xml create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/pom.xml create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/Activator.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorOTF.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorTrace.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/QompassTraceMechanism.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/StringConstants.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceCout.xtend create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceLTTng.xtend create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceOTF.xtend create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceUtils.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/xtend-gen/.gitignore create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/.classpath create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/.project create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/about.html create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/build.properties create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/breakpoint_view.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/gotoobj_tsk.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/skip_brkp.gif create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.properties create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.xml create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/pom.xml create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/Activator.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TraceViewImages.java create mode 100644 extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TracepointView.java create mode 100644 extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.classpath create mode 100644 extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.project create mode 100644 extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.settings/org.eclipse.jdt.core.prefs create mode 100644 extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.settings/org.eclipse.jdt.ui.prefs create mode 100644 extraplugins/qompass/org.eclipse.papyrus.qompass.ui/META-INF/MANIFEST.MF create mode 100644 extraplugins/qompass/org.eclipse.papyrus.qompass.ui/about.html create mode 100644 extraplugins/qompass/org.eclipse.papyrus.qompass.ui/build.properties create mode 100644 extraplugins/qompass/org.eclipse.papyrus.qompass.ui/icons/qompass-16x16.gif create mode 100644 extraplugins/qompass/org.eclipse.papyrus.qompass.ui/plugin.properties create mode 100644 extraplugins/qompass/org.eclipse.papyrus.qompass.ui/plugin.xml create mode 100644 extraplugins/qompass/org.eclipse.papyrus.qompass.ui/pom.xml create mode 100644 extraplugins/qompass/org.eclipse.papyrus.qompass.ui/src/org/eclipse/papyrus/qompass/ui/Activator.java create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/.project create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/build.properties create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/epl-v10.html create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/feature.properties create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/feature.xml create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/license.html create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/pom.xml create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/.project create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/build.properties create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/epl-v10.html create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/feature.properties create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/feature.xml create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/license.html create mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/pom.xml delete mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/.project delete mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/build.properties delete mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/epl-v10.html delete mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/feature.properties delete mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/feature.xml delete mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/license.html delete mode 100644 features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/pom.xml diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/.classpath b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/.project b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/.project deleted file mode 100644 index 09d5deae110..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.acceleo.debug - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/META-INF/MANIFEST.MF deleted file mode 100644 index 97575a4f3e5..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.uml2.uml;bundle-version="4.0.0", - org.eclipse.acceleo.engine;bundle-version="3.2.2", - org.eclipse.papyrus.fcm.profile;bundle-version="1.2.0", - org.eclipse.papyrus.acceleo;bundle-version="1.2.0", - org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="1.2.0", - org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", - org.eclipse.papyrus.acceleo.ui;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.acceleo.debug.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.acceleo.debug;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/about.html b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/build.properties b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/build.properties deleted file mode 100644 index f1e29af020a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties,\ - about.html,\ - icons/,\ - plugin.xml -src.includes = about.html diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/icons/allocation.gif b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/icons/allocation.gif deleted file mode 100644 index ced634f9c9c..00000000000 Binary files a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/icons/allocation.gif and /dev/null differ diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/icons/deploy.gif b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/icons/deploy.gif deleted file mode 100644 index 7a7ced35f3d..00000000000 Binary files a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/icons/deploy.gif and /dev/null differ diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/plugin.properties deleted file mode 100644 index 192d490eefe..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus extra: Debug support for Acceleo code generation(Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/plugin.xml deleted file mode 100644 index a20a00b609c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/plugin.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/pom.xml deleted file mode 100644 index d4ff3f66c7a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.acceleo.debug - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/Activator.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/Activator.java deleted file mode 100644 index 2e0ed394293..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/Activator.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.papyrus.acceleo.debug; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.acceleo.debug"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/dialogs/TestAcceleoDialog.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/dialogs/TestAcceleoDialog.java deleted file mode 100644 index 22609454ace..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/dialogs/TestAcceleoDialog.java +++ /dev/null @@ -1,169 +0,0 @@ -package org.eclipse.papyrus.acceleo.debug.dialogs; - -import org.eclipse.papyrus.acceleo.AcceleoDriver; -import org.eclipse.papyrus.acceleo.AcceleoException; -import org.eclipse.papyrus.infra.widgets.toolbox.utils.DialogUtils; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.KeyListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.SelectionStatusDialog; -import org.eclipse.uml2.uml.NamedElement; - -/** - * Select container rules, either from a list of globally defined rules or from - * local rules which may be created "on the fly" by this dialog. - * - * TODO: extend rule application to instances (problematic, since rules - * transformation is done on type level) - * - * @author ansgar - */ -public class TestAcceleoDialog extends SelectionStatusDialog { - - protected NamedElement m_acceleoParam; - - protected Text fTemplate; - - protected Button fApplyAcceleoButton; - - protected Text fOutput; - - protected Text fErr; - - protected static String saveTemplate = ""; - - public TestAcceleoDialog(Shell parent, NamedElement acceleoParam) { - super(parent); - m_acceleoParam = acceleoParam; - } - - /** - * @see SelectionStatusDialog#computeResult() - */ - @Override - protected void computeResult() { - // nothing to do - saveTemplate = fTemplate.getText(); - } - - @Override - public Control createDialogArea(Composite parent) { - Composite contents = (Composite) super.createDialogArea(parent); - // (parent, "Container rules", "Avail. extensions/interceptors"); - - createTextAcceleoGroup(contents); - return contents; - } - - // create instance configuration group - protected void createTextAcceleoGroup(Composite parent) { - GridData groupGridData = DialogUtils.createFillGridData(); - - Group instanceConfigurationGroup = new Group(parent, SWT.BORDER); - instanceConfigurationGroup.setText(" Test Acceleo Template"); - instanceConfigurationGroup.setLayout(new RowLayout(SWT.VERTICAL)); - instanceConfigurationGroup.setLayout(new GridLayout(1, false)); - instanceConfigurationGroup.setLayoutData(groupGridData); - - GridData span2 = new GridData(); - span2.horizontalAlignment = GridData.FILL; - span2.verticalAlignment = GridData.FILL; - span2.grabExcessHorizontalSpace = true; - span2.grabExcessVerticalSpace = true; - span2.widthHint = 400; - span2.heightHint = 150; - - Label descriptionLabel = new Label(instanceConfigurationGroup, SWT.NONE); - descriptionLabel.setText("Template:"); - - fTemplate = new Text(instanceConfigurationGroup, SWT.WRAP - | SWT.V_SCROLL); - fTemplate.setLayoutData(span2); - fTemplate.setText(saveTemplate); - - fApplyAcceleoButton = new Button(instanceConfigurationGroup, SWT.NONE); - fApplyAcceleoButton.setText("instantiate template"); - fApplyAcceleoButton.addKeyListener(new KeyListener() { - - @Override - public void keyReleased(KeyEvent e) { - } - - @Override - public void keyPressed(KeyEvent e) { - System.out.println(e); - } - }); - // fApplyAcceleoButton.setLayoutData(span2); - fApplyAcceleoButton.addSelectionListener(new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - try { - AcceleoDriver.clearErrors(); - String result = AcceleoDriver.bind(fTemplate.getText(), m_acceleoParam); - fOutput.setText(result); - fErr.setText(""); - } - catch (AcceleoException err) { - fOutput.setText(""); - fErr.setText(err.toString()); - } - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - Button fResetButton = new Button(instanceConfigurationGroup, SWT.NONE); - fResetButton.setText("reset acceleo driver (reread initial scripts)"); - fResetButton.addSelectionListener(new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - fOutput.setText(""); - fErr.setText(""); - AcceleoDriver.init(); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - Label resultLabel = new Label(instanceConfigurationGroup, SWT.NONE); - resultLabel.setText("Result:"); - - fOutput = new Text(instanceConfigurationGroup, SWT.WRAP - | SWT.V_SCROLL | SWT.READ_ONLY); - fOutput.setLayoutData(span2); - - Label errLabel = new Label(instanceConfigurationGroup, SWT.NONE); - errLabel.setText("Error:"); - - GridData span3 = new GridData(); - span3.horizontalAlignment = GridData.FILL; - span3.verticalAlignment = GridData.FILL; - span3.grabExcessHorizontalSpace = true; - // span3.grabExcessVerticalSpace = true; - span3.heightHint = 50; - - fErr = new Text(instanceConfigurationGroup, SWT.WRAP - | SWT.V_SCROLL | SWT.READ_ONLY); - fErr.setLayoutData(span3); - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/handlers/ResetAcceleoHandler.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/handlers/ResetAcceleoHandler.java deleted file mode 100644 index b15a519e978..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/handlers/ResetAcceleoHandler.java +++ /dev/null @@ -1,46 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation - *****************************************************************************/ - -package org.eclipse.papyrus.acceleo.debug.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.papyrus.acceleo.AcceleoDriver; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; - -public class ResetAcceleoHandler extends CmdHandler { - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - if (selectedEObject instanceof Element) { - return true; - } - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - if (selectedEObject instanceof NamedElement) { - AcceleoDriver.init(); - } - return null; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/handlers/TestAcceleoHandler.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/handlers/TestAcceleoHandler.java deleted file mode 100644 index a254e6889e5..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.debug/src/org/eclipse/papyrus/acceleo/debug/handlers/TestAcceleoHandler.java +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation - *****************************************************************************/ - -package org.eclipse.papyrus.acceleo.debug.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.papyrus.acceleo.debug.dialogs.TestAcceleoDialog; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.NamedElement; - -/** - * Test the Acceleo handler: call a dialog that opens the - * - * @author ansgar - * - */ -public class TestAcceleoHandler extends CmdHandler { - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - if (selectedEObject instanceof NamedElement) { - return true; - } - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - if (selectedEObject instanceof NamedElement) { - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - new TestAcceleoDialog(Display.getCurrent().getActiveShell(), (NamedElement) selectedEObject).open(); - } - }); - } - return null; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/.classpath b/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/.classpath deleted file mode 100644 index 8a8f1668cdc..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/.project b/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/.project deleted file mode 100644 index 66792fcc3eb..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.acceleo.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/.settings/org.eclipse.jdt.core.prefs b/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f287d53cf45..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/META-INF/MANIFEST.MF deleted file mode 100644 index c31262c4733..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.emf.ecore;bundle-version="2.10.0", - org.eclipse.papyrus.infra.emf;bundle-version="1.2.0" -Bundle-Vendor: Eclipse Modeling Project -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Name: Acceleo UI (Incubation) -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.acceleo.ui.Activator -Bundle-SymbolicName: org.eclipse.papyrus.acceleo.ui;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/about.html b/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/build.properties b/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/build.properties deleted file mode 100644 index feffce05748..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - about.html,\ - icons/ -src.includes = about.html diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/icons/codegen-16x16.gif b/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/icons/codegen-16x16.gif deleted file mode 100644 index d7c1a7365f5..00000000000 Binary files a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/icons/codegen-16x16.gif and /dev/null differ diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/plugin.properties deleted file mode 100644 index 23bbbab2078..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus extra: Acceleo code generation UI support (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/plugin.xml deleted file mode 100644 index 10ffe8d6e48..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/plugin.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/pom.xml deleted file mode 100644 index 03adb18d9de..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.acceleo.ui - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/src/org/eclipse/papyrus/acceleo/ui/Activator.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/src/org/eclipse/papyrus/acceleo/ui/Activator.java deleted file mode 100644 index edaa9308ab4..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo.ui/src/org/eclipse/papyrus/acceleo/ui/Activator.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.papyrus.acceleo.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.acceleo.ui"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/.classpath b/extraplugins/codegen/org.eclipse.papyrus.acceleo/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/.project b/extraplugins/codegen/org.eclipse.papyrus.acceleo/.project deleted file mode 100644 index aaac2164f37..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.papyrus.acceleo - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.acceleo.ide.ui.acceleoBuilder - - - - - - org.eclipse.acceleo.ide.ui.acceleoNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.acceleo/META-INF/MANIFEST.MF deleted file mode 100644 index f605e91b746..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.acceleo -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.acceleo.engine;bundle-version="3.2.2", - org.eclipse.acceleo.parser;bundle-version="3.2.2", - org.eclipse.uml2.uml;bundle-version="4.0.2", - org.eclipse.core.filesystem;bundle-version="1.3.200", - org.eclipse.core.resources -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.acceleo.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.acceleo;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/about.html b/extraplugins/codegen/org.eclipse.papyrus.acceleo/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/build.acceleo b/extraplugins/codegen/org.eclipse.papyrus.acceleo/build.acceleo deleted file mode 100644 index fb14dcfe540..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/build.acceleo +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/build.properties b/extraplugins/codegen/org.eclipse.papyrus.acceleo/build.properties deleted file mode 100644 index 5f3abe40576..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/build.properties +++ /dev/null @@ -1,11 +0,0 @@ -# -#Fri Aug 09 14:41:33 CEST 2013 -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - build.acceleo -output..=bin/ -src.includes=about.html -source..=src/ -customBuildCallbacks=build.acceleo diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.acceleo/plugin.properties deleted file mode 100644 index ddde138c946..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Acceleo integration (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.acceleo/pom.xml deleted file mode 100644 index 49368638af9..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.acceleo - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/AcceleoDriver.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/AcceleoDriver.java deleted file mode 100644 index cd5bb42bb0c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/AcceleoDriver.java +++ /dev/null @@ -1,438 +0,0 @@ -/** - * Copyright CEA-LIST 2009 - * available under EPL 1.0 licence - * - * This file is part of the Qompass tool chain (www.ec3m.net) - * - * http://www.eclipse.org/legal/epl-v10.html - * - * $Id$ - */ - -package org.eclipse.papyrus.acceleo; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.acceleo.common.IAcceleoConstants; -import org.eclipse.acceleo.engine.AcceleoEnginePlugin; -import org.eclipse.acceleo.engine.AcceleoEvaluationException; -import org.eclipse.acceleo.engine.generation.AcceleoEngine; -import org.eclipse.acceleo.engine.generation.strategy.PreviewStrategy; -import org.eclipse.acceleo.model.mtl.Module; -import org.eclipse.acceleo.model.mtl.ModuleElement; -import org.eclipse.acceleo.model.mtl.Template; -import org.eclipse.acceleo.model.mtl.resource.AcceleoResourceSetImpl; -import org.eclipse.acceleo.parser.AcceleoParser; -import org.eclipse.acceleo.parser.AcceleoSourceBuffer; -import org.eclipse.acceleo.parser.cst.ModuleImportsValue; -import org.eclipse.core.runtime.ILogListener; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.ocl.ecore.EcoreEnvironment; -import org.eclipse.ocl.ecore.EcoreOCLStandardLibrary; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.OpaqueBehavior; - -/** - * This class enables the binding of an Acceleo template with a UML element while returning a String - * - * @author ansgar - * - * @deprecated Since this class is no longer used by Qompass, it will eventually be removed - */ -@Deprecated -public class AcceleoDriver { - - public final static String UML_URI = "http://www.eclipse.org/uml2/5.0.0/UML"; //$NON-NLS-1$ - - public final static String DOT = "."; //$NON-NLS-1$ - - /** - * URI of file that is currently evaluated - */ - public static final URI currentURI = URI.createURI("current." + IAcceleoConstants.EMTL_FILE_EXTENSION); //$NON-NLS-1$ - - public static void init() { - engine = new AcceleoEngine(); - parser = new AcceleoParser(); - hasErrors = false; - lastErrors = false; - // some errors are silently captured inside the evaluation query (@see AcceleoEvaluationVisiton.visitExpression). Yet they produce - // an event in the Acceleo log which is captured via this listener. - AcceleoEnginePlugin.getDefault().getLog().addLogListener(new ILogListener() { - - @Override - public void logging(IStatus status, String plugin) { - hasErrors = true; - lastErrors = true; - } - }); - acceleoResourceSet = new AcceleoResourceSetImpl(); - acceleoResourceSet.createResource(currentURI); - acceleoResourceSet.getPackageRegistry().put( - EcoreEnvironment.OCL_STANDARD_LIBRARY_NS_URI, - new EcoreOCLStandardLibrary().getOCLStdLibPackage()); - } - - /** - * Execute a script passed as parameter. It will be executed in the context - * of a base script that declares the meta-model (UML2) and has additional - * imports (currently none). - * - * @param template - * The template in string form - * @param element - * The UML element to which the template is applied - * @return the evaluated template - */ - public static String bind(String templateStr, Element element) throws AcceleoException { - return evaluate(templateStr, element, null); - } - - /** - * find an MTL file in a plugin. This functions assumes that the relative path (to a "bin" folder) within the - * plugin includes the plug-in name as a prefix - * - * @param moduleName - * qualified name within the plug-in (assuming that the associated file is located - * in a sub-folder with the name "bin") - */ - public static URI findFileInPlugin(String moduleName) { - String relativePath = moduleName.replace(IAcceleoConstants.NAMESPACE_SEPARATOR, File.separator); - String segments[] = moduleName.split(IAcceleoConstants.NAMESPACE_SEPARATOR); - - for (int pass = 0; pass < 2; pass++) { - // try bin directory in first pass (deployed plugins: don't use bin, devel: use bin). - // Problem: resource is also found without bin, but resolving fails later - String binSep = (pass == 0) ? "/bin/" : "/"; //$NON-NLS-1$//$NON-NLS-2$ - for (int segmentLen = segments.length - 1; segmentLen > 1; segmentLen--) { - String pluginNameCandidate = segments[0]; - for (int i = 1; i < segmentLen; i++) { - pluginNameCandidate += DOT + segments[i]; - } - - String fileNameCandidate = pluginNameCandidate + binSep + relativePath + - DOT + IAcceleoConstants.EMTL_FILE_EXTENSION; - - URI uri = URI.createPlatformPluginURI(fileNameCandidate, true); - if (pass == 0) { - // Use absolute path during first pass, i.e. try to load Acceleo module - // at an absolute position. - // This is required, since Acceleo references dependent files using a relative - // path. This applies to debugging in 2nd instance only, if a plugin is deployed, - // references within the EMTL file become platform:/plugin references and the - // EMTL file itself should also be loaded using a platform:/plugin reference. - // - // Caveat: assure that plugins with profile or meta-model definitions are NOT present - // in your debugging workspace, since they might get loaded twice which leads to - // incompatible Java objects denoting the same element (e.g. two instance of Classifier MM - // element). See bug 351137. - - String absoluteFileName = Utils.getAbsoluteFN(uri.toString()); - if (absoluteFileName != null) { - File fileCandidate = new File(absoluteFileName); - if (fileCandidate.exists()) { - return URI.createFileURI(fileCandidate.getAbsolutePath()); - } - } - } - else { - try { - Resource r = acceleoResourceSet.getResource(uri, true); - if (r != null) { - return uri; - } - } catch (Exception e) { - // the URI has been added to the resource set, although there is an exception. - removeURIfromResourceSet(uri); - } - } - } - } - return null; - } - - /** - * Small helper: remove a URI from the AcceleoResourceSet - * - * @param uri - */ - protected static void removeURIfromResourceSet(URI uri) { - for (Resource resource : acceleoResourceSet.getResources()) { - if (resource.getURI() == uri) { - acceleoResourceSet.getResources().remove(resource); - break; - } - } - } - - /** - * Evaluate an Acceleo template - * - * @param ob - * An opaque behavior whose first body contains an Acceleo template that should be evaluated - * @param element - * The UML element to which the template is applied - * @param args - * an array of arguments that are passed to the template. Each argument - * must be either an EObject, a String, an Integer or a Boolean - * (TODO: currently not evaluated) - * @return the evaluated template - * @return - * @throws AcceleoException - */ - public static String evaluate(OpaqueBehavior b, Element element, Object args[]) throws AcceleoException { - // script = null; - if (b.getBodies().size() > 0) { - String body = b.getBodies().get(0); - return evaluate(body, b.getQualifiedName(), element, args); - } - return null; - } - - /** - * Evaluate an Acceleo template - * - * @param template - * The template in string form - * @param element - * The UML element to which the template is applied - * @param args - * an array of arguments that are passed to the template. Each argument - * must be either an EObject, a String, an Integer or a Boolean - * (TODO: currently not evaluated) - * @return the evaluated template - */ - public static String evaluate(String templateStr, Element element, Object args[]) throws AcceleoException { - return evaluate(templateStr, "dummy", element, args); //$NON-NLS-1$ - } - - /** - * Evaluate an Acceleo template - * - * @param templateStr - * The acceleo template in string form - * @param templateName - * The name under which a template can be identified, i.e. the file name - * if the template is stored in a file and the qualified name of the model element (opaque - * behavior) if the template is stored within the model. - * @param element - * The UML element to which the template is applied - * @param args - * an array of arguments that are passed to the template. Each argument - * must be either an EObject, a String, an Integer or a Boolean - * (TODO: currently not evaluated) - * @return the evaluated template - * @throws AcceleoException - */ - public static String evaluate(String templateStr, String templateName, Element element, Object args[]) throws AcceleoException { - if (templateStr == null) { - return null; - } - - if (engine == null) { - init(); - } - - // support non declaration of a template for default naming operations - if (!(templateStr.startsWith("[import") || //$NON-NLS-1$ - templateStr.startsWith("[template") || //$NON-NLS-1$ - templateStr.startsWith("[module"))) { //$NON-NLS-1$ - templateStr = "[template public dummy(ne : NamedElement)]\n" + templateStr + //$NON-NLS-1$ - "\n[/template]\n"; //$NON-NLS-1$ - } - - // module names are not relevant, since passed templates can not be called by others - if (!templateStr.startsWith("[module")) { //$NON-NLS-1$ - templateStr = "[module dummyMod('" + UML_URI + "')/]\n\n" + templateStr; //$NON-NLS-1$//$NON-NLS-2$ - } - - // Strategy: - // 1. Use AcceleoParser to transform text (OpaqueExpression) into Module - // => list of dependencies via explicit import statements - // 2. Use AcceleoEngine to resolve expression. - - // Strategy first: parse imports: verify, if already in resourceSet - - AcceleoSourceBuffer sourceBuffer = new AcceleoSourceBuffer(new StringBuffer(templateStr)); - - Resource resource = acceleoResourceSet.getResource(currentURI, false); - - try { - EList depURIs = new BasicEList(); - lastErrors = false; - // deps.add(outputURI); - - // check, if imports are already in resource set - sourceBuffer.createCST(); - for (ModuleImportsValue importValue : sourceBuffer.getCST().getImports()) { - String importedModuleName = importValue.getName(); - if (importedModuleName != null) { - // String pathName = importedModuleName.replace(IAcceleoConstants.NAMESPACE_SEPARATOR, File.separator); - - URI depURI = findFileInPlugin(importedModuleName); - if (depURI != null) { - depURIs.add(depURI); - // Resource r = acceleoResourceSet.getResource(depURI, true); - } - else { - throw new AcceleoException("Could not find imported module:\n" + importedModuleName + "\n\n" + - "The module (in compiled form, i.e. with .emtl) is searched in the path corresponding to its qualified name " + - "(starting with the \"bin\" directory, if a source plugin) of dependend plug-ins. Verify that these have the " + - "Acceleo nature"); - } - } - } - - // parse imported files - not required, EMTL files exist already - // parser.parse(depInputFiles, outputURIs, new BasicEList(), null, new BasicMonitor()); - - parser.parse(sourceBuffer, resource, depURIs); - if (sourceBuffer.getProblems().getList() != null) { - if (sourceBuffer.getProblems().getList().size() > 0) { - throw new AcceleoException("Acceleo problem: " + sourceBuffer.getProblems().getMessage() + - "\n\nTemplate: " + templateName + "\n" + templateStr); - } - } - String result = evaluateResource(resource, element, templateName, templateStr); - if (result != null) { - return result; - } - - } catch (AcceleoEvaluationException e) { - String elementStr = (element instanceof NamedElement ? ((NamedElement) element).getQualifiedName() : element.toString()); - throw new AcceleoException("Acceleo EvaluationException" + e + "\n\nPassed element: " + elementStr + - "\n\nTemplate: " + templateName + "\n" + templateStr); - } - String elementStr = (element instanceof NamedElement ? ((NamedElement) element).getQualifiedName() : element.toString()); - throw new AcceleoException("Acceleo evaluation error\n\nPassed element: " + elementStr + - "\n\nTemplate: " + templateName + "\n" + templateStr); - } - - /** - * Evaluate a template within the given module. Assume that the template has the same name as - * the module. If this is not the case, use the function below - * - * @param moduleName - * a qualified Acceleo module name, elements are separated by '::' - * @param element - * @return - */ - public static String evaluateURI(String moduleName, Element element) { - int index = moduleName.lastIndexOf("::"); //$NON-NLS-1$ - String templateName = (index == -1) ? moduleName : moduleName.substring(index + 2); - return evaluateURI(moduleName, templateName, element); - } - - - public static String evaluateURI(String moduleName, String templateName, Element element) { - // throws AcceleoException { - if (engine == null) { - init(); - } - try { - // return evaluateURI(URI.createURI("org.eclipse.papyrus.cpp.codegen" + "/" + uriStr.replace(DOT, "/") + DOT + IAcceleoConstants.EMTL_FILE_EXTENSION), element); - URI uri = findFileInPlugin(moduleName); - if (uri == null) { - throw new RuntimeException("Cannot find Acceleo module " + moduleName + //$NON-NLS-1$ - ". Check whether the .emtl file exists and whether it is exported"); //$NON-NLS-1$ - } - return evaluateURI(uri, templateName, element); - } catch (AcceleoException e) { - } - return null; - } - - public static String evaluateURI(URI uri, String templateName, Element element) throws AcceleoException { - - if (engine == null) { - init(); - } - - Resource resource = acceleoResourceSet.getResource(uri, true); - if (resource != null) { - return evaluateResource(resource, element, templateName, ""); //$NON-NLS-1$ - } - return null; - } - - /** - * Evaluate an Acceleo template when given a resource, template name - * - * @param resource - * The resource of an Acceleo module - * @param element - * the UML model element that is passed ( - * @param templateName - * the name of the template - * @param templateStr - * the contents of the template. May be empty (only used for - * error messages - * @return the evaluated template - * @throws AcceleoException - */ - protected static String evaluateResource(Resource resource, Element element, String templateName, String templateStr) throws AcceleoException { - if (resource.getContents().size() > 0) { - EObject result = resource.getContents().get(0); - List arguments = new ArrayList(); - // The input model itself is a potential argument - arguments.add(element); - if (result instanceof Module) { - Module module = (Module) result; - // do not check the template name, if there is only one. - boolean dontCheck = (module.getOwnedModuleElement().size() == 1); - for (ModuleElement me : module.getOwnedModuleElement()) { - if ((me instanceof Template) && (dontCheck || me.getName().equals(templateName))) { - lastErrors = false; - Object stringResult = engine.evaluate((Template) me, arguments, new PreviewStrategy(), null); - if (lastErrors) { - // we do not throw an exception, since it would imply that the evaluation result is - // lost. For a users, the (partially) evaluated result might be more useful to locate - // the problem than the actual error message. - // log additional info about template, which are not present in the Acceleo log - String message = "an acceleo error occurred during the evaluation of template <" + //$NON-NLS-1$ - templateName + ">. Check previous errors in the log."; //$NON-NLS-1$ - if (templateStr.length() > 0) { - message += "Template contents:\n" + templateStr; //$NON-NLS-1$ - } - AcceleoEnginePlugin.getDefault().getLog().log( - new Status(IStatus.INFO, AcceleoEnginePlugin.PLUGIN_ID, message)); - } - if (stringResult instanceof String) { - return (String) stringResult; - } - } - } - } - } - throw new AcceleoEvaluationException("Template " + templateName + " not found"); - } - - public static void clearErrors() { - hasErrors = false; - lastErrors = false; - } - - public static boolean hasErrors() { - return hasErrors; - } - - protected static boolean hasErrors; - - protected static boolean lastErrors; - - protected static AcceleoEngine engine = null; - - protected static ResourceSet acceleoResourceSet; - - protected static AcceleoParser parser; -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/AcceleoException.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/AcceleoException.java deleted file mode 100644 index 655a042eac6..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/AcceleoException.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.papyrus.acceleo; - - -public class AcceleoException extends Exception { - - /** - * - */ - private static final long serialVersionUID = 1548461326327727987L; - - public AcceleoException(String reason) { - super(reason); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Activator.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Activator.java deleted file mode 100644 index defe5cc4f98..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Activator.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.eclipse.papyrus.acceleo; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.acceleo"; //$NON-NLS-1$ - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/GenUtils.emtl b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/GenUtils.emtl deleted file mode 100644 index 7e5552ff18b..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/GenUtils.emtl +++ /dev/null @@ -1,2692 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/GenUtils.mtl b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/GenUtils.mtl deleted file mode 100644 index 2506153a545..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/GenUtils.mtl +++ /dev/null @@ -1,114 +0,0 @@ -[comment encoding = UTF-8 /] -[module GenUtils('http://www.eclipse.org/uml2/5.0.0/UML')/] - -[query public getTemplateBindings(arg0 : Class) : TemplateBinding - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getTemplateBindings(org.eclipse.uml2.uml.Class)', Sequence{arg0}) -/] - -[query public isTemplateBoundElement(arg0 : Classifier) : Boolean - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'isTemplateBoundElement(org.eclipse.uml2.uml.Classifier)', Sequence{arg0}) -/] - -[query public getTemplateName(arg0 : TemplateParameter) : String - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getTemplateName(org.eclipse.uml2.uml.TemplateParameter)', Sequence{arg0}) -/] - -[query public getTemplateParameters(arg0 : Classifier) : Collection(TemplateParameter) - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getTemplateParameters(org.eclipse.uml2.uml.Classifier)', Sequence{arg0}) -/] - -[query public getTemplateParameteredElements(arg0 : Classifier) : Collection(Classifier) - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getTemplateParameteredElements(org.eclipse.uml2.uml.Classifier)', Sequence{arg0}) -/] - -[query public getOwnedAttributeTypes(arg0 : Classifier) : Sequence(Classifier) - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getOwnedAttributeTypes(org.eclipse.uml2.uml.Classifier)', Sequence{arg0}) -/] - -[query public getTypesViaAttributes(arg0 : Classifier) : Sequence(Classifier) - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getTypesViaAttributes(org.eclipse.uml2.uml.Classifier)', Sequence{arg0}) -/] - -[query public getTypesViaOperations(arg0 : Classifier) : Sequence(Classifier) - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getTypesViaOperations(org.eclipse.uml2.uml.Classifier)', Sequence{arg0}) -/] - -[query public getTypesViaRelationships(arg0 : Classifier) : Sequence(Classifier) - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getTypesViaRelationships(org.eclipse.uml2.uml.Classifier)', Sequence{arg0}) -/] - -[query public getTypesViaDependencies(arg0 : Classifier) : Sequence(Classifier) - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getTypesViaDependencies(org.eclipse.uml2.uml.Classifier)', Sequence{arg0}) -/] - -[query public getTypesViaRelationshipsNoDeps(arg0 : Classifier) : Sequence(Classifier) - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getTypesViaRelationshipsNoDeps(org.eclipse.uml2.uml.Classifier)', Sequence{arg0}) -/] - -[query public getFullName(arg0 : NamedElement) : String - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getFullName(org.eclipse.uml2.uml.NamedElement)', Sequence{arg0}) -/] - -[query public getFullNameUC(arg0 : NamedElement) : String - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getFullNameUC(org.eclipse.uml2.uml.NamedElement)', Sequence{arg0}) -/] - -[query public getComments(arg0 : Element) : String - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getComments(org.eclipse.uml2.uml.Element)', Sequence{arg0}) -/] - -[query public getUsedPackages(arg0 : Package) : Sequence(Package) - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getUsedPackages(org.eclipse.uml2.uml.Package)', Sequence{arg0}) -/] - -[query public getUsedClassifiers(arg0 : Classifier) : Sequence(Classifier) - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getUsedClassifiers(org.eclipse.uml2.uml.Classifier)', Sequence{arg0}) -/] - -[query public getFullPath(arg0 : Package) : String - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getFullPath(org.eclipse.uml2.uml.Package)', Sequence{arg0}) -/] - -[query public hasStereotype(arg0 : Element, arg1 : String) : Boolean - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'hasStereotype(org.eclipse.uml2.uml.Element, java.lang.String)', Sequence{arg0, arg1}) -/] - -[comment use OclAny instead of EClass, since Acceleo does not consider a passed stereotype (such as C_Cpp::Ptr) as EClass compatible - although the passed value is technically an eclass /] -[query public hasStereotype(arg0 : Element, definition : OclAny) : Boolean - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'hasStereotypeA(org.eclipse.uml2.uml.Element, org.eclipse.emf.ecore.EClass)', Sequence{arg0, definition}) -/] - -[query public hasStereotypeTree(arg0 : Element, definition : OclAny) : Boolean - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'hasStereotypeTree(org.eclipse.uml2.uml.Element, org.eclipse.emf.ecore.EClass)', Sequence{arg0, definition}) /] - -[query public getApplication(arg0 : Element, arg1 : OclAny) : OclAny - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getApplicationA(org.eclipse.uml2.uml.Element, org.eclipse.emf.ecore.EClass)', Sequence{arg0, arg1}) -/] - -[query public getApplicationTree(arg0 : Element, arg1 : OclAny) : OclAny - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getApplicationTreeA(org.eclipse.uml2.uml.Element, org.eclipse.emf.ecore.EClass)', Sequence{arg0, arg1}) -/] - -[query public getBody(arg0 : Operation, arg1 : String) : String - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getBody(org.eclipse.uml2.uml.Operation, java.lang.String)', Sequence{arg0, arg1}) -/] - -[query public getBodyFromOB(arg0 : OpaqueBehavior, arg1 : String) : String - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getBodyFromOB(org.eclipse.uml2.uml.OpaqueBehavior, java.lang.String)', Sequence{arg0, arg1}) -/] - -[query public cleanCR(str : String) : String - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'cleanCR(java.lang.String)', Sequence{str}) -/] - -[query public maskNull(str : String) : String - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'maskNull(java.lang.String)', Sequence{str}) -/] - -[query public getRelativePath(ne1 : NamedElement, ne2 : NamedElement) : String - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'getRelativePath(org.eclipse.uml2.uml.NamedElement, org.eclipse.uml2.uml.NamedElement)', Sequence{ne1, ne2}) -/] - -[query public returnResult(behavior : Behavior) : Parameter - = invoke('org.eclipse.papyrus.codegen.base.GenUtils', 'returnResult(org.eclipse.uml2.uml.Behavior)', Sequence{behavior}) -/] \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Utils.java b/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Utils.java deleted file mode 100644 index c8f7a01c102..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.acceleo/src/org/eclipse/papyrus/acceleo/Utils.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.eclipse.papyrus.acceleo; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; - -import org.eclipse.core.runtime.FileLocator; - -public class Utils { - - /** - * Return the absolute file name to a file name given e.g. in the form platform:/plugin/xxx - * - * @param fileName - * the file name using eclipse elements such as platform:/plugin - * @return the absolute file name - */ - public static String getAbsoluteFN(String fileName) { - try { - URL absoluteURL = FileLocator.toFileURL(new URL(fileName)); - return absoluteURL.getFile(); - } catch (MalformedURLException e) { - } catch (IOException e) { - } - return null; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/.classpath b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/.classpath deleted file mode 100644 index 098194ca4b7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/.project b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/.project deleted file mode 100644 index f710852782a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.codegen.base - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.core.prefs b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94d61f00da6..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/META-INF/MANIFEST.MF deleted file mode 100644 index ea1f0a8a41f..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.uml2.uml;bundle-version="4.0.2", - org.eclipse.core.filesystem;bundle-version="1.3.200", - org.eclipse.core.resources;bundle-version="3.9.1", - org.eclipse.papyrus.infra.core;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", - org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", - org.eclipse.emf.transaction;bundle-version="1.8.0" -Export-Package: org.eclipse.papyrus.codegen.base, - org.eclipse.papyrus.codegen.base.codesync -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.codegen.base.Activator -Bundle-SymbolicName: org.eclipse.papyrus.codegen.base;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/about.html b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/build.properties b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/build.properties deleted file mode 100644 index 6c551f66003..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - plugin.xml,\ - icons/ -src.includes = about.html diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/icons/codegen-16x16.gif b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/icons/codegen-16x16.gif deleted file mode 100644 index d7c1a7365f5..00000000000 Binary files a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/icons/codegen-16x16.gif and /dev/null differ diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/plugin.properties deleted file mode 100644 index 1e85d2491da..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Basic code-generation functions (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/plugin.xml deleted file mode 100644 index 10ffe8d6e48..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/plugin.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/pom.xml deleted file mode 100644 index 72a38ed6f97..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.codegen.base - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Activator.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Activator.java deleted file mode 100644 index b4c1e58de7f..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Activator.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.eclipse.papyrus.codegen.base; - -import org.eclipse.papyrus.infra.core.log.LogHelper; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator implements BundleActivator { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.codegen.base"; //$NON-NLS-1$ - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - public static LogHelper log; - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - log = new LogHelper(); - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - log = null; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/GenUtils.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/GenUtils.java deleted file mode 100644 index bf1304e37cb..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/GenUtils.java +++ /dev/null @@ -1,731 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2013 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.codegen.base; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.Dependency; -import org.eclipse.uml2.uml.DirectedRelationship; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Namespace; -import org.eclipse.uml2.uml.OpaqueBehavior; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.ParameterDirectionKind; -import org.eclipse.uml2.uml.ParameterableElement; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.TemplateParameter; -import org.eclipse.uml2.uml.TemplateSignature; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.util.UMLUtil; - - -/** - * Some utilities: a set of static methods for Acceleo based code generation - * - * @author wassim, ansgar - * - */ -public class GenUtils { - - public static final String NL = System.getProperties().getProperty("line.separator"); //$NON-NLS-1$ - - /** - * Retrieve first template binding from list of template bindings, if - * exactly one exists. Return null otherwise. - * - * @param current - * Class on which the template binding is searched - * @return the template binding of current Class - */ - public static TemplateBinding getTemplateBinding(Classifier current) { - TemplateBinding binding = null; - if (current.getTemplateBindings().size() == 1) { - binding = current.getTemplateBindings().get(0); - } - - return binding; - } - - /** - * Check whether the passed classifier has a template binding with itself as bound element - * - * @param cl - * @return - */ - public static boolean isTemplateBoundElement(Classifier cl) { - boolean result = false; - EList tbs = cl.getTemplateBindings(); - if (tbs.size() > 0) { - for (TemplateBinding tb : tbs) { - // TODO: will only work for single element in template binding list - result = tb.getBoundElement() == cl; - } - } - return result; - } - - /** - * Get the name of a template parameter or undefined, if it is not set - * - * @param templateParam - * @return - */ - public static String getTemplateName(TemplateParameter templateParam) { - String name = ""; //$NON-NLS-1$ - ParameterableElement pElt = templateParam.getParameteredElement(); - if ((pElt != null) && (pElt instanceof NamedElement)) { - name = ((NamedElement) pElt).getName(); - } else { - name = "undefined"; //$NON-NLS-1$ - } - - return name; - } - - - /** - * - * @param classifier - * a classifier owning a template signature - * @return the list of (formal) parameters defined within a template signature - */ - public static Collection getTemplateParameters(Classifier classifier) { - - Collection params = new ArrayList(); - TemplateSignature ts = classifier.getOwnedTemplateSignature(); - if (ts != null) { - params.addAll(ts.getOwnedParameters()); - } - - return params; - } - - /** - * - * @param classifier - * @return - */ - public static Collection getTemplateParameteredElements(Classifier classifier) { - - Collection params = new ArrayList(); - TemplateSignature ts = classifier.getOwnedTemplateSignature(); - if (ts != null) { - for (TemplateParameter tp : ts.getOwnedParameters()) { - if (tp != null) { - params.add(tp.getParameteredElement()); - } - } - } - return params; - } - - /** - * Retrieve a list of types that belong to by a classifier in the current class - * - * @param current - * Class on which the attributes are searched - * @return collection of classes which are the type of the attributes - */ - public static EList getOwnedAttributeTypes(Classifier current) { - EList result = new UniqueEList(); - - Iterator attributes; - attributes = current.getAttributes().iterator(); - while (attributes.hasNext()) { - Property currentAttribute = attributes.next(); - Type type = currentAttribute.getType(); - addFarthestOwnerType(type, result); - } - return result; - } - - /** - * Retrieve a list of types that belong to by a classifier in the current class - * - * @param current - * Class on which the attributes are searched - * @return collection of classes which are the type of the attributes - */ - public static EList getTypesViaAttributes(Classifier current) { - EList result = new UniqueEList(); - - for (Property currentAttribute : current.getAttributes()) { - Type type = currentAttribute.getType(); - addFarthestOwnerType(type, result); - } - return result; - } - - /** - * Retrieve the operations in the current class. For each - * operation collected the classifier type. This class thus finds types, on - * which the signature depends. - * - * @param current - * Class on which the attributes are searched - * @return collection of classes which are the types of the operations parameters - */ - public static EList getTypesViaOperations(Classifier current) { - EList result = new UniqueEList(); - for (Operation operation : current.getOperations()) { - for (Parameter param : operation.getOwnedParameters()) { - Type type = param.getType(); - addFarthestOwnerType(type, result); - } - } - return result; - } - - /** - * Retrieves a list of types used by inner classifiers of the current classifier - * - * @param current - * Class on which the attributes are searched - * @return collection of classes which are the types of the operations parameters - */ - public static EList getInnerClassifierTypes(Classifier current) { - EList result = new UniqueEList(); - for (Element ownedElement : current.allOwnedElements()) { - if (ownedElement instanceof Classifier) { - result.addAll(getOwnedAttributeTypes((Classifier) ownedElement)); - result.addAll(getTypesViaOperations((Classifier) ownedElement)); - } - } - return result; - } - - /** - * Return a list of classifiers that are referenced by relationships, i.e. - * dependencies or associations - * - * @param current - * @return - */ - public static EList getTypesViaRelationships(Classifier current) { - EList classifiers = new UniqueEList(); - - for (DirectedRelationship relationship : current.getSourceDirectedRelationships()) { - - if (relationship.getTargets().size() > 0) { - // there should always be at least one element in the target - // list and it should be a classifier, but better check. - Element element = relationship.getTargets().get(0); - addFarthestOwnerType(element, classifiers); - } - } - return classifiers; - } - - /** - * Return a list of classifiers that are referenced via dependencies - * - * @param current - * @return - */ - public static EList getTypesViaDependencies(Classifier current) { - EList classifiers = new UniqueEList(); - - for (DirectedRelationship relationship : current.getSourceDirectedRelationships()) { - if (relationship instanceof Dependency) { - if (relationship.getTargets().size() > 0) { - // there should always be at least one element in the target - // list and it should be a classifier, but better check. - Element element = relationship.getTargets().get(0); - addFarthestOwnerType(element, classifiers); - } - } - } - return classifiers; - } - - /** - * Return a list of classifiers that are referenced via all kinds of relations except - * dependencies - * - * @param current - * @return - */ - public static EList getTypesViaRelationshipsNoDeps(Classifier current) { - EList classifiers = new UniqueEList(); - - for (DirectedRelationship relationship : current.getSourceDirectedRelationships()) { - if (!(relationship instanceof Dependency)) { - if (relationship.getTargets().size() > 0) { - // there should always be at least one element in the target - // list and it should be a classifier, but better check. - Element element = relationship.getTargets().get(0); - addFarthestOwnerType(element, classifiers); - } - } - } - return classifiers; - } - - - /** - * Return the qualified name of a named element, but use "_" instead of "::" as separator - * - * @param ne - * a named element - * @return the fully qualified name with "_" as separator character - */ - public static String getFullName(NamedElement ne) { - return ne.getQualifiedName().replace("::", "_"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * return the full name in upper case - * - * @param ne - * @return - */ - public static String getFullNameUC(NamedElement ne) { - return ne.getQualifiedName().replace("::", "_").toUpperCase(); //$NON-NLS-1$ //$NON-NLS-2$ - } - - - /** - * Retrieve the comments associated with an element - * TODO: check whether comment's annotated element link belongs to element in question - * - * @param element - * @return - */ - public static String getComments(Element element) { - String commentText = ""; //$NON-NLS-1$ - for (Comment comment : element.getOwnedComments()) { - // remove eventual CRs (avoid confusion in Acceleo template which adds " *" after line breaks) - commentText += cleanCR(comment.getBody()); - } - return commentText; - } - - /** - * Return a list of dependent package (the list of dependent - * elements filtered for packages) - * - * @param pkg - * @return - */ - public static EList getUsedPackages(Package pkg) { - EList result = new UniqueEList(); - for (Element depElement : pkg.getClientDependencies()) { - if (depElement instanceof Package) { - result.add((Package) depElement); - } - } - return result; - } - - /** - * Return a list of dependent classifiers (the list of dependent - * elements filtered for classifiers) - * - * @param pkg - * @return - */ - public static EList getUsedClassifiers(Classifier cls) { - EList result = new BasicEList(); - for (Element depElement : cls.getClientDependencies()) { - addFarthestOwnerType(depElement, result); - } - return result; - } - - /** - * Adds the first element owned by a package in a classifier's namespace - * - * @param classifier - * @return - */ - private static void addFarthestOwnerType(Element element, EList result) { - if (element == null || result == null) { - return; - } - - if (element.getOwner() instanceof Package && element instanceof Classifier) { - result.add((Classifier) element); - } else { // Type is an inner class. We want to return a classifier C directly owned by a package since it is "C.h" that should be included - addFarthestOwnerType(element.getOwner(), result); - } - } - - /** - * Get the namespace of the farthest classifier owner that owns an operation - * - * @param op - * @return - */ - public static String getNestedOperationFarthestClassifierOwnerNamespace(Operation op) { - StringBuffer buffer = new StringBuffer(""); - if (op != null && op.getOwner() instanceof Classifier) { - getFarthestOwnerNamespace(op.getOwner(), buffer); - } - return buffer.toString(); - } - - /** - * Get the namespace of the farthest classifier owner that owns an operation - * - * @param behavior - * @return - */ - public static String getNestedBehaviorFarthestClassifierOwnerNamespace(OpaqueBehavior behavior) { - StringBuffer buffer = new StringBuffer(""); - if (behavior != null && behavior.getOwner() instanceof Classifier) { - getFarthestOwnerNamespace(behavior.getOwner(), buffer); - } - return buffer.toString(); - } - - /** - * Build a namespace to the farthest owner (i.e. owned by a package) of some element - * - * @param element - * @param result - */ - private static void getFarthestOwnerNamespace(Element element, StringBuffer result) { - if (element == null || result == null) { - return; - } - - if (element.getOwner() instanceof Package) { - result.insert(0, ((Classifier) element).getName()); - } else { - result.insert(0, "::" + ((Classifier) element).getName()); - getFarthestOwnerNamespace(element.getOwner(), result); - } - } - - /** - * Return the qualified name of a package, but use "/" instead of "::" as separator - * - * @param pkg - * @return - */ - public static String getFullPath(Package pkg) { - return pkg.getQualifiedName().replace("::", "/"); //$NON-NLS-1$//$NON-NLS-2$ - } - - /** - * Is a certain stereotype applied? - * - * @param element - * @param stereotype - * fully qualified stereotype name - * @return - */ - public static boolean hasStereotype(Element element, String stereotName) { - return element.getAppliedStereotype(stereotName) != null; - } - - /** - * Is a certain stereotype applied? - * - * @param element - * a UML element - * @param stereotype - * The class of an element of a static profile - * @return - */ - public static boolean hasStereotype(Element element, java.lang.Class clazz) { - for (EObject stereoApplication : element.getStereotypeApplications()) { - // check whether the stereotype is a super-class of the passed parameter clazz - if (clazz.isAssignableFrom(stereoApplication.getClass())) { - return true; - } - } - return false; - } - - - /** - * Is a certain stereotype applied? - * In case of Java, we use the class above (without the A) prefix. In case of Acceleo, a stereotype - * such as C_Cpp::Include is passed as EClass and we therefore use this operation from Acceleo. - * - * @param element - * @param definition - * The eClass associated with the stereotype name (its definition) - * @return - */ - public static boolean hasStereotypeA(Element element, EClass definition) { - if (element == null) { - // make query more robust - return false; - } - for (EObject stereoApplication : element.getStereotypeApplications()) { - // check whether the stereotype application has the right eClass - if (stereoApplication.eClass() == definition) { - return true; - } - } - return false; - } - - /** - * Verify if an Element or its parent Elements have a stereotype. Pass the class associated with a stereotype - * - * @param elt - * Element used. - * @param clazz - * the class associated with a stereotype in a static profile - * - * @return true if found. false otherwise - */ - public static boolean hasStereotypeTree(Element elt, java.lang.Class clazz) - { - - if (hasStereotype(elt, clazz)) { - return true; - } - else { - Element owner = elt.getOwner(); - if (owner != null) { - return hasStereotypeTree(owner, clazz); - } - else { - return false; - } - } - } - - - /** - * Verify if an Element or its parent Elements have a stereotype. Pass the definition of the stereotype - * - * @param elt - * Element used. - * @param definition - * The stereotype definition - * @return true if found. false otherwise - */ - public static boolean hasStereotypeTree(Element elt, EClass definition) - { - Element owner; - - if (hasStereotypeA(elt, definition)) { - return true; - } else if ((owner = elt.getOwner()) != null) { - return hasStereotypeTree(owner, definition); - } else { - return false; - } - } - - - /** - * return the first occurrence of a stereotype application in the ownership tree - * - * @param elt - * an element - * @param definition - * the definition of a stereotype (its eClass) - * @return - */ - @SuppressWarnings("unchecked") - public static T getApplicationTree(Element elt, java.lang.Class clazz) - { - EObject application = UMLUtil.getStereotypeApplication(elt, clazz); - if (application != null) { - return (T) application; - } - else { - Element owner = elt.getOwner(); - if (owner != null) { - return getApplicationTree(owner, clazz); - } - else { - return null; - } - } - } - - - /** - * return the first occurrence of a stereotype application in the ownership tree - * Variant of @see getApplicationTree that is useful for Acceleo - * - * @param elt - * an element - * @param definition - * the definition of a stereotype (its eClass) - * @return - */ - public static EObject getApplicationTreeA(Element elt, EClass definition) - { - EObject application = getApplicationA(elt, definition); - if (application != null) { - return application; - } - else { - Element owner = elt.getOwner(); - if (owner != null) { - return getApplicationTreeA(owner, definition); - } - else { - return null; - } - } - } - - - /** - * Return a stereotype application when given the eClass of that application. - * In case of Java, we use the class above (without the A) prefix. In case of Acceleo, a stereotype - * such as C_Cpp::Include is passed as EClass and we therefore use this operation from Acceleo. - * - * @param element - * the UML model element - * @param eClass - * the eClass of the stereotype application - * @return - */ - public static EObject getApplicationA(Element element, EClass eClass) { - for (EObject stereoApplication : element.getStereotypeApplications()) { - // check whether the stereotype is an instance of the passed parameter clazz - if (stereoApplication.eClass() == eClass) { - return stereoApplication; - } - } - return null; - } - - - /** - * @param operation - * the operation - * @param selectedLanguage - * the selected language - * @return Return the first body of a selected language that is provided by - * one of the operation's methods - */ - public static String getBody(Operation operation, Pattern selectedLanguages) { - for (Behavior behavior : operation.getMethods()) { - if (behavior instanceof OpaqueBehavior) { - return getBodyFromOB((OpaqueBehavior) behavior, selectedLanguages); - } - } - return ""; //$NON-NLS-1$ - } - - - /** - * @param ob - * an opaque behavior - * @param selectedLanguage - * the selected language, this may be a regular expression - * @return Return the first body of a selected language that is provided by - * one of the operation's methods - */ - public static String getBodyFromOB(OpaqueBehavior ob, Pattern selectedLanguages) { - Iterator bodies = ob.getBodies().iterator(); - for (String language : ob.getLanguages()) { - // additional sanity check: number of languages and number of bodies should be synchronized, - // but there is no guarantee that this is the case - if (bodies.hasNext()) { - String body = bodies.next(); - Matcher matcher = selectedLanguages.matcher(language); - if (matcher.matches()) { - // additional "\r" confuses Acceleo - return cleanCR(body); - } - } - } - return ""; //$NON-NLS-1$ - } - - /** - * Remove from a String. These confuse Acceleo's indentation - * - * @param str - * @return - */ - public static String cleanCR(String str) { - if (str == null) { - return "// "; //$NON-NLS-1$ - } - return str.replace("\r", ""); //$NON-NLS-1$ //$NON-NLS-2$ - } - - - /** - * Avoid null strings, i.e. replace null strings by empty strings - * - * @param str - * @return - */ - public static String maskNull(String str) { - if (str == null) { - return ""; //$NON-NLS-1$ - } - return str; - } - - /** - * Return the relative path of ne2 as seen from ne1 - * (might not always be useful, if includes are always done from a common root) - * TODO: incomplete, currently unused - * - * @param ne1 - * a named element - * @param ne2 - * a named element - * @return - */ - public static String getRelativePath(NamedElement ne1, NamedElement ne2) { - // get common prefix - EList ne1namespaces = ne1.allNamespaces(); - String path = ""; //$NON-NLS-1$ - for (Namespace ns : ne2.allNamespaces()) { - if (ne1namespaces.contains(ns)) { - // ns is a common prefix - return ne2.getName(); - } - path += "../"; //$NON-NLS-1$ - } - return path; - } - - /** - * Return the type of a behavior, i.e. the type of the first parameter with - * "return" direction - * - * @param behavior - * a behavior - * @return the associated type - */ - public static Parameter returnResult(Behavior behavior) { - for (Parameter parameter : behavior.getOwnedParameters()) { - if (parameter.getDirection() == ParameterDirectionKind.RETURN_LITERAL) { - return parameter; - } - } - return null; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/HierarchyLocationStrategy.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/HierarchyLocationStrategy.java deleted file mode 100644 index fdb90709689..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/HierarchyLocationStrategy.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.eclipse.papyrus.codegen.base; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Namespace; - -public class HierarchyLocationStrategy implements ILocationStrategy { - - /** - * Always use / instead of File.separationChar - */ - public static final String SEP_CHAR = "/"; //$NON-NLS-1$ - - /** - * Return the filename for a given named element. - * - * @param element - * a named element - * @return filename for this element - */ - public String getFolder(NamedElement element) { - // IContainer baseContainer = getFolder(project, subFolderName); - EList namespaces = element.allNamespaces(); - String fileName = ""; //$NON-NLS-1$ - for (int i = namespaces.size() - 1; i >= 0; i--) { - Namespace ns = namespaces.get(i); - fileName += ns.getName() + SEP_CHAR; - } - return fileName; - } - - /** - * Return the filename for a given named element. - * - * @param element - * a named element - * @return filename for this element - */ - public String getFileName(NamedElement element) { - String folder = getFolder(element); - if (folder.length() > 0) { - folder += SEP_CHAR; - } - return getFolder(element) + element.getName(); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ILocationStrategy.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ILocationStrategy.java deleted file mode 100644 index 7820bdece18..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ILocationStrategy.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.papyrus.codegen.base; - -import org.eclipse.uml2.uml.NamedElement; - -/** - * A location strategy defines the location of a file associated with a model element - * depending on the namespaces of this model element (package hierarchy). - */ -public interface ILocationStrategy { - - public String getFolder(NamedElement element); - - public String getFileName(NamedElement element); -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/IPFileSystemAccess.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/IPFileSystemAccess.java deleted file mode 100644 index e72057135b4..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/IPFileSystemAccess.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - * - *******************************************************************************/ - -package org.eclipse.papyrus.codegen.base; - - -/** - * Simple interface inspired from IFileSystemAccess in xtext.generator. - * The prefix 'P' should avoid confusions with the latter. We do not the xbase class - * directly to avoid a dependency to xtext (not all potential generators are xtend/xtext based). - */ -public interface IPFileSystemAccess { - - /** - * @param fileName using '/' as file separator - * @param contents the to-be-written contents. - */ - public void generateFile(String fileName, String contents); - - /** - * @param fileName using '/' as file separator - */ - public void deleteFile(String fileName); -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/JavaIoFileSystemAccess.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/JavaIoFileSystemAccess.java deleted file mode 100644 index e10e9ad2566..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/JavaIoFileSystemAccess.java +++ /dev/null @@ -1,136 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.codegen.base; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import java.nio.file.Files; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Namespace; - -/** - * A simple class providing access to the file system, if the project is known - * - */ -public class JavaIoFileSystemAccess implements IPFileSystemAccess { - - File baseFolder; - - String subFolderName; - - boolean force = true; - - - /** - * @see org.eclipse.IPFileSystemAccess.generator.IFileSystemAccess#generateFile(java.lang.String, java.lang.String) - * - * @param fileName The filename - * @param content The content that is written to a file - */ - public void generateFile(String fileName, String content) { - File file = getFile(fileName); - try { - if (!file.exists()) { - // the file does not exists - file.createNewFile(); - } - BufferedWriter writer = Files.newBufferedWriter(file.toPath(), Charset.defaultCharset()); - writer.write(content); - } - catch (IOException e) { - throw new RuntimeException("Code generation: " + e.getMessage()); //$NON-NLS-1$ - } - } - - /** - * @see org.eclipse.IPFileSystemAccess.generator.IFileSystemAccess#deleteFile(java.lang.String) - * - * @param fileName - */ - public void deleteFile(String fileName) { - File file = getFile(fileName); - file.delete(); - } - - public void setOutputPath(File baseFolder) { - this.baseFolder = baseFolder; - } - - public void setOutputPath(File baseFolder, String folderName) { - this.baseFolder = baseFolder; - this.subFolderName = folderName; - } - - /** - * Return a container (folder) for a given named element. The folder is embedded into a set - * of folders that correspond to the namespaces of the element. These folders will be - * created, if the do not exist (comparable to "mkdir -p" in Unix). - * - * @param element - * a named element - * @return folder for this element - */ - public File getContainer(NamedElement element) { - try { - File folder = getFile(baseFolder, subFolderName); - EList namespaces = element.allNamespaces(); - for (int i = namespaces.size() - 1; i >= 0; i--) { - Namespace ns = namespaces.get(i); - folder = getFile(folder, ns.getName()); - if (!folder.exists()) { - // if packageContainer is a Project, it necessarily exists - folder.createNewFile(); - } - } - return folder; - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - /** - * Return a container (folder) for a given filename. - * Folders will be created, if the do not exist (comparable to "mkdir -p" in Unix). - * - * @param filename - * a filename with the '/' as separation character - * @return file for this element - */ - public File getFile(String filename) { - String paths[] = filename.split("/"); //$NON-NLS-1$ - File folder = getFile(baseFolder, subFolderName); - try { - for (int i = 0; i < paths.length - 1; i++) { - String path = paths[i]; - folder = getFile(folder, path); - if (!folder.exists()) { - // if packageContainer is a Project, it necessarily exists - folder.createNewFile(); - } - } - String last = paths[paths.length - 1]; - return getFile(folder, last); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - public File getFile(File folder, String fileName) { - return new File(folder, fileName); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Messages.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Messages.java deleted file mode 100644 index 3d66d4250c7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Messages.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.eclipse.papyrus.codegen.base; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.papyrus.acceleo.messages"; //$NON-NLS-1$ - public static String ModelElementsCreator_UnsupportedModelElement; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ModelElementsCreator.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ModelElementsCreator.java deleted file mode 100644 index ed1acce196a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ModelElementsCreator.java +++ /dev/null @@ -1,141 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2012 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.codegen.base; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; - - -/** - * Main class of code generator. This is an abstract class that is supposed to be overriden by language specific code generators - */ -abstract public class ModelElementsCreator { - - protected ILocationStrategy locStrategy; - - protected IPFileSystemAccess fileSystemAccess; - - /** - * - * Constructor. - * - * @param project - * the project in which the generated code should be placed - * @param fileSystemAccess - * a file system access implementation - * @param locStrategy - * a strategy that chooses suitable file names for generated code. - */ - public ModelElementsCreator(IPFileSystemAccess fileSystemAccess, ILocationStrategy locStrategy) { - this.fileSystemAccess = fileSystemAccess; - this.locStrategy = locStrategy; - } - - /** - * Obtain fileName of file(s) generated for a named element. Delegates to location strategy. - * Caller must eventually add extensions. - * - * @param element - * a named element. - * @return - */ - public String getFileName(NamedElement element) { - return locStrategy.getFileName(element); - } - - /** - * Creates the file(s) corresponding to a packageable element. This class needs to be - * implemented by language specific model elements - * - * @param folder - * @param classifier - * @throws CoreException - */ - abstract protected void createPackageableElementFile(PackageableElement classifier, IProgressMonitor monitor); - - /** - * Return true, if no code should be generated for a certain element - * - * @param element - * @return - */ - abstract protected boolean noCodeGen(Element element); - - - /** - * Main function for user calls. Creates code for a packageable element. In case of a passed package, the contained elements - * are generated recursively. - * - * @param monitor - * a progress monitor - * @param element - * the element for which code should be generated - * @throws CoreException - */ - public void createPackageableElement(PackageableElement element, IProgressMonitor monitor) { - createPackageableElement(element, monitor, true); - } - - /** - * Variant of main function: user may supply explicit container (also used by internal function to avoid - * re-calculating the entry container for each element). - * - * @param packageContainer - * The container (directory), in which code should be created - * @param monitor - * a progress monitor - * @param element - * the element for which code should be generated - * @throws CoreException - */ - public void createPackageableElement(PackageableElement element, IProgressMonitor monitor, boolean recursive) - { - if (noCodeGen(element)) { - return; - } - - if (element instanceof Package) { - Package pkg = (Package) element; - if (monitor != null) { - monitor.subTask("generate package " + element.getQualifiedName()); //$NON-NLS-1$ - } - - createPackageableElementFile(element, monitor); - - if (recursive) { - // Continue generation parsing package contents - for (PackageableElement subElement : pkg.getPackagedElements()) { - createPackageableElement(subElement, monitor, recursive); - } - } - } - else { - createPackageableElementFile(element, monitor); - } - } - - /** - * Remove elements (used for differential code generation) - * - * @param monitor - * @param element - * @throws CoreException - */ - public void removePackageableElement(PackageableElement element, IProgressMonitor monitor) { - String fileName = getFileName(element); - fileSystemAccess.deleteFile(fileName); // need recursion support? - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ProjectBasedFileAccess.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ProjectBasedFileAccess.java deleted file mode 100644 index 17b6e97948c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ProjectBasedFileAccess.java +++ /dev/null @@ -1,158 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.codegen.base; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; - -/** - * A simple class providing access to the file system, if the project is known - * - */ -public class ProjectBasedFileAccess implements IPFileSystemAccess { - - IProject project; - - String subFolderName; - - boolean force = true; - - /** - * Create a project based file access for a specific project. - * - * @param project - * the project for which file system access is provided - */ - public ProjectBasedFileAccess(IProject project) { - this.project = project; - subFolderName = null; - } - - /** - * Create a project based file access for a specific project. - * - * @param project - * the project for which file system access is provided - */ - public ProjectBasedFileAccess(IProject project, String subFolderName) { - this.project = project; - this.subFolderName = subFolderName; - } - - /** - * @see org.eclipse.IPFileSystemAccess.generator.IFileSystemAccess#generateFile(java.lang.String, java.lang.CharSequence) - * - * @param fileName - * @param contents - */ - public void generateFile(String fileName, String content) { - IFile file = getFile(fileName); - InputStream contentStream = new ByteArrayInputStream(content.getBytes()); - try { - if (file.exists()) { - if (force) { - file.setContents(contentStream, true, false, null); - } - // else - file is not updated - } - else { - // the file does not exists - file.create(contentStream, true, null); - } - // Refresh the container for the newly created files. This needs to be done even - // during error because of the possibility for partial results. - file.refreshLocal(IResource.DEPTH_INFINITE, null); - } catch (CoreException e) { - throw new RuntimeException("Code generation: " + e.getMessage()); //$NON-NLS-1$ - } - } - - /** - * @see org.eclipse.IPFileSystemAccess.generator.IFileSystemAccess#deleteFile(java.lang.String) - * - * @param fileName - */ - public void deleteFile(String fileName) { - // TODO Auto-generated method stub - - } - - public void setProject(IProject project) { - this.project = project; - } - - public void setProject(IProject project, String subFolderName) { - this.project = project; - this.subFolderName = subFolderName; - } - - - - /** - * Return a container (folder) for a given filename. - * Folders will be created, if the do not exist (comparable to "mkdir -p" in Unix). - * - * @param filename - * a filename with the '/' as separation character - * @return file for this element - */ - public IFile getFile(String filename) { - String paths[] = filename.split("/"); //$NON-NLS-1$ - IContainer packageContainer = getFolder(project, subFolderName); - try { - for (int i = 0; i < paths.length - 1; i++) { - String path = paths[i]; - packageContainer = getFolder(packageContainer, path); - if (!packageContainer.exists()) { - // if packageContainer is a Project, it necessarily exists - ((IFolder) packageContainer).create(false, true, null); - } - } - String last = paths[paths.length - 1]; - return getFile(packageContainer, last); - } catch (CoreException e) { - throw new RuntimeException(e); - } - } - - public IContainer getFolder(IContainer container, String folderName) { - if (folderName == null) { - return container; - } - if (container instanceof IFolder) { - return ((IFolder) container).getFolder(folderName); - } - else if (container instanceof IProject) { - return ((IProject) container).getFolder(folderName); - } - return null; - } - - public IFile getFile(IContainer container, String fileName) { - if (container instanceof IFolder) { - return ((IFolder) container).getFile(fileName); - } - else if (container instanceof IProject) { - return ((IProject) container).getFile(fileName); - } - return null; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ChangeObject.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ChangeObject.java deleted file mode 100644 index e380ed65c45..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ChangeObject.java +++ /dev/null @@ -1,32 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.codegen.base.codesync; - -import org.eclipse.emf.ecore.EObject; - -/** - * Simple data type that stores the tuple of event-type and associated e-Object - */ -public class ChangeObject { - /** - * The eventType. @link org.eclipse.emf.common.notify.Notification - */ - public int eventType; - - /** - * The associated EObject - */ - public EObject eObject; -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ManageChangeEvents.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ManageChangeEvents.java deleted file mode 100644 index fdac34742d7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ManageChangeEvents.java +++ /dev/null @@ -1,137 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.codegen.base.codesync; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.papyrus.codegen.base.Activator; -import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor; -import org.eclipse.papyrus.infra.core.services.EditorLifecycleEventListener; -import org.eclipse.papyrus.infra.core.services.EditorLifecycleManager; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResourceSet; - -/** - * Manage and update change events for incremental code generation - */ -public class ManageChangeEvents { - - protected static Map registeredListeners = - new HashMap(); - - /** - * An internal listener for life cycle events of Papyrus - */ - protected static class LifeCycleListener implements EditorLifecycleEventListener { - - TransactionalEditingDomain domain; - - LifeCycleListener(TransactionalEditingDomain domain) { - this.domain = domain; - } - - public void postInit(IMultiDiagramEditor editor) { - } - - public void postDisplay(IMultiDiagramEditor editor) { - } - - /** - * Executed before an editor will close => stop recording for this editing domain - */ - public void beforeClose(IMultiDiagramEditor editor) { - stopRecording(domain); - } - } - - /** - * Start recording changes for an editing domain - * - * @param domain - * a transactional editing domain. Can be obtained via TransactionUtil from an EObject - */ - public static void startRecording(TransactionalEditingDomain domain) { - if (!registeredListeners.containsKey(domain)) { - RecordEventsListener recordEvents = new RecordEventsListener(); - registeredListeners.put(domain, recordEvents); - // register a listener that records events - domain.addResourceSetListener(recordEvents); - - // register a listener for editor lifecycle events, in order to - // cleanup the set of registered listeners after the editor is closed. - try { - ServicesRegistry registry = ServiceUtilsForResourceSet.getInstance().getServiceRegistry( - domain.getResourceSet()); - EditorLifecycleManager lifecycleManager = registry.getService(EditorLifecycleManager.class); - lifecycleManager.addEditorLifecycleEventsListener(new LifeCycleListener(domain)); - } catch (ServiceException e) { - Activator.log.error(e); - } - } - - } - - /** - * Stop recording changes for an editing domain - * - * @param domain - * a transactional editing domain. Can be obtained via TransactionUtil from an EObject - */ - public static void stopRecording(TransactionalEditingDomain domain) { - RecordEventsListener recordEvents = registeredListeners.get(domain); - if (recordEvents != null) { - domain.removeResourceSetListener(recordEvents); - } - registeredListeners.remove(domain); - } - - /** - * Get the list of changes for an editing domain - * - * @param domain - * a transactional editing domain. Can be obtained via TransactionUtil from an EObject - * @return the list of changes or null, if there is currently no event listener (which means - * typcially, that event recording has not been started yet) - */ - public static EList getChangeList(TransactionalEditingDomain domain) { - RecordEventsListener recordEvents = registeredListeners.get(domain); - if (recordEvents != null) { - return recordEvents.getChangeList(); - } - return null; - } - - /** - * initialize the difference list for an editing domain - * - * @param domain - * a transactional editing domain. Can be obtained via TransactionUtil from an EObject - * @param startAutomatically - * if true, start event recording, if there is currently no event recording active - */ - public static void initChangeList(TransactionalEditingDomain domain, boolean startAutomatically) { - RecordEventsListener recordEvents = registeredListeners.get(domain); - if (recordEvents != null) { - recordEvents.initChangeList(); - } - else if (startAutomatically) { - startRecording(domain); - } - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/RecordEventsListener.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/RecordEventsListener.java deleted file mode 100644 index 8ae6ee95b1d..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/RecordEventsListener.java +++ /dev/null @@ -1,110 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.codegen.base.codesync; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.NotificationFilter; -import org.eclipse.emf.transaction.ResourceSetChangeEvent; -import org.eclipse.emf.transaction.ResourceSetListener; -import org.eclipse.emf.transaction.RollbackException; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * This listener is used to register ADD ant SET about in the diff model during - * the launch of the revision mode. It also create review element in the review - * model. See package commands for specification of review creation commands. - * - */ -public class RecordEventsListener implements ResourceSetListener { - - protected EList changeList; - - /** - * constructor - * - * @param reviewResourceManager - */ - public RecordEventsListener() { - changeList = new BasicEList(); - } - - public NotificationFilter getFilter() { - return null; - } - - /** - * @return the list of recorded change events - */ - public EList getChangeList() { - return changeList; - } - - /** - * initialize (reset) the list of recorded changes - */ - public void initChangeList() { - changeList.clear(); - } - - @Override - public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException { - for (Notification notification : event.getNotifications()) { - int eventType = notification.getEventType(); - if (notification.getNotifier() instanceof EObject) { - EObject notifier = (EObject) notification.getNotifier(); - - EObject baseElement = UMLUtil.getBaseElement(notifier); - if (baseElement != null) { - notifier = baseElement; - } - if ((eventType != Notification.REMOVING_ADAPTER) && (eventType != Notification.RESOLVE)) { - if ((notifier instanceof Element) || (notifier instanceof EAnnotation)) { - ChangeObject changeObject = new ChangeObject(); - changeObject.eventType = notification.getEventType(); - changeObject.eObject = notifier; - changeList.add(changeObject); - } - } - } - } - return null; - } - - @Override - public void resourceSetChanged(ResourceSetChangeEvent event) { - - } - - @Override - public boolean isAggregatePrecommitListener() { - return false; - } - - @Override - public boolean isPrecommitOnly() { - return false; - } - - @Override - public boolean isPostcommitOnly() { - return false; - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/messages.properties b/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/messages.properties deleted file mode 100644 index ad6e5a9fa79..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/messages.properties +++ /dev/null @@ -1 +0,0 @@ -ModelElementsCreator_UnsupportedModelElement=code generator: unsupported model element %s diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/.classpath b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/.project b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/.project deleted file mode 100644 index 24d01935406..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.codegen.extensionpoints - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/.settings/org.eclipse.jdt.core.prefs b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index c537b63063c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/META-INF/MANIFEST.MF deleted file mode 100644 index ac580de577f..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.uml2.uml;bundle-version="4.0.2", - org.eclipse.core.filesystem;bundle-version="1.3.200", - org.eclipse.core.resources, - org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0" -Export-Package: org.eclipse.papyrus.codegen.extensionpoints -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.codegen.extensionpoints.Activator -Bundle-SymbolicName: org.eclipse.papyrus.codegen.extensionpoints;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/about.html b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/build.properties b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/build.properties deleted file mode 100644 index 7e6b2a43702..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - schema/,\ - plugin.xml -src.includes = about.html diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.properties deleted file mode 100644 index d7801588e2c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Code generation extensionpoints (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.xml deleted file mode 100644 index 95044cba2e2..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/pom.xml deleted file mode 100644 index b01a3b6046a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.codegen.extensionpoints - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageCodegen.exsd b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageCodegen.exsd deleted file mode 100644 index 7b60f913ef4..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageCodegen.exsd +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - [Enter description of this extension point.] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ID of a code generator, currently optional for backward compatibility. - - - - - - - Programming language supported by the code generator - - - - - - - A class that provides access to the code generator. It must implement the ILangCodegen interface. - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageProject.exsd b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageProject.exsd deleted file mode 100644 index c631741cac1..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageProject.exsd +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - [Enter description of this extension point.] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/AbstractSettings.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/AbstractSettings.java deleted file mode 100644 index 75d82ca546b..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/AbstractSettings.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.codegen.extensionpoints; - -/** - * Abstract superclass for project settings. It is empty to allow for arbitrary - * project specific settings - */ -public abstract class AbstractSettings { - /** - * the operating system for which code should be produced (will have a - * project specific effect, e.g. in case of CDT it will result in a #define) - */ - public String targetOS; -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Activator.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Activator.java deleted file mode 100644 index c8bcb71a91f..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Activator.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.papyrus.codegen.extensionpoints; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.codegen.extensionpoints"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GenerationConstants.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GenerationConstants.java deleted file mode 100644 index 45d46b12c70..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GenerationConstants.java +++ /dev/null @@ -1,31 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.codegen.extensionpoints; - -public class GenerationConstants { - /** - * Constant indicating that generated code follows. Code generators should use this text in bodies, if bodies contain - * generated code (besides the contents of the opaque behaviors. Code generators need to prefix this string with the - * language specific comment symbol, e.g. // in case of C/C++ or Java. - */ - public static final String GENERATED_START = "the following code has been generated"; //$NON-NLS-1$ - - /** - * Constant indicating that generated code ends. Code generators should use this text in bodies, if bodies contain - * generated code (besides the contents of the opaque behaviors. Code generators need to prefix this string with the - * language specific comment symbol, e.g. // in case of C/C++ or Java. - */ - public static final String GENERATED_END = "generated code ends"; //$NON-NLS-1$ -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GeneratorSelectionDialog.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GeneratorSelectionDialog.java deleted file mode 100644 index fd3066b0ddf..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GeneratorSelectionDialog.java +++ /dev/null @@ -1,122 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.codegen.extensionpoints; - - -import java.util.Arrays; -import java.util.List; - -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.AbstractElementListSelectionDialog; - -/** - * Select a generator from a list of eligible generators - */ -public class GeneratorSelectionDialog extends AbstractElementListSelectionDialog { - - protected Text m_description; - - ILangCodegen generators[]; - - public GeneratorSelectionDialog(Shell parent, List generatorList) { - super(parent, new LabelProvider() { - public String getText(Object element) { - return LanguageCodegen.getID((ILangCodegen) element); - } - }); - generators = generatorList.toArray(new ILangCodegen[0]); - setMultipleSelection(false); - setTitle(Messages.GeneratorSelectionDialog_SelectGenerator); - } - - @Override - public Control createDialogArea(Composite parent) { - Composite contents = (Composite) super.createDialogArea(parent); - createMessageArea(contents); - // createLabel(contents, "Connector type"); - // GridData gridData = DialogUtils.createFillGridData(); - // gridData.heightHint = 200; - - createFilteredList(contents); - createFilterText(contents); - - fFilteredList.setElements(generators); - - Label info = createMessageArea(contents); - info.setText(Messages.GeneratorSelectionDialog_infoCodeGen); - // m_description = createMessageArea(contents); - - fFilteredList.addSelectionListener(new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - int index = fFilteredList.getSelectionIndex(); - updateDescription(getElement(index)); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - GridData descriptionGD = new GridData(); - descriptionGD.horizontalAlignment = GridData.FILL; - descriptionGD.grabExcessHorizontalSpace = true; - descriptionGD.heightHint = 80; - descriptionGD.grabExcessVerticalSpace = true; - descriptionGD.verticalAlignment = GridData.FILL; - - m_description = new Text(contents, SWT.NONE | SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY); - m_description.setLayoutData(descriptionGD); - updateDescription(getElement(0)); - - return contents; - } - - protected void updateDescription(ILangCodegen codegen) { - if (codegen instanceof ILangCodegen2) { - m_description.setText(((ILangCodegen2) codegen).getDescription()); - } - else { - m_description.setText("not available"); //$NON-NLS-1$ - } - } - - /** - * Obtain ILangCodegen object via index. Note that we need to access the data from the filtered list - * since the order might not be the same as the local "generators" array (the filtered list sorts) - * @param index - * @return - */ - ILangCodegen getElement(int index) { - return (ILangCodegen) fFilteredList.getFoldedElements(index)[0]; - } - - @Override - protected void computeResult() { - int index = fFilteredList.getSelectionIndex(); - Object[] result = new Object[] { getElement(index) }; - setResult(Arrays.asList(result)); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen.java deleted file mode 100644 index 9c1c5fa8371..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.codegen.extensionpoints; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.PackageableElement; - -/** - * Extension point that is implemented by a code generator for a specific - * programming language - */ -public interface ILangCodegen { - - /** - * FILE KIND enumeration. It supports two distinction options (this might - * need revision in the future, but is sufficient for all currently - * supported languages) - */ - public enum FILE_KIND { - HEADER, BODY - } - - /** - * Generate code for a specific language - * - * @param project - * a project into which code is generated. if null, project is - * determined automatically (see getTargetProject below) - * @param element - * a packageable element, typically a classifier or a package - * @param monitor - * a progress monitor - */ - public void generateCode(IProject project, PackageableElement element, IProgressMonitor monitor); - - /** - * Code might be generated into a specific project. It might be the project - * that hosts the UML file, but it may also be another project that is - * determined for instance by means of a naming convention (such as a common - * prefix and the name of the model). This functions locates and returns the - * target project for the given packageable element. If the project exists, - * but does not have the nature that is required by the language specific - * editor, the user is asked whether the nature should be added. - * - * Ensures that the target project is correctly setup to contain generated - * C/C++ code. Does not create a new project, but may modify existing ones. - * - * @param pe - * a packageable element within a model - * @param createIfMissing - * if true, a new project is created if it does not exist yet. if - * false, null is returned if the project does not exist. - * @return the associated project (or null) - */ - public IProject getTargetProject(PackageableElement pe, boolean createIfMissing); - - /** - * Obtain fileName of file(s) generated for a named element. Delegates to - * location strategy. Caller must eventually add extensions. - * - * @param project - * a project into which code is generated. if null, project is - * determined automatically - * @param element - * a named element. - * @return a project relative file name - */ - public String getFileName(IProject project, NamedElement element); - - /** - * Clean the code for a certain element, i.e. remove code that has - * previously generated for this element This code is required for - * differential code generation which needs to remove elements for instance - * after they have been renamed. - * - * @param project - * project in which code should be generated - * @param element - * the element for which the generate code should be removed - */ - public void cleanCode(IProject project, PackageableElement element, IProgressMonitor monitor); -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen2.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen2.java deleted file mode 100644 index 1cf48b4455a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen2.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.eclipse.papyrus.codegen.extensionpoints; - -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; - -public interface ILangCodegen2 extends ILangCodegen { - - /** - * Provide a user friendly description of the generator - */ - public String getDescription(); - - /** - * Some code generators use a non-trivial mapping from behaviors to methods - * in the generated code or add methods that are not part of a existing - * behavior in the model. This is a problem for code synchronization (update - * of model from code) as done for instance with the CDT editor integration. - * - * @param methodName - * the name of the method as in the code - * @param body - * the body - * @return the associated synchronization information. Null indicates that a - * default mapping is used - */ - public SyncInformation getSyncInformation(String methodName, String body); - - /** - * Return true, if the generator is eligible for a certain element within a - * model. The code generator may check the element itself, but also for - * instance whether a certain profile (such as UML-RT) has been applied. - * Generators are allowed to return true for all models, if they do not have - * specific (profile related) requirements. - * - * @param modelRoot - * the root of a UML model (for which code should be generated) - * @return true, iff the generator is eligible for this model - */ - public boolean isEligible(Element modelElement); - - /** - * Return the suffix of a code generator. Some languages use different - * suffixes depending on the file kind, e.g. C distinguishes between HEADER - * and BODY languages. Other languages can ignore this parameter. - * - * @param FILE_KIND - * The file kind - * @return - */ - public String getSuffix(FILE_KIND fileKind); - - /** - * return additional information about the method that has been generated - * for a UML behavior. This information is used by the CDT editor - * integration to locate the method in the code. - */ - public MethodInfo getMethodInfo(NamedElement operationOrBehavior); -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangProjectSupport.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangProjectSupport.java deleted file mode 100644 index 883ba90b22a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangProjectSupport.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - ansgar.radermacher@cea.fr initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.codegen.extensionpoints; - -import org.eclipse.core.resources.IProject; -import org.eclipse.uml2.uml.Class; - -/** - * Common interface to create projects for a specific programming language. - */ -public interface ILangProjectSupport { - - /** - * Create a project for a specific language and configure it (according to - * gathered configuration data before). In case of C/C++ for instance, a CDT - * project should be created, in case of Java, a JDT project. An - * implementation should call setProject and setSettings before returning - * the project - * - * @param projectName - * the named of the project - * @return the created project - */ - public IProject createProject(String projectName); - - /** - * Write the project settings from the passed project specific settings. - * (which may be obtained via gatherConfigData). - * - * @param the - * operating system for which code should be produced - */ - public void setSettings(IProject project, AbstractSettings settings); - - /** - * Create an initial (empty) configuration. - * @return the project specific configuration. - */ - public AbstractSettings initialConfigurationData(); - - /** - * Gather configuration data from implementations, e.g. required include - * paths or libraries. It will enrich the project specific settings. - * - * @param implementation - * a class copied to the target - */ - public void gatherConfigData(Class implementation, AbstractSettings settings); -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageCodegen.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageCodegen.java deleted file mode 100644 index 2bb0796017c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageCodegen.java +++ /dev/null @@ -1,214 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - ansgar.radermacher@cea.fr initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.codegen.extensionpoints; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.uml2.uml.Classifier; - -/** - * Common interface to generate code. Supports for multiple target languages via - * the Eclipse extension mechanism - */ -public class LanguageCodegen { - - private static final String CLASS = "class"; //$NON-NLS-1$ - - private static final String LANGUAGE = "language";//$NON-NLS-1$ - - private static final String ID = "id";//$NON-NLS-1$ - - public static final String ILANG_SUPPORT_ID = Activator.PLUGIN_ID + ".languageCodegen"; //$NON-NLS-1$ - - /** - * Interactively choose a generator for a given set of languages (pattern). - * If only one generator is available, it returns this generator - * immediately. - * - * @param languagePattern - * @param classifier - * @return - */ - public static ILangCodegen chooseGenerator(Pattern languagePattern, Classifier classifier) { - List eligibleGenerators = getEligibleGeneratorList(languagePattern, classifier); - - if (eligibleGenerators.size() == 1) { - return eligibleGenerators.get(0); - } - Shell shell = Display.getDefault().getActiveShell(); - if (eligibleGenerators.size() > 1) { - GeneratorSelectionDialog dialog = new GeneratorSelectionDialog(shell, eligibleGenerators); - if (dialog.open() == IDialogConstants.OK_ID) { - return (ILangCodegen) dialog.getResult()[0]; - } - } - else { - // echo language pattern in a more readible way: without escape characters that are used for - // the "+" in C++ - String pattern = languagePattern.pattern().replace("\\", ""); //$NON-NLS-1$ //$NON-NLS-2$ - MessageDialog.openError(shell, Messages.LanguageCodegen_NoGeneratorsFound, - String.format(Messages.LanguageCodegen_NoGeneratorsFoundLong, pattern)); - } - - return null; - } - - /** - * Get a code generator via language and ID. - * - * @param languagePattern - * a pattern containing a list of supported languages - * @return a code generator - */ - public static ILangCodegen getGenerator(String language) { - // compile language into a pattern, escape "+" - return getGenerator(Pattern.compile(language.replace("+", "\\+")), null); //$NON-NLS-1$//$NON-NLS-2$ - } - - /** - * Get a code generator via language and ID. - * - * @param languagePattern - * a pattern containing a list of supported languages - * @return a code generator - */ - public static ILangCodegen getGenerator(String language, String id) { - return getGenerator(Pattern.compile(language), id); - } - - /** - * Get a code generator via language and ID. - * - * @param languagePattern - * a pattern containing a list of supported languages - * @param id - * a string determining the id of the code generator. If null, - * the first available generator is returned. - * @return a code generator - */ - public static ILangCodegen getGenerator(Pattern languagePattern, String id) { - List generators = getCodegenList(languagePattern); - for (ILangCodegen generator : generators) { - if ((id == null) || generatorIDs.get(generator).equals(id)) { - return generator; - } - } - throw new RuntimeException(String.format(Messages.LanguageSupport_LanguageNotSupported, languagePattern)); - } - - /** - * Get a list of generators that conform a language patterns and are - * eligible for a passe classifier - * - * @param languagePattern - * a language pattern - * @param classifier - * a classifier - * @return - */ - public static List getEligibleGeneratorList(Pattern languagePattern, Classifier classifier) { - List eligibleGenerators = new ArrayList(); - for (ILangCodegen generator : getCodegenList(languagePattern)) { - if (generator instanceof ILangCodegen2) { - if (((ILangCodegen2) generator).isEligible(classifier)) { - eligibleGenerators.add(generator); - } - } - else { - eligibleGenerators.add(generator); - } - } - return eligibleGenerators; - } - - /** - * retrieve a list of code generators for a given language. The language may - * be a regular expression - * - * @param language - * @return - */ - public static List getCodegenList(Pattern languagePattern) { - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] configElements = reg.getConfigurationElementsFor(ILANG_SUPPORT_ID); - List generators = new ArrayList(); - - for (IConfigurationElement configElement : configElements) { - try { - final String id = configElement.getAttribute(ID); - final String extLanguage = configElement.getAttribute(LANGUAGE); - Matcher m = languagePattern.matcher(extLanguage); - if (m.matches()) { - final Object obj = configElement.createExecutableExtension(CLASS); - if (obj instanceof ILangCodegen) { - ILangCodegen generator = (ILangCodegen) obj; - if (!generatorIDs.containsKey(generator)) { - generatorIDs.put(generator, id); - } - generators.add((ILangCodegen) obj); - } - } - } catch (CoreException exception) { - exception.printStackTrace(); - } - } - return generators; - } - - /** - * Get a code generator for a given language - * @param language - * @return - * @deprecated This method is deprecated and kept for compatibility, since there could be more than one generator - * for a given programming language. - */ - @Deprecated - public static ILangCodegen getCodegen(String language) - { - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] configElements = reg.getConfigurationElementsFor(ILANG_SUPPORT_ID); - for (IConfigurationElement configElement : configElements) { - try { - final String extLanguage = configElement.getAttribute(LANGUAGE); - if (extLanguage.equals(language)) { - // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) - final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ - if (obj instanceof ILangCodegen) { - return (ILangCodegen) obj; - } - } - } catch (CoreException exception) { - exception.printStackTrace(); - } - } - throw new RuntimeException(String.format(Messages.LanguageSupport_LanguageNotSupported, language)); - } - - public static String getID(ILangCodegen generator) { - return generatorIDs.get(generator); - } - - static Map generatorIDs = new HashMap(); -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageProjectSupport.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageProjectSupport.java deleted file mode 100644 index 031993d2adb..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageProjectSupport.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - ansgar.radermacher@cea.fr initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.codegen.extensionpoints; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; - -/** - * Support for multiple target languages via the Eclipse extension mechanism - */ -public class LanguageProjectSupport { - - public static final String ILANG_SUPPORT_ID = Activator.PLUGIN_ID + ".languageProjectSupport"; //$NON-NLS-1$ - - /** - * Get the project support for a given language editor. - * - * @param language - * a programming language - * @return the project support - */ - public static ILangProjectSupport getProjectSupport(String language) { - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] configElements = reg.getConfigurationElementsFor(ILANG_SUPPORT_ID); - for (IConfigurationElement configElement : configElements) { - try { - final String extLanguage = configElement.getAttribute("language"); //$NON-NLS-1$ - if (extLanguage.equals(language)) { - final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ - if (obj instanceof ILangProjectSupport) { - return (ILangProjectSupport) obj; - } - } - } catch (CoreException exception) { - exception.printStackTrace(); - } - } - throw new RuntimeException(String.format(Messages.LanguageSupport_LanguageNotSupported, language)); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Messages.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Messages.java deleted file mode 100644 index 7ef890e1a85..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Messages.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.eclipse.papyrus.codegen.extensionpoints; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.papyrus.codegen.extensionpoints.messages"; //$NON-NLS-1$ - public static String GeneratorSelectionDialog_infoCodeGen; - public static String GeneratorSelectionDialog_SelectGenerator; - public static String LanguageCodegen_NoGeneratorsFound; - public static String LanguageCodegen_NoGeneratorsFoundLong; - public static String LanguageSupport_LanguageNotSupported; - public static String ModelElementsCreator_UnsupportedModelElement; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/MethodInfo.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/MethodInfo.java deleted file mode 100644 index 3886c365d17..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/MethodInfo.java +++ /dev/null @@ -1,124 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.codegen.extensionpoints; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.ParameterDirectionKind; - -/** - * Additional information about a method that has been generated for a UML behavior. - * This information is used by the CDT editor integration to locate the method in the code, but might be useful - * for other languages as well. - */ -public class MethodInfo { - - /** - * Create a new method info with a given name. The parameter list is initially empty. - * Parameter types can be added with the method addParameterType - * can be initialized later. - * @param name - */ - public MethodInfo(String name) { - this.name = name; - this.parameterTypes = new ArrayList(); - } - - /** - * Create a new method info - * @param name - * @param parameterTypes - */ - public MethodInfo(String name, List parameterTypes) { - this.name = name; - this.parameterTypes = parameterTypes; - } - - /** - * constructor creating a default method information instance from a given behavior - * @param behavior - */ - public static MethodInfo fromBehavior(Behavior behavior) { - MethodInfo mi = new MethodInfo(behavior.getName()); - for (Parameter parameter : behavior.getOwnedParameters()) { - if (parameter.getDirection() != ParameterDirectionKind.RETURN_LITERAL) { - if (parameter.getType() != null) { - mi.addParameterType(parameter.getType().getQualifiedName()); - } - } - else { - mi.addParameterType("undefined"); //$NON-NLS-1$ - } - } - return mi; - } - - /** - * default initializer from a method - * @param behavior - */ - public static MethodInfo fromOperation(Operation operation) { - MethodInfo mi = new MethodInfo(operation.getName()); - for (Parameter parameter : operation.getOwnedParameters()) { - if (parameter.getDirection() != ParameterDirectionKind.RETURN_LITERAL) { - if (parameter.getType() != null) { - mi.addParameterType(parameter.getType().getQualifiedName()); - } - } - else { - mi.addParameterType("undefined"); //$NON-NLS-1$ - } - } - return mi; - } - - /** - * Add a parameter type - * - * @param parameterType the parameter type - */ - public void addParameterType(String parameterType) { - parameterTypes.add(parameterType); - } - - /** - * @return method name - */ - public String getName() { - return name; - } - - /** - * @return list of parameters types (in form of strings). These might contain additional - * modifiers, e.g. { "const char*" } - */ - public List getParameterTypes() { - return parameterTypes; - } - - /** - * The name of the generated method. - */ - protected String name; - - /** - * The names of parameter types - */ - protected List parameterTypes; -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/SyncInformation.java b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/SyncInformation.java deleted file mode 100644 index 82f5d4e4af9..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/SyncInformation.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.eclipse.papyrus.codegen.extensionpoints; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Behavior; - -/** - * Some code generators map behaviors in a non-trivial way or add methods that have not been generated. - * The following information allows (generic) synchronization code, as within the CDT editor to - * make a useful update of the source model. - */ -public class SyncInformation { - /** - * true, iff the method has been added by the generator and does not need synchronization. - */ - public boolean isGenerated; - - /** - * the associated behavior within the source model, in case of a non-trivial method. - * If the element does not exist yet in the source model, it may be null. - */ - public Behavior behavior; - - /* - * The qualified name of a behavior to create in the model. This is used, if there should be an associated behavior in the - * model, but it does not exist yet. Only one of the two attributes (behavior and createBehaviorName) must be set. - */ - public String createBehaviorName; - - /** - * the element for which the CDT editor has been opened. This may for instance be the class that is edited. - */ - public EObject editedElement; - - /** - * The method body gets filtered during default synchronization (text between generation markers is removed), but the filtered information might be - * important for customized back-synchronization. - */ - public String unfilteredBody; -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/messages.properties b/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/messages.properties deleted file mode 100644 index 72942846feb..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/messages.properties +++ /dev/null @@ -1,6 +0,0 @@ -GeneratorSelectionDialog_infoCodeGen=Information about code generator: -GeneratorSelectionDialog_SelectGenerator=Select a code generator -LanguageCodegen_NoGeneratorsFound=No code generators found -LanguageCodegen_NoGeneratorsFoundLong=No eligible code generators can be found for the language pattern %s -LanguageSupport_LanguageNotSupported=Support for language "%s" not configured -ModelElementsCreator_UnsupportedModelElement=code generator: unsupported model element "%s" diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/.classpath b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/.project b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/.project deleted file mode 100644 index 29f34de0ecf..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/.project +++ /dev/null @@ -1,35 +0,0 @@ - - - org.eclipse.papyrus.cpp.cdtproject - - - ec3m.genTools.core - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - fr.obeo.acceleo.gen.ui.acceleoGenBuilder - - - - - - fr.obeo.acceleo.gen.ui.acceleoGenNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/.settings/org.eclipse.jdt.core.prefs b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index c537b63063c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/META-INF/MANIFEST.MF deleted file mode 100644 index ff6f3ed5154..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/META-INF/MANIFEST.MF +++ /dev/null @@ -1,24 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.cpp.cdtproject -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.emf.ecore, - org.eclipse.uml2.uml, - org.eclipse.cdt.ui, - org.eclipse.ui.ide, - org.eclipse.core.resources, - org.eclipse.cdt.managedbuilder.core;bundle-version="8.0.0", - org.eclipse.cdt.core;bundle-version="5.4.0", - org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", - org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.2.0", - org.eclipse.cdt.managedbuilder.ui;bundle-version="8.0.0", - org.eclipse.papyrus.codegen.base;bundle-version="1.2.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.cpp.cdtproject.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.cpp.cdtproject;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/about.html b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/build.properties b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/build.properties deleted file mode 100644 index 7b3c227b84a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - plugin.properties,\ - about.html -src.includes = about.html diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/plugin.properties deleted file mode 100644 index 48c00f652ce..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus extra: Qompass C++ support (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/plugin.xml deleted file mode 100644 index 8c640146657..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/plugin.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/pom.xml deleted file mode 100644 index a706584e1ec..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.cpp.cdtproject - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/Activator.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/Activator.java deleted file mode 100644 index ad6ab20019d..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/Activator.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.papyrus.cpp.cdtproject; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.cpp.cdtproject"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CCNamedProjectWizard.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CCNamedProjectWizard.java deleted file mode 100644 index b712ac949aa..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CCNamedProjectWizard.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.eclipse.papyrus.cpp.cdtproject; - -import org.eclipse.cdt.ui.wizards.CCProjectWizard; -import org.eclipse.jface.wizard.IWizardPage; - -/** - * Variant of CCProjectWizard that allows for setting an initial - * project name. It creates the pages and sets the initial name. - * It does not use the standard CDTMainWizardPage but a variant - * called CDTMainWizardPageV that skips the first validation which - * would other trigger an error. - * - * @see org.eclipse.papyrus.cpp.cdtproject.CDTMainWizardPageV - */ -public class CCNamedProjectWizard extends CCProjectWizard { - - public CCNamedProjectWizard(String projectName) { - this.projectName = projectName; - dontAdd = false; - } - - @Override - public void addPages() { - dontAdd = true; - // avoid that page is actually added, since we want to add our page below - super.addPages(); - dontAdd = false; - String title = fMainPage.getTitle(); - String desc = fMainPage.getDescription(); - fMainPage = new CDTMainWizardPageV(fMainPage.getName()); - fMainPage.setTitle(title); - fMainPage.setDescription(desc); - fMainPage.setInitialProjectName(projectName); - addPage(fMainPage); - } - - @Override - public void addPage(IWizardPage page) { - if (!dontAdd) { - super.addPage(page); - } - } - - private String projectName; - - private boolean dontAdd; -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTMainWizardPageV.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTMainWizardPageV.java deleted file mode 100644 index 9066abf68d1..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTMainWizardPageV.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.eclipse.papyrus.cpp.cdtproject; - -import org.eclipse.cdt.ui.wizards.CDTMainWizardPage; - -/** - * Variant of the CDTMainWizardPage that skips the first validation. This - * is required in the context of setting an initial project name, since the - * update of the project name will trigger a validation which stops with an - * exception, since some elements (notable tree) are not yet initialized. - * - * Verify if future versions of CDT still require this "hack" {@link CDTMainWizardPage} - * - * @author ansgar - * - */ -public class CDTMainWizardPageV extends CDTMainWizardPage { - - public CDTMainWizardPageV(String pageName) { - super(pageName); - firstValidate = true; - } - - @Override - protected boolean validatePage() { - if (firstValidate) { - return true; - } else { - return super.validatePage(); - } - } - - private boolean firstValidate; -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTSettings.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTSettings.java deleted file mode 100644 index 7f44c642855..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTSettings.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.eclipse.papyrus.cpp.cdtproject; - -import java.util.List; - -import org.eclipse.papyrus.codegen.extensionpoints.AbstractSettings; - -public class CDTSettings extends AbstractSettings { - - /** - * include paths for compiler - */ - List includePaths; - - /** - * list of libraries for linker - */ - List libs; - - /** - * list of library paths for linker - */ - List libPaths; - - /** - * list of predefined macros (#define) - */ - List macros; -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CNamedProjectWizard.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CNamedProjectWizard.java deleted file mode 100644 index af5e1592c11..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CNamedProjectWizard.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.eclipse.papyrus.cpp.cdtproject; - -import org.eclipse.cdt.ui.wizards.CProjectWizard; -import org.eclipse.jface.wizard.IWizardPage; - -/** - * Variant of CProjectWizard that allows for setting an initial - * project name. It creates the pages and sets the initial name. - * It does not use the standard CDTMainWizardPage but a variant - * called CDTMainWizardPageV that skips the first validation which - * would other trigger an error. - * - * @see org.eclipse.papyrus.cpp.cdtproject.CDTMainWizardPageV - */ -public class CNamedProjectWizard extends CProjectWizard { - - public CNamedProjectWizard(String projectName) { - this.projectName = projectName; - dontAdd = false; - } - - @Override - public void addPages() { - dontAdd = true; - // avoid that page is actually added, since we want to add our page below - super.addPages(); - dontAdd = false; - String title = fMainPage.getTitle(); - String desc = fMainPage.getDescription(); - fMainPage = new CDTMainWizardPageV(fMainPage.getName()); - fMainPage.setTitle(title); - fMainPage.setDescription(desc); - fMainPage.setInitialProjectName(projectName); - addPage(fMainPage); - } - - @Override - public void addPage(IWizardPage page) { - if (!dontAdd) { - super.addPage(page); - } - } - - private String projectName; - - private boolean dontAdd; -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CProjectSupport.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CProjectSupport.java deleted file mode 100644 index 9f020fd2354..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CProjectSupport.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.eclipse.papyrus.cpp.cdtproject; - -import org.eclipse.core.resources.IProject; -import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; - -/** - * C project support - */ -public class CProjectSupport extends C_CppProjectSupport implements ILangProjectSupport { - - @Override - public IProject createProject(String projectName) { - IProject project = super.createProject(projectName); - return project; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/C_CppProjectSupport.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/C_CppProjectSupport.java deleted file mode 100644 index f86106b7577..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/C_CppProjectSupport.java +++ /dev/null @@ -1,225 +0,0 @@ -package org.eclipse.papyrus.cpp.cdtproject; - -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.settings.model.CIncludePathEntry; -import org.eclipse.cdt.core.settings.model.CMacroEntry; -import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; -import org.eclipse.cdt.core.settings.model.ICFolderDescription; -import org.eclipse.cdt.core.settings.model.ICLanguageSetting; -import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; -import org.eclipse.cdt.core.settings.model.ICProjectDescription; -import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager; -import org.eclipse.cdt.core.settings.model.ICSettingEntry; -import org.eclipse.cdt.managedbuilder.core.BuildException; -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.IOption; -import org.eclipse.cdt.managedbuilder.core.ITool; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.ui.wizards.CDTCommonProjectWizard; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.papyrus.C_Cpp.ExternLibrary; -import org.eclipse.papyrus.codegen.extensionpoints.AbstractSettings; -import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.PlatformUI; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Supports the creation and configuration of CDT projects - */ -public class C_CppProjectSupport implements ILangProjectSupport { - - // TODO specific "root" is only required for component based code generation - private static final String ROOT = "root"; //$NON-NLS-1$ - - private static final String C = "c"; //$NON-NLS-1$ - - private static final String CPP = "cpp"; //$NON-NLS-1$ - - private int dialogStatus; - - /** - * Create a C++ project. - * Caller should test before calling, whether the project exists already - * - * @param projectName - * @return the created project - */ - @Override - public IProject createProject(String projectName) - { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - - IProject project = root.getProject(projectName); - dialogStatus = 0; - try { - IWorkbench wb = PlatformUI.getWorkbench(); - - // create CDT wizard for C++ or C - final CDTCommonProjectWizard wiz = this instanceof CppProjectSupport ? - new CCNamedProjectWizard(projectName) : - new CNamedProjectWizard(projectName); - - wiz.setWindowTitle("create project " + projectName); //$NON-NLS-1$ - wiz.init(wb, null); - - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - WizardDialog wizDiag = new WizardDialog(Display.getCurrent().getActiveShell(), wiz); - - wizDiag.create(); - dialogStatus = wizDiag.open(); - } - }); - } catch (Exception e) { - e.printStackTrace(); - project = null; - } - if (dialogStatus == 1) { - // corresponds to Cancel - return null; - } - if ((project == null) || !project.exists()) { - throw new RuntimeException("Could not create CDT project. This might indicate that there is a problem with your CDT installation."); //$NON-NLS-1$ - } - return project; - } - - @Override - public void setSettings(IProject project, AbstractSettings abstractSettings) - { - CDTSettings settings = (CDTSettings) abstractSettings; - try { - // ((CProject) project). - // IProjectDescription desc = m_project.getDescription(); - - ICProjectDescriptionManager mngr = - CoreModel.getDefault().getProjectDescriptionManager(); - ICProjectDescription cdesc = mngr.getProjectDescription(project, true); - - // loop over all configurations - for (ICConfigurationDescription configDescr : cdesc.getConfigurations()) { - - ICFolderDescription folderDescription = - configDescr.getRootFolderDescription(); - - ICLanguageSetting[] languageSettings = folderDescription.getLanguageSettings(); - - // copy string array into ICLanguageSetting array - ICLanguageSettingEntry[] icIncludePaths = new ICLanguageSettingEntry[settings.includePaths.size()]; - for (int i = 0; i < settings.includePaths.size(); i++) { - icIncludePaths[i] = new CIncludePathEntry(settings.includePaths.get(i), ICSettingEntry.VALUE_WORKSPACE_PATH); - } - - // define name of used operating system from model (attribute of "Target" stereotype) - // and add it to list of macros - if (settings.targetOS != null) { - settings.macros.add("OS_" + settings.targetOS); //$NON-NLS-1$ - } - - // define macros - EList icMacros = - new BasicEList(); - for (int i = 0; i < settings.macros.size(); i++) { - // TODO: need to define values for macros as well? - icMacros.add(new CMacroEntry(settings.macros.get(i), "", 0)); //$NON-NLS-1$ - } - - // now set include path and preprocessor code - for (ICLanguageSetting lang : languageSettings) { - // selection better via ID? (instead of extension) - // Log.log(Status.INFO, Log.CODEGEN, "CppLanguageSupport: lang.getID: " + lang.getId() + " lang.getLanguageID: " + lang.getLanguageId()); - for (String ext : lang.getSourceExtensions()) { - if (ext.equals(CPP) || ext.equals(C)) { - lang.setSettingEntries(ICSettingEntry.INCLUDE_PATH, icIncludePaths); - ICLanguageSettingEntry icOldMacros[] = - lang.getSettingEntries(ICSettingEntry.MACRO); - for (ICLanguageSettingEntry entry : icOldMacros) { - icMacros.add(entry); - } - lang.setSettingEntries(ICSettingEntry.MACRO, icMacros); - break; - } - } - } - IConfiguration main = ManagedBuildManager.getConfigurationForDescription(configDescr); - // change artifact name - // main.setArtifactName(main.getArtifactName () + ".bin"); - - // add to -l (libraries) - ITool cfTool = main.calculateTargetTool(); - - // IOption libOption = cfTool.getOptionBy(IOption.TYPE_LIB); - - for (IOption opt : cfTool.getOptions()) { - if (opt.getValueType() == IOption.LIBRARIES) { - main.setOption(cfTool, opt, settings.libs.toArray(new String[0])); - } else if (opt.getValueType() == IOption.LIBRARY_PATHS) { - main.setOption(cfTool, opt, settings.libPaths.toArray(new String[0])); - } - } - mngr.setProjectDescription(project, cdesc, true, null); - } - ManagedBuildManager.saveBuildInfo(project, true); - } catch (BuildException be) { - throw new RuntimeException(be.getMessage()); - } catch (CoreException ce) { - throw new RuntimeException(ce.getMessage()); - } - } - - @Override - public AbstractSettings initialConfigurationData() { - CDTSettings settings = new CDTSettings(); - settings.includePaths = new UniqueEList(); - // include project directory (all paths are relative to it => ".") - settings.includePaths.add("."); //$NON-NLS-1$ - // include also "root" (relative path) - settings.includePaths.add(ROOT); - - settings.libs = new UniqueEList(); - settings.libPaths = new UniqueEList(); - settings.macros = new UniqueEList(); - return settings; - } - - @Override - public void gatherConfigData(Class implementation, AbstractSettings abstractSettings) { - CDTSettings settings = (CDTSettings) abstractSettings; - Element owner = implementation.getOwner(); - while (owner instanceof Package) { - ExternLibrary cppLibrary = UMLUtil.getStereotypeApplication(owner, ExternLibrary.class); - if ((cppLibrary != null) && (settings != null)) { - settings.includePaths.addAll(cppLibrary.getIncludes()); - for (String libPath : cppLibrary.getLibPaths()) { - if (libPath.startsWith("/")) { - // libPaths starting with a slash are relative to workspace location - // TODO: need to support absolute paths (host file system?) as well? - // (additional prefix. Eclipse standards?) Problem: workspace_loc is added - // automatically for absolute includePaths - settings.libPaths.add("${workspace_loc:" + libPath + "}"); - } else { - // relative to project root, otherwise - settings.libPaths.add(libPath); - } - } - settings.libs.addAll(cppLibrary.getLibs()); - settings.macros.addAll(cppLibrary.getMacros()); - } - owner = owner.getOwner(); - } - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CppProjectSupport.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CppProjectSupport.java deleted file mode 100644 index aaebf98d1d7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CppProjectSupport.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.eclipse.papyrus.cpp.cdtproject; - -import org.eclipse.core.resources.IProject; -import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; - -/** - * C++ project support - */ -public class CppProjectSupport extends C_CppProjectSupport implements ILangProjectSupport { - - @Override - public IProject createProject(String projectName) { - IProject project = super.createProject(projectName); - - return project; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.classpath b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.project b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.project deleted file mode 100644 index 6973103854a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.cpp.codegen.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.settings/org.eclipse.jdt.core.prefs b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index c537b63063c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 7adeca72822..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,25 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.emf.common;bundle-version="2.8.0", - org.eclipse.emf.ecore;bundle-version="2.8.0", - org.eclipse.papyrus.infra.core;bundle-version="1.2.0", - org.eclipse.uml2.uml;bundle-version="4.0.0", - org.eclipse.papyrus.cpp.codegen;bundle-version="1.2.0", - org.eclipse.jface.text;bundle-version="3.8.0", - org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", - org.eclipse.cdt.core;bundle-version="5.5.0", - org.eclipse.papyrus.codegen.base;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", - org.eclipse.core.resources, - org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.cpp.codegen.ui.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.cpp.codegen.ui;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/about.html b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/build.properties b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/build.properties deleted file mode 100644 index 93bba3b6fa4..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - icons/,\ - plugin.properties,\ - plugin.xml,\ - about.html -src.includes = about.html diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/icons/codegen.gif b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/icons/codegen.gif deleted file mode 100644 index c416117e54e..00000000000 Binary files a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/icons/codegen.gif and /dev/null differ diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/plugin.properties deleted file mode 100644 index 53638e41626..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus C++ code generation UI (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/plugin.xml deleted file mode 100644 index e9111f464b8..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/plugin.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/pom.xml deleted file mode 100644 index a8c5b87d073..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.cpp.codegen.ui - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/Activator.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/Activator.java deleted file mode 100644 index 7a8e531ea10..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/Activator.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.ui; - -import org.eclipse.papyrus.infra.core.log.LogHelper; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.cpp.codegen.ui"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - public static LogHelper log; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - - // register the login helper - log = new LogHelper(plugin); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/CDTprojectHandler.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/CDTprojectHandler.java deleted file mode 100644 index ca4efce5b24..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/CDTprojectHandler.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.emf.common.util.URI; -import org.eclipse.papyrus.codegen.extensionpoints.AbstractSettings; -import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; -import org.eclipse.papyrus.codegen.extensionpoints.LanguageProjectSupport; -import org.eclipse.papyrus.cpp.codegen.utils.LocateCppProject; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; - -/** - * Handler for C++ code generation - */ -public class CDTprojectHandler extends CmdHandler { - - private static final String LANGUAGE_NAME = "C++"; //$NON-NLS-1$ - - // ------------------------------------------------------------------------ - // Execution - // ------------------------------------------------------------------------ - - @Override - public boolean isEnabled() { - updateSelectedEObject(); - - if (selectedEObject instanceof Package || selectedEObject instanceof Classifier) { - URI uri = selectedEObject.eResource().getURI(); - - // URIConverter uriConverter = resource.getResourceSet().getURIConverter(); - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - if (uri.segmentCount() < 2) { - return false; - } - IProject modelProject = root.getProject(uri.segment(1)); - return modelProject.exists(); - } - - return false; - } - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - if (selectedEObject instanceof PackageableElement) { - PackageableElement pe = (PackageableElement) selectedEObject; - - IProject modelProject = LocateCppProject.getTargetProject(pe, true); - if (modelProject == null) { - return null; - } - - // get the container for the current element - ILangProjectSupport langSupport = LanguageProjectSupport.getProjectSupport(LANGUAGE_NAME); - if (langSupport != null) { - AbstractSettings settings = langSupport.initialConfigurationData(); - langSupport.setSettings(modelProject, settings); - } - else { - return null; - } - } - return null; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/GenerateCodeHandler.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/GenerateCodeHandler.java deleted file mode 100644 index 8755e9c615c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/GenerateCodeHandler.java +++ /dev/null @@ -1,123 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.papyrus.cpp.codegen.transformation.CppModelElementsCreator; -import org.eclipse.papyrus.cpp.codegen.utils.ClassUtils; -import org.eclipse.papyrus.cpp.codegen.utils.LocateCppProject; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; - -/** - * Handler for C++ code generation - */ -public class GenerateCodeHandler extends CmdHandler { - - private static final boolean Headless = Boolean.getBoolean("papyrus.run-headless"); - - // ------------------------------------------------------------------------ - // Execution - // ------------------------------------------------------------------------ - - @Override - public boolean isEnabled() { - updateSelectedEObject(); - - if (selectedEObject instanceof Package || selectedEObject instanceof Classifier) { - URI uri = selectedEObject.eResource().getURI(); - - // URIConverter uriConverter = resource.getResourceSet().getURIConverter(); - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - if (uri.segmentCount() < 2) { - return false; - } - IProject modelProject = root.getProject(uri.segment(1)); - return modelProject.exists(); - } - - return false; - } - - /** - * Generate code for a passed packageable element and the elements required by it (in the sense of #included statements) - * - * @param mec - * model elements creator - * @param pe - * the element that should be generated - * @param alreadyHandled - * list of packageable elements for which code has already been generated. - * @param recurse - * if the passed packageableElement is a package, generate code for its contents (recursively). - */ - public void generate(CppModelElementsCreator mec, PackageableElement pe, EList alreadyHandled, boolean recurse) { - alreadyHandled.add(pe); - mec.createPackageableElement(pe, null, false); - // Eventual refresh is done in createPackageableElement - - // if recursion is active, go into all sub-elements - if (pe instanceof Package && recurse) { - for (PackageableElement subPe : ((Package) pe).getPackagedElements()) { - if (!alreadyHandled.contains(subPe)) { - generate(mec, subPe, alreadyHandled, recurse); - } - } - } - - // add required classifiers - if (pe instanceof Classifier) { - EList requiredClassifiers = ClassUtils.includedClassifiers((Classifier) pe); - for (Classifier requiredClassifier : requiredClassifiers) { - if (!alreadyHandled.contains(requiredClassifier)) { - generate(mec, requiredClassifier, alreadyHandled, false); - } - } - } - - // owning package is required by generated code. - Package owningPackage = pe.getNearestPackage(); - if ((owningPackage != null) && (owningPackage != pe)) { - if (!alreadyHandled.contains(owningPackage)) { - generate(mec, owningPackage, alreadyHandled, false); - } - } - } - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - if (selectedEObject instanceof PackageableElement) { - PackageableElement pe = (PackageableElement) selectedEObject; - - IProject modelProject = LocateCppProject.getTargetProject(pe, true); - if (modelProject == null) { - return null; - } - - // get the container for the current element - CppModelElementsCreator mec = new CppModelElementsCreator(modelProject); - generate(mec, pe, new BasicEList(), true); - } - return null; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/preferences/CodegenPreferencePage.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/preferences/CodegenPreferencePage.java deleted file mode 100644 index 2c84930aecd..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/preferences/CodegenPreferencePage.java +++ /dev/null @@ -1,117 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.ui.preferences; - -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.papyrus.cpp.codegen.Activator; -import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenConstants; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Group; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - - -/** - * This class represents a preference page that is contributed to the - * Preferences dialog. By subclassing FieldEditorPreferencePage , - * we can use the field support built into JFace that allows us to create a page - * that is small and knows how to save, restore and apply itself. - *

- * This page is used to modify preferences only. They are stored in the preference store that belongs to the main plug-in class. That way, preferences can be accessed directly via the preference store. - */ - -public class CodegenPreferencePage extends FieldEditorPreferencePage implements - IWorkbenchPreferencePage { - - private Document pCommentDoc = new Document(); - - public CodegenPreferencePage() { - super(GRID); - setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription("This preferences page allows to customize Papyrus C++ code generation"); - } - - public void addTextField(String name, String label, Document currentDoc) { - // /////////////////////////////////////////////////////////////////////// - // Create a Group for the text - // /////////////////////////////////////////////////////////////////////// - Group txtGroup = new Group(getFieldEditorParent(), SWT.RESIZE); - txtGroup.setLayout(new FillLayout()); - txtGroup.setText(label); - GridData gd = new GridData(GridData.FILL_BOTH /* FILL_HORIZONTAL */); - // gd.heightHint = 250; - gd.horizontalSpan = 2; - txtGroup.setLayoutData(gd); - - // Text area - SourceViewer txtViewer = new SourceViewer(txtGroup, null, SWT.MULTI - | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); - - txtViewer.setDocument(currentDoc); - - // Retrieving existing preference - String content = getPreferenceStore().getString(name); - - // Loading preference in txt zone - currentDoc.set(content); - - } - - /** - * Creates the field editors. Field editors are abstractions of the common - * GUI blocks needed to manipulate various types of preferences. Each field - * editor knows how to save and restore itself. - */ - - @Override - public void createFieldEditors() { - - addField(new StringFieldEditor(CppCodeGenConstants.P_HEADER_SUFFIX, - "Suffix for C++ header files ", getFieldEditorParent())); - addField(new StringFieldEditor(CppCodeGenConstants.P_IMPLEM_SUFFIX, - "Suffix for C++ implementation files ", getFieldEditorParent())); - addField(new StringFieldEditor(CppCodeGenConstants.P_PROJECT_PREFIX, - "Prefix for generated C++ (CDT) projects ", getFieldEditorParent())); - - // Add P_COMMENT_HEADER - addTextField(CppCodeGenConstants.P_COMMENT_HEADER, "Header for generated files", - pCommentDoc); - } - - @Override - public void init(IWorkbench workbench) { - } - - @Override - public void performDefaults() { - - // initialize comment field from default - pCommentDoc.set(getPreferenceStore().getDefaultString(CppCodeGenConstants.P_COMMENT_HEADER)); - super.performDefaults(); - } - - @Override - public boolean performOk() { - - // Store txt for P_COMMENT_HEADER - String currentComment = pCommentDoc.get(); - getPreferenceStore().setValue(CppCodeGenConstants.P_COMMENT_HEADER, currentComment); - - return super.performOk(); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/.classpath b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/.classpath deleted file mode 100644 index 358df1bc1d1..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/.project b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/.project deleted file mode 100644 index 1b4a71a36b8..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/.project +++ /dev/null @@ -1,52 +0,0 @@ - - - org.eclipse.papyrus.cpp.codegen - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.acceleo.ide.ui.acceleoBuilder - - - compilation.kind - compilation.absolute.path - - - compliance - pragmatic - - - resource.kind - xmi - - - - - - org.eclipse.acceleo.ide.ui.acceleoNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - org.eclipse.xtext.ui.shared.xtextNature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/META-INF/MANIFEST.MF deleted file mode 100644 index 508918952e5..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/META-INF/MANIFEST.MF +++ /dev/null @@ -1,41 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.jface.text, - org.eclipse.uml2.uml;bundle-version="4.1.0", - org.eclipse.core.resources, - org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", - org.eclipse.ui.ide;bundle-version="3.8.0", - org.eclipse.core.filesystem;bundle-version="1.3.200", - org.eclipse.cdt.core;resolution:=optional, - org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", - org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", - org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.2.0", - org.eclipse.xtend.lib, - com.google.guava;bundle-version="11.0.0", - org.eclipse.xtext.xbase.lib, - org.eclipse.uml2.uml.profile.standard;bundle-version="1.0.0", - org.eclipse.papyrus.codegen.base;bundle-version="1.2.0" -Export-Package: org.eclipse.papyrus.cpp.codegen;uses:="org.eclipse.ui.plugin, - org.osgi.framework, - org.eclipse.uml2.uml", - org.eclipse.papyrus.cpp.codegen.preferences;uses:="org.eclipse.jface.preference, - org.eclipse.core.runtime.preferences", - org.eclipse.papyrus.cpp.codegen.transformation; uses:="org.eclipse.core.runtime, - org.eclipse.papyrus.acceleo, - org.eclipse.core.resources, - org.eclipse.uml2.uml", - org.eclipse.papyrus.cpp.codegen.utils;uses:="org.eclipse.emf.ecore, - org.eclipse.emf.common.util, - org.eclipse.uml2.uml", - org.eclipse.papyrus.cpp.codegen.xtend -Bundle-Vendor: %providerName -Eclipse-LazyStart: true -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.cpp.codegen.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.cpp.codegen;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/about.html b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/build.acceleo b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/build.acceleo deleted file mode 100644 index 26abe5ae4c9..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/build.acceleo +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/build.properties b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/build.properties deleted file mode 100644 index 143d4e25c7d..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -# -#Tue Mar 26 23:29:07 CET 2013 -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - plugin.properties,\ - about.html,\ - build.acceleo,\ - src/org/eclipse/papyrus/cpp/codegen/utils/messages.properties -output..=bin/ -src.includes=about.html -source..=src/,xtend-gen/ -customBuildCallbacks=build.acceleo diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/plugin.properties deleted file mode 100644 index c14d7642918..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus C++ code generation (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/plugin.xml deleted file mode 100644 index 5cdc98728ed..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/plugin.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/pom.xml deleted file mode 100644 index 475b2100504..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.cpp.codegen - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-clean-plugin - - - - xtend-gen - - **/* - - - .gitignore - - - - - - - org.eclipse.xtend - xtend-maven-plugin - - - generate-sources - - compile - - - - - xtend-gen - ${project.build.directory}/xtend-gen/test - - - - - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Activator.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Activator.java deleted file mode 100644 index f61e97bca9c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Activator.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2012 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ -package org.eclipse.papyrus.cpp.codegen; - -import org.eclipse.papyrus.infra.core.log.LogHelper; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.cpp.codegen"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - public static LogHelper log; - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - /** - * The constructor - */ - public Activator() { - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - log = new LogHelper(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Constants.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Constants.java deleted file mode 100644 index e1f5d37c6ec..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Constants.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2015 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen; - -import java.util.regex.Pattern; - -/** - * String constants for the code generation - * - * @author ansgar - * - */ -public class Constants { - - public static final String includeHFile = "// include associated header file"; //$NON-NLS-1$ - - public static final String cppIncPreBodyStart = "// Include from CppInclude stereotype (pre-body)"; //$NON-NLS-1$ - - public static final String cppIncPreBodyEnd = "// End of CppInclude stereotype (pre-body)"; //$NON-NLS-1$ - - public static final String cppIncBodyStart = "// Include from CppInclude declaration (body)"; //$NON-NLS-1$ - - public static final String cppIncBodyEnd = "// End of CppInclude stereotype (body)";//$NON-NLS-1$ - - public static final String derivedIncludes = "// Derived includes directives";//$NON-NLS-1$ - - public static final String forwardDecl = "// forward declarations"; //$NON-NLS-1$ - - public static final String staticAttributes = "// static attributes (if any)"; //$NON-NLS-1$ - - public static final String undefinedType = "undefined"; //$NON-NLS-1$ - - // support the languages "C++", "C/C++" as well as "cpp". The '+' needs to be escaped in a regular epression - public static final Pattern supportedLanguages = Pattern.compile("C\\+\\+|C/C\\+\\+|cpp"); //$NON-NLS-1$ - - public static final String DOT = "."; //$NON-NLS-1$ -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/CppLangCodegen.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/CppLangCodegen.java deleted file mode 100644 index 3dc87c06e27..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/CppLangCodegen.java +++ /dev/null @@ -1,138 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2015 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - ansgar.radermacher@cea.fr initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.codegen.base.ModelElementsCreator; -import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen2; -import org.eclipse.papyrus.codegen.extensionpoints.MethodInfo; -import org.eclipse.papyrus.codegen.extensionpoints.SyncInformation; -import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenUtils; -import org.eclipse.papyrus.cpp.codegen.transformation.CppModelElementsCreator; -import org.eclipse.papyrus.cpp.codegen.utils.LocateCppProject; -import org.eclipse.papyrus.cpp.codegen.xtend.CppParameter; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.ParameterDirectionKind; -import org.eclipse.uml2.uml.Profile; - -/** - * C++ language support - * - */ -public class CppLangCodegen implements ILangCodegen2 { - - protected ModelElementsCreator creator = null; - - protected IProject lastProject = null; - - @Override - public String getDescription() { - return Messages.C_CppLangCodegen_GeneratorDesc; - } - - /** - * Check whether the code generator is able to produce code for the passed element: - * it must be a classifier and the C++ profile must be applied. - */ - @Override - public boolean isEligible(Element modelElement) { - if (modelElement instanceof Classifier) { - Package nearestPackage = modelElement.getNearestPackage(); - if (nearestPackage != null) { - // check whether the C++ profile is applied - for (Profile profile : nearestPackage.getAllAppliedProfiles()) { - if (C_CppPackage.eINSTANCE.getName().equals(profile.getName())) { - return true; - } - } - } - } - return false; - } - - @Override - public String getSuffix(FILE_KIND fileKind) { - if (fileKind == FILE_KIND.BODY) { - return CppCodeGenUtils.getBodySuffix(); - } else { - return CppCodeGenUtils.getHeaderSuffix(); - } - } - - @Override - public void generateCode(IProject project, PackageableElement element, IProgressMonitor monitor) { - manageCreator(project, element); - creator.createPackageableElement(element, monitor); - } - - @Override - public void cleanCode(IProject project, PackageableElement element, IProgressMonitor monitor) { - manageCreator(project, element); - creator.removePackageableElement(element, monitor); - } - - @Override - public String getFileName(IProject project, NamedElement element) { - manageCreator(project, element); - return creator.getFileName(element); - } - - @Override - public IProject getTargetProject(PackageableElement pe, boolean createIfMissing) { - return LocateCppProject.getTargetProject(pe, createIfMissing); - } - - protected void manageCreator(IProject project, Element element) { - if ((project == null) && (element instanceof PackageableElement)) { - project = getTargetProject((PackageableElement) element, false); - } - if ((creator == null) || (project != lastProject)) { - lastProject = project; - creator = new CppModelElementsCreator(project); - } - } - - @Override - public SyncInformation getSyncInformation(String methodName, String body) { - return null; - } - - @Override - public MethodInfo getMethodInfo(NamedElement operationOrBehavior) { - MethodInfo mi = new MethodInfo(operationOrBehavior.getName()); - EList parameters = null; - if (operationOrBehavior instanceof Operation) { - parameters = ((Operation) operationOrBehavior).getOwnedParameters(); - } else if (operationOrBehavior instanceof Behavior) { - parameters = ((Behavior) operationOrBehavior).getOwnedParameters(); - } - - if (parameters != null) { - for (Parameter parameter : parameters) { - if (parameter.getDirection() != ParameterDirectionKind.RETURN_LITERAL) { - mi.addParameterType(CppParameter.CppParameterForCDT(parameter).toString()); - } - } - } - return mi; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Messages.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Messages.java deleted file mode 100644 index ff7d9277d4c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Messages.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2015 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.papyrus.cpp.codegen.messages"; //$NON-NLS-1$ - public static String C_CppLangCodegen_GeneratorDesc; - public static String CppModelElementsCreator_CannotFormatContent; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/messages.properties b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/messages.properties deleted file mode 100644 index 611b7081e7e..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/messages.properties +++ /dev/null @@ -1,2 +0,0 @@ -C_CppLangCodegen_GeneratorDesc=General purpose C++ code generator for object-oriented models. Uses the CEA C/C++ profile -CppModelElementsCreator_CannotFormatContent=Cannot format content diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenConstants.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenConstants.java deleted file mode 100644 index 9993ad5e07d..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenConstants.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2012 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.preferences; - -public class CppCodeGenConstants { - - /** - * Suffix for generated header files - */ - public static final String P_HEADER_SUFFIX = "headSuffix"; //$NON-NLS-1$ - - /** - * Suffix for generated body/implementation files - */ - public static final String P_IMPLEM_SUFFIX = "implSuffix"; //$NON-NLS-1$ - - /** - * Suffix for generated body/implementation files - */ - public static final String P_OUT_INOUT_OP = "outInoutOp"; //$NON-NLS-1$ - - /** - * User defined comment header in generated files - */ - public static final String P_COMMENT_HEADER = "commentHeader"; //$NON-NLS-1$ - - /** - * Suffix for generated header files - */ - public static final String P_PROJECT_PREFIX = "projectPrefix"; //$NON-NLS-1$ - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenPreferenceInitializer.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenPreferenceInitializer.java deleted file mode 100644 index 7dd59fbe605..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenPreferenceInitializer.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2012 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.preferences; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.cpp.codegen.Activator; - - -public class CppCodeGenPreferenceInitializer extends AbstractPreferenceInitializer { - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() - */ - @Override - public void initializeDefaultPreferences() { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - store.setDefault(CppCodeGenConstants.P_HEADER_SUFFIX, "h"); //$NON-NLS-1$ - store.setDefault(CppCodeGenConstants.P_IMPLEM_SUFFIX, "cpp"); //$NON-NLS-1$ - store.setDefault(CppCodeGenConstants.P_OUT_INOUT_OP, "*"); //$NON-NLS-1$ - store.setDefault(CppCodeGenConstants.P_PROJECT_PREFIX, "org.eclipse.papyrus.cppgen."); //$NON-NLS-1$ - - // Default value for P_COMMENT_HEADER - String NL = System.getProperties().getProperty("line.separator"); //$NON-NLS-1$ - String defaultValue = - "// --------------------------------------------------------" + NL + //$NON-NLS-1$ - "// Code generated by Papyrus C++" + NL + //$NON-NLS-1$ - "// --------------------------------------------------------" + NL + NL; //$NON-NLS-1$ - store.setDefault(CppCodeGenConstants.P_COMMENT_HEADER, defaultValue); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenUtils.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenUtils.java deleted file mode 100644 index 69a18f191c0..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenUtils.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2012 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.preferences; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.cpp.codegen.Activator; - -/** - * Utility class that returns the preference values - * - * @author ansgar - * - */ -public class CppCodeGenUtils { - - protected static IPreferenceStore preferenceStore = null; - - public static String getHeaderSuffix() { - initPreferenceStore(); - return preferenceStore.getString(CppCodeGenConstants.P_HEADER_SUFFIX); - } - - public static String getBodySuffix() { - initPreferenceStore(); - return preferenceStore.getString(CppCodeGenConstants.P_IMPLEM_SUFFIX); - } - - public static String getOutInoutOp() { - initPreferenceStore(); - return preferenceStore.getString(CppCodeGenConstants.P_OUT_INOUT_OP); - } - - public static String getCommentHeader() { - initPreferenceStore(); - return preferenceStore.getString(CppCodeGenConstants.P_COMMENT_HEADER); - } - - public static void initPreferenceStore() { - if (preferenceStore == null) { - preferenceStore = Activator.getDefault().getPreferenceStore(); - } - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppLocationStrategy.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppLocationStrategy.java deleted file mode 100644 index ccddad6f9cc..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppLocationStrategy.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.eclipse.papyrus.cpp.codegen.transformation; - -import org.eclipse.papyrus.codegen.base.HierarchyLocationStrategy; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Package; - - -public class CppLocationStrategy extends HierarchyLocationStrategy { - - public static final String PKG_PREFIX = "Pkg_"; //$NON-NLS-1$ - - /** - * Return the filename for a given named element. - * - * @param element - * a named element - * @return filename for this element - */ - public String getFileName(NamedElement element) { - if (element instanceof Package) { - // specific prefix for packages - String folder = super.getFileName(element); - if (folder.length() > 0) { - folder += HierarchyLocationStrategy.SEP_CHAR; - } - return folder + PKG_PREFIX + element.getName(); - } - else return super.getFileName(element); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppModelElementsCreator.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppModelElementsCreator.java deleted file mode 100644 index ff974a517e5..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppModelElementsCreator.java +++ /dev/null @@ -1,243 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2012 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.transformation; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.ToolFactory; -import org.eclipse.cdt.core.formatter.CodeFormatter; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.IDocument; -import org.eclipse.papyrus.C_Cpp.ExternLibrary; -import org.eclipse.papyrus.C_Cpp.External; -import org.eclipse.papyrus.C_Cpp.Include; -import org.eclipse.papyrus.C_Cpp.ManualGeneration; -import org.eclipse.papyrus.C_Cpp.NoCodeGen; -import org.eclipse.papyrus.C_Cpp.Template; -import org.eclipse.papyrus.codegen.base.GenUtils; -import org.eclipse.papyrus.codegen.base.IPFileSystemAccess; -import org.eclipse.papyrus.codegen.base.ModelElementsCreator; -import org.eclipse.papyrus.codegen.base.ProjectBasedFileAccess; -import org.eclipse.papyrus.cpp.codegen.Activator; -import org.eclipse.papyrus.cpp.codegen.Constants; -import org.eclipse.papyrus.cpp.codegen.Messages; -import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenUtils; -import org.eclipse.papyrus.cpp.codegen.xtend.CppClassifierGenerator; -import org.eclipse.papyrus.cpp.codegen.xtend.CppPackageHeaderGenerator; -import org.eclipse.text.edits.MalformedTreeException; -import org.eclipse.text.edits.TextEdit; -import org.eclipse.uml2.uml.Association; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Enumeration; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.PrimitiveType; -import org.eclipse.uml2.uml.Relationship; -import org.eclipse.uml2.uml.Signal; -import org.eclipse.uml2.uml.SignalEvent; -import org.eclipse.uml2.uml.Usage; -import org.eclipse.uml2.uml.util.UMLUtil; - - - -/** - * Main class of C++ code generator - * - * @author Ansgar Radermacher (ansgar.radermacher@cea.fr) - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -public class CppModelElementsCreator extends ModelElementsCreator { - - /** - * Constructor. - * - * @param project - * the project in which the generated code should be placed - */ - public CppModelElementsCreator(IProject project) { - this(new ProjectBasedFileAccess(project), null); - } - - /** - * Constructor, allows for non-standard commentHeader - * - * @param project - * the project in which the generated code should be placed - * @param commentHeader - * Custom prefix for each generated file - */ - public CppModelElementsCreator(IProject project, String commentHeader) { - this(new ProjectBasedFileAccess(project), commentHeader); - } - - /** - * Constructor. Pass caller defined file system access and commentHeader - * - * @param project - * the project in which the generated code should be placed - * @param commentHeader - * commentHeader. If null, take from preferences - */ - public CppModelElementsCreator(IPFileSystemAccess fileSystemAccess, String commentHeader) { - super(fileSystemAccess, new CppLocationStrategy()); - this.commentHeader = (commentHeader != null) ? - commentHeader : - CppCodeGenUtils.getCommentHeader(); - hppExt = CppCodeGenUtils.getHeaderSuffix(); - cppExt = CppCodeGenUtils.getBodySuffix(); - } - - protected String hppExt; - - protected String cppExt; - - protected String commentHeader; - - /** - * Creates the files corresponding to the class. For a "simple" class - * generates 2 headers (one for the privates concrete operations and one for - * the attributes, public operations and virtual / abstract operations and - * one body file. - * - * @param folder - * @param classifier - * @throws CoreException - */ - @Override - protected void createPackageableElementFile(PackageableElement element, IProgressMonitor monitor) { - if (element instanceof Package) { - generatePkg((Package) element); - } - - else if ((element instanceof PrimitiveType) || (element instanceof Enumeration) || (element instanceof Usage)) { - // do nothing, included in package - } - else if (element instanceof Classifier) { - generateClassifier((Classifier) element); - } - else if (element instanceof Relationship) { - // no code generation for relationships - } - else if (element instanceof Signal) { - // TODO: not supported, but do nothing - } - else if (element instanceof SignalEvent) { - // TODO: not supported, but do nothing - } - else { - Activator.log.debug("C++ code generator: unsupported model element " + element); //$NON-NLS-1$ - } - } - - protected void generateClassifier(Classifier classifier) { - - // treat case of manual code generation - if (GenUtils.hasStereotype(classifier, ManualGeneration.class)) { - final ManualGeneration mg = UMLUtil.getStereotypeApplication(classifier, ManualGeneration.class); - final Include cppInclude = UMLUtil.getStereotypeApplication(classifier, Include.class); - final String fileContentH = commentHeader + cppInclude.getHeader(); - - // generate header code - final String fileNameH = locStrategy.getFileName(classifier) + Constants.DOT + hppExt; - - generateFile(fileNameH, fileContentH); - - // generate body code - String fileContentB = commentHeader + - cppInclude.getPreBody() + GenUtils.NL + - cppInclude.getBody() + GenUtils.NL; - String ext = GenUtils.maskNull(mg.getExtensionBody()); - if (ext.length() == 0) { - ext = cppExt; - } - String fileNameB = locStrategy.getFileName(classifier) + Constants.DOT + ext; - generateFile(fileNameB, fileContentB); - } - - // Only generate when no CppNoCodeGen stereotype is applied to the class - else if ((!noCodeGen(classifier)) && (!GenUtils.hasStereotype(classifier, Template.class)) && - (!(classifier instanceof Association))) { - - // Template Bound Class - if (GenUtils.isTemplateBoundElement(classifier)) { - final String bindHeaderFileName = locStrategy.getFileName(classifier) + Constants.DOT + hppExt; - generateFile(bindHeaderFileName, commentHeader + CppClassifierGenerator.generateBindHeaderCode(classifier)); - - final String bindBodyFileName = locStrategy.getFileName(classifier) + Constants.DOT + cppExt; - generateFile(bindBodyFileName, commentHeader + CppClassifierGenerator.generateBindBodyCode(classifier)); - } - else { - // Class Header file generation - final String classHeaderFileName = locStrategy.getFileName(classifier) + Constants.DOT + hppExt; - generateFile(classHeaderFileName, commentHeader + CppClassifierGenerator.generateClassHeaderCode(classifier)); - - // Class Body file generation - if (classifier instanceof Class) { - final String classBodyFileName = locStrategy.getFileName(classifier) + Constants.DOT + cppExt; - generateFile(classBodyFileName, commentHeader + CppClassifierGenerator.generateClassBodyCode(classifier)); - } - } - } - } - - protected void generatePkg(Package pkg) { - final String fileName = locStrategy.getFileName(pkg) + Constants.DOT + hppExt; - generateFile(fileName, CppPackageHeaderGenerator.generateCode(pkg).toString()); - } - - protected void generateFile(String fileName, String content) { - fileSystemAccess.generateFile(fileName, format(content)); - } - - /** - * Apply the user's currently selected formatting options to the input content. Return the - * input String in case of error. - */ - private static String format(String content) { - - // do nothing if the CDT plugin is not loaded - if (Platform.getBundle(CCorePlugin.PLUGIN_ID) == null) - return content; - - CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(null); - IDocument doc = new Document(content); - - TextEdit edit = codeFormatter.format(CodeFormatter.K_TRANSLATION_UNIT, doc.get(), 0, doc.get().length(), 0, null); - - if (edit == null) { - Activator.log.debug(Messages.CppModelElementsCreator_CannotFormatContent); - return content; - } - - try { - edit.apply(doc); - return doc.get(); - } catch (MalformedTreeException e) { - Activator.log.error(e); - } catch (BadLocationException e) { - Activator.log.error(e); - } - return content; - } - - protected boolean noCodeGen(Element element) { - return GenUtils.hasStereotype(element, NoCodeGen.class) || - GenUtils.hasStereotype(element, External.class) || - GenUtils.hasStereotypeTree(element, ExternLibrary.class); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ClassUtils.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ClassUtils.java deleted file mode 100644 index 7653753411f..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ClassUtils.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2012 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.utils; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.papyrus.codegen.base.GenUtils; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Operation; - -/** - * A set of utility functions related to classes. - * - * @author ansgar (ansgar.radermacher@cea.fr) - * - */ -public class ClassUtils { - - /** - * Calculate the list of classifiers that needs to be included - * - * @param currentClass - * @return - */ - public static EList includedClassifiers(Classifier currentClass) { - // Retrieve package used by current package (dependencies) - // use a unique list to avoid duplicates - EList usedClasses = new UniqueEList(); - - // class attributes dependencies - usedClasses.addAll(GenUtils.getOwnedAttributeTypes(currentClass)); - // operation parameters dependencies - usedClasses.addAll(GenUtils.getTypesViaOperations(currentClass)); - // inner classifier dependencies - usedClasses.addAll(GenUtils.getInnerClassifierTypes(currentClass)); - // realized interface dependencies - if (currentClass instanceof Class) { - Class clazz = (Class) currentClass; - EList implementedInterfaces = clazz.getImplementedInterfaces(); - usedClasses.addAll(implementedInterfaces); - } - // dependencies and associations - usedClasses.addAll(GenUtils.getTypesViaRelationshipsNoDeps(currentClass)); - - // template parameters are declared locally (if owned) and do not correspond to a file - // that can be included - usedClasses.removeAll(GenUtils.getTemplateParameteredElements(currentClass)); - return usedClasses; - } - - /** - * Retrieve the list of operations of classes nested in the current class - * without the operations directly owned by the current class - * - * @param currentClass - * @return - */ - public static EList nestedOperations(Classifier currentClass) { - EList nestedOperations = new UniqueEList(); - - for (Element element : currentClass.allOwnedElements()) { - if (element instanceof Operation && !(element.getOwner().equals(currentClass))) { - nestedOperations.add((Operation) element); - } - } - - return nestedOperations; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.emtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.emtl deleted file mode 100644 index 967aca987ef..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.emtl +++ /dev/null @@ -1,993 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java deleted file mode 100644 index 36043a363ad..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java +++ /dev/null @@ -1,351 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2013 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.utils; - -import java.util.Iterator; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.papyrus.C_Cpp.ExternLibrary; -import org.eclipse.papyrus.C_Cpp.External; -import org.eclipse.papyrus.C_Cpp.NoCodeGen; -import org.eclipse.papyrus.C_Cpp.Typedef; -import org.eclipse.papyrus.C_Cpp.Visibility; -import org.eclipse.papyrus.codegen.base.GenUtils; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.ClassifierTemplateParameter; -import org.eclipse.uml2.uml.ConnectableElementTemplateParameter; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.LiteralBoolean; -import org.eclipse.uml2.uml.LiteralInteger; -import org.eclipse.uml2.uml.LiteralString; -import org.eclipse.uml2.uml.LiteralUnlimitedNatural; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Namespace; -import org.eclipse.uml2.uml.OperationTemplateParameter; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.ParameterableElement; -import org.eclipse.uml2.uml.PrimitiveType; -import org.eclipse.uml2.uml.TemplateParameter; -import org.eclipse.uml2.uml.VisibilityKind; -import org.eclipse.uml2.uml.util.UMLUtil; - - - -/** - * Some utilities specific to C++ code generation: a set of static methods that is intended - * for use from Acceleo templates. - * - * @author wassim, ansgar - * - */ -public class CppGenUtils { - - public static final String ANSI_C_LIB = "AnsiCLibrary"; //$NON-NLS-1$ - - /** - * Return a list of template parameters without type - * - * @param classifier - * @return - */ - public static String getTemplateParametersWoType(Classifier classifier) { - String tparamWoType = ""; //$NON-NLS-1$ - - Iterator it = GenUtils.getTemplateParameters(classifier).iterator(); - - while (it.hasNext()) { - TemplateParameter currentTParam = it.next(); - tparamWoType = tparamWoType + GenUtils.getTemplateName(currentTParam); - - if (it.hasNext()) { - tparamWoType = tparamWoType + ", "; //$NON-NLS-1$ - } - } - return tparamWoType; - } - - /** - * The standard UML and MARTE libraries do not apply the stereotype "Typedef". Yet, we want to treat these - * types in an identical way, i.e. we use a typedef to the associated primitive C++ type - * - * @param type - * @return - */ - public static String getStdtypes(PrimitiveType type) { - Object owner = type.getOwner(); - String owningPkgName = ""; //$NON-NLS-1$ - if (owner instanceof Package) { - owningPkgName = ((Package) owner).getName(); - } - if (owningPkgName.equals("PrimitiveTypes") || // used in UML >= 2.4 //$NON-NLS-1$ - owningPkgName.equals("UMLPrimitiveTypes") || // used in UML < 2.4 //$NON-NLS-1$ - owningPkgName.equals("MARTE_PrimitivesTypes")) { //$NON-NLS-1$ - String td = null; - String name = type.getName(); - - if (name.equals("Boolean")) { //$NON-NLS-1$ - td = "bool"; //$NON-NLS-1$ - } - else if (name.equals("Integer")) { //$NON-NLS-1$ - td = "int"; //$NON-NLS-1$ - } - else if (name.equals("Unlimited Natural")) { //$NON-NLS-1$ - td = "unsigned long"; //$NON-NLS-1$ - } - else if (name.equals("Real")) { //$NON-NLS-1$ - td = "float"; //$NON-NLS-1$ - } - else if (name.equals("String")) { //$NON-NLS-1$ - td = "const char *"; //$NON-NLS-1$ - } - else if (name.equals("Unlimited Natural")) { //$NON-NLS-1$ - td = "unsigned long"; //$NON-NLS-1$ - } - if (td != null) { - return "typedef " + td + " " + name + ";"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } - // else unknown within UMLPrimitiveTypes, treat in standard way - } - - return ""; //$NON-NLS-1$ - } - - /** - * Return a kind of qualifiedName, except if - * - The named element has the stereotype External or NoCodeGen - * - The named element is part of the ANSI C library - * - The named element is a primitive type that has no further definition via a stereotype (TODO: why is this required/useful?) - * - * @param ne - * @return - */ - public static String cppQualifiedName(NamedElement ne) { - if (ne == null) { - return "undefined"; //$NON-NLS-1$ - } - Object owner = ne.getOwner(); - String owningPkgName = ""; //$NON-NLS-1$ - if (owner instanceof Package) { - owningPkgName = ((Package) owner).getName(); - } - if (GenUtils.hasStereotype(ne, External.class) || - GenUtils.hasStereotypeTree(ne, NoCodeGen.class) || - GenUtils.hasStereotypeTree(ne, ExternLibrary.class)) { - return ne.getName(); - } - else if (owningPkgName.equals(ANSI_C_LIB)) { - // always use the short name for types within the ANSI C library - return ne.getName(); - } - else if (owner instanceof ClassifierTemplateParameter) { - // return short name for template in Type - return ne.getName(); - } - - String qName = ne.getName(); - if (currentNS == ne.getNamespace()) { - // return simple name, if in current namespace - return qName; - } - if (ne instanceof PrimitiveType) { - if (!GenUtils.hasStereotype(ne, Typedef.class) && (getStdtypes((PrimitiveType) ne).length() == 0)) { - // is a primitive type without further definition and not a standard primitive type - // => assume that it is a external type without namespace - return qName; - } - } - - for (Namespace ns : ne.allNamespaces()) { - // don't add qualified name for specific top-level namespace "root". - // TODO: specific workaround for the way Qompass creates its target model. Needs to be removed. - if (!((ns.getOwner() == null) && ns.getName().equals("root"))) { //$NON-NLS-1$ - qName = ns.getName() + "::" + qName; //$NON-NLS-1$ - } - } - if (qName.contains("::")) { //$NON-NLS-1$ - // is a qualified name => make path absolute - return "::" + qName; //$NON-NLS-1$ - } else { - return qName; - } - } - - - /** - * Returns the string that is used within a C++ template declaration, e.g. the "Class XY" in template. - * - * @return the template type formated as string - */ - public static String getTemplateTypeName(TemplateParameter templateParam) { - String prefix = ""; //$NON-NLS-1$ - String name = ""; //$NON-NLS-1$ - - // Retrieve name of the ParameteredElement (when possible = it is a NamedElement - ParameterableElement pElt = templateParam.getParameteredElement(); - if ((pElt != null) && (pElt instanceof NamedElement)) { - name = ((NamedElement) pElt).getName(); - if (templateParam instanceof ClassifierTemplateParameter) { - // prefix name with "class" to indicate that the following type is a classifier - prefix = "class "; //$NON-NLS-1$ - } else if (templateParam instanceof OperationTemplateParameter) { - // no prefix - } else if (templateParam instanceof ConnectableElementTemplateParameter) { - // no prefix - } else {// uml2TemplateParameter instanceof TemplateParameter - // TODO: literal integer is a value specification, but we use the fact that is also a named element - // e.g. would produce an parameter and ignore the value behind (which is ok for the - // declaration of the template, but not for its use. - if (pElt instanceof LiteralInteger) { - prefix = "int "; //$NON-NLS-1$ - } else if (pElt instanceof LiteralString) { - prefix = "String "; //$NON-NLS-1$ - } else if (pElt instanceof LiteralBoolean) { - prefix = "Boolean "; //$NON-NLS-1$ - } else if (pElt instanceof LiteralUnlimitedNatural) { - prefix = "UnlimitedNatural "; //$NON-NLS-1$ - } else { - prefix = pElt.eClass().getName() + " "; //$NON-NLS-1$ - } - } - } else { - name = "undefined"; //$NON-NLS-1$ - } - - return (prefix + name); - } - - - /** - * Return a C++ namespace definition for a named element - * - * @param ne - * a named element - * @return a C++ namespace definition for a named element - */ - public static String getNamespace(NamedElement ne) { - String namespace = ""; //$NON-NLS-1$ - for (Namespace ns : ne.allNamespaces()) { - if (ns.getOwner() != null) { - String nsName = ns.getName(); - if (!namespace.equals("")) { //$NON-NLS-1$ - nsName += "::"; //$NON-NLS-1$ - } - namespace = nsName + namespace; - } - } - if (!namespace.equals("")) { //$NON-NLS-1$ - namespace = "\n" + "using namespace " + namespace + ";\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } - return namespace; - } - - /** - * Return a C++ open-namespace definition for a named element - * - * @param ne - * a named element - * @return a C++ open-namespace definition for a named element - */ - public static String openNS(NamedElement ne) { - String openNS = ""; //$NON-NLS-1$ - currentNS = ne.getNamespace(); - if (ne instanceof Package) { - openNS = "namespace " + ne.getName() + " {\n"; //$NON-NLS-1$ //$NON-NLS-2$ - } - for (Namespace ns : ne.allNamespaces()) { - if (ns.getOwner() != null) { // skip top-level package (useful?) - openNS = "namespace " + ns.getName() + " {\n" + openNS; //$NON-NLS-1$ //$NON-NLS-2$ - } - } - return openNS; - } - - - /** - * Return a C++ close-namespace definition for a named element - * - * @param ne - * a named element - * @return a C++ close-namespace definition for a named element - */ - public static String closeNS(NamedElement ne) { - String closeNS = ""; //$NON-NLS-1$ - if (ne instanceof Package) { - closeNS = "} // of namespace " + ne.getName() + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ - } - for (Namespace ns : ne.allNamespaces()) { - if (ns.getOwner() != null) { - closeNS += "} // of namespace " + ns.getName() + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ - } - } - return closeNS; - } - - - /** - * Return the C++ visibility (on generalizations) in text form. Return public, if no stereotype - * visibility exists - * - * @param element - * @return - */ - public static String getGeneralizationVisibility(Element element) { - // get visibility and target name - Visibility cppVisibility = UMLUtil.getStereotypeApplication(element, Visibility.class); - if (cppVisibility != null) { - return cppVisibility.getValue(); - } else { - return "public"; //$NON-NLS-1$ - } - } - - private static Namespace currentNS; - - private static VisibilityKind currVisibility = null; - private static final Pattern EmptySectionRegex = Pattern.compile("^\\s*$"); //$NON-NLS-1$ - - /** - * Update the current visibility to the specified value without writing this value to - * the output. This is to be used when setting the default visibility of a class/struct. - */ - public static void resetVisibility(VisibilityKind v) { - currVisibility = v; - } - - /** - * Create a section of code with the appropriate visibility. Merges the content with - * the previously declared visibility (if appropriate). Ignore empty content. - */ - public static String getSection(VisibilityKind visibility, String content) { - // Bug 425208: Don't update the visibility until we know for sure that it - // will be written to the output. - VisibilityKind newVisibility = null; - if (!visibility.equals(currVisibility)) { - newVisibility = visibility; - } - - // Filter out empty sections. - Matcher m = EmptySectionRegex.matcher(content); - if (content.isEmpty() || m.matches()) { - return ""; //$NON-NLS-1$ - } - - // Don't write duplicate visibility modifiers. - if (newVisibility == null) { - return content; - } - - currVisibility = newVisibility; - return currVisibility.toString() + ":\n" + content; //$NON-NLS-1$ - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.mtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.mtl deleted file mode 100644 index 973b888613e..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.mtl +++ /dev/null @@ -1,42 +0,0 @@ -[comment encoding = UTF-8 /] -[module CppGenUtils('http://www.eclipse.org/uml2/5.0.0/UML')/] - -[query public getTemplateParametersWoType(arg0 : Classifier) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils', 'getTemplateParametersWoType(org.eclipse.uml2.uml.Classifier)', Sequence{arg0}) -/] - -[query public getStdtypes(arg0 : PrimitiveType) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils', 'getStdtypes(org.eclipse.uml2.uml.PrimitiveType)', Sequence{arg0}) -/] - -[query public cppQualifiedName(arg0 : NamedElement) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils', 'cppQualifiedName(org.eclipse.uml2.uml.NamedElement)', Sequence{arg0}) -/] - -[query public getTemplateTypeName(arg0 : TemplateParameter) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils', 'getTemplateTypeName(org.eclipse.uml2.uml.TemplateParameter)', Sequence{arg0}) -/] - -[query public getNamespace(arg0 : NamedElement) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils', 'getNamespace(org.eclipse.uml2.uml.NamedElement)', Sequence{arg0}) -/] - -[query public openNS(arg0 : NamedElement) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils', 'openNS(org.eclipse.uml2.uml.NamedElement)', Sequence{arg0}) -/] - -[query public closeNS(arg0 : NamedElement) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils', 'closeNS(org.eclipse.uml2.uml.NamedElement)', Sequence{arg0}) -/] - -[query public getGeneralizationVisibility(arg0 : Element) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils', 'getGeneralizationVisibility(org.eclipse.uml2.uml.Element)', Sequence{arg0}) -/] - -[query public resetVisibility(arg0 : VisibilityKind) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils', 'resetVisibility(org.eclipse.uml2.uml.VisibilityKind)', Sequence{arg0}) -/] - -[query public getSection(arg0 : VisibilityKind, arg1 : String) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils', 'getSection(org.eclipse.uml2.uml.VisibilityKind, java.lang.String)', Sequence{arg0, arg1}) -/] diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ILocateCppProject.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ILocateCppProject.java deleted file mode 100644 index 2cdb5d6d945..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ILocateCppProject.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2013 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.utils; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.uml2.uml.PackageableElement; - -public interface ILocateCppProject { - - /** - * Locate and return the target project for the given packageable element. Return null if - * no target project can be found. - * - * Ensures that the target project is correctly setup to contain generated C/C++ code. Does - * not create a new project, but may modify existing ones. - * - * @param pe - * a packageable element within a model - * @param createIfMissing - * if true, ask the user to apply the C++ nature if required. - * @return the associated project, if the C++ nature is applied. - */ - public IProject getTargetProject(PackageableElement pe, boolean createIfMissing); - - public IFile getTargetFile(); -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/LocateCppProject.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/LocateCppProject.java deleted file mode 100644 index 85f041de711..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/LocateCppProject.java +++ /dev/null @@ -1,140 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2013 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.utils; - -import org.eclipse.cdt.core.CCProjectNature; -import org.eclipse.cdt.core.CProjectNature; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; -import org.eclipse.papyrus.codegen.extensionpoints.LanguageProjectSupport; -import org.eclipse.papyrus.cpp.codegen.Activator; -import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenConstants; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; - -public class LocateCppProject { - public static final String LANGUAGE_NAME = "C++"; //$NON-NLS-1$ - - private static final boolean Headless = Boolean.getBoolean("papyrus.run-headless"); //$NON-NLS-1$ - - /** - * Locate and return the target project for the given packageable element. Return null if - * no target project can be found. - * - * Ensures that the target project is correctly setup to contain generated C/C++ code. Does - * not create a new project, but may modify existing ones. - * - * @param pe - * a packageable element within a model - * @param createIfMissing - * if true, ask the user to apply the C++ nature if required. - * @return the associated project, if the C++ nature is applied. - */ - public static IProject getTargetProject(PackageableElement pe, boolean createIfMissing) { - // URI uri = pe.eResource().getURI(); - Package rootPkg = PackageUtil.getRootPackage(pe); - - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - /* - * if(uri.segmentCount() < 2) { - * return null; - * } - */ - - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - String prefix = store != null ? store.getString(CppCodeGenConstants.P_PROJECT_PREFIX) : "bad preferences."; //$NON-NLS-1$ - String projectName = prefix + rootPkg.getName(); - IProject modelProject = root.getProject(projectName); - if (!modelProject.exists()) { - if (Headless) - { - try - { - modelProject.create(null); - } catch (CoreException e) - { - return null; - } - } - else - { - boolean create = createIfMissing && openQuestion( - Messages.LocateCppProject_CreateTargetProjectTitle, - String.format(Messages.LocateCppProject_CreateTargetProjectDesc, projectName)); - if (create) { - ILangProjectSupport langSupport = LanguageProjectSupport.getProjectSupport(LANGUAGE_NAME); - if (langSupport != null) { - modelProject = langSupport.createProject(projectName); - langSupport.setSettings(modelProject, langSupport.initialConfigurationData()); - if (modelProject == null) { - return null; - } - } - else { - return null; - } - } - else { - return null; - } - } - } - - // Make sure the target project is open. If it was just created then it is likely open, - // however if it is an old project then it could have been closed. - if (!modelProject.isOpen()) { - try - { - modelProject.open(null); - } catch (CoreException e) - { - return null; - } - } - - // Make sure the target project has the C and C++ build natures. - try { - if (!modelProject.hasNature(CCProjectNature.CC_NATURE_ID)) { - boolean apply = createIfMissing && (Headless || openQuestion( - Messages.LocateCppProject_ApplyCNatureTitle, - Messages.LocateCppProject_ApplyCNatureDesc)); - if (!apply) { - return null; - } - CProjectNature.addCNature(modelProject, null); - CCProjectNature.addCCNature(modelProject, null); - } - } catch (CoreException e) { - Activator.log.error(e); - } - return modelProject; - } - - private static boolean openQuestion(final String title, final String message) - { - final boolean[] ret = new boolean[] { false }; - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - ret[0] = MessageDialog.openQuestion(Display.getCurrent().getActiveShell(), title, message); - } - }); - return ret[0]; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Messages.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Messages.java deleted file mode 100644 index aa1c639f0c9..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Messages.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.eclipse.papyrus.cpp.codegen.utils; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.papyrus.cpp.codegen.utils.messages"; //$NON-NLS-1$ - public static String LocateCppProject_ApplyCNatureTitle; - public static String LocateCppProject_ApplyCNatureDesc; - public static String LocateCppProject_CreateTargetProjectTitle; - public static String LocateCppProject_CreateTargetProjectDesc; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.emtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.emtl deleted file mode 100644 index 144d24288d2..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.emtl +++ /dev/null @@ -1,421 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.java deleted file mode 100644 index a55f4f6c0a0..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.java +++ /dev/null @@ -1,189 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2012 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.utils; - -import org.eclipse.papyrus.C_Cpp.Array; -import org.eclipse.papyrus.C_Cpp.Const; -import org.eclipse.papyrus.C_Cpp.Mutable; -import org.eclipse.papyrus.C_Cpp.Ptr; -import org.eclipse.papyrus.C_Cpp.Ref; -import org.eclipse.papyrus.C_Cpp.StorageClass; -import org.eclipse.papyrus.C_Cpp.Volatile; -import org.eclipse.papyrus.codegen.base.GenUtils; -import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenUtils; -import org.eclipse.uml2.uml.AggregationKind; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.MultiplicityElement; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.ParameterDirectionKind; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Utility functions managing the "modifier" of an element, i.e. additional - * information whether a passed parameter or an attribute is a pointer, a - * reference, an array or constant. - * - * @author ansgar - * - */ -public class Modifier { - - public static String modPtr(Element propertyOrParameter) { - // Pointer - String ptr = ""; //$NON-NLS-1$ - Ptr cppPtr = UMLUtil.getStereotypeApplication(propertyOrParameter, Ptr.class); - if (cppPtr != null) { - ptr = (cppPtr.getDeclaration() != null) ? cppPtr.getDeclaration() : "*"; //$NON-NLS-1$ - } else { - ptr = ""; //$NON-NLS-1$ - } - if (propertyOrParameter instanceof Property) { - if (((Property) propertyOrParameter).getAggregation() == AggregationKind.SHARED_LITERAL) { - ptr += "*"; //$NON-NLS-1$ - } - } - boolean ptrOrRef = GenUtils.hasStereotype(propertyOrParameter, Ref.class) - || GenUtils.hasStereotype(propertyOrParameter, Ptr.class); - - // out and inout parameter are realized by means of a pointer - if (propertyOrParameter instanceof Parameter) { - ParameterDirectionKind directionKind = ((Parameter) propertyOrParameter).getDirection(); - if (directionKind == ParameterDirectionKind.OUT_LITERAL || directionKind == ParameterDirectionKind.INOUT_LITERAL) { - // parameter is an out or inout parameter. If the user already either a pointer or reference, use this. - if (!ptrOrRef) { - // .. otherwise add the oeprator from the preferences - ptr += CppCodeGenUtils.getOutInoutOp(); - } - } - } - return ptr; - } - - public static String modRef(Element propertyOrParameter) { - // Ref - return GenUtils.hasStereotype(propertyOrParameter, Ref.class) ? "&" : ""; //$NON-NLS-1$ //$NON-NLS-2$ - } - - public static String modArray(Element propertyOrParameter) { - // Array - Array cppArray = UMLUtil.getStereotypeApplication(propertyOrParameter, Array.class); - String array = ""; //$NON-NLS-1$ - if (cppArray != null) { - // explicit array definition - array = (cppArray.getDefinition() != null) ? cppArray.getDefinition() : "[]"; //$NON-NLS-1$ - } else { - // calculate array from multiplicity definition - int multiplicity = 1; - if (propertyOrParameter instanceof MultiplicityElement) { - multiplicity = ((MultiplicityElement) propertyOrParameter).getUpper(); - } - array = ""; //$NON-NLS-1$ - if (multiplicity == -1) { - array = "[]"; //$NON-NLS-1$ - } else if (multiplicity > 1) { - array = "[" + multiplicity + "]"; //$NON-NLS-1$ //$NON-NLS-2$ - } - } - return array; - } - - /** - * return modifier for const and volatile - * @param propertyOrParameter - * @return - */ - public static String modCVQualifier(Element propertyOrParameter) { - String cvQualifier = ""; //$NON-NLS-1$ - // CVQualifiers cannot be used with static functions - if (propertyOrParameter instanceof Operation && ((Operation) propertyOrParameter).isStatic()) { - // do nothing - } - // Const - else if (GenUtils.hasStereotype(propertyOrParameter, Const.class)) { - // Volatile with const - if (GenUtils.hasStereotype(propertyOrParameter, Volatile.class)) { - cvQualifier = (propertyOrParameter instanceof Operation) ? " const volatile" //$NON-NLS-1$ - : // added at the end of operation, prefix with " " - "const volatile "; // before operation or //$NON-NLS-1$ - // parameter, postfix with " " - } - // Const without Volatile - else { - cvQualifier = (propertyOrParameter instanceof Operation) ? " const" //$NON-NLS-1$ - : // added at the end of operation, prefix with " " - "const "; // before operation or //$NON-NLS-1$ - // parameter, postfix with " " - } - } - // Volatile without const - else if (GenUtils.hasStereotype(propertyOrParameter, Volatile.class)) { - cvQualifier = (propertyOrParameter instanceof Operation) ? " volatile" //$NON-NLS-1$ - : // added at the end of operation, prefix with " " - "volatile "; // before operation or parameter, //$NON-NLS-1$ - // postfix with " " - } - - // Mutable (non-static attribute only) - if (GenUtils.hasStereotype(propertyOrParameter, Mutable.class)) { - if (propertyOrParameter instanceof Property && !((Property) propertyOrParameter).isStatic()) { - cvQualifier = "mutable " + cvQualifier; - } - } - - return cvQualifier; - } - - /** - * return modifier for storage class - * @param propertyOrParameter - * @return - */ - public static String modSCQualifier(Element propertyOrParameter) { - StorageClass sc = UMLUtil.getStereotypeApplication(propertyOrParameter, StorageClass.class); - if (sc != null) { - return sc.getStorageClass().getLiteral() + " "; //$NON-NLS-1$ - } - return ""; //$NON-NLS-1$ - } - - /** - * Return inform about the direction of a parameter in form of a comment - * - * @param propertyOperationOrParameter - * @return - */ - public static String dirInfo(Element propertyOperationOrParameter) { - if (propertyOperationOrParameter instanceof Parameter) { - ParameterDirectionKind directionKind = ((Parameter) propertyOperationOrParameter).getDirection(); - if (directionKind == ParameterDirectionKind.IN_LITERAL) { - return " /*in*/"; //$NON-NLS-1$ - } else if (directionKind == ParameterDirectionKind.OUT_LITERAL) { - return " /*out*/"; //$NON-NLS-1$ - } else if (directionKind == ParameterDirectionKind.INOUT_LITERAL) { - return " /*inout*/"; //$NON-NLS-1$ - } - } - return ""; //$NON-NLS-1$ - } - - /** - * initialize the ptr/ref/array/isConst attributes. - * - * @param propertyOperationOrParameter - */ - public static void update(Element propertyOperationOrParameter) { - - - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.mtl b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.mtl deleted file mode 100644 index 08166221277..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.mtl +++ /dev/null @@ -1,15 +0,0 @@ -[comment encoding = UTF-8 /] -[module Modifier('http://www.eclipse.org/uml2/5.0.0/UML')/] - -[query public modPtr(propertyOrParameter : Element) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.Modifier', 'modPtr(org.eclipse.uml2.uml.Element)', Sequence{propertyOrParameter}) /] - -[query public modRef(propertyOrParameter : Element) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.Modifier', 'modRef(org.eclipse.uml2.uml.Element)', Sequence{propertyOrParameter}) /] - -[query public modArray(propertyOrParameter : Element) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.Modifier', 'modArray(org.eclipse.uml2.uml.Element)', Sequence{propertyOrParameter}) /] - -[query public modCVQualifier(propertyOrParameter : Element) : String - = invoke('org.eclipse.papyrus.cpp.codegen.utils.Modifier', 'modCVQualifier(org.eclipse.uml2.uml.Element)', Sequence{propertyOrParameter}) /] - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/messages.properties b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/messages.properties deleted file mode 100644 index 617270b5e1e..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/messages.properties +++ /dev/null @@ -1,4 +0,0 @@ -LocateCppProject_ApplyCNatureTitle=Need to apply C++ nature -LocateCppProject_ApplyCNatureDesc=Code generation requires that the underlying project has a C++ nature. Do you want to apply this nature? -LocateCppProject_CreateTargetProjectDesc=Code generation needs to create a CDT project called "%s". Do you want to do this? -LocateCppProject_CreateTargetProjectTitle=Target project does not exist diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppAttribute.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppAttribute.xtend deleted file mode 100644 index 9324fe993b2..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppAttribute.xtend +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.uml2.uml.Classifier -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.DataType -import org.eclipse.uml2.uml.Interface -import org.eclipse.uml2.uml.Signal -import org.eclipse.uml2.uml.Property -import org.eclipse.papyrus.codegen.base.GenUtils -import org.eclipse.papyrus.C_Cpp.Const -import org.eclipse.papyrus.cpp.codegen.utils.Modifier -import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils -import org.eclipse.papyrus.C_Cpp.Mutable - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppAttribute { - - // Loop over attributes. Check that the attribute is not a static const. - // Constant static attributes are declared within the class declaration - static def CppStaticAttributes(Classifier classifier) { - var code = ''' - // static attributes (if any) - «FOR ownedAttribute : getOwnedAttributes(classifier)» - «IF (ownedAttribute.isStatic)» - «CppStaticAttributeImplementation(ownedAttribute)» - «ENDIF» - «ENDFOR» - ''' - return code - } - - // return a list of owned attributes, empty set, if null - static def getOwnedAttributes(Classifier cl) { - val attributes = getOwnedAttributesWNull(cl) - if (attributes == null) { - emptySet - } - else { - attributes - } - } - - // return a list of owned attributes, since this is not supported directly on a classifier - static def getOwnedAttributesWNull(Classifier cl) { - if (cl instanceof Class) { - (cl as Class).ownedAttributes - } else if (cl instanceof DataType) { - (cl as DataType).ownedAttributes - } else if (cl instanceof Interface) { - (cl as Interface).ownedAttributes - } else if (cl instanceof Signal) { - (cl as Signal).ownedAttributes - } else { - //Sequence{} - } - } - - static def CppStaticAttributeImplementation(Property attribute) ''' - «CppDocumentation.CppElementDoc(attribute)» - «Modifier.modCVQualifier(attribute)» «CppGenUtils.cppQualifiedName(attribute.type)»«Modifier.modPtr(attribute)»«Modifier.modRef(attribute)» «attribute.class_.name»::«attribute.name»«Modifier.modArray(attribute)»«defaultValue(attribute)»; - ''' - - static def defaultValue(Property attribute) { - if ((attribute.defaultValue != null) && attribute.isStatic) { - "=" + attribute.defaultValue.stringValue() - } - } - - static def CppAttributeDeclaration(Property attribute) ''' - «CppDocumentation.CppElementDoc(attribute)» - «staticValue(attribute)» «Modifier.modCVQualifier(attribute)»«CppGenUtils.cppQualifiedName(attribute.type)»«Modifier. - modPtr(attribute)»«Modifier.modRef(attribute)» «attribute.name»«Modifier.modArray(attribute)»; - ''' - - static def staticValue(Property attribute) { - if (attribute.isStatic) 'static' - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassAttributesDeclaration.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassAttributesDeclaration.xtend deleted file mode 100644 index 06990f4229b..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassAttributesDeclaration.xtend +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.uml2.uml.Classifier -import org.eclipse.uml2.uml.VisibilityKind - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppClassAttributesDeclaration { - static def CppClassAttributesDeclaration(Classifier clazz, VisibilityKind visibilityFilter) ''' - «FOR oa : CppAttribute.getOwnedAttributes(clazz).filter[it.visibility == visibilityFilter]» - «CppAttribute.CppAttributeDeclaration(oa)» - «ENDFOR» - ''' -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassFriendDeclaration.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassFriendDeclaration.xtend deleted file mode 100644 index eafcc2b3cc7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassFriendDeclaration.xtend +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.uml2.uml.Classifier -import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils -import org.eclipse.papyrus.C_Cpp.Friend -import org.eclipse.papyrus.C_Cpp.NoCodeGen -import org.eclipse.papyrus.codegen.base.GenUtils - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppClassFriendDeclaration { - static def CppClassFriendDeclaration(Classifier friend) ''' - friend class «CppGenUtils.cppQualifiedName(friend)» - ''' - - static def CppClassIncludeFriendDeclaration(Classifier clazz) { - for (uc : GenUtils.getUsedClassifiers(clazz)) { - if (GenUtils.hasStereotype(uc, Friend) && (!GenUtils.hasStereotype(uc, NoCodeGen))) { - CppClassFriendDeclaration(uc) - } - } - } -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeClassDeclaration.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeClassDeclaration.xtend deleted file mode 100644 index ab952f290cb..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeClassDeclaration.xtend +++ /dev/null @@ -1,69 +0,0 @@ -package org.eclipse.papyrus.cpp.codegen.xtend - -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - import org.eclipse.papyrus.C_Cpp.CppRoot -import org.eclipse.uml2.uml.Package -import org.eclipse.uml2.uml.Classifier -import org.eclipse.emf.common.util.EList -import org.eclipse.papyrus.C_Cpp.NoCodeGen -import org.eclipse.papyrus.C_Cpp.External -import org.eclipse.uml2.uml.Enumeration -import org.eclipse.uml2.uml.PrimitiveType -import java.util.List -import java.util.ArrayList -import org.eclipse.papyrus.cpp.codegen.utils.ClassUtils -import org.eclipse.papyrus.codegen.base.GenUtils - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppClassIncludeClassDeclaration { - - static def cppOwnerPackageIncludePath(Package pkg) { - if ((pkg != null) && (!GenUtils.hasStereotype(pkg, CppRoot))) { - return GenUtils.getFullPath(pkg) + '/Pkg_' + pkg.name + '.h' - } else { - return null - } - } - - static def CppClassAllIncludesDeclarationBody(Classifier classifier) { - cppClassAllIncludes(classifier, GenUtils.getTypesViaDependencies(classifier)) - } - - static def cppClassAllIncludes(Classifier classifier, EList list) { - var List newList = new ArrayList() - for (cl : list) { - //var String str = null - if ((cl != classifier) && (!GenUtils.hasStereotype(cl, NoCodeGen)) || (GenUtils.hasStereotype(cl, External))) { - if ((cl instanceof Enumeration) || (cl instanceof PrimitiveType)) { - if ((cl.owner != null) && (cl.owner instanceof Package)) { - var includePath = (cl.owner as Package).cppOwnerPackageIncludePath - if (!newList.contains(includePath)) newList.add(includePath) - } else { - //str = null - } - } else { - newList.addAll(CppClassIncludeDeclaration.cppClassIncludes(cl)) - } - } else { - //str = null - } - } - return newList.filter[str | str != null] - } - - static def CppClassAllIncludes(Classifier clazz) { - cppClassAllIncludes(clazz, ClassUtils.includedClassifiers(clazz)) - } -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeDeclaration.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeDeclaration.xtend deleted file mode 100644 index a07a939e125..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeDeclaration.xtend +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import java.util.ArrayList -import java.util.List -import org.eclipse.papyrus.C_Cpp.ExternLibrary -import org.eclipse.papyrus.C_Cpp.External -import org.eclipse.papyrus.C_Cpp.Template -import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenUtils -import org.eclipse.uml2.uml.NamedElement -import org.eclipse.uml2.uml.util.UMLUtil -import org.eclipse.papyrus.codegen.base.GenUtils - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppClassIncludeDeclaration { - - static def cppClassIncludes(NamedElement ne) { - var List result = new ArrayList() - if (GenUtils.hasStereotypeTree(ne, ExternLibrary)) { - result = GenUtils.getApplicationTree(ne, ExternLibrary).includes - } else { - result.add(includeName(ne)) - } - return result - } - - static def includeName(NamedElement ne) { - if (GenUtils.hasStereotypeTree(ne, Template)) { - return UMLUtil.getStereotypeApplication(ne, Template).declaration - } else { - if (GenUtils.hasStereotypeTree(ne, External)) { - return UMLUtil.getStereotypeApplication(ne, External).name - } else { - // standard case (no stereotypes are applied) - return GenUtils.getFullPath(ne.nearestPackage) + '/' + ne.name + '.' + CppCodeGenUtils.getHeaderSuffix() - } - } - } -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassInheritedDeclarations.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassInheritedDeclarations.xtend deleted file mode 100644 index b6b81c0c5a9..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassInheritedDeclarations.xtend +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.papyrus.C_Cpp.NoCodeGen -import org.eclipse.papyrus.C_Cpp.Visibility -import org.eclipse.uml2.uml.Classifier -import org.eclipse.uml2.uml.Generalization -import org.eclipse.uml2.uml.InterfaceRealization -import org.eclipse.uml2.uml.Relationship -import org.eclipse.uml2.uml.util.UMLUtil -import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils -import org.eclipse.papyrus.codegen.base.GenUtils - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppClassInheritedDeclarations { - - static def CppClassInheritedDeclarations(Classifier clazz) ''' - «IF (filteredRelationships(clazz).length > 0)» : «ENDIF» - «FOR fr: filteredRelationships(clazz) SEPARATOR ', \n'» - «getCppVisibility(fr)» «CppGenUtils.cppQualifiedName(fr.targets.get(0) as Classifier)»«ENDFOR» - ''' - - //Return a list of relationships that are either Generalizations or InterfaceRealiazations - //and the target does not point to a classifier that has the no-code-gen Stereotype - //TODO: not sure if it makes sense NOT to declare an inheritance, since we do not generate code. - static def filteredRelationships(Classifier clazz) { - clazz.sourceDirectedRelationships.filter[((it instanceof Generalization) || (it instanceof InterfaceRealization)) && - (it.targets.size > 0) && (!GenUtils.hasStereotype(it.targets.get(0), NoCodeGen)) - ] - } - - static def getCppVisibility(Relationship relationship) { - if (GenUtils.hasStereotype(relationship, Visibility)) { - (UMLUtil.getStereotypeApplication(relationship, Visibility) as Visibility).value - } else { - 'public' - } - } -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsDeclaration.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsDeclaration.xtend deleted file mode 100644 index e41bb495982..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsDeclaration.xtend +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.uml2.uml.Classifier -import org.eclipse.uml2.uml.OpaqueBehavior -import org.eclipse.uml2.uml.VisibilityKind - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppClassOperationsDeclaration { - - static def CppClassOperationsDeclaration(Classifier clazz, VisibilityKind visibilityFilter) ''' - «FOR op : CppOperations.getOwnedOperations(clazz).filter[it.visibility == visibilityFilter]» - - «CppOperations.CppOperationDeclaration(op)» - «ENDFOR» - «FOR b : clazz.eAllContents.toList.filter(OpaqueBehavior).filter[it.visibility == visibilityFilter]» - «IF b.specification == null» - - // opaque behavior without specification (typically from state machine) - «CppOperations.CppBehaviorDeclaration(b)» - «ENDIF» - «ENDFOR» - ''' -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsImplementation.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsImplementation.xtend deleted file mode 100644 index 091d40b4f93..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsImplementation.xtend +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.uml2.uml.Classifier -import org.eclipse.papyrus.C_Cpp.NoCodeGen -import org.eclipse.uml2.uml.OpaqueBehavior -import org.eclipse.papyrus.C_Cpp.Inline -import org.eclipse.papyrus.codegen.base.GenUtils - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppClassOperationsImplementation { - - // implementations of a classifier, parameter controls whether only inline (or only not inline) operations - //are produced - static def CppClassOperationsImplementation(Classifier clazz, boolean inline) ''' - «FOR ownedOperation : CppOperations.getOwnedOperations(clazz).filter[(!(GenUtils.hasStereotype(it, NoCodeGen) || it.isAbstract)) && (GenUtils.hasStereotype(it, org.eclipse.papyrus.C_Cpp.Inline) == inline)] SEPARATOR "\n"» - «CppOperations.CppOperationImplementation(ownedOperation)» - «ENDFOR» - - «FOR nestedOperation : CppOperations.getNestedOperations(clazz).filter[(!(GenUtils.hasStereotype(it, NoCodeGen) || it.isAbstract)) && (GenUtils.hasStereotype(it, org.eclipse.papyrus.C_Cpp.Inline) == inline)] SEPARATOR "\n"» - «CppOperations.CppOperationImplementation(nestedOperation)» - «ENDFOR» - - «FOR b : clazz.eAllContents.toIterable.filter[(it instanceof OpaqueBehavior) && GenUtils.hasStereotype((it as OpaqueBehavior), Inline)==inline]» - «IF (b as OpaqueBehavior).specification == null» - // opaque behavior without specification (typically from state machine) - «CppOperations.CppBehaviorImplementation(b as OpaqueBehavior)» - «ENDIF» - «ENDFOR» - ''' - -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassTypeAndEnum.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassTypeAndEnum.xtend deleted file mode 100644 index 65b23596901..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassTypeAndEnum.xtend +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.papyrus.C_Cpp.NoCodeGen -import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils -import org.eclipse.uml2.uml.Classifier -import org.eclipse.uml2.uml.Element -import org.eclipse.uml2.uml.Enumeration -import org.eclipse.uml2.uml.Namespace -import org.eclipse.uml2.uml.Package -import org.eclipse.uml2.uml.PrimitiveType -import org.eclipse.uml2.uml.VisibilityKind -import org.eclipse.papyrus.codegen.base.GenUtils -import org.eclipse.uml2.uml.DataType -import org.eclipse.uml2.uml.UMLFactory - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppClassTypeAndEnum { - - static def CppClassTypeAndEnum(Classifier clazz) ''' - «var publicStr = TypesAndEnumsForVisibility(clazz, VisibilityKind.PUBLIC_LITERAL).toString» - «CppGenUtils.getSection(VisibilityKind.PUBLIC_LITERAL, publicStr)» - «var protectedStr = TypesAndEnumsForVisibility(clazz, VisibilityKind.PROTECTED_LITERAL).toString» - «CppGenUtils.getSection(VisibilityKind.PROTECTED_LITERAL, protectedStr)» - «var privateStr = TypesAndEnumsForVisibility(clazz, VisibilityKind.PRIVATE_LITERAL).toString» - «CppGenUtils.getSection(VisibilityKind.PRIVATE_LITERAL, privateStr)» - ''' - - static def CppClassTypeAndEnumPackage(Package pkg) { - TypesAndEnumsForVisibility(pkg, VisibilityKind.get(VisibilityKind.PACKAGE)) - TypesAndEnumsForVisibility(pkg, VisibilityKind.get(VisibilityKind.PUBLIC)) - } - - static def TypesAndEnumsForVisibility(Namespace ne, VisibilityKind visibilityFilter) ''' - «FOR ownedElement : ne.ownedElements» - «TypeAndEnumForVisibility(ownedElement, visibilityFilter)» - «ENDFOR» - ''' - - static def TypeAndEnumForVisibility(Element element, VisibilityKind visibilityFilter) { - if ((!GenUtils.hasStereotype(element, NoCodeGen)) && (element instanceof Classifier)) { - var elementVisibility = (element as Classifier).visibility - var value = elementVisibility.value - if ((value == visibilityFilter.value)) { - if (element instanceof Enumeration) { - return CppEnumerations.CppEnumerationDefinition(element as Enumeration) - } else if (element instanceof PrimitiveType) { - return CppPrimitiveTypes.CppPrimitiveTypeDefinition(element as PrimitiveType) - } else if ((element instanceof DataType || element.eClass.equals(UMLFactory.eINSTANCE.getUMLPackage().getClass_())) && !(element.owner instanceof Package)) { - if (GenUtils.isTemplateBoundElement(element as Classifier)) { - return CppInnerClassifiers.CppInnerBindDefinition(element as Classifier) - } else { - return CppInnerClassifiers.CppInnerClassDefinition(element as Classifier) - } - - } - } - } - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassifierGenerator.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassifierGenerator.xtend deleted file mode 100644 index 41af9c68a4b..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassifierGenerator.xtend +++ /dev/null @@ -1,253 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.papyrus.C_Cpp.Union -import org.eclipse.papyrus.codegen.base.GenUtils -import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenUtils -import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils -import org.eclipse.uml2.uml.Classifier -import org.eclipse.uml2.uml.DataType -import org.eclipse.uml2.uml.NamedElement -import org.eclipse.uml2.uml.VisibilityKind -import org.eclipse.uml2.uml.profile.standard.Create - -/** - * @author Ansgar Radermacher (ansgar.radermacher@cea.fr) - */ -class CppClassifierGenerator { - - static def generateBindHeaderCode(Classifier classifier) ''' - #ifndef «GenUtils.getFullNameUC(classifier)»_H - #define «GenUtils.getFullNameUC(classifier)»_H - - /************************************************************ - «classifier.name» template binding header - ************************************************************/ - - «CppIncludeUtil.includeDirective(CppClassIncludeClassDeclaration.cppOwnerPackageIncludePath(classifier.package))» - - «FOR path : getSortedIncludePathList(classifier)» - «CppIncludeUtil.includeDirective(path)» - «ENDFOR» - - «CppIncludeUtil.CppIncludeHeader(classifier)» - - «var tb = GenUtils.getTemplateBinding(classifier)» - «var templateElement = tb.targets.get(0)» - «CppIncludeUtil.includeDirective( - GenUtils.getFullPath(classifier.package) + '/' + (templateElement.owner as NamedElement).name + '.' + - CppCodeGenUtils.getHeaderSuffix())» - - «CppGenUtils.openNS(classifier)» - /************************************************************/ - typedef «(templateElement.owner as NamedElement).name»<«FOR ps : tb.parameterSubstitutions SEPARATOR ', '»« - CppTemplates.CppTemplateBindingParameter(ps)»«ENDFOR»> «classifier.name»; - - «CppGenUtils.closeNS(classifier)» - - /************************************************************ - End of «classifier.name» template binding header - ************************************************************/ - - #endif - ''' - - static def getSortedIncludePathList(Classifier classifier) { - var includePathList = CppClassIncludeClassDeclaration.CppClassAllIncludes(classifier).sort; - return includePathList - } - - static def generateBindBodyCode(Classifier classifier) ''' - #define «GenUtils.getFullNameUC(classifier)»_BODY - - /************************************************************ - «classifier.name» template binding body - ************************************************************/ - - «CppIncludeUtil.CppIncludePreBody(classifier)» - - // include associated header file - «CppIncludeUtil.includeDirective( - GenUtils.getFullPath(classifier.package) + '/' + classifier.name + '.' + CppCodeGenUtils.getHeaderSuffix())» - - «CppIncludeUtil.CppIncludeBody(classifier)» - - «CppGenUtils.openNS(classifier)» - - // Derived includes directives - «FOR path : CppClassIncludeClassDeclaration.CppClassAllIncludes(classifier).sort» - «CppIncludeUtil.includeDirective(path)» - «ENDFOR» - - /************************************************************/ - «var tb = GenUtils.getTemplateBinding(classifier)» - «var templateElement = tb.targets.get(0)» - template class «(templateElement.owner as NamedElement).name»<«FOR ps : tb.parameterSubstitutions SEPARATOR ', '»« - CppTemplates.CppTemplateBindingParameter(ps)»«ENDFOR»>; - - «CppGenUtils.closeNS(classifier)» - - /************************************************************ - End of «classifier.name» template binding body - ************************************************************/ - ''' - - static def generateClassHeaderCode(Classifier classifier) ''' - #ifndef «GenUtils.getFullNameUC(classifier)»_H - #define «GenUtils.getFullNameUC(classifier)»_H - - /************************************************************ - «classifier.name» class header - ************************************************************/ - - «CppIncludeUtil.includeDirective(CppClassIncludeClassDeclaration.cppOwnerPackageIncludePath(classifier.package))» - - «FOR path : getSortedIncludePathList(classifier)» - «CppIncludeUtil.includeDirective(path)» - «ENDFOR» - - «CppIncludeUtil.CppIncludeHeader(classifier)» - - «CppGenUtils.openNS(classifier)» - - /************************************************************/ - «CppDocumentation.CppElementDoc(classifier)» - «CppTemplates.templateSignature(classifier)»«classUnionOrStruct(classifier)» «classifier.name»«CppClassInheritedDeclarations. - CppClassInheritedDeclarations(classifier)» { - «CppClassFriendDeclaration.CppClassIncludeFriendDeclaration(classifier)»«CppClassTypeAndEnum.CppClassTypeAndEnum(classifier)» - «var publicVisibility = VisibilityKind.PUBLIC_LITERAL» - «CppGenUtils.getSection(publicVisibility, defaultInitializer(classifier))» - «CppGenUtils.getSection(publicVisibility, - CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, publicVisibility).toString)» - «CppGenUtils.getSection(publicVisibility, - CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, publicVisibility).toString)» - - «var protectedVisibility = VisibilityKind.PROTECTED_LITERAL» - «CppGenUtils.getSection(protectedVisibility, - CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, protectedVisibility).toString)» - «CppGenUtils.getSection(protectedVisibility, - CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, protectedVisibility).toString)» - - «var privateVisibility = VisibilityKind.PRIVATE_LITERAL» - «CppGenUtils.getSection(privateVisibility, - CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, privateVisibility).toString)» - «CppGenUtils.getSection(privateVisibility, - CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, privateVisibility).toString)» - }; - /************************************************************/ - /* External declarations (package visibility) */ - «var packageVisibility = VisibilityKind.PACKAGE_LITERAL» - «CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, packageVisibility)» - «CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, packageVisibility)» - /************************************************************/ - - «IF CppTemplates.isTemplate(classifier)» - /************************************************************/ - /* Template functions */ - «CppClassOperationsImplementation.CppClassOperationsImplementation(classifier, false)» - «ENDIF» - - /* Inline functions */ - «CppClassOperationsImplementation.CppClassOperationsImplementation(classifier, true)» - «CppGenUtils.closeNS(classifier)» - - /************************************************************ - End of «classifier.name» class header - ************************************************************/ - - #endif - ''' - - static def classUnionOrStruct(Classifier classifier) { - if (GenUtils.hasStereotype(classifier, Union)) { - return 'union' - } else { - if (classifier instanceof DataType) { - CppGenUtils.resetVisibility(VisibilityKind.PUBLIC_LITERAL) - return 'struct' - } else { - CppGenUtils.resetVisibility(VisibilityKind.PRIVATE_LITERAL) - return 'class' - } - } - } - - /** - * default initializer for non-static attributes with a default value TODO: should be disabled by default, since non-static members can be initialized directly in C++ 011 - */ - static def defaultInitializer(Classifier classifier) { - - /* Bug 422373: The default initializer should not be generated if there are any user-defined - constructors. In plain C++ code, the existence of a constructor with parameters - means that the compiler will not synthesize a default one. - - E.g., this would be invalid in plain C++ code: - class T1 { }; - class T2 { public: T(int); }; - T1 * t1 = new T1; // OK, sythesized default constructor used - T2 * t2a = new T2(5); // OK, user-defined constructor used - T2 * t2b = new T2; // ERROR, default constructor was not synthesized - - Also, if the user has provided a default constructor in the code, we don't need - to generate a second copy here. A default constructor should only be generated - here if the compiler would have synthesized one anyhow. Otherwise the default - property values should be set in the constructors that are generated by - CppClassOperationsDeclaration. - */ - var code = ''' - «IF CppOperations.getOwnedOperations(classifier).filter[GenUtils.hasStereotype(it, Create)].empty» - «var attributeList = classifier.attributes.filter[ - (it.isStatic == false) && (it.defaultValue != null) && (it.defaultValue.stringValue != null)]» - «IF !attributeList.empty» - «classifier.name»() : «FOR a : attributeList SEPARATOR ', '»«a.name»(«a.defaultValue.stringValue»)«ENDFOR» {} - «ENDIF» - «ENDIF»''' - return code.trim - } - - static def generateClassBodyCode(Classifier classifier) ''' - #define «GenUtils.getFullName(classifier)»_BODY - - /************************************************************ - «classifier.name» class body - ************************************************************/ - - «CppIncludeUtil.CppIncludePreBody(classifier)» - - // include associated header file - «CppIncludeUtil.includeDirective( - GenUtils.getFullPath(classifier.nearestPackage) + '/' + classifier.name + '.' + - CppCodeGenUtils.getHeaderSuffix())» - - // Derived includes directives - «FOR path : CppClassIncludeClassDeclaration.CppClassAllIncludesDeclarationBody(classifier).sort» - «CppIncludeUtil.includeDirective(path)» - «ENDFOR» - - «CppIncludeUtil.CppIncludeBody(classifier)» - - «CppGenUtils.openNS(classifier)» - - «CppAttribute.CppStaticAttributes(classifier)» - - «IF !classifier.isTemplate» - «CppClassOperationsImplementation.CppClassOperationsImplementation(classifier, false)» - «ENDIF» - - «CppGenUtils.closeNS(classifier)» - - /************************************************************ - End of «classifier.name» class body - ************************************************************/ - ''' -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppDocumentation.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppDocumentation.xtend deleted file mode 100644 index de7dcd05ec5..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppDocumentation.xtend +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.uml2.uml.Element -import org.eclipse.uml2.uml.Operation -import org.eclipse.uml2.uml.Parameter -import org.eclipse.uml2.uml.Behavior -import org.eclipse.uml2.uml.ParameterDirectionKind -import org.eclipse.papyrus.codegen.base.GenUtils - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppDocumentation { - static def CppElementDoc(Element argument) ''' - /** - * «GenUtils.getComments(argument).replaceAll('\n', '\n * ')» - */ - ''' - - static def CppOperationDoc(Operation operation) ''' - /** - * «GenUtils.getComments(operation).replaceAll('\n', '\n * ')» - «FOR op: operation.ownedParameters»«CppParamDoc(op)»«ENDFOR» - */ - ''' - - static def CppParamDoc(Parameter parameter) ''' - * «IF (parameter.direction == ParameterDirectionKind.RETURN_LITERAL) - »@return«ELSE»@param«ENDIF» «parameter.name» «GenUtils.getComments(parameter).replaceAll('\n', '\n * ')» - ''' - - static def CppBehaviorDoc(Behavior behavior) ''' - /** - * «GenUtils.getComments(behavior).replaceAll('\n', '\n * ')» - * «FOR op : behavior.ownedParameters»«CppParamDoc(op)»«ENDFOR» - */ - ''' -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppEnumerations.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppEnumerations.xtend deleted file mode 100644 index 7ab2661f252..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppEnumerations.xtend +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.uml2.uml.Enumeration -import org.eclipse.papyrus.C_Cpp.CppInit -import org.eclipse.uml2.uml.util.UMLUtil -import org.eclipse.papyrus.codegen.base.GenUtils - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppEnumerations { - static def CppEnumerationDefinition(Enumeration enumeration) ''' - «CppDocumentation.CppElementDoc(enumeration)» - enum «enumeration.name» { - «FOR ownedLiteral : enumeration.ownedLiterals» - «CppDocumentation.CppElementDoc(ownedLiteral)» - «ownedLiteral.name»«IF GenUtils.hasStereotype(ownedLiteral, CppInit)»«UMLUtil. - getStereotypeApplication(ownedLiteral, CppInit).value»«ENDIF», - «ENDFOR» - }; - ''' -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppIncludeUtil.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppIncludeUtil.xtend deleted file mode 100644 index c8623883fe1..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppIncludeUtil.xtend +++ /dev/null @@ -1,86 +0,0 @@ -package org.eclipse.papyrus.cpp.codegen.xtend - -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - import org.eclipse.uml2.uml.NamedElement -import org.eclipse.papyrus.C_Cpp.Include -import org.eclipse.uml2.uml.util.UMLUtil -import org.eclipse.papyrus.codegen.base.GenUtils - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppIncludeUtil { - static def includeDirective(String path) { - if ((path != null) && (path.length > 0)) - return '''#include ''' + '"' + path + '"' - } - - static def CppIncludeHeader(NamedElement ne) { - if (GenUtils.hasStereotype(ne, Include)) { - UMLUtil.getStereotypeApplication(ne, Include) - var header = UMLUtil.getStereotypeApplication(ne, Include).header - if ((header != null) && (header.length > 0)) { - var includeHeader = constIncludeHeaderStart + GenUtils.cleanCR(header) + '\n' + - constIncludeHeaderEnd - return includeHeader - } - } - } - - static def constIncludeHeaderStart() ''' - // Include from Include stereotype (header) - ''' - - static def constIncludeHeaderEnd() ''' - // End of Include stereotype (header) - ''' - - static def CppIncludePreBody(NamedElement ne) { - if (GenUtils.hasStereotype(ne, Include)) { - var String preBody = UMLUtil.getStereotypeApplication(ne, Include).preBody - if ((preBody != null) && (preBody.length > 0)) { - var includePreBody = constIncludePreBodyStart + GenUtils.cleanCR(preBody) + '\n' + - constIncludePreBodyEnd - return includePreBody - } - } - } - - static def constIncludePreBodyStart() ''' - // Include from Include stereotype (pre-body) - ''' - - static def constIncludePreBodyEnd() ''' - // End of Include stereotype (pre-body) - ''' - - static def CppIncludeBody(NamedElement ne) { - if (GenUtils.hasStereotype(ne, Include)) { - var String body = UMLUtil.getStereotypeApplication(ne, Include).body - if ((body != null) && (body.length > 0)) { - var includeBody = constIncludeBodyStart + GenUtils.cleanCR(body) + '\n' + - constIncludeBodyEnd - return includeBody - } - } - } - - static def constIncludeBodyStart() ''' - // Include from Include declaration (body) - ''' - - static def constIncludeBodyEnd() ''' - // End of Include declaration (body) - ''' - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppInnerClassifiers.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppInnerClassifiers.xtend deleted file mode 100644 index 78938c09623..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppInnerClassifiers.xtend +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.uml2.uml.Classifier -import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils -import org.eclipse.uml2.uml.VisibilityKind -import org.eclipse.papyrus.codegen.base.GenUtils -import org.eclipse.uml2.uml.NamedElement - -/** - * @author Shuai Li (CEA) - */ - -class CppInnerClassifiers { - static def CppInnerClassDefinition(Classifier classifier) ''' - «CppDocumentation.CppElementDoc(classifier)» - «CppTemplates.templateSignature(classifier)»«CppClassifierGenerator.classUnionOrStruct(classifier)» «classifier.name»«CppClassInheritedDeclarations. - CppClassInheritedDeclarations(classifier)» { - «CppClassFriendDeclaration.CppClassIncludeFriendDeclaration(classifier)»«CppClassTypeAndEnum.CppClassTypeAndEnum(classifier)» - «var publicVisibility = VisibilityKind.PUBLIC_LITERAL» - «CppGenUtils.getSection(publicVisibility, CppClassifierGenerator.defaultInitializer(classifier))» - «CppGenUtils.getSection(publicVisibility, - CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, publicVisibility).toString)» - «CppGenUtils.getSection(publicVisibility, - CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, publicVisibility).toString)» - - «var protectedVisibility = VisibilityKind.PROTECTED_LITERAL» - «CppGenUtils.getSection(protectedVisibility, - CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, protectedVisibility).toString)» - «CppGenUtils.getSection(protectedVisibility, - CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, protectedVisibility).toString)» - - «var privateVisibility = VisibilityKind.PRIVATE_LITERAL» - «CppGenUtils.getSection(privateVisibility, - CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, privateVisibility).toString)» - «CppGenUtils.getSection(privateVisibility, - CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, privateVisibility).toString)» - }; - ''' - - static def CppInnerBindDefinition(Classifier classifier) ''' - «var tb = GenUtils.getTemplateBinding(classifier)» - «var templateElement = tb.targets.get(0)» - /************************************************************/ - typedef «(templateElement.owner as NamedElement).name»<«FOR ps : tb.parameterSubstitutions SEPARATOR ', '»« - CppTemplates.CppTemplateBindingParameter(ps)»«ENDFOR»> «classifier.name»; - ''' -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppOperations.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppOperations.xtend deleted file mode 100644 index 557bd5b1c90..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppOperations.xtend +++ /dev/null @@ -1,204 +0,0 @@ -package org.eclipse.papyrus.cpp.codegen.xtend - -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - import org.eclipse.papyrus.C_Cpp.Inline -import org.eclipse.papyrus.C_Cpp.Virtual -import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils -import org.eclipse.papyrus.cpp.codegen.utils.Modifier -import org.eclipse.uml2.uml.Behavior -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.Classifier -import org.eclipse.uml2.uml.DataType -import org.eclipse.uml2.uml.Element -import org.eclipse.uml2.uml.Interface -import org.eclipse.uml2.uml.OpaqueBehavior -import org.eclipse.uml2.uml.Operation -import org.eclipse.uml2.uml.profile.standard.Create -import org.eclipse.uml2.uml.profile.standard.Destroy -import org.eclipse.papyrus.C_Cpp.ConstInit -import org.eclipse.uml2.uml.util.UMLUtil -import org.eclipse.papyrus.cpp.codegen.Constants -import org.eclipse.uml2.uml.NamedElement -import org.eclipse.uml2.uml.Region -import org.eclipse.papyrus.cpp.codegen.utils.ClassUtils -import org.eclipse.papyrus.codegen.base.GenUtils -import org.eclipse.papyrus.C_Cpp.Variadic -import org.eclipse.uml2.uml.ParameterDirectionKind - -class CppOperations { - static def CppOperationImplementation(Operation operation) ''' - «CppDocumentation.CppOperationDoc(operation)» - «IF (operation.name == 'main')» - «CppReturnSpec(operation)»«operation.name»(«CppParameter.CppOperationParameters(operation,false)») { - «GenUtils.getBody(operation, Constants.supportedLanguages)» - } - «ELSE» - «CppTemplates.templateSignature(operation)»«InlineTxt(operation)»«CppReturnSpec(operation)»«GenUtils.getNestedOperationFarthestClassifierOwnerNamespace(operation)»«CppTemplates.templateShortSignature(operation)»::«destructor(operation)»«operation.name»(«CppParameter.CppOperationParameters(operation, false)»«variadicParameter(operation)»)«throwss(operation)»«Modifier.modCVQualifier(operation)»«CppConstInit(operation)» { - «GenUtils.getBody(operation, Constants.supportedLanguages)» - } - «ENDIF» - ''' - - static def CppReturnSpec(Operation operation) { - if ((operation.type == null) || isConsOrDestructor(operation)) { - ConsDestructorOrVoid(operation) - } else { - Modifier.modCVQualifier(operation.getReturnResult())+' '+CppGenUtils.cppQualifiedName(operation.type)+Modifier.modPtr(operation.getReturnResult())+Modifier.modRef(operation.getReturnResult())+' ' - } - } - - static def CppReturnSpec(Behavior behavior) ''' - «IF (GenUtils.returnResult(behavior) == null)»void «ELSE»«Modifier.modCVQualifier(GenUtils.returnResult(behavior))» «CppGenUtils.cppQualifiedName(GenUtils.returnResult(behavior).type)»«Modifier.modPtr(GenUtils.returnResult(behavior))»«Modifier.modRef(GenUtils.returnResult(behavior))» «ENDIF» - ''' - - static def throwss(Operation operation) ''' - «IF operation.raisedExceptions.length > 0» - throws «FOR re : operation.raisedExceptions SEPARATOR ','»«re.name»«ENDFOR» - «ENDIF» - ''' - - static def ConsDestructorOrVoid(Operation operation) { - if (isConsOrDestructor(operation)) { - - } else { - 'void ' - } - } - - static def isConsOrDestructor(Operation operation) { - GenUtils.hasStereotype(operation, Create) || GenUtils.hasStereotype(operation, Destroy) - } - - static def CppConstInit(Operation operation) { - if (GenUtils.hasStereotype(operation, ConstInit) && GenUtils.hasStereotype(operation, Create)) { - ": " + UMLUtil.getStereotypeApplication(operation, ConstInit).initialisation - } - } - - // return a list of owned operations, return emptyset, if null - static def getOwnedOperations(Classifier cl) { - val operations = getOwnedOperationsWNull(cl) - if (operations == null) { - emptySet - } - else { - operations - } - } - - // return a list of owned operations, since this is not supported directly on a classifier - static def getOwnedOperationsWNull(Classifier cl) { - if (cl instanceof Class) { - (cl as Class).ownedOperations - } else { - if (cl instanceof DataType) { - (cl as DataType).ownedOperations - } else { - if (cl instanceof Interface) { - (cl as Interface).ownedOperations - } else { - // Sequence{} - } - } - } - } - - static def getNestedOperations(Classifier c1) { - val operations = getNestedOperationsWNull(c1) - if (operations == null) { - emptySet - } - else { - operations - } - } - - static def getNestedOperationsWNull(Classifier cl) { - if (cl instanceof Class || cl instanceof Interface) { - ClassUtils.nestedOperations(cl) - } - } - - static def CppBehaviorImplementation(OpaqueBehavior behavior) ''' - «CppDocumentation.CppBehaviorDoc(behavior)» - «CppReturnSpec(behavior)»«GenUtils.getNestedBehaviorFarthestClassifierOwnerNamespace(behavior)»::«behavior.qualifiedBehaviorName»(«CppParameter.CppBehaviorParameters(behavior, false)»)«Modifier.modCVQualifier(behavior)» { - «GenUtils.getBodyFromOB(behavior, Constants.supportedLanguages)» - } - ''' - - static def CppOperationDeclaration(Operation operation) ''' - «CppDocumentation.CppOperationDoc(operation)» - «InlineTxt(operation)»«virtualTxt(operation)»«staticTxt(operation)»«CppReturnSpec(operation)»«destructor(operation)»«operation.name»(«CppParameter.CppOperationParameters(operation,true)»«variadicParameter(operation)»)«Modifier.modCVQualifier(operation)»«virtualSuffix(operation)»; - ''' - - static def InlineTxt(Element element) { - if (GenUtils.hasStereotype(element, Inline)) 'inline ' - } - - static def virtualTxt(Operation operation) { - if ((operation.interface != null) || (operation.isAbstract) || (GenUtils.hasStereotype(operation, Virtual))) 'virtual ' - } - - static def staticTxt(Operation operation) { - if (operation.isStatic) 'static ' - } - - static def destructor(Operation operation) { - if (GenUtils.hasStereotype(operation, Destroy) && (!operation.name.startsWith('~'))) { - '~' - } else { - '' - } - } - - static def public virtualSuffix(Operation operation) { - if ((operation.interface != null) || (operation.isAbstract)) ' = 0' - } - - static def CppBehaviorDeclaration(Behavior behavior) ''' - «CppDocumentation.CppBehaviorDoc(behavior)» - «InlineTxt(behavior)»«CppReturnSpec(behavior)»«behavior.qualifiedBehaviorName»(«CppParameter.CppBehaviorParameters(behavior, true)»)«Modifier.modCVQualifier(behavior)»; - ''' - - static def qualifiedBehaviorName(Behavior behavior) { - var ne = behavior as NamedElement - var name = behavior.name - while ((ne != null) && !(ne instanceof Classifier) || (ne instanceof Behavior)) { - if (ne.owner instanceof NamedElement) { - ne = ne.owner as NamedElement - } - if (ne.owner instanceof Region) { - name = ne.name + "_" + name - } - } - return name - } - - static def variadicParameter(Operation operation) { - var hasParameters = false; - var i = 0; - if (GenUtils.hasStereotype(operation, Variadic)) { - while (i < operation.ownedParameters.size && !hasParameters) { - if (operation.ownedParameters.get(i).direction != ParameterDirectionKind.RETURN_LITERAL) { - hasParameters = true; - } - } - - if (hasParameters) { - ', ...' - } else { - '...' - } - } - } -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPackageHeaderGenerator.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPackageHeaderGenerator.xtend deleted file mode 100644 index 4698312f2b8..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPackageHeaderGenerator.xtend +++ /dev/null @@ -1,64 +0,0 @@ -package org.eclipse.papyrus.cpp.codegen.xtend - -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenUtils -import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils -import org.eclipse.uml2.uml.Package -import org.eclipse.papyrus.codegen.base.GenUtils - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppPackageHeaderGenerator { - - static def generateCode(Package pkg) ''' - #ifndef PKG_«GenUtils.getFullNameUC(pkg)» - #define PKG_«GenUtils.getFullNameUC(pkg)» - - /************************************************************ - Pkg_«pkg.name» package header - ************************************************************/ - - «CppIncludeUtil.includeDirective(CppClassIncludeClassDeclaration.cppOwnerPackageIncludePath(pkg.nestingPackage))» - - #ifndef _IN_ - #define _IN_ - #endif - #ifndef _OUT_ - #define _OUT_ - #endif - #ifndef _INOUT_ - #define _INOUT_ - #endif - - - /* Package dependency header include */ - «FOR p: GenUtils.getUsedPackages(pkg)» - «var path = GenUtils.getFullPath(p) + "/Pkg_"+ p.name + "." + CppCodeGenUtils.getHeaderSuffix» - «CppIncludeUtil.includeDirective(path)» - «ENDFOR» - - «CppIncludeUtil.CppIncludeHeader(pkg)» - «CppGenUtils.openNS(pkg)» - - // Types defined within the package - «CppClassTypeAndEnum.CppClassTypeAndEnumPackage(pkg)» - «CppGenUtils.closeNS(pkg)» - - /************************************************************ - End of Pkg_«pkg.name» package header - ************************************************************/ - - #endif - ''' -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppParameter.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppParameter.xtend deleted file mode 100644 index 160265df9b8..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppParameter.xtend +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.uml2.uml.Operation -import org.eclipse.uml2.uml.Parameter -import org.eclipse.papyrus.cpp.codegen.utils.Modifier -import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils -import org.eclipse.uml2.uml.ParameterDirectionKind -import org.eclipse.uml2.uml.Behavior -import org.eclipse.papyrus.C_Cpp.Array -import org.eclipse.uml2.uml.util.UMLUtil - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppParameter { - - static def CppOperationParameters(Operation operation, boolean showDefault) ''' - «FOR ownedParameter : operation.ownedParameters.filter[it.direction != ParameterDirectionKind.RETURN_LITERAL] SEPARATOR ', '»«CppParameter(ownedParameter, showDefault)»«ENDFOR»''' - - /** - * comment signature for a given behavior (e.g. effect within state machine) - */ - static def CppBehaviorParameters(Behavior behavior, boolean showDefault) ''' - «FOR ownedParameter : behavior.ownedParameters.filter[it.direction != ParameterDirectionKind.RETURN_LITERAL] SEPARATOR ', '»«CppParameter(ownedParameter, showDefault)»«ENDFOR» - ''' - - /** - * C++ parameter. Default values are added, if parameter showDefault is true (implementation signature - */ - static def CppParameter(Parameter parameter, boolean showDefault) { - Modifier.modCVQualifier(parameter) + Modifier.modSCQualifier(parameter) + CppGenUtils.cppQualifiedName(parameter.type) + - Modifier.modPtr(parameter) + Modifier.modRef(parameter) + Modifier.dirInfo(parameter) + " " + parameter.name + - Modifier.modArray(parameter) + {if (showDefault) defaultValue(parameter) else ""} - } - - /** - * CppParameterCalculation for CDT - */ - static def CppParameterForCDT(Parameter parameter) { - var paramStr = Modifier.modCVQualifier(parameter) + Modifier.modSCQualifier(parameter) + CppGenUtils.cppQualifiedName(parameter.type) + - Modifier.modPtr(parameter) + Modifier.modRef(parameter) - if (UMLUtil.getStereotypeApplication(parameter, Array) != null) { - paramStr += "[]" - } - return paramStr - } - - static def defaultValue(Parameter parameter) { - if (parameter.defaultValue != null) " = " + parameter.defaultValue.stringValue() else "" - } -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPrimitiveTypes.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPrimitiveTypes.xtend deleted file mode 100644 index 46fcb612a72..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPrimitiveTypes.xtend +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.uml2.uml.PrimitiveType -import org.eclipse.papyrus.C_Cpp.Typedef -import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils -import org.eclipse.uml2.uml.util.UMLUtil -import org.eclipse.papyrus.codegen.base.GenUtils - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppPrimitiveTypes { - - /** Support two different kinds of primitive types - * (1) those that are native types of the programming language such as long - * For these, no additional definition has to be done and they should be referenced - * with their name only - * (2) those that correspond to a typedef (e.g. typedef long ErrorType). These require - * a typedef definition within the package and need to be referenced with their - * fully qualified name (e.g. MyPackage::ErrorType) - * (3) Sometimes the name of the type defined by a typedef does not appear at the end, e.g. - * when defining functionPointers such as "typedef int (*HandlerFct) (void*);" - * (a function with a void* argument returning int) - * Support this case via a specific 'typeName' constant that gets replaced by the name of the - * type - */ - static def CppPrimitiveTypeDefinition(PrimitiveType primitiveType) ''' - «CppDocumentation.CppElementDoc(primitiveType)» - «IF GenUtils.hasStereotype(primitiveType, Typedef)» - typedef «UMLUtil.getStereotypeApplication(primitiveType, Typedef).definition.replaceAll('typeName', primitiveType.name)» - «IF !UMLUtil.getStereotypeApplication(primitiveType, Typedef).definition.contains('typeName')»«primitiveType.name»«ENDIF»; - - «ELSE» - «CppGenUtils.getStdtypes(primitiveType)» - - «ENDIF» - ''' -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppTemplates.xtend b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppTemplates.xtend deleted file mode 100644 index 13c207c8708..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppTemplates.xtend +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - - package org.eclipse.papyrus.cpp.codegen.xtend - -import org.eclipse.uml2.uml.Operation -import org.eclipse.uml2.uml.Classifier -import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils -import org.eclipse.uml2.uml.TemplateParameterSubstitution -import org.eclipse.uml2.uml.NamedElement -import org.eclipse.uml2.uml.LiteralInteger -import org.eclipse.papyrus.codegen.base.GenUtils - -/** - * @author Önder GÜRCAN (onder.gurcan@cea.fr) - */ -class CppTemplates { - - static def templateSignature(Operation operation) { - templateSignature(operation.owner as Classifier) - } - - static def templateSignature(Classifier clazz)''' - «IF (isTemplate(clazz))» - template<«FOR templateParam : GenUtils.getTemplateParameters(clazz) SEPARATOR ', '»«CppGenUtils.getTemplateTypeName(templateParam)»«ENDFOR»> - «ENDIF» - ''' - - static def templateShortSignature(Operation operation) { - templateShortSignature(operation.owner as Classifier) - } - - static def templateShortSignature(Classifier clazz)''' - «IF (isTemplate(clazz))» - <«FOR templateParam : GenUtils.getTemplateParameters(clazz) SEPARATOR ', '»«GenUtils.getTemplateName(templateParam)»«ENDFOR»> - «ENDIF» - ''' - - static def isTemplate(Classifier clazz) { - GenUtils.getTemplateParameters(clazz).size() > 0 - } - - static def CppTemplateBindingParameter(TemplateParameterSubstitution tps) { - if (tps.actual instanceof LiteralInteger) { - (tps.actual as LiteralInteger).value - } else { - (tps.actual as NamedElement).name - } - } -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/xtend-gen/.gitignore b/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/xtend-gen/.gitignore deleted file mode 100644 index c96a04f008e..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.codegen/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/.classpath b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/.project b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/.project deleted file mode 100644 index 3e3d8136716..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.cpp.examples - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/.settings/org.eclipse.jdt.core.prefs b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index c537b63063c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/META-INF/MANIFEST.MF deleted file mode 100644 index 85f6beaf683..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.papyrus.uml.diagram.wizards;bundle-version="1.2.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.cpp.examples.Activator -Bundle-SymbolicName: org.eclipse.papyrus.cpp.examples;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/about.html b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/build.properties b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/build.properties deleted file mode 100644 index 9cd110db55b..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties,\ - about.html,\ - plugin.xml,\ - models/ -src.includes = about.html diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.di b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.di deleted file mode 100644 index b61e898b639..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.di +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.notation b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.notation deleted file mode 100644 index 38ed3da34a5..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.notation +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.uml b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.uml deleted file mode 100644 index 05f811b27a4..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.uml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - Simple HelloWorld component that prints a message in its "run" operation - - - - Class with main function. This function is not declared (since it would always be a member function), but directly added via the ManualGeneration stereptype). - - - The dependency is necessary, since the use of the class HelloWorld is happening inside the body (types appearing in the signature of operations or attributes are managed automatically). - - - Use the package to generate code. Open the context menu and select "generate code". - - - - C/C++ - cout << "Hello world" << endl; - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/plugin.properties deleted file mode 100644 index ed68cd6714a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus C/C++ examples (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/plugin.xml deleted file mode 100644 index 17282114c08..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/plugin.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/pom.xml deleted file mode 100644 index 12e53bc4b17..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.cpp.examples - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/Activator.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/Activator.java deleted file mode 100644 index 4611a96f62d..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/Activator.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.papyrus.cpp.examples; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.cpp.examples"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/HelloWorldOOModelWizard.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/HelloWorldOOModelWizard.java deleted file mode 100644 index ee3400e6c43..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/HelloWorldOOModelWizard.java +++ /dev/null @@ -1,27 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.cpp.examples; - -import org.eclipse.papyrus.uml.diagram.wizards.ModelCopyWizard; - -/** - * Copy wizard for the HelloWorld example - */ -public class HelloWorldOOModelWizard extends ModelCopyWizard { - - public HelloWorldOOModelWizard() { - super("HelloWorldOO"); //$NON-NLS-1$ - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.classpath b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.project b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.project deleted file mode 100644 index 1d8b98f86c4..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.cpp.profile - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.core.prefs b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94d61f00da6..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/META-INF/MANIFEST.MF deleted file mode 100644 index 08fc01f383b..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.emf.ecore;visibility:=reexport, - org.eclipse.emf.ecore.xmi;visibility:=reexport, - org.eclipse.uml2.types;visibility:=reexport, - org.eclipse.uml2.uml;bundle-version="3.1.0";visibility:=reexport -Export-Package: org.eclipse.papyrus.C_Cpp, - org.eclipse.papyrus.C_Cpp.impl, - org.eclipse.papyrus.C_Cpp.util, - org.eclipse.papyrus.cpp.profile -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.cpp.profile.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.cpp.profile;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/about.html b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/build.properties b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/build.properties deleted file mode 100644 index e962c668873..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/build.properties +++ /dev/null @@ -1,11 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - profiles/,\ - libraries/,\ - icons/,\ - about.html,\ - plugin.properties -src.includes = about.html diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/icons/transfo_cpp.gif b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/icons/transfo_cpp.gif deleted file mode 100644 index 7caaa0fdae8..00000000000 Binary files a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/icons/transfo_cpp.gif and /dev/null differ diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.di b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.di deleted file mode 100644 index 27d5dafd653..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.di +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.notation b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.notation deleted file mode 100644 index 039e96e9c0b..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.notation +++ /dev/null @@ -1,348 +0,0 @@ - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.uml b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.uml deleted file mode 100644 index 00ee3486b79..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.uml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Platform independent fixed size types - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/plugin.properties deleted file mode 100644 index 17e06150837..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus C/C++ profile (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/plugin.xml deleted file mode 100644 index c6442e7a3fc..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/plugin.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/pom.xml deleted file mode 100644 index 8668c069579..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.cpp.profile - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.ecore b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.ecore deleted file mode 100644 index 65ebda94e6b..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.ecore +++ /dev/null @@ -1,205 +0,0 @@ - - - - -
- - - - - - - -
- - - - - - - - - - -
- - - - - - -
- - - - - - - - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.genmodel b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.genmodel deleted file mode 100644 index 1273b29c170..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.genmodel +++ /dev/null @@ -1,196 +0,0 @@ - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - C_Cpp.profile.uml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.di b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.di deleted file mode 100644 index 134e5584ee5..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.di +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.notation b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.notation deleted file mode 100644 index 5acb64df288..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.notation +++ /dev/null @@ -1,1835 +0,0 @@ - - - - - -
- - -
- - -
- - - - - -
- - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
- - - name - derived - type - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
- - - name - derived - multiplicity - type - - - - - - -
- - - name - derived - multiplicity - type - - - - - - -
- - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - -
- - -
- - -
- - - - - -
- - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
- - - name - derived - multiplicity - type - - - - - - -
- - - name - derived - multiplicity - type - - - - - - -
- - - name - derived - multiplicity - type - - - - - - -
- - - name - derived - multiplicity - type - - - - - - -
- - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - -
- - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - name - type - derived - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
- - - name - derived - type - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
- - - name - derived - type - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
- - - name - derived - type - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.uml b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.uml deleted file mode 100644 index 624c26dd6b5..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.uml +++ /dev/null @@ -1,529 +0,0 @@ - - - - - "declaration" attribute should only be used, if more than one indirections of pointers (often "**") - - - An arbitrary string that is added to header and body file. Although primarily intended for manual include directives, it can be used for arbitrary definitions. -"preBody" is added to a C++ body file before automatic include statements, "body" after - - - Some toolkits require a quite particular way of use. For instance, LTTng requires the use of C (not C++) for the declaration of a trace provider and the header file is read several time with redefined macros. Therefore, the code generator supports a "manual" generation mode, in which primarily the contents of the CppInclude directive is written. - - - Mark a package as External Library. If this package is used, the associated CDT project will be configured accordingly. - - - No code generation should be done for this element. This also means that no include directive is generated, if the class is referenced. - - - Indicates that this package shoudl be a root package, i.e. its contents should appear on top level folder during generation. Currently not used - - - Declare a new type that is based on another type. -Can be used to define for instance primitive types (like int). Can also be used for function pointers (see wiki) - - - The extension from Include to Class is not necessary, as Classifier is already extended, but kept for compatibility with old models - - - External classes reference existing C++ classes, but are typcially empty in the model. An include directive is generated if classes depend on these. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.di b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.di deleted file mode 100644 index 89f2786c0ea..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.di +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.notation b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.notation deleted file mode 100644 index 8d2827ae033..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.notation +++ /dev/null @@ -1,650 +0,0 @@ - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.uml b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.uml deleted file mode 100644 index 8684a4b4967..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.uml +++ /dev/null @@ -1,4143 +0,0 @@ - - - - - -
-
-
-
-
- - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Array.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Array.java deleted file mode 100644 index 54cbd8163d2..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Array.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Association; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Property; - -/** - * - * A representation of the model object 'Array'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Array#getBase_parameter Base parameter}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Array#getDefinition Definition}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Array#getBase_property Base property}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Array#getBase_association Base association}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getArray() - * @model - * @generated - */ -public interface Array extends EObject { - /** - * Returns the value of the 'Base parameter' reference. - * - *

- * If the meaning of the 'Base parameter' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base parameter' reference. - * @see #setBase_parameter(Parameter) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getArray_Base_parameter() - * @model ordered="false" - * @generated - */ - Parameter getBase_parameter(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Array#getBase_parameter Base parameter}' reference. - * - * - * @param value the new value of the 'Base parameter' reference. - * @see #getBase_parameter() - * @generated - */ - void setBase_parameter(Parameter value); - - /** - * Returns the value of the 'Definition' attribute. - * - *

- * If the meaning of the 'Definition' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Definition' attribute. - * @see #setDefinition(String) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getArray_Definition() - * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" - * @generated - */ - String getDefinition(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Array#getDefinition Definition}' attribute. - * - * - * @param value the new value of the 'Definition' attribute. - * @see #getDefinition() - * @generated - */ - void setDefinition(String value); - - /** - * Returns the value of the 'Base property' reference. - * - *

- * If the meaning of the 'Base property' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base property' reference. - * @see #setBase_property(Property) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getArray_Base_property() - * @model ordered="false" - * @generated - */ - Property getBase_property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Array#getBase_property Base property}' reference. - * - * - * @param value the new value of the 'Base property' reference. - * @see #getBase_property() - * @generated - */ - void setBase_property(Property value); - - /** - * Returns the value of the 'Base association' reference. - * - *

- * If the meaning of the 'Base association' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base association' reference. - * @see #setBase_association(Association) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getArray_Base_association() - * @model ordered="false" - * @generated - */ - Association getBase_association(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Array#getBase_association Base association}' reference. - * - * - * @param value the new value of the 'Base association' reference. - * @see #getBase_association() - * @generated - */ - void setBase_association(Association value); - -} // Array diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppFactory.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppFactory.java deleted file mode 100644 index 23497620ac3..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppFactory.java +++ /dev/null @@ -1,268 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EFactory; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage - * @generated - */ -public interface C_CppFactory extends EFactory { - /** - * The singleton instance of the factory. - * - * - * @generated - */ - C_CppFactory eINSTANCE = org.eclipse.papyrus.C_Cpp.impl.C_CppFactoryImpl.init(); - - /** - * Returns a new object of class 'Ptr'. - * - * - * @return a new object of class 'Ptr'. - * @generated - */ - Ptr createPtr(); - - /** - * Returns a new object of class 'Include'. - * - * - * @return a new object of class 'Include'. - * @generated - */ - Include createInclude(); - - /** - * Returns a new object of class 'Manual Generation'. - * - * - * @return a new object of class 'Manual Generation'. - * @generated - */ - ManualGeneration createManualGeneration(); - - /** - * Returns a new object of class 'Extern Library'. - * - * - * @return a new object of class 'Extern Library'. - * @generated - */ - ExternLibrary createExternLibrary(); - - /** - * Returns a new object of class 'No Code Gen'. - * - * - * @return a new object of class 'No Code Gen'. - * @generated - */ - NoCodeGen createNoCodeGen(); - - /** - * Returns a new object of class 'Cpp Root'. - * - * - * @return a new object of class 'Cpp Root'. - * @generated - */ - CppRoot createCppRoot(); - - /** - * Returns a new object of class 'Array'. - * - * - * @return a new object of class 'Array'. - * @generated - */ - Array createArray(); - - /** - * Returns a new object of class 'Const'. - * - * - * @return a new object of class 'Const'. - * @generated - */ - Const createConst(); - - /** - * Returns a new object of class 'Ref'. - * - * - * @return a new object of class 'Ref'. - * @generated - */ - Ref createRef(); - - /** - * Returns a new object of class 'External'. - * - * - * @return a new object of class 'External'. - * @generated - */ - External createExternal(); - - /** - * Returns a new object of class 'Const Init'. - * - * - * @return a new object of class 'Const Init'. - * @generated - */ - ConstInit createConstInit(); - - /** - * Returns a new object of class 'Friend'. - * - * - * @return a new object of class 'Friend'. - * @generated - */ - Friend createFriend(); - - /** - * Returns a new object of class 'Inline'. - * - * - * @return a new object of class 'Inline'. - * @generated - */ - Inline createInline(); - - /** - * Returns a new object of class 'Virtual'. - * - * - * @return a new object of class 'Virtual'. - * @generated - */ - Virtual createVirtual(); - - /** - * Returns a new object of class 'Typedef'. - * - * - * @return a new object of class 'Typedef'. - * @generated - */ - Typedef createTypedef(); - - /** - * Returns a new object of class 'Visibility'. - * - * - * @return a new object of class 'Visibility'. - * @generated - */ - Visibility createVisibility(); - - /** - * Returns a new object of class 'Cpp Init'. - * - * - * @return a new object of class 'Cpp Init'. - * @generated - */ - CppInit createCppInit(); - - /** - * Returns a new object of class 'Template'. - * - * - * @return a new object of class 'Template'. - * @generated - */ - Template createTemplate(); - - /** - * Returns a new object of class 'Template Binding'. - * - * - * @return a new object of class 'Template Binding'. - * @generated - */ - TemplateBinding createTemplateBinding(); - - /** - * Returns a new object of class 'Template Parameter'. - * - * - * @return a new object of class 'Template Parameter'. - * @generated - */ - TemplateParameter createTemplateParameter(); - - /** - * Returns a new object of class 'Union'. - * - * - * @return a new object of class 'Union'. - * @generated - */ - Union createUnion(); - - /** - * Returns a new object of class 'Storage Class'. - * - * - * @return a new object of class 'Storage Class'. - * @generated - */ - StorageClass createStorageClass(); - - /** - * Returns a new object of class 'Volatile'. - * - * - * @return a new object of class 'Volatile'. - * @generated - */ - Volatile createVolatile(); - - /** - * Returns a new object of class 'Variadic'. - * - * - * @return a new object of class 'Variadic'. - * @generated - */ - Variadic createVariadic(); - - /** - * Returns a new object of class 'Mutable'. - * - * - * @return a new object of class 'Mutable'. - * @generated - */ - Mutable createMutable(); - - /** - * Returns the package supported by this factory. - * - * - * @return the package supported by this factory. - * @generated - */ - C_CppPackage getC_CppPackage(); - -} // C_CppFactory diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppPackage.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppPackage.java deleted file mode 100644 index e58139c0869..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppPackage.java +++ /dev/null @@ -1,2980 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppFactory - * @model kind="package" - * @generated - */ -public interface C_CppPackage extends EPackage { - /** - * The package name. - * - * - * @generated - */ - String eNAME = "C_Cpp"; //$NON-NLS-1$ - - /** - * The package namespace URI. - * - * - * @generated - */ - String eNS_URI = "http://www.eclipse.org/papyrus/C_Cpp/1"; //$NON-NLS-1$ - - /** - * The package namespace name. - * - * - * @generated - */ - String eNS_PREFIX = "C_Cpp"; //$NON-NLS-1$ - - /** - * The singleton instance of the package. - * - * - * @generated - */ - C_CppPackage eINSTANCE = org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl.init(); - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.PtrImpl Ptr}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.PtrImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getPtr() - * @generated - */ - int PTR = 0; - - /** - * The feature id for the 'Base parameter' reference. - * - * - * @generated - * @ordered - */ - int PTR__BASE_PARAMETER = 0; - - /** - * The feature id for the 'Base property' reference. - * - * - * @generated - * @ordered - */ - int PTR__BASE_PROPERTY = 1; - - /** - * The feature id for the 'Declaration' attribute. - * - * - * @generated - * @ordered - */ - int PTR__DECLARATION = 2; - - /** - * The number of structural features of the 'Ptr' class. - * - * - * @generated - * @ordered - */ - int PTR_FEATURE_COUNT = 3; - - /** - * The number of operations of the 'Ptr' class. - * - * - * @generated - * @ordered - */ - int PTR_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl Include}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.IncludeImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getInclude() - * @generated - */ - int INCLUDE = 1; - - /** - * The feature id for the 'Body' attribute. - * - * - * @generated - * @ordered - */ - int INCLUDE__BODY = 0; - - /** - * The feature id for the 'Pre Body' attribute. - * - * - * @generated - * @ordered - */ - int INCLUDE__PRE_BODY = 1; - - /** - * The feature id for the 'Header' attribute. - * - * - * @generated - * @ordered - */ - int INCLUDE__HEADER = 2; - - /** - * The feature id for the 'Base package' reference. - * - * - * @generated - * @ordered - */ - int INCLUDE__BASE_PACKAGE = 3; - - /** - * The feature id for the 'Base class' reference. - * - * - * @generated - * @ordered - */ - int INCLUDE__BASE_CLASS = 4; - - /** - * The feature id for the 'Base Classifier' reference. - * - * - * @generated - * @ordered - */ - int INCLUDE__BASE_CLASSIFIER = 5; - - /** - * The number of structural features of the 'Include' class. - * - * - * @generated - * @ordered - */ - int INCLUDE_FEATURE_COUNT = 6; - - /** - * The number of operations of the 'Include' class. - * - * - * @generated - * @ordered - */ - int INCLUDE_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.ManualGenerationImpl Manual Generation}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.ManualGenerationImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getManualGeneration() - * @generated - */ - int MANUAL_GENERATION = 2; - - /** - * The feature id for the 'Extension Body' attribute. - * - * - * @generated - * @ordered - */ - int MANUAL_GENERATION__EXTENSION_BODY = 0; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int MANUAL_GENERATION__BASE_CLASS = 1; - - /** - * The number of structural features of the 'Manual Generation' class. - * - * - * @generated - * @ordered - */ - int MANUAL_GENERATION_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'Manual Generation' class. - * - * - * @generated - * @ordered - */ - int MANUAL_GENERATION_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl Extern Library}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getExternLibrary() - * @generated - */ - int EXTERN_LIBRARY = 3; - - /** - * The feature id for the 'Include Paths' attribute list. - * - * - * @generated - * @ordered - */ - int EXTERN_LIBRARY__INCLUDE_PATHS = 0; - - /** - * The feature id for the 'Base package' reference. - * - * - * @generated - * @ordered - */ - int EXTERN_LIBRARY__BASE_PACKAGE = 1; - - /** - * The feature id for the 'Lib Paths' attribute list. - * - * - * @generated - * @ordered - */ - int EXTERN_LIBRARY__LIB_PATHS = 2; - - /** - * The feature id for the 'Macros' attribute list. - * - * - * @generated - * @ordered - */ - int EXTERN_LIBRARY__MACROS = 3; - - /** - * The feature id for the 'Libs' attribute list. - * - * - * @generated - * @ordered - */ - int EXTERN_LIBRARY__LIBS = 4; - - /** - * The feature id for the 'Includes' attribute list. - * - * - * @generated - * @ordered - */ - int EXTERN_LIBRARY__INCLUDES = 5; - - /** - * The number of structural features of the 'Extern Library' class. - * - * - * @generated - * @ordered - */ - int EXTERN_LIBRARY_FEATURE_COUNT = 6; - - /** - * The number of operations of the 'Extern Library' class. - * - * - * @generated - * @ordered - */ - int EXTERN_LIBRARY_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.NoCodeGenImpl No Code Gen}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.NoCodeGenImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getNoCodeGen() - * @generated - */ - int NO_CODE_GEN = 4; - - /** - * The feature id for the 'Base element' reference. - * - * - * @generated - * @ordered - */ - int NO_CODE_GEN__BASE_ELEMENT = 0; - - /** - * The number of structural features of the 'No Code Gen' class. - * - * - * @generated - * @ordered - */ - int NO_CODE_GEN_FEATURE_COUNT = 1; - - /** - * The number of operations of the 'No Code Gen' class. - * - * - * @generated - * @ordered - */ - int NO_CODE_GEN_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.CppRootImpl Cpp Root}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.CppRootImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getCppRoot() - * @generated - */ - int CPP_ROOT = 5; - - /** - * The feature id for the 'Base package' reference. - * - * - * @generated - * @ordered - */ - int CPP_ROOT__BASE_PACKAGE = 0; - - /** - * The number of structural features of the 'Cpp Root' class. - * - * - * @generated - * @ordered - */ - int CPP_ROOT_FEATURE_COUNT = 1; - - /** - * The number of operations of the 'Cpp Root' class. - * - * - * @generated - * @ordered - */ - int CPP_ROOT_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.ArrayImpl Array}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.ArrayImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getArray() - * @generated - */ - int ARRAY = 6; - - /** - * The feature id for the 'Base parameter' reference. - * - * - * @generated - * @ordered - */ - int ARRAY__BASE_PARAMETER = 0; - - /** - * The feature id for the 'Definition' attribute. - * - * - * @generated - * @ordered - */ - int ARRAY__DEFINITION = 1; - - /** - * The feature id for the 'Base property' reference. - * - * - * @generated - * @ordered - */ - int ARRAY__BASE_PROPERTY = 2; - - /** - * The feature id for the 'Base association' reference. - * - * - * @generated - * @ordered - */ - int ARRAY__BASE_ASSOCIATION = 3; - - /** - * The number of structural features of the 'Array' class. - * - * - * @generated - * @ordered - */ - int ARRAY_FEATURE_COUNT = 4; - - /** - * The number of operations of the 'Array' class. - * - * - * @generated - * @ordered - */ - int ARRAY_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.ConstImpl Const}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.ConstImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getConst() - * @generated - */ - int CONST = 7; - - /** - * The feature id for the 'Base parameter' reference. - * - * - * @generated - * @ordered - */ - int CONST__BASE_PARAMETER = 0; - - /** - * The feature id for the 'Base property' reference. - * - * - * @generated - * @ordered - */ - int CONST__BASE_PROPERTY = 1; - - /** - * The feature id for the 'Base operation' reference. - * - * - * @generated - * @ordered - */ - int CONST__BASE_OPERATION = 2; - - /** - * The number of structural features of the 'Const' class. - * - * - * @generated - * @ordered - */ - int CONST_FEATURE_COUNT = 3; - - /** - * The number of operations of the 'Const' class. - * - * - * @generated - * @ordered - */ - int CONST_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.RefImpl Ref}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.RefImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getRef() - * @generated - */ - int REF = 8; - - /** - * The feature id for the 'Base parameter' reference. - * - * - * @generated - * @ordered - */ - int REF__BASE_PARAMETER = 0; - - /** - * The feature id for the 'Base property' reference. - * - * - * @generated - * @ordered - */ - int REF__BASE_PROPERTY = 1; - - /** - * The number of structural features of the 'Ref' class. - * - * - * @generated - * @ordered - */ - int REF_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'Ref' class. - * - * - * @generated - * @ordered - */ - int REF_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.ExternalImpl External}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.ExternalImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getExternal() - * @generated - */ - int EXTERNAL = 9; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int EXTERNAL__NAME = 0; - - /** - * The feature id for the 'Base Classifier' reference. - * - * - * @generated - * @ordered - */ - int EXTERNAL__BASE_CLASSIFIER = 1; - - /** - * The number of structural features of the 'External' class. - * - * - * @generated - * @ordered - */ - int EXTERNAL_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'External' class. - * - * - * @generated - * @ordered - */ - int EXTERNAL_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.ConstInitImpl Const Init}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.ConstInitImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getConstInit() - * @generated - */ - int CONST_INIT = 10; - - /** - * The feature id for the 'Initialisation' attribute. - * - * - * @generated - * @ordered - */ - int CONST_INIT__INITIALISATION = 0; - - /** - * The feature id for the 'Base operation' reference. - * - * - * @generated - * @ordered - */ - int CONST_INIT__BASE_OPERATION = 1; - - /** - * The number of structural features of the 'Const Init' class. - * - * - * @generated - * @ordered - */ - int CONST_INIT_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'Const Init' class. - * - * - * @generated - * @ordered - */ - int CONST_INIT_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.FriendImpl Friend}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.FriendImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getFriend() - * @generated - */ - int FRIEND = 11; - - /** - * The feature id for the 'Base dependency' reference. - * - * - * @generated - * @ordered - */ - int FRIEND__BASE_DEPENDENCY = 0; - - /** - * The feature id for the 'Base operation' reference. - * - * - * @generated - * @ordered - */ - int FRIEND__BASE_OPERATION = 1; - - /** - * The number of structural features of the 'Friend' class. - * - * - * @generated - * @ordered - */ - int FRIEND_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'Friend' class. - * - * - * @generated - * @ordered - */ - int FRIEND_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.InlineImpl Inline}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.InlineImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getInline() - * @generated - */ - int INLINE = 12; - - /** - * The feature id for the 'Base operation' reference. - * - * - * @generated - * @ordered - */ - int INLINE__BASE_OPERATION = 0; - - /** - * The number of structural features of the 'Inline' class. - * - * - * @generated - * @ordered - */ - int INLINE_FEATURE_COUNT = 1; - - /** - * The number of operations of the 'Inline' class. - * - * - * @generated - * @ordered - */ - int INLINE_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.VirtualImpl Virtual}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.VirtualImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVirtual() - * @generated - */ - int VIRTUAL = 13; - - /** - * The feature id for the 'Base operation' reference. - * - * - * @generated - * @ordered - */ - int VIRTUAL__BASE_OPERATION = 0; - - /** - * The number of structural features of the 'Virtual' class. - * - * - * @generated - * @ordered - */ - int VIRTUAL_FEATURE_COUNT = 1; - - /** - * The number of operations of the 'Virtual' class. - * - * - * @generated - * @ordered - */ - int VIRTUAL_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.TypedefImpl Typedef}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.TypedefImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTypedef() - * @generated - */ - int TYPEDEF = 14; - - /** - * The feature id for the 'Definition' attribute. - * - * - * @generated - * @ordered - */ - int TYPEDEF__DEFINITION = 0; - - /** - * The feature id for the 'Base primitivetype' reference. - * - * - * @generated - * @ordered - */ - int TYPEDEF__BASE_PRIMITIVETYPE = 1; - - /** - * The number of structural features of the 'Typedef' class. - * - * - * @generated - * @ordered - */ - int TYPEDEF_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'Typedef' class. - * - * - * @generated - * @ordered - */ - int TYPEDEF_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.VisibilityImpl Visibility}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.VisibilityImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVisibility() - * @generated - */ - int VISIBILITY = 15; - - /** - * The feature id for the 'Value' attribute. - * - * - * @generated - * @ordered - */ - int VISIBILITY__VALUE = 0; - - /** - * The feature id for the 'Base generalization' reference. - * - * - * @generated - * @ordered - */ - int VISIBILITY__BASE_GENERALIZATION = 1; - - /** - * The number of structural features of the 'Visibility' class. - * - * - * @generated - * @ordered - */ - int VISIBILITY_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'Visibility' class. - * - * - * @generated - * @ordered - */ - int VISIBILITY_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.CppInitImpl Cpp Init}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.CppInitImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getCppInit() - * @generated - */ - int CPP_INIT = 16; - - /** - * The feature id for the 'Value' attribute. - * - * - * @generated - * @ordered - */ - int CPP_INIT__VALUE = 0; - - /** - * The feature id for the 'Base enumerationliteral' reference. - * - * - * @generated - * @ordered - */ - int CPP_INIT__BASE_ENUMERATIONLITERAL = 1; - - /** - * The number of structural features of the 'Cpp Init' class. - * - * - * @generated - * @ordered - */ - int CPP_INIT_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'Cpp Init' class. - * - * - * @generated - * @ordered - */ - int CPP_INIT_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.TemplateImpl Template}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.TemplateImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTemplate() - * @generated - */ - int TEMPLATE = 17; - - /** - * The feature id for the 'Declaration' attribute. - * - * - * @generated - * @ordered - */ - int TEMPLATE__DECLARATION = 0; - - /** - * The feature id for the 'Base class' reference. - * - * - * @generated - * @ordered - */ - int TEMPLATE__BASE_CLASS = 1; - - /** - * The number of structural features of the 'Template' class. - * - * - * @generated - * @ordered - */ - int TEMPLATE_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'Template' class. - * - * - * @generated - * @ordered - */ - int TEMPLATE_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.TemplateBindingImpl Template Binding}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.TemplateBindingImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTemplateBinding() - * @generated - */ - int TEMPLATE_BINDING = 18; - - /** - * The feature id for the 'Binding' attribute. - * - * - * @generated - * @ordered - */ - int TEMPLATE_BINDING__BINDING = 0; - - /** - * The feature id for the 'Base templatebinding' reference. - * - * - * @generated - * @ordered - */ - int TEMPLATE_BINDING__BASE_TEMPLATEBINDING = 1; - - /** - * The number of structural features of the 'Template Binding' class. - * - * - * @generated - * @ordered - */ - int TEMPLATE_BINDING_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'Template Binding' class. - * - * - * @generated - * @ordered - */ - int TEMPLATE_BINDING_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.TemplateParameterImpl Template Parameter}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.TemplateParameterImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTemplateParameter() - * @generated - */ - int TEMPLATE_PARAMETER = 19; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int TEMPLATE_PARAMETER__NAME = 0; - - /** - * The feature id for the 'Base templateparameter' reference. - * - * - * @generated - * @ordered - */ - int TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER = 1; - - /** - * The number of structural features of the 'Template Parameter' class. - * - * - * @generated - * @ordered - */ - int TEMPLATE_PARAMETER_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'Template Parameter' class. - * - * - * @generated - * @ordered - */ - int TEMPLATE_PARAMETER_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.UnionImpl Union}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.UnionImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getUnion() - * @generated - */ - int UNION = 20; - - /** - * The feature id for the 'Base Data Type' reference. - * - * - * @generated - * @ordered - */ - int UNION__BASE_DATA_TYPE = 0; - - /** - * The number of structural features of the 'Union' class. - * - * - * @generated - * @ordered - */ - int UNION_FEATURE_COUNT = 1; - - /** - * The number of operations of the 'Union' class. - * - * - * @generated - * @ordered - */ - int UNION_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl Storage Class}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getStorageClass() - * @generated - */ - int STORAGE_CLASS = 21; - - /** - * The feature id for the 'Storage Class' attribute. - * - * - * @generated - * @ordered - */ - int STORAGE_CLASS__STORAGE_CLASS = 0; - - /** - * The feature id for the 'Base Property' reference. - * - * - * @generated - * @ordered - */ - int STORAGE_CLASS__BASE_PROPERTY = 1; - - /** - * The feature id for the 'Base Parameter' reference. - * - * - * @generated - * @ordered - */ - int STORAGE_CLASS__BASE_PARAMETER = 2; - - /** - * The number of structural features of the 'Storage Class' class. - * - * - * @generated - * @ordered - */ - int STORAGE_CLASS_FEATURE_COUNT = 3; - - /** - * The number of operations of the 'Storage Class' class. - * - * - * @generated - * @ordered - */ - int STORAGE_CLASS_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.VolatileImpl Volatile}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.VolatileImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVolatile() - * @generated - */ - int VOLATILE = 22; - - /** - * The feature id for the 'Base parameter' reference. - * - * - * @generated - * @ordered - */ - int VOLATILE__BASE_PARAMETER = 0; - - /** - * The feature id for the 'Base property' reference. - * - * - * @generated - * @ordered - */ - int VOLATILE__BASE_PROPERTY = 1; - - /** - * The feature id for the 'Base operation' reference. - * - * - * @generated - * @ordered - */ - int VOLATILE__BASE_OPERATION = 2; - - /** - * The number of structural features of the 'Volatile' class. - * - * - * @generated - * @ordered - */ - int VOLATILE_FEATURE_COUNT = 3; - - /** - * The number of operations of the 'Volatile' class. - * - * - * @generated - * @ordered - */ - int VOLATILE_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.VariadicImpl Variadic}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.VariadicImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVariadic() - * @generated - */ - int VARIADIC = 23; - - /** - * The feature id for the 'Base operation' reference. - * - * - * @generated - * @ordered - */ - int VARIADIC__BASE_OPERATION = 0; - - /** - * The number of structural features of the 'Variadic' class. - * - * - * @generated - * @ordered - */ - int VARIADIC_FEATURE_COUNT = 1; - - /** - * The number of operations of the 'Variadic' class. - * - * - * @generated - * @ordered - */ - int VARIADIC_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.MutableImpl Mutable}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.MutableImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getMutable() - * @generated - */ - int MUTABLE = 24; - - /** - * The feature id for the 'Base property' reference. - * - * - * @generated - * @ordered - */ - int MUTABLE__BASE_PROPERTY = 0; - - /** - * The number of structural features of the 'Mutable' class. - * - * - * @generated - * @ordered - */ - int MUTABLE_FEATURE_COUNT = 1; - - /** - * The number of operations of the 'Mutable' class. - * - * - * @generated - * @ordered - */ - int MUTABLE_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.VisibilityKind Visibility Kind}' enum. - * - * - * @see org.eclipse.papyrus.C_Cpp.VisibilityKind - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVisibilityKind() - * @generated - */ - int VISIBILITY_KIND = 25; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.EAccessKind EAccess Kind}' enum. - * - * - * @see org.eclipse.papyrus.C_Cpp.EAccessKind - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getEAccessKind() - * @generated - */ - int EACCESS_KIND = 26; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.EStorageClass EStorage Class}' enum. - * - * - * @see org.eclipse.papyrus.C_Cpp.EStorageClass - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getEStorageClass() - * @generated - */ - int ESTORAGE_CLASS = 27; - - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Ptr Ptr}'. - * - * - * @return the meta object for class 'Ptr'. - * @see org.eclipse.papyrus.C_Cpp.Ptr - * @generated - */ - EClass getPtr(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Ptr#getBase_parameter Base parameter}'. - * - * - * @return the meta object for the reference 'Base parameter'. - * @see org.eclipse.papyrus.C_Cpp.Ptr#getBase_parameter() - * @see #getPtr() - * @generated - */ - EReference getPtr_Base_parameter(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Ptr#getBase_property Base property}'. - * - * - * @return the meta object for the reference 'Base property'. - * @see org.eclipse.papyrus.C_Cpp.Ptr#getBase_property() - * @see #getPtr() - * @generated - */ - EReference getPtr_Base_property(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Ptr#getDeclaration Declaration}'. - * - * - * @return the meta object for the attribute 'Declaration'. - * @see org.eclipse.papyrus.C_Cpp.Ptr#getDeclaration() - * @see #getPtr() - * @generated - */ - EAttribute getPtr_Declaration(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Include Include}'. - * - * - * @return the meta object for class 'Include'. - * @see org.eclipse.papyrus.C_Cpp.Include - * @generated - */ - EClass getInclude(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Include#getBody Body}'. - * - * - * @return the meta object for the attribute 'Body'. - * @see org.eclipse.papyrus.C_Cpp.Include#getBody() - * @see #getInclude() - * @generated - */ - EAttribute getInclude_Body(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Include#getPreBody Pre Body}'. - * - * - * @return the meta object for the attribute 'Pre Body'. - * @see org.eclipse.papyrus.C_Cpp.Include#getPreBody() - * @see #getInclude() - * @generated - */ - EAttribute getInclude_PreBody(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Include#getHeader Header}'. - * - * - * @return the meta object for the attribute 'Header'. - * @see org.eclipse.papyrus.C_Cpp.Include#getHeader() - * @see #getInclude() - * @generated - */ - EAttribute getInclude_Header(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Include#getBase_package Base package}'. - * - * - * @return the meta object for the reference 'Base package'. - * @see org.eclipse.papyrus.C_Cpp.Include#getBase_package() - * @see #getInclude() - * @generated - */ - EReference getInclude_Base_package(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Include#getBase_class Base class}'. - * - * - * @return the meta object for the reference 'Base class'. - * @see org.eclipse.papyrus.C_Cpp.Include#getBase_class() - * @see #getInclude() - * @generated - */ - EReference getInclude_Base_class(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Include#getBase_Classifier Base Classifier}'. - * - * - * @return the meta object for the reference 'Base Classifier'. - * @see org.eclipse.papyrus.C_Cpp.Include#getBase_Classifier() - * @see #getInclude() - * @generated - */ - EReference getInclude_Base_Classifier(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.ManualGeneration Manual Generation}'. - * - * - * @return the meta object for class 'Manual Generation'. - * @see org.eclipse.papyrus.C_Cpp.ManualGeneration - * @generated - */ - EClass getManualGeneration(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.ManualGeneration#getExtensionBody Extension Body}'. - * - * - * @return the meta object for the attribute 'Extension Body'. - * @see org.eclipse.papyrus.C_Cpp.ManualGeneration#getExtensionBody() - * @see #getManualGeneration() - * @generated - */ - EAttribute getManualGeneration_ExtensionBody(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.ManualGeneration#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.C_Cpp.ManualGeneration#getBase_Class() - * @see #getManualGeneration() - * @generated - */ - EReference getManualGeneration_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary Extern Library}'. - * - * - * @return the meta object for class 'Extern Library'. - * @see org.eclipse.papyrus.C_Cpp.ExternLibrary - * @generated - */ - EClass getExternLibrary(); - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getIncludePaths Include Paths}'. - * - * - * @return the meta object for the attribute list 'Include Paths'. - * @see org.eclipse.papyrus.C_Cpp.ExternLibrary#getIncludePaths() - * @see #getExternLibrary() - * @generated - */ - EAttribute getExternLibrary_IncludePaths(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getBase_package Base package}'. - * - * - * @return the meta object for the reference 'Base package'. - * @see org.eclipse.papyrus.C_Cpp.ExternLibrary#getBase_package() - * @see #getExternLibrary() - * @generated - */ - EReference getExternLibrary_Base_package(); - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getLibPaths Lib Paths}'. - * - * - * @return the meta object for the attribute list 'Lib Paths'. - * @see org.eclipse.papyrus.C_Cpp.ExternLibrary#getLibPaths() - * @see #getExternLibrary() - * @generated - */ - EAttribute getExternLibrary_LibPaths(); - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getMacros Macros}'. - * - * - * @return the meta object for the attribute list 'Macros'. - * @see org.eclipse.papyrus.C_Cpp.ExternLibrary#getMacros() - * @see #getExternLibrary() - * @generated - */ - EAttribute getExternLibrary_Macros(); - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getLibs Libs}'. - * - * - * @return the meta object for the attribute list 'Libs'. - * @see org.eclipse.papyrus.C_Cpp.ExternLibrary#getLibs() - * @see #getExternLibrary() - * @generated - */ - EAttribute getExternLibrary_Libs(); - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getIncludes Includes}'. - * - * - * @return the meta object for the attribute list 'Includes'. - * @see org.eclipse.papyrus.C_Cpp.ExternLibrary#getIncludes() - * @see #getExternLibrary() - * @generated - */ - EAttribute getExternLibrary_Includes(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.NoCodeGen No Code Gen}'. - * - * - * @return the meta object for class 'No Code Gen'. - * @see org.eclipse.papyrus.C_Cpp.NoCodeGen - * @generated - */ - EClass getNoCodeGen(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.NoCodeGen#getBase_element Base element}'. - * - * - * @return the meta object for the reference 'Base element'. - * @see org.eclipse.papyrus.C_Cpp.NoCodeGen#getBase_element() - * @see #getNoCodeGen() - * @generated - */ - EReference getNoCodeGen_Base_element(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.CppRoot Cpp Root}'. - * - * - * @return the meta object for class 'Cpp Root'. - * @see org.eclipse.papyrus.C_Cpp.CppRoot - * @generated - */ - EClass getCppRoot(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.CppRoot#getBase_package Base package}'. - * - * - * @return the meta object for the reference 'Base package'. - * @see org.eclipse.papyrus.C_Cpp.CppRoot#getBase_package() - * @see #getCppRoot() - * @generated - */ - EReference getCppRoot_Base_package(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Array Array}'. - * - * - * @return the meta object for class 'Array'. - * @see org.eclipse.papyrus.C_Cpp.Array - * @generated - */ - EClass getArray(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Array#getBase_parameter Base parameter}'. - * - * - * @return the meta object for the reference 'Base parameter'. - * @see org.eclipse.papyrus.C_Cpp.Array#getBase_parameter() - * @see #getArray() - * @generated - */ - EReference getArray_Base_parameter(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Array#getDefinition Definition}'. - * - * - * @return the meta object for the attribute 'Definition'. - * @see org.eclipse.papyrus.C_Cpp.Array#getDefinition() - * @see #getArray() - * @generated - */ - EAttribute getArray_Definition(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Array#getBase_property Base property}'. - * - * - * @return the meta object for the reference 'Base property'. - * @see org.eclipse.papyrus.C_Cpp.Array#getBase_property() - * @see #getArray() - * @generated - */ - EReference getArray_Base_property(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Array#getBase_association Base association}'. - * - * - * @return the meta object for the reference 'Base association'. - * @see org.eclipse.papyrus.C_Cpp.Array#getBase_association() - * @see #getArray() - * @generated - */ - EReference getArray_Base_association(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Const Const}'. - * - * - * @return the meta object for class 'Const'. - * @see org.eclipse.papyrus.C_Cpp.Const - * @generated - */ - EClass getConst(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Const#getBase_parameter Base parameter}'. - * - * - * @return the meta object for the reference 'Base parameter'. - * @see org.eclipse.papyrus.C_Cpp.Const#getBase_parameter() - * @see #getConst() - * @generated - */ - EReference getConst_Base_parameter(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Const#getBase_property Base property}'. - * - * - * @return the meta object for the reference 'Base property'. - * @see org.eclipse.papyrus.C_Cpp.Const#getBase_property() - * @see #getConst() - * @generated - */ - EReference getConst_Base_property(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Const#getBase_operation Base operation}'. - * - * - * @return the meta object for the reference 'Base operation'. - * @see org.eclipse.papyrus.C_Cpp.Const#getBase_operation() - * @see #getConst() - * @generated - */ - EReference getConst_Base_operation(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Ref Ref}'. - * - * - * @return the meta object for class 'Ref'. - * @see org.eclipse.papyrus.C_Cpp.Ref - * @generated - */ - EClass getRef(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Ref#getBase_parameter Base parameter}'. - * - * - * @return the meta object for the reference 'Base parameter'. - * @see org.eclipse.papyrus.C_Cpp.Ref#getBase_parameter() - * @see #getRef() - * @generated - */ - EReference getRef_Base_parameter(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Ref#getBase_property Base property}'. - * - * - * @return the meta object for the reference 'Base property'. - * @see org.eclipse.papyrus.C_Cpp.Ref#getBase_property() - * @see #getRef() - * @generated - */ - EReference getRef_Base_property(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.External External}'. - * - * - * @return the meta object for class 'External'. - * @see org.eclipse.papyrus.C_Cpp.External - * @generated - */ - EClass getExternal(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.External#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.papyrus.C_Cpp.External#getName() - * @see #getExternal() - * @generated - */ - EAttribute getExternal_Name(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.External#getBase_Classifier Base Classifier}'. - * - * - * @return the meta object for the reference 'Base Classifier'. - * @see org.eclipse.papyrus.C_Cpp.External#getBase_Classifier() - * @see #getExternal() - * @generated - */ - EReference getExternal_Base_Classifier(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.ConstInit Const Init}'. - * - * - * @return the meta object for class 'Const Init'. - * @see org.eclipse.papyrus.C_Cpp.ConstInit - * @generated - */ - EClass getConstInit(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.ConstInit#getInitialisation Initialisation}'. - * - * - * @return the meta object for the attribute 'Initialisation'. - * @see org.eclipse.papyrus.C_Cpp.ConstInit#getInitialisation() - * @see #getConstInit() - * @generated - */ - EAttribute getConstInit_Initialisation(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.ConstInit#getBase_operation Base operation}'. - * - * - * @return the meta object for the reference 'Base operation'. - * @see org.eclipse.papyrus.C_Cpp.ConstInit#getBase_operation() - * @see #getConstInit() - * @generated - */ - EReference getConstInit_Base_operation(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Friend Friend}'. - * - * - * @return the meta object for class 'Friend'. - * @see org.eclipse.papyrus.C_Cpp.Friend - * @generated - */ - EClass getFriend(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Friend#getBase_dependency Base dependency}'. - * - * - * @return the meta object for the reference 'Base dependency'. - * @see org.eclipse.papyrus.C_Cpp.Friend#getBase_dependency() - * @see #getFriend() - * @generated - */ - EReference getFriend_Base_dependency(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Friend#getBase_operation Base operation}'. - * - * - * @return the meta object for the reference 'Base operation'. - * @see org.eclipse.papyrus.C_Cpp.Friend#getBase_operation() - * @see #getFriend() - * @generated - */ - EReference getFriend_Base_operation(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Inline Inline}'. - * - * - * @return the meta object for class 'Inline'. - * @see org.eclipse.papyrus.C_Cpp.Inline - * @generated - */ - EClass getInline(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Inline#getBase_operation Base operation}'. - * - * - * @return the meta object for the reference 'Base operation'. - * @see org.eclipse.papyrus.C_Cpp.Inline#getBase_operation() - * @see #getInline() - * @generated - */ - EReference getInline_Base_operation(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Virtual Virtual}'. - * - * - * @return the meta object for class 'Virtual'. - * @see org.eclipse.papyrus.C_Cpp.Virtual - * @generated - */ - EClass getVirtual(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Virtual#getBase_operation Base operation}'. - * - * - * @return the meta object for the reference 'Base operation'. - * @see org.eclipse.papyrus.C_Cpp.Virtual#getBase_operation() - * @see #getVirtual() - * @generated - */ - EReference getVirtual_Base_operation(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Typedef Typedef}'. - * - * - * @return the meta object for class 'Typedef'. - * @see org.eclipse.papyrus.C_Cpp.Typedef - * @generated - */ - EClass getTypedef(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Typedef#getDefinition Definition}'. - * - * - * @return the meta object for the attribute 'Definition'. - * @see org.eclipse.papyrus.C_Cpp.Typedef#getDefinition() - * @see #getTypedef() - * @generated - */ - EAttribute getTypedef_Definition(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Typedef#getBase_primitivetype Base primitivetype}'. - * - * - * @return the meta object for the reference 'Base primitivetype'. - * @see org.eclipse.papyrus.C_Cpp.Typedef#getBase_primitivetype() - * @see #getTypedef() - * @generated - */ - EReference getTypedef_Base_primitivetype(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Visibility Visibility}'. - * - * - * @return the meta object for class 'Visibility'. - * @see org.eclipse.papyrus.C_Cpp.Visibility - * @generated - */ - EClass getVisibility(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Visibility#getValue Value}'. - * - * - * @return the meta object for the attribute 'Value'. - * @see org.eclipse.papyrus.C_Cpp.Visibility#getValue() - * @see #getVisibility() - * @generated - */ - EAttribute getVisibility_Value(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Visibility#getBase_generalization Base generalization}'. - * - * - * @return the meta object for the reference 'Base generalization'. - * @see org.eclipse.papyrus.C_Cpp.Visibility#getBase_generalization() - * @see #getVisibility() - * @generated - */ - EReference getVisibility_Base_generalization(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.CppInit Cpp Init}'. - * - * - * @return the meta object for class 'Cpp Init'. - * @see org.eclipse.papyrus.C_Cpp.CppInit - * @generated - */ - EClass getCppInit(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.CppInit#getValue Value}'. - * - * - * @return the meta object for the attribute 'Value'. - * @see org.eclipse.papyrus.C_Cpp.CppInit#getValue() - * @see #getCppInit() - * @generated - */ - EAttribute getCppInit_Value(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.CppInit#getBase_enumerationliteral Base enumerationliteral}'. - * - * - * @return the meta object for the reference 'Base enumerationliteral'. - * @see org.eclipse.papyrus.C_Cpp.CppInit#getBase_enumerationliteral() - * @see #getCppInit() - * @generated - */ - EReference getCppInit_Base_enumerationliteral(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Template Template}'. - * - * - * @return the meta object for class 'Template'. - * @see org.eclipse.papyrus.C_Cpp.Template - * @generated - */ - EClass getTemplate(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Template#getDeclaration Declaration}'. - * - * - * @return the meta object for the attribute 'Declaration'. - * @see org.eclipse.papyrus.C_Cpp.Template#getDeclaration() - * @see #getTemplate() - * @generated - */ - EAttribute getTemplate_Declaration(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Template#getBase_class Base class}'. - * - * - * @return the meta object for the reference 'Base class'. - * @see org.eclipse.papyrus.C_Cpp.Template#getBase_class() - * @see #getTemplate() - * @generated - */ - EReference getTemplate_Base_class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.TemplateBinding Template Binding}'. - * - * - * @return the meta object for class 'Template Binding'. - * @see org.eclipse.papyrus.C_Cpp.TemplateBinding - * @generated - */ - EClass getTemplateBinding(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.TemplateBinding#getBinding Binding}'. - * - * - * @return the meta object for the attribute 'Binding'. - * @see org.eclipse.papyrus.C_Cpp.TemplateBinding#getBinding() - * @see #getTemplateBinding() - * @generated - */ - EAttribute getTemplateBinding_Binding(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.TemplateBinding#getBase_templatebinding Base templatebinding}'. - * - * - * @return the meta object for the reference 'Base templatebinding'. - * @see org.eclipse.papyrus.C_Cpp.TemplateBinding#getBase_templatebinding() - * @see #getTemplateBinding() - * @generated - */ - EReference getTemplateBinding_Base_templatebinding(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.TemplateParameter Template Parameter}'. - * - * - * @return the meta object for class 'Template Parameter'. - * @see org.eclipse.papyrus.C_Cpp.TemplateParameter - * @generated - */ - EClass getTemplateParameter(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.TemplateParameter#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.papyrus.C_Cpp.TemplateParameter#getName() - * @see #getTemplateParameter() - * @generated - */ - EAttribute getTemplateParameter_Name(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.TemplateParameter#getBase_templateparameter Base templateparameter}'. - * - * - * @return the meta object for the reference 'Base templateparameter'. - * @see org.eclipse.papyrus.C_Cpp.TemplateParameter#getBase_templateparameter() - * @see #getTemplateParameter() - * @generated - */ - EReference getTemplateParameter_Base_templateparameter(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Union Union}'. - * - * - * @return the meta object for class 'Union'. - * @see org.eclipse.papyrus.C_Cpp.Union - * @generated - */ - EClass getUnion(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Union#getBase_DataType Base Data Type}'. - * - * - * @return the meta object for the reference 'Base Data Type'. - * @see org.eclipse.papyrus.C_Cpp.Union#getBase_DataType() - * @see #getUnion() - * @generated - */ - EReference getUnion_Base_DataType(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.StorageClass Storage Class}'. - * - * - * @return the meta object for class 'Storage Class'. - * @see org.eclipse.papyrus.C_Cpp.StorageClass - * @generated - */ - EClass getStorageClass(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.StorageClass#getStorageClass Storage Class}'. - * - * - * @return the meta object for the attribute 'Storage Class'. - * @see org.eclipse.papyrus.C_Cpp.StorageClass#getStorageClass() - * @see #getStorageClass() - * @generated - */ - EAttribute getStorageClass_StorageClass(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Property Base Property}'. - * - * - * @return the meta object for the reference 'Base Property'. - * @see org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Property() - * @see #getStorageClass() - * @generated - */ - EReference getStorageClass_Base_Property(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Parameter Base Parameter}'. - * - * - * @return the meta object for the reference 'Base Parameter'. - * @see org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Parameter() - * @see #getStorageClass() - * @generated - */ - EReference getStorageClass_Base_Parameter(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Volatile Volatile}'. - * - * - * @return the meta object for class 'Volatile'. - * @see org.eclipse.papyrus.C_Cpp.Volatile - * @generated - */ - EClass getVolatile(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_parameter Base parameter}'. - * - * - * @return the meta object for the reference 'Base parameter'. - * @see org.eclipse.papyrus.C_Cpp.Volatile#getBase_parameter() - * @see #getVolatile() - * @generated - */ - EReference getVolatile_Base_parameter(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_property Base property}'. - * - * - * @return the meta object for the reference 'Base property'. - * @see org.eclipse.papyrus.C_Cpp.Volatile#getBase_property() - * @see #getVolatile() - * @generated - */ - EReference getVolatile_Base_property(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_operation Base operation}'. - * - * - * @return the meta object for the reference 'Base operation'. - * @see org.eclipse.papyrus.C_Cpp.Volatile#getBase_operation() - * @see #getVolatile() - * @generated - */ - EReference getVolatile_Base_operation(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Variadic Variadic}'. - * - * - * @return the meta object for class 'Variadic'. - * @see org.eclipse.papyrus.C_Cpp.Variadic - * @generated - */ - EClass getVariadic(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Variadic#getBase_operation Base operation}'. - * - * - * @return the meta object for the reference 'Base operation'. - * @see org.eclipse.papyrus.C_Cpp.Variadic#getBase_operation() - * @see #getVariadic() - * @generated - */ - EReference getVariadic_Base_operation(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Mutable Mutable}'. - * - * - * @return the meta object for class 'Mutable'. - * @see org.eclipse.papyrus.C_Cpp.Mutable - * @generated - */ - EClass getMutable(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Mutable#getBase_property Base property}'. - * - * - * @return the meta object for the reference 'Base property'. - * @see org.eclipse.papyrus.C_Cpp.Mutable#getBase_property() - * @see #getMutable() - * @generated - */ - EReference getMutable_Base_property(); - - /** - * Returns the meta object for enum '{@link org.eclipse.papyrus.C_Cpp.VisibilityKind Visibility Kind}'. - * - * - * @return the meta object for enum 'Visibility Kind'. - * @see org.eclipse.papyrus.C_Cpp.VisibilityKind - * @generated - */ - EEnum getVisibilityKind(); - - /** - * Returns the meta object for enum '{@link org.eclipse.papyrus.C_Cpp.EAccessKind EAccess Kind}'. - * - * - * @return the meta object for enum 'EAccess Kind'. - * @see org.eclipse.papyrus.C_Cpp.EAccessKind - * @generated - */ - EEnum getEAccessKind(); - - /** - * Returns the meta object for enum '{@link org.eclipse.papyrus.C_Cpp.EStorageClass EStorage Class}'. - * - * - * @return the meta object for enum 'EStorage Class'. - * @see org.eclipse.papyrus.C_Cpp.EStorageClass - * @generated - */ - EEnum getEStorageClass(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - C_CppFactory getC_CppFactory(); - - /** - * - * Defines literals for the meta objects that represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - interface Literals { - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.PtrImpl Ptr}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.PtrImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getPtr() - * @generated - */ - EClass PTR = eINSTANCE.getPtr(); - - /** - * The meta object literal for the 'Base parameter' reference feature. - * - * - * @generated - */ - EReference PTR__BASE_PARAMETER = eINSTANCE.getPtr_Base_parameter(); - - /** - * The meta object literal for the 'Base property' reference feature. - * - * - * @generated - */ - EReference PTR__BASE_PROPERTY = eINSTANCE.getPtr_Base_property(); - - /** - * The meta object literal for the 'Declaration' attribute feature. - * - * - * @generated - */ - EAttribute PTR__DECLARATION = eINSTANCE.getPtr_Declaration(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl Include}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.IncludeImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getInclude() - * @generated - */ - EClass INCLUDE = eINSTANCE.getInclude(); - - /** - * The meta object literal for the 'Body' attribute feature. - * - * - * @generated - */ - EAttribute INCLUDE__BODY = eINSTANCE.getInclude_Body(); - - /** - * The meta object literal for the 'Pre Body' attribute feature. - * - * - * @generated - */ - EAttribute INCLUDE__PRE_BODY = eINSTANCE.getInclude_PreBody(); - - /** - * The meta object literal for the 'Header' attribute feature. - * - * - * @generated - */ - EAttribute INCLUDE__HEADER = eINSTANCE.getInclude_Header(); - - /** - * The meta object literal for the 'Base package' reference feature. - * - * - * @generated - */ - EReference INCLUDE__BASE_PACKAGE = eINSTANCE.getInclude_Base_package(); - - /** - * The meta object literal for the 'Base class' reference feature. - * - * - * @generated - */ - EReference INCLUDE__BASE_CLASS = eINSTANCE.getInclude_Base_class(); - - /** - * The meta object literal for the 'Base Classifier' reference feature. - * - * - * @generated - */ - EReference INCLUDE__BASE_CLASSIFIER = eINSTANCE.getInclude_Base_Classifier(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.ManualGenerationImpl Manual Generation}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.ManualGenerationImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getManualGeneration() - * @generated - */ - EClass MANUAL_GENERATION = eINSTANCE.getManualGeneration(); - - /** - * The meta object literal for the 'Extension Body' attribute feature. - * - * - * @generated - */ - EAttribute MANUAL_GENERATION__EXTENSION_BODY = eINSTANCE.getManualGeneration_ExtensionBody(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference MANUAL_GENERATION__BASE_CLASS = eINSTANCE.getManualGeneration_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl Extern Library}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getExternLibrary() - * @generated - */ - EClass EXTERN_LIBRARY = eINSTANCE.getExternLibrary(); - - /** - * The meta object literal for the 'Include Paths' attribute list feature. - * - * - * @generated - */ - EAttribute EXTERN_LIBRARY__INCLUDE_PATHS = eINSTANCE.getExternLibrary_IncludePaths(); - - /** - * The meta object literal for the 'Base package' reference feature. - * - * - * @generated - */ - EReference EXTERN_LIBRARY__BASE_PACKAGE = eINSTANCE.getExternLibrary_Base_package(); - - /** - * The meta object literal for the 'Lib Paths' attribute list feature. - * - * - * @generated - */ - EAttribute EXTERN_LIBRARY__LIB_PATHS = eINSTANCE.getExternLibrary_LibPaths(); - - /** - * The meta object literal for the 'Macros' attribute list feature. - * - * - * @generated - */ - EAttribute EXTERN_LIBRARY__MACROS = eINSTANCE.getExternLibrary_Macros(); - - /** - * The meta object literal for the 'Libs' attribute list feature. - * - * - * @generated - */ - EAttribute EXTERN_LIBRARY__LIBS = eINSTANCE.getExternLibrary_Libs(); - - /** - * The meta object literal for the 'Includes' attribute list feature. - * - * - * @generated - */ - EAttribute EXTERN_LIBRARY__INCLUDES = eINSTANCE.getExternLibrary_Includes(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.NoCodeGenImpl No Code Gen}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.NoCodeGenImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getNoCodeGen() - * @generated - */ - EClass NO_CODE_GEN = eINSTANCE.getNoCodeGen(); - - /** - * The meta object literal for the 'Base element' reference feature. - * - * - * @generated - */ - EReference NO_CODE_GEN__BASE_ELEMENT = eINSTANCE.getNoCodeGen_Base_element(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.CppRootImpl Cpp Root}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.CppRootImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getCppRoot() - * @generated - */ - EClass CPP_ROOT = eINSTANCE.getCppRoot(); - - /** - * The meta object literal for the 'Base package' reference feature. - * - * - * @generated - */ - EReference CPP_ROOT__BASE_PACKAGE = eINSTANCE.getCppRoot_Base_package(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.ArrayImpl Array}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.ArrayImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getArray() - * @generated - */ - EClass ARRAY = eINSTANCE.getArray(); - - /** - * The meta object literal for the 'Base parameter' reference feature. - * - * - * @generated - */ - EReference ARRAY__BASE_PARAMETER = eINSTANCE.getArray_Base_parameter(); - - /** - * The meta object literal for the 'Definition' attribute feature. - * - * - * @generated - */ - EAttribute ARRAY__DEFINITION = eINSTANCE.getArray_Definition(); - - /** - * The meta object literal for the 'Base property' reference feature. - * - * - * @generated - */ - EReference ARRAY__BASE_PROPERTY = eINSTANCE.getArray_Base_property(); - - /** - * The meta object literal for the 'Base association' reference feature. - * - * - * @generated - */ - EReference ARRAY__BASE_ASSOCIATION = eINSTANCE.getArray_Base_association(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.ConstImpl Const}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.ConstImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getConst() - * @generated - */ - EClass CONST = eINSTANCE.getConst(); - - /** - * The meta object literal for the 'Base parameter' reference feature. - * - * - * @generated - */ - EReference CONST__BASE_PARAMETER = eINSTANCE.getConst_Base_parameter(); - - /** - * The meta object literal for the 'Base property' reference feature. - * - * - * @generated - */ - EReference CONST__BASE_PROPERTY = eINSTANCE.getConst_Base_property(); - - /** - * The meta object literal for the 'Base operation' reference feature. - * - * - * @generated - */ - EReference CONST__BASE_OPERATION = eINSTANCE.getConst_Base_operation(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.RefImpl Ref}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.RefImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getRef() - * @generated - */ - EClass REF = eINSTANCE.getRef(); - - /** - * The meta object literal for the 'Base parameter' reference feature. - * - * - * @generated - */ - EReference REF__BASE_PARAMETER = eINSTANCE.getRef_Base_parameter(); - - /** - * The meta object literal for the 'Base property' reference feature. - * - * - * @generated - */ - EReference REF__BASE_PROPERTY = eINSTANCE.getRef_Base_property(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.ExternalImpl External}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.ExternalImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getExternal() - * @generated - */ - EClass EXTERNAL = eINSTANCE.getExternal(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - EAttribute EXTERNAL__NAME = eINSTANCE.getExternal_Name(); - - /** - * The meta object literal for the 'Base Classifier' reference feature. - * - * - * @generated - */ - EReference EXTERNAL__BASE_CLASSIFIER = eINSTANCE.getExternal_Base_Classifier(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.ConstInitImpl Const Init}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.ConstInitImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getConstInit() - * @generated - */ - EClass CONST_INIT = eINSTANCE.getConstInit(); - - /** - * The meta object literal for the 'Initialisation' attribute feature. - * - * - * @generated - */ - EAttribute CONST_INIT__INITIALISATION = eINSTANCE.getConstInit_Initialisation(); - - /** - * The meta object literal for the 'Base operation' reference feature. - * - * - * @generated - */ - EReference CONST_INIT__BASE_OPERATION = eINSTANCE.getConstInit_Base_operation(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.FriendImpl Friend}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.FriendImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getFriend() - * @generated - */ - EClass FRIEND = eINSTANCE.getFriend(); - - /** - * The meta object literal for the 'Base dependency' reference feature. - * - * - * @generated - */ - EReference FRIEND__BASE_DEPENDENCY = eINSTANCE.getFriend_Base_dependency(); - - /** - * The meta object literal for the 'Base operation' reference feature. - * - * - * @generated - */ - EReference FRIEND__BASE_OPERATION = eINSTANCE.getFriend_Base_operation(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.InlineImpl Inline}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.InlineImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getInline() - * @generated - */ - EClass INLINE = eINSTANCE.getInline(); - - /** - * The meta object literal for the 'Base operation' reference feature. - * - * - * @generated - */ - EReference INLINE__BASE_OPERATION = eINSTANCE.getInline_Base_operation(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.VirtualImpl Virtual}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.VirtualImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVirtual() - * @generated - */ - EClass VIRTUAL = eINSTANCE.getVirtual(); - - /** - * The meta object literal for the 'Base operation' reference feature. - * - * - * @generated - */ - EReference VIRTUAL__BASE_OPERATION = eINSTANCE.getVirtual_Base_operation(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.TypedefImpl Typedef}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.TypedefImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTypedef() - * @generated - */ - EClass TYPEDEF = eINSTANCE.getTypedef(); - - /** - * The meta object literal for the 'Definition' attribute feature. - * - * - * @generated - */ - EAttribute TYPEDEF__DEFINITION = eINSTANCE.getTypedef_Definition(); - - /** - * The meta object literal for the 'Base primitivetype' reference feature. - * - * - * @generated - */ - EReference TYPEDEF__BASE_PRIMITIVETYPE = eINSTANCE.getTypedef_Base_primitivetype(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.VisibilityImpl Visibility}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.VisibilityImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVisibility() - * @generated - */ - EClass VISIBILITY = eINSTANCE.getVisibility(); - - /** - * The meta object literal for the 'Value' attribute feature. - * - * - * @generated - */ - EAttribute VISIBILITY__VALUE = eINSTANCE.getVisibility_Value(); - - /** - * The meta object literal for the 'Base generalization' reference feature. - * - * - * @generated - */ - EReference VISIBILITY__BASE_GENERALIZATION = eINSTANCE.getVisibility_Base_generalization(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.CppInitImpl Cpp Init}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.CppInitImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getCppInit() - * @generated - */ - EClass CPP_INIT = eINSTANCE.getCppInit(); - - /** - * The meta object literal for the 'Value' attribute feature. - * - * - * @generated - */ - EAttribute CPP_INIT__VALUE = eINSTANCE.getCppInit_Value(); - - /** - * The meta object literal for the 'Base enumerationliteral' reference feature. - * - * - * @generated - */ - EReference CPP_INIT__BASE_ENUMERATIONLITERAL = eINSTANCE.getCppInit_Base_enumerationliteral(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.TemplateImpl Template}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.TemplateImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTemplate() - * @generated - */ - EClass TEMPLATE = eINSTANCE.getTemplate(); - - /** - * The meta object literal for the 'Declaration' attribute feature. - * - * - * @generated - */ - EAttribute TEMPLATE__DECLARATION = eINSTANCE.getTemplate_Declaration(); - - /** - * The meta object literal for the 'Base class' reference feature. - * - * - * @generated - */ - EReference TEMPLATE__BASE_CLASS = eINSTANCE.getTemplate_Base_class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.TemplateBindingImpl Template Binding}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.TemplateBindingImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTemplateBinding() - * @generated - */ - EClass TEMPLATE_BINDING = eINSTANCE.getTemplateBinding(); - - /** - * The meta object literal for the 'Binding' attribute feature. - * - * - * @generated - */ - EAttribute TEMPLATE_BINDING__BINDING = eINSTANCE.getTemplateBinding_Binding(); - - /** - * The meta object literal for the 'Base templatebinding' reference feature. - * - * - * @generated - */ - EReference TEMPLATE_BINDING__BASE_TEMPLATEBINDING = eINSTANCE.getTemplateBinding_Base_templatebinding(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.TemplateParameterImpl Template Parameter}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.TemplateParameterImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTemplateParameter() - * @generated - */ - EClass TEMPLATE_PARAMETER = eINSTANCE.getTemplateParameter(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - EAttribute TEMPLATE_PARAMETER__NAME = eINSTANCE.getTemplateParameter_Name(); - - /** - * The meta object literal for the 'Base templateparameter' reference feature. - * - * - * @generated - */ - EReference TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER = eINSTANCE.getTemplateParameter_Base_templateparameter(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.UnionImpl Union}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.UnionImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getUnion() - * @generated - */ - EClass UNION = eINSTANCE.getUnion(); - - /** - * The meta object literal for the 'Base Data Type' reference feature. - * - * - * @generated - */ - EReference UNION__BASE_DATA_TYPE = eINSTANCE.getUnion_Base_DataType(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl Storage Class}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getStorageClass() - * @generated - */ - EClass STORAGE_CLASS = eINSTANCE.getStorageClass(); - - /** - * The meta object literal for the 'Storage Class' attribute feature. - * - * - * @generated - */ - EAttribute STORAGE_CLASS__STORAGE_CLASS = eINSTANCE.getStorageClass_StorageClass(); - - /** - * The meta object literal for the 'Base Property' reference feature. - * - * - * @generated - */ - EReference STORAGE_CLASS__BASE_PROPERTY = eINSTANCE.getStorageClass_Base_Property(); - - /** - * The meta object literal for the 'Base Parameter' reference feature. - * - * - * @generated - */ - EReference STORAGE_CLASS__BASE_PARAMETER = eINSTANCE.getStorageClass_Base_Parameter(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.VolatileImpl Volatile}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.VolatileImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVolatile() - * @generated - */ - EClass VOLATILE = eINSTANCE.getVolatile(); - - /** - * The meta object literal for the 'Base parameter' reference feature. - * - * - * @generated - */ - EReference VOLATILE__BASE_PARAMETER = eINSTANCE.getVolatile_Base_parameter(); - - /** - * The meta object literal for the 'Base property' reference feature. - * - * - * @generated - */ - EReference VOLATILE__BASE_PROPERTY = eINSTANCE.getVolatile_Base_property(); - - /** - * The meta object literal for the 'Base operation' reference feature. - * - * - * @generated - */ - EReference VOLATILE__BASE_OPERATION = eINSTANCE.getVolatile_Base_operation(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.VariadicImpl Variadic}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.VariadicImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVariadic() - * @generated - */ - EClass VARIADIC = eINSTANCE.getVariadic(); - - /** - * The meta object literal for the 'Base operation' reference feature. - * - * - * @generated - */ - EReference VARIADIC__BASE_OPERATION = eINSTANCE.getVariadic_Base_operation(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.MutableImpl Mutable}' class. - * - * - * @see org.eclipse.papyrus.C_Cpp.impl.MutableImpl - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getMutable() - * @generated - */ - EClass MUTABLE = eINSTANCE.getMutable(); - - /** - * The meta object literal for the 'Base property' reference feature. - * - * - * @generated - */ - EReference MUTABLE__BASE_PROPERTY = eINSTANCE.getMutable_Base_property(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.VisibilityKind Visibility Kind}' enum. - * - * - * @see org.eclipse.papyrus.C_Cpp.VisibilityKind - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVisibilityKind() - * @generated - */ - EEnum VISIBILITY_KIND = eINSTANCE.getVisibilityKind(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.EAccessKind EAccess Kind}' enum. - * - * - * @see org.eclipse.papyrus.C_Cpp.EAccessKind - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getEAccessKind() - * @generated - */ - EEnum EACCESS_KIND = eINSTANCE.getEAccessKind(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.EStorageClass EStorage Class}' enum. - * - * - * @see org.eclipse.papyrus.C_Cpp.EStorageClass - * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getEStorageClass() - * @generated - */ - EEnum ESTORAGE_CLASS = eINSTANCE.getEStorageClass(); - - } - -} // C_CppPackage diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Const.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Const.java deleted file mode 100644 index 62008d61ba0..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Const.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Property; - -/** - * - * A representation of the model object 'Const'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Const#getBase_parameter Base parameter}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Const#getBase_property Base property}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Const#getBase_operation Base operation}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConst() - * @model - * @generated - */ -public interface Const extends EObject { - /** - * Returns the value of the 'Base parameter' reference. - * - *

- * If the meaning of the 'Base parameter' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base parameter' reference. - * @see #setBase_parameter(Parameter) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConst_Base_parameter() - * @model ordered="false" - * @generated - */ - Parameter getBase_parameter(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Const#getBase_parameter Base parameter}' reference. - * - * - * @param value the new value of the 'Base parameter' reference. - * @see #getBase_parameter() - * @generated - */ - void setBase_parameter(Parameter value); - - /** - * Returns the value of the 'Base property' reference. - * - *

- * If the meaning of the 'Base property' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base property' reference. - * @see #setBase_property(Property) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConst_Base_property() - * @model ordered="false" - * @generated - */ - Property getBase_property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Const#getBase_property Base property}' reference. - * - * - * @param value the new value of the 'Base property' reference. - * @see #getBase_property() - * @generated - */ - void setBase_property(Property value); - - /** - * Returns the value of the 'Base operation' reference. - * - *

- * If the meaning of the 'Base operation' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base operation' reference. - * @see #setBase_operation(Operation) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConst_Base_operation() - * @model ordered="false" - * @generated - */ - Operation getBase_operation(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Const#getBase_operation Base operation}' reference. - * - * - * @param value the new value of the 'Base operation' reference. - * @see #getBase_operation() - * @generated - */ - void setBase_operation(Operation value); - -} // Const diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ConstInit.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ConstInit.java deleted file mode 100644 index 70939be35c4..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ConstInit.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Operation; - -/** - * - * A representation of the model object 'Const Init'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.ConstInit#getInitialisation Initialisation}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.ConstInit#getBase_operation Base operation}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConstInit() - * @model - * @generated - */ -public interface ConstInit extends EObject { - /** - * Returns the value of the 'Initialisation' attribute. - * - *

- * If the meaning of the 'Initialisation' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Initialisation' attribute. - * @see #setInitialisation(String) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConstInit_Initialisation() - * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" - * @generated - */ - String getInitialisation(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.ConstInit#getInitialisation Initialisation}' attribute. - * - * - * @param value the new value of the 'Initialisation' attribute. - * @see #getInitialisation() - * @generated - */ - void setInitialisation(String value); - - /** - * Returns the value of the 'Base operation' reference. - * - *

- * If the meaning of the 'Base operation' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base operation' reference. - * @see #setBase_operation(Operation) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConstInit_Base_operation() - * @model required="true" ordered="false" - * @generated - */ - Operation getBase_operation(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.ConstInit#getBase_operation Base operation}' reference. - * - * - * @param value the new value of the 'Base operation' reference. - * @see #getBase_operation() - * @generated - */ - void setBase_operation(Operation value); - -} // ConstInit diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppInit.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppInit.java deleted file mode 100644 index 8f239695d33..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppInit.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.EnumerationLiteral; - -/** - * - * A representation of the model object 'Cpp Init'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.CppInit#getValue Value}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.CppInit#getBase_enumerationliteral Base enumerationliteral}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getCppInit() - * @model - * @generated - */ -public interface CppInit extends EObject { - /** - * Returns the value of the 'Value' attribute. - * - *

- * If the meaning of the 'Value' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Value' attribute. - * @see #setValue(int) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getCppInit_Value() - * @model unique="false" dataType="org.eclipse.uml2.types.Integer" required="true" ordered="false" - * @generated - */ - int getValue(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.CppInit#getValue Value}' attribute. - * - * - * @param value the new value of the 'Value' attribute. - * @see #getValue() - * @generated - */ - void setValue(int value); - - /** - * Returns the value of the 'Base enumerationliteral' reference. - * - *

- * If the meaning of the 'Base enumerationliteral' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base enumerationliteral' reference. - * @see #setBase_enumerationliteral(EnumerationLiteral) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getCppInit_Base_enumerationliteral() - * @model required="true" ordered="false" - * @generated - */ - EnumerationLiteral getBase_enumerationliteral(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.CppInit#getBase_enumerationliteral Base enumerationliteral}' reference. - * - * - * @param value the new value of the 'Base enumerationliteral' reference. - * @see #getBase_enumerationliteral() - * @generated - */ - void setBase_enumerationliteral(EnumerationLiteral value); - -} // CppInit diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppRoot.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppRoot.java deleted file mode 100644 index 2f603ef6f4e..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppRoot.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Cpp Root'. - * - * - * - * Indicates that this package shoudl be a root package, i.e. its contents should appear on top level folder during generation. Currently not used - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.CppRoot#getBase_package Base package}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getCppRoot() - * @model - * @generated - */ -public interface CppRoot extends EObject { - /** - * Returns the value of the 'Base package' reference. - * - *

- * If the meaning of the 'Base package' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base package' reference. - * @see #setBase_package(org.eclipse.uml2.uml.Package) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getCppRoot_Base_package() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Package getBase_package(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.CppRoot#getBase_package Base package}' reference. - * - * - * @param value the new value of the 'Base package' reference. - * @see #getBase_package() - * @generated - */ - void setBase_package(org.eclipse.uml2.uml.Package value); - -} // CppRoot diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EAccessKind.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EAccessKind.java deleted file mode 100644 index 57a8c292c1f..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EAccessKind.java +++ /dev/null @@ -1,251 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'EAccess Kind', - * and utility methods for working with them. - * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getEAccessKind() - * @model - * @generated - */ -public enum EAccessKind implements Enumerator { - /** - * The 'Read' literal object. - * - * - * @see #READ_VALUE - * @generated - * @ordered - */ - READ(0, "read", "read"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Write' literal object. - * - * - * @see #WRITE_VALUE - * @generated - * @ordered - */ - WRITE(1, "write", "write"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Read Write' literal object. - * - * - * @see #READ_WRITE_VALUE - * @generated - * @ordered - */ - READ_WRITE(2, "readWrite", "readWrite"); //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Read' literal value. - * - *

- * If the meaning of 'Read' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #READ - * @model name="read" - * @generated - * @ordered - */ - public static final int READ_VALUE = 0; - - /** - * The 'Write' literal value. - * - *

- * If the meaning of 'Write' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #WRITE - * @model name="write" - * @generated - * @ordered - */ - public static final int WRITE_VALUE = 1; - - /** - * The 'Read Write' literal value. - * - *

- * If the meaning of 'Read Write' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #READ_WRITE - * @model name="readWrite" - * @generated - * @ordered - */ - public static final int READ_WRITE_VALUE = 2; - - /** - * An array of all the 'EAccess Kind' enumerators. - * - * - * @generated - */ - private static final EAccessKind[] VALUES_ARRAY = - new EAccessKind[] { - READ, - WRITE, - READ_WRITE, - }; - - /** - * A public read-only list of all the 'EAccess Kind' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'EAccess Kind' literal with the specified literal value. - * - * - * @param literal the literal. - * @return the matching enumerator or null. - * @generated - */ - public static EAccessKind get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - EAccessKind result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'EAccess Kind' literal with the specified name. - * - * - * @param name the name. - * @return the matching enumerator or null. - * @generated - */ - public static EAccessKind getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - EAccessKind result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'EAccess Kind' literal with the specified integer value. - * - * - * @param value the integer value. - * @return the matching enumerator or null. - * @generated - */ - public static EAccessKind get(int value) { - switch (value) { - case READ_VALUE: return READ; - case WRITE_VALUE: return WRITE; - case READ_WRITE_VALUE: return READ_WRITE; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private EAccessKind(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - @Override - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - @Override - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - -} // EAccessKind diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EStorageClass.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EStorageClass.java deleted file mode 100644 index 09807524d5a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EStorageClass.java +++ /dev/null @@ -1,251 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'EStorage Class', - * and utility methods for working with them. - * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getEStorageClass() - * @model - * @generated - */ -public enum EStorageClass implements Enumerator { - /** - * The 'Volatile' literal object. - * - * - * @see #VOLATILE_VALUE - * @generated - * @ordered - */ - VOLATILE(0, "volatile", "volatile"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Register' literal object. - * - * - * @see #REGISTER_VALUE - * @generated - * @ordered - */ - REGISTER(1, "register", "register"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Extern' literal object. - * - * - * @see #EXTERN_VALUE - * @generated - * @ordered - */ - EXTERN(2, "extern", "extern"); //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Volatile' literal value. - * - *

- * If the meaning of 'Volatile' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #VOLATILE - * @model name="volatile" - * @generated - * @ordered - */ - public static final int VOLATILE_VALUE = 0; - - /** - * The 'Register' literal value. - * - *

- * If the meaning of 'Register' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #REGISTER - * @model name="register" - * @generated - * @ordered - */ - public static final int REGISTER_VALUE = 1; - - /** - * The 'Extern' literal value. - * - *

- * If the meaning of 'Extern' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #EXTERN - * @model name="extern" - * @generated - * @ordered - */ - public static final int EXTERN_VALUE = 2; - - /** - * An array of all the 'EStorage Class' enumerators. - * - * - * @generated - */ - private static final EStorageClass[] VALUES_ARRAY = - new EStorageClass[] { - VOLATILE, - REGISTER, - EXTERN, - }; - - /** - * A public read-only list of all the 'EStorage Class' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'EStorage Class' literal with the specified literal value. - * - * - * @param literal the literal. - * @return the matching enumerator or null. - * @generated - */ - public static EStorageClass get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - EStorageClass result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'EStorage Class' literal with the specified name. - * - * - * @param name the name. - * @return the matching enumerator or null. - * @generated - */ - public static EStorageClass getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - EStorageClass result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'EStorage Class' literal with the specified integer value. - * - * - * @param value the integer value. - * @return the matching enumerator or null. - * @generated - */ - public static EStorageClass get(int value) { - switch (value) { - case VOLATILE_VALUE: return VOLATILE; - case REGISTER_VALUE: return REGISTER; - case EXTERN_VALUE: return EXTERN; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private EStorageClass(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - @Override - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - @Override - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - -} // EStorageClass diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ExternLibrary.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ExternLibrary.java deleted file mode 100644 index 21811e3917f..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ExternLibrary.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Extern Library'. - * - * - * - * Mark a package as External Library. If this package is used, the associated CDT project will be configured accordingly. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getIncludePaths Include Paths}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getBase_package Base package}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getLibPaths Lib Paths}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getMacros Macros}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getLibs Libs}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getIncludes Includes}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary() - * @model - * @generated - */ -public interface ExternLibrary extends EObject { - /** - * Returns the value of the 'Include Paths' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'Include Paths' attribute list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Include Paths' attribute list. - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary_IncludePaths() - * @model unique="false" dataType="org.eclipse.uml2.types.String" ordered="false" - * @generated - */ - EList getIncludePaths(); - - /** - * Returns the value of the 'Base package' reference. - * - *

- * If the meaning of the 'Base package' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base package' reference. - * @see #setBase_package(org.eclipse.uml2.uml.Package) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary_Base_package() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Package getBase_package(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getBase_package Base package}' reference. - * - * - * @param value the new value of the 'Base package' reference. - * @see #getBase_package() - * @generated - */ - void setBase_package(org.eclipse.uml2.uml.Package value); - - /** - * Returns the value of the 'Lib Paths' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'Lib Paths' attribute list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Lib Paths' attribute list. - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary_LibPaths() - * @model dataType="org.eclipse.uml2.types.String" ordered="false" - * @generated - */ - EList getLibPaths(); - - /** - * Returns the value of the 'Macros' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'Macros' attribute list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Macros' attribute list. - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary_Macros() - * @model dataType="org.eclipse.uml2.types.String" ordered="false" - * @generated - */ - EList getMacros(); - - /** - * Returns the value of the 'Libs' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'Libs' attribute list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Libs' attribute list. - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary_Libs() - * @model dataType="org.eclipse.uml2.types.String" ordered="false" - * @generated - */ - EList getLibs(); - - /** - * Returns the value of the 'Includes' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'Includes' attribute list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Includes' attribute list. - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary_Includes() - * @model dataType="org.eclipse.uml2.types.String" ordered="false" - * @generated - */ - EList getIncludes(); - -} // ExternLibrary diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/External.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/External.java deleted file mode 100644 index 26d9af0e307..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/External.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Classifier; - -/** - * - * A representation of the model object 'External'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.External#getName Name}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.External#getBase_Classifier Base Classifier}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternal() - * @model - * @generated - */ -public interface External extends EObject { - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternal_Name() - * @model unique="false" dataType="org.eclipse.uml2.types.String" ordered="false" - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.External#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Base Classifier' reference. - * - *

- * If the meaning of the 'Base Classifier' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Classifier' reference. - * @see #setBase_Classifier(Classifier) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternal_Base_Classifier() - * @model required="true" ordered="false" - * @generated - */ - Classifier getBase_Classifier(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.External#getBase_Classifier Base Classifier}' reference. - * - * - * @param value the new value of the 'Base Classifier' reference. - * @see #getBase_Classifier() - * @generated - */ - void setBase_Classifier(Classifier value); - -} // External diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Friend.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Friend.java deleted file mode 100644 index 3971ecf9257..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Friend.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Dependency; -import org.eclipse.uml2.uml.Operation; - -/** - * - * A representation of the model object 'Friend'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Friend#getBase_dependency Base dependency}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Friend#getBase_operation Base operation}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getFriend() - * @model - * @generated - */ -public interface Friend extends EObject { - /** - * Returns the value of the 'Base dependency' reference. - * - *

- * If the meaning of the 'Base dependency' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base dependency' reference. - * @see #setBase_dependency(Dependency) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getFriend_Base_dependency() - * @model ordered="false" - * @generated - */ - Dependency getBase_dependency(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Friend#getBase_dependency Base dependency}' reference. - * - * - * @param value the new value of the 'Base dependency' reference. - * @see #getBase_dependency() - * @generated - */ - void setBase_dependency(Dependency value); - - /** - * Returns the value of the 'Base operation' reference. - * - *

- * If the meaning of the 'Base operation' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base operation' reference. - * @see #setBase_operation(Operation) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getFriend_Base_operation() - * @model ordered="false" - * @generated - */ - Operation getBase_operation(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Friend#getBase_operation Base operation}' reference. - * - * - * @param value the new value of the 'Base operation' reference. - * @see #getBase_operation() - * @generated - */ - void setBase_operation(Operation value); - -} // Friend diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Include.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Include.java deleted file mode 100644 index 734252a47b3..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Include.java +++ /dev/null @@ -1,200 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Classifier; - -/** - * - * A representation of the model object 'Include'. - * - * - * - * An arbitrary string that is added to header and body file. Although primarily intended for manual include directives, it can be used for arbitrary definitions. - * "preBody" is added to a C++ body file before automatic include statements, "body" after - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Include#getBody Body}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Include#getPreBody Pre Body}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Include#getHeader Header}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Include#getBase_package Base package}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Include#getBase_class Base class}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Include#getBase_Classifier Base Classifier}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude() - * @model - * @generated - */ -public interface Include extends EObject { - /** - * Returns the value of the 'Body' attribute. - * The default value is "". - * - *

- * If the meaning of the 'Body' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Body' attribute. - * @see #setBody(String) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude_Body() - * @model default="" dataType="org.eclipse.uml2.types.String" ordered="false" - * @generated - */ - String getBody(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Include#getBody Body}' attribute. - * - * - * @param value the new value of the 'Body' attribute. - * @see #getBody() - * @generated - */ - void setBody(String value); - - /** - * Returns the value of the 'Pre Body' attribute. - * The default value is "". - * - *

- * If the meaning of the 'Pre Body' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Pre Body' attribute. - * @see #setPreBody(String) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude_PreBody() - * @model default="" dataType="org.eclipse.uml2.types.String" ordered="false" - * @generated - */ - String getPreBody(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Include#getPreBody Pre Body}' attribute. - * - * - * @param value the new value of the 'Pre Body' attribute. - * @see #getPreBody() - * @generated - */ - void setPreBody(String value); - - /** - * Returns the value of the 'Header' attribute. - * The default value is "". - * - *

- * If the meaning of the 'Header' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Header' attribute. - * @see #setHeader(String) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude_Header() - * @model default="" dataType="org.eclipse.uml2.types.String" ordered="false" - * @generated - */ - String getHeader(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Include#getHeader Header}' attribute. - * - * - * @param value the new value of the 'Header' attribute. - * @see #getHeader() - * @generated - */ - void setHeader(String value); - - /** - * Returns the value of the 'Base package' reference. - * - *

- * If the meaning of the 'Base package' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base package' reference. - * @see #setBase_package(org.eclipse.uml2.uml.Package) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude_Base_package() - * @model ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Package getBase_package(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Include#getBase_package Base package}' reference. - * - * - * @param value the new value of the 'Base package' reference. - * @see #getBase_package() - * @generated - */ - void setBase_package(org.eclipse.uml2.uml.Package value); - - /** - * Returns the value of the 'Base class' reference. - * - *

- * If the meaning of the 'Base class' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Base class' reference. - * @see #setBase_class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude_Base_class() - * @model ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Include#getBase_class Base class}' reference. - * - * - * @param value the new value of the 'Base class' reference. - * @see #getBase_class() - * @generated - */ - void setBase_class(org.eclipse.uml2.uml.Class value); - - /** - * Returns the value of the 'Base Classifier' reference. - * - *

- * If the meaning of the 'Base Classifier' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Base Classifier' reference. - * @see #setBase_Classifier(Classifier) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude_Base_Classifier() - * @model ordered="false" - * @generated - */ - Classifier getBase_Classifier(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Include#getBase_Classifier Base Classifier}' reference. - * - * - * @param value the new value of the 'Base Classifier' reference. - * @see #getBase_Classifier() - * @generated - */ - void setBase_Classifier(Classifier value); - -} // Include diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Inline.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Inline.java deleted file mode 100644 index 737bc194134..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Inline.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Operation; - -/** - * - * A representation of the model object 'Inline'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Inline#getBase_operation Base operation}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInline() - * @model - * @generated - */ -public interface Inline extends EObject { - /** - * Returns the value of the 'Base operation' reference. - * - *

- * If the meaning of the 'Base operation' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base operation' reference. - * @see #setBase_operation(Operation) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInline_Base_operation() - * @model required="true" ordered="false" - * @generated - */ - Operation getBase_operation(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Inline#getBase_operation Base operation}' reference. - * - * - * @param value the new value of the 'Base operation' reference. - * @see #getBase_operation() - * @generated - */ - void setBase_operation(Operation value); - -} // Inline diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ManualGeneration.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ManualGeneration.java deleted file mode 100644 index b28650aae64..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ManualGeneration.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Manual Generation'. - * - * - * - * Some toolkits require a quite particular way of use. For instance, LTTng requires the use of C (not C++) for the declaration of a trace provider and the header file is read several time with redefined macros. Therefore, the code generator supports a "manual" generation mode, in which primarily the contents of the CppInclude directive is written. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.ManualGeneration#getExtensionBody Extension Body}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.ManualGeneration#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getManualGeneration() - * @model - * @generated - */ -public interface ManualGeneration extends EObject { - /** - * Returns the value of the 'Extension Body' attribute. - * - *

- * If the meaning of the 'Extension Body' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Extension Body' attribute. - * @see #setExtensionBody(String) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getManualGeneration_ExtensionBody() - * @model dataType="org.eclipse.uml2.types.String" required="true" ordered="false" - * @generated - */ - String getExtensionBody(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.ManualGeneration#getExtensionBody Extension Body}' attribute. - * - * - * @param value the new value of the 'Extension Body' attribute. - * @see #getExtensionBody() - * @generated - */ - void setExtensionBody(String value); - - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getManualGeneration_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.ManualGeneration#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // ManualGeneration diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Mutable.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Mutable.java deleted file mode 100644 index 9ca0a41cd6a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Mutable.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; - -import org.eclipse.uml2.uml.Property; - -/** - * - * A representation of the model object 'Mutable'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Mutable#getBase_property Base property}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getMutable() - * @model - * @generated - */ -public interface Mutable extends EObject { - /** - * Returns the value of the 'Base property' reference. - * - *

- * If the meaning of the 'Base property' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Base property' reference. - * @see #setBase_property(Property) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getMutable_Base_property() - * @model required="true" ordered="false" - * @generated - */ - Property getBase_property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Mutable#getBase_property Base property}' reference. - * - * - * @param value the new value of the 'Base property' reference. - * @see #getBase_property() - * @generated - */ - void setBase_property(Property value); - -} // Mutable diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/NoCodeGen.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/NoCodeGen.java deleted file mode 100644 index 2436e6bddc4..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/NoCodeGen.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Element; - -/** - * - * A representation of the model object 'No Code Gen'. - * - * - * - * No code generation should be done for this element. This also means that no include directive is generated, if the class is referenced. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.NoCodeGen#getBase_element Base element}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getNoCodeGen() - * @model - * @generated - */ -public interface NoCodeGen extends EObject { - /** - * Returns the value of the 'Base element' reference. - * - *

- * If the meaning of the 'Base element' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base element' reference. - * @see #setBase_element(Element) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getNoCodeGen_Base_element() - * @model required="true" ordered="false" - * @generated - */ - Element getBase_element(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.NoCodeGen#getBase_element Base element}' reference. - * - * - * @param value the new value of the 'Base element' reference. - * @see #getBase_element() - * @generated - */ - void setBase_element(Element value); - -} // NoCodeGen diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ptr.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ptr.java deleted file mode 100644 index ce60c416a38..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ptr.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Property; - -/** - * - * A representation of the model object 'Ptr'. - * - * - * - * "declaration" attribute should only be used, if more than one indirections of pointers (often "**") - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Ptr#getBase_parameter Base parameter}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Ptr#getBase_property Base property}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Ptr#getDeclaration Declaration}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getPtr() - * @model - * @generated - */ -public interface Ptr extends EObject { - /** - * Returns the value of the 'Base parameter' reference. - * - *

- * If the meaning of the 'Base parameter' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base parameter' reference. - * @see #setBase_parameter(Parameter) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getPtr_Base_parameter() - * @model ordered="false" - * @generated - */ - Parameter getBase_parameter(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Ptr#getBase_parameter Base parameter}' reference. - * - * - * @param value the new value of the 'Base parameter' reference. - * @see #getBase_parameter() - * @generated - */ - void setBase_parameter(Parameter value); - - /** - * Returns the value of the 'Base property' reference. - * - *

- * If the meaning of the 'Base property' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base property' reference. - * @see #setBase_property(Property) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getPtr_Base_property() - * @model ordered="false" - * @generated - */ - Property getBase_property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Ptr#getBase_property Base property}' reference. - * - * - * @param value the new value of the 'Base property' reference. - * @see #getBase_property() - * @generated - */ - void setBase_property(Property value); - - /** - * Returns the value of the 'Declaration' attribute. - * - *

- * If the meaning of the 'Declaration' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Declaration' attribute. - * @see #setDeclaration(String) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getPtr_Declaration() - * @model unique="false" dataType="org.eclipse.uml2.types.String" ordered="false" - * @generated - */ - String getDeclaration(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Ptr#getDeclaration Declaration}' attribute. - * - * - * @param value the new value of the 'Declaration' attribute. - * @see #getDeclaration() - * @generated - */ - void setDeclaration(String value); - -} // Ptr diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ref.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ref.java deleted file mode 100644 index 535918f01cf..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ref.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Property; - -/** - * - * A representation of the model object 'Ref'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Ref#getBase_parameter Base parameter}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Ref#getBase_property Base property}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getRef() - * @model - * @generated - */ -public interface Ref extends EObject { - /** - * Returns the value of the 'Base parameter' reference. - * - *

- * If the meaning of the 'Base parameter' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base parameter' reference. - * @see #setBase_parameter(Parameter) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getRef_Base_parameter() - * @model ordered="false" - * @generated - */ - Parameter getBase_parameter(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Ref#getBase_parameter Base parameter}' reference. - * - * - * @param value the new value of the 'Base parameter' reference. - * @see #getBase_parameter() - * @generated - */ - void setBase_parameter(Parameter value); - - /** - * Returns the value of the 'Base property' reference. - * - *

- * If the meaning of the 'Base property' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base property' reference. - * @see #setBase_property(Property) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getRef_Base_property() - * @model ordered="false" - * @generated - */ - Property getBase_property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Ref#getBase_property Base property}' reference. - * - * - * @param value the new value of the 'Base property' reference. - * @see #getBase_property() - * @generated - */ - void setBase_property(Property value); - -} // Ref diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/StorageClass.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/StorageClass.java deleted file mode 100644 index 478fd5e5fb6..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/StorageClass.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Property; - -/** - * - * A representation of the model object 'Storage Class'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.StorageClass#getStorageClass Storage Class}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Property Base Property}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Parameter Base Parameter}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getStorageClass() - * @model - * @generated - */ -public interface StorageClass extends EObject { - /** - * Returns the value of the 'Storage Class' attribute. - * The literals are from the enumeration {@link org.eclipse.papyrus.C_Cpp.EStorageClass}. - * - *

- * If the meaning of the 'Storage Class' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Storage Class' attribute. - * @see org.eclipse.papyrus.C_Cpp.EStorageClass - * @see #setStorageClass(EStorageClass) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getStorageClass_StorageClass() - * @model unique="false" required="true" ordered="false" - * @generated - */ - EStorageClass getStorageClass(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.StorageClass#getStorageClass Storage Class}' attribute. - * - * - * @param value the new value of the 'Storage Class' attribute. - * @see org.eclipse.papyrus.C_Cpp.EStorageClass - * @see #getStorageClass() - * @generated - */ - void setStorageClass(EStorageClass value); - - /** - * Returns the value of the 'Base Property' reference. - * - *

- * If the meaning of the 'Base Property' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Base Property' reference. - * @see #setBase_Property(Property) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getStorageClass_Base_Property() - * @model ordered="false" - * @generated - */ - Property getBase_Property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Property Base Property}' reference. - * - * - * @param value the new value of the 'Base Property' reference. - * @see #getBase_Property() - * @generated - */ - void setBase_Property(Property value); - - /** - * Returns the value of the 'Base Parameter' reference. - * - *

- * If the meaning of the 'Base Parameter' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Base Parameter' reference. - * @see #setBase_Parameter(Parameter) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getStorageClass_Base_Parameter() - * @model ordered="false" - * @generated - */ - Parameter getBase_Parameter(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Parameter Base Parameter}' reference. - * - * - * @param value the new value of the 'Base Parameter' reference. - * @see #getBase_Parameter() - * @generated - */ - void setBase_Parameter(Parameter value); - -} // StorageClass diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Template.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Template.java deleted file mode 100644 index 66d729cb018..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Template.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Template'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Template#getDeclaration Declaration}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Template#getBase_class Base class}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplate() - * @model - * @generated - */ -public interface Template extends EObject { - /** - * Returns the value of the 'Declaration' attribute. - * - *

- * If the meaning of the 'Declaration' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Declaration' attribute. - * @see #setDeclaration(String) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplate_Declaration() - * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" - * @generated - */ - String getDeclaration(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Template#getDeclaration Declaration}' attribute. - * - * - * @param value the new value of the 'Declaration' attribute. - * @see #getDeclaration() - * @generated - */ - void setDeclaration(String value); - - /** - * Returns the value of the 'Base class' reference. - * - *

- * If the meaning of the 'Base class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base class' reference. - * @see #setBase_class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplate_Base_class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Template#getBase_class Base class}' reference. - * - * - * @param value the new value of the 'Base class' reference. - * @see #getBase_class() - * @generated - */ - void setBase_class(org.eclipse.uml2.uml.Class value); - -} // Template diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateBinding.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateBinding.java deleted file mode 100644 index 5f9e868c814..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateBinding.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Template Binding'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.TemplateBinding#getBinding Binding}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.TemplateBinding#getBase_templatebinding Base templatebinding}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplateBinding() - * @model - * @generated - */ -public interface TemplateBinding extends EObject { - /** - * Returns the value of the 'Binding' attribute. - * - *

- * If the meaning of the 'Binding' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Binding' attribute. - * @see #setBinding(String) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplateBinding_Binding() - * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" - * @generated - */ - String getBinding(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.TemplateBinding#getBinding Binding}' attribute. - * - * - * @param value the new value of the 'Binding' attribute. - * @see #getBinding() - * @generated - */ - void setBinding(String value); - - /** - * Returns the value of the 'Base templatebinding' reference. - * - *

- * If the meaning of the 'Base templatebinding' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base templatebinding' reference. - * @see #setBase_templatebinding(org.eclipse.uml2.uml.TemplateBinding) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplateBinding_Base_templatebinding() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.TemplateBinding getBase_templatebinding(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.TemplateBinding#getBase_templatebinding Base templatebinding}' reference. - * - * - * @param value the new value of the 'Base templatebinding' reference. - * @see #getBase_templatebinding() - * @generated - */ - void setBase_templatebinding(org.eclipse.uml2.uml.TemplateBinding value); - -} // TemplateBinding diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateParameter.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateParameter.java deleted file mode 100644 index 1c67ebfec79..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateParameter.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Template Parameter'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.TemplateParameter#getName Name}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.TemplateParameter#getBase_templateparameter Base templateparameter}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplateParameter() - * @model - * @generated - */ -public interface TemplateParameter extends EObject { - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplateParameter_Name() - * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.TemplateParameter#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Base templateparameter' reference. - * - *

- * If the meaning of the 'Base templateparameter' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base templateparameter' reference. - * @see #setBase_templateparameter(org.eclipse.uml2.uml.TemplateParameter) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplateParameter_Base_templateparameter() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.TemplateParameter getBase_templateparameter(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.TemplateParameter#getBase_templateparameter Base templateparameter}' reference. - * - * - * @param value the new value of the 'Base templateparameter' reference. - * @see #getBase_templateparameter() - * @generated - */ - void setBase_templateparameter(org.eclipse.uml2.uml.TemplateParameter value); - -} // TemplateParameter diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Typedef.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Typedef.java deleted file mode 100644 index 99be18e2013..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Typedef.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.PrimitiveType; - -/** - * - * A representation of the model object 'Typedef'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Typedef#getDefinition Definition}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Typedef#getBase_primitivetype Base primitivetype}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTypedef() - * @model - * @generated - */ -public interface Typedef extends EObject { - /** - * Returns the value of the 'Definition' attribute. - * - *

- * If the meaning of the 'Definition' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Definition' attribute. - * @see #setDefinition(String) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTypedef_Definition() - * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" - * @generated - */ - String getDefinition(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Typedef#getDefinition Definition}' attribute. - * - * - * @param value the new value of the 'Definition' attribute. - * @see #getDefinition() - * @generated - */ - void setDefinition(String value); - - /** - * Returns the value of the 'Base primitivetype' reference. - * - *

- * If the meaning of the 'Base primitivetype' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base primitivetype' reference. - * @see #setBase_primitivetype(PrimitiveType) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTypedef_Base_primitivetype() - * @model required="true" ordered="false" - * @generated - */ - PrimitiveType getBase_primitivetype(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Typedef#getBase_primitivetype Base primitivetype}' reference. - * - * - * @param value the new value of the 'Base primitivetype' reference. - * @see #getBase_primitivetype() - * @generated - */ - void setBase_primitivetype(PrimitiveType value); - -} // Typedef diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Union.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Union.java deleted file mode 100644 index 1edfbd0d38a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Union.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.DataType; - -/** - * - * A representation of the model object 'Union'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Union#getBase_DataType Base Data Type}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getUnion() - * @model - * @generated - */ -public interface Union extends EObject { - /** - * Returns the value of the 'Base Data Type' reference. - * - *

- * If the meaning of the 'Base Data Type' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Data Type' reference. - * @see #setBase_DataType(DataType) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getUnion_Base_DataType() - * @model required="true" ordered="false" - * @generated - */ - DataType getBase_DataType(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Union#getBase_DataType Base Data Type}' reference. - * - * - * @param value the new value of the 'Base Data Type' reference. - * @see #getBase_DataType() - * @generated - */ - void setBase_DataType(DataType value); - -} // Union diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Variadic.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Variadic.java deleted file mode 100644 index 37ead44821e..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Variadic.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; - -import org.eclipse.uml2.uml.Operation; - -/** - * - * A representation of the model object 'Variadic'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Variadic#getBase_operation Base operation}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVariadic() - * @model - * @generated - */ -public interface Variadic extends EObject { - /** - * Returns the value of the 'Base operation' reference. - * - *

- * If the meaning of the 'Base operation' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Base operation' reference. - * @see #setBase_operation(Operation) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVariadic_Base_operation() - * @model required="true" ordered="false" - * @generated - */ - Operation getBase_operation(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Variadic#getBase_operation Base operation}' reference. - * - * - * @param value the new value of the 'Base operation' reference. - * @see #getBase_operation() - * @generated - */ - void setBase_operation(Operation value); - -} // Variadic diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Virtual.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Virtual.java deleted file mode 100644 index 60b209bef50..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Virtual.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Operation; - -/** - * - * A representation of the model object 'Virtual'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Virtual#getBase_operation Base operation}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVirtual() - * @model - * @generated - */ -public interface Virtual extends EObject { - /** - * Returns the value of the 'Base operation' reference. - * - *

- * If the meaning of the 'Base operation' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base operation' reference. - * @see #setBase_operation(Operation) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVirtual_Base_operation() - * @model required="true" ordered="false" - * @generated - */ - Operation getBase_operation(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Virtual#getBase_operation Base operation}' reference. - * - * - * @param value the new value of the 'Base operation' reference. - * @see #getBase_operation() - * @generated - */ - void setBase_operation(Operation value); - -} // Virtual diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Visibility.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Visibility.java deleted file mode 100644 index aea7299af55..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Visibility.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Generalization; - -/** - * - * A representation of the model object 'Visibility'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Visibility#getValue Value}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Visibility#getBase_generalization Base generalization}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVisibility() - * @model - * @generated - */ -public interface Visibility extends EObject { - /** - * Returns the value of the 'Value' attribute. - * - *

- * If the meaning of the 'Value' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Value' attribute. - * @see #setValue(String) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVisibility_Value() - * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" - * @generated - */ - String getValue(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Visibility#getValue Value}' attribute. - * - * - * @param value the new value of the 'Value' attribute. - * @see #getValue() - * @generated - */ - void setValue(String value); - - /** - * Returns the value of the 'Base generalization' reference. - * - *

- * If the meaning of the 'Base generalization' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base generalization' reference. - * @see #setBase_generalization(Generalization) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVisibility_Base_generalization() - * @model required="true" ordered="false" - * @generated - */ - Generalization getBase_generalization(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Visibility#getBase_generalization Base generalization}' reference. - * - * - * @param value the new value of the 'Base generalization' reference. - * @see #getBase_generalization() - * @generated - */ - void setBase_generalization(Generalization value); - -} // Visibility diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/VisibilityKind.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/VisibilityKind.java deleted file mode 100644 index 4ea258e178e..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/VisibilityKind.java +++ /dev/null @@ -1,251 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'Visibility Kind', - * and utility methods for working with them. - * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVisibilityKind() - * @model - * @generated - */ -public enum VisibilityKind implements Enumerator { - /** - * The 'Private' literal object. - * - * - * @see #PRIVATE_VALUE - * @generated - * @ordered - */ - PRIVATE(0, "private", "private"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Protected' literal object. - * - * - * @see #PROTECTED_VALUE - * @generated - * @ordered - */ - PROTECTED(1, "protected", "protected"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Public' literal object. - * - * - * @see #PUBLIC_VALUE - * @generated - * @ordered - */ - PUBLIC(2, "public", "public"); //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Private' literal value. - * - *

- * If the meaning of 'Private' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #PRIVATE - * @model name="private" - * @generated - * @ordered - */ - public static final int PRIVATE_VALUE = 0; - - /** - * The 'Protected' literal value. - * - *

- * If the meaning of 'Protected' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #PROTECTED - * @model name="protected" - * @generated - * @ordered - */ - public static final int PROTECTED_VALUE = 1; - - /** - * The 'Public' literal value. - * - *

- * If the meaning of 'Public' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #PUBLIC - * @model name="public" - * @generated - * @ordered - */ - public static final int PUBLIC_VALUE = 2; - - /** - * An array of all the 'Visibility Kind' enumerators. - * - * - * @generated - */ - private static final VisibilityKind[] VALUES_ARRAY = - new VisibilityKind[] { - PRIVATE, - PROTECTED, - PUBLIC, - }; - - /** - * A public read-only list of all the 'Visibility Kind' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Visibility Kind' literal with the specified literal value. - * - * - * @param literal the literal. - * @return the matching enumerator or null. - * @generated - */ - public static VisibilityKind get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - VisibilityKind result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Visibility Kind' literal with the specified name. - * - * - * @param name the name. - * @return the matching enumerator or null. - * @generated - */ - public static VisibilityKind getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - VisibilityKind result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Visibility Kind' literal with the specified integer value. - * - * - * @param value the integer value. - * @return the matching enumerator or null. - * @generated - */ - public static VisibilityKind get(int value) { - switch (value) { - case PRIVATE_VALUE: return PRIVATE; - case PROTECTED_VALUE: return PROTECTED; - case PUBLIC_VALUE: return PUBLIC; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private VisibilityKind(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - @Override - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - @Override - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - -} // VisibilityKind diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Volatile.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Volatile.java deleted file mode 100644 index 6a80992fc11..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Volatile.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - */ -package org.eclipse.papyrus.C_Cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Property; - -/** - * - * A representation of the model object 'Volatile'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_parameter Base parameter}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_property Base property}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_operation Base operation}
  • - *
- * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVolatile() - * @model - * @generated - */ -public interface Volatile extends EObject { - /** - * Returns the value of the 'Base parameter' reference. - * - *

- * If the meaning of the 'Base parameter' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base parameter' reference. - * @see #setBase_parameter(Parameter) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVolatile_Base_parameter() - * @model ordered="false" - * @generated - */ - Parameter getBase_parameter(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_parameter Base parameter}' reference. - * - * - * @param value the new value of the 'Base parameter' reference. - * @see #getBase_parameter() - * @generated - */ - void setBase_parameter(Parameter value); - - /** - * Returns the value of the 'Base property' reference. - * - *

- * If the meaning of the 'Base property' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base property' reference. - * @see #setBase_property(Property) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVolatile_Base_property() - * @model ordered="false" - * @generated - */ - Property getBase_property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_property Base property}' reference. - * - * - * @param value the new value of the 'Base property' reference. - * @see #getBase_property() - * @generated - */ - void setBase_property(Property value); - - /** - * Returns the value of the 'Base operation' reference. - * - *

- * If the meaning of the 'Base operation' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base operation' reference. - * @see #setBase_operation(Operation) - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVolatile_Base_operation() - * @model ordered="false" - * @generated - */ - Operation getBase_operation(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_operation Base operation}' reference. - * - * - * @param value the new value of the 'Base operation' reference. - * @see #getBase_operation() - * @generated - */ - void setBase_operation(Operation value); - -} // Volatile diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ArrayImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ArrayImpl.java deleted file mode 100644 index 91a71d01d85..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ArrayImpl.java +++ /dev/null @@ -1,362 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.Array; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.uml2.uml.Association; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Property; - -/** - * - * An implementation of the model object 'Array'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ArrayImpl#getBase_parameter Base parameter}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ArrayImpl#getDefinition Definition}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ArrayImpl#getBase_property Base property}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ArrayImpl#getBase_association Base association}
  • - *
- * - * @generated - */ -public class ArrayImpl extends MinimalEObjectImpl.Container implements Array { - /** - * The cached value of the '{@link #getBase_parameter() Base parameter}' reference. - * - * - * @see #getBase_parameter() - * @generated - * @ordered - */ - protected Parameter base_parameter; - - /** - * The default value of the '{@link #getDefinition() Definition}' attribute. - * - * - * @see #getDefinition() - * @generated - * @ordered - */ - protected static final String DEFINITION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefinition() Definition}' attribute. - * - * - * @see #getDefinition() - * @generated - * @ordered - */ - protected String definition = DEFINITION_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_property() Base property}' reference. - * - * - * @see #getBase_property() - * @generated - * @ordered - */ - protected Property base_property; - - /** - * The cached value of the '{@link #getBase_association() Base association}' reference. - * - * - * @see #getBase_association() - * @generated - * @ordered - */ - protected Association base_association; - - /** - * - * - * @generated - */ - protected ArrayImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.ARRAY; - } - - /** - * - * - * @generated - */ - @Override - public Parameter getBase_parameter() { - if (base_parameter != null && base_parameter.eIsProxy()) { - InternalEObject oldBase_parameter = (InternalEObject)base_parameter; - base_parameter = (Parameter)eResolveProxy(oldBase_parameter); - if (base_parameter != oldBase_parameter) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.ARRAY__BASE_PARAMETER, oldBase_parameter, base_parameter)); - } - } - return base_parameter; - } - - /** - * - * - * @generated - */ - public Parameter basicGetBase_parameter() { - return base_parameter; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_parameter(Parameter newBase_parameter) { - Parameter oldBase_parameter = base_parameter; - base_parameter = newBase_parameter; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.ARRAY__BASE_PARAMETER, oldBase_parameter, base_parameter)); - } - - /** - * - * - * @generated - */ - @Override - public String getDefinition() { - return definition; - } - - /** - * - * - * @generated - */ - @Override - public void setDefinition(String newDefinition) { - String oldDefinition = definition; - definition = newDefinition; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.ARRAY__DEFINITION, oldDefinition, definition)); - } - - /** - * - * - * @generated - */ - @Override - public Property getBase_property() { - if (base_property != null && base_property.eIsProxy()) { - InternalEObject oldBase_property = (InternalEObject)base_property; - base_property = (Property)eResolveProxy(oldBase_property); - if (base_property != oldBase_property) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.ARRAY__BASE_PROPERTY, oldBase_property, base_property)); - } - } - return base_property; - } - - /** - * - * - * @generated - */ - public Property basicGetBase_property() { - return base_property; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_property(Property newBase_property) { - Property oldBase_property = base_property; - base_property = newBase_property; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.ARRAY__BASE_PROPERTY, oldBase_property, base_property)); - } - - /** - * - * - * @generated - */ - @Override - public Association getBase_association() { - if (base_association != null && base_association.eIsProxy()) { - InternalEObject oldBase_association = (InternalEObject)base_association; - base_association = (Association)eResolveProxy(oldBase_association); - if (base_association != oldBase_association) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.ARRAY__BASE_ASSOCIATION, oldBase_association, base_association)); - } - } - return base_association; - } - - /** - * - * - * @generated - */ - public Association basicGetBase_association() { - return base_association; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_association(Association newBase_association) { - Association oldBase_association = base_association; - base_association = newBase_association; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.ARRAY__BASE_ASSOCIATION, oldBase_association, base_association)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.ARRAY__BASE_PARAMETER: - if (resolve) return getBase_parameter(); - return basicGetBase_parameter(); - case C_CppPackage.ARRAY__DEFINITION: - return getDefinition(); - case C_CppPackage.ARRAY__BASE_PROPERTY: - if (resolve) return getBase_property(); - return basicGetBase_property(); - case C_CppPackage.ARRAY__BASE_ASSOCIATION: - if (resolve) return getBase_association(); - return basicGetBase_association(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.ARRAY__BASE_PARAMETER: - setBase_parameter((Parameter)newValue); - return; - case C_CppPackage.ARRAY__DEFINITION: - setDefinition((String)newValue); - return; - case C_CppPackage.ARRAY__BASE_PROPERTY: - setBase_property((Property)newValue); - return; - case C_CppPackage.ARRAY__BASE_ASSOCIATION: - setBase_association((Association)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.ARRAY__BASE_PARAMETER: - setBase_parameter((Parameter)null); - return; - case C_CppPackage.ARRAY__DEFINITION: - setDefinition(DEFINITION_EDEFAULT); - return; - case C_CppPackage.ARRAY__BASE_PROPERTY: - setBase_property((Property)null); - return; - case C_CppPackage.ARRAY__BASE_ASSOCIATION: - setBase_association((Association)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.ARRAY__BASE_PARAMETER: - return base_parameter != null; - case C_CppPackage.ARRAY__DEFINITION: - return DEFINITION_EDEFAULT == null ? definition != null : !DEFINITION_EDEFAULT.equals(definition); - case C_CppPackage.ARRAY__BASE_PROPERTY: - return base_property != null; - case C_CppPackage.ARRAY__BASE_ASSOCIATION: - return base_association != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (definition: "); - result.append(definition); - result.append(')'); - return result.toString(); - } - -} // ArrayImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppFactoryImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppFactoryImpl.java deleted file mode 100644 index e16267d1b13..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppFactoryImpl.java +++ /dev/null @@ -1,518 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.impl.EFactoryImpl; -import org.eclipse.emf.ecore.plugin.EcorePlugin; -import org.eclipse.papyrus.C_Cpp.Array; -import org.eclipse.papyrus.C_Cpp.C_CppFactory; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Const; -import org.eclipse.papyrus.C_Cpp.ConstInit; -import org.eclipse.papyrus.C_Cpp.CppInit; -import org.eclipse.papyrus.C_Cpp.CppRoot; -import org.eclipse.papyrus.C_Cpp.EAccessKind; -import org.eclipse.papyrus.C_Cpp.EStorageClass; -import org.eclipse.papyrus.C_Cpp.ExternLibrary; -import org.eclipse.papyrus.C_Cpp.External; -import org.eclipse.papyrus.C_Cpp.Friend; -import org.eclipse.papyrus.C_Cpp.Include; -import org.eclipse.papyrus.C_Cpp.Inline; -import org.eclipse.papyrus.C_Cpp.ManualGeneration; -import org.eclipse.papyrus.C_Cpp.Mutable; -import org.eclipse.papyrus.C_Cpp.NoCodeGen; -import org.eclipse.papyrus.C_Cpp.Ptr; -import org.eclipse.papyrus.C_Cpp.Ref; -import org.eclipse.papyrus.C_Cpp.StorageClass; -import org.eclipse.papyrus.C_Cpp.Template; -import org.eclipse.papyrus.C_Cpp.TemplateBinding; -import org.eclipse.papyrus.C_Cpp.TemplateParameter; -import org.eclipse.papyrus.C_Cpp.Typedef; -import org.eclipse.papyrus.C_Cpp.Union; -import org.eclipse.papyrus.C_Cpp.Variadic; -import org.eclipse.papyrus.C_Cpp.Virtual; -import org.eclipse.papyrus.C_Cpp.Visibility; -import org.eclipse.papyrus.C_Cpp.VisibilityKind; -import org.eclipse.papyrus.C_Cpp.Volatile; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class C_CppFactoryImpl extends EFactoryImpl implements C_CppFactory { - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static C_CppFactory init() { - try { - C_CppFactory theC_CppFactory = (C_CppFactory)EPackage.Registry.INSTANCE.getEFactory(C_CppPackage.eNS_URI); - if (theC_CppFactory != null) { - return theC_CppFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new C_CppFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public C_CppFactoryImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case C_CppPackage.PTR: return createPtr(); - case C_CppPackage.INCLUDE: return createInclude(); - case C_CppPackage.MANUAL_GENERATION: return createManualGeneration(); - case C_CppPackage.EXTERN_LIBRARY: return createExternLibrary(); - case C_CppPackage.NO_CODE_GEN: return createNoCodeGen(); - case C_CppPackage.CPP_ROOT: return createCppRoot(); - case C_CppPackage.ARRAY: return createArray(); - case C_CppPackage.CONST: return createConst(); - case C_CppPackage.REF: return createRef(); - case C_CppPackage.EXTERNAL: return createExternal(); - case C_CppPackage.CONST_INIT: return createConstInit(); - case C_CppPackage.FRIEND: return createFriend(); - case C_CppPackage.INLINE: return createInline(); - case C_CppPackage.VIRTUAL: return createVirtual(); - case C_CppPackage.TYPEDEF: return createTypedef(); - case C_CppPackage.VISIBILITY: return createVisibility(); - case C_CppPackage.CPP_INIT: return createCppInit(); - case C_CppPackage.TEMPLATE: return createTemplate(); - case C_CppPackage.TEMPLATE_BINDING: return createTemplateBinding(); - case C_CppPackage.TEMPLATE_PARAMETER: return createTemplateParameter(); - case C_CppPackage.UNION: return createUnion(); - case C_CppPackage.STORAGE_CLASS: return createStorageClass(); - case C_CppPackage.VOLATILE: return createVolatile(); - case C_CppPackage.VARIADIC: return createVariadic(); - case C_CppPackage.MUTABLE: return createMutable(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public Object createFromString(EDataType eDataType, String initialValue) { - switch (eDataType.getClassifierID()) { - case C_CppPackage.VISIBILITY_KIND: - return createVisibilityKindFromString(eDataType, initialValue); - case C_CppPackage.EACCESS_KIND: - return createEAccessKindFromString(eDataType, initialValue); - case C_CppPackage.ESTORAGE_CLASS: - return createEStorageClassFromString(eDataType, initialValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public String convertToString(EDataType eDataType, Object instanceValue) { - switch (eDataType.getClassifierID()) { - case C_CppPackage.VISIBILITY_KIND: - return convertVisibilityKindToString(eDataType, instanceValue); - case C_CppPackage.EACCESS_KIND: - return convertEAccessKindToString(eDataType, instanceValue); - case C_CppPackage.ESTORAGE_CLASS: - return convertEStorageClassToString(eDataType, instanceValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public Ptr createPtr() { - PtrImpl ptr = new PtrImpl(); - return ptr; - } - - /** - * - * - * @generated - */ - @Override - public Include createInclude() { - IncludeImpl include = new IncludeImpl(); - return include; - } - - /** - * - * - * @generated - */ - @Override - public ManualGeneration createManualGeneration() { - ManualGenerationImpl manualGeneration = new ManualGenerationImpl(); - return manualGeneration; - } - - /** - * - * - * @generated - */ - @Override - public ExternLibrary createExternLibrary() { - ExternLibraryImpl externLibrary = new ExternLibraryImpl(); - return externLibrary; - } - - /** - * - * - * @generated - */ - @Override - public NoCodeGen createNoCodeGen() { - NoCodeGenImpl noCodeGen = new NoCodeGenImpl(); - return noCodeGen; - } - - /** - * - * - * @generated - */ - @Override - public CppRoot createCppRoot() { - CppRootImpl cppRoot = new CppRootImpl(); - return cppRoot; - } - - /** - * - * - * @generated - */ - @Override - public Array createArray() { - ArrayImpl array = new ArrayImpl(); - return array; - } - - /** - * - * - * @generated - */ - @Override - public Const createConst() { - ConstImpl const_ = new ConstImpl(); - return const_; - } - - /** - * - * - * @generated - */ - @Override - public Ref createRef() { - RefImpl ref = new RefImpl(); - return ref; - } - - /** - * - * - * @generated - */ - @Override - public External createExternal() { - ExternalImpl external = new ExternalImpl(); - return external; - } - - /** - * - * - * @generated - */ - @Override - public ConstInit createConstInit() { - ConstInitImpl constInit = new ConstInitImpl(); - return constInit; - } - - /** - * - * - * @generated - */ - @Override - public Friend createFriend() { - FriendImpl friend = new FriendImpl(); - return friend; - } - - /** - * - * - * @generated - */ - @Override - public Inline createInline() { - InlineImpl inline = new InlineImpl(); - return inline; - } - - /** - * - * - * @generated - */ - @Override - public Virtual createVirtual() { - VirtualImpl virtual = new VirtualImpl(); - return virtual; - } - - /** - * - * - * @generated - */ - @Override - public Typedef createTypedef() { - TypedefImpl typedef = new TypedefImpl(); - return typedef; - } - - /** - * - * - * @generated - */ - @Override - public Visibility createVisibility() { - VisibilityImpl visibility = new VisibilityImpl(); - return visibility; - } - - /** - * - * - * @generated - */ - @Override - public CppInit createCppInit() { - CppInitImpl cppInit = new CppInitImpl(); - return cppInit; - } - - /** - * - * - * @generated - */ - @Override - public Template createTemplate() { - TemplateImpl template = new TemplateImpl(); - return template; - } - - /** - * - * - * @generated - */ - @Override - public TemplateBinding createTemplateBinding() { - TemplateBindingImpl templateBinding = new TemplateBindingImpl(); - return templateBinding; - } - - /** - * - * - * @generated - */ - @Override - public TemplateParameter createTemplateParameter() { - TemplateParameterImpl templateParameter = new TemplateParameterImpl(); - return templateParameter; - } - - /** - * - * - * @generated - */ - @Override - public Union createUnion() { - UnionImpl union = new UnionImpl(); - return union; - } - - /** - * - * - * @generated - */ - @Override - public StorageClass createStorageClass() { - StorageClassImpl storageClass = new StorageClassImpl(); - return storageClass; - } - - /** - * - * - * @generated - */ - @Override - public Volatile createVolatile() { - VolatileImpl volatile_ = new VolatileImpl(); - return volatile_; - } - - /** - * - * - * @generated - */ - public Variadic createVariadic() { - VariadicImpl variadic = new VariadicImpl(); - return variadic; - } - - /** - * - * - * @generated - */ - public Mutable createMutable() { - MutableImpl mutable = new MutableImpl(); - return mutable; - } - - /** - * - * - * @generated - */ - public VisibilityKind createVisibilityKindFromString(EDataType eDataType, String initialValue) { - VisibilityKind result = VisibilityKind.get(initialValue); - if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertVisibilityKindToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public EAccessKind createEAccessKindFromString(EDataType eDataType, String initialValue) { - EAccessKind result = EAccessKind.get(initialValue); - if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertEAccessKindToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public EStorageClass createEStorageClassFromString(EDataType eDataType, String initialValue) { - EStorageClass result = EStorageClass.get(initialValue); - if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertEStorageClassToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - @Override - public C_CppPackage getC_CppPackage() { - return (C_CppPackage)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static C_CppPackage getPackage() { - return C_CppPackage.eINSTANCE; - } - -} // C_CppFactoryImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppPackageImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppPackageImpl.java deleted file mode 100644 index 9d62fda5089..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppPackageImpl.java +++ /dev/null @@ -1,1464 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.papyrus.C_Cpp.Array; -import org.eclipse.papyrus.C_Cpp.C_CppFactory; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Const; -import org.eclipse.papyrus.C_Cpp.ConstInit; -import org.eclipse.papyrus.C_Cpp.CppInit; -import org.eclipse.papyrus.C_Cpp.CppRoot; -import org.eclipse.papyrus.C_Cpp.EAccessKind; -import org.eclipse.papyrus.C_Cpp.EStorageClass; -import org.eclipse.papyrus.C_Cpp.ExternLibrary; -import org.eclipse.papyrus.C_Cpp.External; -import org.eclipse.papyrus.C_Cpp.Friend; -import org.eclipse.papyrus.C_Cpp.Include; -import org.eclipse.papyrus.C_Cpp.Inline; -import org.eclipse.papyrus.C_Cpp.ManualGeneration; -import org.eclipse.papyrus.C_Cpp.Mutable; -import org.eclipse.papyrus.C_Cpp.NoCodeGen; -import org.eclipse.papyrus.C_Cpp.Ptr; -import org.eclipse.papyrus.C_Cpp.Ref; -import org.eclipse.papyrus.C_Cpp.StorageClass; -import org.eclipse.papyrus.C_Cpp.Template; -import org.eclipse.papyrus.C_Cpp.TemplateBinding; -import org.eclipse.papyrus.C_Cpp.TemplateParameter; -import org.eclipse.papyrus.C_Cpp.Typedef; -import org.eclipse.papyrus.C_Cpp.Union; -import org.eclipse.papyrus.C_Cpp.Variadic; -import org.eclipse.papyrus.C_Cpp.Virtual; -import org.eclipse.papyrus.C_Cpp.Visibility; -import org.eclipse.papyrus.C_Cpp.VisibilityKind; -import org.eclipse.papyrus.C_Cpp.Volatile; -import org.eclipse.uml2.types.TypesPackage; -import org.eclipse.uml2.uml.UMLPackage; - -/** - * - * An implementation of the model Package. - * - * @generated - */ -public class C_CppPackageImpl extends EPackageImpl implements C_CppPackage { - /** - * - * - * @generated - */ - private EClass ptrEClass = null; - - /** - * - * - * @generated - */ - private EClass includeEClass = null; - - /** - * - * - * @generated - */ - private EClass manualGenerationEClass = null; - - /** - * - * - * @generated - */ - private EClass externLibraryEClass = null; - - /** - * - * - * @generated - */ - private EClass noCodeGenEClass = null; - - /** - * - * - * @generated - */ - private EClass cppRootEClass = null; - - /** - * - * - * @generated - */ - private EClass arrayEClass = null; - - /** - * - * - * @generated - */ - private EClass constEClass = null; - - /** - * - * - * @generated - */ - private EClass refEClass = null; - - /** - * - * - * @generated - */ - private EClass externalEClass = null; - - /** - * - * - * @generated - */ - private EClass constInitEClass = null; - - /** - * - * - * @generated - */ - private EClass friendEClass = null; - - /** - * - * - * @generated - */ - private EClass inlineEClass = null; - - /** - * - * - * @generated - */ - private EClass virtualEClass = null; - - /** - * - * - * @generated - */ - private EClass typedefEClass = null; - - /** - * - * - * @generated - */ - private EClass visibilityEClass = null; - - /** - * - * - * @generated - */ - private EClass cppInitEClass = null; - - /** - * - * - * @generated - */ - private EClass templateEClass = null; - - /** - * - * - * @generated - */ - private EClass templateBindingEClass = null; - - /** - * - * - * @generated - */ - private EClass templateParameterEClass = null; - - /** - * - * - * @generated - */ - private EClass unionEClass = null; - - /** - * - * - * @generated - */ - private EClass storageClassEClass = null; - - /** - * - * - * @generated - */ - private EClass volatileEClass = null; - - /** - * - * - * @generated - */ - private EClass variadicEClass = null; - - /** - * - * - * @generated - */ - private EClass mutableEClass = null; - - /** - * - * - * @generated - */ - private EEnum visibilityKindEEnum = null; - - /** - * - * - * @generated - */ - private EEnum eAccessKindEEnum = null; - - /** - * - * - * @generated - */ - private EEnum eStorageClassEEnum = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#eNS_URI - * @see #init() - * @generated - */ - private C_CppPackageImpl() { - super(eNS_URI, C_CppFactory.eINSTANCE); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * - *

This method is used to initialize {@link C_CppPackage#eINSTANCE} when that field is accessed. - * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static C_CppPackage init() { - if (isInited) return (C_CppPackage)EPackage.Registry.INSTANCE.getEPackage(C_CppPackage.eNS_URI); - - // Obtain or create and register package - C_CppPackageImpl theC_CppPackage = (C_CppPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof C_CppPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new C_CppPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - UMLPackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theC_CppPackage.createPackageContents(); - - // Initialize created meta-data - theC_CppPackage.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theC_CppPackage.freeze(); - - - // Update the registry and return the package - EPackage.Registry.INSTANCE.put(C_CppPackage.eNS_URI, theC_CppPackage); - return theC_CppPackage; - } - - /** - * - * - * @generated - */ - @Override - public EClass getPtr() { - return ptrEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getPtr_Base_parameter() { - return (EReference)ptrEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getPtr_Base_property() { - return (EReference)ptrEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getPtr_Declaration() { - return (EAttribute)ptrEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EClass getInclude() { - return includeEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getInclude_Body() { - return (EAttribute)includeEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getInclude_PreBody() { - return (EAttribute)includeEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getInclude_Header() { - return (EAttribute)includeEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EReference getInclude_Base_package() { - return (EReference)includeEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - public EReference getInclude_Base_class() { - return (EReference)includeEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - public EReference getInclude_Base_Classifier() { - return (EReference)includeEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * @generated - */ - @Override - public EClass getManualGeneration() { - return manualGenerationEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getManualGeneration_ExtensionBody() { - return (EAttribute)manualGenerationEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getManualGeneration_Base_Class() { - return (EReference)manualGenerationEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getExternLibrary() { - return externLibraryEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getExternLibrary_IncludePaths() { - return (EAttribute)externLibraryEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getExternLibrary_Base_package() { - return (EReference)externLibraryEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getExternLibrary_LibPaths() { - return (EAttribute)externLibraryEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getExternLibrary_Macros() { - return (EAttribute)externLibraryEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getExternLibrary_Libs() { - return (EAttribute)externLibraryEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getExternLibrary_Includes() { - return (EAttribute)externLibraryEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * @generated - */ - @Override - public EClass getNoCodeGen() { - return noCodeGenEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getNoCodeGen_Base_element() { - return (EReference)noCodeGenEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getCppRoot() { - return cppRootEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getCppRoot_Base_package() { - return (EReference)cppRootEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getArray() { - return arrayEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getArray_Base_parameter() { - return (EReference)arrayEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getArray_Definition() { - return (EAttribute)arrayEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getArray_Base_property() { - return (EReference)arrayEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EReference getArray_Base_association() { - return (EReference)arrayEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - @Override - public EClass getConst() { - return constEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getConst_Base_parameter() { - return (EReference)constEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getConst_Base_property() { - return (EReference)constEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getConst_Base_operation() { - return (EReference)constEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EClass getRef() { - return refEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getRef_Base_parameter() { - return (EReference)refEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getRef_Base_property() { - return (EReference)refEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getExternal() { - return externalEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getExternal_Name() { - return (EAttribute)externalEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getExternal_Base_Classifier() { - return (EReference)externalEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getConstInit() { - return constInitEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getConstInit_Initialisation() { - return (EAttribute)constInitEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getConstInit_Base_operation() { - return (EReference)constInitEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getFriend() { - return friendEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getFriend_Base_dependency() { - return (EReference)friendEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getFriend_Base_operation() { - return (EReference)friendEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getInline() { - return inlineEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getInline_Base_operation() { - return (EReference)inlineEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getVirtual() { - return virtualEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getVirtual_Base_operation() { - return (EReference)virtualEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getTypedef() { - return typedefEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getTypedef_Definition() { - return (EAttribute)typedefEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getTypedef_Base_primitivetype() { - return (EReference)typedefEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getVisibility() { - return visibilityEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getVisibility_Value() { - return (EAttribute)visibilityEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getVisibility_Base_generalization() { - return (EReference)visibilityEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getCppInit() { - return cppInitEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getCppInit_Value() { - return (EAttribute)cppInitEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getCppInit_Base_enumerationliteral() { - return (EReference)cppInitEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getTemplate() { - return templateEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getTemplate_Declaration() { - return (EAttribute)templateEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getTemplate_Base_class() { - return (EReference)templateEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getTemplateBinding() { - return templateBindingEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getTemplateBinding_Binding() { - return (EAttribute)templateBindingEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getTemplateBinding_Base_templatebinding() { - return (EReference)templateBindingEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getTemplateParameter() { - return templateParameterEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getTemplateParameter_Name() { - return (EAttribute)templateParameterEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getTemplateParameter_Base_templateparameter() { - return (EReference)templateParameterEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getUnion() { - return unionEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getUnion_Base_DataType() { - return (EReference)unionEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getStorageClass() { - return storageClassEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getStorageClass_StorageClass() { - return (EAttribute)storageClassEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getStorageClass_Base_Property() { - return (EReference)storageClassEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getStorageClass_Base_Parameter() { - return (EReference)storageClassEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EClass getVolatile() { - return volatileEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getVolatile_Base_parameter() { - return (EReference)volatileEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getVolatile_Base_property() { - return (EReference)volatileEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getVolatile_Base_operation() { - return (EReference)volatileEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EClass getVariadic() { - return variadicEClass; - } - - /** - * - * - * @generated - */ - public EReference getVariadic_Base_operation() { - return (EReference)variadicEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EClass getMutable() { - return mutableEClass; - } - - /** - * - * - * @generated - */ - public EReference getMutable_Base_property() { - return (EReference)mutableEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EEnum getVisibilityKind() { - return visibilityKindEEnum; - } - - /** - * - * - * @generated - */ - @Override - public EEnum getEAccessKind() { - return eAccessKindEEnum; - } - - /** - * - * - * @generated - */ - @Override - public EEnum getEStorageClass() { - return eStorageClassEEnum; - } - - /** - * - * - * @generated - */ - @Override - public C_CppFactory getC_CppFactory() { - return (C_CppFactory)getEFactoryInstance(); - } - - /** - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void createPackageContents() { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - ptrEClass = createEClass(PTR); - createEReference(ptrEClass, PTR__BASE_PARAMETER); - createEReference(ptrEClass, PTR__BASE_PROPERTY); - createEAttribute(ptrEClass, PTR__DECLARATION); - - includeEClass = createEClass(INCLUDE); - createEAttribute(includeEClass, INCLUDE__BODY); - createEAttribute(includeEClass, INCLUDE__PRE_BODY); - createEAttribute(includeEClass, INCLUDE__HEADER); - createEReference(includeEClass, INCLUDE__BASE_PACKAGE); - createEReference(includeEClass, INCLUDE__BASE_CLASS); - createEReference(includeEClass, INCLUDE__BASE_CLASSIFIER); - - manualGenerationEClass = createEClass(MANUAL_GENERATION); - createEAttribute(manualGenerationEClass, MANUAL_GENERATION__EXTENSION_BODY); - createEReference(manualGenerationEClass, MANUAL_GENERATION__BASE_CLASS); - - externLibraryEClass = createEClass(EXTERN_LIBRARY); - createEAttribute(externLibraryEClass, EXTERN_LIBRARY__INCLUDE_PATHS); - createEReference(externLibraryEClass, EXTERN_LIBRARY__BASE_PACKAGE); - createEAttribute(externLibraryEClass, EXTERN_LIBRARY__LIB_PATHS); - createEAttribute(externLibraryEClass, EXTERN_LIBRARY__MACROS); - createEAttribute(externLibraryEClass, EXTERN_LIBRARY__LIBS); - createEAttribute(externLibraryEClass, EXTERN_LIBRARY__INCLUDES); - - noCodeGenEClass = createEClass(NO_CODE_GEN); - createEReference(noCodeGenEClass, NO_CODE_GEN__BASE_ELEMENT); - - cppRootEClass = createEClass(CPP_ROOT); - createEReference(cppRootEClass, CPP_ROOT__BASE_PACKAGE); - - arrayEClass = createEClass(ARRAY); - createEReference(arrayEClass, ARRAY__BASE_PARAMETER); - createEAttribute(arrayEClass, ARRAY__DEFINITION); - createEReference(arrayEClass, ARRAY__BASE_PROPERTY); - createEReference(arrayEClass, ARRAY__BASE_ASSOCIATION); - - constEClass = createEClass(CONST); - createEReference(constEClass, CONST__BASE_PARAMETER); - createEReference(constEClass, CONST__BASE_PROPERTY); - createEReference(constEClass, CONST__BASE_OPERATION); - - refEClass = createEClass(REF); - createEReference(refEClass, REF__BASE_PARAMETER); - createEReference(refEClass, REF__BASE_PROPERTY); - - externalEClass = createEClass(EXTERNAL); - createEAttribute(externalEClass, EXTERNAL__NAME); - createEReference(externalEClass, EXTERNAL__BASE_CLASSIFIER); - - constInitEClass = createEClass(CONST_INIT); - createEAttribute(constInitEClass, CONST_INIT__INITIALISATION); - createEReference(constInitEClass, CONST_INIT__BASE_OPERATION); - - friendEClass = createEClass(FRIEND); - createEReference(friendEClass, FRIEND__BASE_DEPENDENCY); - createEReference(friendEClass, FRIEND__BASE_OPERATION); - - inlineEClass = createEClass(INLINE); - createEReference(inlineEClass, INLINE__BASE_OPERATION); - - virtualEClass = createEClass(VIRTUAL); - createEReference(virtualEClass, VIRTUAL__BASE_OPERATION); - - typedefEClass = createEClass(TYPEDEF); - createEAttribute(typedefEClass, TYPEDEF__DEFINITION); - createEReference(typedefEClass, TYPEDEF__BASE_PRIMITIVETYPE); - - visibilityEClass = createEClass(VISIBILITY); - createEAttribute(visibilityEClass, VISIBILITY__VALUE); - createEReference(visibilityEClass, VISIBILITY__BASE_GENERALIZATION); - - cppInitEClass = createEClass(CPP_INIT); - createEAttribute(cppInitEClass, CPP_INIT__VALUE); - createEReference(cppInitEClass, CPP_INIT__BASE_ENUMERATIONLITERAL); - - templateEClass = createEClass(TEMPLATE); - createEAttribute(templateEClass, TEMPLATE__DECLARATION); - createEReference(templateEClass, TEMPLATE__BASE_CLASS); - - templateBindingEClass = createEClass(TEMPLATE_BINDING); - createEAttribute(templateBindingEClass, TEMPLATE_BINDING__BINDING); - createEReference(templateBindingEClass, TEMPLATE_BINDING__BASE_TEMPLATEBINDING); - - templateParameterEClass = createEClass(TEMPLATE_PARAMETER); - createEAttribute(templateParameterEClass, TEMPLATE_PARAMETER__NAME); - createEReference(templateParameterEClass, TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER); - - unionEClass = createEClass(UNION); - createEReference(unionEClass, UNION__BASE_DATA_TYPE); - - storageClassEClass = createEClass(STORAGE_CLASS); - createEAttribute(storageClassEClass, STORAGE_CLASS__STORAGE_CLASS); - createEReference(storageClassEClass, STORAGE_CLASS__BASE_PROPERTY); - createEReference(storageClassEClass, STORAGE_CLASS__BASE_PARAMETER); - - volatileEClass = createEClass(VOLATILE); - createEReference(volatileEClass, VOLATILE__BASE_PARAMETER); - createEReference(volatileEClass, VOLATILE__BASE_PROPERTY); - createEReference(volatileEClass, VOLATILE__BASE_OPERATION); - - variadicEClass = createEClass(VARIADIC); - createEReference(variadicEClass, VARIADIC__BASE_OPERATION); - - mutableEClass = createEClass(MUTABLE); - createEReference(mutableEClass, MUTABLE__BASE_PROPERTY); - - // Create enums - visibilityKindEEnum = createEEnum(VISIBILITY_KIND); - eAccessKindEEnum = createEEnum(EACCESS_KIND); - eStorageClassEEnum = createEEnum(ESTORAGE_CLASS); - } - - /** - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - UMLPackage theUMLPackage = (UMLPackage)EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI); - TypesPackage theTypesPackage = (TypesPackage)EPackage.Registry.INSTANCE.getEPackage(TypesPackage.eNS_URI); - - // Create type parameters - - // Set bounds for type parameters - - // Add supertypes to classes - - // Initialize classes, features, and operations; add parameters - initEClass(ptrEClass, Ptr.class, "Ptr", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getPtr_Base_parameter(), theUMLPackage.getParameter(), null, "base_parameter", null, 0, 1, Ptr.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getPtr_Base_property(), theUMLPackage.getProperty(), null, "base_property", null, 0, 1, Ptr.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getPtr_Declaration(), theTypesPackage.getString(), "declaration", null, 0, 1, Ptr.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(includeEClass, Include.class, "Include", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getInclude_Body(), theTypesPackage.getString(), "body", "", 0, 1, Include.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getInclude_PreBody(), theTypesPackage.getString(), "preBody", "", 0, 1, Include.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getInclude_Header(), theTypesPackage.getString(), "header", "", 0, 1, Include.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getInclude_Base_package(), theUMLPackage.getPackage(), null, "base_package", null, 0, 1, Include.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getInclude_Base_class(), theUMLPackage.getClass_(), null, "base_class", null, 0, 1, Include.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getInclude_Base_Classifier(), theUMLPackage.getClassifier(), null, "base_Classifier", null, 0, 1, Include.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(manualGenerationEClass, ManualGeneration.class, "ManualGeneration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getManualGeneration_ExtensionBody(), theTypesPackage.getString(), "extensionBody", null, 1, 1, ManualGeneration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getManualGeneration_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, ManualGeneration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(externLibraryEClass, ExternLibrary.class, "ExternLibrary", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getExternLibrary_IncludePaths(), theTypesPackage.getString(), "includePaths", null, 0, -1, ExternLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getExternLibrary_Base_package(), theUMLPackage.getPackage(), null, "base_package", null, 1, 1, ExternLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getExternLibrary_LibPaths(), theTypesPackage.getString(), "libPaths", null, 0, -1, ExternLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getExternLibrary_Macros(), theTypesPackage.getString(), "macros", null, 0, -1, ExternLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getExternLibrary_Libs(), theTypesPackage.getString(), "libs", null, 0, -1, ExternLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getExternLibrary_Includes(), theTypesPackage.getString(), "includes", null, 0, -1, ExternLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(noCodeGenEClass, NoCodeGen.class, "NoCodeGen", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getNoCodeGen_Base_element(), theUMLPackage.getElement(), null, "base_element", null, 1, 1, NoCodeGen.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(cppRootEClass, CppRoot.class, "CppRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getCppRoot_Base_package(), theUMLPackage.getPackage(), null, "base_package", null, 1, 1, CppRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(arrayEClass, Array.class, "Array", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getArray_Base_parameter(), theUMLPackage.getParameter(), null, "base_parameter", null, 0, 1, Array.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getArray_Definition(), theTypesPackage.getString(), "definition", null, 1, 1, Array.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getArray_Base_property(), theUMLPackage.getProperty(), null, "base_property", null, 0, 1, Array.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getArray_Base_association(), theUMLPackage.getAssociation(), null, "base_association", null, 0, 1, Array.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(constEClass, Const.class, "Const", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getConst_Base_parameter(), theUMLPackage.getParameter(), null, "base_parameter", null, 0, 1, Const.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getConst_Base_property(), theUMLPackage.getProperty(), null, "base_property", null, 0, 1, Const.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getConst_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 0, 1, Const.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(refEClass, Ref.class, "Ref", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getRef_Base_parameter(), theUMLPackage.getParameter(), null, "base_parameter", null, 0, 1, Ref.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getRef_Base_property(), theUMLPackage.getProperty(), null, "base_property", null, 0, 1, Ref.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(externalEClass, External.class, "External", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getExternal_Name(), theTypesPackage.getString(), "name", null, 0, 1, External.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getExternal_Base_Classifier(), theUMLPackage.getClassifier(), null, "base_Classifier", null, 1, 1, External.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(constInitEClass, ConstInit.class, "ConstInit", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getConstInit_Initialisation(), theTypesPackage.getString(), "initialisation", null, 1, 1, ConstInit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getConstInit_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 1, 1, ConstInit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(friendEClass, Friend.class, "Friend", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getFriend_Base_dependency(), theUMLPackage.getDependency(), null, "base_dependency", null, 0, 1, Friend.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getFriend_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 0, 1, Friend.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(inlineEClass, Inline.class, "Inline", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getInline_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 1, 1, Inline.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(virtualEClass, Virtual.class, "Virtual", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getVirtual_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 1, 1, Virtual.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(typedefEClass, Typedef.class, "Typedef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getTypedef_Definition(), theTypesPackage.getString(), "definition", null, 1, 1, Typedef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getTypedef_Base_primitivetype(), theUMLPackage.getPrimitiveType(), null, "base_primitivetype", null, 1, 1, Typedef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(visibilityEClass, Visibility.class, "Visibility", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getVisibility_Value(), theTypesPackage.getString(), "value", null, 1, 1, Visibility.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getVisibility_Base_generalization(), theUMLPackage.getGeneralization(), null, "base_generalization", null, 1, 1, Visibility.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(cppInitEClass, CppInit.class, "CppInit", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getCppInit_Value(), theTypesPackage.getInteger(), "value", null, 1, 1, CppInit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getCppInit_Base_enumerationliteral(), theUMLPackage.getEnumerationLiteral(), null, "base_enumerationliteral", null, 1, 1, CppInit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(templateEClass, Template.class, "Template", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getTemplate_Declaration(), theTypesPackage.getString(), "declaration", null, 1, 1, Template.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getTemplate_Base_class(), theUMLPackage.getClass_(), null, "base_class", null, 1, 1, Template.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(templateBindingEClass, TemplateBinding.class, "TemplateBinding", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getTemplateBinding_Binding(), theTypesPackage.getString(), "binding", null, 1, 1, TemplateBinding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getTemplateBinding_Base_templatebinding(), theUMLPackage.getTemplateBinding(), null, "base_templatebinding", null, 1, 1, TemplateBinding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(templateParameterEClass, TemplateParameter.class, "TemplateParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getTemplateParameter_Name(), theTypesPackage.getString(), "name", null, 1, 1, TemplateParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getTemplateParameter_Base_templateparameter(), theUMLPackage.getTemplateParameter(), null, "base_templateparameter", null, 1, 1, TemplateParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(unionEClass, Union.class, "Union", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getUnion_Base_DataType(), theUMLPackage.getDataType(), null, "base_DataType", null, 1, 1, Union.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(storageClassEClass, StorageClass.class, "StorageClass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getStorageClass_StorageClass(), this.getEStorageClass(), "storageClass", null, 1, 1, StorageClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getStorageClass_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 0, 1, StorageClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getStorageClass_Base_Parameter(), theUMLPackage.getParameter(), null, "base_Parameter", null, 0, 1, StorageClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(volatileEClass, Volatile.class, "Volatile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getVolatile_Base_parameter(), theUMLPackage.getParameter(), null, "base_parameter", null, 0, 1, Volatile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getVolatile_Base_property(), theUMLPackage.getProperty(), null, "base_property", null, 0, 1, Volatile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getVolatile_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 0, 1, Volatile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(variadicEClass, Variadic.class, "Variadic", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getVariadic_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 1, 1, Variadic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(mutableEClass, Mutable.class, "Mutable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getMutable_Base_property(), theUMLPackage.getProperty(), null, "base_property", null, 1, 1, Mutable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - // Initialize enums and add enum literals - initEEnum(visibilityKindEEnum, VisibilityKind.class, "VisibilityKind"); - addEEnumLiteral(visibilityKindEEnum, VisibilityKind.PRIVATE); - addEEnumLiteral(visibilityKindEEnum, VisibilityKind.PROTECTED); - addEEnumLiteral(visibilityKindEEnum, VisibilityKind.PUBLIC); - - initEEnum(eAccessKindEEnum, EAccessKind.class, "EAccessKind"); - addEEnumLiteral(eAccessKindEEnum, EAccessKind.READ); - addEEnumLiteral(eAccessKindEEnum, EAccessKind.WRITE); - addEEnumLiteral(eAccessKindEEnum, EAccessKind.READ_WRITE); - - initEEnum(eStorageClassEEnum, EStorageClass.class, "EStorageClass"); - addEEnumLiteral(eStorageClassEEnum, EStorageClass.VOLATILE); - addEEnumLiteral(eStorageClassEEnum, EStorageClass.REGISTER); - addEEnumLiteral(eStorageClassEEnum, EStorageClass.EXTERN); - - // Create resource - createResource(eNS_URI); - } - -} // C_CppPackageImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstImpl.java deleted file mode 100644 index 0f14741165d..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstImpl.java +++ /dev/null @@ -1,292 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Const; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Property; - -/** - * - * An implementation of the model object 'Const'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ConstImpl#getBase_parameter Base parameter}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ConstImpl#getBase_property Base property}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ConstImpl#getBase_operation Base operation}
  • - *
- * - * @generated - */ -public class ConstImpl extends MinimalEObjectImpl.Container implements Const { - /** - * The cached value of the '{@link #getBase_parameter() Base parameter}' reference. - * - * - * @see #getBase_parameter() - * @generated - * @ordered - */ - protected Parameter base_parameter; - - /** - * The cached value of the '{@link #getBase_property() Base property}' reference. - * - * - * @see #getBase_property() - * @generated - * @ordered - */ - protected Property base_property; - - /** - * The cached value of the '{@link #getBase_operation() Base operation}' reference. - * - * - * @see #getBase_operation() - * @generated - * @ordered - */ - protected Operation base_operation; - - /** - * - * - * @generated - */ - protected ConstImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.CONST; - } - - /** - * - * - * @generated - */ - @Override - public Parameter getBase_parameter() { - if (base_parameter != null && base_parameter.eIsProxy()) { - InternalEObject oldBase_parameter = (InternalEObject)base_parameter; - base_parameter = (Parameter)eResolveProxy(oldBase_parameter); - if (base_parameter != oldBase_parameter) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.CONST__BASE_PARAMETER, oldBase_parameter, base_parameter)); - } - } - return base_parameter; - } - - /** - * - * - * @generated - */ - public Parameter basicGetBase_parameter() { - return base_parameter; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_parameter(Parameter newBase_parameter) { - Parameter oldBase_parameter = base_parameter; - base_parameter = newBase_parameter; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CONST__BASE_PARAMETER, oldBase_parameter, base_parameter)); - } - - /** - * - * - * @generated - */ - @Override - public Property getBase_property() { - if (base_property != null && base_property.eIsProxy()) { - InternalEObject oldBase_property = (InternalEObject)base_property; - base_property = (Property)eResolveProxy(oldBase_property); - if (base_property != oldBase_property) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.CONST__BASE_PROPERTY, oldBase_property, base_property)); - } - } - return base_property; - } - - /** - * - * - * @generated - */ - public Property basicGetBase_property() { - return base_property; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_property(Property newBase_property) { - Property oldBase_property = base_property; - base_property = newBase_property; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CONST__BASE_PROPERTY, oldBase_property, base_property)); - } - - /** - * - * - * @generated - */ - @Override - public Operation getBase_operation() { - if (base_operation != null && base_operation.eIsProxy()) { - InternalEObject oldBase_operation = (InternalEObject)base_operation; - base_operation = (Operation)eResolveProxy(oldBase_operation); - if (base_operation != oldBase_operation) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.CONST__BASE_OPERATION, oldBase_operation, base_operation)); - } - } - return base_operation; - } - - /** - * - * - * @generated - */ - public Operation basicGetBase_operation() { - return base_operation; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_operation(Operation newBase_operation) { - Operation oldBase_operation = base_operation; - base_operation = newBase_operation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CONST__BASE_OPERATION, oldBase_operation, base_operation)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.CONST__BASE_PARAMETER: - if (resolve) return getBase_parameter(); - return basicGetBase_parameter(); - case C_CppPackage.CONST__BASE_PROPERTY: - if (resolve) return getBase_property(); - return basicGetBase_property(); - case C_CppPackage.CONST__BASE_OPERATION: - if (resolve) return getBase_operation(); - return basicGetBase_operation(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.CONST__BASE_PARAMETER: - setBase_parameter((Parameter)newValue); - return; - case C_CppPackage.CONST__BASE_PROPERTY: - setBase_property((Property)newValue); - return; - case C_CppPackage.CONST__BASE_OPERATION: - setBase_operation((Operation)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.CONST__BASE_PARAMETER: - setBase_parameter((Parameter)null); - return; - case C_CppPackage.CONST__BASE_PROPERTY: - setBase_property((Property)null); - return; - case C_CppPackage.CONST__BASE_OPERATION: - setBase_operation((Operation)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.CONST__BASE_PARAMETER: - return base_parameter != null; - case C_CppPackage.CONST__BASE_PROPERTY: - return base_property != null; - case C_CppPackage.CONST__BASE_OPERATION: - return base_operation != null; - } - return super.eIsSet(featureID); - } - -} // ConstImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstInitImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstInitImpl.java deleted file mode 100644 index 0e0bfc786c3..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstInitImpl.java +++ /dev/null @@ -1,236 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.ConstInit; -import org.eclipse.uml2.uml.Operation; - -/** - * - * An implementation of the model object 'Const Init'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ConstInitImpl#getInitialisation Initialisation}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ConstInitImpl#getBase_operation Base operation}
  • - *
- * - * @generated - */ -public class ConstInitImpl extends MinimalEObjectImpl.Container implements ConstInit { - /** - * The default value of the '{@link #getInitialisation() Initialisation}' attribute. - * - * - * @see #getInitialisation() - * @generated - * @ordered - */ - protected static final String INITIALISATION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getInitialisation() Initialisation}' attribute. - * - * - * @see #getInitialisation() - * @generated - * @ordered - */ - protected String initialisation = INITIALISATION_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_operation() Base operation}' reference. - * - * - * @see #getBase_operation() - * @generated - * @ordered - */ - protected Operation base_operation; - - /** - * - * - * @generated - */ - protected ConstInitImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.CONST_INIT; - } - - /** - * - * - * @generated - */ - @Override - public String getInitialisation() { - return initialisation; - } - - /** - * - * - * @generated - */ - @Override - public void setInitialisation(String newInitialisation) { - String oldInitialisation = initialisation; - initialisation = newInitialisation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CONST_INIT__INITIALISATION, oldInitialisation, initialisation)); - } - - /** - * - * - * @generated - */ - @Override - public Operation getBase_operation() { - if (base_operation != null && base_operation.eIsProxy()) { - InternalEObject oldBase_operation = (InternalEObject)base_operation; - base_operation = (Operation)eResolveProxy(oldBase_operation); - if (base_operation != oldBase_operation) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.CONST_INIT__BASE_OPERATION, oldBase_operation, base_operation)); - } - } - return base_operation; - } - - /** - * - * - * @generated - */ - public Operation basicGetBase_operation() { - return base_operation; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_operation(Operation newBase_operation) { - Operation oldBase_operation = base_operation; - base_operation = newBase_operation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CONST_INIT__BASE_OPERATION, oldBase_operation, base_operation)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.CONST_INIT__INITIALISATION: - return getInitialisation(); - case C_CppPackage.CONST_INIT__BASE_OPERATION: - if (resolve) return getBase_operation(); - return basicGetBase_operation(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.CONST_INIT__INITIALISATION: - setInitialisation((String)newValue); - return; - case C_CppPackage.CONST_INIT__BASE_OPERATION: - setBase_operation((Operation)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.CONST_INIT__INITIALISATION: - setInitialisation(INITIALISATION_EDEFAULT); - return; - case C_CppPackage.CONST_INIT__BASE_OPERATION: - setBase_operation((Operation)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.CONST_INIT__INITIALISATION: - return INITIALISATION_EDEFAULT == null ? initialisation != null : !INITIALISATION_EDEFAULT.equals(initialisation); - case C_CppPackage.CONST_INIT__BASE_OPERATION: - return base_operation != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (initialisation: "); - result.append(initialisation); - result.append(')'); - return result.toString(); - } - -} // ConstInitImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppInitImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppInitImpl.java deleted file mode 100644 index 51cded9d983..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppInitImpl.java +++ /dev/null @@ -1,236 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.CppInit; -import org.eclipse.uml2.uml.EnumerationLiteral; - -/** - * - * An implementation of the model object 'Cpp Init'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.CppInitImpl#getValue Value}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.CppInitImpl#getBase_enumerationliteral Base enumerationliteral}
  • - *
- * - * @generated - */ -public class CppInitImpl extends MinimalEObjectImpl.Container implements CppInit { - /** - * The default value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected static final int VALUE_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected int value = VALUE_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_enumerationliteral() Base enumerationliteral}' reference. - * - * - * @see #getBase_enumerationliteral() - * @generated - * @ordered - */ - protected EnumerationLiteral base_enumerationliteral; - - /** - * - * - * @generated - */ - protected CppInitImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.CPP_INIT; - } - - /** - * - * - * @generated - */ - @Override - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - @Override - public void setValue(int newValue) { - int oldValue = value; - value = newValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CPP_INIT__VALUE, oldValue, value)); - } - - /** - * - * - * @generated - */ - @Override - public EnumerationLiteral getBase_enumerationliteral() { - if (base_enumerationliteral != null && base_enumerationliteral.eIsProxy()) { - InternalEObject oldBase_enumerationliteral = (InternalEObject)base_enumerationliteral; - base_enumerationliteral = (EnumerationLiteral)eResolveProxy(oldBase_enumerationliteral); - if (base_enumerationliteral != oldBase_enumerationliteral) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.CPP_INIT__BASE_ENUMERATIONLITERAL, oldBase_enumerationliteral, base_enumerationliteral)); - } - } - return base_enumerationliteral; - } - - /** - * - * - * @generated - */ - public EnumerationLiteral basicGetBase_enumerationliteral() { - return base_enumerationliteral; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_enumerationliteral(EnumerationLiteral newBase_enumerationliteral) { - EnumerationLiteral oldBase_enumerationliteral = base_enumerationliteral; - base_enumerationliteral = newBase_enumerationliteral; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CPP_INIT__BASE_ENUMERATIONLITERAL, oldBase_enumerationliteral, base_enumerationliteral)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.CPP_INIT__VALUE: - return getValue(); - case C_CppPackage.CPP_INIT__BASE_ENUMERATIONLITERAL: - if (resolve) return getBase_enumerationliteral(); - return basicGetBase_enumerationliteral(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.CPP_INIT__VALUE: - setValue((Integer)newValue); - return; - case C_CppPackage.CPP_INIT__BASE_ENUMERATIONLITERAL: - setBase_enumerationliteral((EnumerationLiteral)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.CPP_INIT__VALUE: - setValue(VALUE_EDEFAULT); - return; - case C_CppPackage.CPP_INIT__BASE_ENUMERATIONLITERAL: - setBase_enumerationliteral((EnumerationLiteral)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.CPP_INIT__VALUE: - return value != VALUE_EDEFAULT; - case C_CppPackage.CPP_INIT__BASE_ENUMERATIONLITERAL: - return base_enumerationliteral != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (value: "); - result.append(value); - result.append(')'); - return result.toString(); - } - -} // CppInitImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppRootImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppRootImpl.java deleted file mode 100644 index 99ecba8d819..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppRootImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.CppRoot; - -/** - * - * An implementation of the model object 'Cpp Root'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.CppRootImpl#getBase_package Base package}
  • - *
- * - * @generated - */ -public class CppRootImpl extends MinimalEObjectImpl.Container implements CppRoot { - /** - * The cached value of the '{@link #getBase_package() Base package}' reference. - * - * - * @see #getBase_package() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Package base_package; - - /** - * - * - * @generated - */ - protected CppRootImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.CPP_ROOT; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Package getBase_package() { - if (base_package != null && base_package.eIsProxy()) { - InternalEObject oldBase_package = (InternalEObject)base_package; - base_package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_package); - if (base_package != oldBase_package) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.CPP_ROOT__BASE_PACKAGE, oldBase_package, base_package)); - } - } - return base_package; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Package basicGetBase_package() { - return base_package; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_package(org.eclipse.uml2.uml.Package newBase_package) { - org.eclipse.uml2.uml.Package oldBase_package = base_package; - base_package = newBase_package; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CPP_ROOT__BASE_PACKAGE, oldBase_package, base_package)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.CPP_ROOT__BASE_PACKAGE: - if (resolve) return getBase_package(); - return basicGetBase_package(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.CPP_ROOT__BASE_PACKAGE: - setBase_package((org.eclipse.uml2.uml.Package)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.CPP_ROOT__BASE_PACKAGE: - setBase_package((org.eclipse.uml2.uml.Package)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.CPP_ROOT__BASE_PACKAGE: - return base_package != null; - } - return super.eIsSet(featureID); - } - -} // CppRootImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternLibraryImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternLibraryImpl.java deleted file mode 100644 index 3be2fad1a1a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternLibraryImpl.java +++ /dev/null @@ -1,370 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.emf.ecore.util.EDataTypeEList; -import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.ExternLibrary; - -/** - * - * An implementation of the model object 'Extern Library'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl#getIncludePaths Include Paths}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl#getBase_package Base package}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl#getLibPaths Lib Paths}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl#getMacros Macros}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl#getLibs Libs}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl#getIncludes Includes}
  • - *
- * - * @generated - */ -public class ExternLibraryImpl extends MinimalEObjectImpl.Container implements ExternLibrary { - /** - * The cached value of the '{@link #getIncludePaths() Include Paths}' attribute list. - * - * - * @see #getIncludePaths() - * @generated - * @ordered - */ - protected EList includePaths; - - /** - * The cached value of the '{@link #getBase_package() Base package}' reference. - * - * - * @see #getBase_package() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Package base_package; - - /** - * The cached value of the '{@link #getLibPaths() Lib Paths}' attribute list. - * - * - * @see #getLibPaths() - * @generated - * @ordered - */ - protected EList libPaths; - - /** - * The cached value of the '{@link #getMacros() Macros}' attribute list. - * - * - * @see #getMacros() - * @generated - * @ordered - */ - protected EList macros; - - /** - * The cached value of the '{@link #getLibs() Libs}' attribute list. - * - * - * @see #getLibs() - * @generated - * @ordered - */ - protected EList libs; - - /** - * The cached value of the '{@link #getIncludes() Includes}' attribute list. - * - * - * @see #getIncludes() - * @generated - * @ordered - */ - protected EList includes; - - /** - * - * - * @generated - */ - protected ExternLibraryImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.EXTERN_LIBRARY; - } - - /** - * - * - * @generated - */ - @Override - public EList getIncludePaths() { - if (includePaths == null) { - includePaths = new EDataTypeEList(String.class, this, C_CppPackage.EXTERN_LIBRARY__INCLUDE_PATHS); - } - return includePaths; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Package getBase_package() { - if (base_package != null && base_package.eIsProxy()) { - InternalEObject oldBase_package = (InternalEObject)base_package; - base_package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_package); - if (base_package != oldBase_package) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.EXTERN_LIBRARY__BASE_PACKAGE, oldBase_package, base_package)); - } - } - return base_package; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Package basicGetBase_package() { - return base_package; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_package(org.eclipse.uml2.uml.Package newBase_package) { - org.eclipse.uml2.uml.Package oldBase_package = base_package; - base_package = newBase_package; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.EXTERN_LIBRARY__BASE_PACKAGE, oldBase_package, base_package)); - } - - /** - * - * - * @generated - */ - @Override - public EList getLibPaths() { - if (libPaths == null) { - libPaths = new EDataTypeUniqueEList(String.class, this, C_CppPackage.EXTERN_LIBRARY__LIB_PATHS); - } - return libPaths; - } - - /** - * - * - * @generated - */ - @Override - public EList getMacros() { - if (macros == null) { - macros = new EDataTypeUniqueEList(String.class, this, C_CppPackage.EXTERN_LIBRARY__MACROS); - } - return macros; - } - - /** - * - * - * @generated - */ - @Override - public EList getLibs() { - if (libs == null) { - libs = new EDataTypeUniqueEList(String.class, this, C_CppPackage.EXTERN_LIBRARY__LIBS); - } - return libs; - } - - /** - * - * - * @generated - */ - @Override - public EList getIncludes() { - if (includes == null) { - includes = new EDataTypeUniqueEList(String.class, this, C_CppPackage.EXTERN_LIBRARY__INCLUDES); - } - return includes; - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.EXTERN_LIBRARY__INCLUDE_PATHS: - return getIncludePaths(); - case C_CppPackage.EXTERN_LIBRARY__BASE_PACKAGE: - if (resolve) return getBase_package(); - return basicGetBase_package(); - case C_CppPackage.EXTERN_LIBRARY__LIB_PATHS: - return getLibPaths(); - case C_CppPackage.EXTERN_LIBRARY__MACROS: - return getMacros(); - case C_CppPackage.EXTERN_LIBRARY__LIBS: - return getLibs(); - case C_CppPackage.EXTERN_LIBRARY__INCLUDES: - return getIncludes(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.EXTERN_LIBRARY__INCLUDE_PATHS: - getIncludePaths().clear(); - getIncludePaths().addAll((Collection)newValue); - return; - case C_CppPackage.EXTERN_LIBRARY__BASE_PACKAGE: - setBase_package((org.eclipse.uml2.uml.Package)newValue); - return; - case C_CppPackage.EXTERN_LIBRARY__LIB_PATHS: - getLibPaths().clear(); - getLibPaths().addAll((Collection)newValue); - return; - case C_CppPackage.EXTERN_LIBRARY__MACROS: - getMacros().clear(); - getMacros().addAll((Collection)newValue); - return; - case C_CppPackage.EXTERN_LIBRARY__LIBS: - getLibs().clear(); - getLibs().addAll((Collection)newValue); - return; - case C_CppPackage.EXTERN_LIBRARY__INCLUDES: - getIncludes().clear(); - getIncludes().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.EXTERN_LIBRARY__INCLUDE_PATHS: - getIncludePaths().clear(); - return; - case C_CppPackage.EXTERN_LIBRARY__BASE_PACKAGE: - setBase_package((org.eclipse.uml2.uml.Package)null); - return; - case C_CppPackage.EXTERN_LIBRARY__LIB_PATHS: - getLibPaths().clear(); - return; - case C_CppPackage.EXTERN_LIBRARY__MACROS: - getMacros().clear(); - return; - case C_CppPackage.EXTERN_LIBRARY__LIBS: - getLibs().clear(); - return; - case C_CppPackage.EXTERN_LIBRARY__INCLUDES: - getIncludes().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.EXTERN_LIBRARY__INCLUDE_PATHS: - return includePaths != null && !includePaths.isEmpty(); - case C_CppPackage.EXTERN_LIBRARY__BASE_PACKAGE: - return base_package != null; - case C_CppPackage.EXTERN_LIBRARY__LIB_PATHS: - return libPaths != null && !libPaths.isEmpty(); - case C_CppPackage.EXTERN_LIBRARY__MACROS: - return macros != null && !macros.isEmpty(); - case C_CppPackage.EXTERN_LIBRARY__LIBS: - return libs != null && !libs.isEmpty(); - case C_CppPackage.EXTERN_LIBRARY__INCLUDES: - return includes != null && !includes.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (includePaths: "); - result.append(includePaths); - result.append(", libPaths: "); - result.append(libPaths); - result.append(", macros: "); - result.append(macros); - result.append(", libs: "); - result.append(libs); - result.append(", includes: "); - result.append(includes); - result.append(')'); - return result.toString(); - } - -} // ExternLibraryImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternalImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternalImpl.java deleted file mode 100644 index 02982a5840c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternalImpl.java +++ /dev/null @@ -1,236 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.External; -import org.eclipse.uml2.uml.Classifier; - -/** - * - * An implementation of the model object 'External'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ExternalImpl#getName Name}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ExternalImpl#getBase_Classifier Base Classifier}
  • - *
- * - * @generated - */ -public class ExternalImpl extends MinimalEObjectImpl.Container implements External { - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_Classifier() Base Classifier}' reference. - * - * - * @see #getBase_Classifier() - * @generated - * @ordered - */ - protected Classifier base_Classifier; - - /** - * - * - * @generated - */ - protected ExternalImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.EXTERNAL; - } - - /** - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - @Override - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.EXTERNAL__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - @Override - public Classifier getBase_Classifier() { - if (base_Classifier != null && base_Classifier.eIsProxy()) { - InternalEObject oldBase_Classifier = (InternalEObject)base_Classifier; - base_Classifier = (Classifier)eResolveProxy(oldBase_Classifier); - if (base_Classifier != oldBase_Classifier) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.EXTERNAL__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier)); - } - } - return base_Classifier; - } - - /** - * - * - * @generated - */ - public Classifier basicGetBase_Classifier() { - return base_Classifier; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Classifier(Classifier newBase_Classifier) { - Classifier oldBase_Classifier = base_Classifier; - base_Classifier = newBase_Classifier; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.EXTERNAL__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.EXTERNAL__NAME: - return getName(); - case C_CppPackage.EXTERNAL__BASE_CLASSIFIER: - if (resolve) return getBase_Classifier(); - return basicGetBase_Classifier(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.EXTERNAL__NAME: - setName((String)newValue); - return; - case C_CppPackage.EXTERNAL__BASE_CLASSIFIER: - setBase_Classifier((Classifier)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.EXTERNAL__NAME: - setName(NAME_EDEFAULT); - return; - case C_CppPackage.EXTERNAL__BASE_CLASSIFIER: - setBase_Classifier((Classifier)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.EXTERNAL__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case C_CppPackage.EXTERNAL__BASE_CLASSIFIER: - return base_Classifier != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - -} // ExternalImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/FriendImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/FriendImpl.java deleted file mode 100644 index 128e37db5aa..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/FriendImpl.java +++ /dev/null @@ -1,229 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Friend; -import org.eclipse.uml2.uml.Dependency; -import org.eclipse.uml2.uml.Operation; - -/** - * - * An implementation of the model object 'Friend'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.FriendImpl#getBase_dependency Base dependency}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.FriendImpl#getBase_operation Base operation}
  • - *
- * - * @generated - */ -public class FriendImpl extends MinimalEObjectImpl.Container implements Friend { - /** - * The cached value of the '{@link #getBase_dependency() Base dependency}' reference. - * - * - * @see #getBase_dependency() - * @generated - * @ordered - */ - protected Dependency base_dependency; - - /** - * The cached value of the '{@link #getBase_operation() Base operation}' reference. - * - * - * @see #getBase_operation() - * @generated - * @ordered - */ - protected Operation base_operation; - - /** - * - * - * @generated - */ - protected FriendImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.FRIEND; - } - - /** - * - * - * @generated - */ - @Override - public Dependency getBase_dependency() { - if (base_dependency != null && base_dependency.eIsProxy()) { - InternalEObject oldBase_dependency = (InternalEObject)base_dependency; - base_dependency = (Dependency)eResolveProxy(oldBase_dependency); - if (base_dependency != oldBase_dependency) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.FRIEND__BASE_DEPENDENCY, oldBase_dependency, base_dependency)); - } - } - return base_dependency; - } - - /** - * - * - * @generated - */ - public Dependency basicGetBase_dependency() { - return base_dependency; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_dependency(Dependency newBase_dependency) { - Dependency oldBase_dependency = base_dependency; - base_dependency = newBase_dependency; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.FRIEND__BASE_DEPENDENCY, oldBase_dependency, base_dependency)); - } - - /** - * - * - * @generated - */ - @Override - public Operation getBase_operation() { - if (base_operation != null && base_operation.eIsProxy()) { - InternalEObject oldBase_operation = (InternalEObject)base_operation; - base_operation = (Operation)eResolveProxy(oldBase_operation); - if (base_operation != oldBase_operation) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.FRIEND__BASE_OPERATION, oldBase_operation, base_operation)); - } - } - return base_operation; - } - - /** - * - * - * @generated - */ - public Operation basicGetBase_operation() { - return base_operation; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_operation(Operation newBase_operation) { - Operation oldBase_operation = base_operation; - base_operation = newBase_operation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.FRIEND__BASE_OPERATION, oldBase_operation, base_operation)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.FRIEND__BASE_DEPENDENCY: - if (resolve) return getBase_dependency(); - return basicGetBase_dependency(); - case C_CppPackage.FRIEND__BASE_OPERATION: - if (resolve) return getBase_operation(); - return basicGetBase_operation(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.FRIEND__BASE_DEPENDENCY: - setBase_dependency((Dependency)newValue); - return; - case C_CppPackage.FRIEND__BASE_OPERATION: - setBase_operation((Operation)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.FRIEND__BASE_DEPENDENCY: - setBase_dependency((Dependency)null); - return; - case C_CppPackage.FRIEND__BASE_OPERATION: - setBase_operation((Operation)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.FRIEND__BASE_DEPENDENCY: - return base_dependency != null; - case C_CppPackage.FRIEND__BASE_OPERATION: - return base_operation != null; - } - return super.eIsSet(featureID); - } - -} // FriendImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/IncludeImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/IncludeImpl.java deleted file mode 100644 index e8d5bf7b6da..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/IncludeImpl.java +++ /dev/null @@ -1,468 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Include; -import org.eclipse.uml2.uml.Classifier; - -/** - * - * An implementation of the model object 'Include'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl#getBody Body}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl#getPreBody Pre Body}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl#getHeader Header}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl#getBase_package Base package}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl#getBase_class Base class}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl#getBase_Classifier Base Classifier}
  • - *
- * - * @generated - */ -public class IncludeImpl extends MinimalEObjectImpl.Container implements Include { - /** - * The default value of the '{@link #getBody() Body}' attribute. - * - * - * @see #getBody() - * @generated - * @ordered - */ - protected static final String BODY_EDEFAULT = ""; //$NON-NLS-1$ - - /** - * The cached value of the '{@link #getBody() Body}' attribute. - * - * - * @see #getBody() - * @generated - * @ordered - */ - protected String body = BODY_EDEFAULT; - - /** - * The default value of the '{@link #getPreBody() Pre Body}' attribute. - * - * - * @see #getPreBody() - * @generated - * @ordered - */ - protected static final String PRE_BODY_EDEFAULT = ""; //$NON-NLS-1$ - - /** - * The cached value of the '{@link #getPreBody() Pre Body}' attribute. - * - * - * @see #getPreBody() - * @generated - * @ordered - */ - protected String preBody = PRE_BODY_EDEFAULT; - - /** - * The default value of the '{@link #getHeader() Header}' attribute. - * - * - * @see #getHeader() - * @generated - * @ordered - */ - protected static final String HEADER_EDEFAULT = ""; //$NON-NLS-1$ - - /** - * The cached value of the '{@link #getHeader() Header}' attribute. - * - * - * @see #getHeader() - * @generated - * @ordered - */ - protected String header = HEADER_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_package() Base package}' reference. - * - * - * @see #getBase_package() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Package base_package; - - /** - * The cached value of the '{@link #getBase_class() Base class}' reference. - * - * - * @see #getBase_class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_class; - - /** - * The cached value of the '{@link #getBase_Classifier() Base Classifier}' reference. - * - * - * @see #getBase_Classifier() - * @generated - * @ordered - */ - protected Classifier base_Classifier; - - /** - * - * - * @generated - */ - protected IncludeImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.INCLUDE; - } - - /** - * - * - * @generated - */ - @Override - public String getBody() { - return body; - } - - /** - * - * - * @generated - */ - @Override - public void setBody(String newBody) { - String oldBody = body; - body = newBody; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INCLUDE__BODY, oldBody, body)); - } - - /** - * - * - * @generated - */ - @Override - public String getPreBody() { - return preBody; - } - - /** - * - * - * @generated - */ - @Override - public void setPreBody(String newPreBody) { - String oldPreBody = preBody; - preBody = newPreBody; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INCLUDE__PRE_BODY, oldPreBody, preBody)); - } - - /** - * - * - * @generated - */ - @Override - public String getHeader() { - return header; - } - - /** - * - * - * @generated - */ - @Override - public void setHeader(String newHeader) { - String oldHeader = header; - header = newHeader; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INCLUDE__HEADER, oldHeader, header)); - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Package getBase_package() { - if (base_package != null && base_package.eIsProxy()) { - InternalEObject oldBase_package = (InternalEObject)base_package; - base_package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_package); - if (base_package != oldBase_package) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.INCLUDE__BASE_PACKAGE, oldBase_package, base_package)); - } - } - return base_package; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Package basicGetBase_package() { - return base_package; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_package(org.eclipse.uml2.uml.Package newBase_package) { - org.eclipse.uml2.uml.Package oldBase_package = base_package; - base_package = newBase_package; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INCLUDE__BASE_PACKAGE, oldBase_package, base_package)); - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class getBase_class() { - if (base_class != null && base_class.eIsProxy()) { - InternalEObject oldBase_class = (InternalEObject)base_class; - base_class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_class); - if (base_class != oldBase_class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.INCLUDE__BASE_CLASS, oldBase_class, base_class)); - } - } - return base_class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_class() { - return base_class; - } - - /** - * - * - * @generated - */ - public void setBase_class(org.eclipse.uml2.uml.Class newBase_class) { - org.eclipse.uml2.uml.Class oldBase_class = base_class; - base_class = newBase_class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INCLUDE__BASE_CLASS, oldBase_class, base_class)); - } - - /** - * - * - * @generated - */ - public Classifier getBase_Classifier() { - if (base_Classifier != null && base_Classifier.eIsProxy()) { - InternalEObject oldBase_Classifier = (InternalEObject)base_Classifier; - base_Classifier = (Classifier)eResolveProxy(oldBase_Classifier); - if (base_Classifier != oldBase_Classifier) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.INCLUDE__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier)); - } - } - return base_Classifier; - } - - /** - * - * - * @generated - */ - public Classifier basicGetBase_Classifier() { - return base_Classifier; - } - - /** - * - * - * @generated - */ - public void setBase_Classifier(Classifier newBase_Classifier) { - Classifier oldBase_Classifier = base_Classifier; - base_Classifier = newBase_Classifier; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INCLUDE__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.INCLUDE__BODY: - return getBody(); - case C_CppPackage.INCLUDE__PRE_BODY: - return getPreBody(); - case C_CppPackage.INCLUDE__HEADER: - return getHeader(); - case C_CppPackage.INCLUDE__BASE_PACKAGE: - if (resolve) return getBase_package(); - return basicGetBase_package(); - case C_CppPackage.INCLUDE__BASE_CLASS: - if (resolve) return getBase_class(); - return basicGetBase_class(); - case C_CppPackage.INCLUDE__BASE_CLASSIFIER: - if (resolve) return getBase_Classifier(); - return basicGetBase_Classifier(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.INCLUDE__BODY: - setBody((String)newValue); - return; - case C_CppPackage.INCLUDE__PRE_BODY: - setPreBody((String)newValue); - return; - case C_CppPackage.INCLUDE__HEADER: - setHeader((String)newValue); - return; - case C_CppPackage.INCLUDE__BASE_PACKAGE: - setBase_package((org.eclipse.uml2.uml.Package)newValue); - return; - case C_CppPackage.INCLUDE__BASE_CLASS: - setBase_class((org.eclipse.uml2.uml.Class)newValue); - return; - case C_CppPackage.INCLUDE__BASE_CLASSIFIER: - setBase_Classifier((Classifier)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.INCLUDE__BODY: - setBody(BODY_EDEFAULT); - return; - case C_CppPackage.INCLUDE__PRE_BODY: - setPreBody(PRE_BODY_EDEFAULT); - return; - case C_CppPackage.INCLUDE__HEADER: - setHeader(HEADER_EDEFAULT); - return; - case C_CppPackage.INCLUDE__BASE_PACKAGE: - setBase_package((org.eclipse.uml2.uml.Package)null); - return; - case C_CppPackage.INCLUDE__BASE_CLASS: - setBase_class((org.eclipse.uml2.uml.Class)null); - return; - case C_CppPackage.INCLUDE__BASE_CLASSIFIER: - setBase_Classifier((Classifier)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.INCLUDE__BODY: - return BODY_EDEFAULT == null ? body != null : !BODY_EDEFAULT.equals(body); - case C_CppPackage.INCLUDE__PRE_BODY: - return PRE_BODY_EDEFAULT == null ? preBody != null : !PRE_BODY_EDEFAULT.equals(preBody); - case C_CppPackage.INCLUDE__HEADER: - return HEADER_EDEFAULT == null ? header != null : !HEADER_EDEFAULT.equals(header); - case C_CppPackage.INCLUDE__BASE_PACKAGE: - return base_package != null; - case C_CppPackage.INCLUDE__BASE_CLASS: - return base_class != null; - case C_CppPackage.INCLUDE__BASE_CLASSIFIER: - return base_Classifier != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (body: "); - result.append(body); - result.append(", preBody: "); - result.append(preBody); - result.append(", header: "); - result.append(header); - result.append(')'); - return result.toString(); - } - -} // IncludeImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/InlineImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/InlineImpl.java deleted file mode 100644 index 091904f7416..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/InlineImpl.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Inline; -import org.eclipse.uml2.uml.Operation; - -/** - * - * An implementation of the model object 'Inline'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.InlineImpl#getBase_operation Base operation}
  • - *
- * - * @generated - */ -public class InlineImpl extends MinimalEObjectImpl.Container implements Inline { - /** - * The cached value of the '{@link #getBase_operation() Base operation}' reference. - * - * - * @see #getBase_operation() - * @generated - * @ordered - */ - protected Operation base_operation; - - /** - * - * - * @generated - */ - protected InlineImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.INLINE; - } - - /** - * - * - * @generated - */ - @Override - public Operation getBase_operation() { - if (base_operation != null && base_operation.eIsProxy()) { - InternalEObject oldBase_operation = (InternalEObject)base_operation; - base_operation = (Operation)eResolveProxy(oldBase_operation); - if (base_operation != oldBase_operation) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.INLINE__BASE_OPERATION, oldBase_operation, base_operation)); - } - } - return base_operation; - } - - /** - * - * - * @generated - */ - public Operation basicGetBase_operation() { - return base_operation; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_operation(Operation newBase_operation) { - Operation oldBase_operation = base_operation; - base_operation = newBase_operation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INLINE__BASE_OPERATION, oldBase_operation, base_operation)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.INLINE__BASE_OPERATION: - if (resolve) return getBase_operation(); - return basicGetBase_operation(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.INLINE__BASE_OPERATION: - setBase_operation((Operation)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.INLINE__BASE_OPERATION: - setBase_operation((Operation)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.INLINE__BASE_OPERATION: - return base_operation != null; - } - return super.eIsSet(featureID); - } - -} // InlineImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ManualGenerationImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ManualGenerationImpl.java deleted file mode 100644 index 4507d67ed3b..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ManualGenerationImpl.java +++ /dev/null @@ -1,235 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.ManualGeneration; - -/** - * - * An implementation of the model object 'Manual Generation'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ManualGenerationImpl#getExtensionBody Extension Body}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.ManualGenerationImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class ManualGenerationImpl extends MinimalEObjectImpl.Container implements ManualGeneration { - /** - * The default value of the '{@link #getExtensionBody() Extension Body}' attribute. - * - * - * @see #getExtensionBody() - * @generated - * @ordered - */ - protected static final String EXTENSION_BODY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getExtensionBody() Extension Body}' attribute. - * - * - * @see #getExtensionBody() - * @generated - * @ordered - */ - protected String extensionBody = EXTENSION_BODY_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected ManualGenerationImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.MANUAL_GENERATION; - } - - /** - * - * - * @generated - */ - @Override - public String getExtensionBody() { - return extensionBody; - } - - /** - * - * - * @generated - */ - @Override - public void setExtensionBody(String newExtensionBody) { - String oldExtensionBody = extensionBody; - extensionBody = newExtensionBody; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.MANUAL_GENERATION__EXTENSION_BODY, oldExtensionBody, extensionBody)); - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.MANUAL_GENERATION__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.MANUAL_GENERATION__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.MANUAL_GENERATION__EXTENSION_BODY: - return getExtensionBody(); - case C_CppPackage.MANUAL_GENERATION__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.MANUAL_GENERATION__EXTENSION_BODY: - setExtensionBody((String)newValue); - return; - case C_CppPackage.MANUAL_GENERATION__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.MANUAL_GENERATION__EXTENSION_BODY: - setExtensionBody(EXTENSION_BODY_EDEFAULT); - return; - case C_CppPackage.MANUAL_GENERATION__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.MANUAL_GENERATION__EXTENSION_BODY: - return EXTENSION_BODY_EDEFAULT == null ? extensionBody != null : !EXTENSION_BODY_EDEFAULT.equals(extensionBody); - case C_CppPackage.MANUAL_GENERATION__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (extensionBody: "); - result.append(extensionBody); - result.append(')'); - return result.toString(); - } - -} // ManualGenerationImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/MutableImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/MutableImpl.java deleted file mode 100644 index d0d2217c44d..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/MutableImpl.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Mutable; - -import org.eclipse.uml2.uml.Property; - -/** - * - * An implementation of the model object 'Mutable'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.MutableImpl#getBase_property Base property}
  • - *
- * - * @generated - */ -public class MutableImpl extends MinimalEObjectImpl.Container implements Mutable { - /** - * The cached value of the '{@link #getBase_property() Base property}' reference. - * - * - * @see #getBase_property() - * @generated - * @ordered - */ - protected Property base_property; - /** - * - * - * @generated - */ - protected MutableImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.MUTABLE; - } - - /** - * - * - * @generated - */ - public Property getBase_property() { - if (base_property != null && base_property.eIsProxy()) { - InternalEObject oldBase_property = (InternalEObject)base_property; - base_property = (Property)eResolveProxy(oldBase_property); - if (base_property != oldBase_property) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.MUTABLE__BASE_PROPERTY, oldBase_property, base_property)); - } - } - return base_property; - } - - /** - * - * - * @generated - */ - public Property basicGetBase_property() { - return base_property; - } - - /** - * - * - * @generated - */ - public void setBase_property(Property newBase_property) { - Property oldBase_property = base_property; - base_property = newBase_property; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.MUTABLE__BASE_PROPERTY, oldBase_property, base_property)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.MUTABLE__BASE_PROPERTY: - if (resolve) return getBase_property(); - return basicGetBase_property(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.MUTABLE__BASE_PROPERTY: - setBase_property((Property)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.MUTABLE__BASE_PROPERTY: - setBase_property((Property)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.MUTABLE__BASE_PROPERTY: - return base_property != null; - } - return super.eIsSet(featureID); - } - -} //MutableImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/NoCodeGenImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/NoCodeGenImpl.java deleted file mode 100644 index 123867448aa..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/NoCodeGenImpl.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.NoCodeGen; -import org.eclipse.uml2.uml.Element; - -/** - * - * An implementation of the model object 'No Code Gen'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.NoCodeGenImpl#getBase_element Base element}
  • - *
- * - * @generated - */ -public class NoCodeGenImpl extends MinimalEObjectImpl.Container implements NoCodeGen { - /** - * The cached value of the '{@link #getBase_element() Base element}' reference. - * - * - * @see #getBase_element() - * @generated - * @ordered - */ - protected Element base_element; - - /** - * - * - * @generated - */ - protected NoCodeGenImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.NO_CODE_GEN; - } - - /** - * - * - * @generated - */ - @Override - public Element getBase_element() { - if (base_element != null && base_element.eIsProxy()) { - InternalEObject oldBase_element = (InternalEObject)base_element; - base_element = (Element)eResolveProxy(oldBase_element); - if (base_element != oldBase_element) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.NO_CODE_GEN__BASE_ELEMENT, oldBase_element, base_element)); - } - } - return base_element; - } - - /** - * - * - * @generated - */ - public Element basicGetBase_element() { - return base_element; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_element(Element newBase_element) { - Element oldBase_element = base_element; - base_element = newBase_element; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.NO_CODE_GEN__BASE_ELEMENT, oldBase_element, base_element)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.NO_CODE_GEN__BASE_ELEMENT: - if (resolve) return getBase_element(); - return basicGetBase_element(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.NO_CODE_GEN__BASE_ELEMENT: - setBase_element((Element)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.NO_CODE_GEN__BASE_ELEMENT: - setBase_element((Element)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.NO_CODE_GEN__BASE_ELEMENT: - return base_element != null; - } - return super.eIsSet(featureID); - } - -} // NoCodeGenImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/PtrImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/PtrImpl.java deleted file mode 100644 index e0d4cf2d577..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/PtrImpl.java +++ /dev/null @@ -1,299 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Ptr; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Property; - -/** - * - * An implementation of the model object 'Ptr'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.PtrImpl#getBase_parameter Base parameter}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.PtrImpl#getBase_property Base property}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.PtrImpl#getDeclaration Declaration}
  • - *
- * - * @generated - */ -public class PtrImpl extends MinimalEObjectImpl.Container implements Ptr { - /** - * The cached value of the '{@link #getBase_parameter() Base parameter}' reference. - * - * - * @see #getBase_parameter() - * @generated - * @ordered - */ - protected Parameter base_parameter; - - /** - * The cached value of the '{@link #getBase_property() Base property}' reference. - * - * - * @see #getBase_property() - * @generated - * @ordered - */ - protected Property base_property; - - /** - * The default value of the '{@link #getDeclaration() Declaration}' attribute. - * - * - * @see #getDeclaration() - * @generated - * @ordered - */ - protected static final String DECLARATION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDeclaration() Declaration}' attribute. - * - * - * @see #getDeclaration() - * @generated - * @ordered - */ - protected String declaration = DECLARATION_EDEFAULT; - - /** - * - * - * @generated - */ - protected PtrImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.PTR; - } - - /** - * - * - * @generated - */ - @Override - public Parameter getBase_parameter() { - if (base_parameter != null && base_parameter.eIsProxy()) { - InternalEObject oldBase_parameter = (InternalEObject)base_parameter; - base_parameter = (Parameter)eResolveProxy(oldBase_parameter); - if (base_parameter != oldBase_parameter) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.PTR__BASE_PARAMETER, oldBase_parameter, base_parameter)); - } - } - return base_parameter; - } - - /** - * - * - * @generated - */ - public Parameter basicGetBase_parameter() { - return base_parameter; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_parameter(Parameter newBase_parameter) { - Parameter oldBase_parameter = base_parameter; - base_parameter = newBase_parameter; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.PTR__BASE_PARAMETER, oldBase_parameter, base_parameter)); - } - - /** - * - * - * @generated - */ - @Override - public Property getBase_property() { - if (base_property != null && base_property.eIsProxy()) { - InternalEObject oldBase_property = (InternalEObject)base_property; - base_property = (Property)eResolveProxy(oldBase_property); - if (base_property != oldBase_property) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.PTR__BASE_PROPERTY, oldBase_property, base_property)); - } - } - return base_property; - } - - /** - * - * - * @generated - */ - public Property basicGetBase_property() { - return base_property; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_property(Property newBase_property) { - Property oldBase_property = base_property; - base_property = newBase_property; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.PTR__BASE_PROPERTY, oldBase_property, base_property)); - } - - /** - * - * - * @generated - */ - @Override - public String getDeclaration() { - return declaration; - } - - /** - * - * - * @generated - */ - @Override - public void setDeclaration(String newDeclaration) { - String oldDeclaration = declaration; - declaration = newDeclaration; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.PTR__DECLARATION, oldDeclaration, declaration)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.PTR__BASE_PARAMETER: - if (resolve) return getBase_parameter(); - return basicGetBase_parameter(); - case C_CppPackage.PTR__BASE_PROPERTY: - if (resolve) return getBase_property(); - return basicGetBase_property(); - case C_CppPackage.PTR__DECLARATION: - return getDeclaration(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.PTR__BASE_PARAMETER: - setBase_parameter((Parameter)newValue); - return; - case C_CppPackage.PTR__BASE_PROPERTY: - setBase_property((Property)newValue); - return; - case C_CppPackage.PTR__DECLARATION: - setDeclaration((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.PTR__BASE_PARAMETER: - setBase_parameter((Parameter)null); - return; - case C_CppPackage.PTR__BASE_PROPERTY: - setBase_property((Property)null); - return; - case C_CppPackage.PTR__DECLARATION: - setDeclaration(DECLARATION_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.PTR__BASE_PARAMETER: - return base_parameter != null; - case C_CppPackage.PTR__BASE_PROPERTY: - return base_property != null; - case C_CppPackage.PTR__DECLARATION: - return DECLARATION_EDEFAULT == null ? declaration != null : !DECLARATION_EDEFAULT.equals(declaration); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (declaration: "); - result.append(declaration); - result.append(')'); - return result.toString(); - } - -} // PtrImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/RefImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/RefImpl.java deleted file mode 100644 index 59529e7d1e4..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/RefImpl.java +++ /dev/null @@ -1,229 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Ref; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Property; - -/** - * - * An implementation of the model object 'Ref'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.RefImpl#getBase_parameter Base parameter}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.RefImpl#getBase_property Base property}
  • - *
- * - * @generated - */ -public class RefImpl extends MinimalEObjectImpl.Container implements Ref { - /** - * The cached value of the '{@link #getBase_parameter() Base parameter}' reference. - * - * - * @see #getBase_parameter() - * @generated - * @ordered - */ - protected Parameter base_parameter; - - /** - * The cached value of the '{@link #getBase_property() Base property}' reference. - * - * - * @see #getBase_property() - * @generated - * @ordered - */ - protected Property base_property; - - /** - * - * - * @generated - */ - protected RefImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.REF; - } - - /** - * - * - * @generated - */ - @Override - public Parameter getBase_parameter() { - if (base_parameter != null && base_parameter.eIsProxy()) { - InternalEObject oldBase_parameter = (InternalEObject)base_parameter; - base_parameter = (Parameter)eResolveProxy(oldBase_parameter); - if (base_parameter != oldBase_parameter) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.REF__BASE_PARAMETER, oldBase_parameter, base_parameter)); - } - } - return base_parameter; - } - - /** - * - * - * @generated - */ - public Parameter basicGetBase_parameter() { - return base_parameter; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_parameter(Parameter newBase_parameter) { - Parameter oldBase_parameter = base_parameter; - base_parameter = newBase_parameter; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.REF__BASE_PARAMETER, oldBase_parameter, base_parameter)); - } - - /** - * - * - * @generated - */ - @Override - public Property getBase_property() { - if (base_property != null && base_property.eIsProxy()) { - InternalEObject oldBase_property = (InternalEObject)base_property; - base_property = (Property)eResolveProxy(oldBase_property); - if (base_property != oldBase_property) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.REF__BASE_PROPERTY, oldBase_property, base_property)); - } - } - return base_property; - } - - /** - * - * - * @generated - */ - public Property basicGetBase_property() { - return base_property; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_property(Property newBase_property) { - Property oldBase_property = base_property; - base_property = newBase_property; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.REF__BASE_PROPERTY, oldBase_property, base_property)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.REF__BASE_PARAMETER: - if (resolve) return getBase_parameter(); - return basicGetBase_parameter(); - case C_CppPackage.REF__BASE_PROPERTY: - if (resolve) return getBase_property(); - return basicGetBase_property(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.REF__BASE_PARAMETER: - setBase_parameter((Parameter)newValue); - return; - case C_CppPackage.REF__BASE_PROPERTY: - setBase_property((Property)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.REF__BASE_PARAMETER: - setBase_parameter((Parameter)null); - return; - case C_CppPackage.REF__BASE_PROPERTY: - setBase_property((Property)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.REF__BASE_PARAMETER: - return base_parameter != null; - case C_CppPackage.REF__BASE_PROPERTY: - return base_property != null; - } - return super.eIsSet(featureID); - } - -} // RefImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/StorageClassImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/StorageClassImpl.java deleted file mode 100644 index e2300c07f8e..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/StorageClassImpl.java +++ /dev/null @@ -1,296 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.EStorageClass; -import org.eclipse.papyrus.C_Cpp.StorageClass; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Property; - -/** - * - * An implementation of the model object 'Storage Class'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl#getStorageClass Storage Class}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl#getBase_Property Base Property}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl#getBase_Parameter Base Parameter}
  • - *
- * - * @generated - */ -public class StorageClassImpl extends MinimalEObjectImpl.Container implements StorageClass { - /** - * The default value of the '{@link #getStorageClass() Storage Class}' attribute. - * - * - * @see #getStorageClass() - * @generated - * @ordered - */ - protected static final EStorageClass STORAGE_CLASS_EDEFAULT = EStorageClass.VOLATILE; - - /** - * The cached value of the '{@link #getStorageClass() Storage Class}' attribute. - * - * - * @see #getStorageClass() - * @generated - * @ordered - */ - protected EStorageClass storageClass = STORAGE_CLASS_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_Property() Base Property}' reference. - * - * - * @see #getBase_Property() - * @generated - * @ordered - */ - protected Property base_Property; - - /** - * The cached value of the '{@link #getBase_Parameter() Base Parameter}' reference. - * - * - * @see #getBase_Parameter() - * @generated - * @ordered - */ - protected Parameter base_Parameter; - - /** - * - * - * @generated - */ - protected StorageClassImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.STORAGE_CLASS; - } - - /** - * - * - * @generated - */ - @Override - public EStorageClass getStorageClass() { - return storageClass; - } - - /** - * - * - * @generated - */ - @Override - public void setStorageClass(EStorageClass newStorageClass) { - EStorageClass oldStorageClass = storageClass; - storageClass = newStorageClass == null ? STORAGE_CLASS_EDEFAULT : newStorageClass; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.STORAGE_CLASS__STORAGE_CLASS, oldStorageClass, storageClass)); - } - - /** - * - * - * @generated - */ - public Property getBase_Property() { - if (base_Property != null && base_Property.eIsProxy()) { - InternalEObject oldBase_Property = (InternalEObject)base_Property; - base_Property = (Property)eResolveProxy(oldBase_Property); - if (base_Property != oldBase_Property) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.STORAGE_CLASS__BASE_PROPERTY, oldBase_Property, base_Property)); - } - } - return base_Property; - } - - /** - * - * - * @generated - */ - public Property basicGetBase_Property() { - return base_Property; - } - - /** - * - * - * @generated - */ - public void setBase_Property(Property newBase_Property) { - Property oldBase_Property = base_Property; - base_Property = newBase_Property; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.STORAGE_CLASS__BASE_PROPERTY, oldBase_Property, base_Property)); - } - - /** - * - * - * @generated - */ - public Parameter getBase_Parameter() { - if (base_Parameter != null && base_Parameter.eIsProxy()) { - InternalEObject oldBase_Parameter = (InternalEObject)base_Parameter; - base_Parameter = (Parameter)eResolveProxy(oldBase_Parameter); - if (base_Parameter != oldBase_Parameter) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.STORAGE_CLASS__BASE_PARAMETER, oldBase_Parameter, base_Parameter)); - } - } - return base_Parameter; - } - - /** - * - * - * @generated - */ - public Parameter basicGetBase_Parameter() { - return base_Parameter; - } - - /** - * - * - * @generated - */ - public void setBase_Parameter(Parameter newBase_Parameter) { - Parameter oldBase_Parameter = base_Parameter; - base_Parameter = newBase_Parameter; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.STORAGE_CLASS__BASE_PARAMETER, oldBase_Parameter, base_Parameter)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.STORAGE_CLASS__STORAGE_CLASS: - return getStorageClass(); - case C_CppPackage.STORAGE_CLASS__BASE_PROPERTY: - if (resolve) return getBase_Property(); - return basicGetBase_Property(); - case C_CppPackage.STORAGE_CLASS__BASE_PARAMETER: - if (resolve) return getBase_Parameter(); - return basicGetBase_Parameter(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.STORAGE_CLASS__STORAGE_CLASS: - setStorageClass((EStorageClass)newValue); - return; - case C_CppPackage.STORAGE_CLASS__BASE_PROPERTY: - setBase_Property((Property)newValue); - return; - case C_CppPackage.STORAGE_CLASS__BASE_PARAMETER: - setBase_Parameter((Parameter)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.STORAGE_CLASS__STORAGE_CLASS: - setStorageClass(STORAGE_CLASS_EDEFAULT); - return; - case C_CppPackage.STORAGE_CLASS__BASE_PROPERTY: - setBase_Property((Property)null); - return; - case C_CppPackage.STORAGE_CLASS__BASE_PARAMETER: - setBase_Parameter((Parameter)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.STORAGE_CLASS__STORAGE_CLASS: - return storageClass != STORAGE_CLASS_EDEFAULT; - case C_CppPackage.STORAGE_CLASS__BASE_PROPERTY: - return base_Property != null; - case C_CppPackage.STORAGE_CLASS__BASE_PARAMETER: - return base_Parameter != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (storageClass: "); - result.append(storageClass); - result.append(')'); - return result.toString(); - } - -} // StorageClassImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateBindingImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateBindingImpl.java deleted file mode 100644 index 097340a211b..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateBindingImpl.java +++ /dev/null @@ -1,235 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.TemplateBinding; - -/** - * - * An implementation of the model object 'Template Binding'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.TemplateBindingImpl#getBinding Binding}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.TemplateBindingImpl#getBase_templatebinding Base templatebinding}
  • - *
- * - * @generated - */ -public class TemplateBindingImpl extends MinimalEObjectImpl.Container implements TemplateBinding { - /** - * The default value of the '{@link #getBinding() Binding}' attribute. - * - * - * @see #getBinding() - * @generated - * @ordered - */ - protected static final String BINDING_EDEFAULT = null; - - /** - * The cached value of the '{@link #getBinding() Binding}' attribute. - * - * - * @see #getBinding() - * @generated - * @ordered - */ - protected String binding = BINDING_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_templatebinding() Base templatebinding}' reference. - * - * - * @see #getBase_templatebinding() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.TemplateBinding base_templatebinding; - - /** - * - * - * @generated - */ - protected TemplateBindingImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.TEMPLATE_BINDING; - } - - /** - * - * - * @generated - */ - @Override - public String getBinding() { - return binding; - } - - /** - * - * - * @generated - */ - @Override - public void setBinding(String newBinding) { - String oldBinding = binding; - binding = newBinding; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TEMPLATE_BINDING__BINDING, oldBinding, binding)); - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.TemplateBinding getBase_templatebinding() { - if (base_templatebinding != null && base_templatebinding.eIsProxy()) { - InternalEObject oldBase_templatebinding = (InternalEObject)base_templatebinding; - base_templatebinding = (org.eclipse.uml2.uml.TemplateBinding)eResolveProxy(oldBase_templatebinding); - if (base_templatebinding != oldBase_templatebinding) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.TEMPLATE_BINDING__BASE_TEMPLATEBINDING, oldBase_templatebinding, base_templatebinding)); - } - } - return base_templatebinding; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.TemplateBinding basicGetBase_templatebinding() { - return base_templatebinding; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_templatebinding(org.eclipse.uml2.uml.TemplateBinding newBase_templatebinding) { - org.eclipse.uml2.uml.TemplateBinding oldBase_templatebinding = base_templatebinding; - base_templatebinding = newBase_templatebinding; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TEMPLATE_BINDING__BASE_TEMPLATEBINDING, oldBase_templatebinding, base_templatebinding)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.TEMPLATE_BINDING__BINDING: - return getBinding(); - case C_CppPackage.TEMPLATE_BINDING__BASE_TEMPLATEBINDING: - if (resolve) return getBase_templatebinding(); - return basicGetBase_templatebinding(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.TEMPLATE_BINDING__BINDING: - setBinding((String)newValue); - return; - case C_CppPackage.TEMPLATE_BINDING__BASE_TEMPLATEBINDING: - setBase_templatebinding((org.eclipse.uml2.uml.TemplateBinding)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.TEMPLATE_BINDING__BINDING: - setBinding(BINDING_EDEFAULT); - return; - case C_CppPackage.TEMPLATE_BINDING__BASE_TEMPLATEBINDING: - setBase_templatebinding((org.eclipse.uml2.uml.TemplateBinding)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.TEMPLATE_BINDING__BINDING: - return BINDING_EDEFAULT == null ? binding != null : !BINDING_EDEFAULT.equals(binding); - case C_CppPackage.TEMPLATE_BINDING__BASE_TEMPLATEBINDING: - return base_templatebinding != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (binding: "); - result.append(binding); - result.append(')'); - return result.toString(); - } - -} // TemplateBindingImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateImpl.java deleted file mode 100644 index 17a3a741071..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateImpl.java +++ /dev/null @@ -1,235 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Template; - -/** - * - * An implementation of the model object 'Template'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.TemplateImpl#getDeclaration Declaration}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.TemplateImpl#getBase_class Base class}
  • - *
- * - * @generated - */ -public class TemplateImpl extends MinimalEObjectImpl.Container implements Template { - /** - * The default value of the '{@link #getDeclaration() Declaration}' attribute. - * - * - * @see #getDeclaration() - * @generated - * @ordered - */ - protected static final String DECLARATION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDeclaration() Declaration}' attribute. - * - * - * @see #getDeclaration() - * @generated - * @ordered - */ - protected String declaration = DECLARATION_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_class() Base class}' reference. - * - * - * @see #getBase_class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_class; - - /** - * - * - * @generated - */ - protected TemplateImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.TEMPLATE; - } - - /** - * - * - * @generated - */ - @Override - public String getDeclaration() { - return declaration; - } - - /** - * - * - * @generated - */ - @Override - public void setDeclaration(String newDeclaration) { - String oldDeclaration = declaration; - declaration = newDeclaration; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TEMPLATE__DECLARATION, oldDeclaration, declaration)); - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_class() { - if (base_class != null && base_class.eIsProxy()) { - InternalEObject oldBase_class = (InternalEObject)base_class; - base_class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_class); - if (base_class != oldBase_class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.TEMPLATE__BASE_CLASS, oldBase_class, base_class)); - } - } - return base_class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_class() { - return base_class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_class(org.eclipse.uml2.uml.Class newBase_class) { - org.eclipse.uml2.uml.Class oldBase_class = base_class; - base_class = newBase_class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TEMPLATE__BASE_CLASS, oldBase_class, base_class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.TEMPLATE__DECLARATION: - return getDeclaration(); - case C_CppPackage.TEMPLATE__BASE_CLASS: - if (resolve) return getBase_class(); - return basicGetBase_class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.TEMPLATE__DECLARATION: - setDeclaration((String)newValue); - return; - case C_CppPackage.TEMPLATE__BASE_CLASS: - setBase_class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.TEMPLATE__DECLARATION: - setDeclaration(DECLARATION_EDEFAULT); - return; - case C_CppPackage.TEMPLATE__BASE_CLASS: - setBase_class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.TEMPLATE__DECLARATION: - return DECLARATION_EDEFAULT == null ? declaration != null : !DECLARATION_EDEFAULT.equals(declaration); - case C_CppPackage.TEMPLATE__BASE_CLASS: - return base_class != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (declaration: "); - result.append(declaration); - result.append(')'); - return result.toString(); - } - -} // TemplateImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateParameterImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateParameterImpl.java deleted file mode 100644 index 2ba65fbebfb..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateParameterImpl.java +++ /dev/null @@ -1,235 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.TemplateParameter; - -/** - * - * An implementation of the model object 'Template Parameter'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.TemplateParameterImpl#getName Name}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.TemplateParameterImpl#getBase_templateparameter Base templateparameter}
  • - *
- * - * @generated - */ -public class TemplateParameterImpl extends MinimalEObjectImpl.Container implements TemplateParameter { - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_templateparameter() Base templateparameter}' reference. - * - * - * @see #getBase_templateparameter() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.TemplateParameter base_templateparameter; - - /** - * - * - * @generated - */ - protected TemplateParameterImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.TEMPLATE_PARAMETER; - } - - /** - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - @Override - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TEMPLATE_PARAMETER__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.TemplateParameter getBase_templateparameter() { - if (base_templateparameter != null && base_templateparameter.eIsProxy()) { - InternalEObject oldBase_templateparameter = (InternalEObject)base_templateparameter; - base_templateparameter = (org.eclipse.uml2.uml.TemplateParameter)eResolveProxy(oldBase_templateparameter); - if (base_templateparameter != oldBase_templateparameter) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER, oldBase_templateparameter, base_templateparameter)); - } - } - return base_templateparameter; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.TemplateParameter basicGetBase_templateparameter() { - return base_templateparameter; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_templateparameter(org.eclipse.uml2.uml.TemplateParameter newBase_templateparameter) { - org.eclipse.uml2.uml.TemplateParameter oldBase_templateparameter = base_templateparameter; - base_templateparameter = newBase_templateparameter; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER, oldBase_templateparameter, base_templateparameter)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.TEMPLATE_PARAMETER__NAME: - return getName(); - case C_CppPackage.TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER: - if (resolve) return getBase_templateparameter(); - return basicGetBase_templateparameter(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.TEMPLATE_PARAMETER__NAME: - setName((String)newValue); - return; - case C_CppPackage.TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER: - setBase_templateparameter((org.eclipse.uml2.uml.TemplateParameter)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.TEMPLATE_PARAMETER__NAME: - setName(NAME_EDEFAULT); - return; - case C_CppPackage.TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER: - setBase_templateparameter((org.eclipse.uml2.uml.TemplateParameter)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.TEMPLATE_PARAMETER__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case C_CppPackage.TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER: - return base_templateparameter != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - -} // TemplateParameterImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TypedefImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TypedefImpl.java deleted file mode 100644 index dd30383f008..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TypedefImpl.java +++ /dev/null @@ -1,236 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Typedef; -import org.eclipse.uml2.uml.PrimitiveType; - -/** - * - * An implementation of the model object 'Typedef'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.TypedefImpl#getDefinition Definition}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.TypedefImpl#getBase_primitivetype Base primitivetype}
  • - *
- * - * @generated - */ -public class TypedefImpl extends MinimalEObjectImpl.Container implements Typedef { - /** - * The default value of the '{@link #getDefinition() Definition}' attribute. - * - * - * @see #getDefinition() - * @generated - * @ordered - */ - protected static final String DEFINITION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefinition() Definition}' attribute. - * - * - * @see #getDefinition() - * @generated - * @ordered - */ - protected String definition = DEFINITION_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_primitivetype() Base primitivetype}' reference. - * - * - * @see #getBase_primitivetype() - * @generated - * @ordered - */ - protected PrimitiveType base_primitivetype; - - /** - * - * - * @generated - */ - protected TypedefImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.TYPEDEF; - } - - /** - * - * - * @generated - */ - @Override - public String getDefinition() { - return definition; - } - - /** - * - * - * @generated - */ - @Override - public void setDefinition(String newDefinition) { - String oldDefinition = definition; - definition = newDefinition; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TYPEDEF__DEFINITION, oldDefinition, definition)); - } - - /** - * - * - * @generated - */ - @Override - public PrimitiveType getBase_primitivetype() { - if (base_primitivetype != null && base_primitivetype.eIsProxy()) { - InternalEObject oldBase_primitivetype = (InternalEObject)base_primitivetype; - base_primitivetype = (PrimitiveType)eResolveProxy(oldBase_primitivetype); - if (base_primitivetype != oldBase_primitivetype) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.TYPEDEF__BASE_PRIMITIVETYPE, oldBase_primitivetype, base_primitivetype)); - } - } - return base_primitivetype; - } - - /** - * - * - * @generated - */ - public PrimitiveType basicGetBase_primitivetype() { - return base_primitivetype; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_primitivetype(PrimitiveType newBase_primitivetype) { - PrimitiveType oldBase_primitivetype = base_primitivetype; - base_primitivetype = newBase_primitivetype; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TYPEDEF__BASE_PRIMITIVETYPE, oldBase_primitivetype, base_primitivetype)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.TYPEDEF__DEFINITION: - return getDefinition(); - case C_CppPackage.TYPEDEF__BASE_PRIMITIVETYPE: - if (resolve) return getBase_primitivetype(); - return basicGetBase_primitivetype(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.TYPEDEF__DEFINITION: - setDefinition((String)newValue); - return; - case C_CppPackage.TYPEDEF__BASE_PRIMITIVETYPE: - setBase_primitivetype((PrimitiveType)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.TYPEDEF__DEFINITION: - setDefinition(DEFINITION_EDEFAULT); - return; - case C_CppPackage.TYPEDEF__BASE_PRIMITIVETYPE: - setBase_primitivetype((PrimitiveType)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.TYPEDEF__DEFINITION: - return DEFINITION_EDEFAULT == null ? definition != null : !DEFINITION_EDEFAULT.equals(definition); - case C_CppPackage.TYPEDEF__BASE_PRIMITIVETYPE: - return base_primitivetype != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (definition: "); - result.append(definition); - result.append(')'); - return result.toString(); - } - -} // TypedefImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/UnionImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/UnionImpl.java deleted file mode 100644 index ece4ef86bb1..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/UnionImpl.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Union; -import org.eclipse.uml2.uml.DataType; - -/** - * - * An implementation of the model object 'Union'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.UnionImpl#getBase_DataType Base Data Type}
  • - *
- * - * @generated - */ -public class UnionImpl extends MinimalEObjectImpl.Container implements Union { - /** - * The cached value of the '{@link #getBase_DataType() Base Data Type}' reference. - * - * - * @see #getBase_DataType() - * @generated - * @ordered - */ - protected DataType base_DataType; - - /** - * - * - * @generated - */ - protected UnionImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.UNION; - } - - /** - * - * - * @generated - */ - @Override - public DataType getBase_DataType() { - if (base_DataType != null && base_DataType.eIsProxy()) { - InternalEObject oldBase_DataType = (InternalEObject)base_DataType; - base_DataType = (DataType)eResolveProxy(oldBase_DataType); - if (base_DataType != oldBase_DataType) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.UNION__BASE_DATA_TYPE, oldBase_DataType, base_DataType)); - } - } - return base_DataType; - } - - /** - * - * - * @generated - */ - public DataType basicGetBase_DataType() { - return base_DataType; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_DataType(DataType newBase_DataType) { - DataType oldBase_DataType = base_DataType; - base_DataType = newBase_DataType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.UNION__BASE_DATA_TYPE, oldBase_DataType, base_DataType)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.UNION__BASE_DATA_TYPE: - if (resolve) return getBase_DataType(); - return basicGetBase_DataType(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.UNION__BASE_DATA_TYPE: - setBase_DataType((DataType)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.UNION__BASE_DATA_TYPE: - setBase_DataType((DataType)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.UNION__BASE_DATA_TYPE: - return base_DataType != null; - } - return super.eIsSet(featureID); - } - -} // UnionImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VariadicImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VariadicImpl.java deleted file mode 100644 index d59834ca4ad..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VariadicImpl.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Variadic; - -import org.eclipse.uml2.uml.Operation; - -/** - * - * An implementation of the model object 'Variadic'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.VariadicImpl#getBase_operation Base operation}
  • - *
- * - * @generated - */ -public class VariadicImpl extends MinimalEObjectImpl.Container implements Variadic { - /** - * The cached value of the '{@link #getBase_operation() Base operation}' reference. - * - * - * @see #getBase_operation() - * @generated - * @ordered - */ - protected Operation base_operation; - /** - * - * - * @generated - */ - protected VariadicImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.VARIADIC; - } - - /** - * - * - * @generated - */ - public Operation getBase_operation() { - if (base_operation != null && base_operation.eIsProxy()) { - InternalEObject oldBase_operation = (InternalEObject)base_operation; - base_operation = (Operation)eResolveProxy(oldBase_operation); - if (base_operation != oldBase_operation) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.VARIADIC__BASE_OPERATION, oldBase_operation, base_operation)); - } - } - return base_operation; - } - - /** - * - * - * @generated - */ - public Operation basicGetBase_operation() { - return base_operation; - } - - /** - * - * - * @generated - */ - public void setBase_operation(Operation newBase_operation) { - Operation oldBase_operation = base_operation; - base_operation = newBase_operation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VARIADIC__BASE_OPERATION, oldBase_operation, base_operation)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.VARIADIC__BASE_OPERATION: - if (resolve) return getBase_operation(); - return basicGetBase_operation(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.VARIADIC__BASE_OPERATION: - setBase_operation((Operation)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.VARIADIC__BASE_OPERATION: - setBase_operation((Operation)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.VARIADIC__BASE_OPERATION: - return base_operation != null; - } - return super.eIsSet(featureID); - } - -} //VariadicImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VirtualImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VirtualImpl.java deleted file mode 100644 index 0455159368d..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VirtualImpl.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Virtual; -import org.eclipse.uml2.uml.Operation; - -/** - * - * An implementation of the model object 'Virtual'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.VirtualImpl#getBase_operation Base operation}
  • - *
- * - * @generated - */ -public class VirtualImpl extends MinimalEObjectImpl.Container implements Virtual { - /** - * The cached value of the '{@link #getBase_operation() Base operation}' reference. - * - * - * @see #getBase_operation() - * @generated - * @ordered - */ - protected Operation base_operation; - - /** - * - * - * @generated - */ - protected VirtualImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.VIRTUAL; - } - - /** - * - * - * @generated - */ - @Override - public Operation getBase_operation() { - if (base_operation != null && base_operation.eIsProxy()) { - InternalEObject oldBase_operation = (InternalEObject)base_operation; - base_operation = (Operation)eResolveProxy(oldBase_operation); - if (base_operation != oldBase_operation) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.VIRTUAL__BASE_OPERATION, oldBase_operation, base_operation)); - } - } - return base_operation; - } - - /** - * - * - * @generated - */ - public Operation basicGetBase_operation() { - return base_operation; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_operation(Operation newBase_operation) { - Operation oldBase_operation = base_operation; - base_operation = newBase_operation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VIRTUAL__BASE_OPERATION, oldBase_operation, base_operation)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.VIRTUAL__BASE_OPERATION: - if (resolve) return getBase_operation(); - return basicGetBase_operation(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.VIRTUAL__BASE_OPERATION: - setBase_operation((Operation)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.VIRTUAL__BASE_OPERATION: - setBase_operation((Operation)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.VIRTUAL__BASE_OPERATION: - return base_operation != null; - } - return super.eIsSet(featureID); - } - -} // VirtualImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VisibilityImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VisibilityImpl.java deleted file mode 100644 index 6d865b6a19e..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VisibilityImpl.java +++ /dev/null @@ -1,236 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Visibility; -import org.eclipse.uml2.uml.Generalization; - -/** - * - * An implementation of the model object 'Visibility'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.VisibilityImpl#getValue Value}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.VisibilityImpl#getBase_generalization Base generalization}
  • - *
- * - * @generated - */ -public class VisibilityImpl extends MinimalEObjectImpl.Container implements Visibility { - /** - * The default value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected static final String VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected String value = VALUE_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_generalization() Base generalization}' reference. - * - * - * @see #getBase_generalization() - * @generated - * @ordered - */ - protected Generalization base_generalization; - - /** - * - * - * @generated - */ - protected VisibilityImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.VISIBILITY; - } - - /** - * - * - * @generated - */ - @Override - public String getValue() { - return value; - } - - /** - * - * - * @generated - */ - @Override - public void setValue(String newValue) { - String oldValue = value; - value = newValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VISIBILITY__VALUE, oldValue, value)); - } - - /** - * - * - * @generated - */ - @Override - public Generalization getBase_generalization() { - if (base_generalization != null && base_generalization.eIsProxy()) { - InternalEObject oldBase_generalization = (InternalEObject)base_generalization; - base_generalization = (Generalization)eResolveProxy(oldBase_generalization); - if (base_generalization != oldBase_generalization) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.VISIBILITY__BASE_GENERALIZATION, oldBase_generalization, base_generalization)); - } - } - return base_generalization; - } - - /** - * - * - * @generated - */ - public Generalization basicGetBase_generalization() { - return base_generalization; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_generalization(Generalization newBase_generalization) { - Generalization oldBase_generalization = base_generalization; - base_generalization = newBase_generalization; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VISIBILITY__BASE_GENERALIZATION, oldBase_generalization, base_generalization)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.VISIBILITY__VALUE: - return getValue(); - case C_CppPackage.VISIBILITY__BASE_GENERALIZATION: - if (resolve) return getBase_generalization(); - return basicGetBase_generalization(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.VISIBILITY__VALUE: - setValue((String)newValue); - return; - case C_CppPackage.VISIBILITY__BASE_GENERALIZATION: - setBase_generalization((Generalization)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.VISIBILITY__VALUE: - setValue(VALUE_EDEFAULT); - return; - case C_CppPackage.VISIBILITY__BASE_GENERALIZATION: - setBase_generalization((Generalization)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.VISIBILITY__VALUE: - return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); - case C_CppPackage.VISIBILITY__BASE_GENERALIZATION: - return base_generalization != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (value: "); - result.append(value); - result.append(')'); - return result.toString(); - } - -} // VisibilityImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VolatileImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VolatileImpl.java deleted file mode 100644 index 6ac65d9f088..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VolatileImpl.java +++ /dev/null @@ -1,291 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - */ -package org.eclipse.papyrus.C_Cpp.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Volatile; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Property; - -/** - * - * An implementation of the model object 'Volatile'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.VolatileImpl#getBase_parameter Base parameter}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.VolatileImpl#getBase_property Base property}
  • - *
  • {@link org.eclipse.papyrus.C_Cpp.impl.VolatileImpl#getBase_operation Base operation}
  • - *
- * - * @generated - */ -public class VolatileImpl extends MinimalEObjectImpl.Container implements Volatile { - /** - * The cached value of the '{@link #getBase_parameter() Base parameter}' reference. - * - * - * @see #getBase_parameter() - * @generated - * @ordered - */ - protected Parameter base_parameter; - - /** - * The cached value of the '{@link #getBase_property() Base property}' reference. - * - * - * @see #getBase_property() - * @generated - * @ordered - */ - protected Property base_property; - - /** - * The cached value of the '{@link #getBase_operation() Base operation}' reference. - * - * - * @see #getBase_operation() - * @generated - * @ordered - */ - protected Operation base_operation; - - /** - * - * - * @generated - */ - protected VolatileImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return C_CppPackage.Literals.VOLATILE; - } - - /** - * - * - * @generated - */ - @Override - public Parameter getBase_parameter() { - if (base_parameter != null && base_parameter.eIsProxy()) { - InternalEObject oldBase_parameter = (InternalEObject)base_parameter; - base_parameter = (Parameter)eResolveProxy(oldBase_parameter); - if (base_parameter != oldBase_parameter) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.VOLATILE__BASE_PARAMETER, oldBase_parameter, base_parameter)); - } - } - return base_parameter; - } - - /** - * - * - * @generated - */ - public Parameter basicGetBase_parameter() { - return base_parameter; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_parameter(Parameter newBase_parameter) { - Parameter oldBase_parameter = base_parameter; - base_parameter = newBase_parameter; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VOLATILE__BASE_PARAMETER, oldBase_parameter, base_parameter)); - } - - /** - * - * - * @generated - */ - @Override - public Property getBase_property() { - if (base_property != null && base_property.eIsProxy()) { - InternalEObject oldBase_property = (InternalEObject)base_property; - base_property = (Property)eResolveProxy(oldBase_property); - if (base_property != oldBase_property) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.VOLATILE__BASE_PROPERTY, oldBase_property, base_property)); - } - } - return base_property; - } - - /** - * - * - * @generated - */ - public Property basicGetBase_property() { - return base_property; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_property(Property newBase_property) { - Property oldBase_property = base_property; - base_property = newBase_property; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VOLATILE__BASE_PROPERTY, oldBase_property, base_property)); - } - - /** - * - * - * @generated - */ - @Override - public Operation getBase_operation() { - if (base_operation != null && base_operation.eIsProxy()) { - InternalEObject oldBase_operation = (InternalEObject)base_operation; - base_operation = (Operation)eResolveProxy(oldBase_operation); - if (base_operation != oldBase_operation) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.VOLATILE__BASE_OPERATION, oldBase_operation, base_operation)); - } - } - return base_operation; - } - - /** - * - * - * @generated - */ - public Operation basicGetBase_operation() { - return base_operation; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_operation(Operation newBase_operation) { - Operation oldBase_operation = base_operation; - base_operation = newBase_operation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VOLATILE__BASE_OPERATION, oldBase_operation, base_operation)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case C_CppPackage.VOLATILE__BASE_PARAMETER: - if (resolve) return getBase_parameter(); - return basicGetBase_parameter(); - case C_CppPackage.VOLATILE__BASE_PROPERTY: - if (resolve) return getBase_property(); - return basicGetBase_property(); - case C_CppPackage.VOLATILE__BASE_OPERATION: - if (resolve) return getBase_operation(); - return basicGetBase_operation(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case C_CppPackage.VOLATILE__BASE_PARAMETER: - setBase_parameter((Parameter)newValue); - return; - case C_CppPackage.VOLATILE__BASE_PROPERTY: - setBase_property((Property)newValue); - return; - case C_CppPackage.VOLATILE__BASE_OPERATION: - setBase_operation((Operation)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case C_CppPackage.VOLATILE__BASE_PARAMETER: - setBase_parameter((Parameter)null); - return; - case C_CppPackage.VOLATILE__BASE_PROPERTY: - setBase_property((Property)null); - return; - case C_CppPackage.VOLATILE__BASE_OPERATION: - setBase_operation((Operation)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case C_CppPackage.VOLATILE__BASE_PARAMETER: - return base_parameter != null; - case C_CppPackage.VOLATILE__BASE_PROPERTY: - return base_property != null; - case C_CppPackage.VOLATILE__BASE_OPERATION: - return base_operation != null; - } - return super.eIsSet(featureID); - } - -} // VolatileImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppAdapterFactory.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppAdapterFactory.java deleted file mode 100644 index b00c2921104..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppAdapterFactory.java +++ /dev/null @@ -1,584 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.C_Cpp.Array; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Const; -import org.eclipse.papyrus.C_Cpp.ConstInit; -import org.eclipse.papyrus.C_Cpp.CppInit; -import org.eclipse.papyrus.C_Cpp.CppRoot; -import org.eclipse.papyrus.C_Cpp.ExternLibrary; -import org.eclipse.papyrus.C_Cpp.External; -import org.eclipse.papyrus.C_Cpp.Friend; -import org.eclipse.papyrus.C_Cpp.Include; -import org.eclipse.papyrus.C_Cpp.Inline; -import org.eclipse.papyrus.C_Cpp.ManualGeneration; -import org.eclipse.papyrus.C_Cpp.Mutable; -import org.eclipse.papyrus.C_Cpp.NoCodeGen; -import org.eclipse.papyrus.C_Cpp.Ptr; -import org.eclipse.papyrus.C_Cpp.Ref; -import org.eclipse.papyrus.C_Cpp.StorageClass; -import org.eclipse.papyrus.C_Cpp.Template; -import org.eclipse.papyrus.C_Cpp.TemplateBinding; -import org.eclipse.papyrus.C_Cpp.TemplateParameter; -import org.eclipse.papyrus.C_Cpp.Typedef; -import org.eclipse.papyrus.C_Cpp.Union; -import org.eclipse.papyrus.C_Cpp.Variadic; -import org.eclipse.papyrus.C_Cpp.Virtual; -import org.eclipse.papyrus.C_Cpp.Visibility; -import org.eclipse.papyrus.C_Cpp.Volatile; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage - * @generated - */ -public class C_CppAdapterFactory extends AdapterFactoryImpl { - /** - * The cached model package. - * - * - * @generated - */ - protected static C_CppPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public C_CppAdapterFactory() { - if (modelPackage == null) { - modelPackage = C_CppPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject)object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch that delegates to the createXXX methods. - * - * - * @generated - */ - protected C_CppSwitch modelSwitch = - new C_CppSwitch() { - @Override - public Adapter casePtr(Ptr object) { - return createPtrAdapter(); - } - @Override - public Adapter caseInclude(Include object) { - return createIncludeAdapter(); - } - @Override - public Adapter caseManualGeneration(ManualGeneration object) { - return createManualGenerationAdapter(); - } - @Override - public Adapter caseExternLibrary(ExternLibrary object) { - return createExternLibraryAdapter(); - } - @Override - public Adapter caseNoCodeGen(NoCodeGen object) { - return createNoCodeGenAdapter(); - } - @Override - public Adapter caseCppRoot(CppRoot object) { - return createCppRootAdapter(); - } - @Override - public Adapter caseArray(Array object) { - return createArrayAdapter(); - } - @Override - public Adapter caseConst(Const object) { - return createConstAdapter(); - } - @Override - public Adapter caseRef(Ref object) { - return createRefAdapter(); - } - @Override - public Adapter caseExternal(External object) { - return createExternalAdapter(); - } - @Override - public Adapter caseConstInit(ConstInit object) { - return createConstInitAdapter(); - } - @Override - public Adapter caseFriend(Friend object) { - return createFriendAdapter(); - } - @Override - public Adapter caseInline(Inline object) { - return createInlineAdapter(); - } - @Override - public Adapter caseVirtual(Virtual object) { - return createVirtualAdapter(); - } - @Override - public Adapter caseTypedef(Typedef object) { - return createTypedefAdapter(); - } - @Override - public Adapter caseVisibility(Visibility object) { - return createVisibilityAdapter(); - } - @Override - public Adapter caseCppInit(CppInit object) { - return createCppInitAdapter(); - } - @Override - public Adapter caseTemplate(Template object) { - return createTemplateAdapter(); - } - @Override - public Adapter caseTemplateBinding(TemplateBinding object) { - return createTemplateBindingAdapter(); - } - @Override - public Adapter caseTemplateParameter(TemplateParameter object) { - return createTemplateParameterAdapter(); - } - @Override - public Adapter caseUnion(Union object) { - return createUnionAdapter(); - } - @Override - public Adapter caseStorageClass(StorageClass object) { - return createStorageClassAdapter(); - } - @Override - public Adapter caseVolatile(Volatile object) { - return createVolatileAdapter(); - } - @Override - public Adapter caseVariadic(Variadic object) { - return createVariadicAdapter(); - } - @Override - public Adapter caseMutable(Mutable object) { - return createMutableAdapter(); - } - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * @param target the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject)target); - } - - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Ptr Ptr}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Ptr - * @generated - */ - public Adapter createPtrAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Include Include}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Include - * @generated - */ - public Adapter createIncludeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.ManualGeneration Manual Generation}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.ManualGeneration - * @generated - */ - public Adapter createManualGenerationAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary Extern Library}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.ExternLibrary - * @generated - */ - public Adapter createExternLibraryAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.NoCodeGen No Code Gen}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.NoCodeGen - * @generated - */ - public Adapter createNoCodeGenAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.CppRoot Cpp Root}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.CppRoot - * @generated - */ - public Adapter createCppRootAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Array Array}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Array - * @generated - */ - public Adapter createArrayAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Const Const}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Const - * @generated - */ - public Adapter createConstAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Ref Ref}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Ref - * @generated - */ - public Adapter createRefAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.External External}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.External - * @generated - */ - public Adapter createExternalAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.ConstInit Const Init}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.ConstInit - * @generated - */ - public Adapter createConstInitAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Friend Friend}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Friend - * @generated - */ - public Adapter createFriendAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Inline Inline}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Inline - * @generated - */ - public Adapter createInlineAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Virtual Virtual}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Virtual - * @generated - */ - public Adapter createVirtualAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Typedef Typedef}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Typedef - * @generated - */ - public Adapter createTypedefAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Visibility Visibility}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Visibility - * @generated - */ - public Adapter createVisibilityAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.CppInit Cpp Init}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.CppInit - * @generated - */ - public Adapter createCppInitAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Template Template}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Template - * @generated - */ - public Adapter createTemplateAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.TemplateBinding Template Binding}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.TemplateBinding - * @generated - */ - public Adapter createTemplateBindingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.TemplateParameter Template Parameter}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.TemplateParameter - * @generated - */ - public Adapter createTemplateParameterAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Union Union}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Union - * @generated - */ - public Adapter createUnionAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.StorageClass Storage Class}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.StorageClass - * @generated - */ - public Adapter createStorageClassAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Volatile Volatile}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Volatile - * @generated - */ - public Adapter createVolatileAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Variadic Variadic}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Variadic - * @generated - */ - public Adapter createVariadicAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Mutable Mutable}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.C_Cpp.Mutable - * @generated - */ - public Adapter createMutableAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } - -} // C_CppAdapterFactory diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceFactoryImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceFactoryImpl.java deleted file mode 100644 index 606f055aab1..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceFactoryImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.util; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; -import org.eclipse.emf.ecore.xmi.XMLResource; - -/** - * - * The Resource Factory associated with the package. - * - * @see org.eclipse.papyrus.C_Cpp.util.C_CppResourceImpl - * @generated - */ -public class C_CppResourceFactoryImpl extends ResourceFactoryImpl { - /** - * Creates an instance of the resource factory. - * - * - * @generated - */ - public C_CppResourceFactoryImpl() { - super(); - } - - /** - * Creates an instance of the resource. - * - * - * @generated - */ - @Override - public Resource createResource(URI uri) { - XMLResource result = new C_CppResourceImpl(uri); - return result; - } - -} // C_CppResourceFactoryImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceImpl.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceImpl.java deleted file mode 100644 index c728ce68f13..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.util; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; - -/** - * - * The Resource associated with the package. - * - * @see org.eclipse.papyrus.C_Cpp.util.C_CppResourceFactoryImpl - * @generated - */ -public class C_CppResourceImpl extends XMLResourceImpl { - /** - * Creates an instance of the resource. - * - * - * @param uri the URI of the new resource. - * @generated - */ - public C_CppResourceImpl(URI uri) { - super(uri); - } - -} // C_CppResourceImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppSwitch.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppSwitch.java deleted file mode 100644 index cc3991bb0e4..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppSwitch.java +++ /dev/null @@ -1,646 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.util; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.util.Switch; -import org.eclipse.papyrus.C_Cpp.Array; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; -import org.eclipse.papyrus.C_Cpp.Const; -import org.eclipse.papyrus.C_Cpp.ConstInit; -import org.eclipse.papyrus.C_Cpp.CppInit; -import org.eclipse.papyrus.C_Cpp.CppRoot; -import org.eclipse.papyrus.C_Cpp.ExternLibrary; -import org.eclipse.papyrus.C_Cpp.External; -import org.eclipse.papyrus.C_Cpp.Friend; -import org.eclipse.papyrus.C_Cpp.Include; -import org.eclipse.papyrus.C_Cpp.Inline; -import org.eclipse.papyrus.C_Cpp.ManualGeneration; -import org.eclipse.papyrus.C_Cpp.Mutable; -import org.eclipse.papyrus.C_Cpp.NoCodeGen; -import org.eclipse.papyrus.C_Cpp.Ptr; -import org.eclipse.papyrus.C_Cpp.Ref; -import org.eclipse.papyrus.C_Cpp.StorageClass; -import org.eclipse.papyrus.C_Cpp.Template; -import org.eclipse.papyrus.C_Cpp.TemplateBinding; -import org.eclipse.papyrus.C_Cpp.TemplateParameter; -import org.eclipse.papyrus.C_Cpp.Typedef; -import org.eclipse.papyrus.C_Cpp.Union; -import org.eclipse.papyrus.C_Cpp.Variadic; -import org.eclipse.papyrus.C_Cpp.Virtual; -import org.eclipse.papyrus.C_Cpp.Visibility; -import org.eclipse.papyrus.C_Cpp.Volatile; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * @see org.eclipse.papyrus.C_Cpp.C_CppPackage - * @generated - */ -public class C_CppSwitch extends Switch { - /** - * The cached model package - * - * - * @generated - */ - protected static C_CppPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public C_CppSwitch() { - if (modelPackage == null) { - modelPackage = C_CppPackage.eINSTANCE; - } - } - - /** - * Checks whether this is a switch for the given package. - * - * - * @param ePackage the package in question. - * @return whether this is a switch for the given package. - * @generated - */ - @Override - protected boolean isSwitchFor(EPackage ePackage) { - return ePackage == modelPackage; - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - @Override - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case C_CppPackage.PTR: { - Ptr ptr = (Ptr)theEObject; - T result = casePtr(ptr); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.INCLUDE: { - Include include = (Include)theEObject; - T result = caseInclude(include); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.MANUAL_GENERATION: { - ManualGeneration manualGeneration = (ManualGeneration)theEObject; - T result = caseManualGeneration(manualGeneration); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.EXTERN_LIBRARY: { - ExternLibrary externLibrary = (ExternLibrary)theEObject; - T result = caseExternLibrary(externLibrary); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.NO_CODE_GEN: { - NoCodeGen noCodeGen = (NoCodeGen)theEObject; - T result = caseNoCodeGen(noCodeGen); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.CPP_ROOT: { - CppRoot cppRoot = (CppRoot)theEObject; - T result = caseCppRoot(cppRoot); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.ARRAY: { - Array array = (Array)theEObject; - T result = caseArray(array); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.CONST: { - Const const_ = (Const)theEObject; - T result = caseConst(const_); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.REF: { - Ref ref = (Ref)theEObject; - T result = caseRef(ref); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.EXTERNAL: { - External external = (External)theEObject; - T result = caseExternal(external); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.CONST_INIT: { - ConstInit constInit = (ConstInit)theEObject; - T result = caseConstInit(constInit); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.FRIEND: { - Friend friend = (Friend)theEObject; - T result = caseFriend(friend); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.INLINE: { - Inline inline = (Inline)theEObject; - T result = caseInline(inline); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.VIRTUAL: { - Virtual virtual = (Virtual)theEObject; - T result = caseVirtual(virtual); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.TYPEDEF: { - Typedef typedef = (Typedef)theEObject; - T result = caseTypedef(typedef); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.VISIBILITY: { - Visibility visibility = (Visibility)theEObject; - T result = caseVisibility(visibility); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.CPP_INIT: { - CppInit cppInit = (CppInit)theEObject; - T result = caseCppInit(cppInit); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.TEMPLATE: { - Template template = (Template)theEObject; - T result = caseTemplate(template); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.TEMPLATE_BINDING: { - TemplateBinding templateBinding = (TemplateBinding)theEObject; - T result = caseTemplateBinding(templateBinding); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.TEMPLATE_PARAMETER: { - TemplateParameter templateParameter = (TemplateParameter)theEObject; - T result = caseTemplateParameter(templateParameter); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.UNION: { - Union union = (Union)theEObject; - T result = caseUnion(union); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.STORAGE_CLASS: { - StorageClass storageClass = (StorageClass)theEObject; - T result = caseStorageClass(storageClass); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.VOLATILE: { - Volatile volatile_ = (Volatile)theEObject; - T result = caseVolatile(volatile_); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.VARIADIC: { - Variadic variadic = (Variadic)theEObject; - T result = caseVariadic(variadic); - if (result == null) result = defaultCase(theEObject); - return result; - } - case C_CppPackage.MUTABLE: { - Mutable mutable = (Mutable)theEObject; - T result = caseMutable(mutable); - if (result == null) result = defaultCase(theEObject); - return result; - } - default: return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'Ptr'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Ptr'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePtr(Ptr object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Include'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Include'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseInclude(Include object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Manual Generation'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Manual Generation'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseManualGeneration(ManualGeneration object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Extern Library'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Extern Library'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseExternLibrary(ExternLibrary object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'No Code Gen'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'No Code Gen'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseNoCodeGen(NoCodeGen object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Cpp Root'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Cpp Root'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseCppRoot(CppRoot object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Array'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Array'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseArray(Array object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Const'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Const'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseConst(Const object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Ref'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Ref'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseRef(Ref object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'External'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'External'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseExternal(External object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Const Init'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Const Init'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseConstInit(ConstInit object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Friend'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Friend'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseFriend(Friend object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Inline'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Inline'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseInline(Inline object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Virtual'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Virtual'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseVirtual(Virtual object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Typedef'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Typedef'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseTypedef(Typedef object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Visibility'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Visibility'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseVisibility(Visibility object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Cpp Init'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Cpp Init'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseCppInit(CppInit object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Template'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Template'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseTemplate(Template object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Template Binding'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Template Binding'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseTemplateBinding(TemplateBinding object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Template Parameter'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Template Parameter'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseTemplateParameter(TemplateParameter object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Union'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Union'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseUnion(Union object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Storage Class'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Storage Class'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseStorageClass(StorageClass object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Volatile'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Volatile'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseVolatile(Volatile object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Variadic'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Variadic'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseVariadic(Variadic object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Mutable'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Mutable'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseMutable(Mutable object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - @Override - public T defaultCase(EObject object) { - return null; - } - -} // C_CppSwitch diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppXMLProcessor.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppXMLProcessor.java deleted file mode 100644 index e66da34caf6..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppXMLProcessor.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - */ -package org.eclipse.papyrus.C_Cpp.util; - -import java.util.Map; - -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.xmi.util.XMLProcessor; -import org.eclipse.papyrus.C_Cpp.C_CppPackage; - -/** - * This class contains helper methods to serialize and deserialize XML documents - * - * - * @generated - */ -public class C_CppXMLProcessor extends XMLProcessor { - - /** - * Public constructor to instantiate the helper. - * - * - * @generated - */ - public C_CppXMLProcessor() { - super((EPackage.Registry.INSTANCE)); - C_CppPackage.eINSTANCE.eClass(); - } - - /** - * Register for "*" and "xml" file extensions the C_CppResourceFactoryImpl factory. - * - * - * @generated - */ - @Override - protected Map getRegistrations() { - if (registrations == null) { - super.getRegistrations(); - registrations.put(XML_EXTENSION, new C_CppResourceFactoryImpl()); - registrations.put(STAR_EXTENSION, new C_CppResourceFactoryImpl()); - } - return registrations; - } - -} // C_CppXMLProcessor diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/cpp/profile/Activator.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/cpp/profile/Activator.java deleted file mode 100644 index 7fbcd820996..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/cpp/profile/Activator.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.papyrus.cpp.profile; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.cpp.profile"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/cpp/profile/StdStereo.java b/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/cpp/profile/StdStereo.java deleted file mode 100644 index 315c1f0fbe3..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/cpp/profile/StdStereo.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2012 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.cpp.profile; - -public class StdStereo { - // CAVEAT: namespace has changed from Standard to StandardProfileL2 (and might change back again) - public final static String create = "StandardProfileL2::Create"; //$NON-NLS-1$ - public final static String destroy = "StandardProfileL2::Destroy"; //$NON-NLS-1$ -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/.cproject b/extraplugins/codegen/org.eclipse.papyrus.cpp.test/.cproject deleted file mode 100644 index 7625f2eab4a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/.cproject +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/.gitignore b/extraplugins/codegen/org.eclipse.papyrus.cpp.test/.gitignore deleted file mode 100644 index b946e6f080e..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -TestCDTintegration -Debug diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/.project b/extraplugins/codegen/org.eclipse.papyrus.cpp.test/.project deleted file mode 100644 index 81efcb02b14..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/.project +++ /dev/null @@ -1,83 +0,0 @@ - - - org.eclipse.papyrus.cpp.test - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/TestCDT/Debug} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.di b/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.di deleted file mode 100644 index b1b3ed6ae2a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.di +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.notation b/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.notation deleted file mode 100644 index 322e298d2d9..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.notation +++ /dev/null @@ -1,151 +0,0 @@ - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.uml b/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.uml deleted file mode 100644 index 46032827278..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.uml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - - C/C++ - - - - C/C++ - my Text - - - C/C++ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - // Now let's add some code -arg[0] = 1; - - - - Here you can document operation1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.di b/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.di deleted file mode 100644 index 3acfa5281bc..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.di +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.notation b/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.notation deleted file mode 100644 index 6c917c29662..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.notation +++ /dev/null @@ -1,283 +0,0 @@ - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
- - -
- - -
- - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - -
- - - - -
- - -
- - -
- - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.uml b/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.uml deleted file mode 100644 index 968950faadb..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.uml +++ /dev/null @@ -1,182 +0,0 @@ - - - - - This class contains a state machine - - - - - - - - - - - - - - - - - - C/C++ - - - - C/C++ - my Text - - - C/C++ - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - // this effect is a C++ -// opaque behavior with several lines - - - - - - - - - C/C++ - // Aber hier geht's, oder? - - - - C/C++ - // this effect is a C++ np -// opaque behavior with several lines - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - // Now let's add some code -cout << "value: " << arg; - - - - - - C/C++ - // Now let's add some code -args[0] = 2; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/.classpath b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/.project b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/.project deleted file mode 100644 index d1004a0c6d3..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.texteditor.cdt - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/META-INF/MANIFEST.MF deleted file mode 100644 index 07583f0dffc..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/META-INF/MANIFEST.MF +++ /dev/null @@ -1,40 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.ui.editors;bundle-version="3.7.0", - org.eclipse.text, - org.eclipse.emf.ecore;bundle-version="2.7.0", - org.eclipse.uml2.uml;bundle-version="3.2.0", - org.eclipse.emf.transaction, - org.eclipse.emf.workspace, - org.eclipse.jface.text;bundle-version="3.7.0", - org.eclipse.gmf.runtime.common.core, - org.eclipse.gmf.runtime.emf.type.core, - org.eclipse.cdt.core;bundle-version="5.4.0", - org.eclipse.cdt.ui;bundle-version="5.4.0", - org.eclipse.cdt.codan.ui.cxx;bundle-version="3.2.0", - org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core;bundle-version="1.2.0", - org.eclipse.papyrus.infra.services.edit;bundle-version="1.2.0", - org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", - org.eclipse.papyrus.uml.tools;bundle-version="1.2.0", - org.eclipse.papyrus.texteditor.model;bundle-version="1.2.0", - org.eclipse.ui.ide;bundle-version="3.9.0", - org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.2.0", - org.eclipse.papyrus.codegen.base;bundle-version="1.2.0", - org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", - org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0", - org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0", - org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.2.0", - org.eclipse.papyrus.cpp.codegen;bundle-version="1.2.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.texteditor.cdt.Activator -Bundle-ManifestVersion: 2 -Bundle-Description: %pluginDescription -Bundle-SymbolicName: org.eclipse.papyrus.texteditor.cdt;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/about.html b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/build.properties b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/build.properties deleted file mode 100644 index dca8cd871c9..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - about.html,\ - build.properties,\ - icons/,\ - plugin.properties -src.includes = about.html diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.gif b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.gif deleted file mode 100644 index 0d1a28947ba..00000000000 Binary files a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.gif and /dev/null differ diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.xcf b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.xcf deleted file mode 100644 index 1749c428883..00000000000 Binary files a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.xcf and /dev/null differ diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/plugin.properties deleted file mode 100644 index 7e334617814..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/plugin.properties +++ /dev/null @@ -1,14 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus CDT editor integration (Incubation) -providerName=Eclipse Modeling Project - -pluginDescription=This plugin provides a editor for uml.Comment. The informations are stored in the .notation \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/plugin.xml deleted file mode 100644 index 12a8ca49a2a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/plugin.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/pom.xml deleted file mode 100644 index 9938c82c7e0..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.texteditor.cdt - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Activator.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Activator.java deleted file mode 100644 index f69ef78e6f2..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Activator.java +++ /dev/null @@ -1,71 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.texteditor.cdt; - -import org.eclipse.papyrus.infra.core.log.LogHelper; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.texteditor.cdt"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - public static LogHelper log; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - log = new LogHelper(this); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/AddProfileAndModelLibsHandler.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/AddProfileAndModelLibsHandler.java deleted file mode 100644 index fa0e02c1594..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/AddProfileAndModelLibsHandler.java +++ /dev/null @@ -1,144 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation - * - *******************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageImport; -import org.eclipse.uml2.uml.Profile; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.resource.UMLResource; - -/** - * This class adds the C++ profile as well as the ANSI-C library to your model. - * - * TODO: currently not used. - */ -public class AddProfileAndModelLibsHandler { - - static final String CPP_PROFILE_URI = "pathmap://CPP_PROFILES/C_Cpp.profile.uml"; //$NON-NLS-1$ - - static final String ANSIC_LIBRARY_URI = "pathmap://CPP_LIBRARIES/Ansi_C.library.uml"; //$NON-NLS-1$ - - /** - * Retrieve a model library from the repository - * - * @param uri - * the URI of the repository - * - * @return - */ - public PackageImport getModelLibraryImportFromURI(URI uri, EditingDomain domain) { - // Try to reach model - Element root = getContent(uri, domain); - if (root instanceof Package) { - - // Import model library - Package libToImport = (Package) root; - // create import package - PackageImport modelLibImport = UMLFactory.eINSTANCE.createPackageImport(); - modelLibImport.setImportedPackage(libToImport); - - return modelLibImport; - } - return null; - } - - public static Element getContent(URI uri, EditingDomain domain) { - // Resource resource = getTransactionalEditingDomain ().getResourceSet().getResource (uri, true); - Resource resource = domain.getResourceSet().getResource(uri, true); - return getContent(resource); - } - - public static Element getContent(Resource resource) { - EList contentObj = resource.getContents(); - if ((contentObj.size() > 0) && (contentObj.get(0) instanceof Element)) { - return (Element) contentObj.get(0); - } - return null; - } - - /** - * Check whether a package import is already done - * - * @param selectedPkg - * @param pi - * @return - */ - boolean isAlreadyImported(Package selectedPkg, PackageImport pi) { - for (PackageImport existingPI : selectedPkg.getPackageImports()) { - if ((existingPI.getImportedPackage() == null) || - (pi.getImportedPackage() == null)) { - // import package are null (should not happen?!) - continue; - } - if ((existingPI.getImportedPackage().getName() == null) || - (pi.getImportedPackage().getName() == null)) { - // import package name not set (should not happen?!) - continue; - } else if (existingPI.getImportedPackage().getName().equals(pi.getImportedPackage().getName())) { - return true; - } - } - return false; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - /** - * {@inheritDoc} - */ - public void addProfileAndImport(final Package selectedPkg) throws ExecutionException { - - final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(selectedPkg); - CommandStack stack = domain.getCommandStack(); - stack.execute(new RecordingCommand(domain, "Add C++ profile & ANSI-C library") { //$NON-NLS-1$ - @Override - public void doExecute() { - // add primitive types - // create import package to primitiveType - PackageImport pi = getModelLibraryImportFromURI(URI.createURI(UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI), domain); - selectedPkg.getPackageImports().add(pi); - addCppProfile(selectedPkg, domain); - }; - }); - } - - public static void addCppProfile(Package selectedPkg, TransactionalEditingDomain domain) { - - // Retrieve C++ profile - Profile cppProfile = - (Profile) getContent(URI.createURI(CPP_PROFILE_URI), domain); - - // Apply C++ profile to model - if (cppProfile instanceof Profile) { - Profile profile = selectedPkg.getAppliedProfile(cppProfile.getQualifiedName()); - if ((profile == null) && (!cppProfile.getOwnedStereotypes().isEmpty())) { - selectedPkg.applyProfile(cppProfile); - } - } - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/CommandSupport.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/CommandSupport.java deleted file mode 100644 index a3e32434420..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/CommandSupport.java +++ /dev/null @@ -1,75 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation - * - *******************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt; - -import java.util.Collections; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.operations.IOperationHistory; -import org.eclipse.core.commands.operations.OperationHistoryFactory; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers; - -/** - * Utility function. Allow execution of commands on a transactional command stack - */ -public class CommandSupport { - - /** - * Execute the passed Runnable within a command - * - * @param label - * @param command - */ - public static void exec(String label, final Runnable command) { - ServiceUtilsForActionHandlers serviceUtils = ServiceUtilsForActionHandlers.getInstance(); - try { - exec(serviceUtils.getTransactionalEditingDomain(), label, command); - } catch (ServiceException e) { - // Log.log(Log.ERROR_MSG, Log.UTILS, "Can not get editing domain"); - } - } - - /** - * Execute the passed Runnable within a command - * - * @param label - * @param command - */ - public static void exec(TransactionalEditingDomain domain, String label, final Runnable command) { - if (domain == null) { - command.run(); - } - else { - IOperationHistory history = OperationHistoryFactory.getOperationHistory(); - try { - history.execute(new AbstractTransactionalCommand(domain, label, Collections.EMPTY_LIST) { - - @Override - public CommandResult doExecuteWithResult(IProgressMonitor dummy, IAdaptable info) { - command.run(); - return CommandResult.newOKCommandResult(); - } - }, null, null); - } catch (ExecutionException e) { - e.printStackTrace(); - } - } - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/TextEditorConstants.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/TextEditorConstants.java deleted file mode 100644 index 2436b7373b5..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/TextEditorConstants.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation - * - *******************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt; - -import java.util.regex.Pattern; - -public class TextEditorConstants { - - /** - * Regular expression for accepted language for compatible CDT code generators - */ - public static final Pattern CPP = Pattern.compile("C\\+\\+|c\\+\\+|CPP|cpp|C|c"); //$NON-NLS-1$ -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Utils.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Utils.java deleted file mode 100644 index 2beb89ab936..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Utils.java +++ /dev/null @@ -1,187 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation - * - *******************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt; - -import org.eclipse.papyrus.codegen.extensionpoints.GenerationConstants; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Package; - -/** - * Collection of utility operations that are used by the CDT editor. - */ -public class Utils { - - public static final String nsSep = "::"; //$NON-NLS-1$ - - /** - * Decrease the indentation of a text block. This function is used during synchronization, since - * the code within an opaque behavior is not indented, whereas the code of an operation within a - * file is indented with a tab. - */ - public static String decreaseIndent(char[] contents, int start, int end) { - String newBlock = ""; //$NON-NLS-1$ - boolean newLine = true; - int consume = 0; - for (int i = start; i < end; i++) { - char c = contents[i]; - - // consume either a tab or 4 spaces; - if (newLine && (c == '\t')) { - consume = 1; - } - if (newLine && (c == ' ')) { - consume = 4; - } - - if (consume == 0) { - newBlock += c; - } - else if (c == ' ') { - consume--; - } - else { - consume = 0; - } - if ((c == '\n') || (c == '\r')) { - newLine = true; - } - else { - newLine = false; - } - } - return newBlock; - } - - /** - * Get an element via its qualified name. Will find elements from the root - * model and elements in imported models. Also supports target model in - * which imports have been copied (while keeping the top-level name) - * - * @param root - * @param qualifiedName - * @return - */ - public static NamedElement getQualifiedElement(Package root, - String qualifiedName) { - NamedElement namedElement = null; - int index = qualifiedName.indexOf(nsSep); - if (index != -1) { - // first try using a path without top element (since - // getQualifiedElement is typically used for - // imported elements) - String remainder = qualifiedName.substring(index + 2); - namedElement = getQualifiedElement(root, remainder, qualifiedName); - } - if (namedElement == null) { - // try with complete name as path name, but assume that the element - // has been copied into the model, - // i.e. qualifiedName is prefixed by model name - namedElement = getQualifiedElement(root, qualifiedName, - root.getName() + nsSep + qualifiedName); - } - return namedElement; - } - - /** - * Retrieve an element via its qualified name within a package The segments - * of the package may be non unique due to imports - * - * @return the found element, if it exists - */ - public static NamedElement getQualifiedElement(Package root, - String remainingPath, String qualifiedName) { - if (root == null) { - return null; - } - if (!remainingPath.contains(nsSep)) { - for (NamedElement candidate : root.getMembers()) { - String name = candidate.getName(); - if ((name != null) && name.equals(remainingPath)) { - if (candidate.getQualifiedName().equals(qualifiedName)) { - return candidate; - } - } - } - } else { - String segment = remainingPath.split(nsSep)[0]; - String remainder = remainingPath.substring(segment.length() + 2); - for (Element element : root.getMembers()) { - if (element instanceof Package) { - if (((NamedElement) element).getName().equals(segment)) { - NamedElement foundElement = getQualifiedElement( - (Package) element, remainder, qualifiedName); - // return, if not found - if (foundElement != null) { - return foundElement; - } - } - } - } - } - return null; - } - - /** - * return the top-level owner of an element. This function returns the same - * value as getModel, if the top-level element is a model. While this is the - * case for models, model libraries have a top-level package (not a model). - * In this case, getTop returns the top-level package whereas getModel would - * return null. - * - * @param element - * @return the top-level owning package - */ - public static Package getTop(Element element) { - while (element != null) { - Element owner = element.getOwner(); - if (owner == null) { - if (element instanceof Package) { - return (Package) element; - } - } - element = owner; - } - return null; - } - - /** - * Remove generated code from a body (everything between the GENERATED_START flag - * - * @param bodyStr - * @return - */ - public static String removeGenerated(String bodyStr) { - for (;;) { - int startPos = bodyStr.indexOf(GenerationConstants.GENERATED_START); - if (startPos == -1) { - break; - } - // search line break of previous line (if any) - while ((startPos > 0) && bodyStr.charAt(startPos) != '\r' && bodyStr.charAt(startPos) != '\n') { - startPos--; - } - int endPos = bodyStr.indexOf(GenerationConstants.GENERATED_END, startPos); - if (endPos == -1) { - break; - } - endPos += GenerationConstants.GENERATED_END.length(); - // stop at first non white-space character after comment. - while ((endPos < bodyStr.length()) && Character.isWhitespace(bodyStr.charAt(endPos))) { - endPos++; - } - bodyStr = bodyStr.substring(0, startPos) + bodyStr.substring(endPos); - } - return bodyStr; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/DelegatingSourceViewer.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/DelegatingSourceViewer.java deleted file mode 100644 index f5d61481370..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/DelegatingSourceViewer.java +++ /dev/null @@ -1,400 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt.editor; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.jface.text.IAutoIndentStrategy; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IEventConsumer; -import org.eclipse.jface.text.IFindReplaceTarget; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextDoubleClickStrategy; -import org.eclipse.jface.text.ITextHover; -import org.eclipse.jface.text.ITextInputListener; -import org.eclipse.jface.text.ITextListener; -import org.eclipse.jface.text.ITextOperationTarget; -import org.eclipse.jface.text.IUndoManager; -import org.eclipse.jface.text.IViewportListener; -import org.eclipse.jface.text.TextPresentation; -import org.eclipse.jface.text.source.Annotation; -import org.eclipse.jface.text.source.IAnnotationHover; -import org.eclipse.jface.text.source.IAnnotationModel; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.jface.text.source.SourceViewerConfiguration; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Point; -import org.eclipse.uml2.uml.Classifier; - -/** - * Unsuccessful attempt to create a delegating source viewer that changes the implementation of - * the operation getSelectionProvider of a source viewer. This does not work in case of CDT since the - * source viewer is cast to CSourceViewer later. - * - * CURRENTLY NOT USED - */ -@Deprecated -public class DelegatingSourceViewer implements ISourceViewer { - - public DelegatingSourceViewer(ISourceViewer delegationTarget, Classifier classifier) { - // super(null, null, null, false, 0, null); - this.dt = delegationTarget; - this.cl = classifier; - - sp = new ISelectionProvider() { - - @Override - public void setSelection(ISelection selection) { - } - - @Override - public void removeSelectionChangedListener( - ISelectionChangedListener listener) { - System.err.println("removeSelectionChangedListener"); - } - - @Override - public ISelection getSelection() { - return new IStructuredSelection() { - - @Override - public boolean isEmpty() { - return false; - } - - @Override - public List toList() { - List l = new BasicEList(); - l.add(cl); - return l; - } - - @Override - public Object[] toArray() { - return new Object[] { cl }; - } - - @Override - public int size() { - // TODO Auto-generated method stub - return 1; - } - - @Override - public Iterator iterator() { - return null; - } - - @Override - public Object getFirstElement() { - return cl; - } - }; - } - - @Override - public void addSelectionChangedListener(ISelectionChangedListener listener) { - // TODO Auto-generated method stub - System.err.println("add SelectionChangedListener"); - - } - }; - } - - ISourceViewer dt; - - Classifier cl; - - ISelectionProvider sp; - - @Override - public StyledText getTextWidget() { - return dt.getTextWidget(); - } - - @Override - public void setUndoManager(IUndoManager undoManager) { - dt.setUndoManager(undoManager); - } - - @Override - public void setTextDoubleClickStrategy( - ITextDoubleClickStrategy strategy, String contentType) { - dt.setTextDoubleClickStrategy(strategy, contentType); - } - - @Override - public void setAutoIndentStrategy(IAutoIndentStrategy strategy, - String contentType) { - dt.setAutoIndentStrategy(strategy, contentType); - } - - @Override - public void setTextHover(ITextHover textViewerHover, - String contentType) { - dt.setTextHover(textViewerHover, contentType); - } - - @Override - public void activatePlugins() { - dt.activatePlugins(); - } - - @Override - public void resetPlugins() { - dt.resetPlugins(); - } - - @Override - public void addViewportListener(IViewportListener listener) { - dt.addViewportListener(listener); - } - - @Override - public void removeViewportListener(IViewportListener listener) { - dt.removeViewportListener(listener); - } - - @Override - public void addTextListener(ITextListener listener) { - dt.addTextListener(listener); - } - - @Override - public void removeTextListener(ITextListener listener) { - dt.removeTextListener(listener); - } - - @Override - public void addTextInputListener(ITextInputListener listener) { - dt.addTextInputListener(listener); - } - - @Override - public void removeTextInputListener(ITextInputListener listener) { - dt.removeTextInputListener(listener); - } - - @Override - public void setDocument(IDocument document) { - dt.setDocument(document); - } - - @Override - public IDocument getDocument() { - return dt.getDocument(); - } - - @Override - public void setEventConsumer(IEventConsumer consumer) { - dt.setEventConsumer(consumer); - - } - - @Override - public void setEditable(boolean editable) { - dt.setEditable(editable); - } - - @Override - public boolean isEditable() { - return dt.isEditable(); - } - - @Override - public void setDocument(IDocument document, int modelRangeOffset, - int modelRangeLength) { - dt.setDocument(document, modelRangeOffset, modelRangeLength); - } - - @Override - public void setVisibleRegion(int offset, int length) { - dt.setVisibleRegion(offset, length); - } - - @Override - public void resetVisibleRegion() { - dt.resetVisibleRegion(); - } - - @Override - public IRegion getVisibleRegion() { - return dt.getVisibleRegion(); - } - - @Override - public boolean overlapsWithVisibleRegion(int offset, int length) { - return dt.overlapsWithVisibleRegion(offset, length); - } - - @Override - public void changeTextPresentation(TextPresentation presentation, - boolean controlRedraw) { - dt.changeTextPresentation(presentation, controlRedraw); - } - - @Override - public void invalidateTextPresentation() { - dt.invalidateTextPresentation(); - - } - - @Override - public void setTextColor(Color color) { - dt.setTextColor(color); - } - - @Override - public void setTextColor(Color color, int offset, int length, - boolean controlRedraw) { - dt.setTextColor(color, offset, length, controlRedraw); - } - - @Override - public ITextOperationTarget getTextOperationTarget() { - return dt.getTextOperationTarget(); - } - - @Override - public IFindReplaceTarget getFindReplaceTarget() { - return dt.getFindReplaceTarget(); - } - - @Override - public void setDefaultPrefixes(String[] defaultPrefixes, - String contentType) { - dt.setDefaultPrefixes(defaultPrefixes, contentType); - - } - - @Override - public void setIndentPrefixes(String[] indentPrefixes, - String contentType) { - dt.setIndentPrefixes(indentPrefixes, contentType); - } - - @Override - public void setSelectedRange(int offset, int length) { - dt.setSelectedRange(offset, length); - } - - @Override - public Point getSelectedRange() { - return dt.getSelectedRange(); - } - - @Override - public ISelectionProvider getSelectionProvider() { - return dt.getSelectionProvider(); - } - - @Override - public void revealRange(int offset, int length) { - dt.revealRange(offset, length); - } - - @Override - public void setTopIndex(int index) { - dt.setTopIndex(index); - } - - @Override - public int getTopIndex() { - return dt.getTopIndex(); - } - - @Override - public int getTopIndexStartOffset() { - return dt.getTopIndexStartOffset(); - } - - @Override - public int getBottomIndex() { - return dt.getBottomIndex(); - } - - @Override - public int getBottomIndexEndOffset() { - return dt.getBottomIndexEndOffset(); - } - - @Override - public int getTopInset() { - return dt.getTopInset(); - } - - @Override - public void configure(SourceViewerConfiguration configuration) { - dt.configure(configuration); - } - - @Override - public void setAnnotationHover(IAnnotationHover annotationHover) { - dt.setAnnotationHover(annotationHover); - } - - @Override - public void setDocument(IDocument document, - IAnnotationModel annotationModel) { - dt.setDocument(document, annotationModel); - } - - @Override - public void setDocument(IDocument document, - IAnnotationModel annotationModel, int modelRangeOffset, - int modelRangeLength) { - dt.setDocument(document, annotationModel, modelRangeOffset, modelRangeLength); - - } - - @Override - public IAnnotationModel getAnnotationModel() { - return dt.getAnnotationModel(); - } - - @Override - public void setRangeIndicator(Annotation rangeIndicator) { - dt.setRangeIndicator(rangeIndicator); - - } - - @Override - public void setRangeIndication(int offset, int length, - boolean moveCursor) { - dt.setRangeIndication(offset, length, moveCursor); - } - - @Override - public IRegion getRangeIndication() { - return dt.getRangeIndication(); - } - - @Override - public void removeRangeIndication() { - dt.removeRangeIndication(); - } - - @Override - public void showAnnotations(boolean show) { - dt.showAnnotations(show); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/PapyrusCDTEditor.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/PapyrusCDTEditor.java deleted file mode 100644 index 4ae37530cac..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/PapyrusCDTEditor.java +++ /dev/null @@ -1,395 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.texteditor.cdt.editor; - -import org.eclipse.cdt.codan.internal.ui.cxx.CodanCReconciler; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ISourceRange; -import org.eclipse.cdt.core.model.ISourceReference; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.internal.ui.editor.CEditor; -import org.eclipse.cdt.ui.CDTUITools; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EValidator; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.jface.text.source.IVerticalRuler; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.papyrus.infra.core.lifecycleevents.DoSaveEvent; -import org.eclipse.papyrus.infra.core.lifecycleevents.ILifeCycleEventsProvider; -import org.eclipse.papyrus.infra.core.lifecycleevents.ISaveAndDirtyService; -import org.eclipse.papyrus.infra.core.lifecycleevents.ISaveEventListener; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.texteditor.cdt.Activator; -import org.eclipse.papyrus.texteditor.cdt.sync.ObtainICElement; -import org.eclipse.papyrus.texteditor.cdt.sync.RevealCurrentOperation; -import org.eclipse.papyrus.texteditor.cdt.sync.SyncCDTtoModel; -import org.eclipse.papyrus.texteditor.cdt.sync.SyncModelToCDT; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.ide.IGotoMarker; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.texteditor.ITextEditorActionConstants; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; - -/** - * A specialization of the CDT editor made for integration into Papyrus - * - */ -public class PapyrusCDTEditor extends CEditor { - - /** the service registry */ - protected final ServicesRegistry registry; - - /** the papyrus text instance */ - protected final TextEditorModel papyrusTextInstance; - - /** the text listener */ - protected FocusListener focusListener; - - public static final String EDITOR_DEFAULT_NAME = "CDT Editor"; - - public static final String EDITOR_TYPE = "CDTEditorInPapyrus"; //$NON-NLS-1$ - - protected SyncCDTtoModel syncCpp; - - protected RevealCurrentOperation reveal; - - protected Adapter gotoListener; - - /** - * - * Constructor. - * - * @param registry - * @param papyrusTextInstance - */ - public PapyrusCDTEditor(final ServicesRegistry registry, final TextEditorModel papyrusTextInstance) { - super(); - gotoListener = null; - this.registry = registry; - this.papyrusTextInstance = papyrusTextInstance; - try { - saveAndDirtyService = registry.getService(ISaveAndDirtyService.class); - saveAndDirtyService.registerIsaveablePart(this); - ILifeCycleEventsProvider lifeCycleEvents = registry.getService(ILifeCycleEventsProvider.class); - ISaveEventListener preSaveEvent = new ISaveEventListener() { - - @Override - public void doSaveAs(DoSaveEvent event) { - // TODO Auto-generated method stub - } - - @Override - public void doSave(DoSaveEvent event) { - syncCpp.syncCDTtoModel(); - } - }; - lifeCycleEvents.addAboutToDoSaveListener(preSaveEvent); - } catch (ServiceException e) { - Activator.log.error(e); - } - } - - /** - * override method in order to save & restore action bars entries - */ - @Override - public void createPartControl(Composite parent) { - // save Papyrus (GMF) handlers - IActionBars actionBars = getEditorSite().getActionBars(); - if ((actionBars != null) && (gmfUndo == null)) { - gmfUndo = actionBars.getGlobalActionHandler(ITextEditorActionConstants.UNDO); - gmfRedo = actionBars.getGlobalActionHandler(ITextEditorActionConstants.REDO); - } - - super.createPartControl(parent); - - if (actionBars != null) { - // save CDT (textEditor) handlers - textUndo = actionBars.getGlobalActionHandler(ITextEditorActionConstants.UNDO); - textRedo = actionBars.getGlobalActionHandler(ITextEditorActionConstants.REDO); - // & restore Papyrus bar - actionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, gmfUndo); - actionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, gmfRedo); - actionBars.updateActionBars(); - } - - gotoListener = new Adapter() { - - // assure that gotoElement is called, if the element in the model gets updated - @Override - public void notifyChanged(Notification notification) { - if (notification.getEventType() == Notification.SET) { - Object newValue = notification.getNewValue(); - if (newValue instanceof NamedElement) { - gotoElement((NamedElement) newValue); - } - - } - } - - @Override - public Notifier getTarget() { - return null; - } - - @Override - public void setTarget(Notifier newTarget) { - } - - @Override - public boolean isAdapterForType(Object type) { - return false; - } - }; - papyrusTextInstance.eAdapters().add(gotoListener); - - if (papyrusTextInstance.getSelectedObject() instanceof NamedElement) { - gotoElement((NamedElement) papyrusTextInstance.getSelectedObject()); - } - } - - /** - * - * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.source.IVerticalRuler, int) - * - * @param parent - * @param ruler - * @param styles - * @return - */ - @Override - public ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { - - final ISourceViewer viewer = super.createSourceViewer(parent, ruler, styles); - // ISourceViewer viewer = new DelegatingSourceViewer(origViewer, (Classifier)papyrusTextInstance.getEditedObject()); - focusListener = new FocusListener() { - - @Override - public void focusLost(FocusEvent e) { - // potential problem for undo/redo!! - if (isDirty()) { - doSave(new NullProgressMonitor()); - syncCpp.syncCDTtoModel(); - Classifier classifier = (Classifier) papyrusTextInstance.getEditedObject(); - // regenerate code. TODO: raises update dialog - // SyncModelToCDT.syncModelToCDT(classifier); - } - // restore handlers - IActionBars actionBars = getEditorSite().getActionBars(); - if (actionBars != null) { - if ((gmfUndo != null) && (gmfRedo != null)) { - actionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, gmfUndo); - actionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, gmfRedo); - actionBars.updateActionBars(); - } - } - } - - @Override - public void focusGained(FocusEvent e) { - // restore handlers - IActionBars actionBars = getEditorSite().getActionBars(); - if (actionBars != null) { - if ((textUndo != null) && (textRedo != null)) { - actionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, textUndo); - actionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, textRedo); - actionBars.updateActionBars(); - } - } - } - }; - // register focus listener - viewer.getTextWidget().addFocusListener(focusListener); - SelectionListener selectionListener = new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - IEditorPart ep = getEditorSite().getPage().getActiveEditor(); - ISelection selection = getSelectionProvider().getSelection(); - if ((ep instanceof IGotoMarker) && (selection instanceof ITextSelection)) { - if (((ITextSelection) selection).getLength() > 0) { - // don't try to navigate during selection of a chunk of text. - return; - } - IMarker marker; - /* - * create a temporary validation marker on the - * srcFile file, call the gotoMarker operation of the editor - * and remove the marker afterwards. - * TODO: operation activates the model-explorer - */ - try { - Element element = reveal.obtainSelectedElement((ITextSelection) selection); - String modelURI = EcoreUtil.getURI(element).toString(); - marker = srcFile.createMarker(EValidator.MARKER); - marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO); // set severity before URI to avoid marker update without associated icon - marker.setAttribute(EValidator.URI_ATTRIBUTE, modelURI); - IWorkbenchPage wbpage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - IWorkbenchPart activePart = wbpage.getActivePart(); - ((IGotoMarker) ep).gotoMarker(marker); - // reactivate this editor - wbpage.activate(activePart); - marker.delete(); - } catch (CoreException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }; - - // TODO: don't add selection listener for the moment. It can cause deadlocks (setting a marker attribute while file is locked, reproducible with cut (^X) on selection) - // viewer.getTextWidget().addSelectionListener(selectionListener); - - return viewer; - } - - /** - * Goto a specific element within the text editor. Currently, only methods are supported. - * - * @param element - * @throws CoreException - */ - public void gotoElement(NamedElement element) { - ICElement ice = CDTUITools.getEditorInputCElement(m_input); - - if (ice instanceof ITranslationUnit) { - ITranslationUnit itu = (ITranslationUnit) ice; - ICElement icElement = ObtainICElement.getICElement(syncCpp.getCodeGen(), itu, element); - if (icElement instanceof ISourceReference) { - try { - ISourceRange range = ((ISourceReference) icElement).getSourceRange(); - - ISourceViewer viewer = getSourceViewer(); - viewer.revealRange(range.getStartPos(), 1); - viewer.setSelectedRange(range.getStartPos(), range.getLength()); - return; - } catch (CoreException e) { - Activator.log.error(e); - } - } - } - } - - @Override - public boolean isDirty() { - boolean isDirty = super.isDirty(); - if (isDirty != oldDirty) { - oldDirty = isDirty; - // hack. Normally, the saveAndDirtyService detects this itself (should find a solution how it can do that) - // ((SaveAndDirtyService) saveAndDirtyService).fireIsDirtyChanged(); - } - return isDirty; - } - - /** - * We override this method because setInput can't be overriden for TextEditor. - * We replace the default Papyrus input with the CPP file - * - * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput) - * - * @param input - * @throws CoreException - */ - @Override - protected void doSetInput(IEditorInput input) throws CoreException { - - URI uri = papyrusTextInstance.eResource().getURI(); - Classifier classifier = (Classifier) papyrusTextInstance.getEditedObject(); - String generatorID = papyrusTextInstance.getGeneratorID(); - srcFile = SyncModelToCDT.syncModelToCDT(classifier, generatorID); - if (srcFile == null || !srcFile.exists()) { - throw new PartInitException("Code generation before editing failed. Please check error log"); - } - IEditorInput newInput = new FileEditorInput(srcFile); - - // IStorage storage = new TextStorage(string); - super.doSetInput(newInput); - - syncCpp = new SyncCDTtoModel(newInput, classifier, uri.segment(1), generatorID); - m_input = newInput; - reveal = new RevealCurrentOperation(newInput, classifier, uri.segment(1)); - - // add the reconciler to get syntax check and completion. (still no full checks) - addReconcileListener(new CodanCReconciler()); - } - - /** - * - * @see org.eclipse.ui.editors.text.TextEditor#dispose() - * - */ - @Override - public void dispose() { - - saveAndDirtyService.removeIsaveablePart(this); - if (gotoListener != null) { - papyrusTextInstance.eAdapters().remove(gotoListener); - } - - // we remove the listener - StyledText st = getSourceViewer().getTextWidget(); - st.removeFocusListener(focusListener); - super.dispose(); - // assure that embedded text widget is disposed now. Otherwise, it will be closed - // later, when the editorSite is already set to null by Papyrus (mainEditorSite attribute in MultiPageEditorSite4x) - // resulting in a null pointer exception and resulting inconsistencies in the Papyrus editor. - st.dispose(); - } - - protected IAction gmfUndo, gmfRedo; - - protected IAction textUndo, textRedo; - - protected boolean oldDirty; - - protected ISaveAndDirtyService saveAndDirtyService; - - protected IFile srcFile; - - protected ISelectionProvider sp; - - protected IEditorInput m_input; -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/factory/PapyrusCDTEditorFactory.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/factory/PapyrusCDTEditorFactory.java deleted file mode 100644 index f4f552858e7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/factory/PapyrusCDTEditorFactory.java +++ /dev/null @@ -1,210 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013, 2014 CEA LIST and others. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * Ansgar Radermacher (CEA LIST) - Minor adaptations - * Christian W. Damus (CEA) - bug 392301 - * - *****************************************************************************/ -package org.eclipse.papyrus.texteditor.cdt.factory; - -import org.eclipse.papyrus.infra.core.editor.BackboneException; -import org.eclipse.papyrus.infra.core.extension.diagrameditor.AbstractEditorFactory; -import org.eclipse.papyrus.infra.core.multidiagram.actionbarcontributor.ActionBarContributorRegistry; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.texteditor.cdt.Activator; -import org.eclipse.papyrus.texteditor.cdt.editor.PapyrusCDTEditor; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.part.EditorActionBarContributor; - - -public class PapyrusCDTEditorFactory extends AbstractEditorFactory { - - /** - * Constructor. - */ - public PapyrusCDTEditorFactory() { - super(PapyrusCDTEditor.class, PapyrusCDTEditor.EDITOR_TYPE); - } - - /** - * Create the IPageModel that is used by the SashWindows to manage the editor. - * - * @see org.eclipse.papyrus.infra.core.editorsfactory.IEditorFactory#createIPageModel(java.lang.Object) - * - * @param pageIdentifier - * The model pushed in the sashmodel by the creation command - * @return A model implementing the IPageModel - */ - @Override - public IPageModel createIPageModel(Object pageIdentifier) { - return new TextEditorModelDelegate(pageIdentifier); - } - - /** - * @see org.eclipse.papyrus.infra.core.editorsfactory.IEditorFactory#isPageModelFactoryFor(java.lang.Object) - * - * @param pageIdentifier - * @return - */ - @Override - public boolean isPageModelFactoryFor(Object pageIdentifier) { - if (pageIdentifier instanceof TextEditorModel) { - return ((TextEditorModel) pageIdentifier).getType().equals(this.getExpectedType()); - } - return false; - } - - /** - * IEditorModel used internally by the SashContainer. This model know how to handle IEditor creation. - * - */ - class TextEditorModelDelegate implements IEditorModel { - - /** - * The created editor. - */ - private IEditorPart editor; - - /** - * The raw model stored in the SashProvider. - */ - private TextEditorModel rawEditorModel; - - /** - * - * Constructor. - */ - public TextEditorModelDelegate(Object pageIdentifier) { - rawEditorModel = (TextEditorModel) pageIdentifier; - } - - /** - * Create the IEditor for the diagram. - * - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel#createIEditorPart() - * @return - * @throws PartInitException - * - */ - @Override - public IEditorPart createIEditorPart() throws PartInitException { - try { - // we use this way when there is one factory for several editor types - // Constructor c = getDiagramClass().getConstructor(ServicesRegistry.class, TextEditorModel.class); - // editor = (IEditorPart)c.newInstance(servicesRegistry, rawModel); - - // we use this way when there is only one editor type - editor = new PapyrusCDTEditor(getServiceRegistry(), rawEditorModel); - return editor; - - } catch (Exception e) { - // Lets propagate. This is an implementation problem that should be solved by - // programmer. - throw new PartInitException("Can't create TextEditor", e); - } - - } - - /** - * Get the action bar requested by the Editor. - * - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel#getActionBarContributor() - * @return - * - */ - @Override - public EditorActionBarContributor getActionBarContributor() { - - String actionBarId = editorDescriptor.getActionBarContributorId(); - - // Do nothing if no EditorActionBarContributor is specify. - if (actionBarId == null || actionBarId.length() == 0) { - return null; - } - - // Try to get it. - - // Get ServiceRegistry - // ServicesRegistry serviceRegistry = getServicesRegistry(); - ActionBarContributorRegistry registry; - try { - registry = getServiceRegistry().getService(ActionBarContributorRegistry.class); - } catch (ServiceException e) { - // Service not found - Activator.log.error(e); - return null; - } - - try { - return registry.getActionBarContributor(actionBarId); - } catch (BackboneException e) { - Activator.log.error(e); - return null; - } - } - - /** - * Get the underlying RawModel. Return the TextEditor (normally returns a diagram) - * - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getRawModel() - * @return - * - */ - @Override - public Object getRawModel() { - return rawEditorModel; - } - - /** - * Get the icon to be shown by Tabs - * - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getTabIcon() - * @return - * - */ - @Override - public Image getTabIcon() { - org.eclipse.papyrus.infra.widgets.Activator widgetsActivator = - org.eclipse.papyrus.infra.widgets.Activator.getDefault(); - if (widgetsActivator == null) { - return null; - } - String path = getEditorDescriptor().getIconURL(); - if (path.startsWith(Activator.PLUGIN_ID)) { - // remove PLUGIN-ID prefix from the path (since the image will be searched relative to plugin) - path = path.substring(Activator.PLUGIN_ID.length()); - } - return widgetsActivator.getImage(Activator.PLUGIN_ID, path); - } - - /** - * Get the title of the Diagram. - * - * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getTabTitle() - * @return - * - */ - @Override - public String getTabTitle() { - return rawEditorModel.getName(); - } - - @Override - public void dispose() { - // Pass. The tab icon is a plugin-shared image - } - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/handler/PapyrusCDTEditorHandler.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/handler/PapyrusCDTEditorHandler.java deleted file mode 100644 index 7d6df1edfc4..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/handler/PapyrusCDTEditorHandler.java +++ /dev/null @@ -1,308 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - * - *****************************************************************************/ -package org.eclipse.papyrus.texteditor.cdt.handler; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.workspace.AbstractEMFOperation; -import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; -import org.eclipse.papyrus.codegen.extensionpoints.LanguageCodegen; -import org.eclipse.papyrus.commands.CheckedOperationHistory; -import org.eclipse.papyrus.infra.core.resource.NotFoundException; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager; -import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelManager; -import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; -import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; -import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; -import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.infra.core.utils.ServiceUtils; -import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForHandlers; -import org.eclipse.papyrus.texteditor.cdt.Activator; -import org.eclipse.papyrus.texteditor.cdt.TextEditorConstants; -import org.eclipse.papyrus.texteditor.cdt.editor.PapyrusCDTEditor; -import org.eclipse.papyrus.texteditor.cdt.modelresource.TextEditorModelSharedResource; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelFactory; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Transition; -import org.eclipse.uml2.uml.UMLPackage; - - -/** - * The handler creates a new CDT editor - */ -public class PapyrusCDTEditorHandler extends CmdHandler { - - - public PapyrusCDTEditorHandler() { - } - - /** - * - * @see org.eclipse.infra.core.commands.AbstractHandler#isEnabled() - * - * @return - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - // Filter Classes (including Behaviors, since Behavior inherits from Class), Operation and Transition - if (selectedEObject instanceof Class || - selectedEObject instanceof Operation || - selectedEObject instanceof Transition) - { - URI uri = selectedEObject.eResource().getURI(); - - // URIConverter uriConverter = resource.getResourceSet().getURIConverter(); - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - if (uri.segmentCount() < 2) { - return false; - } - IProject modelProject = root.getProject(uri.segment(1)); - return modelProject.exists(); - } - return false; - } - - /** - * @see org.eclipse.infra.core.commands.IHandler#execute(org.eclipse.infra.core.commands.ExecutionEvent) - * - * @param event - * @return - * @throws ExecutionException - */ - @Override - public Object execute(final ExecutionEvent event) throws ExecutionException { - try { - final ServicesRegistry serviceRegistry = ServiceUtilsForHandlers.getInstance().getServiceRegistry(event); - TransactionalEditingDomain domain = ServiceUtils.getInstance().getTransactionalEditingDomain(serviceRegistry); - - // Create the transactional command - AbstractEMFOperation command = new AbstractEMFOperation(domain, "Create CDT editor") { - - @Override - protected IStatus doExecute(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { - try { - PapyrusCDTEditorHandler.this.doExecute(serviceRegistry); - } catch (ServiceException e) { - Activator.log.error(e); - return Status.CANCEL_STATUS; - } catch (NotFoundException e) { - Activator.log.error(e); - return Status.CANCEL_STATUS; - } - return Status.OK_STATUS; - } - }; - - // Execute the command - CheckedOperationHistory.getInstance().execute(command, new NullProgressMonitor(), null); - } catch (ExecutionException e) { - Activator.log.error("Can't create a CDT editor", e); - } catch (ServiceException e) { - Activator.log.error("Service exception during creation of CDT editor", e); - } - return null; - } - - - /** - * Do the execution of the command. - * - * @param serviceRegistry - * @throws ServiceException - * @throws NotFoundException - */ - public void doExecute(final ServicesRegistry serviceRegistry) throws ServiceException, NotFoundException { - // Get the page manager allowing to add/open an editor. - final IPageManager pageMngr = ServiceUtils.getInstance().getIPageManager(serviceRegistry); - - Classifier classifierToEdit = getClassifierToEdit(); - TextEditorModel editorModel = getEditorModel(serviceRegistry, classifierToEdit); - if (editorModel == null) { - // no editor exist for the given file => create - editorModel = createEditorModel(serviceRegistry, classifierToEdit); - if (editorModel == null) { - return; - } - } - ILangCodegen codegen = LanguageCodegen.getGenerator(TextEditorConstants.CPP, editorModel.getGeneratorID()); - - if (codegen.getTargetProject(classifierToEdit, true) == null) { - return; - } - - if (selectedEObject instanceof Transition) { - Transition transition = (Transition) selectedEObject; - if (transition.getEffect() == null) { - Behavior effect = transition.createEffect("effectOf" + transition.getName(), UMLPackage.eINSTANCE.getOpaqueBehavior()); //$NON-NLS-1$ - } - } - // add the new editor model to the sash. - editorModel.setSelectedObject(selectedEObject); - - final TextEditorModel editorModelFinal = editorModel; - // open asynchronously to prevent handler cycles, see bug 434484 - Display.getDefault().asyncExec(new Runnable() { - - @Override - public void run() { - if (pageMngr.isOpen(editorModelFinal)) { - // select existing editor - pageMngr.selectPage(editorModelFinal); - } - else { - pageMngr.openPage(editorModelFinal); - } - try { - // move page to the RIGHT - DiSashModelManager modelMngr = ServiceUtils.getInstance().getService(DiSashModelManager.class, serviceRegistry); - ISashWindowsContentProvider sashContentProvider = modelMngr.getISashWindowsContentProvider(); - Object rootModel = sashContentProvider.getRootModel(); - - if (rootModel instanceof TabFolder) { - // root = tabFolder, i.e. there is a single folder - ISashWindowsContainer sashContainer = ServiceUtils.getInstance().getISashWindowsContainer(serviceRegistry); - int index = lookupIndex((TabFolder) rootModel, editorModelFinal); - if (index != -1) { - sashContentProvider.createFolder(sashContainer.getSelectedTabFolderModel(), index, sashContainer.getSelectedTabFolderModel(), SWT.RIGHT); - } - } - else if (rootModel instanceof SashPanel) { - // multiple tab-folders exist. Find existing one and move editorModel to other - // TODO - // ISashWindowsContainer sashContainer = ServiceUtils.getInstance().getISashWindowsContainer(serviceRegistry); - // sashContentProvider.movePage(sashContainer.getSelectedTabFolderModel(), lookupIndex(sourceTab, editorModel), targetTabModel, -1); - } - } catch (ServiceException e) { - - } - } - - }); - - } - - /** - * Create a model identifying the editor. This model will be saved with the sash - * - * @return - * @throws ServiceException - * @throws NotFoundException - * The model where to save the TableInstance is not found. - */ - protected TextEditorModel createEditorModel(final ServicesRegistry serviceRegistry, Classifier classifierToEdit) throws ServiceException, NotFoundException { - TextEditorModel editorModel = TextEditorModelFactory.eINSTANCE.createTextEditorModel(); - - editorModel.setEditedObject(classifierToEdit); - editorModel.setType(PapyrusCDTEditor.EDITOR_TYPE); - editorModel.setName("CDT " + classifierToEdit.getName()); //$NON-NLS-1$ - ILangCodegen codegen = LanguageCodegen.chooseGenerator(TextEditorConstants.CPP, classifierToEdit); - if (codegen == null) { - return null; - } - editorModel.setGeneratorID(LanguageCodegen.getID(codegen)); - TextEditorModelSharedResource model = (TextEditorModelSharedResource) - ServiceUtils.getInstance().getModelSet(serviceRegistry).getModelChecked(TextEditorModelSharedResource.MODEL_ID); - model.addTextEditorModel(editorModel); - - return editorModel; - } - - /** - * The classifier to edit - corresponding to the selected object. - * - * @return - */ - protected Classifier getClassifierToEdit() { - if (selectedEObject instanceof Operation) { - return ((Operation) selectedEObject).getFeaturingClassifiers().get(0); - } - else if (selectedEObject instanceof Transition) { - return ((Transition) selectedEObject).getContainer().getStateMachine().getContext(); - } - else if (selectedEObject instanceof Behavior) { - Element owner = (Behavior) selectedEObject; - while (owner != null) { - owner = owner.getOwner(); - if ((owner instanceof Classifier) && !(owner instanceof Behavior)) { - return (Classifier) owner; - } - } - return null; - } - else if (selectedEObject instanceof Classifier) { - // must be class or datatype - return (Classifier) selectedEObject; - } - return null; - } - - /** - * return the editor model corresponding to an EObject - * - * @param serviceRegistry - * the service registry - * @param classifierToEdit - * The classifier for which a CDT editor should be opened - * @return - * @throws ServiceException - * @throws NotFoundException - */ - protected TextEditorModel getEditorModel(final ServicesRegistry serviceRegistry, Classifier classifierToEdit) throws ServiceException, NotFoundException { - TextEditorModelSharedResource model = (TextEditorModelSharedResource) - ServiceUtils.getInstance().getModelSet(serviceRegistry).getModelChecked(TextEditorModelSharedResource.MODEL_ID); - return model.getTextEditorModel(classifierToEdit); - } - - /** - * Recursively search in sash models for a FolderModel. - * Return the first encountered folder. - * - * @param panelModel - * @return - */ - public static int lookupIndex(TabFolder folder, Object model) { - - int index = 0; - for (PageRef pr : folder.getChildren()) { - if (pr.getPageIdentifier() == model) { - return index; - } - index++; - } - return -1; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ChangeKind.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ChangeKind.java deleted file mode 100644 index c6e407ed35f..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ChangeKind.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.eclipse.papyrus.texteditor.cdt.listener; - -public enum ChangeKind { - INTERFACE, - IMPLEMENTATION, - OPERATION -}; diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/Closure.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/Closure.java deleted file mode 100644 index b81203d94bc..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/Closure.java +++ /dev/null @@ -1,81 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt.listener; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature.Setting; -import org.eclipse.uml2.common.util.UML2Util; -import org.eclipse.uml2.uml.Association; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; - -/** - * Calculate the closure of classifiers that need to be re-generated, if a - * classifier changes - * - * There are two different reasons for the need to re-generate a classifier: - * (1) one of the elements that it contains has changed - * (2) an element outside the containment close is changed. An example is a superclass - * that changes its name or an association target. In many cases, classifier depend - * on names of outside elements, but the also require a regeneration if the element - * is deleted. - * We need to take the change-kind into account. E.g. if the name of an operation in A changes, we need to - * re-generate class A, but we only need to regenerate class B (inheriting from A), if it actually - * redefines that operation. - */ -public class Closure { - public static EList calc(Classifier cl) { - EList list = new BasicEList(); - calc(cl, list); - return list; - } - - public static void calc(Classifier cl, EList list) { - if (cl != null) { - for (Setting setting : UML2Util.getNonNavigableInverseReferences(cl)) { - EObject eObj = setting.getEObject(); - if (eObj instanceof Element) { - Classifier referencedCl = nearestClassifier(eObj); - if (!list.contains(referencedCl) && (!(referencedCl instanceof Association))) { - list.add(referencedCl); - calc(referencedCl, list); - } - } - } - } - } - - public static boolean isContained(EObject parent, EObject possibleChild) { - while (possibleChild != null) { - if (parent == possibleChild) { - return true; - } - possibleChild = possibleChild.eContainer(); - } - return false; - } - - public static Classifier nearestClassifier(EObject eObj) { - while (eObj != null) { - if (eObj instanceof Classifier) { - return (Classifier) eObj; - } - eObj = eObj.eContainer(); - } - return null; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ModelListener.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ModelListener.java deleted file mode 100644 index 18bc74c536e..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ModelListener.java +++ /dev/null @@ -1,135 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt.listener; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; -import org.eclipse.papyrus.uml.tools.listeners.PapyrusStereotypeListener; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.DirectedRelationship; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Feature; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Parameter; - -/** - * Main listener for model changes (registered via plugin.xml). It will delegate - * to the sub-listeners for specific sub-elements (type, operation, port, ...) that - * can be found in this package - * - * @author ansgar - * - */ -public class ModelListener implements IPapyrusListener { - - /** - * set to true, if a synchronization from an CDT editor to the model is active - */ - public static boolean syncFromEditor; - - @Override - public void notifyChanged(Notification notification) { - Object notifier = notification.getNotifier(); - int eventType = notification.getEventType(); - if (syncFromEditor) { - return; - } - if ((eventType == Notification.REMOVING_ADAPTER) || - (eventType == Notification.RESOLVE)) { - // does not indicate a modification of the element - return; - } - // System.err.println(eventType + ": " + notifier); - - OperationHistoryListener.init(); - try { - // TODO: kind of get nearest classifier - - if (notifier instanceof Classifier) { - Classifier classifier = (Classifier) notifier; - if ((eventType == Notification.REMOVE) || - (eventType == PapyrusStereotypeListener.MODIFIED_STEREOTYPE)) { - regenList.add(classifier); - } - // don't treat addition here, since operations/properties do not have their final names yet - // IStorage storage = new TextStorage(string); - } - if (notifier instanceof Behavior) { - Behavior behavior = (Behavior) notifier; - if (eventType == Notification.SET) { - // name modification - if (behavior.getSpecification() == null) { - } - } - else if (eventType == Notification.ADD) { - // modification of an opaque behavior in Papyrus implied remove&add operations - Classifier nearestCl = getNearestClassifier(behavior); - if (nearestCl != null) { - regenList.add(nearestCl); - } - } - } - - else if (notifier instanceof Feature) { - // if a feature is added, it is first generated with a dummy name, then the name is corrected. - Feature feature = (Feature) notifier; - Element owner = feature.getOwner(); - if (owner instanceof Classifier) { - // System.out.println(owner); - regenList.add((Classifier) owner); - } - } - else if (notifier instanceof Parameter) { - Parameter parameter = (Parameter) notifier; - if (parameter.getOperation() != null) { - Element owner = parameter.getOperation().getOwner(); - if (owner instanceof Classifier) { - // System.out.println(owner); - regenList.add((Classifier) owner); - } - } - } - else if (notifier instanceof DirectedRelationship) { - // if a feature is added, it is first generated with a dummy name, then the name is corrected. - DirectedRelationship dr = (DirectedRelationship) notifier; - for (Element client : dr.getSources()) { - if (client instanceof Classifier) { - // System.out.println(client); - regenList.add((Classifier) client); - } - } - } - else if (notifier instanceof Package) { - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static Classifier getNearestClassifier(Element element) { - while (element != null) { - if (!(element instanceof Behavior) && (element instanceof Classifier)) { - return (Classifier) element; - } - element = element.getOwner(); - } - return null; - } - - static EList regenList = new UniqueEList(); -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/OperationHistoryListener.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/OperationHistoryListener.java deleted file mode 100644 index ca34d6ab0ba..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/OperationHistoryListener.java +++ /dev/null @@ -1,76 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt.listener; - -import org.eclipse.core.commands.operations.IOperationHistoryListener; -import org.eclipse.core.commands.operations.OperationHistoryEvent; -import org.eclipse.core.commands.operations.OperationHistoryFactory; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.infra.core.resource.NotFoundException; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.services.ServicesRegistry; -import org.eclipse.papyrus.infra.core.utils.ServiceUtils; -import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject; -import org.eclipse.papyrus.texteditor.cdt.Activator; -import org.eclipse.papyrus.texteditor.cdt.modelresource.TextEditorModelSharedResource; -import org.eclipse.papyrus.texteditor.cdt.sync.SyncModelToCDT; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; -import org.eclipse.uml2.uml.Classifier; - -public class OperationHistoryListener implements IOperationHistoryListener { - - public static void init() { - if (ohl == null) { - ohl = new OperationHistoryListener(); - OperationHistoryFactory.getOperationHistory().addOperationHistoryListener(ohl); - } - } - - private static OperationHistoryListener ohl = null; - - @Override - public void historyNotification(OperationHistoryEvent event) { - int eventType = event.getEventType(); - if (eventType == OperationHistoryEvent.OPERATION_ADDED || eventType == OperationHistoryEvent.REDONE - || eventType == OperationHistoryEvent.UNDONE) { - - EList regenListCopy = new BasicEList(ModelListener.regenList); - ModelListener.regenList.clear(); - - // re-generate files from list - if they are still in a resource - for (Classifier cl : regenListCopy) { - if (cl.eResource() != null) { - try { - ServicesRegistry serviceRegistry = ServiceUtilsForEObject.getInstance().getServiceRegistry(cl); - TextEditorModelSharedResource model = (TextEditorModelSharedResource) ServiceUtils.getInstance() - .getModelSet(serviceRegistry).getModelChecked(TextEditorModelSharedResource.MODEL_ID); - - if (model != null) { - TextEditorModel tem = model.getTextEditorModel(cl); - if (tem != null) { - SyncModelToCDT.syncModelToCDT(cl, tem.getGeneratorID()); - } - } - } catch (ServiceException e) { - Activator.log.error(e); - } catch (NotFoundException e) { - Activator.log.error(e); - } - } - } - } - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/modelresource/TextEditorModelSharedResource.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/modelresource/TextEditorModelSharedResource.java deleted file mode 100644 index 7781972dd12..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/modelresource/TextEditorModelSharedResource.java +++ /dev/null @@ -1,120 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.texteditor.cdt.modelresource; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource; -import org.eclipse.papyrus.infra.core.resource.IModel; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; - - -public class TextEditorModelSharedResource extends AbstractModelWithSharedResource implements IModel { - - - /** - * File extension used for notation. - */ - public static final String NOTATION_FILE_EXTENSION = "notation"; //$NON-NLS-1$ - - /** - * Model ID. - */ - public static final String MODEL_ID = "org.eclipse.papyrus.exteditor.cdt.CDTEditorModelSharedResource"; //$NON-NLS-1$ - - - /** - * - * Constructor. - * - */ - public TextEditorModelSharedResource() { - - } - - - /** - * Get the file extension used for this model. - * - * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getModelFileExtension() - * - * @return - */ - @Override - protected String getModelFileExtension() { - return NOTATION_FILE_EXTENSION; - } - - /** - * Get the identifier used to register this model. - * - * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getIdentifier() - * - * @return - */ - @Override - public String getIdentifier() { - return MODEL_ID; - } - - - /** - * Add a new initialized {@link TextEditorModel} to the model. - * - * @param textInstance - * The textInstance to add. - */ - public void addTextEditorModel(TextEditorModel textInstance) { - getResource().getContents().add(textInstance); - } - - /** - * Add a new initialized {@link PapyrustextInstance} to the model. - * - * @param textInstance - * The textInstance to add. - */ - public void removeTextEditorModel(TextEditorModel textInstance) { - getResource().getContents().remove(textInstance); - } - - /** - * @param editedObject - * an edited element - * @return an editor reference for a given object if an editor exists, or null - */ - public TextEditorModel getTextEditorModel(EObject editedObject) { - for (EObject textInstanceEO : getResource().getContents()) { - if (textInstanceEO instanceof TextEditorModel) { - TextEditorModel textInstance = (TextEditorModel) textInstanceEO; - if (textInstance.getEditedObject() == editedObject) { - return textInstance; - } - } - } - return null; - } - - /** - * - * @see org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#isModelRoot(org.eclipse.emf.ecore.EObject) - * - * @param object - * @return - */ - @Override - protected boolean isModelRoot(EObject object) { - return false; - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceConstants.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceConstants.java deleted file mode 100644 index ca20cafca87..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceConstants.java +++ /dev/null @@ -1,33 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.texteditor.cdt.preferences; - -/** - * Constant definitions for plug-in preferences - */ -public class CDTPreferenceConstants { - - /** - * Default option for opening the editor at a specified location. Store uses directly the SWT constants - */ - public static final String P_OPEN_LOCATION = "openLocation"; //$NON-NLS-1$ - - /** - * For attributes, the default "aggregation kind" value is "none". When this option is set - * it will be treated as composite - */ - public static final String P_SYNC_PERMANENTLY = "syncPermanently"; //$NON-NLS-1$ - - public static final String P_SYNC_ALL_FILES = "syncAllFiles"; //$NON-NLS-1$ -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceInitializer.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceInitializer.java deleted file mode 100644 index 494838690c5..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceInitializer.java +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt.preferences; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.texteditor.cdt.Activator; -import org.eclipse.swt.SWT; - -/** - * Class used to initialize default preference values. - */ -public class CDTPreferenceInitializer extends AbstractPreferenceInitializer { - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() - */ - @Override - public void initializeDefaultPreferences() { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - store.setDefault(CDTPreferenceConstants.P_OPEN_LOCATION, SWT.RIGHT); - store.setDefault(CDTPreferenceConstants.P_SYNC_ALL_FILES, false); - store.setDefault(CDTPreferenceConstants.P_SYNC_PERMANENTLY, false); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferencePage.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferencePage.java deleted file mode 100644 index efc94febace..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferencePage.java +++ /dev/null @@ -1,64 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.texteditor.cdt.preferences; - -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.papyrus.texteditor.cdt.Activator; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - - -/** - * This class represents the EC3M preference page - *

- * This page is used to modify preferences only. They are stored in the preference store that belongs to the main plug-in class. That way, preferences can be accessed directly via the preference store. - */ - -public class CDTPreferencePage - extends FieldEditorPreferencePage - implements IWorkbenchPreferencePage { - - public CDTPreferencePage() { - super(GRID); - setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription("CDT editor integration options"); //$NON-NLS-1$ - } - - /** - * Creates the field editors. Field editors are abstractions of - * the common GUI blocks needed to manipulate various types - * of preferences. Each field editor knows how to save and - * restore itself. - */ - @Override - public void createFieldEditors() { - addField(new BooleanFieldEditor( - CDTPreferenceConstants.P_SYNC_PERMANENTLY, "&Synchronize permanently (otherwise only on demand)", //$NON-NLS-1$ - getFieldEditorParent())); - - addField(new BooleanFieldEditor( - CDTPreferenceConstants.P_SYNC_ALL_FILES, "Synchronize all classes (otherwise synchronize only classes with open editor)", //$NON-NLS-1$ - getFieldEditorParent())); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ - @Override - public void init(IWorkbench workbench) { - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/FindTransition.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/FindTransition.java deleted file mode 100644 index e737e45abf3..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/FindTransition.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation - * - *******************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt.sync; - -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Transition; - -/** - * Find the behavior in the model from a given method in the code. Used during the - * back synchronization from code to model. - */ -public class FindTransition { - - private static final String UNDERSCORE = "_"; //$NON-NLS-1$ - - public static Behavior findBehavior(Classifier cl, String methodName) { - for (Element element : cl.allOwnedElements()) { - if (element instanceof Transition) { - Transition transition = (Transition) element; - Behavior effect = transition.getEffect(); - if ((effect != null) && behaviorMatches(effect, methodName)) { - return transition.getEffect(); - } - } - } - return null; - } - - public static boolean behaviorMatches(Behavior behavior, String methodName) { - return - methodName.endsWith(NamedElement.SEPARATOR + behavior.getName()) || - methodName.endsWith(UNDERSCORE + behavior.getName()); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ObtainICElement.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ObtainICElement.java deleted file mode 100644 index e5457380c45..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ObtainICElement.java +++ /dev/null @@ -1,129 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation - * - *******************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt.sync; - -import java.util.Iterator; - -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IFunctionDeclaration; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; -import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen2; -import org.eclipse.papyrus.codegen.extensionpoints.MethodInfo; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.ParameterDirectionKind; -import org.eclipse.uml2.uml.Transition; - - -/** - * This class is used to select the operation the user wants to edit after opening the editor. - * In case of transition, the selection is based on simple name only (either prefixed with the name separator or with an - * underscore - based on the assumption that scoped names are either kept or flattened using underscore as separator - * - */ -public class ObtainICElement { - - /** - * Return the ICelement associated with a UML element. Currently, only methods are supported. - * - * @param parent - * the parent (typically the translation unit of a CDT file) - * @param element - * A named UML element - * @throws CoreException - */ - public static ICElement getICElement(ILangCodegen codegen, IParent parent, NamedElement element) { - MethodInfo methodInfo = null; - NamedElement operationOrBehavior = element; - if (element instanceof Transition) { - operationOrBehavior = ((Transition) element).getEffect(); - } - - // no behavior found => not possible to locate element - if (operationOrBehavior == null) { - return null; - } - - if (codegen instanceof ILangCodegen2) { - // get generator specific method info. - methodInfo = ((ILangCodegen2) codegen).getMethodInfo(operationOrBehavior); - } - if (methodInfo == null) { - // use default behavior. - if (element instanceof Behavior) { - methodInfo = MethodInfo.fromBehavior((Behavior) operationOrBehavior); - } - else if (element instanceof Operation) { - methodInfo = MethodInfo.fromOperation((Operation) operationOrBehavior); - } - else { - return null; - } - } - - try { - for (ICElement child : parent.getChildren()) { - if (child instanceof IParent) { - return getICElement(codegen, (IParent) child, element); - } - if (child instanceof IFunctionDeclaration) { - IFunctionDeclaration function = (IFunctionDeclaration) child; - - // does the element name match? (CDT provides className::methodName information). Since we are in the scope of - // the class, we only verify the postfix part of the name - if (child.getElementName().endsWith(NamedElement.SEPARATOR + methodInfo.getName())) { - // check, if parameters match. This handles most common overloading cases (it does not handle functions that - // only differ with respect to the modifiers - Iterator paramIter = methodInfo.getParameterTypes().iterator(); - boolean match = methodInfo.getParameterTypes().size() == function.getParameterTypes().length; - if (match) { - for (String cdtParamType : function.getParameterTypes()) { - String umlParamType = paramIter.next(); - if (!cdtParamType.equals(umlParamType)) { - match = false; - break; - } - } - if (match) { - return child; - } - } - } - } - } - } catch (CoreException e) { - } - return null; - } - - /** - * Count the number of parameters without taking the return parameter into account - * - * @param list - * @return - */ - public static int countParameters(EList list) { - int params = 0; - for (Parameter par : list) { - if (par.getDirection() != ParameterDirectionKind.RETURN_LITERAL) { - params++; - } - } - return params; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ParameterModifiers.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ParameterModifiers.java deleted file mode 100644 index 8601ac73484..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ParameterModifiers.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation - * - *******************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt.sync; - -/** - * Simple grouping of modifier related parameters - */ -public class ParameterModifiers { - public ParameterModifiers() { - isPointer = false; - isRef = false; - isRegister = false; - array = ""; //$NON-NLS-1$ - } - - /** - * true, if parameter is a pointer - */ - boolean isPointer; - - /** - * true, if parameter is a reference - */ - boolean isRef; - - /** - * true, if parameter is a register - */ - boolean isRegister; - - /** - * value of array modifiers (e.g. [2]) - */ - String array ; -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/RevealCurrentOperation.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/RevealCurrentOperation.java deleted file mode 100644 index cf53a0b5468..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/RevealCurrentOperation.java +++ /dev/null @@ -1,128 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation - * - *******************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt.sync; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.dom.ast.IASTNodeSelector; -import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; -import org.eclipse.cdt.core.index.IIndex; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IFunctionDeclaration; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.cdt.core.model.ISourceRange; -import org.eclipse.cdt.core.model.ISourceReference; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.ui.CDTUITools; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.papyrus.infra.core.Activator; -import org.eclipse.ui.IEditorInput; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Operation; - - -public class RevealCurrentOperation { - - public RevealCurrentOperation(IEditorInput input, Classifier classifier, String projectName) { - m_input = input; - m_classifier = classifier; - m_projectName = projectName; - } - - public Element obtainSelectedElement(ITextSelection selection) { - ICElement ice = CDTUITools.getEditorInputCElement(m_input); - - if (ice instanceof ITranslationUnit) { - ICProject project = CoreModel.getDefault().getCModel().getCProject(m_projectName); - - IIndex index = null; - try { - index = CCorePlugin.getIndexManager().getIndex(project); - index.acquireReadLock(); - - // index = CCorePlugin.getIndexManager().getIndex(project); - ITranslationUnit itu = (ITranslationUnit) ice; - // hack: force re-evaluation of AST node, requires modified CDT! - // Seems to be no longer required. - // ASTProvider.getASTProvider().fCache.setActiveElement(itu); - - IASTTranslationUnit ast = itu.getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS); - IASTNodeSelector selector = ast.getNodeSelector(null); - - String opName = findOperation(itu, selector, itu, selection); - if (opName != null) { - int sep = opName.lastIndexOf("::"); //$NON-NLS-1$ - if (sep != -1) { - opName = opName.substring(sep + 2); - } - Operation operation = m_classifier.getOperation(opName, null, null); - if (operation != null) { - return operation; - } - } - - } catch (CModelException e) { - Activator.getDefault().getLog().log(e.getStatus()); - } catch (Exception e) { - System.err.println(e); - } finally { - if (index != null) { - index.releaseReadLock(); - } - } - } - return m_classifier; - } - - /** - * Examine the children of a translation unit in order to extract the methods that are defined within - * the unit - * - * @param itu - * @param selector - * @param parent - * @throws CModelException - */ - public String findOperation(ITranslationUnit itu, IASTNodeSelector selector, IParent parent, ITextSelection selection) throws CModelException { - - for (ICElement child : parent.getChildren()) { - if (child instanceof IParent) { - return findOperation(itu, selector, (IParent) child, selection); - } - ISourceRange range = null; - if (child instanceof ISourceReference) { - range = ((ISourceReference) child).getSourceRange(); - } - if (child instanceof IFunctionDeclaration) { - // function declaration is a superclass for method declaration (but need to trace functions differently?) - String name = ((IFunctionDeclaration) child).getElementName(); - int pos = selection.getOffset(); - if ((pos >= range.getStartPos()) && (pos < range.getStartPos() + range.getLength())) { - return name; - } - } - } - return null; - } - - - - protected IEditorInput m_input; - - protected Classifier m_classifier; - - protected String m_projectName; -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncCDTtoModel.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncCDTtoModel.java deleted file mode 100644 index 1a0d635b974..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncCDTtoModel.java +++ /dev/null @@ -1,635 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation - * - *******************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt.sync; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.dom.ast.ExpansionOverlapsBoundaryException; -import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement; -import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier; -import org.eclipse.cdt.core.dom.ast.IASTFileLocation; -import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator; -import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition; -import org.eclipse.cdt.core.dom.ast.IASTName; -import org.eclipse.cdt.core.dom.ast.IASTNode; -import org.eclipse.cdt.core.dom.ast.IASTNodeSelector; -import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration; -import org.eclipse.cdt.core.dom.ast.IASTStatement; -import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; -import org.eclipse.cdt.core.index.IIndex; -import org.eclipse.cdt.core.model.CModelException; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IFunctionDeclaration; -import org.eclipse.cdt.core.model.IMethodDeclaration; -import org.eclipse.cdt.core.model.IParent; -import org.eclipse.cdt.core.model.ISourceRange; -import org.eclipse.cdt.core.model.ISourceReference; -import org.eclipse.cdt.core.model.ITranslationUnit; -import org.eclipse.cdt.core.model.IWorkingCopy; -import org.eclipse.cdt.core.parser.IToken; -import org.eclipse.cdt.ui.CDTUITools; -import org.eclipse.cdt.ui.CUIPlugin; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.C_Cpp.Array; -import org.eclipse.papyrus.C_Cpp.Const; -import org.eclipse.papyrus.C_Cpp.EStorageClass; -import org.eclipse.papyrus.C_Cpp.Include; -import org.eclipse.papyrus.C_Cpp.Ptr; -import org.eclipse.papyrus.C_Cpp.Ref; -import org.eclipse.papyrus.C_Cpp.StorageClass; -import org.eclipse.papyrus.C_Cpp.Volatile; -import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; -import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen2; -import org.eclipse.papyrus.codegen.extensionpoints.LanguageCodegen; -import org.eclipse.papyrus.codegen.extensionpoints.SyncInformation; -import org.eclipse.papyrus.cpp.codegen.Constants; -import org.eclipse.papyrus.infra.core.Activator; -import org.eclipse.papyrus.texteditor.cdt.CommandSupport; -import org.eclipse.papyrus.texteditor.cdt.TextEditorConstants; -import org.eclipse.papyrus.texteditor.cdt.Utils; -import org.eclipse.papyrus.texteditor.cdt.listener.ModelListener; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.papyrus.uml.tools.utils.UMLUtil; -import org.eclipse.ui.IEditorInput; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.BehavioralFeature; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.DataType; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.OpaqueBehavior; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLPackage; - -public class SyncCDTtoModel implements Runnable { - - public static final String REGISTER = "register"; //$NON-NLS-1$ - - public static final String CONST = "const"; //$NON-NLS-1$ - - public static final String VOLATILE = "volatile"; //$NON-NLS-1$ - - public static final String sAtParam = "@param"; //$NON-NLS-1$ - - public static final String ansiCLib = "AnsiCLibrary"; //$NON-NLS-1$ - - public SyncCDTtoModel(IEditorInput input, Classifier classifier, String projectName, String generatorID) { - m_input = input; - m_classifier = classifier; - m_projectName = projectName; - m_codegen = LanguageCodegen.getGenerator(TextEditorConstants.CPP, generatorID); - } - - - public final String c_cpp_langID = "C/C++"; //$NON-NLS-1$ - - public void syncCDTtoModel() { - CommandSupport.exec("update model from CDT", this); - } - - @Override - public void run() { - ICElement ice = CDTUITools.getEditorInputCElement(m_input); - ModelListener.syncFromEditor = true; - - if (ice instanceof ITranslationUnit) { - ICProject project = CoreModel.getDefault().getCModel().getCProject(m_projectName); - - IIndex index = null; - try { - index = CCorePlugin.getIndexManager().getIndex(project); - index.acquireReadLock(); - - // index = CCorePlugin.getIndexManager().getIndex(project); - ITranslationUnit itu = (ITranslationUnit) ice; - // hack: force re-evaluation of AST node, requires modified CDT! - // Seems to be no longer required. - // ASTProvider.getASTProvider().fCache.setActiveElement(itu); - - IASTTranslationUnit ast = itu.getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS); - IASTNodeSelector selector = ast.getNodeSelector(null); - - examineChildren(itu, selector, itu); - updateCppInclude(itu); - - CUIPlugin.getDefault().getProblemMarkerManager(); - if (itu instanceof IWorkingCopy) { - // ((IWorkingCopy)itu).commit(true, new - // NullProgressMonitor()); - // ((IWorkingCopy)itu).reconcile(); - ((IWorkingCopy) itu).reconcile(true, new NullProgressMonitor()); - // ((IWorkingCopy)itu).reconcile(true, true, new - // NullProgressMonitor()); - } - - } catch (CModelException e) { - Activator.getDefault().getLog().log(e.getStatus()); - } catch (Exception e) { - System.err.println(e); - } finally { - if (index != null) { - index.releaseReadLock(); - } - } - } - ModelListener.syncFromEditor = false; - } - - /** - * Examine the children of a translation unit in order to extract the - * methods that are defined within hte unit - * - * @param itu - * @param selector - * @param parent - * @throws CModelException - */ - public void examineChildren(ITranslationUnit itu, IASTNodeSelector selector, IParent parent) - throws CModelException { - - int position = 0; - // if (parent instanceof Namespace) { - for (ICElement child : parent.getChildren()) { - if (child instanceof IParent) { - examineChildren(itu, selector, (IParent) child); - } - ISourceRange range = null; - if (child instanceof ISourceReference) { - range = ((ISourceReference) child).getSourceRange(); - } - if (child instanceof IFunctionDeclaration) { - // function declaration is a superclass for method declaration - // (but need to trace functions differently?) - String name = ((IFunctionDeclaration) child).getElementName(); - IASTNode node = selector.findEnclosingNode(range.getStartPos(), range.getLength()); - if (node instanceof IASTFunctionDefinition) { - IASTFunctionDefinition definition = (IASTFunctionDefinition) node; - IASTFunctionDeclarator declarator = definition.getDeclarator(); - String unfilteredBody = getBody(itu, definition); - // get additional information about method synchronization from generator - SyncInformation syncInfo = null; - if (m_codegen instanceof ILangCodegen2) { - syncInfo = ((ILangCodegen2) m_codegen).getSyncInformation(name, unfilteredBody); - } - String body = Utils.removeGenerated(unfilteredBody); - if (syncInfo == null || !syncInfo.isGenerated) { - // only update method, if it is not generated - NamedElement ne = updateMethod(position, parent, name, body, declarator, syncInfo); - updateComment(itu, definition, ne); - } - // System.err.println("body source <" + body + ">"); - } - position++; - } - } - } - - /** - * update the contents of the CppInclude directive - * - * @param itu - * the translation unit - */ - public void updateCppInclude(ITranslationUnit itu) { - String contents = new String(itu.getContents()); - int preBodyStart = contents.indexOf(Constants.cppIncPreBodyStart); - int preBodyEnd = contents.indexOf(Constants.cppIncPreBodyEnd); - String preBody = ""; //$NON-NLS-1$ - String body = ""; //$NON-NLS-1$ - if (preBodyStart != -1) { - preBodyStart += Constants.cppIncPreBodyStart.length(); - if (preBodyEnd > preBodyStart) { - preBody = contents.substring(preBodyStart, preBodyEnd).trim(); - } - } - - int bodyStart = contents.indexOf(Constants.cppIncBodyStart); - int bodyEnd = contents.indexOf(Constants.cppIncBodyEnd); - - if (bodyStart != -1) { - bodyStart += Constants.cppIncBodyStart.length() + 1; - if (bodyEnd > bodyStart) { - body = contents.substring(bodyStart, bodyEnd).trim(); - } - } - if (body.length() > 0 || preBody.length() > 0) { - Include include = StereotypeUtil.applyApp(m_classifier, Include.class); - if (include != null) { - include.setPreBody(preBody); - include.setBody(body); - } - } - } - - /** - * Update a method in the model based on the qualified name. - * - * @param position - * The position of the method within the file. Used to identify - * renaming operations - * @param parent - * the CDT parent which is used to get a list of children - * @param qualifiedName - * the qualified name of a method - * @param body - * the method body - * @param declarator - * the declarator for the method - * @return the operation or the behavior within the model that got updated. The latter is returned in - * case of behaviors that do not have a specification (e.g. the effect of a transition). - */ - public NamedElement updateMethod(int position, IParent parent, String qualifiedName, String body, - IASTFunctionDeclarator declarator, SyncInformation syncInfo) { - - String names[] = qualifiedName.split(Utils.nsSep); - String name = names[names.length - 1]; - - Operation operation = null; - Behavior behavior = null; - - if (syncInfo == null || (syncInfo.behavior == null && syncInfo.createBehaviorName == null)) { - operation = getModelOperationFromName(name, parent, position); - if (operation != null) { - operation.setName(name); - } else { - // it is possible that the C++ method corresponds to the effect - // of a transition. try to locate the behavior (without using an operation) - behavior = FindTransition.findBehavior(m_classifier, name); - if (behavior == null) { - // still null => create new operation in model - if (m_classifier instanceof Class) { - operation = ((Class) m_classifier).createOwnedOperation(name, null, null); - } else if (m_classifier instanceof DataType) { - operation = ((DataType) m_classifier).createOwnedOperation(name, null, null); - } - } - } - } - else if (syncInfo.behavior != null) { - // operation is still null (=> does not enter operation != null case below) - behavior = syncInfo.behavior; - } - else if ((syncInfo.createBehaviorName != null) && (m_classifier instanceof Class)) { - Class clazz = (Class) m_classifier; - behavior = (OpaqueBehavior) clazz.createOwnedBehavior(syncInfo.createBehaviorName, - UMLPackage.eINSTANCE.getOpaqueBehavior().eClass()); - } - - if (operation != null) { - if (operation.getMethods().size() == 0) { - // operation exists, but does not have any method => create - - if (m_classifier instanceof Class) { - behavior = ((Class) m_classifier).createOwnedBehavior(name, UMLPackage.eINSTANCE.getOpaqueBehavior()); - } else if (m_classifier instanceof DataType) { - // ob = (OpaqueBehavior) ((DataType) - // m_classifier).createOwnedBehavior(name, - // UMLPackage.eINSTANCE.getOpaqueBehavior()); - } - behavior.setSpecification(operation); - behavior.setIsReentrant(false); - } - else { - behavior = operation.getMethods().get(0); - // operation has at least one method, this may not be null. - if (!behavior.getName().equals(name)) { - behavior.setName(name); - } - } - } - - // assertions: operation can be null, behavior is always non-null - - // Remove all parameters from operation / behavior (they will be added later). - // Calling parameters.clear() is not sufficient. Otherwise stereotype - // applications to unresolved elements remain in the model - if (operation != null) { - UMLUtil.destroyElements(operation.getOwnedParameters()); - } - UMLUtil.destroyElements(behavior.getOwnedParameters()); - - for (IASTNode declaratorChild : declarator.getChildren()) { - if (declaratorChild instanceof IASTParameterDeclaration) { - IASTParameterDeclaration parameter = (IASTParameterDeclaration) declaratorChild; - IASTName parameterName = parameter.getDeclarator().getName(); - IASTDeclSpecifier parameterType = parameter.getDeclSpecifier(); - ParameterModifiers modifiers = new ParameterModifiers(); - String parameterTypeName = ""; //$NON-NLS-1$ - try { - IToken token = parameter.getDeclarator().getSyntax(); - while (token != null) { - String tokenStr = token.toString(); - if (tokenStr.equals("*")) { //$NON-NLS-1$ - modifiers.isPointer = true; - } else if (tokenStr.equals("&")) { //$NON-NLS-1$ - modifiers.isRef = true; - } else if (tokenStr.equals("[")) { //$NON-NLS-1$ - while (token != null) { - modifiers.array += token.toString(); - token = token.getNext(); - } - if (token == null) { - break; - } - } - token = token.getNext(); - } - - token = parameterType.getSyntax(); - while (token != null) { - String tokenStr = token.toString(); - if (tokenStr.equals("*")) { //$NON-NLS-1$ - // TODO: check, if this can be called (depending on - // * position with different semantics?) - modifiers.isPointer = true; - } else if (tokenStr.equals("&")) { //$NON-NLS-1$ - modifiers.isRef = true; - } else if (tokenStr.equals(REGISTER)) { - modifiers.isRegister = true; - } else if (tokenStr.equals(CONST) || tokenStr.equals(VOLATILE)) { - // do nothing (use isConst() or isVolatile() operation of parameterType) - // is not part of parameter type - } else { - if (parameterTypeName.length() > 0) { - parameterTypeName += " "; //$NON-NLS-1$ - } - parameterTypeName += tokenStr; - } - token = token.getNext(); - } - } catch (ExpansionOverlapsBoundaryException e) { - } - - NamedElement namedElemParamType = Utils.getQualifiedElement(Utils.getTop(m_classifier), - parameterTypeName); - if (namedElemParamType == null) { - namedElemParamType = Utils.getQualifiedElement(Utils.getTop(m_classifier), - ansiCLib + Utils.nsSep + parameterTypeName); - } - if (parameterType.isRestrict()) { - } - Parameter umlParameter = null; - Type paramType = namedElemParamType instanceof Type ? (Type) namedElemParamType : null; - if (operation != null) { - umlParameter = operation.createOwnedParameter(parameterName.toString(), paramType); - applyParameterModifiers(parameterType, umlParameter, modifiers); - } - umlParameter = behavior.createOwnedParameter(parameterName.toString(), paramType); - applyParameterModifiers(parameterType, umlParameter, modifiers); - } - } - - if (behavior instanceof OpaqueBehavior) { - OpaqueBehavior ob = (OpaqueBehavior) behavior; - if (ob.getBodies().size() == 0) { - ob.getLanguages().add(c_cpp_langID); - ob.getBodies().add(""); //$NON-NLS-1$ - } - for (int i = 0; i < ob.getLanguages().size(); i++) { - // update first body of one of the languages supported by CDT. This implies that - // it is actually not possible to have separate C and C++ bodes in the same opaque - // behavior (which is rarely a good idea). - String language = ob.getLanguages().get(i); - if (TextEditorConstants.CPP.matcher(language).matches() || c_cpp_langID.equals(language)) { - if (i < ob.getBodies().size()) { - // should always be true, unless sync between - // languages/bodies is lost - ob.getBodies().set(i, body); - } - } - } - } - if (operation != null) { - return operation; - } - else { - return behavior; - } - } - - /** - * Apply the modifiers for a parameter, notably the stereotypes of the C++ profile - * - * @param parameterType the CDT AST parameter specification - * @param umlParameter the UML parameter (to which a stereotype should be applied) - * @param modifiers the modifiers that should be applied (stored in an instance of class ParameterModifiers) - */ - public void applyParameterModifiers(IASTDeclSpecifier parameterType, Parameter umlParameter, ParameterModifiers modifiers) { - if (parameterType.isConst()) { - StereotypeUtil.apply(umlParameter, Const.class); - } - if (parameterType.isVolatile()) { - StereotypeUtil.apply(umlParameter, Volatile.class); - } - if (modifiers.isRegister) { - StorageClass sc = StereotypeUtil.applyApp(umlParameter, StorageClass.class); - if (sc != null) { - sc.setStorageClass(EStorageClass.REGISTER); - } - } - if (modifiers.isPointer) { - StereotypeUtil.apply(umlParameter, Ptr.class); - } else if (modifiers.isRef) { - StereotypeUtil.apply(umlParameter, Ref.class); - } - if (modifiers.array.length() > 0) { - Array arraySt = StereotypeUtil.applyApp(umlParameter, Array.class); - if (arraySt != null && !modifiers.array.equals("[]") && (!modifiers.array.equals("[ ]"))) { //$NON-NLS-1$//$NON-NLS-2$ - arraySt.setDefinition(modifiers.array); - } - } - } - - /** - * Obtain an operation from the model by using the name of a CDT method. - * If an operation of the given name does not exist, it might indicate that - * the method has been renamed. - * - * @param name the operation name within CDT - * @param parent the parent of the CDT method within CDT editor model - * @param position the position within the other methods. This information is used to locate methods - * within the model that might have been renamed in the CDT editor. - * @return - */ - public Operation getModelOperationFromName(String name, IParent parent, int position) { - Operation operation = m_classifier.getOperation(name, null, null); - - if (operation == null) { - // operation is not found via name in the model. try to locate the operation in the model at the same - // "position" as the method in the file and - // verify that this method does not have the same name as any method - // in the CDT file. - if (position < m_classifier.getOperations().size()) { - operation = m_classifier.getOperations().get(position); - String modelName = operation.getName(); - try { - for (ICElement child : parent.getChildren()) { - if (child instanceof IMethodDeclaration) { - String cdtName = ((IMethodDeclaration) child).getElementName(); - if (cdtName.equals(modelName)) { - // an existing operation in the CDT file already - // has this name - operation = null; - break; - } - } - } - } catch (CModelException e) { - } - } - } - return operation; - } - - public static String getBody(ITranslationUnit itu, IASTFunctionDefinition definition) { - IASTStatement body = definition.getBody(); - - if (body instanceof IASTCompoundStatement) { - IASTCompoundStatement bodyComp = (IASTCompoundStatement) body; - - IASTFileLocation bodyLoc = bodyComp.getFileLocation(); - int start = bodyLoc.getNodeOffset(); - int end = start + bodyLoc.getNodeLength(); - char contents[] = itu.getContents(); - // body contains enclosing { } which we need to remove (+2, -2). We - // cannot use the - // first and last statement, since leading and trailing comments are - // not part of the AST tree. - return Utils.decreaseIndent(contents, start + 2, end - 2); - } - return ""; //$NON-NLS-1$ - } - - /** - * update a comment of a named element. Besides the comment of the element itself, comments on contained - * parameters are handled. - * - * @param itu a translation unit - * @param definition - * @param ne a named element that is either an operation or a behavior (in order to update parameters) - */ - public void updateComment(ITranslationUnit itu, IASTFunctionDefinition definition, NamedElement ne) { - IASTFileLocation bodyLoc = definition.getFileLocation(); - int start = bodyLoc.getNodeOffset() - 1; - int end = start; - char contents[] = itu.getContents(); - String comment = ""; //$NON-NLS-1$ - // backward scan for beginning /* - while (start > 0) { - if (contents[start] == '/' && contents[start + 1] == '*') { - start += "/**".length(); // TODO: common string //$NON-NLS-1$ - // constants with generator - for (int i = start; i < end; i++) { - comment += contents[i]; - } - comment = comment.replace("\n * ", "\n"). //$NON-NLS-1$//$NON-NLS-2$ - replace("*/", "").trim(); //$NON-NLS-1$//$NON-NLS-2$ - break; - } - start--; - } - if (comment.length() > 0) { - // filter @param - int atParam = comment.indexOf(sAtParam); - String commentMethodOnly = (atParam != -1) ? comment.substring(0, atParam).trim() : comment; - - EList commentsUML = ne.getOwnedComments(); - Comment commentUML; - if (commentsUML.size() == 0) { - commentUML = ne.createOwnedComment(); - commentUML.getAnnotatedElements().add(commentUML); - } else { - commentUML = commentsUML.get(0); - } - while (atParam != -1) { - int currentAtParam = atParam; - atParam = comment.indexOf(sAtParam, atParam + 1); - String commentParam = (atParam != -1) ? comment.substring(currentAtParam, atParam) - : comment.substring(currentAtParam); - Comment commentParamUML; - int atParamName = sAtParam.length(); - - while ((atParamName < commentParam.length()) - && Character.isWhitespace(commentParam.charAt(atParamName))) { - atParamName++; - } - int atParamNameEnd = atParamName; - while ((atParamNameEnd < commentParam.length()) - && !Character.isWhitespace(commentParam.charAt(atParamNameEnd))) { - atParamNameEnd++; - } - if (atParamNameEnd < commentParam.length() - 1) { - String parameterName = commentParam.substring(atParamName, atParamNameEnd); - String commentParamText = commentParam.substring(atParamNameEnd).trim(); - Parameter parameter = null; - if (ne instanceof BehavioralFeature) { - parameter = ((BehavioralFeature) ne).getOwnedParameter(parameterName, null, false, false); - } - else if (ne instanceof Behavior) { - parameter = ((Behavior) ne).getOwnedParameter(parameterName, null, false, false); - } - if (parameter != null) { - EList commentsParamUML = parameter.getOwnedComments(); - if (commentsParamUML.size() == 0) { - commentParamUML = parameter.createOwnedComment(); - commentParamUML.getAnnotatedElements().add(commentParamUML); - } else { - commentParamUML = commentsParamUML.get(0); - } - commentParamUML.setBody(commentParamText); - } else { - // parameter is not found in model, e.g. either renamed - // or not yet existing - // store comment in operation comment - commentMethodOnly += "\n " + sAtParam + parameterName + //$NON-NLS-1$ - " not found(!) " + commentParamText; //$NON-NLS-1$ - } - } - } - commentUML.setBody(commentMethodOnly); - } - } - - /** - * Accessor - * @return value of codegen attribute - */ - public ILangCodegen getCodeGen() { - return m_codegen; - } - - /** - * input of the CDT editor. Used to obtain code within editor. - */ - protected IEditorInput m_input; - - /** - * The classifier (class) that is currently edited - */ - protected Classifier m_classifier; - - /** - * name of CDT project in which the generated code is stored. - */ - protected String m_projectName; - - /** - * reference to code generator - */ - protected ILangCodegen m_codegen; -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncModelToCDT.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncModelToCDT.java deleted file mode 100644 index 207dfa013c9..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncModelToCDT.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation - * - *******************************************************************************/ - -package org.eclipse.papyrus.texteditor.cdt.sync; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Path; -import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; -import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen.FILE_KIND; -import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen2; -import org.eclipse.papyrus.codegen.extensionpoints.LanguageCodegen; -import org.eclipse.papyrus.cpp.codegen.Constants; -import org.eclipse.papyrus.infra.core.Activator; -import org.eclipse.papyrus.texteditor.cdt.TextEditorConstants; -import org.eclipse.uml2.uml.Classifier; - -/** - * Main listener for model changes (registered via plugin.xml). It will delegate - * to the sub-listeners for specific sub-elements (type, operation, port, ...) that - * can be found in this package - * - */ -public class SyncModelToCDT { - - private static final String CPP_SUFFIX = "cpp"; //$NON-NLS-1$ - /** - * set to true, if a synchronization from an CDT editor to the model is active - */ - public static boolean syncFromEditor; - - public static IFile syncModelToCDT(Classifier classifier, String generatorID) { - if ((classifier == null) || (classifier.eResource() == null)) { - return null; - } - - ILangCodegen codegen = LanguageCodegen.getGenerator(TextEditorConstants.CPP, generatorID); - - IProject modelProject = codegen.getTargetProject(classifier, false); - if (modelProject == null) { - return null; - } - - IContainer srcPkg = null; - IFile cppFile = null; - try { - codegen.generateCode(modelProject, classifier, null); // need listener for sync in both directions! - - String suffix = (codegen instanceof ILangCodegen2) ? - suffix = ((ILangCodegen2) codegen).getSuffix(FILE_KIND.BODY) : CPP_SUFFIX; - - cppFile = modelProject.getFile(new Path(codegen.getFileName(modelProject, classifier) + Constants.DOT + suffix)); - - // IStorage storage = new TextStorage(string); - } finally { - // Refresh the container for the newly created files. This needs to be done even - // during error because of the possibility for partial results. - try { - if (srcPkg != null) { - srcPkg.refreshLocal(IResource.DEPTH_INFINITE, null); - } - } catch (CoreException e) { - Activator.log.error(e); - } - } - return cppFile; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/.classpath b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/.project b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/.project deleted file mode 100644 index 166c5980713..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.texteditor.model - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/META-INF/MANIFEST.MF deleted file mode 100644 index 4b8a8b4deec..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.emf.ecore;visibility:=reexport -Export-Package: org.eclipse.papyrus.texteditor.model.texteditormodel, - org.eclipse.papyrus.texteditor.model.texteditormodel.impl, - org.eclipse.papyrus.texteditor.model.texteditormodel.util -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-ManifestVersion: 2 -Bundle-Description: %pluginDescription -Bundle-SymbolicName: org.eclipse.papyrus.texteditor.model;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/about.html b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/build.properties b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/build.properties deleted file mode 100644 index 83183307edb..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/build.properties +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2012 CEA LIST. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation -# - -bin.includes = .,\ - model/,\ - META-INF/,\ - plugin.xml,\ - about.html,\ - plugin.properties,\ - build.properties -jars.compile.order = . -source.. = src/ -output.. = bin/ -src.includes = about.html diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.ecore b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.ecore deleted file mode 100644 index 9a9647a4907..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.ecore +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.genmodel b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.genmodel deleted file mode 100644 index 37ae28a3a40..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.genmodel +++ /dev/null @@ -1,19 +0,0 @@ - - - texteditormodel.ecore - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/plugin.properties deleted file mode 100644 index 8f2b155a923..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/plugin.properties +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2012 CEA LIST. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation -# (with the help of examining table support from Vincent Lorenzo) -# -pluginName = Ecore model for text editors (Incubation) -providerName = Eclipse Modeling Project - -pluginDescription=This plugin provides the content model for the papyrus text editor diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/plugin.xml deleted file mode 100644 index 444ce844d4c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/plugin.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/pom.xml deleted file mode 100644 index eebe33e351b..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.texteditor.model - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModel.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModel.java deleted file mode 100644 index bc2a6b449b1..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModel.java +++ /dev/null @@ -1,191 +0,0 @@ -/** - * Copyright (c) 2012 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation - * - */ -package org.eclipse.papyrus.texteditor.model.texteditormodel; - -import org.eclipse.emf.ecore.EModelElement; -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Text Editor Model'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getEditedObject Edited Object}
  • - *
  • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getType Type}
  • - *
  • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getName Name}
  • - *
  • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getSelectedObject Selected Object}
  • - *
  • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getLineNumber Line Number}
  • - *
  • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getGeneratorID Generator ID}
  • - *
- * - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel() - * @model - * @generated - */ -public interface TextEditorModel extends EModelElement { - /** - * Returns the value of the 'Edited Object' reference. - * - *

- * If the meaning of the 'Edited Object' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Edited Object' reference. - * @see #setEditedObject(EObject) - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel_EditedObject() - * @model - * @generated - */ - EObject getEditedObject(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getEditedObject Edited Object}' reference. - * - * - * @param value the new value of the 'Edited Object' reference. - * @see #getEditedObject() - * @generated - */ - void setEditedObject(EObject value); - - /** - * Returns the value of the 'Type' attribute. - * - *

- * If the meaning of the 'Type' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Type' attribute. - * @see #setType(String) - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel_Type() - * @model - * @generated - */ - String getType(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getType Type}' attribute. - * - * - * @param value the new value of the 'Type' attribute. - * @see #getType() - * @generated - */ - void setType(String value); - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Selected Object' reference. - * - *

- * If the meaning of the 'Selected Object' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Selected Object' reference. - * @see #setSelectedObject(EObject) - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel_SelectedObject() - * @model - * @generated - */ - EObject getSelectedObject(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getSelectedObject Selected Object}' reference. - * - * - * @param value the new value of the 'Selected Object' reference. - * @see #getSelectedObject() - * @generated - */ - void setSelectedObject(EObject value); - - /** - * Returns the value of the 'Line Number' attribute. - * - *

- * If the meaning of the 'Line Number' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Line Number' attribute. - * @see #setLineNumber(int) - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel_LineNumber() - * @model - * @generated - */ - int getLineNumber(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getLineNumber Line Number}' attribute. - * - * - * @param value the new value of the 'Line Number' attribute. - * @see #getLineNumber() - * @generated - */ - void setLineNumber(int value); - - /** - * Returns the value of the 'Generator ID' attribute. - * - *

- * If the meaning of the 'Generator ID' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Generator ID' attribute. - * @see #setGeneratorID(String) - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel_GeneratorID() - * @model - * @generated - */ - String getGeneratorID(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getGeneratorID Generator ID}' attribute. - * - * - * @param value the new value of the 'Generator ID' attribute. - * @see #getGeneratorID() - * @generated - */ - void setGeneratorID(String value); - -} // TextEditorModel diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelFactory.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelFactory.java deleted file mode 100644 index 705f79b8b40..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelFactory.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright (c) 2012 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation - * - */ -package org.eclipse.papyrus.texteditor.model.texteditormodel; - -import org.eclipse.emf.ecore.EFactory; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage - * @generated - */ -public interface TextEditorModelFactory extends EFactory { - /** - * The singleton instance of the factory. - * - * - * @generated - */ - TextEditorModelFactory eINSTANCE = org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelFactoryImpl.init(); - - /** - * Returns a new object of class 'Text Editor Model'. - * - * - * @return a new object of class 'Text Editor Model'. - * @generated - */ - TextEditorModel createTextEditorModel(); - - /** - * Returns the package supported by this factory. - * - * - * @return the package supported by this factory. - * @generated - */ - TextEditorModelPackage getTextEditorModelPackage(); - -} // TextEditorModelFactory diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelPackage.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelPackage.java deleted file mode 100644 index 25da2ea1bf8..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelPackage.java +++ /dev/null @@ -1,310 +0,0 @@ -/** - * Copyright (c) 2012 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation - * - */ -package org.eclipse.papyrus.texteditor.model.texteditormodel; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EcorePackage; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelFactory - * @model kind="package" - * @generated - */ -public interface TextEditorModelPackage extends EPackage { - /** - * The package name. - * - * - * @generated - */ - String eNAME = "texteditormodel"; - - /** - * The package namespace URI. - * - * - * @generated - */ - String eNS_URI = "http://www.eclipse.org/Papyrus/TextEditor/0.10.0/texteditormodel"; - - /** - * The package namespace name. - * - * - * @generated - */ - String eNS_PREFIX = "texteditormodel"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - TextEditorModelPackage eINSTANCE = org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelPackageImpl.init(); - - /** - * The meta object id for the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl Text Editor Model}' class. - * - * - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelPackageImpl#getTextEditorModel() - * @generated - */ - int TEXT_EDITOR_MODEL = 0; - - /** - * The feature id for the 'EAnnotations' containment reference list. - * - * - * @generated - * @ordered - */ - int TEXT_EDITOR_MODEL__EANNOTATIONS = EcorePackage.EMODEL_ELEMENT__EANNOTATIONS; - - /** - * The feature id for the 'Edited Object' reference. - * - * - * @generated - * @ordered - */ - int TEXT_EDITOR_MODEL__EDITED_OBJECT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Type' attribute. - * - * - * @generated - * @ordered - */ - int TEXT_EDITOR_MODEL__TYPE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int TEXT_EDITOR_MODEL__NAME = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Selected Object' reference. - * - * - * @generated - * @ordered - */ - int TEXT_EDITOR_MODEL__SELECTED_OBJECT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Line Number' attribute. - * - * - * @generated - * @ordered - */ - int TEXT_EDITOR_MODEL__LINE_NUMBER = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Generator ID' attribute. - * - * - * @generated - * @ordered - */ - int TEXT_EDITOR_MODEL__GENERATOR_ID = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 5; - - /** - * The number of structural features of the 'Text Editor Model' class. - * - * - * @generated - * @ordered - */ - int TEXT_EDITOR_MODEL_FEATURE_COUNT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 6; - - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel Text Editor Model}'. - * - * - * @return the meta object for class 'Text Editor Model'. - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel - * @generated - */ - EClass getTextEditorModel(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getEditedObject Edited Object}'. - * - * - * @return the meta object for the reference 'Edited Object'. - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getEditedObject() - * @see #getTextEditorModel() - * @generated - */ - EReference getTextEditorModel_EditedObject(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getType Type}'. - * - * - * @return the meta object for the attribute 'Type'. - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getType() - * @see #getTextEditorModel() - * @generated - */ - EAttribute getTextEditorModel_Type(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getName() - * @see #getTextEditorModel() - * @generated - */ - EAttribute getTextEditorModel_Name(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getSelectedObject Selected Object}'. - * - * - * @return the meta object for the reference 'Selected Object'. - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getSelectedObject() - * @see #getTextEditorModel() - * @generated - */ - EReference getTextEditorModel_SelectedObject(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getLineNumber Line Number}'. - * - * - * @return the meta object for the attribute 'Line Number'. - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getLineNumber() - * @see #getTextEditorModel() - * @generated - */ - EAttribute getTextEditorModel_LineNumber(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getGeneratorID Generator ID}'. - * - * - * @return the meta object for the attribute 'Generator ID'. - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getGeneratorID() - * @see #getTextEditorModel() - * @generated - */ - EAttribute getTextEditorModel_GeneratorID(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - TextEditorModelFactory getTextEditorModelFactory(); - - /** - * - * Defines literals for the meta objects that represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - interface Literals { - /** - * The meta object literal for the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl Text Editor Model}' class. - * - * - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelPackageImpl#getTextEditorModel() - * @generated - */ - EClass TEXT_EDITOR_MODEL = eINSTANCE.getTextEditorModel(); - - /** - * The meta object literal for the 'Edited Object' reference feature. - * - * - * @generated - */ - EReference TEXT_EDITOR_MODEL__EDITED_OBJECT = eINSTANCE.getTextEditorModel_EditedObject(); - - /** - * The meta object literal for the 'Type' attribute feature. - * - * - * @generated - */ - EAttribute TEXT_EDITOR_MODEL__TYPE = eINSTANCE.getTextEditorModel_Type(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - EAttribute TEXT_EDITOR_MODEL__NAME = eINSTANCE.getTextEditorModel_Name(); - - /** - * The meta object literal for the 'Selected Object' reference feature. - * - * - * @generated - */ - EReference TEXT_EDITOR_MODEL__SELECTED_OBJECT = eINSTANCE.getTextEditorModel_SelectedObject(); - - /** - * The meta object literal for the 'Line Number' attribute feature. - * - * - * @generated - */ - EAttribute TEXT_EDITOR_MODEL__LINE_NUMBER = eINSTANCE.getTextEditorModel_LineNumber(); - - /** - * The meta object literal for the 'Generator ID' attribute feature. - * - * - * @generated - */ - EAttribute TEXT_EDITOR_MODEL__GENERATOR_ID = eINSTANCE.getTextEditorModel_GeneratorID(); - - } - -} // TextEditorModelPackage diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelFactoryImpl.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelFactoryImpl.java deleted file mode 100644 index 997f6ff4c0b..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelFactoryImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Copyright (c) 2012 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation - * - */ -package org.eclipse.papyrus.texteditor.model.texteditormodel.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.impl.EFactoryImpl; -import org.eclipse.emf.ecore.plugin.EcorePlugin; -import org.eclipse.papyrus.texteditor.model.texteditormodel.*; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelFactory; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class TextEditorModelFactoryImpl extends EFactoryImpl implements TextEditorModelFactory { - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static TextEditorModelFactory init() { - try { - TextEditorModelFactory theTextEditorModelFactory = (TextEditorModelFactory)EPackage.Registry.INSTANCE.getEFactory(TextEditorModelPackage.eNS_URI); - if (theTextEditorModelFactory != null) { - return theTextEditorModelFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new TextEditorModelFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public TextEditorModelFactoryImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case TextEditorModelPackage.TEXT_EDITOR_MODEL: return createTextEditorModel(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public TextEditorModel createTextEditorModel() { - TextEditorModelImpl textEditorModel = new TextEditorModelImpl(); - return textEditorModel; - } - - /** - * - * - * @generated - */ - @Override - public TextEditorModelPackage getTextEditorModelPackage() { - return (TextEditorModelPackage)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static TextEditorModelPackage getPackage() { - return TextEditorModelPackage.eINSTANCE; - } - -} // TextEditorModelFactoryImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelImpl.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelImpl.java deleted file mode 100644 index c11dafff246..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelImpl.java +++ /dev/null @@ -1,464 +0,0 @@ -/** - * Copyright (c) 2012 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation - * - */ -package org.eclipse.papyrus.texteditor.model.texteditormodel.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.EModelElementImpl; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage; - -/** - * - * An implementation of the model object 'Text Editor Model'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl#getEditedObject Edited Object}
  • - *
  • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl#getType Type}
  • - *
  • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl#getName Name}
  • - *
  • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl#getSelectedObject Selected Object}
  • - *
  • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl#getLineNumber Line Number}
  • - *
  • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl#getGeneratorID Generator ID}
  • - *
- * - * @generated - */ -public class TextEditorModelImpl extends EModelElementImpl implements TextEditorModel { - /** - * The cached value of the '{@link #getEditedObject() Edited Object}' reference. - * - * - * @see #getEditedObject() - * @generated - * @ordered - */ - protected EObject editedObject; - - /** - * The default value of the '{@link #getType() Type}' attribute. - * - * - * @see #getType() - * @generated - * @ordered - */ - protected static final String TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getType() Type}' attribute. - * - * - * @see #getType() - * @generated - * @ordered - */ - protected String type = TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getSelectedObject() Selected Object}' reference. - * - * - * @see #getSelectedObject() - * @generated - * @ordered - */ - protected EObject selectedObject; - - /** - * The default value of the '{@link #getLineNumber() Line Number}' attribute. - * - * - * @see #getLineNumber() - * @generated - * @ordered - */ - protected static final int LINE_NUMBER_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getLineNumber() Line Number}' attribute. - * - * - * @see #getLineNumber() - * @generated - * @ordered - */ - protected int lineNumber = LINE_NUMBER_EDEFAULT; - - /** - * The default value of the '{@link #getGeneratorID() Generator ID}' attribute. - * - * - * @see #getGeneratorID() - * @generated - * @ordered - */ - protected static final String GENERATOR_ID_EDEFAULT = null; - - /** - * The cached value of the '{@link #getGeneratorID() Generator ID}' attribute. - * - * - * @see #getGeneratorID() - * @generated - * @ordered - */ - protected String generatorID = GENERATOR_ID_EDEFAULT; - - /** - * - * - * @generated - */ - protected TextEditorModelImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return TextEditorModelPackage.Literals.TEXT_EDITOR_MODEL; - } - - /** - * - * - * @generated - */ - @Override - public EObject getEditedObject() { - if (editedObject != null && editedObject.eIsProxy()) { - InternalEObject oldEditedObject = (InternalEObject)editedObject; - editedObject = eResolveProxy(oldEditedObject); - if (editedObject != oldEditedObject) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, TextEditorModelPackage.TEXT_EDITOR_MODEL__EDITED_OBJECT, oldEditedObject, editedObject)); - } - } - return editedObject; - } - - /** - * - * - * @generated - */ - public EObject basicGetEditedObject() { - return editedObject; - } - - /** - * - * - * @generated - */ - @Override - public void setEditedObject(EObject newEditedObject) { - EObject oldEditedObject = editedObject; - editedObject = newEditedObject; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, TextEditorModelPackage.TEXT_EDITOR_MODEL__EDITED_OBJECT, oldEditedObject, editedObject)); - } - - /** - * - * - * @generated - */ - @Override - public String getType() { - return type; - } - - /** - * - * - * @generated - */ - @Override - public void setType(String newType) { - String oldType = type; - type = newType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, TextEditorModelPackage.TEXT_EDITOR_MODEL__TYPE, oldType, type)); - } - - /** - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - @Override - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, TextEditorModelPackage.TEXT_EDITOR_MODEL__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - @Override - public EObject getSelectedObject() { - if (selectedObject != null && selectedObject.eIsProxy()) { - InternalEObject oldSelectedObject = (InternalEObject)selectedObject; - selectedObject = eResolveProxy(oldSelectedObject); - if (selectedObject != oldSelectedObject) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, TextEditorModelPackage.TEXT_EDITOR_MODEL__SELECTED_OBJECT, oldSelectedObject, selectedObject)); - } - } - return selectedObject; - } - - /** - * - * - * @generated - */ - public EObject basicGetSelectedObject() { - return selectedObject; - } - - /** - * - * - * @generated - */ - @Override - public void setSelectedObject(EObject newSelectedObject) { - EObject oldSelectedObject = selectedObject; - selectedObject = newSelectedObject; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, TextEditorModelPackage.TEXT_EDITOR_MODEL__SELECTED_OBJECT, oldSelectedObject, selectedObject)); - } - - /** - * - * - * @generated - */ - @Override - public int getLineNumber() { - return lineNumber; - } - - /** - * - * - * @generated - */ - @Override - public void setLineNumber(int newLineNumber) { - int oldLineNumber = lineNumber; - lineNumber = newLineNumber; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, TextEditorModelPackage.TEXT_EDITOR_MODEL__LINE_NUMBER, oldLineNumber, lineNumber)); - } - - /** - * - * - * @generated - */ - public String getGeneratorID() { - return generatorID; - } - - /** - * - * - * @generated - */ - public void setGeneratorID(String newGeneratorID) { - String oldGeneratorID = generatorID; - generatorID = newGeneratorID; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, TextEditorModelPackage.TEXT_EDITOR_MODEL__GENERATOR_ID, oldGeneratorID, generatorID)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case TextEditorModelPackage.TEXT_EDITOR_MODEL__EDITED_OBJECT: - if (resolve) return getEditedObject(); - return basicGetEditedObject(); - case TextEditorModelPackage.TEXT_EDITOR_MODEL__TYPE: - return getType(); - case TextEditorModelPackage.TEXT_EDITOR_MODEL__NAME: - return getName(); - case TextEditorModelPackage.TEXT_EDITOR_MODEL__SELECTED_OBJECT: - if (resolve) return getSelectedObject(); - return basicGetSelectedObject(); - case TextEditorModelPackage.TEXT_EDITOR_MODEL__LINE_NUMBER: - return getLineNumber(); - case TextEditorModelPackage.TEXT_EDITOR_MODEL__GENERATOR_ID: - return getGeneratorID(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case TextEditorModelPackage.TEXT_EDITOR_MODEL__EDITED_OBJECT: - setEditedObject((EObject)newValue); - return; - case TextEditorModelPackage.TEXT_EDITOR_MODEL__TYPE: - setType((String)newValue); - return; - case TextEditorModelPackage.TEXT_EDITOR_MODEL__NAME: - setName((String)newValue); - return; - case TextEditorModelPackage.TEXT_EDITOR_MODEL__SELECTED_OBJECT: - setSelectedObject((EObject)newValue); - return; - case TextEditorModelPackage.TEXT_EDITOR_MODEL__LINE_NUMBER: - setLineNumber((Integer)newValue); - return; - case TextEditorModelPackage.TEXT_EDITOR_MODEL__GENERATOR_ID: - setGeneratorID((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case TextEditorModelPackage.TEXT_EDITOR_MODEL__EDITED_OBJECT: - setEditedObject((EObject)null); - return; - case TextEditorModelPackage.TEXT_EDITOR_MODEL__TYPE: - setType(TYPE_EDEFAULT); - return; - case TextEditorModelPackage.TEXT_EDITOR_MODEL__NAME: - setName(NAME_EDEFAULT); - return; - case TextEditorModelPackage.TEXT_EDITOR_MODEL__SELECTED_OBJECT: - setSelectedObject((EObject)null); - return; - case TextEditorModelPackage.TEXT_EDITOR_MODEL__LINE_NUMBER: - setLineNumber(LINE_NUMBER_EDEFAULT); - return; - case TextEditorModelPackage.TEXT_EDITOR_MODEL__GENERATOR_ID: - setGeneratorID(GENERATOR_ID_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case TextEditorModelPackage.TEXT_EDITOR_MODEL__EDITED_OBJECT: - return editedObject != null; - case TextEditorModelPackage.TEXT_EDITOR_MODEL__TYPE: - return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); - case TextEditorModelPackage.TEXT_EDITOR_MODEL__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case TextEditorModelPackage.TEXT_EDITOR_MODEL__SELECTED_OBJECT: - return selectedObject != null; - case TextEditorModelPackage.TEXT_EDITOR_MODEL__LINE_NUMBER: - return lineNumber != LINE_NUMBER_EDEFAULT; - case TextEditorModelPackage.TEXT_EDITOR_MODEL__GENERATOR_ID: - return GENERATOR_ID_EDEFAULT == null ? generatorID != null : !GENERATOR_ID_EDEFAULT.equals(generatorID); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (type: "); - result.append(type); - result.append(", name: "); - result.append(name); - result.append(", lineNumber: "); - result.append(lineNumber); - result.append(", generatorID: "); - result.append(generatorID); - result.append(')'); - return result.toString(); - } - -} // TextEditorModelImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelPackageImpl.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelPackageImpl.java deleted file mode 100644 index 8e10c9e3320..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelPackageImpl.java +++ /dev/null @@ -1,255 +0,0 @@ -/** - * Copyright (c) 2012 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation - * - */ -package org.eclipse.papyrus.texteditor.model.texteditormodel.impl; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelFactory; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage; - -/** - * - * An implementation of the model Package. - * - * @generated - */ -public class TextEditorModelPackageImpl extends EPackageImpl implements TextEditorModelPackage { - /** - * - * - * @generated - */ - private EClass textEditorModelEClass = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#eNS_URI - * @see #init() - * @generated - */ - private TextEditorModelPackageImpl() { - super(eNS_URI, TextEditorModelFactory.eINSTANCE); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * - *

- * This method is used to initialize {@link TextEditorModelPackage#eINSTANCE} when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static TextEditorModelPackage init() { - if (isInited) return (TextEditorModelPackage)EPackage.Registry.INSTANCE.getEPackage(TextEditorModelPackage.eNS_URI); - - // Obtain or create and register package - TextEditorModelPackageImpl theTextEditorModelPackage = (TextEditorModelPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof TextEditorModelPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new TextEditorModelPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - EcorePackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theTextEditorModelPackage.createPackageContents(); - - // Initialize created meta-data - theTextEditorModelPackage.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theTextEditorModelPackage.freeze(); - - - // Update the registry and return the package - EPackage.Registry.INSTANCE.put(TextEditorModelPackage.eNS_URI, theTextEditorModelPackage); - return theTextEditorModelPackage; - } - - /** - * - * - * @generated - */ - @Override - public EClass getTextEditorModel() { - return textEditorModelEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getTextEditorModel_EditedObject() { - return (EReference)textEditorModelEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getTextEditorModel_Type() { - return (EAttribute)textEditorModelEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getTextEditorModel_Name() { - return (EAttribute)textEditorModelEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EReference getTextEditorModel_SelectedObject() { - return (EReference)textEditorModelEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getTextEditorModel_LineNumber() { - return (EAttribute)textEditorModelEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - public EAttribute getTextEditorModel_GeneratorID() { - return (EAttribute)textEditorModelEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * @generated - */ - @Override - public TextEditorModelFactory getTextEditorModelFactory() { - return (TextEditorModelFactory)getEFactoryInstance(); - } - - /** - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void createPackageContents() { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - textEditorModelEClass = createEClass(TEXT_EDITOR_MODEL); - createEReference(textEditorModelEClass, TEXT_EDITOR_MODEL__EDITED_OBJECT); - createEAttribute(textEditorModelEClass, TEXT_EDITOR_MODEL__TYPE); - createEAttribute(textEditorModelEClass, TEXT_EDITOR_MODEL__NAME); - createEReference(textEditorModelEClass, TEXT_EDITOR_MODEL__SELECTED_OBJECT); - createEAttribute(textEditorModelEClass, TEXT_EDITOR_MODEL__LINE_NUMBER); - createEAttribute(textEditorModelEClass, TEXT_EDITOR_MODEL__GENERATOR_ID); - } - - /** - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); - - // Create type parameters - - // Set bounds for type parameters - - // Add supertypes to classes - textEditorModelEClass.getESuperTypes().add(theEcorePackage.getEModelElement()); - - // Initialize classes and features; add operations and parameters - initEClass(textEditorModelEClass, TextEditorModel.class, "TextEditorModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getTextEditorModel_EditedObject(), theEcorePackage.getEObject(), null, "editedObject", null, 0, 1, TextEditorModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTextEditorModel_Type(), ecorePackage.getEString(), "type", null, 0, 1, TextEditorModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTextEditorModel_Name(), ecorePackage.getEString(), "name", null, 0, 1, TextEditorModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getTextEditorModel_SelectedObject(), theEcorePackage.getEObject(), null, "selectedObject", null, 0, 1, TextEditorModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTextEditorModel_LineNumber(), ecorePackage.getEInt(), "lineNumber", null, 0, 1, TextEditorModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getTextEditorModel_GeneratorID(), ecorePackage.getEString(), "generatorID", null, 0, 1, TextEditorModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Create resource - createResource(eNS_URI); - } - -} // TextEditorModelPackageImpl diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelAdapterFactory.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelAdapterFactory.java deleted file mode 100644 index 073c23deb57..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelAdapterFactory.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * Copyright (c) 2012 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation - * - */ -package org.eclipse.papyrus.texteditor.model.texteditormodel.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EModelElement; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.texteditor.model.texteditormodel.*; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage - * @generated - */ -public class TextEditorModelAdapterFactory extends AdapterFactoryImpl { - /** - * The cached model package. - * - * - * @generated - */ - protected static TextEditorModelPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public TextEditorModelAdapterFactory() { - if (modelPackage == null) { - modelPackage = TextEditorModelPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject)object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch that delegates to the createXXX methods. - * - * - * @generated - */ - protected TextEditorModelSwitch modelSwitch = - new TextEditorModelSwitch() { - @Override - public Adapter caseTextEditorModel(TextEditorModel object) { - return createTextEditorModelAdapter(); - } - @Override - public Adapter caseEModelElement(EModelElement object) { - return createEModelElementAdapter(); - } - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * @param target the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject)target); - } - - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel Text Editor Model}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel - * @generated - */ - public Adapter createTextEditorModelAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecore.EModelElement EModel Element}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.emf.ecore.EModelElement - * @generated - */ - public Adapter createEModelElementAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } - -} // TextEditorModelAdapterFactory diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelSwitch.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelSwitch.java deleted file mode 100644 index 2e8d35c8cea..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelSwitch.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * Copyright (c) 2012 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation - * - */ -package org.eclipse.papyrus.texteditor.model.texteditormodel.util; - -import org.eclipse.emf.ecore.EModelElement; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.util.Switch; -import org.eclipse.papyrus.texteditor.model.texteditormodel.*; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage - * @generated - */ -public class TextEditorModelSwitch extends Switch { - /** - * The cached model package - * - * - * @generated - */ - protected static TextEditorModelPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public TextEditorModelSwitch() { - if (modelPackage == null) { - modelPackage = TextEditorModelPackage.eINSTANCE; - } - } - - /** - * Checks whether this is a switch for the given package. - * - * - * @param ePackage the package in question. - * @return whether this is a switch for the given package. - * @generated - */ - @Override - protected boolean isSwitchFor(EPackage ePackage) { - return ePackage == modelPackage; - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - @Override - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case TextEditorModelPackage.TEXT_EDITOR_MODEL: { - TextEditorModel textEditorModel = (TextEditorModel)theEObject; - T result = caseTextEditorModel(textEditorModel); - if (result == null) result = caseEModelElement(textEditorModel); - if (result == null) result = defaultCase(theEObject); - return result; - } - default: return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'Text Editor Model'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Text Editor Model'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseTextEditorModel(TextEditorModel object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'EModel Element'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'EModel Element'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseEModelElement(EModelElement object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - @Override - public T defaultCase(EObject object) { - return null; - } - -} // TextEditorModelSwitch diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.classpath b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.project b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.project deleted file mode 100644 index 81eff2e0ed5..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.texteditor.modelexplorer - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/META-INF/MANIFEST.MF deleted file mode 100644 index f3e062e8080..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/META-INF/MANIFEST.MF +++ /dev/null @@ -1,25 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.texteditor.modelexplorer, - org.eclipse.papyrus.texteditor.modelexplorer.queries -Bundle-ActivationPolicy: lazy -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.papyrus.views.modelexplorer;bundle-version="1.2.0", - com.google.guava;bundle-version="11.0.0", - org.eclipse.papyrus.texteditor.model;bundle-version="1.2.0", - org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", - org.eclipse.papyrus.emf.facet.query.java.core;bundle-version="1.2.0", - org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.2.0", - org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.sasheditor.di;bundle-version="1.2.0" -Bundle-Vendor: %pluginProvider -Bundle-Version: 1.2.0.qualifier -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.texteditor.modelexplorer.Activator -Bundle-SymbolicName: org.eclipse.papyrus.texteditor.modelexplorer;singleton:=true -Import-Package: org.eclipse.papyrus.infra.core.editorsfactory, - org.eclipse.papyrus.infra.viewpoints.policy diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/about.html b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/build.properties b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/build.properties deleted file mode 100644 index a42c291785a..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - resources/,\ - about.html,\ - plugin.xml,\ - plugin.properties -src.includes = resources/ diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.properties deleted file mode 100644 index e3cf0949e64..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.properties +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2012 CEA LIST. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation -# (with the help of examining table support from Vincent Lorenzo) -# -pluginProvider = Eclipse Modeling Project -pluginName = Text Editor Customization For Model Explorer (Incubation) \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.xml deleted file mode 100644 index d9537fda209..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/pom.xml deleted file mode 100644 index 6d97872ed73..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.texteditor.modelexplorer - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/resources/TextEditorFacet.custom b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/resources/TextEditorFacet.custom deleted file mode 100644 index 8566b496c67..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/resources/TextEditorFacet.custom +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/Activator.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/Activator.java deleted file mode 100644 index d37acadb2ff..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation - * (with the help of examining table support from Vincent Lorenzo) - * - *****************************************************************************/ - -package org.eclipse.papyrus.texteditor.modelexplorer; - -import org.eclipse.papyrus.infra.core.log.LogHelper; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.texteditor.modelexplorer"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - public static LogHelper log; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - log = new LogHelper(this); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/adapters/TextEditorAdapterFactory.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/adapters/TextEditorAdapterFactory.java deleted file mode 100644 index b3b416be9c9..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/adapters/TextEditorAdapterFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - ansgar.radermacher@cea.fr - Initial API and implementation - * (derived from DiagramAdapterFactory) - * - *****************************************************************************/ -package org.eclipse.papyrus.texteditor.modelexplorer.adapters; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IOpenable; -import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IOpenableWithContainer; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; - -@SuppressWarnings("rawtypes") -public class TextEditorAdapterFactory implements IAdapterFactory { - - @Override - public Object getAdapter(Object adaptableObject, Class adapterType) { - if (adapterType == IOpenable.class) { - if (adaptableObject instanceof TextEditorModel) { - TextEditorModel textEditorModel = (TextEditorModel) adaptableObject; - return new IOpenableWithContainer.Openable(adaptableObject, textEditorModel.getEditedObject()); - } - } - return null; - } - - @Override - public Class[] getAdapterList() { - return new Class[] { IOpenable.class }; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetContainedTextEditors.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetContainedTextEditors.java deleted file mode 100644 index eae3a2f2554..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetContainedTextEditors.java +++ /dev/null @@ -1,58 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation - * (with the help of examining table support from Vincent Lorenzo) - * - *****************************************************************************/ - -package org.eclipse.papyrus.texteditor.modelexplorer.queries; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager; -import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException; -import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2; -import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; -import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils; -import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery; - -/** Get the collection of all contained text editors */ -public class GetContainedTextEditors extends AbstractEditorContainerQuery implements IJavaQuery2> { - - /** - * {@inheritDoc} - */ - @Override - public Collection evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager manager) throws DerivedTypedElementException { - - List result = new ArrayList(); - Iterator roots = NavigatorUtils.getNotationRoots(source); - if (roots == null) { - return result; - } - - while (roots.hasNext()) { - EObject root = roots.next(); - if (root instanceof TextEditorModel) { - TextEditorModel textEditorModel = (TextEditorModel) root; - if (textEditorModel.getEditedObject() == source) { - result.add(textEditorModel); - } - } - } - return result; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorIcon.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorIcon.java deleted file mode 100644 index 7fb77ffdcbd..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorIcon.java +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation - * (with the help of examining table support from Vincent Lorenzo) - * - *****************************************************************************/ -package org.eclipse.papyrus.texteditor.modelexplorer.queries; - -import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage; -import org.eclipse.papyrus.emf.facet.custom.ui.ImageUtils; -import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager; -import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2; -import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; -import org.eclipse.papyrus.views.modelexplorer.queries.AbstractGetEditorIconQuery; - -/** Return the path to the icon of the corresponding table */ -public class GetTextEditorIcon extends AbstractGetEditorIconQuery implements IJavaQuery2 { - - /** - * {@inheritDoc} - */ - @Override - public IImage evaluate(TextEditorModel textInstance, IParameterValueList2 parameterValues, IFacetManager manager) { - IImage image = ImageUtils.wrap("platform:/plugin/" + getEditorRegistry(textInstance).getEditorURLIcon(textInstance)); //$NON-NLS-1$ - return image; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorName.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorName.java deleted file mode 100644 index d7d4e826ef6..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorName.java +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation - * (with the help of examining table support from Vincent Lorenzo) - * - *****************************************************************************/ - -package org.eclipse.papyrus.texteditor.modelexplorer.queries; - -import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager; -import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException; -import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2; -import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; - -/** Return the name for the table */ -public class GetTextEditorName implements IJavaQuery2 { - - /** - * {@inheritDoc} - */ - @Override - public String evaluate(TextEditorModel context, IParameterValueList2 parameterValues, IFacetManager manager) - throws DerivedTypedElementException { - return context.getName(); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/IsTextEditorContainer.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/IsTextEditorContainer.java deleted file mode 100644 index f6d3c9d35f4..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/IsTextEditorContainer.java +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation - * (with the help of examining table support from Vincent Lorenzo) - * - *****************************************************************************/ -package org.eclipse.papyrus.texteditor.modelexplorer.queries; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager; -import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException; -import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2; -import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; -import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery; - -/** Returns true if the element contains a Table */ -public class IsTextEditorContainer extends AbstractEditorContainerQuery implements IJavaQuery2 { - - /** - * {@inheritDoc} - */ - @Override - public Boolean evaluate(EObject context, IParameterValueList2 parameterValues, IFacetManager manager) - throws DerivedTypedElementException { - return false; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java deleted file mode 100644 index 609afc7abd2..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java +++ /dev/null @@ -1,30 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - /*****************************************************************************/ -package org.eclipse.papyrus.texteditor.modelexplorer.queries; - -import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager; -import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException; -import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2; -import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; -import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; - -public class NotVisibleStructuralFeatureQuery implements IJavaQuery2 { - public Boolean evaluate(final TextEditorModel context, - final IParameterValueList2 parameterValues, - final IFacetManager facetManager) - throws DerivedTypedElementException { - // All sub-elements are invisible. EditedObject may eventually be useful, but text editor - // is already shown as a child of edited object within the model explorer - return false; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/.classpath b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/.project b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/.project deleted file mode 100644 index c547cbe1809..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.views.cpp - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/.settings/org.eclipse.jdt.core.prefs b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index c537b63063c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/META-INF/MANIFEST.MF b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/META-INF/MANIFEST.MF deleted file mode 100644 index 786a003cbc7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,33 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.uml2.uml, - org.eclipse.emf.ecore.edit, - org.eclipse.gmf.runtime.notation;bundle-version="1.4.0", - org.eclipse.gef;bundle-version="3.6.0", - org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", - org.eclipse.ui.editors;bundle-version="3.6.1", - org.eclipse.papyrus.infra.core;bundle-version="1.2.0", - org.eclipse.jface.text;bundle-version="3.8.0", - org.eclipse.emf.transaction;bundle-version="1.4.0", - org.eclipse.gmf.runtime.common.core;bundle-version="1.4.1", - org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0", - org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", - org.eclipse.papyrus.infra.emf;bundle-version="1.2.0" -Export-Package: org.eclipse.papyrus.views.cpp; uses:="org.eclipse.ui, - com.cea.papyrus.views.panels, - org.eclipse.jface.viewers, - org.eclipse.ui.part, - org.eclipse.uml2.uml, - org.eclipse.swt.widgets" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.views.cpp.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.views.cpp;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/about.html b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/about.ini b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/about.ini deleted file mode 100644 index 9b4b2c53944..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/about.ini +++ /dev/null @@ -1,17 +0,0 @@ -# about.ini - -# feature image (for about info...) -featureImage = resources/icons/Papyrus_32x32.gif - -#about text -aboutText =\ -Papyrus Cpp Code generation\n\ -\n\ -Version: 1.6.2\n\ -\n\ -(c) Copyright CEA 2006, 2007. All rights reserved.\n\ -\n\ -This program and the accompanying materials are made available under\n\ -the terms of the Eclipse Public License v1.0 which accompanies this\n\ -distribution, and is available at http://www.eclipse.org/legal/epl-v10.html\n\ -\ \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/build.properties b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/build.properties deleted file mode 100644 index b961dfd1fd2..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties,\ - plugin.xml,\ - resources/,\ - about.ini,\ - about.html -src.includes = about.html diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/plugin.properties b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/plugin.properties deleted file mode 100644 index 7ced719d446..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Simple Papyrus C++ view (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/plugin.xml b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/plugin.xml deleted file mode 100644 index 90b2f91a207..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/plugin.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/pom.xml b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/pom.xml deleted file mode 100644 index 6c729396c72..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.views.cpp - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/Papyrus_32x32.gif b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/Papyrus_32x32.gif deleted file mode 100644 index a57b9d92dee..00000000000 Binary files a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/Papyrus_32x32.gif and /dev/null differ diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/save_edit.gif b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/save_edit.gif deleted file mode 100644 index 499dd0ca602..00000000000 Binary files a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/save_edit.gif and /dev/null differ diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp.gif b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp.gif deleted file mode 100644 index 7caaa0fdae8..00000000000 Binary files a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp.gif and /dev/null differ diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp_old.gif b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp_old.gif deleted file mode 100644 index 4b39411daf5..00000000000 Binary files a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp_old.gif and /dev/null differ diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/undo_edit.gif b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/undo_edit.gif deleted file mode 100644 index eae118ad168..00000000000 Binary files a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/resources/icons/undo_edit.gif and /dev/null differ diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/AbstractCppPanelView.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/AbstractCppPanelView.java deleted file mode 100644 index d04e1955e35..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/AbstractCppPanelView.java +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2010 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.cpp; - -import org.eclipse.papyrus.views.panels.CppAbstractPanel; -import org.eclipse.papyrus.views.panels.PanelFactory; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.part.ViewPart; -import org.eclipse.uml2.uml.Element; - - -/** - * This class extends ViewPart. This class draws the Accord/Cpp - * panel in the Modeling Perspective. It also implements ISelectionListener in order to know which element is selected - * in the workbench. In fact, the content of the view changes depending on the - * type of the element selected - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public abstract class AbstractCppPanelView extends ViewPart implements ISelectionListener { - - /** parent composite of the panels contained by this view */ - protected Composite parent; - - /** stores the current target */ - protected Object currentTarget; - - /** keeps the reference to the panel (abstract class) */ - protected CppAbstractPanel panel; - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) - */ - @Override - public void createPartControl(Composite parent) { - getViewSite().getPage().addSelectionListener(this); - this.parent = parent; - panel = createPanel(parent, 0, null); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.part.WorkbenchPart#setFocus() - */ - @Override - public void setFocus() { - // delegate focus to the panel - panel.setFocus(); - } - - /** - * Changes the panel displayed in the view, depending on the type of the - * newly selected element. - */ - protected void switchUI() { - /* - * test to check if the panel is not disposed. Closing the panel - * view and open it again creates a second instance of panel, one of - * it is disposed, the new one is active - */ - if (!panel.isDisposed()) { - panel.exitAction(); - panel.dispose(); - - if (currentTarget != null && currentTarget instanceof Element) { - // creates the new panel given the current target - panel = createPanel(parent, 0, (Element) currentTarget); - } else { - panel = createPanel(parent, 0, null); - } - - panel.setBounds(panel.getParent().getBounds()); - panel.entryAction(); - } - } - - - /** - * Creates the new panel, when switching UI. - *

- * This class should be overloaded when working with RSA or other tools, using a new PanelFactory - * - * @param parent - * the parent of the new panel - * @param style - * the SWT style of this panel - * @param element - * the element for which the panel is created - * @return the newly created panel - */ - protected CppAbstractPanel createPanel(Composite parent, int style, Element element) { - return PanelFactory.eINSTANCE.createPanel(parent, 0, currentTarget); - } -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.java deleted file mode 100644 index 589debbdf42..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.java +++ /dev/null @@ -1,160 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2010 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ -package org.eclipse.papyrus.views.cpp; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.views.cpp"; - - // The shared instance - private static Activator plugin; - - // Resource bundle. - public static final Font VIEW_FONT = new Font(null, "Bitstream Vera Sans Mono", 10, SWT.NORMAL); - - private static final String RESOURCE_NAME = PLUGIN_ID + ".Activator"; - - public static final String ICONS_PATH = "resources/icons/"; - - public static final String DEFAULT_IMAGE = ICONS_PATH + "default.gif"; - - public static final String SAVE_IMAGE = ICONS_PATH + "save_edit.gif"; - - public static final String UNDO_IMAGE = ICONS_PATH + "undo_edit.gif"; - - public static final String WARNING_IMAGE = ICONS_PATH + "warning.gif"; - - private ResourceBundle resourceBundle; - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - /** - * The constructor - */ - public Activator() { - plugin = this; - try { - resourceBundle = ResourceBundle.getBundle(RESOURCE_NAME); - } catch (MissingResourceException mre) { - // Log.exception(mre); - resourceBundle = null; - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the string from the plugin's resource bundle, or 'key' if not - * found. - */ - public static String getResourceString(String key) { - ResourceBundle bundle = getDefault().getResourceBundle(); - try { - return (bundle != null) ? bundle.getString(key) : key; - } catch (MissingResourceException e) { - return key; - } - } - - /** - * Returns the plugin's resource bundle, - */ - public ResourceBundle getResourceBundle() { - return resourceBundle; - } - - /** - * Returns an org.eclipse.swt.graphics.Image identified by - * its key.
- * By default, it returns a default image. This image is the image placed in - * the directory resources/icons/default.gif - * - * @param key - * the key of the image - * @return the Image - */ - public static Image getImage(String key) { - ImageRegistry registry = getDefault().getImageRegistry(); - Image image = registry.get(key); - if (image == null) { - ImageDescriptor desc = AbstractUIPlugin - .imageDescriptorFromPlugin(PLUGIN_ID, key); - registry.put(key, desc); - image = registry.get(key); - } - if (image == null && !key.equals(DEFAULT_IMAGE)) { - image = getImage(DEFAULT_IMAGE); - } - - return image; - } - - /** - * Log the given exception into the plugin log. - * - * @param e - * the exception to log - */ - public static void log(Exception e) { - getDefault().getLog().log(new Status( - IStatus.ERROR, - PLUGIN_ID, - IStatus.OK, - "exception caught: " + e.getMessage(), - e)); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.properties b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.properties deleted file mode 100644 index 79979449eba..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.properties +++ /dev/null @@ -1,96 +0,0 @@ -# Defaut Panel -panel.default.text=Please select a UML item on diagram or in the Model explorer - -# Operation Panel -panel.operation.button.save=Save -panel.operation.button.save.tooltip=Save Cpp operation body into its method Activity -panel.operation.button.cancel=Cancel -panel.operation.button.cancel.tooltip=Ignore modifications made since last save action -panel.operation.dialog.saveorignore.title=Warning : modifications not saved -panel.operation.dialog.saveorignore.body=Do you want to save modifications for the body of this method ? -panel.operation.dialog.saveorignore.button.save=Save -panel.operation.dialog.saveorignore.button.ignore=Ignore - -# Class Panel -panel.class.button.save=Save -panel.class.button.save.tooltip=Save Cpp include associated to this class - -panel.class.button.cancel=Cancel -panel.class.button.cancel.tooltip=Ignore modifications made since last save action - -panel.class.dialog.saveorignore.title=Warning : modifications not saved -panel.class.dialog.saveorignore=Do you want to save modifications for the include declared in this class ? -panel.class.dialog.saveorignore.button.save=Save -panel.class.dialog.saveorignore.button.ignore=Ignore - -# Package Panel -panel.package.button.save=Save -panel.package.button.save.tooltip=Save Cpp include associated to this package - -panel.package.button.cancel=Cancel -panel.package.button.cancel.tooltip=Ignore modifications made since last save action - -panel.package.dialog.saveorignore.title=Warning : modifications not saved -panel.package.dialog.saveorignore=Do you want to save modifications for the include declared in this package ? -panel.package.dialog.saveorignore.button.save=Save -panel.package.dialog.saveorignore.button.ignore=Ignore - -# PrimitiveType Panel -panel.type.button.save=Save -panel.type.button.save.tooltip=Save Cpp type definition associated to this primitive type - -panel.type.button.cancel=Cancel -panel.type.button.cancel.tooltip=Ignore modifications made since last save action - -panel.type.dialog.saveorignore.title=Warning : modifications not saved -panel.type.dialog.saveorignore=Do you want to save modifications for the type defined here ? -panel.type.dialog.saveorignore.button.save=Save -panel.type.dialog.saveorignore.button.ignore=Ignore - -# Property Panel -panel.property.button.save=Save -panel.property.button.save.tooltip=Save Cpp Property informations - -panel.property.button.cancel=Cancel -panel.property.button.cancel.tooltip=Ignore modifications made since last save action - -panel.property.dialog.saveorignore.title=Warning : modifications not saved -panel.property.dialog.saveorignore=Do you want to save modifications for the Property defined here ? -panel.property.dialog.saveorignore.button.save=Save -panel.property.dialog.saveorignore.button.ignore=Ignore - -# Parameter Panel -panel.parameter.button.save=Save -panel.parameter.button.save.tooltip=Save Cpp Parameter informations - -panel.parameter.button.cancel=Cancel -panel.parameter.button.cancel.tooltip=Ignore modifications made since last save action - -panel.parameter.dialog.saveorignore.title=Warning : modifications not saved -panel.parameter.dialog.saveorignore=Do you want to save modifications for the Parameter defined here ? -panel.parameter.dialog.saveorignore.button.save=Save -panel.parameter.dialog.saveorignore.button.ignore=Ignore - -# TemplateBinding Panel -panel.templatebinding.button.save=Save -panel.templatebinding.button.save.tooltip=Save Cpp TemplateBinding informations - -panel.templatebinding.button.cancel=Cancel -panel.templatebinding.button.cancel.tooltip=Ignore modifications made since last save action - -panel.templatebinding.dialog.saveorignore.title=Warning : modifications not saved -panel.templatebinding.dialog.saveorignore=Do you want to save modifications for the TemplateBinding defined here ? -panel.templatebinding.dialog.saveorignore.button.save=Save -panel.templatebinding.dialog.saveorignore.button.ignore=Ignore - -# TemplateParameter Panel -panel.templateparameter.button.save=Save -panel.templateparameter.button.save.tooltip=Save Cpp TemplateParameter informations - -panel.templateparameter.button.cancel=Cancel -panel.templateparameter.button.cancel.tooltip=Ignore modifications made since last save action - -panel.templateparameter.dialog.saveorignore.title=Warning : modifications not saved -panel.templateparameter.dialog.saveorignore=Do you want to save modifications for the TemplateParameter defined here ? -panel.templateparameter.dialog.saveorignore.button.save=Save -panel.templateparameter.dialog.saveorignore.button.ignore=Ignore diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CommandSupport.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CommandSupport.java deleted file mode 100644 index ab69b52fd0d..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CommandSupport.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2010 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.cpp; - -import java.util.Collections; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.operations.IOperationHistory; -import org.eclipse.core.commands.operations.OperationHistoryFactory; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; -import org.eclipse.papyrus.infra.core.utils.EditorUtils; - -/** - * Utility function. Allow adaption to command stack - * - * @author ansgar - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public class CommandSupport -{ - /** - * Execute the passed Runnable within a command - * - * @param label - * @param command - */ - public static void exec(String label, final Runnable command) - { - TransactionalEditingDomain domain = EditorUtils.getTransactionalEditingDomain(); - IOperationHistory history = OperationHistoryFactory.getOperationHistory(); - try { - history.execute(new AbstractTransactionalCommand(domain, label, Collections.EMPTY_LIST) { - @Override - public CommandResult doExecuteWithResult(IProgressMonitor dummy, IAdaptable info) { - command.run(); - return CommandResult.newOKCommandResult(); - } - }, null, null); - } catch (ExecutionException e) { - e.printStackTrace(); - } - } - - /** - * Execute the passed Runnable within a command - * - * @param label - * @param command - */ - public static void exec(TransactionalEditingDomain domain, String label, final Runnable command) - { - // do works, undo does not (but is selectable in Papyrus Model explorer) - IOperationHistory history = OperationHistoryFactory.getOperationHistory(); - try { - history.execute(new AbstractTransactionalCommand(domain, label, Collections.EMPTY_LIST) { - @Override - public CommandResult doExecuteWithResult(IProgressMonitor dummy, IAdaptable info) { - command.run(); - return CommandResult.newOKCommandResult(); - } - }, null, null); - } catch (ExecutionException e) { - e.printStackTrace(); - } - } - -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CppPanelView.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CppPanelView.java deleted file mode 100644 index 677adbf80db..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CppPanelView.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.cpp; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.papyrus.infra.emf.utils.EMFHelper; -import org.eclipse.papyrus.views.panels.CppAbstractPanel; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.uml2.uml.Element; - - -/** - * This class extends ViewPart. This class draws the Accord/Cpp - * panel in the Modeling Perspective. It also implements ISelectionListener in order to know which element is selected - * in the workbench. In fact, the content of the view changes depending on the - * type of the element selected - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public class CppPanelView extends AbstractCppPanelView { - - /** - * Creates the new panel, when switching UI. - *

- * This class should be overloaded when working with RSA or other tools, using a new PanelFactory - * - * @param parent - * the parent of the new panel - * @param style - * the SWT style of this panel - * @param element - * the element for which the panel is created - * @return the newly created panel - */ - @Override - protected CppAbstractPanel createPanel(Composite parent, int style, - Element element) { - return org.eclipse.papyrus.views.panels.PanelFactory.eINSTANCE - .createPanel(parent, 0, currentTarget); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, - * org.eclipse.jface.viewers.ISelection) - */ - @Override - public void selectionChanged(IWorkbenchPart part, ISelection selection) { - - IStructuredSelection sSelection = null; - if (selection instanceof IStructuredSelection) { - sSelection = (IStructuredSelection) selection; - } - - // exclude case of an empty selection which is not a Tree selection, since changing views provokes an - // empty selection (selection gets lost, although same element remains selected) - if ((selection != null) && (sSelection != null) && sSelection.isEmpty()) { - return; - } - - // No available selection: switch to default panel - if ((sSelection == null) || (sSelection.size() != 1)) { - currentTarget = null; - switchUI(); - return; - } - - // Retrieve selected object - EObject currentObject = EMFHelper.getEObject(sSelection.getFirstElement()); - - if (currentObject instanceof Element) { - if (currentTarget != currentObject) { - currentTarget = currentObject; - switchUI(); - } - } - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/listeners/UMLElementPanelListener.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/listeners/UMLElementPanelListener.java deleted file mode 100644 index 6c7f1b59a6c..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/listeners/UMLElementPanelListener.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ -package org.eclipse.papyrus.views.listeners; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.papyrus.views.panels.CppAbstractPanel; - - - -/** - * Listener for a uml element, for a given AccordCppAbstractPanel. - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public class UMLElementPanelListener implements Adapter { - - /** element listened */ - private Notifier target; - - /** panel that listens to this element */ - protected CppAbstractPanel panel; - - /** - * Creates a new UMLElementListener for the given panel. - * - * @param panel - * the panel that describes this element - */ - public UMLElementPanelListener(CppAbstractPanel panel) { - this.panel = panel; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification) - */ - @Override - public void notifyChanged(Notification notification) { - if (notification.getEventType() != Notification.REMOVING_ADAPTER) { - panel.reset(); // equivalent to a refresh - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.emf.common.notify.Adapter#getTarget() - */ - @Override - public Notifier getTarget() { - return this.target; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.emf.common.notify.Adapter#setTarget(org.eclipse.emf.common.notify.Notifier) - */ - @Override - public void setTarget(Notifier newTarget) { - this.target = newTarget; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.emf.common.notify.Adapter#isAdapterForType(java.lang.Object) - */ - @Override - public boolean isAdapterForType(Object type) { - Class class_ = target.getClass(); - // if class is not null - if (class_ != null) { - return class_.equals(type); - } - // default case: it is not an adapter - return false; - } -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppAbstractPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppAbstractPanel.java deleted file mode 100644 index 7a7ee2cbaba..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppAbstractPanel.java +++ /dev/null @@ -1,447 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.panels; - -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.papyrus.views.cpp.Activator; -import org.eclipse.papyrus.views.listeners.UMLElementPanelListener; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.layout.FormAttachment; -import org.eclipse.swt.layout.FormData; -import org.eclipse.swt.layout.FormLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Group; -import org.eclipse.uml2.uml.Element; - - -/** - * @deprecated This view will be replaced by a XWT view for the C++ profile - */ -@Deprecated -public abstract class CppAbstractPanel extends Composite { - - static final Font pluginFont = new Font(null, "Bitstream Vera Sans Mono", 10, SWT.NORMAL); - - public static final int H_SPACE = 10; - - // string representing the ID of the language - // this is the string contained in the language attribute of Activity - protected static final String C_CPP_ID = "C/C++"; //$NON-NLS-1$ - - protected static final String CPP_ID = "C++"; //$NON-NLS-1$ - - protected static final String C_ID = "C"; //$NON-NLS-1$ - - // CppInclude text area - protected Button buttonSave; - - protected Button buttonCancel; - - /** Listener for modifications on the UML element */ - protected UMLElementPanelListener umlListener = null; - - public CppAbstractPanel(Composite parent, int style) { - - super(parent, style); - this.setLayout(new FormLayout()); - FormData layoutData = new FormData(); - layoutData.top = new FormAttachment(0); - layoutData.bottom = new FormAttachment(100); - layoutData.left = new FormAttachment(0); - layoutData.right = new FormAttachment(100); - this.setLayoutData(layoutData); - this.setBackground(parent.getBackground()); - this.setVisible(true); - } - - public abstract Control createContent(); - - - // ///////////////////////////////////////////////////////////////////// - // Following method are used to create text area w/o coloration - // ///////////////////////////////////////////////////////////////////// - // /** - // * - // */ - // protected FastPartitioner createPartitioner() { - // FastPartitioner pluginPartitioner = new FastPartitioner( - // new CPartitionScanner(), new String[] { - // CPartitionScanner.C_SINGLE_LINE_COMMENT, - // CPartitionScanner.C_MULTILINE_COMMENT, - // CPartitionScanner.C_STRING - // } - // ); - // - // return pluginPartitioner; - // } - - - /** - * Create a group for a text area - * - * @param textArea - * parent composite - * @param name - * of the group - * @param t_previous - * attached to top border - * @param l_previous - * attached to left border - * @param toRight - * should group reach right border of parent - * @param height - * of text in percent of group size - * @param width - * of text in percent of group size - * @param toBottom - * should group reach bottom of parent - * @return new Group - */ - protected Group createGroup( - Composite textArea - , String name - , Control t_previous - , Control l_previous - , boolean toRight - , int height - , int width - , boolean toBottom) { - - Group groupBody = new Group(textArea, SWT.NONE); - - groupBody.setBackground(textArea.getBackground()); - groupBody.setLayout(new FormLayout()); - groupBody.setText(" " + name + " "); //$NON-NLS-1$ //$NON-NLS-2$ - groupBody.setFont(Activator.VIEW_FONT); - - FormData data = new FormData(); - if (t_previous != null) { - data.top = new FormAttachment(t_previous, H_SPACE); - } - - if (l_previous != null) { - data.left = new FormAttachment(l_previous, H_SPACE); - } - - if (data.top == null) { - data.top = new FormAttachment(0, H_SPACE); - } - - if (data.left == null) { - data.left = new FormAttachment(0, H_SPACE); - } - - if (toBottom) { - data.bottom = new FormAttachment(100, -H_SPACE); - } else if (height != 0) { - data.bottom = new FormAttachment(height); - } - - if (toRight) { - data.right = new FormAttachment(100, -H_SPACE); - } else { - data.right = new FormAttachment(width, 0); - } - - groupBody.setLayoutData(data); - return groupBody; - } - - /** - * Create a simple viewer without coloration - * - * @param doc - * @param group - * @return - */ - protected SourceViewer createViewer(IDocument doc, Group group) { - - SourceViewer viewer = - new SourceViewer(group, null, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); - - viewer.setDocument(doc); - - viewer.getTextWidget().setLayout(new FormLayout()); - FormData viewerData = new FormData(); - viewerData.height = 20; - viewerData.top = new FormAttachment(0); - viewerData.bottom = new FormAttachment(100); - viewerData.left = new FormAttachment(0); - viewerData.right = new FormAttachment(100); - viewer.getTextWidget().setLayoutData(viewerData); - - return viewer; - } - - /** - * - * @param doc - * @param group - * @return - */ - protected SourceViewer createViewerC(IDocument doc, Group group) { - return createViewer(doc, group); - } - - /** - * Create a simple document - * - * @return - */ - protected IDocument createDocument() { - IDocument doc = new Document(); - - return doc; - } - - /** - * Create a C/C++ (see cdt) document - * - * @return - */ - protected IDocument createDocumentC() { - return createDocument(); - } - - // ///////////////////////////////////////////////////////////////////// - - /** - * Create save and reset button in the top - right of the structure - * - */ - protected void createSaveResetButtons() { - - // /////////////////////////////////////////////////////////////////////// - // Create a composite that contain the "Save/Cancel" buttons - // /////////////////////////////////////////////////////////////////////// - - buttonSave = new Button(this, SWT.PUSH); - buttonSave.setImage(Activator.getImage(Activator.SAVE_IMAGE)); - buttonSave.setToolTipText(Activator.getResourceString("panel.class.button.save.tooltip")); //$NON-NLS-1$ - buttonSave.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent arg0) { - save(); - } - }); - - buttonCancel = new Button(this, SWT.PUSH); - buttonCancel.setImage(Activator.getImage(Activator.UNDO_IMAGE)); - buttonCancel.setToolTipText(Activator.getResourceString("panel.class.button.cancel.tooltip")); //$NON-NLS-1$ - buttonCancel.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent arg0) { - reset(); - } - }); - - FormData dataC = new FormData(); - dataC.right = new FormAttachment(100, -H_SPACE); - dataC.top = new FormAttachment(0, H_SPACE); - buttonCancel.setLayoutData(dataC); - - FormData dataS = new FormData(); - dataS.right = new FormAttachment(buttonCancel, -H_SPACE); - dataS.top = new FormAttachment(0, H_SPACE); - buttonSave.setLayoutData(dataS); - } - - /** - * Create new button - * - * @param name - * of the button - * @param parent - * composite that owns the button - * @param previous - * structure on which button is left attached - * @return the newly created button - */ - protected Button createButton(String name, Composite parent, Button previous) { - Button newButton = new Button(parent, SWT.CHECK); - - newButton.setBackground(parent.getBackground()); - newButton.setText(name); - FormData data = new FormData(); - - if (previous == null) { - data.left = new FormAttachment(0, H_SPACE); - } else { - data.left = new FormAttachment(previous, H_SPACE); - } - - data.top = new FormAttachment(0, H_SPACE); - newButton.setLayoutData(data); - - return newButton; - } - - /** - * Selection listener that match button status and a particular stereotype - * - * @param button - * @param stereotypeName - */ - protected void addStereotypeSelectionListener(final Button button, final String stereotypeName) { - - button.addSelectionListener( - new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - - updateModel(); - refreshPanel(); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - } - ); - } - - /** - * Action executed just after the panel is created for the specific element. - */ - public void entryAction() { - reset(); - } - - /** - * Action executed just before moving to the new element. - */ - public void exitAction() { - boolean modelChanged = false; - - // check if model was modified (read only action) - modelChanged = checkModifications(); - - // model has change, must go in a write transaction => save - if (modelChanged) { - MessageDialog dialog = new MessageDialog( - Display.getCurrent().getActiveShell(), - Activator.getResourceString("panel.property.dialog.saveorignore.title"), //$NON-NLS-1$ - Activator.getImage(Activator.WARNING_IMAGE), - Activator.getResourceString("panel.property.dialog.saveorignore"), //$NON-NLS-1$ - 0, - new String[] { - Activator.getResourceString("panel.property.dialog.saveorignore.button.save"), //$NON-NLS-1$ - Activator.getResourceString("panel.property.dialog.saveorignore.button.ignore") }, //$NON-NLS-1$ - 0); - dialog.open(); - if (dialog.getReturnCode() == 0) { // saveButton pressed - save(); - } - } - } - - /** - * Check if the content of the panel has modification against the corresponding UML element. - * - * @return true if the panel has modification against the model - */ - public abstract boolean checkModifications(); - - /** - * Action executed when save button is pressed - */ - public abstract void save(); - - /** - * Action executed when reset button is pressed - */ - public void reset() { - boolean modelValid = true; - modelValid = isModelValid(); - if (!modelValid) { - updateModel(); - } - refreshPanel(); - } - - /** - * Refresh panel - */ - protected abstract void refreshPanel(); - - /** - * Makes the model coherent with the AccordCpp Methodology - */ - protected void updateModel() { - } - - /** - * Check if model is coherent with the AccordCpp Methodology - * - * @return true if the model is coherent with the AccordCpp Methodology - */ - protected boolean isModelValid() { - return true; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.swt.widgets.Widget#dispose() - */ - @Override - public void dispose() { - if (getSelectedElement() != null && umlListener != null) { - getSelectedElement().eAdapters().remove(umlListener); - } - super.dispose(); - } - - /** - * Returns the selected element - *

- * Warning: it can be null - * - * @return the selected element - */ - public abstract Element getSelectedElement(); - - /** - * Sets the new selected element - * - * @param newElement - * the new selected element - */ - public void setSelectedElement(Element newElement) { - if (newElement != null && umlListener != null) { - newElement.eAdapters().add(umlListener); - } - } - - protected static void openInformation(final String title, final String message) - { - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - MessageDialog.openInformation(Display.getCurrent().getActiveShell(), title, message); - } - }); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppBehaviorPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppBehaviorPanel.java deleted file mode 100644 index 00a143d0f99..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppBehaviorPanel.java +++ /dev/null @@ -1,275 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.panels; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.papyrus.C_Cpp.Virtual; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.papyrus.views.cpp.CommandSupport; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.OpaqueBehavior; - - -/** - * Panel displayed when an Operation is selected - * - * TODO: instead of keeping isAbstract and pureVirtual Stereotype synchronized, pure virtual - * could be removed from the panel - * @deprecated This view will be replaced by a XWT view for the C++ profile - */ -@Deprecated -public class CppBehaviorPanel extends CppAbstractPanel { - - private Group groupBody; - - // document used by the viewer - private IDocument docBody; - - private Behavior selectedBehavior; - - Element selectedEOwner; - - protected String origBody; - - public CppBehaviorPanel(Composite parent, int style) { - super(parent, style); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() - */ - @Override - public Behavior getSelectedElement() { - return selectedBehavior; - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) - */ - @Override - public void setSelectedElement(Element newElement) { - super.setSelectedElement(newElement); - if (newElement instanceof Behavior) { - this.selectedBehavior = (Behavior) newElement; - // Retrieve the owner - this.selectedEOwner = selectedBehavior.getOwner(); - } - else { - throw new RuntimeException("bad selection: " + newElement + " should be an uml2 Behavior"); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() - */ - @Override - public Control createContent() - { - // ///////////////////////////////////////////////////////////////////// - // Create save reset buttons with superclass method - // ///////////////////////////////////////////////////////////////////// - createSaveResetButtons(); - - // ///////////////////////////////////////////////////////////////////// - // Constructor init list - // ///////////////////////////////////////////////////////////////////// - - // ///////////////////////////////////////////////////////////////////// - // Body - // ///////////////////////////////////////////////////////////////////// - - docBody = createDocumentC(); - groupBody = createGroup( - this, - "Method body", //$NON-NLS-1$ - buttonSave, - null, - true, - 0, - 0, - true); - // Use CDT CEditor coloration - createViewerC(docBody, groupBody); - - // ///////////////////////////////////////////////////////////////////// - - return this; - } - - - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#save() - */ - @Override - public void save() - { - if (selectedBehavior == null) { - /* Log.debug("saveBody : selectedOperation is null"); */ - } else { - CommandSupport.exec("C++ behavior save", new Runnable() { - - @Override - public void run() { - // Body - setCppBody(selectedBehavior, docBody.get()); - origBody = docBody.get(); - } - }); - } - - } - - public static String getCppBody(Behavior behavior) - { - if (behavior instanceof OpaqueBehavior) { - OpaqueBehavior ob = (OpaqueBehavior) behavior; - int i = 0; - for (String language : ob.getLanguages()) { - if (language.equals(C_CPP_ID)) { - return ob.getBodies().get(i); - } - else if (language.equals(CPP_ID)) { - return ob.getBodies().get(i); - } - else if (language.equals(C_ID)) { - return ob.getBodies().get(i); - } - i++; - } - } - return ""; - } - - public static void setCppBody(Behavior behavior, String body) - { - boolean done = false; - if (behavior instanceof OpaqueBehavior) { - OpaqueBehavior ob = (OpaqueBehavior) behavior; - int i = 0; - for (String language : ob.getLanguages()) { - if (language.equals(C_CPP_ID) || language.equals(CPP_ID) || language.equals(C_ID)) { - done = true; - ob.getBodies().set(i, body); - break; - } - i++; - } - if (!done) { - ob.getLanguages().add(C_CPP_ID); - ob.getBodies().add(body); - } - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() - */ - @Override - public void entryAction() { - super.entryAction(); - reset(); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#exitAction() - */ - @Override - public void exitAction() { - // do exit action, only if the owner is a class - if (selectedEOwner instanceof Class) { - super.exitAction(); - } - } - - @Override - public boolean checkModifications() { - if (!(docBody.get().equals(origBody))) { - return true; - } - return false; - } - - @Override - protected void refreshPanel() { - if (selectedBehavior == null) { - /* Log.debug("resetBody : selectedOperation is null"); */ - } - else { - String body = getCppBody(selectedBehavior); - origBody = body; - docBody.set(body); - } - } - - @Override - protected boolean isModelValid() { - if (selectedBehavior == null) { - return true; - } - if (selectedEOwner instanceof Class) { - - if (selectedBehavior.isAbstract()) { - if (!StereotypeUtil.isApplied(selectedBehavior, Virtual.class)) { - return false; - } - } - } else { - // owner is interface - if (!selectedBehavior.isAbstract()) { - return false; - } - if (StereotypeUtil.isApplied(selectedBehavior, Virtual.class)) { - return false; - } - } - return true; - - } - - @Override - protected void updateModel() - { - CommandSupport.exec("C++ behavior save", new Runnable() { - - @Override - public void run() - { - if (selectedBehavior == null) { - return; - } - if (selectedEOwner instanceof Class) { - } - else { - selectedBehavior.setIsAbstract(true); - } - } - }); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppClassPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppClassPanel.java deleted file mode 100644 index 7d3d6c40d07..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppClassPanel.java +++ /dev/null @@ -1,225 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.panels; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.papyrus.C_Cpp.Include; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.papyrus.views.cpp.CommandSupport; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.util.UMLUtil; - - - -/** - * Panel displayed when a Class is selected - * @deprecated This view will be replaced by a XWT view for the C++ profile - */ -@Deprecated -public class CppClassPanel extends CppAbstractPanel { - - // document used by the viewer for header include - private IDocument headerDocument; - - @SuppressWarnings("unused") - private SourceViewer headerViewer; - - private Group headerGroup; - - // document used by the viewer for body include - private IDocument bodyDocument; - - @SuppressWarnings("unused") - private SourceViewer bodyViewer; - - private Group bodyGroup; - - // Current selection - private Class selectedClass; - - protected String origHeader; - - protected String origBody; - - public CppClassPanel(Composite parent, int style) { - super(parent, style); - } - - /** - * @return Returns the selectedOperation. - */ - @Override - public org.eclipse.uml2.uml.Class getSelectedElement() { - return selectedClass; - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Object) - */ - @Override - public void setSelectedElement(Element newElement) { - super.setSelectedElement(newElement); - if (newElement instanceof Class) { - this.selectedClass = (Class) newElement; - } - else { - throw new RuntimeException("bad selection: " + newElement + " should be an uml2 Class"); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContentHI() - */ - @Override - public Control createContent() { - - // ///////////////////////////////////////////////////////////////////// - // Create save reset buttons with superclass method - // ///////////////////////////////////////////////////////////////////// - createSaveResetButtons(); - - // /////////////////////////////////////////////////////////////////////// - // Create a Group for the header include declarations - // /////////////////////////////////////////////////////////////////////// - headerDocument = createDocumentC(); - headerGroup = createGroup( - this - , "Header include declarations" - , buttonSave - , null - , true - , 50 - , 0 - , false); - // Use CDT CEditor coloration - headerViewer = createViewerC(headerDocument, headerGroup); - // /////////////////////////////////////////////////////////////////////// - // Create a Group for the body include declarations - // /////////////////////////////////////////////////////////////////////// - bodyDocument = createDocumentC(); - bodyGroup = createGroup( - this - , "Body include declarations" - , headerGroup - , null - , true - , 0 - , 0 - , true); - // Use CDT CEditor coloration - bodyViewer = createViewerC(bodyDocument, bodyGroup); - - // /////////////////////////////////////////////////////////////////////// - - return this; - } - - /** - * Saves the include declarations for a 'Class' - */ - @Override - public void save() - { - if (selectedClass == null) { - /* Log.debug("saveBody : selectedOperation is null"); */ - } else { - CommandSupport.exec("C++ header/body save", new Runnable() { - - @Override - public void run() { - if (headerDocument.get().equals("") - && bodyDocument.get().equals("")) { - StereotypeUtil.unapply(selectedClass, Include.class); - } else { - Include cppInclude = StereotypeUtil.applyApp(selectedClass, Include.class); - cppInclude.setHeader(headerDocument.get()); - origHeader = headerDocument.get(); - cppInclude.setBody(bodyDocument.get()); - origBody = bodyDocument.get(); - } - } - }); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#entryAction() - */ - @Override - public void entryAction() { - super.entryAction(); - reset(); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#checkModifications() - */ - @Override - public boolean checkModifications() { - // String headerInModel = ""; - // String bodyInModel = ""; - - /* - Include cppInclude = UMLUtil.getStereotypeApplication(selectedClass, Include.class); - if (cppInclude != null) { - headerInModel = cppInclude.getHeader(); - bodyInModel = cppInclude.getBody(); - } - */ - - boolean headerChanged = !headerDocument.get().equals(origHeader); - boolean bodyChanged = !bodyDocument.get().equals(origBody); - - return (headerChanged | bodyChanged); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() - */ - @Override - protected void refreshPanel() { - if (selectedClass == null) { - } - else { - Include cppInclude = UMLUtil.getStereotypeApplication(selectedClass, Include.class); - if (cppInclude != null) { - // get the text in the tagged value - String currentHI = cppInclude.getHeader(); - origHeader = currentHI; - headerDocument.set(currentHI); - String currentBI = cppInclude.getBody(); - origBody = currentBI; - bodyDocument.set(currentBI); - } else { - origHeader = ""; //$NON-NLS-1$ - headerDocument.set(""); //$NON-NLS-1$ - origBody = ""; //$NON-NLS-1$ - bodyDocument.set(""); //$NON-NLS-1$ - } - } - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppDefaultPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppDefaultPanel.java deleted file mode 100644 index 2d0c1419e51..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppDefaultPanel.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ -package org.eclipse.papyrus.views.panels; - -import org.eclipse.papyrus.views.cpp.Activator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.uml2.uml.Element; - - -/** - * Default panel when selection is not relevant. - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public class CppDefaultPanel extends CppAbstractPanel { - - /** Label used to display text */ - private Label label; - - /** - * Constructs a new instance of this class given its parent and a style - * value describing its behavior and appearance. - * - * @param parent - * the composite parent of this element - * @param style - * the style for this panel - * @see SWT - */ - public CppDefaultPanel(Composite parent, int style) { - super(parent, style); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#createContent() - */ - @Override - public Control createContent() { - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - this.setLayout(layout); - - label = new Label(this, SWT.NONE); - label.setText(Activator.getResourceString("panel.default.text")); - GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gridData.horizontalSpan = 2; - label.setLayoutData(gridData); - - return null; - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#save() - */ - @Override - public void save() { - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() - */ - @Override - public Element getSelectedElement() { - return null; - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(org.eclipse.uml2.uml.Element) - */ - @Override - public void setSelectedElement(Element newElement) { - } - - @Override - public boolean checkModifications() { - return false; - } - - @Override - protected void refreshPanel() { - - } -} \ No newline at end of file diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppGeneralizationPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppGeneralizationPanel.java deleted file mode 100644 index 40fc2e0a61e..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppGeneralizationPanel.java +++ /dev/null @@ -1,268 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.panels; - -import org.eclipse.papyrus.C_Cpp.Visibility; -import org.eclipse.papyrus.views.cpp.Activator; -import org.eclipse.papyrus.views.cpp.CommandSupport; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Generalization; -import org.eclipse.uml2.uml.util.UMLUtil; - - - -/** - * Panel displayed when a Generalization is selected - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public class CppGeneralizationPanel extends CppAbstractPanel { - - private static final String PROTECTED = "protected"; //$NON-NLS-1$ - - private static final String PUBLIC = "public"; //$NON-NLS-1$ - - private static final String PRIVATE = "private"; //$NON-NLS-1$ - - /** Combo box to display visibility */ - private Combo vPropCombo; - - /** current selected generalization */ - private Generalization selectedGeneralization; - - public CppGeneralizationPanel(Composite parent, int style) { - super(parent, style); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() - */ - @Override - public Generalization getSelectedElement() { - return selectedGeneralization; - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(org.eclipse.uml2.uml.Element) - */ - @Override - public void setSelectedElement(Element newElement) { - super.setSelectedElement(newElement); - if (newElement instanceof Generalization) { - this.selectedGeneralization = (Generalization) newElement; - } else { - throw new RuntimeException("bad selection: " + newElement + " should be a UML2 generalization"); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() - */ - @Override - public Control createContent() - { - // creates a composite - - GridLayout gridLayout = new GridLayout(); - gridLayout.numColumns = 1; - this.setLayout(gridLayout); - - // Contains checkboxes associated to stereotypes - Group qualifierGroup = new Group(this, 0); - qualifierGroup.setLayout(new RowLayout()); - qualifierGroup.setText("Generalization visibility"); - - // Visibility properties combo box - vPropCombo = new Combo(qualifierGroup, SWT.DROP_DOWN | SWT.READ_ONLY); - String items[] = { PUBLIC, PROTECTED, PRIVATE }; - vPropCombo.setItems(items); - vPropCombo.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent event) { - checkVirtual(); - } - }); - - this.pack(); - return this; - } - - /** - * Called when the visibility qualifier is modified - */ - public void checkVirtual() - { - // Treat the generalization - int comboSelected = vPropCombo.getSelectionIndex(); - - final String visibilityVal; - switch (comboSelected) { - case 0: /* public */ - visibilityVal = PUBLIC; - break; - case 1: /* protected */ - visibilityVal = PROTECTED; - break; - case 2: /* private */ - visibilityVal = PRIVATE; - break; - default: /* public */ - visibilityVal = PUBLIC; - break; - } - final Visibility visibility = UMLUtil.getStereotypeApplication(selectedGeneralization, Visibility.class); - if (visibility != null) { - String vis = visibility.getValue(); - if (!vis.equals(visibilityVal)) { - CommandSupport.exec("Set visibility for generalization", new Runnable() { - - @Override - public void run() { - visibility.setValue(visibilityVal); - } - }); - } - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() - */ - @Override - public void entryAction() { - super.entryAction(); - reset(); - } - - // Required by super class - @Override - public void save() { - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#checkModifications() - */ - @Override - public boolean checkModifications() { - // no specific stereotypes tagged value to save - return false; - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() - */ - @Override - protected void refreshPanel() - { - if (selectedGeneralization != null) { - final Visibility visibility = UMLUtil.getStereotypeApplication(selectedGeneralization, Visibility.class); - if (visibility != null) { - String vis = visibility.getValue(); - - if (vis.equals(PUBLIC)) { - vPropCombo.select(0); - } else if (vis.equals(PROTECTED)) { - vPropCombo.select(1); - } else if (vis.equals(PRIVATE)) { - vPropCombo.select(2); - } else { - Activator.log(new RuntimeException("Generalization: should never happen, model should be corrected before")); - vPropCombo.select(0); - } - } else { - // no visibility applied, defaults to public - vPropCombo.select(0); - } - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#isModelValid() - */ - @Override - protected boolean isModelValid() - { - if (selectedGeneralization == null) { - return true; - } - - final Visibility visibility = UMLUtil.getStereotypeApplication(selectedGeneralization, Visibility.class); - if (visibility != null) { - String vis = visibility.getValue(); - - if ((vis.equals(PUBLIC) || vis.equals(PROTECTED)) || vis.equals(PRIVATE)) { - return true; - } - else { - return false; - } - } - else { - return false; - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#updateModel() - */ - @Override - protected void updateModel() { - super.updateModel(); - if (selectedGeneralization == null) { - return; - } - - final Visibility visibility = UMLUtil.getStereotypeApplication(selectedGeneralization, Visibility.class); - if (visibility != null) { - if (!isModelValid()) { - CommandSupport.exec("Correct illegal visibility value", new Runnable() { - - @Override - public void run() { - visibility.setValue(PUBLIC); - } - }); - } - } - else { - // good idea? apply value, even if visibility unspecified - // GenUtils.setStereotype (selectedGeneralization, Visibility.class, true); - // GenUtils.setTaggedValue (selectedGeneralization, Visibility.class, "value", "public"); - } - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppOperationPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppOperationPanel.java deleted file mode 100644 index 892a7a3a655..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppOperationPanel.java +++ /dev/null @@ -1,646 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.panels; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.papyrus.C_Cpp.Const; -import org.eclipse.papyrus.C_Cpp.ConstInit; -import org.eclipse.papyrus.C_Cpp.Friend; -import org.eclipse.papyrus.C_Cpp.Inline; -import org.eclipse.papyrus.C_Cpp.Virtual; -import org.eclipse.papyrus.cpp.profile.StdStereo; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.papyrus.views.cpp.CommandSupport; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.FormAttachment; -import org.eclipse.swt.layout.FormData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.OpaqueBehavior; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.util.UMLUtil; - - -/** - * Panel displayed when an Operation is selected - * - * TODO: instead of keeping isAbstract and pureVirtual Stereotype synchronized, pure virtual - * could be removed from the panel - * @deprecated This view will be replaced by a XWT view for the C++ profile - */ -@Deprecated -public class CppOperationPanel extends CppAbstractPanel { - - @SuppressWarnings("unused") - private ISourceViewer viewerBody; - - @SuppressWarnings("unused") - private ISourceViewer viewerConstInit; - - private Group groupBody; - - private Group groupCInit; - - // document used by the viewer - private IDocument docBody; - - private IDocument docConstInit; - - private Button isStatic; - - private Button isInline; - - private Button isConst; - - private Button isFriend; - - private Button isCreate; - - private Button isDestroy; - - private Combo vPropCombo; - - private Operation selectedOperation; - - Element selectedEOwner; - - protected String origBody; - - public CppOperationPanel(Composite parent, int style) { - super(parent, style); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() - */ - @Override - public Operation getSelectedElement() { - return selectedOperation; - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) - */ - @Override - public void setSelectedElement(Element newElement) { - super.setSelectedElement(newElement); - if (newElement instanceof Operation) { - this.selectedOperation = (Operation) newElement; - // Retrieve the owner - this.selectedEOwner = selectedOperation.getOwner(); - } - else { - throw new RuntimeException("bad selection: " + newElement + " should be an uml2 Operation"); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() - */ - @Override - public Control createContent() - { - // ///////////////////////////////////////////////////////////////////// - // Create checkboxes - // ///////////////////////////////////////////////////////////////////// - isStatic = createButton("isStatic", this, null); - isInline = createButton("isInline", this, isStatic); - isConst = createButton("isConst", this, isInline); - isFriend = createButton("isFriend", this, isConst); - isCreate = createButton("isCreate", this, isFriend); - isDestroy = createButton("isDestroy", this, isCreate); - - // ///////////////////////////////////////////////////////////////////// - // Add checkboxes listeners - // ///////////////////////////////////////////////////////////////////// - isStatic.addSelectionListener(new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - CommandSupport.exec("C++ operation save", new Runnable() { - - @Override - public void run() { - updateModel(); - } - }); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - addStereotypeSelectionListener(isInline, "Inline"); - addStereotypeSelectionListener(isConst, "Const"); - addStereotypeSelectionListener(isFriend, "Friend"); - addStereotypeSelectionListener(isCreate, "Create"); - addStereotypeSelectionListener(isDestroy, "Destroy"); - - // ///////////////////////////////////////////////////////////////////// - // Virtual properties combo box - // ///////////////////////////////////////////////////////////////////// - vPropCombo = new Combo(this, SWT.DROP_DOWN | SWT.READ_ONLY); - String items[] = { "not virtual", "virtual", "pure virtual" }; - vPropCombo.setItems(items); - vPropCombo.setText("Virtual operation qualifiers"); - vPropCombo.addSelectionListener( - new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent event) { - checkVirtual(); - reset(); - } - }); - - FormData data = new FormData(); - data.left = new FormAttachment(isDestroy, H_SPACE); - data.top = new FormAttachment(0, H_SPACE); - vPropCombo.setLayoutData(data); - - // ///////////////////////////////////////////////////////////////////// - // Create save reset buttons with superclass method - // ///////////////////////////////////////////////////////////////////// - createSaveResetButtons(); - - // ///////////////////////////////////////////////////////////////////// - // Constructor init list - // ///////////////////////////////////////////////////////////////////// - docConstInit = createDocument(); - groupCInit = createGroup( - this - , "Constructor initialisation list" - , isStatic - , null - , true - , 0 - , 0 - , false); - - // Use CDT CEditor coloration - viewerConstInit = createViewer(docConstInit, groupCInit); - - // ///////////////////////////////////////////////////////////////////// - // Body - // ///////////////////////////////////////////////////////////////////// - - docBody = createDocumentC(); - groupBody = createGroup( - this - , "Method body" - , groupCInit - , null - , true - , 0 - , 0 - , true); - // Use CDT CEditor coloration - viewerBody = createViewerC(docBody, groupBody); - - // ///////////////////////////////////////////////////////////////////// - - return this; - } - - - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#save() - */ - @Override - public void save() - { - if (selectedOperation == null) { - /* Log.debug("saveBody : selectedOperation is null"); */ - } else { - CommandSupport.exec("C++ operation save", new Runnable() { - - @Override - public void run() { - String newConstInit = docConstInit.get(); - if (newConstInit.equals("")) { //$NON-NLS-1$ - StereotypeUtil.unapply(selectedOperation, ConstInit.class); - } else { - ConstInit cppConstInit = - StereotypeUtil.applyApp(selectedOperation, ConstInit.class); - cppConstInit.setInitialisation(newConstInit); - } - - // Body - setCppBody(selectedOperation, docBody.get()); - origBody = docBody.get(); - } - }); - } - - } - - public static String getCppBody(Operation operation) - { - // get the body of the operation - for (Behavior behavior : operation.getMethods()) { - if (behavior instanceof OpaqueBehavior) { - OpaqueBehavior ob = (OpaqueBehavior) behavior; - int i = 0; - for (String language : ob.getLanguages()) { - if (language.equals(C_CPP_ID)) { - return ob.getBodies().get(i); - } - else if (language.equals(CPP_ID)) { - return ob.getBodies().get(i); - } - else if (language.equals(C_ID)) { - return ob.getBodies().get(i); - } - i++; - } - } - } - return ""; //$NON-NLS-1$ - } - - public static void setCppBody(Operation operation, String body) - { - boolean done = false; - for (Behavior behavior : operation.getMethods()) { - if (behavior instanceof OpaqueBehavior) { - OpaqueBehavior ob = (OpaqueBehavior) behavior; - int i = 0; - for (String language : ob.getLanguages()) { - if (language.equals(C_CPP_ID) || language.equals(CPP_ID) || language.equals(C_ID)) { - done = true; - ob.getBodies().set(i, body); - break; - } - i++; - } - } - if (done) { - break; - } - } - if (!done) { - OpaqueBehavior ob = (OpaqueBehavior) - operation.getClass_().createOwnedBehavior(operation.getName(), UMLPackage.eINSTANCE.getOpaqueBehavior()); - ob.getLanguages().add(C_CPP_ID); - ob.getBodies().add(body); - ob.setSpecification(operation); - } - - } - - /** - * Called when the static checkbox is modified - */ - protected void checkStatic() - { - boolean boxState = isStatic.getSelection(); - - selectedOperation.setIsStatic(boxState); - } - - /** - * Called when the inline checkbox is modified - */ - protected void checkInline() { - // get the text in the activity - boolean boxState = isInline.getSelection(); - - if (boxState != StereotypeUtil.isApplied(selectedOperation, Inline.class)) { - if (boxState) { - StereotypeUtil.apply(selectedOperation, Inline.class); - } - else { - StereotypeUtil.unapply(selectedOperation, Inline.class); - } - } - } - - /** - * Called when the const checkbox is modified - */ - protected void checkConst() { - - boolean boxState = isConst.getSelection(); - - if (boxState != StereotypeUtil.isApplied(selectedOperation, Const.class)) { - if (boxState) { - StereotypeUtil.apply(selectedOperation, Const.class); - } - else { - StereotypeUtil.unapply(selectedOperation, Const.class); - } - } - } - - /** - * Called when the friend checkbox is modified - */ - protected void checkFriend() { - - boolean boxState = isFriend.getSelection(); - - if (boxState != StereotypeUtil.isApplied(selectedOperation, Friend.class)) { - if (boxState) { - StereotypeUtil.apply(selectedOperation, Friend.class); - } - else { - StereotypeUtil.unapply(selectedOperation, Friend.class); - } - } - } - - /** - * Called when the create checkbox is modified - */ - protected void checkCreate() { - // get the text in the activity - boolean boxState = isCreate.getSelection(); - - if (boxState) { - StereotypeUtil.apply(selectedOperation, StdStereo.create); - } - else { - StereotypeUtil.unapply(selectedOperation, ConstInit.class); - StereotypeUtil.unapply(selectedOperation, StdStereo.create); - } - - groupCInit.setEnabled(boxState); - } - - /** - * Called when the destroy checkbox is modified - */ - protected void checkDestroy() { - // get the text in the activity - boolean boxState = isDestroy.getSelection(); - - if (boxState) { - StereotypeUtil.apply(selectedOperation, StdStereo.destroy); - } - else { - StereotypeUtil.unapply(selectedOperation, StdStereo.destroy); - } - } - - /** - * Called when the virtual qualifier is modified - */ - protected void checkVirtual() { - - // Treat the operation - int comboSelected = 2; - - // If owner is a class - if (selectedEOwner instanceof org.eclipse.uml2.uml.Class) { - comboSelected = vPropCombo.getSelectionIndex(); - } else { - // Assume this is an interface - comboSelected = 2; - } - - if (comboSelected == 0 /* not virtual */) { - - selectedOperation.setIsAbstract(false); - StereotypeUtil.unapply(selectedOperation, Virtual.class); - } - else if (comboSelected == 1 /* virtual */) { - - selectedOperation.setIsAbstract(false); - StereotypeUtil.apply(selectedOperation, Virtual.class); - } - else if (comboSelected == 2 /* pure virtual */) { - - selectedOperation.setIsAbstract(true); - StereotypeUtil.apply(selectedOperation, Virtual.class); - } - - // Treat the owner class - if (selectedEOwner instanceof Class) { - Class ownerCl = (Class) selectedEOwner; - - ownerCl.setIsAbstract(ownerCl.isAbstract()); - } // else nothing - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() - */ - @Override - public void entryAction() { - super.entryAction(); - reset(); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#exitAction() - */ - @Override - public void exitAction() { - // do exit action, only if the owner is a class - if (selectedEOwner instanceof Class) { - super.exitAction(); - } - } - - @Override - public boolean checkModifications() { - // check if ConstInit has changed - String valueConstInit = ""; //$NON-NLS-1$ - ConstInit constInit = UMLUtil.getStereotypeApplication(selectedOperation, ConstInit.class); - if (constInit != null) { - valueConstInit = constInit.getInitialisation(); - } - if (!docConstInit.get().equals(valueConstInit)) { - return true; - } - - // String methodBody = getCppBody(selectedOperation); - if (!(docBody.get().equals(origBody))) { - return true; - } - - return false; - } - - @Override - protected void refreshPanel() { - if (selectedOperation == null) { - /* Log.debug("resetBody : selectedOperation is null"); */ - } else { - - // get the text in the activity if parent is a class - if (selectedEOwner instanceof Class) { - - // This part is done for a class only - ConstInit constInit = UMLUtil.getStereotypeApplication(selectedOperation, ConstInit.class); - if (constInit != null) { - docConstInit.set(constInit.getInitialisation()); - } - - // Don't show this unless the operation is a constructor - if (isCreate.getSelection()) { - groupCInit.setEnabled(true); - } else { - docConstInit.set(""); //$NON-NLS-1$ - groupCInit.setEnabled(false); - } - - String body = getCppBody(selectedOperation); - origBody = body; - docBody.set(body); - - // Combo Box - if (selectedOperation.isAbstract()) { - vPropCombo.select(2); - // Nothing in body and body unavailable - docBody.set(""); //$NON-NLS-1$ - groupBody.setEnabled(false); - } - else { - if (StereotypeUtil.isApplied(selectedOperation, Virtual.class)) { - vPropCombo.select(1); - groupBody.setEnabled(true); - } - else { - vPropCombo.select(0); - groupBody.setEnabled(true); - } - } - - // Inline - if (StereotypeUtil.isApplied(selectedOperation, Inline.class)) { - isInline.setSelection(true); - } - - } - else { - // Don't show text areas nor buttons - groupBody.setVisible(false); - buttonSave.setVisible(false); - buttonCancel.setVisible(false); - - // Methods are virtual pure - vPropCombo.select(2); - vPropCombo.setEnabled(false); - - // Inline not visible - isInline.setVisible(false); - } - - isStatic.setSelection(selectedOperation.isStatic()); - isConst.setSelection(StereotypeUtil.isApplied(selectedOperation, Const.class)); - isFriend.setSelection(StereotypeUtil.isApplied(selectedOperation, Friend.class)); - isCreate.setSelection(StereotypeUtil.isApplied(selectedOperation, StdStereo.create)); - isDestroy.setSelection(StereotypeUtil.isApplied(selectedOperation, StdStereo.destroy)); - } - } - - @Override - protected boolean isModelValid() { - if (selectedOperation == null) { - return true; - } - if (selectedEOwner instanceof Class) { - - if (selectedOperation.isAbstract()) { - if (!StereotypeUtil.isApplied(selectedOperation, Virtual.class)) { - return false; - } - } - } else { - // owner is interface - if (!selectedOperation.isAbstract()) { - return false; - } - if (StereotypeUtil.isApplied(selectedOperation, Virtual.class)) { - return false; - } - } - return true; - - } - - @Override - protected void updateModel() - { - CommandSupport.exec("C++ operation save", new Runnable() { - - @Override - public void run() - { - // Check button changes - checkStatic(); - checkConst(); - checkCreate(); - checkDestroy(); - checkInline(); - checkFriend(); - - if (selectedOperation == null) { - return; - } - if (selectedEOwner instanceof Class) { - // toggle Stereotypes pure virtual if element is abstract - if (selectedOperation.isAbstract()) { - if (!StereotypeUtil.isApplied(selectedOperation, Virtual.class)) { - // selectedOperation.toggleStereotype("VirtualPure", true); - // selectedOperation.toggleStereotype("Virtual", false); - } else { - // selectedOperation.toggleStereotype("Virtual", false); - } - } - - // if element is abstract and has VirtualPure, set to Virtual only - if (!selectedOperation.isAbstract()) { - if (StereotypeUtil.isApplied(selectedOperation, Virtual.class)) { - // selectedOperation.toggleStereotype("VirtualPure", false); - // selectedOperation.toggleStereotype("Virtual", true); - } else { - // selectedOperation.toggleStereotype("VirtualPure", false); - // selectedOperation.toggleStereotype("Virtual", false); - } - } - } - else { - selectedOperation.setIsAbstract(true); - // selectedOperation.toggleStereotype("Virtual", false); - // selectedOperation.toggleStereotype("VirtualPure", true); - } - } - }); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPackagePanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPackagePanel.java deleted file mode 100644 index ef8b80141c4..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPackagePanel.java +++ /dev/null @@ -1,183 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.panels; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.papyrus.C_Cpp.Include; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.papyrus.views.cpp.CommandSupport; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.util.UMLUtil; - - -/** - * Panel displayed when a Package is selected - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public class CppPackagePanel extends CppAbstractPanel { - - // document used by the viewer for header include - private IDocument headerDocument; - - // private SourceViewer headerViewer; - private Group headerGroup; - - // Current selection - private Package selectedPackage; - - /** - * Default constructor - * - * @param parent - * the composite parent of this panel - * @param style - * the SWT style of this panel - */ - public CppPackagePanel(Composite parent, int style) { - super(parent, style); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() - */ - @Override - public org.eclipse.uml2.uml.Package getSelectedElement() { - return selectedPackage; - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) - */ - @Override - public void setSelectedElement(Element newElement) { - super.setSelectedElement(newElement); - if (newElement instanceof Package) { - this.selectedPackage = (Package) newElement; - } - else { - throw new RuntimeException("bad selection: " + newElement + " should be an uml2 Package"); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContentHI() - */ - @Override - public Control createContent() { - - // ///////////////////////////////////////////////////////////////////// - // Create a composite that contain the "Save/Cancel" buttons - // ///////////////////////////////////////////////////////////////////// - createSaveResetButtons(); - - // ///////////////////////////////////////////////////////////////////// - // Package header declaration - // ///////////////////////////////////////////////////////////////////// - headerDocument = createDocumentC(); - headerGroup = createGroup( - this - , "Header include declarations" - , buttonSave - , null - , true - , 0 - , 0 - , true); - // Use CDT CEditor coloration - // headerViewer - createViewerC(headerDocument, headerGroup); - - // ///////////////////////////////////////////////////////////////////// - return this; - } - - /** - * Saves the include declarations for a 'Package' - */ - @Override - public void save() - { - if (selectedPackage == null) { - /* Log.debug("saveBody : selectedPackage is null"); */ - } - else { - CommandSupport.exec("C++ package save", new Runnable() { - - @Override - public void run() - { - if (headerDocument.get().equals("")) { - StereotypeUtil.unapply(selectedPackage, Include.class); - } else { - Include cppInclude = StereotypeUtil.applyApp(selectedPackage, Include.class); - cppInclude.setHeader(headerDocument.get()); - } - } - }); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() - */ - @Override - protected void refreshPanel() { - if (selectedPackage != null) { - Include cppInclude = UMLUtil.getStereotypeApplication(selectedPackage, Include.class); - if (cppInclude != null) { - headerDocument.set(cppInclude.getHeader()); - } - else { - headerDocument.set(""); - } - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() - */ - @Override - public void entryAction() { - super.entryAction(); - reset(); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#checkModifications() - */ - @Override - public boolean checkModifications() { - String headerInModel = ""; - Include cppInclude = UMLUtil.getStereotypeApplication(selectedPackage, Include.class); - if (cppInclude != null) { - headerInModel = cppInclude.getHeader(); - } - return (!(headerDocument.get().equals(headerInModel))); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppParameterPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppParameterPanel.java deleted file mode 100644 index 15b1ff3bda2..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppParameterPanel.java +++ /dev/null @@ -1,346 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.panels; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.papyrus.C_Cpp.Array; -import org.eclipse.papyrus.C_Cpp.Const; -import org.eclipse.papyrus.C_Cpp.Ptr; -import org.eclipse.papyrus.C_Cpp.Ref; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.papyrus.views.cpp.CommandSupport; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Parameter; - - -/** - * Panel displayed when a Parameter is selected - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public class CppParameterPanel extends CppAbstractPanel { - - private Button isConst; - - private Parameter selectedParameter; - - // document used by the viewer - private IDocument docPtr; - - private IDocument docRef; - - private IDocument docArray; - - private IDocument docDefault; - - @SuppressWarnings("unused") - private SourceViewer viewerPtr; - - @SuppressWarnings("unused") - private SourceViewer viewerRef; - - @SuppressWarnings("unused") - private SourceViewer viewerArray; - - @SuppressWarnings("unused") - private SourceViewer viewerDefault; - - private Group groupPtr; - - private Group groupRef; - - private Group groupArray; - - private Group groupDefault; - - public CppParameterPanel(Composite parent, int style) { - super(parent, style); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordAbstractPanel#getSelectedElement() - */ - @Override - public org.eclipse.uml2.uml.Parameter getSelectedElement() { - return selectedParameter; - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordAbstractPanel#setSelectedElement(java.lang.Element) - */ - @Override - public void setSelectedElement(Element newElement) { - super.setSelectedElement(newElement); - if (newElement instanceof Parameter) { - this.selectedParameter = (Parameter) newElement; - } - else { - throw new RuntimeException("bad selection: " + newElement + " should be an uml2 Parameter"); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() - */ - @Override - public Control createContent() { - // ///////////////////////////////////////////////////////////////////// - // Create save reset buttons with superclass method - // ///////////////////////////////////////////////////////////////////// - createSaveResetButtons(); - - // ///////////////////////////////////////////////////////////////////// - // Create checkboxes - // ///////////////////////////////////////////////////////////////////// - isConst = createButton("isConst", this, null); - - // ///////////////////////////////////////////////////////////////////// - // Add checkboxes listeners - // ///////////////////////////////////////////////////////////////////// - addStereotypeSelectionListener(isConst, "Const"); - - // ///////////////////////////////////////////////////////////////////// - // Pointer declaration - // ///////////////////////////////////////////////////////////////////// - docPtr = createDocument(); - groupPtr = createGroup( - this - , "Pointer declaration" - , buttonSave - , null - , false - , 0 - , 25 - , false); - - // Use CDT CEditor coloration - viewerPtr = createViewer(docPtr, groupPtr); - - // ///////////////////////////////////////////////////////////////////// - // Pointer declaration - // ///////////////////////////////////////////////////////////////////// - docRef = createDocument(); - groupRef = createGroup( - this - , "Reference declaration" - , buttonSave - , groupPtr - , false - , 0 - , 50 - , false); - - // Use CDT CEditor coloration - viewerRef = createViewer(docRef, groupRef); - - // ///////////////////////////////////////////////////////////////////// - // Pointer declaration - // ///////////////////////////////////////////////////////////////////// - docDefault = createDocument(); - groupDefault = createGroup( - this - , "Default value" - , buttonSave - , groupRef - , false - , 0 - , 75 - , false); - - // Use CDT CEditor coloration - viewerDefault = createViewer(docDefault, groupDefault); - - // ///////////////////////////////////////////////////////////////////// - // Pointer declaration - // ///////////////////////////////////////////////////////////////////// - docArray = createDocument(); - groupArray = createGroup( - this - , "Array value ([...])" - , buttonSave - , groupDefault - , true - , 0 - , 0 - , false); - - // Use CDT CEditor coloration - viewerArray = createViewer(docArray, groupArray); - - // ///////////////////////////////////////////////////////////////////// - // Return control - // ///////////////////////////////////////////////////////////////////// - - return this; - } - - /** - * Saves the body for an 'Parameter' - */ - @Override - public void save() - { - if (selectedParameter == null) { - /* Log.debug("saveBody : selectedParameter is null"); */ - } - else { - CommandSupport.exec("C++ parameter save", new Runnable() { - - @Override - public void run() - { - // Treat Pointer - String newPtr = docPtr.get(); - if (newPtr.equals("")) { - StereotypeUtil.unapply(selectedParameter, Ptr.class); - } - else { - StereotypeUtil.apply(selectedParameter, Ptr.class); - } - - // Treat Reference - String newRef = docRef.get(); - if (newRef.equals("")) { - StereotypeUtil.unapply(selectedParameter, Ref.class); - } - else { - StereotypeUtil.apply(selectedParameter, Ref.class); - } - - // Treat DefaultValue - // need common class for facilitating this - // selectedParameter.setDefaultValue(selectedParameter.createDefaultValue("default", selectedParameter.getType(), null); - - // Treat Array - String newArray = docArray.get(); - if (newArray.equals("")) { - StereotypeUtil.unapply(selectedParameter, Array.class); - } - else { - StereotypeUtil.apply(selectedParameter, Array.class); - // StereotypeUtil.setTaggedValue(selectedParameter, Array.class, "definition", newArray); - } - } - }); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordAbstractPanel#refreshPanel() - */ - @Override - protected void refreshPanel() { - if (selectedParameter != null) { - // Const - - isConst.setSelection(StereotypeUtil.isApplied(selectedParameter, Const.class)); - // TODO: examine effect; - // isConst.setSelection(selectedParameter.getEffect?); - - docPtr.set(StereotypeUtil.isApplied(selectedParameter, Ptr.class) ? "*" : ""); - docRef.set(StereotypeUtil.isApplied(selectedParameter, Ref.class) ? "&" : ""); - docDefault.set(selectedParameter.getDefault()); - docArray.set(StereotypeUtil.isApplied(selectedParameter, Array.class) ? "[]" : ""); - // need definition? - } - } - - /** - * Called when the static checkbox is modified - */ - protected void checkConst() { - - boolean boxState = isConst.getSelection(); - - if (boxState) { - if (!StereotypeUtil.isApplied(selectedParameter, Const.class)) { - StereotypeUtil.apply(selectedParameter, Const.class); - } - } else { - if (StereotypeUtil.isApplied(selectedParameter, Const.class)) { - StereotypeUtil.unapply(selectedParameter, Const.class); - } - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() - */ - @Override - public void entryAction() { - super.entryAction(); - reset(); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordAbstractPanel#checkModifications() - */ - @Override - public boolean checkModifications() { - String ptrValue = StereotypeUtil.isApplied(selectedParameter, Ptr.class) ? "*" : ""; - if (!docPtr.get().equals(ptrValue)) { - return true; - } - - String refValue = StereotypeUtil.isApplied(selectedParameter, Ref.class) ? "&" : ""; - if (!docRef.get().equals(refValue)) { - return true; - } - - String defaultValue = selectedParameter.getDefault(); - if (defaultValue == null) { - if (!docDefault.get().equals("")) { - return true; - } - } - else if (!docDefault.get().equals(defaultValue)) { - return true; - } - - String arrayValue = StereotypeUtil.isApplied(selectedParameter, Array.class) ? "[]" : ""; - if (!docArray.get().equals(arrayValue)) { - return true; - } - return false; - } - - @Override - protected void updateModel() { - - // Check button changes - CommandSupport.exec("C++ parameter update", new Runnable() { - - @Override - public void run() - { - checkConst(); - } - }); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPrimitiveTypePanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPrimitiveTypePanel.java deleted file mode 100644 index adee09cef57..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPrimitiveTypePanel.java +++ /dev/null @@ -1,167 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.panels; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.papyrus.C_Cpp.Typedef; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.papyrus.views.cpp.CommandSupport; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.PrimitiveType; -import org.eclipse.uml2.uml.util.UMLUtil; - - -/** - * Panel displayed when a PrimitiveType is selected - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public class CppPrimitiveTypePanel extends CppAbstractPanel { - - // document used by the viewer for definition of the type - @SuppressWarnings("unused") - private SourceViewer typeViewer; - - private Group typeGroup; - - private IDocument typeDocument; - - // Current selection - private PrimitiveType selectedPType; - - public CppPrimitiveTypePanel(Composite parent, int style) { - super(parent, style); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() - */ - @Override - public PrimitiveType getSelectedElement() { - return selectedPType; - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) - */ - @Override - public void setSelectedElement(Element newElement) { - super.setSelectedElement(newElement); - if (newElement instanceof PrimitiveType) { - this.selectedPType = (PrimitiveType) newElement; - } - else { - throw new RuntimeException("bad selection: " + newElement + " should be an uml2 PrimitiveType"); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContentHI() - */ - @Override - public Control createContent() { - - // ///////////////////////////////////////////////////////////////////// - // Create save reset buttons with superclass method - // ///////////////////////////////////////////////////////////////////// - createSaveResetButtons(); - - // ///////////////////////////////////////////////////////////////////// - // Type definition text area - // ///////////////////////////////////////////////////////////////////// - - typeDocument = createDocumentC(); - typeGroup = createGroup(this, "Type definition", buttonSave, null, true, 0, 0, true); - // Use CDT CEditor coloration - typeViewer = createViewerC(typeDocument, typeGroup); - - // ///////////////////////////////////////////////////////////////////// - - return this; - } - - /** - * Saves the include declarations for a 'PrimitiveType' - */ - @Override - public void save() { - if (selectedPType == null) { - /* Log.debug("saveBody : selectedOperation is null"); */ - } - else { - CommandSupport.exec("C++ primitive type save", new Runnable() { - - @Override - public void run() - { - if (typeDocument.get().equals("")) { - StereotypeUtil.unapply(selectedPType, Typedef.class); - } - else { - Typedef cppType = StereotypeUtil.applyApp(selectedPType, Typedef.class); - cppType.setDefinition(typeDocument.get()); - } - } - }); - } - } - - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() - */ - @Override - protected void refreshPanel() { - if (selectedPType != null) { - Typedef cppType = UMLUtil.getStereotypeApplication(selectedPType, Typedef.class); - typeDocument.set(cppType != null ? cppType.getDefinition() : ""); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() - */ - @Override - public void entryAction() { - super.entryAction(); - reset(); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#checkModifications() - */ - @Override - public boolean checkModifications() { - Typedef cppType = UMLUtil.getStereotypeApplication(selectedPType, Typedef.class); - String typeInModel = cppType != null ? cppType.getDefinition() : ""; - if (!typeDocument.get().equals(typeInModel)) { - return true; - } - return false; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPropertyPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPropertyPanel.java deleted file mode 100644 index 2d449799e6e..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPropertyPanel.java +++ /dev/null @@ -1,384 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ -package org.eclipse.papyrus.views.panels; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.papyrus.C_Cpp.Array; -import org.eclipse.papyrus.C_Cpp.Const; -import org.eclipse.papyrus.C_Cpp.Ptr; -import org.eclipse.papyrus.C_Cpp.Ref; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.papyrus.views.cpp.CommandSupport; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Property; - - -/** - * Panel displayed when a Property is selected - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public class CppPropertyPanel extends CppAbstractPanel { - - private Button isStatic; - - private Button isConst; - - private Property selectedProperty; - - // document used by the viewer - private IDocument docPtr; - - private IDocument docRef; - - private IDocument docArray; - - private IDocument docDefault; - - @SuppressWarnings("unused") - private SourceViewer viewerPtr; - - @SuppressWarnings("unused") - private SourceViewer viewerRef; - - @SuppressWarnings("unused") - private SourceViewer viewerArray; - - @SuppressWarnings("unused") - private SourceViewer viewerDefault; - - private Group groupPtr; - - private Group groupRef; - - private Group groupArray; - - private Group groupDefault; - - public CppPropertyPanel(Composite parent, int style) { - super(parent, style); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() - */ - @Override - public Property getSelectedElement() { - return selectedProperty; - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) - */ - @Override - public void setSelectedElement(Element newElement) { - super.setSelectedElement(newElement); - if (newElement instanceof Property) { - this.selectedProperty = (Property) newElement; - } - else { - throw new RuntimeException("bad selection: " + newElement + " should be an uml2 Property"); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() - */ - @Override - public Control createContent() { - // ///////////////////////////////////////////////////////////////////// - // Create save reset buttons with superclass method - // ///////////////////////////////////////////////////////////////////// - createSaveResetButtons(); - - // ///////////////////////////////////////////////////////////////////// - // Create checkboxes - // ///////////////////////////////////////////////////////////////////// - isStatic = createButton("isStatic", this, null); - isConst = createButton("isConst", this, isStatic); - - // ///////////////////////////////////////////////////////////////////// - // Add checkboxes listeners - // ///////////////////////////////////////////////////////////////////// - isStatic.addSelectionListener(new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - updateModel(); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - addStereotypeSelectionListener(isConst, "Const"); - - // ///////////////////////////////////////////////////////////////////// - // Pointer declaration - // ///////////////////////////////////////////////////////////////////// - docPtr = createDocument(); - groupPtr = createGroup( - this - , "Pointer declaration" - , buttonSave - , null - , false - , 0 - , 25 - , false); - - // Use CDT CEditor coloration - viewerPtr = createViewer(docPtr, groupPtr); - - // ///////////////////////////////////////////////////////////////////// - // Pointer declaration - // ///////////////////////////////////////////////////////////////////// - docRef = createDocument(); - groupRef = createGroup( - this - , "Reference declaration" - , buttonSave - , groupPtr - , false - , 0 - , 50 - , false); - - // Use CDT CEditor coloration - viewerRef = createViewer(docRef, groupRef); - - // ///////////////////////////////////////////////////////////////////// - // Pointer declaration - // ///////////////////////////////////////////////////////////////////// - docDefault = createDocument(); - groupDefault = createGroup( - this - , "Default value" - , buttonSave - , groupRef - , false - , 0 - , 75 - , false); - - // Use CDT CEditor coloration - viewerDefault = createViewer(docDefault, groupDefault); - - // ///////////////////////////////////////////////////////////////////// - // Pointer declaration - // ///////////////////////////////////////////////////////////////////// - docArray = createDocument(); - groupArray = createGroup( - this - , "Array value ([...])" - , buttonSave - , groupDefault - , true - , 0 - , 0 - , false); - - // Use CDT CEditor coloration - viewerArray = createViewer(docArray, groupArray); - - // ///////////////////////////////////////////////////////////////////// - // Return control - // ///////////////////////////////////////////////////////////////////// - - return this; - } - - /** - * Saves the body for an 'Property' - */ - @Override - public void save() - { - if (selectedProperty == null) { - /* Log.debug("saveBody : selectedProperty is null"); */ - } - else { - CommandSupport.exec("C++ package save", new Runnable() { - - @Override - public void run() - { - // Treat Pointer - String newPtr = docPtr.get(); - if (newPtr.equals("")) { - StereotypeUtil.unapply(selectedProperty, Ptr.class); - } - else { - StereotypeUtil.apply(selectedProperty, Ptr.class); - } - - // Treat Reference - String newRef = docRef.get(); - if (newRef.equals("")) { - StereotypeUtil.unapply(selectedProperty, Ref.class); - } - else { - StereotypeUtil.apply(selectedProperty, Ref.class); - } - - // Treat DefaultValue - // need common class for facilitating this - // selectedParameter.setDefaultValue(selectedParameter.createDefaultValue("default", selectedParameter.getType(), null); - - // Treat Array - String newArray = docArray.get(); - if (newArray.equals("")) { - StereotypeUtil.unapply(selectedProperty, Array.class); - } - else { - StereotypeUtil.apply(selectedProperty, Array.class); - } - } - }); - } - - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() - */ - @Override - protected void refreshPanel() { - if (selectedProperty == null) { - /* Log.debug("resetBody : selectedProperty is null"); */ - } - else { - isStatic.setSelection(selectedProperty.isStatic()); - isConst.setSelection(StereotypeUtil.isApplied(selectedProperty, Const.class)); - docPtr.set(StereotypeUtil.isApplied(selectedProperty, Ptr.class) ? "*" : ""); - docRef.set(StereotypeUtil.isApplied(selectedProperty, Ref.class) ? "&" : ""); - docDefault.set(selectedProperty.getDefault()); - docArray.set(StereotypeUtil.isApplied(selectedProperty, Array.class) ? "[]" : ""); - } - } - - /** - * Called when the static checkbox is modified - */ - protected void checkStatic() { - - boolean boxState = isStatic.getSelection(); - - selectedProperty.setIsStatic(boxState); - } - - /** - * Called when the const checkbox is modified - */ - protected void checkConst() { - boolean boxState = isConst.getSelection(); - - if (StereotypeUtil.isApplied(selectedProperty, Const.class) != boxState) { - if (boxState) { - StereotypeUtil.apply(selectedProperty, Const.class); - } - else { - StereotypeUtil.unapply(selectedProperty, Const.class); - } - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() - */ - @Override - public void entryAction() { - super.entryAction(); - reset(); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#exitAction() - */ - @Override - public void exitAction() { - super.exitAction(); - } - - /** - * Checks if the content of the panel is different to the model - *

- * This is a read only operation - * - * @return true if one of the element of the model is not up-to-date - * with the content of the panel - */ - @Override - public boolean checkModifications() { - String ptrValue = StereotypeUtil.isApplied(selectedProperty, Ptr.class) ? "*" : ""; - if (!docPtr.get().equals(ptrValue)) { - return true; - } - - String refValue = StereotypeUtil.isApplied(selectedProperty, Ref.class) ? "&" : ""; - if (!docRef.get().equals(refValue)) { - return true; - } - - String defaultValue = selectedProperty.getDefault(); - if (defaultValue == null) { - if (!docDefault.get().equals("")) { - return true; - } - } - else if (!docDefault.get().equals(defaultValue)) { - return true; - } - - String arrayValue = StereotypeUtil.isApplied(selectedProperty, Array.class) ? "[]" : ""; - if (!docArray.get().equals(arrayValue)) { - return true; - } - return false; - - } - - - @Override - protected void updateModel() - { - CommandSupport.exec("C++ property save", new Runnable() { - - @Override - public void run() - { - // Check button changes - checkStatic(); - checkConst(); - - } - }); - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateBindingPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateBindingPanel.java deleted file mode 100644 index ff62c9613f1..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateBindingPanel.java +++ /dev/null @@ -1,178 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.panels; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.papyrus.views.cpp.CommandSupport; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.util.UMLUtil; - - -/** - * Panel displayed when a TemplateBinding is selected - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public class CppTemplateBindingPanel extends CppAbstractPanel { - - private TemplateBinding selectedTB; - - // document used by the viewer - private IDocument docBinding; - - @SuppressWarnings("unused") - private SourceViewer viewerBinding; - - private Group groupBinding; - - public CppTemplateBindingPanel(Composite parent, int style) { - super(parent, style); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() - */ - @Override - public TemplateBinding getSelectedElement() { - return selectedTB; - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) - */ - @Override - public void setSelectedElement(Element newElement) { - super.setSelectedElement(newElement); - if (newElement instanceof TemplateBinding) { - this.selectedTB = (TemplateBinding) newElement; - } - else { - throw new RuntimeException("bad selection: " + newElement + " should be an uml2 TemplateBinding"); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() - */ - @Override - public Control createContent() { - - // ///////////////////////////////////////////////////////////////////// - // Create save reset buttons with superclass method - // ///////////////////////////////////////////////////////////////////// - createSaveResetButtons(); - - // ///////////////////////////////////////////////////////////////////// - // Body - // ///////////////////////////////////////////////////////////////////// - - docBinding = createDocumentC(); - groupBinding = createGroup( - this - , "Binding declaration (<...>)" - , groupBinding - , null - , true - , 0 - , 0 - , true); - // Use CDT CEditor coloration - viewerBinding = createViewerC(docBinding, groupBinding); - - // ///////////////////////////////////////////////////////////////////// - - return this; - } - - /** - * Saves the body for an 'TemplateBinding' - */ - @Override - public void save() - { - if (selectedTB == null) { - /* Log.debug("saveBody : selectedTemplateBinding is null"); */ - } - else { - CommandSupport.exec("C++ template binding save", new Runnable() { - - @Override - public void run() - { - // Treat Pointer - String newB = docBinding.get(); - if (newB.equals("")) { - StereotypeUtil.unapply(selectedTB, TemplateBinding.class); - } else { - org.eclipse.papyrus.C_Cpp.TemplateBinding templateBinding = StereotypeUtil.applyApp(selectedTB, org.eclipse.papyrus.C_Cpp.TemplateBinding.class); - // TODO: use UML template bindings? - templateBinding.setBinding(newB); - } - } - }); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() - */ - @Override - protected void refreshPanel() { - if (selectedTB != null) { - org.eclipse.papyrus.C_Cpp.TemplateBinding templateBinding = UMLUtil.getStereotypeApplication(selectedTB, org.eclipse.papyrus.C_Cpp.TemplateBinding.class); - // TODO: use UML template bindings? - docBinding.set(templateBinding != null ? templateBinding.getBinding() : ""); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#entryAction() - */ - @Override - public void entryAction() { - super.entryAction(); - reset(); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#checkModifications() - */ - @Override - public boolean checkModifications() { - org.eclipse.papyrus.C_Cpp.TemplateBinding templateBinding = UMLUtil.getStereotypeApplication(selectedTB, org.eclipse.papyrus.C_Cpp.TemplateBinding.class); - // TODO: use UML template bindings? - String bindingValue = templateBinding != null ? templateBinding.getBinding() : ""; - if (!docBinding.get().equals(bindingValue)) { - return true; - } - return false; - - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateParameterPanel.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateParameterPanel.java deleted file mode 100644 index 4726c644d03..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateParameterPanel.java +++ /dev/null @@ -1,181 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.panels; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.papyrus.views.cpp.CommandSupport; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.TemplateParameter; -import org.eclipse.uml2.uml.util.UMLUtil; - - -/** - * Panel displayed when a TemplateParameter is selected - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public class CppTemplateParameterPanel extends CppAbstractPanel { - - private TemplateParameter selectedTP; - - // document used by the viewer - @SuppressWarnings("unused") - private SourceViewer viewerParameter; - - private Group groupParameter; - - private IDocument docParameter; - - public CppTemplateParameterPanel(Composite parent, int style) { - super(parent, style); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() - */ - @Override - public TemplateParameter getSelectedElement() { - return selectedTP; - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) - */ - @Override - public void setSelectedElement(Element newElement) { - super.setSelectedElement(newElement); - if (newElement instanceof TemplateParameter) { - this.selectedTP = (TemplateParameter) newElement; - } - else { - throw new RuntimeException("bad selection: " + newElement + " should be an uml2 TemplateParameter"); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() - */ - @Override - public Control createContent() { - - // ///////////////////////////////////////////////////////////////////// - // Create save reset buttons with superclass method - // ///////////////////////////////////////////////////////////////////// - createSaveResetButtons(); - - // ///////////////////////////////////////////////////////////////////// - // TemplateParameter declaration - // ///////////////////////////////////////////////////////////////////// - docParameter = createDocumentC(); - groupParameter = createGroup( - this - , "Parameter name" - , buttonSave - , null - , true - , 0 - , 0 - , true); - // Use CDT CEditor coloration - viewerParameter = createViewerC(docParameter, groupParameter); - - // ///////////////////////////////////////////////////////////////////// - // Return control on this composite - // ///////////////////////////////////////////////////////////////////// - - return this; - } - - /** - * Saves the body for an 'Property' - */ - @Override - public void save() - { - if (selectedTP == null) { - /* Log.debug("saveBody : selectedProperty is null"); */ - } - else { - CommandSupport.exec("C++ template parameter save", new Runnable() { - - @Override - public void run() - { - // Treat Parameter name - String newB = docParameter.get(); - if (newB.equals("")) { - StereotypeUtil.unapply(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class); - } - else { - org.eclipse.papyrus.C_Cpp.TemplateParameter templateParameter = StereotypeUtil.applyApp(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class); - templateParameter.setName(newB); - } - } - }); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() - */ - @Override - protected void refreshPanel() { - if (selectedTP == null) { - /* Log.debug("resetBody : selectedProperty is null"); */ - } else { - - org.eclipse.papyrus.C_Cpp.TemplateParameter templateParameter = UMLUtil.getStereotypeApplication(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class); - String parameterName = templateParameter != null ? templateParameter.getName() : ""; - docParameter.set(parameterName); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#entryAction() - */ - @Override - public void entryAction() { - super.entryAction(); - reset(); - } - - /* - * (non-Javadoc) - * - * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#checkModifications() - */ - @Override - public boolean checkModifications() { - org.eclipse.papyrus.C_Cpp.TemplateParameter templateParameter = UMLUtil.getStereotypeApplication(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class); - // TODO: use UML template bindings? - String parameterName = templateParameter != null ? templateParameter.getName() : ""; - if (!docParameter.get().equals(parameterName)) { - return true; - } - return false; - } -} diff --git a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/PanelFactory.java b/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/PanelFactory.java deleted file mode 100644 index ae12cb171da..00000000000 --- a/extraplugins/codegen/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/PanelFactory.java +++ /dev/null @@ -1,144 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 - 2007 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.views.panels; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.OpaqueBehavior; -import org.eclipse.uml2.uml.Transition; -import org.eclipse.uml2.uml.UMLPackage; - - -/** - * Factory that creates panel given element type. - * @deprecated This view will be replaced by an XWT view for the C++ profile - */ -@Deprecated -public class PanelFactory { - - /** Singleton instance for this factory */ - public static PanelFactory eINSTANCE = new PanelFactory(); - - /** - * Default constructor (private visibility for singleton pattern) - */ - protected PanelFactory() { - } - - /** - * Creates a panel for the given object. The object should be an {@link Element}. If not, - * it returns a default panel. - * - * @param parent - * the composite parent for the new panel - * @param style - * the SWT style of the panel - * @param object - * the object for which the panel is created - * @return the newly created panel - */ - public CppAbstractPanel createPanel(Composite parent, int style, Object object) { - CppAbstractPanel panel; - if (object instanceof Element) { - panel = createPanel(parent, style, (Element) object); - } else { - panel = createPanel(parent, style, null); - } - return panel; - } - - /** - * Creates a panel for the given element. - * - * @param parent - * the composite parent for the new panel - * @param style - * the SWT style of the panel - * @param element - * the UML2 element for which the panel is created - * @return the newly created panel - */ - public CppAbstractPanel createPanel(Composite parent, int style, Element element) { - CppAbstractPanel panel = null; - int metaclassID = -1; // -1 => default case - if (element instanceof Transition) { - // navigate from transition to effect, if it exists (and has an opaque behavior) - Behavior effect = ((Transition) element).getEffect(); - if (effect instanceof OpaqueBehavior) { - element = effect; - } - } - if (element != null) { - metaclassID = element.eClass().getClassifierID(); - } - - switch (metaclassID) { - - case UMLPackage.OPERATION: - panel = new CppOperationPanel(parent, style); - break; - - case UMLPackage.OPAQUE_BEHAVIOR: - panel = new CppBehaviorPanel(parent, style); - break; - - case UMLPackage.CLASS: - panel = new CppClassPanel(parent, style); - break; - - case UMLPackage.PACKAGE: - panel = new CppPackagePanel(parent, style); - break; - - case UMLPackage.MODEL: - panel = new CppPackagePanel(parent, style); - break; - - case UMLPackage.PRIMITIVE_TYPE: - panel = new CppPrimitiveTypePanel(parent, style); - break; - - // same panel for property and its child elements - case UMLPackage.PROPERTY: - case UMLPackage.EXTENSION_END: - case UMLPackage.PORT: - panel = new CppPropertyPanel(parent, style); - break; - - case UMLPackage.PARAMETER: - panel = new CppParameterPanel(parent, style); - break; - - case UMLPackage.TEMPLATE_PARAMETER: - panel = new CppTemplateParameterPanel(parent, style); - break; - - case UMLPackage.TEMPLATE_BINDING: - panel = new CppTemplateBindingPanel(parent, style); - break; - - case UMLPackage.GENERALIZATION: - panel = new CppGeneralizationPanel(parent, style); - break; - - default: - panel = new CppDefaultPanel(parent, style); - break; - } - - panel.createContent(); - panel.setSelectedElement(element); - return panel; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java-updatesite/.project b/extraplugins/java/org.eclipse.papyrus.java-updatesite/.project deleted file mode 100644 index 0cc00efb223..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java-updatesite/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.papyrus.java-updatesite - - - - - - org.eclipse.pde.UpdateSiteBuilder - - - - - - org.eclipse.pde.UpdateSiteNature - - diff --git a/extraplugins/java/org.eclipse.papyrus.java-updatesite/site.xml b/extraplugins/java/org.eclipse.papyrus.java-updatesite/site.xml deleted file mode 100644 index 7ca05aad69a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java-updatesite/site.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - Java Classes generator. This feature allows to generate Java classes from Papyrus classes and packages. It also allows to generate projects. - - - - - This profile is used by the Java generator and the Java reverse to add additional properties to the UML model. These properties allows to change the names, specify project target, source targets, ... - - - - - Tools related to the Java language. This set of plugins allows to reverse java code to a Papyrus model, and to generate Java code from a Papyrus model. - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.classpath b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.project b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.project deleted file mode 100644 index 189ce3e8668..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.java.generator.jdtsynchronizer - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.core.prefs b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94d61f00da6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/META-INF/MANIFEST.MF b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/META-INF/MANIFEST.MF deleted file mode 100644 index 9c9e594967b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.uml2.uml, - org.eclipse.m2m.qvt.oml, - org.eclipse.papyrus.java.generator.metamodel.jdt;bundle-version="1.2.0", - org.eclipse.core.runtime, - org.eclipse.papyrus.java.generator.transfo.umltojdt;bundle-version="1.2.0", - org.eclipse.jdt.core, - org.eclipse.jface.text, - org.eclipse.jdt.launching, - org.eclipse.core.resources -Export-Package: org.eclipse.papyrus.java.generator.jdtsynchronizer -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.java.generator.jdtsynchronizer;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/about.html b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/build.properties b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/build.properties deleted file mode 100644 index 81e0fbf3cff..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - icons/,\ - about.html,\ - plugin.properties -src.includes = about.html diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generate.psd b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generate.psd deleted file mode 100644 index 9a555a938e1..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generate.psd and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generation.png b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generation.png deleted file mode 100644 index 6a55c438352..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generation.png and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/sample.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/sample.gif deleted file mode 100644 index 34fb3c9d8cb..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/sample.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/plugin.properties b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/plugin.properties deleted file mode 100644 index 41b9da94450..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/plugin.properties +++ /dev/null @@ -1,18 +0,0 @@ -################################################################################# -# Copyright (c) 2011 Nicolas Deblock & Manuel Giles. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation -# Manuel Giles giles.manu@live.fr - Initial API and implementation -# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception -# -################################################################################# - - -pluginName = Jdt Synchronizer (Incubation) -providerName = Eclipse Modeling Project diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/pom.xml b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/pom.xml deleted file mode 100644 index 54392113517..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.java.generator.jdtsynchronizer - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/GeneratorPreference.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/GeneratorPreference.java deleted file mode 100644 index 56af682c908..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/GeneratorPreference.java +++ /dev/null @@ -1,77 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.jdtsynchronizer; - -public interface GeneratorPreference { - - /** - * indicate if methods of inherits interfaces must be implement in a class - * - * @return - */ - public boolean implementMethodsOfIntefaces(); - - /** - * indicate if methods of inherit abstract class must be implement in a class - * - * @return - */ - public boolean implementMethodsOfAbstractClass(); - - /** - * indicate if getters must be create - * - * @return - */ - public boolean generateGetters(); - - /** - * indicate if setters must be create - * - * @return - */ - public boolean generateSetters(); - - /** - * indicate if a package must be generate - * - * @param packageQualifiedName - * package to generate - * @return - */ - public boolean isPackageToGenerate(String packageQualifiedName); - - /** - * - * @return generic class to use for the association * (multi-value) - */ - public String genericClassForMultiValue(); - - /** - * Return true if we want to stop on first error, false if we want to continue anyway. - * - * @return - */ - public boolean stopOnFirstError(); - - /** - * - * @return the default source folder name where the generator have to generate Java files and packages. - */ - public String defaultSourceFolderName(); - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/RunGenerator.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/RunGenerator.java deleted file mode 100644 index 4ff03a7e505..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/RunGenerator.java +++ /dev/null @@ -1,228 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.jdtsynchronizer; - -import java.io.File; -import java.io.FileNotFoundException; -import java.util.List; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.URIConverter; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; -import org.eclipse.m2m.qvt.oml.BasicModelExtent; -import org.eclipse.m2m.qvt.oml.ExecutionContextImpl; -import org.eclipse.m2m.qvt.oml.ExecutionDiagnostic; -import org.eclipse.m2m.qvt.oml.ModelExtent; -import org.eclipse.m2m.qvt.oml.TransformationExecutor; -import org.eclipse.papyrus.java.generator.jdtsynchronizer.impl.SynchJDTJavaModel; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; -import org.eclipse.papyrus.java.generator.transfo.umltojdt.UmltojdtActivator; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.resource.UMLResource; - -/** - * Class to Run the QVT Transformation, and then the Java generation - */ -public class RunGenerator { - - /** - * This is the metamodele - */ - private EList inObjects; - - /** - * Constructor of RunGenerator using .uml file - * - * @param UMLFileUrl - * the '.uml' file's url - * @throws FileNotFoundException - */ - public RunGenerator(String umlFileUrl) throws FileNotFoundException { - - // charge the model of the '.uml' file - inObjects = loadUmlModel(umlFileUrl); - } - - /** - * Constructor of RunGenerator using EList metamodel - * - * @param UMLFileUrl - * the '.uml' file's url - */ - public RunGenerator(EList inObjects) { - this.inObjects = inObjects; - } - - /** - * run code generation using QVTo transformation - * - * @throws JDTVisitorException - */ - public void runGeneration(GeneratorPreference preference) throws JDTVisitorException { - // Create an options model using the Eclipse Preferences - EList inOptions = createOptionModelFromEclipsePreferences(preference); - - // Refer to an existing transformation via URI - final URI scriptUri = - URI.createURI("platform:/plugin/" + UmltojdtActivator.PLUGIN_ID + UmltojdtActivator.PATH_QVT_FILE); - - List outObjects = runTransformation(scriptUri, inObjects, inOptions); - - if (outObjects.size() == 0) { - throw new JDTVisitorException("No classes or packages produced from the transformation. Nothing is generated."); - } - - if (outObjects.size() > 1) { - System.err.println("Warning, JDT modele has more than one root. Found root:"); - for (EObject el : outObjects) { - System.err.println(((JDTJavaElement) el).getElementName()); - } - System.err.println("-------"); - } - - // finally, we synchronize the JDT model with org.eclipse.jdt.core - if (outObjects.size() > 0) { - /* - * TODO : if metamodel have some root node, we make a loop - * JDTJavaElement proj = (JDTJavaElement) outObjects.get(0); - * - * JDTVisitor visitor = new SynchJDTJavaModel(); - * proj.accept(visitor); - */ - for (Object o : outObjects) { - if (o instanceof JDTJavaModel) { - JDTJavaElement proj = (JDTJavaElement) o; - JDTVisitor visitor = new SynchJDTJavaModel(preference); - proj.accept(visitor); - } - - } - } - } - - /** - * Create a new GeneratorOptions model and inject eclipse preferences on it. - * - * @param preference - * eclipse preferences - * @return a new instance of Options, where options.defaultSourceFolder have been initialized. - */ - private EList createOptionModelFromEclipsePreferences(GeneratorPreference preference) { - GeneratoroptionsmmFactory optionsFactory = GeneratoroptionsmmFactory.eINSTANCE; - - // Create a new Options object and inject the default source folder name from Eclipse preferences - Options options = optionsFactory.createOptions(); - options.setDefaultSourceFolder(preference.defaultSourceFolderName()); - - // Add options to the model - EList optionsContents = new BasicEList(1); - optionsContents.add(options); - - return optionsContents; - } - - /** - * Run QVTo transformation using the scriptUri and the inObjects model - * - * @param scriptUri - * The script QVTo - * @param inObjects - * The entry model - * @param inOptions2 - * @return The output model - */ - private List runTransformation(URI scriptUri, EList inObjects, EList inOptions) { - // initialize the transformation - // First, you need to instantiate a Registry: - EPackage.Registry registry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE); - - // which is used to register the meta-models in E:\workspace\modelesUML\org.eclipse.papyrus.java.javagen.mmJDT\metaModel - - JdtmmPackage mm1 = JdtmmPackage.eINSTANCE; - registry.put(mm1.getNsURI(), mm1); - - // class which allow to execute the transformation - TransformationExecutor t = new TransformationExecutor(scriptUri, registry); - ExecutionContextImpl executionContext = new ExecutionContextImpl(); - - // allow to contains the model uml - ModelExtent input = new BasicModelExtent(inObjects); - ModelExtent inputOptions = new BasicModelExtent(inOptions); - ModelExtent output = new BasicModelExtent(); - // make the transformation - ExecutionDiagnostic executionDiagnostic = t.execute(executionContext, input, inputOptions, output); - - // the errors - System.out.println(executionDiagnostic.getMessage()); - for (Diagnostic d : executionDiagnostic.getChildren()) { - System.out.println(d.getMessage()); - } - - - // we take the out JDT model in a list - return output.getContents(); - } - - - /** - * Allow to charge the uml model in a list - * - * @param url - * the '.uml' file's url - * @return the charge model - * @throws FileNotFoundException - */ - private EList loadUmlModel(String url) throws FileNotFoundException { - - ResourceSet resourceSet = new ResourceSetImpl(); - - // charge the metamodel util for read the model - resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE); - resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE); - // Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "uml", new UMLResourceFactoryImpl()); - - Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl()); - URIConverter.URI_MAP.put(URI.createURI("pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml"), URI.createFileURI(System.getProperty("user.dir") + "/Model_Libs/UMLPrimitiveTypes.library.uml")); - - // the '.uml' file's url - File file = new File(url); - if (!file.exists()) { - throw new FileNotFoundException("File " + new File(url).getAbsolutePath() + " not found"); - } - URI fileURI = URI.createFileURI(new File(url).getAbsolutePath()); - - // demand load the resource for this file. - Resource resource = resourceSet.getResource(fileURI, true); - - return resource.getContents(); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCommentable.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCommentable.java deleted file mode 100644 index 5a196a155b0..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCommentable.java +++ /dev/null @@ -1,161 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; - -import java.util.List; - -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.dom.AST; -import org.eclipse.jdt.core.dom.ASTParser; -import org.eclipse.jdt.core.dom.BodyDeclaration; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.Javadoc; -import org.eclipse.jdt.core.dom.TagElement; -import org.eclipse.jdt.core.dom.TextElement; -import org.eclipse.jdt.core.dom.TypeDeclaration; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.Document; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; -import org.eclipse.text.edits.MalformedTreeException; -import org.eclipse.text.edits.TextEdit; - -/** - * Useful for class who have to generate Javadoc comment. - * - * @author Deblock Nicolas & Manuel Giles - * - */ -public abstract class SynchJDTCommentable implements JDTVisitor { - - - /** - * search the element to insert the Javadoc in compilation unit - * - * @param cu - * @param typeName - * @return - */ - protected abstract BodyDeclaration searchElementToInsert(CompilationUnit cu, IJavaElement elementName); - - /** - * return javaDoc tag to add. Call in function createJavaDocFor() - * - * @return javaDoc tag to add in a List with String = "@tag comment" - */ - protected abstract List getJavadocTags(); - - /** - * Reads a ICompilationUnit and creates the AST DOM for manipulating the - * Java source file - * - * @param unit - * @return - */ - private static CompilationUnit parse(ICompilationUnit unit) { - ASTParser parser = ASTParser.newParser(AST.JLS3); - parser.setKind(ASTParser.K_COMPILATION_UNIT); - parser.setSource(unit); - parser.setResolveBindings(true); - return (CompilationUnit) parser.createAST(null); // parse - } - - - /** - * Create a JavaDoc for a a objet who extends IJavaElement and IMethod - * (IType or IMethod by example) - * - * @param ielement - * the element you want add javadoc - * @param icu - * the compilation unit of ielement - * @param comment - * body of the comment - * @param auteur - * author of the compilation unit - * @throws JavaModelException - * @throws BadLocationException - * @throws MalformedTreeException - */ - protected void createJavaDocFor(U ielement, ICompilationUnit icu, String comment, String author) throws JavaModelException, MalformedTreeException, BadLocationException { - - CompilationUnit cu = parse(icu); - // Authorize modification - cu.recordModifications(); - // create document - Document document = new Document(icu.getBuffer().getContents()); - - // Creating the new JavaDoc node - AST ast = cu.getAST(); - Javadoc jc = ast.newJavadoc(); - - TagElement tag = ast.newTagElement(); - if (comment != null) { - TextElement te = ast.newTextElement(); - tag.fragments().add(te); - te.setText(comment); - } - jc.tags().add(tag); - - List javadocTags = getJavadocTags(); - if (javadocTags != null) { - for (String s : javadocTags) { - tag = ast.newTagElement(); - tag.setTagName(s); - jc.tags().add(tag); - } - } - // add javadoc to type - BodyDeclaration classType = searchElementToInsert(cu, ielement); - if (classType != null) { - classType.setJavadoc(jc); - } - - // Applying changes - TextEdit text = cu.rewrite(document, icu.getJavaProject().getOptions(true)); - text.apply(document); - - // set buffer of compilation unit - icu.getBuffer().setContents(document.get()); - - } - - /** - * search type in type declaration - * - * @param classType - * type declaration - * @param typeName - * typeName type name research - * @return - */ - protected TypeDeclaration searchType(TypeDeclaration classType, String typeName) { - if (classType.getName().toString().equals(typeName)) { - return classType; - } - - for (Object objct : classType.getTypes()) { - TypeDeclaration ct = (TypeDeclaration) objct; - if (ct.getName().toString().equals(typeName)) { - return ct; - } - searchType(ct, typeName); - } - return null; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCompilationUnit.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCompilationUnit.java deleted file mode 100644 index 1e6f34fb515..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCompilationUnit.java +++ /dev/null @@ -1,95 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; - -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; - -/** - * Allow to generate compilation Unit - * - * @author Deblock Nicolas & Manuel Giles - * - */ -public class SynchJDTCompilationUnit extends EObjectImpl implements JDTVisitor { - - private IPackageFragment ipack; - - private GeneratorPreference preference; - - /** - * Constructor - * - * @param ipack - * the IPackageFragment parent - */ - public SynchJDTCompilationUnit(IPackageFragment ipack, GeneratorPreference preference) { - super(); - this.ipack = ipack; - this.preference = preference; - } - - @Override - public void visit(JDTJavaElement element) throws JDTVisitorException { - // if element can't be generated, we stop all - if (!element.isGenerated()) { - return; - } - if (SynchTools.isPrimiveType(element.getElementName()) && !element.getElementName().equals("String")) { - return; - } - - JDTCompilationUnit cu = (JDTCompilationUnit) element; - try { - ICompilationUnit icu = SynchTools.searchIJavaElement(ipack.getCompilationUnits(), cu.getElementName() + ".java"); - - if (icu == null) { - icu = ipack.createCompilationUnit(cu.getElementName() + ".java", "", true, null); - if (!ipack.getElementName().equals(IPackageFragment.DEFAULT_PACKAGE_NAME)) { - icu.createPackageDeclaration(ipack.getElementName(), null); - } - } - - // call the children JDTType - JDTVisitor visitor = new SynchJDTType(icu, preference); - - for (JDTType type : cu.getTypes()) { - type.accept(visitor); - } - - // save the compilation unit - icu.save(null, true); - } catch (JavaModelException e) { - e.printStackTrace(); - throw new JDTVisitorException(e.getMessage(), e.getCause()); - } catch (Exception e) { - e.printStackTrace(); - throw new JDTVisitorException(e.getMessage(), e.getCause()); - } - - - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTField.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTField.java deleted file mode 100644 index 485ef9ce603..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTField.java +++ /dev/null @@ -1,217 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; - -import java.util.List; - -import org.eclipse.jdt.core.IField; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.dom.BodyDeclaration; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.FieldDeclaration; -import org.eclipse.jdt.core.dom.TypeDeclaration; -import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; - -/** - * Allow to generate field in a type - * - * @author Deblock Nicolas & Manuel Giles - * - */ -public class SynchJDTField extends SynchJDTCommentable { - - private IType itype; - - private JDTField field; - - private GeneratorPreference preference; - - /** - * Constructor - * - * @param itype - * the type parent - */ - public SynchJDTField(IType itype, GeneratorPreference preference) { - super(); - this.itype = itype; - this.preference = preference; - } - - @Override - public void visit(JDTJavaElement element) throws JDTVisitorException { - // if element can't be generated, we stop all - if (!element.isGenerated()) { - return; - } - - field = (JDTField) element; - - StringBuffer buffer = new StringBuffer(); - try { - IField ifield = SynchTools.searchIJavaElement(itype.getFields(), field.getElementName()); - if (ifield == null && field.getType() != null) { - // first : find the import package - // create import when it's not a primitive type - SynchTools.createImport(itype, field.getOwner(), field.getType()); - - - // visibility - buffer.append("\n" + SynchTools.getVisibility(field).toString()); - - // // if it's an association * - if (field.isMultiValued()) { - buffer.append(SynchTools.getMultiValued(itype, field.getType().getElementName(), preference)); - } else { - buffer.append(field.getType().getElementName()); - } - - - // create type - buffer.append(" " + field.getElementName()); - - if (field.getValue() != null) { - buffer.append(" = "); - if (field.getType().getElementName().equals("char")) { - buffer.append("'" + field.getValue().toString() + "'"); - } else if (field.getType().getElementName().equals("String")) { - buffer.append("\"" + field.getValue().toString() + "\""); - } else { - buffer.append(field.getValue().toString()); - } - } - - buffer.append(";"); - - // create type - ifield = itype.createField(buffer.toString(), null, true, null); - - // add javadoc to method - createJavaDocFor(ifield, ifield.getCompilationUnit(), field.getComment(), ""); - } - else if (field.getType() == null) { - System.err.println("No type specified for " - + field.getOwner().getQualifiedName() - + "." + field.getElementName()); - } - - - // Generate explicit imports - generateExplicitImports(field, itype); - - } catch (JavaModelException e) { - // e.printStackTrace(); - String msg = "Can't generate field (class='" - + field.getOwner().getQualifiedName() - + "', msg= " + e.getMessage() - + ", buffer=" + buffer.toString() - + ")"; - // System.err.println(msg); - // throw new JDTVisitorException( msg, e.getCause()); - propagateException(msg, e); - } catch (Exception e) { - // e.printStackTrace(); - // throw new JDTVisitorException(e.getMessage(), e.getCause()); - propagateException(e.getMessage(), e); - } - } - - /** - * Propagate a {@link JDTVisitorException} if the flag is not set - * - * @param msg - * @param e - * @throws JDTVisitorException - */ - private void propagateException(String msg, Throwable e) throws JDTVisitorException { - - if (preference.stopOnFirstError()) { - throw new JDTVisitorException(msg, e.getCause()); - } - else { - // Show error - System.err.println(msg); - e.printStackTrace(); - } - } - - @Override - protected BodyDeclaration searchElementToInsert(CompilationUnit cu, - IJavaElement field) { - - // search Itype parent - if (field.getParent() instanceof IType) { - IType itype = (IType) field.getParent(); - // find the good type - TypeDeclaration type = searchType((TypeDeclaration) cu.types().get(0), itype.getElementName()); - - // search the method. Fortunately, there are no method getSignature() for the type FieldDeclaration. - // So, we search manually - for (FieldDeclaration fs : type.getFields()) { - if (fs.toString().contains((field.getElementName()))) { - return fs; - } - } - } - return null; - } - - @Override - protected List getJavadocTags() { - // any javadoc tag - return null; - } - - /** - * Generate imports that are explicitly declared in the type - * - * @param field2 - * The src type to be transformed - * @param destType - * The jdt dest type to be generated - * @throws JavaModelException - * @throws JDTVisitorException - */ - private void generateExplicitImports(JDTField field2, IType destType) throws JDTVisitorException { - - - // Add explicit type - for (JDTType anImport : field2.getExplicitRequiredImports()) { - try { - destType.getCompilationUnit().createImport(anImport.getQualifiedName(), null, null); - } catch (Exception e) { - propagateException(destType.getFullyQualifiedName() + "Can't add explicit import " + anImport.getQualifiedName(), e); - } - } - - // Add explicit plain text types - for (String anImport : field2.getExplicitPlainTextRequiredImports()) { - try { - destType.getCompilationUnit().createImport(anImport, null, null); - } catch (JavaModelException e) { - propagateException(destType.getFullyQualifiedName() + "Can't add explicit plain text import " + anImport, e); - } - } - - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTGetterSetter.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTGetterSetter.java deleted file mode 100644 index b1939423c7c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTGetterSetter.java +++ /dev/null @@ -1,168 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; - -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IMethod; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.dom.BodyDeclaration; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.MethodDeclaration; -import org.eclipse.jdt.core.dom.TypeDeclaration; -import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; - -public class SynchJDTGetterSetter extends SynchJDTMethod { - - private JDTField field; - - private GeneratorPreference preference; - - public SynchJDTGetterSetter(IType it, GeneratorPreference preference) { - super(it, preference); - this.preference = preference; - } - - - @Override - public void visit(JDTJavaElement element) throws JDTVisitorException { - this.field = (JDTField) element; - // error if field.getType() == null. indicate in console only - if (field.getType() == null) { - System.err.println("l31 SunchJDTGetterSetter : field.getType() est null pour " + field.getElementName() + " dans " + field.getOwner().getElementName()); - return; - } - - - try { - // name of field - String fieldNameCap = field.getElementName().replaceFirst(".", (field.getElementName().charAt(0) + "").toUpperCase()); - - // generate getter - if (field.getGenerateGetter() == TrueFalseDefault.TRUE || // user demand generate getter - field.getGenerateGetter() == TrueFalseDefault.DEFAULT && preference.generateGetters()) { // or no demand, look at preferences - StringBuffer bufferGet = new StringBuffer(); - - bufferGet.append("public "); - - // handle MultiValued - if (field.isMultiValued()) { - bufferGet.append(SynchTools.getMultiValued(itype, field.getType().getElementName(), preference)); - } else { - bufferGet.append(field.getType().getElementName()); - } - - - bufferGet.append(" get" + fieldNameCap + "() {\n " - + "\t return " + field.getElementName() + "; \n} \n"); - - - - - IMethod imethod = SynchTools.searchIJavaElement(itype.getMethods(), "get" + fieldNameCap); - if (imethod == null) { - IMethod methodGet = itype.createMethod(bufferGet.toString(), null, true, null); - createJavaDocFor(methodGet, itype.getCompilationUnit(), "Getter of " + field.getElementName(), ""); - } - } - - - // generate setter - if (field.getGenerateSetter() == TrueFalseDefault.TRUE || // user demand generate setter - field.getGenerateSetter() == TrueFalseDefault.DEFAULT && preference.generateSetters()) { // or no demand, look at preferences - StringBuffer bufferSet = new StringBuffer(); - - bufferSet.append("public void set" + fieldNameCap + "("); - - // handle MultiValued - if (field.isMultiValued()) { - bufferSet.append(SynchTools.getMultiValued(itype, field.getType().getElementName(), preference)); - } else { - bufferSet.append(field.getType().getElementName()); - } - - bufferSet.append(" " + field.getElementName() + ") { \n" - + "\t this." + field.getElementName() + " = " + field.getElementName() + "; \n} \n "); - - - - - IMethod imethod = SynchTools.searchIJavaElement(itype.getMethods(), "set" + fieldNameCap); - if (imethod == null) { - IMethod methodSet = itype.createMethod(bufferSet.toString(), null, true, null); - createJavaDocFor(methodSet, itype.getCompilationUnit(), "Setter of " + field.getElementName(), ""); - } - } - } catch (JavaModelException e) { - e.printStackTrace(); - throw new JDTVisitorException(e.getMessage(), e.getCause()); - } catch (Exception e) { - e.printStackTrace(); - throw new JDTVisitorException(e.getMessage(), e.getCause()); - } - } - - - @Override - // search the method to insert Javadoc - protected BodyDeclaration searchElementToInsert(CompilationUnit cu, - IJavaElement method) { - - // search Itype parent - if (method.getParent() instanceof IType) { - IType itype = (IType) method.getParent(); - // find the good type - TypeDeclaration type = searchType((TypeDeclaration) cu.types().get(0), itype.getElementName()); - - // search the method. Fortunately, there are no method getSignature() for the type MethodDeclaration. - // So, we search manually - for (MethodDeclaration m : type.getMethods()) { - if (m.getName().toString().equals(method.getElementName())) { - // verify the signature - return m; - /* - * TODO - * if(m.parameters() !=null && m.parameters().size() == 0 && this.method.getParameters().size() == 0) - * return m; - * if(m.parameters().size() == this.method.getParameters().size()) { - * int numParam = 0; - * boolean goodSignature = true; - * for(Object paramObj : m.parameters()) { - * if(paramObj instanceof SingleVariableDeclaration) { - * SingleVariableDeclaration param = (SingleVariableDeclaration) paramObj; - * if(!param.getType().toString().equals(this.method.getParameters().get(numParam).getType().getElementName())) - * goodSignature = false; - * - * numParam++; - * } - * } - * if(goodSignature) - * return m; - * } - */ - } - } - } - - return null; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaModel.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaModel.java deleted file mode 100644 index 7dc71d9ccef..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaModel.java +++ /dev/null @@ -1,73 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; - - -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jdt.core.IJavaModel; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; - -/** - * Allow to generate Code thanks to a JDT model - * - * @author Deblock Nicolas & Manuel Giles - * - */ -public class SynchJDTJavaModel implements JDTVisitor { - - private GeneratorPreference preference; - - /** - * Constructor - * - * @param modelJDT - * the model JDT to generate - */ - public SynchJDTJavaModel(GeneratorPreference preference) { - this.preference = preference; - } - - @Override - public void visit(JDTJavaElement element) throws JDTVisitorException { - // if element can't be generated, we stop all - // if(!element.isGenerated()) return ; - - if (!(element instanceof JDTJavaModel)) { - return; - } - // cast element to JDTJavaModel - JDTJavaModel model = (JDTJavaModel) element; - - // research the IJavaModel - IWorkspaceRoot iroot = ResourcesPlugin.getWorkspace().getRoot(); - IJavaModel ijm = JavaCore.create(iroot); - - - // browse all JDTJavaProject and call the visit - JDTVisitor visitor = new SynchJDTJavaProject(ijm, iroot, preference); - for (JDTJavaProject root : model.getJavaProject()) { - root.accept(visitor); - } - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaProject.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaProject.java deleted file mode 100644 index fa545843b69..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaProject.java +++ /dev/null @@ -1,145 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaModel; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.launching.IVMInstall; -import org.eclipse.jdt.launching.JavaRuntime; -import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util.JdtmmPreference; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; - -/** - * Allow to generate Code thanks to a JDT model - * - * @author Deblock Nicolas & Manuel Giles - * - */ -public class SynchJDTJavaProject implements JDTVisitor { - - private IJavaModel ijm; - - private IWorkspaceRoot iroot; - - private GeneratorPreference preference; - - /** - * Constructor - * - * @param modelJDT - * the model JDT to generate - */ - public SynchJDTJavaProject(IJavaModel ijm, IWorkspaceRoot iroot, GeneratorPreference preference) { - this.ijm = ijm; - this.iroot = iroot; - this.preference = preference; - } - - - @Override - public void visit(JDTJavaElement element) throws JDTVisitorException { - // if element can't be generated, we stop all - if (!element.isGenerated()) { - return; - } - - if (!(element instanceof JDTJavaProject)) { - return; - } - // cast element to JDTJavaProject - JDTJavaProject project = (JDTJavaProject) element; - - // set the multi-value for the metamodel - JdtmmPreference.setClassMultiValue(preference.genericClassForMultiValue().substring(preference.genericClassForMultiValue().lastIndexOf(".") + 1)); - - - // search IJavaProject - // IProject projet = iroot.getProject(project.getElementName()); - IJavaProject ijavaProjet = ijm.getJavaProject(project.getElementName()); - IProject proj; - - // if ijavaProjet don't exist, create this! - if (!ijavaProjet.exists()) { - try { - proj = iroot.getProject(project.getElementName()); - if (!proj.exists()) { - proj.create(null); - proj.open(null); - } else if (!proj.isOpen()) { - proj.open(null); - } - - // Specifies type of project - IProjectDescription description = proj.getDescription(); - description.setNatureIds(new String[] { JavaCore.NATURE_ID }); - proj.setDescription(description, null); - } catch (CoreException e) { - e.printStackTrace(); - throw new JDTVisitorException(e.getMessage()); - } - - ijavaProjet = JavaCore.create(proj); - } - - // include the default JRE library if don't exist - List entries = new ArrayList(); - IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall(); - boolean creerJRE = true; - - - try { - // take libs to project class path - for (IClasspathEntry elem : ijavaProjet.getRawClasspath()) { - if (elem.getPath().toString().contains(JavaRuntime.JRE_CONTAINER)) { - creerJRE = false; - } - entries.add(elem); - } - // if jre don't exist, we add it to classpath - if (creerJRE) { - entries.add(JavaCore.newContainerEntry(JavaRuntime.newJREContainerPath(vmInstall))); - ijavaProjet.setRawClasspath(entries.toArray(new IClasspathEntry[entries.size()]), null); - } - } catch (JavaModelException e) { - e.printStackTrace(); - throw new JDTVisitorException(e.getMessage(), e.getCause()); - } - - - - // browse all PackageFragmentRoot and call the visit - JDTVisitor visitor = new SynchJDTPackageFragmentRoot(ijavaProjet, preference); - for (JDTPackageFragmentRoot root : project.getPackageFragmentRoots()) { - root.accept(visitor); - } - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTMethod.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTMethod.java deleted file mode 100644 index f7b07b36d9c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTMethod.java +++ /dev/null @@ -1,387 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; - - -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IMethod; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.dom.BodyDeclaration; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.MethodDeclaration; -import org.eclipse.jdt.core.dom.SingleVariableDeclaration; -import org.eclipse.jdt.core.dom.TagElement; -import org.eclipse.jdt.core.dom.TypeDeclaration; -import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; - - -/** - * Allow to generate Method in a IType - * - * @author Deblock Nicolas & Manuel Giles - * - */ -public class SynchJDTMethod extends SynchJDTCommentable { - - protected IType itype; - - private JDTMethod method; - - private GeneratorPreference preference; - - /** - * Constructor - * - * @param itype - * the type parent - */ - public SynchJDTMethod(IType itype, GeneratorPreference preference) { - super(); - this.itype = itype; - this.preference = preference; - } - - - - @Override - public void visit(JDTJavaElement element) throws JDTVisitorException { - // if element can't be generated, we stop all - if (!element.isGenerated()) { - return; - } - - method = (JDTMethod) element; - // IntroduceParameterObjectDescript - IMethod imethod = null; - - try { - // See if the method exist - boolean createMethod = true; - - for (IMethod m : itype.getMethods()) { - // if it's the same name, and the same parameterTypes, the method exist - if (m.getElementName().equals(method.getElementName()) && m.getSignature().equals(method.getJDTSignature())) { - // stop all - createMethod = false; - imethod = m; - break; - } - } - - if (createMethod) { - StringBuffer methodStr = new StringBuffer("\n"); - - // visibility - if (itype.isInterface()) { - methodStr.append("public "); - } else { - methodStr.append(SynchTools.getVisibility(method).toString()); - } - - // if method is a constructor, no return Type, and name is class name - if (method.isConstructor()) { - methodStr.append(itype.getElementName() + "("); - } - else { - // return type - if (method.getReturnType() != null) { - // Compute the type, taken into account multivalue - String type = getTypeAsString(method.getReturnType()); - // put the import package - SynchTools.createImport(itype, method.getOwner(), method.getReturnType().getType()); - - methodStr.append(type + " "); - } - else { - methodStr.append("void "); - } - // method name - methodStr.append(method.getElementName() + "("); - } - // parameters - // System.out.println(method.getParam() + " " + method.getParameterTypes()); - int nbParam = 0; - for (JDTParameter p : method.getParameters()) { - String typeName = p.getElementName(); - String type = "Undefined"; - if (p.getType() != null) { - // Compute the type, taken into account multivalue - type = getTypeAsString(p); - // put the import package - SynchTools.createImport(itype, method.getOwner(), p.getType()); - } - - - if (nbParam > 0) { - methodStr.append(", "); - } - methodStr.append(type + " " + typeName); - nbParam++; - } - - // close - methodStr.append(")"); - - // throws - if (method.getExceptions() != null && method.getExceptions().size() > 0) { - methodStr.append(" throws "); - int nbExc = 0; - for (JDTType exception : method.getExceptions()) { - if (nbExc > 0) { - methodStr.append(", "); - } - methodStr.append(exception.getElementName()); - if (!SynchTools.isPrimiveType(exception.getQualifiedName()) && exception.getQualifiedName().contains(".")) { - itype.getCompilationUnit().createImport(exception.getQualifiedName(), null, null); - } - nbExc++; - } - } - - - // Do we need a body ? - if (itype.isInterface() || Flags.isAbstract(method.getFlags())) { - methodStr.append(";"); - } - else { - // Generate Body. Open the body - methodStr.append(" {"); - // If there is a declared body, use it. Otherwise, use the default body. - if (method.getBodies().size() > 0) { - - for (JDTMethodBody body : method.getBodies()) { - methodStr.append("\n\t"); - methodStr.append(body.asText()); - } - // methodStr.append("\n"); - } - else { - // Default body - methodStr.append(" \n\t// TODO Auto-generated method"); - if (method.getReturnType() != null) { - methodStr.append("\n\treturn " + SynchTools.defaultReturn(method.getReturnType().getType().getElementName()) + ";"); - } - - } - // Close the body - methodStr.append("\n }"); - } - - // create the method - imethod = itype.createMethod(methodStr.toString(), null, true, null); - } - - // add javadoc to method - createJavaDocFor(imethod, imethod.getCompilationUnit(), method.getComment(), ""); - // Add explicit imports - generateExplicitImports(method, itype); - } catch (JavaModelException e) { - // e.printStackTrace(); - // throw new JDTVisitorException(e.getMessage(), e.getCause()); - propagateException(e.getMessage(), e); - } catch (Exception e) { - // e.printStackTrace(); - // throw new JDTVisitorException(e.getMessage(), e.getCause()); - propagateException(e.getMessage(), e); - } - - - } - - - /** - * Get the type of the parameter as a String. Take into account the multivalue setting. - * - * @param p - * @return - * @throws JavaModelException - */ - private String getTypeAsString(JDTParameter p) throws JavaModelException { - String type; - if (p.isMultiValued()) { - type = SynchTools.getMultiValued(itype, p.getType().getElementName(), preference); - } else { - type = p.getType().getElementName(); - } - return type; - } - - - - - - /** *************** methods override by SynchJDTCommentable ************** */ - - - @Override - /** - * search the method to insert Javadoc - * - * @see org.eclipse.papyrus.java.generator.jdtsynchronizer.impl.SynchJDTCommentable#searchElementToInsert(org.eclipse.jdt.core.dom.CompilationUnit, org.eclipse.jdt.core.IJavaElement) - * - * @param cu - * @param method - * @return - */ - protected BodyDeclaration searchElementToInsert(CompilationUnit cu, IJavaElement method) { - - // search Itype parent - if (method.getParent() instanceof IType) { - IType itype = (IType) method.getParent(); - // find the good type - TypeDeclaration type = searchType((TypeDeclaration) cu.types().get(0), itype.getElementName()); - - // search the method. Fortunately, there are no method getSignature() for the type MethodDeclaration. - // So, we search manually - for (MethodDeclaration m : type.getMethods()) { - if (m.getName().toString().equals(method.getElementName())) { - // verify the signature - if (m.parameters() != null && m.parameters().size() == 0 && this.method.getParameters().size() == 0) { - return m; - } - if (m.parameters().size() == this.method.getParameters().size()) { - int numParam = 0; - boolean goodSignature = true; - for (Object paramObj : m.parameters()) { - if (paramObj instanceof SingleVariableDeclaration) { - SingleVariableDeclaration param = (SingleVariableDeclaration) paramObj; - if (!param.getType().toString().equals(this.method.getParameters().get(numParam).getType().getElementName())) { - goodSignature = false; - } - - numParam++; - } - } - if (goodSignature) { - return m; - } - } - } - } - } - - return null; - } - - @Override - protected List getJavadocTags() { - List lst = new LinkedList(); - if (method == null) { - return lst; - } - - // parameters - for (JDTParameter param : method.getParameters()) { - String comment = param.getComment(); - if (comment == null) { - comment = ""; - } - lst.add(TagElement.TAG_PARAM + " " + param.getElementName() + " " + comment); - } - - // return - if (method.getReturnType() != null) { - String comment = method.getReturnType().getComment(); - if (comment == null) { - comment = ""; - } - lst.add(TagElement.TAG_RETURN + " " + comment); - } - - // exception - // TODO prendre en compte notion de commentaire - if (method.getExceptions() != null) { - for (JDTType exception : method.getExceptions()) { - // String comment = exception.getComment(); - // if(comment == null) comment = ""; - lst.add(TagElement.TAG_THROWS + " " + exception.getElementName()); - } - } - - - - return lst; - } - - - - /** - * Propagate a {@link JDTVisitorException} if the flag is not set - * - * @param msg - * @param e - * @throws JDTVisitorException - */ - private void propagateException(String msg, Throwable e) throws JDTVisitorException { - - if (preference.stopOnFirstError()) { - throw new JDTVisitorException(msg, e.getCause()); - } - else { - // Show error - System.err.println(msg); - e.printStackTrace(); - } - } - - - - /** - * Generate imports that are explicitly declared in the type - * - * @param srcType - * The src type to be transformed - * @param destType - * The jdt dest type to be generated - * @throws JavaModelException - * @throws JDTVisitorException - */ - private void generateExplicitImports(JDTMethod srcType, IType destType) throws JDTVisitorException { - - - // Add explicit type - for (JDTType anImport : srcType.getExplicitRequiredImports()) { - try { - destType.getCompilationUnit().createImport(anImport.getQualifiedName(), null, null); - } catch (Exception e) { - propagateException(destType.getFullyQualifiedName() + "Can't add explicit import " + anImport.getQualifiedName(), e); - } - } - - // Add explicit plain text types - for (String anImport : srcType.getExplicitPlainTextRequiredImports()) { - try { - destType.getCompilationUnit().createImport(anImport, null, null); - } catch (JavaModelException e) { - propagateException(destType.getFullyQualifiedName() + "Can't add explicit plain text import " + anImport, e); - } - } - - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragment.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragment.java deleted file mode 100644 index 7426838392c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragment.java +++ /dev/null @@ -1,112 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; - -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; - - -/** - * allow to generate package fragment - * - * @author Deblock Nicolas & Manuel Giles - * - */ -public class SynchJDTPackageFragment extends EObjectImpl implements JDTVisitor { - - public IPackageFragmentRoot iroot; - - private GeneratorPreference preference; - - /** - * Constructor - * - * @param iroot - * the IPackageFragmentRoot parent - */ - public SynchJDTPackageFragment(IPackageFragmentRoot iroot, GeneratorPreference preference) { - super(); - this.iroot = iroot; - this.preference = preference; - } - - - @Override - public void visit(JDTJavaElement element) throws JDTVisitorException { - // if element can't be generated, we stop all - if (!element.isGenerated()) { - return; - } - if (!preference.isPackageToGenerate(element.getElementName())) { - return; - } - - JDTPackageFragment packag = (JDTPackageFragment) element; - - try { - // search the package - IJavaElement tmp = null; - IPackageFragment ipack = null; - - - if ((tmp = SynchTools.searchIJavaElement(iroot.getChildren(), packag.getElementName())) != null && - tmp instanceof IPackageFragment) { - ipack = (IPackageFragment) tmp; - } - - // if name=null, it's the default package - if (packag.getQualifiedName() == null) { - // generate Compilation unit without package - IJavaElement defaultPackageElement = SynchTools.searchIJavaElement(iroot.getChildren(), IPackageFragment.DEFAULT_PACKAGE_NAME); - if (defaultPackageElement != null) { - ipack = (IPackageFragment) defaultPackageElement; - } - } - - // if the package don't exist, we create it! - if (ipack == null) { - - // find the name of the package - ipack = iroot.createPackageFragment(packag.getQualifiedName(), true, null); - - } - - // call the children compilationUnit - JDTVisitor visitor = new SynchJDTCompilationUnit(ipack, preference); - for (JDTCompilationUnit cu : packag.getCompilationUnits()) { - cu.accept(visitor); - } - - } catch (JavaModelException e) { - e.printStackTrace(); - throw new JDTVisitorException(e.getMessage(), e.getCause()); - } catch (Exception e) { - e.printStackTrace(); - throw new JDTVisitorException(e.getMessage(), e.getCause()); - } - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragmentRoot.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragmentRoot.java deleted file mode 100644 index cf023088416..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragmentRoot.java +++ /dev/null @@ -1,120 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; - - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jdt.core.IClasspathEntry; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; - - -/** - * allow to generate package fragment root - * - * @author Deblock Nicolas & Manuel Giles - * - */ -public class SynchJDTPackageFragmentRoot implements JDTVisitor { - - private IJavaProject iprojet; - - private GeneratorPreference preference; - - /** - * Constructor - * - * @param iprojet - * the project parent - */ - public SynchJDTPackageFragmentRoot(IJavaProject iprojet, GeneratorPreference preference) { - super(); - this.iprojet = iprojet; - this.preference = preference; - } - - - - @Override - public void visit(JDTJavaElement element) throws JDTVisitorException { - // if element can't be generated, we stop all - if (!element.isGenerated()) { - return; - } - - JDTPackageFragmentRoot root = (JDTPackageFragmentRoot) element; - - try { - // research JDTPackageFragmentRoot - IPackageFragmentRoot iroot = SynchTools.searchIJavaElement(iprojet.getAllPackageFragmentRoots(), root.getElementName()); - - // if IPackageFragmentRoot don't exist, we create this - if (iroot == null) { - // create the folder - IFolder sourceFolder = iprojet.getProject().getFolder(root.getElementName()); - try { - sourceFolder.create(false, true, null); - } catch (CoreException e) { - // folder already exist - } - - iroot = iprojet.getPackageFragmentRoot(sourceFolder); - IClasspathEntry[] oldEntries = iprojet.getRawClasspath(); - List newEntries = new ArrayList(); - - // copy the old entries in new entries - for (int i = 0; i < oldEntries.length; i++) { - // don't take the /projectName, else an exception are throw - if (oldEntries[i] != null && !oldEntries[i].getPath().toString().equals("/" + iprojet.getElementName())) { - newEntries.add(oldEntries[i]); - } - } - - // add the new packageFragmentRoot - newEntries.add(JavaCore.newSourceEntry(iroot.getPath())); - - IClasspathEntry[] newEntriesArray = new IClasspathEntry[newEntries.size()]; - newEntries.toArray(newEntriesArray); - - iprojet.setRawClasspath(newEntriesArray, null); - - } - - // call children - JDTVisitor visitPackageFragment = new SynchJDTPackageFragment(iroot, preference); - for (JDTPackageFragment ipack : root.getPackageFragments()) { - ipack.accept(visitPackageFragment); - } - - } catch (JavaModelException e) { - e.printStackTrace(); - throw new JDTVisitorException(e.getMessage(), e.getCause()); - } - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTType.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTType.java deleted file mode 100644 index 7d9560f1cc7..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTType.java +++ /dev/null @@ -1,435 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; - - -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.TagElement; -import org.eclipse.jdt.core.dom.TypeDeclaration; -import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; - - -/** - * Synchronize a JDTType with JDT. - * Can create a type to a ICompilationUnit or to a IType (useful for intern class). - * - * @author Deblock Nicolas & Giles Manuel - * - */ -public class SynchJDTType extends SynchJDTCommentable { - - /** - * Useful to create a type in a ICompilationUnit - * If icu is null, itype can't be null - */ - private ICompilationUnit icu; - - private GeneratorPreference preference; - - /** - * Useful to create a type in a IType - * If itype is null, icu can't be null - */ - private IType itype; - - /** - * Create a type to a ICompilationUnit - * - * @param icu - */ - public SynchJDTType(ICompilationUnit icu, GeneratorPreference preference) { - super(); - this.icu = icu; - this.preference = preference; - } - - /** - * Create a type to a IType (useful for intern class) - * - * @param itype - */ - public SynchJDTType(IType itype, GeneratorPreference preference) { - super(); - this.itype = itype; - this.preference = preference; - } - - - - @Override - public void visit(JDTJavaElement element) throws JDTVisitorException { - // if element can't be generated, we stop all - if (!element.isGenerated()) { - return; - } - if (SynchTools.isPrimiveType(element.getElementName()) && !element.getElementName().equals("String")) { - return; - } - - JDTType type = (JDTType) element; - - try { - IType it = SynchTools.searchIJavaElement(getTypes(), type.getElementName()); - - // generate type - if (it == null) { - StringBuffer buffer = new StringBuffer(); - - buffer.append(SynchTools.getVisibility(type)); - - // System.out.println("\n\n \t \t ####### " + type.isEnum()); - - if (type.isClass()) { - buffer.append("class "); - } else if (type.isInterface()) { - buffer.append("interface "); - } else if (type.isEnum()) { - - // System.out.println( type.getFields()); - - // generate the field - StringBuffer fieldStr = new StringBuffer(); - int i = 0; - for (JDTField field : type.getFields()) { - if (i > 0) { - fieldStr.append(",\n"); - } - fieldStr.append("\t" + field.getElementName()); - i++; - } - if (!type.getFields().isEmpty()) { - fieldStr.append(";\n\n"); - } - - it = createType("public enum " + type.getElementName() + " { \n" + fieldStr + " \n } ", null, true, null); - return; - /* - * it = createType("public enum " + type.getElementName() + " { \n" + - * fieldStr + - * "\tprivate final int value;\n\n"+ - * - * "\tprivate "+ type.getElementName() +"(int value) {\n"+ - * "\t\tthis.value = value;\n"+ - * "\t}\n\n"+ - * - * "\tpublic int getValue() {\n" + - * "\t\treturn this.value;\n" + - * "\t}\n" + - * "\n}", null, true, null); - * return; - */ - - } - // else, generate nothing - else { - return; - } - - buffer.append(type.getElementName()); - - if (type.getSuperClass() != null) { - buffer.append(" extends "); - buffer.append(type.getSuperClass().getElementName()); - - } - - if (type.getSuperInterfaces() != null && type.getSuperInterfaces().size() > 0) { - if (type.isInterface()) { - buffer.append(" extends "); - } else { - buffer.append(" implements "); - } - - int i = 0; - for (JDTType superInterface : type.getSuperInterfaces()) { - if (i != 0) { - buffer.append(", "); - } - buffer.append(superInterface.getElementName()); - i++; - } - } - - it = createType(buffer.toString() + " { \n\n}", null, true, null); - } - - // add imports - if (type.getSuperClass() != null) { - SynchTools.createImport(it, type, type.getSuperClass()); - } - - if (type.getSuperInterfaces() != null) { - for (JDTType superInterface : type.getSuperInterfaces()) { - SynchTools.createImport(it, type, superInterface); - } - } - - - - // add javaDoc comment - if (type.getComment() != null && !type.getComment().isEmpty()) { - createJavaDocFor(it, it.getCompilationUnit(), type.getComment(), ""); - } - - - // generate field - if (!type.isEnum()) { - JDTVisitor visitor = new SynchJDTField(it, preference); - for (JDTField field : type.getFields()) { - field.accept(visitor); - } - } - - // generate getters and setters - JDTVisitor vgettersetter = new SynchJDTGetterSetter(it, preference); - if (type.isClass()) { - for (JDTField field : type.getFields()) { - field.accept(vgettersetter); - } - } - - - // generate method - JDTVisitor vmethod = new SynchJDTMethod(it, preference); - for (JDTMethod method : type.getMethods()) { - method.accept(vmethod); - } - - // The class implements interface methods only if it's not an abstract class - if (!Flags.isAbstract(type.getFlags())) { - - // recover the superclass - JDTType superClass = type.getSuperClass(); - - // recover the interfaces - List allSuperInterfaces = getAllSuperInterfaces(type); - - // Implement the abstract methods of the superClass (recursive method) - if (preference.implementMethodsOfAbstractClass()) { - implementSuperClassAbstractMethods(it, superClass); - } - - // implements interfaces methods of the super-interfaces - if (preference.implementMethodsOfIntefaces()) { - for (JDTType superInterface : allSuperInterfaces) { - for (JDTMethod superInterfaceMethod : superInterface.getMethods()) { - superInterfaceMethod.accept(vmethod); - } - } - } - } - - - // generate nested class - JDTVisitor vClass = new SynchJDTType(it, preference); - for (JDTType child : type.getTypes()) { - child.accept(vClass); - } - - // Generate explicit imports - generateExplicitImports(type, it); - - } catch (JavaModelException e) { - e.printStackTrace(); - throw new JDTVisitorException(e.getMessage(), e.getCause()); - } catch (Exception e) { - e.printStackTrace(); - throw new JDTVisitorException(e.getMessage(), e.getCause()); - } - - - } - - /** - * Generate imports that are explicitly declared in the type - * - * @param it - * The jdt type to be generated - * @throws JavaModelException - * @throws JDTVisitorException - */ - private void generateExplicitImports(JDTType containerType, IType it) throws JDTVisitorException { - - - // Add explicit type - for (JDTType anImport : containerType.getExplicitRequiredImports()) { - try { - it.getCompilationUnit().createImport(anImport.getQualifiedName(), null, null); - } catch (Exception e) { - propagateException(it.getFullyQualifiedName() + "Can't add explicit import " + anImport.getQualifiedName(), e); - } - } - - // Add explicit plain text types - for (String anImport : containerType.getExplicitPlainTextRequiredImports()) { - try { - it.getCompilationUnit().createImport(anImport, null, null); - } catch (JavaModelException e) { - propagateException(it.getFullyQualifiedName() + "Can't add explicit plain text import " + anImport, e); - } - } - - } - - /** - * get current type - * - * @return - * @throws JavaModelException - */ - private IType[] getTypes() throws JavaModelException { - if (icu != null) { - return icu.getTypes(); - } - return itype.getTypes(); - } - - /** - * create type for a element 'sibling' - * - * @param contents - * the source contents of the type declaration to add - * @param sibling - * the existing element which the type will be inserted immediately before (if null, then this type will be inserted as the last type - * declaration - * @param force - * a flag in case the same name already exists in this type - * @param monitor - * the progress monitor to notify - * @return the newly inserted type - * @throws JavaModelException - */ - private IType createType(String contents, IJavaElement sibling, boolean force, IProgressMonitor monitor) throws JavaModelException - { - if (icu != null) { - return icu.createType(contents, sibling, force, monitor); - } - - return itype.createType(contents, sibling, force, monitor); - } - - - @Override - protected TypeDeclaration searchElementToInsert(CompilationUnit cu, IJavaElement typeName) { - if (!(cu.types().get(0) instanceof TypeDeclaration)) { - return null; - } - TypeDeclaration classType = (TypeDeclaration) cu.types().get(0); - return searchType(classType, typeName.getElementName()); - - } - - @Override - protected List getJavadocTags() { - List lst = new LinkedList(); - lst.add(TagElement.TAG_AUTHOR); - return lst; - } - - /** - * Collect all super interfaces from the super class and the super interfaces (JDTType). Recursive method. - * - * @param superClass - * @return List of all super interfaces - */ - public List getAllSuperInterfaces(JDTType _type) { - List superInterfaces = new LinkedList(); - - // recover its own interfaces - superInterfaces.addAll(_type.getSuperInterfaces()); - - // add interfaces of the super class if it's abstract - if (_type.getSuperClass() != null && _type.getSuperClass().isAbstract()) { - superInterfaces.addAll(getAllSuperInterfaces(_type.getSuperClass())); - } - - // add interfaces of the super interfaces - for (JDTType superInterface : _type.getSuperInterfaces()) { - superInterfaces.addAll(getAllSuperInterfaces(superInterface)); - } - - return superInterfaces; - } - - /** - * Implement the abstract methods of the superClass if the superClass is abstract. It's a recursive method on the super class of the super class. - * - * @param it - * @param superClass - * @throws JDTVisitorException - */ - public void implementSuperClassAbstractMethods(IType it, JDTType superClass) throws JDTVisitorException { - if (superClass == null) { - return; - } - - JDTVisitor vmethod = new SynchJDTMethod(it, preference); - - if (Flags.isAbstract(superClass.getFlags())) { - for (JDTMethod superClassAbstractMethod : superClass.getMethods()) { - // Skip if method is not abstract - if (!superClassAbstractMethod.isAbstract()) { - continue; - } - // Remove the abstract flag to not generate the method with the keyword "abstract" - superClassAbstractMethod.setAbstract(false); - superClassAbstractMethod.accept(vmethod); - superClassAbstractMethod.setAbstract(true); - } - - // Recursive call on the super class of superClass - JDTType superClassSuperClass = superClass.getSuperClass(); - if (superClassSuperClass != null) { - implementSuperClassAbstractMethods(it, superClassSuperClass); - } - } - } - - /** - * Propagate a {@link JDTVisitorException} if the flag is not set - * - * @param msg - * @param e - * @throws JDTVisitorException - */ - private void propagateException(String msg, Throwable e) throws JDTVisitorException { - - if (preference.stopOnFirstError()) { - throw new JDTVisitorException(msg, e.getCause()); - } - else { - // Show error - System.err.println(msg); - e.printStackTrace(); - } - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchTools.java b/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchTools.java deleted file mode 100644 index 89a4d4a586d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchTools.java +++ /dev/null @@ -1,325 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; - - - -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; - -/** - * gathers all the util function to synchronize with JDT - * - * @author Nicolas Deblock and Manuel Giles - * - */ -public class SynchTools { - - - /** - * Find a IJavaElement in a list of IJavaElement - * It's util to search a children of a IJavaElement - * - * @param - * a IJavaElement - * @param lstElement - * list of IJavaElement - * @param elementName - * name of IJavaElement which is search - * @return the element who is search, null if there is no element find - */ - public static U searchIJavaElement(U[] lstElement, String elementName) { - for (U e : lstElement) { - if (e.getElementName().equals(elementName)) { - return e; - } - } - return null; - } - - /** - * return the visibility of jdtMember : - * public or private or protected, abstract, static, final, synchronized - * - * @param jdtMember - * @return visibility of jdtMember - */ - public static String getVisibility(JDTMember jdtMember) { - StringBuffer buffer = new StringBuffer(); - - if (Flags.isPublic(jdtMember.getFlags())) { - buffer.append("public "); - } - if (Flags.isPrivate(jdtMember.getFlags())) { - buffer.append("private "); - } - if (Flags.isProtected(jdtMember.getFlags())) { - buffer.append("protected "); - } - - if (Flags.isAbstract(jdtMember.getFlags())) { - buffer.append("abstract "); - } - - if (Flags.isStatic(jdtMember.getFlags())) { - buffer.append("static "); - } - if (Flags.isFinal(jdtMember.getFlags())) { - buffer.append("final "); - } - if (Flags.isSynchronized(jdtMember.getFlags())) { - buffer.append("synchronized "); - } - return buffer.toString(); - } - - /** - * allow to know if a type is primitive - * - * @param typename - * @return true if typename is a primive type - */ - public static boolean isPrimiveType(String typename) { - if (typename.equals("byte")) { - return true; - } - if (typename.equals("char")) { - return true; - } - if (typename.equals("double")) { - return true; - } - if (typename.equals("float")) { - return true; - } - if (typename.equals("int")) { - return true; - } - if (typename.equals("long")) { - return true; - } - if (typename.equals("short")) { - return true; - } - if (typename.equals("boolean")) { - return true; - } - if (typename.equals("String")) { - return true; - } - return false; - } - - /** - * Check if a name represents a pure Java primitive type. - * Pure Java primitive type are Java primitive types that are keywords and not Classes (ie excluding String). - * - * - * @param typename - * @return true if typename is a primive type - */ - public static boolean isPureJavaPrimiveType(String typename) { - if (typename.equals("byte")) { - return true; - } - if (typename.equals("char")) { - return true; - } - if (typename.equals("double")) { - return true; - } - if (typename.equals("float")) { - return true; - } - if (typename.equals("int")) { - return true; - } - if (typename.equals("long")) { - return true; - } - if (typename.equals("short")) { - return true; - } - if (typename.equals("boolean")) { - return true; - } - if (typename.equals("String")) { - return true; - } - return false; - } - - /** - * return the default return of a type (ex: 0 for a int, false for a boolean, null for a class,...) - * - * @param typename - * @return true if typename is a primive type - */ - public static String defaultReturn(String typename) { - if (typename.equals("byte")) { - return "0"; - } - if (typename.equals("char")) { - return "0"; - } - if (typename.equals("double")) { - return "0"; - } - if (typename.equals("float")) { - return "0"; - } - if (typename.equals("int")) { - return "0"; - } - if (typename.equals("long")) { - return "0"; - } - if (typename.equals("short")) { - return "0"; - } - if (typename.equals("boolean")) { - return "false"; - } - - return "null"; - } - - /** - * return the Class of a primitive type (ex : int => Integer) - * - * @param typename - * @return true if typename is a primive type - */ - private static String getPrimiveTypeClass(String typename) { - if (typename.equals("byte")) { - return "Byte"; - } - if (typename.equals("char")) { - return "Character"; - } - if (typename.equals("double")) { - return "Double"; - } - if (typename.equals("float")) { - return "Float"; - } - if (typename.equals("int")) { - return "Integer"; - } - if (typename.equals("long")) { - return "Long"; - } - if (typename.equals("short")) { - return "Short"; - } - if (typename.equals("boolean")) { - return "Boolean"; - } - return typename; - } - - - public static String getPackageFragment(JDTType type) { - try { - if (type.getCompilationUnit() != null) { - return type.getCompilationUnit().getPackageFragment().getQualifiedName(); - } else { - return getPackageFragment(type.getOwner()); - } - } catch (NullPointerException e) { - // id null pointer exception, we return null - return null; - } - } - - public static void createImport(IType itype, JDTType currentType, JDTType importType) throws JavaModelException { - String packageCurrentType = getPackageFragment(currentType); - String packageImportType = getPackageFragment(importType); - - // if no package to import, stop - if (packageImportType == null) { - return; - } - - - // if they have the same package, and if it is not a nested class, we stop - if (packageCurrentType != null && importType.getCompilationUnit() != null && packageCurrentType.equals(packageImportType)) { - return; - } - - // Check if the last segment name is not a primitive name. - // Stop if it is the case (otherwise createImport() throw an exception) - if( isPureJavaPrimiveType(importType.getElementName())) { - return; - } - - String _import = importType.getQualifiedName(); - if (!SynchTools.isPrimiveType(_import) && _import.contains(".")) { - itype.getCompilationUnit().createImport(_import, null, null); - } - } - - /** - * Get the multivalued declaration for the specified typeName. - * - * @param type - * The enclosing type that will contains the declaration. Requested to ajust import. - * @param typeName - * The type for wich a multivalued statement is requested - * @param preference - * The preferences - * @return The multivalued statement for the specified typeName. - * - * @throws JavaModelException - */ - public static String getMultiValued(IType type, String typeName, GeneratorPreference preference) throws JavaModelException { - // create the import - String _classQualifiedName = preference.genericClassForMultiValue(); - String _class = _classQualifiedName.substring(_classQualifiedName.lastIndexOf(".") + 1); - - type.getCompilationUnit().createImport(_classQualifiedName, null, null); - return _class + "<" + getPrimiveTypeClass(typeName) + ">"; - } - - /** - * Get the multivalued declaration for the specified typeName. - * - * @param type - * The enclosing type that will contains the declaration. Requested to ajust import. - * @param typeName - * The type for wich a multivalued statement is requested - * @param preference - * The preferences - * @return The multivalued statement for the specified typeName. - * - * @throws JavaModelException - */ - public static String getMultiValued(IType type, JDTType valueType, GeneratorPreference preference) throws JavaModelException { - // create the import - String _classQualifiedName = preference.genericClassForMultiValue(); - String _class = _classQualifiedName.substring(_classQualifiedName.lastIndexOf(".") + 1); - - type.getCompilationUnit().createImport(_classQualifiedName, null, null); - return _class + "<" + getPrimiveTypeClass(valueType.getElementName()) + ">"; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.classpath b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.project b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.project deleted file mode 100644 index 0288cbb8ed8..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.java.generator.metamodel.jdt.edit - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.core.prefs b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94d61f00da6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/META-INF/MANIFEST.MF b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/META-INF/MANIFEST.MF deleted file mode 100644 index 22a5ba0c5dc..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider, - org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.papyrus.java.generator.metamodel.jdt;bundle-version="1.2.0";visibility:=reexport, - org.eclipse.emf.edit;visibility:=reexport, - org.eclipse.uml2.types;visibility:=reexport, - org.eclipse.uml2.common.edit;visibility:=reexport -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider.GeneratoroptionsmmEditPlugin$Implementation -Bundle-SymbolicName: org.eclipse.papyrus.java.generator.metamodel.jdt.edit;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/about.html b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/build.properties b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/build.properties deleted file mode 100644 index b686a6bcfc4..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/build.properties +++ /dev/null @@ -1,12 +0,0 @@ -# - -bin.includes = .,\ - icons/,\ - META-INF/,\ - plugin.xml,\ - plugin.properties,\ - about.html -jars.compile.order = . -source.. = src/ -output.. = bin/ -src.includes = about.html diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTClass.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTClass.gif deleted file mode 100644 index 5b6f7bd4d41..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTClass.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTEnum.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTEnum.gif deleted file mode 100644 index b7364612037..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTEnum.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTInterface.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTInterface.gif deleted file mode 100644 index fb66338ebff..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTInterface.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTType.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTType.gif deleted file mode 100644 index f7c61c23bbd..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTType.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaModel_javaProject_JDTJavaProject.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaModel_javaProject_JDTJavaProject.gif deleted file mode 100644 index 41c86b3dbc1..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaModel_javaProject_JDTJavaProject.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaProject_packageFragmentRoots_JDTPackageFragmentRoot.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaProject_packageFragmentRoots_JDTPackageFragmentRoot.gif deleted file mode 100644 index 07adaab9f3a..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaProject_packageFragmentRoots_JDTPackageFragmentRoot.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMember_typeParameters_JDTTypeParameter.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMember_typeParameters_JDTTypeParameter.gif deleted file mode 100644 index c3c4510a051..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMember_typeParameters_JDTTypeParameter.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_JDTOpaqueBody.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_JDTOpaqueBody.gif deleted file mode 100644 index e5d4d731cc6..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_JDTOpaqueBody.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_OpaqueMethodBody.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_OpaqueMethodBody.gif deleted file mode 100644 index d5f8c8dbcfb..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_OpaqueMethodBody.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_parameters_JDTParameter.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_parameters_JDTParameter.gif deleted file mode 100644 index d7724b60a25..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_parameters_JDTParameter.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_returnType_JDTParameter.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_returnType_JDTParameter.gif deleted file mode 100644 index d7724b60a25..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_returnType_JDTParameter.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragmentRoot_packageFragments_JDTPackageFragment.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragmentRoot_packageFragments_JDTPackageFragment.gif deleted file mode 100644 index 932fde3646a..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragmentRoot_packageFragments_JDTPackageFragment.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_compilationUnits_JDTCompilationUnit.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_compilationUnits_JDTCompilationUnit.gif deleted file mode 100644 index 953143344d9..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_compilationUnits_JDTCompilationUnit.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_packageFragments_JDTPackageFragment.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_packageFragments_JDTPackageFragment.gif deleted file mode 100644 index df3eebc9432..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_packageFragments_JDTPackageFragment.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_fields_JDTField.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_fields_JDTField.gif deleted file mode 100644 index 2c2ef1ff95c..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_fields_JDTField.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_methods_JDTMethod.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_methods_JDTMethod.gif deleted file mode 100644 index a64a033a18c..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_methods_JDTMethod.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTClass.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTClass.gif deleted file mode 100644 index e5f323d1f47..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTClass.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTEnum.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTEnum.gif deleted file mode 100644 index a6e5cfd32c1..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTEnum.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTInterface.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTInterface.gif deleted file mode 100644 index 2f6d3eba40f..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTInterface.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTType.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTType.gif deleted file mode 100644 index 11148cf465f..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTType.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTClass.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTClass.gif deleted file mode 100644 index 10d222998af..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTClass.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTCompilationUnit.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTCompilationUnit.gif deleted file mode 100644 index 05dc74ad5da..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTCompilationUnit.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTEnum.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTEnum.gif deleted file mode 100644 index ed874747401..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTEnum.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTException.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTException.gif deleted file mode 100644 index c4fb30e9687..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTException.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTField.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTField.gif deleted file mode 100644 index 1e5345fb323..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTField.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportContainer.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportContainer.gif deleted file mode 100644 index 53500daf98e..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportContainer.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportDeclaration.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportDeclaration.gif deleted file mode 100644 index d3dc5a9ad81..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportDeclaration.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTInterface.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTInterface.gif deleted file mode 100644 index c3370c7ddd5..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTInterface.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaElement.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaElement.gif deleted file mode 100644 index 94c953e013b..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaElement.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaModel.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaModel.gif deleted file mode 100644 index 4365960a04b..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaModel.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaProject.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaProject.gif deleted file mode 100644 index a26660ec28f..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaProject.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTMethod.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTMethod.gif deleted file mode 100644 index 30f0c48da8d..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTMethod.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTOpaqueBody.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTOpaqueBody.gif deleted file mode 100644 index 5a9bc7514fa..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTOpaqueBody.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragment.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragment.gif deleted file mode 100644 index c414fe9f728..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragment.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragmentRoot.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragmentRoot.gif deleted file mode 100644 index 48e3cf22687..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragmentRoot.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTParameter.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTParameter.gif deleted file mode 100644 index 7c2aaac84ee..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTParameter.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTTypeParameter.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTTypeParameter.gif deleted file mode 100644 index 94c953e013b..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTTypeParameter.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/OpaqueMethodBody.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/OpaqueMethodBody.gif deleted file mode 100644 index 98b351f1c44..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/OpaqueMethodBody.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/Options.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/Options.gif deleted file mode 100644 index cdd3b76e3c0..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/Options.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.properties b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.properties deleted file mode 100644 index 2f93b958827..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.properties +++ /dev/null @@ -1,22 +0,0 @@ -# - -pluginName = Jdt metamodel Edit Support (Incubation) -providerName = Eclipse Modeling Project - -_UI_CreateChild_text = {0} -_UI_CreateChild_text2 = {1} {0} -_UI_CreateChild_text3 = {1} -_UI_CreateChild_tooltip = Create New {0} Under {1} Feature -_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}. -_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent. - -_UI_PropertyDescriptor_description = The {0} of the {1} - -_UI_Options_type = Options -_UI_Unknown_type = Object - -_UI_Unknown_datatype= Value - -_UI_Options_defaultSourceFolder_feature = Default Source Folder -_UI_Unknown_feature = Unspecified - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.xml b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.xml deleted file mode 100644 index df8624cdbb7..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/pom.xml b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/pom.xml deleted file mode 100644 index 13f198963fe..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.java.generator.metamodel.jdt.edit - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmEditPlugin.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmEditPlugin.java deleted file mode 100644 index 3e8e80040f5..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmEditPlugin.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider; - -import org.eclipse.emf.common.EMFPlugin; -import org.eclipse.emf.common.util.ResourceLocator; - -/** - * This is the central singleton for the Generatoroptionsmm edit plugin. - * - * - * - * @generated - */ -public final class GeneratoroptionsmmEditPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * - * @generated - */ - public static final GeneratoroptionsmmEditPlugin INSTANCE = new GeneratoroptionsmmEditPlugin(); - - /** - * Keep track of the singleton. - * - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * - * @generated - */ - public GeneratoroptionsmmEditPlugin() { - super(new ResourceLocator[] { - }); - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * - * @return the singleton instance. - * @generated - */ - @Override - public ResourceLocator getPluginResourceLocator() { - return plugin; - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * - * @return the singleton instance. - * @generated - */ - public static Implementation getPlugin() { - return plugin; - } - - /** - * The actual implementation of the Eclipse Plugin. - * - * - * - * @generated - */ - public static class Implementation extends EclipsePlugin { - /** - * Creates an instance. - * - * - * - * @generated - */ - public Implementation() { - super(); - - // Remember the static instance. - // - plugin = this; - } - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmItemProviderAdapterFactory.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmItemProviderAdapterFactory.java deleted file mode 100644 index 88634641cf3..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmItemProviderAdapterFactory.java +++ /dev/null @@ -1,221 +0,0 @@ -/** - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IDisposable; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.util.GeneratoroptionsmmAdapterFactory; - -/** - * This is the factory that is used to provide the interfaces needed to support Viewers. - * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. - * The adapters also support Eclipse property sheets. - * Note that most of the adapters are shared among multiple instances. - * - * - * - * @generated - */ -public class GeneratoroptionsmmItemProviderAdapterFactory extends GeneratoroptionsmmAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - * - * - * - * @generated - */ - protected ComposedAdapterFactory parentAdapterFactory; - - /** - * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. - * - * - * - * @generated - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - - /** - * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. - * - * - * - * @generated - */ - protected Collection supportedTypes = new ArrayList(); - - /** - * This constructs an instance. - * - * - * - * @generated - */ - public GeneratoroptionsmmItemProviderAdapterFactory() { - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemLabelProvider.class); - supportedTypes.add(IItemPropertySource.class); - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options} instances. - * - * - * - * @generated - */ - protected OptionsItemProvider optionsItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options}. - * - * - * - * @generated - */ - @Override - public Adapter createOptionsAdapter() { - if (optionsItemProvider == null) { - optionsItemProvider = new OptionsItemProvider(this); - } - - return optionsItemProvider; - } - - /** - * This returns the root adapter factory that contains this factory. - * - * - * - * @generated - */ - @Override - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - /** - * This sets the composed adapter factory that contains this factory. - * - * - * - * @generated - */ - @Override - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isFactoryForType(Object type) { - return supportedTypes.contains(type) || super.isFactoryForType(type); - } - - /** - * This implementation substitutes the factory itself as the key for the adapter. - * - * - * - * @generated - */ - @Override - public Adapter adapt(Notifier notifier, Object type) { - return super.adapt(notifier, this); - } - - /** - * - * - * - * @generated - */ - @Override - public Object adapt(Object object, Object type) { - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - /** - * This adds a listener. - * - * - * - * @generated - */ - @Override - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This removes a listener. - * - * - * - * @generated - */ - @Override - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. - * - * - * - * @generated - */ - @Override - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This disposes all of the item providers created by this factory. - * - * - * - * @generated - */ - @Override - public void dispose() { - if (optionsItemProvider != null) { - optionsItemProvider.dispose(); - } - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/OptionsItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/OptionsItemProvider.java deleted file mode 100644 index 57d2268c2de..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/OptionsItemProvider.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options} object. - * - * - * - * @generated - */ -public class OptionsItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public OptionsItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addDefaultSourceFolderPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Default Source Folder feature. - * - * - * - * @generated - */ - protected void addDefaultSourceFolderPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Options_defaultSourceFolder_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Options_defaultSourceFolder_feature", "_UI_Options_type"), - GeneratoroptionsmmPackage.Literals.OPTIONS__DEFAULT_SOURCE_FOLDER, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns Options.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Options")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((Options) object).getDefaultSourceFolder(); - return label == null || label.length() == 0 ? - getString("_UI_Options_type") : - getString("_UI_Options_type") + " " + label; - } - - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(Options.class)) { - case GeneratoroptionsmmPackage.OPTIONS__DEFAULT_SOURCE_FOLDER: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. - * - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return GeneratoroptionsmmEditPlugin.INSTANCE; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTClassItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTClassItemProvider.java deleted file mode 100644 index a0298c0858e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTClassItemProvider.java +++ /dev/null @@ -1,135 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass} object. - * - * - * - * @generated - */ -public class JDTClassItemProvider - extends JDTTypeItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTClassItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This returns JDTClass.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTClass")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTClass) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTClass_type") : - getString("_UI_JDTClass_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTCompilationUnitItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTCompilationUnitItemProvider.java deleted file mode 100644 index 6f0ec9edd1c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTCompilationUnitItemProvider.java +++ /dev/null @@ -1,242 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.uml2.common.edit.command.SubsetAddCommand; -import org.eclipse.uml2.common.edit.command.SubsetSupersetReplaceCommand; -import org.eclipse.uml2.common.edit.command.SupersetRemoveCommand; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit} object. - * - * - * - * @generated - */ -public class JDTCompilationUnitItemProvider - extends JDTTypeRootItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTCompilationUnitItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES); - } - return childrenFeatures; - } - - /** - * - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns JDTCompilationUnit.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTCompilationUnit")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTCompilationUnit) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTCompilationUnit_type") : - getString("_UI_JDTCompilationUnit_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTCompilationUnit.class)) { - case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES, - JdtmmFactory.eINSTANCE.createJDTClass())); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES, - JdtmmFactory.eINSTANCE.createJDTInterface())); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES, - JdtmmFactory.eINSTANCE.createJDTEnum())); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createAddCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection, int) - * - * - * @generated - */ - @Override - protected Command createAddCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection, int index) { - if (feature == JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES) { - return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); - } - return super.createAddCommand(domain, owner, feature, collection, index); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection) - * - * - * @generated - */ - @Override - protected Command createRemoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection) { - if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { - return new SupersetRemoveCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES }, collection); - } - return super.createRemoveCommand(domain, owner, feature, collection); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createReplaceCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject, java.util.Collection) - * - * - * @generated - */ - @Override - protected Command createReplaceCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, EObject value, Collection collection) { - if (feature == JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES) { - return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); - } - if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { - return new SubsetSupersetReplaceCommand(domain, owner, feature, null, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES }, value, collection); - } - return super.createReplaceCommand(domain, owner, feature, value, collection); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTEnumItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTEnumItemProvider.java deleted file mode 100644 index 03cc577662b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTEnumItemProvider.java +++ /dev/null @@ -1,135 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum} object. - * - * - * - * @generated - */ -public class JDTEnumItemProvider - extends JDTTypeItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTEnumItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This returns JDTEnum.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTEnum")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTEnum) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTEnum_type") : - getString("_UI_JDTEnum_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTExceptionItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTExceptionItemProvider.java deleted file mode 100644 index 7425bf22b7a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTExceptionItemProvider.java +++ /dev/null @@ -1,145 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException} object. - * - * - * - * @generated - */ -public class JDTExceptionItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTExceptionItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This returns JDTException.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTException")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - return getString("_UI_JDTException_type"); - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. - * - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return JdtmmEditPlugin.INSTANCE; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTFieldItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTFieldItemProvider.java deleted file mode 100644 index 06ce121e867..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTFieldItemProvider.java +++ /dev/null @@ -1,343 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField} object. - * - * - * - * @generated - */ -public class JDTFieldItemProvider - extends JDTMemberItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTFieldItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addAbstractPropertyDescriptor(object); - addFinalPropertyDescriptor(object); - addStaticPropertyDescriptor(object); - addIsMultiValuedPropertyDescriptor(object); - addTypePropertyDescriptor(object); - addValuePropertyDescriptor(object); - addGenerateGetterPropertyDescriptor(object); - addGenerateSetterPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Abstract feature. - * - * - * - * @generated - */ - protected void addAbstractPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTField_abstract_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTField_abstract_feature", "_UI_JDTField_type"), - JdtmmPackage.Literals.JDT_FIELD__ABSTRACT, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Final feature. - * - * - * - * @generated - */ - protected void addFinalPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTField_final_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTField_final_feature", "_UI_JDTField_type"), - JdtmmPackage.Literals.JDT_FIELD__FINAL, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Static feature. - * - * - * - * @generated - */ - protected void addStaticPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTField_static_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTField_static_feature", "_UI_JDTField_type"), - JdtmmPackage.Literals.JDT_FIELD__STATIC, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Multi Valued feature. - * - * - * - * @generated - */ - protected void addIsMultiValuedPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTField_isMultiValued_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTField_isMultiValued_feature", "_UI_JDTField_type"), - JdtmmPackage.Literals.JDT_FIELD__IS_MULTI_VALUED, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Type feature. - * - * - * - * @generated - */ - protected void addTypePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTField_type_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTField_type_feature", "_UI_JDTField_type"), - JdtmmPackage.Literals.JDT_FIELD__TYPE, - true, - false, - true, - null, - null, - null)); - } - - /** - * This adds a property descriptor for the Value feature. - * - * - * - * @generated - */ - protected void addValuePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTField_value_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTField_value_feature", "_UI_JDTField_type"), - JdtmmPackage.Literals.JDT_FIELD__VALUE, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Generate Getter feature. - * - * - * - * @generated - */ - protected void addGenerateGetterPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTField_generateGetter_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTField_generateGetter_feature", "_UI_JDTField_type"), - JdtmmPackage.Literals.JDT_FIELD__GENERATE_GETTER, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Generate Setter feature. - * - * - * - * @generated - */ - protected void addGenerateSetterPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTField_generateSetter_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTField_generateSetter_feature", "_UI_JDTField_type"), - JdtmmPackage.Literals.JDT_FIELD__GENERATE_SETTER, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns JDTField.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTField")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTField) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTField_type") : - getString("_UI_JDTField_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTField.class)) { - case JdtmmPackage.JDT_FIELD__ABSTRACT: - case JdtmmPackage.JDT_FIELD__FINAL: - case JdtmmPackage.JDT_FIELD__STATIC: - case JdtmmPackage.JDT_FIELD__IS_MULTI_VALUED: - case JdtmmPackage.JDT_FIELD__VALUE: - case JdtmmPackage.JDT_FIELD__GENERATE_GETTER: - case JdtmmPackage.JDT_FIELD__GENERATE_SETTER: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportContainerItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportContainerItemProvider.java deleted file mode 100644 index db59b9cf788..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportContainerItemProvider.java +++ /dev/null @@ -1,135 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer} object. - * - * - * - * @generated - */ -public class JDTImportContainerItemProvider - extends JDTParentJavaElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTImportContainerItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This returns JDTImportContainer.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTImportContainer")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTImportContainer) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTImportContainer_type") : - getString("_UI_JDTImportContainer_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportDeclarationItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportDeclarationItemProvider.java deleted file mode 100644 index 00b887558c4..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportDeclarationItemProvider.java +++ /dev/null @@ -1,135 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration} object. - * - * - * - * @generated - */ -public class JDTImportDeclarationItemProvider - extends JDTJavaElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTImportDeclarationItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This returns JDTImportDeclaration.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTImportDeclaration")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTImportDeclaration) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTImportDeclaration_type") : - getString("_UI_JDTImportDeclaration_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTInterfaceItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTInterfaceItemProvider.java deleted file mode 100644 index 53afb9f522a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTInterfaceItemProvider.java +++ /dev/null @@ -1,135 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface} object. - * - * - * - * @generated - */ -public class JDTInterfaceItemProvider - extends JDTTypeItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTInterfaceItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This returns JDTInterface.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTInterface")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTInterface) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTInterface_type") : - getString("_UI_JDTInterface_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaElementItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaElementItemProvider.java deleted file mode 100644 index 3b3ae3d9dab..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaElementItemProvider.java +++ /dev/null @@ -1,270 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement} object. - * - * - * - * @generated - */ -public class JDTJavaElementItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTJavaElementItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addElementNamePropertyDescriptor(object); - addElementTypePropertyDescriptor(object); - addCommentPropertyDescriptor(object); - addGeneratedPropertyDescriptor(object); - addParentPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Parent feature. - * - * - * - * @generated - */ - protected void addParentPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTJavaElement_parent_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTJavaElement_parent_feature", "_UI_JDTJavaElement_type"), - JdtmmPackage.Literals.JDT_JAVA_ELEMENT__PARENT, - false, - false, - false, - null, - null, - null)); - } - - /** - * This adds a property descriptor for the Element Name feature. - * - * - * - * @generated - */ - protected void addElementNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTJavaElement_elementName_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTJavaElement_elementName_feature", "_UI_JDTJavaElement_type"), - JdtmmPackage.Literals.JDT_JAVA_ELEMENT__ELEMENT_NAME, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Element Type feature. - * - * - * - * @generated - */ - protected void addElementTypePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTJavaElement_elementType_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTJavaElement_elementType_feature", "_UI_JDTJavaElement_type"), - JdtmmPackage.Literals.JDT_JAVA_ELEMENT__ELEMENT_TYPE, - true, - false, - false, - ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Comment feature. - * - * - * - * @generated - */ - protected void addCommentPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTJavaElement_comment_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTJavaElement_comment_feature", "_UI_JDTJavaElement_type"), - JdtmmPackage.Literals.JDT_JAVA_ELEMENT__COMMENT, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Generated feature. - * - * - * - * @generated - */ - protected void addGeneratedPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTJavaElement_generated_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTJavaElement_generated_feature", "_UI_JDTJavaElement_type"), - JdtmmPackage.Literals.JDT_JAVA_ELEMENT__GENERATED, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTJavaElement) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTJavaElement_type") : - getString("_UI_JDTJavaElement_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTJavaElement.class)) { - case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_NAME: - case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_TYPE: - case JdtmmPackage.JDT_JAVA_ELEMENT__COMMENT: - case JdtmmPackage.JDT_JAVA_ELEMENT__GENERATED: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. - * - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return JdtmmEditPlugin.INSTANCE; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaModelItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaModelItemProvider.java deleted file mode 100644 index 3c1c389f517..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaModelItemProvider.java +++ /dev/null @@ -1,181 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel} object. - * - * - * - * @generated - */ -public class JDTJavaModelItemProvider - extends JDTParentJavaElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTJavaModelItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(JdtmmPackage.Literals.JDT_JAVA_MODEL__JAVA_PROJECT); - } - return childrenFeatures; - } - - /** - * - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns JDTJavaModel.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTJavaModel")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTJavaModel) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTJavaModel_type") : - getString("_UI_JDTJavaModel_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTJavaModel.class)) { - case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_JAVA_MODEL__JAVA_PROJECT, - JdtmmFactory.eINSTANCE.createJDTJavaProject())); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaProjectItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaProjectItemProvider.java deleted file mode 100644 index f1c6006b642..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaProjectItemProvider.java +++ /dev/null @@ -1,232 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.uml2.common.edit.command.SubsetAddCommand; -import org.eclipse.uml2.common.edit.command.SubsetSupersetReplaceCommand; -import org.eclipse.uml2.common.edit.command.SupersetRemoveCommand; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject} object. - * - * - * - * @generated - */ -public class JDTJavaProjectItemProvider - extends JDTParentJavaElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTJavaProjectItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(JdtmmPackage.Literals.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS); - } - return childrenFeatures; - } - - /** - * - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns JDTJavaProject.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTJavaProject")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTJavaProject) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTJavaProject_type") : - getString("_UI_JDTJavaProject_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTJavaProject.class)) { - case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS, - JdtmmFactory.eINSTANCE.createJDTPackageFragmentRoot())); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createAddCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection, int) - * - * - * @generated - */ - @Override - protected Command createAddCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection, int index) { - if (feature == JdtmmPackage.Literals.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS) { - return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); - } - return super.createAddCommand(domain, owner, feature, collection, index); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection) - * - * - * @generated - */ - @Override - protected Command createRemoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection) { - if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { - return new SupersetRemoveCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS }, collection); - } - return super.createRemoveCommand(domain, owner, feature, collection); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createReplaceCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject, java.util.Collection) - * - * - * @generated - */ - @Override - protected Command createReplaceCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, EObject value, Collection collection) { - if (feature == JdtmmPackage.Literals.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS) { - return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); - } - if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { - return new SubsetSupersetReplaceCommand(domain, owner, feature, null, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS }, value, collection); - } - return super.createReplaceCommand(domain, owner, feature, value, collection); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMemberItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMemberItemProvider.java deleted file mode 100644 index 28301611c75..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMemberItemProvider.java +++ /dev/null @@ -1,247 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember} object. - * - * - * - * @generated - */ -public class JDTMemberItemProvider - extends JDTParentJavaElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTMemberItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addVisibilityPropertyDescriptor(object); - addExplicitRequiredImportsPropertyDescriptor(object); - addExplicitPlainTextRequiredImportsPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Visibility feature. - * - * - * - * @generated - */ - protected void addVisibilityPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTMember_visibility_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTMember_visibility_feature", "_UI_JDTMember_type"), - JdtmmPackage.Literals.JDT_MEMBER__VISIBILITY, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Explicit Required Imports feature. - * - * - * - * @generated - */ - protected void addExplicitRequiredImportsPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTMember_explicitRequiredImports_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTMember_explicitRequiredImports_feature", "_UI_JDTMember_type"), - JdtmmPackage.Literals.JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS, - true, - false, - true, - null, - null, - null)); - } - - /** - * This adds a property descriptor for the Explicit Plain Text Required Imports feature. - * - * - * - * @generated - */ - protected void addExplicitPlainTextRequiredImportsPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTMember_explicitPlainTextRequiredImports_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTMember_explicitPlainTextRequiredImports_feature", "_UI_JDTMember_type"), - JdtmmPackage.Literals.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(JdtmmPackage.Literals.JDT_MEMBER__TYPE_PARAMETERS); - } - return childrenFeatures; - } - - /** - * - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTMember) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTMember_type") : - getString("_UI_JDTMember_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTMember.class)) { - case JdtmmPackage.JDT_MEMBER__VISIBILITY: - case JdtmmPackage.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_MEMBER__TYPE_PARAMETERS, - JdtmmFactory.eINSTANCE.createJDTTypeParameter())); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodBodyItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodBodyItemProvider.java deleted file mode 100644 index 6e2cc034d23..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodBodyItemProvider.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody} object. - * - * - * - * @generated - */ -public class JDTMethodBodyItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTMethodBodyItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - return getString("_UI_JDTMethodBody_type"); - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. - * - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return JdtmmEditPlugin.INSTANCE; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodItemProvider.java deleted file mode 100644 index c99f0c834ec..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodItemProvider.java +++ /dev/null @@ -1,371 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod} object. - * - * - * - * @generated - */ -public class JDTMethodItemProvider - extends JDTMemberItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTMethodItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addAbstractPropertyDescriptor(object); - addFinalPropertyDescriptor(object); - addStaticPropertyDescriptor(object); - addExceptionsPropertyDescriptor(object); - addSynchronizedPropertyDescriptor(object); - addConstructorPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Abstract feature. - * - * - * - * @generated - */ - protected void addAbstractPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTMethod_abstract_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTMethod_abstract_feature", "_UI_JDTMethod_type"), - JdtmmPackage.Literals.JDT_METHOD__ABSTRACT, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Final feature. - * - * - * - * @generated - */ - protected void addFinalPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTMethod_final_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTMethod_final_feature", "_UI_JDTMethod_type"), - JdtmmPackage.Literals.JDT_METHOD__FINAL, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Static feature. - * - * - * - * @generated - */ - protected void addStaticPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTMethod_static_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTMethod_static_feature", "_UI_JDTMethod_type"), - JdtmmPackage.Literals.JDT_METHOD__STATIC, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Exceptions feature. - * - * - * - * @generated - */ - protected void addExceptionsPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTMethod_exceptions_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTMethod_exceptions_feature", "_UI_JDTMethod_type"), - JdtmmPackage.Literals.JDT_METHOD__EXCEPTIONS, - true, - false, - true, - null, - null, - null)); - } - - /** - * This adds a property descriptor for the Synchronized feature. - * - * - * - * @generated - */ - protected void addSynchronizedPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTMethod_synchronized_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTMethod_synchronized_feature", "_UI_JDTMethod_type"), - JdtmmPackage.Literals.JDT_METHOD__SYNCHRONIZED, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Constructor feature. - * - * - * - * @generated - */ - protected void addConstructorPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTMethod_constructor_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTMethod_constructor_feature", "_UI_JDTMethod_type"), - JdtmmPackage.Literals.JDT_METHOD__CONSTRUCTOR, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(JdtmmPackage.Literals.JDT_METHOD__RETURN_TYPE); - childrenFeatures.add(JdtmmPackage.Literals.JDT_METHOD__PARAMETERS); - childrenFeatures.add(JdtmmPackage.Literals.JDT_METHOD__BODIES); - } - return childrenFeatures; - } - - /** - * - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns JDTMethod.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTMethod")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTMethod) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTMethod_type") : - getString("_UI_JDTMethod_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTMethod.class)) { - case JdtmmPackage.JDT_METHOD__ABSTRACT: - case JdtmmPackage.JDT_METHOD__FINAL: - case JdtmmPackage.JDT_METHOD__STATIC: - case JdtmmPackage.JDT_METHOD__SYNCHRONIZED: - case JdtmmPackage.JDT_METHOD__CONSTRUCTOR: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - case JdtmmPackage.JDT_METHOD__RETURN_TYPE: - case JdtmmPackage.JDT_METHOD__PARAMETERS: - case JdtmmPackage.JDT_METHOD__BODIES: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_METHOD__RETURN_TYPE, - JdtmmFactory.eINSTANCE.createJDTParameter())); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_METHOD__PARAMETERS, - JdtmmFactory.eINSTANCE.createJDTParameter())); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_METHOD__BODIES, - JdtmmFactory.eINSTANCE.createJDTOpaqueBody())); - } - - /** - * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}. - * - * - * - * @generated - */ - @Override - public String getCreateChildText(Object owner, Object feature, Object child, Collection selection) { - Object childFeature = feature; - Object childObject = child; - - boolean qualify = - childFeature == JdtmmPackage.Literals.JDT_METHOD__RETURN_TYPE || - childFeature == JdtmmPackage.Literals.JDT_METHOD__PARAMETERS; - - if (qualify) { - return getString("_UI_CreateChild_text2", - new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) }); - } - return super.getCreateChildText(owner, feature, child, selection); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTOpaqueBodyItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTOpaqueBodyItemProvider.java deleted file mode 100644 index 4f60a443ca8..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTOpaqueBodyItemProvider.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody} object. - * - * - * - * @generated - */ -public class JDTOpaqueBodyItemProvider - extends JDTMethodBodyItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTOpaqueBodyItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - add_bodyPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the body feature. - * - * - * - * @generated - */ - protected void add_bodyPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTOpaqueBody__body_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTOpaqueBody__body_feature", "_UI_JDTOpaqueBody_type"), - JdtmmPackage.Literals.JDT_OPAQUE_BODY__BODY, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns JDTOpaqueBody.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTOpaqueBody")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTOpaqueBody) object).get_body(); - return label == null || label.length() == 0 ? - getString("_UI_JDTOpaqueBody_type") : - getString("_UI_JDTOpaqueBody_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTOpaqueBody.class)) { - case JdtmmPackage.JDT_OPAQUE_BODY__BODY: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentItemProvider.java deleted file mode 100644 index 105e8771d7a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentItemProvider.java +++ /dev/null @@ -1,232 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.uml2.common.edit.command.SubsetAddCommand; -import org.eclipse.uml2.common.edit.command.SubsetSupersetReplaceCommand; -import org.eclipse.uml2.common.edit.command.SupersetRemoveCommand; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment} object. - * - * - * - * @generated - */ -public class JDTPackageFragmentItemProvider - extends JDTParentJavaElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTPackageFragmentItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS); - } - return childrenFeatures; - } - - /** - * - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns JDTPackageFragment.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTPackageFragment")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTPackageFragment) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTPackageFragment_type") : - getString("_UI_JDTPackageFragment_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTPackageFragment.class)) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS, - JdtmmFactory.eINSTANCE.createJDTCompilationUnit())); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createAddCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection, int) - * - * - * @generated - */ - @Override - protected Command createAddCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection, int index) { - if (feature == JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS) { - return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); - } - return super.createAddCommand(domain, owner, feature, collection, index); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection) - * - * - * @generated - */ - @Override - protected Command createRemoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection) { - if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { - return new SupersetRemoveCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS }, collection); - } - return super.createRemoveCommand(domain, owner, feature, collection); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createReplaceCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject, java.util.Collection) - * - * - * @generated - */ - @Override - protected Command createReplaceCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, EObject value, Collection collection) { - if (feature == JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS) { - return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); - } - if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { - return new SubsetSupersetReplaceCommand(domain, owner, feature, null, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS }, value, collection); - } - return super.createReplaceCommand(domain, owner, feature, value, collection); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentRootItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentRootItemProvider.java deleted file mode 100644 index 422c5ef7803..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentRootItemProvider.java +++ /dev/null @@ -1,232 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.uml2.common.edit.command.SubsetAddCommand; -import org.eclipse.uml2.common.edit.command.SubsetSupersetReplaceCommand; -import org.eclipse.uml2.common.edit.command.SupersetRemoveCommand; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot} object. - * - * - * - * @generated - */ -public class JDTPackageFragmentRootItemProvider - extends JDTParentJavaElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTPackageFragmentRootItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS); - } - return childrenFeatures; - } - - /** - * - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns JDTPackageFragmentRoot.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTPackageFragmentRoot")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTPackageFragmentRoot) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTPackageFragmentRoot_type") : - getString("_UI_JDTPackageFragmentRoot_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTPackageFragmentRoot.class)) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS, - JdtmmFactory.eINSTANCE.createJDTPackageFragment())); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createAddCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection, int) - * - * - * @generated - */ - @Override - protected Command createAddCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection, int index) { - if (feature == JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS) { - return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); - } - return super.createAddCommand(domain, owner, feature, collection, index); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection) - * - * - * @generated - */ - @Override - protected Command createRemoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection) { - if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { - return new SupersetRemoveCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS }, collection); - } - return super.createRemoveCommand(domain, owner, feature, collection); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createReplaceCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject, java.util.Collection) - * - * - * @generated - */ - @Override - protected Command createReplaceCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, EObject value, Collection collection) { - if (feature == JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS) { - return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); - } - if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { - return new SubsetSupersetReplaceCommand(domain, owner, feature, null, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS }, value, collection); - } - return super.createReplaceCommand(domain, owner, feature, value, collection); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParameterItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParameterItemProvider.java deleted file mode 100644 index 5b752d26f95..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParameterItemProvider.java +++ /dev/null @@ -1,218 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter} object. - * - * - * - * @generated - */ -public class JDTParameterItemProvider - extends JDTMemberItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTParameterItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addFinalPropertyDescriptor(object); - addIsMultiValuedPropertyDescriptor(object); - addTypePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Final feature. - * - * - * - * @generated - */ - protected void addFinalPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTParameter_final_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTParameter_final_feature", "_UI_JDTParameter_type"), - JdtmmPackage.Literals.JDT_PARAMETER__FINAL, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Multi Valued feature. - * - * - * - * @generated - */ - protected void addIsMultiValuedPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTParameter_isMultiValued_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTParameter_isMultiValued_feature", "_UI_JDTParameter_type"), - JdtmmPackage.Literals.JDT_PARAMETER__IS_MULTI_VALUED, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Type feature. - * - * - * - * @generated - */ - protected void addTypePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTParameter_type_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTParameter_type_feature", "_UI_JDTParameter_type"), - JdtmmPackage.Literals.JDT_PARAMETER__TYPE, - true, - false, - true, - null, - null, - null)); - } - - /** - * This returns JDTParameter.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTParameter")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTParameter) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTParameter_type") : - getString("_UI_JDTParameter_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTParameter.class)) { - case JdtmmPackage.JDT_PARAMETER__FINAL: - case JdtmmPackage.JDT_PARAMETER__IS_MULTI_VALUED: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentItemProvider.java deleted file mode 100644 index 86e1fbe2a9f..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentItemProvider.java +++ /dev/null @@ -1,193 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent} object. - * - * - * - * @generated - */ -public class JDTParentItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTParentItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addChildrenPropertyDescriptor(object); - addFlagsPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Flags feature. - * - * - * - * @generated - */ - protected void addFlagsPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTParent_flags_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTParent_flags_feature", "_UI_JDTParent_type"), - JdtmmPackage.Literals.JDT_PARENT__FLAGS, - true, - false, - false, - ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Children feature. - * - * - * - * @generated - */ - protected void addChildrenPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTParent_children_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTParent_children_feature", "_UI_JDTParent_type"), - JdtmmPackage.Literals.JDT_PARENT__CHILDREN, - false, - false, - false, - null, - null, - null)); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - JDTParent jdtParent = (JDTParent) object; - return getString("_UI_JDTParent_type") + " " + jdtParent.getFlags(); - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTParent.class)) { - case JdtmmPackage.JDT_PARENT__FLAGS: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. - * - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return JdtmmEditPlugin.INSTANCE; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentJavaElementItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentJavaElementItemProvider.java deleted file mode 100644 index 069b6c12c76..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentJavaElementItemProvider.java +++ /dev/null @@ -1,181 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement} object. - * - * - * - * @generated - */ -public class JDTParentJavaElementItemProvider - extends JDTJavaElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTParentJavaElementItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addChildrenPropertyDescriptor(object); - addFlagsPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Flags feature. - * - * - * - * @generated - */ - protected void addFlagsPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTParent_flags_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTParent_flags_feature", "_UI_JDTParent_type"), - JdtmmPackage.Literals.JDT_PARENT__FLAGS, - true, - false, - false, - ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Children feature. - * - * - * - * @generated - */ - protected void addChildrenPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTParent_children_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTParent_children_feature", "_UI_JDTParent_type"), - JdtmmPackage.Literals.JDT_PARENT__CHILDREN, - false, - false, - false, - null, - null, - null)); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTParentJavaElement) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTParentJavaElement_type") : - getString("_UI_JDTParentJavaElement_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTParentJavaElement.class)) { - case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeItemProvider.java deleted file mode 100644 index 7a99105e5a1..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeItemProvider.java +++ /dev/null @@ -1,508 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.uml2.common.edit.command.SubsetAddCommand; -import org.eclipse.uml2.common.edit.command.SubsetSupersetReplaceCommand; -import org.eclipse.uml2.common.edit.command.SupersetRemoveCommand; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType} object. - * - * - * - * @generated - */ -public class JDTTypeItemProvider - extends JDTMemberItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTTypeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addClassPropertyDescriptor(object); - addInterfacePropertyDescriptor(object); - addEnumPropertyDescriptor(object); - addAbstractPropertyDescriptor(object); - addFinalPropertyDescriptor(object); - addStaticPropertyDescriptor(object); - addSuperInterfacesPropertyDescriptor(object); - addSuperClassPropertyDescriptor(object); - addSuperInterfaceNamesPropertyDescriptor(object); - addSuperClassNamePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Class feature. - * - * - * - * @generated - */ - protected void addClassPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTType_class_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTType_class_feature", "_UI_JDTType_type"), - JdtmmPackage.Literals.JDT_TYPE__CLASS, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Interface feature. - * - * - * - * @generated - */ - protected void addInterfacePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTType_interface_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTType_interface_feature", "_UI_JDTType_type"), - JdtmmPackage.Literals.JDT_TYPE__INTERFACE, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Enum feature. - * - * - * - * @generated - */ - protected void addEnumPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTType_enum_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTType_enum_feature", "_UI_JDTType_type"), - JdtmmPackage.Literals.JDT_TYPE__ENUM, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Abstract feature. - * - * - * - * @generated - */ - protected void addAbstractPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTType_abstract_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTType_abstract_feature", "_UI_JDTType_type"), - JdtmmPackage.Literals.JDT_TYPE__ABSTRACT, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Final feature. - * - * - * - * @generated - */ - protected void addFinalPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTType_final_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTType_final_feature", "_UI_JDTType_type"), - JdtmmPackage.Literals.JDT_TYPE__FINAL, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Static feature. - * - * - * - * @generated - */ - protected void addStaticPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTType_static_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTType_static_feature", "_UI_JDTType_type"), - JdtmmPackage.Literals.JDT_TYPE__STATIC, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Super Interfaces feature. - * - * - * - * @generated - */ - protected void addSuperInterfacesPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTType_superInterfaces_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTType_superInterfaces_feature", "_UI_JDTType_type"), - JdtmmPackage.Literals.JDT_TYPE__SUPER_INTERFACES, - true, - false, - true, - null, - null, - null)); - } - - /** - * This adds a property descriptor for the Super Class feature. - * - * - * - * @generated - */ - protected void addSuperClassPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTType_superClass_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTType_superClass_feature", "_UI_JDTType_type"), - JdtmmPackage.Literals.JDT_TYPE__SUPER_CLASS, - true, - false, - true, - null, - null, - null)); - } - - /** - * This adds a property descriptor for the Super Interface Names feature. - * - * - * - * @generated - */ - protected void addSuperInterfaceNamesPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTType_superInterfaceNames_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTType_superInterfaceNames_feature", "_UI_JDTType_type"), - JdtmmPackage.Literals.JDT_TYPE__SUPER_INTERFACE_NAMES, - false, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Super Class Name feature. - * - * - * - * @generated - */ - protected void addSuperClassNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JDTType_superClassName_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JDTType_superClassName_feature", "_UI_JDTType_type"), - JdtmmPackage.Literals.JDT_TYPE__SUPER_CLASS_NAME, - false, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(JdtmmPackage.Literals.JDT_TYPE__METHODS); - childrenFeatures.add(JdtmmPackage.Literals.JDT_TYPE__FIELDS); - childrenFeatures.add(JdtmmPackage.Literals.JDT_TYPE__TYPES); - } - return childrenFeatures; - } - - /** - * - * - * - * @generated - */ - @Override - protected EStructuralFeature getChildFeature(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildFeature(object, child); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTType) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTType_type") : - getString("_UI_JDTType_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JDTType.class)) { - case JdtmmPackage.JDT_TYPE__CLASS: - case JdtmmPackage.JDT_TYPE__INTERFACE: - case JdtmmPackage.JDT_TYPE__ENUM: - case JdtmmPackage.JDT_TYPE__ABSTRACT: - case JdtmmPackage.JDT_TYPE__FINAL: - case JdtmmPackage.JDT_TYPE__STATIC: - case JdtmmPackage.JDT_TYPE__SUPER_INTERFACE_NAMES: - case JdtmmPackage.JDT_TYPE__SUPER_CLASS_NAME: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - case JdtmmPackage.JDT_TYPE__METHODS: - case JdtmmPackage.JDT_TYPE__FIELDS: - case JdtmmPackage.JDT_TYPE__TYPES: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_TYPE__METHODS, - JdtmmFactory.eINSTANCE.createJDTMethod())); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_TYPE__FIELDS, - JdtmmFactory.eINSTANCE.createJDTField())); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_TYPE__TYPES, - JdtmmFactory.eINSTANCE.createJDTClass())); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_TYPE__TYPES, - JdtmmFactory.eINSTANCE.createJDTInterface())); - - newChildDescriptors.add - (createChildParameter - (JdtmmPackage.Literals.JDT_TYPE__TYPES, - JdtmmFactory.eINSTANCE.createJDTEnum())); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createAddCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection, int) - * - * - * @generated - */ - @Override - protected Command createAddCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection, int index) { - if (feature == JdtmmPackage.Literals.JDT_TYPE__METHODS) { - return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); - } - if (feature == JdtmmPackage.Literals.JDT_TYPE__FIELDS) { - return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); - } - if (feature == JdtmmPackage.Literals.JDT_TYPE__TYPES) { - return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); - } - return super.createAddCommand(domain, owner, feature, collection, index); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection) - * - * - * @generated - */ - @Override - protected Command createRemoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection) { - if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { - return new SupersetRemoveCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_TYPE__METHODS, JdtmmPackage.Literals.JDT_TYPE__FIELDS, JdtmmPackage.Literals.JDT_TYPE__TYPES }, collection); - } - return super.createRemoveCommand(domain, owner, feature, collection); - } - - /** - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createReplaceCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject, java.util.Collection) - * - * - * @generated - */ - @Override - protected Command createReplaceCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, EObject value, Collection collection) { - if (feature == JdtmmPackage.Literals.JDT_TYPE__METHODS) { - return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); - } - if (feature == JdtmmPackage.Literals.JDT_TYPE__FIELDS) { - return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); - } - if (feature == JdtmmPackage.Literals.JDT_TYPE__TYPES) { - return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); - } - if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { - return new SubsetSupersetReplaceCommand(domain, owner, feature, null, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_TYPE__METHODS, JdtmmPackage.Literals.JDT_TYPE__FIELDS, JdtmmPackage.Literals.JDT_TYPE__TYPES }, value, collection); - } - return super.createReplaceCommand(domain, owner, feature, value, collection); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeParameterItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeParameterItemProvider.java deleted file mode 100644 index 855887da62c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeParameterItemProvider.java +++ /dev/null @@ -1,135 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter} object. - * - * - * - * @generated - */ -public class JDTTypeParameterItemProvider - extends JDTJavaElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTTypeParameterItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This returns JDTTypeParameter.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTTypeParameter")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTTypeParameter) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTTypeParameter_type") : - getString("_UI_JDTTypeParameter_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeRootItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeRootItemProvider.java deleted file mode 100644 index 8863ab761cf..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeRootItemProvider.java +++ /dev/null @@ -1,123 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot} object. - * - * - * - * @generated - */ -public class JDTTypeRootItemProvider - extends JDTParentJavaElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JDTTypeRootItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - } - return itemPropertyDescriptors; - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JDTTypeRoot) object).getElementName(); - return label == null || label.length() == 0 ? - getString("_UI_JDTTypeRoot_type") : - getString("_UI_JDTTypeRoot_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmEditPlugin.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmEditPlugin.java deleted file mode 100644 index 3dd25b4756d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmEditPlugin.java +++ /dev/null @@ -1,115 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - -import org.eclipse.emf.common.EMFPlugin; -import org.eclipse.emf.common.util.ResourceLocator; - -/** - * This is the central singleton for the Jdtmm edit plugin. - * - * - * - * @generated - */ -public final class JdtmmEditPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * - * @generated - */ - public static final JdtmmEditPlugin INSTANCE = new JdtmmEditPlugin(); - - /** - * Keep track of the singleton. - * - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * - * @generated - */ - public JdtmmEditPlugin() { - super(new ResourceLocator[] { - }); - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * - * @return the singleton instance. - * @generated - */ - @Override - public ResourceLocator getPluginResourceLocator() { - return plugin; - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * - * @return the singleton instance. - * @generated - */ - public static Implementation getPlugin() { - return plugin; - } - - /** - * The actual implementation of the Eclipse Plugin. - * - * - * - * @generated - */ - public static class Implementation extends EclipsePlugin { - /** - * Creates an instance. - * - * - * - * @generated - */ - public Implementation() { - super(); - - // Remember the static instance. - // - plugin = this; - } - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmItemProviderAdapterFactory.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmItemProviderAdapterFactory.java deleted file mode 100644 index 406acea650c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmItemProviderAdapterFactory.java +++ /dev/null @@ -1,661 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IDisposable; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util.JdtmmAdapterFactory; - -/** - * This is the factory that is used to provide the interfaces needed to support Viewers. - * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. - * The adapters also support Eclipse property sheets. - * Note that most of the adapters are shared among multiple instances. - * - * - * - * @generated - */ -public class JdtmmItemProviderAdapterFactory extends JdtmmAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - * - * - * - * @generated - */ - protected ComposedAdapterFactory parentAdapterFactory; - - /** - * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. - * - * - * - * @generated - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - - /** - * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. - * - * - * - * @generated - */ - protected Collection supportedTypes = new ArrayList(); - - /** - * This constructs an instance. - * - * - * - * @generated - */ - public JdtmmItemProviderAdapterFactory() { - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemLabelProvider.class); - supportedTypes.add(IItemPropertySource.class); - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter} instances. - * - * - * - * @generated - */ - protected JDTTypeParameterItemProvider jdtTypeParameterItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTTypeParameterAdapter() { - if (jdtTypeParameterItemProvider == null) { - jdtTypeParameterItemProvider = new JDTTypeParameterItemProvider(this); - } - - return jdtTypeParameterItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField} instances. - * - * - * - * @generated - */ - protected JDTFieldItemProvider jdtFieldItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTFieldAdapter() { - if (jdtFieldItemProvider == null) { - jdtFieldItemProvider = new JDTFieldItemProvider(this); - } - - return jdtFieldItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod} instances. - * - * - * - * @generated - */ - protected JDTMethodItemProvider jdtMethodItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTMethodAdapter() { - if (jdtMethodItemProvider == null) { - jdtMethodItemProvider = new JDTMethodItemProvider(this); - } - - return jdtMethodItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter} instances. - * - * - * - * @generated - */ - protected JDTParameterItemProvider jdtParameterItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTParameterAdapter() { - if (jdtParameterItemProvider == null) { - jdtParameterItemProvider = new JDTParameterItemProvider(this); - } - - return jdtParameterItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit} instances. - * - * - * - * @generated - */ - protected JDTCompilationUnitItemProvider jdtCompilationUnitItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTCompilationUnitAdapter() { - if (jdtCompilationUnitItemProvider == null) { - jdtCompilationUnitItemProvider = new JDTCompilationUnitItemProvider(this); - } - - return jdtCompilationUnitItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment} instances. - * - * - * - * @generated - */ - protected JDTPackageFragmentItemProvider jdtPackageFragmentItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTPackageFragmentAdapter() { - if (jdtPackageFragmentItemProvider == null) { - jdtPackageFragmentItemProvider = new JDTPackageFragmentItemProvider(this); - } - - return jdtPackageFragmentItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot} instances. - * - * - * - * @generated - */ - protected JDTPackageFragmentRootItemProvider jdtPackageFragmentRootItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTPackageFragmentRootAdapter() { - if (jdtPackageFragmentRootItemProvider == null) { - jdtPackageFragmentRootItemProvider = new JDTPackageFragmentRootItemProvider(this); - } - - return jdtPackageFragmentRootItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject} instances. - * - * - * - * @generated - */ - protected JDTJavaProjectItemProvider jdtJavaProjectItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTJavaProjectAdapter() { - if (jdtJavaProjectItemProvider == null) { - jdtJavaProjectItemProvider = new JDTJavaProjectItemProvider(this); - } - - return jdtJavaProjectItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel} instances. - * - * - * - * @generated - */ - protected JDTJavaModelItemProvider jdtJavaModelItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTJavaModelAdapter() { - if (jdtJavaModelItemProvider == null) { - jdtJavaModelItemProvider = new JDTJavaModelItemProvider(this); - } - - return jdtJavaModelItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass} instances. - * - * - * - * @generated - */ - protected JDTClassItemProvider jdtClassItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTClassAdapter() { - if (jdtClassItemProvider == null) { - jdtClassItemProvider = new JDTClassItemProvider(this); - } - - return jdtClassItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface} instances. - * - * - * - * @generated - */ - protected JDTInterfaceItemProvider jdtInterfaceItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTInterfaceAdapter() { - if (jdtInterfaceItemProvider == null) { - jdtInterfaceItemProvider = new JDTInterfaceItemProvider(this); - } - - return jdtInterfaceItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum} instances. - * - * - * - * @generated - */ - protected JDTEnumItemProvider jdtEnumItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTEnumAdapter() { - if (jdtEnumItemProvider == null) { - jdtEnumItemProvider = new JDTEnumItemProvider(this); - } - - return jdtEnumItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration} instances. - * - * - * - * @generated - */ - protected JDTImportDeclarationItemProvider jdtImportDeclarationItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTImportDeclarationAdapter() { - if (jdtImportDeclarationItemProvider == null) { - jdtImportDeclarationItemProvider = new JDTImportDeclarationItemProvider(this); - } - - return jdtImportDeclarationItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer} instances. - * - * - * - * @generated - */ - protected JDTImportContainerItemProvider jdtImportContainerItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTImportContainerAdapter() { - if (jdtImportContainerItemProvider == null) { - jdtImportContainerItemProvider = new JDTImportContainerItemProvider(this); - } - - return jdtImportContainerItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException} instances. - * - * - * - * @generated - */ - protected JDTExceptionItemProvider jdtExceptionItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTExceptionAdapter() { - if (jdtExceptionItemProvider == null) { - jdtExceptionItemProvider = new JDTExceptionItemProvider(this); - } - - return jdtExceptionItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody} instances. - * - * - * - * @generated - */ - protected JDTOpaqueBodyItemProvider jdtOpaqueBodyItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody}. - * - * - * - * @generated - */ - @Override - public Adapter createJDTOpaqueBodyAdapter() { - if (jdtOpaqueBodyItemProvider == null) { - jdtOpaqueBodyItemProvider = new JDTOpaqueBodyItemProvider(this); - } - - return jdtOpaqueBodyItemProvider; - } - - /** - * This returns the root adapter factory that contains this factory. - * - * - * - * @generated - */ - @Override - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - /** - * This sets the composed adapter factory that contains this factory. - * - * - * - * @generated - */ - @Override - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isFactoryForType(Object type) { - return supportedTypes.contains(type) || super.isFactoryForType(type); - } - - /** - * This implementation substitutes the factory itself as the key for the adapter. - * - * - * - * @generated - */ - @Override - public Adapter adapt(Notifier notifier, Object type) { - return super.adapt(notifier, this); - } - - /** - * - * - * - * @generated - */ - @Override - public Object adapt(Object object, Object type) { - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - /** - * This adds a listener. - * - * - * - * @generated - */ - @Override - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This removes a listener. - * - * - * - * @generated - */ - @Override - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. - * - * - * - * @generated - */ - @Override - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This disposes all of the item providers created by this factory. - * - * - * - * @generated - */ - @Override - public void dispose() { - if (jdtMethodItemProvider != null) { - jdtMethodItemProvider.dispose(); - } - if (jdtTypeParameterItemProvider != null) { - jdtTypeParameterItemProvider.dispose(); - } - if (jdtFieldItemProvider != null) { - jdtFieldItemProvider.dispose(); - } - if (jdtCompilationUnitItemProvider != null) { - jdtCompilationUnitItemProvider.dispose(); - } - if (jdtPackageFragmentItemProvider != null) { - jdtPackageFragmentItemProvider.dispose(); - } - if (jdtPackageFragmentRootItemProvider != null) { - jdtPackageFragmentRootItemProvider.dispose(); - } - if (jdtJavaProjectItemProvider != null) { - jdtJavaProjectItemProvider.dispose(); - } - if (jdtJavaModelItemProvider != null) { - jdtJavaModelItemProvider.dispose(); - } - if (jdtParameterItemProvider != null) { - jdtParameterItemProvider.dispose(); - } - if (jdtClassItemProvider != null) { - jdtClassItemProvider.dispose(); - } - if (jdtInterfaceItemProvider != null) { - jdtInterfaceItemProvider.dispose(); - } - if (jdtEnumItemProvider != null) { - jdtEnumItemProvider.dispose(); - } - if (jdtImportDeclarationItemProvider != null) { - jdtImportDeclarationItemProvider.dispose(); - } - if (jdtImportContainerItemProvider != null) { - jdtImportContainerItemProvider.dispose(); - } - if (jdtExceptionItemProvider != null) { - jdtExceptionItemProvider.dispose(); - } - if (jdtOpaqueBodyItemProvider != null) { - jdtOpaqueBodyItemProvider.dispose(); - } - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.classpath b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.project b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.project deleted file mode 100644 index 3d0615d9665..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.java.generator.metamodel.jdt.editor - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.core.prefs b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94d61f00da6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/META-INF/MANIFEST.MF b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/META-INF/MANIFEST.MF deleted file mode 100644 index 14f61d6d866..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.presentation -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.core.resources;visibility:=reexport, - org.eclipse.papyrus.java.generator.metamodel.jdt.edit;bundle-version="1.2.0";visibility:=reexport, - org.eclipse.emf.ecore.xmi;visibility:=reexport, - org.eclipse.emf.edit.ui;visibility:=reexport, - org.eclipse.ui.ide;visibility:=reexport -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.presentation.GeneratoroptionsmmEditorPlugin$Implementation -Bundle-SymbolicName: org.eclipse.papyrus.java.generator.metamodel.jdt.editor;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/about.html b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/build.properties b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/build.properties deleted file mode 100644 index f4610251623..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/build.properties +++ /dev/null @@ -1,12 +0,0 @@ -# - -bin.includes = .,\ - icons/,\ - META-INF/,\ - plugin.xml,\ - plugin.properties,\ - about.html -jars.compile.order = . -source.. = src/ -output.. = bin -src.includes = about.html diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/obj16/JdtmmModelFile.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/obj16/JdtmmModelFile.gif deleted file mode 100644 index a99fd8140c4..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/obj16/JdtmmModelFile.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/wizban/NewJdtmm.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/wizban/NewJdtmm.gif deleted file mode 100644 index 897c9baa83c..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/wizban/NewJdtmm.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.properties b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.properties deleted file mode 100644 index e799174fb7c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.properties +++ /dev/null @@ -1,53 +0,0 @@ -# - -pluginName = Jdt metamodel Editor (Incubation) -providerName = Eclipse Modeling Project - -_UI_GeneratoroptionsmmEditor_menu = &Generatoroptionsmm Editor - -_UI_CreateChild_menu_item = &New Child -_UI_CreateSibling_menu_item = N&ew Sibling - -_UI_ShowPropertiesView_menu_item = Show &Properties View -_UI_RefreshViewer_menu_item = &Refresh - -_UI_SelectionPage_label = Selection -_UI_ParentPage_label = Parent -_UI_ListPage_label = List -_UI_TreePage_label = Tree -_UI_TablePage_label = Table -_UI_TreeWithColumnsPage_label = Tree with Columns -_UI_ObjectColumn_label = Object -_UI_SelfColumn_label = Self - -_UI_NoObjectSelected = Selected Nothing -_UI_SingleObjectSelected = Selected Object: {0} -_UI_MultiObjectSelected = Selected {0} Objects - -_UI_OpenEditorError_label = Open Editor - -_UI_Wizard_category = Example EMF Model Creation Wizards - -_UI_CreateModelError_message = Problems encountered in file "{0}" - -_UI_GeneratoroptionsmmModelWizard_label = Generatoroptionsmm Model -_UI_GeneratoroptionsmmModelWizard_description = Create a new Generatoroptionsmm model - -_UI_GeneratoroptionsmmEditor_label = Generatoroptionsmm Model Editor - -_UI_GeneratoroptionsmmEditorFilenameDefaultBase = My -_UI_GeneratoroptionsmmEditorFilenameExtensions = generatoroptionsmm - -_UI_Wizard_label = New - -_WARN_FilenameExtension = The file name must end in ''.{0}'' -_WARN_FilenameExtensions = The file name must have one of the following extensions: {0} - -_UI_ModelObject = &Model Object -_UI_XMLEncoding = &XML Encoding -_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1 -_UI_Wizard_initial_object_description = Select a model object to create - -_UI_FileConflict_label = File Conflict -_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes? - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.xml b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.xml deleted file mode 100644 index 811f7e9bc6f..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - %_UI_GeneratoroptionsmmModelWizard_description - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/pom.xml b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/pom.xml deleted file mode 100644 index 6d65def46cb..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.java.generator.metamodel.jdt.editor - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmActionBarContributor.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmActionBarContributor.java deleted file mode 100644 index ba68a1509a8..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmActionBarContributor.java +++ /dev/null @@ -1,441 +0,0 @@ -/** - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.presentation; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.ui.viewer.IViewerProvider; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.domain.IEditingDomainProvider; -import org.eclipse.emf.edit.ui.action.ControlAction; -import org.eclipse.emf.edit.ui.action.CreateChildAction; -import org.eclipse.emf.edit.ui.action.CreateSiblingAction; -import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; -import org.eclipse.emf.edit.ui.action.LoadResourceAction; -import org.eclipse.emf.edit.ui.action.ValidateAction; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.ActionContributionItem; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IContributionItem; -import org.eclipse.jface.action.IContributionManager; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.action.SubContributionItem; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.PartInitException; - -/** - * This is the action bar contributor for the Generatoroptionsmm model editor. - * - * - * - * @generated - */ -public class GeneratoroptionsmmActionBarContributor - extends EditingDomainActionBarContributor - implements ISelectionChangedListener { - /** - * This keeps track of the active editor. - * - * - * - * @generated - */ - protected IEditorPart activeEditorPart; - - /** - * This keeps track of the current selection provider. - * - * - * - * @generated - */ - protected ISelectionProvider selectionProvider; - - /** - * This action opens the Properties view. - * - * - * - * @generated - */ - protected IAction showPropertiesViewAction = - new Action(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { - @Override - public void run() { - try { - getPage().showView("org.eclipse.ui.views.PropertySheet"); - } - catch (PartInitException exception) { - GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); - } - } - }; - - /** - * This action refreshes the viewer of the current editor if the editor - * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. - * - * - * - * @generated - */ - protected IAction refreshViewerAction = - new Action(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) { - @Override - public boolean isEnabled() { - return activeEditorPart instanceof IViewerProvider; - } - - @Override - public void run() { - if (activeEditorPart instanceof IViewerProvider) { - Viewer viewer = ((IViewerProvider) activeEditorPart).getViewer(); - if (viewer != null) { - viewer.refresh(); - } - } - } - }; - - /** - * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor - * generated for the current selection by the item provider. - * - * - * - * @generated - */ - protected Collection createChildActions; - - /** - * This is the menu manager into which menu contribution items should be added for CreateChild actions. - * - * - * - * @generated - */ - protected IMenuManager createChildMenuManager; - - /** - * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor - * generated for the current selection by the item provider. - * - * - * - * @generated - */ - protected Collection createSiblingActions; - - /** - * This is the menu manager into which menu contribution items should be added for CreateSibling actions. - * - * - * - * @generated - */ - protected IMenuManager createSiblingMenuManager; - - /** - * This creates an instance of the contributor. - * - * - * - * @generated - */ - public GeneratoroptionsmmActionBarContributor() { - super(ADDITIONS_LAST_STYLE); - loadResourceAction = new LoadResourceAction(); - validateAction = new ValidateAction(); - controlAction = new ControlAction(); - } - - /** - * This adds Separators for editor additions to the tool bar. - * - * - * - * @generated - */ - @Override - public void contributeToToolBar(IToolBarManager toolBarManager) { - toolBarManager.add(new Separator("generatoroptionsmm-settings")); - toolBarManager.add(new Separator("generatoroptionsmm-additions")); - } - - /** - * This adds to the menu bar a menu and some separators for editor additions, - * as well as the sub-menus for object creation items. - * - * - * - * @generated - */ - @Override - public void contributeToMenu(IMenuManager menuManager) { - super.contributeToMenu(menuManager); - - IMenuManager submenuManager = new MenuManager(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmEditor_menu"), "org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmmMenuID"); - menuManager.insertAfter("additions", submenuManager); - submenuManager.add(new Separator("settings")); - submenuManager.add(new Separator("actions")); - submenuManager.add(new Separator("additions")); - submenuManager.add(new Separator("additions-end")); - - // Prepare for CreateChild item addition or removal. - // - createChildMenuManager = new MenuManager(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - submenuManager.insertBefore("additions", createChildMenuManager); - - // Prepare for CreateSibling item addition or removal. - // - createSiblingMenuManager = new MenuManager(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - submenuManager.insertBefore("additions", createSiblingMenuManager); - - // Force an update because Eclipse hides empty menus now. - // - submenuManager.addMenuListener - (new IMenuListener() { - @Override - public void menuAboutToShow(IMenuManager menuManager) { - menuManager.updateAll(true); - } - }); - - addGlobalActions(submenuManager); - } - - /** - * When the active editor changes, this remembers the change and registers with it as a selection provider. - * - * - * - * @generated - */ - @Override - public void setActiveEditor(IEditorPart part) { - super.setActiveEditor(part); - activeEditorPart = part; - - // Switch to the new selection provider. - // - if (selectionProvider != null) { - selectionProvider.removeSelectionChangedListener(this); - } - if (part == null) { - selectionProvider = null; - } - else { - selectionProvider = part.getSite().getSelectionProvider(); - selectionProvider.addSelectionChangedListener(this); - - // Fake a selection changed event to update the menus. - // - if (selectionProvider.getSelection() != null) { - selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection())); - } - } - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener}, - * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings - * that can be added to the selected object and updating the menus accordingly. - * - * - * - * @generated - */ - @Override - public void selectionChanged(SelectionChangedEvent event) { - // Remove any menu items for old selection. - // - if (createChildMenuManager != null) { - depopulateManager(createChildMenuManager, createChildActions); - } - if (createSiblingMenuManager != null) { - depopulateManager(createSiblingMenuManager, createSiblingActions); - } - - // Query the new selection for appropriate new child/sibling descriptors - // - Collection newChildDescriptors = null; - Collection newSiblingDescriptors = null; - - ISelection selection = event.getSelection(); - if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) { - Object object = ((IStructuredSelection) selection).getFirstElement(); - - EditingDomain domain = ((IEditingDomainProvider) activeEditorPart).getEditingDomain(); - - newChildDescriptors = domain.getNewChildDescriptors(object, null); - newSiblingDescriptors = domain.getNewChildDescriptors(null, object); - } - - // Generate actions for selection; populate and redraw the menus. - // - createChildActions = generateCreateChildActions(newChildDescriptors, selection); - createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection); - - if (createChildMenuManager != null) { - populateManager(createChildMenuManager, createChildActions, null); - createChildMenuManager.update(true); - } - if (createSiblingMenuManager != null) { - populateManager(createSiblingMenuManager, createSiblingActions, null); - createSiblingMenuManager.update(true); - } - } - - /** - * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in descriptors, - * and returns the collection of these actions. - * - * - * - * @generated - */ - protected Collection generateCreateChildActions(Collection descriptors, ISelection selection) { - Collection actions = new ArrayList(); - if (descriptors != null) { - for (Object descriptor : descriptors) { - actions.add(new CreateChildAction(activeEditorPart, selection, descriptor)); - } - } - return actions; - } - - /** - * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in descriptors, - * and returns the collection of these actions. - * - * - * - * @generated - */ - protected Collection generateCreateSiblingActions(Collection descriptors, ISelection selection) { - Collection actions = new ArrayList(); - if (descriptors != null) { - for (Object descriptor : descriptors) { - actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); - } - } - return actions; - } - - /** - * This populates the specified manager with {@link org.eclipse.jface.action.ActionContributionItem}s - * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection, - * by inserting them before the specified contribution item contributionID. - * If contributionID is null, they are simply added. - * - * - * - * @generated - */ - protected void populateManager(IContributionManager manager, Collection actions, String contributionID) { - if (actions != null) { - for (IAction action : actions) { - if (contributionID != null) { - manager.insertBefore(contributionID, action); - } - else { - manager.add(action); - } - } - } - } - - /** - * This removes from the specified manager all {@link org.eclipse.jface.action.ActionContributionItem}s - * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection. - * - * - * - * @generated - */ - protected void depopulateManager(IContributionManager manager, Collection actions) { - if (actions != null) { - IContributionItem[] items = manager.getItems(); - for (int i = 0; i < items.length; i++) { - // Look into SubContributionItems - // - IContributionItem contributionItem = items[i]; - while (contributionItem instanceof SubContributionItem) { - contributionItem = ((SubContributionItem) contributionItem).getInnerItem(); - } - - // Delete the ActionContributionItems with matching action. - // - if (contributionItem instanceof ActionContributionItem) { - IAction action = ((ActionContributionItem) contributionItem).getAction(); - if (actions.contains(action)) { - manager.remove(contributionItem); - } - } - } - } - } - - /** - * This populates the pop-up menu before it appears. - * - * - * - * @generated - */ - @Override - public void menuAboutToShow(IMenuManager menuManager) { - super.menuAboutToShow(menuManager); - MenuManager submenuManager = null; - - submenuManager = new MenuManager(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - populateManager(submenuManager, createChildActions, null); - menuManager.insertBefore("edit", submenuManager); - - submenuManager = new MenuManager(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - populateManager(submenuManager, createSiblingActions, null); - menuManager.insertBefore("edit", submenuManager); - } - - /** - * This inserts global actions before the "additions-end" separator. - * - * - * - * @generated - */ - @Override - protected void addGlobalActions(IMenuManager menuManager) { - menuManager.insertAfter("additions-end", new Separator("ui-actions")); - menuManager.insertAfter("ui-actions", showPropertiesViewAction); - - refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); - menuManager.insertAfter("ui-actions", refreshViewerAction); - - super.addGlobalActions(menuManager); - } - - /** - * This ensures that a delete action will clean up all references to deleted objects. - * - * - * - * @generated - */ - @Override - protected boolean removeAllReferencesOnDelete() { - return true; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditor.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditor.java deleted file mode 100644 index 61e6583d63e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditor.java +++ /dev/null @@ -1,1884 +0,0 @@ -/** - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.presentation; - - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.EventObject; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.common.command.BasicCommandStack; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.command.CommandStackListener; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.ui.MarkerHelper; -import org.eclipse.emf.common.ui.ViewerPane; -import org.eclipse.emf.common.ui.editor.ProblemEditorPart; -import org.eclipse.emf.common.ui.viewer.IViewerProvider; -import org.eclipse.emf.common.util.BasicDiagnostic; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.EContentAdapter; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.domain.IEditingDomainProvider; -import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; -import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory; -import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; -import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; -import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter; -import org.eclipse.emf.edit.ui.dnd.LocalTransfer; -import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider; -import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper; -import org.eclipse.emf.edit.ui.util.EditUIUtil; -import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.util.LocalSelectionTransfer; -import org.eclipse.jface.viewers.ColumnWeightData; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ListViewer; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider.GeneratoroptionsmmItemProviderAdapterFactory; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CTabFolder; -import org.eclipse.swt.dnd.DND; -import org.eclipse.swt.dnd.FileTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.ControlAdapter; -import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.swt.widgets.TreeColumn; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.dialogs.SaveAsDialog; -import org.eclipse.ui.ide.IGotoMarker; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.MultiPageEditorPart; -import org.eclipse.ui.views.contentoutline.ContentOutline; -import org.eclipse.ui.views.contentoutline.ContentOutlinePage; -import org.eclipse.ui.views.contentoutline.IContentOutlinePage; -import org.eclipse.ui.views.properties.IPropertySheetPage; -import org.eclipse.ui.views.properties.PropertySheet; -import org.eclipse.ui.views.properties.PropertySheetPage; - - -/** - * This is an example of a Generatoroptionsmm model editor. - * - * - * - * @generated - */ -public class GeneratoroptionsmmEditor - extends MultiPageEditorPart - implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker { - /** - * This keeps track of the editing domain that is used to track all changes to the model. - * - * - * - * @generated - */ - protected AdapterFactoryEditingDomain editingDomain; - - /** - * This is the one adapter factory used for providing views of the model. - * - * - * - * @generated - */ - protected ComposedAdapterFactory adapterFactory; - - /** - * This is the content outline page. - * - * - * - * @generated - */ - protected IContentOutlinePage contentOutlinePage; - - /** - * This is a kludge... - * - * - * - * @generated - */ - protected IStatusLineManager contentOutlineStatusLineManager; - - /** - * This is the content outline page's viewer. - * - * - * - * @generated - */ - protected TreeViewer contentOutlineViewer; - - /** - * This is the property sheet page. - * - * - * - * @generated - */ - protected List propertySheetPages = new ArrayList(); - - /** - * This is the viewer that shadows the selection in the content outline. - * The parent relation must be correctly defined for this to work. - * - * - * - * @generated - */ - protected TreeViewer selectionViewer; - - /** - * This inverts the roll of parent and child in the content provider and show parents as a tree. - * - * - * - * @generated - */ - protected TreeViewer parentViewer; - - /** - * This shows how a tree view works. - * - * - * - * @generated - */ - protected TreeViewer treeViewer; - - /** - * This shows how a list view works. - * A list viewer doesn't support icons. - * - * - * - * @generated - */ - protected ListViewer listViewer; - - /** - * This shows how a table view works. - * A table can be used as a list with icons. - * - * - * - * @generated - */ - protected TableViewer tableViewer; - - /** - * This shows how a tree view with columns works. - * - * - * - * @generated - */ - protected TreeViewer treeViewerWithColumns; - - /** - * This keeps track of the active viewer pane, in the book. - * - * - * - * @generated - */ - protected ViewerPane currentViewerPane; - - /** - * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer. - * - * - * - * @generated - */ - protected Viewer currentViewer; - - /** - * This listens to which ever viewer is active. - * - * - * - * @generated - */ - protected ISelectionChangedListener selectionChangedListener; - - /** - * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor. - * - * - * - * @generated - */ - protected Collection selectionChangedListeners = new ArrayList(); - - /** - * This keeps track of the selection of the editor as a whole. - * - * - * - * @generated - */ - protected ISelection editorSelection = StructuredSelection.EMPTY; - - /** - * The MarkerHelper is responsible for creating workspace resource markers presented - * in Eclipse's Problems View. - * - * - * - * @generated - */ - protected MarkerHelper markerHelper = new EditUIMarkerHelper(); - - /** - * This listens for when the outline becomes active - * - * - * - * @generated - */ - protected IPartListener partListener = - new IPartListener() { - @Override - public void partActivated(IWorkbenchPart p) { - if (p instanceof ContentOutline) { - if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) { - getActionBarContributor().setActiveEditor(GeneratoroptionsmmEditor.this); - - setCurrentViewer(contentOutlineViewer); - } - } - else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet) p).getCurrentPage())) { - getActionBarContributor().setActiveEditor(GeneratoroptionsmmEditor.this); - handleActivate(); - } - } - else if (p == GeneratoroptionsmmEditor.this) { - handleActivate(); - } - } - - @Override - public void partBroughtToTop(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partClosed(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partDeactivated(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partOpened(IWorkbenchPart p) { - // Ignore. - } - }; - - /** - * Resources that have been removed since last activation. - * - * - * - * @generated - */ - protected Collection removedResources = new ArrayList(); - - /** - * Resources that have been changed since last activation. - * - * - * - * @generated - */ - protected Collection changedResources = new ArrayList(); - - /** - * Resources that have been saved. - * - * - * - * @generated - */ - protected Collection savedResources = new ArrayList(); - - /** - * Map to store the diagnostic associated with a resource. - * - * - * - * @generated - */ - protected Map resourceToDiagnosticMap = new LinkedHashMap(); - - /** - * Controls whether the problem indication should be updated. - * - * - * - * @generated - */ - protected boolean updateProblemIndication = true; - - /** - * Adapter used to update the problem indication when resources are demanded loaded. - * - * - * - * @generated - */ - protected EContentAdapter problemIndicationAdapter = - new EContentAdapter() { - @Override - public void notifyChanged(Notification notification) { - if (notification.getNotifier() instanceof Resource) { - switch (notification.getFeatureID(Resource.class)) { - case Resource.RESOURCE__IS_LOADED: - case Resource.RESOURCE__ERRORS: - case Resource.RESOURCE__WARNINGS: { - Resource resource = (Resource) notification.getNotifier(); - Diagnostic diagnostic = analyzeResourceProblems(resource, null); - if (diagnostic.getSeverity() != Diagnostic.OK) { - resourceToDiagnosticMap.put(resource, diagnostic); - } - else { - resourceToDiagnosticMap.remove(resource); - } - - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - updateProblemIndication(); - } - }); - } - break; - } - } - } - else { - super.notifyChanged(notification); - } - } - - @Override - protected void setTarget(Resource target) { - basicSetTarget(target); - } - - @Override - protected void unsetTarget(Resource target) { - basicUnsetTarget(target); - resourceToDiagnosticMap.remove(target); - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - updateProblemIndication(); - } - }); - } - } - }; - - /** - * This listens for workspace changes. - * - * - * - * @generated - */ - protected IResourceChangeListener resourceChangeListener = - new IResourceChangeListener() { - @Override - public void resourceChanged(IResourceChangeEvent event) { - IResourceDelta delta = event.getDelta(); - try { - class ResourceDeltaVisitor implements IResourceDeltaVisitor { - protected ResourceSet resourceSet = editingDomain.getResourceSet(); - protected Collection changedResources = new ArrayList(); - protected Collection removedResources = new ArrayList(); - - @Override - public boolean visit(IResourceDelta delta) { - if (delta.getResource().getType() == IResource.FILE) { - if (delta.getKind() == IResourceDelta.REMOVED || - delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) { - Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false); - if (resource != null) { - if (delta.getKind() == IResourceDelta.REMOVED) { - removedResources.add(resource); - } - else if (!savedResources.remove(resource)) { - changedResources.add(resource); - } - } - } - return false; - } - - return true; - } - - public Collection getChangedResources() { - return changedResources; - } - - public Collection getRemovedResources() { - return removedResources; - } - } - - final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(); - delta.accept(visitor); - - if (!visitor.getRemovedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - removedResources.addAll(visitor.getRemovedResources()); - if (!isDirty()) { - getSite().getPage().closeEditor(GeneratoroptionsmmEditor.this, false); - } - } - }); - } - - if (!visitor.getChangedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - changedResources.addAll(visitor.getChangedResources()); - if (getSite().getPage().getActiveEditor() == GeneratoroptionsmmEditor.this) { - handleActivate(); - } - } - }); - } - } - catch (CoreException exception) { - GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); - } - } - }; - - /** - * Handles activation of the editor or it's associated views. - * - * - * - * @generated - */ - protected void handleActivate() { - // Recompute the read only state. - // - if (editingDomain.getResourceToReadOnlyMap() != null) { - editingDomain.getResourceToReadOnlyMap().clear(); - - // Refresh any actions that may become enabled or disabled. - // - setSelection(getSelection()); - } - - if (!removedResources.isEmpty()) { - if (handleDirtyConflict()) { - getSite().getPage().closeEditor(GeneratoroptionsmmEditor.this, false); - } - else { - removedResources.clear(); - changedResources.clear(); - savedResources.clear(); - } - } - else if (!changedResources.isEmpty()) { - changedResources.removeAll(savedResources); - handleChangedResources(); - changedResources.clear(); - savedResources.clear(); - } - } - - /** - * Handles what to do with changed resources on activation. - * - * - * - * @generated - */ - protected void handleChangedResources() { - if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { - if (isDirty()) { - changedResources.addAll(editingDomain.getResourceSet().getResources()); - } - editingDomain.getCommandStack().flush(); - - updateProblemIndication = false; - for (Resource resource : changedResources) { - if (resource.isLoaded()) { - resource.unload(); - try { - resource.load(Collections.EMPTY_MAP); - } catch (IOException exception) { - if (!resourceToDiagnosticMap.containsKey(resource)) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - } - } - } - - if (AdapterFactoryEditingDomain.isStale(editorSelection)) { - setSelection(StructuredSelection.EMPTY); - } - - updateProblemIndication = true; - updateProblemIndication(); - } - } - - /** - * Updates the problems indication with the information described in the specified diagnostic. - * - * - * - * @generated - */ - protected void updateProblemIndication() { - if (updateProblemIndication) { - BasicDiagnostic diagnostic = - new BasicDiagnostic - (Diagnostic.OK, - "org.eclipse.papyrus.java.generator.metamodel.jdt.editor", - 0, - null, - new Object[] { editingDomain.getResourceSet() }); - for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) { - if (childDiagnostic.getSeverity() != Diagnostic.OK) { - diagnostic.add(childDiagnostic); - } - } - - int lastEditorPage = getPageCount() - 1; - if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) { - ((ProblemEditorPart) getEditor(lastEditorPage)).setDiagnostic(diagnostic); - if (diagnostic.getSeverity() != Diagnostic.OK) { - setActivePage(lastEditorPage); - } - } - else if (diagnostic.getSeverity() != Diagnostic.OK) { - ProblemEditorPart problemEditorPart = new ProblemEditorPart(); - problemEditorPart.setDiagnostic(diagnostic); - problemEditorPart.setMarkerHelper(markerHelper); - try { - addPage(++lastEditorPage, problemEditorPart, getEditorInput()); - setPageText(lastEditorPage, problemEditorPart.getPartName()); - setActivePage(lastEditorPage); - showTabs(); - } catch (PartInitException exception) { - GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); - } - } - - if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - markerHelper.deleteMarkers(editingDomain.getResourceSet()); - if (diagnostic.getSeverity() != Diagnostic.OK) { - try { - markerHelper.createMarkers(diagnostic); - } catch (CoreException exception) { - GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); - } - } - } - } - } - - /** - * Shows a dialog that asks if conflicting changes should be discarded. - * - * - * - * @generated - */ - protected boolean handleDirtyConflict() { - return MessageDialog.openQuestion - (getSite().getShell(), - getString("_UI_FileConflict_label"), - getString("_WARN_FileConflict")); - } - - /** - * This creates a model editor. - * - * - * - * @generated - */ - public GeneratoroptionsmmEditor() { - super(); - initializeEditingDomain(); - } - - /** - * This sets up the editing domain for the model editor. - * - * - * - * @generated - */ - protected void initializeEditingDomain() { - // Create an adapter factory that yields item providers. - // - adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); - - adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new GeneratoroptionsmmItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); - - // Create the command stack that will notify this editor as commands are executed. - // - BasicCommandStack commandStack = new BasicCommandStack(); - - // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. - // - commandStack.addCommandStackListener - (new CommandStackListener() { - @Override - public void commandStackChanged(final EventObject event) { - getContainer().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - firePropertyChange(IEditorPart.PROP_DIRTY); - - // Try to select the affected objects. - // - Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand(); - if (mostRecentCommand != null) { - setSelectionToViewer(mostRecentCommand.getAffectedObjects()); - } - for (Iterator i = propertySheetPages.iterator(); i.hasNext();) { - PropertySheetPage propertySheetPage = i.next(); - if (propertySheetPage.getControl().isDisposed()) { - i.remove(); - } - else { - propertySheetPage.refresh(); - } - } - } - }); - } - }); - - // Create the editing domain with a special command stack. - // - editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap()); - } - - /** - * This is here for the listener to be able to call it. - * - * - * - * @generated - */ - @Override - protected void firePropertyChange(int action) { - super.firePropertyChange(action); - } - - /** - * This sets the selection into whichever viewer is active. - * - * - * - * @generated - */ - public void setSelectionToViewer(Collection collection) { - final Collection theSelection = collection; - // Make sure it's okay. - // - if (theSelection != null && !theSelection.isEmpty()) { - Runnable runnable = - new Runnable() { - @Override - public void run() { - // Try to select the items in the current content viewer of the editor. - // - if (currentViewer != null) { - currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); - } - } - }; - getSite().getShell().getDisplay().asyncExec(runnable); - } - } - - /** - * This returns the editing domain as required by the {@link IEditingDomainProvider} interface. - * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}. - * - * - * - * @generated - */ - @Override - public EditingDomain getEditingDomain() { - return editingDomain; - } - - /** - * - * - * - * @generated - */ - public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { - /** - * - * - * - * @generated - */ - public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * - * - * - * @generated - */ - @Override - public Object[] getElements(Object object) { - Object parent = super.getParent(object); - return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); - } - - /** - * - * - * - * @generated - */ - @Override - public Object[] getChildren(Object object) { - Object parent = super.getParent(object); - return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean hasChildren(Object object) { - Object parent = super.getParent(object); - return parent != null; - } - - /** - * - * - * - * @generated - */ - @Override - public Object getParent(Object object) { - return null; - } - } - - /** - * - * - * - * @generated - */ - public void setCurrentViewerPane(ViewerPane viewerPane) { - if (currentViewerPane != viewerPane) { - if (currentViewerPane != null) { - currentViewerPane.showFocus(false); - } - currentViewerPane = viewerPane; - } - setCurrentViewer(currentViewerPane.getViewer()); - } - - /** - * This makes sure that one content viewer, either for the current page or the outline view, if it has focus, - * is the current one. - * - * - * - * @generated - */ - public void setCurrentViewer(Viewer viewer) { - // If it is changing... - // - if (currentViewer != viewer) { - if (selectionChangedListener == null) { - // Create the listener on demand. - // - selectionChangedListener = - new ISelectionChangedListener() { - // This just notifies those things that are affected by the section. - // - @Override - public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { - setSelection(selectionChangedEvent.getSelection()); - } - }; - } - - // Stop listening to the old one. - // - if (currentViewer != null) { - currentViewer.removeSelectionChangedListener(selectionChangedListener); - } - - // Start listening to the new one. - // - if (viewer != null) { - viewer.addSelectionChangedListener(selectionChangedListener); - } - - // Remember it. - // - currentViewer = viewer; - - // Set the editors selection based on the current viewer's selection. - // - setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection()); - } - } - - /** - * This returns the viewer as required by the {@link IViewerProvider} interface. - * - * - * - * @generated - */ - @Override - public Viewer getViewer() { - return currentViewer; - } - - /** - * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. - * - * - * - * @generated - */ - protected void createContextMenuFor(StructuredViewer viewer) { - MenuManager contextMenu = new MenuManager("#PopUp"); - contextMenu.add(new Separator("additions")); - contextMenu.setRemoveAllWhenShown(true); - contextMenu.addMenuListener(this); - Menu menu = contextMenu.createContextMenu(viewer.getControl()); - viewer.getControl().setMenu(menu); - getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); - - int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; - Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() }; - viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); - viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); - } - - /** - * This is the method called to load a resource into the editing domain's resource set based on the editor's input. - * - * - * - * @generated - */ - public void createModel() { - URI resourceURI = EditUIUtil.getURI(getEditorInput()); - Exception exception = null; - Resource resource = null; - try { - // Load the resource through the editing domain. - // - resource = editingDomain.getResourceSet().getResource(resourceURI, true); - } catch (Exception e) { - exception = e; - resource = editingDomain.getResourceSet().getResource(resourceURI, false); - } - - Diagnostic diagnostic = analyzeResourceProblems(resource, exception); - if (diagnostic.getSeverity() != Diagnostic.OK) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter); - } - - /** - * Returns a diagnostic describing the errors and warnings listed in the resource - * and the specified exception (if any). - * - * - * - * @generated - */ - public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) { - if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) { - BasicDiagnostic basicDiagnostic = - new BasicDiagnostic - (Diagnostic.ERROR, - "org.eclipse.papyrus.java.generator.metamodel.jdt.editor", - 0, - getString("_UI_CreateModelError_message", resource.getURI()), - new Object[] { exception == null ? (Object) resource : exception }); - basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); - return basicDiagnostic; - } - else if (exception != null) { - return new BasicDiagnostic(Diagnostic.ERROR, - "org.eclipse.papyrus.java.generator.metamodel.jdt.editor", - 0, - getString("_UI_CreateModelError_message", resource.getURI()), - new Object[] { exception }); - } - else { - return Diagnostic.OK_INSTANCE; - } - } - - /** - * This is the method used by the framework to install your own controls. - * - * - * - * @generated - */ - @Override - public void createPages() { - // Creates the model from the editor input - // - createModel(); - - // Only creates the other pages if there is something that can be edited - // - if (!getEditingDomain().getResourceSet().getResources().isEmpty()) { - // Create a page for the selection tree view. - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), GeneratoroptionsmmEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - Tree tree = new Tree(composite, SWT.MULTI); - TreeViewer newTreeViewer = new TreeViewer(tree); - return newTreeViewer; - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - - selectionViewer = (TreeViewer) viewerPane.getViewer(); - selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - - selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - selectionViewer.setInput(editingDomain.getResourceSet()); - selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); - viewerPane.setTitle(editingDomain.getResourceSet()); - - new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); - - createContextMenuFor(selectionViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_SelectionPage_label")); - } - - // Create a page for the parent tree view. - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), GeneratoroptionsmmEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - Tree tree = new Tree(composite, SWT.MULTI); - TreeViewer newTreeViewer = new TreeViewer(tree); - return newTreeViewer; - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - - parentViewer = (TreeViewer) viewerPane.getViewer(); - parentViewer.setAutoExpandLevel(30); - parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory)); - parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - createContextMenuFor(parentViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_ParentPage_label")); - } - - // This is the page for the list viewer - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), GeneratoroptionsmmEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - return new ListViewer(composite); - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - listViewer = (ListViewer) viewerPane.getViewer(); - listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - createContextMenuFor(listViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_ListPage_label")); - } - - // This is the page for the tree viewer - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), GeneratoroptionsmmEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - return new TreeViewer(composite); - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - treeViewer = (TreeViewer) viewerPane.getViewer(); - treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory); - - createContextMenuFor(treeViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_TreePage_label")); - } - - // This is the page for the table viewer. - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), GeneratoroptionsmmEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - return new TableViewer(composite); - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - tableViewer = (TableViewer) viewerPane.getViewer(); - - Table table = tableViewer.getTable(); - TableLayout layout = new TableLayout(); - table.setLayout(layout); - table.setHeaderVisible(true); - table.setLinesVisible(true); - - TableColumn objectColumn = new TableColumn(table, SWT.NONE); - layout.addColumnData(new ColumnWeightData(3, 100, true)); - objectColumn.setText(getString("_UI_ObjectColumn_label")); - objectColumn.setResizable(true); - - TableColumn selfColumn = new TableColumn(table, SWT.NONE); - layout.addColumnData(new ColumnWeightData(2, 100, true)); - selfColumn.setText(getString("_UI_SelfColumn_label")); - selfColumn.setResizable(true); - - tableViewer.setColumnProperties(new String[] { "a", "b" }); - tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - createContextMenuFor(tableViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_TablePage_label")); - } - - // This is the page for the table tree viewer. - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), GeneratoroptionsmmEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - return new TreeViewer(composite); - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - - treeViewerWithColumns = (TreeViewer) viewerPane.getViewer(); - - Tree tree = treeViewerWithColumns.getTree(); - tree.setLayoutData(new FillLayout()); - tree.setHeaderVisible(true); - tree.setLinesVisible(true); - - TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE); - objectColumn.setText(getString("_UI_ObjectColumn_label")); - objectColumn.setResizable(true); - objectColumn.setWidth(250); - - TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE); - selfColumn.setText(getString("_UI_SelfColumn_label")); - selfColumn.setResizable(true); - selfColumn.setWidth(200); - - treeViewerWithColumns.setColumnProperties(new String[] { "a", "b" }); - treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - createContextMenuFor(treeViewerWithColumns); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); - } - - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - setActivePage(0); - } - }); - } - - // Ensures that this editor will only display the page's tab - // area if there are more than one page - // - getContainer().addControlListener - (new ControlAdapter() { - boolean guard = false; - - @Override - public void controlResized(ControlEvent event) { - if (!guard) { - guard = true; - hideTabs(); - guard = false; - } - } - }); - - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - updateProblemIndication(); - } - }); - } - - /** - * If there is just one page in the multi-page editor part, - * this hides the single tab at the bottom. - * - * - * - * @generated - */ - protected void hideTabs() { - if (getPageCount() <= 1) { - setPageText(0, ""); - if (getContainer() instanceof CTabFolder) { - ((CTabFolder) getContainer()).setTabHeight(1); - Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y + 6); - } - } - } - - /** - * If there is more than one page in the multi-page editor part, - * this shows the tabs at the bottom. - * - * - * - * @generated - */ - protected void showTabs() { - if (getPageCount() > 1) { - setPageText(0, getString("_UI_SelectionPage_label")); - if (getContainer() instanceof CTabFolder) { - ((CTabFolder) getContainer()).setTabHeight(SWT.DEFAULT); - Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y - 6); - } - } - } - - /** - * This is used to track the active viewer. - * - * - * - * @generated - */ - @Override - protected void pageChange(int pageIndex) { - super.pageChange(pageIndex); - - if (contentOutlinePage != null) { - handleContentOutlineSelection(contentOutlinePage.getSelection()); - } - } - - /** - * This is how the framework determines which interfaces we implement. - * - * - * - * @generated - */ - @SuppressWarnings("rawtypes") - @Override - public Object getAdapter(Class key) { - if (key.equals(IContentOutlinePage.class)) { - return showOutlineView() ? getContentOutlinePage() : null; - } - else if (key.equals(IPropertySheetPage.class)) { - return getPropertySheetPage(); - } - else if (key.equals(IGotoMarker.class)) { - return this; - } - else { - return super.getAdapter(key); - } - } - - /** - * This accesses a cached version of the content outliner. - * - * - * - * @generated - */ - public IContentOutlinePage getContentOutlinePage() { - if (contentOutlinePage == null) { - // The content outline is just a tree. - // - class MyContentOutlinePage extends ContentOutlinePage { - @Override - public void createControl(Composite parent) { - super.createControl(parent); - contentOutlineViewer = getTreeViewer(); - contentOutlineViewer.addSelectionChangedListener(this); - - // Set up the tree viewer. - // - contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - contentOutlineViewer.setInput(editingDomain.getResourceSet()); - - // Make sure our popups work. - // - createContextMenuFor(contentOutlineViewer); - - if (!editingDomain.getResourceSet().getResources().isEmpty()) { - // Select the root object in the view. - // - contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); - } - } - - @Override - public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { - super.makeContributions(menuManager, toolBarManager, statusLineManager); - contentOutlineStatusLineManager = statusLineManager; - } - - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - } - - contentOutlinePage = new MyContentOutlinePage(); - - // Listen to selection so that we can handle it is a special way. - // - contentOutlinePage.addSelectionChangedListener - (new ISelectionChangedListener() { - // This ensures that we handle selections correctly. - // - @Override - public void selectionChanged(SelectionChangedEvent event) { - handleContentOutlineSelection(event.getSelection()); - } - }); - } - - return contentOutlinePage; - } - - /** - * This accesses a cached version of the property sheet. - * - * - * - * @generated - */ - public IPropertySheetPage getPropertySheetPage() { - PropertySheetPage propertySheetPage = - new ExtendedPropertySheetPage(editingDomain) { - @Override - public void setSelectionToViewer(List selection) { - GeneratoroptionsmmEditor.this.setSelectionToViewer(selection); - GeneratoroptionsmmEditor.this.setFocus(); - } - - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - }; - propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); - propertySheetPages.add(propertySheetPage); - - return propertySheetPage; - } - - /** - * This deals with how we want selection in the outliner to affect the other views. - * - * - * - * @generated - */ - public void handleContentOutlineSelection(ISelection selection) { - if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) { - Iterator selectedElements = ((IStructuredSelection) selection).iterator(); - if (selectedElements.hasNext()) { - // Get the first selected element. - // - Object selectedElement = selectedElements.next(); - - // If it's the selection viewer, then we want it to select the same selection as this selection. - // - if (currentViewerPane.getViewer() == selectionViewer) { - ArrayList selectionList = new ArrayList(); - selectionList.add(selectedElement); - while (selectedElements.hasNext()) { - selectionList.add(selectedElements.next()); - } - - // Set the selection to the widget. - // - selectionViewer.setSelection(new StructuredSelection(selectionList)); - } - else { - // Set the input to the widget. - // - if (currentViewerPane.getViewer().getInput() != selectedElement) { - currentViewerPane.getViewer().setInput(selectedElement); - currentViewerPane.setTitle(selectedElement); - } - } - } - } - } - - /** - * This is for implementing {@link IEditorPart} and simply tests the command stack. - * - * - * - * @generated - */ - @Override - public boolean isDirty() { - return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded(); - } - - /** - * This is for implementing {@link IEditorPart} and simply saves the model file. - * - * - * - * @generated - */ - @Override - public void doSave(IProgressMonitor progressMonitor) { - // Save only resources that have actually changed. - // - final Map saveOptions = new HashMap(); - saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); - saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED); - - // Do the work within an operation because this is a long running activity that modifies the workbench. - // - WorkspaceModifyOperation operation = - new WorkspaceModifyOperation() { - // This is the method that gets invoked when the operation runs. - // - @Override - public void execute(IProgressMonitor monitor) { - // Save the resources to the file system. - // - boolean first = true; - for (Resource resource : editingDomain.getResourceSet().getResources()) { - if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) { - try { - long timeStamp = resource.getTimeStamp(); - resource.save(saveOptions); - if (resource.getTimeStamp() != timeStamp) { - savedResources.add(resource); - } - } - catch (Exception exception) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - first = false; - } - } - } - }; - - updateProblemIndication = false; - try { - // This runs the options, and shows progress. - // - new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation); - - // Refresh the necessary state. - // - ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone(); - firePropertyChange(IEditorPart.PROP_DIRTY); - } catch (Exception exception) { - // Something went wrong that shouldn't. - // - GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); - } - updateProblemIndication = true; - updateProblemIndication(); - } - - /** - * This returns whether something has been persisted to the URI of the specified resource. - * The implementation uses the URI converter from the editor's resource set to try to open an input stream. - * - * - * - * @generated - */ - protected boolean isPersisted(Resource resource) { - boolean result = false; - try { - InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI()); - if (stream != null) { - result = true; - stream.close(); - } - } catch (IOException e) { - // Ignore - } - return result; - } - - /** - * This always returns true because it is not currently supported. - * - * - * - * @generated - */ - @Override - public boolean isSaveAsAllowed() { - return true; - } - - /** - * This also changes the editor's input. - * - * - * - * @generated - */ - @Override - public void doSaveAs() { - SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); - saveAsDialog.open(); - IPath path = saveAsDialog.getResult(); - if (path != null) { - IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); - if (file != null) { - doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); - } - } - } - - /** - * - * - * - * @generated - */ - protected void doSaveAs(URI uri, IEditorInput editorInput) { - (editingDomain.getResourceSet().getResources().get(0)).setURI(uri); - setInputWithNotify(editorInput); - setPartName(editorInput.getName()); - IProgressMonitor progressMonitor = - getActionBars().getStatusLineManager() != null ? - getActionBars().getStatusLineManager().getProgressMonitor() : - new NullProgressMonitor(); - doSave(progressMonitor); - } - - /** - * - * - * - * @generated - */ - @Override - public void gotoMarker(IMarker marker) { - List targetObjects = markerHelper.getTargetObjects(editingDomain, marker); - if (!targetObjects.isEmpty()) { - setSelectionToViewer(targetObjects); - } - } - - /** - * This is called during startup. - * - * - * - * @generated - */ - @Override - public void init(IEditorSite site, IEditorInput editorInput) { - setSite(site); - setInputWithNotify(editorInput); - setPartName(editorInput.getName()); - site.setSelectionProvider(this); - site.getPage().addPartListener(partListener); - ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE); - } - - /** - * - * - * - * @generated - */ - @Override - public void setFocus() { - if (currentViewerPane != null) { - currentViewerPane.setFocus(); - } - else { - getControl(getActivePage()).setFocus(); - } - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * - * @generated - */ - @Override - public void addSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.add(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * - * @generated - */ - @Override - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.remove(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. - * - * - * - * @generated - */ - @Override - public ISelection getSelection() { - return editorSelection; - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection. - * Calling this result will notify the listeners. - * - * - * - * @generated - */ - @Override - public void setSelection(ISelection selection) { - editorSelection = selection; - - for (ISelectionChangedListener listener : selectionChangedListeners) { - listener.selectionChanged(new SelectionChangedEvent(this, selection)); - } - setStatusLineManager(selection); - } - - /** - * - * - * - * @generated - */ - public void setStatusLineManager(ISelection selection) { - IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? - contentOutlineStatusLineManager : getActionBars().getStatusLineManager(); - - if (statusLineManager != null) { - if (selection instanceof IStructuredSelection) { - Collection collection = ((IStructuredSelection) selection).toList(); - switch (collection.size()) { - case 0: { - statusLineManager.setMessage(getString("_UI_NoObjectSelected")); - break; - } - case 1: { - String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next()); - statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); - break; - } - default: { - statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); - break; - } - } - } - else { - statusLineManager.setMessage(""); - } - } - } - - /** - * This looks up a string in the plugin's plugin.properties file. - * - * - * - * @generated - */ - private static String getString(String key) { - return GeneratoroptionsmmEditorPlugin.INSTANCE.getString(key); - } - - /** - * This looks up a string in plugin.properties, making a substitution. - * - * - * - * @generated - */ - private static String getString(String key, Object s1) { - return GeneratoroptionsmmEditorPlugin.INSTANCE.getString(key, new Object[] { s1 }); - } - - /** - * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu. - * - * - * - * @generated - */ - @Override - public void menuAboutToShow(IMenuManager menuManager) { - ((IMenuListener) getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); - } - - /** - * - * - * - * @generated - */ - public EditingDomainActionBarContributor getActionBarContributor() { - return (EditingDomainActionBarContributor) getEditorSite().getActionBarContributor(); - } - - /** - * - * - * - * @generated - */ - public IActionBars getActionBars() { - return getActionBarContributor().getActionBars(); - } - - /** - * - * - * - * @generated - */ - public AdapterFactory getAdapterFactory() { - return adapterFactory; - } - - /** - * - * - * - * @generated - */ - @Override - public void dispose() { - updateProblemIndication = false; - - ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); - - getSite().getPage().removePartListener(partListener); - - adapterFactory.dispose(); - - if (getActionBarContributor().getActiveEditor() == this) { - getActionBarContributor().setActiveEditor(null); - } - - for (PropertySheetPage propertySheetPage : propertySheetPages) { - propertySheetPage.dispose(); - } - - if (contentOutlinePage != null) { - contentOutlinePage.dispose(); - } - - super.dispose(); - } - - /** - * Returns whether the outline view should be presented to the user. - * - * - * - * @generated - */ - protected boolean showOutlineView() { - return true; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditorPlugin.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditorPlugin.java deleted file mode 100644 index b9c5d54c04b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditorPlugin.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.presentation; - -import org.eclipse.emf.common.EMFPlugin; -import org.eclipse.emf.common.ui.EclipseUIPlugin; -import org.eclipse.emf.common.util.ResourceLocator; - -/** - * This is the central singleton for the Generatoroptionsmm editor plugin. - * - * - * - * @generated - */ -public final class GeneratoroptionsmmEditorPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * - * @generated - */ - public static final GeneratoroptionsmmEditorPlugin INSTANCE = new GeneratoroptionsmmEditorPlugin(); - - /** - * Keep track of the singleton. - * - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * - * @generated - */ - public GeneratoroptionsmmEditorPlugin() { - super(new ResourceLocator[] { - }); - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * - * @return the singleton instance. - * @generated - */ - @Override - public ResourceLocator getPluginResourceLocator() { - return plugin; - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * - * @return the singleton instance. - * @generated - */ - public static Implementation getPlugin() { - return plugin; - } - - /** - * The actual implementation of the Eclipse Plugin. - * - * - * - * @generated - */ - public static class Implementation extends EclipseUIPlugin { - /** - * Creates an instance. - * - * - * - * @generated - */ - public Implementation() { - super(); - - // Remember the static instance. - // - plugin = this; - } - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmModelWizard.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmModelWizard.java deleted file mode 100644 index 0eaf5624b1a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmModelWizard.java +++ /dev/null @@ -1,636 +0,0 @@ -/** - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.presentation; - - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.StringTokenizer; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.CommonPlugin; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.emf.ecore.xmi.XMLResource; -import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider.GeneratoroptionsmmEditPlugin; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.dialogs.WizardNewFileCreationPage; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.ISetSelectionTarget; - - -/** - * This is a simple wizard for creating a new model file. - * - * - * - * @generated - */ -public class GeneratoroptionsmmModelWizard extends Wizard implements INewWizard { - /** - * The supported extensions for created files. - * - * - * - * @generated - */ - public static final List FILE_EXTENSIONS = - Collections.unmodifiableList(Arrays.asList(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmEditorFilenameExtensions").split("\\s*,\\s*"))); - - /** - * A formatted list of supported file extensions, suitable for display. - * - * - * - * @generated - */ - public static final String FORMATTED_FILE_EXTENSIONS = - GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); - - /** - * This caches an instance of the model package. - * - * - * - * @generated - */ - protected GeneratoroptionsmmPackage generatoroptionsmmPackage = GeneratoroptionsmmPackage.eINSTANCE; - - /** - * This caches an instance of the model factory. - * - * - * - * @generated - */ - protected GeneratoroptionsmmFactory generatoroptionsmmFactory = generatoroptionsmmPackage.getGeneratoroptionsmmFactory(); - - /** - * This is the file creation page. - * - * - * - * @generated - */ - protected GeneratoroptionsmmModelWizardNewFileCreationPage newFileCreationPage; - - /** - * This is the initial object creation page. - * - * - * - * @generated - */ - protected GeneratoroptionsmmModelWizardInitialObjectCreationPage initialObjectCreationPage; - - /** - * Remember the selection during initialization for populating the default container. - * - * - * - * @generated - */ - protected IStructuredSelection selection; - - /** - * Remember the workbench during initialization. - * - * - * - * @generated - */ - protected IWorkbench workbench; - - /** - * Caches the names of the types that can be created as the root object. - * - * - * - * @generated - */ - protected List initialObjectNames; - - /** - * This just records the information. - * - * - * - * @generated - */ - @Override - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.workbench = workbench; - this.selection = selection; - setWindowTitle(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); - setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(GeneratoroptionsmmEditorPlugin.INSTANCE.getImage("full/wizban/NewGeneratoroptionsmm"))); - } - - /** - * Returns the names of the types that can be created as the root object. - * - * - * - * @generated - */ - protected Collection getInitialObjectNames() { - if (initialObjectNames == null) { - initialObjectNames = new ArrayList(); - for (EClassifier eClassifier : generatoroptionsmmPackage.getEClassifiers()) { - if (eClassifier instanceof EClass) { - EClass eClass = (EClass) eClassifier; - if (!eClass.isAbstract()) { - initialObjectNames.add(eClass.getName()); - } - } - } - Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator()); - } - return initialObjectNames; - } - - /** - * Create a new model. - * - * - * - * @generated - */ - protected EObject createInitialModel() { - EClass eClass = (EClass) generatoroptionsmmPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); - EObject rootObject = generatoroptionsmmFactory.create(eClass); - return rootObject; - } - - /** - * Do the work after everything is specified. - * - * - * - * @generated - */ - @Override - public boolean performFinish() { - try { - // Remember the file. - // - final IFile modelFile = getModelFile(); - - // Do the work within an operation. - // - WorkspaceModifyOperation operation = - new WorkspaceModifyOperation() { - @Override - protected void execute(IProgressMonitor progressMonitor) { - try { - // Create a resource set - // - ResourceSet resourceSet = new ResourceSetImpl(); - - // Get the URI of the model file. - // - URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true); - - // Create a resource for this file. - // - Resource resource = resourceSet.createResource(fileURI); - - // Add the initial model object to the contents. - // - EObject rootObject = createInitialModel(); - if (rootObject != null) { - resource.getContents().add(rootObject); - } - - // Save the contents of the resource to the file system. - // - Map options = new HashMap(); - options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding()); - resource.save(options); - } - catch (Exception exception) { - GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); - } - finally { - progressMonitor.done(); - } - } - }; - - getContainer().run(false, false, operation); - - // Select the new file resource in the current view. - // - IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); - IWorkbenchPage page = workbenchWindow.getActivePage(); - final IWorkbenchPart activePart = page.getActivePart(); - if (activePart instanceof ISetSelectionTarget) { - final ISelection targetSelection = new StructuredSelection(modelFile); - getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - ((ISetSelectionTarget) activePart).selectReveal(targetSelection); - } - }); - } - - // Open an editor on the new file. - // - try { - page.openEditor - (new FileEditorInput(modelFile), - workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId()); - } catch (PartInitException exception) { - MessageDialog.openError(workbenchWindow.getShell(), GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); - return false; - } - - return true; - } catch (Exception exception) { - GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); - return false; - } - } - - /** - * This is the one page of the wizard. - * - * - * - * @generated - */ - public class GeneratoroptionsmmModelWizardNewFileCreationPage extends WizardNewFileCreationPage { - /** - * Pass in the selection. - * - * - * - * @generated - */ - public GeneratoroptionsmmModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) { - super(pageId, selection); - } - - /** - * The framework calls this to see if the file is correct. - * - * - * - * @generated - */ - @Override - protected boolean validatePage() { - if (super.validatePage()) { - String extension = new Path(getFileName()).getFileExtension(); - if (extension == null || !FILE_EXTENSIONS.contains(extension)) { - String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; - setErrorMessage(GeneratoroptionsmmEditorPlugin.INSTANCE.getString(key, new Object[] { FORMATTED_FILE_EXTENSIONS })); - return false; - } - return true; - } - return false; - } - - /** - * - * - * - * @generated - */ - public IFile getModelFile() { - return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName())); - } - } - - /** - * This is the page where the type of object to create is selected. - * - * - * - * @generated - */ - public class GeneratoroptionsmmModelWizardInitialObjectCreationPage extends WizardPage { - /** - * - * - * - * @generated - */ - protected Combo initialObjectField; - - /** - * @generated - * - * - */ - protected List encodings; - - /** - * - * - * - * @generated - */ - protected Combo encodingField; - - /** - * Pass in the selection. - * - * - * - * @generated - */ - public GeneratoroptionsmmModelWizardInitialObjectCreationPage(String pageId) { - super(pageId); - } - - /** - * - * - * - * @generated - */ - @Override - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - { - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - layout.verticalSpacing = 12; - composite.setLayout(layout); - - GridData data = new GridData(); - data.verticalAlignment = GridData.FILL; - data.grabExcessVerticalSpace = true; - data.horizontalAlignment = GridData.FILL; - composite.setLayoutData(data); - } - - Label containerLabel = new Label(composite, SWT.LEFT); - { - containerLabel.setText(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_ModelObject")); - - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - containerLabel.setLayoutData(data); - } - - initialObjectField = new Combo(composite, SWT.BORDER); - { - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - initialObjectField.setLayoutData(data); - } - - for (String objectName : getInitialObjectNames()) { - initialObjectField.add(getLabel(objectName)); - } - - if (initialObjectField.getItemCount() == 1) { - initialObjectField.select(0); - } - initialObjectField.addModifyListener(validator); - - Label encodingLabel = new Label(composite, SWT.LEFT); - { - encodingLabel.setText(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_XMLEncoding")); - - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - encodingLabel.setLayoutData(data); - } - encodingField = new Combo(composite, SWT.BORDER); - { - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - encodingField.setLayoutData(data); - } - - for (String encoding : getEncodings()) { - encodingField.add(encoding); - } - - encodingField.select(0); - encodingField.addModifyListener(validator); - - setPageComplete(validatePage()); - setControl(composite); - } - - /** - * - * - * - * @generated - */ - protected ModifyListener validator = - new ModifyListener() { - @Override - public void modifyText(ModifyEvent e) { - setPageComplete(validatePage()); - } - }; - - /** - * - * - * - * @generated - */ - protected boolean validatePage() { - return getInitialObjectName() != null && getEncodings().contains(encodingField.getText()); - } - - /** - * - * - * - * @generated - */ - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - if (visible) { - if (initialObjectField.getItemCount() == 1) { - initialObjectField.clearSelection(); - encodingField.setFocus(); - } - else { - encodingField.clearSelection(); - initialObjectField.setFocus(); - } - } - } - - /** - * - * - * - * @generated - */ - public String getInitialObjectName() { - String label = initialObjectField.getText(); - - for (String name : getInitialObjectNames()) { - if (getLabel(name).equals(label)) { - return name; - } - } - return null; - } - - /** - * - * - * - * @generated - */ - public String getEncoding() { - return encodingField.getText(); - } - - /** - * Returns the label for the specified type name. - * - * - * - * @generated - */ - protected String getLabel(String typeName) { - try { - return GeneratoroptionsmmEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); - } catch (MissingResourceException mre) { - GeneratoroptionsmmEditorPlugin.INSTANCE.log(mre); - } - return typeName; - } - - /** - * - * - * - * @generated - */ - protected Collection getEncodings() { - if (encodings == null) { - encodings = new ArrayList(); - for (StringTokenizer stringTokenizer = new StringTokenizer(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens();) { - encodings.add(stringTokenizer.nextToken()); - } - } - return encodings; - } - } - - /** - * The framework calls this to create the contents of the wizard. - * - * - * - * @generated - */ - @Override - public void addPages() { - // Create a page, set the title, and the initial model file name. - // - newFileCreationPage = new GeneratoroptionsmmModelWizardNewFileCreationPage("Whatever", selection); - newFileCreationPage.setTitle(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmModelWizard_label")); - newFileCreationPage.setDescription(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmModelWizard_description")); - newFileCreationPage.setFileName(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0)); - addPage(newFileCreationPage); - - // Try and get the resource selection to determine a current directory for the file dialog. - // - if (selection != null && !selection.isEmpty()) { - // Get the resource... - // - Object selectedElement = selection.iterator().next(); - if (selectedElement instanceof IResource) { - // Get the resource parent, if its a file. - // - IResource selectedResource = (IResource) selectedElement; - if (selectedResource.getType() == IResource.FILE) { - selectedResource = selectedResource.getParent(); - } - - // This gives us a directory... - // - if (selectedResource instanceof IFolder || selectedResource instanceof IProject) { - // Set this for the container. - // - newFileCreationPage.setContainerFullPath(selectedResource.getFullPath()); - - // Make up a unique new name here. - // - String defaultModelBaseFilename = GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmEditorFilenameDefaultBase"); - String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0); - String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; - for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) { - modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; - } - newFileCreationPage.setFileName(modelFilename); - } - } - } - initialObjectCreationPage = new GeneratoroptionsmmModelWizardInitialObjectCreationPage("Whatever2"); - initialObjectCreationPage.setTitle(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmModelWizard_label")); - initialObjectCreationPage.setDescription(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description")); - addPage(initialObjectCreationPage); - } - - /** - * Get the file from the page. - * - * - * - * @generated - */ - public IFile getModelFile() { - return newFileCreationPage.getModelFile(); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmActionBarContributor.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmActionBarContributor.java deleted file mode 100644 index e86713e1c5d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmActionBarContributor.java +++ /dev/null @@ -1,461 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.presentation; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.ui.viewer.IViewerProvider; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.domain.IEditingDomainProvider; -import org.eclipse.emf.edit.ui.action.ControlAction; -import org.eclipse.emf.edit.ui.action.CreateChildAction; -import org.eclipse.emf.edit.ui.action.CreateSiblingAction; -import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; -import org.eclipse.emf.edit.ui.action.LoadResourceAction; -import org.eclipse.emf.edit.ui.action.ValidateAction; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.ActionContributionItem; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IContributionItem; -import org.eclipse.jface.action.IContributionManager; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.action.SubContributionItem; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.PartInitException; - -/** - * This is the action bar contributor for the Jdtmm model editor. - * - * - * - * @generated - */ -public class JdtmmActionBarContributor - extends EditingDomainActionBarContributor - implements ISelectionChangedListener { - /** - * This keeps track of the active editor. - * - * - * - * @generated - */ - protected IEditorPart activeEditorPart; - - /** - * This keeps track of the current selection provider. - * - * - * - * @generated - */ - protected ISelectionProvider selectionProvider; - - /** - * This action opens the Properties view. - * - * - * - * @generated - */ - protected IAction showPropertiesViewAction = - new Action(JdtmmEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { - @Override - public void run() { - try { - getPage().showView("org.eclipse.ui.views.PropertySheet"); - } - catch (PartInitException exception) { - JdtmmEditorPlugin.INSTANCE.log(exception); - } - } - }; - - /** - * This action refreshes the viewer of the current editor if the editor - * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. - * - * - * - * @generated - */ - protected IAction refreshViewerAction = - new Action(JdtmmEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) { - @Override - public boolean isEnabled() { - return activeEditorPart instanceof IViewerProvider; - } - - @Override - public void run() { - if (activeEditorPart instanceof IViewerProvider) { - Viewer viewer = ((IViewerProvider) activeEditorPart).getViewer(); - if (viewer != null) { - viewer.refresh(); - } - } - } - }; - - /** - * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor - * generated for the current selection by the item provider. - * - * - * - * @generated - */ - protected Collection createChildActions; - - /** - * This is the menu manager into which menu contribution items should be added for CreateChild actions. - * - * - * - * @generated - */ - protected IMenuManager createChildMenuManager; - - /** - * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor - * generated for the current selection by the item provider. - * - * - * - * @generated - */ - protected Collection createSiblingActions; - - /** - * This is the menu manager into which menu contribution items should be added for CreateSibling actions. - * - * - * - * @generated - */ - protected IMenuManager createSiblingMenuManager; - - /** - * This creates an instance of the contributor. - * - * - * - * @generated - */ - public JdtmmActionBarContributor() { - super(ADDITIONS_LAST_STYLE); - loadResourceAction = new LoadResourceAction(); - validateAction = new ValidateAction(); - controlAction = new ControlAction(); - } - - /** - * This adds Separators for editor additions to the tool bar. - * - * - * - * @generated - */ - @Override - public void contributeToToolBar(IToolBarManager toolBarManager) { - toolBarManager.add(new Separator("jdtmm-settings")); - toolBarManager.add(new Separator("jdtmm-additions")); - } - - /** - * This adds to the menu bar a menu and some separators for editor additions, - * as well as the sub-menus for object creation items. - * - * - * - * @generated - */ - @Override - public void contributeToMenu(IMenuManager menuManager) { - super.contributeToMenu(menuManager); - - IMenuManager submenuManager = new MenuManager(JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmEditor_menu"), "org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmmMenuID"); - menuManager.insertAfter("additions", submenuManager); - submenuManager.add(new Separator("settings")); - submenuManager.add(new Separator("actions")); - submenuManager.add(new Separator("additions")); - submenuManager.add(new Separator("additions-end")); - - // Prepare for CreateChild item addition or removal. - // - createChildMenuManager = new MenuManager(JdtmmEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - submenuManager.insertBefore("additions", createChildMenuManager); - - // Prepare for CreateSibling item addition or removal. - // - createSiblingMenuManager = new MenuManager(JdtmmEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - submenuManager.insertBefore("additions", createSiblingMenuManager); - - // Force an update because Eclipse hides empty menus now. - // - submenuManager.addMenuListener - (new IMenuListener() { - @Override - public void menuAboutToShow(IMenuManager menuManager) { - menuManager.updateAll(true); - } - }); - - addGlobalActions(submenuManager); - } - - /** - * When the active editor changes, this remembers the change and registers with it as a selection provider. - * - * - * - * @generated - */ - @Override - public void setActiveEditor(IEditorPart part) { - super.setActiveEditor(part); - activeEditorPart = part; - - // Switch to the new selection provider. - // - if (selectionProvider != null) { - selectionProvider.removeSelectionChangedListener(this); - } - if (part == null) { - selectionProvider = null; - } - else { - selectionProvider = part.getSite().getSelectionProvider(); - selectionProvider.addSelectionChangedListener(this); - - // Fake a selection changed event to update the menus. - // - if (selectionProvider.getSelection() != null) { - selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection())); - } - } - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener}, - * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings - * that can be added to the selected object and updating the menus accordingly. - * - * - * - * @generated - */ - @Override - public void selectionChanged(SelectionChangedEvent event) { - // Remove any menu items for old selection. - // - if (createChildMenuManager != null) { - depopulateManager(createChildMenuManager, createChildActions); - } - if (createSiblingMenuManager != null) { - depopulateManager(createSiblingMenuManager, createSiblingActions); - } - - // Query the new selection for appropriate new child/sibling descriptors - // - Collection newChildDescriptors = null; - Collection newSiblingDescriptors = null; - - ISelection selection = event.getSelection(); - if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) { - Object object = ((IStructuredSelection) selection).getFirstElement(); - - EditingDomain domain = ((IEditingDomainProvider) activeEditorPart).getEditingDomain(); - - newChildDescriptors = domain.getNewChildDescriptors(object, null); - newSiblingDescriptors = domain.getNewChildDescriptors(null, object); - } - - // Generate actions for selection; populate and redraw the menus. - // - createChildActions = generateCreateChildActions(newChildDescriptors, selection); - createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection); - - if (createChildMenuManager != null) { - populateManager(createChildMenuManager, createChildActions, null); - createChildMenuManager.update(true); - } - if (createSiblingMenuManager != null) { - populateManager(createSiblingMenuManager, createSiblingActions, null); - createSiblingMenuManager.update(true); - } - } - - /** - * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in descriptors, - * and returns the collection of these actions. - * - * - * - * @generated - */ - protected Collection generateCreateChildActions(Collection descriptors, ISelection selection) { - Collection actions = new ArrayList(); - if (descriptors != null) { - for (Object descriptor : descriptors) { - actions.add(new CreateChildAction(activeEditorPart, selection, descriptor)); - } - } - return actions; - } - - /** - * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in descriptors, - * and returns the collection of these actions. - * - * - * - * @generated - */ - protected Collection generateCreateSiblingActions(Collection descriptors, ISelection selection) { - Collection actions = new ArrayList(); - if (descriptors != null) { - for (Object descriptor : descriptors) { - actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); - } - } - return actions; - } - - /** - * This populates the specified manager with {@link org.eclipse.jface.action.ActionContributionItem}s - * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection, - * by inserting them before the specified contribution item contributionID. - * If contributionID is null, they are simply added. - * - * - * - * @generated - */ - protected void populateManager(IContributionManager manager, Collection actions, String contributionID) { - if (actions != null) { - for (IAction action : actions) { - if (contributionID != null) { - manager.insertBefore(contributionID, action); - } - else { - manager.add(action); - } - } - } - } - - /** - * This removes from the specified manager all {@link org.eclipse.jface.action.ActionContributionItem}s - * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection. - * - * - * - * @generated - */ - protected void depopulateManager(IContributionManager manager, Collection actions) { - if (actions != null) { - IContributionItem[] items = manager.getItems(); - for (int i = 0; i < items.length; i++) { - // Look into SubContributionItems - // - IContributionItem contributionItem = items[i]; - while (contributionItem instanceof SubContributionItem) { - contributionItem = ((SubContributionItem) contributionItem).getInnerItem(); - } - - // Delete the ActionContributionItems with matching action. - // - if (contributionItem instanceof ActionContributionItem) { - IAction action = ((ActionContributionItem) contributionItem).getAction(); - if (actions.contains(action)) { - manager.remove(contributionItem); - } - } - } - } - } - - /** - * This populates the pop-up menu before it appears. - * - * - * - * @generated - */ - @Override - public void menuAboutToShow(IMenuManager menuManager) { - super.menuAboutToShow(menuManager); - MenuManager submenuManager = null; - - submenuManager = new MenuManager(JdtmmEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - populateManager(submenuManager, createChildActions, null); - menuManager.insertBefore("edit", submenuManager); - - submenuManager = new MenuManager(JdtmmEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - populateManager(submenuManager, createSiblingActions, null); - menuManager.insertBefore("edit", submenuManager); - } - - /** - * This inserts global actions before the "additions-end" separator. - * - * - * - * @generated - */ - @Override - protected void addGlobalActions(IMenuManager menuManager) { - menuManager.insertAfter("additions-end", new Separator("ui-actions")); - menuManager.insertAfter("ui-actions", showPropertiesViewAction); - - refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); - menuManager.insertAfter("ui-actions", refreshViewerAction); - - super.addGlobalActions(menuManager); - } - - /** - * This ensures that a delete action will clean up all references to deleted objects. - * - * - * - * @generated - */ - @Override - protected boolean removeAllReferencesOnDelete() { - return true; - } - -} \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditor.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditor.java deleted file mode 100644 index fa9eb69be34..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditor.java +++ /dev/null @@ -1,1897 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.presentation; - - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.EventObject; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.common.command.BasicCommandStack; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.command.CommandStackListener; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.ui.MarkerHelper; -import org.eclipse.emf.common.ui.ViewerPane; -import org.eclipse.emf.common.ui.editor.ProblemEditorPart; -import org.eclipse.emf.common.ui.viewer.IViewerProvider; -import org.eclipse.emf.common.util.BasicDiagnostic; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EValidator; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.EContentAdapter; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.domain.IEditingDomainProvider; -import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; -import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory; -import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; -import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; -import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter; -import org.eclipse.emf.edit.ui.dnd.LocalTransfer; -import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider; -import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper; -import org.eclipse.emf.edit.ui.util.EditUIUtil; -import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.viewers.ColumnWeightData; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ListViewer; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider.JdtmmItemProviderAdapterFactory; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CTabFolder; -import org.eclipse.swt.dnd.DND; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.ControlAdapter; -import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.swt.widgets.TreeColumn; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.dialogs.SaveAsDialog; -import org.eclipse.ui.ide.IGotoMarker; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.MultiPageEditorPart; -import org.eclipse.ui.views.contentoutline.ContentOutline; -import org.eclipse.ui.views.contentoutline.ContentOutlinePage; -import org.eclipse.ui.views.contentoutline.IContentOutlinePage; -import org.eclipse.ui.views.properties.IPropertySheetPage; -import org.eclipse.ui.views.properties.PropertySheet; -import org.eclipse.ui.views.properties.PropertySheetPage; - - -/** - * This is an example of a Jdtmm model editor. - * - * - * - * @generated - */ -public class JdtmmEditor - extends MultiPageEditorPart - implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker { - /** - * This keeps track of the editing domain that is used to track all changes to the model. - * - * - * - * @generated - */ - protected AdapterFactoryEditingDomain editingDomain; - - /** - * This is the one adapter factory used for providing views of the model. - * - * - * - * @generated - */ - protected ComposedAdapterFactory adapterFactory; - - /** - * This is the content outline page. - * - * - * - * @generated - */ - protected IContentOutlinePage contentOutlinePage; - - /** - * This is a kludge... - * - * - * - * @generated - */ - protected IStatusLineManager contentOutlineStatusLineManager; - - /** - * This is the content outline page's viewer. - * - * - * - * @generated - */ - protected TreeViewer contentOutlineViewer; - - /** - * This is the property sheet page. - * - * - * - * @generated - */ - protected PropertySheetPage propertySheetPage; - - /** - * This is the viewer that shadows the selection in the content outline. - * The parent relation must be correctly defined for this to work. - * - * - * - * @generated - */ - protected TreeViewer selectionViewer; - - /** - * This inverts the roll of parent and child in the content provider and show parents as a tree. - * - * - * - * @generated - */ - protected TreeViewer parentViewer; - - /** - * This shows how a tree view works. - * - * - * - * @generated - */ - protected TreeViewer treeViewer; - - /** - * This shows how a list view works. - * A list viewer doesn't support icons. - * - * - * - * @generated - */ - protected ListViewer listViewer; - - /** - * This shows how a table view works. - * A table can be used as a list with icons. - * - * - * - * @generated - */ - protected TableViewer tableViewer; - - /** - * This shows how a tree view with columns works. - * - * - * - * @generated - */ - protected TreeViewer treeViewerWithColumns; - - /** - * This keeps track of the active viewer pane, in the book. - * - * - * - * @generated - */ - protected ViewerPane currentViewerPane; - - /** - * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer. - * - * - * - * @generated - */ - protected Viewer currentViewer; - - /** - * This listens to which ever viewer is active. - * - * - * - * @generated - */ - protected ISelectionChangedListener selectionChangedListener; - - /** - * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor. - * - * - * - * @generated - */ - protected Collection selectionChangedListeners = new ArrayList(); - - /** - * This keeps track of the selection of the editor as a whole. - * - * - * - * @generated - */ - protected ISelection editorSelection = StructuredSelection.EMPTY; - - /** - * The MarkerHelper is responsible for creating workspace resource markers presented - * in Eclipse's Problems View. - * - * - * - * @generated - */ - protected MarkerHelper markerHelper = new EditUIMarkerHelper(); - - /** - * This listens for when the outline becomes active - * - * - * - * @generated - */ - protected IPartListener partListener = - new IPartListener() { - @Override - public void partActivated(IWorkbenchPart p) { - if (p instanceof ContentOutline) { - if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) { - getActionBarContributor().setActiveEditor(JdtmmEditor.this); - - setCurrentViewer(contentOutlineViewer); - } - } - else if (p instanceof PropertySheet) { - if (((PropertySheet) p).getCurrentPage() == propertySheetPage) { - getActionBarContributor().setActiveEditor(JdtmmEditor.this); - handleActivate(); - } - } - else if (p == JdtmmEditor.this) { - handleActivate(); - } - } - - @Override - public void partBroughtToTop(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partClosed(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partDeactivated(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partOpened(IWorkbenchPart p) { - // Ignore. - } - }; - - /** - * Resources that have been removed since last activation. - * - * - * - * @generated - */ - protected Collection removedResources = new ArrayList(); - - /** - * Resources that have been changed since last activation. - * - * - * - * @generated - */ - protected Collection changedResources = new ArrayList(); - - /** - * Resources that have been saved. - * - * - * - * @generated - */ - protected Collection savedResources = new ArrayList(); - - /** - * Map to store the diagnostic associated with a resource. - * - * - * - * @generated - */ - protected Map resourceToDiagnosticMap = new LinkedHashMap(); - - /** - * Controls whether the problem indication should be updated. - * - * - * - * @generated - */ - protected boolean updateProblemIndication = true; - - /** - * Adapter used to update the problem indication when resources are demanded loaded. - * - * - * - * @generated - */ - protected EContentAdapter problemIndicationAdapter = - new EContentAdapter() { - @Override - public void notifyChanged(Notification notification) { - if (notification.getNotifier() instanceof Resource) { - switch (notification.getFeatureID(Resource.class)) { - case Resource.RESOURCE__IS_LOADED: - case Resource.RESOURCE__ERRORS: - case Resource.RESOURCE__WARNINGS: { - Resource resource = (Resource) notification.getNotifier(); - Diagnostic diagnostic = analyzeResourceProblems(resource, null); - if (diagnostic.getSeverity() != Diagnostic.OK) { - resourceToDiagnosticMap.put(resource, diagnostic); - } - else { - resourceToDiagnosticMap.remove(resource); - } - - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - updateProblemIndication(); - } - }); - } - break; - } - } - } - else { - super.notifyChanged(notification); - } - } - - @Override - protected void setTarget(Resource target) { - basicSetTarget(target); - } - - @Override - protected void unsetTarget(Resource target) { - basicUnsetTarget(target); - } - }; - - /** - * This listens for workspace changes. - * - * - * - * @generated - */ - protected IResourceChangeListener resourceChangeListener = - new IResourceChangeListener() { - @Override - public void resourceChanged(IResourceChangeEvent event) { - IResourceDelta delta = event.getDelta(); - try { - class ResourceDeltaVisitor implements IResourceDeltaVisitor { - protected ResourceSet resourceSet = editingDomain.getResourceSet(); - protected Collection changedResources = new ArrayList(); - protected Collection removedResources = new ArrayList(); - - @Override - public boolean visit(IResourceDelta delta) { - if (delta.getResource().getType() == IResource.FILE) { - if (delta.getKind() == IResourceDelta.REMOVED || - delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) { - Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false); - if (resource != null) { - if (delta.getKind() == IResourceDelta.REMOVED) { - removedResources.add(resource); - } - else if (!savedResources.remove(resource)) { - changedResources.add(resource); - } - } - } - } - - return true; - } - - public Collection getChangedResources() { - return changedResources; - } - - public Collection getRemovedResources() { - return removedResources; - } - } - - final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(); - delta.accept(visitor); - - if (!visitor.getRemovedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - removedResources.addAll(visitor.getRemovedResources()); - if (!isDirty()) { - getSite().getPage().closeEditor(JdtmmEditor.this, false); - } - } - }); - } - - if (!visitor.getChangedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - changedResources.addAll(visitor.getChangedResources()); - if (getSite().getPage().getActiveEditor() == JdtmmEditor.this) { - handleActivate(); - } - } - }); - } - } - catch (CoreException exception) { - JdtmmEditorPlugin.INSTANCE.log(exception); - } - } - }; - - /** - * Handles activation of the editor or it's associated views. - * - * - * - * @generated - */ - protected void handleActivate() { - // Recompute the read only state. - // - if (editingDomain.getResourceToReadOnlyMap() != null) { - editingDomain.getResourceToReadOnlyMap().clear(); - - // Refresh any actions that may become enabled or disabled. - // - setSelection(getSelection()); - } - - if (!removedResources.isEmpty()) { - if (handleDirtyConflict()) { - getSite().getPage().closeEditor(JdtmmEditor.this, false); - } - else { - removedResources.clear(); - changedResources.clear(); - savedResources.clear(); - } - } - else if (!changedResources.isEmpty()) { - changedResources.removeAll(savedResources); - handleChangedResources(); - changedResources.clear(); - savedResources.clear(); - } - } - - /** - * Handles what to do with changed resources on activation. - * - * - * - * @generated - */ - protected void handleChangedResources() { - if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { - if (isDirty()) { - changedResources.addAll(editingDomain.getResourceSet().getResources()); - } - editingDomain.getCommandStack().flush(); - - updateProblemIndication = false; - for (Resource resource : changedResources) { - if (resource.isLoaded()) { - resource.unload(); - try { - resource.load(Collections.EMPTY_MAP); - } catch (IOException exception) { - if (!resourceToDiagnosticMap.containsKey(resource)) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - } - } - } - - if (AdapterFactoryEditingDomain.isStale(editorSelection)) { - setSelection(StructuredSelection.EMPTY); - } - - updateProblemIndication = true; - updateProblemIndication(); - } - } - - /** - * Updates the problems indication with the information described in the specified diagnostic. - * - * - * - * @generated - */ - protected void updateProblemIndication() { - if (updateProblemIndication) { - BasicDiagnostic diagnostic = - new BasicDiagnostic - (Diagnostic.OK, - "org.eclipse.papyrus.java.generator.metamodel.jdt.editor", - 0, - null, - new Object[] { editingDomain.getResourceSet() }); - for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) { - if (childDiagnostic.getSeverity() != Diagnostic.OK) { - diagnostic.add(childDiagnostic); - } - } - - int lastEditorPage = getPageCount() - 1; - if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) { - ((ProblemEditorPart) getEditor(lastEditorPage)).setDiagnostic(diagnostic); - if (diagnostic.getSeverity() != Diagnostic.OK) { - setActivePage(lastEditorPage); - } - } - else if (diagnostic.getSeverity() != Diagnostic.OK) { - ProblemEditorPart problemEditorPart = new ProblemEditorPart(); - problemEditorPart.setDiagnostic(diagnostic); - problemEditorPart.setMarkerHelper(markerHelper); - try { - addPage(++lastEditorPage, problemEditorPart, getEditorInput()); - setPageText(lastEditorPage, problemEditorPart.getPartName()); - setActivePage(lastEditorPage); - showTabs(); - } catch (PartInitException exception) { - JdtmmEditorPlugin.INSTANCE.log(exception); - } - } - - if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - markerHelper.deleteMarkers(editingDomain.getResourceSet()); - if (diagnostic.getSeverity() != Diagnostic.OK) { - try { - markerHelper.createMarkers(diagnostic); - } catch (CoreException exception) { - JdtmmEditorPlugin.INSTANCE.log(exception); - } - } - } - } - } - - /** - * Shows a dialog that asks if conflicting changes should be discarded. - * - * - * - * @generated - */ - protected boolean handleDirtyConflict() { - return MessageDialog.openQuestion - (getSite().getShell(), - getString("_UI_FileConflict_label"), - getString("_WARN_FileConflict")); - } - - /** - * This creates a model editor. - * - * - * - * @generated - */ - public JdtmmEditor() { - super(); - initializeEditingDomain(); - } - - /** - * This sets up the editing domain for the model editor. - * - * - * - * @generated - */ - protected void initializeEditingDomain() { - // Create an adapter factory that yields item providers. - // - adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); - - adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new JdtmmItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); - - // Create the command stack that will notify this editor as commands are executed. - // - BasicCommandStack commandStack = new BasicCommandStack(); - - // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. - // - commandStack.addCommandStackListener - (new CommandStackListener() { - @Override - public void commandStackChanged(final EventObject event) { - getContainer().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - firePropertyChange(IEditorPart.PROP_DIRTY); - - // Try to select the affected objects. - // - Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand(); - if (mostRecentCommand != null) { - setSelectionToViewer(mostRecentCommand.getAffectedObjects()); - } - if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) { - propertySheetPage.refresh(); - } - } - }); - } - }); - - // Create the editing domain with a special command stack. - // - editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap()); - } - - /** - * This is here for the listener to be able to call it. - * - * - * - * @generated - */ - @Override - protected void firePropertyChange(int action) { - super.firePropertyChange(action); - } - - /** - * This sets the selection into whichever viewer is active. - * - * - * - * @generated - */ - public void setSelectionToViewer(Collection collection) { - final Collection theSelection = collection; - // Make sure it's okay. - // - if (theSelection != null && !theSelection.isEmpty()) { - Runnable runnable = - new Runnable() { - @Override - public void run() { - // Try to select the items in the current content viewer of the editor. - // - if (currentViewer != null) { - currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); - } - } - }; - getSite().getShell().getDisplay().asyncExec(runnable); - } - } - - /** - * This returns the editing domain as required by the {@link IEditingDomainProvider} interface. - * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}. - * - * - * - * @generated - */ - @Override - public EditingDomain getEditingDomain() { - return editingDomain; - } - - /** - * - * - * - * @generated - */ - public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { - /** - * - * - * - * @generated - */ - public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * - * - * - * @generated - */ - @Override - public Object[] getElements(Object object) { - Object parent = super.getParent(object); - return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); - } - - /** - * - * - * - * @generated - */ - @Override - public Object[] getChildren(Object object) { - Object parent = super.getParent(object); - return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean hasChildren(Object object) { - Object parent = super.getParent(object); - return parent != null; - } - - /** - * - * - * - * @generated - */ - @Override - public Object getParent(Object object) { - return null; - } - } - - /** - * - * - * - * @generated - */ - public void setCurrentViewerPane(ViewerPane viewerPane) { - if (currentViewerPane != viewerPane) { - if (currentViewerPane != null) { - currentViewerPane.showFocus(false); - } - currentViewerPane = viewerPane; - } - setCurrentViewer(currentViewerPane.getViewer()); - } - - /** - * This makes sure that one content viewer, either for the current page or the outline view, if it has focus, - * is the current one. - * - * - * - * @generated - */ - public void setCurrentViewer(Viewer viewer) { - // If it is changing... - // - if (currentViewer != viewer) { - if (selectionChangedListener == null) { - // Create the listener on demand. - // - selectionChangedListener = - new ISelectionChangedListener() { - // This just notifies those things that are affected by the section. - // - @Override - public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { - setSelection(selectionChangedEvent.getSelection()); - } - }; - } - - // Stop listening to the old one. - // - if (currentViewer != null) { - currentViewer.removeSelectionChangedListener(selectionChangedListener); - } - - // Start listening to the new one. - // - if (viewer != null) { - viewer.addSelectionChangedListener(selectionChangedListener); - } - - // Remember it. - // - currentViewer = viewer; - - // Set the editors selection based on the current viewer's selection. - // - setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection()); - } - } - - /** - * This returns the viewer as required by the {@link IViewerProvider} interface. - * - * - * - * @generated - */ - @Override - public Viewer getViewer() { - return currentViewer; - } - - /** - * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. - * - * - * - * @generated - */ - protected void createContextMenuFor(StructuredViewer viewer) { - MenuManager contextMenu = new MenuManager("#PopUp"); - contextMenu.add(new Separator("additions")); - contextMenu.setRemoveAllWhenShown(true); - contextMenu.addMenuListener(this); - Menu menu = contextMenu.createContextMenu(viewer.getControl()); - viewer.getControl().setMenu(menu); - getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); - - int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; - Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() }; - viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); - viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); - } - - /** - * This is the method called to load a resource into the editing domain's resource set based on the editor's input. - * - * - * - * @generated - */ - public void createModel() { - URI resourceURI = EditUIUtil.getURI(getEditorInput()); - Exception exception = null; - Resource resource = null; - try { - // Load the resource through the editing domain. - // - resource = editingDomain.getResourceSet().getResource(resourceURI, true); - } catch (Exception e) { - exception = e; - resource = editingDomain.getResourceSet().getResource(resourceURI, false); - } - - Diagnostic diagnostic = analyzeResourceProblems(resource, exception); - if (diagnostic.getSeverity() != Diagnostic.OK) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter); - } - - /** - * Returns a diagnostic describing the errors and warnings listed in the resource - * and the specified exception (if any). - * - * - * - * @generated - */ - public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) { - if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) { - BasicDiagnostic basicDiagnostic = - new BasicDiagnostic - (Diagnostic.ERROR, - "org.eclipse.papyrus.java.generator.metamodel.jdt.editor", - 0, - getString("_UI_CreateModelError_message", resource.getURI()), - new Object[] { exception == null ? (Object) resource : exception }); - basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); - return basicDiagnostic; - } - else if (exception != null) { - return new BasicDiagnostic(Diagnostic.ERROR, - "org.eclipse.papyrus.java.generator.metamodel.jdt.editor", - 0, - getString("_UI_CreateModelError_message", resource.getURI()), - new Object[] { exception }); - } - else { - return Diagnostic.OK_INSTANCE; - } - } - - /** - * This is the method used by the framework to install your own controls. - * - * - * - * @generated - */ - @Override - public void createPages() { - // Creates the model from the editor input - // - createModel(); - - // Only creates the other pages if there is something that can be edited - // - if (!getEditingDomain().getResourceSet().getResources().isEmpty()) { - // Create a page for the selection tree view. - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), JdtmmEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - Tree tree = new Tree(composite, SWT.MULTI); - TreeViewer newTreeViewer = new TreeViewer(tree); - return newTreeViewer; - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - - selectionViewer = (TreeViewer) viewerPane.getViewer(); - selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - - selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - selectionViewer.setInput(editingDomain.getResourceSet()); - selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); - viewerPane.setTitle(editingDomain.getResourceSet()); - - new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); - - createContextMenuFor(selectionViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_SelectionPage_label")); - } - - // Create a page for the parent tree view. - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), JdtmmEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - Tree tree = new Tree(composite, SWT.MULTI); - TreeViewer newTreeViewer = new TreeViewer(tree); - return newTreeViewer; - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - - parentViewer = (TreeViewer) viewerPane.getViewer(); - parentViewer.setAutoExpandLevel(30); - parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory)); - parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - createContextMenuFor(parentViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_ParentPage_label")); - } - - // This is the page for the list viewer - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), JdtmmEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - return new ListViewer(composite); - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - listViewer = (ListViewer) viewerPane.getViewer(); - listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - createContextMenuFor(listViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_ListPage_label")); - } - - // This is the page for the tree viewer - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), JdtmmEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - return new TreeViewer(composite); - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - treeViewer = (TreeViewer) viewerPane.getViewer(); - treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory); - - createContextMenuFor(treeViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_TreePage_label")); - } - - // This is the page for the table viewer. - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), JdtmmEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - return new TableViewer(composite); - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - tableViewer = (TableViewer) viewerPane.getViewer(); - - Table table = tableViewer.getTable(); - TableLayout layout = new TableLayout(); - table.setLayout(layout); - table.setHeaderVisible(true); - table.setLinesVisible(true); - - TableColumn objectColumn = new TableColumn(table, SWT.NONE); - layout.addColumnData(new ColumnWeightData(3, 100, true)); - objectColumn.setText(getString("_UI_ObjectColumn_label")); - objectColumn.setResizable(true); - - TableColumn selfColumn = new TableColumn(table, SWT.NONE); - layout.addColumnData(new ColumnWeightData(2, 100, true)); - selfColumn.setText(getString("_UI_SelfColumn_label")); - selfColumn.setResizable(true); - - tableViewer.setColumnProperties(new String[] { "a", "b" }); - tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - createContextMenuFor(tableViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_TablePage_label")); - } - - // This is the page for the table tree viewer. - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), JdtmmEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - return new TreeViewer(composite); - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - - treeViewerWithColumns = (TreeViewer) viewerPane.getViewer(); - - Tree tree = treeViewerWithColumns.getTree(); - tree.setLayoutData(new FillLayout()); - tree.setHeaderVisible(true); - tree.setLinesVisible(true); - - TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE); - objectColumn.setText(getString("_UI_ObjectColumn_label")); - objectColumn.setResizable(true); - objectColumn.setWidth(250); - - TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE); - selfColumn.setText(getString("_UI_SelfColumn_label")); - selfColumn.setResizable(true); - selfColumn.setWidth(200); - - treeViewerWithColumns.setColumnProperties(new String[] { "a", "b" }); - treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - createContextMenuFor(treeViewerWithColumns); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); - } - - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - setActivePage(0); - } - }); - } - - // Ensures that this editor will only display the page's tab - // area if there are more than one page - // - getContainer().addControlListener - (new ControlAdapter() { - boolean guard = false; - - @Override - public void controlResized(ControlEvent event) { - if (!guard) { - guard = true; - hideTabs(); - guard = false; - } - } - }); - - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - updateProblemIndication(); - } - }); - } - - /** - * If there is just one page in the multi-page editor part, - * this hides the single tab at the bottom. - * - * - * - * @generated - */ - protected void hideTabs() { - if (getPageCount() <= 1) { - setPageText(0, ""); - if (getContainer() instanceof CTabFolder) { - ((CTabFolder) getContainer()).setTabHeight(1); - Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y + 6); - } - } - } - - /** - * If there is more than one page in the multi-page editor part, - * this shows the tabs at the bottom. - * - * - * - * @generated - */ - protected void showTabs() { - if (getPageCount() > 1) { - setPageText(0, getString("_UI_SelectionPage_label")); - if (getContainer() instanceof CTabFolder) { - ((CTabFolder) getContainer()).setTabHeight(SWT.DEFAULT); - Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y - 6); - } - } - } - - /** - * This is used to track the active viewer. - * - * - * - * @generated - */ - @Override - protected void pageChange(int pageIndex) { - super.pageChange(pageIndex); - - if (contentOutlinePage != null) { - handleContentOutlineSelection(contentOutlinePage.getSelection()); - } - } - - /** - * This is how the framework determines which interfaces we implement. - * - * - * - * @generated - */ - @SuppressWarnings("rawtypes") - @Override - public Object getAdapter(Class key) { - if (key.equals(IContentOutlinePage.class)) { - return showOutlineView() ? getContentOutlinePage() : null; - } - else if (key.equals(IPropertySheetPage.class)) { - return getPropertySheetPage(); - } - else if (key.equals(IGotoMarker.class)) { - return this; - } - else { - return super.getAdapter(key); - } - } - - /** - * This accesses a cached version of the content outliner. - * - * - * - * @generated - */ - public IContentOutlinePage getContentOutlinePage() { - if (contentOutlinePage == null) { - // The content outline is just a tree. - // - class MyContentOutlinePage extends ContentOutlinePage { - @Override - public void createControl(Composite parent) { - super.createControl(parent); - contentOutlineViewer = getTreeViewer(); - contentOutlineViewer.addSelectionChangedListener(this); - - // Set up the tree viewer. - // - contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - contentOutlineViewer.setInput(editingDomain.getResourceSet()); - - // Make sure our popups work. - // - createContextMenuFor(contentOutlineViewer); - - if (!editingDomain.getResourceSet().getResources().isEmpty()) { - // Select the root object in the view. - // - contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); - } - } - - @Override - public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { - super.makeContributions(menuManager, toolBarManager, statusLineManager); - contentOutlineStatusLineManager = statusLineManager; - } - - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - } - - contentOutlinePage = new MyContentOutlinePage(); - - // Listen to selection so that we can handle it is a special way. - // - contentOutlinePage.addSelectionChangedListener - (new ISelectionChangedListener() { - // This ensures that we handle selections correctly. - // - @Override - public void selectionChanged(SelectionChangedEvent event) { - handleContentOutlineSelection(event.getSelection()); - } - }); - } - - return contentOutlinePage; - } - - /** - * This accesses a cached version of the property sheet. - * - * - * - * @generated - */ - public IPropertySheetPage getPropertySheetPage() { - if (propertySheetPage == null) { - propertySheetPage = - new ExtendedPropertySheetPage(editingDomain) { - @Override - public void setSelectionToViewer(List selection) { - JdtmmEditor.this.setSelectionToViewer(selection); - JdtmmEditor.this.setFocus(); - } - - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - }; - propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); - } - - return propertySheetPage; - } - - /** - * This deals with how we want selection in the outliner to affect the other views. - * - * - * - * @generated - */ - public void handleContentOutlineSelection(ISelection selection) { - if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) { - Iterator selectedElements = ((IStructuredSelection) selection).iterator(); - if (selectedElements.hasNext()) { - // Get the first selected element. - // - Object selectedElement = selectedElements.next(); - - // If it's the selection viewer, then we want it to select the same selection as this selection. - // - if (currentViewerPane.getViewer() == selectionViewer) { - ArrayList selectionList = new ArrayList(); - selectionList.add(selectedElement); - while (selectedElements.hasNext()) { - selectionList.add(selectedElements.next()); - } - - // Set the selection to the widget. - // - selectionViewer.setSelection(new StructuredSelection(selectionList)); - } - else { - // Set the input to the widget. - // - if (currentViewerPane.getViewer().getInput() != selectedElement) { - currentViewerPane.getViewer().setInput(selectedElement); - currentViewerPane.setTitle(selectedElement); - } - } - } - } - } - - /** - * This is for implementing {@link IEditorPart} and simply tests the command stack. - * - * - * - * @generated - */ - @Override - public boolean isDirty() { - return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded(); - } - - /** - * This is for implementing {@link IEditorPart} and simply saves the model file. - * - * - * - * @generated - */ - @Override - public void doSave(IProgressMonitor progressMonitor) { - // Save only resources that have actually changed. - // - final Map saveOptions = new HashMap(); - saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); - - // Do the work within an operation because this is a long running activity that modifies the workbench. - // - WorkspaceModifyOperation operation = - new WorkspaceModifyOperation() { - // This is the method that gets invoked when the operation runs. - // - @Override - public void execute(IProgressMonitor monitor) { - // Save the resources to the file system. - // - boolean first = true; - for (Resource resource : editingDomain.getResourceSet().getResources()) { - if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) { - try { - long timeStamp = resource.getTimeStamp(); - resource.save(saveOptions); - if (resource.getTimeStamp() != timeStamp) { - savedResources.add(resource); - } - } - catch (Exception exception) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - first = false; - } - } - } - }; - - updateProblemIndication = false; - try { - // This runs the options, and shows progress. - // - new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation); - - // Refresh the necessary state. - // - ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone(); - firePropertyChange(IEditorPart.PROP_DIRTY); - } catch (Exception exception) { - // Something went wrong that shouldn't. - // - JdtmmEditorPlugin.INSTANCE.log(exception); - } - updateProblemIndication = true; - updateProblemIndication(); - } - - /** - * This returns whether something has been persisted to the URI of the specified resource. - * The implementation uses the URI converter from the editor's resource set to try to open an input stream. - * - * - * - * @generated - */ - protected boolean isPersisted(Resource resource) { - boolean result = false; - try { - InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI()); - if (stream != null) { - result = true; - stream.close(); - } - } catch (IOException e) { - // Ignore - } - return result; - } - - /** - * This always returns true because it is not currently supported. - * - * - * - * @generated - */ - @Override - public boolean isSaveAsAllowed() { - return true; - } - - /** - * This also changes the editor's input. - * - * - * - * @generated - */ - @Override - public void doSaveAs() { - SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); - saveAsDialog.open(); - IPath path = saveAsDialog.getResult(); - if (path != null) { - IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); - if (file != null) { - doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); - } - } - } - - /** - * - * - * - * @generated - */ - protected void doSaveAs(URI uri, IEditorInput editorInput) { - (editingDomain.getResourceSet().getResources().get(0)).setURI(uri); - setInputWithNotify(editorInput); - setPartName(editorInput.getName()); - IProgressMonitor progressMonitor = - getActionBars().getStatusLineManager() != null ? - getActionBars().getStatusLineManager().getProgressMonitor() : - new NullProgressMonitor(); - doSave(progressMonitor); - } - - /** - * - * - * - * @generated - */ - @Override - public void gotoMarker(IMarker marker) { - try { - if (marker.getType().equals(EValidator.MARKER)) { - String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null); - if (uriAttribute != null) { - URI uri = URI.createURI(uriAttribute); - EObject eObject = editingDomain.getResourceSet().getEObject(uri, true); - if (eObject != null) { - setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject))); - } - } - } - } catch (CoreException exception) { - JdtmmEditorPlugin.INSTANCE.log(exception); - } - } - - /** - * This is called during startup. - * - * - * - * @generated - */ - @Override - public void init(IEditorSite site, IEditorInput editorInput) { - setSite(site); - setInputWithNotify(editorInput); - setPartName(editorInput.getName()); - site.setSelectionProvider(this); - site.getPage().addPartListener(partListener); - ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE); - } - - /** - * - * - * - * @generated - */ - @Override - public void setFocus() { - if (currentViewerPane != null) { - currentViewerPane.setFocus(); - } - else { - getControl(getActivePage()).setFocus(); - } - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * - * @generated - */ - @Override - public void addSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.add(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * - * @generated - */ - @Override - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.remove(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. - * - * - * - * @generated - */ - @Override - public ISelection getSelection() { - return editorSelection; - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection. - * Calling this result will notify the listeners. - * - * - * - * @generated - */ - @Override - public void setSelection(ISelection selection) { - editorSelection = selection; - - for (ISelectionChangedListener listener : selectionChangedListeners) { - listener.selectionChanged(new SelectionChangedEvent(this, selection)); - } - setStatusLineManager(selection); - } - - /** - * - * - * - * @generated - */ - public void setStatusLineManager(ISelection selection) { - IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? - contentOutlineStatusLineManager : getActionBars().getStatusLineManager(); - - if (statusLineManager != null) { - if (selection instanceof IStructuredSelection) { - Collection collection = ((IStructuredSelection) selection).toList(); - switch (collection.size()) { - case 0: { - statusLineManager.setMessage(getString("_UI_NoObjectSelected")); - break; - } - case 1: { - String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next()); - statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); - break; - } - default: { - statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); - break; - } - } - } - else { - statusLineManager.setMessage(""); - } - } - } - - /** - * This looks up a string in the plugin's plugin.properties file. - * - * - * - * @generated - */ - private static String getString(String key) { - return JdtmmEditorPlugin.INSTANCE.getString(key); - } - - /** - * This looks up a string in plugin.properties, making a substitution. - * - * - * - * @generated - */ - private static String getString(String key, Object s1) { - return JdtmmEditorPlugin.INSTANCE.getString(key, new Object[] { s1 }); - } - - /** - * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu. - * - * - * - * @generated - */ - @Override - public void menuAboutToShow(IMenuManager menuManager) { - ((IMenuListener) getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); - } - - /** - * - * - * - * @generated - */ - public EditingDomainActionBarContributor getActionBarContributor() { - return (EditingDomainActionBarContributor) getEditorSite().getActionBarContributor(); - } - - /** - * - * - * - * @generated - */ - public IActionBars getActionBars() { - return getActionBarContributor().getActionBars(); - } - - /** - * - * - * - * @generated - */ - public AdapterFactory getAdapterFactory() { - return adapterFactory; - } - - /** - * - * - * - * @generated - */ - @Override - public void dispose() { - updateProblemIndication = false; - - ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); - - getSite().getPage().removePartListener(partListener); - - adapterFactory.dispose(); - - if (getActionBarContributor().getActiveEditor() == this) { - getActionBarContributor().setActiveEditor(null); - } - - if (propertySheetPage != null) { - propertySheetPage.dispose(); - } - - if (contentOutlinePage != null) { - contentOutlinePage.dispose(); - } - - super.dispose(); - } - - /** - * Returns whether the outline view should be presented to the user. - * - * - * - * @generated - */ - protected boolean showOutlineView() { - return true; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditorPlugin.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditorPlugin.java deleted file mode 100644 index 399c138dfb8..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditorPlugin.java +++ /dev/null @@ -1,116 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.presentation; - -import org.eclipse.emf.common.EMFPlugin; -import org.eclipse.emf.common.ui.EclipseUIPlugin; -import org.eclipse.emf.common.util.ResourceLocator; - -/** - * This is the central singleton for the Jdtmm editor plugin. - * - * - * - * @generated - */ -public final class JdtmmEditorPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * - * @generated - */ - public static final JdtmmEditorPlugin INSTANCE = new JdtmmEditorPlugin(); - - /** - * Keep track of the singleton. - * - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * - * @generated - */ - public JdtmmEditorPlugin() { - super(new ResourceLocator[] { - }); - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * - * @return the singleton instance. - * @generated - */ - @Override - public ResourceLocator getPluginResourceLocator() { - return plugin; - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * - * @return the singleton instance. - * @generated - */ - public static Implementation getPlugin() { - return plugin; - } - - /** - * The actual implementation of the Eclipse Plugin. - * - * - * - * @generated - */ - public static class Implementation extends EclipseUIPlugin { - /** - * Creates an instance. - * - * - * - * @generated - */ - public Implementation() { - super(); - - // Remember the static instance. - // - plugin = this; - } - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmModelWizard.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmModelWizard.java deleted file mode 100644 index 3b0642514e6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmModelWizard.java +++ /dev/null @@ -1,656 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.presentation; - - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.StringTokenizer; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.CommonPlugin; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.emf.ecore.xmi.XMLResource; -import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider.JdtmmEditPlugin; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.dialogs.WizardNewFileCreationPage; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.ISetSelectionTarget; - - -/** - * This is a simple wizard for creating a new model file. - * - * - * - * @generated - */ -public class JdtmmModelWizard extends Wizard implements INewWizard { - /** - * The supported extensions for created files. - * - * - * - * @generated - */ - public static final List FILE_EXTENSIONS = - Collections.unmodifiableList(Arrays.asList(JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmEditorFilenameExtensions").split("\\s*,\\s*"))); - - /** - * A formatted list of supported file extensions, suitable for display. - * - * - * - * @generated - */ - public static final String FORMATTED_FILE_EXTENSIONS = - JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); - - /** - * This caches an instance of the model package. - * - * - * - * @generated - */ - protected JdtmmPackage jdtmmPackage = JdtmmPackage.eINSTANCE; - - /** - * This caches an instance of the model factory. - * - * - * - * @generated - */ - protected JdtmmFactory jdtmmFactory = jdtmmPackage.getJdtmmFactory(); - - /** - * This is the file creation page. - * - * - * - * @generated - */ - protected JdtmmModelWizardNewFileCreationPage newFileCreationPage; - - /** - * This is the initial object creation page. - * - * - * - * @generated - */ - protected JdtmmModelWizardInitialObjectCreationPage initialObjectCreationPage; - - /** - * Remember the selection during initialization for populating the default container. - * - * - * - * @generated - */ - protected IStructuredSelection selection; - - /** - * Remember the workbench during initialization. - * - * - * - * @generated - */ - protected IWorkbench workbench; - - /** - * Caches the names of the types that can be created as the root object. - * - * - * - * @generated - */ - protected List initialObjectNames; - - /** - * This just records the information. - * - * - * - * @generated - */ - @Override - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.workbench = workbench; - this.selection = selection; - setWindowTitle(JdtmmEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); - setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(JdtmmEditorPlugin.INSTANCE.getImage("full/wizban/NewJdtmm"))); - } - - /** - * Returns the names of the types that can be created as the root object. - * - * - * - * @generated - */ - protected Collection getInitialObjectNames() { - if (initialObjectNames == null) { - initialObjectNames = new ArrayList(); - for (EClassifier eClassifier : jdtmmPackage.getEClassifiers()) { - if (eClassifier instanceof EClass) { - EClass eClass = (EClass) eClassifier; - if (!eClass.isAbstract()) { - initialObjectNames.add(eClass.getName()); - } - } - } - Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator()); - } - return initialObjectNames; - } - - /** - * Create a new model. - * - * - * - * @generated - */ - protected EObject createInitialModel() { - EClass eClass = (EClass) jdtmmPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); - EObject rootObject = jdtmmFactory.create(eClass); - return rootObject; - } - - /** - * Do the work after everything is specified. - * - * - * - * @generated - */ - @Override - public boolean performFinish() { - try { - // Remember the file. - // - final IFile modelFile = getModelFile(); - - // Do the work within an operation. - // - WorkspaceModifyOperation operation = - new WorkspaceModifyOperation() { - @Override - protected void execute(IProgressMonitor progressMonitor) { - try { - // Create a resource set - // - ResourceSet resourceSet = new ResourceSetImpl(); - - // Get the URI of the model file. - // - URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true); - - // Create a resource for this file. - // - Resource resource = resourceSet.createResource(fileURI); - - // Add the initial model object to the contents. - // - EObject rootObject = createInitialModel(); - if (rootObject != null) { - resource.getContents().add(rootObject); - } - - // Save the contents of the resource to the file system. - // - Map options = new HashMap(); - options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding()); - resource.save(options); - } - catch (Exception exception) { - JdtmmEditorPlugin.INSTANCE.log(exception); - } - finally { - progressMonitor.done(); - } - } - }; - - getContainer().run(false, false, operation); - - // Select the new file resource in the current view. - // - IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); - IWorkbenchPage page = workbenchWindow.getActivePage(); - final IWorkbenchPart activePart = page.getActivePart(); - if (activePart instanceof ISetSelectionTarget) { - final ISelection targetSelection = new StructuredSelection(modelFile); - getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - ((ISetSelectionTarget) activePart).selectReveal(targetSelection); - } - }); - } - - // Open an editor on the new file. - // - try { - page.openEditor - (new FileEditorInput(modelFile), - workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId()); - } catch (PartInitException exception) { - MessageDialog.openError(workbenchWindow.getShell(), JdtmmEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); - return false; - } - - return true; - } catch (Exception exception) { - JdtmmEditorPlugin.INSTANCE.log(exception); - return false; - } - } - - /** - * This is the one page of the wizard. - * - * - * - * @generated - */ - public class JdtmmModelWizardNewFileCreationPage extends WizardNewFileCreationPage { - /** - * Pass in the selection. - * - * - * - * @generated - */ - public JdtmmModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) { - super(pageId, selection); - } - - /** - * The framework calls this to see if the file is correct. - * - * - * - * @generated - */ - @Override - protected boolean validatePage() { - if (super.validatePage()) { - String extension = new Path(getFileName()).getFileExtension(); - if (extension == null || !FILE_EXTENSIONS.contains(extension)) { - String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; - setErrorMessage(JdtmmEditorPlugin.INSTANCE.getString(key, new Object[] { FORMATTED_FILE_EXTENSIONS })); - return false; - } - return true; - } - return false; - } - - /** - * - * - * - * @generated - */ - public IFile getModelFile() { - return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName())); - } - } - - /** - * This is the page where the type of object to create is selected. - * - * - * - * @generated - */ - public class JdtmmModelWizardInitialObjectCreationPage extends WizardPage { - /** - * - * - * - * @generated - */ - protected Combo initialObjectField; - - /** - * @generated - * - * - */ - protected List encodings; - - /** - * - * - * - * @generated - */ - protected Combo encodingField; - - /** - * Pass in the selection. - * - * - * - * @generated - */ - public JdtmmModelWizardInitialObjectCreationPage(String pageId) { - super(pageId); - } - - /** - * - * - * - * @generated - */ - @Override - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - { - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - layout.verticalSpacing = 12; - composite.setLayout(layout); - - GridData data = new GridData(); - data.verticalAlignment = GridData.FILL; - data.grabExcessVerticalSpace = true; - data.horizontalAlignment = GridData.FILL; - composite.setLayoutData(data); - } - - Label containerLabel = new Label(composite, SWT.LEFT); - { - containerLabel.setText(JdtmmEditorPlugin.INSTANCE.getString("_UI_ModelObject")); - - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - containerLabel.setLayoutData(data); - } - - initialObjectField = new Combo(composite, SWT.BORDER); - { - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - initialObjectField.setLayoutData(data); - } - - for (String objectName : getInitialObjectNames()) { - initialObjectField.add(getLabel(objectName)); - } - - if (initialObjectField.getItemCount() == 1) { - initialObjectField.select(0); - } - initialObjectField.addModifyListener(validator); - - Label encodingLabel = new Label(composite, SWT.LEFT); - { - encodingLabel.setText(JdtmmEditorPlugin.INSTANCE.getString("_UI_XMLEncoding")); - - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - encodingLabel.setLayoutData(data); - } - encodingField = new Combo(composite, SWT.BORDER); - { - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - encodingField.setLayoutData(data); - } - - for (String encoding : getEncodings()) { - encodingField.add(encoding); - } - - encodingField.select(0); - encodingField.addModifyListener(validator); - - setPageComplete(validatePage()); - setControl(composite); - } - - /** - * - * - * - * @generated - */ - protected ModifyListener validator = - new ModifyListener() { - @Override - public void modifyText(ModifyEvent e) { - setPageComplete(validatePage()); - } - }; - - /** - * - * - * - * @generated - */ - protected boolean validatePage() { - return getInitialObjectName() != null && getEncodings().contains(encodingField.getText()); - } - - /** - * - * - * - * @generated - */ - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - if (visible) { - if (initialObjectField.getItemCount() == 1) { - initialObjectField.clearSelection(); - encodingField.setFocus(); - } - else { - encodingField.clearSelection(); - initialObjectField.setFocus(); - } - } - } - - /** - * - * - * - * @generated - */ - public String getInitialObjectName() { - String label = initialObjectField.getText(); - - for (String name : getInitialObjectNames()) { - if (getLabel(name).equals(label)) { - return name; - } - } - return null; - } - - /** - * - * - * - * @generated - */ - public String getEncoding() { - return encodingField.getText(); - } - - /** - * Returns the label for the specified type name. - * - * - * - * @generated - */ - protected String getLabel(String typeName) { - try { - return JdtmmEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); - } catch (MissingResourceException mre) { - JdtmmEditorPlugin.INSTANCE.log(mre); - } - return typeName; - } - - /** - * - * - * - * @generated - */ - protected Collection getEncodings() { - if (encodings == null) { - encodings = new ArrayList(); - for (StringTokenizer stringTokenizer = new StringTokenizer(JdtmmEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens();) { - encodings.add(stringTokenizer.nextToken()); - } - } - return encodings; - } - } - - /** - * The framework calls this to create the contents of the wizard. - * - * - * - * @generated - */ - @Override - public void addPages() { - // Create a page, set the title, and the initial model file name. - // - newFileCreationPage = new JdtmmModelWizardNewFileCreationPage("Whatever", selection); - newFileCreationPage.setTitle(JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmModelWizard_label")); - newFileCreationPage.setDescription(JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmModelWizard_description")); - newFileCreationPage.setFileName(JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0)); - addPage(newFileCreationPage); - - // Try and get the resource selection to determine a current directory for the file dialog. - // - if (selection != null && !selection.isEmpty()) { - // Get the resource... - // - Object selectedElement = selection.iterator().next(); - if (selectedElement instanceof IResource) { - // Get the resource parent, if its a file. - // - IResource selectedResource = (IResource) selectedElement; - if (selectedResource.getType() == IResource.FILE) { - selectedResource = selectedResource.getParent(); - } - - // This gives us a directory... - // - if (selectedResource instanceof IFolder || selectedResource instanceof IProject) { - // Set this for the container. - // - newFileCreationPage.setContainerFullPath(selectedResource.getFullPath()); - - // Make up a unique new name here. - // - String defaultModelBaseFilename = JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmEditorFilenameDefaultBase"); - String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0); - String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; - for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) { - modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; - } - newFileCreationPage.setFileName(modelFilename); - } - } - } - initialObjectCreationPage = new JdtmmModelWizardInitialObjectCreationPage("Whatever2"); - initialObjectCreationPage.setTitle(JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmModelWizard_label")); - initialObjectCreationPage.setDescription(JdtmmEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description")); - addPage(initialObjectCreationPage); - } - - /** - * Get the file from the page. - * - * - * - * @generated - */ - public IFile getModelFile() { - return newFileCreationPage.getModelFile(); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.classpath b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.project b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.project deleted file mode 100644 index 6da221b42e4..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.java.generator.metamodel.jdt - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.core.prefs b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94d61f00da6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/META-INF/MANIFEST.MF b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/META-INF/MANIFEST.MF deleted file mode 100644 index 09af16320e6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.uml2.common;bundle-version="1.5.0", - org.eclipse.jdt.core;bundle-version="3.6.0", - org.eclipse.core.runtime, - org.eclipse.emf.ecore;visibility:=reexport, - org.eclipse.uml2.types;visibility:=reexport -Export-Package: org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm, - org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl, - org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.util, - org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm, - org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl, - org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util, - org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.java.generator.metamodel.jdt;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/about.html b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/build.properties b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/build.properties deleted file mode 100644 index 90dc876dc50..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/build.properties +++ /dev/null @@ -1,16 +0,0 @@ - -# -# -# -# $Id$ - -bin.includes = .,\ - model/,\ - META-INF/,\ - plugin.xml,\ - plugin.properties,\ - about.html -jars.compile.order = . -source.. = src/ -output.. = bin/ -src.includes = about.html diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.di b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.di deleted file mode 100644 index bf9abab340f..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.di +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.ecore b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.ecore deleted file mode 100644 index 94f441e8179..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.ecore +++ /dev/null @@ -1,12 +0,0 @@ - - - -
- - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.genmodel b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.genmodel deleted file mode 100644 index 185bb8cd48b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.genmodel +++ /dev/null @@ -1,40 +0,0 @@ - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - generatoroptionsmm.uml - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.notation b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.notation deleted file mode 100644 index b9668edc339..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.notation +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.uml b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.uml deleted file mode 100644 index 984402e4517..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.uml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.di b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.di deleted file mode 100644 index 2ad562c2abc..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.di +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.ecore b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.ecore deleted file mode 100644 index 8d8c40c7c1b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.ecore +++ /dev/null @@ -1,243 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.genmodel b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.genmodel deleted file mode 100644 index 5661529e011..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.genmodel +++ /dev/null @@ -1,191 +0,0 @@ - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - jdtmm.uml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.notation b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.notation deleted file mode 100644 index a43c9740861..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.notation +++ /dev/null @@ -1,3094 +0,0 @@ - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - -
-
-
-
-
- - - - - - - -
- - -
- - -
- - -
-
-
-
-
- - - - - - - -
- - -
- - -
- - -
-
-
-
-
- - - - - - - -
- - -
- - -
- - -
-
-
-
-
- - - - - - - -
- - -
- - -
- - -
-
-
-
-
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.uml b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.uml deleted file mode 100644 index 30b14aa8114..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.uml +++ /dev/null @@ -1,481 +0,0 @@ - - - - - Can have different type of body: opaque, expr (not yet implemented, ...) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This class is not part of JDT. It is added as a convenience to simplify the double inheritance from -JDTParent and JDTJavaElement - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.di b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.di deleted file mode 100644 index 9084770dd56..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.di +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.notation b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.notation deleted file mode 100644 index 73830701e82..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.notation +++ /dev/null @@ -1,1614 +0,0 @@ - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.uml b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.uml deleted file mode 100644 index 0421e23299d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.uml +++ /dev/null @@ -1,20911 +0,0 @@ - - - - - - - - - - - - * Utility class to decode or create a binding key. - * <p> - * This class is not intended to be subclassed by clients. - * </p> - * - * @see org.eclipse.jdt.core.dom.IBinding#getKey() - * @since 3.1 - - - - - - - * Creates a new array type binding key from the given type binding key and the given array dimension. - * <p> - * For example: - * <pre> - * <code> - * createArrayTypeBindingKey("Ljava/lang/Object;", 1) -> "[Ljava/lang/Object;" - * createArrayTypeBindingKey("I", 2) -> "[[I" - * </code> - * </pre> - * </p> - * - * @param typeKey the binding key of the given type - * @param arrayDimension the given array dimension - * @return a new array type binding key - - - - - - - - - - * Creates a new parameterized type binding key from the given generic type binding key and the given argument type binding keys. - * If the argument type keys array is empty, then a raw type binding key is created. - * <p> - * For example: - * <pre> - * <code> - * createParameterizedTypeBindingKey( - * "Ljava/util/Map&lt;TK;TV;&gt;;", - * new String[] {"Ljava/lang/String;", "Ljava/lang/Object;"}) -&gt; - * "Ljava/util/Map&lt;Ljava/lang/String;Ljava/lang/Object;&gt;;" - * createParameterizedTypeBindingKey( - * "Ljava/util/List&lt;TE;&gt;;", new String[] {}) -&gt; - * "Ljava/util/List&lt;&gt;;" - * </code> - * </pre> - * </p> - * - * @param genericTypeKey the binding key of the generic type - * @param argumentTypeKeys the possibly empty list of binding keys of argument types - * @return a new parameterized type binding key - - - - - - - - - - - - - * Creates a new type binding key from the given type name. The type name must be either - * a fully qualified name, an array type name or a primitive type name. - * If the type name is fully qualified, then it is expected to be dot-based. - * Note that inner types, generic types and parameterized types are not supported. - * <p> - * For example: - * <pre> - * <code> - * createTypeBindingKey("int") -> "I" - * createTypeBindingKey("java.lang.String") -> "Ljava/lang/String;" - * createTypeBindingKey("boolean[]") -> "[Z" - * </code> - * </pre> - * </p> - * - * @param typeName the possibly qualified type name - * @return a new type binding key - - - - - - - - - * Creates a new type variable binding key from the given type variable name and the given declaring key. - * The declaring key can either be a type binding key or a method binding key. - * <p> - * For example: - * <pre> - * <code> - * createTypeVariableBindingKey("T", "Ljava/util/List&lt;TE;&gt;;") -&gt; - * "Ljava/util/List&lt;TE;&gt;;:TT;" - * createTypeVariableBindingKey("SomeTypeVariable", "Lp/X;.foo()V") -&gt; - * "Lp/X;.foo()V:TSomeTypeVariable;" - * </code> - * </pre> - * </p> - * - * @param typeVariableName the name of the given type variable - * @param declaringKey the binding key of the type or method the type variable belongs to - * @return a new type variable binding key - - - - - - - - - - * Creates a new wildcard type binding key from the given type binding key and the given wildcard kind - * (one of {@link Signature#C_STAR}, {@link Signature#C_SUPER}, or {@link Signature#C_EXTENDS}. - * If the wildcard is {@link Signature#C_STAR}, the given type binding key is ignored. - * <p> - * For example: - * <pre> - * <code> - * createWilcardTypeBindingKey(null, Signature.C_STAR) -&gt; "*" - * createWilcardTypeBindingKey("Ljava/util/List&lt;TE;&gt;;", - * Signature.C_SUPER) -&gt; "-Ljava/util/List&lt;TE;&gt;;" - * createWilcardTypeBindingKey("Ljava/util/ArrayList;", Signature.C_EXTENDS) -&gt; - * "+Ljava/util/ArrayList;" - * </code> - * </pre> - * </p> - * - * @param typeKey the binding key of the given type - * @param kind one of {@link Signature#C_STAR}, {@link Signature#C_SUPER}, or {@link Signature#C_EXTENDS} - * @return a new wildcard type binding key - * @deprecated This method is missing crucial information necessary for proper wildcard binding key creation. - * @see org.eclipse.jdt.core.BindingKey#createWildcardTypeBindingKey(String, char, String, int) - - - - - - - - - - * Creates a new wildcard type binding key from the given generic type binding key, the given wildcard - * kind (one of {@link Signature#C_STAR}, {@link Signature#C_SUPER}, or {@link Signature#C_EXTENDS} - * the given bound type binding key and the given rank. If the wildcard kind is {@link Signature#C_STAR}, - * the given bound type binding key is ignored. - * <p> - * For example: - * <pre> - * <code> - * createWildcardTypeBindingKey("Ljava/util/ArrayList;", Signature.C_STAR, null, 0) -&gt; "Ljava/util/ArrayList;{0}*" - * createWildcardTypeBindingKey("Ljava/util/ArrayList;", Signature.C_SUPER, "Ljava/lang/String;", 0) -&gt; "Ljava/util/ArrayList;{0}-Ljava/lang/String;" - * createWildcardTypeBindingKey("Ljava/util/HashMap;", Signature.C_EXTENDS, "Ljava/lang/String;", 1) -&gt; - * "Ljava/util/HashMap;{1}+Ljava/lang/String;" - * </code> - * </pre> - * </p> - * - * @param genericTypeKey the binding key of the generic type - * @param boundKind one of {@link Signature#C_STAR}, {@link Signature#C_SUPER}, or {@link Signature#C_EXTENDS} - * @param boundTypeKey the binding key of the bounding type. - * @param rank the relative position of this wild card type in the parameterization of the generic type. - * @return a new wildcard type binding key - * @since 3.5 - - - - - - - - - - - - * Returns the thrown exception signatures of the element represented by this binding key. - * If this binding key does not represent a method or does not throw any exception, - * returns an empty array. - * - * @return the thrown exceptions signatures - * @since 3.3 - - - - - - - - - - - * Returns the type argument signatures of the element represented by this binding key. - * If this binding key doesn't represent a parameterized type or a parameterized method, - * returns an empty array. - * - * @return the type argument signatures - - - - - - - - - - - * Returns whether this binding key represents a raw type. - * - * @return whether this binding key represents a raw type - - - - - - - - * Returns whether this binding key represents a parameterized type, or if its declaring type is a parameterized type. - * - * @return whether this binding key represents a parameterized type - - - - - - - - * Returns whether this binding key represents a parameterized method, or if its declaring method is a parameterized method. - * - * @return whether this binding key represents a parameterized method - - - - - - - - * Transforms this binding key into a resolved signature. - * If this binding key represents a field, the returned signature is - * the field type's signature. - * - * @return the resolved signature for this binding key - * @see Signature - * @since 3.2 - - - - - - - - - - - - * A buffer changed event describes how a buffer has changed. These events are - * used in <code>IBufferChangedListener</code> notifications. - * <p> - * For text insertions, <code>getOffset</code> is the offset - * of the first inserted character, <code>getText</code> is the - * inserted text, and <code>getLength</code> is 0. - * </p> - * <p> - * For text removals, <code>getOffset</code> is the offset - * of the first removed character, <code>getText</code> is <code>null</code>, - * and <code>getLength</code> is the length of the text that was removed. - * </p> - * <p> - * For replacements (including <code>IBuffer.setContents</code>), - * <code>getOffset</code> is the offset - * of the first replaced character, <code>getText</code> is the replacement - * text, and <code>getLength</code> is the length of the original text - * that was replaced. - * </p> - * <p> - * When a buffer is closed, <code>getOffset</code> is 0, <code>getLength</code> - * is 0, and <code>getText</code> is <code>null</code>. - * </p> - * - * @see IBuffer - * @noextend This class is not intended to be subclassed by clients. - - - - - - - * The length of text that has been modified in the buffer. - - - - - - - * The offset into the buffer where the modification took place. - - - - - - - * The text that was modified. - - - - - - - - * Returns the buffer which has changed. - * - * @return the buffer affected by the change - - - - - - - - * Abstract base implementation of all classpath variable initializers. - * Classpath variable initializers are used in conjunction with the - * "org.eclipse.jdt.core.classpathVariableInitializer" extension point. - * <p> - * Clients should subclass this class to implement a specific classpath - * variable initializer. The subclass must have a public 0-argument - * constructor and a concrete implementation of <code>initialize</code>. - * - * @see IClasspathEntry - * @since 2.0 - - - - - - * Binds a value to the workspace classpath variable with the given name, - * or fails silently if this cannot be done. - * <p> - * A variable initializer is automatically activated whenever a variable value - * is needed and none has been recorded so far. The implementation of - * the initializer can set the corresponding variable using - * <code>JavaCore#setClasspathVariable</code>. - * - * @param variable the name of the workspace classpath variable - * that requires a binding - * - * @see JavaCore#getClasspathVariable(String) - * @see JavaCore#setClasspathVariable(String, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor) - * @see JavaCore#setClasspathVariables(String[], org.eclipse.core.runtime.IPath[], org.eclipse.core.runtime.IProgressMonitor) - - - - - - - - - * Completion context. - * - * Represent the context in which the completion occurs. - * - * @see CompletionRequestor#acceptContext(CompletionContext) - * @since 3.1 - * @noinstantiate This class is not intended to be instantiated by clients. - - - - - - * The completed token is the first token of a member declaration.<br> - * e.g. - * <pre> - * public class X { - * Foo| // completion occurs at | - * } - * </pre> - * - * @see #getTokenLocation() - * - * @since 3.4 - - - - - - - * The completed token is the first token of a statement.<br> - * e.g. - * <pre> - * public class X { - * public void bar() { - * Foo| // completion occurs at | - * } - * } - * </pre> - * - * @see #getTokenLocation() - * - * @since 3.4 - - - - - - - * The completion token is unknown. - * @since 3.2 - - - - - - - * The completion token is a name. - * @since 3.2 - - - - - - - * The completion token is a string literal. - * The string literal ends quote can be not present the source. - * <code>"foo"</code> or <code>"foo</code>. - * @since 3.2 - - - - - - - * Tell user whether completion takes place in a javadoc comment or not. - * - * @return boolean true if completion takes place in a javadoc comment, false otherwise. - * @since 3.2 - - - - - - - - * Tell user whether completion takes place in text area of a javadoc comment or not. - * - * @return boolean true if completion takes place in a text area of a javadoc comment, false otherwise. - * @since 3.2 - - - - - - - - * Tell user whether completion takes place in a formal reference of a javadoc tag or not. - * Tags with formal reference are: - * <ul> - * <li>&#64;see</li> - * <li>&#64;throws</li> - * <li>&#64;exception</li> - * <li>{&#64;link Object}</li> - * <li>{&#64;linkplain Object}</li> - * <li>{&#64;value} when compiler compliance is set at leats to 1.5</li> - * </ul> - * - * @return boolean true if completion takes place in formal reference of a javadoc tag, false otherwise. - * @since 3.2 - - - - - - - - * Returns whether this completion context is an extended context. - * Some methods of this context can be used only if this context is an extended context but an extended context consumes more memory. - * - * @return <code>true</code> if this completion context is an extended context. - * - * @since 3.4 - - - - - - - - * Return signatures of expected types of a potential completion proposal at the completion position. - * - * It's not mandatory to a completion proposal to respect this expectation. - * - * @return signatures expected types of a potential completion proposal at the completion position or - * <code>null</code> if there is no expected types. - * - * @see Signature - - - - - - - - - - - * Return keys of expected types of a potential completion proposal at the completion position. - * - * It's not mandatory to a completion proposal to respect this expectation. - * - * @return keys of expected types of a potential completion proposal at the completion position or - * <code>null</code> if there is no expected types. - * - * @see org.eclipse.jdt.core.dom.ASTParser#createASTs(ICompilationUnit[], String[], org.eclipse.jdt.core.dom.ASTRequestor, org.eclipse.core.runtime.IProgressMonitor) - - - - - - - - - - - * Returns the completed token. - * This token is either the identifier or Java language keyword - * or the string literal under, immediately preceding, - * the original request offset. If the original request offset - * is not within or immediately after an identifier or keyword or - * a string literal then the returned value is <code>null</code>. - * - * @return completed token or <code>null</code> - * @since 3.2 - - - - - - - - - - - * Returns the kind of completion token being proposed. - * <p> - * The set of different kinds of completion token is - * expected to change over time. It is strongly recommended - * that clients do <b>not</b> assume that the kind is one of the - * ones they know about, and code defensively for the - * possibility of unexpected future growth. - * </p> - * - * @return the kind; one of the kind constants declared on - * this class whose name starts with <code>TOKEN_KIND</code>, - * or possibly a kind unknown to the caller - * @since 3.2 - - - - - - - - * Returns the location of completion token being proposed. - * The returned location is a bit mask which can contain some values - * of the constants declared on this class whose name starts with <code>TL</code>, - * or possibly values unknown to the caller. - * - * <p> - * The set of different location values is expected to change over time. - * It is strongly recommended that clients do <b>not</b> assume that - * the location contains only known value, and code defensively for - * the possibility of unexpected future growth. - * </p> - * - * @return the location - * - * @since 3.4 - - - - - - - - * Returns the character index of the start of the - * subrange in the source file buffer containing the - * relevant token being completed. This - * token is either the identifier or Java language keyword - * under, or immediately preceding, the original request - * offset. If the original request offset is not within - * or immediately after an identifier or keyword, then the - * position returned is original request offset and the - * token range is empty. - * - * @return character index of token start position (inclusive) - * @since 3.2 - - - - - - - - - - - * Returns the offset position in the source file buffer - * after which code assist is requested. - * - * @return offset position in the source file buffer - * @since 3.2 - - - - - - - - * Returns the innermost enclosing Java element which contains the completion location or <code>null</code> if this element cannot be computed. - * The returned Java element and all Java elements in the same compilation unit which can be navigated to from the returned Java element are special Java elements: - * <ul> - * <li>they are based on the current content of the compilation unit's buffer, they are not the result of a reconcile operation</li> - * <li>they are not updated if the buffer changes.</li> - * <li>they do not contain local types which are not visible from the completion location.</li> - * <li>they do not give information about categories. {@link IMember#getCategories()} will return an empty array</li> - * </ul> - * - * Reasons for returning <code>null</code> include: - * <ul> - * <li>the compilation unit no longer exists</li> - * <li>the completion occurred in a binary type. However this restriction might be relaxed in the future.</li> - * </ul> - * - * @return the innermost enclosing Java element which contains the completion location or <code>null</code> if this element cannot be computed. - * - * @exception UnsupportedOperationException if the context is not an extended context - * - * @since 3.4 - - - - - - - - * Utility class for decoding additional flags in completion proposal. - * <p> - * This class provides static methods only; it is not intended to be - * instantiated or subclassed by clients. - * </p> - * - * @see CompletionProposal#getAdditionalFlags() - * - * @since 3.3 - - - - - - * Constant representing the absence of any flag - - - - - - - * Constant representing a static import - - - - - - - * Returns whether the given integer includes the {@link #StaticImport} flag. - * - * @param flags the flags - * @return <code>true</code> if the {@link #StaticImport} flag is included - - - - - - - - - - * Completion proposal. - * <p> - * In typical usage, the user working in a Java code editor issues - * a code assist command. This command results in a call to - * <code>ICodeAssist.codeComplete(position, completionRequestor)</code> - * passing the current position in the source code. The code assist - * engine analyzes the code in the buffer, determines what kind of - * Java language construct is at that position, and proposes ways - * to complete that construct. These proposals are instances of - * the class <code>CompletionProposal</code>. These proposals, - * perhaps after sorting and filtering, are presented to the user - * to make a choice. - * </p> - * <p> - * The proposal is as follows: insert - * the {@linkplain #getCompletion() completion string} into the - * source file buffer, replacing the characters between - * {@linkplain #getReplaceStart() the start} - * and {@linkplain #getReplaceEnd() end}. The string - * can be arbitrary; for example, it might include not only the - * name of a method but a set of parentheses. Moreover, the source - * range may include source positions before or after the source - * position where <code>ICodeAssist.codeComplete</code> was invoked. - * The rest of the information associated with the proposal is - * to provide context that may help a user to choose from among - * competing proposals. - * </p> - * <p> - * The completion engine creates instances of this class. - * </p> - * - * @see ICodeAssist#codeComplete(int, CompletionRequestor) - * @since 3.0 - * @noinstantiate This class is not intended to be instantiated by clients. - * @noextend This class is not intended to be subclassed by clients. - - - - - - * Completion is a declaration of an anonymous class. - * This kind of completion might occur in a context like - * <code>"new List(^;"</code> and complete it to - * <code>"new List() {}"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type being implemented or subclassed - * </li> - * <li>{@link #getDeclarationKey()} - - * the type unique key of the type being implemented or subclassed - * </li> - * <li>{@link #getSignature()} - - * the method signature of the constructor that is referenced - * </li> - * <li>{@link #getKey()} - - * the method unique key of the constructor that is referenced - * if the declaring type is not an interface - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags of the constructor that is referenced - * </li> - * </ul> - * </p> - * - * @see #getKind() - - - - - - - * Completion is a reference to a field. - * This kind of completion might occur in a context like - * <code>"this.ref^ = 0;"</code> and complete it to - * <code>"this.refcount = 0;"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the field that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags (including ACC_ENUM) of the field that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the field that is referenced - * </li> - * <li>{@link #getSignature()} - - * the type signature of the field's type (as opposed to the - * signature of the type in which the referenced field - * is declared) - * </li> - * </ul> - * </p> - * - * @see #getKind() - - - - - - - * Completion is a keyword. - * This kind of completion might occur in a context like - * <code>"public cl^ Foo {}"</code> and complete it to - * <code>"public class Foo {}"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getName()} - - * the keyword token - * </li> - * <li>{@link #getFlags()} - - * the corresponding modifier flags if the keyword is a modifier - * </li> - * </ul> - * </p> - * - * @see #getKind() - - - - - - - * Completion is a reference to a label. - * This kind of completion might occur in a context like - * <code>"break lo^;"</code> and complete it to - * <code>"break loop;"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getName()} - - * the simple name of the label that is referenced - * </li> - * </ul> - * </p> - * - * @see #getKind() - - - - - - - * Completion is a reference to a local variable. - * This kind of completion might occur in a context like - * <code>"ke^ = 4;"</code> and complete it to - * <code>"keys = 4;"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getFlags()} - - * the modifiers flags of the local variable that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the local variable that is referenced - * </li> - * <li>{@link #getSignature()} - - * the type signature of the local variable's type - * </li> - * </ul> - * </p> - * - * @see #getKind() - - - - - - - * Completion is a reference to a method. - * This kind of completion might occur in a context like - * <code>"System.out.pr^();"</code> and complete it to - * <code>""System.out.println();"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the method that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags of the method that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the method that is referenced - * </li> - * <li>{@link #getSignature()} - - * the method signature of the method that is referenced - * </li> - * </ul> - * </p> - * - * @see #getKind() - - - - - - - * Completion is a declaration of a method. - * This kind of completion might occur in a context like - * <code>"new List() {si^};"</code> and complete it to - * <code>"new List() {public int size() {} };"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the - * method that is being overridden or implemented - * </li> - * <li>{@link #getDeclarationKey()} - - * the unique of the type that declares the - * method that is being overridden or implemented - * </li> - * <li>{@link #getName()} - - * the simple name of the method that is being overridden - * or implemented - * </li> - * <li>{@link #getSignature()} - - * the method signature of the method that is being - * overridden or implemented - * </li> - * <li>{@link #getKey()} - - * the method unique key of the method that is being - * overridden or implemented - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags of the method that is being - * overridden or implemented - * </li> - * </ul> - * </p> - * - * @see #getKind() - - - - - - - * Completion is a reference to a package. - * This kind of completion might occur in a context like - * <code>"import java.u^.*;"</code> and complete it to - * <code>"import java.util.*;"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the dot-based package name of the package that is referenced - * </li> - * </ul> - * </p> - * - * @see #getKind() - - - - - - - * Completion is a reference to a type. Any kind of type - * is allowed, including primitive types, reference types, - * array types, parameterized types, and type variables. - * This kind of completion might occur in a context like - * <code>"public static Str^ key;"</code> and complete it to - * <code>"public static String key;"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the dot-based package name of the package that contains - * the type that is referenced - * </li> - * <li>{@link #getSignature()} - - * the type signature of the type that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags (including Flags.AccInterface, AccEnum, - * and AccAnnotation) of the type that is referenced - * </li> - * </ul> - * </p> - * - * @see #getKind() - - - - - - - * Completion is a declaration of a variable (locals, parameters, - * fields, etc.). - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getName()} - - * the simple name of the variable being declared - * </li> - * <li>{@link #getSignature()} - - * the type signature of the type of the variable - * being declared - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags of the variable being declared - * </li> - * </ul> - * </p> - * @see #getKind() - - - - - - - * Completion is a declaration of a new potential method. - * This kind of completion might occur in a context like - * <code>"new List() {si^};"</code> and complete it to - * <code>"new List() {public int si() {} };"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the - * method that is being created - * </li> - * <li>{@link #getName()} - - * the simple name of the method that is being created - * </li> - * <li>{@link #getSignature()} - - * the method signature of the method that is being - * created - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags of the method that is being - * created - * </li> - * </ul> - * </p> - * - * @see #getKind() - * @since 3.1 - - - - - - - * Completion is a reference to a method name. - * This kind of completion might occur in a context like - * <code>"import p.X.fo^"</code> and complete it to - * <code>"import p.X.foo;"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the method that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags of the method that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the method that is referenced - * </li> - * <li>{@link #getSignature()} - - * the method signature of the method that is referenced - * </li> - * </ul> - * </p> - * - * @see #getKind() - * @since 3.1 - - - - - - - * Completion is a reference to annotation's attribute. - * This kind of completion might occur in a context like - * <code>"@Annot(attr^=value)"</code> and complete it to - * <code>"@Annot(attribute^=value)"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the annotation that declares the attribute that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags of the attribute that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the attribute that is referenced - * </li> - * <li>{@link #getSignature()} - - * the type signature of the attribute's type (as opposed to the - * signature of the type in which the referenced attribute - * is declared) - * </li> - * </ul> - * </p> - * - * @see #getKind() - * @since 3.1 - - - - - - - * Completion is a link reference to a field in a javadoc text. - * This kind of completion might occur in a context like - * <code>" * blabla System.o^ blabla"</code> and complete it to - * <code>" * blabla {&#64;link System#out } blabla"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the field that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags (including ACC_ENUM) of the field that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the field that is referenced - * </li> - * <li>{@link #getSignature()} - - * the type signature of the field's type (as opposed to the - * signature of the type in which the referenced field - * is declared) - * </li> - * </ul> - * </p> - * - * @see #getKind() - * @since 3.2 - - - - - - - * Completion is a link reference to a method in a javadoc text. - * This kind of completion might occur in a context like - * <code>" * blabla Runtime#get^ blabla"</code> and complete it to - * <code>" * blabla {&#64;link Runtime#getRuntime() }"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the method that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags of the method that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the method that is referenced - * </li> - * <li>{@link #getSignature()} - - * the method signature of the method that is referenced - * </li> - * </ul> - * </p> - * - * @see #getKind() - * @since 3.2 - - - - - - - * Completion is a link reference to a type in a javadoc text. - * Any kind of type is allowed, including primitive types, reference types, - * array types, parameterized types, and type variables. - * This kind of completion might occur in a context like - * <code>" * blabla Str^ blabla"</code> and complete it to - * <code>" * blabla {&#64;link String } blabla"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the dot-based package name of the package that contains - * the type that is referenced - * </li> - * <li>{@link #getSignature()} - - * the type signature of the type that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags (including Flags.AccInterface, AccEnum, - * and AccAnnotation) of the type that is referenced - * </li> - * </ul> - * </p> - * - * @see #getKind() - * @since 3.2 - - - - - - - * Completion is a value reference to a static field in a javadoc text. - * This kind of completion might occur in a context like - * <code>" * blabla System.o^ blabla"</code> and complete it to - * <code>" * blabla {&#64;value System#out } blabla"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the field that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags (including ACC_ENUM) of the field that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the field that is referenced - * </li> - * <li>{@link #getSignature()} - - * the type signature of the field's type (as opposed to the - * signature of the type in which the referenced field - * is declared) - * </li> - * </ul> - * </p> - * - * @see #getKind() - * @since 3.2 - - - - - - - * Completion is a method argument or a class/method type parameter - * in javadoc param tag. - * This kind of completion might occur in a context like - * <code>" * @param arg^ blabla"</code> and complete it to - * <code>" * @param argument blabla"</code>. - * or - * <code>" * @param &lt;T^ blabla"</code> and complete it to - * <code>" * @param &lt;TT&gt; blabla"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the field that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags (including ACC_ENUM) of the field that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the field that is referenced - * </li> - * <li>{@link #getSignature()} - - * the type signature of the field's type (as opposed to the - * signature of the type in which the referenced field - * is declared) - * </li> - * </ul> - * </p> - * - * @see #getKind() - * @since 3.2 - - - - - - - * Completion is a javadoc block tag. - * This kind of completion might occur in a context like - * <code>" * @s^ blabla"</code> and complete it to - * <code>" * @see blabla"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the field that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags (including ACC_ENUM) of the field that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the field that is referenced - * </li> - * <li>{@link #getSignature()} - - * the type signature of the field's type (as opposed to the - * signature of the type in which the referenced field - * is declared) - * </li> - * </ul> - * </p> - * - * @see #getKind() - * @since 3.2 - - - - - - - * Completion is a javadoc inline tag. - * This kind of completion might occur in a context like - * <code>" * Insert @l^ Object"</code> and complete it to - * <code>" * Insert {&#64;link Object }"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the field that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags (including ACC_ENUM) of the field that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the field that is referenced - * </li> - * <li>{@link #getSignature()} - - * the type signature of the field's type (as opposed to the - * signature of the type in which the referenced field - * is declared) - * </li> - * </ul> - * </p> - * - * @see #getKind() - * @since 3.2 - - - - - - - * Completion is an import of reference to a static field. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the field that is imported - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags (including ACC_ENUM) of the field that is imported - * </li> - * <li>{@link #getName()} - - * the simple name of the field that is imported - * </li> - * <li>{@link #getSignature()} - - * the type signature of the field's type (as opposed to the - * signature of the type in which the referenced field - * is declared) - * </li> - * <li>{@link #getAdditionalFlags()} - - * the completion flags (including ComletionFlags.StaticImport) - * of the proposed import - * </li> - * </ul> - * </p> - * - * @see #getKind() - * - * @since 3.3 - - - - - - - * Completion is an import of reference to a static method. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the method that is imported - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags of the method that is imported - * </li> - * <li>{@link #getName()} - - * the simple name of the method that is imported - * </li> - * <li>{@link #getSignature()} - - * the method signature of the method that is imported - * </li> - * <li>{@link #getAdditionalFlags()} - - * the completion flags (including ComletionFlags.StaticImport) - * of the proposed import - * </li> - * </ul> - * </p> - * - * @see #getKind() - * - * @since 3.3 - - - - - - - * Completion is an import of reference to a type. - * Only reference to reference types are allowed. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the dot-based package name of the package that contains - * the type that is imported - * </li> - * <li>{@link #getSignature()} - - * the type signature of the type that is imported - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags (including Flags.AccInterface, AccEnum, - * and AccAnnotation) of the type that is imported - * </li> - * <li>{@link #getAdditionalFlags()} - - * the completion flags (including ComletionFlags.StaticImport) - * of the proposed import - * </li> - * </ul> - * </p> - * - * @see #getKind() - * - * @since 3.3 - - - - - - - * Completion is a reference to a method with a casted receiver. - * This kind of completion might occur in a context like - * <code>"receiver.fo^();"</code> and complete it to - * <code>""((X)receiver).foo();"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the method that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags of the method that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the method that is referenced - * </li> - * <li>{@link #getReceiverSignature()} - - * the type signature of the receiver type. It's the type of the cast expression. - * </li> - * <li>{@link #getSignature()} - - * the method signature of the method that is referenced - * </li> - * </ul> - * </p> - * - * @see #getKind() - * - * @since 3.4 - - - - - - - * Completion is a reference to a field with a casted receiver. - * This kind of completion might occur in a context like - * <code>"recevier.ref^ = 0;"</code> and complete it to - * <code>"((X)receiver).refcount = 0;"</code>. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the field that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags (including ACC_ENUM) of the field that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the field that is referenced - * </li> - * <li>{@link #getReceiverSignature()} - - * the type signature of the receiver type. It's the type of the cast expression. - * </li> - * <li>{@link #getSignature()} - - * the type signature of the field's type (as opposed to the - * signature of the type in which the referenced field - * is declared) - * </li> - * - * </ul> - * </p> - * - * @see #getKind() - * - * @since 3.4 - - - - - - - * Completion is a reference to a constructor. - * This kind of completion might occur in a context like - * <code>"new Lis"</code> and complete it to - * <code>"new List();"</code> if List is a class that is not abstract. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type that declares the constructor that is referenced - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags of the constructor that is referenced - * </li> - * <li>{@link #getName()} - - * the simple name of the constructor that is referenced - * </li> - * <li>{@link #getSignature()} - - * the method signature of the constructor that is referenced - * </li> - * </ul> - * </p> - * <p> - * This kind of proposal could require a long computation, so they are computed only if completion operation is called with a {@link IProgressMonitor} - * (e.g. {@link ICodeAssist#codeComplete(int, CompletionRequestor, IProgressMonitor)}).<br> - * This kind of proposal is always is only proposals with a {@link #TYPE_REF} required proposal, so this kind of required proposal must be allowed: - * <code>requestor.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION, TYPE_REF, true)</code>. - * </p> - * - * @see #getKind() - * @see CompletionRequestor#setAllowsRequiredProposals(int, int, boolean) - * - * @since 3.5 - - - - - - - * Completion is a reference of a constructor of an anonymous class. - * This kind of completion might occur in a context like - * <code>"new Lis^;"</code> and complete it to - * <code>"new List() {}"</code> if List is an interface or abstract class. - * <p> - * The following additional context information is available - * for this kind of completion proposal at little extra cost: - * <ul> - * <li>{@link #getDeclarationSignature()} - - * the type signature of the type being implemented or subclassed - * </li> - * <li>{@link #getDeclarationKey()} - - * the type unique key of the type being implemented or subclassed - * </li> - * <li>{@link #getSignature()} - - * the method signature of the constructor that is referenced - * </li> - * <li>{@link #getKey()} - - * the method unique key of the constructor that is referenced - * if the declaring type is not an interface - * </li> - * <li>{@link #getFlags()} - - * the modifiers flags of the constructor that is referenced - * </li> - * </ul> - * </p> - * <p> - * This kind of proposal could require a long computation, so they are computed only if completion operation is called with a {@link IProgressMonitor} - * (e.g. {@link ICodeAssist#codeComplete(int, CompletionRequestor, IProgressMonitor)})<br> - * This kind of proposal is always is only proposals with a {@link #TYPE_REF} required proposal, so this kind of required proposal must be allowed: - * <code>requestor.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION, TYPE_REF, true)</code>. - * </p> - * - * @see #getKind() - * @see CompletionRequestor#setAllowsRequiredProposals(int, int, boolean) - * - * @since 3.5 - - - - - - - * First valid completion kind. - * - * @since 3.1 - - - - - - - * Last valid completion kind. - * - * @since 3.1 - - - - - - - * Creates a basic completion proposal. All instance - * field have plausible default values unless otherwise noted. - * <p> - * Note that the constructors for this class are internal to the - * Java model implementation. Clients cannot directly create - * CompletionProposal objects. - * </p> - * - * @param kind one of the kind constants declared on this class - * @param completionOffset original offset of code completion request - * @return a new completion proposal - - - - - - - - - - * Returns the completion flags relevant in the context, or - * <code>CompletionFlags.Default</code> if none. - * <p> - * This field is available for the following kinds of - * completion proposals: - * <ul> - * <li><code>FIELD_IMPORT</code> - completion flags - * of the attribute that is referenced. Completion flags for - * this proposal kind can only include <code>CompletionFlags.StaticImport</code></li> - * <li><code>METHOD_IMPORT</code> - completion flags - * of the attribute that is referenced. Completion flags for - * this proposal kind can only include <code>CompletionFlags.StaticImport</code></li> - * <li><code>TYPE_IMPORT</code> - completion flags - * of the attribute that is referenced. Completion flags for - * this proposal kind can only include <code>CompletionFlags.StaticImport</code></li> - * </ul> - * For other kinds of completion proposals, this method returns - * <code>CompletionFlags.Default</code>. - * </p> - * - * @return the completion flags, or - * <code>CompletionFlags.Default</code> if none - * @see CompletionFlags - * - * @since 3.3 - - - - - - - - * Sets the completion flags relevant in the context. - * <p> - * If not set, defaults to none. - * </p> - * <p> - * The completion engine creates instances of this class and sets - * its properties; this method is not intended to be used by other clients. - * </p> - * - * @param additionalFlags the completion flags, or - * <code>CompletionFlags.Default</code> if none - * - * @since 3.3 - - - - - - - - * Returns the kind of completion being proposed. - * <p> - * The set of different kinds of completion proposals is - * expected to change over time. It is strongly recommended - * that clients do <b>not</b> assume that the kind is one of the - * ones they know about, and code defensively for the - * possibility of unexpected future growth. - * </p> - * - * @return the kind; one of the kind constants - * declared on this class, or possibly a kind unknown - * to the caller - - - - - - - - - - - * Returns the character index of the start of the - * subrange in the source file buffer containing the - * relevant token being completed. This - * token is either the identifier or Java language keyword - * under, or immediately preceding, the original request - * offset. If the original request offset is not within - * or immediately after an identifier or keyword, then the - * position returned is original request offset and the - * token range is empty. - * - * @return character index of token start position (inclusive) - - - - - - - - * Returns the character index of the end (exclusive) of the subrange - * in the source file buffer containing the - * relevant token. When there is no relevant token, the - * range is empty - * (<code>getEndToken() == getStartToken()</code>). - * - * @return character index of token end position (exclusive) - - - - - - - - * Sets the character indices of the subrange in the - * source file buffer containing the relevant token being - * completed. This token is either the identifier or - * Java language keyword under, or immediately preceding, - * the original request offset. If the original request - * offset is not within or immediately after an identifier - * or keyword, then the source range begins at original - * request offset and is empty. - * <p> - * If not set, defaults to empty subrange at [0,0). - * </p> - * - * @param startIndex character index of token start position (inclusive) - * @param endIndex character index of token end position (exclusive) - - - - - - - - - * Returns the proposed sequence of characters to insert into the - * source file buffer, replacing the characters at the specified - * source range. The string can be arbitrary; for example, it might - * include not only the name of a method but a set of parentheses. - * <p> - * The client must not modify the array returned. - * </p> - * - * @return the completion string - - - - - - - - - - - * Sets the proposed sequence of characters to insert into the - * source file buffer, replacing the characters at the specified - * source range. The string can be arbitrary; for example, it might - * include not only the name of a method but a set of parentheses. - * <p> - * If not set, defaults to an empty character array. - * </p> - * <p> - * The completion engine creates instances of this class and sets - * its properties; this method is not intended to be used by other clients. - * </p> - * - * @param completion the completion string - - - - - - - - - - - * Returns the character index of the start of the - * subrange in the source file buffer to be replaced - * by the completion string. If the subrange is empty - * (<code>getReplaceEnd() == getReplaceStart()</code>), - * the completion string is to be inserted at this - * index. - * <p> - * Note that while the token subrange is precisely - * specified, the replacement range is loosely - * constrained and may not bear any direct relation - * to the original request offset. For example, - * it would be possible for a type completion to - * propose inserting an import declaration at the - * top of the compilation unit; or the completion - * might include trailing parentheses and - * punctuation for a method completion. - * </p> - * - * @return replacement start position (inclusive) - - - - - - - - * Returns the character index of the end of the - * subrange in the source file buffer to be replaced - * by the completion string. If the subrange is empty - * (<code>getReplaceEnd() == getReplaceStart()</code>), - * the completion string is to be inserted at this - * index. - * - * @return replacement end position (exclusive) - - - - - - - - * Sets the character indices of the subrange in the - * source file buffer to be replaced by the completion - * string. If the subrange is empty - * (<code>startIndex == endIndex</code>), - * the completion string is to be inserted at this - * index. - * <p> - * If not set, defaults to empty subrange at [0,0). - * </p> - * <p> - * The completion engine creates instances of this class and sets - * its properties; this method is not intended to be used by other clients. - * </p> - * - * @param startIndex character index of replacement start position (inclusive) - * @param endIndex character index of replacement end position (exclusive) - - - - - - - - - * Returns the relative relevance rating of this proposal. - * - * @return relevance rating of this proposal; ratings are positive; higher means better - - - - - - - - * Sets the relative relevance rating of this proposal. - * <p> - * If not set, defaults to the lowest possible rating (1). - * </p> - * <p> - * The completion engine creates instances of this class and sets - * its properties; this method is not intended to be used by other clients. - * </p> - * - * @param rating relevance rating of this proposal; ratings are positive; higher means better - - - - - - - - * Returns the type signature or package name of the relevant - * declaration in the context, or <code>null</code> if none. - * <p> - * This field is available for the following kinds of - * completion proposals: - * <ul> - * <li><code>ANNOTATION_ATTRIBUT_REF</code> - type signature - * of the annotation that declares the attribute that is referenced</li> - * <li><code>ANONYMOUS_CLASS_DECLARATION</code> - type signature - * of the type that is being subclassed or implemented</li> - * <li><code>FIELD_IMPORT</code> - type signature - * of the type that declares the field that is imported</li> - * <li><code>FIELD_REF</code> - type signature - * of the type that declares the field that is referenced</li> - * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code> - type signature - * of the type that declares the field that is referenced</li> - * <li><code>METHOD_IMPORT</code> - type signature - * of the type that declares the method that is imported</li> - * <li><code>METHOD_REF</code> - type signature - * of the type that declares the method that is referenced</li> - * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code> - type signature - * of the type that declares the method that is referenced</li> - * <li><code>METHOD_DECLARATION</code> - type signature - * of the type that declares the method that is being - * implemented or overridden</li> - * <li><code>PACKAGE_REF</code> - dot-based package - * name of the package that is referenced</li> - * <li><code>TYPE_IMPORT</code> - dot-based package - * name of the package containing the type that is imported</li> - * <li><code>TYPE_REF</code> - dot-based package - * name of the package containing the type that is referenced</li> - * <li><code>POTENTIAL_METHOD_DECLARATION</code> - type signature - * of the type that declares the method that is being created</li> - * </ul> - * For kinds of completion proposals, this method returns - * <code>null</code>. Clients must not modify the array - * returned. - * </p> - * - * @return a type signature or a package name (depending - * on the kind of completion), or <code>null</code> if none - * @see Signature - - - - - - - - - - - * Returns the key of the relevant - * declaration in the context, or <code>null</code> if none. - * <p> - * This field is available for the following kinds of - * completion proposals: - * <ul> - * <li><code>ANONYMOUS_CLASS_DECLARATION</code> - key - * of the type that is being subclassed or implemented</li> - * <li><code>METHOD_DECLARATION</code> - key - * of the type that declares the method that is being - * implemented or overridden</li> - * </ul> - * For kinds of completion proposals, this method returns - * <code>null</code>. Clients must not modify the array - * returned. - * </p> - * - * @return a key, or <code>null</code> if none - * @see org.eclipse.jdt.core.dom.ASTParser#createASTs(ICompilationUnit[], String[], org.eclipse.jdt.core.dom.ASTRequestor, IProgressMonitor) - * @since 3.1 - - - - - - - - - - - * Sets the type or package signature of the relevant - * declaration in the context, or <code>null</code> if none. - * <p> - * If not set, defaults to none. - * </p> - * <p> - * The completion engine creates instances of this class and sets - * its properties; this method is not intended to be used by other clients. - * </p> - * - * @param signature the type or package signature, or - * <code>null</code> if none - - - - - - - - - - - * Sets the type or package key of the relevant - * declaration in the context, or <code>null</code> if none. - * <p> - * If not set, defaults to none. - * </p> - * <p> - * The completion engine creates instances of this class and sets - * its properties; this method is not intended to be used by other clients. - * </p> - * - * @param key the type or package key, or - * <code>null</code> if none - * @since 3.1 - - - - - - - - - - - * Returns the simple name of the method, field, - * member, or variable relevant in the context, or - * <code>null</code> if none. - * <p> - * This field is available for the following kinds of - * completion proposals: - * <ul> - * <li><code>ANNOTATION_ATTRIBUT_REF</code> - the name of the attribute</li> - * <li><code>FIELD_IMPORT</code> - the name of the field</li> - * <li><code>FIELD_REF</code> - the name of the field</li> - * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code> - the name of the field</li> - * <li><code>KEYWORD</code> - the keyword</li> - * <li><code>LABEL_REF</code> - the name of the label</li> - * <li><code>LOCAL_VARIABLE_REF</code> - the name of the local variable</li> - * <li><code>METHOD_IMPORT</code> - the name of the method</li> - * <li><code>METHOD_REF</code> - the name of the method (the type simple name for constructor)</li> - * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code> - the name of the method</li> - * <li><code>METHOD_DECLARATION</code> - the name of the method (the type simple name for constructor)</li> - * <li><code>VARIABLE_DECLARATION</code> - the name of the variable</li> - * <li><code>POTENTIAL_METHOD_DECLARATION</code> - the name of the method</li> - * </ul> - * For kinds of completion proposals, this method returns - * <code>null</code>. Clients must not modify the array - * returned. - * </p> - * - * @return the keyword, field, method, local variable, or member - * name, or <code>null</code> if none - - - - - - - - - - - * Sets the simple name of the method (type simple name for constructor), field, - * member, or variable relevant in the context, or - * <code>null</code> if none. - * <p> - * If not set, defaults to none. - * </p> - * <p> - * The completion engine creates instances of this class and sets - * its properties; this method is not intended to be used by other clients. - * </p> - * - * @param name the keyword, field, method, local variable, - * or member name, or <code>null</code> if none - - - - - - - - - - - * Returns the signature of the method or type - * relevant in the context, or <code>null</code> if none. - * <p> - * This field is available for the following kinds of - * completion proposals: - * <ul> - * <li><code>ANNOTATION_ATTRIBUT_REF</code> - the type signature - * of the referenced attribute's type</li> - * <li><code>ANONYMOUS_CLASS_DECLARATION</code> - method signature - * of the constructor that is being invoked</li> - * <li><code>FIELD_IMPORT</code> - the type signature - * of the referenced field's type</li> - * <li><code>FIELD_REF</code> - the type signature - * of the referenced field's type</li> - * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code> - the type signature - * of the referenced field's type</li> - * <li><code>LOCAL_VARIABLE_REF</code> - the type signature - * of the referenced local variable's type</li> - * <li><code>METHOD_IMPORT</code> - method signature - * of the method that is imported</li> - * <li><code>METHOD_REF</code> - method signature - * of the method that is referenced</li> - * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code> - method signature - * of the method that is referenced</li> - * <li><code>METHOD_DECLARATION</code> - method signature - * of the method that is being implemented or overridden</li> - * <li><code>TYPE_IMPORT</code> - type signature - * of the type that is imported</li> - * <li><code>TYPE_REF</code> - type signature - * of the type that is referenced</li> - * <li><code>VARIABLE_DECLARATION</code> - the type signature - * of the type of the variable being declared</li> - * <li><code>POTENTIAL_METHOD_DECLARATION</code> - method signature - * of the method that is being created</li> - * </ul> - * For kinds of completion proposals, this method returns - * <code>null</code>. Clients must not modify the array - * returned. - * </p> - * - * @return the signature, or <code>null</code> if none - * @see Signature - - - - - - - - - - - * Returns the key relevant in the context, - * or <code>null</code> if none. - * <p> - * This field is available for the following kinds of - * completion proposals: - * <ul> - * <li><code>ANONYMOUS_CLASS_DECLARATION</code> - method key - * of the constructor that is being invoked, or <code>null</code> if - * the declaring type is an interface</li> - * <li><code>METHOD_DECLARATION</code> - method key - * of the method that is being implemented or overridden</li> - * </ul> - * For kinds of completion proposals, this method returns - * <code>null</code>. Clients must not modify the array - * returned. - * </p> - * - * @return the key, or <code>null</code> if none - * @see org.eclipse.jdt.core.dom.ASTParser#createASTs(ICompilationUnit[], String[], org.eclipse.jdt.core.dom.ASTRequestor, IProgressMonitor) - * @since 3.1 - - - - - - - - - - - * Sets the signature of the method, field type, member type, - * relevant in the context, or <code>null</code> if none. - * <p> - * If not set, defaults to none. - * </p> - * <p> - * The completion engine creates instances of this class and sets - * its properties; this method is not intended to be used by other clients. - * </p> - * - * @param signature the signature, or <code>null</code> if none - - - - - - - - - - - * Sets the key of the method, field type, member type, - * relevant in the context, or <code>null</code> if none. - * <p> - * If not set, defaults to none. - * </p> - * <p> - * The completion engine creates instances of this class and sets - * its properties; this method is not intended to be used by other clients. - * </p> - * - * @param key the key, or <code>null</code> if none - * @since 3.1 - - - - - - - - - - - * Returns the modifier flags relevant in the context, or - * <code>Flags.AccDefault</code> if none. - * <p> - * This field is available for the following kinds of - * completion proposals: - * <ul> - * <li><code>ANNOTATION_ATTRIBUT_REF</code> - modifier flags - * of the attribute that is referenced; - * <li><code>ANONYMOUS_CLASS_DECLARATION</code> - modifier flags - * of the constructor that is referenced</li> - * <li><code>FIELD_IMPORT</code> - modifier flags - * of the field that is imported.</li> - * <li><code>FIELD_REF</code> - modifier flags - * of the field that is referenced; - * <code>Flags.AccEnum</code> can be used to recognize - * references to enum constants - * </li> - * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code> - modifier flags - * of the field that is referenced. - * </li> - * <li><code>KEYWORD</code> - modifier flag - * corresponding to the modifier keyword</li> - * <li><code>LOCAL_VARIABLE_REF</code> - modifier flags - * of the local variable that is referenced</li> - * <li><code>METHOD_IMPORT</code> - modifier flags - * of the method that is imported; - * </li> - * <li><code>METHOD_REF</code> - modifier flags - * of the method that is referenced; - * <code>Flags.AccAnnotation</code> can be used to recognize - * references to annotation type members - * </li> - * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code> - modifier flags - * of the method that is referenced. - * </li> - * <li><code>METHOD_DECLARATION</code> - modifier flags - * for the method that is being implemented or overridden</li> - * <li><code>TYPE_IMPORT</code> - modifier flags - * of the type that is imported; <code>Flags.AccInterface</code> - * can be used to recognize references to interfaces, - * <code>Flags.AccEnum</code> enum types, - * and <code>Flags.AccAnnotation</code> annotation types</li> - * <li><code>TYPE_REF</code> - modifier flags - * of the type that is referenced; <code>Flags.AccInterface</code> - * can be used to recognize references to interfaces, - * <code>Flags.AccEnum</code> enum types, - * and <code>Flags.AccAnnotation</code> annotation types - * </li> - * <li><code>VARIABLE_DECLARATION</code> - modifier flags - * for the variable being declared</li> - * <li><code>POTENTIAL_METHOD_DECLARATION</code> - modifier flags - * for the method that is being created</li> - * </ul> - * For other kinds of completion proposals, this method returns - * <code>Flags.AccDefault</code>. - * </p> - * - * @return the modifier flags, or - * <code>Flags.AccDefault</code> if none - * @see Flags - - - - - - - - * Sets the modifier flags relevant in the context. - * <p> - * If not set, defaults to none. - * </p> - * <p> - * The completion engine creates instances of this class and sets - * its properties; this method is not intended to be used by other clients. - * </p> - * - * @param flags the modifier flags, or - * <code>Flags.AccDefault</code> if none - - - - - - - - * Returns the required completion proposals. - * The proposal can be apply only if these required completion proposals are also applied. - * If the required proposal aren't applied the completion could create completion problems. - * - * <p> - * This field is available for the following kinds of - * completion proposals: - * <ul> - * <li><code>FIELD_REF</code> - The allowed required proposals for this kind are: - * <ul> - * <li><code>TYPE_REF</code></li> - * <li><code>TYPE_IMPORT</code></li> - * <li><code>FIELD_IMPORT</code></li> - * </ul> - * </li> - * <li><code>METHOD_REF</code> - The allowed required proposals for this kind are: - * <ul> - * <li><code>TYPE_REF</code></li> - * <li><code>TYPE_IMPORT</code></li> - * <li><code>METHOD_IMPORT</code></li> - * </ul> - * </li> - * </li> - * <li><code>TYPE_REF</code> - The allowed required proposals for this kind are: - * <ul> - * <li><code>TYPE_REF</code></li> - * </ul> - * </li> - * <li><code>CONSTRUCTOR_INVOCATION</code> - The allowed required proposals for this kind are: - * <ul> - * <li><code>TYPE_REF</code></li> - * </ul> - * </li> - * <li><code>ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION</code> - The allowed required proposals for this kind are: - * <ul> - * <li><code>TYPE_REF</code></li> - * </ul> - * </li> - * <li><code>ANONYMOUS_CLASS_DECLARATION</code> - The allowed required proposals for this kind are: - * <ul> - * <li><code>TYPE_REF</code></li> - * </ul> - * </li> - * </ul> - * </p> - * <p> - * Other kinds of required proposals will be returned in the future, therefore clients of this - * API must allow with {@link CompletionRequestor#setAllowsRequiredProposals(int, int, boolean)} - * only kinds which are in this list to avoid unexpected results in the future. - * </p> - * <p> - * A required proposal of a given kind is proposed even if {@link CompletionRequestor#isIgnored(int)} - * return <code>true</code> for that kind. - * </p> - * <p> - * A required completion proposal cannot have required completion proposals. - * </p> - * - * @return the required completion proposals, or <code>null</code> if none. - * - * @see CompletionRequestor#setAllowsRequiredProposals(int, int,boolean) - * - * @since 3.3 - - - - - - - - - - - * Sets the list of required completion proposals, or <code>null</code> if none. - * <p> - * If not set, defaults to none. - * </p> - * <p> - * The completion engine creates instances of this class and sets - * its properties; this method is not intended to be used by other clients. - * </p> - * - * @param proposals the list of required completion proposals, or - * <code>null</code> if none - * @since 3.3 - - - - - - - - - - - * Finds the method parameter names. - * This information is relevant to method reference (and - * method declaration proposals). Returns <code>null</code> - * if not available or not relevant. - * <p> - * The client must not modify the array returned. - * </p> - * <p> - * <b>Note that this is an expensive thing to compute, which may require - * parsing Java source files, etc. Use sparingly.</b> - * </p> - * - * @param monitor the progress monitor, or <code>null</code> if none - * @return the parameter names, or <code>null</code> if none - * or not available or not relevant - - - - - - - - - - - - * Sets the method parameter names. - * This information is relevant to method reference (and - * method declaration proposals). - * <p> - * The completion engine creates instances of this class and sets - * its properties; this method is not intended to be used by other clients. - * </p> - * - * @param parameterNames the parameter names, or <code>null</code> if none - - - - - - - - - - - * Returns the accessibility of the proposal. - * <p> - * This field is available for the following kinds of - * completion proposals: - * <ul> - * <li><code>TYPE_REF</code> - accessibility of the type</li> - * </ul> - * For these kinds of completion proposals, this method returns - * {@link IAccessRule#K_ACCESSIBLE} or {@link IAccessRule#K_DISCOURAGED} - * or {@link IAccessRule#K_NON_ACCESSIBLE}. - * By default this method return {@link IAccessRule#K_ACCESSIBLE}. - * </p> - * - * @see IAccessRule - * - * @return the accessibility of the proposal - * - * @since 3.1 - - - - - - - - * Returns whether this proposal is a constructor. - * <p> - * This field is available for the following kinds of - * completion proposals: - * <ul> - * <li><code>METHOD_REF</code> - return <code>true</code> - * if the referenced method is a constructor</li> - * <li><code>METHOD_DECLARATION</code> - return <code>true</code> - * if the declared method is a constructor</li> - * </ul> - * For kinds of completion proposals, this method returns - * <code>false</code>. - * </p> - * - * @return <code>true</code> if the proposal is a constructor. - * @since 3.1 - - - - - - - - * Returns the type signature or package name of the relevant - * receiver in the context, or <code>null</code> if none. - * <p> - * This field is available for the following kinds of - * completion proposals: - * <ul> - * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code> - type signature - * of the type that cast the receiver of the field that is referenced</li> - * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code> - type signature - * of the type that cast the receiver of the method that is referenced</li> - * </ul> - * For kinds of completion proposals, this method returns - * <code>null</code>. Clients must not modify the array - * returned. - * </p> - * - * @return a type signature or a package name (depending - * on the kind of completion), or <code>null</code> if none - * @see Signature - * - * @since 3.4 - - - - - - - - - - - * Returns the character index of the start of the - * subrange in the source file buffer containing the - * relevant receiver of the member being completed. This - * receiver is an expression. - * - * <p> - * This field is available for the following kinds of - * completion proposals: - * <ul> - * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code></li> - * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code></li> - * </ul> - * For kinds of completion proposals, this method returns <code>0</code>. - * </p> - * - * @return character index of receiver start position (inclusive) - * - * @since 3.4 - - - - - - - - * Returns the character index of the end (exclusive) of the subrange - * in the source file buffer containing the - * relevant receiver of the member being completed. - * - * * <p> - * This field is available for the following kinds of - * completion proposals: - * <ul> - * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code></li> - * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code></li> - * </ul> - * For kinds of completion proposals, this method returns <code>0</code>. - * </p> - * - * @return character index of receiver end position (exclusive) - * - * @since 3.4 - - - - - - - - * Sets the type or package signature of the relevant - * receiver in the context, or <code>null</code> if none. - * <p> - * If not set, defaults to none. - * </p> - * <p> - * The completion engine creates instances of this class and sets - * its properties; this method is not intended to be used by other clients. - * </p> - * - * @param signature the type or package signature, or - * <code>null</code> if none - * - * @since 3.4 - - - - - - - - - - - * Sets the character indices of the subrange in the - * source file buffer containing the relevant receiver - * of the member being completed. - * - * <p> - * If not set, defaults to empty subrange at [0,0). - * </p> - * - * @param startIndex character index of receiver start position (inclusive) - * @param endIndex character index of receiver end position (exclusive) - * - * @since 3.4 - - - - - - - - - - * Abstract base class for a completion requestor which is passed completion - * proposals as they are generated in response to a code assist request. - * <p> - * This class is intended to be subclassed by clients. - * </p> - * <p> - * The code assist engine normally invokes methods on completion - * requestor in the following sequence: - * <pre> - * requestor.beginReporting(); - * requestor.acceptContext(context); - * requestor.accept(proposal_1); - * requestor.accept(proposal_2); - * ... - * requestor.endReporting(); - * </pre> - * If, however, the engine is unable to offer completion proposals - * for whatever reason, <code>completionFailure</code> is called - * with a problem object describing why completions were unavailable. - * In this case, the sequence of calls is: - * <pre> - * requestor.beginReporting(); - * requestor.acceptContext(context); - * requestor.completionFailure(problem); - * requestor.endReporting(); - * </pre> - * In either case, the bracketing <code>beginReporting</code> - * <code>endReporting</code> calls are always made as well as - * <code>acceptContext</code> call. - * </p> - * <p> - * The class was introduced in 3.0 as a more evolvable replacement - * for the <code>ICompletionRequestor</code> interface. - * </p> - * - * @see ICodeAssist - * @since 3.0 - - - - - - * The set of CompletionProposal kinds that this requestor - * ignores; <code>0</code> means the set is empty. - * 1 << completionProposalKind - - - - - - - - - - - * The set of CompletionProposal kinds that this requestor - * allows for required proposals; <code>0</code> means the set is empty. - * 1 << completionProposalKind - - - - - - - - * Returns whether the given kind of completion proposal is ignored. - * - * @param completionProposalKind one of the kind constants declared - * on <code>CompletionProposal</code> - * @return <code>true</code> if the given kind of completion proposal - * is ignored by this requestor, and <code>false</code> if it is of - * interest - * @see #setIgnored(int, boolean) - * @see CompletionProposal#getKind() - - - - - - - - - * Sets whether the given kind of completion proposal is ignored. - * - * @param completionProposalKind one of the kind constants declared - * on <code>CompletionProposal</code> - * @param ignore <code>true</code> if the given kind of completion proposal - * is ignored by this requestor, and <code>false</code> if it is of - * interest - * @see #isIgnored(int) - * @see CompletionProposal#getKind() - - - - - - - - - * Returns whether a proposal of a given kind with a required proposal - * of the given kind is allowed. - * - * @param proposalKind one of the kind constants declared - * @param requiredProposalKind one of the kind constants declared - * on <code>CompletionProposal</code> - * @return <code>true</code> if a proposal of a given kind with a required proposal - * of the given kind is allowed by this requestor, and <code>false</code> - * if it isn't of interest. - * <p> - * By default, all kinds of required proposals aren't allowed. - * </p> - * @see #setAllowsRequiredProposals(int, int, boolean) - * @see CompletionProposal#getKind() - * @see CompletionProposal#getRequiredProposals() - * - * @since 3.3 - - - - - - - - - - * Sets whether a proposal of a given kind with a required proposal - * of the given kind is allowed. - * - * A required proposal of a given kind is proposed even if {@link #isIgnored(int)} - * return <code>true</code> for that kind. - * - * Currently only a subset of kinds support required proposals. To see what combinations - * are supported you must look at {@link CompletionProposal#getRequiredProposals()} - * documentation. - * - * @param proposalKind one of the kind constants declared - * @param requiredProposalKind one of the kind constants declared - * on <code>CompletionProposal</code> - * @param allow <code>true</code> if a proposal of a given kind with a required proposal - * of the given kind is allowed by this requestor, and <code>false</code> - * if it isn't of interest - * @see #isAllowingRequiredProposals(int, int) - * @see CompletionProposal#getKind() - * @see CompletionProposal#getRequiredProposals() - * - * @since 3.3 - - - - - - - - - - * Returns the favorite references which are used to compute some completion proposals. - * <p> - * A favorite reference is a qualified reference as it can be seen in an import statement.<br> - * e.g. <code>{"java.util.Arrays"}</code><br> - * It can be an on demand reference.<br> - * e.g. <code>{"java.util.Arrays.*"}</code> - * It can be a reference to a static method or field (as in a static import)<br> - * e.g. <code>{"java.util.Arrays.equals"}</code> - * </p> - * <p> - * Currently only on demand type references (<code>"java.util.Arrays.*"</code>), - * references to a static method or a static field are used to compute completion proposals. - * Other kind of reference could be used in the future. - * </p> - * @return favorite imports - * - * @since 3.3 - - - - - - - - - - - * Set the favorite references which will be used to compute some completion proposals. - * A favorite reference is a qualified reference as it can be seen in an import statement.<br> - * - * @param favoriteImports - * - * @see #getFavoriteReferences() - * - * @since 3.3 - - - - - - - - - - - * Pro forma notification sent before reporting a batch of - * completion proposals. - * <p> - * The default implementation of this method does nothing. - * Clients may override. - * </p> - - - - - - - * Pro forma notification sent after reporting a batch of - * completion proposals. - * <p> - * The default implementation of this method does nothing. - * Clients may override. - * </p> - - - - - - - * Notification of failure to produce any completions. - * The problem object explains what prevented completing. - * <p> - * The default implementation of this method does nothing. - * Clients may override to receive this kind of notice. - * </p> - * - * @param problem the problem object - - - - - - - - * Proposes a completion. Has no effect if the kind of proposal - * is being ignored by this requestor. Callers should consider - * checking {@link #isIgnored(int)} before avoid creating proposal - * objects that would only be ignored. - * <p> - * Similarly, implementers should check - * {@link #isIgnored(int) isIgnored(proposal.getKind())} - * and ignore proposals that have been declared as uninteresting. - * The proposal object passed is only valid for the duration of - * completion operation. - * - * @param proposal the completion proposal - * @exception IllegalArgumentException if the proposal is null - - - - - - - - * Propose the context in which the completion occurs. - * <p> - * This method is called one and only one time before any call to - * {@link #accept(CompletionProposal)}. - * The default implementation of this method does nothing. - * Clients may override. - * </p> - * @param context the completion context - * - * @since 3.1 - - - - - - - - * Returns whether this requestor requires an extended context. - * - * By default this method return <code>false</code>. - * - * @return <code>true</code> if this requestor requires an extended context. - * - * @see CompletionContext#isExtended() - * - * @since 3.4 - - - - - - - - * Sets whether this requestor requires an extended context. - * - * @param require <code>true</code> if this requestor requires an extended context. - * - * @see CompletionContext#isExtended() - * - * @since 3.4 - - - - - - - - - - - - - * Adapter of the requestor interface <code>ICompletionRequestor</code>. - * <p> - * This class is intended to be instantiated and subclassed by clients. - * </p> - * - * @see ICompletionRequestor - * @since 2.0 - * @deprecated Subclass {@link CompletionRequestor} instead. - - - - - - - * This class is the entry point for source corrections. - * - * This class is intended to be instantiated by clients. - * - * @since 2.0 - * @noextend This class is not intended to be subclassed by clients. - - - - - - * This field is not intended to be used by client. - - - - - - - * This field is not intended to be used by client. - - - - - - - * This field is not intended to be used by client. - - - - - - - - * An element changed event describes a change to the structure or contents - * of a tree of Java elements. The changes to the elements are described by - * the associated delta object carried by this event. - * <p> - * This class is not intended to be instantiated or subclassed by clients. - * Instances of this class are automatically created by the Java model. - * </p> - * - * @see IElementChangedListener - * @see IJavaElementDelta - * @noinstantiate This class is not intended to be instantiated by clients. - * @noextend This class is not intended to be subclassed by clients. - - - - - - - * Event type constant (bit mask) indicating an after-the-fact - * report of creations, deletions, and modifications - * to one or more Java element(s) expressed as a hierarchical - * java element delta as returned by <code>getDelta()</code>. - * - * Note: this notification occurs during the corresponding POST_CHANGE - * resource change notification, and contains a full delta accounting for - * any JavaModel operation and/or resource change. - * - * @see IJavaElementDelta - * @see org.eclipse.core.resources.IResourceChangeEvent - * @see #getDelta() - * @since 2.0 - - - - - - - * Event type constant (bit mask) indicating an after-the-fact - * report of creations, deletions, and modifications - * to one or more Java element(s) expressed as a hierarchical - * java element delta as returned by <code>getDelta</code>. - * - * Note: this notification occurs during the corresponding PRE_AUTO_BUILD - * resource change notification. The delta, which is notified here, only contains - * information relative to the previous JavaModel operations (in other words, - * it ignores the possible resources which have changed outside Java operations). - * In particular, it is possible that the JavaModel be inconsistent with respect to - * resources, which got modified outside JavaModel operations (it will only be - * fully consistent once the POST_CHANGE notification has occurred). - * - * @see IJavaElementDelta - * @see org.eclipse.core.resources.IResourceChangeEvent - * @see #getDelta() - * @since 2.0 - * @deprecated - no longer used, such deltas are now notified during POST_CHANGE - - - - - - - * Event type constant (bit mask) indicating an after-the-fact - * report of creations, deletions, and modifications - * to one or more Java element(s) expressed as a hierarchical - * java element delta as returned by <code>getDelta</code>. - * - * Note: this notification occurs as a result of a working copy reconcile - * operation. - * - * @see IJavaElementDelta - * @see org.eclipse.core.resources.IResourceChangeEvent - * @see #getDelta() - * @since 2.0 - - - - - - - - - * Returns the delta describing the change. - * - * @return the delta describing the change - - - - - - - - * Utility class for decoding modifier flags in Java elements. - * <p> - * This class provides static methods only. - * </p> - * <p> - * Note that the numeric values of these flags match the ones for class files - * as described in the Java Virtual Machine Specification. The AST class - * <code>Modifier</code> provides the same functionality as this class, only in - * the <code>org.eclipse.jdt.core.dom</code> package. - * </p> - * - * @see IMember#getFlags() - * @noinstantiate This class is not intended to be instantiated by clients. - - - - - - * Constant representing the absence of any flag - * @since 3.0 - - - - - - - * Public access flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Private access flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Protected access flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Static access flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Final access flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Synchronized access flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Volatile property flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Transient property flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Native property flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Interface property flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Abstract property flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Strictfp property flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Super property flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Synthetic property flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Deprecated property flag. See The Java Virtual Machine Specification for more details. - * @since 2.0 - - - - - - - * Bridge method property flag (added in J2SE 1.5). Used to flag a compiler-generated - * bridge methods. - * See The Java Virtual Machine Specification for more details. - * @since 3.0 - - - - - - - * Varargs method property flag (added in J2SE 1.5). - * Used to flag variable arity method declarations. - * See The Java Virtual Machine Specification for more details. - * @since 3.0 - - - - - - - * Enum property flag (added in J2SE 1.5). - * See The Java Virtual Machine Specification for more details. - * @since 3.0 - - - - - - - * Annotation property flag (added in J2SE 1.5). - * See The Java Virtual Machine Specification for more details. - * @since 3.0 - - - - - - - * Returns whether the given integer includes the <code>abstract</code> modifier. - * - * @param flags the flags - * @return <code>true</code> if the <code>abstract</code> modifier is included - - - - - - - - - * Returns whether the given integer includes the indication that the - * element is deprecated (<code>@deprecated</code> tag in Javadoc comment). - * - * @param flags the flags - * @return <code>true</code> if the element is marked as deprecated - - - - - - - - - * Returns whether the given integer includes the <code>final</code> modifier. - * - * @param flags the flags - * @return <code>true</code> if the <code>final</code> modifier is included - - - - - - - - - * Returns whether the given integer includes the <code>interface</code> modifier. - * - * @param flags the flags - * @return <code>true</code> if the <code>interface</code> modifier is included - * @since 2.0 - - - - - - - - - * Returns whether the given integer includes the <code>native</code> modifier. - * - * @param flags the flags - * @return <code>true</code> if the <code>native</code> modifier is included - - - - - - - - - * Returns whether the given integer does not include one of the - * <code>public</code>, <code>private</code>, or <code>protected</code> flags. - * - * @param flags the flags - * @return <code>true</code> if no visibility flag is set - * @since 3.2 - - - - - - - - - * Returns whether the given integer includes the <code>private</code> modifier. - * - * @param flags the flags - * @return <code>true</code> if the <code>private</code> modifier is included - - - - - - - - - * Returns whether the given integer includes the <code>protected</code> modifier. - * - * @param flags the flags - * @return <code>true</code> if the <code>protected</code> modifier is included - - - - - - - - - * Returns whether the given integer includes the <code>public</code> modifier. - * - * @param flags the flags - * @return <code>true</code> if the <code>public</code> modifier is included - - - - - - - - - * Returns whether the given integer includes the <code>static</code> modifier. - * - * @param flags the flags - * @return <code>true</code> if the <code>static</code> modifier is included - - - - - - - - - * Returns whether the given integer includes the <code>super</code> modifier. - * - * @param flags the flags - * @return <code>true</code> if the <code>super</code> modifier is included - * @since 3.2 - - - - - - - - - * Returns whether the given integer includes the <code>strictfp</code> modifier. - * - * @param flags the flags - * @return <code>true</code> if the <code>strictfp</code> modifier is included - - - - - - - - - * Returns whether the given integer includes the <code>synchronized</code> modifier. - * - * @param flags the flags - * @return <code>true</code> if the <code>synchronized</code> modifier is included - - - - - - - - - * Returns whether the given integer includes the indication that the - * element is synthetic. - * - * @param flags the flags - * @return <code>true</code> if the element is marked synthetic - - - - - - - - - * Returns whether the given integer includes the <code>transient</code> modifier. - * - * @param flags the flags - * @return <code>true</code> if the <code>transient</code> modifier is included - - - - - - - - - * Returns whether the given integer includes the <code>volatile</code> modifier. - * - * @param flags the flags - * @return <code>true</code> if the <code>volatile</code> modifier is included - - - - - - - - - * Returns whether the given integer has the <code>AccBridge</code> - * bit set. - * - * @param flags the flags - * @return <code>true</code> if the <code>AccBridge</code> flag is included - * @see #AccBridge - * @since 3.0 - - - - - - - - - * Returns whether the given integer has the <code>AccVarargs</code> - * bit set. - * - * @param flags the flags - * @return <code>true</code> if the <code>AccVarargs</code> flag is included - * @see #AccVarargs - * @since 3.0 - - - - - - - - - * Returns whether the given integer has the <code>AccEnum</code> - * bit set. - * - * @param flags the flags - * @return <code>true</code> if the <code>AccEnum</code> flag is included - * @see #AccEnum - * @since 3.0 - - - - - - - - - * Returns whether the given integer has the <code>AccAnnotation</code> - * bit set. - * - * @param flags the flags - * @return <code>true</code> if the <code>AccAnnotation</code> flag is included - * @see #AccAnnotation - * @since 3.0 - - - - - - - - - * Returns a standard string describing the given modifier flags. - * Only modifier flags are included in the output; deprecated, - * synthetic, bridge, etc. flags are ignored. - * <p> - * The flags are output in the following order: - * <pre> - * <code>public</code> <code>protected</code> <code>private</code> - * <code>static</code> - * <code>abstract</code> <code>final</code> <code>native</code> <code>synchronized</code> <code>transient</code> <code>volatile</code> <code>strictfp</code> - * </pre> - * This is a compromise between the orders specified in sections 8.1.1, - * 8.3.1, 8.4.3, 8.8.3, 9.1.1, and 9.3 of <em>The Java Language - * Specification, Second Edition</em> (JLS2). - * </p> - * <p> - * Note that the flags of a method can include the AccVarargs flag that has no standard description. Since the AccVarargs flag has the same value as - * the AccTransient flag (valid for fields only), attempting to get the description of method modifiers with the AccVarargs flag set would result in an - * unexpected description. Clients should ensure that the AccVarargs is not included in the flags of a method as follows: - * <pre> - * IMethod method = ... - * int flags = method.getFlags() & ~Flags.AccVarargs; - * return Flags.toString(flags); - * </pre> - * </p> - * <p> - * Examples results: - * <pre> - * <code>"public static final"</code> - * <code>"private native"</code> - * </pre> - * </p> - * - * @param flags the flags - * @return the standard string representation of the given flags - - - - - - - - - - * Describes an access rule to source and class files on a classpath entry. - * An access rule is composed of a file pattern and a kind (accessible, - * non accessible, or discouraged). - * <p> - * On a given classpath entry, the access rules are considered in the order given - * when the entry was created. When a source or class file matches an access - * rule's pattern, the access rule's kind define whether the file is considered - * accessible, non accessible, or its access is discouraged. If the source or class - * file doesn't match any accessible rule, it is considered accessible. A source or class - * file that is not accessible or discouraged can still be refered to but it is tagged as being not - * accessible - the Java builder will create a problem marker for example. - * The severity of the marker created from a non accessible rule is controled through - * the {@link JavaCore#COMPILER_PB_FORBIDDEN_REFERENCE} compiler option. - * The severity of the marker created from a discouraged rule is controled through - * the {@link JavaCore#COMPILER_PB_DISCOURAGED_REFERENCE} compiler option. - * Note this is different from inclusion and exclusion patterns on source classpath entries, - * where a source file that is excluded is not even compiled. - * Files patterns look like relative file paths with wildcards and are interpreted relative - * to each entry's path. - * File patterns are case-sensitive and they can contain '**', '*' or '?' wildcards (see - * {@link IClasspathEntry#getExclusionPatterns()} for the full description - * of their syntax and semantics). - * Note that file patterns must not include the file extension. - * <code>com/xyz/tests/MyClass</code> is a valid file pattern, whereas - * <code>com/xyz/tests/MyClass.class</code> is not valid. - * </p> - * <p> - * For example, if one of the entry path is <code>/Project/someLib.jar</code>, - * there are no accessible rules, and there is one non accessible rule whith pattern - * <code>com/xyz/tests/&#42;&#42;</code>, then class files - * like <code>/Project/someLib.jar/com/xyz/Foo.class</code> - * and <code>/Project/someLib.jar/com/xyz/utils/Bar.class</code> would be accessible, - * whereas <code>/Project/someLib.jar/com/xyz/tests/T1.class</code> - * and <code>/Project/someLib.jar/com/xyz/tests/quick/T2.class</code> would not be - * accessible. - * </p> - * <p> - * This interface is not intended to be implemented by clients. - * </p> - * - * @since 3.1 - - - - - - * Constant indicating that files matching the rule's pattern are accessible. - - - - - - - * Constant indicating that files matching the rule's pattern are non accessible. - - - - - - - * Constant indicating that access to the files matching the rule's pattern is discouraged. - - - - - - - * <p>Flag indicating that whether a type matching this rule should be ignored iff a type with - * the same qualified name can be found on a later classpath entry with a better - * accessibility.</p> - * <p>E.g. if a type p.X matches a rule K_NON_ACCESSIBLE | IGNORE_IF_BETTER - * on a library entry 'lib1' and another type p.X also matches a rule - * K_DISCOURAGED on library entry 'lib2' ('lib2' being after 'lib1' on the - * classpath), then p.X from 'lib2' will be used and reported as - * discouraged.</p> - * - * @since 3.2 - - - - - - - * Returns the file pattern for this access rule. - * - * @return the file pattern for this access rule - - - - - - - - * Returns the kind of this access rule (one of {@link #K_ACCESSIBLE}, {@link #K_NON_ACCESSIBLE} - * or {@link #K_DISCOURAGED}). - * - * @return the kind of this access rule - - - - - - - - * <p>Returns whether a type matching this rule should be ignored iff a type with - * the same qualified name can be found on a later classpath entry with a better - * accessibility.</p> - * <p>E.g. if a type p.X matches a rule K_NON_ACCESSIBLE | IGNORE_IF_BETTER - * on a library entry 'lib1' and another type p.X also matches a rule - * K_DISCOURAGED on library entry 'lib2' ('lib2' being after 'lib1' on the - * classpath), then p.X from 'lib2' will be used and reported as - * discouraged.</p> - * - * @return whether a type matching this rule should be ignored iff a type - * with the same qualified name can be found on a later classpath - * entry with a better accessibility - * @since 3.2 - - - - - - - - - * Common protocol for Java elements that can be annotated. - * <p> - * This interface is not intended to be implemented by clients. - * </p> - * - * @since 3.4 - - - - - - * Returns the annotation with the given name declared on this element. - * This is a handle-only method. The annotation may or may not exist. - * - * @param name the given simple name - * @return the annotation with the given name declared on this element - - - - - - - - * Represents an annotation on a package declaration, a type, a method, a field - * or a local variable in a compilation unit or a class file. - * <p> - * Annotations are obtained using {@link IAnnotatable#getAnnotation(String)}. - * </p><p> - * Note that annotations are not children of their declaring element. - * To get a list of the annotations use {@link IAnnotatable#getAnnotations()}. - * </p> - * <p> - * This interface is not intended to be implemented or extended by clients. - * </p> - * - * @since 3.4 - - - - - - - * A buffer contains the text contents of a resource. It is not language-specific. - * The contents may be in the process of being edited, differing from the actual contents of the - * underlying resource. A buffer has an owner, which is an <code>IOpenable</code>. - * If a buffer does not have an underlying resource, saving the buffer has no effect. - * Buffers can be read-only. - * <p> - * Note that java model operations that manipulate an <code>IBuffer</code> (for example, - * <code>IType.createMethod(...)</code>) ensures that the same line delimiter - * (either <code>"\n"</code> or <code>"\r"</code> or <code>"\r\n"</code>) is - * used across the whole buffer. Thus these operations may change the line delimiter(s) - * included in the string to be append, or replaced. - * However implementers of this interface should be aware that other clients of <code>IBuffer</code> - * might not do such transformations beforehand. - * <p> - * This interface may be implemented by clients. - * </p> - - - - - - * Implementors of {@link IBuffer} can additionally implement {@link IBuffer.ITextEditCapability}. - * This adds the capability to apply text edits to the buffer and will be used by - * {@link ICompilationUnit#applyTextEdit(TextEdit, IProgressMonitor)}. - * - * <p> - * This interface may be implemented by clients. - * </p> - * @since 3.4 - - - - - - * Applies a text edit to this underlying buffer. - * - * @param edit the edit to apply - * @param monitor the progress monitor to use or <code>null</code> if no progress should be reported - * @return the undo edit - * @throws JavaModelException if this edit can not be applied to the buffer. Reasons include: - * <ul> - * <li>The provided edit can not be applied as there is a problem with the text edit locations ({@link IJavaModelStatusConstants#BAD_TEXT_EDIT_LOCATION})}.</li> - * </ul> - - - - - - - - - - - - * A listener, which gets notified when the contents of a specific buffer - * have changed, or when the buffer is closed. - * When a buffer is closed, the listener is notified <em>after</em> the buffer has been closed. - * A listener is not notified when a buffer is saved. - * <p> - * This interface may be implemented by clients. - * </p> - - - - - - * Notifies that the given event has occurred. - * - * @param event the change event - - - - - - - - - * A factory that creates <code>IBuffer</code>s for openables. - * <p> - * This interface may be implemented by clients. - * </p> - * @since 2.0 - * @deprecated Use {@link WorkingCopyOwner} instead - - - - - - - * Represents an entire binary type (single <code>.class</code> file). - * A class file has a single child of type <code>IType</code>. - * Class file elements need to be opened before they can be navigated. - * If a class file cannot be parsed, its structure remains unknown. Use - * <code>IJavaElement.isStructureKnown</code> to determine whether this is the - * case. - * <p> - * Note: <code>IClassFile</code> extends <code>ISourceReference</code>. - * Source can be obtained for a class file if and only if source has been attached to this - * class file. The source associated with a class file is the source code of - * the compilation unit it was (nominally) generated from. - * </p> - * - * @see IPackageFragmentRoot#attachSource(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, IProgressMonitor) - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - * Changes this class file handle into a working copy. A new {@link IBuffer} is - * created using the given owner. Uses the primary owner if <code>null</code> is - * specified. - * <p> - * When switching to working copy mode, problems are reported to the given - * {@link IProblemRequestor}. Note that once in working copy mode, the given - * {@link IProblemRequestor} is ignored. Only the original {@link IProblemRequestor} - * is used to report subsequent problems. - * </p> - * <p> - * Once in working copy mode, changes to this working copy or its children are done in memory. - * Only the new buffer is affected. - * </p> - * <p> - * Using {@link ICompilationUnit#commitWorkingCopy(boolean, IProgressMonitor)} on the working copy - * will throw a <code>JavaModelException</code> as a class file is implicetly read-only. - * </p> - * <p> - * If this class file was already in working copy mode, an internal counter is incremented and no - * other action is taken on this working copy. To bring this working copy back into the original mode - * (where it reflects the underlying resource), {@link ICompilationUnit#discardWorkingCopy} must be call as many - * times as {@link #becomeWorkingCopy(IProblemRequestor, WorkingCopyOwner, IProgressMonitor)}. - * </p> - * <p> - * The primary compilation unit of a class file's working copy does not exist if the class file is not - * in working copy mode (<code>classFileWorkingCopy.getPrimary().exists() == false</code>). - * </p> - * <p> - * The resource of a class file's working copy is <code>null</code> if the class file is in an external jar file. - * </p> - * - * @param problemRequestor a requestor which will get notified of problems detected during - * reconciling as they are discovered. The requestor can be set to <code>null</code> indicating - * that the client is not interested in problems. - * @param owner the given {@link WorkingCopyOwner}, or <code>null</code> for the primary owner - * @param monitor a progress monitor used to report progress while opening this compilation unit - * or <code>null</code> if no progress should be reported - * @return a working copy for this class file - * @throws JavaModelException if this compilation unit could not become a working copy. - * @see ICompilationUnit#discardWorkingCopy() - * @since 3.2 - * @deprecated Use {@link ITypeRoot#getWorkingCopy(WorkingCopyOwner, IProgressMonitor)} instead. - * Note that if this deprecated method is used, problems will be reported to the given problem requestor - * as well as the problem requestor returned by the working copy owner (if not null). - - - - - - - - - - - * Returns the bytes contained in this class file. - * - * @return the bytes contained in this class file - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - * @since 3.3 - - - - - - - - - - - * Returns the type contained in this class file. - * This is a handle-only method. The type may or may not exist. - * - * @return the type contained in this class file - - - - - - - - * Returns a working copy on the source associated with this class file using the given - * factory to create the buffer, or <code>null</code> if there is no source associated - * with the class file. - * <p> - * The buffer will be automatically initialized with the source of the class file - * upon creation. - * <p> - * The only valid operations on this working copy are <code>getBuffer()</code> or <code>getOriginalElement</code>. - * - * @param monitor a progress monitor used to report progress while opening this compilation unit - * or <code>null</code> if no progress should be reported - * @param factory the factory that creates a buffer that is used to get the content of the working copy - * or <code>null</code> if the internal factory should be used - * @return a a working copy on the source associated with this class file - * @exception JavaModelException if the source of this class file can - * not be determined. Reasons include: - * <ul> - * <li> This class file does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * </ul> - * @since 2.0 - * @deprecated Use {@link ITypeRoot#getWorkingCopy(WorkingCopyOwner, IProgressMonitor)} instead - - - - - - - - - - * Returns whether this type represents a class. This is not guaranteed to be - * instantaneous, as it may require parsing the underlying file. - * - * @return <code>true</code> if the class file represents a class. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - * Returns whether this type represents an interface. This is not guaranteed to - * be instantaneous, as it may require parsing the underlying file. - * - * @return <code>true</code> if the class file represents an interface. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - - * A classpath attribute defines a name/value pair that can be persisted with a classpath entry. Such an attribute - * can be created using the factory method {@link JavaCore#newClasspathAttribute(String, String) newClasspathAttribute(String name, String value)}. - * - * @see JavaCore#newContainerEntry( - * org.eclipse.core.runtime.IPath containerPath, - * IAccessRule[] accessRules, - * IClasspathAttribute[] extraAttributes, - * boolean isExported) - * @see JavaCore#newLibraryEntry( - * org.eclipse.core.runtime.IPath path, - * org.eclipse.core.runtime.IPath sourceAttachmentPath, - * org.eclipse.core.runtime.IPath sourceAttachmentRootPath, - * IAccessRule[] accessRules, - * IClasspathAttribute[] extraAttributes, - * boolean isExported) - * @see JavaCore#newProjectEntry( - * org.eclipse.core.runtime.IPath path, - * IAccessRule[] accessRules, - * boolean combineAccessRestrictions, - * IClasspathAttribute[] extraAttributes, - * boolean isExported) - * @see JavaCore#newSourceEntry( - * org.eclipse.core.runtime.IPath path, - * org.eclipse.core.runtime.IPath[] inclusionPatterns, - * org.eclipse.core.runtime.IPath[] exclusionPatterns, - * org.eclipse.core.runtime.IPath specificOutputLocation, - * IClasspathAttribute[] extraAttributes) - * @see JavaCore#newVariableEntry( - * org.eclipse.core.runtime.IPath variablePath, - * org.eclipse.core.runtime.IPath variableSourceAttachmentPath, - * org.eclipse.core.runtime.IPath variableSourceAttachmentRootPath, - * IAccessRule[] accessRules, - * IClasspathAttribute[] extraAttributes, - * boolean isExported) - * @since 3.1 - * @noimplement This interface is not intended to be implemented by clients. - - - - - - * Constant for the name of the javadoc location attribute. - * - * <p>The value for this attribute has to be the string representation of a URL.</p> - * - * @since 3.1 - - - - - - - * Constant for the name of the optional attribute. The possible values - * for this attribute are <code>"true"</code> or <code>"false"</code>. - * When not present, <code>"false"</code> is assumed. - * If the value of this attribute is <code>"true"</code>, the classpath entry - * is optional. If the underlying resource or jar file doesn't exist, no error - * is reported and the classpath entry is ignored. - * - * @since 3.2 - - - - - - - * Returns the name of this classpath attribute. - * - * @return the name of this classpath attribute. - * @since 3.1 - - - - - - - - * Returns the value of this classpath attribute. - * - * @return the value of this classpath attribute. - * @since 3.1 - - - - - - - - - * Interface of a classpath container. - * A classpath container provides a way to indirectly reference a set of classpath entries through - * a classpath entry of kind <code>CPE_CONTAINER</code>. Typically, a classpath container can - * be used to describe a complex library composed of multiple JARs or projects, considering also - * that containers can map to different set of entries on each project, in other words, several - * projects can reference the same generic container path, but have each of them actually bound - * to a different container object. - * <p> - * The set of entries associated with a classpath container may contain any of the following: - * <ul> - * <li> library entries (<code>CPE_LIBRARY</code>) </li> - * <li> project entries (<code>CPE_PROJECT</code>) </li> - * </ul> - * In particular, a classpath container can neither reference further classpath containers or classpath variables. - * <p> - * A library entry can reference other libraries through the Class-Path section of the JAR's MANIFEST.MF file. If the - * container wants such referenced entries to be part of the classpath, the container must explicitly add them to the - * array returned from {@link #getClasspathEntries()}. - * <p> - * Classpath container values are persisted locally to the workspace, but are not preserved from a - * session to another. It is thus highly recommended to register a <code>ClasspathContainerInitializer</code> - * for each referenced container (through the extension point "org.eclipse.jdt.core.ClasspathContainerInitializer"). - * <p> - * @see IClasspathEntry - * @since 2.0 - - - - - - * Kind for a container mapping to an application library - - - - - - - * Kind for a container mapping to a system library - - - - - - - * Kind for a container mapping to a default system library, implicitly contributed by the runtime - - - - - - - * Answers the set of classpath entries this container is mapping to. - * <p> - * The set of entries associated with a classpath container may contain any of the following: - * <ul> - * <li> library entries (<code>CPE_LIBRARY</code>) </li> - * <li> project entries (<code>CPE_PROJECT</code>) </li> - * </ul> - * A classpath container can neither reference further classpath containers - * or classpath variables. - * <p> - * A library entry can reference other libraries through the Class-Path section of the JAR's MANIFEST.MF file. If - * the container wants such referenced entries to be part of the classpath, the container must explicitly add them - * to the result. - * <p> - * This method is called by the Java model when it needs to resolve this - * classpath container entry into a list of library and project entries. - * The method is typically called exactly once for a given Java project, - * and the resulting list of entries cached internally by the Java model. - * This method must not be called by other clients. - * <p> - * There are a wide variety of conditions under which this method may be - * invoked. To ensure that the implementation does not interfere with - * correct functioning of the Java model, the implementation should use - * only the following Java model APIs: - * <ul> - * <li>{@link JavaCore#newLibraryEntry(IPath, IPath, IPath, boolean)} and variants</li> - * <li>{@link JavaCore#newProjectEntry(IPath, boolean)} and variants</li> - * <li>{@link JavaCore#create(org.eclipse.core.resources.IWorkspaceRoot)}</li> - * <li>{@link JavaCore#create(org.eclipse.core.resources.IProject)}</li> - * <li>{@link JavaCore#getReferencedClasspathEntries(IClasspathEntry, IJavaProject)} with <code>null</code> as project</li> - * <li>{@link IJavaModel#getJavaProjects()}</li> - * <li>{@link IJavaProject#getRawClasspath()}</li> - * <li>{@link IJavaProject#readRawClasspath()}</li> - * <li>{@link IJavaProject#getOutputLocation()}</li> - * <li>{@link IJavaProject#readOutputLocation()}</li> - * <li>Java element operations marked as "handle-only"</li> - * </ul> - * The effects of using other Java model APIs are unspecified. - * </p> - * - * @return IClasspathEntry[] - the classpath entries this container represents - * @see IClasspathEntry - - - - - - - - * An entry on a Java project classpath identifying one or more package fragment - * roots. A classpath entry has a content kind (either source, - * {@link IPackageFragmentRoot#K_SOURCE}, or binary, {@link IPackageFragmentRoot#K_BINARY}), which is inherited - * by each package fragment root and package fragment associated with the entry. - * <p> - * A classpath entry can refer to any of the following:<ul> - * - * <li>Source code in the current project. In this case, the entry identifies a - * root folder in the current project containing package fragments and - * source files with one of the {@link JavaCore#getJavaLikeExtensions() - * Java-like extensions}. The root folder itself represents a default - * package, subfolders represent package fragments, and files with a - * Java-like extension (e.g. <code>.java</code> files) - * represent compilation units. All compilation units will be compiled when - * the project is built. The classpath entry must specify the - * absolute path to the root folder. Entries of this kind are - * associated with the {@link #CPE_SOURCE} constant. - * Source classpath entries can carry inclusion and exclusion patterns for - * selecting which source files appear as compilation - * units and get compiled when the project is built. - * </li> - * - * <li>A binary library in the current project, in another project, or in the external - * file system. In this case the entry identifies a JAR (or root folder) containing - * package fragments and <code>.class</code> files. The classpath entry - * must specify the absolute path to the JAR (or root folder), and in case it refers - * to an external JAR, then there is no associated resource in the workbench. Entries - * of this kind are associated with the {@link #CPE_LIBRARY} constant.</li> - * - * <li>A required project. In this case the entry identifies another project in - * the workspace. The required project is used as a binary library when compiling - * (that is, the builder looks in the output location of the required project - * for required <code>.class</code> files when building). When performing other - * "development" operations - such as code assist, code resolve, type hierarchy - * creation, etc. - the source code of the project is referred to. Thus, development - * is performed against a required project's source code, and compilation is - * performed against a required project's last built state. The - * classpath entry must specify the absolute path to the - * project. Entries of this kind are associated with the {@link #CPE_PROJECT} - * constant. - * Note: referencing a required project with a classpath entry refers to the source - * code or associated <code>.class</code> files located in its output location. - * It will also automatically include any other libraries or projects that the required project's classpath - * refers to, iff the corresponding classpath entries are tagged as being exported - * ({@link IClasspathEntry#isExported}). - * Unless exporting some classpath entries, classpaths are not chained by default - - * each project must specify its own classpath in its entirety.</li> - * - * <li> A path beginning in a classpath variable defined globally to the workspace. - * Entries of this kind are associated with the {@link #CPE_VARIABLE} constant. - * Classpath variables are created using {@link JavaCore#setClasspathVariable(String, IPath, org.eclipse.core.runtime.IProgressMonitor)}, - * and gets resolved, to either a project or library entry, using - * {@link JavaCore#getResolvedClasspathEntry(IClasspathEntry)}. - * It is also possible to register an automatic initializer ({@link ClasspathVariableInitializer}), - * which will be invoked through the extension point "org.eclipse.jdt.core.classpathVariableInitializer". - * After resolution, a classpath variable entry may either correspond to a project or a library entry. </li> - * - * <li> A named classpath container identified by its container path. - * A classpath container provides a way to indirectly reference a set of classpath entries through - * a classpath entry of kind {@link #CPE_CONTAINER}. Typically, a classpath container can - * be used to describe a complex library composed of multiple JARs, projects or classpath variables, - * considering also that containers can be mapped differently on each project. Several projects can - * reference the same generic container path, but have each of them actually bound to a different - * container object. - * The container path is a formed by a first ID segment followed with extra segments, - * which can be used as additional hints for resolving this container reference. If no container was ever - * recorded for this container path onto this project (using {@link JavaCore#setClasspathContainer}, - * then a {@link ClasspathContainerInitializer} will be activated if any was registered for this - * container ID onto the extension point "org.eclipse.jdt.core.classpathContainerInitializer". - * A classpath container entry can be resolved explicitly using {@link JavaCore#getClasspathContainer} - * and the resulting container entries can contain any non-container entry. In particular, it may contain variable - * entries, which in turn needs to be resolved before being directly used. - * <br> Also note that the container resolution APIs include an IJavaProject argument, so as to allow the same - * container path to be interpreted in different ways for different projects. </li> - * </ul> - * </p> - * The result of {@link IJavaProject#getResolvedClasspath} will have all entries of type - * {@link #CPE_VARIABLE} and {@link #CPE_CONTAINER} resolved to a set of - * {@link #CPE_SOURCE}, {@link #CPE_LIBRARY} or {@link #CPE_PROJECT} - * classpath entries. - * <p> - * Any classpath entry other than a source folder (kind {@link #CPE_SOURCE}) can - * be marked as being exported. Exported entries are automatically contributed to - * dependent projects, along with the project's default output folder, which is - * implicitly exported, and any auxiliary output folders specified on source - * classpath entries. The project's output folder(s) are always listed first, - * followed by the any exported entries. - * <p> - * Classpath entries can be created via methods on {@link JavaCore}. - * </p> - * - * @see JavaCore#newLibraryEntry(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath) - * @see JavaCore#newProjectEntry(org.eclipse.core.runtime.IPath) - * @see JavaCore#newSourceEntry(org.eclipse.core.runtime.IPath) - * @see JavaCore#newVariableEntry(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath) - * @see JavaCore#newContainerEntry(org.eclipse.core.runtime.IPath) - * @see ClasspathVariableInitializer - * @see ClasspathContainerInitializer - * @noimplement This interface is not intended to be implemented by clients. - - - - - - * Entry kind constant describing a classpath entry identifying a - * library. A library is a folder or JAR containing package - * fragments consisting of pre-compiled binaries. - - - - - - - * Entry kind constant describing a classpath entry identifying a - * required project. - - - - - - - * Entry kind constant describing a classpath entry identifying a - * folder containing package fragments with source code - * to be compiled. - - - - - - - * Entry kind constant describing a classpath entry defined using - * a path that begins with a classpath variable reference. - - - - - - - * Entry kind constant describing a classpath entry representing - * a name classpath container. - * - * @since 2.0 - - - - - - - * Returns whether the access rules of the project's exported entries should be combined with this entry's access rules. - * Returns true for container entries. - * Returns false otherwise. - * - * @return whether the access rules of the project's exported entries should be combined with this entry's access rules - * @since 3.1 - - - - - - - - * Returns the possibly empty list of access rules for this entry. - * - * @return the possibly empty list of access rules for this entry - * @since 3.1 - - - - - - - - - - - * Returns the kind of files found in the package fragments identified by this - * classpath entry. - * - * @return {@link IPackageFragmentRoot#K_SOURCE} for files containing - * source code, and {@link IPackageFragmentRoot#K_BINARY} for binary - * class files. - * There is no specified value for an entry denoting a variable ({@link #CPE_VARIABLE}) - * or a classpath container ({@link #CPE_CONTAINER}). - - - - - - - - * Returns the kind of this classpath entry. - * - * @return one of: - * <ul> - * <li>{@link #CPE_SOURCE} - this entry describes a source root in - its project - * <li>{@link #CPE_LIBRARY} - this entry describes a folder or JAR - containing binaries - * <li>{@link #CPE_PROJECT} - this entry describes another project - * - * <li>{@link #CPE_VARIABLE} - this entry describes a project or library - * indirectly via a classpath variable in the first segment of the path - * * - * <li>{@link #CPE_CONTAINER} - this entry describes set of entries - * referenced indirectly via a classpath container - * </ul> - - - - - - - - * Returns the set of patterns used to exclude resources or classes associated with - * this classpath entry. - * <p> - * For source classpath entries, - * exclusion patterns allow specified portions of the resource tree rooted - * at this source entry's path to be filtered out. If no exclusion patterns - * are specified, this source entry includes all relevent files. Each path - * specified must be a relative path, and will be interpreted relative - * to this source entry's path. File patterns are case-sensitive. A file - * matched by one or more of these patterns is excluded from the - * corresponding package fragment root. - * Exclusion patterns have higher precedence than inclusion patterns; - * in other words, exclusion patterns can remove files for the ones that - * are to be included, not the other way around. - * </p> - * <p> - * Note that there is no need to supply a pattern to exclude ".class" files - * because a source entry filters these out automatically. - * </p> - * <p> - * The pattern mechanism is similar to Ant's. Each pattern is represented as - * a relative path. The path segments can be regular file or folder names or simple patterns - * involving standard wildcard characters. - * </p> - * <p> - * '*' matches 0 or more characters within a segment. So - * <code>*.java</code> matches <code>.java</code>, <code>a.java</code> - * and <code>Foo.java</code>, but not <code>Foo.properties</code> - * (does not end with <code>.java</code>). - * </p> - * <p> - * '?' matches 1 character within a segment. So <code>?.java</code> - * matches <code>a.java</code>, <code>A.java</code>, - * but not <code>.java</code> or <code>xyz.java</code> (neither have - * just one character before <code>.java</code>). - * </p> - * <p> - * Combinations of *'s and ?'s are allowed. - * </p> - * <p> - * The special pattern '**' matches zero or more segments. In a source entry, - * a path like <code>tests/</code> that ends in a trailing separator is interpreted - * as <code>tests/&#42;&#42;</code>, and would match everything under - * the folder named <code>tests</code>. - * </p> - * <p> - * Example patterns in source entries (assuming that "java" is the only {@link JavaCore#getJavaLikeExtensions() Java-like extension}): - * <ul> - * <li> - * <code>tests/&#42;&#42;</code> (or simply <code>tests/</code>) - * matches all files under a root folder - * named <code>tests</code>. This includes <code>tests/Foo.java</code> - * and <code>tests/com/example/Foo.java</code>, but not - * <code>com/example/tests/Foo.java</code> (not under a root folder named - * <code>tests</code>). - * </li> - * <li> - * <code>tests/&#42;</code> matches all files directly below a root - * folder named <code>tests</code>. This includes <code>tests/Foo.java</code> - * and <code>tests/FooHelp.java</code> - * but not <code>tests/com/example/Foo.java</code> (not directly under - * a folder named <code>tests</code>) or - * <code>com/Foo.java</code> (not under a folder named <code>tests</code>). - * </li> - * <li> - * <code>&#42;&#42;/tests/&#42;&#42;</code> matches all files under any - * folder named <code>tests</code>. This includes <code>tests/Foo.java</code>, - * <code>com/examples/tests/Foo.java</code>, and - * <code>com/examples/tests/unit/Foo.java</code>, but not - * <code>com/example/Foo.java</code> (not under a folder named - * <code>tests</code>). - * </li> - * </ul> - * </p> - * - * @return the possibly empty list of resource exclusion patterns - * associated with this classpath entry, or <code>null</code> if this kind - * of classpath entry does not support exclusion patterns - * @since 2.1 - - - - - - - - - - - * Returns the extra classpath attributes for this classpath entry. Returns an empty array if this entry - * has no extra attributes. - * - * @return the possibly empty list of extra classpath attributes for this classpath entry - * @since 3.1 - - - - - - - - - - - * Returns the set of patterns used to explicitly define resources or classes - * to be included with this classpath entry. - * <p> - * For source classpath entries, - * when no inclusion patterns are specified, the source entry includes all - * relevent files in the resource tree rooted at this source entry's path. - * Specifying one or more inclusion patterns means that only the specified - * portions of the resource tree are to be included. Each path specified - * must be a relative path, and will be interpreted relative to this source - * entry's path. File patterns are case-sensitive. A file matched by one or - * more of these patterns is included in the corresponding package fragment - * root unless it is excluded by one or more of this entrie's exclusion - * patterns. Exclusion patterns have higher precedence than inclusion - * patterns; in other words, exclusion patterns can remove files for the - * ones that are to be included, not the other way around. - * </p> - * <p> - * See {@link #getExclusionPatterns()} for a discussion of the syntax and - * semantics of path patterns. The absence of any inclusion patterns is - * semantically equivalent to the explicit inclusion pattern - * <code>&#42;&#42;</code>. - * </p> - * <p> - * Example patterns in source entries: - * <ul> - * <li> - * The inclusion pattern <code>src/&#42;&#42;</code> by itself includes all - * files under a root folder named <code>src</code>. - * </li> - * <li> - * The inclusion patterns <code>src/&#42;&#42;</code> and - * <code>tests/&#42;&#42;</code> includes all files under the root folders - * named <code>src</code> and <code>tests</code>. - * </li> - * <li> - * The inclusion pattern <code>src/&#42;&#42;</code> together with the - * exclusion pattern <code>src/&#42;&#42;/Foo.java</code> includes all - * files under a root folder named <code>src</code> except for ones - * named <code>Foo.java</code>. - * </li> - * </ul> - * </p> - * - * @return the possibly empty list of resource inclusion patterns - * associated with this classpath entry, or <code>null</code> if this kind - * of classpath entry does not support inclusion patterns - * @since 3.0 - - - - - - - - - - - * Returns the full path to the specific location where the builder writes - * <code>.class</code> files generated for this source entry - * (entry kind {@link #CPE_SOURCE}). - * <p> - * Source entries can optionally be associated with a specific output location. - * If none is provided, the source entry will be implicitly associated with its project - * default output location (see {@link IJavaProject#getOutputLocation}). - * </p><p> - * NOTE: A specific output location cannot coincidate with another source/library entry. - * </p> - * - * @return the full path to the specific location where the builder writes - * <code>.class</code> files for this source entry, or <code>null</code> - * if using default output folder - * @since 2.1 - - - - - - - - * Returns the path of this classpath entry. - * - * The meaning of the path of a classpath entry depends on its entry kind:<ul> - * <li>Source code in the current project ({@link #CPE_SOURCE}) - - * The path associated with this entry is the absolute path to the root folder. </li> - * <li>A binary library in the current project ({@link #CPE_LIBRARY}) - the path - * associated with this entry is the absolute path to the JAR (or root folder), and - * in case it refers to an external library, then there is no associated resource in - * the workbench. - * <li>A required project ({@link #CPE_PROJECT}) - the path of the entry denotes the - * path to the corresponding project resource.</li> - * <li>A variable entry ({@link #CPE_VARIABLE}) - the first segment of the path - * is the name of a classpath variable. If this classpath variable - * is bound to the path <i>P</i>, the path of the corresponding classpath entry - * is computed by appending to <i>P</i> the segments of the returned - * path without the variable.</li> - * <li> A container entry ({@link #CPE_CONTAINER}) - the path of the entry - * is the name of the classpath container, which can be bound indirectly to a set of classpath - * entries after resolution. The containerPath is a formed by a first ID segment followed with - * extra segments that can be used as additional hints for resolving this container - * reference (also see {@link IClasspathContainer}). - * </li> - * </ul> - * - * @return the path of this classpath entry - - - - - - - - * Returns the path to the source archive or folder associated with this - * classpath entry, or <code>null</code> if this classpath entry has no - * source attachment. - * <p> - * Only library and variable classpath entries may have source attachments. - * For library classpath entries, the result path (if present) locates a source - * archive or folder. This archive or folder can be located in a project of the - * workspace or outside the workspace. For variable classpath entries, the - * result path (if present) has an analogous form and meaning as the - * variable path, namely the first segment is the name of a classpath variable. - * </p> - * - * @return the path to the source archive or folder, or <code>null</code> if none - - - - - - - - * Returns the path within the source archive or folder where package fragments - * are located. An empty path indicates that packages are located at - * the root of the source archive or folder. Returns a non-<code>null</code> value - * if and only if {@link #getSourceAttachmentPath} returns - * a non-<code>null</code> value. - * - * @return the path within the source archive or folder, or <code>null</code> if - * not applicable - - - - - - - - * Returns the classpath entry that is making a reference to this classpath entry. For entry kinds - * {@link #CPE_LIBRARY}, the return value is the entry that is representing the JAR that includes - * <code>this</code> in the MANIFEST.MF file's Class-Path section. For entry kinds other than - * {@link #CPE_LIBRARY}, this returns <code>null</code>. For those entries that are on the raw classpath already, - * this returns <code>null</code>. - * <p> - * It is possible that multiple library entries refer to the same entry - * via the MANIFEST.MF file. In those cases, this method returns the first classpath entry - * that appears in the raw classpath. However, this does not mean that the other referencing - * entries do not relate to their referenced entries. - * See {@link JavaCore#getReferencedClasspathEntries(IClasspathEntry, IJavaProject)} for - * more details. - * </p> - * - * @return the classpath entry that is referencing this entry or <code>null</code> if - * not applicable. - * @since 3.6 - - - - - - - - * Returns whether this entry is exported to dependent projects. - * Always returns <code>false</code> for source entries (kind - * {@link #CPE_SOURCE}), which cannot be exported. - * - * @return <code>true</code> if exported, and <code>false</code> otherwise - * @since 2.0 - - - - - - - - * This is a helper method, which returns the resolved classpath entry denoted - * by an entry (if it is a variable entry). It is obtained by resolving the variable - * reference in the first segment. Returns <code>null</code> if unable to resolve using - * the following algorithm: - * <ul> - * <li> if variable segment cannot be resolved, returns <code>null</code></li> - * <li> finds a project, JAR or binary folder in the workspace at the resolved path location</li> - * <li> if none finds an external JAR file or folder outside the workspace at the resolved path location </li> - * <li> if none returns <code>null</code></li> - * </ul> - * <p> - * Variable source attachment is also resolved and recorded in the resulting classpath entry. - * <p> - * @return the resolved library or project classpath entry, or <code>null</code> - * if the given path could not be resolved to a classpath entry - * <p> - * Note that this deprecated API doesn't handle CPE_CONTAINER entries. - * - * @deprecated Use {@link JavaCore#getResolvedClasspathEntry(IClasspathEntry)} instead - - - - - - - - - * Common protocol for Java elements that support source code assist and code - * resolve. - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - * A completion requestor accepts results as they are computed and is aware - * of source positions to complete the various different results. - * <p> - * This interface may be implemented by clients. - * </p> - * - * @see ICodeAssist - * @deprecated Use {@link CompletionRequestor} instead. - - - - - - * Code assist notification of a class completion. - * - * @param packageName Declaring package name of the class. - * @param className Name of the class. - * @param completionName The completion for the class. - * Can include ';' for imported classes. - * @param modifiers The modifiers of the class. - * @param completionStart The start position of insertion of the name of the class. - * @param completionEnd The end position of insertion of the name of the class. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - - - - - - - - - - - - - - - - - - - - - - * Code assist notification of a compilation error detected during completion. - * @param marker Only problems which are categorized as errors are notified to the requestor, - * warnings are silently ignored. - * In case an error got signaled, no other completions might be available, - * therefore the problem message should be presented to the user. - * The source positions of the problem are related to the source where it was - * detected (might be in another compilation unit, if it was indirectly requested - * during the code assist process). - * Note: the problem knows its originating file name. - - - - - - - - * Code assist notification of a field completion. - * - * @param declaringTypePackageName Name of the package in which the type that contains this field is declared. - * - * @param declaringTypeName Name of the type declaring this new field. - * - * @param name Name of the field. - * - * @param typePackageName Name of the package in which the type of this field is declared. - * - * @param typeName Name of the type of this field. - * - * @param completionName The completion for the field. - * - * @param modifiers The modifiers of this field. - * - * @param completionStart The start position of insertion of the name of this field. - * - * @param completionEnd The end position of insertion of the name of this field. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Base types are in the form "int" or "boolean". - * Array types are in the qualified form "M[]" or "int[]". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Code assist notification of an interface completion. - * - * @param packageName Declaring package name of the interface. - * @param interfaceName Name of the interface. - * @param completionName The completion for the interface. - * Can include ';' for imported interfaces. - * @param modifiers The modifiers of the interface. - * @param completionStart The start position of insertion of the name of the interface. - * @param completionEnd The end position of insertion of the name of the interface. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - - - - - - - - - - - - - - - - - - - - - - * Code assist notification of a keyword completion. - * - * @param keywordName The keyword source. - * @param completionStart The start position of insertion of the name of this keyword. - * @param completionEnd The end position of insertion of the name of this keyword. - - - - - - - - - - - - - * Code assist notification of a label completion. - * - * @param labelName The label source. - * @param completionStart The start position of insertion of the name of this label. - * @param completionEnd The end position of insertion of the name of this label. - - - - - - - - - - - - - * Code assist notification of a local variable completion. - * - * @param name Name of the new local variable. - * - * @param typePackageName Name of the package in which the type of this new local variable is declared. - * - * @param typeName Name of the type of this new local variable. - * - * @param modifiers The modifiers of this new local variable. - * - * @param completionStart The start position of insertion of the name of this new local variable. - * - * @param completionEnd The end position of insertion of the name of this new local variable. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Base types are in the form "int" or "boolean". - * Array types are in the qualified form "M[]" or "int[]". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - - - - - - - - - - - - - - - - - - - - - - * Code assist notification of a method completion. - * - * @param declaringTypePackageName Name of the package in which the type that contains this new method is declared. - * - * @param declaringTypeName Name of the type declaring this new method. - * - * @param selector Name of the new method. - * - * @param parameterPackageNames Names of the packages in which the parameter types are declared. - * Should contain as many elements as parameterTypeNames. - * - * @param parameterTypeNames Names of the parameters types. - * Should contain as many elements as parameterPackageNames. - * - * @param returnTypePackageName Name of the package in which the return type is declared. - * - * @param returnTypeName Name of the return type of this new method, should be <code>null</code> for a constructor. - * - * @param completionName The completion for the method. - * Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it. - * - * @param modifiers The modifiers of this new method. - * - * @param completionStart The start position of insertion of the name of this new method. - * - * @param completionEnd The end position of insertion of the name of this new method. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Base types are in the form "int" or "boolean". - * Array types are in the qualified form "M[]" or "int[]". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - * - * NOTE: parameter names can be retrieved from the source model after the user selects a specific method. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Code assist notification of a modifier completion. - * - * @param modifierName The new modifier. - * @param completionStart The start position of insertion of the name of this new modifier. - * @param completionEnd The end position of insertion of the name of this new modifier. - - - - - - - - - - - - - * Code assist notification of a package completion. - * - * @param packageName The package name. - * @param completionName The completion for the package. - * Can include '.*;' for imports. - * @param completionStart The start position of insertion of the name of this new package. - * @param completionEnd The end position of insertion of the name of this new package. - * - * NOTE - All package names are presented in their readable form: - * Package names are in the form "a.b.c". - * The default package is represented by an empty array. - - - - - - - - - - - - - - - - - * Code assist notification of a type completion. - * - * @param packageName Declaring package name of the type. - * @param typeName Name of the type. - * @param completionName The completion for the type. - * Can include ';' for imported types. - * @param completionStart The start position of insertion of the name of the type. - * @param completionEnd The end position of insertion of the name of the type. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - - - - - - - - - - - - - - - - - - - - - - * Specification for a generic source code formatter. Client plug-ins can contribute - * an implementation for an ICodeFormatter, through the extension point "org.eclipse.jdt.core.codeFormatter". - * In case none is found, a default formatter can be provided through the ToolFactory. - * - * @see ToolFactory#createCodeFormatter() - * @see ToolFactory#createDefaultCodeFormatter(java.util.Map options) - * @since 2.0 - * @deprecated Use {@link org.eclipse.jdt.core.formatter.CodeFormatter} instead (note: options have changed) - - - - - - * Formats the String <code>sourceString</code>, - * and returns a string containing the formatted version. - * - * @param string the string to format - * @param indentationLevel the initial indentation level, used - * to shift left/right the entire source fragment. An initial indentation - * level of zero has no effect. - * @param positions an array of positions to map. These are - * character-based source positions inside the original source, - * arranged in non-decreasing order, for which corresponding positions in - * the formatted source will be computed (so as to relocate elements associated - * with the original source). It updates the positions array with updated - * positions. If set to <code>null</code>, then no positions are mapped. - * @param lineSeparator the line separator to use in formatted source, - * if set to <code>null</code>, then the platform default one will be used. - * @return the formatted output string. - - - - - - - - - - - - - - - - * Represents an entire Java compilation unit (source file with one of the - * {@link JavaCore#getJavaLikeExtensions() Java-like extensions}). - * Compilation unit elements need to be opened before they can be navigated or manipulated. - * The children are of type {@link IPackageDeclaration}, - * {@link IImportContainer}, and {@link IType}, - * and appear in the order in which they are declared in the source. - * If a source file cannot be parsed, its structure remains unknown. - * Use {@link IJavaElement#isStructureKnown} to determine whether this is - * the case. - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - - * Constant indicating that a reconcile operation should not return an AST. - * @since 3.0 - - - - - - - * Constant indicating that a reconcile operation should recompute the problems - * even if the source hasn't changed. - * @since 3.3 - - - - - - - * Constant indicating that a reconcile operation should enable the statements recovery. - * @see ASTParser#setStatementsRecovery(boolean) - * @since 3.3 - - - - - - - * Constant indicating that a reconcile operation should enable the bindings recovery - * @see ASTParser#setBindingsRecovery(boolean) - * @see IBinding#isRecovered() - * @since 3.3 - - - - - - - * Constant indicating that a reconcile operation could ignore to parse the method bodies. - * @see ASTParser#setIgnoreMethodBodies(boolean) - * @since 3.5.2 - - - - - - - * Applies a text edit to the compilation unit's buffer. - * <p> - * Note that the edit is simply applied to the compilation unit's buffer. - * In particular the undo edit is not grouped with previous undo edits - * if the buffer doesn't implement {@link IBuffer.ITextEditCapability}. - * If it does, the exact semantics for grouping undo edit depends - * on how {@link IBuffer.ITextEditCapability#applyTextEdit(TextEdit, IProgressMonitor)} - * is implemented. - * </p> - * - * @param edit the edit to apply - * @param monitor the progress monitor to use or <code>null</code> if no progress should be reported - * @return the undo edit - * @throws JavaModelException if this edit can not be applied to the compilation unit's buffer. Reasons include: - * <ul> - * <li>This compilation unit does not exist ({@link IJavaModelStatusConstants#ELEMENT_DOES_NOT_EXIST}).</li> - * <li>The provided edit can not be applied as there is a problem with the text edit locations ({@link IJavaModelStatusConstants#BAD_TEXT_EDIT_LOCATION}).</li> - * </ul> - * - * @since 3.4 - - - - - - - - - - * Changes this compilation unit handle into a working copy. A new {@link IBuffer} is - * created using this compilation unit handle's owner. Uses the primary owner if none was - * specified when this compilation unit handle was created. - * <p> - * When switching to working copy mode, problems are reported to given - * {@link IProblemRequestor}. Note that once in working copy mode, the given - * {@link IProblemRequestor} is ignored. Only the original {@link IProblemRequestor} - * is used to report subsequent problems. - * </p> - * <p> - * Once in working copy mode, changes to this compilation unit or its children are done in memory. - * Only the new buffer is affected. Using {@link #commitWorkingCopy(boolean, IProgressMonitor)} - * will bring the underlying resource in sync with this compilation unit. - * </p> - * <p> - * If this compilation unit was already in working copy mode, an internal counter is incremented and no - * other action is taken on this compilation unit. To bring this compilation unit back into the original mode - * (where it reflects the underlying resource), {@link #discardWorkingCopy} must be call as many - * times as {@link #becomeWorkingCopy(IProblemRequestor, IProgressMonitor)}. - * </p> - * - * @param problemRequestor a requestor which will get notified of problems detected during - * reconciling as they are discovered. The requestor can be set to <code>null</code> indicating - * that the client is not interested in problems. - * @param monitor a progress monitor used to report progress while opening this compilation unit - * or <code>null</code> if no progress should be reported - * @throws JavaModelException if this compilation unit could not become a working copy. - * @see #discardWorkingCopy() - * @since 3.0 - * - * @deprecated Use {@link #becomeWorkingCopy(IProgressMonitor)} instead. - * Note that if this deprecated method is used, problems will be reported to the given problem requestor - * as well as the problem requestor returned by the working copy owner (if not null). - - - - - - - - - * Changes this compilation unit handle into a working copy. A new {@link IBuffer} is - * created using this compilation unit handle's owner. Uses the primary owner if none was - * specified when this compilation unit handle was created. - * <p> - * When switching to working copy mode, problems are reported to the {@link IProblemRequestor - * problem requestor} of the {@link WorkingCopyOwner working copy owner}. - * </p><p> - * Once in working copy mode, changes to this compilation unit or its children are done in memory. - * Only the new buffer is affected. Using {@link #commitWorkingCopy(boolean, IProgressMonitor)} - * will bring the underlying resource in sync with this compilation unit. - * </p><p> - * If this compilation unit was already in working copy mode, an internal counter is incremented and no - * other action is taken on this compilation unit. To bring this compilation unit back into the original mode - * (where it reflects the underlying resource), {@link #discardWorkingCopy} must be call as many - * times as {@link #becomeWorkingCopy(IProblemRequestor, IProgressMonitor)}. - * </p> - * - * @param monitor a progress monitor used to report progress while opening this compilation unit - * or <code>null</code> if no progress should be reported - * @throws JavaModelException if this compilation unit could not become a working copy. - * @see #discardWorkingCopy() - * @since 3.3 - - - - - - - - * Commits the contents of this working copy to its underlying resource. - * - * <p>It is possible that the contents of the original resource have changed - * since this working copy was created, in which case there is an update conflict. - * The value of the <code>force</code> parameter affects the resolution of - * such a conflict:<ul> - * <li> <code>true</code> - in this case the contents of this working copy are applied to - * the underlying resource even though this working copy was created before - * a subsequent change in the resource</li> - * <li> <code>false</code> - in this case a {@link JavaModelException} is thrown</li> - * </ul> - * <p> - * Since 2.1, a working copy can be created on a not-yet existing compilation - * unit. In particular, such a working copy can then be committed in order to create - * the corresponding compilation unit. - * </p> - * @param force a flag to handle the cases when the contents of the original resource have changed - * since this working copy was created - * @param monitor the given progress monitor - * @throws JavaModelException if this working copy could not commit. Reasons include: - * <ul> - * <li> A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource - * <li> This element is not a working copy (INVALID_ELEMENT_TYPES) - * <li> A update conflict (described above) (UPDATE_CONFLICT) - * </ul> - * @since 3.0 - - - - - - - - - * Creates and returns an non-static import declaration in this compilation unit - * with the given name. This method is equivalent to - * <code>createImport(name, Flags.AccDefault, sibling, monitor)</code>. - * - * @param name the name of the import declaration to add as defined by JLS2 7.5. (For example: <code>"java.io.File"</code> or - * <code>"java.awt.*"</code>) - * @param sibling the existing element which the import declaration will be inserted immediately before (if - * <code> null </code>, then this import will be inserted as the last import declaration. - * @param monitor the progress monitor to notify - * @return the newly inserted import declaration (or the previously existing one in case attempting to create a duplicate) - * - * @throws JavaModelException if the element could not be created. Reasons include: - * <ul> - * <li> This Java element does not exist or the specified sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource - * <li> The specified sibling is not a child of this compilation unit (INVALID_SIBLING) - * <li> The name is not a valid import name (INVALID_NAME) - * </ul> - * @see #createImport(String, IJavaElement, int, IProgressMonitor) - - - - - - - - - - - * Creates and returns an import declaration in this compilation unit - * with the given name. - * <p> - * Optionally, the new element can be positioned before the specified - * sibling. If no sibling is specified, the element will be inserted - * as the last import declaration in this compilation unit. - * <p> - * If the compilation unit already includes the specified import declaration, - * the import is not generated (it does not generate duplicates). - * Note that it is valid to specify both a single-type import and an on-demand import - * for the same package, for example <code>"java.io.File"</code> and - * <code>"java.io.*"</code>, in which case both are preserved since the semantics - * of this are not the same as just importing <code>"java.io.*"</code>. - * Importing <code>"java.lang.*"</code>, or the package in which the compilation unit - * is defined, are not treated as special cases. If they are specified, they are - * included in the result. - * <p> - * Note: This API element is only needed for dealing with Java code that uses - * new language features of J2SE 5.0. - * </p> - * - * @param name the name of the import declaration to add as defined by JLS2 7.5. (For example: <code>"java.io.File"</code> or - * <code>"java.awt.*"</code>) - * @param sibling the existing element which the import declaration will be inserted immediately before (if - * <code> null </code>, then this import will be inserted as the last import declaration. - * @param flags {@link Flags#AccStatic} for static imports, or - * {@link Flags#AccDefault} for regular imports; other modifier flags - * are ignored - * @param monitor the progress monitor to notify - * @return the newly inserted import declaration (or the previously existing one in case attempting to create a duplicate) - * - * @throws JavaModelException if the element could not be created. Reasons include: - * <ul> - * <li> This Java element does not exist or the specified sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource - * <li> The specified sibling is not a child of this compilation unit (INVALID_SIBLING) - * <li> The name is not a valid import name (INVALID_NAME) - * </ul> - * @see Flags - * @since 3.0 - - - - - - - - - - - - * Creates and returns a package declaration in this compilation unit - * with the given package name. - * - * <p>If the compilation unit already includes the specified package declaration, - * it is not generated (it does not generate duplicates). - * - * @param name the name of the package declaration to add as defined by JLS2 7.4. (For example, <code>"java.lang"</code>) - * @param monitor the progress monitor to notify - * @return the newly inserted package declaration (or the previously existing one in case attempting to create a duplicate) - * - * @throws JavaModelException if the element could not be created. Reasons include: - * <ul> - * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource - * <li> The name is not a valid package name (INVALID_NAME) - * </ul> - - - - - - - - - - * Creates and returns a type in this compilation unit with the - * given contents. If this compilation unit does not exist, one - * will be created with an appropriate package declaration. - * <p> - * Optionally, the new type can be positioned before the specified - * sibling. If <code>sibling</code> is <code>null</code>, the type will be appended - * to the end of this compilation unit. - * - * <p>It is possible that a type with the same name already exists in this compilation unit. - * The value of the <code>force</code> parameter affects the resolution of - * such a conflict:<ul> - * <li> <code>true</code> - in this case the type is created with the new contents</li> - * <li> <code>false</code> - in this case a {@link JavaModelException} is thrown</li> - * </ul> - * - * @param contents the source contents of the type declaration to add. - * @param sibling the existing element which the type will be inserted immediately before (if - * <code>null</code>, then this type will be inserted as the last type declaration. - * @param force a <code>boolean</code> flag indicating how to deal with duplicates - * @param monitor the progress monitor to notify - * @return the newly inserted type - * - * @throws JavaModelException if the element could not be created. Reasons include: - * <ul> - * <li>The specified sibling element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource - * <li> The specified sibling is not a child of this compilation unit (INVALID_SIBLING) - * <li> The contents could not be recognized as a type declaration (INVALID_CONTENTS) - * <li> There was a naming collision with an existing type (NAME_COLLISION) - * </ul> - - - - - - - - - - - - * Changes this compilation unit in working copy mode back to its original mode. - * <p> - * This has no effect if this compilation unit was not in working copy mode. - * </p> - * <p> - * If {@link #becomeWorkingCopy(IProgressMonitor)} method was called several - * times on this compilation unit, {@link #discardWorkingCopy()} must be called - * as many times before it switches back to the original mode. Same as - * for method {@link #getWorkingCopy(IProgressMonitor)}. - * </p> - * - * @throws JavaModelException if this working copy could not return in its original mode. - * @see #becomeWorkingCopy(IProblemRequestor, IProgressMonitor) - * @since 3.0 - - - - - - - * Finds the elements in this compilation unit that correspond to - * the given element. - * An element A corresponds to an element B if: - * <ul> - * <li>A has the same element name as B. - * <li>If A is a method, A must have the same number of arguments as - * B and the simple names of the argument types must be equals. - * <li>The parent of A corresponds to the parent of B recursively up to - * their respective compilation units. - * <li>A exists. - * </ul> - * Returns <code>null</code> if no such java elements can be found - * or if the given element is not included in a compilation unit. - * - * @param element the given element - * @return the found elements in this compilation unit that correspond to the given element - * @since 3.0 - - - - - - - - - - - - * Finds the working copy for this compilation unit, given a {@link WorkingCopyOwner}. - * If no working copy has been created for this compilation unit associated with this - * working copy owner, returns <code>null</code>. - * <p> - * Users of this method must not destroy the resulting working copy. - * - * @param owner the given {@link WorkingCopyOwner} - * @return the found working copy for this compilation unit, <code>null</code> if none - * @see WorkingCopyOwner - * @since 3.0 - - - - - - - - - * Returns all types declared in this compilation unit in the order - * in which they appear in the source. - * This includes all top-level types and nested member types. - * It does NOT include local types (types defined in methods). - * - * @return the array of top-level and member types defined in a compilation unit, in declaration order. - * @throws JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - - - - * Returns the first import declaration in this compilation unit with the given name. - * This is a handle-only method. The import declaration may or may not exist. This - * is a convenience method - imports can also be accessed from a compilation unit's - * import container. - * - * @param name the name of the import to find as defined by JLS2 7.5. (For example: <code>"java.io.File"</code> - * or <code>"java.awt.*"</code>) - * @return a handle onto the corresponding import declaration. The import declaration may or may not exist. - - - - - - - - - * Returns the import container for this compilation unit. - * This is a handle-only method. The import container may or - * may not exist. The import container can used to access the - * imports. - * @return a handle onto the corresponding import container. The - * import contain may or may not exist. - - - - - - - - * Returns the import declarations in this compilation unit - * in the order in which they appear in the source. This is - * a convenience method - import declarations can also be - * accessed from a compilation unit's import container. - * - * @return the import declarations in this compilation unit - * @throws JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - - - - * Returns the primary compilation unit (whose owner is the primary owner) - * this working copy was created from, or this compilation unit if this a primary - * compilation unit. - * <p> - * Note that the returned primary compilation unit can be in working copy mode. - * </p> - * - * @return the primary compilation unit this working copy was created from, - * or this compilation unit if it is primary - * @since 3.0 - - - - - - - - * Returns <tt>null</tt> if this <code>ICompilationUnit</code> is the primary - * working copy, or this <code>ICompilationUnit</code> is not a working copy, - * otherwise the <code>WorkingCopyOwner</code> - * - * @return <tt>null</tt> if this <code>ICompilationUnit</code> is the primary - * working copy, or this <code>ICompilationUnit</code> is not a working copy, - * otherwise the <code>WorkingCopyOwner</code> - * @since 3.0 - - - - - - - - * Returns the first package declaration in this compilation unit with the given package name - * (there normally is at most one package declaration). - * This is a handle-only method. The package declaration may or may not exist. - * - * @param name the name of the package declaration as defined by JLS2 7.4. (For example, <code>"java.lang"</code>) - * @return the first package declaration in this compilation unit with the given package name - - - - - - - - - * Returns the package declarations in this compilation unit - * in the order in which they appear in the source. - * There normally is at most one package declaration. - * - * @return an array of package declaration (normally of size one) - * - * @throws JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - - - - * Returns the top-level type declared in this compilation unit with the given simple type name. - * The type name has to be a valid compilation unit name. - * This is a handle-only method. The type may or may not exist. - * - * @param name the simple name of the requested type in the compilation unit - * @return a handle onto the corresponding type. The type may or may not exist. - * @see JavaConventions#validateCompilationUnitName(String name, String sourceLevel, String complianceLevel) - - - - - - - - - * Returns the top-level types declared in this compilation unit - * in the order in which they appear in the source. - * - * @return the top-level types declared in this compilation unit - * @throws JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - - - - * Returns a new working copy of this compilation unit if it is a primary compilation unit, - * or this compilation unit if it is already a non-primary working copy. - * <p> - * Note: if intending to share a working copy amongst several clients, then - * {@link #getWorkingCopy(WorkingCopyOwner, IProblemRequestor, IProgressMonitor)} - * should be used instead. - * </p><p> - * When the working copy instance is created, an ADDED IJavaElementDelta is - * reported on this working copy. - * </p><p> - * Once done with the working copy, users of this method must discard it using - * {@link #discardWorkingCopy()}. - * </p><p> - * Since 2.1, a working copy can be created on a not-yet existing compilation - * unit. In particular, such a working copy can then be committed in order to create - * the corresponding compilation unit. - * </p> - * @param monitor a progress monitor used to report progress while opening this compilation unit - * or <code>null</code> if no progress should be reported - * @throws JavaModelException if the contents of this element can - * not be determined. - * @return a new working copy of this element if this element is not - * a working copy, or this element if this element is already a working copy - * @since 3.0 - - - - - - - - - * Returns a shared working copy on this compilation unit using the given working copy owner to create - * the buffer, or this compilation unit if it is already a non-primary working copy. - * This API can only answer an already existing working copy if it is based on the same - * original compilation unit AND was using the same working copy owner (that is, as defined by {@link Object#equals}). - * <p> - * The life time of a shared working copy is as follows: - * <ul> - * <li>The first call to {@link #getWorkingCopy(WorkingCopyOwner, IProblemRequestor, IProgressMonitor)} - * creates a new working copy for this element</li> - * <li>Subsequent calls increment an internal counter.</li> - * <li>A call to {@link #discardWorkingCopy()} decrements the internal counter.</li> - * <li>When this counter is 0, the working copy is discarded. - * </ul> - * So users of this method must discard exactly once the working copy. - * <p> - * Note that the working copy owner will be used for the life time of this working copy, that is if the - * working copy is closed then reopened, this owner will be used. - * The buffer will be automatically initialized with the original's compilation unit content - * upon creation. - * <p> - * When the shared working copy instance is created, an ADDED IJavaElementDelta is reported on this - * working copy. - * </p><p> - * Since 2.1, a working copy can be created on a not-yet existing compilation - * unit. In particular, such a working copy can then be committed in order to create - * the corresponding compilation unit. - * </p> - * @param owner the working copy owner that creates a buffer that is used to get the content - * of the working copy - * @param problemRequestor a requestor which will get notified of problems detected during - * reconciling as they are discovered. The requestor can be set to <code>null</code> indicating - * that the client is not interested in problems. - * @param monitor a progress monitor used to report progress while opening this compilation unit - * or <code>null</code> if no progress should be reported - * @throws JavaModelException if the contents of this element can - * not be determined. - * @return a new working copy of this element using the given factory to create - * the buffer, or this element if this element is already a working copy - * @since 3.0 - * @deprecated Use {@link ITypeRoot#getWorkingCopy(WorkingCopyOwner, IProgressMonitor)} instead. - * Note that if this deprecated method is used, problems will be reported on the passed problem requester - * as well as on the problem requestor returned by the working copy owner (if not null). - - - - - - - - - - - * Returns whether the resource of this working copy has changed since the - * inception of this working copy. - * Returns <code>false</code> if this compilation unit is not in working copy mode. - * - * @return whether the resource has changed - * @since 3.0 - - - - - - - - * Returns whether this element is a working copy. - * - * @return true if this element is a working copy, false otherwise - * @since 3.0 - - - - - - - - * Reconciles the contents of this working copy, sends out a Java delta - * notification indicating the nature of the change of the working copy since - * the last time it was either reconciled or made consistent - * ({@link IOpenable#makeConsistent(IProgressMonitor)}), and returns a - * compilation unit AST if requested. - * <p> - * It performs the reconciliation by locally caching the contents of - * the working copy, updating the contents, then creating a delta - * over the cached contents and the new contents, and finally firing - * this delta. - * <p> - * The boolean argument allows to force problem detection even if the - * working copy is already consistent. - * </p> - * <p> - * This functionality allows to specify a working copy owner which is used - * during problem detection. All references contained in the working copy are - * resolved against other units; for which corresponding owned working copies - * are going to take precedence over their original compilation units. If - * <code>null</code> is passed in, then the primary working copy owner is used. - * </p> - * <p> - * Compilation problems found in the new contents are notified through the - * {@link IProblemRequestor} interface which was passed at - * creation, and no longer as transient markers. - * </p> - * <p> - * Note: Since 3.0, added/removed/changed inner types generate change deltas. - * </p> - * <p> - * If requested, a DOM AST representing the compilation unit is returned. - * Its bindings are computed only if the problem requestor is active. - * This method returns <code>null</code> if the creation of the DOM AST was not requested, - * or if the requested level of AST API is not supported, or if the working copy was - * already consistent. - * </p> - * - * <p> - * This method doesn't perform statements recovery. To recover statements with syntax - * errors, {@link #reconcile(int, boolean, boolean, WorkingCopyOwner, IProgressMonitor)} must be use. - * </p> - * - * @param astLevel either {@link #NO_AST} if no AST is wanted, - * or the {@linkplain AST#newAST(int) AST API level} of the AST if one is wanted - * @param forceProblemDetection boolean indicating whether problem should be - * recomputed even if the source hasn't changed - * @param owner the owner of working copies that take precedence over the - * original compilation units, or <code>null</code> if the primary working - * copy owner should be used - * @param monitor a progress monitor - * @return the compilation unit AST or <code>null</code> if not requested, - * or if the requested level of AST API is not supported, - * or if the working copy was consistent - * @throws JavaModelException if the contents of the original element - * cannot be accessed. Reasons include: - * <ul> - * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * </ul> - * @since 3.0 - - - - - - - - - - - - * Reconciles the contents of this working copy, sends out a Java delta - * notification indicating the nature of the change of the working copy since - * the last time it was either reconciled or made consistent - * ({@link IOpenable#makeConsistent(IProgressMonitor)}), and returns a - * compilation unit AST if requested. - * <p> - * It performs the reconciliation by locally caching the contents of - * the working copy, updating the contents, then creating a delta - * over the cached contents and the new contents, and finally firing - * this delta. - * <p> - * The boolean argument allows to force problem detection even if the - * working copy is already consistent. - * </p> - * <p> - * This functionality allows to specify a working copy owner which is used - * during problem detection. All references contained in the working copy are - * resolved against other units; for which corresponding owned working copies - * are going to take precedence over their original compilation units. If - * <code>null</code> is passed in, then the primary working copy owner is used. - * </p> - * <p> - * Compilation problems found in the new contents are notified through the - * {@link IProblemRequestor} interface which was passed at - * creation, and no longer as transient markers. - * </p> - * <p> - * Note: Since 3.0, added/removed/changed inner types generate change deltas. - * </p> - * <p> - * If requested, a DOM AST representing the compilation unit is returned. - * Its bindings are computed only if the problem requestor is active. - * This method returns <code>null</code> if the creation of the DOM AST was not requested, - * or if the requested level of AST API is not supported, or if the working copy was - * already consistent. - * </p> - * - * <p> - * If statements recovery is enabled then this method tries to rebuild statements - * with syntax error. Otherwise statements with syntax error won't be present in - * the returning DOM AST. - * </p> - * - * @param astLevel either {@link #NO_AST} if no AST is wanted, - * or the {@linkplain AST#newAST(int) AST API level} of the AST if one is wanted - * @param forceProblemDetection boolean indicating whether problem should be - * recomputed even if the source hasn't changed - * @param enableStatementsRecovery if <code>true</code> statements recovery is enabled. - * @param owner the owner of working copies that take precedence over the - * original compilation units, or <code>null</code> if the primary working - * copy owner should be used - * @param monitor a progress monitor - * @return the compilation unit AST or <code>null</code> if not requested, - * or if the requested level of AST API is not supported, - * or if the working copy was consistent - * @throws JavaModelException if the contents of the original element - * cannot be accessed. Reasons include: - * <ul> - * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * </ul> - * @since 3.2 - - - - - - - - - - - - - * Reconciles the contents of this working copy, sends out a Java delta - * notification indicating the nature of the change of the working copy since - * the last time it was either reconciled or made consistent - * ({@link IOpenable#makeConsistent(IProgressMonitor)}), and returns a - * compilation unit AST if requested. - * - * <p> - * If the problem detection is forced by passing the {@link #FORCE_PROBLEM_DETECTION} bit in the given reconcile flag, - * problem detection is run even if the working copy is already consistent. - * </p> - * - * <p> - * It performs the reconciliation by locally caching the contents of - * the working copy, updating the contents, then creating a delta - * over the cached contents and the new contents, and finally firing - * this delta.</p> - * - * <p> - * This functionality allows to specify a working copy owner which is used - * during problem detection. All references contained in the working copy are - * resolved against other units; for which corresponding owned working copies - * are going to take precedence over their original compilation units. If - * <code>null</code> is passed in, then the primary working copy owner is used. - * </p> - * <p> - * Compilation problems found in the new contents are notified through the - * {@link IProblemRequestor} interface which was passed at - * creation, and no longer as transient markers. - * </p> - * <p> - * Note: Since 3.0, added/removed/changed inner types generate change deltas. - * </p> - * <p> - * If requested, a DOM AST representing the compilation unit is returned. - * Its bindings are computed only if the problem requestor is active. - * This method returns <code>null</code> if the creation of the DOM AST was not requested, - * or if the requested level of AST API is not supported, or if the working copy was - * already consistent. - * </p> - * - * <p> - * If statements recovery is enabled by passing the {@link #ENABLE_STATEMENTS_RECOVERY} bit in the given reconcile flag - * then this method tries to rebuild statements with syntax error. Otherwise statements with syntax error won't be - * present in the returning DOM AST.</p> - * <p> - * If bindings recovery is enabled by passing the {@link #ENABLE_BINDINGS_RECOVERY} bit in the given reconcile flag - * then this method tries to resolve bindings even if the type resolution contains errors.</p> - * <p> - * The given reconcile flags is a bit-mask of the different constants ({@link #ENABLE_BINDINGS_RECOVERY}, - * {@link #ENABLE_STATEMENTS_RECOVERY}, {@link #FORCE_PROBLEM_DETECTION}). Unspecified values are left for future use. - * </p> - * - * @param astLevel either {@link #NO_AST} if no AST is wanted, - * or the {@linkplain AST#newAST(int) AST API level} of the AST if one is wanted - * @param reconcileFlags the given reconcile flags - * @param owner the owner of working copies that take precedence over the - * original compilation units, or <code>null</code> if the primary working - * copy owner should be used - * @param monitor a progress monitor - * @return the compilation unit AST or <code>null</code> if not requested, - * or if the requested level of AST API is not supported, - * or if the working copy was consistent - * @throws JavaModelException if the contents of the original element - * cannot be accessed. Reasons include: - * <ul> - * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * </ul> - * @see #FORCE_PROBLEM_DETECTION - * @see #ENABLE_BINDINGS_RECOVERY - * @see #ENABLE_STATEMENTS_RECOVERY - * @since 3.3 - - - - - - - - - - - - * Restores the contents of this working copy to the current contents of - * this working copy's original element. Has no effect if this element - * is not a working copy. - * - * <p>Note: This is the inverse of committing the content of the - * working copy to the original element with {@link #commitWorkingCopy(boolean, IProgressMonitor)}. - * - * @throws JavaModelException if the contents of the original element - * cannot be accessed. Reasons include: - * <ul> - * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * </ul> - * @since 3.0 - - - - - - - - * A completion requestor accepts results as they are computed and is aware - * of source positions to complete the various different results. - * <p> - * This interface may be implemented by clients. - * </p> - * - * @see ICodeAssist - * @since 2.0 - * @deprecated Use {@link CompletionRequestor} instead. - - - - - - * Code assist notification of an anonymous type declaration completion. - * @param superTypePackageName Name of the package that contains the super type of this - * new anonymous type declaration. - * @param superTypeName Name of the super type of this new anonymous type declaration. - * @param parameterPackageNames Names of the packages in which the parameter types are declared. - * Should contain as many elements as parameterTypeNames. - * @param parameterTypeNames Names of the parameter types. - * Should contain as many elements as parameterPackageNames. - * @param parameterNames Names of the parameters. - * Should contain as many elements as parameterPackageNames. - * @param completionName The completion for the anonymous type declaration. - * Can include zero, one or two brackets. If the closing bracket is included, - * then the cursor should be placed before it. - * @param modifiers The modifiers of the constructor. - * @param completionStart The start position of insertion of the name of this new anonymous type declaration. - * @param completionEnd The end position of insertion of the name of this new anonymous type declaration. - * @param relevance The relevance of the completion proposal - * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. - * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance - * value is higher. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Base types are in the form "int" or "boolean". - * Array types are in the qualified form "M[]" or "int[]". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - * - * NOTE: parameter names can be retrieved from the source model after the user selects a specific method. - * - * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Code assist notification of a class completion. - * - * @param packageName Declaring package name of the class. - * @param className Name of the class. - * @param completionName The completion for the class. Can include ';' for imported classes. - * @param modifiers The modifiers of the class. - * @param completionStart The start position of insertion of the name of the class. - * @param completionEnd The end position of insertion of the name of the class. - * @param relevance The relevance of the completion proposal - * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. - * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance - * value is higher. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - * - * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. - - - - - - - - - - - - - - - - - - - - - - - * Code assist notification of a compilation error detected during completion. - * @param error Only problems which are categorized as non-syntax errors are notified to the - * requestor, warnings are silently ignored. - * In case an error got signalled, no other completions might be available, - * therefore the problem message should be presented to the user. - * The source positions of the problem are related to the source where it was - * detected (might be in another compilation unit, if it was indirectly requested - * during the code assist process). - * Note: the problem knows its originating file name. - * - * @deprecated Use {@link CompletionRequestor#completionFailure(IProblem)} instead. - - - - - - - - * Code assist notification of a field completion. - * - * @param declaringTypePackageName Name of the package in which the type that contains this field is declared. - * @param declaringTypeName Name of the type declaring this new field. - * @param name Name of the field. - * @param typePackageName Name of the package in which the type of this field is declared. - * @param typeName Name of the type of this field. - * @param completionName The completion for the field. - * @param modifiers The modifiers of this field. - * @param completionStart The start position of insertion of the name of this field. - * @param completionEnd The end position of insertion of the name of this field. - * @param relevance The relevance of the completion proposal - * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. - * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance - * value is higher. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Base types are in the form "int" or "boolean". - * Array types are in the qualified form "M[]" or "int[]". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - * - * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Code assist notification of an interface completion. - * - * @param packageName Declaring package name of the interface. - * @param interfaceName Name of the interface. - * @param completionName The completion for the interface. Can include ';' for imported interfaces. - * @param modifiers The modifiers of the interface. - * @param completionStart The start position of insertion of the name of the interface. - * @param completionEnd The end position of insertion of the name of the interface. - * @param relevance The relevance of the completion proposal - * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. - * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance - * value is higher. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - * - * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. - - - - - - - - - - - - - - - - - - - - - - - * Code assist notification of a keyword completion. - * @param keywordName The keyword source. - * @param completionStart The start position of insertion of the name of this keyword. - * @param completionEnd The end position of insertion of the name of this keyword. - * @param relevance The relevance of the completion proposal - * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. - * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance - * value is higher. - * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. - - - - - - - - - - - - - - * Code assist notification of a label completion. - * - * @param labelName The label source. - * @param completionStart The start position of insertion of the name of this label. - * @param completionEnd The end position of insertion of the name of this label. - * @param relevance The relevance of the completion proposal - * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. - * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance - * value is higher. - * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. - - - - - - - - - - - - - - * Code assist notification of a local variable completion. - * - * @param name Name of the new local variable. - * @param typePackageName Name of the package in which the type of this new local variable is declared. - * @param typeName Name of the type of this new local variable. - * @param modifiers The modifiers of this new local variable. - * @param completionStart The start position of insertion of the name of this new local variable. - * @param completionEnd The end position of insertion of the name of this new local variable. - * @param relevance The relevance of the completion proposal - * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. - * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance - * value is higher. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Base types are in the form "int" or "boolean". - * Array types are in the qualified form "M[]" or "int[]". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - * - * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. - - - - - - - - - - - - - - - - - - - - - - - * Code assist notification of a method completion. - * - * @param declaringTypePackageName Name of the package in which the type that contains this new method is declared. - * @param declaringTypeName Name of the type declaring this new method. - * @param selector Name of the new method. - * @param parameterPackageNames Names of the packages in which the parameter types are declared. - * Should contain as many elements as parameterTypeNames. - * @param parameterTypeNames Names of the parameter types. - * Should contain as many elements as parameterPackageNames. - * @param parameterNames Names of the parameters. - * Should contain as many elements as parameterPackageNames. - * @param returnTypePackageName Name of the package in which the return type is declared. - * @param returnTypeName Name of the return type of this new method, should be <code>null</code> for a constructor. - * @param completionName The completion for the method. Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it. - * @param modifiers The modifiers of this new method. - * @param completionStart The start position of insertion of the name of this new method. - * @param completionEnd The end position of insertion of the name of this new method. - * @param relevance The relevance of the completion proposal - * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. - * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance - * value is higher. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Base types are in the form "int" or "boolean". - * Array types are in the qualified form "M[]" or "int[]". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - * - * NOTE: parameter names can be retrieved from the source model after the user selects a specific method. - * - * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Code assist notification of a method completion. - * - * @param declaringTypePackageName Name of the package in which the type that contains this new method is declared. - * @param declaringTypeName Name of the type declaring this new method. - * @param selector Name of the new method. - * @param parameterPackageNames Names of the packages in which the parameter types are declared. - * Should contain as many elements as parameterTypeNames. - * @param parameterTypeNames Names of the parameter types. - * Should contain as many elements as parameterPackageNames. - * @param parameterNames Names of the parameters. - * Should contain as many elements as parameterPackageNames. - * @param returnTypePackageName Name of the package in which the return type is declared. - * @param returnTypeName Name of the return type of this new method, should be <code>null</code> for a constructor. - * @param completionName The completion for the method. Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it. - * @param modifiers The modifiers of this new method. - * @param completionStart The start position of insertion of the name of this new method. - * @param completionEnd The end position of insertion of the name of this new method. - * @param relevance The relevance of the completion proposal - * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. - * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance - * value is higher. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Base types are in the form "int" or "boolean". - * Array types are in the qualified form "M[]" or "int[]". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - * - * NOTE: parameter names can be retrieved from the source model after the user selects a specific method. - * - * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Code assist notification of a modifier completion. - * - * @param modifierName The new modifier. - * @param completionStart The start position of insertion of the name of this new modifier. - * @param completionEnd The end position of insertion of the name of this new modifier. - * @param relevance The relevance of the completion proposal - * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. - * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance - * value is higher. - * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. - - - - - - - - - - - - - - * Code assist notification of a package completion. - * - * @param packageName The package name. - * @param completionName The completion for the package. Can include '.*;' for imports. - * @param completionStart The start position of insertion of the name of this new package. - * @param completionEnd The end position of insertion of the name of this new package. - * @param relevance The relevance of the completion proposal - * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. - * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance - * value is higher. - * - * NOTE - All package names are presented in their readable form: - * Package names are in the form "a.b.c". - * The default package is represented by an empty array. - * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. - - - - - - - - - - - - - - - - - - * Code assist notification of a type completion. - * - * @param packageName Declaring package name of the type. - * @param typeName Name of the type. - * @param completionName The completion for the type. Can include ';' for imported types. - * @param completionStart The start position of insertion of the name of the type. - * @param completionEnd The end position of insertion of the name of the type. - * @param relevance The relevance of the completion proposal - * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. - * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance - * value is higher. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. - - - - - - - - - - - - - - - - - - - - - - * Code assist notification of a variable name completion. - * - * @param typePackageName Name of the package in which the type of this variable is declared. - * @param typeName Name of the type of this variable. - * @param name Name of the variable. - * @param completionName The completion for the variable. - * @param completionStart The start position of insertion of the name of this variable. - * @param completionEnd The end position of insertion of the name of this variable. - * @param relevance The relevance of the completion proposal - * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. - * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance - * value is higher. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Base types are in the form "int" or "boolean". - * Array types are in the qualified form "M[]" or "int[]". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. - - - - - - - - - - - - - - - - - - - - - - - - - - - * A callback interface for receiving java problem correction. - * - * @since 2.0 - - - - - - * Notification of a class correction. - * - * @param packageName Declaring package name of the class. - * @param className Name of the class. - * @param correctionName The correction for the class. - * @param modifiers The modifiers of the class. - * @param correctionStart The start position of insertion of the correction of the class. - * @param correctionEnd The end position of insertion of the correction of the class. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - - - - - - - - - - - - - - - - - - - - - - * Notification of a field correction. - * - * @param declaringTypePackageName Name of the package in which the type that contains this field is declared. - * @param declaringTypeName Name of the type declaring this field. - * @param name Name of the field. - * @param typePackageName Name of the package in which the type of this field is declared. - * @param typeName Name of the type of this field. - * @param correctionName The correction for the field. - * @param modifiers The modifiers of this field. - * @param correctionStart The start position of insertion of the correction of this field. - * @param correctionEnd The end position of insertion of the correction of this field. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Base types are in the form "int" or "boolean". - * Array types are in the qualified form "M[]" or "int[]". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Notification of an interface correction. - * - * @param packageName Declaring package name of the interface. - * @param interfaceName Name of the interface. - * @param correctionName The correction for the interface. - * Can include ';' for imported interfaces. - * @param modifiers The modifiers of the interface. - * @param correctionStart The start position of insertion of the correction of the interface. - * @param correctionEnd The end position of insertion of the correction of the interface. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - - - - - - - - - - - - - - - - - - - - - - * Notification of a local variable correction. - * - * @param name Name of the local variable. - * @param typePackageName Name of the package in which the type of this local variable is declared. - * @param typeName Name of the type of this local variable. - * @param modifiers The modifiers of this local variable. - * @param correctionStart The start position of insertion of the correction of this local variable. - * @param correctionEnd The end position of insertion of the correction of this local variable. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Base types are in the form "int" or "boolean". - * Array types are in the qualified form "M[]" or "int[]". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - - - - - - - - - - - - - - - - - - - - - - * Notification of a method correction. - * - * @param declaringTypePackageName Name of the package in which the type that contains this method is declared. - * @param declaringTypeName Name of the type declaring this method. - * @param selector Name of the method. - * @param parameterPackageNames Names of the packages in which the parameter types are declared. - * Should contain as many elements as parameterTypeNames. - * @param parameterTypeNames Names of the parameter types. - * Should contain as many elements as parameterPackageNames. - * @param parameterNames Names of the parameters. - * Should contain as many elements as parameterPackageNames. - * @param returnTypePackageName Name of the package in which the return type is declared. - * @param returnTypeName Name of the return type of this method, should be <code>null</code> for a constructor. - * @param correctionName The correction for the method. - * Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it. - * @param modifiers The modifiers of this method. - * @param correctionStart The start position of insertion of the correction of this method. - * @param correctionEnd The end position of insertion of the correction of this method. - * - * NOTE - All package and type names are presented in their readable form: - * Package names are in the form "a.b.c". - * Base types are in the form "int" or "boolean". - * Array types are in the qualified form "M[]" or "int[]". - * Nested type names are in the qualified form "A.M". - * The default package is represented by an empty array. - * - * NOTE: parameter names can be retrieved from the source model after the user selects a specific method. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Notification of a package correction. - * - * @param packageName The package name. - * @param correctionName The correction for the package. - * Can include '.*;' for imports. - * @param correctionStart The start position of insertion of the correction of this package. - * @param correctionEnd The end position of insertion of the correction of this package. - * - * NOTE - All package names are presented in their readable form: - * Package names are in the form "a.b.c". - * The default package is represented by an empty array. - - - - - - - - - - - - - - - - - - * An element changed listener receives notification of changes to Java elements - * maintained by the Java model. - * <p> - * This interface may be implemented by clients. - * </p> - - - - - - * Notifies that one or more attributes of one or more Java elements have changed. - * The specific details of the change are described by the given event. - * - * @param event the change event - - - - - - - - - * Represents a field declared in a type. - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - * Returns the constant value associated with this field - * or <code>null</code> if this field has none. The field needs to be static and final to have - * a constant value. - * Returns an instance of the wrapper type corresponding to the the type of the field. - * <table border="1"> - * <tr> - * <th>field type</th> - * <th>wrapper type</th> - * </tr> - * <tr> - * <td>int - * </td> - * <td>java.lang.Integer - * </td> - * </tr> - * <tr> - * <td>byte - * </td> - * <td>java.lang.Byte - * </td> - * </tr> - * <tr> - * <td>boolean - * </td> - * <td>java.lang.Boolean - * </td> - * </tr> - * <tr> - * <td>char - * </td> - * <td>java.lang.Character - * </td> - * </tr> - * <tr> - * <td>double - * </td> - * <td>java.lang.Double - * </td> - * </tr> - * <tr> - * <td>float - * </td> - * <td>java.lang.Float - * </td> - * </tr> - * <tr> - * <td>long - * </td> - * <td>java.lang.Long - * </td> - * </tr> - * <tr> - * <td>short - * </td> - * <td>java.lang.Short - * </td> - * </tr> - * <tr> - * <td>java.lang.String - * </td> - * <td>java.lang.String - * </td> - * </tr> - * </table> - * - * @return the constant value associated with this field or <code>null</code> if this field has none. - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - * Returns the simple name of this field. - * @return the simple name of this field. - - - - - - - - * Returns the binding key for this field only if the given field is {@link #isResolved() resolved}. - * A binding key is a key that uniquely identifies this field. It allows access to generic info - * for parameterized fields. - * - * <p>If the given field is not resolved, the returned key is simply the java element's key. - * </p> - * @return the binding key for this field - * @see org.eclipse.jdt.core.dom.IBinding#getKey() - * @see BindingKey - * @see #isResolved() - * @since 3.1 - - - - - - - - * Returns the type signature of this field. For enum constants, - * this returns the signature of the declaring enum class. - * <p> - * The type signature may be either unresolved (for source types) - * or resolved (for binary types), and either basic (for basic types) - * or rich (for parameterized types). See {@link Signature} for details. - * </p> - * - * @return the type signature of this field - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - * @see Signature - - - - - - - - * Returns whether this field represents an enum constant. - * - * @return whether this field represents an enum constant - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - * @since 3.1 - - - - - - - - * Returns whether this field represents a resolved field. - * If a field is resolved, its key contains resolved information. - * - * @return whether this field represents a resolved field. - * @since 3.1 - - - - - - - - - * Represents an import container is a child of a Java compilation unit that contains - * all (and only) the import declarations. If a compilation unit has no import - * declarations, no import container will be present. - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - - * Returns the first import declaration in this import container with the given name. - * This is a handle-only method. The import declaration may or may not exist. - * - * @param name the given name - * - * @return the first import declaration in this import container with the given name - - - - - - - - - - * Represents an import declaration in Java compilation unit. - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - - * Returns the name that has been imported. - * For an on-demand import, this includes the trailing <code>".*"</code>. - * For example, for the statement <code>"import java.util.*"</code>, - * this returns <code>"java.util.*"</code>. - * For the statement <code>"import java.util.Hashtable"</code>, - * this returns <code>"java.util.Hashtable"</code>. - * - * @return the name that has been imported - - - - - - - - * Returns the modifier flags for this import. The flags can be examined using class - * <code>Flags</code>. Only the static flag is meaningful for import declarations. - * - * @return the modifier flags for this import - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @see Flags - * @since 3.0 - - - - - - - - * Returns whether the import is on-demand. An import is on-demand if it ends - * with <code>".*"</code>. - * @return true if the import is on-demand, false otherwise - - - - - - - - - * Represents a stand-alone instance or class (static) initializer in a type. - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - * A jar entry corresponding to a non-Java resource in an archive {@link IPackageFragment} or {@link IPackageFragmentRoot}. - * <p> - * One can navigate the non-Java resource tree using the {@link #getChildren()} and {@link #getParent()} methods. - * Jar entry resources are either files ({@link #isFile()} returns true) or directories ({@link #isFile()} returns false). - * Files don't have any children and the returned array is always empty. - * </p><p> - * Jar entry resources that refer to the same element are guaranteed to be equal, but not necessarily identical. - * <p> - * - * @since 3.3 - - - - - - - * Returns the list of children of this jar entry resource. - * Returns an empty array if this jar entry is a file, or if this jar entry is a directory and it has no children. - * - * @return the children of this jar entry resource - - - - - - - - - - - * Returns the full, absolute path of this jar entry resource relative to the archive this jar - * entry belongs to. - * <p> - * A jar entry resource's full path indicates the route from the root of the archive - * to the jar entry resource. Within an archive, there is exactly one such path - * for any given jar entry resource. </p> - * <p> - * The returned path is absolute (i.e. it starts with a separator) and it never has a trailing separator. - * </p> - * - * @return the absolute path of this jar entry resource - - - - - - - - * Returns the parent of this jar entry resource. This is either an {@link IJarEntryResource}, an {@link IPackageFragment} - * or an {@link IPackageFragmentRoot}. - * - * @return the parent of this jar entry resource - - - - - - - - * Returns the package fragment root this jar entry resource belongs to. - * - * @return the package fragment root this jar entry resource belongs to. - - - - - - - - * Common protocol for all elements provided by the Java model. - * Java model elements are exposed to clients as handles to the actual underlying element. - * The Java model may hand out any number of handles for each element. Handles - * that refer to the same element are guaranteed to be equal, but not necessarily identical. - * <p> - * Methods annotated as "handle-only" do not require underlying elements to exist. - * Methods that require underlying elements to exist throw - * a <code>JavaModelException</code> when an underlying element is missing. - * <code>JavaModelException.isDoesNotExist</code> can be used to recognize - * this common special case. - * </p> - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - * Constant representing a Java model (workspace level object). - * A Java element with this type can be safely cast to {@link IJavaModel}. - - - - - - - * Constant representing a Java project. - * A Java element with this type can be safely cast to {@link IJavaProject}. - - - - - - - * Constant representing a package fragment root. - * A Java element with this type can be safely cast to {@link IPackageFragmentRoot}. - - - - - - - * Constant representing a package fragment. - * A Java element with this type can be safely cast to {@link IPackageFragment}. - - - - - - - * Constant representing a Java compilation unit. - * A Java element with this type can be safely cast to {@link ICompilationUnit}. - - - - - - - * Constant representing a class file. - * A Java element with this type can be safely cast to {@link IClassFile}. - - - - - - - * Constant representing a type (a class or interface). - * A Java element with this type can be safely cast to {@link IType}. - - - - - - - * Constant representing a field. - * A Java element with this type can be safely cast to {@link IField}. - - - - - - - * Constant representing a method or constructor. - * A Java element with this type can be safely cast to {@link IMethod}. - - - - - - - * Constant representing a stand-alone instance or class initializer. - * A Java element with this type can be safely cast to {@link IInitializer}. - - - - - - - * Constant representing a package declaration within a compilation unit. - * A Java element with this type can be safely cast to {@link IPackageDeclaration}. - - - - - - - * Constant representing all import declarations within a compilation unit. - * A Java element with this type can be safely cast to {@link IImportContainer}. - - - - - - - * Constant representing an import declaration within a compilation unit. - * A Java element with this type can be safely cast to {@link IImportDeclaration}. - - - - - - - * Constant representing a local variable declaration. - * A Java element with this type can be safely cast to {@link ILocalVariable}. - * @since 3.0 - - - - - - - * Constant representing a type parameter declaration. - * A Java element with this type can be safely cast to {@link ITypeParameter}. - * @since 3.1 - - - - - - - * Constant representing an annotation. - * A Java element with this type can be safely cast to {@link IAnnotation}. - * @since 3.4 - - - - - - - * Returns whether this Java element exists in the model. - * <p> - * Java elements are handle objects that may or may not be backed by an - * actual element. Java elements that are backed by an actual element are - * said to "exist", and this method returns <code>true</code>. For Java - * elements that are not working copies, it is always the case that if the - * element exists, then its parent also exists (provided it has one) and - * includes the element as one of its children. It is therefore possible - * to navigated to any existing Java element from the root of the Java model - * along a chain of existing Java elements. On the other hand, working - * copies are said to exist until they are destroyed (with - * <code>IWorkingCopy.destroy</code>). Unlike regular Java elements, a - * working copy never shows up among the children of its parent element - * (which may or may not exist). - * </p> - * - * @return <code>true</code> if this element exists in the Java model, and - * <code>false</code> if this element does not exist - - - - - - - - * Returns the first ancestor of this Java element that has the given type. - * Returns <code>null</code> if no such an ancestor can be found. - * This is a handle-only method. - * - * @param ancestorType the given type - * @return the first ancestor of this Java element that has the given type, null if no such an ancestor can be found - * @since 2.0 - - - - - - - - - * <p>Returns the Javadoc as an html source if this element has an attached javadoc, - * null otherwise.</p> - * <p>This should be used only for binary elements. Source elements will always return null.</p> - * <p>The encoding used to read the javadoc is the one defined by the content type of the - * file. If none is defined, then the project's encoding of this java element is used. If the project's - * encoding cannot be retrieved, then the platform encoding is used.</p> - * <p>In case of the javadoc doesn't exist for this element, null is returned.</p> - * - * <p>The html is extracted from the attached javadoc and provided as is. No - * transformation or validation is done.</p> - * - * @param monitor the given progress monitor - * @exception JavaModelException if:<ul> - * <li>this element does not exist</li> - * <li>retrieving the attached javadoc fails (timed-out, invalid URL, ...)</li> - * <li>the format of the javadoc doesn't match expected standards (different anchors,...)</li> - * </ul> - * @return the extracted javadoc from the attached javadoc, null if none - * @see IClasspathAttribute#JAVADOC_LOCATION_ATTRIBUTE_NAME - * @since 3.2 - - - - - - - - - * Returns the resource that corresponds directly to this element, - * or <code>null</code> if there is no resource that corresponds to - * this element. - * <p> - * For example, the corresponding resource for an <code>ICompilationUnit</code> - * is its underlying <code>IFile</code>. The corresponding resource for - * an <code>IPackageFragment</code> that is not contained in an archive - * is its underlying <code>IFolder</code>. An <code>IPackageFragment</code> - * contained in an archive has no corresponding resource. Similarly, there - * are no corresponding resources for <code>IMethods</code>, - * <code>IFields</code>, etc. - * <p> - * - * @return the corresponding resource, or <code>null</code> if none - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - * Returns the name of this element. This is a handle-only method. - * - * @return the element name - - - - - - - - * Returns this element's kind encoded as an integer. - * This is a handle-only method. - * - * @return the kind of element; one of the constants declared in - * <code>IJavaElement</code> - * @see IJavaElement - - - - - - - - * Returns a string representation of this element handle. The format of - * the string is not specified; however, the identifier is stable across - * workspace sessions, and can be used to recreate this handle via the - * <code>JavaCore.create(String)</code> method. - * - * @return the string handle identifier - * @see JavaCore#create(java.lang.String) - - - - - - - - * Returns the Java model. - * This is a handle-only method. - * - * @return the Java model - - - - - - - - * Returns the Java project this element is contained in, - * or <code>null</code> if this element is not contained in any Java project - * (for instance, the <code>IJavaModel</code> is not contained in any Java - * project). - * This is a handle-only method. - * - * @return the containing Java project, or <code>null</code> if this element is - * not contained in a Java project - - - - - - - - * Returns the first openable parent. If this element is openable, the element - * itself is returned. Returns <code>null</code> if this element doesn't have - * an openable parent. - * This is a handle-only method. - * - * @return the first openable parent or <code>null</code> if this element doesn't have - * an openable parent. - * @since 2.0 - - - - - - - - * Returns the element directly containing this element, - * or <code>null</code> if this element has no parent. - * This is a handle-only method. - * - * @return the parent element, or <code>null</code> if this element has no parent - - - - - - - - * Returns the path to the innermost resource enclosing this element. - * If this element is not included in an external library, - * the path returned is the full, absolute path to the underlying resource, - * relative to the workbench. - * If this element is included in an external library, - * the path returned is the absolute path to the archive or to the - * folder in the file system. - * This is a handle-only method. - * - * @return the path to the innermost resource enclosing this element - * @since 2.0 - - - - - - - - * Returns the primary element (whose compilation unit is the primary compilation unit) - * this working copy element was created from, or this element if it is a descendant of a - * primary compilation unit or if it is not a descendant of a working copy (e.g. it is a - * binary member). - * The returned element may or may not exist. - * - * @return the primary element this working copy element was created from, or this - * element. - * @since 3.0 - - - - - - - - * Returns the innermost resource enclosing this element. - * If this element is included in an archive and this archive is not external, - * this is the underlying resource corresponding to the archive. - * If this element is included in an external library, <code>null</code> - * is returned. - * This is a handle-only method. - * - * @return the innermost resource enclosing this element, <code>null</code> if this - * element is included in an external archive - * @since 2.0 - - - - - - - - * Returns the scheduling rule associated with this Java element. - * This is a handle-only method. - * - * @return the scheduling rule associated with this Java element - * @since 3.0 - - - - - - - - * Returns the smallest underlying resource that contains - * this element, or <code>null</code> if this element is not contained - * in a resource. - * - * @return the underlying resource, or <code>null</code> if none - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its underlying resource - - - - - - - - * Returns whether this Java element is read-only. An element is read-only - * if its structure cannot be modified by the java model. - * <p> - * Note this is different from IResource.isReadOnly(). For example, .jar - * files are read-only as the java model doesn't know how to add/remove - * elements in this file, but the underlying IFile can be writable. - * <p> - * This is a handle-only method. - * - * @return <code>true</code> if this element is read-only - - - - - - - - - - - - * A Java element delta describes changes in Java element between two discrete - * points in time. Given a delta, clients can access the element that has - * changed, and any children that have changed. - * <p> - * Deltas have a different status depending on the kind of change they represent. - * The list below summarizes each status (as returned by {@link #getKind}) - * and its meaning (see individual constants for a more detailled description): - * <ul> - * <li>{@link #ADDED} - The element described by the delta has been added.</li> - * <li>{@link #REMOVED} - The element described by the delta has been removed.</li> - * <li>{@link #CHANGED} - The element described by the delta has been changed in some way. - * Specification of the type of change is provided by {@link #getFlags} which returns the following values: - * <ul> - * <li>{@link #F_ADDED_TO_CLASSPATH} - A classpath entry corresponding to the element - * has been added to the project's classpath. This flag is only valid if the element is an - * {@link IPackageFragmentRoot}.</li> - * <li>{@link #F_ARCHIVE_CONTENT_CHANGED} - The contents of an archive - * has changed in some way. This flag is only valid if the element is an {@link IPackageFragmentRoot} - * which is an archive.</li> - * <li>{@link #F_CHILDREN} - A child of the element has changed in some way. This flag - * is only valid if the element is an {@link IParent}.</li> - * <li>{@link #F_CLASSPATH_REORDER} - A classpath entry corresponding to the element - * has changed position in the project's classpath. This flag is only valid if the element is an - * {@link IPackageFragmentRoot}.</li> - * <li>{@link #F_CLOSED} - The underlying {@link org.eclipse.core.resources.IProject} - * has been closed. This flag is only valid if the element is an {@link IJavaProject}.</li> - * <li>{@link #F_CONTENT} - The contents of the element have been altered. This flag - * is only valid for elements which correspond to files.</li> - *<li>{@link #F_FINE_GRAINED} - The delta is a fine-grained delta, that is, an analysis down - * to the members level was done to determine if there were structural changes to members of the element.</li> - * <li>{@link #F_MODIFIERS} - The modifiers on the element have changed in some way. - * This flag is only valid if the element is an {@link IMember}.</li> - * <li>{@link #F_OPENED} - The underlying {@link org.eclipse.core.resources.IProject} - * has been opened. This flag is only valid if the element is an {@link IJavaProject}.</li> - * <li>{@link #F_REMOVED_FROM_CLASSPATH} - A classpath entry corresponding to the element - * has been removed from the project's classpath. This flag is only valid if the element is an - * {@link IPackageFragmentRoot}.</li> - * <li>{@link #F_SOURCEATTACHED} - The source attachment path or the source attachment root path - * of a classpath entry corresponding to the element was added. This flag is only valid if the element is an - * {@link IPackageFragmentRoot}.</li> - * <li>{@link #F_SOURCEDETACHED} - The source attachment path or the source attachment root path - * of a classpath entry corresponding to the element was removed. This flag is only valid if the element is an - * {@link IPackageFragmentRoot}.</li> - * <li>{@link #F_SUPER_TYPES} - One of the supertypes of an {@link IType} has changed</li>. - * </ul> - * </li> - * </ul> - * </p> - * <p> - * Move operations are indicated by other change flags, layered on top - * of the change flags described above. If element A is moved to become B, - * the delta for the change in A will have status {@link #REMOVED}, - * with change flag {@link #F_MOVED_TO}. In this case, - * {@link #getMovedToElement} on delta A will return the handle for B. - * The delta for B will have status {@link #ADDED}, with change flag - * {@link #F_MOVED_FROM}, and {@link #getMovedFromElement} on delta - * B will return the handle for A. (Note, the handle to A in this case represents - * an element that no longer exists). - * </p> - * <p> - * Note that the move change flags only describe the changes to a single element, they - * do not imply anything about the parent or children of the element. - * </p> - * <p> - * The {@link #F_ADDED_TO_CLASSPATH}, {@link #F_REMOVED_FROM_CLASSPATH} and - * {@link #F_CLASSPATH_REORDER} flags are triggered by changes to a project's classpath. They do not mean that - * the underlying resource was added, removed or changed. For example, if a project P already contains a folder src, then - * adding a classpath entry with the 'P/src' path to the project's classpath will result in an {@link IJavaElementDelta} - * with the {@link #F_ADDED_TO_CLASSPATH} flag for the {@link IPackageFragmentRoot} P/src. - * On the contrary, if a resource is physically added, removed or changed and this resource corresponds to a classpath - * entry of the project, then an {@link IJavaElementDelta} with the {@link #ADDED}, - * {@link #REMOVED}, or {@link #CHANGED} kind will be fired. - * </p> - * <p> - * Note that when a source attachment path or a source attachment root path is changed, then the flags of the delta contain - * both {@link #F_SOURCEATTACHED} and {@link #F_SOURCEDETACHED}. - * </p> - * <p> - * No assumptions should be made on whether the java element delta tree is rooted at the {@link IJavaModel} - * level or not. - * </p> - * <p> - * {@link IJavaElementDelta} object are not valid outside the dynamic scope - * of the notification. - * </p> - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - * Status constant indicating that the element has been added. - * Note that an added java element delta has no children, as they are all implicitely added. - - - - - - - * Status constant indicating that the element has been removed. - * Note that a removed java element delta has no children, as they are all implicitely removed. - - - - - - - * Status constant indicating that the element has been changed, - * as described by the change flags. - * - * @see #getFlags() - - - - - - - * Change flag indicating that the content of the element has changed. - * This flag is only valid for elements which correspond to files. - - - - - - - * Change flag indicating that the modifiers of the element have changed. - * This flag is only valid if the element is an {@link IMember}. - - - - - - - * Change flag indicating that there are changes to the children of the element. - * This flag is only valid if the element is an {@link IParent}. - - - - - - - * Change flag indicating that the element was moved from another location. - * The location of the old element can be retrieved using {@link #getMovedFromElement}. - - - - - - - * Change flag indicating that the element was moved to another location. - * The location of the new element can be retrieved using {@link #getMovedToElement}. - - - - - - - * Change flag indicating that a classpath entry corresponding to the element has been added to the project's classpath. - * This flag is only valid if the element is an {@link IPackageFragmentRoot}. - - - - - - - * Change flag indicating that a classpath entry corresponding to the element has been removed from the project's - * classpath. This flag is only valid if the element is an {@link IPackageFragmentRoot}. - - - - - - - * Change flag indicating that a classpath entry corresponding to the element has changed position in the project's - * classpath. This flag is only valid if the element is an {@link IPackageFragmentRoot}. - * @deprecated Use {@link #F_REORDER} instead. - - - - - - - * Change flag indicating that the element has changed position relatively to its siblings. - * If the element is an {@link IPackageFragmentRoot}, a classpath entry corresponding - * to the element has changed position in the project's classpath. - * - * @since 2.1 - - - - - - - * Change flag indicating that the underlying {@link org.eclipse.core.resources.IProject} has been - * opened. This flag is only valid if the element is an {@link IJavaProject}. - - - - - - - * Change flag indicating that the underlying {@link org.eclipse.core.resources.IProject} has been - * closed. This flag is only valid if the element is an {@link IJavaProject}. - - - - - - - * Change flag indicating that one of the supertypes of an {@link IType} - * has changed. - - - - - - - * Change flag indicating that the source attachment path or the source attachment root path of a classpath entry - * corresponding to the element was added. This flag is only valid if the element is an - * {@link IPackageFragmentRoot}. - - - - - - - * Change flag indicating that the source attachment path or the source attachment root path of a classpath entry - * corresponding to the element was removed. This flag is only valid if the element is an - * {@link IPackageFragmentRoot}. - - - - - - - * Change flag indicating that this is a fine-grained delta, that is, an analysis down - * to the members level was done to determine if there were structural changes to - * members. - * <p> - * Clients can use this flag to find out if a compilation unit - * that have a {@link #F_CONTENT} change should assume that there are - * no finer grained changes ({@link #F_FINE_GRAINED} is set) or if - * finer grained changes were not considered ({@link #F_FINE_GRAINED} - * is not set). - * - * @since 2.0 - - - - - - - * Change flag indicating that the element's archive content on the classpath has changed. - * This flag is only valid if the element is an {@link IPackageFragmentRoot} - * which is an archive. - * - * @see IPackageFragmentRoot#isArchive() - * @since 2.0 - - - - - - - * Change flag indicating that a compilation unit has become a primary working copy, or that a - * primary working copy has reverted to a compilation unit. - * This flag is only valid if the element is an {@link ICompilationUnit}. - * - * @since 3.0 - - - - - - - * Change flag indicating that the {@link IJavaProject#getRawClasspath() raw classpath} - * (or the {@link IJavaProject#getOutputLocation() output folder}) of a project has changed. - * This flag is only valid if the element is an {@link IJavaProject}. - * Also see {@link #F_RESOLVED_CLASSPATH_CHANGED}, which indicates that there is a - * change to the {@link IJavaProject#getResolvedClasspath(boolean) resolved class path}. - * The resolved classpath can change without the raw classpath changing (e.g. - * if a container resolves to a different set of classpath entries). - * And conversely, it is possible to construct a case where the raw classpath - * can change without the resolved classpath changing. - * - * @since 3.0 - - - - - - - * Change flag indicating that the resource of a primary compilation unit has changed. - * This flag is only valid if the element is a primary {@link ICompilationUnit}. - * - * @since 3.0 - - - - - - - * Change flag indicating that a reconcile operation has affected the compilation unit AST created in a - * previous reconcile operation. Use {@link #getCompilationUnitAST()} to retrieve the AST (if any is available). - * This flag is only valid if the element is an {@link ICompilationUnit} in working copy mode. - * - * @since 3.2 - - - - - - - * Change flag indicating that the categories of the element have changed. - * This flag is only valid if the element is an {@link IMember}. - * - * @since 3.2 - - - - - - - * Change flag indicating that the {@link IJavaProject#getResolvedClasspath(boolean) - * resolved classpath} of a project has changed. - * This flag is only valid if the element is an {@link IJavaProject}. - * Also see {@link #F_CLASSPATH_CHANGED}, which indicates that there is a - * change to the {@link IJavaProject#getRawClasspath() raw class path}. - * The resolved classpath can change without the raw classpath changing (e.g. - * if a container resolves to a different set of classpath entries). - * And conversely, it is possible to construct a case where the raw classpath - * can change without the resolved classpath changing. - * - * @since 3.4 - - - - - - - * Change flag indicating that the annotations of the element have changed. - * Use {@link #getAnnotationDeltas()} to get the added/removed/changed annotations. - * This flag is only valid if the element is an {@link IAnnotatable}. - * - * @since 3.4 - - - - - - - * Returns deltas for the children that have been added. - * @return deltas for the children that have been added - - - - - - - - - - - * Returns deltas for the affected (added, removed, or changed) children. - * @return deltas for the affected (added, removed, or changed) children - - - - - - - - - - - * Returns deltas for affected annotations (added, removed, or changed). - * Returns an empty array if no annotations was affected, or if this delta's element is not - * an {@link IAnnotatable}. - * - * @return deltas for affected annotations (added, removed, or changed) - * - * @since 3.4 - - - - - - - - - - - * Returns the compilation unit AST created by the last reconcile operation on this delta's element. - * This returns a non-null value if and only if: - * <ul> - * <li>the last reconcile operation on this working copy requested an AST</li> - * <li>this delta's element is an {@link ICompilationUnit} in working copy mode</li> - * <li>the delta comes from a {@link ElementChangedEvent#POST_RECONCILE} event - * </ul> - * - * @return the AST created during the last reconcile operation - * @see ICompilationUnit#reconcile(int, boolean, WorkingCopyOwner, org.eclipse.core.runtime.IProgressMonitor) - * @see #F_AST_AFFECTED - * @since 3.2 - - - - - - - - * Returns deltas for the children which have changed. - * @return deltas for the children which have changed - - - - - - - - - - - * Returns the element that this delta describes a change to. - * @return the element that this delta describes a change to - - - - - - - - * Returns flags that describe how an element has changed. - * Such flags should be tested using the <code>&</code> operand. For example: - * <pre> - * if ((delta.getFlags() & IJavaElementDelta.F_CONTENT) != 0) { - * // the delta indicates a content change - * } - * </pre> - * - * @return flags that describe how an element has changed - - - - - - - - * Returns the kind of this delta - one of {@link #ADDED}, {@link #REMOVED}, - * or {@link #CHANGED}. - * - * @return the kind of this delta - - - - - - - - * Returns an element describing this element before it was moved - * to its current location, or <code>null</code> if the - * {@link #F_MOVED_FROM} change flag is not set. - * - * @return an element describing this element before it was moved - * to its current location, or <code>null</code> if the - * {@link #F_MOVED_FROM} change flag is not set - - - - - - - - * Returns an element describing this element in its new location, - * or <code>null</code> if the {@link #F_MOVED_TO} change - * flag is not set. - * - * @return an element describing this element in its new location, - * or <code>null</code> if the {@link #F_MOVED_TO} change - * flag is not set - - - - - - - - * Returns deltas for the children which have been removed. - * - * @return deltas for the children which have been removed - - - - - - - - - - - * Returns the collection of resource deltas. - * <p> - * Note that resource deltas, like Java element deltas, are generally only valid - * for the dynamic scope of an event notification. Clients must not hang on to - * these objects. - * </p> - * - * @return the underlying resource deltas, or <code>null</code> if none - - - - - - - - - - - - - - - * Represent the root Java element corresponding to the workspace. - * Since there is only one such root element, it is commonly referred to as - * <em>the</em> Java model element. - * The Java model element needs to be opened before it can be navigated or manipulated. - * The Java model element has no parent (it is the root of the Java element - * hierarchy). Its children are <code>IJavaProject</code>s. - * <p> - * This interface provides methods for performing copy, move, rename, and - * delete operations on multiple Java elements. - * </p> - * <p> - * An instance of one of these handles can be created via - * <code>JavaCore.create(workspace.getRoot())</code>. - * </p> - * - * @see JavaCore#create(org.eclipse.core.resources.IWorkspaceRoot) - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - - * Returns whether this Java model contains an <code>IJavaElement</code> whose - * resource is the given resource or a non-Java resource which is the given resource. - * <p> - * Note: no existency check is performed on the argument resource. If it is not accessible - * (see <code>IResource.isAccessible()</code>) yet but would be located in Java model - * range, then it will return <code>true</code>. - * </p><p> - * If the resource is accessible, it can be reached by navigating the Java model down using the - * <code>getChildren()</code> and/or <code>getNonJavaResources()</code> methods. - * </p> - * @param resource the resource to check - * @return true if the resource is accessible through the Java model - * @since 2.1 - - - - - - - - - * Copies the given elements to the specified container(s). - * If one container is specified, all elements are copied to that - * container. If more than one container is specified, the number of - * elements and containers must match, and each element is copied to - * its associated container. - * <p> - * Optionally, each copy can positioned before a sibling - * element. If <code>null</code> is specified for a given sibling, the copy - * is inserted as the last child of its associated container. - * </p> - * <p> - * Optionally, each copy can be renamed. If - * <code>null</code> is specified for the new name, the copy - * is not renamed. - * </p> - * <p> - * Optionally, any existing child in the destination container with - * the same name can be replaced by specifying <code>true</code> for - * force. Otherwise an exception is thrown in the event that a name - * collision occurs. - * </p> - * - * @param elements the elements to copy - * @param containers the container, or list of containers - * @param siblings the list of siblings element any of which may be - * <code>null</code>; or <code>null</code> - * @param renamings the list of new names any of which may be - * <code>null</code>; or <code>null</code> - * @param replace <code>true</code> if any existing child in a target container - * with the target name should be replaced, and <code>false</code> to throw an - * exception in the event of a name collision - * @param monitor a progress monitor - * @exception JavaModelException if an element could not be copied. Reasons include: - * <ul> - * <li> There is no element to process (NO_ELEMENTS_TO_PROCESS). The given elements is null or empty</li> - * <li> A specified element, container, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while updating an underlying resource</li> - * <li> A container is of an incompatible type (<code>INVALID_DESTINATION</code>)</li> - * <li> A sibling is not a child of it associated container (<code>INVALID_SIBLING</code>)</li> - * <li> A new name is invalid (<code>INVALID_NAME</code>)</li> - * <li> A child in its associated container already exists with the same - * name and <code>replace</code> has been specified as <code>false</code> (<code>NAME_COLLISION</code>)</li> - * <li> A container or element is read-only (<code>READ_ONLY</code>) </li> - * </ul> - * @see org.eclipse.jdt.core.IJavaModelStatusConstants#INVALID_DESTINATION - - - - - - - - - - - - - - - - - - - - - - - - - * Deletes the given elements, forcing the operation if necessary and specified. - * - * @param elements the elements to delete - * @param force a flag controlling whether underlying resources that are not - * in sync with the local file system will be tolerated - * @param monitor a progress monitor - * @exception JavaModelException if an element could not be deleted. Reasons include: - * <ul> - * <li> There is no element to process (NO_ELEMENTS_TO_PROCESS). The given elements is null or empty</li> - * <li> A specified element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while updating an underlying resource</li> - * <li> An element is read-only (<code>READ_ONLY</code>) </li> - * </ul> - - - - - - - - - - - - - * Returns the Java project with the given name. The given name must be a valid - * path segment as defined by {@link IPath#isValidSegment(String)}. - * This is a handle-only method. - * The project may or may not exist. - * - * @param name the name of the Java project - * @return the Java project with the given name - - - - - - - - - * Returns the Java projects in this Java model, or an empty array if there - * are none. - * - * @return the Java projects in this Java model, or an empty array if there - * are none - * @exception JavaModelException if this request fails. - - - - - - - - - - - * Returns an array of non-Java resources (that is, non-Java projects) in - * the workspace. - * <p> - * Non-Java projects include all projects that are closed (even if they have the - * Java nature). - * </p> - * - * @return an array of non-Java projects (<code>IProject</code>s) contained - * in the workspace. - * @throws JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - * @since 2.1 - - - - - - - - - - - * Returns the workspace associated with this Java model. - * - * @return the workspace associated with this Java model - - - - - - - - * Moves the given elements to the specified container(s). - * If one container is specified, all elements are moved to that - * container. If more than one container is specified, the number of - * elements and containers must match, and each element is moved to - * its associated container. - * <p> - * Optionally, each element can positioned before a sibling - * element. If <code>null</code> is specified for sibling, the element - * is inserted as the last child of its associated container. - * </p> - * <p> - * Optionally, each element can be renamed. If - * <code>null</code> is specified for the new name, the element - * is not renamed. - * </p> - * <p> - * Optionally, any existing child in the destination container with - * the same name can be replaced by specifying <code>true</code> for - * force. Otherwise an exception is thrown in the event that a name - * collision occurs. - * </p> - * - * @param elements the elements to move - * @param containers the container, or list of containers - * @param siblings the list of siblings element any of which may be - * <code>null</code>; or <code>null</code> - * @param renamings the list of new names any of which may be - * <code>null</code>; or <code>null</code> - * @param replace <code>true</code> if any existing child in a target container - * with the target name should be replaced, and <code>false</code> to throw an - * exception in the event of a name collision - * @param monitor a progress monitor - * @exception JavaModelException if an element could not be moved. Reasons include: - * <ul> - * <li> There is no element to process (NO_ELEMENTS_TO_PROCESS). The given elements is null or empty</li> - * <li> A specified element, container, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while updating an underlying resource</li> - * <li> A container is of an incompatible type (<code>INVALID_DESTINATION</code>)</li> - * <li> A sibling is not a child of it associated container (<code>INVALID_SIBLING</code>)</li> - * <li> A new name is invalid (<code>INVALID_NAME</code>)</li> - * <li> A child in its associated container already exists with the same - * name and <code>replace</code> has been specified as <code>false</code> (<code>NAME_COLLISION</code>)</li> - * <li> A container or element is read-only (<code>READ_ONLY</code>) </li> - * </ul> - * - * @exception IllegalArgumentException any element or container is <code>null</code> - * @see org.eclipse.jdt.core.IJavaModelStatusConstants#INVALID_DESTINATION - - - - - - - - - - - - - - - - - - - - - - - - - * Triggers an update of the JavaModel with respect to the referenced external archives. - * This operation will issue a JavaModel delta describing the discovered changes, in term - * of Java element package fragment roots added, removed or changed. - * Note that a collection of elements can be passed so as to narrow the set of archives - * to refresh (passing <code>null</code> along is equivalent to refreshing the entire mode). - * The elements can be: - * <ul> - * <li> package fragment roots corresponding to external archives - * <li> Java projects, which referenced external archives will be refreshed - * <li> Java model, all referenced external archives will be refreshed. - * </ul> - * <p> In case an archive is used by multiple projects, the delta issued will account for - * all of them. This means that even if a project was not part of the elements scope, it - * may still be notified of changes if it is referencing a library comprised in the scope. - * <p> - * <b>Since 3.7</b>, a project refresh automatically triggers a refresh of external archives. - * Hence, this method doesn't need to be explicitly called after a project refresh. - * <p> - * @param elementsScope - a collection of elements defining the scope of the refresh - * @param monitor - a progress monitor used to report progress - * @exception JavaModelException in one of the corresponding situation: - * <ul> - * <li> an exception occurs while accessing project resources </li> - * </ul> - * - * @see IJavaElementDelta - * @since 2.0 - - - - - - - - - - - - * Renames the given elements as specified. - * If one container is specified, all elements are renamed within that - * container. If more than one container is specified, the number of - * elements and containers must match, and each element is renamed within - * its associated container. - * - * @param elements the elements to rename - * @param destinations the container, or list of containers - * @param names the list of new names - * @param replace <code>true</code> if an existing child in a target container - * with the target name should be replaced, and <code>false</code> to throw an - * exception in the event of a name collision - * @param monitor a progress monitor - * @exception JavaModelException if an element could not be renamed. Reasons include: - * <ul> - * <li> There is no element to process (NO_ELEMENTS_TO_PROCESS). The given elements is null or empty</li> - * <li> A specified element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while updating an underlying resource - * <li> A new name is invalid (<code>INVALID_NAME</code>) - * <li> A child already exists with the same name and <code>replace</code> has been specified as <code>false</code> (<code>NAME_COLLISION</code>) - * <li> An element is read-only (<code>READ_ONLY</code>) - * </ul> - - - - - - - - - - - - - - - - - - - - - - * Markers used by the Java model. - * <p> - * This interface declares constants only. - * </p> - * @noimplement This interface is not intended to be implemented by clients. - - - - - - * Java model problem marker type (value - * <code>"org.eclipse.jdt.core.problem"</code>). This can be used to - * recognize those markers in the workspace that flag problems detected by - * the Java tooling during compilation. - - - - - - - * Java model transient problem marker type (value - * <code>"org.eclipse.jdt.core.transient_problem"</code>). This can be - * used to recognize those markers in the workspace that flag transient - * problems detected by the Java tooling (such as a problem detected by the - * outliner, or a problem detected during a code completion). Since 1.0, - * transient problems are reported as <code>IProblem</code> through - * various API. Only the evaluation API is still producing markers for - * transient problems. - * - * @see org.eclipse.jdt.core.compiler.IProblem - * @see org.eclipse.jdt.core.eval.ICodeSnippetRequestor#acceptProblem(org.eclipse.core.resources.IMarker,String, - * int) - - - - - - - * Java model task marker type (value - * <code>"org.eclipse.jdt.core.task"</code>). This can be used to - * recognize task markers in the workspace that correspond to tasks - * specified in Java source comments and detected during compilation (for - * example, 'TO-DO: ...'). Tasks are identified by a task tag, which can be - * customized through <code>JavaCore</code> option - * <code>"org.eclipse.jdt.core.compiler.taskTag"</code>. - * - * @since 2.1 - - - - - - - * Id marker attribute (value <code>"arguments"</code>). Arguments are - * concatenated into one String, prefixed with an argument count (followed - * with colon separator) and separated with '#' characters. For example: { - * "foo", "bar" } is encoded as "2:foo#bar", { } is encoded as "0:". - * <p>Empty argument is encoded as three spaces (" ").</p> - * <p>If the argument contains a '#', the character is doubled.<br> - * {"foo#test", "bar" } is encoded as "2:foo##test#bar" - * </p> - * - * @since 2.0 - * @see CorrectionEngine#getProblemArguments(IMarker) - - - - - - - * ID marker attribute (value <code>"id"</code>). - - - - - - - * ID category marker attribute (value <code>"categoryId"</code>) - * @since 3.2 - - - - - - - * Flags marker attribute (value <code>"flags"</code>). Reserved for - * future use. - - - - - - - * Cycle detected marker attribute (value <code>"cycleDetected"</code>). - * Used only on buildpath problem markers. The value of this attribute is - * either "true" or "false". - - - - - - - * Build path problem marker type (value - * <code>"org.eclipse.jdt.core.buildpath_problem"</code>). This can be - * used to recognize those markers in the workspace that flag problems - * detected by the Java tooling during classpath setting. - - - - - - - * Classpath file format marker attribute (value - * <code>"classpathFileFormat"</code>). Used only on buildpath problem - * markers. The value of this attribute is either "true" or "false". - * - * @since 2.0 - - - - - - - - * Represents the outcome of an Java model operation. Status objects are - * used inside <code>JavaModelException</code> objects to indicate what went - * wrong. - * <p> - * Java model status object are distinguished by their plug-in id: - * <code>getPlugin</code> returns <code>"org.eclipse.jdt.core"</code>. - * <code>getCode</code> returns one of the status codes declared in - * <code>IJavaModelStatusConstants</code>. - * </p> - * <p> - * A Java model status may also carry additional information (that is, in - * addition to the information defined in <code>IStatus</code>): - * <ul> - * <li>elements - optional handles to Java elements associated with the failure</li> - * <li>string - optional string associated with the failure</li> - * </ul> - * - * @see org.eclipse.core.runtime.IStatus - * @see IJavaModelStatusConstants - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - * Returns any Java elements associated with the failure (see specification - * of the status code), or an empty array if no elements are related to this - * particular status code. - * - * @return the list of Java element culprits - * @see IJavaModelStatusConstants - - - - - - - - - - - * Returns the path associated with the failure (see specification - * of the status code), or <code>null</code> if the failure is not - * one of <code>DEVICE_PATH</code>, <code>INVALID_PATH</code>, - * <code>PATH_OUTSIDE_PROJECT</code>, or <code>RELATIVE_PATH</code>. - * - * @return the path that caused the failure, or <code>null</code> if none - * @see IJavaModelStatusConstants#DEVICE_PATH - * @see IJavaModelStatusConstants#INVALID_PATH - * @see IJavaModelStatusConstants#PATH_OUTSIDE_PROJECT - * @see IJavaModelStatusConstants#RELATIVE_PATH - - - - - - - - * Returns the string associated with the failure (see specification - * of the status code), or <code>null</code> if no string is related to this - * particular status code. - * - * @return the string culprit, or <code>null</code> if none - * @see IJavaModelStatusConstants - * @deprecated Use {@link IStatus#getMessage()} instead - - - - - - - - * Returns whether this status indicates that a Java model element does not exist. - * This convenience method is equivalent to - * <code>getCode() == IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST</code>. - * - * @return <code>true</code> if the status code indicates that a Java model - * element does not exist - * @see IJavaModelStatusConstants#ELEMENT_DOES_NOT_EXIST - - - - - - - - - * Status codes used with Java model status objects. - * <p> - * This interface declares constants only. - * </p> - * - * @see IJavaModelStatus - * @see org.eclipse.core.runtime.IStatus#getCode() - * @noimplement This interface is not intended to be implemented by clients. - - - - - - * Status constant indicating that a container path was resolved - * to invalid entries (null or container). - * - * @since 2.0 - - - - - - - * Status constant indicating that a container path was not resolvable - * indicating either the referred container is undefined, unbound. - * - * @since 2.0 - - - - - - - * Status constant indicating that a classpath entry was invalid - - - - - - - * Status constant indicating that a variable path was not resolvable - * indicating either the referred variable is undefined, unbound or the resolved - * variable path does not correspond to an existing file or folder. - - - - - - - * Status constant indicating a core exception occurred. - * Use <code>getException</code> to retrieve a <code>CoreException</code>. - - - - - - - * Status constant indicating one or more of the elements - * supplied are not of a valid type for the operation to - * process. - * The element(s) can be retrieved using <code>getElements</code> on the status object. - - - - - - - * Status constant indicating that no elements were - * provided to the operation for processing. - - - - - - - * Status constant indicating that one or more elements - * supplied do not exist. - * The element(s) can be retrieved using <code>getElements</code> on the status object. - * - * @see IJavaModelStatus#isDoesNotExist() - - - - - - - * Status constant indicating that a <code>null</code> path was - * supplied to the operation. - - - - - - - * Status constant indicating that a path outside of the - * project was supplied to the operation. The path can be retrieved using - * <code>getPath</code> on the status object. - - - - - - - * Status constant indicating that a relative path - * was supplied to the operation when an absolute path is - * required. The path can be retrieved using <code>getPath</code> on the - * status object. - - - - - - - * Status constant indicating that a path specifying a device - * was supplied to the operation when a path with no device is - * required. The path can be retrieved using <code>getPath</code> on the - * status object. - - - - - - - * Status constant indicating that a string - * was supplied to the operation that was <code>null</code>. - - - - - - - * Status constant indicating that the operation encountered - * a read-only element. - * The element(s) can be retrieved using <code>getElements</code> on the status object. - - - - - - - * Status constant indicating that a naming collision would occur - * if the operation proceeded. - - - - - - - * Status constant indicating that a destination provided for a copy/move/rename operation - * is invalid. The destination for a package fragment must be a package fragment root; the - * destination for a compilation unit must be a package fragment; the destination for - * a package declaration or import declaration must be a compilation unit; the - * destination for a type must be a type or compilation unit; the destination for any - * type member (other than a type) must be a type. <br> - * - * The destination element can be retrieved using <code>getElements</code> on the status object. - - - - - - - * Status constant indicating that a path provided to an operation - * is invalid. The path can be retrieved using <code>getPath</code> on the - * status object. - - - - - - - * Status constant indicating the given source position is out of bounds. - - - - - - - * Status constant indicating there is an update conflict - * for a working copy. The compilation unit on which the - * working copy is based has changed since the working copy - * was created. - - - - - - - * Status constant indicating that <code>null</code> was specified - * as a name argument. - - - - - - - * Status constant indicating that a name provided is not syntactically correct. - * The name can be retrieved from <code>getString</code>. - - - - - - - * Status constant indicating that the specified contents - * are not valid. - - - - - - - * Status constant indicating that an <code>java.io.IOException</code> - * occurred. - - - - - - - * Status constant indicating that a <code>DOMException</code> - * occurred. - - - - - - - * Status constant indicating that a <code>TargetException</code> - * occurred. - - - - - - - * Status constant indicating that the Java builder - * could not be initialized. - - - - - - - * Status constant indicating that the Java builder's last built state - * could not be serialized or deserialized. - - - - - - - * Status constant indicating that an error was encountered while - * trying to evaluate a code snippet, or other item. - - - - - - - * Status constant indicating that a sibling specified is not valid. - - - - - - - * Status indicating that a Java element could not be created because - * the underlying resource is invalid. - * @see JavaCore - - - - - - - * Status indicating that a Java element could not be created because - * the underlying resource is not of an appropriate type. - * @see JavaCore - - - - - - - * Status indicating that a Java element could not be created because - * the project owning underlying resource does not have the Java nature. - * @see JavaCore - - - - - - - * Status indicating that the package declaration in a <code>ICompilationUnit</code> - * does not correspond to the <code>IPackageFragment</code> it belongs to. - * The <code>getString</code> method of the associated status object - * gives the name of the package in which the <code>ICompilationUnit</code> is - * declared. - - - - - - - * Status indicating that the corresponding resource has no local contents yet. - * This might happen when attempting to use a resource before its contents - * has been made locally available. - - - - - - - * Status indicating that a .classpath file is ill-formed, and thus cannot - * be read/written successfully. - * @since 2.1 - - - - - - - * Status indicating that a project is involved in a build path cycle. - * @since 2.1 - - - - - - - * Status constant indicating that an inclusion or an exclusion pattern got specified - * on a classpath source entry, though it was explicitely disabled - * according to its project preference settings. - * @see org.eclipse.jdt.core.IJavaProject#getOptions(boolean) - * @since 2.1 - - - - - - - * Status constant indicating that a specific output location got associated - * with a source entry, though it was explicitely disabled according to its project - * preference settings. - * @see org.eclipse.jdt.core.IJavaProject#getOptions(boolean) - * @since 2.1 - - - - - - - * Status constant indicating that a project is prerequisiting some library for which the - * classfile JDK version level is more recent than the project JDK target level setting. - * This can indicate some binary incompatibility issues later on. - * @since 3.0 - - - - - - - * Status constant indicating that a compiler failure occurred. - * @since 3.0 - - - - - - - * Status constant indicating that an element is not on its project's claspath. - * @since 3.1 - - - - - - - * <p>Status constant indicating that the attached javadoc content cannot be retrieved due to multiple reasons: - * invalid url, incorrect proxy, wrong authentication,...</p> - * - * @since 3.2 - - - - - - - * <p>Status constant indicating that the attached javadoc content format is unrecognized.</p> - * - * @since 3.2 - - - - - - - * <p>Status constant indicating that the variable is deprecated.</p> - * - * @since 3.3 - - - - - - - * <p>Status constant indicating that a text edit can not be applied as there - * is a problem with the text edit location.</p> - * - * @since 3.4 - - - - - - - * <p>Status constant indicating that the attached javadoc content cannot be retrieved due to timeout - * @since 3.7 - - - - - - - - * A Java project represents a view of a project resource in terms of Java - * elements such as package fragments, types, methods and fields. - * A project may contain several package roots, which contain package fragments. - * A package root corresponds to an underlying folder or JAR. - * <p> - * Each Java project has a classpath, defining which folders contain source code and - * where required libraries are located. Each Java project also has an output location, - * defining where the builder writes <code>.class</code> files. A project that - * references packages in another project can access the packages by including - * the required project in a classpath entry. The Java model will present the - * source elements in the required project; when building, the compiler will use - * the corresponding generated class files from the required project's output - * location(s)). The classpath format is a sequence of classpath entries - * describing the location and contents of package fragment roots. - * </p> - * Java project elements need to be opened before they can be navigated or manipulated. - * The children of a Java project are the package fragment roots that are - * defined by the classpath and contained in this project (in other words, it - * does not include package fragment roots for other projects). - * </p> - * <p> - * An instance of one of these handles can be created via - * <code>JavaCore.create(project)</code>. - * </p> - * - * @see JavaCore#create(org.eclipse.core.resources.IProject) - * @see IClasspathEntry - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - - * Decodes the classpath entry that has been encoded in the given string - * in the context of this project. - * Returns null if the encoded entry is malformed. - * - * @param encodedEntry the encoded classpath entry - * @return the decoded classpath entry, or <code>null</code> if unable to decode it - * @since 3.2 - - - - - - - - - * Encodes the given classpath entry into a string in the context of this project. - * - * @param classpathEntry the classpath entry to encode - * @return the encoded classpath entry - * @since 3.2 - - - - - - - - - * Returns the <code>IJavaElement</code> corresponding to the given - * classpath-relative path, or <code>null</code> if no such - * <code>IJavaElement</code> is found. The result is one of an - * <code>ICompilationUnit</code>, <code>IClassFile</code>, or - * <code>IPackageFragment</code>. - * <p> - * When looking for a package fragment, there might be several potential - * matches; only one of them is returned. - * - * <p>For example, the path "java/lang/Object.java", would result in the - * <code>ICompilationUnit</code> or <code>IClassFile</code> corresponding to - * "java.lang.Object". The path "java/lang" would result in the - * <code>IPackageFragment</code> for "java.lang". - * @param path the given classpath-relative path - * @exception JavaModelException if the given path is <code>null</code> - * or absolute - * @return the <code>IJavaElement</code> corresponding to the given - * classpath-relative path, or <code>null</code> if no such - * <code>IJavaElement</code> is found - - - - - - - - - * Returns the <code>IJavaElement</code> corresponding to the given - * classpath-relative path, or <code>null</code> if no such - * <code>IJavaElement</code> is found. The result is one of an - * <code>ICompilationUnit</code>, <code>IClassFile</code>, or - * <code>IPackageFragment</code>. If it is an <code>ICompilationUnit</code>, - * its owner is the given owner. - * <p> - * When looking for a package fragment, there might be several potential - * matches; only one of them is returned. - * - * <p>For example, the path "java/lang/Object.java", would result in the - * <code>ICompilationUnit</code> or <code>IClassFile</code> corresponding to - * "java.lang.Object". The path "java/lang" would result in the - * <code>IPackageFragment</code> for "java.lang". - * @param path the given classpath-relative path - * @param owner the owner of the returned compilation unit, ignored if it is - * not a compilation unit. - * @exception JavaModelException if the given path is <code>null</code> - * or absolute - * @return the <code>IJavaElement</code> corresponding to the given - * classpath-relative path, or <code>null</code> if no such - * <code>IJavaElement</code> is found - * @since 3.0 - - - - - - - - - - * Finds the Java element corresponding to the given binding key if any, - * else returns <code>null</code>. Elements are looked up using this - * project's classpath. The first element corresponding to - * the given key on this project's classpath is returned. - * <p>Possible elements are: - * <ul> - * <li>{@link IPackageFragment} for a binding key from an - * {@link IPackageBinding}</li> - * <li>{@link IType} for a binding key from an {@link ITypeBinding}</li> - * <li>{@link IMethod} for a binding key from an {@link IMethodBinding}</li> - * <li>{@link IField} for a binding key from an {@link IVariableBinding} - * representing a {@link IVariableBinding#isField() field}</li> - * <li>{@link ITypeParameter} for a binding key from an {@link ITypeBinding} - * representing a {@link ITypeBinding#isTypeVariable() type - * variable}</li> - * <li>{@link IAnnotation} for a binding key from an - * {@link IAnnotationBinding}</li> - * </ul></p> - * <p>Note: if two methods correspond to the binding key because their - * parameter types' simple names are the same, then the first one is returned. - * For example, if a class defines two methods <code>foo(p1.Y, String)</code> - * and <code>foo(p2.Y, String)</code>, in both cases the parameter type's - * simple names are <code>{"Y", "String"}</code>. Thus - * <code>foo(p1.Y, String)</code> is returned.</p> - * - * @param bindingKey the given binding key - * @param owner the owner of the returned element's compilation unit, - * or <code>null</code> if the default working copy owner must be - * used - * @exception JavaModelException if this project does not exist or if an - * exception occurs while accessing its corresponding resource - * @return the Java element corresponding to the given key, - * or <code>null</code> if no such Java element is found - * @since 3.4 - - - - - - - - - - * Returns the first existing package fragment on this project's classpath - * whose path matches the given (absolute) path, or <code>null</code> if none - * exist. - * The path can be: - * - internal to the workbench: "/Project/src" - * - external to the workbench: "c:/jdk/classes.zip/java/lang" - * @param path the given absolute path - * @exception JavaModelException if this project does not exist or if an - * exception occurs while accessing its corresponding resource - * @return the first existing package fragment on this project's classpath - * whose path matches the given (absolute) path, or <code>null</code> if none - * exist - - - - - - - - - * Returns the existing package fragment root on this project's classpath - * whose path matches the given (absolute) path, or <code>null</code> if - * one does not exist. - * The path can be: - * - internal to the workbench: "/Compiler/src" - * - external to the workbench: "c:/jdk/classes.zip" - * @param path the given absolute path - * @exception JavaModelException if this project does not exist or if an - * exception occurs while accessing its corresponding resource - * @return the existing package fragment root on this project's classpath - * whose path matches the given (absolute) path, or <code>null</code> if - * one does not exist - - - - - - - - - * Returns the existing package fragment roots identified by the given entry. - * A classpath entry within the current project identifies a single root. - * <p> - * If the classpath entry denotes a variable, it will be resolved and return - * the roots of the target entry (empty if not resolvable). - * <p> - * If the classpath entry denotes a container, it will be resolved and return - * the roots corresponding to the set of container entries (empty if not resolvable). - * <p> - * The result does not include package fragment roots in other projects - * referenced on this project's classpath. - * - * @param entry the given entry - * @return the existing package fragment roots identified by the given entry - * @see IClasspathContainer - * @since 2.1 - - - - - - - - - - - - * Returns the first type found following this project's classpath - * with the given fully qualified name or <code>null</code> if none is found. - * The fully qualified name is a dot-separated name. For example, - * a class B defined as a member type of a class A in package x.y should have a - * the fully qualified name "x.y.A.B". - * - * Note that in order to be found, a type name (or its toplevel enclosing - * type name) must match its corresponding compilation unit name. As a - * consequence, secondary types cannot be found using this functionality. - * To find secondary types use {@link #findType(String, IProgressMonitor)} instead. - * - * @param fullyQualifiedName the given fully qualified name - * @exception JavaModelException if this project does not exist or if an - * exception occurs while accessing its corresponding resource - * @return the first type found following this project's classpath - * with the given fully qualified name or <code>null</code> if none is found - * @see IType#getFullyQualifiedName(char) - * @since 2.0 - - - - - - - - - * Same functionality as {@link #findType(String)} but also look for secondary - * types if given name does not match a compilation unit name. - * - * @param fullyQualifiedName the given fully qualified name - * @param progressMonitor the progress monitor to report progress to, - * or <code>null</code> if no progress monitor is provided - * @exception JavaModelException if this project does not exist or if an - * exception occurs while accessing its corresponding resource - * @return the first type found following this project's classpath - * with the given fully qualified name or <code>null</code> if none is found - * @see IType#getFullyQualifiedName(char) - * @since 3.2 - - - - - - - - - - * Returns the first type found following this project's classpath - * with the given fully qualified name or <code>null</code> if none is found. - * The fully qualified name is a dot-separated name. For example, - * a class B defined as a member type of a class A in package x.y should have a - * the fully qualified name "x.y.A.B". - * If the returned type is part of a compilation unit, its owner is the given - * owner. - * - * Note that in order to be found, a type name (or its toplevel enclosing - * type name) must match its corresponding compilation unit name. As a - * consequence, secondary types cannot be found using this functionality. - * To find secondary types use {@link #findType(String, WorkingCopyOwner, IProgressMonitor)} - * instead. - * - * @param fullyQualifiedName the given fully qualified name - * @param owner the owner of the returned type's compilation unit - * @exception JavaModelException if this project does not exist or if an - * exception occurs while accessing its corresponding resource - * @return the first type found following this project's classpath - * with the given fully qualified name or <code>null</code> if none is found - * @see IType#getFullyQualifiedName(char) - * @since 3.0 - - - - - - - - - - * Same functionality as {@link #findType(String, WorkingCopyOwner)} - * but also look for secondary types if given name does not match - * a compilation unit name. - * - * @param fullyQualifiedName the given fully qualified name - * @param owner the owner of the returned type's compilation unit - * @param progressMonitor the progress monitor to report progress to, - * or <code>null</code> if no progress monitor is provided - * @exception JavaModelException if this project does not exist or if an - * exception occurs while accessing its corresponding resource - * @return the first type found following this project's classpath - * with the given fully qualified name or <code>null</code> if none is found - * @see IType#getFullyQualifiedName(char) - * @since 3.2 - - - - - - - - - - - * Returns the first type found following this project's classpath - * with the given package name and type qualified name - * or <code>null</code> if none is found. - * The package name is a dot-separated name. - * The type qualified name is also a dot-separated name. For example, - * a class B defined as a member type of a class A should have the - * type qualified name "A.B". - * - * Note that in order to be found, a type name (or its toplevel enclosing - * type name) must match its corresponding compilation unit name. As a - * consequence, secondary types cannot be found using this functionality. - * To find secondary types use {@link #findType(String, String, IProgressMonitor)} - * instead. - * - * @param packageName the given package name - * @param typeQualifiedName the given type qualified name - * @exception JavaModelException if this project does not exist or if an - * exception occurs while accessing its corresponding resource - * @return the first type found following this project's classpath - * with the given package name and type qualified name - * or <code>null</code> if none is found - * @see IType#getTypeQualifiedName(char) - * @since 2.0 - - - - - - - - - - * Same functionality as {@link #findType(String, String)} but also look for - * secondary types if given name does not match a compilation unit name. - * - * @param packageName the given package name - * @param typeQualifiedName the given type qualified name - * @param progressMonitor the progress monitor to report progress to, - * or <code>null</code> if no progress monitor is provided - * @exception JavaModelException if this project does not exist or if an - * exception occurs while accessing its corresponding resource - * @return the first type found following this project's classpath - * with the given fully qualified name or <code>null</code> if none is found - * @see IType#getFullyQualifiedName(char) - * @since 3.2 - - - - - - - - - - - * Returns the first type found following this project's classpath - * with the given package name and type qualified name - * or <code>null</code> if none is found. - * The package name is a dot-separated name. - * The type qualified name is also a dot-separated name. For example, - * a class B defined as a member type of a class A should have the - * type qualified name "A.B". - * If the returned type is part of a compilation unit, its owner is the given - * owner. - * - * Note that in order to be found, a type name (or its toplevel enclosing - * type name) must match its corresponding compilation unit name. As a - * consequence, secondary types cannot be found using this functionality. - * To find secondary types use {@link #findType(String, String, WorkingCopyOwner, IProgressMonitor)} - * instead. - * - * @param packageName the given package name - * @param typeQualifiedName the given type qualified name - * @param owner the owner of the returned type's compilation unit - * @exception JavaModelException if this project does not exist or if an - * exception occurs while accessing its corresponding resource - * @return the first type found following this project's classpath - * with the given package name and type qualified name - * or <code>null</code> if none is found - * @see IType#getTypeQualifiedName(char) - * @since 3.0 - - - - - - - - - - - * Same functionality as {@link #findType(String, String, WorkingCopyOwner)} - * but also look for secondary types if given name does not match a compilation unit name. - * - * @param packageName the given package name - * @param typeQualifiedName the given type qualified name - * @param owner the owner of the returned type's compilation unit - * @param progressMonitor the progress monitor to report progress to, - * or <code>null</code> if no progress monitor is provided - * @exception JavaModelException if this project does not exist or if an - * exception occurs while accessing its corresponding resource - * @return the first type found following this project's classpath - * with the given fully qualified name or <code>null</code> if none is found - * @see IType#getFullyQualifiedName(char) - * @since 3.2 - - - - - - - - - - - - * Returns all of the existing package fragment roots that exist - * on the classpath, in the order they are defined by the classpath. - * - * @return all of the existing package fragment roots that exist - * on the classpath - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - - - - * Returns an array of non-Java resources directly contained in this project. - * It does not transitively answer non-Java resources contained in folders; - * these would have to be explicitly iterated over. - * <p> - * Non-Java resources includes other files and folders located in the - * project not accounted for by any of it source or binary package fragment - * roots. If the project is a source folder itself, resources excluded from the - * corresponding source classpath entry by one or more exclusion patterns - * are considered non-Java resources and will appear in the result - * (possibly in a folder) - * </p> - * - * @return an array of non-Java resources (<code>IFile</code>s and/or - * <code>IFolder</code>s) directly contained in this project - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - - - - * Helper method for returning one option value only. Equivalent to <code>(String)this.getOptions(inheritJavaCoreOptions).get(optionName)</code> - * Note that it may answer <code>null</code> if this option does not exist, or if there is no custom value for it. - * <p> - * For a complete description of the configurable options, see <code>JavaCore#getDefaultOptions</code>. - * </p> - * - * @param optionName the name of an option - * @param inheritJavaCoreOptions - boolean indicating whether JavaCore options should be inherited as well - * @return the String value of a given option - * @see JavaCore#getDefaultOptions() - * @since 2.1 - - - - - - - - - - * Returns the table of the current custom options for this project. Projects remember their custom options, - * in other words, only the options different from the the JavaCore global options for the workspace. - * A boolean argument allows to directly merge the project options with global ones from <code>JavaCore</code>. - * <p> - * For a complete description of the configurable options, see <code>JavaCore#getDefaultOptions</code>. - * </p> - * - * @param inheritJavaCoreOptions - boolean indicating whether JavaCore options should be inherited as well - * @return table of current settings of all options - * (key type: <code>String</code>; value type: <code>String</code>) - * @see JavaCore#getDefaultOptions() - * @since 2.1 - - - - - - - - - * Returns the default output location for this project as a workspace- - * relative absolute path. - * <p> - * The default output location is where class files are ordinarily generated - * (and resource files, copied). Each source classpath entry can also - * specify an output location for the generated class files (and copied - * resource files) corresponding to compilation units under that source - * folder. This makes it possible to arrange generated class files for - * different source folders in different output folders, and not - * necessarily the default output folder. This means that the generated - * class files for the project may end up scattered across several folders, - * rather than all in the default output folder (which is more standard). - * </p> - * - * @return the workspace-relative absolute path of the default output folder - * @exception JavaModelException if this element does not exist - * @see #setOutputLocation(org.eclipse.core.runtime.IPath, IProgressMonitor) - * @see IClasspathEntry#getOutputLocation() - - - - - - - - * Returns a package fragment root for an external library - * (a ZIP archive - e.g. a <code>.jar</code>, a <code>.zip</code> file, etc. - - * or - since 3.4 - a class folder) at the specified file system path. - * This is a handle-only method. The underlying <code>java.io.File</code> - * may or may not exist. No resource is associated with this local library - * package fragment root. - * - * @param externalLibraryPath the library's file system path - * @return a package fragment root for the external library at the specified file system path - - - - - - - - - * Returns a package fragment root for the given resource, which - * must either be a folder representing the top of a package hierarchy, - * or a ZIP archive (e.g. a <code>.jar</code>, a <code>.zip</code> file, etc.) - * This is a handle-only method. The underlying resource may or may not exist. - * - * @param resource the given resource - * @return a package fragment root for the given resource, which - * must either be a folder representing the top of a package hierarchy, - * or a ZIP archive (e.g. a <code>.jar</code>, a <code>.zip</code> file, etc.) - - - - - - - - - * Returns all of the package fragment roots contained in this - * project, identified on this project's resolved classpath. The result - * does not include package fragment roots in other projects referenced - * on this project's classpath. - * - * <p>NOTE: This is equivalent to <code>getChildren()</code>. - * - * @return all of the package fragment roots contained in this - * project, identified on this project's resolved classpath - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - - - - * Returns the existing package fragment roots identified by the given entry. - * A classpath entry within the current project identifies a single root. - * <p> - * If the classpath entry denotes a variable, it will be resolved and return - * the roots of the target entry (empty if not resolvable). - * <p> - * If the classpath entry denotes a container, it will be resolved and return - * the roots corresponding to the set of container entries (empty if not resolvable). - * <p> - * The result does not include package fragment roots in other projects - * referenced on this project's classpath. - * - * @param entry the given entry - * @return the existing package fragment roots identified by the given entry - * @see IClasspathContainer - * @deprecated Use {@link IJavaProject#findPackageFragmentRoots(IClasspathEntry)} instead - - - - - - - - - - - - * Returns all package fragments in all package fragment roots contained - * in this project. This is a convenience method. - * - * Note that the package fragment roots corresponds to the resolved - * classpath of the project. - * - * @return all package fragments in all package fragment roots contained - * in this project - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - - - - * Returns the <code>IProject</code> on which this <code>IJavaProject</code> - * was created. This is handle-only method. - * - * @return the <code>IProject</code> on which this <code>IJavaProject</code> - * was created - - - - - - - - * Returns the raw classpath for the project, as a list of classpath - * entries. This corresponds to the exact set of entries which were assigned - * using <code>setRawClasspath</code>, in particular such a classpath may - * contain classpath variable and classpath container entries. Classpath - * variable and classpath container entries can be resolved using the - * helper method <code>getResolvedClasspath</code>; classpath variable - * entries also can be resolved individually using - * <code>JavaCore#getClasspathVariable</code>). - * <p> - * Both classpath containers and classpath variables provides a level of - * indirection that can make the <code>.classpath</code> file stable across - * workspaces. - * As an example, classpath variables allow a classpath to no longer refer - * directly to external JARs located in some user specific location. - * The classpath can simply refer to some variables defining the proper - * locations of these external JARs. Similarly, classpath containers - * allows classpath entries to be computed dynamically by the plug-in that - * defines that kind of classpath container. - * </p> - * <p> - * Note that in case the project isn't yet opened, the classpath will - * be read directly from the associated <tt>.classpath</tt> file. - * </p> - * - * @return the raw classpath for the project, as a list of classpath entries - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - * @see IClasspathEntry - - - - - - - - - - - * Returns the names of the projects that are directly required by this - * project. A project is required if it is in its classpath. - * <p> - * The project names are returned in the order they appear on the classpath. - * - * @return the names of the projects that are directly required by this - * project in classpath order - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - - - - * This is a helper method returning the resolved classpath for the project - * as a list of simple (non-variable, non-container) classpath entries. - * All classpath variable and classpath container entries in the project's - * raw classpath will be replaced by the simple classpath entries they - * resolve to. - * <p> - * The resulting resolved classpath is accurate for the given point in time. - * If the project's raw classpath is later modified, or if classpath - * variables are changed, the resolved classpath can become out of date. - * Because of this, hanging on resolved classpath is not recommended. - * </p> - * <p> - * Note that if the resolution creates duplicate entries - * (i.e. {@link IClasspathEntry entries} which are {@link Object#equals(Object)}), - * only the first one is added to the resolved classpath. - * </p> - * - * @param ignoreUnresolvedEntry indicates how to handle unresolvable - * variables and containers; <code>true</code> indicates that missing - * variables and unresolvable classpath containers should be silently - * ignored, and that the resulting list should consist only of the - * entries that could be successfully resolved; <code>false</code> indicates - * that a <code>JavaModelException</code> should be thrown for the first - * unresolved variable or container - * @return the resolved classpath for the project as a list of simple - * classpath entries, where all classpath variable and container entries - * have been resolved and substituted with their final target entries - * @exception JavaModelException in one of the corresponding situation: - * <ul> - * <li>this element does not exist</li> - * <li>an exception occurs while accessing its corresponding resource</li> - * <li>a classpath variable or classpath container was not resolvable - * and <code>ignoreUnresolvedEntry</code> is <code>false</code>.</li> - * </ul> - * @see IClasspathEntry - - - - - - - - - - - - * Returns whether this project has been built at least once and thus whether it has a build state. - * @return true if this project has been built at least once, false otherwise - - - - - - - - * Returns whether setting this project's classpath to the given classpath entries - * would result in a cycle. - * - * If the set of entries contains some variables, those are resolved in order to determine - * cycles. - * - * @param entries the given classpath entries - * @return true if the given classpath entries would result in a cycle, false otherwise - - - - - - - - - - - - * Returns whether the given element is on the classpath of this project, - * that is, referenced from a classpath entry and not explicitly excluded - * using an exclusion pattern. - * - * @param element the given element - * @return <code>true</code> if the given element is on the classpath of - * this project, <code>false</code> otherwise - * @see IClasspathEntry#getInclusionPatterns() - * @see IClasspathEntry#getExclusionPatterns() - * @since 2.0 - - - - - - - - - * Returns whether the given resource is on the classpath of this project, - * that is, referenced from a classpath entry and not explicitly excluded - * using an exclusion pattern. - * - * @param resource the given resource - * @return <code>true</code> if the given resource is on the classpath of - * this project, <code>false</code> otherwise - * @see IClasspathEntry#getInclusionPatterns() - * @see IClasspathEntry#getExclusionPatterns() - * @since 2.1 - - - - - - - - - * Creates a new evaluation context. - * @return a new evaluation context. - - - - - - - - * Creates and returns a type hierarchy for all types in the given - * region, considering subtypes within that region. - * - * @param monitor the given progress monitor - * @param region the given region - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - * @exception IllegalArgumentException if region is <code>null</code> - * @return a type hierarchy for all types in the given - * region, considering subtypes within that region - - - - - - - - - - * Creates and returns a type hierarchy for all types in the given - * region, considering subtypes within that region and considering types in the - * working copies with the given owner. - * In other words, the owner's working copies will take - * precedence over their original compilation units in the workspace. - * <p> - * Note that if a working copy is empty, it will be as if the original compilation - * unit had been deleted. - * <p> - * - * @param monitor the given progress monitor - * @param region the given region - * @param owner the owner of working copies that take precedence over their original compilation units - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - * @exception IllegalArgumentException if region is <code>null</code> - * @return a type hierarchy for all types in the given - * region, considering subtypes within that region - * @since 3.0 - - - - - - - - - - - * Creates and returns a type hierarchy for the given type considering - * subtypes in the specified region. - * - * @param type the given type - * @param region the given region - * @param monitor the given monitor - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - * - * @exception IllegalArgumentException if type or region is <code>null</code> - * @return a type hierarchy for the given type considering - * subtypes in the specified region - - - - - - - - - - - * Creates and returns a type hierarchy for the given type considering - * subtypes in the specified region and considering types in the - * working copies with the given owner. - * In other words, the owner's working copies will take - * precedence over their original compilation units in the workspace. - * <p> - * Note that if a working copy is empty, it will be as if the original compilation - * unit had been deleted. - * <p> - * - * @param type the given type - * @param region the given region - * @param monitor the given monitor - * @param owner the owner of working copies that take precedence over their original compilation units - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - * - * @exception IllegalArgumentException if type or region is <code>null</code> - * @return a type hierarchy for the given type considering - * subtypes in the specified region - * @since 3.0 - - - - - - - - - - - - * Returns the default output location for the project as defined by its <code>.classpath</code> file from disk, or <code>null</code> - * if unable to read the file. - * <p> - * This output location may differ from the in-memory one returned by <code>getOutputLocation</code>, in case the - * automatic reconciliation mechanism has not been performed yet. Usually, any change to the <code>.classpath</code> file - * is automatically noticed and reconciled at the next resource change notification event. - * However, if the file is modified within an operation, where this change needs to be taken into account before the - * operation ends, then the output location from disk can be read using this method, and further assigned to the project - * using <code>setRawClasspath(...)</code>. - * <p> - * The default output location is where class files are ordinarily generated - * (and resource files, copied). Each source classpath entry can also - * specify an output location for the generated class files (and copied - * resource files) corresponding to compilation units under that source - * folder. This makes it possible to arrange generated class files for - * different source folders in different output folders, and not - * necessarily the default output folder. This means that the generated - * class files for the project may end up scattered across several folders, - * rather than all in the default output folder (which is more standard). - * <p> - * In order to manually force a project classpath refresh, one can simply assign the project classpath using the result of this - * method, as follows: - * <code>proj.setRawClasspath(proj.readRawClasspath(), proj.readOutputLocation(), monitor)</code> - * (note that the <code>readRawClasspath/readOutputLocation</code> methods could return <code>null</code>). - * <p> - * @return the workspace-relative absolute path of the default output folder - * @see #getOutputLocation() - * @since 3.0 - - - - - - - - * Returns the raw classpath for the project as defined by its - * <code>.classpath</code> file from disk, or <code>null</code> - * if unable to read the file. - * <p> - * This classpath may differ from the in-memory classpath returned by - * <code>getRawClasspath</code>, in case the automatic reconciliation - * mechanism has not been performed yet. Usually, any change to the - * <code>.classpath</code> file is automatically noticed and reconciled at - * the next resource change notification event. However, if the file is - * modified within an operation, where this change needs to be taken into - * account before the operation ends, then the classpath from disk can be - * read using this method, and further assigned to the project using - * <code>setRawClasspath(...)</code>. - * </p> - * <p> - * Classpath variable and classpath container entries can be resolved using - * the helper method <code>getResolvedClasspath</code>; classpath variable - * entries also can be resolved individually using - * <code>JavaCore#getClasspathVariable</code>). - * </p> - * <p> - * Note that no check is performed whether the project has the Java nature - * set, allowing an existing <code>.classpath</code> file to be considered - * independantly (unlike <code>getRawClasspath</code> which requires the - * Java nature to be associated with the project). - * </p> - * <p> - * In order to manually force a project classpath refresh, one can simply - * assign the project classpath using the result of this method, as follows: - * <code>proj.setRawClasspath(proj.readRawClasspath(), proj.readOutputLocation(), monitor)</code> - * (note that the <code>readRawClasspath/readOutputLocation</code> methods - * could return <code>null</code>). - * </p> - * - * @return the raw classpath from disk for the project, as a list of - * classpath entries - * @see #getRawClasspath() - * @see IClasspathEntry - * @since 3.0 - - - - - - - - - - - * Helper method for setting one option value only. - *<p> - * Equivalent to: - * <pre> - * Map options = this.getOptions(false); - * map.put(optionName, optionValue); - * this.setOptions(map) - * </pre> - * <p> - * For a complete description of the configurable options, see <code>JavaCore#getDefaultOptions</code>. - * </p> - * - * @param optionName the name of an option - * @param optionValue the value of the option to set. If <code>null</code>, then the option - * is removed from project preferences. - * @throws NullPointerException if <code>optionName</code> is <code>null</code> - * (see {@link org.osgi.service.prefs.Preferences#put(String, String)}). - * @see JavaCore#getDefaultOptions() - * @since 3.0 - - - - - - - - - * Sets the project custom options. All and only the options explicitly included in the given table - * are remembered; all previous option settings are forgotten, including ones not explicitly - * mentioned. - * <p> - * For a complete description of the configurable options, see <code>JavaCore#getDefaultOptions</code>. - * </p> - * - * @param newOptions the new options (key type: <code>String</code>; value type: <code>String</code>), - * or <code>null</code> to flush all custom options (clients will automatically get the global JavaCore options). - * @see JavaCore#getDefaultOptions() - * @since 2.1 - - - - - - - - * Sets the default output location of this project to the location - * described by the given workspace-relative absolute path. - * <p> - * The default output location is where class files are ordinarily generated - * (and resource files, copied). Each source classpath entries can also - * specify an output location for the generated class files (and copied - * resource files) corresponding to compilation units under that source - * folder. This makes it possible to arrange that generated class files for - * different source folders to end up in different output folders, and not - * necessarily the default output folder. This means that the generated - * class files for the project may end up scattered across several folders, - * rather than all in the default output folder (which is more standard). - * </p> - * - * @param path the workspace-relative absolute path of the default output - * folder - * @param monitor the progress monitor - * - * @exception JavaModelException if the classpath could not be set. Reasons include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> The path refers to a location not contained in this project (<code>PATH_OUTSIDE_PROJECT</code>) - * <li> The path is not an absolute path (<code>RELATIVE_PATH</code>) - * <li> The path is nested inside a package fragment root of this project (<code>INVALID_PATH</code>) - * <li> The output location is being modified during resource change event notification (CORE_EXCEPTION) - * </ul> - * @see #getOutputLocation() - * @see IClasspathEntry#getOutputLocation() - - - - - - - - - * Sets both the classpath of this project and its default output - * location at once. The classpath is defined using a list of classpath - * entries. In particular such a classpath may contain classpath variable entries. - * Classpath variable entries can be resolved individually ({@link JavaCore#getClasspathVariable(String)}), - * or the full classpath can be resolved at once using the helper method {@link #getResolvedClasspath(boolean)}. - * <p> - * A classpath variable provides an indirection level for better sharing a classpath. As an example, it allows - * a classpath to no longer refer directly to external JARs located in some user specific location. The classpath - * can simply refer to some variables defining the proper locations of these external JARs. - * </p><p> - * If it is specified that this operation cannot modify resources, the .classpath file will not be written to disk - * and no error marker will be generated. To synchronize the .classpath with the in-memory classpath, - * one can use <code>setRawClasspath(readRawClasspath(), true, monitor)</code>. - * </p><p> - * Setting the classpath to <code>null</code> specifies a default classpath - * (the project root). Setting the classpath to an empty array specifies an - * empty classpath. - * </p><p> - * If a cycle is detected while setting this classpath (and if resources can be modified), an error marker will be added - * to the project closing the cycle. - * To avoid this problem, use {@link #hasClasspathCycle(IClasspathEntry[])} - * before setting the classpath. - * <p> - * This operation acquires a lock on the workspace's root. - * - * @param entries a list of classpath entries - * @param outputLocation the default output location - * @param canModifyResources whether resources should be written to disk if needed - * @param monitor the given progress monitor - * @exception JavaModelException if the classpath could not be set. Reasons include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> The classpath is being modified during resource change event notification (CORE_EXCEPTION) - * <li> The classpath failed the validation check as defined by {@link JavaConventions#validateClasspath(IJavaProject, IClasspathEntry[], IPath)} - * </ul> - * @see IClasspathEntry - * @since 3.2 - - - - - - - - - - - - - - * Sets the classpath of this project using a list of classpath entries. In particular such a classpath may contain - * classpath variable entries. Classpath variable entries can be resolved individually ({@link JavaCore#getClasspathVariable(String)}), - * or the full classpath can be resolved at once using the helper method {@link #getResolvedClasspath(boolean)}. - * <p> - * A classpath variable provides an indirection level for better sharing a classpath. As an example, it allows - * a classpath to no longer refer directly to external JARs located in some user specific location. The classpath - * can simply refer to some variables defining the proper locations of these external JARs. - * </p><p> - * If it is specified that this operation cannot modify resources, the .classpath file will not be written to disk - * and no error marker will be generated. To synchronize the .classpath with the in-memory classpath, - * one can use <code>setRawClasspath(readRawClasspath(), true, monitor)</code>. - * </p><p> - * Setting the classpath to <code>null</code> specifies a default classpath - * (the project root). Setting the classpath to an empty array specifies an - * empty classpath. - * </p><p> - * If a cycle is detected while setting this classpath (and if resources can be modified), an error marker will be added - * to the project closing the cycle. - * To avoid this problem, use {@link #hasClasspathCycle(IClasspathEntry[])} - * before setting the classpath. - * <p> - * This operation acquires a lock on the workspace's root. - * - * @param entries a list of classpath entries - * @param canModifyResources whether resources should be written to disk if needed - * @param monitor the given progress monitor - * @exception JavaModelException if the classpath could not be set. Reasons include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> The classpath is being modified during resource change event notification (CORE_EXCEPTION) - * <li> The classpath failed the validation check as defined by {@link JavaConventions#validateClasspath(IJavaProject, IClasspathEntry[], IPath)} - * </ul> - * @see IClasspathEntry - * @since 3.2 - - - - - - - - - - - - - * Works similar to {@link #setRawClasspath(IClasspathEntry[], IPath, IProgressMonitor)} and - * additionally allows persisting the given array of referenced entries for this project. - * The referenced entries and their attributes are stored in the .classpath file of this - * project. For details on referenced entries, see - * {@link JavaCore#getReferencedClasspathEntries(IClasspathEntry, IJavaProject)} - * and {@link IClasspathEntry#getReferencingEntry()}. - * <p> - * Since the referenced entries are stored in the .classpath file, clients can store additional - * information that belong to these entries and retrieve them across sessions, though the referenced - * entries themselves may not be present in the raw classpath. By passing a <code>null</code> - * referencedEntries, clients can choose not to modify the already persisted referenced entries, - * which is fully equivalent to {@link #setRawClasspath(IClasspathEntry[], IPath, IProgressMonitor)}. - * If an empty array is passed as referencedEntries, the already persisted referenced entries, - * if any, will be cleared. - * </p> <p> - * If there are duplicates of a referenced entry or if any of the <code>referencedEntries</code> - * is already present in the raw classpath(<code>entries</code>) those referenced entries will - * be excluded and not be persisted. - *</p> - * @param entries a list of classpath entries - * @param referencedEntries the list of referenced classpath entries to be persisted - * @param outputLocation the default output location - * @param monitor the given progress monitor - * @exception JavaModelException if the classpath could not be set. Reasons include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> The classpath is being modified during resource change event notification (CORE_EXCEPTION) - * <li> The classpath failed the validation check as defined by {@link JavaConventions#validateClasspath(IJavaProject, IClasspathEntry[], IPath)} - * </ul> - * @see IClasspathEntry - * @see #getReferencedClasspathEntries() - * @since 3.6 - - - - - - - - - - - - - - - - - * Returns the list of referenced classpath entries stored in the .classpath file of <code>this</code> - * java project. Clients can store the referenced classpath entries using - * {@link #setRawClasspath(IClasspathEntry[], IClasspathEntry[], IPath, IProgressMonitor)} - * If the client has not stored any referenced entries for this project, an empty array is returned. - * - * @throws JavaModelException - * @return an array of referenced classpath entries stored for this java project or an empty array if none - * stored earlier. - * @since 3.6 - - - - - - - - - - - * Sets the classpath of this project using a list of classpath entries. In particular such a classpath may contain - * classpath variable entries. Classpath variable entries can be resolved individually ({@link JavaCore#getClasspathVariable(String)}), - * or the full classpath can be resolved at once using the helper method {@link #getResolvedClasspath(boolean)}. - * <p> - * A classpath variable provides an indirection level for better sharing a classpath. As an example, it allows - * a classpath to no longer refer directly to external JARs located in some user specific location. The classpath - * can simply refer to some variables defining the proper locations of these external JARs. - * <p> - * Setting the classpath to <code>null</code> specifies a default classpath - * (the project root). Setting the classpath to an empty array specifies an - * empty classpath. - * <p> - * If a cycle is detected while setting this classpath, an error marker will be added - * to the project closing the cycle. - * To avoid this problem, use {@link #hasClasspathCycle(IClasspathEntry[])} - * before setting the classpath. - * <p> - * This operation acquires a lock on the workspace's root. - * - * @param entries a list of classpath entries - * @param monitor the given progress monitor - * @exception JavaModelException if the classpath could not be set. Reasons include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> The classpath is being modified during resource change event notification (CORE_EXCEPTION) - * <li> The classpath failed the validation check as defined by {@link JavaConventions#validateClasspath(IJavaProject, IClasspathEntry[], IPath)} - * </ul> - * @see IClasspathEntry - - - - - - - - - - - - * Sets the both the classpath of this project and its default output - * location at once. The classpath is defined using a list of classpath - * entries. In particular, such a classpath may contain classpath variable - * entries. Classpath variable entries can be resolved individually (see - * ({@link JavaCore#getClasspathVariable(String)}), or the full classpath can be - * resolved at once using the helper method - * {@link #getResolvedClasspath(boolean)}. - * <p> - * A classpath variable provides an indirection level for better sharing a - * classpath. As an example, it allows a classpath to no longer refer - * directly to external JARs located in some user specific location. The - * classpath can simply refer to some variables defining the proper - * locations of these external JARs. - * </p> - * <p> - * Setting the classpath to <code>null</code> specifies a default classpath - * (the project root). Setting the classpath to an empty array specifies an - * empty classpath. - * </p> - * <p> - * If a cycle is detected while setting this classpath, an error marker will - * be added to the project closing the cycle. To avoid this problem, use - * {@link #hasClasspathCycle(IClasspathEntry[])} before setting - * the classpath. - * </p> - * <p> - * This operation acquires a lock on the workspace's root. - * </p> - * - * @param entries a list of classpath entries - * @param monitor the progress monitor - * @param outputLocation the default output location - * @exception JavaModelException if the classpath could not be set. Reasons - * include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> Two or more entries specify source roots with the same or overlapping paths (NAME_COLLISION) - * <li> A entry of kind <code>CPE_PROJECT</code> refers to this project (INVALID_PATH) - * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li>The output location path refers to a location not contained in this project (<code>PATH_OUTSIDE_PROJECT</code>) - * <li>The output location path is not an absolute path (<code>RELATIVE_PATH</code>) - * <li>The output location path is nested inside a package fragment root of this project (<code>INVALID_PATH</code>) - * <li> The classpath is being modified during resource change event notification (CORE_EXCEPTION) - * </ul> - * @see IClasspathEntry - * @since 2.0 - - - - - - - - - - - - - - * Represents a local variable declared in a method or an initializer. - * <code>ILocalVariable</code> are pseudo-elements created as the result of a <code>ICodeAssist.codeSelect(...)</code> - * operation. They are not part of the Java model (<code>exists()</code> returns whether the parent exists rather than - * whether the local variable exists in the parent) and they are not included in the children of an <code>IMethod</code> - * or an <code>IInitializer</code>. - * <p> - * In particular such a pseudo-element should not be used as a handle. For example its name range won't be updated - * if the underlying source changes. - * </p> - * - * @since 3.0 - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - * Common protocol for Java elements that can be members of types. - * This set consists of <code>IType</code>, <code>IMethod</code>, - * <code>IField</code>, and <code>IInitializer</code>. - * <p> - * The children are listed in the order in which they appear in the source or class file. - * </p> - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - - - * Returns the categories defined by this member's Javadoc. A category is the identifier - * following the tag <code>@category</code> in the member's Javadoc. - * Returns an empty array if no category is defined in this member's Javadoc. - * - * @return the categories defined by this member's doc - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 3.2 - - - - - - - - - - - * Returns the class file in which this member is declared, or <code>null</code> - * if this member is not declared in a class file (for example, a source type). - * This is a handle-only method. - * - * @return the class file in which this member is declared, or <code>null</code> - * if this member is not declared in a class file (for example, a source type) - - - - - - - - * Returns the compilation unit in which this member is declared, or <code>null</code> - * if this member is not declared in a compilation unit (for example, a binary type). - * This is a handle-only method. - * - * @return the compilation unit in which this member is declared, or <code>null</code> - * if this member is not declared in a compilation unit (for example, a binary type) - - - - - - - - * Returns the type in which this member is declared, or <code>null</code> - * if this member is not declared in a type (for example, a top-level type). - * This is a handle-only method. - * - * @return the type in which this member is declared, or <code>null</code> - * if this member is not declared in a type (for example, a top-level type) - - - - - - - - * Returns the modifier flags for this member. The flags can be examined using class - * <code>Flags</code>. - * <p> - * Note that only flags as indicated in the source are returned. Thus if an interface - * defines a method <code>void myMethod();</code> the flags don't include the - * 'public' flag. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the modifier flags for this member - * @see Flags - - - - - - - - * Returns the Javadoc range if this element is from source or if this element - * is a binary element with an attached source, null otherwise. - * - * <p>If this element is from source, the javadoc range is - * extracted from the corresponding source.</p> - * <p>If this element is from a binary, the javadoc is extracted from the - * attached source if present.</p> - * <p>If this element's openable is not consistent, then null is returned.</p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return a source range corresponding to the javadoc source or <code>null</code> - * if no source is available, this element has no javadoc comment or - * this element's openable is not consistent - * @see IOpenable#isConsistent() - * @since 3.2 - - - - - - - - * Returns the position relative to the order this member is defined in the source. - * Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0). - * <p> - * Two members m1 and m2 that are equal (e.g. 2 fields with the same name in - * the same type) can be distinguished using their occurrence counts. If member - * m1 appears first in the source, it will have an occurrence count of 1. If member - * m2 appears right after member m1, it will have an occurrence count of 2. - * </p><p> - * The occurrence count can be used to distinguish initializers inside a type - * or anonymous types inside a method. - * </p><p> - * This is a handle-only method. The member may or may not be present. - * </p> - * - * @return the position relative to the order this member is defined in the source - * @since 3.2 - - - - - - - - * Returns the Java type root in which this member is declared. - * This is a handle-only method. - * - * @return the Java type root in which this member is declared. - * @since 3.3 - - - - - - - - * Returns the local or anonymous type declared in this source member with the given simple name and/or - * with the specified position relative to the order they are defined in the source. - * The name is empty if it is an anonymous type. - * Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0). - * This is a handle-only method. The type may or may not exist. - * Throws a <code>RuntimeException</code> if this member is not a source member. - * - * @param name the given simple name - * @param occurrenceCount the specified position - * @return the type with the given name and/or with the specified position relative to the order they are defined in the source - * @since 3.0 - - - - - - - - - - * Returns whether this member is from a class file. - * This is a handle-only method. - * - * @return <code>true</code> if from a class file, and <code>false</code> if - * from a compilation unit - - - - - - - - - * Represents a member-value pair of an annotation. - * The {@link #getValue() value} is represented by an {@link Object}. To get the exact - * type of this object, use its {@link #getValueKind() value kind}. If this value is an array, - * {@link #getValue()} returns an instance of {@link Object}[] and the value kind returns - * the kind of the elements in this array. - * <p> - * This interface is not intended to be implemented or extended by clients. - * </p> - * - * @since 3.4 - - - - - - * Constant indicating that the value kind is an <code>int</code> represented by - * an instance of {@link Integer}. - - - - - - - * Constant indicating that the value kind is a <code>byte</code> represented by - * an instance of {@link Byte}. - - - - - - - * Constant indicating that the value kind is a <code>short</code> represented by - * an instance of {@link Short}. - - - - - - - * Constant indicating that the value kind is a <code>char</code> represented by - * an instance of {@link Character}. - - - - - - - * Constant indicating that the value kind is a <code>float</code> represented by - * an instance of {@link Float}. - - - - - - - * Constant indicating that the value kind is a <code>double</code> represented by - * an instance of {@link Double}. - - - - - - - * Constant indicating that the value kind is a <code>long</code> represented by - * an instance of {@link Long}. - - - - - - - * Constant indicating that the value kind is a <code>boolean</code> represented by - * an instance of {@link Boolean}. - - - - - - - * Constant indicating that the value kind is a {@link String} represented by - * the corresponding {@link String}. - - - - - - - * Constant indicating that the value kind is an annotation represented by - * an instance of {@link IAnnotation}. - - - - - - - * Constant indicating that the value kind is a {@link Class} represented by - * the name of the class (i.e. a {@link String}. If the member-value pair is coming from - * a compilation unit, this is either a simple name (e.g. for <code>MyType.class</code>, - * the name is "MyType"), or a qualified name (e.g. for <code>x.y.MyType.MyNestedType.class</code>, - * the name is "x.y.MyType.MyNestedType"). If the member-value pair is coming from a class file, this is - * always a fully qualified name. - * <p> - * Note that one can use {@link IType#resolveType(String)} and e.g. - * {@link IJavaProject#findType(String, String, org.eclipse.core.runtime.IProgressMonitor)} - * to find the corresponding {@link IType}. - * </p> - - - - - - - * Constant indicating that the value is a qualified name represented by a - * {@link String}. The qualified name refers to an enum constant or another - * compile-time constant if the code is correct (e.g. "MyEnum.FIRST"). - - - - - - - * Constant indicating that the value is a simple name represented by a - * {@link String}. The simple name refers to an enum constant or another - * compile-time constant if the code is correct (e.g. "FIRST" when there is - * a static import for "MyEnum.FIRST"). - - - - - - - * Constant indicating that the value kind is unknown at this stage. The value is unknown in the - * following cases: - * <ul> - * <li>the value is an expression that would need to be further analyzed to determine its kind. For - * example, in <code>@MyAnnot(1 + 2.3)</code> the kind of the expression "1 + 2.3" is - * unknown</li> - * <li>the value is an array of size 0, e.g. <code>@MyAnnot({})</code></li> - * <li>the value is an array that contains at least one expression that would need to be further - * analyzed to determine its kind. For example, in <code>@MyAnnot({3.4, 1 + 2.3})</code>, - * the kind of the second element "1 + 2.3" is unknown.</li> - * <li>the value is an array that contains heterogeneous values, e.g. - * <code>@MyAnnot({1, 2.3, "abc"})</code></li> - * </ul> - * If the value kind is unknown, the returned value is always either <code>null</code>, or an - * array containing {@link Object}s and/or <code>null</code>s for unknown elements. - - - - - - - * Returns the member's name of this member-value pair. - * - * @return the member's name of this member-value pair. - - - - - - - - * Returns the value of this member-value pair. The type of this value - * is function of this member-value pair's {@link #getValueKind() value kind}. It is an - * instance of {@link Object}[] if the value is an array. - * <p> - * If the value kind is {@link #K_UNKNOWN} and the value is not an array, then the - * value is <code>null</code>. - * If the value kind is {@link #K_UNKNOWN} and the value is an array, then the - * value is an array containing {@link Object}s and/or <code>null</code>s for - * unknown elements. - * See {@link #K_UNKNOWN} for more details. - * </p> - * @return the value of this member-value pair. - - - - - - - - * Returns the value kind of this member-value pair. This indicates the instance of - * the returned {@link #getValue() value}, or the instance of the elements if the value - * is an array. The value kind is one of the following constants: - * {@link #K_ANNOTATION}, {@link #K_BOOLEAN}, {@link #K_BYTE}, {@link #K_CHAR}, - * {@link #K_CLASS}, {@link #K_DOUBLE}, {@link #K_FLOAT}, {@link #K_INT}, {@link #K_LONG}, - * {@link #K_QUALIFIED_NAME}, {@link #K_SIMPLE_NAME}, {@link #K_SHORT}, {@link #K_STRING}, - * {@link #K_UNKNOWN}. - * - * @return the value kind of this member-value pair - - - - - - - - - * Represents a method (or constructor) declared in a type. - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - * Returns a {@link IMemberValuePair member value pair} representing the default - * value of this method if any, or <code>null</code> if this method's parent is - * not an annotation type, or else if this method does not have a default value. - * <p> - * Note that {@link IMemberValuePair#getValue()} might return <code>null</code>. - * Please see this method for more details. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return a member pair value if any, or <code>null</code> if none - * @since 3.4 - - - - - - - - * Returns the simple name of this method. - * For a constructor, this returns the simple name of the declaring type. - * Note: This holds whether the constructor appears in a source or binary type - * (even though class files internally define constructor names to be <code>"&lt;init&gt;"</code>). - * For the class initialization methods in binary types, this returns - * the special name <code>"&lt;clinit&gt;"</code>. - * This is a handle-only method. - * @return the simple name of this method - - - - - - - - * Returns the type signatures of the exceptions this method throws, - * in the order declared in the source. Returns an empty array - * if this method throws no exceptions. - * <p> - * For example, a source method declaring <code>"throws IOException"</code>, - * would return the array <code>{"QIOException;"}</code>. - * </p> - * <p> - * The type signatures may be either unresolved (for source types) - * or resolved (for binary types), and either basic (for basic types) - * or rich (for parameterized types). See {@link Signature} for details. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the type signatures of the exceptions this method throws, - * in the order declared in the source, an empty array if this method throws no exceptions - * @see Signature - - - - - - - - - - - * Returns the formal type parameter signatures for this method. - * Returns an empty array if this method has no formal type parameters. - * <p> - * The formal type parameter signatures may be either unresolved (for source - * types) or resolved (for binary types). See {@link Signature} for details. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the formal type parameter signatures of this method, - * in the order declared in the source, an empty array if none - * @see Signature - * @since 3.0 - * @deprecated Use {@link #getTypeParameters()} instead - - - - - - - - - - - * Returns the formal type parameters for this method. - * Returns an empty array if this method has no formal type parameters. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the formal type parameters of this method, - * in the order declared in the source, an empty array if none - * @since 3.1 - - - - - - - - * Common protocol for Java elements that must be opened before they can be - * navigated or modified. Opening a textual element (such as a compilation unit) - * involves opening a buffer on its contents. While open, any changes to the buffer - * can be reflected in the element's structure; - * see {@link #isConsistent} and {@link #makeConsistent(IProgressMonitor)}. - * <p> - * To reduce complexity in clients, elements are automatically opened - * by the Java model as element properties are accessed. The Java model maintains - * an LRU cache of open elements, and automatically closes elements as they - * are swapped out of the cache to make room for other elements. Elements with - * unsaved changes are never removed from the cache, and thus, if the client - * maintains many open elements with unsaved - * changes, the LRU cache can grow in size (in this case the cache is not - * bounded). However, as elements are saved, the cache will shrink back to its - * original bounded size. - * </p> - * <p> - * To open an element, all openable parent elements must be open. - * The Java model automatically opens parent elements, as it automatically opens elements. - * Opening an element may provide access to direct children and other descendants, - * but does not automatically open any descendents which are themselves {@link IOpenable}. - * For example, opening a compilation unit provides access to all its constituent elements, - * but opening a package fragment does not open all compilation units in the package fragment. - * </p> - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - * Closes this element and its buffer (if any). - * Closing an element which is not open has no effect. - * - * <p>Note: although {@link #close} is exposed in the API, clients are - * not expected to open and close elements - the Java model does this automatically - * as elements are accessed. - * - * @exception JavaModelException if an error occurs closing this element - - - - - - - * Finds and returns the recommended line separator for this element. - * The element's buffer is first searched and the first line separator in this buffer is returned if any. - * Otherwise the preference {@link org.eclipse.core.runtime.Platform#PREF_LINE_SEPARATOR} - * on this element's project or workspace is returned. - * Finally if no such preference is set, the system line separator is returned. - * - * @return the recommended line separator for this element - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 3.2 - - - - - - - - * Returns the buffer opened for this element, or <code>null</code> - * if this element does not have a buffer. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the buffer opened for this element, or <code>null</code> - * if this element does not have a buffer - - - - - - - - * Returns <code>true</code> if this element is open and: - * <ul> - * <li>its buffer has unsaved changes, or - * <li>one of its descendants has unsaved changes, or - * <li>a working copy has been created on one of this - * element's children and has not yet destroyed - * </ul> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return <code>true</code> if this element is open and: - * <ul> - * <li>its buffer has unsaved changes, or - * <li>one of its descendants has unsaved changes, or - * <li>a working copy has been created on one of this - * element's children and has not yet destroyed - * </ul> - - - - - - - - * Returns whether the element is consistent with its underlying resource or buffer. - * The element is consistent when opened, and is consistent if the underlying resource - * or buffer has not been modified since it was last consistent. - * - * <p>NOTE: Child consistency is not considered. For example, a package fragment - * responds <code>true</code> when it knows about all of its - * compilation units present in its underlying folder. However, one or more of - * the compilation units could be inconsistent. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return true if the element is consistent with its underlying resource or buffer, false otherwise. - * @see IOpenable#makeConsistent(IProgressMonitor) - - - - - - - - * Returns whether this openable is open. This is a handle-only method. - * @return true if this openable is open, false otherwise - - - - - - - - * Makes this element consistent with its underlying resource or buffer - * by updating the element's structure and properties as necessary. - *<p> - * Note: Using this functionality on a working copy will interfere with any - * subsequent reconciling operation. Indeed, the next - * {@link ICompilationUnit#reconcile(int, boolean, WorkingCopyOwner, IProgressMonitor)} or - * {@link ICompilationUnit#reconcile(int, boolean, boolean, WorkingCopyOwner, IProgressMonitor)} - * operation will not account for changes which occurred before an - * explicit use of {@link #makeConsistent(IProgressMonitor)} - * <p> - * @param progress the given progress monitor - * @exception JavaModelException if the element is unable to access the contents - * of its underlying resource. Reasons include: - * <ul> - * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * </ul> - * @see IOpenable#isConsistent() - * @see ICompilationUnit#reconcile(int, boolean, WorkingCopyOwner, IProgressMonitor) - - - - - - - - * Opens this element and all parent elements that are not already open. - * For compilation units, a buffer is opened on the contents of the underlying resource. - * - * <p>Note: although {@link #open} is exposed in the API, clients are - * not expected to open and close elements - the Java model does this automatically - * as elements are accessed. - * - * @param progress the given progress monitor - * @exception JavaModelException if an error occurs accessing the contents - * of its underlying resource. Reasons include: - * <ul> - * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * </ul> - - - - - - - - * Saves any changes in this element's buffer to its underlying resource - * via a workspace resource operation. This has no effect if the element has no underlying - * buffer, or if there are no unsaved changed in the buffer. - * <p> - * The <code>force</code> parameter controls how this method deals with - * cases where the workbench is not completely in sync with the local file system. - * If <code>false</code> is specified, this method will only attempt - * to overwrite a corresponding file in the local file system provided - * it is in sync with the workbench. This option ensures there is no - * unintended data loss; it is the recommended setting. - * However, if <code>true</code> is specified, an attempt will be made - * to write a corresponding file in the local file system, - * overwriting any existing one if need be. - * In either case, if this method succeeds, the resource will be marked - * as being local (even if it wasn't before). - * <p> - * As a result of this operation, the element is consistent with its underlying - * resource or buffer. - * - * @param progress the given progress monitor - * @param force it controls how this method deals with - * cases where the workbench is not completely in sync with the local file system - * @exception JavaModelException if an error occurs accessing the contents - * of its underlying resource. Reasons include: - * <ul> - * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li>This Java element is read-only (READ_ONLY)</li> - * </ul> - - - - - - - - - - * Represents a package declaration in Java compilation unit. - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - * A package fragment is a portion of the workspace corresponding to an entire package, - * or to a portion thereof. The distinction between a package fragment and a package - * is that a package with some name is the union of all package fragments in the class path - * which have the same name. - * <p> - * Package fragments elements need to be opened before they can be navigated or manipulated. - * The children are of type <code>ICompilationUnit</code> (representing a source file) or - * <code>IClassFile</code> (representing a binary class file). - * The children are listed in no particular order. - * </p> - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - - - * <p> - * The name of package fragment for the default package (value: the empty - * string, <code>""</code>). - * </p> - - - - - - - * Returns whether this fragment contains at least one Java resource. - * @return true if this fragment contains at least one Java resource, false otherwise - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - - - - - - - - * Creates and returns a compilation unit in this package fragment - * with the specified name and contents. No verification is performed - * on the contents. - * - * <p>It is possible that a compilation unit with the same name already exists in this - * package fragment. - * The value of the <code>force</code> parameter affects the resolution of - * such a conflict:<ul> - * <li> <code>true</code> - in this case the compilation is created with the new contents</li> - * <li> <code>false</code> - in this case a <code>JavaModelException</code> is thrown</li> - * </ul> - * - * @param contents the given contents - * @param force specify how to handle conflict is the same name already exists - * @param monitor the given progress monitor - * @param name the given name - * @exception JavaModelException if the element could not be created. Reasons include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while creating an underlying resource - * <li> The name is not a valid compilation unit name (INVALID_NAME) - * <li> The contents are <code>null</code> (INVALID_CONTENTS) - * </ul> - * @return a compilation unit in this package fragment - * with the specified name and contents - - - - - - - - - - - - * Returns the class file with the specified name - * in this package (for example, <code>"Object.class"</code>). - * The ".class" suffix is required. - * This is a handle-only method. The class file may or may not be present. - * @param name the given name - * @return the class file with the specified name in this package - - - - - - - - - * Returns all of the class files in this package fragment. - * - * <p>Note: it is possible that a package fragment contains only - * compilation units (in other words, its kind is <code>K_SOURCE</code>), in - * which case this method returns an empty collection. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return all of the class files in this package fragment - - - - - - - - - - - * Returns the compilation unit with the specified name - * in this package (for example, <code>"Object.java"</code>). - * The name has to be a valid compilation unit name. - * This is a handle-only method. The compilation unit may or may not be present. - * - * @param name the given name - * @return the compilation unit with the specified name in this package - * @see JavaConventions#validateCompilationUnitName(String name, String sourceLevel, String complianceLevel) - - - - - - - - - * Returns all of the compilation units in this package fragment. - * - * <p>Note: it is possible that a package fragment contains only - * class files (in other words, its kind is <code>K_BINARY</code>), in which - * case this method returns an empty collection. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return all of the compilation units in this package fragment - - - - - - - - - - - * Returns all of the compilation units in this package fragment that are - * in working copy mode and that have the given owner. - * <p> - * Only existing working copies are returned. So a compilation unit handle that has no - * corresponding resource on disk will be included if and only if is in working copy mode. - * </p> - * <p>Note: it is possible that a package fragment contains only - * class files (in other words, its kind is <code>K_BINARY</code>), in which - * case this method returns an empty collection. - * </p> - * - * @param owner the owner of the returned compilation units - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return all of the compilation units in this package fragment - * @since 3.0 - - - - - - - - - - - - * Returns the dot-separated package name of this fragment, for example - * <code>"java.lang"</code>, or <code>""</code> (the empty string), - * for the default package. - * - * @return the dot-separated package name of this fragment - - - - - - - - * Returns this package fragment's root kind encoded as an integer. - * A package fragment can contain source files (i.e. files with one of - * the {@link JavaCore#getJavaLikeExtensions() Java-like extensions}), - * or <code>.class</code> files. This is a convenience method. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return this package fragment's root kind encoded as an integer - * @see IPackageFragmentRoot#K_SOURCE - * @see IPackageFragmentRoot#K_BINARY - - - - - - - - * Returns an array of non-Java resources contained in this package fragment. - * <p> - * Non-Java resources includes other files and folders located in the same - * directory as the compilation units or class files for this package - * fragment. Source files excluded from this package by virtue of - * inclusion/exclusion patterns on the corresponding source classpath entry - * are considered non-Java resources and will appear in the result - * (possibly in a folder). - * </p><p> - * Since 3.3, if this package fragment is inside an archive, the non-Java resources - * are a tree of {@link IJarEntryResource}s. One can navigate this tree using - * the {@link IJarEntryResource#getChildren()} and - * {@link IJarEntryResource#getParent()} methods. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return an array of non-Java resources (<code>IFile</code>s, - * <code>IFolder</code>s, or <code>IStorage</code>s if the - * package fragment is in an archive) contained in this package - * fragment - * @see IClasspathEntry#getInclusionPatterns() - * @see IClasspathEntry#getExclusionPatterns() - - - - - - - - - - - * Returns whether this package fragment's name is - * a prefix of other package fragments in this package fragment's - * root. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return true if this package fragment's name is a prefix of other package fragments in this package fragment's root, false otherwise - - - - - - - - * Returns whether this package fragment is a default package. - * This is a handle-only method. - * - * @return true if this package fragment is a default package - - - - - - - - - * A package fragment root contains a set of package fragments. - * It corresponds to an underlying resource which is either a folder, - * JAR, or zip. In the case of a folder, all descendant folders represent - * package fragments. For a given child folder representing a package fragment, - * the corresponding package name is composed of the folder names between the folder - * for this root and the child folder representing the package, separated by '.'. - * In the case of a JAR or zip, the contents of the archive dictates - * the set of package fragments in an analogous manner. - * Package fragment roots need to be opened before they can be navigated or manipulated. - * The children are of type <code>IPackageFragment</code>, and are in no particular order. - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - - * Kind constant for a source path root. Indicates this root - * only contains source files. - - - - - - - * Kind constant for a binary path root. Indicates this - * root only contains binary files. - - - - - - - * Empty root path - - - - - - - * Update model flag constant (bit mask value 1) indicating that the operation - * is to not copy/move/delete the package fragment root resource. - * @since 2.1 - - - - - - - * Update model flag constant (bit mask value 2) indicating that the operation - * is to update the classpath of the originating project. - * @since 2.1 - - - - - - - * Update model flag constant (bit mask value 4) indicating that the operation - * is to update the classpath of all referring projects except the originating project. - * @since 2.1 - - - - - - - * Update model flag constant (bit mask value 8) indicating that the operation - * is to update the classpath of the destination project. - * @since 2.1 - - - - - - - * Update model flag constant (bit mask value 16) indicating that the operation - * is to replace the resource and the destination project's classpath entry. - * @since 2.1 - - - - - - - * Attaches the source archive identified by the given absolute path to this - * binary package fragment root. <code>rootPath</code> specifies the location - * of the root within the archive or folder (empty specifies the default root - * and <code>null</code> specifies the root path should be detected). - * Once a source archive or folder is attached to the package fragment root, - * the <code>getSource</code> and <code>getSourceRange</code> - * methods become operational for binary types/members. - * To detach a source archive or folder from a package fragment root, specify - * <code>null</code> as the source path. - * - * @param sourcePath the given absolute path to the source archive or folder - * @param rootPath specifies the location of the root within the archive - * (empty specifies the default root and <code>null</code> specifies - * automatic detection of the root path) - * @param monitor the given progress monitor - * @exception JavaModelException if this operation fails. Reasons include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while updating a server property - * <li> This package fragment root is not of kind binary (INVALID_ELEMENT_TYPES) - * <li> The path provided is not absolute (RELATIVE_PATH) - * </ul> - - - - - - - - - - * Copies the resource of this package fragment root to the destination path - * as specified by <code>IResource.copy(IPath, int, IProgressMonitor)</code> - * but excluding nested source folders. - * <p> - * If <code>NO_RESOURCE_MODIFICATION</code> is specified in - * <code>updateModelFlags</code> or if this package fragment root is external, - * this operation doesn't copy the resource. <code>updateResourceFlags</code> - * is then ignored. - * </p><p> - * If <code>DESTINATION_PROJECT_CLASSPATH</code> is specified in - * <code>updateModelFlags</code>, updates the classpath of the - * destination's project (if it is a Java project). If a non-<code>null</code> - * sibling is specified, a copy of this root's classpath entry is inserted before the - * sibling on the destination project's raw classpath. If <code>null</code> is - * specified, the classpath entry is added at the end of the raw classpath. - * </p><p> - * If <code>REPLACE</code> is specified in <code>updateModelFlags</code>, - * overwrites the resource at the destination path if any. - * If the same classpath entry already exists on the destination project's raw - * classpath, then the sibling is ignored and the new classpath entry replaces the - * existing one. - * </p><p> - * If no flags is specified in <code>updateModelFlags</code> (using - * <code>IResource.NONE</code>), the default behavior applies: the - * resource is copied (if this package fragment root is not external) and the - * classpath is not updated. - * </p> - * - * @param destination the destination path - * @param updateResourceFlags bit-wise or of update resource flag constants - * (<code>IResource.FORCE</code> and <code>IResource.SHALLOW</code>) - * @param updateModelFlags bit-wise or of update resource flag constants - * (<code>DESTINATION_PROJECT_CLASSPATH</code> and - * <code>NO_RESOURCE_MODIFICATION</code>) - * @param sibling the classpath entry before which a copy of the classpath - * entry should be inserted or <code>null</code> if the classpath entry should - * be inserted at the end - * @param monitor a progress monitor - * - * @exception JavaModelException if this root could not be copied. Reasons - * include: - * <ul> - * <li> This root does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while copying the - * resource or updating a classpath</li> - * <li> - * The destination is not inside an existing project and <code>updateModelFlags</code> - * has been specified as <code>DESTINATION_PROJECT_CLASSPATH</code> - * (INVALID_DESTINATION)</li> - * <li> The sibling is not a classpath entry on the destination project's - * raw classpath (INVALID_SIBLING)</li> - * <li> The same classpath entry already exists on the destination project's - * classpath (NAME_COLLISION) and <code>updateModelFlags</code> - * has not been specified as <code>REPLACE</code></li> - * </ul> - * @see org.eclipse.core.resources.IResource#copy(IPath, boolean, IProgressMonitor) - * @since 2.1 - - - - - - - - - - - - * Creates and returns a package fragment in this root with the - * given dot-separated package name. An empty string specifies the default package. - * This has the side effect of creating all package - * fragments that are a prefix of the new package fragment which - * do not exist yet. If the package fragment already exists, this - * has no effect. - * - * For a description of the <code>force</code> flag, see <code>IFolder.create</code>. - * - * @param name the given dot-separated package name - * @param force a flag controlling how to deal with resources that - * are not in sync with the local file system - * @param monitor the given progress monitor - * @exception JavaModelException if the element could not be created. Reasons include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while creating an underlying resource - * <li> This package fragment root is read only (READ_ONLY) - * <li> The name is not a valid package name (INVALID_NAME) - * </ul> - * @return a package fragment in this root with the given dot-separated package name - * @see org.eclipse.core.resources.IFolder#create(boolean, boolean, IProgressMonitor) - - - - - - - - - - - * Deletes the resource of this package fragment root as specified by - * <code>IResource.delete(int, IProgressMonitor)</code> but excluding nested - * source folders. - * <p> - * If <code>NO_RESOURCE_MODIFICATION</code> is specified in - * <code>updateModelFlags</code> or if this package fragment root is external, - * this operation doesn't delete the resource. <code>updateResourceFlags</code> - * is then ignored. - * </p><p> - * If <code>ORIGINATING_PROJECT_CLASSPATH</code> is specified in - * <code>updateModelFlags</code>, update the raw classpath of this package - * fragment root's project by removing the corresponding classpath entry. - * </p><p> - * If <code>OTHER_REFERRING_PROJECTS_CLASSPATH</code> is specified in - * <code>updateModelFlags</code>, update the raw classpaths of all other Java - * projects referring to this root's resource by removing the corresponding classpath - * entries. - * </p><p> - * If no flags is specified in <code>updateModelFlags</code> (using - * <code>IResource.NONE</code>), the default behavior applies: the - * resource is deleted (if this package fragment root is not external) and no - * classpaths are updated. - * </p> - * - * @param updateResourceFlags bit-wise or of update resource flag constants - * (<code>IResource.FORCE</code> and <code>IResource.KEEP_HISTORY</code>) - * @param updateModelFlags bit-wise or of update resource flag constants - * (<code>ORIGINATING_PROJECT_CLASSPATH</code>, - * <code>OTHER_REFERRING_PROJECTS_CLASSPATH</code> and - * <code>NO_RESOURCE_MODIFICATION</code>) - * @param monitor a progress monitor - * - * @exception JavaModelException if this root could not be deleted. Reasons - * include: - * <ul> - * <li> This root does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while deleting the resource - * or updating a classpath - * </li> - * </ul> - * @see org.eclipse.core.resources.IResource#delete(boolean, IProgressMonitor) - * @since 2.1 - - - - - - - - - - * Returns this package fragment root's kind encoded as an integer. - * A package fragment root can contain source files (i.e. files with one - * of the {@link JavaCore#getJavaLikeExtensions() Java-like extensions}, - * or <code>.class</code> files, but not both. - * If the underlying folder or archive contains other kinds of files, they are ignored. - * In particular, <code>.class</code> files are ignored under a source package fragment root, - * and source files are ignored under a binary package fragment root. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return this package fragment root's kind encoded as an integer - * @see IPackageFragmentRoot#K_SOURCE - * @see IPackageFragmentRoot#K_BINARY - - - - - - - - * Returns an array of non-Java resources contained in this package fragment root. - * <p> - * Non-Java resources includes other files and folders located in the same - * directories as the compilation units or class files under this package - * fragment root. Resources excluded from this package fragment root - * by virtue of inclusion/exclusion patterns on the corresponding source classpath - * entry are considered non-Java resources and will appear in the result - * (possibly in a folder). Thus when a nested source folder is excluded, it will appear - * in the non-Java resources of the outer folder. - * </p><p> - * Since 3.3, if this package fragment root is an archive, the non-Java resources - * are a tree of {@link IJarEntryResource}s. One can navigate this tree using - * the {@link IJarEntryResource#getChildren()} and - * {@link IJarEntryResource#getParent()} methods. - * </p> - * - * @return an array of non-Java resources (<code>IFile</code>s, - * <code>IFolder</code>s, or <code>IStorage</code>s if the - * package fragment root is in archive) contained in this package - * fragment root - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @see IClasspathEntry#getInclusionPatterns() - * @see IClasspathEntry#getExclusionPatterns() - - - - - - - - - - - * Returns the package fragment with the given package name. - * An empty string indicates the default package. - * This is a handle-only operation. The package fragment - * may or may not exist. - * - * @param packageName the given package name - * @return the package fragment with the given package name - - - - - - - - - * Returns the first raw classpath entry that corresponds to this package - * fragment root. - * A raw classpath entry corresponds to a package fragment root if once resolved - * this entry's path is equal to the root's path. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the first raw classpath entry that corresponds to this package fragment root - * @since 2.0 - - - - - - - - * Returns the first resolved classpath entry that corresponds to this package fragment root. - * A resolved classpath entry is said to correspond to a root if the path of the resolved - * entry is equal to the root's path. - * - * @return the first resolved classpath entry that corresponds to this package fragment root - * @throws JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 3.6 - - - - - - - - * Returns the absolute path to the source archive attached to - * this package fragment root's binary archive. - * - * @return the absolute path to the corresponding source archive, - * or <code>null</code> if this package fragment root's binary archive - * has no corresponding source archive, or if this package fragment root - * is not a binary archive - * @exception JavaModelException if this operation fails - - - - - - - - * Returns the path within this package fragment root's source archive. - * An empty path indicates that packages are located at the root of the - * source archive. - * - * @return the path within the corresponding source archive, - * or <code>null</code> if this package fragment root's binary archive - * has no corresponding source archive, or if this package fragment root - * is not a binary archive - * @exception JavaModelException if this operation fails - - - - - - - - * Returns whether this package fragment root's underlying - * resource is a binary archive (a JAR or zip file). - * <p> - * This is a handle-only method. - * </p> - * - * @return true if this package fragment root's underlying resource is a binary archive, false otherwise - - - - - - - - * Returns whether this package fragment root is external - * to the workbench (that is, a local file), and has no - * underlying resource. - * <p> - * This is a handle-only method. - * </p> - * - * @return true if this package fragment root is external - * to the workbench (that is, a local file), and has no - * underlying resource, false otherwise - - - - - - - - * Moves the resource of this package fragment root to the destination path - * as specified by <code>IResource.move(IPath,int,IProgressMonitor)</code> - * but excluding nested source folders. - * <p> - * If <code>NO_RESOURCE_MODIFICATION</code> is specified in - * <code>updateModelFlags</code> or if this package fragment root is external, - * this operation doesn't move the resource. <code>updateResourceFlags</code> - * is then ignored. - * </p><p> - * If <code>DESTINATION_PROJECT_CLASSPATH</code> is specified in - * <code>updateModelFlags</code>, updates the classpath of the - * destination's project (if it is a Java project). If a non-<code>null</code> - * sibling is specified, a copy of this root's classpath entry is inserted before the - * sibling on the destination project's raw classpath. If <code>null</code> is - * specified, the classpath entry is added at the end of the raw classpath. - * </p><p> - * If <code>ORIGINATING_PROJECT_CLASSPATH</code> is specified in - * <code>updateModelFlags</code>, update the raw classpath of this package - * fragment root's project by removing the corresponding classpath entry. - * </p><p> - * If <code>OTHER_REFERRING_PROJECTS_CLASSPATH</code> is specified in - * <code>updateModelFlags</code>, update the raw classpaths of all other Java - * projects referring to this root's resource by removing the corresponding classpath - * entries. - * </p><p> - * If <code>REPLACE</code> is specified in <code>updateModelFlags</code>, - * overwrites the resource at the destination path if any. - * If the same classpath entry already exists on the destination project's raw - * classpath, then the sibling is ignored and the new classpath entry replaces the - * existing one. - * </p><p> - * If no flags is specified in <code>updateModelFlags</code> (using - * <code>IResource.NONE</code>), the default behavior applies: the - * resource is moved (if this package fragment root is not external) and no - * classpaths are updated. - * </p> - * - * @param destination the destination path - * @param updateResourceFlags bit-wise or of update flag constants - * (<code>IResource.FORCE</code>, <code>IResource.KEEP_HISTORY</code> - * and <code>IResource.SHALLOW</code>) - * @param updateModelFlags bit-wise or of update resource flag constants - * (<code>DESTINATION_PROJECT_CLASSPATH</code>, - * <code>ORIGINATING_PROJECT_CLASSPATH</code>, - * <code>OTHER_REFERRING_PROJECTS_CLASSPATH</code> and - * <code>NO_RESOURCE_MODIFICATION</code>) - * @param sibling the classpath entry before which a copy of the classpath - * entry should be inserted or <code>null</code> if the classpath entry should - * be inserted at the end - * @param monitor a progress monitor - * - * @exception JavaModelException if this root could not be moved. Reasons - * include: - * <ul> - * <li> This root does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while copying the - * resource or updating a classpath</li> - * <li> - * The destination is not inside an existing project and <code>updateModelFlags</code> - * has been specified as <code>DESTINATION_PROJECT_CLASSPATH</code> - * (INVALID_DESTINATION)</li> - * <li> The sibling is not a classpath entry on the destination project's - * raw classpath (INVALID_SIBLING)</li> - * <li> The same classpath entry already exists on the destination project's - * classpath (NAME_COLLISION) and <code>updateModelFlags</code> - * has not been specified as <code>REPLACE</code></li> - * </ul> - * @see org.eclipse.core.resources.IResource#move(IPath, boolean, IProgressMonitor) - * @since 2.1 - - - - - - - - - - - - - * Common protocol for Java elements that contain other Java elements. - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - * Returns the immediate children of this element. - * Unless otherwise specified by the implementing element, - * the children are in no particular order. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - * @return the immediate children of this element - - - - - - - - - - - * Returns whether this element has one or more immediate children. - * This is a convenience method, and may be more efficient than - * testing whether <code>getChildren</code> is an empty array. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - * @return true if the immediate children of this element, false otherwise - - - - - - - - - * A callback interface for receiving java problem as they are discovered - * by some Java operation. - * - * @see IProblem - * @since 2.0 - - - - - - * Notification of a Java problem. - * - * @param problem IProblem - The discovered Java problem. - - - - - - - - * Notification sent before starting the problem detection process. - * Typically, this would tell a problem collector to clear previously recorded problems. - - - - - - - * Notification sent after having completed problem detection process. - * Typically, this would tell a problem collector that no more problems should be expected in this - * iteration. - - - - - - - * Predicate allowing the problem requestor to signal whether or not it is currently - * interested by problem reports. When answering <code>false</code>, problem will - * not be discovered any more until the next iteration. - * - * This predicate will be invoked once prior to each problem detection iteration. - * - * @return boolean - indicates whether the requestor is currently interested by problems. - - - - - - - - - * A Java model region describes a hierarchical set of elements. - * Regions are often used to describe a set of elements to be considered - * when performing operations; for example, the set of elements to be - * considered during a search. A region may include elements from different - * projects. - * <p> - * When an element is included in a region, all of its children - * are considered to be included. Children of an included element - * <b>cannot</b> be selectively excluded. - * </p> - * <p> - * Instances can be created via the <code>JavaCore.newRegion</code>. - * </p> - * - * @see JavaCore#newRegion() - * @noimplement This interface is not intended to be implemented by clients. - - - - - - * Adds the given element and all of its descendents to this region. - * If the specified element is already included, or one of its - * ancestors is already included, this has no effect. If the element - * being added is an ancestor of an element already contained in this - * region, the ancestor subsumes the descendent. - * - * @param element the given element - - - - - - - - * Returns whether the given element is contained in this region. - * - * @param element the given element - * @return true if the given element is contained in this region, false otherwise - - - - - - - - - * Returns the top level elements in this region. - * All descendents of these elements are also included in this region. - * - * @return the top level elements in this region - - - - - - - - - - - * Removes the specified element from the region and returns - * <code>true</code> if successful, <code>false</code> if the remove - * fails. If an ancestor of the given element is included, the - * remove fails (in other words, it is not possible to selectively - * exclude descendants of included ancestors). - * - * @param element the given element - * @return <code>true</code> if successful, <code>false</code> if the remove fails - - - - - - - - - - * Common protocol for Java elements that support source code manipulations such - * as copy, move, rename, and delete. - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - * Copies this element to the given container. - * - * @param container the container - * @param sibling the sibling element before which the copy should be inserted, - * or <code>null</code> if the copy should be inserted as the last child of - * the container - * @param rename the new name for the element, or <code>null</code> if the copy - * retains the name of this element - * @param replace <code>true</code> if any existing child in the container with - * the target name should be replaced, and <code>false</code> to throw an - * exception in the event of a name collision - * @param monitor a progress monitor - * @exception JavaModelException if this element could not be copied. Reasons include: - * <ul> - * <li> This Java element, container element, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while updating an underlying resource - * <li> The container is of an incompatible type (INVALID_DESTINATION) - * <li> The sibling is not a child of the given container (INVALID_SIBLING) - * <li> The new name is invalid (INVALID_NAME) - * <li> A child in the container already exists with the same name (NAME_COLLISION) - * and <code>replace</code> has been specified as <code>false</code> - * <li> The container or this element is read-only (READ_ONLY) - * </ul> - * - * @exception IllegalArgumentException if container is <code>null</code> - * @see org.eclipse.jdt.core.IJavaModelStatusConstants#INVALID_DESTINATION - - - - - - - - - - - - * Deletes this element, forcing if specified and necessary. - * - * @param force a flag controlling whether underlying resources that are not - * in sync with the local file system will be tolerated (same as the force flag - * in IResource operations). - * @param monitor a progress monitor - * @exception JavaModelException if this element could not be deleted. Reasons include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while updating an underlying resource (CORE_EXCEPTION)</li> - * <li> This element is read-only (READ_ONLY)</li> - * </ul> - - - - - - - - - * Moves this element to the given container. - * - * @param container the container - * @param sibling the sibling element before which the element should be inserted, - * or <code>null</code> if the element should be inserted as the last child of - * the container - * @param rename the new name for the element, or <code>null</code> if the - * element retains its name - * @param replace <code>true</code> if any existing child in the container with - * the target name should be replaced, and <code>false</code> to throw an - * exception in the event of a name collision - * @param monitor a progress monitor - * @exception JavaModelException if this element could not be moved. Reasons include: - * <ul> - * <li> This Java element, container element, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while updating an underlying resource - * <li> The container is of an incompatible type (INVALID_DESTINATION) - * <li> The sibling is not a child of the given container (INVALID_SIBLING) - * <li> The new name is invalid (INVALID_NAME) - * <li> A child in the container already exists with the same name (NAME_COLLISION) - * and <code>replace</code> has been specified as <code>false</code> - * <li> The container or this element is read-only (READ_ONLY) - * </ul> - * - * @exception IllegalArgumentException if container is <code>null</code> - * @see org.eclipse.jdt.core.IJavaModelStatusConstants#INVALID_DESTINATION - - - - - - - - - - - - * Renames this element to the given name. - * - * @param name the new name for the element - * @param replace <code>true</code> if any existing element with the target name - * should be replaced, and <code>false</code> to throw an exception in the - * event of a name collision - * @param monitor a progress monitor - * @exception JavaModelException if this element could not be renamed. Reasons include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while updating an underlying resource - * <li> The new name is invalid (INVALID_NAME) - * <li> A child in the container already exists with the same name (NAME_COLLISION) - * and <code>replace</code> has been specified as <code>false</code> - * <li> This element is read-only (READ_ONLY) - * </ul> - - - - - - - - - - - * A source range defines an element's source coordinates relative to - * its source buffer. - * - * <p>Clients may use the method {@link org.eclipse.jdt.core.SourceRange#isAvailable(ISourceRange)} - * in order to find out if a source range is available. This method returns <code>false</code> - * when the source range offset is equals to <code>-1</code>.</p> - * - * <p>Clients may use the default implementation provided by {@link SourceRange}.</p> - * - * @see SourceRange - * @noimplement This interface is not intended to be implemented by clients. - - - - - - * Returns the number of characters of the source code for this element, - * relative to the source buffer in which this element is contained. - * - * @return the number of characters of the source code for this element, - * relative to the source buffer in which this element is contained - - - - - - - - * Returns the 0-based index of the first character of the source code for this element, - * relative to the source buffer in which this element is contained. However, if the element - * has no associated source code, an implementation may return -1. - * - * @return the 0-based index of the first character of the source code for this element, - * relative to the source buffer in which this element is contained. However, if the element - * has no associated source code, an implementation may return -1. - - - - - - - - - * Common protocol for Java elements that have associated source code. - * This set consists of {@link IClassFile}, {@link ICompilationUnit}, - * {@link IPackageDeclaration}, {@link IImportDeclaration}, - * {@link IImportContainer}, {@link IType}, {@link IField}, - * {@link IMethod}, {@link IInitializer}, {@link ITypeParameter}, - * {@link ILocalVariable}, and {@link IAnnotation}. - * <p> - * Note: For <code>IClassFile</code>, <code>IType</code> and other members - * derived from a binary type, the implementation returns source iff the - * element has attached source code. - * </p> - * <p> - * Source reference elements may be working copies if they were created from - * a compilation unit that is a working copy. - * </p> - * - * @see IPackageFragmentRoot#attachSource(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor) - * @noimplement This interface is not intended to be implemented by clients. - - - - - - * Returns whether this element exists in the model. - * - * @return <code>true</code> if this element exists in the Java model - * @since 2.0 - - - - - - - - * Returns the source code associated with this element. - * This extracts the substring from the source buffer containing this source - * element. This corresponds to the source range that would be returned by - * <code>getSourceRange</code>. - * <p> - * For class files, this returns the source of the entire compilation unit - * associated with the class file (if there is one). - * </p> - * - * @return the source code, or <code>null</code> if this element has no - * associated source code - * @exception JavaModelException if an exception occurs while accessing its corresponding resource - - - - - - - - * Returns the source range associated with this element. - * <p> - * For class files, this returns the range of the entire compilation unit - * associated with the class file (if there is one). - * </p> - * <p> - * If this element has no associated source code, either <code>null</code> is returned, - * or a source range with a -1 offset and a 0 length. {@link SourceRange#isAvailable(ISourceRange)} - * can be used to detect that case. - * </p> - * - * @return the source range, or either <code>null</code> or [-1, 0] if this element has no - * associated source code - * @exception JavaModelException if an exception occurs while accessing its corresponding resource - * @see SourceRange#isAvailable(ISourceRange) - - - - - - - - * Returns the name range associated with this element. - * - * <p>If the element is an {@link IMember}, it returns - * the source range of this member's simple name, - * or <code>null</code> if this member does not have a name - * (for example, an initializer), or if this member does not have - * associated source code (for example, a binary type).</p> - * - * <p>If this element is an {@link IImportDeclaration}, the source range - * of this import declaration's name, or <code>null</code> if this import - * declaration does not have associated source code (for example, a binary type). - * <br>The source range for the name includes the trailing '*' if the call to - * {@link IImportDeclaration#isOnDemand()} returns true. - * </p> - * - * <p>If this element is an {@link IPackageDeclaration}, the source range of - * this package declaration's name, or <code>null</code> if this package - * declaration does not have associated source code (for example, a binary type).</p> - * - * <p>If this element is an {@link IAnnotation}, the source range of - * this annotation's name, or <code>null</code> if this annotation does not have - * associated source code (for example, in a binary type).</p> - * - * <p>If this element is an {@link ITypeParameter}, the source range of this - * type parameter's name, or <code>null</code> if this type parameter does not have - * associated source code (for example, in a binary type).</p> - * - * <p>If this element is an {@link ITypeRoot} or {@link IImportContainer}, it - * returns null.</p> - * - * @return the name range associated with this element, or <code>null</code> if - * not available - * - * @since 3.7 - - - - - - - - - * Represents either a source type in a compilation unit (either a top-level - * type, a member type, a local type or an anonymous type) - * or a binary type in a class file. Enumeration classes and annotation - * types are subkinds of classes and interfaces, respectively. - * <p> - * Note that the element name of an anonymous source type is always empty. - * </p><p> - * If a binary type cannot be parsed, its structure remains unknown. - * Use <code>IJavaElement.isStructureKnown</code> to determine whether this - * is the case. - * </p> - * <p> - * The children are of type <code>IMember</code>, which includes <code>IField</code>, - * <code>IMethod</code>, <code>IInitializer</code> and <code>IType</code>. - * The children are listed in the order in which they appear in the source or class file. - * </p> - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - * Do code completion inside a code snippet in the context of the current type. - * - * If the type has access to its source code and the insertion position is valid, - * then completion is performed against the source. Otherwise the completion is performed - * against the type structure and the given locals variables. - * - * @param snippet the code snippet - * @param insertion the position with in source where the snippet - * is inserted. This position must not be in comments. - * A possible value is -1, if the position is not known. - * @param position the position within snippet where the user - * is performing code assist. - * @param localVariableTypeNames an array (possibly empty) of fully qualified - * type names of local variables visible at the current scope - * @param localVariableNames an array (possibly empty) of local variable names - * that are visible at the current scope - * @param localVariableModifiers an array (possible empty) of modifiers for - * local variables - * @param isStatic whether the current scope is in a static context - * @param requestor the completion requestor - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 2.0 - * @deprecated Use {@link #codeComplete(char[],int,int,char[][],char[][],int[],boolean,CompletionRequestor)} instead. - - - - - - - - - - - - - - - - - - - - - - - - - - - * Do code completion inside a code snippet in the context of the current type. - * It considers types in the working copies with the given owner first. In other words, - * the owner's working copies will take precedence over their original compilation units - * in the workspace. - * <p> - * Note that if a working copy is empty, it will be as if the original compilation - * unit had been deleted. - * </p><p> - * If the type has access to its source code and the insertion position is valid, - * then completion is performed against the source. Otherwise the completion is performed - * against the type structure and the given locals variables. - * </p> - * - * @param snippet the code snippet - * @param insertion the position with in source where the snippet - * is inserted. This position must not be in comments. - * A possible value is -1, if the position is not known. - * @param position the position with in snippet where the user - * is performing code assist. - * @param localVariableTypeNames an array (possibly empty) of fully qualified - * type names of local variables visible at the current scope - * @param localVariableNames an array (possibly empty) of local variable names - * that are visible at the current scope - * @param localVariableModifiers an array (possible empty) of modifiers for - * local variables - * @param isStatic whether the current scope is in a static context - * @param requestor the completion requestor - * @param owner the owner of working copies that take precedence over their original compilation units - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 3.0 - * @deprecated Use {@link #codeComplete(char[],int,int,char[][],char[][],int[],boolean,CompletionRequestor,WorkingCopyOwner)} instead. - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Do code completion inside a code snippet in the context of the current type. - * - * If the type has access to its source code and the insertion position is valid, - * then completion is performed against the source. Otherwise the completion is performed - * against the type structure and the given locals variables. - * - * @param snippet the code snippet - * @param insertion the position with in source where the snippet - * is inserted. This position must not be in comments. - * A possible value is -1, if the position is not known. - * @param position the position within snippet where the user - * is performing code assist. - * @param localVariableTypeNames an array (possibly empty) of fully qualified - * type names of local variables visible at the current scope - * @param localVariableNames an array (possibly empty) of local variable names - * that are visible at the current scope - * @param localVariableModifiers an array (possible empty) of modifiers for - * local variables - * @param isStatic whether the current scope is in a static context - * @param requestor the completion requestor - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 3.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - * Do code completion inside a code snippet in the context of the current type. - * - * If the type has access to its source code and the insertion position is valid, - * then completion is performed against the source. Otherwise the completion is performed - * against the type structure and the given locals variables. - * <p> - * If {@link IProgressMonitor} is not <code>null</code> then some proposals which - * can be very long to compute are proposed. To avoid that the code assist operation - * take too much time a {@link IProgressMonitor} which automatically cancel the code - * assist operation when a specified amount of time is reached could be used. - * - * <pre> - * new IProgressMonitor() { - * private final static int TIMEOUT = 500; //ms - * private long endTime; - * public void beginTask(String name, int totalWork) { - * fEndTime= System.currentTimeMillis() + TIMEOUT; - * } - * public boolean isCanceled() { - * return endTime <= System.currentTimeMillis(); - * } - * ... - * }; - * </pre> - * <p> - * - * @param snippet the code snippet - * @param insertion the position with in source where the snippet - * is inserted. This position must not be in comments. - * A possible value is -1, if the position is not known. - * @param position the position within snippet where the user - * is performing code assist. - * @param localVariableTypeNames an array (possibly empty) of fully qualified - * type names of local variables visible at the current scope - * @param localVariableNames an array (possibly empty) of local variable names - * that are visible at the current scope - * @param localVariableModifiers an array (possible empty) of modifiers for - * local variables - * @param isStatic whether the current scope is in a static context - * @param requestor the completion requestor - * @param monitor the progress monitor used to report progress - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Do code completion inside a code snippet in the context of the current type. - * It considers types in the working copies with the given owner first. In other words, - * the owner's working copies will take precedence over their original compilation units - * in the workspace. - * <p> - * Note that if a working copy is empty, it will be as if the original compilation - * unit had been deleted. - * </p><p> - * If the type has access to its source code and the insertion position is valid, - * then completion is performed against the source. Otherwise the completion is performed - * against the type structure and the given locals variables. - * </p> - * - * @param snippet the code snippet - * @param insertion the position with in source where the snippet - * is inserted. This position must not be in comments. - * A possible value is -1, if the position is not known. - * @param position the position with in snippet where the user - * is performing code assist. - * @param localVariableTypeNames an array (possibly empty) of fully qualified - * type names of local variables visible at the current scope - * @param localVariableNames an array (possibly empty) of local variable names - * that are visible at the current scope - * @param localVariableModifiers an array (possible empty) of modifiers for - * local variables - * @param isStatic whether the current scope is in a static context - * @param requestor the completion requestor - * @param owner the owner of working copies that take precedence over their original compilation units - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 3.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Do code completion inside a code snippet in the context of the current type. - * It considers types in the working copies with the given owner first. In other words, - * the owner's working copies will take precedence over their original compilation units - * in the workspace. - * <p> - * Note that if a working copy is empty, it will be as if the original compilation - * unit had been deleted. - * </p><p> - * If the type has access to its source code and the insertion position is valid, - * then completion is performed against the source. Otherwise the completion is performed - * against the type structure and the given locals variables. - * </p> - * <p> - * If {@link IProgressMonitor} is not <code>null</code> then some proposals which - * can be very long to compute are proposed. To avoid that the code assist operation - * take too much time a {@link IProgressMonitor} which automatically cancel the code - * assist operation when a specified amount of time is reached could be used. - * - * <pre> - * new IProgressMonitor() { - * private final static int TIMEOUT = 500; //ms - * private long endTime; - * public void beginTask(String name, int totalWork) { - * endTime= System.currentTimeMillis() + TIMEOUT; - * } - * public boolean isCanceled() { - * return endTime <= System.currentTimeMillis(); - * } - * ... - * }; - * </pre> - * <p> - * - * @param snippet the code snippet - * @param insertion the position with in source where the snippet - * is inserted. This position must not be in comments. - * A possible value is -1, if the position is not known. - * @param position the position with in snippet where the user - * is performing code assist. - * @param localVariableTypeNames an array (possibly empty) of fully qualified - * type names of local variables visible at the current scope - * @param localVariableNames an array (possibly empty) of local variable names - * that are visible at the current scope - * @param localVariableModifiers an array (possible empty) of modifiers for - * local variables - * @param isStatic whether the current scope is in a static context - * @param requestor the completion requestor - * @param owner the owner of working copies that take precedence over their original compilation units - * @param monitor the progress monitor used to report progress - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Creates and returns a field in this type with the - * given contents. - * <p> - * Optionally, the new element can be positioned before the specified - * sibling. If no sibling is specified, the element will be inserted - * as the last field declaration in this type.</p> - * - * <p>It is possible that a field with the same name already exists in this type. - * The value of the <code>force</code> parameter affects the resolution of - * such a conflict:<ul> - * <li> <code>true</code> - in this case the field is created with the new contents</li> - * <li> <code>false</code> - in this case a <code>JavaModelException</code> is thrown</li> - * </ul></p> - * - * @param contents the given contents - * @param sibling the given sibling - * @param force a flag in case the same name already exists in this type - * @param monitor the given progress monitor - * @exception JavaModelException if the element could not be created. Reasons include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while updating an underlying resource - * <li> The specified sibling is not a child of this type (INVALID_SIBLING) - * <li> The contents could not be recognized as a field declaration (INVALID_CONTENTS) - * <li> This type is read-only (binary) (READ_ONLY) - * <li> There was a naming collision with an existing field (NAME_COLLISION) - * </ul> - * @return a field in this type with the given contents - - - - - - - - - - - - * Creates and returns a static initializer in this type with the - * given contents. - * <p> - * Optionally, the new element can be positioned before the specified - * sibling. If no sibling is specified, the new initializer is positioned - * after the last existing initializer declaration, or as the first member - * in the type if there are no initializers.</p> - * - * @param contents the given contents - * @param sibling the given sibling - * @param monitor the given progress monitor - * @exception JavaModelException if the element could not be created. Reasons include: - * <ul> - * <li> This element does not exist - * <li> A <code>CoreException</code> occurred while updating an underlying resource - * <li> The specified sibling is not a child of this type (INVALID_SIBLING) - * <li> The contents could not be recognized as an initializer declaration (INVALID_CONTENTS) - * <li> This type is read-only (binary) (READ_ONLY) - * </ul> - * @return a static initializer in this type with the given contents - - - - - - - - - - - * Creates and returns a method or constructor in this type with the - * given contents. - * <p> - * Optionally, the new element can be positioned before the specified - * sibling. If no sibling is specified, the element will be appended - * to this type. - * - * <p>It is possible that a method with the same signature already exists in this type. - * The value of the <code>force</code> parameter affects the resolution of - * such a conflict:<ul> - * <li> <code>true</code> - in this case the method is created with the new contents</li> - * <li> <code>false</code> - in this case a <code>JavaModelException</code> is thrown</li> - * </ul></p> - * - * @param contents the given contents - * @param sibling the given sibling - * @param force a flag in case the same name already exists in this type - * @param monitor the given progress monitor - * @exception JavaModelException if the element could not be created. Reasons include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while updating an underlying resource - * <li> The specified sibling is not a child of this type (INVALID_SIBLING) - * <li> The contents could not be recognized as a method or constructor - * declaration (INVALID_CONTENTS) - * <li> This type is read-only (binary) (READ_ONLY) - * <li> There was a naming collision with an existing method (NAME_COLLISION) - * </ul> - * @return a method or constructor in this type with the given contents - - - - - - - - - - - - * Creates and returns a type in this type with the - * given contents. - * <p> - * Optionally, the new type can be positioned before the specified - * sibling. If no sibling is specified, the type will be appended - * to this type.</p> - * - * <p>It is possible that a type with the same name already exists in this type. - * The value of the <code>force</code> parameter affects the resolution of - * such a conflict:<ul> - * <li> <code>true</code> - in this case the type is created with the new contents</li> - * <li> <code>false</code> - in this case a <code>JavaModelException</code> is thrown</li> - * </ul></p> - * - * @param contents the given contents - * @param sibling the given sibling - * @param force a flag in case the same name already exists in this type - * @param monitor the given progress monitor - * @exception JavaModelException if the element could not be created. Reasons include: - * <ul> - * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * <li> A <code>CoreException</code> occurred while updating an underlying resource - * <li> The specified sibling is not a child of this type (INVALID_SIBLING) - * <li> The contents could not be recognized as a type declaration (INVALID_CONTENTS) - * <li> This type is read-only (binary) (READ_ONLY) - * <li> There was a naming collision with an existing field (NAME_COLLISION) - * </ul> - * @return a type in this type with the given contents - - - - - - - - - - - - * Finds the methods in this type that correspond to - * the given method. - * A method m1 corresponds to another method m2 if: - * <ul> - * <li>m1 has the same element name as m2. - * <li>m1 has the same number of arguments as m2 and - * the simple names of the argument types must be equals. - * <li>m1 exists. - * </ul> - * @param method the given method - * @return the found method or <code>null</code> if no such methods can be found. - * - * @since 2.0 - - - - - - - - - - - - * Returns the children of this type that have the given category as a <code>@category</code> tag. - * Returns an empty array if no children with this category exist. - * - * <p> - * The results are listed in the order in which they appear in the source or class file. - * </p> - * - * @return the children for the given category. - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 3.2 - - - - - - - - - - - - * Returns the simple name of this type, unqualified by package or enclosing type. - * This is a handle-only method. - * - * @return the simple name of this type - - - - - - - - * Returns the field with the specified name - * in this type (for example, <code>"bar"</code>). - * This is a handle-only method. The field may or may not exist. - * - * @param name the given name - * @return the field with the specified name in this type - - - - - - - - - * Returns the fields declared by this type in the order in which they appear - * in the source or class file. For binary types, this includes synthetic fields. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the fields declared by this type - - - - - - - - - - - * Returns the fully qualified name of this type, - * including qualification for any containing types and packages. - * This is the name of the package, followed by <code>'.'</code>, - * followed by the type-qualified name. - * <p> - * <b>Note</b>: The enclosing type separator used in the type-qualified - * name is <code>'$'</code>, not <code>'.'</code>. - * </p> - * This method is fully equivalent to <code>getFullyQualifiedName('$')</code>. - * This is a handle-only method. - * - * @see IType#getTypeQualifiedName() - * @see IType#getFullyQualifiedName(char) - * @return the fully qualified name of this type - - - - - - - - * Returns the fully qualified name of this type, - * including qualification for any containing types and packages. - * This is the name of the package, followed by <code>'.'</code>, - * followed by the type-qualified name using the <code>enclosingTypeSeparator</code>. - * - * For example: - * <ul> - * <li>the fully qualified name of a class B defined as a member of a class A in a compilation unit A.java - * in a package x.y using the '.' separator is "x.y.A.B"</li> - * <li>the fully qualified name of a class B defined as a member of a class A in a compilation unit A.java - * in a package x.y using the '$' separator is "x.y.A$B"</li> - * <li>the fully qualified name of a binary type whose class file is x/y/A$B.class - * using the '.' separator is "x.y.A.B"</li> - * <li>the fully qualified name of a binary type whose class file is x/y/A$B.class - * using the '$' separator is "x.y.A$B"</li> - * <li>the fully qualified name of an anonymous binary type whose class file is x/y/A$1.class - * using the '.' separator is "x.y.A.1"</li> - * </ul> - * - * This is a handle-only method. - * - * @param enclosingTypeSeparator the given enclosing type separator - * @return the fully qualified name of this type, including qualification for any containing types and packages - * @see IType#getTypeQualifiedName(char) - * @since 2.0 - - - - - - - - - * Returns this type's fully qualified name using a '.' enclosing type separator - * followed by its type parameters between angle brackets if it is a generic type. - * For example, "p.X&lt;T&gt;", "java.util.Map&lt;java.lang.String, p.X&gt;" - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the fully qualified parameterized representation of this type - * @since 3.1 - - - - - - - - * Returns the initializer with the specified position relative to - * the order they are defined in the source. - * Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0). - * This is a handle-only method. The initializer may or may not be present. - * - * @param occurrenceCount the specified position - * @return the initializer with the specified position relative to the order they are defined in the source - - - - - - - - - * Returns the initializers declared by this type. For binary types this is an - * empty collection. For source types, the results are listed in the order in - * which they appear in the source. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the initializers declared by this type - - - - - - - - - - - * Returns the binding key for this type only if the given type is {@link #isResolved() resolved}. - * A binding key is a key that uniquely identifies this type. It allows access - * to generic info for parameterized types. - * - * <p>If the given type is not resolved, the returned key is simply the java element's key. - * </p> - * @return the binding key for this type - * @see org.eclipse.jdt.core.dom.IBinding#getKey() - * @see BindingKey - * @since 3.1 - * @see #isResolved() - - - - - - - - * Returns the method with the specified name and parameter types - * in this type (for example, <code>"foo", {"I", "QString;"}</code>). - * To get the handle for a constructor, the name specified must be the - * simple name of the enclosing type. - * This is a handle-only method. The method may or may not be present. - * <p> - * The type signatures may be either unresolved (for source types) - * or resolved (for binary types), and either basic (for basic types) - * or rich (for parameterized types). See {@link Signature} for details. - * </p> - * - * @param name the given name - * @param parameterTypeSignatures the given parameter types - * @return the method with the specified name and parameter types in this type - - - - - - - - - - - - - * Returns the methods and constructors declared by this type. - * For binary types, this may include the special <code>&lt;clinit&gt;</code> method - * and synthetic methods. - * <p> - * The results are listed in the order in which they appear in the source or class file. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the methods and constructors declared by this type - - - - - - - - - - - * Returns the package fragment in which this element is defined. - * This is a handle-only method. - * - * @return the package fragment in which this element is defined - - - - - - - - * Returns the name of this type's superclass, or <code>null</code> - * for source types that do not specify a superclass. - * <p> - * For interfaces, the superclass name is always <code>"java.lang.Object"</code>. - * For source types, the name as declared is returned, for binary types, - * the resolved, qualified name is returned. - * For anonymous types, the superclass name is the name appearing after the 'new' keyword'. - * If the superclass is a parameterized type, the string - * may include its type arguments enclosed in "&lt;&gt;". - * If the returned string is needed for anything other than display - * purposes, use {@link #getSuperclassTypeSignature()} which returns - * a structured type signature string containing more precise information. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the name of this type's superclass, or <code>null</code> for source types that do not specify a superclass - - - - - - - - * Returns the type signature of this type's superclass, or - * <code>null</code> if none. - * <p> - * The type signature may be either unresolved (for source types) - * or resolved (for binary types), and either basic (for basic types) - * or rich (for parameterized types). See {@link Signature} for details. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the type signature of this type's superclass, or - * <code>null</code> if none - * @since 3.0 - - - - - - - - * Returns the type signatures of the interfaces that this type - * implements or extends, in the order in which they are listed in the - * source. - * <p> - * For classes and enum types, this gives the interfaces that this - * class implements. For interfaces and annotation types, - * this gives the interfaces that this interface extends. - * An empty collection is returned if this type does not implement or - * extend any interfaces. For anonymous types, an empty collection is - * always returned. - * </p> - * <p> - * The type signatures may be either unresolved (for source types) - * or resolved (for binary types), and either basic (for basic types) - * or rich (for parameterized types). See {@link Signature} for details. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the type signatures of interfaces that this type implements - * or extends, in the order in which they are listed in the source, - * an empty collection if none - * @since 3.0 - - - - - - - - - - - * Returns the names of interfaces that this type implements or extends, - * in the order in which they are listed in the source. - * <p> - * For classes, this gives the interfaces that this class implements. - * For interfaces, this gives the interfaces that this interface extends. - * An empty collection is returned if this type does not implement or - * extend any interfaces. For source types, simple names are returned, - * for binary types, qualified names are returned. - * For anonymous types, an empty collection is always returned. - * If the list of supertypes includes parameterized types, - * the string may include type arguments enclosed in "&lt;&gt;". - * If the result is needed for anything other than display - * purposes, use {@link #getSuperInterfaceTypeSignatures()} which returns - * structured signature strings containing more precise information. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the names of interfaces that this type implements or extends, in the order in which they are listed in the source, - * an empty collection if none - - - - - - - - - - - * Returns the formal type parameter signatures for this type. - * Returns an empty array if this type has no formal type parameters. - * <p> - * The formal type parameter signatures may be either unresolved (for source - * types) or resolved (for binary types). See {@link Signature} for details. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the formal type parameter signatures of this type, - * in the order declared in the source, an empty array if none - * @see Signature - * @since 3.0 - - - - - - - - - - - * Returns the formal type parameters for this type. - * Returns an empty array if this type has no formal type parameters. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the formal type parameters of this type, - * in the order declared in the source, an empty array if none - * @since 3.1 - - - - - - - - - - - * Returns the member type declared in this type with the given simple name. - * This is a handle-only method. The type may or may not exist. - * - * @param name the given simple name - * @return the member type declared in this type with the given simple name - - - - - - - - - * Returns the type parameter declared in this type with the given name. - * This is a handle-only method. The type parameter may or may not exist. - * - * @param name the given simple name - * @return the type parameter declared in this type with the given name - * @since 3.1 - - - - - - - - - * Returns the type-qualified name of this type, - * including qualification for any enclosing types, - * but not including package qualification. - * For source types, this consists of the simple names of any enclosing types, - * separated by <code>'$'</code>, followed by the simple name of this type - * or the occurrence count of this type if it is anonymous. - * For binary types, this is the name of the class file without the ".class" suffix. - * This method is fully equivalent to <code>getTypeQualifiedName('$')</code>. - * This is a handle-only method. - * - * @see #getTypeQualifiedName(char) - * @return the type-qualified name of this type - - - - - - - - * Returns the type-qualified name of this type, - * including qualification for any enclosing types, - * but not including package qualification. - * For source types, this consists of the simple names of any enclosing types, - * separated by <code>enclosingTypeSeparator</code>, followed by the - * simple name of this type or the occurrence count of this type if it is anonymous. - * For binary types, this is the name of the class file without the ".class" suffix, - * and - since 3.4 - the '$' characters in the class file name are replaced with the - * <code>enclosingTypeSeparator</code> character. - * - * For example: - * <ul> - * <li>the type qualified name of a class B defined as a member of a class A - * using the '.' separator is "A.B"</li> - * <li>the type qualified name of a class B defined as a member of a class A - * using the '$' separator is "A$B"</li> - * <li>the type qualified name of a binary type whose class file is A$B.class - * using the '.' separator is "A.B"</li> - * <li>the type qualified name of a binary type whose class file is A$B.class - * using the '$' separator is "A$B"</li> - * <li>the type qualified name of an anonymous binary type whose class file is A$1.class - * using the '.' separator is "A.1"</li> - * </ul> - * - * This is a handle-only method. - * - * @param enclosingTypeSeparator the specified enclosing type separator - * @return the type-qualified name of this type - * @since 2.0 - - - - - - - - - * Returns the immediate member types declared by this type. - * The results are listed in the order in which they appear in the source or class file. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return the immediate member types declared by this type - - - - - - - - - - - * Returns whether this type represents an anonymous type. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return true if this type represents an anonymous type, false otherwise - * @since 2.0 - - - - - - - - * Returns whether this type represents a class. - * <p> - * Note that a class can neither be an interface, an enumeration class, nor an annotation type. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return true if this type represents a class, false otherwise - - - - - - - - * Returns whether this type represents an enumeration class. - * <p> - * Note that an enumeration class can neither be a class, an interface, nor an annotation type. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return true if this type represents an enumeration class, - * false otherwise - * @since 3.0 - - - - - - - - * Returns whether this type represents an interface. - * <p> - * Note that an interface can also be an annotation type, but it can neither be a class nor an enumeration class. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return true if this type represents an interface, false otherwise - - - - - - - - * Returns whether this type represents an annotation type. - * <p> - * Note that an annotation type is also an interface, but it can neither be a class nor an enumeration class. - * </p> - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return true if this type represents an annotation type, - * false otherwise - * @since 3.0 - - - - - - - - * Returns whether this type represents a local type. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return true if this type represents a local type, false otherwise - * @since 2.0 - - - - - - - - * Returns whether this type represents a member type. - * - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return true if this type represents a member type, false otherwise - * @since 2.0 - - - - - - - - * Returns whether this type represents a resolved type. - * If a type is resolved, its key contains resolved information. - * - * @return whether this type represents a resolved type. - * @since 3.1 - - - - - - - - * Loads a previously saved ITypeHierarchy from an input stream. A type hierarchy can - * be stored using ITypeHierachy#store(OutputStream). - * - * Only hierarchies originally created by the following methods can be loaded: - * <ul> - * <li>IType#newSupertypeHierarchy(IProgressMonitor)</li> - * <li>IType#newTypeHierarchy(IJavaProject, IProgressMonitor)</li> - * <li>IType#newTypeHierarchy(IProgressMonitor)</li> - * </ul> - * - * @param input stream where hierarchy will be read - * @param monitor the given progress monitor - * @return the stored hierarchy - * @exception JavaModelException if the hierarchy could not be restored, reasons include: - * - type is not the focus of the hierarchy or - * - unable to read the input stream (wrong format, IOException during reading, ...) - * @see ITypeHierarchy#store(java.io.OutputStream, IProgressMonitor) - * @since 2.1 - - - - - - - - - - * Creates and returns a type hierarchy for this type containing - * this type and all of its supertypes. - * - * @param monitor the given progress monitor - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return a type hierarchy for this type containing this type and all of its supertypes - - - - - - - - - * Creates and returns a type hierarchy for this type containing - * this type and all of its supertypes, considering types in the given - * working copies. In other words, the list of working copies will take - * precedence over their original compilation units in the workspace. - * <p> - * Note that passing an empty working copy will be as if the original compilation - * unit had been deleted. - * </p> - * - * @param workingCopies the working copies that take precedence over their original compilation units - * @param monitor the given progress monitor - * @return a type hierarchy for this type containing this type and all of its supertypes - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 3.0 - - - - - - - - - - - - - * Creates and returns a type hierarchy for this type containing - * this type and all of its supertypes, considering types in the given - * working copies. In other words, the list of working copies will take - * precedence over their original compilation units in the workspace. - * <p> - * Note that passing an empty working copy will be as if the original compilation - * unit had been deleted. - * </p> - * - * @param workingCopies the working copies that take precedence over their original compilation units - * @param monitor the given progress monitor - * @return a type hierarchy for this type containing this type and all of its supertypes - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 2.0 - * @deprecated Use {@link #newSupertypeHierarchy(ICompilationUnit[], IProgressMonitor)} instead - - - - - - - - - - - - - * Creates and returns a type hierarchy for this type containing - * this type and all of its supertypes, considering types in the - * working copies with the given owner. - * In other words, the owner's working copies will take - * precedence over their original compilation units in the workspace. - * <p> - * Note that if a working copy is empty, it will be as if the original compilation - * unit had been deleted. - * <p> - * - * @param owner the owner of working copies that take precedence over their original compilation units - * @param monitor the given progress monitor - * @return a type hierarchy for this type containing this type and all of its supertypes - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 3.0 - - - - - - - - - - * Creates and returns a type hierarchy for this type containing - * this type, all of its supertypes, and all its subtypes - * in the context of the given project. - * - * @param project the given project - * @param monitor the given progress monitor - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return a type hierarchy for this type containing - * this type, all of its supertypes, and all its subtypes - * in the context of the given project - - - - - - - - - - * Creates and returns a type hierarchy for this type containing - * this type, all of its supertypes, and all its subtypes - * in the context of the given project, considering types in the - * working copies with the given owner. - * In other words, the owner's working copies will take - * precedence over their original compilation units in the workspace. - * <p> - * Note that if a working copy is empty, it will be as if the original compilation - * unit had been deleted. - * <p> - * - * @param project the given project - * @param owner the owner of working copies that take precedence over their original compilation units - * @param monitor the given progress monitor - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return a type hierarchy for this type containing - * this type, all of its supertypes, and all its subtypes - * in the context of the given project - * @since 3.0 - - - - - - - - - - - * Creates and returns a type hierarchy for this type containing - * this type, all of its supertypes, and all its subtypes in the workspace. - * - * @param monitor the given progress monitor - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @return a type hierarchy for this type containing - * this type, all of its supertypes, and all its subtypes in the workspace - - - - - - - - - * Creates and returns a type hierarchy for this type containing - * this type, all of its supertypes, and all its subtypes in the workspace, - * considering types in the given working copies. In other words, the list of working - * copies that will take precedence over their original compilation units in the workspace. - * <p> - * Note that passing an empty working copy will be as if the original compilation - * unit had been deleted. - * - * @param workingCopies the working copies that take precedence over their original compilation units - * @param monitor the given progress monitor - * @return a type hierarchy for this type containing - * this type, all of its supertypes, and all its subtypes in the workspace - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 3.0 - - - - - - - - - - - - - * Creates and returns a type hierarchy for this type containing - * this type, all of its supertypes, and all its subtypes in the workspace, - * considering types in the given working copies. In other words, the list of working - * copies that will take precedence over their original compilation units in the workspace. - * <p> - * Note that passing an empty working copy will be as if the original compilation - * unit had been deleted. - * - * @param workingCopies the working copies that take precedence over their original compilation units - * @param monitor the given progress monitor - * @return a type hierarchy for this type containing - * this type, all of its supertypes, and all its subtypes in the workspace - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 2.0 - * @deprecated Use {@link #newTypeHierarchy(ICompilationUnit[], IProgressMonitor)} instead - - - - - - - - - - - - - * Creates and returns a type hierarchy for this type containing - * this type, all of its supertypes, and all its subtypes in the workspace, - * considering types in the working copies with the given owner. - * In other words, the owner's working copies will take - * precedence over their original compilation units in the workspace. - * <p> - * Note that if a working copy is empty, it will be as if the original compilation - * unit had been deleted. - * <p> - * - * @param owner the owner of working copies that take precedence over their original compilation units - * @param monitor the given progress monitor - * @return a type hierarchy for this type containing - * this type, all of its supertypes, and all its subtypes in the workspace - * @exception JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource. - * @since 3.0 - - - - - - - - - - * Resolves the given type name within the context of this type (depending on the type hierarchy - * and its imports). - * <p> - * Multiple answers might be found in case there are ambiguous matches. - * </p> - * <p> - * Each matching type name is decomposed as an array of two strings, the first denoting the package - * name (dot-separated) and the second being the type name. The package name is empty if it is the - * default package. The type name is the type qualified name using a '.' enclosing type separator. - * </p> - * <p> - * Returns <code>null</code> if unable to find any matching type. - * </p> - *<p> - * For example, resolution of <code>"Object"</code> would typically return - * <code>{{"java.lang", "Object"}}</code>. Another resolution that returns - * <code>{{"", "X.Inner"}}</code> represents the inner type Inner defined in type X in the - * default package. - * </p> - * - * @param typeName the given type name - * @exception JavaModelException if code resolve could not be performed. - * @return the resolved type names or <code>null</code> if unable to find any matching type - * @see #getTypeQualifiedName(char) - - - - - - - - - - - - * Resolves the given type name within the context of this type (depending on the type hierarchy - * and its imports) and using the given owner's working copies, considering types in the - * working copies with the given owner. In other words, the owner's working copies will take - * precedence over their original compilation units in the workspace. - * <p> - * Note that if a working copy is empty, it will be as if the original compilation - * unit had been deleted. - * </p> - * <p>Multiple answers might be found in case there are ambiguous matches. - * </p> - * <p> - * Each matching type name is decomposed as an array of two strings, the first denoting the package - * name (dot-separated) and the second being the type name. The package name is empty if it is the - * default package. The type name is the type qualified name using a '.' enclosing type separator. - * </p> - * <p> - * Returns <code>null</code> if unable to find any matching type. - *</p> - *<p> - * For example, resolution of <code>"Object"</code> would typically return - * <code>{{"java.lang", "Object"}}</code>. Another resolution that returns - * <code>{{"", "X.Inner"}}</code> represents the inner type Inner defined in type X in the - * default package. - * </p> - * - * @param typeName the given type name - * @param owner the owner of working copies that take precedence over their original compilation units - * @exception JavaModelException if code resolve could not be performed. - * @return the resolved type names or <code>null</code> if unable to find any matching type - * @see #getTypeQualifiedName(char) - * @since 3.0 - - - - - - - - - - - - - - * A type hierarchy provides navigations between a type and its resolved - * supertypes and subtypes for a specific type or for all types within a region. - * Supertypes may extend outside of the type hierarchy's region in which it was - * created such that the root of the hierarchy is always included. For example, if a type - * hierarchy is created for a <code>java.io.File</code>, and the region the hierarchy was - * created in is the package fragment <code>java.io</code>, the supertype - * <code>java.lang.Object</code> will still be included. As a historical quirk, - * <code>java.lang.Object</code> has always been included in type hierarchies - * created on interface types. - * <p> - * A type hierarchy is static and can become stale. Although consistent when - * created, it does not automatically track changes in the model. - * As changes in the model potentially invalidate the hierarchy, change notifications - * are sent to registered <code>ITypeHierarchyChangedListener</code>s. Listeners should - * use the <code>exists</code> method to determine if the hierarchy has become completely - * invalid (for example, when the type or project the hierarchy was created on - * has been removed). To refresh a hierarchy, use the <code>refresh</code> method. - * </p> - * <p> - * The type hierarchy may contain cycles due to malformed supertype declarations. - * Most type hierarchy queries are oblivious to cycles; the <code>getAll* </code> - * methods are implemented such that they are unaffected by cycles. - * </p> - * - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - * A listener which gets notified when a particular type hierarchy object - * changes. - * <p> - * This interface may be implemented by clients. - * </p> - - - - - - * Notifies that the given type hierarchy has changed in some way and should - * be refreshed at some point to make it consistent with the current state of - * the Java model. - * - * @param typeHierarchy the given type hierarchy - - - - - - - - - * Represents a type parameter defined by a type or a method - * in a compilation unit or a class file. - * <p> - * Type parameters are obtained using {@link IType#getTypeParameter(String)} and - * {@link IMethod#getTypeParameter(String)}. - * </p><p> - * Note that type parameters are not children of their declaring type or method. To get a list - * of the type parameters use {@link IType#getTypeParameters()} for a type and use - * {@link IMethod#getTypeParameters()} for a method. - * </p> - * - * @since 3.1 - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - * Returns the names of the class and interface bounds of this type parameter. Returns an empty - * array if this type parameter has no bounds. A bound name is the name as it appears in the - * source (without the <code>extends</code> keyword) if the type parameter comes from a - * compilation unit. It is the dot-separated fully qualified name of the bound if the type - * parameter comes from a class file. - * - * @return the names of the bounds - * @throws JavaModelException if this element does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - - - - * Returns the signatures for this type parameter's bounds. The type parameter may have - * been declared as part of a type or a method. The signatures represent only the individual - * bounds and do not include the type variable name or the <code>extends</code> keyword. - * The signatures may be either unresolved (for source types) or resolved (for binary types). - * See {@link Signature} for details. - * - * @return the signatures for the bounds of this formal type parameter - * @throws JavaModelException - * if this element does not exist or if an exception occurs while accessing its corresponding resource. - * @see Signature - * @since 3.6 - - - - - - - - - - - * Returns the declaring member of this type parameter. This can be either an <code>IType</code> - * or an <code>IMethod</code>. - * <p> - * This is a handle-only method. - * </p> - * - * @return the declaring member of this type parameter. - - - - - - - - * Returns the Java type root in which this type parameter is declared. - * <p> - * This is a handle-only method. - * </p> - * - * @return the Java type root in which this type parameter is declared - * @since 3.7 - - - - - - - - * Represents an entire Java type root (either an <code>ICompilationUnit</code> - * or an <code>IClassFile</code>). - * - * @see ICompilationUnit Note that methods {@link #findPrimaryType()} and {@link #getElementAt(int)} - * were already implemented in this interface respectively since version 3.0 and version 1.0. - * @see IClassFile Note that method {@link #getWorkingCopy(WorkingCopyOwner, IProgressMonitor)} - * was already implemented in this interface since version 3.0. - * @since 3.3 - * @noimplement This interface is not intended to be implemented by clients. - - - - - - - - - - - * Finds the primary type of this Java type root (that is, the type with the same name as the - * compilation unit, or the type of a class file), or <code>null</code> if no such a type exists. - * - * @return the found primary type of this Java type root, or <code>null</code> if no such a type exists - - - - - - - - * Returns the smallest element within this Java type root that - * includes the given source position (that is, a method, field, etc.), or - * <code>null</code> if there is no element other than the Java type root - * itself at the given position, or if the given position is not - * within the source range of the source of this Java type root. - * - * @param position a source position inside the Java type root - * @return the innermost Java element enclosing a given source position or <code>null</code> - * if none (excluding the Java type root). - * @throws JavaModelException if the Java type root does not exist or if an - * exception occurs while accessing its corresponding resource - - - - - - - - - - * Common protocol for Java elements that support working copies. - * <p> - * A working copy of a Java element acts just like a regular element (handle), - * except it is not attached to an underlying resource. A working copy is not - * visible to the rest of the Java model. Changes in a working copy's - * buffer are not realized in a resource. To bring the Java model up-to-date with a working - * copy's contents, an explicit commit must be performed on the working copy. - * Other operations performed on a working copy update the - * contents of the working copy's buffer but do not commit the contents - * of the working copy. - * </p> - * <p> - * Note: The contents of a working copy is determined when a working - * copy is created, based on the current content of the element the working - * copy is created from. If a working copy is an <code>IOpenable</code> and is explicitly - * closed, the working copy's buffer will be thrown away. However, clients should not - * explicitly open and close working copies. - * </p> - * <p> - * The client that creates a working copy is responsible for - * destroying the working copy. The Java model will never automatically - * destroy or close a working copy. (Note that destroying a working copy - * does not commit it to the model, it only frees up the memory occupied by - * the element). After a working copy is destroyed, the working copy cannot - * be accessed again. Non-handle methods will throw a - * <code>JavaModelException</code> indicating the Java element does not exist. - * </p> - * <p> - * A working copy cannot be created from another working copy. - * Calling <code>getWorkingCopy</code> on a working copy returns the receiver. - * </p> - * - * @deprecated Use {@link ICompilationUnit} instead - * @noimplement This interface is not intended to be implemented by clients. - - - - - - * Commits the contents of this working copy to its original element - * and underlying resource, bringing the Java model up-to-date with - * the current contents of the working copy. - * - * <p>It is possible that the contents of the original resource have changed - * since this working copy was created, in which case there is an update conflict. - * The value of the <code>force</code> parameter affects the resolution of - * such a conflict:<ul> - * <li> <code>true</code> - in this case the contents of this working copy are applied to - * the underlying resource even though this working copy was created before - * a subsequent change in the resource</li> - * <li> <code>false</code> - in this case a <code>JavaModelException</code> is thrown</li> - * </ul> - * <p> - * Since 2.1, a working copy can be created on a not-yet existing compilation - * unit. In particular, such a working copy can then be committed in order to create - * the corresponding compilation unit. - * </p> - * @param force a flag to handle the cases when the contents of the original resource have changed - * since this working copy was created - * @param monitor the given progress monitor - * @exception JavaModelException if this working copy could not commit. Reasons include: - * <ul> - * <li> A <code>CoreException</code> occurred while updating an underlying resource - * <li> This element is not a working copy (INVALID_ELEMENT_TYPES) - * <li> A update conflict (described above) (UPDATE_CONFLICT) - * </ul> - * @deprecated Use {@link ICompilationUnit#commitWorkingCopy(boolean, IProgressMonitor)} instead. - - - - - - - - - * Destroys this working copy, closing its buffer and discarding - * its structure. Subsequent attempts to access non-handle information - * for this working copy will result in <code>IJavaModelException</code>s. Has - * no effect if this element is not a working copy. - * <p> - * If this working copy is shared, it is destroyed only when the number of calls to - * <code>destroy()</code> is the same as the number of calls to <code> - * getSharedWorkingCopy(IProgressMonitor, IBufferFactory)</code>. - * </p><p> - * When it is destroyed, a REMOVED IJavaElementDelta is reported on this - * working copy. - * </p> - * @deprecated Use {@link ICompilationUnit#discardWorkingCopy()} instead. - - - - - - - * Finds the shared working copy for this element, given a <code>IBuffer</code> factory. - * If no working copy has been created for this element associated with this - * buffer factory, returns <code>null</code>. - * <p> - * Users of this method must not destroy the resulting working copy. - * - * @param bufferFactory the given <code>IBuffer</code> factory - * @return the found shared working copy for this element, <code>null</code> if none - * @see IBufferFactory - * @since 2.0 - * - * @deprecated Use {@link ICompilationUnit#findWorkingCopy(WorkingCopyOwner)} instead. - - - - - - - - - * Returns the original element the specified working copy element was created from, - * or <code>null</code> if this is not a working copy element. This is a handle - * only method, the returned element may or may not exist. - * - * @param workingCopyElement the specified working copy element - * @return the original element the specified working copy element was created from, - * or <code>null</code> if this is not a working copy element - * - * @deprecated Use {@link IJavaElement#getPrimaryElement()} instead. - - - - - - - - - * Returns the original element this working copy was created from, - * or <code>null</code> if this is not a working copy. - * - * @return the original element this working copy was created from, - * or <code>null</code> if this is not a working copy - * - * @deprecated Use {@link ICompilationUnit#getPrimaryElement()} instead. - - - - - - - - * Finds the elements in this compilation unit that correspond to - * the given element. - * An element A corresponds to an element B if: - * <ul> - * <li>A has the same element name as B. - * <li>If A is a method, A must have the same number of arguments as - * B and the simple names of the argument types must be equals. - * <li>The parent of A corresponds to the parent of B recursively up to - * their respective compilation units. - * <li>A exists. - * </ul> - * Returns <code>null</code> if no such java elements can be found - * or if the given element is not included in a compilation unit. - * - * @param element the given element - * @return the found elements in this compilation unit that correspond to the given element - * @since 2.0 - * - * @deprecated Use {@link ICompilationUnit#findElements(IJavaElement)} instead. - - - - - - - - - - - - * Finds the primary type of this compilation unit (that is, the type with the same name as the - * compilation unit), or <code>null</code> if no such a type exists. - * - * @return the found primary type of this compilation unit, or <code>null</code> if no such a type exists - * @since 2.0 - * - * @deprecated Use {@link ITypeRoot#findPrimaryType()} instead. - - - - - - - - * Returns a shared working copy on this element using the given factory to create - * the buffer, or this element if this element is already a working copy. - * This API can only answer an already existing working copy if it is based on the same - * original compilation unit AND was using the same buffer factory (that is, as defined by <code>Object.equals</code>). - * <p> - * The life time of a shared working copy is as follows: - * <ul> - * <li>The first call to <code>getSharedWorkingCopy(...)</code> creates a new working copy for this - * element</li> - * <li>Subsequent calls increment an internal counter.</li> - * <li>A call to <code>destroy()</code> decrements the internal counter.</li> - * <li>When this counter is 0, the working copy is destroyed. - * </ul> - * So users of this method must destroy exactly once the working copy. - * <p> - * Note that the buffer factory will be used for the life time of this working copy, that is if the - * working copy is closed then reopened, this factory will be used. - * The buffer will be automatically initialized with the original's compilation unit content - * upon creation. - * <p> - * When the shared working copy instance is created, an ADDED IJavaElementDelta is reported on this - * working copy. - * - * @param monitor a progress monitor used to report progress while opening this compilation unit - * or <code>null</code> if no progress should be reported - * @param factory the factory that creates a buffer that is used to get the content of the working copy - * or <code>null</code> if the internal factory should be used - * @param problemRequestor a requestor which will get notified of problems detected during - * reconciling as they are discovered. The requestor can be set to <code>null</code> indicating - * that the client is not interested in problems. - * @exception JavaModelException if the contents of this element can - * not be determined. - * @return a shared working copy on this element using the given factory to create - * the buffer, or this element if this element is already a working copy - * @see IBufferFactory - * @see IProblemRequestor - * @since 2.0 - * - * @deprecated Use {@link ICompilationUnit#getWorkingCopy(WorkingCopyOwner, IProblemRequestor, IProgressMonitor)} instead. - - - - - - - - - - - * Returns a new working copy of this element if this element is not - * a working copy, or this element if this element is already a working copy. - * <p> - * Note: if intending to share a working copy amongst several clients, then - * <code>#getSharedWorkingCopy</code> should be used instead. - * </p><p> - * When the working copy instance is created, an ADDED IJavaElementDelta is - * reported on this working copy. - * </p><p> - * Since 2.1, a working copy can be created on a not-yet existing compilation - * unit. In particular, such a working copy can then be committed in order to create - * the corresponding compilation unit. - * </p> - * @exception JavaModelException if the contents of this element can - * not be determined. - * @return a new working copy of this element if this element is not - * a working copy, or this element if this element is already a working copy - * - * @deprecated Use {@link ICompilationUnit#getWorkingCopy(IProgressMonitor)} instead. - - - - - - - - * Returns a new working copy of this element using the given factory to create - * the buffer, or this element if this element is already a working copy. - * Note that this factory will be used for the life time of this working copy, that is if the - * working copy is closed then reopened, this factory will be reused. - * The buffer will be automatically initialized with the original's compilation unit content - * upon creation. - * <p> - * Note: if intending to share a working copy amongst several clients, then - * <code>#getSharedWorkingCopy</code> should be used instead. - * </p><p> - * When the working copy instance is created, an ADDED IJavaElementDelta is - * reported on this working copy. - * </p><p> - * Since 2.1, a working copy can be created on a not-yet existing compilation - * unit. In particular, such a working copy can then be committed in order to create - * the corresponding compilation unit. - * </p> - * @param monitor a progress monitor used to report progress while opening this compilation unit - * or <code>null</code> if no progress should be reported - * @param factory the factory that creates a buffer that is used to get the content of the working copy - * or <code>null</code> if the internal factory should be used - * @param problemRequestor a requestor which will get notified of problems detected during - * reconciling as they are discovered. The requestor can be set to <code>null</code> indicating - * that the client is not interested in problems. - * @exception JavaModelException if the contents of this element can - * not be determined. - * @return a new working copy of this element using the given factory to create - * the buffer, or this element if this element is already a working copy - * @since 2.0 - * - * @deprecated Use {@link ICompilationUnit#getWorkingCopy(WorkingCopyOwner, IProblemRequestor, IProgressMonitor)} instead. - - - - - - - - - - - * Returns whether this working copy's original element's content - * has not changed since the inception of this working copy. - * - * @param resource this working copy's resource - * @return true if this working copy's original element's content - * has not changed since the inception of this working copy, false otherwise - * - * @deprecated Use {@link ICompilationUnit#hasResourceChanged()} instead. - - - - - - - - - * Returns whether this element is a working copy. - * - * @return true if this element is a working copy, false otherwise - * - * @deprecated Use {@link ICompilationUnit#isWorkingCopy()} instead. - - - - - - - - * Reconciles the contents of this working copy. - * It performs the reconciliation by locally caching the contents of - * the working copy, updating the contents, then creating a delta - * over the cached contents and the new contents, and finally firing - * this delta. - * <p> - * If the working copy hasn't changed, then no problem will be detected, - * this is equivalent to <code>IWorkingCopy#reconcile(false, null)</code>.</p> - * <p> - * Compilation problems found in the new contents are notified through the - * <code>IProblemRequestor</code> interface which was passed at - * creation, and no longer as transient markers. Therefore this API will - * return <code>null</code>.</p> - * <p> - * Note: Since 3.0 added/removed/changed inner types generate change deltas.</p> - * - * @exception JavaModelException if the contents of the original element - * cannot be accessed. Reasons include: - * <ul> - * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * </ul> - * @return <code>null</code> - * - * @deprecated Use {@link ICompilationUnit#reconcile(int, boolean, WorkingCopyOwner, IProgressMonitor)} instead. - - - - - - - - - - - * Reconciles the contents of this working copy. - * It performs the reconciliation by locally caching the contents of - * the working copy, updating the contents, then creating a delta - * over the cached contents and the new contents, and finally firing - * this delta. - * <p> - * The boolean argument allows to force problem detection even if the - * working copy is already consistent.</p> - * <p> - * Compilation problems found in the new contents are notified through the - * <code>IProblemRequestor</code> interface which was passed at - * creation, and no longer as transient markers. Therefore this API answers - * nothing.</p> - * <p> - * Note: Since 3.0 added/removed/changed inner types generate change deltas.</p> - * - * @param forceProblemDetection boolean indicating whether problem should be recomputed - * even if the source hasn't changed. - * @param monitor a progress monitor - * @exception JavaModelException if the contents of the original element - * cannot be accessed. Reasons include: - * <ul> - * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * </ul> - * @since 2.0 - * - * @deprecated Use {@link ICompilationUnit#reconcile(int, boolean, WorkingCopyOwner, IProgressMonitor)} instead. - - - - - - - - - * Restores the contents of this working copy to the current contents of - * this working copy's original element. Has no effect if this element - * is not a working copy. - * - * <p>Note: This is the inverse of committing the content of the - * working copy to the original element with <code>commit(boolean, IProgressMonitor)</code>. - * - * @exception JavaModelException if the contents of the original element - * cannot be accessed. Reasons include: - * <ul> - * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> - * </ul> - * @deprecated Use {@link ICompilationUnit#restore()} instead. - - - - - - - - * Provides methods for checking Java-specific conventions such as name syntax. - * <p> - * This class provides static methods and constants only. - * </p> - * @noinstantiate This class is not intended to be instantiated by clients. - - - - - - - - - * Returns whether the given package fragment root paths are considered - * to overlap. - * <p> - * Two root paths overlap if one is a prefix of the other, or they point to - * the same location. However, a JAR is allowed to be nested in a root. - * - * @param rootPath1 the first root path - * @param rootPath2 the second root path - * @return true if the given package fragment root paths are considered to overlap, false otherwise - * @deprecated Overlapping roots are allowed in 2.1 - - - - - - - - - - - - - - - - - - - * Validate the given compilation unit name. - * <p> - * A compilation unit name must obey the following rules: - * <ul> - * <li> it must not be null - * <li> it must be suffixed by a dot ('.') followed by one of the - * {@link JavaCore#getJavaLikeExtensions() Java-like extensions} - * <li> its prefix must be a valid identifier - * <li> it must not contain any characters or substrings that are not valid - * on the file system on which workspace root is located. - * </ul> - * </p> - * @param name the name of a compilation unit - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a compilation unit name, otherwise a status - * object indicating what is wrong with the name - * @deprecated Use {@link #validateCompilationUnitName(String id, String sourceLevel, String complianceLevel)} instead - - - - - - - - - * Validate the given compilation unit name for the given source and compliance levels. - * <p> - * A compilation unit name must obey the following rules: - * <ul> - * <li> it must not be null - * <li> it must be suffixed by a dot ('.') followed by one of the - * {@link JavaCore#getJavaLikeExtensions() Java-like extensions} - * <li> its prefix must be a valid identifier - * <li> it must not contain any characters or substrings that are not valid - * on the file system on which workspace root is located. - * </ul> - * </p> - * @param name the name of a compilation unit - * @param sourceLevel the source level - * @param complianceLevel the compliance level - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a compilation unit name, otherwise a status - * object indicating what is wrong with the name - * @since 3.3 - - - - - - - - - - - * Validate the given .class file name. - * <p> - * A .class file name must obey the following rules: - * <ul> - * <li> it must not be null - * <li> it must include the <code>".class"</code> suffix - * <li> its prefix must be a valid identifier - * <li> it must not contain any characters or substrings that are not valid - * on the file system on which workspace root is located. - * </ul> - * </p> - * @param name the name of a .class file - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a .class file name, otherwise a status - * object indicating what is wrong with the name - * @since 2.0 - * @deprecated Use {@link #validateClassFileName(String id, String sourceLevel, String complianceLevel)} instead - - - - - - - - - * Validate the given .class file name for the given source and compliance levels. - * <p> - * A .class file name must obey the following rules: - * <ul> - * <li> it must not be null - * <li> it must include the <code>".class"</code> suffix - * <li> its prefix must be a valid identifier - * <li> it must not contain any characters or substrings that are not valid - * on the file system on which workspace root is located. - * </ul> - * </p> - * @param name the name of a .class file - * @param sourceLevel the source level - * @param complianceLevel the compliance level - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a .class file name, otherwise a status - * object indicating what is wrong with the name - * @since 3.3 - - - - - - - - - - - * Validate the given field name. - * <p> - * Syntax of a field name corresponds to VariableDeclaratorId (JLS2 8.3). - * For example, <code>"x"</code>. - * - * @param name the name of a field - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a field name, otherwise a status - * object indicating what is wrong with the name - * @deprecated Use {@link #validateFieldName(String id, String sourceLevel, String complianceLevel)} instead - - - - - - - - - * Validate the given field name for the given source and compliance levels. - * <p> - * Syntax of a field name corresponds to VariableDeclaratorId (JLS2 8.3). - * For example, <code>"x"</code>. - * - * @param name the name of a field - * @param sourceLevel the source level - * @param complianceLevel the compliance level - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a field name, otherwise a status - * object indicating what is wrong with the name - * @since 3.3 - - - - - - - - - - - * Validate the given Java identifier. - * The identifier must not have the same spelling as a Java keyword, - * boolean literal (<code>"true"</code>, <code>"false"</code>), or null literal (<code>"null"</code>). - * See section 3.8 of the <em>Java Language Specification, Second Edition</em> (JLS2). - * A valid identifier can act as a simple type name, method name or field name. - * - * @param id the Java identifier - * @return a status object with code <code>IStatus.OK</code> if - * the given identifier is a valid Java identifier, otherwise a status - * object indicating what is wrong with the identifier - * @deprecated Use {@link #validateIdentifier(String id, String sourceLevel, String complianceLevel)} instead - - - - - - - - - * Validate the given Java identifier for the given source and compliance levels - * The identifier must not have the same spelling as a Java keyword, - * boolean literal (<code>"true"</code>, <code>"false"</code>), or null literal (<code>"null"</code>). - * See section 3.8 of the <em>Java Language Specification, Second Edition</em> (JLS2). - * A valid identifier can act as a simple type name, method name or field name. - * - * @param id the Java identifier - * @param sourceLevel the source level - * @param complianceLevel the compliance level - * @return a status object with code <code>IStatus.OK</code> if - * the given identifier is a valid Java identifier, otherwise a status - * object indicating what is wrong with the identifier - * @since 3.3 - - - - - - - - - - - * Validate the given import declaration name. - * <p> - * The name of an import corresponds to a fully qualified type name - * or an on-demand package name as defined by ImportDeclaration (JLS2 7.5). - * For example, <code>"java.util.*"</code> or <code>"java.util.Hashtable"</code>. - * - * @param name the import declaration - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as an import declaration, otherwise a status - * object indicating what is wrong with the name - * @deprecated Use {@link #validateImportDeclaration(String id, String sourceLevel, String complianceLevel)} instead - - - - - - - - - * Validate the given import declaration name for the given source and compliance levels. - * <p> - * The name of an import corresponds to a fully qualified type name - * or an on-demand package name as defined by ImportDeclaration (JLS2 7.5). - * For example, <code>"java.util.*"</code> or <code>"java.util.Hashtable"</code>. - * - * @param name the import declaration - * @param sourceLevel the source level - * @param complianceLevel the compliance level - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as an import declaration, otherwise a status - * object indicating what is wrong with the name - * @since 3.3 - - - - - - - - - - - * Validate the given Java type name, either simple or qualified. - * For example, <code>"java.lang.Object"</code>, or <code>"Object"</code>. - * <p> - * - * @param name the name of a type - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a Java type name, - * a status with code <code>IStatus.WARNING</code> - * indicating why the given name is discouraged, - * otherwise a status object indicating what is wrong with - * the name - * @deprecated Use {@link #validateJavaTypeName(String id, String sourceLevel, String complianceLevel)} instead - - - - - - - - - * Validate the given Java type name, either simple or qualified, for the given source and compliance levels. - * - * <p>For example, <code>"java.lang.Object"</code>, or <code>"Object"</code>.</p> - * - * <p>The source level and compliance level values should be taken from the constant defined inside - * {@link JavaCore} class. The constants are named <code>JavaCore#VERSION_1_x</code>, x being set - * between '1' and '7'. - * </p> - * - * @param name the name of a type - * @param sourceLevel the source level - * @param complianceLevel the compliance level - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a Java type name, - * a status with code <code>IStatus.WARNING</code> - * indicating why the given name is discouraged, - * otherwise a status object indicating what is wrong with - * the name - * @since 3.3 - * @see JavaCore#VERSION_1_1 - * @see JavaCore#VERSION_1_2 - * @see JavaCore#VERSION_1_3 - * @see JavaCore#VERSION_1_4 - * @see JavaCore#VERSION_1_5 - * @see JavaCore#VERSION_1_6 - * @see JavaCore#VERSION_1_7 - - - - - - - - - - - * Validate the given method name. - * The special names "&lt;init&gt;" and "&lt;clinit&gt;" are not valid. - * <p> - * The syntax for a method name is defined by Identifier - * of MethodDeclarator (JLS2 8.4). For example "println". - * - * @param name the name of a method - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a method name, otherwise a status - * object indicating what is wrong with the name - * @deprecated Use {@link #validateMethodName(String id, String sourceLevel, String complianceLevel)} instead - - - - - - - - - * Validate the given method name for the given source and compliance levels. - * The special names "&lt;init&gt;" and "&lt;clinit&gt;" are not valid. - * <p> - * The syntax for a method name is defined by Identifier - * of MethodDeclarator (JLS2 8.4). For example "println". - * - * @param name the name of a method - * @param sourceLevel the source level - * @param complianceLevel the compliance level - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a method name, otherwise a status - * object indicating what is wrong with the name - * @since 3.3 - - - - - - - - - - - * Validate the given package name. - * <p> - * The syntax of a package name corresponds to PackageName as - * defined by PackageDeclaration (JLS2 7.4). For example, <code>"java.lang"</code>. - * <p> - * Note that the given name must be a non-empty package name (that is, attempting to - * validate the default package will return an error status.) - * Also it must not contain any characters or substrings that are not valid - * on the file system on which workspace root is located. - * - * @param name the name of a package - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a package name, otherwise a status - * object indicating what is wrong with the name - * @deprecated Use {@link #validatePackageName(String id, String sourceLevel, String complianceLevel)} instead - - - - - - - - - * Validate the given package name for the given source and compliance levels. - * <p> - * The syntax of a package name corresponds to PackageName as - * defined by PackageDeclaration (JLS2 7.4). For example, <code>"java.lang"</code>. - * <p> - * Note that the given name must be a non-empty package name (that is, attempting to - * validate the default package will return an error status.) - * Also it must not contain any characters or substrings that are not valid - * on the file system on which workspace root is located. - * - * @param name the name of a package - * @param sourceLevel the source level - * @param complianceLevel the compliance level - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a package name, otherwise a status - * object indicating what is wrong with the name - * @since 3.3 - - - - - - - - - - - * Validate a given classpath and output location for a project, using the following rules: - * <ul> - * <li> Classpath entries cannot collide with each other; that is, all entry paths must be unique. - * <li> The project output location path cannot be null, must be absolute and located inside the project. - * <li> Specific output locations (specified on source entries) can be null, if not they must be located inside the project, - * <li> A project entry cannot refer to itself directly (that is, a project cannot prerequisite itself). - * <li> Classpath entries or output locations cannot coincidate or be nested in each other, except for the following scenarii listed below: - * <ul><li> A source folder can coincidate with its own output location, in which case this output can then contain library archives. - * However, a specific output location cannot coincidate with any library or a distinct source folder than the one referring to it. </li> - * <li> A source/library folder can be nested in any source folder as long as the nested folder is excluded from the enclosing one. </li> - * <li> An output location can be nested in a source folder, if the source folder coincidates with the project itself, or if the output - * location is excluded from the source folder. - * </ul> - * </ul> - * - * Note that the classpath entries are not validated automatically. Only bound variables or containers are considered - * in the checking process (this allows to perform a consistency check on a classpath which has references to - * yet non existing projects, folders, ...). - * <p> - * This validation is intended to anticipate classpath issues prior to assigning it to a project. In particular, it will automatically - * be performed during the classpath setting operation (if validation fails, the classpath setting will not complete). - * <p> - * @param javaProject the given java project - * @param rawClasspath the given classpath - * @param projectOutputLocation the given output location - * @return a status object with code <code>IStatus.OK</code> if - * the given classpath and output location are compatible, otherwise a status - * object indicating what is wrong with the classpath or output location - * @since 2.0 - - - - - - - - - - - - - - * Returns a Java model status describing the problem related to this classpath entry if any, - * a status object with code <code>IStatus.OK</code> if the entry is fine (that is, if the - * given classpath entry denotes a valid element to be referenced onto a classpath). - * - * @param project the given java project - * @param entry the given classpath entry - * @param checkSourceAttachment a flag to determine if source attachment should be checked - * @return a java model status describing the problem related to this classpath entry if any, a status object with code <code>IStatus.OK</code> if the entry is fine - * @since 2.0 - - - - - - - - - - - * Validate the given type variable name. - * <p> - * Syntax of a type variable name corresponds to a Java identifier (JLS3 4.3). - * For example, <code>"E"</code>. - * - * @param name the name of a type variable - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a type variable name, otherwise a status - * object indicating what is wrong with the name - * @since 3.1 - * @deprecated Use {@link #validateTypeVariableName(String id, String sourceLevel, String complianceLevel)} instead - - - - - - - - - * Validate the given type variable name for the given source and compliance levels. - * <p> - * Syntax of a type variable name corresponds to a Java identifier (JLS3 4.3). - * For example, <code>"E"</code>. - * - * @param name the name of a type variable - * @param sourceLevel the source level - * @param complianceLevel the compliance level - * @return a status object with code <code>IStatus.OK</code> if - * the given name is valid as a type variable name, otherwise a status - * object indicating what is wrong with the name - * @since 3.3 - - - - - - - - - - - - * The plug-in runtime class for the Java model plug-in containing the core - * (UI-free) support for Java projects. - * <p> - * Like all plug-in runtime classes (subclasses of <code>Plugin</code>), this - * class is automatically instantiated by the platform when the plug-in gets - * activated. Clients must not attempt to instantiate plug-in runtime classes - * directly. - * </p> - * <p> - * The single instance of this class can be accessed from any plug-in declaring - * the Java model plug-in as a prerequisite via - * <code>JavaCore.getJavaCore()</code>. The Java model plug-in will be activated - * automatically if not already active. - * </p> - * @noinstantiate This class is not intended to be instantiated by clients. - - - - - - - - - - - - * The plug-in identifier of the Java core support - * (value <code>"org.eclipse.jdt.core"</code>). - - - - - - - * The identifier for the Java builder - * (value <code>"org.eclipse.jdt.core.javabuilder"</code>). - - - - - - - * The identifier for the Java model - * (value <code>"org.eclipse.jdt.core.javamodel"</code>). - - - - - - - * The identifier for the Java nature - * (value <code>"org.eclipse.jdt.core.javanature"</code>). - * The presence of this nature on a project indicates that it is - * Java-capable. - * - * @see org.eclipse.core.resources.IProject#hasNature(java.lang.String) - - - - - - - * Name of the handle id attribute in a Java marker. - - - - - - - * Name of the User Library Container id. - * @since 3.0 - - - - - - - * Compiler option ID: Generating Local Variable Debug Attribute. - * <p>When generated, this attribute will enable local variable names - * to be displayed in debugger, only in place where variables are - * definitely assigned (.class file is then bigger). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.debug.localVariable"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "generate", "do not generate" }</code></dd> - * <dt>Default:</dt><dd><code>"generate"</code></dd> - * </dl> - * @category CompilerOptionID - - - - - - - * Compiler option ID: Generating Line Number Debug Attribute. - * <p>When generated, this attribute will enable source code highlighting in debugger - * (.class file is then bigger). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.debug.lineNumber"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "generate", "do not generate" }</code></dd> - * <dt>Default:</dt><dd><code>"generate"</code></dd> - * </dl> - * @category CompilerOptionID - - - - - - - * Compiler option ID: Generating Source Debug Attribute. - * <p>When generated, this attribute will enable the debugger to present the - * corresponding source code. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.debug.sourceFile"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "generate", "do not generate" }</code></dd> - * <dt>Default:</dt><dd><code>"generate"</code></dd> - * </dl> - * @category CompilerOptionID - - - - - - - * Compiler option ID: Preserving Unused Local Variables. - * <p>Unless requested to preserve unused local variables (that is, never read), the - * compiler will optimize them out, potentially altering debugging. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.codegen.unusedLocal"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "preserve", "optimize out" }</code></dd> - * <dt>Default:</dt><dd><code>"preserve"</code></dd> - * </dl> - * @category CompilerOptionID - - - - - - - * Compiler option ID: Defining Target Java Platform. - * <p>For binary compatibility reason, .class files can be tagged to with certain VM versions and later. - * <p>Note that <code>"1.4"</code> target requires to toggle compliance mode to <code>"1.4"</code>, <code>"1.5"</code> target requires - * to toggle compliance mode to <code>"1.5"</code>, <code>"1.6"</code> target requires to toggle compliance mode to <code>"1.6"</code> and - * <code>"1.7"</code> target requires to toggle compliance mode to <code>"1.7"</code>. - * <code>"cldc1.1"</code> requires the source version to be <code>"1.3"</code> and the compliance version to be <code>"1.4"</code> or lower. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.codegen.targetPlatform"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "cldc1.1" }</code></dd> - * <dt>Default:</dt><dd><code>"1.2"</code></dd> - * </dl> - * @category CompilerOptionID - - - - - - - * Compiler option ID: Inline JSR Bytecode Instruction. - * <p>When enabled, the compiler will no longer generate JSR instructions, but rather inline corresponding - * subroutine code sequences (mostly corresponding to try finally blocks). The generated code will thus - * get bigger, but will load faster on virtual machines since the verification process is then much simpler. - * <p>This mode is anticipating support for the Java Specification Request 202. - * <p>Note that JSR inlining is optional only for target platform lesser than 1.5. From 1.5 on, the JSR - * inlining is mandatory (also see related setting {@link #COMPILER_CODEGEN_TARGET_PLATFORM}). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Javadoc Comment Support. - * <p>When this support is disabled, the compiler will ignore all javadoc problems options settings - * and will not report any javadoc problem. It will also not find any reference in javadoc comment and - * DOM AST Javadoc node will be only a flat text instead of having structured tag elements. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.doc.comment.support"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"enabled"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * @deprecated Discontinued since turning off would violate language specs. - * @category DeprecatedOptionID - - - - - - - * @deprecated Discontinued since turning off would violate language specs. - * @category DeprecatedOptionID - - - - - - - * Compiler option ID: Reporting Attempt to Override Package Visible Method. - * <p>A package visible method, which is any method that is not explicitly - * declared as public, protected or private, is not visible from other - * packages, and thus cannot be overridden from another package. - * Attempting to override a package visible method from another package - * introduces a new method that is unrelated to the original one. When - * enabling this option, the compiler will signal such situations as an - * error or a warning. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Method With Constructor Name. - * <p>Naming a method with a constructor name is generally considered poor - * style programming. When enabling this option, the compiler will signal such - * scenarii either as an error or a warning. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.methodWithConstructorName"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Deprecation. - * <p>When enabled, the compiler will signal use of deprecated API either as an - * error or a warning. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.deprecation"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Deprecation Inside Deprecated Code. - * <p>When enabled, the compiler will signal use of deprecated API inside deprecated code. - * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_DEPRECATION}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 2.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Deprecation When Overriding Deprecated Method. - * <p>When enabled, the compiler will signal the declaration of a method overriding a deprecated one. - * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_DEPRECATION}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Hidden Catch Block. - * <p>Locally to a try statement, some catch blocks may hide others. For example, - * <pre> - * try { throw new java.io.CharConversionException(); - * } catch (java.io.CharConversionException e) { - * } catch (java.io.IOException e) {}. - * </pre> - * When enabling this option, the compiler will issue an error or a warning for hidden - * catch blocks corresponding to checked exceptions. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Unused Local. - * <p>When enabled, the compiler will issue an error or a warning for unused local - * variables (that is, variables never read from). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedLocal"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Unused Parameter. - * <p>When enabled, the compiler will issue an error or a warning for unused method - * parameters (that is, parameters never read from). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedParameter"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Unused Parameter if Implementing Abstract Method. - * <p>When enabled, the compiler will signal unused parameters in abstract method implementations. - * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_UNUSED_PARAMETER}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 2.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Unused Parameter if Overriding Concrete Method. - * <p>When enabled, the compiler will signal unused parameters in methods overriding concrete ones. - * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_UNUSED_PARAMETER}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 2.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Consider Reference in Doc Comment for Unused Parameter Check. - * <p>When enabled, the compiler will consider doc comment references to parameters (i.e. <code>@param</code> clauses) for the unused - * parameter check. Thus, documented parameters will be considered as mandated as per doc contract. - * <p>The severity of the unused parameter problem is controlled with option {@link #COMPILER_PB_UNUSED_PARAMETER}. - * <p>Note: this option has no effect until the doc comment support is enabled according to the - * option {@link #COMPILER_DOC_COMMENT_SUPPORT}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"enabled"</code></dd> - * </dl> - * @since 3.3 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Unused Import. - * <p>When enabled, the compiler will issue an error or a warning for unused import - * reference. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedImport"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 2.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Presence of Type Arguments for a Non-Generic Method Invocation. - * <p>When enabled, the compiler will issue an error or a warning whenever type arguments are encountered for a - * non-generic method invocation. Note that prior to compliance level is <code>"1.7"</code>, this situation would automatically result - * in an error. From Java7 on, unused type arguments are being tolerated, and optionally warned against. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedTypeArgumentsForMethodInvocation"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.4 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Synthetic Access Emulation. - * <p>When enabled, the compiler will issue an error or a warning whenever it emulates - * access to a non-accessible member of an enclosing type. Such access can have - * performance implications. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Non-Externalized String Literal. - * <p>When enabled, the compiler will issue an error or a warning for non externalized - * String literal (that is, not tagged with <code>//$NON-NLS-&lt;n&gt;$</code>). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 2.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Usage of <code>'assert'</code> Identifier. - * <p>When enabled, the compiler will issue an error or a warning whenever <code>'assert'</code> is - * used as an identifier (reserved keyword in 1.4). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.assertIdentifier"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 2.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Usage of <code>'enum'</code> Identifier. - * <p>When enabled, the compiler will issue an error or a warning whenever <code>'enum'</code> is - * used as an identifier (reserved keyword in 1.5). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.enumIdentifier"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Non-Static Reference to a Static Member. - * <p>When enabled, the compiler will issue an error or a warning whenever a static field - * or method is accessed with an expression receiver. A reference to a static member should - * be qualified with a type name. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 2.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Indirect Reference to a Static Member. - * <p>When enabled, the compiler will issue an error or a warning whenever a static field - * or method is accessed in an indirect way. A reference to a static member should - * preferably be qualified with its declaring type name. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.indirectStaticAccess"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Assignment with no Effect. - * <p>When enabled, the compiler will issue an error or a warning whenever an assignment - * has no effect (e.g <code>'x = x'</code>). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.noEffectAssignment"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 2.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Interface Method not Compatible with non-Inherited Methods. - * <p>When enabled, the compiler will issue an error or a warning whenever an interface - * defines a method incompatible with a non-inherited <code>Object</code> method. Until this conflict - * is resolved, such an interface cannot be implemented, For example, - * <pre> - * interface I { - * int clone(); - * } - * </pre> - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 2.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Unused Private Members. - * <p>When enabled, the compiler will issue an error or a warning whenever a private - * method or field is declared but never used within the same unit. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedPrivateMember"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 2.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Local Variable Declaration Hiding another Variable. - * <p>When enabled, the compiler will issue an error or a warning whenever a local variable - * declaration is hiding some field or local variable (either locally, inherited or defined in enclosing type). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.localVariableHiding"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Special Parameter Hiding another Field. - * <p>When enabled, the compiler will signal cases where a constructor or setter method parameter declaration - * is hiding some field (either locally, inherited or defined in enclosing type). - * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_LOCAL_VARIABLE_HIDING}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Field Declaration Hiding another Variable. - * <p>When enabled, the compiler will issue an error or a warning whenever a field - * declaration is hiding some field or local variable (either locally, inherited or defined in enclosing type). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.fieldHiding"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Type Declaration Hiding another Type. - * <p>When enabled, the compiler will issue an error or a warning in situations where a type parameter - * declaration is hiding some type, when a nested type is hiding some type parameter, or when - * a nested type is hiding another nested type defined in same unit. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.typeParameterHiding"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Possible Accidental Boolean Assignment. - * <p>When enabled, the compiler will issue an error or a warning if a boolean assignment is acting as the condition - * of a control statement (where it probably was meant to be a boolean comparison). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Switch Fall-Through Case. - * <p>When enabled, the compiler will issue an error or a warning if a case may be - * entered by falling through previous case. Empty cases are allowed. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.fallthroughCase"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.2 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Empty Statements and Unnecessary Semicolons. - * <p>When enabled, the compiler will issue an error or a warning if an empty statement or a - * unnecessary semicolon is encountered. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.emptyStatement"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.booleanMethodThrowingException"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - * @deprecated - this option has no effect - - - - - - - * Compiler option ID: Reporting Unnecessary Type Check. - * <p>When enabled, the compiler will issue an error or a warning when a cast or an <code>instanceof</code> operation - * is unnecessary. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Unnecessary Else. - * <p>When enabled, the compiler will issue an error or a warning when a statement is unnecessarily - * nested within an <code>else</code> clause (in situation where then clause is not completing normally). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unnecessaryElse"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Undocumented Empty Block. - * <p>When enabled, the compiler will issue an error or a warning when an empty block is detected and it is not - * documented with any comment. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Finally Blocks Not Completing Normally. - * <p>When enabled, the compiler will issue an error or a warning when a finally block does not complete normally. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Unused Declared Thrown Exception. - * <p>When enabled, the compiler will issue an error or a warning when a - * method or a constructor is declaring a checked exception as thrown, - * but its body actually raises neither that exception, nor any other - * exception extending it. - * <p>This diagnostic is further tuned by options - * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_INCLUDE_DOC_COMMENT_REFERENCE}, - * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE}, - * and {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Unused Declared Thrown Exception in Overriding Method. - * <p>When disabled, the compiler will report unused declared thrown - * exceptions neither on overriding methods nor on implementing methods. - * <p>The severity of the unused declared thrown exception problem is - * controlled with option {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION}. - * <p>This diagnostic is further tuned by options - * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_INCLUDE_DOC_COMMENT_REFERENCE} and - * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Consider Reference in Doc Comment for Unused Declared Thrown Exception Check. - * <p>When enabled, the compiler will consider doc comment references to - * exceptions (i.e. <code>@throws</code> clauses) for the unused - * declared thrown exception check. Thus, documented exceptions will be - * considered as mandated as per doc contract. - * <p>The severity of the unused declared thrown exception problem is controlled with option {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION}. - * <p>Note: this option has no effect until the doc comment support is enabled according to the - * option {@link #COMPILER_DOC_COMMENT_SUPPORT}. - * <p>This diagnostic is further tuned by options - * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE} - * and {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"enabled"</code></dd> - * </dl> - * @since 3.4 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Unused Declared Thrown Exception Exempts Exception And Throwable. - * <p>When enabled, the compiler will issue an error or a warning when a - * method or a constructor is declaring a checked exception else than - * {@link java.lang.Throwable} or {@link java.lang.Exception} as thrown, - * but its body actually raises neither that exception, nor any other - * exception extending it. When disabled, the compiler will issue an - * error or a warning when a method or a constructor is declaring a - * checked exception (including {@link java.lang.Throwable} and - * {@link java.lang.Exception}) as thrown, but its body actually raises - * neither that exception, nor any other exception extending it. - * <p>The severity of the unused declared thrown exception problem is - * controlled with option - * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION}. - * <p>This diagnostic is further tuned by options - * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_INCLUDE_DOC_COMMENT_REFERENCE} - * and {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"enabled"</code></dd> - * </dl> - * @since 3.4 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Unqualified Access to Field. - * <p>When enabled, the compiler will issue an error or a warning when a field is access without any qualification. - * In order to improve code readability, it should be qualified, e.g. <code>'x'</code> should rather be written <code>'this.x'</code>. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * @deprecated Use {@link #COMPILER_PB_UNCHECKED_TYPE_OPERATION} instead. - * @since 3.1 - * @category DeprecatedOptionID - - - - - - - * Compiler option ID: Reporting Unchecked Type Operation. - * <p>When enabled, the compiler will issue an error or a warning whenever an operation involves generic types, and potentially - * invalidates type safety since involving raw types (e.g. invoking <code>#foo(X&lt;String&gt;)</code> with arguments <code>(X)</code>). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Raw Type Reference. - * <p>When enabled, the compiler will issue an error or a warning when detecting references to raw types. Raw types are - * discouraged, and are intended to help interfacing with legacy code. In the future, the language specification may - * reject raw references to generic types. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.rawTypeReference"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.2 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting of Unavoidable Generic Type Problems. - * <p> When enabled, the compiler will issue an error or warning even when it detects a generic type problem - * that could not have been avoided by the programmer. As an example, a type may be forced to use raw types - * in its method signatures and return types because the methods it overrides from a super type are declared to - * use raw types in the first place. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"enabled"</code></dd> - * </dl> - * @since 3.7 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting final Bound for Type Parameter. - * <p>When enabled, the compiler will issue an error or a warning whenever a generic type parameter is associated with a - * bound corresponding to a final type; since final types cannot be further extended, the parameter is pretty useless. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.finalParameterBound"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Missing Declaration of serialVersionUID Field on Serializable Class. - * <p>When enabled, the compiler will issue an error or a warning whenever a serializable class is missing a local declaration - * of a <code>serialVersionUID</code> field. This field must be declared as static final and be of type <code>long</code>. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingSerialVersion"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Varargs Argument Needing a Cast in Method/Constructor Invocation. - * <p>When enabled, the compiler will issue an error or a warning whenever a varargs arguments should be cast - * when passed to a method/constructor invocation. (e.g. <code>Class.getMethod(String name, Class ... args )</code> - * invoked with arguments <code>("foo", null)</code>). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Boxing/Unboxing Conversion. - * <p>When enabled, the compiler will issue an error or a warning whenever a boxing or an unboxing - * conversion is performed. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.autoboxing"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Use of Annotation Type as Super Interface. - * <p>When enabled, the compiler will issue an error or a warning whenever an annotation type is used - * as a super-interface. Though legal, this is discouraged. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.annotationSuperInterface"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Missing <code>@Override</code> Annotation. - * <p>When enabled, the compiler will issue an error or a warning whenever encountering a method - * declaration which overrides a superclass method but has no <code>@Override</code> annotation. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Missing <code>@Override</code> Annotation for interface method implementation. - * <p>When enabled, the compiler will issue an error or a warning whenever encountering a method - * declaration which overrides or implements a superinterface method but has no <code>@Override</code> annotation.</p> - * <p>This option only has an effect if the compiler compliance is 1.6 or greater.</p> - * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_MISSING_OVERRIDE_ANNOTATION}.</p> - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"enabled"</code></dd> - * </dl> - * @since 3.6 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Missing <code>@Deprecated</code> Annotation. - * <p>When enabled, the compiler will issue an error or a warning whenever encountering a declaration - * carrying a <code>@deprecated</code> doc tag but having no corresponding <code>@Deprecated</code> annotation. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Missing HashCode Method. - * <p>When enabled, the compiler will issue an error or a warning if a type - * overrides Object.equals(Object) but does not override hashCode(). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.5 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Dead Code. - * <p>When enabled, the compiler will issue an error or a warning if some non fatal dead code is detected. For instance, <code>if (false) foo();</code> - * is not reported as truly unreachable code by the Java Language Specification. If this diagnostic is enabled, then the invocation of <code>foo()</code> is - * going to be signaled as being dead code. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.deadCode"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.5 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Dead Code Inside Trivial If Statement. - * <p>When enabled, the compiler will signal presence of dead code inside trivial IF statement, e.g. <code>if (DEBUG)...</code>.. - * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_DEAD_CODE}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.deadCodeInTrivialIfStatement"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.5 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Incomplete Enum Switch. - * <p>When enabled, the compiler will issue an error or a warning whenever - * an enum constant has no corresponding case label in an enum switch - * statement. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * @since 3.1 - * @deprecated Use {@link #COMPILER_PB_NULL_REFERENCE} instead. - * @category DeprecatedOptionID - - - - - - - * Compiler option ID: Reporting Unreferenced Label. - * <p>When enabled, the compiler will issue an error or a warning when encountering a labeled statement which label - * is never explicitly referenced. A label is considered to be referenced if its name explicitly appears behind a break - * or continue statement; for instance the following label would be considered unreferenced: - * <code>LABEL: { break; }</code> - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedLabel"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.2 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Invalid Javadoc Comment. - * <p>This is the generic control for the severity of Javadoc problems. - * When enabled, the compiler will issue an error or a warning for a problem in Javadoc. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.invalidJavadoc"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Invalid Javadoc Tags. - * <p>When enabled, the compiler will signal unbound or unexpected reference tags in Javadoc. - * A <code>@throws</code> tag referencing an undeclared exception would be considered as unexpected. - * <p>Note that this diagnosis can be enabled based on the visibility of the construct associated with the Javadoc; - * also see the setting {@link #COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.invalidJavadocTags"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Invalid Javadoc Tags with Deprecated References. - * <p>Specify whether the compiler will report deprecated references used in Javadoc tags. - * <p>Note that this diagnosis can be enabled based on the visibility of the construct associated with the Javadoc; - * also see the setting {@link #COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Invalid Javadoc Tags with Not Visible References. - * <p>Specify whether the compiler will report non-visible references used in Javadoc tags. - * <p>Note that this diagnosis can be enabled based on the visibility of the construct associated with the Javadoc; - * also see the setting {@link #COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Visibility Level For Invalid Javadoc Tags. - * <p>Set the minimum visibility level for Javadoc tag problems. Below this level problems will be ignored. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "public", "protected", "default", "private" }</code></dd> - * <dt>Default:</dt><dd><code>"public"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting missing tag description. - * <p>When enabled, the compiler will report a warning or an error for any Javadoc tag missing a required description. - * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_INVALID_JAVADOC}. - * <p>It does not depend on option {@link #COMPILER_PB_INVALID_JAVADOC_TAGS}. - * <p>When this option is valued to {@link #COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION_ALL_STANDARD_TAGS}, - * a subset of the standard <a href="http://java.sun.com/javase/6/docs/technotes/tools/windows/javadoc.html#javadoctags">Javadoc tags</a> - * that have a description, text or label are checked. While this set may grow in the future, note that user-defined tags are not and will not be checked. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "return_tag", "all_standard_tags", "no_tag" }</code></dd> - * <dt>Default:</dt><dd><code>"return_tag"</code></dd> - * </dl> - * @since 3.4 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Missing Javadoc Tags. - * <p>This is the generic control for the severity of Javadoc missing tag problems. - * When enabled, the compiler will issue an error or a warning when tags are missing in Javadoc comments. - * <p>Note that this diagnosis can be enabled based on the visibility of the construct associated with the Javadoc; - * also see the setting {@link #COMPILER_PB_MISSING_JAVADOC_TAGS_VISIBILITY}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocTags"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Visibility Level For Missing Javadoc Tags. - * <p>Set the minimum visibility level for Javadoc missing tag problems. Below this level problems will be ignored. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "public", "protected", "default", "private" }</code></dd> - * <dt>Default:</dt><dd><code>"public"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Missing Javadoc Tags on Overriding Methods. - * <p>Specify whether the compiler will verify overriding methods in order to report Javadoc missing tag problems. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Missing Javadoc Tags for Method Type Parameters. - * <p>Specify whether a missing <code>@param</code> for a type parameter in a method declaration should be reported. - * When enabled, the compiler will issue a missing Javadoc tag error or warning for a type parameter without a - * corresponding <code>@param</code> tag.</p> - * <p>This option only has an effect if the compiler compliance is 1.5 or greater.</p> - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.7 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Missing Javadoc Comments. - * <p>This is the generic control for the severity of missing Javadoc comment problems. - * When enabled, the compiler will issue an error or a warning when Javadoc comments are missing. - * <p>Note that this diagnosis can be enabled based on the visibility of the construct associated with the expected Javadoc; - * also see the setting {@link #COMPILER_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY}. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocComments"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Visibility Level For Missing Javadoc Comments. - * <p>Set the minimum visibility level for missing Javadoc problems. Below this level problems will be ignored. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "public", "protected", "default", "private" }</code></dd> - * <dt>Default:</dt><dd><code>"public"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Missing Javadoc Comments on Overriding Methods. - * <p>Specify whether the compiler will verify overriding methods in order to report missing Javadoc comment problems. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Usage of <code>char[]</code> Expressions in String Concatenations. - * <p>When enabled, the compiler will issue an error or a warning whenever a <code>char[]</code> expression - * is used in String concatenations (for example, <code>"hello" + new char[]{'w','o','r','l','d'}</code>). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 2.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Maximum Number of Problems Reported per Compilation Unit. - * <p>Specify the maximum number of problems reported on each compilation unit. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.maxProblemPerUnit"</code></dd> - * <dt>Possible values:</dt><dd><code>"&lt;n&gt;"</code> where <code>&lt;n&gt;</code> is zero or a positive integer (if zero then all problems are reported).</dd> - * <dt>Default:</dt><dd><code>"100"</code></dd> - * </dl> - * @since 2.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Treating Optional Error as Fatal. - * <p>When enabled, optional errors (i.e. optional problems which severity is set to <code>"error"</code>) will be treated as standard - * compiler errors, yielding problem methods/types preventing from running offending code until the issue got resolved.</p> - * <p>When disabled, optional errors are only considered as warnings, still carrying an error indication to make them more - * severe. Note that by default, optional errors are not fatal. Non-optional errors are - * always fatal.</p> - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.fatalOptionalError"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.2 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Parameter Assignment. - * <p>When enabled, the compiler will issue an error or a warning if a parameter is - * assigned to. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.parameterAssignment"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.2 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting a method that qualifies as static, but not declared static. - * <p>When enabled, the compiler will issue an error or a warning if a method has - * not been declared as <code>static</code>, even though it qualifies as one. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.7 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting a method that may qualify as static, but not declared static. - * <p>When enabled, the compiler will issue an error or a warning if a method has - * not been declared as <code>static</code>, even though it may qualify as one, - * when another method doesn't override it. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.7 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Setting Source Compatibility Mode. - * <p>Specify whether which source level compatibility is used. From 1.4 on, <code>'assert'</code> is a keyword - * reserved for assertion support. Also note, than when toggling to 1.4 mode, the target VM - * level should be set to <code>"1.4"</code> and the compliance mode should be <code>"1.4"</code>. - * <p>Source level 1.5 is necessary to enable generics, autoboxing, covariance, annotations, enumerations - * enhanced for loop, static imports and varargs. Once toggled, the target VM level should be set to <code>"1.5"</code> - * and the compliance mode should be <code>"1.5"</code>. - * <p>Source level 1.6 is necessary to enable the computation of stack map tables. Once toggled, the target - * VM level should be set to <code>"1.6"</code> and the compliance mode should be <code>"1.6"</code>. - * <p>Once the source level 1.7 is toggled, the target VM level should be set to <code>"1.7"</code> and the compliance mode - * should be <code>"1.7"</code>. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.source"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "1.3", "1.4", "1.5", "1.6", "1.7" }</code></dd> - * <dt>Default:</dt><dd><code>"1.3"</code></dd> - * </dl> - * @since 2.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Setting Compliance Level. - * <p>Select the compliance level for the compiler. In <code>"1.3"</code> mode, source and target settings - * should not go beyond <code>"1.3"</code> level. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.compliance"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "1.3", "1.4", "1.5", "1.6", "1.7" }</code></dd> - * <dt>Default:</dt><dd><code>"1.4"</code></dd> - * </dl> - * @since 2.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Defining the Automatic Task Priorities. - * <p>In parallel with the Automatic Task Tags, this list defines the priorities (high, normal or low) - * of the task markers issued by the compiler. - * If the default is specified, the priority of each task marker is <code>"NORMAL"</code>.</p> - * <p>Task Priorities and task tags must have the same length. If task priorities are set, then task tags should also - * be set.</p> - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.taskPriorities"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "&lt;priority&gt;[,&lt;priority&gt;]*" }</code> where <code>&lt;priority&gt;</code> is one of <code>"HIGH"</code>, <code>"NORMAL"</code> or <code>"LOW"</code></dd> - * <dt>Default:</dt><dd><code>"NORMAL,HIGH,NORMAL"</code></dd> - * </dl> - * @since 2.1 - * @category CompilerOptionID - * @see #COMPILER_TASK_TAGS - - - - - - - * Compiler option ID: Defining the Automatic Task Tags. - * <p>When the tag list is not empty, the compiler will issue a task marker whenever it encounters - * one of the corresponding tags inside any comment in Java source code. - * <p>Generated task messages will start with the tag, and range until the next line separator, - * comment ending, or tag.</p> - * <p>When a given line of code bears multiple tags, each tag will be reported separately. - * Moreover, a tag immediately followed by another tag will be reported using the contents of the - * next non-empty tag of the line, if any.</p> - * <p>Note that tasks messages are trimmed. If a tag is starting with a letter or digit, then it cannot be leaded by - * another letter or digit to be recognized (<code>"fooToDo"</code> will not be recognized as a task for tag <code>"ToDo"</code>, but <code>"foo#ToDo"</code> - * will be detected for either tag <code>"ToDo"</code> or <code>"#ToDo"</code>). Respectively, a tag ending with a letter or digit cannot be followed - * by a letter or digit to be recognized (<code>"ToDofoo"</code> will not be recognized as a task for tag <code>"ToDo"</code>, but <code>"ToDo:foo"</code> will - * be detected either for tag <code>"ToDo"</code> or <code>"ToDo:"</code>).</p> - * <p>Task Priorities and task tags must have the same length. If task tags are set, then task priorities should also - * be set.</p> - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.taskTags"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "&lt;tag&gt;[,&lt;tag&gt;]*" }</code> where <code>&lt;tag&gt;</code> is a String without any wild-card or leading/trailing spaces</dd> - * <dt>Default:</dt><dd><code>"TODO,FIXME,XXX"</code></dd> - * </dl> - * @since 2.1 - * @category CompilerOptionID - * @see #COMPILER_TASK_PRIORITIES - - - - - - - * Compiler option ID: Determining whether task tags are case-sensitive. - * <p>When enabled, task tags are considered in a case-sensitive way. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.taskCaseSensitive"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"enabled"</code></dd> - * </dl> - * @since 3.0 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Forbidden Reference to Type with Restricted Access. - * <p>When enabled, the compiler will issue an error or a warning when referring to a type that is non accessible, as defined according - * to the access rule specifications. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.forbiddenReference"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"error"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Discouraged Reference to Type with Restricted Access. - * <p>When enabled, the compiler will issue an error or a warning when referring to a type with discouraged access, as defined according - * to the access rule specifications. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.discouragedReference"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Determining Effect of <code>@SuppressWarnings</code>. - * <p>When enabled, the <code>@SuppressWarnings</code> annotation can be used to suppress some compiler warnings. - * <p>When disabled, all <code>@SupressWarnings</code> annotations are ignored; i.e., warnings are reported. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.suppressWarnings"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"enabled"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Raise null related errors or warnings arising because of assert statements. - * <p>When enabled, the compiler will flag all null related errors or warnings that have been enabled by the user, - * irrespective of whether a variable occurred in an assert statement.</p> - * <p>When disabled, the compiler will not flag null related errors or warnings on variables that got marked as maybe or definitely - * <code>null</code> in an assert statement upstream.</p> - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.7 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Further Determining the Effect of <code>@SuppressWarnings</code> if also - * {@link #COMPILER_PB_SUPPRESS_WARNINGS} is enabled. - * <p>When enabled, the <code>@SuppressWarnings</code> annotation can additionally be used to suppress - * optional compiler diagnostics that have been configured as {@link #ERROR}. - * <p>When disabled, all <code>@SuppressWarnings</code> annotations only affects warnings. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.6 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Unhandled Warning Token for <code>@SuppressWarnings</code>. - * <p>When enabled, the compiler will issue an error or a warning when encountering a token - * it cannot handle inside a <code>@SuppressWarnings</code> annotation. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unhandledWarningToken"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.1 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Unnecessary <code>@SuppressWarnings</code>. - * <p>When enabled, the compiler will issue an error or a warning when encountering <code>@SuppressWarnings</code> annotation - * for which no corresponding warning got detected in the code. This diagnostic is provided to help developers to get - * rid of transient <code>@SuppressWarnings</code> no longer needed. Note that <code>@SuppressWarnings("all")</code> is still - * silencing the warning for unnecessary <code>@SuppressWarnings</code>, as it is the master switch to silence ALL warnings. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedWarningToken"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.4 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Null Dereference. - * <p>When enabled, the compiler will issue an error or a warning whenever a - * variable that is statically known to hold a null value is used to - * access a field or method.</p> - * <p>Assert statements are ignored unless {@link #COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS} - * is enabled.</p> - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.nullReference"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.2 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Potential Null Dereference. - * <p>When enabled, the compiler will issue an error or a warning whenever a - * variable that has formerly been tested against null but is not (no more) - * statically known to hold a non-null value is used to access a field or - * method.</p> - * <p>Assert statements are ignored unless {@link #COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS} - * is enabled.</p> - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.potentialNullReference"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.3 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Redundant Null Check. - * <p>When enabled, the compiler will issue an error or a warning whenever a - * variable that is statically known to hold a null or a non-null value - * is tested against null.</p> - * <p>Assert statements are ignored unless {@link #COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS} - * is enabled.</p> - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.redundantNullCheck"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.3 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Overriding method that doesn't call the super method invocation. - * <p>When enabled, the compiler will issue an error or a warning if a method is overriding a method without calling - * the super invocation. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.overridingMethodWithoutSuperInvocation"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.3 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Redundant Superinterface. - * <p>When enabled, the compiler will issue an error or a warning if a type - * explicitly implements an interface that is already implemented by any - * of its supertypes. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.redundantSuperinterface"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.4 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Comparison of Identical Expressions. - * <p>When enabled, the compiler will issue an error or a warning if a comparison - * is involving identical operands (e.g <code>'x == x'</code>). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.comparingIdentical"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 3.5 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Missing Synchronized Modifier On Inherited Method. - * <p>When enabled, the compiler will issue an error or a warning if a method - * overrides a synchronized method without having a synchronized modifier. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.5 - * @category CompilerOptionID - - - - - - - * Compiler option ID: Reporting Allocation of an Unused Object. - * <p>When enabled, the compiler will issue an error or a warning if an object is allocated but never used, - * neither by holding a reference nor by invoking one of the object's methods. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.6 - * @category CompilerOptionID - - - - - - - * Core option ID: Computing Project Build Order. - * <p>Indicate whether JavaCore should enforce the project build order to be based on - * the classpath prerequisite chain. When requesting to compute, this takes over - * the platform default order (based on project references). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.computeJavaBuildOrder"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "compute", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @category CoreOptionID - - - - - - - * Core option ID: Specifying Filters for Resource Copying Control. - * <p>Allow to specify some filters to control the resource copy process. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.builder.resourceCopyExclusionFilter"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "&lt;name&gt;[,&lt;name&gt;]* }</code> where <code>&lt;name&gt;</code> is a file name pattern (* and ? wild-cards allowed) - * or the name of a folder which ends with <code>'/'</code></dd> - * <dt>Default:</dt><dd><code>""</code></dd> - * </dl> - * @since 2.0 - * @category CoreOptionID - - - - - - - * Core option ID: Reporting Duplicate Resources. - * <p>Indicate the severity of the problem reported when more than one occurrence - * of a resource is to be copied into the output location. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.builder.duplicateResourceTask"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning" }</code></dd> - * <dt>Default:</dt><dd><code>"warning"</code></dd> - * </dl> - * @since 2.1 - * @category CoreOptionID - - - - - - - * Core option ID: Cleaning Output Folder(s). - * <p>Indicate whether the JavaBuilder is allowed to clean the output folders - * when performing full build operations. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.builder.cleanOutputFolder"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "clean", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"clean"</code></dd> - * </dl> - * @since 2.1 - * @category CoreOptionID - - - - - - - * Core option ID: Recreate Modified class files in Output Folder. - * <p>Indicate whether the JavaBuilder should check for any changes to .class files - * in the output folders while performing incremental build operations. If changes - * are detected to managed .class files, then a full build is performed, otherwise - * the changes are left as is. Tools further altering generated .class files, like optimizers, - * should ensure this option remains set in its default state of ignore. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.2 - * @category CoreOptionID - - - - - - - * Core option ID: Reporting Incomplete Classpath. - * <p>Indicate the severity of the problem reported when an entry on the classpath does not exist, - * is not legite or is not visible (for example, a referenced project is closed). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.incompleteClasspath"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning"}</code></dd> - * <dt>Default:</dt><dd><code>"error"</code></dd> - * </dl> - * @since 2.1 - * @category CoreOptionID - - - - - - - * Core option ID: Reporting Classpath Cycle. - * <p>Indicate the severity of the problem reported when a project is involved in a cycle. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.circularClasspath"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning" }</code></dd> - * <dt>Default:</dt><dd><code>"error"</code></dd> - * </dl> - * @since 2.1 - * @category CoreOptionID - - - - - - - * Core option ID: Reporting Incompatible JDK Level for Required Binaries. - * <p>Indicate the severity of the problem reported when a project prerequisites another project - * or library with an incompatible target JDK level (e.g. project targeting 1.1 vm, but compiled against 1.4 libraries). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.incompatibleJDKLevel"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"ignore"</code></dd> - * </dl> - * @since 3.0 - * @category CoreOptionID - - - - - - - * Core option ID: Abort if Invalid Classpath. - * <p>Allow to toggle the builder to abort if the classpath is invalid. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.builder.invalidClasspath"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "abort", "ignore" }</code></dd> - * <dt>Default:</dt><dd><code>"abort"</code></dd> - * </dl> - * @since 2.0 - * @category CoreOptionID - - - - - - - * Core option ID: Default Source Encoding Format. - * <p>Get the default encoding format of source files. This value is - * immutable and preset to the result of <code>ResourcesPlugin.getEncoding()</code>. - * <p>It is offered as a convenience shortcut only. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.encoding"</code></dd> - * <dt>value:</dt><dd><code>&lt;immutable, platform default value&gt;</code></dd> - * </dl> - * @since 2.0 - * @category CoreOptionID - - - - - - - * Core option ID: Enabling Usage of Classpath Exclusion Patterns. - * <p>When disabled, no entry on a project classpath can be associated with - * an exclusion pattern. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.classpath.exclusionPatterns"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"enabled"</code></dd> - * </dl> - * @since 2.1 - * @category CoreOptionID - - - - - - - * Core option ID: Enabling Usage of Classpath Multiple Output Locations. - * <p>When disabled, no entry on a project classpath can be associated with - * a specific output location, preventing thus usage of multiple output locations. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.classpath.multipleOutputLocations"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"enabled"</code></dd> - * </dl> - * @since 2.1 - * @category CoreOptionID - - - - - - - * Core option ID: Set the timeout value for retrieving the method's parameter names from javadoc. - * <p>Timeout in milliseconds to retrieve the method's parameter names from javadoc. - * <p>If the value is <code>0</code>, the parameter names are not fetched and the raw names are returned. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.timeoutForParameterNameFromAttachedJavadoc"</code></dd> - * <dt>Possible values:</dt><dd><code>"&lt;n&gt;"</code>, where <code>n</code> is an integer greater than or equal to <code>0</code></dd> - * <dt>Default:</dt><dd><code>"50"</code></dd> - * </dl> - * @since 3.2 - * @category CoreOptionID - - - - - - - * @since 2.0 - * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION}, - * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_BLOCK} , - * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION}, - * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION}, - * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_SWITCH}, - * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION} instead. - * @category DeprecatedOptionID - - - - - - - * @since 2.0 - * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT}, - * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT}, - * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT}, - * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT} instead. - * @category DeprecatedOptionID - - - - - - - * @since 2.0 - * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMPACT_ELSE_IF} instead. - * @category DeprecatedOptionID - - - - - - - * @since 2.0 - * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK} instead. - * @category DeprecatedOptionID - - - - - - - * @since 2.0 - * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE} instead. - * @category DeprecatedOptionID - - - - - - - * @since 2.0 - * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_LINE_SPLIT} instead - * @category DeprecatedOptionID - - - - - - - * @since 2.0 - * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR} instead. - * @category DeprecatedOptionID - - - - - - - * @since 2.0 - * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_TAB_CHAR} instead. - * @category DeprecatedOptionID - - - - - - - * @since 2.0 - * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_TAB_SIZE} instead. - * @category DeprecatedOptionID - - - - - - - * @since 2.1 - * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST} instead. - * @category DeprecatedOptionID - - - - - - - * Code assist option ID: Activate Visibility Sensitive Completion. - * <p>When active, completion doesn't show that you can not see - * (for example, you can not see private methods of a super class). - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.visibilityCheck"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 2.0 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Activate Deprecation Sensitive Completion. - * <p>When enabled, completion doesn't propose deprecated members and types. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.deprecationCheck"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.2 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Activate Camel Case Sensitive Completion. - * <p>When enabled, completion shows proposals whose name match the CamelCase - * pattern. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.camelCaseMatch"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"enabled"</code></dd> - * </dl> - * @since 3.2 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Automatic Qualification of Implicit Members. - * <p>When active, completion automatically qualifies completion on implicit - * field references and message expressions. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.forceImplicitQualification"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 2.0 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Define the Prefixes for Field Name. - * <p>When the prefixes is non empty, completion for field name will begin with - * one of the proposed prefixes. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.fieldPrefixes"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "&lt;prefix&gt;[,&lt;prefix&gt;]*" }</code> where <code>&lt;prefix&gt;</code> is a String without any wild-card</dd> - * <dt>Default:</dt><dd><code>""</code></dd> - * </dl> - * @since 2.1 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Define the Prefixes for Static Field Name. - * <p>When the prefixes is non empty, completion for static field name will begin with - * one of the proposed prefixes. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.staticFieldPrefixes"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "&lt;prefix&gt;[,&lt;prefix&gt;]*" }</code> where <code>&lt;prefix&gt;</code> is a String without any wild-card</dd> - * <dt>Default:</dt><dd><code>""</code></dd> - * </dl> - * @since 2.1 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Define the Prefixes for Static Final Field Name. - * <p>When the prefixes is non empty, completion for static final field name will begin with - * one of the proposed prefixes. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "&lt;prefix&gt;[,&lt;prefix&gt;]*" }</code> where <code>&lt;prefix&gt;</code> is a String without any wild-card</dd> - * <dt>Default:</dt><dd><code>""</code></dd> - * </dl> - * @since 3.5 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Define the Prefixes for Local Variable Name. - * <p>When the prefixes is non empty, completion for local variable name will begin with - * one of the proposed prefixes. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.localPrefixes"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "&lt;prefix&gt;[,&lt;prefix&gt;]*" }</code> where <code>&lt;prefix&gt;</code> is a String without any wild-card</dd> - * <dt>Default:</dt><dd><code>""</code></dd> - * </dl> - * @since 2.1 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Define the Prefixes for Argument Name. - * <p>When the prefixes is non empty, completion for argument name will begin with - * one of the proposed prefixes. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.argumentPrefixes"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "&lt;prefix&gt;[,&lt;prefix&gt;]*" }</code> where <code>&lt;prefix&gt;</code> is a String without any wild-card</dd> - * <dt>Default:</dt><dd><code>""</code></dd> - * </dl> - * @since 2.1 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Define the Suffixes for Field Name. - * <p>When the suffixes is non empty, completion for field name will end with - * one of the proposed suffixes. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.fieldSuffixes"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "&lt;suffix&gt;[,&lt;suffix&gt;]*" }</code> where <code>&lt;suffix&gt;</code> is a String without any wild-card</dd> - * <dt>Default:</dt><dd><code>""</code></dd> - * </dl> - * @since 2.1 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Define the Suffixes for Static Field Name. - * <p>When the suffixes is non empty, completion for static field name will end with - * one of the proposed suffixes. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.staticFieldSuffixes"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "&lt;suffix&gt;[,&lt;suffix&gt;]*" }</code>< where <code>&lt;suffix&gt;</code> is a String without any wild-card</dd> - * <dt>Default:</dt><dd><code>""</code></dd> - * </dl> - * @since 2.1 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Define the Suffixes for Static Final Field Name. - * <p>When the suffixes is non empty, completion for static final field name will end with - * one of the proposed suffixes. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "&lt;suffix&gt;[,&lt;suffix&gt;]*" }</code>< where <code>&lt;suffix&gt;</code> is a String without any wild-card</dd> - * <dt>Default:</dt><dd><code>""</code></dd> - * </dl> - * @since 3.5 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Define the Suffixes for Local Variable Name. - * <p>When the suffixes is non empty, completion for local variable name will end with - * one of the proposed suffixes. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.localSuffixes"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "&lt;suffix&gt;[,&lt;suffix&gt;]*" }</code> where <code>&lt;suffix&gt;</code> is a String without any wild-card</dd> - * <dt>Default:</dt><dd><code>""</code></dd> - * </dl> - * @since 2.1 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Define the Suffixes for Argument Name. - * <p>When the suffixes is non empty, completion for argument name will end with - * one of the proposed suffixes. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.argumentSuffixes"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "&lt;suffix&gt;[,&lt;suffix&gt;]*" }</code> where <code>&lt;suffix&gt;</code> is a String without any wild-card</dd> - * <dt>Default:</dt><dd><code>""</code></dd> - * </dl> - * @since 2.1 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Activate Forbidden Reference Sensitive Completion. - * <p>When enabled, completion doesn't propose elements which match a - * forbidden reference rule. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.forbiddenReferenceCheck"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"enabled"</code></dd> - * </dl> - * @since 3.1 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Activate Discouraged Reference Sensitive Completion. - * <p>When enabled, completion doesn't propose elements which match a - * discouraged reference rule. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.discouragedReferenceCheck"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"disabled"</code></dd> - * </dl> - * @since 3.1 - * @category CodeAssistOptionID - - - - - - - * Code assist option ID: Activate Suggestion of Static Import. - * <p>When enabled, completion proposals can contain static import - * pattern. - * <dl> - * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.suggestStaticImports"</code></dd> - * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> - * <dt>Default:</dt><dd><code>"enabled"</code></dd> - * </dl> - * @since 3.3 - * @category CodeAssistOptionID - - - - - - - * @deprecated Use {@link #DEFAULT_TASK_TAGS} instead. - * @since 2.1 - * @category DeprecatedOptionValue - - - - - - - * @deprecated Use {@link #DEFAULT_TASK_PRIORITIES} instead. - * @since 2.1 - * @category DeprecatedOptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @category OptionValue - - - - - - - * Configurable option value for {@link #COMPILER_TASK_PRIORITIES}: {@value}. - * @since 2.1 - * @category OptionValue - - - - - - - * Configurable option value for {@link #COMPILER_TASK_PRIORITIES}: {@value}. - * @since 2.1 - * @category OptionValue - - - - - - - * Configurable option value for {@link #COMPILER_TASK_PRIORITIES}: {@value}. - * @since 2.1 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.2 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.3 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.4 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 2.1 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.0 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.1 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.4 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.4 - * @category OptionValue - - - - - - - * Configurable option value: {@value}. - * @since 3.4 - * @category OptionValue - - - - - - - * Value of the content-type for Java source files. Use this value to retrieve the Java content type - * from the content type manager, and to add new Java-like extensions to this content type. - * - * @see org.eclipse.core.runtime.content.IContentTypeManager#getContentType(String) - * @see #getJavaLikeExtensions() - * @since 3.2 - - - - - - - * Adds the given listener for changes to Java elements. - * Has no effect if an identical listener is already registered. - * - * This listener will only be notified during the POST_CHANGE resource change notification - * and any reconcile operation (POST_RECONCILE). - * For finer control of the notification, use <code>addElementChangedListener(IElementChangedListener,int)</code>, - * which allows to specify a different eventMask. - * - * @param listener the listener - * @see ElementChangedEvent - - - - - - - - * Adds the given listener for changes to Java elements. - * Has no effect if an identical listener is already registered. - * After completion of this method, the given listener will be registered for exactly - * the specified events. If they were previously registered for other events, they - * will be deregistered. - * <p> - * Once registered, a listener starts receiving notification of changes to - * java elements in the model. The listener continues to receive - * notifications until it is replaced or removed. - * </p> - * <p> - * Listeners can listen for several types of event as defined in <code>ElementChangeEvent</code>. - * Clients are free to register for any number of event types however if they register - * for more than one, it is their responsibility to ensure they correctly handle the - * case where the same java element change shows up in multiple notifications. - * Clients are guaranteed to receive only the events for which they are registered. - * </p> - * - * @param listener the listener - * @param eventMask the bit-wise OR of all event types of interest to the listener - * @see IElementChangedListener - * @see ElementChangedEvent - * @see #removeElementChangedListener(IElementChangedListener) - * @since 2.0 - - - - - - - - - * Configures the given marker attribute map for the given Java element. - * Used for markers, which denote a Java element rather than a resource. - * - * @param attributes the mutable marker attribute map (key type: <code>String</code>, - * value type: <code>String</code>) - * @param element the Java element for which the marker needs to be configured - - - - - - - - - - - - - - - - - - - - - * Adds the given listener for POST_CHANGE resource change events to the Java core. - * The listener is guaranteed to be notified of the POST_CHANGE resource change event before - * the Java core starts processing the resource change event itself. - * <p> - * Has no effect if an identical listener is already registered. - * </p> - * - * @param listener the listener - * @see #removePreProcessingResourceChangedListener(IResourceChangeListener) - * @since 3.0 - * @deprecated use addPreProcessingResourceChangedListener(listener, IResourceChangeEvent.POST_CHANGE) instead - - - - - - - - * Adds the given listener for resource change events of the given types to the Java core. - * The listener is guaranteed to be notified of the resource change event before - * the Java core starts processing the resource change event itself. - * <p> - * If an identical listener is already registered, the given event types are added to the event types - * of interest to the listener. - * </p> - * <p> - * Supported event types are: - * <ul> - * <li>{@link IResourceChangeEvent#PRE_BUILD}</li> - * <li>{@link IResourceChangeEvent#POST_BUILD}</li> - * <li>{@link IResourceChangeEvent#POST_CHANGE}</li> - * <li>{@link IResourceChangeEvent#PRE_DELETE}</li> - * <li>{@link IResourceChangeEvent#PRE_CLOSE}</li> - * </ul> - * This list may increase in the future. - * </p> - * - * @param listener the listener - * @param eventMask the bit-wise OR of all event types of interest to the - * listener - * @see #removePreProcessingResourceChangedListener(IResourceChangeListener) - * @see IResourceChangeEvent - * @since 3.2 - - - - - - - - - * Configures the given marker for the given Java element. - * Used for markers, which denote a Java element rather than a resource. - * - * @param marker the marker to be configured - * @param element the Java element for which the marker needs to be configured - * @exception CoreException if the <code>IMarker.setAttribute</code> on the marker fails - - - - - - - - - * Returns the Java model element corresponding to the given handle identifier - * generated by <code>IJavaElement.getHandleIdentifier()</code>, or - * <code>null</code> if unable to create the associated element. - * - * @param handleIdentifier the given handle identifier - * @return the Java element corresponding to the handle identifier - - - - - - - - - - * A checked exception representing a failure in the Java model. - * Java model exceptions contain a Java-specific status object describing the - * cause of the exception. - * <p> - * Instances of this class are automatically created by the Java model - * when problems arise, so there is generally no need for clients to create - * instances. - * </p> - * - * @see IJavaModelStatus - * @see IJavaModelStatusConstants - * - * @noextend This class is not intended to be subclassed by clients. - - - - - - - - - * Returns the underlying <code>Throwable</code> that caused the failure. - * - * @return the wrappered <code>Throwable</code>, or <code>null</code> if the - * direct case of the failure was at the Java model layer - - - - - - - - * Returns the Java model status object for this exception. - * Equivalent to <code>(IJavaModelStatus) getStatus()</code>. - * - * @return a status object - - - - - - - - * Returns whether this exception indicates that a Java model element does not - * exist. Such exceptions have a status with a code of - * <code>IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST</code> or - * <code>IJavaModelStatusConstants.ELEMENT_NOT_ON_CLASSPATH</code>. - * This is a convenience method. - * - * @return <code>true</code> if this exception indicates that a Java model - * element does not exist - * @see IJavaModelStatus#isDoesNotExist() - * @see IJavaModelStatusConstants#ELEMENT_DOES_NOT_EXIST - * @see IJavaModelStatusConstants#ELEMENT_NOT_ON_CLASSPATH - - - - - - - - * Prints this exception's stack trace to the given print stream. - * - * @param output the print stream - * @since 3.0 - - - - - - - - * Prints this exception's stack trace to the given print writer. - * - * @param output the print writer - * @since 3.0 - - - - - - - - - - - - * Provides methods for computing Java-specific names. - * <p> - * The behavior of the methods is dependent of several JavaCore options. - * <p> - * The possible options are : - * <ul> - * <li> {@link JavaCore#CODEASSIST_FIELD_PREFIXES} : Define the Prefixes for Field Name.</li> - * <li> {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} : Define the Suffixes for Field Name.</li> - * - * <li> {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES} : Define the Prefixes for Static Field Name.</li> - * <li> {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} : Define the Suffixes for Static Field Name.</li> - * - * <li> {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_PREFIXES} : Define the Prefixes for Static Final Field Name.</li> - * <li> {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES} : Define the Suffixes for Static Final Field Name.</li> - * - * <li> {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} : Define the Prefixes for Local Variable Name.</li> - * <li> {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES} : Define the Suffixes for Local Variable Name.</li> - * - * <li> {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} : Define the Prefixes for Argument Name.</li> - * <li> {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES} : Define the Suffixes for Argument Name.</li> - * </ul> - * </p> - * <p> - * For a complete description of the configurable options, see {@link JavaCore#getDefaultOptions()}. - * To programmatically change these options, see {@link JavaCore#setOptions(java.util.Hashtable)}. - * </p> - * <p> - * This class provides static methods and constants only. - * </p> - * - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * @since 2.1 - * @noinstantiate This class is not intended to be instantiated by clients. - - - - - - - - - - - - - - - - - - * Variable kind which represents a static field. - * - * @since 3.5 - - - - - - - * Variable kind which represents an instance field. - * - * @since 3.5 - - - - - - - * Variable kind which represents a static final field. - * - * @since 3.5 - - - - - - - * Variable kind which represents an argument. - * - * @since 3.5 - - - - - - - * Variable kind which represents a local variable. - * - * @since 3.5 - - - - - - - * The base name associated to this base name kind is a simple name. - * When this base name is used the whole name is considered. - * - * @see #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean) - * - * @since 3.5 - - - - - - - * The base name associated to this base name kind is a simple type name. - * When this base name is used all the words of the name are considered. - * - * @see #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean) - * - * @since 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Remove prefix and suffix from an argument name. - * <p> - * If argument name prefix is <code>pre</code> and argument name suffix is <code>suf</code> - * then for an argument named <code>preArgsuf</code> the result of this method is <code>arg</code>. - * If there is no prefix or suffix defined in JavaCore options the result is the unchanged - * name <code>preArgsuf</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} and - * {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES}. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param javaProject project which contains the argument. - * @param argumentName argument's name. - * @return char[] the name without prefix and suffix. - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * - * @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead with {@link #VK_PARAMETER} as variable kind. - - - - - - - - - - - - - - - - * Remove prefix and suffix from an argument name. - * <p> - * If argument name prefix is <code>pre</code> and argument name suffix is <code>suf</code> - * then for an argument named <code>preArgsuf</code> the result of this method is <code>arg</code>. - * If there is no prefix or suffix defined in JavaCore options the result is the unchanged - * name <code>preArgsuf</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} and - * {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES}. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param javaProject project which contains the argument. - * @param argumentName argument's name. - * @return char[] the name without prefix and suffix. - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * - * @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead with {@link #VK_PARAMETER} as variable kind. - - - - - - - - - - * Remove prefix and suffix from a field name. - * <p> - * If field name prefix is <code>pre</code> and field name suffix is <code>suf</code> - * then for a field named <code>preFieldsuf</code> the result of this method is <code>field</code>. - * If there is no prefix or suffix defined in JavaCore options the result is the unchanged - * name <code>preFieldsuf</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES} } , - * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param javaProject project which contains the field. - * @param fieldName field's name. - * @param modifiers field's modifiers as defined by the class - * <code>Flags</code>. - * @return char[] the name without prefix and suffix. - * @see Flags - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * - * @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead - * with {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FIELD} as variable kind. - - - - - - - - - - - - - - - - - * Remove prefix and suffix from a field name. - * <p> - * If field name prefix is <code>pre</code> and field name suffix is <code>suf</code> - * then for a field named <code>preFieldsuf</code> the result of this method is <code>field</code>. - * If there is no prefix or suffix defined in JavaCore options the result is the unchanged - * name <code>preFieldsuf</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param javaProject project which contains the field. - * @param fieldName field's name. - * @param modifiers field's modifiers as defined by the class - * <code>Flags</code>. - * @return char[] the name without prefix and suffix. - * @see Flags - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * - * @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead - * with {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FIELD} as variable kind. - - - - - - - - - - - * Remove prefix and suffix from a local variable name. - * <p> - * If local variable name prefix is <code>pre</code> and local variable name suffix is <code>suf</code> - * then for a local variable named <code>preLocalsuf</code> the result of this method is <code>local</code>. - * If there is no prefix or suffix defined in JavaCore options the result is the unchanged - * name <code>preLocalsuf</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and - * {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param javaProject project which contains the variable. - * @param localName variable's name. - * @return char[] the name without prefix and suffix. - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * - * @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead with {@link #VK_LOCAL} as variable kind. - - - - - - - - - - - - - - - - * Remove prefix and suffix from a local variable name. - * <p> - * If local variable name prefix is <code>pre</code> and local variable name suffix is <code>suf</code> - * then for a local variable named <code>preLocalsuf</code> the result of this method is <code>local</code>. - * If there is no prefix or suffix defined in JavaCore options the result is the unchanged - * name <code>preLocalsuf</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and - * {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param javaProject project which contains the variable. - * @param localName variable's name. - * @return char[] the name without prefix and suffix. - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * - * @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead with {@link #VK_LOCAL} as variable kind. - - - - - - - - - - * Returns a base name which could be used to generate the given variable name with {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)}. - * <p> - * e.g.<br> - * If the variable is a {@link #VK_LOCAL} and the variable name is <code>variableName</code> then the base name will be <code>variableName</code>.<br> - * If the variable is a {@link #VK_STATIC_FINAL_FIELD} and the variable name is <code>VARIABLE_NAME</code> then the base name will be <code>variableName</code>.<br> - * </p> - * <p> - * Prefixes and suffixes defined in JavaCore options will be also removed from the variable name.<br> - * Each variable kind is affected by the following JavaCore options: - * <ul> - * <li>{@link #VK_PARAMETER}: {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} and {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES}</li> - * <li>{@link #VK_LOCAL}: {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}</li> - * <li>{@link #VK_INSTANCE_FIELD}: {@link JavaCore#CODEASSIST_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_FIELD_SUFFIXES}</li> - * <li>{@link #VK_STATIC_FIELD}: {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES}</li> - * <li>{@link #VK_STATIC_FINAL_FIELD}: {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES}</li> - * </ul> - * </p> - * <p> - * e.g.<br> - * If the variable is a {@link #VK_LOCAL}, the variable name is <code>preVariableNamesuf</code>, a possible prefix is <code>pre</code> and a possible suffix is <code>suf</code> - * then the base name will be <code>variableName</code>.<br> - * </p> - * - * @param variableKind specifies what type the variable is: {@link #VK_LOCAL}, {@link #VK_PARAMETER}, {@link #VK_STATIC_FIELD}, - * {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FINAL_FIELD}. - * @param variableName a variable name - * @param javaProject project which contains the variable or <code>null</code> to take into account only workspace settings. - * - * @see #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean) - * @since 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - * Suggest names for an argument. The name is computed from argument's type - * and possible prefixes or suffixes are added. - * <p> - * If the type of the argument is <code>TypeName</code>, the prefix for argument is <code>pre</code> - * and the suffix for argument is <code>suf</code> then the proposed names are <code>preTypeNamesuf</code> - * and <code>preNamesuf</code>. If there is no prefix or suffix the proposals are <code>typeName</code> - * and <code>name</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} and - * {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES}. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param javaProject project which contains the argument. - * @param packageName package of the argument's type. - * @param qualifiedTypeName argument's type. - * @param dim argument's dimension (0 if the argument is not an array). - * @param excludedNames a list of names which cannot be suggested (already used names). - * Can be <code>null</code> if there is no excluded names. - * @return char[][] an array of names. - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * - * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead with {@link #VK_PARAMETER} as variable kind. - - - - - - - - - - - - - - - - - - - - - - - - - * Suggest names for an argument. The name is computed from argument's type - * and possible prefixes or suffixes are added. - * <p> - * If the type of the argument is <code>TypeName</code>, the prefix for argument is <code>pre</code> - * and the suffix for argument is <code>suf</code> then the proposed names are <code>preTypeNamesuf</code> - * and <code>preNamesuf</code>. If there is no prefix or suffix the proposals are <code>typeName</code> - * and <code>name</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} and - * {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES}. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param javaProject project which contains the argument. - * @param packageName package of the argument's type. - * @param qualifiedTypeName argument's type. - * @param dim argument's dimension (0 if the argument is not an array). - * @param excludedNames a list of names which cannot be suggested (already used names). - * Can be <code>null</code> if there is no excluded names. - * @return char[][] an array of names. - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * - * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead with {@link #VK_PARAMETER} as variable kind. - - - - - - - - - - - - - - - - - - - * Suggest names for a field. The name is computed from field's type - * and possible prefixes or suffixes are added. - * <p> - * If the type of the field is <code>TypeName</code>, the prefix for field is <code>pre</code> - * and the suffix for field is <code>suf</code> then the proposed names are <code>preTypeNamesuf</code> - * and <code>preNamesuf</code>. If there is no prefix or suffix the proposals are <code>typeName</code> - * and <code>name</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} and for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param javaProject project which contains the field. - * @param packageName package of the field's type. - * @param qualifiedTypeName field's type. - * @param dim field's dimension (0 if the field is not an array). - * @param modifiers field's modifiers as defined by the class - * <code>Flags</code>. - * @param excludedNames a list of names which cannot be suggested (already used names). - * Can be <code>null</code> if there is no excluded names. - * @return char[][] an array of names. - * @see Flags - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * - * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead - * with {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FIELD} as variable kind. - - - - - - - - - - - - - - - - - - - - - - - - - - * Suggest names for a field. The name is computed from field's type - * and possible prefixes or suffixes are added. - * <p> - * If the type of the field is <code>TypeName</code>, the prefix for field is <code>pre</code> - * and the suffix for field is <code>suf</code> then the proposed names are <code>preTypeNamesuf</code> - * and <code>preNamesuf</code>. If there is no prefix or suffix the proposals are <code>typeName</code> - * and <code>name</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} and for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param javaProject project which contains the field. - * @param packageName package of the field's type. - * @param qualifiedTypeName field's type. - * @param dim field's dimension (0 if the field is not an array). - * @param modifiers field's modifiers as defined by the class - * <code>Flags</code>. - * @param excludedNames a list of names which cannot be suggested (already used names). - * Can be <code>null</code> if there is no excluded names. - * @return char[][] an array of names. - * @see Flags - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * - * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead - * with {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FIELD} as variable kind. - - - - - - - - - - - - - - - - - - - - * Suggest name for a getter method. The name is computed from field's name - * and possible prefixes or suffixes are removed. - * <p> - * If the field name is <code>preFieldNamesuf</code> and the prefix for field is <code>pre</code> and - * the suffix for field is <code>suf</code> then the prosposed name is <code>isFieldName</code> for boolean field or - * <code>getFieldName</code> for others. If there is no prefix and suffix the proposal is <code>isPreFieldNamesuf</code> - * for boolean field or <code>getPreFieldNamesuf</code> for others. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param project project which contains the field. - * @param fieldName field's name's. - * @param modifiers field's modifiers as defined by the class - * <code>Flags</code>. - * @param isBoolean <code>true</code> if the field's type is boolean - * @param excludedNames a list of names which cannot be suggested (already used names). - * Can be <code>null</code> if there is no excluded names. - * @return char[] a name. - * @see Flags - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - - - - - - - - - - - - - - - - - - - - - - * Suggest name for a getter method. The name is computed from field's name - * and possible prefixes or suffixes are removed. - * <p> - * If the field name is <code>preFieldNamesuf</code> and the prefix for field is <code>pre</code> and - * the suffix for field is <code>suf</code> then the prosposed name is <code>isFieldName</code> for boolean field or - * <code>getFieldName</code> for others. If there is no prefix and suffix the proposal is <code>isPreFieldNamesuf</code> - * for boolean field or <code>getPreFieldNamesuf</code> for others. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param project project which contains the field. - * @param fieldName field's name's. - * @param modifiers field's modifiers as defined by the class - * <code>Flags</code>. - * @param isBoolean <code>true</code> if the field's type is boolean - * @param excludedNames a list of names which cannot be suggested (already used names). - * Can be <code>null</code> if there is no excluded names. - * @return char[] a name. - * @see Flags - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - - - - - - - - - - - - - - - - * Suggest names for a local variable. The name is computed from variable's type - * and possible prefixes or suffixes are added. - * <p> - * If the type of the local variable is <code>TypeName</code>, the prefix for local variable is <code>pre</code> - * and the suffix for local variable is <code>suf</code> then the proposed names are <code>preTypeNamesuf</code> - * and <code>preNamesuf</code>. If there is no prefix or suffix the proposals are <code>typeName</code> - * and <code>name</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and - * {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param javaProject project which contains the variable. - * @param packageName package of the variable's type. - * @param qualifiedTypeName variable's type. - * @param dim variable's dimension (0 if the variable is not an array). - * @param excludedNames a list of names which cannot be suggested (already used names). - * Can be <code>null</code> if there is no excluded names. - * @return char[][] an array of names. - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * - * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead with {@link #VK_LOCAL} as variable kind. - - - - - - - - - - - - - - - - - - - - - - - - - * Suggest names for a local variable. The name is computed from variable's type - * and possible prefixes or suffixes are added. - * <p> - * If the type of the local variable is <code>TypeName</code>, the prefix for local variable is <code>pre</code> - * and the suffix for local variable is <code>suf</code> then the proposed names are <code>preTypeNamesuf</code> - * and <code>preNamesuf</code>. If there is no prefix or suffix the proposals are <code>typeName</code> - * and <code>name</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and - * {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param javaProject project which contains the variable. - * @param packageName package of the variable's type. - * @param qualifiedTypeName variable's type. - * @param dim variable's dimension (0 if the variable is not an array). - * @param excludedNames a list of names which cannot be suggested (already used names). - * Can be <code>null</code> if there is no excluded names. - * @return char[][] an array of names. - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * - * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead with {@link #VK_LOCAL} as variable kind. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Suggest name for a setter method. The name is computed from field's name - * and possible prefixes or suffixes are removed. - * <p> - * If the field name is <code>preFieldNamesuf</code> and the prefix for field is <code>pre</code> and - * the suffix for field is <code>suf</code> then the proposed name is <code>setFieldName</code>. - * If there is no prefix and suffix the proposal is <code>setPreFieldNamesuf</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param project project which contains the field. - * @param fieldName field's name's. - * @param modifiers field's modifiers as defined by the class - * <code>Flags</code>. - * @param isBoolean <code>true</code> if the field's type is boolean - * @param excludedNames a list of names which cannot be suggested (already used names). - * Can be <code>null</code> if there is no excluded names. - * @return char[] a name. - * @see Flags - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - - - - - - - - - - - - - - - - - - - - - - * Suggest name for a setter method. The name is computed from field's name - * and possible prefixes or suffixes are removed. - * <p> - * If the field name is <code>preFieldNamesuf</code> and the prefix for field is <code>pre</code> and - * the suffix for field is <code>suf</code> then the proposed name is <code>setFieldName</code>. - * If there is no prefix and suffix the proposal is <code>setPreFieldNamesuf</code>. - * </p> - * <p> - * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, - * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. - * </p> - * <p> - * For a complete description of these configurable options, see <code>getDefaultOptions</code>. - * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. - * </p> - * - * @param project project which contains the field. - * @param fieldName field's name's. - * @param modifiers field's modifiers as defined by the class - * <code>Flags</code>. - * @param isBoolean <code>true</code> if the field's type is boolean - * @param excludedNames a list of names which cannot be suggested (already used names). - * Can be <code>null</code> if there is no excluded names. - * @return char[] a name. - * @see Flags - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - - - - - - - - - - - - - - - - * Suggests names for a variable. The name is computed from a base name and possible prefixes or suffixes are added. - * - * <p> - * The base name is used to compute the variable name. - * Some different kinds of base names are possible and each kind is associated to a different heuristic to compute variable names.<br> - * The heuristic depends also on the kind of the variable. Each kind of variable is identified by a constant starting with <code>VK_</code>.<br> - * When a prefix and a suffix can be added then all combinations of prefix and suffix are suggested. - * If the name is <code>name</code>, the prefix is <code>pre</code> and the suffix is <code>suf</code> then the suggested names will be - * <code>prenamesuf</code>, <code>prename</code>, <code>namesuf</code> and <code>name</code>.<br> - * <br> - * The different kinds of base names are: - * <ul> - * <li>{@link #BK_NAME}: the base name is a Java name and the whole base name is considered to compute the variable names. A prefix and a suffix can be added.<br> - * There is a heuristic by variable kind. - * <ul> - * <li>{@link #VK_PARAMETER}, {@link #VK_LOCAL}, {@link #VK_INSTANCE_FIELD} and {@link #VK_STATIC_FIELD}:<br> - * In this case the first word will be converted to lower case and the other characters won't be changed.<br> - * If the base name is <code>SimpleName</code> then the suggested name will be <code>simpleName</code>.<br></li> - * <li>{@link #VK_STATIC_FINAL_FIELD} :<br> - * In this case all letters of the name will be converted to upper case and words will be separated by an underscore (<code>"_"</code>).<br> - * If the base name is <code>SimpleName</code> then the suggested name will be <code>SIMPLE_NAME</code>.</li> - * </ul></li> - * <li>{@link #BK_TYPE_NAME}: the base name is a Java simple type name (e.g. <code>HashMap</code>) and all the words of the base name are considered to compute the variable names. A prefix and a suffix can be added to these names.<br> - * There is a heuristic by variable kind. - * <ul> - * <li>{@link #VK_PARAMETER}, {@link #VK_LOCAL}, {@link #VK_INSTANCE_FIELD} and {@link #VK_STATIC_FIELD}:<br> - * In this case a variable name will contain some words of the base name and the first word will be converted to lower case.<br> - * If the type is <code>TypeName</code> then the suggested names will be <code>typeName</code> and <code>name</code>.</li> - * <li>{@link #VK_STATIC_FINAL_FIELD} :<br> - * In this case a variable name will contain some words of the base name, all letters of the name will be converted to upper case and segments will be separated by a underscore (<code>"_"</code>).<br> - * If the base name is <code>TypeName</code> then the suggested name will be <code>TYPE_NAME</code> and <code>NAME</code>.</li> - * </ul></li> - * </ul> - * Some other kinds could be added in the future. - * </p> - * <p> - * Each variable kind is affected by the following JavaCore options: - * <ul> - * <li>{@link #VK_PARAMETER}: {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} and {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES}</li> - * <li>{@link #VK_LOCAL}: {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}</li> - * <li>{@link #VK_INSTANCE_FIELD}: {@link JavaCore#CODEASSIST_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_FIELD_SUFFIXES}</li> - * <li>{@link #VK_STATIC_FIELD}: {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES}</li> - * <li>{@link #VK_STATIC_FINAL_FIELD}: {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES}</li> - * </ul> - * </p> - * <p> - * For a complete description of these configurable options, see {@link JavaCore#getDefaultOptions()}. - * To programmatically change these options, see {@link JavaCore#setOptions(java.util.Hashtable)} and {@link IJavaProject#setOptions(java.util.Map)} - * </p> - * <p> - * Proposed names are sorted by relevance (best proposal first).<br> - * The names are proposed in the following order: - * <ol> - * <li>Names with prefix and suffix. Longer names are proposed first</li> - * <li>Names with prefix. Longer names are proposed first</li> - * <li>Names with suffix. Longer names are proposed first</li> - * <li>Names without prefix and suffix. Longer names are proposed first</li> - * </ol> - * </p> - * - * @param variableKind specifies what type the variable is: {@link #VK_LOCAL}, {@link #VK_PARAMETER}, {@link #VK_STATIC_FIELD}, - * {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FINAL_FIELD}. - * @param baseNameKind specifies what type the base name is: {@link #BK_NAME} or {@link #BK_TYPE_NAME} - * @param baseName name used to compute the suggested names. - * @param javaProject project which contains the variable or <code>null</code> to take into account only workspace settings. - * @param dim variable dimension (0 if the field is not an array). - * @param excluded a list of names which cannot be suggested (already used names). - * Can be <code>null</code> if there are no excluded names. - * @param evaluateDefault if <code>true</code>, the result is guaranteed to contain at least one result. If <code>false</code>, the result can be an empty array. - * @return String[] an array of names. - * @see JavaCore#setOptions(java.util.Hashtable) - * @see JavaCore#getDefaultOptions() - * - * @since 3.5 - - - - - - - - - - - - - - - - - - - - - - * Provides methods for encoding and decoding type and method signature strings. - * <p> - * Signatures obtained from parsing source files (i.e. files with one of the - * {@link JavaCore#getJavaLikeExtensions() Java-like extensions}) differ subtly - * from ones obtained from pre-compiled binary (".class") files in class names are - * usually left unresolved in the former. For example, the normal resolved form - * of the type "String" embeds the class's package name ("Ljava.lang.String;" - * or "Ljava/lang/String;"), whereas the unresolved form contains only what is - * written "QString;". - * </p> - * <p> - * Generic types introduce to the Java language in J2SE 1.5 add three new - * facets to signatures: type variables, parameterized types with type arguments, - * and formal type parameters. <i>Rich</i> signatures containing these facets - * only occur when dealing with code that makes overt use of the new language - * features. All other code, and certainly all Java code written or compiled - * with J2SE 1.4 or earlier, involved only <i>simple</i> signatures. - * </p> - * <p> - * Note that the "Q" and "!" formats are specific to Eclipse; the remainder - * are specified in the JVM spec. - * </p> - * <p> - * The syntax for a type signature is: - * <pre> - * TypeSignature ::= - * "B" // byte - * | "C" // char - * | "D" // double - * | "F" // float - * | "I" // int - * | "J" // long - * | "S" // short - * | "V" // void - * | "Z" // boolean - * | "T" + Identifier + ";" // type variable - * | "[" + TypeSignature // array X[] - * | "!" + TypeSignature // capture-of ? - * | ResolvedClassTypeSignature - * | UnresolvedClassTypeSignature - * - * ResolvedClassTypeSignature ::= // resolved named type (in compiled code) - * "L" + Identifier + OptionalTypeArguments - * ( ( "." | "/" ) + Identifier + OptionalTypeArguments )* + ";" - * | OptionalTypeParameters + "L" + Identifier + - * ( ( "." | "/" ) + Identifier )* + ";" - * - * UnresolvedClassTypeSignature ::= // unresolved named type (in source code) - * "Q" + Identifier + OptionalTypeArguments - * ( ( "." | "/" ) + Identifier + OptionalTypeArguments )* + ";" - * | OptionalTypeParameters "Q" + Identifier + - * ( ( "." | "/" ) + Identifier )* + ";" - * - * OptionalTypeArguments ::= - * "&lt;" + TypeArgument+ + "&gt;" - * | - * - * TypeArgument ::= - * | TypeSignature - * | "*" // wildcard ? - * | "+" TypeSignature // wildcard ? extends X - * | "-" TypeSignature // wildcard ? super X - * - * OptionalTypeParameters ::= - * "&lt;" + FormalTypeParameterSignature+ + "&gt;" - * | - * </pre> - * </p> - * <p> - * Examples: - * <ul> - * <li><code>"[[I"</code> denotes <code>int[][]</code></li> - * <li><code>"Ljava.lang.String;"</code> denotes <code>java.lang.String</code> in compiled code</li> - * <li><code>"QString;"</code> denotes <code>String</code> in source code</li> - * <li><code>"Qjava.lang.String;"</code> denotes <code>java.lang.String</code> in source code</li> - * <li><code>"[QString;"</code> denotes <code>String[]</code> in source code</li> - * <li><code>"QMap&lt;QString;*&gt;;"</code> denotes <code>Map&lt;String,?&gt;</code> in source code</li> - * <li><code>"Qjava.util.List&ltTV;&gt;;"</code> denotes <code>java.util.List&lt;V&gt;</code> in source code</li> - * <li><code>"&ltE;&gt;Ljava.util.List;"</code> denotes <code>&lt;E&gt;java.util.List</code> in source code</li> - * </ul> - * </p> - * <p> - * The syntax for a method signature is: - * <pre> - * MethodSignature ::= OptionalTypeParameters + "(" + ParamTypeSignature* + ")" + ReturnTypeSignature - * ParamTypeSignature ::= TypeSignature - * ReturnTypeSignature ::= TypeSignature - * </pre> - * <p> - * Examples: - * <ul> - * <li><code>"()I"</code> denotes <code>int foo()</code></li> - * <li><code>"([Ljava.lang.String;)V"</code> denotes <code>void foo(java.lang.String[])</code> in compiled code</li> - * <li><code>"(QString;)QObject;"</code> denotes <code>Object foo(String)</code> in source code</li> - * </ul> - * </p> - * <p> - * The syntax for a formal type parameter signature is: - * <pre> - * FormalTypeParameterSignature ::= - * TypeVariableName + OptionalClassBound + InterfaceBound* - * TypeVariableName ::= Identifier - * OptionalClassBound ::= - * ":" - * | ":" + TypeSignature - * InterfaceBound ::= - * ":" + TypeSignature - * </pre> - * <p> - * Examples: - * <ul> - * <li><code>"X:"</code> denotes <code>X</code></li> - * <li><code>"X:QReader;"</code> denotes <code>X extends Reader</code> in source code</li> - * <li><code>"X:QReader;:QSerializable;"</code> denotes <code>X extends Reader & Serializable</code> in source code</li> - * </ul> - * </p> - * <p> - * This class provides static methods and constants only. - * </p> - * <p>Note: An empty signature is considered to be syntactically incorrect. So most methods will throw - * an IllegalArgumentException if an empty signature is provided.</p> - * - * @noinstantiate This class is not intended to be instantiated by clients. - - - - - - * Character constant indicating the primitive type boolean in a signature. - * Value is <code>'Z'</code>. - - - - - - - * Character constant indicating the primitive type byte in a signature. - * Value is <code>'B'</code>. - - - - - - - * Character constant indicating the primitive type char in a signature. - * Value is <code>'C'</code>. - - - - - - - * Character constant indicating the primitive type double in a signature. - * Value is <code>'D'</code>. - - - - - - - * Character constant indicating the primitive type float in a signature. - * Value is <code>'F'</code>. - - - - - - - * Character constant indicating the primitive type int in a signature. - * Value is <code>'I'</code>. - - - - - - - * Character constant indicating the semicolon in a signature. - * Value is <code>';'</code>. - - - - - - - * Character constant indicating the colon in a signature. - * Value is <code>':'</code>. - * @since 3.0 - - - - - - - * Character constant indicating the primitive type long in a signature. - * Value is <code>'J'</code>. - - - - - - - * Character constant indicating the primitive type short in a signature. - * Value is <code>'S'</code>. - - - - - - - * Character constant indicating result type void in a signature. - * Value is <code>'V'</code>. - - - - - - - * Character constant indicating the start of a resolved type variable in a - * signature. Value is <code>'T'</code>. - * @since 3.0 - - - - - - - * Character constant indicating an unbound wildcard type argument - * in a signature. - * Value is <code>'*'</code>. - * @since 3.0 - - - - - - - * Character constant indicating an exception in a signature. - * Value is <code>'^'</code>. - * @since 3.1 - - - - - - - * Character constant indicating a bound wildcard type argument - * in a signature with extends clause. - * Value is <code>'+'</code>. - * @since 3.1 - - - - - - - * Character constant indicating a bound wildcard type argument - * in a signature with super clause. - * Value is <code>'-'</code>. - * @since 3.1 - - - - - - - * Character constant indicating the dot in a signature. - * Value is <code>'.'</code>. - - - - - - - * Character constant indicating the dollar in a signature. - * Value is <code>'$'</code>. - - - - - - - * Character constant indicating an array type in a signature. - * Value is <code>'['</code>. - - - - - - - * Character constant indicating the start of a resolved, named type in a - * signature. Value is <code>'L'</code>. - - - - - - - * Character constant indicating the start of an unresolved, named type in a - * signature. Value is <code>'Q'</code>. - - - - - - - * Character constant indicating the end of a named type in a signature. - * Value is <code>';'</code>. - - - - - - - * Character constant indicating the start of a parameter type list in a - * signature. Value is <code>'('</code>. - - - - - - - * Character constant indicating the end of a parameter type list in a - * signature. Value is <code>')'</code>. - - - - - - - * Character constant indicating the start of a formal type parameter - * (or type argument) list in a signature. Value is <code>'&lt;'</code>. - * @since 3.0 - - - - - - - * Character constant indicating the end of a generic type list in a - * signature. Value is <code>'&gt;'</code>. - * @since 3.0 - - - - - - - * Character constant indicating a capture of a wildcard type in a - * signature. Value is <code>'!'</code>. - * @since 3.1 - - - - - - - * String constant for the signature of the primitive type boolean. - * Value is <code>"Z"</code>. - - - - - - - * String constant for the signature of the primitive type byte. - * Value is <code>"B"</code>. - - - - - - - * String constant for the signature of the primitive type char. - * Value is <code>"C"</code>. - - - - - - - * String constant for the signature of the primitive type double. - * Value is <code>"D"</code>. - - - - - - - * String constant for the signature of the primitive type float. - * Value is <code>"F"</code>. - - - - - - - * String constant for the signature of the primitive type int. - * Value is <code>"I"</code>. - - - - - - - * String constant for the signature of the primitive type long. - * Value is <code>"J"</code>. - - - - - - - * String constant for the signature of the primitive type short. - * Value is <code>"S"</code>. - - - - - - String constant for the signature of result type void. - * Value is <code>"V"</code>. - - - - - - - * Kind constant for a class type signature. - * @see #getTypeSignatureKind(String) - * @since 3.0 - - - - - - - * Kind constant for a base (primitive or void) type signature. - * @see #getTypeSignatureKind(String) - * @since 3.0 - - - - - - - * Kind constant for a type variable signature. - * @see #getTypeSignatureKind(String) - * @since 3.0 - - - - - - - * Kind constant for an array type signature. - * @see #getTypeSignatureKind(String) - * @since 3.0 - - - - - - - * Kind constant for a wildcard type signature. - * @see #getTypeSignatureKind(String) - * @since 3.1 - - - - - - - * Kind constant for the capture of a wildcard type signature. - * @see #getTypeSignatureKind(String) - * @since 3.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Creates a new type signature with the given amount of array nesting added - * to the given type signature. - * - * @param typeSignature the type signature - * @param arrayCount the desired number of levels of array nesting - * @return the encoded array type signature - * - * @since 2.0 - - - - - - - - - - - - - - - - * Creates a new type signature with the given amount of array nesting added - * to the given type signature. - * - * @param typeSignature the type signature - * @param arrayCount the desired number of levels of array nesting - * @return the encoded array type signature - - - - - - - - - - * Creates a method signature from the given parameter and return type - * signatures. The encoded method signature is dot-based. - * - * @param parameterTypes the list of parameter type signatures - * @param returnType the return type signature - * @return the encoded method signature - * - * @since 2.0 - - - - - - - - - - - - - - - - - - - * Creates a method signature from the given parameter and return type - * signatures. The encoded method signature is dot-based. This method - * is equivalent to - * <code>createMethodSignature(parameterTypes, returnType)</code>. - * - * @param parameterTypes the list of parameter type signatures - * @param returnType the return type signature - * @return the encoded method signature - * @see Signature#createMethodSignature(char[][], char[]) - - - - - - - - - - - - - * Creates a new type parameter signature with the given name and bounds. - * - * @param typeParameterName the type parameter name - * @param boundSignatures the signatures of associated bounds or empty array if none - * @return the encoded type parameter signature - * - * @since 3.1 - - - - - - - - - - - - - - - - - - - * Creates a new type parameter signature with the given name and bounds. - * - * @param typeParameterName the type parameter name - * @param boundSignatures the signatures of associated bounds or empty array if none - * @return the encoded type parameter signature - * - * @since 3.1 - - - - - - - - - - - - - * Creates a new type signature from the given type name encoded as a character - * array. The type name may contain primitive types, array types or parameterized types. - * This method is equivalent to - * <code>createTypeSignature(new String(typeName),isResolved)</code>, although - * more efficient for callers with character arrays rather than strings. If the - * type name is qualified, then it is expected to be dot-based. - * - * @param typeName the possibly qualified type name - * @param isResolved <code>true</code> if the type name is to be considered - * resolved (for example, a type name from a binary class file), and - * <code>false</code> if the type name is to be considered unresolved - * (for example, a type name found in source code) - * @return the encoded type signature - * @see #createTypeSignature(java.lang.String,boolean) - - - - - - - - - - - - - * Creates a new type signature from the given type name encoded as a character - * array. The type name may contain primitive types or array types or parameterized types. - * This method is equivalent to - * <code>createTypeSignature(new String(typeName),isResolved).toCharArray()</code>, - * although more efficient for callers with character arrays rather than strings. - * If the type name is qualified, then it is expected to be dot-based. - * - * @param typeName the possibly qualified type name - * @param isResolved <code>true</code> if the type name is to be considered - * resolved (for example, a type name from a binary class file), and - * <code>false</code> if the type name is to be considered unresolved - * (for example, a type name found in source code) - * @return the encoded type signature - * @see #createTypeSignature(java.lang.String,boolean) - * - * @since 2.0 - - - - - - - - - - - - - - - - - - - - - - - - - - * A source range defines an element's source coordinates relative to - * its source buffer. - * - * @see ISourceRange - * @since 3.6 - - - - - - - - - * Helper method that answers whether a valid source range is available - * in the given ISourceRange. When an element has no associated source - * code, Java Model APIs may return either <code>null</code> or a range of - * [-1, 0] to indicate an invalid range. This utility method can be used - * to detect that case. - * - * @param range a source range, can be <code>null</code> - * @return <code>true</code> iff range is not null and range.getOffset() is not -1 - - - - - - - - - - - - - * @see ISourceRange - - - - - - - - * @see ISourceRange - - - - - - - - - - - - - - - * Factory for creating various compiler tools, such as scanners, parsers and compilers. - * <p> - * This class provides static methods only. - * </p> - * - * @since 2.0 - * @noinstantiate This class is not intended to be instantiated by clients. - * @noextend This class is not intended to be subclassed by clients. - - - - - - * This mode is used for formatting new code when some formatter options should not be used. - * In particular, options that preserve the indentation of comments are not used. - * In the future, newly added options may be ignored as well. - * <p>Clients that are formatting new code are recommended to use this mode. - * </p> - * - * @see DefaultCodeFormatterConstants#FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN - * @see DefaultCodeFormatterConstants#FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN - * @see #createCodeFormatter(Map, int) - * @since 3.3 - - - - - - - * This mode is used for formatting existing code when all formatter options should be used. - * In particular, options that preserve the indentation of comments are used. - * <p>Clients that are formatting existing code are recommended to use this mode. - * </p> - * - * @see DefaultCodeFormatterConstants#FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN - * @see DefaultCodeFormatterConstants#FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN - * @see #createCodeFormatter(Map, int) - * @since 3.3 - - - - - - - * Create an instance of a code formatter. A code formatter implementation can be contributed via the - * extension point "org.eclipse.jdt.core.codeFormatter". If unable to find a registered extension, the factory - * will default to using the default code formatter. - * - * @return an instance of a code formatter - * @see ICodeFormatter - * @see ToolFactory#createDefaultCodeFormatter(Map) - * @deprecated The extension point has been deprecated, use {@link #createCodeFormatter(Map)} instead. - - - - - - - - * Create an instance of the built-in code formatter. - * <p>The given options should at least provide the source level ({@link JavaCore#COMPILER_SOURCE}), - * the compiler compliance level ({@link JavaCore#COMPILER_COMPLIANCE}) and the target platform - * ({@link JavaCore#COMPILER_CODEGEN_TARGET_PLATFORM}). - * Without these options, it is not possible for the code formatter to know what kind of source it needs to format. - * </p><p> - * Note this is equivalent to <code>createCodeFormatter(options, M_FORMAT_NEW)</code>. Thus some code formatter options - * may be ignored. See @{link {@link #M_FORMAT_NEW} for more details. - * </p> - * @param options - the options map to use for formatting with the default code formatter. Recognized options - * are documented on <code>JavaCore#getDefaultOptions()</code>. If set to <code>null</code>, then use - * the current settings from <code>JavaCore#getOptions</code>. - * @return an instance of the built-in code formatter - * @see CodeFormatter - * @see JavaCore#getOptions() - * @since 3.0 - - - - - - - - - * Create an instance of the built-in code formatter. - * <p>The given options should at least provide the source level ({@link JavaCore#COMPILER_SOURCE}), - * the compiler compliance level ({@link JavaCore#COMPILER_COMPLIANCE}) and the target platform - * ({@link JavaCore#COMPILER_CODEGEN_TARGET_PLATFORM}). - * Without these options, it is not possible for the code formatter to know what kind of source it needs to format. - * </p> - * <p>The given mode determines what options should be enabled when formatting the code. It can have the following - * values: {@link #M_FORMAT_NEW}, {@link #M_FORMAT_EXISTING}, but other values may be added in the future. - * </p> - * - * @param options the options map to use for formatting with the default code formatter. Recognized options - * are documented on <code>JavaCore#getDefaultOptions()</code>. If set to <code>null</code>, then use - * the current settings from <code>JavaCore#getOptions</code>. - * @param mode the given mode to modify the given options. - * - * @return an instance of the built-in code formatter - * @see CodeFormatter - * @see JavaCore#getOptions() - * @since 3.3 - - - - - - - - - - * Create a classfile bytecode disassembler, able to produce a String representation of a given classfile. - * - * @return a classfile bytecode disassembler - * @see ClassFileBytesDisassembler - * @since 2.1 - - - - - - - - * Create a classfile bytecode disassembler, able to produce a String representation of a given classfile. - * - * @return a classfile bytecode disassembler - * @see org.eclipse.jdt.core.util.IClassFileDisassembler - * @deprecated Use {@link #createDefaultClassFileBytesDisassembler()} instead - - - - - - - - * Create a classfile reader onto a classfile Java element. - * Create a default classfile reader, able to expose the internal representation of a given classfile - * according to the decoding flag used to initialize the reader. - * Answer null if the file named fileName doesn't represent a valid .class file. - * - * The decoding flags are described in IClassFileReader. - * - * @param classfile the classfile element to introspect - * @param decodingFlag the flag used to decode the class file reader. - * @return a default classfile reader - * - * @see IClassFileReader - - - - - - - - - - * Create a default classfile reader, able to expose the internal representation of a given classfile - * according to the decoding flag used to initialize the reader. - * Answer null if the input stream contents cannot be retrieved - * - * The decoding flags are described in IClassFileReader. - * - * @param stream the given input stream to read - * @param decodingFlag the flag used to decode the class file reader. - * @return a default classfile reader - * - * @see IClassFileReader - * @since 3.2 - - - - - - - - - - * Create a default classfile reader, able to expose the internal representation of a given classfile - * according to the decoding flag used to initialize the reader. - * Answer null if the file named fileName doesn't represent a valid .class file. - * The fileName has to be an absolute OS path to the given .class file. - * - * The decoding flags are described in IClassFileReader. - * - * @param fileName the name of the file to be read - * @param decodingFlag the flag used to decode the class file reader. - * @return a default classfile reader - * - * @see IClassFileReader - - - - - - - - - - * Create a default classfile reader, able to expose the internal representation of a given classfile - * according to the decoding flag used to initialize the reader. - * Answer null if the file named zipFileName doesn't represent a valid zip file or if the zipEntryName - * is not a valid entry name for the specified zip file or if the bytes don't represent a valid - * .class file according to the JVM specifications. - * - * The decoding flags are described in IClassFileReader. - * - * @param zipFileName the name of the zip file - * @param zipEntryName the name of the entry in the zip file to be read - * @param decodingFlag the flag used to decode the class file reader. - * @return a default classfile reader - * @see IClassFileReader - - - - - - - - - - - * Create an instance of the default code formatter. - * - * @param options - the options map to use for formatting with the default code formatter. Recognized options - * are documented on <code>JavaCore#getDefaultOptions()</code>. If set to <code>null</code>, then use - * the current settings from <code>JavaCore#getOptions</code>. - * @return an instance of the built-in code formatter - * @see ICodeFormatter - * @see ToolFactory#createCodeFormatter() - * @see JavaCore#getOptions() - * @deprecated Use {@link #createCodeFormatter(Map)} instead but note the different options - - - - - - - - - * Create a scanner, indicating the level of detail requested for tokenizing. The scanner can then be - * used to tokenize some source in a Java aware way. - * Here is a typical scanning loop: - * - * <code> - * <pre> - * IScanner scanner = ToolFactory.createScanner(false, false, false, false); - * scanner.setSource("int i = 0;".toCharArray()); - * while (true) { - * int token = scanner.getNextToken(); - * if (token == ITerminalSymbols.TokenNameEOF) break; - * System.out.println(token + " : " + new String(scanner.getCurrentTokenSource())); - * } - * </pre> - * </code> - * - * <p>By default the compliance used to create the scanner is the workspace's compliance when running inside the IDE - * or 1.4 if running from outside of a headless eclipse. - * </p> - * - * @param tokenizeComments if set to <code>false</code>, comments will be silently consumed - * @param tokenizeWhiteSpace if set to <code>false</code>, white spaces will be silently consumed, - * @param assertMode if set to <code>false</code>, occurrences of 'assert' will be reported as identifiers - * ({@link ITerminalSymbols#TokenNameIdentifier}), whereas if set to <code>true</code>, it - * would report assert keywords ({@link ITerminalSymbols#TokenNameassert}). Java 1.4 has introduced - * a new 'assert' keyword. - * @param recordLineSeparator if set to <code>true</code>, the scanner will record positions of encountered line - * separator ends. In case of multi-character line separators, the last character position is considered. These positions - * can then be extracted using {@link IScanner#getLineEnds()}. Only non-unicode escape sequences are - * considered as valid line separators. - * @return a scanner - * @see org.eclipse.jdt.core.compiler.IScanner - * @see #createScanner(boolean, boolean, boolean, String, String) - - - - - - - - - - - - * Create a scanner, indicating the level of detail requested for tokenizing. The scanner can then be - * used to tokenize some source in a Java aware way. - * Here is a typical scanning loop: - * - * <code> - * <pre> - * IScanner scanner = ToolFactory.createScanner(false, false, false, false); - * scanner.setSource("int i = 0;".toCharArray()); - * while (true) { - * int token = scanner.getNextToken(); - * if (token == ITerminalSymbols.TokenNameEOF) break; - * System.out.println(token + " : " + new String(scanner.getCurrentTokenSource())); - * } - * </pre> - * </code> - * - * <p>By default the compliance used to create the scanner is the workspace's compliance when running inside the IDE - * or 1.4 if running from outside of a headless eclipse. - * </p> - * - * @param tokenizeComments if set to <code>false</code>, comments will be silently consumed - * @param tokenizeWhiteSpace if set to <code>false</code>, white spaces will be silently consumed, - * @param recordLineSeparator if set to <code>true</code>, the scanner will record positions of encountered line - * separator ends. In case of multi-character line separators, the last character position is considered. These positions - * can then be extracted using {@link IScanner#getLineEnds()}. Only non-unicode escape sequences are - * considered as valid line separators. - * @param sourceLevel if set to <code>&quot;1.3&quot;</code> or <code>null</code>, occurrences of 'assert' will be reported as identifiers - * ({@link ITerminalSymbols#TokenNameIdentifier}), whereas if set to <code>&quot;1.4&quot;</code>, it - * would report assert keywords ({@link ITerminalSymbols#TokenNameassert}). Java 1.4 has introduced - * a new 'assert' keyword. - * @return a scanner - * @see org.eclipse.jdt.core.compiler.IScanner - * @see #createScanner(boolean, boolean, boolean, String, String) - * @since 3.0 - - - - - - - - - - - - * Create a scanner, indicating the level of detail requested for tokenizing. The scanner can then be - * used to tokenize some source in a Java aware way. - * Here is a typical scanning loop: - * - * <code> - * <pre> - * IScanner scanner = ToolFactory.createScanner(false, false, false, false); - * scanner.setSource("int i = 0;".toCharArray()); - * while (true) { - * int token = scanner.getNextToken(); - * if (token == ITerminalSymbols.TokenNameEOF) break; - * System.out.println(token + " : " + new String(scanner.getCurrentTokenSource())); - * } - * </pre> - * </code> - * - * @param tokenizeComments if set to <code>false</code>, comments will be silently consumed - * @param tokenizeWhiteSpace if set to <code>false</code>, white spaces will be silently consumed, - * @param recordLineSeparator if set to <code>true</code>, the scanner will record positions of encountered line - * separator ends. In case of multi-character line separators, the last character position is considered. These positions - * can then be extracted using {@link IScanner#getLineEnds()}. Only non-unicode escape sequences are - * considered as valid line separators. - * @param sourceLevel if set to <code>&quot;1.3&quot;</code> or <code>null</code>, occurrences of 'assert' will be reported as identifiers - * ({@link ITerminalSymbols#TokenNameIdentifier}), whereas if set to <code>&quot;1.4&quot;</code>, it - * would report assert keywords ({@link ITerminalSymbols#TokenNameassert}). Java 1.4 has introduced - * a new 'assert' keyword. - * @param complianceLevel This is used to support the Unicode 4.0 character sets. if set to 1.5 or above, - * the Unicode 4.0 is supporte, otherwise Unicode 3.0 is supported. - * @return a scanner - * @see org.eclipse.jdt.core.compiler.IScanner - * - * @since 3.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * The owner of an {@link ICompilationUnit} handle in working copy mode. - * An owner is used to identify a working copy and to create its buffer. - * <p> - * Clients should subclass this class to instantiate a working copy owner that is specific to their need and that - * they can pass in to various APIs (e.g. {@link IType#resolveType(String, WorkingCopyOwner)}. - * Clients can also override the default implementation of {@link #createBuffer(ICompilationUnit)}. - * </p><p> - * Note: even though this class has no abstract method, which means that it provides functional default behavior, - * it is still an abstract class, as clients are intended to own their owner implementation. - * </p> - * @see ICompilationUnit#becomeWorkingCopy(org.eclipse.core.runtime.IProgressMonitor) - * @see ICompilationUnit#discardWorkingCopy() - * @see ICompilationUnit#getWorkingCopy(org.eclipse.core.runtime.IProgressMonitor) - * @since 3.0 - - - - - - * Sets the buffer provider of the primary working copy owner. Note that even if the - * buffer provider is a working copy owner, only its <code>createBuffer(ICompilationUnit)</code> - * method is used by the primary working copy owner. It doesn't replace the internal primary - * working owner. - * <p> - * This method is for internal use by the jdt-related plug-ins. - * Clients outside of the jdt should not reference this method. - * </p> - * - * @param primaryBufferProvider the primary buffer provider - - - - - - - - * Creates a buffer for the given working copy. - * The new buffer will be initialized with the contents of the underlying file - * if and only if it was not already initialized by the compilation owner (a buffer is - * uninitialized if its content is <code>null</code>). - * <p> - * Note: This buffer will be associated to the working copy for its entire life-cycle. Another - * working copy on same unit but owned by a different owner would not share the same buffer - * unless its owner decided to implement such a sharing behaviour. - * </p> - * - * @param workingCopy the working copy of the buffer - * @return IBuffer the created buffer for the given working copy - * @see IBuffer - - - - - - - - - * Returns the problem requestor used by a working copy of this working copy owner. - * <p> - * By default, no problem requestor is configured. Clients can override this - * method to provide a requestor. - * </p> - * - * @param workingCopy The problem requestor used for the given working copy. - * @return the problem requestor to be used by working copies of this working - * copy owner or <code>null</code> if no problem requestor is configured. - * - * @since 3.3 - - - - - - - - - * Returns the source of the compilation unit that defines the given type in - * the given package, or <code>null</code> if the type is unknown to this - * owner. - * <p>This method is called before the normal lookup (i.e. before looking - * at the project's classpath and before looking at the working copies of this - * owner.)</p> - * <p>This allows to provide types that are not normally available, or to hide - * types that would normally be available by returning an empty source for - * the given type and package.</p> - * <p>Example of use: - * <pre> - * WorkingCopyOwner owner = new WorkingCopyOwner() { - * public String findSource(String typeName, String packageName) { - * if ("to.be".equals(packageName) && "Generated".equals(typeName)) { - * return - * "package to.be;\n" + - * "public class Generated {\n" + - * "}"; - * } - * return super.findSource(typeName, packageName); - * } - * public boolean isPackage(String[] pkg) { - * switch (pkg.length) { - * case 1: - * return "to".equals(pkg[0]); - * case 2: - * return "to".equals(pkg[0]) && "be".equals(pkg[1]); - * } - * return false; - * } - * }; - * // Working copy on X.java with the following contents: - * // public class X extends to.be.Generated { - * // } - * ICompilationUnit workingCopy = ... - * ASTParser parser = ASTParser.newParser(AST.JLS3); - * parser.setSource(workingCopy); - * parser.setResolveBindings(true); - * parser.setWorkingCopyOwner(owner); - * CompilationUnit cu = (CompilationUnit) parser.createAST(null); - * assert cu.getProblems().length == 0; - * </pre> - * </p> - * - * @param typeName the simple name of the type to lookup - * @param packageName the dot-separated name of the package of type - * @return the source of the compilation unit that defines the given type in - * the given package, or <code>null</code> if the type is unknown - * @see #isPackage(String[]) - * @since 3.5 - - - - - - - - - - * Returns whether the given package segments represent a package. - * <p>This method is called before the normal lookup (i.e. before looking - * at the project's classpath and before looking at the working copies of this - * owner.)</p> - * <p>This allows to provide packages that are not normally available.</p> - * <p>If <code>false</code> is returned, then normal lookup is used on - * this package.</p> - * - * @param pkg the segments of a package to lookup - * @return whether the given package segments represent a package. - * @see #findSource(String, String) - * @since 3.5 - - - - - - - - - - - - * Returns a new working copy with the given name using this working copy owner to - * create its buffer. - * <p> - * This working copy always belongs to the default package in a package - * fragment root that corresponds to its Java project, and this Java project never exists. - * However this Java project has the given classpath that is used when resolving names - * in this working copy. - * </p><p> - * A DOM AST created using this working copy will have bindings resolved using the given - * classpath, and problem are reported to the given problem requestor. - * <p></p> - * <code>JavaCore#getOptions()</code> is used to create the DOM AST as it is not - * possible to set the options on the non-existing Java project. - * </p><p> - * When the working copy instance is created, an {@link IJavaElementDelta#ADDED added delta} is - * reported on this working copy. - * </p><p> - * Once done with the working copy, users of this method must discard it using - * {@link ICompilationUnit#discardWorkingCopy()}. - * </p><p> - * Note that when such working copy is committed, only its buffer is saved (see - * {@link IBuffer#save(IProgressMonitor, boolean)}) but no resource is created. - * </p><p> - * This method is not intended to be overriden by clients. - * </p> - * - * @param name the name of the working copy (e.g. "X.java") - * @param classpath the classpath used to resolve names in this working copy - * @param problemRequestor a requestor which will get notified of problems detected during - * reconciling as they are discovered. The requestor can be set to <code>null</code> indicating - * that the client is not interested in problems. - * @param monitor a progress monitor used to report progress while opening the working copy - * or <code>null</code> if no progress should be reported - * @throws JavaModelException if the contents of this working copy can - * not be determined. - * @return a new working copy - * @see ICompilationUnit#becomeWorkingCopy(IProblemRequestor, IProgressMonitor) - * @since 3.2 - * - * @deprecated Use {@link #newWorkingCopy(String, IClasspathEntry[], IProgressMonitor)} instead. - * Note that if this deprecated method is used, problems may be reported twice - * if the given requestor is not the same as the current working copy owner one. - - - - - - - - - - - - - - - * Returns a new working copy with the given name using this working copy owner to - * create its buffer. - * <p> - * This working copy always belongs to the default package in a package - * fragment root that corresponds to its Java project, and this Java project never exists. - * However this Java project has the given classpath that is used when resolving names - * in this working copy. - * </p><p> - * If a DOM AST is created using this working copy, then given classpath will be used - * if bindings need to be resolved. Problems will be reported to the problem requestor - * of the current working copy owner problem if it is not <code>null</code>. - * <p></p> - * Options used to create the DOM AST are got from {@link JavaCore#getOptions()} - * as it is not possible to set the options on a non-existing Java project. - * </p><p> - * When the working copy instance is created, an {@link IJavaElementDelta#ADDED added delta} is - * reported on this working copy. - * </p><p> - * Once done with the working copy, users of this method must discard it using - * {@link ICompilationUnit#discardWorkingCopy()}. - * </p><p> - * Note that when such working copy is committed, only its buffer is saved (see - * {@link IBuffer#save(IProgressMonitor, boolean)}) but no resource is created. - * </p><p> - * This method is not intended to be overriden by clients. - * </p> - * - * @param name the name of the working copy (e.g. "X.java") - * @param classpath the classpath used to resolve names in this working copy - * @param monitor a progress monitor used to report progress while opening the working copy - * or <code>null</code> if no progress should be reported - * @throws JavaModelException if the contents of this working copy can - * not be determined. - * @return a new working copy - * @see ICompilationUnit#becomeWorkingCopy(IProgressMonitor) - * - * @since 3.3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.properties b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.properties deleted file mode 100644 index 0a19e739f6a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.properties +++ /dev/null @@ -1,19 +0,0 @@ -################################################################################# -# Copyright (c) 2011 Nicolas Deblock & Manuel Giles. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation -# Manuel Giles giles.manu@live.fr - Initial API and implementation -# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception -# -################################################################################# - - -pluginName = Jdt metamodel (Incubation) -providerName = Eclipse Modeling Project - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.xml b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.xml deleted file mode 100644 index 1d95f211dfb..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/pom.xml b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/pom.xml deleted file mode 100644 index dad8ca33821..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.java.generator.metamodel.jdt - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmFactory.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmFactory.java deleted file mode 100644 index 574aafc167a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmFactory.java +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Jonathan Geoffroy - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception - * - *****************************************************************************/ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm; - -import org.eclipse.emf.ecore.EFactory; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage - * @generated - */ -public interface GeneratoroptionsmmFactory extends EFactory { - /** - * The singleton instance of the factory. - * - * - * - * @generated - */ - GeneratoroptionsmmFactory eINSTANCE = org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.GeneratoroptionsmmFactoryImpl.init(); - - /** - * Returns a new object of class 'Options'. - * - * - * - * @return a new object of class 'Options'. - * @generated - */ - Options createOptions(); - - /** - * Returns the package supported by this factory. - * - * - * - * @return the package supported by this factory. - * @generated - */ - GeneratoroptionsmmPackage getGeneratoroptionsmmPackage(); - -} // GeneratoroptionsmmFactory diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmPackage.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmPackage.java deleted file mode 100644 index d67b1c8d5b3..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmPackage.java +++ /dev/null @@ -1,187 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Jonathan Geoffroy - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception - * - *****************************************************************************/ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each operation of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmFactory - * @model kind="package" - * annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='GeneratorOptionsMM'" - * @generated - */ -public interface GeneratoroptionsmmPackage extends EPackage { - /** - * The package name. - * - * - * - * @generated - */ - String eNAME = "generatoroptionsmm"; - - /** - * The package namespace URI. - * - * - * - * @generated - */ - String eNS_URI = "http:///GeneratorOptionsMM.ecore"; - - /** - * The package namespace name. - * - * - * - * @generated - */ - String eNS_PREFIX = "GeneratorOptionsMM"; - - /** - * The singleton instance of the package. - * - * - * - * @generated - */ - GeneratoroptionsmmPackage eINSTANCE = org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.GeneratoroptionsmmPackageImpl.init(); - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.OptionsImpl Options}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.OptionsImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.GeneratoroptionsmmPackageImpl#getOptions() - * @generated - */ - int OPTIONS = 0; - - /** - * The feature id for the 'Default Source Folder' attribute. - * - * - * - * @generated - * @ordered - */ - int OPTIONS__DEFAULT_SOURCE_FOLDER = 0; - - /** - * The number of structural features of the 'Options' class. - * - * - * - * @generated - * @ordered - */ - int OPTIONS_FEATURE_COUNT = 1; - - /** - * The number of operations of the 'Options' class. - * - * - * - * @generated - * @ordered - */ - int OPTIONS_OPERATION_COUNT = 0; - - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options Options}'. - * - * - * - * @return the meta object for class 'Options'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options - * @generated - */ - EClass getOptions(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options#getDefaultSourceFolder Default Source Folder}'. - * - * - * - * @return the meta object for the attribute 'Default Source Folder'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options#getDefaultSourceFolder() - * @see #getOptions() - * @generated - */ - EAttribute getOptions_DefaultSourceFolder(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - GeneratoroptionsmmFactory getGeneratoroptionsmmFactory(); - - /** - * - * Defines literals for the meta objects that represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each operation of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * - * @generated - */ - interface Literals { - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.OptionsImpl Options}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.OptionsImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.GeneratoroptionsmmPackageImpl#getOptions() - * @generated - */ - EClass OPTIONS = eINSTANCE.getOptions(); - - /** - * The meta object literal for the 'Default Source Folder' attribute feature. - * - * - * - * @generated - */ - EAttribute OPTIONS__DEFAULT_SOURCE_FOLDER = eINSTANCE.getOptions_DefaultSourceFolder(); - - } - -} // GeneratoroptionsmmPackage diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/Options.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/Options.java deleted file mode 100644 index d2940a2afc6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/Options.java +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Jonathan Geoffroy - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception - * - *****************************************************************************/ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Options'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options#getDefaultSourceFolder Default Source Folder}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage#getOptions() - * @model - * @generated - */ -public interface Options extends EObject { - /** - * Returns the value of the 'Default Source Folder' attribute. - * - *

- * If the meaning of the 'Default Source Folder' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Default Source Folder' attribute. - * @see #setDefaultSourceFolder(String) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage#getOptions_DefaultSourceFolder() - * @model dataType="org.eclipse.uml2.types.String" required="true" ordered="false" - * @generated - */ - String getDefaultSourceFolder(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options#getDefaultSourceFolder Default Source Folder}' attribute. - * - * - * - * @param value - * the new value of the 'Default Source Folder' attribute. - * @see #getDefaultSourceFolder() - * @generated - */ - void setDefaultSourceFolder(String value); - -} // Options diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmFactoryImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmFactoryImpl.java deleted file mode 100644 index 04e8b13c3c9..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmFactoryImpl.java +++ /dev/null @@ -1,114 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Jonathan Geoffroy - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception - * - *****************************************************************************/ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.impl.EFactoryImpl; -import org.eclipse.emf.ecore.plugin.EcorePlugin; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; - -/** - * - * An implementation of the model Factory. - * - * - * @generated - */ -public class GeneratoroptionsmmFactoryImpl extends EFactoryImpl implements GeneratoroptionsmmFactory { - /** - * Creates the default factory implementation. - * - * - * - * @generated - */ - public static GeneratoroptionsmmFactory init() { - try { - GeneratoroptionsmmFactory theGeneratoroptionsmmFactory = (GeneratoroptionsmmFactory) EPackage.Registry.INSTANCE.getEFactory(GeneratoroptionsmmPackage.eNS_URI); - if (theGeneratoroptionsmmFactory != null) { - return theGeneratoroptionsmmFactory; - } - } catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new GeneratoroptionsmmFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * - * @generated - */ - public GeneratoroptionsmmFactoryImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case GeneratoroptionsmmPackage.OPTIONS: - return createOptions(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Options createOptions() { - OptionsImpl options = new OptionsImpl(); - return options; - } - - /** - * - * - * - * @generated - */ - @Override - public GeneratoroptionsmmPackage getGeneratoroptionsmmPackage() { - return (GeneratoroptionsmmPackage) getEPackage(); - } - - /** - * - * - * - * @deprecated - * @generated - */ - @Deprecated - public static GeneratoroptionsmmPackage getPackage() { - return GeneratoroptionsmmPackage.eINSTANCE; - } - -} // GeneratoroptionsmmFactoryImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmPackageImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmPackageImpl.java deleted file mode 100644 index 1ff4792db08..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmPackageImpl.java +++ /dev/null @@ -1,229 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Jonathan Geoffroy - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception - * - *****************************************************************************/ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; -import org.eclipse.uml2.types.TypesPackage; - -/** - * - * An implementation of the model Package. - * - * - * @generated - */ -public class GeneratoroptionsmmPackageImpl extends EPackageImpl implements GeneratoroptionsmmPackage { - /** - * - * - * - * @generated - */ - private EClass optionsEClass = null; - - /** - * Creates an instance of the model Package, registered with {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

- * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also performs initialization of the package, or returns the registered package, if one already exists. - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage#eNS_URI - * @see #init() - * @generated - */ - private GeneratoroptionsmmPackageImpl() { - super(eNS_URI, GeneratoroptionsmmFactory.eINSTANCE); - } - - /** - * - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * - *

- * This method is used to initialize {@link GeneratoroptionsmmPackage#eINSTANCE} when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static GeneratoroptionsmmPackage init() { - if (isInited) { - return (GeneratoroptionsmmPackage) EPackage.Registry.INSTANCE.getEPackage(GeneratoroptionsmmPackage.eNS_URI); - } - - // Obtain or create and register package - GeneratoroptionsmmPackageImpl theGeneratoroptionsmmPackage = (GeneratoroptionsmmPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof GeneratoroptionsmmPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) - : new GeneratoroptionsmmPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - TypesPackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theGeneratoroptionsmmPackage.createPackageContents(); - - // Initialize created meta-data - theGeneratoroptionsmmPackage.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theGeneratoroptionsmmPackage.freeze(); - - - // Update the registry and return the package - EPackage.Registry.INSTANCE.put(GeneratoroptionsmmPackage.eNS_URI, theGeneratoroptionsmmPackage); - return theGeneratoroptionsmmPackage; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getOptions() { - return optionsEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getOptions_DefaultSourceFolder() { - return (EAttribute) optionsEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public GeneratoroptionsmmFactory getGeneratoroptionsmmFactory() { - return (GeneratoroptionsmmFactory) getEFactoryInstance(); - } - - /** - * - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * - * @generated - */ - public void createPackageContents() { - if (isCreated) { - return; - } - isCreated = true; - - // Create classes and their features - optionsEClass = createEClass(OPTIONS); - createEAttribute(optionsEClass, OPTIONS__DEFAULT_SOURCE_FOLDER); - } - - /** - * - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) { - return; - } - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - TypesPackage theTypesPackage = (TypesPackage) EPackage.Registry.INSTANCE.getEPackage(TypesPackage.eNS_URI); - - // Create type parameters - - // Set bounds for type parameters - - // Add supertypes to classes - - // Initialize classes, features, and operations; add parameters - initEClass(optionsEClass, Options.class, "Options", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getOptions_DefaultSourceFolder(), theTypesPackage.getString(), "defaultSourceFolder", null, 1, 1, Options.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - // Create resource - createResource(eNS_URI); - - // Create annotations - // http://www.eclipse.org/uml2/2.0.0/UML - createUMLAnnotations(); - } - - /** - * Initializes the annotations for http://www.eclipse.org/uml2/2.0.0/UML. - * - * - * - * @generated - */ - protected void createUMLAnnotations() { - String source = "http://www.eclipse.org/uml2/2.0.0/UML"; - addAnnotation(this, - source, - new String[] { - "originalName", "GeneratorOptionsMM" - }); - } - -} // GeneratoroptionsmmPackageImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/OptionsImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/OptionsImpl.java deleted file mode 100644 index da0c05436b7..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/OptionsImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Jonathan Geoffroy - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception - * - *****************************************************************************/ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; - -/** - * - * An implementation of the model object 'Options'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.OptionsImpl#getDefaultSourceFolder Default Source Folder}
  • - *
- *

- * - * @generated - */ -public class OptionsImpl extends MinimalEObjectImpl.Container implements Options { - /** - * The default value of the '{@link #getDefaultSourceFolder() Default Source Folder}' attribute. - * - * - * - * @see #getDefaultSourceFolder() - * @generated - * @ordered - */ - protected static final String DEFAULT_SOURCE_FOLDER_EDEFAULT = null; - - /** - * The cached value of the '{@link #getDefaultSourceFolder() Default Source Folder}' attribute. - * - * - * - * @see #getDefaultSourceFolder() - * @generated - * @ordered - */ - protected String defaultSourceFolder = DEFAULT_SOURCE_FOLDER_EDEFAULT; - - /** - * - * - * - * @generated - */ - protected OptionsImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return GeneratoroptionsmmPackage.Literals.OPTIONS; - } - - /** - * - * - * - * @generated - */ - @Override - public String getDefaultSourceFolder() { - return defaultSourceFolder; - } - - /** - * - * - * - * @generated - */ - @Override - public void setDefaultSourceFolder(String newDefaultSourceFolder) { - String oldDefaultSourceFolder = defaultSourceFolder; - defaultSourceFolder = newDefaultSourceFolder; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, GeneratoroptionsmmPackage.OPTIONS__DEFAULT_SOURCE_FOLDER, oldDefaultSourceFolder, defaultSourceFolder)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case GeneratoroptionsmmPackage.OPTIONS__DEFAULT_SOURCE_FOLDER: - return getDefaultSourceFolder(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case GeneratoroptionsmmPackage.OPTIONS__DEFAULT_SOURCE_FOLDER: - setDefaultSourceFolder((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case GeneratoroptionsmmPackage.OPTIONS__DEFAULT_SOURCE_FOLDER: - setDefaultSourceFolder(DEFAULT_SOURCE_FOLDER_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case GeneratoroptionsmmPackage.OPTIONS__DEFAULT_SOURCE_FOLDER: - return DEFAULT_SOURCE_FOLDER_EDEFAULT == null ? defaultSourceFolder != null : !DEFAULT_SOURCE_FOLDER_EDEFAULT.equals(defaultSourceFolder); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (defaultSourceFolder: "); - result.append(defaultSourceFolder); - result.append(')'); - return result.toString(); - } - -} // OptionsImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmAdapterFactory.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmAdapterFactory.java deleted file mode 100644 index b3559f01418..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmAdapterFactory.java +++ /dev/null @@ -1,139 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Jonathan Geoffroy - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception - * - *****************************************************************************/ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage - * @generated - */ -public class GeneratoroptionsmmAdapterFactory extends AdapterFactoryImpl { - /** - * The cached model package. - * - * - * - * @generated - */ - protected static GeneratoroptionsmmPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * - * @generated - */ - public GeneratoroptionsmmAdapterFactory() { - if (modelPackage == null) { - modelPackage = GeneratoroptionsmmPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject) object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch that delegates to the createXXX methods. - * - * - * - * @generated - */ - protected GeneratoroptionsmmSwitch modelSwitch = - new GeneratoroptionsmmSwitch() { - @Override - public Adapter caseOptions(Options object) { - return createOptionsAdapter(); - } - - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * - * @param target - * the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject) target); - } - - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options Options}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options - * @generated - */ - public Adapter createOptionsAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } - -} // GeneratoroptionsmmAdapterFactory diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmSwitch.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmSwitch.java deleted file mode 100644 index e4b8935cc3a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmSwitch.java +++ /dev/null @@ -1,131 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Jonathan Geoffroy - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception - * - *****************************************************************************/ -package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.util; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.util.Switch; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage - * @generated - */ -public class GeneratoroptionsmmSwitch extends Switch { - /** - * The cached model package - * - * - * - * @generated - */ - protected static GeneratoroptionsmmPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * - * @generated - */ - public GeneratoroptionsmmSwitch() { - if (modelPackage == null) { - modelPackage = GeneratoroptionsmmPackage.eINSTANCE; - } - } - - /** - * Checks whether this is a switch for the given package. - * - * - * - * @parameter ePackage the package in question. - * @return whether this is a switch for the given package. - * @generated - */ - @Override - protected boolean isSwitchFor(EPackage ePackage) { - return ePackage == modelPackage; - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - @Override - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case GeneratoroptionsmmPackage.OPTIONS: { - Options options = (Options) theEObject; - T result = caseOptions(options); - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - default: - return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'Options'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Options'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseOptions(Options object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - @Override - public T defaultCase(EObject object) { - return null; - } - -} // GeneratoroptionsmmSwitch diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTClass.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTClass.java deleted file mode 100644 index 2479b25ad4e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTClass.java +++ /dev/null @@ -1,37 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - - -/** - * - * A representation of the model object 'JDT Class'. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTClass() - * @model - * @generated - */ -public interface JDTClass extends JDTType { -} // JDTClass diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTCompilationUnit.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTCompilationUnit.java deleted file mode 100644 index c9cace0f946..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTCompilationUnit.java +++ /dev/null @@ -1,106 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.common.util.EList; - - -/** - * - * A representation of the model object 'JDT Compilation Unit'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getPackageFragment Package Fragment}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getTypes Types}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTCompilationUnit() - * @model - * @generated - */ -public interface JDTCompilationUnit extends JDTTypeRoot { - - /** - * Returns the value of the 'Package Fragment' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getCompilationUnits Compilation Units}'. - *

- * This feature redefines the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
  • - *
- *

- * - *

- * If the meaning of the 'Package Fragment' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Package Fragment' container reference. - * @see #setPackageFragment(JDTPackageFragment) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTCompilationUnit_PackageFragment() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getCompilationUnits - * @model opposite="compilationUnits" transient="false" ordered="false" - * @generated - */ - JDTPackageFragment getPackageFragment(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getPackageFragment Package Fragment}' container reference. - * - * - * - * @param value - * the new value of the 'Package Fragment' container reference. - * @see #getPackageFragment() - * @generated - */ - void setPackageFragment(JDTPackageFragment value); - - /** - * Returns the value of the 'Types' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getCompilationUnit Compilation Unit}'. - *

- * This feature subsets the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
  • - *
- *

- * - *

- * If the meaning of the 'Types' reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Types' containment reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTCompilationUnit_Types() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getCompilationUnit - * @model opposite="compilationUnit" containment="true" ordered="false" - * @generated - */ - EList getTypes(); -} // JDTCompilationUnit diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTEnum.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTEnum.java deleted file mode 100644 index 2a762c988be..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTEnum.java +++ /dev/null @@ -1,37 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - - -/** - * - * A representation of the model object 'JDT Enum'. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTEnum() - * @model - * @generated - */ -public interface JDTEnum extends JDTType { -} // JDTEnum diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTException.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTException.java deleted file mode 100644 index bb72424f0f7..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTException.java +++ /dev/null @@ -1,38 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'JDT Exception'. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTException() - * @model - * @generated - */ -public interface JDTException extends EObject { -} // JDTException diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTField.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTField.java deleted file mode 100644 index 39c29010ee8..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTField.java +++ /dev/null @@ -1,322 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - - -/** - * - * A representation of the model object 'JDT Field'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isAbstract Abstract}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isFinal Final}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isStatic Static}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isMultiValued Is Multi Valued}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getType Type}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getValue Value}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateGetter Generate Getter}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateSetter Generate Setter}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getOwner Owner}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField() - * @model - * @generated - */ -public interface JDTField extends JDTMember { - - /** - * Returns the value of the 'Owner' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getFields Fields}'. - *

- * This feature redefines the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
  • - *
- *

- * - *

- * If the meaning of the 'Owner' container reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Owner' container reference. - * @see #setOwner(JDTType) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_Owner() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getFields - * @model opposite="fields" required="true" transient="false" ordered="false" - * @generated - */ - JDTType getOwner(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getOwner Owner}' container reference. - * - * - * - * @param value - * the new value of the 'Owner' container reference. - * @see #getOwner() - * @generated - */ - void setOwner(JDTType value); - - /** - * Returns the value of the 'Abstract' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Abstract' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Abstract' attribute. - * @see #setAbstract(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_Abstract() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" - * @generated - */ - boolean isAbstract(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isAbstract Abstract}' attribute. - * - * - * - * @param value - * the new value of the 'Abstract' attribute. - * @see #isAbstract() - * @generated - */ - void setAbstract(boolean value); - - /** - * Returns the value of the 'Final' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Final' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Final' attribute. - * @see #setFinal(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_Final() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" - * @generated - */ - boolean isFinal(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isFinal Final}' attribute. - * - * - * - * @param value - * the new value of the 'Final' attribute. - * @see #isFinal() - * @generated - */ - void setFinal(boolean value); - - /** - * Returns the value of the 'Static' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Static' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Static' attribute. - * @see #setStatic(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_Static() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" - * @generated - */ - boolean isStatic(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isStatic Static}' attribute. - * - * - * - * @param value - * the new value of the 'Static' attribute. - * @see #isStatic() - * @generated - */ - void setStatic(boolean value); - - /** - * Returns the value of the 'Is Multi Valued' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Is Multi Valued' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Multi Valued' attribute. - * @see #setIsMultiValued(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_IsMultiValued() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" - * @generated - */ - boolean isMultiValued(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isMultiValued Is Multi Valued}' attribute. - * - * - * - * @param value - * the new value of the 'Is Multi Valued' attribute. - * @see #isMultiValued() - * @generated - */ - void setIsMultiValued(boolean value); - - /** - * Returns the value of the 'Type' reference. - * - *

- * If the meaning of the 'Type' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Type' reference. - * @see #setType(JDTType) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_Type() - * @model ordered="false" - * @generated - */ - JDTType getType(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getType Type}' reference. - * - * - * - * @param value - * the new value of the 'Type' reference. - * @see #getType() - * @generated - */ - void setType(JDTType value); - - /** - * Returns the value of the 'Value' attribute. - * - *

- * If the meaning of the 'Value' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Value' attribute. - * @see #setValue(String) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_Value() - * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" - * @generated - */ - String getValue(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getValue Value}' attribute. - * - * - * - * @param value - * the new value of the 'Value' attribute. - * @see #getValue() - * @generated - */ - void setValue(String value); - - /** - * Returns the value of the 'Generate Getter' attribute. - * The literals are from the enumeration {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault}. - * - *

- * If the meaning of the 'Generate Getter' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Generate Getter' attribute. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault - * @see #setGenerateGetter(TrueFalseDefault) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_GenerateGetter() - * @model required="true" ordered="false" - * @generated - */ - TrueFalseDefault getGenerateGetter(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateGetter Generate Getter}' attribute. - * - * - * - * @param value - * the new value of the 'Generate Getter' attribute. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault - * @see #getGenerateGetter() - * @generated - */ - void setGenerateGetter(TrueFalseDefault value); - - /** - * Returns the value of the 'Generate Setter' attribute. - * The literals are from the enumeration {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault}. - * - *

- * If the meaning of the 'Generate Setter' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Generate Setter' attribute. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault - * @see #setGenerateSetter(TrueFalseDefault) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_GenerateSetter() - * @model required="true" ordered="false" - * @generated - */ - TrueFalseDefault getGenerateSetter(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateSetter Generate Setter}' attribute. - * - * - * - * @param value - * the new value of the 'Generate Setter' attribute. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault - * @see #getGenerateSetter() - * @generated - */ - void setGenerateSetter(TrueFalseDefault value); - -} // JDTField diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportContainer.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportContainer.java deleted file mode 100644 index 44e4feeb27b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportContainer.java +++ /dev/null @@ -1,37 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - - -/** - * - * A representation of the model object 'JDT Import Container'. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTImportContainer() - * @model - * @generated - */ -public interface JDTImportContainer extends JDTParentJavaElement { -} // JDTImportContainer diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportDeclaration.java deleted file mode 100644 index 31f45b7481a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportDeclaration.java +++ /dev/null @@ -1,37 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - - -/** - * - * A representation of the model object 'JDT Import Declaration'. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTImportDeclaration() - * @model - * @generated - */ -public interface JDTImportDeclaration extends JDTJavaElement { -} // JDTImportDeclaration diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTInterface.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTInterface.java deleted file mode 100644 index 140bba30001..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTInterface.java +++ /dev/null @@ -1,37 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - - -/** - * - * A representation of the model object 'JDT Interface'. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTInterface() - * @model - * @generated - */ -public interface JDTInterface extends JDTType { -} // JDTInterface diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaElement.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaElement.java deleted file mode 100644 index d928b385700..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaElement.java +++ /dev/null @@ -1,207 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; - -/** - * - * A representation of the model object 'JDT Java Element'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementName Element Name}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementType Element Type}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getComment Comment}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#isGenerated Generated}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent Parent}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaElement() - * @model abstract="true" - * @generated - */ -public interface JDTJavaElement extends EObject { - - /** - * Returns the value of the 'Parent' reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren Children}'. - * - *

- * If the meaning of the 'Parent' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Parent' reference. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaElement_Parent() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren - * @model opposite="children" transient="true" changeable="false" ordered="false" - * @generated - */ - JDTParent getParent(); - - /** - * Returns the value of the 'Element Name' attribute. - * - *

- * If the meaning of the 'Element Name' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Element Name' attribute. - * @see #setElementName(String) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaElement_ElementName() - * @model unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" - * @generated - */ - String getElementName(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementName Element Name}' attribute. - * - * - * - * @param value - * the new value of the 'Element Name' attribute. - * @see #getElementName() - * @generated - */ - void setElementName(String value); - - /** - * Returns the value of the 'Element Type' attribute. - * - *

- * If the meaning of the 'Element Type' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Element Type' attribute. - * @see #setElementType(int) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaElement_ElementType() - * @model unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.int" required="true" ordered="false" - * @generated - */ - int getElementType(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementType Element Type}' attribute. - * - * - * - * @param value - * the new value of the 'Element Type' attribute. - * @see #getElementType() - * @generated - */ - void setElementType(int value); - - /** - * Returns the value of the 'Comment' attribute. - * - *

- * If the meaning of the 'Comment' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Comment' attribute. - * @see #setComment(String) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaElement_Comment() - * @model unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" - * @generated - */ - String getComment(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getComment Comment}' attribute. - * - * - * - * @param value - * the new value of the 'Comment' attribute. - * @see #getComment() - * @generated - */ - void setComment(String value); - - /** - * Returns the value of the 'Generated' attribute. - * - *

- * If the meaning of the 'Generated' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Generated' attribute. - * @see #setGenerated(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaElement_Generated() - * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" - * @generated - */ - boolean isGenerated(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#isGenerated Generated}' attribute. - * - * - * - * @param value - * the new value of the 'Generated' attribute. - * @see #isGenerated() - * @generated - */ - void setGenerated(boolean value); - - /** - * - * - * - * @model kind="operation" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" - * @generated - */ - String getQualifiedName(); - - /** - * - * - * - * @model exceptions="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTVisitorException" visitorDataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.Visitor" visitorRequired="true" visitorOrdered="false" - * @generated - */ - void accept(JDTVisitor visitor) throws JDTVisitorException; - - /** - * - * - * - * @model kind="operation" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" - * @generated - */ - String getJDTSignature(); - -} // JDTJavaElement diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaModel.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaModel.java deleted file mode 100644 index 825af4b4dd9..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaModel.java +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.common.util.EList; - - -/** - * - * A representation of the model object 'JDT Java Model'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel#getJavaProject Java Project}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaModel() - * @model - * @generated - */ -public interface JDTJavaModel extends JDTParentJavaElement { - - /** - * Returns the value of the 'Java Project' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getJavaModel Java Model}'. - * - *

- * If the meaning of the 'Java Project' containment reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Java Project' containment reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaModel_JavaProject() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getJavaModel - * @model opposite="javaModel" containment="true" ordered="false" - * @generated - */ - EList getJavaProject(); -} // JDTJavaModel diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaProject.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaProject.java deleted file mode 100644 index 02d6e63656a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaProject.java +++ /dev/null @@ -1,100 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'JDT Java Project'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getJavaModel Java Model}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getPackageFragmentRoots Package Fragment Roots}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaProject() - * @model - * @generated - */ -public interface JDTJavaProject extends JDTParentJavaElement { - - /** - * Returns the value of the 'Java Model' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel#getJavaProject Java Project}'. - * - *

- * If the meaning of the 'Java Model' container reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Java Model' container reference. - * @see #setJavaModel(JDTJavaModel) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaProject_JavaModel() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel#getJavaProject - * @model opposite="javaProject" transient="false" ordered="false" - * @generated - */ - JDTJavaModel getJavaModel(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getJavaModel Java Model}' container reference. - * - * - * - * @param value - * the new value of the 'Java Model' container reference. - * @see #getJavaModel() - * @generated - */ - void setJavaModel(JDTJavaModel value); - - /** - * Returns the value of the 'Package Fragment Roots' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getJavaProject Java Project}'. - *

- * This feature subsets the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
  • - *
- *

- * - *

- * If the meaning of the 'Package Fragment Roots' containment reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Package Fragment Roots' containment reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaProject_PackageFragmentRoots() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getJavaProject - * @model opposite="javaProject" containment="true" ordered="false" - * @generated - */ - EList getPackageFragmentRoots(); - -} // JDTJavaProject diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMember.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMember.java deleted file mode 100644 index eacd3ae38fd..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMember.java +++ /dev/null @@ -1,130 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.common.util.EList; - - -/** - * - * A representation of the model object 'JDT Member'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getTypeParameters Type Parameters}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getVisibility Visibility}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getExplicitRequiredImports Explicit Required Imports}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMember() - * @model abstract="true" - * @generated - */ -public interface JDTMember extends JDTParentJavaElement { - - /** - * Returns the value of the 'Type Parameters' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter#getDeclaringMember Declaring Member}'. - * - *

- * If the meaning of the 'Type Parameters' containment reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Type Parameters' containment reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMember_TypeParameters() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter#getDeclaringMember - * @model opposite="declaringMember" containment="true" ordered="false" - * @generated - */ - EList getTypeParameters(); - - /** - * Returns the value of the 'Visibility' attribute. - * The default value is "public". - * The literals are from the enumeration {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind}. - * - *

- * If the meaning of the 'Visibility' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Visibility' attribute. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind - * @see #setVisibility(VisibilityKind) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMember_Visibility() - * @model default="public" unique="false" required="true" transient="true" volatile="true" derived="true" ordered="false" - * @generated - */ - VisibilityKind getVisibility(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getVisibility Visibility}' attribute. - * - * - * - * @param value - * the new value of the 'Visibility' attribute. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind - * @see #getVisibility() - * @generated - */ - void setVisibility(VisibilityKind value); - - /** - * Returns the value of the 'Explicit Required Imports' reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType}. - * - *

- * If the meaning of the 'Explicit Required Imports' reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Explicit Required Imports' reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMember_ExplicitRequiredImports() - * @model ordered="false" - * @generated - */ - EList getExplicitRequiredImports(); - - /** - * Returns the value of the 'Explicit Plain Text Required Imports' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'Explicit Plain Text Required Imports' attribute list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Explicit Plain Text Required Imports' attribute list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMember_ExplicitPlainTextRequiredImports() - * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" ordered="false" - * @generated - */ - EList getExplicitPlainTextRequiredImports(); -} // JDTMember diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethod.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethod.java deleted file mode 100644 index 3b9910e6807..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethod.java +++ /dev/null @@ -1,316 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.common.util.EList; - - -/** - * - * A representation of the model object 'JDT Method'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getOwner Owner}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getReturnType Return Type}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getParameters Parameters}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isAbstract Abstract}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isFinal Final}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isStatic Static}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getExceptions Exceptions}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isSynchronized Synchronized}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isConstructor Constructor}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getBodies Bodies}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod() - * @model - * @generated - */ -public interface JDTMethod extends JDTMember { - - /** - * Returns the value of the 'Return Type' containment reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getReturnOwner Return Owner}'. - * - *

- * If the meaning of the 'Return Type' containment reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Return Type' containment reference. - * @see #setReturnType(JDTParameter) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_ReturnType() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getReturnOwner - * @model opposite="returnOwner" containment="true" ordered="false" - * @generated - */ - JDTParameter getReturnType(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getReturnType Return Type}' containment reference. - * - * - * - * @param value - * the new value of the 'Return Type' containment reference. - * @see #getReturnType() - * @generated - */ - void setReturnType(JDTParameter value); - - /** - * Returns the value of the 'Parameters' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getParameterOwner Parameter Owner}'. - * - *

- * If the meaning of the 'Parameters' containment reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Parameters' containment reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Parameters() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getParameterOwner - * @model opposite="parameterOwner" containment="true" ordered="false" - * @generated - */ - EList getParameters(); - - /** - * Returns the value of the 'Exceptions' reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType}. - * - *

- * If the meaning of the 'Exceptions' reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Exceptions' reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Exceptions() - * @model ordered="false" - * @generated - */ - EList getExceptions(); - - /** - * Returns the value of the 'Synchronized' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Synchronized' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Synchronized' attribute. - * @see #setSynchronized(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Synchronized() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" - * @generated - */ - boolean isSynchronized(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isSynchronized Synchronized}' attribute. - * - * - * - * @param value - * the new value of the 'Synchronized' attribute. - * @see #isSynchronized() - * @generated - */ - void setSynchronized(boolean value); - - /** - * Returns the value of the 'Constructor' attribute. - * - *

- * If the meaning of the 'Constructor' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Constructor' attribute. - * @see #setConstructor(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Constructor() - * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" - * @generated - */ - boolean isConstructor(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isConstructor Constructor}' attribute. - * - * - * - * @param value - * the new value of the 'Constructor' attribute. - * @see #isConstructor() - * @generated - */ - void setConstructor(boolean value); - - /** - * Returns the value of the 'Bodies' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody#getOwner Owner}'. - * - *

- * If the meaning of the 'Bodies' containment reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Bodies' containment reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Bodies() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody#getOwner - * @model opposite="owner" containment="true" ordered="false" - * @generated - */ - EList getBodies(); - - /** - * Returns the value of the 'Abstract' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Abstract' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Abstract' attribute. - * @see #setAbstract(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Abstract() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" - * @generated - */ - boolean isAbstract(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isAbstract Abstract}' attribute. - * - * - * - * @param value - * the new value of the 'Abstract' attribute. - * @see #isAbstract() - * @generated - */ - void setAbstract(boolean value); - - /** - * Returns the value of the 'Final' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Final' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Final' attribute. - * @see #setFinal(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Final() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" - * @generated - */ - boolean isFinal(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isFinal Final}' attribute. - * - * - * - * @param value - * the new value of the 'Final' attribute. - * @see #isFinal() - * @generated - */ - void setFinal(boolean value); - - /** - * Returns the value of the 'Static' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Static' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Static' attribute. - * @see #setStatic(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Static() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" - * @generated - */ - boolean isStatic(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isStatic Static}' attribute. - * - * - * - * @param value - * the new value of the 'Static' attribute. - * @see #isStatic() - * @generated - */ - void setStatic(boolean value); - - /** - * Returns the value of the 'Owner' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getMethods Methods}'. - *

- * This feature redefines the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
  • - *
- *

- * - *

- * If the meaning of the 'Owner' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Owner' container reference. - * @see #setOwner(JDTType) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Owner() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getMethods - * @model opposite="methods" required="true" transient="false" ordered="false" - * @generated - */ - JDTType getOwner(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getOwner Owner}' container reference. - * - * - * - * @param value - * the new value of the 'Owner' container reference. - * @see #getOwner() - * @generated - */ - void setOwner(JDTType value); -} // JDTMethod diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethodBody.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethodBody.java deleted file mode 100644 index 970acbffbcd..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethodBody.java +++ /dev/null @@ -1,71 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'JDT Method Body'. - * - * - * - * Can have different type of body: opaque, expr (not yet implemented, ...) - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody#getOwner Owner}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethodBody() - * @model abstract="true" - * @generated - */ -public interface JDTMethodBody extends EObject { - /** - * Returns the value of the 'Owner' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getBodies Bodies}'. - * - *

- * If the meaning of the 'Owner' container reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Owner' container reference. - * @see #setOwner(JDTMethod) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethodBody_Owner() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getBodies - * @model opposite="bodies" required="true" transient="false" ordered="false" - * @generated - */ - JDTMethod getOwner(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody#getOwner Owner}' container reference. - * - * - * - * @param value - * the new value of the 'Owner' container reference. - * @see #getOwner() - * @generated - */ - void setOwner(JDTMethod value); - - /** - * - * - * - * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" - * @generated - */ - String asText(); - -} // JDTMethodBody diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTOpaqueBody.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTOpaqueBody.java deleted file mode 100644 index 9e6d2280f01..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTOpaqueBody.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - - -/** - * - * A representation of the model object 'JDT Opaque Body'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody#get_body body}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTOpaqueBody() - * @model - * @generated - */ -public interface JDTOpaqueBody extends JDTMethodBody { - /** - * Returns the value of the 'body' attribute. - * - *

- * If the meaning of the 'body' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'body' attribute. - * @see #set_body(String) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTOpaqueBody__body() - * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" - * @generated - */ - String get_body(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody#get_body body}' attribute. - * - * - * - * @param value - * the new value of the 'body' attribute. - * @see #get_body() - * @generated - */ - void set_body(String value); - -} // JDTOpaqueBody diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragment.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragment.java deleted file mode 100644 index fbf0e3ab93d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragment.java +++ /dev/null @@ -1,106 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.common.util.EList; - - -/** - * - * A representation of the model object 'JDT Package Fragment'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getPackageFragmentRoot Package Fragment Root}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getCompilationUnits Compilation Units}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTPackageFragment() - * @model - * @generated - */ -public interface JDTPackageFragment extends JDTParentJavaElement { - - /** - * Returns the value of the 'Package Fragment Root' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getPackageFragments Package Fragments}'. - *

- * This feature redefines the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
  • - *
- *

- * - *

- * If the meaning of the 'Package Fragment Root' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Package Fragment Root' container reference. - * @see #setPackageFragmentRoot(JDTPackageFragmentRoot) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTPackageFragment_PackageFragmentRoot() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getPackageFragments - * @model opposite="packageFragments" transient="false" ordered="false" - * @generated - */ - JDTPackageFragmentRoot getPackageFragmentRoot(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getPackageFragmentRoot Package Fragment Root}' container reference. - * - * - * - * @param value - * the new value of the 'Package Fragment Root' container reference. - * @see #getPackageFragmentRoot() - * @generated - */ - void setPackageFragmentRoot(JDTPackageFragmentRoot value); - - /** - * Returns the value of the 'Compilation Units' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getPackageFragment Package Fragment}'. - *

- * This feature subsets the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
  • - *
- *

- * - *

- * If the meaning of the 'Compilation Units' reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Compilation Units' containment reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTPackageFragment_CompilationUnits() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getPackageFragment - * @model opposite="packageFragment" containment="true" ordered="false" - * @generated - */ - EList getCompilationUnits(); -} // JDTPackageFragment diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragmentRoot.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragmentRoot.java deleted file mode 100644 index 2b34e6990de..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragmentRoot.java +++ /dev/null @@ -1,106 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.common.util.EList; - - -/** - * - * A representation of the model object 'JDT Package Fragment Root'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getJavaProject Java Project}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getPackageFragments Package Fragments}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTPackageFragmentRoot() - * @model - * @generated - */ -public interface JDTPackageFragmentRoot extends JDTParentJavaElement { - - /** - * Returns the value of the 'Java Project' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getPackageFragmentRoots Package Fragment Roots}'. - *

- * This feature redefines the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
  • - *
- *

- * - *

- * If the meaning of the 'Java Project' container reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Java Project' container reference. - * @see #setJavaProject(JDTJavaProject) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTPackageFragmentRoot_JavaProject() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getPackageFragmentRoots - * @model opposite="packageFragmentRoots" transient="false" ordered="false" - * @generated - */ - JDTJavaProject getJavaProject(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getJavaProject Java Project}' container reference. - * - * - * - * @param value - * the new value of the 'Java Project' container reference. - * @see #getJavaProject() - * @generated - */ - void setJavaProject(JDTJavaProject value); - - /** - * Returns the value of the 'Package Fragments' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getPackageFragmentRoot Package Fragment Root}'. - *

- * This feature subsets the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
  • - *
- *

- * - *

- * If the meaning of the 'Package Fragments' reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Package Fragments' containment reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTPackageFragmentRoot_PackageFragments() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getPackageFragmentRoot - * @model opposite="packageFragmentRoot" containment="true" ordered="false" - * @generated - */ - EList getPackageFragments(); -} // JDTPackageFragmentRoot diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParameter.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParameter.java deleted file mode 100644 index 7e23a137536..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParameter.java +++ /dev/null @@ -1,193 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - - -/** - * - * A representation of the model object 'JDT Parameter'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getParameterOwner Parameter Owner}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isFinal Final}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isMultiValued Is Multi Valued}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getType Type}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getReturnOwner Return Owner}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParameter() - * @model - * @generated - */ -public interface JDTParameter extends JDTMember { - - /** - * Returns the value of the 'Parameter Owner' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getParameters Parameters}'. - * - *

- * If the meaning of the 'Parameter Owner' container reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Parameter Owner' container reference. - * @see #setParameterOwner(JDTMethod) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParameter_ParameterOwner() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getParameters - * @model opposite="parameters" transient="false" ordered="false" - * @generated - */ - JDTMethod getParameterOwner(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getParameterOwner Parameter Owner}' container reference. - * - * - * - * @param value - * the new value of the 'Parameter Owner' container reference. - * @see #getParameterOwner() - * @generated - */ - void setParameterOwner(JDTMethod value); - - /** - * Returns the value of the 'Final' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Final' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Final' attribute. - * @see #setFinal(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParameter_Final() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" - * @generated - */ - boolean isFinal(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isFinal Final}' attribute. - * - * - * - * @param value - * the new value of the 'Final' attribute. - * @see #isFinal() - * @generated - */ - void setFinal(boolean value); - - /** - * Returns the value of the 'Is Multi Valued' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Is Multi Valued' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Multi Valued' attribute. - * @see #setIsMultiValued(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParameter_IsMultiValued() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" - * @generated - */ - boolean isMultiValued(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isMultiValued Is Multi Valued}' attribute. - * - * - * - * @param value - * the new value of the 'Is Multi Valued' attribute. - * @see #isMultiValued() - * @generated - */ - void setIsMultiValued(boolean value); - - /** - * Returns the value of the 'Type' reference. - * - *

- * If the meaning of the 'Type' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Type' reference. - * @see #setType(JDTType) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParameter_Type() - * @model ordered="false" - * @generated - */ - JDTType getType(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getType Type}' reference. - * - * - * - * @param value - * the new value of the 'Type' reference. - * @see #getType() - * @generated - */ - void setType(JDTType value); - - /** - * Returns the value of the 'Return Owner' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getReturnType Return Type}'. - * - *

- * If the meaning of the 'Return Owner' container reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Return Owner' container reference. - * @see #setReturnOwner(JDTMethod) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParameter_ReturnOwner() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getReturnType - * @model opposite="returnType" transient="false" ordered="false" - * @generated - */ - JDTMethod getReturnOwner(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getReturnOwner Return Owner}' container reference. - * - * - * - * @param value - * the new value of the 'Return Owner' container reference. - * @see #getReturnOwner() - * @generated - */ - void setReturnOwner(JDTMethod value); -} // JDTParameter diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParent.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParent.java deleted file mode 100644 index 273a3cad656..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParent.java +++ /dev/null @@ -1,111 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'JDT Parent'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren Children}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getFlags Flags}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParent() - * @model abstract="true" - * @generated - */ -public interface JDTParent extends EObject { - - /** - * Returns the value of the 'Flags' attribute. - * - *

- * If the meaning of the 'Flags' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Flags' attribute. - * @see #setFlags(int) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParent_Flags() - * @model unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.int" required="true" ordered="false" - * @generated - */ - int getFlags(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getFlags Flags}' attribute. - * - * - * - * @param value - * the new value of the 'Flags' attribute. - * @see #getFlags() - * @generated - */ - void setFlags(int value); - - /** - * - * - * - * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" flagDataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.int" flagRequired="true" flagOrdered="false" - * @generated - */ - boolean isFlagSet(int flag); - - /** - * Returns the value of the 'Children' reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent Parent}'. - * - *

- * If the meaning of the 'Children' reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Children' reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParent_Children() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent - * @model opposite="parent" transient="true" changeable="false" volatile="true" ordered="false" - * @generated - */ - EList getChildren(); - - /** - * - * - * - * @model flagDataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.int" flagRequired="true" flagOrdered="false" valueDataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" valueRequired="true" valueOrdered="false" - * @generated - */ - void setFlag(int flag, boolean value); - -} // JDTParent diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParentJavaElement.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParentJavaElement.java deleted file mode 100644 index c64fd494880..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParentJavaElement.java +++ /dev/null @@ -1,37 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - - -/** - * - * A representation of the model object 'JDT Parent Java Element'. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParentJavaElement() - * @model abstract="true" - * @generated - */ -public interface JDTParentJavaElement extends JDTJavaElement, JDTParent { -} // JDTParentJavaElement diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTType.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTType.java deleted file mode 100644 index 8b83fef2790..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTType.java +++ /dev/null @@ -1,452 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'JDT Type'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getMethods Methods}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getFields Fields}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getCompilationUnit Compilation Unit}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isClass Class}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isInterface Interface}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isEnum Enum}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isAbstract Abstract}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isFinal Final}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isStatic Static}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getTypes Types}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getOwner Owner}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperInterfaces Super Interfaces}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClass Super Class}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperInterfaceNames Super Interface Names}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClassName Super Class Name}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType() - * @model abstract="true" - * @generated - */ -public interface JDTType extends JDTMember { - - /** - * Returns the value of the 'Methods' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getOwner Owner}'. - *

- * This feature subsets the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
  • - *
- *

- * - *

- * If the meaning of the 'Methods' containment reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Methods' containment reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Methods() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getOwner - * @model opposite="owner" containment="true" ordered="false" - * @generated - */ - EList getMethods(); - - /** - * Returns the value of the 'Compilation Unit' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getTypes Types}'. - *

- * This feature redefines the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
  • - *
- *

- * - *

- * If the meaning of the 'Compilation Unit' container reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Compilation Unit' container reference. - * @see #setCompilationUnit(JDTCompilationUnit) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_CompilationUnit() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getTypes - * @model opposite="types" transient="false" ordered="false" - * @generated - */ - JDTCompilationUnit getCompilationUnit(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getCompilationUnit Compilation Unit}' container reference. - * - * - * - * @param value - * the new value of the 'Compilation Unit' container reference. - * @see #getCompilationUnit() - * @generated - */ - void setCompilationUnit(JDTCompilationUnit value); - - /** - * Returns the value of the 'Class' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Class' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Class' attribute. - * @see #setClass_(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Class() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" - * @generated - */ - boolean isClass(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isClass Class}' attribute. - * - * - * - * @param value - * the new value of the 'Class' attribute. - * @see #isClass() - * @generated - */ - void setClass_(boolean value); - - /** - * Returns the value of the 'Interface' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Interface' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Interface' attribute. - * @see #setInterface(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Interface() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" - * @generated - */ - boolean isInterface(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isInterface Interface}' attribute. - * - * - * - * @param value - * the new value of the 'Interface' attribute. - * @see #isInterface() - * @generated - */ - void setInterface(boolean value); - - /** - * Returns the value of the 'Enum' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Enum' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Enum' attribute. - * @see #setEnum(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Enum() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" - * @generated - */ - boolean isEnum(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isEnum Enum}' attribute. - * - * - * - * @param value - * the new value of the 'Enum' attribute. - * @see #isEnum() - * @generated - */ - void setEnum(boolean value); - - /** - * Returns the value of the 'Abstract' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Abstract' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Abstract' attribute. - * @see #setAbstract(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Abstract() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" - * @generated - */ - boolean isAbstract(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isAbstract Abstract}' attribute. - * - * - * - * @param value - * the new value of the 'Abstract' attribute. - * @see #isAbstract() - * @generated - */ - void setAbstract(boolean value); - - /** - * Returns the value of the 'Final' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Final' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Final' attribute. - * @see #setFinal(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Final() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" - * @generated - */ - boolean isFinal(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isFinal Final}' attribute. - * - * - * - * @param value - * the new value of the 'Final' attribute. - * @see #isFinal() - * @generated - */ - void setFinal(boolean value); - - /** - * Returns the value of the 'Static' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Static' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Static' attribute. - * @see #setStatic(boolean) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Static() - * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" - * @generated - */ - boolean isStatic(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isStatic Static}' attribute. - * - * - * - * @param value - * the new value of the 'Static' attribute. - * @see #isStatic() - * @generated - */ - void setStatic(boolean value); - - /** - * Returns the value of the 'Types' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getOwner Owner}'. - *

- * This feature subsets the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
  • - *
- *

- * - *

- * If the meaning of the 'Types' containment reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Types' containment reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Types() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getOwner - * @model opposite="owner" containment="true" ordered="false" - * @generated - */ - EList getTypes(); - - /** - * Returns the value of the 'Owner' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getTypes Types}'. - *

- * This feature redefines the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
  • - *
- *

- * - *

- * If the meaning of the 'Owner' container reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Owner' container reference. - * @see #setOwner(JDTType) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Owner() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getTypes - * @model opposite="types" transient="false" ordered="false" - * @generated - */ - JDTType getOwner(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getOwner Owner}' container reference. - * - * - * - * @param value - * the new value of the 'Owner' container reference. - * @see #getOwner() - * @generated - */ - void setOwner(JDTType value); - - /** - * Returns the value of the 'Super Interfaces' reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType}. - * - *

- * If the meaning of the 'Super Interfaces' reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Super Interfaces' reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_SuperInterfaces() - * @model ordered="false" - * @generated - */ - EList getSuperInterfaces(); - - /** - * Returns the value of the 'Super Class' reference. - * - *

- * If the meaning of the 'Super Class' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Super Class' reference. - * @see #setSuperClass(JDTType) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_SuperClass() - * @model ordered="false" - * @generated - */ - JDTType getSuperClass(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClass Super Class}' reference. - * - * - * - * @param value - * the new value of the 'Super Class' reference. - * @see #getSuperClass() - * @generated - */ - void setSuperClass(JDTType value); - - /** - * Returns the value of the 'Super Interface Names' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'Super Interface Names' attribute list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Super Interface Names' attribute list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_SuperInterfaceNames() - * @model unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" transient="true" changeable="false" volatile="true" derived="true" ordered="false" - * @generated - */ - EList getSuperInterfaceNames(); - - /** - * Returns the value of the 'Super Class Name' attribute. - * - *

- * If the meaning of the 'Super Class Name' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Super Class Name' attribute. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_SuperClassName() - * @model unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" transient="true" changeable="false" volatile="true" derived="true" ordered="false" - * @generated - */ - String getSuperClassName(); - - /** - * Returns the value of the 'Fields' containment reference list. - * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField}. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getOwner Owner}'. - *

- * This feature subsets the following features: - *

    - *
  • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
  • - *
- *

- * - *

- * If the meaning of the 'Fields' containment reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Fields' containment reference list. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Fields() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getOwner - * @model opposite="owner" containment="true" ordered="false" - * @generated - */ - EList getFields(); - -} // JDTType diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeParameter.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeParameter.java deleted file mode 100644 index 0b417a44a06..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeParameter.java +++ /dev/null @@ -1,74 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - - -/** - * - * A representation of the model object 'JDT Type Parameter'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter#getDeclaringMember Declaring Member}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTTypeParameter() - * @model - * @generated - */ -public interface JDTTypeParameter extends JDTJavaElement { - - /** - * Returns the value of the 'Declaring Member' container reference. - * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getTypeParameters Type Parameters}'. - * - *

- * If the meaning of the 'Declaring Member' container reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Declaring Member' container reference. - * @see #setDeclaringMember(JDTMember) - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTTypeParameter_DeclaringMember() - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getTypeParameters - * @model opposite="typeParameters" transient="false" ordered="false" - * @generated - */ - JDTMember getDeclaringMember(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter#getDeclaringMember Declaring Member}' container reference. - * - * - * - * @param value - * the new value of the 'Declaring Member' container reference. - * @see #getDeclaringMember() - * @generated - */ - void setDeclaringMember(JDTMember value); - -} // JDTTypeParameter diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeRoot.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeRoot.java deleted file mode 100644 index daffc8a54d7..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeRoot.java +++ /dev/null @@ -1,37 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - - -/** - * - * A representation of the model object 'JDT Type Root'. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTTypeRoot() - * @model abstract="true" - * @generated - */ -public interface JDTTypeRoot extends JDTParentJavaElement { -} // JDTTypeRoot diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmFactory.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmFactory.java deleted file mode 100644 index e257924008d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmFactory.java +++ /dev/null @@ -1,217 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.ecore.EFactory; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage - * @generated - */ -public interface JdtmmFactory extends EFactory { - - /** - * The singleton instance of the factory. - * - * - * - * @generated - */ - JdtmmFactory eINSTANCE = org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmFactoryImpl.init(); - - /** - * Returns a new object of class 'JDT Type Parameter'. - * - * - * - * @return a new object of class 'JDT Type Parameter'. - * @generated - */ - JDTTypeParameter createJDTTypeParameter(); - - /** - * Returns a new object of class 'JDT Field'. - * - * - * - * @return a new object of class 'JDT Field'. - * @generated - */ - JDTField createJDTField(); - - /** - * Returns a new object of class 'JDT Method'. - * - * - * - * @return a new object of class 'JDT Method'. - * @generated - */ - JDTMethod createJDTMethod(); - - /** - * Returns a new object of class 'JDT Class'. - * - * - * - * @return a new object of class 'JDT Class'. - * @generated - */ - JDTClass createJDTClass(); - - /** - * Returns a new object of class 'JDT Interface'. - * - * - * - * @return a new object of class 'JDT Interface'. - * @generated - */ - JDTInterface createJDTInterface(); - - /** - * Returns a new object of class 'JDT Enum'. - * - * - * - * @return a new object of class 'JDT Enum'. - * @generated - */ - JDTEnum createJDTEnum(); - - /** - * Returns a new object of class 'JDT Compilation Unit'. - * - * - * - * @return a new object of class 'JDT Compilation Unit'. - * @generated - */ - JDTCompilationUnit createJDTCompilationUnit(); - - /** - * Returns a new object of class 'JDT Import Declaration'. - * - * - * - * @return a new object of class 'JDT Import Declaration'. - * @generated - */ - JDTImportDeclaration createJDTImportDeclaration(); - - /** - * Returns a new object of class 'JDT Import Container'. - * - * - * - * @return a new object of class 'JDT Import Container'. - * @generated - */ - JDTImportContainer createJDTImportContainer(); - - /** - * Returns a new object of class 'JDT Parameter'. - * - * - * - * @return a new object of class 'JDT Parameter'. - * @generated - */ - JDTParameter createJDTParameter(); - - /** - * Returns a new object of class 'JDT Exception'. - * - * - * - * @return a new object of class 'JDT Exception'. - * @generated - */ - JDTException createJDTException(); - - /** - * Returns a new object of class 'JDT Opaque Body'. - * - * - * - * @return a new object of class 'JDT Opaque Body'. - * @generated - */ - JDTOpaqueBody createJDTOpaqueBody(); - - /** - * Returns a new object of class 'JDT Java Model'. - * - * - * - * @return a new object of class 'JDT Java Model'. - * @generated - */ - JDTJavaModel createJDTJavaModel(); - - /** - * Returns a new object of class 'JDT Package Fragment'. - * - * - * - * @return a new object of class 'JDT Package Fragment'. - * @generated - */ - JDTPackageFragment createJDTPackageFragment(); - - /** - * Returns a new object of class 'JDT Package Fragment Root'. - * - * - * - * @return a new object of class 'JDT Package Fragment Root'. - * @generated - */ - JDTPackageFragmentRoot createJDTPackageFragmentRoot(); - - /** - * Returns a new object of class 'JDT Java Project'. - * - * - * - * @return a new object of class 'JDT Java Project'. - * @generated - */ - JDTJavaProject createJDTJavaProject(); - - /** - * Returns the package supported by this factory. - * - * - * - * @return the package supported by this factory. - * @generated - */ - JdtmmPackage getJdtmmPackage(); - -} // JdtmmFactory diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmPackage.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmPackage.java deleted file mode 100644 index f69bbbaaebd..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmPackage.java +++ /dev/null @@ -1,5215 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory - * @model kind="package" - * @generated - */ -public interface JdtmmPackage extends EPackage { - - /** - * The package name. - * - * - * - * @generated - */ - String eNAME = "jdtmm"; - - /** - * The package namespace URI. - * - * - * - * @generated - */ - String eNS_URI = "http:///jdtmm.ecore"; - - /** - * The package namespace name. - * - * - * - * @generated - */ - String eNS_PREFIX = "jdtmm"; - - /** - * The singleton instance of the package. - * - * - * - * @generated - */ - JdtmmPackage eINSTANCE = org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl.init(); - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodBodyImpl JDT Method Body}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodBodyImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTMethodBody() - * @generated - */ - int JDT_METHOD_BODY = 0; - - /** - * The feature id for the 'Owner' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD_BODY__OWNER = 0; - - /** - * The number of structural features of the 'JDT Method Body' class. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD_BODY_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl JDT Java Element}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTJavaElement() - * @generated - */ - int JDT_JAVA_ELEMENT = 5; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_ELEMENT__ELEMENT_NAME = 0; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_ELEMENT__ELEMENT_TYPE = 1; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_ELEMENT__COMMENT = 2; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_ELEMENT__GENERATED = 3; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_ELEMENT__PARENT = 4; - - /** - * The number of structural features of the 'JDT Java Element' class. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_ELEMENT_FEATURE_COUNT = 5; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentImpl JDT Parent}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTParent() - * @generated - */ - int JDT_PARENT = 4; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentJavaElementImpl JDT Parent Java Element}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentJavaElementImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTParentJavaElement() - * @generated - */ - int JDT_PARENT_JAVA_ELEMENT = 3; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME = JDT_JAVA_ELEMENT__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE = JDT_JAVA_ELEMENT__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARENT_JAVA_ELEMENT__COMMENT = JDT_JAVA_ELEMENT__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARENT_JAVA_ELEMENT__GENERATED = JDT_JAVA_ELEMENT__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_PARENT_JAVA_ELEMENT__PARENT = JDT_JAVA_ELEMENT__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_PARENT_JAVA_ELEMENT__CHILDREN = JDT_JAVA_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARENT_JAVA_ELEMENT__FLAGS = JDT_JAVA_ELEMENT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'JDT Parent Java Element' class. - * - * - * - * @generated - * @ordered - */ - int JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT = JDT_JAVA_ELEMENT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl JDT Member}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTMember() - * @generated - */ - int JDT_MEMBER = 2; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_MEMBER__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_MEMBER__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_MEMBER__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_MEMBER__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_MEMBER__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_MEMBER__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_MEMBER__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; - - /** - * The feature id for the 'Type Parameters' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_MEMBER__TYPE_PARAMETERS = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Visibility' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_MEMBER__VISIBILITY = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Explicit Required Imports' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Explicit Plain Text Required Imports' attribute list. - * - * - * - * @generated - * @ordered - */ - int JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'JDT Member' class. - * - * - * - * @generated - * @ordered - */ - int JDT_MEMBER_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeParameterImpl JDT Type Parameter}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeParameterImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTTypeParameter() - * @generated - */ - int JDT_TYPE_PARAMETER = 6; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl JDT Field}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTField() - * @generated - */ - int JDT_FIELD = 8; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl JDT Type}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTType() - * @generated - */ - int JDT_TYPE = 7; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl JDT Method}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTMethod() - * @generated - */ - int JDT_METHOD = 1; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__ELEMENT_NAME = JDT_MEMBER__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__ELEMENT_TYPE = JDT_MEMBER__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__COMMENT = JDT_MEMBER__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__GENERATED = JDT_MEMBER__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__PARENT = JDT_MEMBER__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__CHILDREN = JDT_MEMBER__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__FLAGS = JDT_MEMBER__FLAGS; - - /** - * The feature id for the 'Type Parameters' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__TYPE_PARAMETERS = JDT_MEMBER__TYPE_PARAMETERS; - - /** - * The feature id for the 'Visibility' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__VISIBILITY = JDT_MEMBER__VISIBILITY; - - /** - * The feature id for the 'Explicit Required Imports' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__EXPLICIT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Explicit Plain Text Required Imports' attribute list. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Owner' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__OWNER = JDT_MEMBER_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Return Type' containment reference. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__RETURN_TYPE = JDT_MEMBER_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Parameters' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__PARAMETERS = JDT_MEMBER_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Abstract' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__ABSTRACT = JDT_MEMBER_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Final' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__FINAL = JDT_MEMBER_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Static' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__STATIC = JDT_MEMBER_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Exceptions' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__EXCEPTIONS = JDT_MEMBER_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Synchronized' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__SYNCHRONIZED = JDT_MEMBER_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Constructor' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__CONSTRUCTOR = JDT_MEMBER_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Bodies' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD__BODIES = JDT_MEMBER_FEATURE_COUNT + 9; - - /** - * The number of structural features of the 'JDT Method' class. - * - * - * - * @generated - * @ordered - */ - int JDT_METHOD_FEATURE_COUNT = JDT_MEMBER_FEATURE_COUNT + 10; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_PARENT__CHILDREN = 0; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARENT__FLAGS = 1; - - /** - * The number of structural features of the 'JDT Parent' class. - * - * - * - * @generated - * @ordered - */ - int JDT_PARENT_FEATURE_COUNT = 2; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_PARAMETER__ELEMENT_NAME = JDT_JAVA_ELEMENT__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_PARAMETER__ELEMENT_TYPE = JDT_JAVA_ELEMENT__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_PARAMETER__COMMENT = JDT_JAVA_ELEMENT__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_PARAMETER__GENERATED = JDT_JAVA_ELEMENT__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_PARAMETER__PARENT = JDT_JAVA_ELEMENT__PARENT; - - /** - * The feature id for the 'Declaring Member' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_PARAMETER__DECLARING_MEMBER = JDT_JAVA_ELEMENT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'JDT Type Parameter' class. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_PARAMETER_FEATURE_COUNT = JDT_JAVA_ELEMENT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__ELEMENT_NAME = JDT_MEMBER__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__ELEMENT_TYPE = JDT_MEMBER__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__COMMENT = JDT_MEMBER__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__GENERATED = JDT_MEMBER__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__PARENT = JDT_MEMBER__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__CHILDREN = JDT_MEMBER__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__FLAGS = JDT_MEMBER__FLAGS; - - /** - * The feature id for the 'Type Parameters' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__TYPE_PARAMETERS = JDT_MEMBER__TYPE_PARAMETERS; - - /** - * The feature id for the 'Visibility' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__VISIBILITY = JDT_MEMBER__VISIBILITY; - - /** - * The feature id for the 'Explicit Required Imports' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__EXPLICIT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Explicit Plain Text Required Imports' attribute list. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Methods' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__METHODS = JDT_MEMBER_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Fields' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__FIELDS = JDT_MEMBER_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Compilation Unit' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__COMPILATION_UNIT = JDT_MEMBER_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Class' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__CLASS = JDT_MEMBER_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Interface' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__INTERFACE = JDT_MEMBER_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Enum' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__ENUM = JDT_MEMBER_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Abstract' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__ABSTRACT = JDT_MEMBER_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Final' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__FINAL = JDT_MEMBER_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Static' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__STATIC = JDT_MEMBER_FEATURE_COUNT + 8; - - /** - * The feature id for the 'Types' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__TYPES = JDT_MEMBER_FEATURE_COUNT + 9; - - /** - * The feature id for the 'Owner' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__OWNER = JDT_MEMBER_FEATURE_COUNT + 10; - - /** - * The feature id for the 'Super Interfaces' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__SUPER_INTERFACES = JDT_MEMBER_FEATURE_COUNT + 11; - - /** - * The feature id for the 'Super Class' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__SUPER_CLASS = JDT_MEMBER_FEATURE_COUNT + 12; - - /** - * The feature id for the 'Super Interface Names' attribute list. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__SUPER_INTERFACE_NAMES = JDT_MEMBER_FEATURE_COUNT + 13; - - /** - * The feature id for the 'Super Class Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE__SUPER_CLASS_NAME = JDT_MEMBER_FEATURE_COUNT + 14; - - /** - * The number of structural features of the 'JDT Type' class. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_FEATURE_COUNT = JDT_MEMBER_FEATURE_COUNT + 15; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__ELEMENT_NAME = JDT_MEMBER__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__ELEMENT_TYPE = JDT_MEMBER__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__COMMENT = JDT_MEMBER__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__GENERATED = JDT_MEMBER__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__PARENT = JDT_MEMBER__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__CHILDREN = JDT_MEMBER__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__FLAGS = JDT_MEMBER__FLAGS; - - /** - * The feature id for the 'Type Parameters' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__TYPE_PARAMETERS = JDT_MEMBER__TYPE_PARAMETERS; - - /** - * The feature id for the 'Visibility' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__VISIBILITY = JDT_MEMBER__VISIBILITY; - - /** - * The feature id for the 'Explicit Required Imports' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__EXPLICIT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Explicit Plain Text Required Imports' attribute list. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Abstract' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__ABSTRACT = JDT_MEMBER_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Final' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__FINAL = JDT_MEMBER_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Static' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__STATIC = JDT_MEMBER_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Is Multi Valued' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__IS_MULTI_VALUED = JDT_MEMBER_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Type' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__TYPE = JDT_MEMBER_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Value' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__VALUE = JDT_MEMBER_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Generate Getter' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__GENERATE_GETTER = JDT_MEMBER_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Generate Setter' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__GENERATE_SETTER = JDT_MEMBER_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Owner' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD__OWNER = JDT_MEMBER_FEATURE_COUNT + 8; - - /** - * The number of structural features of the 'JDT Field' class. - * - * - * - * @generated - * @ordered - */ - int JDT_FIELD_FEATURE_COUNT = JDT_MEMBER_FEATURE_COUNT + 9; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTClassImpl JDT Class}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTClassImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTClass() - * @generated - */ - int JDT_CLASS = 16; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTInterfaceImpl JDT Interface}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTInterfaceImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTInterface() - * @generated - */ - int JDT_INTERFACE = 17; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTEnumImpl JDT Enum}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTEnumImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTEnum() - * @generated - */ - int JDT_ENUM = 18; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeRootImpl JDT Type Root}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeRootImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTTypeRoot() - * @generated - */ - int JDT_TYPE_ROOT = 10; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl JDT Compilation Unit}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTCompilationUnit() - * @generated - */ - int JDT_COMPILATION_UNIT = 9; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportDeclarationImpl JDT Import Declaration}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportDeclarationImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTImportDeclaration() - * @generated - */ - int JDT_IMPORT_DECLARATION = 19; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportContainerImpl JDT Import Container}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportContainerImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTImportContainer() - * @generated - */ - int JDT_IMPORT_CONTAINER = 20; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl JDT Parameter}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTParameter() - * @generated - */ - int JDT_PARAMETER = 15; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl JDT Package Fragment}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTPackageFragment() - * @generated - */ - int JDT_PACKAGE_FRAGMENT = 11; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl JDT Package Fragment Root}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTPackageFragmentRoot() - * @generated - */ - int JDT_PACKAGE_FRAGMENT_ROOT = 12; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl JDT Java Project}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTJavaProject() - * @generated - */ - int JDT_JAVA_PROJECT = 13; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaModelImpl JDT Java Model}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaModelImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTJavaModel() - * @generated - */ - int JDT_JAVA_MODEL = 14; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_ROOT__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_ROOT__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_ROOT__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_ROOT__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_ROOT__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_ROOT__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_ROOT__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; - - /** - * The number of structural features of the 'JDT Type Root' class. - * - * - * - * @generated - * @ordered - */ - int JDT_TYPE_ROOT_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_COMPILATION_UNIT__ELEMENT_NAME = JDT_TYPE_ROOT__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_COMPILATION_UNIT__ELEMENT_TYPE = JDT_TYPE_ROOT__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_COMPILATION_UNIT__COMMENT = JDT_TYPE_ROOT__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_COMPILATION_UNIT__GENERATED = JDT_TYPE_ROOT__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_COMPILATION_UNIT__PARENT = JDT_TYPE_ROOT__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_COMPILATION_UNIT__CHILDREN = JDT_TYPE_ROOT__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_COMPILATION_UNIT__FLAGS = JDT_TYPE_ROOT__FLAGS; - - /** - * The feature id for the 'Package Fragment' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT = JDT_TYPE_ROOT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Types' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_COMPILATION_UNIT__TYPES = JDT_TYPE_ROOT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'JDT Compilation Unit' class. - * - * - * - * @generated - * @ordered - */ - int JDT_COMPILATION_UNIT_FEATURE_COUNT = JDT_TYPE_ROOT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; - - /** - * The feature id for the 'Package Fragment Root' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Compilation Units' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'JDT Package Fragment' class. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT_ROOT__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT_ROOT__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT_ROOT__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT_ROOT__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT_ROOT__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT_ROOT__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT_ROOT__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; - - /** - * The feature id for the 'Java Project' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Package Fragments' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'JDT Package Fragment Root' class. - * - * - * - * @generated - * @ordered - */ - int JDT_PACKAGE_FRAGMENT_ROOT_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_PROJECT__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_PROJECT__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_PROJECT__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_PROJECT__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_PROJECT__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_PROJECT__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_PROJECT__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; - - /** - * The feature id for the 'Java Model' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_PROJECT__JAVA_MODEL = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Package Fragment Roots' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'JDT Java Project' class. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_PROJECT_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_MODEL__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_MODEL__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_MODEL__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_MODEL__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_MODEL__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_MODEL__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_MODEL__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; - - /** - * The feature id for the 'Java Project' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_MODEL__JAVA_PROJECT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'JDT Java Model' class. - * - * - * - * @generated - * @ordered - */ - int JDT_JAVA_MODEL_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__ELEMENT_NAME = JDT_MEMBER__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__ELEMENT_TYPE = JDT_MEMBER__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__COMMENT = JDT_MEMBER__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__GENERATED = JDT_MEMBER__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__PARENT = JDT_MEMBER__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__CHILDREN = JDT_MEMBER__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__FLAGS = JDT_MEMBER__FLAGS; - - /** - * The feature id for the 'Type Parameters' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__TYPE_PARAMETERS = JDT_MEMBER__TYPE_PARAMETERS; - - /** - * The feature id for the 'Visibility' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__VISIBILITY = JDT_MEMBER__VISIBILITY; - - /** - * The feature id for the 'Explicit Required Imports' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__EXPLICIT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Explicit Plain Text Required Imports' attribute list. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Parameter Owner' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__PARAMETER_OWNER = JDT_MEMBER_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Final' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__FINAL = JDT_MEMBER_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Is Multi Valued' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__IS_MULTI_VALUED = JDT_MEMBER_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Type' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__TYPE = JDT_MEMBER_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Return Owner' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER__RETURN_OWNER = JDT_MEMBER_FEATURE_COUNT + 4; - - /** - * The number of structural features of the 'JDT Parameter' class. - * - * - * - * @generated - * @ordered - */ - int JDT_PARAMETER_FEATURE_COUNT = JDT_MEMBER_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__ELEMENT_NAME = JDT_TYPE__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__ELEMENT_TYPE = JDT_TYPE__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__COMMENT = JDT_TYPE__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__GENERATED = JDT_TYPE__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__PARENT = JDT_TYPE__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__CHILDREN = JDT_TYPE__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__FLAGS = JDT_TYPE__FLAGS; - - /** - * The feature id for the 'Type Parameters' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__TYPE_PARAMETERS = JDT_TYPE__TYPE_PARAMETERS; - - /** - * The feature id for the 'Visibility' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__VISIBILITY = JDT_TYPE__VISIBILITY; - - /** - * The feature id for the 'Explicit Required Imports' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__EXPLICIT_REQUIRED_IMPORTS = JDT_TYPE__EXPLICIT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Explicit Plain Text Required Imports' attribute list. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_TYPE__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Methods' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__METHODS = JDT_TYPE__METHODS; - - /** - * The feature id for the 'Fields' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__FIELDS = JDT_TYPE__FIELDS; - - /** - * The feature id for the 'Compilation Unit' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__COMPILATION_UNIT = JDT_TYPE__COMPILATION_UNIT; - - /** - * The feature id for the 'Class' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__CLASS = JDT_TYPE__CLASS; - - /** - * The feature id for the 'Interface' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__INTERFACE = JDT_TYPE__INTERFACE; - - /** - * The feature id for the 'Enum' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__ENUM = JDT_TYPE__ENUM; - - /** - * The feature id for the 'Abstract' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__ABSTRACT = JDT_TYPE__ABSTRACT; - - /** - * The feature id for the 'Final' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__FINAL = JDT_TYPE__FINAL; - - /** - * The feature id for the 'Static' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__STATIC = JDT_TYPE__STATIC; - - /** - * The feature id for the 'Types' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__TYPES = JDT_TYPE__TYPES; - - /** - * The feature id for the 'Owner' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__OWNER = JDT_TYPE__OWNER; - - /** - * The feature id for the 'Super Interfaces' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__SUPER_INTERFACES = JDT_TYPE__SUPER_INTERFACES; - - /** - * The feature id for the 'Super Class' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__SUPER_CLASS = JDT_TYPE__SUPER_CLASS; - - /** - * The feature id for the 'Super Interface Names' attribute list. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__SUPER_INTERFACE_NAMES = JDT_TYPE__SUPER_INTERFACE_NAMES; - - /** - * The feature id for the 'Super Class Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS__SUPER_CLASS_NAME = JDT_TYPE__SUPER_CLASS_NAME; - - /** - * The number of structural features of the 'JDT Class' class. - * - * - * - * @generated - * @ordered - */ - int JDT_CLASS_FEATURE_COUNT = JDT_TYPE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__ELEMENT_NAME = JDT_TYPE__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__ELEMENT_TYPE = JDT_TYPE__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__COMMENT = JDT_TYPE__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__GENERATED = JDT_TYPE__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__PARENT = JDT_TYPE__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__CHILDREN = JDT_TYPE__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__FLAGS = JDT_TYPE__FLAGS; - - /** - * The feature id for the 'Type Parameters' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__TYPE_PARAMETERS = JDT_TYPE__TYPE_PARAMETERS; - - /** - * The feature id for the 'Visibility' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__VISIBILITY = JDT_TYPE__VISIBILITY; - - /** - * The feature id for the 'Explicit Required Imports' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__EXPLICIT_REQUIRED_IMPORTS = JDT_TYPE__EXPLICIT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Explicit Plain Text Required Imports' attribute list. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_TYPE__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Methods' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__METHODS = JDT_TYPE__METHODS; - - /** - * The feature id for the 'Fields' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__FIELDS = JDT_TYPE__FIELDS; - - /** - * The feature id for the 'Compilation Unit' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__COMPILATION_UNIT = JDT_TYPE__COMPILATION_UNIT; - - /** - * The feature id for the 'Class' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__CLASS = JDT_TYPE__CLASS; - - /** - * The feature id for the 'Interface' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__INTERFACE = JDT_TYPE__INTERFACE; - - /** - * The feature id for the 'Enum' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__ENUM = JDT_TYPE__ENUM; - - /** - * The feature id for the 'Abstract' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__ABSTRACT = JDT_TYPE__ABSTRACT; - - /** - * The feature id for the 'Final' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__FINAL = JDT_TYPE__FINAL; - - /** - * The feature id for the 'Static' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__STATIC = JDT_TYPE__STATIC; - - /** - * The feature id for the 'Types' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__TYPES = JDT_TYPE__TYPES; - - /** - * The feature id for the 'Owner' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__OWNER = JDT_TYPE__OWNER; - - /** - * The feature id for the 'Super Interfaces' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__SUPER_INTERFACES = JDT_TYPE__SUPER_INTERFACES; - - /** - * The feature id for the 'Super Class' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__SUPER_CLASS = JDT_TYPE__SUPER_CLASS; - - /** - * The feature id for the 'Super Interface Names' attribute list. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__SUPER_INTERFACE_NAMES = JDT_TYPE__SUPER_INTERFACE_NAMES; - - /** - * The feature id for the 'Super Class Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE__SUPER_CLASS_NAME = JDT_TYPE__SUPER_CLASS_NAME; - - /** - * The number of structural features of the 'JDT Interface' class. - * - * - * - * @generated - * @ordered - */ - int JDT_INTERFACE_FEATURE_COUNT = JDT_TYPE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__ELEMENT_NAME = JDT_TYPE__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__ELEMENT_TYPE = JDT_TYPE__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__COMMENT = JDT_TYPE__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__GENERATED = JDT_TYPE__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__PARENT = JDT_TYPE__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__CHILDREN = JDT_TYPE__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__FLAGS = JDT_TYPE__FLAGS; - - /** - * The feature id for the 'Type Parameters' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__TYPE_PARAMETERS = JDT_TYPE__TYPE_PARAMETERS; - - /** - * The feature id for the 'Visibility' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__VISIBILITY = JDT_TYPE__VISIBILITY; - - /** - * The feature id for the 'Explicit Required Imports' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__EXPLICIT_REQUIRED_IMPORTS = JDT_TYPE__EXPLICIT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Explicit Plain Text Required Imports' attribute list. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_TYPE__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; - - /** - * The feature id for the 'Methods' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__METHODS = JDT_TYPE__METHODS; - - /** - * The feature id for the 'Fields' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__FIELDS = JDT_TYPE__FIELDS; - - /** - * The feature id for the 'Compilation Unit' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__COMPILATION_UNIT = JDT_TYPE__COMPILATION_UNIT; - - /** - * The feature id for the 'Class' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__CLASS = JDT_TYPE__CLASS; - - /** - * The feature id for the 'Interface' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__INTERFACE = JDT_TYPE__INTERFACE; - - /** - * The feature id for the 'Enum' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__ENUM = JDT_TYPE__ENUM; - - /** - * The feature id for the 'Abstract' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__ABSTRACT = JDT_TYPE__ABSTRACT; - - /** - * The feature id for the 'Final' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__FINAL = JDT_TYPE__FINAL; - - /** - * The feature id for the 'Static' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__STATIC = JDT_TYPE__STATIC; - - /** - * The feature id for the 'Types' containment reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__TYPES = JDT_TYPE__TYPES; - - /** - * The feature id for the 'Owner' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__OWNER = JDT_TYPE__OWNER; - - /** - * The feature id for the 'Super Interfaces' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__SUPER_INTERFACES = JDT_TYPE__SUPER_INTERFACES; - - /** - * The feature id for the 'Super Class' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__SUPER_CLASS = JDT_TYPE__SUPER_CLASS; - - /** - * The feature id for the 'Super Interface Names' attribute list. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__SUPER_INTERFACE_NAMES = JDT_TYPE__SUPER_INTERFACE_NAMES; - - /** - * The feature id for the 'Super Class Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM__SUPER_CLASS_NAME = JDT_TYPE__SUPER_CLASS_NAME; - - /** - * The number of structural features of the 'JDT Enum' class. - * - * - * - * @generated - * @ordered - */ - int JDT_ENUM_FEATURE_COUNT = JDT_TYPE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_DECLARATION__ELEMENT_NAME = JDT_JAVA_ELEMENT__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_DECLARATION__ELEMENT_TYPE = JDT_JAVA_ELEMENT__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_DECLARATION__COMMENT = JDT_JAVA_ELEMENT__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_DECLARATION__GENERATED = JDT_JAVA_ELEMENT__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_DECLARATION__PARENT = JDT_JAVA_ELEMENT__PARENT; - - /** - * The number of structural features of the 'JDT Import Declaration' class. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_DECLARATION_FEATURE_COUNT = JDT_JAVA_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Element Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_CONTAINER__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; - - /** - * The feature id for the 'Element Type' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_CONTAINER__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_CONTAINER__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; - - /** - * The feature id for the 'Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_CONTAINER__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; - - /** - * The feature id for the 'Parent' reference. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_CONTAINER__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; - - /** - * The feature id for the 'Children' reference list. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_CONTAINER__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; - - /** - * The feature id for the 'Flags' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_CONTAINER__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; - - /** - * The number of structural features of the 'JDT Import Container' class. - * - * - * - * @generated - * @ordered - */ - int JDT_IMPORT_CONTAINER_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTExceptionImpl JDT Exception}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTExceptionImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTException() - * @generated - */ - int JDT_EXCEPTION = 21; - - /** - * The number of structural features of the 'JDT Exception' class. - * - * - * - * @generated - * @ordered - */ - int JDT_EXCEPTION_FEATURE_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTOpaqueBodyImpl JDT Opaque Body}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTOpaqueBodyImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTOpaqueBody() - * @generated - */ - int JDT_OPAQUE_BODY = 22; - - /** - * The feature id for the 'Owner' container reference. - * - * - * - * @generated - * @ordered - */ - int JDT_OPAQUE_BODY__OWNER = JDT_METHOD_BODY__OWNER; - - /** - * The feature id for the 'body' attribute. - * - * - * - * @generated - * @ordered - */ - int JDT_OPAQUE_BODY__BODY = JDT_METHOD_BODY_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'JDT Opaque Body' class. - * - * - * - * @generated - * @ordered - */ - int JDT_OPAQUE_BODY_FEATURE_COUNT = JDT_METHOD_BODY_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind Visibility Kind}' enum. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getVisibilityKind() - * @generated - */ - int VISIBILITY_KIND = 23; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault True False Default}' enum. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getTrueFalseDefault() - * @generated - */ - int TRUE_FALSE_DEFAULT = 24; - - /** - * The meta object id for the 'boolean' data type. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getboolean() - * @generated - */ - int BOOLEAN = 27; - - /** - * The meta object id for the 'int' data type. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getint() - * @generated - */ - int INT = 26; - - /** - * The meta object id for the 'String' data type. - * - * - * - * @see java.lang.String - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getString() - * @generated - */ - int STRING = 25; - - - /** - * The meta object id for the 'JDT Visitor Exception' data type. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTVisitorException() - * @generated - */ - int JDT_VISITOR_EXCEPTION = 28; - - /** - * The meta object id for the 'Visitor' data type. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getVisitor() - * @generated - */ - int VISITOR = 29; - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody JDT Method Body}'. - * - * - * - * @return the meta object for class 'JDT Method Body'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody - * @generated - */ - EClass getJDTMethodBody(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody#getOwner Owner}'. - * - * - * - * @return the meta object for the container reference 'Owner'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody#getOwner() - * @see #getJDTMethodBody() - * @generated - */ - EReference getJDTMethodBody_Owner(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement JDT Java Element}'. - * - * - * - * @return the meta object for class 'JDT Java Element'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement - * @generated - */ - EClass getJDTJavaElement(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent Parent}'. - * - * - * - * @return the meta object for the reference 'Parent'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() - * @see #getJDTJavaElement() - * @generated - */ - EReference getJDTJavaElement_Parent(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementName Element Name}'. - * - * - * - * @return the meta object for the attribute 'Element Name'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementName() - * @see #getJDTJavaElement() - * @generated - */ - EAttribute getJDTJavaElement_ElementName(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementType Element Type}'. - * - * - * - * @return the meta object for the attribute 'Element Type'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementType() - * @see #getJDTJavaElement() - * @generated - */ - EAttribute getJDTJavaElement_ElementType(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getComment Comment}'. - * - * - * - * @return the meta object for the attribute 'Comment'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getComment() - * @see #getJDTJavaElement() - * @generated - */ - EAttribute getJDTJavaElement_Comment(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#isGenerated Generated}'. - * - * - * - * @return the meta object for the attribute 'Generated'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#isGenerated() - * @see #getJDTJavaElement() - * @generated - */ - EAttribute getJDTJavaElement_Generated(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent JDT Parent}'. - * - * - * - * @return the meta object for class 'JDT Parent'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent - * @generated - */ - EClass getJDTParent(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getFlags Flags}'. - * - * - * - * @return the meta object for the attribute 'Flags'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getFlags() - * @see #getJDTParent() - * @generated - */ - EAttribute getJDTParent_Flags(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren Children}'. - * - * - * - * @return the meta object for the reference list 'Children'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() - * @see #getJDTParent() - * @generated - */ - EReference getJDTParent_Children(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember JDT Member}'. - * - * - * - * @return the meta object for class 'JDT Member'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember - * @generated - */ - EClass getJDTMember(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getTypeParameters Type Parameters}'. - * - * - * - * @return the meta object for the containment reference list 'Type Parameters'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getTypeParameters() - * @see #getJDTMember() - * @generated - */ - EReference getJDTMember_TypeParameters(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getVisibility Visibility}'. - * - * - * - * @return the meta object for the attribute 'Visibility'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getVisibility() - * @see #getJDTMember() - * @generated - */ - EAttribute getJDTMember_Visibility(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getExplicitRequiredImports Explicit Required Imports}'. - * - * - * - * @return the meta object for the reference list 'Explicit Required Imports'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getExplicitRequiredImports() - * @see #getJDTMember() - * @generated - */ - EReference getJDTMember_ExplicitRequiredImports(); - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}'. - * - * - * - * @return the meta object for the attribute list 'Explicit Plain Text Required Imports'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getExplicitPlainTextRequiredImports() - * @see #getJDTMember() - * @generated - */ - EAttribute getJDTMember_ExplicitPlainTextRequiredImports(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement JDT Parent Java Element}'. - * - * - * - * @return the meta object for class 'JDT Parent Java Element'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement - * @generated - */ - EClass getJDTParentJavaElement(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter JDT Type Parameter}'. - * - * - * - * @return the meta object for class 'JDT Type Parameter'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter - * @generated - */ - EClass getJDTTypeParameter(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter#getDeclaringMember Declaring Member}'. - * - * - * - * @return the meta object for the container reference 'Declaring Member'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter#getDeclaringMember() - * @see #getJDTTypeParameter() - * @generated - */ - EReference getJDTTypeParameter_DeclaringMember(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField JDT Field}'. - * - * - * - * @return the meta object for class 'JDT Field'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField - * @generated - */ - EClass getJDTField(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getOwner Owner}'. - * - * - * - * @return the meta object for the container reference 'Owner'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getOwner() - * @see #getJDTField() - * @generated - */ - EReference getJDTField_Owner(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getType Type}'. - * - * - * - * @return the meta object for the reference 'Type'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getType() - * @see #getJDTField() - * @generated - */ - EReference getJDTField_Type(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getValue Value}'. - * - * - * - * @return the meta object for the attribute 'Value'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getValue() - * @see #getJDTField() - * @generated - */ - EAttribute getJDTField_Value(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateGetter Generate Getter}'. - * - * - * - * @return the meta object for the attribute 'Generate Getter'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateGetter() - * @see #getJDTField() - * @generated - */ - EAttribute getJDTField_GenerateGetter(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateSetter Generate Setter}'. - * - * - * - * @return the meta object for the attribute 'Generate Setter'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateSetter() - * @see #getJDTField() - * @generated - */ - EAttribute getJDTField_GenerateSetter(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isAbstract Abstract}'. - * - * - * - * @return the meta object for the attribute 'Abstract'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isAbstract() - * @see #getJDTField() - * @generated - */ - EAttribute getJDTField_Abstract(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isFinal Final}'. - * - * - * - * @return the meta object for the attribute 'Final'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isFinal() - * @see #getJDTField() - * @generated - */ - EAttribute getJDTField_Final(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isStatic Static}'. - * - * - * - * @return the meta object for the attribute 'Static'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isStatic() - * @see #getJDTField() - * @generated - */ - EAttribute getJDTField_Static(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isMultiValued Is Multi Valued}'. - * - * - * - * @return the meta object for the attribute 'Is Multi Valued'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isMultiValued() - * @see #getJDTField() - * @generated - */ - EAttribute getJDTField_IsMultiValued(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType JDT Type}'. - * - * - * - * @return the meta object for class 'JDT Type'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType - * @generated - */ - EClass getJDTType(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getMethods Methods}'. - * - * - * - * @return the meta object for the containment reference list 'Methods'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getMethods() - * @see #getJDTType() - * @generated - */ - EReference getJDTType_Methods(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getCompilationUnit Compilation Unit}'. - * - * - * - * @return the meta object for the container reference 'Compilation Unit'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getCompilationUnit() - * @see #getJDTType() - * @generated - */ - EReference getJDTType_CompilationUnit(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isClass Class}'. - * - * - * - * @return the meta object for the attribute 'Class'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isClass() - * @see #getJDTType() - * @generated - */ - EAttribute getJDTType_Class(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isInterface Interface}'. - * - * - * - * @return the meta object for the attribute 'Interface'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isInterface() - * @see #getJDTType() - * @generated - */ - EAttribute getJDTType_Interface(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isEnum Enum}'. - * - * - * - * @return the meta object for the attribute 'Enum'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isEnum() - * @see #getJDTType() - * @generated - */ - EAttribute getJDTType_Enum(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isAbstract Abstract}'. - * - * - * - * @return the meta object for the attribute 'Abstract'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isAbstract() - * @see #getJDTType() - * @generated - */ - EAttribute getJDTType_Abstract(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isFinal Final}'. - * - * - * - * @return the meta object for the attribute 'Final'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isFinal() - * @see #getJDTType() - * @generated - */ - EAttribute getJDTType_Final(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isStatic Static}'. - * - * - * - * @return the meta object for the attribute 'Static'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isStatic() - * @see #getJDTType() - * @generated - */ - EAttribute getJDTType_Static(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getTypes Types}'. - * - * - * - * @return the meta object for the containment reference list 'Types'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getTypes() - * @see #getJDTType() - * @generated - */ - EReference getJDTType_Types(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getOwner Owner}'. - * - * - * - * @return the meta object for the container reference 'Owner'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getOwner() - * @see #getJDTType() - * @generated - */ - EReference getJDTType_Owner(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperInterfaces Super Interfaces}'. - * - * - * - * @return the meta object for the reference list 'Super Interfaces'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperInterfaces() - * @see #getJDTType() - * @generated - */ - EReference getJDTType_SuperInterfaces(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClass Super Class}'. - * - * - * - * @return the meta object for the reference 'Super Class'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClass() - * @see #getJDTType() - * @generated - */ - EReference getJDTType_SuperClass(); - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperInterfaceNames Super Interface Names}'. - * - * - * - * @return the meta object for the attribute list 'Super Interface Names'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperInterfaceNames() - * @see #getJDTType() - * @generated - */ - EAttribute getJDTType_SuperInterfaceNames(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClassName Super Class Name}'. - * - * - * - * @return the meta object for the attribute 'Super Class Name'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClassName() - * @see #getJDTType() - * @generated - */ - EAttribute getJDTType_SuperClassName(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getFields Fields}'. - * - * - * - * @return the meta object for the containment reference list 'Fields'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getFields() - * @see #getJDTType() - * @generated - */ - EReference getJDTType_Fields(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod JDT Method}'. - * - * - * - * @return the meta object for class 'JDT Method'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod - * @generated - */ - EClass getJDTMethod(); - - /** - * Returns the meta object for the containment reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getReturnType Return Type}'. - * - * - * - * @return the meta object for the containment reference 'Return Type'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getReturnType() - * @see #getJDTMethod() - * @generated - */ - EReference getJDTMethod_ReturnType(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getParameters Parameters}'. - * - * - * - * @return the meta object for the containment reference list 'Parameters'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getParameters() - * @see #getJDTMethod() - * @generated - */ - EReference getJDTMethod_Parameters(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getExceptions Exceptions}'. - * - * - * - * @return the meta object for the reference list 'Exceptions'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getExceptions() - * @see #getJDTMethod() - * @generated - */ - EReference getJDTMethod_Exceptions(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isSynchronized Synchronized}'. - * - * - * - * @return the meta object for the attribute 'Synchronized'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isSynchronized() - * @see #getJDTMethod() - * @generated - */ - EAttribute getJDTMethod_Synchronized(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isConstructor Constructor}'. - * - * - * - * @return the meta object for the attribute 'Constructor'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isConstructor() - * @see #getJDTMethod() - * @generated - */ - EAttribute getJDTMethod_Constructor(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getBodies Bodies}'. - * - * - * - * @return the meta object for the containment reference list 'Bodies'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getBodies() - * @see #getJDTMethod() - * @generated - */ - EReference getJDTMethod_Bodies(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isAbstract Abstract}'. - * - * - * - * @return the meta object for the attribute 'Abstract'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isAbstract() - * @see #getJDTMethod() - * @generated - */ - EAttribute getJDTMethod_Abstract(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isFinal Final}'. - * - * - * - * @return the meta object for the attribute 'Final'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isFinal() - * @see #getJDTMethod() - * @generated - */ - EAttribute getJDTMethod_Final(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isStatic Static}'. - * - * - * - * @return the meta object for the attribute 'Static'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isStatic() - * @see #getJDTMethod() - * @generated - */ - EAttribute getJDTMethod_Static(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getOwner Owner}'. - * - * - * - * @return the meta object for the container reference 'Owner'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getOwner() - * @see #getJDTMethod() - * @generated - */ - EReference getJDTMethod_Owner(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass JDT Class}'. - * - * - * - * @return the meta object for class 'JDT Class'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass - * @generated - */ - EClass getJDTClass(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface JDT Interface}'. - * - * - * - * @return the meta object for class 'JDT Interface'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface - * @generated - */ - EClass getJDTInterface(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum JDT Enum}'. - * - * - * - * @return the meta object for class 'JDT Enum'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum - * @generated - */ - EClass getJDTEnum(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot JDT Type Root}'. - * - * - * - * @return the meta object for class 'JDT Type Root'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot - * @generated - */ - EClass getJDTTypeRoot(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit JDT Compilation Unit}'. - * - * - * - * @return the meta object for class 'JDT Compilation Unit'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit - * @generated - */ - EClass getJDTCompilationUnit(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getPackageFragment Package Fragment}'. - * - * - * - * @return the meta object for the container reference 'Package Fragment'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getPackageFragment() - * @see #getJDTCompilationUnit() - * @generated - */ - EReference getJDTCompilationUnit_PackageFragment(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getTypes Types}'. - * - * - * - * @return the meta object for the containment reference list 'Types'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getTypes() - * @see #getJDTCompilationUnit() - * @generated - */ - EReference getJDTCompilationUnit_Types(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration JDT Import Declaration}'. - * - * - * - * @return the meta object for class 'JDT Import Declaration'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration - * @generated - */ - EClass getJDTImportDeclaration(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer JDT Import Container}'. - * - * - * - * @return the meta object for class 'JDT Import Container'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer - * @generated - */ - EClass getJDTImportContainer(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter JDT Parameter}'. - * - * - * - * @return the meta object for class 'JDT Parameter'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter - * @generated - */ - EClass getJDTParameter(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getParameterOwner Parameter Owner}'. - * - * - * - * @return the meta object for the container reference 'Parameter Owner'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getParameterOwner() - * @see #getJDTParameter() - * @generated - */ - EReference getJDTParameter_ParameterOwner(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isFinal Final}'. - * - * - * - * @return the meta object for the attribute 'Final'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isFinal() - * @see #getJDTParameter() - * @generated - */ - EAttribute getJDTParameter_Final(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isMultiValued Is Multi Valued}'. - * - * - * - * @return the meta object for the attribute 'Is Multi Valued'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isMultiValued() - * @see #getJDTParameter() - * @generated - */ - EAttribute getJDTParameter_IsMultiValued(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getType Type}'. - * - * - * - * @return the meta object for the reference 'Type'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getType() - * @see #getJDTParameter() - * @generated - */ - EReference getJDTParameter_Type(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getReturnOwner Return Owner}'. - * - * - * - * @return the meta object for the container reference 'Return Owner'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getReturnOwner() - * @see #getJDTParameter() - * @generated - */ - EReference getJDTParameter_ReturnOwner(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException JDT Exception}'. - * - * - * - * @return the meta object for class 'JDT Exception'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException - * @generated - */ - EClass getJDTException(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody JDT Opaque Body}'. - * - * - * - * @return the meta object for class 'JDT Opaque Body'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody - * @generated - */ - EClass getJDTOpaqueBody(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody#get_body body}'. - * - * - * - * @return the meta object for the attribute 'body'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody#get_body() - * @see #getJDTOpaqueBody() - * @generated - */ - EAttribute getJDTOpaqueBody__body(); - - /** - * Returns the meta object for enum '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind Visibility Kind}'. - * - * - * - * @return the meta object for enum 'Visibility Kind'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind - * @generated - */ - EEnum getVisibilityKind(); - - /** - * Returns the meta object for enum '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault True False Default}'. - * - * - * - * @return the meta object for enum 'True False Default'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault - * @generated - */ - EEnum getTrueFalseDefault(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel JDT Java Model}'. - * - * - * - * @return the meta object for class 'JDT Java Model'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel - * @generated - */ - EClass getJDTJavaModel(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel#getJavaProject Java Project}'. - * - * - * - * @return the meta object for the containment reference list 'Java Project'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel#getJavaProject() - * @see #getJDTJavaModel() - * @generated - */ - EReference getJDTJavaModel_JavaProject(); - - /** - * Returns the meta object for data type 'boolean'. - * - * - * - * @return the meta object for data type 'boolean'. - * @model instanceClass="boolean" - * @generated - */ - EDataType getboolean(); - - /** - * Returns the meta object for data type 'int'. - * - * - * - * @return the meta object for data type 'int'. - * @model instanceClass="int" - * @generated - */ - EDataType getint(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment JDT Package Fragment}'. - * - * - * - * @return the meta object for class 'JDT Package Fragment'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment - * @generated - */ - EClass getJDTPackageFragment(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getPackageFragmentRoot Package Fragment Root}'. - * - * - * - * @return the meta object for the container reference 'Package Fragment Root'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getPackageFragmentRoot() - * @see #getJDTPackageFragment() - * @generated - */ - EReference getJDTPackageFragment_PackageFragmentRoot(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getCompilationUnits Compilation Units}'. - * - * - * - * @return the meta object for the containment reference list 'Compilation Units'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getCompilationUnits() - * @see #getJDTPackageFragment() - * @generated - */ - EReference getJDTPackageFragment_CompilationUnits(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot JDT Package Fragment Root}'. - * - * - * - * @return the meta object for class 'JDT Package Fragment Root'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot - * @generated - */ - EClass getJDTPackageFragmentRoot(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getJavaProject Java Project}'. - * - * - * - * @return the meta object for the container reference 'Java Project'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getJavaProject() - * @see #getJDTPackageFragmentRoot() - * @generated - */ - EReference getJDTPackageFragmentRoot_JavaProject(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getPackageFragments Package Fragments}'. - * - * - * - * @return the meta object for the containment reference list 'Package Fragments'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getPackageFragments() - * @see #getJDTPackageFragmentRoot() - * @generated - */ - EReference getJDTPackageFragmentRoot_PackageFragments(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject JDT Java Project}'. - * - * - * - * @return the meta object for class 'JDT Java Project'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject - * @generated - */ - EClass getJDTJavaProject(); - - /** - * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getJavaModel Java Model}'. - * - * - * - * @return the meta object for the container reference 'Java Model'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getJavaModel() - * @see #getJDTJavaProject() - * @generated - */ - EReference getJDTJavaProject_JavaModel(); - - /** - * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getPackageFragmentRoots Package Fragment Roots}'. - * - * - * - * @return the meta object for the containment reference list 'Package Fragment Roots'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getPackageFragmentRoots() - * @see #getJDTJavaProject() - * @generated - */ - EReference getJDTJavaProject_PackageFragmentRoots(); - - /** - * Returns the meta object for data type '{@link java.lang.String String}'. - * - * - * - * @return the meta object for data type 'String'. - * @see java.lang.String - * @model instanceClass="java.lang.String" - * @generated - */ - EDataType getString(); - - /** - * Returns the meta object for data type '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException JDT Visitor Exception}'. - * - * - * - * @return the meta object for data type 'JDT Visitor Exception'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException - * @model instanceClass="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException" - * @generated - */ - EDataType getJDTVisitorException(); - - /** - * Returns the meta object for data type '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor Visitor}'. - * - * - * - * @return the meta object for data type 'Visitor'. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor - * @model instanceClass="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor" - * @generated - */ - EDataType getVisitor(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - JdtmmFactory getJdtmmFactory(); - - /** - * - * Defines literals for the meta objects that represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * - * @generated - */ - interface Literals { - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodBodyImpl JDT Method Body}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodBodyImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTMethodBody() - * @generated - */ - EClass JDT_METHOD_BODY = eINSTANCE.getJDTMethodBody(); - - /** - * The meta object literal for the 'Owner' container reference feature. - * - * - * - * @generated - */ - EReference JDT_METHOD_BODY__OWNER = eINSTANCE.getJDTMethodBody_Owner(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl JDT Java Element}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTJavaElement() - * @generated - */ - EClass JDT_JAVA_ELEMENT = eINSTANCE.getJDTJavaElement(); - - /** - * The meta object literal for the 'Parent' reference feature. - * - * - * - * @generated - */ - EReference JDT_JAVA_ELEMENT__PARENT = eINSTANCE.getJDTJavaElement_Parent(); - - /** - * The meta object literal for the 'Element Name' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_JAVA_ELEMENT__ELEMENT_NAME = eINSTANCE.getJDTJavaElement_ElementName(); - - /** - * The meta object literal for the 'Element Type' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_JAVA_ELEMENT__ELEMENT_TYPE = eINSTANCE.getJDTJavaElement_ElementType(); - - /** - * The meta object literal for the 'Comment' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_JAVA_ELEMENT__COMMENT = eINSTANCE.getJDTJavaElement_Comment(); - - /** - * The meta object literal for the 'Generated' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_JAVA_ELEMENT__GENERATED = eINSTANCE.getJDTJavaElement_Generated(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentImpl JDT Parent}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTParent() - * @generated - */ - EClass JDT_PARENT = eINSTANCE.getJDTParent(); - - /** - * The meta object literal for the 'Flags' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_PARENT__FLAGS = eINSTANCE.getJDTParent_Flags(); - - /** - * The meta object literal for the 'Children' reference list feature. - * - * - * - * @generated - */ - EReference JDT_PARENT__CHILDREN = eINSTANCE.getJDTParent_Children(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl JDT Member}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTMember() - * @generated - */ - EClass JDT_MEMBER = eINSTANCE.getJDTMember(); - - /** - * The meta object literal for the 'Type Parameters' containment reference list feature. - * - * - * - * @generated - */ - EReference JDT_MEMBER__TYPE_PARAMETERS = eINSTANCE.getJDTMember_TypeParameters(); - - /** - * The meta object literal for the 'Visibility' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_MEMBER__VISIBILITY = eINSTANCE.getJDTMember_Visibility(); - - /** - * The meta object literal for the 'Explicit Required Imports' reference list feature. - * - * - * - * @generated - */ - EReference JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS = eINSTANCE.getJDTMember_ExplicitRequiredImports(); - - /** - * The meta object literal for the 'Explicit Plain Text Required Imports' attribute list feature. - * - * - * - * @generated - */ - EAttribute JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = eINSTANCE.getJDTMember_ExplicitPlainTextRequiredImports(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentJavaElementImpl JDT Parent Java Element}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentJavaElementImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTParentJavaElement() - * @generated - */ - EClass JDT_PARENT_JAVA_ELEMENT = eINSTANCE.getJDTParentJavaElement(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeParameterImpl JDT Type Parameter}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeParameterImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTTypeParameter() - * @generated - */ - EClass JDT_TYPE_PARAMETER = eINSTANCE.getJDTTypeParameter(); - - /** - * The meta object literal for the 'Declaring Member' container reference feature. - * - * - * - * @generated - */ - EReference JDT_TYPE_PARAMETER__DECLARING_MEMBER = eINSTANCE.getJDTTypeParameter_DeclaringMember(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl JDT Field}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTField() - * @generated - */ - EClass JDT_FIELD = eINSTANCE.getJDTField(); - - /** - * The meta object literal for the 'Owner' container reference feature. - * - * - * - * @generated - */ - EReference JDT_FIELD__OWNER = eINSTANCE.getJDTField_Owner(); - - /** - * The meta object literal for the 'Type' reference feature. - * - * - * - * @generated - */ - EReference JDT_FIELD__TYPE = eINSTANCE.getJDTField_Type(); - - /** - * The meta object literal for the 'Value' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_FIELD__VALUE = eINSTANCE.getJDTField_Value(); - - /** - * The meta object literal for the 'Generate Getter' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_FIELD__GENERATE_GETTER = eINSTANCE.getJDTField_GenerateGetter(); - - /** - * The meta object literal for the 'Generate Setter' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_FIELD__GENERATE_SETTER = eINSTANCE.getJDTField_GenerateSetter(); - - /** - * The meta object literal for the 'Abstract' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_FIELD__ABSTRACT = eINSTANCE.getJDTField_Abstract(); - - /** - * The meta object literal for the 'Final' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_FIELD__FINAL = eINSTANCE.getJDTField_Final(); - - /** - * The meta object literal for the 'Static' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_FIELD__STATIC = eINSTANCE.getJDTField_Static(); - - /** - * The meta object literal for the 'Is Multi Valued' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_FIELD__IS_MULTI_VALUED = eINSTANCE.getJDTField_IsMultiValued(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl JDT Type}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTType() - * @generated - */ - EClass JDT_TYPE = eINSTANCE.getJDTType(); - - /** - * The meta object literal for the 'Methods' containment reference list feature. - * - * - * - * @generated - */ - EReference JDT_TYPE__METHODS = eINSTANCE.getJDTType_Methods(); - - /** - * The meta object literal for the 'Compilation Unit' container reference feature. - * - * - * - * @generated - */ - EReference JDT_TYPE__COMPILATION_UNIT = eINSTANCE.getJDTType_CompilationUnit(); - - /** - * The meta object literal for the 'Class' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_TYPE__CLASS = eINSTANCE.getJDTType_Class(); - - /** - * The meta object literal for the 'Interface' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_TYPE__INTERFACE = eINSTANCE.getJDTType_Interface(); - - /** - * The meta object literal for the 'Enum' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_TYPE__ENUM = eINSTANCE.getJDTType_Enum(); - - /** - * The meta object literal for the 'Abstract' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_TYPE__ABSTRACT = eINSTANCE.getJDTType_Abstract(); - - /** - * The meta object literal for the 'Final' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_TYPE__FINAL = eINSTANCE.getJDTType_Final(); - - /** - * The meta object literal for the 'Static' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_TYPE__STATIC = eINSTANCE.getJDTType_Static(); - - /** - * The meta object literal for the 'Types' containment reference list feature. - * - * - * - * @generated - */ - EReference JDT_TYPE__TYPES = eINSTANCE.getJDTType_Types(); - - /** - * The meta object literal for the 'Owner' container reference feature. - * - * - * - * @generated - */ - EReference JDT_TYPE__OWNER = eINSTANCE.getJDTType_Owner(); - - /** - * The meta object literal for the 'Super Interfaces' reference list feature. - * - * - * - * @generated - */ - EReference JDT_TYPE__SUPER_INTERFACES = eINSTANCE.getJDTType_SuperInterfaces(); - - /** - * The meta object literal for the 'Super Class' reference feature. - * - * - * - * @generated - */ - EReference JDT_TYPE__SUPER_CLASS = eINSTANCE.getJDTType_SuperClass(); - - /** - * The meta object literal for the 'Super Interface Names' attribute list feature. - * - * - * - * @generated - */ - EAttribute JDT_TYPE__SUPER_INTERFACE_NAMES = eINSTANCE.getJDTType_SuperInterfaceNames(); - - /** - * The meta object literal for the 'Super Class Name' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_TYPE__SUPER_CLASS_NAME = eINSTANCE.getJDTType_SuperClassName(); - - /** - * The meta object literal for the 'Fields' containment reference list feature. - * - * - * - * @generated - */ - EReference JDT_TYPE__FIELDS = eINSTANCE.getJDTType_Fields(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl JDT Method}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTMethod() - * @generated - */ - EClass JDT_METHOD = eINSTANCE.getJDTMethod(); - - /** - * The meta object literal for the 'Return Type' containment reference feature. - * - * - * - * @generated - */ - EReference JDT_METHOD__RETURN_TYPE = eINSTANCE.getJDTMethod_ReturnType(); - - /** - * The meta object literal for the 'Parameters' containment reference list feature. - * - * - * - * @generated - */ - EReference JDT_METHOD__PARAMETERS = eINSTANCE.getJDTMethod_Parameters(); - - /** - * The meta object literal for the 'Exceptions' reference list feature. - * - * - * - * @generated - */ - EReference JDT_METHOD__EXCEPTIONS = eINSTANCE.getJDTMethod_Exceptions(); - - /** - * The meta object literal for the 'Synchronized' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_METHOD__SYNCHRONIZED = eINSTANCE.getJDTMethod_Synchronized(); - - /** - * The meta object literal for the 'Constructor' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_METHOD__CONSTRUCTOR = eINSTANCE.getJDTMethod_Constructor(); - - /** - * The meta object literal for the 'Bodies' containment reference list feature. - * - * - * - * @generated - */ - EReference JDT_METHOD__BODIES = eINSTANCE.getJDTMethod_Bodies(); - - /** - * The meta object literal for the 'Abstract' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_METHOD__ABSTRACT = eINSTANCE.getJDTMethod_Abstract(); - - /** - * The meta object literal for the 'Final' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_METHOD__FINAL = eINSTANCE.getJDTMethod_Final(); - - /** - * The meta object literal for the 'Static' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_METHOD__STATIC = eINSTANCE.getJDTMethod_Static(); - - /** - * The meta object literal for the 'Owner' container reference feature. - * - * - * - * @generated - */ - EReference JDT_METHOD__OWNER = eINSTANCE.getJDTMethod_Owner(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTClassImpl JDT Class}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTClassImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTClass() - * @generated - */ - EClass JDT_CLASS = eINSTANCE.getJDTClass(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTInterfaceImpl JDT Interface}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTInterfaceImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTInterface() - * @generated - */ - EClass JDT_INTERFACE = eINSTANCE.getJDTInterface(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTEnumImpl JDT Enum}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTEnumImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTEnum() - * @generated - */ - EClass JDT_ENUM = eINSTANCE.getJDTEnum(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeRootImpl JDT Type Root}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeRootImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTTypeRoot() - * @generated - */ - EClass JDT_TYPE_ROOT = eINSTANCE.getJDTTypeRoot(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl JDT Compilation Unit}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTCompilationUnit() - * @generated - */ - EClass JDT_COMPILATION_UNIT = eINSTANCE.getJDTCompilationUnit(); - - /** - * The meta object literal for the 'Package Fragment' container reference feature. - * - * - * - * @generated - */ - EReference JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT = eINSTANCE.getJDTCompilationUnit_PackageFragment(); - - /** - * The meta object literal for the 'Types' containment reference list feature. - * - * - * - * @generated - */ - EReference JDT_COMPILATION_UNIT__TYPES = eINSTANCE.getJDTCompilationUnit_Types(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportDeclarationImpl JDT Import Declaration}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportDeclarationImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTImportDeclaration() - * @generated - */ - EClass JDT_IMPORT_DECLARATION = eINSTANCE.getJDTImportDeclaration(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportContainerImpl JDT Import Container}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportContainerImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTImportContainer() - * @generated - */ - EClass JDT_IMPORT_CONTAINER = eINSTANCE.getJDTImportContainer(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl JDT Parameter}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTParameter() - * @generated - */ - EClass JDT_PARAMETER = eINSTANCE.getJDTParameter(); - - /** - * The meta object literal for the 'Parameter Owner' container reference feature. - * - * - * - * @generated - */ - EReference JDT_PARAMETER__PARAMETER_OWNER = eINSTANCE.getJDTParameter_ParameterOwner(); - - /** - * The meta object literal for the 'Final' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_PARAMETER__FINAL = eINSTANCE.getJDTParameter_Final(); - - /** - * The meta object literal for the 'Is Multi Valued' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_PARAMETER__IS_MULTI_VALUED = eINSTANCE.getJDTParameter_IsMultiValued(); - - /** - * The meta object literal for the 'Type' reference feature. - * - * - * - * @generated - */ - EReference JDT_PARAMETER__TYPE = eINSTANCE.getJDTParameter_Type(); - - /** - * The meta object literal for the 'Return Owner' container reference feature. - * - * - * - * @generated - */ - EReference JDT_PARAMETER__RETURN_OWNER = eINSTANCE.getJDTParameter_ReturnOwner(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTExceptionImpl JDT Exception}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTExceptionImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTException() - * @generated - */ - EClass JDT_EXCEPTION = eINSTANCE.getJDTException(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTOpaqueBodyImpl JDT Opaque Body}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTOpaqueBodyImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTOpaqueBody() - * @generated - */ - EClass JDT_OPAQUE_BODY = eINSTANCE.getJDTOpaqueBody(); - - /** - * The meta object literal for the 'body' attribute feature. - * - * - * - * @generated - */ - EAttribute JDT_OPAQUE_BODY__BODY = eINSTANCE.getJDTOpaqueBody__body(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind Visibility Kind}' enum. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getVisibilityKind() - * @generated - */ - EEnum VISIBILITY_KIND = eINSTANCE.getVisibilityKind(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault True False Default}' enum. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getTrueFalseDefault() - * @generated - */ - EEnum TRUE_FALSE_DEFAULT = eINSTANCE.getTrueFalseDefault(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaModelImpl JDT Java Model}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaModelImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTJavaModel() - * @generated - */ - EClass JDT_JAVA_MODEL = eINSTANCE.getJDTJavaModel(); - - /** - * The meta object literal for the 'Java Project' containment reference list feature. - * - * - * - * @generated - */ - EReference JDT_JAVA_MODEL__JAVA_PROJECT = eINSTANCE.getJDTJavaModel_JavaProject(); - - /** - * The meta object literal for the 'boolean' data type. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getboolean() - * @generated - */ - EDataType BOOLEAN = eINSTANCE.getboolean(); - - /** - * The meta object literal for the 'int' data type. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getint() - * @generated - */ - EDataType INT = eINSTANCE.getint(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl JDT Package Fragment}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTPackageFragment() - * @generated - */ - EClass JDT_PACKAGE_FRAGMENT = eINSTANCE.getJDTPackageFragment(); - - /** - * The meta object literal for the 'Package Fragment Root' container reference feature. - * - * - * - * @generated - */ - EReference JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT = eINSTANCE.getJDTPackageFragment_PackageFragmentRoot(); - - /** - * The meta object literal for the 'Compilation Units' containment reference list feature. - * - * - * - * @generated - */ - EReference JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS = eINSTANCE.getJDTPackageFragment_CompilationUnits(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl JDT Package Fragment Root}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTPackageFragmentRoot() - * @generated - */ - EClass JDT_PACKAGE_FRAGMENT_ROOT = eINSTANCE.getJDTPackageFragmentRoot(); - - /** - * The meta object literal for the 'Java Project' container reference feature. - * - * - * - * @generated - */ - EReference JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT = eINSTANCE.getJDTPackageFragmentRoot_JavaProject(); - - /** - * The meta object literal for the 'Package Fragments' containment reference list feature. - * - * - * - * @generated - */ - EReference JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS = eINSTANCE.getJDTPackageFragmentRoot_PackageFragments(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl JDT Java Project}' class. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTJavaProject() - * @generated - */ - EClass JDT_JAVA_PROJECT = eINSTANCE.getJDTJavaProject(); - - /** - * The meta object literal for the 'Java Model' container reference feature. - * - * - * - * @generated - */ - EReference JDT_JAVA_PROJECT__JAVA_MODEL = eINSTANCE.getJDTJavaProject_JavaModel(); - - /** - * The meta object literal for the 'Package Fragment Roots' containment reference list feature. - * - * - * - * @generated - */ - EReference JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS = eINSTANCE.getJDTJavaProject_PackageFragmentRoots(); - - /** - * The meta object literal for the 'String' data type. - * - * - * - * @see java.lang.String - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getString() - * @generated - */ - EDataType STRING = eINSTANCE.getString(); - - /** - * The meta object literal for the 'JDT Visitor Exception' data type. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTVisitorException() - * @generated - */ - EDataType JDT_VISITOR_EXCEPTION = eINSTANCE.getJDTVisitorException(); - - /** - * The meta object literal for the 'Visitor' data type. - * - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getVisitor() - * @generated - */ - EDataType VISITOR = eINSTANCE.getVisitor(); - - } - -} // JdtmmPackage diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/TrueFalseDefault.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/TrueFalseDefault.java deleted file mode 100644 index dae01bcc8c7..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/TrueFalseDefault.java +++ /dev/null @@ -1,278 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'True False Default', - * and utility methods for working with them. - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getTrueFalseDefault() - * @model - * @generated - */ -public enum TrueFalseDefault implements Enumerator { - /** - * The 'True' literal object. - * - * - * - * @see #TRUE_VALUE - * @generated - * @ordered - */ - TRUE(0, "true", "true"), - - /** - * The 'False' literal object. - * - * - * - * @see #FALSE_VALUE - * @generated - * @ordered - */ - FALSE(1, "false", "false"), - - /** - * The 'Default' literal object. - * - * - * - * @see #DEFAULT_VALUE - * @generated - * @ordered - */ - DEFAULT(2, "default", "default"); - - /** - * The 'True' literal value. - * - *

- * If the meaning of 'True' literal object isn't clear, there really should be more of a description here... - *

- * - * - * @see #TRUE - * @model name="true" - * @generated - * @ordered - */ - public static final int TRUE_VALUE = 0; - - /** - * The 'False' literal value. - * - *

- * If the meaning of 'False' literal object isn't clear, there really should be more of a description here... - *

- * - * - * @see #FALSE - * @model name="false" - * @generated - * @ordered - */ - public static final int FALSE_VALUE = 1; - - /** - * The 'Default' literal value. - * - *

- * If the meaning of 'Default' literal object isn't clear, there really should be more of a description here... - *

- * - * - * @see #DEFAULT - * @model name="default" - * @generated - * @ordered - */ - public static final int DEFAULT_VALUE = 2; - - /** - * An array of all the 'True False Default' enumerators. - * - * - * - * @generated - */ - private static final TrueFalseDefault[] VALUES_ARRAY = - new TrueFalseDefault[] { - TRUE, - FALSE, - DEFAULT, - }; - - /** - * A public read-only list of all the 'True False Default' enumerators. - * - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'True False Default' literal with the specified literal value. - * - * - * - * @generated - */ - public static TrueFalseDefault get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - TrueFalseDefault result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'True False Default' literal with the specified name. - * - * - * - * @generated - */ - public static TrueFalseDefault getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - TrueFalseDefault result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'True False Default' literal with the specified integer value. - * - * - * - * @generated - */ - public static TrueFalseDefault get(int value) { - switch (value) { - case TRUE_VALUE: - return TRUE; - case FALSE_VALUE: - return FALSE; - case DEFAULT_VALUE: - return DEFAULT; - } - return null; - } - - /** - * - * - * - * @generated - */ - private final int value; - - /** - * - * - * - * @generated - */ - private final String name; - - /** - * - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * - * @generated - */ - private TrueFalseDefault(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * - * @generated - */ - @Override - public int getValue() { - return value; - } - - /** - * - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * - * @generated - */ - @Override - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - -} // TrueFalseDefault diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/VisibilityKind.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/VisibilityKind.java deleted file mode 100644 index 7297efd22a2..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/VisibilityKind.java +++ /dev/null @@ -1,278 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'Visibility Kind', - * and utility methods for working with them. - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getVisibilityKind() - * @model - * @generated - */ -public enum VisibilityKind implements Enumerator { - /** - * The 'Public' literal object. - * - * - * - * @see #PUBLIC_VALUE - * @generated - * @ordered - */ - PUBLIC(0, "public", "public"), - - /** - * The 'Protected' literal object. - * - * - * - * @see #PROTECTED_VALUE - * @generated - * @ordered - */ - PROTECTED(1, "protected", "protected"), - - /** - * The 'Private' literal object. - * - * - * - * @see #PRIVATE_VALUE - * @generated - * @ordered - */ - PRIVATE(2, "private", "private"); - - /** - * The 'Public' literal value. - * - *

- * If the meaning of 'Public' literal object isn't clear, there really should be more of a description here... - *

- * - * - * @see #PUBLIC - * @model name="public" - * @generated - * @ordered - */ - public static final int PUBLIC_VALUE = 0; - - /** - * The 'Protected' literal value. - * - *

- * If the meaning of 'Protected' literal object isn't clear, there really should be more of a description here... - *

- * - * - * @see #PROTECTED - * @model name="protected" - * @generated - * @ordered - */ - public static final int PROTECTED_VALUE = 1; - - /** - * The 'Private' literal value. - * - *

- * If the meaning of 'Private' literal object isn't clear, there really should be more of a description here... - *

- * - * - * @see #PRIVATE - * @model name="private" - * @generated - * @ordered - */ - public static final int PRIVATE_VALUE = 2; - - /** - * An array of all the 'Visibility Kind' enumerators. - * - * - * - * @generated - */ - private static final VisibilityKind[] VALUES_ARRAY = - new VisibilityKind[] { - PUBLIC, - PROTECTED, - PRIVATE, - }; - - /** - * A public read-only list of all the 'Visibility Kind' enumerators. - * - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Visibility Kind' literal with the specified literal value. - * - * - * - * @generated - */ - public static VisibilityKind get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - VisibilityKind result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Visibility Kind' literal with the specified name. - * - * - * - * @generated - */ - public static VisibilityKind getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - VisibilityKind result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Visibility Kind' literal with the specified integer value. - * - * - * - * @generated - */ - public static VisibilityKind get(int value) { - switch (value) { - case PUBLIC_VALUE: - return PUBLIC; - case PROTECTED_VALUE: - return PROTECTED; - case PRIVATE_VALUE: - return PRIVATE; - } - return null; - } - - /** - * - * - * - * @generated - */ - private final int value; - - /** - * - * - * - * @generated - */ - private final String name; - - /** - * - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * - * @generated - */ - private VisibilityKind(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * - * @generated - */ - @Override - public int getValue() { - return value; - } - - /** - * - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * - * @generated - */ - @Override - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - -} // VisibilityKind diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTClassImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTClassImpl.java deleted file mode 100644 index db43f78bd57..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTClassImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * An implementation of the model object 'JDT Class'. - * - *

- *

- * - * @generated - */ -public class JDTClassImpl extends JDTTypeImpl implements JDTClass { - - /** - * - * - * - * @generated - */ - protected JDTClassImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_CLASS; - } - -} // JDTClassImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTCompilationUnitImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTCompilationUnitImpl.java deleted file mode 100644 index d01d7d3bd83..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTCompilationUnitImpl.java +++ /dev/null @@ -1,375 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; -import org.eclipse.uml2.common.util.SubsetSupersetEObjectContainmentWithInverseEList; - -/** - * - * An implementation of the model object 'JDT Compilation Unit'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl#getChildren Children}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl#getPackageFragment Package Fragment}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl#getTypes Types}
  • - *
- *

- * - * @generated - */ -public class JDTCompilationUnitImpl extends JDTTypeRootImpl implements JDTCompilationUnit { - - /** - * The cached value of the '{@link #getTypes() Types}' containment reference list. - * - * - * - * @see #getTypes() - * @generated - * @ordered - */ - protected EList types; - - /** - * - * - * - * @generated - */ - protected JDTCompilationUnitImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_COMPILATION_UNIT; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getChildren() { - return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_COMPILATION_UNIT__CHILDREN, CHILDREN_ESUBSETS); - } - - /** - * The array of subset feature identifiers for the '{@link #getChildren() Children}' reference list. - * - * - * - * @see #getChildren() - * @generated - * @ordered - */ - protected static final int[] CHILDREN_ESUBSETS = new int[] { JdtmmPackage.JDT_COMPILATION_UNIT__TYPES }; - - /** - * - * - * - * @generated - */ - @Override - public JDTPackageFragment getPackageFragment() { - if (eContainerFeatureID() != JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT) { - return null; - } - return (JDTPackageFragment) eContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetPackageFragment(JDTPackageFragment newPackageFragment, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newPackageFragment, JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setPackageFragment(JDTPackageFragment newPackageFragment) { - if (newPackageFragment != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT && newPackageFragment != null)) { - if (EcoreUtil.isAncestor(this, newPackageFragment)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newPackageFragment != null) { - msgs = ((InternalEObject) newPackageFragment).eInverseAdd(this, JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS, JDTPackageFragment.class, msgs); - } - msgs = basicSetPackageFragment(newPackageFragment, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } - else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT, newPackageFragment, newPackageFragment)); - } - } - - /** - * - * - * - * @generated - */ - public boolean isSetPackageFragment() { - return getPackageFragment() != null; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getTypes() { - if (types == null) { - types = new SubsetSupersetEObjectContainmentWithInverseEList(JDTType.class, this, JdtmmPackage.JDT_COMPILATION_UNIT__TYPES, TYPES_ESUPERSETS, null, JdtmmPackage.JDT_TYPE__COMPILATION_UNIT); - } - return types; - } - - /** - * The array of superset feature identifiers for the '{@link #getTypes() Types}' containment reference list. - * - * - * - * @see #getTypes() - * @generated - * @ordered - */ - protected static final int[] TYPES_ESUPERSETS = new int[] { JdtmmPackage.JDT_COMPILATION_UNIT__CHILDREN }; - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetPackageFragment((JDTPackageFragment) otherEnd, msgs); - case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: - return ((InternalEList) (InternalEList) getTypes()).basicAdd(otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: - return basicSetPackageFragment(null, msgs); - case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: - return ((InternalEList) getTypes()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: - return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS, JDTPackageFragment.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: - return getPackageFragment(); - case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: - return getTypes(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: - setPackageFragment((JDTPackageFragment) newValue); - return; - case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: - getTypes().clear(); - getTypes().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: - setPackageFragment((JDTPackageFragment) null); - return; - case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: - getTypes().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: - return isSetPackageFragment(); - case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: - return types != null && !types.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isSetChildren() { - return super.isSetChildren() - || eIsSet(JdtmmPackage.JDT_COMPILATION_UNIT__TYPES); - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParent getParent() { - return getPackageFragment(); - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParent basicGetParent() { - return getPackageFragment(); - } - - /** - * - * - * - * @generated - */ - public boolean isSetParent() { - return false; - } - -} // JDTCompilationUnitImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTEnumImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTEnumImpl.java deleted file mode 100644 index 22e94d54f07..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTEnumImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * An implementation of the model object 'JDT Enum'. - * - *

- *

- * - * @generated - */ -public class JDTEnumImpl extends JDTTypeImpl implements JDTEnum { - - /** - * - * - * - * @generated - */ - protected JDTEnumImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_ENUM; - } - -} // JDTEnumImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTExceptionImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTExceptionImpl.java deleted file mode 100644 index dccb6aa5f6d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTExceptionImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * An implementation of the model object 'JDT Exception'. - * - *

- *

- * - * @generated - */ -public class JDTExceptionImpl extends EObjectImpl implements JDTException { - - /** - * - * - * - * @generated - */ - protected JDTExceptionImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_EXCEPTION; - } - -} // JDTExceptionImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTFieldImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTFieldImpl.java deleted file mode 100644 index 4e99b219be8..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTFieldImpl.java +++ /dev/null @@ -1,749 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.jdt.core.Flags; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault; - -/** - * - * An implementation of the model object 'JDT Field'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#isAbstract Abstract}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#isFinal Final}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#isStatic Static}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#isMultiValued Is Multi Valued}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#getType Type}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#getValue Value}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#getGenerateGetter Generate Getter}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#getGenerateSetter Generate Setter}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#getOwner Owner}
  • - *
- *

- * - * @generated - */ -public class JDTFieldImpl extends JDTMemberImpl implements JDTField { - - /** - * The default value of the '{@link #isAbstract() Abstract}' attribute. - * - * - * - * @see #isAbstract() - * @generated - * @ordered - */ - protected static final boolean ABSTRACT_EDEFAULT = false; - - /** - * The default value of the '{@link #isFinal() Final}' attribute. - * - * - * - * @see #isFinal() - * @generated - * @ordered - */ - protected static final boolean FINAL_EDEFAULT = false; - - /** - * The default value of the '{@link #isStatic() Static}' attribute. - * - * - * - * @see #isStatic() - * @generated - * @ordered - */ - protected static final boolean STATIC_EDEFAULT = false; - - /** - * The default value of the '{@link #isMultiValued() Is Multi Valued}' attribute. - * - * - * - * @see #isMultiValued() - * @generated - * @ordered - */ - protected static final boolean IS_MULTI_VALUED_EDEFAULT = false; - - /** - * The cached value of the '{@link #isMultiValued() Is Multi Valued}' attribute. - * - * - * - * @see #isMultiValued() - * @generated - * @ordered - */ - protected boolean isMultiValued = IS_MULTI_VALUED_EDEFAULT; - - /** - * The cached value of the '{@link #getType() Type}' reference. - * - * - * - * @see #getType() - * @generated - * @ordered - */ - protected JDTType type; - - /** - * The default value of the '{@link #getValue() Value}' attribute. - * - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected static final String VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getValue() Value}' attribute. - * - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected String value = VALUE_EDEFAULT; - - /** - * The default value of the '{@link #getGenerateGetter() Generate Getter}' attribute. - * - * - * - * @see #getGenerateGetter() - * @generated - * @ordered - */ - protected static final TrueFalseDefault GENERATE_GETTER_EDEFAULT = TrueFalseDefault.TRUE; - - /** - * The cached value of the '{@link #getGenerateGetter() Generate Getter}' attribute. - * - * - * - * @see #getGenerateGetter() - * @generated - * @ordered - */ - protected TrueFalseDefault generateGetter = GENERATE_GETTER_EDEFAULT; - - /** - * The default value of the '{@link #getGenerateSetter() Generate Setter}' attribute. - * - * - * - * @see #getGenerateSetter() - * @generated - * @ordered - */ - protected static final TrueFalseDefault GENERATE_SETTER_EDEFAULT = TrueFalseDefault.TRUE; - - /** - * The cached value of the '{@link #getGenerateSetter() Generate Setter}' attribute. - * - * - * - * @see #getGenerateSetter() - * @generated - * @ordered - */ - protected TrueFalseDefault generateSetter = GENERATE_SETTER_EDEFAULT; - - /** - * - * - * - * @generated - */ - protected JDTFieldImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_FIELD; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTType getOwner() { - if (eContainerFeatureID() != JdtmmPackage.JDT_FIELD__OWNER) { - return null; - } - return (JDTType) eContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetOwner(JDTType newOwner, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newOwner, JdtmmPackage.JDT_FIELD__OWNER, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setOwner(JDTType newOwner) { - if (newOwner != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_FIELD__OWNER && newOwner != null)) { - if (EcoreUtil.isAncestor(this, newOwner)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newOwner != null) { - msgs = ((InternalEObject) newOwner).eInverseAdd(this, JdtmmPackage.JDT_TYPE__FIELDS, JDTType.class, msgs); - } - msgs = basicSetOwner(newOwner, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } - else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_FIELD__OWNER, newOwner, newOwner)); - } - } - - /** - * - * - * - * @generated - */ - public boolean isSetOwner() { - return getOwner() != null; - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isAbstract() { - // TODO: implement this method to return the 'Abstract' attribute - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isMultiValued() { - return isMultiValued; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsMultiValued(boolean newIsMultiValued) { - boolean oldIsMultiValued = isMultiValued; - isMultiValued = newIsMultiValued; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_FIELD__IS_MULTI_VALUED, oldIsMultiValued, isMultiValued)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public JDTType getType() { - if (type != null && type.eIsProxy()) { - InternalEObject oldType = (InternalEObject) type; - type = (JDTType) eResolveProxy(oldType); - if (type != oldType) { - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.RESOLVE, JdtmmPackage.JDT_FIELD__TYPE, oldType, type)); - } - } - } - return type; - } - - /** - * - * - * - * @generated - */ - public JDTType basicGetType() { - return type; - } - - /** - * - * - * - * @generated - */ - @Override - public void setType(JDTType newType) { - JDTType oldType = type; - type = newType; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_FIELD__TYPE, oldType, type)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public String getValue() { - return value; - } - - /** - * - * - * - * @generated - */ - @Override - public void setValue(String newValue) { - String oldValue = value; - value = newValue; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_FIELD__VALUE, oldValue, value)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public TrueFalseDefault getGenerateGetter() { - return generateGetter; - } - - /** - * - * - * - * @generated - */ - @Override - public void setGenerateGetter(TrueFalseDefault newGenerateGetter) { - TrueFalseDefault oldGenerateGetter = generateGetter; - generateGetter = newGenerateGetter == null ? GENERATE_GETTER_EDEFAULT : newGenerateGetter; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_FIELD__GENERATE_GETTER, oldGenerateGetter, generateGetter)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public TrueFalseDefault getGenerateSetter() { - return generateSetter; - } - - /** - * - * - * - * @generated - */ - @Override - public void setGenerateSetter(TrueFalseDefault newGenerateSetter) { - TrueFalseDefault oldGenerateSetter = generateSetter; - generateSetter = newGenerateSetter == null ? GENERATE_SETTER_EDEFAULT : newGenerateSetter; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_FIELD__GENERATE_SETTER, oldGenerateSetter, generateSetter)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_FIELD__OWNER: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetOwner((JDTType) otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_FIELD__OWNER: - return basicSetOwner(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case JdtmmPackage.JDT_FIELD__OWNER: - return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_TYPE__FIELDS, JDTType.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_FIELD__ABSTRACT: - return isAbstract(); - case JdtmmPackage.JDT_FIELD__FINAL: - return isFinal(); - case JdtmmPackage.JDT_FIELD__STATIC: - return isStatic(); - case JdtmmPackage.JDT_FIELD__IS_MULTI_VALUED: - return isMultiValued(); - case JdtmmPackage.JDT_FIELD__TYPE: - if (resolve) { - return getType(); - } - return basicGetType(); - case JdtmmPackage.JDT_FIELD__VALUE: - return getValue(); - case JdtmmPackage.JDT_FIELD__GENERATE_GETTER: - return getGenerateGetter(); - case JdtmmPackage.JDT_FIELD__GENERATE_SETTER: - return getGenerateSetter(); - case JdtmmPackage.JDT_FIELD__OWNER: - return getOwner(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_FIELD__ABSTRACT: - setAbstract((Boolean) newValue); - return; - case JdtmmPackage.JDT_FIELD__FINAL: - setFinal((Boolean) newValue); - return; - case JdtmmPackage.JDT_FIELD__STATIC: - setStatic((Boolean) newValue); - return; - case JdtmmPackage.JDT_FIELD__IS_MULTI_VALUED: - setIsMultiValued((Boolean) newValue); - return; - case JdtmmPackage.JDT_FIELD__TYPE: - setType((JDTType) newValue); - return; - case JdtmmPackage.JDT_FIELD__VALUE: - setValue((String) newValue); - return; - case JdtmmPackage.JDT_FIELD__GENERATE_GETTER: - setGenerateGetter((TrueFalseDefault) newValue); - return; - case JdtmmPackage.JDT_FIELD__GENERATE_SETTER: - setGenerateSetter((TrueFalseDefault) newValue); - return; - case JdtmmPackage.JDT_FIELD__OWNER: - setOwner((JDTType) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_FIELD__ABSTRACT: - setAbstract(ABSTRACT_EDEFAULT); - return; - case JdtmmPackage.JDT_FIELD__FINAL: - setFinal(FINAL_EDEFAULT); - return; - case JdtmmPackage.JDT_FIELD__STATIC: - setStatic(STATIC_EDEFAULT); - return; - case JdtmmPackage.JDT_FIELD__IS_MULTI_VALUED: - setIsMultiValued(IS_MULTI_VALUED_EDEFAULT); - return; - case JdtmmPackage.JDT_FIELD__TYPE: - setType((JDTType) null); - return; - case JdtmmPackage.JDT_FIELD__VALUE: - setValue(VALUE_EDEFAULT); - return; - case JdtmmPackage.JDT_FIELD__GENERATE_GETTER: - setGenerateGetter(GENERATE_GETTER_EDEFAULT); - return; - case JdtmmPackage.JDT_FIELD__GENERATE_SETTER: - setGenerateSetter(GENERATE_SETTER_EDEFAULT); - return; - case JdtmmPackage.JDT_FIELD__OWNER: - setOwner((JDTType) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_FIELD__ABSTRACT: - return isAbstract() != ABSTRACT_EDEFAULT; - case JdtmmPackage.JDT_FIELD__FINAL: - return isFinal() != FINAL_EDEFAULT; - case JdtmmPackage.JDT_FIELD__STATIC: - return isStatic() != STATIC_EDEFAULT; - case JdtmmPackage.JDT_FIELD__IS_MULTI_VALUED: - return isMultiValued != IS_MULTI_VALUED_EDEFAULT; - case JdtmmPackage.JDT_FIELD__TYPE: - return type != null; - case JdtmmPackage.JDT_FIELD__VALUE: - return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); - case JdtmmPackage.JDT_FIELD__GENERATE_GETTER: - return generateGetter != GENERATE_GETTER_EDEFAULT; - case JdtmmPackage.JDT_FIELD__GENERATE_SETTER: - return generateSetter != GENERATE_SETTER_EDEFAULT; - case JdtmmPackage.JDT_FIELD__OWNER: - return isSetOwner(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (isMultiValued: "); - result.append(isMultiValued); - result.append(", value: "); - result.append(value); - result.append(", generateGetter: "); - result.append(generateGetter); - result.append(", generateSetter: "); - result.append(generateSetter); - result.append(')'); - return result.toString(); - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParent getParent() { - return getOwner(); - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParent basicGetParent() { - return getOwner(); - } - - /** - * - * - * - * @generated - */ - public boolean isSetParent() { - return false; - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isFinal() { - // TODO: implement this method to return the 'Final' attribute - // Ensure that you remove @generated or mark it @generated NOT - return isFlagSet(Flags.AccFinal); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isStatic() { - return isFlagSet(Flags.AccStatic); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setAbstract(boolean newAbstract) { - // Ensure that you remove @generated or mark it @generated NOT - setFlag(Flags.AccAbstract, newAbstract); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setFinal(boolean newFinal) { - - setFlag(Flags.AccFinal, newFinal); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setStatic(boolean newStatic) { - setFlag(Flags.AccStatic, newStatic); - } - -} // JDTFieldImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportContainerImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportContainerImpl.java deleted file mode 100644 index 778b6c46e40..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportContainerImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * An implementation of the model object 'JDT Import Container'. - * - *

- *

- * - * @generated - */ -public class JDTImportContainerImpl extends JDTParentJavaElementImpl implements JDTImportContainer { - - /** - * - * - * - * @generated - */ - protected JDTImportContainerImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_IMPORT_CONTAINER; - } - -} // JDTImportContainerImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportDeclarationImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportDeclarationImpl.java deleted file mode 100644 index 3312ffe75ba..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportDeclarationImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * An implementation of the model object 'JDT Import Declaration'. - * - *

- *

- * - * @generated - */ -public class JDTImportDeclarationImpl extends JDTJavaElementImpl implements JDTImportDeclaration { - - /** - * - * - * - * @generated - */ - protected JDTImportDeclarationImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_IMPORT_DECLARATION; - } - -} // JDTImportDeclarationImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTInterfaceImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTInterfaceImpl.java deleted file mode 100644 index 289b0d528bf..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTInterfaceImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * An implementation of the model object 'JDT Interface'. - * - *

- *

- * - * @generated - */ -public class JDTInterfaceImpl extends JDTTypeImpl implements JDTInterface { - - /** - * - * - * - * @generated - */ - protected JDTInterfaceImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_INTERFACE; - } - -} // JDTInterfaceImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaElementImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaElementImpl.java deleted file mode 100644 index cb4cdf8284e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaElementImpl.java +++ /dev/null @@ -1,453 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; - -/** - * - * An implementation of the model object 'JDT Java Element'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl#getElementName Element Name}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl#getElementType Element Type}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl#getComment Comment}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl#isGenerated Generated}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl#getParent Parent}
  • - *
- *

- * - * @generated - */ -public abstract class JDTJavaElementImpl extends EObjectImpl implements JDTJavaElement { - - /** - * The default value of the '{@link #getElementName() Element Name}' attribute. - * - * - * - * @see #getElementName() - * @generated - * @ordered - */ - protected static final String ELEMENT_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getElementName() Element Name}' attribute. - * - * - * - * @see #getElementName() - * @generated - * @ordered - */ - protected String elementName = ELEMENT_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getElementType() Element Type}' attribute. - * - * - * - * @see #getElementType() - * @generated - * @ordered - */ - protected static final int ELEMENT_TYPE_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getElementType() Element Type}' attribute. - * - * - * - * @see #getElementType() - * @generated - * @ordered - */ - protected int elementType = ELEMENT_TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getComment() Comment}' attribute. - * - * - * - * @see #getComment() - * @generated - * @ordered - */ - protected static final String COMMENT_EDEFAULT = null; - - /** - * The cached value of the '{@link #getComment() Comment}' attribute. - * - * - * - * @see #getComment() - * @generated - * @ordered - */ - protected String comment = COMMENT_EDEFAULT; - - /** - * The default value of the '{@link #isGenerated() Generated}' attribute. - * - * - * - * @see #isGenerated() - * @generated - * @ordered - */ - protected static final boolean GENERATED_EDEFAULT = false; - - /** - * The cached value of the '{@link #isGenerated() Generated}' attribute. - * - * - * - * @see #isGenerated() - * @generated - * @ordered - */ - protected boolean generated = GENERATED_EDEFAULT; - - /** - * - * - * - * @generated - */ - protected JDTJavaElementImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_JAVA_ELEMENT; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParent getParent() { - JDTParent parent = basicGetParent(); - return parent != null && parent.eIsProxy() ? (JDTParent) eResolveProxy((InternalEObject) parent) : parent; - } - - /** - * - * - * - * @generated - */ - public JDTParent basicGetParent() { - // TODO: implement this method to return the 'Parent' reference - // -> do not perform proxy resolution - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - - /** - * - * - * - * @generated - */ - @Override - public String getElementName() { - return elementName; - } - - /** - * - * - * - * @generated - */ - @Override - public void setElementName(String newElementName) { - String oldElementName = elementName; - elementName = newElementName; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_NAME, oldElementName, elementName)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public int getElementType() { - return elementType; - } - - /** - * - * - * - * @generated - */ - @Override - public void setElementType(int newElementType) { - int oldElementType = elementType; - elementType = newElementType; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_TYPE, oldElementType, elementType)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public String getComment() { - return comment; - } - - /** - * - * - * - * @generated - */ - @Override - public void setComment(String newComment) { - String oldComment = comment; - comment = newComment; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_JAVA_ELEMENT__COMMENT, oldComment, comment)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isGenerated() { - return generated; - } - - /** - * - * - * - * @generated - */ - @Override - public void setGenerated(boolean newGenerated) { - boolean oldGenerated = generated; - generated = newGenerated; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_JAVA_ELEMENT__GENERATED, oldGenerated, generated)); - } - } - - /** - * - * - * - * @generated not - */ - @Override - public String getQualifiedName() { - return getElementName(); - } - - /** - * - * - * - * @throws JDTVisitorException - * @generated NOT - */ - @Override - public void accept(JDTVisitor visitor) throws JDTVisitorException { - visitor.visit(this); - } - - /** - * - * - * - * @generated - */ - @Override - public String getJDTSignature() { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_NAME: - return getElementName(); - case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_TYPE: - return getElementType(); - case JdtmmPackage.JDT_JAVA_ELEMENT__COMMENT: - return getComment(); - case JdtmmPackage.JDT_JAVA_ELEMENT__GENERATED: - return isGenerated(); - case JdtmmPackage.JDT_JAVA_ELEMENT__PARENT: - if (resolve) { - return getParent(); - } - return basicGetParent(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_NAME: - setElementName((String) newValue); - return; - case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_TYPE: - setElementType((Integer) newValue); - return; - case JdtmmPackage.JDT_JAVA_ELEMENT__COMMENT: - setComment((String) newValue); - return; - case JdtmmPackage.JDT_JAVA_ELEMENT__GENERATED: - setGenerated((Boolean) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_NAME: - setElementName(ELEMENT_NAME_EDEFAULT); - return; - case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_TYPE: - setElementType(ELEMENT_TYPE_EDEFAULT); - return; - case JdtmmPackage.JDT_JAVA_ELEMENT__COMMENT: - setComment(COMMENT_EDEFAULT); - return; - case JdtmmPackage.JDT_JAVA_ELEMENT__GENERATED: - setGenerated(GENERATED_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_NAME: - return ELEMENT_NAME_EDEFAULT == null ? elementName != null : !ELEMENT_NAME_EDEFAULT.equals(elementName); - case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_TYPE: - return elementType != ELEMENT_TYPE_EDEFAULT; - case JdtmmPackage.JDT_JAVA_ELEMENT__COMMENT: - return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment); - case JdtmmPackage.JDT_JAVA_ELEMENT__GENERATED: - return generated != GENERATED_EDEFAULT; - case JdtmmPackage.JDT_JAVA_ELEMENT__PARENT: - return basicGetParent() != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (elementName: "); - result.append(elementName); - result.append(", elementType: "); - result.append(elementType); - result.append(", comment: "); - result.append(comment); - result.append(", generated: "); - result.append(generated); - result.append(')'); - return result.toString(); - } - -} // JDTJavaElementImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaModelImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaModelImpl.java deleted file mode 100644 index ac4c2ac89db..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaModelImpl.java +++ /dev/null @@ -1,193 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * An implementation of the model object 'JDT Java Model'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaModelImpl#getJavaProject Java Project}
  • - *
- *

- * - * @generated - */ -public class JDTJavaModelImpl extends JDTParentJavaElementImpl implements JDTJavaModel { - - /** - * The cached value of the '{@link #getJavaProject() Java Project}' containment reference list. - * - * - * - * @see #getJavaProject() - * @generated - * @ordered - */ - protected EList javaProject; - - /** - * - * - * - * @generated - */ - protected JDTJavaModelImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_JAVA_MODEL; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getJavaProject() { - if (javaProject == null) { - javaProject = new EObjectContainmentWithInverseEList(JDTJavaProject.class, this, JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT, JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL); - } - return javaProject; - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: - return ((InternalEList) (InternalEList) getJavaProject()).basicAdd(otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: - return ((InternalEList) getJavaProject()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: - return getJavaProject(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: - getJavaProject().clear(); - getJavaProject().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: - getJavaProject().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: - return javaProject != null && !javaProject.isEmpty(); - } - return super.eIsSet(featureID); - } - -} // JDTJavaModelImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaProjectImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaProjectImpl.java deleted file mode 100644 index a085e987b2d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaProjectImpl.java +++ /dev/null @@ -1,333 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; -import org.eclipse.uml2.common.util.SubsetSupersetEObjectContainmentWithInverseEList; - -/** - * - * An implementation of the model object 'JDT Java Project'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl#getChildren Children}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl#getJavaModel Java Model}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl#getPackageFragmentRoots Package Fragment Roots}
  • - *
- *

- * - * @generated - */ -public class JDTJavaProjectImpl extends JDTParentJavaElementImpl implements JDTJavaProject { - - /** - * The cached value of the '{@link #getPackageFragmentRoots() Package Fragment Roots}' containment reference list. - * - * - * - * @see #getPackageFragmentRoots() - * @generated - * @ordered - */ - protected EList packageFragmentRoots; - - /** - * - * - * - * @generated - */ - protected JDTJavaProjectImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_JAVA_PROJECT; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getChildren() { - return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_JAVA_PROJECT__CHILDREN, CHILDREN_ESUBSETS); - } - - /** - * The array of subset feature identifiers for the '{@link #getChildren() Children}' reference list. - * - * - * - * @see #getChildren() - * @generated - * @ordered - */ - protected static final int[] CHILDREN_ESUBSETS = new int[] { JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS }; - - /** - * - * - * - * @generated - */ - @Override - public JDTJavaModel getJavaModel() { - if (eContainerFeatureID() != JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL) { - return null; - } - return (JDTJavaModel) eContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetJavaModel(JDTJavaModel newJavaModel, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newJavaModel, JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setJavaModel(JDTJavaModel newJavaModel) { - if (newJavaModel != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL && newJavaModel != null)) { - if (EcoreUtil.isAncestor(this, newJavaModel)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newJavaModel != null) { - msgs = ((InternalEObject) newJavaModel).eInverseAdd(this, JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT, JDTJavaModel.class, msgs); - } - msgs = basicSetJavaModel(newJavaModel, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } - else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL, newJavaModel, newJavaModel)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public EList getPackageFragmentRoots() { - if (packageFragmentRoots == null) { - packageFragmentRoots = new SubsetSupersetEObjectContainmentWithInverseEList(JDTPackageFragmentRoot.class, this, JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS, PACKAGE_FRAGMENT_ROOTS_ESUPERSETS, null, - JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT); - } - return packageFragmentRoots; - } - - /** - * The array of superset feature identifiers for the '{@link #getPackageFragmentRoots() Package Fragment Roots}' containment reference list. - * - * - * - * @see #getPackageFragmentRoots() - * @generated - * @ordered - */ - protected static final int[] PACKAGE_FRAGMENT_ROOTS_ESUPERSETS = new int[] { JdtmmPackage.JDT_JAVA_PROJECT__CHILDREN }; - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetJavaModel((JDTJavaModel) otherEnd, msgs); - case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: - return ((InternalEList) (InternalEList) getPackageFragmentRoots()).basicAdd(otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: - return basicSetJavaModel(null, msgs); - case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: - return ((InternalEList) getPackageFragmentRoots()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: - return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT, JDTJavaModel.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: - return getJavaModel(); - case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: - return getPackageFragmentRoots(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: - setJavaModel((JDTJavaModel) newValue); - return; - case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: - getPackageFragmentRoots().clear(); - getPackageFragmentRoots().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: - setJavaModel((JDTJavaModel) null); - return; - case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: - getPackageFragmentRoots().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: - return getJavaModel() != null; - case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: - return packageFragmentRoots != null && !packageFragmentRoots.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isSetChildren() { - return super.isSetChildren() - || eIsSet(JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS); - } - -} // JDTJavaProjectImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMemberImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMemberImpl.java deleted file mode 100644 index 281a07e2051..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMemberImpl.java +++ /dev/null @@ -1,363 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; -import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jdt.core.Flags; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind; - -/** - * - * An implementation of the model object 'JDT Member'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl#getTypeParameters Type Parameters}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl#getVisibility Visibility}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl#getExplicitRequiredImports Explicit Required Imports}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
  • - *
- *

- * - * @generated - */ -public abstract class JDTMemberImpl extends JDTParentJavaElementImpl implements JDTMember { - - /** - * The cached value of the '{@link #getTypeParameters() Type Parameters}' containment reference list. - * - * - * - * @see #getTypeParameters() - * @generated - * @ordered - */ - protected EList typeParameters; - - /** - * The default value of the '{@link #getVisibility() Visibility}' attribute. - * - * - * - * @see #getVisibility() - * @generated - * @ordered - */ - protected static final VisibilityKind VISIBILITY_EDEFAULT = VisibilityKind.PUBLIC; - - /** - * The cached value of the '{@link #getExplicitRequiredImports() Explicit Required Imports}' reference list. - * - * - * - * @see #getExplicitRequiredImports() - * @generated - * @ordered - */ - protected EList explicitRequiredImports; - - /** - * The cached value of the '{@link #getExplicitPlainTextRequiredImports() Explicit Plain Text Required Imports}' attribute list. - * - * - * - * @see #getExplicitPlainTextRequiredImports() - * @generated - * @ordered - */ - protected EList explicitPlainTextRequiredImports; - - /** - * - * - * - * @generated - */ - protected JDTMemberImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_MEMBER; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getTypeParameters() { - if (typeParameters == null) { - typeParameters = new EObjectContainmentWithInverseEList(JDTTypeParameter.class, this, JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS, JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER); - } - return typeParameters; - } - - /** - * - * - * - * @generated NOT - */ - @Override - public VisibilityKind getVisibility() { - - if (Flags.isPublic(flags)) { - return VisibilityKind.PUBLIC; - } else if (Flags.isProtected(flags)) { - return VisibilityKind.PROTECTED; - } else if (Flags.isPrivate(flags)) { - return VisibilityKind.PRIVATE; - } - - // default - return VisibilityKind.PUBLIC; - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setVisibility(VisibilityKind newVisibility) { - - switch (newVisibility) { - case PUBLIC: - setFlag(Flags.AccPublic, true); - setFlag(Flags.AccProtected, false); - setFlag(Flags.AccPrivate, false); - break; - case PROTECTED: - setFlag(Flags.AccPublic, false); - setFlag(Flags.AccProtected, true); - setFlag(Flags.AccPrivate, false); - break; - case PRIVATE: - setFlag(Flags.AccPublic, false); - setFlag(Flags.AccProtected, false); - setFlag(Flags.AccPrivate, true); - break; - } - } - - /** - * - * - * - * @generated - */ - @Override - public EList getExplicitRequiredImports() { - if (explicitRequiredImports == null) { - explicitRequiredImports = new EObjectResolvingEList(JDTType.class, this, JdtmmPackage.JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS); - } - return explicitRequiredImports; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getExplicitPlainTextRequiredImports() { - if (explicitPlainTextRequiredImports == null) { - explicitPlainTextRequiredImports = new EDataTypeUniqueEList(String.class, this, JdtmmPackage.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); - } - return explicitPlainTextRequiredImports; - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: - return ((InternalEList) (InternalEList) getTypeParameters()).basicAdd(otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: - return ((InternalEList) getTypeParameters()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: - return getTypeParameters(); - case JdtmmPackage.JDT_MEMBER__VISIBILITY: - return getVisibility(); - case JdtmmPackage.JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS: - return getExplicitRequiredImports(); - case JdtmmPackage.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - return getExplicitPlainTextRequiredImports(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: - getTypeParameters().clear(); - getTypeParameters().addAll((Collection) newValue); - return; - case JdtmmPackage.JDT_MEMBER__VISIBILITY: - setVisibility((VisibilityKind) newValue); - return; - case JdtmmPackage.JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS: - getExplicitRequiredImports().clear(); - getExplicitRequiredImports().addAll((Collection) newValue); - return; - case JdtmmPackage.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - getExplicitPlainTextRequiredImports().clear(); - getExplicitPlainTextRequiredImports().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: - getTypeParameters().clear(); - return; - case JdtmmPackage.JDT_MEMBER__VISIBILITY: - setVisibility(VISIBILITY_EDEFAULT); - return; - case JdtmmPackage.JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS: - getExplicitRequiredImports().clear(); - return; - case JdtmmPackage.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - getExplicitPlainTextRequiredImports().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: - return typeParameters != null && !typeParameters.isEmpty(); - case JdtmmPackage.JDT_MEMBER__VISIBILITY: - return getVisibility() != VISIBILITY_EDEFAULT; - case JdtmmPackage.JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS: - return explicitRequiredImports != null && !explicitRequiredImports.isEmpty(); - case JdtmmPackage.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - return explicitPlainTextRequiredImports != null && !explicitPlainTextRequiredImports.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (explicitPlainTextRequiredImports: "); - result.append(explicitPlainTextRequiredImports); - result.append(')'); - return result.toString(); - } - - -} // JDTMemberImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodBodyImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodBodyImpl.java deleted file mode 100644 index 9cc13471a7c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodBodyImpl.java +++ /dev/null @@ -1,232 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * An implementation of the model object 'JDT Method Body'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodBodyImpl#getOwner Owner}
  • - *
- *

- * - * @generated - */ -public abstract class JDTMethodBodyImpl extends EObjectImpl implements JDTMethodBody { - /** - * - * - * - * @generated - */ - protected JDTMethodBodyImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_METHOD_BODY; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTMethod getOwner() { - if (eContainerFeatureID() != JdtmmPackage.JDT_METHOD_BODY__OWNER) { - return null; - } - return (JDTMethod) eContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetOwner(JDTMethod newOwner, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newOwner, JdtmmPackage.JDT_METHOD_BODY__OWNER, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setOwner(JDTMethod newOwner) { - if (newOwner != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_METHOD_BODY__OWNER && newOwner != null)) { - if (EcoreUtil.isAncestor(this, newOwner)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newOwner != null) { - msgs = ((InternalEObject) newOwner).eInverseAdd(this, JdtmmPackage.JDT_METHOD__BODIES, JDTMethod.class, msgs); - } - msgs = basicSetOwner(newOwner, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } - else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_METHOD_BODY__OWNER, newOwner, newOwner)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public String asText() { - // TODO: implement this method - // Ensure that you remove @generated or mark it @generated NOT - throw new UnsupportedOperationException(); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_METHOD_BODY__OWNER: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetOwner((JDTMethod) otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_METHOD_BODY__OWNER: - return basicSetOwner(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case JdtmmPackage.JDT_METHOD_BODY__OWNER: - return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_METHOD__BODIES, JDTMethod.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_METHOD_BODY__OWNER: - return getOwner(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_METHOD_BODY__OWNER: - setOwner((JDTMethod) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_METHOD_BODY__OWNER: - setOwner((JDTMethod) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_METHOD_BODY__OWNER: - return getOwner() != null; - } - return super.eIsSet(featureID); - } - -} // JDTMethodBodyImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodImpl.java deleted file mode 100644 index 59aabb752f5..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodImpl.java +++ /dev/null @@ -1,779 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.Signature; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * An implementation of the model object 'JDT Method'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#getOwner Owner}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#getReturnType Return Type}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#getParameters Parameters}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#isAbstract Abstract}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#isFinal Final}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#isStatic Static}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#getExceptions Exceptions}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#isSynchronized Synchronized}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#isConstructor Constructor}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#getBodies Bodies}
  • - *
- *

- * - * @generated - */ -public class JDTMethodImpl extends JDTMemberImpl implements JDTMethod { - - /** - * The cached value of the '{@link #getReturnType() Return Type}' containment reference. - * - * - * - * @see #getReturnType() - * @generated - * @ordered - */ - protected JDTParameter returnType; - - /** - * The cached value of the '{@link #getParameters() Parameters}' containment reference list. - * - * - * - * @see #getParameters() - * @generated - * @ordered - */ - protected EList parameters; - - /** - * The default value of the '{@link #isAbstract() Abstract}' attribute. - * - * - * - * @see #isAbstract() - * @generated - * @ordered - */ - protected static final boolean ABSTRACT_EDEFAULT = false; - - /** - * The default value of the '{@link #isFinal() Final}' attribute. - * - * - * - * @see #isFinal() - * @generated - * @ordered - */ - protected static final boolean FINAL_EDEFAULT = false; - - /** - * The default value of the '{@link #isStatic() Static}' attribute. - * - * - * - * @see #isStatic() - * @generated - * @ordered - */ - protected static final boolean STATIC_EDEFAULT = false; - - /** - * The cached value of the '{@link #getExceptions() Exceptions}' reference list. - * - * - * - * @see #getExceptions() - * @generated - * @ordered - */ - protected EList exceptions; - - /** - * The default value of the '{@link #isSynchronized() Synchronized}' attribute. - * - * - * - * @see #isSynchronized() - * @generated - * @ordered - */ - protected static final boolean SYNCHRONIZED_EDEFAULT = false; - - /** - * The default value of the '{@link #isConstructor() Constructor}' attribute. - * - * - * - * @see #isConstructor() - * @generated - * @ordered - */ - protected static final boolean CONSTRUCTOR_EDEFAULT = false; - - /** - * The cached value of the '{@link #isConstructor() Constructor}' attribute. - * - * - * - * @see #isConstructor() - * @generated - * @ordered - */ - protected boolean constructor = CONSTRUCTOR_EDEFAULT; - - /** - * The cached value of the '{@link #getBodies() Bodies}' containment reference list. - * - * - * - * @see #getBodies() - * @generated - * @ordered - */ - protected EList bodies; - - /** - * - * - * - * @generated - */ - protected JDTMethodImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_METHOD; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParameter getReturnType() { - return returnType; - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetReturnType(JDTParameter newReturnType, NotificationChain msgs) { - JDTParameter oldReturnType = returnType; - returnType = newReturnType; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_METHOD__RETURN_TYPE, oldReturnType, newReturnType); - if (msgs == null) { - msgs = notification; - } else { - msgs.add(notification); - } - } - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setReturnType(JDTParameter newReturnType) { - if (newReturnType != returnType) { - NotificationChain msgs = null; - if (returnType != null) { - msgs = ((InternalEObject) returnType).eInverseRemove(this, JdtmmPackage.JDT_PARAMETER__RETURN_OWNER, JDTParameter.class, msgs); - } - if (newReturnType != null) { - msgs = ((InternalEObject) newReturnType).eInverseAdd(this, JdtmmPackage.JDT_PARAMETER__RETURN_OWNER, JDTParameter.class, msgs); - } - msgs = basicSetReturnType(newReturnType, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } - else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_METHOD__RETURN_TYPE, newReturnType, newReturnType)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public EList getParameters() { - if (parameters == null) { - parameters = new EObjectContainmentWithInverseEList(JDTParameter.class, this, JdtmmPackage.JDT_METHOD__PARAMETERS, JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER); - } - return parameters; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getExceptions() { - if (exceptions == null) { - exceptions = new EObjectResolvingEList(JDTType.class, this, JdtmmPackage.JDT_METHOD__EXCEPTIONS); - } - return exceptions; - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isSynchronized() { - // Ensure that you remove @generated or mark it @generated NOT - return isFlagSet(Flags.AccSynchronized); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setSynchronized(boolean newSynchronized) { - // Ensure that you remove @generated or mark it @generated NOT - setFlag(Flags.AccSynchronized, newSynchronized); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isConstructor() { - return constructor; - } - - /** - * - * - * - * @generated - */ - @Override - public void setConstructor(boolean newConstructor) { - boolean oldConstructor = constructor; - constructor = newConstructor; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_METHOD__CONSTRUCTOR, oldConstructor, constructor)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public EList getBodies() { - if (bodies == null) { - bodies = new EObjectContainmentWithInverseEList(JDTMethodBody.class, this, JdtmmPackage.JDT_METHOD__BODIES, JdtmmPackage.JDT_METHOD_BODY__OWNER); - } - return bodies; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTType getOwner() { - if (eContainerFeatureID() != JdtmmPackage.JDT_METHOD__OWNER) { - return null; - } - return (JDTType) eContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetOwner(JDTType newOwner, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newOwner, JdtmmPackage.JDT_METHOD__OWNER, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setOwner(JDTType newOwner) { - if (newOwner != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_METHOD__OWNER && newOwner != null)) { - if (EcoreUtil.isAncestor(this, newOwner)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newOwner != null) { - msgs = ((InternalEObject) newOwner).eInverseAdd(this, JdtmmPackage.JDT_TYPE__METHODS, JDTType.class, msgs); - } - msgs = basicSetOwner(newOwner, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } - else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_METHOD__OWNER, newOwner, newOwner)); - } - } - - /** - * - * - * - * @generated - */ - public boolean isSetOwner() { - return getOwner() != null; - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_METHOD__OWNER: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetOwner((JDTType) otherEnd, msgs); - case JdtmmPackage.JDT_METHOD__RETURN_TYPE: - if (returnType != null) { - msgs = ((InternalEObject) returnType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JdtmmPackage.JDT_METHOD__RETURN_TYPE, null, msgs); - } - return basicSetReturnType((JDTParameter) otherEnd, msgs); - case JdtmmPackage.JDT_METHOD__PARAMETERS: - return ((InternalEList) (InternalEList) getParameters()).basicAdd(otherEnd, msgs); - case JdtmmPackage.JDT_METHOD__BODIES: - return ((InternalEList) (InternalEList) getBodies()).basicAdd(otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_METHOD__OWNER: - return basicSetOwner(null, msgs); - case JdtmmPackage.JDT_METHOD__RETURN_TYPE: - return basicSetReturnType(null, msgs); - case JdtmmPackage.JDT_METHOD__PARAMETERS: - return ((InternalEList) getParameters()).basicRemove(otherEnd, msgs); - case JdtmmPackage.JDT_METHOD__BODIES: - return ((InternalEList) getBodies()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case JdtmmPackage.JDT_METHOD__OWNER: - return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_TYPE__METHODS, JDTType.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_METHOD__OWNER: - return getOwner(); - case JdtmmPackage.JDT_METHOD__RETURN_TYPE: - return getReturnType(); - case JdtmmPackage.JDT_METHOD__PARAMETERS: - return getParameters(); - case JdtmmPackage.JDT_METHOD__ABSTRACT: - return isAbstract(); - case JdtmmPackage.JDT_METHOD__FINAL: - return isFinal(); - case JdtmmPackage.JDT_METHOD__STATIC: - return isStatic(); - case JdtmmPackage.JDT_METHOD__EXCEPTIONS: - return getExceptions(); - case JdtmmPackage.JDT_METHOD__SYNCHRONIZED: - return isSynchronized(); - case JdtmmPackage.JDT_METHOD__CONSTRUCTOR: - return isConstructor(); - case JdtmmPackage.JDT_METHOD__BODIES: - return getBodies(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_METHOD__OWNER: - setOwner((JDTType) newValue); - return; - case JdtmmPackage.JDT_METHOD__RETURN_TYPE: - setReturnType((JDTParameter) newValue); - return; - case JdtmmPackage.JDT_METHOD__PARAMETERS: - getParameters().clear(); - getParameters().addAll((Collection) newValue); - return; - case JdtmmPackage.JDT_METHOD__ABSTRACT: - setAbstract((Boolean) newValue); - return; - case JdtmmPackage.JDT_METHOD__FINAL: - setFinal((Boolean) newValue); - return; - case JdtmmPackage.JDT_METHOD__STATIC: - setStatic((Boolean) newValue); - return; - case JdtmmPackage.JDT_METHOD__EXCEPTIONS: - getExceptions().clear(); - getExceptions().addAll((Collection) newValue); - return; - case JdtmmPackage.JDT_METHOD__SYNCHRONIZED: - setSynchronized((Boolean) newValue); - return; - case JdtmmPackage.JDT_METHOD__CONSTRUCTOR: - setConstructor((Boolean) newValue); - return; - case JdtmmPackage.JDT_METHOD__BODIES: - getBodies().clear(); - getBodies().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_METHOD__OWNER: - setOwner((JDTType) null); - return; - case JdtmmPackage.JDT_METHOD__RETURN_TYPE: - setReturnType((JDTParameter) null); - return; - case JdtmmPackage.JDT_METHOD__PARAMETERS: - getParameters().clear(); - return; - case JdtmmPackage.JDT_METHOD__ABSTRACT: - setAbstract(ABSTRACT_EDEFAULT); - return; - case JdtmmPackage.JDT_METHOD__FINAL: - setFinal(FINAL_EDEFAULT); - return; - case JdtmmPackage.JDT_METHOD__STATIC: - setStatic(STATIC_EDEFAULT); - return; - case JdtmmPackage.JDT_METHOD__EXCEPTIONS: - getExceptions().clear(); - return; - case JdtmmPackage.JDT_METHOD__SYNCHRONIZED: - setSynchronized(SYNCHRONIZED_EDEFAULT); - return; - case JdtmmPackage.JDT_METHOD__CONSTRUCTOR: - setConstructor(CONSTRUCTOR_EDEFAULT); - return; - case JdtmmPackage.JDT_METHOD__BODIES: - getBodies().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_METHOD__OWNER: - return isSetOwner(); - case JdtmmPackage.JDT_METHOD__RETURN_TYPE: - return returnType != null; - case JdtmmPackage.JDT_METHOD__PARAMETERS: - return parameters != null && !parameters.isEmpty(); - case JdtmmPackage.JDT_METHOD__ABSTRACT: - return isAbstract() != ABSTRACT_EDEFAULT; - case JdtmmPackage.JDT_METHOD__FINAL: - return isFinal() != FINAL_EDEFAULT; - case JdtmmPackage.JDT_METHOD__STATIC: - return isStatic() != STATIC_EDEFAULT; - case JdtmmPackage.JDT_METHOD__EXCEPTIONS: - return exceptions != null && !exceptions.isEmpty(); - case JdtmmPackage.JDT_METHOD__SYNCHRONIZED: - return isSynchronized() != SYNCHRONIZED_EDEFAULT; - case JdtmmPackage.JDT_METHOD__CONSTRUCTOR: - return constructor != CONSTRUCTOR_EDEFAULT; - case JdtmmPackage.JDT_METHOD__BODIES: - return bodies != null && !bodies.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (constructor: "); - result.append(constructor); - result.append(')'); - return result.toString(); - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParent getParent() { - return getOwner(); - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParent basicGetParent() { - return getOwner(); - } - - /** - * - * - * - * @generated - */ - public boolean isSetParent() { - return false; - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isAbstract() { - // Ensure that you remove @generated or mark it @generated NOT - return isFlagSet(Flags.AccAbstract); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isFinal() { - // Ensure that you remove @generated or mark it @generated NOT - return isFlagSet(Flags.AccFinal); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isStatic() { - return isFlagSet(Flags.AccStatic); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setAbstract(boolean newAbstract) { - // Ensure that you remove @generated or mark it @generated NOT - setFlag(Flags.AccAbstract, newAbstract); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setFinal(boolean newFinal) { - - setFlag(Flags.AccFinal, newFinal); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setStatic(boolean newStatic) { - setFlag(Flags.AccStatic, newStatic); - } - - @Override - public String getJDTSignature() { - List lst = new ArrayList(); - - // signature of parameter - for (JDTParameter p : parameters) { - lst.add(p.getJDTSignature()); - } - - String[] params = new String[lst.size()]; - lst.toArray(params); - - // signature of return - String returnTypeStr = Signature.createTypeSignature("void", false); - if (returnType != null) { - returnTypeStr = returnType.getJDTSignature(); - } - - return Signature.createMethodSignature(params, returnTypeStr); - } - - -} // JDTMethodImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTOpaqueBodyImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTOpaqueBodyImpl.java deleted file mode 100644 index 13f1b15dd2b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTOpaqueBodyImpl.java +++ /dev/null @@ -1,191 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * An implementation of the model object 'JDT Opaque Body'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTOpaqueBodyImpl#get_body body}
  • - *
- *

- * - * @generated - */ -public class JDTOpaqueBodyImpl extends JDTMethodBodyImpl implements JDTOpaqueBody { - /** - * The default value of the '{@link #get_body() body}' attribute. - * - * - * - * @see #get_body() - * @generated - * @ordered - */ - protected static final String _BODY_EDEFAULT = null; - - /** - * The cached value of the '{@link #get_body() body}' attribute. - * - * - * - * @see #get_body() - * @generated - * @ordered - */ - protected String _body = _BODY_EDEFAULT; - - /** - * - * - * - * @generated - */ - protected JDTOpaqueBodyImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_OPAQUE_BODY; - } - - /** - * - * - * - * @generated - */ - @Override - public String get_body() { - return _body; - } - - /** - * - * - * - * @generated - */ - @Override - public void set_body(String new_body) { - String old_body = _body; - _body = new_body; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_OPAQUE_BODY__BODY, old_body, _body)); - } - } - - /** - * - * - * - * @generated NOT - */ - @Override - public String asText() { - return get_body(); - } - - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_OPAQUE_BODY__BODY: - return get_body(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_OPAQUE_BODY__BODY: - set_body((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_OPAQUE_BODY__BODY: - set_body(_BODY_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_OPAQUE_BODY__BODY: - return _BODY_EDEFAULT == null ? _body != null : !_BODY_EDEFAULT.equals(_body); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (_body: "); - result.append(_body); - result.append(')'); - return result.toString(); - } - -} // JDTOpaqueBodyImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentImpl.java deleted file mode 100644 index d3eff0ac3cb..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentImpl.java +++ /dev/null @@ -1,376 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; -import org.eclipse.uml2.common.util.SubsetSupersetEObjectContainmentWithInverseEList; - -/** - * - * An implementation of the model object 'JDT Package Fragment'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl#getChildren Children}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl#getPackageFragmentRoot Package Fragment Root}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl#getCompilationUnits Compilation Units}
  • - *
- *

- * - * @generated - */ -public class JDTPackageFragmentImpl extends JDTParentJavaElementImpl implements JDTPackageFragment { - - /** - * The cached value of the '{@link #getCompilationUnits() Compilation Units}' containment reference list. - * - * - * - * @see #getCompilationUnits() - * @generated - * @ordered - */ - protected EList compilationUnits; - - /** - * - * - * - * @generated - */ - protected JDTPackageFragmentImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getChildren() { - return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_PACKAGE_FRAGMENT__CHILDREN, CHILDREN_ESUBSETS); - } - - /** - * The array of subset feature identifiers for the '{@link #getChildren() Children}' reference list. - * - * - * - * @see #getChildren() - * @generated - * @ordered - */ - protected static final int[] CHILDREN_ESUBSETS = new int[] { JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS }; - - /** - * - * - * - * @generated - */ - @Override - public JDTPackageFragmentRoot getPackageFragmentRoot() { - if (eContainerFeatureID() != JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT) { - return null; - } - return (JDTPackageFragmentRoot) eContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetPackageFragmentRoot(JDTPackageFragmentRoot newPackageFragmentRoot, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newPackageFragmentRoot, JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setPackageFragmentRoot(JDTPackageFragmentRoot newPackageFragmentRoot) { - if (newPackageFragmentRoot != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT && newPackageFragmentRoot != null)) { - if (EcoreUtil.isAncestor(this, newPackageFragmentRoot)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newPackageFragmentRoot != null) { - msgs = ((InternalEObject) newPackageFragmentRoot).eInverseAdd(this, JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS, JDTPackageFragmentRoot.class, msgs); - } - msgs = basicSetPackageFragmentRoot(newPackageFragmentRoot, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } - else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT, newPackageFragmentRoot, newPackageFragmentRoot)); - } - } - - /** - * - * - * - * @generated - */ - public boolean isSetPackageFragmentRoot() { - return getPackageFragmentRoot() != null; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getCompilationUnits() { - if (compilationUnits == null) { - compilationUnits = new SubsetSupersetEObjectContainmentWithInverseEList(JDTCompilationUnit.class, this, JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS, COMPILATION_UNITS_ESUPERSETS, null, - JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT); - } - return compilationUnits; - } - - /** - * The array of superset feature identifiers for the '{@link #getCompilationUnits() Compilation Units}' containment reference list. - * - * - * - * @see #getCompilationUnits() - * @generated - * @ordered - */ - protected static final int[] COMPILATION_UNITS_ESUPERSETS = new int[] { JdtmmPackage.JDT_PACKAGE_FRAGMENT__CHILDREN }; - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetPackageFragmentRoot((JDTPackageFragmentRoot) otherEnd, msgs); - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: - return ((InternalEList) (InternalEList) getCompilationUnits()).basicAdd(otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: - return basicSetPackageFragmentRoot(null, msgs); - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: - return ((InternalEList) getCompilationUnits()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: - return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS, JDTPackageFragmentRoot.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: - return getPackageFragmentRoot(); - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: - return getCompilationUnits(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: - setPackageFragmentRoot((JDTPackageFragmentRoot) newValue); - return; - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: - getCompilationUnits().clear(); - getCompilationUnits().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: - setPackageFragmentRoot((JDTPackageFragmentRoot) null); - return; - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: - getCompilationUnits().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: - return isSetPackageFragmentRoot(); - case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: - return compilationUnits != null && !compilationUnits.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isSetChildren() { - return super.isSetChildren() - || eIsSet(JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS); - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParent getParent() { - return getPackageFragmentRoot(); - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParent basicGetParent() { - return getPackageFragmentRoot(); - } - - /** - * - * - * - * @generated - */ - public boolean isSetParent() { - return false; - } - -} // JDTPackageFragmentImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentRootImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentRootImpl.java deleted file mode 100644 index 07c30c7406f..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentRootImpl.java +++ /dev/null @@ -1,376 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; -import org.eclipse.uml2.common.util.SubsetSupersetEObjectContainmentWithInverseEList; - -/** - * - * An implementation of the model object 'JDT Package Fragment Root'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl#getChildren Children}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl#getJavaProject Java Project}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl#getPackageFragments Package Fragments}
  • - *
- *

- * - * @generated - */ -public class JDTPackageFragmentRootImpl extends JDTParentJavaElementImpl implements JDTPackageFragmentRoot { - - /** - * The cached value of the '{@link #getPackageFragments() Package Fragments}' containment reference list. - * - * - * - * @see #getPackageFragments() - * @generated - * @ordered - */ - protected EList packageFragments; - - /** - * - * - * - * @generated - */ - protected JDTPackageFragmentRootImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getChildren() { - return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__CHILDREN, CHILDREN_ESUBSETS); - } - - /** - * The array of subset feature identifiers for the '{@link #getChildren() Children}' reference list. - * - * - * - * @see #getChildren() - * @generated - * @ordered - */ - protected static final int[] CHILDREN_ESUBSETS = new int[] { JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS }; - - /** - * - * - * - * @generated - */ - @Override - public JDTJavaProject getJavaProject() { - if (eContainerFeatureID() != JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT) { - return null; - } - return (JDTJavaProject) eContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetJavaProject(JDTJavaProject newJavaProject, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newJavaProject, JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setJavaProject(JDTJavaProject newJavaProject) { - if (newJavaProject != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT && newJavaProject != null)) { - if (EcoreUtil.isAncestor(this, newJavaProject)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newJavaProject != null) { - msgs = ((InternalEObject) newJavaProject).eInverseAdd(this, JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS, JDTJavaProject.class, msgs); - } - msgs = basicSetJavaProject(newJavaProject, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } - else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT, newJavaProject, newJavaProject)); - } - } - - /** - * - * - * - * @generated - */ - public boolean isSetJavaProject() { - return getJavaProject() != null; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getPackageFragments() { - if (packageFragments == null) { - packageFragments = new SubsetSupersetEObjectContainmentWithInverseEList(JDTPackageFragment.class, this, JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS, PACKAGE_FRAGMENTS_ESUPERSETS, null, - JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT); - } - return packageFragments; - } - - /** - * The array of superset feature identifiers for the '{@link #getPackageFragments() Package Fragments}' containment reference list. - * - * - * - * @see #getPackageFragments() - * @generated - * @ordered - */ - protected static final int[] PACKAGE_FRAGMENTS_ESUPERSETS = new int[] { JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__CHILDREN }; - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetJavaProject((JDTJavaProject) otherEnd, msgs); - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: - return ((InternalEList) (InternalEList) getPackageFragments()).basicAdd(otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: - return basicSetJavaProject(null, msgs); - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: - return ((InternalEList) getPackageFragments()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: - return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS, JDTJavaProject.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: - return getJavaProject(); - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: - return getPackageFragments(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: - setJavaProject((JDTJavaProject) newValue); - return; - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: - getPackageFragments().clear(); - getPackageFragments().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: - setJavaProject((JDTJavaProject) null); - return; - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: - getPackageFragments().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: - return isSetJavaProject(); - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: - return packageFragments != null && !packageFragments.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isSetChildren() { - return super.isSetChildren() - || eIsSet(JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS); - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParent getParent() { - return getJavaProject(); - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParent basicGetParent() { - return getJavaProject(); - } - - /** - * - * - * - * @generated - */ - public boolean isSetParent() { - return false; - } - -} // JDTPackageFragmentRootImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParameterImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParameterImpl.java deleted file mode 100644 index 587f6e113d2..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParameterImpl.java +++ /dev/null @@ -1,515 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.Signature; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util.JdtmmPreference; - -/** - * - * An implementation of the model object 'JDT Parameter'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl#getParameterOwner Parameter Owner}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl#isFinal Final}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl#isMultiValued Is Multi Valued}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl#getType Type}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl#getReturnOwner Return Owner}
  • - *
- *

- * - * @generated - */ -public class JDTParameterImpl extends JDTMemberImpl implements JDTParameter { - - /** - * The default value of the '{@link #isFinal() Final}' attribute. - * - * - * - * @see #isFinal() - * @generated - * @ordered - */ - protected static final boolean FINAL_EDEFAULT = false; - - /** - * The default value of the '{@link #isMultiValued() Is Multi Valued}' attribute. - * - * - * - * @see #isMultiValued() - * @generated - * @ordered - */ - protected static final boolean IS_MULTI_VALUED_EDEFAULT = false; - - /** - * The cached value of the '{@link #isMultiValued() Is Multi Valued}' attribute. - * - * - * - * @see #isMultiValued() - * @generated - * @ordered - */ - protected boolean isMultiValued = IS_MULTI_VALUED_EDEFAULT; - - /** - * The cached value of the '{@link #getType() Type}' reference. - * - * - * - * @see #getType() - * @generated - * @ordered - */ - protected JDTType type; - - /** - * - * - * - * @generated - */ - protected JDTParameterImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_PARAMETER; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTMethod getParameterOwner() { - if (eContainerFeatureID() != JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER) { - return null; - } - return (JDTMethod) eContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetParameterOwner(JDTMethod newParameterOwner, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newParameterOwner, JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setParameterOwner(JDTMethod newParameterOwner) { - if (newParameterOwner != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER && newParameterOwner != null)) { - if (EcoreUtil.isAncestor(this, newParameterOwner)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newParameterOwner != null) { - msgs = ((InternalEObject) newParameterOwner).eInverseAdd(this, JdtmmPackage.JDT_METHOD__PARAMETERS, JDTMethod.class, msgs); - } - msgs = basicSetParameterOwner(newParameterOwner, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } - else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER, newParameterOwner, newParameterOwner)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isMultiValued() { - return isMultiValued; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsMultiValued(boolean newIsMultiValued) { - boolean oldIsMultiValued = isMultiValued; - isMultiValued = newIsMultiValued; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PARAMETER__IS_MULTI_VALUED, oldIsMultiValued, isMultiValued)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public JDTType getType() { - if (type != null && type.eIsProxy()) { - InternalEObject oldType = (InternalEObject) type; - type = (JDTType) eResolveProxy(oldType); - if (type != oldType) { - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.RESOLVE, JdtmmPackage.JDT_PARAMETER__TYPE, oldType, type)); - } - } - } - return type; - } - - /** - * - * - * - * @generated - */ - public JDTType basicGetType() { - return type; - } - - /** - * - * - * - * @generated - */ - @Override - public void setType(JDTType newType) { - JDTType oldType = type; - type = newType; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PARAMETER__TYPE, oldType, type)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public JDTMethod getReturnOwner() { - if (eContainerFeatureID() != JdtmmPackage.JDT_PARAMETER__RETURN_OWNER) { - return null; - } - return (JDTMethod) eContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetReturnOwner(JDTMethod newReturnOwner, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newReturnOwner, JdtmmPackage.JDT_PARAMETER__RETURN_OWNER, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setReturnOwner(JDTMethod newReturnOwner) { - if (newReturnOwner != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_PARAMETER__RETURN_OWNER && newReturnOwner != null)) { - if (EcoreUtil.isAncestor(this, newReturnOwner)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newReturnOwner != null) { - msgs = ((InternalEObject) newReturnOwner).eInverseAdd(this, JdtmmPackage.JDT_METHOD__RETURN_TYPE, JDTMethod.class, msgs); - } - msgs = basicSetReturnOwner(newReturnOwner, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } - else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PARAMETER__RETURN_OWNER, newReturnOwner, newReturnOwner)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetParameterOwner((JDTMethod) otherEnd, msgs); - case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetReturnOwner((JDTMethod) otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: - return basicSetParameterOwner(null, msgs); - case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: - return basicSetReturnOwner(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: - return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_METHOD__PARAMETERS, JDTMethod.class, msgs); - case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: - return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_METHOD__RETURN_TYPE, JDTMethod.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: - return getParameterOwner(); - case JdtmmPackage.JDT_PARAMETER__FINAL: - return isFinal(); - case JdtmmPackage.JDT_PARAMETER__IS_MULTI_VALUED: - return isMultiValued(); - case JdtmmPackage.JDT_PARAMETER__TYPE: - if (resolve) { - return getType(); - } - return basicGetType(); - case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: - return getReturnOwner(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: - setParameterOwner((JDTMethod) newValue); - return; - case JdtmmPackage.JDT_PARAMETER__FINAL: - setFinal((Boolean) newValue); - return; - case JdtmmPackage.JDT_PARAMETER__IS_MULTI_VALUED: - setIsMultiValued((Boolean) newValue); - return; - case JdtmmPackage.JDT_PARAMETER__TYPE: - setType((JDTType) newValue); - return; - case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: - setReturnOwner((JDTMethod) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: - setParameterOwner((JDTMethod) null); - return; - case JdtmmPackage.JDT_PARAMETER__FINAL: - setFinal(FINAL_EDEFAULT); - return; - case JdtmmPackage.JDT_PARAMETER__IS_MULTI_VALUED: - setIsMultiValued(IS_MULTI_VALUED_EDEFAULT); - return; - case JdtmmPackage.JDT_PARAMETER__TYPE: - setType((JDTType) null); - return; - case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: - setReturnOwner((JDTMethod) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: - return getParameterOwner() != null; - case JdtmmPackage.JDT_PARAMETER__FINAL: - return isFinal() != FINAL_EDEFAULT; - case JdtmmPackage.JDT_PARAMETER__IS_MULTI_VALUED: - return isMultiValued != IS_MULTI_VALUED_EDEFAULT; - case JdtmmPackage.JDT_PARAMETER__TYPE: - return type != null; - case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: - return getReturnOwner() != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (isMultiValued: "); - result.append(isMultiValued); - result.append(')'); - return result.toString(); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isFinal() { - // TODO: implement this method to return the 'Final' attribute - // Ensure that you remove @generated or mark it @generated NOT - return isFlagSet(Flags.AccFinal); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setFinal(boolean newFinal) { - - setFlag(Flags.AccFinal, newFinal); - } - - @Override - public String getJDTSignature() { - if (this.isMultiValued()) { - return Signature.createTypeSignature(JdtmmPreference.getMultiValued(type.getElementName()), false); - } - return type.getJDTSignature(); - } -} // JDTParameterImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentImpl.java deleted file mode 100644 index 6307b67f243..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentImpl.java +++ /dev/null @@ -1,254 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; - -/** - * - * An implementation of the model object 'JDT Parent'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentImpl#getChildren Children}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentImpl#getFlags Flags}
  • - *
- *

- * - * @generated - */ -public abstract class JDTParentImpl extends EObjectImpl implements JDTParent { - - /** - * The default value of the '{@link #getFlags() Flags}' attribute. - * - * - * - * @see #getFlags() - * @generated - * @ordered - */ - protected static final int FLAGS_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getFlags() Flags}' attribute. - * - * - * - * @see #getFlags() - * @generated - * @ordered - */ - protected int flags = FLAGS_EDEFAULT; - - /** - * - * - * - * @generated - */ - protected JDTParentImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_PARENT; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getChildren() { - return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_PARENT__CHILDREN, null); - } - - /** - * - * - * - * @generated - */ - @Override - public int getFlags() { - return flags; - } - - /** - * - * - * - * @generated - */ - @Override - public void setFlags(int newFlags) { - int oldFlags = flags; - flags = newFlags; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PARENT__FLAGS, oldFlags, flags)); - } - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setFlag(int flag, boolean value) { - - if (value == true) { - setFlags(getFlags() | (flag)); - } else { - setFlags(getFlags() & ~(flag)); - } - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isFlagSet(int flag) { - - return (getFlags() & flag) != 0; - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_PARENT__CHILDREN: - return getChildren(); - case JdtmmPackage.JDT_PARENT__FLAGS: - return getFlags(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_PARENT__FLAGS: - setFlags((Integer) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_PARENT__FLAGS: - setFlags(FLAGS_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_PARENT__CHILDREN: - return isSetChildren(); - case JdtmmPackage.JDT_PARENT__FLAGS: - return flags != FLAGS_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (flags: "); - result.append(flags); - result.append(')'); - return result.toString(); - } - - /** - * - * - * - * @generated - */ - public boolean isSetChildren() { - return false; - } - -} // JDTParentImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentJavaElementImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentJavaElementImpl.java deleted file mode 100644 index 7a45658d162..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentJavaElementImpl.java +++ /dev/null @@ -1,296 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; - -/** - * - * An implementation of the model object 'JDT Parent Java Element'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentJavaElementImpl#getChildren Children}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentJavaElementImpl#getFlags Flags}
  • - *
- *

- * - * @generated - */ -public abstract class JDTParentJavaElementImpl extends JDTJavaElementImpl implements JDTParentJavaElement { - - /** - * The default value of the '{@link #getFlags() Flags}' attribute. - * - * - * - * @see #getFlags() - * @generated - * @ordered - */ - protected static final int FLAGS_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getFlags() Flags}' attribute. - * - * - * - * @see #getFlags() - * @generated - * @ordered - */ - protected int flags = FLAGS_EDEFAULT; - - /** - * - * - * - * @generated - */ - protected JDTParentJavaElementImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_PARENT_JAVA_ELEMENT; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getChildren() { - return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__CHILDREN, null); - } - - /** - * - * - * - * @generated - */ - @Override - public int getFlags() { - return flags; - } - - /** - * - * - * - * @generated - */ - @Override - public void setFlags(int newFlags) { - int oldFlags = flags; - flags = newFlags; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS, oldFlags, flags)); - } - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setFlag(int flag, boolean value) { - - if (value == true) { - setFlags(getFlags() | (flag)); - } else { - setFlags(getFlags() & ~(flag)); - } - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isFlagSet(int flag) { - - return (getFlags() & flag) != 0; - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__CHILDREN: - return getChildren(); - case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS: - return getFlags(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS: - setFlags((Integer) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS: - setFlags(FLAGS_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__CHILDREN: - return isSetChildren(); - case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS: - return flags != FLAGS_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { - if (baseClass == JDTParent.class) { - switch (derivedFeatureID) { - case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__CHILDREN: - return JdtmmPackage.JDT_PARENT__CHILDREN; - case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS: - return JdtmmPackage.JDT_PARENT__FLAGS; - default: - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * - * - * - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { - if (baseClass == JDTParent.class) { - switch (baseFeatureID) { - case JdtmmPackage.JDT_PARENT__CHILDREN: - return JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__CHILDREN; - case JdtmmPackage.JDT_PARENT__FLAGS: - return JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS; - default: - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (flags: "); - result.append(flags); - result.append(')'); - return result.toString(); - } - - /** - * - * - * - * @generated - */ - public boolean isSetChildren() { - return false; - } - -} // JDTParentJavaElementImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeImpl.java deleted file mode 100644 index 554572a55be..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeImpl.java +++ /dev/null @@ -1,1117 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.notify.NotifyingList; -import org.eclipse.emf.common.util.ECollections; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.Signature; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.utils.DerivedNotifyingEList; -import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; -import org.eclipse.uml2.common.util.SubsetSupersetEObjectContainmentWithInverseEList; - -/** - * - * An implementation of the model object 'JDT Type'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getChildren Children}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getMethods Methods}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getFields Fields}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getCompilationUnit Compilation Unit}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#isClass Class}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#isInterface Interface}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#isEnum Enum}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#isAbstract Abstract}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#isFinal Final}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#isStatic Static}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getTypes Types}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getOwner Owner}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getSuperInterfaces Super Interfaces}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getSuperClass Super Class}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getSuperInterfaceNames Super Interface Names}
  • - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getSuperClassName Super Class Name}
  • - *
- *

- * - * @generated - */ -public abstract class JDTTypeImpl extends JDTMemberImpl implements JDTType { - - /** - * The cached value of the '{@link #getMethods() Methods}' containment reference list. - * - * - * - * @see #getMethods() - * @generated - * @ordered - */ - protected EList methods; - - /** - * The cached value of the '{@link #getFields() Fields}' containment reference list. - * - * - * - * @see #getFields() - * @generated - * @ordered - */ - protected EList fields; - - /** - * The default value of the '{@link #isClass() Class}' attribute. - * - * - * - * @see #isClass() - * @generated - * @ordered - */ - protected static final boolean CLASS_EDEFAULT = false; - - /** - * The cached value of the '{@link #isClass() Class}' attribute. - * - * - * - * @see #isClass() - * @generated - * @ordered - */ - protected boolean class_ = CLASS_EDEFAULT; - - /** - * The default value of the '{@link #isInterface() Interface}' attribute. - * - * - * - * @see #isInterface() - * @generated - * @ordered - */ - protected static final boolean INTERFACE_EDEFAULT = false; - - /** - * The cached value of the '{@link #isInterface() Interface}' attribute. - * - * - * - * @see #isInterface() - * @generated - * @ordered - */ - protected boolean interface_ = INTERFACE_EDEFAULT; - - /** - * The default value of the '{@link #isEnum() Enum}' attribute. - * - * - * - * @see #isEnum() - * @generated - * @ordered - */ - protected static final boolean ENUM_EDEFAULT = false; - - /** - * The cached value of the '{@link #isEnum() Enum}' attribute. - * - * - * - * @see #isEnum() - * @generated - * @ordered - */ - protected boolean enum_ = ENUM_EDEFAULT; - - /** - * The default value of the '{@link #isAbstract() Abstract}' attribute. - * - * - * - * @see #isAbstract() - * @generated - * @ordered - */ - protected static final boolean ABSTRACT_EDEFAULT = false; - - /** - * The default value of the '{@link #isFinal() Final}' attribute. - * - * - * - * @see #isFinal() - * @generated - * @ordered - */ - protected static final boolean FINAL_EDEFAULT = false; - - /** - * The default value of the '{@link #isStatic() Static}' attribute. - * - * - * - * @see #isStatic() - * @generated - * @ordered - */ - protected static final boolean STATIC_EDEFAULT = false; - - /** - * The cached value of the '{@link #getTypes() Types}' containment reference list. - * - * - * - * @see #getTypes() - * @generated - * @ordered - */ - protected EList types; - - /** - * The cached value of the '{@link #getSuperInterfaces() Super Interfaces}' reference list. - * - * - * - * @see #getSuperInterfaces() - * @generated - * @ordered - */ - protected EList superInterfaces; - - /** - * The cached value of the '{@link #getSuperClass() Super Class}' reference. - * - * - * - * @see #getSuperClass() - * @generated - * @ordered - */ - protected JDTType superClass; - - /** - * The default value of the '{@link #getSuperClassName() Super Class Name}' attribute. - * - * - * - * @see #getSuperClassName() - * @generated - * @ordered - */ - protected static final String SUPER_CLASS_NAME_EDEFAULT = null; - - /** - * - * - * - * @generated - */ - protected JDTTypeImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_TYPE; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getChildren() { - return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_TYPE__CHILDREN, CHILDREN_ESUBSETS); - } - - /** - * The array of subset feature identifiers for the '{@link #getChildren() Children}' reference list. - * - * - * - * @see #getChildren() - * @generated - * @ordered - */ - protected static final int[] CHILDREN_ESUBSETS = new int[] { JdtmmPackage.JDT_TYPE__METHODS, JdtmmPackage.JDT_TYPE__FIELDS, JdtmmPackage.JDT_TYPE__TYPES }; - - /** - * - * - * - * @generated - */ - @Override - public EList getMethods() { - if (methods == null) { - methods = new SubsetSupersetEObjectContainmentWithInverseEList(JDTMethod.class, this, JdtmmPackage.JDT_TYPE__METHODS, METHODS_ESUPERSETS, null, JdtmmPackage.JDT_METHOD__OWNER); - } - return methods; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTCompilationUnit getCompilationUnit() { - if (eContainerFeatureID() != JdtmmPackage.JDT_TYPE__COMPILATION_UNIT) { - return null; - } - return (JDTCompilationUnit) eContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetCompilationUnit(JDTCompilationUnit newCompilationUnit, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newCompilationUnit, JdtmmPackage.JDT_TYPE__COMPILATION_UNIT, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setCompilationUnit(JDTCompilationUnit newCompilationUnit) { - if (newCompilationUnit != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_TYPE__COMPILATION_UNIT && newCompilationUnit != null)) { - if (EcoreUtil.isAncestor(this, newCompilationUnit)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newCompilationUnit != null) { - msgs = ((InternalEObject) newCompilationUnit).eInverseAdd(this, JdtmmPackage.JDT_COMPILATION_UNIT__TYPES, JDTCompilationUnit.class, msgs); - } - msgs = basicSetCompilationUnit(newCompilationUnit, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } - else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE__COMPILATION_UNIT, newCompilationUnit, newCompilationUnit)); - } - } - - /** - * - * - * - * @generated - */ - public boolean isSetCompilationUnit() { - return getCompilationUnit() != null; - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isClass() { - return class_; - } - - /** - * - * - * - * @generated - */ - @Override - public void setClass_(boolean newClass) { - boolean oldClass = class_; - class_ = newClass; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE__CLASS, oldClass, class_)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isInterface() { - return interface_; - } - - /** - * - * - * - * @generated - */ - @Override - public void setInterface(boolean newInterface) { - boolean oldInterface = interface_; - interface_ = newInterface; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE__INTERFACE, oldInterface, interface_)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isEnum() { - return enum_; - } - - /** - * - * - * - * @generated - */ - @Override - public void setEnum(boolean newEnum) { - boolean oldEnum = enum_; - enum_ = newEnum; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE__ENUM, oldEnum, enum_)); - } - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isAbstract() { - // Ensure that you remove @generated or mark it @generated NOT - return isFlagSet(Flags.AccAbstract); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setAbstract(boolean newAbstract) { - // Ensure that you remove @generated or mark it @generated NOT - setFlag(Flags.AccAbstract, newAbstract); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isFinal() { - // TODO: implement this method to return the 'Final' attribute - // Ensure that you remove @generated or mark it @generated NOT - return isFlagSet(Flags.AccFinal); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setFinal(boolean newFinal) { - - setFlag(Flags.AccFinal, newFinal); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isStatic() { - return isFlagSet(Flags.AccStatic); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setStatic(boolean newStatic) { - setFlag(Flags.AccStatic, newStatic); - } - - /** - * - * - * - * @generated - */ - @Override - public EList getTypes() { - if (types == null) { - types = new SubsetSupersetEObjectContainmentWithInverseEList(JDTType.class, this, JdtmmPackage.JDT_TYPE__TYPES, TYPES_ESUPERSETS, null, JdtmmPackage.JDT_TYPE__OWNER); - } - return types; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTType getOwner() { - if (eContainerFeatureID() != JdtmmPackage.JDT_TYPE__OWNER) { - return null; - } - return (JDTType) eContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetOwner(JDTType newOwner, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newOwner, JdtmmPackage.JDT_TYPE__OWNER, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setOwner(JDTType newOwner) { - if (newOwner != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_TYPE__OWNER && newOwner != null)) { - if (EcoreUtil.isAncestor(this, newOwner)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newOwner != null) { - msgs = ((InternalEObject) newOwner).eInverseAdd(this, JdtmmPackage.JDT_TYPE__TYPES, JDTType.class, msgs); - } - msgs = basicSetOwner(newOwner, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } - else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE__OWNER, newOwner, newOwner)); - } - } - - /** - * - * - * - * @generated - */ - public boolean isSetOwner() { - return getOwner() != null; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getSuperInterfaces() { - if (superInterfaces == null) { - superInterfaces = new EObjectResolvingEList(JDTType.class, this, JdtmmPackage.JDT_TYPE__SUPER_INTERFACES); - } - return superInterfaces; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTType getSuperClass() { - if (superClass != null && superClass.eIsProxy()) { - InternalEObject oldSuperClass = (InternalEObject) superClass; - superClass = (JDTType) eResolveProxy(oldSuperClass); - if (superClass != oldSuperClass) { - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.RESOLVE, JdtmmPackage.JDT_TYPE__SUPER_CLASS, oldSuperClass, superClass)); - } - } - } - return superClass; - } - - /** - * - * - * - * @generated - */ - public JDTType basicGetSuperClass() { - return superClass; - } - - /** - * - * - * - * @generated - */ - @Override - public void setSuperClass(JDTType newSuperClass) { - JDTType oldSuperClass = superClass; - superClass = newSuperClass; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE__SUPER_CLASS, oldSuperClass, superClass)); - } - } - - - DerivedNotifyingEList superInterfaceNames; - - /** - * Returns the names of interfaces that this type implements or extends, - * in the order in which they are listed in the source. - *

- * For classes, this gives the interfaces that this class implements. For interfaces, this gives the interfaces that this interface extends. An empty collection is returned if this type does not implement or extend any interfaces. * - * - * - * @generated NOT - */ - @Override - public EList getSuperInterfaceNames() { - // TODO: implement this method to return the 'Super Interface Names' attribute list - // Ensure that you remove @generated or mark it @generated NOT - - // Return empty collection if there is nothing - if (getSuperInterfaces().size() == 0) { - return ECollections.emptyEList(); - } - - if (superInterfaceNames == null) { - // Create a derived list that return the names instead of the original elements. - superInterfaceNames = new DerivedNotifyingEList((NotifyingList) getSuperInterfaces()) { - - /** - * Return the name of the JDTtype. - */ - @Override - protected String doGet(int index) { - return getBackupList().get(index).getElementName(); - } - }; - } - - return superInterfaceNames; - } - - - - /** - * Returns the name of this type's superclass, or null for source types that do not specify a superclass. - * - * - * - * @generated NOT - */ - @Override - public String getSuperClassName() { - // TODO: implement this method to return the 'Super Class Name' attribute - // Ensure that you remove @generated or mark it @generated NOT - if (getSuperClass() != null) { - return getSuperClass().getElementName(); - } - // No superclass - return null; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getFields() { - if (fields == null) { - fields = new SubsetSupersetEObjectContainmentWithInverseEList(JDTField.class, this, JdtmmPackage.JDT_TYPE__FIELDS, FIELDS_ESUPERSETS, null, JdtmmPackage.JDT_FIELD__OWNER); - } - return fields; - } - - /** - * The array of superset feature identifiers for the '{@link #getMethods() Methods}' containment reference list. - * - * - * - * @see #getMethods() - * @generated - * @ordered - */ - protected static final int[] METHODS_ESUPERSETS = new int[] { JdtmmPackage.JDT_TYPE__CHILDREN }; - - /** - * The array of superset feature identifiers for the '{@link #getFields() Fields}' containment reference list. - * - * - * - * @see #getFields() - * @generated - * @ordered - */ - protected static final int[] FIELDS_ESUPERSETS = new int[] { JdtmmPackage.JDT_TYPE__CHILDREN }; - - /** - * The array of superset feature identifiers for the '{@link #getTypes() Types}' containment reference list. - * - * - * - * @see #getTypes() - * @generated - * @ordered - */ - protected static final int[] TYPES_ESUPERSETS = new int[] { JdtmmPackage.JDT_TYPE__CHILDREN }; - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_TYPE__METHODS: - return ((InternalEList) (InternalEList) getMethods()).basicAdd(otherEnd, msgs); - case JdtmmPackage.JDT_TYPE__FIELDS: - return ((InternalEList) (InternalEList) getFields()).basicAdd(otherEnd, msgs); - case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetCompilationUnit((JDTCompilationUnit) otherEnd, msgs); - case JdtmmPackage.JDT_TYPE__TYPES: - return ((InternalEList) (InternalEList) getTypes()).basicAdd(otherEnd, msgs); - case JdtmmPackage.JDT_TYPE__OWNER: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetOwner((JDTType) otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_TYPE__METHODS: - return ((InternalEList) getMethods()).basicRemove(otherEnd, msgs); - case JdtmmPackage.JDT_TYPE__FIELDS: - return ((InternalEList) getFields()).basicRemove(otherEnd, msgs); - case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: - return basicSetCompilationUnit(null, msgs); - case JdtmmPackage.JDT_TYPE__TYPES: - return ((InternalEList) getTypes()).basicRemove(otherEnd, msgs); - case JdtmmPackage.JDT_TYPE__OWNER: - return basicSetOwner(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: - return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_COMPILATION_UNIT__TYPES, JDTCompilationUnit.class, msgs); - case JdtmmPackage.JDT_TYPE__OWNER: - return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_TYPE__TYPES, JDTType.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_TYPE__METHODS: - return getMethods(); - case JdtmmPackage.JDT_TYPE__FIELDS: - return getFields(); - case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: - return getCompilationUnit(); - case JdtmmPackage.JDT_TYPE__CLASS: - return isClass(); - case JdtmmPackage.JDT_TYPE__INTERFACE: - return isInterface(); - case JdtmmPackage.JDT_TYPE__ENUM: - return isEnum(); - case JdtmmPackage.JDT_TYPE__ABSTRACT: - return isAbstract(); - case JdtmmPackage.JDT_TYPE__FINAL: - return isFinal(); - case JdtmmPackage.JDT_TYPE__STATIC: - return isStatic(); - case JdtmmPackage.JDT_TYPE__TYPES: - return getTypes(); - case JdtmmPackage.JDT_TYPE__OWNER: - return getOwner(); - case JdtmmPackage.JDT_TYPE__SUPER_INTERFACES: - return getSuperInterfaces(); - case JdtmmPackage.JDT_TYPE__SUPER_CLASS: - if (resolve) { - return getSuperClass(); - } - return basicGetSuperClass(); - case JdtmmPackage.JDT_TYPE__SUPER_INTERFACE_NAMES: - return getSuperInterfaceNames(); - case JdtmmPackage.JDT_TYPE__SUPER_CLASS_NAME: - return getSuperClassName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_TYPE__METHODS: - getMethods().clear(); - getMethods().addAll((Collection) newValue); - return; - case JdtmmPackage.JDT_TYPE__FIELDS: - getFields().clear(); - getFields().addAll((Collection) newValue); - return; - case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: - setCompilationUnit((JDTCompilationUnit) newValue); - return; - case JdtmmPackage.JDT_TYPE__CLASS: - setClass_((Boolean) newValue); - return; - case JdtmmPackage.JDT_TYPE__INTERFACE: - setInterface((Boolean) newValue); - return; - case JdtmmPackage.JDT_TYPE__ENUM: - setEnum((Boolean) newValue); - return; - case JdtmmPackage.JDT_TYPE__ABSTRACT: - setAbstract((Boolean) newValue); - return; - case JdtmmPackage.JDT_TYPE__FINAL: - setFinal((Boolean) newValue); - return; - case JdtmmPackage.JDT_TYPE__STATIC: - setStatic((Boolean) newValue); - return; - case JdtmmPackage.JDT_TYPE__TYPES: - getTypes().clear(); - getTypes().addAll((Collection) newValue); - return; - case JdtmmPackage.JDT_TYPE__OWNER: - setOwner((JDTType) newValue); - return; - case JdtmmPackage.JDT_TYPE__SUPER_INTERFACES: - getSuperInterfaces().clear(); - getSuperInterfaces().addAll((Collection) newValue); - return; - case JdtmmPackage.JDT_TYPE__SUPER_CLASS: - setSuperClass((JDTType) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_TYPE__METHODS: - getMethods().clear(); - return; - case JdtmmPackage.JDT_TYPE__FIELDS: - getFields().clear(); - return; - case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: - setCompilationUnit((JDTCompilationUnit) null); - return; - case JdtmmPackage.JDT_TYPE__CLASS: - setClass_(CLASS_EDEFAULT); - return; - case JdtmmPackage.JDT_TYPE__INTERFACE: - setInterface(INTERFACE_EDEFAULT); - return; - case JdtmmPackage.JDT_TYPE__ENUM: - setEnum(ENUM_EDEFAULT); - return; - case JdtmmPackage.JDT_TYPE__ABSTRACT: - setAbstract(ABSTRACT_EDEFAULT); - return; - case JdtmmPackage.JDT_TYPE__FINAL: - setFinal(FINAL_EDEFAULT); - return; - case JdtmmPackage.JDT_TYPE__STATIC: - setStatic(STATIC_EDEFAULT); - return; - case JdtmmPackage.JDT_TYPE__TYPES: - getTypes().clear(); - return; - case JdtmmPackage.JDT_TYPE__OWNER: - setOwner((JDTType) null); - return; - case JdtmmPackage.JDT_TYPE__SUPER_INTERFACES: - getSuperInterfaces().clear(); - return; - case JdtmmPackage.JDT_TYPE__SUPER_CLASS: - setSuperClass((JDTType) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_TYPE__METHODS: - return methods != null && !methods.isEmpty(); - case JdtmmPackage.JDT_TYPE__FIELDS: - return fields != null && !fields.isEmpty(); - case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: - return isSetCompilationUnit(); - case JdtmmPackage.JDT_TYPE__CLASS: - return class_ != CLASS_EDEFAULT; - case JdtmmPackage.JDT_TYPE__INTERFACE: - return interface_ != INTERFACE_EDEFAULT; - case JdtmmPackage.JDT_TYPE__ENUM: - return enum_ != ENUM_EDEFAULT; - case JdtmmPackage.JDT_TYPE__ABSTRACT: - return isAbstract() != ABSTRACT_EDEFAULT; - case JdtmmPackage.JDT_TYPE__FINAL: - return isFinal() != FINAL_EDEFAULT; - case JdtmmPackage.JDT_TYPE__STATIC: - return isStatic() != STATIC_EDEFAULT; - case JdtmmPackage.JDT_TYPE__TYPES: - return types != null && !types.isEmpty(); - case JdtmmPackage.JDT_TYPE__OWNER: - return isSetOwner(); - case JdtmmPackage.JDT_TYPE__SUPER_INTERFACES: - return superInterfaces != null && !superInterfaces.isEmpty(); - case JdtmmPackage.JDT_TYPE__SUPER_CLASS: - return superClass != null; - case JdtmmPackage.JDT_TYPE__SUPER_INTERFACE_NAMES: - return !getSuperInterfaceNames().isEmpty(); - case JdtmmPackage.JDT_TYPE__SUPER_CLASS_NAME: - return SUPER_CLASS_NAME_EDEFAULT == null ? getSuperClassName() != null : !SUPER_CLASS_NAME_EDEFAULT.equals(getSuperClassName()); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (class: "); - result.append(class_); - result.append(", interface: "); - result.append(interface_); - result.append(", enum: "); - result.append(enum_); - result.append(')'); - return result.toString(); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isSetChildren() { - return super.isSetChildren() - || eIsSet(JdtmmPackage.JDT_TYPE__METHODS) - || eIsSet(JdtmmPackage.JDT_TYPE__FIELDS) - || eIsSet(JdtmmPackage.JDT_TYPE__TYPES); - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParent getParent() { - return getCompilationUnit(); - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParent basicGetParent() { - return getCompilationUnit(); - } - - /** - * - * - * - * @generated - */ - public boolean isSetParent() { - return false; - } - - @Override - public String getJDTSignature() { - return Signature.createTypeSignature(getElementName(), false); - } - - @Override - public String getQualifiedName() { - // if it's a intern class, it's special - if (getOwner() != null) { - return getOwner().getQualifiedName() + "." + getElementName(); - } - - // else, return the qualified name of the package + "." + the name of the type - if (getCompilationUnit().getPackageFragment() == null) { - return getElementName(); - } - if (getCompilationUnit().getPackageFragment().getQualifiedName() == null) { - return getElementName(); - } - return getCompilationUnit().getPackageFragment().getQualifiedName() + "." + getElementName(); - } -} // JDTTypeImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeParameterImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeParameterImpl.java deleted file mode 100644 index 0f11bdd4e26..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeParameterImpl.java +++ /dev/null @@ -1,235 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * An implementation of the model object 'JDT Type Parameter'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeParameterImpl#getDeclaringMember Declaring Member}
  • - *
- *

- * - * @generated - */ -public class JDTTypeParameterImpl extends JDTJavaElementImpl implements JDTTypeParameter { - - /** - * - * - * - * @generated - */ - protected JDTTypeParameterImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_TYPE_PARAMETER; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTMember getDeclaringMember() { - if (eContainerFeatureID() != JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER) { - return null; - } - return (JDTMember) eContainer(); - } - - /** - * - * - * - * @generated - */ - public NotificationChain basicSetDeclaringMember(JDTMember newDeclaringMember, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject) newDeclaringMember, JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER, msgs); - return msgs; - } - - /** - * - * - * - * @generated - */ - @Override - public void setDeclaringMember(JDTMember newDeclaringMember) { - if (newDeclaringMember != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER && newDeclaringMember != null)) { - if (EcoreUtil.isAncestor(this, newDeclaringMember)) { - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - } - NotificationChain msgs = null; - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - if (newDeclaringMember != null) { - msgs = ((InternalEObject) newDeclaringMember).eInverseAdd(this, JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS, JDTMember.class, msgs); - } - msgs = basicSetDeclaringMember(newDeclaringMember, msgs); - if (msgs != null) { - msgs.dispatch(); - } - } - else if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER, newDeclaringMember, newDeclaringMember)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: - if (eInternalContainer() != null) { - msgs = eBasicRemoveFromContainer(msgs); - } - return basicSetDeclaringMember((JDTMember) otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: - return basicSetDeclaringMember(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: - return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS, JDTMember.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: - return getDeclaringMember(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: - setDeclaringMember((JDTMember) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: - setDeclaringMember((JDTMember) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: - return getDeclaringMember() != null; - } - return super.eIsSet(featureID); - } - -} // JDTTypeParameterImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeRootImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeRootImpl.java deleted file mode 100644 index feab7e6748f..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeRootImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * An implementation of the model object 'JDT Type Root'. - * - *

- *

- * - * @generated - */ -public abstract class JDTTypeRootImpl extends JDTParentJavaElementImpl implements JDTTypeRoot { - - /** - * - * - * - * @generated - */ - protected JDTTypeRootImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JdtmmPackage.Literals.JDT_TYPE_ROOT; - } - -} // JDTTypeRootImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmFactoryImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmFactoryImpl.java deleted file mode 100644 index 9a567bb769e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmFactoryImpl.java +++ /dev/null @@ -1,558 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.impl.EFactoryImpl; -import org.eclipse.emf.ecore.plugin.EcorePlugin; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; - -/** - * - * An implementation of the model Factory. - * - * - * @generated - */ -public class JdtmmFactoryImpl extends EFactoryImpl implements JdtmmFactory { - - /** - * Creates the default factory implementation. - * - * - * - * @generated - */ - public static JdtmmFactory init() { - try { - JdtmmFactory theJdtmmFactory = (JdtmmFactory) EPackage.Registry.INSTANCE.getEFactory("http:///jdtmm.ecore"); - if (theJdtmmFactory != null) { - return theJdtmmFactory; - } - } catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new JdtmmFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * - * @generated - */ - public JdtmmFactoryImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case JdtmmPackage.JDT_METHOD: - return createJDTMethod(); - case JdtmmPackage.JDT_TYPE_PARAMETER: - return createJDTTypeParameter(); - case JdtmmPackage.JDT_FIELD: - return createJDTField(); - case JdtmmPackage.JDT_COMPILATION_UNIT: - return createJDTCompilationUnit(); - case JdtmmPackage.JDT_PACKAGE_FRAGMENT: - return createJDTPackageFragment(); - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT: - return createJDTPackageFragmentRoot(); - case JdtmmPackage.JDT_JAVA_PROJECT: - return createJDTJavaProject(); - case JdtmmPackage.JDT_JAVA_MODEL: - return createJDTJavaModel(); - case JdtmmPackage.JDT_PARAMETER: - return createJDTParameter(); - case JdtmmPackage.JDT_CLASS: - return createJDTClass(); - case JdtmmPackage.JDT_INTERFACE: - return createJDTInterface(); - case JdtmmPackage.JDT_ENUM: - return createJDTEnum(); - case JdtmmPackage.JDT_IMPORT_DECLARATION: - return createJDTImportDeclaration(); - case JdtmmPackage.JDT_IMPORT_CONTAINER: - return createJDTImportContainer(); - case JdtmmPackage.JDT_EXCEPTION: - return createJDTException(); - case JdtmmPackage.JDT_OPAQUE_BODY: - return createJDTOpaqueBody(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Object createFromString(EDataType eDataType, String initialValue) { - switch (eDataType.getClassifierID()) { - case JdtmmPackage.VISIBILITY_KIND: - return createVisibilityKindFromString(eDataType, initialValue); - case JdtmmPackage.TRUE_FALSE_DEFAULT: - return createTrueFalseDefaultFromString(eDataType, initialValue); - case JdtmmPackage.STRING: - return createStringFromString(eDataType, initialValue); - case JdtmmPackage.INT: - return createintFromString(eDataType, initialValue); - case JdtmmPackage.BOOLEAN: - return createbooleanFromString(eDataType, initialValue); - case JdtmmPackage.JDT_VISITOR_EXCEPTION: - return createJDTVisitorExceptionFromString(eDataType, initialValue); - case JdtmmPackage.VISITOR: - return createVisitorFromString(eDataType, initialValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * - * @generated - */ - @Override - public String convertToString(EDataType eDataType, Object instanceValue) { - switch (eDataType.getClassifierID()) { - case JdtmmPackage.VISIBILITY_KIND: - return convertVisibilityKindToString(eDataType, instanceValue); - case JdtmmPackage.TRUE_FALSE_DEFAULT: - return convertTrueFalseDefaultToString(eDataType, instanceValue); - case JdtmmPackage.STRING: - return convertStringToString(eDataType, instanceValue); - case JdtmmPackage.INT: - return convertintToString(eDataType, instanceValue); - case JdtmmPackage.BOOLEAN: - return convertbooleanToString(eDataType, instanceValue); - case JdtmmPackage.JDT_VISITOR_EXCEPTION: - return convertJDTVisitorExceptionToString(eDataType, instanceValue); - case JdtmmPackage.VISITOR: - return convertVisitorToString(eDataType, instanceValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * - * @generated - */ - @Override - public JDTTypeParameter createJDTTypeParameter() { - JDTTypeParameterImpl jdtTypeParameter = new JDTTypeParameterImpl(); - return jdtTypeParameter; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTField createJDTField() { - JDTFieldImpl jdtField = new JDTFieldImpl(); - return jdtField; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTMethod createJDTMethod() { - JDTMethodImpl jdtMethod = new JDTMethodImpl(); - return jdtMethod; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTCompilationUnit createJDTCompilationUnit() { - JDTCompilationUnitImpl jdtCompilationUnit = new JDTCompilationUnitImpl(); - return jdtCompilationUnit; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTPackageFragment createJDTPackageFragment() { - JDTPackageFragmentImpl jdtPackageFragment = new JDTPackageFragmentImpl(); - return jdtPackageFragment; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTPackageFragmentRoot createJDTPackageFragmentRoot() { - JDTPackageFragmentRootImpl jdtPackageFragmentRoot = new JDTPackageFragmentRootImpl(); - return jdtPackageFragmentRoot; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTJavaProject createJDTJavaProject() { - JDTJavaProjectImpl jdtJavaProject = new JDTJavaProjectImpl(); - return jdtJavaProject; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTClass createJDTClass() { - JDTClassImpl jdtClass = new JDTClassImpl(); - return jdtClass; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTInterface createJDTInterface() { - JDTInterfaceImpl jdtInterface = new JDTInterfaceImpl(); - return jdtInterface; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTEnum createJDTEnum() { - JDTEnumImpl jdtEnum = new JDTEnumImpl(); - return jdtEnum; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTImportDeclaration createJDTImportDeclaration() { - JDTImportDeclarationImpl jdtImportDeclaration = new JDTImportDeclarationImpl(); - return jdtImportDeclaration; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTImportContainer createJDTImportContainer() { - JDTImportContainerImpl jdtImportContainer = new JDTImportContainerImpl(); - return jdtImportContainer; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTParameter createJDTParameter() { - JDTParameterImpl jdtParameter = new JDTParameterImpl(); - return jdtParameter; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTException createJDTException() { - JDTExceptionImpl jdtException = new JDTExceptionImpl(); - return jdtException; - } - - /** - * - * - * - * @generated - */ - @Override - public JDTOpaqueBody createJDTOpaqueBody() { - JDTOpaqueBodyImpl jdtOpaqueBody = new JDTOpaqueBodyImpl(); - return jdtOpaqueBody; - } - - /** - * - * - * - * @generated - */ - public VisibilityKind createVisibilityKindFromString(EDataType eDataType, String initialValue) { - VisibilityKind result = VisibilityKind.get(initialValue); - if (result == null) { - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - } - return result; - } - - /** - * - * - * - * @generated - */ - public String convertVisibilityKindToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * - * @generated - */ - public TrueFalseDefault createTrueFalseDefaultFromString(EDataType eDataType, String initialValue) { - TrueFalseDefault result = TrueFalseDefault.get(initialValue); - if (result == null) { - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - } - return result; - } - - /** - * - * - * - * @generated - */ - public String convertTrueFalseDefaultToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * - * @generated - */ - @Override - public JDTJavaModel createJDTJavaModel() { - JDTJavaModelImpl jdtJavaModel = new JDTJavaModelImpl(); - return jdtJavaModel; - } - - /** - * - * - * - * @generated - */ - public Integer createintFromString(EDataType eDataType, String initialValue) { - return (Integer) super.createFromString(eDataType, initialValue); - } - - /** - * - * - * - * @generated - */ - public String convertintToString(EDataType eDataType, Object instanceValue) { - return super.convertToString(eDataType, instanceValue); - } - - /** - * - * - * - * @generated - */ - public String createStringFromString(EDataType eDataType, String initialValue) { - return (String) super.createFromString(eDataType, initialValue); - } - - /** - * - * - * - * @generated - */ - public String convertStringToString(EDataType eDataType, Object instanceValue) { - return super.convertToString(eDataType, instanceValue); - } - - /** - * - * - * - * @generated - */ - public JDTVisitorException createJDTVisitorExceptionFromString(EDataType eDataType, String initialValue) { - return (JDTVisitorException) super.createFromString(eDataType, initialValue); - } - - /** - * - * - * - * @generated - */ - public String convertJDTVisitorExceptionToString(EDataType eDataType, Object instanceValue) { - return super.convertToString(eDataType, instanceValue); - } - - /** - * - * - * - * @generated - */ - public JDTVisitor createVisitorFromString(EDataType eDataType, String initialValue) { - return (JDTVisitor) super.createFromString(eDataType, initialValue); - } - - /** - * - * - * - * @generated - */ - public String convertVisitorToString(EDataType eDataType, Object instanceValue) { - return super.convertToString(eDataType, instanceValue); - } - - /** - * - * - * - * @generated - */ - public Boolean createbooleanFromString(EDataType eDataType, String initialValue) { - return (Boolean) super.createFromString(eDataType, initialValue); - } - - /** - * - * - * - * @generated - */ - public String convertbooleanToString(EDataType eDataType, Object instanceValue) { - return super.convertToString(eDataType, instanceValue); - } - - /** - * - * - * - * @generated - */ - @Override - public JdtmmPackage getJdtmmPackage() { - return (JdtmmPackage) getEPackage(); - } - - /** - * - * - * - * @deprecated - * @generated - */ - @Deprecated - public static JdtmmPackage getPackage() { - return JdtmmPackage.eINSTANCE; - } - -} // JdtmmFactoryImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmPackageImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmPackageImpl.java deleted file mode 100644 index 3050ecf23e4..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmPackageImpl.java +++ /dev/null @@ -1,1905 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception - * Manuel Giles giles.manu@live.fr - Meta-model conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EOperation; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; - -/** - * - * An implementation of the model Package. - * - * - * @generated - */ -public class JdtmmPackageImpl extends EPackageImpl implements JdtmmPackage { - - /** - * - * - * - * @generated - */ - private EClass jdtMethodBodyEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtJavaElementEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtParentEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtMemberEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtParentJavaElementEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtTypeParameterEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtFieldEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtTypeEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtMethodEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtCompilationUnitEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtTypeRootEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtPackageFragmentEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtPackageFragmentRootEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtJavaProjectEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtClassEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtInterfaceEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtEnumEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtImportDeclarationEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtImportContainerEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtParameterEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtExceptionEClass = null; - - /** - * - * - * - * @generated - */ - private EClass jdtOpaqueBodyEClass = null; - - /** - * - * - * - * @generated - */ - private EEnum visibilityKindEEnum = null; - - /** - * - * - * - * @generated - */ - private EEnum trueFalseDefaultEEnum = null; - - /** - * - * - * - * @generated - */ - private EClass jdtJavaModelEClass = null; - - /** - * - * - * - * @generated - */ - private EDataType intEDataType = null; - - /** - * - * - * - * @generated - */ - private EDataType stringEDataType = null; - - /** - * - * - * - * @generated - */ - private EDataType jdtVisitorExceptionEDataType = null; - - /** - * - * - * - * @generated - */ - private EDataType visitorEDataType = null; - - /** - * - * - * - * @generated - */ - private EDataType booleanEDataType = null; - - /** - * Creates an instance of the model Package, registered with {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

- * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also performs initialization of the package, or returns the registered package, if one already exists. - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#eNS_URI - * @see #init() - * @generated - */ - private JdtmmPackageImpl() { - super(eNS_URI, JdtmmFactory.eINSTANCE); - } - - /** - * - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * - *

- * This method is used to initialize {@link JdtmmPackage#eINSTANCE} when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static JdtmmPackage init() { - if (isInited) { - return (JdtmmPackage) EPackage.Registry.INSTANCE.getEPackage(JdtmmPackage.eNS_URI); - } - - // Obtain or create and register package - JdtmmPackageImpl theJdtmmPackage = (JdtmmPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof JdtmmPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new JdtmmPackageImpl()); - - isInited = true; - - // Create package meta-data objects - theJdtmmPackage.createPackageContents(); - - // Initialize created meta-data - theJdtmmPackage.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theJdtmmPackage.freeze(); - - - // Update the registry and return the package - EPackage.Registry.INSTANCE.put(JdtmmPackage.eNS_URI, theJdtmmPackage); - return theJdtmmPackage; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTMethodBody() { - return jdtMethodBodyEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTMethodBody_Owner() { - return (EReference) jdtMethodBodyEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTJavaElement() { - return jdtJavaElementEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTJavaElement_Parent() { - return (EReference) jdtJavaElementEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTJavaElement_ElementName() { - return (EAttribute) jdtJavaElementEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTJavaElement_ElementType() { - return (EAttribute) jdtJavaElementEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTJavaElement_Comment() { - return (EAttribute) jdtJavaElementEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTJavaElement_Generated() { - return (EAttribute) jdtJavaElementEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTParent() { - return jdtParentEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTParent_Flags() { - return (EAttribute) jdtParentEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTParent_Children() { - return (EReference) jdtParentEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTMember() { - return jdtMemberEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTMember_TypeParameters() { - return (EReference) jdtMemberEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTMember_Visibility() { - return (EAttribute) jdtMemberEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTMember_ExplicitRequiredImports() { - return (EReference) jdtMemberEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTMember_ExplicitPlainTextRequiredImports() { - return (EAttribute) jdtMemberEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTParentJavaElement() { - return jdtParentJavaElementEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTTypeParameter() { - return jdtTypeParameterEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTTypeParameter_DeclaringMember() { - return (EReference) jdtTypeParameterEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTField() { - return jdtFieldEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTField_Owner() { - return (EReference) jdtFieldEClass.getEStructuralFeatures().get(8); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTField_Type() { - return (EReference) jdtFieldEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTField_Value() { - return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTField_GenerateGetter() { - return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(6); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTField_GenerateSetter() { - return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(7); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTField_Abstract() { - return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTField_Final() { - return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTField_Static() { - return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTField_IsMultiValued() { - return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTType() { - return jdtTypeEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTType_Methods() { - return (EReference) jdtTypeEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTType_CompilationUnit() { - return (EReference) jdtTypeEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTType_Class() { - return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTType_Interface() { - return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTType_Enum() { - return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTType_Abstract() { - return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(6); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTType_Final() { - return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(7); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTType_Static() { - return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(8); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTType_Types() { - return (EReference) jdtTypeEClass.getEStructuralFeatures().get(9); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTType_Owner() { - return (EReference) jdtTypeEClass.getEStructuralFeatures().get(10); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTType_SuperInterfaces() { - return (EReference) jdtTypeEClass.getEStructuralFeatures().get(11); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTType_SuperClass() { - return (EReference) jdtTypeEClass.getEStructuralFeatures().get(12); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTType_SuperInterfaceNames() { - return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(13); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTType_SuperClassName() { - return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(14); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTType_Fields() { - return (EReference) jdtTypeEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTMethod() { - return jdtMethodEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTMethod_ReturnType() { - return (EReference) jdtMethodEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTMethod_Parameters() { - return (EReference) jdtMethodEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTMethod_Exceptions() { - return (EReference) jdtMethodEClass.getEStructuralFeatures().get(6); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTMethod_Synchronized() { - return (EAttribute) jdtMethodEClass.getEStructuralFeatures().get(7); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTMethod_Constructor() { - return (EAttribute) jdtMethodEClass.getEStructuralFeatures().get(8); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTMethod_Bodies() { - return (EReference) jdtMethodEClass.getEStructuralFeatures().get(9); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTMethod_Abstract() { - return (EAttribute) jdtMethodEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTMethod_Final() { - return (EAttribute) jdtMethodEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTMethod_Static() { - return (EAttribute) jdtMethodEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTMethod_Owner() { - return (EReference) jdtMethodEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTCompilationUnit() { - return jdtCompilationUnitEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTCompilationUnit_PackageFragment() { - return (EReference) jdtCompilationUnitEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTCompilationUnit_Types() { - return (EReference) jdtCompilationUnitEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTTypeRoot() { - return jdtTypeRootEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTPackageFragment() { - return jdtPackageFragmentEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTPackageFragment_PackageFragmentRoot() { - return (EReference) jdtPackageFragmentEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTPackageFragment_CompilationUnits() { - return (EReference) jdtPackageFragmentEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTPackageFragmentRoot() { - return jdtPackageFragmentRootEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTPackageFragmentRoot_JavaProject() { - return (EReference) jdtPackageFragmentRootEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTPackageFragmentRoot_PackageFragments() { - return (EReference) jdtPackageFragmentRootEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTJavaProject() { - return jdtJavaProjectEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTJavaProject_JavaModel() { - return (EReference) jdtJavaProjectEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTJavaProject_PackageFragmentRoots() { - return (EReference) jdtJavaProjectEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTClass() { - return jdtClassEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTInterface() { - return jdtInterfaceEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTEnum() { - return jdtEnumEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTImportDeclaration() { - return jdtImportDeclarationEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTImportContainer() { - return jdtImportContainerEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTParameter() { - return jdtParameterEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTParameter_ParameterOwner() { - return (EReference) jdtParameterEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTParameter_Final() { - return (EAttribute) jdtParameterEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTParameter_IsMultiValued() { - return (EAttribute) jdtParameterEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTParameter_Type() { - return (EReference) jdtParameterEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTParameter_ReturnOwner() { - return (EReference) jdtParameterEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTException() { - return jdtExceptionEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTOpaqueBody() { - return jdtOpaqueBodyEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJDTOpaqueBody__body() { - return (EAttribute) jdtOpaqueBodyEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EEnum getVisibilityKind() { - return visibilityKindEEnum; - } - - /** - * - * - * - * @generated - */ - @Override - public EEnum getTrueFalseDefault() { - return trueFalseDefaultEEnum; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJDTJavaModel() { - return jdtJavaModelEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJDTJavaModel_JavaProject() { - return (EReference) jdtJavaModelEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EDataType getint() { - return intEDataType; - } - - /** - * - * - * - * @generated - */ - @Override - public EDataType getString() { - return stringEDataType; - } - - /** - * - * - * - * @generated - */ - @Override - public EDataType getJDTVisitorException() { - return jdtVisitorExceptionEDataType; - } - - /** - * - * - * - * @generated - */ - @Override - public EDataType getVisitor() { - return visitorEDataType; - } - - /** - * - * - * - * @generated - */ - @Override - public EDataType getboolean() { - return booleanEDataType; - } - - /** - * - * - * - * @generated - */ - @Override - public JdtmmFactory getJdtmmFactory() { - return (JdtmmFactory) getEFactoryInstance(); - } - - /** - * - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * - * @generated - */ - public void createPackageContents() { - if (isCreated) { - return; - } - isCreated = true; - - // Create classes and their features - jdtMethodBodyEClass = createEClass(JDT_METHOD_BODY); - createEReference(jdtMethodBodyEClass, JDT_METHOD_BODY__OWNER); - - jdtMethodEClass = createEClass(JDT_METHOD); - createEReference(jdtMethodEClass, JDT_METHOD__OWNER); - createEReference(jdtMethodEClass, JDT_METHOD__RETURN_TYPE); - createEReference(jdtMethodEClass, JDT_METHOD__PARAMETERS); - createEAttribute(jdtMethodEClass, JDT_METHOD__ABSTRACT); - createEAttribute(jdtMethodEClass, JDT_METHOD__FINAL); - createEAttribute(jdtMethodEClass, JDT_METHOD__STATIC); - createEReference(jdtMethodEClass, JDT_METHOD__EXCEPTIONS); - createEAttribute(jdtMethodEClass, JDT_METHOD__SYNCHRONIZED); - createEAttribute(jdtMethodEClass, JDT_METHOD__CONSTRUCTOR); - createEReference(jdtMethodEClass, JDT_METHOD__BODIES); - - jdtMemberEClass = createEClass(JDT_MEMBER); - createEReference(jdtMemberEClass, JDT_MEMBER__TYPE_PARAMETERS); - createEAttribute(jdtMemberEClass, JDT_MEMBER__VISIBILITY); - createEReference(jdtMemberEClass, JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS); - createEAttribute(jdtMemberEClass, JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); - - jdtParentJavaElementEClass = createEClass(JDT_PARENT_JAVA_ELEMENT); - - jdtParentEClass = createEClass(JDT_PARENT); - createEReference(jdtParentEClass, JDT_PARENT__CHILDREN); - createEAttribute(jdtParentEClass, JDT_PARENT__FLAGS); - - jdtJavaElementEClass = createEClass(JDT_JAVA_ELEMENT); - createEAttribute(jdtJavaElementEClass, JDT_JAVA_ELEMENT__ELEMENT_NAME); - createEAttribute(jdtJavaElementEClass, JDT_JAVA_ELEMENT__ELEMENT_TYPE); - createEAttribute(jdtJavaElementEClass, JDT_JAVA_ELEMENT__COMMENT); - createEAttribute(jdtJavaElementEClass, JDT_JAVA_ELEMENT__GENERATED); - createEReference(jdtJavaElementEClass, JDT_JAVA_ELEMENT__PARENT); - - jdtTypeParameterEClass = createEClass(JDT_TYPE_PARAMETER); - createEReference(jdtTypeParameterEClass, JDT_TYPE_PARAMETER__DECLARING_MEMBER); - - jdtTypeEClass = createEClass(JDT_TYPE); - createEReference(jdtTypeEClass, JDT_TYPE__METHODS); - createEReference(jdtTypeEClass, JDT_TYPE__FIELDS); - createEReference(jdtTypeEClass, JDT_TYPE__COMPILATION_UNIT); - createEAttribute(jdtTypeEClass, JDT_TYPE__CLASS); - createEAttribute(jdtTypeEClass, JDT_TYPE__INTERFACE); - createEAttribute(jdtTypeEClass, JDT_TYPE__ENUM); - createEAttribute(jdtTypeEClass, JDT_TYPE__ABSTRACT); - createEAttribute(jdtTypeEClass, JDT_TYPE__FINAL); - createEAttribute(jdtTypeEClass, JDT_TYPE__STATIC); - createEReference(jdtTypeEClass, JDT_TYPE__TYPES); - createEReference(jdtTypeEClass, JDT_TYPE__OWNER); - createEReference(jdtTypeEClass, JDT_TYPE__SUPER_INTERFACES); - createEReference(jdtTypeEClass, JDT_TYPE__SUPER_CLASS); - createEAttribute(jdtTypeEClass, JDT_TYPE__SUPER_INTERFACE_NAMES); - createEAttribute(jdtTypeEClass, JDT_TYPE__SUPER_CLASS_NAME); - - jdtFieldEClass = createEClass(JDT_FIELD); - createEAttribute(jdtFieldEClass, JDT_FIELD__ABSTRACT); - createEAttribute(jdtFieldEClass, JDT_FIELD__FINAL); - createEAttribute(jdtFieldEClass, JDT_FIELD__STATIC); - createEAttribute(jdtFieldEClass, JDT_FIELD__IS_MULTI_VALUED); - createEReference(jdtFieldEClass, JDT_FIELD__TYPE); - createEAttribute(jdtFieldEClass, JDT_FIELD__VALUE); - createEAttribute(jdtFieldEClass, JDT_FIELD__GENERATE_GETTER); - createEAttribute(jdtFieldEClass, JDT_FIELD__GENERATE_SETTER); - createEReference(jdtFieldEClass, JDT_FIELD__OWNER); - - jdtCompilationUnitEClass = createEClass(JDT_COMPILATION_UNIT); - createEReference(jdtCompilationUnitEClass, JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT); - createEReference(jdtCompilationUnitEClass, JDT_COMPILATION_UNIT__TYPES); - - jdtTypeRootEClass = createEClass(JDT_TYPE_ROOT); - - jdtPackageFragmentEClass = createEClass(JDT_PACKAGE_FRAGMENT); - createEReference(jdtPackageFragmentEClass, JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT); - createEReference(jdtPackageFragmentEClass, JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS); - - jdtPackageFragmentRootEClass = createEClass(JDT_PACKAGE_FRAGMENT_ROOT); - createEReference(jdtPackageFragmentRootEClass, JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT); - createEReference(jdtPackageFragmentRootEClass, JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS); - - jdtJavaProjectEClass = createEClass(JDT_JAVA_PROJECT); - createEReference(jdtJavaProjectEClass, JDT_JAVA_PROJECT__JAVA_MODEL); - createEReference(jdtJavaProjectEClass, JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS); - - jdtJavaModelEClass = createEClass(JDT_JAVA_MODEL); - createEReference(jdtJavaModelEClass, JDT_JAVA_MODEL__JAVA_PROJECT); - - jdtParameterEClass = createEClass(JDT_PARAMETER); - createEReference(jdtParameterEClass, JDT_PARAMETER__PARAMETER_OWNER); - createEAttribute(jdtParameterEClass, JDT_PARAMETER__FINAL); - createEAttribute(jdtParameterEClass, JDT_PARAMETER__IS_MULTI_VALUED); - createEReference(jdtParameterEClass, JDT_PARAMETER__TYPE); - createEReference(jdtParameterEClass, JDT_PARAMETER__RETURN_OWNER); - - jdtClassEClass = createEClass(JDT_CLASS); - - jdtInterfaceEClass = createEClass(JDT_INTERFACE); - - jdtEnumEClass = createEClass(JDT_ENUM); - - jdtImportDeclarationEClass = createEClass(JDT_IMPORT_DECLARATION); - - jdtImportContainerEClass = createEClass(JDT_IMPORT_CONTAINER); - - jdtExceptionEClass = createEClass(JDT_EXCEPTION); - - jdtOpaqueBodyEClass = createEClass(JDT_OPAQUE_BODY); - createEAttribute(jdtOpaqueBodyEClass, JDT_OPAQUE_BODY__BODY); - - // Create enums - visibilityKindEEnum = createEEnum(VISIBILITY_KIND); - trueFalseDefaultEEnum = createEEnum(TRUE_FALSE_DEFAULT); - - // Create data types - stringEDataType = createEDataType(STRING); - intEDataType = createEDataType(INT); - booleanEDataType = createEDataType(BOOLEAN); - jdtVisitorExceptionEDataType = createEDataType(JDT_VISITOR_EXCEPTION); - visitorEDataType = createEDataType(VISITOR); - } - - /** - * - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) { - return; - } - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Create type parameters - - // Set bounds for type parameters - - // Add supertypes to classes - jdtMethodEClass.getESuperTypes().add(this.getJDTMember()); - jdtMemberEClass.getESuperTypes().add(this.getJDTParentJavaElement()); - jdtParentJavaElementEClass.getESuperTypes().add(this.getJDTJavaElement()); - jdtParentJavaElementEClass.getESuperTypes().add(this.getJDTParent()); - jdtTypeParameterEClass.getESuperTypes().add(this.getJDTJavaElement()); - jdtTypeEClass.getESuperTypes().add(this.getJDTMember()); - jdtFieldEClass.getESuperTypes().add(this.getJDTMember()); - jdtCompilationUnitEClass.getESuperTypes().add(this.getJDTTypeRoot()); - jdtTypeRootEClass.getESuperTypes().add(this.getJDTParentJavaElement()); - jdtPackageFragmentEClass.getESuperTypes().add(this.getJDTParentJavaElement()); - jdtPackageFragmentRootEClass.getESuperTypes().add(this.getJDTParentJavaElement()); - jdtJavaProjectEClass.getESuperTypes().add(this.getJDTParentJavaElement()); - jdtJavaModelEClass.getESuperTypes().add(this.getJDTParentJavaElement()); - jdtParameterEClass.getESuperTypes().add(this.getJDTMember()); - jdtClassEClass.getESuperTypes().add(this.getJDTType()); - jdtInterfaceEClass.getESuperTypes().add(this.getJDTType()); - jdtEnumEClass.getESuperTypes().add(this.getJDTType()); - jdtImportDeclarationEClass.getESuperTypes().add(this.getJDTJavaElement()); - jdtImportContainerEClass.getESuperTypes().add(this.getJDTParentJavaElement()); - jdtOpaqueBodyEClass.getESuperTypes().add(this.getJDTMethodBody()); - - // Initialize classes and features; add operations and parameters - initEClass(jdtMethodBodyEClass, JDTMethodBody.class, "JDTMethodBody", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJDTMethodBody_Owner(), this.getJDTMethod(), this.getJDTMethod_Bodies(), "owner", null, 1, 1, JDTMethodBody.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - - addEOperation(jdtMethodBodyEClass, this.getString(), "asText", 1, 1, IS_UNIQUE, !IS_ORDERED); - - initEClass(jdtMethodEClass, JDTMethod.class, "JDTMethod", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJDTMethod_Owner(), this.getJDTType(), this.getJDTType_Methods(), "owner", null, 1, 1, JDTMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - initEReference(getJDTMethod_ReturnType(), this.getJDTParameter(), this.getJDTParameter_ReturnOwner(), "returnType", null, 0, 1, JDTMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, - !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTMethod_Parameters(), this.getJDTParameter(), this.getJDTParameter_ParameterOwner(), "parameters", null, 0, -1, JDTMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTMethod_Abstract(), this.getboolean(), "abstract", "false", 1, 1, JDTMethod.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTMethod_Final(), this.getboolean(), "final", "false", 1, 1, JDTMethod.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTMethod_Static(), this.getboolean(), "static", "false", 1, 1, JDTMethod.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - initEReference(getJDTMethod_Exceptions(), this.getJDTType(), null, "exceptions", null, 0, -1, JDTMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTMethod_Synchronized(), this.getboolean(), "synchronized", "false", 1, 1, JDTMethod.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTMethod_Constructor(), this.getboolean(), "constructor", null, 1, 1, JDTMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTMethod_Bodies(), this.getJDTMethodBody(), this.getJDTMethodBody_Owner(), "bodies", null, 0, -1, JDTMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, - !IS_DERIVED, !IS_ORDERED); - - initEClass(jdtMemberEClass, JDTMember.class, "JDTMember", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJDTMember_TypeParameters(), this.getJDTTypeParameter(), this.getJDTTypeParameter_DeclaringMember(), "typeParameters", null, 0, -1, JDTMember.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, - !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTMember_Visibility(), this.getVisibilityKind(), "visibility", "public", 1, 1, JDTMember.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - initEReference(getJDTMember_ExplicitRequiredImports(), this.getJDTType(), null, "explicitRequiredImports", null, 0, -1, JDTMember.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, - !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTMember_ExplicitPlainTextRequiredImports(), this.getString(), "explicitPlainTextRequiredImports", null, 0, -1, JDTMember.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(jdtParentJavaElementEClass, JDTParentJavaElement.class, "JDTParentJavaElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(jdtParentEClass, JDTParent.class, "JDTParent", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJDTParent_Children(), this.getJDTJavaElement(), this.getJDTJavaElement_Parent(), "children", null, 0, -1, JDTParent.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, - !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTParent_Flags(), this.getint(), "flags", null, 1, 1, JDTParent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - EOperation op = addEOperation(jdtParentEClass, null, "setFlag", 1, 1, IS_UNIQUE, !IS_ORDERED); - addEParameter(op, this.getint(), "flag", 1, 1, IS_UNIQUE, !IS_ORDERED); - addEParameter(op, this.getboolean(), "value", 1, 1, IS_UNIQUE, !IS_ORDERED); - - op = addEOperation(jdtParentEClass, this.getboolean(), "isFlagSet", 1, 1, IS_UNIQUE, !IS_ORDERED); - addEParameter(op, this.getint(), "flag", 1, 1, IS_UNIQUE, !IS_ORDERED); - - initEClass(jdtJavaElementEClass, JDTJavaElement.class, "JDTJavaElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getJDTJavaElement_ElementName(), this.getString(), "elementName", null, 1, 1, JDTJavaElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTJavaElement_ElementType(), this.getint(), "elementType", null, 1, 1, JDTJavaElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTJavaElement_Comment(), this.getString(), "comment", null, 1, 1, JDTJavaElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTJavaElement_Generated(), this.getboolean(), "generated", null, 1, 1, JDTJavaElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTJavaElement_Parent(), this.getJDTParent(), this.getJDTParent_Children(), "parent", null, 0, 1, JDTJavaElement.class, IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, - !IS_DERIVED, !IS_ORDERED); - - addEOperation(jdtJavaElementEClass, this.getString(), "getQualifiedName", 1, 1, IS_UNIQUE, !IS_ORDERED); - - op = addEOperation(jdtJavaElementEClass, null, "accept", 1, 1, IS_UNIQUE, !IS_ORDERED); - addEParameter(op, this.getVisitor(), "visitor", 1, 1, IS_UNIQUE, !IS_ORDERED); - addEException(op, this.getJDTVisitorException()); - - addEOperation(jdtJavaElementEClass, this.getString(), "getJDTSignature", 1, 1, IS_UNIQUE, !IS_ORDERED); - - initEClass(jdtTypeParameterEClass, JDTTypeParameter.class, "JDTTypeParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJDTTypeParameter_DeclaringMember(), this.getJDTMember(), this.getJDTMember_TypeParameters(), "declaringMember", null, 0, 1, JDTTypeParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, - !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(jdtTypeEClass, JDTType.class, "JDTType", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJDTType_Methods(), this.getJDTMethod(), this.getJDTMethod_Owner(), "methods", null, 0, -1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - initEReference(getJDTType_Fields(), this.getJDTField(), this.getJDTField_Owner(), "fields", null, 0, -1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTType_CompilationUnit(), this.getJDTCompilationUnit(), this.getJDTCompilationUnit_Types(), "compilationUnit", null, 0, 1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, - !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTType_Class(), this.getboolean(), "class", "false", 1, 1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTType_Interface(), this.getboolean(), "interface", "false", 1, 1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTType_Enum(), this.getboolean(), "enum", "false", 1, 1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTType_Abstract(), this.getboolean(), "abstract", "false", 1, 1, JDTType.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTType_Final(), this.getboolean(), "final", "false", 1, 1, JDTType.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTType_Static(), this.getboolean(), "static", "false", 1, 1, JDTType.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - initEReference(getJDTType_Types(), this.getJDTType(), this.getJDTType_Owner(), "types", null, 0, -1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTType_Owner(), this.getJDTType(), this.getJDTType_Types(), "owner", null, 0, 1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTType_SuperInterfaces(), this.getJDTType(), null, "superInterfaces", null, 0, -1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTType_SuperClass(), this.getJDTType(), null, "superClass", null, 0, 1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTType_SuperInterfaceNames(), this.getString(), "superInterfaceNames", null, 0, -1, JDTType.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTType_SuperClassName(), this.getString(), "superClassName", null, 1, 1, JDTType.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - - initEClass(jdtFieldEClass, JDTField.class, "JDTField", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getJDTField_Abstract(), this.getboolean(), "abstract", "false", 1, 1, JDTField.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTField_Final(), this.getboolean(), "final", "false", 1, 1, JDTField.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTField_Static(), this.getboolean(), "static", "false", 1, 1, JDTField.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTField_IsMultiValued(), this.getboolean(), "isMultiValued", "false", 1, 1, JDTField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTField_Type(), this.getJDTType(), null, "type", null, 0, 1, JDTField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTField_Value(), this.getString(), "value", null, 1, 1, JDTField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTField_GenerateGetter(), this.getTrueFalseDefault(), "generateGetter", null, 1, 1, JDTField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTField_GenerateSetter(), this.getTrueFalseDefault(), "generateSetter", null, 1, 1, JDTField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTField_Owner(), this.getJDTType(), this.getJDTType_Fields(), "owner", null, 1, 1, JDTField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(jdtCompilationUnitEClass, JDTCompilationUnit.class, "JDTCompilationUnit", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJDTCompilationUnit_PackageFragment(), this.getJDTPackageFragment(), this.getJDTPackageFragment_CompilationUnits(), "packageFragment", null, 0, 1, JDTCompilationUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, - !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTCompilationUnit_Types(), this.getJDTType(), this.getJDTType_CompilationUnit(), "types", null, 0, -1, JDTCompilationUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(jdtTypeRootEClass, JDTTypeRoot.class, "JDTTypeRoot", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(jdtPackageFragmentEClass, JDTPackageFragment.class, "JDTPackageFragment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJDTPackageFragment_PackageFragmentRoot(), this.getJDTPackageFragmentRoot(), this.getJDTPackageFragmentRoot_PackageFragments(), "packageFragmentRoot", null, 0, 1, JDTPackageFragment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, - !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTPackageFragment_CompilationUnits(), this.getJDTCompilationUnit(), this.getJDTCompilationUnit_PackageFragment(), "compilationUnits", null, 0, -1, JDTPackageFragment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, - !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(jdtPackageFragmentRootEClass, JDTPackageFragmentRoot.class, "JDTPackageFragmentRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJDTPackageFragmentRoot_JavaProject(), this.getJDTJavaProject(), this.getJDTJavaProject_PackageFragmentRoots(), "javaProject", null, 0, 1, JDTPackageFragmentRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, - !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTPackageFragmentRoot_PackageFragments(), this.getJDTPackageFragment(), this.getJDTPackageFragment_PackageFragmentRoot(), "packageFragments", null, 0, -1, JDTPackageFragmentRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, - IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(jdtJavaProjectEClass, JDTJavaProject.class, "JDTJavaProject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJDTJavaProject_JavaModel(), this.getJDTJavaModel(), this.getJDTJavaModel_JavaProject(), "javaModel", null, 0, 1, JDTJavaProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTJavaProject_PackageFragmentRoots(), this.getJDTPackageFragmentRoot(), this.getJDTPackageFragmentRoot_JavaProject(), "packageFragmentRoots", null, 0, -1, JDTJavaProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, - IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(jdtJavaModelEClass, JDTJavaModel.class, "JDTJavaModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJDTJavaModel_JavaProject(), this.getJDTJavaProject(), this.getJDTJavaProject_JavaModel(), "javaProject", null, 0, -1, JDTJavaModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(jdtParameterEClass, JDTParameter.class, "JDTParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJDTParameter_ParameterOwner(), this.getJDTMethod(), this.getJDTMethod_Parameters(), "parameterOwner", null, 0, 1, JDTParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTParameter_Final(), this.getboolean(), "final", "false", 1, 1, JDTParameter.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); - initEAttribute(getJDTParameter_IsMultiValued(), this.getboolean(), "isMultiValued", "false", 1, 1, JDTParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTParameter_Type(), this.getJDTType(), null, "type", null, 0, 1, JDTParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJDTParameter_ReturnOwner(), this.getJDTMethod(), this.getJDTMethod_ReturnType(), "returnOwner", null, 0, 1, JDTParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(jdtClassEClass, JDTClass.class, "JDTClass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(jdtInterfaceEClass, JDTInterface.class, "JDTInterface", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(jdtEnumEClass, JDTEnum.class, "JDTEnum", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(jdtImportDeclarationEClass, JDTImportDeclaration.class, "JDTImportDeclaration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(jdtImportContainerEClass, JDTImportContainer.class, "JDTImportContainer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(jdtExceptionEClass, JDTException.class, "JDTException", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(jdtOpaqueBodyEClass, JDTOpaqueBody.class, "JDTOpaqueBody", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getJDTOpaqueBody__body(), this.getString(), "_body", null, 1, 1, JDTOpaqueBody.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - // Initialize enums and add enum literals - initEEnum(visibilityKindEEnum, VisibilityKind.class, "VisibilityKind"); - addEEnumLiteral(visibilityKindEEnum, VisibilityKind.PUBLIC); - addEEnumLiteral(visibilityKindEEnum, VisibilityKind.PROTECTED); - addEEnumLiteral(visibilityKindEEnum, VisibilityKind.PRIVATE); - - initEEnum(trueFalseDefaultEEnum, TrueFalseDefault.class, "TrueFalseDefault"); - addEEnumLiteral(trueFalseDefaultEEnum, TrueFalseDefault.TRUE); - addEEnumLiteral(trueFalseDefaultEEnum, TrueFalseDefault.FALSE); - addEEnumLiteral(trueFalseDefaultEEnum, TrueFalseDefault.DEFAULT); - - // Initialize data types - initEDataType(stringEDataType, String.class, "String", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - initEDataType(intEDataType, int.class, "int", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - initEDataType(booleanEDataType, boolean.class, "boolean", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - initEDataType(jdtVisitorExceptionEDataType, JDTVisitorException.class, "JDTVisitorException", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - initEDataType(visitorEDataType, JDTVisitor.class, "Visitor", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); - - // Create resource - createResource(eNS_URI); - - // Create annotations - // redefines - createRedefinesAnnotations(); - // union - createUnionAnnotations(); - // subsets - createSubsetsAnnotations(); - } - - /** - * Initializes the annotations for union. - * - * - * - * @generated - */ - protected void createUnionAnnotations() { - String source = "union"; - addAnnotation(getJDTParent_Children(), - source, - new String[] { - }); - } - - /** - * Initializes the annotations for redefines. - * - * - * - * @generated - */ - protected void createRedefinesAnnotations() { - String source = "redefines"; - addAnnotation(getJDTMethod_Owner(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") - }); - addAnnotation(getJDTType_CompilationUnit(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") - }); - addAnnotation(getJDTType_Owner(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") - }); - addAnnotation(getJDTField_Owner(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") - }); - addAnnotation(getJDTCompilationUnit_PackageFragment(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") - }); - addAnnotation(getJDTPackageFragment_PackageFragmentRoot(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") - }); - addAnnotation(getJDTPackageFragmentRoot_JavaProject(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") - }); - } - - /** - * Initializes the annotations for subsets. - * - * - * - * @generated - */ - protected void createSubsetsAnnotations() { - String source = "subsets"; - addAnnotation(getJDTType_Methods(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTParent/children") - }); - addAnnotation(getJDTType_Fields(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTParent/children") - }); - addAnnotation(getJDTType_Types(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTParent/children") - }); - addAnnotation(getJDTCompilationUnit_Types(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTParent/children") - }); - addAnnotation(getJDTPackageFragment_CompilationUnits(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTParent/children") - }); - addAnnotation(getJDTPackageFragmentRoot_PackageFragments(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTParent/children") - }); - addAnnotation(getJDTJavaProject_PackageFragmentRoots(), - source, - new String[] { - }, - new URI[] { - URI.createURI(eNS_URI).appendFragment("//JDTParent/children") - }); - } - -} // JdtmmPackageImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmAdapterFactory.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmAdapterFactory.java deleted file mode 100644 index aa76f9d5313..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmAdapterFactory.java +++ /dev/null @@ -1,595 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage - * @generated - */ -public class JdtmmAdapterFactory extends AdapterFactoryImpl { - - /** - * The cached model package. - * - * - * - * @generated - */ - protected static JdtmmPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * - * @generated - */ - public JdtmmAdapterFactory() { - if (modelPackage == null) { - modelPackage = JdtmmPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject) object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch that delegates to the createXXX methods. - * - * - * - * @generated - */ - protected JdtmmSwitch modelSwitch = - new JdtmmSwitch() { - @Override - public Adapter caseJDTMethodBody(JDTMethodBody object) { - return createJDTMethodBodyAdapter(); - } - - @Override - public Adapter caseJDTMethod(JDTMethod object) { - return createJDTMethodAdapter(); - } - - @Override - public Adapter caseJDTMember(JDTMember object) { - return createJDTMemberAdapter(); - } - - @Override - public Adapter caseJDTParentJavaElement(JDTParentJavaElement object) { - return createJDTParentJavaElementAdapter(); - } - - @Override - public Adapter caseJDTParent(JDTParent object) { - return createJDTParentAdapter(); - } - - @Override - public Adapter caseJDTJavaElement(JDTJavaElement object) { - return createJDTJavaElementAdapter(); - } - - @Override - public Adapter caseJDTTypeParameter(JDTTypeParameter object) { - return createJDTTypeParameterAdapter(); - } - - @Override - public Adapter caseJDTType(JDTType object) { - return createJDTTypeAdapter(); - } - - @Override - public Adapter caseJDTField(JDTField object) { - return createJDTFieldAdapter(); - } - - @Override - public Adapter caseJDTCompilationUnit(JDTCompilationUnit object) { - return createJDTCompilationUnitAdapter(); - } - - @Override - public Adapter caseJDTTypeRoot(JDTTypeRoot object) { - return createJDTTypeRootAdapter(); - } - - @Override - public Adapter caseJDTPackageFragment(JDTPackageFragment object) { - return createJDTPackageFragmentAdapter(); - } - - @Override - public Adapter caseJDTPackageFragmentRoot(JDTPackageFragmentRoot object) { - return createJDTPackageFragmentRootAdapter(); - } - - @Override - public Adapter caseJDTJavaProject(JDTJavaProject object) { - return createJDTJavaProjectAdapter(); - } - - @Override - public Adapter caseJDTJavaModel(JDTJavaModel object) { - return createJDTJavaModelAdapter(); - } - - @Override - public Adapter caseJDTParameter(JDTParameter object) { - return createJDTParameterAdapter(); - } - - @Override - public Adapter caseJDTClass(JDTClass object) { - return createJDTClassAdapter(); - } - - @Override - public Adapter caseJDTInterface(JDTInterface object) { - return createJDTInterfaceAdapter(); - } - - @Override - public Adapter caseJDTEnum(JDTEnum object) { - return createJDTEnumAdapter(); - } - - @Override - public Adapter caseJDTImportDeclaration(JDTImportDeclaration object) { - return createJDTImportDeclarationAdapter(); - } - - @Override - public Adapter caseJDTImportContainer(JDTImportContainer object) { - return createJDTImportContainerAdapter(); - } - - @Override - public Adapter caseJDTException(JDTException object) { - return createJDTExceptionAdapter(); - } - - @Override - public Adapter caseJDTOpaqueBody(JDTOpaqueBody object) { - return createJDTOpaqueBodyAdapter(); - } - - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * - * @param target - * the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject) target); - } - - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody JDT Method Body}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody - * @generated - */ - public Adapter createJDTMethodBodyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement JDT Java Element}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement - * @generated - */ - public Adapter createJDTJavaElementAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent JDT Parent}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent - * @generated - */ - public Adapter createJDTParentAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember JDT Member}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember - * @generated - */ - public Adapter createJDTMemberAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement JDT Parent Java Element}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement - * @generated - */ - public Adapter createJDTParentJavaElementAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter JDT Type Parameter}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter - * @generated - */ - public Adapter createJDTTypeParameterAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField JDT Field}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField - * @generated - */ - public Adapter createJDTFieldAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType JDT Type}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType - * @generated - */ - public Adapter createJDTTypeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod JDT Method}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod - * @generated - */ - public Adapter createJDTMethodAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter JDT Parameter}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter - * @generated - */ - public Adapter createJDTParameterAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit JDT Compilation Unit}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit - * @generated - */ - public Adapter createJDTCompilationUnitAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot JDT Type Root}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot - * @generated - */ - public Adapter createJDTTypeRootAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment JDT Package Fragment}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment - * @generated - */ - public Adapter createJDTPackageFragmentAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot JDT Package Fragment Root}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot - * @generated - */ - public Adapter createJDTPackageFragmentRootAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject JDT Java Project}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject - * @generated - */ - public Adapter createJDTJavaProjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel JDT Java Model}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel - * @generated - */ - public Adapter createJDTJavaModelAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass JDT Class}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass - * @generated - */ - public Adapter createJDTClassAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface JDT Interface}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface - * @generated - */ - public Adapter createJDTInterfaceAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum JDT Enum}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum - * @generated - */ - public Adapter createJDTEnumAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration JDT Import Declaration}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration - * @generated - */ - public Adapter createJDTImportDeclarationAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer JDT Import Container}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer - * @generated - */ - public Adapter createJDTImportContainerAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException JDT Exception}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException - * @generated - */ - public Adapter createJDTExceptionAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody JDT Opaque Body}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody - * @generated - */ - public Adapter createJDTOpaqueBodyAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } - -} // JdtmmAdapterFactory diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmPreference.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmPreference.java deleted file mode 100644 index 71f10f9be80..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmPreference.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util; - -public class JdtmmPreference { - - private static String classMultiValue = "List"; - - /** - * Set value of class used for the MultiValue - * - * @param classMultiValue - */ - public static void setClassMultiValue(String classMultiValue) { - JdtmmPreference.classMultiValue = classMultiValue; - } - - /** - * get value of class used for the MultiValue - * - * @param classMultiValue - */ - public static String getMultiValued(String typeName) { - return classMultiValue + "<" + getPrimiveTypeClass(typeName) + ">"; - } - - /** - * return the Class of a primitive type (ex : int => Integer) - * - * @param typename - * @return true if typename is a primive type - */ - private static String getPrimiveTypeClass(String typename) { - if (typename.equals("byte")) { - return "Byte"; - } - if (typename.equals("char")) { - return "Character"; - } - if (typename.equals("double")) { - return "Double"; - } - if (typename.equals("float")) { - return "Float"; - } - if (typename.equals("int")) { - return "Integer"; - } - if (typename.equals("long")) { - return "Long"; - } - if (typename.equals("short")) { - return "Short"; - } - if (typename.equals("boolean")) { - return "Boolean"; - } - return typename; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmSwitch.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmSwitch.java deleted file mode 100644 index 54c63e6116d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmSwitch.java +++ /dev/null @@ -1,880 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.util.Switch; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * - * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage - * @generated - */ -public class JdtmmSwitch extends Switch { - - /** - * The cached model package - * - * - * - * @generated - */ - protected static JdtmmPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * - * @generated - */ - public JdtmmSwitch() { - if (modelPackage == null) { - modelPackage = JdtmmPackage.eINSTANCE; - } - } - - /** - * Checks whether this is a switch for the given package. - * - * - * - * @parameter ePackage the package in question. - * @return whether this is a switch for the given package. - * @generated - */ - @Override - protected boolean isSwitchFor(EPackage ePackage) { - return ePackage == modelPackage; - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - @Override - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case JdtmmPackage.JDT_METHOD_BODY: { - JDTMethodBody jdtMethodBody = (JDTMethodBody) theEObject; - T result = caseJDTMethodBody(jdtMethodBody); - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_METHOD: { - JDTMethod jdtMethod = (JDTMethod) theEObject; - T result = caseJDTMethod(jdtMethod); - if (result == null) { - result = caseJDTMember(jdtMethod); - } - if (result == null) { - result = caseJDTParentJavaElement(jdtMethod); - } - if (result == null) { - result = caseJDTJavaElement(jdtMethod); - } - if (result == null) { - result = caseJDTParent(jdtMethod); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_MEMBER: { - JDTMember jdtMember = (JDTMember) theEObject; - T result = caseJDTMember(jdtMember); - if (result == null) { - result = caseJDTParentJavaElement(jdtMember); - } - if (result == null) { - result = caseJDTJavaElement(jdtMember); - } - if (result == null) { - result = caseJDTParent(jdtMember); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT: { - JDTParentJavaElement jdtParentJavaElement = (JDTParentJavaElement) theEObject; - T result = caseJDTParentJavaElement(jdtParentJavaElement); - if (result == null) { - result = caseJDTJavaElement(jdtParentJavaElement); - } - if (result == null) { - result = caseJDTParent(jdtParentJavaElement); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_PARENT: { - JDTParent jdtParent = (JDTParent) theEObject; - T result = caseJDTParent(jdtParent); - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_JAVA_ELEMENT: { - JDTJavaElement jdtJavaElement = (JDTJavaElement) theEObject; - T result = caseJDTJavaElement(jdtJavaElement); - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_TYPE_PARAMETER: { - JDTTypeParameter jdtTypeParameter = (JDTTypeParameter) theEObject; - T result = caseJDTTypeParameter(jdtTypeParameter); - if (result == null) { - result = caseJDTJavaElement(jdtTypeParameter); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_TYPE: { - JDTType jdtType = (JDTType) theEObject; - T result = caseJDTType(jdtType); - if (result == null) { - result = caseJDTMember(jdtType); - } - if (result == null) { - result = caseJDTParentJavaElement(jdtType); - } - if (result == null) { - result = caseJDTJavaElement(jdtType); - } - if (result == null) { - result = caseJDTParent(jdtType); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_FIELD: { - JDTField jdtField = (JDTField) theEObject; - T result = caseJDTField(jdtField); - if (result == null) { - result = caseJDTMember(jdtField); - } - if (result == null) { - result = caseJDTParentJavaElement(jdtField); - } - if (result == null) { - result = caseJDTJavaElement(jdtField); - } - if (result == null) { - result = caseJDTParent(jdtField); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_COMPILATION_UNIT: { - JDTCompilationUnit jdtCompilationUnit = (JDTCompilationUnit) theEObject; - T result = caseJDTCompilationUnit(jdtCompilationUnit); - if (result == null) { - result = caseJDTTypeRoot(jdtCompilationUnit); - } - if (result == null) { - result = caseJDTParentJavaElement(jdtCompilationUnit); - } - if (result == null) { - result = caseJDTJavaElement(jdtCompilationUnit); - } - if (result == null) { - result = caseJDTParent(jdtCompilationUnit); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_TYPE_ROOT: { - JDTTypeRoot jdtTypeRoot = (JDTTypeRoot) theEObject; - T result = caseJDTTypeRoot(jdtTypeRoot); - if (result == null) { - result = caseJDTParentJavaElement(jdtTypeRoot); - } - if (result == null) { - result = caseJDTJavaElement(jdtTypeRoot); - } - if (result == null) { - result = caseJDTParent(jdtTypeRoot); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_PACKAGE_FRAGMENT: { - JDTPackageFragment jdtPackageFragment = (JDTPackageFragment) theEObject; - T result = caseJDTPackageFragment(jdtPackageFragment); - if (result == null) { - result = caseJDTParentJavaElement(jdtPackageFragment); - } - if (result == null) { - result = caseJDTJavaElement(jdtPackageFragment); - } - if (result == null) { - result = caseJDTParent(jdtPackageFragment); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT: { - JDTPackageFragmentRoot jdtPackageFragmentRoot = (JDTPackageFragmentRoot) theEObject; - T result = caseJDTPackageFragmentRoot(jdtPackageFragmentRoot); - if (result == null) { - result = caseJDTParentJavaElement(jdtPackageFragmentRoot); - } - if (result == null) { - result = caseJDTJavaElement(jdtPackageFragmentRoot); - } - if (result == null) { - result = caseJDTParent(jdtPackageFragmentRoot); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_JAVA_PROJECT: { - JDTJavaProject jdtJavaProject = (JDTJavaProject) theEObject; - T result = caseJDTJavaProject(jdtJavaProject); - if (result == null) { - result = caseJDTParentJavaElement(jdtJavaProject); - } - if (result == null) { - result = caseJDTJavaElement(jdtJavaProject); - } - if (result == null) { - result = caseJDTParent(jdtJavaProject); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_JAVA_MODEL: { - JDTJavaModel jdtJavaModel = (JDTJavaModel) theEObject; - T result = caseJDTJavaModel(jdtJavaModel); - if (result == null) { - result = caseJDTParentJavaElement(jdtJavaModel); - } - if (result == null) { - result = caseJDTJavaElement(jdtJavaModel); - } - if (result == null) { - result = caseJDTParent(jdtJavaModel); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_PARAMETER: { - JDTParameter jdtParameter = (JDTParameter) theEObject; - T result = caseJDTParameter(jdtParameter); - if (result == null) { - result = caseJDTMember(jdtParameter); - } - if (result == null) { - result = caseJDTParentJavaElement(jdtParameter); - } - if (result == null) { - result = caseJDTJavaElement(jdtParameter); - } - if (result == null) { - result = caseJDTParent(jdtParameter); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_CLASS: { - JDTClass jdtClass = (JDTClass) theEObject; - T result = caseJDTClass(jdtClass); - if (result == null) { - result = caseJDTType(jdtClass); - } - if (result == null) { - result = caseJDTMember(jdtClass); - } - if (result == null) { - result = caseJDTParentJavaElement(jdtClass); - } - if (result == null) { - result = caseJDTJavaElement(jdtClass); - } - if (result == null) { - result = caseJDTParent(jdtClass); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_INTERFACE: { - JDTInterface jdtInterface = (JDTInterface) theEObject; - T result = caseJDTInterface(jdtInterface); - if (result == null) { - result = caseJDTType(jdtInterface); - } - if (result == null) { - result = caseJDTMember(jdtInterface); - } - if (result == null) { - result = caseJDTParentJavaElement(jdtInterface); - } - if (result == null) { - result = caseJDTJavaElement(jdtInterface); - } - if (result == null) { - result = caseJDTParent(jdtInterface); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_ENUM: { - JDTEnum jdtEnum = (JDTEnum) theEObject; - T result = caseJDTEnum(jdtEnum); - if (result == null) { - result = caseJDTType(jdtEnum); - } - if (result == null) { - result = caseJDTMember(jdtEnum); - } - if (result == null) { - result = caseJDTParentJavaElement(jdtEnum); - } - if (result == null) { - result = caseJDTJavaElement(jdtEnum); - } - if (result == null) { - result = caseJDTParent(jdtEnum); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_IMPORT_DECLARATION: { - JDTImportDeclaration jdtImportDeclaration = (JDTImportDeclaration) theEObject; - T result = caseJDTImportDeclaration(jdtImportDeclaration); - if (result == null) { - result = caseJDTJavaElement(jdtImportDeclaration); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_IMPORT_CONTAINER: { - JDTImportContainer jdtImportContainer = (JDTImportContainer) theEObject; - T result = caseJDTImportContainer(jdtImportContainer); - if (result == null) { - result = caseJDTParentJavaElement(jdtImportContainer); - } - if (result == null) { - result = caseJDTJavaElement(jdtImportContainer); - } - if (result == null) { - result = caseJDTParent(jdtImportContainer); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_EXCEPTION: { - JDTException jdtException = (JDTException) theEObject; - T result = caseJDTException(jdtException); - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JdtmmPackage.JDT_OPAQUE_BODY: { - JDTOpaqueBody jdtOpaqueBody = (JDTOpaqueBody) theEObject; - T result = caseJDTOpaqueBody(jdtOpaqueBody); - if (result == null) { - result = caseJDTMethodBody(jdtOpaqueBody); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - default: - return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Method Body'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Method Body'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTMethodBody(JDTMethodBody object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Java Element'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Java Element'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTJavaElement(JDTJavaElement object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Parent'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Parent'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTParent(JDTParent object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Member'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Member'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTMember(JDTMember object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Parent Java Element'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Parent Java Element'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTParentJavaElement(JDTParentJavaElement object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Type Parameter'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Type Parameter'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTTypeParameter(JDTTypeParameter object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Field'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Field'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTField(JDTField object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Type'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Type'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTType(JDTType object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Method'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Method'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTMethod(JDTMethod object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Parameter'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Parameter'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTParameter(JDTParameter object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Compilation Unit'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Compilation Unit'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTCompilationUnit(JDTCompilationUnit object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Type Root'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Type Root'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTTypeRoot(JDTTypeRoot object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Package Fragment'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Package Fragment'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTPackageFragment(JDTPackageFragment object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Package Fragment Root'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Package Fragment Root'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTPackageFragmentRoot(JDTPackageFragmentRoot object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Java Project'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Java Project'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTJavaProject(JDTJavaProject object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Java Model'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Java Model'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTJavaModel(JDTJavaModel object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Class'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Class'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTClass(JDTClass object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Interface'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Interface'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTInterface(JDTInterface object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Enum'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Enum'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTEnum(JDTEnum object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Import Declaration'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Import Declaration'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTImportDeclaration(JDTImportDeclaration object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Import Container'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Import Container'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTImportContainer(JDTImportContainer object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Exception'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Exception'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTException(JDTException object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'JDT Opaque Body'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'JDT Opaque Body'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJDTOpaqueBody(JDTOpaqueBody object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - @Override - public T defaultCase(EObject object) { - return null; - } - -} // JdtmmSwitch diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitor.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitor.java deleted file mode 100644 index 96f258be762..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitor.java +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor; - -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; - - -/** - * - */ -public interface JDTVisitor { - - /** - * - * @param element - */ - void visit(JDTJavaElement element) throws JDTVisitorException; - -} // JDTVisitor diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitorException.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitorException.java deleted file mode 100644 index d2d1d0b8ae8..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitorException.java +++ /dev/null @@ -1,42 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor; - -public class JDTVisitorException extends Exception { - - /** - * - */ - private static final long serialVersionUID = 1L; - - public JDTVisitorException() { - super(); - } - - public JDTVisitorException(String arg0, Throwable arg1) { - super(arg0, arg1); - } - - public JDTVisitorException(String arg0) { - super(arg0); - } - - public JDTVisitorException(Throwable arg0) { - super(arg0); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/utils/DerivedNotifyingEList.java b/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/utils/DerivedNotifyingEList.java deleted file mode 100644 index 6f5bdd9b327..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/utils/DerivedNotifyingEList.java +++ /dev/null @@ -1,442 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2010 LIFL & CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin (LIFL) cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.metamodel.jdt.utils; - -import java.util.AbstractSequentialList; -import java.util.ListIterator; -import java.util.NoSuchElementException; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.NotifyingList; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.common.notify.impl.NotificationImpl; -import org.eclipse.emf.common.util.AbstractEList; -import org.eclipse.emf.common.util.EList; - - -/** - * A List derived from an original list. - * - *
- * Some code from org.eclipse.emf.common.util.AbstractEList - * - * @author cedric dumoulin - * - * @param E - * Expected type of this derived list's item. I.e. the type returned by this list get() method. - * @param T - * Type of the original list elements' - */ -public abstract class DerivedNotifyingEList extends AbstractSequentialList implements EList, NotifyingList { - - - /** - * The original List - */ - protected NotifyingList backupList; - - /** - * Notifier used to notify changes in the list - */ - private Object notifier; - - /** - * Feature in the list that correspond to the list. - */ - private Object feature; - - /** - * Feature ID - */ - private int featureID; - - /** - * Listener on backuplist. - * TODO : use weakreference in order to enable garbage on this class. - */ - private Adapter backupListChangeListener = new AdapterImpl() { - - /** - * Event receive when the backupList is changed. - * - * @param msg - */ - @Override - public void notifyChanged(Notification msg) { - - // Retains only changes from the backuplist - if (msg.getNotifier() != backupList.getNotifier() || msg.getFeature() != backupList.getFeature()) { - return; - } - - // create a new Notification and throw event to its Notifier - NotificationImpl newNotification = createNotification(msg); - newNotification.dispatch(); - - } - }; - - /** - * Constructor. - * The backupList is used as notifier. Feature is set to null and featureID to 0. - * - */ - public DerivedNotifyingEList(NotifyingList backupList) { - - this(backupList, backupList.getNotifier(), null, 0); - } - - /** - * Constructor. - * - * @param backupList - * @param notifier - * @param feature - * @param featureID - */ - public DerivedNotifyingEList(NotifyingList backupList, Object feature, int featureID) { - - this(backupList, backupList.getNotifier(), feature, featureID); - } - - /** - * Final Constructor.
- * Feature and featureID should be different from the backupList.feature and backupList.featureID - * - * @param backupList - * @param notifier - * @param feature - * The feature in the notifier that represent this list. - * @param featureID - * The feature ID - */ - public DerivedNotifyingEList(NotifyingList backupList, Object notifier, Object feature, int featureID) { - - // Check values - if (feature == backupList.getFeature() || featureID == backupList.getFeatureID()) { - throw new IllegalArgumentException("Feature and featureID should be different from the backupList.feature and backupList.featureID. [" - + feature + "==" - + backupList.getFeature() + " - " - + featureID + "==" - + backupList.getFeatureID() - + "]"); - } - - // Set properties - this.backupList = backupList; - this.notifier = notifier; - this.feature = feature; - this.featureID = featureID; - attachListener(); - } - - /** - * Listen to changes in backupList. - */ - protected void attachListener() { - ((Notifier) notifier).eAdapters().add(backupListChangeListener); - } - - /** - * @see org.eclipse.emf.common.notify.NotifyingList#getNotifier() - * - * @return - */ - @Override - public Object getNotifier() { - return notifier; - } - - /** - * @see org.eclipse.emf.common.notify.NotifyingList#getFeature() - * - * @return - */ - @Override - public Object getFeature() { - return feature; - } - - /** - * @see org.eclipse.emf.common.notify.NotifyingList#getFeatureID() - * - * @return - */ - @Override - public int getFeatureID() { - return featureID; - } - - /** - * Creates a notification. - * - * @param eventType - * the type of change that has occurred. - * @param oldObject - * the value of the notifier's feature before the change occurred. - * @param newObject - * the value of the notifier's feature after the change occurred. - * @param index - * the position at which the change occurred. - * @return a new notification. - */ - protected NotificationImpl createNotification(Notification origNotification) - { - - return new NotificationImpl(origNotification.getEventType(), origNotification.getOldValue(), origNotification.getNewValue(), origNotification.getPosition(), origNotification.wasSet()) - { - - @Override - public Object getNotifier() - { - return DerivedNotifyingEList.this.getNotifier(); - } - - @Override - public Object getFeature() - { - return DerivedNotifyingEList.this.getFeature(); - } - - @Override - public int getFeatureID(Class expectedClass) - { - return DerivedNotifyingEList.this.getFeatureID(); - } - }; - } - - public NotifyingList getBackupList() { - return backupList; - } - - /** - * Get the object at the specified index in the backup list. - * Subclass should override in order to return the proper object. - * - * @param index - * @return - */ - abstract protected E doGet(int index); - - /** - * @see org.eclipse.emf.common.util.EList#move(int, java.lang.Object) - * - * @param newPosition - * @param object - */ - @Override - public void move(int newPosition, E object) { - move(newPosition, indexOf(object)); - } - - /** - * @see org.eclipse.emf.common.util.EList#move(int, int) - * - * @param newPosition - * @param oldPosition - * @return - */ - @Override - public E move(int newPosition, int oldPosition) { - throw new UnsupportedOperationException(); - } - - /** - * @see java.util.AbstractCollection#size() - * - * @return - */ - @Override - public int size() { - return backupList.size(); - } - - /** - * @see java.util.AbstractSequentialList#listIterator(int) - * - * @param index - * @return - */ - @Override - public ListIterator listIterator(int index) { - return new DerivedListIterator(index); - } - - /** - * - * - * @param - */ - public class DerivedListIterator implements ListIterator { - - /** - * The current position of the iterator. - */ - protected int cursor = 0; - - /** - * The previous position of the iterator. - */ - protected int lastCursor = -1; - - /** - * The modification count of the containing list. - */ - protected int expectedModCount = modCount; - - - /** - * Creates an instance advanced to the index. - * - * @param index - * the starting index. - */ - public DerivedListIterator(int index) - { - cursor = index; - } - - /** - * Returns whether there are more objects. - * - * @return whether there are more objects. - */ - @Override - public boolean hasNext() - { - return cursor != size(); - } - - /** - * Returns the next object and advances the iterator. - * This implementation delegates to {@link #doNext doNext}. - * - * @return the next object. - * @exception NoSuchElementException - * if the iterator is done. - */ - @Override - public E next() - { - try - { - E next = doGet(cursor); - lastCursor = cursor++; - return next; - } catch (IndexOutOfBoundsException exception) - { - throw new NoSuchElementException(); - } - } - - /** - * Returns whether there are more objects for {@link #previous}. - * Returns whether there are more objects. - */ - @Override - public boolean hasPrevious() - { - return cursor != 0; - } - - /** - * Returns the previous object and advances the iterator. - * This implementation delegates to {@link #doPrevious doPrevious}. - * - * @return the previous object. - * @exception NoSuchElementException - * if the iterator is done. - */ - @Override - public E previous() - { - try - { - E previous = doGet(--cursor); - lastCursor = cursor; - return previous; - } catch (IndexOutOfBoundsException exception) - { - throw new NoSuchElementException(); - } - } - - /** - * Returns the index of the object that would be returned by calling {@link #next() next}. - * - * @return the index of the object that would be returned by calling next. - */ - @Override - public int nextIndex() - { - return cursor; - } - - /** - * Returns the index of the object that would be returned by calling {@link #previous previous}. - * - * @return the index of the object that would be returned by calling previous. - */ - @Override - public int previousIndex() - { - return cursor - 1; - } - - /** - * Sets the object at the index of the last call to {@link #next() next} or {@link #previous previous}. - * This implementation delegates to {@link AbstractEList#set set}. - * - * @param object - * the object to set. - * @exception IllegalStateException - * if next or previous have not yet been called, - * or {@link #remove(Object) remove} or {@link #add add} have already been called - * after the last call to next or previous. - */ - @Override - public void set(E object) - { - throw new UnsupportedOperationException(); - } - - /** - * Adds the object at the {@link #next() next} index and advances the iterator past it. - * This implementation delegates to {@link #doAdd(Object) doAdd(E)}. - * - * @param object - * the object to add. - */ - @Override - public void add(E object) - { - throw new UnsupportedOperationException(); - } - - /** - * @see java.util.ListIterator#remove() - * - */ - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.classpath b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.project b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.project deleted file mode 100644 index 42aed9bd201..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.project +++ /dev/null @@ -1,38 +0,0 @@ - - - org.eclipse.papyrus.java.generator.transfo.umltojdt - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.m2m.qvt.oml.project.QVTOBuilder - - - src_container - transforms - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.m2m.qvt.oml.project.QVTONature - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.core.prefs b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94d61f00da6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/META-INF/MANIFEST.MF b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/META-INF/MANIFEST.MF deleted file mode 100644 index e126b18f3b0..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/META-INF/MANIFEST.MF +++ /dev/null @@ -1,10 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.java.generator.transfo.umltojdt -Require-Bundle: org.eclipse.core.runtime -Bundle-Vendor: %providerName -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.java.generator.transfo.umltojdt -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/about.html b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/build.properties b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/build.properties deleted file mode 100644 index 60a87c754ae..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - transforms/,\ - plugin.properties,\ - about.html -src.includes = about.html diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.di b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.di deleted file mode 100644 index 9d143f73599..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.di +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.notation b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.notation deleted file mode 100644 index 08d0a52ccd9..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.notation +++ /dev/null @@ -1,775 +0,0 @@ - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.uml b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.uml deleted file mode 100644 index dda3161236d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.uml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/plugin.properties b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/plugin.properties deleted file mode 100644 index 7d387085329..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/plugin.properties +++ /dev/null @@ -1,19 +0,0 @@ - -################################################################################# -# Copyright (c) 2011 Nicolas Deblock & Manuel Giles. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation -# Manuel Giles giles.manu@live.fr - Initial API and implementation -# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception -# -################################################################################# - - -pluginName=Papyrus Java Classes Generator transformations (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/pom.xml b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/pom.xml deleted file mode 100644 index c699cf62b22..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.java.generator.transfo.umltojdt - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/src/org/eclipse/papyrus/java/generator/transfo/umltojdt/UmltojdtActivator.java b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/src/org/eclipse/papyrus/java/generator/transfo/umltojdt/UmltojdtActivator.java deleted file mode 100644 index d4160d94245..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/src/org/eclipse/papyrus/java/generator/transfo/umltojdt/UmltojdtActivator.java +++ /dev/null @@ -1,71 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial transformation and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial transformation and implementation - * Manuel Giles giles.manu@live.fr - Initial transformation and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.transfo.umltojdt; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class UmltojdtActivator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.java.generator.transfo.umltojdt"; - public static final String PATH_QVT_FILE = "/transforms/uml/uml2jdt2.qvto"; - - // The shared instance - private static UmltojdtActivator plugin; - - /** - * The constructor - */ - public UmltojdtActivator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static UmltojdtActivator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/algo.txt b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/algo.txt deleted file mode 100644 index bdcd72a922b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/algo.txt +++ /dev/null @@ -1,167 +0,0 @@ - - -class Data { - - projectName - srcName - packageName -} - -/** - * - */ -Type::markType( Type type, defSrc, defPrj ) { - if( type.data == null ) - type.data = getTypeData(); - -} - -// Get or create the Data for this Type -Type::getTypeData(defSrc, defPrj) : Data { - - // Check if it exist - if( type.data != null ) - return type.data ; - - // Create it - Data data = new Data(); - // srcName = si stereotype ==> stereotype; sinon si parent ==> parent.srcName; sinon defSrc - if( parent != null ) { - parentData = parent.getData(defSrc, defPrj); - data.srcName = getStereotype( , "src", parentData.srcName ); - projectName = getStereotype( , "project", parentData.projectName ); - packageName = parentData.packageName; - } - else { - data.srcName = getStereotype( , "src", defSrc ); - projectName = getStereotype( , "project", defPrj ); - packageName = DFLT_PACKAGE_NAME; - } - - return type.data; -} - -// Get or create the Data for this Package -// Check if the package is a src or project -Package::getTypeData(defSrc, defPrj) : Data { - - // Check if it exist - if( type.data != null ) - return type.data ; - - // Create it - // Data data = new Data(); - - // Are we a "src" ? - if( isStereotyped("src") ) { - return createTypeDataFromSrcFolder(defSrc, defPrj); - } - else if( isStereotyped("project") ) { - return createTypeDataFromProject(defSrc, defPrj); - } - else if( self.isTypeOf(uml::Model) ) { - // This is a simple package - return createTypeDataFromUmlModel(defSrc, defPrj); - } - else { - // This is a simple package - return createTypeDataFromSimplePackage(defSrc, defPrj); - } -} - -// Get or create the Data for this simple Package -// -// Don't check if the package is a src or project -Package::createTypeDataFromSimplePackage(defSrc, defPrj) : Data { - - Data data = new Data(); - // srcName = si stereotype ==> stereotype; sinon si parent ==> parent.srcName; sinon defSrc - if( parent != null ) { - parentData = parent.getData(defSrc, defPrj); - data.srcName = getStereotype( "JavaPackage", "src", parentData.srcName ); - projectName = getStereotype( , "project", parentData.projectName ); - // packageName = parentData.packageName + "." + (stereotype ? stereotype: self.name) - packageName = computePackageName( parentData.packageName, getStereotype( , "name", self.name ) ); - } - else { - data.srcName = getStereotype( "JavaPackage", "src", defSrc ); - projectName = getStereotype( , "project", defPrj ); - packageName = getStereotype( , "name", self.name ); - } - - return type.data; - -} - -// Compute the package name from the prefix and suffix. -// check if prefix is null or size=0 -computePackageName( prefix, suffix ) { - if( prefix != null && prefix != "") - return prefix + "." + suffix; - else - return suffix; -} - -// Get or create the Data for a Package Stereotypes "SrcFolder" -// -// Don't Check if the package is a src or project -Package::createTypeDataFromSourceFolder(defSrc, defPrj) : Data { - - Data data = new Data(); - // srcName = si stereotype ==> stereotype; sinon si parent ==> parent.srcName; sinon defSrc - if( parent != null ) { - // Lookup for Project - parentData = parent.getData(defSrc, defPrj); - data.srcName = getStereotype( "JavaSrcFolder", "src", parentData.srcName ); - projectName = getStereotype( , "project", parentData.projectName ); - // packageName = "" or null, as we are in a srcFolder (root of packages) - packageName = null; - } - else { - data.srcName = getStereotype( "JavaPackage", "src", defSrc ); - projectName = getStereotype( , "project", defPrj ); - packageName = null; - } - - return type.data; -} - -// Get or create the Data for a Package Stereotypes "Project" -// -// Don't Check if the package is a src or project -Package::createTypeDataFromProjectFolder(defSrc, defPrj) : Data { - - Data data = new Data(); - - data.srcName = getStereotype( "JavaProject", "src", defSrc ); - projectName = getStereotype( , "project", defPrj ); - packageName = null; - - return type.data; -} - -// Get or create the Data for a uml::Model -// This is the root, so stop recursivity -// Don't Check if the package is a src or project -Package::createTypeDataFromUmlModel(defSrc, defPrj) : Data { - - Data data = new Data(); - - data.srcName = gdefSrc; - projectName = defPrj ; - packageName = null; - - return type.data; -} - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/stereotypeUtil.qvto b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/stereotypeUtil.qvto deleted file mode 100644 index 98c70005c93..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/stereotypeUtil.qvto +++ /dev/null @@ -1,99 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Cedric Dumoulin - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial implementation - * - *****************************************************************************/ - - library stereotypeUtil; - -/* Model type declarations -*/ -modeltype mmUML uses "http://www.eclipse.org/uml2/3.0.0/UML"; - -/* - * Get the specified taggedValue. Return the found property value, or the provided default value if not - * taggedValue can be found. - */ -query mmUML::NamedElement::getTaggedValue(stereotypeName : String, taggedValueName : String, defaultValue : OclAny) : OclAny { - - var value : OclAny := defaultValue; - var stereotype := self.getAppliedStereotype(stereotypeName); - if (stereotype.oclIsUndefined()) - then - return value - endif; - - var taggedValue := self.getValue(stereotype, taggedValueName); - if taggedValue.oclIsUndefined() - then - return defaultValue - endif; - - return taggedValue; -} - -query mmUML::NamedElement::getTaggedValues(stereotypeName : String, taggedValueName : String, defaultValue : Set(OclAny)) : Set(OclAny) { - - var value : Set(OclAny) := defaultValue; - var stereotype := self.getAppliedStereotype(stereotypeName); - if (stereotype.oclIsUndefined()) - then - return value - endif; - - var taggedValue := self.getValue(stereotype, taggedValueName); - if taggedValue->size() <=0 - then - return defaultValue - endif; - - return taggedValue->asSet(); -} - - -/* - * Get a tagged value by its name and the sterotype name. - * Return null if no stereotype of taggedValue is defined. - */ -query uml::NamedElement::getBooleanTaggedValue( stereotypeName : String, taggedValueName : String ) : Boolean { - - return self.getTaggedValue(stereotypeName, taggedValueName, null).oclAsType(Boolean); -} - -/* - * Get the specified taggedValue. Return the found property value, or the provided default value if not - * taggedValue can be found. - */ -query mmUML::NamedElement::getBooleanTaggedValue(stereotypeName : String, valueName : String, defaultValue : Boolean) : Boolean { - - return self.getTaggedValue(stereotypeName, valueName, defaultValue).oclAsType(Boolean); -} - - -/* - * Get the specified taggedValue. Return the found property value, or the provided default value if not - * taggedValue can be found. - */ -query mmUML::NamedElement::getStringTaggedValue(stereotypeName : String, valueName : String, defaultValue : String) : String { - - return self.getTaggedValue(stereotypeName, valueName, defaultValue).oclAsType(String); -} - -/* - * Get the specified taggedValue. Return the found property value, or the provided default value if not - * taggedValue can be found. - */ -query mmUML::NamedElement::getEnumTaggedValue(stereotypeName : String, valueName : String, defaultValue : String) : String { - var ret = self.getTaggedValue(stereotypeName, valueName,defaultValue); - if (not ret.oclIsTypeOf(EnumerationLiteral)) then return defaultValue endif; - return self.getTaggedValue(stereotypeName, valueName,defaultValue).oclAsType(EnumerationLiteral).name; -} - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/uml2jdt2.qvto b/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/uml2jdt2.qvto deleted file mode 100644 index e2a43a4cf6e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/uml2jdt2.qvto +++ /dev/null @@ -1,1269 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial transformation and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial transformation and implementation - * Manuel Giles giles.manu@live.fr - Initial transformation and implementation - * - *****************************************************************************/ - -import stereotypeUtil; -import Strings; - -/* Model type declarations -*/ -modeltype UMLmm uses "http://www.eclipse.org/uml2/3.0.0/UML"; -modeltype JDTmm uses 'http:///jdtmm.ecore'; -modeltype GeneratorOptionsMM uses 'http:///GeneratorOptionsMM.ecore'; -modeltype JavaProfile uses java('http://www.eclipse.org/papyrus/JAVA/1'); - -/** - * - */ -transformation uml2jdt2( in uml: UMLmm, in options : GeneratorOptionsMM, out jdt: JDTmm) - extends stereotypeUtil; - -/** Root of java stereotypes */ -intermediate property UMLmm::STEREOTYPE_JAVA_NAMED_ELEMENT : String; -intermediate property UMLmm::STEREOTYPE_JAVA_GEN : String; -/** Apply to any Types */ -intermediate property UMLmm::STEREOTYPE_JAVA_CLASS : String; -intermediate property UMLmm::STEREOTYPE_JAVA_METHOD : String; -intermediate property UMLmm::STEREOTYPE_JAVA_PROPERTY : String; -intermediate property UMLmm::STEREOTYPE_JAVA_PROJECT : String; -intermediate property UMLmm::STEREOTYPE_JAVA_SRC_FOLDER : String; -intermediate property UMLmm::STEREOTYPE_JAVA_PACKAGE : String; -intermediate property UMLmm::STEREOTYPE_PRIMITIVETYPE : String; - -intermediate property UMLmm::TAGVALUE_SRC : String; -intermediate property UMLmm::TAGVALUE_PROJECT : String; -intermediate property UMLmm::TAGVALUE_NAME : String; -intermediate property UMLmm::TAGVALUE_GENERATED : String; -intermediate property UMLmm::TAGVALUE_IMPLEMENTATION_CLASS : String; -intermediate property UMLmm::TAGVALUE_EXPLICIT_REQUIRED_IMPORTS : String; -intermediate property UMLmm::TAGVALUE_EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS : String; -intermediate property UMLmm::NO_PACKAGE : String; -/** Default name values for generation */ -intermediate property UMLmm::GENERATION_DEFAULT_SRC_NAME : String; -intermediate property UMLmm::GENERATION_DEFAULT_PROJECT_NAME : String; - -/** - * The main operation. This is the entry point of the transformation. - */ -main() { - - // Initialize global variables - uml.STEREOTYPE_JAVA_NAMED_ELEMENT := "java::JavaNamedElement"; - uml.STEREOTYPE_JAVA_GEN := "java::JavaGen"; - uml.STEREOTYPE_JAVA_CLASS := "java::JavaClass"; - uml.STEREOTYPE_JAVA_METHOD := "java::JavaMethod"; - uml.STEREOTYPE_JAVA_PROPERTY := "java::JavaProperty"; - uml.STEREOTYPE_JAVA_PROJECT := "java::JavaProject"; - uml.STEREOTYPE_JAVA_SRC_FOLDER := "java::JavaSrcFolder"; - uml.STEREOTYPE_JAVA_PACKAGE := "java::JavaPackage_"; - uml.STEREOTYPE_PRIMITIVETYPE := "java::PrimitiveType"; - - uml.TAGVALUE_SRC := "srcName"; - uml.TAGVALUE_NAME := "name"; - uml.TAGVALUE_GENERATED := "isGenerated"; - uml.TAGVALUE_PROJECT := "projectName"; - uml.TAGVALUE_IMPLEMENTATION_CLASS := "implementationClass"; - uml.TAGVALUE_EXPLICIT_REQUIRED_IMPORTS := "explicitRequiredImports"; - uml.TAGVALUE_EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS := "explicitPlainTextRequiredImports"; - uml.NO_PACKAGE := null; - - // Default names - uml.GENERATION_DEFAULT_SRC_NAME := options.objectsOfType(GeneratorOptionsMM::Options)->asSequence()->first().defaultSourceFolder; - uml.GENERATION_DEFAULT_PROJECT_NAME := "defaultProject"; - - // Select only object that we want to generate - var types : Set(uml::Type) := uml.objects()[uml::Type]->select(o | - o.oclIsTypeOf(uml::Class) - or o.oclIsTypeOf(uml::Interface) - or o.oclIsTypeOf(uml::PrimitiveType) - or o.oclIsTypeOf(uml::Enumeration) ); - - log('------------------------ Start marking input elements'); - // First pass: mark uml::Type objects - types -> map markUmlType(uml.GENERATION_DEFAULT_SRC_NAME, uml.GENERATION_DEFAULT_PROJECT_NAME); - // show result - log('------------------------ Show results'); - types -> map showMarkedType(); - log('------------------------ Show packages results'); - uml.objects()[uml::Package] -> map showMarkedType(); - // Second pass: transform marked objects - log('------------------------ Start transformation'); - types -> map transformTypeToType(); - - log('------------------------ Done'); - -} - -/** - * A query used to check if a stereotype is applied to an UML element - */ -query uml::Element::isStereotyped( stereotypeName : String ) : Boolean { - var stereotype = self.getAppliedStereotype(stereotypeName); - return not stereotype.oclIsUndefined(); -} - -/** - * Is the specified type a Compilation Unit ? - */ -query uml::Type::isCompilationUnit( ) : Boolean { - - // A compilation unit is a type whose owner is a Package - return self.owner.oclIsKindOf(Package); -} - -/** - * Get the interfaces associated to the Classifier - */ -query uml::Classifier::generalInterfaces() : Set(uml::Interface) { - // Get interface linked by a generalization -// var res : Set(uml::Interface) := self.generalization -> select( p | p.general.oclIsTypeOf(uml::Interface)) -// -> collect(p | p.general.oclAsType(uml::Interface)) -> asSet(); - var res : Set(uml::Interface) := self.generalization.general[uml::Interface] -> asSet(); - - return res; -} - -/** - * Get the class associated to a stereotype. This work for static profile. - */ -query uml::NamedElement::getStereotype(stereotypeName:String) : OclAny { - - var stereotype := self.getAppliedStereotype(stereotypeName); - if (stereotype.oclIsUndefined()) - then - return null - endif; - - return self.getStereotypeApplication(stereotype); -} - - -/** - * Get the JavaClass stereotype from a classifier. - */ -query uml::Classifier::getJavaClassStereotype() : JavaProfile::JavaClass { - - return self.getStereotype(uml.STEREOTYPE_JAVA_CLASS).oclAsType(JavaProfile::JavaClass); -} - -/** - * Get the JavaClass stereotype from a classifier. - */ -query uml::Operation::getJavaMethodStereotype() : JavaProfile::JavaMethod { - - return self.getStereotype(uml.STEREOTYPE_JAVA_METHOD).oclAsType(JavaProfile::JavaMethod); -} - -/** - * Get the JavaClass stereotype from a classifier. - */ -query uml::Property::getJavaPropertyStereotype() : JavaProfile::JavaProperty { - - return self.getStereotype(uml.STEREOTYPE_JAVA_PROPERTY).oclAsType(JavaProfile::JavaProperty); -} - -/** - * Get the ExplicitImports from a classifier. - * Explicit imports are stored in a Stereotype. - */ -query uml::Classifier::getExplicitPlainTextRequiredImports() : Set(String) { - - var emptySet : Set(String) := Set{}; - return self.getTaggedValue( uml.STEREOTYPE_JAVA_CLASS, - uml.TAGVALUE_EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS, - OclAny ) [String]->asSet(); -} - -/** - * Get the interfaces associated to the Classifier - */ -query uml::BehavioredClassifier::generalInterfacesForClass() : Set(uml::Interface) -{ - // Get interface linked by a generalization - // var res : Set(uml::Interface) := self.generalization -> select( p | p.general.oclIsTypeOf(uml::Interface)) - // -> collect(p | p.general.oclAsType(uml::Interface)) -> asSet(); - var res : Set(uml::Interface) := self.generalization.general[uml::Interface] -> asSet(); - - // manage the interfaceRealisation - res += self.oclAsType(uml::BehavioredClassifier).interfaceRealization.supplier[uml::Interface]; - - return res; -} - -/** - * Get the general Class associated to the Enumeration - */ -query uml::Enumeration::general() : uml::Class { - // Get interface linked by a generalization - var res : uml::Class := self.generalization.general[uml::Class] -> asOrderedSet() -> first(); - - return res; -} - -/** - * return true if the element is marked has "toGenerate". Return false otherwise. - */ -query uml::NamedElement::isGenerated() : Boolean { - // by default, generated are true - var generated := true; - - self.getApplicableStereotypes()->forEach(st) { - generated := self->getBooleanTaggedValue("java::"+st.name, "isGenerated",generated)->asOrderedSet()->first(); - }; - - return generated; -} - - -/** - * Compute additional data associated to self. - * How to compute such datas is dependant of the type of self, so dispatch to the appropriate method. - * - * Common ancestor. Dispatch to correct method according to the element's type. - */ -helper NamedElement::getData(defaultSrcName : String, defaultProjectName : String) : TypeMarker { - -// log("NamedElement::getData(self.name=" + self.name + ") "); - - // overloading doesn't work, so we do it manually - if( self.oclIsKindOf(uml::PrimitiveType)) then { - return self.oclAsType(uml::PrimitiveType).getDataFromPrimitiveType( defaultSrcName, defaultProjectName); - } endif; - - if( self.oclIsKindOf(uml::Type)) then { - return self.oclAsType(uml::Type).getDataFromType( defaultSrcName, defaultProjectName); - } - else { - if( self.oclIsKindOf(uml::Package)) then { - return self.oclAsType(uml::Package).getDataFromPackage( defaultSrcName, defaultProjectName); - } endif; - } endif; - // not defined - return null; -} - -/** - * Compute the additional data for a uml::Type. - * Recursively set the additional data for the parent (owner) of this type. - */ -helper Type::getDataFromType( defaultSrcName : String, defaultProjectName : String) : TypeMarker { - - log( "Type::getDataFromType(self.name=" + self.name + ")"); - // Check if data already exist - if not self.data.oclIsUndefined() - then - return self.data - endif; - - // Create it - log("Type::getData() - start creation"); - var data : TypeMarker := object TypeMarker {}; - - var parent :uml::Namespace := self.namespace; - if parent != null - then { - // - var parentData : TypeMarker := parent.getData(defaultSrcName, defaultProjectName); - data.srcName := self.getStringTaggedValue(uml.STEREOTYPE_JAVA_CLASS, uml.TAGVALUE_SRC, parentData.srcName); - data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_CLASS, uml.TAGVALUE_PROJECT, parentData.projectName ); - data.packageName := parentData.packageName; - data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_CLASS, uml.TAGVALUE_GENERATED, true ); - } - else { - data.srcName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_CLASS, uml.TAGVALUE_SRC, defaultSrcName ); - data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_CLASS, uml.TAGVALUE_PROJECT, defaultProjectName ); - data.packageName := uml.NO_PACKAGE; - data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_CLASS, uml.TAGVALUE_GENERATED, true ); - } - endif; - - - self.data := data; - return data; -} - -/** - * Compute the additional data for a uml::Type. - * Recursively set the additional data for the parent (owner) of this type. - * - * Primitive types are stored in the package declared in uml.TAGVALUE_IMPLEMENTATION_CLASS. - * If no implementation class is declared, use the same scheme as Classes. - */ -helper PrimitiveType::getDataFromPrimitiveType( defaultSrcName : String, defaultProjectName : String) : TypeMarker { - - log("Type::getDataFromPrimitiveType(self.name=" + self.name + ")"); - // Check if data already exist - if not self.data.oclIsUndefined() - then - return self.data - endif; - - // Create it - log("Type::getData() - start creation"); - var data : TypeMarker := object TypeMarker {}; - - var parent :uml::Namespace := self.namespace; - if parent != null - then { - // - var parentData : TypeMarker := parent.getData(defaultSrcName, defaultProjectName); - data.srcName := self.getStringTaggedValue(uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_SRC, parentData.srcName); - data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_PROJECT, parentData.projectName ); - data.packageName := parentData.packageName; - data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_GENERATED, parentData.generated ); - } - else { - data.srcName := self.getStringTaggedValue( uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_SRC, defaultSrcName ); - data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_PROJECT, defaultProjectName ); - data.packageName := uml.NO_PACKAGE; - data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_GENERATED, true ); - } - endif; - - // Check if an instance name is set - var instanceClassName := self.getStringTaggedValue(uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_IMPLEMENTATION_CLASS, null); - if( not instanceClassName.oclIsUndefined()) then { - // Try to get the package name from the provided qualified name. - // If none is specified, use the regular package name. - var packageName : String := instanceClassName.findPackageFromQualifiedName(data.packageName); - data.packageName := packageName; - } endif; - - self.data := data; - return data; -} - -/** - * Get the package name of the specified qualifiedname. Return the package name if there is one. - * Return the nameIfNotFound value if no package is set in qualifiedName. - * @param nameIfNotFound Default name returned if no package specified in provided String - */ -query String::findPackageFromQualifiedName( nameIfNotFound : String) : String { - - // Get the index of the last segment - var cur : int := self.lastIndexOf('.'); - // return empty string if not found - var res : String; - // Do strange comparison because of trouble with - // QVTo - if 0>(cur) then { - res := nameIfNotFound; - } - else { - res := self.substring( 1, cur); - } endif; - - return res; -} - -/** - * Get the last name from the specified qualifiedname. - */ -query String::lastNameFromQualifiedName( ) : String { - - // Get the index of the last segment - var cur : Integer := self.lastIndexOf('.'); - // return empty string if not found - var res : String; - // Do strange comparison because of trouble with - // QVTo - if 0>(cur) then { - // Only one name ==> return it - res := self; - } - else { - cur := cur+2; - res := self.substring( cur, self.size()); - } endif; - - return res; -} - - -/** - * Get generation data associated to a Package. - * Associated stereotype are taken into account to compute the GenData - */ -helper Package::getDataFromPackage(defaultSrcName : String, defaultProjectName : String) : TypeMarker { - - log("Type::getDataFromPackage(self.name=" + self.name + ")"); - // Check if data already exist - if not self.data.oclIsUndefined() - then - return self.data - endif; - - var data : TypeMarker; - - // Switch to correct helper, according to stereotype - switch { - case (self.isStereotyped( uml.STEREOTYPE_JAVA_SRC_FOLDER) ) { - // SrcFolder - data := self.createDataFromSrcFolder(defaultSrcName, defaultProjectName); - } - case ( self.isStereotyped( uml.STEREOTYPE_JAVA_PROJECT) ) { - // JavaProject - data := self.createDataFromJavaProject(defaultSrcName, defaultProjectName); - } - case ( self.isStereotyped( uml.STEREOTYPE_JAVA_PACKAGE)) { - // Treat it as a Java Package - // uml::Model and uml::Package can be marked with this stereotype. - // When a uml::Model is marked as package, it is not considered anymore as a root for packages - data := self.createDataFromSimplePackage(defaultSrcName, defaultProjectName); - } - case ( self.oclIsTypeOf(uml::Model) ) { - // uml::Model - // uml::Model is considered as the root of packages. - // So, stop on type Model, except if a STEREOTYPE_JAVA_PACKAGE is set. - data := self.createDataFromUmlModel(defaultSrcName, defaultProjectName); - } - else { - // Default Package - data := self.createDataFromSimplePackage(defaultSrcName, defaultProjectName); - } - }; - - self.data := data; - return data; -} - -/** - * Get or create the Data for a Package Stereotypes "SrcFolder" - */ -helper Package::createDataFromSrcFolder(defaultSrcName : String, defaultProjectName : String) : TypeMarker { - - var data := object TypeMarker {}; - var parent : Namespace := self.namespace; - - if parent != null - then { - // - var parentData : TypeMarker := parent.getData(defaultSrcName, defaultProjectName); - // We are in an SrcFolder, so srcName is either the stereotype.srcName or self.name - data.srcName := self.getStringTaggedValue(uml.STEREOTYPE_JAVA_SRC_FOLDER, uml.TAGVALUE_SRC, self.name); - data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_SRC_FOLDER, uml.TAGVALUE_PROJECT, parentData.projectName ); - // packageName = "" or null, as we are in a srcFolder (root of packages) - data.packageName := uml.NO_PACKAGE; - // Compute generated: (parent.generated == false ? false : taggedValue || true ) - data.generated := if parentData.generated = false then false else self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_SRC_FOLDER, uml.TAGVALUE_GENERATED, true ) endif; - } - else { - data.srcName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_SRC_FOLDER, uml.TAGVALUE_SRC, self.name ); - data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_SRC_FOLDER, uml.TAGVALUE_PROJECT, defaultProjectName ); - // packageName = "" or null, as we are in a srcFolder (root of packages) - data.packageName := uml.NO_PACKAGE; - data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_SRC_FOLDER, uml.TAGVALUE_GENERATED, true ); - } - endif; - - -// self.data := data; - return data; -} - -/** - * Get or create the Data for this simple Package - * Don't check if the package is a src or project - */ -helper Package::createDataFromSimplePackage(defaultSrcName : String, defaultProjectName : String) : TypeMarker { - - var data := object TypeMarker {}; - var parent : Namespace := self.namespace; - - if parent != null - then { - // - var parentData : TypeMarker := parent.getData(defaultSrcName, defaultProjectName); - data.srcName := self.getStringTaggedValue(uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_SRC, parentData.srcName); - data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_PROJECT, parentData.projectName ); - data.packageName := self.computePackageName( parentData.packageName, self.getStringTaggedValue(uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_NAME, self.name) ); - data.generated := if parentData.generated = false then false else self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_GENERATED, true ) endif; - } - else { - // This is the root node, and maybe the stereotype overide some values. - data.srcName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_SRC, defaultSrcName ); - data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_PROJECT, self.name ); - data.packageName := self.getStringTaggedValue(uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_NAME, self.name); - data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_GENERATED, true ); - } - endif; - - -// self.data := data; - return data; -} - -/** - * - */ -helper Package::computePackageName( parentName : String, selfName : String) : String { - if( parentName.oclIsUndefined() or parentName.length() = 0) then { - return selfName; - } endif; - - return parentName + "." + selfName; -} - -/** - * Get or create the Data for a Package Stereotypes "Project" - */ -helper Package::createDataFromJavaProject(defaultSrcName : String, defaultProjectName : String) : TypeMarker { - - var data := object TypeMarker {}; - - data.srcName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_PROJECT, uml.TAGVALUE_SRC, defaultSrcName ); - // We are in a JavaProject, so the name is either the setereotype.projectName, or the folder name - data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_PROJECT, uml.TAGVALUE_PROJECT, self.name ); - // packageName = "" or null, as we are in a srcFolder (root of packages) - data.packageName := uml.NO_PACKAGE; - data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_PROJECT, uml.TAGVALUE_GENERATED, true ); - return data; -} - -/** - * Get or create the Data for a uml::Model with no stereotype - * This is the root, so stop recursivity - */ -helper Package::createDataFromUmlModel(defaultSrcName : String, defaultProjectName : String) : TypeMarker { - - var data := object TypeMarker {}; - - data.srcName := defaultSrcName; - // Use the name of the Model as project name. - data.projectName := self.name; - // packageName = "" or null, as we are in a srcFolder (root of packages) - data.packageName := uml.NO_PACKAGE; - data.generated := true; - return data; -} - -/** - * A class used to hold data on a type - */ -intermediate class TypeMarker { - isCompilationUnit : Boolean; - projectName : String; - srcName : String; - packageName : String; - generated : Boolean = true; - - } - - // log this object -query TypeMarker::show() : String { - return self.projectName + "-" + self.srcName + "-" + self.packageName; -/* - + "(isCu=" + self.isCompilationUnit.repr() - + ", isGenerated=" + self.generated.repr() - + ")"; -*/ - }; - -/** - * Add a property to the uml::Type. This property is filled during the first pass. - * The first pass collect the data that are used during the second pass. - */ -intermediate property uml::NamedElement::data : TypeMarker; - - - -/** - * Show the content of marked type - */ -mapping uml::NamedElement::showMarkedType() -{ - log( '--------- ' + self.name + " ---------"); - log( 'uml=' + self.repr()); - log( 'data=' + self.data.repr()); - - log( 'projectName=' + self.data.projectName); - log( 'srcName =' + self.data.srcName.repr()); - log( 'packageName=' + self.data.packageName); - log( 'generated =' + self.data.generated.repr()); -} - -/** - * Map a model to a JavaModel. - * Compute and associate additional data (in a TypeMarker class) to the type. - * Recursively ensure that the data are associated to the container of this type. - */ -mapping uml::Type::markUmlType(defaultSrcName : String, defaultProjectName : String) -// when { self.isCompilationUnit() } -{ -// log("------ try to get data for " + self.name); - if( self.data.oclIsUndefined() ) then { - log("Compute associated data for '" + self.name + "'"); - self.data := self.getData( defaultSrcName, defaultProjectName); - } endif; -} - -/** - * Map a model to a JavaModel. - * Compute and associate additional data (in a TypeMarker class) to the type. - * Recursively ensure that the data are associated to the container of this type. - */ -mapping uml::Type::markUmlType() -{ - self.map markUmlType( uml.GENERATION_DEFAULT_SRC_NAME, uml.GENERATION_DEFAULT_PROJECT_NAME); -} - -/** - * - */ -mapping uml::Namespace::getNamespaceMarker() : TypeMarker { - - init { -// if not self.namespaceMarker.oclIsUndefined() then return self.namespaceMarker endif; - } - - -} - -/* ******************************************************************** */ -/* */ -/* ******************************************************************** */ -abstract mapping uml::NamedElement::transformNamedElementToJavaElement() : JDTmm::JDTJavaElement -{ - // by default, isGenerated are true - generated := self.isGenerated(); - //generated := self.data.generated; - - comment := self.ownedComment.body->asOrderedSet()->first(); - log("************************************" + self.name,comment); -} - - -mapping uml::Type::transformTypeToType() : JDTmm::JDTType - disjuncts Class::generateCuClass, Class::generateNestedClass, - Interface::generateCuInterface, Interface::generateNestedInterface, - Enumeration::generateCuEnumeration, Enumeration::generateNestedEnumeration, - PrimitiveType::generateCuPrimitiveType -{ - -} - -helper createOrRetrieveJavaModel2() : JDTJavaModel { - // get the model unique instance, or create it. - var model : JDTJavaModel := resolveoneIn(createOrRetrieveJavaModel).oclAsType(JDTJavaModel); - if( model.oclIsUndefined()) then { - model := map createOrRetrieveJavaModel(); - } endif; - return model; -} - -/** - * Generate a Class that should be a CompilationUnit and set its CompilationUnit - */ -mapping uml::Class::generateCuClass() : JDTmm::JDTClass - inherits Class::generateClass /*, NamedElement::transformNamedElementToJavaElement */ - when { self.isCompilationUnit() } -{ - log("------- transform", self.qualifiedName); - compilationUnit := self.map type2CompilationUnit(); -} - -/** - * Generate a Class that is nested in another Type - */ -mapping uml::Class::generateNestedClass() : JDTmm::JDTClass - inherits Class::generateClass -when { not self.isCompilationUnit() } -{ - log("------- transform", self.qualifiedName); - // We are NOT a compilation unit, so our parent is a Type - owner := self.namespace.oclAsType(uml::Type).map transformTypeToType(); -} - -/** - * Generate a Class. - * set all except its compilationUnit and its owner - */ -mapping uml::Class::generateClass() : JDTmm::JDTClass - inherits Classifier::mapTypeToType -{ -// log( "Interfaces:"); -// self.generalInterfaces()->forEach(c) { -// log( " interface=", c.name); -// }; - log("------- transform", self.qualifiedName); - interface := false; - _class := true; - _enum := false; - - // map inheritance - superClass := self.superClass[uml::Class] -> asOrderedSet() -> first().map transformTypeToType(); - // map interfaces - superInterfaces := self.generalInterfacesForClass() -> map transformTypeToType(); - // Properties - fields := self.ownedAttribute.map propertyToField(); - // Compute property from associations - // This is already computed from the previous case, as such - // properties are marked with owner=Classifier -// fields += self.ownedAttribute.map propertyToAssociationField(); - fields += self[uml::AssociationClass].memberEnd.map propertyToFieldOfAssociationClass(); - - //fields.type := self->generateClass() -> asOrderedSet() -> first(); - // Methods - methods := self.ownedOperation -> map operationToMethod(); -} - - -/** - * Create a Compilation Unit, and set its packageFragment - */ -mapping uml::Type::type2CompilationUnit() : JDTCompilationUnit - inherits NamedElement::transformNamedElementToJavaElement -{ - - elementName := self.name; - // Compute the package fragment from the GenData associated to the type - var res : JDTPackageFragment := self.data.map typeMarkerToPackageFragment(); - -// log( "try to set package fragment found packageFragment=", res); -// log( " type(.packageFragment)=", self); - - // Set the packageFragment of this CU - // next call has a bug, so we do the opposite affectation: - // add this CU to its packageFragment -// packageFragment := res; - res.compilationUnits += result; -} - -/** - * Generate a Interface that should be a CompilationUnit and set its CompilationUnit - */ -mapping uml::Interface::generateCuInterface() : JDTmm::JDTInterface - inherits Interface::generateInterface /*, NamedElement::transformNamedElementToJavaElement */ - when { self.isCompilationUnit() } -{ - log("------- transform", self.qualifiedName); - compilationUnit := self.map type2CompilationUnit(); - -} - -/** - * Generate a Interface that is nested in another Type - */ -mapping uml::Interface::generateNestedInterface() : JDTmm::JDTInterface - inherits Interface::generateInterface -when { not self.isCompilationUnit() } -{ - log("------- transform", self.qualifiedName); - // We are NOT a compilation unit, so our parent is a Type - owner := self.namespace.oclAsType(uml::Type).map transformTypeToType(); -} - -/** - * Generate a Interface. - * set all except its compilationUnit and its owner - */ -mapping uml::Interface::generateInterface() : JDTmm::JDTInterface - inherits Classifier::mapTypeToType -{ - interface := true; - _class := false; - _enum := false; - - // map interfaces - superInterfaces := self.generalInterfaces() -> map transformTypeToType(); - // Properties - fields := self.ownedAttribute -> map propertyToField(); - // Methods - methods := self.ownedOperation -> map operationToMethod(); - - -} - -/** - * Generate a Enumeration that should be a CompilationUnit and set its CompilationUnit - */ -mapping uml::Enumeration::generateCuEnumeration() : JDTmm::JDTEnum - inherits Enumeration::generateEnumeration /*, NamedElement::transformNamedElementToJavaElement */ - when { self.isCompilationUnit() } -{ - log("------- transform", self.qualifiedName); - compilationUnit := self.map type2CompilationUnit(); - -} - -/** - * Generate a Enumeration that is nested in another Type - */ -mapping uml::Enumeration::generateNestedEnumeration() : JDTmm::JDTEnum - inherits Enumeration::generateEnumeration -when { not self.isCompilationUnit() } -{ - log("------- transform", self.qualifiedName); - // We are NOT a compilation unit, so our parent is a Type - owner := self.namespace.oclAsType(uml::Type).map transformTypeToType(); -} - -/** - * Generate a Enumeration. - * set all except its compilationUnit and its owner - */ -mapping uml::Enumeration::generateEnumeration() : JDTmm::JDTEnum - inherits Classifier::mapTypeToType -{ - interface := false; - _class := false; - _enum := true; - - // map inheritance - superClass := self.general().map transformTypeToType(); - // map interfaces - superInterfaces := self.generalInterfaces() -> map transformTypeToType(); - - // Properties - fields := self.ownedAttribute -> map propertyToField(); - - // Litterals ?? - fields += self.ownedLiteral -> map enumerationLiteral2Field(); - - - // Methods - methods := self.ownedOperation -> map operationToMethod(); - -} - -mapping uml::EnumerationLiteral::enumerationLiteral2Field() : JDTmm::JDTField -{ - elementName := self.name; - // visibility - visibility := self.visibility.visibilityToVisibility(); - // modifiers - final := false; - _static := false; - // multiplicity - isMultiValued := false; - // type - type := null; -} - -/** - * Generate a primitive type - */ -mapping uml::PrimitiveType::generateCuPrimitiveType() : JDTmm::JDTClass - inherits Classifier::mapTypeToType -{ - log("------- transform", self.qualifiedName); - compilationUnit := self.map type2CompilationUnit(); - - // Compute elementName - // Check if another name is set in instanceClassname - // Set only the last name, because the package name is set previously in the compilationUnit. - var instanceName : String := self.getStringTaggedValue(uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_IMPLEMENTATION_CLASS, null); - elementName := if( instanceName.oclIsUndefined()) - then self.name - else instanceName.lastNameFromQualifiedName() - endif; - - // Adjust compilation unit name - compilationUnit.elementName := elementName; - - generated := self.data.generated; -} - -/** - * Generate a Enumeration. - * set all except its compilationUnit and its owner - */ -abstract mapping uml::Classifier::mapTypeToType() : JDTmm::JDTType - inherits NamedElement::transformNamedElementToJavaElement -{ - - // Ensure that data are set - if( self.data.oclIsUndefined()) then { - self.map markUmlType(); - } endif; - - elementName := self.name; - // visibility - visibility := self.visibility.visibilityToVisibility(); - // modifiers - _abstract := self.getBooleanTaggedValue("java::JavaClass", "isAbstract",self.isAbstract); - final := self.getBooleanTaggedValue("java::JavaClass", "isFinal",self.isLeaf); - _static := self.getBooleanTaggedValue("java::JavaClass", "isStatic", false); - generated := self.data.generated; - - // Explicit imports - explicitRequiredImports += self.elementImport.target[uml::Classifier] -> map transformTypeToType(); - // Explicit imports from stereotype - var ext:JavaProfile::JavaClass := self.getJavaClassStereotype(); - if( ext <> null) then { - explicitRequiredImports += ext.explicitRequiredImports -> map transformTypeToType(); - explicitPlainTextRequiredImports += ext.explicitPlainTextRequiredImports - } endif; - -} - -/** - * Transform the visibility. - */ -query uml::VisibilityKind::visibilityToVisibility() : jdtmm::VisibilityKind { - - if( self = uml::VisibilityKind::public ) then return jdtmm::VisibilityKind::public endif; - if( self = uml::VisibilityKind::protected ) then return jdtmm::VisibilityKind::protected endif; - if( self = uml::VisibilityKind::private ) then return jdtmm::VisibilityKind::private endif; - - // Can't happen' - return jdtmm::VisibilityKind::public; -} - -/** - * Map a Property to a field - */ -mapping uml::Property::propertyToField() : JDTField - inherits NamedElement::transformNamedElementToJavaElement -{ - // - elementName := self.name; - // visibility - visibility := self.visibility.visibilityToVisibility(); - // modifiers - final := self.getBooleanTaggedValue("java::JavaProperty", "isFinal",self.isLeaf); - _static := self.getBooleanTaggedValue("java::JavaProperty", "isStatic", self.isStatic); - // getter setter - generateGetter := self.getEnumTaggedValue("java::JavaProperty", "generateGetter", "default").getTrueFalseDefaultValue(); - generateSetter := self.getEnumTaggedValue("java::JavaProperty", "generateSetter", "default").getTrueFalseDefaultValue(); - - // multiplicity - isMultiValued := self.upper < 1; - // type - type := self.type.map transformTypeToType(); - - // Specify the default value - if(not self.defaultValue.isNull() ) then { - value := self.defaultValue.valueSpecificationToString(); - } endif; - - // Explicit imports from stereotype - var ext:JavaProfile::JavaProperty := self.getJavaPropertyStereotype(); - if( ext <> null) then { - explicitRequiredImports += ext.explicitRequiredImports -> map transformTypeToType(); - explicitPlainTextRequiredImports += ext.explicitPlainTextRequiredImports - } endif; - -} - -/** - * Compute the default value from the ValueSpecification. - * Check if this is a special case. - * - */ -query uml::ValueSpecification::valueSpecificationToString() : String { - - switch { - case (self.oclIsTypeOf(uml::InstanceValue)) { - var iv := self.oclAsType(uml::InstanceValue ); - - // Is it an EnumLiteral ? - if( iv.instance.oclIsTypeOf(uml::EnumerationLiteral)) then { - // This is an enum literal. Prefix it with its typeName - return iv.type.name + "." + iv.instance.name; - } endif; - } - else { - return self.stringValue() - } - }; - return ""; -} - -/** - * Return the value of the enumeration literal for Enum 'TrueFalseDefault' - */ -query String::getTrueFalseDefaultValue(): TrueFalseDefault { - if(self = "true") then - return TrueFalseDefault::_true - else - if(self = "false") then - return TrueFalseDefault::_false - endif - endif; - - return TrueFalseDefault::_default; -} -/** - * Map a Property to a field of a association class - */ -mapping uml::Property::propertyToFieldOfAssociationClass() : JDTField - inherits Property::propertyToField -{ - -} - -/** - * Map a Property to a association field assoc+nameOfProperty - */ -mapping uml::Property::propertyToAssociationField() : JDTField - inherits Property::propertyToField -when { - not self.association.oclIsUndefined() -} -{ - // handle the class association - elementName := "assoc"+ self.name.firstToUpper(); - type := self.association.map transformTypeToType()->asOrderedSet()->first(); -} - -/** - * Map a Operation to a Method - */ -mapping uml::Operation::operationToMethod() : JDTMethod - inherits NamedElement::transformNamedElementToJavaElement -{ - // - elementName := self.name; - // visibility - visibility := self.visibility.visibilityToVisibility(); - // modifiers - final := self.getBooleanTaggedValue("java::JavaMethod", "isFinal",self.isLeaf); - _static := self.getBooleanTaggedValue("java::JavaMethod", "isStatic", self.isStatic); - _abstract := self.getBooleanTaggedValue("java::JavaMethod", "isAbstract", self.isAbstract); - synchronized := self.getBooleanTaggedValue("java::JavaMethod", "isSynchronized", false); - - // constructor - _constructor := self.getBooleanTaggedValue("java::JavaMethod", "isConstructor", false); - - // arguments - returnType := self.ownedParameter->select(m| m.direction.repr()="return")->first().map parameterToParameter(); - parameters := self.ownedParameter->select(m| m.direction.repr()!="return")-> map parameterToParameter(); - - // Body - bodies := self.method -> map BehaviorToMethodBody(); - // exception - exceptions := self.raisedException -> map transformTypeToType(); - - // Explicit imports from stereotype - var ext:JavaProfile::JavaMethod := self.getJavaMethodStereotype(); - if( ext <> null) then { - explicitRequiredImports += ext.explicitRequiredImports -> map transformTypeToType(); - explicitPlainTextRequiredImports += ext.explicitPlainTextRequiredImports - } endif; - -} - -mapping uml::Parameter::parameterToParameter() : jdtmm::JDTParameter - inherits NamedElement::transformNamedElementToJavaElement -{ - // - elementName := self.name; - // modifiers - final := self.getBooleanTaggedValue("java::JavaClass", "isFinal",false); - // multiplicity - isMultiValued := self.upper < 1; - // type - type := self.type.map transformTypeToType(); -} - -/** - * Transform a Behavior to a JDTMethodBody. - * Root rule of transforming a Behavior to a JDTMethodBody. The real transformation ois done in sub-rules - * (with the same name, but different input type). - * - * Behavior can't be transformed to JDTMethodBody, so create a JDTMethodBody with an error message. - */ -mapping uml::Behavior::BehaviorToMethodBody() : jdtmm::JDTMethodBody { - init { - var jdtBody := object JDTOpaqueBody {}; - jdtBody._body := "Don't know how to map a Behavior to a Java Body"; - result := jdtBody; - } -} - -/** - * Transform an OpaqueBehavior to a MethodBody. - * As we return a subclass of JDTMethodBody, delegate to the appropriate rule. - */ -mapping uml::OpaqueBehavior::BehaviorToMethodBody() : jdtmm::JDTMethodBody { - init { - result := self.map OpaqueBehaviorToOpaqueBody(); - } - -} - -/** - * Transform an OpaqueBehavior to a OpaqueBody - */ -mapping uml::OpaqueBehavior::OpaqueBehaviorToOpaqueBody() : jdtmm::JDTOpaqueBody { - -// log("OpaqueBehavior found"); - - // Look for the java index - var index : Integer := self.language->indexOf("Java"); - if ( index >= 0) then { - _body := self.body->at(index); - } - else { - _body := "// No 'Java' body found. Please set a 'Java' body in the OpaqueBehavior associted to method."; - } - endif; -} - - - - - -/** - * Get or create the PackageFragment corresponding to the TypeMarker - */ -mapping TypeMarker::typeMarkerToPackageFragment() : JDTPackageFragment { - - init { - // Check if the fragment already exist - - // First, lookup fragment root - var srcRoot:JDTPackageFragmentRoot := self.map typeMarkerToPackageFragmentRoot(); - - // Second, lookup in srcRoot for an fragment with the same name - result := srcRoot.packageFragments -> select( fragment | self.packageName=fragment.elementName)-> asSequence()-> first(); - - if( result.oclIsUndefined()) then { - log("create fragment " + self.packageName ); - } - else { - log("reuse fragment '" + result.elementName + "'' for gendata " + self.show() ); - } endif; - - // Ideally, we should return here. But this is not allowed in this qvt version - // return; - } - - // Initialize our object if it is not already done - if( packageFragmentRoot.oclIsUndefined() ) then { - - // Try one of the end of the relation. Some QVT implementation fail on the first end, - // So use the second. (In any cases, we should only affect one end, EMF will do the second end) - // packageFragmentRoot := srcRoot; // self.map typeMarkerToPackageFragmentRoot(); - srcRoot.packageFragments += result; - elementName := self.packageName; - - // Get the isGenerated Flag - // Need to know the flag that has been set in the corresponding package. - // But here, we only got the genData associated to the CompilationUnit, so we - // can't know the flag value. - // TODO: improve the algorithm to be able to get the package's flag value - // actually, always set it to true - generated := true; - -/* - // if package is generated=false, put generated=false for the children's package - if(generated = false) then { - log("c'est false"); - srcRoot.packageFragments->forEach(pack) { - log("**********************"+pack.elementName, pack.elementName.indexOf(elementName)); - if (pack.elementName.indexOf(elementName) != -1) then { - pack.generated := false; - log("************************ elementName passé à ", generated); - } endif; - }; - } endif; -*/ - } endif; - -} - -/** - * Get or create the PackageFragmentRoot corresponding to the TypeMarker - */ -mapping TypeMarker::typeMarkerToPackageFragmentRoot() : JDTPackageFragmentRoot { - - init { - // Check if the fragment already exist - - // First, lookup corresponding project - var project:JDTJavaProject := self.map typeMarkerToJavaProject(); - - // Second, lookup in project for an srcRoot with the same name - result := project.packageFragmentRoots -> select( srcRoot | self.srcName=srcRoot.elementName)-> asSequence()-> first(); - - if( result.oclIsUndefined()) then { - log("create PackageFragmentRoot " + self.srcName ); - } - else { - log("reuse PackageFragmentRoot '" + result.elementName + "' for gendata " + self.show() ); - } endif; - - - // Ideally, we should return here. But this is not allowed in this qvt version - // return; - } - - // Initialize our object if it is not already done - if( javaProject.oclIsUndefined() ) then { - javaProject := project; // self.map typeMarkerToJavaProject(); - elementName := self.srcName; - // Get the isGenerated Flag - // Need to know the flag that has been set in the corresponding package. - // But here, we only got the genData associated to the CompilationUnit, so we - // can't know the flag value. - // TODO: improve the algorithm to be able to get the package's flag value - // actually, always set it to true - generated := true; - } endif; -} - -/** - * Get or create the PackageJavaProject corresponding to the TypeMarker - */ -mapping TypeMarker::typeMarkerToJavaProject() : JDTJavaProject { - - init { - // Lookup if there is a Project already created for this projectName - // resolveIn return a list of object created with the specified mapping rule - // Then, we loukup in the list for an element with the requested name. - result := resolveIn(TypeMarker::typeMarkerToJavaProject) - ->select( project | self.projectName=project.oclAsType(JDTJavaProject).elementName)->first().oclAsType(JDTJavaProject); - - - if( result.oclIsUndefined()) then { - log("create project " + self.projectName ); - } - else { - log("reuse project '" + result.elementName + "'' for gendata " + self.show() ); - } endif; - - - // Ideally, we should return here. But this is not allowed in this qvt version - // return; - } - - // Initialize our object if it is not already done - if( javaModel.oclIsUndefined() ) then { - javaModel := map createOrRetrieveJavaModel(); - elementName := self.projectName; - // Get the isGenerated Flag - // Need to know the flag that has been set in the corresponding package. - // But here, we only got the genData associated to the CompilationUnit, so we - // can't know the flag value. - // TODO: improve the algorithm to be able to get the package's flag value - // actually, always set it to true - generated := true; - } endif; -} - -/** - * - */ -mapping createOrRetrieveJavaModel () : JDTJavaModel { -init { - // result := resolveoneIn(createOrRetrieveJavaModel).oclAsType(JDTJavaModel); -// if not result.oclIsUndefined() then{ return c; }endif; -} - generated := true; - elementName := "JavaModel"; -} - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/.classpath b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/.classpath deleted file mode 100644 index 8a8f1668cdc..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/.project b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/.project deleted file mode 100644 index 4f0ff984c7b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.java.generator.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.core.prefs b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94d61f00da6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/META-INF/MANIFEST.MF b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/META-INF/MANIFEST.MF deleted file mode 100644 index b5234389f4e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.java.generator.ui -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.emf.ecore, - org.eclipse.uml2.uml, - org.eclipse.ui.ide, - org.eclipse.core.resources;bundle-version="3.6.0", - org.eclipse.papyrus.java.generator.metamodel.jdt;bundle-version="1.2.0", - org.eclipse.jdt.core, - org.eclipse.jdt.ui, - org.eclipse.papyrus.java.generator.jdtsynchronizer;bundle-version="1.2.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.java.generator.ui.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.java.generator.ui;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/about.html b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/build.properties b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/build.properties deleted file mode 100644 index 7915e442db0..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - icons/,\ - about.html,\ - plugin.properties -src.includes = about.html diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/icons/generate.psd b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/icons/generate.psd deleted file mode 100644 index 9a555a938e1..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/icons/generate.psd and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/icons/generation.png b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/icons/generation.png deleted file mode 100644 index 6a55c438352..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/icons/generation.png and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/icons/sample.gif b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/icons/sample.gif deleted file mode 100644 index 34fb3c9d8cb..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/icons/sample.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/plugin.properties b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/plugin.properties deleted file mode 100644 index c561698838c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/plugin.properties +++ /dev/null @@ -1,19 +0,0 @@ - -################################################################################# -# Copyright (c) 2011 Nicolas Deblock & Manuel Giles. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation -# Manuel Giles giles.manu@live.fr - Initial API and implementation -# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API -# -################################################################################# - - -pluginName=Papyrus Java Classes Generator UI (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/plugin.xml b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/plugin.xml deleted file mode 100644 index 4a4fdf7e6a6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/plugin.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/pom.xml b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/pom.xml deleted file mode 100644 index 87e2b7faa1c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.java.generator.ui - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/Activator.java b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/Activator.java deleted file mode 100644 index bf812d8fb4e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/Activator.java +++ /dev/null @@ -1,70 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.java.generator.ui"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/handlers/GenerateJavaCodeHandler.java b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/handlers/GenerateJavaCodeHandler.java deleted file mode 100644 index 5adfd0698df..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/handlers/GenerateJavaCodeHandler.java +++ /dev/null @@ -1,246 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.ui.handlers; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.TreeSelection; -import org.eclipse.papyrus.java.generator.jdtsynchronizer.RunGenerator; -import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; -import org.eclipse.papyrus.java.generator.ui.Activator; -import org.eclipse.papyrus.java.generator.ui.preference.GeneratorPreferenceImpl; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; -import org.eclipse.uml2.uml.NamedElement; - -/** - * Handler used to launch Java code generation from a selected UML element. - * - * @author Cedric dumoulin - * - */ -public class GenerateJavaCodeHandler extends AbstractHandler implements IHandler { - - - /** - * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) - * @param event - * @return - * @throws ExecutionException - * - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - // Get selection - // Can't be done in the job. - List objects = lookupSelectedElements(); - // Execute handler - doExecute(objects); - - return null; - } - - /** - * Get the name used in the {@link RecordingCommand}. This name will be visible in - * undo/redo. - * - * @return The command name to show. - */ - public String getCommandName() { - return "Generate Java Code"; - } - - /** - * Return a list of selected domain (UML) elements. - * - * @return - */ - protected List getSelectedUmlObject() { - List selections = lookupSelectedElements(); - - List results = new ArrayList(); - - // create model with EList objects - for (Object obj : selections) { - // Adapt object to NamedElement - NamedElement ele = null; - if (obj instanceof IAdaptable) { - ele = (NamedElement) ((IAdaptable) obj).getAdapter(NamedElement.class); - } - if (ele == null) { - ele = (NamedElement) Platform.getAdapterManager().getAdapter(obj, NamedElement.class); - } - - // Add uml element if found - if (ele != null) { - results.add(ele); - } - - } - - return results; - } - - /** - * Do the execution of the command. - * - * @param objects - * List of object to generate Java code from. - */ - protected void doExecute(final List objects) { - - Job job = new Job("Generate java classes ") { - - @Override - protected IStatus run(IProgressMonitor monitor) { - // execute the task ... - - try { - IStatus status = doExecute(monitor, objects); - monitor.done(); - return status; - } - catch (Exception e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); - } - finally { - - } - - - } - }; - - job.setUser(true); - job.schedule(); - - } - - /** - * Do the execution of the command. - * - * @param objects - * List of object to generate Java code from. - */ - protected IStatus doExecute(IProgressMonitor monitor, List objects) { - monitor.beginTask("Generate ...", 3); - - // create a EList who is the model - EList model = new BasicEList(); - - // create model with EList objects - for (Object obj : objects) { - // Adapt object to NamedElement - NamedElement ele = null; - if (obj instanceof IAdaptable) { - ele = (NamedElement) ((IAdaptable) obj).getAdapter(NamedElement.class); - } - if (ele == null) { - ele = (NamedElement) Platform.getAdapterManager().getAdapter(obj, NamedElement.class); - } - - // Add uml element if found - if (ele != null) { - model.add(ele); - } - - } - monitor.worked(1); - - // recover window - // IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - - // Check if there is a right selection - if (model.size() <= 0) { - String msg = "No UML element selected. Please select one or more UML element to generate"; - // MessageDialog.openInformation(window.getShell(),"No Selection", msg); - - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, msg); - - } - - // error message - String message = ""; - - - try { - // run code generator - RunGenerator runGen = new RunGenerator(model); - runGen.runGeneration(new GeneratorPreferenceImpl()); - } catch (JDTVisitorException e) { - // error message - StringBuffer stackTrace = new StringBuffer(); - for (StackTraceElement trace : e.getStackTrace()) { - stackTrace.append("at " + trace.getMethodName() + "(" + trace.getClassName() + ":" + trace.getLineNumber() + ")\n"); - } - - IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); - // ErrorDialog errDg = new ErrorDialog(window.getShell(), "Error encountered during code generation", - // "Error encountered during code generation", - // status, - // Status.ERROR); - // errDg.open(); - return status; - } - - // if(message.isEmpty()) message = "Code generated successfully!"; - - monitor.worked(2); - // MessageDialog.openInformation(window.getShell(),"Code generation",message); - - return Status.OK_STATUS; - } - - /** - * Lookup selected objects in UI. - * - * @return - */ - private List lookupSelectedElements() { - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - ISelection selection = page.getSelection(); - // System.out.println("check " + selection); - if (selection instanceof IStructuredSelection) - { - IStructuredSelection structuredSelection = (IStructuredSelection) selection; - return structuredSelection.toList(); - } - else if (selection instanceof TreeSelection) { - TreeSelection treeSelection = (TreeSelection) selection; - return treeSelection.toList(); - - } - return null; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GeneratorPreferenceImpl.java b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GeneratorPreferenceImpl.java deleted file mode 100644 index 4b781af05c2..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GeneratorPreferenceImpl.java +++ /dev/null @@ -1,103 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.ui.preference; - -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; -import org.eclipse.papyrus.java.generator.ui.Activator; - -public class GeneratorPreferenceImpl implements GeneratorPreference { - - /** - * allow to gather default value - */ - private IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - - - @Override - public boolean implementMethodsOfIntefaces() { - return store.getBoolean(PreferenceConstants.P_IMPLEMENT_METHODS_OF_INTERFACES_AND_ABSTRACT_CLASS); - } - - @Override - public boolean implementMethodsOfAbstractClass() { - return store.getBoolean(PreferenceConstants.P_IMPLEMENT_METHODS_OF_INTERFACES_AND_ABSTRACT_CLASS); - } - - @Override - public boolean generateGetters() { - return store.getBoolean(PreferenceConstants.P_GENERATE_GETTERS); - } - - @Override - public boolean generateSetters() { - return store.getBoolean(PreferenceConstants.P_GENERATE_SETTERS); - } - - @Override - public boolean isPackageToGenerate(String packageQualifiedName) { - if (packageQualifiedName == null || packageQualifiedName.isEmpty()) { - return true; - } - - // gather list of packages : - String listStr = store.getString(PreferenceConstants.P_FILTER_OF_PACKAGE_NOT_TO_GENERATE); - - // if list of package don't exist, return true - if (listStr == null || listStr.isEmpty()) { - return true; - } - - // gather list in a table - String[] listPackage = listStr.split(";"); - - for (String _package : listPackage) { - if (_package.equals(packageQualifiedName)) { - return false; - } - - // if package have a *, we delete * - String packageWithoutStar = _package; - if (_package.contains("*")) { - packageWithoutStar = _package.substring(0, _package.indexOf("*") - 1); - } - - if (packageQualifiedName.contains(packageWithoutStar)) { - return false; - } - } - - // by default, return true - return true; - } - - @Override - public String genericClassForMultiValue() { - return store.getString(PreferenceConstants.P_GENERIC_CLASS_FOR_MULTIVALUE); - } - - @Override - public boolean stopOnFirstError() { - return store.getBoolean(PreferenceConstants.P_STOP_ON_FIRST_ERROR); - } - - @Override - public String defaultSourceFolderName() { - return store.getString(PreferenceConstants.P_DEFAULT_SOURCE_FOLDER_NAME); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GenericClassFieldEditor.java b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GenericClassFieldEditor.java deleted file mode 100644 index 61abda9df3c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GenericClassFieldEditor.java +++ /dev/null @@ -1,69 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.ui.preference; - -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.search.IJavaSearchConstants; -import org.eclipse.jdt.core.search.IJavaSearchScope; -import org.eclipse.jdt.core.search.SearchEngine; -import org.eclipse.jdt.internal.core.BinaryType; -import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.preference.StringButtonFieldEditor; -import org.eclipse.swt.widgets.Composite; - - -/** - * Used to choice a generic class - * - * @author DEBLOCK Nicolas and GILES Manuel - * - */ -public class GenericClassFieldEditor extends StringButtonFieldEditor { - - public GenericClassFieldEditor(String name, String labelText, Composite parent) { - super(name, labelText, parent); - } - - @Override - protected String changePressed() { - - // search scope - IJavaSearchScope scope = SearchEngine.createWorkspaceScope(); - FilteredTypesSelectionDialog d = new FilteredTypesSelectionDialog(getShell(), false, null, scope, IJavaSearchConstants.TYPE); - d.open(); - Object[] pack = d.getResult(); - BinaryType result = (BinaryType) pack[0]; - try { - // if it's not a generic class, generate a error message - if (!(result.getClassFile().getType().getFullyQualifiedParameterizedName().contains("<") && result.getClassFile().getType().getFullyQualifiedParameterizedName().contains(">"))) { - String errorMessage = "Erreur : " + result.getElementName() + " is not a generic class"; - MessageDialog.openError(getShell(), "Error", errorMessage); - return getStringValue(); - } - } catch (JavaModelException e) { - e.printStackTrace(); - String errorMessage = "Erreur : " + e.getMessage(); - MessageDialog.openError(getShell(), "Error", errorMessage); - } - - - return result.getPackageFragment().getElementName() + "." + result.getElementName(); - } - - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PackageListEditor.java b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PackageListEditor.java deleted file mode 100644 index 20c81ae56e7..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PackageListEditor.java +++ /dev/null @@ -1,87 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.ui.preference; - -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.jdt.internal.ui.preferences.TypeFilterInputDialog; -import org.eclipse.jface.preference.ListEditor; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Composite; - -/** - * - * Used to select packages from the dialog. - * - * @author DEBLOCK Nicolas and GILES Manuel - */ -public class PackageListEditor extends ListEditor { - - /** - * Constructor. - * - * @param name - * @param labelText - * @param parent - */ - PackageListEditor(String name, String labelText, Composite parent) { - super(name, labelText, parent); - } - - @Override - /** - * Functionality for New button. - * Shows a browser dialog to select a file and returns that file. - */ - protected String getNewInputObject() { - // Dialog p = new JDialog(); - List l = new LinkedList(); - - - TypeFilterInputDialog d = new TypeFilterInputDialog(getShell(), l); - d.open(); - Object pack = d.getResult(); - - // Return null if user clicked on "cancel" button, to not add ampty package on the list - if (d.getReturnCode() == Window.CANCEL) { - return null; - } - return pack.toString(); - } - - @Override - protected String createList(String[] items) { - StringBuffer str = new StringBuffer(); - for (String item : items) { - str.append(item + ";"); - } - return str.toString(); - } - - /* - * (non-Javadoc) - * initialize list of items - * - * @see org.eclipse.jface.preference.ListEditor#parseString(java.lang.String) - */ - @Override - protected String[] parseString(String stringList) { - return stringList.split(";"); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceConstants.java b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceConstants.java deleted file mode 100644 index 674c6f07c68..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceConstants.java +++ /dev/null @@ -1,41 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.ui.preference; - -/** - * Constant definitions for plug-in preferences - */ -public class PreferenceConstants { - - public static final String P_PREFERENCE_ID = "org.eclipse.papyrus.java.generator.ui.preference.PreferencePage"; - - public static final String P_IMPLEMENT_METHODS_OF_INTERFACES_AND_ABSTRACT_CLASS = "implementsMethosOfIntefacesAndAbstractClass"; - - public static final String P_GENERATE_GETTERS = "generateGetter"; - - public static final String P_GENERATE_SETTERS = "generateSetter"; - - public static final String P_FILTER_OF_PACKAGE_NOT_TO_GENERATE = "filterOfPackageNotToGenerate"; - - public static final String P_GENERIC_CLASS_FOR_MULTIVALUE = "genericClassForMultiValue"; - - public static final String P_STOP_ON_FIRST_ERROR = "stopOnFirstError"; - - public static final String P_DEFAULT_SOURCE_FOLDER_NAME = "defaultSourceFolderName"; - - public static final String LABEL_DEFAULT_SOURCE_FOLDER_NAME = "Default source folder name"; -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceInitializer.java b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceInitializer.java deleted file mode 100644 index 5bbb763db45..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceInitializer.java +++ /dev/null @@ -1,47 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.ui.preference; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.java.generator.ui.Activator; - - -/** - * Class used to initialize default preference values. - */ -public class PreferenceInitializer extends AbstractPreferenceInitializer { - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() - */ - @Override - public void initializeDefaultPreferences() { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - - store.setDefault(PreferenceConstants.P_IMPLEMENT_METHODS_OF_INTERFACES_AND_ABSTRACT_CLASS, true); - store.setDefault(PreferenceConstants.P_GENERATE_GETTERS, true); - store.setDefault(PreferenceConstants.P_GENERATE_SETTERS, true); - store.setDefault(PreferenceConstants.P_FILTER_OF_PACKAGE_NOT_TO_GENERATE, "java.*;javax.*"); - store.setDefault(PreferenceConstants.P_GENERIC_CLASS_FOR_MULTIVALUE, "java.util.List"); - store.setDefault(PreferenceConstants.P_STOP_ON_FIRST_ERROR, true); - store.setDefault(PreferenceConstants.P_DEFAULT_SOURCE_FOLDER_NAME, "src"); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferencePage.java b/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferencePage.java deleted file mode 100644 index 626d3a8f871..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferencePage.java +++ /dev/null @@ -1,109 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation - * Manuel Giles giles.manu@live.fr - Initial API and implementation - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.generator.ui.preference; - -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.papyrus.java.generator.ui.Activator; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -/** - * This class represents a preference page that - * is contributed to the Preferences dialog. By - * subclassing FieldEditorPreferencePage, we - * can use the field support built into JFace that allows - * us to create a page that is small and knows how to - * save, restore and apply itself. - *

- * This page is used to modify preferences only. They are stored in the preference store that belongs to the main plug-in class. That way, preferences can be accessed directly via the preference store. - */ - -public class PreferencePage - extends FieldEditorPreferencePage - implements IWorkbenchPreferencePage { - - public PreferencePage() { - super(GRID); - } - - /** - * Creates the field editors. Field editors are abstractions of - * the common GUI blocks needed to manipulate various types - * of preferences. Each field editor knows how to save and - * restore itself. - */ - @Override - public void createFieldEditors() { - - // implements methods of inherits interfaces and abstract class - addField(new BooleanFieldEditor( - PreferenceConstants.P_STOP_ON_FIRST_ERROR, - "Stop on first error", - getFieldEditorParent())); - - // implements methods of inherits interfaces and abstract class - addField(new BooleanFieldEditor( - PreferenceConstants.P_IMPLEMENT_METHODS_OF_INTERFACES_AND_ABSTRACT_CLASS, - "Implement methods of inherits interfaces and abstract class", - getFieldEditorParent())); - - - // generate getters setters - addField(new BooleanFieldEditor( - PreferenceConstants.P_GENERATE_GETTERS, - "Generate getters", - getFieldEditorParent())); - - addField(new BooleanFieldEditor( - PreferenceConstants.P_GENERATE_SETTERS, - "Generate setters", - getFieldEditorParent())); - - // filter of package not to generate - addField(new PackageListEditor( - PreferenceConstants.P_FILTER_OF_PACKAGE_NOT_TO_GENERATE, - "Filter of package to not generate", - getFieldEditorParent())); - - addField(new GenericClassFieldEditor( - PreferenceConstants.P_GENERIC_CLASS_FOR_MULTIVALUE, - "Generic class to use for association * ", - getFieldEditorParent())); - - - // text input field for the default source folder name - addField(new GenericClassFieldEditor( - PreferenceConstants.P_DEFAULT_SOURCE_FOLDER_NAME, - PreferenceConstants.LABEL_DEFAULT_SOURCE_FOLDER_NAME, - getFieldEditorParent())); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ - @Override - public void init(IWorkbench workbench) { - setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription("Edit your preferences to generate Java classes with papyrus"); - } - - - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/.classpath b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/.project b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/.project deleted file mode 100644 index f1c67ae603d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.java.profile.edit - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.core.prefs b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94d61f00da6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/META-INF/MANIFEST.MF b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/META-INF/MANIFEST.MF deleted file mode 100644 index e2c700d5d7d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/META-INF/MANIFEST.MF +++ /dev/null @@ -1,15 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.papyrus.java.profile;bundle-version="1.2.0";visibility:=reexport, - org.eclipse.uml2.uml.edit;visibility:=reexport, - org.eclipse.core.runtime -Export-Package: org.eclipse.papyrus.java.profile.java.provider -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.java.profile.java.provider.JavaEditPlugin$Implementation -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.java.profile.edit;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/about.html b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/build.properties b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/build.properties deleted file mode 100644 index 890b147293b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/build.properties +++ /dev/null @@ -1,16 +0,0 @@ - -# -# -# -# $Id$ - -bin.includes = .,\ - icons/,\ - META-INF/,\ - plugin.xml,\ - plugin.properties,\ - about.html -jars.compile.order = . -source.. = src/ -output.. = bin/ -src.includes = about.html diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaClass.gif b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaClass.gif deleted file mode 100644 index 134551bff7e..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaClass.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaMethod.gif b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaMethod.gif deleted file mode 100644 index b3643da048a..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaMethod.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaPackage_.gif b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaPackage_.gif deleted file mode 100644 index e4b530eca17..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaPackage_.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaParameter.gif b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaParameter.gif deleted file mode 100644 index 10d222998af..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaParameter.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProject.gif b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProject.gif deleted file mode 100644 index badaab0664a..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProject.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProperty.gif b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProperty.gif deleted file mode 100644 index 33854e98c25..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProperty.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaSrcFolder.gif b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaSrcFolder.gif deleted file mode 100644 index 98b351f1c44..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaSrcFolder.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/PrimitiveType.gif b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/PrimitiveType.gif deleted file mode 100644 index 35ef84e20e2..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/PrimitiveType.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/plugin.properties b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/plugin.properties deleted file mode 100644 index dfb7e79f433..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/plugin.properties +++ /dev/null @@ -1,86 +0,0 @@ - - -################################################################################# -# Copyright (c) 2011-2013 Cedric Dumoulin. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API -# -################################################################################# - -pluginName = Profile for Java classes generation Edit Support (Incubation) -providerName = Eclipse Modeling Project - -_UI_CreateChild_text = {0} -_UI_CreateChild_text2 = {1} {0} -_UI_CreateChild_text3 = {1} -_UI_CreateChild_tooltip = Create New {0} Under {1} Feature -_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}. -_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent. - -_UI_PropertyDescriptor_description = The {0} of the {1} - -_UI_JavaClass_type = Class -_UI_JavaGen_type = Gen -_UI_JavaNamedElement_type = Named Element -_UI_JavaPackage__type = Package -_UI_JavaMethod_type = Method -_UI_JavaParameter_type = Parameter -_UI_JavaProperty_type = Property -_UI_PrimitiveType_type = Primitive Type -_UI_JavaProject_type = Project -_UI_JavaSrcFolder_type = Src Folder -_UI_Unknown_type = Object - -_UI_Unknown_datatype= Value - -_UI_JavaClass_base_Classifier_feature = Base Classifier -_UI_JavaClass_isFinal_feature = Is Final -_UI_JavaClass_isAbstract_feature = Is Abstract -_UI_JavaClass_isStatic_feature = Is Static -_UI_JavaGen_srcName_feature = Src Name -_UI_JavaGen_projectName_feature = Project Name -_UI_JavaNamedElement_name_feature = Name -_UI_JavaNamedElement_author_feature = Author -_UI_JavaNamedElement_version_feature = Version -_UI_JavaNamedElement_comment_feature = Comment -_UI_JavaNamedElement_isGenerated_feature = Is Generated -_UI_JavaPackage__packageName_feature = Package Name -_UI_JavaPackage__base_Package_feature = Base Package -_UI_JavaMethod_isStatic_feature = Is Static -_UI_JavaMethod_isFinal_feature = Is Final -_UI_JavaMethod_isAbstract_feature = Is Abstract -_UI_JavaMethod_isNative_feature = Is Native -_UI_JavaMethod_isSynchronized_feature = Is Synchronized -_UI_JavaMethod_isConstructor_feature = Is Constructor -_UI_JavaMethod_base_Operation_feature = Base Operation -_UI_JavaParameter_isFinal_feature = Is Final -_UI_JavaParameter_base_Parameter_feature = Base Parameter -_UI_JavaProperty_isAbstract_feature = Is Abstract -_UI_JavaProperty_isFinal_feature = Is Final -_UI_JavaProperty_base_Property_feature = Base Property -_UI_JavaProperty_isTransient_feature = Is Transient -_UI_JavaProperty_generateGetter_feature = Generate Getter -_UI_JavaProperty_generateSetter_feature = Generate Setter -_UI_JavaProperty_isStatic_feature = Is Static -_UI_PrimitiveType_implementationClass_feature = Implementation Class -_UI_PrimitiveType_base_PrimitiveType_feature = Base Primitive Type -_UI_JavaProject_base_Package_feature = Base Package -_UI_JavaSrcFolder_base_Package_feature = Base Package -_UI_Unknown_feature = Unspecified - -_UI_TrueFalseDefault_true_literal = true -_UI_TrueFalseDefault_false_literal = false -_UI_TrueFalseDefault_default_literal = default -_UI_PrimitiveType_collectionImplementationClass_feature = Collection Implementation Class -_UI_JavaClass_explicitPlainTextRequiredImports_feature = Explicit Plain Text Required Imports -_UI_JavaClass_explicitRequiredImports_feature = Explicit Required Imports -_UI_JavaMethod_explicitPlainTextRequiredImports_feature = Explicit Plain Text Required Imports -_UI_JavaProperty_explicitPlainTextRequiredImports_feature = Explicit Plain Text Required Imports -_UI_JavaMethod_explicitRequiredImports_feature = Explicit Required Imports -_UI_JavaProperty_explicitRequiredImports_feature = Explicit Required Imports diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/plugin.xml b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/plugin.xml deleted file mode 100644 index 24301c02945..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/plugin.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/pom.xml b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/pom.xml deleted file mode 100644 index f3c1c3f0cae..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.java.profile.edit - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaClassItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaClassItemProvider.java deleted file mode 100644 index 5bc9f8a6b1b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaClassItemProvider.java +++ /dev/null @@ -1,276 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.profile.java.JavaClass; -import org.eclipse.papyrus.java.profile.java.JavaPackage; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaClass} object. - * - * - * - * @generated - */ -public class JavaClassItemProvider - extends JavaGenItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JavaClassItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addBase_ClassifierPropertyDescriptor(object); - addIsFinalPropertyDescriptor(object); - addIsAbstractPropertyDescriptor(object); - addIsStaticPropertyDescriptor(object); - addExplicitPlainTextRequiredImportsPropertyDescriptor(object); - addExplicitRequiredImportsPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Base Classifier feature. - * - * - * - * @generated - */ - protected void addBase_ClassifierPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaClass_base_Classifier_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaClass_base_Classifier_feature", "_UI_JavaClass_type"), - JavaPackage.Literals.JAVA_CLASS__BASE_CLASSIFIER, - true, - false, - true, - null, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Final feature. - * - * - * - * @generated - */ - protected void addIsFinalPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaClass_isFinal_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaClass_isFinal_feature", "_UI_JavaClass_type"), - JavaPackage.Literals.JAVA_CLASS__IS_FINAL, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Abstract feature. - * - * - * - * @generated - */ - protected void addIsAbstractPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaClass_isAbstract_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaClass_isAbstract_feature", "_UI_JavaClass_type"), - JavaPackage.Literals.JAVA_CLASS__IS_ABSTRACT, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Static feature. - * - * - * - * @generated - */ - protected void addIsStaticPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaClass_isStatic_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaClass_isStatic_feature", "_UI_JavaClass_type"), - JavaPackage.Literals.JAVA_CLASS__IS_STATIC, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Explicit Plain Text Required Imports feature. - * - * - * - * @generated - */ - protected void addExplicitPlainTextRequiredImportsPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaClass_explicitPlainTextRequiredImports_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaClass_explicitPlainTextRequiredImports_feature", "_UI_JavaClass_type"), - JavaPackage.Literals.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Explicit Required Imports feature. - * - * - * - * @generated - */ - protected void addExplicitRequiredImportsPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaClass_explicitRequiredImports_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaClass_explicitRequiredImports_feature", "_UI_JavaClass_type"), - JavaPackage.Literals.JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS, - true, - false, - true, - null, - null, - null)); - } - - /** - * This returns JavaClass.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaClass")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JavaClass) object).getName(); - return label == null || label.length() == 0 ? - getString("_UI_JavaClass_type") : - getString("_UI_JavaClass_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JavaClass.class)) { - case JavaPackage.JAVA_CLASS__IS_FINAL: - case JavaPackage.JAVA_CLASS__IS_ABSTRACT: - case JavaPackage.JAVA_CLASS__IS_STATIC: - case JavaPackage.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaEditPlugin.java b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaEditPlugin.java deleted file mode 100644 index f0cbef55544..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaEditPlugin.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.provider; - -import org.eclipse.emf.common.EMFPlugin; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.provider.EcoreEditPlugin; -import org.eclipse.uml2.uml.edit.UMLEditPlugin; - -/** - * This is the central singleton for the Java edit plugin. - * - * - * - * @generated - */ -public final class JavaEditPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * - * @generated - */ - public static final JavaEditPlugin INSTANCE = new JavaEditPlugin(); - - /** - * Keep track of the singleton. - * - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * - * @generated - */ - public JavaEditPlugin() { - super(new ResourceLocator[] { - UMLEditPlugin.INSTANCE, - EcoreEditPlugin.INSTANCE, - }); - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * - * @return the singleton instance. - * @generated - */ - @Override - public ResourceLocator getPluginResourceLocator() { - return plugin; - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * - * @return the singleton instance. - * @generated - */ - public static Implementation getPlugin() { - return plugin; - } - - /** - * The actual implementation of the Eclipse Plugin. - * - * - * - * @generated - */ - public static class Implementation extends EclipsePlugin { - /** - * Creates an instance. - * - * - * - * @generated - */ - public Implementation() { - super(); - - // Remember the static instance. - // - plugin = this; - } - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaGenItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaGenItemProvider.java deleted file mode 100644 index b17fd0fa212..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaGenItemProvider.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.profile.java.JavaGen; -import org.eclipse.papyrus.java.profile.java.JavaPackage; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaGen} object. - * - * - * - * @generated - */ -public class JavaGenItemProvider - extends JavaNamedElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JavaGenItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addSrcNamePropertyDescriptor(object); - addProjectNamePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Src Name feature. - * - * - * - * @generated - */ - protected void addSrcNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaGen_srcName_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaGen_srcName_feature", "_UI_JavaGen_type"), - JavaPackage.Literals.JAVA_GEN__SRC_NAME, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Project Name feature. - * - * - * - * @generated - */ - protected void addProjectNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaGen_projectName_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaGen_projectName_feature", "_UI_JavaGen_type"), - JavaPackage.Literals.JAVA_GEN__PROJECT_NAME, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JavaGen) object).getName(); - return label == null || label.length() == 0 ? - getString("_UI_JavaGen_type") : - getString("_UI_JavaGen_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JavaGen.class)) { - case JavaPackage.JAVA_GEN__SRC_NAME: - case JavaPackage.JAVA_GEN__PROJECT_NAME: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaItemProviderAdapterFactory.java b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaItemProviderAdapterFactory.java deleted file mode 100644 index 9b126fc37ee..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaItemProviderAdapterFactory.java +++ /dev/null @@ -1,421 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.provider; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IDisposable; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.papyrus.java.profile.java.util.JavaAdapterFactory; - -/** - * This is the factory that is used to provide the interfaces needed to support Viewers. - * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. - * The adapters also support Eclipse property sheets. - * Note that most of the adapters are shared among multiple instances. - * - * - * - * @generated - */ -public class JavaItemProviderAdapterFactory extends JavaAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - * - * - * - * @generated - */ - protected ComposedAdapterFactory parentAdapterFactory; - - /** - * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. - * - * - * - * @generated - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - - /** - * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. - * - * - * - * @generated - */ - protected Collection supportedTypes = new ArrayList(); - - /** - * This constructs an instance. - * - * - * - * @generated - */ - public JavaItemProviderAdapterFactory() { - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemLabelProvider.class); - supportedTypes.add(IItemPropertySource.class); - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaClass} instances. - * - * - * - * @generated - */ - protected JavaClassItemProvider javaClassItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaClass}. - * - * - * - * @generated - */ - @Override - public Adapter createJavaClassAdapter() { - if (javaClassItemProvider == null) { - javaClassItemProvider = new JavaClassItemProvider(this); - } - - return javaClassItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaPackage_} instances. - * - * - * - * @generated - */ - protected JavaPackage_ItemProvider javaPackage_ItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaPackage_}. - * - * - * - * @generated - */ - @Override - public Adapter createJavaPackage_Adapter() { - if (javaPackage_ItemProvider == null) { - javaPackage_ItemProvider = new JavaPackage_ItemProvider(this); - } - - return javaPackage_ItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaMethod} instances. - * - * - * - * @generated - */ - protected JavaMethodItemProvider javaMethodItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaMethod}. - * - * - * - * @generated - */ - @Override - public Adapter createJavaMethodAdapter() { - if (javaMethodItemProvider == null) { - javaMethodItemProvider = new JavaMethodItemProvider(this); - } - - return javaMethodItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaParameter} instances. - * - * - * - * @generated - */ - protected JavaParameterItemProvider javaParameterItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaParameter}. - * - * - * - * @generated - */ - @Override - public Adapter createJavaParameterAdapter() { - if (javaParameterItemProvider == null) { - javaParameterItemProvider = new JavaParameterItemProvider(this); - } - - return javaParameterItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaProperty} instances. - * - * - * - * @generated - */ - protected JavaPropertyItemProvider javaPropertyItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaProperty}. - * - * - * - * @generated - */ - @Override - public Adapter createJavaPropertyAdapter() { - if (javaPropertyItemProvider == null) { - javaPropertyItemProvider = new JavaPropertyItemProvider(this); - } - - return javaPropertyItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.PrimitiveType} instances. - * - * - * - * @generated - */ - protected PrimitiveTypeItemProvider primitiveTypeItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.PrimitiveType}. - * - * - * - * @generated - */ - @Override - public Adapter createPrimitiveTypeAdapter() { - if (primitiveTypeItemProvider == null) { - primitiveTypeItemProvider = new PrimitiveTypeItemProvider(this); - } - - return primitiveTypeItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaProject} instances. - * - * - * - * @generated - */ - protected JavaProjectItemProvider javaProjectItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaProject}. - * - * - * - * @generated - */ - @Override - public Adapter createJavaProjectAdapter() { - if (javaProjectItemProvider == null) { - javaProjectItemProvider = new JavaProjectItemProvider(this); - } - - return javaProjectItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder} instances. - * - * - * - * @generated - */ - protected JavaSrcFolderItemProvider javaSrcFolderItemProvider; - - /** - * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder}. - * - * - * - * @generated - */ - @Override - public Adapter createJavaSrcFolderAdapter() { - if (javaSrcFolderItemProvider == null) { - javaSrcFolderItemProvider = new JavaSrcFolderItemProvider(this); - } - - return javaSrcFolderItemProvider; - } - - /** - * This returns the root adapter factory that contains this factory. - * - * - * - * @generated - */ - @Override - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - /** - * This sets the composed adapter factory that contains this factory. - * - * - * - * @generated - */ - @Override - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isFactoryForType(Object type) { - return supportedTypes.contains(type) || super.isFactoryForType(type); - } - - /** - * This implementation substitutes the factory itself as the key for the adapter. - * - * - * - * @generated - */ - @Override - public Adapter adapt(Notifier notifier, Object type) { - return super.adapt(notifier, this); - } - - /** - * - * - * - * @generated - */ - @Override - public Object adapt(Object object, Object type) { - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - /** - * This adds a listener. - * - * - * - * @generated - */ - @Override - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This removes a listener. - * - * - * - * @generated - */ - @Override - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. - * - * - * - * @generated - */ - @Override - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This disposes all of the item providers created by this factory. - * - * - * - * @generated - */ - @Override - public void dispose() { - if (javaClassItemProvider != null) { - javaClassItemProvider.dispose(); - } - if (javaPackage_ItemProvider != null) { - javaPackage_ItemProvider.dispose(); - } - if (javaMethodItemProvider != null) { - javaMethodItemProvider.dispose(); - } - if (javaParameterItemProvider != null) { - javaParameterItemProvider.dispose(); - } - if (javaPropertyItemProvider != null) { - javaPropertyItemProvider.dispose(); - } - if (primitiveTypeItemProvider != null) { - primitiveTypeItemProvider.dispose(); - } - if (javaProjectItemProvider != null) { - javaProjectItemProvider.dispose(); - } - if (javaSrcFolderItemProvider != null) { - javaSrcFolderItemProvider.dispose(); - } - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaMethodItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaMethodItemProvider.java deleted file mode 100644 index c30e779e6aa..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaMethodItemProvider.java +++ /dev/null @@ -1,351 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.profile.java.JavaMethod; -import org.eclipse.papyrus.java.profile.java.JavaPackage; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaMethod} object. - * - * - * - * @generated - */ -public class JavaMethodItemProvider - extends JavaNamedElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JavaMethodItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addIsStaticPropertyDescriptor(object); - addIsFinalPropertyDescriptor(object); - addIsAbstractPropertyDescriptor(object); - addIsNativePropertyDescriptor(object); - addIsSynchronizedPropertyDescriptor(object); - addIsConstructorPropertyDescriptor(object); - addBase_OperationPropertyDescriptor(object); - addExplicitPlainTextRequiredImportsPropertyDescriptor(object); - addExplicitRequiredImportsPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Is Static feature. - * - * - * - * @generated - */ - protected void addIsStaticPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaMethod_isStatic_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_isStatic_feature", "_UI_JavaMethod_type"), - JavaPackage.Literals.JAVA_METHOD__IS_STATIC, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Final feature. - * - * - * - * @generated - */ - protected void addIsFinalPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaMethod_isFinal_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_isFinal_feature", "_UI_JavaMethod_type"), - JavaPackage.Literals.JAVA_METHOD__IS_FINAL, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Abstract feature. - * - * - * - * @generated - */ - protected void addIsAbstractPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaMethod_isAbstract_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_isAbstract_feature", "_UI_JavaMethod_type"), - JavaPackage.Literals.JAVA_METHOD__IS_ABSTRACT, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Native feature. - * - * - * - * @generated - */ - protected void addIsNativePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaMethod_isNative_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_isNative_feature", "_UI_JavaMethod_type"), - JavaPackage.Literals.JAVA_METHOD__IS_NATIVE, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Synchronized feature. - * - * - * - * @generated - */ - protected void addIsSynchronizedPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaMethod_isSynchronized_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_isSynchronized_feature", "_UI_JavaMethod_type"), - JavaPackage.Literals.JAVA_METHOD__IS_SYNCHRONIZED, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Constructor feature. - * - * - * - * @generated - */ - protected void addIsConstructorPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaMethod_isConstructor_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_isConstructor_feature", "_UI_JavaMethod_type"), - JavaPackage.Literals.JAVA_METHOD__IS_CONSTRUCTOR, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Base Operation feature. - * - * - * - * @generated - */ - protected void addBase_OperationPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaMethod_base_Operation_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_base_Operation_feature", "_UI_JavaMethod_type"), - JavaPackage.Literals.JAVA_METHOD__BASE_OPERATION, - true, - false, - true, - null, - null, - null)); - } - - /** - * This adds a property descriptor for the Explicit Plain Text Required Imports feature. - * - * - * - * @generated - */ - protected void addExplicitPlainTextRequiredImportsPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaMethod_explicitPlainTextRequiredImports_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_explicitPlainTextRequiredImports_feature", "_UI_JavaMethod_type"), - JavaPackage.Literals.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Explicit Required Imports feature. - * - * - * - * @generated - */ - protected void addExplicitRequiredImportsPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaMethod_explicitRequiredImports_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_explicitRequiredImports_feature", "_UI_JavaMethod_type"), - JavaPackage.Literals.JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS, - true, - false, - true, - null, - null, - null)); - } - - /** - * This returns JavaMethod.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaMethod")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JavaMethod) object).getName(); - return label == null || label.length() == 0 ? - getString("_UI_JavaMethod_type") : - getString("_UI_JavaMethod_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JavaMethod.class)) { - case JavaPackage.JAVA_METHOD__IS_STATIC: - case JavaPackage.JAVA_METHOD__IS_FINAL: - case JavaPackage.JAVA_METHOD__IS_ABSTRACT: - case JavaPackage.JAVA_METHOD__IS_NATIVE: - case JavaPackage.JAVA_METHOD__IS_SYNCHRONIZED: - case JavaPackage.JAVA_METHOD__IS_CONSTRUCTOR: - case JavaPackage.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaNamedElementItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaNamedElementItemProvider.java deleted file mode 100644 index 9f0a4b9e6e1..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaNamedElementItemProvider.java +++ /dev/null @@ -1,255 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.profile.java.JavaNamedElement; -import org.eclipse.papyrus.java.profile.java.JavaPackage; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaNamedElement} object. - * - * - * - * @generated - */ -public class JavaNamedElementItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JavaNamedElementItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addNamePropertyDescriptor(object); - addAuthorPropertyDescriptor(object); - addVersionPropertyDescriptor(object); - addCommentPropertyDescriptor(object); - addIsGeneratedPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Name feature. - * - * - * - * @generated - */ - protected void addNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaNamedElement_name_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaNamedElement_name_feature", "_UI_JavaNamedElement_type"), - JavaPackage.Literals.JAVA_NAMED_ELEMENT__NAME, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Author feature. - * - * - * - * @generated - */ - protected void addAuthorPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaNamedElement_author_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaNamedElement_author_feature", "_UI_JavaNamedElement_type"), - JavaPackage.Literals.JAVA_NAMED_ELEMENT__AUTHOR, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Version feature. - * - * - * - * @generated - */ - protected void addVersionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaNamedElement_version_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaNamedElement_version_feature", "_UI_JavaNamedElement_type"), - JavaPackage.Literals.JAVA_NAMED_ELEMENT__VERSION, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Comment feature. - * - * - * - * @generated - */ - protected void addCommentPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaNamedElement_comment_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaNamedElement_comment_feature", "_UI_JavaNamedElement_type"), - JavaPackage.Literals.JAVA_NAMED_ELEMENT__COMMENT, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Generated feature. - * - * - * - * @generated - */ - protected void addIsGeneratedPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaNamedElement_isGenerated_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaNamedElement_isGenerated_feature", "_UI_JavaNamedElement_type"), - JavaPackage.Literals.JAVA_NAMED_ELEMENT__IS_GENERATED, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JavaNamedElement) object).getName(); - return label == null || label.length() == 0 ? - getString("_UI_JavaNamedElement_type") : - getString("_UI_JavaNamedElement_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JavaNamedElement.class)) { - case JavaPackage.JAVA_NAMED_ELEMENT__NAME: - case JavaPackage.JAVA_NAMED_ELEMENT__AUTHOR: - case JavaPackage.JAVA_NAMED_ELEMENT__VERSION: - case JavaPackage.JAVA_NAMED_ELEMENT__COMMENT: - case JavaPackage.JAVA_NAMED_ELEMENT__IS_GENERATED: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. - * - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return JavaEditPlugin.INSTANCE; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPackage_ItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPackage_ItemProvider.java deleted file mode 100644 index 3220ea94e6d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPackage_ItemProvider.java +++ /dev/null @@ -1,177 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaPackage_; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaPackage_} object. - * - * - * - * @generated - */ -public class JavaPackage_ItemProvider - extends JavaGenItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JavaPackage_ItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addPackageNamePropertyDescriptor(object); - addBase_PackagePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Package Name feature. - * - * - * - * @generated - */ - protected void addPackageNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaPackage__packageName_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaPackage__packageName_feature", "_UI_JavaPackage__type"), - JavaPackage.Literals.JAVA_PACKAGE___PACKAGE_NAME, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Base Package feature. - * - * - * - * @generated - */ - protected void addBase_PackagePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaPackage__base_Package_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaPackage__base_Package_feature", "_UI_JavaPackage__type"), - JavaPackage.Literals.JAVA_PACKAGE___BASE_PACKAGE, - true, - false, - true, - null, - null, - null)); - } - - /** - * This returns JavaPackage_.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaPackage_")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JavaPackage_) object).getName(); - return label == null || label.length() == 0 ? - getString("_UI_JavaPackage__type") : - getString("_UI_JavaPackage__type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JavaPackage_.class)) { - case JavaPackage.JAVA_PACKAGE___PACKAGE_NAME: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaParameterItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaParameterItemProvider.java deleted file mode 100644 index 006b8d41606..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaParameterItemProvider.java +++ /dev/null @@ -1,177 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaParameter; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaParameter} object. - * - * - * - * @generated - */ -public class JavaParameterItemProvider - extends JavaNamedElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JavaParameterItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addIsFinalPropertyDescriptor(object); - addBase_ParameterPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Is Final feature. - * - * - * - * @generated - */ - protected void addIsFinalPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaParameter_isFinal_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaParameter_isFinal_feature", "_UI_JavaParameter_type"), - JavaPackage.Literals.JAVA_PARAMETER__IS_FINAL, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Base Parameter feature. - * - * - * - * @generated - */ - protected void addBase_ParameterPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaParameter_base_Parameter_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaParameter_base_Parameter_feature", "_UI_JavaParameter_type"), - JavaPackage.Literals.JAVA_PARAMETER__BASE_PARAMETER, - true, - false, - true, - null, - null, - null)); - } - - /** - * This returns JavaParameter.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaParameter")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JavaParameter) object).getName(); - return label == null || label.length() == 0 ? - getString("_UI_JavaParameter_type") : - getString("_UI_JavaParameter_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JavaParameter.class)) { - case JavaPackage.JAVA_PARAMETER__IS_FINAL: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaProjectItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaProjectItemProvider.java deleted file mode 100644 index 3fafb280255..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaProjectItemProvider.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaProject; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaProject} object. - * - * - * - * @generated - */ -public class JavaProjectItemProvider - extends JavaGenItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JavaProjectItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addBase_PackagePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Base Package feature. - * - * - * - * @generated - */ - protected void addBase_PackagePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaProject_base_Package_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaProject_base_Package_feature", "_UI_JavaProject_type"), - JavaPackage.Literals.JAVA_PROJECT__BASE_PACKAGE, - true, - false, - true, - null, - null, - null)); - } - - /** - * This returns JavaProject.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaProject")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JavaProject) object).getName(); - return label == null || label.length() == 0 ? - getString("_UI_JavaProject_type") : - getString("_UI_JavaProject_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPropertyItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPropertyItemProvider.java deleted file mode 100644 index 4d3b1342181..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPropertyItemProvider.java +++ /dev/null @@ -1,351 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaProperty; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaProperty} object. - * - * - * - * @generated - */ -public class JavaPropertyItemProvider - extends JavaNamedElementItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JavaPropertyItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addIsAbstractPropertyDescriptor(object); - addIsFinalPropertyDescriptor(object); - addBase_PropertyPropertyDescriptor(object); - addIsTransientPropertyDescriptor(object); - addGenerateGetterPropertyDescriptor(object); - addGenerateSetterPropertyDescriptor(object); - addIsStaticPropertyDescriptor(object); - addExplicitPlainTextRequiredImportsPropertyDescriptor(object); - addExplicitRequiredImportsPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Is Abstract feature. - * - * - * - * @generated - */ - protected void addIsAbstractPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaProperty_isAbstract_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_isAbstract_feature", "_UI_JavaProperty_type"), - JavaPackage.Literals.JAVA_PROPERTY__IS_ABSTRACT, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Final feature. - * - * - * - * @generated - */ - protected void addIsFinalPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaProperty_isFinal_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_isFinal_feature", "_UI_JavaProperty_type"), - JavaPackage.Literals.JAVA_PROPERTY__IS_FINAL, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Base Property feature. - * - * - * - * @generated - */ - protected void addBase_PropertyPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaProperty_base_Property_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_base_Property_feature", "_UI_JavaProperty_type"), - JavaPackage.Literals.JAVA_PROPERTY__BASE_PROPERTY, - true, - false, - true, - null, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Transient feature. - * - * - * - * @generated - */ - protected void addIsTransientPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaProperty_isTransient_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_isTransient_feature", "_UI_JavaProperty_type"), - JavaPackage.Literals.JAVA_PROPERTY__IS_TRANSIENT, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Generate Getter feature. - * - * - * - * @generated - */ - protected void addGenerateGetterPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaProperty_generateGetter_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_generateGetter_feature", "_UI_JavaProperty_type"), - JavaPackage.Literals.JAVA_PROPERTY__GENERATE_GETTER, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Generate Setter feature. - * - * - * - * @generated - */ - protected void addGenerateSetterPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaProperty_generateSetter_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_generateSetter_feature", "_UI_JavaProperty_type"), - JavaPackage.Literals.JAVA_PROPERTY__GENERATE_SETTER, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Is Static feature. - * - * - * - * @generated - */ - protected void addIsStaticPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaProperty_isStatic_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_isStatic_feature", "_UI_JavaProperty_type"), - JavaPackage.Literals.JAVA_PROPERTY__IS_STATIC, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Explicit Plain Text Required Imports feature. - * - * - * - * @generated - */ - protected void addExplicitPlainTextRequiredImportsPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaProperty_explicitPlainTextRequiredImports_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_explicitPlainTextRequiredImports_feature", "_UI_JavaProperty_type"), - JavaPackage.Literals.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Explicit Required Imports feature. - * - * - * - * @generated - */ - protected void addExplicitRequiredImportsPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaProperty_explicitRequiredImports_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_explicitRequiredImports_feature", "_UI_JavaProperty_type"), - JavaPackage.Literals.JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS, - true, - false, - true, - null, - null, - null)); - } - - /** - * This returns JavaProperty.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaProperty")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JavaProperty) object).getName(); - return label == null || label.length() == 0 ? - getString("_UI_JavaProperty_type") : - getString("_UI_JavaProperty_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(JavaProperty.class)) { - case JavaPackage.JAVA_PROPERTY__IS_ABSTRACT: - case JavaPackage.JAVA_PROPERTY__IS_FINAL: - case JavaPackage.JAVA_PROPERTY__IS_TRANSIENT: - case JavaPackage.JAVA_PROPERTY__GENERATE_GETTER: - case JavaPackage.JAVA_PROPERTY__GENERATE_SETTER: - case JavaPackage.JAVA_PROPERTY__IS_STATIC: - case JavaPackage.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaSrcFolderItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaSrcFolderItemProvider.java deleted file mode 100644 index 524bcd7e059..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaSrcFolderItemProvider.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaSrcFolder; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder} object. - * - * - * - * @generated - */ -public class JavaSrcFolderItemProvider - extends JavaGenItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public JavaSrcFolderItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addBase_PackagePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Base Package feature. - * - * - * - * @generated - */ - protected void addBase_PackagePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_JavaSrcFolder_base_Package_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_JavaSrcFolder_base_Package_feature", "_UI_JavaSrcFolder_type"), - JavaPackage.Literals.JAVA_SRC_FOLDER__BASE_PACKAGE, - true, - false, - true, - null, - null, - null)); - } - - /** - * This returns JavaSrcFolder.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaSrcFolder")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((JavaSrcFolder) object).getName(); - return label == null || label.length() == 0 ? - getString("_UI_JavaSrcFolder_type") : - getString("_UI_JavaSrcFolder_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/PrimitiveTypeItemProvider.java b/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/PrimitiveTypeItemProvider.java deleted file mode 100644 index 1ec2a9c9a48..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/PrimitiveTypeItemProvider.java +++ /dev/null @@ -1,202 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.provider; - - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.PrimitiveType; - -/** - * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.PrimitiveType} object. - * - * - * - * @generated - */ -public class PrimitiveTypeItemProvider - extends JavaGenItemProvider - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * - * @generated - */ - public PrimitiveTypeItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - * - * - * - * @generated - */ - @Override - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - addImplementationClassPropertyDescriptor(object); - addBase_PrimitiveTypePropertyDescriptor(object); - addCollectionImplementationClassPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Implementation Class feature. - * - * - * - * @generated - */ - protected void addImplementationClassPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_PrimitiveType_implementationClass_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_PrimitiveType_implementationClass_feature", "_UI_PrimitiveType_type"), - JavaPackage.Literals.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Base Primitive Type feature. - * - * - * - * @generated - */ - protected void addBase_PrimitiveTypePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_PrimitiveType_base_PrimitiveType_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_PrimitiveType_base_PrimitiveType_feature", "_UI_PrimitiveType_type"), - JavaPackage.Literals.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE, - true, - false, - true, - null, - null, - null)); - } - - /** - * This adds a property descriptor for the Collection Implementation Class feature. - * - * - * - * @generated - */ - protected void addCollectionImplementationClassPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_PrimitiveType_collectionImplementationClass_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_PrimitiveType_collectionImplementationClass_feature", "_UI_PrimitiveType_type"), - JavaPackage.Literals.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns PrimitiveType.gif. - * - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/PrimitiveType")); - } - - /** - * This returns the label text for the adapted class. - * - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((PrimitiveType) object).getName(); - return label == null || label.length() == 0 ? - getString("_UI_PrimitiveType_type") : - getString("_UI_PrimitiveType_type") + " " + label; - } - - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * - * - * - * @generated - */ - @Override - public void notifyChanged(Notification notification) { - updateChildren(notification); - - switch (notification.getFeatureID(PrimitiveType.class)) { - case JavaPackage.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS: - case JavaPackage.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - } - super.notifyChanged(notification); - } - - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * - * - * - * @generated - */ - @Override - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/.classpath b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/.project b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/.project deleted file mode 100644 index b093010c682..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.java.profile.editor - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.core.prefs b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94d61f00da6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/META-INF/MANIFEST.MF b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/META-INF/MANIFEST.MF deleted file mode 100644 index 4406bae6a12..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.papyrus.java.profile.edit;bundle-version="1.2.0";visibility:=reexport, - org.eclipse.emf.edit.ui;visibility:=reexport, - org.eclipse.ui.ide;visibility:=reexport, - org.eclipse.core.resources -Export-Package: org.eclipse.papyrus.java.profile.java.presentation -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.java.profile.java.presentation.JavaEditorPlugin$Implementation -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.java.profile.editor;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/about.html b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/build.properties b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/build.properties deleted file mode 100644 index e0979c7d60f..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/build.properties +++ /dev/null @@ -1,16 +0,0 @@ - -# -# -# -# $Id$ - -bin.includes = .,\ - icons/,\ - META-INF/,\ - plugin.xml,\ - plugin.properties,\ - about.html -jars.compile.order = . -source.. = src/ -output.. = bin -src.includes = about.html diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/icons/full/obj16/JavaModelFile.gif b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/icons/full/obj16/JavaModelFile.gif deleted file mode 100644 index 53eb7d4f381..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/icons/full/obj16/JavaModelFile.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/icons/full/wizban/NewJava.gif b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/icons/full/wizban/NewJava.gif deleted file mode 100644 index 5306a816d4c..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/icons/full/wizban/NewJava.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/plugin.properties b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/plugin.properties deleted file mode 100644 index f21e2f2baf8..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/plugin.properties +++ /dev/null @@ -1,65 +0,0 @@ - -################################################################################# -# Copyright (c) 2011-2013 Cedric Dumoulin. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API -# -################################################################################# - -pluginName = Profile for Java classes generation Editor Support (Incubation) -providerName = Eclipse Modeling Project - -_UI_JavaEditor_menu = &Java Editor - -_UI_CreateChild_menu_item = &New Child -_UI_CreateSibling_menu_item = N&ew Sibling - -_UI_ShowPropertiesView_menu_item = Show &Properties View -_UI_RefreshViewer_menu_item = &Refresh - -_UI_SelectionPage_label = Selection -_UI_ParentPage_label = Parent -_UI_ListPage_label = List -_UI_TreePage_label = Tree -_UI_TablePage_label = Table -_UI_TreeWithColumnsPage_label = Tree with Columns -_UI_ObjectColumn_label = Object -_UI_SelfColumn_label = Self - -_UI_NoObjectSelected = Selected Nothing -_UI_SingleObjectSelected = Selected Object: {0} -_UI_MultiObjectSelected = Selected {0} Objects - -_UI_OpenEditorError_label = Open Editor - -_UI_Wizard_category = Example EMF Model Creation Wizards - -_UI_CreateModelError_message = Problems encountered in file "{0}" - -_UI_JavaModelWizard_label = Java Model -_UI_JavaModelWizard_description = Create a new Java model - -_UI_JavaEditor_label = Java Model Editor - -_UI_JavaEditorFilenameDefaultBase = My -_UI_JavaEditorFilenameExtensions = java - -_UI_Wizard_label = New - -_WARN_FilenameExtension = The file name must end in ''.{0}'' -_WARN_FilenameExtensions = The file name must have one of the following extensions: {0} - -_UI_ModelObject = &Model Object -_UI_XMLEncoding = &XML Encoding -_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1 -_UI_Wizard_initial_object_description = Select a model object to create - -_UI_FileConflict_label = File Conflict -_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes? - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/plugin.xml b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/plugin.xml deleted file mode 100644 index 83b63b9cb2c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/plugin.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - %_UI_JavaModelWizard_description - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/pom.xml b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/pom.xml deleted file mode 100644 index d43f0b0275a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.java.profile.editor - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaActionBarContributor.java b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaActionBarContributor.java deleted file mode 100644 index f73a9c3c7a1..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaActionBarContributor.java +++ /dev/null @@ -1,445 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.presentation; - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.ui.viewer.IViewerProvider; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.domain.IEditingDomainProvider; -import org.eclipse.emf.edit.ui.action.ControlAction; -import org.eclipse.emf.edit.ui.action.CreateChildAction; -import org.eclipse.emf.edit.ui.action.CreateSiblingAction; -import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; -import org.eclipse.emf.edit.ui.action.LoadResourceAction; -import org.eclipse.emf.edit.ui.action.ValidateAction; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.ActionContributionItem; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IContributionItem; -import org.eclipse.jface.action.IContributionManager; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.action.SubContributionItem; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.PartInitException; - -/** - * This is the action bar contributor for the Java model editor. - * - * - * - * @generated - */ -public class JavaActionBarContributor - extends EditingDomainActionBarContributor - implements ISelectionChangedListener { - /** - * This keeps track of the active editor. - * - * - * - * @generated - */ - protected IEditorPart activeEditorPart; - - /** - * This keeps track of the current selection provider. - * - * - * - * @generated - */ - protected ISelectionProvider selectionProvider; - - /** - * This action opens the Properties view. - * - * - * - * @generated - */ - protected IAction showPropertiesViewAction = - new Action(JavaEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { - @Override - public void run() { - try { - getPage().showView("org.eclipse.ui.views.PropertySheet"); - } - catch (PartInitException exception) { - JavaEditorPlugin.INSTANCE.log(exception); - } - } - }; - - /** - * This action refreshes the viewer of the current editor if the editor - * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. - * - * - * - * @generated - */ - protected IAction refreshViewerAction = - new Action(JavaEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) { - @Override - public boolean isEnabled() { - return activeEditorPart instanceof IViewerProvider; - } - - @Override - public void run() { - if (activeEditorPart instanceof IViewerProvider) { - Viewer viewer = ((IViewerProvider) activeEditorPart).getViewer(); - if (viewer != null) { - viewer.refresh(); - } - } - } - }; - - /** - * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor - * generated for the current selection by the item provider. - * - * - * - * @generated - */ - protected Collection createChildActions; - - /** - * This is the menu manager into which menu contribution items should be added for CreateChild actions. - * - * - * - * @generated - */ - protected IMenuManager createChildMenuManager; - - /** - * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor - * generated for the current selection by the item provider. - * - * - * - * @generated - */ - protected Collection createSiblingActions; - - /** - * This is the menu manager into which menu contribution items should be added for CreateSibling actions. - * - * - * - * @generated - */ - protected IMenuManager createSiblingMenuManager; - - /** - * This creates an instance of the contributor. - * - * - * - * @generated - */ - public JavaActionBarContributor() { - super(ADDITIONS_LAST_STYLE); - loadResourceAction = new LoadResourceAction(); - validateAction = new ValidateAction(); - controlAction = new ControlAction(); - } - - /** - * This adds Separators for editor additions to the tool bar. - * - * - * - * @generated - */ - @Override - public void contributeToToolBar(IToolBarManager toolBarManager) { - toolBarManager.add(new Separator("java-settings")); - toolBarManager.add(new Separator("java-additions")); - } - - /** - * This adds to the menu bar a menu and some separators for editor additions, - * as well as the sub-menus for object creation items. - * - * - * - * @generated - */ - @Override - public void contributeToMenu(IMenuManager menuManager) { - super.contributeToMenu(menuManager); - - IMenuManager submenuManager = new MenuManager(JavaEditorPlugin.INSTANCE.getString("_UI_JavaEditor_menu"), "org.eclipse.papyrus.java.profile.javaMenuID"); - menuManager.insertAfter("additions", submenuManager); - submenuManager.add(new Separator("settings")); - submenuManager.add(new Separator("actions")); - submenuManager.add(new Separator("additions")); - submenuManager.add(new Separator("additions-end")); - - // Prepare for CreateChild item addition or removal. - // - createChildMenuManager = new MenuManager(JavaEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - submenuManager.insertBefore("additions", createChildMenuManager); - - // Prepare for CreateSibling item addition or removal. - // - createSiblingMenuManager = new MenuManager(JavaEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - submenuManager.insertBefore("additions", createSiblingMenuManager); - - // Force an update because Eclipse hides empty menus now. - // - submenuManager.addMenuListener - (new IMenuListener() { - @Override - public void menuAboutToShow(IMenuManager menuManager) { - menuManager.updateAll(true); - } - }); - - addGlobalActions(submenuManager); - } - - /** - * When the active editor changes, this remembers the change and registers with it as a selection provider. - * - * - * - * @generated - */ - @Override - public void setActiveEditor(IEditorPart part) { - super.setActiveEditor(part); - activeEditorPart = part; - - // Switch to the new selection provider. - // - if (selectionProvider != null) { - selectionProvider.removeSelectionChangedListener(this); - } - if (part == null) { - selectionProvider = null; - } - else { - selectionProvider = part.getSite().getSelectionProvider(); - selectionProvider.addSelectionChangedListener(this); - - // Fake a selection changed event to update the menus. - // - if (selectionProvider.getSelection() != null) { - selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection())); - } - } - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener}, - * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings - * that can be added to the selected object and updating the menus accordingly. - * - * - * - * @generated - */ - @Override - public void selectionChanged(SelectionChangedEvent event) { - // Remove any menu items for old selection. - // - if (createChildMenuManager != null) { - depopulateManager(createChildMenuManager, createChildActions); - } - if (createSiblingMenuManager != null) { - depopulateManager(createSiblingMenuManager, createSiblingActions); - } - - // Query the new selection for appropriate new child/sibling descriptors - // - Collection newChildDescriptors = null; - Collection newSiblingDescriptors = null; - - ISelection selection = event.getSelection(); - if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) { - Object object = ((IStructuredSelection) selection).getFirstElement(); - - EditingDomain domain = ((IEditingDomainProvider) activeEditorPart).getEditingDomain(); - - newChildDescriptors = domain.getNewChildDescriptors(object, null); - newSiblingDescriptors = domain.getNewChildDescriptors(null, object); - } - - // Generate actions for selection; populate and redraw the menus. - // - createChildActions = generateCreateChildActions(newChildDescriptors, selection); - createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection); - - if (createChildMenuManager != null) { - populateManager(createChildMenuManager, createChildActions, null); - createChildMenuManager.update(true); - } - if (createSiblingMenuManager != null) { - populateManager(createSiblingMenuManager, createSiblingActions, null); - createSiblingMenuManager.update(true); - } - } - - /** - * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in descriptors, - * and returns the collection of these actions. - * - * - * - * @generated - */ - protected Collection generateCreateChildActions(Collection descriptors, ISelection selection) { - Collection actions = new ArrayList(); - if (descriptors != null) { - for (Object descriptor : descriptors) { - actions.add(new CreateChildAction(activeEditorPart, selection, descriptor)); - } - } - return actions; - } - - /** - * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in descriptors, - * and returns the collection of these actions. - * - * - * - * @generated - */ - protected Collection generateCreateSiblingActions(Collection descriptors, ISelection selection) { - Collection actions = new ArrayList(); - if (descriptors != null) { - for (Object descriptor : descriptors) { - actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); - } - } - return actions; - } - - /** - * This populates the specified manager with {@link org.eclipse.jface.action.ActionContributionItem}s - * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection, - * by inserting them before the specified contribution item contributionID. - * If contributionID is null, they are simply added. - * - * - * - * @generated - */ - protected void populateManager(IContributionManager manager, Collection actions, String contributionID) { - if (actions != null) { - for (IAction action : actions) { - if (contributionID != null) { - manager.insertBefore(contributionID, action); - } - else { - manager.add(action); - } - } - } - } - - /** - * This removes from the specified manager all {@link org.eclipse.jface.action.ActionContributionItem}s - * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection. - * - * - * - * @generated - */ - protected void depopulateManager(IContributionManager manager, Collection actions) { - if (actions != null) { - IContributionItem[] items = manager.getItems(); - for (int i = 0; i < items.length; i++) { - // Look into SubContributionItems - // - IContributionItem contributionItem = items[i]; - while (contributionItem instanceof SubContributionItem) { - contributionItem = ((SubContributionItem) contributionItem).getInnerItem(); - } - - // Delete the ActionContributionItems with matching action. - // - if (contributionItem instanceof ActionContributionItem) { - IAction action = ((ActionContributionItem) contributionItem).getAction(); - if (actions.contains(action)) { - manager.remove(contributionItem); - } - } - } - } - } - - /** - * This populates the pop-up menu before it appears. - * - * - * - * @generated - */ - @Override - public void menuAboutToShow(IMenuManager menuManager) { - super.menuAboutToShow(menuManager); - MenuManager submenuManager = null; - - submenuManager = new MenuManager(JavaEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - populateManager(submenuManager, createChildActions, null); - menuManager.insertBefore("edit", submenuManager); - - submenuManager = new MenuManager(JavaEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - populateManager(submenuManager, createSiblingActions, null); - menuManager.insertBefore("edit", submenuManager); - } - - /** - * This inserts global actions before the "additions-end" separator. - * - * - * - * @generated - */ - @Override - protected void addGlobalActions(IMenuManager menuManager) { - menuManager.insertAfter("additions-end", new Separator("ui-actions")); - menuManager.insertAfter("ui-actions", showPropertiesViewAction); - - refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); - menuManager.insertAfter("ui-actions", refreshViewerAction); - - super.addGlobalActions(menuManager); - } - - /** - * This ensures that a delete action will clean up all references to deleted objects. - * - * - * - * @generated - */ - @Override - protected boolean removeAllReferencesOnDelete() { - return true; - } - -} \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditor.java b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditor.java deleted file mode 100644 index 4ac8d8e0bc8..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditor.java +++ /dev/null @@ -1,1885 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.presentation; - - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.EventObject; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.common.command.BasicCommandStack; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.command.CommandStackListener; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.ui.MarkerHelper; -import org.eclipse.emf.common.ui.ViewerPane; -import org.eclipse.emf.common.ui.editor.ProblemEditorPart; -import org.eclipse.emf.common.ui.viewer.IViewerProvider; -import org.eclipse.emf.common.util.BasicDiagnostic; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EValidator; -import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.EContentAdapter; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.domain.IEditingDomainProvider; -import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; -import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory; -import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; -import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; -import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter; -import org.eclipse.emf.edit.ui.dnd.LocalTransfer; -import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider; -import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper; -import org.eclipse.emf.edit.ui.util.EditUIUtil; -import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.viewers.ColumnWeightData; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ListViewer; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.jface.viewers.TableLayout; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.papyrus.java.profile.java.provider.JavaItemProviderAdapterFactory; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CTabFolder; -import org.eclipse.swt.dnd.DND; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.ControlAdapter; -import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.swt.widgets.TreeColumn; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.dialogs.SaveAsDialog; -import org.eclipse.ui.ide.IGotoMarker; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.MultiPageEditorPart; -import org.eclipse.ui.views.contentoutline.ContentOutline; -import org.eclipse.ui.views.contentoutline.ContentOutlinePage; -import org.eclipse.ui.views.contentoutline.IContentOutlinePage; -import org.eclipse.ui.views.properties.IPropertySheetPage; -import org.eclipse.ui.views.properties.PropertySheet; -import org.eclipse.ui.views.properties.PropertySheetPage; -import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory; - - -/** - * This is an example of a Java model editor. - * - * - * - * @generated - */ -public class JavaEditor - extends MultiPageEditorPart - implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker { - /** - * This keeps track of the editing domain that is used to track all changes to the model. - * - * - * - * @generated - */ - protected AdapterFactoryEditingDomain editingDomain; - - /** - * This is the one adapter factory used for providing views of the model. - * - * - * - * @generated - */ - protected ComposedAdapterFactory adapterFactory; - - /** - * This is the content outline page. - * - * - * - * @generated - */ - protected IContentOutlinePage contentOutlinePage; - - /** - * This is a kludge... - * - * - * - * @generated - */ - protected IStatusLineManager contentOutlineStatusLineManager; - - /** - * This is the content outline page's viewer. - * - * - * - * @generated - */ - protected TreeViewer contentOutlineViewer; - - /** - * This is the property sheet page. - * - * - * - * @generated - */ - protected PropertySheetPage propertySheetPage; - - /** - * This is the viewer that shadows the selection in the content outline. - * The parent relation must be correctly defined for this to work. - * - * - * - * @generated - */ - protected TreeViewer selectionViewer; - - /** - * This inverts the roll of parent and child in the content provider and show parents as a tree. - * - * - * - * @generated - */ - protected TreeViewer parentViewer; - - /** - * This shows how a tree view works. - * - * - * - * @generated - */ - protected TreeViewer treeViewer; - - /** - * This shows how a list view works. - * A list viewer doesn't support icons. - * - * - * - * @generated - */ - protected ListViewer listViewer; - - /** - * This shows how a table view works. - * A table can be used as a list with icons. - * - * - * - * @generated - */ - protected TableViewer tableViewer; - - /** - * This shows how a tree view with columns works. - * - * - * - * @generated - */ - protected TreeViewer treeViewerWithColumns; - - /** - * This keeps track of the active viewer pane, in the book. - * - * - * - * @generated - */ - protected ViewerPane currentViewerPane; - - /** - * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer. - * - * - * - * @generated - */ - protected Viewer currentViewer; - - /** - * This listens to which ever viewer is active. - * - * - * - * @generated - */ - protected ISelectionChangedListener selectionChangedListener; - - /** - * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor. - * - * - * - * @generated - */ - protected Collection selectionChangedListeners = new ArrayList(); - - /** - * This keeps track of the selection of the editor as a whole. - * - * - * - * @generated - */ - protected ISelection editorSelection = StructuredSelection.EMPTY; - - /** - * The MarkerHelper is responsible for creating workspace resource markers presented - * in Eclipse's Problems View. - * - * - * - * @generated - */ - protected MarkerHelper markerHelper = new EditUIMarkerHelper(); - - /** - * This listens for when the outline becomes active - * - * - * - * @generated - */ - protected IPartListener partListener = - new IPartListener() { - @Override - public void partActivated(IWorkbenchPart p) { - if (p instanceof ContentOutline) { - if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) { - getActionBarContributor().setActiveEditor(JavaEditor.this); - - setCurrentViewer(contentOutlineViewer); - } - } - else if (p instanceof PropertySheet) { - if (((PropertySheet) p).getCurrentPage() == propertySheetPage) { - getActionBarContributor().setActiveEditor(JavaEditor.this); - handleActivate(); - } - } - else if (p == JavaEditor.this) { - handleActivate(); - } - } - - @Override - public void partBroughtToTop(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partClosed(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partDeactivated(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partOpened(IWorkbenchPart p) { - // Ignore. - } - }; - - /** - * Resources that have been removed since last activation. - * - * - * - * @generated - */ - protected Collection removedResources = new ArrayList(); - - /** - * Resources that have been changed since last activation. - * - * - * - * @generated - */ - protected Collection changedResources = new ArrayList(); - - /** - * Resources that have been saved. - * - * - * - * @generated - */ - protected Collection savedResources = new ArrayList(); - - /** - * Map to store the diagnostic associated with a resource. - * - * - * - * @generated - */ - protected Map resourceToDiagnosticMap = new LinkedHashMap(); - - /** - * Controls whether the problem indication should be updated. - * - * - * - * @generated - */ - protected boolean updateProblemIndication = true; - - /** - * Adapter used to update the problem indication when resources are demanded loaded. - * - * - * - * @generated - */ - protected EContentAdapter problemIndicationAdapter = - new EContentAdapter() { - @Override - public void notifyChanged(Notification notification) { - if (notification.getNotifier() instanceof Resource) { - switch (notification.getFeatureID(Resource.class)) { - case Resource.RESOURCE__IS_LOADED: - case Resource.RESOURCE__ERRORS: - case Resource.RESOURCE__WARNINGS: { - Resource resource = (Resource) notification.getNotifier(); - Diagnostic diagnostic = analyzeResourceProblems(resource, null); - if (diagnostic.getSeverity() != Diagnostic.OK) { - resourceToDiagnosticMap.put(resource, diagnostic); - } - else { - resourceToDiagnosticMap.remove(resource); - } - - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - updateProblemIndication(); - } - }); - } - break; - } - } - } - else { - super.notifyChanged(notification); - } - } - - @Override - protected void setTarget(Resource target) { - basicSetTarget(target); - } - - @Override - protected void unsetTarget(Resource target) { - basicUnsetTarget(target); - } - }; - - /** - * This listens for workspace changes. - * - * - * - * @generated - */ - protected IResourceChangeListener resourceChangeListener = - new IResourceChangeListener() { - @Override - public void resourceChanged(IResourceChangeEvent event) { - IResourceDelta delta = event.getDelta(); - try { - class ResourceDeltaVisitor implements IResourceDeltaVisitor { - protected ResourceSet resourceSet = editingDomain.getResourceSet(); - protected Collection changedResources = new ArrayList(); - protected Collection removedResources = new ArrayList(); - - @Override - public boolean visit(IResourceDelta delta) { - if (delta.getResource().getType() == IResource.FILE) { - if (delta.getKind() == IResourceDelta.REMOVED || - delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) { - Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false); - if (resource != null) { - if (delta.getKind() == IResourceDelta.REMOVED) { - removedResources.add(resource); - } - else if (!savedResources.remove(resource)) { - changedResources.add(resource); - } - } - } - } - - return true; - } - - public Collection getChangedResources() { - return changedResources; - } - - public Collection getRemovedResources() { - return removedResources; - } - } - - final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(); - delta.accept(visitor); - - if (!visitor.getRemovedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - removedResources.addAll(visitor.getRemovedResources()); - if (!isDirty()) { - getSite().getPage().closeEditor(JavaEditor.this, false); - } - } - }); - } - - if (!visitor.getChangedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - changedResources.addAll(visitor.getChangedResources()); - if (getSite().getPage().getActiveEditor() == JavaEditor.this) { - handleActivate(); - } - } - }); - } - } - catch (CoreException exception) { - JavaEditorPlugin.INSTANCE.log(exception); - } - } - }; - - /** - * Handles activation of the editor or it's associated views. - * - * - * - * @generated - */ - protected void handleActivate() { - // Recompute the read only state. - // - if (editingDomain.getResourceToReadOnlyMap() != null) { - editingDomain.getResourceToReadOnlyMap().clear(); - - // Refresh any actions that may become enabled or disabled. - // - setSelection(getSelection()); - } - - if (!removedResources.isEmpty()) { - if (handleDirtyConflict()) { - getSite().getPage().closeEditor(JavaEditor.this, false); - } - else { - removedResources.clear(); - changedResources.clear(); - savedResources.clear(); - } - } - else if (!changedResources.isEmpty()) { - changedResources.removeAll(savedResources); - handleChangedResources(); - changedResources.clear(); - savedResources.clear(); - } - } - - /** - * Handles what to do with changed resources on activation. - * - * - * - * @generated - */ - protected void handleChangedResources() { - if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { - if (isDirty()) { - changedResources.addAll(editingDomain.getResourceSet().getResources()); - } - editingDomain.getCommandStack().flush(); - - updateProblemIndication = false; - for (Resource resource : changedResources) { - if (resource.isLoaded()) { - resource.unload(); - try { - resource.load(Collections.EMPTY_MAP); - } catch (IOException exception) { - if (!resourceToDiagnosticMap.containsKey(resource)) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - } - } - } - - if (AdapterFactoryEditingDomain.isStale(editorSelection)) { - setSelection(StructuredSelection.EMPTY); - } - - updateProblemIndication = true; - updateProblemIndication(); - } - } - - /** - * Updates the problems indication with the information described in the specified diagnostic. - * - * - * - * @generated - */ - protected void updateProblemIndication() { - if (updateProblemIndication) { - BasicDiagnostic diagnostic = - new BasicDiagnostic - (Diagnostic.OK, - "org.eclipse.papyrus.java.profile.editor", - 0, - null, - new Object[] { editingDomain.getResourceSet() }); - for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) { - if (childDiagnostic.getSeverity() != Diagnostic.OK) { - diagnostic.add(childDiagnostic); - } - } - - int lastEditorPage = getPageCount() - 1; - if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) { - ((ProblemEditorPart) getEditor(lastEditorPage)).setDiagnostic(diagnostic); - if (diagnostic.getSeverity() != Diagnostic.OK) { - setActivePage(lastEditorPage); - } - } - else if (diagnostic.getSeverity() != Diagnostic.OK) { - ProblemEditorPart problemEditorPart = new ProblemEditorPart(); - problemEditorPart.setDiagnostic(diagnostic); - problemEditorPart.setMarkerHelper(markerHelper); - try { - addPage(++lastEditorPage, problemEditorPart, getEditorInput()); - setPageText(lastEditorPage, problemEditorPart.getPartName()); - setActivePage(lastEditorPage); - showTabs(); - } catch (PartInitException exception) { - JavaEditorPlugin.INSTANCE.log(exception); - } - } - - if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - markerHelper.deleteMarkers(editingDomain.getResourceSet()); - if (diagnostic.getSeverity() != Diagnostic.OK) { - try { - markerHelper.createMarkers(diagnostic); - } catch (CoreException exception) { - JavaEditorPlugin.INSTANCE.log(exception); - } - } - } - } - } - - /** - * Shows a dialog that asks if conflicting changes should be discarded. - * - * - * - * @generated - */ - protected boolean handleDirtyConflict() { - return MessageDialog.openQuestion - (getSite().getShell(), - getString("_UI_FileConflict_label"), - getString("_WARN_FileConflict")); - } - - /** - * This creates a model editor. - * - * - * - * @generated - */ - public JavaEditor() { - super(); - initializeEditingDomain(); - } - - /** - * This sets up the editing domain for the model editor. - * - * - * - * @generated - */ - protected void initializeEditingDomain() { - // Create an adapter factory that yields item providers. - // - adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); - - adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new JavaItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new UMLItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); - - // Create the command stack that will notify this editor as commands are executed. - // - BasicCommandStack commandStack = new BasicCommandStack(); - - // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. - // - commandStack.addCommandStackListener - (new CommandStackListener() { - @Override - public void commandStackChanged(final EventObject event) { - getContainer().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - firePropertyChange(IEditorPart.PROP_DIRTY); - - // Try to select the affected objects. - // - Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand(); - if (mostRecentCommand != null) { - setSelectionToViewer(mostRecentCommand.getAffectedObjects()); - } - if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) { - propertySheetPage.refresh(); - } - } - }); - } - }); - - // Create the editing domain with a special command stack. - // - editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap()); - } - - /** - * This is here for the listener to be able to call it. - * - * - * - * @generated - */ - @Override - protected void firePropertyChange(int action) { - super.firePropertyChange(action); - } - - /** - * This sets the selection into whichever viewer is active. - * - * - * - * @generated - */ - public void setSelectionToViewer(Collection collection) { - final Collection theSelection = collection; - // Make sure it's okay. - // - if (theSelection != null && !theSelection.isEmpty()) { - Runnable runnable = - new Runnable() { - @Override - public void run() { - // Try to select the items in the current content viewer of the editor. - // - if (currentViewer != null) { - currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); - } - } - }; - getSite().getShell().getDisplay().asyncExec(runnable); - } - } - - /** - * This returns the editing domain as required by the {@link IEditingDomainProvider} interface. - * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}. - * - * - * - * @generated - */ - @Override - public EditingDomain getEditingDomain() { - return editingDomain; - } - - /** - * - * - * - * @generated - */ - public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { - /** - * - * - * - * @generated - */ - public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * - * - * - * @generated - */ - @Override - public Object[] getElements(Object object) { - Object parent = super.getParent(object); - return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); - } - - /** - * - * - * - * @generated - */ - @Override - public Object[] getChildren(Object object) { - Object parent = super.getParent(object); - return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean hasChildren(Object object) { - Object parent = super.getParent(object); - return parent != null; - } - - /** - * - * - * - * @generated - */ - @Override - public Object getParent(Object object) { - return null; - } - } - - /** - * - * - * - * @generated - */ - public void setCurrentViewerPane(ViewerPane viewerPane) { - if (currentViewerPane != viewerPane) { - if (currentViewerPane != null) { - currentViewerPane.showFocus(false); - } - currentViewerPane = viewerPane; - } - setCurrentViewer(currentViewerPane.getViewer()); - } - - /** - * This makes sure that one content viewer, either for the current page or the outline view, if it has focus, - * is the current one. - * - * - * - * @generated - */ - public void setCurrentViewer(Viewer viewer) { - // If it is changing... - // - if (currentViewer != viewer) { - if (selectionChangedListener == null) { - // Create the listener on demand. - // - selectionChangedListener = - new ISelectionChangedListener() { - // This just notifies those things that are affected by the section. - // - @Override - public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { - setSelection(selectionChangedEvent.getSelection()); - } - }; - } - - // Stop listening to the old one. - // - if (currentViewer != null) { - currentViewer.removeSelectionChangedListener(selectionChangedListener); - } - - // Start listening to the new one. - // - if (viewer != null) { - viewer.addSelectionChangedListener(selectionChangedListener); - } - - // Remember it. - // - currentViewer = viewer; - - // Set the editors selection based on the current viewer's selection. - // - setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection()); - } - } - - /** - * This returns the viewer as required by the {@link IViewerProvider} interface. - * - * - * - * @generated - */ - @Override - public Viewer getViewer() { - return currentViewer; - } - - /** - * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. - * - * - * - * @generated - */ - protected void createContextMenuFor(StructuredViewer viewer) { - MenuManager contextMenu = new MenuManager("#PopUp"); - contextMenu.add(new Separator("additions")); - contextMenu.setRemoveAllWhenShown(true); - contextMenu.addMenuListener(this); - Menu menu = contextMenu.createContextMenu(viewer.getControl()); - viewer.getControl().setMenu(menu); - getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); - - int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; - Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() }; - viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); - viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); - } - - /** - * This is the method called to load a resource into the editing domain's resource set based on the editor's input. - * - * - * - * @generated - */ - public void createModel() { - URI resourceURI = EditUIUtil.getURI(getEditorInput()); - Exception exception = null; - Resource resource = null; - try { - // Load the resource through the editing domain. - // - resource = editingDomain.getResourceSet().getResource(resourceURI, true); - } catch (Exception e) { - exception = e; - resource = editingDomain.getResourceSet().getResource(resourceURI, false); - } - - Diagnostic diagnostic = analyzeResourceProblems(resource, exception); - if (diagnostic.getSeverity() != Diagnostic.OK) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter); - } - - /** - * Returns a diagnostic describing the errors and warnings listed in the resource - * and the specified exception (if any). - * - * - * - * @generated - */ - public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) { - if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) { - BasicDiagnostic basicDiagnostic = - new BasicDiagnostic - (Diagnostic.ERROR, - "org.eclipse.papyrus.java.profile.editor", - 0, - getString("_UI_CreateModelError_message", resource.getURI()), - new Object[] { exception == null ? (Object) resource : exception }); - basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); - return basicDiagnostic; - } - else if (exception != null) { - return new BasicDiagnostic(Diagnostic.ERROR, - "org.eclipse.papyrus.java.profile.editor", - 0, - getString("_UI_CreateModelError_message", resource.getURI()), - new Object[] { exception }); - } - else { - return Diagnostic.OK_INSTANCE; - } - } - - /** - * This is the method used by the framework to install your own controls. - * - * - * - * @generated - */ - @Override - public void createPages() { - // Creates the model from the editor input - // - createModel(); - - // Only creates the other pages if there is something that can be edited - // - if (!getEditingDomain().getResourceSet().getResources().isEmpty()) { - // Create a page for the selection tree view. - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), JavaEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - Tree tree = new Tree(composite, SWT.MULTI); - TreeViewer newTreeViewer = new TreeViewer(tree); - return newTreeViewer; - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - - selectionViewer = (TreeViewer) viewerPane.getViewer(); - selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - - selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - selectionViewer.setInput(editingDomain.getResourceSet()); - selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); - viewerPane.setTitle(editingDomain.getResourceSet()); - - new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); - - createContextMenuFor(selectionViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_SelectionPage_label")); - } - - // Create a page for the parent tree view. - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), JavaEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - Tree tree = new Tree(composite, SWT.MULTI); - TreeViewer newTreeViewer = new TreeViewer(tree); - return newTreeViewer; - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - - parentViewer = (TreeViewer) viewerPane.getViewer(); - parentViewer.setAutoExpandLevel(30); - parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory)); - parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - createContextMenuFor(parentViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_ParentPage_label")); - } - - // This is the page for the list viewer - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), JavaEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - return new ListViewer(composite); - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - listViewer = (ListViewer) viewerPane.getViewer(); - listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - createContextMenuFor(listViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_ListPage_label")); - } - - // This is the page for the tree viewer - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), JavaEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - return new TreeViewer(composite); - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - treeViewer = (TreeViewer) viewerPane.getViewer(); - treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory); - - createContextMenuFor(treeViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_TreePage_label")); - } - - // This is the page for the table viewer. - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), JavaEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - return new TableViewer(composite); - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - tableViewer = (TableViewer) viewerPane.getViewer(); - - Table table = tableViewer.getTable(); - TableLayout layout = new TableLayout(); - table.setLayout(layout); - table.setHeaderVisible(true); - table.setLinesVisible(true); - - TableColumn objectColumn = new TableColumn(table, SWT.NONE); - layout.addColumnData(new ColumnWeightData(3, 100, true)); - objectColumn.setText(getString("_UI_ObjectColumn_label")); - objectColumn.setResizable(true); - - TableColumn selfColumn = new TableColumn(table, SWT.NONE); - layout.addColumnData(new ColumnWeightData(2, 100, true)); - selfColumn.setText(getString("_UI_SelfColumn_label")); - selfColumn.setResizable(true); - - tableViewer.setColumnProperties(new String[] { "a", "b" }); - tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - createContextMenuFor(tableViewer); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_TablePage_label")); - } - - // This is the page for the table tree viewer. - // - { - ViewerPane viewerPane = - new ViewerPane(getSite().getPage(), JavaEditor.this) { - @Override - public Viewer createViewer(Composite composite) { - return new TreeViewer(composite); - } - - @Override - public void requestActivation() { - super.requestActivation(); - setCurrentViewerPane(this); - } - }; - viewerPane.createControl(getContainer()); - - treeViewerWithColumns = (TreeViewer) viewerPane.getViewer(); - - Tree tree = treeViewerWithColumns.getTree(); - tree.setLayoutData(new FillLayout()); - tree.setHeaderVisible(true); - tree.setLinesVisible(true); - - TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE); - objectColumn.setText(getString("_UI_ObjectColumn_label")); - objectColumn.setResizable(true); - objectColumn.setWidth(250); - - TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE); - selfColumn.setText(getString("_UI_SelfColumn_label")); - selfColumn.setResizable(true); - selfColumn.setWidth(200); - - treeViewerWithColumns.setColumnProperties(new String[] { "a", "b" }); - treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - - createContextMenuFor(treeViewerWithColumns); - int pageIndex = addPage(viewerPane.getControl()); - setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); - } - - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - setActivePage(0); - } - }); - } - - // Ensures that this editor will only display the page's tab - // area if there are more than one page - // - getContainer().addControlListener - (new ControlAdapter() { - boolean guard = false; - - @Override - public void controlResized(ControlEvent event) { - if (!guard) { - guard = true; - hideTabs(); - guard = false; - } - } - }); - - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - updateProblemIndication(); - } - }); - } - - /** - * If there is just one page in the multi-page editor part, - * this hides the single tab at the bottom. - * - * - * - * @generated - */ - protected void hideTabs() { - if (getPageCount() <= 1) { - setPageText(0, ""); - if (getContainer() instanceof CTabFolder) { - ((CTabFolder) getContainer()).setTabHeight(1); - Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y + 6); - } - } - } - - /** - * If there is more than one page in the multi-page editor part, - * this shows the tabs at the bottom. - * - * - * - * @generated - */ - protected void showTabs() { - if (getPageCount() > 1) { - setPageText(0, getString("_UI_SelectionPage_label")); - if (getContainer() instanceof CTabFolder) { - ((CTabFolder) getContainer()).setTabHeight(SWT.DEFAULT); - Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y - 6); - } - } - } - - /** - * This is used to track the active viewer. - * - * - * - * @generated - */ - @Override - protected void pageChange(int pageIndex) { - super.pageChange(pageIndex); - - if (contentOutlinePage != null) { - handleContentOutlineSelection(contentOutlinePage.getSelection()); - } - } - - /** - * This is how the framework determines which interfaces we implement. - * - * - * - * @generated - */ - @SuppressWarnings("rawtypes") - @Override - public Object getAdapter(Class key) { - if (key.equals(IContentOutlinePage.class)) { - return showOutlineView() ? getContentOutlinePage() : null; - } - else if (key.equals(IPropertySheetPage.class)) { - return getPropertySheetPage(); - } - else if (key.equals(IGotoMarker.class)) { - return this; - } - else { - return super.getAdapter(key); - } - } - - /** - * This accesses a cached version of the content outliner. - * - * - * - * @generated - */ - public IContentOutlinePage getContentOutlinePage() { - if (contentOutlinePage == null) { - // The content outline is just a tree. - // - class MyContentOutlinePage extends ContentOutlinePage { - @Override - public void createControl(Composite parent) { - super.createControl(parent); - contentOutlineViewer = getTreeViewer(); - contentOutlineViewer.addSelectionChangedListener(this); - - // Set up the tree viewer. - // - contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); - contentOutlineViewer.setInput(editingDomain.getResourceSet()); - - // Make sure our popups work. - // - createContextMenuFor(contentOutlineViewer); - - if (!editingDomain.getResourceSet().getResources().isEmpty()) { - // Select the root object in the view. - // - contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); - } - } - - @Override - public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { - super.makeContributions(menuManager, toolBarManager, statusLineManager); - contentOutlineStatusLineManager = statusLineManager; - } - - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - } - - contentOutlinePage = new MyContentOutlinePage(); - - // Listen to selection so that we can handle it is a special way. - // - contentOutlinePage.addSelectionChangedListener - (new ISelectionChangedListener() { - // This ensures that we handle selections correctly. - // - @Override - public void selectionChanged(SelectionChangedEvent event) { - handleContentOutlineSelection(event.getSelection()); - } - }); - } - - return contentOutlinePage; - } - - /** - * This accesses a cached version of the property sheet. - * - * - * - * @generated - */ - public IPropertySheetPage getPropertySheetPage() { - if (propertySheetPage == null) { - propertySheetPage = - new ExtendedPropertySheetPage(editingDomain) { - @Override - public void setSelectionToViewer(List selection) { - JavaEditor.this.setSelectionToViewer(selection); - JavaEditor.this.setFocus(); - } - - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - }; - propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); - } - - return propertySheetPage; - } - - /** - * This deals with how we want selection in the outliner to affect the other views. - * - * - * - * @generated - */ - public void handleContentOutlineSelection(ISelection selection) { - if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) { - Iterator selectedElements = ((IStructuredSelection) selection).iterator(); - if (selectedElements.hasNext()) { - // Get the first selected element. - // - Object selectedElement = selectedElements.next(); - - // If it's the selection viewer, then we want it to select the same selection as this selection. - // - if (currentViewerPane.getViewer() == selectionViewer) { - ArrayList selectionList = new ArrayList(); - selectionList.add(selectedElement); - while (selectedElements.hasNext()) { - selectionList.add(selectedElements.next()); - } - - // Set the selection to the widget. - // - selectionViewer.setSelection(new StructuredSelection(selectionList)); - } - else { - // Set the input to the widget. - // - if (currentViewerPane.getViewer().getInput() != selectedElement) { - currentViewerPane.getViewer().setInput(selectedElement); - currentViewerPane.setTitle(selectedElement); - } - } - } - } - } - - /** - * This is for implementing {@link IEditorPart} and simply tests the command stack. - * - * - * - * @generated - */ - @Override - public boolean isDirty() { - return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded(); - } - - /** - * This is for implementing {@link IEditorPart} and simply saves the model file. - * - * - * - * @generated - */ - @Override - public void doSave(IProgressMonitor progressMonitor) { - // Save only resources that have actually changed. - // - final Map saveOptions = new HashMap(); - saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); - - // Do the work within an operation because this is a long running activity that modifies the workbench. - // - WorkspaceModifyOperation operation = - new WorkspaceModifyOperation() { - // This is the method that gets invoked when the operation runs. - // - @Override - public void execute(IProgressMonitor monitor) { - // Save the resources to the file system. - // - boolean first = true; - for (Resource resource : editingDomain.getResourceSet().getResources()) { - if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) { - try { - long timeStamp = resource.getTimeStamp(); - resource.save(saveOptions); - if (resource.getTimeStamp() != timeStamp) { - savedResources.add(resource); - } - } - catch (Exception exception) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - first = false; - } - } - } - }; - - updateProblemIndication = false; - try { - // This runs the options, and shows progress. - // - new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation); - - // Refresh the necessary state. - // - ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone(); - firePropertyChange(IEditorPart.PROP_DIRTY); - } catch (Exception exception) { - // Something went wrong that shouldn't. - // - JavaEditorPlugin.INSTANCE.log(exception); - } - updateProblemIndication = true; - updateProblemIndication(); - } - - /** - * This returns whether something has been persisted to the URI of the specified resource. - * The implementation uses the URI converter from the editor's resource set to try to open an input stream. - * - * - * - * @generated - */ - protected boolean isPersisted(Resource resource) { - boolean result = false; - try { - InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI()); - if (stream != null) { - result = true; - stream.close(); - } - } catch (IOException e) { - // Ignore - } - return result; - } - - /** - * This always returns true because it is not currently supported. - * - * - * - * @generated - */ - @Override - public boolean isSaveAsAllowed() { - return true; - } - - /** - * This also changes the editor's input. - * - * - * - * @generated - */ - @Override - public void doSaveAs() { - SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); - saveAsDialog.open(); - IPath path = saveAsDialog.getResult(); - if (path != null) { - IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); - if (file != null) { - doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); - } - } - } - - /** - * - * - * - * @generated - */ - protected void doSaveAs(URI uri, IEditorInput editorInput) { - (editingDomain.getResourceSet().getResources().get(0)).setURI(uri); - setInputWithNotify(editorInput); - setPartName(editorInput.getName()); - IProgressMonitor progressMonitor = - getActionBars().getStatusLineManager() != null ? - getActionBars().getStatusLineManager().getProgressMonitor() : - new NullProgressMonitor(); - doSave(progressMonitor); - } - - /** - * - * - * - * @generated - */ - @Override - public void gotoMarker(IMarker marker) { - try { - if (marker.getType().equals(EValidator.MARKER)) { - String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null); - if (uriAttribute != null) { - URI uri = URI.createURI(uriAttribute); - EObject eObject = editingDomain.getResourceSet().getEObject(uri, true); - if (eObject != null) { - setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject))); - } - } - } - } catch (CoreException exception) { - JavaEditorPlugin.INSTANCE.log(exception); - } - } - - /** - * This is called during startup. - * - * - * - * @generated - */ - @Override - public void init(IEditorSite site, IEditorInput editorInput) { - setSite(site); - setInputWithNotify(editorInput); - setPartName(editorInput.getName()); - site.setSelectionProvider(this); - site.getPage().addPartListener(partListener); - ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE); - } - - /** - * - * - * - * @generated - */ - @Override - public void setFocus() { - if (currentViewerPane != null) { - currentViewerPane.setFocus(); - } - else { - getControl(getActivePage()).setFocus(); - } - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * - * @generated - */ - @Override - public void addSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.add(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * - * @generated - */ - @Override - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.remove(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. - * - * - * - * @generated - */ - @Override - public ISelection getSelection() { - return editorSelection; - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection. - * Calling this result will notify the listeners. - * - * - * - * @generated - */ - @Override - public void setSelection(ISelection selection) { - editorSelection = selection; - - for (ISelectionChangedListener listener : selectionChangedListeners) { - listener.selectionChanged(new SelectionChangedEvent(this, selection)); - } - setStatusLineManager(selection); - } - - /** - * - * - * - * @generated - */ - public void setStatusLineManager(ISelection selection) { - IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? - contentOutlineStatusLineManager : getActionBars().getStatusLineManager(); - - if (statusLineManager != null) { - if (selection instanceof IStructuredSelection) { - Collection collection = ((IStructuredSelection) selection).toList(); - switch (collection.size()) { - case 0: { - statusLineManager.setMessage(getString("_UI_NoObjectSelected")); - break; - } - case 1: { - String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next()); - statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); - break; - } - default: { - statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); - break; - } - } - } - else { - statusLineManager.setMessage(""); - } - } - } - - /** - * This looks up a string in the plugin's plugin.properties file. - * - * - * - * @generated - */ - private static String getString(String key) { - return JavaEditorPlugin.INSTANCE.getString(key); - } - - /** - * This looks up a string in plugin.properties, making a substitution. - * - * - * - * @generated - */ - private static String getString(String key, Object s1) { - return JavaEditorPlugin.INSTANCE.getString(key, new Object[] { s1 }); - } - - /** - * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu. - * - * - * - * @generated - */ - @Override - public void menuAboutToShow(IMenuManager menuManager) { - ((IMenuListener) getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); - } - - /** - * - * - * - * @generated - */ - public EditingDomainActionBarContributor getActionBarContributor() { - return (EditingDomainActionBarContributor) getEditorSite().getActionBarContributor(); - } - - /** - * - * - * - * @generated - */ - public IActionBars getActionBars() { - return getActionBarContributor().getActionBars(); - } - - /** - * - * - * - * @generated - */ - public AdapterFactory getAdapterFactory() { - return adapterFactory; - } - - /** - * - * - * - * @generated - */ - @Override - public void dispose() { - updateProblemIndication = false; - - ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); - - getSite().getPage().removePartListener(partListener); - - adapterFactory.dispose(); - - if (getActionBarContributor().getActiveEditor() == this) { - getActionBarContributor().setActiveEditor(null); - } - - if (propertySheetPage != null) { - propertySheetPage.dispose(); - } - - if (contentOutlinePage != null) { - contentOutlinePage.dispose(); - } - - super.dispose(); - } - - /** - * Returns whether the outline view should be presented to the user. - * - * - * - * @generated - */ - protected boolean showOutlineView() { - return true; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditorPlugin.java b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditorPlugin.java deleted file mode 100644 index 9db89df6630..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditorPlugin.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.presentation; - -import org.eclipse.emf.common.EMFPlugin; -import org.eclipse.emf.common.ui.EclipseUIPlugin; -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.emf.ecore.provider.EcoreEditPlugin; -import org.eclipse.uml2.uml.edit.UMLEditPlugin; - -/** - * This is the central singleton for the Java editor plugin. - * - * - * - * @generated - */ -public final class JavaEditorPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * - * @generated - */ - public static final JavaEditorPlugin INSTANCE = new JavaEditorPlugin(); - - /** - * Keep track of the singleton. - * - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * - * @generated - */ - public JavaEditorPlugin() { - super(new ResourceLocator[] { - UMLEditPlugin.INSTANCE, - EcoreEditPlugin.INSTANCE, - }); - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * - * @return the singleton instance. - * @generated - */ - @Override - public ResourceLocator getPluginResourceLocator() { - return plugin; - } - - /** - * Returns the singleton instance of the Eclipse plugin. - * - * - * - * @return the singleton instance. - * @generated - */ - public static Implementation getPlugin() { - return plugin; - } - - /** - * The actual implementation of the Eclipse Plugin. - * - * - * - * @generated - */ - public static class Implementation extends EclipseUIPlugin { - /** - * Creates an instance. - * - * - * - * @generated - */ - public Implementation() { - super(); - - // Remember the static instance. - // - plugin = this; - } - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaModelWizard.java b/extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaModelWizard.java deleted file mode 100644 index 8a22e9e9187..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaModelWizard.java +++ /dev/null @@ -1,640 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.presentation; - - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.StringTokenizer; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.CommonPlugin; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.emf.ecore.xmi.XMLResource; -import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.papyrus.java.profile.java.JavaFactory; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.provider.JavaEditPlugin; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.dialogs.WizardNewFileCreationPage; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.ISetSelectionTarget; - - -/** - * This is a simple wizard for creating a new model file. - * - * - * - * @generated - */ -public class JavaModelWizard extends Wizard implements INewWizard { - /** - * The supported extensions for created files. - * - * - * - * @generated - */ - public static final List FILE_EXTENSIONS = - Collections.unmodifiableList(Arrays.asList(JavaEditorPlugin.INSTANCE.getString("_UI_JavaEditorFilenameExtensions").split("\\s*,\\s*"))); - - /** - * A formatted list of supported file extensions, suitable for display. - * - * - * - * @generated - */ - public static final String FORMATTED_FILE_EXTENSIONS = - JavaEditorPlugin.INSTANCE.getString("_UI_JavaEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); - - /** - * This caches an instance of the model package. - * - * - * - * @generated - */ - protected JavaPackage javaPackage = JavaPackage.eINSTANCE; - - /** - * This caches an instance of the model factory. - * - * - * - * @generated - */ - protected JavaFactory javaFactory = javaPackage.getJavaFactory(); - - /** - * This is the file creation page. - * - * - * - * @generated - */ - protected JavaModelWizardNewFileCreationPage newFileCreationPage; - - /** - * This is the initial object creation page. - * - * - * - * @generated - */ - protected JavaModelWizardInitialObjectCreationPage initialObjectCreationPage; - - /** - * Remember the selection during initialization for populating the default container. - * - * - * - * @generated - */ - protected IStructuredSelection selection; - - /** - * Remember the workbench during initialization. - * - * - * - * @generated - */ - protected IWorkbench workbench; - - /** - * Caches the names of the types that can be created as the root object. - * - * - * - * @generated - */ - protected List initialObjectNames; - - /** - * This just records the information. - * - * - * - * @generated - */ - @Override - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.workbench = workbench; - this.selection = selection; - setWindowTitle(JavaEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); - setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(JavaEditorPlugin.INSTANCE.getImage("full/wizban/NewJava"))); - } - - /** - * Returns the names of the types that can be created as the root object. - * - * - * - * @generated - */ - protected Collection getInitialObjectNames() { - if (initialObjectNames == null) { - initialObjectNames = new ArrayList(); - for (EClassifier eClassifier : javaPackage.getEClassifiers()) { - if (eClassifier instanceof EClass) { - EClass eClass = (EClass) eClassifier; - if (!eClass.isAbstract()) { - initialObjectNames.add(eClass.getName()); - } - } - } - Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator()); - } - return initialObjectNames; - } - - /** - * Create a new model. - * - * - * - * @generated - */ - protected EObject createInitialModel() { - EClass eClass = (EClass) javaPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); - EObject rootObject = javaFactory.create(eClass); - return rootObject; - } - - /** - * Do the work after everything is specified. - * - * - * - * @generated - */ - @Override - public boolean performFinish() { - try { - // Remember the file. - // - final IFile modelFile = getModelFile(); - - // Do the work within an operation. - // - WorkspaceModifyOperation operation = - new WorkspaceModifyOperation() { - @Override - protected void execute(IProgressMonitor progressMonitor) { - try { - // Create a resource set - // - ResourceSet resourceSet = new ResourceSetImpl(); - - // Get the URI of the model file. - // - URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true); - - // Create a resource for this file. - // - Resource resource = resourceSet.createResource(fileURI); - - // Add the initial model object to the contents. - // - EObject rootObject = createInitialModel(); - if (rootObject != null) { - resource.getContents().add(rootObject); - } - - // Save the contents of the resource to the file system. - // - Map options = new HashMap(); - options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding()); - resource.save(options); - } - catch (Exception exception) { - JavaEditorPlugin.INSTANCE.log(exception); - } - finally { - progressMonitor.done(); - } - } - }; - - getContainer().run(false, false, operation); - - // Select the new file resource in the current view. - // - IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); - IWorkbenchPage page = workbenchWindow.getActivePage(); - final IWorkbenchPart activePart = page.getActivePart(); - if (activePart instanceof ISetSelectionTarget) { - final ISelection targetSelection = new StructuredSelection(modelFile); - getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - ((ISetSelectionTarget) activePart).selectReveal(targetSelection); - } - }); - } - - // Open an editor on the new file. - // - try { - page.openEditor - (new FileEditorInput(modelFile), - workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId()); - } catch (PartInitException exception) { - MessageDialog.openError(workbenchWindow.getShell(), JavaEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); - return false; - } - - return true; - } catch (Exception exception) { - JavaEditorPlugin.INSTANCE.log(exception); - return false; - } - } - - /** - * This is the one page of the wizard. - * - * - * - * @generated - */ - public class JavaModelWizardNewFileCreationPage extends WizardNewFileCreationPage { - /** - * Pass in the selection. - * - * - * - * @generated - */ - public JavaModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) { - super(pageId, selection); - } - - /** - * The framework calls this to see if the file is correct. - * - * - * - * @generated - */ - @Override - protected boolean validatePage() { - if (super.validatePage()) { - String extension = new Path(getFileName()).getFileExtension(); - if (extension == null || !FILE_EXTENSIONS.contains(extension)) { - String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; - setErrorMessage(JavaEditorPlugin.INSTANCE.getString(key, new Object[] { FORMATTED_FILE_EXTENSIONS })); - return false; - } - return true; - } - return false; - } - - /** - * - * - * - * @generated - */ - public IFile getModelFile() { - return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName())); - } - } - - /** - * This is the page where the type of object to create is selected. - * - * - * - * @generated - */ - public class JavaModelWizardInitialObjectCreationPage extends WizardPage { - /** - * - * - * - * @generated - */ - protected Combo initialObjectField; - - /** - * @generated - * - * - */ - protected List encodings; - - /** - * - * - * - * @generated - */ - protected Combo encodingField; - - /** - * Pass in the selection. - * - * - * - * @generated - */ - public JavaModelWizardInitialObjectCreationPage(String pageId) { - super(pageId); - } - - /** - * - * - * - * @generated - */ - @Override - public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - { - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - layout.verticalSpacing = 12; - composite.setLayout(layout); - - GridData data = new GridData(); - data.verticalAlignment = GridData.FILL; - data.grabExcessVerticalSpace = true; - data.horizontalAlignment = GridData.FILL; - composite.setLayoutData(data); - } - - Label containerLabel = new Label(composite, SWT.LEFT); - { - containerLabel.setText(JavaEditorPlugin.INSTANCE.getString("_UI_ModelObject")); - - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - containerLabel.setLayoutData(data); - } - - initialObjectField = new Combo(composite, SWT.BORDER); - { - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - initialObjectField.setLayoutData(data); - } - - for (String objectName : getInitialObjectNames()) { - initialObjectField.add(getLabel(objectName)); - } - - if (initialObjectField.getItemCount() == 1) { - initialObjectField.select(0); - } - initialObjectField.addModifyListener(validator); - - Label encodingLabel = new Label(composite, SWT.LEFT); - { - encodingLabel.setText(JavaEditorPlugin.INSTANCE.getString("_UI_XMLEncoding")); - - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - encodingLabel.setLayoutData(data); - } - encodingField = new Combo(composite, SWT.BORDER); - { - GridData data = new GridData(); - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - encodingField.setLayoutData(data); - } - - for (String encoding : getEncodings()) { - encodingField.add(encoding); - } - - encodingField.select(0); - encodingField.addModifyListener(validator); - - setPageComplete(validatePage()); - setControl(composite); - } - - /** - * - * - * - * @generated - */ - protected ModifyListener validator = - new ModifyListener() { - @Override - public void modifyText(ModifyEvent e) { - setPageComplete(validatePage()); - } - }; - - /** - * - * - * - * @generated - */ - protected boolean validatePage() { - return getInitialObjectName() != null && getEncodings().contains(encodingField.getText()); - } - - /** - * - * - * - * @generated - */ - @Override - public void setVisible(boolean visible) { - super.setVisible(visible); - if (visible) { - if (initialObjectField.getItemCount() == 1) { - initialObjectField.clearSelection(); - encodingField.setFocus(); - } - else { - encodingField.clearSelection(); - initialObjectField.setFocus(); - } - } - } - - /** - * - * - * - * @generated - */ - public String getInitialObjectName() { - String label = initialObjectField.getText(); - - for (String name : getInitialObjectNames()) { - if (getLabel(name).equals(label)) { - return name; - } - } - return null; - } - - /** - * - * - * - * @generated - */ - public String getEncoding() { - return encodingField.getText(); - } - - /** - * Returns the label for the specified type name. - * - * - * - * @generated - */ - protected String getLabel(String typeName) { - try { - return JavaEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); - } catch (MissingResourceException mre) { - JavaEditorPlugin.INSTANCE.log(mre); - } - return typeName; - } - - /** - * - * - * - * @generated - */ - protected Collection getEncodings() { - if (encodings == null) { - encodings = new ArrayList(); - for (StringTokenizer stringTokenizer = new StringTokenizer(JavaEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens();) { - encodings.add(stringTokenizer.nextToken()); - } - } - return encodings; - } - } - - /** - * The framework calls this to create the contents of the wizard. - * - * - * - * @generated - */ - @Override - public void addPages() { - // Create a page, set the title, and the initial model file name. - // - newFileCreationPage = new JavaModelWizardNewFileCreationPage("Whatever", selection); - newFileCreationPage.setTitle(JavaEditorPlugin.INSTANCE.getString("_UI_JavaModelWizard_label")); - newFileCreationPage.setDescription(JavaEditorPlugin.INSTANCE.getString("_UI_JavaModelWizard_description")); - newFileCreationPage.setFileName(JavaEditorPlugin.INSTANCE.getString("_UI_JavaEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0)); - addPage(newFileCreationPage); - - // Try and get the resource selection to determine a current directory for the file dialog. - // - if (selection != null && !selection.isEmpty()) { - // Get the resource... - // - Object selectedElement = selection.iterator().next(); - if (selectedElement instanceof IResource) { - // Get the resource parent, if its a file. - // - IResource selectedResource = (IResource) selectedElement; - if (selectedResource.getType() == IResource.FILE) { - selectedResource = selectedResource.getParent(); - } - - // This gives us a directory... - // - if (selectedResource instanceof IFolder || selectedResource instanceof IProject) { - // Set this for the container. - // - newFileCreationPage.setContainerFullPath(selectedResource.getFullPath()); - - // Make up a unique new name here. - // - String defaultModelBaseFilename = JavaEditorPlugin.INSTANCE.getString("_UI_JavaEditorFilenameDefaultBase"); - String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0); - String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; - for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) { - modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; - } - newFileCreationPage.setFileName(modelFilename); - } - } - } - initialObjectCreationPage = new JavaModelWizardInitialObjectCreationPage("Whatever2"); - initialObjectCreationPage.setTitle(JavaEditorPlugin.INSTANCE.getString("_UI_JavaModelWizard_label")); - initialObjectCreationPage.setDescription(JavaEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description")); - addPage(initialObjectCreationPage); - } - - /** - * Get the file from the page. - * - * - * - * @generated - */ - public IFile getModelFile() { - return newFileCreationPage.getModelFile(); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/.classpath b/extraplugins/java/org.eclipse.papyrus.java.profile/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/.project b/extraplugins/java/org.eclipse.papyrus.java.profile/.project deleted file mode 100644 index f90e9a5b55b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.java.profile - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.core.prefs b/extraplugins/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94d61f00da6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/META-INF/MANIFEST.MF b/extraplugins/java/org.eclipse.papyrus.java.profile/META-INF/MANIFEST.MF deleted file mode 100644 index 1cd3c3071ad..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.emf.ecore;visibility:=reexport, - org.eclipse.emf.ecore.xmi;visibility:=reexport, - org.eclipse.uml2.uml;visibility:=reexport -Export-Package: org.eclipse.papyrus.java.profile.java, - org.eclipse.papyrus.java.profile.java.impl, - org.eclipse.papyrus.java.profile.java.util -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.java.profile;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/about.html b/extraplugins/java/org.eclipse.papyrus.java.profile/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/build.properties b/extraplugins/java/org.eclipse.papyrus.java.profile/build.properties deleted file mode 100644 index a3690e680da..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/build.properties +++ /dev/null @@ -1,17 +0,0 @@ - -# -# -# -# $Id$ - -bin.includes = .,\ - models/,\ - META-INF/,\ - plugin.xml,\ - plugin.properties,\ - icons/,\ - about.html -jars.compile.order = . -source.. = src/ -output.. = bin/ -src.includes = about.html diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/icons/javaprofile.gif b/extraplugins/java/org.eclipse.papyrus.java.profile/icons/javaprofile.gif deleted file mode 100644 index 34fb3c9d8cb..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.profile/icons/javaprofile.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.ecore b/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.ecore deleted file mode 100644 index f2ce423a3eb..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.ecore +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.di b/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.di deleted file mode 100644 index 61e2f6a31f3..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.di +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.genmodel b/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.genmodel deleted file mode 100644 index c2f4684879d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.genmodel +++ /dev/null @@ -1,105 +0,0 @@ - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - java.profile.uml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.notation b/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.notation deleted file mode 100644 index a5335966efb..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.notation +++ /dev/null @@ -1,821 +0,0 @@ - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.uml b/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.uml deleted file mode 100644 index 9aff0b63659..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/models/java.profile.uml +++ /dev/null @@ -1,5729 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The implementation class to use when this primitive type is encountered with a cardinality greater than 1. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/plugin.properties b/extraplugins/java/org.eclipse.papyrus.java.profile/plugin.properties deleted file mode 100644 index bc49c812cb7..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/plugin.properties +++ /dev/null @@ -1,16 +0,0 @@ - -################################################################################# -# Copyright (c) 2011-2013 Cedric Dumoulin. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API -# -################################################################################# - -pluginName = Profile for Java classes generation (Incubation) -providerName = Eclipse Modeling Project diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/plugin.xml b/extraplugins/java/org.eclipse.papyrus.java.profile/plugin.xml deleted file mode 100644 index 9ebf9f7c10b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/plugin.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/pom.xml b/extraplugins/java/org.eclipse.papyrus.java.profile/pom.xml deleted file mode 100644 index 2c76b0c8d93..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.java.profile - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaClass.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaClass.java deleted file mode 100644 index 86b0fc45fd6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaClass.java +++ /dev/null @@ -1,209 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.uml2.uml.Classifier; - -/** - * - * A representation of the model object 'Class'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaClass#getBase_Classifier Base Classifier}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaClass#isFinal Is Final}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaClass#isAbstract Is Abstract}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaClass#isStatic Is Static}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaClass#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaClass#getExplicitRequiredImports Explicit Required Imports}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass() - * @model - * @generated - */ -public interface JavaClass extends JavaGen { - /** - * Returns the value of the 'Base Classifier' reference. - * - *

- * If the meaning of the 'Base Classifier' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Base Classifier' reference. - * @see #setBase_Classifier(Classifier) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass_Base_Classifier() - * @model required="true" ordered="false" - * @generated - */ - Classifier getBase_Classifier(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaClass#getBase_Classifier Base Classifier}' reference. - * - * - * - * @param value - * the new value of the 'Base Classifier' reference. - * @see #getBase_Classifier() - * @generated - */ - void setBase_Classifier(Classifier value); - - /** - * Returns the value of the 'Is Final' attribute. - * - *

- * If the meaning of the 'Is Final' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Final' attribute. - * @see #setIsFinal(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass_IsFinal() - * @model unique="false" required="true" ordered="false" - * @generated - */ - boolean isFinal(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaClass#isFinal Is Final}' attribute. - * - * - * - * @param value - * the new value of the 'Is Final' attribute. - * @see #isFinal() - * @generated - */ - void setIsFinal(boolean value); - - /** - * Returns the value of the 'Is Abstract' attribute. - * - *

- * If the meaning of the 'Is Abstract' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Abstract' attribute. - * @see #setIsAbstract(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass_IsAbstract() - * @model unique="false" required="true" ordered="false" - * @generated - */ - boolean isAbstract(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaClass#isAbstract Is Abstract}' attribute. - * - * - * - * @param value - * the new value of the 'Is Abstract' attribute. - * @see #isAbstract() - * @generated - */ - void setIsAbstract(boolean value); - - /** - * Returns the value of the 'Is Static' attribute. - * - *

- * If the meaning of the 'Is Static' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Static' attribute. - * @see #setIsStatic(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass_IsStatic() - * @model unique="false" required="true" ordered="false" - * @generated - */ - boolean isStatic(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaClass#isStatic Is Static}' attribute. - * - * - * - * @param value - * the new value of the 'Is Static' attribute. - * @see #isStatic() - * @generated - */ - void setIsStatic(boolean value); - - /** - * Returns the value of the 'Explicit Plain Text Required Imports' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'Explicit Plain Text Required Imports' attribute list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Explicit Plain Text Required Imports' attribute list. - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass_ExplicitPlainTextRequiredImports() - * @model unique="false" ordered="false" - * @generated - */ - EList getExplicitPlainTextRequiredImports(); - - /** - * Returns the value of the 'Explicit Required Imports' reference list. - * The list contents are of type {@link org.eclipse.uml2.uml.Classifier}. - * - *

- * If the meaning of the 'Explicit Required Imports' reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Explicit Required Imports' reference list. - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass_ExplicitRequiredImports() - * @model ordered="false" - * @generated - */ - EList getExplicitRequiredImports(); - - /** - * Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name' from the 'Explicit Required Imports' reference list. - * - * - * - * @param name - * The 'Name' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. - * @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name', or null. - * @see #getExplicitRequiredImports() - * @generated - */ - Classifier getExplicitRequiredImports(String name); - - /** - * Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name' from the 'Explicit Required Imports' reference list. - * - * - * - * @param name - * The 'Name' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. - * @param ignoreCase - * Whether to ignore case in {@link java.lang.String} comparisons. - * @param eClass - * The Ecore class of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. - * @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name', or null. - * @see #getExplicitRequiredImports() - * @generated - */ - Classifier getExplicitRequiredImports(String name, boolean ignoreCase, EClass eClass); - -} // JavaClass diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaFactory.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaFactory.java deleted file mode 100644 index 6adbd7ca301..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaFactory.java +++ /dev/null @@ -1,120 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java; - -import org.eclipse.emf.ecore.EFactory; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage - * @generated - */ -public interface JavaFactory extends EFactory { - /** - * The singleton instance of the factory. - * - * - * - * @generated - */ - JavaFactory eINSTANCE = org.eclipse.papyrus.java.profile.java.impl.JavaFactoryImpl.init(); - - /** - * Returns a new object of class 'Class'. - * - * - * - * @return a new object of class 'Class'. - * @generated - */ - JavaClass createJavaClass(); - - /** - * Returns a new object of class 'Package '. - * - * - * - * @return a new object of class 'Package '. - * @generated - */ - JavaPackage_ createJavaPackage_(); - - /** - * Returns a new object of class 'Method'. - * - * - * - * @return a new object of class 'Method'. - * @generated - */ - JavaMethod createJavaMethod(); - - /** - * Returns a new object of class 'Parameter'. - * - * - * - * @return a new object of class 'Parameter'. - * @generated - */ - JavaParameter createJavaParameter(); - - /** - * Returns a new object of class 'Property'. - * - * - * - * @return a new object of class 'Property'. - * @generated - */ - JavaProperty createJavaProperty(); - - /** - * Returns a new object of class 'Primitive Type'. - * - * - * - * @return a new object of class 'Primitive Type'. - * @generated - */ - PrimitiveType createPrimitiveType(); - - /** - * Returns a new object of class 'Project'. - * - * - * - * @return a new object of class 'Project'. - * @generated - */ - JavaProject createJavaProject(); - - /** - * Returns a new object of class 'Src Folder'. - * - * - * - * @return a new object of class 'Src Folder'. - * @generated - */ - JavaSrcFolder createJavaSrcFolder(); - - /** - * Returns the package supported by this factory. - * - * - * - * @return the package supported by this factory. - * @generated - */ - JavaPackage getJavaPackage(); - -} // JavaFactory diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaGen.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaGen.java deleted file mode 100644 index a4342630684..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaGen.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java; - - -/** - * - * A representation of the model object 'Gen'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaGen#getSrcName Src Name}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaGen#getProjectName Project Name}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaGen() - * @model abstract="true" - * @generated - */ -public interface JavaGen extends JavaNamedElement { - /** - * Returns the value of the 'Src Name' attribute. - * - *

- * If the meaning of the 'Src Name' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Src Name' attribute. - * @see #setSrcName(String) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaGen_SrcName() - * @model unique="false" required="true" ordered="false" - * @generated - */ - String getSrcName(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaGen#getSrcName Src Name}' attribute. - * - * - * - * @param value - * the new value of the 'Src Name' attribute. - * @see #getSrcName() - * @generated - */ - void setSrcName(String value); - - /** - * Returns the value of the 'Project Name' attribute. - * - *

- * If the meaning of the 'Project Name' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Project Name' attribute. - * @see #setProjectName(String) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaGen_ProjectName() - * @model unique="false" required="true" ordered="false" - * @generated - */ - String getProjectName(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaGen#getProjectName Project Name}' attribute. - * - * - * - * @param value - * the new value of the 'Project Name' attribute. - * @see #getProjectName() - * @generated - */ - void setProjectName(String value); - -} // JavaGen diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaMethod.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaMethod.java deleted file mode 100644 index b0230672d39..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaMethod.java +++ /dev/null @@ -1,297 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Operation; - -/** - * - * A representation of the model object 'Method'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#isStatic Is Static}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#isFinal Is Final}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#isAbstract Is Abstract}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#isNative Is Native}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#isSynchronized Is Synchronized}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#isConstructor Is Constructor}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#getBase_Operation Base Operation}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#getExplicitRequiredImports Explicit Required Imports}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod() - * @model - * @generated - */ -public interface JavaMethod extends JavaNamedElement { - /** - * Returns the value of the 'Is Static' attribute. - * - *

- * If the meaning of the 'Is Static' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Static' attribute. - * @see #setIsStatic(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_IsStatic() - * @model unique="false" required="true" ordered="false" - * @generated - */ - boolean isStatic(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isStatic Is Static}' attribute. - * - * - * - * @param value - * the new value of the 'Is Static' attribute. - * @see #isStatic() - * @generated - */ - void setIsStatic(boolean value); - - /** - * Returns the value of the 'Is Final' attribute. - * - *

- * If the meaning of the 'Is Final' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Final' attribute. - * @see #setIsFinal(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_IsFinal() - * @model unique="false" required="true" ordered="false" - * @generated - */ - boolean isFinal(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isFinal Is Final}' attribute. - * - * - * - * @param value - * the new value of the 'Is Final' attribute. - * @see #isFinal() - * @generated - */ - void setIsFinal(boolean value); - - /** - * Returns the value of the 'Is Abstract' attribute. - * - *

- * If the meaning of the 'Is Abstract' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Abstract' attribute. - * @see #setIsAbstract(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_IsAbstract() - * @model unique="false" required="true" ordered="false" - * @generated - */ - boolean isAbstract(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isAbstract Is Abstract}' attribute. - * - * - * - * @param value - * the new value of the 'Is Abstract' attribute. - * @see #isAbstract() - * @generated - */ - void setIsAbstract(boolean value); - - /** - * Returns the value of the 'Is Native' attribute. - * - *

- * If the meaning of the 'Is Native' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Native' attribute. - * @see #setIsNative(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_IsNative() - * @model unique="false" required="true" ordered="false" - * @generated - */ - boolean isNative(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isNative Is Native}' attribute. - * - * - * - * @param value - * the new value of the 'Is Native' attribute. - * @see #isNative() - * @generated - */ - void setIsNative(boolean value); - - /** - * Returns the value of the 'Is Synchronized' attribute. - * - *

- * If the meaning of the 'Is Synchronized' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Synchronized' attribute. - * @see #setIsSynchronized(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_IsSynchronized() - * @model unique="false" required="true" ordered="false" - * @generated - */ - boolean isSynchronized(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isSynchronized Is Synchronized}' attribute. - * - * - * - * @param value - * the new value of the 'Is Synchronized' attribute. - * @see #isSynchronized() - * @generated - */ - void setIsSynchronized(boolean value); - - /** - * Returns the value of the 'Is Constructor' attribute. - * - *

- * If the meaning of the 'Is Constructor' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Constructor' attribute. - * @see #setIsConstructor(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_IsConstructor() - * @model unique="false" required="true" ordered="false" - * @generated - */ - boolean isConstructor(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isConstructor Is Constructor}' attribute. - * - * - * - * @param value - * the new value of the 'Is Constructor' attribute. - * @see #isConstructor() - * @generated - */ - void setIsConstructor(boolean value); - - /** - * Returns the value of the 'Base Operation' reference. - * - *

- * If the meaning of the 'Base Operation' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Base Operation' reference. - * @see #setBase_Operation(Operation) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_Base_Operation() - * @model required="true" ordered="false" - * @generated - */ - Operation getBase_Operation(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#getBase_Operation Base Operation}' reference. - * - * - * - * @param value - * the new value of the 'Base Operation' reference. - * @see #getBase_Operation() - * @generated - */ - void setBase_Operation(Operation value); - - /** - * Returns the value of the 'Explicit Plain Text Required Imports' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'Explicit Plain Text Required Imports' attribute list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Explicit Plain Text Required Imports' attribute list. - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_ExplicitPlainTextRequiredImports() - * @model unique="false" ordered="false" - * @generated - */ - EList getExplicitPlainTextRequiredImports(); - - /** - * Returns the value of the 'Explicit Required Imports' reference list. - * The list contents are of type {@link org.eclipse.uml2.uml.Classifier}. - * - *

- * If the meaning of the 'Explicit Required Imports' reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Explicit Required Imports' reference list. - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_ExplicitRequiredImports() - * @model ordered="false" - * @generated - */ - EList getExplicitRequiredImports(); - - /** - * Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name' from the 'Explicit Required Imports' reference list. - * - * - * - * @param name - * The 'Name' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. - * @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name', or null. - * @see #getExplicitRequiredImports() - * @generated - */ - Classifier getExplicitRequiredImports(String name); - - /** - * Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name' from the 'Explicit Required Imports' reference list. - * - * - * - * @param name - * The 'Name' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. - * @param ignoreCase - * Whether to ignore case in {@link java.lang.String} comparisons. - * @param eClass - * The Ecore class of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. - * @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name', or null. - * @see #getExplicitRequiredImports() - * @generated - */ - Classifier getExplicitRequiredImports(String name, boolean ignoreCase, EClass eClass); - -} // JavaMethod diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaNamedElement.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaNamedElement.java deleted file mode 100644 index 0ae050419d3..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaNamedElement.java +++ /dev/null @@ -1,173 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Named Element'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getName Name}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getAuthor Author}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getVersion Version}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getComment Comment}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#isGenerated Is Generated}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaNamedElement() - * @model abstract="true" - * @generated - */ -public interface JavaNamedElement extends EObject { - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaNamedElement_Name() - * @model unique="false" required="true" ordered="false" - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getName Name}' attribute. - * - * - * - * @param value - * the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Author' attribute. - * - *

- * If the meaning of the 'Author' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Author' attribute. - * @see #setAuthor(String) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaNamedElement_Author() - * @model unique="false" required="true" ordered="false" - * @generated - */ - String getAuthor(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getAuthor Author}' attribute. - * - * - * - * @param value - * the new value of the 'Author' attribute. - * @see #getAuthor() - * @generated - */ - void setAuthor(String value); - - /** - * Returns the value of the 'Version' attribute. - * - *

- * If the meaning of the 'Version' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Version' attribute. - * @see #setVersion(String) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaNamedElement_Version() - * @model unique="false" required="true" ordered="false" - * @generated - */ - String getVersion(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getVersion Version}' attribute. - * - * - * - * @param value - * the new value of the 'Version' attribute. - * @see #getVersion() - * @generated - */ - void setVersion(String value); - - /** - * Returns the value of the 'Comment' attribute. - * - *

- * If the meaning of the 'Comment' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Comment' attribute. - * @see #setComment(String) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaNamedElement_Comment() - * @model unique="false" required="true" ordered="false" - * @generated - */ - String getComment(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getComment Comment}' attribute. - * - * - * - * @param value - * the new value of the 'Comment' attribute. - * @see #getComment() - * @generated - */ - void setComment(String value); - - /** - * Returns the value of the 'Is Generated' attribute. - * The default value is "true". - * - *

- * If the meaning of the 'Is Generated' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Generated' attribute. - * @see #setIsGenerated(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaNamedElement_IsGenerated() - * @model default="true" unique="false" required="true" ordered="false" - * @generated - */ - boolean isGenerated(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#isGenerated Is Generated}' attribute. - * - * - * - * @param value - * the new value of the 'Is Generated' attribute. - * @see #isGenerated() - * @generated - */ - void setIsGenerated(boolean value); - -} // JavaNamedElement diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage.java deleted file mode 100644 index 32e0cda8c6a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage.java +++ /dev/null @@ -1,2348 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * - * @see org.eclipse.papyrus.java.profile.java.JavaFactory - * @model kind="package" - * @generated - */ -public interface JavaPackage extends EPackage { - /** - * The package name. - * - * - * - * @generated - */ - String eNAME = "java"; - - /** - * The package namespace URI. - * - * - * - * @generated - */ - String eNS_URI = "http://www.eclipse.org/papyrus/JAVA/1"; - - /** - * The package namespace name. - * - * - * - * @generated - */ - String eNS_PREFIX = "java"; - - /** - * The singleton instance of the package. - * - * - * - * @generated - */ - JavaPackage eINSTANCE = org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl.init(); - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl Named Element}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaNamedElement() - * @generated - */ - int JAVA_NAMED_ELEMENT = 2; - - /** - * The feature id for the 'Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_NAMED_ELEMENT__NAME = 0; - - /** - * The feature id for the 'Author' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_NAMED_ELEMENT__AUTHOR = 1; - - /** - * The feature id for the 'Version' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_NAMED_ELEMENT__VERSION = 2; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_NAMED_ELEMENT__COMMENT = 3; - - /** - * The feature id for the 'Is Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_NAMED_ELEMENT__IS_GENERATED = 4; - - /** - * The number of structural features of the 'Named Element' class. - * - * - * - * @generated - * @ordered - */ - int JAVA_NAMED_ELEMENT_FEATURE_COUNT = 5; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaGenImpl Gen}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaGenImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaGen() - * @generated - */ - int JAVA_GEN = 1; - - /** - * The feature id for the 'Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_GEN__NAME = JAVA_NAMED_ELEMENT__NAME; - - /** - * The feature id for the 'Author' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_GEN__AUTHOR = JAVA_NAMED_ELEMENT__AUTHOR; - - /** - * The feature id for the 'Version' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_GEN__VERSION = JAVA_NAMED_ELEMENT__VERSION; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_GEN__COMMENT = JAVA_NAMED_ELEMENT__COMMENT; - - /** - * The feature id for the 'Is Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_GEN__IS_GENERATED = JAVA_NAMED_ELEMENT__IS_GENERATED; - - /** - * The feature id for the 'Src Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_GEN__SRC_NAME = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Project Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_GEN__PROJECT_NAME = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Gen' class. - * - * - * - * @generated - * @ordered - */ - int JAVA_GEN_FEATURE_COUNT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl Class}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaClass() - * @generated - */ - int JAVA_CLASS = 0; - - /** - * The feature id for the 'Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS__NAME = JAVA_GEN__NAME; - - /** - * The feature id for the 'Author' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS__AUTHOR = JAVA_GEN__AUTHOR; - - /** - * The feature id for the 'Version' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS__VERSION = JAVA_GEN__VERSION; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS__COMMENT = JAVA_GEN__COMMENT; - - /** - * The feature id for the 'Is Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS__IS_GENERATED = JAVA_GEN__IS_GENERATED; - - /** - * The feature id for the 'Src Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS__SRC_NAME = JAVA_GEN__SRC_NAME; - - /** - * The feature id for the 'Project Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS__PROJECT_NAME = JAVA_GEN__PROJECT_NAME; - - /** - * The feature id for the 'Base Classifier' reference. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS__BASE_CLASSIFIER = JAVA_GEN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Is Final' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS__IS_FINAL = JAVA_GEN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Is Abstract' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS__IS_ABSTRACT = JAVA_GEN_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Is Static' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS__IS_STATIC = JAVA_GEN_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Explicit Plain Text Required Imports' attribute list. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JAVA_GEN_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Explicit Required Imports' reference list. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS = JAVA_GEN_FEATURE_COUNT + 5; - - /** - * The number of structural features of the 'Class' class. - * - * - * - * @generated - * @ordered - */ - int JAVA_CLASS_FEATURE_COUNT = JAVA_GEN_FEATURE_COUNT + 6; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaPackage_Impl Package }' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackage_Impl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaPackage_() - * @generated - */ - int JAVA_PACKAGE_ = 3; - - /** - * The feature id for the 'Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PACKAGE___NAME = JAVA_GEN__NAME; - - /** - * The feature id for the 'Author' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PACKAGE___AUTHOR = JAVA_GEN__AUTHOR; - - /** - * The feature id for the 'Version' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PACKAGE___VERSION = JAVA_GEN__VERSION; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PACKAGE___COMMENT = JAVA_GEN__COMMENT; - - /** - * The feature id for the 'Is Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PACKAGE___IS_GENERATED = JAVA_GEN__IS_GENERATED; - - /** - * The feature id for the 'Src Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PACKAGE___SRC_NAME = JAVA_GEN__SRC_NAME; - - /** - * The feature id for the 'Project Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PACKAGE___PROJECT_NAME = JAVA_GEN__PROJECT_NAME; - - /** - * The feature id for the 'Package Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PACKAGE___PACKAGE_NAME = JAVA_GEN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Base Package' reference. - * - * - * - * @generated - * @ordered - */ - int JAVA_PACKAGE___BASE_PACKAGE = JAVA_GEN_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Package ' class. - * - * - * - * @generated - * @ordered - */ - int JAVA_PACKAGE__FEATURE_COUNT = JAVA_GEN_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl Method}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaMethod() - * @generated - */ - int JAVA_METHOD = 4; - - /** - * The feature id for the 'Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__NAME = JAVA_NAMED_ELEMENT__NAME; - - /** - * The feature id for the 'Author' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__AUTHOR = JAVA_NAMED_ELEMENT__AUTHOR; - - /** - * The feature id for the 'Version' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__VERSION = JAVA_NAMED_ELEMENT__VERSION; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__COMMENT = JAVA_NAMED_ELEMENT__COMMENT; - - /** - * The feature id for the 'Is Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__IS_GENERATED = JAVA_NAMED_ELEMENT__IS_GENERATED; - - /** - * The feature id for the 'Is Static' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__IS_STATIC = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Is Final' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__IS_FINAL = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Is Abstract' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__IS_ABSTRACT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Is Native' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__IS_NATIVE = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Is Synchronized' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__IS_SYNCHRONIZED = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Is Constructor' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__IS_CONSTRUCTOR = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Base Operation' reference. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__BASE_OPERATION = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Explicit Plain Text Required Imports' attribute list. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Explicit Required Imports' reference list. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 8; - - /** - * The number of structural features of the 'Method' class. - * - * - * - * @generated - * @ordered - */ - int JAVA_METHOD_FEATURE_COUNT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 9; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaParameterImpl Parameter}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaParameterImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaParameter() - * @generated - */ - int JAVA_PARAMETER = 5; - - /** - * The feature id for the 'Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PARAMETER__NAME = JAVA_NAMED_ELEMENT__NAME; - - /** - * The feature id for the 'Author' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PARAMETER__AUTHOR = JAVA_NAMED_ELEMENT__AUTHOR; - - /** - * The feature id for the 'Version' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PARAMETER__VERSION = JAVA_NAMED_ELEMENT__VERSION; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PARAMETER__COMMENT = JAVA_NAMED_ELEMENT__COMMENT; - - /** - * The feature id for the 'Is Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PARAMETER__IS_GENERATED = JAVA_NAMED_ELEMENT__IS_GENERATED; - - /** - * The feature id for the 'Is Final' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PARAMETER__IS_FINAL = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Base Parameter' reference. - * - * - * - * @generated - * @ordered - */ - int JAVA_PARAMETER__BASE_PARAMETER = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Parameter' class. - * - * - * - * @generated - * @ordered - */ - int JAVA_PARAMETER_FEATURE_COUNT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl Property}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaProperty() - * @generated - */ - int JAVA_PROPERTY = 6; - - /** - * The feature id for the 'Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__NAME = JAVA_NAMED_ELEMENT__NAME; - - /** - * The feature id for the 'Author' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__AUTHOR = JAVA_NAMED_ELEMENT__AUTHOR; - - /** - * The feature id for the 'Version' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__VERSION = JAVA_NAMED_ELEMENT__VERSION; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__COMMENT = JAVA_NAMED_ELEMENT__COMMENT; - - /** - * The feature id for the 'Is Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__IS_GENERATED = JAVA_NAMED_ELEMENT__IS_GENERATED; - - /** - * The feature id for the 'Is Abstract' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__IS_ABSTRACT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Is Final' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__IS_FINAL = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Base Property' reference. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__BASE_PROPERTY = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Is Transient' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__IS_TRANSIENT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 3; - - /** - * The feature id for the 'Generate Getter' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__GENERATE_GETTER = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 4; - - /** - * The feature id for the 'Generate Setter' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__GENERATE_SETTER = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 5; - - /** - * The feature id for the 'Is Static' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__IS_STATIC = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 6; - - /** - * The feature id for the 'Explicit Plain Text Required Imports' attribute list. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 7; - - /** - * The feature id for the 'Explicit Required Imports' reference list. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 8; - - /** - * The number of structural features of the 'Property' class. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROPERTY_FEATURE_COUNT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 9; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl Primitive Type}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getPrimitiveType() - * @generated - */ - int PRIMITIVE_TYPE = 7; - - /** - * The feature id for the 'Name' attribute. - * - * - * - * @generated - * @ordered - */ - int PRIMITIVE_TYPE__NAME = JAVA_GEN__NAME; - - /** - * The feature id for the 'Author' attribute. - * - * - * - * @generated - * @ordered - */ - int PRIMITIVE_TYPE__AUTHOR = JAVA_GEN__AUTHOR; - - /** - * The feature id for the 'Version' attribute. - * - * - * - * @generated - * @ordered - */ - int PRIMITIVE_TYPE__VERSION = JAVA_GEN__VERSION; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int PRIMITIVE_TYPE__COMMENT = JAVA_GEN__COMMENT; - - /** - * The feature id for the 'Is Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int PRIMITIVE_TYPE__IS_GENERATED = JAVA_GEN__IS_GENERATED; - - /** - * The feature id for the 'Src Name' attribute. - * - * - * - * @generated - * @ordered - */ - int PRIMITIVE_TYPE__SRC_NAME = JAVA_GEN__SRC_NAME; - - /** - * The feature id for the 'Project Name' attribute. - * - * - * - * @generated - * @ordered - */ - int PRIMITIVE_TYPE__PROJECT_NAME = JAVA_GEN__PROJECT_NAME; - - /** - * The feature id for the 'Implementation Class' attribute. - * - * - * - * @generated - * @ordered - */ - int PRIMITIVE_TYPE__IMPLEMENTATION_CLASS = JAVA_GEN_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Base Primitive Type' reference. - * - * - * - * @generated - * @ordered - */ - int PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE = JAVA_GEN_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Collection Implementation Class' attribute. - * - * - * - * @generated - * @ordered - */ - int PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS = JAVA_GEN_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Primitive Type' class. - * - * - * - * @generated - * @ordered - */ - int PRIMITIVE_TYPE_FEATURE_COUNT = JAVA_GEN_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaProjectImpl Project}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaProjectImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaProject() - * @generated - */ - int JAVA_PROJECT = 8; - - /** - * The feature id for the 'Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROJECT__NAME = JAVA_GEN__NAME; - - /** - * The feature id for the 'Author' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROJECT__AUTHOR = JAVA_GEN__AUTHOR; - - /** - * The feature id for the 'Version' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROJECT__VERSION = JAVA_GEN__VERSION; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROJECT__COMMENT = JAVA_GEN__COMMENT; - - /** - * The feature id for the 'Is Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROJECT__IS_GENERATED = JAVA_GEN__IS_GENERATED; - - /** - * The feature id for the 'Src Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROJECT__SRC_NAME = JAVA_GEN__SRC_NAME; - - /** - * The feature id for the 'Project Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROJECT__PROJECT_NAME = JAVA_GEN__PROJECT_NAME; - - /** - * The feature id for the 'Base Package' reference. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROJECT__BASE_PACKAGE = JAVA_GEN_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Project' class. - * - * - * - * @generated - * @ordered - */ - int JAVA_PROJECT_FEATURE_COUNT = JAVA_GEN_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaSrcFolderImpl Src Folder}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaSrcFolderImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaSrcFolder() - * @generated - */ - int JAVA_SRC_FOLDER = 9; - - /** - * The feature id for the 'Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_SRC_FOLDER__NAME = JAVA_GEN__NAME; - - /** - * The feature id for the 'Author' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_SRC_FOLDER__AUTHOR = JAVA_GEN__AUTHOR; - - /** - * The feature id for the 'Version' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_SRC_FOLDER__VERSION = JAVA_GEN__VERSION; - - /** - * The feature id for the 'Comment' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_SRC_FOLDER__COMMENT = JAVA_GEN__COMMENT; - - /** - * The feature id for the 'Is Generated' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_SRC_FOLDER__IS_GENERATED = JAVA_GEN__IS_GENERATED; - - /** - * The feature id for the 'Src Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_SRC_FOLDER__SRC_NAME = JAVA_GEN__SRC_NAME; - - /** - * The feature id for the 'Project Name' attribute. - * - * - * - * @generated - * @ordered - */ - int JAVA_SRC_FOLDER__PROJECT_NAME = JAVA_GEN__PROJECT_NAME; - - /** - * The feature id for the 'Base Package' reference. - * - * - * - * @generated - * @ordered - */ - int JAVA_SRC_FOLDER__BASE_PACKAGE = JAVA_GEN_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Src Folder' class. - * - * - * - * @generated - * @ordered - */ - int JAVA_SRC_FOLDER_FEATURE_COUNT = JAVA_GEN_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.TrueFalseDefault True False Default}' enum. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getTrueFalseDefault() - * @generated - */ - int TRUE_FALSE_DEFAULT = 10; - - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaClass Class}'. - * - * - * - * @return the meta object for class 'Class'. - * @see org.eclipse.papyrus.java.profile.java.JavaClass - * @generated - */ - EClass getJavaClass(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaClass#getBase_Classifier Base Classifier}'. - * - * - * - * @return the meta object for the reference 'Base Classifier'. - * @see org.eclipse.papyrus.java.profile.java.JavaClass#getBase_Classifier() - * @see #getJavaClass() - * @generated - */ - EReference getJavaClass_Base_Classifier(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaClass#isFinal Is Final}'. - * - * - * - * @return the meta object for the attribute 'Is Final'. - * @see org.eclipse.papyrus.java.profile.java.JavaClass#isFinal() - * @see #getJavaClass() - * @generated - */ - EAttribute getJavaClass_IsFinal(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaClass#isAbstract Is Abstract}'. - * - * - * - * @return the meta object for the attribute 'Is Abstract'. - * @see org.eclipse.papyrus.java.profile.java.JavaClass#isAbstract() - * @see #getJavaClass() - * @generated - */ - EAttribute getJavaClass_IsAbstract(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaClass#isStatic Is Static}'. - * - * - * - * @return the meta object for the attribute 'Is Static'. - * @see org.eclipse.papyrus.java.profile.java.JavaClass#isStatic() - * @see #getJavaClass() - * @generated - */ - EAttribute getJavaClass_IsStatic(); - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.java.profile.java.JavaClass#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}'. - * - * - * - * @return the meta object for the attribute list 'Explicit Plain Text Required Imports'. - * @see org.eclipse.papyrus.java.profile.java.JavaClass#getExplicitPlainTextRequiredImports() - * @see #getJavaClass() - * @generated - */ - EAttribute getJavaClass_ExplicitPlainTextRequiredImports(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.profile.java.JavaClass#getExplicitRequiredImports Explicit Required Imports}'. - * - * - * - * @return the meta object for the reference list 'Explicit Required Imports'. - * @see org.eclipse.papyrus.java.profile.java.JavaClass#getExplicitRequiredImports() - * @see #getJavaClass() - * @generated - */ - EReference getJavaClass_ExplicitRequiredImports(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaGen Gen}'. - * - * - * - * @return the meta object for class 'Gen'. - * @see org.eclipse.papyrus.java.profile.java.JavaGen - * @generated - */ - EClass getJavaGen(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaGen#getSrcName Src Name}'. - * - * - * - * @return the meta object for the attribute 'Src Name'. - * @see org.eclipse.papyrus.java.profile.java.JavaGen#getSrcName() - * @see #getJavaGen() - * @generated - */ - EAttribute getJavaGen_SrcName(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaGen#getProjectName Project Name}'. - * - * - * - * @return the meta object for the attribute 'Project Name'. - * @see org.eclipse.papyrus.java.profile.java.JavaGen#getProjectName() - * @see #getJavaGen() - * @generated - */ - EAttribute getJavaGen_ProjectName(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement Named Element}'. - * - * - * - * @return the meta object for class 'Named Element'. - * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement - * @generated - */ - EClass getJavaNamedElement(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getName Name}'. - * - * - * - * @return the meta object for the attribute 'Name'. - * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement#getName() - * @see #getJavaNamedElement() - * @generated - */ - EAttribute getJavaNamedElement_Name(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getAuthor Author}'. - * - * - * - * @return the meta object for the attribute 'Author'. - * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement#getAuthor() - * @see #getJavaNamedElement() - * @generated - */ - EAttribute getJavaNamedElement_Author(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getVersion Version}'. - * - * - * - * @return the meta object for the attribute 'Version'. - * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement#getVersion() - * @see #getJavaNamedElement() - * @generated - */ - EAttribute getJavaNamedElement_Version(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getComment Comment}'. - * - * - * - * @return the meta object for the attribute 'Comment'. - * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement#getComment() - * @see #getJavaNamedElement() - * @generated - */ - EAttribute getJavaNamedElement_Comment(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#isGenerated Is Generated}'. - * - * - * - * @return the meta object for the attribute 'Is Generated'. - * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement#isGenerated() - * @see #getJavaNamedElement() - * @generated - */ - EAttribute getJavaNamedElement_IsGenerated(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaPackage_ Package }'. - * - * - * - * @return the meta object for class 'Package '. - * @see org.eclipse.papyrus.java.profile.java.JavaPackage_ - * @generated - */ - EClass getJavaPackage_(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaPackage_#getPackageName Package Name}'. - * - * - * - * @return the meta object for the attribute 'Package Name'. - * @see org.eclipse.papyrus.java.profile.java.JavaPackage_#getPackageName() - * @see #getJavaPackage_() - * @generated - */ - EAttribute getJavaPackage__PackageName(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaPackage_#getBase_Package Base Package}'. - * - * - * - * @return the meta object for the reference 'Base Package'. - * @see org.eclipse.papyrus.java.profile.java.JavaPackage_#getBase_Package() - * @see #getJavaPackage_() - * @generated - */ - EReference getJavaPackage__Base_Package(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaMethod Method}'. - * - * - * - * @return the meta object for class 'Method'. - * @see org.eclipse.papyrus.java.profile.java.JavaMethod - * @generated - */ - EClass getJavaMethod(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isStatic Is Static}'. - * - * - * - * @return the meta object for the attribute 'Is Static'. - * @see org.eclipse.papyrus.java.profile.java.JavaMethod#isStatic() - * @see #getJavaMethod() - * @generated - */ - EAttribute getJavaMethod_IsStatic(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isFinal Is Final}'. - * - * - * - * @return the meta object for the attribute 'Is Final'. - * @see org.eclipse.papyrus.java.profile.java.JavaMethod#isFinal() - * @see #getJavaMethod() - * @generated - */ - EAttribute getJavaMethod_IsFinal(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isAbstract Is Abstract}'. - * - * - * - * @return the meta object for the attribute 'Is Abstract'. - * @see org.eclipse.papyrus.java.profile.java.JavaMethod#isAbstract() - * @see #getJavaMethod() - * @generated - */ - EAttribute getJavaMethod_IsAbstract(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isNative Is Native}'. - * - * - * - * @return the meta object for the attribute 'Is Native'. - * @see org.eclipse.papyrus.java.profile.java.JavaMethod#isNative() - * @see #getJavaMethod() - * @generated - */ - EAttribute getJavaMethod_IsNative(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isSynchronized Is Synchronized}'. - * - * - * - * @return the meta object for the attribute 'Is Synchronized'. - * @see org.eclipse.papyrus.java.profile.java.JavaMethod#isSynchronized() - * @see #getJavaMethod() - * @generated - */ - EAttribute getJavaMethod_IsSynchronized(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isConstructor Is Constructor}'. - * - * - * - * @return the meta object for the attribute 'Is Constructor'. - * @see org.eclipse.papyrus.java.profile.java.JavaMethod#isConstructor() - * @see #getJavaMethod() - * @generated - */ - EAttribute getJavaMethod_IsConstructor(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#getBase_Operation Base Operation}'. - * - * - * - * @return the meta object for the reference 'Base Operation'. - * @see org.eclipse.papyrus.java.profile.java.JavaMethod#getBase_Operation() - * @see #getJavaMethod() - * @generated - */ - EReference getJavaMethod_Base_Operation(); - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}'. - * - * - * - * @return the meta object for the attribute list 'Explicit Plain Text Required Imports'. - * @see org.eclipse.papyrus.java.profile.java.JavaMethod#getExplicitPlainTextRequiredImports() - * @see #getJavaMethod() - * @generated - */ - EAttribute getJavaMethod_ExplicitPlainTextRequiredImports(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#getExplicitRequiredImports Explicit Required Imports}'. - * - * - * - * @return the meta object for the reference list 'Explicit Required Imports'. - * @see org.eclipse.papyrus.java.profile.java.JavaMethod#getExplicitRequiredImports() - * @see #getJavaMethod() - * @generated - */ - EReference getJavaMethod_ExplicitRequiredImports(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaParameter Parameter}'. - * - * - * - * @return the meta object for class 'Parameter'. - * @see org.eclipse.papyrus.java.profile.java.JavaParameter - * @generated - */ - EClass getJavaParameter(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaParameter#isFinal Is Final}'. - * - * - * - * @return the meta object for the attribute 'Is Final'. - * @see org.eclipse.papyrus.java.profile.java.JavaParameter#isFinal() - * @see #getJavaParameter() - * @generated - */ - EAttribute getJavaParameter_IsFinal(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaParameter#getBase_Parameter Base Parameter}'. - * - * - * - * @return the meta object for the reference 'Base Parameter'. - * @see org.eclipse.papyrus.java.profile.java.JavaParameter#getBase_Parameter() - * @see #getJavaParameter() - * @generated - */ - EReference getJavaParameter_Base_Parameter(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaProperty Property}'. - * - * - * - * @return the meta object for class 'Property'. - * @see org.eclipse.papyrus.java.profile.java.JavaProperty - * @generated - */ - EClass getJavaProperty(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isAbstract Is Abstract}'. - * - * - * - * @return the meta object for the attribute 'Is Abstract'. - * @see org.eclipse.papyrus.java.profile.java.JavaProperty#isAbstract() - * @see #getJavaProperty() - * @generated - */ - EAttribute getJavaProperty_IsAbstract(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isFinal Is Final}'. - * - * - * - * @return the meta object for the attribute 'Is Final'. - * @see org.eclipse.papyrus.java.profile.java.JavaProperty#isFinal() - * @see #getJavaProperty() - * @generated - */ - EAttribute getJavaProperty_IsFinal(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getBase_Property Base Property}'. - * - * - * - * @return the meta object for the reference 'Base Property'. - * @see org.eclipse.papyrus.java.profile.java.JavaProperty#getBase_Property() - * @see #getJavaProperty() - * @generated - */ - EReference getJavaProperty_Base_Property(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isTransient Is Transient}'. - * - * - * - * @return the meta object for the attribute 'Is Transient'. - * @see org.eclipse.papyrus.java.profile.java.JavaProperty#isTransient() - * @see #getJavaProperty() - * @generated - */ - EAttribute getJavaProperty_IsTransient(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateGetter Generate Getter}'. - * - * - * - * @return the meta object for the attribute 'Generate Getter'. - * @see org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateGetter() - * @see #getJavaProperty() - * @generated - */ - EAttribute getJavaProperty_GenerateGetter(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateSetter Generate Setter}'. - * - * - * - * @return the meta object for the attribute 'Generate Setter'. - * @see org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateSetter() - * @see #getJavaProperty() - * @generated - */ - EAttribute getJavaProperty_GenerateSetter(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isStatic Is Static}'. - * - * - * - * @return the meta object for the attribute 'Is Static'. - * @see org.eclipse.papyrus.java.profile.java.JavaProperty#isStatic() - * @see #getJavaProperty() - * @generated - */ - EAttribute getJavaProperty_IsStatic(); - - /** - * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}'. - * - * - * - * @return the meta object for the attribute list 'Explicit Plain Text Required Imports'. - * @see org.eclipse.papyrus.java.profile.java.JavaProperty#getExplicitPlainTextRequiredImports() - * @see #getJavaProperty() - * @generated - */ - EAttribute getJavaProperty_ExplicitPlainTextRequiredImports(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getExplicitRequiredImports Explicit Required Imports}'. - * - * - * - * @return the meta object for the reference list 'Explicit Required Imports'. - * @see org.eclipse.papyrus.java.profile.java.JavaProperty#getExplicitRequiredImports() - * @see #getJavaProperty() - * @generated - */ - EReference getJavaProperty_ExplicitRequiredImports(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType Primitive Type}'. - * - * - * - * @return the meta object for class 'Primitive Type'. - * @see org.eclipse.papyrus.java.profile.java.PrimitiveType - * @generated - */ - EClass getPrimitiveType(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getImplementationClass Implementation Class}'. - * - * - * - * @return the meta object for the attribute 'Implementation Class'. - * @see org.eclipse.papyrus.java.profile.java.PrimitiveType#getImplementationClass() - * @see #getPrimitiveType() - * @generated - */ - EAttribute getPrimitiveType_ImplementationClass(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getBase_PrimitiveType Base Primitive Type}'. - * - * - * - * @return the meta object for the reference 'Base Primitive Type'. - * @see org.eclipse.papyrus.java.profile.java.PrimitiveType#getBase_PrimitiveType() - * @see #getPrimitiveType() - * @generated - */ - EReference getPrimitiveType_Base_PrimitiveType(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getCollectionImplementationClass Collection Implementation Class}'. - * - * - * - * @return the meta object for the attribute 'Collection Implementation Class'. - * @see org.eclipse.papyrus.java.profile.java.PrimitiveType#getCollectionImplementationClass() - * @see #getPrimitiveType() - * @generated - */ - EAttribute getPrimitiveType_CollectionImplementationClass(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaProject Project}'. - * - * - * - * @return the meta object for class 'Project'. - * @see org.eclipse.papyrus.java.profile.java.JavaProject - * @generated - */ - EClass getJavaProject(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaProject#getBase_Package Base Package}'. - * - * - * - * @return the meta object for the reference 'Base Package'. - * @see org.eclipse.papyrus.java.profile.java.JavaProject#getBase_Package() - * @see #getJavaProject() - * @generated - */ - EReference getJavaProject_Base_Package(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder Src Folder}'. - * - * - * - * @return the meta object for class 'Src Folder'. - * @see org.eclipse.papyrus.java.profile.java.JavaSrcFolder - * @generated - */ - EClass getJavaSrcFolder(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder#getBase_Package Base Package}'. - * - * - * - * @return the meta object for the reference 'Base Package'. - * @see org.eclipse.papyrus.java.profile.java.JavaSrcFolder#getBase_Package() - * @see #getJavaSrcFolder() - * @generated - */ - EReference getJavaSrcFolder_Base_Package(); - - /** - * Returns the meta object for enum '{@link org.eclipse.papyrus.java.profile.java.TrueFalseDefault True False Default}'. - * - * - * - * @return the meta object for enum 'True False Default'. - * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault - * @generated - */ - EEnum getTrueFalseDefault(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - JavaFactory getJavaFactory(); - - /** - * - * Defines literals for the meta objects that represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * - * @generated - */ - interface Literals { - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl Class}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaClass() - * @generated - */ - EClass JAVA_CLASS = eINSTANCE.getJavaClass(); - - /** - * The meta object literal for the 'Base Classifier' reference feature. - * - * - * - * @generated - */ - EReference JAVA_CLASS__BASE_CLASSIFIER = eINSTANCE.getJavaClass_Base_Classifier(); - - /** - * The meta object literal for the 'Is Final' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_CLASS__IS_FINAL = eINSTANCE.getJavaClass_IsFinal(); - - /** - * The meta object literal for the 'Is Abstract' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_CLASS__IS_ABSTRACT = eINSTANCE.getJavaClass_IsAbstract(); - - /** - * The meta object literal for the 'Is Static' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_CLASS__IS_STATIC = eINSTANCE.getJavaClass_IsStatic(); - - /** - * The meta object literal for the 'Explicit Plain Text Required Imports' attribute list feature. - * - * - * - * @generated - */ - EAttribute JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = eINSTANCE.getJavaClass_ExplicitPlainTextRequiredImports(); - - /** - * The meta object literal for the 'Explicit Required Imports' reference list feature. - * - * - * - * @generated - */ - EReference JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS = eINSTANCE.getJavaClass_ExplicitRequiredImports(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaGenImpl Gen}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaGenImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaGen() - * @generated - */ - EClass JAVA_GEN = eINSTANCE.getJavaGen(); - - /** - * The meta object literal for the 'Src Name' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_GEN__SRC_NAME = eINSTANCE.getJavaGen_SrcName(); - - /** - * The meta object literal for the 'Project Name' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_GEN__PROJECT_NAME = eINSTANCE.getJavaGen_ProjectName(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl Named Element}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaNamedElement() - * @generated - */ - EClass JAVA_NAMED_ELEMENT = eINSTANCE.getJavaNamedElement(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_NAMED_ELEMENT__NAME = eINSTANCE.getJavaNamedElement_Name(); - - /** - * The meta object literal for the 'Author' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_NAMED_ELEMENT__AUTHOR = eINSTANCE.getJavaNamedElement_Author(); - - /** - * The meta object literal for the 'Version' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_NAMED_ELEMENT__VERSION = eINSTANCE.getJavaNamedElement_Version(); - - /** - * The meta object literal for the 'Comment' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_NAMED_ELEMENT__COMMENT = eINSTANCE.getJavaNamedElement_Comment(); - - /** - * The meta object literal for the 'Is Generated' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_NAMED_ELEMENT__IS_GENERATED = eINSTANCE.getJavaNamedElement_IsGenerated(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaPackage_Impl Package }' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackage_Impl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaPackage_() - * @generated - */ - EClass JAVA_PACKAGE_ = eINSTANCE.getJavaPackage_(); - - /** - * The meta object literal for the 'Package Name' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_PACKAGE___PACKAGE_NAME = eINSTANCE.getJavaPackage__PackageName(); - - /** - * The meta object literal for the 'Base Package' reference feature. - * - * - * - * @generated - */ - EReference JAVA_PACKAGE___BASE_PACKAGE = eINSTANCE.getJavaPackage__Base_Package(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl Method}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaMethod() - * @generated - */ - EClass JAVA_METHOD = eINSTANCE.getJavaMethod(); - - /** - * The meta object literal for the 'Is Static' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_METHOD__IS_STATIC = eINSTANCE.getJavaMethod_IsStatic(); - - /** - * The meta object literal for the 'Is Final' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_METHOD__IS_FINAL = eINSTANCE.getJavaMethod_IsFinal(); - - /** - * The meta object literal for the 'Is Abstract' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_METHOD__IS_ABSTRACT = eINSTANCE.getJavaMethod_IsAbstract(); - - /** - * The meta object literal for the 'Is Native' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_METHOD__IS_NATIVE = eINSTANCE.getJavaMethod_IsNative(); - - /** - * The meta object literal for the 'Is Synchronized' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_METHOD__IS_SYNCHRONIZED = eINSTANCE.getJavaMethod_IsSynchronized(); - - /** - * The meta object literal for the 'Is Constructor' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_METHOD__IS_CONSTRUCTOR = eINSTANCE.getJavaMethod_IsConstructor(); - - /** - * The meta object literal for the 'Base Operation' reference feature. - * - * - * - * @generated - */ - EReference JAVA_METHOD__BASE_OPERATION = eINSTANCE.getJavaMethod_Base_Operation(); - - /** - * The meta object literal for the 'Explicit Plain Text Required Imports' attribute list feature. - * - * - * - * @generated - */ - EAttribute JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = eINSTANCE.getJavaMethod_ExplicitPlainTextRequiredImports(); - - /** - * The meta object literal for the 'Explicit Required Imports' reference list feature. - * - * - * - * @generated - */ - EReference JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS = eINSTANCE.getJavaMethod_ExplicitRequiredImports(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaParameterImpl Parameter}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaParameterImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaParameter() - * @generated - */ - EClass JAVA_PARAMETER = eINSTANCE.getJavaParameter(); - - /** - * The meta object literal for the 'Is Final' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_PARAMETER__IS_FINAL = eINSTANCE.getJavaParameter_IsFinal(); - - /** - * The meta object literal for the 'Base Parameter' reference feature. - * - * - * - * @generated - */ - EReference JAVA_PARAMETER__BASE_PARAMETER = eINSTANCE.getJavaParameter_Base_Parameter(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl Property}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaProperty() - * @generated - */ - EClass JAVA_PROPERTY = eINSTANCE.getJavaProperty(); - - /** - * The meta object literal for the 'Is Abstract' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_PROPERTY__IS_ABSTRACT = eINSTANCE.getJavaProperty_IsAbstract(); - - /** - * The meta object literal for the 'Is Final' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_PROPERTY__IS_FINAL = eINSTANCE.getJavaProperty_IsFinal(); - - /** - * The meta object literal for the 'Base Property' reference feature. - * - * - * - * @generated - */ - EReference JAVA_PROPERTY__BASE_PROPERTY = eINSTANCE.getJavaProperty_Base_Property(); - - /** - * The meta object literal for the 'Is Transient' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_PROPERTY__IS_TRANSIENT = eINSTANCE.getJavaProperty_IsTransient(); - - /** - * The meta object literal for the 'Generate Getter' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_PROPERTY__GENERATE_GETTER = eINSTANCE.getJavaProperty_GenerateGetter(); - - /** - * The meta object literal for the 'Generate Setter' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_PROPERTY__GENERATE_SETTER = eINSTANCE.getJavaProperty_GenerateSetter(); - - /** - * The meta object literal for the 'Is Static' attribute feature. - * - * - * - * @generated - */ - EAttribute JAVA_PROPERTY__IS_STATIC = eINSTANCE.getJavaProperty_IsStatic(); - - /** - * The meta object literal for the 'Explicit Plain Text Required Imports' attribute list feature. - * - * - * - * @generated - */ - EAttribute JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = eINSTANCE.getJavaProperty_ExplicitPlainTextRequiredImports(); - - /** - * The meta object literal for the 'Explicit Required Imports' reference list feature. - * - * - * - * @generated - */ - EReference JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS = eINSTANCE.getJavaProperty_ExplicitRequiredImports(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl Primitive Type}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getPrimitiveType() - * @generated - */ - EClass PRIMITIVE_TYPE = eINSTANCE.getPrimitiveType(); - - /** - * The meta object literal for the 'Implementation Class' attribute feature. - * - * - * - * @generated - */ - EAttribute PRIMITIVE_TYPE__IMPLEMENTATION_CLASS = eINSTANCE.getPrimitiveType_ImplementationClass(); - - /** - * The meta object literal for the 'Base Primitive Type' reference feature. - * - * - * - * @generated - */ - EReference PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE = eINSTANCE.getPrimitiveType_Base_PrimitiveType(); - - /** - * The meta object literal for the 'Collection Implementation Class' attribute feature. - * - * - * - * @generated - */ - EAttribute PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS = eINSTANCE.getPrimitiveType_CollectionImplementationClass(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaProjectImpl Project}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaProjectImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaProject() - * @generated - */ - EClass JAVA_PROJECT = eINSTANCE.getJavaProject(); - - /** - * The meta object literal for the 'Base Package' reference feature. - * - * - * - * @generated - */ - EReference JAVA_PROJECT__BASE_PACKAGE = eINSTANCE.getJavaProject_Base_Package(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaSrcFolderImpl Src Folder}' class. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.impl.JavaSrcFolderImpl - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaSrcFolder() - * @generated - */ - EClass JAVA_SRC_FOLDER = eINSTANCE.getJavaSrcFolder(); - - /** - * The meta object literal for the 'Base Package' reference feature. - * - * - * - * @generated - */ - EReference JAVA_SRC_FOLDER__BASE_PACKAGE = eINSTANCE.getJavaSrcFolder_Base_Package(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.TrueFalseDefault True False Default}' enum. - * - * - * - * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault - * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getTrueFalseDefault() - * @generated - */ - EEnum TRUE_FALSE_DEFAULT = eINSTANCE.getTrueFalseDefault(); - - } - -} // JavaPackage diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage_.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage_.java deleted file mode 100644 index 72f5dd43ebc..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage_.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java; - - -/** - * - * A representation of the model object 'Package '. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaPackage_#getPackageName Package Name}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaPackage_#getBase_Package Base Package}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaPackage_() - * @model - * @generated - */ -public interface JavaPackage_ extends JavaGen { - /** - * Returns the value of the 'Package Name' attribute. - * - *

- * If the meaning of the 'Package Name' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Package Name' attribute. - * @see #setPackageName(String) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaPackage__PackageName() - * @model unique="false" required="true" ordered="false" - * @generated - */ - String getPackageName(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaPackage_#getPackageName Package Name}' attribute. - * - * - * - * @param value - * the new value of the 'Package Name' attribute. - * @see #getPackageName() - * @generated - */ - void setPackageName(String value); - - /** - * Returns the value of the 'Base Package' reference. - * - *

- * If the meaning of the 'Base Package' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Base Package' reference. - * @see #setBase_Package(org.eclipse.uml2.uml.Package) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaPackage__Base_Package() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Package getBase_Package(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaPackage_#getBase_Package Base Package}' reference. - * - * - * - * @param value - * the new value of the 'Base Package' reference. - * @see #getBase_Package() - * @generated - */ - void setBase_Package(org.eclipse.uml2.uml.Package value); - -} // JavaPackage_ diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaParameter.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaParameter.java deleted file mode 100644 index 788372013f5..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaParameter.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java; - -import org.eclipse.uml2.uml.Parameter; - -/** - * - * A representation of the model object 'Parameter'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaParameter#isFinal Is Final}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaParameter#getBase_Parameter Base Parameter}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaParameter() - * @model - * @generated - */ -public interface JavaParameter extends JavaNamedElement { - /** - * Returns the value of the 'Is Final' attribute. - * - *

- * If the meaning of the 'Is Final' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Final' attribute. - * @see #setIsFinal(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaParameter_IsFinal() - * @model unique="false" required="true" ordered="false" - * @generated - */ - boolean isFinal(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaParameter#isFinal Is Final}' attribute. - * - * - * - * @param value - * the new value of the 'Is Final' attribute. - * @see #isFinal() - * @generated - */ - void setIsFinal(boolean value); - - /** - * Returns the value of the 'Base Parameter' reference. - * - *

- * If the meaning of the 'Base Parameter' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Base Parameter' reference. - * @see #setBase_Parameter(Parameter) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaParameter_Base_Parameter() - * @model required="true" ordered="false" - * @generated - */ - Parameter getBase_Parameter(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaParameter#getBase_Parameter Base Parameter}' reference. - * - * - * - * @param value - * the new value of the 'Base Parameter' reference. - * @see #getBase_Parameter() - * @generated - */ - void setBase_Parameter(Parameter value); - -} // JavaParameter diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProject.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProject.java deleted file mode 100644 index 122301f6388..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProject.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java; - - -/** - * - * A representation of the model object 'Project'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaProject#getBase_Package Base Package}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProject() - * @model - * @generated - */ -public interface JavaProject extends JavaGen { - /** - * Returns the value of the 'Base Package' reference. - * - *

- * If the meaning of the 'Base Package' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Base Package' reference. - * @see #setBase_Package(org.eclipse.uml2.uml.Package) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProject_Base_Package() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Package getBase_Package(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProject#getBase_Package Base Package}' reference. - * - * - * - * @param value - * the new value of the 'Base Package' reference. - * @see #getBase_Package() - * @generated - */ - void setBase_Package(org.eclipse.uml2.uml.Package value); - -} // JavaProject diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProperty.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProperty.java deleted file mode 100644 index 7ddf1e1bff6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProperty.java +++ /dev/null @@ -1,305 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Property; - -/** - * - * A representation of the model object 'Property'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#isAbstract Is Abstract}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#isFinal Is Final}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#getBase_Property Base Property}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#isTransient Is Transient}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateGetter Generate Getter}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateSetter Generate Setter}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#isStatic Is Static}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#getExplicitRequiredImports Explicit Required Imports}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty() - * @model - * @generated - */ -public interface JavaProperty extends JavaNamedElement { - /** - * Returns the value of the 'Is Abstract' attribute. - * - *

- * If the meaning of the 'Is Abstract' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Abstract' attribute. - * @see #setIsAbstract(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_IsAbstract() - * @model unique="false" required="true" ordered="false" - * @generated - */ - boolean isAbstract(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isAbstract Is Abstract}' attribute. - * - * - * - * @param value - * the new value of the 'Is Abstract' attribute. - * @see #isAbstract() - * @generated - */ - void setIsAbstract(boolean value); - - /** - * Returns the value of the 'Is Final' attribute. - * - *

- * If the meaning of the 'Is Final' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Final' attribute. - * @see #setIsFinal(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_IsFinal() - * @model unique="false" required="true" ordered="false" - * @generated - */ - boolean isFinal(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isFinal Is Final}' attribute. - * - * - * - * @param value - * the new value of the 'Is Final' attribute. - * @see #isFinal() - * @generated - */ - void setIsFinal(boolean value); - - /** - * Returns the value of the 'Base Property' reference. - * - *

- * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Base Property' reference. - * @see #setBase_Property(Property) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_Base_Property() - * @model required="true" ordered="false" - * @generated - */ - Property getBase_Property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getBase_Property Base Property}' reference. - * - * - * - * @param value - * the new value of the 'Base Property' reference. - * @see #getBase_Property() - * @generated - */ - void setBase_Property(Property value); - - /** - * Returns the value of the 'Is Transient' attribute. - * - *

- * If the meaning of the 'Is Transient' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Transient' attribute. - * @see #setIsTransient(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_IsTransient() - * @model unique="false" required="true" ordered="false" - * @generated - */ - boolean isTransient(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isTransient Is Transient}' attribute. - * - * - * - * @param value - * the new value of the 'Is Transient' attribute. - * @see #isTransient() - * @generated - */ - void setIsTransient(boolean value); - - /** - * Returns the value of the 'Generate Getter' attribute. - * The default value is "default". - * The literals are from the enumeration {@link org.eclipse.papyrus.java.profile.java.TrueFalseDefault}. - * - *

- * If the meaning of the 'Generate Getter' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Generate Getter' attribute. - * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault - * @see #setGenerateGetter(TrueFalseDefault) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_GenerateGetter() - * @model default="default" required="true" ordered="false" - * @generated - */ - TrueFalseDefault getGenerateGetter(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateGetter Generate Getter}' attribute. - * - * - * - * @param value - * the new value of the 'Generate Getter' attribute. - * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault - * @see #getGenerateGetter() - * @generated - */ - void setGenerateGetter(TrueFalseDefault value); - - /** - * Returns the value of the 'Generate Setter' attribute. - * The default value is "default". - * The literals are from the enumeration {@link org.eclipse.papyrus.java.profile.java.TrueFalseDefault}. - * - *

- * If the meaning of the 'Generate Setter' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Generate Setter' attribute. - * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault - * @see #setGenerateSetter(TrueFalseDefault) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_GenerateSetter() - * @model default="default" required="true" ordered="false" - * @generated - */ - TrueFalseDefault getGenerateSetter(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateSetter Generate Setter}' attribute. - * - * - * - * @param value - * the new value of the 'Generate Setter' attribute. - * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault - * @see #getGenerateSetter() - * @generated - */ - void setGenerateSetter(TrueFalseDefault value); - - /** - * Returns the value of the 'Is Static' attribute. - * - *

- * If the meaning of the 'Is Static' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Is Static' attribute. - * @see #setIsStatic(boolean) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_IsStatic() - * @model required="true" ordered="false" - * @generated - */ - boolean isStatic(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isStatic Is Static}' attribute. - * - * - * - * @param value - * the new value of the 'Is Static' attribute. - * @see #isStatic() - * @generated - */ - void setIsStatic(boolean value); - - /** - * Returns the value of the 'Explicit Plain Text Required Imports' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'Explicit Plain Text Required Imports' attribute list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Explicit Plain Text Required Imports' attribute list. - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_ExplicitPlainTextRequiredImports() - * @model unique="false" ordered="false" - * @generated - */ - EList getExplicitPlainTextRequiredImports(); - - /** - * Returns the value of the 'Explicit Required Imports' reference list. - * The list contents are of type {@link org.eclipse.uml2.uml.Classifier}. - * - *

- * If the meaning of the 'Explicit Required Imports' reference list isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Explicit Required Imports' reference list. - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_ExplicitRequiredImports() - * @model ordered="false" - * @generated - */ - EList getExplicitRequiredImports(); - - /** - * Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name' from the 'Explicit Required Imports' reference list. - * - * - * - * @param name - * The 'Name' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. - * @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name', or null. - * @see #getExplicitRequiredImports() - * @generated - */ - Classifier getExplicitRequiredImports(String name); - - /** - * Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name' from the 'Explicit Required Imports' reference list. - * - * - * - * @param name - * The 'Name' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. - * @param ignoreCase - * Whether to ignore case in {@link java.lang.String} comparisons. - * @param eClass - * The Ecore class of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. - * @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name', or null. - * @see #getExplicitRequiredImports() - * @generated - */ - Classifier getExplicitRequiredImports(String name, boolean ignoreCase, EClass eClass); - -} // JavaProperty diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaSrcFolder.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaSrcFolder.java deleted file mode 100644 index 25bf1c52ed5..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaSrcFolder.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java; - - -/** - * - * A representation of the model object 'Src Folder'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder#getBase_Package Base Package}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaSrcFolder() - * @model - * @generated - */ -public interface JavaSrcFolder extends JavaGen { - /** - * Returns the value of the 'Base Package' reference. - * - *

- * If the meaning of the 'Base Package' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Base Package' reference. - * @see #setBase_Package(org.eclipse.uml2.uml.Package) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaSrcFolder_Base_Package() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Package getBase_Package(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder#getBase_Package Base Package}' reference. - * - * - * - * @param value - * the new value of the 'Base Package' reference. - * @see #getBase_Package() - * @generated - */ - void setBase_Package(org.eclipse.uml2.uml.Package value); - -} // JavaSrcFolder diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/PrimitiveType.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/PrimitiveType.java deleted file mode 100644 index 00d52854f23..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/PrimitiveType.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java; - - -/** - * - * A representation of the model object 'Primitive Type'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getImplementationClass Implementation Class}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getBase_PrimitiveType Base Primitive Type}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getCollectionImplementationClass Collection Implementation Class}
  • - *
- *

- * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getPrimitiveType() - * @model - * @generated - */ -public interface PrimitiveType extends JavaGen { - /** - * Returns the value of the 'Implementation Class' attribute. - * - *

- * If the meaning of the 'Implementation Class' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Implementation Class' attribute. - * @see #setImplementationClass(String) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getPrimitiveType_ImplementationClass() - * @model unique="false" required="true" ordered="false" - * @generated - */ - String getImplementationClass(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getImplementationClass Implementation Class}' attribute. - * - * - * - * @param value - * the new value of the 'Implementation Class' attribute. - * @see #getImplementationClass() - * @generated - */ - void setImplementationClass(String value); - - /** - * Returns the value of the 'Base Primitive Type' reference. - * - *

- * If the meaning of the 'Base Primitive Type' reference isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Base Primitive Type' reference. - * @see #setBase_PrimitiveType(org.eclipse.uml2.uml.PrimitiveType) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getPrimitiveType_Base_PrimitiveType() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.PrimitiveType getBase_PrimitiveType(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getBase_PrimitiveType Base Primitive Type}' reference. - * - * - * - * @param value - * the new value of the 'Base Primitive Type' reference. - * @see #getBase_PrimitiveType() - * @generated - */ - void setBase_PrimitiveType(org.eclipse.uml2.uml.PrimitiveType value); - - /** - * Returns the value of the 'Collection Implementation Class' attribute. - * - *

- * If the meaning of the 'Collection Implementation Class' attribute isn't clear, there really should be more of a description here... - *

- * - * - * @return the value of the 'Collection Implementation Class' attribute. - * @see #setCollectionImplementationClass(String) - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getPrimitiveType_CollectionImplementationClass() - * @model unique="false" required="true" ordered="false" - * @generated - */ - String getCollectionImplementationClass(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getCollectionImplementationClass Collection Implementation Class}' attribute. - * - * - * - * @param value - * the new value of the 'Collection Implementation Class' attribute. - * @see #getCollectionImplementationClass() - * @generated - */ - void setCollectionImplementationClass(String value); - -} // PrimitiveType diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/TrueFalseDefault.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/TrueFalseDefault.java deleted file mode 100644 index 99d15305e4e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/TrueFalseDefault.java +++ /dev/null @@ -1,262 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'True False Default', - * and utility methods for working with them. - * - * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getTrueFalseDefault() - * @model - * @generated - */ -public enum TrueFalseDefault implements Enumerator { - /** - * The 'True' literal object. - * - * - * - * @see #TRUE_VALUE - * @generated - * @ordered - */ - TRUE(0, "true", "true"), - - /** - * The 'False' literal object. - * - * - * - * @see #FALSE_VALUE - * @generated - * @ordered - */ - FALSE(1, "false", "false"), - - /** - * The 'Default' literal object. - * - * - * - * @see #DEFAULT_VALUE - * @generated - * @ordered - */ - DEFAULT(2, "default", "default"); - - /** - * The 'True' literal value. - * - *

- * If the meaning of 'True' literal object isn't clear, there really should be more of a description here... - *

- * - * - * @see #TRUE - * @model name="true" - * @generated - * @ordered - */ - public static final int TRUE_VALUE = 0; - - /** - * The 'False' literal value. - * - *

- * If the meaning of 'False' literal object isn't clear, there really should be more of a description here... - *

- * - * - * @see #FALSE - * @model name="false" - * @generated - * @ordered - */ - public static final int FALSE_VALUE = 1; - - /** - * The 'Default' literal value. - * - *

- * If the meaning of 'Default' literal object isn't clear, there really should be more of a description here... - *

- * - * - * @see #DEFAULT - * @model name="default" - * @generated - * @ordered - */ - public static final int DEFAULT_VALUE = 2; - - /** - * An array of all the 'True False Default' enumerators. - * - * - * - * @generated - */ - private static final TrueFalseDefault[] VALUES_ARRAY = - new TrueFalseDefault[] { - TRUE, - FALSE, - DEFAULT, - }; - - /** - * A public read-only list of all the 'True False Default' enumerators. - * - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'True False Default' literal with the specified literal value. - * - * - * - * @generated - */ - public static TrueFalseDefault get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - TrueFalseDefault result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'True False Default' literal with the specified name. - * - * - * - * @generated - */ - public static TrueFalseDefault getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - TrueFalseDefault result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'True False Default' literal with the specified integer value. - * - * - * - * @generated - */ - public static TrueFalseDefault get(int value) { - switch (value) { - case TRUE_VALUE: - return TRUE; - case FALSE_VALUE: - return FALSE; - case DEFAULT_VALUE: - return DEFAULT; - } - return null; - } - - /** - * - * - * - * @generated - */ - private final int value; - - /** - * - * - * - * @generated - */ - private final String name; - - /** - * - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * - * @generated - */ - private TrueFalseDefault(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * - * @generated - */ - @Override - public int getValue() { - return value; - } - - /** - * - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * - * @generated - */ - @Override - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - -} // TrueFalseDefault diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaClassImpl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaClassImpl.java deleted file mode 100644 index d6dc2b051f1..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaClassImpl.java +++ /dev/null @@ -1,486 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EDataTypeEList; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.papyrus.java.profile.java.JavaClass; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.uml2.uml.Classifier; - -/** - * - * An implementation of the model object 'Class'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl#getBase_Classifier Base Classifier}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl#isFinal Is Final}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl#isAbstract Is Abstract}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl#isStatic Is Static}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl#getExplicitRequiredImports Explicit Required Imports}
  • - *
- *

- * - * @generated - */ -public class JavaClassImpl extends JavaGenImpl implements JavaClass { - /** - * The cached value of the '{@link #getBase_Classifier() Base Classifier}' reference. - * - * - * - * @see #getBase_Classifier() - * @generated - * @ordered - */ - protected Classifier base_Classifier; - - /** - * The default value of the '{@link #isFinal() Is Final}' attribute. - * - * - * - * @see #isFinal() - * @generated - * @ordered - */ - protected static final boolean IS_FINAL_EDEFAULT = false; - - /** - * The cached value of the '{@link #isFinal() Is Final}' attribute. - * - * - * - * @see #isFinal() - * @generated - * @ordered - */ - protected boolean isFinal = IS_FINAL_EDEFAULT; - - /** - * The default value of the '{@link #isAbstract() Is Abstract}' attribute. - * - * - * - * @see #isAbstract() - * @generated - * @ordered - */ - protected static final boolean IS_ABSTRACT_EDEFAULT = false; - - /** - * The cached value of the '{@link #isAbstract() Is Abstract}' attribute. - * - * - * - * @see #isAbstract() - * @generated - * @ordered - */ - protected boolean isAbstract = IS_ABSTRACT_EDEFAULT; - - /** - * The default value of the '{@link #isStatic() Is Static}' attribute. - * - * - * - * @see #isStatic() - * @generated - * @ordered - */ - protected static final boolean IS_STATIC_EDEFAULT = false; - - /** - * The cached value of the '{@link #isStatic() Is Static}' attribute. - * - * - * - * @see #isStatic() - * @generated - * @ordered - */ - protected boolean isStatic = IS_STATIC_EDEFAULT; - - /** - * The cached value of the '{@link #getExplicitPlainTextRequiredImports() Explicit Plain Text Required Imports}' attribute list. - * - * - * - * @see #getExplicitPlainTextRequiredImports() - * @generated - * @ordered - */ - protected EList explicitPlainTextRequiredImports; - - /** - * The cached value of the '{@link #getExplicitRequiredImports() Explicit Required Imports}' reference list. - * - * - * - * @see #getExplicitRequiredImports() - * @generated - * @ordered - */ - protected EList explicitRequiredImports; - - /** - * - * - * - * @generated - */ - protected JavaClassImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JavaPackage.Literals.JAVA_CLASS; - } - - /** - * - * - * - * @generated - */ - @Override - public Classifier getBase_Classifier() { - if (base_Classifier != null && base_Classifier.eIsProxy()) { - InternalEObject oldBase_Classifier = (InternalEObject) base_Classifier; - base_Classifier = (Classifier) eResolveProxy(oldBase_Classifier); - if (base_Classifier != oldBase_Classifier) { - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_CLASS__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier)); - } - } - } - return base_Classifier; - } - - /** - * - * - * - * @generated - */ - public Classifier basicGetBase_Classifier() { - return base_Classifier; - } - - /** - * - * - * - * @generated - */ - @Override - public void setBase_Classifier(Classifier newBase_Classifier) { - Classifier oldBase_Classifier = base_Classifier; - base_Classifier = newBase_Classifier; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_CLASS__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isFinal() { - return isFinal; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsFinal(boolean newIsFinal) { - boolean oldIsFinal = isFinal; - isFinal = newIsFinal; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_CLASS__IS_FINAL, oldIsFinal, isFinal)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isAbstract() { - return isAbstract; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsAbstract(boolean newIsAbstract) { - boolean oldIsAbstract = isAbstract; - isAbstract = newIsAbstract; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_CLASS__IS_ABSTRACT, oldIsAbstract, isAbstract)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isStatic() { - return isStatic; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsStatic(boolean newIsStatic) { - boolean oldIsStatic = isStatic; - isStatic = newIsStatic; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_CLASS__IS_STATIC, oldIsStatic, isStatic)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public EList getExplicitPlainTextRequiredImports() { - if (explicitPlainTextRequiredImports == null) { - explicitPlainTextRequiredImports = new EDataTypeEList(String.class, this, JavaPackage.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); - } - return explicitPlainTextRequiredImports; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getExplicitRequiredImports() { - if (explicitRequiredImports == null) { - explicitRequiredImports = new EObjectResolvingEList(Classifier.class, this, JavaPackage.JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS); - } - return explicitRequiredImports; - } - - /** - * - * - * - * @generated - */ - @Override - public Classifier getExplicitRequiredImports(String name) { - return getExplicitRequiredImports(name, false, null); - } - - /** - * - * - * - * @generated - */ - @Override - public Classifier getExplicitRequiredImports(String name, boolean ignoreCase, EClass eClass) { - explicitRequiredImportsLoop: for (Classifier explicitRequiredImports : getExplicitRequiredImports()) { - if (eClass != null && !eClass.isInstance(explicitRequiredImports)) { - continue explicitRequiredImportsLoop; - } - if (name != null && !(ignoreCase ? name.equalsIgnoreCase(explicitRequiredImports.getName()) : name.equals(explicitRequiredImports.getName()))) { - continue explicitRequiredImportsLoop; - } - return explicitRequiredImports; - } - return null; - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JavaPackage.JAVA_CLASS__BASE_CLASSIFIER: - if (resolve) { - return getBase_Classifier(); - } - return basicGetBase_Classifier(); - case JavaPackage.JAVA_CLASS__IS_FINAL: - return isFinal(); - case JavaPackage.JAVA_CLASS__IS_ABSTRACT: - return isAbstract(); - case JavaPackage.JAVA_CLASS__IS_STATIC: - return isStatic(); - case JavaPackage.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - return getExplicitPlainTextRequiredImports(); - case JavaPackage.JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS: - return getExplicitRequiredImports(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JavaPackage.JAVA_CLASS__BASE_CLASSIFIER: - setBase_Classifier((Classifier) newValue); - return; - case JavaPackage.JAVA_CLASS__IS_FINAL: - setIsFinal((Boolean) newValue); - return; - case JavaPackage.JAVA_CLASS__IS_ABSTRACT: - setIsAbstract((Boolean) newValue); - return; - case JavaPackage.JAVA_CLASS__IS_STATIC: - setIsStatic((Boolean) newValue); - return; - case JavaPackage.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - getExplicitPlainTextRequiredImports().clear(); - getExplicitPlainTextRequiredImports().addAll((Collection) newValue); - return; - case JavaPackage.JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS: - getExplicitRequiredImports().clear(); - getExplicitRequiredImports().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_CLASS__BASE_CLASSIFIER: - setBase_Classifier((Classifier) null); - return; - case JavaPackage.JAVA_CLASS__IS_FINAL: - setIsFinal(IS_FINAL_EDEFAULT); - return; - case JavaPackage.JAVA_CLASS__IS_ABSTRACT: - setIsAbstract(IS_ABSTRACT_EDEFAULT); - return; - case JavaPackage.JAVA_CLASS__IS_STATIC: - setIsStatic(IS_STATIC_EDEFAULT); - return; - case JavaPackage.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - getExplicitPlainTextRequiredImports().clear(); - return; - case JavaPackage.JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS: - getExplicitRequiredImports().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_CLASS__BASE_CLASSIFIER: - return base_Classifier != null; - case JavaPackage.JAVA_CLASS__IS_FINAL: - return isFinal != IS_FINAL_EDEFAULT; - case JavaPackage.JAVA_CLASS__IS_ABSTRACT: - return isAbstract != IS_ABSTRACT_EDEFAULT; - case JavaPackage.JAVA_CLASS__IS_STATIC: - return isStatic != IS_STATIC_EDEFAULT; - case JavaPackage.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - return explicitPlainTextRequiredImports != null && !explicitPlainTextRequiredImports.isEmpty(); - case JavaPackage.JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS: - return explicitRequiredImports != null && !explicitRequiredImports.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (isFinal: "); - result.append(isFinal); - result.append(", isAbstract: "); - result.append(isAbstract); - result.append(", isStatic: "); - result.append(isStatic); - result.append(", explicitPlainTextRequiredImports: "); - result.append(explicitPlainTextRequiredImports); - result.append(')'); - return result.toString(); - } - -} // JavaClassImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaFactoryImpl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaFactoryImpl.java deleted file mode 100644 index 815339c6983..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaFactoryImpl.java +++ /dev/null @@ -1,270 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.impl.EFactoryImpl; -import org.eclipse.emf.ecore.plugin.EcorePlugin; -import org.eclipse.papyrus.java.profile.java.JavaClass; -import org.eclipse.papyrus.java.profile.java.JavaFactory; -import org.eclipse.papyrus.java.profile.java.JavaMethod; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaPackage_; -import org.eclipse.papyrus.java.profile.java.JavaParameter; -import org.eclipse.papyrus.java.profile.java.JavaProject; -import org.eclipse.papyrus.java.profile.java.JavaProperty; -import org.eclipse.papyrus.java.profile.java.JavaSrcFolder; -import org.eclipse.papyrus.java.profile.java.PrimitiveType; -import org.eclipse.papyrus.java.profile.java.TrueFalseDefault; - -/** - * - * An implementation of the model Factory. - * - * - * @generated - */ -public class JavaFactoryImpl extends EFactoryImpl implements JavaFactory { - /** - * Creates the default factory implementation. - * - * - * - * @generated - */ - public static JavaFactory init() { - try { - JavaFactory theJavaFactory = (JavaFactory) EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/JAVA/1"); - if (theJavaFactory != null) { - return theJavaFactory; - } - } catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new JavaFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * - * @generated - */ - public JavaFactoryImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case JavaPackage.JAVA_CLASS: - return createJavaClass(); - case JavaPackage.JAVA_PACKAGE_: - return createJavaPackage_(); - case JavaPackage.JAVA_METHOD: - return createJavaMethod(); - case JavaPackage.JAVA_PARAMETER: - return createJavaParameter(); - case JavaPackage.JAVA_PROPERTY: - return createJavaProperty(); - case JavaPackage.PRIMITIVE_TYPE: - return createPrimitiveType(); - case JavaPackage.JAVA_PROJECT: - return createJavaProject(); - case JavaPackage.JAVA_SRC_FOLDER: - return createJavaSrcFolder(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Object createFromString(EDataType eDataType, String initialValue) { - switch (eDataType.getClassifierID()) { - case JavaPackage.TRUE_FALSE_DEFAULT: - return createTrueFalseDefaultFromString(eDataType, initialValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * - * @generated - */ - @Override - public String convertToString(EDataType eDataType, Object instanceValue) { - switch (eDataType.getClassifierID()) { - case JavaPackage.TRUE_FALSE_DEFAULT: - return convertTrueFalseDefaultToString(eDataType, instanceValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * - * @generated - */ - @Override - public JavaClass createJavaClass() { - JavaClassImpl javaClass = new JavaClassImpl(); - return javaClass; - } - - /** - * - * - * - * @generated - */ - @Override - public JavaPackage_ createJavaPackage_() { - JavaPackage_Impl javaPackage_ = new JavaPackage_Impl(); - return javaPackage_; - } - - /** - * - * - * - * @generated - */ - @Override - public JavaMethod createJavaMethod() { - JavaMethodImpl javaMethod = new JavaMethodImpl(); - return javaMethod; - } - - /** - * - * - * - * @generated - */ - @Override - public JavaParameter createJavaParameter() { - JavaParameterImpl javaParameter = new JavaParameterImpl(); - return javaParameter; - } - - /** - * - * - * - * @generated - */ - @Override - public JavaProperty createJavaProperty() { - JavaPropertyImpl javaProperty = new JavaPropertyImpl(); - return javaProperty; - } - - /** - * - * - * - * @generated - */ - @Override - public PrimitiveType createPrimitiveType() { - PrimitiveTypeImpl primitiveType = new PrimitiveTypeImpl(); - return primitiveType; - } - - /** - * - * - * - * @generated - */ - @Override - public JavaProject createJavaProject() { - JavaProjectImpl javaProject = new JavaProjectImpl(); - return javaProject; - } - - /** - * - * - * - * @generated - */ - @Override - public JavaSrcFolder createJavaSrcFolder() { - JavaSrcFolderImpl javaSrcFolder = new JavaSrcFolderImpl(); - return javaSrcFolder; - } - - /** - * - * - * - * @generated - */ - public TrueFalseDefault createTrueFalseDefaultFromString(EDataType eDataType, String initialValue) { - TrueFalseDefault result = TrueFalseDefault.get(initialValue); - if (result == null) { - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - } - return result; - } - - /** - * - * - * - * @generated - */ - public String convertTrueFalseDefaultToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * - * @generated - */ - @Override - public JavaPackage getJavaPackage() { - return (JavaPackage) getEPackage(); - } - - /** - * - * - * - * @deprecated - * @generated - */ - @Deprecated - public static JavaPackage getPackage() { - return JavaPackage.eINSTANCE; - } - -} // JavaFactoryImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaGenImpl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaGenImpl.java deleted file mode 100644 index d9fb5127c2b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaGenImpl.java +++ /dev/null @@ -1,240 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.papyrus.java.profile.java.JavaGen; -import org.eclipse.papyrus.java.profile.java.JavaPackage; - -/** - * - * An implementation of the model object 'Gen'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaGenImpl#getSrcName Src Name}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaGenImpl#getProjectName Project Name}
  • - *
- *

- * - * @generated - */ -public abstract class JavaGenImpl extends JavaNamedElementImpl implements JavaGen { - /** - * The default value of the '{@link #getSrcName() Src Name}' attribute. - * - * - * - * @see #getSrcName() - * @generated - * @ordered - */ - protected static final String SRC_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSrcName() Src Name}' attribute. - * - * - * - * @see #getSrcName() - * @generated - * @ordered - */ - protected String srcName = SRC_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getProjectName() Project Name}' attribute. - * - * - * - * @see #getProjectName() - * @generated - * @ordered - */ - protected static final String PROJECT_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getProjectName() Project Name}' attribute. - * - * - * - * @see #getProjectName() - * @generated - * @ordered - */ - protected String projectName = PROJECT_NAME_EDEFAULT; - - /** - * - * - * - * @generated - */ - protected JavaGenImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JavaPackage.Literals.JAVA_GEN; - } - - /** - * - * - * - * @generated - */ - @Override - public String getSrcName() { - return srcName; - } - - /** - * - * - * - * @generated - */ - @Override - public void setSrcName(String newSrcName) { - String oldSrcName = srcName; - srcName = newSrcName; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_GEN__SRC_NAME, oldSrcName, srcName)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public String getProjectName() { - return projectName; - } - - /** - * - * - * - * @generated - */ - @Override - public void setProjectName(String newProjectName) { - String oldProjectName = projectName; - projectName = newProjectName; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_GEN__PROJECT_NAME, oldProjectName, projectName)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JavaPackage.JAVA_GEN__SRC_NAME: - return getSrcName(); - case JavaPackage.JAVA_GEN__PROJECT_NAME: - return getProjectName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JavaPackage.JAVA_GEN__SRC_NAME: - setSrcName((String) newValue); - return; - case JavaPackage.JAVA_GEN__PROJECT_NAME: - setProjectName((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_GEN__SRC_NAME: - setSrcName(SRC_NAME_EDEFAULT); - return; - case JavaPackage.JAVA_GEN__PROJECT_NAME: - setProjectName(PROJECT_NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_GEN__SRC_NAME: - return SRC_NAME_EDEFAULT == null ? srcName != null : !SRC_NAME_EDEFAULT.equals(srcName); - case JavaPackage.JAVA_GEN__PROJECT_NAME: - return PROJECT_NAME_EDEFAULT == null ? projectName != null : !PROJECT_NAME_EDEFAULT.equals(projectName); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (srcName: "); - result.append(srcName); - result.append(", projectName: "); - result.append(projectName); - result.append(')'); - return result.toString(); - } - -} // JavaGenImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaMethodImpl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaMethodImpl.java deleted file mode 100644 index ba74887b921..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaMethodImpl.java +++ /dev/null @@ -1,670 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EDataTypeEList; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.papyrus.java.profile.java.JavaMethod; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Operation; - -/** - * - * An implementation of the model object 'Method'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#isStatic Is Static}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#isFinal Is Final}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#isAbstract Is Abstract}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#isNative Is Native}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#isSynchronized Is Synchronized}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#isConstructor Is Constructor}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#getBase_Operation Base Operation}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#getExplicitRequiredImports Explicit Required Imports}
  • - *
- *

- * - * @generated - */ -public class JavaMethodImpl extends JavaNamedElementImpl implements JavaMethod { - /** - * The default value of the '{@link #isStatic() Is Static}' attribute. - * - * - * - * @see #isStatic() - * @generated - * @ordered - */ - protected static final boolean IS_STATIC_EDEFAULT = false; - - /** - * The cached value of the '{@link #isStatic() Is Static}' attribute. - * - * - * - * @see #isStatic() - * @generated - * @ordered - */ - protected boolean isStatic = IS_STATIC_EDEFAULT; - - /** - * The default value of the '{@link #isFinal() Is Final}' attribute. - * - * - * - * @see #isFinal() - * @generated - * @ordered - */ - protected static final boolean IS_FINAL_EDEFAULT = false; - - /** - * The cached value of the '{@link #isFinal() Is Final}' attribute. - * - * - * - * @see #isFinal() - * @generated - * @ordered - */ - protected boolean isFinal = IS_FINAL_EDEFAULT; - - /** - * The default value of the '{@link #isAbstract() Is Abstract}' attribute. - * - * - * - * @see #isAbstract() - * @generated - * @ordered - */ - protected static final boolean IS_ABSTRACT_EDEFAULT = false; - - /** - * The cached value of the '{@link #isAbstract() Is Abstract}' attribute. - * - * - * - * @see #isAbstract() - * @generated - * @ordered - */ - protected boolean isAbstract = IS_ABSTRACT_EDEFAULT; - - /** - * The default value of the '{@link #isNative() Is Native}' attribute. - * - * - * - * @see #isNative() - * @generated - * @ordered - */ - protected static final boolean IS_NATIVE_EDEFAULT = false; - - /** - * The cached value of the '{@link #isNative() Is Native}' attribute. - * - * - * - * @see #isNative() - * @generated - * @ordered - */ - protected boolean isNative = IS_NATIVE_EDEFAULT; - - /** - * The default value of the '{@link #isSynchronized() Is Synchronized}' attribute. - * - * - * - * @see #isSynchronized() - * @generated - * @ordered - */ - protected static final boolean IS_SYNCHRONIZED_EDEFAULT = false; - - /** - * The cached value of the '{@link #isSynchronized() Is Synchronized}' attribute. - * - * - * - * @see #isSynchronized() - * @generated - * @ordered - */ - protected boolean isSynchronized = IS_SYNCHRONIZED_EDEFAULT; - - /** - * The default value of the '{@link #isConstructor() Is Constructor}' attribute. - * - * - * - * @see #isConstructor() - * @generated - * @ordered - */ - protected static final boolean IS_CONSTRUCTOR_EDEFAULT = false; - - /** - * The cached value of the '{@link #isConstructor() Is Constructor}' attribute. - * - * - * - * @see #isConstructor() - * @generated - * @ordered - */ - protected boolean isConstructor = IS_CONSTRUCTOR_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_Operation() Base Operation}' reference. - * - * - * - * @see #getBase_Operation() - * @generated - * @ordered - */ - protected Operation base_Operation; - - /** - * The cached value of the '{@link #getExplicitPlainTextRequiredImports() Explicit Plain Text Required Imports}' attribute list. - * - * - * - * @see #getExplicitPlainTextRequiredImports() - * @generated - * @ordered - */ - protected EList explicitPlainTextRequiredImports; - - /** - * The cached value of the '{@link #getExplicitRequiredImports() Explicit Required Imports}' reference list. - * - * - * - * @see #getExplicitRequiredImports() - * @generated - * @ordered - */ - protected EList explicitRequiredImports; - - /** - * - * - * - * @generated - */ - protected JavaMethodImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JavaPackage.Literals.JAVA_METHOD; - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isStatic() { - return isStatic; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsStatic(boolean newIsStatic) { - boolean oldIsStatic = isStatic; - isStatic = newIsStatic; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__IS_STATIC, oldIsStatic, isStatic)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isFinal() { - return isFinal; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsFinal(boolean newIsFinal) { - boolean oldIsFinal = isFinal; - isFinal = newIsFinal; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__IS_FINAL, oldIsFinal, isFinal)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isAbstract() { - return isAbstract; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsAbstract(boolean newIsAbstract) { - boolean oldIsAbstract = isAbstract; - isAbstract = newIsAbstract; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__IS_ABSTRACT, oldIsAbstract, isAbstract)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isNative() { - return isNative; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsNative(boolean newIsNative) { - boolean oldIsNative = isNative; - isNative = newIsNative; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__IS_NATIVE, oldIsNative, isNative)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isSynchronized() { - return isSynchronized; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsSynchronized(boolean newIsSynchronized) { - boolean oldIsSynchronized = isSynchronized; - isSynchronized = newIsSynchronized; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__IS_SYNCHRONIZED, oldIsSynchronized, isSynchronized)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isConstructor() { - return isConstructor; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsConstructor(boolean newIsConstructor) { - boolean oldIsConstructor = isConstructor; - isConstructor = newIsConstructor; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__IS_CONSTRUCTOR, oldIsConstructor, isConstructor)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Operation getBase_Operation() { - if (base_Operation != null && base_Operation.eIsProxy()) { - InternalEObject oldBase_Operation = (InternalEObject) base_Operation; - base_Operation = (Operation) eResolveProxy(oldBase_Operation); - if (base_Operation != oldBase_Operation) { - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_METHOD__BASE_OPERATION, oldBase_Operation, base_Operation)); - } - } - } - return base_Operation; - } - - /** - * - * - * - * @generated - */ - public Operation basicGetBase_Operation() { - return base_Operation; - } - - /** - * - * - * - * @generated - */ - @Override - public void setBase_Operation(Operation newBase_Operation) { - Operation oldBase_Operation = base_Operation; - base_Operation = newBase_Operation; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__BASE_OPERATION, oldBase_Operation, base_Operation)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public EList getExplicitPlainTextRequiredImports() { - if (explicitPlainTextRequiredImports == null) { - explicitPlainTextRequiredImports = new EDataTypeEList(String.class, this, JavaPackage.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); - } - return explicitPlainTextRequiredImports; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getExplicitRequiredImports() { - if (explicitRequiredImports == null) { - explicitRequiredImports = new EObjectResolvingEList(Classifier.class, this, JavaPackage.JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS); - } - return explicitRequiredImports; - } - - /** - * - * - * - * @generated - */ - @Override - public Classifier getExplicitRequiredImports(String name) { - return getExplicitRequiredImports(name, false, null); - } - - /** - * - * - * - * @generated - */ - @Override - public Classifier getExplicitRequiredImports(String name, boolean ignoreCase, EClass eClass) { - explicitRequiredImportsLoop: for (Classifier explicitRequiredImports : getExplicitRequiredImports()) { - if (eClass != null && !eClass.isInstance(explicitRequiredImports)) { - continue explicitRequiredImportsLoop; - } - if (name != null && !(ignoreCase ? name.equalsIgnoreCase(explicitRequiredImports.getName()) : name.equals(explicitRequiredImports.getName()))) { - continue explicitRequiredImportsLoop; - } - return explicitRequiredImports; - } - return null; - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JavaPackage.JAVA_METHOD__IS_STATIC: - return isStatic(); - case JavaPackage.JAVA_METHOD__IS_FINAL: - return isFinal(); - case JavaPackage.JAVA_METHOD__IS_ABSTRACT: - return isAbstract(); - case JavaPackage.JAVA_METHOD__IS_NATIVE: - return isNative(); - case JavaPackage.JAVA_METHOD__IS_SYNCHRONIZED: - return isSynchronized(); - case JavaPackage.JAVA_METHOD__IS_CONSTRUCTOR: - return isConstructor(); - case JavaPackage.JAVA_METHOD__BASE_OPERATION: - if (resolve) { - return getBase_Operation(); - } - return basicGetBase_Operation(); - case JavaPackage.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - return getExplicitPlainTextRequiredImports(); - case JavaPackage.JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS: - return getExplicitRequiredImports(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JavaPackage.JAVA_METHOD__IS_STATIC: - setIsStatic((Boolean) newValue); - return; - case JavaPackage.JAVA_METHOD__IS_FINAL: - setIsFinal((Boolean) newValue); - return; - case JavaPackage.JAVA_METHOD__IS_ABSTRACT: - setIsAbstract((Boolean) newValue); - return; - case JavaPackage.JAVA_METHOD__IS_NATIVE: - setIsNative((Boolean) newValue); - return; - case JavaPackage.JAVA_METHOD__IS_SYNCHRONIZED: - setIsSynchronized((Boolean) newValue); - return; - case JavaPackage.JAVA_METHOD__IS_CONSTRUCTOR: - setIsConstructor((Boolean) newValue); - return; - case JavaPackage.JAVA_METHOD__BASE_OPERATION: - setBase_Operation((Operation) newValue); - return; - case JavaPackage.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - getExplicitPlainTextRequiredImports().clear(); - getExplicitPlainTextRequiredImports().addAll((Collection) newValue); - return; - case JavaPackage.JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS: - getExplicitRequiredImports().clear(); - getExplicitRequiredImports().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_METHOD__IS_STATIC: - setIsStatic(IS_STATIC_EDEFAULT); - return; - case JavaPackage.JAVA_METHOD__IS_FINAL: - setIsFinal(IS_FINAL_EDEFAULT); - return; - case JavaPackage.JAVA_METHOD__IS_ABSTRACT: - setIsAbstract(IS_ABSTRACT_EDEFAULT); - return; - case JavaPackage.JAVA_METHOD__IS_NATIVE: - setIsNative(IS_NATIVE_EDEFAULT); - return; - case JavaPackage.JAVA_METHOD__IS_SYNCHRONIZED: - setIsSynchronized(IS_SYNCHRONIZED_EDEFAULT); - return; - case JavaPackage.JAVA_METHOD__IS_CONSTRUCTOR: - setIsConstructor(IS_CONSTRUCTOR_EDEFAULT); - return; - case JavaPackage.JAVA_METHOD__BASE_OPERATION: - setBase_Operation((Operation) null); - return; - case JavaPackage.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - getExplicitPlainTextRequiredImports().clear(); - return; - case JavaPackage.JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS: - getExplicitRequiredImports().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_METHOD__IS_STATIC: - return isStatic != IS_STATIC_EDEFAULT; - case JavaPackage.JAVA_METHOD__IS_FINAL: - return isFinal != IS_FINAL_EDEFAULT; - case JavaPackage.JAVA_METHOD__IS_ABSTRACT: - return isAbstract != IS_ABSTRACT_EDEFAULT; - case JavaPackage.JAVA_METHOD__IS_NATIVE: - return isNative != IS_NATIVE_EDEFAULT; - case JavaPackage.JAVA_METHOD__IS_SYNCHRONIZED: - return isSynchronized != IS_SYNCHRONIZED_EDEFAULT; - case JavaPackage.JAVA_METHOD__IS_CONSTRUCTOR: - return isConstructor != IS_CONSTRUCTOR_EDEFAULT; - case JavaPackage.JAVA_METHOD__BASE_OPERATION: - return base_Operation != null; - case JavaPackage.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - return explicitPlainTextRequiredImports != null && !explicitPlainTextRequiredImports.isEmpty(); - case JavaPackage.JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS: - return explicitRequiredImports != null && !explicitRequiredImports.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (isStatic: "); - result.append(isStatic); - result.append(", isFinal: "); - result.append(isFinal); - result.append(", isAbstract: "); - result.append(isAbstract); - result.append(", isNative: "); - result.append(isNative); - result.append(", isSynchronized: "); - result.append(isSynchronized); - result.append(", isConstructor: "); - result.append(isConstructor); - result.append(", explicitPlainTextRequiredImports: "); - result.append(explicitPlainTextRequiredImports); - result.append(')'); - return result.toString(); - } - -} // JavaMethodImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaNamedElementImpl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaNamedElementImpl.java deleted file mode 100644 index f3876cd8961..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaNamedElementImpl.java +++ /dev/null @@ -1,424 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.java.profile.java.JavaNamedElement; -import org.eclipse.papyrus.java.profile.java.JavaPackage; - -/** - * - * An implementation of the model object 'Named Element'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl#getName Name}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl#getAuthor Author}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl#getVersion Version}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl#getComment Comment}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl#isGenerated Is Generated}
  • - *
- *

- * - * @generated - */ -public abstract class JavaNamedElementImpl extends EObjectImpl implements JavaNamedElement { - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getAuthor() Author}' attribute. - * - * - * - * @see #getAuthor() - * @generated - * @ordered - */ - protected static final String AUTHOR_EDEFAULT = null; - - /** - * The cached value of the '{@link #getAuthor() Author}' attribute. - * - * - * - * @see #getAuthor() - * @generated - * @ordered - */ - protected String author = AUTHOR_EDEFAULT; - - /** - * The default value of the '{@link #getVersion() Version}' attribute. - * - * - * - * @see #getVersion() - * @generated - * @ordered - */ - protected static final String VERSION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getVersion() Version}' attribute. - * - * - * - * @see #getVersion() - * @generated - * @ordered - */ - protected String version = VERSION_EDEFAULT; - - /** - * The default value of the '{@link #getComment() Comment}' attribute. - * - * - * - * @see #getComment() - * @generated - * @ordered - */ - protected static final String COMMENT_EDEFAULT = null; - - /** - * The cached value of the '{@link #getComment() Comment}' attribute. - * - * - * - * @see #getComment() - * @generated - * @ordered - */ - protected String comment = COMMENT_EDEFAULT; - - /** - * The default value of the '{@link #isGenerated() Is Generated}' attribute. - * - * - * - * @see #isGenerated() - * @generated - * @ordered - */ - protected static final boolean IS_GENERATED_EDEFAULT = true; - - /** - * The cached value of the '{@link #isGenerated() Is Generated}' attribute. - * - * - * - * @see #isGenerated() - * @generated - * @ordered - */ - protected boolean isGenerated = IS_GENERATED_EDEFAULT; - - /** - * - * - * - * @generated - */ - protected JavaNamedElementImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JavaPackage.Literals.JAVA_NAMED_ELEMENT; - } - - /** - * - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * - * @generated - */ - @Override - public void setName(String newName) { - String oldName = name; - name = newName; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_NAMED_ELEMENT__NAME, oldName, name)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public String getAuthor() { - return author; - } - - /** - * - * - * - * @generated - */ - @Override - public void setAuthor(String newAuthor) { - String oldAuthor = author; - author = newAuthor; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_NAMED_ELEMENT__AUTHOR, oldAuthor, author)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public String getVersion() { - return version; - } - - /** - * - * - * - * @generated - */ - @Override - public void setVersion(String newVersion) { - String oldVersion = version; - version = newVersion; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_NAMED_ELEMENT__VERSION, oldVersion, version)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public String getComment() { - return comment; - } - - /** - * - * - * - * @generated - */ - @Override - public void setComment(String newComment) { - String oldComment = comment; - comment = newComment; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_NAMED_ELEMENT__COMMENT, oldComment, comment)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isGenerated() { - return isGenerated; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsGenerated(boolean newIsGenerated) { - boolean oldIsGenerated = isGenerated; - isGenerated = newIsGenerated; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_NAMED_ELEMENT__IS_GENERATED, oldIsGenerated, isGenerated)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JavaPackage.JAVA_NAMED_ELEMENT__NAME: - return getName(); - case JavaPackage.JAVA_NAMED_ELEMENT__AUTHOR: - return getAuthor(); - case JavaPackage.JAVA_NAMED_ELEMENT__VERSION: - return getVersion(); - case JavaPackage.JAVA_NAMED_ELEMENT__COMMENT: - return getComment(); - case JavaPackage.JAVA_NAMED_ELEMENT__IS_GENERATED: - return isGenerated(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JavaPackage.JAVA_NAMED_ELEMENT__NAME: - setName((String) newValue); - return; - case JavaPackage.JAVA_NAMED_ELEMENT__AUTHOR: - setAuthor((String) newValue); - return; - case JavaPackage.JAVA_NAMED_ELEMENT__VERSION: - setVersion((String) newValue); - return; - case JavaPackage.JAVA_NAMED_ELEMENT__COMMENT: - setComment((String) newValue); - return; - case JavaPackage.JAVA_NAMED_ELEMENT__IS_GENERATED: - setIsGenerated((Boolean) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_NAMED_ELEMENT__NAME: - setName(NAME_EDEFAULT); - return; - case JavaPackage.JAVA_NAMED_ELEMENT__AUTHOR: - setAuthor(AUTHOR_EDEFAULT); - return; - case JavaPackage.JAVA_NAMED_ELEMENT__VERSION: - setVersion(VERSION_EDEFAULT); - return; - case JavaPackage.JAVA_NAMED_ELEMENT__COMMENT: - setComment(COMMENT_EDEFAULT); - return; - case JavaPackage.JAVA_NAMED_ELEMENT__IS_GENERATED: - setIsGenerated(IS_GENERATED_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_NAMED_ELEMENT__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case JavaPackage.JAVA_NAMED_ELEMENT__AUTHOR: - return AUTHOR_EDEFAULT == null ? author != null : !AUTHOR_EDEFAULT.equals(author); - case JavaPackage.JAVA_NAMED_ELEMENT__VERSION: - return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version); - case JavaPackage.JAVA_NAMED_ELEMENT__COMMENT: - return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment); - case JavaPackage.JAVA_NAMED_ELEMENT__IS_GENERATED: - return isGenerated != IS_GENERATED_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", author: "); - result.append(author); - result.append(", version: "); - result.append(version); - result.append(", comment: "); - result.append(comment); - result.append(", isGenerated: "); - result.append(isGenerated); - result.append(')'); - return result.toString(); - } - -} // JavaNamedElementImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackageImpl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackageImpl.java deleted file mode 100644 index c692fe3aa4f..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackageImpl.java +++ /dev/null @@ -1,978 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.impl; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.papyrus.java.profile.java.JavaClass; -import org.eclipse.papyrus.java.profile.java.JavaFactory; -import org.eclipse.papyrus.java.profile.java.JavaGen; -import org.eclipse.papyrus.java.profile.java.JavaMethod; -import org.eclipse.papyrus.java.profile.java.JavaNamedElement; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaPackage_; -import org.eclipse.papyrus.java.profile.java.JavaParameter; -import org.eclipse.papyrus.java.profile.java.JavaProject; -import org.eclipse.papyrus.java.profile.java.JavaProperty; -import org.eclipse.papyrus.java.profile.java.JavaSrcFolder; -import org.eclipse.papyrus.java.profile.java.PrimitiveType; -import org.eclipse.papyrus.java.profile.java.TrueFalseDefault; -import org.eclipse.uml2.uml.UMLPackage; - -/** - * - * An implementation of the model Package. - * - * - * @generated - */ -public class JavaPackageImpl extends EPackageImpl implements JavaPackage { - /** - * - * - * - * @generated - */ - private EClass javaClassEClass = null; - - /** - * - * - * - * @generated - */ - private EClass javaGenEClass = null; - - /** - * - * - * - * @generated - */ - private EClass javaNamedElementEClass = null; - - /** - * - * - * - * @generated - */ - private EClass javaPackage_EClass = null; - - /** - * - * - * - * @generated - */ - private EClass javaMethodEClass = null; - - /** - * - * - * - * @generated - */ - private EClass javaParameterEClass = null; - - /** - * - * - * - * @generated - */ - private EClass javaPropertyEClass = null; - - /** - * - * - * - * @generated - */ - private EClass primitiveTypeEClass = null; - - /** - * - * - * - * @generated - */ - private EClass javaProjectEClass = null; - - /** - * - * - * - * @generated - */ - private EClass javaSrcFolderEClass = null; - - /** - * - * - * - * @generated - */ - private EEnum trueFalseDefaultEEnum = null; - - /** - * Creates an instance of the model Package, registered with {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

- * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also performs initialization of the package, or returns the registered package, if one already exists. - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.papyrus.java.profile.java.JavaPackage#eNS_URI - * @see #init() - * @generated - */ - private JavaPackageImpl() { - super(eNS_URI, JavaFactory.eINSTANCE); - } - - /** - * - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * - *

- * This method is used to initialize {@link JavaPackage#eINSTANCE} when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static JavaPackage init() { - if (isInited) { - return (JavaPackage) EPackage.Registry.INSTANCE.getEPackage(JavaPackage.eNS_URI); - } - - // Obtain or create and register package - JavaPackageImpl theJavaPackage = (JavaPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof JavaPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new JavaPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - UMLPackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theJavaPackage.createPackageContents(); - - // Initialize created meta-data - theJavaPackage.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theJavaPackage.freeze(); - - - // Update the registry and return the package - EPackage.Registry.INSTANCE.put(JavaPackage.eNS_URI, theJavaPackage); - return theJavaPackage; - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJavaClass() { - return javaClassEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJavaClass_Base_Classifier() { - return (EReference) javaClassEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaClass_IsFinal() { - return (EAttribute) javaClassEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaClass_IsAbstract() { - return (EAttribute) javaClassEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaClass_IsStatic() { - return (EAttribute) javaClassEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaClass_ExplicitPlainTextRequiredImports() { - return (EAttribute) javaClassEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJavaClass_ExplicitRequiredImports() { - return (EReference) javaClassEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJavaGen() { - return javaGenEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaGen_SrcName() { - return (EAttribute) javaGenEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaGen_ProjectName() { - return (EAttribute) javaGenEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJavaNamedElement() { - return javaNamedElementEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaNamedElement_Name() { - return (EAttribute) javaNamedElementEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaNamedElement_Author() { - return (EAttribute) javaNamedElementEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaNamedElement_Version() { - return (EAttribute) javaNamedElementEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaNamedElement_Comment() { - return (EAttribute) javaNamedElementEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaNamedElement_IsGenerated() { - return (EAttribute) javaNamedElementEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJavaPackage_() { - return javaPackage_EClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaPackage__PackageName() { - return (EAttribute) javaPackage_EClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJavaPackage__Base_Package() { - return (EReference) javaPackage_EClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJavaMethod() { - return javaMethodEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaMethod_IsStatic() { - return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaMethod_IsFinal() { - return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaMethod_IsAbstract() { - return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaMethod_IsNative() { - return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaMethod_IsSynchronized() { - return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaMethod_IsConstructor() { - return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJavaMethod_Base_Operation() { - return (EReference) javaMethodEClass.getEStructuralFeatures().get(6); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaMethod_ExplicitPlainTextRequiredImports() { - return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(7); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJavaMethod_ExplicitRequiredImports() { - return (EReference) javaMethodEClass.getEStructuralFeatures().get(8); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJavaParameter() { - return javaParameterEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaParameter_IsFinal() { - return (EAttribute) javaParameterEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJavaParameter_Base_Parameter() { - return (EReference) javaParameterEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJavaProperty() { - return javaPropertyEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaProperty_IsAbstract() { - return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaProperty_IsFinal() { - return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJavaProperty_Base_Property() { - return (EReference) javaPropertyEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaProperty_IsTransient() { - return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaProperty_GenerateGetter() { - return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaProperty_GenerateSetter() { - return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaProperty_IsStatic() { - return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(6); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getJavaProperty_ExplicitPlainTextRequiredImports() { - return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(7); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJavaProperty_ExplicitRequiredImports() { - return (EReference) javaPropertyEClass.getEStructuralFeatures().get(8); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getPrimitiveType() { - return primitiveTypeEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getPrimitiveType_ImplementationClass() { - return (EAttribute) primitiveTypeEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getPrimitiveType_Base_PrimitiveType() { - return (EReference) primitiveTypeEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * - * @generated - */ - @Override - public EAttribute getPrimitiveType_CollectionImplementationClass() { - return (EAttribute) primitiveTypeEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJavaProject() { - return javaProjectEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJavaProject_Base_Package() { - return (EReference) javaProjectEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EClass getJavaSrcFolder() { - return javaSrcFolderEClass; - } - - /** - * - * - * - * @generated - */ - @Override - public EReference getJavaSrcFolder_Base_Package() { - return (EReference) javaSrcFolderEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * - * @generated - */ - @Override - public EEnum getTrueFalseDefault() { - return trueFalseDefaultEEnum; - } - - /** - * - * - * - * @generated - */ - @Override - public JavaFactory getJavaFactory() { - return (JavaFactory) getEFactoryInstance(); - } - - /** - * - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * - * @generated - */ - public void createPackageContents() { - if (isCreated) { - return; - } - isCreated = true; - - // Create classes and their features - javaClassEClass = createEClass(JAVA_CLASS); - createEReference(javaClassEClass, JAVA_CLASS__BASE_CLASSIFIER); - createEAttribute(javaClassEClass, JAVA_CLASS__IS_FINAL); - createEAttribute(javaClassEClass, JAVA_CLASS__IS_ABSTRACT); - createEAttribute(javaClassEClass, JAVA_CLASS__IS_STATIC); - createEAttribute(javaClassEClass, JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); - createEReference(javaClassEClass, JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS); - - javaGenEClass = createEClass(JAVA_GEN); - createEAttribute(javaGenEClass, JAVA_GEN__SRC_NAME); - createEAttribute(javaGenEClass, JAVA_GEN__PROJECT_NAME); - - javaNamedElementEClass = createEClass(JAVA_NAMED_ELEMENT); - createEAttribute(javaNamedElementEClass, JAVA_NAMED_ELEMENT__NAME); - createEAttribute(javaNamedElementEClass, JAVA_NAMED_ELEMENT__AUTHOR); - createEAttribute(javaNamedElementEClass, JAVA_NAMED_ELEMENT__VERSION); - createEAttribute(javaNamedElementEClass, JAVA_NAMED_ELEMENT__COMMENT); - createEAttribute(javaNamedElementEClass, JAVA_NAMED_ELEMENT__IS_GENERATED); - - javaPackage_EClass = createEClass(JAVA_PACKAGE_); - createEAttribute(javaPackage_EClass, JAVA_PACKAGE___PACKAGE_NAME); - createEReference(javaPackage_EClass, JAVA_PACKAGE___BASE_PACKAGE); - - javaMethodEClass = createEClass(JAVA_METHOD); - createEAttribute(javaMethodEClass, JAVA_METHOD__IS_STATIC); - createEAttribute(javaMethodEClass, JAVA_METHOD__IS_FINAL); - createEAttribute(javaMethodEClass, JAVA_METHOD__IS_ABSTRACT); - createEAttribute(javaMethodEClass, JAVA_METHOD__IS_NATIVE); - createEAttribute(javaMethodEClass, JAVA_METHOD__IS_SYNCHRONIZED); - createEAttribute(javaMethodEClass, JAVA_METHOD__IS_CONSTRUCTOR); - createEReference(javaMethodEClass, JAVA_METHOD__BASE_OPERATION); - createEAttribute(javaMethodEClass, JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); - createEReference(javaMethodEClass, JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS); - - javaParameterEClass = createEClass(JAVA_PARAMETER); - createEAttribute(javaParameterEClass, JAVA_PARAMETER__IS_FINAL); - createEReference(javaParameterEClass, JAVA_PARAMETER__BASE_PARAMETER); - - javaPropertyEClass = createEClass(JAVA_PROPERTY); - createEAttribute(javaPropertyEClass, JAVA_PROPERTY__IS_ABSTRACT); - createEAttribute(javaPropertyEClass, JAVA_PROPERTY__IS_FINAL); - createEReference(javaPropertyEClass, JAVA_PROPERTY__BASE_PROPERTY); - createEAttribute(javaPropertyEClass, JAVA_PROPERTY__IS_TRANSIENT); - createEAttribute(javaPropertyEClass, JAVA_PROPERTY__GENERATE_GETTER); - createEAttribute(javaPropertyEClass, JAVA_PROPERTY__GENERATE_SETTER); - createEAttribute(javaPropertyEClass, JAVA_PROPERTY__IS_STATIC); - createEAttribute(javaPropertyEClass, JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); - createEReference(javaPropertyEClass, JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS); - - primitiveTypeEClass = createEClass(PRIMITIVE_TYPE); - createEAttribute(primitiveTypeEClass, PRIMITIVE_TYPE__IMPLEMENTATION_CLASS); - createEReference(primitiveTypeEClass, PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE); - createEAttribute(primitiveTypeEClass, PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS); - - javaProjectEClass = createEClass(JAVA_PROJECT); - createEReference(javaProjectEClass, JAVA_PROJECT__BASE_PACKAGE); - - javaSrcFolderEClass = createEClass(JAVA_SRC_FOLDER); - createEReference(javaSrcFolderEClass, JAVA_SRC_FOLDER__BASE_PACKAGE); - - // Create enums - trueFalseDefaultEEnum = createEEnum(TRUE_FALSE_DEFAULT); - } - - /** - * - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) { - return; - } - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - UMLPackage theUMLPackage = (UMLPackage) EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI); - - // Create type parameters - - // Set bounds for type parameters - - // Add supertypes to classes - javaClassEClass.getESuperTypes().add(this.getJavaGen()); - javaGenEClass.getESuperTypes().add(this.getJavaNamedElement()); - javaPackage_EClass.getESuperTypes().add(this.getJavaGen()); - javaMethodEClass.getESuperTypes().add(this.getJavaNamedElement()); - javaParameterEClass.getESuperTypes().add(this.getJavaNamedElement()); - javaPropertyEClass.getESuperTypes().add(this.getJavaNamedElement()); - primitiveTypeEClass.getESuperTypes().add(this.getJavaGen()); - javaProjectEClass.getESuperTypes().add(this.getJavaGen()); - javaSrcFolderEClass.getESuperTypes().add(this.getJavaGen()); - - // Initialize classes and features; add operations and parameters - initEClass(javaClassEClass, JavaClass.class, "JavaClass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJavaClass_Base_Classifier(), theUMLPackage.getClassifier(), null, "base_Classifier", null, 1, 1, JavaClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - initEAttribute(getJavaClass_IsFinal(), ecorePackage.getEBoolean(), "isFinal", null, 1, 1, JavaClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaClass_IsAbstract(), ecorePackage.getEBoolean(), "isAbstract", null, 1, 1, JavaClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaClass_IsStatic(), ecorePackage.getEBoolean(), "isStatic", null, 1, 1, JavaClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaClass_ExplicitPlainTextRequiredImports(), ecorePackage.getEString(), "explicitPlainTextRequiredImports", null, 0, -1, JavaClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - initEReference(getJavaClass_ExplicitRequiredImports(), theUMLPackage.getClassifier(), null, "explicitRequiredImports", null, 0, -1, JavaClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(javaGenEClass, JavaGen.class, "JavaGen", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getJavaGen_SrcName(), ecorePackage.getEString(), "srcName", null, 1, 1, JavaGen.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaGen_ProjectName(), ecorePackage.getEString(), "projectName", null, 1, 1, JavaGen.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(javaNamedElementEClass, JavaNamedElement.class, "JavaNamedElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getJavaNamedElement_Name(), ecorePackage.getEString(), "name", null, 1, 1, JavaNamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaNamedElement_Author(), ecorePackage.getEString(), "author", null, 1, 1, JavaNamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaNamedElement_Version(), ecorePackage.getEString(), "version", null, 1, 1, JavaNamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaNamedElement_Comment(), ecorePackage.getEString(), "comment", null, 1, 1, JavaNamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaNamedElement_IsGenerated(), ecorePackage.getEBoolean(), "isGenerated", "true", 1, 1, JavaNamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(javaPackage_EClass, JavaPackage_.class, "JavaPackage_", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getJavaPackage__PackageName(), ecorePackage.getEString(), "packageName", null, 1, 1, JavaPackage_.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJavaPackage__Base_Package(), theUMLPackage.getPackage(), null, "base_Package", null, 1, 1, JavaPackage_.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - - initEClass(javaMethodEClass, JavaMethod.class, "JavaMethod", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getJavaMethod_IsStatic(), ecorePackage.getEBoolean(), "isStatic", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaMethod_IsFinal(), ecorePackage.getEBoolean(), "isFinal", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaMethod_IsAbstract(), ecorePackage.getEBoolean(), "isAbstract", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaMethod_IsNative(), ecorePackage.getEBoolean(), "isNative", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaMethod_IsSynchronized(), ecorePackage.getEBoolean(), "isSynchronized", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaMethod_IsConstructor(), ecorePackage.getEBoolean(), "isConstructor", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJavaMethod_Base_Operation(), theUMLPackage.getOperation(), null, "base_Operation", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - initEAttribute(getJavaMethod_ExplicitPlainTextRequiredImports(), ecorePackage.getEString(), "explicitPlainTextRequiredImports", null, 0, -1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - initEReference(getJavaMethod_ExplicitRequiredImports(), theUMLPackage.getClassifier(), null, "explicitRequiredImports", null, 0, -1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(javaParameterEClass, JavaParameter.class, "JavaParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getJavaParameter_IsFinal(), ecorePackage.getEBoolean(), "isFinal", null, 1, 1, JavaParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJavaParameter_Base_Parameter(), theUMLPackage.getParameter(), null, "base_Parameter", null, 1, 1, JavaParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, - !IS_DERIVED, !IS_ORDERED); - - initEClass(javaPropertyEClass, JavaProperty.class, "JavaProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getJavaProperty_IsAbstract(), ecorePackage.getEBoolean(), "isAbstract", null, 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaProperty_IsFinal(), ecorePackage.getEBoolean(), "isFinal", null, 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getJavaProperty_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - initEAttribute(getJavaProperty_IsTransient(), ecorePackage.getEBoolean(), "isTransient", null, 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaProperty_GenerateGetter(), this.getTrueFalseDefault(), "generateGetter", "default", 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaProperty_GenerateSetter(), this.getTrueFalseDefault(), "generateSetter", "default", 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaProperty_IsStatic(), ecorePackage.getEBoolean(), "isStatic", null, 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getJavaProperty_ExplicitPlainTextRequiredImports(), ecorePackage.getEString(), "explicitPlainTextRequiredImports", null, 0, -1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, - !IS_DERIVED, !IS_ORDERED); - initEReference(getJavaProperty_ExplicitRequiredImports(), theUMLPackage.getClassifier(), null, "explicitRequiredImports", null, 0, -1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(primitiveTypeEClass, PrimitiveType.class, "PrimitiveType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPrimitiveType_ImplementationClass(), ecorePackage.getEString(), "implementationClass", null, 1, 1, PrimitiveType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getPrimitiveType_Base_PrimitiveType(), theUMLPackage.getPrimitiveType(), null, "base_PrimitiveType", null, 1, 1, PrimitiveType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, - !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getPrimitiveType_CollectionImplementationClass(), ecorePackage.getEString(), "collectionImplementationClass", null, 1, 1, PrimitiveType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - - initEClass(javaProjectEClass, JavaProject.class, "JavaProject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJavaProject_Base_Package(), theUMLPackage.getPackage(), null, "base_Package", null, 1, 1, JavaProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - - initEClass(javaSrcFolderEClass, JavaSrcFolder.class, "JavaSrcFolder", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getJavaSrcFolder_Base_Package(), theUMLPackage.getPackage(), null, "base_Package", null, 1, 1, JavaSrcFolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, - !IS_ORDERED); - - // Initialize enums and add enum literals - initEEnum(trueFalseDefaultEEnum, TrueFalseDefault.class, "TrueFalseDefault"); - addEEnumLiteral(trueFalseDefaultEEnum, TrueFalseDefault.TRUE); - addEEnumLiteral(trueFalseDefaultEEnum, TrueFalseDefault.FALSE); - addEEnumLiteral(trueFalseDefaultEEnum, TrueFalseDefault.DEFAULT); - - // Create resource - createResource(eNS_URI); - } - -} // JavaPackageImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackage_Impl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackage_Impl.java deleted file mode 100644 index 845bb0e70d8..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackage_Impl.java +++ /dev/null @@ -1,250 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaPackage_; - -/** - * - * An implementation of the model object 'Package '. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPackage_Impl#getPackageName Package Name}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPackage_Impl#getBase_Package Base Package}
  • - *
- *

- * - * @generated - */ -public class JavaPackage_Impl extends JavaGenImpl implements JavaPackage_ { - /** - * The default value of the '{@link #getPackageName() Package Name}' attribute. - * - * - * - * @see #getPackageName() - * @generated - * @ordered - */ - protected static final String PACKAGE_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getPackageName() Package Name}' attribute. - * - * - * - * @see #getPackageName() - * @generated - * @ordered - */ - protected String packageName = PACKAGE_NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_Package() Base Package}' reference. - * - * - * - * @see #getBase_Package() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Package base_Package; - - /** - * - * - * - * @generated - */ - protected JavaPackage_Impl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JavaPackage.Literals.JAVA_PACKAGE_; - } - - /** - * - * - * - * @generated - */ - @Override - public String getPackageName() { - return packageName; - } - - /** - * - * - * - * @generated - */ - @Override - public void setPackageName(String newPackageName) { - String oldPackageName = packageName; - packageName = newPackageName; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PACKAGE___PACKAGE_NAME, oldPackageName, packageName)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Package getBase_Package() { - if (base_Package != null && base_Package.eIsProxy()) { - InternalEObject oldBase_Package = (InternalEObject) base_Package; - base_Package = (org.eclipse.uml2.uml.Package) eResolveProxy(oldBase_Package); - if (base_Package != oldBase_Package) { - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_PACKAGE___BASE_PACKAGE, oldBase_Package, base_Package)); - } - } - } - return base_Package; - } - - /** - * - * - * - * @generated - */ - public org.eclipse.uml2.uml.Package basicGetBase_Package() { - return base_Package; - } - - /** - * - * - * - * @generated - */ - @Override - public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { - org.eclipse.uml2.uml.Package oldBase_Package = base_Package; - base_Package = newBase_Package; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PACKAGE___BASE_PACKAGE, oldBase_Package, base_Package)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JavaPackage.JAVA_PACKAGE___PACKAGE_NAME: - return getPackageName(); - case JavaPackage.JAVA_PACKAGE___BASE_PACKAGE: - if (resolve) { - return getBase_Package(); - } - return basicGetBase_Package(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JavaPackage.JAVA_PACKAGE___PACKAGE_NAME: - setPackageName((String) newValue); - return; - case JavaPackage.JAVA_PACKAGE___BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_PACKAGE___PACKAGE_NAME: - setPackageName(PACKAGE_NAME_EDEFAULT); - return; - case JavaPackage.JAVA_PACKAGE___BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_PACKAGE___PACKAGE_NAME: - return PACKAGE_NAME_EDEFAULT == null ? packageName != null : !PACKAGE_NAME_EDEFAULT.equals(packageName); - case JavaPackage.JAVA_PACKAGE___BASE_PACKAGE: - return base_Package != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (packageName: "); - result.append(packageName); - result.append(')'); - return result.toString(); - } - -} // JavaPackage_Impl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaParameterImpl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaParameterImpl.java deleted file mode 100644 index e554cd837cc..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaParameterImpl.java +++ /dev/null @@ -1,251 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaParameter; -import org.eclipse.uml2.uml.Parameter; - -/** - * - * An implementation of the model object 'Parameter'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaParameterImpl#isFinal Is Final}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaParameterImpl#getBase_Parameter Base Parameter}
  • - *
- *

- * - * @generated - */ -public class JavaParameterImpl extends JavaNamedElementImpl implements JavaParameter { - /** - * The default value of the '{@link #isFinal() Is Final}' attribute. - * - * - * - * @see #isFinal() - * @generated - * @ordered - */ - protected static final boolean IS_FINAL_EDEFAULT = false; - - /** - * The cached value of the '{@link #isFinal() Is Final}' attribute. - * - * - * - * @see #isFinal() - * @generated - * @ordered - */ - protected boolean isFinal = IS_FINAL_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_Parameter() Base Parameter}' reference. - * - * - * - * @see #getBase_Parameter() - * @generated - * @ordered - */ - protected Parameter base_Parameter; - - /** - * - * - * - * @generated - */ - protected JavaParameterImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JavaPackage.Literals.JAVA_PARAMETER; - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isFinal() { - return isFinal; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsFinal(boolean newIsFinal) { - boolean oldIsFinal = isFinal; - isFinal = newIsFinal; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PARAMETER__IS_FINAL, oldIsFinal, isFinal)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Parameter getBase_Parameter() { - if (base_Parameter != null && base_Parameter.eIsProxy()) { - InternalEObject oldBase_Parameter = (InternalEObject) base_Parameter; - base_Parameter = (Parameter) eResolveProxy(oldBase_Parameter); - if (base_Parameter != oldBase_Parameter) { - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_PARAMETER__BASE_PARAMETER, oldBase_Parameter, base_Parameter)); - } - } - } - return base_Parameter; - } - - /** - * - * - * - * @generated - */ - public Parameter basicGetBase_Parameter() { - return base_Parameter; - } - - /** - * - * - * - * @generated - */ - @Override - public void setBase_Parameter(Parameter newBase_Parameter) { - Parameter oldBase_Parameter = base_Parameter; - base_Parameter = newBase_Parameter; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PARAMETER__BASE_PARAMETER, oldBase_Parameter, base_Parameter)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JavaPackage.JAVA_PARAMETER__IS_FINAL: - return isFinal(); - case JavaPackage.JAVA_PARAMETER__BASE_PARAMETER: - if (resolve) { - return getBase_Parameter(); - } - return basicGetBase_Parameter(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JavaPackage.JAVA_PARAMETER__IS_FINAL: - setIsFinal((Boolean) newValue); - return; - case JavaPackage.JAVA_PARAMETER__BASE_PARAMETER: - setBase_Parameter((Parameter) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_PARAMETER__IS_FINAL: - setIsFinal(IS_FINAL_EDEFAULT); - return; - case JavaPackage.JAVA_PARAMETER__BASE_PARAMETER: - setBase_Parameter((Parameter) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_PARAMETER__IS_FINAL: - return isFinal != IS_FINAL_EDEFAULT; - case JavaPackage.JAVA_PARAMETER__BASE_PARAMETER: - return base_Parameter != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (isFinal: "); - result.append(isFinal); - result.append(')'); - return result.toString(); - } - -} // JavaParameterImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaProjectImpl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaProjectImpl.java deleted file mode 100644 index 7c356b1ec6a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaProjectImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaProject; - -/** - * - * An implementation of the model object 'Project'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaProjectImpl#getBase_Package Base Package}
  • - *
- *

- * - * @generated - */ -public class JavaProjectImpl extends JavaGenImpl implements JavaProject { - /** - * The cached value of the '{@link #getBase_Package() Base Package}' reference. - * - * - * - * @see #getBase_Package() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Package base_Package; - - /** - * - * - * - * @generated - */ - protected JavaProjectImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JavaPackage.Literals.JAVA_PROJECT; - } - - /** - * - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Package getBase_Package() { - if (base_Package != null && base_Package.eIsProxy()) { - InternalEObject oldBase_Package = (InternalEObject) base_Package; - base_Package = (org.eclipse.uml2.uml.Package) eResolveProxy(oldBase_Package); - if (base_Package != oldBase_Package) { - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_PROJECT__BASE_PACKAGE, oldBase_Package, base_Package)); - } - } - } - return base_Package; - } - - /** - * - * - * - * @generated - */ - public org.eclipse.uml2.uml.Package basicGetBase_Package() { - return base_Package; - } - - /** - * - * - * - * @generated - */ - @Override - public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { - org.eclipse.uml2.uml.Package oldBase_Package = base_Package; - base_Package = newBase_Package; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROJECT__BASE_PACKAGE, oldBase_Package, base_Package)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JavaPackage.JAVA_PROJECT__BASE_PACKAGE: - if (resolve) { - return getBase_Package(); - } - return basicGetBase_Package(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JavaPackage.JAVA_PROJECT__BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_PROJECT__BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_PROJECT__BASE_PACKAGE: - return base_Package != null; - } - return super.eIsSet(featureID); - } - -} // JavaProjectImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPropertyImpl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPropertyImpl.java deleted file mode 100644 index e1214355ae8..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPropertyImpl.java +++ /dev/null @@ -1,671 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EDataTypeEList; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaProperty; -import org.eclipse.papyrus.java.profile.java.TrueFalseDefault; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Property; - -/** - * - * An implementation of the model object 'Property'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#isAbstract Is Abstract}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#isFinal Is Final}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#getBase_Property Base Property}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#isTransient Is Transient}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#getGenerateGetter Generate Getter}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#getGenerateSetter Generate Setter}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#isStatic Is Static}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#getExplicitRequiredImports Explicit Required Imports}
  • - *
- *

- * - * @generated - */ -public class JavaPropertyImpl extends JavaNamedElementImpl implements JavaProperty { - /** - * The default value of the '{@link #isAbstract() Is Abstract}' attribute. - * - * - * - * @see #isAbstract() - * @generated - * @ordered - */ - protected static final boolean IS_ABSTRACT_EDEFAULT = false; - - /** - * The cached value of the '{@link #isAbstract() Is Abstract}' attribute. - * - * - * - * @see #isAbstract() - * @generated - * @ordered - */ - protected boolean isAbstract = IS_ABSTRACT_EDEFAULT; - - /** - * The default value of the '{@link #isFinal() Is Final}' attribute. - * - * - * - * @see #isFinal() - * @generated - * @ordered - */ - protected static final boolean IS_FINAL_EDEFAULT = false; - - /** - * The cached value of the '{@link #isFinal() Is Final}' attribute. - * - * - * - * @see #isFinal() - * @generated - * @ordered - */ - protected boolean isFinal = IS_FINAL_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_Property() Base Property}' reference. - * - * - * - * @see #getBase_Property() - * @generated - * @ordered - */ - protected Property base_Property; - - /** - * The default value of the '{@link #isTransient() Is Transient}' attribute. - * - * - * - * @see #isTransient() - * @generated - * @ordered - */ - protected static final boolean IS_TRANSIENT_EDEFAULT = false; - - /** - * The cached value of the '{@link #isTransient() Is Transient}' attribute. - * - * - * - * @see #isTransient() - * @generated - * @ordered - */ - protected boolean isTransient = IS_TRANSIENT_EDEFAULT; - - /** - * The default value of the '{@link #getGenerateGetter() Generate Getter}' attribute. - * - * - * - * @see #getGenerateGetter() - * @generated - * @ordered - */ - protected static final TrueFalseDefault GENERATE_GETTER_EDEFAULT = TrueFalseDefault.DEFAULT; - - /** - * The cached value of the '{@link #getGenerateGetter() Generate Getter}' attribute. - * - * - * - * @see #getGenerateGetter() - * @generated - * @ordered - */ - protected TrueFalseDefault generateGetter = GENERATE_GETTER_EDEFAULT; - - /** - * The default value of the '{@link #getGenerateSetter() Generate Setter}' attribute. - * - * - * - * @see #getGenerateSetter() - * @generated - * @ordered - */ - protected static final TrueFalseDefault GENERATE_SETTER_EDEFAULT = TrueFalseDefault.DEFAULT; - - /** - * The cached value of the '{@link #getGenerateSetter() Generate Setter}' attribute. - * - * - * - * @see #getGenerateSetter() - * @generated - * @ordered - */ - protected TrueFalseDefault generateSetter = GENERATE_SETTER_EDEFAULT; - - /** - * The default value of the '{@link #isStatic() Is Static}' attribute. - * - * - * - * @see #isStatic() - * @generated - * @ordered - */ - protected static final boolean IS_STATIC_EDEFAULT = false; - - /** - * The cached value of the '{@link #isStatic() Is Static}' attribute. - * - * - * - * @see #isStatic() - * @generated - * @ordered - */ - protected boolean isStatic = IS_STATIC_EDEFAULT; - - /** - * The cached value of the '{@link #getExplicitPlainTextRequiredImports() Explicit Plain Text Required Imports}' attribute list. - * - * - * - * @see #getExplicitPlainTextRequiredImports() - * @generated - * @ordered - */ - protected EList explicitPlainTextRequiredImports; - - /** - * The cached value of the '{@link #getExplicitRequiredImports() Explicit Required Imports}' reference list. - * - * - * - * @see #getExplicitRequiredImports() - * @generated - * @ordered - */ - protected EList explicitRequiredImports; - - /** - * - * - * - * @generated - */ - protected JavaPropertyImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JavaPackage.Literals.JAVA_PROPERTY; - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isAbstract() { - return isAbstract; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsAbstract(boolean newIsAbstract) { - boolean oldIsAbstract = isAbstract; - isAbstract = newIsAbstract; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__IS_ABSTRACT, oldIsAbstract, isAbstract)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isFinal() { - return isFinal; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsFinal(boolean newIsFinal) { - boolean oldIsFinal = isFinal; - isFinal = newIsFinal; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__IS_FINAL, oldIsFinal, isFinal)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Property getBase_Property() { - if (base_Property != null && base_Property.eIsProxy()) { - InternalEObject oldBase_Property = (InternalEObject) base_Property; - base_Property = (Property) eResolveProxy(oldBase_Property); - if (base_Property != oldBase_Property) { - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_PROPERTY__BASE_PROPERTY, oldBase_Property, base_Property)); - } - } - } - return base_Property; - } - - /** - * - * - * - * @generated - */ - public Property basicGetBase_Property() { - return base_Property; - } - - /** - * - * - * - * @generated - */ - @Override - public void setBase_Property(Property newBase_Property) { - Property oldBase_Property = base_Property; - base_Property = newBase_Property; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__BASE_PROPERTY, oldBase_Property, base_Property)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isTransient() { - return isTransient; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsTransient(boolean newIsTransient) { - boolean oldIsTransient = isTransient; - isTransient = newIsTransient; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__IS_TRANSIENT, oldIsTransient, isTransient)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public TrueFalseDefault getGenerateGetter() { - return generateGetter; - } - - /** - * - * - * - * @generated - */ - @Override - public void setGenerateGetter(TrueFalseDefault newGenerateGetter) { - TrueFalseDefault oldGenerateGetter = generateGetter; - generateGetter = newGenerateGetter == null ? GENERATE_GETTER_EDEFAULT : newGenerateGetter; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__GENERATE_GETTER, oldGenerateGetter, generateGetter)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public TrueFalseDefault getGenerateSetter() { - return generateSetter; - } - - /** - * - * - * - * @generated - */ - @Override - public void setGenerateSetter(TrueFalseDefault newGenerateSetter) { - TrueFalseDefault oldGenerateSetter = generateSetter; - generateSetter = newGenerateSetter == null ? GENERATE_SETTER_EDEFAULT : newGenerateSetter; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__GENERATE_SETTER, oldGenerateSetter, generateSetter)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public boolean isStatic() { - return isStatic; - } - - /** - * - * - * - * @generated - */ - @Override - public void setIsStatic(boolean newIsStatic) { - boolean oldIsStatic = isStatic; - isStatic = newIsStatic; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__IS_STATIC, oldIsStatic, isStatic)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public EList getExplicitPlainTextRequiredImports() { - if (explicitPlainTextRequiredImports == null) { - explicitPlainTextRequiredImports = new EDataTypeEList(String.class, this, JavaPackage.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); - } - return explicitPlainTextRequiredImports; - } - - /** - * - * - * - * @generated - */ - @Override - public EList getExplicitRequiredImports() { - if (explicitRequiredImports == null) { - explicitRequiredImports = new EObjectResolvingEList(Classifier.class, this, JavaPackage.JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS); - } - return explicitRequiredImports; - } - - /** - * - * - * - * @generated - */ - @Override - public Classifier getExplicitRequiredImports(String name) { - return getExplicitRequiredImports(name, false, null); - } - - /** - * - * - * - * @generated - */ - @Override - public Classifier getExplicitRequiredImports(String name, boolean ignoreCase, EClass eClass) { - explicitRequiredImportsLoop: for (Classifier explicitRequiredImports : getExplicitRequiredImports()) { - if (eClass != null && !eClass.isInstance(explicitRequiredImports)) { - continue explicitRequiredImportsLoop; - } - if (name != null && !(ignoreCase ? name.equalsIgnoreCase(explicitRequiredImports.getName()) : name.equals(explicitRequiredImports.getName()))) { - continue explicitRequiredImportsLoop; - } - return explicitRequiredImports; - } - return null; - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JavaPackage.JAVA_PROPERTY__IS_ABSTRACT: - return isAbstract(); - case JavaPackage.JAVA_PROPERTY__IS_FINAL: - return isFinal(); - case JavaPackage.JAVA_PROPERTY__BASE_PROPERTY: - if (resolve) { - return getBase_Property(); - } - return basicGetBase_Property(); - case JavaPackage.JAVA_PROPERTY__IS_TRANSIENT: - return isTransient(); - case JavaPackage.JAVA_PROPERTY__GENERATE_GETTER: - return getGenerateGetter(); - case JavaPackage.JAVA_PROPERTY__GENERATE_SETTER: - return getGenerateSetter(); - case JavaPackage.JAVA_PROPERTY__IS_STATIC: - return isStatic(); - case JavaPackage.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - return getExplicitPlainTextRequiredImports(); - case JavaPackage.JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS: - return getExplicitRequiredImports(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JavaPackage.JAVA_PROPERTY__IS_ABSTRACT: - setIsAbstract((Boolean) newValue); - return; - case JavaPackage.JAVA_PROPERTY__IS_FINAL: - setIsFinal((Boolean) newValue); - return; - case JavaPackage.JAVA_PROPERTY__BASE_PROPERTY: - setBase_Property((Property) newValue); - return; - case JavaPackage.JAVA_PROPERTY__IS_TRANSIENT: - setIsTransient((Boolean) newValue); - return; - case JavaPackage.JAVA_PROPERTY__GENERATE_GETTER: - setGenerateGetter((TrueFalseDefault) newValue); - return; - case JavaPackage.JAVA_PROPERTY__GENERATE_SETTER: - setGenerateSetter((TrueFalseDefault) newValue); - return; - case JavaPackage.JAVA_PROPERTY__IS_STATIC: - setIsStatic((Boolean) newValue); - return; - case JavaPackage.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - getExplicitPlainTextRequiredImports().clear(); - getExplicitPlainTextRequiredImports().addAll((Collection) newValue); - return; - case JavaPackage.JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS: - getExplicitRequiredImports().clear(); - getExplicitRequiredImports().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_PROPERTY__IS_ABSTRACT: - setIsAbstract(IS_ABSTRACT_EDEFAULT); - return; - case JavaPackage.JAVA_PROPERTY__IS_FINAL: - setIsFinal(IS_FINAL_EDEFAULT); - return; - case JavaPackage.JAVA_PROPERTY__BASE_PROPERTY: - setBase_Property((Property) null); - return; - case JavaPackage.JAVA_PROPERTY__IS_TRANSIENT: - setIsTransient(IS_TRANSIENT_EDEFAULT); - return; - case JavaPackage.JAVA_PROPERTY__GENERATE_GETTER: - setGenerateGetter(GENERATE_GETTER_EDEFAULT); - return; - case JavaPackage.JAVA_PROPERTY__GENERATE_SETTER: - setGenerateSetter(GENERATE_SETTER_EDEFAULT); - return; - case JavaPackage.JAVA_PROPERTY__IS_STATIC: - setIsStatic(IS_STATIC_EDEFAULT); - return; - case JavaPackage.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - getExplicitPlainTextRequiredImports().clear(); - return; - case JavaPackage.JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS: - getExplicitRequiredImports().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_PROPERTY__IS_ABSTRACT: - return isAbstract != IS_ABSTRACT_EDEFAULT; - case JavaPackage.JAVA_PROPERTY__IS_FINAL: - return isFinal != IS_FINAL_EDEFAULT; - case JavaPackage.JAVA_PROPERTY__BASE_PROPERTY: - return base_Property != null; - case JavaPackage.JAVA_PROPERTY__IS_TRANSIENT: - return isTransient != IS_TRANSIENT_EDEFAULT; - case JavaPackage.JAVA_PROPERTY__GENERATE_GETTER: - return generateGetter != GENERATE_GETTER_EDEFAULT; - case JavaPackage.JAVA_PROPERTY__GENERATE_SETTER: - return generateSetter != GENERATE_SETTER_EDEFAULT; - case JavaPackage.JAVA_PROPERTY__IS_STATIC: - return isStatic != IS_STATIC_EDEFAULT; - case JavaPackage.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: - return explicitPlainTextRequiredImports != null && !explicitPlainTextRequiredImports.isEmpty(); - case JavaPackage.JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS: - return explicitRequiredImports != null && !explicitRequiredImports.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (isAbstract: "); - result.append(isAbstract); - result.append(", isFinal: "); - result.append(isFinal); - result.append(", isTransient: "); - result.append(isTransient); - result.append(", generateGetter: "); - result.append(generateGetter); - result.append(", generateSetter: "); - result.append(generateSetter); - result.append(", isStatic: "); - result.append(isStatic); - result.append(", explicitPlainTextRequiredImports: "); - result.append(explicitPlainTextRequiredImports); - result.append(')'); - return result.toString(); - } - -} // JavaPropertyImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaSrcFolderImpl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaSrcFolderImpl.java deleted file mode 100644 index e52396f2794..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaSrcFolderImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaSrcFolder; - -/** - * - * An implementation of the model object 'Src Folder'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.JavaSrcFolderImpl#getBase_Package Base Package}
  • - *
- *

- * - * @generated - */ -public class JavaSrcFolderImpl extends JavaGenImpl implements JavaSrcFolder { - /** - * The cached value of the '{@link #getBase_Package() Base Package}' reference. - * - * - * - * @see #getBase_Package() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Package base_Package; - - /** - * - * - * - * @generated - */ - protected JavaSrcFolderImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JavaPackage.Literals.JAVA_SRC_FOLDER; - } - - /** - * - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Package getBase_Package() { - if (base_Package != null && base_Package.eIsProxy()) { - InternalEObject oldBase_Package = (InternalEObject) base_Package; - base_Package = (org.eclipse.uml2.uml.Package) eResolveProxy(oldBase_Package); - if (base_Package != oldBase_Package) { - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_SRC_FOLDER__BASE_PACKAGE, oldBase_Package, base_Package)); - } - } - } - return base_Package; - } - - /** - * - * - * - * @generated - */ - public org.eclipse.uml2.uml.Package basicGetBase_Package() { - return base_Package; - } - - /** - * - * - * - * @generated - */ - @Override - public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { - org.eclipse.uml2.uml.Package oldBase_Package = base_Package; - base_Package = newBase_Package; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_SRC_FOLDER__BASE_PACKAGE, oldBase_Package, base_Package)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JavaPackage.JAVA_SRC_FOLDER__BASE_PACKAGE: - if (resolve) { - return getBase_Package(); - } - return basicGetBase_Package(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JavaPackage.JAVA_SRC_FOLDER__BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_SRC_FOLDER__BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package) null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JavaPackage.JAVA_SRC_FOLDER__BASE_PACKAGE: - return base_Package != null; - } - return super.eIsSet(featureID); - } - -} // JavaSrcFolderImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/PrimitiveTypeImpl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/PrimitiveTypeImpl.java deleted file mode 100644 index 45fa400b2ee..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/PrimitiveTypeImpl.java +++ /dev/null @@ -1,311 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.PrimitiveType; - -/** - * - * An implementation of the model object 'Primitive Type'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl#getImplementationClass Implementation Class}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl#getBase_PrimitiveType Base Primitive Type}
  • - *
  • {@link org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl#getCollectionImplementationClass Collection Implementation Class}
  • - *
- *

- * - * @generated - */ -public class PrimitiveTypeImpl extends JavaGenImpl implements PrimitiveType { - /** - * The default value of the '{@link #getImplementationClass() Implementation Class}' attribute. - * - * - * - * @see #getImplementationClass() - * @generated - * @ordered - */ - protected static final String IMPLEMENTATION_CLASS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getImplementationClass() Implementation Class}' attribute. - * - * - * - * @see #getImplementationClass() - * @generated - * @ordered - */ - protected String implementationClass = IMPLEMENTATION_CLASS_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_PrimitiveType() Base Primitive Type}' reference. - * - * - * - * @see #getBase_PrimitiveType() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.PrimitiveType base_PrimitiveType; - - /** - * The default value of the '{@link #getCollectionImplementationClass() Collection Implementation Class}' attribute. - * - * - * - * @see #getCollectionImplementationClass() - * @generated - * @ordered - */ - protected static final String COLLECTION_IMPLEMENTATION_CLASS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getCollectionImplementationClass() Collection Implementation Class}' attribute. - * - * - * - * @see #getCollectionImplementationClass() - * @generated - * @ordered - */ - protected String collectionImplementationClass = COLLECTION_IMPLEMENTATION_CLASS_EDEFAULT; - - /** - * - * - * - * @generated - */ - protected PrimitiveTypeImpl() { - super(); - } - - /** - * - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return JavaPackage.Literals.PRIMITIVE_TYPE; - } - - /** - * - * - * - * @generated - */ - @Override - public String getImplementationClass() { - return implementationClass; - } - - /** - * - * - * - * @generated - */ - @Override - public void setImplementationClass(String newImplementationClass) { - String oldImplementationClass = implementationClass; - implementationClass = newImplementationClass; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS, oldImplementationClass, implementationClass)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.PrimitiveType getBase_PrimitiveType() { - if (base_PrimitiveType != null && base_PrimitiveType.eIsProxy()) { - InternalEObject oldBase_PrimitiveType = (InternalEObject) base_PrimitiveType; - base_PrimitiveType = (org.eclipse.uml2.uml.PrimitiveType) eResolveProxy(oldBase_PrimitiveType); - if (base_PrimitiveType != oldBase_PrimitiveType) { - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE, oldBase_PrimitiveType, base_PrimitiveType)); - } - } - } - return base_PrimitiveType; - } - - /** - * - * - * - * @generated - */ - public org.eclipse.uml2.uml.PrimitiveType basicGetBase_PrimitiveType() { - return base_PrimitiveType; - } - - /** - * - * - * - * @generated - */ - @Override - public void setBase_PrimitiveType(org.eclipse.uml2.uml.PrimitiveType newBase_PrimitiveType) { - org.eclipse.uml2.uml.PrimitiveType oldBase_PrimitiveType = base_PrimitiveType; - base_PrimitiveType = newBase_PrimitiveType; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE, oldBase_PrimitiveType, base_PrimitiveType)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public String getCollectionImplementationClass() { - return collectionImplementationClass; - } - - /** - * - * - * - * @generated - */ - @Override - public void setCollectionImplementationClass(String newCollectionImplementationClass) { - String oldCollectionImplementationClass = collectionImplementationClass; - collectionImplementationClass = newCollectionImplementationClass; - if (eNotificationRequired()) { - eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS, oldCollectionImplementationClass, collectionImplementationClass)); - } - } - - /** - * - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JavaPackage.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS: - return getImplementationClass(); - case JavaPackage.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE: - if (resolve) { - return getBase_PrimitiveType(); - } - return basicGetBase_PrimitiveType(); - case JavaPackage.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS: - return getCollectionImplementationClass(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JavaPackage.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS: - setImplementationClass((String) newValue); - return; - case JavaPackage.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE: - setBase_PrimitiveType((org.eclipse.uml2.uml.PrimitiveType) newValue); - return; - case JavaPackage.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS: - setCollectionImplementationClass((String) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JavaPackage.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS: - setImplementationClass(IMPLEMENTATION_CLASS_EDEFAULT); - return; - case JavaPackage.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE: - setBase_PrimitiveType((org.eclipse.uml2.uml.PrimitiveType) null); - return; - case JavaPackage.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS: - setCollectionImplementationClass(COLLECTION_IMPLEMENTATION_CLASS_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JavaPackage.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS: - return IMPLEMENTATION_CLASS_EDEFAULT == null ? implementationClass != null : !IMPLEMENTATION_CLASS_EDEFAULT.equals(implementationClass); - case JavaPackage.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE: - return base_PrimitiveType != null; - case JavaPackage.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS: - return COLLECTION_IMPLEMENTATION_CLASS_EDEFAULT == null ? collectionImplementationClass != null : !COLLECTION_IMPLEMENTATION_CLASS_EDEFAULT.equals(collectionImplementationClass); - } - return super.eIsSet(featureID); - } - - /** - * - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) { - return super.toString(); - } - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (implementationClass: "); - result.append(implementationClass); - result.append(", collectionImplementationClass: "); - result.append(collectionImplementationClass); - result.append(')'); - return result.toString(); - } - -} // PrimitiveTypeImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaAdapterFactory.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaAdapterFactory.java deleted file mode 100644 index 5e966089922..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaAdapterFactory.java +++ /dev/null @@ -1,321 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.java.profile.java.JavaClass; -import org.eclipse.papyrus.java.profile.java.JavaGen; -import org.eclipse.papyrus.java.profile.java.JavaMethod; -import org.eclipse.papyrus.java.profile.java.JavaNamedElement; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaPackage_; -import org.eclipse.papyrus.java.profile.java.JavaParameter; -import org.eclipse.papyrus.java.profile.java.JavaProject; -import org.eclipse.papyrus.java.profile.java.JavaProperty; -import org.eclipse.papyrus.java.profile.java.JavaSrcFolder; -import org.eclipse.papyrus.java.profile.java.PrimitiveType; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage - * @generated - */ -public class JavaAdapterFactory extends AdapterFactoryImpl { - /** - * The cached model package. - * - * - * - * @generated - */ - protected static JavaPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * - * @generated - */ - public JavaAdapterFactory() { - if (modelPackage == null) { - modelPackage = JavaPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject) object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch that delegates to the createXXX methods. - * - * - * - * @generated - */ - protected JavaSwitch modelSwitch = - new JavaSwitch() { - @Override - public Adapter caseJavaClass(JavaClass object) { - return createJavaClassAdapter(); - } - - @Override - public Adapter caseJavaGen(JavaGen object) { - return createJavaGenAdapter(); - } - - @Override - public Adapter caseJavaNamedElement(JavaNamedElement object) { - return createJavaNamedElementAdapter(); - } - - @Override - public Adapter caseJavaPackage_(JavaPackage_ object) { - return createJavaPackage_Adapter(); - } - - @Override - public Adapter caseJavaMethod(JavaMethod object) { - return createJavaMethodAdapter(); - } - - @Override - public Adapter caseJavaParameter(JavaParameter object) { - return createJavaParameterAdapter(); - } - - @Override - public Adapter caseJavaProperty(JavaProperty object) { - return createJavaPropertyAdapter(); - } - - @Override - public Adapter casePrimitiveType(PrimitiveType object) { - return createPrimitiveTypeAdapter(); - } - - @Override - public Adapter caseJavaProject(JavaProject object) { - return createJavaProjectAdapter(); - } - - @Override - public Adapter caseJavaSrcFolder(JavaSrcFolder object) { - return createJavaSrcFolderAdapter(); - } - - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * - * @param target - * the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject) target); - } - - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaClass Class}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.profile.java.JavaClass - * @generated - */ - public Adapter createJavaClassAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaGen Gen}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.profile.java.JavaGen - * @generated - */ - public Adapter createJavaGenAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement Named Element}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement - * @generated - */ - public Adapter createJavaNamedElementAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaPackage_ Package }'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.profile.java.JavaPackage_ - * @generated - */ - public Adapter createJavaPackage_Adapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaMethod Method}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.profile.java.JavaMethod - * @generated - */ - public Adapter createJavaMethodAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaParameter Parameter}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.profile.java.JavaParameter - * @generated - */ - public Adapter createJavaParameterAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaProperty Property}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.profile.java.JavaProperty - * @generated - */ - public Adapter createJavaPropertyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType Primitive Type}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.profile.java.PrimitiveType - * @generated - */ - public Adapter createPrimitiveTypeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaProject Project}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.profile.java.JavaProject - * @generated - */ - public Adapter createJavaProjectAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder Src Folder}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * - * @return the new adapter. - * @see org.eclipse.papyrus.java.profile.java.JavaSrcFolder - * @generated - */ - public Adapter createJavaSrcFolderAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } - -} // JavaAdapterFactory diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceFactoryImpl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceFactoryImpl.java deleted file mode 100644 index 38cc336adf6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceFactoryImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.util; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; -import org.eclipse.emf.ecore.xmi.XMLResource; - -/** - * - * The Resource Factory associated with the package. - * - * - * @see org.eclipse.papyrus.java.profile.java.util.JavaResourceImpl - * @generated - */ -public class JavaResourceFactoryImpl extends ResourceFactoryImpl { - /** - * Creates an instance of the resource factory. - * - * - * - * @generated - */ - public JavaResourceFactoryImpl() { - super(); - } - - /** - * Creates an instance of the resource. - * - * - * - * @generated - */ - @Override - public Resource createResource(URI uri) { - XMLResource result = new JavaResourceImpl(uri); - result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); - result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); - - result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE); - - result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); - result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); - - result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE); - return result; - } - -} // JavaResourceFactoryImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceImpl.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceImpl.java deleted file mode 100644 index 6f18c504479..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.util; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; - -/** - * - * The Resource associated with the package. - * - * - * @see org.eclipse.papyrus.java.profile.java.util.JavaResourceFactoryImpl - * @generated - */ -public class JavaResourceImpl extends XMLResourceImpl { - /** - * Creates an instance of the resource. - * - * - * - * @param uri - * the URI of the new resource. - * @generated - */ - public JavaResourceImpl(URI uri) { - super(uri); - } - -} // JavaResourceImpl diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaSwitch.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaSwitch.java deleted file mode 100644 index 85d4994bcb2..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaSwitch.java +++ /dev/null @@ -1,400 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.util; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.util.Switch; -import org.eclipse.papyrus.java.profile.java.JavaClass; -import org.eclipse.papyrus.java.profile.java.JavaGen; -import org.eclipse.papyrus.java.profile.java.JavaMethod; -import org.eclipse.papyrus.java.profile.java.JavaNamedElement; -import org.eclipse.papyrus.java.profile.java.JavaPackage; -import org.eclipse.papyrus.java.profile.java.JavaPackage_; -import org.eclipse.papyrus.java.profile.java.JavaParameter; -import org.eclipse.papyrus.java.profile.java.JavaProject; -import org.eclipse.papyrus.java.profile.java.JavaProperty; -import org.eclipse.papyrus.java.profile.java.JavaSrcFolder; -import org.eclipse.papyrus.java.profile.java.PrimitiveType; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * - * @see org.eclipse.papyrus.java.profile.java.JavaPackage - * @generated - */ -public class JavaSwitch extends Switch { - /** - * The cached model package - * - * - * - * @generated - */ - protected static JavaPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * - * @generated - */ - public JavaSwitch() { - if (modelPackage == null) { - modelPackage = JavaPackage.eINSTANCE; - } - } - - /** - * Checks whether this is a switch for the given package. - * - * - * - * @parameter ePackage the package in question. - * @return whether this is a switch for the given package. - * @generated - */ - @Override - protected boolean isSwitchFor(EPackage ePackage) { - return ePackage == modelPackage; - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - @Override - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case JavaPackage.JAVA_CLASS: { - JavaClass javaClass = (JavaClass) theEObject; - T result = caseJavaClass(javaClass); - if (result == null) { - result = caseJavaGen(javaClass); - } - if (result == null) { - result = caseJavaNamedElement(javaClass); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JavaPackage.JAVA_GEN: { - JavaGen javaGen = (JavaGen) theEObject; - T result = caseJavaGen(javaGen); - if (result == null) { - result = caseJavaNamedElement(javaGen); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JavaPackage.JAVA_NAMED_ELEMENT: { - JavaNamedElement javaNamedElement = (JavaNamedElement) theEObject; - T result = caseJavaNamedElement(javaNamedElement); - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JavaPackage.JAVA_PACKAGE_: { - JavaPackage_ javaPackage_ = (JavaPackage_) theEObject; - T result = caseJavaPackage_(javaPackage_); - if (result == null) { - result = caseJavaGen(javaPackage_); - } - if (result == null) { - result = caseJavaNamedElement(javaPackage_); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JavaPackage.JAVA_METHOD: { - JavaMethod javaMethod = (JavaMethod) theEObject; - T result = caseJavaMethod(javaMethod); - if (result == null) { - result = caseJavaNamedElement(javaMethod); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JavaPackage.JAVA_PARAMETER: { - JavaParameter javaParameter = (JavaParameter) theEObject; - T result = caseJavaParameter(javaParameter); - if (result == null) { - result = caseJavaNamedElement(javaParameter); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JavaPackage.JAVA_PROPERTY: { - JavaProperty javaProperty = (JavaProperty) theEObject; - T result = caseJavaProperty(javaProperty); - if (result == null) { - result = caseJavaNamedElement(javaProperty); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JavaPackage.PRIMITIVE_TYPE: { - PrimitiveType primitiveType = (PrimitiveType) theEObject; - T result = casePrimitiveType(primitiveType); - if (result == null) { - result = caseJavaGen(primitiveType); - } - if (result == null) { - result = caseJavaNamedElement(primitiveType); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JavaPackage.JAVA_PROJECT: { - JavaProject javaProject = (JavaProject) theEObject; - T result = caseJavaProject(javaProject); - if (result == null) { - result = caseJavaGen(javaProject); - } - if (result == null) { - result = caseJavaNamedElement(javaProject); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - case JavaPackage.JAVA_SRC_FOLDER: { - JavaSrcFolder javaSrcFolder = (JavaSrcFolder) theEObject; - T result = caseJavaSrcFolder(javaSrcFolder); - if (result == null) { - result = caseJavaGen(javaSrcFolder); - } - if (result == null) { - result = caseJavaNamedElement(javaSrcFolder); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } - default: - return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'Class'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Class'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaClass(JavaClass object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Gen'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Gen'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaGen(JavaGen object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Named Element'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Named Element'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaNamedElement(JavaNamedElement object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Package '. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Package '. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaPackage_(JavaPackage_ object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Method'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Method'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaMethod(JavaMethod object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Parameter'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Parameter'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaParameter(JavaParameter object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Property'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Property'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaProperty(JavaProperty object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Primitive Type'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Primitive Type'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePrimitiveType(PrimitiveType object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Project'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Project'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaProject(JavaProject object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Src Folder'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'Src Folder'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaSrcFolder(JavaSrcFolder object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * - * @param object - * the target of the switch. - * @return the result of interpreting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - @Override - public T defaultCase(EObject object) { - return null; - } - -} // JavaSwitch diff --git a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaXMLProcessor.java b/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaXMLProcessor.java deleted file mode 100644 index 117391bb1f6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaXMLProcessor.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * - * - * - * $Id$ - */ -package org.eclipse.papyrus.java.profile.java.util; - -import java.util.Map; - -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.xmi.util.XMLProcessor; -import org.eclipse.papyrus.java.profile.java.JavaPackage; - -/** - * This class contains helper methods to serialize and deserialize XML documents - * - * - * - * @generated - */ -public class JavaXMLProcessor extends XMLProcessor { - - /** - * Public constructor to instantiate the helper. - * - * - * - * @generated - */ - public JavaXMLProcessor() { - super((EPackage.Registry.INSTANCE)); - JavaPackage.eINSTANCE.eClass(); - } - - /** - * Register for "*" and "xml" file extensions the JavaResourceFactoryImpl factory. - * - * - * - * @generated - */ - @Override - protected Map getRegistrations() { - if (registrations == null) { - super.getRegistrations(); - registrations.put(XML_EXTENSION, new JavaResourceFactoryImpl()); - registrations.put(STAR_EXTENSION, new JavaResourceFactoryImpl()); - } - return registrations; - } - -} // JavaXMLProcessor diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.classpath b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.project b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.project deleted file mode 100644 index 6456ba27df1..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.java.reverse.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.core.resources.prefs b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 2697efedfa3..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,3 +0,0 @@ -eclipse.preferences.version=1 -encoding//src/org/eclipse/papyrus/java/reverse/ui/dnd/messages.properties=ISO-8859-1 -encoding//src/org/eclipse/papyrus/java/reverse/ui/messages.properties=ISO-8859-1 diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.core.prefs b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94d61f00da6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/META-INF/MANIFEST.MF b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/META-INF/MANIFEST.MF deleted file mode 100644 index b24c01b97bd..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.emf.transaction;bundle-version="1.2.0", - org.eclipse.gef;bundle-version="3.4.0", - org.eclipse.jdt.core;bundle-version="3.4.0", - org.eclipse.papyrus.java.reverse;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core;bundle-version="1.2.0", - org.eclipse.papyrus.uml.tools;bundle-version="1.2.0", - org.eclipse.gmf.runtime.diagram.core, - org.eclipse.papyrus.infra.gmfdiag.dnd;bundle-version="1.2.0", - org.eclipse.papyrus.infra.emf.diagram.common;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.java.reverse.ui.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.java.reverse.ui;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/about.html b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/build.properties b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/build.properties deleted file mode 100644 index 1dc01a0a02a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/build.properties +++ /dev/null @@ -1,11 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - icons/,\ - plugin.properties,\ - about.html -src.includes = .classpath,\ - about.html,\ - build.properties diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/icons/associationFromProperty.gif b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/icons/associationFromProperty.gif deleted file mode 100644 index b4fbec9c849..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/icons/associationFromProperty.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/icons/javaReverse.gif b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/icons/javaReverse.gif deleted file mode 100644 index 68d40f7e2d5..00000000000 Binary files a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/icons/javaReverse.gif and /dev/null differ diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/plugin.properties b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/plugin.properties deleted file mode 100644 index fba264cf201..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/plugin.properties +++ /dev/null @@ -1,16 +0,0 @@ - -################################################################################# -# Copyright (c) 2010-2013 Cedric Dumoulin. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API -# -################################################################################# - -pluginName = Java Reverse UI (Incubation) -providerName = Eclipse Modeling Project diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/plugin.xml b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/plugin.xml deleted file mode 100644 index 6e744e206e8..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/plugin.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/pom.xml b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/pom.xml deleted file mode 100644 index 6d3e48ae13f..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.java.reverse.ui - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Activator.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Activator.java deleted file mode 100644 index 2ac94758559..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Activator.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.papyrus.java.reverse.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.java.reverse.ui"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DisplayReverse.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DisplayReverse.java deleted file mode 100644 index caac0a8c995..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DisplayReverse.java +++ /dev/null @@ -1,181 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Jonathan Geoffroy. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Geoffroy geoffroy.jonathan@gmail.com initial implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.reverse.ui; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.emf.common.util.TreeIterator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.gmf.runtime.diagram.core.services.ViewService; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.uml2.uml.Model; -import org.eclipse.uml2.uml.NamedElement; - -/** - * Command which allow to display java elements into papyrus diagram. - * The java element must exists into papyrus model (for example by using reverse plugin) - * - * @author Jonathan Geoffroy - * - */ -public class DisplayReverse { - - private static final String MODEL_TYPE = "2005", PACKAGE_TYPE = "2007", CU_TYPE = "2008"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - - /** - * items to display into papyrus diagram - */ - private List items; - - /** - * Contains all uml resources. - * Used to improve research into umlModel. - */ - private Map umlModelNames; - - /** - * Graphical container for the reverse result - */ - private Diagram diagram; - - /** - * model to display into diagram. Null if user doesn't want to display any model - */ - private Model model; - - /** - * Constructor. - * - * @param items - * items to display into papyrus diagram - * @param diagram - * container where to display items - * @param umlModel - * resource representing the papyrus uml model - * @param model - * model to display into diagram. Null if user doesn't want to display any model - */ - public DisplayReverse(List items, Diagram diagram, Resource umlModel, Model model) { - super(); - this.items = items; - this.diagram = diagram; - this.model = model; - - // Change uml model collection to improve search - umlModelNames = new HashMap(); - TreeIterator tree = umlModel.getAllContents(); - while (tree.hasNext()) { - for (EObject o : tree.next().eContents()) { - /* - * Only add reversable elements. - * The non Named element cannot been added into model (comments ...) - */ - if (o instanceof NamedElement) { - // Add it into items to display - NamedElement e = (NamedElement) o; - umlModelNames.put(e.getName(), e); - } - } - } - - - } - - /** - * Execute the display command. - * Should call this method when you want display the selection into papyrus diagram. - * - * @throws JavaModelException - */ - public void execute() throws JavaModelException { - // Display the model - if (model != null) { - display(model.getName(), MODEL_TYPE); - } - - // Cross selection to display each selected item - for (IJavaElement item : items) { - scanJavaElement(item); - } - } - - /** - * Scan a Compilation Unit item - * Just display it - * - * @param item - * a selection compilation unit - */ - private void scanCU(ICompilationUnit item) { - String itemName = item.getElementName().substring(0, item.getElementName().length() - 5); // remove ".java" to the compilation unit name - display(itemName, CU_TYPE); - } - - /** - * Scan a package. - * Display it and cross its childs to display all sub-packages (and recursively) - * - * @param item - * the package to scan - * @throws JavaModelException - */ - private void scanPackage(IPackageFragment item) throws JavaModelException { - String itemName = item.getElementName(); - display(itemName, PACKAGE_TYPE); - } - - /** - * scan and display a JavaElement by delegates to scan{typeOfJavaElement} - * - * @param item - * the item to display - * @throws JavaModelException - */ - private void scanJavaElement(IJavaElement item) throws JavaModelException { - try { - switch (item.getElementType()) { - case IJavaElement.PACKAGE_FRAGMENT: - scanPackage((IPackageFragment) item); - break; - case IJavaElement.COMPILATION_UNIT: - scanCU((ICompilationUnit) item); - break; - } - } catch (NullPointerException e) { - System.err.println(item.getElementName() + "is NOT in selected uml model"); //$NON-NLS-1$ - } - } - - /** - * Display an element into papyrus diagram - * - * @param itemName - * the name of element to display - */ - private void display(String itemName, String type) { - EObject item = this.umlModelNames.get(itemName); - if (!diagram.getChildren().contains(item)) { - ViewService.createNode(diagram, item, type, new PreferencesHint("org.eclipse.papyrus.uml.diagram.clazz")); //$NON-NLS-1$ - } - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DndReverseCodeHandler.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DndReverseCodeHandler.java deleted file mode 100644 index 5c5568282c7..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DndReverseCodeHandler.java +++ /dev/null @@ -1,246 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Jonathan Geoffroy. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Geoffroy geoffroy.jonathan@gmail.com initial implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.java.reverse.ui; - -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import java.util.TreeSet; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.TreeIterator; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.impl.ShapeImpl; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.TreeSelection; -import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor; -import org.eclipse.papyrus.java.reverse.ui.dialog.DndReverseCodeDialog; -import org.eclipse.papyrus.java.reverse.ui.dialog.ReverseCodeDialog; -import org.eclipse.papyrus.uml.diagram.common.util.MDTUtil; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; -import org.eclipse.uml2.uml.Model; -import org.eclipse.uml2.uml.NamedElement; - -/** - * Handler to display reverse result into current papyrus diagram - * This Handler is activated when user drag'n'drop java resource into papyrus diagram.
- * It display just non displayed java resource. - * Moreover, it use DndReverseCodeDialog to know if it have to display model, packages and CompilationUnit or not. - * - * @author Jonathan Geoffroy - * - */ -public class DndReverseCodeHandler extends ReverseCodeHandler { - - /** - * true if and only if user want to display reversed compilation unit - */ - private boolean displayCU; - - /** - * true if and only if user want to display reversed packages - */ - private boolean displayPackages; - - /** - * true if and only if user want to display reversed model - */ - private boolean displayModel; - - @Override - /** - * Find all resource to display (selection - resources which are already in the diagram), run the reverse command, before running the display command
- * @see org.eclipse.papyrus.java.reverse.ui.ReverseCodeHandler#doExecute(org.eclipse.papyrus.java.reverse.ui.dialog.ReverseCodeDialog) - * - * @param dialog - */ - protected void doExecute(ReverseCodeDialog dialog) { - // Get user preferences on dialog - DndReverseCodeDialog dndDialog = (DndReverseCodeDialog) dialog; - displayModel = dndDialog.displayModel(); - displayPackages = dndDialog.displayPackages(); - displayCU = dndDialog.displayCU(); - - // get current selection - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - ISelection selection = page.getSelection(); - TreeSelection treeSelection = (TreeSelection) selection; - - // Find active papyrus diagram - Diagram diagram = null; - IEditorPart activeEditor = MDTUtil.getActiveEditor(); - if (activeEditor != null) { - if (activeEditor instanceof IMultiDiagramEditor) { - diagram = (Diagram) ((IMultiDiagramEditor) activeEditor).getAdapter(Diagram.class); - } - } - - // Remove items already in diagram from selection - List listSelection; - try { - listSelection = selectionMinusAlreadyInDiagram(treeSelection, diagram); - } catch (JavaModelException e1) { - e1.printStackTrace(); - return; - } - - // Run the reverse - super.doExecute(dialog); - - // Find model to display - Model model = null; - if (displayModel) { - String modelName = dndDialog.getValue(); - model = getModelToDisplay(diagram, modelName); - } - - // Run the reverse displayer - DisplayReverse displayReverse = new DisplayReverse(listSelection, diagram, getUmlResource(), model); - try { - displayReverse.execute(); - } catch (JavaModelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - @Override - protected ReverseCodeDialog getDialog(Shell shell, String modelUid) { - return new DndReverseCodeDialog(shell, modelUid, null, null); - } - - /** - * - * @param selection - * java resources selected - * @param diagram - * opened papyrus diagram - * @return selection - resources already in diagram - * @throws JavaModelException - */ - private List selectionMinusAlreadyInDiagram(TreeSelection selection, Diagram diagram) throws JavaModelException { - // Add all diagram elements to Set - TreeSet alreadyExists = new TreeSet(); - EList diagramList = diagram.getChildren(); - Iterator diagramIt = diagramList.iterator(); - ShapeImpl item; - NamedElement e; - while (diagramIt.hasNext()) { - item = (ShapeImpl) diagramIt.next(); - e = (NamedElement) (item.getElement()); - alreadyExists.add(e.getName()); - } - - // remove all elements of Set from selection - TreeSelectionList selectionList = new TreeSelectionList(selection, displayPackages, displayCU); - ListIterator selectionIterator = selectionList.listIterator(); - String selectionItemName; - while (selectionIterator.hasNext()) { - selectionItemName = getName(selectionIterator.next()); - if (selectionItemName != null && alreadyExists.contains(selectionItemName)) { - selectionIterator.remove(); - } - } - - return selectionList; - } - - /** - * Find the name of item For java compilation unit, remove ".java" extension - * - * @param item - * @return the name of item. - */ - private String getName(IJavaElement item) { - String name = item.getElementName(); - if (item instanceof ICompilationUnit) { - return name.substring(0, name.length() - 5); - } - return name; - } - - /** - * find a model named modelName - * - * @param modelName - * the name of the model the find - * @return the model which named modelName, or null if it doesn't exists into the current papyrus uml resource - */ - public Model getModel(String modelName) { - TreeIterator tree = getUmlResource().getAllContents(); - while (tree.hasNext()) { - for (EObject o : tree.next().eContents()) { - if (o instanceof Model) { - // Add it into items to display - Model model = (Model) o; - - // Search for model - if (model.getName().equals(modelName)) { - System.out.println("model = " + model); - return model; - } - } - } - } - System.out.println("model = null"); - return null; - } - - /** - * find the model named modelName, and get it only if it has to be displayed - * - * @param diagram - * active papyrus diagram - * @param modelName - * the name of the model to find - * @return model corresponding to the modelName if it has to be displayed, i.e. if it doesn't already displayed into the diagram, or null - * otherwise - */ - private Model getModelToDisplay(Diagram diagram, String modelName) { - Model model = getModel(modelName); - if (model != null && !isInDiagram(diagram, model)) { - System.out.println("display model " + model); - return model; - } - System.out.println("don't display model"); - return null; - } - - /** - * - * @param diagram - * @param model - * @return true if model is in diagram - */ - private boolean isInDiagram(Diagram diagram, Model model) { - EList diagramList = diagram.getChildren(); - Iterator diagramIt = diagramList.iterator(); - ShapeImpl item; - while (diagramIt.hasNext()) { - item = (ShapeImpl) diagramIt.next(); - if (item.getElement() == model) { - return true; - } - } - return false; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/JavaCodeReverse.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/JavaCodeReverse.java deleted file mode 100644 index a9190952dcc..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/JavaCodeReverse.java +++ /dev/null @@ -1,287 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.java.reverse.ui; - -import japa.parser.JavaParser; -import japa.parser.ParseException; -import japa.parser.ast.CompilationUnit; - -import java.io.StringReader; -import java.util.Iterator; -import java.util.List; - -import javagen.umlparser.CompilationUnitAnalyser; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.ITypeRoot; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.TreeSelection; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; -import org.eclipse.uml2.uml.Package; - -/** - * @author dumoulin - * - */ -public class JavaCodeReverse { - - CompilationUnitAnalyser javaAnalyser; - - /** - * Constructor. - * - * @param model - */ - public JavaCodeReverse(Resource model) { - javaAnalyser = new CompilationUnitAnalyser(model); - } - - /** - * Constructor. - * - * @param model - */ - public JavaCodeReverse(Package rootPackage, String generatedPackageName, List searchPaths) { - javaAnalyser = new CompilationUnitAnalyser(rootPackage, generatedPackageName, searchPaths); - } - - - /** - * @throws CoreException - * @throws ParseException - * - */ - public void reverseResource(IResource resource) throws ParseException, CoreException { - System.out.println("reverseResource(" + resource.getName() + ")"); - - if (resource instanceof IFile) { - reverseFile((IFile) resource); - } else if (resource instanceof IFolder) { - reverseFolder((IFolder) resource); - } else if (resource instanceof IProject) { - reverseProject((IProject) resource); - } - - } - - /** - * Walk throw each file in folder - * - * @param resource - * @param model - * @throws CoreException - * @throws ParseException - */ - private void reverseFolder(IFolder folder) throws CoreException, ParseException { - - for (IResource resource : folder.members()) { - reverseResource(resource); - } - - } - - /** - * Walk throw each file in folder - * - * @param resource - * @param model - * @throws CoreException - * @throws ParseException - */ - private void reverseProject(IProject folder) throws CoreException, ParseException { - - for (IResource resource : folder.members()) { - reverseResource(resource); - } - - } - - /** - * Reverse a file - * - * @param resource - * @throws CoreException - * @throws ParseException - */ - private void reverseFile(IFile file) throws ParseException, CoreException { - System.out.println("try to reverseFile(" + file.getName() + ")"); - if (!"java".equals(file.getFileExtension())) { - return; - } - - System.out.println("reverseFile(" + file.getName() + ")"); - - CompilationUnit cu = JavaParser.parse(file.getContents()); - javaAnalyser.processCompilationUnit(cu); - } - - /** - * @throws CoreException - * @throws ParseException - * - */ - public void reverseJavaElement(IJavaElement element) throws ParseException, CoreException - { - System.out.println("reverseJavaElement(" + element.getElementName() + ")"); - - if (element instanceof ITypeRoot) - { - reverseCompilationUnit((ITypeRoot) element); - } - else if (element instanceof IPackageFragment) - { - reversePackageFragment((IPackageFragment) element); - } - else if (element instanceof IPackageFragmentRoot) - { - reversePackageFragmentRoot((IPackageFragmentRoot) element); - } - else - { - System.err.println("Can't reverse Java Element " + element); - } - - } - - /** - * - * @param element - * @throws ParseException - * @throws CoreException - */ - private void reversePackageFragmentRoot(IPackageFragmentRoot element) throws ParseException, CoreException { - - System.out.println("reversePackageFragmentRoot(" + element.getElementName() + ")"); - - IJavaElement[] children = element.getChildren(); - for (IJavaElement child : children) { - reverseJavaElement(child); - } - - } - - /** - * - * @param element - * @throws ParseException - * @throws CoreException - */ - private void reversePackageFragment(IPackageFragment element) throws ParseException, CoreException { - - System.out.println("reversePackageFragment(" + element.getElementName() + ")"); - - IJavaElement[] children = element.getChildren(); - for (IJavaElement child : children) { - reverseJavaElement(child); - } - } - - /** - * Reverse a file - * - * @param resource - * @throws CoreException - * @throws ParseException - */ - private void reverseCompilationUnit(ITypeRoot unit) throws ParseException, CoreException { - System.out.println("try to reverseUnit(" + unit.getElementName() + ")"); - System.out.println("file type=(" + unit.getElementType() + ")"); - - String source = unit.getSource(); - if (source == null) - { - System.err.println("No source attached to unit '" + unit.getElementName() + "'"); - return; - } - - - CompilationUnit cu = JavaParser.parse(new StringReader(source)); - javaAnalyser.processCompilationUnit(cu); - } - - /** - * Real Implementation of the command. - * - * @param generationPackageName - * @param searchPaths - */ - public void executeCodeReverse(Resource umlResource, String generationPackageName, List searchPaths) { - System.out.println("executeCodeReverse()"); - - // Get current selection - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - ISelection selection = page.getSelection(); - - TreeSelection treeSelection = (TreeSelection) selection; - // String filename = treeSelection. - @SuppressWarnings("rawtypes") - Iterator iter = treeSelection.iterator(); - while (iter.hasNext()) { - Object obj = iter.next(); - // Translate java ICompilationUnit to Iresource - if (obj instanceof ICompilationUnit) { - ICompilationUnit u = (ICompilationUnit) obj; - try { - obj = u.getCorrespondingResource(); - } catch (JavaModelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - if (obj instanceof IPackageFragment) - { - IPackageFragment u = (IPackageFragment) obj; - try { - IResource res = u.getCorrespondingResource(); - if (res != null) { - obj = res; - } - } catch (JavaModelException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - // This happen when selection is an element from a jar - if (obj instanceof IJavaElement) - { - IJavaElement u = (IJavaElement) obj; - try { - - reverseJavaElement(u); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - // This is a regular java file - if (obj instanceof IResource) - { - try { - reverseResource((IResource) obj); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - - System.out.println("reverse done"); - - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Messages.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Messages.java deleted file mode 100644 index 38577506c0d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Messages.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.eclipse.papyrus.java.reverse.ui; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - - private static final String BUNDLE_NAME = "org.eclipse.papyrus.java.reverse.ui.messages"; //$NON-NLS-1$ - - public static String ReverseCodeHandler_NoModelError_Message; - - public static String ReverseCodeHandler_NoModelError_Title; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/ReverseCodeHandler.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/ReverseCodeHandler.java deleted file mode 100644 index 433344eba35..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/ReverseCodeHandler.java +++ /dev/null @@ -1,196 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.java.reverse.ui; - -import java.util.Arrays; -import java.util.List; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.window.Window; -import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.utils.EditorUtils; -import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers; -import org.eclipse.papyrus.java.reverse.ui.dialog.ReverseCodeDialog; -import org.eclipse.papyrus.uml.tools.model.UmlUtils; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.uml2.uml.Package; - - -/** - * @author dumoulin - * - */ -public class ReverseCodeHandler extends AbstractHandler implements IHandler { - - private static String DefaultGenerationModeleName = "generated"; - - /** - * Method called when button is pressed. - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - // Try to find uml resource - final Resource umlResource; - try { - umlResource = getUmlResource(); - } catch (NullPointerException e) { - // No uml resource available. User must open a model. We open an error dialog with an explicit message to advice user. - Shell shell = HandlerUtil.getActiveShell(event); - Status errorStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ReverseCodeHandler_NoModelError_Title); - ErrorDialog.openError(shell, "", Messages.ReverseCodeHandler_NoModelError_Message, errorStatus); - - // Stop the reverse execution. - return null; - } - ; - - String modelUid = getModelUid(umlResource); - System.out.println("Model uid :" + modelUid); - - // Get reverse parameters from a dialog - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart().getSite().getShell(); - // ReverseCodeDialog dialog = new ReverseCodeDialog(shell, DefaultGenerationPackageName, Arrays.asList("generated") ); - final ReverseCodeDialog dialog = getDialog(shell, modelUid); - - int res = dialog.open(); - // System.out.println("dialog result =" + res); - if (res == Window.CANCEL) { - System.out.println("Canceled by user."); - return null; - } - - // Execute the reverse with provided parameters - TransactionalEditingDomain editingDomain; - try { - editingDomain = getEditingDomain(); - } catch (ServiceException e) { - // Can't get editing domain - e.printStackTrace(); - throw new ExecutionException(e.getMessage()); - } - - RecordingCommand command = new RecordingCommand(editingDomain, "Reverse Java Code") { - - @Override - protected void doExecute() { - ReverseCodeHandler.this.doExecute(dialog); - } - - }; - - editingDomain.getCommandStack().execute(command); - - - return null; - } - - /** - * Find the modelUid name contains into umlResource taken in parameter - * - * @param umlResource - * @return the modelUid name - */ - private String getModelUid(Resource umlResource) { - // Try to compute a uid identifying the model. Used to store user settings. - String modelUid = umlResource.getURI().toPlatformString(true); - if (modelUid == null) { - System.err.println("Can't compute relatif model uid. Use absolute one"); - modelUid = umlResource.getURI().path(); - } - return modelUid; - } - - /** - * Command ran in a RecordingCommand, after the dialog - * Run the @link{JavaCodeReverse.executeCodeReverse} - * Shall be override to change command behavior - */ - protected void doExecute(ReverseCodeDialog dialog) { - // Create searchpaths. Add the rootmodelname as prefix. - final List searchPaths = Arrays.asList(dialog.getSearchPath()); - Resource umlResource = getUmlResource(); - String packageName = getPackageName(dialog); - JavaCodeReverse reverse = new JavaCodeReverse(getRootPackage(umlResource), packageName, searchPaths); - reverse.executeCodeReverse(umlResource, packageName, searchPaths); - } - - /** - * The dialog used for user. - * - * @param shell - * @param modelUid - * @return the dialog to show to user - */ - protected ReverseCodeDialog getDialog(Shell shell, String modelUid) { - return new ReverseCodeDialog(shell, modelUid, null, null); - } - - /** - * Find the name of the model provided by the dialog - * - * @param dialog - * opened dialog to user - * @return the name of the model. If the user has changed this name, return the name provided by the user; return the default model name - * otherwise. - */ - protected String getPackageName(ReverseCodeDialog dialog) { - String generationPackageName = dialog.getValue(); - if (generationPackageName == null || generationPackageName.length() == 0) { - generationPackageName = DefaultGenerationModeleName; - } - return generationPackageName; - } - - /** - * Get the uml resource used by the model. - * - * @return the Uml Resource - */ - protected Resource getUmlResource() { - Resource umlResource = UmlUtils.getUmlModel().getResource(); - return umlResource; - } - - /** - * Get the name of the root model. - * - * @return - */ - protected Package getRootPackage(Resource umlResource) { - Package rootPackage = (Package) umlResource.getContents().get(0); - return rootPackage; - } - - /** - * Get the current MultiDiagramEditor. - * - * @return - */ - protected IMultiDiagramEditor getMultiDiagramEditor() { - return EditorUtils.getMultiDiagramEditor(); - } - - /** - * Get the main editing doamin. - * - * @return - * @throws ServiceException - */ - protected TransactionalEditingDomain getEditingDomain() throws ServiceException { - return ServiceUtilsForActionHandlers.getInstance().getTransactionalEditingDomain(); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/TreeSelectionList.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/TreeSelectionList.java deleted file mode 100644 index 370a9c0319e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/TreeSelectionList.java +++ /dev/null @@ -1,153 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Jonathan Geoffroy. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Geoffroy geoffroy.jonathan@gmail.com initial implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.java.reverse.ui; - -import java.util.Iterator; -import java.util.LinkedList; - -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jface.viewers.TreeSelection; - -/** - * Transform a TreeSelection collection, provided by java resource selection, into a java List (java.util.List).
- * Add each element of TreeSelection which have to be displayed. i.e. include packages if includePackages == true; include compilation - * unit if inclupdeCU == true
- * Note the each element of TreeSelection is a IJavaElement. - * - * @author Jonathan Geoffroy - * - */ -public class TreeSelectionList extends LinkedList { - - /** - * - */ - private static final long serialVersionUID = -5749380826507346600L; - - /** - * True if and only if this list includes packages - */ - private boolean includePackages; - - /** - * True if and only if this list includes packages - */ - private boolean includeCU; - - /** - * - * Constructor. - * - * @param treeSelection - * java resources selection - * @param includePackages - * True if and only if this list includes packages from treeSelection - * @param includeCU - * True if and only if this list includes compilation units from treeSelection - * @throws JavaModelException - */ - public TreeSelectionList(TreeSelection treeSelection, boolean includePackages, boolean includeCU) throws JavaModelException { - super(); - this.includePackages = includePackages; - this.includeCU = includeCU; - - // Add each treeSelection item into the list - addAll(treeSelection); - } - - /** - * - * @param selection - * @throws JavaModelException - */ - private void addAll(TreeSelection selection) throws JavaModelException { - Iterator selectionIterator = selection.iterator(); - while (selectionIterator.hasNext()) { - IJavaElement item = selectionIterator.next(); - scanJavaElement(item); - } - } - - /** - * Scan a Compilation Unit item - * Just add it if it's necessary - * - * @param item - * a selection compilation unit - */ - private void scanCU(ICompilationUnit item) { - if (includeCU) { - add(item); - } - } - - /** - * Scan a package. - * add it if it's necessary and cross its childs to display all sub-packages (and recursively) - * - * @param item - * the package to scan - * @throws JavaModelException - */ - private void scanPackage(IPackageFragment item) throws JavaModelException { - if (includePackages) { - add(item); - } - - // Recursive search in tree - for (IJavaElement child : item.getChildren()) { - scanJavaElement(child); - } - } - - /** - * Scan a source folder. - * add its childs (and recursively) by calling scanJavaElement on each child - * - * @param item - * the folder to scan - * @throws JavaModelException - */ - private void scanFolder(IPackageFragmentRoot item) throws JavaModelException { - // Recursive search in tree - for (IJavaElement child : item.getChildren()) { - scanJavaElement(child); - } - } - - /** - * scan and add a JavaElement by delegates to scan{typeOfJavaElement} - * - * @param item - * the item to display - * @throws JavaModelException - */ - private void scanJavaElement(IJavaElement item) throws JavaModelException { - switch (item.getElementType()) { - case IJavaElement.PACKAGE_FRAGMENT_ROOT: - scanFolder((IPackageFragmentRoot) item); - break; - case IJavaElement.PACKAGE_FRAGMENT: - scanPackage((IPackageFragment) item); - break; - case IJavaElement.COMPILATION_UNIT: - scanCU((ICompilationUnit) item); - break; - } - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/DndReverseCodeDialog.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/DndReverseCodeDialog.java deleted file mode 100644 index 05180af829d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/DndReverseCodeDialog.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.eclipse.papyrus.java.reverse.ui.dialog; - -import java.util.List; - -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.papyrus.java.reverse.ui.Activator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; - - -public class DndReverseCodeDialog extends ReverseCodeDialog { - - private static final String DISPLAY_MODEL_UID = ":DISPLAY_MODEL"; //$NON-NLS-1$ - private static final String DISPLAY_PACKAGES_UID = ":DISPLAY_PACKAGES"; //$NON-NLS-1$ - private static final String DISPLAY_CU_UID = ":DISPLAY_CU"; //$NON-NLS-1$ - private Button displayModelCheckbox; - private Button displayPackagesCheckbox; - private Button displayCUCheckbox; - - private boolean displayModel; - private boolean displayPackages; - private boolean displayCU; - - public DndReverseCodeDialog(Shell parentShell, String modelUid, String initialValue, List searchPathsInitialValues) { - super(parentShell, modelUid, initialValue, searchPathsInitialValues); - - } - - @Override - protected Control createDialogArea(Composite parent) { - IDialogSettings settings = Activator.getDefault().getDialogSettings(); - Composite composite = (Composite) super.createDialogArea(parent); - - // Create button to display or not the model - displayModelCheckbox = new Button(composite, SWT.CHECK); - displayModelCheckbox.setText("Display reversed Model into diagram"); - displayModelCheckbox.setSelection(settings.getBoolean(MODEL_UID + DISPLAY_MODEL_UID)); - - // Create button to display or not package - displayPackagesCheckbox = new Button(composite, SWT.CHECK); - displayPackagesCheckbox.setText("Display reversed UML::packages into diagram"); - displayPackagesCheckbox.setSelection(settings.getBoolean(MODEL_UID + DISPLAY_PACKAGES_UID)); - - // Create button to display or not CompilationUnit - displayCUCheckbox = new Button(composite, SWT.CHECK); - displayCUCheckbox.setText("Display UML::classes, UML::interfaces, UML::enumerations into diagram"); - displayCUCheckbox.setSelection(settings.getBoolean(MODEL_UID + DISPLAY_CU_UID)); - - return composite; - } - - @Override - protected void okPressed() { - // add selection into fields to prevent dialog disposing - displayModel = displayModelCheckbox.getSelection(); - displayPackages = displayPackagesCheckbox.getSelection(); - displayCU = displayCUCheckbox.getSelection(); - - // save selection into settings - IDialogSettings settings = Activator.getDefault().getDialogSettings(); - settings.put(MODEL_UID + DISPLAY_MODEL_UID, displayModel); - settings.put(MODEL_UID + DISPLAY_PACKAGES_UID, displayPackages); - settings.put(MODEL_UID + DISPLAY_CU_UID, displayCU); - super.okPressed(); - } - - /** - * - * @return true if displayModelCheckbox is checked - */ - public boolean displayModel() { - return displayModel; - } - - /** - * - * @return true if displayPackagesCheckbox is checked - */ - public boolean displayPackages() { - return displayPackages; - } - - /** - * - * @return true if displayCUCheckbox is checked - */ - public boolean displayCU() { - return displayCU; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/InputListDialog.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/InputListDialog.java deleted file mode 100644 index f8c4fd0a58e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/InputListDialog.java +++ /dev/null @@ -1,332 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.java.reverse.ui.dialog; - -import java.util.List; - -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -/** - * @author dumoulin - * - */ -public class InputListDialog { - - /** Message to be show */ - private String message; - - /** Message to be show */ - private String tooltips; - - /** List of fields to show */ - private List fieldList; - - /** - * Input text widget. - */ - private Text addToListText; - - private org.eclipse.swt.widgets.List listWidget; - - /** - * Constructor. - * - * @param msg - * @param list - */ - public InputListDialog(String msg, List list) { - this.message = msg; - this.fieldList = list; - } - - - - /** - * @param tooltips - * the tooltips to set - */ - public void setTooltips(String tooltips) { - this.tooltips = tooltips; - } - - - /** - * Return the selected list. - * - * @return - */ - public String[] getList() { - return listWidget.getItems(); - } - - /** - * - * @param parent - * @return - */ - public Control createDialogArea(Composite parent) { - // create composite - Composite composite = parent; - // create message - if (message != null) { - Label label = new Label(composite, SWT.WRAP); - label.setText(message); - GridData data = new GridData(GridData.GRAB_HORIZONTAL - /* | GridData.GRAB_VERTICAL */| GridData.HORIZONTAL_ALIGN_FILL - | GridData.VERTICAL_ALIGN_CENTER); - // data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); - label.setLayoutData(data); - label.setFont(parent.getFont()); - setToolTip(label, tooltips); - ; - } - - // button - createButtonBar(composite); - - // list - listWidget = new org.eclipse.swt.widgets.List(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.RESIZE); - - GridData listData = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL); - - listData.heightHint = 100; - listWidget.setLayoutData(listData); - setToolTip(listWidget, tooltips); - if (fieldList != null) { - for (String item : fieldList) { - listWidget.add(item); - } - } - - // applyDialogFont(composite); - return composite; - } - - - /** - * Set the tooltips if not null. - * - * @param parent - * @param tooltips - */ - private void setToolTip(Control parent, String tooltips) { - if (tooltips != null) { - parent.setToolTipText(tooltips); - } - } - - /** - * Returns the style bits that should be used for the input text field. - * Defaults to a single line entry. Subclasses may override. - * - * @return the integer style bits that should be used when creating the - * input text - * - * @since 3.4 - */ - protected int getInputTextStyle() { - return SWT.SINGLE | SWT.BORDER; - } - - /** - * Creates and returns the contents of this dialog's button bar. - *

- * The Dialog implementation of this framework method lays out a button bar and calls the createButtonsForButtonBar framework method to populate it. Subclasses may override. - *

- *

- * The returned control's layout data must be an instance of GridData. - *

- * - * @param parent - * the parent composite to contain the button bar - * @return the button bar control - */ - protected Control createButtonBar(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - // create a layout with spacing and margins appropriate for the font - // size. - GridLayout layout = new GridLayout(); - layout.numColumns = 0; // this is incremented by createButton - layout.makeColumnsEqualWidth = false; - // layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); - // layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); - // layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); - // layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); - composite.setLayout(layout); - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL - | GridData.VERTICAL_ALIGN_CENTER); - composite.setLayoutData(data); - composite.setFont(parent.getFont()); - - // Add the buttons to the button bar. - createButtonsForButtonBar(composite); - return composite; - } - - /** - * Adds buttons to this dialog's button bar. - *

- * The Dialog implementation of this framework method adds standard ok and cancel buttons using the createButton framework method. These standard buttons will be accessible from getCancelButton, and - * getOKButton. Subclasses may override. - *

- * - * @param parent - * the button bar composite - */ - protected void createButtonsForButtonBar(Composite parent) { - // create OK and Cancel buttons by default - // Create input text - // input text - ((GridLayout) parent.getLayout()).numColumns++; - addToListText = new Text(parent, getInputTextStyle()); - setButtonLayoutData(addToListText); - addToListText.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING - | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL)); - - // Create a Button - ((GridLayout) parent.getLayout()).numColumns++; - Button button = new Button(parent, SWT.PUSH); - button.setText("add"); - button.setFont(JFaceResources.getDialogFont()); - button.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent event) { - addPressed(); - } - }); - setButtonLayoutData(button); - - // remove - ((GridLayout) parent.getLayout()).numColumns++; - button = new Button(parent, SWT.PUSH); - button.setText("-"); - button.setFont(JFaceResources.getDialogFont()); - button.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent event) { - removedPressed(); - } - }); - setButtonLayoutData(button); - - // up - ((GridLayout) parent.getLayout()).numColumns++; - button = new Button(parent, SWT.PUSH); - button.setText("^"); - button.setFont(JFaceResources.getDialogFont()); - button.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent event) { - upPressed(); - } - }); - setButtonLayoutData(button); - - // down - ((GridLayout) parent.getLayout()).numColumns++; - button = new Button(parent, SWT.PUSH); - button.setText("v"); - button.setFont(JFaceResources.getDialogFont()); - button.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent event) { - downPressed(); - } - }); - setButtonLayoutData(button); - - - } - - /** - * Called when add button is pressed. - */ - protected void addPressed() { - System.out.println("add pressed " + addToListText.getText()); - String msg = addToListText.getText(); - if (msg.length() == 0) { - return; - } - - msg.trim(); - listWidget.add(msg); - // listWidget.pack(true); - } - - protected void upPressed() { - System.out.println("up pressed"); - int selectionIndex = listWidget.getSelectionIndex(); - - if (selectionIndex > 0) { - swapItems(selectionIndex - 1, selectionIndex); - listWidget.setSelection(selectionIndex - 1); - } - } - - /** - * Swap items in the list - * - * @param down - * @param up - */ - private void swapItems(int down, int up) { - String tmp = listWidget.getItem(down); - listWidget.setItem(down, listWidget.getItem(up)); - listWidget.setItem(up, tmp); - } - - protected void downPressed() { - System.out.println("down pressed"); - int selectionIndex = listWidget.getSelectionIndex(); - - if (selectionIndex < listWidget.getItemCount() - 1) { - swapItems(selectionIndex, selectionIndex + 1); - listWidget.setSelection(selectionIndex + 1); - } - } - - - protected void removedPressed() { - System.out.println("removed pressed"); - int selectionIndex = listWidget.getSelectionIndex(); - - String old = listWidget.getItem(selectionIndex); - listWidget.remove(selectionIndex); - addToListText.setText(old); - } - - - /** - * Set the layout data of the button to a GridData with appropriate heights - * and widths. - * - * @param button - */ - protected void setButtonLayoutData(Control button) { - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - // int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); - Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); - // data.widthHint = Math.max(widthHint, minSize.x); - data.widthHint = minSize.x; - button.setLayoutData(data); - } - - - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/ReverseCodeDialog.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/ReverseCodeDialog.java deleted file mode 100644 index d21b20de12d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/ReverseCodeDialog.java +++ /dev/null @@ -1,281 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.java.reverse.ui.dialog; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javagen.umlparser.CreationPackageCatalog; - -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.papyrus.java.reverse.ui.Activator; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; - -/** - * @author dumoulin - * - */ -public class ReverseCodeDialog extends InputDialog { - - /** Internal dialog to show list of searchpaths */ - private InputListDialog listDialog; - - /** Internal dialog to show list of creation paths */ - private InputListDialog creationPathsDialog; - - /** Returned searchpaths */ - private String[] searchPath; - /** creationPaths read by the list. One line pattern by element */ - private String[] creationPaths; - /** splitted creationPaths. pattern lines are splitted in small path */ - private List splittedCreationPaths; - - private String SEARCHPATHS_UID = ":searchpaths"; - private String CREATIONPATHS_UID = ":creationpaths"; - private static String DEFAULT_PACKAGE_NAME_UID = ":defaultpackagename"; - protected String MODEL_UID = "nomodeluid"; - - private static String textMsg = "Default creation package."; - @SuppressWarnings("unused") - private static String creationPackageTooltips = "The default creation package is used when no matching creation package are found."; - - - private static String dialogTitle = "Reverse Code"; - - private static String listMsg = "search paths - list of model packages used to search for already existing classes (ex: p1/p2)"; - private static String listTooltips = "search paths - list of model packages used to search for already existing classes (ex: p1/p2)"; - - private static String creationPathMsg = "creation paths \n" - + "pattern: includePath ; excludePath ; destination (use ';' as separator)\n"; - - private static String creationPathTooltips = "creation paths - list of path describing the models inside which reversed classes will be generated.\n" - + "pattern: includeJavaPackage ; excludeJavaPackage ; destinationPath (use ';' as separator)\n" - + "includeJavaPackage: the java package that should be mapped. Can contain a '*'.\n" - + "excludeJavaPackage: the java package that should be excluded. Can contain a '*'.\n" - + "destinationPath: the uml model inside which matching java packages will be created. Can contain a '*'.\n" - + "if destinationPath contains a '*', it will be replaced by the partname found at the place of '*'\n" - + "in the includeJavaPackage\n" - + "\n" - + "ex: eclipse.org.* ; eclipse.org.papyrus ; *"; - - - /** - * @param parentShell - * @param dialogTitle - * @param dialogMessage - * @param initialValue - * @param validator - */ - public ReverseCodeDialog(Shell parentShell, String modelUid, String initialValue, List searchPathsInitialValues) { - super(parentShell, dialogTitle, textMsg, getInitialValue(modelUid, initialValue), null); - // TODO Auto-generated constructor stub - IDialogSettings settings = Activator.getDefault().getDialogSettings(); - - MODEL_UID = modelUid; - - // Look for generationPackageName if none is provided. - // if(initialValue == null) - // { - // String generationPackageName = settings.get("generationPackageName"); - // getText().setText(generationPackageName); - // - // } - // Look for saved searchpaths if none is provided. - if (searchPathsInitialValues == null) { - String[] savedSearchPath = settings.getArray(MODEL_UID + SEARCHPATHS_UID); - if (savedSearchPath != null) { - searchPathsInitialValues = Arrays.asList(savedSearchPath); - } else - { - searchPathsInitialValues = CreationPackageCatalog.getDefaultSearchPath(); - } - } - - // Look for saved creationPaths if none is provided. - if (creationPaths == null) { - String[] savedSearchPath = settings.getArray(MODEL_UID + CREATIONPATHS_UID); - if (savedSearchPath != null) { - creationPaths = savedSearchPath; - } else { - creationPaths = CreationPackageCatalog.getDefaultPackageCreationPatterns(" ; "); - } - } - - listDialog = new InputListDialog(listMsg, searchPathsInitialValues); - listDialog.setTooltips(listTooltips); - creationPathsDialog = new InputListDialog(creationPathMsg, Arrays.asList(creationPaths)); - creationPathsDialog.setTooltips(creationPathTooltips); - } - - /** - * - * @param modelUid - * @param initialValue - * @return - */ - private static String getInitialValue(String modelUid, String initialValue) { - IDialogSettings settings = Activator.getDefault().getDialogSettings(); - - // Look for generationPackageName if none is provided. - if (initialValue == null) { - // String generationPackageName = settings.get(MODEL_UID + SEARCHPATH_UID); - String generationPackageName = settings.get(modelUid + DEFAULT_PACKAGE_NAME_UID); - return generationPackageName; - - } - return initialValue; - } - - /** - * Allows resizing. - */ - @Override - protected boolean isResizable() { - // TODO Auto-generated method stub - return true; - } - - /** - * Get the returned searchpaths. - * - * @return - */ - public String[] getSearchPath() { - return searchPath; - } - - /** - * Get the returned creationPaths, one pattern for each entry, separated by ';'. - * - * @return - */ - public List getCreationPaths() { - - return splittedCreationPaths; - } - - - /** - * Create additional list of searchpaths. - */ - @Override - protected Control createDialogArea(Composite parent) { - // create composite - Composite composite = (Composite) super.createDialogArea(parent); - - listDialog.createDialogArea(composite); - creationPathsDialog.createDialogArea(composite); - return composite; - } - - /** - * Save the searchpath after the button is pressed. - */ - @Override - protected void okPressed() { - // Save the list before the control is disposed - searchPath = listDialog.getList(); - creationPaths = creationPathsDialog.getList(); - String defaultCreationPath = getValue(); - if (defaultCreationPath == null || defaultCreationPath.length() == 0) { - defaultCreationPath = CreationPackageCatalog.getDefaultCreationPath(); - } - - // Check inputs - try { - // Check paths - splittedCreationPaths = computeCreationPaths(creationPaths); - CreationPackageCatalog.validateCreationPath(splittedCreationPaths); - // add default searchPaths - searchPath = addDefaultSearchPaths(Arrays.asList(searchPath), splittedCreationPaths).toArray(new String[0]); - - } catch (Exception e) { - // TODO Auto-generated catch block - showError(e.getMessage()); - return; - } - - - // save values - IDialogSettings settings = Activator.getDefault().getDialogSettings(); - settings.put(MODEL_UID + SEARCHPATHS_UID, searchPath); - settings.put(MODEL_UID + CREATIONPATHS_UID, creationPaths); - settings.put(MODEL_UID + DEFAULT_PACKAGE_NAME_UID, getValue()); - - - super.okPressed(); - } - - - /** - * Add the defaultSearchPath extracted from the splittedCreationPath to the searchPath. - * - * @param splittedCreationPaths2 - */ - private List addDefaultSearchPaths(List searchPath, List splittedCreationPaths) { - - - List result = new ArrayList(searchPath.size() + splittedCreationPaths.size()); - result.addAll(searchPath); - - List additionalPaths = CreationPackageCatalog.extractCreationPaths(splittedCreationPaths.toArray(new String[0])); - for (String toAdd : additionalPaths) { - if (!result.contains(toAdd)) { - result.add(toAdd); - } - } - - return result; - } - - /** - * Show an error message - * - * @param message - */ - private void showError(String message) { - System.err.println("Error: " + message); - - } - - - /** - * Compute and check the creationsPaths - * - * @param creationPaths - * An array with one creationPattern by element - * @return An array with one path by elements - * @throws Exception - */ - private List computeCreationPaths(String[] creationPaths) throws Exception { - - List result = new ArrayList(); - - // Iterate line by line - // For each line, separate the 3 patterns - // If a pattern is empty, put a null - for (String line : creationPaths) { - String[] eles = line.split(";"); - if (eles.length != 3) { - throw new Exception("A line must contains 3 pattern separated by ';' :" + line); - } - for (String ele : eles) - { - ele = ele.trim(); - if (ele.length() == 0) { - ele = null; - } - // add ele - result.add(ele); - } - } - return result; - } - - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseCommand.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseCommand.java deleted file mode 100755 index 9fdb9fb8505..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseCommand.java +++ /dev/null @@ -1,103 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Jonathan Geoffroy. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Geoffroy geoffroy.jonathan@gmail.com - initial implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.reverse.ui.dnd; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.papyrus.java.reverse.ui.DndReverseCodeHandler; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; - -/** - * Command called when user drop Java Elements into diagram model (on Papyrus editor). - * Check for selected elements, and run reverse handler if all selected files are reversible. - * - * This command implements a Singleton Pattern. You should use ReverseCommand.getInstance() to receive a Singleton of this Command. - * - * @author Jonathan Geoffroy - * - */ -public class DropReverseCommand extends Command { - - /** - * Singleton implementation of ReverseCommand - * Always return this instance of Reverse Command when ask for instance - * - * @see {getInstance()} - */ - private static DropReverseCommand instance; - - /** - * Constructor. Initialize the request for this ReverseCommand - */ - private DropReverseCommand() { - super(); - } - - @Override - public boolean canExecute() { - // Find the type of each selected file (CompilationUnit, packages ...) - List selected; // The selected files from JDT - - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - ISelection selection = page.getSelection(); - if (!(selection instanceof IStructuredSelection)) { - return false; - } - IStructuredSelection structuredSelection = (IStructuredSelection) selection; - selected = structuredSelection.toList(); - - // For each selected object, check if it's reversible. - for (Object s : selected) { - // We can only reverse Java Elements. Moreover, reversing projects is not available yet - if (!(s instanceof IJavaElement) || s instanceof IProject) { - return false; - } - } - return true; - } - - @Override - public void execute() { - DndReverseCodeHandler reverse = new DndReverseCodeHandler(); - try { - reverse.execute(null); - } catch (ExecutionException e) { - e.printStackTrace(); - } - } - - /** - * return a singleton of this command - * Change the request if it differ from the previous calling - * - * - * @return a singleton of this command - */ - public static DropReverseCommand getInstance(Request request) { - if (instance == null) { - instance = new DropReverseCommand(); - } - - return instance; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseStrategy.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseStrategy.java deleted file mode 100755 index a302a6d3418..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseStrategy.java +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2014 Jonathan Geoffroy. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Jonathan Geoffroy geoffroy.jonathan@gmail.com - initial implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.reverse.ui.dnd; - -import org.eclipse.gef.EditPart; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.papyrus.infra.gmfdiag.dnd.strategy.DropStrategy; -import org.eclipse.swt.graphics.Image; - - -public class DropReverseStrategy implements DropStrategy { - public DropReverseStrategy() { - } - - @Override - public String getLabel() { - return Messages.DropReverseStrategy_LABEL; - } - - @Override - public String getDescription() { - return Messages.DropReverseStrategy_DESCRIPTION; - } - - @Override - public Image getImage() { - // No image to display - return null; - } - - @Override - public String getID() { - return "org.eclipse.papyrus.java.reverse.ui.dnd.reversedropstrategy"; //$NON-NLS-1$ - } - - @Override - public Command getCommand(final Request request, final EditPart targetEditPart) { - return DropReverseCommand.getInstance(request); - - } - - @Override - public int getPriority() { - return 0; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/Messages.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/Messages.java deleted file mode 100644 index 3253c5eb40a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/Messages.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.eclipse.papyrus.java.reverse.ui.dnd; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - - private static final String BUNDLE_NAME = "org.eclipse.papyrus.java.reverse.ui.dnd.messages"; //$NON-NLS-1$ - - public static String DropReverseStrategy_DESCRIPTION; - - public static String DropReverseStrategy_LABEL; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/messages.properties b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/messages.properties deleted file mode 100644 index 753937a59b2..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/messages.properties +++ /dev/null @@ -1,2 +0,0 @@ -DropReverseStrategy_DESCRIPTION=Reverse all dropped classes into model -DropReverseStrategy_LABEL=Reverse diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/handlers/CreateAssociationFromPropertyHandler.java b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/handlers/CreateAssociationFromPropertyHandler.java deleted file mode 100644 index 848f5ea6cbc..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/handlers/CreateAssociationFromPropertyHandler.java +++ /dev/null @@ -1,286 +0,0 @@ -/** - * - */ -package org.eclipse.papyrus.java.reverse.ui.handlers; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RecordingCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.TreeSelection; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers; -import org.eclipse.papyrus.java.reverse.utils.TypeOperationsEnhanced; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.uml2.uml.AggregationKind; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; - - -/** - * An handler getting the selected element and reporting them in console. - * - * @author Cedric dumoulin - * - */ -public class CreateAssociationFromPropertyHandler extends AbstractHandler implements IHandler { - - - /** - * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) - * @param event - * @return - * @throws ExecutionException - * - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - List objects = lookupSelectedElements(); - List selectedProperties = getAllSelectionOfType(event, Property.class); - if (objects == null) { - - showErrorDialog(event, "No object selected", "Can't create association. Please select a Property First."); - return null; - } - - // Try creation - try { - doExecute(selectedProperties); - } catch (ServiceException e) { - showErrorDialog(event, "Can't get TransactionalEditingDomain", e.getMessage()); - e.printStackTrace(); - } catch (Exception e) { - showErrorDialog(event, "Can't Create Association", e.getMessage()); - e.printStackTrace(); - } - - return null; - } - - /** - * Get all selected element of the specified type. - * - * @param expectedType - * @return - * @throws ExecutionException - */ - private List getAllSelectionOfType(ExecutionEvent event, Class expectedType) throws ExecutionException { - - ISelection selection = HandlerUtil.getCurrentSelectionChecked(event); - // IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - // ISelection selection = page.getSelection(); - System.out.println("check " + selection); - if (selection instanceof IStructuredSelection) - { - IStructuredSelection structuredSelection = (IStructuredSelection) selection; - return getAllElementOfType(structuredSelection.toList(), expectedType); - } - else if (selection instanceof TreeSelection) { - TreeSelection treeSelection = (TreeSelection) selection; - return getAllElementOfType(treeSelection.toList(), expectedType); - - } - return null; - } - - /** - * Filter the list, and only retain objects that can be adapted to the specified type - * - * @param objects - * @param class1 - * @return - */ - private List getAllElementOfType(List list, Class expectedClassType) { - - List res = new ArrayList(); - - for (Object cur : list) { - - T adapted = adapt(cur, expectedClassType); - if (adapted != null) { - res.add(adapted); - } - } - return res; - } - - /** - * Adapt the specified object to the requested type, if possible. - * Return null if the object can't be adapted. - * - * @param object - * @param expectedClassType - * @return The adapted object, or null. - */ - private T adapt(Object object, Class expectedClassType) { - - if (object instanceof IAdaptable) { - @SuppressWarnings("unchecked") - T ele = (T) ((IAdaptable) object).getAdapter(expectedClassType); - if (ele != null) { - return ele; - } - // Try as EObject if the expectedClasType is sub-type of EObject. - if (EObject.class.isAssignableFrom(expectedClassType)) { - // to EObject - EObject eobject = (EObject) ((IAdaptable) object).getAdapter(EObject.class); - - if (eobject != null && expectedClassType.isInstance(eobject)) { - return (T) eobject; - } - } - } - - // Try global mechanism - { - @SuppressWarnings("unchecked") - T ele = (T) Platform.getAdapterManager().getAdapter(object, expectedClassType); - if (ele != null) { - return ele; - } - // Try as EObject if the expectedClasType is sub-type of EObject. - if (EObject.class.isAssignableFrom(expectedClassType)) { - // to EObject - EObject eobject = (EObject) Platform.getAdapterManager().getAdapter(object, EObject.class); - - if (eobject != null && expectedClassType.isInstance(eobject)) { - - return (T) eobject; - } - } - } - // Can't be adapted - return null; - - } - - /** - * - * @param event - * @param errorMessage - * @throws ExecutionException - */ - private void showErrorDialog(ExecutionEvent event, String title, String errorMessage) throws ExecutionException { - IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); - MessageDialog.openError( - window.getShell(), - title, - errorMessage); - } - - - /** - * Get the name used in the {@link RecordingCommand}. This name will be visible in - * undo/redo. - * - * @return The command name to show. - */ - public String getCommandName() { - return "Create Association"; - } - - /** - * Do the execution of the command. - * - * @param objects - * List of object to generate Java code from. - * @throws ServiceException - */ - protected void doExecute(final List objects) throws ServiceException { - - // Execute the reverse with provided paramters - TransactionalEditingDomain editingDomain = getEditingDomain(); - RecordingCommand command = new RecordingCommand(editingDomain, getCommandName()) { - - @Override - protected void doExecute() { - System.out.println(" Selections:"); - - for (Object obj : objects) { - - System.out.println("found '" + obj + "'."); - createAssociationFromProperty((Property) obj); - } - } - - }; - - editingDomain.getCommandStack().execute(command); - - - } - - - /** - * Create an association from the specified Property. The association is created - * in the property's nearest package. - * - * @param p - * The property to use to create an association. - */ - protected void createAssociationFromProperty(Property p) { - - Element owner = p.getOwner(); - - if (owner instanceof Type) { - - Type classOwner = (Type) owner; - - // Compute other end name - String name = classOwner.getName(); - String newname = name.substring(0, 1).toLowerCase() + name.substring(1); - // Create - TypeOperationsEnhanced.createAssociationFromProperty(p, true, AggregationKind.COMPOSITE_LITERAL, - false, AggregationKind.NONE_LITERAL, newname, 0, 1); - } - } - - /** - * Lookup selected objects in UI. - * - * @return - */ - private List lookupSelectedElements() { - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - ISelection selection = page.getSelection(); - System.out.println("check " + selection); - if (selection instanceof IStructuredSelection) - { - IStructuredSelection structuredSelection = (IStructuredSelection) selection; - return structuredSelection.toList(); - } - else if (selection instanceof TreeSelection) { - TreeSelection treeSelection = (TreeSelection) selection; - return treeSelection.toList(); - - } - return null; - } - - /** - * Get the main editing doamin. - * - * @return - * @throws ServiceException - */ - protected TransactionalEditingDomain getEditingDomain() throws ServiceException { - return ServiceUtilsForActionHandlers.getInstance().getTransactionalEditingDomain(); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/messages.properties b/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/messages.properties deleted file mode 100644 index a754ab7df2a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/messages.properties +++ /dev/null @@ -1,2 +0,0 @@ -ReverseCodeHandler_NoModelError_Message=No model selected for Reverse. Please open a model where you want to add the reverse result. -ReverseCodeHandler_NoModelError_Title=No model selected diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/.classpath b/extraplugins/java/org.eclipse.papyrus.java.reverse/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/.project b/extraplugins/java/org.eclipse.papyrus.java.reverse/.project deleted file mode 100644 index 9f8df991a34..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.java.reverse - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.core.prefs b/extraplugins/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 94d61f00da6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/META-INF/MANIFEST.MF b/extraplugins/java/org.eclipse.papyrus.java.reverse/META-INF/MANIFEST.MF deleted file mode 100644 index bb2e8d708bb..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.uml2.uml;visibility:=reexport -Export-Package: japa.parser, - japa.parser.ast, - javagen.umlparser, - org.eclipse.papyrus.java.reverse.utils -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.java.reverse.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.java.reverse;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/about.html b/extraplugins/java/org.eclipse.papyrus.java.reverse/about.html deleted file mode 100644 index 82d49bf5f81..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 5, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/build.properties b/extraplugins/java/org.eclipse.papyrus.java.reverse/build.properties deleted file mode 100644 index d012a1e3eec..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties,\ - about.html -src.includes = about.html,\ - build.properties diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/plugin.properties b/extraplugins/java/org.eclipse.papyrus.java.reverse/plugin.properties deleted file mode 100644 index 4baa6d1eeda..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/plugin.properties +++ /dev/null @@ -1,16 +0,0 @@ - -################################################################################# -# Copyright (c) 2010-2013 Cedric Dumoulin. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API -# -################################################################################# - -pluginName=Java Reverse (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/pom.xml b/extraplugins/java/org.eclipse.papyrus.java.reverse/pom.xml deleted file mode 100644 index 7c10666dbca..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.java.reverse - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParser.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParser.java deleted file mode 100644 index 9eeb4b984c4..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParser.java +++ /dev/null @@ -1,10321 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. ASTParser.java */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package japa.parser; - -import japa.parser.ast.Comment; -import japa.parser.ast.CompilationUnit; -import japa.parser.ast.ImportDeclaration; -import japa.parser.ast.PackageDeclaration; -import japa.parser.ast.TypeParameter; -import japa.parser.ast.body.AnnotationDeclaration; -import japa.parser.ast.body.AnnotationMemberDeclaration; -import japa.parser.ast.body.BodyDeclaration; -import japa.parser.ast.body.ClassOrInterfaceDeclaration; -import japa.parser.ast.body.ConstructorDeclaration; -import japa.parser.ast.body.EmptyMemberDeclaration; -import japa.parser.ast.body.EmptyTypeDeclaration; -import japa.parser.ast.body.EnumConstantDeclaration; -import japa.parser.ast.body.EnumDeclaration; -import japa.parser.ast.body.FieldDeclaration; -import japa.parser.ast.body.InitializerDeclaration; -import japa.parser.ast.body.JavadocComment; -import japa.parser.ast.body.MethodDeclaration; -import japa.parser.ast.body.ModifierSet; -import japa.parser.ast.body.Parameter; -import japa.parser.ast.body.TypeDeclaration; -import japa.parser.ast.body.VariableDeclarator; -import japa.parser.ast.body.VariableDeclaratorId; -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.expr.ArrayAccessExpr; -import japa.parser.ast.expr.ArrayCreationExpr; -import japa.parser.ast.expr.ArrayInitializerExpr; -import japa.parser.ast.expr.AssignExpr; -import japa.parser.ast.expr.BinaryExpr; -import japa.parser.ast.expr.BooleanLiteralExpr; -import japa.parser.ast.expr.CastExpr; -import japa.parser.ast.expr.CharLiteralExpr; -import japa.parser.ast.expr.ClassExpr; -import japa.parser.ast.expr.ConditionalExpr; -import japa.parser.ast.expr.DoubleLiteralExpr; -import japa.parser.ast.expr.EnclosedExpr; -import japa.parser.ast.expr.Expression; -import japa.parser.ast.expr.FieldAccessExpr; -import japa.parser.ast.expr.InstanceOfExpr; -import japa.parser.ast.expr.IntegerLiteralExpr; -import japa.parser.ast.expr.IntegerLiteralMinValueExpr; -import japa.parser.ast.expr.LongLiteralExpr; -import japa.parser.ast.expr.LongLiteralMinValueExpr; -import japa.parser.ast.expr.MarkerAnnotationExpr; -import japa.parser.ast.expr.MemberValuePair; -import japa.parser.ast.expr.MethodCallExpr; -import japa.parser.ast.expr.NameExpr; -import japa.parser.ast.expr.NormalAnnotationExpr; -import japa.parser.ast.expr.NullLiteralExpr; -import japa.parser.ast.expr.ObjectCreationExpr; -import japa.parser.ast.expr.QualifiedNameExpr; -import japa.parser.ast.expr.SingleMemberAnnotationExpr; -import japa.parser.ast.expr.StringLiteralExpr; -import japa.parser.ast.expr.SuperExpr; -import japa.parser.ast.expr.ThisExpr; -import japa.parser.ast.expr.UnaryExpr; -import japa.parser.ast.expr.VariableDeclarationExpr; -import japa.parser.ast.stmt.AssertStmt; -import japa.parser.ast.stmt.BlockStmt; -import japa.parser.ast.stmt.BreakStmt; -import japa.parser.ast.stmt.CatchClause; -import japa.parser.ast.stmt.ContinueStmt; -import japa.parser.ast.stmt.DoStmt; -import japa.parser.ast.stmt.EmptyStmt; -import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; -import japa.parser.ast.stmt.ExpressionStmt; -import japa.parser.ast.stmt.ForStmt; -import japa.parser.ast.stmt.ForeachStmt; -import japa.parser.ast.stmt.IfStmt; -import japa.parser.ast.stmt.LabeledStmt; -import japa.parser.ast.stmt.ReturnStmt; -import japa.parser.ast.stmt.Statement; -import japa.parser.ast.stmt.SwitchEntryStmt; -import japa.parser.ast.stmt.SwitchStmt; -import japa.parser.ast.stmt.SynchronizedStmt; -import japa.parser.ast.stmt.ThrowStmt; -import japa.parser.ast.stmt.TryStmt; -import japa.parser.ast.stmt.TypeDeclarationStmt; -import japa.parser.ast.stmt.WhileStmt; -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.type.PrimitiveType; -import japa.parser.ast.type.ReferenceType; -import japa.parser.ast.type.Type; -import japa.parser.ast.type.VoidType; -import japa.parser.ast.type.WildcardType; - -import java.io.InputStream; -import java.util.LinkedList; -import java.util.List; - -/** - *

- * This class was generated automatically by javacc, do not edit. - *

- * - * @author Júlio Vilmar Gesser - */ -final class ASTParser implements ASTParserConstants { - - void reset(InputStream in, String encoding) { - ReInit(in, encoding); - token_source.clearComments(); - } - - private List add(List list, Object obj) { - if (list == null) { - list = new LinkedList(); - } - list.add(obj); - return list; - } - - private List add(int pos, List list, Object obj) { - if (list == null) { - list = new LinkedList(); - } - list.add(pos, obj); - return list; - } - - private class Modifier { - - final int modifiers; - - final List annotations; - - final int beginLine; - - final int beginColumn; - - public Modifier(int beginLine, int beginColumn, int modifiers, List annotations) { - this.beginLine = beginLine; - this.beginColumn = beginColumn; - this.modifiers = modifiers; - this.annotations = annotations; - } - } - - public int addModifier(int modifiers, int mod, Token token) throws ParseException { - if ((ModifierSet.hasModifier(modifiers, mod))) { - throwParseException(token, "Duplicated modifier"); - } - return ModifierSet.addModifier(modifiers, mod); - } - - private void pushJavadoc() { - token_source.pushJavadoc(); - } - - private JavadocComment popJavadoc() { - return token_source.popJavadoc(); - } - - private List getComments() { - return token_source.getComments(); - } - - private void throwParseException(Token token, String message) throws ParseException { - StringBuilder buf = new StringBuilder(); - buf.append(message); - buf.append(": \""); - buf.append(token.image); - buf.append("\" at line "); - buf.append(token.beginLine); - buf.append(", column "); - buf.append(token.beginColumn); - ParseException e = new ParseException(buf.toString()); - e.currentToken = token; - throw e; - } - - static final class GTToken extends Token { - - int realKind = ASTParserConstants.GT; - - GTToken(int kind, String image) { - this.kind = kind; - this.image = image; - } - - public static Token newToken(int kind, String image) { - return new GTToken(kind, image); - } - } - - /***************************************** - * THE JAVA LANGUAGE GRAMMAR STARTS HERE * - *****************************************/ - - /* - * Program structuring syntax follows. - */ - final public CompilationUnit CompilationUnit() throws ParseException { - PackageDeclaration pakage = null; - List imports = null; - ImportDeclaration in = null; - List types = null; - TypeDeclaration tn = null; - int line = -1; - int column = 0; - if (jj_2_1(2147483647)) { - pakage = PackageDeclaration(); - line = pakage.getBeginLine(); - column = pakage.getBeginColumn(); - } else { - ; - } - label_1: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IMPORT: - ; - break; - default: - jj_la1[0] = jj_gen; - break label_1; - } - in = ImportDeclaration(); - if (line == -1) { - line = in.getBeginLine(); - column = in.getBeginColumn(); - } - imports = add(imports, in); - } - label_2: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case CLASS: - case ENUM: - case FINAL: - case INTERFACE: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case SEMICOLON: - case AT: - ; - break; - default: - jj_la1[1] = jj_gen; - break label_2; - } - tn = TypeDeclaration(); - if (line == -1) { - line = tn.getBeginLine(); - column = tn.getBeginColumn(); - } - types = add(types, tn); - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case 0: - jj_consume_token(0); - break; - case 128: - jj_consume_token(128); - break; - default: - jj_la1[2] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return new CompilationUnit(line == -1 ? 0 : line, column, token.endLine, token.endColumn, pakage, imports, types, getComments()); - } - } - throw new Error("Missing return statement in function"); - } - - final public PackageDeclaration PackageDeclaration() throws ParseException { - List annotations = null; - AnnotationExpr ann; - NameExpr name; - int line; - int column; - label_3: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[3] = jj_gen; - break label_3; - } - ann = Annotation(); - annotations = add(annotations, ann); - } - jj_consume_token(PACKAGE); - line = token.beginLine; - column = token.beginColumn; - name = Name(); - jj_consume_token(SEMICOLON); - { - if (true) { - return new PackageDeclaration(line, column, token.endLine, token.endColumn, annotations, name); - } - } - throw new Error("Missing return statement in function"); - } - - final public ImportDeclaration ImportDeclaration() throws ParseException { - NameExpr name; - boolean isStatic = false; - boolean isAsterisk = false; - int line; - int column; - jj_consume_token(IMPORT); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case STATIC: - jj_consume_token(STATIC); - isStatic = true; - break; - default: - jj_la1[4] = jj_gen; - ; - } - name = Name(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case DOT: - jj_consume_token(DOT); - jj_consume_token(STAR); - isAsterisk = true; - break; - default: - jj_la1[5] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - { - if (true) { - return new ImportDeclaration(line, column, token.endLine, token.endColumn, name, isStatic, isAsterisk); - } - } - throw new Error("Missing return statement in function"); - } - - /* - * Modifiers. We match all modifiers in a single rule to reduce the chances of - * syntax errors for simple modifier mistakes. It will also enable us to give - * better error messages. - */ - final public Modifier Modifiers() throws ParseException { - int beginLine = -1; - int beginColumn = -1; - int modifiers = 0; - List annotations = null; - AnnotationExpr ann; - label_4: while (true) { - if (jj_2_2(2)) { - ; - } else { - break label_4; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case PUBLIC: - jj_consume_token(PUBLIC); - modifiers = addModifier(modifiers, ModifierSet.PUBLIC, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case STATIC: - jj_consume_token(STATIC); - modifiers = addModifier(modifiers, ModifierSet.STATIC, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case PROTECTED: - jj_consume_token(PROTECTED); - modifiers = addModifier(modifiers, ModifierSet.PROTECTED, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case PRIVATE: - jj_consume_token(PRIVATE); - modifiers = addModifier(modifiers, ModifierSet.PRIVATE, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case FINAL: - jj_consume_token(FINAL); - modifiers = addModifier(modifiers, ModifierSet.FINAL, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case ABSTRACT: - jj_consume_token(ABSTRACT); - modifiers = addModifier(modifiers, ModifierSet.ABSTRACT, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case SYNCHRONIZED: - jj_consume_token(SYNCHRONIZED); - modifiers = addModifier(modifiers, ModifierSet.SYNCHRONIZED, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case NATIVE: - jj_consume_token(NATIVE); - modifiers = addModifier(modifiers, ModifierSet.NATIVE, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case TRANSIENT: - jj_consume_token(TRANSIENT); - modifiers = addModifier(modifiers, ModifierSet.TRANSIENT, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case VOLATILE: - jj_consume_token(VOLATILE); - modifiers = addModifier(modifiers, ModifierSet.VOLATILE, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case STRICTFP: - jj_consume_token(STRICTFP); - modifiers = addModifier(modifiers, ModifierSet.STRICTFP, token); - if (beginLine == -1) { - beginLine = token.beginLine; - beginColumn = token.beginColumn; - } - break; - case AT: - ann = Annotation(); - annotations = add(annotations, ann); - if (beginLine == -1) { - beginLine = ann.getBeginLine(); - beginColumn = ann.getBeginColumn(); - } - break; - default: - jj_la1[6] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) { - return new Modifier(beginLine, beginColumn, modifiers, annotations); - } - } - throw new Error("Missing return statement in function"); - } - - /* - * Declaration syntax follows. - */ - final public TypeDeclaration TypeDeclaration() throws ParseException { - Modifier modifier; - TypeDeclaration ret; - pushJavadoc(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case SEMICOLON: - jj_consume_token(SEMICOLON); - ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); - break; - case ABSTRACT: - case CLASS: - case ENUM: - case FINAL: - case INTERFACE: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case AT: - modifier = Modifiers(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CLASS: - case INTERFACE: - ret = ClassOrInterfaceDeclaration(modifier); - break; - case ENUM: - ret = EnumDeclaration(modifier); - break; - case AT: - ret = AnnotationTypeDeclaration(modifier); - break; - default: - jj_la1[7] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - default: - jj_la1[8] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public ClassOrInterfaceDeclaration ClassOrInterfaceDeclaration(Modifier modifier) throws ParseException { - boolean isInterface = false; - String name; - List typePar = null; - List extList = null; - List impList = null; - List members; - int line = modifier.beginLine; - int column = modifier.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CLASS: - jj_consume_token(CLASS); - break; - case INTERFACE: - jj_consume_token(INTERFACE); - isInterface = true; - break; - default: - jj_la1[9] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - jj_consume_token(IDENTIFIER); - name = token.image; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typePar = TypeParameters(); - typePar.remove(0); - break; - default: - jj_la1[10] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case EXTENDS: - extList = ExtendsList(isInterface); - break; - default: - jj_la1[11] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IMPLEMENTS: - impList = ImplementsList(isInterface); - break; - default: - jj_la1[12] = jj_gen; - ; - } - members = ClassOrInterfaceBody(isInterface); - { - if (true) { - return new ClassOrInterfaceDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, isInterface, name, typePar, extList, impList, members); - } - } - throw new Error("Missing return statement in function"); - } - - final public List ExtendsList(boolean isInterface) throws ParseException { - boolean extendsMoreThanOne = false; - List ret = new LinkedList(); - ClassOrInterfaceType cit; - jj_consume_token(EXTENDS); - cit = ClassOrInterfaceType(); - ret.add(cit); - label_5: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[13] = jj_gen; - break label_5; - } - jj_consume_token(COMMA); - cit = ClassOrInterfaceType(); - ret.add(cit); - extendsMoreThanOne = true; - } - if (extendsMoreThanOne && !isInterface) { - throwParseException(token, "A class cannot extend more than one other class"); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public List ImplementsList(boolean isInterface) throws ParseException { - List ret = new LinkedList(); - ClassOrInterfaceType cit; - jj_consume_token(IMPLEMENTS); - cit = ClassOrInterfaceType(); - ret.add(cit); - label_6: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[14] = jj_gen; - break label_6; - } - jj_consume_token(COMMA); - cit = ClassOrInterfaceType(); - ret.add(cit); - } - if (isInterface) { - throwParseException(token, "An interface cannot implement other interfaces"); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public EnumDeclaration EnumDeclaration(Modifier modifier) throws ParseException { - String name; - List impList = null; - EnumConstantDeclaration entry; - List entries = null; - BodyDeclaration member; - List members = null; - int line = modifier.beginLine; - int column = modifier.beginColumn; - jj_consume_token(ENUM); - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - jj_consume_token(IDENTIFIER); - name = token.image; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IMPLEMENTS: - impList = ImplementsList(false); - break; - default: - jj_la1[15] = jj_gen; - ; - } - jj_consume_token(LBRACE); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - case AT: - entries = new LinkedList(); - entry = EnumConstantDeclaration(); - entries.add(entry); - label_7: while (true) { - if (jj_2_3(2)) { - ; - } else { - break label_7; - } - jj_consume_token(COMMA); - entry = EnumConstantDeclaration(); - entries.add(entry); - } - break; - default: - jj_la1[16] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - jj_consume_token(COMMA); - break; - default: - jj_la1[17] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case SEMICOLON: - jj_consume_token(SEMICOLON); - label_8: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOID: - case VOLATILE: - case IDENTIFIER: - case LBRACE: - case SEMICOLON: - case AT: - case LT: - ; - break; - default: - jj_la1[18] = jj_gen; - break label_8; - } - member = ClassOrInterfaceBodyDeclaration(false); - members = add(members, member); - } - break; - default: - jj_la1[19] = jj_gen; - ; - } - jj_consume_token(RBRACE); - { - if (true) { - return new EnumDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, name, impList, entries, members); - } - } - throw new Error("Missing return statement in function"); - } - - final public EnumConstantDeclaration EnumConstantDeclaration() throws ParseException { - List annotations = null; - AnnotationExpr ann; - String name; - List args = null; - List classBody = null; - int line = -1; - int column = -1; - pushJavadoc(); - label_9: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ; - break; - default: - jj_la1[20] = jj_gen; - break label_9; - } - ann = Annotation(); - annotations = add(annotations, ann); - if (line == -1) { - line = ann.getBeginLine(); - column = ann.getBeginColumn(); - } - } - jj_consume_token(IDENTIFIER); - name = token.image; - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LPAREN: - args = Arguments(); - break; - default: - jj_la1[21] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACE: - classBody = ClassOrInterfaceBody(false); - break; - default: - jj_la1[22] = jj_gen; - ; - } - { - if (true) { - return new EnumConstantDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), annotations, name, args, classBody); - } - } - throw new Error("Missing return statement in function"); - } - - final public List TypeParameters() throws ParseException { - List ret = new LinkedList(); - TypeParameter tp; - jj_consume_token(LT); - ret.add(new int[] { token.beginLine, token.beginColumn }); - tp = TypeParameter(); - ret.add(tp); - label_10: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[23] = jj_gen; - break label_10; - } - jj_consume_token(COMMA); - tp = TypeParameter(); - ret.add(tp); - } - jj_consume_token(GT); - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public TypeParameter TypeParameter() throws ParseException { - String name; - List typeBound = null; - int line; - int column; - jj_consume_token(IDENTIFIER); - name = token.image; - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case EXTENDS: - typeBound = TypeBound(); - break; - default: - jj_la1[24] = jj_gen; - ; - } - { - if (true) { - return new TypeParameter(line, column, token.endLine, token.endColumn, name, typeBound); - } - } - throw new Error("Missing return statement in function"); - } - - final public List TypeBound() throws ParseException { - List ret = new LinkedList(); - ClassOrInterfaceType cit; - jj_consume_token(EXTENDS); - cit = ClassOrInterfaceType(); - ret.add(cit); - label_11: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BIT_AND: - ; - break; - default: - jj_la1[25] = jj_gen; - break label_11; - } - jj_consume_token(BIT_AND); - cit = ClassOrInterfaceType(); - ret.add(cit); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public List ClassOrInterfaceBody(boolean isInterface) throws ParseException { - List ret = new LinkedList(); - BodyDeclaration member; - jj_consume_token(LBRACE); - label_12: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOID: - case VOLATILE: - case IDENTIFIER: - case LBRACE: - case SEMICOLON: - case AT: - case LT: - ; - break; - default: - jj_la1[26] = jj_gen; - break label_12; - } - member = ClassOrInterfaceBodyDeclaration(isInterface); - ret.add(member); - } - jj_consume_token(RBRACE); - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public BodyDeclaration ClassOrInterfaceBodyDeclaration(boolean isInterface) throws ParseException { - boolean isNestedInterface = false; - Modifier modifier; - BodyDeclaration ret; - pushJavadoc(); - if (jj_2_6(2)) { - ret = InitializerDeclaration(); - if (isInterface) { - throwParseException(token, "An interface cannot have initializers"); - } - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOID: - case VOLATILE: - case IDENTIFIER: - case AT: - case LT: - modifier = Modifiers(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CLASS: - case INTERFACE: - ret = ClassOrInterfaceDeclaration(modifier); - break; - case ENUM: - ret = EnumDeclaration(modifier); - break; - case AT: - ret = AnnotationTypeDeclaration(modifier); - break; - default: - jj_la1[27] = jj_gen; - if (jj_2_4(2147483647)) { - ret = ConstructorDeclaration(modifier); - } else if (jj_2_5(2147483647)) { - ret = FieldDeclaration(modifier); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case VOID: - case IDENTIFIER: - case LT: - ret = MethodDeclaration(modifier); - break; - default: - jj_la1[28] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - break; - case SEMICOLON: - jj_consume_token(SEMICOLON); - ret = new EmptyMemberDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); - break; - default: - jj_la1[29] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public FieldDeclaration FieldDeclaration(Modifier modifier) throws ParseException { - Type type; - List variables = new LinkedList(); - VariableDeclarator val; - // Modifiers are already matched in the caller - type = Type(); - val = VariableDeclarator(); - variables.add(val); - label_13: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[30] = jj_gen; - break label_13; - } - jj_consume_token(COMMA); - val = VariableDeclarator(); - variables.add(val); - } - jj_consume_token(SEMICOLON); - int line = modifier.beginLine; - int column = modifier.beginColumn; - if (line == -1) { - line = type.getBeginLine(); - column = type.getBeginColumn(); - } - { - if (true) { - return new FieldDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, type, variables); - } - } - throw new Error("Missing return statement in function"); - } - - final public VariableDeclarator VariableDeclarator() throws ParseException { - VariableDeclaratorId id; - Expression init = null; - id = VariableDeclaratorId(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ASSIGN: - jj_consume_token(ASSIGN); - init = VariableInitializer(); - break; - default: - jj_la1[31] = jj_gen; - ; - } - { - if (true) { - return new VariableDeclarator(id.getBeginLine(), id.getBeginColumn(), token.endLine, token.endColumn, id, init); - } - } - throw new Error("Missing return statement in function"); - } - - final public VariableDeclaratorId VariableDeclaratorId() throws ParseException { - String name; - int arrayCount = 0; - int line; - int column; - jj_consume_token(IDENTIFIER); - name = token.image; - line = token.beginLine; - column = token.beginColumn; - label_14: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACKET: - ; - break; - default: - jj_la1[32] = jj_gen; - break label_14; - } - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; - } - { - if (true) { - return new VariableDeclaratorId(line, column, token.endLine, token.endColumn, name, arrayCount); - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression VariableInitializer() throws ParseException { - Expression ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACE: - ret = ArrayInitializer(); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - ret = Expression(); - break; - default: - jj_la1[33] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public ArrayInitializerExpr ArrayInitializer() throws ParseException { - List values = null; - Expression val; - int line; - int column; - jj_consume_token(LBRACE); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - val = VariableInitializer(); - values = add(values, val); - label_15: while (true) { - if (jj_2_7(2)) { - ; - } else { - break label_15; - } - jj_consume_token(COMMA); - val = VariableInitializer(); - values = add(values, val); - } - break; - default: - jj_la1[34] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - jj_consume_token(COMMA); - break; - default: - jj_la1[35] = jj_gen; - ; - } - jj_consume_token(RBRACE); - { - if (true) { - return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn, values); - } - } - throw new Error("Missing return statement in function"); - } - - final public MethodDeclaration MethodDeclaration(Modifier modifier) throws ParseException { - List typeParameters = null; - Type type; - String name; - List parameters; - int arrayCount = 0; - List throws_ = null; - BlockStmt block = null; - int line = modifier.beginLine; - int column = modifier.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typeParameters = TypeParameters(); - int[] lineCol = (int[]) typeParameters.remove(0); - if (line == -1) { - line = lineCol[0]; - column = lineCol[1]; - } - break; - default: - jj_la1[36] = jj_gen; - ; - } - type = ResultType(); - if (line == -1) { - line = type.getBeginLine(); - column = type.getBeginColumn(); - } - jj_consume_token(IDENTIFIER); - name = token.image; - parameters = FormalParameters(); - label_16: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACKET: - ; - break; - default: - jj_la1[37] = jj_gen; - break label_16; - } - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case THROWS: - jj_consume_token(THROWS); - throws_ = NameList(); - break; - default: - jj_la1[38] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACE: - block = Block(); - break; - case SEMICOLON: - jj_consume_token(SEMICOLON); - break; - default: - jj_la1[39] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return new MethodDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, typeParameters, type, name, parameters, arrayCount, throws_, block); - } - } - throw new Error("Missing return statement in function"); - } - - final public List FormalParameters() throws ParseException { - List ret = null; - Parameter par; - jj_consume_token(LPAREN); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case IDENTIFIER: - case AT: - par = FormalParameter(); - ret = add(ret, par); - label_17: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[40] = jj_gen; - break label_17; - } - jj_consume_token(COMMA); - par = FormalParameter(); - ret = add(ret, par); - } - break; - default: - jj_la1[41] = jj_gen; - ; - } - jj_consume_token(RPAREN); - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Parameter FormalParameter() throws ParseException { - Modifier modifier; - Type type; - boolean isVarArg = false; - VariableDeclaratorId id; - modifier = Modifiers(); - type = Type(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ELLIPSIS: - jj_consume_token(ELLIPSIS); - isVarArg = true; - break; - default: - jj_la1[42] = jj_gen; - ; - } - id = VariableDeclaratorId(); - int line = modifier.beginLine; - int column = modifier.beginColumn; - if (line == -1) { - line = type.getBeginLine(); - column = type.getBeginColumn(); - } - { - if (true) { - return new Parameter(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, isVarArg, id); - } - } - throw new Error("Missing return statement in function"); - } - - final public ConstructorDeclaration ConstructorDeclaration(Modifier modifier) throws ParseException { - List typeParameters = null; - String name; - List parameters; - List throws_ = null; - ExplicitConstructorInvocationStmt exConsInv = null; - List stmts; - int line = modifier.beginLine; - int column = modifier.beginColumn; - int bbLine = 0; - int bbColumn = 0; - int beLine = 0; - int beColumn = 0; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typeParameters = TypeParameters(); - int[] lineCol = (int[]) typeParameters.remove(0); - if (line == -1) { - line = lineCol[0]; - column = lineCol[1]; - } - break; - default: - jj_la1[43] = jj_gen; - ; - } - jj_consume_token(IDENTIFIER); - name = token.image; - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - parameters = FormalParameters(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case THROWS: - jj_consume_token(THROWS); - throws_ = NameList(); - break; - default: - jj_la1[44] = jj_gen; - ; - } - jj_consume_token(LBRACE); - bbLine = token.beginLine; - bbColumn = token.beginColumn; - if (jj_2_8(2147483647)) { - exConsInv = ExplicitConstructorInvocation(); - } else { - ; - } - stmts = Statements(); - jj_consume_token(RBRACE); - if (exConsInv != null) { - stmts = add(0, stmts, exConsInv); - } - { - if (true) { - return new ConstructorDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, typeParameters, name, parameters, throws_, new BlockStmt(bbLine, bbColumn, token.endLine, token.endColumn, - stmts)); - } - } - throw new Error("Missing return statement in function"); - } - - final public ExplicitConstructorInvocationStmt ExplicitConstructorInvocation() throws ParseException { - boolean isThis = false; - List args; - Expression expr = null; - List typeArgs = null; - int line = -1; - int column = 0; - if (jj_2_10(2147483647)) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typeArgs = TypeArguments(); - int[] lineCol = (int[]) typeArgs.remove(0); - line = lineCol[0]; - column = lineCol[1]; - break; - default: - jj_la1[45] = jj_gen; - ; - } - jj_consume_token(THIS); - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - isThis = true; - args = Arguments(); - jj_consume_token(SEMICOLON); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LT: - if (jj_2_9(2147483647)) { - expr = PrimaryExpressionWithoutSuperSuffix(); - jj_consume_token(DOT); - line = expr.getBeginLine(); - column = expr.getBeginColumn(); - } else { - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typeArgs = TypeArguments(); - int[] lineCol = (int[]) typeArgs.remove(0); - if (line == -1) { - line = lineCol[0]; - column = lineCol[1]; - } - break; - default: - jj_la1[46] = jj_gen; - ; - } - jj_consume_token(SUPER); - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - args = Arguments(); - jj_consume_token(SEMICOLON); - break; - default: - jj_la1[47] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) { - return new ExplicitConstructorInvocationStmt(line, column, token.endLine, token.endColumn, typeArgs, isThis, expr, args); - } - } - throw new Error("Missing return statement in function"); - } - - final public List Statements() throws ParseException { - List ret = null; - Statement stmt; - label_18: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case ASSERT: - case BOOLEAN: - case BREAK: - case BYTE: - case CHAR: - case CLASS: - case CONTINUE: - case DO: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case FOR: - case IF: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case RETURN: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SWITCH: - case SYNCHRONIZED: - case THIS: - case THROW: - case TRANSIENT: - case TRUE: - case TRY: - case VOID: - case VOLATILE: - case WHILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case SEMICOLON: - case AT: - case INCR: - case DECR: - ; - break; - default: - jj_la1[48] = jj_gen; - break label_18; - } - stmt = BlockStatement(); - ret = add(ret, stmt); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public InitializerDeclaration InitializerDeclaration() throws ParseException { - BlockStmt block; - int line = -1; - int column = 0; - boolean isStatic = false; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case STATIC: - jj_consume_token(STATIC); - isStatic = true; - line = token.beginLine; - column = token.beginColumn; - break; - default: - jj_la1[49] = jj_gen; - ; - } - block = Block(); - if (line == -1) { - line = block.getBeginLine(); - column = block.getBeginColumn(); - } - { - if (true) { - return new InitializerDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), isStatic, block); - } - } - throw new Error("Missing return statement in function"); - } - - /* - * Type, name and expression syntax follows. - */ - final public Type Type() throws ParseException { - Type ret; - if (jj_2_11(2)) { - ret = ReferenceType(); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - ret = PrimitiveType(); - break; - default: - jj_la1[50] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public ReferenceType ReferenceType() throws ParseException { - Type type; - int arrayCount = 0; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - type = PrimitiveType(); - label_19: while (true) { - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; - if (jj_2_12(2)) { - ; - } else { - break label_19; - } - } - break; - case IDENTIFIER: - type = ClassOrInterfaceType(); - label_20: while (true) { - if (jj_2_13(2)) { - ; - } else { - break label_20; - } - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - arrayCount++; - } - break; - default: - jj_la1[51] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return new ReferenceType(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type, arrayCount); - } - } - throw new Error("Missing return statement in function"); - } - - final public ClassOrInterfaceType ClassOrInterfaceType() throws ParseException { - ClassOrInterfaceType ret; - String name; - List typeArgs = null; - int line; - int column; - jj_consume_token(IDENTIFIER); - line = token.beginLine; - column = token.beginColumn; - name = token.image; - if (jj_2_14(2)) { - typeArgs = TypeArguments(); - typeArgs.remove(0); - } else { - ; - } - ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn, null, name, typeArgs); - label_21: while (true) { - if (jj_2_15(2)) { - ; - } else { - break label_21; - } - jj_consume_token(DOT); - jj_consume_token(IDENTIFIER); - name = token.image; - if (jj_2_16(2)) { - typeArgs = TypeArguments(); - typeArgs.remove(0); - } else { - ; - } - ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn, ret, name, typeArgs); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public List TypeArguments() throws ParseException { - List ret = new LinkedList(); - Type type; - jj_consume_token(LT); - ret.add(new int[] { token.beginLine, token.beginColumn }); - type = TypeArgument(); - ret.add(type); - label_22: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[52] = jj_gen; - break label_22; - } - jj_consume_token(COMMA); - type = TypeArgument(); - ret.add(type); - } - jj_consume_token(GT); - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Type TypeArgument() throws ParseException { - Type ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: - ret = ReferenceType(); - break; - case HOOK: - ret = Wildcard(); - break; - default: - jj_la1[53] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public WildcardType Wildcard() throws ParseException { - ReferenceType ext = null; - ReferenceType sup = null; - int line; - int column; - jj_consume_token(HOOK); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case EXTENDS: - case SUPER: - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case EXTENDS: - jj_consume_token(EXTENDS); - ext = ReferenceType(); - break; - case SUPER: - jj_consume_token(SUPER); - sup = ReferenceType(); - break; - default: - jj_la1[54] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - default: - jj_la1[55] = jj_gen; - ; - } - { - if (true) { - return new WildcardType(line, column, token.endLine, token.endColumn, ext, sup); - } - } - throw new Error("Missing return statement in function"); - } - - final public PrimitiveType PrimitiveType() throws ParseException { - PrimitiveType ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - jj_consume_token(BOOLEAN); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Boolean); - break; - case CHAR: - jj_consume_token(CHAR); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Char); - break; - case BYTE: - jj_consume_token(BYTE); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Byte); - break; - case SHORT: - jj_consume_token(SHORT); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Short); - break; - case INT: - jj_consume_token(INT); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Int); - break; - case LONG: - jj_consume_token(LONG); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Long); - break; - case FLOAT: - jj_consume_token(FLOAT); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Float); - break; - case DOUBLE: - jj_consume_token(DOUBLE); - ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Double); - break; - default: - jj_la1[56] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Type ResultType() throws ParseException { - Type ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case VOID: - jj_consume_token(VOID); - ret = new VoidType(token.beginLine, token.beginColumn, token.endLine, token.endColumn); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: - ret = Type(); - break; - default: - jj_la1[57] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public NameExpr Name() throws ParseException { - NameExpr ret; - jj_consume_token(IDENTIFIER); - ret = new NameExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - label_23: while (true) { - if (jj_2_17(2)) { - ; - } else { - break label_23; - } - jj_consume_token(DOT); - jj_consume_token(IDENTIFIER); - ret = new QualifiedNameExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, token.image); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public List NameList() throws ParseException { - List ret = new LinkedList(); - NameExpr name; - name = Name(); - ret.add(name); - label_24: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[58] = jj_gen; - break label_24; - } - jj_consume_token(COMMA); - name = Name(); - ret.add(name); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - /* - * Expression syntax follows. - */ - final public Expression Expression() throws ParseException { - Expression ret; - AssignExpr.Operator op; - Expression value; - ret = ConditionalExpression(); - if (jj_2_18(2)) { - op = AssignmentOperator(); - value = Expression(); - ret = new AssignExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, value, op); - } else { - ; - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public AssignExpr.Operator AssignmentOperator() throws ParseException { - AssignExpr.Operator ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ASSIGN: - jj_consume_token(ASSIGN); - ret = AssignExpr.Operator.assign; - break; - case STARASSIGN: - jj_consume_token(STARASSIGN); - ret = AssignExpr.Operator.star; - break; - case SLASHASSIGN: - jj_consume_token(SLASHASSIGN); - ret = AssignExpr.Operator.slash; - break; - case REMASSIGN: - jj_consume_token(REMASSIGN); - ret = AssignExpr.Operator.rem; - break; - case PLUSASSIGN: - jj_consume_token(PLUSASSIGN); - ret = AssignExpr.Operator.plus; - break; - case MINUSASSIGN: - jj_consume_token(MINUSASSIGN); - ret = AssignExpr.Operator.minus; - break; - case LSHIFTASSIGN: - jj_consume_token(LSHIFTASSIGN); - ret = AssignExpr.Operator.lShift; - break; - case RSIGNEDSHIFTASSIGN: - jj_consume_token(RSIGNEDSHIFTASSIGN); - ret = AssignExpr.Operator.rSignedShift; - break; - case RUNSIGNEDSHIFTASSIGN: - jj_consume_token(RUNSIGNEDSHIFTASSIGN); - ret = AssignExpr.Operator.rUnsignedShift; - break; - case ANDASSIGN: - jj_consume_token(ANDASSIGN); - ret = AssignExpr.Operator.and; - break; - case XORASSIGN: - jj_consume_token(XORASSIGN); - ret = AssignExpr.Operator.xor; - break; - case ORASSIGN: - jj_consume_token(ORASSIGN); - ret = AssignExpr.Operator.or; - break; - default: - jj_la1[59] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression ConditionalExpression() throws ParseException { - Expression ret; - Expression left; - Expression right; - ret = ConditionalOrExpression(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case HOOK: - jj_consume_token(HOOK); - left = Expression(); - jj_consume_token(COLON); - right = ConditionalExpression(); - ret = new ConditionalExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, left, right); - break; - default: - jj_la1[60] = jj_gen; - ; - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression ConditionalOrExpression() throws ParseException { - Expression ret; - Expression right; - ret = ConditionalAndExpression(); - label_25: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case SC_OR: - ; - break; - default: - jj_la1[61] = jj_gen; - break label_25; - } - jj_consume_token(SC_OR); - right = ConditionalAndExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.or); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression ConditionalAndExpression() throws ParseException { - Expression ret; - Expression right; - ret = InclusiveOrExpression(); - label_26: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case SC_AND: - ; - break; - default: - jj_la1[62] = jj_gen; - break label_26; - } - jj_consume_token(SC_AND); - right = InclusiveOrExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.and); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression InclusiveOrExpression() throws ParseException { - Expression ret; - Expression right; - ret = ExclusiveOrExpression(); - label_27: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BIT_OR: - ; - break; - default: - jj_la1[63] = jj_gen; - break label_27; - } - jj_consume_token(BIT_OR); - right = ExclusiveOrExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binOr); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression ExclusiveOrExpression() throws ParseException { - Expression ret; - Expression right; - ret = AndExpression(); - label_28: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case XOR: - ; - break; - default: - jj_la1[64] = jj_gen; - break label_28; - } - jj_consume_token(XOR); - right = AndExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.xor); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression AndExpression() throws ParseException { - Expression ret; - Expression right; - ret = EqualityExpression(); - label_29: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BIT_AND: - ; - break; - default: - jj_la1[65] = jj_gen; - break label_29; - } - jj_consume_token(BIT_AND); - right = EqualityExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binAnd); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression EqualityExpression() throws ParseException { - Expression ret; - Expression right; - BinaryExpr.Operator op; - ret = InstanceOfExpression(); - label_30: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case EQ: - case NE: - ; - break; - default: - jj_la1[66] = jj_gen; - break label_30; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case EQ: - jj_consume_token(EQ); - op = BinaryExpr.Operator.equals; - break; - case NE: - jj_consume_token(NE); - op = BinaryExpr.Operator.notEquals; - break; - default: - jj_la1[67] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = InstanceOfExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression InstanceOfExpression() throws ParseException { - Expression ret; - Type type; - ret = RelationalExpression(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case INSTANCEOF: - jj_consume_token(INSTANCEOF); - type = Type(); - ret = new InstanceOfExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, type); - break; - default: - jj_la1[68] = jj_gen; - ; - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression RelationalExpression() throws ParseException { - Expression ret; - Expression right; - BinaryExpr.Operator op; - ret = ShiftExpression(); - label_31: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - case LE: - case GE: - case GT: - ; - break; - default: - jj_la1[69] = jj_gen; - break label_31; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - jj_consume_token(LT); - op = BinaryExpr.Operator.less; - break; - case GT: - jj_consume_token(GT); - op = BinaryExpr.Operator.greater; - break; - case LE: - jj_consume_token(LE); - op = BinaryExpr.Operator.lessEquals; - break; - case GE: - jj_consume_token(GE); - op = BinaryExpr.Operator.greaterEquals; - break; - default: - jj_la1[70] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = ShiftExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression ShiftExpression() throws ParseException { - Expression ret; - Expression right; - BinaryExpr.Operator op; - ret = AdditiveExpression(); - label_32: while (true) { - if (jj_2_19(1)) { - ; - } else { - break label_32; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LSHIFT: - jj_consume_token(LSHIFT); - op = BinaryExpr.Operator.lShift; - break; - default: - jj_la1[71] = jj_gen; - if (jj_2_20(1)) { - RSIGNEDSHIFT(); - op = BinaryExpr.Operator.rSignedShift; - } else if (jj_2_21(1)) { - RUNSIGNEDSHIFT(); - op = BinaryExpr.Operator.rUnsignedShift; - } else { - jj_consume_token(-1); - throw new ParseException(); - } - } - right = AdditiveExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression AdditiveExpression() throws ParseException { - Expression ret; - Expression right; - BinaryExpr.Operator op; - ret = MultiplicativeExpression(); - label_33: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case PLUS: - case MINUS: - ; - break; - default: - jj_la1[72] = jj_gen; - break label_33; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case PLUS: - jj_consume_token(PLUS); - op = BinaryExpr.Operator.plus; - break; - case MINUS: - jj_consume_token(MINUS); - op = BinaryExpr.Operator.minus; - break; - default: - jj_la1[73] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = MultiplicativeExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression MultiplicativeExpression() throws ParseException { - Expression ret; - Expression right; - BinaryExpr.Operator op; - ret = UnaryExpression(); - label_34: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case STAR: - case SLASH: - case REM: - ; - break; - default: - jj_la1[74] = jj_gen; - break label_34; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case STAR: - jj_consume_token(STAR); - op = BinaryExpr.Operator.times; - break; - case SLASH: - jj_consume_token(SLASH); - op = BinaryExpr.Operator.divide; - break; - case REM: - jj_consume_token(REM); - op = BinaryExpr.Operator.remainder; - break; - default: - jj_la1[75] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - right = UnaryExpression(); - ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression UnaryExpression() throws ParseException { - Expression ret; - UnaryExpr.Operator op; - int line = 0; - int column = 0; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case PLUS: - case MINUS: - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case PLUS: - jj_consume_token(PLUS); - op = UnaryExpr.Operator.positive; - line = token.beginLine; - column = token.beginColumn; - break; - case MINUS: - jj_consume_token(MINUS); - op = UnaryExpr.Operator.negative; - line = token.beginLine; - column = token.beginColumn; - break; - default: - jj_la1[76] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = UnaryExpression(); - if (op == UnaryExpr.Operator.negative) { - if (ret instanceof IntegerLiteralExpr && ((IntegerLiteralExpr) ret).isMinValue()) { - ret = new IntegerLiteralMinValueExpr(line, column, token.endLine, token.endColumn); - } else if (ret instanceof LongLiteralExpr && ((LongLiteralExpr) ret).isMinValue()) { - ret = new LongLiteralMinValueExpr(line, column, token.endLine, token.endColumn); - } else { - ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, op); - } - } else { - ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, op); - } - break; - case INCR: - ret = PreIncrementExpression(); - break; - case DECR: - ret = PreDecrementExpression(); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - ret = UnaryExpressionNotPlusMinus(); - break; - default: - jj_la1[77] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression PreIncrementExpression() throws ParseException { - Expression ret; - int line; - int column; - jj_consume_token(INCR); - line = token.beginLine; - column = token.beginColumn; - ret = PrimaryExpression(); - ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, UnaryExpr.Operator.preIncrement); - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression PreDecrementExpression() throws ParseException { - Expression ret; - int line; - int column; - jj_consume_token(DECR); - line = token.beginLine; - column = token.beginColumn; - ret = PrimaryExpression(); - ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, UnaryExpr.Operator.preDecrement); - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression UnaryExpressionNotPlusMinus() throws ParseException { - Expression ret; - UnaryExpr.Operator op; - int line = 0; - int column = 0; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BANG: - case TILDE: - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case TILDE: - jj_consume_token(TILDE); - op = UnaryExpr.Operator.inverse; - line = token.beginLine; - column = token.beginColumn; - break; - case BANG: - jj_consume_token(BANG); - op = UnaryExpr.Operator.not; - line = token.beginLine; - column = token.beginColumn; - break; - default: - jj_la1[78] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = UnaryExpression(); - ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, op); - break; - default: - jj_la1[79] = jj_gen; - if (jj_2_22(2147483647)) { - ret = CastExpression(); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - ret = PostfixExpression(); - break; - default: - jj_la1[80] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - // This production is to determine lookahead only. The LOOKAHEAD specifications - // below are not used, but they are there just to indicate that we know about - // this. - final public void CastLookahead() throws ParseException { - if (jj_2_23(2147483647)) { - jj_consume_token(LPAREN); - Type(); - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LPAREN: - jj_consume_token(LPAREN); - Type(); - jj_consume_token(RPAREN); - UnaryExpression(); - break; - default: - jj_la1[81] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - - final public Expression PostfixExpression() throws ParseException { - Expression ret; - UnaryExpr.Operator op; - ret = PrimaryExpression(); - if (jj_2_24(2)) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case INCR: - jj_consume_token(INCR); - op = UnaryExpr.Operator.posIncrement; - break; - case DECR: - jj_consume_token(DECR); - op = UnaryExpr.Operator.posDecrement; - break; - default: - jj_la1[82] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - ret = new UnaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, op); - } else { - ; - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression CastExpression() throws ParseException { - Expression ret; - Type type; - int line; - int column; - jj_consume_token(LPAREN); - line = token.beginLine; - column = token.beginColumn; - type = Type(); - jj_consume_token(RPAREN); - ret = UnaryExpression(); - ret = new CastExpr(line, column, token.endLine, token.endColumn, type, ret); - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression PrimaryExpression() throws ParseException { - Expression ret; - Expression inner; - ret = PrimaryPrefix(); - label_35: while (true) { - if (jj_2_25(2)) { - ; - } else { - break label_35; - } - ret = PrimarySuffix(ret); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression PrimaryExpressionWithoutSuperSuffix() throws ParseException { - Expression ret; - Expression inner; - ret = PrimaryPrefix(); - label_36: while (true) { - if (jj_2_26(2147483647)) { - ; - } else { - break label_36; - } - ret = PrimarySuffixWithoutSuper(ret); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression PrimaryPrefix() throws ParseException { - Expression ret; - String name; - List typeArgs = null; - List args = null; - boolean hasArgs = false; - Type type; - int line; - int column; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case FALSE: - case NULL: - case TRUE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - ret = Literal(); - break; - case THIS: - jj_consume_token(THIS); - ret = new ThisExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); - break; - case SUPER: - jj_consume_token(SUPER); - ret = new SuperExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); - jj_consume_token(DOT); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typeArgs = TypeArguments(); - typeArgs.remove(0); - break; - default: - jj_la1[83] = jj_gen; - ; - } - jj_consume_token(IDENTIFIER); - name = token.image; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LPAREN: - args = Arguments(); - hasArgs = true; - break; - default: - jj_la1[84] = jj_gen; - ; - } - ret = hasArgs - ? new MethodCallExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, name, args) - : new FieldAccessExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, null, name); - break; - case LPAREN: - jj_consume_token(LPAREN); - line = token.beginLine; - column = token.beginColumn; - ret = Expression(); - jj_consume_token(RPAREN); - ret = new EnclosedExpr(line, column, token.endLine, token.endColumn, ret); - break; - case NEW: - ret = AllocationExpression(null); - break; - default: - jj_la1[86] = jj_gen; - if (jj_2_27(2147483647)) { - type = ResultType(); - jj_consume_token(DOT); - jj_consume_token(CLASS); - ret = new ClassExpr(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - jj_consume_token(IDENTIFIER); - name = token.image; - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LPAREN: - args = Arguments(); - hasArgs = true; - break; - default: - jj_la1[85] = jj_gen; - ; - } - ret = hasArgs - ? new MethodCallExpr(line, column, token.endLine, token.endColumn, null, null, name, args) - : new NameExpr(line, column, token.endLine, token.endColumn, name); - break; - default: - jj_la1[87] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression PrimarySuffix(Expression scope) throws ParseException { - Expression ret; - if (jj_2_28(2)) { - ret = PrimarySuffixWithoutSuper(scope); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case DOT: - jj_consume_token(DOT); - jj_consume_token(SUPER); - ret = new SuperExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); - break; - default: - jj_la1[88] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression PrimarySuffixWithoutSuper(Expression scope) throws ParseException { - Expression ret; - List typeArgs = null; - List args = null; - boolean hasArgs = false; - String name; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case DOT: - jj_consume_token(DOT); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case THIS: - jj_consume_token(THIS); - ret = new ThisExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); - break; - case NEW: - ret = AllocationExpression(scope); - break; - default: - jj_la1[91] = jj_gen; - if (jj_2_29(2147483647)) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typeArgs = TypeArguments(); - typeArgs.remove(0); - break; - default: - jj_la1[89] = jj_gen; - ; - } - jj_consume_token(IDENTIFIER); - name = token.image; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LPAREN: - args = Arguments(); - hasArgs = true; - break; - default: - jj_la1[90] = jj_gen; - ; - } - ret = hasArgs - ? new MethodCallExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, name, args) - : new FieldAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, name); - } else { - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - case LBRACKET: - jj_consume_token(LBRACKET); - ret = Expression(); - jj_consume_token(RBRACKET); - ret = new ArrayAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, ret); - break; - default: - jj_la1[92] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression Literal() throws ParseException { - Expression ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case INTEGER_LITERAL: - jj_consume_token(INTEGER_LITERAL); - ret = new IntegerLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - break; - case LONG_LITERAL: - jj_consume_token(LONG_LITERAL); - ret = new LongLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - break; - case FLOATING_POINT_LITERAL: - jj_consume_token(FLOATING_POINT_LITERAL); - ret = new DoubleLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - break; - case CHARACTER_LITERAL: - jj_consume_token(CHARACTER_LITERAL); - ret = new CharLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length() - 1)); - break; - case STRING_LITERAL: - jj_consume_token(STRING_LITERAL); - ret = new StringLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length() - 1)); - break; - case FALSE: - case TRUE: - ret = BooleanLiteral(); - break; - case NULL: - ret = NullLiteral(); - break; - default: - jj_la1[93] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression BooleanLiteral() throws ParseException { - Expression ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case TRUE: - jj_consume_token(TRUE); - ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, true); - break; - case FALSE: - jj_consume_token(FALSE); - ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, false); - break; - default: - jj_la1[94] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression NullLiteral() throws ParseException { - jj_consume_token(NULL); - { - if (true) { - return new NullLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn); - } - } - throw new Error("Missing return statement in function"); - } - - final public List Arguments() throws ParseException { - List ret = null; - jj_consume_token(LPAREN); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - ret = ArgumentList(); - break; - default: - jj_la1[95] = jj_gen; - ; - } - jj_consume_token(RPAREN); - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public List ArgumentList() throws ParseException { - List ret = new LinkedList(); - Expression expr; - expr = Expression(); - ret.add(expr); - label_37: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[96] = jj_gen; - break label_37; - } - jj_consume_token(COMMA); - expr = Expression(); - ret.add(expr); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression AllocationExpression(Expression scope) throws ParseException { - Expression ret; - Type type; - Object[] arr = null; - List typeArgs = null; - List anonymousBody = null; - List args; - int line; - int column; - jj_consume_token(NEW); - if (scope == null) { - line = token.beginLine; - column = token.beginColumn; - } else { - line = scope.getBeginLine(); - column = scope.getBeginColumn(); - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - type = PrimitiveType(); - arr = ArrayDimsAndInits(); - if (arr[0] instanceof Integer) { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer) arr[0]).intValue(), (ArrayInitializerExpr) arr[1]); - } else { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List) arr[0], ((Integer) arr[1]).intValue()); - } - break; - default: - jj_la1[98] = jj_gen; - if (jj_2_31(2147483647)) { - type = ClassOrInterfaceType(); - arr = ArrayDimsAndInits(); - if (arr[0] instanceof Integer) { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer) arr[0]).intValue(), (ArrayInitializerExpr) arr[1]); - } else { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List) arr[0], ((Integer) arr[1]).intValue()); - } - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - case LT: - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LT: - typeArgs = TypeArguments(); - typeArgs.remove(0); - break; - default: - jj_la1[97] = jj_gen; - ; - } - type = ClassOrInterfaceType(); - args = Arguments(); - if (jj_2_30(2)) { - anonymousBody = ClassOrInterfaceBody(false); - } else { - ; - } - ret = new ObjectCreationExpr(line, column, token.endLine, token.endColumn, scope, (ClassOrInterfaceType) type, typeArgs, args, anonymousBody); - break; - default: - jj_la1[99] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - /* - * The third LOOKAHEAD specification below is to parse to PrimarySuffix - * if there is an expression between the "[...]". - */ - final public Object[] ArrayDimsAndInits() throws ParseException { - Object[] ret = new Object[2]; - Expression expr; - List inits = null; - int i = 0; - if (jj_2_34(2)) { - label_38: while (true) { - jj_consume_token(LBRACKET); - expr = Expression(); - inits = add(inits, expr); - jj_consume_token(RBRACKET); - if (jj_2_32(2)) { - ; - } else { - break label_38; - } - } - label_39: while (true) { - if (jj_2_33(2)) { - ; - } else { - break label_39; - } - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - i++; - } - ret[0] = inits; - ret[1] = new Integer(i); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACKET: - label_40: while (true) { - jj_consume_token(LBRACKET); - jj_consume_token(RBRACKET); - i++; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case LBRACKET: - ; - break; - default: - jj_la1[100] = jj_gen; - break label_40; - } - } - expr = ArrayInitializer(); - ret[0] = new Integer(i); - ret[1] = expr; - break; - default: - jj_la1[101] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - /* - * Statement syntax follows. - */ - final public Statement Statement() throws ParseException { - Statement ret; - if (jj_2_35(2)) { - ret = LabeledStatement(); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ASSERT: - ret = AssertStatement(); - break; - case LBRACE: - ret = Block(); - break; - case SEMICOLON: - ret = EmptyStatement(); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case INCR: - case DECR: - ret = StatementExpression(); - break; - case SWITCH: - ret = SwitchStatement(); - break; - case IF: - ret = IfStatement(); - break; - case WHILE: - ret = WhileStatement(); - break; - case DO: - ret = DoStatement(); - break; - case FOR: - ret = ForStatement(); - break; - case BREAK: - ret = BreakStatement(); - break; - case CONTINUE: - ret = ContinueStatement(); - break; - case RETURN: - ret = ReturnStatement(); - break; - case THROW: - ret = ThrowStatement(); - break; - case SYNCHRONIZED: - ret = SynchronizedStatement(); - break; - case TRY: - ret = TryStatement(); - break; - default: - jj_la1[102] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public AssertStmt AssertStatement() throws ParseException { - Expression check; - Expression msg = null; - int line; - int column; - jj_consume_token(ASSERT); - line = token.beginLine; - column = token.beginColumn; - check = Expression(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COLON: - jj_consume_token(COLON); - msg = Expression(); - break; - default: - jj_la1[103] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - { - if (true) { - return new AssertStmt(line, column, token.endLine, token.endColumn, check, msg); - } - } - throw new Error("Missing return statement in function"); - } - - final public LabeledStmt LabeledStatement() throws ParseException { - String label; - Statement stmt; - int line; - int column; - jj_consume_token(IDENTIFIER); - line = token.beginLine; - column = token.beginColumn; - label = token.image; - jj_consume_token(COLON); - stmt = Statement(); - { - if (true) { - return new LabeledStmt(line, column, token.endLine, token.endColumn, label, stmt); - } - } - throw new Error("Missing return statement in function"); - } - - final public BlockStmt Block() throws ParseException { - List stmts; - int beginLine; - int beginColumn; - jj_consume_token(LBRACE); - beginLine = token.beginLine; - beginColumn = token.beginColumn; - stmts = Statements(); - jj_consume_token(RBRACE); - { - if (true) { - return new BlockStmt(beginLine, beginColumn, token.endLine, token.endColumn, stmts); - } - } - throw new Error("Missing return statement in function"); - } - - /* - * Classes inside block stametents can only be abstract or final. The semantic must check it. - */ - final public Statement BlockStatement() throws ParseException { - Statement ret; - Expression expr; - ClassOrInterfaceDeclaration typeDecl; - Modifier modifier; - if (jj_2_36(2147483647)) { - pushJavadoc(); - modifier = Modifiers(); - typeDecl = ClassOrInterfaceDeclaration(modifier); - ret = new TypeDeclarationStmt(typeDecl.getBeginLine(), typeDecl.getBeginColumn(), token.endLine, token.endColumn, typeDecl); - } else if (jj_2_37(2147483647)) { - expr = VariableDeclarationExpression(); - jj_consume_token(SEMICOLON); - ret = new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ASSERT: - case BOOLEAN: - case BREAK: - case BYTE: - case CHAR: - case CONTINUE: - case DO: - case DOUBLE: - case FALSE: - case FLOAT: - case FOR: - case IF: - case INT: - case LONG: - case NEW: - case NULL: - case RETURN: - case SHORT: - case SUPER: - case SWITCH: - case SYNCHRONIZED: - case THIS: - case THROW: - case TRUE: - case TRY: - case VOID: - case WHILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case SEMICOLON: - case INCR: - case DECR: - ret = Statement(); - break; - default: - jj_la1[104] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public VariableDeclarationExpr VariableDeclarationExpression() throws ParseException { - Modifier modifier; - Type type; - List vars = new LinkedList(); - VariableDeclarator var; - modifier = Modifiers(); - type = Type(); - var = VariableDeclarator(); - vars.add(var); - label_41: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[105] = jj_gen; - break label_41; - } - jj_consume_token(COMMA); - var = VariableDeclarator(); - vars.add(var); - } - int line = modifier.beginLine; - int column = modifier.beginColumn; - if (line == -1) { - line = type.getBeginLine(); - column = type.getBeginColumn(); - } - { - if (true) { - return new VariableDeclarationExpr(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, vars); - } - } - throw new Error("Missing return statement in function"); - } - - final public EmptyStmt EmptyStatement() throws ParseException { - jj_consume_token(SEMICOLON); - { - if (true) { - return new EmptyStmt(token.beginLine, token.beginColumn, token.endLine, token.endColumn); - } - } - throw new Error("Missing return statement in function"); - } - - final public ExpressionStmt StatementExpression() throws ParseException { - Expression expr; - AssignExpr.Operator op; - Expression value; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case INCR: - expr = PreIncrementExpression(); - break; - case DECR: - expr = PreDecrementExpression(); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - expr = PrimaryExpression(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ASSIGN: - case INCR: - case DECR: - case PLUSASSIGN: - case MINUSASSIGN: - case STARASSIGN: - case SLASHASSIGN: - case ANDASSIGN: - case ORASSIGN: - case XORASSIGN: - case REMASSIGN: - case LSHIFTASSIGN: - case RSIGNEDSHIFTASSIGN: - case RUNSIGNEDSHIFTASSIGN: - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case INCR: - jj_consume_token(INCR); - expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posIncrement); - break; - case DECR: - jj_consume_token(DECR); - expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posDecrement); - break; - case ASSIGN: - case PLUSASSIGN: - case MINUSASSIGN: - case STARASSIGN: - case SLASHASSIGN: - case ANDASSIGN: - case ORASSIGN: - case XORASSIGN: - case REMASSIGN: - case LSHIFTASSIGN: - case RSIGNEDSHIFTASSIGN: - case RUNSIGNEDSHIFTASSIGN: - op = AssignmentOperator(); - value = Expression(); - expr = new AssignExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, value, op); - break; - default: - jj_la1[106] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - default: - jj_la1[107] = jj_gen; - ; - } - break; - default: - jj_la1[108] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(SEMICOLON); - { - if (true) { - return new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); - } - } - throw new Error("Missing return statement in function"); - } - - final public SwitchStmt SwitchStatement() throws ParseException { - Expression selector; - SwitchEntryStmt entry; - List entries = null; - int line; - int column; - jj_consume_token(SWITCH); - line = token.beginLine; - column = token.beginColumn; - jj_consume_token(LPAREN); - selector = Expression(); - jj_consume_token(RPAREN); - jj_consume_token(LBRACE); - label_42: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CASE: - case _DEFAULT: - ; - break; - default: - jj_la1[109] = jj_gen; - break label_42; - } - entry = SwitchEntry(); - entries = add(entries, entry); - } - jj_consume_token(RBRACE); - { - if (true) { - return new SwitchStmt(line, column, token.endLine, token.endColumn, selector, entries); - } - } - throw new Error("Missing return statement in function"); - } - - final public SwitchEntryStmt SwitchEntry() throws ParseException { - Expression label = null; - List stmts; - int line; - int column; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CASE: - jj_consume_token(CASE); - line = token.beginLine; - column = token.beginColumn; - label = Expression(); - break; - case _DEFAULT: - jj_consume_token(_DEFAULT); - line = token.beginLine; - column = token.beginColumn; - break; - default: - jj_la1[110] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(COLON); - stmts = Statements(); - { - if (true) { - return new SwitchEntryStmt(line, column, token.endLine, token.endColumn, label, stmts); - } - } - throw new Error("Missing return statement in function"); - } - - final public IfStmt IfStatement() throws ParseException { - Expression condition; - Statement thenStmt; - Statement elseStmt = null; - int line; - int column; - jj_consume_token(IF); - line = token.beginLine; - column = token.beginColumn; - jj_consume_token(LPAREN); - condition = Expression(); - jj_consume_token(RPAREN); - thenStmt = Statement(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ELSE: - jj_consume_token(ELSE); - elseStmt = Statement(); - break; - default: - jj_la1[111] = jj_gen; - ; - } - { - if (true) { - return new IfStmt(line, column, token.endLine, token.endColumn, condition, thenStmt, elseStmt); - } - } - throw new Error("Missing return statement in function"); - } - - final public WhileStmt WhileStatement() throws ParseException { - Expression condition; - Statement body; - int line; - int column; - jj_consume_token(WHILE); - line = token.beginLine; - column = token.beginColumn; - jj_consume_token(LPAREN); - condition = Expression(); - jj_consume_token(RPAREN); - body = Statement(); - { - if (true) { - return new WhileStmt(line, column, token.endLine, token.endColumn, condition, body); - } - } - throw new Error("Missing return statement in function"); - } - - final public DoStmt DoStatement() throws ParseException { - Expression condition; - Statement body; - int line; - int column; - jj_consume_token(DO); - line = token.beginLine; - column = token.beginColumn; - body = Statement(); - jj_consume_token(WHILE); - jj_consume_token(LPAREN); - condition = Expression(); - jj_consume_token(RPAREN); - jj_consume_token(SEMICOLON); - { - if (true) { - return new DoStmt(line, column, token.endLine, token.endColumn, body, condition); - } - } - throw new Error("Missing return statement in function"); - } - - final public Statement ForStatement() throws ParseException { - String id = null; - VariableDeclarationExpr varExpr = null; - Expression expr = null; - List init = null; - List update = null; - Statement body; - int line; - int column; - jj_consume_token(FOR); - line = token.beginLine; - column = token.beginColumn; - jj_consume_token(LPAREN); - if (jj_2_38(2147483647)) { - varExpr = VariableDeclarationExpression(); - jj_consume_token(COLON); - expr = Expression(); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SYNCHRONIZED: - case THIS: - case TRANSIENT: - case TRUE: - case VOID: - case VOLATILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case SEMICOLON: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FINAL: - case FLOAT: - case INT: - case LONG: - case NATIVE: - case NEW: - case NULL: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SUPER: - case SYNCHRONIZED: - case THIS: - case TRANSIENT: - case TRUE: - case VOID: - case VOLATILE: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - init = ForInit(); - break; - default: - jj_la1[112] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - expr = Expression(); - break; - default: - jj_la1[113] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - update = ForUpdate(); - break; - default: - jj_la1[114] = jj_gen; - ; - } - break; - default: - jj_la1[115] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - jj_consume_token(RPAREN); - body = Statement(); - if (varExpr != null) { - { - if (true) { - return new ForeachStmt(line, column, token.endLine, token.endColumn, varExpr, expr, body); - } - } - } - { - if (true) { - return new ForStmt(line, column, token.endLine, token.endColumn, init, expr, update, body); - } - } - throw new Error("Missing return statement in function"); - } - - final public List ForInit() throws ParseException { - List ret; - Expression expr; - if (jj_2_39(2147483647)) { - expr = VariableDeclarationExpression(); - ret = new LinkedList(); - ret.add(expr); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - ret = ExpressionList(); - break; - default: - jj_la1[116] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public List ExpressionList() throws ParseException { - List ret = new LinkedList(); - Expression expr; - expr = Expression(); - ret.add(expr); - label_43: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[117] = jj_gen; - break label_43; - } - jj_consume_token(COMMA); - expr = Expression(); - ret.add(expr); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public List ForUpdate() throws ParseException { - List ret; - ret = ExpressionList(); - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public BreakStmt BreakStatement() throws ParseException { - String id = null; - int line; - int column; - jj_consume_token(BREAK); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - jj_consume_token(IDENTIFIER); - id = token.image; - break; - default: - jj_la1[118] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - { - if (true) { - return new BreakStmt(line, column, token.endLine, token.endColumn, id); - } - } - throw new Error("Missing return statement in function"); - } - - final public ContinueStmt ContinueStatement() throws ParseException { - String id = null; - int line; - int column; - jj_consume_token(CONTINUE); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - jj_consume_token(IDENTIFIER); - id = token.image; - break; - default: - jj_la1[119] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - { - if (true) { - return new ContinueStmt(line, column, token.endLine, token.endColumn, id); - } - } - throw new Error("Missing return statement in function"); - } - - final public ReturnStmt ReturnStatement() throws ParseException { - Expression expr = null; - int line; - int column; - jj_consume_token(RETURN); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - expr = Expression(); - break; - default: - jj_la1[120] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - { - if (true) { - return new ReturnStmt(line, column, token.endLine, token.endColumn, expr); - } - } - throw new Error("Missing return statement in function"); - } - - final public ThrowStmt ThrowStatement() throws ParseException { - Expression expr; - int line; - int column; - jj_consume_token(THROW); - line = token.beginLine; - column = token.beginColumn; - expr = Expression(); - jj_consume_token(SEMICOLON); - { - if (true) { - return new ThrowStmt(line, column, token.endLine, token.endColumn, expr); - } - } - throw new Error("Missing return statement in function"); - } - - final public SynchronizedStmt SynchronizedStatement() throws ParseException { - Expression expr; - BlockStmt block; - int line; - int column; - jj_consume_token(SYNCHRONIZED); - line = token.beginLine; - column = token.beginColumn; - jj_consume_token(LPAREN); - expr = Expression(); - jj_consume_token(RPAREN); - block = Block(); - { - if (true) { - return new SynchronizedStmt(line, column, token.endLine, token.endColumn, expr, block); - } - } - throw new Error("Missing return statement in function"); - } - - final public TryStmt TryStatement() throws ParseException { - BlockStmt tryBlock; - BlockStmt finallyBlock = null; - List catchs = null; - Parameter except; - BlockStmt catchBlock; - int line; - int column; - int cLine; - int cColumn; - jj_consume_token(TRY); - line = token.beginLine; - column = token.beginColumn; - tryBlock = Block(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CATCH: - label_44: while (true) { - jj_consume_token(CATCH); - cLine = token.beginLine; - cColumn = token.beginColumn; - jj_consume_token(LPAREN); - except = FormalParameter(); - jj_consume_token(RPAREN); - catchBlock = Block(); - catchs = add(catchs, new CatchClause(cLine, cColumn, token.endLine, token.endColumn, except, catchBlock)); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CATCH: - ; - break; - default: - jj_la1[121] = jj_gen; - break label_44; - } - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case FINALLY: - jj_consume_token(FINALLY); - finallyBlock = Block(); - break; - default: - jj_la1[122] = jj_gen; - ; - } - break; - case FINALLY: - jj_consume_token(FINALLY); - finallyBlock = Block(); - break; - default: - jj_la1[123] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return new TryStmt(line, column, token.endLine, token.endColumn, tryBlock, catchs, finallyBlock); - } - } - throw new Error("Missing return statement in function"); - } - - /* - * We use productions to match >>>, >> and > so that we can keep the - * type declaration syntax with generics clean - */ - final public void RUNSIGNEDSHIFT() throws ParseException { - if (getToken(1).kind == GT && - ((GTToken) getToken(1)).realKind == RUNSIGNEDSHIFT) { - - } else { - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(GT); - jj_consume_token(GT); - jj_consume_token(GT); - } - - final public void RSIGNEDSHIFT() throws ParseException { - if (getToken(1).kind == GT && - ((GTToken) getToken(1)).realKind == RSIGNEDSHIFT) { - - } else { - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(GT); - jj_consume_token(GT); - } - - /* Annotation syntax follows. */ - final public AnnotationExpr Annotation() throws ParseException { - AnnotationExpr ret; - if (jj_2_40(2147483647)) { - ret = NormalAnnotation(); - } else if (jj_2_41(2147483647)) { - ret = SingleMemberAnnotation(); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ret = MarkerAnnotation(); - break; - default: - jj_la1[124] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public NormalAnnotationExpr NormalAnnotation() throws ParseException { - NameExpr name; - List pairs = null; - int line; - int column; - jj_consume_token(AT); - line = token.beginLine; - column = token.beginColumn; - name = Name(); - jj_consume_token(LPAREN); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case IDENTIFIER: - pairs = MemberValuePairs(); - break; - default: - jj_la1[125] = jj_gen; - ; - } - jj_consume_token(RPAREN); - { - if (true) { - return new NormalAnnotationExpr(line, column, token.endLine, token.endColumn, name, pairs); - } - } - throw new Error("Missing return statement in function"); - } - - final public MarkerAnnotationExpr MarkerAnnotation() throws ParseException { - NameExpr name; - int line; - int column; - jj_consume_token(AT); - line = token.beginLine; - column = token.beginColumn; - name = Name(); - { - if (true) { - return new MarkerAnnotationExpr(line, column, token.endLine, token.endColumn, name); - } - } - throw new Error("Missing return statement in function"); - } - - final public SingleMemberAnnotationExpr SingleMemberAnnotation() throws ParseException { - NameExpr name; - Expression memberVal; - int line; - int column; - jj_consume_token(AT); - line = token.beginLine; - column = token.beginColumn; - name = Name(); - jj_consume_token(LPAREN); - memberVal = MemberValue(); - jj_consume_token(RPAREN); - { - if (true) { - return new SingleMemberAnnotationExpr(line, column, token.endLine, token.endColumn, name, memberVal); - } - } - throw new Error("Missing return statement in function"); - } - - final public List MemberValuePairs() throws ParseException { - List ret = new LinkedList(); - MemberValuePair pair; - pair = MemberValuePair(); - ret.add(pair); - label_45: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - ; - break; - default: - jj_la1[126] = jj_gen; - break label_45; - } - jj_consume_token(COMMA); - pair = MemberValuePair(); - ret.add(pair); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public MemberValuePair MemberValuePair() throws ParseException { - String name; - Expression value; - int line; - int column; - jj_consume_token(IDENTIFIER); - name = token.image; - line = token.beginLine; - column = token.beginColumn; - jj_consume_token(ASSIGN); - value = MemberValue(); - { - if (true) { - return new MemberValuePair(line, column, token.endLine, token.endColumn, name, value); - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression MemberValue() throws ParseException { - Expression ret; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case AT: - ret = Annotation(); - break; - case LBRACE: - ret = MemberValueArrayInitializer(); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - ret = ConditionalExpression(); - break; - default: - jj_la1[127] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression MemberValueArrayInitializer() throws ParseException { - List ret = new LinkedList(); - Expression member; - int line; - int column; - jj_consume_token(LBRACE); - line = token.beginLine; - column = token.beginColumn; - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FALSE: - case FLOAT: - case INT: - case LONG: - case NEW: - case NULL: - case SHORT: - case SUPER: - case THIS: - case TRUE: - case VOID: - case LONG_LITERAL: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case CHARACTER_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: - case LBRACE: - case AT: - case BANG: - case TILDE: - case INCR: - case DECR: - case PLUS: - case MINUS: - member = MemberValue(); - ret.add(member); - label_46: while (true) { - if (jj_2_42(2)) { - ; - } else { - break label_46; - } - jj_consume_token(COMMA); - member = MemberValue(); - ret.add(member); - } - break; - default: - jj_la1[128] = jj_gen; - ; - } - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case COMMA: - jj_consume_token(COMMA); - break; - default: - jj_la1[129] = jj_gen; - ; - } - jj_consume_token(RBRACE); - { - if (true) { - return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn, ret); - } - } - throw new Error("Missing return statement in function"); - } - - /* Annotation Types. */ - final public AnnotationDeclaration AnnotationTypeDeclaration(Modifier modifier) throws ParseException { - String name; - List members; - int line = modifier.beginLine; - int column = modifier.beginColumn; - jj_consume_token(AT); - if (line == -1) { - line = token.beginLine; - column = token.beginColumn; - } - jj_consume_token(INTERFACE); - jj_consume_token(IDENTIFIER); - name = token.image; - members = AnnotationTypeBody(); - { - if (true) { - return new AnnotationDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, name, members); - } - } - throw new Error("Missing return statement in function"); - } - - final public List AnnotationTypeBody() throws ParseException { - List ret = null; - BodyDeclaration member; - jj_consume_token(LBRACE); - label_47: while (true) { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case IDENTIFIER: - case SEMICOLON: - case AT: - ; - break; - default: - jj_la1[130] = jj_gen; - break label_47; - } - member = AnnotationBodyDeclaration(); - ret = add(ret, member); - } - jj_consume_token(RBRACE); - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public BodyDeclaration AnnotationBodyDeclaration() throws ParseException { - Modifier modifier; - BodyDeclaration ret; - pushJavadoc(); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case SEMICOLON: - jj_consume_token(SEMICOLON); - ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); - break; - case ABSTRACT: - case BOOLEAN: - case BYTE: - case CHAR: - case CLASS: - case DOUBLE: - case ENUM: - case FINAL: - case FLOAT: - case INT: - case INTERFACE: - case LONG: - case NATIVE: - case PRIVATE: - case PROTECTED: - case PUBLIC: - case SHORT: - case STATIC: - case STRICTFP: - case SYNCHRONIZED: - case TRANSIENT: - case VOLATILE: - case IDENTIFIER: - case AT: - modifier = Modifiers(); - if (jj_2_43(2147483647)) { - ret = AnnotationTypeMemberDeclaration(modifier); - } else { - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case CLASS: - case INTERFACE: - ret = ClassOrInterfaceDeclaration(modifier); - break; - case ENUM: - ret = EnumDeclaration(modifier); - break; - case AT: - ret = AnnotationTypeDeclaration(modifier); - break; - case BOOLEAN: - case BYTE: - case CHAR: - case DOUBLE: - case FLOAT: - case INT: - case LONG: - case SHORT: - case IDENTIFIER: - ret = FieldDeclaration(modifier); - break; - default: - jj_la1[131] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - break; - default: - jj_la1[132] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - final public AnnotationMemberDeclaration AnnotationTypeMemberDeclaration(Modifier modifier) throws ParseException { - Type type; - String name; - Expression defaultVal = null; - type = Type(); - jj_consume_token(IDENTIFIER); - name = token.image; - jj_consume_token(LPAREN); - jj_consume_token(RPAREN); - switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { - case _DEFAULT: - defaultVal = DefaultValue(); - break; - default: - jj_la1[133] = jj_gen; - ; - } - jj_consume_token(SEMICOLON); - int line = modifier.beginLine; - int column = modifier.beginColumn; - { - if (line == -1) { - line = type.getBeginLine(); - column = type.getBeginColumn(); - } - } - { - if (true) { - return new AnnotationMemberDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, type, name, defaultVal); - } - } - throw new Error("Missing return statement in function"); - } - - final public Expression DefaultValue() throws ParseException { - Expression ret; - jj_consume_token(_DEFAULT); - ret = MemberValue(); - { - if (true) { - return ret; - } - } - throw new Error("Missing return statement in function"); - } - - private boolean jj_2_1(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_1(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(0, xla); - } - } - - private boolean jj_2_2(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_2(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(1, xla); - } - } - - private boolean jj_2_3(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_3(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(2, xla); - } - } - - private boolean jj_2_4(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_4(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(3, xla); - } - } - - private boolean jj_2_5(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_5(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(4, xla); - } - } - - private boolean jj_2_6(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_6(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(5, xla); - } - } - - private boolean jj_2_7(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_7(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(6, xla); - } - } - - private boolean jj_2_8(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_8(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(7, xla); - } - } - - private boolean jj_2_9(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_9(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(8, xla); - } - } - - private boolean jj_2_10(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_10(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(9, xla); - } - } - - private boolean jj_2_11(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_11(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(10, xla); - } - } - - private boolean jj_2_12(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_12(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(11, xla); - } - } - - private boolean jj_2_13(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_13(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(12, xla); - } - } - - private boolean jj_2_14(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_14(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(13, xla); - } - } - - private boolean jj_2_15(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_15(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(14, xla); - } - } - - private boolean jj_2_16(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_16(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(15, xla); - } - } - - private boolean jj_2_17(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_17(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(16, xla); - } - } - - private boolean jj_2_18(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_18(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(17, xla); - } - } - - private boolean jj_2_19(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_19(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(18, xla); - } - } - - private boolean jj_2_20(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_20(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(19, xla); - } - } - - private boolean jj_2_21(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_21(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(20, xla); - } - } - - private boolean jj_2_22(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_22(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(21, xla); - } - } - - private boolean jj_2_23(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_23(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(22, xla); - } - } - - private boolean jj_2_24(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_24(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(23, xla); - } - } - - private boolean jj_2_25(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_25(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(24, xla); - } - } - - private boolean jj_2_26(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_26(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(25, xla); - } - } - - private boolean jj_2_27(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_27(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(26, xla); - } - } - - private boolean jj_2_28(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_28(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(27, xla); - } - } - - private boolean jj_2_29(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_29(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(28, xla); - } - } - - private boolean jj_2_30(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_30(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(29, xla); - } - } - - private boolean jj_2_31(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_31(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(30, xla); - } - } - - private boolean jj_2_32(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_32(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(31, xla); - } - } - - private boolean jj_2_33(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_33(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(32, xla); - } - } - - private boolean jj_2_34(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_34(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(33, xla); - } - } - - private boolean jj_2_35(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_35(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(34, xla); - } - } - - private boolean jj_2_36(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_36(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(35, xla); - } - } - - private boolean jj_2_37(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_37(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(36, xla); - } - } - - private boolean jj_2_38(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_38(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(37, xla); - } - } - - private boolean jj_2_39(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_39(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(38, xla); - } - } - - private boolean jj_2_40(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_40(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(39, xla); - } - } - - private boolean jj_2_41(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_41(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(40, xla); - } - } - - private boolean jj_2_42(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_42(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(41, xla); - } - } - - private boolean jj_2_43(int xla) { - jj_la = xla; - jj_lastpos = jj_scanpos = token; - try { - return !jj_3_43(); - } catch (LookaheadSuccess ls) { - return true; - } finally { - jj_save(42, xla); - } - } - - private boolean jj_3R_100() { - if (jj_3R_145()) { - return true; - } - return false; - } - - private boolean jj_3R_168() { - if (jj_scan_token(ASSIGN)) { - return true; - } - if (jj_3R_66()) { - return true; - } - return false; - } - - private boolean jj_3R_207() { - if (jj_scan_token(CHARACTER_LITERAL)) { - return true; - } - return false; - } - - private boolean jj_3R_206() { - if (jj_scan_token(FLOATING_POINT_LITERAL)) { - return true; - } - return false; - } - - private boolean jj_3R_66() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_100()) { - jj_scanpos = xsp; - if (jj_3R_101()) { - return true; - } - } - return false; - } - - private boolean jj_3R_205() { - if (jj_scan_token(LONG_LITERAL)) { - return true; - } - return false; - } - - private boolean jj_3R_361() { - if (jj_3R_372()) { - return true; - } - return false; - } - - private boolean jj_3R_204() { - if (jj_scan_token(INTEGER_LITERAL)) { - return true; - } - return false; - } - - private boolean jj_3R_83() { - if (jj_3R_71()) { - return true; - } - return false; - } - - private boolean jj_3R_167() { - if (jj_scan_token(IDENTIFIER)) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_200()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3_29() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_83()) { - jj_scanpos = xsp; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - return false; - } - - private boolean jj_3R_64() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - return false; - } - - private boolean jj_3R_184() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_204()) { - jj_scanpos = xsp; - if (jj_3R_205()) { - jj_scanpos = xsp; - if (jj_3R_206()) { - jj_scanpos = xsp; - if (jj_3R_207()) { - jj_scanpos = xsp; - if (jj_3R_208()) { - jj_scanpos = xsp; - if (jj_3R_209()) { - jj_scanpos = xsp; - if (jj_3R_210()) { - return true; - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_128() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_3R_73()) { - return true; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - return false; - } - - private boolean jj_3R_196() { - if (jj_3R_147()) { - return true; - } - return false; - } - - private boolean jj_3R_195() { - if (jj_3R_71()) { - return true; - } - return false; - } - - private boolean jj_3R_133() { - if (jj_3R_167()) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_168()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3R_164() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_195()) { - jj_scanpos = xsp; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - xsp = jj_scanpos; - if (jj_3R_196()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3R_163() { - if (jj_3R_187()) { - return true; - } - return false; - } - - private boolean jj_3R_173() { - if (jj_3R_201()) { - return true; - } - return false; - } - - private boolean jj_3R_162() { - if (jj_scan_token(THIS)) { - return true; - } - return false; - } - - private boolean jj_3R_321() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_133()) { - return true; - } - return false; - } - - private boolean jj_3_5() { - if (jj_3R_63()) { - return true; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_64()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_scan_token(87)) { - jj_scanpos = xsp; - if (jj_scan_token(90)) { - jj_scanpos = xsp; - if (jj_scan_token(86)) { - return true; - } - } - } - return false; - } - - private boolean jj_3R_62() { - if (jj_3R_96()) { - return true; - } - return false; - } - - private boolean jj_3R_127() { - if (jj_scan_token(DOT)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_162()) { - jj_scanpos = xsp; - if (jj_3R_163()) { - jj_scanpos = xsp; - if (jj_3R_164()) { - return true; - } - } - } - return false; - } - - private boolean jj_3_4() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_62()) { - jj_scanpos = xsp; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - return false; - } - - private boolean jj_3R_247() { - if (jj_3R_63()) { - return true; - } - if (jj_3R_133()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_321()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_226() { - if (jj_3R_248()) { - return true; - } - return false; - } - - private boolean jj_3R_81() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_127()) { - jj_scanpos = xsp; - if (jj_3R_128()) { - return true; - } - } - return false; - } - - private boolean jj_3R_198() { - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_225() { - if (jj_3R_247()) { - return true; - } - return false; - } - - private boolean jj_3R_224() { - if (jj_3R_246()) { - return true; - } - return false; - } - - private boolean jj_3R_372() { - if (jj_scan_token(_DEFAULT)) { - return true; - } - if (jj_3R_92()) { - return true; - } - return false; - } - - private boolean jj_3R_223() { - if (jj_3R_245()) { - return true; - } - return false; - } - - private boolean jj_3R_126() { - if (jj_scan_token(DOT)) { - return true; - } - if (jj_scan_token(SUPER)) { - return true; - } - return false; - } - - private boolean jj_3R_222() { - if (jj_3R_244()) { - return true; - } - return false; - } - - private boolean jj_3_28() { - if (jj_3R_81()) { - return true; - } - return false; - } - - private boolean jj_3R_221() { - if (jj_3R_243()) { - return true; - } - return false; - } - - private boolean jj_3R_188() { - if (jj_3R_147()) { - return true; - } - return false; - } - - private boolean jj_3R_80() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_28()) { - jj_scanpos = xsp; - if (jj_3R_126()) { - return true; - } - } - return false; - } - - private boolean jj_3_27() { - if (jj_3R_82()) { - return true; - } - if (jj_scan_token(DOT)) { - return true; - } - if (jj_scan_token(CLASS)) { - return true; - } - return false; - } - - private boolean jj_3R_197() { - if (jj_3R_88()) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_221()) { - jj_scanpos = xsp; - if (jj_3R_222()) { - jj_scanpos = xsp; - if (jj_3R_223()) { - jj_scanpos = xsp; - if (jj_3R_224()) { - jj_scanpos = xsp; - if (jj_3R_225()) { - jj_scanpos = xsp; - if (jj_3R_226()) { - return true; - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_156() { - if (jj_scan_token(IDENTIFIER)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_188()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3R_360() { - if (jj_3R_63()) { - return true; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_scan_token(RPAREN)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_361()) { - jj_scanpos = xsp; - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3_43() { - if (jj_3R_63()) { - return true; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - return false; - } - - private boolean jj_3R_356() { - if (jj_3R_247()) { - return true; - } - return false; - } - - private boolean jj_3_6() { - if (jj_3R_65()) { - return true; - } - return false; - } - - private boolean jj_3R_355() { - if (jj_3R_245()) { - return true; - } - return false; - } - - private boolean jj_3R_155() { - if (jj_3R_82()) { - return true; - } - if (jj_scan_token(DOT)) { - return true; - } - if (jj_scan_token(CLASS)) { - return true; - } - return false; - } - - private boolean jj_3R_354() { - if (jj_3R_244()) { - return true; - } - return false; - } - - private boolean jj_3R_154() { - if (jj_3R_187()) { - return true; - } - return false; - } - - private boolean jj_3R_353() { - if (jj_3R_243()) { - return true; - } - return false; - } - - private boolean jj_3R_153() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_3R_73()) { - return true; - } - if (jj_scan_token(RPAREN)) { - return true; - } - return false; - } - - private boolean jj_3R_352() { - if (jj_3R_360()) { - return true; - } - return false; - } - - private boolean jj_3R_165() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_6()) { - jj_scanpos = xsp; - if (jj_3R_197()) { - jj_scanpos = xsp; - if (jj_3R_198()) { - return true; - } - } - } - return false; - } - - private boolean jj_3_42() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_92()) { - return true; - } - return false; - } - - private boolean jj_3_26() { - if (jj_3R_81()) { - return true; - } - return false; - } - - private boolean jj_3R_186() { - if (jj_3R_147()) { - return true; - } - return false; - } - - private boolean jj_3R_185() { - if (jj_3R_71()) { - return true; - } - return false; - } - - private boolean jj_3R_131() { - if (jj_3R_165()) { - return true; - } - return false; - } - - private boolean jj_3R_346() { - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_347() { - if (jj_3R_88()) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_352()) { - jj_scanpos = xsp; - if (jj_3R_353()) { - jj_scanpos = xsp; - if (jj_3R_354()) { - jj_scanpos = xsp; - if (jj_3R_355()) { - jj_scanpos = xsp; - if (jj_3R_356()) { - return true; - } - } - } - } - } - return false; - } - - private boolean jj_3R_152() { - if (jj_scan_token(SUPER)) { - return true; - } - if (jj_scan_token(DOT)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_185()) { - jj_scanpos = xsp; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - xsp = jj_scanpos; - if (jj_3R_186()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3R_151() { - if (jj_scan_token(THIS)) { - return true; - } - return false; - } - - private boolean jj_3R_84() { - if (jj_scan_token(LBRACE)) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_131()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(RBRACE)) { - return true; - } - return false; - } - - private boolean jj_3R_150() { - if (jj_3R_184()) { - return true; - } - return false; - } - - private boolean jj_3R_105() { - if (jj_3R_81()) { - return true; - } - return false; - } - - private boolean jj_3R_341() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_346()) { - jj_scanpos = xsp; - if (jj_3R_347()) { - return true; - } - } - return false; - } - - private boolean jj_3_3() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_61()) { - return true; - } - return false; - } - - private boolean jj_3R_228() { - if (jj_scan_token(BIT_AND)) { - return true; - } - if (jj_3R_85()) { - return true; - } - return false; - } - - private boolean jj_3R_330() { - if (jj_3R_341()) { - return true; - } - return false; - } - - private boolean jj_3R_201() { - if (jj_scan_token(EXTENDS)) { - return true; - } - if (jj_3R_85()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_228()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_104() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_150()) { - jj_scanpos = xsp; - if (jj_3R_151()) { - jj_scanpos = xsp; - if (jj_3R_152()) { - jj_scanpos = xsp; - if (jj_3R_153()) { - jj_scanpos = xsp; - if (jj_3R_154()) { - jj_scanpos = xsp; - if (jj_3R_155()) { - jj_scanpos = xsp; - if (jj_3R_156()) { - return true; - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3_25() { - if (jj_3R_80()) { - return true; - } - return false; - } - - private boolean jj_3R_317() { - if (jj_scan_token(LBRACE)) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_330()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(RBRACE)) { - return true; - } - return false; - } - - private boolean jj_3R_141() { - if (jj_scan_token(IDENTIFIER)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_173()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3R_340() { - if (jj_3R_84()) { - return true; - } - return false; - } - - private boolean jj_3R_68() { - if (jj_3R_104()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_105()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_245() { - if (jj_scan_token(AT)) { - return true; - } - if (jj_scan_token(INTERFACE)) { - return true; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_3R_317()) { - return true; - } - return false; - } - - private boolean jj_3R_142() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_141()) { - return true; - } - return false; - } - - private boolean jj_3R_96() { - if (jj_scan_token(LT)) { - return true; - } - if (jj_3R_141()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_142()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(GT)) { - return true; - } - return false; - } - - private boolean jj_3R_265() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_264()) { - return true; - } - return false; - } - - private boolean jj_3R_238() { - if (jj_3R_104()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_25()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_283() { - if (jj_3R_92()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_42()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_227() { - if (jj_3R_249()) { - return true; - } - return false; - } - - private boolean jj_3R_169() { - if (jj_scan_token(LBRACE)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_283()) { - jj_scanpos = xsp; - } - xsp = jj_scanpos; - if (jj_scan_token(87)) { - jj_scanpos = xsp; - } - if (jj_scan_token(RBRACE)) { - return true; - } - return false; - } - - private boolean jj_3R_339() { - if (jj_3R_147()) { - return true; - } - return false; - } - - private boolean jj_3R_329() { - if (jj_3R_165()) { - return true; - } - return false; - } - - private boolean jj_3R_95() { - if (jj_3R_94()) { - return true; - } - return false; - } - - private boolean jj_3R_258() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_3R_63()) { - return true; - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_3R_161()) { - return true; - } - return false; - } - - private boolean jj_3R_137() { - if (jj_3R_121()) { - return true; - } - return false; - } - - private boolean jj_3R_61() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_95()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - xsp = jj_scanpos; - if (jj_3R_339()) { - jj_scanpos = xsp; - } - xsp = jj_scanpos; - if (jj_3R_340()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3R_136() { - if (jj_3R_169()) { - return true; - } - return false; - } - - private boolean jj_3R_135() { - if (jj_3R_94()) { - return true; - } - return false; - } - - private boolean jj_3R_316() { - if (jj_scan_token(SEMICOLON)) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_329()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_79() { - if (jj_scan_token(DECR)) { - return true; - } - return false; - } - - private boolean jj_3_24() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_78()) { - jj_scanpos = xsp; - if (jj_3R_79()) { - return true; - } - } - return false; - } - - private boolean jj_3R_78() { - if (jj_scan_token(INCR)) { - return true; - } - return false; - } - - private boolean jj_3R_92() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_135()) { - jj_scanpos = xsp; - if (jj_3R_136()) { - jj_scanpos = xsp; - if (jj_3R_137()) { - return true; - } - } - } - return false; - } - - private boolean jj_3R_259() { - if (jj_3R_238()) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3_24()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3_23() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_3R_63()) { - return true; - } - if (jj_scan_token(LBRACKET)) { - return true; - } - return false; - } - - private boolean jj_3R_315() { - if (jj_3R_61()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_3()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_264() { - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_scan_token(ASSIGN)) { - return true; - } - if (jj_3R_92()) { - return true; - } - return false; - } - - private boolean jj_3_22() { - if (jj_3R_77()) { - return true; - } - return false; - } - - private boolean jj_3R_125() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_3R_63()) { - return true; - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_3R_161()) { - return true; - } - return false; - } - - private boolean jj_3R_314() { - if (jj_3R_328()) { - return true; - } - return false; - } - - private boolean jj_3R_124() { - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_3R_63()) { - return true; - } - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - return false; - } - - private boolean jj_3R_77() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_124()) { - jj_scanpos = xsp; - if (jj_3R_125()) { - return true; - } - } - return false; - } - - private boolean jj_3R_244() { - if (jj_scan_token(ENUM)) { - return true; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_314()) { - jj_scanpos = xsp; - } - if (jj_scan_token(LBRACE)) { - return true; - } - xsp = jj_scanpos; - if (jj_3R_315()) { - jj_scanpos = xsp; - } - xsp = jj_scanpos; - if (jj_scan_token(87)) { - jj_scanpos = xsp; - } - xsp = jj_scanpos; - if (jj_3R_316()) { - jj_scanpos = xsp; - } - if (jj_scan_token(RBRACE)) { - return true; - } - return false; - } - - private boolean jj_3R_241() { - if (jj_3R_259()) { - return true; - } - return false; - } - - private boolean jj_3R_249() { - if (jj_3R_264()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_265()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_240() { - if (jj_3R_258()) { - return true; - } - return false; - } - - private boolean jj_3R_257() { - if (jj_scan_token(BANG)) { - return true; - } - return false; - } - - private boolean jj_3R_256() { - if (jj_scan_token(TILDE)) { - return true; - } - return false; - } - - private boolean jj_3R_239() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_256()) { - jj_scanpos = xsp; - if (jj_3R_257()) { - return true; - } - } - if (jj_3R_161()) { - return true; - } - return false; - } - - private boolean jj_3R_171() { - if (jj_scan_token(AT)) { - return true; - } - if (jj_3R_90()) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_3R_92()) { - return true; - } - if (jj_scan_token(RPAREN)) { - return true; - } - return false; - } - - private boolean jj_3R_338() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_85()) { - return true; - } - return false; - } - - private boolean jj_3R_219() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_239()) { - jj_scanpos = xsp; - if (jj_3R_240()) { - jj_scanpos = xsp; - if (jj_3R_241()) { - return true; - } - } - } - return false; - } - - private boolean jj_3R_91() { - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_scan_token(ASSIGN)) { - return true; - } - return false; - } - - private boolean jj_3R_328() { - if (jj_scan_token(IMPLEMENTS)) { - return true; - } - if (jj_3R_85()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_338()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_172() { - if (jj_scan_token(AT)) { - return true; - } - if (jj_3R_90()) { - return true; - } - return false; - } - - private boolean jj_3R_218() { - if (jj_scan_token(DECR)) { - return true; - } - if (jj_3R_238()) { - return true; - } - return false; - } - - private boolean jj_3R_337() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_85()) { - return true; - } - return false; - } - - private boolean jj_3_41() { - if (jj_scan_token(AT)) { - return true; - } - if (jj_3R_90()) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - return false; - } - - private boolean jj_3R_327() { - if (jj_scan_token(EXTENDS)) { - return true; - } - if (jj_3R_85()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_337()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3_40() { - if (jj_scan_token(AT)) { - return true; - } - if (jj_3R_90()) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_91()) { - jj_scanpos = xsp; - if (jj_scan_token(81)) { - return true; - } - } - return false; - } - - private boolean jj_3R_170() { - if (jj_scan_token(AT)) { - return true; - } - if (jj_3R_90()) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_227()) { - jj_scanpos = xsp; - } - if (jj_scan_token(RPAREN)) { - return true; - } - return false; - } - - private boolean jj_3R_217() { - if (jj_scan_token(INCR)) { - return true; - } - if (jj_3R_238()) { - return true; - } - return false; - } - - private boolean jj_3R_261() { - if (jj_scan_token(INTERFACE)) { - return true; - } - return false; - } - - private boolean jj_3R_140() { - if (jj_3R_172()) { - return true; - } - return false; - } - - private boolean jj_3R_194() { - if (jj_3R_219()) { - return true; - } - return false; - } - - private boolean jj_3R_139() { - if (jj_3R_171()) { - return true; - } - return false; - } - - private boolean jj_3R_193() { - if (jj_3R_218()) { - return true; - } - return false; - } - - private boolean jj_3R_313() { - if (jj_3R_328()) { - return true; - } - return false; - } - - private boolean jj_3R_138() { - if (jj_3R_170()) { - return true; - } - return false; - } - - private boolean jj_3R_312() { - if (jj_3R_327()) { - return true; - } - return false; - } - - private boolean jj_3R_192() { - if (jj_3R_217()) { - return true; - } - return false; - } - - private boolean jj_3R_311() { - if (jj_3R_96()) { - return true; - } - return false; - } - - private boolean jj_3R_243() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(20)) { - jj_scanpos = xsp; - if (jj_3R_261()) { - return true; - } - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - xsp = jj_scanpos; - if (jj_3R_311()) { - jj_scanpos = xsp; - } - xsp = jj_scanpos; - if (jj_3R_312()) { - jj_scanpos = xsp; - } - xsp = jj_scanpos; - if (jj_3R_313()) { - jj_scanpos = xsp; - } - if (jj_3R_84()) { - return true; - } - return false; - } - - private boolean jj_3R_94() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_138()) { - jj_scanpos = xsp; - if (jj_3R_139()) { - jj_scanpos = xsp; - if (jj_3R_140()) { - return true; - } - } - } - return false; - } - - private boolean jj_3R_122() { - return false; - } - - private boolean jj_3R_216() { - if (jj_scan_token(MINUS)) { - return true; - } - return false; - } - - private boolean jj_3R_215() { - if (jj_scan_token(PLUS)) { - return true; - } - return false; - } - - private boolean jj_3R_191() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_215()) { - jj_scanpos = xsp; - if (jj_3R_216()) { - return true; - } - } - if (jj_3R_161()) { - return true; - } - return false; - } - - private boolean jj_3R_123() { - return false; - } - - private boolean jj_3R_75() { - jj_lookingAhead = true; - jj_semLA = getToken(1).kind == GT && - ((GTToken) getToken(1)).realKind == RSIGNEDSHIFT; - jj_lookingAhead = false; - if (!jj_semLA || jj_3R_122()) { - return true; - } - if (jj_scan_token(GT)) { - return true; - } - if (jj_scan_token(GT)) { - return true; - } - return false; - } - - private boolean jj_3R_161() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_191()) { - jj_scanpos = xsp; - if (jj_3R_192()) { - jj_scanpos = xsp; - if (jj_3R_193()) { - jj_scanpos = xsp; - if (jj_3R_194()) { - return true; - } - } - } - } - return false; - } - - private boolean jj_3R_378() { - if (jj_scan_token(CATCH)) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_3R_342()) { - return true; - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_3R_99()) { - return true; - } - return false; - } - - private boolean jj_3R_379() { - if (jj_scan_token(FINALLY)) { - return true; - } - if (jj_3R_99()) { - return true; - } - return false; - } - - private boolean jj_3R_371() { - if (jj_scan_token(FINALLY)) { - return true; - } - if (jj_3R_99()) { - return true; - } - return false; - } - - private boolean jj_3R_76() { - jj_lookingAhead = true; - jj_semLA = getToken(1).kind == GT && - ((GTToken) getToken(1)).realKind == RUNSIGNEDSHIFT; - jj_lookingAhead = false; - if (!jj_semLA || jj_3R_123()) { - return true; - } - if (jj_scan_token(GT)) { - return true; - } - if (jj_scan_token(GT)) { - return true; - } - if (jj_scan_token(GT)) { - return true; - } - return false; - } - - private boolean jj_3R_359() { - if (jj_scan_token(REM)) { - return true; - } - return false; - } - - private boolean jj_3R_358() { - if (jj_scan_token(SLASH)) { - return true; - } - return false; - } - - private boolean jj_3R_357() { - if (jj_scan_token(STAR)) { - return true; - } - return false; - } - - private boolean jj_3R_349() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_357()) { - jj_scanpos = xsp; - if (jj_3R_358()) { - jj_scanpos = xsp; - if (jj_3R_359()) { - return true; - } - } - } - if (jj_3R_161()) { - return true; - } - return false; - } - - private boolean jj_3R_369() { - if (jj_3R_73()) { - return true; - } - return false; - } - - private boolean jj_3R_370() { - Token xsp; - if (jj_3R_378()) { - return true; - } - while (true) { - xsp = jj_scanpos; - if (jj_3R_378()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_3R_379()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3R_325() { - if (jj_3R_161()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_349()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_368() { - if (jj_scan_token(IDENTIFIER)) { - return true; - } - return false; - } - - private boolean jj_3R_351() { - if (jj_scan_token(MINUS)) { - return true; - } - return false; - } - - private boolean jj_3R_350() { - if (jj_scan_token(PLUS)) { - return true; - } - return false; - } - - private boolean jj_3R_60() { - if (jj_3R_94()) { - return true; - } - return false; - } - - private boolean jj_3R_345() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_350()) { - jj_scanpos = xsp; - if (jj_3R_351()) { - return true; - } - } - if (jj_3R_325()) { - return true; - } - return false; - } - - private boolean jj_3R_59() { - if (jj_scan_token(STRICTFP)) { - return true; - } - return false; - } - - private boolean jj_3R_297() { - if (jj_scan_token(TRY)) { - return true; - } - if (jj_3R_99()) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_370()) { - jj_scanpos = xsp; - if (jj_3R_371()) { - return true; - } - } - return false; - } - - private boolean jj_3R_58() { - if (jj_scan_token(VOLATILE)) { - return true; - } - return false; - } - - private boolean jj_3R_57() { - if (jj_scan_token(TRANSIENT)) { - return true; - } - return false; - } - - private boolean jj_3R_56() { - if (jj_scan_token(NATIVE)) { - return true; - } - return false; - } - - private boolean jj_3R_367() { - if (jj_scan_token(IDENTIFIER)) { - return true; - } - return false; - } - - private boolean jj_3R_307() { - if (jj_3R_325()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_345()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_55() { - if (jj_scan_token(SYNCHRONIZED)) { - return true; - } - return false; - } - - private boolean jj_3R_54() { - if (jj_scan_token(ABSTRACT)) { - return true; - } - return false; - } - - private boolean jj_3R_53() { - if (jj_scan_token(FINAL)) { - return true; - } - return false; - } - - private boolean jj_3_21() { - if (jj_3R_76()) { - return true; - } - return false; - } - - private boolean jj_3_20() { - if (jj_3R_75()) { - return true; - } - return false; - } - - private boolean jj_3R_52() { - if (jj_scan_token(PRIVATE)) { - return true; - } - return false; - } - - private boolean jj_3R_74() { - if (jj_scan_token(LSHIFT)) { - return true; - } - return false; - } - - private boolean jj_3R_51() { - if (jj_scan_token(PROTECTED)) { - return true; - } - return false; - } - - private boolean jj_3_19() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_74()) { - jj_scanpos = xsp; - if (jj_3_20()) { - jj_scanpos = xsp; - if (jj_3_21()) { - return true; - } - } - } - if (jj_3R_307()) { - return true; - } - return false; - } - - private boolean jj_3R_50() { - if (jj_scan_token(STATIC)) { - return true; - } - return false; - } - - private boolean jj_3R_49() { - if (jj_scan_token(PUBLIC)) { - return true; - } - return false; - } - - private boolean jj_3R_308() { - if (jj_scan_token(INSTANCEOF)) { - return true; - } - if (jj_3R_63()) { - return true; - } - return false; - } - - private boolean jj_3R_296() { - if (jj_scan_token(SYNCHRONIZED)) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_3R_73()) { - return true; - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_3R_99()) { - return true; - } - return false; - } - - private boolean jj_3_2() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_49()) { - jj_scanpos = xsp; - if (jj_3R_50()) { - jj_scanpos = xsp; - if (jj_3R_51()) { - jj_scanpos = xsp; - if (jj_3R_52()) { - jj_scanpos = xsp; - if (jj_3R_53()) { - jj_scanpos = xsp; - if (jj_3R_54()) { - jj_scanpos = xsp; - if (jj_3R_55()) { - jj_scanpos = xsp; - if (jj_3R_56()) { - jj_scanpos = xsp; - if (jj_3R_57()) { - jj_scanpos = xsp; - if (jj_3R_58()) { - jj_scanpos = xsp; - if (jj_3R_59()) { - jj_scanpos = xsp; - if (jj_3R_60()) { - return true; - } - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_305() { - if (jj_3R_307()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_19()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_88() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_2()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_336() { - if (jj_scan_token(GE)) { - return true; - } - return false; - } - - private boolean jj_3R_335() { - if (jj_scan_token(LE)) { - return true; - } - return false; - } - - private boolean jj_3R_334() { - if (jj_scan_token(GT)) { - return true; - } - return false; - } - - private boolean jj_3R_333() { - if (jj_scan_token(LT)) { - return true; - } - return false; - } - - private boolean jj_3R_326() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_333()) { - jj_scanpos = xsp; - if (jj_3R_334()) { - jj_scanpos = xsp; - if (jj_3R_335()) { - jj_scanpos = xsp; - if (jj_3R_336()) { - return true; - } - } - } - } - if (jj_3R_305()) { - return true; - } - return false; - } - - private boolean jj_3R_295() { - if (jj_scan_token(THROW)) { - return true; - } - if (jj_3R_73()) { - return true; - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_303() { - if (jj_3R_305()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_326()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_294() { - if (jj_scan_token(RETURN)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_369()) { - jj_scanpos = xsp; - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_390() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_73()) { - return true; - } - return false; - } - - private boolean jj_3R_304() { - if (jj_scan_token(BIT_AND)) { - return true; - } - if (jj_3R_281()) { - return true; - } - return false; - } - - private boolean jj_3R_298() { - if (jj_3R_303()) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_308()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3R_364() { - if (jj_scan_token(ELSE)) { - return true; - } - if (jj_3R_250()) { - return true; - } - return false; - } - - private boolean jj_3R_293() { - if (jj_scan_token(CONTINUE)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_368()) { - jj_scanpos = xsp; - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_93() { - if (jj_3R_94()) { - return true; - } - return false; - } - - private boolean jj_3R_48() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_93()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(PACKAGE)) { - return true; - } - if (jj_3R_90()) { - return true; - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_310() { - if (jj_scan_token(NE)) { - return true; - } - return false; - } - - private boolean jj_3_1() { - if (jj_3R_48()) { - return true; - } - return false; - } - - private boolean jj_3R_309() { - if (jj_scan_token(EQ)) { - return true; - } - return false; - } - - private boolean jj_3R_306() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_309()) { - jj_scanpos = xsp; - if (jj_3R_310()) { - return true; - } - } - if (jj_3R_298()) { - return true; - } - return false; - } - - private boolean jj_3R_377() { - if (jj_3R_386()) { - return true; - } - return false; - } - - private boolean jj_3R_299() { - if (jj_scan_token(XOR)) { - return true; - } - if (jj_3R_255()) { - return true; - } - return false; - } - - private boolean jj_3R_292() { - if (jj_scan_token(BREAK)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_367()) { - jj_scanpos = xsp; - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_282() { - if (jj_scan_token(BIT_OR)) { - return true; - } - if (jj_3R_237()) { - return true; - } - return false; - } - - private boolean jj_3R_281() { - if (jj_3R_298()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_306()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_260() { - if (jj_scan_token(SC_AND)) { - return true; - } - if (jj_3R_214()) { - return true; - } - return false; - } - - private boolean jj_3R_386() { - if (jj_3R_389()) { - return true; - } - return false; - } - - private boolean jj_3R_255() { - if (jj_3R_281()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_304()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_242() { - if (jj_scan_token(SC_OR)) { - return true; - } - if (jj_3R_190()) { - return true; - } - return false; - } - - private boolean jj_3_39() { - if (jj_3R_88()) { - return true; - } - if (jj_3R_63()) { - return true; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - return false; - } - - private boolean jj_3R_389() { - if (jj_3R_73()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_390()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_237() { - if (jj_3R_255()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_299()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_388() { - if (jj_3R_389()) { - return true; - } - return false; - } - - private boolean jj_3R_376() { - if (jj_3R_73()) { - return true; - } - return false; - } - - private boolean jj_3R_387() { - if (jj_3R_89()) { - return true; - } - return false; - } - - private boolean jj_3R_214() { - if (jj_3R_237()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_282()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_385() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_387()) { - jj_scanpos = xsp; - if (jj_3R_388()) { - return true; - } - } - return false; - } - - private boolean jj_3R_190() { - if (jj_3R_214()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_260()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3_38() { - if (jj_3R_89()) { - return true; - } - if (jj_scan_token(COLON)) { - return true; - } - return false; - } - - private boolean jj_3R_375() { - if (jj_3R_385()) { - return true; - } - return false; - } - - private boolean jj_3R_160() { - if (jj_3R_190()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_242()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_366() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_375()) { - jj_scanpos = xsp; - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - xsp = jj_scanpos; - if (jj_3R_376()) { - jj_scanpos = xsp; - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - xsp = jj_scanpos; - if (jj_3R_377()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3R_365() { - if (jj_3R_89()) { - return true; - } - if (jj_scan_token(COLON)) { - return true; - } - if (jj_3R_73()) { - return true; - } - return false; - } - - private boolean jj_3R_220() { - if (jj_scan_token(HOOK)) { - return true; - } - if (jj_3R_73()) { - return true; - } - if (jj_scan_token(COLON)) { - return true; - } - if (jj_3R_121()) { - return true; - } - return false; - } - - private boolean jj_3R_291() { - if (jj_scan_token(FOR)) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_365()) { - jj_scanpos = xsp; - if (jj_3R_366()) { - return true; - } - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_3R_250()) { - return true; - } - return false; - } - - private boolean jj_3R_121() { - if (jj_3R_160()) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_220()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3R_120() { - if (jj_scan_token(ORASSIGN)) { - return true; - } - return false; - } - - private boolean jj_3R_119() { - if (jj_scan_token(XORASSIGN)) { - return true; - } - return false; - } - - private boolean jj_3R_118() { - if (jj_scan_token(ANDASSIGN)) { - return true; - } - return false; - } - - private boolean jj_3R_117() { - if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) { - return true; - } - return false; - } - - private boolean jj_3R_116() { - if (jj_scan_token(RSIGNEDSHIFTASSIGN)) { - return true; - } - return false; - } - - private boolean jj_3R_115() { - if (jj_scan_token(LSHIFTASSIGN)) { - return true; - } - return false; - } - - private boolean jj_3R_114() { - if (jj_scan_token(MINUSASSIGN)) { - return true; - } - return false; - } - - private boolean jj_3R_113() { - if (jj_scan_token(PLUSASSIGN)) { - return true; - } - return false; - } - - private boolean jj_3R_290() { - if (jj_scan_token(DO)) { - return true; - } - if (jj_3R_250()) { - return true; - } - if (jj_scan_token(WHILE)) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_3R_73()) { - return true; - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_112() { - if (jj_scan_token(REMASSIGN)) { - return true; - } - return false; - } - - private boolean jj_3R_111() { - if (jj_scan_token(SLASHASSIGN)) { - return true; - } - return false; - } - - private boolean jj_3R_110() { - if (jj_scan_token(STARASSIGN)) { - return true; - } - return false; - } - - private boolean jj_3R_109() { - if (jj_scan_token(ASSIGN)) { - return true; - } - return false; - } - - private boolean jj_3R_72() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_109()) { - jj_scanpos = xsp; - if (jj_3R_110()) { - jj_scanpos = xsp; - if (jj_3R_111()) { - jj_scanpos = xsp; - if (jj_3R_112()) { - jj_scanpos = xsp; - if (jj_3R_113()) { - jj_scanpos = xsp; - if (jj_3R_114()) { - jj_scanpos = xsp; - if (jj_3R_115()) { - jj_scanpos = xsp; - if (jj_3R_116()) { - jj_scanpos = xsp; - if (jj_3R_117()) { - jj_scanpos = xsp; - if (jj_3R_118()) { - jj_scanpos = xsp; - if (jj_3R_119()) { - jj_scanpos = xsp; - if (jj_3R_120()) { - return true; - } - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_344() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_90()) { - return true; - } - return false; - } - - private boolean jj_3R_289() { - if (jj_scan_token(WHILE)) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_3R_73()) { - return true; - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_3R_250()) { - return true; - } - return false; - } - - private boolean jj_3_18() { - if (jj_3R_72()) { - return true; - } - if (jj_3R_73()) { - return true; - } - return false; - } - - private boolean jj_3R_73() { - if (jj_3R_121()) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3_18()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3R_288() { - if (jj_scan_token(IF)) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_3R_73()) { - return true; - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_3R_250()) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_364()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3R_134() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_133()) { - return true; - } - return false; - } - - private boolean jj_3R_384() { - if (jj_scan_token(_DEFAULT)) { - return true; - } - return false; - } - - private boolean jj_3R_383() { - if (jj_scan_token(CASE)) { - return true; - } - if (jj_3R_73()) { - return true; - } - return false; - } - - private boolean jj_3R_374() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_383()) { - jj_scanpos = xsp; - if (jj_3R_384()) { - return true; - } - } - if (jj_scan_token(COLON)) { - return true; - } - if (jj_3R_144()) { - return true; - } - return false; - } - - private boolean jj_3R_332() { - if (jj_3R_90()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_344()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3_17() { - if (jj_scan_token(DOT)) { - return true; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - return false; - } - - private boolean jj_3R_363() { - if (jj_3R_374()) { - return true; - } - return false; - } - - private boolean jj_3R_90() { - if (jj_scan_token(IDENTIFIER)) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_17()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_287() { - if (jj_scan_token(SWITCH)) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - if (jj_3R_73()) { - return true; - } - if (jj_scan_token(RPAREN)) { - return true; - } - if (jj_scan_token(LBRACE)) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_363()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(RBRACE)) { - return true; - } - return false; - } - - private boolean jj_3R_130() { - if (jj_3R_63()) { - return true; - } - return false; - } - - private boolean jj_3R_129() { - if (jj_scan_token(VOID)) { - return true; - } - return false; - } - - private boolean jj_3R_382() { - if (jj_3R_72()) { - return true; - } - if (jj_3R_73()) { - return true; - } - return false; - } - - private boolean jj_3R_381() { - if (jj_scan_token(DECR)) { - return true; - } - return false; - } - - private boolean jj_3R_380() { - if (jj_scan_token(INCR)) { - return true; - } - return false; - } - - private boolean jj_3R_373() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_380()) { - jj_scanpos = xsp; - if (jj_3R_381()) { - jj_scanpos = xsp; - if (jj_3R_382()) { - return true; - } - } - } - return false; - } - - private boolean jj_3R_82() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_129()) { - jj_scanpos = xsp; - if (jj_3R_130()) { - return true; - } - } - return false; - } - - private boolean jj_3R_302() { - if (jj_3R_238()) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_373()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3R_301() { - if (jj_3R_218()) { - return true; - } - return false; - } - - private boolean jj_3R_300() { - if (jj_3R_217()) { - return true; - } - return false; - } - - private boolean jj_3R_181() { - if (jj_scan_token(DOUBLE)) { - return true; - } - return false; - } - - private boolean jj_3R_180() { - if (jj_scan_token(FLOAT)) { - return true; - } - return false; - } - - private boolean jj_3R_179() { - if (jj_scan_token(LONG)) { - return true; - } - return false; - } - - private boolean jj_3R_286() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_300()) { - jj_scanpos = xsp; - if (jj_3R_301()) { - jj_scanpos = xsp; - if (jj_3R_302()) { - return true; - } - } - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_178() { - if (jj_scan_token(INT)) { - return true; - } - return false; - } - - private boolean jj_3R_177() { - if (jj_scan_token(SHORT)) { - return true; - } - return false; - } - - private boolean jj_3R_176() { - if (jj_scan_token(BYTE)) { - return true; - } - return false; - } - - private boolean jj_3R_157() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_108()) { - return true; - } - return false; - } - - private boolean jj_3R_254() { - if (jj_scan_token(SUPER)) { - return true; - } - if (jj_3R_70()) { - return true; - } - return false; - } - - private boolean jj_3R_175() { - if (jj_scan_token(CHAR)) { - return true; - } - return false; - } - - private boolean jj_3R_362() { - if (jj_scan_token(COLON)) { - return true; - } - if (jj_3R_73()) { - return true; - } - return false; - } - - private boolean jj_3R_236() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_253()) { - jj_scanpos = xsp; - if (jj_3R_254()) { - return true; - } - } - return false; - } - - private boolean jj_3R_253() { - if (jj_scan_token(EXTENDS)) { - return true; - } - if (jj_3R_70()) { - return true; - } - return false; - } - - private boolean jj_3R_174() { - if (jj_scan_token(BOOLEAN)) { - return true; - } - return false; - } - - private boolean jj_3R_143() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_174()) { - jj_scanpos = xsp; - if (jj_3R_175()) { - jj_scanpos = xsp; - if (jj_3R_176()) { - jj_scanpos = xsp; - if (jj_3R_177()) { - jj_scanpos = xsp; - if (jj_3R_178()) { - jj_scanpos = xsp; - if (jj_3R_179()) { - jj_scanpos = xsp; - if (jj_3R_180()) { - jj_scanpos = xsp; - if (jj_3R_181()) { - return true; - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_285() { - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_189() { - if (jj_scan_token(HOOK)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_236()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3_37() { - if (jj_3R_89()) { - return true; - } - return false; - } - - private boolean jj_3R_89() { - if (jj_3R_88()) { - return true; - } - if (jj_3R_63()) { - return true; - } - if (jj_3R_133()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_134()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3_36() { - if (jj_3R_88()) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(20)) { - jj_scanpos = xsp; - if (jj_scan_token(40)) { - return true; - } - } - return false; - } - - private boolean jj_3R_231() { - if (jj_3R_250()) { - return true; - } - return false; - } - - private boolean jj_3R_159() { - if (jj_3R_189()) { - return true; - } - return false; - } - - private boolean jj_3R_230() { - if (jj_3R_89()) { - return true; - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_158() { - if (jj_3R_70()) { - return true; - } - return false; - } - - private boolean jj_3R_319() { - if (jj_scan_token(THROWS)) { - return true; - } - if (jj_3R_332()) { - return true; - } - return false; - } - - private boolean jj_3R_108() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_158()) { - jj_scanpos = xsp; - if (jj_3R_159()) { - return true; - } - } - return false; - } - - private boolean jj_3R_229() { - if (jj_3R_88()) { - return true; - } - if (jj_3R_243()) { - return true; - } - return false; - } - - private boolean jj_3_13() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - return false; - } - - private boolean jj_3R_71() { - if (jj_scan_token(LT)) { - return true; - } - if (jj_3R_108()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_157()) { - jj_scanpos = xsp; - break; - } - } - if (jj_scan_token(GT)) { - return true; - } - return false; - } - - private boolean jj_3R_202() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_229()) { - jj_scanpos = xsp; - if (jj_3R_230()) { - jj_scanpos = xsp; - if (jj_3R_231()) { - return true; - } - } - } - return false; - } - - private boolean jj_3_16() { - if (jj_3R_71()) { - return true; - } - return false; - } - - private boolean jj_3_15() { - if (jj_scan_token(DOT)) { - return true; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3_16()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3_12() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - return false; - } - - private boolean jj_3_14() { - if (jj_3R_71()) { - return true; - } - return false; - } - - private boolean jj_3_33() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - return false; - } - - private boolean jj_3R_85() { - if (jj_scan_token(IDENTIFIER)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3_14()) { - jj_scanpos = xsp; - } - while (true) { - xsp = jj_scanpos; - if (jj_3_15()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_99() { - if (jj_scan_token(LBRACE)) { - return true; - } - if (jj_3R_144()) { - return true; - } - if (jj_scan_token(RBRACE)) { - return true; - } - return false; - } - - private boolean jj_3R_87() { - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_scan_token(COLON)) { - return true; - } - if (jj_3R_250()) { - return true; - } - return false; - } - - private boolean jj_3R_107() { - if (jj_3R_85()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_13()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_106() { - if (jj_3R_143()) { - return true; - } - Token xsp; - if (jj_3_12()) { - return true; - } - while (true) { - xsp = jj_scanpos; - if (jj_3_12()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_70() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_106()) { - jj_scanpos = xsp; - if (jj_3R_107()) { - return true; - } - } - return false; - } - - private boolean jj_3R_284() { - if (jj_scan_token(ASSERT)) { - return true; - } - if (jj_3R_73()) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_362()) { - jj_scanpos = xsp; - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_97() { - if (jj_3R_143()) { - return true; - } - return false; - } - - private boolean jj_3R_280() { - if (jj_3R_297()) { - return true; - } - return false; - } - - private boolean jj_3_11() { - if (jj_3R_70()) { - return true; - } - return false; - } - - private boolean jj_3R_279() { - if (jj_3R_296()) { - return true; - } - return false; - } - - private boolean jj_3R_63() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_11()) { - jj_scanpos = xsp; - if (jj_3R_97()) { - return true; - } - } - return false; - } - - private boolean jj_3R_278() { - if (jj_3R_295()) { - return true; - } - return false; - } - - private boolean jj_3R_277() { - if (jj_3R_294()) { - return true; - } - return false; - } - - private boolean jj_3R_276() { - if (jj_3R_293()) { - return true; - } - return false; - } - - private boolean jj_3R_275() { - if (jj_3R_292()) { - return true; - } - return false; - } - - private boolean jj_3R_274() { - if (jj_3R_291()) { - return true; - } - return false; - } - - private boolean jj_3R_273() { - if (jj_3R_290()) { - return true; - } - return false; - } - - private boolean jj_3R_98() { - if (jj_scan_token(STATIC)) { - return true; - } - return false; - } - - private boolean jj_3R_272() { - if (jj_3R_289()) { - return true; - } - return false; - } - - private boolean jj_3R_65() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_98()) { - jj_scanpos = xsp; - } - if (jj_3R_99()) { - return true; - } - return false; - } - - private boolean jj_3R_271() { - if (jj_3R_288()) { - return true; - } - return false; - } - - private boolean jj_3R_270() { - if (jj_3R_287()) { - return true; - } - return false; - } - - private boolean jj_3R_182() { - if (jj_3R_202()) { - return true; - } - return false; - } - - private boolean jj_3R_269() { - if (jj_3R_286()) { - return true; - } - return false; - } - - private boolean jj_3R_144() { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_182()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_268() { - if (jj_3R_285()) { - return true; - } - return false; - } - - private boolean jj_3_9() { - if (jj_3R_68()) { - return true; - } - if (jj_scan_token(DOT)) { - return true; - } - return false; - } - - private boolean jj_3R_267() { - if (jj_3R_99()) { - return true; - } - return false; - } - - private boolean jj_3R_266() { - if (jj_3R_284()) { - return true; - } - return false; - } - - private boolean jj_3_35() { - if (jj_3R_87()) { - return true; - } - return false; - } - - private boolean jj_3R_69() { - if (jj_3R_71()) { - return true; - } - return false; - } - - private boolean jj_3R_149() { - if (jj_3R_71()) { - return true; - } - return false; - } - - private boolean jj_3_7() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_66()) { - return true; - } - return false; - } - - private boolean jj_3_10() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_69()) { - jj_scanpos = xsp; - } - if (jj_scan_token(THIS)) { - return true; - } - if (jj_scan_token(LPAREN)) { - return true; - } - return false; - } - - private boolean jj_3R_148() { - if (jj_3R_68()) { - return true; - } - if (jj_scan_token(DOT)) { - return true; - } - return false; - } - - private boolean jj_3R_103() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_148()) { - jj_scanpos = xsp; - } - xsp = jj_scanpos; - if (jj_3R_149()) { - jj_scanpos = xsp; - } - if (jj_scan_token(SUPER)) { - return true; - } - if (jj_3R_147()) { - return true; - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_250() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_35()) { - jj_scanpos = xsp; - if (jj_3R_266()) { - jj_scanpos = xsp; - if (jj_3R_267()) { - jj_scanpos = xsp; - if (jj_3R_268()) { - jj_scanpos = xsp; - if (jj_3R_269()) { - jj_scanpos = xsp; - if (jj_3R_270()) { - jj_scanpos = xsp; - if (jj_3R_271()) { - jj_scanpos = xsp; - if (jj_3R_272()) { - jj_scanpos = xsp; - if (jj_3R_273()) { - jj_scanpos = xsp; - if (jj_3R_274()) { - jj_scanpos = xsp; - if (jj_3R_275()) { - jj_scanpos = xsp; - if (jj_3R_276()) { - jj_scanpos = xsp; - if (jj_3R_277()) { - jj_scanpos = xsp; - if (jj_3R_278()) { - jj_scanpos = xsp; - if (jj_3R_279()) { - jj_scanpos = xsp; - if (jj_3R_280()) { - return true; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - return false; - } - - private boolean jj_3R_146() { - if (jj_3R_71()) { - return true; - } - return false; - } - - private boolean jj_3R_102() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_146()) { - jj_scanpos = xsp; - } - if (jj_scan_token(THIS)) { - return true; - } - if (jj_3R_147()) { - return true; - } - if (jj_scan_token(SEMICOLON)) { - return true; - } - return false; - } - - private boolean jj_3R_166() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - return false; - } - - private boolean jj_3R_132() { - Token xsp; - if (jj_3R_166()) { - return true; - } - while (true) { - xsp = jj_scanpos; - if (jj_3R_166()) { - jj_scanpos = xsp; - break; - } - } - if (jj_3R_145()) { - return true; - } - return false; - } - - private boolean jj_3_32() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_3R_73()) { - return true; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - return false; - } - - private boolean jj_3_34() { - Token xsp; - if (jj_3_32()) { - return true; - } - while (true) { - xsp = jj_scanpos; - if (jj_3_32()) { - jj_scanpos = xsp; - break; - } - } - while (true) { - xsp = jj_scanpos; - if (jj_3_33()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3_30() { - if (jj_3R_84()) { - return true; - } - return false; - } - - private boolean jj_3R_67() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_102()) { - jj_scanpos = xsp; - if (jj_3R_103()) { - return true; - } - } - return false; - } - - private boolean jj_3R_86() { - Token xsp; - xsp = jj_scanpos; - if (jj_3_34()) { - jj_scanpos = xsp; - if (jj_3R_132()) { - return true; - } - } - return false; - } - - private boolean jj_3R_322() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - return false; - } - - private boolean jj_3R_343() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_342()) { - return true; - } - return false; - } - - private boolean jj_3_8() { - if (jj_3R_67()) { - return true; - } - return false; - } - - private boolean jj_3R_348() { - if (jj_scan_token(ELLIPSIS)) { - return true; - } - return false; - } - - private boolean jj_3R_235() { - if (jj_3R_71()) { - return true; - } - return false; - } - - private boolean jj_3R_320() { - if (jj_3R_67()) { - return true; - } - return false; - } - - private boolean jj_3R_213() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_235()) { - jj_scanpos = xsp; - } - if (jj_3R_85()) { - return true; - } - if (jj_3R_147()) { - return true; - } - xsp = jj_scanpos; - if (jj_3_30()) { - jj_scanpos = xsp; - } - return false; - } - - private boolean jj_3_31() { - if (jj_3R_85()) { - return true; - } - if (jj_3R_86()) { - return true; - } - return false; - } - - private boolean jj_3R_262() { - if (jj_3R_96()) { - return true; - } - return false; - } - - private boolean jj_3R_232() { - if (jj_scan_token(COMMA)) { - return true; - } - if (jj_3R_73()) { - return true; - } - return false; - } - - private boolean jj_3R_246() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_262()) { - jj_scanpos = xsp; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_3R_318()) { - return true; - } - xsp = jj_scanpos; - if (jj_3R_319()) { - jj_scanpos = xsp; - } - if (jj_scan_token(LBRACE)) { - return true; - } - xsp = jj_scanpos; - if (jj_3R_320()) { - jj_scanpos = xsp; - } - if (jj_3R_144()) { - return true; - } - if (jj_scan_token(RBRACE)) { - return true; - } - return false; - } - - private boolean jj_3R_212() { - if (jj_3R_85()) { - return true; - } - if (jj_3R_86()) { - return true; - } - return false; - } - - private boolean jj_3R_200() { - if (jj_scan_token(LBRACKET)) { - return true; - } - if (jj_scan_token(RBRACKET)) { - return true; - } - return false; - } - - private boolean jj_3R_211() { - if (jj_3R_143()) { - return true; - } - if (jj_3R_86()) { - return true; - } - return false; - } - - private boolean jj_3R_199() { - if (jj_3R_66()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_7()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_187() { - if (jj_scan_token(NEW)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_211()) { - jj_scanpos = xsp; - if (jj_3R_212()) { - jj_scanpos = xsp; - if (jj_3R_213()) { - return true; - } - } - } - return false; - } - - private boolean jj_3R_342() { - if (jj_3R_88()) { - return true; - } - if (jj_3R_63()) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_348()) { - jj_scanpos = xsp; - } - if (jj_3R_167()) { - return true; - } - return false; - } - - private boolean jj_3R_331() { - if (jj_3R_342()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_343()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_318() { - if (jj_scan_token(LPAREN)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_331()) { - jj_scanpos = xsp; - } - if (jj_scan_token(RPAREN)) { - return true; - } - return false; - } - - private boolean jj_3R_203() { - if (jj_3R_73()) { - return true; - } - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_232()) { - jj_scanpos = xsp; - break; - } - } - return false; - } - - private boolean jj_3R_183() { - if (jj_3R_203()) { - return true; - } - return false; - } - - private boolean jj_3R_324() { - if (jj_3R_99()) { - return true; - } - return false; - } - - private boolean jj_3R_323() { - if (jj_scan_token(THROWS)) { - return true; - } - if (jj_3R_332()) { - return true; - } - return false; - } - - private boolean jj_3R_147() { - if (jj_scan_token(LPAREN)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_183()) { - jj_scanpos = xsp; - } - if (jj_scan_token(RPAREN)) { - return true; - } - return false; - } - - private boolean jj_3R_263() { - if (jj_3R_96()) { - return true; - } - return false; - } - - private boolean jj_3R_248() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_263()) { - jj_scanpos = xsp; - } - if (jj_3R_82()) { - return true; - } - if (jj_scan_token(IDENTIFIER)) { - return true; - } - if (jj_3R_318()) { - return true; - } - while (true) { - xsp = jj_scanpos; - if (jj_3R_322()) { - jj_scanpos = xsp; - break; - } - } - xsp = jj_scanpos; - if (jj_3R_323()) { - jj_scanpos = xsp; - } - xsp = jj_scanpos; - if (jj_3R_324()) { - jj_scanpos = xsp; - if (jj_scan_token(86)) { - return true; - } - } - return false; - } - - private boolean jj_3R_234() { - if (jj_scan_token(NULL)) { - return true; - } - return false; - } - - private boolean jj_3R_252() { - if (jj_scan_token(FALSE)) { - return true; - } - return false; - } - - private boolean jj_3R_251() { - if (jj_scan_token(TRUE)) { - return true; - } - return false; - } - - private boolean jj_3R_233() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_251()) { - jj_scanpos = xsp; - if (jj_3R_252()) { - return true; - } - } - return false; - } - - private boolean jj_3R_210() { - if (jj_3R_234()) { - return true; - } - return false; - } - - private boolean jj_3R_145() { - if (jj_scan_token(LBRACE)) { - return true; - } - Token xsp; - xsp = jj_scanpos; - if (jj_3R_199()) { - jj_scanpos = xsp; - } - xsp = jj_scanpos; - if (jj_scan_token(87)) { - jj_scanpos = xsp; - } - if (jj_scan_token(RBRACE)) { - return true; - } - return false; - } - - private boolean jj_3R_209() { - if (jj_3R_233()) { - return true; - } - return false; - } - - private boolean jj_3R_101() { - if (jj_3R_73()) { - return true; - } - return false; - } - - private boolean jj_3R_208() { - if (jj_scan_token(STRING_LITERAL)) { - return true; - } - return false; - } - - /** Generated Token Manager. */ - public ASTParserTokenManager token_source; - - JavaCharStream jj_input_stream; - - /** Current token. */ - public Token token; - - /** Next token. */ - public Token jj_nt; - - private int jj_ntk; - - private Token jj_scanpos, jj_lastpos; - - private int jj_la; - - /** Whether we are looking ahead. */ - private boolean jj_lookingAhead = false; - - private boolean jj_semLA; - - private int jj_gen; - - final private int[] jj_la1 = new int[134]; - - static private int[] jj_la1_0; - - static private int[] jj_la1_1; - - static private int[] jj_la1_2; - - static private int[] jj_la1_3; - - static private int[] jj_la1_4; - static { - jj_la1_init_0(); - jj_la1_init_1(); - jj_la1_init_2(); - jj_la1_init_3(); - jj_la1_init_4(); - } - - private static void jj_la1_init_0() { - jj_la1_0 = new int[] { 0x0, 0x48101000, 0x1, 0x0, 0x0, 0x0, 0x40001000, 0x8100000, 0x48101000, 0x100000, 0x0, 0x10000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4a195000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000, 0x0, 0x4a195000, 0x8100000, 0x2094000, 0x4a195000, - 0x0, 0x0, 0x0, 0x22094000, 0x22094000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x42095000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x22094000, 0x6359f000, 0x0, 0x2094000, 0x2094000, 0x0, 0x2094000, 0x10000000, 0x10000000, 0x2094000, 0x2094000, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x22094000, 0x0, 0x0, 0x22094000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20000000, 0x20000000, 0x22094000, 0x0, 0x0, 0x2094000, 0x0, 0x0, 0x0, - 0x2349e000, 0x0, 0x2349e000, 0x0, 0x0, 0x0, 0x22094000, 0x820000, 0x820000, 0x4000000, 0x62095000, 0x22094000, 0x22094000, 0x62095000, 0x22094000, 0x0, 0x0, 0x0, 0x22094000, 0x40000, 0x80000000, 0x80040000, 0x0, 0x0, 0x0, 0x22094000, - 0x22094000, 0x0, 0x4a195000, 0xa194000, 0x4a195000, 0x800000, }; - } - - private static void jj_la1_init_1() { - jj_la1_1 = new int[] { 0x20, 0x8899c500, 0x0, 0x0, 0x80000, 0x0, 0x8899c400, 0x100, 0x8899c500, 0x100, 0x0, 0x0, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0xc89dc781, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc89dc781, 0x100, 0x40040281, 0xc89dc781, 0x0, 0x0, 0x0, - 0x51241a81, 0x51241a81, 0x0, 0x0, 0x0, 0x4000000, 0x0, 0x0, 0x889dc681, 0x0, 0x0, 0x4000000, 0x0, 0x0, 0x51241a81, 0xfbffdf8b, 0x80000, 0x40281, 0x40281, 0x0, 0x40281, 0x200000, 0x200000, 0x40281, 0x40040281, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x51241a81, 0x0, 0x0, 0x51241a81, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11201800, 0x0, 0x0, 0x0, 0x0, 0x1000800, 0x0, 0x10001000, 0x10000000, 0x51241a81, 0x0, 0x0, 0x40281, 0x0, 0x0, 0x0, - 0x73e61a8b, 0x0, 0x73e61a8b, 0x0, 0x0, 0x0, 0x51241a81, 0x0, 0x0, 0x0, 0xd9bdde81, 0x51241a81, 0x51241a81, 0xd9bdde81, 0x51241a81, 0x0, 0x0, 0x0, 0x51241a81, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x51241a81, 0x51241a81, 0x0, 0x889dc781, 0x40381, - 0x889dc781, 0x0, }; - } - - private static void jj_la1_init_2() { - jj_la1_2 = new int[] { 0x0, 0x2400000, 0x0, 0x2000000, 0x0, 0x1000000, 0x2000000, 0x2000000, 0x2400000, 0x0, 0x8000000, 0x0, 0x0, 0x800000, 0x800000, 0x0, 0x2002000, 0x800000, 0xa442000, 0x400000, 0x2000000, 0x10000, 0x40000, 0x800000, 0x0, 0x0, - 0xa442000, 0x2000000, 0x8002000, 0xa402000, 0x800000, 0x4000000, 0x100000, 0x30053846, 0x30053846, 0x800000, 0x8000000, 0x100000, 0x0, 0x440000, 0x800000, 0x2002000, 0x0, 0x8000000, 0x0, 0x8000000, 0x8000000, 0x8013846, 0x2453847, 0x0, 0x0, - 0x2000, 0x800000, 0x40002000, 0x0, 0x0, 0x0, 0x2000, 0x800000, 0x4000000, 0x40000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8000000, 0x8000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x30013846, 0x30000000, 0x30000000, 0x13846, 0x10000, 0x0, - 0x8000000, 0x10000, 0x10000, 0x11846, 0x2000, 0x1000000, 0x8000000, 0x10000, 0x0, 0x1100000, 0x1846, 0x0, 0x30013846, 0x800000, 0x8000000, 0x0, 0x8002000, 0x100000, 0x100000, 0x453847, 0x80000000, 0x453847, 0x800000, 0x4000000, 0x4000000, - 0x13846, 0x0, 0x0, 0x0, 0x32013846, 0x30013846, 0x30013846, 0x32413846, 0x30013846, 0x800000, 0x2000, 0x2000, 0x30013846, 0x0, 0x0, 0x0, 0x2000000, 0x2000, 0x800000, 0x32053846, 0x32053846, 0x800000, 0x2402000, 0x2002000, 0x2402000, 0x0, }; - } - - private static void jj_la1_init_3() { - jj_la1_3 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3c0, 0x3c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000, - 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffe0000, 0x0, 0x10, 0x20, 0x2000, 0x4000, 0x1000, 0x9, 0x9, 0x0, 0x80000006, 0x80000006, 0x10000, 0x300, 0x300, 0x8c00, 0x8c00, 0x300, 0x3c0, 0x0, 0x0, 0x0, - 0x0, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0, 0x0, 0xc0, 0x0, 0xffe00c0, 0xffe00c0, 0xc0, 0x0, 0x0, 0x0, 0x3c0, 0x3c0, 0x3c0, 0x3c0, 0x3c0, 0x0, 0x0, 0x0, 0x3c0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x3c0, 0x3c0, 0x0, 0x0, 0x0, 0x0, 0x0, }; - } - - private static void jj_la1_init_4() { - jj_la1_4 = new int[] { 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }; - } - - final private JJCalls[] jj_2_rtns = new JJCalls[43]; - - private boolean jj_rescan = false; - - private int jj_gc = 0; - - /** Constructor with InputStream. */ - public ASTParser(java.io.InputStream stream) { - this(stream, null); - } - - /** Constructor with InputStream and supplied encoding */ - public ASTParser(java.io.InputStream stream, String encoding) { - try { - jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); - } catch (java.io.UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - token_source = new ASTParserTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 134; i++) { - jj_la1[i] = -1; - } - for (int i = 0; i < jj_2_rtns.length; i++) { - jj_2_rtns[i] = new JJCalls(); - } - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream stream) { - ReInit(stream, null); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream stream, String encoding) { - try { - jj_input_stream.ReInit(stream, encoding, 1, 1); - } catch (java.io.UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 134; i++) { - jj_la1[i] = -1; - } - for (int i = 0; i < jj_2_rtns.length; i++) { - jj_2_rtns[i] = new JJCalls(); - } - } - - /** Constructor. */ - public ASTParser(java.io.Reader stream) { - jj_input_stream = new JavaCharStream(stream, 1, 1); - token_source = new ASTParserTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 134; i++) { - jj_la1[i] = -1; - } - for (int i = 0; i < jj_2_rtns.length; i++) { - jj_2_rtns[i] = new JJCalls(); - } - } - - /** Reinitialise. */ - public void ReInit(java.io.Reader stream) { - jj_input_stream.ReInit(stream, 1, 1); - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 134; i++) { - jj_la1[i] = -1; - } - for (int i = 0; i < jj_2_rtns.length; i++) { - jj_2_rtns[i] = new JJCalls(); - } - } - - /** Constructor with generated Token Manager. */ - public ASTParser(ASTParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 134; i++) { - jj_la1[i] = -1; - } - for (int i = 0; i < jj_2_rtns.length; i++) { - jj_2_rtns[i] = new JJCalls(); - } - } - - /** Reinitialise. */ - public void ReInit(ASTParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 134; i++) { - jj_la1[i] = -1; - } - for (int i = 0; i < jj_2_rtns.length; i++) { - jj_2_rtns[i] = new JJCalls(); - } - } - - private Token jj_consume_token(int kind) throws ParseException { - Token oldToken; - if ((oldToken = token).next != null) { - token = token.next; - } else { - token = token.next = token_source.getNextToken(); - } - jj_ntk = -1; - if (token.kind == kind) { - jj_gen++; - if (++jj_gc > 100) { - jj_gc = 0; - for (int i = 0; i < jj_2_rtns.length; i++) { - JJCalls c = jj_2_rtns[i]; - while (c != null) { - if (c.gen < jj_gen) { - c.first = null; - } - c = c.next; - } - } - } - return token; - } - token = oldToken; - jj_kind = kind; - throw generateParseException(); - } - - static private final class LookaheadSuccess extends java.lang.Error { - } - - final private LookaheadSuccess jj_ls = new LookaheadSuccess(); - - private boolean jj_scan_token(int kind) { - if (jj_scanpos == jj_lastpos) { - jj_la--; - if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); - } else { - jj_lastpos = jj_scanpos = jj_scanpos.next; - } - } else { - jj_scanpos = jj_scanpos.next; - } - if (jj_rescan) { - int i = 0; - Token tok = token; - while (tok != null && tok != jj_scanpos) { - i++; - tok = tok.next; - } - if (tok != null) { - jj_add_error_token(kind, i); - } - } - if (jj_scanpos.kind != kind) { - return true; - } - if (jj_la == 0 && jj_scanpos == jj_lastpos) { - throw jj_ls; - } - return false; - } - - - /** Get the next Token. */ - final public Token getNextToken() { - if (token.next != null) { - token = token.next; - } else { - token = token.next = token_source.getNextToken(); - } - jj_ntk = -1; - jj_gen++; - return token; - } - - /** Get the specific Token. */ - final public Token getToken(int index) { - Token t = jj_lookingAhead ? jj_scanpos : token; - for (int i = 0; i < index; i++) { - if (t.next != null) { - t = t.next; - } else { - t = t.next = token_source.getNextToken(); - } - } - return t; - } - - private int jj_ntk() { - if ((jj_nt = token.next) == null) { - return (jj_ntk = (token.next = token_source.getNextToken()).kind); - } else { - return (jj_ntk = jj_nt.kind); - } - } - - private java.util.List jj_expentries = new java.util.ArrayList(); - - private int[] jj_expentry; - - private int jj_kind = -1; - - private int[] jj_lasttokens = new int[100]; - - private int jj_endpos; - - private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) { - return; - } - if (pos == jj_endpos + 1) { - jj_lasttokens[jj_endpos++] = kind; - } else if (jj_endpos != 0) { - jj_expentry = new int[jj_endpos]; - for (int i = 0; i < jj_endpos; i++) { - jj_expentry[i] = jj_lasttokens[i]; - } - jj_entries_loop: for (java.util.Iterator it = jj_expentries.iterator(); it.hasNext();) { - int[] oldentry = (int[]) (it.next()); - if (oldentry.length == jj_expentry.length) { - for (int i = 0; i < jj_expentry.length; i++) { - if (oldentry[i] != jj_expentry[i]) { - continue jj_entries_loop; - } - } - jj_expentries.add(jj_expentry); - break jj_entries_loop; - } - } - if (pos != 0) { - jj_lasttokens[(jj_endpos = pos) - 1] = kind; - } - } - } - - /** Generate ParseException. */ - public ParseException generateParseException() { - jj_expentries.clear(); - boolean[] la1tokens = new boolean[129]; - if (jj_kind >= 0) { - la1tokens[jj_kind] = true; - jj_kind = -1; - } - for (int i = 0; i < 134; i++) { - if (jj_la1[i] == jj_gen) { - for (int j = 0; j < 32; j++) { - if ((jj_la1_0[i] & (1 << j)) != 0) { - la1tokens[j] = true; - } - if ((jj_la1_1[i] & (1 << j)) != 0) { - la1tokens[32 + j] = true; - } - if ((jj_la1_2[i] & (1 << j)) != 0) { - la1tokens[64 + j] = true; - } - if ((jj_la1_3[i] & (1 << j)) != 0) { - la1tokens[96 + j] = true; - } - if ((jj_la1_4[i] & (1 << j)) != 0) { - la1tokens[128 + j] = true; - } - } - } - } - for (int i = 0; i < 129; i++) { - if (la1tokens[i]) { - jj_expentry = new int[1]; - jj_expentry[0] = i; - jj_expentries.add(jj_expentry); - } - } - jj_endpos = 0; - jj_rescan_token(); - jj_add_error_token(0, 0); - int[][] exptokseq = new int[jj_expentries.size()][]; - for (int i = 0; i < jj_expentries.size(); i++) { - exptokseq[i] = jj_expentries.get(i); - } - return new ParseException(token, exptokseq, tokenImage); - } - - /** Enable tracing. */ - final public void enable_tracing() { - } - - /** Disable tracing. */ - final public void disable_tracing() { - } - - private void jj_rescan_token() { - jj_rescan = true; - for (int i = 0; i < 43; i++) { - try { - JJCalls p = jj_2_rtns[i]; - do { - if (p.gen > jj_gen) { - jj_la = p.arg; - jj_lastpos = jj_scanpos = p.first; - switch (i) { - case 0: - jj_3_1(); - break; - case 1: - jj_3_2(); - break; - case 2: - jj_3_3(); - break; - case 3: - jj_3_4(); - break; - case 4: - jj_3_5(); - break; - case 5: - jj_3_6(); - break; - case 6: - jj_3_7(); - break; - case 7: - jj_3_8(); - break; - case 8: - jj_3_9(); - break; - case 9: - jj_3_10(); - break; - case 10: - jj_3_11(); - break; - case 11: - jj_3_12(); - break; - case 12: - jj_3_13(); - break; - case 13: - jj_3_14(); - break; - case 14: - jj_3_15(); - break; - case 15: - jj_3_16(); - break; - case 16: - jj_3_17(); - break; - case 17: - jj_3_18(); - break; - case 18: - jj_3_19(); - break; - case 19: - jj_3_20(); - break; - case 20: - jj_3_21(); - break; - case 21: - jj_3_22(); - break; - case 22: - jj_3_23(); - break; - case 23: - jj_3_24(); - break; - case 24: - jj_3_25(); - break; - case 25: - jj_3_26(); - break; - case 26: - jj_3_27(); - break; - case 27: - jj_3_28(); - break; - case 28: - jj_3_29(); - break; - case 29: - jj_3_30(); - break; - case 30: - jj_3_31(); - break; - case 31: - jj_3_32(); - break; - case 32: - jj_3_33(); - break; - case 33: - jj_3_34(); - break; - case 34: - jj_3_35(); - break; - case 35: - jj_3_36(); - break; - case 36: - jj_3_37(); - break; - case 37: - jj_3_38(); - break; - case 38: - jj_3_39(); - break; - case 39: - jj_3_40(); - break; - case 40: - jj_3_41(); - break; - case 41: - jj_3_42(); - break; - case 42: - jj_3_43(); - break; - } - } - p = p.next; - } while (p != null); - } catch (LookaheadSuccess ls) { - } - } - jj_rescan = false; - } - - private void jj_save(int index, int xla) { - JJCalls p = jj_2_rtns[index]; - while (p.gen > jj_gen) { - if (p.next == null) { - p = p.next = new JJCalls(); - break; - } - p = p.next; - } - p.gen = jj_gen + xla - jj_la; - p.first = token; - p.arg = xla; - } - - static final class JJCalls { - - int gen; - - Token first; - - int arg; - - JJCalls next; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserConstants.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserConstants.java deleted file mode 100644 index c17a56d91e0..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserConstants.java +++ /dev/null @@ -1,531 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. ASTParserConstants.java */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package japa.parser; - - -/** - * Token literal values and constants. - * Generated by org.javacc.parser.OtherFilesGen#start() - */ -public interface ASTParserConstants { - - /** End of File. */ - int EOF = 0; - - /** RegularExpression Id. */ - int SINGLE_LINE_COMMENT = 6; - - /** RegularExpression Id. */ - int JAVA_DOC_COMMENT = 9; - - /** RegularExpression Id. */ - int MULTI_LINE_COMMENT = 10; - - /** RegularExpression Id. */ - int ABSTRACT = 12; - - /** RegularExpression Id. */ - int ASSERT = 13; - - /** RegularExpression Id. */ - int BOOLEAN = 14; - - /** RegularExpression Id. */ - int BREAK = 15; - - /** RegularExpression Id. */ - int BYTE = 16; - - /** RegularExpression Id. */ - int CASE = 17; - - /** RegularExpression Id. */ - int CATCH = 18; - - /** RegularExpression Id. */ - int CHAR = 19; - - /** RegularExpression Id. */ - int CLASS = 20; - - /** RegularExpression Id. */ - int CONST = 21; - - /** RegularExpression Id. */ - int CONTINUE = 22; - - /** RegularExpression Id. */ - int _DEFAULT = 23; - - /** RegularExpression Id. */ - int DO = 24; - - /** RegularExpression Id. */ - int DOUBLE = 25; - - /** RegularExpression Id. */ - int ELSE = 26; - - /** RegularExpression Id. */ - int ENUM = 27; - - /** RegularExpression Id. */ - int EXTENDS = 28; - - /** RegularExpression Id. */ - int FALSE = 29; - - /** RegularExpression Id. */ - int FINAL = 30; - - /** RegularExpression Id. */ - int FINALLY = 31; - - /** RegularExpression Id. */ - int FLOAT = 32; - - /** RegularExpression Id. */ - int FOR = 33; - - /** RegularExpression Id. */ - int GOTO = 34; - - /** RegularExpression Id. */ - int IF = 35; - - /** RegularExpression Id. */ - int IMPLEMENTS = 36; - - /** RegularExpression Id. */ - int IMPORT = 37; - - /** RegularExpression Id. */ - int INSTANCEOF = 38; - - /** RegularExpression Id. */ - int INT = 39; - - /** RegularExpression Id. */ - int INTERFACE = 40; - - /** RegularExpression Id. */ - int LONG = 41; - - /** RegularExpression Id. */ - int NATIVE = 42; - - /** RegularExpression Id. */ - int NEW = 43; - - /** RegularExpression Id. */ - int NULL = 44; - - /** RegularExpression Id. */ - int PACKAGE = 45; - - /** RegularExpression Id. */ - int PRIVATE = 46; - - /** RegularExpression Id. */ - int PROTECTED = 47; - - /** RegularExpression Id. */ - int PUBLIC = 48; - - /** RegularExpression Id. */ - int RETURN = 49; - - /** RegularExpression Id. */ - int SHORT = 50; - - /** RegularExpression Id. */ - int STATIC = 51; - - /** RegularExpression Id. */ - int STRICTFP = 52; - - /** RegularExpression Id. */ - int SUPER = 53; - - /** RegularExpression Id. */ - int SWITCH = 54; - - /** RegularExpression Id. */ - int SYNCHRONIZED = 55; - - /** RegularExpression Id. */ - int THIS = 56; - - /** RegularExpression Id. */ - int THROW = 57; - - /** RegularExpression Id. */ - int THROWS = 58; - - /** RegularExpression Id. */ - int TRANSIENT = 59; - - /** RegularExpression Id. */ - int TRUE = 60; - - /** RegularExpression Id. */ - int TRY = 61; - - /** RegularExpression Id. */ - int VOID = 62; - - /** RegularExpression Id. */ - int VOLATILE = 63; - - /** RegularExpression Id. */ - int WHILE = 64; - - /** RegularExpression Id. */ - int LONG_LITERAL = 65; - - /** RegularExpression Id. */ - int INTEGER_LITERAL = 66; - - /** RegularExpression Id. */ - int DECIMAL_LITERAL = 67; - - /** RegularExpression Id. */ - int HEX_LITERAL = 68; - - /** RegularExpression Id. */ - int OCTAL_LITERAL = 69; - - /** RegularExpression Id. */ - int FLOATING_POINT_LITERAL = 70; - - /** RegularExpression Id. */ - int DECIMAL_FLOATING_POINT_LITERAL = 71; - - /** RegularExpression Id. */ - int DECIMAL_EXPONENT = 72; - - /** RegularExpression Id. */ - int HEXADECIMAL_FLOATING_POINT_LITERAL = 73; - - /** RegularExpression Id. */ - int HEXADECIMAL_EXPONENT = 74; - - /** RegularExpression Id. */ - int CHARACTER_LITERAL = 75; - - /** RegularExpression Id. */ - int STRING_LITERAL = 76; - - /** RegularExpression Id. */ - int IDENTIFIER = 77; - - /** RegularExpression Id. */ - int LETTER = 78; - - /** RegularExpression Id. */ - int PART_LETTER = 79; - - /** RegularExpression Id. */ - int LPAREN = 80; - - /** RegularExpression Id. */ - int RPAREN = 81; - - /** RegularExpression Id. */ - int LBRACE = 82; - - /** RegularExpression Id. */ - int RBRACE = 83; - - /** RegularExpression Id. */ - int LBRACKET = 84; - - /** RegularExpression Id. */ - int RBRACKET = 85; - - /** RegularExpression Id. */ - int SEMICOLON = 86; - - /** RegularExpression Id. */ - int COMMA = 87; - - /** RegularExpression Id. */ - int DOT = 88; - - /** RegularExpression Id. */ - int AT = 89; - - /** RegularExpression Id. */ - int ASSIGN = 90; - - /** RegularExpression Id. */ - int LT = 91; - - /** RegularExpression Id. */ - int BANG = 92; - - /** RegularExpression Id. */ - int TILDE = 93; - - /** RegularExpression Id. */ - int HOOK = 94; - - /** RegularExpression Id. */ - int COLON = 95; - - /** RegularExpression Id. */ - int EQ = 96; - - /** RegularExpression Id. */ - int LE = 97; - - /** RegularExpression Id. */ - int GE = 98; - - /** RegularExpression Id. */ - int NE = 99; - - /** RegularExpression Id. */ - int SC_OR = 100; - - /** RegularExpression Id. */ - int SC_AND = 101; - - /** RegularExpression Id. */ - int INCR = 102; - - /** RegularExpression Id. */ - int DECR = 103; - - /** RegularExpression Id. */ - int PLUS = 104; - - /** RegularExpression Id. */ - int MINUS = 105; - - /** RegularExpression Id. */ - int STAR = 106; - - /** RegularExpression Id. */ - int SLASH = 107; - - /** RegularExpression Id. */ - int BIT_AND = 108; - - /** RegularExpression Id. */ - int BIT_OR = 109; - - /** RegularExpression Id. */ - int XOR = 110; - - /** RegularExpression Id. */ - int REM = 111; - - /** RegularExpression Id. */ - int LSHIFT = 112; - - /** RegularExpression Id. */ - int PLUSASSIGN = 113; - - /** RegularExpression Id. */ - int MINUSASSIGN = 114; - - /** RegularExpression Id. */ - int STARASSIGN = 115; - - /** RegularExpression Id. */ - int SLASHASSIGN = 116; - - /** RegularExpression Id. */ - int ANDASSIGN = 117; - - /** RegularExpression Id. */ - int ORASSIGN = 118; - - /** RegularExpression Id. */ - int XORASSIGN = 119; - - /** RegularExpression Id. */ - int REMASSIGN = 120; - - /** RegularExpression Id. */ - int LSHIFTASSIGN = 121; - - /** RegularExpression Id. */ - int RSIGNEDSHIFTASSIGN = 122; - - /** RegularExpression Id. */ - int RUNSIGNEDSHIFTASSIGN = 123; - - /** RegularExpression Id. */ - int ELLIPSIS = 124; - - /** RegularExpression Id. */ - int RUNSIGNEDSHIFT = 125; - - /** RegularExpression Id. */ - int RSIGNEDSHIFT = 126; - - /** RegularExpression Id. */ - int GT = 127; - - /** Lexical state. */ - int DEFAULT = 0; - - /** Lexical state. */ - int IN_JAVA_DOC_COMMENT = 1; - - /** Lexical state. */ - int IN_MULTI_LINE_COMMENT = 2; - - /** Literal token values. */ - String[] tokenImage = { - "", - "\" \"", - "\"\\t\"", - "\"\\n\"", - "\"\\r\"", - "\"\\f\"", - "", - "", - "\"/*\"", - "\"*/\"", - "\"*/\"", - "", - "\"abstract\"", - "\"assert\"", - "\"boolean\"", - "\"break\"", - "\"byte\"", - "\"case\"", - "\"catch\"", - "\"char\"", - "\"class\"", - "\"const\"", - "\"continue\"", - "\"default\"", - "\"do\"", - "\"double\"", - "\"else\"", - "\"enum\"", - "\"extends\"", - "\"false\"", - "\"final\"", - "\"finally\"", - "\"float\"", - "\"for\"", - "\"goto\"", - "\"if\"", - "\"implements\"", - "\"import\"", - "\"instanceof\"", - "\"int\"", - "\"interface\"", - "\"long\"", - "\"native\"", - "\"new\"", - "\"null\"", - "\"package\"", - "\"private\"", - "\"protected\"", - "\"public\"", - "\"return\"", - "\"short\"", - "\"static\"", - "\"strictfp\"", - "\"super\"", - "\"switch\"", - "\"synchronized\"", - "\"this\"", - "\"throw\"", - "\"throws\"", - "\"transient\"", - "\"true\"", - "\"try\"", - "\"void\"", - "\"volatile\"", - "\"while\"", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "\"(\"", - "\")\"", - "\"{\"", - "\"}\"", - "\"[\"", - "\"]\"", - "\";\"", - "\",\"", - "\".\"", - "\"@\"", - "\"=\"", - "\"<\"", - "\"!\"", - "\"~\"", - "\"?\"", - "\":\"", - "\"==\"", - "\"<=\"", - "\">=\"", - "\"!=\"", - "\"||\"", - "\"&&\"", - "\"++\"", - "\"--\"", - "\"+\"", - "\"-\"", - "\"*\"", - "\"/\"", - "\"&\"", - "\"|\"", - "\"^\"", - "\"%\"", - "\"<<\"", - "\"+=\"", - "\"-=\"", - "\"*=\"", - "\"/=\"", - "\"&=\"", - "\"|=\"", - "\"^=\"", - "\"%=\"", - "\"<<=\"", - "\">>=\"", - "\">>>=\"", - "\"...\"", - "\">>>\"", - "\">>\"", - "\">\"", - "\"\\u001a\"", - }; - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserTokenManager.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserTokenManager.java deleted file mode 100644 index dad38f6ece0..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserTokenManager.java +++ /dev/null @@ -1,2579 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. ASTParserTokenManager.java */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package japa.parser; - -import japa.parser.ast.BlockComment; -import japa.parser.ast.Comment; -import japa.parser.ast.LineComment; -import japa.parser.ast.body.JavadocComment; - -import java.util.LinkedList; -import java.util.List; -import java.util.Stack; - -/** Token Manager. */ -public class ASTParserTokenManager implements ASTParserConstants { - - private List comments; - - private final Stack javadocStack = new Stack(); - - private JavadocComment lastJavadoc; - - void pushJavadoc() { - javadocStack.push(lastJavadoc); - } - - JavadocComment popJavadoc() { - return javadocStack.pop(); - } - - List getComments() { - return comments; - } - - void clearComments() { - comments = null; - javadocStack.clear(); - lastJavadoc = null; - } - - private void CommonTokenAction(Token token) { - lastJavadoc = null; - if (token.specialToken != null) { - if (comments == null) { - comments = new LinkedList(); - } - Token special = token.specialToken; - if (special.kind == JAVA_DOC_COMMENT) { - lastJavadoc = new JavadocComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(3, special.image.length() - 2)); - comments.add(lastJavadoc); - } else if (special.kind == SINGLE_LINE_COMMENT) { - LineComment comment = new LineComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2)); - comments.add(comment); - } else if (special.kind == MULTI_LINE_COMMENT) { - BlockComment comment = new BlockComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2, special.image.length() - 2)); - comments.add(comment); - } - } - } - - /** Debug output. */ - public java.io.PrintStream debugStream = System.out; - - /** Set debug output. */ - public void setDebugStream(java.io.PrintStream ds) { - debugStream = ds; - } - - private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1, long active2) { - switch (pos) { - case 0: - if ((active0 & 0xfffffffffffff000L) != 0L || (active1 & 0x1L) != 0L) { - jjmatchedKind = 77; - return 37; - } - if ((active1 & 0x1000000001000000L) != 0L) { - return 1; - } - if ((active0 & 0x100L) != 0L || (active1 & 0x10080000000000L) != 0L) { - return 54; - } - return -1; - case 1: - if ((active0 & 0x100L) != 0L) { - return 59; - } - if ((active0 & 0x803000000L) != 0L) { - return 37; - } - if ((active0 & 0xfffffff7fcfff000L) != 0L || (active1 & 0x1L) != 0L) { - if (jjmatchedPos != 1) { - jjmatchedKind = 77; - jjmatchedPos = 1; - } - return 37; - } - return -1; - case 2: - if ((active0 & 0xdffff675fefff000L) != 0L || (active1 & 0x1L) != 0L) { - if (jjmatchedPos != 2) { - jjmatchedKind = 77; - jjmatchedPos = 2; - } - return 37; - } - if ((active0 & 0x2000098200000000L) != 0L) { - return 37; - } - return -1; - case 3: - if ((active0 & 0x8effe571f2f4f000L) != 0L || (active1 & 0x1L) != 0L) { - jjmatchedKind = 77; - jjmatchedPos = 3; - return 37; - } - if ((active0 & 0x510012040c0b0000L) != 0L) { - return 37; - } - return -1; - case 4: - if ((active0 & 0x88dbe57012c07000L) != 0L) { - if (jjmatchedPos != 4) { - jjmatchedKind = 77; - jjmatchedPos = 4; - } - return 37; - } - if ((active0 & 0x6240001e0348000L) != 0L || (active1 & 0x1L) != 0L) { - return 37; - } - return -1; - case 5: - if ((active0 & 0x8890e15090c05000L) != 0L) { - jjmatchedKind = 77; - jjmatchedPos = 5; - return 37; - } - if ((active0 & 0x44b042002002000L) != 0L) { - return 37; - } - return -1; - case 6: - if ((active0 & 0x8890815000401000L) != 0L) { - jjmatchedKind = 77; - jjmatchedPos = 6; - return 37; - } - if ((active0 & 0x600090804000L) != 0L) { - return 37; - } - return -1; - case 7: - if ((active0 & 0x880815000000000L) != 0L) { - jjmatchedKind = 77; - jjmatchedPos = 7; - return 37; - } - if ((active0 & 0x8010000000401000L) != 0L) { - return 37; - } - return -1; - case 8: - if ((active0 & 0x800810000000000L) != 0L) { - return 37; - } - if ((active0 & 0x80005000000000L) != 0L) { - jjmatchedKind = 77; - jjmatchedPos = 8; - return 37; - } - return -1; - case 9: - if ((active0 & 0x80000000000000L) != 0L) { - jjmatchedKind = 77; - jjmatchedPos = 9; - return 37; - } - if ((active0 & 0x5000000000L) != 0L) { - return 37; - } - return -1; - case 10: - if ((active0 & 0x80000000000000L) != 0L) { - jjmatchedKind = 77; - jjmatchedPos = 10; - return 37; - } - return -1; - default: - return -1; - } - } - - private final int jjStartNfa_0(int pos, long active0, long active1, long active2) { - return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1, active2), pos + 1); - } - - private int jjStopAtPos(int pos, int kind) { - jjmatchedKind = kind; - jjmatchedPos = pos; - return pos + 1; - } - - private int jjMoveStringLiteralDfa0_0() { - switch (curChar) { - case 26: - return jjStopAtPos(0, 128); - case 33: - jjmatchedKind = 92; - return jjMoveStringLiteralDfa1_0(0x0L, 0x800000000L); - case 37: - jjmatchedKind = 111; - return jjMoveStringLiteralDfa1_0(0x0L, 0x100000000000000L); - case 38: - jjmatchedKind = 108; - return jjMoveStringLiteralDfa1_0(0x0L, 0x20002000000000L); - case 40: - return jjStopAtPos(0, 80); - case 41: - return jjStopAtPos(0, 81); - case 42: - jjmatchedKind = 106; - return jjMoveStringLiteralDfa1_0(0x0L, 0x8000000000000L); - case 43: - jjmatchedKind = 104; - return jjMoveStringLiteralDfa1_0(0x0L, 0x2004000000000L); - case 44: - return jjStopAtPos(0, 87); - case 45: - jjmatchedKind = 105; - return jjMoveStringLiteralDfa1_0(0x0L, 0x4008000000000L); - case 46: - jjmatchedKind = 88; - return jjMoveStringLiteralDfa1_0(0x0L, 0x1000000000000000L); - case 47: - jjmatchedKind = 107; - return jjMoveStringLiteralDfa1_0(0x100L, 0x10000000000000L); - case 58: - return jjStopAtPos(0, 95); - case 59: - return jjStopAtPos(0, 86); - case 60: - jjmatchedKind = 91; - return jjMoveStringLiteralDfa1_0(0x0L, 0x201000200000000L); - case 61: - jjmatchedKind = 90; - return jjMoveStringLiteralDfa1_0(0x0L, 0x100000000L); - case 62: - jjmatchedKind = 127; - return jjMoveStringLiteralDfa1_0(0x0L, 0x6c00000400000000L); - case 63: - return jjStopAtPos(0, 94); - case 64: - return jjStopAtPos(0, 89); - case 91: - return jjStopAtPos(0, 84); - case 93: - return jjStopAtPos(0, 85); - case 94: - jjmatchedKind = 110; - return jjMoveStringLiteralDfa1_0(0x0L, 0x80000000000000L); - case 97: - return jjMoveStringLiteralDfa1_0(0x3000L, 0x0L); - case 98: - return jjMoveStringLiteralDfa1_0(0x1c000L, 0x0L); - case 99: - return jjMoveStringLiteralDfa1_0(0x7e0000L, 0x0L); - case 100: - return jjMoveStringLiteralDfa1_0(0x3800000L, 0x0L); - case 101: - return jjMoveStringLiteralDfa1_0(0x1c000000L, 0x0L); - case 102: - return jjMoveStringLiteralDfa1_0(0x3e0000000L, 0x0L); - case 103: - return jjMoveStringLiteralDfa1_0(0x400000000L, 0x0L); - case 105: - return jjMoveStringLiteralDfa1_0(0x1f800000000L, 0x0L); - case 108: - return jjMoveStringLiteralDfa1_0(0x20000000000L, 0x0L); - case 110: - return jjMoveStringLiteralDfa1_0(0x1c0000000000L, 0x0L); - case 112: - return jjMoveStringLiteralDfa1_0(0x1e00000000000L, 0x0L); - case 114: - return jjMoveStringLiteralDfa1_0(0x2000000000000L, 0x0L); - case 115: - return jjMoveStringLiteralDfa1_0(0xfc000000000000L, 0x0L); - case 116: - return jjMoveStringLiteralDfa1_0(0x3f00000000000000L, 0x0L); - case 118: - return jjMoveStringLiteralDfa1_0(0xc000000000000000L, 0x0L); - case 119: - return jjMoveStringLiteralDfa1_0(0x0L, 0x1L); - case 123: - return jjStopAtPos(0, 82); - case 124: - jjmatchedKind = 109; - return jjMoveStringLiteralDfa1_0(0x0L, 0x40001000000000L); - case 125: - return jjStopAtPos(0, 83); - case 126: - return jjStopAtPos(0, 93); - default: - return jjMoveNfa_0(0, 0); - } - } - - private int jjMoveStringLiteralDfa1_0(long active0, long active1) { - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(0, active0, active1, 0L); - return 1; - } - switch (curChar) { - case 38: - if ((active1 & 0x2000000000L) != 0L) { - return jjStopAtPos(1, 101); - } - break; - case 42: - if ((active0 & 0x100L) != 0L) { - return jjStartNfaWithStates_0(1, 8, 59); - } - break; - case 43: - if ((active1 & 0x4000000000L) != 0L) { - return jjStopAtPos(1, 102); - } - break; - case 45: - if ((active1 & 0x8000000000L) != 0L) { - return jjStopAtPos(1, 103); - } - break; - case 46: - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x1000000000000000L); - case 60: - if ((active1 & 0x1000000000000L) != 0L) { - jjmatchedKind = 112; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x200000000000000L); - case 61: - if ((active1 & 0x100000000L) != 0L) { - return jjStopAtPos(1, 96); - } else if ((active1 & 0x200000000L) != 0L) { - return jjStopAtPos(1, 97); - } else if ((active1 & 0x400000000L) != 0L) { - return jjStopAtPos(1, 98); - } else if ((active1 & 0x800000000L) != 0L) { - return jjStopAtPos(1, 99); - } else if ((active1 & 0x2000000000000L) != 0L) { - return jjStopAtPos(1, 113); - } else if ((active1 & 0x4000000000000L) != 0L) { - return jjStopAtPos(1, 114); - } else if ((active1 & 0x8000000000000L) != 0L) { - return jjStopAtPos(1, 115); - } else if ((active1 & 0x10000000000000L) != 0L) { - return jjStopAtPos(1, 116); - } else if ((active1 & 0x20000000000000L) != 0L) { - return jjStopAtPos(1, 117); - } else if ((active1 & 0x40000000000000L) != 0L) { - return jjStopAtPos(1, 118); - } else if ((active1 & 0x80000000000000L) != 0L) { - return jjStopAtPos(1, 119); - } else if ((active1 & 0x100000000000000L) != 0L) { - return jjStopAtPos(1, 120); - } - break; - case 62: - if ((active1 & 0x4000000000000000L) != 0L) { - jjmatchedKind = 126; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x2c00000000000000L); - case 97: - return jjMoveStringLiteralDfa2_0(active0, 0x240020060000L, active1, 0L); - case 98: - return jjMoveStringLiteralDfa2_0(active0, 0x1000L, active1, 0L); - case 101: - return jjMoveStringLiteralDfa2_0(active0, 0x2080000800000L, active1, 0L); - case 102: - if ((active0 & 0x800000000L) != 0L) { - return jjStartNfaWithStates_0(1, 35, 37); - } - break; - case 104: - return jjMoveStringLiteralDfa2_0(active0, 0x704000000080000L, active1, 0x1L); - case 105: - return jjMoveStringLiteralDfa2_0(active0, 0xc0000000L, active1, 0L); - case 108: - return jjMoveStringLiteralDfa2_0(active0, 0x104100000L, active1, 0L); - case 109: - return jjMoveStringLiteralDfa2_0(active0, 0x3000000000L, active1, 0L); - case 110: - return jjMoveStringLiteralDfa2_0(active0, 0x1c008000000L, active1, 0L); - case 111: - if ((active0 & 0x1000000L) != 0L) { - jjmatchedKind = 24; - jjmatchedPos = 1; - } - return jjMoveStringLiteralDfa2_0(active0, 0xc000020602604000L, active1, 0L); - case 114: - return jjMoveStringLiteralDfa2_0(active0, 0x3800c00000008000L, active1, 0L); - case 115: - return jjMoveStringLiteralDfa2_0(active0, 0x2000L, active1, 0L); - case 116: - return jjMoveStringLiteralDfa2_0(active0, 0x18000000000000L, active1, 0L); - case 117: - return jjMoveStringLiteralDfa2_0(active0, 0x21100000000000L, active1, 0L); - case 119: - return jjMoveStringLiteralDfa2_0(active0, 0x40000000000000L, active1, 0L); - case 120: - return jjMoveStringLiteralDfa2_0(active0, 0x10000000L, active1, 0L); - case 121: - return jjMoveStringLiteralDfa2_0(active0, 0x80000000010000L, active1, 0L); - case 124: - if ((active1 & 0x1000000000L) != 0L) { - return jjStopAtPos(1, 100); - } - break; - default: - break; - } - return jjStartNfa_0(0, active0, active1, 0L); - } - - private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) { - return jjStartNfa_0(0, old0, old1, 0L); - } - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(1, active0, active1, 0L); - return 2; - } - switch (curChar) { - case 46: - if ((active1 & 0x1000000000000000L) != 0L) { - return jjStopAtPos(2, 124); - } - break; - case 61: - if ((active1 & 0x200000000000000L) != 0L) { - return jjStopAtPos(2, 121); - } else if ((active1 & 0x400000000000000L) != 0L) { - return jjStopAtPos(2, 122); - } - break; - case 62: - if ((active1 & 0x2000000000000000L) != 0L) { - jjmatchedKind = 125; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x800000000000000L); - case 97: - return jjMoveStringLiteralDfa3_0(active0, 0x808000000180000L, active1, 0L); - case 98: - return jjMoveStringLiteralDfa3_0(active0, 0x1000000000000L, active1, 0L); - case 99: - return jjMoveStringLiteralDfa3_0(active0, 0x200000000000L, active1, 0L); - case 101: - return jjMoveStringLiteralDfa3_0(active0, 0x8000L, active1, 0L); - case 102: - return jjMoveStringLiteralDfa3_0(active0, 0x800000L, active1, 0L); - case 105: - return jjMoveStringLiteralDfa3_0(active0, 0x4140400000000000L, active1, 0x1L); - case 108: - return jjMoveStringLiteralDfa3_0(active0, 0x8000100020000000L, active1, 0L); - case 110: - return jjMoveStringLiteralDfa3_0(active0, 0x800200c0600000L, active1, 0L); - case 111: - return jjMoveStringLiteralDfa3_0(active0, 0x4800100004000L, active1, 0L); - case 112: - return jjMoveStringLiteralDfa3_0(active0, 0x20003000000000L, active1, 0L); - case 114: - if ((active0 & 0x200000000L) != 0L) { - return jjStartNfaWithStates_0(2, 33, 37); - } - return jjMoveStringLiteralDfa3_0(active0, 0x610000000000000L, active1, 0L); - case 115: - return jjMoveStringLiteralDfa3_0(active0, 0x4004023000L, active1, 0L); - case 116: - if ((active0 & 0x8000000000L) != 0L) { - jjmatchedKind = 39; - jjmatchedPos = 2; - } - return jjMoveStringLiteralDfa3_0(active0, 0x2050410050000L, active1, 0L); - case 117: - return jjMoveStringLiteralDfa3_0(active0, 0x100000000a000000L, active1, 0L); - case 119: - if ((active0 & 0x80000000000L) != 0L) { - return jjStartNfaWithStates_0(2, 43, 37); - } - break; - case 121: - if ((active0 & 0x2000000000000000L) != 0L) { - return jjStartNfaWithStates_0(2, 61, 37); - } - break; - default: - break; - } - return jjStartNfa_0(1, active0, active1, 0L); - } - - private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) { - return jjStartNfa_0(1, old0, old1, 0L); - } - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(2, active0, active1, 0L); - return 3; - } - switch (curChar) { - case 61: - if ((active1 & 0x800000000000000L) != 0L) { - return jjStopAtPos(3, 123); - } - break; - case 97: - return jjMoveStringLiteralDfa4_0(active0, 0x80000001c0808000L, active1, 0L); - case 98: - return jjMoveStringLiteralDfa4_0(active0, 0x2000000L, active1, 0L); - case 99: - return jjMoveStringLiteralDfa4_0(active0, 0x80000000040000L, active1, 0L); - case 100: - if ((active0 & 0x4000000000000000L) != 0L) { - return jjStartNfaWithStates_0(3, 62, 37); - } - break; - case 101: - if ((active0 & 0x10000L) != 0L) { - return jjStartNfaWithStates_0(3, 16, 37); - } else if ((active0 & 0x20000L) != 0L) { - return jjStartNfaWithStates_0(3, 17, 37); - } else if ((active0 & 0x4000000L) != 0L) { - return jjStartNfaWithStates_0(3, 26, 37); - } else if ((active0 & 0x1000000000000000L) != 0L) { - return jjStartNfaWithStates_0(3, 60, 37); - } - return jjMoveStringLiteralDfa4_0(active0, 0x20010010002000L, active1, 0L); - case 103: - if ((active0 & 0x20000000000L) != 0L) { - return jjStartNfaWithStates_0(3, 41, 37); - } - break; - case 105: - return jjMoveStringLiteralDfa4_0(active0, 0x10040000000000L, active1, 0L); - case 107: - return jjMoveStringLiteralDfa4_0(active0, 0x200000000000L, active1, 0L); - case 108: - if ((active0 & 0x100000000000L) != 0L) { - return jjStartNfaWithStates_0(3, 44, 37); - } - return jjMoveStringLiteralDfa4_0(active0, 0x1001000004000L, active1, 0x1L); - case 109: - if ((active0 & 0x8000000L) != 0L) { - return jjStartNfaWithStates_0(3, 27, 37); - } - break; - case 110: - return jjMoveStringLiteralDfa4_0(active0, 0x800000000000000L, active1, 0L); - case 111: - if ((active0 & 0x400000000L) != 0L) { - return jjStartNfaWithStates_0(3, 34, 37); - } - return jjMoveStringLiteralDfa4_0(active0, 0x600002000000000L, active1, 0L); - case 114: - if ((active0 & 0x80000L) != 0L) { - return jjStartNfaWithStates_0(3, 19, 37); - } - return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000L, active1, 0L); - case 115: - if ((active0 & 0x100000000000000L) != 0L) { - return jjStartNfaWithStates_0(3, 56, 37); - } - return jjMoveStringLiteralDfa4_0(active0, 0x20300000L, active1, 0L); - case 116: - return jjMoveStringLiteralDfa4_0(active0, 0x48804000401000L, active1, 0L); - case 117: - return jjMoveStringLiteralDfa4_0(active0, 0x2000000000000L, active1, 0L); - case 118: - return jjMoveStringLiteralDfa4_0(active0, 0x400000000000L, active1, 0L); - default: - break; - } - return jjStartNfa_0(2, active0, active1, 0L); - } - - private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) { - return jjStartNfa_0(2, old0, old1, 0L); - } - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(3, active0, active1, 0L); - return 4; - } - switch (curChar) { - case 97: - return jjMoveStringLiteralDfa5_0(active0, 0x604000000000L, active1, 0L); - case 99: - return jjMoveStringLiteralDfa5_0(active0, 0x50000000000000L, active1, 0L); - case 101: - if ((active0 & 0x20000000L) != 0L) { - return jjStartNfaWithStates_0(4, 29, 37); - } else if ((active1 & 0x1L) != 0L) { - return jjStartNfaWithStates_0(4, 64, 37); - } - return jjMoveStringLiteralDfa5_0(active0, 0x801000004000L, active1, 0L); - case 104: - if ((active0 & 0x40000L) != 0L) { - return jjStartNfaWithStates_0(4, 18, 37); - } - return jjMoveStringLiteralDfa5_0(active0, 0x80000000000000L, active1, 0L); - case 105: - return jjMoveStringLiteralDfa5_0(active0, 0x9000000400000L, active1, 0L); - case 107: - if ((active0 & 0x8000L) != 0L) { - return jjStartNfaWithStates_0(4, 15, 37); - } - break; - case 108: - if ((active0 & 0x40000000L) != 0L) { - jjmatchedKind = 30; - jjmatchedPos = 4; - } - return jjMoveStringLiteralDfa5_0(active0, 0x82000000L, active1, 0L); - case 110: - return jjMoveStringLiteralDfa5_0(active0, 0x10000000L, active1, 0L); - case 114: - if ((active0 & 0x20000000000000L) != 0L) { - return jjStartNfaWithStates_0(4, 53, 37); - } - return jjMoveStringLiteralDfa5_0(active0, 0x2012000003000L, active1, 0L); - case 115: - if ((active0 & 0x100000L) != 0L) { - return jjStartNfaWithStates_0(4, 20, 37); - } - return jjMoveStringLiteralDfa5_0(active0, 0x800000000000000L, active1, 0L); - case 116: - if ((active0 & 0x200000L) != 0L) { - return jjStartNfaWithStates_0(4, 21, 37); - } else if ((active0 & 0x100000000L) != 0L) { - return jjStartNfaWithStates_0(4, 32, 37); - } else if ((active0 & 0x4000000000000L) != 0L) { - return jjStartNfaWithStates_0(4, 50, 37); - } - return jjMoveStringLiteralDfa5_0(active0, 0x8000000000000000L, active1, 0L); - case 117: - return jjMoveStringLiteralDfa5_0(active0, 0x800000L, active1, 0L); - case 118: - return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0L); - case 119: - if ((active0 & 0x200000000000000L) != 0L) { - jjmatchedKind = 57; - jjmatchedPos = 4; - } - return jjMoveStringLiteralDfa5_0(active0, 0x400000000000000L, active1, 0L); - default: - break; - } - return jjStartNfa_0(3, active0, active1, 0L); - } - - private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1) { - if (((active0 &= old0) | (active1 &= old1)) == 0L) { - return jjStartNfa_0(3, old0, old1, 0L); - } - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(4, active0, 0L, 0L); - return 5; - } - switch (curChar) { - case 97: - return jjMoveStringLiteralDfa6_0(active0, 0x5000L); - case 99: - if ((active0 & 0x1000000000000L) != 0L) { - return jjStartNfaWithStates_0(5, 48, 37); - } else if ((active0 & 0x8000000000000L) != 0L) { - return jjStartNfaWithStates_0(5, 51, 37); - } - return jjMoveStringLiteralDfa6_0(active0, 0x800000000000L); - case 100: - return jjMoveStringLiteralDfa6_0(active0, 0x10000000L); - case 101: - if ((active0 & 0x2000000L) != 0L) { - return jjStartNfaWithStates_0(5, 25, 37); - } else if ((active0 & 0x40000000000L) != 0L) { - return jjStartNfaWithStates_0(5, 42, 37); - } - break; - case 102: - return jjMoveStringLiteralDfa6_0(active0, 0x10000000000L); - case 103: - return jjMoveStringLiteralDfa6_0(active0, 0x200000000000L); - case 104: - if ((active0 & 0x40000000000000L) != 0L) { - return jjStartNfaWithStates_0(5, 54, 37); - } - break; - case 105: - return jjMoveStringLiteralDfa6_0(active0, 0x8800000000000000L); - case 108: - return jjMoveStringLiteralDfa6_0(active0, 0x80800000L); - case 109: - return jjMoveStringLiteralDfa6_0(active0, 0x1000000000L); - case 110: - if ((active0 & 0x2000000000000L) != 0L) { - return jjStartNfaWithStates_0(5, 49, 37); - } - return jjMoveStringLiteralDfa6_0(active0, 0x4000400000L); - case 114: - return jjMoveStringLiteralDfa6_0(active0, 0x80000000000000L); - case 115: - if ((active0 & 0x400000000000000L) != 0L) { - return jjStartNfaWithStates_0(5, 58, 37); - } - break; - case 116: - if ((active0 & 0x2000L) != 0L) { - return jjStartNfaWithStates_0(5, 13, 37); - } else if ((active0 & 0x2000000000L) != 0L) { - return jjStartNfaWithStates_0(5, 37, 37); - } - return jjMoveStringLiteralDfa6_0(active0, 0x10400000000000L); - default: - break; - } - return jjStartNfa_0(4, active0, 0L, 0L); - } - - private int jjMoveStringLiteralDfa6_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) { - return jjStartNfa_0(4, old0, 0L, 0L); - } - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(5, active0, 0L, 0L); - return 6; - } - switch (curChar) { - case 97: - return jjMoveStringLiteralDfa7_0(active0, 0x10000000000L); - case 99: - return jjMoveStringLiteralDfa7_0(active0, 0x4000001000L); - case 101: - if ((active0 & 0x200000000000L) != 0L) { - return jjStartNfaWithStates_0(6, 45, 37); - } else if ((active0 & 0x400000000000L) != 0L) { - return jjStartNfaWithStates_0(6, 46, 37); - } - return jjMoveStringLiteralDfa7_0(active0, 0x800001000000000L); - case 102: - return jjMoveStringLiteralDfa7_0(active0, 0x10000000000000L); - case 108: - return jjMoveStringLiteralDfa7_0(active0, 0x8000000000000000L); - case 110: - if ((active0 & 0x4000L) != 0L) { - return jjStartNfaWithStates_0(6, 14, 37); - } - break; - case 111: - return jjMoveStringLiteralDfa7_0(active0, 0x80000000000000L); - case 115: - if ((active0 & 0x10000000L) != 0L) { - return jjStartNfaWithStates_0(6, 28, 37); - } - break; - case 116: - if ((active0 & 0x800000L) != 0L) { - return jjStartNfaWithStates_0(6, 23, 37); - } - return jjMoveStringLiteralDfa7_0(active0, 0x800000000000L); - case 117: - return jjMoveStringLiteralDfa7_0(active0, 0x400000L); - case 121: - if ((active0 & 0x80000000L) != 0L) { - return jjStartNfaWithStates_0(6, 31, 37); - } - break; - default: - break; - } - return jjStartNfa_0(5, active0, 0L, 0L); - } - - private int jjMoveStringLiteralDfa7_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) { - return jjStartNfa_0(5, old0, 0L, 0L); - } - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(6, active0, 0L, 0L); - return 7; - } - switch (curChar) { - case 99: - return jjMoveStringLiteralDfa8_0(active0, 0x10000000000L); - case 101: - if ((active0 & 0x400000L) != 0L) { - return jjStartNfaWithStates_0(7, 22, 37); - } else if ((active0 & 0x8000000000000000L) != 0L) { - return jjStartNfaWithStates_0(7, 63, 37); - } - return jjMoveStringLiteralDfa8_0(active0, 0x804000000000L); - case 110: - return jjMoveStringLiteralDfa8_0(active0, 0x880001000000000L); - case 112: - if ((active0 & 0x10000000000000L) != 0L) { - return jjStartNfaWithStates_0(7, 52, 37); - } - break; - case 116: - if ((active0 & 0x1000L) != 0L) { - return jjStartNfaWithStates_0(7, 12, 37); - } - break; - default: - break; - } - return jjStartNfa_0(6, active0, 0L, 0L); - } - - private int jjMoveStringLiteralDfa8_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) { - return jjStartNfa_0(6, old0, 0L, 0L); - } - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(7, active0, 0L, 0L); - return 8; - } - switch (curChar) { - case 100: - if ((active0 & 0x800000000000L) != 0L) { - return jjStartNfaWithStates_0(8, 47, 37); - } - break; - case 101: - if ((active0 & 0x10000000000L) != 0L) { - return jjStartNfaWithStates_0(8, 40, 37); - } - break; - case 105: - return jjMoveStringLiteralDfa9_0(active0, 0x80000000000000L); - case 111: - return jjMoveStringLiteralDfa9_0(active0, 0x4000000000L); - case 116: - if ((active0 & 0x800000000000000L) != 0L) { - return jjStartNfaWithStates_0(8, 59, 37); - } - return jjMoveStringLiteralDfa9_0(active0, 0x1000000000L); - default: - break; - } - return jjStartNfa_0(7, active0, 0L, 0L); - } - - private int jjMoveStringLiteralDfa9_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) { - return jjStartNfa_0(7, old0, 0L, 0L); - } - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(8, active0, 0L, 0L); - return 9; - } - switch (curChar) { - case 102: - if ((active0 & 0x4000000000L) != 0L) { - return jjStartNfaWithStates_0(9, 38, 37); - } - break; - case 115: - if ((active0 & 0x1000000000L) != 0L) { - return jjStartNfaWithStates_0(9, 36, 37); - } - break; - case 122: - return jjMoveStringLiteralDfa10_0(active0, 0x80000000000000L); - default: - break; - } - return jjStartNfa_0(8, active0, 0L, 0L); - } - - private int jjMoveStringLiteralDfa10_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) { - return jjStartNfa_0(8, old0, 0L, 0L); - } - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(9, active0, 0L, 0L); - return 10; - } - switch (curChar) { - case 101: - return jjMoveStringLiteralDfa11_0(active0, 0x80000000000000L); - default: - break; - } - return jjStartNfa_0(9, active0, 0L, 0L); - } - - private int jjMoveStringLiteralDfa11_0(long old0, long active0) { - if (((active0 &= old0)) == 0L) { - return jjStartNfa_0(9, old0, 0L, 0L); - } - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - jjStopStringLiteralDfa_0(10, active0, 0L, 0L); - return 11; - } - switch (curChar) { - case 100: - if ((active0 & 0x80000000000000L) != 0L) { - return jjStartNfaWithStates_0(11, 55, 37); - } - break; - default: - break; - } - return jjStartNfa_0(10, active0, 0L, 0L); - } - - private int jjStartNfaWithStates_0(int pos, int kind, int state) { - jjmatchedKind = kind; - jjmatchedPos = pos; - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - return pos + 1; - } - return jjMoveNfa_0(state, pos + 1); - } - - static final long[] jjbitVec0 = { - 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL - }; - - static final long[] jjbitVec2 = { - 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL - }; - - static final long[] jjbitVec3 = { - 0xfff0000000200002L, 0xffffffffffffdfffL, 0xfffff00f7fffffffL, 0x12000000007fffffL - }; - - static final long[] jjbitVec4 = { - 0x0L, 0x0L, 0x420043c00000000L, 0xff7fffffff7fffffL - }; - - static final long[] jjbitVec5 = { - 0x7fffffffffffffL, 0xffffffffffff0000L, 0xffffffffffffffffL, 0x401f0003ffc3L - }; - - static final long[] jjbitVec6 = { - 0x0L, 0x400000000000000L, 0xfffffffbffffd740L, 0xfbfffffffff7fffL - }; - - static final long[] jjbitVec7 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc03L, 0x33fffffffff7fffL - }; - - static final long[] jjbitVec8 = { - 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xffL, 0x707ffffff0000L - }; - - static final long[] jjbitVec9 = { - 0x7fffffe00000000L, 0xfffec000000007ffL, 0xffffffffffffffffL, 0x9c00c060002fffffL - }; - - static final long[] jjbitVec10 = { - 0xfffffffd0000L, 0xe000L, 0x2003fffffffffL, 0x0L - }; - - static final long[] jjbitVec11 = { - 0x23fffffffffffff0L, 0x3ff010000L, 0x23c5fdfffff99fe0L, 0xf0003b0000000L - }; - - static final long[] jjbitVec12 = { - 0x36dfdfffff987e0L, 0x1c00005e000000L, 0x23edfdfffffbbfe0L, 0x2000300010000L - }; - - static final long[] jjbitVec13 = { - 0x23edfdfffff99fe0L, 0x20003b0000000L, 0x3bfc718d63dc7e8L, 0x200000000000000L - }; - - static final long[] jjbitVec14 = { - 0x3effdfffffddfe0L, 0x300000000L, 0x23effdfffffddfe0L, 0x340000000L - }; - - static final long[] jjbitVec15 = { - 0x3fffdfffffddfe0L, 0x300000000L, 0x2ffbfffffc7fffe0L, 0x7fL - }; - - static final long[] jjbitVec16 = { - 0x800dfffffffffffeL, 0x7fL, 0x200decaefef02596L, 0x3000005fL - }; - - static final long[] jjbitVec17 = { - 0x1L, 0x7fffffffeffL, 0xf00L, 0x0L - }; - - static final long[] jjbitVec18 = { - 0x6fbffffffffL, 0x3f0000L, 0xffffffff00000000L, 0x1ffffffffff003fL - }; - - static final long[] jjbitVec19 = { - 0xffffffffffffffffL, 0xffffffff83ffffffL, 0xffffff07ffffffffL, 0x3ffffffffffffffL - }; - - static final long[] jjbitVec20 = { - 0xffffffffffffff7fL, 0xffffffff3d7f3d7fL, 0x7f3d7fffffff3d7fL, 0xffff7fffff7f7f3dL - }; - - static final long[] jjbitVec21 = { - 0xffffffff7f3d7fffL, 0x7ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL - }; - - static final long[] jjbitVec22 = { - 0xffffffffffffffffL, 0x7f9fffffffffffL, 0xffffffff07fffffeL, 0x1c7ffffffffffL - }; - - static final long[] jjbitVec23 = { - 0x3ffff0003dfffL, 0x1dfff0003ffffL, 0xfffffffffffffL, 0x18800000L - }; - - static final long[] jjbitVec24 = { - 0xffffffff00000000L, 0xffffffffffffffL, 0x1ffffffffffL, 0x0L - }; - - static final long[] jjbitVec25 = { - 0x1fffffffL, 0x1f3fffffff0000L, 0x0L, 0x0L - }; - - static final long[] jjbitVec26 = { - 0xffffffffffffffffL, 0xfffffffffffL, 0x0L, 0x0L - }; - - static final long[] jjbitVec27 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffff0fffffffL, 0x3ffffffffffffffL - }; - - static final long[] jjbitVec28 = { - 0xffffffff3f3fffffL, 0x3fffffffaaff3f3fL, 0x5fdfffffffffffffL, 0x1fdc1fff0fcf1fdcL - }; - - static final long[] jjbitVec29 = { - 0x8000000000000000L, 0x8002000000100001L, 0x3ffff00000000L, 0x0L - }; - - static final long[] jjbitVec30 = { - 0xe3fbbd503e2ffc84L, 0xffffffff000003e0L, 0xfL, 0x0L - }; - - static final long[] jjbitVec31 = { - 0x1f3e03fe000000e0L, 0xfffffffffffffffeL, 0xfffffffee07fffffL, 0xffffffffffffffffL - }; - - static final long[] jjbitVec32 = { - 0xfffe1fffffffffe0L, 0xffffffffffffffffL, 0xffffff00007fffL, 0xffff000000000000L - }; - - static final long[] jjbitVec33 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffffffL, 0x0L - }; - - static final long[] jjbitVec34 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffL, 0x0L - }; - - static final long[] jjbitVec35 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0x1fffL, 0x0L - }; - - static final long[] jjbitVec36 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffL, 0x0L - }; - - static final long[] jjbitVec37 = { - 0x6L, 0x0L, 0x0L, 0x0L - }; - - static final long[] jjbitVec38 = { - 0xffff3fffffffffffL, 0x7ffffffffffL, 0x0L, 0x0L - }; - - static final long[] jjbitVec39 = { - 0x5f7ffdffa0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L - }; - - static final long[] jjbitVec40 = { - 0x3fffffffffffffffL, 0xffffffffffff0000L, 0xfffffffffffcffffL, 0x1fff0000000000ffL - }; - - static final long[] jjbitVec41 = { - 0x18000000000000L, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x1fffffffffffffffL - }; - - static final long[] jjbitVec42 = { - 0x87fffffe00000010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0x631cfcfcfcL - }; - - static final long[] jjbitVec43 = { - 0x0L, 0x0L, 0x420243cffffffffL, 0xff7fffffff7fffffL - }; - - static final long[] jjbitVec44 = { - 0xffffffffffffffffL, 0x400ffffe0ffffffL, 0xfffffffbffffd740L, 0xfbfffffffff7fffL - }; - - static final long[] jjbitVec45 = { - 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc7bL, 0x33fffffffff7fffL - }; - - static final long[] jjbitVec46 = { - 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xbbfffffbfffe00ffL, 0x707ffffff0016L - }; - - static final long[] jjbitVec47 = { - 0x7fffffe003f000fL, 0xffffc3ff01ffffffL, 0xffffffffffffffffL, 0x9ffffdffbfefffffL - }; - - static final long[] jjbitVec48 = { - 0xffffffffffff8000L, 0xe7ffL, 0x3ffffffffffffL, 0x0L - }; - - static final long[] jjbitVec49 = { - 0xf3fffffffffffffeL, 0xffcfff1f3fffL, 0xf3c5fdfffff99feeL, 0xfffcfb080399fL - }; - - static final long[] jjbitVec50 = { - 0xd36dfdfffff987eeL, 0x1fffc05e003987L, 0xf3edfdfffffbbfeeL, 0x2ffcf00013bbfL - }; - - static final long[] jjbitVec51 = { - 0xf3edfdfffff99feeL, 0x2ffc3b0c0398fL, 0xc3bfc718d63dc7ecL, 0x200ff8000803dc7L - }; - - static final long[] jjbitVec52 = { - 0xc3effdfffffddfeeL, 0xffc300603ddfL, 0xf3effdfffffddfecL, 0xffc340603ddfL - }; - - static final long[] jjbitVec53 = { - 0xc3fffdfffffddfecL, 0xffc300803dcfL, 0x2ffbfffffc7fffecL, 0xc0000ff5f847fL - }; - - static final long[] jjbitVec54 = { - 0x87fffffffffffffeL, 0x3ff7fffL, 0x3bffecaefef02596L, 0x33ff3f5fL - }; - - static final long[] jjbitVec55 = { - 0xc2a003ff03000001L, 0xfffe07fffffffeffL, 0x1ffffffffeff0fdfL, 0x40L - }; - - static final long[] jjbitVec56 = { - 0x3c7f6fbffffffffL, 0x3ff03ffL, 0xffffffff00000000L, 0x1ffffffffff003fL - }; - - static final long[] jjbitVec57 = { - 0xffffffff7f3d7fffL, 0x3fe0007ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL - }; - - static final long[] jjbitVec58 = { - 0x1fffff001fdfffL, 0xddfff000fffffL, 0xffffffffffffffffL, 0x3ff388fffffL - }; - - static final long[] jjbitVec59 = { - 0xffffffff03ff3800L, 0xffffffffffffffL, 0x3ffffffffffL, 0x0L - }; - - static final long[] jjbitVec60 = { - 0xfff0fff1fffffffL, 0x1f3fffffffffc0L, 0x0L, 0x0L - }; - - static final long[] jjbitVec61 = { - 0x80007c000000f000L, 0x8002fc0f00100001L, 0x3ffff00000000L, 0x7e21fff0000L - }; - - static final long[] jjbitVec62 = { - 0x1f3efffe000000e0L, 0xfffffffffffffffeL, 0xfffffffee67fffffL, 0xffffffffffffffffL - }; - - static final long[] jjbitVec63 = { - 0x10000000000006L, 0x0L, 0x0L, 0x0L - }; - - static final long[] jjbitVec64 = { - 0x3L, 0x0L, 0x0L, 0x0L - }; - - static final long[] jjbitVec65 = { - 0x0L, 0x800000000000000L, 0x0L, 0x0L - }; - - static final long[] jjbitVec66 = { - 0x5f7ffdffe0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L - }; - - static final long[] jjbitVec67 = { - 0x18000f0000ffffL, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x9fffffffffffffffL - }; - - static final long[] jjbitVec68 = { - 0x87fffffe03ff0010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0xe0000631cfcfcfcL - }; - - private int jjMoveNfa_0(int startState, int curPos) { - int startsAt = 0; - jjnewStateCnt = 86; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (;;) { - if (++jjround == 0x7fffffff) { - ReInitRounds(); - } - if (curChar < 64) { - long l = 1L << curChar; - do { - switch (jjstateSet[--i]) { - case 54: - if (curChar == 42) { - jjstateSet[jjnewStateCnt++] = 59; - } else if (curChar == 47) { - if (kind > 6) { - kind = 6; - } - jjCheckNAddStates(0, 2); - } - break; - case 0: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(3, 9); - } else if (curChar == 47) { - jjAddStates(10, 11); - } else if (curChar == 36) { - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - } else if (curChar == 34) { - jjCheckNAddStates(12, 15); - } else if (curChar == 39) { - jjAddStates(16, 18); - } else if (curChar == 46) { - jjCheckNAdd(1); - } - if ((0x3fe000000000000L & l) != 0L) { - if (kind > 66) { - kind = 66; - } - jjCheckNAddStates(19, 21); - } else if (curChar == 48) { - if (kind > 66) { - kind = 66; - } - jjCheckNAddStates(22, 28); - } - break; - case 1: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddStates(29, 31); - break; - case 3: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(4); - } - break; - case 4: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddTwoStates(4, 5); - break; - case 6: - if (curChar == 39) { - jjAddStates(16, 18); - } - break; - case 7: - if ((0xffffff7fffffdbffL & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 8: - if (curChar == 39 && kind > 75) { - kind = 75; - } - break; - case 10: - if ((0x8400000000L & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 11: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(12, 8); - } - break; - case 12: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 13: - if ((0xf000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 14; - } - break; - case 14: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAdd(12); - } - break; - case 16: - if ((0x3ff000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 17; - } - break; - case 17: - if ((0x3ff000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 18; - } - break; - case 18: - if ((0x3ff000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 19; - } - break; - case 19: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 21: - if (curChar == 34) { - jjCheckNAddStates(12, 15); - } - break; - case 22: - if ((0xfffffffbffffdbffL & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 24: - if ((0x8400000000L & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 26: - if ((0x3ff000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 27; - } - break; - case 27: - if ((0x3ff000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 28; - } - break; - case 28: - if ((0x3ff000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 29; - } - break; - case 29: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 31: - if (curChar == 34 && kind > 76) { - kind = 76; - } - break; - case 32: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddStates(32, 36); - } - break; - case 33: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 34: - if ((0xf000000000000L & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 35; - } - break; - case 35: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAdd(33); - } - break; - case 36: - if (curChar != 36) { - break; - } - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - break; - case 37: - if ((0x3ff00100fffc1ffL & l) == 0L) { - break; - } - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - break; - case 38: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(3, 9); - } - break; - case 39: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(37, 39); - } - break; - case 41: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(42); - } - break; - case 42: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(42, 5); - } - break; - case 43: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(43, 44); - } - break; - case 45: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(46); - } - break; - case 46: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddTwoStates(46, 5); - break; - case 47: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(47, 48); - } - break; - case 48: - if (curChar != 46) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddStates(40, 42); - break; - case 49: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddStates(40, 42); - break; - case 51: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(52); - } - break; - case 52: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddTwoStates(52, 5); - break; - case 53: - if (curChar == 47) { - jjAddStates(10, 11); - } - break; - case 55: - if ((0xffffffffffffdbffL & l) == 0L) { - break; - } - if (kind > 6) { - kind = 6; - } - jjCheckNAddStates(0, 2); - break; - case 56: - if ((0x2400L & l) != 0L && kind > 6) { - kind = 6; - } - break; - case 57: - if (curChar == 10 && kind > 6) { - kind = 6; - } - break; - case 58: - if (curChar == 13) { - jjstateSet[jjnewStateCnt++] = 57; - } - break; - case 59: - if (curChar == 42) { - jjstateSet[jjnewStateCnt++] = 60; - } - break; - case 60: - if ((0xffff7fffffffffffL & l) != 0L && kind > 7) { - kind = 7; - } - break; - case 61: - if (curChar == 42) { - jjstateSet[jjnewStateCnt++] = 59; - } - break; - case 62: - if ((0x3fe000000000000L & l) == 0L) { - break; - } - if (kind > 66) { - kind = 66; - } - jjCheckNAddStates(19, 21); - break; - case 63: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(63, 64); - } - break; - case 65: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 66) { - kind = 66; - } - jjCheckNAdd(65); - break; - case 66: - if (curChar != 48) { - break; - } - if (kind > 66) { - kind = 66; - } - jjCheckNAddStates(22, 28); - break; - case 68: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(68, 64); - } - break; - case 69: - if ((0xff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(69, 64); - } - break; - case 71: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 66) { - kind = 66; - } - jjstateSet[jjnewStateCnt++] = 71; - break; - case 72: - if ((0xff000000000000L & l) == 0L) { - break; - } - if (kind > 66) { - kind = 66; - } - jjCheckNAdd(72); - break; - case 74: - if ((0x3ff000000000000L & l) != 0L) { - jjAddStates(43, 44); - } - break; - case 75: - if (curChar == 46) { - jjCheckNAdd(76); - } - break; - case 76: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddTwoStates(76, 77); - } - break; - case 78: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(79); - } - break; - case 79: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddTwoStates(79, 5); - break; - case 81: - if ((0x3ff000000000000L & l) != 0L) { - jjCheckNAddStates(45, 47); - } - break; - case 82: - if (curChar == 46) { - jjCheckNAdd(83); - } - break; - case 84: - if ((0x280000000000L & l) != 0L) { - jjCheckNAdd(85); - } - break; - case 85: - if ((0x3ff000000000000L & l) == 0L) { - break; - } - if (kind > 70) { - kind = 70; - } - jjCheckNAddTwoStates(85, 5); - break; - default: - break; - } - } while (i != startsAt); - } else if (curChar < 128) { - long l = 1L << (curChar & 077); - do { - switch (jjstateSet[--i]) { - case 0: - if ((0x7fffffe87fffffeL & l) == 0L) { - break; - } - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - break; - case 2: - if ((0x2000000020L & l) != 0L) { - jjAddStates(48, 49); - } - break; - case 5: - if ((0x5000000050L & l) != 0L && kind > 70) { - kind = 70; - } - break; - case 7: - if ((0xffffffffefffffffL & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 9: - if (curChar == 92) { - jjAddStates(50, 52); - } - break; - case 10: - if ((0x14404410000000L & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 15: - if (curChar == 117) { - jjstateSet[jjnewStateCnt++] = 16; - } - break; - case 16: - if ((0x7e0000007eL & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 17; - } - break; - case 17: - if ((0x7e0000007eL & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 18; - } - break; - case 18: - if ((0x7e0000007eL & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 19; - } - break; - case 19: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAdd(8); - } - break; - case 20: - if (curChar == 92) { - jjstateSet[jjnewStateCnt++] = 15; - } - break; - case 22: - if ((0xffffffffefffffffL & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 23: - if (curChar == 92) { - jjAddStates(53, 55); - } - break; - case 24: - if ((0x14404410000000L & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 25: - if (curChar == 117) { - jjstateSet[jjnewStateCnt++] = 26; - } - break; - case 26: - if ((0x7e0000007eL & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 27; - } - break; - case 27: - if ((0x7e0000007eL & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 28; - } - break; - case 28: - if ((0x7e0000007eL & l) != 0L) { - jjstateSet[jjnewStateCnt++] = 29; - } - break; - case 29: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAddStates(12, 15); - } - break; - case 30: - if (curChar == 92) { - jjstateSet[jjnewStateCnt++] = 25; - } - break; - case 37: - if ((0x87fffffe87fffffeL & l) == 0L) { - break; - } - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - break; - case 40: - if ((0x2000000020L & l) != 0L) { - jjAddStates(56, 57); - } - break; - case 44: - if ((0x2000000020L & l) != 0L) { - jjAddStates(58, 59); - } - break; - case 50: - if ((0x2000000020L & l) != 0L) { - jjAddStates(60, 61); - } - break; - case 55: - if (kind > 6) { - kind = 6; - } - jjAddStates(0, 2); - break; - case 60: - if (kind > 7) { - kind = 7; - } - break; - case 64: - if ((0x100000001000L & l) != 0L && kind > 65) { - kind = 65; - } - break; - case 67: - if ((0x100000001000000L & l) != 0L) { - jjCheckNAdd(68); - } - break; - case 68: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAddTwoStates(68, 64); - } - break; - case 70: - if ((0x100000001000000L & l) != 0L) { - jjCheckNAdd(71); - } - break; - case 71: - if ((0x7e0000007eL & l) == 0L) { - break; - } - if (kind > 66) { - kind = 66; - } - jjCheckNAdd(71); - break; - case 73: - if ((0x100000001000000L & l) != 0L) { - jjCheckNAddTwoStates(74, 75); - } - break; - case 74: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAddTwoStates(74, 75); - } - break; - case 76: - if ((0x7e0000007eL & l) != 0L) { - jjAddStates(62, 63); - } - break; - case 77: - if ((0x1000000010000L & l) != 0L) { - jjAddStates(64, 65); - } - break; - case 80: - if ((0x100000001000000L & l) != 0L) { - jjCheckNAdd(81); - } - break; - case 81: - if ((0x7e0000007eL & l) != 0L) { - jjCheckNAddStates(45, 47); - } - break; - case 83: - if ((0x1000000010000L & l) != 0L) { - jjAddStates(66, 67); - } - break; - default: - break; - } - } while (i != startsAt); - } else { - int hiByte = curChar >> 8; - int i1 = hiByte >> 6; - long l1 = 1L << (hiByte & 077); - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do { - switch (jjstateSet[--i]) { - case 0: - if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) { - break; - } - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - break; - case 7: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { - jjstateSet[jjnewStateCnt++] = 8; - } - break; - case 22: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { - jjAddStates(12, 15); - } - break; - case 37: - if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) { - break; - } - if (kind > 77) { - kind = 77; - } - jjCheckNAdd(37); - break; - case 55: - if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) { - break; - } - if (kind > 6) { - kind = 6; - } - jjAddStates(0, 2); - break; - case 60: - if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 7) { - kind = 7; - } - break; - default: - break; - } - } while (i != startsAt); - } - if (kind != 0x7fffffff) { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; - } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 86 - (jjnewStateCnt = startsAt))) { - return curPos; - } - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - return curPos; - } - } - } - - private int jjMoveStringLiteralDfa0_2() { - switch (curChar) { - case 42: - return jjMoveStringLiteralDfa1_2(0x400L); - default: - return 1; - } - } - - private int jjMoveStringLiteralDfa1_2(long active0) { - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - return 1; - } - switch (curChar) { - case 47: - if ((active0 & 0x400L) != 0L) { - return jjStopAtPos(1, 10); - } - break; - default: - return 2; - } - return 2; - } - - private int jjMoveStringLiteralDfa0_1() { - switch (curChar) { - case 42: - return jjMoveStringLiteralDfa1_1(0x200L); - default: - return 1; - } - } - - private int jjMoveStringLiteralDfa1_1(long active0) { - try { - curChar = input_stream.readChar(); - } catch (java.io.IOException e) { - return 1; - } - switch (curChar) { - case 47: - if ((active0 & 0x200L) != 0L) { - return jjStopAtPos(1, 9); - } - break; - default: - return 2; - } - return 2; - } - - static final int[] jjnextStates = { - 55, 56, 58, 39, 40, 5, 43, 44, 47, 48, 54, 61, 22, 23, 30, 31, - 7, 9, 20, 63, 64, 65, 67, 69, 64, 70, 72, 73, 80, 1, 2, 5, - 22, 23, 33, 30, 31, 39, 40, 5, 49, 50, 5, 74, 75, 81, 82, 83, - 3, 4, 10, 11, 13, 24, 32, 34, 41, 42, 45, 46, 51, 52, 76, 77, - 78, 79, 84, 85, - }; - - private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) { - switch (hiByte) { - case 0: - return ((jjbitVec2[i2] & l2) != 0L); - default: - if ((jjbitVec0[i1] & l1) != 0L) { - return true; - } - return false; - } - } - - private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2) { - switch (hiByte) { - case 0: - return ((jjbitVec4[i2] & l2) != 0L); - case 2: - return ((jjbitVec5[i2] & l2) != 0L); - case 3: - return ((jjbitVec6[i2] & l2) != 0L); - case 4: - return ((jjbitVec7[i2] & l2) != 0L); - case 5: - return ((jjbitVec8[i2] & l2) != 0L); - case 6: - return ((jjbitVec9[i2] & l2) != 0L); - case 7: - return ((jjbitVec10[i2] & l2) != 0L); - case 9: - return ((jjbitVec11[i2] & l2) != 0L); - case 10: - return ((jjbitVec12[i2] & l2) != 0L); - case 11: - return ((jjbitVec13[i2] & l2) != 0L); - case 12: - return ((jjbitVec14[i2] & l2) != 0L); - case 13: - return ((jjbitVec15[i2] & l2) != 0L); - case 14: - return ((jjbitVec16[i2] & l2) != 0L); - case 15: - return ((jjbitVec17[i2] & l2) != 0L); - case 16: - return ((jjbitVec18[i2] & l2) != 0L); - case 17: - return ((jjbitVec19[i2] & l2) != 0L); - case 18: - return ((jjbitVec20[i2] & l2) != 0L); - case 19: - return ((jjbitVec21[i2] & l2) != 0L); - case 20: - return ((jjbitVec0[i2] & l2) != 0L); - case 22: - return ((jjbitVec22[i2] & l2) != 0L); - case 23: - return ((jjbitVec23[i2] & l2) != 0L); - case 24: - return ((jjbitVec24[i2] & l2) != 0L); - case 25: - return ((jjbitVec25[i2] & l2) != 0L); - case 29: - return ((jjbitVec26[i2] & l2) != 0L); - case 30: - return ((jjbitVec27[i2] & l2) != 0L); - case 31: - return ((jjbitVec28[i2] & l2) != 0L); - case 32: - return ((jjbitVec29[i2] & l2) != 0L); - case 33: - return ((jjbitVec30[i2] & l2) != 0L); - case 48: - return ((jjbitVec31[i2] & l2) != 0L); - case 49: - return ((jjbitVec32[i2] & l2) != 0L); - case 77: - return ((jjbitVec33[i2] & l2) != 0L); - case 159: - return ((jjbitVec34[i2] & l2) != 0L); - case 164: - return ((jjbitVec35[i2] & l2) != 0L); - case 215: - return ((jjbitVec36[i2] & l2) != 0L); - case 216: - return ((jjbitVec37[i2] & l2) != 0L); - case 250: - return ((jjbitVec38[i2] & l2) != 0L); - case 251: - return ((jjbitVec39[i2] & l2) != 0L); - case 253: - return ((jjbitVec40[i2] & l2) != 0L); - case 254: - return ((jjbitVec41[i2] & l2) != 0L); - case 255: - return ((jjbitVec42[i2] & l2) != 0L); - default: - if ((jjbitVec3[i1] & l1) != 0L) { - return true; - } - return false; - } - } - - private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2) { - switch (hiByte) { - case 0: - return ((jjbitVec43[i2] & l2) != 0L); - case 2: - return ((jjbitVec5[i2] & l2) != 0L); - case 3: - return ((jjbitVec44[i2] & l2) != 0L); - case 4: - return ((jjbitVec45[i2] & l2) != 0L); - case 5: - return ((jjbitVec46[i2] & l2) != 0L); - case 6: - return ((jjbitVec47[i2] & l2) != 0L); - case 7: - return ((jjbitVec48[i2] & l2) != 0L); - case 9: - return ((jjbitVec49[i2] & l2) != 0L); - case 10: - return ((jjbitVec50[i2] & l2) != 0L); - case 11: - return ((jjbitVec51[i2] & l2) != 0L); - case 12: - return ((jjbitVec52[i2] & l2) != 0L); - case 13: - return ((jjbitVec53[i2] & l2) != 0L); - case 14: - return ((jjbitVec54[i2] & l2) != 0L); - case 15: - return ((jjbitVec55[i2] & l2) != 0L); - case 16: - return ((jjbitVec56[i2] & l2) != 0L); - case 17: - return ((jjbitVec19[i2] & l2) != 0L); - case 18: - return ((jjbitVec20[i2] & l2) != 0L); - case 19: - return ((jjbitVec57[i2] & l2) != 0L); - case 20: - return ((jjbitVec0[i2] & l2) != 0L); - case 22: - return ((jjbitVec22[i2] & l2) != 0L); - case 23: - return ((jjbitVec58[i2] & l2) != 0L); - case 24: - return ((jjbitVec59[i2] & l2) != 0L); - case 25: - return ((jjbitVec60[i2] & l2) != 0L); - case 29: - return ((jjbitVec26[i2] & l2) != 0L); - case 30: - return ((jjbitVec27[i2] & l2) != 0L); - case 31: - return ((jjbitVec28[i2] & l2) != 0L); - case 32: - return ((jjbitVec61[i2] & l2) != 0L); - case 33: - return ((jjbitVec30[i2] & l2) != 0L); - case 48: - return ((jjbitVec62[i2] & l2) != 0L); - case 49: - return ((jjbitVec32[i2] & l2) != 0L); - case 77: - return ((jjbitVec33[i2] & l2) != 0L); - case 159: - return ((jjbitVec34[i2] & l2) != 0L); - case 164: - return ((jjbitVec35[i2] & l2) != 0L); - case 215: - return ((jjbitVec36[i2] & l2) != 0L); - case 216: - return ((jjbitVec63[i2] & l2) != 0L); - case 220: - return ((jjbitVec64[i2] & l2) != 0L); - case 221: - return ((jjbitVec65[i2] & l2) != 0L); - case 250: - return ((jjbitVec38[i2] & l2) != 0L); - case 251: - return ((jjbitVec66[i2] & l2) != 0L); - case 253: - return ((jjbitVec40[i2] & l2) != 0L); - case 254: - return ((jjbitVec67[i2] & l2) != 0L); - case 255: - return ((jjbitVec68[i2] & l2) != 0L); - default: - if ((jjbitVec3[i1] & l1) != 0L) { - return true; - } - return false; - } - } - - /** Token literal values. */ - public static final String[] jjstrLiteralImages = { - "", null, null, null, null, null, null, null, null, null, null, null, - "\141\142\163\164\162\141\143\164", "\141\163\163\145\162\164", "\142\157\157\154\145\141\156", - "\142\162\145\141\153", "\142\171\164\145", "\143\141\163\145", "\143\141\164\143\150", - "\143\150\141\162", "\143\154\141\163\163", "\143\157\156\163\164", - "\143\157\156\164\151\156\165\145", "\144\145\146\141\165\154\164", "\144\157", "\144\157\165\142\154\145", - "\145\154\163\145", "\145\156\165\155", "\145\170\164\145\156\144\163", "\146\141\154\163\145", - "\146\151\156\141\154", "\146\151\156\141\154\154\171", "\146\154\157\141\164", "\146\157\162", - "\147\157\164\157", "\151\146", "\151\155\160\154\145\155\145\156\164\163", - "\151\155\160\157\162\164", "\151\156\163\164\141\156\143\145\157\146", "\151\156\164", - "\151\156\164\145\162\146\141\143\145", "\154\157\156\147", "\156\141\164\151\166\145", "\156\145\167", - "\156\165\154\154", "\160\141\143\153\141\147\145", "\160\162\151\166\141\164\145", - "\160\162\157\164\145\143\164\145\144", "\160\165\142\154\151\143", "\162\145\164\165\162\156", - "\163\150\157\162\164", "\163\164\141\164\151\143", "\163\164\162\151\143\164\146\160", - "\163\165\160\145\162", "\163\167\151\164\143\150", - "\163\171\156\143\150\162\157\156\151\172\145\144", "\164\150\151\163", "\164\150\162\157\167", "\164\150\162\157\167\163", - "\164\162\141\156\163\151\145\156\164", "\164\162\165\145", "\164\162\171", "\166\157\151\144", - "\166\157\154\141\164\151\154\145", "\167\150\151\154\145", null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, "\50", "\51", "\173", "\175", "\133", "\135", - "\73", "\54", "\56", "\100", "\75", "\74", "\41", "\176", "\77", "\72", "\75\75", - "\74\75", "\76\75", "\41\75", "\174\174", "\46\46", "\53\53", "\55\55", "\53", "\55", - "\52", "\57", "\46", "\174", "\136", "\45", "\74\74", "\53\75", "\55\75", "\52\75", - "\57\75", "\46\75", "\174\75", "\136\75", "\45\75", "\74\74\75", "\76\76\75", - "\76\76\76\75", "\56\56\56", "\76\76\76", "\76\76", "\76", "\32", }; - - /** Lexer state names. */ - public static final String[] lexStateNames = { - "DEFAULT", - "IN_JAVA_DOC_COMMENT", - "IN_MULTI_LINE_COMMENT", - }; - - /** Lex State array. */ - public static final int[] jjnewLexState = { - -1, -1, -1, -1, -1, -1, -1, 1, 2, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, - }; - - static final long[] jjtoToken = { - 0xfffffffffffff001L, 0xffffffffffff3847L, 0x1L, - }; - - static final long[] jjtoSkip = { - 0x67eL, 0x0L, 0x0L, - }; - - static final long[] jjtoSpecial = { - 0x640L, 0x0L, 0x0L, - }; - - static final long[] jjtoMore = { - 0x980L, 0x0L, 0x0L, - }; - - protected JavaCharStream input_stream; - - private final int[] jjrounds = new int[86]; - - private final int[] jjstateSet = new int[172]; - - private final StringBuilder jjimage = new StringBuilder(); - - private StringBuilder image = jjimage; - - private int jjimageLen; - - private int lengthOfMatch; - - protected char curChar; - - /** Constructor. */ - public ASTParserTokenManager(JavaCharStream stream) { - if (JavaCharStream.staticFlag) { - throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); - } - input_stream = stream; - } - - /** Constructor. */ - public ASTParserTokenManager(JavaCharStream stream, int lexState) { - this(stream); - SwitchTo(lexState); - } - - /** Reinitialise parser. */ - public void ReInit(JavaCharStream stream) { - jjmatchedPos = jjnewStateCnt = 0; - curLexState = defaultLexState; - input_stream = stream; - ReInitRounds(); - } - - private void ReInitRounds() { - int i; - jjround = 0x80000001; - for (i = 86; i-- > 0;) { - jjrounds[i] = 0x80000000; - } - } - - /** Reinitialise parser. */ - public void ReInit(JavaCharStream stream, int lexState) { - ReInit(stream); - SwitchTo(lexState); - } - - /** Switch to specified lex state. */ - public void SwitchTo(int lexState) { - if (lexState >= 3 || lexState < 0) { - throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); - } else { - curLexState = lexState; - } - } - - protected Token jjFillToken() { - final Token t; - final String curTokenImage; - final int beginLine; - final int endLine; - final int beginColumn; - final int endColumn; - String im = jjstrLiteralImages[jjmatchedKind]; - curTokenImage = (im == null) ? input_stream.GetImage() : im; - beginLine = input_stream.getBeginLine(); - beginColumn = input_stream.getBeginColumn(); - endLine = input_stream.getEndLine(); - endColumn = input_stream.getEndColumn(); - t = ASTParser.GTToken.newToken(jjmatchedKind, curTokenImage); - - t.beginLine = beginLine; - t.endLine = endLine; - t.beginColumn = beginColumn; - t.endColumn = endColumn; - - return t; - } - - int curLexState = 0; - - int defaultLexState = 0; - - int jjnewStateCnt; - - int jjround; - - int jjmatchedPos; - - int jjmatchedKind; - - /** Get the next Token. */ - public Token getNextToken() { - Token specialToken = null; - Token matchedToken; - int curPos = 0; - - EOFLoop: for (;;) { - try { - curChar = input_stream.BeginToken(); - } catch (java.io.IOException e) { - jjmatchedKind = 0; - matchedToken = jjFillToken(); - matchedToken.specialToken = specialToken; - CommonTokenAction(matchedToken); - return matchedToken; - } - image = jjimage; - image.setLength(0); - jjimageLen = 0; - - for (;;) { - switch (curLexState) { - case 0: - try { - input_stream.backup(0); - while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) { - curChar = input_stream.BeginToken(); - } - } catch (java.io.IOException e1) { - continue EOFLoop; - } - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_0(); - break; - case 1: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_1(); - if (jjmatchedPos == 0 && jjmatchedKind > 11) { - jjmatchedKind = 11; - } - break; - case 2: - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_2(); - if (jjmatchedPos == 0 && jjmatchedKind > 11) { - jjmatchedKind = 11; - } - break; - } - if (jjmatchedKind != 0x7fffffff) { - if (jjmatchedPos + 1 < curPos) { - input_stream.backup(curPos - jjmatchedPos - 1); - } - if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { - matchedToken = jjFillToken(); - matchedToken.specialToken = specialToken; - TokenLexicalActions(matchedToken); - if (jjnewLexState[jjmatchedKind] != -1) { - curLexState = jjnewLexState[jjmatchedKind]; - } - CommonTokenAction(matchedToken); - return matchedToken; - } else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { - if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { - matchedToken = jjFillToken(); - if (specialToken == null) { - specialToken = matchedToken; - } else { - matchedToken.specialToken = specialToken; - specialToken = (specialToken.next = matchedToken); - } - SkipLexicalActions(matchedToken); - } else { - SkipLexicalActions(null); - } - if (jjnewLexState[jjmatchedKind] != -1) { - curLexState = jjnewLexState[jjmatchedKind]; - } - continue EOFLoop; - } - MoreLexicalActions(); - if (jjnewLexState[jjmatchedKind] != -1) { - curLexState = jjnewLexState[jjmatchedKind]; - } - curPos = 0; - jjmatchedKind = 0x7fffffff; - try { - curChar = input_stream.readChar(); - continue; - } catch (java.io.IOException e1) { - } - } - int error_line = input_stream.getEndLine(); - int error_column = input_stream.getEndColumn(); - String error_after = null; - boolean EOFSeen = false; - try { - input_stream.readChar(); - input_stream.backup(1); - } catch (java.io.IOException e1) { - EOFSeen = true; - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - if (curChar == '\n' || curChar == '\r') { - error_line++; - error_column = 0; - } else { - error_column++; - } - } - if (!EOFSeen) { - input_stream.backup(1); - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - } - throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); - } - } - } - - void SkipLexicalActions(Token matchedToken) { - switch (jjmatchedKind) { - default: - break; - } - } - - void MoreLexicalActions() { - jjimageLen += (lengthOfMatch = jjmatchedPos + 1); - switch (jjmatchedKind) { - case 7: - image.append(input_stream.GetSuffix(jjimageLen)); - jjimageLen = 0; - input_stream.backup(1); - break; - default: - break; - } - } - - void TokenLexicalActions(Token matchedToken) { - switch (jjmatchedKind) { - case 125: - image.append(jjstrLiteralImages[125]); - lengthOfMatch = jjstrLiteralImages[125].length(); - matchedToken.kind = GT; - ((ASTParser.GTToken) matchedToken).realKind = RUNSIGNEDSHIFT; - input_stream.backup(2); - break; - case 126: - image.append(jjstrLiteralImages[126]); - lengthOfMatch = jjstrLiteralImages[126].length(); - matchedToken.kind = GT; - ((ASTParser.GTToken) matchedToken).realKind = RSIGNEDSHIFT; - input_stream.backup(1); - break; - default: - break; - } - } - - private void jjCheckNAdd(int state) { - if (jjrounds[state] != jjround) { - jjstateSet[jjnewStateCnt++] = state; - jjrounds[state] = jjround; - } - } - - private void jjAddStates(int start, int end) { - do { - jjstateSet[jjnewStateCnt++] = jjnextStates[start]; - } while (start++ != end); - } - - private void jjCheckNAddTwoStates(int state1, int state2) { - jjCheckNAdd(state1); - jjCheckNAdd(state2); - } - - private void jjCheckNAddStates(int start, int end) { - do { - jjCheckNAdd(jjnextStates[start]); - } while (start++ != end); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaCharStream.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaCharStream.java deleted file mode 100644 index b094f6dbaf4..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaCharStream.java +++ /dev/null @@ -1,599 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 4.1 */ -/* JavaCCOptions:STATIC=false */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package japa.parser; - -/** - * An implementation of interface CharStream, where the stream is assumed to - * contain only ASCII characters (with java-like unicode escape processing). - */ - -public class JavaCharStream { - - /** Whether parser is static. */ - public static final boolean staticFlag = false; - - static final int hexval(char c) throws java.io.IOException { - switch (c) { - case '0': - return 0; - case '1': - return 1; - case '2': - return 2; - case '3': - return 3; - case '4': - return 4; - case '5': - return 5; - case '6': - return 6; - case '7': - return 7; - case '8': - return 8; - case '9': - return 9; - - case 'a': - case 'A': - return 10; - case 'b': - case 'B': - return 11; - case 'c': - case 'C': - return 12; - case 'd': - case 'D': - return 13; - case 'e': - case 'E': - return 14; - case 'f': - case 'F': - return 15; - } - - throw new java.io.IOException(); // Should never come here - } - - /** Position in buffer. */ - public int bufpos = -1; - - int bufsize; - - int available; - - int tokenBegin; - - protected int bufline[]; - - protected int bufcolumn[]; - - protected int column = 0; - - protected int line = 1; - - protected boolean prevCharIsCR = false; - - protected boolean prevCharIsLF = false; - - protected java.io.Reader inputStream; - - protected char[] nextCharBuf; - - protected char[] buffer; - - protected int maxNextCharInd = 0; - - protected int nextCharInd = -1; - - protected int inBuf = 0; - - protected int tabSize = 8; - - protected void setTabSize(int i) { - tabSize = i; - } - - protected int getTabSize(int i) { - return tabSize; - } - - protected void ExpandBuff(boolean wrapAround) { - char[] newbuffer = new char[bufsize + 2048]; - int newbufline[] = new int[bufsize + 2048]; - int newbufcolumn[] = new int[bufsize + 2048]; - - try { - if (wrapAround) { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - System.arraycopy(buffer, 0, newbuffer, - bufsize - tokenBegin, bufpos); - buffer = newbuffer; - - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); - bufline = newbufline; - - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); - bufcolumn = newbufcolumn; - - bufpos += (bufsize - tokenBegin); - } else { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - buffer = newbuffer; - - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - bufline = newbufline; - - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - bufcolumn = newbufcolumn; - - bufpos -= tokenBegin; - } - } catch (Throwable t) { - throw new Error(t.getMessage()); - } - - available = (bufsize += 2048); - tokenBegin = 0; - } - - protected void FillBuff() throws java.io.IOException { - int i; - if (maxNextCharInd == 4096) { - maxNextCharInd = nextCharInd = 0; - } - - try { - if ((i = inputStream.read(nextCharBuf, maxNextCharInd, - 4096 - maxNextCharInd)) == -1) { - inputStream.close(); - throw new java.io.IOException(); - } else { - maxNextCharInd += i; - } - return; - } catch (java.io.IOException e) { - if (bufpos != 0) { - --bufpos; - backup(0); - } else { - bufline[bufpos] = line; - bufcolumn[bufpos] = column; - } - throw e; - } - } - - protected char ReadByte() throws java.io.IOException { - if (++nextCharInd >= maxNextCharInd) { - FillBuff(); - } - - return nextCharBuf[nextCharInd]; - } - - /** @return starting character for token. */ - public char BeginToken() throws java.io.IOException { - if (inBuf > 0) { - --inBuf; - - if (++bufpos == bufsize) { - bufpos = 0; - } - - tokenBegin = bufpos; - return buffer[bufpos]; - } - - tokenBegin = 0; - bufpos = -1; - - return readChar(); - } - - protected void AdjustBuffSize() { - if (available == bufsize) { - if (tokenBegin > 2048) { - bufpos = 0; - available = tokenBegin; - } else { - ExpandBuff(false); - } - } else if (available > tokenBegin) { - available = bufsize; - } else if ((tokenBegin - available) < 2048) { - ExpandBuff(true); - } else { - available = tokenBegin; - } - } - - protected void UpdateLineColumn(char c) { - column++; - - if (prevCharIsLF) { - prevCharIsLF = false; - line += (column = 1); - } else if (prevCharIsCR) { - prevCharIsCR = false; - if (c == '\n') { - prevCharIsLF = true; - } else { - line += (column = 1); - } - } - - switch (c) { - case '\r': - prevCharIsCR = true; - break; - case '\n': - prevCharIsLF = true; - break; - case '\t': - column--; - column += (tabSize - (column % tabSize)); - break; - default: - break; - } - - bufline[bufpos] = line; - bufcolumn[bufpos] = column; - } - - /** Read a character. */ - public char readChar() throws java.io.IOException { - if (inBuf > 0) { - --inBuf; - - if (++bufpos == bufsize) { - bufpos = 0; - } - - return buffer[bufpos]; - } - - char c; - - if (++bufpos == available) { - AdjustBuffSize(); - } - - if ((buffer[bufpos] = c = ReadByte()) == '\\') { - UpdateLineColumn(c); - - int backSlashCnt = 1; - - for (;;) // Read all the backslashes - { - if (++bufpos == available) { - AdjustBuffSize(); - } - - try { - if ((buffer[bufpos] = c = ReadByte()) != '\\') { - UpdateLineColumn(c); - // found a non-backslash char. - if ((c == 'u') && ((backSlashCnt & 1) == 1)) { - if (--bufpos < 0) { - bufpos = bufsize - 1; - } - - break; - } - - backup(backSlashCnt); - return '\\'; - } - } catch (java.io.IOException e) { - if (backSlashCnt > 1) { - backup(backSlashCnt - 1); - } - - return '\\'; - } - - UpdateLineColumn(c); - backSlashCnt++; - } - - // Here, we have seen an odd number of backslash's followed by a 'u' - try { - while ((c = ReadByte()) == 'u') { - ++column; - } - - buffer[bufpos] = c = (char) (hexval(c) << 12 | - hexval(ReadByte()) << 8 | - hexval(ReadByte()) << 4 | - hexval(ReadByte())); - - column += 4; - } catch (java.io.IOException e) { - throw new Error("Invalid escape character at line " + line + - " column " + column + "."); - } - - if (backSlashCnt == 1) { - return c; - } else { - backup(backSlashCnt - 1); - return '\\'; - } - } else { - UpdateLineColumn(c); - return c; - } - } - - @Deprecated - /** - * @deprecated - * @see #getEndColumn - */ - public int getColumn() { - return bufcolumn[bufpos]; - } - - @Deprecated - /** - * @deprecated - * @see #getEndLine - */ - public int getLine() { - return bufline[bufpos]; - } - - /** Get end column. */ - public int getEndColumn() { - return bufcolumn[bufpos]; - } - - /** Get end line. */ - public int getEndLine() { - return bufline[bufpos]; - } - - /** @return column of token start */ - public int getBeginColumn() { - return bufcolumn[tokenBegin]; - } - - /** @return line number of token start */ - public int getBeginLine() { - return bufline[tokenBegin]; - } - - /** Retreat. */ - public void backup(int amount) { - - inBuf += amount; - if ((bufpos -= amount) < 0) { - bufpos += bufsize; - } - } - - /** Constructor. */ - public JavaCharStream(java.io.Reader dstream, - int startline, int startcolumn, int buffersize) { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - nextCharBuf = new char[4096]; - } - - /** Constructor. */ - public JavaCharStream(java.io.Reader dstream, - int startline, int startcolumn) { - this(dstream, startline, startcolumn, 4096); - } - - /** Constructor. */ - public JavaCharStream(java.io.Reader dstream) { - this(dstream, 1, 1, 4096); - } - - /** Reinitialise. */ - public void ReInit(java.io.Reader dstream, - int startline, int startcolumn, int buffersize) { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - if (buffer == null || buffersize != buffer.length) { - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - nextCharBuf = new char[4096]; - } - prevCharIsLF = prevCharIsCR = false; - tokenBegin = inBuf = maxNextCharInd = 0; - nextCharInd = bufpos = -1; - } - - /** Reinitialise. */ - public void ReInit(java.io.Reader dstream, - int startline, int startcolumn) { - ReInit(dstream, startline, startcolumn, 4096); - } - - /** Reinitialise. */ - public void ReInit(java.io.Reader dstream) { - ReInit(dstream, 1, 1, 4096); - } - - /** Constructor. */ - public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, - int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException { - this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); - } - - /** Constructor. */ - public JavaCharStream(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) { - this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096); - } - - /** Constructor. */ - public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, - int startcolumn) throws java.io.UnsupportedEncodingException { - this(dstream, encoding, startline, startcolumn, 4096); - } - - /** Constructor. */ - public JavaCharStream(java.io.InputStream dstream, int startline, - int startcolumn) { - this(dstream, startline, startcolumn, 4096); - } - - /** Constructor. */ - public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException { - this(dstream, encoding, 1, 1, 4096); - } - - /** Constructor. */ - public JavaCharStream(java.io.InputStream dstream) { - this(dstream, 1, 1, 4096); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, String encoding, int startline, - int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException { - ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) { - ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, String encoding, int startline, - int startcolumn) throws java.io.UnsupportedEncodingException { - ReInit(dstream, encoding, startline, startcolumn, 4096); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn) { - ReInit(dstream, startline, startcolumn, 4096); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException { - ReInit(dstream, encoding, 1, 1, 4096); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream dstream) { - ReInit(dstream, 1, 1, 4096); - } - - /** @return token image as String */ - public String GetImage() { - if (bufpos >= tokenBegin) { - return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); - } else { - return new String(buffer, tokenBegin, bufsize - tokenBegin) + - new String(buffer, 0, bufpos + 1); - } - } - - /** @return suffix */ - public char[] GetSuffix(int len) { - char[] ret = new char[len]; - - if ((bufpos + 1) >= len) { - System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); - } else { - System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, - len - bufpos - 1); - System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); - } - - return ret; - } - - /** Set buffers back to null when finished. */ - public void Done() { - nextCharBuf = null; - buffer = null; - bufline = null; - bufcolumn = null; - } - - /** - * Method to adjust line and column numbers for the start of a token. - */ - public void adjustBeginLineColumn(int newLine, int newCol) { - int start = tokenBegin; - int len; - - if (bufpos >= tokenBegin) { - len = bufpos - tokenBegin + inBuf + 1; - } else { - len = bufsize - tokenBegin + bufpos + 1 + inBuf; - } - - int i = 0, j = 0, k = 0; - int nextColDiff = 0, columnDiff = 0; - - while (i < len && - bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) { - bufline[j] = newLine; - nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; - bufcolumn[j] = newCol + columnDiff; - columnDiff = nextColDiff; - i++; - } - - if (i < len) { - bufline[j] = newLine++; - bufcolumn[j] = newCol + columnDiff; - - while (i++ < len) { - if (bufline[j = start % bufsize] != bufline[++start % bufsize]) { - bufline[j] = newLine++; - } else { - bufline[j] = newLine; - } - } - } - - line = bufline[j]; - column = bufcolumn[j]; - } - -} -/* JavaCC - OriginalChecksum=69daf7a8766456321bf569ae1edca171 (do not edit this line) */ diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaParser.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaParser.java deleted file mode 100644 index 18f98ec9a1e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaParser.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser; - -import japa.parser.ast.CompilationUnit; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.Reader; - -/** - *

- * This class was generated automatically by javacc, do not edit. - *

- *

- * Parse Java 1.5 source code and creates Abstract Syntax Tree classes. - *

- *

- * Note: To use this parser asynchronously, disable de parser cache by calling the method {@link setCacheParser} with false as argument. - *

- * - * @author Júlio Vilmar Gesser - */ -public final class JavaParser { - - private static ASTParser parser; - - private static boolean cacheParser = true; - - private JavaParser() { - // hide the constructor - } - - /** - * Changes the way that the parser acts when starts to parse. If the - * parser cache is enabled, only one insance of this object will be - * used in every call to parse methods. - * If this parser is intend to be used asynchonously, the cache must - * be disabled setting this flag to false. - * By default, the cache is enabled. - * - * @param value - * false to disable the parser instance cache. - */ - public static void setCacheParser(boolean value) { - cacheParser = value; - if (!value) { - parser = null; - } - } - - /** - * Parses the Java code contained in the {@link InputStream} and returns - * a {@link CompilationUnit} that represents it. - * - * @param in - * {@link InputStream} containing Java source code - * @param encoding - * encoding of the source code - * @return CompilationUnit representing the Java source code - * @throws ParseException - * if the source code has parser errors - */ - public static CompilationUnit parse(InputStream in, String encoding) throws ParseException { - if (cacheParser) { - if (parser == null) { - parser = new ASTParser(in, encoding); - } else { - parser.reset(in, encoding); - } - return parser.CompilationUnit(); - } - return new ASTParser(in, encoding).CompilationUnit(); - } - - /** - * Parses the Java code contained in the {@link InputStream} and returns - * a {@link CompilationUnit} that represents it. - * - * @param in - * {@link InputStream} containing Java source code - * @return CompilationUnit representing the Java source code - * @throws ParseException - * if the source code has parser errors - */ - public static CompilationUnit parse(InputStream in) throws ParseException { - return parse(in, null); - } - - /** - * Parses the Java code contained in a {@link File} and returns - * a {@link CompilationUnit} that represents it. - * - * @param file - * {@link File} containing Java source code - * @param encoding - * encoding of the source code - * @return CompilationUnit representing the Java source code - * @throws ParseException - * if the source code has parser errors - * @throws IOException - */ - public static CompilationUnit parse(File file, String encoding) throws ParseException, IOException { - FileInputStream in = new FileInputStream(file); - try { - return parse(in, encoding); - } finally { - in.close(); - } - } - - /** - * Parses the Java code contained in a {@link File} and returns - * a {@link CompilationUnit} that represents it. - * - * @param file - * {@link File} containing Java source code - * @return CompilationUnit representing the Java source code - * @throws ParseException - * if the source code has parser errors - * @throws IOException - */ - public static CompilationUnit parse(File file) throws ParseException, IOException { - return parse(file, null); - } - - /** - * Parses the Java code contained in the {@link InputStream} and returns - * a {@link CompilationUnit} that represents it. - * - * @param in - * {@link InputStream} containing Java source code - * @param encoding - * encoding of the source code - * @return CompilationUnit representing the Java source code - * @throws ParseException - * if the source code has parser errors - */ - public static CompilationUnit parse(Reader in) throws ParseException { - if (cacheParser) { - if (parser == null) { - parser = new ASTParser(in); - } else { - parser.ReInit(in); - } - return parser.CompilationUnit(); - } - return new ASTParser(in).CompilationUnit(); - } - - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ParseException.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ParseException.java deleted file mode 100644 index adbf212f98b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ParseException.java +++ /dev/null @@ -1,216 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 4.1 */ -/* JavaCCOptions:KEEP_LINE_COL=null */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package japa.parser; - -/** - * This exception is thrown when parse errors are encountered. - * You can explicitly create objects of this exception type by - * calling the method generateParseException in the generated - * parser. - * - * You can modify this class to customize your error reporting - * mechanisms so long as you retain the public fields. - */ -public class ParseException extends Exception { - - /** - * This constructor is used by the method "generateParseException" - * in the generated parser. Calling this constructor generates - * a new object of this type with the fields "currentToken", - * "expectedTokenSequences", and "tokenImage" set. The boolean - * flag "specialConstructor" is also set to true to indicate that - * this constructor was used to create this object. - * This constructor calls its super class with the empty string - * to force the "toString" method of parent class "Throwable" to - * print the error message in the form: - * ParseException: - */ - public ParseException(Token currentTokenVal, - int[][] expectedTokenSequencesVal, - String[] tokenImageVal) { - super(""); - specialConstructor = true; - currentToken = currentTokenVal; - expectedTokenSequences = expectedTokenSequencesVal; - tokenImage = tokenImageVal; - } - - /** - * The following constructors are for use by you for whatever - * purpose you can think of. Constructing the exception in this - * manner makes the exception behave in the normal way - i.e., as - * documented in the class "Throwable". The fields "errorToken", - * "expectedTokenSequences", and "tokenImage" do not contain - * relevant information. The JavaCC generated code does not use - * these constructors. - */ - - public ParseException() { - super(); - specialConstructor = false; - } - - /** Constructor with message. */ - public ParseException(String message) { - super(message); - specialConstructor = false; - } - - /** - * This variable determines which constructor was used to create - * this object and thereby affects the semantics of the - * "getMessage" method (see below). - */ - protected boolean specialConstructor; - - /** - * This is the last token that has been consumed successfully. If - * this object has been created due to a parse error, the token - * followng this token will (therefore) be the first error token. - */ - public Token currentToken; - - /** - * Each entry in this array is an array of integers. Each array - * of integers represents a sequence of tokens (by their ordinal - * values) that is expected at this point of the parse. - */ - public int[][] expectedTokenSequences; - - /** - * This is a reference to the "tokenImage" array of the generated - * parser within which the parse error occurred. This array is - * defined in the generated ...Constants interface. - */ - public String[] tokenImage; - - /** - * This method has the standard behavior when this object has been - * created using the standard constructors. Otherwise, it uses - * "currentToken" and "expectedTokenSequences" to generate a parse - * error message and returns it. If this object has been created - * due to a parse error, and you do not catch it (it gets thrown - * from the parser), then this method is called during the printing - * of the final stack trace, and hence the correct error message - * gets displayed. - */ - @Override - public String getMessage() { - if (!specialConstructor) { - return super.getMessage(); - } - StringBuffer expected = new StringBuffer(); - int maxSize = 0; - for (int i = 0; i < expectedTokenSequences.length; i++) { - if (maxSize < expectedTokenSequences[i].length) { - maxSize = expectedTokenSequences[i].length; - } - for (int j = 0; j < expectedTokenSequences[i].length; j++) { - expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' '); - } - if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) { - expected.append("..."); - } - expected.append(eol).append(" "); - } - String retval = "Encountered \""; - Token tok = currentToken.next; - for (int i = 0; i < maxSize; i++) { - if (i != 0) { - retval += " "; - } - if (tok.kind == 0) { - retval += tokenImage[0]; - break; - } - retval += " " + tokenImage[tok.kind]; - retval += " \""; - retval += add_escapes(tok.image); - retval += " \""; - tok = tok.next; - } - retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn; - retval += "." + eol; - if (expectedTokenSequences.length == 1) { - retval += "Was expecting:" + eol + " "; - } else { - retval += "Was expecting one of:" + eol + " "; - } - retval += expected.toString(); - return retval; - } - - /** - * The end of line string for this machine. - */ - protected String eol = System.getProperty("line.separator", "\n"); - - /** - * Used to convert raw characters to their escaped version - * when these raw version cannot be used as part of an ASCII - * string literal. - */ - protected String add_escapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) { - case 0: - continue; - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } - } - return retval.toString(); - } - -} -/* JavaCC - OriginalChecksum=4beea1df20cd4144443abe59f34118d0 (do not edit this line) */ diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/Token.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/Token.java deleted file mode 100644 index 9a885a1f69c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/Token.java +++ /dev/null @@ -1,142 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. Token.java Version 4.1 */ -/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package japa.parser; - -/** - * Describes the input token stream. - */ - -public class Token { - - /** - * An integer that describes the kind of this token. This numbering - * system is determined by JavaCCParser, and a table of these numbers is - * stored in the file ...Constants.java. - */ - public int kind; - - /** The line number of the first character of this Token. */ - public int beginLine; - - /** The column number of the first character of this Token. */ - public int beginColumn; - - /** The line number of the last character of this Token. */ - public int endLine; - - /** The column number of the last character of this Token. */ - public int endColumn; - - /** - * The string image of the token. - */ - public String image; - - /** - * A reference to the next regular (non-special) token from the input - * stream. If this is the last token from the input stream, or if the - * token manager has not read tokens beyond this one, this field is - * set to null. This is true only if this token is also a regular - * token. Otherwise, see below for a description of the contents of - * this field. - */ - public Token next; - - /** - * This field is used to access special tokens that occur prior to this - * token, but after the immediately preceding regular (non-special) token. - * If there are no such special tokens, this field is set to null. - * When there are more than one such special token, this field refers - * to the last of these special tokens, which in turn refers to the next - * previous special token through its specialToken field, and so on - * until the first special token (whose specialToken field is null). - * The next fields of special tokens refer to other special tokens that - * immediately follow it (without an intervening regular token). If there - * is no such token, this field is null. - */ - public Token specialToken; - - /** - * An optional attribute value of the Token. - * Tokens which are not used as syntactic sugar will often contain - * meaningful values that will be used later on by the compiler or - * interpreter. This attribute value is often different from the image. - * Any subclass of Token that actually wants to return a non-null value can - * override this method as appropriate. - */ - public Object getValue() { - return null; - } - - /** - * No-argument constructor - */ - public Token() { - } - - /** - * Constructs a new token for the specified Image. - */ - public Token(int kind) { - this(kind, null); - } - - /** - * Constructs a new token for the specified Image and Kind. - */ - public Token(int kind, String image) { - this.kind = kind; - this.image = image; - } - - /** - * Returns the image. - */ - @Override - public String toString() { - return image; - } - - /** - * Returns a new Token object, by default. However, if you want, you - * can create and return subclass objects based on the value of ofKind. - * Simply add the cases to the switch for all those special cases. - * For example, if you have a subclass of Token called IDToken that - * you want to create if ofKind is ID, simply add something like : - * - * case MyParserConstants.ID : return new IDToken(ofKind, image); - * - * to the following switch statement. Then you can cast matchedToken - * variable to the appropriate type and use sit in your lexical actions. - */ - public static Token newToken(int ofKind, String image) { - switch (ofKind) { - default: - return new Token(ofKind, image); - } - } - - public static Token newToken(int ofKind) { - return newToken(ofKind, null); - } - -} -/* JavaCC - OriginalChecksum=36e116391da53a8cb5fc7d23289ae0c7 (do not edit this line) */ diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/TokenMgrError.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/TokenMgrError.java deleted file mode 100644 index 4f46a2efcad..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/TokenMgrError.java +++ /dev/null @@ -1,158 +0,0 @@ -/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 4.1 */ -/* JavaCCOptions: */ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package japa.parser; - -/** Token Manager Error. */ -@SuppressWarnings("serial") -public class TokenMgrError extends Error { - - /* - * Ordinals for various reasons why an Error of this type can be thrown. - */ - - /** - * Lexical error occurred. - */ - static final int LEXICAL_ERROR = 0; - - /** - * An attempt was made to create a second instance of a static token manager. - */ - static final int STATIC_LEXER_ERROR = 1; - - /** - * Tried to change to an invalid lexical state. - */ - static final int INVALID_LEXICAL_STATE = 2; - - /** - * Detected (and bailed out of) an infinite loop in the token manager. - */ - static final int LOOP_DETECTED = 3; - - /** - * Indicates the reason why the exception is thrown. It will have - * one of the above 4 values. - */ - int errorCode; - - /** - * Replaces unprintable characters by their escaped (or unicode escaped) - * equivalents in the given string - */ - protected static final String addEscapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) { - case 0: - continue; - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } - } - return retval.toString(); - } - - /** - * Returns a detailed message for the Error when it is thrown by the - * token manager to indicate a lexical error. - * Parameters : - * EOFSeen : indicates if EOF caused the lexical error - * curLexState : lexical state in which this error occurred - * errorLine : line number when the error occurred - * errorColumn : column number when the error occurred - * errorAfter : prefix that was seen before this error occurred - * curchar : the offending character - * Note: You can customize the lexical error message by modifying this method. - */ - protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { - return ("Lexical error at line " + - errorLine + ", column " + - errorColumn + ". Encountered: " + - (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int) curChar + "), ") + - "after : \"" + addEscapes(errorAfter) + "\""); - } - - /** - * You can also modify the body of this method to customize your error messages. - * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not - * of end-users concern, so you can return something like : - * - * "Internal Error : Please file a bug report .... " - * - * from this method for such cases in the release version of your parser. - */ - @Override - public String getMessage() { - return super.getMessage(); - } - - /* - * Constructors of various flavors follow. - */ - - /** No arg constructor. */ - public TokenMgrError() { - } - - /** Constructor with message and reason. */ - public TokenMgrError(String message, int reason) { - super(message); - errorCode = reason; - } - - /** Full Constructor. */ - public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { - this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); - } -} -/* JavaCC - OriginalChecksum=f513119adae97f8c53113edb988c2492 (do not edit this line) */ diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/BlockComment.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/BlockComment.java deleted file mode 100644 index ac8b4dd5310..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/BlockComment.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 23/05/2008 - */ -package japa.parser.ast; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - *

- * AST node that represent block comments. - *

- * - * Block comments can has multi lines and are delimited - * by "/*" and "*/". - * - * @author Julio Vilmar Gesser - */ -public final class BlockComment extends Comment { - - public BlockComment() { - } - - public BlockComment(int beginLine, int beginColumn, int endLine, int endColumn, String content) { - super(beginLine, beginColumn, endLine, endColumn, content); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Comment.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Comment.java deleted file mode 100644 index c01837cc87b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Comment.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 23/05/2008 - */ -package japa.parser.ast; - -import japa.parser.ast.body.JavadocComment; - -/** - * Abstract class for all AST nodes that represent comments. - * - * @see BlockComment - * @see LineComment - * @see JavadocComment - * @author Julio Vilmar Gesser - */ -public abstract class Comment extends Node { - - private String content; - - public Comment() { - } - - public Comment(int beginLine, int beginColumn, int endLine, int endColumn, String content) { - super(beginLine, beginColumn, endLine, endColumn); - this.content = content; - } - - /** - * Return the text of the comment. - * - * @return text of the comment - */ - public final String getContent() { - return content; - } - - /** - * Sets the text of the comment. - * - * @param content - * the text of the comment to set - */ - public void setContent(String content) { - this.content = content; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/CompilationUnit.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/CompilationUnit.java deleted file mode 100644 index f2ab3a88f90..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/CompilationUnit.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast; - -import japa.parser.ast.body.AnnotationDeclaration; -import japa.parser.ast.body.ClassOrInterfaceDeclaration; -import japa.parser.ast.body.EmptyTypeDeclaration; -import japa.parser.ast.body.EnumDeclaration; -import japa.parser.ast.body.JavadocComment; -import japa.parser.ast.body.TypeDeclaration; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - *

- * This class represents the entire compilation unit. Each java file denotes a compilation unit. - *

- * - * The CompilationUnit is constructed following the syntax:
- * - * - * - * - * - * - * - *
CompilationUnit::= - * ( {@link PackageDeclaration} )?
- * ( {@link ImportDeclaration} )*
- * ( {@link TypeDeclaration} )*
- *
- *
- * - * @author Julio Vilmar Gesser - */ -public final class CompilationUnit extends Node { - - private PackageDeclaration pakage; - - private List imports; - - private List types; - - private List comments; - - public CompilationUnit() { - } - - public CompilationUnit(int beginLine, int beginColumn, int endLine, int endColumn, PackageDeclaration pakage, List imports, List types, List comments) { - super(beginLine, beginColumn, endLine, endColumn); - this.pakage = pakage; - this.imports = imports; - this.types = types; - this.comments = comments; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public
void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - /** - * Return a list containing all comments declared in this compilation unit. - * Including javadocs, line comments and block comments of all types, - * inner-classes and other members.
- * If there is no comment, null is returned. - * - * @return list with all comments of this compilation unit or null - * @see JavadocComment - * @see LineComment - * @see BlockComment - */ - public List getComments() { - return comments; - } - - /** - * Retrieves the list of imports declared in this compilation unit or null if there is no import. - * - * @return the list of imports or null if there is no import - */ - public List getImports() { - return imports; - } - - /** - * Retrieves the package declaration of this compilation unit.
- * If this compilation unit has no package declaration (default package), null is returned. - * - * @return the package declaration or null - */ - public PackageDeclaration getPakage() { - return pakage; - } - - /** - * Return the list of types declared in this compilation unit.
- * If there is no types declared, null is returned. - * - * @return the list of types or null null if there is no type - * @see AnnotationDeclaration - * @see ClassOrInterfaceDeclaration - * @see EmptyTypeDeclaration - * @see EnumDeclaration - */ - public List getTypes() { - return types; - } - - /** - * Sets the list of comments of this compilation unit. - * - * @param comments - * the list of comments - */ - public void setComments(List comments) { - this.comments = comments; - } - - /** - * Sets the list of imports of this compilation unit. - * The list is initially null. - * - * @param imports - * the list of imports - */ - public void setImports(List imports) { - this.imports = imports; - } - - /** - * Sets or clear the package declarations of this compilation unit. - * - * @param pakage - * the pakage declaration to set or null to default package - */ - public void setPakage(PackageDeclaration pakage) { - this.pakage = pakage; - } - - /** - * Sets the list of types declared in this compilation unit. - * - * @param types - * the lis of types - */ - public void setTypes(List types) { - this.types = types; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/ImportDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/ImportDeclaration.java deleted file mode 100644 index d4bf38a08cb..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/ImportDeclaration.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast; - -import japa.parser.ast.expr.NameExpr; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - *

- * This class represents a import declaration. Imports are optional for the {@link CompilationUnit}. - *

- * - * The ImportDeclaration is constructed following the syntax:
- * - * - * - * - * - * - * - *
ImportDeclaration::= - * "import" ( "static" )? {@link NameExpr} ( "." "*" )? ";" - *
- *
- * - * @author Julio Vilmar Gesser - */ -public final class ImportDeclaration extends Node { - - private NameExpr name; - - private boolean static_; - - private boolean asterisk; - - public ImportDeclaration() { - } - - public ImportDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr name, boolean isStatic, boolean isAsterisk) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.static_ = isStatic; - this.asterisk = isAsterisk; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public
void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - /** - * Retrieves the name of the import. - * - * @return the name of the import - */ - public NameExpr getName() { - return name; - } - - /** - * Return if the import ends with "*". - * - * @return true if the import ends with "*", false otherwise - */ - public boolean isAsterisk() { - return asterisk; - } - - /** - * Return if the import is static. - * - * @return true if the import is static, false otherwise - */ - public boolean isStatic() { - return static_; - } - - /** - * Sets if this import is asterisk. - * - * @param asterisk - * true if this import is asterisk - */ - public void setAsterisk(boolean asterisk) { - this.asterisk = asterisk; - } - - /** - * Sets the name this import. - * - * @param name - * the name to set - */ - public void setName(NameExpr name) { - this.name = name; - } - - /** - * Sets if this import is static. - * - * @param static_ - * true if this import is static - */ - public void setStatic(boolean static_) { - this.static_ = static_; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/LineComment.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/LineComment.java deleted file mode 100644 index 83636a74d7e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/LineComment.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 23/05/2008 - */ -package japa.parser.ast; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - *

- * AST node that represent line comments. - *

- * - * Line comments are started with "//" and finish at - * the end of the line ("\n"). - * - * @author Julio Vilmar Gesser - */ -public final class LineComment extends Comment { - - public LineComment() { - } - - public LineComment(int beginLine, int beginColumn, int endLine, int endColumn, String content) { - super(beginLine, beginColumn, endLine, endColumn, content); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public
void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Node.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Node.java deleted file mode 100644 index 3d396b3777f..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Node.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast; - -import japa.parser.ast.visitor.DumpVisitor; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * Abstract class for all nodes of the AST. - * - * @author Julio Vilmar Gesser - */ -public abstract class Node { - - private int beginLine; - - private int beginColumn; - - private int endLine; - - private int endColumn; - - /** - * This attribute can store additional information from semantic analysis. - */ - private Object data; - - public Node() { - } - - public Node(int beginLine, int beginColumn, int endLine, int endColumn) { - this.beginLine = beginLine; - this.beginColumn = beginColumn; - this.endLine = endLine; - this.endColumn = endColumn; - } - - /** - * Accept method for visitor support. - * - * @param - * the type the return value of the visitor - * @param - * the type the argument passed for the visitor - * @param v - * the visitor implementation - * @param arg - * any value relevant for the visitor - * @return the result of the visit - */ - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - /** - * Accept method for visitor support. - * - * @param - * the type the argument passed for the visitor - * @param v - * the visitor implementation - * @param arg - * any value relevant for the visitor - */ - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - /** - * Return the begin column of this node. - * - * @return the begin column of this node - */ - public final int getBeginColumn() { - return beginColumn; - } - - /** - * Return the begin line of this node. - * - * @return the begin line of this node - */ - public final int getBeginLine() { - return beginLine; - } - - /** - * Use this to retrieve additional information associated to this node. - */ - public final Object getData() { - return data; - } - - /** - * Return the end column of this node. - * - * @return the end column of this node - */ - public final int getEndColumn() { - return endColumn; - } - - /** - * Return the end line of this node. - * - * @return the end line of this node - */ - public final int getEndLine() { - return endLine; - } - - /** - * Sets the begin column of this node. - * - * @param beginColumn - * the begin column of this node - */ - public final void setBeginColumn(int beginColumn) { - this.beginColumn = beginColumn; - } - - /** - * Sets the begin line of this node. - * - * @param beginLine - * the begin line of this node - */ - public final void setBeginLine(int beginLine) { - this.beginLine = beginLine; - } - - /** - * Use this to store additional information to this node. - */ - public final void setData(Object data) { - this.data = data; - } - - /** - * Sets the end column of this node. - * - * @param endColumn - * the end column of this node - */ - public final void setEndColumn(int endColumn) { - this.endColumn = endColumn; - } - - /** - * Sets the end line of this node. - * - * @param endLine - * the end line of this node - */ - public final void setEndLine(int endLine) { - this.endLine = endLine; - } - - /** - * Return the String representation of this node. - * - * @return the String representation of this node - */ - @Override - public final String toString() { - DumpVisitor visitor = new DumpVisitor(); - accept(visitor, null); - return visitor.getSource(); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/PackageDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/PackageDeclaration.java deleted file mode 100644 index cc910afe4f6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/PackageDeclaration.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 17/10/2007 - */ -package japa.parser.ast; - -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.expr.NameExpr; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - *

- * This class represents the package declaration. The package declaration is optional for the {@link CompilationUnit}. - *

- * - * The PackageDeclaration is constructed following the syntax:
- * - * - * - * - * - * - * - *
PackageDeclaration::= - * ( {@link AnnotationExpr} )* "package" {@link NameExpr} ) ";" - *
- *
- * - * @author Julio Vilmar Gesser - */ -public final class PackageDeclaration extends Node { - - private List annotations; - - private NameExpr name; - - public PackageDeclaration() { - } - - public PackageDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, List annotations, NameExpr name) { - super(beginLine, beginColumn, endLine, endColumn); - this.annotations = annotations; - this.name = name; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public
void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - /** - * Retrieves the list of annotations declared before the package - * declaration. Return null if there are no annotations. - * - * @return list of annotations or null - */ - public List getAnnotations() { - return annotations; - } - - /** - * Return the name of the package. - * - * @return the name of the package - */ - public NameExpr getName() { - return name; - } - - /** - * - * @param annotations - * the annotations to set - */ - public void setAnnotations(List annotations) { - this.annotations = annotations; - } - - /** - * Sets the name of this package declaration. - * - * @param name - * the name to set - */ - public void setName(NameExpr name) { - this.name = name; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/TypeParameter.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/TypeParameter.java deleted file mode 100644 index 6d5006fb1b9..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/TypeParameter.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast; - -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - *

- * This class represents the declaration of a genetics argument. - *

- * - * The TypeParameter is constructed following the syntax:
- * - * - * - * - * - * - * - *
TypeParameter::= - * <IDENTIFIER> ( "extends" {@link ClassOrInterfaceType} ( "&" {@link ClassOrInterfaceType} )* )? - *
- *
- * - * @author Julio Vilmar Gesser - */ -public final class TypeParameter extends Node { - - private String name; - - private List typeBound; - - public TypeParameter() { - } - - public TypeParameter(int beginLine, int beginColumn, int endLine, int endColumn, String name, List typeBound) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.typeBound = typeBound; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public
void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - /** - * Return the name of the paramenter. - * - * @return the name of the paramenter - */ - public String getName() { - return name; - } - - /** - * Return the list of {@link ClassOrInterfaceType} that this parameter - * extends. Return null null if there are no type. - * - * @return list of types that this paramente extends or null - */ - public List getTypeBound() { - return typeBound; - } - - /** - * Sets the name of this type parameter. - * - * @param name - * the name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * Sets the list o types. - * - * @param typeBound - * the typeBound to set - */ - public void setTypeBound(List typeBound) { - this.typeBound = typeBound; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationDeclaration.java deleted file mode 100644 index 07ad2b8a3c6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationDeclaration.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class AnnotationDeclaration extends TypeDeclaration { - - public AnnotationDeclaration() { - } - - public AnnotationDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, String name, List members) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc, name, modifiers, members); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationMemberDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationMemberDeclaration.java deleted file mode 100644 index e453f0a3903..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationMemberDeclaration.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.expr.Expression; -import japa.parser.ast.type.Type; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class AnnotationMemberDeclaration extends BodyDeclaration { - - private int modifiers; - - private Type type; - - private String name; - - private Expression defaultValue; - - public AnnotationMemberDeclaration() { - } - - public AnnotationMemberDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, Type type, String name, Expression defaultValue) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); - this.modifiers = modifiers; - this.type = type; - this.name = name; - this.defaultValue = defaultValue; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getDefaultValue() { - return defaultValue; - } - - public int getModifiers() { - return modifiers; - } - - public String getName() { - return name; - } - - public Type getType() { - return type; - } - - public void setDefaultValue(Expression defaultValue) { - this.defaultValue = defaultValue; - } - - public void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public void setName(String name) { - this.name = name; - } - - public void setType(Type type) { - this.type = type; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/BodyDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/BodyDeclaration.java deleted file mode 100644 index af540c292f2..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/BodyDeclaration.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.Node; -import japa.parser.ast.expr.AnnotationExpr; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class BodyDeclaration extends Node { - - private JavadocComment javaDoc; - - private List annotations; - - public BodyDeclaration() { - } - - public BodyDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, List annotations, JavadocComment javaDoc) { - super(beginLine, beginColumn, endLine, endColumn); - this.javaDoc = javaDoc; - this.annotations = annotations; - } - - public final JavadocComment getJavaDoc() { - return javaDoc; - } - - public final List getAnnotations() { - return annotations; - } - - public final void setJavaDoc(JavadocComment javaDoc) { - this.javaDoc = javaDoc; - } - - public final void setAnnotations(List annotations) { - this.annotations = annotations; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ClassOrInterfaceDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ClassOrInterfaceDeclaration.java deleted file mode 100644 index 473bb244159..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ClassOrInterfaceDeclaration.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.TypeParameter; -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class ClassOrInterfaceDeclaration extends TypeDeclaration { - - private boolean interface_; - - private List typeParameters; - - private List extendsList; - - private List implementsList; - - public ClassOrInterfaceDeclaration() { - } - - public ClassOrInterfaceDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, boolean isInterface, String name, List typeParameters, - List extendsList, List implementsList, List members) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc, name, modifiers, members); - this.interface_ = isInterface; - this.typeParameters = typeParameters; - this.extendsList = extendsList; - this.implementsList = implementsList; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getExtends() { - return extendsList; - } - - public List getImplements() { - return implementsList; - } - - public List getTypeParameters() { - return typeParameters; - } - - public boolean isInterface() { - return interface_; - } - - public void setExtends(List extendsList) { - this.extendsList = extendsList; - } - - public void setImplements(List implementsList) { - this.implementsList = implementsList; - } - - public void setInterface(boolean interface_) { - this.interface_ = interface_; - } - - public void setTypeParameters(List typeParameters) { - this.typeParameters = typeParameters; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ConstructorDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ConstructorDeclaration.java deleted file mode 100644 index 8af73d596f4..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ConstructorDeclaration.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.TypeParameter; -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.expr.NameExpr; -import japa.parser.ast.stmt.BlockStmt; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class ConstructorDeclaration extends BodyDeclaration { - - private int modifiers; - - private List typeParameters; - - private String name; - - private List parameters; - - private List throws_; - - private BlockStmt block; - - public ConstructorDeclaration() { - } - - public ConstructorDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, List typeParameters, String name, List parameters, - List throws_, BlockStmt block) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); - this.modifiers = modifiers; - this.typeParameters = typeParameters; - this.name = name; - this.parameters = parameters; - this.throws_ = throws_; - this.block = block; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public BlockStmt getBlock() { - return block; - } - - public int getModifiers() { - return modifiers; - } - - public String getName() { - return name; - } - - public List getParameters() { - return parameters; - } - - public List getThrows() { - return throws_; - } - - public List getTypeParameters() { - return typeParameters; - } - - public void setBlock(BlockStmt block) { - this.block = block; - } - - public void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public void setName(String name) { - this.name = name; - } - - public void setParameters(List parameters) { - this.parameters = parameters; - } - - public void setThrows(List throws_) { - this.throws_ = throws_; - } - - public void setTypeParameters(List typeParameters) { - this.typeParameters = typeParameters; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyMemberDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyMemberDeclaration.java deleted file mode 100644 index 79f1c7601d5..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyMemberDeclaration.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class EmptyMemberDeclaration extends BodyDeclaration { - - public EmptyMemberDeclaration() { - } - - public EmptyMemberDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc) { - super(beginLine, beginColumn, endLine, endColumn, null, javaDoc); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyTypeDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyTypeDeclaration.java deleted file mode 100644 index 7090017fde2..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyTypeDeclaration.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 20/01/2007 - */ -package japa.parser.ast.body; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class EmptyTypeDeclaration extends TypeDeclaration { - - public EmptyTypeDeclaration() { - } - - public EmptyTypeDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc) { - super(beginLine, beginColumn, endLine, endColumn, null, javaDoc, null, 0, null); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumConstantDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumConstantDeclaration.java deleted file mode 100644 index 814bd2e3ced..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumConstantDeclaration.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/11/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.expr.Expression; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class EnumConstantDeclaration extends BodyDeclaration { - - private String name; - - private List args; - - private List classBody; - - public EnumConstantDeclaration() { - } - - public EnumConstantDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, List annotations, String name, List args, List classBody) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); - this.name = name; - this.args = args; - this.classBody = classBody; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getArgs() { - return args; - } - - public List getClassBody() { - return classBody; - } - - public String getName() { - return name; - } - - public void setArgs(List args) { - this.args = args; - } - - public void setClassBody(List classBody) { - this.classBody = classBody; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumDeclaration.java deleted file mode 100644 index b1185537641..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumDeclaration.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class EnumDeclaration extends TypeDeclaration { - - private List implementsList; - - private List entries; - - public EnumDeclaration() { - } - - public EnumDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, String name, List implementsList, List entries, - List members) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc, name, modifiers, members); - this.implementsList = implementsList; - this.entries = entries; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getEntries() { - return entries; - } - - public List getImplements() { - return implementsList; - } - - public void setEntries(List entries) { - this.entries = entries; - } - - public void setImplements(List implementsList) { - this.implementsList = implementsList; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/FieldDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/FieldDeclaration.java deleted file mode 100644 index e868e7a7320..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/FieldDeclaration.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.type.Type; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class FieldDeclaration extends BodyDeclaration { - - private int modifiers; - - private Type type; - - private List variables; - - public FieldDeclaration() { - } - - public FieldDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, Type type, List variables) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); - this.modifiers = modifiers; - this.type = type; - this.variables = variables; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public int getModifiers() { - return modifiers; - } - - public Type getType() { - return type; - } - - public List getVariables() { - return variables; - } - - public void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public void setType(Type type) { - this.type = type; - } - - public void setVariables(List variables) { - this.variables = variables; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/InitializerDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/InitializerDeclaration.java deleted file mode 100644 index 0f3882b3845..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/InitializerDeclaration.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.stmt.BlockStmt; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class InitializerDeclaration extends BodyDeclaration { - - private boolean isStatic; - - private BlockStmt block; - - public InitializerDeclaration() { - } - - public InitializerDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, boolean isStatic, BlockStmt block) { - super(beginLine, beginColumn, endLine, endColumn, null, javaDoc); - this.isStatic = isStatic; - this.block = block; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public BlockStmt getBlock() { - return block; - } - - public boolean isStatic() { - return isStatic; - } - - public void setBlock(BlockStmt block) { - this.block = block; - } - - public void setStatic(boolean isStatic) { - this.isStatic = isStatic; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/JavadocComment.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/JavadocComment.java deleted file mode 100644 index 5241b3cf22b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/JavadocComment.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 23/05/2008 - */ -package japa.parser.ast.body; - -import japa.parser.ast.Comment; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class JavadocComment extends Comment { - - public JavadocComment() { - } - - public JavadocComment(int beginLine, int beginColumn, int endLine, int endColumn, String content) { - super(beginLine, beginColumn, endLine, endColumn, content); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/MethodDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/MethodDeclaration.java deleted file mode 100644 index 1337198d173..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/MethodDeclaration.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.TypeParameter; -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.expr.NameExpr; -import japa.parser.ast.stmt.BlockStmt; -import japa.parser.ast.type.Type; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class MethodDeclaration extends BodyDeclaration { - - private int modifiers; - - private List typeParameters; - - private Type type; - - private String name; - - private List parameters; - - private int arrayCount; - - private List throws_; - - private BlockStmt body; - - public MethodDeclaration() { - } - - public MethodDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, List typeParameters, Type type, String name, List parameters, - int arrayCount, List throws_, BlockStmt block) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); - this.modifiers = modifiers; - this.typeParameters = typeParameters; - this.type = type; - this.name = name; - this.parameters = parameters; - this.arrayCount = arrayCount; - this.throws_ = throws_; - this.body = block; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public int getArrayCount() { - return arrayCount; - } - - public BlockStmt getBody() { - return body; - } - - public int getModifiers() { - return modifiers; - } - - public String getName() { - return name; - } - - public List getParameters() { - return parameters; - } - - public List getThrows() { - return throws_; - } - - public Type getType() { - return type; - } - - public List getTypeParameters() { - return typeParameters; - } - - public void setArrayCount(int arrayCount) { - this.arrayCount = arrayCount; - } - - public void setBody(BlockStmt body) { - this.body = body; - } - - public void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public void setName(String name) { - this.name = name; - } - - public void setParameters(List parameters) { - this.parameters = parameters; - } - - public void setThrows(List throws_) { - this.throws_ = throws_; - } - - public void setType(Type type) { - this.type = type; - } - - public void setTypeParameters(List typeParameters) { - this.typeParameters = typeParameters; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ModifierSet.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ModifierSet.java deleted file mode 100644 index ad2dfaa7253..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ModifierSet.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package japa.parser.ast.body; - -/** - * Class to hold modifiers. - */ -public final class ModifierSet { - - /* Definitions of the bits in the modifiers field. */ - public static final int PUBLIC = 0x0001; - - public static final int PROTECTED = 0x0002; - - public static final int PRIVATE = 0x0004; - - public static final int ABSTRACT = 0x0008; - - public static final int STATIC = 0x0010; - - public static final int FINAL = 0x0020; - - public static final int SYNCHRONIZED = 0x0040; - - public static final int NATIVE = 0x0080; - - public static final int TRANSIENT = 0x0100; - - public static final int VOLATILE = 0x0200; - - public static final int STRICTFP = 0x1000; - - /** - * Adds the given modifier. - */ - public static int addModifier(int modifiers, int mod) { - return modifiers |= mod; - } - - public static boolean hasModifier(int modifiers, int modifier) { - return (modifiers & modifier) != 0; - } - - public static boolean isAbstract(int modifiers) { - return (modifiers & ABSTRACT) != 0; - } - - public static boolean isFinal(int modifiers) { - return (modifiers & FINAL) != 0; - } - - public static boolean isNative(int modifiers) { - return (modifiers & NATIVE) != 0; - } - - public static boolean isPrivate(int modifiers) { - return (modifiers & PRIVATE) != 0; - } - - public static boolean isProtected(int modifiers) { - return (modifiers & PROTECTED) != 0; - } - - /** - * A set of accessors that indicate whether the specified modifier - * is in the set. - */ - - public static boolean isPublic(int modifiers) { - return (modifiers & PUBLIC) != 0; - } - - public static boolean isStatic(int modifiers) { - return (modifiers & STATIC) != 0; - } - - public static boolean isStrictfp(int modifiers) { - return (modifiers & STRICTFP) != 0; - } - - public static boolean isSynchronized(int modifiers) { - return (modifiers & SYNCHRONIZED) != 0; - } - - public static boolean isTransient(int modifiers) { - return (modifiers & TRANSIENT) != 0; - } - - public static boolean isVolatile(int modifiers) { - return (modifiers & VOLATILE) != 0; - } - - /** - * Removes the given modifier. - */ - public static int removeModifier(int modifiers, int mod) { - return modifiers &= ~mod; - } - - private ModifierSet() { - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/Parameter.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/Parameter.java deleted file mode 100644 index faa4c8fff26..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/Parameter.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 03/11/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.Node; -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.type.Type; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class Parameter extends Node { - - private int modifiers; - - private List annotations; - - private Type type; - - private boolean isVarArgs; - - private VariableDeclaratorId id; - - public Parameter() { - } - - public Parameter(int beginLine, int beginColumn, int endLine, int endColumn, int modifiers, List annotations, Type type, boolean isVarArgs, VariableDeclaratorId id) { - super(beginLine, beginColumn, endLine, endColumn); - this.modifiers = modifiers; - this.annotations = annotations; - this.type = type; - this.isVarArgs = isVarArgs; - this.id = id; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getAnnotations() { - return annotations; - } - - public VariableDeclaratorId getId() { - return id; - } - - public int getModifiers() { - return modifiers; - } - - public Type getType() { - return type; - } - - public boolean isVarArgs() { - return isVarArgs; - } - - public void setAnnotations(List annotations) { - this.annotations = annotations; - } - - public void setId(VariableDeclaratorId id) { - this.id = id; - } - - public void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public void setType(Type type) { - this.type = type; - } - - public void setVarArgs(boolean isVarArgs) { - this.isVarArgs = isVarArgs; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/TypeDeclaration.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/TypeDeclaration.java deleted file mode 100644 index 79107a962ed..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/TypeDeclaration.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.expr.AnnotationExpr; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class TypeDeclaration extends BodyDeclaration { - - private String name; - - private int modifiers; - - private List members; - - public TypeDeclaration() { - } - - public TypeDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, List annotations, JavadocComment javaDoc, String name, int modifiers, List members) { - super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); - this.name = name; - this.modifiers = modifiers; - this.members = members; - } - - public final List getMembers() { - return members; - } - - public final int getModifiers() { - return modifiers; - } - - public final String getName() { - return name; - } - - public void setMembers(List members) { - this.members = members; - } - - public final void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public final void setName(String name) { - this.name = name; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclarator.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclarator.java deleted file mode 100644 index d5ecc164f09..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclarator.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.Node; -import japa.parser.ast.expr.Expression; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class VariableDeclarator extends Node { - - private VariableDeclaratorId id; - - private Expression init; - - public VariableDeclarator() { - } - - public VariableDeclarator(int beginLine, int beginColumn, int endLine, int endColumn, VariableDeclaratorId id, Expression init) { - super(beginLine, beginColumn, endLine, endColumn); - this.id = id; - this.init = init; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public VariableDeclaratorId getId() { - return id; - } - - public Expression getInit() { - return init; - } - - public void setId(VariableDeclaratorId id) { - this.id = id; - } - - public void setInit(Expression init) { - this.init = init; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclaratorId.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclaratorId.java deleted file mode 100644 index 98bdd8c040c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclaratorId.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.body; - -import japa.parser.ast.Node; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class VariableDeclaratorId extends Node { - - private String name; - - private int arrayCount; - - public VariableDeclaratorId() { - } - - public VariableDeclaratorId(int beginLine, int beginColumn, int endLine, int endColumn, String name, int arrayCount) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.arrayCount = arrayCount; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public int getArrayCount() { - return arrayCount; - } - - public String getName() { - return name; - } - - public void setArrayCount(int arrayCount) { - this.arrayCount = arrayCount; - } - - public void setName(String name) { - this.name = name; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AnnotationExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AnnotationExpr.java deleted file mode 100644 index a0cb8e270bf..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AnnotationExpr.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package japa.parser.ast.expr; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class AnnotationExpr extends Expression { - - public AnnotationExpr() { - } - - public AnnotationExpr(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayAccessExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayAccessExpr.java deleted file mode 100644 index 2b3ceb92b03..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayAccessExpr.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ArrayAccessExpr extends Expression { - - private Expression name; - - private Expression index; - - public ArrayAccessExpr() { - } - - public ArrayAccessExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression name, Expression index) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.index = index; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getIndex() { - return index; - } - - public Expression getName() { - return name; - } - - public void setIndex(Expression index) { - this.index = index; - } - - public void setName(Expression name) { - this.name = name; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayCreationExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayCreationExpr.java deleted file mode 100644 index 94e379150ae..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayCreationExpr.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.type.Type; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class ArrayCreationExpr extends Expression { - - private Type type; - - private int arrayCount; - - private ArrayInitializerExpr initializer; - - private List dimensions; - - public ArrayCreationExpr() { - } - - public ArrayCreationExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type, int arrayCount, ArrayInitializerExpr initializer) { - super(beginLine, beginColumn, endLine, endColumn); - this.type = type; - this.arrayCount = arrayCount; - this.initializer = initializer; - this.dimensions = null; - } - - public ArrayCreationExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type, List dimensions, int arrayCount) { - super(beginLine, beginColumn, endLine, endColumn); - this.type = type; - this.arrayCount = arrayCount; - this.dimensions = dimensions; - this.initializer = null; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public int getArrayCount() { - return arrayCount; - } - - public List getDimensions() { - return dimensions; - } - - public ArrayInitializerExpr getInitializer() { - return initializer; - } - - public Type getType() { - return type; - } - - - public void setArrayCount(int arrayCount) { - this.arrayCount = arrayCount; - } - - public void setDimensions(List dimensions) { - this.dimensions = dimensions; - } - - public void setInitializer(ArrayInitializerExpr initializer) { - this.initializer = initializer; - } - - public void setType(Type type) { - this.type = type; - } - - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayInitializerExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayInitializerExpr.java deleted file mode 100644 index 9f38c589759..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayInitializerExpr.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class ArrayInitializerExpr extends Expression { - - private List values; - - public ArrayInitializerExpr() { - } - - public ArrayInitializerExpr(int beginLine, int beginColumn, int endLine, int endColumn, List values) { - super(beginLine, beginColumn, endLine, endColumn); - this.values = values; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getValues() { - return values; - } - - public void setValues(List values) { - this.values = values; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AssignExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AssignExpr.java deleted file mode 100644 index 6b9c715f212..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AssignExpr.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class AssignExpr extends Expression { - - public static enum Operator { - assign, // = - plus, // += - minus, // -= - star, // *= - slash, // /= - and, // &= - or, // |= - xor, // ^= - rem, // %= - lShift, // <<= - rSignedShift, // >>= - rUnsignedShift, // >>>= - } - - private Expression target; - - private Expression value; - - private Operator op; - - public AssignExpr() { - } - - public AssignExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression target, Expression value, Operator op) { - super(beginLine, beginColumn, endLine, endColumn); - this.target = target; - this.value = value; - this.op = op; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Operator getOperator() { - return op; - } - - public Expression getTarget() { - return target; - } - - public Expression getValue() { - return value; - } - - public void setOperator(Operator op) { - this.op = op; - } - - public void setTarget(Expression target) { - this.target = target; - } - - public void setValue(Expression value) { - this.value = value; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BinaryExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BinaryExpr.java deleted file mode 100644 index 7742be65b5e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BinaryExpr.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class BinaryExpr extends Expression { - - public static enum Operator { - or, // || - and, // && - binOr, // | - binAnd, // & - xor, // ^ - equals, // == - notEquals, // != - less, // < - greater, // > - lessEquals, // <= - greaterEquals, // >= - lShift, // << - rSignedShift, // >> - rUnsignedShift, // >>> - plus, // + - minus, // - - times, // * - divide, // / - remainder, // % - } - - private Expression left; - - private Expression right; - - private Operator op; - - public BinaryExpr() { - } - - public BinaryExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression left, Expression right, Operator op) { - super(beginLine, beginColumn, endLine, endColumn); - this.left = left; - this.right = right; - this.op = op; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getLeft() { - return left; - } - - public Operator getOperator() { - return op; - } - - public Expression getRight() { - return right; - } - - public void setLeft(Expression left) { - this.left = left; - } - - public void setOperator(Operator op) { - this.op = op; - } - - public void setRight(Expression right) { - this.right = right; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BooleanLiteralExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BooleanLiteralExpr.java deleted file mode 100644 index 4f614b88bed..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BooleanLiteralExpr.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class BooleanLiteralExpr extends LiteralExpr { - - private boolean value; - - public BooleanLiteralExpr() { - } - - public BooleanLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, boolean value) { - super(beginLine, beginColumn, endLine, endColumn); - this.value = value; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public boolean getValue() { - return value; - } - - public void setValue(boolean value) { - this.value = value; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CastExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CastExpr.java deleted file mode 100644 index 85e4fbf8007..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CastExpr.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.type.Type; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class CastExpr extends Expression { - - private Type type; - - private Expression expr; - - public CastExpr() { - } - - public CastExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type, Expression expr) { - super(beginLine, beginColumn, endLine, endColumn); - this.type = type; - this.expr = expr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getExpr() { - return expr; - } - - public Type getType() { - return type; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } - - public void setType(Type type) { - this.type = type; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CharLiteralExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CharLiteralExpr.java deleted file mode 100644 index 09c9372fd41..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CharLiteralExpr.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class CharLiteralExpr extends StringLiteralExpr { - - public CharLiteralExpr() { - } - - public CharLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { - super(beginLine, beginColumn, endLine, endColumn, value); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ClassExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ClassExpr.java deleted file mode 100644 index c3e59ee3755..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ClassExpr.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.type.Type; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ClassExpr extends Expression { - - private Type type; - - public ClassExpr() { - } - - public ClassExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type) { - super(beginLine, beginColumn, endLine, endColumn); - this.type = type; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Type getType() { - return type; - } - - public void setType(Type type) { - this.type = type; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ConditionalExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ConditionalExpr.java deleted file mode 100644 index de616bbe851..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ConditionalExpr.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ConditionalExpr extends Expression { - - private Expression condition; - - private Expression thenExpr; - - private Expression elseExpr; - - public ConditionalExpr() { - } - - public ConditionalExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression condition, Expression thenExpr, Expression elseExpr) { - super(beginLine, beginColumn, endLine, endColumn); - this.condition = condition; - this.thenExpr = thenExpr; - this.elseExpr = elseExpr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getCondition() { - return condition; - } - - public Expression getElseExpr() { - return elseExpr; - } - - public Expression getThenExpr() { - return thenExpr; - } - - public void setCondition(Expression condition) { - this.condition = condition; - } - - public void setElseExpr(Expression elseExpr) { - this.elseExpr = elseExpr; - } - - public void setThenExpr(Expression thenExpr) { - this.thenExpr = thenExpr; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/DoubleLiteralExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/DoubleLiteralExpr.java deleted file mode 100644 index 02df5bbc474..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/DoubleLiteralExpr.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class DoubleLiteralExpr extends StringLiteralExpr { - - public DoubleLiteralExpr() { - } - - public DoubleLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { - super(beginLine, beginColumn, endLine, endColumn, value); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/EnclosedExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/EnclosedExpr.java deleted file mode 100644 index 90a0f0882af..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/EnclosedExpr.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class EnclosedExpr extends Expression { - - private Expression inner; - - public EnclosedExpr() { - } - - public EnclosedExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression inner) { - super(beginLine, beginColumn, endLine, endColumn); - this.inner = inner; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getInner() { - return inner; - } - - public void setInner(Expression inner) { - this.inner = inner; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/Expression.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/Expression.java deleted file mode 100644 index f4813ee2ed2..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/Expression.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 10/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.Node; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class Expression extends Node { - - public Expression() { - } - - public Expression(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/FieldAccessExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/FieldAccessExpr.java deleted file mode 100644 index 444956e1bdb..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/FieldAccessExpr.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.type.Type; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class FieldAccessExpr extends Expression { - - private Expression scope; - - private List typeArgs; - - private String field; - - public FieldAccessExpr() { - } - - public FieldAccessExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression scope, List typeArgs, String field) { - super(beginLine, beginColumn, endLine, endColumn); - this.scope = scope; - this.typeArgs = typeArgs; - this.field = field; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public String getField() { - return field; - } - - public Expression getScope() { - return scope; - } - - public List getTypeArgs() { - return typeArgs; - } - - public void setField(String field) { - this.field = field; - } - - public void setScope(Expression scope) { - this.scope = scope; - } - - public void setTypeArgs(List typeArgs) { - this.typeArgs = typeArgs; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/InstanceOfExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/InstanceOfExpr.java deleted file mode 100644 index cf2954c3a27..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/InstanceOfExpr.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.type.Type; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class InstanceOfExpr extends Expression { - - private Expression expr; - - private Type type; - - public InstanceOfExpr() { - } - - public InstanceOfExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr, Type type) { - super(beginLine, beginColumn, endLine, endColumn); - this.expr = expr; - this.type = type; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getExpr() { - return expr; - } - - public Type getType() { - return type; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } - - public void setType(Type type) { - this.type = type; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralExpr.java deleted file mode 100644 index ff362ace5f1..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralExpr.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public class IntegerLiteralExpr extends StringLiteralExpr { - - public IntegerLiteralExpr() { - } - - public IntegerLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { - super(beginLine, beginColumn, endLine, endColumn, value); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public final boolean isMinValue() { - return value != null && // - value.length() == 10 && // - value.equals("2147483648"); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralMinValueExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralMinValueExpr.java deleted file mode 100644 index c4a14c6389d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralMinValueExpr.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 09/03/2007 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class IntegerLiteralMinValueExpr extends IntegerLiteralExpr { - - public IntegerLiteralMinValueExpr() { - this.value = "-2147483648"; - } - - public IntegerLiteralMinValueExpr(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn, "-2147483648"); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LiteralExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LiteralExpr.java deleted file mode 100644 index e2fe637eb35..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LiteralExpr.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class LiteralExpr extends Expression { - - public LiteralExpr() { - } - - public LiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralExpr.java deleted file mode 100644 index f5009c15038..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralExpr.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public class LongLiteralExpr extends StringLiteralExpr { - - public LongLiteralExpr() { - } - - public LongLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { - super(beginLine, beginColumn, endLine, endColumn, value); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public final boolean isMinValue() { - return value != null && // - value.length() == 20 && // - value.startsWith("9223372036854775808") && // - (value.charAt(19) == 'L' || value.charAt(19) == 'l'); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralMinValueExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralMinValueExpr.java deleted file mode 100644 index fc26b305378..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralMinValueExpr.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 09/03/2007 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class LongLiteralMinValueExpr extends LongLiteralExpr { - - public LongLiteralMinValueExpr() { - this.value = "-9223372036854775808L"; - } - - public LongLiteralMinValueExpr(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn, "-9223372036854775808L"); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MarkerAnnotationExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MarkerAnnotationExpr.java deleted file mode 100644 index 36d76f9ff6d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MarkerAnnotationExpr.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class MarkerAnnotationExpr extends AnnotationExpr { - - private NameExpr name; - - public MarkerAnnotationExpr() { - } - - public MarkerAnnotationExpr(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr name) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public NameExpr getName() { - return name; - } - - public void setName(NameExpr name) { - this.name = name; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MemberValuePair.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MemberValuePair.java deleted file mode 100644 index c309831ee79..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MemberValuePair.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.Node; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class MemberValuePair extends Node { - - private String name; - - private Expression value; - - public MemberValuePair() { - } - - public MemberValuePair(int beginLine, int beginColumn, int endLine, int endColumn, String name, Expression value) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.value = value; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public String getName() { - return name; - } - - public Expression getValue() { - return value; - } - - public void setName(String name) { - this.name = name; - } - - public void setValue(Expression value) { - this.value = value; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MethodCallExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MethodCallExpr.java deleted file mode 100644 index 577833afb9a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MethodCallExpr.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.type.Type; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class MethodCallExpr extends Expression { - - private Expression scope; - - private List typeArgs; - - private String name; - - private List args; - - public MethodCallExpr() { - } - - public MethodCallExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression scope, List typeArgs, String name, List args) { - super(beginLine, beginColumn, endLine, endColumn); - this.scope = scope; - this.typeArgs = typeArgs; - this.name = name; - this.args = args; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getArgs() { - return args; - } - - public String getName() { - return name; - } - - public Expression getScope() { - return scope; - } - - public List getTypeArgs() { - return typeArgs; - } - - public void setArgs(List args) { - this.args = args; - } - - public void setName(String name) { - this.name = name; - } - - public void setScope(Expression scope) { - this.scope = scope; - } - - public void setTypeArgs(List typeArgs) { - this.typeArgs = typeArgs; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NameExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NameExpr.java deleted file mode 100644 index b265fc516ea..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NameExpr.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public class NameExpr extends Expression { - - private String name; - - public NameExpr() { - } - - public NameExpr(int beginLine, int beginColumn, int endLine, int endColumn, String name) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public final String getName() { - return name; - } - - public final void setName(String name) { - this.name = name; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NormalAnnotationExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NormalAnnotationExpr.java deleted file mode 100644 index 3dd6642aace..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NormalAnnotationExpr.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class NormalAnnotationExpr extends AnnotationExpr { - - private NameExpr name; - - private List pairs; - - public NormalAnnotationExpr() { - } - - public NormalAnnotationExpr(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr name, List pairs) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.pairs = pairs; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public NameExpr getName() { - return name; - } - - public List getPairs() { - return pairs; - } - - public void setName(NameExpr name) { - this.name = name; - } - - public void setPairs(List pairs) { - this.pairs = pairs; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NullLiteralExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NullLiteralExpr.java deleted file mode 100644 index 3b225fd94b4..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NullLiteralExpr.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class NullLiteralExpr extends LiteralExpr { - - public NullLiteralExpr() { - } - - public NullLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ObjectCreationExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ObjectCreationExpr.java deleted file mode 100644 index 59c7ee4f3fa..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ObjectCreationExpr.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.body.BodyDeclaration; -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.type.Type; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class ObjectCreationExpr extends Expression { - - private Expression scope; - - private ClassOrInterfaceType type; - - private List typeArgs; - - private List args; - - private List anonymousClassBody; - - public ObjectCreationExpr() { - } - - public ObjectCreationExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression scope, ClassOrInterfaceType type, List typeArgs, List args, List anonymousBody) { - super(beginLine, beginColumn, endLine, endColumn); - this.scope = scope; - this.type = type; - this.typeArgs = typeArgs; - this.args = args; - this.anonymousClassBody = anonymousBody; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getAnonymousClassBody() { - return anonymousClassBody; - } - - public List getArgs() { - return args; - } - - public Expression getScope() { - return scope; - } - - public ClassOrInterfaceType getType() { - return type; - } - - public List getTypeArgs() { - return typeArgs; - } - - public void setAnonymousClassBody(List anonymousClassBody) { - this.anonymousClassBody = anonymousClassBody; - } - - public void setArgs(List args) { - this.args = args; - } - - public void setScope(Expression scope) { - this.scope = scope; - } - - public void setType(ClassOrInterfaceType type) { - this.type = type; - } - - public void setTypeArgs(List typeArgs) { - this.typeArgs = typeArgs; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/QualifiedNameExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/QualifiedNameExpr.java deleted file mode 100644 index a265e6ffc2b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/QualifiedNameExpr.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class QualifiedNameExpr extends NameExpr { - - private NameExpr qualifier; - - public QualifiedNameExpr() { - } - - public QualifiedNameExpr(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr scope, String name) { - super(beginLine, beginColumn, endLine, endColumn, name); - this.qualifier = scope; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public NameExpr getQualifier() { - return qualifier; - } - - public void setQualifier(NameExpr qualifier) { - this.qualifier = qualifier; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SingleMemberAnnotationExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SingleMemberAnnotationExpr.java deleted file mode 100644 index 68a013d0691..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SingleMemberAnnotationExpr.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 21/11/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class SingleMemberAnnotationExpr extends AnnotationExpr { - - private NameExpr name; - - private Expression memberValue; - - public SingleMemberAnnotationExpr() { - } - - public SingleMemberAnnotationExpr(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr name, Expression memberValue) { - super(beginLine, beginColumn, endLine, endColumn); - this.name = name; - this.memberValue = memberValue; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getMemberValue() { - return memberValue; - } - - public NameExpr getName() { - return name; - } - - public void setMemberValue(Expression memberValue) { - this.memberValue = memberValue; - } - - public void setName(NameExpr name) { - this.name = name; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/StringLiteralExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/StringLiteralExpr.java deleted file mode 100644 index 2cf2e0f0608..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/StringLiteralExpr.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 02/03/2007 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public class StringLiteralExpr extends LiteralExpr { - - protected String value; - - public StringLiteralExpr() { - } - - public StringLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { - super(beginLine, beginColumn, endLine, endColumn); - this.value = value; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public final String getValue() { - return value; - } - - public final void setValue(String value) { - this.value = value; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SuperExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SuperExpr.java deleted file mode 100644 index 7c65800ccd3..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SuperExpr.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 20/01/2007 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class SuperExpr extends Expression { - - private Expression classExpr; - - public SuperExpr() { - } - - public SuperExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression classExpr) { - super(beginLine, beginColumn, endLine, endColumn); - this.classExpr = classExpr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getClassExpr() { - return classExpr; - } - - public void setClassExpr(Expression classExpr) { - this.classExpr = classExpr; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ThisExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ThisExpr.java deleted file mode 100644 index bff1d408766..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ThisExpr.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ThisExpr extends Expression { - - private Expression classExpr; - - public ThisExpr() { - } - - public ThisExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression classExpr) { - super(beginLine, beginColumn, endLine, endColumn); - this.classExpr = classExpr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getClassExpr() { - return classExpr; - } - - public void setClassExpr(Expression classExpr) { - this.classExpr = classExpr; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/UnaryExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/UnaryExpr.java deleted file mode 100644 index d8607f05723..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/UnaryExpr.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class UnaryExpr extends Expression { - - public static enum Operator { - positive, // + - negative, // - - preIncrement, // ++ - preDecrement, // -- - not, // ! - inverse, // ~ - posIncrement, // ++ - posDecrement, // -- - } - - private Expression expr; - - private Operator op; - - public UnaryExpr() { - } - - public UnaryExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr, Operator op) { - super(beginLine, beginColumn, endLine, endColumn); - this.expr = expr; - this.op = op; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getExpr() { - return expr; - } - - public Operator getOperator() { - return op; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } - - public void setOperator(Operator op) { - this.op = op; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/VariableDeclarationExpr.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/VariableDeclarationExpr.java deleted file mode 100644 index 32e0272a2b6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/VariableDeclarationExpr.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 03/11/2006 - */ -package japa.parser.ast.expr; - -import japa.parser.ast.body.VariableDeclarator; -import japa.parser.ast.type.Type; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class VariableDeclarationExpr extends Expression { - - private int modifiers; - - private List annotations; - - private Type type; - - private List vars; - - public VariableDeclarationExpr() { - } - - public VariableDeclarationExpr(int beginLine, int beginColumn, int endLine, int endColumn, int modifiers, List annotations, Type type, List vars) { - super(beginLine, beginColumn, endLine, endColumn); - this.modifiers = modifiers; - this.annotations = annotations; - this.type = type; - this.vars = vars; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getAnnotations() { - return annotations; - } - - public int getModifiers() { - return modifiers; - } - - public Type getType() { - return type; - } - - public List getVars() { - return vars; - } - - public void setAnnotations(List annotations) { - this.annotations = annotations; - } - - public void setModifiers(int modifiers) { - this.modifiers = modifiers; - } - - public void setType(Type type) { - this.type = type; - } - - public void setVars(List vars) { - this.vars = vars; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/AssertStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/AssertStmt.java deleted file mode 100644 index 0f184cd1e59..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/AssertStmt.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.expr.Expression; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class AssertStmt extends Statement { - - private Expression check; - - private Expression msg; - - public AssertStmt() { - } - - public AssertStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression check, Expression msg) { - super(beginLine, beginColumn, endLine, endColumn); - this.check = check; - this.msg = msg; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getCheck() { - return check; - } - - public Expression getMessage() { - return msg; - } - - public void setCheck(Expression check) { - this.check = check; - } - - public void setMessage(Expression msg) { - this.msg = msg; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BlockStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BlockStmt.java deleted file mode 100644 index 1ac9d534ca1..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BlockStmt.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class BlockStmt extends Statement { - - private List stmts; - - public BlockStmt() { - } - - public BlockStmt(int beginLine, int beginColumn, int endLine, int endColumn, List stmts) { - super(beginLine, beginColumn, endLine, endColumn); - this.stmts = stmts; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getStmts() { - return stmts; - } - - public void setStmts(List stmts) { - this.stmts = stmts; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BreakStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BreakStmt.java deleted file mode 100644 index 2388f620786..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BreakStmt.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class BreakStmt extends Statement { - - private String id; - - public BreakStmt() { - } - - public BreakStmt(int beginLine, int beginColumn, int endLine, int endColumn, String id) { - super(beginLine, beginColumn, endLine, endColumn); - this.id = id; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/CatchClause.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/CatchClause.java deleted file mode 100644 index 8ccbc320e72..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/CatchClause.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 18/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.Node; -import japa.parser.ast.body.Parameter; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class CatchClause extends Node { - - private Parameter except; - - private BlockStmt catchBlock; - - public CatchClause() { - } - - public CatchClause(int beginLine, int beginColumn, int endLine, int endColumn, Parameter except, BlockStmt catchBlock) { - super(beginLine, beginColumn, endLine, endColumn); - this.except = except; - this.catchBlock = catchBlock; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public BlockStmt getCatchBlock() { - return catchBlock; - } - - public Parameter getExcept() { - return except; - } - - public void setCatchBlock(BlockStmt catchBlock) { - this.catchBlock = catchBlock; - } - - public void setExcept(Parameter except) { - this.except = except; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ContinueStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ContinueStmt.java deleted file mode 100644 index de6a07d2b35..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ContinueStmt.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ContinueStmt extends Statement { - - private String id; - - public ContinueStmt() { - } - - public ContinueStmt(int beginLine, int beginColumn, int endLine, int endColumn, String id) { - super(beginLine, beginColumn, endLine, endColumn); - this.id = id; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/DoStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/DoStmt.java deleted file mode 100644 index 2660f385c46..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/DoStmt.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.expr.Expression; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class DoStmt extends Statement { - - private Statement body; - - private Expression condition; - - public DoStmt() { - } - - public DoStmt(int beginLine, int beginColumn, int endLine, int endColumn, Statement body, Expression condition) { - super(beginLine, beginColumn, endLine, endColumn); - this.body = body; - this.condition = condition; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Statement getBody() { - return body; - } - - public Expression getCondition() { - return condition; - } - - public void setBody(Statement body) { - this.body = body; - } - - public void setCondition(Expression condition) { - this.condition = condition; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/EmptyStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/EmptyStmt.java deleted file mode 100644 index 121bfa34e78..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/EmptyStmt.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class EmptyStmt extends Statement { - - public EmptyStmt() { - } - - public EmptyStmt(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExplicitConstructorInvocationStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExplicitConstructorInvocationStmt.java deleted file mode 100644 index b0176fafe72..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExplicitConstructorInvocationStmt.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 03/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.expr.Expression; -import japa.parser.ast.type.Type; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class ExplicitConstructorInvocationStmt extends Statement { - - private List typeArgs; - - private boolean isThis; - - private Expression expr; - - private List args; - - public ExplicitConstructorInvocationStmt() { - } - - public ExplicitConstructorInvocationStmt(int beginLine, int beginColumn, int endLine, int endColumn, List typeArgs, boolean isThis, Expression expr, List args) { - super(beginLine, beginColumn, endLine, endColumn); - this.typeArgs = typeArgs; - this.isThis = isThis; - this.expr = expr; - this.args = args; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getArgs() { - return args; - } - - public Expression getExpr() { - return expr; - } - - public List getTypeArgs() { - return typeArgs; - } - - public boolean isThis() { - return isThis; - } - - public void setArgs(List args) { - this.args = args; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } - - public void setThis(boolean isThis) { - this.isThis = isThis; - } - - public void setTypeArgs(List typeArgs) { - this.typeArgs = typeArgs; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExpressionStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExpressionStmt.java deleted file mode 100644 index 3413a2199f1..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExpressionStmt.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.expr.Expression; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ExpressionStmt extends Statement { - - private Expression expr; - - public ExpressionStmt() { - } - - public ExpressionStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr) { - super(beginLine, beginColumn, endLine, endColumn); - this.expr = expr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getExpression() { - return expr; - } - - public void setExpression(Expression expr) { - this.expr = expr; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForStmt.java deleted file mode 100644 index a3f465a6b14..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForStmt.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.expr.Expression; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class ForStmt extends Statement { - - private List init; - - private Expression compare; - - private List update; - - private Statement body; - - public ForStmt() { - } - - public ForStmt(int beginLine, int beginColumn, int endLine, int endColumn, List init, Expression compare, List update, Statement body) { - super(beginLine, beginColumn, endLine, endColumn); - this.compare = compare; - this.init = init; - this.update = update; - this.body = body; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Statement getBody() { - return body; - } - - public Expression getCompare() { - return compare; - } - - public List getInit() { - return init; - } - - public List getUpdate() { - return update; - } - - public void setBody(Statement body) { - this.body = body; - } - - public void setCompare(Expression compare) { - this.compare = compare; - } - - public void setInit(List init) { - this.init = init; - } - - public void setUpdate(List update) { - this.update = update; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForeachStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForeachStmt.java deleted file mode 100644 index 8d3f6a156a1..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForeachStmt.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.expr.Expression; -import japa.parser.ast.expr.VariableDeclarationExpr; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ForeachStmt extends Statement { - - private VariableDeclarationExpr var; - - private Expression iterable; - - private Statement body; - - public ForeachStmt() { - } - - public ForeachStmt(int beginLine, int beginColumn, int endLine, int endColumn, VariableDeclarationExpr var, Expression iterable, Statement body) { - super(beginLine, beginColumn, endLine, endColumn); - this.var = var; - this.iterable = iterable; - this.body = body; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Statement getBody() { - return body; - } - - public Expression getIterable() { - return iterable; - } - - public VariableDeclarationExpr getVariable() { - return var; - } - - public void setBody(Statement body) { - this.body = body; - } - - public void setIterable(Expression iterable) { - this.iterable = iterable; - } - - public void setVariable(VariableDeclarationExpr var) { - this.var = var; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/IfStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/IfStmt.java deleted file mode 100644 index 1a8d237efd8..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/IfStmt.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.expr.Expression; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class IfStmt extends Statement { - - private Expression condition; - - private Statement thenStmt; - - private Statement elseStmt; - - public IfStmt() { - } - - public IfStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression condition, Statement thenStmt, Statement elseStmt) { - super(beginLine, beginColumn, endLine, endColumn); - this.condition = condition; - this.thenStmt = thenStmt; - this.elseStmt = elseStmt; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getCondition() { - return condition; - } - - public Statement getElseStmt() { - return elseStmt; - } - - public Statement getThenStmt() { - return thenStmt; - } - - public void setCondition(Expression condition) { - this.condition = condition; - } - - public void setElseStmt(Statement elseStmt) { - this.elseStmt = elseStmt; - } - - public void setThenStmt(Statement thenStmt) { - this.thenStmt = thenStmt; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/LabeledStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/LabeledStmt.java deleted file mode 100644 index 737f1626b52..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/LabeledStmt.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class LabeledStmt extends Statement { - - private String label; - - private Statement stmt; - - public LabeledStmt() { - } - - public LabeledStmt(int beginLine, int beginColumn, int endLine, int endColumn, String label, Statement stmt) { - super(beginLine, beginColumn, endLine, endColumn); - this.label = label; - this.stmt = stmt; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public String getLabel() { - return label; - } - - public Statement getStmt() { - return stmt; - } - - public void setLabel(String label) { - this.label = label; - } - - public void setStmt(Statement stmt) { - this.stmt = stmt; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ReturnStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ReturnStmt.java deleted file mode 100644 index 598f73a24d1..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ReturnStmt.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.expr.Expression; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ReturnStmt extends Statement { - - private Expression expr; - - public ReturnStmt() { - } - - public ReturnStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr) { - super(beginLine, beginColumn, endLine, endColumn); - this.expr = expr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getExpr() { - return expr; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/Statement.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/Statement.java deleted file mode 100644 index 386746d8629..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/Statement.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 03/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.Node; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class Statement extends Node { - - public Statement() { - } - - public Statement(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchEntryStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchEntryStmt.java deleted file mode 100644 index 8ff7e3f25a6..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchEntryStmt.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.expr.Expression; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class SwitchEntryStmt extends Statement { - - private Expression label; - - private List stmts; - - public SwitchEntryStmt() { - } - - public SwitchEntryStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression label, List stmts) { - super(beginLine, beginColumn, endLine, endColumn); - this.label = label; - this.stmts = stmts; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getLabel() { - return label; - } - - public List getStmts() { - return stmts; - } - - public void setLabel(Expression label) { - this.label = label; - } - - public void setStmts(List stmts) { - this.stmts = stmts; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchStmt.java deleted file mode 100644 index d18eaa975a3..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchStmt.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.expr.Expression; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class SwitchStmt extends Statement { - - private Expression selector; - - private List entries; - - public SwitchStmt() { - } - - public SwitchStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression selector, List entries) { - super(beginLine, beginColumn, endLine, endColumn); - this.selector = selector; - this.entries = entries; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getEntries() { - return entries; - } - - public Expression getSelector() { - return selector; - } - - public void setEntries(List entries) { - this.entries = entries; - } - - public void setSelector(Expression selector) { - this.selector = selector; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SynchronizedStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SynchronizedStmt.java deleted file mode 100644 index 25de6c6a157..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SynchronizedStmt.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 18/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.expr.Expression; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class SynchronizedStmt extends Statement { - - private Expression expr; - - private BlockStmt block; - - public SynchronizedStmt() { - } - - public SynchronizedStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr, BlockStmt block) { - super(beginLine, beginColumn, endLine, endColumn); - this.expr = expr; - this.block = block; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public BlockStmt getBlock() { - return block; - } - - public Expression getExpr() { - return expr; - } - - public void setBlock(BlockStmt block) { - this.block = block; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ThrowStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ThrowStmt.java deleted file mode 100644 index d329cb078e7..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ThrowStmt.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 18/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.expr.Expression; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ThrowStmt extends Statement { - - private Expression expr; - - public ThrowStmt() { - } - - public ThrowStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr) { - super(beginLine, beginColumn, endLine, endColumn); - this.expr = expr; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Expression getExpr() { - return expr; - } - - public void setExpr(Expression expr) { - this.expr = expr; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TryStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TryStmt.java deleted file mode 100644 index 7ec39e6bad3..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TryStmt.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 18/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class TryStmt extends Statement { - - private BlockStmt tryBlock; - - private List catchs; - - private BlockStmt finallyBlock; - - public TryStmt() { - } - - public TryStmt(int beginLine, int beginColumn, int endLine, int endColumn, BlockStmt tryBlock, List catchs, BlockStmt finallyBlock) { - super(beginLine, beginColumn, endLine, endColumn); - this.tryBlock = tryBlock; - this.catchs = catchs; - this.finallyBlock = finallyBlock; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public List getCatchs() { - return catchs; - } - - public BlockStmt getFinallyBlock() { - return finallyBlock; - } - - public BlockStmt getTryBlock() { - return tryBlock; - } - - public void setCatchs(List catchs) { - this.catchs = catchs; - } - - public void setFinallyBlock(BlockStmt finallyBlock) { - this.finallyBlock = finallyBlock; - } - - public void setTryBlock(BlockStmt tryBlock) { - this.tryBlock = tryBlock; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TypeDeclarationStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TypeDeclarationStmt.java deleted file mode 100644 index a578dd811ee..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TypeDeclarationStmt.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 04/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.body.TypeDeclaration; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class TypeDeclarationStmt extends Statement { - - private TypeDeclaration typeDecl; - - public TypeDeclarationStmt() { - } - - public TypeDeclarationStmt(int beginLine, int beginColumn, int endLine, int endColumn, TypeDeclaration typeDecl) { - super(beginLine, beginColumn, endLine, endColumn); - this.typeDecl = typeDecl; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public TypeDeclaration getTypeDeclaration() { - return typeDecl; - } - - public void setTypeDeclaration(TypeDeclaration typeDecl) { - this.typeDecl = typeDecl; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/WhileStmt.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/WhileStmt.java deleted file mode 100644 index 0a2c96efd3a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/WhileStmt.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 07/11/2006 - */ -package japa.parser.ast.stmt; - -import japa.parser.ast.expr.Expression; -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class WhileStmt extends Statement { - - private Expression condition; - - private Statement body; - - public WhileStmt() { - } - - public WhileStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression condition, Statement body) { - super(beginLine, beginColumn, endLine, endColumn); - this.condition = condition; - this.body = body; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Statement getBody() { - return body; - } - - public Expression getCondition() { - return condition; - } - - public void setBody(Statement body) { - this.body = body; - } - - public void setCondition(Expression condition) { - this.condition = condition; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ClassOrInterfaceType.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ClassOrInterfaceType.java deleted file mode 100644 index a233bc1fa93..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ClassOrInterfaceType.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.type; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ -public final class ClassOrInterfaceType extends Type { - - private ClassOrInterfaceType scope; - - private String name; - - private List typeArgs; - - public ClassOrInterfaceType() { - } - - public ClassOrInterfaceType(int beginLine, int beginColumn, int endLine, int endColumn, ClassOrInterfaceType scope, String name, List typeArgs) { - super(beginLine, beginColumn, endLine, endColumn); - this.scope = scope; - this.name = name; - this.typeArgs = typeArgs; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public String getName() { - return name; - } - - public ClassOrInterfaceType getScope() { - return scope; - } - - public List getTypeArgs() { - return typeArgs; - } - - public void setName(String name) { - this.name = name; - } - - public void setScope(ClassOrInterfaceType scope) { - this.scope = scope; - } - - public void setTypeArgs(List typeArgs) { - this.typeArgs = typeArgs; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/PrimitiveType.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/PrimitiveType.java deleted file mode 100644 index 06b5dcf1601..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/PrimitiveType.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.type; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class PrimitiveType extends Type { - - public enum Primitive { - Boolean, Char, Byte, Short, Int, Long, Float, Double - } - - private Primitive type; - - public PrimitiveType() { - } - - public PrimitiveType(int beginLine, int beginColumn, int endLine, int endColumn, Primitive type) { - super(beginLine, beginColumn, endLine, endColumn); - this.type = type; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public Primitive getType() { - return type; - } - - public void setType(Primitive type) { - this.type = type; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ReferenceType.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ReferenceType.java deleted file mode 100644 index f19afbb0c4c..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ReferenceType.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.type; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class ReferenceType extends Type { - - private Type type; - - private int arrayCount; - - public ReferenceType() { - } - - public ReferenceType(int beginLine, int beginColumn, int endLine, int endColumn, Type type, int arrayCount) { - super(beginLine, beginColumn, endLine, endColumn); - this.type = type; - this.arrayCount = arrayCount; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public int getArrayCount() { - return arrayCount; - } - - public Type getType() { - return type; - } - - public void setArrayCount(int arrayCount) { - this.arrayCount = arrayCount; - } - - public void setType(Type type) { - this.type = type; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/Type.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/Type.java deleted file mode 100644 index ad0afadff96..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/Type.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.type; - -import japa.parser.ast.Node; - -/** - * @author Julio Vilmar Gesser - */ -public abstract class Type extends Node { - - public Type() { - } - - public Type(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/VoidType.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/VoidType.java deleted file mode 100644 index 1502105620f..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/VoidType.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.type; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class VoidType extends Type { - - public VoidType() { - } - - public VoidType(int beginLine, int beginColumn, int endLine, int endColumn) { - super(beginLine, beginColumn, endLine, endColumn); - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/WildcardType.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/WildcardType.java deleted file mode 100644 index e1af38fbf7b..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/WildcardType.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.type; - -import japa.parser.ast.visitor.GenericVisitor; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * @author Julio Vilmar Gesser - */ -public final class WildcardType extends Type { - - private ReferenceType ext; - - private ReferenceType sup; - - public WildcardType() { - } - - public WildcardType(int beginLine, int beginColumn, int endLine, int endColumn, ReferenceType ext, ReferenceType sup) { - super(beginLine, beginColumn, endLine, endColumn); - assert ext == null || sup == null; - this.ext = ext; - this.sup = sup; - } - - @Override - public R accept(GenericVisitor v, A arg) { - return v.visit(this, arg); - } - - @Override - public void accept(VoidVisitor v, A arg) { - v.visit(this, arg); - } - - public ReferenceType getExtends() { - return ext; - } - - public ReferenceType getSuper() { - return sup; - } - - public void setExtends(ReferenceType ext) { - this.ext = ext; - } - - public void setSuper(ReferenceType sup) { - this.sup = sup; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/DumpVisitor.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/DumpVisitor.java deleted file mode 100644 index 8b10b6c85f9..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/DumpVisitor.java +++ /dev/null @@ -1,1387 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.visitor; - -import japa.parser.ast.BlockComment; -import japa.parser.ast.CompilationUnit; -import japa.parser.ast.ImportDeclaration; -import japa.parser.ast.LineComment; -import japa.parser.ast.Node; -import japa.parser.ast.PackageDeclaration; -import japa.parser.ast.TypeParameter; -import japa.parser.ast.body.AnnotationDeclaration; -import japa.parser.ast.body.AnnotationMemberDeclaration; -import japa.parser.ast.body.BodyDeclaration; -import japa.parser.ast.body.ClassOrInterfaceDeclaration; -import japa.parser.ast.body.ConstructorDeclaration; -import japa.parser.ast.body.EmptyMemberDeclaration; -import japa.parser.ast.body.EmptyTypeDeclaration; -import japa.parser.ast.body.EnumConstantDeclaration; -import japa.parser.ast.body.EnumDeclaration; -import japa.parser.ast.body.FieldDeclaration; -import japa.parser.ast.body.InitializerDeclaration; -import japa.parser.ast.body.JavadocComment; -import japa.parser.ast.body.MethodDeclaration; -import japa.parser.ast.body.ModifierSet; -import japa.parser.ast.body.Parameter; -import japa.parser.ast.body.TypeDeclaration; -import japa.parser.ast.body.VariableDeclarator; -import japa.parser.ast.body.VariableDeclaratorId; -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.expr.ArrayAccessExpr; -import japa.parser.ast.expr.ArrayCreationExpr; -import japa.parser.ast.expr.ArrayInitializerExpr; -import japa.parser.ast.expr.AssignExpr; -import japa.parser.ast.expr.BinaryExpr; -import japa.parser.ast.expr.BooleanLiteralExpr; -import japa.parser.ast.expr.CastExpr; -import japa.parser.ast.expr.CharLiteralExpr; -import japa.parser.ast.expr.ClassExpr; -import japa.parser.ast.expr.ConditionalExpr; -import japa.parser.ast.expr.DoubleLiteralExpr; -import japa.parser.ast.expr.EnclosedExpr; -import japa.parser.ast.expr.Expression; -import japa.parser.ast.expr.FieldAccessExpr; -import japa.parser.ast.expr.InstanceOfExpr; -import japa.parser.ast.expr.IntegerLiteralExpr; -import japa.parser.ast.expr.IntegerLiteralMinValueExpr; -import japa.parser.ast.expr.LongLiteralExpr; -import japa.parser.ast.expr.LongLiteralMinValueExpr; -import japa.parser.ast.expr.MarkerAnnotationExpr; -import japa.parser.ast.expr.MemberValuePair; -import japa.parser.ast.expr.MethodCallExpr; -import japa.parser.ast.expr.NameExpr; -import japa.parser.ast.expr.NormalAnnotationExpr; -import japa.parser.ast.expr.NullLiteralExpr; -import japa.parser.ast.expr.ObjectCreationExpr; -import japa.parser.ast.expr.QualifiedNameExpr; -import japa.parser.ast.expr.SingleMemberAnnotationExpr; -import japa.parser.ast.expr.StringLiteralExpr; -import japa.parser.ast.expr.SuperExpr; -import japa.parser.ast.expr.ThisExpr; -import japa.parser.ast.expr.UnaryExpr; -import japa.parser.ast.expr.VariableDeclarationExpr; -import japa.parser.ast.stmt.AssertStmt; -import japa.parser.ast.stmt.BlockStmt; -import japa.parser.ast.stmt.BreakStmt; -import japa.parser.ast.stmt.CatchClause; -import japa.parser.ast.stmt.ContinueStmt; -import japa.parser.ast.stmt.DoStmt; -import japa.parser.ast.stmt.EmptyStmt; -import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; -import japa.parser.ast.stmt.ExpressionStmt; -import japa.parser.ast.stmt.ForStmt; -import japa.parser.ast.stmt.ForeachStmt; -import japa.parser.ast.stmt.IfStmt; -import japa.parser.ast.stmt.LabeledStmt; -import japa.parser.ast.stmt.ReturnStmt; -import japa.parser.ast.stmt.Statement; -import japa.parser.ast.stmt.SwitchEntryStmt; -import japa.parser.ast.stmt.SwitchStmt; -import japa.parser.ast.stmt.SynchronizedStmt; -import japa.parser.ast.stmt.ThrowStmt; -import japa.parser.ast.stmt.TryStmt; -import japa.parser.ast.stmt.TypeDeclarationStmt; -import japa.parser.ast.stmt.WhileStmt; -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.type.PrimitiveType; -import japa.parser.ast.type.ReferenceType; -import japa.parser.ast.type.Type; -import japa.parser.ast.type.VoidType; -import japa.parser.ast.type.WildcardType; - -import java.util.Iterator; -import java.util.List; - -/** - * @author Julio Vilmar Gesser - */ - -public final class DumpVisitor implements VoidVisitor { - - private class SourcePrinter { - - private int level = 0; - - private boolean indented = false; - - private final StringBuilder buf = new StringBuilder(); - - public void indent() { - level++; - } - - public void unindent() { - level--; - } - - private void makeIndent() { - for (int i = 0; i < level; i++) { - buf.append(" "); - } - } - - public void print(String arg) { - if (!indented) { - makeIndent(); - indented = true; - } - buf.append(arg); - } - - public void printLn(String arg) { - print(arg); - printLn(); - } - - public void printLn() { - buf.append("\n"); - indented = false; - } - - public String getSource() { - return buf.toString(); - } - - @Override - public String toString() { - return getSource(); - } - } - - private final SourcePrinter printer = new SourcePrinter(); - - public String getSource() { - return printer.getSource(); - } - - private void printModifiers(int modifiers) { - if (ModifierSet.isPrivate(modifiers)) { - printer.print("private "); - } - if (ModifierSet.isProtected(modifiers)) { - printer.print("protected "); - } - if (ModifierSet.isPublic(modifiers)) { - printer.print("public "); - } - if (ModifierSet.isAbstract(modifiers)) { - printer.print("abstract "); - } - if (ModifierSet.isStatic(modifiers)) { - printer.print("static "); - } - if (ModifierSet.isFinal(modifiers)) { - printer.print("final "); - } - if (ModifierSet.isNative(modifiers)) { - printer.print("native "); - } - if (ModifierSet.isStrictfp(modifiers)) { - printer.print("strictfp "); - } - if (ModifierSet.isSynchronized(modifiers)) { - printer.print("synchronized "); - } - if (ModifierSet.isTransient(modifiers)) { - printer.print("transient "); - } - if (ModifierSet.isVolatile(modifiers)) { - printer.print("volatile "); - } - } - - private void printMembers(List members, Object arg) { - for (BodyDeclaration member : members) { - printer.printLn(); - member.accept(this, arg); - printer.printLn(); - } - } - - private void printMemberAnnotations(List annotations, Object arg) { - if (annotations != null) { - for (AnnotationExpr a : annotations) { - a.accept(this, arg); - printer.printLn(); - } - } - } - - private void printAnnotations(List annotations, Object arg) { - if (annotations != null) { - for (AnnotationExpr a : annotations) { - a.accept(this, arg); - printer.print(" "); - } - } - } - - private void printTypeArgs(List args, Object arg) { - if (args != null) { - printer.print("<"); - for (Iterator i = args.iterator(); i.hasNext();) { - Type t = i.next(); - t.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - printer.print(">"); - } - } - - private void printTypeParameters(List args, Object arg) { - if (args != null) { - printer.print("<"); - for (Iterator i = args.iterator(); i.hasNext();) { - TypeParameter t = i.next(); - t.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - printer.print(">"); - } - } - - private void printArguments(List args, Object arg) { - printer.print("("); - if (args != null) { - for (Iterator i = args.iterator(); i.hasNext();) { - Expression e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - } - - private void printJavadoc(JavadocComment javadoc, Object arg) { - if (javadoc != null) { - javadoc.accept(this, arg); - } - } - - @Override - public void visit(CompilationUnit n, Object arg) { - if (n.getPakage() != null) { - n.getPakage().accept(this, arg); - } - if (n.getImports() != null) { - for (ImportDeclaration i : n.getImports()) { - i.accept(this, arg); - } - printer.printLn(); - } - if (n.getTypes() != null) { - for (Iterator i = n.getTypes().iterator(); i.hasNext();) { - i.next().accept(this, arg); - printer.printLn(); - if (i.hasNext()) { - printer.printLn(); - } - } - } - } - - @Override - public void visit(PackageDeclaration n, Object arg) { - printAnnotations(n.getAnnotations(), arg); - printer.print("package "); - n.getName().accept(this, arg); - printer.printLn(";"); - printer.printLn(); - } - - @Override - public void visit(NameExpr n, Object arg) { - printer.print(n.getName()); - } - - @Override - public void visit(QualifiedNameExpr n, Object arg) { - n.getQualifier().accept(this, arg); - printer.print("."); - printer.print(n.getName()); - } - - @Override - public void visit(ImportDeclaration n, Object arg) { - printer.print("import "); - if (n.isStatic()) { - printer.print("static "); - } - n.getName().accept(this, arg); - if (n.isAsterisk()) { - printer.print(".*"); - } - printer.printLn(";"); - } - - @Override - public void visit(ClassOrInterfaceDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - if (n.isInterface()) { - printer.print("interface "); - } else { - printer.print("class "); - } - - printer.print(n.getName()); - - printTypeParameters(n.getTypeParameters(), arg); - - if (n.getExtends() != null) { - printer.print(" extends "); - for (Iterator i = n.getExtends().iterator(); i.hasNext();) { - ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - if (n.getImplements() != null) { - printer.print(" implements "); - for (Iterator i = n.getImplements().iterator(); i.hasNext();) { - ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - printer.printLn(" {"); - printer.indent(); - if (n.getMembers() != null) { - printMembers(n.getMembers(), arg); - } - printer.unindent(); - printer.print("}"); - } - - @Override - public void visit(EmptyTypeDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printer.print(";"); - } - - @Override - public void visit(JavadocComment n, Object arg) { - printer.print("/**"); - printer.print(n.getContent()); - printer.printLn("*/"); - } - - @Override - public void visit(ClassOrInterfaceType n, Object arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - printer.print("."); - } - printer.print(n.getName()); - printTypeArgs(n.getTypeArgs(), arg); - } - - @Override - public void visit(TypeParameter n, Object arg) { - printer.print(n.getName()); - if (n.getTypeBound() != null) { - printer.print(" extends "); - for (Iterator i = n.getTypeBound().iterator(); i.hasNext();) { - ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(" & "); - } - } - } - } - - @Override - public void visit(PrimitiveType n, Object arg) { - switch (n.getType()) { - case Boolean: - printer.print("boolean"); - break; - case Byte: - printer.print("byte"); - break; - case Char: - printer.print("char"); - break; - case Double: - printer.print("double"); - break; - case Float: - printer.print("float"); - break; - case Int: - printer.print("int"); - break; - case Long: - printer.print("long"); - break; - case Short: - printer.print("short"); - break; - } - } - - @Override - public void visit(ReferenceType n, Object arg) { - n.getType().accept(this, arg); - for (int i = 0; i < n.getArrayCount(); i++) { - printer.print("[]"); - } - } - - @Override - public void visit(WildcardType n, Object arg) { - printer.print("?"); - if (n.getExtends() != null) { - printer.print(" extends "); - n.getExtends().accept(this, arg); - } - if (n.getSuper() != null) { - printer.print(" super "); - n.getSuper().accept(this, arg); - } - } - - @Override - public void visit(FieldDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - n.getType().accept(this, arg); - - printer.print(" "); - for (Iterator i = n.getVariables().iterator(); i.hasNext();) { - VariableDeclarator var = i.next(); - var.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - - printer.print(";"); - } - - @Override - public void visit(VariableDeclarator n, Object arg) { - n.getId().accept(this, arg); - if (n.getInit() != null) { - printer.print(" = "); - n.getInit().accept(this, arg); - } - } - - @Override - public void visit(VariableDeclaratorId n, Object arg) { - printer.print(n.getName()); - for (int i = 0; i < n.getArrayCount(); i++) { - printer.print("[]"); - } - } - - @Override - public void visit(ArrayInitializerExpr n, Object arg) { - printer.print("{"); - if (n.getValues() != null) { - printer.print(" "); - for (Iterator i = n.getValues().iterator(); i.hasNext();) { - Expression expr = i.next(); - expr.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - printer.print(" "); - } - printer.print("}"); - } - - @Override - public void visit(VoidType n, Object arg) { - printer.print("void"); - } - - @Override - public void visit(ArrayAccessExpr n, Object arg) { - n.getName().accept(this, arg); - printer.print("["); - n.getIndex().accept(this, arg); - printer.print("]"); - } - - @Override - public void visit(ArrayCreationExpr n, Object arg) { - printer.print("new "); - n.getType().accept(this, arg); - - if (n.getDimensions() != null) { - for (Expression dim : n.getDimensions()) { - printer.print("["); - dim.accept(this, arg); - printer.print("]"); - } - for (int i = 0; i < n.getArrayCount(); i++) { - printer.print("[]"); - } - } else { - for (int i = 0; i < n.getArrayCount(); i++) { - printer.print("[]"); - } - printer.print(" "); - n.getInitializer().accept(this, arg); - } - } - - @Override - public void visit(AssignExpr n, Object arg) { - n.getTarget().accept(this, arg); - printer.print(" "); - switch (n.getOperator()) { - case assign: - printer.print("="); - break; - case and: - printer.print("&="); - break; - case or: - printer.print("|="); - break; - case xor: - printer.print("^="); - break; - case plus: - printer.print("+="); - break; - case minus: - printer.print("-="); - break; - case rem: - printer.print("%="); - break; - case slash: - printer.print("/="); - break; - case star: - printer.print("*="); - break; - case lShift: - printer.print("<<="); - break; - case rSignedShift: - printer.print(">>="); - break; - case rUnsignedShift: - printer.print(">>>="); - break; - } - printer.print(" "); - n.getValue().accept(this, arg); - } - - @Override - public void visit(BinaryExpr n, Object arg) { - n.getLeft().accept(this, arg); - printer.print(" "); - switch (n.getOperator()) { - case or: - printer.print("||"); - break; - case and: - printer.print("&&"); - break; - case binOr: - printer.print("|"); - break; - case binAnd: - printer.print("&"); - break; - case xor: - printer.print("^"); - break; - case equals: - printer.print("=="); - break; - case notEquals: - printer.print("!="); - break; - case less: - printer.print("<"); - break; - case greater: - printer.print(">"); - break; - case lessEquals: - printer.print("<="); - break; - case greaterEquals: - printer.print(">="); - break; - case lShift: - printer.print("<<"); - break; - case rSignedShift: - printer.print(">>"); - break; - case rUnsignedShift: - printer.print(">>>"); - break; - case plus: - printer.print("+"); - break; - case minus: - printer.print("-"); - break; - case times: - printer.print("*"); - break; - case divide: - printer.print("/"); - break; - case remainder: - printer.print("%"); - break; - } - printer.print(" "); - n.getRight().accept(this, arg); - } - - @Override - public void visit(CastExpr n, Object arg) { - printer.print("("); - n.getType().accept(this, arg); - printer.print(") "); - n.getExpr().accept(this, arg); - } - - @Override - public void visit(ClassExpr n, Object arg) { - n.getType().accept(this, arg); - printer.print(".class"); - } - - @Override - public void visit(ConditionalExpr n, Object arg) { - n.getCondition().accept(this, arg); - printer.print(" ? "); - n.getThenExpr().accept(this, arg); - printer.print(" : "); - n.getElseExpr().accept(this, arg); - } - - @Override - public void visit(EnclosedExpr n, Object arg) { - printer.print("("); - n.getInner().accept(this, arg); - printer.print(")"); - } - - @Override - public void visit(FieldAccessExpr n, Object arg) { - n.getScope().accept(this, arg); - printer.print("."); - printer.print(n.getField()); - } - - @Override - public void visit(InstanceOfExpr n, Object arg) { - n.getExpr().accept(this, arg); - printer.print(" instanceof "); - n.getType().accept(this, arg); - } - - @Override - public void visit(CharLiteralExpr n, Object arg) { - printer.print("'"); - printer.print(n.getValue()); - printer.print("'"); - } - - @Override - public void visit(DoubleLiteralExpr n, Object arg) { - printer.print(n.getValue()); - } - - @Override - public void visit(IntegerLiteralExpr n, Object arg) { - printer.print(n.getValue()); - } - - @Override - public void visit(LongLiteralExpr n, Object arg) { - printer.print(n.getValue()); - } - - @Override - public void visit(IntegerLiteralMinValueExpr n, Object arg) { - printer.print(n.getValue()); - } - - @Override - public void visit(LongLiteralMinValueExpr n, Object arg) { - printer.print(n.getValue()); - } - - @Override - public void visit(StringLiteralExpr n, Object arg) { - printer.print("\""); - printer.print(n.getValue()); - printer.print("\""); - } - - @Override - public void visit(BooleanLiteralExpr n, Object arg) { - printer.print(String.valueOf(n.getValue())); - } - - @Override - public void visit(NullLiteralExpr n, Object arg) { - printer.print("null"); - } - - @Override - public void visit(ThisExpr n, Object arg) { - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - printer.print("."); - } - printer.print("this"); - } - - @Override - public void visit(SuperExpr n, Object arg) { - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - printer.print("."); - } - printer.print("super"); - } - - @Override - public void visit(MethodCallExpr n, Object arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - printer.print("."); - } - printTypeArgs(n.getTypeArgs(), arg); - printer.print(n.getName()); - printArguments(n.getArgs(), arg); - } - - @Override - public void visit(ObjectCreationExpr n, Object arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - printer.print("."); - } - - printer.print("new "); - - printTypeArgs(n.getTypeArgs(), arg); - n.getType().accept(this, arg); - - printArguments(n.getArgs(), arg); - - if (n.getAnonymousClassBody() != null) { - printer.printLn(" {"); - printer.indent(); - printMembers(n.getAnonymousClassBody(), arg); - printer.unindent(); - printer.print("}"); - } - } - - @Override - public void visit(UnaryExpr n, Object arg) { - switch (n.getOperator()) { - case positive: - printer.print("+"); - break; - case negative: - printer.print("-"); - break; - case inverse: - printer.print("~"); - break; - case not: - printer.print("!"); - break; - case preIncrement: - printer.print("++"); - break; - case preDecrement: - printer.print("--"); - break; - } - - n.getExpr().accept(this, arg); - - switch (n.getOperator()) { - case posIncrement: - printer.print("++"); - break; - case posDecrement: - printer.print("--"); - break; - } - } - - @Override - public void visit(ConstructorDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - printTypeParameters(n.getTypeParameters(), arg); - if (n.getTypeParameters() != null) { - printer.print(" "); - } - printer.print(n.getName()); - - printer.print("("); - if (n.getParameters() != null) { - for (Iterator i = n.getParameters().iterator(); i.hasNext();) { - Parameter p = i.next(); - p.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - - if (n.getThrows() != null) { - printer.print(" throws "); - for (Iterator i = n.getThrows().iterator(); i.hasNext();) { - NameExpr name = i.next(); - name.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(" "); - n.getBlock().accept(this, arg); - } - - @Override - public void visit(MethodDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - printTypeParameters(n.getTypeParameters(), arg); - if (n.getTypeParameters() != null) { - printer.print(" "); - } - - n.getType().accept(this, arg); - printer.print(" "); - printer.print(n.getName()); - - printer.print("("); - if (n.getParameters() != null) { - for (Iterator i = n.getParameters().iterator(); i.hasNext();) { - Parameter p = i.next(); - p.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - - for (int i = 0; i < n.getArrayCount(); i++) { - printer.print("[]"); - } - - if (n.getThrows() != null) { - printer.print(" throws "); - for (Iterator i = n.getThrows().iterator(); i.hasNext();) { - NameExpr name = i.next(); - name.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - if (n.getBody() == null) { - printer.print(";"); - } else { - printer.print(" "); - n.getBody().accept(this, arg); - } - } - - @Override - public void visit(Parameter n, Object arg) { - printAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - n.getType().accept(this, arg); - if (n.isVarArgs()) { - printer.print("..."); - } - printer.print(" "); - n.getId().accept(this, arg); - } - - @Override - public void visit(ExplicitConstructorInvocationStmt n, Object arg) { - if (n.isThis()) { - printTypeArgs(n.getTypeArgs(), arg); - printer.print("this"); - } else { - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - printer.print("."); - } - printTypeArgs(n.getTypeArgs(), arg); - printer.print("super"); - } - printArguments(n.getArgs(), arg); - printer.print(";"); - } - - @Override - public void visit(VariableDeclarationExpr n, Object arg) { - printAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - n.getType().accept(this, arg); - printer.print(" "); - - for (Iterator i = n.getVars().iterator(); i.hasNext();) { - VariableDeclarator v = i.next(); - v.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - @Override - public void visit(TypeDeclarationStmt n, Object arg) { - n.getTypeDeclaration().accept(this, arg); - } - - @Override - public void visit(AssertStmt n, Object arg) { - printer.print("assert "); - n.getCheck().accept(this, arg); - if (n.getMessage() != null) { - printer.print(" : "); - n.getMessage().accept(this, arg); - } - printer.print(";"); - } - - @Override - public void visit(BlockStmt n, Object arg) { - printer.printLn("{"); - if (n.getStmts() != null) { - printer.indent(); - for (Statement s : n.getStmts()) { - s.accept(this, arg); - printer.printLn(); - } - printer.unindent(); - } - printer.print("}"); - - } - - @Override - public void visit(LabeledStmt n, Object arg) { - printer.print(n.getLabel()); - printer.print(": "); - n.getStmt().accept(this, arg); - } - - @Override - public void visit(EmptyStmt n, Object arg) { - printer.print(";"); - } - - @Override - public void visit(ExpressionStmt n, Object arg) { - n.getExpression().accept(this, arg); - printer.print(";"); - } - - @Override - public void visit(SwitchStmt n, Object arg) { - printer.print("switch("); - n.getSelector().accept(this, arg); - printer.printLn(") {"); - if (n.getEntries() != null) { - printer.indent(); - for (SwitchEntryStmt e : n.getEntries()) { - e.accept(this, arg); - } - printer.unindent(); - } - printer.print("}"); - - } - - @Override - public void visit(SwitchEntryStmt n, Object arg) { - if (n.getLabel() != null) { - printer.print("case "); - n.getLabel().accept(this, arg); - printer.print(":"); - } else { - printer.print("default:"); - } - printer.printLn(); - printer.indent(); - if (n.getStmts() != null) { - for (Statement s : n.getStmts()) { - s.accept(this, arg); - printer.printLn(); - } - } - printer.unindent(); - } - - @Override - public void visit(BreakStmt n, Object arg) { - printer.print("break"); - if (n.getId() != null) { - printer.print(" "); - printer.print(n.getId()); - } - printer.print(";"); - } - - @Override - public void visit(ReturnStmt n, Object arg) { - printer.print("return"); - if (n.getExpr() != null) { - printer.print(" "); - n.getExpr().accept(this, arg); - } - printer.print(";"); - } - - @Override - public void visit(EnumDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - printer.print("enum "); - printer.print(n.getName()); - - if (n.getImplements() != null) { - printer.print(" implements "); - for (Iterator i = n.getImplements().iterator(); i.hasNext();) { - ClassOrInterfaceType c = i.next(); - c.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - - printer.printLn(" {"); - printer.indent(); - if (n.getEntries() != null) { - printer.printLn(); - for (Iterator i = n.getEntries().iterator(); i.hasNext();) { - EnumConstantDeclaration e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - if (n.getMembers() != null) { - printer.printLn(";"); - printMembers(n.getMembers(), arg); - } else { - if (n.getEntries() != null) { - printer.printLn(); - } - } - printer.unindent(); - printer.print("}"); - } - - @Override - public void visit(EnumConstantDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printer.print(n.getName()); - - if (n.getArgs() != null) { - printArguments(n.getArgs(), arg); - } - - if (n.getClassBody() != null) { - printer.printLn(" {"); - printer.indent(); - printMembers(n.getClassBody(), arg); - printer.unindent(); - printer.printLn("}"); - } - } - - @Override - public void visit(EmptyMemberDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printer.print(";"); - } - - @Override - public void visit(InitializerDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - if (n.isStatic()) { - printer.print("static "); - } - n.getBlock().accept(this, arg); - } - - @Override - public void visit(IfStmt n, Object arg) { - printer.print("if ("); - n.getCondition().accept(this, arg); - printer.print(") "); - n.getThenStmt().accept(this, arg); - if (n.getElseStmt() != null) { - printer.print(" else "); - n.getElseStmt().accept(this, arg); - } - } - - @Override - public void visit(WhileStmt n, Object arg) { - printer.print("while ("); - n.getCondition().accept(this, arg); - printer.print(") "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(ContinueStmt n, Object arg) { - printer.print("continue"); - if (n.getId() != null) { - printer.print(" "); - printer.print(n.getId()); - } - printer.print(";"); - } - - @Override - public void visit(DoStmt n, Object arg) { - printer.print("do "); - n.getBody().accept(this, arg); - printer.print(" while ("); - n.getCondition().accept(this, arg); - printer.print(");"); - } - - @Override - public void visit(ForeachStmt n, Object arg) { - printer.print("for ("); - n.getVariable().accept(this, arg); - printer.print(" : "); - n.getIterable().accept(this, arg); - printer.print(") "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(ForStmt n, Object arg) { - printer.print("for ("); - if (n.getInit() != null) { - for (Iterator i = n.getInit().iterator(); i.hasNext();) { - Expression e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print("; "); - if (n.getCompare() != null) { - n.getCompare().accept(this, arg); - } - printer.print("; "); - if (n.getUpdate() != null) { - for (Iterator i = n.getUpdate().iterator(); i.hasNext();) { - Expression e = i.next(); - e.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(") "); - n.getBody().accept(this, arg); - } - - @Override - public void visit(ThrowStmt n, Object arg) { - printer.print("throw "); - n.getExpr().accept(this, arg); - printer.print(";"); - } - - @Override - public void visit(SynchronizedStmt n, Object arg) { - printer.print("synchronized ("); - n.getExpr().accept(this, arg); - printer.print(") "); - n.getBlock().accept(this, arg); - } - - @Override - public void visit(TryStmt n, Object arg) { - printer.print("try "); - n.getTryBlock().accept(this, arg); - if (n.getCatchs() != null) { - for (CatchClause c : n.getCatchs()) { - c.accept(this, arg); - } - } - if (n.getFinallyBlock() != null) { - printer.print(" finally "); - n.getFinallyBlock().accept(this, arg); - } - } - - @Override - public void visit(CatchClause n, Object arg) { - printer.print(" catch ("); - n.getExcept().accept(this, arg); - printer.print(") "); - n.getCatchBlock().accept(this, arg); - - } - - @Override - public void visit(AnnotationDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - printer.print("@interface "); - printer.print(n.getName()); - printer.printLn(" {"); - printer.indent(); - if (n.getMembers() != null) { - printMembers(n.getMembers(), arg); - } - printer.unindent(); - printer.print("}"); - } - - @Override - public void visit(AnnotationMemberDeclaration n, Object arg) { - printJavadoc(n.getJavaDoc(), arg); - printMemberAnnotations(n.getAnnotations(), arg); - printModifiers(n.getModifiers()); - - n.getType().accept(this, arg); - printer.print(" "); - printer.print(n.getName()); - printer.print("()"); - if (n.getDefaultValue() != null) { - printer.print(" default "); - n.getDefaultValue().accept(this, arg); - } - printer.print(";"); - } - - @Override - public void visit(MarkerAnnotationExpr n, Object arg) { - printer.print("@"); - n.getName().accept(this, arg); - } - - @Override - public void visit(SingleMemberAnnotationExpr n, Object arg) { - printer.print("@"); - n.getName().accept(this, arg); - printer.print("("); - n.getMemberValue().accept(this, arg); - printer.print(")"); - } - - @Override - public void visit(NormalAnnotationExpr n, Object arg) { - printer.print("@"); - n.getName().accept(this, arg); - printer.print("("); - if (n.getPairs() != null) { - for (Iterator i = n.getPairs().iterator(); i.hasNext();) { - MemberValuePair m = i.next(); - m.accept(this, arg); - if (i.hasNext()) { - printer.print(", "); - } - } - } - printer.print(")"); - } - - @Override - public void visit(MemberValuePair n, Object arg) { - printer.print(n.getName()); - printer.print(" = "); - n.getValue().accept(this, arg); - } - - @Override - public void visit(LineComment n, Object arg) { - printer.print("//"); - printer.printLn(n.getContent()); - } - - @Override - public void visit(BlockComment n, Object arg) { - printer.print("/*"); - printer.print(n.getContent()); - printer.printLn("*/"); - } - - @Override - public void visit(Node n, Object arg) { - throw new IllegalStateException(n.getClass().getName()); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitor.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitor.java deleted file mode 100644 index 8041649a27f..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitor.java +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.visitor; - -import japa.parser.ast.BlockComment; -import japa.parser.ast.CompilationUnit; -import japa.parser.ast.ImportDeclaration; -import japa.parser.ast.LineComment; -import japa.parser.ast.Node; -import japa.parser.ast.PackageDeclaration; -import japa.parser.ast.TypeParameter; -import japa.parser.ast.body.AnnotationDeclaration; -import japa.parser.ast.body.AnnotationMemberDeclaration; -import japa.parser.ast.body.ClassOrInterfaceDeclaration; -import japa.parser.ast.body.ConstructorDeclaration; -import japa.parser.ast.body.EmptyMemberDeclaration; -import japa.parser.ast.body.EmptyTypeDeclaration; -import japa.parser.ast.body.EnumConstantDeclaration; -import japa.parser.ast.body.EnumDeclaration; -import japa.parser.ast.body.FieldDeclaration; -import japa.parser.ast.body.InitializerDeclaration; -import japa.parser.ast.body.JavadocComment; -import japa.parser.ast.body.MethodDeclaration; -import japa.parser.ast.body.Parameter; -import japa.parser.ast.body.VariableDeclarator; -import japa.parser.ast.body.VariableDeclaratorId; -import japa.parser.ast.expr.ArrayAccessExpr; -import japa.parser.ast.expr.ArrayCreationExpr; -import japa.parser.ast.expr.ArrayInitializerExpr; -import japa.parser.ast.expr.AssignExpr; -import japa.parser.ast.expr.BinaryExpr; -import japa.parser.ast.expr.BooleanLiteralExpr; -import japa.parser.ast.expr.CastExpr; -import japa.parser.ast.expr.CharLiteralExpr; -import japa.parser.ast.expr.ClassExpr; -import japa.parser.ast.expr.ConditionalExpr; -import japa.parser.ast.expr.DoubleLiteralExpr; -import japa.parser.ast.expr.EnclosedExpr; -import japa.parser.ast.expr.FieldAccessExpr; -import japa.parser.ast.expr.InstanceOfExpr; -import japa.parser.ast.expr.IntegerLiteralExpr; -import japa.parser.ast.expr.IntegerLiteralMinValueExpr; -import japa.parser.ast.expr.LongLiteralExpr; -import japa.parser.ast.expr.LongLiteralMinValueExpr; -import japa.parser.ast.expr.MarkerAnnotationExpr; -import japa.parser.ast.expr.MemberValuePair; -import japa.parser.ast.expr.MethodCallExpr; -import japa.parser.ast.expr.NameExpr; -import japa.parser.ast.expr.NormalAnnotationExpr; -import japa.parser.ast.expr.NullLiteralExpr; -import japa.parser.ast.expr.ObjectCreationExpr; -import japa.parser.ast.expr.QualifiedNameExpr; -import japa.parser.ast.expr.SingleMemberAnnotationExpr; -import japa.parser.ast.expr.StringLiteralExpr; -import japa.parser.ast.expr.SuperExpr; -import japa.parser.ast.expr.ThisExpr; -import japa.parser.ast.expr.UnaryExpr; -import japa.parser.ast.expr.VariableDeclarationExpr; -import japa.parser.ast.stmt.AssertStmt; -import japa.parser.ast.stmt.BlockStmt; -import japa.parser.ast.stmt.BreakStmt; -import japa.parser.ast.stmt.CatchClause; -import japa.parser.ast.stmt.ContinueStmt; -import japa.parser.ast.stmt.DoStmt; -import japa.parser.ast.stmt.EmptyStmt; -import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; -import japa.parser.ast.stmt.ExpressionStmt; -import japa.parser.ast.stmt.ForStmt; -import japa.parser.ast.stmt.ForeachStmt; -import japa.parser.ast.stmt.IfStmt; -import japa.parser.ast.stmt.LabeledStmt; -import japa.parser.ast.stmt.ReturnStmt; -import japa.parser.ast.stmt.SwitchEntryStmt; -import japa.parser.ast.stmt.SwitchStmt; -import japa.parser.ast.stmt.SynchronizedStmt; -import japa.parser.ast.stmt.ThrowStmt; -import japa.parser.ast.stmt.TryStmt; -import japa.parser.ast.stmt.TypeDeclarationStmt; -import japa.parser.ast.stmt.WhileStmt; -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.type.PrimitiveType; -import japa.parser.ast.type.ReferenceType; -import japa.parser.ast.type.VoidType; -import japa.parser.ast.type.WildcardType; - -/** - * @author Julio Vilmar Gesser - */ -public interface GenericVisitor { - - public R visit(Node n, A arg); - - // - Compilation Unit ---------------------------------- - - public R visit(CompilationUnit n, A arg); - - public R visit(PackageDeclaration n, A arg); - - public R visit(ImportDeclaration n, A arg); - - public R visit(TypeParameter n, A arg); - - public R visit(LineComment n, A arg); - - public R visit(BlockComment n, A arg); - - // - Body ---------------------------------------------- - - public R visit(ClassOrInterfaceDeclaration n, A arg); - - public R visit(EnumDeclaration n, A arg); - - public R visit(EmptyTypeDeclaration n, A arg); - - public R visit(EnumConstantDeclaration n, A arg); - - public R visit(AnnotationDeclaration n, A arg); - - public R visit(AnnotationMemberDeclaration n, A arg); - - public R visit(FieldDeclaration n, A arg); - - public R visit(VariableDeclarator n, A arg); - - public R visit(VariableDeclaratorId n, A arg); - - public R visit(ConstructorDeclaration n, A arg); - - public R visit(MethodDeclaration n, A arg); - - public R visit(Parameter n, A arg); - - public R visit(EmptyMemberDeclaration n, A arg); - - public R visit(InitializerDeclaration n, A arg); - - public R visit(JavadocComment n, A arg); - - // - Type ---------------------------------------------- - - public R visit(ClassOrInterfaceType n, A arg); - - public R visit(PrimitiveType n, A arg); - - public R visit(ReferenceType n, A arg); - - public R visit(VoidType n, A arg); - - public R visit(WildcardType n, A arg); - - // - Expression ---------------------------------------- - - public R visit(ArrayAccessExpr n, A arg); - - public R visit(ArrayCreationExpr n, A arg); - - public R visit(ArrayInitializerExpr n, A arg); - - public R visit(AssignExpr n, A arg); - - public R visit(BinaryExpr n, A arg); - - public R visit(CastExpr n, A arg); - - public R visit(ClassExpr n, A arg); - - public R visit(ConditionalExpr n, A arg); - - public R visit(EnclosedExpr n, A arg); - - public R visit(FieldAccessExpr n, A arg); - - public R visit(InstanceOfExpr n, A arg); - - public R visit(StringLiteralExpr n, A arg); - - public R visit(IntegerLiteralExpr n, A arg); - - public R visit(LongLiteralExpr n, A arg); - - public R visit(IntegerLiteralMinValueExpr n, A arg); - - public R visit(LongLiteralMinValueExpr n, A arg); - - public R visit(CharLiteralExpr n, A arg); - - public R visit(DoubleLiteralExpr n, A arg); - - public R visit(BooleanLiteralExpr n, A arg); - - public R visit(NullLiteralExpr n, A arg); - - public R visit(MethodCallExpr n, A arg); - - public R visit(NameExpr n, A arg); - - public R visit(ObjectCreationExpr n, A arg); - - public R visit(QualifiedNameExpr n, A arg); - - public R visit(ThisExpr n, A arg); - - public R visit(SuperExpr n, A arg); - - public R visit(UnaryExpr n, A arg); - - public R visit(VariableDeclarationExpr n, A arg); - - public R visit(MarkerAnnotationExpr n, A arg); - - public R visit(SingleMemberAnnotationExpr n, A arg); - - public R visit(NormalAnnotationExpr n, A arg); - - public R visit(MemberValuePair n, A arg); - - // - Statements ---------------------------------------- - - public R visit(ExplicitConstructorInvocationStmt n, A arg); - - public R visit(TypeDeclarationStmt n, A arg); - - public R visit(AssertStmt n, A arg); - - public R visit(BlockStmt n, A arg); - - public R visit(LabeledStmt n, A arg); - - public R visit(EmptyStmt n, A arg); - - public R visit(ExpressionStmt n, A arg); - - public R visit(SwitchStmt n, A arg); - - public R visit(SwitchEntryStmt n, A arg); - - public R visit(BreakStmt n, A arg); - - public R visit(ReturnStmt n, A arg); - - public R visit(IfStmt n, A arg); - - public R visit(WhileStmt n, A arg); - - public R visit(ContinueStmt n, A arg); - - public R visit(DoStmt n, A arg); - - public R visit(ForeachStmt n, A arg); - - public R visit(ForStmt n, A arg); - - public R visit(ThrowStmt n, A arg); - - public R visit(SynchronizedStmt n, A arg); - - public R visit(TryStmt n, A arg); - - public R visit(CatchClause n, A arg); - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitorAdapter.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitorAdapter.java deleted file mode 100644 index 5140baac26e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitorAdapter.java +++ /dev/null @@ -1,910 +0,0 @@ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 09/06/2008 - */ -package japa.parser.ast.visitor; - -import japa.parser.ast.BlockComment; -import japa.parser.ast.CompilationUnit; -import japa.parser.ast.ImportDeclaration; -import japa.parser.ast.LineComment; -import japa.parser.ast.Node; -import japa.parser.ast.PackageDeclaration; -import japa.parser.ast.TypeParameter; -import japa.parser.ast.body.AnnotationDeclaration; -import japa.parser.ast.body.AnnotationMemberDeclaration; -import japa.parser.ast.body.BodyDeclaration; -import japa.parser.ast.body.ClassOrInterfaceDeclaration; -import japa.parser.ast.body.ConstructorDeclaration; -import japa.parser.ast.body.EmptyMemberDeclaration; -import japa.parser.ast.body.EmptyTypeDeclaration; -import japa.parser.ast.body.EnumConstantDeclaration; -import japa.parser.ast.body.EnumDeclaration; -import japa.parser.ast.body.FieldDeclaration; -import japa.parser.ast.body.InitializerDeclaration; -import japa.parser.ast.body.JavadocComment; -import japa.parser.ast.body.MethodDeclaration; -import japa.parser.ast.body.Parameter; -import japa.parser.ast.body.TypeDeclaration; -import japa.parser.ast.body.VariableDeclarator; -import japa.parser.ast.body.VariableDeclaratorId; -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.expr.ArrayAccessExpr; -import japa.parser.ast.expr.ArrayCreationExpr; -import japa.parser.ast.expr.ArrayInitializerExpr; -import japa.parser.ast.expr.AssignExpr; -import japa.parser.ast.expr.BinaryExpr; -import japa.parser.ast.expr.BooleanLiteralExpr; -import japa.parser.ast.expr.CastExpr; -import japa.parser.ast.expr.CharLiteralExpr; -import japa.parser.ast.expr.ClassExpr; -import japa.parser.ast.expr.ConditionalExpr; -import japa.parser.ast.expr.DoubleLiteralExpr; -import japa.parser.ast.expr.EnclosedExpr; -import japa.parser.ast.expr.Expression; -import japa.parser.ast.expr.FieldAccessExpr; -import japa.parser.ast.expr.InstanceOfExpr; -import japa.parser.ast.expr.IntegerLiteralExpr; -import japa.parser.ast.expr.IntegerLiteralMinValueExpr; -import japa.parser.ast.expr.LongLiteralExpr; -import japa.parser.ast.expr.LongLiteralMinValueExpr; -import japa.parser.ast.expr.MarkerAnnotationExpr; -import japa.parser.ast.expr.MemberValuePair; -import japa.parser.ast.expr.MethodCallExpr; -import japa.parser.ast.expr.NameExpr; -import japa.parser.ast.expr.NormalAnnotationExpr; -import japa.parser.ast.expr.NullLiteralExpr; -import japa.parser.ast.expr.ObjectCreationExpr; -import japa.parser.ast.expr.QualifiedNameExpr; -import japa.parser.ast.expr.SingleMemberAnnotationExpr; -import japa.parser.ast.expr.StringLiteralExpr; -import japa.parser.ast.expr.SuperExpr; -import japa.parser.ast.expr.ThisExpr; -import japa.parser.ast.expr.UnaryExpr; -import japa.parser.ast.expr.VariableDeclarationExpr; -import japa.parser.ast.stmt.AssertStmt; -import japa.parser.ast.stmt.BlockStmt; -import japa.parser.ast.stmt.BreakStmt; -import japa.parser.ast.stmt.CatchClause; -import japa.parser.ast.stmt.ContinueStmt; -import japa.parser.ast.stmt.DoStmt; -import japa.parser.ast.stmt.EmptyStmt; -import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; -import japa.parser.ast.stmt.ExpressionStmt; -import japa.parser.ast.stmt.ForStmt; -import japa.parser.ast.stmt.ForeachStmt; -import japa.parser.ast.stmt.IfStmt; -import japa.parser.ast.stmt.LabeledStmt; -import japa.parser.ast.stmt.ReturnStmt; -import japa.parser.ast.stmt.Statement; -import japa.parser.ast.stmt.SwitchEntryStmt; -import japa.parser.ast.stmt.SwitchStmt; -import japa.parser.ast.stmt.SynchronizedStmt; -import japa.parser.ast.stmt.ThrowStmt; -import japa.parser.ast.stmt.TryStmt; -import japa.parser.ast.stmt.TypeDeclarationStmt; -import japa.parser.ast.stmt.WhileStmt; -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.type.PrimitiveType; -import japa.parser.ast.type.ReferenceType; -import japa.parser.ast.type.Type; -import japa.parser.ast.type.VoidType; -import japa.parser.ast.type.WildcardType; - -/** - * @author Julio Vilmar Gesser - */ -public class GenericVisitorAdapter implements GenericVisitor { - - @Override - public R visit(AnnotationDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(AnnotationMemberDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getDefaultValue() != null) { - n.getDefaultValue().accept(this, arg); - } - return null; - } - - @Override - public R visit(ArrayAccessExpr n, A arg) { - n.getName().accept(this, arg); - n.getIndex().accept(this, arg); - return null; - } - - @Override - public R visit(ArrayCreationExpr n, A arg) { - n.getType().accept(this, arg); - if (n.getDimensions() != null) { - for (Expression dim : n.getDimensions()) { - dim.accept(this, arg); - } - } else { - n.getInitializer().accept(this, arg); - } - return null; - } - - @Override - public R visit(ArrayInitializerExpr n, A arg) { - if (n.getValues() != null) { - for (Expression expr : n.getValues()) { - expr.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(AssertStmt n, A arg) { - n.getCheck().accept(this, arg); - if (n.getMessage() != null) { - n.getMessage().accept(this, arg); - } - return null; - } - - @Override - public R visit(AssignExpr n, A arg) { - n.getTarget().accept(this, arg); - n.getValue().accept(this, arg); - return null; - } - - @Override - public R visit(BinaryExpr n, A arg) { - n.getLeft().accept(this, arg); - n.getRight().accept(this, arg); - return null; - } - - @Override - public R visit(BlockStmt n, A arg) { - if (n.getStmts() != null) { - for (Statement s : n.getStmts()) { - s.accept(this, arg); - } - } - return null; - - } - - @Override - public R visit(BooleanLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(BreakStmt n, A arg) { - return null; - } - - @Override - public R visit(CastExpr n, A arg) { - n.getType().accept(this, arg); - n.getExpr().accept(this, arg); - return null; - } - - @Override - public R visit(CatchClause n, A arg) { - n.getExcept().accept(this, arg); - n.getCatchBlock().accept(this, arg); - return null; - - } - - @Override - public R visit(CharLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(ClassExpr n, A arg) { - n.getType().accept(this, arg); - return null; - } - - @Override - public R visit(ClassOrInterfaceDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - if (n.getExtends() != null) { - for (ClassOrInterfaceType c : n.getExtends()) { - c.accept(this, arg); - } - } - - if (n.getImplements() != null) { - for (ClassOrInterfaceType c : n.getImplements()) { - c.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(ClassOrInterfaceType n, A arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(CompilationUnit n, A arg) { - if (n.getPakage() != null) { - n.getPakage().accept(this, arg); - } - if (n.getImports() != null) { - for (ImportDeclaration i : n.getImports()) { - i.accept(this, arg); - } - } - if (n.getTypes() != null) { - for (TypeDeclaration typeDeclaration : n.getTypes()) { - typeDeclaration.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(ConditionalExpr n, A arg) { - n.getCondition().accept(this, arg); - n.getThenExpr().accept(this, arg); - n.getElseExpr().accept(this, arg); - return null; - } - - @Override - public R visit(ConstructorDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - if (n.getParameters() != null) { - for (Parameter p : n.getParameters()) { - p.accept(this, arg); - } - } - if (n.getThrows() != null) { - for (NameExpr name : n.getThrows()) { - name.accept(this, arg); - } - } - n.getBlock().accept(this, arg); - return null; - } - - @Override - public R visit(ContinueStmt n, A arg) { - return null; - } - - @Override - public R visit(DoStmt n, A arg) { - n.getBody().accept(this, arg); - n.getCondition().accept(this, arg); - return null; - } - - @Override - public R visit(DoubleLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(EmptyMemberDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - return null; - } - - @Override - public R visit(EmptyStmt n, A arg) { - return null; - } - - @Override - public R visit(EmptyTypeDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - return null; - } - - @Override - public R visit(EnclosedExpr n, A arg) { - n.getInner().accept(this, arg); - return null; - } - - @Override - public R visit(EnumConstantDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - if (n.getClassBody() != null) { - for (BodyDeclaration member : n.getClassBody()) { - member.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(EnumDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getImplements() != null) { - for (ClassOrInterfaceType c : n.getImplements()) { - c.accept(this, arg); - } - } - if (n.getEntries() != null) { - for (EnumConstantDeclaration e : n.getEntries()) { - e.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(ExplicitConstructorInvocationStmt n, A arg) { - if (!n.isThis()) { - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - } - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(ExpressionStmt n, A arg) { - n.getExpression().accept(this, arg); - return null; - } - - @Override - public R visit(FieldAccessExpr n, A arg) { - n.getScope().accept(this, arg); - return null; - } - - @Override - public R visit(FieldDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - for (VariableDeclarator var : n.getVariables()) { - var.accept(this, arg); - } - return null; - } - - @Override - public R visit(ForeachStmt n, A arg) { - n.getVariable().accept(this, arg); - n.getIterable().accept(this, arg); - n.getBody().accept(this, arg); - return null; - } - - @Override - public R visit(ForStmt n, A arg) { - if (n.getInit() != null) { - for (Expression e : n.getInit()) { - e.accept(this, arg); - } - } - if (n.getCompare() != null) { - n.getCompare().accept(this, arg); - } - if (n.getUpdate() != null) { - for (Expression e : n.getUpdate()) { - e.accept(this, arg); - } - } - n.getBody().accept(this, arg); - return null; - } - - @Override - public R visit(IfStmt n, A arg) { - n.getCondition().accept(this, arg); - n.getThenStmt().accept(this, arg); - if (n.getElseStmt() != null) { - n.getElseStmt().accept(this, arg); - } - return null; - } - - @Override - public R visit(ImportDeclaration n, A arg) { - n.getName().accept(this, arg); - return null; - } - - @Override - public R visit(InitializerDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - n.getBlock().accept(this, arg); - return null; - } - - @Override - public R visit(InstanceOfExpr n, A arg) { - n.getExpr().accept(this, arg); - n.getType().accept(this, arg); - return null; - } - - @Override - public R visit(IntegerLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(IntegerLiteralMinValueExpr n, A arg) { - return null; - } - - @Override - public R visit(JavadocComment n, A arg) { - return null; - } - - @Override - public R visit(LabeledStmt n, A arg) { - n.getStmt().accept(this, arg); - return null; - } - - @Override - public R visit(LongLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(LongLiteralMinValueExpr n, A arg) { - return null; - } - - @Override - public R visit(MarkerAnnotationExpr n, A arg) { - n.getName().accept(this, arg); - return null; - } - - @Override - public R visit(MemberValuePair n, A arg) { - n.getValue().accept(this, arg); - return null; - } - - @Override - public R visit(MethodCallExpr n, A arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(MethodDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getParameters() != null) { - for (Parameter p : n.getParameters()) { - p.accept(this, arg); - } - } - if (n.getThrows() != null) { - for (NameExpr name : n.getThrows()) { - name.accept(this, arg); - } - } - if (n.getBody() != null) { - n.getBody().accept(this, arg); - } - return null; - } - - @Override - public R visit(NameExpr n, A arg) { - return null; - } - - @Override - public R visit(NormalAnnotationExpr n, A arg) { - n.getName().accept(this, arg); - if (n.getPairs() != null) { - for (MemberValuePair m : n.getPairs()) { - m.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(NullLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(ObjectCreationExpr n, A arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - if (n.getAnonymousClassBody() != null) { - for (BodyDeclaration member : n.getAnonymousClassBody()) { - member.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(PackageDeclaration n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getName().accept(this, arg); - return null; - } - - @Override - public R visit(Parameter n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - n.getId().accept(this, arg); - return null; - } - - @Override - public R visit(PrimitiveType n, A arg) { - return null; - } - - @Override - public R visit(QualifiedNameExpr n, A arg) { - n.getQualifier().accept(this, arg); - return null; - } - - @Override - public R visit(ReferenceType n, A arg) { - n.getType().accept(this, arg); - return null; - } - - @Override - public R visit(ReturnStmt n, A arg) { - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - } - return null; - } - - @Override - public R visit(SingleMemberAnnotationExpr n, A arg) { - n.getName().accept(this, arg); - n.getMemberValue().accept(this, arg); - return null; - } - - @Override - public R visit(StringLiteralExpr n, A arg) { - return null; - } - - @Override - public R visit(SuperExpr n, A arg) { - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - } - return null; - } - - @Override - public R visit(SwitchEntryStmt n, A arg) { - if (n.getLabel() != null) { - n.getLabel().accept(this, arg); - } - if (n.getStmts() != null) { - for (Statement s : n.getStmts()) { - s.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(SwitchStmt n, A arg) { - n.getSelector().accept(this, arg); - if (n.getEntries() != null) { - for (SwitchEntryStmt e : n.getEntries()) { - e.accept(this, arg); - } - } - return null; - - } - - @Override - public R visit(SynchronizedStmt n, A arg) { - n.getExpr().accept(this, arg); - n.getBlock().accept(this, arg); - return null; - } - - @Override - public R visit(ThisExpr n, A arg) { - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - } - return null; - } - - @Override - public R visit(ThrowStmt n, A arg) { - n.getExpr().accept(this, arg); - return null; - } - - @Override - public R visit(TryStmt n, A arg) { - n.getTryBlock().accept(this, arg); - if (n.getCatchs() != null) { - for (CatchClause c : n.getCatchs()) { - c.accept(this, arg); - } - } - if (n.getFinallyBlock() != null) { - n.getFinallyBlock().accept(this, arg); - } - return null; - } - - @Override - public R visit(TypeDeclarationStmt n, A arg) { - n.getTypeDeclaration().accept(this, arg); - return null; - } - - @Override - public R visit(TypeParameter n, A arg) { - if (n.getTypeBound() != null) { - for (ClassOrInterfaceType c : n.getTypeBound()) { - c.accept(this, arg); - } - } - return null; - } - - @Override - public R visit(UnaryExpr n, A arg) { - n.getExpr().accept(this, arg); - return null; - } - - @Override - public R visit(VariableDeclarationExpr n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - for (VariableDeclarator v : n.getVars()) { - v.accept(this, arg); - } - return null; - } - - @Override - public R visit(VariableDeclarator n, A arg) { - n.getId().accept(this, arg); - if (n.getInit() != null) { - n.getInit().accept(this, arg); - } - return null; - } - - @Override - public R visit(VariableDeclaratorId n, A arg) { - return null; - } - - @Override - public R visit(VoidType n, A arg) { - return null; - } - - @Override - public R visit(WhileStmt n, A arg) { - n.getCondition().accept(this, arg); - n.getBody().accept(this, arg); - return null; - } - - @Override - public R visit(WildcardType n, A arg) { - if (n.getExtends() != null) { - n.getExtends().accept(this, arg); - } - if (n.getSuper() != null) { - n.getSuper().accept(this, arg); - } - return null; - } - - @Override - public R visit(BlockComment n, A arg) { - return null; - } - - @Override - public R visit(LineComment n, A arg) { - return null; - } - - @Override - public R visit(Node n, A arg) { - throw new IllegalStateException(n.getClass().getName()); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitor.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitor.java deleted file mode 100644 index 4996631b4be..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitor.java +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (C) 2007 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 05/10/2006 - */ -package japa.parser.ast.visitor; - -import japa.parser.ast.BlockComment; -import japa.parser.ast.CompilationUnit; -import japa.parser.ast.ImportDeclaration; -import japa.parser.ast.LineComment; -import japa.parser.ast.Node; -import japa.parser.ast.PackageDeclaration; -import japa.parser.ast.TypeParameter; -import japa.parser.ast.body.AnnotationDeclaration; -import japa.parser.ast.body.AnnotationMemberDeclaration; -import japa.parser.ast.body.ClassOrInterfaceDeclaration; -import japa.parser.ast.body.ConstructorDeclaration; -import japa.parser.ast.body.EmptyMemberDeclaration; -import japa.parser.ast.body.EmptyTypeDeclaration; -import japa.parser.ast.body.EnumConstantDeclaration; -import japa.parser.ast.body.EnumDeclaration; -import japa.parser.ast.body.FieldDeclaration; -import japa.parser.ast.body.InitializerDeclaration; -import japa.parser.ast.body.JavadocComment; -import japa.parser.ast.body.MethodDeclaration; -import japa.parser.ast.body.Parameter; -import japa.parser.ast.body.VariableDeclarator; -import japa.parser.ast.body.VariableDeclaratorId; -import japa.parser.ast.expr.ArrayAccessExpr; -import japa.parser.ast.expr.ArrayCreationExpr; -import japa.parser.ast.expr.ArrayInitializerExpr; -import japa.parser.ast.expr.AssignExpr; -import japa.parser.ast.expr.BinaryExpr; -import japa.parser.ast.expr.BooleanLiteralExpr; -import japa.parser.ast.expr.CastExpr; -import japa.parser.ast.expr.CharLiteralExpr; -import japa.parser.ast.expr.ClassExpr; -import japa.parser.ast.expr.ConditionalExpr; -import japa.parser.ast.expr.DoubleLiteralExpr; -import japa.parser.ast.expr.EnclosedExpr; -import japa.parser.ast.expr.FieldAccessExpr; -import japa.parser.ast.expr.InstanceOfExpr; -import japa.parser.ast.expr.IntegerLiteralExpr; -import japa.parser.ast.expr.IntegerLiteralMinValueExpr; -import japa.parser.ast.expr.LongLiteralExpr; -import japa.parser.ast.expr.LongLiteralMinValueExpr; -import japa.parser.ast.expr.MarkerAnnotationExpr; -import japa.parser.ast.expr.MemberValuePair; -import japa.parser.ast.expr.MethodCallExpr; -import japa.parser.ast.expr.NameExpr; -import japa.parser.ast.expr.NormalAnnotationExpr; -import japa.parser.ast.expr.NullLiteralExpr; -import japa.parser.ast.expr.ObjectCreationExpr; -import japa.parser.ast.expr.QualifiedNameExpr; -import japa.parser.ast.expr.SingleMemberAnnotationExpr; -import japa.parser.ast.expr.StringLiteralExpr; -import japa.parser.ast.expr.SuperExpr; -import japa.parser.ast.expr.ThisExpr; -import japa.parser.ast.expr.UnaryExpr; -import japa.parser.ast.expr.VariableDeclarationExpr; -import japa.parser.ast.stmt.AssertStmt; -import japa.parser.ast.stmt.BlockStmt; -import japa.parser.ast.stmt.BreakStmt; -import japa.parser.ast.stmt.CatchClause; -import japa.parser.ast.stmt.ContinueStmt; -import japa.parser.ast.stmt.DoStmt; -import japa.parser.ast.stmt.EmptyStmt; -import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; -import japa.parser.ast.stmt.ExpressionStmt; -import japa.parser.ast.stmt.ForStmt; -import japa.parser.ast.stmt.ForeachStmt; -import japa.parser.ast.stmt.IfStmt; -import japa.parser.ast.stmt.LabeledStmt; -import japa.parser.ast.stmt.ReturnStmt; -import japa.parser.ast.stmt.SwitchEntryStmt; -import japa.parser.ast.stmt.SwitchStmt; -import japa.parser.ast.stmt.SynchronizedStmt; -import japa.parser.ast.stmt.ThrowStmt; -import japa.parser.ast.stmt.TryStmt; -import japa.parser.ast.stmt.TypeDeclarationStmt; -import japa.parser.ast.stmt.WhileStmt; -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.type.PrimitiveType; -import japa.parser.ast.type.ReferenceType; -import japa.parser.ast.type.VoidType; -import japa.parser.ast.type.WildcardType; - -/** - * @author Julio Vilmar Gesser - */ -public interface VoidVisitor { - - public void visit(Node n, A arg); - - // - Compilation Unit ---------------------------------- - - public void visit(CompilationUnit n, A arg); - - public void visit(PackageDeclaration n, A arg); - - public void visit(ImportDeclaration n, A arg); - - public void visit(TypeParameter n, A arg); - - public void visit(LineComment n, A arg); - - public void visit(BlockComment n, A arg); - - // - Body ---------------------------------------------- - - public void visit(ClassOrInterfaceDeclaration n, A arg); - - public void visit(EnumDeclaration n, A arg); - - public void visit(EmptyTypeDeclaration n, A arg); - - public void visit(EnumConstantDeclaration n, A arg); - - public void visit(AnnotationDeclaration n, A arg); - - public void visit(AnnotationMemberDeclaration n, A arg); - - public void visit(FieldDeclaration n, A arg); - - public void visit(VariableDeclarator n, A arg); - - public void visit(VariableDeclaratorId n, A arg); - - public void visit(ConstructorDeclaration n, A arg); - - public void visit(MethodDeclaration n, A arg); - - public void visit(Parameter n, A arg); - - public void visit(EmptyMemberDeclaration n, A arg); - - public void visit(InitializerDeclaration n, A arg); - - public void visit(JavadocComment n, A arg); - - // - Type ---------------------------------------------- - - public void visit(ClassOrInterfaceType n, A arg); - - public void visit(PrimitiveType n, A arg); - - public void visit(ReferenceType n, A arg); - - public void visit(VoidType n, A arg); - - public void visit(WildcardType n, A arg); - - // - Expression ---------------------------------------- - - public void visit(ArrayAccessExpr n, A arg); - - public void visit(ArrayCreationExpr n, A arg); - - public void visit(ArrayInitializerExpr n, A arg); - - public void visit(AssignExpr n, A arg); - - public void visit(BinaryExpr n, A arg); - - public void visit(CastExpr n, A arg); - - public void visit(ClassExpr n, A arg); - - public void visit(ConditionalExpr n, A arg); - - public void visit(EnclosedExpr n, A arg); - - public void visit(FieldAccessExpr n, A arg); - - public void visit(InstanceOfExpr n, A arg); - - public void visit(StringLiteralExpr n, A arg); - - public void visit(IntegerLiteralExpr n, A arg); - - public void visit(LongLiteralExpr n, A arg); - - public void visit(IntegerLiteralMinValueExpr n, A arg); - - public void visit(LongLiteralMinValueExpr n, A arg); - - public void visit(CharLiteralExpr n, A arg); - - public void visit(DoubleLiteralExpr n, A arg); - - public void visit(BooleanLiteralExpr n, A arg); - - public void visit(NullLiteralExpr n, A arg); - - public void visit(MethodCallExpr n, A arg); - - public void visit(NameExpr n, A arg); - - public void visit(ObjectCreationExpr n, A arg); - - public void visit(QualifiedNameExpr n, A arg); - - public void visit(ThisExpr n, A arg); - - public void visit(SuperExpr n, A arg); - - public void visit(UnaryExpr n, A arg); - - public void visit(VariableDeclarationExpr n, A arg); - - public void visit(MarkerAnnotationExpr n, A arg); - - public void visit(SingleMemberAnnotationExpr n, A arg); - - public void visit(NormalAnnotationExpr n, A arg); - - public void visit(MemberValuePair n, A arg); - - // - Statements ---------------------------------------- - - public void visit(ExplicitConstructorInvocationStmt n, A arg); - - public void visit(TypeDeclarationStmt n, A arg); - - public void visit(AssertStmt n, A arg); - - public void visit(BlockStmt n, A arg); - - public void visit(LabeledStmt n, A arg); - - public void visit(EmptyStmt n, A arg); - - public void visit(ExpressionStmt n, A arg); - - public void visit(SwitchStmt n, A arg); - - public void visit(SwitchEntryStmt n, A arg); - - public void visit(BreakStmt n, A arg); - - public void visit(ReturnStmt n, A arg); - - public void visit(IfStmt n, A arg); - - public void visit(WhileStmt n, A arg); - - public void visit(ContinueStmt n, A arg); - - public void visit(DoStmt n, A arg); - - public void visit(ForeachStmt n, A arg); - - public void visit(ForStmt n, A arg); - - public void visit(ThrowStmt n, A arg); - - public void visit(SynchronizedStmt n, A arg); - - public void visit(TryStmt n, A arg); - - public void visit(CatchClause n, A arg); - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitorAdapter.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitorAdapter.java deleted file mode 100644 index ed7af7e364a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitorAdapter.java +++ /dev/null @@ -1,828 +0,0 @@ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -/* - * Created on 09/06/2008 - */ -package japa.parser.ast.visitor; - -import japa.parser.ast.BlockComment; -import japa.parser.ast.CompilationUnit; -import japa.parser.ast.ImportDeclaration; -import japa.parser.ast.LineComment; -import japa.parser.ast.Node; -import japa.parser.ast.PackageDeclaration; -import japa.parser.ast.TypeParameter; -import japa.parser.ast.body.AnnotationDeclaration; -import japa.parser.ast.body.AnnotationMemberDeclaration; -import japa.parser.ast.body.BodyDeclaration; -import japa.parser.ast.body.ClassOrInterfaceDeclaration; -import japa.parser.ast.body.ConstructorDeclaration; -import japa.parser.ast.body.EmptyMemberDeclaration; -import japa.parser.ast.body.EmptyTypeDeclaration; -import japa.parser.ast.body.EnumConstantDeclaration; -import japa.parser.ast.body.EnumDeclaration; -import japa.parser.ast.body.FieldDeclaration; -import japa.parser.ast.body.InitializerDeclaration; -import japa.parser.ast.body.JavadocComment; -import japa.parser.ast.body.MethodDeclaration; -import japa.parser.ast.body.Parameter; -import japa.parser.ast.body.TypeDeclaration; -import japa.parser.ast.body.VariableDeclarator; -import japa.parser.ast.body.VariableDeclaratorId; -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.expr.ArrayAccessExpr; -import japa.parser.ast.expr.ArrayCreationExpr; -import japa.parser.ast.expr.ArrayInitializerExpr; -import japa.parser.ast.expr.AssignExpr; -import japa.parser.ast.expr.BinaryExpr; -import japa.parser.ast.expr.BooleanLiteralExpr; -import japa.parser.ast.expr.CastExpr; -import japa.parser.ast.expr.CharLiteralExpr; -import japa.parser.ast.expr.ClassExpr; -import japa.parser.ast.expr.ConditionalExpr; -import japa.parser.ast.expr.DoubleLiteralExpr; -import japa.parser.ast.expr.EnclosedExpr; -import japa.parser.ast.expr.Expression; -import japa.parser.ast.expr.FieldAccessExpr; -import japa.parser.ast.expr.InstanceOfExpr; -import japa.parser.ast.expr.IntegerLiteralExpr; -import japa.parser.ast.expr.IntegerLiteralMinValueExpr; -import japa.parser.ast.expr.LongLiteralExpr; -import japa.parser.ast.expr.LongLiteralMinValueExpr; -import japa.parser.ast.expr.MarkerAnnotationExpr; -import japa.parser.ast.expr.MemberValuePair; -import japa.parser.ast.expr.MethodCallExpr; -import japa.parser.ast.expr.NameExpr; -import japa.parser.ast.expr.NormalAnnotationExpr; -import japa.parser.ast.expr.NullLiteralExpr; -import japa.parser.ast.expr.ObjectCreationExpr; -import japa.parser.ast.expr.QualifiedNameExpr; -import japa.parser.ast.expr.SingleMemberAnnotationExpr; -import japa.parser.ast.expr.StringLiteralExpr; -import japa.parser.ast.expr.SuperExpr; -import japa.parser.ast.expr.ThisExpr; -import japa.parser.ast.expr.UnaryExpr; -import japa.parser.ast.expr.VariableDeclarationExpr; -import japa.parser.ast.stmt.AssertStmt; -import japa.parser.ast.stmt.BlockStmt; -import japa.parser.ast.stmt.BreakStmt; -import japa.parser.ast.stmt.CatchClause; -import japa.parser.ast.stmt.ContinueStmt; -import japa.parser.ast.stmt.DoStmt; -import japa.parser.ast.stmt.EmptyStmt; -import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; -import japa.parser.ast.stmt.ExpressionStmt; -import japa.parser.ast.stmt.ForStmt; -import japa.parser.ast.stmt.ForeachStmt; -import japa.parser.ast.stmt.IfStmt; -import japa.parser.ast.stmt.LabeledStmt; -import japa.parser.ast.stmt.ReturnStmt; -import japa.parser.ast.stmt.Statement; -import japa.parser.ast.stmt.SwitchEntryStmt; -import japa.parser.ast.stmt.SwitchStmt; -import japa.parser.ast.stmt.SynchronizedStmt; -import japa.parser.ast.stmt.ThrowStmt; -import japa.parser.ast.stmt.TryStmt; -import japa.parser.ast.stmt.TypeDeclarationStmt; -import japa.parser.ast.stmt.WhileStmt; -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.type.PrimitiveType; -import japa.parser.ast.type.ReferenceType; -import japa.parser.ast.type.Type; -import japa.parser.ast.type.VoidType; -import japa.parser.ast.type.WildcardType; - -/** - * @author Julio Vilmar Gesser - */ -public class VoidVisitorAdapter implements VoidVisitor { - - @Override - public void visit(AnnotationDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(AnnotationMemberDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getDefaultValue() != null) { - n.getDefaultValue().accept(this, arg); - } - } - - @Override - public void visit(ArrayAccessExpr n, A arg) { - n.getName().accept(this, arg); - n.getIndex().accept(this, arg); - } - - @Override - public void visit(ArrayCreationExpr n, A arg) { - n.getType().accept(this, arg); - if (n.getDimensions() != null) { - for (Expression dim : n.getDimensions()) { - dim.accept(this, arg); - } - } else { - n.getInitializer().accept(this, arg); - } - } - - @Override - public void visit(ArrayInitializerExpr n, A arg) { - if (n.getValues() != null) { - for (Expression expr : n.getValues()) { - expr.accept(this, arg); - } - } - } - - @Override - public void visit(AssertStmt n, A arg) { - n.getCheck().accept(this, arg); - if (n.getMessage() != null) { - n.getMessage().accept(this, arg); - } - } - - @Override - public void visit(AssignExpr n, A arg) { - n.getTarget().accept(this, arg); - n.getValue().accept(this, arg); - } - - @Override - public void visit(BinaryExpr n, A arg) { - n.getLeft().accept(this, arg); - n.getRight().accept(this, arg); - } - - @Override - public void visit(BlockComment n, A arg) { - } - - @Override - public void visit(BlockStmt n, A arg) { - if (n.getStmts() != null) { - for (Statement s : n.getStmts()) { - s.accept(this, arg); - } - } - } - - @Override - public void visit(BooleanLiteralExpr n, A arg) { - } - - @Override - public void visit(BreakStmt n, A arg) { - } - - @Override - public void visit(CastExpr n, A arg) { - n.getType().accept(this, arg); - n.getExpr().accept(this, arg); - } - - @Override - public void visit(CatchClause n, A arg) { - n.getExcept().accept(this, arg); - n.getCatchBlock().accept(this, arg); - } - - @Override - public void visit(CharLiteralExpr n, A arg) { - } - - @Override - public void visit(ClassExpr n, A arg) { - n.getType().accept(this, arg); - } - - @Override - public void visit(ClassOrInterfaceDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - if (n.getExtends() != null) { - for (ClassOrInterfaceType c : n.getExtends()) { - c.accept(this, arg); - } - } - - if (n.getImplements() != null) { - for (ClassOrInterfaceType c : n.getImplements()) { - c.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(ClassOrInterfaceType n, A arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - } - - @Override - public void visit(CompilationUnit n, A arg) { - if (n.getPakage() != null) { - n.getPakage().accept(this, arg); - } - if (n.getImports() != null) { - for (ImportDeclaration i : n.getImports()) { - i.accept(this, arg); - } - } - if (n.getTypes() != null) { - for (TypeDeclaration typeDeclaration : n.getTypes()) { - typeDeclaration.accept(this, arg); - } - } - } - - @Override - public void visit(ConditionalExpr n, A arg) { - n.getCondition().accept(this, arg); - n.getThenExpr().accept(this, arg); - n.getElseExpr().accept(this, arg); - } - - @Override - public void visit(ConstructorDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - if (n.getParameters() != null) { - for (Parameter p : n.getParameters()) { - p.accept(this, arg); - } - } - if (n.getThrows() != null) { - for (NameExpr name : n.getThrows()) { - name.accept(this, arg); - } - } - n.getBlock().accept(this, arg); - } - - @Override - public void visit(ContinueStmt n, A arg) { - } - - @Override - public void visit(DoStmt n, A arg) { - n.getBody().accept(this, arg); - n.getCondition().accept(this, arg); - } - - @Override - public void visit(DoubleLiteralExpr n, A arg) { - } - - @Override - public void visit(EmptyMemberDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - } - - @Override - public void visit(EmptyStmt n, A arg) { - } - - @Override - public void visit(EmptyTypeDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - } - - @Override - public void visit(EnclosedExpr n, A arg) { - n.getInner().accept(this, arg); - } - - @Override - public void visit(EnumConstantDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - if (n.getClassBody() != null) { - for (BodyDeclaration member : n.getClassBody()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(EnumDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getImplements() != null) { - for (ClassOrInterfaceType c : n.getImplements()) { - c.accept(this, arg); - } - } - if (n.getEntries() != null) { - for (EnumConstantDeclaration e : n.getEntries()) { - e.accept(this, arg); - } - } - if (n.getMembers() != null) { - for (BodyDeclaration member : n.getMembers()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(ExplicitConstructorInvocationStmt n, A arg) { - if (!n.isThis()) { - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - } - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - } - - @Override - public void visit(ExpressionStmt n, A arg) { - n.getExpression().accept(this, arg); - } - - @Override - public void visit(FieldAccessExpr n, A arg) { - n.getScope().accept(this, arg); - } - - @Override - public void visit(FieldDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - for (VariableDeclarator var : n.getVariables()) { - var.accept(this, arg); - } - } - - @Override - public void visit(ForeachStmt n, A arg) { - n.getVariable().accept(this, arg); - n.getIterable().accept(this, arg); - n.getBody().accept(this, arg); - } - - @Override - public void visit(ForStmt n, A arg) { - if (n.getInit() != null) { - for (Expression e : n.getInit()) { - e.accept(this, arg); - } - } - if (n.getCompare() != null) { - n.getCompare().accept(this, arg); - } - if (n.getUpdate() != null) { - for (Expression e : n.getUpdate()) { - e.accept(this, arg); - } - } - n.getBody().accept(this, arg); - } - - @Override - public void visit(IfStmt n, A arg) { - n.getCondition().accept(this, arg); - n.getThenStmt().accept(this, arg); - if (n.getElseStmt() != null) { - n.getElseStmt().accept(this, arg); - } - } - - @Override - public void visit(ImportDeclaration n, A arg) { - n.getName().accept(this, arg); - } - - @Override - public void visit(InitializerDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - n.getBlock().accept(this, arg); - } - - @Override - public void visit(InstanceOfExpr n, A arg) { - n.getExpr().accept(this, arg); - n.getType().accept(this, arg); - } - - @Override - public void visit(IntegerLiteralExpr n, A arg) { - } - - @Override - public void visit(IntegerLiteralMinValueExpr n, A arg) { - } - - @Override - public void visit(JavadocComment n, A arg) { - } - - @Override - public void visit(LabeledStmt n, A arg) { - n.getStmt().accept(this, arg); - } - - @Override - public void visit(LineComment n, A arg) { - } - - @Override - public void visit(LongLiteralExpr n, A arg) { - } - - @Override - public void visit(LongLiteralMinValueExpr n, A arg) { - } - - @Override - public void visit(MarkerAnnotationExpr n, A arg) { - n.getName().accept(this, arg); - } - - @Override - public void visit(MemberValuePair n, A arg) { - n.getValue().accept(this, arg); - } - - @Override - public void visit(MethodCallExpr n, A arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - } - - @Override - public void visit(MethodDeclaration n, A arg) { - if (n.getJavaDoc() != null) { - n.getJavaDoc().accept(this, arg); - } - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - if (n.getTypeParameters() != null) { - for (TypeParameter t : n.getTypeParameters()) { - t.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getParameters() != null) { - for (Parameter p : n.getParameters()) { - p.accept(this, arg); - } - } - if (n.getThrows() != null) { - for (NameExpr name : n.getThrows()) { - name.accept(this, arg); - } - } - if (n.getBody() != null) { - n.getBody().accept(this, arg); - } - } - - @Override - public void visit(NameExpr n, A arg) { - } - - @Override - public void visit(Node n, A arg) { - throw new IllegalStateException(n.getClass().getName()); - } - - @Override - public void visit(NormalAnnotationExpr n, A arg) { - n.getName().accept(this, arg); - if (n.getPairs() != null) { - for (MemberValuePair m : n.getPairs()) { - m.accept(this, arg); - } - } - } - - @Override - public void visit(NullLiteralExpr n, A arg) { - } - - @Override - public void visit(ObjectCreationExpr n, A arg) { - if (n.getScope() != null) { - n.getScope().accept(this, arg); - } - if (n.getTypeArgs() != null) { - for (Type t : n.getTypeArgs()) { - t.accept(this, arg); - } - } - n.getType().accept(this, arg); - if (n.getArgs() != null) { - for (Expression e : n.getArgs()) { - e.accept(this, arg); - } - } - if (n.getAnonymousClassBody() != null) { - for (BodyDeclaration member : n.getAnonymousClassBody()) { - member.accept(this, arg); - } - } - } - - @Override - public void visit(PackageDeclaration n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getName().accept(this, arg); - } - - @Override - public void visit(Parameter n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - n.getId().accept(this, arg); - } - - @Override - public void visit(PrimitiveType n, A arg) { - } - - @Override - public void visit(QualifiedNameExpr n, A arg) { - n.getQualifier().accept(this, arg); - } - - @Override - public void visit(ReferenceType n, A arg) { - n.getType().accept(this, arg); - } - - @Override - public void visit(ReturnStmt n, A arg) { - if (n.getExpr() != null) { - n.getExpr().accept(this, arg); - } - } - - @Override - public void visit(SingleMemberAnnotationExpr n, A arg) { - n.getName().accept(this, arg); - n.getMemberValue().accept(this, arg); - } - - @Override - public void visit(StringLiteralExpr n, A arg) { - } - - @Override - public void visit(SuperExpr n, A arg) { - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - } - } - - @Override - public void visit(SwitchEntryStmt n, A arg) { - if (n.getLabel() != null) { - n.getLabel().accept(this, arg); - } - if (n.getStmts() != null) { - for (Statement s : n.getStmts()) { - s.accept(this, arg); - } - } - } - - @Override - public void visit(SwitchStmt n, A arg) { - n.getSelector().accept(this, arg); - if (n.getEntries() != null) { - for (SwitchEntryStmt e : n.getEntries()) { - e.accept(this, arg); - } - } - } - - @Override - public void visit(SynchronizedStmt n, A arg) { - n.getExpr().accept(this, arg); - n.getBlock().accept(this, arg); - - } - - @Override - public void visit(ThisExpr n, A arg) { - if (n.getClassExpr() != null) { - n.getClassExpr().accept(this, arg); - } - } - - @Override - public void visit(ThrowStmt n, A arg) { - n.getExpr().accept(this, arg); - } - - @Override - public void visit(TryStmt n, A arg) { - n.getTryBlock().accept(this, arg); - if (n.getCatchs() != null) { - for (CatchClause c : n.getCatchs()) { - c.accept(this, arg); - } - } - if (n.getFinallyBlock() != null) { - n.getFinallyBlock().accept(this, arg); - } - } - - @Override - public void visit(TypeDeclarationStmt n, A arg) { - n.getTypeDeclaration().accept(this, arg); - } - - @Override - public void visit(TypeParameter n, A arg) { - if (n.getTypeBound() != null) { - for (ClassOrInterfaceType c : n.getTypeBound()) { - c.accept(this, arg); - } - } - } - - @Override - public void visit(UnaryExpr n, A arg) { - n.getExpr().accept(this, arg); - } - - @Override - public void visit(VariableDeclarationExpr n, A arg) { - if (n.getAnnotations() != null) { - for (AnnotationExpr a : n.getAnnotations()) { - a.accept(this, arg); - } - } - n.getType().accept(this, arg); - for (VariableDeclarator v : n.getVars()) { - v.accept(this, arg); - } - } - - @Override - public void visit(VariableDeclarator n, A arg) { - n.getId().accept(this, arg); - if (n.getInit() != null) { - n.getInit().accept(this, arg); - } - } - - @Override - public void visit(VariableDeclaratorId n, A arg) { - } - - @Override - public void visit(VoidType n, A arg) { - } - - @Override - public void visit(WhileStmt n, A arg) { - n.getCondition().accept(this, arg); - n.getBody().accept(this, arg); - } - - @Override - public void visit(WildcardType n, A arg) { - if (n.getExtends() != null) { - n.getExtends().accept(this, arg); - } - if (n.getSuper() != null) { - n.getSuper().accept(this, arg); - } - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/java_1_5.jj b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/java_1_5.jj deleted file mode 100644 index f35074082d9..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/japa/parser/java_1_5.jj +++ /dev/null @@ -1,3006 +0,0 @@ -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ - -options { - LOOKAHEAD=1; - STATIC=false; - JAVA_UNICODE_ESCAPE=true; - COMMON_TOKEN_ACTION=true; - //SUPPORT_CLASS_VISIBILITY_PUBLIC=false; - JDK_VERSION = "1.5"; - TOKEN_FACTORY = "ASTParser.GTToken"; -} - -PARSER_BEGIN(ASTParser) -/* - * Copyright (C) 2008 Júlio Vilmar Gesser. - * - * This file is part of Java 1.5 parser and Abstract Syntax Tree. - * - * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . - */ -package japa.parser; - -import java.io.*; -import java.util.*; -import japa.parser.ast.*; -import japa.parser.ast.body.*; -import japa.parser.ast.expr.*; -import japa.parser.ast.stmt.*; -import japa.parser.ast.type.*; - -/** - *

This class was generated automatically by javacc, do not edit.

- * @author Júlio Vilmar Gesser - */ -final class ASTParser { - - void reset(InputStream in, String encoding) { - ReInit(in, encoding); - token_source.clearComments(); - } - - private List add(List list, Object obj) { - if (list == null) { - list = new LinkedList(); - } - list.add(obj); - return list; - } - - private List add(int pos, List list, Object obj) { - if (list == null) { - list = new LinkedList(); - } - list.add(pos, obj); - return list; - } - - private class Modifier { - - final int modifiers; - final List annotations; - final int beginLine; - final int beginColumn; - - public Modifier(int beginLine, int beginColumn, int modifiers, List annotations) { - this.beginLine = beginLine; - this.beginColumn = beginColumn; - this.modifiers = modifiers; - this.annotations = annotations; - } - } - - public int addModifier(int modifiers, int mod, Token token) throws ParseException { - if ((ModifierSet.hasModifier(modifiers, mod))) { - throwParseException(token, "Duplicated modifier"); - } - return ModifierSet.addModifier(modifiers, mod); - } - - private void pushJavadoc() { - token_source.pushJavadoc(); - } - - private JavadocComment popJavadoc() { - return token_source.popJavadoc(); - } - - private List getComments() { - return token_source.getComments(); - } - - private void throwParseException(Token token, String message) throws ParseException { - StringBuilder buf = new StringBuilder(); - buf.append(message); - buf.append(": \""); - buf.append(token.image); - buf.append("\" at line "); - buf.append(token.beginLine); - buf.append(", column "); - buf.append(token.beginColumn); - ParseException e = new ParseException(buf.toString()); - e.currentToken = token; - throw e; - } - - static final class GTToken extends Token { - - int realKind = ASTParserConstants.GT; - - GTToken(int kind, String image) { - this.kind = kind; - this.image = image; - } - - public static Token newToken(int kind, String image) { - return new GTToken(kind, image); - } - } -} - -PARSER_END(ASTParser) - -/* WHITE SPACE */ - -SKIP : -{ - " " -| "\t" -| "\n" -| "\r" -| "\f" -} - -/* COMMENTS */ - -TOKEN_MGR_DECLS : -{ - private List comments; - private final Stack javadocStack = new Stack(); - private JavadocComment lastJavadoc; - - void pushJavadoc() { - javadocStack.push(lastJavadoc); - } - - JavadocComment popJavadoc() { - return javadocStack.pop(); - } - - List getComments() { - return comments; - } - - void clearComments() { - comments = null; - javadocStack.clear(); - lastJavadoc = null; - } - - private void CommonTokenAction(Token token) { - lastJavadoc = null; - if (token.specialToken != null) { - if(comments == null) { - comments = new LinkedList(); - } - Token special = token.specialToken; - if(special.kind == JAVA_DOC_COMMENT) { - lastJavadoc = new JavadocComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(3, special.image.length()-2)); - comments.add(lastJavadoc); - } else if(special.kind == SINGLE_LINE_COMMENT) { - LineComment comment = new LineComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2)); - comments.add(comment); - } else if(special.kind == MULTI_LINE_COMMENT) { - BlockComment comment = new BlockComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2, special.image.length()-2)); - comments.add(comment); - } - } - } -} - -SPECIAL_TOKEN : -{ - -} - -MORE : -{ - <"/**" ~["/"]> { input_stream.backup(1); } : IN_JAVA_DOC_COMMENT -| - <"/*"> : IN_MULTI_LINE_COMMENT -} - - -SPECIAL_TOKEN : -{ - : DEFAULT -} - - -SPECIAL_TOKEN : -{ - : DEFAULT -} - - -MORE : -{ - < ~[] > -} - -/* RESERVED WORDS AND LITERALS */ - -TOKEN : -{ - < ABSTRACT: "abstract" > -| < ASSERT: "assert" > -| < BOOLEAN: "boolean" > -| < BREAK: "break" > -| < BYTE: "byte" > -| < CASE: "case" > -| < CATCH: "catch" > -| < CHAR: "char" > -| < CLASS: "class" > -| < CONST: "const" > -| < CONTINUE: "continue" > -| < _DEFAULT: "default" > -| < DO: "do" > -| < DOUBLE: "double" > -| < ELSE: "else" > -| < ENUM: "enum" > -| < EXTENDS: "extends" > -| < FALSE: "false" > -| < FINAL: "final" > -| < FINALLY: "finally" > -| < FLOAT: "float" > -| < FOR: "for" > -| < GOTO: "goto" > -| < IF: "if" > -| < IMPLEMENTS: "implements" > -| < IMPORT: "import" > -| < INSTANCEOF: "instanceof" > -| < INT: "int" > -| < INTERFACE: "interface" > -| < LONG: "long" > -| < NATIVE: "native" > -| < NEW: "new" > -| < NULL: "null" > -| < PACKAGE: "package"> -| < PRIVATE: "private" > -| < PROTECTED: "protected" > -| < PUBLIC: "public" > -| < RETURN: "return" > -| < SHORT: "short" > -| < STATIC: "static" > -| < STRICTFP: "strictfp" > -| < SUPER: "super" > -| < SWITCH: "switch" > -| < SYNCHRONIZED: "synchronized" > -| < THIS: "this" > -| < THROW: "throw" > -| < THROWS: "throws" > -| < TRANSIENT: "transient" > -| < TRUE: "true" > -| < TRY: "try" > -| < VOID: "void" > -| < VOLATILE: "volatile" > -| < WHILE: "while" > -} - -/* LITERALS */ - -TOKEN : -{ - < LONG_LITERAL: - (["l","L"]) - | (["l","L"]) - | (["l","L"]) - > -| - < INTEGER_LITERAL: - - | - | - > -| - < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* > -| - < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ > -| - < #OCTAL_LITERAL: "0" (["0"-"7"])* > -| - < FLOATING_POINT_LITERAL: - - | - > -| - < #DECIMAL_FLOATING_POINT_LITERAL: - (["0"-"9"])+ "." (["0"-"9"])* ()? (["f","F","d","D"])? - | "." (["0"-"9"])+ ()? (["f","F","d","D"])? - | (["0"-"9"])+ (["f","F","d","D"])? - | (["0"-"9"])+ ()? ["f","F","d","D"] - > -| - < #DECIMAL_EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ > -| - < #HEXADECIMAL_FLOATING_POINT_LITERAL: - "0" ["x", "X"] (["0"-"9","a"-"f","A"-"F"])+ (".")? (["f","F","d","D"])? - | "0" ["x", "X"] (["0"-"9","a"-"f","A"-"F"])* "." (["0"-"9","a"-"f","A"-"F"])+ (["f","F","d","D"])? - > -| - < #HEXADECIMAL_EXPONENT: ["p","P"] (["+","-"])? (["0"-"9"])+ > -| - < CHARACTER_LITERAL: - "'" - ( (~["'","\\","\n","\r"]) - | ("\\" - ( ["n","t","b","r","f","\\","'","\""] - | ["0"-"7"] ( ["0"-"7"] )? - | ["0"-"3"] ["0"-"7"] ["0"-"7"] - ) - ) - | ("\\u" - ["0"-"9","A"-"F","a"-"f"] - ["0"-"9","A"-"F","a"-"f"] - ["0"-"9","A"-"F","a"-"f"] - ["0"-"9","A"-"F","a"-"f"] - ) - ) - "'" - > -| - < STRING_LITERAL: - "\"" - ( (~["\"","\\","\n","\r"]) - | ("\\" - ( ["n","t","b","r","f","\\","'","\""] - | ["0"-"7"] ( ["0"-"7"] )? - | ["0"-"3"] ["0"-"7"] ["0"-"7"] - ) - ) - | ("\\u" - ["0"-"9","A"-"F","a"-"f"] - ["0"-"9","A"-"F","a"-"f"] - ["0"-"9","A"-"F","a"-"f"] - ["0"-"9","A"-"F","a"-"f"] - ) - )* - "\"" - > -} - -/* IDENTIFIERS */ - -TOKEN : -{ - < IDENTIFIER: ()* > -| - < #LETTER: - [ // all chars for which Character.isIdentifierStart is true - "\u0024", // "$" - "\u0041"-"\u005a", // "A"-"Z" - "\u005f", // "_" - "\u0061"-"\u007a", // "a"-"z" - "\u00a2"-"\u00a5", - "\u00aa", - "\u00b5", - "\u00ba", - "\u00c0"-"\u00d6", - "\u00d8"-"\u00f6", - "\u00f8"-"\u0236", - "\u0250"-"\u02c1", - "\u02c6"-"\u02d1", - "\u02e0"-"\u02e4", - "\u02ee", - "\u037a", - "\u0386", - "\u0388"-"\u038a", - "\u038c", - "\u038e"-"\u03a1", - "\u03a3"-"\u03ce", - "\u03d0"-"\u03f5", - "\u03f7"-"\u03fb", - "\u0400"-"\u0481", - "\u048a"-"\u04ce", - "\u04d0"-"\u04f5", - "\u04f8"-"\u04f9", - "\u0500"-"\u050f", - "\u0531"-"\u0556", - "\u0559", - "\u0561"-"\u0587", - "\u05d0"-"\u05ea", - "\u05f0"-"\u05f2", - "\u0621"-"\u063a", - "\u0640"-"\u064a", - "\u066e"-"\u066f", - "\u0671"-"\u06d3", - "\u06d5", - "\u06e5"-"\u06e6", - "\u06ee"-"\u06ef", - "\u06fa"-"\u06fc", - "\u06ff", - "\u0710", - "\u0712"-"\u072f", - "\u074d"-"\u074f", - "\u0780"-"\u07a5", - "\u07b1", - "\u0904"-"\u0939", - "\u093d", - "\u0950", - "\u0958"-"\u0961", - "\u0985"-"\u098c", - "\u098f"-"\u0990", - "\u0993"-"\u09a8", - "\u09aa"-"\u09b0", - "\u09b2", - "\u09b6"-"\u09b9", - "\u09bd", - "\u09dc"-"\u09dd", - "\u09df"-"\u09e1", - "\u09f0"-"\u09f3", - "\u0a05"-"\u0a0a", - "\u0a0f"-"\u0a10", - "\u0a13"-"\u0a28", - "\u0a2a"-"\u0a30", - "\u0a32"-"\u0a33", - "\u0a35"-"\u0a36", - "\u0a38"-"\u0a39", - "\u0a59"-"\u0a5c", - "\u0a5e", - "\u0a72"-"\u0a74", - "\u0a85"-"\u0a8d", - "\u0a8f"-"\u0a91", - "\u0a93"-"\u0aa8", - "\u0aaa"-"\u0ab0", - "\u0ab2"-"\u0ab3", - "\u0ab5"-"\u0ab9", - "\u0abd", - "\u0ad0", - "\u0ae0"-"\u0ae1", - "\u0af1", - "\u0b05"-"\u0b0c", - "\u0b0f"-"\u0b10", - "\u0b13"-"\u0b28", - "\u0b2a"-"\u0b30", - "\u0b32"-"\u0b33", - "\u0b35"-"\u0b39", - "\u0b3d", - "\u0b5c"-"\u0b5d", - "\u0b5f"-"\u0b61", - "\u0b71", - "\u0b83", - "\u0b85"-"\u0b8a", - "\u0b8e"-"\u0b90", - "\u0b92"-"\u0b95", - "\u0b99"-"\u0b9a", - "\u0b9c", - "\u0b9e"-"\u0b9f", - "\u0ba3"-"\u0ba4", - "\u0ba8"-"\u0baa", - "\u0bae"-"\u0bb5", - "\u0bb7"-"\u0bb9", - "\u0bf9", - "\u0c05"-"\u0c0c", - "\u0c0e"-"\u0c10", - "\u0c12"-"\u0c28", - "\u0c2a"-"\u0c33", - "\u0c35"-"\u0c39", - "\u0c60"-"\u0c61", - "\u0c85"-"\u0c8c", - "\u0c8e"-"\u0c90", - "\u0c92"-"\u0ca8", - "\u0caa"-"\u0cb3", - "\u0cb5"-"\u0cb9", - "\u0cbd", - "\u0cde", - "\u0ce0"-"\u0ce1", - "\u0d05"-"\u0d0c", - "\u0d0e"-"\u0d10", - "\u0d12"-"\u0d28", - "\u0d2a"-"\u0d39", - "\u0d60"-"\u0d61", - "\u0d85"-"\u0d96", - "\u0d9a"-"\u0db1", - "\u0db3"-"\u0dbb", - "\u0dbd", - "\u0dc0"-"\u0dc6", - "\u0e01"-"\u0e30", - "\u0e32"-"\u0e33", - "\u0e3f"-"\u0e46", - "\u0e81"-"\u0e82", - "\u0e84", - "\u0e87"-"\u0e88", - "\u0e8a", - "\u0e8d", - "\u0e94"-"\u0e97", - "\u0e99"-"\u0e9f", - "\u0ea1"-"\u0ea3", - "\u0ea5", - "\u0ea7", - "\u0eaa"-"\u0eab", - "\u0ead"-"\u0eb0", - "\u0eb2"-"\u0eb3", - "\u0ebd", - "\u0ec0"-"\u0ec4", - "\u0ec6", - "\u0edc"-"\u0edd", - "\u0f00", - "\u0f40"-"\u0f47", - "\u0f49"-"\u0f6a", - "\u0f88"-"\u0f8b", - "\u1000"-"\u1021", - "\u1023"-"\u1027", - "\u1029"-"\u102a", - "\u1050"-"\u1055", - "\u10a0"-"\u10c5", - "\u10d0"-"\u10f8", - "\u1100"-"\u1159", - "\u115f"-"\u11a2", - "\u11a8"-"\u11f9", - "\u1200"-"\u1206", - "\u1208"-"\u1246", - "\u1248", - "\u124a"-"\u124d", - "\u1250"-"\u1256", - "\u1258", - "\u125a"-"\u125d", - "\u1260"-"\u1286", - "\u1288", - "\u128a"-"\u128d", - "\u1290"-"\u12ae", - "\u12b0", - "\u12b2"-"\u12b5", - "\u12b8"-"\u12be", - "\u12c0", - "\u12c2"-"\u12c5", - "\u12c8"-"\u12ce", - "\u12d0"-"\u12d6", - "\u12d8"-"\u12ee", - "\u12f0"-"\u130e", - "\u1310", - "\u1312"-"\u1315", - "\u1318"-"\u131e", - "\u1320"-"\u1346", - "\u1348"-"\u135a", - "\u13a0"-"\u13f4", - "\u1401"-"\u166c", - "\u166f"-"\u1676", - "\u1681"-"\u169a", - "\u16a0"-"\u16ea", - "\u16ee"-"\u16f0", - "\u1700"-"\u170c", - "\u170e"-"\u1711", - "\u1720"-"\u1731", - "\u1740"-"\u1751", - "\u1760"-"\u176c", - "\u176e"-"\u1770", - "\u1780"-"\u17b3", - "\u17d7", - "\u17db"-"\u17dc", - "\u1820"-"\u1877", - "\u1880"-"\u18a8", - "\u1900"-"\u191c", - "\u1950"-"\u196d", - "\u1970"-"\u1974", - "\u1d00"-"\u1d6b", - "\u1e00"-"\u1e9b", - "\u1ea0"-"\u1ef9", - "\u1f00"-"\u1f15", - "\u1f18"-"\u1f1d", - "\u1f20"-"\u1f45", - "\u1f48"-"\u1f4d", - "\u1f50"-"\u1f57", - "\u1f59", - "\u1f5b", - "\u1f5d", - "\u1f5f"-"\u1f7d", - "\u1f80"-"\u1fb4", - "\u1fb6"-"\u1fbc", - "\u1fbe", - "\u1fc2"-"\u1fc4", - "\u1fc6"-"\u1fcc", - "\u1fd0"-"\u1fd3", - "\u1fd6"-"\u1fdb", - "\u1fe0"-"\u1fec", - "\u1ff2"-"\u1ff4", - "\u1ff6"-"\u1ffc", - "\u203f"-"\u2040", - "\u2054", - "\u2071", - "\u207f", - "\u20a0"-"\u20b1", - "\u2102", - "\u2107", - "\u210a"-"\u2113", - "\u2115", - "\u2119"-"\u211d", - "\u2124", - "\u2126", - "\u2128", - "\u212a"-"\u212d", - "\u212f"-"\u2131", - "\u2133"-"\u2139", - "\u213d"-"\u213f", - "\u2145"-"\u2149", - "\u2160"-"\u2183", - "\u3005"-"\u3007", - "\u3021"-"\u3029", - "\u3031"-"\u3035", - "\u3038"-"\u303c", - "\u3041"-"\u3096", - "\u309d"-"\u309f", - "\u30a1"-"\u30ff", - "\u3105"-"\u312c", - "\u3131"-"\u318e", - "\u31a0"-"\u31b7", - "\u31f0"-"\u31ff", - "\u3400"-"\u4db5", - "\u4e00"-"\u9fa5", - "\ua000"-"\ua48c", - "\uac00"-"\ud7a3", - "\ud801", //for supplementary characters suport - "\ud802", //for supplementary characters suport - "\uf900"-"\ufa2d", - "\ufa30"-"\ufa6a", - "\ufb00"-"\ufb06", - "\ufb13"-"\ufb17", - "\ufb1d", - "\ufb1f"-"\ufb28", - "\ufb2a"-"\ufb36", - "\ufb38"-"\ufb3c", - "\ufb3e", - "\ufb40"-"\ufb41", - "\ufb43"-"\ufb44", - "\ufb46"-"\ufbb1", - "\ufbd3"-"\ufd3d", - "\ufd50"-"\ufd8f", - "\ufd92"-"\ufdc7", - "\ufdf0"-"\ufdfc", - "\ufe33"-"\ufe34", - "\ufe4d"-"\ufe4f", - "\ufe69", - "\ufe70"-"\ufe74", - "\ufe76"-"\ufefc", - "\uff04", - "\uff21"-"\uff3a", - "\uff3f", - "\uff41"-"\uff5a", - "\uff65"-"\uffbe", - "\uffc2"-"\uffc7", - "\uffca"-"\uffcf", - "\uffd2"-"\uffd7", - "\uffda"-"\uffdc", - "\uffe0"-"\uffe1", - "\uffe5"-"\uffe6" - ] - > -| - < #PART_LETTER: - [ // all chars for which Character.isIdentifierPart is true - "\u0000"-"\u0008", - "\u000e"-"\u001b", - "\u0024", // "$" - "\u0030"-"\u0039", // "0"-"9" - "\u0041"-"\u005a", // "A"-"Z" - "\u005f", // "_" - "\u0061"-"\u007a", // "a"-"z" - "\u007f"-"\u009f", - "\u00a2"-"\u00a5", - "\u00aa", - "\u00ad", - "\u00b5", - "\u00ba", - "\u00c0"-"\u00d6", - "\u00d8"-"\u00f6", - "\u00f8"-"\u0236", - "\u0250"-"\u02c1", - "\u02c6"-"\u02d1", - "\u02e0"-"\u02e4", - "\u02ee", - "\u0300"-"\u0357", - "\u035d"-"\u036f", - "\u037a", - "\u0386", - "\u0388"-"\u038a", - "\u038c", - "\u038e"-"\u03a1", - "\u03a3"-"\u03ce", - "\u03d0"-"\u03f5", - "\u03f7"-"\u03fb", - "\u0400"-"\u0481", - "\u0483"-"\u0486", - "\u048a"-"\u04ce", - "\u04d0"-"\u04f5", - "\u04f8"-"\u04f9", - "\u0500"-"\u050f", - "\u0531"-"\u0556", - "\u0559", - "\u0561"-"\u0587", - "\u0591"-"\u05a1", - "\u05a3"-"\u05b9", - "\u05bb"-"\u05bd", - "\u05bf", - "\u05c1"-"\u05c2", - "\u05c4", - "\u05d0"-"\u05ea", - "\u05f0"-"\u05f2", - "\u0600"-"\u0603", - "\u0610"-"\u0615", - "\u0621"-"\u063a", - "\u0640"-"\u0658", - "\u0660"-"\u0669", - "\u066e"-"\u06d3", - "\u06d5"-"\u06dd", - "\u06df"-"\u06e8", - "\u06ea"-"\u06fc", - "\u06ff", - "\u070f"-"\u074a", - "\u074d"-"\u074f", - "\u0780"-"\u07b1", - "\u0901"-"\u0939", - "\u093c"-"\u094d", - "\u0950"-"\u0954", - "\u0958"-"\u0963", - "\u0966"-"\u096f", - "\u0981"-"\u0983", - "\u0985"-"\u098c", - "\u098f"-"\u0990", - "\u0993"-"\u09a8", - "\u09aa"-"\u09b0", - "\u09b2", - "\u09b6"-"\u09b9", - "\u09bc"-"\u09c4", - "\u09c7"-"\u09c8", - "\u09cb"-"\u09cd", - "\u09d7", - "\u09dc"-"\u09dd", - "\u09df"-"\u09e3", - "\u09e6"-"\u09f3", - "\u0a01"-"\u0a03", - "\u0a05"-"\u0a0a", - "\u0a0f"-"\u0a10", - "\u0a13"-"\u0a28", - "\u0a2a"-"\u0a30", - "\u0a32"-"\u0a33", - "\u0a35"-"\u0a36", - "\u0a38"-"\u0a39", - "\u0a3c", - "\u0a3e"-"\u0a42", - "\u0a47"-"\u0a48", - "\u0a4b"-"\u0a4d", - "\u0a59"-"\u0a5c", - "\u0a5e", - "\u0a66"-"\u0a74", - "\u0a81"-"\u0a83", - "\u0a85"-"\u0a8d", - "\u0a8f"-"\u0a91", - "\u0a93"-"\u0aa8", - "\u0aaa"-"\u0ab0", - "\u0ab2"-"\u0ab3", - "\u0ab5"-"\u0ab9", - "\u0abc"-"\u0ac5", - "\u0ac7"-"\u0ac9", - "\u0acb"-"\u0acd", - "\u0ad0", - "\u0ae0"-"\u0ae3", - "\u0ae6"-"\u0aef", - "\u0af1", - "\u0b01"-"\u0b03", - "\u0b05"-"\u0b0c", - "\u0b0f"-"\u0b10", - "\u0b13"-"\u0b28", - "\u0b2a"-"\u0b30", - "\u0b32"-"\u0b33", - "\u0b35"-"\u0b39", - "\u0b3c"-"\u0b43", - "\u0b47"-"\u0b48", - "\u0b4b"-"\u0b4d", - "\u0b56"-"\u0b57", - "\u0b5c"-"\u0b5d", - "\u0b5f"-"\u0b61", - "\u0b66"-"\u0b6f", - "\u0b71", - "\u0b82"-"\u0b83", - "\u0b85"-"\u0b8a", - "\u0b8e"-"\u0b90", - "\u0b92"-"\u0b95", - "\u0b99"-"\u0b9a", - "\u0b9c", - "\u0b9e"-"\u0b9f", - "\u0ba3"-"\u0ba4", - "\u0ba8"-"\u0baa", - "\u0bae"-"\u0bb5", - "\u0bb7"-"\u0bb9", - "\u0bbe"-"\u0bc2", - "\u0bc6"-"\u0bc8", - "\u0bca"-"\u0bcd", - "\u0bd7", - "\u0be7"-"\u0bef", - "\u0bf9", - "\u0c01"-"\u0c03", - "\u0c05"-"\u0c0c", - "\u0c0e"-"\u0c10", - "\u0c12"-"\u0c28", - "\u0c2a"-"\u0c33", - "\u0c35"-"\u0c39", - "\u0c3e"-"\u0c44", - "\u0c46"-"\u0c48", - "\u0c4a"-"\u0c4d", - "\u0c55"-"\u0c56", - "\u0c60"-"\u0c61", - "\u0c66"-"\u0c6f", - "\u0c82"-"\u0c83", - "\u0c85"-"\u0c8c", - "\u0c8e"-"\u0c90", - "\u0c92"-"\u0ca8", - "\u0caa"-"\u0cb3", - "\u0cb5"-"\u0cb9", - "\u0cbc"-"\u0cc4", - "\u0cc6"-"\u0cc8", - "\u0cca"-"\u0ccd", - "\u0cd5"-"\u0cd6", - "\u0cde", - "\u0ce0"-"\u0ce1", - "\u0ce6"-"\u0cef", - "\u0d02"-"\u0d03", - "\u0d05"-"\u0d0c", - "\u0d0e"-"\u0d10", - "\u0d12"-"\u0d28", - "\u0d2a"-"\u0d39", - "\u0d3e"-"\u0d43", - "\u0d46"-"\u0d48", - "\u0d4a"-"\u0d4d", - "\u0d57", - "\u0d60"-"\u0d61", - "\u0d66"-"\u0d6f", - "\u0d82"-"\u0d83", - "\u0d85"-"\u0d96", - "\u0d9a"-"\u0db1", - "\u0db3"-"\u0dbb", - "\u0dbd", - "\u0dc0"-"\u0dc6", - "\u0dca", - "\u0dcf"-"\u0dd4", - "\u0dd6", - "\u0dd8"-"\u0ddf", - "\u0df2"-"\u0df3", - "\u0e01"-"\u0e3a", - "\u0e3f"-"\u0e4e", - "\u0e50"-"\u0e59", - "\u0e81"-"\u0e82", - "\u0e84", - "\u0e87"-"\u0e88", - "\u0e8a", - "\u0e8d", - "\u0e94"-"\u0e97", - "\u0e99"-"\u0e9f", - "\u0ea1"-"\u0ea3", - "\u0ea5", - "\u0ea7", - "\u0eaa"-"\u0eab", - "\u0ead"-"\u0eb9", - "\u0ebb"-"\u0ebd", - "\u0ec0"-"\u0ec4", - "\u0ec6", - "\u0ec8"-"\u0ecd", - "\u0ed0"-"\u0ed9", - "\u0edc"-"\u0edd", - "\u0f00", - "\u0f18"-"\u0f19", - "\u0f20"-"\u0f29", - "\u0f35", - "\u0f37", - "\u0f39", - "\u0f3e"-"\u0f47", - "\u0f49"-"\u0f6a", - "\u0f71"-"\u0f84", - "\u0f86"-"\u0f8b", - "\u0f90"-"\u0f97", - "\u0f99"-"\u0fbc", - "\u0fc6", - "\u1000"-"\u1021", - "\u1023"-"\u1027", - "\u1029"-"\u102a", - "\u102c"-"\u1032", - "\u1036"-"\u1039", - "\u1040"-"\u1049", - "\u1050"-"\u1059", - "\u10a0"-"\u10c5", - "\u10d0"-"\u10f8", - "\u1100"-"\u1159", - "\u115f"-"\u11a2", - "\u11a8"-"\u11f9", - "\u1200"-"\u1206", - "\u1208"-"\u1246", - "\u1248", - "\u124a"-"\u124d", - "\u1250"-"\u1256", - "\u1258", - "\u125a"-"\u125d", - "\u1260"-"\u1286", - "\u1288", - "\u128a"-"\u128d", - "\u1290"-"\u12ae", - "\u12b0", - "\u12b2"-"\u12b5", - "\u12b8"-"\u12be", - "\u12c0", - "\u12c2"-"\u12c5", - "\u12c8"-"\u12ce", - "\u12d0"-"\u12d6", - "\u12d8"-"\u12ee", - "\u12f0"-"\u130e", - "\u1310", - "\u1312"-"\u1315", - "\u1318"-"\u131e", - "\u1320"-"\u1346", - "\u1348"-"\u135a", - "\u1369"-"\u1371", - "\u13a0"-"\u13f4", - "\u1401"-"\u166c", - "\u166f"-"\u1676", - "\u1681"-"\u169a", - "\u16a0"-"\u16ea", - "\u16ee"-"\u16f0", - "\u1700"-"\u170c", - "\u170e"-"\u1714", - "\u1720"-"\u1734", - "\u1740"-"\u1753", - "\u1760"-"\u176c", - "\u176e"-"\u1770", - "\u1772"-"\u1773", - "\u1780"-"\u17d3", - "\u17d7", - "\u17db"-"\u17dd", - "\u17e0"-"\u17e9", - "\u180b"-"\u180d", - "\u1810"-"\u1819", - "\u1820"-"\u1877", - "\u1880"-"\u18a9", - "\u1900"-"\u191c", - "\u1920"-"\u192b", - "\u1930"-"\u193b", - "\u1946"-"\u196d", - "\u1970"-"\u1974", - "\u1d00"-"\u1d6b", - "\u1e00"-"\u1e9b", - "\u1ea0"-"\u1ef9", - "\u1f00"-"\u1f15", - "\u1f18"-"\u1f1d", - "\u1f20"-"\u1f45", - "\u1f48"-"\u1f4d", - "\u1f50"-"\u1f57", - "\u1f59", - "\u1f5b", - "\u1f5d", - "\u1f5f"-"\u1f7d", - "\u1f80"-"\u1fb4", - "\u1fb6"-"\u1fbc", - "\u1fbe", - "\u1fc2"-"\u1fc4", - "\u1fc6"-"\u1fcc", - "\u1fd0"-"\u1fd3", - "\u1fd6"-"\u1fdb", - "\u1fe0"-"\u1fec", - "\u1ff2"-"\u1ff4", - "\u1ff6"-"\u1ffc", - "\u200c"-"\u200f", - "\u202a"-"\u202e", - "\u203f"-"\u2040", - "\u2054", - "\u2060"-"\u2063", - "\u206a"-"\u206f", - "\u2071", - "\u207f", - "\u20a0"-"\u20b1", - "\u20d0"-"\u20dc", - "\u20e1", - "\u20e5"-"\u20ea", - "\u2102", - "\u2107", - "\u210a"-"\u2113", - "\u2115", - "\u2119"-"\u211d", - "\u2124", - "\u2126", - "\u2128", - "\u212a"-"\u212d", - "\u212f"-"\u2131", - "\u2133"-"\u2139", - "\u213d"-"\u213f", - "\u2145"-"\u2149", - "\u2160"-"\u2183", - "\u3005"-"\u3007", - "\u3021"-"\u302f", - "\u3031"-"\u3035", - "\u3038"-"\u303c", - "\u3041"-"\u3096", - "\u3099"-"\u309a", - "\u309d"-"\u309f", - "\u30a1"-"\u30ff", - "\u3105"-"\u312c", - "\u3131"-"\u318e", - "\u31a0"-"\u31b7", - "\u31f0"-"\u31ff", - "\u3400"-"\u4db5", - "\u4e00"-"\u9fa5", - "\ua000"-"\ua48c", - "\uac00"-"\ud7a3", - "\ud801", //for supplementary characters suport - "\ud802", //for supplementary characters suport - "\ud834", //for supplementary characters suport - "\udc00", //for supplementary characters suport - "\udc01", //for supplementary characters suport - "\udd7b", //for supplementary characters suport - "\uf900"-"\ufa2d", - "\ufa30"-"\ufa6a", - "\ufb00"-"\ufb06", - "\ufb13"-"\ufb17", - "\ufb1d"-"\ufb28", - "\ufb2a"-"\ufb36", - "\ufb38"-"\ufb3c", - "\ufb3e", - "\ufb40"-"\ufb41", - "\ufb43"-"\ufb44", - "\ufb46"-"\ufbb1", - "\ufbd3"-"\ufd3d", - "\ufd50"-"\ufd8f", - "\ufd92"-"\ufdc7", - "\ufdf0"-"\ufdfc", - "\ufe00"-"\ufe0f", - "\ufe20"-"\ufe23", - "\ufe33"-"\ufe34", - "\ufe4d"-"\ufe4f", - "\ufe69", - "\ufe70"-"\ufe74", - "\ufe76"-"\ufefc", - "\ufeff", - "\uff04", - "\uff10"-"\uff19", - "\uff21"-"\uff3a", - "\uff3f", - "\uff41"-"\uff5a", - "\uff65"-"\uffbe", - "\uffc2"-"\uffc7", - "\uffca"-"\uffcf", - "\uffd2"-"\uffd7", - "\uffda"-"\uffdc", - "\uffe0"-"\uffe1", - "\uffe5"-"\uffe6", - "\ufff9"-"\ufffb" - ] - > -} - -/* SEPARATORS */ - -TOKEN : -{ - < LPAREN: "(" > -| < RPAREN: ")" > -| < LBRACE: "{" > -| < RBRACE: "}" > -| < LBRACKET: "[" > -| < RBRACKET: "]" > -| < SEMICOLON: ";" > -| < COMMA: "," > -| < DOT: "." > -| < AT: "@" > -} - -/* OPERATORS */ - -TOKEN : -{ - < ASSIGN: "=" > -| < LT: "<" > -| < BANG: "!" > -| < TILDE: "~" > -| < HOOK: "?" > -| < COLON: ":" > -| < EQ: "==" > -| < LE: "<=" > -| < GE: ">=" > -| < NE: "!=" > -| < SC_OR: "||" > -| < SC_AND: "&&" > -| < INCR: "++" > -| < DECR: "--" > -| < PLUS: "+" > -| < MINUS: "-" > -| < STAR: "*" > -| < SLASH: "/" > -| < BIT_AND: "&" > -| < BIT_OR: "|" > -| < XOR: "^" > -| < REM: "%" > -| < LSHIFT: "<<" > -| < PLUSASSIGN: "+=" > -| < MINUSASSIGN: "-=" > -| < STARASSIGN: "*=" > -| < SLASHASSIGN: "/=" > -| < ANDASSIGN: "&=" > -| < ORASSIGN: "|=" > -| < XORASSIGN: "^=" > -| < REMASSIGN: "%=" > -| < LSHIFTASSIGN: "<<=" > -| < RSIGNEDSHIFTASSIGN: ">>=" > -| < RUNSIGNEDSHIFTASSIGN: ">>>=" > -| < ELLIPSIS: "..." > -} - -/* >'s need special attention due to generics syntax. */ -TOKEN : -{ - < RUNSIGNEDSHIFT: ">>>" > - { - matchedToken.kind = GT; - ((ASTParser.GTToken)matchedToken).realKind = RUNSIGNEDSHIFT; - input_stream.backup(2); - } -| < RSIGNEDSHIFT: ">>" > - { - matchedToken.kind = GT; - ((ASTParser.GTToken)matchedToken).realKind = RSIGNEDSHIFT; - input_stream.backup(1); - } -| < GT: ">" > -} - - -/***************************************** - * THE JAVA LANGUAGE GRAMMAR STARTS HERE * - *****************************************/ - -/* - * Program structuring syntax follows. - */ - -CompilationUnit CompilationUnit(): -{ - PackageDeclaration pakage = null; - List imports = null; - ImportDeclaration in = null; - List types = null; - TypeDeclaration tn = null; - int line = -1; - int column = 0; -} -{ - [ LOOKAHEAD(PackageDeclaration()) pakage = PackageDeclaration() {line = pakage.getBeginLine(); column = pakage.getBeginColumn();} ] - ( in = ImportDeclaration() { if(line==-1){line = in.getBeginLine(); column = in.getBeginColumn();} imports = add(imports, in); } )* - ( tn = TypeDeclaration() { if(line==-1){line = tn.getBeginLine(); column = tn.getBeginColumn();} types = add(types, tn); } )* - ( | "\u001A" /** ctrl+z char **/) - { return new CompilationUnit(line == -1 ? 0 : line, column, token.endLine, token.endColumn,pakage, imports, types, getComments()); } -} - -PackageDeclaration PackageDeclaration(): -{ - List annotations = null; - AnnotationExpr ann; - NameExpr name; - int line; - int column; -} -{ -( ann = Annotation() { annotations = add(annotations, ann); } )* - "package" {line=token.beginLine; column=token.beginColumn;} name = Name() ";" - { return new PackageDeclaration(line, column, token.endLine, token.endColumn,annotations, name); } -} - -ImportDeclaration ImportDeclaration(): -{ - NameExpr name; - boolean isStatic = false; - boolean isAsterisk = false; - int line; - int column; -} -{ - "import" {line=token.beginLine; column=token.beginColumn;} [ "static" { isStatic = true; } ] name = Name() [ "." "*" { isAsterisk = true; } ] ";" - { return new ImportDeclaration(line, column, token.endLine, token.endColumn,name, isStatic, isAsterisk); } -} - -/* - * Modifiers. We match all modifiers in a single rule to reduce the chances of - * syntax errors for simple modifier mistakes. It will also enable us to give - * better error messages. - */ - -Modifier Modifiers(): -{ - int beginLine = -1; - int beginColumn = -1; - int modifiers = 0; - List annotations = null; - AnnotationExpr ann; -} -{ - ( - LOOKAHEAD(2) - ( - "public" { modifiers = addModifier(modifiers, ModifierSet.PUBLIC, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "static" { modifiers = addModifier(modifiers, ModifierSet.STATIC, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "protected" { modifiers = addModifier(modifiers, ModifierSet.PROTECTED, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "private" { modifiers = addModifier(modifiers, ModifierSet.PRIVATE, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "final" { modifiers = addModifier(modifiers, ModifierSet.FINAL, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "abstract" { modifiers = addModifier(modifiers, ModifierSet.ABSTRACT, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "synchronized" { modifiers = addModifier(modifiers, ModifierSet.SYNCHRONIZED, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "native" { modifiers = addModifier(modifiers, ModifierSet.NATIVE, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "transient" { modifiers = addModifier(modifiers, ModifierSet.TRANSIENT, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "volatile" { modifiers = addModifier(modifiers, ModifierSet.VOLATILE, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - "strictfp" { modifiers = addModifier(modifiers, ModifierSet.STRICTFP, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } - | - ann = Annotation() { annotations = add(annotations, ann); if(beginLine==-1) {beginLine=ann.getBeginLine(); beginColumn=ann.getBeginColumn();} } - ) - )* - - { - return new Modifier(beginLine, beginColumn, modifiers, annotations); - } -} - -/* - * Declaration syntax follows. - */ -TypeDeclaration TypeDeclaration(): -{ - Modifier modifier; - TypeDeclaration ret; -} -{ - { pushJavadoc(); } - ( - ";" { ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); } - | - modifier = Modifiers() - ( - ret = ClassOrInterfaceDeclaration(modifier) - | - ret = EnumDeclaration(modifier) - | - ret = AnnotationTypeDeclaration(modifier) - ) - ) - { return ret; } -} - - -ClassOrInterfaceDeclaration ClassOrInterfaceDeclaration(Modifier modifier): -{ - boolean isInterface = false; - String name; - List typePar = null; - List extList = null; - List impList = null; - List members; - int line = modifier.beginLine; - int column = modifier.beginColumn; -} -{ - ( "class" | "interface" { isInterface = true; } ) { if (line == -1) {line=token.beginLine; column=token.beginColumn;} } - { name = token.image; } - [ typePar = TypeParameters() {typePar.remove(0);} ] - [ extList = ExtendsList(isInterface) ] - [ impList = ImplementsList(isInterface) ] - members = ClassOrInterfaceBody(isInterface) - - { return new ClassOrInterfaceDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, isInterface, name, typePar, extList, impList, members); } -} - -List ExtendsList(boolean isInterface): -{ - boolean extendsMoreThanOne = false; - List ret = new LinkedList(); - ClassOrInterfaceType cit; -} -{ - "extends" cit = ClassOrInterfaceType() { ret.add(cit); } - ( "," cit = ClassOrInterfaceType() { ret.add(cit); extendsMoreThanOne = true; } )* - { - if (extendsMoreThanOne && !isInterface) - throwParseException(token, "A class cannot extend more than one other class"); - } - { return ret; } -} - -List ImplementsList(boolean isInterface): -{ - List ret = new LinkedList(); - ClassOrInterfaceType cit; -} -{ - "implements" cit = ClassOrInterfaceType() { ret.add(cit); } - ( "," cit = ClassOrInterfaceType() { ret.add(cit); } )* - { - if (isInterface) - throwParseException(token, "An interface cannot implement other interfaces"); - } - { return ret; } -} - -EnumDeclaration EnumDeclaration(Modifier modifier): -{ - String name; - List impList = null; - EnumConstantDeclaration entry; - List entries = null; - BodyDeclaration member; - List members = null; - int line = modifier.beginLine; - int column = modifier.beginColumn; -} -{ - "enum" { if (line == -1) {line=token.beginLine; column=token.beginColumn;} } - { name = token.image; } - [ impList = ImplementsList(false) ] - "{" - [ - { entries = new LinkedList(); } - entry = EnumConstantDeclaration() { entries.add(entry); } ( LOOKAHEAD(2) "," entry = EnumConstantDeclaration() { entries.add(entry); } )* - ] - [ "," ] - [ - ( ";" ( member = ClassOrInterfaceBodyDeclaration(false) { members = add(members, member); } )* ) - ] - "}" - - { return new EnumDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, name, impList, entries, members); } -} - - -EnumConstantDeclaration EnumConstantDeclaration(): -{ - List annotations = null; - AnnotationExpr ann; - String name; - List args = null; - List classBody = null; - int line = -1; - int column = -1; -} -{ - { pushJavadoc(); } - ( ann = Annotation() { annotations = add(annotations, ann); if(line==-1){line=ann.getBeginLine(); column=ann.getBeginColumn();} } )* - { name = token.image; if(line==-1){line=token.beginLine; column=token.beginColumn;} } - [ args = Arguments() ] [ classBody = ClassOrInterfaceBody(false) ] - { return new EnumConstantDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), annotations, name, args, classBody); } -} - -List TypeParameters(): -{ - List ret = new LinkedList(); - TypeParameter tp; -} -{ - "<" { ret.add(new int[]{token.beginLine, token.beginColumn}); } - tp = TypeParameter() { ret.add(tp); } - ( "," tp = TypeParameter() { ret.add(tp); } )* - ">" - { return ret; } -} - -TypeParameter TypeParameter(): -{ - String name; - List typeBound = null; - int line; - int column; -} -{ - { name = token.image; line=token.beginLine; column=token.beginColumn;} [ typeBound = TypeBound() ] - { return new TypeParameter(line, column, token.endLine, token.endColumn,name, typeBound); } -} - -List TypeBound(): -{ - List ret = new LinkedList(); - ClassOrInterfaceType cit; -} -{ - "extends" cit = ClassOrInterfaceType() { ret.add(cit); } - ( "&" cit = ClassOrInterfaceType() { ret.add(cit); } )* - { return ret; } -} - -List ClassOrInterfaceBody(boolean isInterface): -{ - List ret = new LinkedList(); - BodyDeclaration member; -} -{ - "{" ( member = ClassOrInterfaceBodyDeclaration(isInterface) { ret.add(member); } )* "}" - { return ret; } -} - -BodyDeclaration ClassOrInterfaceBodyDeclaration(boolean isInterface): -{ - boolean isNestedInterface = false; - Modifier modifier; - BodyDeclaration ret; -} -{ - { pushJavadoc(); } - ( - LOOKAHEAD(2) - ret = InitializerDeclaration() - { - if (isInterface) - throwParseException(token, "An interface cannot have initializers"); - } - | - modifier = Modifiers() // Just get all the modifiers out of the way. If you want to do - // more checks, pass the modifiers down to the member - ( - ret = ClassOrInterfaceDeclaration(modifier) - | - ret = EnumDeclaration(modifier) - | - ret = AnnotationTypeDeclaration(modifier) - | - LOOKAHEAD( [ TypeParameters() ] "(" ) - ret = ConstructorDeclaration(modifier) - | - LOOKAHEAD( Type() ( "[" "]" )* ( "," | "=" | ";" ) ) - ret = FieldDeclaration(modifier) - | - ret = MethodDeclaration(modifier) - ) - | - ";" { ret = new EmptyMemberDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); } - ) - { return ret; } -} - -FieldDeclaration FieldDeclaration(Modifier modifier): -{ - Type type; - List variables = new LinkedList(); - VariableDeclarator val; -} -{ - // Modifiers are already matched in the caller - type = Type() - val = VariableDeclarator() { variables.add(val); } - ( "," val = VariableDeclarator() { variables.add(val); } )* ";" - - { - int line = modifier.beginLine; - int column = modifier.beginColumn; - if (line == -1) { line=type.getBeginLine(); column=type.getBeginColumn(); } - return new FieldDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, type, variables); - } -} - -VariableDeclarator VariableDeclarator(): -{ - VariableDeclaratorId id; - Expression init = null; -} -{ - id = VariableDeclaratorId() [ "=" init = VariableInitializer() ] - { return new VariableDeclarator(id.getBeginLine(), id.getBeginColumn(), token.endLine, token.endColumn, id, init); } -} - -VariableDeclaratorId VariableDeclaratorId(): -{ - String name; - int arrayCount = 0; - int line; - int column; -} -{ - { name = token.image; line=token.beginLine; column=token.beginColumn;} ( "[" "]" { arrayCount++; } )* - { return new VariableDeclaratorId(line, column, token.endLine, token.endColumn,name, arrayCount); } -} - -Expression VariableInitializer(): -{ - Expression ret; -} -{ - ( - ret = ArrayInitializer() - | - ret = Expression() - ) - { return ret;} -} - -ArrayInitializerExpr ArrayInitializer(): -{ - List values = null; - Expression val; - int line; - int column; -} -{ - "{" {line=token.beginLine; column=token.beginColumn;} [ val = VariableInitializer() { values = add(values, val); } ( LOOKAHEAD(2) "," val = VariableInitializer() { values = add(values, val); } )* ] [ "," ] "}" - { return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn,values); } -} - -MethodDeclaration MethodDeclaration(Modifier modifier): -{ - List typeParameters = null; - Type type; - String name; - List parameters; - int arrayCount = 0; - List throws_ = null; - BlockStmt block = null; - int line = modifier.beginLine; - int column = modifier.beginColumn; -} -{ - // Modifiers already matched in the caller! - [ typeParameters = TypeParameters() { int[] lineCol=(int[])typeParameters.remove(0); if(line==-1){ line=lineCol[0]; column=lineCol[1];} } ] - type = ResultType() { if(line==-1){line=type.getBeginLine(); column=type.getBeginColumn();}} - { name = token.image; } parameters = FormalParameters() ( "[" "]" { arrayCount++; } )* - [ "throws" throws_ = NameList() ] - ( block = Block() | ";" ) - - { return new MethodDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, typeParameters, type, name, parameters, arrayCount, throws_, block); } -} - -List FormalParameters(): -{ - List ret = null; - Parameter par; -} -{ - "(" [ par = FormalParameter() { ret = add(ret, par); } ( "," par = FormalParameter() { ret = add(ret, par); } )* ] ")" - - { return ret; } -} - -Parameter FormalParameter(): -{ - Modifier modifier; - Type type; - boolean isVarArg = false; - VariableDeclaratorId id; -} -{ - modifier = Modifiers() type = Type() [ "..." { isVarArg = true;} ] id = VariableDeclaratorId() - - { - int line = modifier.beginLine; - int column = modifier.beginColumn; - if(line==-1){ line=type.getBeginLine(); column=type.getBeginColumn(); } - return new Parameter(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, isVarArg, id); - } -} - -ConstructorDeclaration ConstructorDeclaration(Modifier modifier): -{ - List typeParameters = null; - String name; - List parameters; - List throws_ = null; - ExplicitConstructorInvocationStmt exConsInv = null; - List stmts; - int line = modifier.beginLine; - int column = modifier.beginColumn; - int bbLine = 0; - int bbColumn = 0; - int beLine = 0; - int beColumn = 0; -} -{ - [ typeParameters = TypeParameters() { int[] lineCol=(int[])typeParameters.remove(0); if(line==-1){ line=lineCol[0]; column=lineCol[1];} } ] - // Modifiers matched in the caller - { name = token.image; if(line==-1){line=token.beginLine; column=token.beginColumn;}} parameters = FormalParameters() [ "throws" throws_ = NameList() ] - "{" { bbLine=token.beginLine; bbColumn=token.beginColumn; } - [ LOOKAHEAD(ExplicitConstructorInvocation()) exConsInv = ExplicitConstructorInvocation() ] - stmts = Statements() - "}" - - { - if (exConsInv != null) { - stmts = add(0, stmts, exConsInv); - } - return new ConstructorDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, typeParameters, name, parameters, throws_, new BlockStmt(bbLine, bbColumn, token.endLine, token.endColumn, stmts)); - } -} - -ExplicitConstructorInvocationStmt ExplicitConstructorInvocation(): -{ - boolean isThis = false; - List args; - Expression expr = null; - List typeArgs = null; - int line = -1; - int column = 0; -} -{ - ( - LOOKAHEAD([ TypeArguments() ] "this" "(") - [ typeArgs = TypeArguments() { int[] lineCol=(int[])typeArgs.remove(0); line=lineCol[0]; column=lineCol[1]; } ] - "this" { if (line == -1) {line=token.beginLine; column=token.beginColumn;} isThis = true; } - args = Arguments() ";" - | - [ - LOOKAHEAD( PrimaryExpressionWithoutSuperSuffix() "." ) - expr = PrimaryExpressionWithoutSuperSuffix() "." - { line=expr.getBeginLine(); column=expr.getBeginColumn(); } - ] - [ typeArgs = TypeArguments() {int[] lineCol=(int[])typeArgs.remove(0); if (line == -1) {line=lineCol[0]; column=lineCol[1];}} ] - "super" {if (line == -1) {line=token.beginLine; column=token.beginColumn;}} - args = Arguments() ";" - ) - { return new ExplicitConstructorInvocationStmt(line, column, token.endLine, token.endColumn,typeArgs, isThis, expr, args); } -} - -List Statements(): -{ - List ret = null; - Statement stmt; -} -{ - ( stmt = BlockStatement() { ret = add(ret, stmt); } )* - { return ret; } -} - -InitializerDeclaration InitializerDeclaration(): -{ - BlockStmt block; - int line = -1; - int column = 0; - boolean isStatic = false; -} -{ - [ "static" { isStatic = true; line=token.beginLine; column=token.beginColumn;} ] block = Block() {if(line==-1){line=block.getBeginLine(); column=block.getBeginColumn();}} - { return new InitializerDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), isStatic, block); } -} - - -/* - * Type, name and expression syntax follows. - */ - -Type Type(): -{ - Type ret; -} -{ - ( - LOOKAHEAD(2) ret = ReferenceType() - | - ret = PrimitiveType() - ) - { return ret; } -} - -ReferenceType ReferenceType(): -{ - Type type; - int arrayCount = 0; -} -{ - ( - type = PrimitiveType() ( LOOKAHEAD(2) "[" "]" { arrayCount++; } )+ - | - type = ClassOrInterfaceType() ( LOOKAHEAD(2) "[" "]" { arrayCount++; } )* - ) - { return new ReferenceType(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type, arrayCount); } -} - -ClassOrInterfaceType ClassOrInterfaceType(): -{ - ClassOrInterfaceType ret; - String name; - List typeArgs = null; - int line; - int column; -} -{ - {line=token.beginLine; column=token.beginColumn;} { name = token.image; } - [ LOOKAHEAD(2) typeArgs = TypeArguments() {typeArgs.remove(0);} ] - { ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,null, name, typeArgs); } - ( - LOOKAHEAD(2) "." { name = token.image; } - [ LOOKAHEAD(2) typeArgs = TypeArguments() {typeArgs.remove(0);} ] { ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,ret, name, typeArgs); } - )* - { return ret; } -} - -List TypeArguments(): -{ - List ret = new LinkedList(); - Type type; -} -{ - "<" { ret.add(new int[]{token.beginLine, token.beginColumn}); } - type = TypeArgument() { ret.add(type); } ( "," type = TypeArgument() { ret.add(type); } )* - ">" - { return ret; } -} - -Type TypeArgument(): -{ - Type ret; -} -{ - ( - ret = ReferenceType() - | - ret = Wildcard() - ) - { return ret; } -} - -WildcardType Wildcard(): -{ - ReferenceType ext = null; - ReferenceType sup = null; - int line; - int column; -} -{ - "?" {line=token.beginLine; column=token.beginColumn;} - [ - "extends" ext = ReferenceType() - | - "super" sup = ReferenceType() - ] - { return new WildcardType(line, column, token.endLine, token.endColumn,ext, sup); } -} - -PrimitiveType PrimitiveType(): -{ - PrimitiveType ret; -} -{ -( - "boolean" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Boolean); } -| - "char" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Char); } -| - "byte" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Byte); } -| - "short" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Short); } -| - "int" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Int); } -| - "long" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Long); } -| - "float" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Float); } -| - "double" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Double); } -) -{ return ret; } -} - -Type ResultType(): -{ - Type ret; -} -{ - ( - "void" { ret = new VoidType(token.beginLine, token.beginColumn, token.endLine, token.endColumn); } - | - ret = Type() - ) - { return ret; } -} - -NameExpr Name(): -/* - * A lookahead of 2 is required below since "Name" can be followed - * by a ".*" when used in the context of an "ImportDeclaration". - */ -{ - NameExpr ret; -} -{ - { ret = new NameExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); } - ( LOOKAHEAD(2) "." { ret = new QualifiedNameExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, token.image); } )* - { return ret; } -} - -List NameList(): -{ - List ret = new LinkedList(); - NameExpr name; -} -{ - name = Name() { ret.add(name); } ( "," name = Name() { ret.add(name); } )* - - { return ret; } -} - - -/* - * Expression syntax follows. - */ - -Expression Expression(): -/* - * This expansion has been written this way instead of: - * Assignment() | ConditionalExpression() - * for performance reasons. - * However, it is a weakening of the grammar for it allows the LHS of - * assignments to be any conditional expression whereas it can only be - * a primary expression. Consider adding a semantic predicate to work - * around this. - */ -{ - Expression ret; - AssignExpr.Operator op; - Expression value; -} -{ - ret = ConditionalExpression() - [ - LOOKAHEAD(2) - op = AssignmentOperator() value = Expression() { ret = new AssignExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, value, op); } - ] - { return ret; } -} - -AssignExpr.Operator AssignmentOperator(): -{ - AssignExpr.Operator ret; -} -{ - ( - "=" { ret = AssignExpr.Operator.assign; } - | "*=" { ret = AssignExpr.Operator.star; } - | "/=" { ret = AssignExpr.Operator.slash; } - | "%=" { ret = AssignExpr.Operator.rem; } - | "+=" { ret = AssignExpr.Operator.plus; } - | "-=" { ret = AssignExpr.Operator.minus; } - | "<<=" { ret = AssignExpr.Operator.lShift; } - | ">>=" { ret = AssignExpr.Operator.rSignedShift; } - | ">>>=" { ret = AssignExpr.Operator.rUnsignedShift; } - | "&=" { ret = AssignExpr.Operator.and; } - | "^=" { ret = AssignExpr.Operator.xor; } - | "|=" { ret = AssignExpr.Operator.or; } - ) - { return ret; } -} - -Expression ConditionalExpression(): -{ - Expression ret; - Expression left; - Expression right; -} -{ - ret = ConditionalOrExpression() - [ "?" left = Expression() ":" right = ConditionalExpression() { ret = new ConditionalExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, left, right); } ] - { return ret; } -} - -Expression ConditionalOrExpression(): -{ - Expression ret; - Expression right; -} -{ - ret = ConditionalAndExpression() ( "||" right = ConditionalAndExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.or); } )* - { return ret; } -} - -Expression ConditionalAndExpression(): -{ - Expression ret; - Expression right; -} -{ - ret = InclusiveOrExpression() ( "&&" right = InclusiveOrExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.and); } )* - { return ret; } -} - -Expression InclusiveOrExpression(): -{ - Expression ret; - Expression right; -} -{ - ret = ExclusiveOrExpression() ( "|" right = ExclusiveOrExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binOr); } )* - { return ret; } -} - -Expression ExclusiveOrExpression(): -{ - Expression ret; - Expression right; -} -{ - ret = AndExpression() ( "^" right = AndExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.xor); } )* - { return ret; } -} - -Expression AndExpression(): -{ - Expression ret; - Expression right; -} -{ - ret = EqualityExpression() ( "&" right = EqualityExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binAnd); } )* - { return ret; } -} - -Expression EqualityExpression(): -{ - Expression ret; - Expression right; - BinaryExpr.Operator op; -} -{ - ret = InstanceOfExpression() - ( - ( "==" { op = BinaryExpr.Operator.equals; } | - "!=" { op = BinaryExpr.Operator.notEquals; } - ) right = InstanceOfExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } - )* - { return ret; } -} - -Expression InstanceOfExpression(): -{ - Expression ret; - Type type; -} -{ - ret = RelationalExpression() [ "instanceof" type = Type() { ret = new InstanceOfExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, type); } ] - { return ret; } -} - -Expression RelationalExpression(): -{ - Expression ret; - Expression right; - BinaryExpr.Operator op; -} -{ - ret = ShiftExpression() - ( - ( "<" { op = BinaryExpr.Operator.less; } | - ">" { op = BinaryExpr.Operator.greater; } | - "<=" { op = BinaryExpr.Operator.lessEquals; } | - ">=" { op = BinaryExpr.Operator.greaterEquals; } - ) right = ShiftExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } - )* - { return ret; } -} - -Expression ShiftExpression(): -{ - Expression ret; - Expression right; - BinaryExpr.Operator op; -} -{ - ret = AdditiveExpression() - ( - ( "<<" { op = BinaryExpr.Operator.lShift; } | - RSIGNEDSHIFT() { op = BinaryExpr.Operator.rSignedShift; } | - RUNSIGNEDSHIFT() { op = BinaryExpr.Operator.rUnsignedShift; } - ) right = AdditiveExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } - )* - { return ret; } -} - -Expression AdditiveExpression(): -{ - Expression ret; - Expression right; - BinaryExpr.Operator op; -} -{ - ret = MultiplicativeExpression() - ( - ( "+" { op = BinaryExpr.Operator.plus; } | - "-" { op = BinaryExpr.Operator.minus; } - ) right = MultiplicativeExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } - )* - { return ret; } -} - -Expression MultiplicativeExpression(): -{ - Expression ret; - Expression right; - BinaryExpr.Operator op; -} -{ - ret = UnaryExpression() - ( - ( "*" { op = BinaryExpr.Operator.times; } | - "/" { op = BinaryExpr.Operator.divide; } | - "%" { op = BinaryExpr.Operator.remainder; } - ) right = UnaryExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } - )* - { return ret; } -} - -Expression UnaryExpression(): -{ - Expression ret; - UnaryExpr.Operator op; - int line = 0; - int column = 0; -} -{ - ( - ( "+" { op = UnaryExpr.Operator.positive; line=token.beginLine; column=token.beginColumn;} | - "-" { op = UnaryExpr.Operator.negative; line=token.beginLine; column=token.beginColumn;} - ) ret = UnaryExpression() - { - if(op == UnaryExpr.Operator.negative) { - if (ret instanceof IntegerLiteralExpr && ((IntegerLiteralExpr)ret).isMinValue()) { - ret = new IntegerLiteralMinValueExpr(line, column, token.endLine, token.endColumn); - } else if (ret instanceof LongLiteralExpr && ((LongLiteralExpr)ret).isMinValue()) { - ret = new LongLiteralMinValueExpr(line, column, token.endLine, token.endColumn); - } else { - ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); - } - } else { - ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); - } - } - | - ret = PreIncrementExpression() - | - ret = PreDecrementExpression() - | - ret = UnaryExpressionNotPlusMinus() - ) - { return ret; } -} - -Expression PreIncrementExpression(): -{ - Expression ret; - int line; - int column; -} -{ - "++" {line=token.beginLine; column=token.beginColumn;} ret = PrimaryExpression() { ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, UnaryExpr.Operator.preIncrement); } - { return ret; } -} - -Expression PreDecrementExpression(): -{ - Expression ret; - int line; - int column; -} -{ - "--" {line=token.beginLine; column=token.beginColumn;} ret = PrimaryExpression() { ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, UnaryExpr.Operator.preDecrement); } - { return ret; } -} - -Expression UnaryExpressionNotPlusMinus(): -{ - Expression ret; - UnaryExpr.Operator op; - int line = 0; - int column = 0; -} -{ - ( - ( "~" { op = UnaryExpr.Operator.inverse; line=token.beginLine; column=token.beginColumn;} | - "!" { op = UnaryExpr.Operator.not; line=token.beginLine; column=token.beginColumn;} - ) ret = UnaryExpression() { ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); } - | - LOOKAHEAD( CastLookahead() ) - ret = CastExpression() - | - ret = PostfixExpression() - ) - { return ret; } -} - -// This production is to determine lookahead only. The LOOKAHEAD specifications -// below are not used, but they are there just to indicate that we know about -// this. -void CastLookahead(): -{} -{ - LOOKAHEAD("(" Type() "[") - "(" Type() "[" "]" -| - "(" Type() ")" UnaryExpression() -} - -Expression PostfixExpression(): -{ - Expression ret; - UnaryExpr.Operator op; -} -{ - ret = PrimaryExpression() - [ - LOOKAHEAD(2) - ( "++" { op = UnaryExpr.Operator.posIncrement; } | - "--" { op = UnaryExpr.Operator.posDecrement; } - ) { ret = new UnaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, op); } - ] - { return ret; } -} - -Expression CastExpression(): -{ - Expression ret; - Type type; - int line; - int column; -} -{ - "(" {line=token.beginLine; column=token.beginColumn;} type = Type() ")" ret = UnaryExpression() { ret = new CastExpr(line, column, token.endLine, token.endColumn,type, ret); } - { return ret; } -} - -Expression PrimaryExpression(): -{ - Expression ret; - Expression inner; -} -{ - ret = PrimaryPrefix() ( LOOKAHEAD(2) ret = PrimarySuffix(ret) )* - { return ret; } -} - -Expression PrimaryExpressionWithoutSuperSuffix(): -{ - Expression ret; - Expression inner; -} -{ - ret = PrimaryPrefix() ( LOOKAHEAD( PrimarySuffixWithoutSuper(null) ) ret = PrimarySuffixWithoutSuper(ret) )* - { return ret; } -} - -Expression PrimaryPrefix(): -{ - Expression ret; - String name; - List typeArgs = null; - List args = null; - boolean hasArgs = false; - Type type; - int line; - int column; -} -{ - ( - ret = Literal() - | - "this" { ret = new ThisExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); } - | - "super" { ret = new SuperExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); } - "." - [ typeArgs = TypeArguments() {typeArgs.remove(0);} ] - { name = token.image; } - [ args = Arguments() {hasArgs=true;} ] - { - ret = hasArgs - ? new MethodCallExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, name, args) - : new FieldAccessExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, null, name); - } - | - "(" {line=token.beginLine; column=token.beginColumn;} ret = Expression() ")" { ret = new EnclosedExpr(line, column, token.endLine, token.endColumn,ret); } - | - ret = AllocationExpression(null) - | - LOOKAHEAD( ResultType() "." "class" ) - type = ResultType() "." "class" { ret = new ClassExpr(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type); } - | - { name = token.image; line=token.beginLine; column=token.beginColumn; } - [ args = Arguments() {hasArgs=true;} ] - { - ret = hasArgs - ? new MethodCallExpr(line, column, token.endLine, token.endColumn, null, null, name, args) - : new NameExpr(line, column, token.endLine, token.endColumn, name); - } - ) - { return ret; } -} - -Expression PrimarySuffix(Expression scope): -{ - Expression ret; -} -{ - ( - LOOKAHEAD(2) - ret = PrimarySuffixWithoutSuper(scope) - | - "." "super" { ret = new SuperExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); } - ) - { return ret; } -} - -Expression PrimarySuffixWithoutSuper(Expression scope): -{ - Expression ret; - List typeArgs = null; - List args = null; - boolean hasArgs = false; - String name; -} -{ - ( - "." - ( - // TODO: está deixando passar "this.this", verificar na JLS se é possível - "this" { ret = new ThisExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); } - | - ret = AllocationExpression(scope) - | - LOOKAHEAD( [ TypeArguments() ] ) - [ typeArgs = TypeArguments() {typeArgs.remove(0);} ] - { name = token.image; } - [ args = Arguments() {hasArgs=true;} ] - { - ret = hasArgs - ? new MethodCallExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, name, args) - : new FieldAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, name); - } - ) - | - "["ret = Expression() "]" { ret = new ArrayAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, ret); } - ) - { return ret; } -} - -Expression Literal(): -{ - Expression ret; -} -{ - ( - { - ret = new IntegerLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - } - | - { - ret = new LongLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - } - | - { - ret = new DoubleLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); - } - | - { - ret = new CharLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length()-1)); - } - | - { - ret = new StringLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length()-1)); - } - | - ret = BooleanLiteral() - | - ret = NullLiteral() - ) - { return ret; } -} - -Expression BooleanLiteral(): -{ - Expression ret; -} -{ - ( - "true" { ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, true); } - | - "false" { ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, false); } - ) - { return ret; } -} - -Expression NullLiteral(): -{} -{ - "null" - { return new NullLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn); } -} - -List Arguments(): -{ - List ret = null; -} -{ - "(" [ ret = ArgumentList() ] ")" - { return ret; } -} - -List ArgumentList(): -{ - List ret = new LinkedList(); - Expression expr; -} -{ - expr = Expression() { ret.add(expr); } ( "," expr = Expression() { ret.add(expr); } )* - { return ret; } -} - -Expression AllocationExpression(Expression scope): -{ - Expression ret; - Type type; - Object[] arr = null; - List typeArgs = null; - List anonymousBody = null; - List args; - int line; - int column; -} -{ - "new" { if(scope==null) {line=token.beginLine; column=token.beginColumn;} else {line=scope.getBeginLine(); column=scope.getBeginColumn();} } - ( - type = PrimitiveType() - arr = ArrayDimsAndInits() - { - if (arr[0] instanceof Integer) { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer)arr[0]).intValue(), (ArrayInitializerExpr)arr[1]); - } else { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List)arr[0], ((Integer)arr[1]).intValue()); - } - } - | - LOOKAHEAD(ClassOrInterfaceType() ArrayDimsAndInits()) - type = ClassOrInterfaceType() - arr = ArrayDimsAndInits() - { - if (arr[0] instanceof Integer) { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer)arr[0]).intValue(), (ArrayInitializerExpr)arr[1]); - } else { - ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List)arr[0], ((Integer)arr[1]).intValue()); - } - } - | - [ typeArgs = TypeArguments() {typeArgs.remove(0);} ] - type = ClassOrInterfaceType() - args = Arguments() [ LOOKAHEAD(2) anonymousBody = ClassOrInterfaceBody(false) ] - { ret = new ObjectCreationExpr(line, column, token.endLine, token.endColumn, scope, (ClassOrInterfaceType) type, typeArgs, args, anonymousBody); } - ) - { return ret; } -} - -/* - * The third LOOKAHEAD specification below is to parse to PrimarySuffix - * if there is an expression between the "[...]". - */ -Object[] ArrayDimsAndInits(): -{ - Object[] ret = new Object[2]; - Expression expr; - List inits = null; - int i = 0; -} -{ - ( - LOOKAHEAD(2) - ( LOOKAHEAD(2) "[" expr = Expression() { inits = add(inits, expr); } "]" )+ ( LOOKAHEAD(2) "[" "]" { i++; } )* { ret[0] = inits; ret[1] = new Integer(i); } - | - ( "[" "]" { i++; } )+ expr = ArrayInitializer() { ret[0] = new Integer(i); ret[1] = expr; } - ) - { return ret; } -} - - -/* - * Statement syntax follows. - */ - -Statement Statement(): -{ - Statement ret; -} -{ - ( - LOOKAHEAD(2) - ret = LabeledStatement() - | - ret = AssertStatement() - | - ret = Block() - | - ret = EmptyStatement() - | - ret = StatementExpression() - | - ret = SwitchStatement() - | - ret = IfStatement() - | - ret = WhileStatement() - | - ret = DoStatement() - | - ret = ForStatement() - | - ret = BreakStatement() - | - ret = ContinueStatement() - | - ret = ReturnStatement() - | - ret = ThrowStatement() - | - ret = SynchronizedStatement() - | - ret = TryStatement() - ) - { return ret; } -} - -AssertStmt AssertStatement(): -{ - Expression check; - Expression msg = null; - int line; - int column; -} -{ - "assert" {line=token.beginLine; column=token.beginColumn;} check = Expression() [ ":" msg = Expression() ] ";" - { return new AssertStmt(line, column, token.endLine, token.endColumn,check, msg); } -} - -LabeledStmt LabeledStatement(): -{ - String label; - Statement stmt; - int line; - int column; -} -{ - {line=token.beginLine; column=token.beginColumn;} { label = token.image; } ":" stmt = Statement() - { return new LabeledStmt(line, column, token.endLine, token.endColumn,label, stmt); } -} - -BlockStmt Block(): -{ - List stmts; - int beginLine; - int beginColumn; -} -{ - "{" {beginLine=token.beginLine; beginColumn=token.beginColumn;} - stmts = Statements() - "}" - { return new BlockStmt(beginLine, beginColumn, token.endLine, token.endColumn, stmts); } -} - -/* - * Classes inside block stametents can only be abstract or final. The semantic must check it. - */ -Statement BlockStatement(): -{ - Statement ret; - Expression expr; - ClassOrInterfaceDeclaration typeDecl; - Modifier modifier; -} -{ - ( - LOOKAHEAD( Modifiers() ("class" | "interface") ) - { pushJavadoc(); } - modifier = Modifiers() - typeDecl = ClassOrInterfaceDeclaration(modifier) { ret = new TypeDeclarationStmt(typeDecl.getBeginLine(), typeDecl.getBeginColumn(), token.endLine, token.endColumn, typeDecl); } - | - LOOKAHEAD(VariableDeclarationExpression() ) - expr = VariableDeclarationExpression() ";" - { ret = new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); } - | - ret = Statement() - ) - { return ret; } -} - -VariableDeclarationExpr VariableDeclarationExpression(): -{ - Modifier modifier; - Type type; - List vars = new LinkedList(); - VariableDeclarator var; -} -{ - modifier = Modifiers() type = Type() var = VariableDeclarator() { vars.add(var); } ( "," var = VariableDeclarator() { vars.add(var); } )* - { - int line = modifier.beginLine; - int column = modifier.beginColumn; - if(line==-1) {line=type.getBeginLine(); column=type.getBeginColumn(); } - return new VariableDeclarationExpr(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, vars); - } -} - -EmptyStmt EmptyStatement(): -{} -{ - ";" - { return new EmptyStmt(token.beginLine, token.beginColumn, token.endLine, token.endColumn); } -} - -ExpressionStmt StatementExpression(): -/* - * The last expansion of this production accepts more than the legal - * Java expansions for StatementExpression. This expansion does not - * use PostfixExpression for performance reasons. - */ -{ - Expression expr; - AssignExpr.Operator op; - Expression value; -} -{ - ( - expr = PreIncrementExpression() - | - expr = PreDecrementExpression() - | - expr = PrimaryExpression() - [ - "++" { expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posIncrement); } - | - "--" { expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posDecrement); } - | - op = AssignmentOperator() value = Expression() { expr = new AssignExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, value, op); } - ] - ) - ";" - { return new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); } -} - -SwitchStmt SwitchStatement(): -{ - Expression selector; - SwitchEntryStmt entry; - List entries = null; - int line; - int column; -} -{ - "switch" {line=token.beginLine; column=token.beginColumn;} "(" selector = Expression() ")" "{" - ( entry = SwitchEntry() { entries = add(entries, entry); } )* - "}" - - { return new SwitchStmt(line, column, token.endLine, token.endColumn,selector, entries); } -} - -SwitchEntryStmt SwitchEntry(): -{ - Expression label = null; - List stmts; - int line; - int column; -} -{ - ( - "case" {line=token.beginLine; column=token.beginColumn;} label = Expression() - | - "default" {line=token.beginLine; column=token.beginColumn;} - ) - ":" stmts = Statements() - - { return new SwitchEntryStmt(line, column, token.endLine, token.endColumn,label, stmts); } -} - -IfStmt IfStatement(): -/* - * The disambiguating algorithm of JavaCC automatically binds dangling - * else's to the innermost if statement. The LOOKAHEAD specification - * is to tell JavaCC that we know what we are doing. - */ -{ - Expression condition; - Statement thenStmt; - Statement elseStmt = null; - int line; - int column; -} -{ - "if" {line=token.beginLine; column=token.beginColumn;} "(" condition = Expression() ")" thenStmt = Statement() [ LOOKAHEAD(1) "else" elseStmt = Statement() ] - { return new IfStmt(line, column, token.endLine, token.endColumn,condition, thenStmt, elseStmt); } -} - -WhileStmt WhileStatement(): -{ - Expression condition; - Statement body; - int line; - int column; -} -{ - "while" {line=token.beginLine; column=token.beginColumn;} "(" condition = Expression() ")" body = Statement() - { return new WhileStmt(line, column, token.endLine, token.endColumn,condition, body); } -} - -DoStmt DoStatement(): -{ - Expression condition; - Statement body; - int line; - int column; -} -{ - "do" {line=token.beginLine; column=token.beginColumn;} body = Statement() "while" "(" condition = Expression() ")" ";" - { return new DoStmt(line, column, token.endLine, token.endColumn,body, condition); } -} - -Statement ForStatement(): -{ - String id = null; - VariableDeclarationExpr varExpr = null; - Expression expr = null; - List init = null; - List update = null; - Statement body; - int line; - int column; -} -{ - "for" {line=token.beginLine; column=token.beginColumn;} "(" - - ( - LOOKAHEAD(VariableDeclarationExpression() ":") - varExpr = VariableDeclarationExpression() ":" expr = Expression() - | - [ init = ForInit() ] ";" [ expr = Expression() ] ";" [ update = ForUpdate() ] - ) - - ")" body = Statement() - - { - if (varExpr != null) { - return new ForeachStmt(line, column, token.endLine, token.endColumn,varExpr, expr, body); - } - return new ForStmt(line, column, token.endLine, token.endColumn,init, expr, update, body); - } -} - -List ForInit(): -{ - List ret; - Expression expr; -} -{ - ( - LOOKAHEAD( Modifiers() Type() ) - expr = VariableDeclarationExpression() { ret = new LinkedList(); ret.add(expr); } - | - ret = ExpressionList() - ) - { return ret; } -} - -List ExpressionList(): -{ - List ret = new LinkedList(); - Expression expr; -} -{ - expr = Expression() { ret.add(expr); } ( "," expr = Expression() { ret.add(expr); } )* - - { return ret; } -} - -List ForUpdate(): -{ - List ret; -} -{ - ret = ExpressionList() - - { return ret; } -} - -BreakStmt BreakStatement(): -{ - String id = null; - int line; - int column; -} -{ - "break" {line=token.beginLine; column=token.beginColumn;} [ { id = token.image; } ] ";" - { return new BreakStmt(line, column, token.endLine, token.endColumn,id); } -} - -ContinueStmt ContinueStatement(): -{ - String id = null; - int line; - int column; -} -{ - "continue" {line=token.beginLine; column=token.beginColumn;} [ { id = token.image; } ] ";" - { return new ContinueStmt(line, column, token.endLine, token.endColumn,id); } -} - -ReturnStmt ReturnStatement(): -{ - Expression expr = null; - int line; - int column; -} -{ - "return" {line=token.beginLine; column=token.beginColumn;} [ expr = Expression() ] ";" - { return new ReturnStmt(line, column, token.endLine, token.endColumn,expr); } -} - -ThrowStmt ThrowStatement(): -{ - Expression expr; - int line; - int column; -} -{ - "throw" {line=token.beginLine; column=token.beginColumn;} expr = Expression() ";" - { return new ThrowStmt(line, column, token.endLine, token.endColumn,expr); } -} - -SynchronizedStmt SynchronizedStatement(): -{ - Expression expr; - BlockStmt block; - int line; - int column; -} -{ - "synchronized" {line=token.beginLine; column=token.beginColumn;} "(" expr = Expression() ")" block = Block() - { return new SynchronizedStmt(line, column, token.endLine, token.endColumn,expr, block); } -} - -TryStmt TryStatement(): -/* - * Semantic check required here to make sure that at least one - * finally/catch is present. - */ -{ - BlockStmt tryBlock; - BlockStmt finallyBlock = null; - List catchs = null; - Parameter except; - BlockStmt catchBlock; - int line; - int column; - int cLine; - int cColumn; -} -{ - "try" {line=token.beginLine; column=token.beginColumn;} tryBlock = Block() - ( - ( - "catch" {cLine=token.beginLine; cColumn=token.beginColumn;} - "(" except = FormalParameter() ")" catchBlock = Block() - { catchs = add(catchs, new CatchClause(cLine, cColumn, token.endLine, token.endColumn, except, catchBlock)); } - )+ - [ "finally" finallyBlock = Block() ] - | - "finally" finallyBlock = Block() - ) - { return new TryStmt(line, column, token.endLine, token.endColumn,tryBlock, catchs, finallyBlock); } -} - - - -/* We use productions to match >>>, >> and > so that we can keep the - * type declaration syntax with generics clean - */ - -void RUNSIGNEDSHIFT(): -{} -{ - ( LOOKAHEAD({ getToken(1).kind == GT && - ((GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT} ) - ">" ">" ">" - ) -} - -void RSIGNEDSHIFT(): -{} -{ - ( LOOKAHEAD({ getToken(1).kind == GT && - ((GTToken)getToken(1)).realKind == RSIGNEDSHIFT} ) - ">" ">" - ) -} - -/* Annotation syntax follows. */ - -AnnotationExpr Annotation(): -{ - AnnotationExpr ret; -} -{ - ( - LOOKAHEAD( "@" Name() "(" ( "=" | ")" )) - ret = NormalAnnotation() - | - LOOKAHEAD( "@" Name() "(" ) - ret = SingleMemberAnnotation() - | - ret = MarkerAnnotation() - ) - { return ret; } -} - -NormalAnnotationExpr NormalAnnotation(): -{ - NameExpr name; - List pairs = null; - int line; - int column; -} -{ - "@" {line=token.beginLine; column=token.beginColumn;} name = Name() "(" [ pairs = MemberValuePairs() ] ")" - { return new NormalAnnotationExpr(line, column, token.endLine, token.endColumn,name, pairs); } -} - -MarkerAnnotationExpr MarkerAnnotation(): -{ - NameExpr name; - int line; - int column; -} -{ - "@" {line=token.beginLine; column=token.beginColumn;} name = Name() - { return new MarkerAnnotationExpr(line, column, token.endLine, token.endColumn,name); } -} - -SingleMemberAnnotationExpr SingleMemberAnnotation(): -{ - NameExpr name; - Expression memberVal; - int line; - int column; -} -{ - "@" {line=token.beginLine; column=token.beginColumn;} name = Name() "(" memberVal = MemberValue() ")" - { return new SingleMemberAnnotationExpr(line, column, token.endLine, token.endColumn,name, memberVal); } -} - -List MemberValuePairs(): -{ - List ret = new LinkedList(); - MemberValuePair pair; -} -{ - pair = MemberValuePair() { ret.add(pair); } ( "," pair = MemberValuePair() { ret.add(pair); } )* - { return ret; } -} - -MemberValuePair MemberValuePair(): -{ - String name; - Expression value; - int line; - int column; -} -{ - { name = token.image; line=token.beginLine; column=token.beginColumn;} "=" value = MemberValue() - { return new MemberValuePair(line, column, token.endLine, token.endColumn,name, value); } -} - -Expression MemberValue(): -{ - Expression ret; -} -{ - ( - ret = Annotation() - | - ret = MemberValueArrayInitializer() - | - ret = ConditionalExpression() - ) - { return ret; } -} - -Expression MemberValueArrayInitializer(): -{ - List ret = new LinkedList(); - Expression member; - int line; - int column; -} -{ - "{" {line=token.beginLine; column=token.beginColumn;} - ( member = MemberValue() { ret.add(member); } ( LOOKAHEAD(2) "," member = MemberValue() { ret.add(member); } )* )? [ "," ] - "}" - { return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn,ret); } -} - - -/* Annotation Types. */ - -AnnotationDeclaration AnnotationTypeDeclaration(Modifier modifier): -{ - String name; - List members; - int line = modifier.beginLine; - int column = modifier.beginColumn; -} -{ - "@" { if (line == -1) {line=token.beginLine; column=token.beginColumn;} } - "interface" { name = token.image; } members = AnnotationTypeBody() - - { return new AnnotationDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, name, members); } -} - -List AnnotationTypeBody(): -{ - List ret = null; - BodyDeclaration member; -} -{ - "{" ( member = AnnotationBodyDeclaration() { ret = add(ret, member); } )* "}" - - { return ret; } -} - -BodyDeclaration AnnotationBodyDeclaration(): -{ - Modifier modifier; - BodyDeclaration ret; -} -{ - { pushJavadoc(); } - ( - ";" { ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); } - | - modifier = Modifiers() - ( - LOOKAHEAD(Type() "(") - ret = AnnotationTypeMemberDeclaration(modifier) - | - ret = ClassOrInterfaceDeclaration(modifier) - | - ret = EnumDeclaration(modifier) - | - ret = AnnotationTypeDeclaration(modifier) - | - ret = FieldDeclaration(modifier) - ) - ) - { return ret; } -} - -AnnotationMemberDeclaration AnnotationTypeMemberDeclaration(Modifier modifier): -{ - Type type; - String name; - Expression defaultVal = null; -} -{ - type = Type() { name = token.image; } "(" ")" [ defaultVal = DefaultValue() ] ";" - - { - int line = modifier.beginLine; - int column = modifier.beginColumn; - { if (line == -1) {line=type.getBeginLine(); column=type.getBeginColumn();} } - return new AnnotationMemberDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, type, name, defaultVal); - } -} - -Expression DefaultValue(): -{ - Expression ret; -} -{ - "default" ret = MemberValue() - { return ret; } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ClassifierCatalog.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ClassifierCatalog.java deleted file mode 100644 index f7777787f1e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ClassifierCatalog.java +++ /dev/null @@ -1,393 +0,0 @@ -/** - * - */ -package javagen.umlparser; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Package; - -/** - * Instance of this class allows to lookup for a Classifier. - * Lookup is done in the provided paths. - * Classifier or Package are not created. An error is thrown when not found. - * - * @author dumoulin - * - * @TODO rename to ClasspathCatalog - */ -public class ClassifierCatalog { - - public static final String WILDCARD = "*"; - - /** Model containing the paths */ - protected Resource model; - - /** model Package used as root of all searchpaths */ - private Package modelRootPackage; - - /** The package containing the current compilation unit. First package searched */ - private Package currentCompilationUnitPackage; - - /** - * List of packages from where the lookup is done. - */ - protected List paths = new ArrayList();; - - /** - * Constructor. - */ - public ClassifierCatalog(Resource model) { - this.model = model; - paths.add(new ResourceSearchPackage()); - } - - /** - * Constructor. - * Not used anymore - * - * @param model - * The Resource containing the packages - */ - public ClassifierCatalog(Resource model, List packageNames) { - this.model = model; - for (String name : packageNames) { - if ("/".equals(name)) { - paths.add(new ResourceSearchPackage()); - } else { - List qualifiedName = dirToQualifiedName(name); - // Get corresponding package if any - paths.add(new ResourceRelativeSearchPackage(qualifiedName)); - } - - } - } - - /** - * Constructor. - * search paths are relative to the specified package. - * - * @param modelRootPackage - * The model Package used as root. - */ - public ClassifierCatalog(Package modelRootPackage, List packageNames) { - this.modelRootPackage = modelRootPackage; - for (String name : packageNames) { - if ("/".equals(name)) { - paths.add(new ResourceSearchPackage()); - } else { - List qualifiedName = dirToQualifiedName(name); - if (name.contains(WILDCARD)) { - // Use search path with wildcard - paths.add(new RelativeSearchPackageWithWildcard(qualifiedName)); - } - else { - // Get corresponding package if any - paths.add(new RelativeSearchPackage(qualifiedName)); - } - - - } - - } - } - - /** - * @param currentCompilationUnitPackage - * the currentCompilationUnitPackage to set - */ - public void setCurrentCompilationUnitPackage(Package currentCompilationUnitPackage) { - this.currentCompilationUnitPackage = currentCompilationUnitPackage; - } - - /** - * Get the qualified name from a directory like name. - * Name is splitted arround '/' - * - * @param name - * @return - */ - private List dirToQualifiedName(String qname) { - String[] splittedName = qname.split("/"); - return Arrays.asList(splittedName); - } - - - /** - * Get the classifier by its qname. - * - * @param qualifiedName - * @return - */ - public Classifier getClassifier(String qualifiedName) { - List qname = UmlUtils.toQualifiedName(qualifiedName); - return getClassifier(qname); - } - - /** - * Get the classifier by its qualified name. - * - * @param qualifiedName - * @return - */ - public Classifier getClassifier(List qualifiedName) { - return lookupNamedElement(qualifiedName, null); - // for( Package path : paths) - // { - // NamedElement res = getNamedElement(path, qualifiedName); - // if(res != null ) - // return (Classifier)res; - // } - // - // return null; - } - - /** - * Look for the specified element in each of the path of the model. - * Return the first corresponding element found in paths. - * - * @param qualifiedName - * Expected name. - * @param type - * Expected type or null. - * @return - */ - private Classifier lookupNamedElement(List qualifiedName, EClass type) { - - // search on current CU - if (currentCompilationUnitPackage != null) { - Classifier res = UmlUtils.lookupClassifier(currentCompilationUnitPackage, qualifiedName, type); - if (res != null) { - return res; - } - } - - // loop on searchpaths - for (SearchPackage path : paths) { - Classifier res = path.getUmlClassifier(qualifiedName, type); - if (res != null) { - return res; - } - } - - return null; - } - - - /** - * Class corresponding to one searchpath. - * - * @author dumoulin - * - */ - abstract private class SearchPackage { - - /** - * Cached value. Can be null. - */ - protected Package umlPackage; - - /** - * Search path - */ - protected List packageQualifiedName; - - /** - * @param qualifiedName - */ - public SearchPackage(List qualifiedName) { - super(); - this.packageQualifiedName = qualifiedName; - } - - abstract public Classifier getUmlClassifier(List qualifiedName, EClass expectedType); - } - - /** - * This class allows to search for uml element in specified packages relative to the Resource. - * - * @author dumoulin - * - */ - private class ResourceRelativeSearchPackage extends SearchPackage { - - public ResourceRelativeSearchPackage(List qualifiedName) { - super(qualifiedName); - } - - /** - * Get the uml package corresponding to the path. - * - * @return - */ - private Package getPathPackage() { - - // Check if in cache - if (umlPackage != null) { - return umlPackage; - } - - // No, Try to find package using the resource - umlPackage = UmlUtils.lookupPackage(model, packageQualifiedName); - return umlPackage; - } - - /** - * lookup for the classifier in this searchpath. - */ - @Override - public Classifier getUmlClassifier(List qualifiedName, EClass expectedType) { - Package p = getPathPackage(); - if (p == null) { - return null; - } - - return UmlUtils.lookupClassifier(p, qualifiedName, expectedType); - } - } - - /** - * This class allows to search for uml element in packages relative to the modelRootPackage. - * - * @author dumoulin - * - */ - private class RelativeSearchPackage extends SearchPackage { - - public RelativeSearchPackage(List qualifiedName) { - super(qualifiedName); - } - - /** - * Get the uml package corresponding to the path. - * Search from the modelRootPackage. - * - * @return - */ - private Package getPathPackage() { - // Check if in cache - if (umlPackage != null) { - return umlPackage; - } - - // No, Try to find package using the root package - umlPackage = UmlUtils.lookupPackage(modelRootPackage, packageQualifiedName); - return umlPackage; - } - - /** - * lookup for the classifier in this searchpath. - */ - @Override - public Classifier getUmlClassifier(List qualifiedName, EClass expectedType) { - Package p = getPathPackage(); - if (p == null) { - return null; - } - - return UmlUtils.lookupClassifier(p, qualifiedName, expectedType); - } - - } - - /** - * This class allows to search for uml element in packages relative to the modelRootPackage. - * - * @author dumoulin - * - */ - private class RelativeSearchPackageWithWildcard extends SearchPackage { - - /** - * - * Constructor. - * - * @param searchpath - * Search path, with a wildcard. - */ - public RelativeSearchPackageWithWildcard(List searchpath) { - super(searchpath); - } - - /** - * Lookup the uml package corresponding to the path with WILDCARD. - * Search from the modelRootPackage. - * - * @return - */ - private List lookupExistingPackages() { - - - // Lookup the package containing the wildcard, and put it in cache - if (umlPackage == null) { - umlPackage = UmlUtils.lookupPackageBeforeWildcard(modelRootPackage, packageQualifiedName); - } - - if (umlPackage == null) { - return Collections.emptyList(); - } - - // No, Try to find package using the root package - // Look for existing packages at the place of the wildcard. - List existingPackages = umlPackage.getNestedPackages(); - - return existingPackages; - } - - /** - * lookup for the classifier in this searchpath. - */ - @Override - public Classifier getUmlClassifier(List qualifiedName, EClass expectedType) { - - // Iterate on possible searchpaths - int wildcardIndex = packageQualifiedName.indexOf(WILDCARD); - // Get existing packages for the path, untill the wildcard - List existingPackages = lookupExistingPackages(); - - // Get the remaining path from ]index, size] - List remainingPath = qualifiedName.subList(wildcardIndex + 1, qualifiedName.size()); - // Now do searching from the existing packages - for (Package nestedPackage : existingPackages) { - - Classifier res = UmlUtils.lookupClassifier(nestedPackage, qualifiedName, expectedType); - if (res != null) { - return res; - } - } - - // Not found - return null; - } - - } - - /** - * This class allows to search for uml element in the resource. - * - * @author dumoulin - * - */ - private class ResourceSearchPackage extends SearchPackage { - - public ResourceSearchPackage() { - super(null); - // TODO Auto-generated constructor stub - } - - /** - * lookup for the classifier in this searchpath. - */ - @Override - public Classifier getUmlClassifier(List qualifiedName, EClass expectedType) { - return UmlUtils.lookupClassifier(model, qualifiedName, expectedType); - } - - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CompilationUnitAnalyser.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CompilationUnitAnalyser.java deleted file mode 100644 index 78a09f7764e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CompilationUnitAnalyser.java +++ /dev/null @@ -1,1245 +0,0 @@ -/** - * - */ -package javagen.umlparser; - -import japa.parser.ast.CompilationUnit; -import japa.parser.ast.ImportDeclaration; -import japa.parser.ast.Node; -import japa.parser.ast.PackageDeclaration; -import japa.parser.ast.body.BodyDeclaration; -import japa.parser.ast.body.ClassOrInterfaceDeclaration; -import japa.parser.ast.body.FieldDeclaration; -import japa.parser.ast.body.JavadocComment; -import japa.parser.ast.body.MethodDeclaration; -import japa.parser.ast.body.ModifierSet; -import japa.parser.ast.body.Parameter; -import japa.parser.ast.body.TypeDeclaration; -import japa.parser.ast.body.VariableDeclarator; -import japa.parser.ast.expr.AnnotationExpr; -import japa.parser.ast.expr.NameExpr; -import japa.parser.ast.expr.QualifiedNameExpr; -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.type.PrimitiveType; -import japa.parser.ast.type.ReferenceType; -import japa.parser.ast.type.VoidType; -import japa.parser.ast.type.WildcardType; -import japa.parser.ast.visitor.VoidVisitorAdapter; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import javagen.umlparser.TypeAnalyserAndTranslator.TranslatedTypeData; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.uml2.uml.BehavioredClassifier; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Feature; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Namespace; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.ParameterDirectionKind; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.VisibilityKind; - -/** - * A visitor filling the provided UML model - * - * @author dumoulin - * - */ -public class CompilationUnitAnalyser { - - - public static String DEFAULT_GENERATION_PACKAGE_NAME = "generated"; - - public static String DEFAULT_ROOT_PACKAGE_NAME = "model"; - - private List generationPackageQualifiedName; - - /** - * Root package of the generation. All generated elements will be added to this package, or one of - * its subpackages - */ - private org.eclipse.uml2.uml.Package defaultGenerationPackage; - - /** - * Catalog used to get the package needed for a creation. - */ - private CreationPackageCatalog creationPackageCatalog; - - /** - * Catalog used to lookup for a classifier. The catalog specifies a collection of models - * containing the java packages - */ - private ClassifierCatalog classifierCatalog; - - /** - * Catalog used to store the imports and to lookup for the qualified name of an element. - */ - private ImportedTypeCatalog importedTypes; - - /** - * The Package containing the current compilation unit. - * Initialized at the beginning of exploreCompilationUnit() - */ - private Package currentCompilationUnitPackage; - - /** - * Enclosing namespaces of the currently processed class. - * The first element is always the current package. - */ - private List enclosingNamespaces = new ArrayList(); - - /** - * Visitor used to parse qualified names. - */ - private QualifiedNameParser qualifiedNameParser = new QualifiedNameParser(); - - private TypeAnalyserAndTranslator typeAnalyser; - - /** Model where all element are created */ - - /** - * Constructor. - */ - public CompilationUnitAnalyser(Resource model) { - - this(model, DEFAULT_ROOT_PACKAGE_NAME, DEFAULT_GENERATION_PACKAGE_NAME, null); - } - - /** - * - * Constructor. - */ - public CompilationUnitAnalyser(Resource model, String generatePackageName, List searchPaths) { - - this(model, DEFAULT_ROOT_PACKAGE_NAME, generatePackageName, searchPaths); - } - - /** - * - * Constructor. - */ - public CompilationUnitAnalyser(Resource model, String modelRootPackageName, String generatePackageName, List searchPaths) { - - Package modelRootPackage = UmlUtils.getPackage(model, dirToQualifiedName(modelRootPackageName)); - initCompilationUnitAnalyser(modelRootPackage, generatePackageName, searchPaths); - } - - /** - * - * Constructor. - * All provided paths and searchpaths are relative to the specified modelRootPackage. - */ - public CompilationUnitAnalyser(Package modelRootPackage, String generatePackageName, List searchPaths) { - - // this.model = model; - - initCompilationUnitAnalyser(modelRootPackage, generatePackageName, searchPaths); - } - - /** - * Initialize the class. Called by constructors. - * - * @param modelRootPackage - * @param generatePackageName - * @param searchPaths - */ - private void initCompilationUnitAnalyser(Package modelRootPackage, String generatePackageName, List searchPaths) { - if (generatePackageName == null) { - generatePackageName = DEFAULT_GENERATION_PACKAGE_NAME; - } - - this.generationPackageQualifiedName = dirToQualifiedName(generatePackageName); - - - // Copy searchpath in order to be able to change it. - if (searchPaths != null) { - searchPaths = new ArrayList(searchPaths); - } else { - searchPaths = new ArrayList(); - } - - // Add generation package in search paths - if (!searchPaths.contains(generatePackageName)) { - searchPaths.add(generatePackageName); - } - - System.out.println(this.getClass().getSimpleName() + ".CT(" + generationPackageQualifiedName + ", sarchpaths=" + searchPaths + ")"); - - - createDefaultGenerationPackage(modelRootPackage); - - classifierCatalog = new ClassifierCatalog(modelRootPackage, searchPaths); - importedTypes = new ImportedTypeCatalog(); - creationPackageCatalog = new CreationPackageCatalog(modelRootPackage, defaultGenerationPackage, null); - - typeAnalyser = new TypeAnalyserAndTranslator(importedTypes); - } - - - - /** - * Get the qualified name from a directory like name. - * Name is splitted arround '/' - * - * @param name - * @return - */ - private List dirToQualifiedName(String qname) { - String[] splittedName = qname.split("/"); - return Arrays.asList(splittedName); - } - - /** - * Create the root element in which all element will be created. - */ - private void createDefaultGenerationPackage(Resource model) { - - Package p = UmlUtils.getPackage(model, generationPackageQualifiedName); - defaultGenerationPackage = p; - } - - /** - * Create the root element in which all element will be created. - */ - private void createDefaultGenerationPackage(Package rootModelElement) { - - // Package p = UmlUtils.getPackage(rootModelElement, generationPackageQualifiedName); - Package p = UmlUtils.getModel(rootModelElement, generationPackageQualifiedName); - defaultGenerationPackage = p; - } - - /** - * Explore the CU and create the declared types - * - * @param cu - */ - public void processCompilationUnit(CompilationUnit cu) { - - // First, find the parent Package - currentCompilationUnitPackage = getCuPackage(cu.getPakage()); - ; - classifierCatalog.setCurrentCompilationUnitPackage(currentCompilationUnitPackage); - - // Add imports - importedTypes.clear(); - if (cu.getImports() != null) { - addImports(importedTypes, cu.getImports()); - } - - // Now, explore each type declared type in the cu - if (cu.getTypes() != null) { - // for (Iterator i = cu.getTypes().iterator(); - // i.hasNext();) - // Process all types - for (TypeDeclaration typeDecl : cu.getTypes()) { - // Build the enclosing namespaces. Add the package as parent - enclosingNamespaces.add(currentCompilationUnitPackage); - processTypedeclaration(enclosingNamespaces, typeDecl); - // Reset the list of enclosing parents, in case of errors - enclosingNamespaces.clear(); - } // end loop - } // end if - - } - - /** - * Process Typedeclaration 2 Classifier. - * Process common parts : modifiers, members, ... - * - * @param enclosingParents - * The package, followed by nested classes if any. - * @param typeDecl - */ - private void processTypedeclaration(final List enclosingParents, TypeDeclaration typeDecl) { - Classifier classifier; - - // Process right type - // Create the corresponding type. - classifier = new GenericSwitchVisitor>() { - - @Override - public Classifier visit(ClassOrInterfaceDeclaration n, List enclosingParents) { - return processClassOrInterfaceDeclaration(n, enclosingParents); - } - - // TODO Other kind of types - }.doSwitch(typeDecl, enclosingParents); - - // Set Visibility - createModifiers(classifier, typeDecl.getModifiers()); - - // Template parameters - // TODO - - // Explore members - if (typeDecl.getMembers() != null) { - for (BodyDeclaration member : typeDecl.getMembers()) { - new SwitchVisitor() { - - @Override - public void visit(FieldDeclaration n, Type classifier) { - createAttributes(n, classifier); - } - - @Override - public void visit(MethodDeclaration n, Type classifier) { - processMethod(n, (Classifier) classifier); - } - - /** - * Inner classes ? - * - * @param n - * @param arg - */ - @Override - public void visit(ClassOrInterfaceDeclaration n, Type classifier) { - System.out.println("Found nested class (ClassOrInterface)'" + n.getName() + "'"); - - // Process nested classifier, and create it in its nested namespace - // So, increase the enclosing parents. - enclosingParents.add((Classifier) classifier); - processTypedeclaration(enclosingParents, n); - enclosingParents.remove(classifier); - // processClassOrInterfaceDeclaration(n, parent) - super.visit(n, classifier); - } - // TODO Other kind of members - }.doSwitch(member, classifier); - } - - } - } - - /** - * Add all the imports to the manager. - * - * @param importedTypes2 - * @param imports - */ - private void addImports(ImportedTypeCatalog importedTypes, List imports) { - - - for (ImportDeclaration decl : imports) { - List qualifiedName = qualifiedNameParser.getImportQualifiedName(decl); - if (decl.isAsterisk()) { - qualifiedName.add("*"); - } - importedTypes.addImport(qualifiedName); - } - - } - - /** - * Get (lookup or create) the specified classifier. - * Translate the qualifiedName according to imports, and lookup in classifierCatalog . - * If nothing is found and provided name is not qualified, create/get in parent, otherwise create/get in root - * using the qualified name. - * - * @param qualifiedName - * @param isInterface - * What should be created if nothing is found ? An interface or a Class ? - * @return - */ - private Classifier getUmlClassifier(List qualifiedName, boolean isInterface) { - // Get the corresponding type - // TODO specify requested type - // Lookup if it exist in the catalog (under one of the specified path) - Classifier foundClass = classifierCatalog.getClassifier(qualifiedName); - - // If nothing found, create it - if (foundClass == null) {// Not yet created. - EClass expectedType; - if (isInterface) { - expectedType = UMLPackage.eINSTANCE.getInterface(); - } else { - expectedType = UMLPackage.eINSTANCE.getClass_(); - } - - // Check where to create - if (importedTypes.isImportedType(qualifiedName)) { - // This is an imported type, create it in its dedicated model - // First get the package where to create it, according to its name - Package creationPackage = creationPackageCatalog.getCreationPackage(qualifiedName); - // Now, create it. - foundClass = UmlUtils.getClassifier(creationPackage, qualifiedName, expectedType); - } else { - // The qualified name is relative to one of the enclosing namespace. - // Check if it exist, or create it. - foundClass = UmlUtils.getGuessedClassifier(enclosingNamespaces, qualifiedName, expectedType); - } - - - - // if(qualifiedName.size() == 1 && currentCompilationUnitPackage != null) { - // // No scope in qname, create it in current namespace. - // // TODO use current namespace instead of current package. - // - // // TODO change to create (avoid second lookup) - // // foundClass = UmlUtils.getClassifier(currentCompilationUnitPackage, qualifiedName, expectedType); - // foundClass = UmlUtils.getGuessedClassifier(enclosingNamespaces, qualifiedName.get(0), expectedType); - // } else { - // //create with specified qname - // // First get the package where to create it, according to its name - // Package creationPackage = creationPackageCatalog.getCreationPackage(qualifiedName); - // // Now, create it. - // foundClass = UmlUtils.getClassifier(creationPackage, qualifiedName, expectedType); - // } - } - return foundClass; - } - - /** - * Get the type qualified name from its ast description - * - * @param astType - * @return - */ - private List getQualifiedName(ClassOrInterfaceType astType) { - QualifiedNameParser visitor = new QualifiedNameParser(); - - List res = visitor.getClassOrInterfaceQualifiedName(astType); - return res; - } - - /** - * Create all attributes and add it to the parent. - * - * @param n - * @param parent - */ - protected void createAttributes(FieldDeclaration n, Type parent) { - - System.out.println("getAttributeType( from:" + n.getType().getClass().getName() + ")"); - - // Get data about the type - // Get the qualified name, and other info on type - TranslatedTypeData typeData = processType(n.getType()); - // Get the uml element from the qualified name - Type umlType = getUmlType(typeData); - - // walk on variable declarations. - for (VariableDeclarator var : n.getVariables()) { - if (parent instanceof Classifier) { - createAttribute(n, var, (Classifier) parent, umlType, typeData); - } - } - } - - /** - * Get the qualified name, and other info on type. - * Lookup in imports to resolve names. - * - * @param n - * @return - */ - private TranslatedTypeData processType(japa.parser.ast.type.Type astType) { - TranslatedTypeData data = typeAnalyser.getTranslatedTypeData(astType); - - return data; - } - - /** - * Get the uml type from the translated type. - * - * @param data - * @return - */ - private Type getUmlType(TranslatedTypeData data) { - // Get the uml type - Type umlType = null; - if (data.isPrimitive) { - umlType = classifierCatalog.getClassifier(data.qualifiedName); - if (umlType == null) { - Package creationPackage = creationPackageCatalog.getCreationPackage(data.qualifiedName); - umlType = UmlUtils.getPrimitive(creationPackage, data.qualifiedName); - } - } else if (data.isVoid || data.isWildcard) { - return null; - } else { - // Look for existing classifier of any type. - // Take the first letter of the name as an hint. IXxxx - List qualifiedName = data.getTranslatedQualifiedName(); - boolean isInterface = false; - String shortName = qualifiedName.get(qualifiedName.size() - 1); - - // Try to guess if it is an interface. - if (shortName.length() > 2 && shortName.startsWith("I") && Character.isUpperCase(shortName.charAt(1))) { - isInterface = true; - } - - // Get or create type. - umlType = getUmlClassifier(qualifiedName, isInterface); - } - return umlType; - } - - /** - * Get the Type from an ast.Type node. - * - * @param astType - * @return - */ - protected TypeData getAttributeType(japa.parser.ast.type.Type astType) { - - TypeData res = new TypeData(); - - new SwitchVisitor() { - - /** - * Get type from a class. - */ - @Override - public void visit(ClassOrInterfaceType n, TypeData data) { - List qnameBefore = getQualifiedName(n); - List qname = importedTypes.getQualifiedName(qnameBefore); - - data.qualifiedName = qname; - // Check for generic parameters - if (n.getTypeArgs() != null) { - data.genericData = new ArrayList(); - for (japa.parser.ast.type.Type arg : n.getTypeArgs()) { - TypeData argData = new TypeData(); - arg.accept(this, argData); - data.genericData.add(argData); - } - } - } - - @Override - public void visit(ReferenceType n, TypeData data) { - // skip the reference node and process the child. - // Should not appear in an type use (in Attribute or method) - data.arrayCount = n.getArrayCount(); - n.getType().accept(this, data); - } - - @Override - public void visit(PrimitiveType n, TypeData data) { - String qnameBefore = getPrimitiveName(n); - List qname = importedTypes.getQualifiedName(qnameBefore); - - data.qualifiedName = qname; - data.isPrimitive = true; - } - - @Override - public void visit(WildcardType n, TypeData data) { - data.isWildcard = true; - if (n.getExtends() != null) { - data.extends_ = new TypeData(); - n.getExtends().accept(this, data.extends_); - } - if (n.getSuper() != null) { - data.super_ = new TypeData(); - n.getSuper().accept(this, data.super_); - } - - } - - @Override - public void visit(VoidType n, TypeData data) { - // TODO Auto-generated method stub - data.isVoid = true; - } - - }.doSwitch(astType, res); - - return res; - } - - /** - * Data structure to return data about a Declared type. - * - * @author dumoulin - * - */ - protected class TypeData { - - List qualifiedName; - - /** template parameters */ - protected List genericData; - - boolean isInterface = false; - - /** PrimitiveType */ - boolean isPrimitive = false; - - /** ReferenceType */ - protected int arrayCount; - - /** For Wildcard */ - protected boolean isWildcard = false; - - protected TypeData extends_; - - protected TypeData super_; - - /** VoidType */ - protected boolean isVoid = false; - } - - /** - * Create the uml2.primitivetype denoted by the specified PrimitiveType - * - * @param n - * @return - */ - protected String getPrimitiveName(PrimitiveType n) { - String typeName = null; - - switch (n.getType()) { - case Boolean: - typeName = "Boolean"; - break; - case Byte: - typeName = "Byte"; - break; - case Char: - typeName = "Char"; - break; - case Double: - typeName = "Double"; - break; - case Float: - typeName = "Float"; - break; - case Int: - typeName = "Integer"; - break; - case Long: - typeName = "Long"; - break; - case Short: - typeName = "Short"; - break; - } - - return typeName; - } - - /** - * Create an attribute and add it to the parent. - * - * @param n - * node declaring type and modifiers - * @param var - * @param parent - * @param type - */ - protected void createAttribute(FieldDeclaration n, VariableDeclarator var, Classifier parent, Type type, TranslatedTypeData typeData) { - - // get with no type, and then update type. - Property property = UmlUtils.createProperty(parent, null, var.getId().getName(), var.getId().getArrayCount()); - property.setType(type); - processJavadoc(n.getJavaDoc(), property); - processModifiers(n.getModifiers(), property); - if (typeData.isCollection()) { - property.setLower(typeData.getTranslatedLower()); - property.setUpper(typeData.getTranslatedUpper()); - } - } - - /** - * Process modifiers for Operation - * - * @param modifiers - * @param property - */ - private void processModifiers(int modifiers, Operation property) { - if (ModifierSet.isAbstract(modifiers)) { - property.setIsAbstract(true); - } - processModifiers(modifiers, (Feature) property); - } - - /** - * Process modifiers - * - * @param modifiers - * @param property - */ - private void processModifiers(int modifiers, Feature property) { - // TODO Auto-generated method stub - if (ModifierSet.isPrivate(modifiers)) { - property.setVisibility(VisibilityKind.PRIVATE_LITERAL); - } - if (ModifierSet.isProtected(modifiers)) { - property.setVisibility(VisibilityKind.PROTECTED_LITERAL); - } - if (ModifierSet.isPublic(modifiers)) { - property.setVisibility(VisibilityKind.PUBLIC_LITERAL); - } - if (ModifierSet.isStatic(modifiers)) { - property.setIsStatic(true); - } - if (ModifierSet.isFinal(modifiers)) { - property.setIsLeaf(true); - } - // if (ModifierSet.isNative(modifiers)) { - // printer.print("native "); - // } - // if (ModifierSet.isStrictfp(modifiers)) { - // printer.print("strictfp "); - // } - // if (ModifierSet.isSynchronized(modifiers)) { - // printer.print("synchronized "); - // } - // if (ModifierSet.isTransient(modifiers)) { - // property.set(true); - // } - // if (ModifierSet.isVolatile(modifiers)) { - // printer.print("volatile "); - // } - } - - /** - * Process modifiers - * - * @param modifiers - * @param property - */ - private void processModifiers(int modifiers, org.eclipse.uml2.uml.Parameter property) { - // TODO Auto-generated method stub - if (ModifierSet.isPrivate(modifiers)) { - property.setVisibility(VisibilityKind.PRIVATE_LITERAL); - } - if (ModifierSet.isProtected(modifiers)) { - property.setVisibility(VisibilityKind.PROTECTED_LITERAL); - } - if (ModifierSet.isPublic(modifiers)) { - property.setVisibility(VisibilityKind.PUBLIC_LITERAL); - } - if (ModifierSet.isFinal(modifiers)) { - property.setDirection(ParameterDirectionKind.IN_LITERAL); - } - } - - private class MethodParameterData { - - TranslatedTypeData dataType; - - Type umlType; - - Parameter astParameter; - } - - /** - * Process method to be added to the provided classifier. - * - * @param n - * @param classifier - */ - protected void processMethod(MethodDeclaration n, Classifier classifier) { - - // Get parameters to have a signature - // Parameters - List signature = new ArrayList(); - - if (n.getParameters() != null) { - List paramDatas = new ArrayList(); - - for (Parameter param : n.getParameters()) { - MethodParameterData data = new MethodParameterData(); - data.dataType = processType(param.getType()); - data.umlType = getUmlType(data.dataType); - data.astParameter = param; - paramDatas.add(data); - signature.add(data.umlType); - } - } - - // Operation method = UmlUtils.getOperation(classifier, n.getName()); - Operation method = getUmlOperation(classifier, n.getName(), signature); - - processJavadoc(n.getJavaDoc(), method); - processAnnotation(n.getAnnotations(), method); - processModifiers(n.getModifiers(), method); - TranslatedTypeData typeData = processType(n.getType()); - Type methodType = getUmlType(typeData); - - if (methodType != null) { - method.setType(methodType); - if (typeData.isCollection()) { - method.setLower(typeData.getTranslatedLower()); - method.setUpper(typeData.getTranslatedUpper()); - } - } - - // Parameters - if (n.getParameters() != null) { - for (Parameter param : n.getParameters()) { - processMethodParameter(param, method); - } - } - } - - /** - * Get an operation by its signature - * - * @param classifier - * @param name - * @param signature - * @return - */ - private Operation getUmlOperation(Classifier classifier, String name, List signature) { - List list = classifier.getOperations(); - - // walk all operations with the same name. - // Check signature matching - for (Operation oper : list) { - - if (isSameOperation(oper, name, signature)) { - return oper; - } - } - // Not found, create a new one (without signature) - return UmlUtils.createOperation(classifier, name); - } - - /** - * @param oper - * @param name - * @param signature - */ - private boolean isSameOperation(Operation oper, String name, List signature) { - - // check name - if (!name.equals(oper.getName())) { - return false; - } - - // Check parameters - List umlParams = oper.getOwnedParameters(); - // Check signature - if (signature == null) { - return true; - } else if (umlParams == null) { - if (signature.size() == 0) { - return true; - } else { - return false; - } - } else if ( /* signature!= null && */umlParams != null) { - int umlParamIndex = 0; - for (Type signatureType : signature) { - try { - // Compare type - org.eclipse.uml2.uml.Parameter param = umlParams.get(umlParamIndex++); - // skip return parameter - while (param.getDirection() == ParameterDirectionKind.RETURN_LITERAL) { - param = umlParams.get(umlParamIndex++); - } - - // Check types, skip if existing type is null - Type existingType = param.getType(); - if (existingType != null && !(existingType.getName().equals(signatureType.getName()))) { - // umlParamIndex > umlParams.getSize() - return false; - } - } catch (IndexOutOfBoundsException e) { - - return false; - } - } - // Check if there still some type in umlParams - // if index is the last one: ok - // otherwise, check if remaining arguments are only returns. - while (umlParamIndex < umlParams.size()) { - if (umlParams.get(umlParamIndex++).getDirection() != ParameterDirectionKind.RETURN_LITERAL) { - return false; - } - } - // same - return true; - } - - return false; - } - - /** - * Process a parameter. - * - * @param param - * @param method - */ - private void processMethodParameter(Parameter param, Operation method) { - - TranslatedTypeData typeData = processType(param.getType()); - Type type = getUmlType(typeData); - - System.out.println("getOwnedParameter(" + method.getName() + "= " + param.getId().getName() + ", " + type + " )"); - org.eclipse.uml2.uml.Parameter umlParameter = method.getOwnedParameter(param.getId().getName(), type, true, true); - - if (typeData.isCollection()) { - umlParameter.setLower(typeData.getTranslatedLower()); - umlParameter.setUpper(typeData.getTranslatedUpper()); - } - processModifiers(param.getModifiers(), umlParameter); - processAnnotation(param.getAnnotations(), method); - - } - - /** - * Process annotation. - * - * @param annotations - * @param method - */ - private void processAnnotation(List annotations, Element method) { - // TODO Auto-generated method stub - // Set annotation as stereotype ? - } - - /** - * Process javadoc. - * - * @param javaDoc - * @param method - */ - private void processJavadoc(JavadocComment javaDoc, Element umlElement) { - if (javaDoc == null) { - return; - } - - Comment comment; - // Check if a comment already exists. - List ownedComments = umlElement.getOwnedComments(); - if (ownedComments != null && ownedComments.size() > 0) { - comment = ownedComments.get(0); - } else { // Create a new comment - comment = umlElement.createOwnedComment(); - } - - // Set the body - comment.setBody(javaDoc.getContent()); - } - - /** - * Create an interface and return it. - * The Classifier is created exactly in the directly enclosing namespace. - * First, a lookup is done to check if it has been created elsewhere in the namespaces. If true, correct the location - * and maybe the type. - * - * Only need to create the object and fill it with data available at this level. - * - * @param enclosingParents - * enclosing parent, Package included, in case of nested declaration. - * @param n - * @return - */ - protected Class createClass(List enclosingParents, ClassOrInterfaceDeclaration n) { - System.out.println("getClass( " + n.getName() + " )"); - return UmlUtils.getClass(enclosingParents, n.getName()); - } - - /** - * Create an interface and return it. - * The Classifier is created exactly in the directly enclosing namespace. - * First, a lookup is done to check if it has been created elsewhere in the namespaces. If true, correct the location - * and maybe the type. - * - * Only need to create the object and fill it with data available at this level. - * - * @param parent - * @param n - * @return - */ - protected Interface createInterface(List enclosingParents, ClassOrInterfaceDeclaration n) { - System.out.println("getInterface( " + n.getName() + " )"); - return UmlUtils.getInterface(enclosingParents, n.getName()); - } - - /** - * get (lookup or create) the packages containing the CU. - * - * @param cu - * @return - */ - private Package getCuPackage(PackageDeclaration packageDecl) { - - // If null, return the generation root - if (packageDecl == null) { - return defaultGenerationPackage; - } - - // Get the name - List qualifiedName = qualifiedNameParser.getPackageQualifiedName(packageDecl); - // Get the creation model - Package creationPackage = creationPackageCatalog.getCreationPackage(qualifiedName); - // Get the current unit package (where the element are created) - Package p = UmlUtils.getPackage(creationPackage, qualifiedName); - - return p; - // question - // How to let the creationPackageCatalog create the package for a specified name ? - // CreatePackage visitor = new CreatePackage(); - // Package res = visitor.getPackage(packageDecl, defaultGenerationPackage); - - // return res; - } - - private void createModifiers(Classifier c, int modifiers) { - // TODO Auto-generated method stub - if (ModifierSet.isPrivate(modifiers)) { - c.setVisibility(VisibilityKind.PRIVATE_LITERAL); - } - if (ModifierSet.isProtected(modifiers)) { - c.setVisibility(VisibilityKind.PROTECTED_LITERAL); - } - if (ModifierSet.isPublic(modifiers)) { - c.setVisibility(VisibilityKind.PUBLIC_LITERAL); - } - if (ModifierSet.isAbstract(modifiers)) { - c.setIsAbstract(true); - } - // if (ModifierSet.isStatic(modifiers)) { - // c.get - // } - if (ModifierSet.isFinal(modifiers)) { - c.setIsLeaf(true); - } - // if (ModifierSet.isNative(modifiers)) { - // printer.print("native "); - // } - // if (ModifierSet.isStrictfp(modifiers)) { - // printer.print("strictfp "); - // } - // if (ModifierSet.isSynchronized(modifiers)) { - // printer.print("synchronized "); - // } - // if (ModifierSet.isTransient(modifiers)) { - // printer.print("transient "); - // } - // if (ModifierSet.isVolatile(modifiers)) { - // printer.print("volatile "); - // } - - } - - - - /** - * Process Class or Interface declaration (only the head of the class, not the members). - * - * @param n - * @param parent - * @return - */ - private Classifier processClassOrInterfaceDeclaration(ClassOrInterfaceDeclaration n, List enclosingParents) { - - Classifier processedClass; - if (n.isInterface()) { - processedClass = createInterface(enclosingParents, n); - } else { - processedClass = createClass(enclosingParents, n); - } - - // Comments - processJavadoc(n.getJavaDoc(), processedClass); - - // Extends parameters - if (n.getExtends() != null) { - for (ClassOrInterfaceType type : n.getExtends()) { // Get the type - List qualifiedName = getQualifiedName(type); - qualifiedName = importedTypes.getQualifiedName(qualifiedName); - Classifier generalization = getUmlClassifier(qualifiedName, n.isInterface()); - // create the generalization - UmlUtils.getGeneralization(processedClass, generalization); - } - } - - // implements parameters - if (n.getImplements() != null) { - for (ClassOrInterfaceType type : n.getImplements()) { - List qualifiedName = getQualifiedName(type); - qualifiedName = importedTypes.getQualifiedName(qualifiedName); - Classifier generalization = getUmlClassifier(qualifiedName, true); - // create the generalization - Package parentPackage = (Package) enclosingParents.get(0); - // TODO use InterfaceRealization instead of Realization - // Need to store the InterfaceRealization in the right parent - // UmlUtils.getRealization(parentPackage, processedClass, generalization); - if (generalization instanceof Interface && processedClass instanceof BehavioredClassifier) { - UmlUtils.getInterfaceRealization((BehavioredClassifier) processedClass, (Interface) generalization); - } else - { - // should not happen - UmlUtils.getGeneralization(processedClass, generalization); - } - } - } - - - return processedClass; - } - - - /** - * Visitor used to create Package from a qualified names - * Example : javagen.parser - * trace : - * - visitQualifiedName( parser ) - * - visitName( javagen ) - * - * @author dumoulin - * - */ - protected class CreatePackage extends VoidVisitorAdapter> { - - - /** - * Create or find the packages corresponding to the qualified name. - * This is the main method to be called - * - * @param decl - * @param parent - * @return - */ - public Package getPackage(PackageDeclaration decl, Package parent) { - List names = new ArrayList(); - - // Create a list of names in proper order. - decl.accept(this, names); - - Package p = parent; - // iterate on names - for (String packageName : names) { - p = UmlUtils.getPackage(p, packageName); - } - return p; - } - - /** - * Create the package part - */ - @Override - public void visit(NameExpr n, List names) { - // System.out.println("visitName( " + n.getName() + " )"); - // Add in head, because elements are found in reverse order. - names.add(0, n.getName()); - super.visit(n, names); - } - - /** - * - */ - @Override - public void visit(QualifiedNameExpr n, List names) { - // System.out.println("visitQualifiedName( " + n.getName() + " )"); - // Add in head, because elements are found in reverse order. - names.add(0, n.getName()); - super.visit(n, names); - } - } - - /** - * Visitor used to create a qualified name from ClassOrInterfaceType - * - * @author dumoulin - * - */ - protected class QualifiedNameParser extends VoidVisitorAdapter> { - - /** - * Get the qualified name from the specified ast type - * - * @param n - * @return - */ - public List getClassOrInterfaceQualifiedName(ClassOrInterfaceType n) { - List res = new ArrayList(); - n.accept(this, res); - return res; - } - - /** - * Get the qualified name from the specified ast type - * - * @param n - * @return - */ - public List getPackageQualifiedName(PackageDeclaration n) { - List res = new ArrayList(); - n.accept(this, res); - return res; - } - - /** - * Get the qualified name from the specified ast type - * - * @param n - * @return - */ - public List getImportQualifiedName(ImportDeclaration n) { - // Imports are ordered from rootPackage to Type. - // So, names should be added in before visiting childs. - return getQualifiedName(n); - } - - /** - * Get the qualified name from the specified ast type - * - * @param n - * @return - */ - private List getQualifiedName(Node n) { - List res = new ArrayList(); - n.accept(this, res); - return res; - } - - /** - * Create the package part - */ - @Override - public void visit(ClassOrInterfaceType n, List names) { - // System.out.println("visitName( " + n.getName() + " )"); - // Add in head, because elements are found in reverse order. - // super.visit(n, names); - names.add(0, n.getName()); - if (n.getScope() != null) { - n.getScope().accept(this, names); - } - } - - /** - * Create the package part - */ - @Override - public void visit(NameExpr n, List names) { - // Add in head, because elements are found in reverse order. - // System.out.println("addName( " + n.getName() + " )"); - names.add(0, n.getName()); - // super.visit(n, names); - } - - /** - * - */ - @Override - public void visit(QualifiedNameExpr n, List names) { - // Add in head, because elements are found in reverse order. - // System.out.println("addQualifiedName( " + n.getName() + " )"); - names.add(0, n.getName()); - if (n.getQualifier() != null) - { - n.getQualifier().accept(this, names); - // super.visit(n, names); - } - } - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CreationPackageCatalog.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CreationPackageCatalog.java deleted file mode 100644 index 5266bb2df21..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CreationPackageCatalog.java +++ /dev/null @@ -1,639 +0,0 @@ -/** - * - */ -package javagen.umlparser; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.uml2.uml.Package; - -/** - * Catalog used to find the package where an element should be created. - * The catalog maintain a map of (java package prefixes, creation prefixes). - * If no mapping is specified, the default creation package is used. - * The catalog can be configured with: - *
    - *
  • defaultCreationPackage - The default path where packages are created when no matching creation Paths can be found.
  • - *
  • packageCreationPatterns - Pattern indicating in where a java package should be created according to its name.
  • - *
  • packageSearchPatterns - Patterns used to search for an existing java patterns. Used by {@link ClassifierCatalog}
  • - *
- *
- * A packageCreationPatterns is made like that: - *
    - *
  • packageCreationPatterns: includePattern excludePatterns creationPath
  • - *
  • includePattern: pathPattern | null
  • - *
  • excludePatterns: pathPattern*
  • - *
  • creationPath: pathPattern
  • - *
  • pathPattern: path*.'*' | path | '*'.path | path'.*.'path
  • - *
  • path: pathPart['.'pathPart]*
  • - *
  • pathPart: name
  • - *
- * A defaultCreationPackage is made like that: - *
    - *
  • defaultCreationPackage: path
  • - *
- * A packageSearchPatterns is made like that: - *
    - *
  • defaultCreationPackage: path*.'*'
  • - *
creationPatterns; - - /** - * Default package returned when no mapping is found. - */ - private Package defaultCreationPackage; - - private static String defaultCreationPath = "default"; - - /** The model root package. Used to create mapped packages */ - private Package modelRootPackage; - - /** - * Default packageCreationPatterns. - */ - private static String[] defaultPackageCreationPatterns = { - "java.*", null, "java", - "org.eclipse.papyrus.*", null, "*", - // "org.eclipse.*", "org.eclipse.papyrus.*", "eclipse.*", - "org.eclipse.*", "org.eclipse.papyrus.*", "*", - "org.osgi.*", null, "osgi.*", - "datatype.*", null, "datatype" - }; - - - /** - * Constructor. - * Init the mappings - * format: ("p1.p2.p3", "p1.p2.p3", "pa/pb/pc") - * format: (include javaPackage, exclude javaPackage(or null), umlPackage) - * include and exclude package can start or (xor) end with '*' - * - * @param modelRootPackage - * Package used to create mapped packages - * @param defaultPackage - * Default package returned when no mapping is found - * @param creationPatterns - * mappings. - */ - public CreationPackageCatalog(Package modelRootPackage, Package defaultPackage, List packageCreationPatterns) { - this.defaultCreationPackage = defaultPackage; - this.modelRootPackage = modelRootPackage; - creationPatterns = new ArrayList(); - - if (packageCreationPatterns == null || packageCreationPatterns.size() == 0) - { - // use default - initPackageCreationPatterns(creationPatterns, defaultPackageCreationPatterns); - } - else { - // Use provided array - try { - validateCreationPath(packageCreationPatterns); - } catch (Exception e) { - throw new IllegalArgumentException("Parameter initialMappings has bad format:", e); - } - initPackageCreationPatterns(creationPatterns, packageCreationPatterns.toArray(new String[] {})); - - } - - } - - /** - * @param defaultPackage - * the defaultPackage to set - */ - public void setDefaultPackage(Package defaultPackage) { - this.defaultCreationPackage = defaultPackage; - } - - /** - * Init the mappings - * format: ("p1.p2.p3", "p1.p2.p3", "pa/pb/pc") - * format: (include javaPackage, exclude javaPackage(or null), umlPackage) - * - * @param mappings - */ - private void initPackageCreationPatterns(List mappings, String[] initialMappings) { - if (initialMappings == null) { - return; - } - - for (int i = 0; i < initialMappings.length; i += 3) { - String qname = initialMappings[i + 2]; - String excludeKey = initialMappings[i + 1]; - String[] excludeKeys = null; - if (excludeKey != null) { - excludeKeys = excludeKey.split(","); - } - mappings.add(new CreationPattern(initialMappings[i], excludeKeys, qname)); - } - } - - /** - * Get the creation Package for the specified qualifiedName. - * The returned package is the Model from where the specified element should be created. - * The package denoted by the qualifiedName are not created. - * - * The modelPath is the model where specified element should be created.
- * Create any missing intermediate packages or models. - * - * @param qualifiedName - * The fully qualified name of the element to create. - * @return The package where the element should be created, according to its qualified name. The - */ - public Package getCreationPackage(List qualifiedName) { - String qname = toFlatQualifiedName(qualifiedName); - for (CreationPattern p : creationPatterns) { - if (p.isFor(qname)) { - return p.getPackage(qualifiedName); - } - } - - // not found - return defaultCreationPackage; - } - - - /** - * Used by the UI to show the default values. - * Return one line for each packageCreationPatterns - * - * @return the defaultPackageCreationPatterns - */ - public static String[] getDefaultPackageCreationPatterns(String separator) { - - return toLineCreationPattern(defaultPackageCreationPatterns, separator); - } - - - /** - * @return the defaultCreationPath - */ - public static String getDefaultCreationPath() { - return defaultCreationPath; - } - - /** - * Transform a String with dot in a List of String - * - * @param key - * @return - */ - private List dotToListOfString(String key) { - return Arrays.asList(key.split("\\.")); - } - - /** - * Transform the qname into a string representation. - * - * @param qualifiedName - * @return - */ - private String toFlatQualifiedName(List qualifiedName) { - if (qualifiedName.size() == 1) { - return qualifiedName.get(0); - } - // Compute full name - StringBuffer buff = new StringBuffer(); - - buff.append(qualifiedName.get(0)); - for (int i = 1; i < qualifiedName.size(); i++) { - String part = qualifiedName.get(i); - buff.append(".").append(part); - } - return buff.toString(); - } - - /** - * A pattern mapping java packages to path representing the model where the java package should be created - * - * @author dumoulin - * - */ - protected class CreationPattern { - - private CreationModelPathEntry creationModelPathEntry; - - private StringFilter includeFilter; - - private StringFilter[] excludeFilters; - - /** - * - * @param key - * @param excludekey - * comma separated list of keys to exclude. - * @param qualifiedName - */ - public CreationPattern(String key, String[] excludekeys, String qualifiedName) { - this.includeFilter = createFilter(key); - this.excludeFilters = createFilters(excludekeys); - this.creationModelPathEntry = createCreationModelPathEntry(key, qualifiedName); - } - - - /** - * Create a list of filters - * - * @param excludekeys - * @return - */ - private StringFilter[] createFilters(String[] excludekeys) { - if (excludekeys == null) { - return null; - } - - StringFilter[] filters = new StringFilter[excludekeys.length]; - - for (int i = 0; i < excludekeys.length; i++) { - filters[i] = createFilter(excludekeys[i]); - } - return null; - } - - - /** - * Create appropriate filter by looking up the stars positions. - * - * @param name - * @return - */ - private StringFilter createFilter(String name) { - if (name.startsWith("*")) { - return new EndWithFilter(name.substring(1, name.length())); - } else if (name.endsWith("*")) { - return new StartWithFilter(name.substring(0, name.length() - 1)); - } else { - return new IsEqualsFilter(name); - } - - } - - /** - * Create appropriate CreationModelPathEntry by looking up the #WILDCARD positions. - * - * @param name - * @return - */ - private CreationModelPathEntry createCreationModelPathEntry(String key, String qualifiedNameWithDot) { - - List qname = dotToListOfString(qualifiedNameWithDot); - - // Create the appropriate QualifiedNameGenerator - if (qname.contains("*")) { - if (key.contains("*")) { - // Both string contains '*' - return new PatternCreationModelPathEntry(key, qname); - } else { - // key have no pattern, but qualified name has. - // No solution: remove '*' from qualifiedName - qname.remove("*"); - return new SimpleCreationModelPathEntry(qname); - } - } else { - // the qualified name has no pattern - return new SimpleCreationModelPathEntry(qname); - } - - - } - - /** - * Return true if this mapping is for the provided qname. - * - * @param packageQualifiedName - * @return - */ - public boolean isFor(String flatQualifiedName) { - // System.out.println("isFor(" + filter.filter + "==" + flatQualifiedName + ")"); - if (includeFilter.accept(flatQualifiedName)) { - if (!isExcluded(flatQualifiedName)) { - return true; - } - } - - - return false; - } - - /** - * Is the name in the exclude list ? - * - * @param flatQualifiedName - * @return - */ - private boolean isExcluded(String flatQualifiedName) { - if (excludeFilters == null) { - return false; - } - - for (StringFilter exclude : excludeFilters) { - if (exclude.accept(flatQualifiedName)) { - return true; - } - } - - return false; - } - - /** - * Get the uml Package. Create it if needed. - * Create a Model that will contains the created elements - * - * @param proposedPath - * The proposedPath for which the creation Package is requested. - * @return - */ - public Package getPackage(List proposedPath) { - - // umlPackage = UmlUtils.getPackage(modelRootPackage, qualifiedName); - Package cachedPackage = UmlUtils.getModel(modelRootPackage, creationModelPathEntry.getCreationModelPath(proposedPath)); - return cachedPackage; - } - } - - abstract private class StringFilter { - - protected String filter; - - /** - * @param filter - */ - public StringFilter(String filter) { - this.filter = filter; - } - - abstract public boolean accept(String name); - } - - private class StartWithFilter extends StringFilter { - - public StartWithFilter(String filter) { - super(filter); - } - - @Override - public boolean accept(String name) { - return name.startsWith(filter); - } - - } - - private class EndWithFilter extends StringFilter { - - public EndWithFilter(String filter) { - super(filter); - } - - @Override - public boolean accept(String name) { - return name.endsWith(filter); - } - - } - - private class IsEqualsFilter extends StringFilter { - - public IsEqualsFilter(String filter) { - super(filter); - } - - @Override - public boolean accept(String name) { - return name.equals(filter); - } - - } - - /** - * A CreationModelPathEntry is used get the model path for a given elementPath. - * - * @author dumoulin - * - */ - private abstract class CreationModelPathEntry { - - /** - * Return the path for the model in wich the specified element should be created. - * - * @param elementName - * The fully qualified name of the element to create. - * @return - */ - abstract public List getCreationModelPath(List pattern); - } - - /** - * A {@link CreationModelPathEntry} returning the registered path. - * The path should not contain {@value #WILDCARD} - * - * @author dumoulin - * - */ - private class SimpleCreationModelPathEntry extends CreationModelPathEntry { - - /** - * The qualified name of the model where element are created - */ - private List modelPath; - - /** - * - * Constructor. - * - * @param modelPath - * The qualified name of the model where element are created - */ - public SimpleCreationModelPathEntry(List modelPath) { - this.modelPath = modelPath; - } - - /** - * Return the patt for the model in wich the specified element should be created. - * - * @see javagen.umlparser.CreationPackageCatalog.CreationModelPathEntry#getCreationModelPath(java.util.List) - * - * @param elementName - * The fully qualified name of the element to create. - * @return - */ - @Override - public List getCreationModelPath(List elementName) { - // Return the registered path - return modelPath; - } - - } - - /** - * This {@link CreationModelPathEntry} allows to create Models giving a pattern containing a wildcard. - * - * @author dumoulin - * - */ - private class PatternCreationModelPathEntry extends CreationModelPathEntry { - - private List qname; - - private int srcPartIndex; - - private int targetPartIndex; - - public PatternCreationModelPathEntry(String key, List qname) { - - // - List qualifiedKey = dotToListOfString(key); - // Get the index of the '*' - srcPartIndex = qualifiedKey.indexOf("*"); - targetPartIndex = qname.indexOf("*"); - if (targetPartIndex < 0 || srcPartIndex < 0) - { - System.err.println("getCreationModelPath() - index problem for " + key + ", " + qname); - } - this.qname = qname; - } - - /** - * Return the name of the model for the specified qualifiedname. - * - * @see javagen.umlparser.CreationPackageCatalog.CreationModelPathEntry#getCreationModelPath(java.util.List) - * - * @param elementName - * The fully qualified name of the element to create. - * @return - */ - @Override - public List getCreationModelPath(List elementName) { - List result = new ArrayList(qname); - // Replace the '*' in the requested path by the name found at the star index in the provided pattern - if (targetPartIndex < 0 || srcPartIndex < 0) - { - System.err.println("getCreationModelPath() - index problem for " + elementName); - } - result.set(targetPartIndex, elementName.get(srcPartIndex)); - return result; - } - - } - - /** - * Validate the creation paths. The list contains one pattern by element - * - * @param paths - * @throws Exception - * If the path is not valid. The message describes the error. - */ - public static void validateCreationPath(List paths) throws Exception { - - for (int i = 0; i < paths.size(); i += 3) - { - String includePattern = paths.get(i); - String excludePattern = paths.get(i + 1); - String targetPath = paths.get(i + 2); - String errorLine = "[" + includePattern + " ; " + excludePattern + " ; " + targetPath + "]"; - checkNotEmptyPattern(includePattern, errorLine); - checkNotEmptyPattern(targetPath, errorLine); - checkSizeNotZero(excludePattern, errorLine); - } - - } - - private static void checkSizeNotZero(String pattern, String errorLine) throws Exception { - if (!(pattern == null) && pattern.length() == 0) { - throw new Exception("Pattern should not be null or empty" + errorLine); - } - } - - private static void checkNotEmptyPattern(String pattern, String errorLine) throws Exception { - - if (pattern == null || pattern.length() == 0) { - throw new Exception("Pattern should not be null or empty" + errorLine); - } - - } - - /** - * Transform a creation package with one single pattern by element to - * an array of creationPatterns (one creationPattern by line). - * - * @return the defaultPackageCreationPatterns - */ - public static String[] toLineCreationPattern(String[] elements, String separator) { - - int size = elements.length / 3; - String[] result = new String[size]; - - int index = 0; - for (int i = 0; i < elements.length; i += 3) { - String includePattern = elements[i]; - String excludePattern = elements[i + 1]; - String creationPath = elements[i + 2]; - - if (excludePattern == null) { - excludePattern = ""; - } - - result[index] = includePattern + separator + excludePattern + separator + creationPath; - index++; - } - return result; - } - - /** - * Get all the creationPath of the specified creation patterns (one path by element); - * - * @param creationPattern - * A splitted creation pattern array - * @return - */ - public static List extractCreationPaths(String[] creationPattern) { - - int size = creationPattern.length / 3; - List result = new ArrayList(size); - - for (int i = 0; i < creationPattern.length; i += 3) { - String element = creationPattern[i + 2]; - if (!result.contains(element)) { - result.add(element); - } - } - return result; - } - - /** - * Get an array containing the specified colon of the provided array - * - * @return the defaultPackageCreationPatterns - */ - private static String[] extractColumn(String[] inputArray, int columnCount, int extractedColumn) { - - int size = inputArray.length / columnCount; - String[] result = new String[size]; - - int index = 0; - for (int i = 0; i < inputArray.length; i += 3) { - String element = inputArray[i + extractedColumn]; - result[index] = element; - index++; - } - return result; - } - - public static List getDefaultSearchPath() { - // TODO Auto-generated method stub - return extractCreationPaths(defaultPackageCreationPatterns); - } - - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CuPrinter.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CuPrinter.java deleted file mode 100644 index a0a4271eeac..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CuPrinter.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * - */ -package javagen.umlparser; - -import japa.parser.JavaParser; -import japa.parser.ParseException; -import japa.parser.ast.CompilationUnit; - -import java.io.FileInputStream; - -/** - * @author dumoulin - * - */ -public class CuPrinter { - - public static void main(String args[]) { - CompilationUnit cu; - - try { - - if (args.length == 0) { - System.out.println("Java Parser Version 1.1: Reading from standard input . . ."); - cu = JavaParser.parse(System.in); - } else if (args.length == 1) { - System.out.println("Java Parser Version 1.1: Reading from file " + args[0] + " . . ."); - try { - cu = JavaParser.parse(new java.io.FileInputStream(args[0])); - System.out.println("Java Parser Version 1.1: Java program parsed successfully."); - // prints the resulting compilation unit to default system output - System.out.println(cu.toString()); - - } catch (java.io.FileNotFoundException e) { - System.out.println("Java Parser Version 1.1: File " + args[0] + " not found."); - return; - } - } else { - System.out.println("Java Parser Version 1.1: Usage is one of:"); - System.out.println(" java JavaParser < inputfile"); - System.out.println("OR"); - System.out.println(" java JavaParser inputfile"); - return; - } - - } catch (ParseException e) { - System.out.println(e.getMessage()); - System.out.println("Java Parser Version 1.1: Encountered errors during parse."); - } finally { - // in.close(); - } - - } - - - public static void main2(String[] args) throws Exception { - // creates an input stream for the file to be parsed - FileInputStream in = new FileInputStream("test.java"); - - CompilationUnit cu; - try { - // parse the file - cu = JavaParser.parse(in); - } finally { - in.close(); - } - - // prints the resulting compilation unit to default system output - System.out.println(cu.toString()); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericSwitchVisitor.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericSwitchVisitor.java deleted file mode 100644 index 96fc7f91e97..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericSwitchVisitor.java +++ /dev/null @@ -1,665 +0,0 @@ -/** - * - */ -package javagen.umlparser; - -import japa.parser.ast.BlockComment; -import japa.parser.ast.CompilationUnit; -import japa.parser.ast.ImportDeclaration; -import japa.parser.ast.LineComment; -import japa.parser.ast.Node; -import japa.parser.ast.PackageDeclaration; -import japa.parser.ast.TypeParameter; -import japa.parser.ast.body.AnnotationDeclaration; -import japa.parser.ast.body.AnnotationMemberDeclaration; -import japa.parser.ast.body.ClassOrInterfaceDeclaration; -import japa.parser.ast.body.ConstructorDeclaration; -import japa.parser.ast.body.EmptyMemberDeclaration; -import japa.parser.ast.body.EmptyTypeDeclaration; -import japa.parser.ast.body.EnumConstantDeclaration; -import japa.parser.ast.body.EnumDeclaration; -import japa.parser.ast.body.FieldDeclaration; -import japa.parser.ast.body.InitializerDeclaration; -import japa.parser.ast.body.JavadocComment; -import japa.parser.ast.body.MethodDeclaration; -import japa.parser.ast.body.Parameter; -import japa.parser.ast.body.VariableDeclarator; -import japa.parser.ast.body.VariableDeclaratorId; -import japa.parser.ast.expr.ArrayAccessExpr; -import japa.parser.ast.expr.ArrayCreationExpr; -import japa.parser.ast.expr.ArrayInitializerExpr; -import japa.parser.ast.expr.AssignExpr; -import japa.parser.ast.expr.BinaryExpr; -import japa.parser.ast.expr.BooleanLiteralExpr; -import japa.parser.ast.expr.CastExpr; -import japa.parser.ast.expr.CharLiteralExpr; -import japa.parser.ast.expr.ClassExpr; -import japa.parser.ast.expr.ConditionalExpr; -import japa.parser.ast.expr.DoubleLiteralExpr; -import japa.parser.ast.expr.EnclosedExpr; -import japa.parser.ast.expr.FieldAccessExpr; -import japa.parser.ast.expr.InstanceOfExpr; -import japa.parser.ast.expr.IntegerLiteralExpr; -import japa.parser.ast.expr.IntegerLiteralMinValueExpr; -import japa.parser.ast.expr.LongLiteralExpr; -import japa.parser.ast.expr.LongLiteralMinValueExpr; -import japa.parser.ast.expr.MarkerAnnotationExpr; -import japa.parser.ast.expr.MemberValuePair; -import japa.parser.ast.expr.MethodCallExpr; -import japa.parser.ast.expr.NameExpr; -import japa.parser.ast.expr.NormalAnnotationExpr; -import japa.parser.ast.expr.NullLiteralExpr; -import japa.parser.ast.expr.ObjectCreationExpr; -import japa.parser.ast.expr.QualifiedNameExpr; -import japa.parser.ast.expr.SingleMemberAnnotationExpr; -import japa.parser.ast.expr.StringLiteralExpr; -import japa.parser.ast.expr.SuperExpr; -import japa.parser.ast.expr.ThisExpr; -import japa.parser.ast.expr.UnaryExpr; -import japa.parser.ast.expr.VariableDeclarationExpr; -import japa.parser.ast.stmt.AssertStmt; -import japa.parser.ast.stmt.BlockStmt; -import japa.parser.ast.stmt.BreakStmt; -import japa.parser.ast.stmt.CatchClause; -import japa.parser.ast.stmt.ContinueStmt; -import japa.parser.ast.stmt.DoStmt; -import japa.parser.ast.stmt.EmptyStmt; -import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; -import japa.parser.ast.stmt.ExpressionStmt; -import japa.parser.ast.stmt.ForStmt; -import japa.parser.ast.stmt.ForeachStmt; -import japa.parser.ast.stmt.IfStmt; -import japa.parser.ast.stmt.LabeledStmt; -import japa.parser.ast.stmt.ReturnStmt; -import japa.parser.ast.stmt.SwitchEntryStmt; -import japa.parser.ast.stmt.SwitchStmt; -import japa.parser.ast.stmt.SynchronizedStmt; -import japa.parser.ast.stmt.ThrowStmt; -import japa.parser.ast.stmt.TryStmt; -import japa.parser.ast.stmt.TypeDeclarationStmt; -import japa.parser.ast.stmt.WhileStmt; -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.type.PrimitiveType; -import japa.parser.ast.type.ReferenceType; -import japa.parser.ast.type.VoidType; -import japa.parser.ast.type.WildcardType; -import japa.parser.ast.visitor.GenericVisitor; - -/** - * A base class used to do switching. - * The class must be subclassed, and methods corresponding to needed cases should be subclassed. - * - * @author dumoulin - * - */ -public class GenericSwitchVisitor implements GenericVisitor { - - /** - * Do switching according to the real type of the node. - * - * @param n - * @param arg - * @return - */ - public R doSwitch(Node n, A arg) { - return n.accept(this, arg); - } - - @Override - public R visit(Node n, A arg) { - // TODO Auto-generated method stub - return null; - } - - @Override - public R visit(CompilationUnit n, A arg) { - // TODO Auto-generated method stub - return null; - } - - @Override - public R visit(PackageDeclaration n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ImportDeclaration n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(TypeParameter n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(LineComment n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(BlockComment n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ClassOrInterfaceDeclaration n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(EnumDeclaration n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(EmptyTypeDeclaration n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(EnumConstantDeclaration n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(AnnotationDeclaration n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(AnnotationMemberDeclaration n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(FieldDeclaration n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(VariableDeclarator n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(VariableDeclaratorId n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ConstructorDeclaration n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(MethodDeclaration n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(Parameter n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(EmptyMemberDeclaration n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(InitializerDeclaration n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(JavadocComment n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ClassOrInterfaceType n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(PrimitiveType n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ReferenceType n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(VoidType n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(WildcardType n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ArrayAccessExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ArrayCreationExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ArrayInitializerExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(AssignExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(BinaryExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(CastExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ClassExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ConditionalExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(EnclosedExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(FieldAccessExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(InstanceOfExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(StringLiteralExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(IntegerLiteralExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(LongLiteralExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(IntegerLiteralMinValueExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(LongLiteralMinValueExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(CharLiteralExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(DoubleLiteralExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(BooleanLiteralExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(NullLiteralExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(MethodCallExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(NameExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ObjectCreationExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(QualifiedNameExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ThisExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(SuperExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(UnaryExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(VariableDeclarationExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(MarkerAnnotationExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(SingleMemberAnnotationExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(NormalAnnotationExpr n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(MemberValuePair n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ExplicitConstructorInvocationStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(TypeDeclarationStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(AssertStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(BlockStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(LabeledStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(EmptyStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ExpressionStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(SwitchStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(SwitchEntryStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(BreakStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ReturnStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(IfStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(WhileStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ContinueStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(DoStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ForeachStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ForStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(ThrowStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(SynchronizedStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(TryStmt n, A arg) { - // TODO Auto-generated method stub - return null; - } - - - @Override - public R visit(CatchClause n, A arg) { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericTransformer.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericTransformer.java deleted file mode 100644 index 49ac5b4e7ca..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericTransformer.java +++ /dev/null @@ -1,269 +0,0 @@ -/*************************************************** - * Copyright (c) 2010 Atos Origin. - - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Atos Origin - Initial API and implementation - * - ****************************************************/ -package javagen.umlparser; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.ECrossReferenceAdapter; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.EcoreUtil.UsageCrossReferencer; -import org.eclipse.emf.ecore.util.FeatureMapUtil; - -/** - * The Class GenericTransformer. Permits to transform an eobject of eclass to - * another eclass - */ -public class GenericTransformer { - - /** element to transform */ - private EObject element; - - /** - * Instantiates a new generic transformer. - * - * @param currentEobject - * the current eobject - */ - public GenericTransformer(EObject currentEobject) { - this.element = currentEobject; - } - - /** - * Transform the element to the given eclass. - * - * @param requestedType - * the targeted eclass - */ - public EObject transform(EClass requestedType) { - - // Create the result - EObject result = requestedType.getEPackage().getEFactoryInstance() - .create(requestedType); - - try { - // Copy features - copyAllFeatures(element, result); - // Change parent - // EcoreUtil.replace(element, result); - changeReferences(element, result); - - // Change references on the old objet to references on the new - // object. - - // drop caches about input element - ECrossReferenceAdapter cross = ECrossReferenceAdapter - .getCrossReferenceAdapter(element); - if (cross != null) { - cross.unsetTarget(element); - } - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - return result; - } - - /** - * Copy the feature of the source into the target - * - * @param element2 - * @param result - */ - private void copyAllFeatures(EObject source, EObject target) { - EClass eclass = source.eClass(); - if (eclass != null) { - EList eAllStructuralFeatures = eclass - .getEAllStructuralFeatures(); - for (EStructuralFeature structuralFeature : eAllStructuralFeatures) { - if (contains(target.eClass(), structuralFeature)) { - copyFeature(source, target, structuralFeature); - } - } - } - - } - - /** - * check if the target eclass contains a estructuralfeature with the same - * name less rigorous can work for many cases - * - * @param target - * the target - * @param e - * the e - * - * @return true, if successful - */ - private boolean contains(EClass target, EStructuralFeature e) { - EList features = target.getEAllStructuralFeatures(); - for (EStructuralFeature f : features) { - if (f.getName().equals(e.getName())) { - return true; - } - } - return false; - } - - /** - * Copy specified feature from source to target. - * - * @param mixedDomain - * the mixed domain - * @param source - * the source - * @param target - * the target - * @param feature - * the e - */ - @SuppressWarnings("unchecked") - private void copyFeature(EObject source, EObject target, - EStructuralFeature feature) { - Collection alreadyManaged = new ArrayList(); - - // Get the target feature - EStructuralFeature targetFeature = getFeature(target, feature.getName()); - - if (feature.getUpperBound() <= targetFeature.getUpperBound() - && feature.getLowerBound() >= targetFeature.getLowerBound()) { - if (feature.isChangeable() && !feature.isDerived()) { - Object value = source.eGet(feature); - - if (feature.isMany() && targetFeature.isMany()) { - // Collection to collection - Collection values = (Collection) value; - if (values != null && !values.isEmpty()) { - Collection newList = new ArrayList(); - newList.addAll(values); - if (feature instanceof EReference - && !((EReference) feature).isContainment()) { - // references - setFeatureValue(target, targetFeature, newList); - // add(new SetValueCommand(new - // SetRequest(editingDomain, target, targetFeature, - // newList))); - } else if (feature instanceof EReference - && ((EReference) feature).isContainment()) { - // Containement feature - Collection toTreat = new ArrayList(); - for (Object o : newList) { - if (!alreadyManaged.contains(o)) { - toTreat.add(o); - alreadyManaged.add(o); - } - } - - setFeatureValue(target, targetFeature, newList); - } - } - } else if (!feature.isMany() && !targetFeature.isMany()) { - // Copy one to one - if (value != null) { - if (!alreadyManaged.contains(value)) { - alreadyManaged.add(value); - setFeatureValue(target, targetFeature, value); - } - } - } - } - } - - } - - /** - * - * Set the value of the specified feature - * - * @param elementToEdit - * @param feature - * @param value - */ - protected void setFeatureValue(EObject elementToEdit, - EStructuralFeature feature, Object value) { - - boolean many = FeatureMapUtil.isMany(elementToEdit, feature); - if (many) { - Collection collection = ((Collection) elementToEdit.eGet(feature)); - if (value instanceof List) { - List values = (List) value; - collection.clear(); - collection.addAll(values); - } else { - collection.add(value); - } - } else { - elementToEdit.eSet(feature, value); - } - } - - /** - * Gets a feature from a name - * - * @param eobject - * the eobject - * @param name - * the name - * - * @return the feature - */ - private EStructuralFeature getFeature(EObject eobject, String name) { - return eobject.eClass().getEStructuralFeature(name); - } - - /** - * Replace all references on source by references on target Deletes the - * object from its {@link EObject#eResource containing} resource and/or its {@link EObject#eContainer containing} object as well as from any other - * feature that references it within the enclosing resource set, resource, - * or root object. - * - * @param eObject - * the object to delete. - * @copyright org.eclipse.emf.ecore.util.EcoreUtil - */ - private void changeReferences(EObject source, EObject target) { - EObject rootEObject = EcoreUtil.getRootContainer(source); - Resource resource = rootEObject.eResource(); - - Collection usages; - if (resource == null) { - usages = UsageCrossReferencer.find(source, rootEObject); - } else { - ResourceSet resourceSet = resource.getResourceSet(); - if (resourceSet == null) { - usages = UsageCrossReferencer.find(source, resource); - } else { - usages = UsageCrossReferencer.find(source, resourceSet); - } - } - - for (EStructuralFeature.Setting setting : usages) { - if (setting.getEStructuralFeature().isChangeable()) { - EcoreUtil.replace(setting, source, target); - } - } - - EcoreUtil.replace(source, target); - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ImportedTypeCatalog.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ImportedTypeCatalog.java deleted file mode 100644 index de8ededd8e5..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ImportedTypeCatalog.java +++ /dev/null @@ -1,167 +0,0 @@ -/** - * - */ -package javagen.umlparser; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Catalog managing the imports names. - * This catalog allows to lookup the qualified name of a type. - * - * @author dumoulin - * - */ -public class ImportedTypeCatalog { - - private Map> map = new HashMap>(); - - /** - * Default mapping to be set - */ - public String[] defaultMappingNames = { - "String", "java.lang.String", - "Class", "java.lang.Class", - "Object", "java.lang.Object", - "Exception", "java.lang.Exception", - "Integer", "datatype.Integer", - "Boolean", "datatype.Boolean", - "Long", "datatype.Long", - "Char", "datatype.Char", - "Byte", "datatype.Byte", - "Runnable", "java.lang.Runnable", - "Throwable", "java.lang.Throwable", - "Thread", "java.lang.Thread", - }; - - - /** - * Constructor. - */ - public ImportedTypeCatalog() { - // Set default mapping - setDefaultMapping(defaultMappingNames); - } - - /** - * Set the default mappings - * - * @param defaultMappingNames - */ - private void setDefaultMapping(String[] defaultMappingNames) { - for (int i = 0; i < defaultMappingNames.length; i += 2) { - map.put(defaultMappingNames[i], UmlUtils.toQualifiedName(defaultMappingNames[i + 1])); - System.out.println("setDefaultMapping().add(" + defaultMappingNames[i] + ", " + UmlUtils.toQualifiedName(defaultMappingNames[i + 1]) + ")"); - } - } - - /** - * Get the associated qualified name from the imports. - * Return the translation or the name itself, as a qualifiedName. - * - * @param name - * @return - */ - public List getQualifiedName(String name) { - - List res = map.get(name); - if (res == null) { - res = UmlUtils.toQualifiedName(name); - } - return res; - } - - /** - * Lookup the associated qualified name from the imports. - * - * @param name - * @return - */ - private List lookupQualifiedName(String name) { - - List res = map.get(name); - return res; - } - - /** - * Get the qualified name of the provided [qualifiedName]. - * If the provided name size is one, lookup for its full name. - * Otherwise, return the imput. - * - * @param typeQualifiedName - * @return - */ - public List getQualifiedName(List possiblyQualifiedName) { - if (possiblyQualifiedName.size() == 1) { - List res = lookupQualifiedName(possiblyQualifiedName.get(0)); - if (res == null) { - res = possiblyQualifiedName; - } - return res; - } else { - return possiblyQualifiedName; - } - } - - /** - * Return true if the specified qualifiedName denote an imported name. - * Return false otherwise. - * - * @param qualifiedName - * @return - */ - public boolean isImportedType(List qualifiedName) { - - String lastName = qualifiedName.get(qualifiedName.size() - 1); - - // Check if the last name is in the catalog, and compare package names - List found = map.get(lastName); - if (found != null && found.equals(qualifiedName)) { - return true; - } - - return false; - } - - - /** - * Add an import - * - * @param qualifiedName - */ - public void addImport(List qualifiedName) { - - String lastName = qualifiedName.get(qualifiedName.size() - 1); - System.out.println("ImportedCatalog.add(" + qualifiedName + ")"); - if ("*".equals(lastName)) { - addPackageClasses(qualifiedName); - } else { - map.put(lastName, qualifiedName); - } - } - - /** - * Add all the class from the package. - * Last name is '*' - * - * @param qualifiedName - */ - private void addPackageClasses(List qualifiedName) { - // TODO Auto-generated method stub - // throw new UnsupportedOperationException("not yet implmeented"); - System.err.println(this.getClass().getName() - + ".addPackageClasses() - Not yet implemented - can't process import with 'p1.p2.*;'"); - } - - /** - * Clear all mappings - */ - public void clear() { - map.clear(); - setDefaultMapping(defaultMappingNames); - - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ModelManager.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ModelManager.java deleted file mode 100644 index 56cae4aa276..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ModelManager.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * - */ -package javagen.umlparser; - -import java.io.File; -import java.io.IOException; -import java.util.Collections; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.resource.UMLResource; - -/** - * This class is responsible of the life cycle of the model. - * - * @author dumoulin - * - */ -public class ModelManager { - - private Resource model; - - private ResourceSet resourceSet; - - /** - * @return the resourceSet - */ - public ResourceSet getResourceSet() { - return resourceSet; - } - - /** - * @return the model - */ - public Resource getModel() { - return model; - } - - /** - * - * @param filename - */ - protected void createModel(String filename) { - // Create a resource set. - resourceSet = new ResourceSetImpl(); - - - // Register the default resource factory -- only needed for stand-alone! - // resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); - resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE); - resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.Factory.Registry.DEFAULT_EXTENSION, UMLResource.Factory.INSTANCE); - - // Get the URI of the model file. - URI fileURI = URI.createFileURI(new File(filename).getAbsolutePath()); - - System.out.println("URI= " + fileURI); - // Create a resource for this file. - model = resourceSet.createResource(fileURI); - - } - - /** - * - * @param filename - */ - protected void loadModel(String filename) { - UMLFactory.eINSTANCE.createActor(); - // Create a resource set. - resourceSet = new ResourceSetImpl(); - - - // Register the default resource factory -- only needed for stand-alone! - // resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); - resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE); - resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.Factory.Registry.DEFAULT_EXTENSION, UMLResource.Factory.INSTANCE); - - // Get the URI of the model file. - URI fileURI = URI.createFileURI(new File(filename).getAbsolutePath()); - - System.out.println("URI= " + fileURI); - // Create a resource for this file. - model = resourceSet.getResource(fileURI, true); - - } - - public void save() { - try { - System.out.println("Save model."); - - model.save(Collections.EMPTY_MAP); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/QualifiedName.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/QualifiedName.java deleted file mode 100644 index 7b549cc8868..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/QualifiedName.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * - */ -package javagen.umlparser; - -import java.util.ArrayList; -import java.util.Collection; - -/** - * Instance of this class denote a qualified name of a type. - * - * @author dumoulin - * - */ -@SuppressWarnings("serial") -public class QualifiedName extends ArrayList { - - /** - * - */ - public QualifiedName() { - } - - /** - * @param initialCapacity - */ - public QualifiedName(int initialCapacity) { - super(initialCapacity); - } - - /** - * @param c - */ - public QualifiedName(Collection c) { - super(c); - } - - /** - * Return the last name of the qualified name. - * This is usually the short name. - * - * @return - */ - public String getName() { - - return get(size() - 1); - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/SwitchVisitor.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/SwitchVisitor.java deleted file mode 100644 index 5c06cc5c95a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/SwitchVisitor.java +++ /dev/null @@ -1,661 +0,0 @@ -/** - * - */ -package javagen.umlparser; - -import japa.parser.ast.BlockComment; -import japa.parser.ast.CompilationUnit; -import japa.parser.ast.ImportDeclaration; -import japa.parser.ast.LineComment; -import japa.parser.ast.Node; -import japa.parser.ast.PackageDeclaration; -import japa.parser.ast.TypeParameter; -import japa.parser.ast.body.AnnotationDeclaration; -import japa.parser.ast.body.AnnotationMemberDeclaration; -import japa.parser.ast.body.ClassOrInterfaceDeclaration; -import japa.parser.ast.body.ConstructorDeclaration; -import japa.parser.ast.body.EmptyMemberDeclaration; -import japa.parser.ast.body.EmptyTypeDeclaration; -import japa.parser.ast.body.EnumConstantDeclaration; -import japa.parser.ast.body.EnumDeclaration; -import japa.parser.ast.body.FieldDeclaration; -import japa.parser.ast.body.InitializerDeclaration; -import japa.parser.ast.body.JavadocComment; -import japa.parser.ast.body.MethodDeclaration; -import japa.parser.ast.body.Parameter; -import japa.parser.ast.body.VariableDeclarator; -import japa.parser.ast.body.VariableDeclaratorId; -import japa.parser.ast.expr.ArrayAccessExpr; -import japa.parser.ast.expr.ArrayCreationExpr; -import japa.parser.ast.expr.ArrayInitializerExpr; -import japa.parser.ast.expr.AssignExpr; -import japa.parser.ast.expr.BinaryExpr; -import japa.parser.ast.expr.BooleanLiteralExpr; -import japa.parser.ast.expr.CastExpr; -import japa.parser.ast.expr.CharLiteralExpr; -import japa.parser.ast.expr.ClassExpr; -import japa.parser.ast.expr.ConditionalExpr; -import japa.parser.ast.expr.DoubleLiteralExpr; -import japa.parser.ast.expr.EnclosedExpr; -import japa.parser.ast.expr.FieldAccessExpr; -import japa.parser.ast.expr.InstanceOfExpr; -import japa.parser.ast.expr.IntegerLiteralExpr; -import japa.parser.ast.expr.IntegerLiteralMinValueExpr; -import japa.parser.ast.expr.LongLiteralExpr; -import japa.parser.ast.expr.LongLiteralMinValueExpr; -import japa.parser.ast.expr.MarkerAnnotationExpr; -import japa.parser.ast.expr.MemberValuePair; -import japa.parser.ast.expr.MethodCallExpr; -import japa.parser.ast.expr.NameExpr; -import japa.parser.ast.expr.NormalAnnotationExpr; -import japa.parser.ast.expr.NullLiteralExpr; -import japa.parser.ast.expr.ObjectCreationExpr; -import japa.parser.ast.expr.QualifiedNameExpr; -import japa.parser.ast.expr.SingleMemberAnnotationExpr; -import japa.parser.ast.expr.StringLiteralExpr; -import japa.parser.ast.expr.SuperExpr; -import japa.parser.ast.expr.ThisExpr; -import japa.parser.ast.expr.UnaryExpr; -import japa.parser.ast.expr.VariableDeclarationExpr; -import japa.parser.ast.stmt.AssertStmt; -import japa.parser.ast.stmt.BlockStmt; -import japa.parser.ast.stmt.BreakStmt; -import japa.parser.ast.stmt.CatchClause; -import japa.parser.ast.stmt.ContinueStmt; -import japa.parser.ast.stmt.DoStmt; -import japa.parser.ast.stmt.EmptyStmt; -import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; -import japa.parser.ast.stmt.ExpressionStmt; -import japa.parser.ast.stmt.ForStmt; -import japa.parser.ast.stmt.ForeachStmt; -import japa.parser.ast.stmt.IfStmt; -import japa.parser.ast.stmt.LabeledStmt; -import japa.parser.ast.stmt.ReturnStmt; -import japa.parser.ast.stmt.SwitchEntryStmt; -import japa.parser.ast.stmt.SwitchStmt; -import japa.parser.ast.stmt.SynchronizedStmt; -import japa.parser.ast.stmt.ThrowStmt; -import japa.parser.ast.stmt.TryStmt; -import japa.parser.ast.stmt.TypeDeclarationStmt; -import japa.parser.ast.stmt.WhileStmt; -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.type.PrimitiveType; -import japa.parser.ast.type.ReferenceType; -import japa.parser.ast.type.VoidType; -import japa.parser.ast.type.WildcardType; -import japa.parser.ast.visitor.VoidVisitor; - -/** - * A base class used to do switching. - * The class must be subclassed, and methods corresponding to needed cases should be subclassed. - * - * @author dumoulin - * - */ -public class SwitchVisitor implements VoidVisitor { - - public void doSwitch(Node n, A arg) { - n.accept(this, arg); - } - - - @Override - public void visit(Node n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(CompilationUnit n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(PackageDeclaration n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ImportDeclaration n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(TypeParameter n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(LineComment n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(BlockComment n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ClassOrInterfaceDeclaration n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(EnumDeclaration n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(EmptyTypeDeclaration n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(EnumConstantDeclaration n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(AnnotationDeclaration n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(AnnotationMemberDeclaration n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(FieldDeclaration n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(VariableDeclarator n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(VariableDeclaratorId n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ConstructorDeclaration n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(MethodDeclaration n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(Parameter n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(EmptyMemberDeclaration n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(InitializerDeclaration n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(JavadocComment n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ClassOrInterfaceType n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(PrimitiveType n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ReferenceType n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(VoidType n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(WildcardType n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ArrayAccessExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ArrayCreationExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ArrayInitializerExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(AssignExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(BinaryExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(CastExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ClassExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ConditionalExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(EnclosedExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(FieldAccessExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(InstanceOfExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(StringLiteralExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(IntegerLiteralExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(LongLiteralExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(IntegerLiteralMinValueExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(LongLiteralMinValueExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(CharLiteralExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(DoubleLiteralExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(BooleanLiteralExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(NullLiteralExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(MethodCallExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(NameExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ObjectCreationExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(QualifiedNameExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ThisExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(SuperExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(UnaryExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(VariableDeclarationExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(MarkerAnnotationExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(SingleMemberAnnotationExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(NormalAnnotationExpr n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(MemberValuePair n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ExplicitConstructorInvocationStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(TypeDeclarationStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(AssertStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(BlockStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(LabeledStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(EmptyStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ExpressionStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(SwitchStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(SwitchEntryStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(BreakStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ReturnStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(IfStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(WhileStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ContinueStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(DoStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ForeachStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ForStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(ThrowStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(SynchronizedStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(TryStmt n, A arg) { - // TODO Auto-generated method stub - - } - - - @Override - public void visit(CatchClause n, A arg) { - // TODO Auto-generated method stub - - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyser.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyser.java deleted file mode 100644 index c49c9828c10..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyser.java +++ /dev/null @@ -1,219 +0,0 @@ -/** - * - */ -package javagen.umlparser; - -import japa.parser.ast.type.ClassOrInterfaceType; -import japa.parser.ast.type.PrimitiveType; -import japa.parser.ast.type.ReferenceType; -import japa.parser.ast.type.VoidType; -import japa.parser.ast.type.WildcardType; - -import java.util.ArrayList; -import java.util.List; - - -/** - * Data structure to return data about a Declared type. - * - * @author dumoulin - * - */ -public class TypeAnalyser { - - /** - * Data structure returned after type analyse - * - * @author dumoulin - * - */ - public class TypeData { - - List qualifiedName; - - /** template parameters */ - protected List genericData; - - boolean isInterface = false; - - /** PrimitiveType */ - boolean isPrimitive = false; - - /** ReferenceType */ - protected int arrayCount; - - /** For Wildcard */ - protected boolean isWildcard = false; - - protected TypeData extends_; - - protected TypeData super_; - - /** VoidType */ - protected boolean isVoid = false; - - } - - /** Catalog of imported types. Used to translate short name to QualifiedNames */ - private ImportedTypeCatalog importedTypes; - - /** - * Constructor. - * - * @param importedType - */ - public TypeAnalyser(ImportedTypeCatalog importedType) { - this.importedTypes = importedType; - } - - /** - * Get the Type from an ast.Type node. - * - * @param astType - * @return - */ - public TypeData getTypeData(japa.parser.ast.type.Type astType) { - - TypeData res = createTypeData(); - - new SwitchVisitor() { - - /** - * Get type from a class. - */ - @Override - public void visit(ClassOrInterfaceType n, TypeData data) { - List qnameBefore = getQualifiedName(n); - List qname = importedTypes.getQualifiedName(qnameBefore); - - data.qualifiedName = qname; - // Check for generic parameters - if (n.getTypeArgs() != null) { - data.genericData = new ArrayList(); - for (japa.parser.ast.type.Type arg : n.getTypeArgs()) { - TypeData argData = createTypeData(); - arg.accept(this, argData); - data.genericData.add(argData); - } - } - } - - @Override - public void visit(ReferenceType n, TypeData data) { - // skip the reference node and process the child. - // Should not appear in an type use (in Attribute or method) - data.arrayCount = n.getArrayCount(); - n.getType().accept(this, data); - } - - @Override - public void visit(PrimitiveType n, TypeData data) { - String qnameBefore = getPrimitiveName(n); - List qname = importedTypes.getQualifiedName(qnameBefore); - - data.qualifiedName = qname; - data.isPrimitive = true; - } - - @Override - public void visit(WildcardType n, TypeData data) { - data.isWildcard = true; - if (n.getExtends() != null) { - data.extends_ = createTypeData(); - n.getExtends().accept(this, data.extends_); - } - if (n.getSuper() != null) { - data.super_ = createTypeData(); - n.getSuper().accept(this, data.super_); - } - - } - - @Override - public void visit(VoidType n, TypeData data) { - // TODO Auto-generated method stub - data.isVoid = true; - } - - }.doSwitch(astType, res); - - return res; - } - - /** - * Create a new instance. - * Can be subclassed to use another type. - * - * @return - */ - protected TypeData createTypeData() { - return new TypeData(); - } - - /** - * Get the qualified name from the provided type. - * - * @param n - * @return - */ - private List getQualifiedName(ClassOrInterfaceType n) { - List qname = new ArrayList(); - - getQualifiedName(n, qname); - return qname; - } - - /** - * Walk each part of the name and put it in the resulting List. - * - * @param n - * @param qname - */ - private void getQualifiedName(ClassOrInterfaceType n, List qname) { - if (n.getScope() != null) { - getQualifiedName(n.getScope(), qname); - } - qname.add(n.getName()); - } - - /** - * Create the uml2.primitivetype denoted by the specified PrimitiveType - * - * @param n - * @return - */ - private String getPrimitiveName(PrimitiveType n) { - String typeName = null; - - switch (n.getType()) { - case Boolean: - typeName = "Boolean"; - break; - case Byte: - typeName = "Byte"; - break; - case Char: - typeName = "Char"; - break; - case Double: - typeName = "Double"; - break; - case Float: - typeName = "Float"; - break; - case Int: - typeName = "Integer"; - break; - case Long: - typeName = "Long"; - break; - case Short: - typeName = "Short"; - break; - } - - return typeName; - } - - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyserAndTranslator.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyserAndTranslator.java deleted file mode 100644 index d551fde8532..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyserAndTranslator.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * - */ -package javagen.umlparser; - -import japa.parser.ast.type.Type; - -import java.util.ArrayList; -import java.util.List; - -/** - * Allows to analyse an ast type, and to translate it according to recognized - * patterns. - * For example, this allow to translate from List to Xxx[0..1]. - * TODO : improve to take into account Map, Set, ... - * Use an enum rather than a boolean. Allow to create association class specifying the real type used. - * - * @author dumoulin - * - */ -public class TypeAnalyserAndTranslator extends TypeAnalyser { - - private List> translationList = new ArrayList>(); - - private static String[] defaultTranslatedType = { - "java.util.List", - "java.util.ArrayList", - "java.util.Collection", - "java.util.OrderedSet", - }; - - - /** - * Constructor. - * - * @param importedType - */ - public TypeAnalyserAndTranslator(ImportedTypeCatalog importedType) { - super(importedType); - initDefaultTranslatedTypes(defaultTranslatedType); - } - - /** - * Get the translated type data from the astType. - * - * @param astType - * @return - */ - public TranslatedTypeData getTranslatedTypeData(Type astType) { - TranslatedTypeData typeData = (TranslatedTypeData) getTypeData(astType); - // Does the type correspond to a list ? - translate(typeData); - return typeData; - } - - /** - * Return the TRanslatedTypeData - */ - @Override - protected TypeData createTypeData() { - return new TranslatedTypeData(); - } - - /** - * Translate the type if it is a collection type. - * - * @param data - */ - private void translate(TranslatedTypeData data) { - List qname = data.qualifiedName; - if (translationList.contains(qname)) { - // Check for one and only one template parameter - if (data.genericData != null && data.genericData.size() == 1) { - System.out.println("translate '" + qname + "'"); - // Set translatable if it is a valide inner type (i.e. not a wildcard) - if (!data.genericData.get(0).isWildcard) { - data.isTranslatable = true; - } - data.isCollection = true; - } else if (data.genericData == null) { // Collection type, with nospecified type :-( - data.isCollection = true; - } - } else if (data.arrayCount > 0) { - data.isCollection = true; - } - - // not translatable - } - - - /** - * Data structure returned - * - * @author dumoulin - * - */ - public class TranslatedTypeData extends TypeData { - - /** is the type translatable (can we use the generic's one) ? */ - public boolean isTranslatable = false; - - /** is the type denoting a collection ? */ - public boolean isCollection = false; - - /** - * Get the Real name, taking into account if it is a generic. - * - * @return - */ - public List getTranslatedQualifiedName() { - if (isTranslatable) { - return genericData.get(0).qualifiedName; - } else { - return qualifiedName; - } - } - - public int getTranslatedUpper() { - if (isCollection) { - return -1; - } else { - return 1; - } - } - - public int getTranslatedLower() { - if (isCollection) { - return 0; - } else { - return 0; - } - } - - public boolean isCollection() { - return isCollection; - } - } - - /** - * Set the default mappings - * - * @param defaultMappingNames - */ - private void initDefaultTranslatedTypes(String[] defaultTranslatedTypes) { - for (int i = 0; i < defaultTranslatedTypes.length; i++) { - translationList.add(UmlUtils.toQualifiedName(defaultTranslatedTypes[i])); - } - } - - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlParser.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlParser.java deleted file mode 100644 index 51bf3d209a5..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlParser.java +++ /dev/null @@ -1,163 +0,0 @@ -/** - * - */ -package javagen.umlparser; - -import japa.parser.JavaParser; -import japa.parser.ParseException; -import japa.parser.ast.CompilationUnit; - -import java.io.File; -import java.io.IOException; -import java.util.Arrays; - -/** - * @author dumoulin - * - */ -public class UmlParser { - - /** - * The visitor used to collect model. - */ - protected CompilationUnitAnalyser visitor; - - public UmlParser() { - } - - /** - * Select the appropriate parsing method according to the file type. - * - * @param file - * @throws ParseException - * @throws IOException - */ - public void parseResource(File file) throws ParseException, IOException { - if (file.isDirectory()) { - System.out.println(" '" + file.getAbsolutePath() + " is a directory"); - parsePackage(file); - } else if (file.isFile()) { - System.out.println(" '" + file.getAbsolutePath() + " is a file"); - // Parse only file ending in .java - if (file.getName().endsWith(".java")) { - parseFile(file); - } else { - System.out.println("skip non java file '" + file.getAbsolutePath() + "'"); - } - } else { - System.out.println(" '" + file.getAbsolutePath() + " can't be identified - " + file); - } - } - - /** - * Explore the package to call parse on classes - * - * @param file - * @throws ParseException - * @throws IOException - */ - public void parsePackage(File file) throws ParseException, IOException { - for (File f : file.listFiles()) { - parseResource(f); - } - } - - /** - * Parse the specified file - * - * @param filename - * @throws IOException - * @throws ParseException - */ - protected void parseFile(File file) throws ParseException, IOException { - CompilationUnit cu = JavaParser.parse(file); - // prints the resulting compilation unit to default system output - // System.out.println(cu.toString()); - - // visitor.visit(cu, null); - - visitor.processCompilationUnit(cu); - } - - /** - * Select the appropriate parse method according to the type of the - * resource denoted by the name. - * - * @param resourceName - * @throws IOException - * @throws ParseException - */ - public void parseResource(String resourceName) throws ParseException, IOException { - File file = new File(resourceName); - parseResource(file); - } - - public void execute(String resourcePath, String outputModelName) throws ParseException, IOException { - System.out.println("resource=" + resourcePath); - // Load model - ModelManager modelManager = new ModelManager(); - modelManager.createModel(outputModelName); - // modelManager.getModel().load(null); - // Create visitor - visitor = new CompilationUnitAnalyser(modelManager.getModel()); - // parse all file using the visitor - parseResource(resourcePath); - - // Save the model - modelManager.save(); - - } - - public void executeTest(String resourcePath, String outputModelName) throws ParseException, IOException { - System.out.println("resource=" + resourcePath); - // Load model - ModelManager modelManager = new ModelManager(); - modelManager.createModel(outputModelName); - // modelManager.getModel().load(null); - // Create visitor - String javaccDir = "H:/temp/papyrus/papyrus-gmf-head2/org.eclipse.papyrus.java.reverse/src/japa/parser"; - String javagenDir = "H:/temp/papyrus/papyrus-gmf-head2/org.eclipse.papyrus.java.reverse/src/javagen/umlparser"; - ; - - String[] paths = { - "javagen", - "javacc", - }; - visitor = new CompilationUnitAnalyser(modelManager.getModel(), "javacc", null); - // parse all file using the visitor - parseResource(javaccDir); - - // Second parsing with same model - visitor = new CompilationUnitAnalyser(modelManager.getModel(), "javagen", Arrays.asList(paths)); - // parse all file using the visitor - parseResource(javagenDir); - - // Save the model - modelManager.save(); - - } - - public static void main(String args[]) { - - if (args.length == 1) { - try { - UmlParser p = new UmlParser(); - p.execute(args[0], "myfile.uml"); - // p.executeTest(args[0], "myfile.uml"); - } catch (IOException e) { - e.printStackTrace(); - } catch (ParseException e) { - System.out.println("Problems encountered during parsing."); - e.printStackTrace(); - } - - } else { - System.out.println("Please select a file or directory to parse"); - return; - } - - - } - - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlUtils.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlUtils.java deleted file mode 100644 index 327cbb3c828..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlUtils.java +++ /dev/null @@ -1,1054 +0,0 @@ -/** - * - */ -package javagen.umlparser; - -import java.util.Arrays; -import java.util.List; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.uml2.uml.BehavioredClassifier; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.DataType; -import org.eclipse.uml2.uml.Dependency; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.InterfaceRealization; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Namespace; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.PrimitiveType; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Realization; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.UMLPackage; - -/** - * Utility methods. - *
    - *
  • getXxx() methods lookup for the element and create it if not found.
  • - *
  • lookup() methods lookup for the element.
  • - *
  • xxx( Resource, ...) methods lookup from the model container.
  • - *
  • xxx( Package, ...) methods lookup from the specified package?
  • - *
- * - * The following methods can be used: - *
    - *
  • package.getPackagedElement( name, b, type, createOnDemand) : PackageableElement
  • - *
  • package.getNestPacke()
  • - *
  • package.getOwnedType(name, b, type, createOnDemand) : Type
  • - *
- * - * @author dumoulin - * - */ -public class UmlUtils { - - private static final String WILDCARD = "*"; - - /** - * Get the qualified name from a name. - * Name is splitted arround '.' - * - * @param name - * @return - */ - public static List toQualifiedName(String qname) { - String[] splittedName = qname.split("\\."); - return Arrays.asList(splittedName); - } - - /** - * Get the qualified name from a name. - * Name is splitted arround '/' - * - * @param name - * @return - */ - public static List slashNameToQualifiedName(String qname) { - String[] splittedName = qname.split("/"); - return Arrays.asList(splittedName); - } - - /** - * Lookup for the specified package in the parent package. Create it if not found. - * - * @param parent - * the containing package - * @param name - * Package to get - * @return The requested package (never null) - */ - public static Package getPackage(Package parent, String name) { - // Get or create an instance of the specified package. - Package p = (Package) parent.getPackagedElement(name, false, UMLPackage.eINSTANCE.getPackage(), true); - return p; - } - - /** - * Lookup for the specified package in the parent package. Create it if not found. - * - * @param parent - * the containing package - * @param name - * Package to get - * @return The requested package (never null) - */ - public static Package getModel(Package parent, String name) { - - Package p = lookupPackage(parent, name); - if (p == null) - { - // Create as model - p = (Package) parent.getPackagedElement(name, false, UMLPackage.eINSTANCE.getModel(), true); - } - return p; - } - - /** - * Lookup for the specified package in the parent package. Do not create it. - * - * @param parent - * the containing package - * @param name - * Package to get - * @return The requested package (never null) - */ - private static Package lookupPackage(Package parent, String name) { - // Get or create an instance of the specified package. - Package p = (Package) parent.getPackagedElement(name, false, UMLPackage.eINSTANCE.getPackage(), false); - return p; - } - - /** - * Lookup for the specified Namespace in the parent Namespace. Do not create it. - * - * @param parent - * the containing package - * @param name - * Package to get - * @return The requested package (never null) - */ - private static Namespace lookupNamespace(Namespace parent, String name) { - // Get or create an instance of the specified package. - NamedElement foundElement = parent.getOwnedMember(name); - if (foundElement instanceof Namespace) { - return (Namespace) foundElement; - } - // Not found - return null; - } - - - /** - * Get the package containing the last package of the qualifiedName. - * Create any missing package if needed - * Do not lookup for the last element. - * If there is no scope package in the qualifiedName, return the root. - * - * @param root - * @param qualifiedName - * @return The containing package (never null) - */ - public static Package getContainingPackage(Package root, List qualifiedName) { - Package cur = root; - for (int i = 0; i < qualifiedName.size() - 1; i++) { - String name = qualifiedName.get(i); - cur = getPackage(cur, name); - // if(cur==null) - // return null; - } - return cur; - } - - /** - * Get the package containing the last package of the qualifiedName. - * Create any missing package if needed - * Do not lookup for the last element. - * If there is no scope package in the qualifiedName, return the root. - * - * @param root - * @param qualifiedName - * @return The containing package (never null) - */ - private static Package lookupContainingPackage(Package root, List qualifiedName) { - Package cur = root; - for (int i = 0; i < qualifiedName.size() - 1; i++) { - String name = qualifiedName.get(i); - cur = lookupPackage(cur, name); - if (cur == null) { - return null; - } - } - return cur; - } - - /** - * Get the Namespace containing the last namespace of the qualifiedName. - * Do not lookup for the last element. - * If there is no scope package in the qualifiedName, return the root. - * - * @param parent - * @param qualifiedName - * @return The containing package (never null) - */ - private static Namespace lookupContainingNamespace(Namespace parent, List qualifiedName) { - Namespace cur = parent; - for (int i = 0; i < qualifiedName.size() - 1; i++) { - String name = qualifiedName.get(i); - cur = lookupNamespace(parent, name); - if (cur == null) { - return null; - } - } - return cur; - } - - /** - * Get the package containing the {@value #WILDCARD}. - * Do not create intermediate packages. - * Do not lookup for the last element. - * The qualified name contains a {@value #WILDCARD}, lookup the package just before it. - * - * @param root - * @param qualifiedName - * @return The containing package or null if not found. - */ - public static Package lookupPackageBeforeWildcard(Package root, List qualifiedName) { - Package cur = root; - for (int i = 0; i < qualifiedName.size(); i++) { - String name = qualifiedName.get(i); - // Stop if we encounter the wilcard. - if (WILDCARD.equals(name)) { - break; - } - - cur = lookupPackage(cur, name); - if (cur == null) { - return null; - } - } - return cur; - } - - - /** - * Get the package containing the last package of the qualifiedName. - * Create any missing package if needed - * Do not lookup for the last element. - * If there is no scope package in the qualifiedName, return the root. - * - * @param model - * @param qualifiedName - * @return The containing package (never null) - */ - public static Package getContainingPackage(Resource model, List qualifiedName) { - Package cur = getNamedElement(model, UMLPackage.eINSTANCE.getPackage(), qualifiedName.get(0)); - - for (int i = 1; i < qualifiedName.size() - 1; i++) { - String name = qualifiedName.get(i); - cur = getPackage(cur, name); - // if(cur==null) - // return null; - } - return cur; - } - - /** - * Get the package containing the last package of the qualifiedName. - * Create any missing package if needed - * Do not lookup for the last element. - * If there is no scope package in the qualifiedName, return the root. - * - * @param model - * @param qualifiedName - * @return The containing package or null if not found. - */ - private static Package lookupContainingPackage(Resource model, List qualifiedName) { - Package cur = lookupNamedElement(model, UMLPackage.eINSTANCE.getPackage(), qualifiedName.get(0)); - if (cur == null) { - return null; - } - - for (int i = 1; i < qualifiedName.size() - 1; i++) { - String name = qualifiedName.get(i); - cur = lookupPackage(cur, name); - if (cur == null) { - return null; - } - } - return cur; - } - - /** - * Get the Package corresponding to the qname. - * Create all missing package - * - * @param qualifiedName - * @return The requested package (never null) - */ - public static Package getPackage(Resource model, List qualifiedName) { - Package cur = getNamedElement(model, UMLPackage.eINSTANCE.getPackage(), qualifiedName.get(0)); - - for (int i = 1; i < qualifiedName.size(); i++) { - String name = qualifiedName.get(i); - cur = getPackage(cur, name); - // if(cur==null) - // return null; - } - return cur; - } - - /** - * Lookup the Package corresponding to the qname in specified model resource.. - * - * @param qualifiedName - * @return The requested package or null if not found - */ - public static Package lookupPackage(Resource model, List qualifiedName) { - Package cur = lookupNamedElement(model, UMLPackage.eINSTANCE.getPackage(), qualifiedName.get(0)); - if (cur == null) { - return null; - } - - for (int i = 1; i < qualifiedName.size(); i++) { - String name = qualifiedName.get(i); - cur = lookupPackage(cur, name); - if (cur == null) { - return null; - } - } - return cur; - } - - /** - * Get the Package corresponding to the qname. - * Create all missing package - * - * @param parent - * @param qualifiedName - * @return The requested package (never null) - */ - public static Package getPackage(Package parent, List qualifiedName) { - Package cur = parent; - for (int i = 0; i < qualifiedName.size(); i++) { - String name = qualifiedName.get(i); - cur = getPackage(cur, name); - // if(cur==null) - // return null; - } - return cur; - } - - /** - * Get the Model corresponding to the qname. - * Create all missing package. - * - * @param parent - * @param qualifiedName - * @return The requested package (never null) - */ - public static Package getModel(Package parent, List qualifiedName) { - Package cur = parent; - - // Get the intermediate as Package - int i = 0; - for (i = 0; i < qualifiedName.size() - 1; i++) { - String name = qualifiedName.get(i); - cur = getPackage(cur, name); - } - // Get the last one as Model - String name = qualifiedName.get(i); - cur = getModel(cur, name); - - return cur; - } - - /** - * Get the Package corresponding to the qname. - * - * @param parent - * @param qualifiedName - * @return The requested package or null if not found - */ - public static Package lookupPackage(Package parent, List qualifiedName) { - Package cur = parent; - for (int i = 0; i < qualifiedName.size(); i++) { - String name = qualifiedName.get(i); - cur = lookupPackage(cur, name); - if (cur == null) { - return null; - } - } - return cur; - } - - /** - * get (lookup or create) the specified NamedElement with the requested type - * - * @param - * should be equals to expected type. - * @param model - * @param expectedType - * @param name - * @return - */ - protected static R getNamedElement(Resource model, EClass expectedType, String name) { - - for (Object cur : model.getContents()) { - // System.out.println("Compare " + cur.getClass().getName() + "-->" + name ); - if (expectedType.getInstanceClass().isInstance(cur) && name.equals(((NamedElement) cur).getName())) { - // System.out.println("found !!!"); - return (R) cur; - } - } - - // Create it - R res = (R) UMLFactory.eINSTANCE.create(expectedType); - res.setName(name); - model.getContents().add(res); - return res; - } - - /** - * Lookup for the specified NamedElement with the requested type from the model container. - * - * @param - * @param model - * @param expectedType - * @param name - * @return - */ - protected static R lookupNamedElement(Resource model, EClass expectedType, String name) { - - for (Object cur : model.getContents()) { - if (expectedType.isInstance(cur) && name.equals(((NamedElement) cur).getName())) { - return (R) cur; - } - } - - return null; - } - - - /** - * Lookup or create the requested qualifiedName. Create it with the specified type. - * - * @param parentPackage - * @param generalQualifiedName - * @param expectedType - * @return - */ - public static R getClassifier(Package parent, List qualifiedName, EClass expectedType) { - // Get or create containing packages - Package p = getContainingPackage(parent, qualifiedName); - // Use the last name to create the element - return (R) p.getOwnedType(qualifiedName.get(qualifiedName.size() - 1), false, expectedType, true); - } - - /** - * Lookup the corresponding classifier to the qname in specified model resource.. - * - * @param qualifiedName - * @return The requested package or null if not found - */ - public static R lookupClassifier(Resource model, List qualifiedName, EClass expectedType) { - Package p = lookupContainingPackage(model, qualifiedName); - if (p == null) { - return null; - } - - return (R) p.getOwnedType(qualifiedName.get(qualifiedName.size() - 1), false, expectedType, false); - } - - /** - * Lookup for the classifier with specified qualifiedName in specified model resource.. - * - * @param qualifiedName - * @return The requested package or null if not found - */ - public static R lookupClassifierWithWildcard(Resource model, List qualifiedName, EClass expectedType) { - Package p = lookupContainingPackage(model, qualifiedName); - if (p == null) { - return null; - } - - return (R) p.getOwnedType(qualifiedName.get(qualifiedName.size() - 1), false, expectedType, false); - } - - - /** - * Lookup for the classifier with specified qualifiedName in specified model resource.. - * Don't Create it . - * The qualifiedName can contain a wildcard "*". - * - * @param parentPackage - * @param generalQualifiedName - * @param expectedType - * @return Found classifier or null - */ - public static R lookupClassifierWithWildcard(Package parent, List qualifiedName, EClass expectedType) { - - int wildcardIndex = qualifiedName.indexOf(WILDCARD); - // If there is no wildcard, use more simple implementation. - if (wildcardIndex < 0) { - return lookupClassifier(parent, qualifiedName, expectedType); - } - - // Get containing package till the WILDCARD - Package p = lookupPackageBeforeWildcard(parent, qualifiedName); - // If not found, return - if (p == null) { - return null; - } - - // Use the last name to lookup the element - // Look for existing packages at the place of the wildcard. - List existingPackages = p.getNestedPackages(); - // Get the remaining path from ]index, size] - List remainingPath = qualifiedName.subList(wildcardIndex + 1, qualifiedName.size()); - // Now continue searching from the existing packages - for (Package nestedPackage : existingPackages) { - - R r = lookupClassifier(nestedPackage, qualifiedName, expectedType); - if (r != null) { - return r; - } - } - - // Nothing found - return null; - } - - /** - * Lookup the requested qualifiedName. Don't Create it . - * - * @param parentPackage - * @param generalQualifiedName - * @param expectedType - * @return Found classifier or null - */ - public static R lookupClassifier(Package parent, List qualifiedName, EClass expectedType) { - // Get containing package - Package p = lookupContainingPackage(parent, qualifiedName); - if (p == null) { - return null; - } - // Use the last name to create the element - return (R) p.getOwnedType(qualifiedName.get(qualifiedName.size() - 1), false, expectedType, false); - } - - /** - * Lookup the requested qualifiedName. Don't Create it . - * - * @param parentPackage - * @param generalQualifiedName - * @param expectedType - * @return Found classifier or null - */ - public static R lookupClassifier(Namespace parent, List qualifiedName, EClass expectedType) { - // Get containing package - Namespace p = lookupContainingNamespace(parent, qualifiedName); - if (p == null) { - return null; - } - - parent = p; - String shortname = qualifiedName.get(qualifiedName.size() - 1); - Classifier result; - - if (parent instanceof Package) - { - result = (Classifier) ((Package) parent).getOwnedType(shortname, false, expectedType, false); - - } - else if (parent instanceof Interface) - { - result = ((Interface) parent).getNestedClassifier(shortname, false, expectedType, false); - } - else if (parent instanceof Class) - { - result = ((Class) parent).getNestedClassifier(shortname, false, expectedType, false); - } - else - { - // Should never happen ! - return null; - } - - return (R) result; - } - - /** - * Lookup for the specified package in the parent package. Create it if not found. - * - * @param parent - * @param name - * Package to found - * @return - */ - public static Class getClass(Package parent, String name) { - // Get or create an instance of the specified package. - Class p = (Class) parent.getOwnedType(name, false, UMLPackage.eINSTANCE.getClass_(), true); - return p; - } - - /** - * Get the specified class from the specified parent. - * Missing package and the class are created if needed. - * - * @param parent - * @param qualifiedName - * @return - */ - public static Class getClass(Package parent, List qualifiedName) { - Package p = getContainingPackage(parent, qualifiedName); - // Use the last name to create the element - return getClass(p, qualifiedName.get(qualifiedName.size() - 1)); - } - - /** - * - * @param enclosingParents - * list of enclosing parent, from the most outerside to the most inner side. - * @param name - * @return - */ - public static Class getClass(List enclosingParents, String name) { - - EClass type = UMLPackage.eINSTANCE.getClass_(); - Class result = (Class) getClassifier(enclosingParents, name, type); - - return result; - } - - /** - * Get or create a Classifier by its name. The type of the classifier can be Class or Interface - * Lookup is done in the provided namespaces, using the short name. - * The classifier is expected to be in the directly enclosing parent, but lookup is done in all enclosing parents. - * If the position is not the one expected, the found classifier is moved to the enclosing parent. - * - * If not found, create the classifier in the directly enclosing namespace. - * If found, correct the classifier parent to be the directly enclosing namespace. Eventually correct the type - * if it doesn't match. - * - * @param enclosingParents - * @param name - * @param type - * @return - */ - private static Classifier getClassifier(List enclosingParents, String name, EClass type) { - Classifier result = null; - int parentsCount = enclosingParents.size(); - // Get the direct parent - Namespace parent = enclosingParents.get(parentsCount - 1); - - // Look in enclosing parents - for (int i = parentsCount - 1; i >= 0; i--) - { - Namespace namespace = enclosingParents.get(i); - - // Lookup for the exact type - result = (Classifier) namespace.getOwnedMember(name, false, type); - if (result == null) - { - // Lookup for the other type - result = (Classifier) namespace.getOwnedMember(name, false, UMLPackage.eINSTANCE.getClassifier()); - } - - // Here, the result should have the correct type - if (result != null) - { - // Change type if needed - if (result.eClass() != type) { - System.err.println("Classifier type need to be corrected for (" + result.getQualifiedName() + ")"); - // Correct the classifier type - result = (Classifier) transformInto(result, type); - } - // Check if parent need to be corrected - if (result.getOwner() != parent) { - - // Correct the parent - setClassifierOwner(result, parent); - // Get the transformed element. - } - - // Found, return it - return result; - } - } - - // Not found, create in the direct parent. - - if (parent instanceof Package) - { - result = (Classifier) ((Package) parent).getOwnedType(name, false, type, true); - - } - else if (parent instanceof Interface) - { - result = ((Interface) parent).createNestedClassifier(name, type); - } - else if (parent instanceof Class) - { - result = ((Class) parent).createNestedClassifier(name, type); - } - else - { - // Should never happen ! - // The first namespace is always the package. - Package parentPackage = (Package) enclosingParents.get(0); - result = (Classifier) parentPackage.getOwnedType(name, false, type, true); - } - return result; - } - - /** - * Change the owner of the classifier - * - * @param classifier - * The classifier to change the parent - * @param newParent - * The parent to set. - */ - private static void setClassifierOwner(Classifier classifier, Namespace newParent) { - // Not found, create in the direct parent. - if (newParent instanceof Package) - { - classifier.setPackage((Package) newParent); - - } - else if (newParent instanceof Interface) - { - - ((Interface) newParent).getNestedClassifiers().add(classifier); - } - else if (newParent instanceof Class) - { - ((Class) newParent).getNestedClassifiers().add(classifier); - } - else - { - // Should never happen ! - // The first namespace is always the package. - System.err.println("Don't know how to change classifier owner for " + newParent); - } - } - - /** - * Transform the element into the specified type - * - * @param toTransform - * Classifier to transform (Class or interface) - * @param type - * Type to transform into - */ - private static EObject transformInto(Classifier toTransform, EClass type) { - - GenericTransformer transformer = new GenericTransformer(toTransform); - EObject result = transformer.transform(type); - return result; - - } - - /** - * Get or create a guessed Classifier by its name. The type of the classifier can be Class or Interface. - * A guessed classifier is a classifier specified by an attribute, a parameter, a return type ... - * First, lookup for a Classifier with the same name, and return it regardless of its type. - * If nothing is found, create a classifier with the specified type. - * - * - * If not found, create the classifier in the package (enclosingParent[0]). - * If found, return it. - * - * @param enclosingParents - * @param name - * The short name - * @param type - * the proposed type to use as a hint for creation. - * @return - */ - public static Classifier getGuessedClassifier(List enclosingParents, List name, EClass type) { - Classifier result = null; - int parentsCount = enclosingParents.size(); - // Get the direct parent - Namespace parent = enclosingParents.get(parentsCount - 1); - - // Look in enclosing parents - for (int i = parentsCount - 1; i >= 0; i--) - { - Namespace namespace = enclosingParents.get(i); - - // Lookup for any type - result = lookupClassifier(namespace, name, UMLPackage.eINSTANCE.getClassifier()); - // result = (Classifier)namespace.getOwnedMember(name, false, UMLPackage.eINSTANCE.getClassifier()); - if (result != null) - { - return result; - } - } - - // Not found, create in the direct parent. - // The first namespace is always the package. - Package parentPackage = (Package) enclosingParents.get(0); - result = (Classifier) getClassifier(parentPackage, name, type); - // result = (Classifier) ((Package)parentPackage).getOwnedType(name, false, type, true); - - return result; - } - - /** - * - * @param parent - * @param name - * @return - */ - public static Interface getInterface(Package parent, String name) { - Interface p = (Interface) parent.getOwnedType(name, false, UMLPackage.eINSTANCE.getInterface(), true); - return p; - } - - /** - * - * @param enclosingParents - * list of enclosing parent, from the most outerside to the most inner side. - * @param name - * @return - */ - public static Interface getInterface(List enclosingParents, String name) { - return (Interface) getClassifier(enclosingParents, name, UMLPackage.eINSTANCE.getInterface()); - } - - /** - * Create a Property and add it to the parent. - * - * @param parent - * @param name - * @param arrayCount - * @return - */ - public static Property createProperty(Classifier parent, Type type, String name, int arrayCount) { - Property p; - if (parent instanceof Class) { - p = createProperty((Class) parent, type, name, arrayCount); - } else if (parent instanceof Interface) { - p = createProperty((Interface) parent, type, name, arrayCount); - } else { - return null; - } - - p.setIsUnique(false); - return p; - } - - /** - * Create a property for the Class - * - * @param parent - * @param type - * @param name - * @param arrayCount - * @return - */ - public static Property createProperty(Class parent, Type type, String name, int arrayCount) { - return parent.getOwnedAttribute(name, type, false, UMLPackage.eINSTANCE.getProperty(), true); - } - - /** - * Create a property for the Class - * - * @param parent - * @param type - * @param name - * @param arrayCount - * @return - */ - public static Property createProperty(Interface parent, Type type, String name, int arrayCount) { - return parent.getOwnedAttribute(name, type, false, UMLPackage.eINSTANCE.getProperty(), true); - } - - /** - * Create a Generalization relation between the specified Classifier - * - * @param child - * @param general - */ - public static void getGeneralization(Classifier child, Classifier general) { - child.getGeneralization(general, true); - // child.createGeneralization(general); - } - - /** - * Create a InterfaceRealization relation between the specified Classifier - * - * @param child - * @param general - */ - public static void getInterfaceRealization(BehavioredClassifier child, Interface general) { - Realization res = lookupInterfaceRealization(child, general); - if (res == null) { - createInterfaceRealization(child, general); - } - } - - /** - * Lookup for the specified realization inside the package - * - * @param parent - * @param child - * @param general - * @return - */ - private static InterfaceRealization lookupInterfaceRealization(Classifier child, Classifier general) { - for (Dependency ele : child.getClientDependencies()) { - if (ele instanceof InterfaceRealization) { - InterfaceRealization real = (InterfaceRealization) ele; - if (real.getClients().contains(child) && real.getSuppliers().contains(general)) { - return real; - } - } - } - return null; - } - - /** - * Create a Generalization relation between the specified Classifier - * - * @param child - * @param general - */ - public static void createInterfaceRealization(BehavioredClassifier child, Interface general) { - InterfaceRealization res = UMLFactory.eINSTANCE.createInterfaceRealization(); - - res.setContract(general); - res.setImplementingClassifier(child); - - // res.getClients().add(child); - // res.getSuppliers().add(general); - res.setName(child.getName() + " implements " + general.getName()); - // child.createGeneralization(general); - // child.getClientDependencies().add(res); - } - - - /** - * Create a Generalization relation between the specified Classifier - * - * @param child - * @param general - */ - public static void getRealization(Package parent, Classifier child, Classifier general) { - Realization res = lookupRealization(parent, child, general); - if (res == null) { - createRealization(parent, child, general); - } - } - - /** - * Lookup for the specified realization inside the package - * - * @param parent - * @param child - * @param general - * @return - */ - private static Realization lookupRealization(Package parent, Classifier child, Classifier general) { - for (PackageableElement ele : parent.getPackagedElements()) { - if (ele instanceof Realization) { - Realization real = (Realization) ele; - if (real.getClients().contains(child) && real.getSuppliers().contains(general)) { - return real; - } - } - } - return null; - } - - /** - * Create a Generalization relation between the specified Classifier - * - * @param child - * @param general - */ - public static void createRealization(Package parent, Classifier child, Classifier general) { - Realization res = UMLFactory.eINSTANCE.createRealization(); - res.getClients().add(child); - res.getSuppliers().add(general); - res.setName(child.getName() + " extends " + general.getName()); - parent.getPackagedElements().add(res); - } - - /** - * Create a primitive type. - * - * @param root - * @param typeName - */ - public static PrimitiveType getPrimitive(Package parent, String typeName) { - return (PrimitiveType) parent.getOwnedType(typeName, true, UMLPackage.eINSTANCE.getPrimitiveType(), true); - - } - - /** - * Get the specified class from the specified parent. - * Missing package and the class are created if needed. - * - * @param parent - * @param qualifiedName - * @return - */ - public static PrimitiveType getPrimitive(Package parent, List qualifiedName) { - Package p = getContainingPackage(parent, qualifiedName); - // Use the last name to create the element - return getPrimitive(p, qualifiedName.get(qualifiedName.size() - 1)); - } - - /** - * Get the specified operation from the provided type. - * - * @param classifier - * @param name - * @return - */ - public static Operation getOperation(Classifier classifier, String name) { - // TODO Auto-generated method stub - List opers = classifier.getOperations(); - for (Operation op : opers) { - if (name.equals(op.getName())) { - return op; - } - } - - Operation res = createOperation(classifier, name); - return res; - } - - /** - * Create an operation with the specified name. - * - * @param classifier - * @param name - * @return - */ - public static Operation createOperation(Classifier classifier, String name) { - // Not found, create it - Operation res = UMLFactory.eINSTANCE.createOperation(); - res.setName(name); - if (classifier instanceof Class) { - ((Class) classifier).getOwnedOperations().add(res); - } else if (classifier instanceof Interface) { - ((Interface) classifier).getOwnedOperations().add(res); - } else if (classifier instanceof DataType) { - ((DataType) classifier).getOwnedOperations().add(res); - } - return res; - } - - - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/Activator.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/Activator.java deleted file mode 100644 index eea09e53942..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/Activator.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.papyrus.java.reverse; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.java.reverse"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/utils/TypeOperationsEnhanced.java b/extraplugins/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/utils/TypeOperationsEnhanced.java deleted file mode 100644 index 55a0f3132b3..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/utils/TypeOperationsEnhanced.java +++ /dev/null @@ -1,184 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 Cedric Dumoulin. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.java.reverse.utils; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.uml2.uml.AggregationKind; -import org.eclipse.uml2.uml.Association; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.internal.operations.TypeOperations; - - -/** - * - * A static utility class that provides operations related to 'Type' model objects. - * - * - *

- * The following operations are supported: - *

    - *
  • {@link org.eclipse.uml2.uml.Type#createAssociation(boolean, org.eclipse.uml2.uml.AggregationKind, java.lang.String, int, int, org.eclipse.uml2.uml.Type, boolean, org.eclipse.uml2.uml.AggregationKind, java.lang.String, int, int) Create Association - * }
  • - *
  • {@link org.eclipse.uml2.uml.Type#getAssociations() Get Associations}
  • - *
  • {@link org.eclipse.uml2.uml.Type#conformsTo(org.eclipse.uml2.uml.Type) Conforms To}
  • - *
- *

- * - * @copyright copied from org.eclipse.uml2.uml.internal.operations.TypeOperations - */ -public class TypeOperationsEnhanced extends TypeOperations { - - /** - * - * - * - * @generated - */ - protected TypeOperationsEnhanced() { - super(); - } - - protected static Property setAssociationEnd(Property property, - Association association, boolean isNavigable, - AggregationKind aggregation) { - - Property associationEnd = property; - - associationEnd.setAggregation(aggregation); - - if (isNavigable) { - association.getMemberEnds().add(associationEnd); - } - - return associationEnd; - } - - - /** - * - * - * - * Creates a(n) (binary) association between this type and the specified other type, with the specified navigabilities, aggregations, names, lower bounds, and upper bounds, and owned by this type's nearest package. - * - * @param type - * The receiving 'Type' model object. - * @param end1IsNavigable - * The navigability for the first end of the new association. - * @param end1Aggregation - * The aggregation for the first end of the new association. - * @param end1Name - * The name for the first end of the new association. - * @param end1Lower - * The lower bound for the first end of the new association. - * @param end1Upper - * The upper bound for the first end of the new association. - * @param end1Type - * The type for the first end of the new association. - * @param end2IsNavigable - * The navigability for the second end of the new association. - * @param end2Aggregation - * The aggregation for the second end of the new association. - * @param end2Name - * The name for the second end of the new association. - * @param end2Lower - * The lower bound for the second end of the new association. - * @param end2Upper - * The upper bound for the second end of the new association. - * - * @generated NOT - */ - public static Association createAssociationFromProperty(Property property, - boolean end1IsNavigable, AggregationKind end1Aggregation, - boolean end2IsNavigable, AggregationKind end2Aggregation, - String end2Name, int end2Lower, int end2Upper) { - return createAssociationFromProperty(property, end1IsNavigable, end1Aggregation, - end2IsNavigable, end2Aggregation, - end2Name, end2Lower, end2Upper, - UMLPackage.Literals.ASSOCIATION); - } - - /** - * - * @param property - * @param end1IsNavigable - * @param end1Aggregation - * @param end2IsNavigable - * @param end2Aggregation - * @param end2Name - * @param end2Lower - * @param end2Upper - * @param eClass - * @return - */ - protected static Association createAssociationFromProperty(Property property, - boolean end1IsNavigable, AggregationKind end1Aggregation, - boolean end2IsNavigable, AggregationKind end2Aggregation, - String end2Name, int end2Lower, int end2Upper, - EClass eClass) { - - // Check if there the property is already part of an association - if (property.getAssociation() != null) { - return property.getAssociation(); - } - - // Get owner (end2Type) - Type type; - try { - type = (Type) property.getOwner(); - } catch (ClassCastException e) { - throw new IllegalArgumentException("Property's owner should be a Type"); - } - - Type end1Type = property.getType(); - // Validate end1 - validateTypeAndBounds(end1Type, end2Lower, end2Upper); - - - org.eclipse.uml2.uml.Package package_ = type.getNearestPackage(); - - if (package_ == null) { - throw new IllegalStateException(); - } - - if (end1Aggregation == null) { - throw new IllegalArgumentException(String.valueOf(end1Aggregation)); - } - - if (end2Aggregation == null) { - throw new IllegalArgumentException(String.valueOf(end2Aggregation)); - } - - Association association = (Association) package_.createOwnedType(null, eClass); - association.setName("A_" + property.getName() + "_" + end2Name); - - // Set end1 - // createAssociationEnd(type, association, end1IsNavigable, - // end1Aggregation, end1Name, end1Lower, end1Upper, end1Type); - setAssociationEnd(property, association, end1IsNavigable, - end1Aggregation); - - createAssociationEnd(end1Type, association, end2IsNavigable, - end2Aggregation, end2Name, end2Lower, end2Upper, type); - - - - - - return association; - } - -} // TypeOperations \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.template/.classpath b/extraplugins/java/org.eclipse.papyrus.java.template/.classpath deleted file mode 100644 index 2d1a4302f04..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.template/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.template/.project b/extraplugins/java/org.eclipse.papyrus.java.template/.project deleted file mode 100644 index 4bfadfe48b4..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.template/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.java.template - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.core.prefs b/extraplugins/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 4759947300a..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,291 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=260 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=false -org.eclipse.jdt.core.formatter.join_wrapped_lines=false -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=260 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=tab -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=false -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 954281dbc31..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,68 +0,0 @@ -cleanup.add_default_serial_version_id=true -cleanup.add_generated_serial_version_id=false -cleanup.add_missing_annotations=true -cleanup.add_missing_deprecated_annotations=true -cleanup.add_missing_methods=false -cleanup.add_missing_nls_tags=false -cleanup.add_missing_override_annotations=true -cleanup.add_missing_override_annotations_interface_methods=true -cleanup.add_serial_version_id=false -cleanup.always_use_blocks=true -cleanup.always_use_parentheses_in_expressions=false -cleanup.always_use_this_for_non_static_field_access=false -cleanup.always_use_this_for_non_static_method_access=false -cleanup.convert_functional_interfaces=false -cleanup.convert_to_enhanced_for_loop=false -cleanup.correct_indentation=false -cleanup.format_source_code=false -cleanup.format_source_code_changes_only=false -cleanup.insert_inferred_type_arguments=false -cleanup.make_local_variable_final=true -cleanup.make_parameters_final=false -cleanup.make_private_fields_final=true -cleanup.make_type_abstract_if_missing_method=false -cleanup.make_variable_declarations_final=false -cleanup.never_use_blocks=false -cleanup.never_use_parentheses_in_expressions=true -cleanup.organize_imports=false -cleanup.qualify_static_field_accesses_with_declaring_class=false -cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true -cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true -cleanup.qualify_static_member_accesses_with_declaring_class=true -cleanup.qualify_static_method_accesses_with_declaring_class=false -cleanup.remove_private_constructors=true -cleanup.remove_redundant_type_arguments=true -cleanup.remove_trailing_whitespaces=true -cleanup.remove_trailing_whitespaces_all=true -cleanup.remove_trailing_whitespaces_ignore_empty=false -cleanup.remove_unnecessary_casts=true -cleanup.remove_unnecessary_nls_tags=true -cleanup.remove_unused_imports=true -cleanup.remove_unused_local_variables=false -cleanup.remove_unused_private_fields=true -cleanup.remove_unused_private_members=false -cleanup.remove_unused_private_methods=true -cleanup.remove_unused_private_types=true -cleanup.sort_members=false -cleanup.sort_members_all=false -cleanup.use_anonymous_class_creation=false -cleanup.use_blocks=true -cleanup.use_blocks_only_for_return_and_throw=false -cleanup.use_lambda=true -cleanup.use_parentheses_in_expressions=false -cleanup.use_this_for_non_static_field_access=false -cleanup.use_this_for_non_static_field_access_only_if_necessary=true -cleanup.use_this_for_non_static_method_access=false -cleanup.use_this_for_non_static_method_access_only_if_necessary=true -cleanup.use_type_arguments=false -cleanup_profile=_Papyrus -cleanup_settings_version=2 -eclipse.preferences.version=1 -formatter_profile=_Papyrus -formatter_settings_version=12 -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=java;javax;org;com; -org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/java/org.eclipse.papyrus.java.template/META-INF/MANIFEST.MF b/extraplugins/java/org.eclipse.papyrus.java.template/META-INF/MANIFEST.MF deleted file mode 100644 index 9c471179c14..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.template/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.jface.text, - org.eclipse.jdt.core, - org.eclipse.jdt.ui, - org.eclipse.pde.core, - org.eclipse.ui -Bundle-Vendor: Atos Origin -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Name: Java Template -Bundle-Activator: org.eclipse.papyrus.java.template.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.java.template;singleton:=true -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/extraplugins/java/org.eclipse.papyrus.java.template/about.html b/extraplugins/java/org.eclipse.papyrus.java.template/about.html deleted file mode 100644 index a80e9697355..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.template/about.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - -About - -

About This Content

- -

June 5, 2006

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - \ No newline at end of file diff --git a/extraplugins/java/org.eclipse.papyrus.java.template/build.properties b/extraplugins/java/org.eclipse.papyrus.java.template/build.properties deleted file mode 100644 index 534691f258d..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.template/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml -src.includes = about.html diff --git a/extraplugins/java/org.eclipse.papyrus.java.template/plugin.xml b/extraplugins/java/org.eclipse.papyrus.java.template/plugin.xml deleted file mode 100644 index f34d144cb6e..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.template/plugin.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/extraplugins/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/Activator.java b/extraplugins/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/Activator.java deleted file mode 100644 index dc84187efd2..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/Activator.java +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2009 Atos Origin. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - *****************************************************************************/ -package org.eclipse.papyrus.java.template; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.java.template"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/BundleActivatorResolver.java b/extraplugins/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/BundleActivatorResolver.java deleted file mode 100644 index fddd864d9eb..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/BundleActivatorResolver.java +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2009 Atos Origin. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - *****************************************************************************/ -package org.eclipse.papyrus.java.template.resolvers; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.internal.corext.template.java.CompilationUnitContext; -import org.eclipse.jdt.internal.corext.template.java.JavaContext; -import org.eclipse.jface.text.templates.TemplateContext; -import org.eclipse.jface.text.templates.TemplateVariable; -import org.eclipse.jface.text.templates.TemplateVariableResolver; -import org.eclipse.pde.core.plugin.IPluginModelBase; -import org.eclipse.pde.core.plugin.PluginRegistry; -import org.osgi.framework.Bundle; -import org.osgi.framework.Constants; - -/** - * This class creates a new variable which resolve the activator class of the compilation unit. - * - * @author tlandre - * - */ -public class BundleActivatorResolver extends TemplateVariableResolver { - - public BundleActivatorResolver() { - super("activatorLog", "Static field log in the activator containing the current compilation unit"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * - * {@inheritDoc} - * - * @see TemplateVariableResolver#resolve(org.eclipse.jface.text.templates.TemplateContext) - * - */ - @SuppressWarnings("restriction") - @Override - public void resolve(TemplateVariable variable, TemplateContext pContext) { - variable.setUnambiguous(true); - variable.setValue(""); //$NON-NLS-1$ - if (pContext instanceof JavaContext) { - final JavaContext context = (JavaContext) pContext; - final IPluginModelBase pluginModelBase = PluginRegistry.findModel(getProject(context)); - Bundle bundle = getBundle(pluginModelBase); - if (bundle != null) { - Object obj = bundle.getHeaders().get(Constants.BUNDLE_ACTIVATOR); - if (obj instanceof String) { - StringBuffer qualifiedName = new StringBuffer((String) obj); - qualifiedName.append(".log"); - context.addStaticImport(qualifiedName.toString()); - } - } - } - - } - - /** - * Get the bundle associated with the IPluginModelBase - * - * @param pluginModelBase - * a pluginModelBase. May be null. - * @return the bundle found or null. - */ - private Bundle getBundle(IPluginModelBase pluginModelBase) { - Bundle bundle = null; - if (pluginModelBase != null && pluginModelBase.getBundleDescription() != null) { - bundle = Platform.getBundle(pluginModelBase.getBundleDescription().getSymbolicName()); - } - return bundle; - } - - /** - * Get the project of the compilation unit (if any) associated with the given JavaContext - * - * @param context - * the JavaContext. Must be not null. - * @return the project found or null - */ - @SuppressWarnings("restriction") - private IProject getProject(CompilationUnitContext context) { - IProject project = null; - ICompilationUnit compilationUnit = context.getCompilationUnit(); - if (compilationUnit != null) { - IJavaProject javaProject = compilationUnit.getJavaProject(); - if (javaProject != null) { - project = javaProject.getProject(); - } - } - return project; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.text.templates.TemplateVariableResolver#resolveAll(org.eclipse.jface.text.templates.TemplateContext) - */ - @Override - protected String[] resolveAll(TemplateContext context) { - return new String[0]; - } -} diff --git a/extraplugins/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/RegisterResolver.java b/extraplugins/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/RegisterResolver.java deleted file mode 100644 index 95c0461ac39..00000000000 --- a/extraplugins/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/RegisterResolver.java +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2009 Atos Origin. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - *****************************************************************************/ -package org.eclipse.papyrus.java.template.resolvers; - -import java.util.Iterator; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.jdt.internal.corext.template.java.CompilationUnitContextType; -import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jface.text.templates.ContextTypeRegistry; -import org.eclipse.papyrus.java.template.Activator; -import org.eclipse.ui.IStartup; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.BundleEvent; -import org.osgi.framework.BundleListener; - -/** - * This class registers the resolver into the ContextTypeRegistry - * - * @author tlandre - * - */ -public class RegisterResolver implements IStartup { - - /** - * - * {@inheritDoc} - * - * @see IStartup#earlyStartup() - * - */ - public void earlyStartup() { - // check if plug-in org.eclipse.jdt.ui is already active - Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID); - if (bundle != null && bundle.getState() == Bundle.ACTIVE) { - // register resolvers - registerResolvers(); - } else { - // register listener to get informed, when plug-in becomes active - final BundleContext bundleContext = Activator.getDefault().getBundle().getBundleContext(); - if (bundleContext != null) { - bundleContext.addBundleListener(new BundleListener() { - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleListener#bundleChanged(org.osgi.framework.BundleEvent) - */ - public void bundleChanged(final BundleEvent pEvent) { - Bundle bundle = pEvent.getBundle(); - if (!Activator.PLUGIN_ID.equals(bundle.getSymbolicName())) { - return; - } - if (bundle.getState() == Bundle.ACTIVE) { - // register resolvers - registerResolvers(); - bundleContext.removeBundleListener(this); - } - } - }); - } - } - } - - /** - * - * Internal method to register resolvers with all context types. - * - */ - private void registerResolvers() { - final ContextTypeRegistry codeTemplateContextRegistry = JavaPlugin.getDefault().getTemplateContextRegistry(); - final Iterator ctIter = codeTemplateContextRegistry.contextTypes(); - while (ctIter.hasNext()) { - Object object = ctIter.next(); - if (object instanceof CompilationUnitContextType) { - CompilationUnitContextType contextType = (CompilationUnitContextType) object; - // Add the bundle activator resolver - contextType.addResolver(new BundleActivatorResolver()); - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/.classpath b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/.classpath deleted file mode 100644 index 098194ca4b7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/.project b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/.project deleted file mode 100644 index 856e4c4cd85..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.fcm.profile - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f42de363afa..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/META-INF/MANIFEST.MF deleted file mode 100644 index fd139e5c660..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/META-INF/MANIFEST.MF +++ /dev/null @@ -1,24 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.emf.ecore;visibility:=reexport, - org.eclipse.emf.ecore.xmi;visibility:=reexport, - org.eclipse.uml2.uml;visibility:=reexport, - org.eclipse.uml2.types;visibility:=reexport, - org.eclipse.emf.transaction;bundle-version="1.4.0", - org.eclipse.papyrus.infra.core;bundle-version="1.2.0", - org.eclipse.gmf.runtime.common.core;bundle-version="1.4.1", - org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0", - org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0", - org.eclipse.ui;bundle-version="3.105.0" -Export-Package: org.eclipse.papyrus.FCM, - org.eclipse.papyrus.FCM.impl, - org.eclipse.papyrus.FCM.util -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-ClassPath: . -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.fcm.profile;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/about.html b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/build.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/build.properties deleted file mode 100644 index cb863c1cf51..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/build.properties +++ /dev/null @@ -1,19 +0,0 @@ - -# -# -# -# $Id$ - -bin.includes = .,\ - model/,\ - META-INF/,\ - plugin.xml,\ - plugin.properties,\ - icons/,\ - palettes/,\ - about.html,\ - schema/ -jars.compile.order = . -source.. = src/ -output.. = bin/ -src.includes = about.html diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/connector.png b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/connector.png deleted file mode 100644 index 975629baeaa..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/connector.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/connector.svg b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/connector.svg deleted file mode 100644 index c56fadbf37d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/connector.svg +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/deploy.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/deploy.gif deleted file mode 100644 index 7a7ced35f3d..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/deploy.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/fcm.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/fcm.gif deleted file mode 100644 index ec21c358e2f..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/fcm.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/hires/connector.png b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/hires/connector.png deleted file mode 100644 index e2be455d487..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/hires/connector.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/port.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/port.gif deleted file mode 100644 index 4aea611efe7..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/port.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/target.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/target.gif deleted file mode 100644 index 92b10039973..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/icons/target.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.ecore b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.ecore deleted file mode 100644 index dda5a4bf17e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.ecore +++ /dev/null @@ -1,301 +0,0 @@ - - - - -
- - - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - -
- - - - - - - -
- - - - - - - -
- - - - - -
- - - - - - - - - - -
- - - - - - - - - - -
- - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.genmodel b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.genmodel deleted file mode 100644 index d14164bedca..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.genmodel +++ /dev/null @@ -1,176 +0,0 @@ - - - FCM.ecore - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.di b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.di deleted file mode 100644 index 375842f73a9..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.di +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.notation deleted file mode 100644 index 273d8fcf69a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.notation +++ /dev/null @@ -1,2897 +0,0 @@ - - - - - -
- - - - - -
- - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - name - derived - multiplicity - type - - - - - - - name - derived - type - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - name - derived - multiplicity - type - - - - - - - name - derived - type - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - name - derived - type - - - - - - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - name - derived - type - - - - - - - name - derived - type - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - -
-
-
-
-
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - -
- - -
- - -
- - -
-
-
-
-
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
- - - name - derived - multiplicity - type - - - - - - -
- - - name - derived - multiplicity - type - - - - - - -
- - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
- - - name - derived - multiplicity - type - - - - - - - name - type - derived - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
- - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - -
- - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - -
- - - -
- - - name - derived - multiplicity - type - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - name - derived - type - - - - - - - name - derived - multiplicity - type - - - - - - - name - derived - type - - - - - - - name - derived - type - - - - - - - name - derived - type - - - - - - - name - derived - multiplicity - type - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- - - - - - - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.uml deleted file mode 100644 index 1e2517210f2..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.uml +++ /dev/null @@ -1,679 +0,0 @@ - - - - - The associations between PortKind and Operation simply denote the fact that we want to target something that encapsulates the definition of interface mapping rules (i.e. the rules that determine the interfaces that are provided/required on a port -of a particular PortKind). Further experiments are still needed to confirm that the Operation metaclass is the right metaclass to encapsulate this definition. - - - The template parameters list defines the parameters that are passed to the Acceleo template. If empty, the formal parameter list of the package template is used. - - - LateEvaluation is more a tempalte binding rather than a template definition. In - - - This stereotype indicuates that the attribute does not only store values but needs to be configured initially be the user. It corresponds to the automatic creation of an entry (slot+nstance specification) in the deployment plan - - - A group of interaction components should apply both stereotypes. Each member of such a group must be an interaction component, but this is not enforced by the meta-model - - - A rule that is applied to a package applies automatically to all elements that are contained within - - - Assembly and FlatComposite are components whose parts are allocated to different nodes. -Both may not have a behavior - - - An assembly is a collection of (interconnected) parts. During distribution, a variant of the assembly is created for each node, that contains only a subset of the parts. This requires that -(1) no inheritance -(2) all instances of the assembly on a node must be split in an identical way -The system component is also an assembly - - - A composite that will get flattened during distribution. This means that it vanishes and its parts are added to the composite in which the flat composite is defined. A flat composite may not have assembly connections. It is primarily used by interaction components - - - We assume that a model library defines a set of supported programming languages as well as a set of provided component to mappings. We do not use a fixed enumeration defined in the profile to assure extensibility - - - This information on a package tells the code generators which programming language and which component-to-OO mapping should be used - - - An interaction component is responsible for realization the communication between two components. It typically owns conjugated ports. It might be defined within a package template to enable the adaption of ports to those used by the interacting components - - - Indicate that this component is instantiated only once within the system. It also implies that this component is automatically instantiated by a generated bootloader - - - This stereotype references the interaction component that should realize the communication. It can be applied to UML connectors as well as to properties. The former is used, if there are two communication partners, the latter is more flexible. For instance, in case of a DDS interaction, a publisher does not know the consumers, it therefore communicates with a part (property) representing the publisher part of the interaction component - - - Use a dedicated component that that is responsible for configuring component instances. The concept is primarily intented for container extensions. For instance, a container extension might provide reflection data about a component. In this case, the instance configuration would create the value specifications using data available in the model - - - Apply a set of container rules. It can be applied to a single class or to a package, implying that all components within the package apply the specified rule. - - - A container rule, i.e. a specification of extension or interception within a container. Beside the two options, a container rule is basically a composite class whose parts are added to the container. - - - Template ports are ports that enable the binding of an extended port with an actual parameter: the resulting port kind is the port kind bound to the current port type. -For instance, we cound type a port with "MyType" and use an extended port Writer with a template with formal parameter T. Resulting port would be Writer with T bound to MyType. - - - A binding helper is responsible for creating sub-elements. For instance, if the formal parameter of a template is an interface, it might be required to instantiate an operation for each operation of the interface. - - - Condition whether an interceptor should be used within a container. -- "Some" = set of ports defined in interception rule -- "AllOut/AllIn" = ports with required/provided ports only -- "Matching" = kind of interceptor and component port need to match - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/palettes/palette-classdep.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/palettes/palette-classdep.xml deleted file mode 100644 index 2352951986c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/palettes/palette-classdep.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/palettes/palette-composite.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/palettes/palette-composite.xml deleted file mode 100644 index d5afbd294a9..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/palettes/palette-composite.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/plugin.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/plugin.properties deleted file mode 100644 index f15495b325f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus extra: profile for flexible component model - FCM (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/plugin.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/plugin.xml deleted file mode 100644 index fd9d5ec828a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/plugin.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/pom.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/pom.xml deleted file mode 100644 index 30de6eb7866..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.fcm.profile - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/schema/fcmBindingHelper.exsd b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/schema/fcmBindingHelper.exsd deleted file mode 100644 index e51291f98af..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/schema/fcmBindingHelper.exsd +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - [Enter description of this extension point.] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/schema/fcmEmbeddingRule.exsd b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/schema/fcmEmbeddingRule.exsd deleted file mode 100644 index 82aa794425b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/schema/fcmEmbeddingRule.exsd +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - [Enter description of this extension point.] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/schema/fcmPortMappingRule.exsd b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/schema/fcmPortMappingRule.exsd deleted file mode 100644 index 77f6e9cb5e4..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/schema/fcmPortMappingRule.exsd +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - A port mapping rule, i.e. a rule that maps port kinds to a provider and/or required interface - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Activator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Activator.java deleted file mode 100644 index 2d60ac344ee..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Activator.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.FCM; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.fcm.profile"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Assembly.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Assembly.java deleted file mode 100644 index 1d4189e3920..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Assembly.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Assembly'. - * - * - * - * An assembly is a collection of (interconnected) parts. During distribution, a variant of the assembly is created for each node, that contains only a subset of the parts. This requires that - * (1) no inheritance - * (2) all instances of the assembly on a node must be split in an identical way - * The system component is also an assembly - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.Assembly#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getAssembly() - * @model - * @generated - */ -public interface Assembly extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getAssembly_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Assembly#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // Assembly diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndex.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndex.java deleted file mode 100644 index 40a23903437..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndex.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Property; - -/** - * - * A representation of the model object 'Auto Index'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.AutoIndex#getBase_Property Base Property}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getAutoIndex() - * @model - * @generated - */ -public interface AutoIndex extends EObject { - /** - * Returns the value of the 'Base Property' reference. - * - *

- * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Property' reference. - * @see #setBase_Property(Property) - * @see org.eclipse.papyrus.FCM.FCMPackage#getAutoIndex_Base_Property() - * @model required="true" ordered="false" - * @generated - */ - Property getBase_Property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.AutoIndex#getBase_Property Base Property}' reference. - * - * - * @param value the new value of the 'Base Property' reference. - * @see #getBase_Property() - * @generated - */ - void setBase_Property(Property value); - -} // AutoIndex diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndexPerNode.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndexPerNode.java deleted file mode 100644 index d986de382f4..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndexPerNode.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - - -/** - * - * A representation of the model object 'Auto Index Per Node'. - * - * - * - * @see org.eclipse.papyrus.FCM.FCMPackage#getAutoIndexPerNode() - * @model - * @generated - */ -public interface AutoIndexPerNode extends AutoIndex { -} // AutoIndexPerNode diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindTemplate.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindTemplate.java deleted file mode 100644 index 94380f0d970..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindTemplate.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; - -/** - * - * A representation of the model object 'Bind Template'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.BindTemplate#getActual Actual}
  • - *
  • {@link org.eclipse.papyrus.FCM.BindTemplate#getBase_Property Base Property}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getBindTemplate() - * @model - * @generated - */ -public interface BindTemplate extends EObject { - /** - * Returns the value of the 'Actual' reference list. - * The list contents are of type {@link org.eclipse.uml2.uml.Type}. - * - *

- * If the meaning of the 'Actual' reference list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Actual' reference list. - * @see org.eclipse.papyrus.FCM.FCMPackage#getBindTemplate_Actual() - * @model ordered="false" - * @generated - */ - EList getActual(); - - /** - * Returns the value of the 'Base Property' reference. - * - *

- * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Property' reference. - * @see #setBase_Property(Property) - * @see org.eclipse.papyrus.FCM.FCMPackage#getBindTemplate_Base_Property() - * @model required="true" ordered="false" - * @generated - */ - Property getBase_Property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.BindTemplate#getBase_Property Base Property}' reference. - * - * - * @param value the new value of the 'Base Property' reference. - * @see #getBase_Property() - * @generated - */ - void setBase_Property(Property value); - -} // BindTemplate diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindingHelper.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindingHelper.java deleted file mode 100644 index 901e429efb1..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindingHelper.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Binding Helper'. - * - * - * - * A binding helper is responsible for creating sub-elements. For instance, if the formal parameter of a template is an interface, it might be required to instantiate an operation for each operation of the interface. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.BindingHelper#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getBindingHelper() - * @model - * @generated - */ -public interface BindingHelper extends EObject { - - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getBindingHelper_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.BindingHelper#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); -} // BindingHelper diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CodeGenOptions.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CodeGenOptions.java deleted file mode 100644 index a0554816e52..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CodeGenOptions.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Code Gen Options'. - * - * - * - * This information on a package tells the code generators which programming language and which component-to-OO mapping should be used - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.CodeGenOptions#getBase_Package Base Package}
  • - *
  • {@link org.eclipse.papyrus.FCM.CodeGenOptions#getCompToOOmapping Comp To OOmapping}
  • - *
  • {@link org.eclipse.papyrus.FCM.CodeGenOptions#getProgLanguage Prog Language}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getCodeGenOptions() - * @model - * @generated - */ -public interface CodeGenOptions extends EObject { - /** - * Returns the value of the 'Base Package' reference. - * - *

- * If the meaning of the 'Base Package' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Package' reference. - * @see #setBase_Package(org.eclipse.uml2.uml.Package) - * @see org.eclipse.papyrus.FCM.FCMPackage#getCodeGenOptions_Base_Package() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Package getBase_Package(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.CodeGenOptions#getBase_Package Base Package}' reference. - * - * - * @param value the new value of the 'Base Package' reference. - * @see #getBase_Package() - * @generated - */ - void setBase_Package(org.eclipse.uml2.uml.Package value); - - /** - * Returns the value of the 'Comp To OOmapping' reference. - * - *

- * If the meaning of the 'Comp To OOmapping' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Comp To OOmapping' reference. - * @see #setCompToOOmapping(CompToOOmapping) - * @see org.eclipse.papyrus.FCM.FCMPackage#getCodeGenOptions_CompToOOmapping() - * @model required="true" ordered="false" - * @generated - */ - CompToOOmapping getCompToOOmapping(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.CodeGenOptions#getCompToOOmapping Comp To OOmapping}' reference. - * - * - * @param value the new value of the 'Comp To OOmapping' reference. - * @see #getCompToOOmapping() - * @generated - */ - void setCompToOOmapping(CompToOOmapping value); - - /** - * Returns the value of the 'Prog Language' reference. - * - *

- * If the meaning of the 'Prog Language' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Prog Language' reference. - * @see #setProgLanguage(ProgLanguage) - * @see org.eclipse.papyrus.FCM.FCMPackage#getCodeGenOptions_ProgLanguage() - * @model required="true" ordered="false" - * @generated - */ - ProgLanguage getProgLanguage(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.CodeGenOptions#getProgLanguage Prog Language}' reference. - * - * - * @param value the new value of the 'Prog Language' reference. - * @see #getProgLanguage() - * @generated - */ - void setProgLanguage(ProgLanguage value); - -} // CodeGenOptions diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompImplTemplate.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompImplTemplate.java deleted file mode 100644 index 25ff298bda8..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompImplTemplate.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Comp Impl Template'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.CompImplTemplate#getTemplateDefs Template Defs}
  • - *
  • {@link org.eclipse.papyrus.FCM.CompImplTemplate#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getCompImplTemplate() - * @model - * @generated - */ -public interface CompImplTemplate extends EObject { - /** - * Returns the value of the 'Template Defs' attribute. - * - *

- * If the meaning of the 'Template Defs' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Template Defs' attribute. - * @see #setTemplateDefs(String) - * @see org.eclipse.papyrus.FCM.FCMPackage#getCompImplTemplate_TemplateDefs() - * @model unique="false" dataType="org.eclipse.uml2.types.String" ordered="false" - * @generated - */ - String getTemplateDefs(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.CompImplTemplate#getTemplateDefs Template Defs}' attribute. - * - * - * @param value the new value of the 'Template Defs' attribute. - * @see #getTemplateDefs() - * @generated - */ - void setTemplateDefs(String value); - - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getCompImplTemplate_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.CompImplTemplate#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // CompImplTemplate diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompToOOmapping.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompToOOmapping.java deleted file mode 100644 index 45a6ac2a439..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompToOOmapping.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Comp To OOmapping'. - * - * - * - * We assume that a model library defines a set of supported programming languages as well as a set of provided component to mappings. We do not use a fixed enumeration defined in the profile to assure extensibility - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.CompToOOmapping#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getCompToOOmapping() - * @model - * @generated - */ -public interface CompToOOmapping extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getCompToOOmapping_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.CompToOOmapping#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // CompToOOmapping diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompilerChain.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompilerChain.java deleted file mode 100644 index c788bf107d5..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompilerChain.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Compiler Chain'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.CompilerChain#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getCompilerChain() - * @model - * @generated - */ -public interface CompilerChain extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getCompilerChain_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.CompilerChain#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // CompilerChain diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigOption.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigOption.java deleted file mode 100644 index 18537c5d33b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigOption.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Config Option'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.ConfigOption#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getConfigOption() - * @model - * @generated - */ -public interface ConfigOption extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getConfigOption_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.ConfigOption#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // ConfigOption diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurableElementInstance.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurableElementInstance.java deleted file mode 100644 index 480e38b98fb..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurableElementInstance.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * A representation of the model object 'Configurable Element Instance'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.ConfigurableElementInstance#getConfiguration Configuration}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getConfigurableElementInstance() - * @model abstract="true" - * @generated - */ -public interface ConfigurableElementInstance extends EObject { - /** - * Returns the value of the 'Configuration' reference. - * - *

- * If the meaning of the 'Configuration' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Configuration' reference. - * @see #setConfiguration(InstanceSpecification) - * @see org.eclipse.papyrus.FCM.FCMPackage#getConfigurableElementInstance_Configuration() - * @model ordered="false" - * @generated - */ - InstanceSpecification getConfiguration(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.ConfigurableElementInstance#getConfiguration Configuration}' reference. - * - * - * @param value the new value of the 'Configuration' reference. - * @see #getConfiguration() - * @generated - */ - void setConfiguration(InstanceSpecification value); - -} // ConfigurableElementInstance diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Configuration.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Configuration.java deleted file mode 100644 index af652b2f3de..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Configuration.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Configuration'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.Configuration#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.Configuration#getConfigOptions Config Options}
  • - *
  • {@link org.eclipse.papyrus.FCM.Configuration#getDeploymentPlan Deployment Plan}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getConfiguration() - * @model - * @generated - */ -public interface Configuration extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getConfiguration_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Configuration#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - - /** - * Returns the value of the 'Config Options' reference list. - * The list contents are of type {@link org.eclipse.papyrus.FCM.ConfigOption}. - * - *

- * If the meaning of the 'Config Options' reference list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Config Options' reference list. - * @see org.eclipse.papyrus.FCM.FCMPackage#getConfiguration_ConfigOptions() - * @model ordered="false" - * @generated - */ - EList getConfigOptions(); - - /** - * Returns the value of the 'Deployment Plan' reference. - * - *

- * If the meaning of the 'Deployment Plan' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Deployment Plan' reference. - * @see #setDeploymentPlan(DeploymentPlan) - * @see org.eclipse.papyrus.FCM.FCMPackage#getConfiguration_DeploymentPlan() - * @model required="true" ordered="false" - * @generated - */ - DeploymentPlan getDeploymentPlan(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Configuration#getDeploymentPlan Deployment Plan}' reference. - * - * - * @param value the new value of the 'Deployment Plan' reference. - * @see #getDeploymentPlan() - * @generated - */ - void setDeploymentPlan(DeploymentPlan value); - -} // Configuration diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurationProperty.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurationProperty.java deleted file mode 100644 index 505e9ad4b84..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurationProperty.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Property; - -/** - * - * A representation of the model object 'Configuration Property'. - * - * - * - * This stereotype indicuates that the attribute does not only store values but needs to be configured initially be the user. It corresponds to the automatic creation of an entry (slot+nstance specification) in the deployment plan - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.ConfigurationProperty#getBase_Property Base Property}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getConfigurationProperty() - * @model - * @generated - */ -public interface ConfigurationProperty extends EObject { - /** - * Returns the value of the 'Base Property' reference. - * - *

- * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Property' reference. - * @see #setBase_Property(Property) - * @see org.eclipse.papyrus.FCM.FCMPackage#getConfigurationProperty_Base_Property() - * @model required="true" ordered="false" - * @generated - */ - Property getBase_Property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.ConfigurationProperty#getBase_Property Base Property}' reference. - * - * - * @param value the new value of the 'Base Property' reference. - * @see #getBase_Property() - * @generated - */ - void setBase_Property(Property value); - -} // ConfigurationProperty diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Connector.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Connector.java deleted file mode 100644 index e8ad70be248..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Connector.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.uml2.uml.Property; - -/** - * - * A representation of the model object 'Connector'. - * - * - * - * This stereotype references the interaction component that should realize the communication. It can be applied to UML connectors as well as to properties. The former is used, if there are two communication partners, the latter is more flexible. For instance, in case of a DDS interaction, a publisher does not know the consumers, it therefore communicates with a part (property) representing the publisher part of the interaction component - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.Connector#getBase_Connector Base Connector}
  • - *
  • {@link org.eclipse.papyrus.FCM.Connector#getIc Ic}
  • - *
  • {@link org.eclipse.papyrus.FCM.Connector#getBase_Property Base Property}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getConnector() - * @model - * @generated - */ -public interface Connector extends ConfigurableElementInstance { - /** - * Returns the value of the 'Base Connector' reference. - * - *

- * If the meaning of the 'Base Connector' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Connector' reference. - * @see #setBase_Connector(org.eclipse.uml2.uml.Connector) - * @see org.eclipse.papyrus.FCM.FCMPackage#getConnector_Base_Connector() - * @model ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Connector getBase_Connector(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Connector#getBase_Connector Base Connector}' reference. - * - * - * @param value the new value of the 'Base Connector' reference. - * @see #getBase_Connector() - * @generated - */ - void setBase_Connector(org.eclipse.uml2.uml.Connector value); - - /** - * Returns the value of the 'Ic' reference. - * - *

- * If the meaning of the 'Ic' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Ic' reference. - * @see #setIc(InteractionComponent) - * @see org.eclipse.papyrus.FCM.FCMPackage#getConnector_Ic() - * @model ordered="false" - * @generated - */ - InteractionComponent getIc(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Connector#getIc Ic}' reference. - * - * - * @param value the new value of the 'Ic' reference. - * @see #getIc() - * @generated - */ - void setIc(InteractionComponent value); - - /** - * Returns the value of the 'Base Property' reference. - * - *

- * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Property' reference. - * @see #setBase_Property(Property) - * @see org.eclipse.papyrus.FCM.FCMPackage#getConnector_Base_Property() - * @model ordered="false" - * @generated - */ - Property getBase_Property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Connector#getBase_Property Base Property}' reference. - * - * - * @param value the new value of the 'Base Property' reference. - * @see #getBase_Property() - * @generated - */ - void setBase_Property(Property value); - -} // Connector diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConnectorConfiguration.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConnectorConfiguration.java deleted file mode 100644 index cd7bb6bcd19..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConnectorConfiguration.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Slot; - -/** - * - * A representation of the model object 'Connector Configuration'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.ConnectorConfiguration#getBase_Slot Base Slot}
  • - *
  • {@link org.eclipse.papyrus.FCM.ConnectorConfiguration#getConnector Connector}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getConnectorConfiguration() - * @model - * @generated - */ -public interface ConnectorConfiguration extends EObject { - /** - * Returns the value of the 'Base Slot' reference. - * - *

- * If the meaning of the 'Base Slot' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Slot' reference. - * @see #setBase_Slot(Slot) - * @see org.eclipse.papyrus.FCM.FCMPackage#getConnectorConfiguration_Base_Slot() - * @model required="true" ordered="false" - * @generated - */ - Slot getBase_Slot(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.ConnectorConfiguration#getBase_Slot Base Slot}' reference. - * - * - * @param value the new value of the 'Base Slot' reference. - * @see #getBase_Slot() - * @generated - */ - void setBase_Slot(Slot value); - - /** - * Returns the value of the 'Connector' reference. - * - *

- * If the meaning of the 'Connector' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Connector' reference. - * @see #setConnector(Connector) - * @see org.eclipse.papyrus.FCM.FCMPackage#getConnectorConfiguration_Connector() - * @model required="true" ordered="false" - * @generated - */ - Connector getConnector(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.ConnectorConfiguration#getConnector Connector}' reference. - * - * - * @param value the new value of the 'Connector' reference. - * @see #getConnector() - * @generated - */ - void setConnector(Connector value); - -} // ConnectorConfiguration diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRule.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRule.java deleted file mode 100644 index 4b4ad0161f8..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRule.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Container Rule'. - * - * - * - * A container rule, i.e. a specification of extension or interception within a container. Beside the two options, a container rule is basically a composite class whose parts are added to the container. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.ContainerRule#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.ContainerRule#getForConfig For Config}
  • - *
  • {@link org.eclipse.papyrus.FCM.ContainerRule#getKind Kind}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getContainerRule() - * @model - * @generated - */ -public interface ContainerRule extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getContainerRule_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.ContainerRule#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - - /** - * Returns the value of the 'For Config' reference list. - * The list contents are of type {@link org.eclipse.papyrus.FCM.ConfigOption}. - * - *

- * If the meaning of the 'For Config' reference list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'For Config' reference list. - * @see org.eclipse.papyrus.FCM.FCMPackage#getContainerRule_ForConfig() - * @model ordered="false" - * @generated - */ - EList getForConfig(); - - /** - * Returns the value of the 'Kind' attribute. - * The literals are from the enumeration {@link org.eclipse.papyrus.FCM.ContainerRuleKind}. - * - *

- * If the meaning of the 'Kind' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Kind' attribute. - * @see org.eclipse.papyrus.FCM.ContainerRuleKind - * @see #setKind(ContainerRuleKind) - * @see org.eclipse.papyrus.FCM.FCMPackage#getContainerRule_Kind() - * @model required="true" ordered="false" - * @generated - */ - ContainerRuleKind getKind(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.ContainerRule#getKind Kind}' attribute. - * - * - * @param value the new value of the 'Kind' attribute. - * @see org.eclipse.papyrus.FCM.ContainerRuleKind - * @see #getKind() - * @generated - */ - void setKind(ContainerRuleKind value); - -} // ContainerRule diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRuleKind.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRuleKind.java deleted file mode 100644 index 6366f1cc62a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRuleKind.java +++ /dev/null @@ -1,225 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'Container Rule Kind', - * and utility methods for working with them. - * - * @see org.eclipse.papyrus.FCM.FCMPackage#getContainerRuleKind() - * @model - * @generated - */ -public enum ContainerRuleKind implements Enumerator { - /** - * The 'Component Rule' literal object. - * - * - * @see #COMPONENT_RULE_VALUE - * @generated - * @ordered - */ - COMPONENT_RULE(0, "ComponentRule", "ComponentRule"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Light Weight OO Rule' literal object. - * - * - * @see #LIGHT_WEIGHT_OO_RULE_VALUE - * @generated - * @ordered - */ - LIGHT_WEIGHT_OO_RULE(1, "LightWeightOORule", "LightWeightOORule"); //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Component Rule' literal value. - * - *

- * If the meaning of 'Component Rule' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #COMPONENT_RULE - * @model name="ComponentRule" - * @generated - * @ordered - */ - public static final int COMPONENT_RULE_VALUE = 0; - - /** - * The 'Light Weight OO Rule' literal value. - * - *

- * If the meaning of 'Light Weight OO Rule' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #LIGHT_WEIGHT_OO_RULE - * @model name="LightWeightOORule" - * @generated - * @ordered - */ - public static final int LIGHT_WEIGHT_OO_RULE_VALUE = 1; - - /** - * An array of all the 'Container Rule Kind' enumerators. - * - * - * @generated - */ - private static final ContainerRuleKind[] VALUES_ARRAY = - new ContainerRuleKind[] { - COMPONENT_RULE, - LIGHT_WEIGHT_OO_RULE, - }; - - /** - * A public read-only list of all the 'Container Rule Kind' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Container Rule Kind' literal with the specified literal value. - * - * - * @param literal the literal. - * @return the matching enumerator or null. - * @generated - */ - public static ContainerRuleKind get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - ContainerRuleKind result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Container Rule Kind' literal with the specified name. - * - * - * @param name the name. - * @return the matching enumerator or null. - * @generated - */ - public static ContainerRuleKind getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - ContainerRuleKind result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Container Rule Kind' literal with the specified integer value. - * - * - * @param value the integer value. - * @return the matching enumerator or null. - * @generated - */ - public static ContainerRuleKind get(int value) { - switch (value) { - case COMPONENT_RULE_VALUE: return COMPONENT_RULE; - case LIGHT_WEIGHT_OO_RULE_VALUE: return LIGHT_WEIGHT_OO_RULE; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private ContainerRuleKind(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - @Override - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - @Override - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - -} // ContainerRuleKind diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CopyAttributeValue.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CopyAttributeValue.java deleted file mode 100644 index 414ccb88e3d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CopyAttributeValue.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Property; - -/** - * - * A representation of the model object 'Copy Attribute Value'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.CopyAttributeValue#getSource Source}
  • - *
  • {@link org.eclipse.papyrus.FCM.CopyAttributeValue#getBase_Property Base Property}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getCopyAttributeValue() - * @model - * @generated - */ -public interface CopyAttributeValue extends EObject { - /** - * Returns the value of the 'Source' reference. - * - *

- * If the meaning of the 'Source' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Source' reference. - * @see #setSource(Property) - * @see org.eclipse.papyrus.FCM.FCMPackage#getCopyAttributeValue_Source() - * @model required="true" ordered="false" - * @generated - */ - Property getSource(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.CopyAttributeValue#getSource Source}' reference. - * - * - * @param value the new value of the 'Source' reference. - * @see #getSource() - * @generated - */ - void setSource(Property value); - - /** - * Returns the value of the 'Base Property' reference. - * - *

- * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Property' reference. - * @see #setBase_Property(Property) - * @see org.eclipse.papyrus.FCM.FCMPackage#getCopyAttributeValue_Base_Property() - * @model required="true" ordered="false" - * @generated - */ - Property getBase_Property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.CopyAttributeValue#getBase_Property Base Property}' reference. - * - * - * @param value the new value of the 'Base Property' reference. - * @see #getBase_Property() - * @generated - */ - void setBase_Property(Property value); - -} // CopyAttributeValue diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DeploymentPlan.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DeploymentPlan.java deleted file mode 100644 index 7a0d9dc3d44..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DeploymentPlan.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * A representation of the model object 'Deployment Plan'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.DeploymentPlan#getMainInstance Main Instance}
  • - *
  • {@link org.eclipse.papyrus.FCM.DeploymentPlan#getBase_Package Base Package}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getDeploymentPlan() - * @model - * @generated - */ -public interface DeploymentPlan extends EObject { - /** - * Returns the value of the 'Main Instance' reference. - * - *

- * If the meaning of the 'Main Instance' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Main Instance' reference. - * @see #setMainInstance(InstanceSpecification) - * @see org.eclipse.papyrus.FCM.FCMPackage#getDeploymentPlan_MainInstance() - * @model required="true" ordered="false" - * @generated - */ - InstanceSpecification getMainInstance(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.DeploymentPlan#getMainInstance Main Instance}' reference. - * - * - * @param value the new value of the 'Main Instance' reference. - * @see #getMainInstance() - * @generated - */ - void setMainInstance(InstanceSpecification value); - - /** - * Returns the value of the 'Base Package' reference. - * - *

- * If the meaning of the 'Base Package' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Package' reference. - * @see #setBase_Package(org.eclipse.uml2.uml.Package) - * @see org.eclipse.papyrus.FCM.FCMPackage#getDeploymentPlan_Base_Package() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Package getBase_Package(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.DeploymentPlan#getBase_Package Base Package}' reference. - * - * - * @param value the new value of the 'Base Package' reference. - * @see #getBase_Package() - * @generated - */ - void setBase_Package(org.eclipse.uml2.uml.Package value); - -} // DeploymentPlan diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DerivedElement.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DerivedElement.java deleted file mode 100644 index 58ff9aee3ba..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DerivedElement.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Element; - -/** - * - * A representation of the model object 'Derived Element'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.DerivedElement#getBase_Element Base Element}
  • - *
  • {@link org.eclipse.papyrus.FCM.DerivedElement#getSource Source}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getDerivedElement() - * @model - * @generated - */ -public interface DerivedElement extends EObject { - /** - * Returns the value of the 'Base Element' reference. - * - *

- * If the meaning of the 'Base Element' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Element' reference. - * @see #setBase_Element(Element) - * @see org.eclipse.papyrus.FCM.FCMPackage#getDerivedElement_Base_Element() - * @model required="true" ordered="false" - * @generated - */ - Element getBase_Element(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.DerivedElement#getBase_Element Base Element}' reference. - * - * - * @param value the new value of the 'Base Element' reference. - * @see #getBase_Element() - * @generated - */ - void setBase_Element(Element value); - - /** - * Returns the value of the 'Source' reference. - * - *

- * If the meaning of the 'Source' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Source' reference. - * @see #setSource(Element) - * @see org.eclipse.papyrus.FCM.FCMPackage#getDerivedElement_Source() - * @model required="true" ordered="false" - * @generated - */ - Element getSource(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.DerivedElement#getSource Source}' reference. - * - * - * @param value the new value of the 'Source' reference. - * @see #getSource() - * @generated - */ - void setSource(Element value); - -} // DerivedElement diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMFactory.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMFactory.java deleted file mode 100644 index 907c2d5b4e3..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMFactory.java +++ /dev/null @@ -1,376 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EFactory; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @see org.eclipse.papyrus.FCM.FCMPackage - * @generated - */ -public interface FCMFactory extends EFactory { - /** - * The singleton instance of the factory. - * - * - * @generated - */ - FCMFactory eINSTANCE = org.eclipse.papyrus.FCM.impl.FCMFactoryImpl.init(); - - /** - * Returns a new object of class 'Template'. - * - * - * @return a new object of class 'Template'. - * @generated - */ - Template createTemplate(); - - /** - * Returns a new object of class 'Binding Helper'. - * - * - * @return a new object of class 'Binding Helper'. - * @generated - */ - BindingHelper createBindingHelper(); - - /** - * Returns a new object of class 'Configuration Property'. - * - * - * @return a new object of class 'Configuration Property'. - * @generated - */ - ConfigurationProperty createConfigurationProperty(); - - /** - * Returns a new object of class 'Implementation Group'. - * - * - * @return a new object of class 'Implementation Group'. - * @generated - */ - ImplementationGroup createImplementationGroup(); - - /** - * Returns a new object of class 'Assembly'. - * - * - * @return a new object of class 'Assembly'. - * @generated - */ - Assembly createAssembly(); - - /** - * Returns a new object of class 'Flatten'. - * - * - * @return a new object of class 'Flatten'. - * @generated - */ - Flatten createFlatten(); - - /** - * Returns a new object of class 'Comp To OOmapping'. - * - * - * @return a new object of class 'Comp To OOmapping'. - * @generated - */ - CompToOOmapping createCompToOOmapping(); - - /** - * Returns a new object of class 'Prog Language'. - * - * - * @return a new object of class 'Prog Language'. - * @generated - */ - ProgLanguage createProgLanguage(); - - /** - * Returns a new object of class 'Code Gen Options'. - * - * - * @return a new object of class 'Code Gen Options'. - * @generated - */ - CodeGenOptions createCodeGenOptions(); - - /** - * Returns a new object of class 'Interaction Component'. - * - * - * @return a new object of class 'Interaction Component'. - * @generated - */ - InteractionComponent createInteractionComponent(); - - /** - * Returns a new object of class 'Singleton'. - * - * - * @return a new object of class 'Singleton'. - * @generated - */ - Singleton createSingleton(); - - /** - * Returns a new object of class 'Connector'. - * - * - * @return a new object of class 'Connector'. - * @generated - */ - Connector createConnector(); - - /** - * Returns a new object of class 'Use Instance Configurator'. - * - * - * @return a new object of class 'Use Instance Configurator'. - * @generated - */ - UseInstanceConfigurator createUseInstanceConfigurator(); - - /** - * Returns a new object of class 'Instance Configurator'. - * - * - * @return a new object of class 'Instance Configurator'. - * @generated - */ - InstanceConfigurator createInstanceConfigurator(); - - /** - * Returns a new object of class 'Rule Application'. - * - * - * @return a new object of class 'Rule Application'. - * @generated - */ - RuleApplication createRuleApplication(); - - /** - * Returns a new object of class 'Container Rule'. - * - * - * @return a new object of class 'Container Rule'. - * @generated - */ - ContainerRule createContainerRule(); - - /** - * Returns a new object of class 'Config Option'. - * - * - * @return a new object of class 'Config Option'. - * @generated - */ - ConfigOption createConfigOption(); - - /** - * Returns a new object of class 'Template Port'. - * - * - * @return a new object of class 'Template Port'. - * @generated - */ - TemplatePort createTemplatePort(); - - /** - * Returns a new object of class 'Port'. - * - * - * @return a new object of class 'Port'. - * @generated - */ - Port createPort(); - - /** - * Returns a new object of class 'Port Kind'. - * - * - * @return a new object of class 'Port Kind'. - * @generated - */ - PortKind createPortKind(); - - /** - * Returns a new object of class 'Deployment Plan'. - * - * - * @return a new object of class 'Deployment Plan'. - * @generated - */ - DeploymentPlan createDeploymentPlan(); - - /** - * Returns a new object of class 'Derived Element'. - * - * - * @return a new object of class 'Derived Element'. - * @generated - */ - DerivedElement createDerivedElement(); - - /** - * Returns a new object of class 'Comp Impl Template'. - * - * - * @return a new object of class 'Comp Impl Template'. - * @generated - */ - CompImplTemplate createCompImplTemplate(); - - /** - * Returns a new object of class 'Implementation Properties'. - * - * - * @return a new object of class 'Implementation Properties'. - * @generated - */ - ImplementationProperties createImplementationProperties(); - - /** - * Returns a new object of class 'Operating System'. - * - * - * @return a new object of class 'Operating System'. - * @generated - */ - OperatingSystem createOperatingSystem(); - - /** - * Returns a new object of class 'Target Architecture'. - * - * - * @return a new object of class 'Target Architecture'. - * @generated - */ - TargetArchitecture createTargetArchitecture(); - - /** - * Returns a new object of class 'Configuration'. - * - * - * @return a new object of class 'Configuration'. - * @generated - */ - Configuration createConfiguration(); - - /** - * Returns a new object of class 'Interception Rule'. - * - * - * @return a new object of class 'Interception Rule'. - * @generated - */ - InterceptionRule createInterceptionRule(); - - /** - * Returns a new object of class 'Target'. - * - * - * @return a new object of class 'Target'. - * @generated - */ - Target createTarget(); - - /** - * Returns a new object of class 'Compiler Chain'. - * - * - * @return a new object of class 'Compiler Chain'. - * @generated - */ - CompilerChain createCompilerChain(); - - /** - * Returns a new object of class 'Fragment'. - * - * - * @return a new object of class 'Fragment'. - * @generated - */ - Fragment createFragment(); - - /** - * Returns a new object of class 'Copy Attribute Value'. - * - * - * @return a new object of class 'Copy Attribute Value'. - * @generated - */ - CopyAttributeValue createCopyAttributeValue(); - - /** - * Returns a new object of class 'Auto Index'. - * - * - * @return a new object of class 'Auto Index'. - * @generated - */ - AutoIndex createAutoIndex(); - - /** - * Returns a new object of class 'Auto Index Per Node'. - * - * - * @return a new object of class 'Auto Index Per Node'. - * @generated - */ - AutoIndexPerNode createAutoIndexPerNode(); - - /** - * Returns a new object of class 'Init Precedence'. - * - * - * @return a new object of class 'Init Precedence'. - * @generated - */ - InitPrecedence createInitPrecedence(); - - /** - * Returns a new object of class 'Connector Configuration'. - * - * - * @return a new object of class 'Connector Configuration'. - * @generated - */ - ConnectorConfiguration createConnectorConfiguration(); - - /** - * Returns a new object of class 'Bind Template'. - * - * - * @return a new object of class 'Bind Template'. - * @generated - */ - BindTemplate createBindTemplate(); - - /** - * Returns the package supported by this factory. - * - * - * @return the package supported by this factory. - * @generated - */ - FCMPackage getFCMPackage(); - -} // FCMFactory diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMPackage.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMPackage.java deleted file mode 100644 index 1dc5cea5fed..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMPackage.java +++ /dev/null @@ -1,3911 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMFactory - * @model kind="package" - * @generated - */ -public interface FCMPackage extends EPackage { - /** - * The package name. - * - * - * @generated - */ - String eNAME = "FCM"; //$NON-NLS-1$ - - /** - * The package namespace URI. - * - * - * @generated - */ - String eNS_URI = "http://www.eclipse.org/papyrus/FCM/1"; //$NON-NLS-1$ - - /** - * The package namespace name. - * - * - * @generated - */ - String eNS_PREFIX = "FCM"; //$NON-NLS-1$ - - /** - * The singleton instance of the package. - * - * - * @generated - */ - FCMPackage eINSTANCE = org.eclipse.papyrus.FCM.impl.FCMPackageImpl.init(); - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.TemplateImpl Template}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.TemplateImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTemplate() - * @generated - */ - int TEMPLATE = 0; - - /** - * The feature id for the 'Base Element' reference. - * - * - * @generated - * @ordered - */ - int TEMPLATE__BASE_ELEMENT = 0; - - /** - * The feature id for the 'Helper' reference. - * - * - * @generated - * @ordered - */ - int TEMPLATE__HELPER = 1; - - /** - * The number of structural features of the 'Template' class. - * - * - * @generated - * @ordered - */ - int TEMPLATE_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.BindingHelperImpl Binding Helper}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.BindingHelperImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getBindingHelper() - * @generated - */ - int BINDING_HELPER = 1; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int BINDING_HELPER__BASE_CLASS = 0; - - /** - * The number of structural features of the 'Binding Helper' class. - * - * - * @generated - * @ordered - */ - int BINDING_HELPER_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ConfigurationPropertyImpl Configuration Property}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ConfigurationPropertyImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfigurationProperty() - * @generated - */ - int CONFIGURATION_PROPERTY = 2; - - /** - * The feature id for the 'Base Property' reference. - * - * - * @generated - * @ordered - */ - int CONFIGURATION_PROPERTY__BASE_PROPERTY = 0; - - /** - * The number of structural features of the 'Configuration Property' class. - * - * - * @generated - * @ordered - */ - int CONFIGURATION_PROPERTY_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ImplementationGroupImpl Implementation Group}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ImplementationGroupImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getImplementationGroup() - * @generated - */ - int IMPLEMENTATION_GROUP = 3; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int IMPLEMENTATION_GROUP__BASE_CLASS = 0; - - /** - * The number of structural features of the 'Implementation Group' class. - * - * - * @generated - * @ordered - */ - int IMPLEMENTATION_GROUP_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.AssemblyImpl Assembly}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.AssemblyImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getAssembly() - * @generated - */ - int ASSEMBLY = 4; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int ASSEMBLY__BASE_CLASS = 0; - - /** - * The number of structural features of the 'Assembly' class. - * - * - * @generated - * @ordered - */ - int ASSEMBLY_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.FlattenImpl Flatten}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.FlattenImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getFlatten() - * @generated - */ - int FLATTEN = 5; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int FLATTEN__BASE_CLASS = 0; - - /** - * The number of structural features of the 'Flatten' class. - * - * - * @generated - * @ordered - */ - int FLATTEN_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.CompToOOmappingImpl Comp To OOmapping}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.CompToOOmappingImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCompToOOmapping() - * @generated - */ - int COMP_TO_OOMAPPING = 6; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int COMP_TO_OOMAPPING__BASE_CLASS = 0; - - /** - * The number of structural features of the 'Comp To OOmapping' class. - * - * - * @generated - * @ordered - */ - int COMP_TO_OOMAPPING_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ProgLanguageImpl Prog Language}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ProgLanguageImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getProgLanguage() - * @generated - */ - int PROG_LANGUAGE = 7; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int PROG_LANGUAGE__BASE_CLASS = 0; - - /** - * The number of structural features of the 'Prog Language' class. - * - * - * @generated - * @ordered - */ - int PROG_LANGUAGE_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl Code Gen Options}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCodeGenOptions() - * @generated - */ - int CODE_GEN_OPTIONS = 8; - - /** - * The feature id for the 'Base Package' reference. - * - * - * @generated - * @ordered - */ - int CODE_GEN_OPTIONS__BASE_PACKAGE = 0; - - /** - * The feature id for the 'Comp To OOmapping' reference. - * - * - * @generated - * @ordered - */ - int CODE_GEN_OPTIONS__COMP_TO_OOMAPPING = 1; - - /** - * The feature id for the 'Prog Language' reference. - * - * - * @generated - * @ordered - */ - int CODE_GEN_OPTIONS__PROG_LANGUAGE = 2; - - /** - * The number of structural features of the 'Code Gen Options' class. - * - * - * @generated - * @ordered - */ - int CODE_GEN_OPTIONS_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.InteractionComponentImpl Interaction Component}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.InteractionComponentImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInteractionComponent() - * @generated - */ - int INTERACTION_COMPONENT = 9; - - /** - * The feature id for the 'For Distribution' attribute. - * - * - * @generated - * @ordered - */ - int INTERACTION_COMPONENT__FOR_DISTRIBUTION = 0; - - /** - * The feature id for the 'Connection Pattern' reference. - * - * - * @generated - * @ordered - */ - int INTERACTION_COMPONENT__CONNECTION_PATTERN = 1; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int INTERACTION_COMPONENT__BASE_CLASS = 2; - - /** - * The number of structural features of the 'Interaction Component' class. - * - * - * @generated - * @ordered - */ - int INTERACTION_COMPONENT_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.SingletonImpl Singleton}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.SingletonImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getSingleton() - * @generated - */ - int SINGLETON = 10; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int SINGLETON__BASE_CLASS = 0; - - /** - * The number of structural features of the 'Singleton' class. - * - * - * @generated - * @ordered - */ - int SINGLETON_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ConfigurableElementInstanceImpl Configurable Element Instance}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ConfigurableElementInstanceImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfigurableElementInstance() - * @generated - */ - int CONFIGURABLE_ELEMENT_INSTANCE = 12; - - /** - * The feature id for the 'Configuration' reference. - * - * - * @generated - * @ordered - */ - int CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION = 0; - - /** - * The number of structural features of the 'Configurable Element Instance' class. - * - * - * @generated - * @ordered - */ - int CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ConnectorImpl Connector}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ConnectorImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConnector() - * @generated - */ - int CONNECTOR = 11; - - /** - * The feature id for the 'Configuration' reference. - * - * - * @generated - * @ordered - */ - int CONNECTOR__CONFIGURATION = CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION; - - /** - * The feature id for the 'Base Connector' reference. - * - * - * @generated - * @ordered - */ - int CONNECTOR__BASE_CONNECTOR = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Ic' reference. - * - * - * @generated - * @ordered - */ - int CONNECTOR__IC = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Base Property' reference. - * - * - * @generated - * @ordered - */ - int CONNECTOR__BASE_PROPERTY = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Connector' class. - * - * - * @generated - * @ordered - */ - int CONNECTOR_FEATURE_COUNT = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.UseInstanceConfiguratorImpl Use Instance Configurator}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.UseInstanceConfiguratorImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getUseInstanceConfigurator() - * @generated - */ - int USE_INSTANCE_CONFIGURATOR = 13; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int USE_INSTANCE_CONFIGURATOR__BASE_CLASS = 0; - - /** - * The feature id for the 'Configurator' reference. - * - * - * @generated - * @ordered - */ - int USE_INSTANCE_CONFIGURATOR__CONFIGURATOR = 1; - - /** - * The number of structural features of the 'Use Instance Configurator' class. - * - * - * @generated - * @ordered - */ - int USE_INSTANCE_CONFIGURATOR_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.InstanceConfiguratorImpl Instance Configurator}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.InstanceConfiguratorImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInstanceConfigurator() - * @generated - */ - int INSTANCE_CONFIGURATOR = 14; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int INSTANCE_CONFIGURATOR__BASE_CLASS = 0; - - /** - * The feature id for the 'On Node Model' attribute. - * - * - * @generated - * @ordered - */ - int INSTANCE_CONFIGURATOR__ON_NODE_MODEL = 1; - - /** - * The number of structural features of the 'Instance Configurator' class. - * - * - * @generated - * @ordered - */ - int INSTANCE_CONFIGURATOR_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.RuleApplicationImpl Rule Application}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.RuleApplicationImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getRuleApplication() - * @generated - */ - int RULE_APPLICATION = 15; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int RULE_APPLICATION__BASE_CLASS = 0; - - /** - * The feature id for the 'Container Rule' reference list. - * - * - * @generated - * @ordered - */ - int RULE_APPLICATION__CONTAINER_RULE = 1; - - /** - * The feature id for the 'Base Package' reference. - * - * - * @generated - * @ordered - */ - int RULE_APPLICATION__BASE_PACKAGE = 2; - - /** - * The number of structural features of the 'Rule Application' class. - * - * - * @generated - * @ordered - */ - int RULE_APPLICATION_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ContainerRuleImpl Container Rule}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ContainerRuleImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getContainerRule() - * @generated - */ - int CONTAINER_RULE = 16; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int CONTAINER_RULE__BASE_CLASS = 0; - - /** - * The feature id for the 'For Config' reference list. - * - * - * @generated - * @ordered - */ - int CONTAINER_RULE__FOR_CONFIG = 1; - - /** - * The feature id for the 'Kind' attribute. - * - * - * @generated - * @ordered - */ - int CONTAINER_RULE__KIND = 2; - - /** - * The number of structural features of the 'Container Rule' class. - * - * - * @generated - * @ordered - */ - int CONTAINER_RULE_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ConfigOptionImpl Config Option}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ConfigOptionImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfigOption() - * @generated - */ - int CONFIG_OPTION = 17; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int CONFIG_OPTION__BASE_CLASS = 0; - - /** - * The number of structural features of the 'Config Option' class. - * - * - * @generated - * @ordered - */ - int CONFIG_OPTION_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.PortImpl Port}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.PortImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getPort() - * @generated - */ - int PORT = 19; - - /** - * The feature id for the 'Configuration' reference. - * - * - * @generated - * @ordered - */ - int PORT__CONFIGURATION = CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION; - - /** - * The feature id for the 'Base Port' reference. - * - * - * @generated - * @ordered - */ - int PORT__BASE_PORT = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Kind' reference. - * - * - * @generated - * @ordered - */ - int PORT__KIND = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Type' reference. - * - * - * @generated - * @ordered - */ - int PORT__TYPE = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Port' class. - * - * - * @generated - * @ordered - */ - int PORT_FEATURE_COUNT = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.TemplatePortImpl Template Port}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.TemplatePortImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTemplatePort() - * @generated - */ - int TEMPLATE_PORT = 18; - - /** - * The feature id for the 'Configuration' reference. - * - * - * @generated - * @ordered - */ - int TEMPLATE_PORT__CONFIGURATION = PORT__CONFIGURATION; - - /** - * The feature id for the 'Base Port' reference. - * - * - * @generated - * @ordered - */ - int TEMPLATE_PORT__BASE_PORT = PORT__BASE_PORT; - - /** - * The feature id for the 'Kind' reference. - * - * - * @generated - * @ordered - */ - int TEMPLATE_PORT__KIND = PORT__KIND; - - /** - * The feature id for the 'Type' reference. - * - * - * @generated - * @ordered - */ - int TEMPLATE_PORT__TYPE = PORT__TYPE; - - /** - * The feature id for the 'Bound Type' reference. - * - * - * @generated - * @ordered - */ - int TEMPLATE_PORT__BOUND_TYPE = PORT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Template Port' class. - * - * - * @generated - * @ordered - */ - int TEMPLATE_PORT_FEATURE_COUNT = PORT_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.PortKindImpl Port Kind}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.PortKindImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getPortKind() - * @generated - */ - int PORT_KIND = 20; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int PORT_KIND__BASE_CLASS = 0; - - /** - * The feature id for the 'Provided Interface' reference. - * - * - * @generated - * @ordered - */ - int PORT_KIND__PROVIDED_INTERFACE = 1; - - /** - * The feature id for the 'Required Interface' reference. - * - * - * @generated - * @ordered - */ - int PORT_KIND__REQUIRED_INTERFACE = 2; - - /** - * The feature id for the 'Extended Port' attribute. - * - * - * @generated - * @ordered - */ - int PORT_KIND__EXTENDED_PORT = 3; - - /** - * The number of structural features of the 'Port Kind' class. - * - * - * @generated - * @ordered - */ - int PORT_KIND_FEATURE_COUNT = 4; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.DeploymentPlanImpl Deployment Plan}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.DeploymentPlanImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getDeploymentPlan() - * @generated - */ - int DEPLOYMENT_PLAN = 21; - - /** - * The feature id for the 'Main Instance' reference. - * - * - * @generated - * @ordered - */ - int DEPLOYMENT_PLAN__MAIN_INSTANCE = 0; - - /** - * The feature id for the 'Base Package' reference. - * - * - * @generated - * @ordered - */ - int DEPLOYMENT_PLAN__BASE_PACKAGE = 1; - - /** - * The number of structural features of the 'Deployment Plan' class. - * - * - * @generated - * @ordered - */ - int DEPLOYMENT_PLAN_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.DerivedElementImpl Derived Element}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.DerivedElementImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getDerivedElement() - * @generated - */ - int DERIVED_ELEMENT = 22; - - /** - * The feature id for the 'Base Element' reference. - * - * - * @generated - * @ordered - */ - int DERIVED_ELEMENT__BASE_ELEMENT = 0; - - /** - * The feature id for the 'Source' reference. - * - * - * @generated - * @ordered - */ - int DERIVED_ELEMENT__SOURCE = 1; - - /** - * The number of structural features of the 'Derived Element' class. - * - * - * @generated - * @ordered - */ - int DERIVED_ELEMENT_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.CompImplTemplateImpl Comp Impl Template}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.CompImplTemplateImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCompImplTemplate() - * @generated - */ - int COMP_IMPL_TEMPLATE = 23; - - /** - * The feature id for the 'Template Defs' attribute. - * - * - * @generated - * @ordered - */ - int COMP_IMPL_TEMPLATE__TEMPLATE_DEFS = 0; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int COMP_IMPL_TEMPLATE__BASE_CLASS = 1; - - /** - * The number of structural features of the 'Comp Impl Template' class. - * - * - * @generated - * @ordered - */ - int COMP_IMPL_TEMPLATE_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl Implementation Properties}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getImplementationProperties() - * @generated - */ - int IMPLEMENTATION_PROPERTIES = 24; - - /** - * The feature id for the 'Size RAM' attribute. - * - * - * @generated - * @ordered - */ - int IMPLEMENTATION_PROPERTIES__SIZE_RAM = 0; - - /** - * The feature id for the 'Supported OS' reference list. - * - * - * @generated - * @ordered - */ - int IMPLEMENTATION_PROPERTIES__SUPPORTED_OS = 1; - - /** - * The feature id for the 'Arch' reference list. - * - * - * @generated - * @ordered - */ - int IMPLEMENTATION_PROPERTIES__ARCH = 2; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int IMPLEMENTATION_PROPERTIES__BASE_CLASS = 3; - - /** - * The feature id for the 'Size ROM' attribute. - * - * - * @generated - * @ordered - */ - int IMPLEMENTATION_PROPERTIES__SIZE_ROM = 4; - - /** - * The feature id for the 'Supported Target Arch' reference. - * - * - * @generated - * @ordered - */ - int IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH = 5; - - /** - * The number of structural features of the 'Implementation Properties' class. - * - * - * @generated - * @ordered - */ - int IMPLEMENTATION_PROPERTIES_FEATURE_COUNT = 6; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.OperatingSystemImpl Operating System}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.OperatingSystemImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getOperatingSystem() - * @generated - */ - int OPERATING_SYSTEM = 25; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int OPERATING_SYSTEM__BASE_CLASS = 0; - - /** - * The number of structural features of the 'Operating System' class. - * - * - * @generated - * @ordered - */ - int OPERATING_SYSTEM_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.TargetArchitectureImpl Target Architecture}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.TargetArchitectureImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTargetArchitecture() - * @generated - */ - int TARGET_ARCHITECTURE = 26; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int TARGET_ARCHITECTURE__BASE_CLASS = 0; - - /** - * The number of structural features of the 'Target Architecture' class. - * - * - * @generated - * @ordered - */ - int TARGET_ARCHITECTURE_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ConfigurationImpl Configuration}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ConfigurationImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfiguration() - * @generated - */ - int CONFIGURATION = 27; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int CONFIGURATION__BASE_CLASS = 0; - - /** - * The feature id for the 'Config Options' reference list. - * - * - * @generated - * @ordered - */ - int CONFIGURATION__CONFIG_OPTIONS = 1; - - /** - * The feature id for the 'Deployment Plan' reference. - * - * - * @generated - * @ordered - */ - int CONFIGURATION__DEPLOYMENT_PLAN = 2; - - /** - * The number of structural features of the 'Configuration' class. - * - * - * @generated - * @ordered - */ - int CONFIGURATION_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl Interception Rule}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInterceptionRule() - * @generated - */ - int INTERCEPTION_RULE = 28; - - /** - * The feature id for the 'Interception Kind' attribute. - * - * - * @generated - * @ordered - */ - int INTERCEPTION_RULE__INTERCEPTION_KIND = 0; - - /** - * The feature id for the 'Interception Set' reference list. - * - * - * @generated - * @ordered - */ - int INTERCEPTION_RULE__INTERCEPTION_SET = 1; - - /** - * The feature id for the 'Base Property' reference. - * - * - * @generated - * @ordered - */ - int INTERCEPTION_RULE__BASE_PROPERTY = 2; - - /** - * The feature id for the 'Base Operation' reference. - * - * - * @generated - * @ordered - */ - int INTERCEPTION_RULE__BASE_OPERATION = 3; - - /** - * The number of structural features of the 'Interception Rule' class. - * - * - * @generated - * @ordered - */ - int INTERCEPTION_RULE_FEATURE_COUNT = 4; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.TargetImpl Target}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.TargetImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTarget() - * @generated - */ - int TARGET = 29; - - /** - * The feature id for the 'Target Arch' reference. - * - * - * @generated - * @ordered - */ - int TARGET__TARGET_ARCH = 0; - - /** - * The feature id for the 'Options' reference list. - * - * - * @generated - * @ordered - */ - int TARGET__OPTIONS = 1; - - /** - * The feature id for the 'Base Node' reference. - * - * - * @generated - * @ordered - */ - int TARGET__BASE_NODE = 2; - - /** - * The feature id for the 'Used OS' reference. - * - * - * @generated - * @ordered - */ - int TARGET__USED_OS = 3; - - /** - * The feature id for the 'Avail RAM' attribute. - * - * - * @generated - * @ordered - */ - int TARGET__AVAIL_RAM = 4; - - /** - * The feature id for the 'Avail ROM' attribute. - * - * - * @generated - * @ordered - */ - int TARGET__AVAIL_ROM = 5; - - /** - * The feature id for the 'Compiler' reference. - * - * - * @generated - * @ordered - */ - int TARGET__COMPILER = 6; - - /** - * The number of structural features of the 'Target' class. - * - * - * @generated - * @ordered - */ - int TARGET_FEATURE_COUNT = 7; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.CompilerChainImpl Compiler Chain}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.CompilerChainImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCompilerChain() - * @generated - */ - int COMPILER_CHAIN = 30; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int COMPILER_CHAIN__BASE_CLASS = 0; - - /** - * The number of structural features of the 'Compiler Chain' class. - * - * - * @generated - * @ordered - */ - int COMPILER_CHAIN_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.FragmentImpl Fragment}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.FragmentImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getFragment() - * @generated - */ - int FRAGMENT = 31; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int FRAGMENT__BASE_CLASS = 0; - - /** - * The number of structural features of the 'Fragment' class. - * - * - * @generated - * @ordered - */ - int FRAGMENT_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.CopyAttributeValueImpl Copy Attribute Value}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.CopyAttributeValueImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCopyAttributeValue() - * @generated - */ - int COPY_ATTRIBUTE_VALUE = 32; - - /** - * The feature id for the 'Source' reference. - * - * - * @generated - * @ordered - */ - int COPY_ATTRIBUTE_VALUE__SOURCE = 0; - - /** - * The feature id for the 'Base Property' reference. - * - * - * @generated - * @ordered - */ - int COPY_ATTRIBUTE_VALUE__BASE_PROPERTY = 1; - - /** - * The number of structural features of the 'Copy Attribute Value' class. - * - * - * @generated - * @ordered - */ - int COPY_ATTRIBUTE_VALUE_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.AutoIndexImpl Auto Index}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.AutoIndexImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getAutoIndex() - * @generated - */ - int AUTO_INDEX = 33; - - /** - * The feature id for the 'Base Property' reference. - * - * - * @generated - * @ordered - */ - int AUTO_INDEX__BASE_PROPERTY = 0; - - /** - * The number of structural features of the 'Auto Index' class. - * - * - * @generated - * @ordered - */ - int AUTO_INDEX_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.AutoIndexPerNodeImpl Auto Index Per Node}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.AutoIndexPerNodeImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getAutoIndexPerNode() - * @generated - */ - int AUTO_INDEX_PER_NODE = 34; - - /** - * The feature id for the 'Base Property' reference. - * - * - * @generated - * @ordered - */ - int AUTO_INDEX_PER_NODE__BASE_PROPERTY = AUTO_INDEX__BASE_PROPERTY; - - /** - * The number of structural features of the 'Auto Index Per Node' class. - * - * - * @generated - * @ordered - */ - int AUTO_INDEX_PER_NODE_FEATURE_COUNT = AUTO_INDEX_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl Init Precedence}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInitPrecedence() - * @generated - */ - int INIT_PRECEDENCE = 35; - - /** - * The feature id for the 'Invoke After' reference list. - * - * - * @generated - * @ordered - */ - int INIT_PRECEDENCE__INVOKE_AFTER = 0; - - /** - * The feature id for the 'Invoke Before' reference list. - * - * - * @generated - * @ordered - */ - int INIT_PRECEDENCE__INVOKE_BEFORE = 1; - - /** - * The feature id for the 'Base Class' reference. - * - * - * @generated - * @ordered - */ - int INIT_PRECEDENCE__BASE_CLASS = 2; - - /** - * The number of structural features of the 'Init Precedence' class. - * - * - * @generated - * @ordered - */ - int INIT_PRECEDENCE_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ConnectorConfigurationImpl Connector Configuration}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ConnectorConfigurationImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConnectorConfiguration() - * @generated - */ - int CONNECTOR_CONFIGURATION = 36; - - /** - * The feature id for the 'Base Slot' reference. - * - * - * @generated - * @ordered - */ - int CONNECTOR_CONFIGURATION__BASE_SLOT = 0; - - /** - * The feature id for the 'Connector' reference. - * - * - * @generated - * @ordered - */ - int CONNECTOR_CONFIGURATION__CONNECTOR = 1; - - /** - * The number of structural features of the 'Connector Configuration' class. - * - * - * @generated - * @ordered - */ - int CONNECTOR_CONFIGURATION_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.BindTemplateImpl Bind Template}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.BindTemplateImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getBindTemplate() - * @generated - */ - int BIND_TEMPLATE = 37; - - /** - * The feature id for the 'Actual' reference list. - * - * - * @generated - * @ordered - */ - int BIND_TEMPLATE__ACTUAL = 0; - - /** - * The feature id for the 'Base Property' reference. - * - * - * @generated - * @ordered - */ - int BIND_TEMPLATE__BASE_PROPERTY = 1; - - /** - * The number of structural features of the 'Bind Template' class. - * - * - * @generated - * @ordered - */ - int BIND_TEMPLATE_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.ContainerRuleKind Container Rule Kind}' enum. - * - * - * @see org.eclipse.papyrus.FCM.ContainerRuleKind - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getContainerRuleKind() - * @generated - */ - int CONTAINER_RULE_KIND = 38; - - /** - * The meta object id for the '{@link org.eclipse.papyrus.FCM.InterceptionKind Interception Kind}' enum. - * - * - * @see org.eclipse.papyrus.FCM.InterceptionKind - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInterceptionKind() - * @generated - */ - int INTERCEPTION_KIND = 39; - - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Template Template}'. - * - * - * @return the meta object for class 'Template'. - * @see org.eclipse.papyrus.FCM.Template - * @generated - */ - EClass getTemplate(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Template#getBase_Element Base Element}'. - * - * - * @return the meta object for the reference 'Base Element'. - * @see org.eclipse.papyrus.FCM.Template#getBase_Element() - * @see #getTemplate() - * @generated - */ - EReference getTemplate_Base_Element(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Template#getHelper Helper}'. - * - * - * @return the meta object for the reference 'Helper'. - * @see org.eclipse.papyrus.FCM.Template#getHelper() - * @see #getTemplate() - * @generated - */ - EReference getTemplate_Helper(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.BindingHelper Binding Helper}'. - * - * - * @return the meta object for class 'Binding Helper'. - * @see org.eclipse.papyrus.FCM.BindingHelper - * @generated - */ - EClass getBindingHelper(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.BindingHelper#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.BindingHelper#getBase_Class() - * @see #getBindingHelper() - * @generated - */ - EReference getBindingHelper_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ConfigurationProperty Configuration Property}'. - * - * - * @return the meta object for class 'Configuration Property'. - * @see org.eclipse.papyrus.FCM.ConfigurationProperty - * @generated - */ - EClass getConfigurationProperty(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ConfigurationProperty#getBase_Property Base Property}'. - * - * - * @return the meta object for the reference 'Base Property'. - * @see org.eclipse.papyrus.FCM.ConfigurationProperty#getBase_Property() - * @see #getConfigurationProperty() - * @generated - */ - EReference getConfigurationProperty_Base_Property(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ImplementationGroup Implementation Group}'. - * - * - * @return the meta object for class 'Implementation Group'. - * @see org.eclipse.papyrus.FCM.ImplementationGroup - * @generated - */ - EClass getImplementationGroup(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ImplementationGroup#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.ImplementationGroup#getBase_Class() - * @see #getImplementationGroup() - * @generated - */ - EReference getImplementationGroup_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Assembly Assembly}'. - * - * - * @return the meta object for class 'Assembly'. - * @see org.eclipse.papyrus.FCM.Assembly - * @generated - */ - EClass getAssembly(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Assembly#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.Assembly#getBase_Class() - * @see #getAssembly() - * @generated - */ - EReference getAssembly_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Flatten Flatten}'. - * - * - * @return the meta object for class 'Flatten'. - * @see org.eclipse.papyrus.FCM.Flatten - * @generated - */ - EClass getFlatten(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Flatten#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.Flatten#getBase_Class() - * @see #getFlatten() - * @generated - */ - EReference getFlatten_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.CompToOOmapping Comp To OOmapping}'. - * - * - * @return the meta object for class 'Comp To OOmapping'. - * @see org.eclipse.papyrus.FCM.CompToOOmapping - * @generated - */ - EClass getCompToOOmapping(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CompToOOmapping#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.CompToOOmapping#getBase_Class() - * @see #getCompToOOmapping() - * @generated - */ - EReference getCompToOOmapping_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ProgLanguage Prog Language}'. - * - * - * @return the meta object for class 'Prog Language'. - * @see org.eclipse.papyrus.FCM.ProgLanguage - * @generated - */ - EClass getProgLanguage(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ProgLanguage#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.ProgLanguage#getBase_Class() - * @see #getProgLanguage() - * @generated - */ - EReference getProgLanguage_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.CodeGenOptions Code Gen Options}'. - * - * - * @return the meta object for class 'Code Gen Options'. - * @see org.eclipse.papyrus.FCM.CodeGenOptions - * @generated - */ - EClass getCodeGenOptions(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CodeGenOptions#getBase_Package Base Package}'. - * - * - * @return the meta object for the reference 'Base Package'. - * @see org.eclipse.papyrus.FCM.CodeGenOptions#getBase_Package() - * @see #getCodeGenOptions() - * @generated - */ - EReference getCodeGenOptions_Base_Package(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CodeGenOptions#getCompToOOmapping Comp To OOmapping}'. - * - * - * @return the meta object for the reference 'Comp To OOmapping'. - * @see org.eclipse.papyrus.FCM.CodeGenOptions#getCompToOOmapping() - * @see #getCodeGenOptions() - * @generated - */ - EReference getCodeGenOptions_CompToOOmapping(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CodeGenOptions#getProgLanguage Prog Language}'. - * - * - * @return the meta object for the reference 'Prog Language'. - * @see org.eclipse.papyrus.FCM.CodeGenOptions#getProgLanguage() - * @see #getCodeGenOptions() - * @generated - */ - EReference getCodeGenOptions_ProgLanguage(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.InteractionComponent Interaction Component}'. - * - * - * @return the meta object for class 'Interaction Component'. - * @see org.eclipse.papyrus.FCM.InteractionComponent - * @generated - */ - EClass getInteractionComponent(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.InteractionComponent#isForDistribution For Distribution}'. - * - * - * @return the meta object for the attribute 'For Distribution'. - * @see org.eclipse.papyrus.FCM.InteractionComponent#isForDistribution() - * @see #getInteractionComponent() - * @generated - */ - EAttribute getInteractionComponent_ForDistribution(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.InteractionComponent#getConnectionPattern Connection Pattern}'. - * - * - * @return the meta object for the reference 'Connection Pattern'. - * @see org.eclipse.papyrus.FCM.InteractionComponent#getConnectionPattern() - * @see #getInteractionComponent() - * @generated - */ - EReference getInteractionComponent_ConnectionPattern(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.InteractionComponent#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.InteractionComponent#getBase_Class() - * @see #getInteractionComponent() - * @generated - */ - EReference getInteractionComponent_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Singleton Singleton}'. - * - * - * @return the meta object for class 'Singleton'. - * @see org.eclipse.papyrus.FCM.Singleton - * @generated - */ - EClass getSingleton(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Singleton#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.Singleton#getBase_Class() - * @see #getSingleton() - * @generated - */ - EReference getSingleton_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Connector Connector}'. - * - * - * @return the meta object for class 'Connector'. - * @see org.eclipse.papyrus.FCM.Connector - * @generated - */ - EClass getConnector(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Connector#getBase_Connector Base Connector}'. - * - * - * @return the meta object for the reference 'Base Connector'. - * @see org.eclipse.papyrus.FCM.Connector#getBase_Connector() - * @see #getConnector() - * @generated - */ - EReference getConnector_Base_Connector(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Connector#getIc Ic}'. - * - * - * @return the meta object for the reference 'Ic'. - * @see org.eclipse.papyrus.FCM.Connector#getIc() - * @see #getConnector() - * @generated - */ - EReference getConnector_Ic(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Connector#getBase_Property Base Property}'. - * - * - * @return the meta object for the reference 'Base Property'. - * @see org.eclipse.papyrus.FCM.Connector#getBase_Property() - * @see #getConnector() - * @generated - */ - EReference getConnector_Base_Property(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ConfigurableElementInstance Configurable Element Instance}'. - * - * - * @return the meta object for class 'Configurable Element Instance'. - * @see org.eclipse.papyrus.FCM.ConfigurableElementInstance - * @generated - */ - EClass getConfigurableElementInstance(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ConfigurableElementInstance#getConfiguration Configuration}'. - * - * - * @return the meta object for the reference 'Configuration'. - * @see org.eclipse.papyrus.FCM.ConfigurableElementInstance#getConfiguration() - * @see #getConfigurableElementInstance() - * @generated - */ - EReference getConfigurableElementInstance_Configuration(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.UseInstanceConfigurator Use Instance Configurator}'. - * - * - * @return the meta object for class 'Use Instance Configurator'. - * @see org.eclipse.papyrus.FCM.UseInstanceConfigurator - * @generated - */ - EClass getUseInstanceConfigurator(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.UseInstanceConfigurator#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.UseInstanceConfigurator#getBase_Class() - * @see #getUseInstanceConfigurator() - * @generated - */ - EReference getUseInstanceConfigurator_Base_Class(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.UseInstanceConfigurator#getConfigurator Configurator}'. - * - * - * @return the meta object for the reference 'Configurator'. - * @see org.eclipse.papyrus.FCM.UseInstanceConfigurator#getConfigurator() - * @see #getUseInstanceConfigurator() - * @generated - */ - EReference getUseInstanceConfigurator_Configurator(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.InstanceConfigurator Instance Configurator}'. - * - * - * @return the meta object for class 'Instance Configurator'. - * @see org.eclipse.papyrus.FCM.InstanceConfigurator - * @generated - */ - EClass getInstanceConfigurator(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.InstanceConfigurator#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.InstanceConfigurator#getBase_Class() - * @see #getInstanceConfigurator() - * @generated - */ - EReference getInstanceConfigurator_Base_Class(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.InstanceConfigurator#isOnNodeModel On Node Model}'. - * - * - * @return the meta object for the attribute 'On Node Model'. - * @see org.eclipse.papyrus.FCM.InstanceConfigurator#isOnNodeModel() - * @see #getInstanceConfigurator() - * @generated - */ - EAttribute getInstanceConfigurator_OnNodeModel(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.RuleApplication Rule Application}'. - * - * - * @return the meta object for class 'Rule Application'. - * @see org.eclipse.papyrus.FCM.RuleApplication - * @generated - */ - EClass getRuleApplication(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.RuleApplication#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.RuleApplication#getBase_Class() - * @see #getRuleApplication() - * @generated - */ - EReference getRuleApplication_Base_Class(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.RuleApplication#getContainerRule Container Rule}'. - * - * - * @return the meta object for the reference list 'Container Rule'. - * @see org.eclipse.papyrus.FCM.RuleApplication#getContainerRule() - * @see #getRuleApplication() - * @generated - */ - EReference getRuleApplication_ContainerRule(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.RuleApplication#getBase_Package Base Package}'. - * - * - * @return the meta object for the reference 'Base Package'. - * @see org.eclipse.papyrus.FCM.RuleApplication#getBase_Package() - * @see #getRuleApplication() - * @generated - */ - EReference getRuleApplication_Base_Package(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ContainerRule Container Rule}'. - * - * - * @return the meta object for class 'Container Rule'. - * @see org.eclipse.papyrus.FCM.ContainerRule - * @generated - */ - EClass getContainerRule(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ContainerRule#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.ContainerRule#getBase_Class() - * @see #getContainerRule() - * @generated - */ - EReference getContainerRule_Base_Class(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.ContainerRule#getForConfig For Config}'. - * - * - * @return the meta object for the reference list 'For Config'. - * @see org.eclipse.papyrus.FCM.ContainerRule#getForConfig() - * @see #getContainerRule() - * @generated - */ - EReference getContainerRule_ForConfig(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.ContainerRule#getKind Kind}'. - * - * - * @return the meta object for the attribute 'Kind'. - * @see org.eclipse.papyrus.FCM.ContainerRule#getKind() - * @see #getContainerRule() - * @generated - */ - EAttribute getContainerRule_Kind(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ConfigOption Config Option}'. - * - * - * @return the meta object for class 'Config Option'. - * @see org.eclipse.papyrus.FCM.ConfigOption - * @generated - */ - EClass getConfigOption(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ConfigOption#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.ConfigOption#getBase_Class() - * @see #getConfigOption() - * @generated - */ - EReference getConfigOption_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.TemplatePort Template Port}'. - * - * - * @return the meta object for class 'Template Port'. - * @see org.eclipse.papyrus.FCM.TemplatePort - * @generated - */ - EClass getTemplatePort(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.TemplatePort#getBoundType Bound Type}'. - * - * - * @return the meta object for the reference 'Bound Type'. - * @see org.eclipse.papyrus.FCM.TemplatePort#getBoundType() - * @see #getTemplatePort() - * @generated - */ - EReference getTemplatePort_BoundType(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Port Port}'. - * - * - * @return the meta object for class 'Port'. - * @see org.eclipse.papyrus.FCM.Port - * @generated - */ - EClass getPort(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Port#getBase_Port Base Port}'. - * - * - * @return the meta object for the reference 'Base Port'. - * @see org.eclipse.papyrus.FCM.Port#getBase_Port() - * @see #getPort() - * @generated - */ - EReference getPort_Base_Port(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Port#getKind Kind}'. - * - * - * @return the meta object for the reference 'Kind'. - * @see org.eclipse.papyrus.FCM.Port#getKind() - * @see #getPort() - * @generated - */ - EReference getPort_Kind(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Port#getType Type}'. - * - * - * @return the meta object for the reference 'Type'. - * @see org.eclipse.papyrus.FCM.Port#getType() - * @see #getPort() - * @generated - */ - EReference getPort_Type(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.PortKind Port Kind}'. - * - * - * @return the meta object for class 'Port Kind'. - * @see org.eclipse.papyrus.FCM.PortKind - * @generated - */ - EClass getPortKind(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.PortKind#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.PortKind#getBase_Class() - * @see #getPortKind() - * @generated - */ - EReference getPortKind_Base_Class(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.PortKind#getProvidedInterface Provided Interface}'. - * - * - * @return the meta object for the reference 'Provided Interface'. - * @see org.eclipse.papyrus.FCM.PortKind#getProvidedInterface() - * @see #getPortKind() - * @generated - */ - EReference getPortKind_ProvidedInterface(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.PortKind#getRequiredInterface Required Interface}'. - * - * - * @return the meta object for the reference 'Required Interface'. - * @see org.eclipse.papyrus.FCM.PortKind#getRequiredInterface() - * @see #getPortKind() - * @generated - */ - EReference getPortKind_RequiredInterface(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.PortKind#isExtendedPort Extended Port}'. - * - * - * @return the meta object for the attribute 'Extended Port'. - * @see org.eclipse.papyrus.FCM.PortKind#isExtendedPort() - * @see #getPortKind() - * @generated - */ - EAttribute getPortKind_ExtendedPort(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.DeploymentPlan Deployment Plan}'. - * - * - * @return the meta object for class 'Deployment Plan'. - * @see org.eclipse.papyrus.FCM.DeploymentPlan - * @generated - */ - EClass getDeploymentPlan(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.DeploymentPlan#getMainInstance Main Instance}'. - * - * - * @return the meta object for the reference 'Main Instance'. - * @see org.eclipse.papyrus.FCM.DeploymentPlan#getMainInstance() - * @see #getDeploymentPlan() - * @generated - */ - EReference getDeploymentPlan_MainInstance(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.DeploymentPlan#getBase_Package Base Package}'. - * - * - * @return the meta object for the reference 'Base Package'. - * @see org.eclipse.papyrus.FCM.DeploymentPlan#getBase_Package() - * @see #getDeploymentPlan() - * @generated - */ - EReference getDeploymentPlan_Base_Package(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.DerivedElement Derived Element}'. - * - * - * @return the meta object for class 'Derived Element'. - * @see org.eclipse.papyrus.FCM.DerivedElement - * @generated - */ - EClass getDerivedElement(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.DerivedElement#getBase_Element Base Element}'. - * - * - * @return the meta object for the reference 'Base Element'. - * @see org.eclipse.papyrus.FCM.DerivedElement#getBase_Element() - * @see #getDerivedElement() - * @generated - */ - EReference getDerivedElement_Base_Element(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.DerivedElement#getSource Source}'. - * - * - * @return the meta object for the reference 'Source'. - * @see org.eclipse.papyrus.FCM.DerivedElement#getSource() - * @see #getDerivedElement() - * @generated - */ - EReference getDerivedElement_Source(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.CompImplTemplate Comp Impl Template}'. - * - * - * @return the meta object for class 'Comp Impl Template'. - * @see org.eclipse.papyrus.FCM.CompImplTemplate - * @generated - */ - EClass getCompImplTemplate(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.CompImplTemplate#getTemplateDefs Template Defs}'. - * - * - * @return the meta object for the attribute 'Template Defs'. - * @see org.eclipse.papyrus.FCM.CompImplTemplate#getTemplateDefs() - * @see #getCompImplTemplate() - * @generated - */ - EAttribute getCompImplTemplate_TemplateDefs(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CompImplTemplate#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.CompImplTemplate#getBase_Class() - * @see #getCompImplTemplate() - * @generated - */ - EReference getCompImplTemplate_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ImplementationProperties Implementation Properties}'. - * - * - * @return the meta object for class 'Implementation Properties'. - * @see org.eclipse.papyrus.FCM.ImplementationProperties - * @generated - */ - EClass getImplementationProperties(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSizeRAM Size RAM}'. - * - * - * @return the meta object for the attribute 'Size RAM'. - * @see org.eclipse.papyrus.FCM.ImplementationProperties#getSizeRAM() - * @see #getImplementationProperties() - * @generated - */ - EAttribute getImplementationProperties_SizeRAM(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedOS Supported OS}'. - * - * - * @return the meta object for the reference list 'Supported OS'. - * @see org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedOS() - * @see #getImplementationProperties() - * @generated - */ - EReference getImplementationProperties_SupportedOS(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getArch Arch}'. - * - * - * @return the meta object for the reference list 'Arch'. - * @see org.eclipse.papyrus.FCM.ImplementationProperties#getArch() - * @see #getImplementationProperties() - * @generated - */ - EReference getImplementationProperties_Arch(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.ImplementationProperties#getBase_Class() - * @see #getImplementationProperties() - * @generated - */ - EReference getImplementationProperties_Base_Class(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSizeROM Size ROM}'. - * - * - * @return the meta object for the attribute 'Size ROM'. - * @see org.eclipse.papyrus.FCM.ImplementationProperties#getSizeROM() - * @see #getImplementationProperties() - * @generated - */ - EAttribute getImplementationProperties_SizeROM(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedTargetArch Supported Target Arch}'. - * - * - * @return the meta object for the reference 'Supported Target Arch'. - * @see org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedTargetArch() - * @see #getImplementationProperties() - * @generated - */ - EReference getImplementationProperties_SupportedTargetArch(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.OperatingSystem Operating System}'. - * - * - * @return the meta object for class 'Operating System'. - * @see org.eclipse.papyrus.FCM.OperatingSystem - * @generated - */ - EClass getOperatingSystem(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.OperatingSystem#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.OperatingSystem#getBase_Class() - * @see #getOperatingSystem() - * @generated - */ - EReference getOperatingSystem_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.TargetArchitecture Target Architecture}'. - * - * - * @return the meta object for class 'Target Architecture'. - * @see org.eclipse.papyrus.FCM.TargetArchitecture - * @generated - */ - EClass getTargetArchitecture(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.TargetArchitecture#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.TargetArchitecture#getBase_Class() - * @see #getTargetArchitecture() - * @generated - */ - EReference getTargetArchitecture_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Configuration Configuration}'. - * - * - * @return the meta object for class 'Configuration'. - * @see org.eclipse.papyrus.FCM.Configuration - * @generated - */ - EClass getConfiguration(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Configuration#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.Configuration#getBase_Class() - * @see #getConfiguration() - * @generated - */ - EReference getConfiguration_Base_Class(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.Configuration#getConfigOptions Config Options}'. - * - * - * @return the meta object for the reference list 'Config Options'. - * @see org.eclipse.papyrus.FCM.Configuration#getConfigOptions() - * @see #getConfiguration() - * @generated - */ - EReference getConfiguration_ConfigOptions(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Configuration#getDeploymentPlan Deployment Plan}'. - * - * - * @return the meta object for the reference 'Deployment Plan'. - * @see org.eclipse.papyrus.FCM.Configuration#getDeploymentPlan() - * @see #getConfiguration() - * @generated - */ - EReference getConfiguration_DeploymentPlan(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.InterceptionRule Interception Rule}'. - * - * - * @return the meta object for class 'Interception Rule'. - * @see org.eclipse.papyrus.FCM.InterceptionRule - * @generated - */ - EClass getInterceptionRule(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionKind Interception Kind}'. - * - * - * @return the meta object for the attribute 'Interception Kind'. - * @see org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionKind() - * @see #getInterceptionRule() - * @generated - */ - EAttribute getInterceptionRule_InterceptionKind(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionSet Interception Set}'. - * - * - * @return the meta object for the reference list 'Interception Set'. - * @see org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionSet() - * @see #getInterceptionRule() - * @generated - */ - EReference getInterceptionRule_InterceptionSet(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.InterceptionRule#getBase_Property Base Property}'. - * - * - * @return the meta object for the reference 'Base Property'. - * @see org.eclipse.papyrus.FCM.InterceptionRule#getBase_Property() - * @see #getInterceptionRule() - * @generated - */ - EReference getInterceptionRule_Base_Property(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.InterceptionRule#getBase_Operation Base Operation}'. - * - * - * @return the meta object for the reference 'Base Operation'. - * @see org.eclipse.papyrus.FCM.InterceptionRule#getBase_Operation() - * @see #getInterceptionRule() - * @generated - */ - EReference getInterceptionRule_Base_Operation(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Target Target}'. - * - * - * @return the meta object for class 'Target'. - * @see org.eclipse.papyrus.FCM.Target - * @generated - */ - EClass getTarget(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Target#getTargetArch Target Arch}'. - * - * - * @return the meta object for the reference 'Target Arch'. - * @see org.eclipse.papyrus.FCM.Target#getTargetArch() - * @see #getTarget() - * @generated - */ - EReference getTarget_TargetArch(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.Target#getOptions Options}'. - * - * - * @return the meta object for the reference list 'Options'. - * @see org.eclipse.papyrus.FCM.Target#getOptions() - * @see #getTarget() - * @generated - */ - EReference getTarget_Options(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Target#getBase_Node Base Node}'. - * - * - * @return the meta object for the reference 'Base Node'. - * @see org.eclipse.papyrus.FCM.Target#getBase_Node() - * @see #getTarget() - * @generated - */ - EReference getTarget_Base_Node(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Target#getUsedOS Used OS}'. - * - * - * @return the meta object for the reference 'Used OS'. - * @see org.eclipse.papyrus.FCM.Target#getUsedOS() - * @see #getTarget() - * @generated - */ - EReference getTarget_UsedOS(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.Target#getAvailRAM Avail RAM}'. - * - * - * @return the meta object for the attribute 'Avail RAM'. - * @see org.eclipse.papyrus.FCM.Target#getAvailRAM() - * @see #getTarget() - * @generated - */ - EAttribute getTarget_AvailRAM(); - - /** - * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.Target#getAvailROM Avail ROM}'. - * - * - * @return the meta object for the attribute 'Avail ROM'. - * @see org.eclipse.papyrus.FCM.Target#getAvailROM() - * @see #getTarget() - * @generated - */ - EAttribute getTarget_AvailROM(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Target#getCompiler Compiler}'. - * - * - * @return the meta object for the reference 'Compiler'. - * @see org.eclipse.papyrus.FCM.Target#getCompiler() - * @see #getTarget() - * @generated - */ - EReference getTarget_Compiler(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.CompilerChain Compiler Chain}'. - * - * - * @return the meta object for class 'Compiler Chain'. - * @see org.eclipse.papyrus.FCM.CompilerChain - * @generated - */ - EClass getCompilerChain(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CompilerChain#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.CompilerChain#getBase_Class() - * @see #getCompilerChain() - * @generated - */ - EReference getCompilerChain_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Fragment Fragment}'. - * - * - * @return the meta object for class 'Fragment'. - * @see org.eclipse.papyrus.FCM.Fragment - * @generated - */ - EClass getFragment(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Fragment#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.Fragment#getBase_Class() - * @see #getFragment() - * @generated - */ - EReference getFragment_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.CopyAttributeValue Copy Attribute Value}'. - * - * - * @return the meta object for class 'Copy Attribute Value'. - * @see org.eclipse.papyrus.FCM.CopyAttributeValue - * @generated - */ - EClass getCopyAttributeValue(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CopyAttributeValue#getSource Source}'. - * - * - * @return the meta object for the reference 'Source'. - * @see org.eclipse.papyrus.FCM.CopyAttributeValue#getSource() - * @see #getCopyAttributeValue() - * @generated - */ - EReference getCopyAttributeValue_Source(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CopyAttributeValue#getBase_Property Base Property}'. - * - * - * @return the meta object for the reference 'Base Property'. - * @see org.eclipse.papyrus.FCM.CopyAttributeValue#getBase_Property() - * @see #getCopyAttributeValue() - * @generated - */ - EReference getCopyAttributeValue_Base_Property(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.AutoIndex Auto Index}'. - * - * - * @return the meta object for class 'Auto Index'. - * @see org.eclipse.papyrus.FCM.AutoIndex - * @generated - */ - EClass getAutoIndex(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.AutoIndex#getBase_Property Base Property}'. - * - * - * @return the meta object for the reference 'Base Property'. - * @see org.eclipse.papyrus.FCM.AutoIndex#getBase_Property() - * @see #getAutoIndex() - * @generated - */ - EReference getAutoIndex_Base_Property(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.AutoIndexPerNode Auto Index Per Node}'. - * - * - * @return the meta object for class 'Auto Index Per Node'. - * @see org.eclipse.papyrus.FCM.AutoIndexPerNode - * @generated - */ - EClass getAutoIndexPerNode(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.InitPrecedence Init Precedence}'. - * - * - * @return the meta object for class 'Init Precedence'. - * @see org.eclipse.papyrus.FCM.InitPrecedence - * @generated - */ - EClass getInitPrecedence(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.InitPrecedence#getInvokeAfter Invoke After}'. - * - * - * @return the meta object for the reference list 'Invoke After'. - * @see org.eclipse.papyrus.FCM.InitPrecedence#getInvokeAfter() - * @see #getInitPrecedence() - * @generated - */ - EReference getInitPrecedence_InvokeAfter(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.InitPrecedence#getInvokeBefore Invoke Before}'. - * - * - * @return the meta object for the reference list 'Invoke Before'. - * @see org.eclipse.papyrus.FCM.InitPrecedence#getInvokeBefore() - * @see #getInitPrecedence() - * @generated - */ - EReference getInitPrecedence_InvokeBefore(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.InitPrecedence#getBase_Class Base Class}'. - * - * - * @return the meta object for the reference 'Base Class'. - * @see org.eclipse.papyrus.FCM.InitPrecedence#getBase_Class() - * @see #getInitPrecedence() - * @generated - */ - EReference getInitPrecedence_Base_Class(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ConnectorConfiguration Connector Configuration}'. - * - * - * @return the meta object for class 'Connector Configuration'. - * @see org.eclipse.papyrus.FCM.ConnectorConfiguration - * @generated - */ - EClass getConnectorConfiguration(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ConnectorConfiguration#getBase_Slot Base Slot}'. - * - * - * @return the meta object for the reference 'Base Slot'. - * @see org.eclipse.papyrus.FCM.ConnectorConfiguration#getBase_Slot() - * @see #getConnectorConfiguration() - * @generated - */ - EReference getConnectorConfiguration_Base_Slot(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ConnectorConfiguration#getConnector Connector}'. - * - * - * @return the meta object for the reference 'Connector'. - * @see org.eclipse.papyrus.FCM.ConnectorConfiguration#getConnector() - * @see #getConnectorConfiguration() - * @generated - */ - EReference getConnectorConfiguration_Connector(); - - /** - * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.BindTemplate Bind Template}'. - * - * - * @return the meta object for class 'Bind Template'. - * @see org.eclipse.papyrus.FCM.BindTemplate - * @generated - */ - EClass getBindTemplate(); - - /** - * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.BindTemplate#getActual Actual}'. - * - * - * @return the meta object for the reference list 'Actual'. - * @see org.eclipse.papyrus.FCM.BindTemplate#getActual() - * @see #getBindTemplate() - * @generated - */ - EReference getBindTemplate_Actual(); - - /** - * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.BindTemplate#getBase_Property Base Property}'. - * - * - * @return the meta object for the reference 'Base Property'. - * @see org.eclipse.papyrus.FCM.BindTemplate#getBase_Property() - * @see #getBindTemplate() - * @generated - */ - EReference getBindTemplate_Base_Property(); - - /** - * Returns the meta object for enum '{@link org.eclipse.papyrus.FCM.ContainerRuleKind Container Rule Kind}'. - * - * - * @return the meta object for enum 'Container Rule Kind'. - * @see org.eclipse.papyrus.FCM.ContainerRuleKind - * @generated - */ - EEnum getContainerRuleKind(); - - /** - * Returns the meta object for enum '{@link org.eclipse.papyrus.FCM.InterceptionKind Interception Kind}'. - * - * - * @return the meta object for enum 'Interception Kind'. - * @see org.eclipse.papyrus.FCM.InterceptionKind - * @generated - */ - EEnum getInterceptionKind(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - FCMFactory getFCMFactory(); - - /** - * - * Defines literals for the meta objects that represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - interface Literals { - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.TemplateImpl Template}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.TemplateImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTemplate() - * @generated - */ - EClass TEMPLATE = eINSTANCE.getTemplate(); - - /** - * The meta object literal for the 'Base Element' reference feature. - * - * - * @generated - */ - EReference TEMPLATE__BASE_ELEMENT = eINSTANCE.getTemplate_Base_Element(); - - /** - * The meta object literal for the 'Helper' reference feature. - * - * - * @generated - */ - EReference TEMPLATE__HELPER = eINSTANCE.getTemplate_Helper(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.BindingHelperImpl Binding Helper}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.BindingHelperImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getBindingHelper() - * @generated - */ - EClass BINDING_HELPER = eINSTANCE.getBindingHelper(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference BINDING_HELPER__BASE_CLASS = eINSTANCE.getBindingHelper_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ConfigurationPropertyImpl Configuration Property}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ConfigurationPropertyImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfigurationProperty() - * @generated - */ - EClass CONFIGURATION_PROPERTY = eINSTANCE.getConfigurationProperty(); - - /** - * The meta object literal for the 'Base Property' reference feature. - * - * - * @generated - */ - EReference CONFIGURATION_PROPERTY__BASE_PROPERTY = eINSTANCE.getConfigurationProperty_Base_Property(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ImplementationGroupImpl Implementation Group}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ImplementationGroupImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getImplementationGroup() - * @generated - */ - EClass IMPLEMENTATION_GROUP = eINSTANCE.getImplementationGroup(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference IMPLEMENTATION_GROUP__BASE_CLASS = eINSTANCE.getImplementationGroup_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.AssemblyImpl Assembly}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.AssemblyImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getAssembly() - * @generated - */ - EClass ASSEMBLY = eINSTANCE.getAssembly(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference ASSEMBLY__BASE_CLASS = eINSTANCE.getAssembly_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.FlattenImpl Flatten}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.FlattenImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getFlatten() - * @generated - */ - EClass FLATTEN = eINSTANCE.getFlatten(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference FLATTEN__BASE_CLASS = eINSTANCE.getFlatten_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.CompToOOmappingImpl Comp To OOmapping}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.CompToOOmappingImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCompToOOmapping() - * @generated - */ - EClass COMP_TO_OOMAPPING = eINSTANCE.getCompToOOmapping(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference COMP_TO_OOMAPPING__BASE_CLASS = eINSTANCE.getCompToOOmapping_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ProgLanguageImpl Prog Language}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ProgLanguageImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getProgLanguage() - * @generated - */ - EClass PROG_LANGUAGE = eINSTANCE.getProgLanguage(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference PROG_LANGUAGE__BASE_CLASS = eINSTANCE.getProgLanguage_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl Code Gen Options}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCodeGenOptions() - * @generated - */ - EClass CODE_GEN_OPTIONS = eINSTANCE.getCodeGenOptions(); - - /** - * The meta object literal for the 'Base Package' reference feature. - * - * - * @generated - */ - EReference CODE_GEN_OPTIONS__BASE_PACKAGE = eINSTANCE.getCodeGenOptions_Base_Package(); - - /** - * The meta object literal for the 'Comp To OOmapping' reference feature. - * - * - * @generated - */ - EReference CODE_GEN_OPTIONS__COMP_TO_OOMAPPING = eINSTANCE.getCodeGenOptions_CompToOOmapping(); - - /** - * The meta object literal for the 'Prog Language' reference feature. - * - * - * @generated - */ - EReference CODE_GEN_OPTIONS__PROG_LANGUAGE = eINSTANCE.getCodeGenOptions_ProgLanguage(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.InteractionComponentImpl Interaction Component}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.InteractionComponentImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInteractionComponent() - * @generated - */ - EClass INTERACTION_COMPONENT = eINSTANCE.getInteractionComponent(); - - /** - * The meta object literal for the 'For Distribution' attribute feature. - * - * - * @generated - */ - EAttribute INTERACTION_COMPONENT__FOR_DISTRIBUTION = eINSTANCE.getInteractionComponent_ForDistribution(); - - /** - * The meta object literal for the 'Connection Pattern' reference feature. - * - * - * @generated - */ - EReference INTERACTION_COMPONENT__CONNECTION_PATTERN = eINSTANCE.getInteractionComponent_ConnectionPattern(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference INTERACTION_COMPONENT__BASE_CLASS = eINSTANCE.getInteractionComponent_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.SingletonImpl Singleton}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.SingletonImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getSingleton() - * @generated - */ - EClass SINGLETON = eINSTANCE.getSingleton(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference SINGLETON__BASE_CLASS = eINSTANCE.getSingleton_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ConnectorImpl Connector}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ConnectorImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConnector() - * @generated - */ - EClass CONNECTOR = eINSTANCE.getConnector(); - - /** - * The meta object literal for the 'Base Connector' reference feature. - * - * - * @generated - */ - EReference CONNECTOR__BASE_CONNECTOR = eINSTANCE.getConnector_Base_Connector(); - - /** - * The meta object literal for the 'Ic' reference feature. - * - * - * @generated - */ - EReference CONNECTOR__IC = eINSTANCE.getConnector_Ic(); - - /** - * The meta object literal for the 'Base Property' reference feature. - * - * - * @generated - */ - EReference CONNECTOR__BASE_PROPERTY = eINSTANCE.getConnector_Base_Property(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ConfigurableElementInstanceImpl Configurable Element Instance}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ConfigurableElementInstanceImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfigurableElementInstance() - * @generated - */ - EClass CONFIGURABLE_ELEMENT_INSTANCE = eINSTANCE.getConfigurableElementInstance(); - - /** - * The meta object literal for the 'Configuration' reference feature. - * - * - * @generated - */ - EReference CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION = eINSTANCE.getConfigurableElementInstance_Configuration(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.UseInstanceConfiguratorImpl Use Instance Configurator}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.UseInstanceConfiguratorImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getUseInstanceConfigurator() - * @generated - */ - EClass USE_INSTANCE_CONFIGURATOR = eINSTANCE.getUseInstanceConfigurator(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference USE_INSTANCE_CONFIGURATOR__BASE_CLASS = eINSTANCE.getUseInstanceConfigurator_Base_Class(); - - /** - * The meta object literal for the 'Configurator' reference feature. - * - * - * @generated - */ - EReference USE_INSTANCE_CONFIGURATOR__CONFIGURATOR = eINSTANCE.getUseInstanceConfigurator_Configurator(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.InstanceConfiguratorImpl Instance Configurator}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.InstanceConfiguratorImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInstanceConfigurator() - * @generated - */ - EClass INSTANCE_CONFIGURATOR = eINSTANCE.getInstanceConfigurator(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference INSTANCE_CONFIGURATOR__BASE_CLASS = eINSTANCE.getInstanceConfigurator_Base_Class(); - - /** - * The meta object literal for the 'On Node Model' attribute feature. - * - * - * @generated - */ - EAttribute INSTANCE_CONFIGURATOR__ON_NODE_MODEL = eINSTANCE.getInstanceConfigurator_OnNodeModel(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.RuleApplicationImpl Rule Application}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.RuleApplicationImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getRuleApplication() - * @generated - */ - EClass RULE_APPLICATION = eINSTANCE.getRuleApplication(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference RULE_APPLICATION__BASE_CLASS = eINSTANCE.getRuleApplication_Base_Class(); - - /** - * The meta object literal for the 'Container Rule' reference list feature. - * - * - * @generated - */ - EReference RULE_APPLICATION__CONTAINER_RULE = eINSTANCE.getRuleApplication_ContainerRule(); - - /** - * The meta object literal for the 'Base Package' reference feature. - * - * - * @generated - */ - EReference RULE_APPLICATION__BASE_PACKAGE = eINSTANCE.getRuleApplication_Base_Package(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ContainerRuleImpl Container Rule}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ContainerRuleImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getContainerRule() - * @generated - */ - EClass CONTAINER_RULE = eINSTANCE.getContainerRule(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference CONTAINER_RULE__BASE_CLASS = eINSTANCE.getContainerRule_Base_Class(); - - /** - * The meta object literal for the 'For Config' reference list feature. - * - * - * @generated - */ - EReference CONTAINER_RULE__FOR_CONFIG = eINSTANCE.getContainerRule_ForConfig(); - - /** - * The meta object literal for the 'Kind' attribute feature. - * - * - * @generated - */ - EAttribute CONTAINER_RULE__KIND = eINSTANCE.getContainerRule_Kind(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ConfigOptionImpl Config Option}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ConfigOptionImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfigOption() - * @generated - */ - EClass CONFIG_OPTION = eINSTANCE.getConfigOption(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference CONFIG_OPTION__BASE_CLASS = eINSTANCE.getConfigOption_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.TemplatePortImpl Template Port}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.TemplatePortImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTemplatePort() - * @generated - */ - EClass TEMPLATE_PORT = eINSTANCE.getTemplatePort(); - - /** - * The meta object literal for the 'Bound Type' reference feature. - * - * - * @generated - */ - EReference TEMPLATE_PORT__BOUND_TYPE = eINSTANCE.getTemplatePort_BoundType(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.PortImpl Port}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.PortImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getPort() - * @generated - */ - EClass PORT = eINSTANCE.getPort(); - - /** - * The meta object literal for the 'Base Port' reference feature. - * - * - * @generated - */ - EReference PORT__BASE_PORT = eINSTANCE.getPort_Base_Port(); - - /** - * The meta object literal for the 'Kind' reference feature. - * - * - * @generated - */ - EReference PORT__KIND = eINSTANCE.getPort_Kind(); - - /** - * The meta object literal for the 'Type' reference feature. - * - * - * @generated - */ - EReference PORT__TYPE = eINSTANCE.getPort_Type(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.PortKindImpl Port Kind}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.PortKindImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getPortKind() - * @generated - */ - EClass PORT_KIND = eINSTANCE.getPortKind(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference PORT_KIND__BASE_CLASS = eINSTANCE.getPortKind_Base_Class(); - - /** - * The meta object literal for the 'Provided Interface' reference feature. - * - * - * @generated - */ - EReference PORT_KIND__PROVIDED_INTERFACE = eINSTANCE.getPortKind_ProvidedInterface(); - - /** - * The meta object literal for the 'Required Interface' reference feature. - * - * - * @generated - */ - EReference PORT_KIND__REQUIRED_INTERFACE = eINSTANCE.getPortKind_RequiredInterface(); - - /** - * The meta object literal for the 'Extended Port' attribute feature. - * - * - * @generated - */ - EAttribute PORT_KIND__EXTENDED_PORT = eINSTANCE.getPortKind_ExtendedPort(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.DeploymentPlanImpl Deployment Plan}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.DeploymentPlanImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getDeploymentPlan() - * @generated - */ - EClass DEPLOYMENT_PLAN = eINSTANCE.getDeploymentPlan(); - - /** - * The meta object literal for the 'Main Instance' reference feature. - * - * - * @generated - */ - EReference DEPLOYMENT_PLAN__MAIN_INSTANCE = eINSTANCE.getDeploymentPlan_MainInstance(); - - /** - * The meta object literal for the 'Base Package' reference feature. - * - * - * @generated - */ - EReference DEPLOYMENT_PLAN__BASE_PACKAGE = eINSTANCE.getDeploymentPlan_Base_Package(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.DerivedElementImpl Derived Element}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.DerivedElementImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getDerivedElement() - * @generated - */ - EClass DERIVED_ELEMENT = eINSTANCE.getDerivedElement(); - - /** - * The meta object literal for the 'Base Element' reference feature. - * - * - * @generated - */ - EReference DERIVED_ELEMENT__BASE_ELEMENT = eINSTANCE.getDerivedElement_Base_Element(); - - /** - * The meta object literal for the 'Source' reference feature. - * - * - * @generated - */ - EReference DERIVED_ELEMENT__SOURCE = eINSTANCE.getDerivedElement_Source(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.CompImplTemplateImpl Comp Impl Template}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.CompImplTemplateImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCompImplTemplate() - * @generated - */ - EClass COMP_IMPL_TEMPLATE = eINSTANCE.getCompImplTemplate(); - - /** - * The meta object literal for the 'Template Defs' attribute feature. - * - * - * @generated - */ - EAttribute COMP_IMPL_TEMPLATE__TEMPLATE_DEFS = eINSTANCE.getCompImplTemplate_TemplateDefs(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference COMP_IMPL_TEMPLATE__BASE_CLASS = eINSTANCE.getCompImplTemplate_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl Implementation Properties}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getImplementationProperties() - * @generated - */ - EClass IMPLEMENTATION_PROPERTIES = eINSTANCE.getImplementationProperties(); - - /** - * The meta object literal for the 'Size RAM' attribute feature. - * - * - * @generated - */ - EAttribute IMPLEMENTATION_PROPERTIES__SIZE_RAM = eINSTANCE.getImplementationProperties_SizeRAM(); - - /** - * The meta object literal for the 'Supported OS' reference list feature. - * - * - * @generated - */ - EReference IMPLEMENTATION_PROPERTIES__SUPPORTED_OS = eINSTANCE.getImplementationProperties_SupportedOS(); - - /** - * The meta object literal for the 'Arch' reference list feature. - * - * - * @generated - */ - EReference IMPLEMENTATION_PROPERTIES__ARCH = eINSTANCE.getImplementationProperties_Arch(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference IMPLEMENTATION_PROPERTIES__BASE_CLASS = eINSTANCE.getImplementationProperties_Base_Class(); - - /** - * The meta object literal for the 'Size ROM' attribute feature. - * - * - * @generated - */ - EAttribute IMPLEMENTATION_PROPERTIES__SIZE_ROM = eINSTANCE.getImplementationProperties_SizeROM(); - - /** - * The meta object literal for the 'Supported Target Arch' reference feature. - * - * - * @generated - */ - EReference IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH = eINSTANCE.getImplementationProperties_SupportedTargetArch(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.OperatingSystemImpl Operating System}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.OperatingSystemImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getOperatingSystem() - * @generated - */ - EClass OPERATING_SYSTEM = eINSTANCE.getOperatingSystem(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference OPERATING_SYSTEM__BASE_CLASS = eINSTANCE.getOperatingSystem_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.TargetArchitectureImpl Target Architecture}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.TargetArchitectureImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTargetArchitecture() - * @generated - */ - EClass TARGET_ARCHITECTURE = eINSTANCE.getTargetArchitecture(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference TARGET_ARCHITECTURE__BASE_CLASS = eINSTANCE.getTargetArchitecture_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ConfigurationImpl Configuration}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ConfigurationImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfiguration() - * @generated - */ - EClass CONFIGURATION = eINSTANCE.getConfiguration(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference CONFIGURATION__BASE_CLASS = eINSTANCE.getConfiguration_Base_Class(); - - /** - * The meta object literal for the 'Config Options' reference list feature. - * - * - * @generated - */ - EReference CONFIGURATION__CONFIG_OPTIONS = eINSTANCE.getConfiguration_ConfigOptions(); - - /** - * The meta object literal for the 'Deployment Plan' reference feature. - * - * - * @generated - */ - EReference CONFIGURATION__DEPLOYMENT_PLAN = eINSTANCE.getConfiguration_DeploymentPlan(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl Interception Rule}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInterceptionRule() - * @generated - */ - EClass INTERCEPTION_RULE = eINSTANCE.getInterceptionRule(); - - /** - * The meta object literal for the 'Interception Kind' attribute feature. - * - * - * @generated - */ - EAttribute INTERCEPTION_RULE__INTERCEPTION_KIND = eINSTANCE.getInterceptionRule_InterceptionKind(); - - /** - * The meta object literal for the 'Interception Set' reference list feature. - * - * - * @generated - */ - EReference INTERCEPTION_RULE__INTERCEPTION_SET = eINSTANCE.getInterceptionRule_InterceptionSet(); - - /** - * The meta object literal for the 'Base Property' reference feature. - * - * - * @generated - */ - EReference INTERCEPTION_RULE__BASE_PROPERTY = eINSTANCE.getInterceptionRule_Base_Property(); - - /** - * The meta object literal for the 'Base Operation' reference feature. - * - * - * @generated - */ - EReference INTERCEPTION_RULE__BASE_OPERATION = eINSTANCE.getInterceptionRule_Base_Operation(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.TargetImpl Target}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.TargetImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTarget() - * @generated - */ - EClass TARGET = eINSTANCE.getTarget(); - - /** - * The meta object literal for the 'Target Arch' reference feature. - * - * - * @generated - */ - EReference TARGET__TARGET_ARCH = eINSTANCE.getTarget_TargetArch(); - - /** - * The meta object literal for the 'Options' reference list feature. - * - * - * @generated - */ - EReference TARGET__OPTIONS = eINSTANCE.getTarget_Options(); - - /** - * The meta object literal for the 'Base Node' reference feature. - * - * - * @generated - */ - EReference TARGET__BASE_NODE = eINSTANCE.getTarget_Base_Node(); - - /** - * The meta object literal for the 'Used OS' reference feature. - * - * - * @generated - */ - EReference TARGET__USED_OS = eINSTANCE.getTarget_UsedOS(); - - /** - * The meta object literal for the 'Avail RAM' attribute feature. - * - * - * @generated - */ - EAttribute TARGET__AVAIL_RAM = eINSTANCE.getTarget_AvailRAM(); - - /** - * The meta object literal for the 'Avail ROM' attribute feature. - * - * - * @generated - */ - EAttribute TARGET__AVAIL_ROM = eINSTANCE.getTarget_AvailROM(); - - /** - * The meta object literal for the 'Compiler' reference feature. - * - * - * @generated - */ - EReference TARGET__COMPILER = eINSTANCE.getTarget_Compiler(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.CompilerChainImpl Compiler Chain}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.CompilerChainImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCompilerChain() - * @generated - */ - EClass COMPILER_CHAIN = eINSTANCE.getCompilerChain(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference COMPILER_CHAIN__BASE_CLASS = eINSTANCE.getCompilerChain_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.FragmentImpl Fragment}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.FragmentImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getFragment() - * @generated - */ - EClass FRAGMENT = eINSTANCE.getFragment(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference FRAGMENT__BASE_CLASS = eINSTANCE.getFragment_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.CopyAttributeValueImpl Copy Attribute Value}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.CopyAttributeValueImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCopyAttributeValue() - * @generated - */ - EClass COPY_ATTRIBUTE_VALUE = eINSTANCE.getCopyAttributeValue(); - - /** - * The meta object literal for the 'Source' reference feature. - * - * - * @generated - */ - EReference COPY_ATTRIBUTE_VALUE__SOURCE = eINSTANCE.getCopyAttributeValue_Source(); - - /** - * The meta object literal for the 'Base Property' reference feature. - * - * - * @generated - */ - EReference COPY_ATTRIBUTE_VALUE__BASE_PROPERTY = eINSTANCE.getCopyAttributeValue_Base_Property(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.AutoIndexImpl Auto Index}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.AutoIndexImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getAutoIndex() - * @generated - */ - EClass AUTO_INDEX = eINSTANCE.getAutoIndex(); - - /** - * The meta object literal for the 'Base Property' reference feature. - * - * - * @generated - */ - EReference AUTO_INDEX__BASE_PROPERTY = eINSTANCE.getAutoIndex_Base_Property(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.AutoIndexPerNodeImpl Auto Index Per Node}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.AutoIndexPerNodeImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getAutoIndexPerNode() - * @generated - */ - EClass AUTO_INDEX_PER_NODE = eINSTANCE.getAutoIndexPerNode(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl Init Precedence}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInitPrecedence() - * @generated - */ - EClass INIT_PRECEDENCE = eINSTANCE.getInitPrecedence(); - - /** - * The meta object literal for the 'Invoke After' reference list feature. - * - * - * @generated - */ - EReference INIT_PRECEDENCE__INVOKE_AFTER = eINSTANCE.getInitPrecedence_InvokeAfter(); - - /** - * The meta object literal for the 'Invoke Before' reference list feature. - * - * - * @generated - */ - EReference INIT_PRECEDENCE__INVOKE_BEFORE = eINSTANCE.getInitPrecedence_InvokeBefore(); - - /** - * The meta object literal for the 'Base Class' reference feature. - * - * - * @generated - */ - EReference INIT_PRECEDENCE__BASE_CLASS = eINSTANCE.getInitPrecedence_Base_Class(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ConnectorConfigurationImpl Connector Configuration}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.ConnectorConfigurationImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConnectorConfiguration() - * @generated - */ - EClass CONNECTOR_CONFIGURATION = eINSTANCE.getConnectorConfiguration(); - - /** - * The meta object literal for the 'Base Slot' reference feature. - * - * - * @generated - */ - EReference CONNECTOR_CONFIGURATION__BASE_SLOT = eINSTANCE.getConnectorConfiguration_Base_Slot(); - - /** - * The meta object literal for the 'Connector' reference feature. - * - * - * @generated - */ - EReference CONNECTOR_CONFIGURATION__CONNECTOR = eINSTANCE.getConnectorConfiguration_Connector(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.BindTemplateImpl Bind Template}' class. - * - * - * @see org.eclipse.papyrus.FCM.impl.BindTemplateImpl - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getBindTemplate() - * @generated - */ - EClass BIND_TEMPLATE = eINSTANCE.getBindTemplate(); - - /** - * The meta object literal for the 'Actual' reference list feature. - * - * - * @generated - */ - EReference BIND_TEMPLATE__ACTUAL = eINSTANCE.getBindTemplate_Actual(); - - /** - * The meta object literal for the 'Base Property' reference feature. - * - * - * @generated - */ - EReference BIND_TEMPLATE__BASE_PROPERTY = eINSTANCE.getBindTemplate_Base_Property(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.ContainerRuleKind Container Rule Kind}' enum. - * - * - * @see org.eclipse.papyrus.FCM.ContainerRuleKind - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getContainerRuleKind() - * @generated - */ - EEnum CONTAINER_RULE_KIND = eINSTANCE.getContainerRuleKind(); - - /** - * The meta object literal for the '{@link org.eclipse.papyrus.FCM.InterceptionKind Interception Kind}' enum. - * - * - * @see org.eclipse.papyrus.FCM.InterceptionKind - * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInterceptionKind() - * @generated - */ - EEnum INTERCEPTION_KIND = eINSTANCE.getInterceptionKind(); - - } - -} // FCMPackage diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Flatten.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Flatten.java deleted file mode 100644 index 9a89c91f924..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Flatten.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Flatten'. - * - * - * - * A composite that will get flattened during distribution. This means that it vanishes and its parts are added to the composite in which the flat composite is defined. A flat composite may not have assembly connections. It is primarily used by interaction components - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.Flatten#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getFlatten() - * @model - * @generated - */ -public interface Flatten extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getFlatten_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Flatten#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // Flatten diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Fragment.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Fragment.java deleted file mode 100644 index 53f4baac33e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Fragment.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Fragment'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.Fragment#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getFragment() - * @model - * @generated - */ -public interface Fragment extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getFragment_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Fragment#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // Fragment diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationGroup.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationGroup.java deleted file mode 100644 index fc79e9d0ea6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationGroup.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Implementation Group'. - * - * - * - * A group of interaction components should apply both stereotypes. Each member of such a group must be an interaction component, but this is not enforced by the meta-model - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.ImplementationGroup#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationGroup() - * @model - * @generated - */ -public interface ImplementationGroup extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationGroup_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.ImplementationGroup#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // ImplementationGroup diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationProperties.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationProperties.java deleted file mode 100644 index 8a3bd56e5bc..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationProperties.java +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Implementation Properties'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.ImplementationProperties#getSizeRAM Size RAM}
  • - *
  • {@link org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedOS Supported OS}
  • - *
  • {@link org.eclipse.papyrus.FCM.ImplementationProperties#getArch Arch}
  • - *
  • {@link org.eclipse.papyrus.FCM.ImplementationProperties#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.ImplementationProperties#getSizeROM Size ROM}
  • - *
  • {@link org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedTargetArch Supported Target Arch}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties() - * @model - * @generated - */ -public interface ImplementationProperties extends EObject { - /** - * Returns the value of the 'Size RAM' attribute. - * - *

- * If the meaning of the 'Size RAM' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Size RAM' attribute. - * @see #setSizeRAM(int) - * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties_SizeRAM() - * @model unique="false" dataType="org.eclipse.uml2.types.Integer" required="true" ordered="false" - * @generated - */ - int getSizeRAM(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSizeRAM Size RAM}' attribute. - * - * - * @param value the new value of the 'Size RAM' attribute. - * @see #getSizeRAM() - * @generated - */ - void setSizeRAM(int value); - - /** - * Returns the value of the 'Supported OS' reference list. - * The list contents are of type {@link org.eclipse.papyrus.FCM.OperatingSystem}. - * - *

- * If the meaning of the 'Supported OS' reference list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Supported OS' reference list. - * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties_SupportedOS() - * @model ordered="false" - * @generated - */ - EList getSupportedOS(); - - /** - * Returns the value of the 'Arch' reference list. - * The list contents are of type {@link org.eclipse.papyrus.FCM.TargetArchitecture}. - * - *

- * If the meaning of the 'Arch' reference list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Arch' reference list. - * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties_Arch() - * @model ordered="false" - * @generated - */ - EList getArch(); - - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - - /** - * Returns the value of the 'Size ROM' attribute. - * - *

- * If the meaning of the 'Size ROM' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Size ROM' attribute. - * @see #setSizeROM(int) - * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties_SizeROM() - * @model dataType="org.eclipse.uml2.types.Integer" required="true" ordered="false" - * @generated - */ - int getSizeROM(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSizeROM Size ROM}' attribute. - * - * - * @param value the new value of the 'Size ROM' attribute. - * @see #getSizeROM() - * @generated - */ - void setSizeROM(int value); - - /** - * Returns the value of the 'Supported Target Arch' reference. - * - *

- * If the meaning of the 'Supported Target Arch' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Supported Target Arch' reference. - * @see #setSupportedTargetArch(TargetArchitecture) - * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties_SupportedTargetArch() - * @model required="true" ordered="false" - * @generated - */ - TargetArchitecture getSupportedTargetArch(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedTargetArch Supported Target Arch}' reference. - * - * - * @param value the new value of the 'Supported Target Arch' reference. - * @see #getSupportedTargetArch() - * @generated - */ - void setSupportedTargetArch(TargetArchitecture value); - -} // ImplementationProperties diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InitPrecedence.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InitPrecedence.java deleted file mode 100644 index 8c6af695105..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InitPrecedence.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Init Precedence'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.InitPrecedence#getInvokeAfter Invoke After}
  • - *
  • {@link org.eclipse.papyrus.FCM.InitPrecedence#getInvokeBefore Invoke Before}
  • - *
  • {@link org.eclipse.papyrus.FCM.InitPrecedence#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getInitPrecedence() - * @model - * @generated - */ -public interface InitPrecedence extends EObject { - /** - * Returns the value of the 'Invoke After' reference list. - * The list contents are of type {@link org.eclipse.uml2.uml.Class}. - * - *

- * If the meaning of the 'Invoke After' reference list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Invoke After' reference list. - * @see org.eclipse.papyrus.FCM.FCMPackage#getInitPrecedence_InvokeAfter() - * @model ordered="false" - * @generated - */ - EList getInvokeAfter(); - - /** - * Returns the value of the 'Invoke Before' reference list. - * The list contents are of type {@link org.eclipse.uml2.uml.Class}. - * - *

- * If the meaning of the 'Invoke Before' reference list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Invoke Before' reference list. - * @see org.eclipse.papyrus.FCM.FCMPackage#getInitPrecedence_InvokeBefore() - * @model ordered="false" - * @generated - */ - EList getInvokeBefore(); - - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getInitPrecedence_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.InitPrecedence#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // InitPrecedence diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InstanceConfigurator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InstanceConfigurator.java deleted file mode 100644 index bb463ad5340..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InstanceConfigurator.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Instance Configurator'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.InstanceConfigurator#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.InstanceConfigurator#isOnNodeModel On Node Model}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getInstanceConfigurator() - * @model - * @generated - */ -public interface InstanceConfigurator extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getInstanceConfigurator_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.InstanceConfigurator#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - - /** - * Returns the value of the 'On Node Model' attribute. - * - *

- * If the meaning of the 'On Node Model' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'On Node Model' attribute. - * @see #setOnNodeModel(boolean) - * @see org.eclipse.papyrus.FCM.FCMPackage#getInstanceConfigurator_OnNodeModel() - * @model dataType="org.eclipse.uml2.types.Boolean" ordered="false" - * @generated - */ - boolean isOnNodeModel(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.InstanceConfigurator#isOnNodeModel On Node Model}' attribute. - * - * - * @param value the new value of the 'On Node Model' attribute. - * @see #isOnNodeModel() - * @generated - */ - void setOnNodeModel(boolean value); - -} // InstanceConfigurator diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InteractionComponent.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InteractionComponent.java deleted file mode 100644 index cbef19b172b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InteractionComponent.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Collaboration; - -/** - * - * A representation of the model object 'Interaction Component'. - * - * - * - * An interaction component is responsible for realization the communication between two components. It typically owns conjugated ports. It might be defined within a package template to enable the adaption of ports to those used by the interacting components - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.InteractionComponent#isForDistribution For Distribution}
  • - *
  • {@link org.eclipse.papyrus.FCM.InteractionComponent#getConnectionPattern Connection Pattern}
  • - *
  • {@link org.eclipse.papyrus.FCM.InteractionComponent#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getInteractionComponent() - * @model - * @generated - */ -public interface InteractionComponent extends EObject { - /** - * Returns the value of the 'For Distribution' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'For Distribution' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'For Distribution' attribute. - * @see #setForDistribution(boolean) - * @see org.eclipse.papyrus.FCM.FCMPackage#getInteractionComponent_ForDistribution() - * @model default="false" unique="false" dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" - * @generated - */ - boolean isForDistribution(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.InteractionComponent#isForDistribution For Distribution}' attribute. - * - * - * @param value the new value of the 'For Distribution' attribute. - * @see #isForDistribution() - * @generated - */ - void setForDistribution(boolean value); - - /** - * Returns the value of the 'Connection Pattern' reference. - * - *

- * If the meaning of the 'Connection Pattern' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Connection Pattern' reference. - * @see #setConnectionPattern(Collaboration) - * @see org.eclipse.papyrus.FCM.FCMPackage#getInteractionComponent_ConnectionPattern() - * @model ordered="false" - * @generated - */ - Collaboration getConnectionPattern(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.InteractionComponent#getConnectionPattern Connection Pattern}' reference. - * - * - * @param value the new value of the 'Connection Pattern' reference. - * @see #getConnectionPattern() - * @generated - */ - void setConnectionPattern(Collaboration value); - - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getInteractionComponent_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.InteractionComponent#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // InteractionComponent diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionKind.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionKind.java deleted file mode 100644 index 24de3ce829e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionKind.java +++ /dev/null @@ -1,310 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.eclipse.emf.common.util.Enumerator; - -/** - * - * A representation of the literals of the enumeration 'Interception Kind', - * and utility methods for working with them. - * - * - * Condition whether an interceptor should be used within a container. - * - "Some" = set of ports defined in interception rule - * - "AllOut/AllIn" = ports with required/provided ports only - * - "Matching" = kind of interceptor and component port need to match - * - * - * @see org.eclipse.papyrus.FCM.FCMPackage#getInterceptionKind() - * @model - * @generated - */ -public enum InterceptionKind implements Enumerator { - /** - * The 'Intercept Some' literal object. - * - * - * @see #INTERCEPT_SOME_VALUE - * @generated - * @ordered - */ - INTERCEPT_SOME(0, "InterceptSome", "InterceptSome"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Intercept All' literal object. - * - * - * @see #INTERCEPT_ALL_VALUE - * @generated - * @ordered - */ - INTERCEPT_ALL(1, "InterceptAll", "InterceptAll"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Intercept All Out' literal object. - * - * - * @see #INTERCEPT_ALL_OUT_VALUE - * @generated - * @ordered - */ - INTERCEPT_ALL_OUT(2, "InterceptAllOut", "InterceptAllOut"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Intercept All In' literal object. - * - * - * @see #INTERCEPT_ALL_IN_VALUE - * @generated - * @ordered - */ - INTERCEPT_ALL_IN(3, "InterceptAllIn", "InterceptAllIn"), //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Intercept Matching' literal object. - * - * - * @see #INTERCEPT_MATCHING_VALUE - * @generated - * @ordered - */ - INTERCEPT_MATCHING(4, "InterceptMatching", "InterceptMatching"); //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * The 'Intercept Some' literal value. - * - *

- * If the meaning of 'Intercept Some' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #INTERCEPT_SOME - * @model name="InterceptSome" - * @generated - * @ordered - */ - public static final int INTERCEPT_SOME_VALUE = 0; - - /** - * The 'Intercept All' literal value. - * - *

- * If the meaning of 'Intercept All' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #INTERCEPT_ALL - * @model name="InterceptAll" - * @generated - * @ordered - */ - public static final int INTERCEPT_ALL_VALUE = 1; - - /** - * The 'Intercept All Out' literal value. - * - *

- * If the meaning of 'Intercept All Out' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #INTERCEPT_ALL_OUT - * @model name="InterceptAllOut" - * @generated - * @ordered - */ - public static final int INTERCEPT_ALL_OUT_VALUE = 2; - - /** - * The 'Intercept All In' literal value. - * - *

- * If the meaning of 'Intercept All In' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #INTERCEPT_ALL_IN - * @model name="InterceptAllIn" - * @generated - * @ordered - */ - public static final int INTERCEPT_ALL_IN_VALUE = 3; - - /** - * The 'Intercept Matching' literal value. - * - *

- * If the meaning of 'Intercept Matching' literal object isn't clear, there really should be more of a description here... - *

- * - * @see #INTERCEPT_MATCHING - * @model name="InterceptMatching" - * @generated - * @ordered - */ - public static final int INTERCEPT_MATCHING_VALUE = 4; - - /** - * An array of all the 'Interception Kind' enumerators. - * - * - * @generated - */ - private static final InterceptionKind[] VALUES_ARRAY = - new InterceptionKind[] { - INTERCEPT_SOME, - INTERCEPT_ALL, - INTERCEPT_ALL_OUT, - INTERCEPT_ALL_IN, - INTERCEPT_MATCHING, - }; - - /** - * A public read-only list of all the 'Interception Kind' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Interception Kind' literal with the specified literal value. - * - * - * @param literal the literal. - * @return the matching enumerator or null. - * @generated - */ - public static InterceptionKind get(String literal) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - InterceptionKind result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Interception Kind' literal with the specified name. - * - * - * @param name the name. - * @return the matching enumerator or null. - * @generated - */ - public static InterceptionKind getByName(String name) { - for (int i = 0; i < VALUES_ARRAY.length; ++i) { - InterceptionKind result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) { - return result; - } - } - return null; - } - - /** - * Returns the 'Interception Kind' literal with the specified integer value. - * - * - * @param value the integer value. - * @return the matching enumerator or null. - * @generated - */ - public static InterceptionKind get(int value) { - switch (value) { - case INTERCEPT_SOME_VALUE: return INTERCEPT_SOME; - case INTERCEPT_ALL_VALUE: return INTERCEPT_ALL; - case INTERCEPT_ALL_OUT_VALUE: return INTERCEPT_ALL_OUT; - case INTERCEPT_ALL_IN_VALUE: return INTERCEPT_ALL_IN; - case INTERCEPT_MATCHING_VALUE: return INTERCEPT_MATCHING; - } - return null; - } - - /** - * - * - * @generated - */ - private final int value; - - /** - * - * - * @generated - */ - private final String name; - - /** - * - * - * @generated - */ - private final String literal; - - /** - * Only this class can construct instances. - * - * - * @generated - */ - private InterceptionKind(int value, String name, String literal) { - this.value = value; - this.name = name; - this.literal = literal; - } - - /** - * - * - * @generated - */ - @Override - public int getValue() { - return value; - } - - /** - * - * - * @generated - */ - @Override - public String getName() { - return name; - } - - /** - * - * - * @generated - */ - @Override - public String getLiteral() { - return literal; - } - - /** - * Returns the literal value of the enumerator, which is its string representation. - * - * - * @generated - */ - @Override - public String toString() { - return literal; - } - -} // InterceptionKind diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionRule.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionRule.java deleted file mode 100644 index 44adb8c7700..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionRule.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Feature; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Property; - -/** - * - * A representation of the model object 'Interception Rule'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionKind Interception Kind}
  • - *
  • {@link org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionSet Interception Set}
  • - *
  • {@link org.eclipse.papyrus.FCM.InterceptionRule#getBase_Property Base Property}
  • - *
  • {@link org.eclipse.papyrus.FCM.InterceptionRule#getBase_Operation Base Operation}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getInterceptionRule() - * @model - * @generated - */ -public interface InterceptionRule extends EObject { - /** - * Returns the value of the 'Interception Kind' attribute. - * The literals are from the enumeration {@link org.eclipse.papyrus.FCM.InterceptionKind}. - * - *

- * If the meaning of the 'Interception Kind' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Interception Kind' attribute. - * @see org.eclipse.papyrus.FCM.InterceptionKind - * @see #setInterceptionKind(InterceptionKind) - * @see org.eclipse.papyrus.FCM.FCMPackage#getInterceptionRule_InterceptionKind() - * @model unique="false" required="true" ordered="false" - * @generated - */ - InterceptionKind getInterceptionKind(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionKind Interception Kind}' attribute. - * - * - * @param value the new value of the 'Interception Kind' attribute. - * @see org.eclipse.papyrus.FCM.InterceptionKind - * @see #getInterceptionKind() - * @generated - */ - void setInterceptionKind(InterceptionKind value); - - /** - * Returns the value of the 'Interception Set' reference list. - * The list contents are of type {@link org.eclipse.uml2.uml.Feature}. - * - *

- * If the meaning of the 'Interception Set' reference list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Interception Set' reference list. - * @see org.eclipse.papyrus.FCM.FCMPackage#getInterceptionRule_InterceptionSet() - * @model ordered="false" - * @generated - */ - EList getInterceptionSet(); - - /** - * Returns the value of the 'Base Property' reference. - * - *

- * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Property' reference. - * @see #setBase_Property(Property) - * @see org.eclipse.papyrus.FCM.FCMPackage#getInterceptionRule_Base_Property() - * @model required="true" ordered="false" - * @generated - */ - Property getBase_Property(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.InterceptionRule#getBase_Property Base Property}' reference. - * - * - * @param value the new value of the 'Base Property' reference. - * @see #getBase_Property() - * @generated - */ - void setBase_Property(Property value); - - /** - * Returns the value of the 'Base Operation' reference. - * - *

- * If the meaning of the 'Base Operation' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Operation' reference. - * @see #setBase_Operation(Operation) - * @see org.eclipse.papyrus.FCM.FCMPackage#getInterceptionRule_Base_Operation() - * @model required="true" ordered="false" - * @generated - */ - Operation getBase_Operation(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.InterceptionRule#getBase_Operation Base Operation}' reference. - * - * - * @param value the new value of the 'Base Operation' reference. - * @see #getBase_Operation() - * @generated - */ - void setBase_Operation(Operation value); - -} // InterceptionRule diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/OperatingSystem.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/OperatingSystem.java deleted file mode 100644 index e9dc05079f7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/OperatingSystem.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Operating System'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.OperatingSystem#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getOperatingSystem() - * @model - * @generated - */ -public interface OperatingSystem extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getOperatingSystem_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.OperatingSystem#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // OperatingSystem diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Port.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Port.java deleted file mode 100644 index 0f1da61cd0c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Port.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Type; - -/** - * - * A representation of the model object 'Port'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.Port#getBase_Port Base Port}
  • - *
  • {@link org.eclipse.papyrus.FCM.Port#getKind Kind}
  • - *
  • {@link org.eclipse.papyrus.FCM.Port#getType Type}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getPort() - * @model - * @generated - */ -public interface Port extends ConfigurableElementInstance { - /** - * Returns the value of the 'Base Port' reference. - * - *

- * If the meaning of the 'Base Port' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Port' reference. - * @see #setBase_Port(org.eclipse.uml2.uml.Port) - * @see org.eclipse.papyrus.FCM.FCMPackage#getPort_Base_Port() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Port getBase_Port(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Port#getBase_Port Base Port}' reference. - * - * - * @param value the new value of the 'Base Port' reference. - * @see #getBase_Port() - * @generated - */ - void setBase_Port(org.eclipse.uml2.uml.Port value); - - /** - * Returns the value of the 'Kind' reference. - * - *

- * If the meaning of the 'Kind' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Kind' reference. - * @see #setKind(PortKind) - * @see org.eclipse.papyrus.FCM.FCMPackage#getPort_Kind() - * @model ordered="false" - * @generated - */ - PortKind getKind(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Port#getKind Kind}' reference. - * - * - * @param value the new value of the 'Kind' reference. - * @see #getKind() - * @generated - */ - void setKind(PortKind value); - - /** - * Returns the value of the 'Type' reference. - * - *

- * If the meaning of the 'Type' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Type' reference. - * @see #setType(Type) - * @see org.eclipse.papyrus.FCM.FCMPackage#getPort_Type() - * @model required="true" ordered="false" - * @generated - */ - Type getType(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Port#getType Type}' reference. - * - * - * @param value the new value of the 'Type' reference. - * @see #getType() - * @generated - */ - void setType(Type value); - - /** - * Update the derived interfaces of a port. Manually added method - */ - void update(); -} // Port diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/PortKind.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/PortKind.java deleted file mode 100644 index 82ad56f8cf7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/PortKind.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Interface; - -/** - * - * A representation of the model object 'Port Kind'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.PortKind#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.PortKind#getProvidedInterface Provided Interface}
  • - *
  • {@link org.eclipse.papyrus.FCM.PortKind#getRequiredInterface Required Interface}
  • - *
  • {@link org.eclipse.papyrus.FCM.PortKind#isExtendedPort Extended Port}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getPortKind() - * @model - * @generated - */ -public interface PortKind extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getPortKind_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.PortKind#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - - /** - * Returns the value of the 'Provided Interface' reference. - * - *

- * If the meaning of the 'Provided Interface' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Provided Interface' reference. - * @see #setProvidedInterface(Interface) - * @see org.eclipse.papyrus.FCM.FCMPackage#getPortKind_ProvidedInterface() - * @model ordered="false" - * @generated - */ - Interface getProvidedInterface(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.PortKind#getProvidedInterface Provided Interface}' reference. - * - * - * @param value the new value of the 'Provided Interface' reference. - * @see #getProvidedInterface() - * @generated - */ - void setProvidedInterface(Interface value); - - /** - * Returns the value of the 'Required Interface' reference. - * - *

- * If the meaning of the 'Required Interface' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Required Interface' reference. - * @see #setRequiredInterface(Interface) - * @see org.eclipse.papyrus.FCM.FCMPackage#getPortKind_RequiredInterface() - * @model ordered="false" - * @generated - */ - Interface getRequiredInterface(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.PortKind#getRequiredInterface Required Interface}' reference. - * - * - * @param value the new value of the 'Required Interface' reference. - * @see #getRequiredInterface() - * @generated - */ - void setRequiredInterface(Interface value); - - /** - * Returns the value of the 'Extended Port' attribute. - * - *

- * If the meaning of the 'Extended Port' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Extended Port' attribute. - * @see #isSetExtendedPort() - * @see org.eclipse.papyrus.FCM.FCMPackage#getPortKind_ExtendedPort() - * @model unsettable="true" dataType="org.eclipse.uml2.types.Boolean" required="true" transient="true" changeable="false" volatile="true" derived="true" ordered="false" - * @generated - */ - boolean isExtendedPort(); - - /** - * Returns whether the value of the '{@link org.eclipse.papyrus.FCM.PortKind#isExtendedPort Extended Port}' attribute is set. - * - * - * @return whether the value of the 'Extended Port' attribute is set. - * @see #isExtendedPort() - * @generated - */ - boolean isSetExtendedPort(); - -} // PortKind diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ProgLanguage.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ProgLanguage.java deleted file mode 100644 index 8458d640c94..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ProgLanguage.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Prog Language'. - * - * - * - * We assume that a model library defines a set of supported programming languages as well as a set of provided component to mappings. We do not use a fixed enumeration defined in the profile to assure extensibility - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.ProgLanguage#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getProgLanguage() - * @model - * @generated - */ -public interface ProgLanguage extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getProgLanguage_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.ProgLanguage#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // ProgLanguage diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/RuleApplication.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/RuleApplication.java deleted file mode 100644 index 5fedd0d9a3a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/RuleApplication.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Rule Application'. - * - * - * - * Apply a set of container rules. It can be applied to a single class or to a package, implying that all components within the package apply the specified rule. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.RuleApplication#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.RuleApplication#getContainerRule Container Rule}
  • - *
  • {@link org.eclipse.papyrus.FCM.RuleApplication#getBase_Package Base Package}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getRuleApplication() - * @model - * @generated - */ -public interface RuleApplication extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getRuleApplication_Base_Class() - * @model ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.RuleApplication#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - - /** - * Returns the value of the 'Container Rule' reference list. - * The list contents are of type {@link org.eclipse.papyrus.FCM.ContainerRule}. - * - *

- * If the meaning of the 'Container Rule' reference list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Container Rule' reference list. - * @see org.eclipse.papyrus.FCM.FCMPackage#getRuleApplication_ContainerRule() - * @model ordered="false" - * @generated - */ - EList getContainerRule(); - - /** - * Returns the value of the 'Base Package' reference. - * - *

- * If the meaning of the 'Base Package' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Package' reference. - * @see #setBase_Package(org.eclipse.uml2.uml.Package) - * @see org.eclipse.papyrus.FCM.FCMPackage#getRuleApplication_Base_Package() - * @model ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Package getBase_Package(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.RuleApplication#getBase_Package Base Package}' reference. - * - * - * @param value the new value of the 'Base Package' reference. - * @see #getBase_Package() - * @generated - */ - void setBase_Package(org.eclipse.uml2.uml.Package value); - -} // RuleApplication diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Singleton.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Singleton.java deleted file mode 100644 index 097280acf11..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Singleton.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Singleton'. - * - * - * - * Indicate that this component is instantiated only once within the system. It also implies that this component is automatically instantiated by a generated bootloader - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.Singleton#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getSingleton() - * @model - * @generated - */ -public interface Singleton extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getSingleton_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Singleton#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // Singleton diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Target.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Target.java deleted file mode 100644 index 41bf2accb32..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Target.java +++ /dev/null @@ -1,207 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Node; - -/** - * - * A representation of the model object 'Target'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.Target#getTargetArch Target Arch}
  • - *
  • {@link org.eclipse.papyrus.FCM.Target#getOptions Options}
  • - *
  • {@link org.eclipse.papyrus.FCM.Target#getBase_Node Base Node}
  • - *
  • {@link org.eclipse.papyrus.FCM.Target#getUsedOS Used OS}
  • - *
  • {@link org.eclipse.papyrus.FCM.Target#getAvailRAM Avail RAM}
  • - *
  • {@link org.eclipse.papyrus.FCM.Target#getAvailROM Avail ROM}
  • - *
  • {@link org.eclipse.papyrus.FCM.Target#getCompiler Compiler}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget() - * @model - * @generated - */ -public interface Target extends EObject { - /** - * Returns the value of the 'Target Arch' reference. - * - *

- * If the meaning of the 'Target Arch' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Target Arch' reference. - * @see #setTargetArch(TargetArchitecture) - * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_TargetArch() - * @model required="true" ordered="false" - * @generated - */ - TargetArchitecture getTargetArch(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Target#getTargetArch Target Arch}' reference. - * - * - * @param value the new value of the 'Target Arch' reference. - * @see #getTargetArch() - * @generated - */ - void setTargetArch(TargetArchitecture value); - - /** - * Returns the value of the 'Options' reference list. - * The list contents are of type {@link org.eclipse.papyrus.FCM.ConfigOption}. - * - *

- * If the meaning of the 'Options' reference list isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Options' reference list. - * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_Options() - * @model ordered="false" - * @generated - */ - EList getOptions(); - - /** - * Returns the value of the 'Base Node' reference. - * - *

- * If the meaning of the 'Base Node' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Node' reference. - * @see #setBase_Node(Node) - * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_Base_Node() - * @model required="true" ordered="false" - * @generated - */ - Node getBase_Node(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Target#getBase_Node Base Node}' reference. - * - * - * @param value the new value of the 'Base Node' reference. - * @see #getBase_Node() - * @generated - */ - void setBase_Node(Node value); - - /** - * Returns the value of the 'Used OS' reference. - * - *

- * If the meaning of the 'Used OS' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Used OS' reference. - * @see #setUsedOS(OperatingSystem) - * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_UsedOS() - * @model required="true" ordered="false" - * @generated - */ - OperatingSystem getUsedOS(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Target#getUsedOS Used OS}' reference. - * - * - * @param value the new value of the 'Used OS' reference. - * @see #getUsedOS() - * @generated - */ - void setUsedOS(OperatingSystem value); - - /** - * Returns the value of the 'Avail RAM' attribute. - * - *

- * If the meaning of the 'Avail RAM' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Avail RAM' attribute. - * @see #setAvailRAM(int) - * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_AvailRAM() - * @model dataType="org.eclipse.uml2.types.Integer" required="true" ordered="false" - * @generated - */ - int getAvailRAM(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Target#getAvailRAM Avail RAM}' attribute. - * - * - * @param value the new value of the 'Avail RAM' attribute. - * @see #getAvailRAM() - * @generated - */ - void setAvailRAM(int value); - - /** - * Returns the value of the 'Avail ROM' attribute. - * - *

- * If the meaning of the 'Avail ROM' attribute isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Avail ROM' attribute. - * @see #setAvailROM(int) - * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_AvailROM() - * @model dataType="org.eclipse.uml2.types.Integer" required="true" ordered="false" - * @generated - */ - int getAvailROM(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Target#getAvailROM Avail ROM}' attribute. - * - * - * @param value the new value of the 'Avail ROM' attribute. - * @see #getAvailROM() - * @generated - */ - void setAvailROM(int value); - - /** - * Returns the value of the 'Compiler' reference. - * - *

- * If the meaning of the 'Compiler' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Compiler' reference. - * @see #setCompiler(CompilerChain) - * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_Compiler() - * @model ordered="false" - * @generated - */ - CompilerChain getCompiler(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Target#getCompiler Compiler}' reference. - * - * - * @param value the new value of the 'Compiler' reference. - * @see #getCompiler() - * @generated - */ - void setCompiler(CompilerChain value); - -} // Target diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TargetArchitecture.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TargetArchitecture.java deleted file mode 100644 index 9d5c63c871a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TargetArchitecture.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Target Architecture'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.TargetArchitecture#getBase_Class Base Class}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getTargetArchitecture() - * @model - * @generated - */ -public interface TargetArchitecture extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getTargetArchitecture_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.TargetArchitecture#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - -} // TargetArchitecture diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Template.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Template.java deleted file mode 100644 index bf444e4e4b9..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Template.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.Element; - -/** - * - * A representation of the model object 'Template'. - * - * - * - * The template parameters list defines the parameters that are passed to the Acceleo template. If empty, the formal parameter list of the package template is used. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.Template#getBase_Element Base Element}
  • - *
  • {@link org.eclipse.papyrus.FCM.Template#getHelper Helper}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getTemplate() - * @model - * @generated - */ -public interface Template extends EObject { - /** - * Returns the value of the 'Base Element' reference. - * - *

- * If the meaning of the 'Base Element' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Element' reference. - * @see #setBase_Element(Element) - * @see org.eclipse.papyrus.FCM.FCMPackage#getTemplate_Base_Element() - * @model required="true" ordered="false" - * @generated - */ - Element getBase_Element(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Template#getBase_Element Base Element}' reference. - * - * - * @param value the new value of the 'Base Element' reference. - * @see #getBase_Element() - * @generated - */ - void setBase_Element(Element value); - - /** - * Returns the value of the 'Helper' reference. - * - *

- * If the meaning of the 'Helper' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Helper' reference. - * @see #setHelper(BindingHelper) - * @see org.eclipse.papyrus.FCM.FCMPackage#getTemplate_Helper() - * @model ordered="false" - * @generated - */ - BindingHelper getHelper(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.Template#getHelper Helper}' reference. - * - * - * @param value the new value of the 'Helper' reference. - * @see #getHelper() - * @generated - */ - void setHelper(BindingHelper value); - -} // Template diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TemplatePort.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TemplatePort.java deleted file mode 100644 index 77f0d02222f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TemplatePort.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - - -/** - * - * A representation of the model object 'Template Port'. - * - * - * - * Template ports are ports that enable the binding of an extended port with an actual parameter: the resulting port kind is the port kind bound to the current port type. - * For instance, we cound type a port with "MyType" and use an extended port Writer with a template with formal parameter T. Resulting port would be Writer with T bound to MyType. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.TemplatePort#getBoundType Bound Type}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getTemplatePort() - * @model - * @generated - */ -public interface TemplatePort extends Port { - /** - * Returns the value of the 'Bound Type' reference. - * - *

- * If the meaning of the 'Bound Type' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Bound Type' reference. - * @see #isSetBoundType() - * @see #unsetBoundType() - * @see #setBoundType(PortKind) - * @see org.eclipse.papyrus.FCM.FCMPackage#getTemplatePort_BoundType() - * @model unsettable="true" transient="true" volatile="true" derived="true" ordered="false" - * @generated - */ - PortKind getBoundType(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.TemplatePort#getBoundType Bound Type}' reference. - * - * - * @param value the new value of the 'Bound Type' reference. - * @see #isSetBoundType() - * @see #unsetBoundType() - * @see #getBoundType() - * @generated - */ - void setBoundType(PortKind value); - - /** - * Unsets the value of the '{@link org.eclipse.papyrus.FCM.TemplatePort#getBoundType Bound Type}' reference. - * - * - * @see #isSetBoundType() - * @see #getBoundType() - * @see #setBoundType(PortKind) - * @generated - */ - void unsetBoundType(); - - /** - * Returns whether the value of the '{@link org.eclipse.papyrus.FCM.TemplatePort#getBoundType Bound Type}' reference is set. - * - * - * @return whether the value of the 'Bound Type' reference is set. - * @see #unsetBoundType() - * @see #getBoundType() - * @see #setBoundType(PortKind) - * @generated - */ - boolean isSetBoundType(); - -} // TemplatePort diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/UseInstanceConfigurator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/UseInstanceConfigurator.java deleted file mode 100644 index f0232d7637f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/UseInstanceConfigurator.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Use Instance Configurator'. - * - * - * - * Use a dedicated component that that is responsible for configuring component instances. The concept is primarily intented for container extensions. For instance, a container extension might provide reflection data about a component. In this case, the instance configuration would create the value specifications using data available in the model - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.UseInstanceConfigurator#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.UseInstanceConfigurator#getConfigurator Configurator}
  • - *
- * - * @see org.eclipse.papyrus.FCM.FCMPackage#getUseInstanceConfigurator() - * @model - * @generated - */ -public interface UseInstanceConfigurator extends EObject { - /** - * Returns the value of the 'Base Class' reference. - * - *

- * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Base Class' reference. - * @see #setBase_Class(org.eclipse.uml2.uml.Class) - * @see org.eclipse.papyrus.FCM.FCMPackage#getUseInstanceConfigurator_Base_Class() - * @model required="true" ordered="false" - * @generated - */ - org.eclipse.uml2.uml.Class getBase_Class(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.UseInstanceConfigurator#getBase_Class Base Class}' reference. - * - * - * @param value the new value of the 'Base Class' reference. - * @see #getBase_Class() - * @generated - */ - void setBase_Class(org.eclipse.uml2.uml.Class value); - - /** - * Returns the value of the 'Configurator' reference. - * - *

- * If the meaning of the 'Configurator' reference isn't clear, there really should be more of a description here... - *

- * - * @return the value of the 'Configurator' reference. - * @see #setConfigurator(InstanceConfigurator) - * @see org.eclipse.papyrus.FCM.FCMPackage#getUseInstanceConfigurator_Configurator() - * @model required="true" ordered="false" - * @generated - */ - InstanceConfigurator getConfigurator(); - - /** - * Sets the value of the '{@link org.eclipse.papyrus.FCM.UseInstanceConfigurator#getConfigurator Configurator}' reference. - * - * - * @param value the new value of the 'Configurator' reference. - * @see #getConfigurator() - * @generated - */ - void setConfigurator(InstanceConfigurator value); - -} // UseInstanceConfigurator diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AssemblyImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AssemblyImpl.java deleted file mode 100644 index 8d53df41fe1..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AssemblyImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.Assembly; -import org.eclipse.papyrus.FCM.FCMPackage; - -/** - * - * An implementation of the model object 'Assembly'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.AssemblyImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class AssemblyImpl extends EObjectImpl implements Assembly { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected AssemblyImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.ASSEMBLY; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.ASSEMBLY__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.ASSEMBLY__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.ASSEMBLY__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.ASSEMBLY__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.ASSEMBLY__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.ASSEMBLY__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - -} // AssemblyImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexImpl.java deleted file mode 100644 index 9379bae368d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexImpl.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.AutoIndex; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.uml2.uml.Property; - -/** - * - * An implementation of the model object 'Auto Index'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.AutoIndexImpl#getBase_Property Base Property}
  • - *
- * - * @generated - */ -public class AutoIndexImpl extends EObjectImpl implements AutoIndex { - /** - * The cached value of the '{@link #getBase_Property() Base Property}' reference. - * - * - * @see #getBase_Property() - * @generated - * @ordered - */ - protected Property base_Property; - - /** - * - * - * @generated - */ - protected AutoIndexImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.AUTO_INDEX; - } - - /** - * - * - * @generated - */ - @Override - public Property getBase_Property() { - if (base_Property != null && base_Property.eIsProxy()) { - InternalEObject oldBase_Property = (InternalEObject)base_Property; - base_Property = (Property)eResolveProxy(oldBase_Property); - if (base_Property != oldBase_Property) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.AUTO_INDEX__BASE_PROPERTY, oldBase_Property, base_Property)); - } - } - return base_Property; - } - - /** - * - * - * @generated - */ - public Property basicGetBase_Property() { - return base_Property; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Property(Property newBase_Property) { - Property oldBase_Property = base_Property; - base_Property = newBase_Property; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.AUTO_INDEX__BASE_PROPERTY, oldBase_Property, base_Property)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.AUTO_INDEX__BASE_PROPERTY: - if (resolve) return getBase_Property(); - return basicGetBase_Property(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.AUTO_INDEX__BASE_PROPERTY: - setBase_Property((Property)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.AUTO_INDEX__BASE_PROPERTY: - setBase_Property((Property)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.AUTO_INDEX__BASE_PROPERTY: - return base_Property != null; - } - return super.eIsSet(featureID); - } - -} // AutoIndexImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexPerNodeImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexPerNodeImpl.java deleted file mode 100644 index ca4713734be..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexPerNodeImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.papyrus.FCM.AutoIndexPerNode; -import org.eclipse.papyrus.FCM.FCMPackage; - -/** - * - * An implementation of the model object 'Auto Index Per Node'. - * - * - * @generated - */ -public class AutoIndexPerNodeImpl extends AutoIndexImpl implements AutoIndexPerNode { - /** - * - * - * @generated - */ - protected AutoIndexPerNodeImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.AUTO_INDEX_PER_NODE; - } - -} // AutoIndexPerNodeImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindTemplateImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindTemplateImpl.java deleted file mode 100644 index 84097ab7ee5..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindTemplateImpl.java +++ /dev/null @@ -1,207 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.papyrus.FCM.BindTemplate; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; - -/** - * - * An implementation of the model object 'Bind Template'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.BindTemplateImpl#getActual Actual}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.BindTemplateImpl#getBase_Property Base Property}
  • - *
- * - * @generated - */ -public class BindTemplateImpl extends EObjectImpl implements BindTemplate { - /** - * The cached value of the '{@link #getActual() Actual}' reference list. - * - * - * @see #getActual() - * @generated - * @ordered - */ - protected EList actual; - - /** - * The cached value of the '{@link #getBase_Property() Base Property}' reference. - * - * - * @see #getBase_Property() - * @generated - * @ordered - */ - protected Property base_Property; - - /** - * - * - * @generated - */ - protected BindTemplateImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.BIND_TEMPLATE; - } - - /** - * - * - * @generated - */ - @Override - public EList getActual() { - if (actual == null) { - actual = new EObjectResolvingEList(Type.class, this, FCMPackage.BIND_TEMPLATE__ACTUAL); - } - return actual; - } - - /** - * - * - * @generated - */ - @Override - public Property getBase_Property() { - if (base_Property != null && base_Property.eIsProxy()) { - InternalEObject oldBase_Property = (InternalEObject)base_Property; - base_Property = (Property)eResolveProxy(oldBase_Property); - if (base_Property != oldBase_Property) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.BIND_TEMPLATE__BASE_PROPERTY, oldBase_Property, base_Property)); - } - } - return base_Property; - } - - /** - * - * - * @generated - */ - public Property basicGetBase_Property() { - return base_Property; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Property(Property newBase_Property) { - Property oldBase_Property = base_Property; - base_Property = newBase_Property; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.BIND_TEMPLATE__BASE_PROPERTY, oldBase_Property, base_Property)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.BIND_TEMPLATE__ACTUAL: - return getActual(); - case FCMPackage.BIND_TEMPLATE__BASE_PROPERTY: - if (resolve) return getBase_Property(); - return basicGetBase_Property(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.BIND_TEMPLATE__ACTUAL: - getActual().clear(); - getActual().addAll((Collection)newValue); - return; - case FCMPackage.BIND_TEMPLATE__BASE_PROPERTY: - setBase_Property((Property)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.BIND_TEMPLATE__ACTUAL: - getActual().clear(); - return; - case FCMPackage.BIND_TEMPLATE__BASE_PROPERTY: - setBase_Property((Property)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.BIND_TEMPLATE__ACTUAL: - return actual != null && !actual.isEmpty(); - case FCMPackage.BIND_TEMPLATE__BASE_PROPERTY: - return base_Property != null; - } - return super.eIsSet(featureID); - } - -} // BindTemplateImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindingHelperImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindingHelperImpl.java deleted file mode 100644 index cca6f30bf16..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindingHelperImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.BindingHelper; -import org.eclipse.papyrus.FCM.FCMPackage; - -/** - * - * An implementation of the model object 'Binding Helper'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.BindingHelperImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class BindingHelperImpl extends EObjectImpl implements BindingHelper { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected BindingHelperImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.BINDING_HELPER; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.BINDING_HELPER__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.BINDING_HELPER__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.BINDING_HELPER__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.BINDING_HELPER__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.BINDING_HELPER__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.BINDING_HELPER__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - -} // BindingHelperImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CodeGenOptionsImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CodeGenOptionsImpl.java deleted file mode 100644 index 87c4df5de26..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CodeGenOptionsImpl.java +++ /dev/null @@ -1,291 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.CodeGenOptions; -import org.eclipse.papyrus.FCM.CompToOOmapping; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.ProgLanguage; - -/** - * - * An implementation of the model object 'Code Gen Options'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl#getBase_Package Base Package}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl#getCompToOOmapping Comp To OOmapping}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl#getProgLanguage Prog Language}
  • - *
- * - * @generated - */ -public class CodeGenOptionsImpl extends EObjectImpl implements CodeGenOptions { - /** - * The cached value of the '{@link #getBase_Package() Base Package}' reference. - * - * - * @see #getBase_Package() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Package base_Package; - - /** - * The cached value of the '{@link #getCompToOOmapping() Comp To OOmapping}' reference. - * - * - * @see #getCompToOOmapping() - * @generated - * @ordered - */ - protected CompToOOmapping compToOOmapping; - - /** - * The cached value of the '{@link #getProgLanguage() Prog Language}' reference. - * - * - * @see #getProgLanguage() - * @generated - * @ordered - */ - protected ProgLanguage progLanguage; - - /** - * - * - * @generated - */ - protected CodeGenOptionsImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.CODE_GEN_OPTIONS; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Package getBase_Package() { - if (base_Package != null && base_Package.eIsProxy()) { - InternalEObject oldBase_Package = (InternalEObject)base_Package; - base_Package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_Package); - if (base_Package != oldBase_Package) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CODE_GEN_OPTIONS__BASE_PACKAGE, oldBase_Package, base_Package)); - } - } - return base_Package; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Package basicGetBase_Package() { - return base_Package; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { - org.eclipse.uml2.uml.Package oldBase_Package = base_Package; - base_Package = newBase_Package; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CODE_GEN_OPTIONS__BASE_PACKAGE, oldBase_Package, base_Package)); - } - - /** - * - * - * @generated - */ - @Override - public CompToOOmapping getCompToOOmapping() { - if (compToOOmapping != null && compToOOmapping.eIsProxy()) { - InternalEObject oldCompToOOmapping = (InternalEObject)compToOOmapping; - compToOOmapping = (CompToOOmapping)eResolveProxy(oldCompToOOmapping); - if (compToOOmapping != oldCompToOOmapping) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CODE_GEN_OPTIONS__COMP_TO_OOMAPPING, oldCompToOOmapping, compToOOmapping)); - } - } - return compToOOmapping; - } - - /** - * - * - * @generated - */ - public CompToOOmapping basicGetCompToOOmapping() { - return compToOOmapping; - } - - /** - * - * - * @generated - */ - @Override - public void setCompToOOmapping(CompToOOmapping newCompToOOmapping) { - CompToOOmapping oldCompToOOmapping = compToOOmapping; - compToOOmapping = newCompToOOmapping; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CODE_GEN_OPTIONS__COMP_TO_OOMAPPING, oldCompToOOmapping, compToOOmapping)); - } - - /** - * - * - * @generated - */ - @Override - public ProgLanguage getProgLanguage() { - if (progLanguage != null && progLanguage.eIsProxy()) { - InternalEObject oldProgLanguage = (InternalEObject)progLanguage; - progLanguage = (ProgLanguage)eResolveProxy(oldProgLanguage); - if (progLanguage != oldProgLanguage) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CODE_GEN_OPTIONS__PROG_LANGUAGE, oldProgLanguage, progLanguage)); - } - } - return progLanguage; - } - - /** - * - * - * @generated - */ - public ProgLanguage basicGetProgLanguage() { - return progLanguage; - } - - /** - * - * - * @generated - */ - @Override - public void setProgLanguage(ProgLanguage newProgLanguage) { - ProgLanguage oldProgLanguage = progLanguage; - progLanguage = newProgLanguage; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CODE_GEN_OPTIONS__PROG_LANGUAGE, oldProgLanguage, progLanguage)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.CODE_GEN_OPTIONS__BASE_PACKAGE: - if (resolve) return getBase_Package(); - return basicGetBase_Package(); - case FCMPackage.CODE_GEN_OPTIONS__COMP_TO_OOMAPPING: - if (resolve) return getCompToOOmapping(); - return basicGetCompToOOmapping(); - case FCMPackage.CODE_GEN_OPTIONS__PROG_LANGUAGE: - if (resolve) return getProgLanguage(); - return basicGetProgLanguage(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.CODE_GEN_OPTIONS__BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package)newValue); - return; - case FCMPackage.CODE_GEN_OPTIONS__COMP_TO_OOMAPPING: - setCompToOOmapping((CompToOOmapping)newValue); - return; - case FCMPackage.CODE_GEN_OPTIONS__PROG_LANGUAGE: - setProgLanguage((ProgLanguage)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.CODE_GEN_OPTIONS__BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package)null); - return; - case FCMPackage.CODE_GEN_OPTIONS__COMP_TO_OOMAPPING: - setCompToOOmapping((CompToOOmapping)null); - return; - case FCMPackage.CODE_GEN_OPTIONS__PROG_LANGUAGE: - setProgLanguage((ProgLanguage)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.CODE_GEN_OPTIONS__BASE_PACKAGE: - return base_Package != null; - case FCMPackage.CODE_GEN_OPTIONS__COMP_TO_OOMAPPING: - return compToOOmapping != null; - case FCMPackage.CODE_GEN_OPTIONS__PROG_LANGUAGE: - return progLanguage != null; - } - return super.eIsSet(featureID); - } - -} // CodeGenOptionsImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompImplTemplateImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompImplTemplateImpl.java deleted file mode 100644 index ef442c13a78..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompImplTemplateImpl.java +++ /dev/null @@ -1,235 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.CompImplTemplate; -import org.eclipse.papyrus.FCM.FCMPackage; - -/** - * - * An implementation of the model object 'Comp Impl Template'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.CompImplTemplateImpl#getTemplateDefs Template Defs}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.CompImplTemplateImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class CompImplTemplateImpl extends EObjectImpl implements CompImplTemplate { - /** - * The default value of the '{@link #getTemplateDefs() Template Defs}' attribute. - * - * - * @see #getTemplateDefs() - * @generated - * @ordered - */ - protected static final String TEMPLATE_DEFS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getTemplateDefs() Template Defs}' attribute. - * - * - * @see #getTemplateDefs() - * @generated - * @ordered - */ - protected String templateDefs = TEMPLATE_DEFS_EDEFAULT; - - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected CompImplTemplateImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.COMP_IMPL_TEMPLATE; - } - - /** - * - * - * @generated - */ - @Override - public String getTemplateDefs() { - return templateDefs; - } - - /** - * - * - * @generated - */ - @Override - public void setTemplateDefs(String newTemplateDefs) { - String oldTemplateDefs = templateDefs; - templateDefs = newTemplateDefs; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.COMP_IMPL_TEMPLATE__TEMPLATE_DEFS, oldTemplateDefs, templateDefs)); - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.COMP_IMPL_TEMPLATE__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.COMP_IMPL_TEMPLATE__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.COMP_IMPL_TEMPLATE__TEMPLATE_DEFS: - return getTemplateDefs(); - case FCMPackage.COMP_IMPL_TEMPLATE__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.COMP_IMPL_TEMPLATE__TEMPLATE_DEFS: - setTemplateDefs((String)newValue); - return; - case FCMPackage.COMP_IMPL_TEMPLATE__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.COMP_IMPL_TEMPLATE__TEMPLATE_DEFS: - setTemplateDefs(TEMPLATE_DEFS_EDEFAULT); - return; - case FCMPackage.COMP_IMPL_TEMPLATE__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.COMP_IMPL_TEMPLATE__TEMPLATE_DEFS: - return TEMPLATE_DEFS_EDEFAULT == null ? templateDefs != null : !TEMPLATE_DEFS_EDEFAULT.equals(templateDefs); - case FCMPackage.COMP_IMPL_TEMPLATE__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (templateDefs: "); //$NON-NLS-1$ - result.append(templateDefs); - result.append(')'); - return result.toString(); - } - -} // CompImplTemplateImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompToOOmappingImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompToOOmappingImpl.java deleted file mode 100644 index c8337d11912..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompToOOmappingImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.CompToOOmapping; -import org.eclipse.papyrus.FCM.FCMPackage; - -/** - * - * An implementation of the model object 'Comp To OOmapping'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.CompToOOmappingImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class CompToOOmappingImpl extends EObjectImpl implements CompToOOmapping { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected CompToOOmappingImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.COMP_TO_OOMAPPING; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.COMP_TO_OOMAPPING__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.COMP_TO_OOMAPPING__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.COMP_TO_OOMAPPING__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.COMP_TO_OOMAPPING__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.COMP_TO_OOMAPPING__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.COMP_TO_OOMAPPING__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - -} // CompToOOmappingImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompilerChainImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompilerChainImpl.java deleted file mode 100644 index 9f1edb84aa1..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompilerChainImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.CompilerChain; -import org.eclipse.papyrus.FCM.FCMPackage; - -/** - * - * An implementation of the model object 'Compiler Chain'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.CompilerChainImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class CompilerChainImpl extends EObjectImpl implements CompilerChain { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected CompilerChainImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.COMPILER_CHAIN; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.COMPILER_CHAIN__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.COMPILER_CHAIN__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.COMPILER_CHAIN__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.COMPILER_CHAIN__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.COMPILER_CHAIN__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.COMPILER_CHAIN__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - -} // CompilerChainImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigOptionImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigOptionImpl.java deleted file mode 100644 index ddf33cb0dbc..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigOptionImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.ConfigOption; -import org.eclipse.papyrus.FCM.FCMPackage; - -/** - * - * An implementation of the model object 'Config Option'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.ConfigOptionImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class ConfigOptionImpl extends EObjectImpl implements ConfigOption { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected ConfigOptionImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.CONFIG_OPTION; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONFIG_OPTION__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONFIG_OPTION__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.CONFIG_OPTION__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.CONFIG_OPTION__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.CONFIG_OPTION__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.CONFIG_OPTION__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - -} // ConfigOptionImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurableElementInstanceImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurableElementInstanceImpl.java deleted file mode 100644 index fb9e509e607..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurableElementInstanceImpl.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.ConfigurableElementInstance; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * An implementation of the model object 'Configurable Element Instance'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.ConfigurableElementInstanceImpl#getConfiguration Configuration}
  • - *
- * - * @generated - */ -public abstract class ConfigurableElementInstanceImpl extends EObjectImpl implements ConfigurableElementInstance { - /** - * The cached value of the '{@link #getConfiguration() Configuration}' reference. - * - * - * @see #getConfiguration() - * @generated - * @ordered - */ - protected InstanceSpecification configuration; - - /** - * - * - * @generated - */ - protected ConfigurableElementInstanceImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.CONFIGURABLE_ELEMENT_INSTANCE; - } - - /** - * - * - * @generated - */ - @Override - public InstanceSpecification getConfiguration() { - if (configuration != null && configuration.eIsProxy()) { - InternalEObject oldConfiguration = (InternalEObject)configuration; - configuration = (InstanceSpecification)eResolveProxy(oldConfiguration); - if (configuration != oldConfiguration) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION, oldConfiguration, configuration)); - } - } - return configuration; - } - - /** - * - * - * @generated - */ - public InstanceSpecification basicGetConfiguration() { - return configuration; - } - - /** - * - * - * @generated - */ - @Override - public void setConfiguration(InstanceSpecification newConfiguration) { - InstanceSpecification oldConfiguration = configuration; - configuration = newConfiguration; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION, oldConfiguration, configuration)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION: - if (resolve) return getConfiguration(); - return basicGetConfiguration(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION: - setConfiguration((InstanceSpecification)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION: - setConfiguration((InstanceSpecification)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION: - return configuration != null; - } - return super.eIsSet(featureID); - } - -} // ConfigurableElementInstanceImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationImpl.java deleted file mode 100644 index b4910abb934..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationImpl.java +++ /dev/null @@ -1,269 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.papyrus.FCM.ConfigOption; -import org.eclipse.papyrus.FCM.Configuration; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.FCM.FCMPackage; - -/** - * - * An implementation of the model object 'Configuration'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.ConfigurationImpl#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.ConfigurationImpl#getConfigOptions Config Options}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.ConfigurationImpl#getDeploymentPlan Deployment Plan}
  • - *
- * - * @generated - */ -public class ConfigurationImpl extends EObjectImpl implements Configuration { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * The cached value of the '{@link #getConfigOptions() Config Options}' reference list. - * - * - * @see #getConfigOptions() - * @generated - * @ordered - */ - protected EList configOptions; - - /** - * The cached value of the '{@link #getDeploymentPlan() Deployment Plan}' reference. - * - * - * @see #getDeploymentPlan() - * @generated - * @ordered - */ - protected DeploymentPlan deploymentPlan; - - /** - * - * - * @generated - */ - protected ConfigurationImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.CONFIGURATION; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONFIGURATION__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONFIGURATION__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public EList getConfigOptions() { - if (configOptions == null) { - configOptions = new EObjectResolvingEList(ConfigOption.class, this, FCMPackage.CONFIGURATION__CONFIG_OPTIONS); - } - return configOptions; - } - - /** - * - * - * @generated - */ - @Override - public DeploymentPlan getDeploymentPlan() { - if (deploymentPlan != null && deploymentPlan.eIsProxy()) { - InternalEObject oldDeploymentPlan = (InternalEObject)deploymentPlan; - deploymentPlan = (DeploymentPlan)eResolveProxy(oldDeploymentPlan); - if (deploymentPlan != oldDeploymentPlan) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONFIGURATION__DEPLOYMENT_PLAN, oldDeploymentPlan, deploymentPlan)); - } - } - return deploymentPlan; - } - - /** - * - * - * @generated - */ - public DeploymentPlan basicGetDeploymentPlan() { - return deploymentPlan; - } - - /** - * - * - * @generated - */ - @Override - public void setDeploymentPlan(DeploymentPlan newDeploymentPlan) { - DeploymentPlan oldDeploymentPlan = deploymentPlan; - deploymentPlan = newDeploymentPlan; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONFIGURATION__DEPLOYMENT_PLAN, oldDeploymentPlan, deploymentPlan)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.CONFIGURATION__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - case FCMPackage.CONFIGURATION__CONFIG_OPTIONS: - return getConfigOptions(); - case FCMPackage.CONFIGURATION__DEPLOYMENT_PLAN: - if (resolve) return getDeploymentPlan(); - return basicGetDeploymentPlan(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.CONFIGURATION__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - case FCMPackage.CONFIGURATION__CONFIG_OPTIONS: - getConfigOptions().clear(); - getConfigOptions().addAll((Collection)newValue); - return; - case FCMPackage.CONFIGURATION__DEPLOYMENT_PLAN: - setDeploymentPlan((DeploymentPlan)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.CONFIGURATION__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - case FCMPackage.CONFIGURATION__CONFIG_OPTIONS: - getConfigOptions().clear(); - return; - case FCMPackage.CONFIGURATION__DEPLOYMENT_PLAN: - setDeploymentPlan((DeploymentPlan)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.CONFIGURATION__BASE_CLASS: - return base_Class != null; - case FCMPackage.CONFIGURATION__CONFIG_OPTIONS: - return configOptions != null && !configOptions.isEmpty(); - case FCMPackage.CONFIGURATION__DEPLOYMENT_PLAN: - return deploymentPlan != null; - } - return super.eIsSet(featureID); - } - -} // ConfigurationImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationPropertyImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationPropertyImpl.java deleted file mode 100644 index 38eab69aac7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationPropertyImpl.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.ConfigurationProperty; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.uml2.uml.Property; - -/** - * - * An implementation of the model object 'Configuration Property'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.ConfigurationPropertyImpl#getBase_Property Base Property}
  • - *
- * - * @generated - */ -public class ConfigurationPropertyImpl extends EObjectImpl implements ConfigurationProperty { - /** - * The cached value of the '{@link #getBase_Property() Base Property}' reference. - * - * - * @see #getBase_Property() - * @generated - * @ordered - */ - protected Property base_Property; - - /** - * - * - * @generated - */ - protected ConfigurationPropertyImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.CONFIGURATION_PROPERTY; - } - - /** - * - * - * @generated - */ - @Override - public Property getBase_Property() { - if (base_Property != null && base_Property.eIsProxy()) { - InternalEObject oldBase_Property = (InternalEObject)base_Property; - base_Property = (Property)eResolveProxy(oldBase_Property); - if (base_Property != oldBase_Property) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONFIGURATION_PROPERTY__BASE_PROPERTY, oldBase_Property, base_Property)); - } - } - return base_Property; - } - - /** - * - * - * @generated - */ - public Property basicGetBase_Property() { - return base_Property; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Property(Property newBase_Property) { - Property oldBase_Property = base_Property; - base_Property = newBase_Property; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONFIGURATION_PROPERTY__BASE_PROPERTY, oldBase_Property, base_Property)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.CONFIGURATION_PROPERTY__BASE_PROPERTY: - if (resolve) return getBase_Property(); - return basicGetBase_Property(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.CONFIGURATION_PROPERTY__BASE_PROPERTY: - setBase_Property((Property)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.CONFIGURATION_PROPERTY__BASE_PROPERTY: - setBase_Property((Property)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.CONFIGURATION_PROPERTY__BASE_PROPERTY: - return base_Property != null; - } - return super.eIsSet(featureID); - } - -} // ConfigurationPropertyImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorConfigurationImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorConfigurationImpl.java deleted file mode 100644 index 21bc4a77305..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorConfigurationImpl.java +++ /dev/null @@ -1,229 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.Connector; -import org.eclipse.papyrus.FCM.ConnectorConfiguration; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.uml2.uml.Slot; - -/** - * - * An implementation of the model object 'Connector Configuration'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.ConnectorConfigurationImpl#getBase_Slot Base Slot}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.ConnectorConfigurationImpl#getConnector Connector}
  • - *
- * - * @generated - */ -public class ConnectorConfigurationImpl extends EObjectImpl implements ConnectorConfiguration { - /** - * The cached value of the '{@link #getBase_Slot() Base Slot}' reference. - * - * - * @see #getBase_Slot() - * @generated - * @ordered - */ - protected Slot base_Slot; - - /** - * The cached value of the '{@link #getConnector() Connector}' reference. - * - * - * @see #getConnector() - * @generated - * @ordered - */ - protected Connector connector; - - /** - * - * - * @generated - */ - protected ConnectorConfigurationImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.CONNECTOR_CONFIGURATION; - } - - /** - * - * - * @generated - */ - @Override - public Slot getBase_Slot() { - if (base_Slot != null && base_Slot.eIsProxy()) { - InternalEObject oldBase_Slot = (InternalEObject)base_Slot; - base_Slot = (Slot)eResolveProxy(oldBase_Slot); - if (base_Slot != oldBase_Slot) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONNECTOR_CONFIGURATION__BASE_SLOT, oldBase_Slot, base_Slot)); - } - } - return base_Slot; - } - - /** - * - * - * @generated - */ - public Slot basicGetBase_Slot() { - return base_Slot; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Slot(Slot newBase_Slot) { - Slot oldBase_Slot = base_Slot; - base_Slot = newBase_Slot; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONNECTOR_CONFIGURATION__BASE_SLOT, oldBase_Slot, base_Slot)); - } - - /** - * - * - * @generated - */ - @Override - public Connector getConnector() { - if (connector != null && connector.eIsProxy()) { - InternalEObject oldConnector = (InternalEObject)connector; - connector = (Connector)eResolveProxy(oldConnector); - if (connector != oldConnector) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONNECTOR_CONFIGURATION__CONNECTOR, oldConnector, connector)); - } - } - return connector; - } - - /** - * - * - * @generated - */ - public Connector basicGetConnector() { - return connector; - } - - /** - * - * - * @generated - */ - @Override - public void setConnector(Connector newConnector) { - Connector oldConnector = connector; - connector = newConnector; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONNECTOR_CONFIGURATION__CONNECTOR, oldConnector, connector)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.CONNECTOR_CONFIGURATION__BASE_SLOT: - if (resolve) return getBase_Slot(); - return basicGetBase_Slot(); - case FCMPackage.CONNECTOR_CONFIGURATION__CONNECTOR: - if (resolve) return getConnector(); - return basicGetConnector(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.CONNECTOR_CONFIGURATION__BASE_SLOT: - setBase_Slot((Slot)newValue); - return; - case FCMPackage.CONNECTOR_CONFIGURATION__CONNECTOR: - setConnector((Connector)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.CONNECTOR_CONFIGURATION__BASE_SLOT: - setBase_Slot((Slot)null); - return; - case FCMPackage.CONNECTOR_CONFIGURATION__CONNECTOR: - setConnector((Connector)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.CONNECTOR_CONFIGURATION__BASE_SLOT: - return base_Slot != null; - case FCMPackage.CONNECTOR_CONFIGURATION__CONNECTOR: - return connector != null; - } - return super.eIsSet(featureID); - } - -} // ConnectorConfigurationImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorImpl.java deleted file mode 100644 index fc4c4381033..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorImpl.java +++ /dev/null @@ -1,290 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.papyrus.FCM.Connector; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.uml2.uml.Property; - -/** - * - * An implementation of the model object 'Connector'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.ConnectorImpl#getBase_Connector Base Connector}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.ConnectorImpl#getIc Ic}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.ConnectorImpl#getBase_Property Base Property}
  • - *
- * - * @generated - */ -public class ConnectorImpl extends ConfigurableElementInstanceImpl implements Connector { - /** - * The cached value of the '{@link #getBase_Connector() Base Connector}' reference. - * - * - * @see #getBase_Connector() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Connector base_Connector; - - /** - * The cached value of the '{@link #getIc() Ic}' reference. - * - * - * @see #getIc() - * @generated - * @ordered - */ - protected InteractionComponent ic; - - /** - * The cached value of the '{@link #getBase_Property() Base Property}' reference. - * - * - * @see #getBase_Property() - * @generated - * @ordered - */ - protected Property base_Property; - - /** - * - * - * @generated - */ - protected ConnectorImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.CONNECTOR; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Connector getBase_Connector() { - if (base_Connector != null && base_Connector.eIsProxy()) { - InternalEObject oldBase_Connector = (InternalEObject)base_Connector; - base_Connector = (org.eclipse.uml2.uml.Connector)eResolveProxy(oldBase_Connector); - if (base_Connector != oldBase_Connector) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONNECTOR__BASE_CONNECTOR, oldBase_Connector, base_Connector)); - } - } - return base_Connector; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Connector basicGetBase_Connector() { - return base_Connector; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Connector(org.eclipse.uml2.uml.Connector newBase_Connector) { - org.eclipse.uml2.uml.Connector oldBase_Connector = base_Connector; - base_Connector = newBase_Connector; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONNECTOR__BASE_CONNECTOR, oldBase_Connector, base_Connector)); - } - - /** - * - * - * @generated - */ - @Override - public InteractionComponent getIc() { - if (ic != null && ic.eIsProxy()) { - InternalEObject oldIc = (InternalEObject)ic; - ic = (InteractionComponent)eResolveProxy(oldIc); - if (ic != oldIc) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONNECTOR__IC, oldIc, ic)); - } - } - return ic; - } - - /** - * - * - * @generated - */ - public InteractionComponent basicGetIc() { - return ic; - } - - /** - * - * - * @generated - */ - @Override - public void setIc(InteractionComponent newIc) { - InteractionComponent oldIc = ic; - ic = newIc; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONNECTOR__IC, oldIc, ic)); - } - - /** - * - * - * @generated - */ - @Override - public Property getBase_Property() { - if (base_Property != null && base_Property.eIsProxy()) { - InternalEObject oldBase_Property = (InternalEObject)base_Property; - base_Property = (Property)eResolveProxy(oldBase_Property); - if (base_Property != oldBase_Property) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONNECTOR__BASE_PROPERTY, oldBase_Property, base_Property)); - } - } - return base_Property; - } - - /** - * - * - * @generated - */ - public Property basicGetBase_Property() { - return base_Property; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Property(Property newBase_Property) { - Property oldBase_Property = base_Property; - base_Property = newBase_Property; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONNECTOR__BASE_PROPERTY, oldBase_Property, base_Property)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.CONNECTOR__BASE_CONNECTOR: - if (resolve) return getBase_Connector(); - return basicGetBase_Connector(); - case FCMPackage.CONNECTOR__IC: - if (resolve) return getIc(); - return basicGetIc(); - case FCMPackage.CONNECTOR__BASE_PROPERTY: - if (resolve) return getBase_Property(); - return basicGetBase_Property(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.CONNECTOR__BASE_CONNECTOR: - setBase_Connector((org.eclipse.uml2.uml.Connector)newValue); - return; - case FCMPackage.CONNECTOR__IC: - setIc((InteractionComponent)newValue); - return; - case FCMPackage.CONNECTOR__BASE_PROPERTY: - setBase_Property((Property)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.CONNECTOR__BASE_CONNECTOR: - setBase_Connector((org.eclipse.uml2.uml.Connector)null); - return; - case FCMPackage.CONNECTOR__IC: - setIc((InteractionComponent)null); - return; - case FCMPackage.CONNECTOR__BASE_PROPERTY: - setBase_Property((Property)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.CONNECTOR__BASE_CONNECTOR: - return base_Connector != null; - case FCMPackage.CONNECTOR__IC: - return ic != null; - case FCMPackage.CONNECTOR__BASE_PROPERTY: - return base_Property != null; - } - return super.eIsSet(featureID); - } - -} // ConnectorImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ContainerRuleImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ContainerRuleImpl.java deleted file mode 100644 index 8b705f5b4fb..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ContainerRuleImpl.java +++ /dev/null @@ -1,277 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.papyrus.FCM.ConfigOption; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.ContainerRuleKind; -import org.eclipse.papyrus.FCM.FCMPackage; - -/** - * - * An implementation of the model object 'Container Rule'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.ContainerRuleImpl#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.ContainerRuleImpl#getForConfig For Config}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.ContainerRuleImpl#getKind Kind}
  • - *
- * - * @generated - */ -public class ContainerRuleImpl extends EObjectImpl implements ContainerRule { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * The cached value of the '{@link #getForConfig() For Config}' reference list. - * - * - * @see #getForConfig() - * @generated - * @ordered - */ - protected EList forConfig; - - /** - * The default value of the '{@link #getKind() Kind}' attribute. - * - * - * @see #getKind() - * @generated - * @ordered - */ - protected static final ContainerRuleKind KIND_EDEFAULT = ContainerRuleKind.COMPONENT_RULE; - - /** - * The cached value of the '{@link #getKind() Kind}' attribute. - * - * - * @see #getKind() - * @generated - * @ordered - */ - protected ContainerRuleKind kind = KIND_EDEFAULT; - - /** - * - * - * @generated - */ - protected ContainerRuleImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.CONTAINER_RULE; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONTAINER_RULE__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONTAINER_RULE__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public EList getForConfig() { - if (forConfig == null) { - forConfig = new EObjectResolvingEList(ConfigOption.class, this, FCMPackage.CONTAINER_RULE__FOR_CONFIG); - } - return forConfig; - } - - /** - * - * - * @generated - */ - @Override - public ContainerRuleKind getKind() { - return kind; - } - - /** - * - * - * @generated - */ - @Override - public void setKind(ContainerRuleKind newKind) { - ContainerRuleKind oldKind = kind; - kind = newKind == null ? KIND_EDEFAULT : newKind; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONTAINER_RULE__KIND, oldKind, kind)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.CONTAINER_RULE__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - case FCMPackage.CONTAINER_RULE__FOR_CONFIG: - return getForConfig(); - case FCMPackage.CONTAINER_RULE__KIND: - return getKind(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.CONTAINER_RULE__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - case FCMPackage.CONTAINER_RULE__FOR_CONFIG: - getForConfig().clear(); - getForConfig().addAll((Collection)newValue); - return; - case FCMPackage.CONTAINER_RULE__KIND: - setKind((ContainerRuleKind)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.CONTAINER_RULE__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - case FCMPackage.CONTAINER_RULE__FOR_CONFIG: - getForConfig().clear(); - return; - case FCMPackage.CONTAINER_RULE__KIND: - setKind(KIND_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.CONTAINER_RULE__BASE_CLASS: - return base_Class != null; - case FCMPackage.CONTAINER_RULE__FOR_CONFIG: - return forConfig != null && !forConfig.isEmpty(); - case FCMPackage.CONTAINER_RULE__KIND: - return kind != KIND_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (kind: "); //$NON-NLS-1$ - result.append(kind); - result.append(')'); - return result.toString(); - } - -} // ContainerRuleImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CopyAttributeValueImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CopyAttributeValueImpl.java deleted file mode 100644 index bc73efb61af..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CopyAttributeValueImpl.java +++ /dev/null @@ -1,228 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.CopyAttributeValue; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.uml2.uml.Property; - -/** - * - * An implementation of the model object 'Copy Attribute Value'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.CopyAttributeValueImpl#getSource Source}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.CopyAttributeValueImpl#getBase_Property Base Property}
  • - *
- * - * @generated - */ -public class CopyAttributeValueImpl extends EObjectImpl implements CopyAttributeValue { - /** - * The cached value of the '{@link #getSource() Source}' reference. - * - * - * @see #getSource() - * @generated - * @ordered - */ - protected Property source; - - /** - * The cached value of the '{@link #getBase_Property() Base Property}' reference. - * - * - * @see #getBase_Property() - * @generated - * @ordered - */ - protected Property base_Property; - - /** - * - * - * @generated - */ - protected CopyAttributeValueImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.COPY_ATTRIBUTE_VALUE; - } - - /** - * - * - * @generated - */ - @Override - public Property getSource() { - if (source != null && source.eIsProxy()) { - InternalEObject oldSource = (InternalEObject)source; - source = (Property)eResolveProxy(oldSource); - if (source != oldSource) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.COPY_ATTRIBUTE_VALUE__SOURCE, oldSource, source)); - } - } - return source; - } - - /** - * - * - * @generated - */ - public Property basicGetSource() { - return source; - } - - /** - * - * - * @generated - */ - @Override - public void setSource(Property newSource) { - Property oldSource = source; - source = newSource; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.COPY_ATTRIBUTE_VALUE__SOURCE, oldSource, source)); - } - - /** - * - * - * @generated - */ - @Override - public Property getBase_Property() { - if (base_Property != null && base_Property.eIsProxy()) { - InternalEObject oldBase_Property = (InternalEObject)base_Property; - base_Property = (Property)eResolveProxy(oldBase_Property); - if (base_Property != oldBase_Property) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.COPY_ATTRIBUTE_VALUE__BASE_PROPERTY, oldBase_Property, base_Property)); - } - } - return base_Property; - } - - /** - * - * - * @generated - */ - public Property basicGetBase_Property() { - return base_Property; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Property(Property newBase_Property) { - Property oldBase_Property = base_Property; - base_Property = newBase_Property; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.COPY_ATTRIBUTE_VALUE__BASE_PROPERTY, oldBase_Property, base_Property)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.COPY_ATTRIBUTE_VALUE__SOURCE: - if (resolve) return getSource(); - return basicGetSource(); - case FCMPackage.COPY_ATTRIBUTE_VALUE__BASE_PROPERTY: - if (resolve) return getBase_Property(); - return basicGetBase_Property(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.COPY_ATTRIBUTE_VALUE__SOURCE: - setSource((Property)newValue); - return; - case FCMPackage.COPY_ATTRIBUTE_VALUE__BASE_PROPERTY: - setBase_Property((Property)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.COPY_ATTRIBUTE_VALUE__SOURCE: - setSource((Property)null); - return; - case FCMPackage.COPY_ATTRIBUTE_VALUE__BASE_PROPERTY: - setBase_Property((Property)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.COPY_ATTRIBUTE_VALUE__SOURCE: - return source != null; - case FCMPackage.COPY_ATTRIBUTE_VALUE__BASE_PROPERTY: - return base_Property != null; - } - return super.eIsSet(featureID); - } - -} // CopyAttributeValueImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DeploymentPlanImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DeploymentPlanImpl.java deleted file mode 100644 index eeec84970e5..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DeploymentPlanImpl.java +++ /dev/null @@ -1,228 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.uml2.uml.InstanceSpecification; - -/** - * - * An implementation of the model object 'Deployment Plan'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.DeploymentPlanImpl#getMainInstance Main Instance}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.DeploymentPlanImpl#getBase_Package Base Package}
  • - *
- * - * @generated - */ -public class DeploymentPlanImpl extends EObjectImpl implements DeploymentPlan { - /** - * The cached value of the '{@link #getMainInstance() Main Instance}' reference. - * - * - * @see #getMainInstance() - * @generated - * @ordered - */ - protected InstanceSpecification mainInstance; - - /** - * The cached value of the '{@link #getBase_Package() Base Package}' reference. - * - * - * @see #getBase_Package() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Package base_Package; - - /** - * - * - * @generated - */ - protected DeploymentPlanImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.DEPLOYMENT_PLAN; - } - - /** - * - * - * @generated - */ - @Override - public InstanceSpecification getMainInstance() { - if (mainInstance != null && mainInstance.eIsProxy()) { - InternalEObject oldMainInstance = (InternalEObject)mainInstance; - mainInstance = (InstanceSpecification)eResolveProxy(oldMainInstance); - if (mainInstance != oldMainInstance) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.DEPLOYMENT_PLAN__MAIN_INSTANCE, oldMainInstance, mainInstance)); - } - } - return mainInstance; - } - - /** - * - * - * @generated - */ - public InstanceSpecification basicGetMainInstance() { - return mainInstance; - } - - /** - * - * - * @generated - */ - @Override - public void setMainInstance(InstanceSpecification newMainInstance) { - InstanceSpecification oldMainInstance = mainInstance; - mainInstance = newMainInstance; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.DEPLOYMENT_PLAN__MAIN_INSTANCE, oldMainInstance, mainInstance)); - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Package getBase_Package() { - if (base_Package != null && base_Package.eIsProxy()) { - InternalEObject oldBase_Package = (InternalEObject)base_Package; - base_Package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_Package); - if (base_Package != oldBase_Package) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.DEPLOYMENT_PLAN__BASE_PACKAGE, oldBase_Package, base_Package)); - } - } - return base_Package; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Package basicGetBase_Package() { - return base_Package; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { - org.eclipse.uml2.uml.Package oldBase_Package = base_Package; - base_Package = newBase_Package; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.DEPLOYMENT_PLAN__BASE_PACKAGE, oldBase_Package, base_Package)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.DEPLOYMENT_PLAN__MAIN_INSTANCE: - if (resolve) return getMainInstance(); - return basicGetMainInstance(); - case FCMPackage.DEPLOYMENT_PLAN__BASE_PACKAGE: - if (resolve) return getBase_Package(); - return basicGetBase_Package(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.DEPLOYMENT_PLAN__MAIN_INSTANCE: - setMainInstance((InstanceSpecification)newValue); - return; - case FCMPackage.DEPLOYMENT_PLAN__BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.DEPLOYMENT_PLAN__MAIN_INSTANCE: - setMainInstance((InstanceSpecification)null); - return; - case FCMPackage.DEPLOYMENT_PLAN__BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.DEPLOYMENT_PLAN__MAIN_INSTANCE: - return mainInstance != null; - case FCMPackage.DEPLOYMENT_PLAN__BASE_PACKAGE: - return base_Package != null; - } - return super.eIsSet(featureID); - } - -} // DeploymentPlanImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DerivedElementImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DerivedElementImpl.java deleted file mode 100644 index 3217b6ff94e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DerivedElementImpl.java +++ /dev/null @@ -1,228 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.uml2.uml.Element; - -/** - * - * An implementation of the model object 'Derived Element'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.DerivedElementImpl#getBase_Element Base Element}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.DerivedElementImpl#getSource Source}
  • - *
- * - * @generated - */ -public class DerivedElementImpl extends EObjectImpl implements DerivedElement { - /** - * The cached value of the '{@link #getBase_Element() Base Element}' reference. - * - * - * @see #getBase_Element() - * @generated - * @ordered - */ - protected Element base_Element; - - /** - * The cached value of the '{@link #getSource() Source}' reference. - * - * - * @see #getSource() - * @generated - * @ordered - */ - protected Element source; - - /** - * - * - * @generated - */ - protected DerivedElementImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.DERIVED_ELEMENT; - } - - /** - * - * - * @generated - */ - @Override - public Element getBase_Element() { - if (base_Element != null && base_Element.eIsProxy()) { - InternalEObject oldBase_Element = (InternalEObject)base_Element; - base_Element = (Element)eResolveProxy(oldBase_Element); - if (base_Element != oldBase_Element) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.DERIVED_ELEMENT__BASE_ELEMENT, oldBase_Element, base_Element)); - } - } - return base_Element; - } - - /** - * - * - * @generated - */ - public Element basicGetBase_Element() { - return base_Element; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Element(Element newBase_Element) { - Element oldBase_Element = base_Element; - base_Element = newBase_Element; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.DERIVED_ELEMENT__BASE_ELEMENT, oldBase_Element, base_Element)); - } - - /** - * - * - * @generated - */ - @Override - public Element getSource() { - if (source != null && source.eIsProxy()) { - InternalEObject oldSource = (InternalEObject)source; - source = (Element)eResolveProxy(oldSource); - if (source != oldSource) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.DERIVED_ELEMENT__SOURCE, oldSource, source)); - } - } - return source; - } - - /** - * - * - * @generated - */ - public Element basicGetSource() { - return source; - } - - /** - * - * - * @generated - */ - @Override - public void setSource(Element newSource) { - Element oldSource = source; - source = newSource; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.DERIVED_ELEMENT__SOURCE, oldSource, source)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.DERIVED_ELEMENT__BASE_ELEMENT: - if (resolve) return getBase_Element(); - return basicGetBase_Element(); - case FCMPackage.DERIVED_ELEMENT__SOURCE: - if (resolve) return getSource(); - return basicGetSource(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.DERIVED_ELEMENT__BASE_ELEMENT: - setBase_Element((Element)newValue); - return; - case FCMPackage.DERIVED_ELEMENT__SOURCE: - setSource((Element)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.DERIVED_ELEMENT__BASE_ELEMENT: - setBase_Element((Element)null); - return; - case FCMPackage.DERIVED_ELEMENT__SOURCE: - setSource((Element)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.DERIVED_ELEMENT__BASE_ELEMENT: - return base_Element != null; - case FCMPackage.DERIVED_ELEMENT__SOURCE: - return source != null; - } - return super.eIsSet(featureID); - } - -} // DerivedElementImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMFactoryImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMFactoryImpl.java deleted file mode 100644 index 9cd6ea0b76d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMFactoryImpl.java +++ /dev/null @@ -1,652 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.impl.EFactoryImpl; -import org.eclipse.emf.ecore.plugin.EcorePlugin; -import org.eclipse.papyrus.FCM.*; -import org.eclipse.papyrus.FCM.Assembly; -import org.eclipse.papyrus.FCM.AutoIndex; -import org.eclipse.papyrus.FCM.AutoIndexPerNode; -import org.eclipse.papyrus.FCM.BindTemplate; -import org.eclipse.papyrus.FCM.BindingHelper; -import org.eclipse.papyrus.FCM.CodeGenOptions; -import org.eclipse.papyrus.FCM.CompImplTemplate; -import org.eclipse.papyrus.FCM.CompToOOmapping; -import org.eclipse.papyrus.FCM.CompilerChain; -import org.eclipse.papyrus.FCM.ConfigOption; -import org.eclipse.papyrus.FCM.Configuration; -import org.eclipse.papyrus.FCM.ConfigurationProperty; -import org.eclipse.papyrus.FCM.Connector; -import org.eclipse.papyrus.FCM.ConnectorConfiguration; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.ContainerRuleKind; -import org.eclipse.papyrus.FCM.CopyAttributeValue; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.FCM.FCMFactory; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.Flatten; -import org.eclipse.papyrus.FCM.Fragment; -import org.eclipse.papyrus.FCM.ImplementationGroup; -import org.eclipse.papyrus.FCM.ImplementationProperties; -import org.eclipse.papyrus.FCM.InitPrecedence; -import org.eclipse.papyrus.FCM.InstanceConfigurator; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.FCM.InterceptionKind; -import org.eclipse.papyrus.FCM.InterceptionRule; -import org.eclipse.papyrus.FCM.OperatingSystem; -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.PortKind; -import org.eclipse.papyrus.FCM.ProgLanguage; -import org.eclipse.papyrus.FCM.RuleApplication; -import org.eclipse.papyrus.FCM.Singleton; -import org.eclipse.papyrus.FCM.Target; -import org.eclipse.papyrus.FCM.TargetArchitecture; -import org.eclipse.papyrus.FCM.Template; -import org.eclipse.papyrus.FCM.TemplatePort; -import org.eclipse.papyrus.FCM.UseInstanceConfigurator; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class FCMFactoryImpl extends EFactoryImpl implements FCMFactory { - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static FCMFactory init() { - try { - FCMFactory theFCMFactory = (FCMFactory)EPackage.Registry.INSTANCE.getEFactory(FCMPackage.eNS_URI); - if (theFCMFactory != null) { - return theFCMFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new FCMFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public FCMFactoryImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case FCMPackage.TEMPLATE: return createTemplate(); - case FCMPackage.BINDING_HELPER: return createBindingHelper(); - case FCMPackage.CONFIGURATION_PROPERTY: return createConfigurationProperty(); - case FCMPackage.IMPLEMENTATION_GROUP: return createImplementationGroup(); - case FCMPackage.ASSEMBLY: return createAssembly(); - case FCMPackage.FLATTEN: return createFlatten(); - case FCMPackage.COMP_TO_OOMAPPING: return createCompToOOmapping(); - case FCMPackage.PROG_LANGUAGE: return createProgLanguage(); - case FCMPackage.CODE_GEN_OPTIONS: return createCodeGenOptions(); - case FCMPackage.INTERACTION_COMPONENT: return createInteractionComponent(); - case FCMPackage.SINGLETON: return createSingleton(); - case FCMPackage.CONNECTOR: return createConnector(); - case FCMPackage.USE_INSTANCE_CONFIGURATOR: return createUseInstanceConfigurator(); - case FCMPackage.INSTANCE_CONFIGURATOR: return createInstanceConfigurator(); - case FCMPackage.RULE_APPLICATION: return createRuleApplication(); - case FCMPackage.CONTAINER_RULE: return createContainerRule(); - case FCMPackage.CONFIG_OPTION: return createConfigOption(); - case FCMPackage.TEMPLATE_PORT: return createTemplatePort(); - case FCMPackage.PORT: return createPort(); - case FCMPackage.PORT_KIND: return createPortKind(); - case FCMPackage.DEPLOYMENT_PLAN: return createDeploymentPlan(); - case FCMPackage.DERIVED_ELEMENT: return createDerivedElement(); - case FCMPackage.COMP_IMPL_TEMPLATE: return createCompImplTemplate(); - case FCMPackage.IMPLEMENTATION_PROPERTIES: return createImplementationProperties(); - case FCMPackage.OPERATING_SYSTEM: return createOperatingSystem(); - case FCMPackage.TARGET_ARCHITECTURE: return createTargetArchitecture(); - case FCMPackage.CONFIGURATION: return createConfiguration(); - case FCMPackage.INTERCEPTION_RULE: return createInterceptionRule(); - case FCMPackage.TARGET: return createTarget(); - case FCMPackage.COMPILER_CHAIN: return createCompilerChain(); - case FCMPackage.FRAGMENT: return createFragment(); - case FCMPackage.COPY_ATTRIBUTE_VALUE: return createCopyAttributeValue(); - case FCMPackage.AUTO_INDEX: return createAutoIndex(); - case FCMPackage.AUTO_INDEX_PER_NODE: return createAutoIndexPerNode(); - case FCMPackage.INIT_PRECEDENCE: return createInitPrecedence(); - case FCMPackage.CONNECTOR_CONFIGURATION: return createConnectorConfiguration(); - case FCMPackage.BIND_TEMPLATE: return createBindTemplate(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - - /** - * - * - * @generated - */ - @Override - public Object createFromString(EDataType eDataType, String initialValue) { - switch (eDataType.getClassifierID()) { - case FCMPackage.CONTAINER_RULE_KIND: - return createContainerRuleKindFromString(eDataType, initialValue); - case FCMPackage.INTERCEPTION_KIND: - return createInterceptionKindFromString(eDataType, initialValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - - /** - * - * - * @generated - */ - @Override - public String convertToString(EDataType eDataType, Object instanceValue) { - switch (eDataType.getClassifierID()) { - case FCMPackage.CONTAINER_RULE_KIND: - return convertContainerRuleKindToString(eDataType, instanceValue); - case FCMPackage.INTERCEPTION_KIND: - return convertInterceptionKindToString(eDataType, instanceValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - - /** - * - * - * @generated - */ - @Override - public Template createTemplate() { - TemplateImpl template = new TemplateImpl(); - return template; - } - - /** - * - * - * @generated - */ - @Override - public BindingHelper createBindingHelper() { - BindingHelperImpl bindingHelper = new BindingHelperImpl(); - return bindingHelper; - } - - /** - * - * - * @generated - */ - @Override - public ConfigurationProperty createConfigurationProperty() { - ConfigurationPropertyImpl configurationProperty = new ConfigurationPropertyImpl(); - return configurationProperty; - } - - /** - * - * - * @generated - */ - @Override - public ImplementationGroup createImplementationGroup() { - ImplementationGroupImpl implementationGroup = new ImplementationGroupImpl(); - return implementationGroup; - } - - /** - * - * - * @generated - */ - @Override - public Assembly createAssembly() { - AssemblyImpl assembly = new AssemblyImpl(); - return assembly; - } - - /** - * - * - * @generated - */ - @Override - public Flatten createFlatten() { - FlattenImpl flatten = new FlattenImpl(); - return flatten; - } - - /** - * - * - * @generated - */ - @Override - public CompToOOmapping createCompToOOmapping() { - CompToOOmappingImpl compToOOmapping = new CompToOOmappingImpl(); - return compToOOmapping; - } - - /** - * - * - * @generated - */ - @Override - public ProgLanguage createProgLanguage() { - ProgLanguageImpl progLanguage = new ProgLanguageImpl(); - return progLanguage; - } - - /** - * - * - * @generated - */ - @Override - public CodeGenOptions createCodeGenOptions() { - CodeGenOptionsImpl codeGenOptions = new CodeGenOptionsImpl(); - return codeGenOptions; - } - - /** - * - * - * @generated - */ - @Override - public InteractionComponent createInteractionComponent() { - InteractionComponentImpl interactionComponent = new InteractionComponentImpl(); - return interactionComponent; - } - - /** - * - * - * @generated - */ - @Override - public Singleton createSingleton() { - SingletonImpl singleton = new SingletonImpl(); - return singleton; - } - - /** - * - * - * @generated - */ - @Override - public Connector createConnector() { - ConnectorImpl connector = new ConnectorImpl(); - return connector; - } - - /** - * - * - * @generated - */ - @Override - public UseInstanceConfigurator createUseInstanceConfigurator() { - UseInstanceConfiguratorImpl useInstanceConfigurator = new UseInstanceConfiguratorImpl(); - return useInstanceConfigurator; - } - - /** - * - * - * @generated - */ - @Override - public InstanceConfigurator createInstanceConfigurator() { - InstanceConfiguratorImpl instanceConfigurator = new InstanceConfiguratorImpl(); - return instanceConfigurator; - } - - /** - * - * - * @generated - */ - @Override - public RuleApplication createRuleApplication() { - RuleApplicationImpl ruleApplication = new RuleApplicationImpl(); - return ruleApplication; - } - - /** - * - * - * @generated - */ - @Override - public ContainerRule createContainerRule() { - ContainerRuleImpl containerRule = new ContainerRuleImpl(); - return containerRule; - } - - /** - * - * - * @generated - */ - @Override - public ConfigOption createConfigOption() { - ConfigOptionImpl configOption = new ConfigOptionImpl(); - return configOption; - } - - /** - * - * - * @generated - */ - @Override - public TemplatePort createTemplatePort() { - TemplatePortImpl templatePort = new TemplatePortImpl(); - return templatePort; - } - - /** - * - * - * @generated - */ - @Override - public Port createPort() { - PortImpl port = new PortImpl(); - return port; - } - - /** - * - * - * @generated - */ - @Override - public PortKind createPortKind() { - PortKindImpl portKind = new PortKindImpl(); - return portKind; - } - - /** - * - * - * @generated - */ - @Override - public DeploymentPlan createDeploymentPlan() { - DeploymentPlanImpl deploymentPlan = new DeploymentPlanImpl(); - return deploymentPlan; - } - - /** - * - * - * @generated - */ - @Override - public DerivedElement createDerivedElement() { - DerivedElementImpl derivedElement = new DerivedElementImpl(); - return derivedElement; - } - - /** - * - * - * @generated - */ - @Override - public CompImplTemplate createCompImplTemplate() { - CompImplTemplateImpl compImplTemplate = new CompImplTemplateImpl(); - return compImplTemplate; - } - - /** - * - * - * @generated - */ - @Override - public ImplementationProperties createImplementationProperties() { - ImplementationPropertiesImpl implementationProperties = new ImplementationPropertiesImpl(); - return implementationProperties; - } - - /** - * - * - * @generated - */ - @Override - public OperatingSystem createOperatingSystem() { - OperatingSystemImpl operatingSystem = new OperatingSystemImpl(); - return operatingSystem; - } - - /** - * - * - * @generated - */ - @Override - public TargetArchitecture createTargetArchitecture() { - TargetArchitectureImpl targetArchitecture = new TargetArchitectureImpl(); - return targetArchitecture; - } - - /** - * - * - * @generated - */ - @Override - public Configuration createConfiguration() { - ConfigurationImpl configuration = new ConfigurationImpl(); - return configuration; - } - - /** - * - * - * @generated - */ - @Override - public InterceptionRule createInterceptionRule() { - InterceptionRuleImpl interceptionRule = new InterceptionRuleImpl(); - return interceptionRule; - } - - /** - * - * - * @generated - */ - @Override - public Target createTarget() { - TargetImpl target = new TargetImpl(); - return target; - } - - /** - * - * - * @generated - */ - @Override - public CompilerChain createCompilerChain() { - CompilerChainImpl compilerChain = new CompilerChainImpl(); - return compilerChain; - } - - /** - * - * - * @generated - */ - @Override - public Fragment createFragment() { - FragmentImpl fragment = new FragmentImpl(); - return fragment; - } - - /** - * - * - * @generated - */ - @Override - public CopyAttributeValue createCopyAttributeValue() { - CopyAttributeValueImpl copyAttributeValue = new CopyAttributeValueImpl(); - return copyAttributeValue; - } - - /** - * - * - * @generated - */ - @Override - public AutoIndex createAutoIndex() { - AutoIndexImpl autoIndex = new AutoIndexImpl(); - return autoIndex; - } - - /** - * - * - * @generated - */ - @Override - public AutoIndexPerNode createAutoIndexPerNode() { - AutoIndexPerNodeImpl autoIndexPerNode = new AutoIndexPerNodeImpl(); - return autoIndexPerNode; - } - - /** - * - * - * @generated - */ - @Override - public InitPrecedence createInitPrecedence() { - InitPrecedenceImpl initPrecedence = new InitPrecedenceImpl(); - return initPrecedence; - } - - /** - * - * - * @generated - */ - @Override - public ConnectorConfiguration createConnectorConfiguration() { - ConnectorConfigurationImpl connectorConfiguration = new ConnectorConfigurationImpl(); - return connectorConfiguration; - } - - /** - * - * - * @generated - */ - @Override - public BindTemplate createBindTemplate() { - BindTemplateImpl bindTemplate = new BindTemplateImpl(); - return bindTemplate; - } - - /** - * - * - * @generated - */ - public ContainerRuleKind createContainerRuleKindFromString(EDataType eDataType, String initialValue) { - ContainerRuleKind result = ContainerRuleKind.get(initialValue); - if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - return result; - } - - /** - * - * - * @generated - */ - public String convertContainerRuleKindToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public InterceptionKind createInterceptionKindFromString(EDataType eDataType, String initialValue) { - InterceptionKind result = InterceptionKind.get(initialValue); - if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - return result; - } - - /** - * - * - * @generated - */ - public String convertInterceptionKindToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - @Override - public FCMPackage getFCMPackage() { - return (FCMPackage)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static FCMPackage getPackage() { - return FCMPackage.eINSTANCE; - } - -} // FCMFactoryImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMPackageImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMPackageImpl.java deleted file mode 100644 index c59952dab6e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMPackageImpl.java +++ /dev/null @@ -1,2002 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.impl.EPackageImpl; -import org.eclipse.papyrus.FCM.Assembly; -import org.eclipse.papyrus.FCM.AutoIndex; -import org.eclipse.papyrus.FCM.AutoIndexPerNode; -import org.eclipse.papyrus.FCM.BindTemplate; -import org.eclipse.papyrus.FCM.BindingHelper; -import org.eclipse.papyrus.FCM.CodeGenOptions; -import org.eclipse.papyrus.FCM.CompImplTemplate; -import org.eclipse.papyrus.FCM.CompToOOmapping; -import org.eclipse.papyrus.FCM.CompilerChain; -import org.eclipse.papyrus.FCM.ConfigOption; -import org.eclipse.papyrus.FCM.ConfigurableElementInstance; -import org.eclipse.papyrus.FCM.Configuration; -import org.eclipse.papyrus.FCM.ConfigurationProperty; -import org.eclipse.papyrus.FCM.Connector; -import org.eclipse.papyrus.FCM.ConnectorConfiguration; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.ContainerRuleKind; -import org.eclipse.papyrus.FCM.CopyAttributeValue; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.FCM.FCMFactory; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.Flatten; -import org.eclipse.papyrus.FCM.Fragment; -import org.eclipse.papyrus.FCM.ImplementationGroup; -import org.eclipse.papyrus.FCM.ImplementationProperties; -import org.eclipse.papyrus.FCM.InitPrecedence; -import org.eclipse.papyrus.FCM.InstanceConfigurator; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.FCM.InterceptionKind; -import org.eclipse.papyrus.FCM.InterceptionRule; -import org.eclipse.papyrus.FCM.OperatingSystem; -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.PortKind; -import org.eclipse.papyrus.FCM.ProgLanguage; -import org.eclipse.papyrus.FCM.RuleApplication; -import org.eclipse.papyrus.FCM.Singleton; -import org.eclipse.papyrus.FCM.Target; -import org.eclipse.papyrus.FCM.TargetArchitecture; -import org.eclipse.papyrus.FCM.Template; -import org.eclipse.papyrus.FCM.TemplatePort; -import org.eclipse.papyrus.FCM.UseInstanceConfigurator; -import org.eclipse.uml2.types.TypesPackage; -import org.eclipse.uml2.uml.UMLPackage; - -/** - * - * An implementation of the model Package. - * - * @generated - */ -public class FCMPackageImpl extends EPackageImpl implements FCMPackage { - /** - * - * - * @generated - */ - private EClass templateEClass = null; - - /** - * - * - * @generated - */ - private EClass bindingHelperEClass = null; - - /** - * - * - * @generated - */ - private EClass configurationPropertyEClass = null; - - /** - * - * - * @generated - */ - private EClass implementationGroupEClass = null; - - /** - * - * - * @generated - */ - private EClass assemblyEClass = null; - - /** - * - * - * @generated - */ - private EClass flattenEClass = null; - - /** - * - * - * @generated - */ - private EClass compToOOmappingEClass = null; - - /** - * - * - * @generated - */ - private EClass progLanguageEClass = null; - - /** - * - * - * @generated - */ - private EClass codeGenOptionsEClass = null; - - /** - * - * - * @generated - */ - private EClass interactionComponentEClass = null; - - /** - * - * - * @generated - */ - private EClass singletonEClass = null; - - /** - * - * - * @generated - */ - private EClass connectorEClass = null; - - /** - * - * - * @generated - */ - private EClass configurableElementInstanceEClass = null; - - /** - * - * - * @generated - */ - private EClass useInstanceConfiguratorEClass = null; - - /** - * - * - * @generated - */ - private EClass instanceConfiguratorEClass = null; - - /** - * - * - * @generated - */ - private EClass ruleApplicationEClass = null; - - /** - * - * - * @generated - */ - private EClass containerRuleEClass = null; - - /** - * - * - * @generated - */ - private EClass configOptionEClass = null; - - /** - * - * - * @generated - */ - private EClass templatePortEClass = null; - - /** - * - * - * @generated - */ - private EClass portEClass = null; - - /** - * - * - * @generated - */ - private EClass portKindEClass = null; - - /** - * - * - * @generated - */ - private EClass deploymentPlanEClass = null; - - /** - * - * - * @generated - */ - private EClass derivedElementEClass = null; - - /** - * - * - * @generated - */ - private EClass compImplTemplateEClass = null; - - /** - * - * - * @generated - */ - private EClass implementationPropertiesEClass = null; - - /** - * - * - * @generated - */ - private EClass operatingSystemEClass = null; - - /** - * - * - * @generated - */ - private EClass targetArchitectureEClass = null; - - /** - * - * - * @generated - */ - private EClass configurationEClass = null; - - /** - * - * - * @generated - */ - private EClass interceptionRuleEClass = null; - - /** - * - * - * @generated - */ - private EClass targetEClass = null; - - /** - * - * - * @generated - */ - private EClass compilerChainEClass = null; - - /** - * - * - * @generated - */ - private EClass fragmentEClass = null; - - /** - * - * - * @generated - */ - private EClass copyAttributeValueEClass = null; - - /** - * - * - * @generated - */ - private EClass autoIndexEClass = null; - - /** - * - * - * @generated - */ - private EClass autoIndexPerNodeEClass = null; - - /** - * - * - * @generated - */ - private EClass initPrecedenceEClass = null; - - /** - * - * - * @generated - */ - private EClass connectorConfigurationEClass = null; - - /** - * - * - * @generated - */ - private EClass bindTemplateEClass = null; - - /** - * - * - * @generated - */ - private EEnum containerRuleKindEEnum = null; - - /** - * - * - * @generated - */ - private EEnum interceptionKindEEnum = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.eclipse.papyrus.FCM.FCMPackage#eNS_URI - * @see #init() - * @generated - */ - private FCMPackageImpl() { - super(eNS_URI, FCMFactory.eINSTANCE); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * - *

This method is used to initialize {@link FCMPackage#eINSTANCE} when that field is accessed. - * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static FCMPackage init() { - if (isInited) return (FCMPackage)EPackage.Registry.INSTANCE.getEPackage(FCMPackage.eNS_URI); - - // Obtain or create and register package - FCMPackageImpl theFCMPackage = (FCMPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FCMPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FCMPackageImpl()); - - isInited = true; - - // Initialize simple dependencies - UMLPackage.eINSTANCE.eClass(); - - // Create package meta-data objects - theFCMPackage.createPackageContents(); - - // Initialize created meta-data - theFCMPackage.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theFCMPackage.freeze(); - - - // Update the registry and return the package - EPackage.Registry.INSTANCE.put(FCMPackage.eNS_URI, theFCMPackage); - return theFCMPackage; - } - - /** - * - * - * @generated - */ - @Override - public EClass getTemplate() { - return templateEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getTemplate_Base_Element() { - return (EReference)templateEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getTemplate_Helper() { - return (EReference)templateEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getBindingHelper() { - return bindingHelperEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getBindingHelper_Base_Class() { - return (EReference)bindingHelperEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getConfigurationProperty() { - return configurationPropertyEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getConfigurationProperty_Base_Property() { - return (EReference)configurationPropertyEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getImplementationGroup() { - return implementationGroupEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getImplementationGroup_Base_Class() { - return (EReference)implementationGroupEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getAssembly() { - return assemblyEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getAssembly_Base_Class() { - return (EReference)assemblyEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getFlatten() { - return flattenEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getFlatten_Base_Class() { - return (EReference)flattenEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getCompToOOmapping() { - return compToOOmappingEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getCompToOOmapping_Base_Class() { - return (EReference)compToOOmappingEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getProgLanguage() { - return progLanguageEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getProgLanguage_Base_Class() { - return (EReference)progLanguageEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getCodeGenOptions() { - return codeGenOptionsEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getCodeGenOptions_Base_Package() { - return (EReference)codeGenOptionsEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getCodeGenOptions_CompToOOmapping() { - return (EReference)codeGenOptionsEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getCodeGenOptions_ProgLanguage() { - return (EReference)codeGenOptionsEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EClass getInteractionComponent() { - return interactionComponentEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getInteractionComponent_ForDistribution() { - return (EAttribute)interactionComponentEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getInteractionComponent_ConnectionPattern() { - return (EReference)interactionComponentEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getInteractionComponent_Base_Class() { - return (EReference)interactionComponentEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EClass getSingleton() { - return singletonEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getSingleton_Base_Class() { - return (EReference)singletonEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getConnector() { - return connectorEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getConnector_Base_Connector() { - return (EReference)connectorEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getConnector_Ic() { - return (EReference)connectorEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getConnector_Base_Property() { - return (EReference)connectorEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EClass getConfigurableElementInstance() { - return configurableElementInstanceEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getConfigurableElementInstance_Configuration() { - return (EReference)configurableElementInstanceEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getUseInstanceConfigurator() { - return useInstanceConfiguratorEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getUseInstanceConfigurator_Base_Class() { - return (EReference)useInstanceConfiguratorEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getUseInstanceConfigurator_Configurator() { - return (EReference)useInstanceConfiguratorEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getInstanceConfigurator() { - return instanceConfiguratorEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getInstanceConfigurator_Base_Class() { - return (EReference)instanceConfiguratorEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getInstanceConfigurator_OnNodeModel() { - return (EAttribute)instanceConfiguratorEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getRuleApplication() { - return ruleApplicationEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getRuleApplication_Base_Class() { - return (EReference)ruleApplicationEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getRuleApplication_ContainerRule() { - return (EReference)ruleApplicationEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getRuleApplication_Base_Package() { - return (EReference)ruleApplicationEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EClass getContainerRule() { - return containerRuleEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getContainerRule_Base_Class() { - return (EReference)containerRuleEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getContainerRule_ForConfig() { - return (EReference)containerRuleEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getContainerRule_Kind() { - return (EAttribute)containerRuleEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EClass getConfigOption() { - return configOptionEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getConfigOption_Base_Class() { - return (EReference)configOptionEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getTemplatePort() { - return templatePortEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getTemplatePort_BoundType() { - return (EReference)templatePortEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getPort() { - return portEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getPort_Base_Port() { - return (EReference)portEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getPort_Kind() { - return (EReference)portEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getPort_Type() { - return (EReference)portEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EClass getPortKind() { - return portKindEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getPortKind_Base_Class() { - return (EReference)portKindEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getPortKind_ProvidedInterface() { - return (EReference)portKindEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getPortKind_RequiredInterface() { - return (EReference)portKindEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getPortKind_ExtendedPort() { - return (EAttribute)portKindEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - @Override - public EClass getDeploymentPlan() { - return deploymentPlanEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getDeploymentPlan_MainInstance() { - return (EReference)deploymentPlanEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getDeploymentPlan_Base_Package() { - return (EReference)deploymentPlanEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getDerivedElement() { - return derivedElementEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getDerivedElement_Base_Element() { - return (EReference)derivedElementEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getDerivedElement_Source() { - return (EReference)derivedElementEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getCompImplTemplate() { - return compImplTemplateEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getCompImplTemplate_TemplateDefs() { - return (EAttribute)compImplTemplateEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getCompImplTemplate_Base_Class() { - return (EReference)compImplTemplateEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getImplementationProperties() { - return implementationPropertiesEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getImplementationProperties_SizeRAM() { - return (EAttribute)implementationPropertiesEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getImplementationProperties_SupportedOS() { - return (EReference)implementationPropertiesEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getImplementationProperties_Arch() { - return (EReference)implementationPropertiesEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EReference getImplementationProperties_Base_Class() { - return (EReference)implementationPropertiesEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getImplementationProperties_SizeROM() { - return (EAttribute)implementationPropertiesEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - @Override - public EReference getImplementationProperties_SupportedTargetArch() { - return (EReference)implementationPropertiesEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * @generated - */ - @Override - public EClass getOperatingSystem() { - return operatingSystemEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getOperatingSystem_Base_Class() { - return (EReference)operatingSystemEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getTargetArchitecture() { - return targetArchitectureEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getTargetArchitecture_Base_Class() { - return (EReference)targetArchitectureEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getConfiguration() { - return configurationEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getConfiguration_Base_Class() { - return (EReference)configurationEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getConfiguration_ConfigOptions() { - return (EReference)configurationEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getConfiguration_DeploymentPlan() { - return (EReference)configurationEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EClass getInterceptionRule() { - return interceptionRuleEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getInterceptionRule_InterceptionKind() { - return (EAttribute)interceptionRuleEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getInterceptionRule_InterceptionSet() { - return (EReference)interceptionRuleEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getInterceptionRule_Base_Property() { - return (EReference)interceptionRuleEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EReference getInterceptionRule_Base_Operation() { - return (EReference)interceptionRuleEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - @Override - public EClass getTarget() { - return targetEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getTarget_TargetArch() { - return (EReference)targetEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getTarget_Options() { - return (EReference)targetEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getTarget_Base_Node() { - return (EReference)targetEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EReference getTarget_UsedOS() { - return (EReference)targetEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getTarget_AvailRAM() { - return (EAttribute)targetEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getTarget_AvailROM() { - return (EAttribute)targetEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * @generated - */ - @Override - public EReference getTarget_Compiler() { - return (EReference)targetEClass.getEStructuralFeatures().get(6); - } - - /** - * - * - * @generated - */ - @Override - public EClass getCompilerChain() { - return compilerChainEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getCompilerChain_Base_Class() { - return (EReference)compilerChainEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getFragment() { - return fragmentEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getFragment_Base_Class() { - return (EReference)fragmentEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getCopyAttributeValue() { - return copyAttributeValueEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getCopyAttributeValue_Source() { - return (EReference)copyAttributeValueEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getCopyAttributeValue_Base_Property() { - return (EReference)copyAttributeValueEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getAutoIndex() { - return autoIndexEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getAutoIndex_Base_Property() { - return (EReference)autoIndexEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getAutoIndexPerNode() { - return autoIndexPerNodeEClass; - } - - /** - * - * - * @generated - */ - @Override - public EClass getInitPrecedence() { - return initPrecedenceEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getInitPrecedence_InvokeAfter() { - return (EReference)initPrecedenceEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getInitPrecedence_InvokeBefore() { - return (EReference)initPrecedenceEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getInitPrecedence_Base_Class() { - return (EReference)initPrecedenceEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EClass getConnectorConfiguration() { - return connectorConfigurationEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getConnectorConfiguration_Base_Slot() { - return (EReference)connectorConfigurationEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getConnectorConfiguration_Connector() { - return (EReference)connectorConfigurationEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getBindTemplate() { - return bindTemplateEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getBindTemplate_Actual() { - return (EReference)bindTemplateEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getBindTemplate_Base_Property() { - return (EReference)bindTemplateEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EEnum getContainerRuleKind() { - return containerRuleKindEEnum; - } - - /** - * - * - * @generated - */ - @Override - public EEnum getInterceptionKind() { - return interceptionKindEEnum; - } - - /** - * - * - * @generated - */ - @Override - public FCMFactory getFCMFactory() { - return (FCMFactory)getEFactoryInstance(); - } - - /** - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void createPackageContents() { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - templateEClass = createEClass(TEMPLATE); - createEReference(templateEClass, TEMPLATE__BASE_ELEMENT); - createEReference(templateEClass, TEMPLATE__HELPER); - - bindingHelperEClass = createEClass(BINDING_HELPER); - createEReference(bindingHelperEClass, BINDING_HELPER__BASE_CLASS); - - configurationPropertyEClass = createEClass(CONFIGURATION_PROPERTY); - createEReference(configurationPropertyEClass, CONFIGURATION_PROPERTY__BASE_PROPERTY); - - implementationGroupEClass = createEClass(IMPLEMENTATION_GROUP); - createEReference(implementationGroupEClass, IMPLEMENTATION_GROUP__BASE_CLASS); - - assemblyEClass = createEClass(ASSEMBLY); - createEReference(assemblyEClass, ASSEMBLY__BASE_CLASS); - - flattenEClass = createEClass(FLATTEN); - createEReference(flattenEClass, FLATTEN__BASE_CLASS); - - compToOOmappingEClass = createEClass(COMP_TO_OOMAPPING); - createEReference(compToOOmappingEClass, COMP_TO_OOMAPPING__BASE_CLASS); - - progLanguageEClass = createEClass(PROG_LANGUAGE); - createEReference(progLanguageEClass, PROG_LANGUAGE__BASE_CLASS); - - codeGenOptionsEClass = createEClass(CODE_GEN_OPTIONS); - createEReference(codeGenOptionsEClass, CODE_GEN_OPTIONS__BASE_PACKAGE); - createEReference(codeGenOptionsEClass, CODE_GEN_OPTIONS__COMP_TO_OOMAPPING); - createEReference(codeGenOptionsEClass, CODE_GEN_OPTIONS__PROG_LANGUAGE); - - interactionComponentEClass = createEClass(INTERACTION_COMPONENT); - createEAttribute(interactionComponentEClass, INTERACTION_COMPONENT__FOR_DISTRIBUTION); - createEReference(interactionComponentEClass, INTERACTION_COMPONENT__CONNECTION_PATTERN); - createEReference(interactionComponentEClass, INTERACTION_COMPONENT__BASE_CLASS); - - singletonEClass = createEClass(SINGLETON); - createEReference(singletonEClass, SINGLETON__BASE_CLASS); - - connectorEClass = createEClass(CONNECTOR); - createEReference(connectorEClass, CONNECTOR__BASE_CONNECTOR); - createEReference(connectorEClass, CONNECTOR__IC); - createEReference(connectorEClass, CONNECTOR__BASE_PROPERTY); - - configurableElementInstanceEClass = createEClass(CONFIGURABLE_ELEMENT_INSTANCE); - createEReference(configurableElementInstanceEClass, CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION); - - useInstanceConfiguratorEClass = createEClass(USE_INSTANCE_CONFIGURATOR); - createEReference(useInstanceConfiguratorEClass, USE_INSTANCE_CONFIGURATOR__BASE_CLASS); - createEReference(useInstanceConfiguratorEClass, USE_INSTANCE_CONFIGURATOR__CONFIGURATOR); - - instanceConfiguratorEClass = createEClass(INSTANCE_CONFIGURATOR); - createEReference(instanceConfiguratorEClass, INSTANCE_CONFIGURATOR__BASE_CLASS); - createEAttribute(instanceConfiguratorEClass, INSTANCE_CONFIGURATOR__ON_NODE_MODEL); - - ruleApplicationEClass = createEClass(RULE_APPLICATION); - createEReference(ruleApplicationEClass, RULE_APPLICATION__BASE_CLASS); - createEReference(ruleApplicationEClass, RULE_APPLICATION__CONTAINER_RULE); - createEReference(ruleApplicationEClass, RULE_APPLICATION__BASE_PACKAGE); - - containerRuleEClass = createEClass(CONTAINER_RULE); - createEReference(containerRuleEClass, CONTAINER_RULE__BASE_CLASS); - createEReference(containerRuleEClass, CONTAINER_RULE__FOR_CONFIG); - createEAttribute(containerRuleEClass, CONTAINER_RULE__KIND); - - configOptionEClass = createEClass(CONFIG_OPTION); - createEReference(configOptionEClass, CONFIG_OPTION__BASE_CLASS); - - templatePortEClass = createEClass(TEMPLATE_PORT); - createEReference(templatePortEClass, TEMPLATE_PORT__BOUND_TYPE); - - portEClass = createEClass(PORT); - createEReference(portEClass, PORT__BASE_PORT); - createEReference(portEClass, PORT__KIND); - createEReference(portEClass, PORT__TYPE); - - portKindEClass = createEClass(PORT_KIND); - createEReference(portKindEClass, PORT_KIND__BASE_CLASS); - createEReference(portKindEClass, PORT_KIND__PROVIDED_INTERFACE); - createEReference(portKindEClass, PORT_KIND__REQUIRED_INTERFACE); - createEAttribute(portKindEClass, PORT_KIND__EXTENDED_PORT); - - deploymentPlanEClass = createEClass(DEPLOYMENT_PLAN); - createEReference(deploymentPlanEClass, DEPLOYMENT_PLAN__MAIN_INSTANCE); - createEReference(deploymentPlanEClass, DEPLOYMENT_PLAN__BASE_PACKAGE); - - derivedElementEClass = createEClass(DERIVED_ELEMENT); - createEReference(derivedElementEClass, DERIVED_ELEMENT__BASE_ELEMENT); - createEReference(derivedElementEClass, DERIVED_ELEMENT__SOURCE); - - compImplTemplateEClass = createEClass(COMP_IMPL_TEMPLATE); - createEAttribute(compImplTemplateEClass, COMP_IMPL_TEMPLATE__TEMPLATE_DEFS); - createEReference(compImplTemplateEClass, COMP_IMPL_TEMPLATE__BASE_CLASS); - - implementationPropertiesEClass = createEClass(IMPLEMENTATION_PROPERTIES); - createEAttribute(implementationPropertiesEClass, IMPLEMENTATION_PROPERTIES__SIZE_RAM); - createEReference(implementationPropertiesEClass, IMPLEMENTATION_PROPERTIES__SUPPORTED_OS); - createEReference(implementationPropertiesEClass, IMPLEMENTATION_PROPERTIES__ARCH); - createEReference(implementationPropertiesEClass, IMPLEMENTATION_PROPERTIES__BASE_CLASS); - createEAttribute(implementationPropertiesEClass, IMPLEMENTATION_PROPERTIES__SIZE_ROM); - createEReference(implementationPropertiesEClass, IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH); - - operatingSystemEClass = createEClass(OPERATING_SYSTEM); - createEReference(operatingSystemEClass, OPERATING_SYSTEM__BASE_CLASS); - - targetArchitectureEClass = createEClass(TARGET_ARCHITECTURE); - createEReference(targetArchitectureEClass, TARGET_ARCHITECTURE__BASE_CLASS); - - configurationEClass = createEClass(CONFIGURATION); - createEReference(configurationEClass, CONFIGURATION__BASE_CLASS); - createEReference(configurationEClass, CONFIGURATION__CONFIG_OPTIONS); - createEReference(configurationEClass, CONFIGURATION__DEPLOYMENT_PLAN); - - interceptionRuleEClass = createEClass(INTERCEPTION_RULE); - createEAttribute(interceptionRuleEClass, INTERCEPTION_RULE__INTERCEPTION_KIND); - createEReference(interceptionRuleEClass, INTERCEPTION_RULE__INTERCEPTION_SET); - createEReference(interceptionRuleEClass, INTERCEPTION_RULE__BASE_PROPERTY); - createEReference(interceptionRuleEClass, INTERCEPTION_RULE__BASE_OPERATION); - - targetEClass = createEClass(TARGET); - createEReference(targetEClass, TARGET__TARGET_ARCH); - createEReference(targetEClass, TARGET__OPTIONS); - createEReference(targetEClass, TARGET__BASE_NODE); - createEReference(targetEClass, TARGET__USED_OS); - createEAttribute(targetEClass, TARGET__AVAIL_RAM); - createEAttribute(targetEClass, TARGET__AVAIL_ROM); - createEReference(targetEClass, TARGET__COMPILER); - - compilerChainEClass = createEClass(COMPILER_CHAIN); - createEReference(compilerChainEClass, COMPILER_CHAIN__BASE_CLASS); - - fragmentEClass = createEClass(FRAGMENT); - createEReference(fragmentEClass, FRAGMENT__BASE_CLASS); - - copyAttributeValueEClass = createEClass(COPY_ATTRIBUTE_VALUE); - createEReference(copyAttributeValueEClass, COPY_ATTRIBUTE_VALUE__SOURCE); - createEReference(copyAttributeValueEClass, COPY_ATTRIBUTE_VALUE__BASE_PROPERTY); - - autoIndexEClass = createEClass(AUTO_INDEX); - createEReference(autoIndexEClass, AUTO_INDEX__BASE_PROPERTY); - - autoIndexPerNodeEClass = createEClass(AUTO_INDEX_PER_NODE); - - initPrecedenceEClass = createEClass(INIT_PRECEDENCE); - createEReference(initPrecedenceEClass, INIT_PRECEDENCE__INVOKE_AFTER); - createEReference(initPrecedenceEClass, INIT_PRECEDENCE__INVOKE_BEFORE); - createEReference(initPrecedenceEClass, INIT_PRECEDENCE__BASE_CLASS); - - connectorConfigurationEClass = createEClass(CONNECTOR_CONFIGURATION); - createEReference(connectorConfigurationEClass, CONNECTOR_CONFIGURATION__BASE_SLOT); - createEReference(connectorConfigurationEClass, CONNECTOR_CONFIGURATION__CONNECTOR); - - bindTemplateEClass = createEClass(BIND_TEMPLATE); - createEReference(bindTemplateEClass, BIND_TEMPLATE__ACTUAL); - createEReference(bindTemplateEClass, BIND_TEMPLATE__BASE_PROPERTY); - - // Create enums - containerRuleKindEEnum = createEEnum(CONTAINER_RULE_KIND); - interceptionKindEEnum = createEEnum(INTERCEPTION_KIND); - } - - /** - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void initializePackageContents() { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Obtain other dependent packages - UMLPackage theUMLPackage = (UMLPackage)EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI); - TypesPackage theTypesPackage = (TypesPackage)EPackage.Registry.INSTANCE.getEPackage(TypesPackage.eNS_URI); - - // Create type parameters - - // Set bounds for type parameters - - // Add supertypes to classes - connectorEClass.getESuperTypes().add(this.getConfigurableElementInstance()); - templatePortEClass.getESuperTypes().add(this.getPort()); - portEClass.getESuperTypes().add(this.getConfigurableElementInstance()); - autoIndexPerNodeEClass.getESuperTypes().add(this.getAutoIndex()); - - // Initialize classes and features; add operations and parameters - initEClass(templateEClass, Template.class, "Template", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getTemplate_Base_Element(), theUMLPackage.getElement(), null, "base_Element", null, 1, 1, Template.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getTemplate_Helper(), this.getBindingHelper(), null, "helper", null, 0, 1, Template.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(bindingHelperEClass, BindingHelper.class, "BindingHelper", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getBindingHelper_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, BindingHelper.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(configurationPropertyEClass, ConfigurationProperty.class, "ConfigurationProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getConfigurationProperty_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 1, 1, ConfigurationProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(implementationGroupEClass, ImplementationGroup.class, "ImplementationGroup", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getImplementationGroup_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, ImplementationGroup.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(assemblyEClass, Assembly.class, "Assembly", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getAssembly_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, Assembly.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(flattenEClass, Flatten.class, "Flatten", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getFlatten_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, Flatten.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(compToOOmappingEClass, CompToOOmapping.class, "CompToOOmapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getCompToOOmapping_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, CompToOOmapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(progLanguageEClass, ProgLanguage.class, "ProgLanguage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getProgLanguage_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, ProgLanguage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(codeGenOptionsEClass, CodeGenOptions.class, "CodeGenOptions", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getCodeGenOptions_Base_Package(), theUMLPackage.getPackage(), null, "base_Package", null, 1, 1, CodeGenOptions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getCodeGenOptions_CompToOOmapping(), this.getCompToOOmapping(), null, "compToOOmapping", null, 1, 1, CodeGenOptions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getCodeGenOptions_ProgLanguage(), this.getProgLanguage(), null, "progLanguage", null, 1, 1, CodeGenOptions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(interactionComponentEClass, InteractionComponent.class, "InteractionComponent", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEAttribute(getInteractionComponent_ForDistribution(), theTypesPackage.getBoolean(), "forDistribution", "false", 1, 1, InteractionComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ //$NON-NLS-2$ - initEReference(getInteractionComponent_ConnectionPattern(), theUMLPackage.getCollaboration(), null, "connectionPattern", null, 0, 1, InteractionComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getInteractionComponent_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, InteractionComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(singletonEClass, Singleton.class, "Singleton", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getSingleton_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, Singleton.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(connectorEClass, Connector.class, "Connector", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getConnector_Base_Connector(), theUMLPackage.getConnector(), null, "base_Connector", null, 0, 1, Connector.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getConnector_Ic(), this.getInteractionComponent(), null, "ic", null, 0, 1, Connector.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getConnector_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 0, 1, Connector.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(configurableElementInstanceEClass, ConfigurableElementInstance.class, "ConfigurableElementInstance", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getConfigurableElementInstance_Configuration(), theUMLPackage.getInstanceSpecification(), null, "configuration", null, 0, 1, ConfigurableElementInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(useInstanceConfiguratorEClass, UseInstanceConfigurator.class, "UseInstanceConfigurator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getUseInstanceConfigurator_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, UseInstanceConfigurator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getUseInstanceConfigurator_Configurator(), this.getInstanceConfigurator(), null, "configurator", null, 1, 1, UseInstanceConfigurator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(instanceConfiguratorEClass, InstanceConfigurator.class, "InstanceConfigurator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getInstanceConfigurator_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, InstanceConfigurator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEAttribute(getInstanceConfigurator_OnNodeModel(), theTypesPackage.getBoolean(), "onNodeModel", null, 0, 1, InstanceConfigurator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(ruleApplicationEClass, RuleApplication.class, "RuleApplication", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getRuleApplication_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 0, 1, RuleApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getRuleApplication_ContainerRule(), this.getContainerRule(), null, "containerRule", null, 0, -1, RuleApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getRuleApplication_Base_Package(), theUMLPackage.getPackage(), null, "base_Package", null, 0, 1, RuleApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(containerRuleEClass, ContainerRule.class, "ContainerRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getContainerRule_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, ContainerRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getContainerRule_ForConfig(), this.getConfigOption(), null, "forConfig", null, 0, -1, ContainerRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEAttribute(getContainerRule_Kind(), this.getContainerRuleKind(), "kind", null, 1, 1, ContainerRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(configOptionEClass, ConfigOption.class, "ConfigOption", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getConfigOption_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, ConfigOption.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(templatePortEClass, TemplatePort.class, "TemplatePort", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getTemplatePort_BoundType(), this.getPortKind(), null, "boundType", null, 0, 1, TemplatePort.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(portEClass, Port.class, "Port", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getPort_Base_Port(), theUMLPackage.getPort(), null, "base_Port", null, 1, 1, Port.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getPort_Kind(), this.getPortKind(), null, "kind", null, 0, 1, Port.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getPort_Type(), theUMLPackage.getType(), null, "type", null, 1, 1, Port.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(portKindEClass, PortKind.class, "PortKind", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getPortKind_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, PortKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getPortKind_ProvidedInterface(), theUMLPackage.getInterface(), null, "providedInterface", null, 0, 1, PortKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getPortKind_RequiredInterface(), theUMLPackage.getInterface(), null, "requiredInterface", null, 0, 1, PortKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEAttribute(getPortKind_ExtendedPort(), theTypesPackage.getBoolean(), "extendedPort", null, 1, 1, PortKind.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(deploymentPlanEClass, DeploymentPlan.class, "DeploymentPlan", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getDeploymentPlan_MainInstance(), theUMLPackage.getInstanceSpecification(), null, "mainInstance", null, 1, 1, DeploymentPlan.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getDeploymentPlan_Base_Package(), theUMLPackage.getPackage(), null, "base_Package", null, 1, 1, DeploymentPlan.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(derivedElementEClass, DerivedElement.class, "DerivedElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getDerivedElement_Base_Element(), theUMLPackage.getElement(), null, "base_Element", null, 1, 1, DerivedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getDerivedElement_Source(), theUMLPackage.getElement(), null, "source", null, 1, 1, DerivedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(compImplTemplateEClass, CompImplTemplate.class, "CompImplTemplate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEAttribute(getCompImplTemplate_TemplateDefs(), theTypesPackage.getString(), "templateDefs", null, 0, 1, CompImplTemplate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getCompImplTemplate_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, CompImplTemplate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(implementationPropertiesEClass, ImplementationProperties.class, "ImplementationProperties", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEAttribute(getImplementationProperties_SizeRAM(), theTypesPackage.getInteger(), "sizeRAM", null, 1, 1, ImplementationProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getImplementationProperties_SupportedOS(), this.getOperatingSystem(), null, "supportedOS", null, 0, -1, ImplementationProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getImplementationProperties_Arch(), this.getTargetArchitecture(), null, "arch", null, 0, -1, ImplementationProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getImplementationProperties_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, ImplementationProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEAttribute(getImplementationProperties_SizeROM(), theTypesPackage.getInteger(), "sizeROM", null, 1, 1, ImplementationProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getImplementationProperties_SupportedTargetArch(), this.getTargetArchitecture(), null, "supportedTargetArch", null, 1, 1, ImplementationProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(operatingSystemEClass, OperatingSystem.class, "OperatingSystem", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getOperatingSystem_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, OperatingSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(targetArchitectureEClass, TargetArchitecture.class, "TargetArchitecture", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getTargetArchitecture_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, TargetArchitecture.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(configurationEClass, Configuration.class, "Configuration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getConfiguration_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, Configuration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getConfiguration_ConfigOptions(), this.getConfigOption(), null, "configOptions", null, 0, -1, Configuration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getConfiguration_DeploymentPlan(), this.getDeploymentPlan(), null, "deploymentPlan", null, 1, 1, Configuration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(interceptionRuleEClass, InterceptionRule.class, "InterceptionRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEAttribute(getInterceptionRule_InterceptionKind(), this.getInterceptionKind(), "interceptionKind", null, 1, 1, InterceptionRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getInterceptionRule_InterceptionSet(), theUMLPackage.getFeature(), null, "interceptionSet", null, 0, -1, InterceptionRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getInterceptionRule_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 1, 1, InterceptionRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getInterceptionRule_Base_Operation(), theUMLPackage.getOperation(), null, "base_Operation", null, 1, 1, InterceptionRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(targetEClass, Target.class, "Target", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getTarget_TargetArch(), this.getTargetArchitecture(), null, "targetArch", null, 1, 1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getTarget_Options(), this.getConfigOption(), null, "options", null, 0, -1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getTarget_Base_Node(), theUMLPackage.getNode(), null, "base_Node", null, 1, 1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getTarget_UsedOS(), this.getOperatingSystem(), null, "usedOS", null, 1, 1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEAttribute(getTarget_AvailRAM(), theTypesPackage.getInteger(), "availRAM", null, 1, 1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEAttribute(getTarget_AvailROM(), theTypesPackage.getInteger(), "availROM", null, 1, 1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getTarget_Compiler(), this.getCompilerChain(), null, "compiler", null, 0, 1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(compilerChainEClass, CompilerChain.class, "CompilerChain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getCompilerChain_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, CompilerChain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(fragmentEClass, Fragment.class, "Fragment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getFragment_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, Fragment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(copyAttributeValueEClass, CopyAttributeValue.class, "CopyAttributeValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getCopyAttributeValue_Source(), theUMLPackage.getProperty(), null, "source", null, 1, 1, CopyAttributeValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getCopyAttributeValue_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 1, 1, CopyAttributeValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(autoIndexEClass, AutoIndex.class, "AutoIndex", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getAutoIndex_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 1, 1, AutoIndex.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(autoIndexPerNodeEClass, AutoIndexPerNode.class, "AutoIndexPerNode", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - - initEClass(initPrecedenceEClass, InitPrecedence.class, "InitPrecedence", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getInitPrecedence_InvokeAfter(), theUMLPackage.getClass_(), null, "invokeAfter", null, 0, -1, InitPrecedence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getInitPrecedence_InvokeBefore(), theUMLPackage.getClass_(), null, "invokeBefore", null, 0, -1, InitPrecedence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getInitPrecedence_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, InitPrecedence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(connectorConfigurationEClass, ConnectorConfiguration.class, "ConnectorConfiguration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getConnectorConfiguration_Base_Slot(), theUMLPackage.getSlot(), null, "base_Slot", null, 1, 1, ConnectorConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getConnectorConfiguration_Connector(), this.getConnector(), null, "connector", null, 1, 1, ConnectorConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - initEClass(bindTemplateEClass, BindTemplate.class, "BindTemplate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ - initEReference(getBindTemplate_Actual(), theUMLPackage.getType(), null, "actual", null, 0, -1, BindTemplate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - initEReference(getBindTemplate_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 1, 1, BindTemplate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ - - // Initialize enums and add enum literals - initEEnum(containerRuleKindEEnum, ContainerRuleKind.class, "ContainerRuleKind"); //$NON-NLS-1$ - addEEnumLiteral(containerRuleKindEEnum, ContainerRuleKind.COMPONENT_RULE); - addEEnumLiteral(containerRuleKindEEnum, ContainerRuleKind.LIGHT_WEIGHT_OO_RULE); - - initEEnum(interceptionKindEEnum, InterceptionKind.class, "InterceptionKind"); //$NON-NLS-1$ - addEEnumLiteral(interceptionKindEEnum, InterceptionKind.INTERCEPT_SOME); - addEEnumLiteral(interceptionKindEEnum, InterceptionKind.INTERCEPT_ALL); - addEEnumLiteral(interceptionKindEEnum, InterceptionKind.INTERCEPT_ALL_OUT); - addEEnumLiteral(interceptionKindEEnum, InterceptionKind.INTERCEPT_ALL_IN); - addEEnumLiteral(interceptionKindEEnum, InterceptionKind.INTERCEPT_MATCHING); - - // Create resource - createResource(eNS_URI); - } - -} // FCMPackageImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FlattenImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FlattenImpl.java deleted file mode 100644 index df03b58b1df..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FlattenImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.Flatten; - -/** - * - * An implementation of the model object 'Flatten'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.FlattenImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class FlattenImpl extends EObjectImpl implements Flatten { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected FlattenImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.FLATTEN; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.FLATTEN__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.FLATTEN__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.FLATTEN__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.FLATTEN__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.FLATTEN__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.FLATTEN__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - -} // FlattenImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FragmentImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FragmentImpl.java deleted file mode 100644 index 3b0f821b496..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FragmentImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.Fragment; - -/** - * - * An implementation of the model object 'Fragment'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.FragmentImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class FragmentImpl extends EObjectImpl implements Fragment { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected FragmentImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.FRAGMENT; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.FRAGMENT__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.FRAGMENT__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.FRAGMENT__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.FRAGMENT__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.FRAGMENT__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.FRAGMENT__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - -} // FragmentImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationGroupImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationGroupImpl.java deleted file mode 100644 index 42d65ff5e31..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationGroupImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.ImplementationGroup; - -/** - * - * An implementation of the model object 'Implementation Group'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.ImplementationGroupImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class ImplementationGroupImpl extends EObjectImpl implements ImplementationGroup { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected ImplementationGroupImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.IMPLEMENTATION_GROUP; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.IMPLEMENTATION_GROUP__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.IMPLEMENTATION_GROUP__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.IMPLEMENTATION_GROUP__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.IMPLEMENTATION_GROUP__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.IMPLEMENTATION_GROUP__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.IMPLEMENTATION_GROUP__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - -} // ImplementationGroupImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationPropertiesImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationPropertiesImpl.java deleted file mode 100644 index 7f86201abbf..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationPropertiesImpl.java +++ /dev/null @@ -1,430 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.ImplementationProperties; -import org.eclipse.papyrus.FCM.OperatingSystem; -import org.eclipse.papyrus.FCM.TargetArchitecture; - -/** - * - * An implementation of the model object 'Implementation Properties'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl#getSizeRAM Size RAM}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl#getSupportedOS Supported OS}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl#getArch Arch}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl#getSizeROM Size ROM}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl#getSupportedTargetArch Supported Target Arch}
  • - *
- * - * @generated - */ -public class ImplementationPropertiesImpl extends EObjectImpl implements ImplementationProperties { - /** - * The default value of the '{@link #getSizeRAM() Size RAM}' attribute. - * - * - * @see #getSizeRAM() - * @generated - * @ordered - */ - protected static final int SIZE_RAM_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getSizeRAM() Size RAM}' attribute. - * - * - * @see #getSizeRAM() - * @generated - * @ordered - */ - protected int sizeRAM = SIZE_RAM_EDEFAULT; - - /** - * The cached value of the '{@link #getSupportedOS() Supported OS}' reference list. - * - * - * @see #getSupportedOS() - * @generated - * @ordered - */ - protected EList supportedOS; - - /** - * The cached value of the '{@link #getArch() Arch}' reference list. - * - * - * @see #getArch() - * @generated - * @ordered - */ - protected EList arch; - - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * The default value of the '{@link #getSizeROM() Size ROM}' attribute. - * - * - * @see #getSizeROM() - * @generated - * @ordered - */ - protected static final int SIZE_ROM_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getSizeROM() Size ROM}' attribute. - * - * - * @see #getSizeROM() - * @generated - * @ordered - */ - protected int sizeROM = SIZE_ROM_EDEFAULT; - - /** - * The cached value of the '{@link #getSupportedTargetArch() Supported Target Arch}' reference. - * - * - * @see #getSupportedTargetArch() - * @generated - * @ordered - */ - protected TargetArchitecture supportedTargetArch; - - /** - * - * - * @generated - */ - protected ImplementationPropertiesImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.IMPLEMENTATION_PROPERTIES; - } - - /** - * - * - * @generated - */ - @Override - public int getSizeRAM() { - return sizeRAM; - } - - /** - * - * - * @generated - */ - @Override - public void setSizeRAM(int newSizeRAM) { - int oldSizeRAM = sizeRAM; - sizeRAM = newSizeRAM; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_RAM, oldSizeRAM, sizeRAM)); - } - - /** - * - * - * @generated - */ - @Override - public EList getSupportedOS() { - if (supportedOS == null) { - supportedOS = new EObjectResolvingEList(OperatingSystem.class, this, FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_OS); - } - return supportedOS; - } - - /** - * - * - * @generated - */ - @Override - public EList getArch() { - if (arch == null) { - arch = new EObjectResolvingEList(TargetArchitecture.class, this, FCMPackage.IMPLEMENTATION_PROPERTIES__ARCH); - } - return arch; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.IMPLEMENTATION_PROPERTIES__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.IMPLEMENTATION_PROPERTIES__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public int getSizeROM() { - return sizeROM; - } - - /** - * - * - * @generated - */ - @Override - public void setSizeROM(int newSizeROM) { - int oldSizeROM = sizeROM; - sizeROM = newSizeROM; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_ROM, oldSizeROM, sizeROM)); - } - - /** - * - * - * @generated - */ - @Override - public TargetArchitecture getSupportedTargetArch() { - if (supportedTargetArch != null && supportedTargetArch.eIsProxy()) { - InternalEObject oldSupportedTargetArch = (InternalEObject)supportedTargetArch; - supportedTargetArch = (TargetArchitecture)eResolveProxy(oldSupportedTargetArch); - if (supportedTargetArch != oldSupportedTargetArch) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH, oldSupportedTargetArch, supportedTargetArch)); - } - } - return supportedTargetArch; - } - - /** - * - * - * @generated - */ - public TargetArchitecture basicGetSupportedTargetArch() { - return supportedTargetArch; - } - - /** - * - * - * @generated - */ - @Override - public void setSupportedTargetArch(TargetArchitecture newSupportedTargetArch) { - TargetArchitecture oldSupportedTargetArch = supportedTargetArch; - supportedTargetArch = newSupportedTargetArch; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH, oldSupportedTargetArch, supportedTargetArch)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_RAM: - return getSizeRAM(); - case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_OS: - return getSupportedOS(); - case FCMPackage.IMPLEMENTATION_PROPERTIES__ARCH: - return getArch(); - case FCMPackage.IMPLEMENTATION_PROPERTIES__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_ROM: - return getSizeROM(); - case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH: - if (resolve) return getSupportedTargetArch(); - return basicGetSupportedTargetArch(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_RAM: - setSizeRAM((Integer)newValue); - return; - case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_OS: - getSupportedOS().clear(); - getSupportedOS().addAll((Collection)newValue); - return; - case FCMPackage.IMPLEMENTATION_PROPERTIES__ARCH: - getArch().clear(); - getArch().addAll((Collection)newValue); - return; - case FCMPackage.IMPLEMENTATION_PROPERTIES__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_ROM: - setSizeROM((Integer)newValue); - return; - case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH: - setSupportedTargetArch((TargetArchitecture)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_RAM: - setSizeRAM(SIZE_RAM_EDEFAULT); - return; - case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_OS: - getSupportedOS().clear(); - return; - case FCMPackage.IMPLEMENTATION_PROPERTIES__ARCH: - getArch().clear(); - return; - case FCMPackage.IMPLEMENTATION_PROPERTIES__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_ROM: - setSizeROM(SIZE_ROM_EDEFAULT); - return; - case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH: - setSupportedTargetArch((TargetArchitecture)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_RAM: - return sizeRAM != SIZE_RAM_EDEFAULT; - case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_OS: - return supportedOS != null && !supportedOS.isEmpty(); - case FCMPackage.IMPLEMENTATION_PROPERTIES__ARCH: - return arch != null && !arch.isEmpty(); - case FCMPackage.IMPLEMENTATION_PROPERTIES__BASE_CLASS: - return base_Class != null; - case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_ROM: - return sizeROM != SIZE_ROM_EDEFAULT; - case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH: - return supportedTargetArch != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (sizeRAM: "); //$NON-NLS-1$ - result.append(sizeRAM); - result.append(", sizeROM: "); //$NON-NLS-1$ - result.append(sizeROM); - result.append(')'); - return result.toString(); - } - -} // ImplementationPropertiesImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InitPrecedenceImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InitPrecedenceImpl.java deleted file mode 100644 index f3912aed57b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InitPrecedenceImpl.java +++ /dev/null @@ -1,240 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.InitPrecedence; - -/** - * - * An implementation of the model object 'Init Precedence'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl#getInvokeAfter Invoke After}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl#getInvokeBefore Invoke Before}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class InitPrecedenceImpl extends EObjectImpl implements InitPrecedence { - /** - * The cached value of the '{@link #getInvokeAfter() Invoke After}' reference list. - * - * - * @see #getInvokeAfter() - * @generated - * @ordered - */ - protected EList invokeAfter; - - /** - * The cached value of the '{@link #getInvokeBefore() Invoke Before}' reference list. - * - * - * @see #getInvokeBefore() - * @generated - * @ordered - */ - protected EList invokeBefore; - - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected InitPrecedenceImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.INIT_PRECEDENCE; - } - - /** - * - * - * @generated - */ - @Override - public EList getInvokeAfter() { - if (invokeAfter == null) { - invokeAfter = new EObjectResolvingEList(org.eclipse.uml2.uml.Class.class, this, FCMPackage.INIT_PRECEDENCE__INVOKE_AFTER); - } - return invokeAfter; - } - - /** - * - * - * @generated - */ - @Override - public EList getInvokeBefore() { - if (invokeBefore == null) { - invokeBefore = new EObjectResolvingEList(org.eclipse.uml2.uml.Class.class, this, FCMPackage.INIT_PRECEDENCE__INVOKE_BEFORE); - } - return invokeBefore; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.INIT_PRECEDENCE__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INIT_PRECEDENCE__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.INIT_PRECEDENCE__INVOKE_AFTER: - return getInvokeAfter(); - case FCMPackage.INIT_PRECEDENCE__INVOKE_BEFORE: - return getInvokeBefore(); - case FCMPackage.INIT_PRECEDENCE__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.INIT_PRECEDENCE__INVOKE_AFTER: - getInvokeAfter().clear(); - getInvokeAfter().addAll((Collection)newValue); - return; - case FCMPackage.INIT_PRECEDENCE__INVOKE_BEFORE: - getInvokeBefore().clear(); - getInvokeBefore().addAll((Collection)newValue); - return; - case FCMPackage.INIT_PRECEDENCE__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.INIT_PRECEDENCE__INVOKE_AFTER: - getInvokeAfter().clear(); - return; - case FCMPackage.INIT_PRECEDENCE__INVOKE_BEFORE: - getInvokeBefore().clear(); - return; - case FCMPackage.INIT_PRECEDENCE__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.INIT_PRECEDENCE__INVOKE_AFTER: - return invokeAfter != null && !invokeAfter.isEmpty(); - case FCMPackage.INIT_PRECEDENCE__INVOKE_BEFORE: - return invokeBefore != null && !invokeBefore.isEmpty(); - case FCMPackage.INIT_PRECEDENCE__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - -} // InitPrecedenceImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InstanceConfiguratorImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InstanceConfiguratorImpl.java deleted file mode 100644 index 98c39d1bb77..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InstanceConfiguratorImpl.java +++ /dev/null @@ -1,234 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.InstanceConfigurator; - -/** - * - * An implementation of the model object 'Instance Configurator'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.InstanceConfiguratorImpl#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.InstanceConfiguratorImpl#isOnNodeModel On Node Model}
  • - *
- * - * @generated - */ -public class InstanceConfiguratorImpl extends EObjectImpl implements InstanceConfigurator { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * The default value of the '{@link #isOnNodeModel() On Node Model}' attribute. - * - * - * @see #isOnNodeModel() - * @generated - * @ordered - */ - protected static final boolean ON_NODE_MODEL_EDEFAULT = false; - /** - * The cached value of the '{@link #isOnNodeModel() On Node Model}' attribute. - * - * - * @see #isOnNodeModel() - * @generated - * @ordered - */ - protected boolean onNodeModel = ON_NODE_MODEL_EDEFAULT; - - /** - * - * - * @generated - */ - protected InstanceConfiguratorImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.INSTANCE_CONFIGURATOR; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.INSTANCE_CONFIGURATOR__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INSTANCE_CONFIGURATOR__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public boolean isOnNodeModel() { - return onNodeModel; - } - - /** - * - * - * @generated - */ - @Override - public void setOnNodeModel(boolean newOnNodeModel) { - boolean oldOnNodeModel = onNodeModel; - onNodeModel = newOnNodeModel; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INSTANCE_CONFIGURATOR__ON_NODE_MODEL, oldOnNodeModel, onNodeModel)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.INSTANCE_CONFIGURATOR__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - case FCMPackage.INSTANCE_CONFIGURATOR__ON_NODE_MODEL: - return isOnNodeModel(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.INSTANCE_CONFIGURATOR__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - case FCMPackage.INSTANCE_CONFIGURATOR__ON_NODE_MODEL: - setOnNodeModel((Boolean)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.INSTANCE_CONFIGURATOR__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - case FCMPackage.INSTANCE_CONFIGURATOR__ON_NODE_MODEL: - setOnNodeModel(ON_NODE_MODEL_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.INSTANCE_CONFIGURATOR__BASE_CLASS: - return base_Class != null; - case FCMPackage.INSTANCE_CONFIGURATOR__ON_NODE_MODEL: - return onNodeModel != ON_NODE_MODEL_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (onNodeModel: "); //$NON-NLS-1$ - result.append(onNodeModel); - result.append(')'); - return result.toString(); - } - -} // InstanceConfiguratorImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InteractionComponentImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InteractionComponentImpl.java deleted file mode 100644 index eda594ff7b3..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InteractionComponentImpl.java +++ /dev/null @@ -1,298 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.uml2.uml.Collaboration; - -/** - * - * An implementation of the model object 'Interaction Component'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.InteractionComponentImpl#isForDistribution For Distribution}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.InteractionComponentImpl#getConnectionPattern Connection Pattern}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.InteractionComponentImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class InteractionComponentImpl extends EObjectImpl implements InteractionComponent { - /** - * The default value of the '{@link #isForDistribution() For Distribution}' attribute. - * - * - * @see #isForDistribution() - * @generated - * @ordered - */ - protected static final boolean FOR_DISTRIBUTION_EDEFAULT = false; - - /** - * The cached value of the '{@link #isForDistribution() For Distribution}' attribute. - * - * - * @see #isForDistribution() - * @generated - * @ordered - */ - protected boolean forDistribution = FOR_DISTRIBUTION_EDEFAULT; - - /** - * The cached value of the '{@link #getConnectionPattern() Connection Pattern}' reference. - * - * - * @see #getConnectionPattern() - * @generated - * @ordered - */ - protected Collaboration connectionPattern; - - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected InteractionComponentImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.INTERACTION_COMPONENT; - } - - /** - * - * - * @generated - */ - @Override - public boolean isForDistribution() { - return forDistribution; - } - - /** - * - * - * @generated - */ - @Override - public void setForDistribution(boolean newForDistribution) { - boolean oldForDistribution = forDistribution; - forDistribution = newForDistribution; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INTERACTION_COMPONENT__FOR_DISTRIBUTION, oldForDistribution, forDistribution)); - } - - /** - * - * - * @generated - */ - @Override - public Collaboration getConnectionPattern() { - if (connectionPattern != null && connectionPattern.eIsProxy()) { - InternalEObject oldConnectionPattern = (InternalEObject)connectionPattern; - connectionPattern = (Collaboration)eResolveProxy(oldConnectionPattern); - if (connectionPattern != oldConnectionPattern) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.INTERACTION_COMPONENT__CONNECTION_PATTERN, oldConnectionPattern, connectionPattern)); - } - } - return connectionPattern; - } - - /** - * - * - * @generated - */ - public Collaboration basicGetConnectionPattern() { - return connectionPattern; - } - - /** - * - * - * @generated - */ - @Override - public void setConnectionPattern(Collaboration newConnectionPattern) { - Collaboration oldConnectionPattern = connectionPattern; - connectionPattern = newConnectionPattern; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INTERACTION_COMPONENT__CONNECTION_PATTERN, oldConnectionPattern, connectionPattern)); - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.INTERACTION_COMPONENT__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INTERACTION_COMPONENT__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.INTERACTION_COMPONENT__FOR_DISTRIBUTION: - return isForDistribution(); - case FCMPackage.INTERACTION_COMPONENT__CONNECTION_PATTERN: - if (resolve) return getConnectionPattern(); - return basicGetConnectionPattern(); - case FCMPackage.INTERACTION_COMPONENT__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.INTERACTION_COMPONENT__FOR_DISTRIBUTION: - setForDistribution((Boolean)newValue); - return; - case FCMPackage.INTERACTION_COMPONENT__CONNECTION_PATTERN: - setConnectionPattern((Collaboration)newValue); - return; - case FCMPackage.INTERACTION_COMPONENT__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.INTERACTION_COMPONENT__FOR_DISTRIBUTION: - setForDistribution(FOR_DISTRIBUTION_EDEFAULT); - return; - case FCMPackage.INTERACTION_COMPONENT__CONNECTION_PATTERN: - setConnectionPattern((Collaboration)null); - return; - case FCMPackage.INTERACTION_COMPONENT__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.INTERACTION_COMPONENT__FOR_DISTRIBUTION: - return forDistribution != FOR_DISTRIBUTION_EDEFAULT; - case FCMPackage.INTERACTION_COMPONENT__CONNECTION_PATTERN: - return connectionPattern != null; - case FCMPackage.INTERACTION_COMPONENT__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (forDistribution: "); //$NON-NLS-1$ - result.append(forDistribution); - result.append(')'); - return result.toString(); - } - -} // InteractionComponentImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InterceptionRuleImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InterceptionRuleImpl.java deleted file mode 100644 index 5c061d96327..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InterceptionRuleImpl.java +++ /dev/null @@ -1,341 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.InterceptionKind; -import org.eclipse.papyrus.FCM.InterceptionRule; -import org.eclipse.uml2.uml.Feature; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Property; - -/** - * - * An implementation of the model object 'Interception Rule'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl#getInterceptionKind Interception Kind}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl#getInterceptionSet Interception Set}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl#getBase_Property Base Property}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl#getBase_Operation Base Operation}
  • - *
- * - * @generated - */ -public class InterceptionRuleImpl extends EObjectImpl implements InterceptionRule { - /** - * The default value of the '{@link #getInterceptionKind() Interception Kind}' attribute. - * - * - * @see #getInterceptionKind() - * @generated - * @ordered - */ - protected static final InterceptionKind INTERCEPTION_KIND_EDEFAULT = InterceptionKind.INTERCEPT_SOME; - - /** - * The cached value of the '{@link #getInterceptionKind() Interception Kind}' attribute. - * - * - * @see #getInterceptionKind() - * @generated - * @ordered - */ - protected InterceptionKind interceptionKind = INTERCEPTION_KIND_EDEFAULT; - - /** - * The cached value of the '{@link #getInterceptionSet() Interception Set}' reference list. - * - * - * @see #getInterceptionSet() - * @generated - * @ordered - */ - protected EList interceptionSet; - - /** - * The cached value of the '{@link #getBase_Property() Base Property}' reference. - * - * - * @see #getBase_Property() - * @generated - * @ordered - */ - protected Property base_Property; - - /** - * The cached value of the '{@link #getBase_Operation() Base Operation}' reference. - * - * - * @see #getBase_Operation() - * @generated - * @ordered - */ - protected Operation base_Operation; - - /** - * - * - * @generated - */ - protected InterceptionRuleImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.INTERCEPTION_RULE; - } - - /** - * - * - * @generated - */ - @Override - public InterceptionKind getInterceptionKind() { - return interceptionKind; - } - - /** - * - * - * @generated - */ - @Override - public void setInterceptionKind(InterceptionKind newInterceptionKind) { - InterceptionKind oldInterceptionKind = interceptionKind; - interceptionKind = newInterceptionKind == null ? INTERCEPTION_KIND_EDEFAULT : newInterceptionKind; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INTERCEPTION_RULE__INTERCEPTION_KIND, oldInterceptionKind, interceptionKind)); - } - - /** - * - * - * @generated - */ - @Override - public EList getInterceptionSet() { - if (interceptionSet == null) { - interceptionSet = new EObjectResolvingEList(Feature.class, this, FCMPackage.INTERCEPTION_RULE__INTERCEPTION_SET); - } - return interceptionSet; - } - - /** - * - * - * @generated - */ - @Override - public Property getBase_Property() { - if (base_Property != null && base_Property.eIsProxy()) { - InternalEObject oldBase_Property = (InternalEObject)base_Property; - base_Property = (Property)eResolveProxy(oldBase_Property); - if (base_Property != oldBase_Property) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.INTERCEPTION_RULE__BASE_PROPERTY, oldBase_Property, base_Property)); - } - } - return base_Property; - } - - /** - * - * - * @generated - */ - public Property basicGetBase_Property() { - return base_Property; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Property(Property newBase_Property) { - Property oldBase_Property = base_Property; - base_Property = newBase_Property; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INTERCEPTION_RULE__BASE_PROPERTY, oldBase_Property, base_Property)); - } - - /** - * - * - * @generated - */ - @Override - public Operation getBase_Operation() { - if (base_Operation != null && base_Operation.eIsProxy()) { - InternalEObject oldBase_Operation = (InternalEObject)base_Operation; - base_Operation = (Operation)eResolveProxy(oldBase_Operation); - if (base_Operation != oldBase_Operation) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.INTERCEPTION_RULE__BASE_OPERATION, oldBase_Operation, base_Operation)); - } - } - return base_Operation; - } - - /** - * - * - * @generated - */ - public Operation basicGetBase_Operation() { - return base_Operation; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Operation(Operation newBase_Operation) { - Operation oldBase_Operation = base_Operation; - base_Operation = newBase_Operation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INTERCEPTION_RULE__BASE_OPERATION, oldBase_Operation, base_Operation)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_KIND: - return getInterceptionKind(); - case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_SET: - return getInterceptionSet(); - case FCMPackage.INTERCEPTION_RULE__BASE_PROPERTY: - if (resolve) return getBase_Property(); - return basicGetBase_Property(); - case FCMPackage.INTERCEPTION_RULE__BASE_OPERATION: - if (resolve) return getBase_Operation(); - return basicGetBase_Operation(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_KIND: - setInterceptionKind((InterceptionKind)newValue); - return; - case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_SET: - getInterceptionSet().clear(); - getInterceptionSet().addAll((Collection)newValue); - return; - case FCMPackage.INTERCEPTION_RULE__BASE_PROPERTY: - setBase_Property((Property)newValue); - return; - case FCMPackage.INTERCEPTION_RULE__BASE_OPERATION: - setBase_Operation((Operation)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_KIND: - setInterceptionKind(INTERCEPTION_KIND_EDEFAULT); - return; - case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_SET: - getInterceptionSet().clear(); - return; - case FCMPackage.INTERCEPTION_RULE__BASE_PROPERTY: - setBase_Property((Property)null); - return; - case FCMPackage.INTERCEPTION_RULE__BASE_OPERATION: - setBase_Operation((Operation)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_KIND: - return interceptionKind != INTERCEPTION_KIND_EDEFAULT; - case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_SET: - return interceptionSet != null && !interceptionSet.isEmpty(); - case FCMPackage.INTERCEPTION_RULE__BASE_PROPERTY: - return base_Property != null; - case FCMPackage.INTERCEPTION_RULE__BASE_OPERATION: - return base_Operation != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (interceptionKind: "); //$NON-NLS-1$ - result.append(interceptionKind); - result.append(')'); - return result.toString(); - } - -} // InterceptionRuleImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/OperatingSystemImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/OperatingSystemImpl.java deleted file mode 100644 index f102dd9fd32..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/OperatingSystemImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.OperatingSystem; - -/** - * - * An implementation of the model object 'Operating System'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.OperatingSystemImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class OperatingSystemImpl extends EObjectImpl implements OperatingSystem { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected OperatingSystemImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.OPERATING_SYSTEM; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.OPERATING_SYSTEM__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.OPERATING_SYSTEM__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.OPERATING_SYSTEM__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.OPERATING_SYSTEM__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.OPERATING_SYSTEM__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.OPERATING_SYSTEM__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - -} // OperatingSystemImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortImpl.java deleted file mode 100644 index 474cdf56684..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortImpl.java +++ /dev/null @@ -1,334 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.PortKind; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Image; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Stereotype; -import org.eclipse.uml2.uml.Type; - -/** - * - * An implementation of the model object 'Port'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.PortImpl#getBase_Port Base Port}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.PortImpl#getKind Kind}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.PortImpl#getType Type}
  • - *
- * - * @generated - */ -public class PortImpl extends ConfigurableElementInstanceImpl implements Port { - - /** - * The cached value of the '{@link #getBase_Port() Base Port}' reference. - * - * - * @see #getBase_Port() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Port base_Port; - - /** - * The cached value of the '{@link #getKind() Kind}' reference. - * - * - * @see #getKind() - * @generated - * @ordered - */ - protected PortKind kind; - - /** - * The cached value of the '{@link #getType() Type}' reference. - * - * - * @see #getType() - * @generated - * @ordered - */ - protected Type type; - - /** - * - * - * @generated - */ - protected PortImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.PORT; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Port getBase_Port() { - if (base_Port != null && base_Port.eIsProxy()) { - InternalEObject oldBase_Port = (InternalEObject)base_Port; - base_Port = (org.eclipse.uml2.uml.Port)eResolveProxy(oldBase_Port); - if (base_Port != oldBase_Port) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PORT__BASE_PORT, oldBase_Port, base_Port)); - } - } - return base_Port; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Port basicGetBase_Port() { - return base_Port; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Port(org.eclipse.uml2.uml.Port newBase_Port) { - org.eclipse.uml2.uml.Port oldBase_Port = base_Port; - base_Port = newBase_Port; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PORT__BASE_PORT, oldBase_Port, base_Port)); - } - - /** - * - * - * @generated - */ - @Override - public PortKind getKind() { - if (kind != null && kind.eIsProxy()) { - InternalEObject oldKind = (InternalEObject)kind; - kind = (PortKind)eResolveProxy(oldKind); - if (kind != oldKind) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PORT__KIND, oldKind, kind)); - } - } - return kind; - } - - /** - * - * - * @generated - */ - public PortKind basicGetKind() { - return kind; - } - - /** - * - * - * @generated - */ - @Override - public void setKind(PortKind newKind) { - PortKind oldKind = kind; - kind = newKind; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PORT__KIND, oldKind, kind)); - } - - /** - * - * - * @generated - */ - public Type getType() { - if (type != null && type.eIsProxy()) { - InternalEObject oldType = (InternalEObject)type; - type = (Type)eResolveProxy(oldType); - if (type != oldType) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PORT__TYPE, oldType, type)); - } - } - return type; - } - - /** - * - * - * @generated - */ - public Type basicGetType() { - return type; - } - - /** - * - * - * @generated - */ - public void setType(Type newType) { - Type oldType = type; - type = newType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PORT__TYPE, oldType, type)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.PORT__BASE_PORT: - if (resolve) return getBase_Port(); - return basicGetBase_Port(); - case FCMPackage.PORT__KIND: - if (resolve) return getKind(); - return basicGetKind(); - case FCMPackage.PORT__TYPE: - if (resolve) return getType(); - return basicGetType(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.PORT__BASE_PORT: - setBase_Port((org.eclipse.uml2.uml.Port)newValue); - return; - case FCMPackage.PORT__KIND: - setKind((PortKind)newValue); - return; - case FCMPackage.PORT__TYPE: - setType((Type)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.PORT__BASE_PORT: - setBase_Port((org.eclipse.uml2.uml.Port)null); - return; - case FCMPackage.PORT__KIND: - setKind((PortKind)null); - return; - case FCMPackage.PORT__TYPE: - setType((Type)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.PORT__BASE_PORT: - return base_Port != null; - case FCMPackage.PORT__KIND: - return kind != null; - case FCMPackage.PORT__TYPE: - return type != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * * @generated NOT - */ - static EList emptyList = new BasicEList(); - - /** - * @return icon (serialized in port kind) - * @generated NOT - */ - public Image getIcon() - { - if (getKind() != null) { - Class clazz = getKind().getBase_Class(); - - if (clazz instanceof Stereotype) { - EList icons = ((Stereotype) clazz).getIcons(); - if (base_Port.isConjugated()) { - if (icons.size() > 1) { - // standard position for conjugated icon - return icons.get(1); - } - } - else { - if (icons.size() > 0) { - return icons.get(0); - } - } - } - } - return null; - } - - @Override - public void update() { - MapUtil.update(this); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortKindImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortKindImpl.java deleted file mode 100644 index eb480f3a3fc..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortKindImpl.java +++ /dev/null @@ -1,351 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.PortKind; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Image; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Stereotype; - -/** - * - * An implementation of the model object 'Port Kind'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.PortKindImpl#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.PortKindImpl#getProvidedInterface Provided Interface}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.PortKindImpl#getRequiredInterface Required Interface}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.PortKindImpl#isExtendedPort Extended Port}
  • - *
- * - * @generated - */ -public class PortKindImpl extends EObjectImpl implements PortKind { - - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * The cached value of the '{@link #getProvidedInterface() Provided Interface}' reference. - * - * - * @see #getProvidedInterface() - * @generated - * @ordered - */ - protected Interface providedInterface; - - /** - * The cached value of the '{@link #getRequiredInterface() Required Interface}' reference. - * - * - * @see #getRequiredInterface() - * @generated - * @ordered - */ - protected Interface requiredInterface; - - /** - * The default value of the '{@link #isExtendedPort() Extended Port}' attribute. - * - * - * @see #isExtendedPort() - * @generated - * @ordered - */ - protected static final boolean EXTENDED_PORT_EDEFAULT = false; - - /** - * - * - * @generated - */ - protected PortKindImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.PORT_KIND; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PORT_KIND__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PORT_KIND__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Interface getProvidedInterface() { - if (providedInterface != null && providedInterface.eIsProxy()) { - InternalEObject oldProvidedInterface = (InternalEObject)providedInterface; - providedInterface = (Interface)eResolveProxy(oldProvidedInterface); - if (providedInterface != oldProvidedInterface) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PORT_KIND__PROVIDED_INTERFACE, oldProvidedInterface, providedInterface)); - } - } - return providedInterface; - } - - /** - * - * - * @generated - */ - public Interface basicGetProvidedInterface() { - return providedInterface; - } - - /** - * - * - * @generated - */ - @Override - public void setProvidedInterface(Interface newProvidedInterface) { - Interface oldProvidedInterface = providedInterface; - providedInterface = newProvidedInterface; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PORT_KIND__PROVIDED_INTERFACE, oldProvidedInterface, providedInterface)); - } - - /** - * - * - * @generated - */ - @Override - public Interface getRequiredInterface() { - if (requiredInterface != null && requiredInterface.eIsProxy()) { - InternalEObject oldRequiredInterface = (InternalEObject)requiredInterface; - requiredInterface = (Interface)eResolveProxy(oldRequiredInterface); - if (requiredInterface != oldRequiredInterface) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PORT_KIND__REQUIRED_INTERFACE, oldRequiredInterface, requiredInterface)); - } - } - return requiredInterface; - } - - /** - * - * - * @generated - */ - public Interface basicGetRequiredInterface() { - return requiredInterface; - } - - /** - * - * - * @generated - */ - @Override - public void setRequiredInterface(Interface newRequiredInterface) { - Interface oldRequiredInterface = requiredInterface; - requiredInterface = newRequiredInterface; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PORT_KIND__REQUIRED_INTERFACE, oldRequiredInterface, requiredInterface)); - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isExtendedPort() { - if (getBase_Class() != null) { - return getBase_Class().getOwnedPorts().size() > 0; - } - return false; - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isSetExtendedPort() { - return true; - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.PORT_KIND__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - case FCMPackage.PORT_KIND__PROVIDED_INTERFACE: - if (resolve) return getProvidedInterface(); - return basicGetProvidedInterface(); - case FCMPackage.PORT_KIND__REQUIRED_INTERFACE: - if (resolve) return getRequiredInterface(); - return basicGetRequiredInterface(); - case FCMPackage.PORT_KIND__EXTENDED_PORT: - return isExtendedPort(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.PORT_KIND__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - case FCMPackage.PORT_KIND__PROVIDED_INTERFACE: - setProvidedInterface((Interface)newValue); - return; - case FCMPackage.PORT_KIND__REQUIRED_INTERFACE: - setRequiredInterface((Interface)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.PORT_KIND__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - case FCMPackage.PORT_KIND__PROVIDED_INTERFACE: - setProvidedInterface((Interface)null); - return; - case FCMPackage.PORT_KIND__REQUIRED_INTERFACE: - setRequiredInterface((Interface)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.PORT_KIND__BASE_CLASS: - return base_Class != null; - case FCMPackage.PORT_KIND__PROVIDED_INTERFACE: - return providedInterface != null; - case FCMPackage.PORT_KIND__REQUIRED_INTERFACE: - return requiredInterface != null; - case FCMPackage.PORT_KIND__EXTENDED_PORT: - return isSetExtendedPort(); - } - return super.eIsSet(featureID); - } - - /** - * @return icon (serialized in port kind) - * @generated NOT - */ - public Image getIcon() - { - Class clazz = getBase_Class(); - - if (clazz instanceof Stereotype) { - EList icons = ((Stereotype) clazz).getIcons(); - if (icons.size() > 0) { - return icons.get(0); - } - } - return null; - } -} // PortKindImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ProgLanguageImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ProgLanguageImpl.java deleted file mode 100644 index 367900b37a8..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ProgLanguageImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.ProgLanguage; - -/** - * - * An implementation of the model object 'Prog Language'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.ProgLanguageImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class ProgLanguageImpl extends EObjectImpl implements ProgLanguage { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected ProgLanguageImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.PROG_LANGUAGE; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PROG_LANGUAGE__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PROG_LANGUAGE__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.PROG_LANGUAGE__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.PROG_LANGUAGE__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.PROG_LANGUAGE__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.PROG_LANGUAGE__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - -} // ProgLanguageImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/RuleApplicationImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/RuleApplicationImpl.java deleted file mode 100644 index 8e9183bee71..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/RuleApplicationImpl.java +++ /dev/null @@ -1,268 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.RuleApplication; - -/** - * - * An implementation of the model object 'Rule Application'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.RuleApplicationImpl#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.RuleApplicationImpl#getContainerRule Container Rule}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.RuleApplicationImpl#getBase_Package Base Package}
  • - *
- * - * @generated - */ -public class RuleApplicationImpl extends EObjectImpl implements RuleApplication { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * The cached value of the '{@link #getContainerRule() Container Rule}' reference list. - * - * - * @see #getContainerRule() - * @generated - * @ordered - */ - protected EList containerRule; - - /** - * The cached value of the '{@link #getBase_Package() Base Package}' reference. - * - * - * @see #getBase_Package() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Package base_Package; - - /** - * - * - * @generated - */ - protected RuleApplicationImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.RULE_APPLICATION; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.RULE_APPLICATION__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.RULE_APPLICATION__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public EList getContainerRule() { - if (containerRule == null) { - containerRule = new EObjectResolvingEList(ContainerRule.class, this, FCMPackage.RULE_APPLICATION__CONTAINER_RULE); - } - return containerRule; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Package getBase_Package() { - if (base_Package != null && base_Package.eIsProxy()) { - InternalEObject oldBase_Package = (InternalEObject)base_Package; - base_Package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_Package); - if (base_Package != oldBase_Package) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.RULE_APPLICATION__BASE_PACKAGE, oldBase_Package, base_Package)); - } - } - return base_Package; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Package basicGetBase_Package() { - return base_Package; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { - org.eclipse.uml2.uml.Package oldBase_Package = base_Package; - base_Package = newBase_Package; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.RULE_APPLICATION__BASE_PACKAGE, oldBase_Package, base_Package)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.RULE_APPLICATION__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - case FCMPackage.RULE_APPLICATION__CONTAINER_RULE: - return getContainerRule(); - case FCMPackage.RULE_APPLICATION__BASE_PACKAGE: - if (resolve) return getBase_Package(); - return basicGetBase_Package(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.RULE_APPLICATION__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - case FCMPackage.RULE_APPLICATION__CONTAINER_RULE: - getContainerRule().clear(); - getContainerRule().addAll((Collection)newValue); - return; - case FCMPackage.RULE_APPLICATION__BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.RULE_APPLICATION__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - case FCMPackage.RULE_APPLICATION__CONTAINER_RULE: - getContainerRule().clear(); - return; - case FCMPackage.RULE_APPLICATION__BASE_PACKAGE: - setBase_Package((org.eclipse.uml2.uml.Package)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.RULE_APPLICATION__BASE_CLASS: - return base_Class != null; - case FCMPackage.RULE_APPLICATION__CONTAINER_RULE: - return containerRule != null && !containerRule.isEmpty(); - case FCMPackage.RULE_APPLICATION__BASE_PACKAGE: - return base_Package != null; - } - return super.eIsSet(featureID); - } - -} // RuleApplicationImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/SingletonImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/SingletonImpl.java deleted file mode 100644 index 80a515a8d12..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/SingletonImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.Singleton; - -/** - * - * An implementation of the model object 'Singleton'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.SingletonImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class SingletonImpl extends EObjectImpl implements Singleton { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected SingletonImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.SINGLETON; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.SINGLETON__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.SINGLETON__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.SINGLETON__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.SINGLETON__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.SINGLETON__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.SINGLETON__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - -} // SingletonImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetArchitectureImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetArchitectureImpl.java deleted file mode 100644 index 5af10b34478..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetArchitectureImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.TargetArchitecture; - -/** - * - * An implementation of the model object 'Target Architecture'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.TargetArchitectureImpl#getBase_Class Base Class}
  • - *
- * - * @generated - */ -public class TargetArchitectureImpl extends EObjectImpl implements TargetArchitecture { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * - * - * @generated - */ - protected TargetArchitectureImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.TARGET_ARCHITECTURE; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TARGET_ARCHITECTURE__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET_ARCHITECTURE__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.TARGET_ARCHITECTURE__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.TARGET_ARCHITECTURE__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.TARGET_ARCHITECTURE__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.TARGET_ARCHITECTURE__BASE_CLASS: - return base_Class != null; - } - return super.eIsSet(featureID); - } - -} // TargetArchitectureImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetImpl.java deleted file mode 100644 index 512c44b434d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetImpl.java +++ /dev/null @@ -1,522 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.emf.ecore.util.EObjectResolvingEList; -import org.eclipse.papyrus.FCM.CompilerChain; -import org.eclipse.papyrus.FCM.ConfigOption; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.OperatingSystem; -import org.eclipse.papyrus.FCM.Target; -import org.eclipse.papyrus.FCM.TargetArchitecture; -import org.eclipse.uml2.uml.Node; - -/** - * - * An implementation of the model object 'Target'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getTargetArch Target Arch}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getOptions Options}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getBase_Node Base Node}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getUsedOS Used OS}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getAvailRAM Avail RAM}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getAvailROM Avail ROM}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getCompiler Compiler}
  • - *
- * - * @generated - */ -public class TargetImpl extends EObjectImpl implements Target { - /** - * The cached value of the '{@link #getTargetArch() Target Arch}' reference. - * - * - * @see #getTargetArch() - * @generated - * @ordered - */ - protected TargetArchitecture targetArch; - - /** - * The cached value of the '{@link #getOptions() Options}' reference list. - * - * - * @see #getOptions() - * @generated - * @ordered - */ - protected EList options; - - /** - * The cached value of the '{@link #getBase_Node() Base Node}' reference. - * - * - * @see #getBase_Node() - * @generated - * @ordered - */ - protected Node base_Node; - - /** - * The cached value of the '{@link #getUsedOS() Used OS}' reference. - * - * - * @see #getUsedOS() - * @generated - * @ordered - */ - protected OperatingSystem usedOS; - - /** - * The default value of the '{@link #getAvailRAM() Avail RAM}' attribute. - * - * - * @see #getAvailRAM() - * @generated - * @ordered - */ - protected static final int AVAIL_RAM_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getAvailRAM() Avail RAM}' attribute. - * - * - * @see #getAvailRAM() - * @generated - * @ordered - */ - protected int availRAM = AVAIL_RAM_EDEFAULT; - - /** - * The default value of the '{@link #getAvailROM() Avail ROM}' attribute. - * - * - * @see #getAvailROM() - * @generated - * @ordered - */ - protected static final int AVAIL_ROM_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getAvailROM() Avail ROM}' attribute. - * - * - * @see #getAvailROM() - * @generated - * @ordered - */ - protected int availROM = AVAIL_ROM_EDEFAULT; - - /** - * The cached value of the '{@link #getCompiler() Compiler}' reference. - * - * - * @see #getCompiler() - * @generated - * @ordered - */ - protected CompilerChain compiler; - - /** - * - * - * @generated - */ - protected TargetImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.TARGET; - } - - /** - * - * - * @generated - */ - @Override - public TargetArchitecture getTargetArch() { - if (targetArch != null && targetArch.eIsProxy()) { - InternalEObject oldTargetArch = (InternalEObject)targetArch; - targetArch = (TargetArchitecture)eResolveProxy(oldTargetArch); - if (targetArch != oldTargetArch) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TARGET__TARGET_ARCH, oldTargetArch, targetArch)); - } - } - return targetArch; - } - - /** - * - * - * @generated - */ - public TargetArchitecture basicGetTargetArch() { - return targetArch; - } - - /** - * - * - * @generated - */ - @Override - public void setTargetArch(TargetArchitecture newTargetArch) { - TargetArchitecture oldTargetArch = targetArch; - targetArch = newTargetArch; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET__TARGET_ARCH, oldTargetArch, targetArch)); - } - - /** - * - * - * @generated - */ - @Override - public EList getOptions() { - if (options == null) { - options = new EObjectResolvingEList(ConfigOption.class, this, FCMPackage.TARGET__OPTIONS); - } - return options; - } - - /** - * - * - * @generated - */ - @Override - public Node getBase_Node() { - if (base_Node != null && base_Node.eIsProxy()) { - InternalEObject oldBase_Node = (InternalEObject)base_Node; - base_Node = (Node)eResolveProxy(oldBase_Node); - if (base_Node != oldBase_Node) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TARGET__BASE_NODE, oldBase_Node, base_Node)); - } - } - return base_Node; - } - - /** - * - * - * @generated - */ - public Node basicGetBase_Node() { - return base_Node; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Node(Node newBase_Node) { - Node oldBase_Node = base_Node; - base_Node = newBase_Node; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET__BASE_NODE, oldBase_Node, base_Node)); - } - - /** - * - * - * @generated - */ - @Override - public OperatingSystem getUsedOS() { - if (usedOS != null && usedOS.eIsProxy()) { - InternalEObject oldUsedOS = (InternalEObject)usedOS; - usedOS = (OperatingSystem)eResolveProxy(oldUsedOS); - if (usedOS != oldUsedOS) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TARGET__USED_OS, oldUsedOS, usedOS)); - } - } - return usedOS; - } - - /** - * - * - * @generated - */ - public OperatingSystem basicGetUsedOS() { - return usedOS; - } - - /** - * - * - * @generated - */ - @Override - public void setUsedOS(OperatingSystem newUsedOS) { - OperatingSystem oldUsedOS = usedOS; - usedOS = newUsedOS; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET__USED_OS, oldUsedOS, usedOS)); - } - - /** - * - * - * @generated - */ - @Override - public int getAvailRAM() { - return availRAM; - } - - /** - * - * - * @generated - */ - @Override - public void setAvailRAM(int newAvailRAM) { - int oldAvailRAM = availRAM; - availRAM = newAvailRAM; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET__AVAIL_RAM, oldAvailRAM, availRAM)); - } - - /** - * - * - * @generated - */ - @Override - public int getAvailROM() { - return availROM; - } - - /** - * - * - * @generated - */ - @Override - public void setAvailROM(int newAvailROM) { - int oldAvailROM = availROM; - availROM = newAvailROM; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET__AVAIL_ROM, oldAvailROM, availROM)); - } - - /** - * - * - * @generated - */ - @Override - public CompilerChain getCompiler() { - if (compiler != null && compiler.eIsProxy()) { - InternalEObject oldCompiler = (InternalEObject)compiler; - compiler = (CompilerChain)eResolveProxy(oldCompiler); - if (compiler != oldCompiler) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TARGET__COMPILER, oldCompiler, compiler)); - } - } - return compiler; - } - - /** - * - * - * @generated - */ - public CompilerChain basicGetCompiler() { - return compiler; - } - - /** - * - * - * @generated - */ - @Override - public void setCompiler(CompilerChain newCompiler) { - CompilerChain oldCompiler = compiler; - compiler = newCompiler; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET__COMPILER, oldCompiler, compiler)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.TARGET__TARGET_ARCH: - if (resolve) return getTargetArch(); - return basicGetTargetArch(); - case FCMPackage.TARGET__OPTIONS: - return getOptions(); - case FCMPackage.TARGET__BASE_NODE: - if (resolve) return getBase_Node(); - return basicGetBase_Node(); - case FCMPackage.TARGET__USED_OS: - if (resolve) return getUsedOS(); - return basicGetUsedOS(); - case FCMPackage.TARGET__AVAIL_RAM: - return getAvailRAM(); - case FCMPackage.TARGET__AVAIL_ROM: - return getAvailROM(); - case FCMPackage.TARGET__COMPILER: - if (resolve) return getCompiler(); - return basicGetCompiler(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.TARGET__TARGET_ARCH: - setTargetArch((TargetArchitecture)newValue); - return; - case FCMPackage.TARGET__OPTIONS: - getOptions().clear(); - getOptions().addAll((Collection)newValue); - return; - case FCMPackage.TARGET__BASE_NODE: - setBase_Node((Node)newValue); - return; - case FCMPackage.TARGET__USED_OS: - setUsedOS((OperatingSystem)newValue); - return; - case FCMPackage.TARGET__AVAIL_RAM: - setAvailRAM((Integer)newValue); - return; - case FCMPackage.TARGET__AVAIL_ROM: - setAvailROM((Integer)newValue); - return; - case FCMPackage.TARGET__COMPILER: - setCompiler((CompilerChain)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.TARGET__TARGET_ARCH: - setTargetArch((TargetArchitecture)null); - return; - case FCMPackage.TARGET__OPTIONS: - getOptions().clear(); - return; - case FCMPackage.TARGET__BASE_NODE: - setBase_Node((Node)null); - return; - case FCMPackage.TARGET__USED_OS: - setUsedOS((OperatingSystem)null); - return; - case FCMPackage.TARGET__AVAIL_RAM: - setAvailRAM(AVAIL_RAM_EDEFAULT); - return; - case FCMPackage.TARGET__AVAIL_ROM: - setAvailROM(AVAIL_ROM_EDEFAULT); - return; - case FCMPackage.TARGET__COMPILER: - setCompiler((CompilerChain)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.TARGET__TARGET_ARCH: - return targetArch != null; - case FCMPackage.TARGET__OPTIONS: - return options != null && !options.isEmpty(); - case FCMPackage.TARGET__BASE_NODE: - return base_Node != null; - case FCMPackage.TARGET__USED_OS: - return usedOS != null; - case FCMPackage.TARGET__AVAIL_RAM: - return availRAM != AVAIL_RAM_EDEFAULT; - case FCMPackage.TARGET__AVAIL_ROM: - return availROM != AVAIL_ROM_EDEFAULT; - case FCMPackage.TARGET__COMPILER: - return compiler != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (availRAM: "); //$NON-NLS-1$ - result.append(availRAM); - result.append(", availROM: "); //$NON-NLS-1$ - result.append(availROM); - result.append(')'); - return result.toString(); - } - -} // TargetImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplateImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplateImpl.java deleted file mode 100644 index 9bae3f5d98c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplateImpl.java +++ /dev/null @@ -1,229 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.BindingHelper; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.Template; -import org.eclipse.uml2.uml.Element; - -/** - * - * An implementation of the model object 'Template'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.TemplateImpl#getBase_Element Base Element}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.TemplateImpl#getHelper Helper}
  • - *
- * - * @generated - */ -public class TemplateImpl extends EObjectImpl implements Template { - /** - * The cached value of the '{@link #getBase_Element() Base Element}' reference. - * - * - * @see #getBase_Element() - * @generated - * @ordered - */ - protected Element base_Element; - - /** - * The cached value of the '{@link #getHelper() Helper}' reference. - * - * - * @see #getHelper() - * @generated - * @ordered - */ - protected BindingHelper helper; - - /** - * - * - * @generated - */ - protected TemplateImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.TEMPLATE; - } - - /** - * - * - * @generated - */ - @Override - public Element getBase_Element() { - if (base_Element != null && base_Element.eIsProxy()) { - InternalEObject oldBase_Element = (InternalEObject)base_Element; - base_Element = (Element)eResolveProxy(oldBase_Element); - if (base_Element != oldBase_Element) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TEMPLATE__BASE_ELEMENT, oldBase_Element, base_Element)); - } - } - return base_Element; - } - - /** - * - * - * @generated - */ - public Element basicGetBase_Element() { - return base_Element; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Element(Element newBase_Element) { - Element oldBase_Element = base_Element; - base_Element = newBase_Element; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TEMPLATE__BASE_ELEMENT, oldBase_Element, base_Element)); - } - - /** - * - * - * @generated - */ - @Override - public BindingHelper getHelper() { - if (helper != null && helper.eIsProxy()) { - InternalEObject oldHelper = (InternalEObject)helper; - helper = (BindingHelper)eResolveProxy(oldHelper); - if (helper != oldHelper) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TEMPLATE__HELPER, oldHelper, helper)); - } - } - return helper; - } - - /** - * - * - * @generated - */ - public BindingHelper basicGetHelper() { - return helper; - } - - /** - * - * - * @generated - */ - @Override - public void setHelper(BindingHelper newHelper) { - BindingHelper oldHelper = helper; - helper = newHelper; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TEMPLATE__HELPER, oldHelper, helper)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.TEMPLATE__BASE_ELEMENT: - if (resolve) return getBase_Element(); - return basicGetBase_Element(); - case FCMPackage.TEMPLATE__HELPER: - if (resolve) return getHelper(); - return basicGetHelper(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.TEMPLATE__BASE_ELEMENT: - setBase_Element((Element)newValue); - return; - case FCMPackage.TEMPLATE__HELPER: - setHelper((BindingHelper)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.TEMPLATE__BASE_ELEMENT: - setBase_Element((Element)null); - return; - case FCMPackage.TEMPLATE__HELPER: - setHelper((BindingHelper)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.TEMPLATE__BASE_ELEMENT: - return base_Element != null; - case FCMPackage.TEMPLATE__HELPER: - return helper != null; - } - return super.eIsSet(featureID); - } - -} // TemplateImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplatePortImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplatePortImpl.java deleted file mode 100644 index 60fcc261168..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplatePortImpl.java +++ /dev/null @@ -1,181 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.PortKind; -import org.eclipse.papyrus.FCM.TemplatePort; -import org.eclipse.papyrus.FCM.util.MapUtil; - -/** - * - * An implementation of the model object 'Template Port'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.TemplatePortImpl#getBoundType Bound Type}
  • - *
- * - * @generated - */ -public class TemplatePortImpl extends PortImpl implements TemplatePort { - /** - * - * - * @generated - */ - protected TemplatePortImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.TEMPLATE_PORT; - } - - /** - * - * - * @generated - */ - @Override - public PortKind getBoundType() { - PortKind boundType = basicGetBoundType(); - return boundType != null && boundType.eIsProxy() ? (PortKind)eResolveProxy((InternalEObject)boundType) : boundType; - } - - /** - * - * - * - * @generated NOT - */ - public PortKind basicGetBoundType() { - if(base_Port == null) { - return null; - } - if(base_Port.isConjugated()) { - return MapUtil.getBoundType(this); - } - else { - return MapUtil.getBoundType(this); - } - - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void setBoundType(PortKind newBoundType) { - // TODO: implement this method to set the 'Bound Type' reference - // Ensure that you remove @generated or mark it @generated NOT - } - - /** - * - * - * - * @generated NOT - */ - @Override - public void unsetBoundType() { - // TODO: implement this method to unset the 'Bound Type' reference - // Ensure that you remove @generated or mark it @generated NOT - } - - /** - * - * - * - * @generated NOT - */ - @Override - public boolean isSetBoundType() { - // TODO: implement this method to return whether the 'Bound Type' reference is set - // Ensure that you remove @generated or mark it @generated NOT - return false; - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.TEMPLATE_PORT__BOUND_TYPE: - if (resolve) return getBoundType(); - return basicGetBoundType(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.TEMPLATE_PORT__BOUND_TYPE: - setBoundType((PortKind)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.TEMPLATE_PORT__BOUND_TYPE: - unsetBoundType(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.TEMPLATE_PORT__BOUND_TYPE: - return isSetBoundType(); - } - return super.eIsSet(featureID); - } - -} // TemplatePortImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/UseInstanceConfiguratorImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/UseInstanceConfiguratorImpl.java deleted file mode 100644 index 21b2bcece52..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/UseInstanceConfiguratorImpl.java +++ /dev/null @@ -1,228 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.EObjectImpl; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.InstanceConfigurator; -import org.eclipse.papyrus.FCM.UseInstanceConfigurator; - -/** - * - * An implementation of the model object 'Use Instance Configurator'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link org.eclipse.papyrus.FCM.impl.UseInstanceConfiguratorImpl#getBase_Class Base Class}
  • - *
  • {@link org.eclipse.papyrus.FCM.impl.UseInstanceConfiguratorImpl#getConfigurator Configurator}
  • - *
- * - * @generated - */ -public class UseInstanceConfiguratorImpl extends EObjectImpl implements UseInstanceConfigurator { - /** - * The cached value of the '{@link #getBase_Class() Base Class}' reference. - * - * - * @see #getBase_Class() - * @generated - * @ordered - */ - protected org.eclipse.uml2.uml.Class base_Class; - - /** - * The cached value of the '{@link #getConfigurator() Configurator}' reference. - * - * - * @see #getConfigurator() - * @generated - * @ordered - */ - protected InstanceConfigurator configurator; - - /** - * - * - * @generated - */ - protected UseInstanceConfiguratorImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FCMPackage.Literals.USE_INSTANCE_CONFIGURATOR; - } - - /** - * - * - * @generated - */ - @Override - public org.eclipse.uml2.uml.Class getBase_Class() { - if (base_Class != null && base_Class.eIsProxy()) { - InternalEObject oldBase_Class = (InternalEObject)base_Class; - base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); - if (base_Class != oldBase_Class) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.USE_INSTANCE_CONFIGURATOR__BASE_CLASS, oldBase_Class, base_Class)); - } - } - return base_Class; - } - - /** - * - * - * @generated - */ - public org.eclipse.uml2.uml.Class basicGetBase_Class() { - return base_Class; - } - - /** - * - * - * @generated - */ - @Override - public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { - org.eclipse.uml2.uml.Class oldBase_Class = base_Class; - base_Class = newBase_Class; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.USE_INSTANCE_CONFIGURATOR__BASE_CLASS, oldBase_Class, base_Class)); - } - - /** - * - * - * @generated - */ - @Override - public InstanceConfigurator getConfigurator() { - if (configurator != null && configurator.eIsProxy()) { - InternalEObject oldConfigurator = (InternalEObject)configurator; - configurator = (InstanceConfigurator)eResolveProxy(oldConfigurator); - if (configurator != oldConfigurator) { - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.USE_INSTANCE_CONFIGURATOR__CONFIGURATOR, oldConfigurator, configurator)); - } - } - return configurator; - } - - /** - * - * - * @generated - */ - public InstanceConfigurator basicGetConfigurator() { - return configurator; - } - - /** - * - * - * @generated - */ - @Override - public void setConfigurator(InstanceConfigurator newConfigurator) { - InstanceConfigurator oldConfigurator = configurator; - configurator = newConfigurator; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.USE_INSTANCE_CONFIGURATOR__CONFIGURATOR, oldConfigurator, configurator)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FCMPackage.USE_INSTANCE_CONFIGURATOR__BASE_CLASS: - if (resolve) return getBase_Class(); - return basicGetBase_Class(); - case FCMPackage.USE_INSTANCE_CONFIGURATOR__CONFIGURATOR: - if (resolve) return getConfigurator(); - return basicGetConfigurator(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FCMPackage.USE_INSTANCE_CONFIGURATOR__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)newValue); - return; - case FCMPackage.USE_INSTANCE_CONFIGURATOR__CONFIGURATOR: - setConfigurator((InstanceConfigurator)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FCMPackage.USE_INSTANCE_CONFIGURATOR__BASE_CLASS: - setBase_Class((org.eclipse.uml2.uml.Class)null); - return; - case FCMPackage.USE_INSTANCE_CONFIGURATOR__CONFIGURATOR: - setConfigurator((InstanceConfigurator)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FCMPackage.USE_INSTANCE_CONFIGURATOR__BASE_CLASS: - return base_Class != null; - case FCMPackage.USE_INSTANCE_CONFIGURATOR__CONFIGURATOR: - return configurator != null; - } - return super.eIsSet(featureID); - } - -} // UseInstanceConfiguratorImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ConnectorTypeUtil.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ConnectorTypeUtil.java deleted file mode 100644 index 919a7fcbff1..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ConnectorTypeUtil.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ - -package org.eclipse.papyrus.FCM.util; - -import java.util.ArrayList; - -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.uml2.uml.Collaboration; - -public class ConnectorTypeUtil { - - protected Collaboration connectionPattern = null; - - protected InteractionComponent connectorComp = null; - - protected FCMUtil.RoleBindingTable bindingTable = null; - - public FCMUtil.RoleBindingTable getRoleBindings(org.eclipse.papyrus.FCM.Connector connector) { - if (connector.getIc() instanceof InteractionComponent) { - connectorComp = connector.getIc(); - connectionPattern = connectorComp.getConnectionPattern(); - bindingTable = new FCMUtil.RoleBindingTable(); - for (org.eclipse.uml2.uml.ConnectableElement role : connectionPattern.getRoles()) { - bindingTable.addEntry(role, new ArrayList()); - } - return bindingTable; - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMAdapterFactory.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMAdapterFactory.java deleted file mode 100644 index ae3a258af53..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMAdapterFactory.java +++ /dev/null @@ -1,832 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.FCM.*; -import org.eclipse.papyrus.FCM.Assembly; -import org.eclipse.papyrus.FCM.AutoIndex; -import org.eclipse.papyrus.FCM.AutoIndexPerNode; -import org.eclipse.papyrus.FCM.BindTemplate; -import org.eclipse.papyrus.FCM.BindingHelper; -import org.eclipse.papyrus.FCM.CodeGenOptions; -import org.eclipse.papyrus.FCM.CompImplTemplate; -import org.eclipse.papyrus.FCM.CompToOOmapping; -import org.eclipse.papyrus.FCM.CompilerChain; -import org.eclipse.papyrus.FCM.ConfigOption; -import org.eclipse.papyrus.FCM.ConfigurableElementInstance; -import org.eclipse.papyrus.FCM.Configuration; -import org.eclipse.papyrus.FCM.ConfigurationProperty; -import org.eclipse.papyrus.FCM.Connector; -import org.eclipse.papyrus.FCM.ConnectorConfiguration; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.CopyAttributeValue; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.Flatten; -import org.eclipse.papyrus.FCM.Fragment; -import org.eclipse.papyrus.FCM.ImplementationGroup; -import org.eclipse.papyrus.FCM.ImplementationProperties; -import org.eclipse.papyrus.FCM.InitPrecedence; -import org.eclipse.papyrus.FCM.InstanceConfigurator; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.FCM.InterceptionRule; -import org.eclipse.papyrus.FCM.OperatingSystem; -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.PortKind; -import org.eclipse.papyrus.FCM.ProgLanguage; -import org.eclipse.papyrus.FCM.RuleApplication; -import org.eclipse.papyrus.FCM.Singleton; -import org.eclipse.papyrus.FCM.Target; -import org.eclipse.papyrus.FCM.TargetArchitecture; -import org.eclipse.papyrus.FCM.Template; -import org.eclipse.papyrus.FCM.TemplatePort; -import org.eclipse.papyrus.FCM.UseInstanceConfigurator; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * @see org.eclipse.papyrus.FCM.FCMPackage - * @generated - */ -public class FCMAdapterFactory extends AdapterFactoryImpl { - /** - * The cached model package. - * - * - * @generated - */ - protected static FCMPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public FCMAdapterFactory() { - if (modelPackage == null) { - modelPackage = FCMPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) { - if (object == modelPackage) { - return true; - } - if (object instanceof EObject) { - return ((EObject)object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch that delegates to the createXXX methods. - * - * - * @generated - */ - protected FCMSwitch modelSwitch = - new FCMSwitch() { - @Override - public Adapter caseTemplate(Template object) { - return createTemplateAdapter(); - } - @Override - public Adapter caseBindingHelper(BindingHelper object) { - return createBindingHelperAdapter(); - } - @Override - public Adapter caseConfigurationProperty(ConfigurationProperty object) { - return createConfigurationPropertyAdapter(); - } - @Override - public Adapter caseImplementationGroup(ImplementationGroup object) { - return createImplementationGroupAdapter(); - } - @Override - public Adapter caseAssembly(Assembly object) { - return createAssemblyAdapter(); - } - @Override - public Adapter caseFlatten(Flatten object) { - return createFlattenAdapter(); - } - @Override - public Adapter caseCompToOOmapping(CompToOOmapping object) { - return createCompToOOmappingAdapter(); - } - @Override - public Adapter caseProgLanguage(ProgLanguage object) { - return createProgLanguageAdapter(); - } - @Override - public Adapter caseCodeGenOptions(CodeGenOptions object) { - return createCodeGenOptionsAdapter(); - } - @Override - public Adapter caseInteractionComponent(InteractionComponent object) { - return createInteractionComponentAdapter(); - } - @Override - public Adapter caseSingleton(Singleton object) { - return createSingletonAdapter(); - } - @Override - public Adapter caseConnector(Connector object) { - return createConnectorAdapter(); - } - @Override - public Adapter caseConfigurableElementInstance(ConfigurableElementInstance object) { - return createConfigurableElementInstanceAdapter(); - } - @Override - public Adapter caseUseInstanceConfigurator(UseInstanceConfigurator object) { - return createUseInstanceConfiguratorAdapter(); - } - @Override - public Adapter caseInstanceConfigurator(InstanceConfigurator object) { - return createInstanceConfiguratorAdapter(); - } - @Override - public Adapter caseRuleApplication(RuleApplication object) { - return createRuleApplicationAdapter(); - } - @Override - public Adapter caseContainerRule(ContainerRule object) { - return createContainerRuleAdapter(); - } - @Override - public Adapter caseConfigOption(ConfigOption object) { - return createConfigOptionAdapter(); - } - @Override - public Adapter caseTemplatePort(TemplatePort object) { - return createTemplatePortAdapter(); - } - @Override - public Adapter casePort(Port object) { - return createPortAdapter(); - } - @Override - public Adapter casePortKind(PortKind object) { - return createPortKindAdapter(); - } - @Override - public Adapter caseDeploymentPlan(DeploymentPlan object) { - return createDeploymentPlanAdapter(); - } - @Override - public Adapter caseDerivedElement(DerivedElement object) { - return createDerivedElementAdapter(); - } - @Override - public Adapter caseCompImplTemplate(CompImplTemplate object) { - return createCompImplTemplateAdapter(); - } - @Override - public Adapter caseImplementationProperties(ImplementationProperties object) { - return createImplementationPropertiesAdapter(); - } - @Override - public Adapter caseOperatingSystem(OperatingSystem object) { - return createOperatingSystemAdapter(); - } - @Override - public Adapter caseTargetArchitecture(TargetArchitecture object) { - return createTargetArchitectureAdapter(); - } - @Override - public Adapter caseConfiguration(Configuration object) { - return createConfigurationAdapter(); - } - @Override - public Adapter caseInterceptionRule(InterceptionRule object) { - return createInterceptionRuleAdapter(); - } - @Override - public Adapter caseTarget(Target object) { - return createTargetAdapter(); - } - @Override - public Adapter caseCompilerChain(CompilerChain object) { - return createCompilerChainAdapter(); - } - @Override - public Adapter caseFragment(Fragment object) { - return createFragmentAdapter(); - } - @Override - public Adapter caseCopyAttributeValue(CopyAttributeValue object) { - return createCopyAttributeValueAdapter(); - } - @Override - public Adapter caseAutoIndex(AutoIndex object) { - return createAutoIndexAdapter(); - } - @Override - public Adapter caseAutoIndexPerNode(AutoIndexPerNode object) { - return createAutoIndexPerNodeAdapter(); - } - @Override - public Adapter caseInitPrecedence(InitPrecedence object) { - return createInitPrecedenceAdapter(); - } - @Override - public Adapter caseConnectorConfiguration(ConnectorConfiguration object) { - return createConnectorConfigurationAdapter(); - } - @Override - public Adapter caseBindTemplate(BindTemplate object) { - return createBindTemplateAdapter(); - } - @Override - public Adapter defaultCase(EObject object) { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * @param target the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) { - return modelSwitch.doSwitch((EObject)target); - } - - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Template Template}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.Template - * @generated - */ - public Adapter createTemplateAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.BindingHelper Binding Helper}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.BindingHelper - * @generated - */ - public Adapter createBindingHelperAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ConfigurationProperty Configuration Property}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.ConfigurationProperty - * @generated - */ - public Adapter createConfigurationPropertyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ImplementationGroup Implementation Group}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.ImplementationGroup - * @generated - */ - public Adapter createImplementationGroupAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Assembly Assembly}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.Assembly - * @generated - */ - public Adapter createAssemblyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Flatten Flatten}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.Flatten - * @generated - */ - public Adapter createFlattenAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.CompToOOmapping Comp To OOmapping}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.CompToOOmapping - * @generated - */ - public Adapter createCompToOOmappingAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ProgLanguage Prog Language}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.ProgLanguage - * @generated - */ - public Adapter createProgLanguageAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.CodeGenOptions Code Gen Options}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.CodeGenOptions - * @generated - */ - public Adapter createCodeGenOptionsAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.InteractionComponent Interaction Component}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.InteractionComponent - * @generated - */ - public Adapter createInteractionComponentAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Singleton Singleton}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.Singleton - * @generated - */ - public Adapter createSingletonAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Connector Connector}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.Connector - * @generated - */ - public Adapter createConnectorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ConfigurableElementInstance Configurable Element Instance}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.ConfigurableElementInstance - * @generated - */ - public Adapter createConfigurableElementInstanceAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.UseInstanceConfigurator Use Instance Configurator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.UseInstanceConfigurator - * @generated - */ - public Adapter createUseInstanceConfiguratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.InstanceConfigurator Instance Configurator}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.InstanceConfigurator - * @generated - */ - public Adapter createInstanceConfiguratorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.RuleApplication Rule Application}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.RuleApplication - * @generated - */ - public Adapter createRuleApplicationAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ContainerRule Container Rule}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.ContainerRule - * @generated - */ - public Adapter createContainerRuleAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ConfigOption Config Option}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.ConfigOption - * @generated - */ - public Adapter createConfigOptionAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.TemplatePort Template Port}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.TemplatePort - * @generated - */ - public Adapter createTemplatePortAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Port Port}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.Port - * @generated - */ - public Adapter createPortAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.PortKind Port Kind}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.PortKind - * @generated - */ - public Adapter createPortKindAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.DeploymentPlan Deployment Plan}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.DeploymentPlan - * @generated - */ - public Adapter createDeploymentPlanAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.DerivedElement Derived Element}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.DerivedElement - * @generated - */ - public Adapter createDerivedElementAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.CompImplTemplate Comp Impl Template}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.CompImplTemplate - * @generated - */ - public Adapter createCompImplTemplateAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ImplementationProperties Implementation Properties}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.ImplementationProperties - * @generated - */ - public Adapter createImplementationPropertiesAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.OperatingSystem Operating System}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.OperatingSystem - * @generated - */ - public Adapter createOperatingSystemAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.TargetArchitecture Target Architecture}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.TargetArchitecture - * @generated - */ - public Adapter createTargetArchitectureAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Configuration Configuration}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.Configuration - * @generated - */ - public Adapter createConfigurationAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.InterceptionRule Interception Rule}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.InterceptionRule - * @generated - */ - public Adapter createInterceptionRuleAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Target Target}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.Target - * @generated - */ - public Adapter createTargetAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.CompilerChain Compiler Chain}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.CompilerChain - * @generated - */ - public Adapter createCompilerChainAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Fragment Fragment}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.Fragment - * @generated - */ - public Adapter createFragmentAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.CopyAttributeValue Copy Attribute Value}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.CopyAttributeValue - * @generated - */ - public Adapter createCopyAttributeValueAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.AutoIndex Auto Index}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.AutoIndex - * @generated - */ - public Adapter createAutoIndexAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.AutoIndexPerNode Auto Index Per Node}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.AutoIndexPerNode - * @generated - */ - public Adapter createAutoIndexPerNodeAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.InitPrecedence Init Precedence}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.InitPrecedence - * @generated - */ - public Adapter createInitPrecedenceAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ConnectorConfiguration Connector Configuration}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.ConnectorConfiguration - * @generated - */ - public Adapter createConnectorConfigurationAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.BindTemplate Bind Template}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.papyrus.FCM.BindTemplate - * @generated - */ - public Adapter createBindTemplateAdapter() { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() { - return null; - } - -} // FCMAdapterFactory diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceFactoryImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceFactoryImpl.java deleted file mode 100644 index 5a422f9f93f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceFactoryImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.util; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; -import org.eclipse.emf.ecore.xmi.XMLResource; - -/** - * - * The Resource Factory associated with the package. - * - * @see org.eclipse.papyrus.FCM.util.FCMResourceImpl - * @generated - */ -public class FCMResourceFactoryImpl extends ResourceFactoryImpl { - /** - * Creates an instance of the resource factory. - * - * - * @generated - */ - public FCMResourceFactoryImpl() { - super(); - } - - /** - * Creates an instance of the resource. - * - * - * @generated - */ - @Override - public Resource createResource(URI uri) { - Resource result = new FCMResourceImpl(uri); - return result; - } - -} // FCMResourceFactoryImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceImpl.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceImpl.java deleted file mode 100644 index 44226971798..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.util; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; - -/** - * - * The Resource associated with the package. - * - * @see org.eclipse.papyrus.FCM.util.FCMResourceFactoryImpl - * @generated - */ -public class FCMResourceImpl extends XMLResourceImpl { - /** - * Creates an instance of the resource. - * - * - * @param uri the URI of the new resource. - * @generated - */ - public FCMResourceImpl(URI uri) { - super(uri); - } - -} // FCMResourceImpl diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMSwitch.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMSwitch.java deleted file mode 100644 index 8850265f42a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMSwitch.java +++ /dev/null @@ -1,938 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.util; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.util.Switch; -import org.eclipse.papyrus.FCM.*; -import org.eclipse.papyrus.FCM.Assembly; -import org.eclipse.papyrus.FCM.AutoIndex; -import org.eclipse.papyrus.FCM.AutoIndexPerNode; -import org.eclipse.papyrus.FCM.BindTemplate; -import org.eclipse.papyrus.FCM.BindingHelper; -import org.eclipse.papyrus.FCM.CodeGenOptions; -import org.eclipse.papyrus.FCM.CompImplTemplate; -import org.eclipse.papyrus.FCM.CompToOOmapping; -import org.eclipse.papyrus.FCM.CompilerChain; -import org.eclipse.papyrus.FCM.ConfigOption; -import org.eclipse.papyrus.FCM.ConfigurableElementInstance; -import org.eclipse.papyrus.FCM.Configuration; -import org.eclipse.papyrus.FCM.ConfigurationProperty; -import org.eclipse.papyrus.FCM.Connector; -import org.eclipse.papyrus.FCM.ConnectorConfiguration; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.CopyAttributeValue; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.FCM.FCMPackage; -import org.eclipse.papyrus.FCM.Flatten; -import org.eclipse.papyrus.FCM.Fragment; -import org.eclipse.papyrus.FCM.ImplementationGroup; -import org.eclipse.papyrus.FCM.ImplementationProperties; -import org.eclipse.papyrus.FCM.InitPrecedence; -import org.eclipse.papyrus.FCM.InstanceConfigurator; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.FCM.InterceptionRule; -import org.eclipse.papyrus.FCM.OperatingSystem; -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.PortKind; -import org.eclipse.papyrus.FCM.ProgLanguage; -import org.eclipse.papyrus.FCM.RuleApplication; -import org.eclipse.papyrus.FCM.Singleton; -import org.eclipse.papyrus.FCM.Target; -import org.eclipse.papyrus.FCM.TargetArchitecture; -import org.eclipse.papyrus.FCM.Template; -import org.eclipse.papyrus.FCM.TemplatePort; -import org.eclipse.papyrus.FCM.UseInstanceConfigurator; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * @see org.eclipse.papyrus.FCM.FCMPackage - * @generated - */ -public class FCMSwitch extends Switch { - /** - * The cached model package - * - * - * @generated - */ - protected static FCMPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public FCMSwitch() { - if (modelPackage == null) { - modelPackage = FCMPackage.eINSTANCE; - } - } - - /** - * Checks whether this is a switch for the given package. - * - * - * @param ePackage the package in question. - * @return whether this is a switch for the given package. - * @generated - */ - @Override - protected boolean isSwitchFor(EPackage ePackage) { - return ePackage == modelPackage; - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - @Override - protected T doSwitch(int classifierID, EObject theEObject) { - switch (classifierID) { - case FCMPackage.TEMPLATE: { - Template template = (Template)theEObject; - T result = caseTemplate(template); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.BINDING_HELPER: { - BindingHelper bindingHelper = (BindingHelper)theEObject; - T result = caseBindingHelper(bindingHelper); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.CONFIGURATION_PROPERTY: { - ConfigurationProperty configurationProperty = (ConfigurationProperty)theEObject; - T result = caseConfigurationProperty(configurationProperty); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.IMPLEMENTATION_GROUP: { - ImplementationGroup implementationGroup = (ImplementationGroup)theEObject; - T result = caseImplementationGroup(implementationGroup); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.ASSEMBLY: { - Assembly assembly = (Assembly)theEObject; - T result = caseAssembly(assembly); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.FLATTEN: { - Flatten flatten = (Flatten)theEObject; - T result = caseFlatten(flatten); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.COMP_TO_OOMAPPING: { - CompToOOmapping compToOOmapping = (CompToOOmapping)theEObject; - T result = caseCompToOOmapping(compToOOmapping); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.PROG_LANGUAGE: { - ProgLanguage progLanguage = (ProgLanguage)theEObject; - T result = caseProgLanguage(progLanguage); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.CODE_GEN_OPTIONS: { - CodeGenOptions codeGenOptions = (CodeGenOptions)theEObject; - T result = caseCodeGenOptions(codeGenOptions); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.INTERACTION_COMPONENT: { - InteractionComponent interactionComponent = (InteractionComponent)theEObject; - T result = caseInteractionComponent(interactionComponent); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.SINGLETON: { - Singleton singleton = (Singleton)theEObject; - T result = caseSingleton(singleton); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.CONNECTOR: { - Connector connector = (Connector)theEObject; - T result = caseConnector(connector); - if (result == null) result = caseConfigurableElementInstance(connector); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE: { - ConfigurableElementInstance configurableElementInstance = (ConfigurableElementInstance)theEObject; - T result = caseConfigurableElementInstance(configurableElementInstance); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.USE_INSTANCE_CONFIGURATOR: { - UseInstanceConfigurator useInstanceConfigurator = (UseInstanceConfigurator)theEObject; - T result = caseUseInstanceConfigurator(useInstanceConfigurator); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.INSTANCE_CONFIGURATOR: { - InstanceConfigurator instanceConfigurator = (InstanceConfigurator)theEObject; - T result = caseInstanceConfigurator(instanceConfigurator); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.RULE_APPLICATION: { - RuleApplication ruleApplication = (RuleApplication)theEObject; - T result = caseRuleApplication(ruleApplication); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.CONTAINER_RULE: { - ContainerRule containerRule = (ContainerRule)theEObject; - T result = caseContainerRule(containerRule); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.CONFIG_OPTION: { - ConfigOption configOption = (ConfigOption)theEObject; - T result = caseConfigOption(configOption); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.TEMPLATE_PORT: { - TemplatePort templatePort = (TemplatePort)theEObject; - T result = caseTemplatePort(templatePort); - if (result == null) result = casePort(templatePort); - if (result == null) result = caseConfigurableElementInstance(templatePort); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.PORT: { - Port port = (Port)theEObject; - T result = casePort(port); - if (result == null) result = caseConfigurableElementInstance(port); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.PORT_KIND: { - PortKind portKind = (PortKind)theEObject; - T result = casePortKind(portKind); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.DEPLOYMENT_PLAN: { - DeploymentPlan deploymentPlan = (DeploymentPlan)theEObject; - T result = caseDeploymentPlan(deploymentPlan); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.DERIVED_ELEMENT: { - DerivedElement derivedElement = (DerivedElement)theEObject; - T result = caseDerivedElement(derivedElement); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.COMP_IMPL_TEMPLATE: { - CompImplTemplate compImplTemplate = (CompImplTemplate)theEObject; - T result = caseCompImplTemplate(compImplTemplate); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.IMPLEMENTATION_PROPERTIES: { - ImplementationProperties implementationProperties = (ImplementationProperties)theEObject; - T result = caseImplementationProperties(implementationProperties); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.OPERATING_SYSTEM: { - OperatingSystem operatingSystem = (OperatingSystem)theEObject; - T result = caseOperatingSystem(operatingSystem); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.TARGET_ARCHITECTURE: { - TargetArchitecture targetArchitecture = (TargetArchitecture)theEObject; - T result = caseTargetArchitecture(targetArchitecture); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.CONFIGURATION: { - Configuration configuration = (Configuration)theEObject; - T result = caseConfiguration(configuration); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.INTERCEPTION_RULE: { - InterceptionRule interceptionRule = (InterceptionRule)theEObject; - T result = caseInterceptionRule(interceptionRule); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.TARGET: { - Target target = (Target)theEObject; - T result = caseTarget(target); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.COMPILER_CHAIN: { - CompilerChain compilerChain = (CompilerChain)theEObject; - T result = caseCompilerChain(compilerChain); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.FRAGMENT: { - Fragment fragment = (Fragment)theEObject; - T result = caseFragment(fragment); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.COPY_ATTRIBUTE_VALUE: { - CopyAttributeValue copyAttributeValue = (CopyAttributeValue)theEObject; - T result = caseCopyAttributeValue(copyAttributeValue); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.AUTO_INDEX: { - AutoIndex autoIndex = (AutoIndex)theEObject; - T result = caseAutoIndex(autoIndex); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.AUTO_INDEX_PER_NODE: { - AutoIndexPerNode autoIndexPerNode = (AutoIndexPerNode)theEObject; - T result = caseAutoIndexPerNode(autoIndexPerNode); - if (result == null) result = caseAutoIndex(autoIndexPerNode); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.INIT_PRECEDENCE: { - InitPrecedence initPrecedence = (InitPrecedence)theEObject; - T result = caseInitPrecedence(initPrecedence); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.CONNECTOR_CONFIGURATION: { - ConnectorConfiguration connectorConfiguration = (ConnectorConfiguration)theEObject; - T result = caseConnectorConfiguration(connectorConfiguration); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FCMPackage.BIND_TEMPLATE: { - BindTemplate bindTemplate = (BindTemplate)theEObject; - T result = caseBindTemplate(bindTemplate); - if (result == null) result = defaultCase(theEObject); - return result; - } - default: return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'Template'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Template'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseTemplate(Template object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Binding Helper'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Binding Helper'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseBindingHelper(BindingHelper object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Configuration Property'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Configuration Property'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseConfigurationProperty(ConfigurationProperty object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Implementation Group'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Implementation Group'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseImplementationGroup(ImplementationGroup object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Assembly'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Assembly'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseAssembly(Assembly object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Flatten'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Flatten'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseFlatten(Flatten object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Comp To OOmapping'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Comp To OOmapping'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseCompToOOmapping(CompToOOmapping object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Prog Language'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Prog Language'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseProgLanguage(ProgLanguage object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Code Gen Options'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Code Gen Options'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseCodeGenOptions(CodeGenOptions object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Interaction Component'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Interaction Component'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseInteractionComponent(InteractionComponent object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Singleton'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Singleton'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseSingleton(Singleton object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Connector'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Connector'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseConnector(Connector object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Configurable Element Instance'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Configurable Element Instance'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseConfigurableElementInstance(ConfigurableElementInstance object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Use Instance Configurator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Use Instance Configurator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseUseInstanceConfigurator(UseInstanceConfigurator object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Instance Configurator'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Instance Configurator'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseInstanceConfigurator(InstanceConfigurator object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Rule Application'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Rule Application'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseRuleApplication(RuleApplication object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Container Rule'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Container Rule'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseContainerRule(ContainerRule object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Config Option'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Config Option'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseConfigOption(ConfigOption object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Template Port'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Template Port'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseTemplatePort(TemplatePort object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Port'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Port'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePort(Port object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Port Kind'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Port Kind'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePortKind(PortKind object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Deployment Plan'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Deployment Plan'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseDeploymentPlan(DeploymentPlan object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Derived Element'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Derived Element'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseDerivedElement(DerivedElement object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Comp Impl Template'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Comp Impl Template'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseCompImplTemplate(CompImplTemplate object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Implementation Properties'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Implementation Properties'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseImplementationProperties(ImplementationProperties object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Operating System'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Operating System'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseOperatingSystem(OperatingSystem object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Target Architecture'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Target Architecture'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseTargetArchitecture(TargetArchitecture object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Configuration'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Configuration'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseConfiguration(Configuration object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Interception Rule'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Interception Rule'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseInterceptionRule(InterceptionRule object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Target'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Target'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseTarget(Target object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Compiler Chain'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Compiler Chain'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseCompilerChain(CompilerChain object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Fragment'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Fragment'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseFragment(Fragment object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Copy Attribute Value'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Copy Attribute Value'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseCopyAttributeValue(CopyAttributeValue object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Auto Index'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Auto Index'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseAutoIndex(AutoIndex object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Auto Index Per Node'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Auto Index Per Node'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseAutoIndexPerNode(AutoIndexPerNode object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Init Precedence'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Init Precedence'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseInitPrecedence(InitPrecedence object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Connector Configuration'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Connector Configuration'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseConnectorConfiguration(ConnectorConfiguration object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Bind Template'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Bind Template'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseBindTemplate(BindTemplate object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - @Override - public T defaultCase(EObject object) { - return null; - } - -} // FCMSwitch diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMUtil.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMUtil.java deleted file mode 100644 index 70d93d48d1b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMUtil.java +++ /dev/null @@ -1,240 +0,0 @@ -package org.eclipse.papyrus.FCM.util; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.FCM.Connector; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.FCM.RuleApplication; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.CollaborationUse; -import org.eclipse.uml2.uml.ConnectableElement; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.ValueSpecification; - - -public class FCMUtil { - - /** - * @param specification - * @param configPropertyName - * @return - */ - public static EList getConfigurationValue(InstanceSpecification specification, String configPropertyName) { - if (specification != null) { - for (Iterator i = specification.getSlots().iterator(); i.hasNext();) { - Slot currentSlot = i.next(); - if (currentSlot.getDefiningFeature() != null && - currentSlot.getDefiningFeature().getName().equals(configPropertyName)) { - return currentSlot.getValues(); - } - } - } - return null; - } - - /** - * @param interfaces - * @param interfaceName - * @return - */ - public static Interface findInterfaceByName(EList interfaces, String interfaceName) { - for (Iterator i = interfaces.iterator(); i.hasNext();) { - Interface currentInterface = i.next(); - if (currentInterface.getName().equals(interfaceName)) { - return currentInterface; - } - } - return null; - } - - /** - * A data structure to be used for the specification of how the roles of the collaboration associated with - * the type of param "connector" are bound to actual elements of the composite containing param "connector". - * This data structure contains an hashmap>: - * - keys must be roles of a Collaboration - * - values must be list of elements playing this role in the context of a particular composite - * - * @author ac221913 - * - */ - public static final class RoleBindingTable { - - private HashMap> table; - - public RoleBindingTable() { - this.table = new HashMap>(); - } - - public void addEntry(org.eclipse.uml2.uml.ConnectableElement role, - List playedBy) { - table.put(role, playedBy); - } - - public List getEntry(org.eclipse.uml2.uml.ConnectableElement role) { - return table.get(role); - } - - public Iterator iterator() { - return table.keySet().iterator(); - } - - public HashMap> getTable() { - return table; - } - - public ConnectableElement getRoleKeyByName(String roleName) { - for (ConnectableElement role : table.keySet()) { - if (role.getName().equals(roleName)) { - return role; - } - } - return null; - } - } - - /** - * Generate a connection pattern. Currently unused - * - * @param connectorComp - */ - public static void generateDefaultConnectionPattern(InteractionComponent connectorComp) { - org.eclipse.uml2.uml.Collaboration connectionPattern = - UMLFactory.eINSTANCE.createCollaboration(); - - // ((org.eclipse.uml2.uml.Package)connectorComp.getBase_Class().getOwner()).getPackagedElements().add(connectionPattern) ; - connectorComp.getBase_Class().getNestedClassifiers().add(connectionPattern); - connectionPattern.setName(connectorComp.getBase_Class().getName() + "ConnectionPattern"); //$NON-NLS-1$ - - org.eclipse.uml2.uml.Property connectorRole = - connectionPattern.createOwnedAttribute("connector", connectorComp.getBase_Class(), 1, 1); //$NON-NLS-1$ - for (Iterator i = connectorComp.getBase_Class().getOwnedPorts().iterator(); i.hasNext();) { - org.eclipse.uml2.uml.Port port = i.next(); - org.eclipse.uml2.uml.Property role; - org.eclipse.uml2.uml.Connector connector; - role = connectionPattern.createOwnedAttribute(port.getName(), null); - connector = connectionPattern.createOwnedConnector(""); //$NON-NLS-1$ - org.eclipse.uml2.uml.ConnectorEnd source, target; - source = connector.createEnd(); - source.setRole(port); - source.setPartWithPort(connectorRole); - target = connector.createEnd(); - target.setRole(role); - } - - connectorComp.setConnectionPattern(connectionPattern); - } - - /** - * TODO Move this method in ConnectorReification.java - * - * @author ac221913 - * - */ - public static void generateCollaborationUse(Connector connector) { - - InteractionComponent connectorCompGen = connector.getIc(); - - if (!(connectorCompGen instanceof InteractionComponent)) { - return; - } - InteractionComponent connectorComp = connectorCompGen; - org.eclipse.uml2.uml.Collaboration connectionPattern = - connectorComp.getConnectionPattern(); - - if (connectionPattern == null) { - FCMUtil.generateDefaultConnectionPattern(connectorComp); - connectionPattern = connectorComp.getConnectionPattern(); - } - - Class composite = (Class) connector.getBase_Connector().getOwner(); - CollaborationUse collaborationUse; - RoleBindingTable bindingTable = getConnectorRoleBindings(connector); - - if (bindingTable == null) { - return; - } - - collaborationUse = composite.createCollaborationUse("useOf" + connectionPattern.getName()); //$NON-NLS-1$ - collaborationUse.setType(connectionPattern); - for (Iterator i = bindingTable.iterator(); i.hasNext();) { - org.eclipse.uml2.uml.ConnectableElement role = i.next(); - org.eclipse.uml2.uml.Dependency roleBinding; - roleBinding = collaborationUse.createRoleBinding(role.getName() + "RoleBinding"); //$NON-NLS-1$ - roleBinding.getSuppliers().add(role); - for (Iterator j = bindingTable.getEntry(role).iterator(); j.hasNext();) { - roleBinding.getClients().add(j.next()); - } - } - } - - /** - * Computes a RoleBindingTable for a given ConnectorComp - * Implies that a java class has been defined in FCMProfile.util for this ConnectorComp, - * and that it encapsulates corresponding role binding rule - * - * @author ac221913 - * - */ - public static RoleBindingTable getConnectorRoleBindings(Connector connector) { - InteractionComponent connectorCompGen = connector.getIc(); - - if (!(connectorCompGen instanceof InteractionComponent)) { - return null; - } - InteractionComponent type = connectorCompGen; - - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] configElements = reg.getConfigurationElementsFor("fcmEmbeddingRule"); //$NON-NLS-1$ - for (IConfigurationElement configElement : configElements) { - try { - final String extConnName = configElement.getAttribute("connectorName"); //$NON-NLS-1$ - if (extConnName.equals(type.getBase_Class().getName())) { - final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ - if (obj instanceof IEmbeddingRule) { - return ((IEmbeddingRule) obj).getRoleBindings(connector); - } - } - } catch (CoreException exception) { - exception.printStackTrace(); - } - } - return null; - } - - /* - * return a list of all rules based on containment packages of rules - * from owning elements - */ - public static EList getAllContainerRules(Element element) { - EList list = new UniqueEList(); - if (element != null) { - for (EObject eObj : element.getStereotypeApplications()) { - if (eObj instanceof RuleApplication) { - list.addAll(((RuleApplication) eObj).getContainerRule()); - break; - } - } - element = element.getOwner(); - if (element != null) { - list.addAll(getAllContainerRules(element)); - } - } - return list; - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMXMLProcessor.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMXMLProcessor.java deleted file mode 100644 index c529e27f558..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMXMLProcessor.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ -package org.eclipse.papyrus.FCM.util; - -import java.util.Map; - -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.xmi.util.XMLProcessor; -import org.eclipse.papyrus.FCM.FCMPackage; - -/** - * This class contains helper methods to serialize and deserialize XML documents - * - * - * @generated - */ -public class FCMXMLProcessor extends XMLProcessor { - - /** - * Public constructor to instantiate the helper. - * - * - * @generated - */ - public FCMXMLProcessor() { - super((EPackage.Registry.INSTANCE)); - FCMPackage.eINSTANCE.eClass(); - } - - /** - * Register for "*" and "xml" file extensions the FCMResourceFactoryImpl factory. - * - * - * @generated - */ - @Override - protected Map getRegistrations() { - if (registrations == null) { - super.getRegistrations(); - registrations.put(XML_EXTENSION, new FCMResourceFactoryImpl()); - registrations.put(STAR_EXTENSION, new FCMResourceFactoryImpl()); - } - return registrations; - } - -} // FCMXMLProcessor diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IBindingHelper.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IBindingHelper.java deleted file mode 100644 index b512b1e5b11..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IBindingHelper.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ - -package org.eclipse.papyrus.FCM.util; - -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.TemplateBinding; - -/** - * BindingHelper interface. The interface is intentionally left empty. Implementations - * (such as Qompass designer) might check for subclasses. - * - */ -public interface IBindingHelper { - public void handleElement(TemplateBinding binding, Element object); -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IEmbeddingRule.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IEmbeddingRule.java deleted file mode 100644 index 8489c5377cc..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IEmbeddingRule.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ - -package org.eclipse.papyrus.FCM.util; - -import org.eclipse.papyrus.FCM.Connector; - -/** - * Interface used by extension point for embedding rules - */ -public interface IEmbeddingRule { - /** - * Return a role binding table for a given connector - * - * @param connector - * the connector - * @return role binding table - */ - public FCMUtil.RoleBindingTable getRoleBindings(Connector connector); - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IMappingRule.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IMappingRule.java deleted file mode 100644 index f5b37646df5..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IMappingRule.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ - -package org.eclipse.papyrus.FCM.util; - -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.uml2.uml.Type; - -/** - * Interface used by extension point for evaluation of interface mappings - * - */ -public interface IMappingRule { - /** - * Calculate the derived portType - * - * @param p - * the port - * @param update - * if true, make model updates during calculation of derived interface - * @return the list of provided interfaces - */ - public Type calcDerivedType(Port p, boolean update); - - /** - * check whether a port needs to be updated (recalculation of its derived interfaces) - * - * @return true, if update is required, false otherwise - */ - public boolean needsUpdate(Port p); -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ITemplateMappingRule.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ITemplateMappingRule.java deleted file mode 100644 index 2b9ef6487db..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ITemplateMappingRule.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ - -package org.eclipse.papyrus.FCM.util; - -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.PortKind; - - -/** - * A specific mapping rule for template ports, i.e. ports that facilitate the - * use of bound ports: i.e. instead of creating explicitly a binding for an extended - * port, the type of the port is used as actual and the kind points to an extended - * port - */ -public interface ITemplateMappingRule extends IMappingRule { - - /** - * Update the created binding - */ - public void updateBinding(Port port); - - /** - * Return the bound type - * - * @param port - * @return - */ - public PortKind getBoundType(Port port); -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/MapUtil.java b/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/MapUtil.java deleted file mode 100644 index c6e4699fb8e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/MapUtil.java +++ /dev/null @@ -1,530 +0,0 @@ -/** - * Copyright (c) 2013 CEA LIST - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher - Initial API and implementation - * - */ - -package org.eclipse.papyrus.FCM.util; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.FCM.Activator; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.PortKind; -import org.eclipse.papyrus.FCM.TemplatePort; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Namespace; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageMerge; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.Stereotype; -import org.eclipse.uml2.uml.TemplateSignature; -import org.eclipse.uml2.uml.TemplateableElement; -import org.eclipse.uml2.uml.Type; - - -/** - * This class is responsible for creating derived types associated with ports. The derived - * type is the class that will type the port and contain imported and used interfaces depending - * on the FCM type and kind. - * A particular question related to the derived types is into which package we can place them - * within the type hierarchy: - * (1) Of course, the package must be writable. That means, it must not belong to an imported library. - * (2) The source type must be clearly identifiable. - * (3) If a template get's instantiated, derived types within (if we place them there) might - * need (re-) instantiation. Imagine AMI_ interface that contains some of I's method. The creation of an AMI_I type within the template - * - * Therefore, a global "derived types" package is created within the model that owns the port. This - * package contains the full folder hierarchy of the original type and places the elements there. - * TODO: Align with package template instantiation => create type specific sub-folder, e.g. kind_type. Use package specific side-folders. - * Need specific solution for elements within template (placing into same template is finally not a good idea). - * Idea of package template (and the possibility to extend) was, that common elements are instantiated once. Thus, we will have interfaceBased_/UseInterface/Use.cpp, - * not UseInterface_/Use.cpp - * [Users choice to define template with additional package or not?] - */ -public class MapUtil { - - private static final String DERIVED_TYPES = "derivedTypes"; //$NON-NLS-1$ - - // specific treatment of "root" model that is created by eC3M for deployment - // It avoids that copies of derived interfaces are created at different places - // [better alternative: avoid problem by using set of models instead of single large one] - // [other option?: no-update flag?] - public static final String rootModelName = "root"; //$NON-NLS-1$ - - public static final String MAPPING_RULE_ID = "fcmPortMappingRule"; //$NON-NLS-1$ - - public enum CREATE_KIND { - CLASS, INTERFACE, NONE - } - - /** - * Get the template signature of a templateable element (typically a package). The class must - * (1) either own the signature - * (2) or merge with a package which owns the signature. - * Qompass enables the "extension" of existing packages via the package merge mechanism - * - * @param template - * The potential template - * @return the signature or null, if none can be found. - */ - public static TemplateSignature getSignature(TemplateableElement template) { - for (Element element : template.getOwnedElements()) { - if (element instanceof TemplateSignature) { - return (TemplateSignature) element; - } - } - - // enable multiple package templates sharing the same signature. - if (template instanceof Package) { - Package pkg = (Package) template; - for (PackageMerge pkgImport : pkg.getPackageMerges()) { - Package importedPkg = pkgImport.getMergedPackage(); - return getSignature(importedPkg); - } - } - return null; - } - - /** - * Return the top-level owner of an element. This function returns the same value - * as getModel, if the top-level element is a model and not contained in a template - * While this is the case for models, model libraries have a top-level package (not - * a model). In this case, getTop returns the top-level package whereas getModel - * would return null. - * In case of a package owning a signature, it returns this package instead of the - * top level package. The reason is that the derived types might reference elements - * of the template signature which would be undefined outside. - * - * @param element - * An element of which we want to query - * @return the top-level owning package - */ - public static Package getTop(Element element) { - while (element != null) { - Element owner = element.getOwner(); - if (owner == null) { - if (element instanceof Package) { - return (Package) element; - } - } else if ((owner instanceof Package) && (owner.getOwner() == null) && - ((Package) owner).getName().equals(rootModelName)) { - // Hack: assure that no new derived interface folder is created in "root" model - // that eC3M creates for deployment - if (element instanceof Package) { - // return (Package)element; - } - } - if ((element instanceof Package) && (getSignature((Package) element) != null)) { - return (Package) element; - } - element = owner; - } - return null; - } - - /** - * Apply the derived element stereotype to a model element - * - * @param element - * @return - */ - public static DerivedElement applyDE(Element element) { - Stereotype stereotype = element.getApplicableStereotype("FCM::DerivedElement"); //$NON-NLS-1$ - if (stereotype != null) { - EObject alreadyApplied = element.getStereotypeApplication(stereotype); - if (alreadyApplied instanceof DerivedElement) { - return (DerivedElement) alreadyApplied; - } - alreadyApplied = element.applyStereotype(stereotype); - if (alreadyApplied instanceof DerivedElement) { - return (DerivedElement) alreadyApplied; - } - } - return null; - } - - /** - * Get or create a package within another package (often the root of a model), i.e. return - * a package with the passed name, if it exists or create a new one of this name - * - * @param root - * a package potentially owning a certain element - * @param name - * the name of a package that should be be returned. - * @return a package - */ - public static Package getAndCreate(Package root, String name, boolean createOnDemand) { - NamedElement pkg = root.getOwnedMember(name); - if ((pkg == null) && createOnDemand) { - pkg = root.createNestedPackage(name); - } - return (Package) pkg; - } - - /** - * Get or create a derived interface for a port using a fixed prefix - * type name - * - * @param port - * The port - * @param prefix - * prefix string - * @param type - * type name - * @return the derived interface or null (if it cannot be created) - */ - public static Class getDerivedClass(Port port, String prefix) { - Type type = getOrCreateDerivedTypeIntern(port, prefix, port.getType(), CREATE_KIND.NONE); - return type instanceof Class ? (Class) type : null; - } - - /** - * Get or create a derived interface for a port using a fixed prefix - * type name - * - * @param port - * The port - * @param prefix - * prefix string - * @param type - * type name - * @return the derived interface or null (if it cannot be created) - */ - public static Class getDerivedClass(Port port, String prefix, boolean update) { - return update ? getOrCreateDerivedClass(port, prefix) : getDerivedClass(port, prefix); - } - - /** - * Get a derived interface of a port. The interface is searched within the derived types - * folder based on the passed prefix - * - * @param port - * The port - * @param prefix - * prefix string - * @param type - * FCM port type - * @return the derived interface or null (if it cannot be created) - */ - public static Interface getDerivedInterface(Port port, String prefix) { - Type type = getOrCreateDerivedTypeIntern(port, prefix, port.getType(), CREATE_KIND.NONE); - return type instanceof Interface ? (Interface) type : null; - } - - /** - * Get or create a derived interface for a port using a fixed prefix - * type name - * - * @param port - * The port - * @param prefix - * prefix string - * @param type - * type name - * @return the derived interface or null (if it cannot be created) - */ - public static Interface getDerivedInterface(Port port, String prefix, boolean update) { - return update ? getOrCreateDerivedInterface(port, prefix) : getDerivedInterface(port, prefix); - } - - /** - * Get or create a derived interface for a port using a fixed prefix - * type name - * - * @param port - * The port - * @param prefix - * prefix string - * @param type - * type name - * @param createKind - * if non NONE, create either an interfaces or a class, if it does not exist yet - * @return the derived interface or null (if it cannot be created) - */ - public static Class getOrCreateDerivedClass(Port port, String prefix) { - Type type = getOrCreateDerivedTypeIntern(port, prefix, port.getType(), CREATE_KIND.CLASS); - return type instanceof Class ? (Class) type : null; - } - - /** - * Get or create a derived interface for a port using a fixed prefix - * type name - * - * @param port - * The port - * @param prefix - * prefix string - * @param type - * type name - * @return the derived interface or null (if it cannot be created) - */ - public static Interface getOrCreateDerivedInterface(Port port, String prefix) { - Type type = getOrCreateDerivedTypeIntern(port, prefix, port.getType(), CREATE_KIND.INTERFACE); - return type instanceof Interface ? (Interface) type : null; - } - - - - /** - * This function returns a Package reference that corresponds to a qualified name. - * Packages are created, if not existing yet - the function is thus a bit similar to - * the unix "mkdir -p" command. Note that the main model within the list of name-spaces is - * ignored, in order to avoid that a sub-package within a model starts with the name - * of the model. - * - * @param model - * a model - * @param list - * a list of namespace elements (as can be obtained via allNamespaces), - * the top-level element is the last within the list. - * @param skipTop - * if true, skip top level namespace element - * @return - */ - public static Package getAndCreate(Package root, EList list, boolean createOnDemand) { - boolean first = true; - for (int i = list.size() - 1; i >= 0; i--) { - Namespace ns = list.get(i); - - if (first) { - first = false; - // Hack: if rootModel is used, skip top - // (avoid that new derived interface with "root" prefix is created) - if (ns.getName().equals(rootModelName)) { - continue; - } - } - NamedElement pkg = root.getOwnedMember(ns.getName()); - if ((pkg == null) && createOnDemand) { - // package does not exist => create it. - pkg = root.createNestedPackage(ns.getName()); - // copy stereotype to create package - } - if (!(pkg instanceof Package)) { - break; - } - root = (Package) pkg; - } - return root; - } - - /** - * Get or create a derived interface for a port using the name given by concatenation of prefix and - * type name - * - * @param port - * The port for which to create a derived interface. Only used to determine the place where the - * derived interface is placed - * @param prefix - * prefix string - * @param type - * type name - * @param createKind - * if non NONE, create either an interfaces or a class, if it does not exist yet - * @return - */ - private static Type getOrCreateDerivedTypeIntern(Port port, String prefix, Type type, CREATE_KIND createKind) { - String typeName = prefix + type.getName(); - - // create derived element in "derivedInterface" package within the model owning - // the port (which must be an FCM model, since the port carries the FCM stereotype) - Package baseModelOfPort = getTop(port.getBase_Port()); - // handle specific case of type within template. Place derived type into same template. - Package derivedTypes = getAndCreate(baseModelOfPort, DERIVED_TYPES, createKind != CREATE_KIND.NONE); - if (derivedTypes != null) { - Package owner = getAndCreate(derivedTypes, type.allNamespaces(), createKind != CREATE_KIND.NONE); - Interface intf = null; - - PackageableElement pe = owner.getPackagedElement(typeName); - if (pe instanceof Type) { - // type already exists - return (Type) pe; - } else if (createKind == CREATE_KIND.INTERFACE) { - // System.out.println ("Derived port types: create new interface " + typeName + " in package " + owner.getQualifiedName ()); - intf = owner.createOwnedInterface(typeName); - - // System.out.println ("Derived port types: Apply derived stereotype annotation to interface: " + intf.getQualifiedName()); - DerivedElement de = applyDE(intf); - if (de != null) { - // de may be null, if FCM is not properly applied - de.setSource(type); - } - return intf; - } else if (createKind == CREATE_KIND.CLASS) { - // System.out.println ("Derived port types: create new interface " + typeName + " in package " + owner.getQualifiedName ()); - Class newType = owner.createOwnedClass(typeName, false); - - // System.out.println ("Derived port types: Apply derived stereotype annotation to interface: " + intf.getQualifiedName()); - DerivedElement de = applyDE(newType); - if (de != null) { - // de may be null, if FCM is not properly applied - de.setSource(type); - } - return newType; - } - } - - // instead of returning null, return a dummy interface that indicates the user that an element needs updating. - PackageableElement portKinds = baseModelOfPort.getImportedMember("PortKinds"); //$NON-NLS-1$ - if (portKinds instanceof Package) { - PackageableElement pe = ((Package) portKinds).getPackagedElement("Please update derived elements"); //$NON-NLS-1$ - if (pe instanceof Interface) { - // dummy interface exists - return (Interface) pe; - } - } - return null; - } - - public static void addRealization(Class portType, Interface providedInterface) { - if (!portType.getImplementedInterfaces().contains(providedInterface)) { - portType.createInterfaceRealization(null, providedInterface); - } - } - - public static void addUsage(Class portType, Interface usedInterface) { - if (!portType.getUsedInterfaces().contains(usedInterface)) { - portType.createUsage(usedInterface); - } - } - - /** - * Calculate derived required interface in function of port type and kind - * - * @param port - * the port, for which the calculation should be done - * @return - */ - public static Type getDerivedType(final Port port) { - if (port.getBase_Port() == null) { - // should not happen, but can occur in case of corrupted XMI files - return null; - } - PortKind portKind = port.getKind(); - if (portKind != null) { - String ruleName = portKind.isExtendedPort() ? "ExtendedPort" : portKind.getBase_Class().getName(); //$NON-NLS-1$ - final IMappingRule mappingRule = getMappingRule(ruleName); - if (mappingRule != null) { - return mappingRule.calcDerivedType(port, false); - } - } - return null; - } - - - /** - * Obtain the mapping rule for a port when the name of the portKind is given - * - * @param portKindName - * the name of the port-kind - * - * @return the mapping rule or null, if no rule could be found - */ - public static IMappingRule getMappingRule(String portKindName) { - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] configElements = reg.getConfigurationElementsFor(Activator.PLUGIN_ID + "." + MAPPING_RULE_ID); //$NON-NLS-1$ - for (IConfigurationElement configElement : configElements) { - try { - final String extPortKindName = configElement.getAttribute("portKindName"); //$NON-NLS-1$ - if (extPortKindName.equals(portKindName)) { - final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ - if (obj instanceof IMappingRule) { - return (IMappingRule) obj; - } - } - } catch (CoreException exception) { - exception.printStackTrace(); - } - } - return null; - } - - /** - * Get the mapping rule for a port - * - * @param port - * the FCM port - * @return the mapping rule or null, if no rule could be found - */ - public static IMappingRule getMappingRule(final Port port) { - if (port.getBase_Port() == null) { - // should not happen, but can occur in case of corrupted XMI files - return null; - } - PortKind portKind = port.getKind(); - if (portKind == null) { - return null; - } - if (portKind.getBase_Class() != null) { - String ruleName = portKind.isExtendedPort() ? "ExtendedPort" : portKind.getBase_Class().getName(); //$NON-NLS-1$ - if (port instanceof TemplatePort) { - ruleName = "TemplatePort"; //$NON-NLS-1$ - } - return getMappingRule(ruleName); - } - return null; - } - - public static PortKind getBoundType(final Port port) { - if (port.getBase_Port() == null) { - // should not happen, but can occur in case of corrupted XMI files - return null; - } else { - String ruleName = "TemplatePort"; //$NON-NLS-1$ - final IMappingRule mappingRule = getMappingRule(ruleName); - if (mappingRule instanceof ITemplateMappingRule) { - return ((ITemplateMappingRule) mappingRule).getBoundType(port); - } - } - return null; - } - - /** - * Update the derived interfaces of a port this operation needs to be - * called in the context of an update command (transaction). - * - * @param port - */ - public static void update(final Port port) { - final IMappingRule mappingRule = getMappingRule(port); - - if (mappingRule != null) { - Type type = mappingRule.calcDerivedType(port, true); - port.getBase_Port().setType(type); - if (mappingRule instanceof ITemplateMappingRule) { - ((ITemplateMappingRule) mappingRule).updateBinding(port); - } - } - } - - /** - * Check whether a port needs to be updated, since its derived interfaces - * are either not existing or out of date. - * - * @param port - * @return - */ - public static boolean needsUpdate(final Port port) { - final IMappingRule mappingRule = getMappingRule(port); - if (mappingRule != null) { - return mappingRule.needsUpdate(port); - } - return false; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/.classpath b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/.classpath deleted file mode 100644 index 098194ca4b7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/.project b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/.project deleted file mode 100644 index 65c53f6af96..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/.project +++ /dev/null @@ -1,46 +0,0 @@ - - - org.eclipse.papyrus.qompass.designer.core - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.acceleo.ide.ui.acceleoBuilder - - - compilation.kind - compilation.absolute.path - - - compliance - pragmatic - - - resource.kind - xmi - - - - - - org.eclipse.acceleo.ide.ui.acceleoNature - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f42de363afa..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/META-INF/MANIFEST.MF deleted file mode 100644 index 9228e09c908..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/META-INF/MANIFEST.MF +++ /dev/null @@ -1,47 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.qompass.designer.core, - org.eclipse.papyrus.qompass.designer.core.commands, - org.eclipse.papyrus.qompass.designer.core.deployment, - org.eclipse.papyrus.qompass.designer.core.extensions, - org.eclipse.papyrus.qompass.designer.core.generate, - org.eclipse.papyrus.qompass.designer.core.listeners, - org.eclipse.papyrus.qompass.designer.core.preferences, - org.eclipse.papyrus.qompass.designer.core.sync, - org.eclipse.papyrus.qompass.designer.core.templates, - org.eclipse.papyrus.qompass.designer.core.transformations, - org.eclipse.papyrus.qompass.designer.core.transformations.connector, - org.eclipse.papyrus.qompass.designer.core.transformations.container, - org.eclipse.papyrus.qompass.designer.core.transformations.filters -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.emf.ecore, - org.eclipse.uml2.uml, - org.eclipse.ui.ide, - org.eclipse.core.resources, - org.eclipse.papyrus.fcm.profile;bundle-version="1.2.0", - org.eclipse.papyrus.marte.static.profile;bundle-version="1.2.0", - org.eclipse.papyrus.qompass.designer.vsl;bundle-version="1.2.0", - org.eclipse.papyrus.uml.modelexplorer.widgets;bundle-version="1.2.0", - org.eclipse.papyrus.uml.tools;bundle-version="1.2.0", - org.eclipse.acceleo.engine;bundle-version="3.1.0", - org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core;bundle-version="1.2.0", - org.eclipse.gmf.runtime.common.core;bundle-version="1.7.0", - org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0", - org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0", - org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", - org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.2.0", - org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", - org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", - org.eclipse.ui, - org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.2.0", - org.eclipse.uml2.uml.profile.standard;bundle-version="1.0.100" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.qompass.designer.core.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.core;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/about.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/about.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/about.properties deleted file mode 100644 index c06246d0761..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/about.properties +++ /dev/null @@ -1,12 +0,0 @@ -# about.properties -# contains externalized strings for about.ini -# java.io.Properties file (ISO 8859-1 with "\" escapes) -# fill-ins are supplied by about.mappings -# This file should be translated. - -featureText=Qompass \n\ -\n\ -Copyright (c) 2010 CEA LIST -\n\ -Qompass is a component oriented model based on the connector and container patterns. The implementation produces executable -models a user model and a set of imported model libraries. \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/build.acceleo b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/build.acceleo deleted file mode 100644 index f1dfcddd5ce..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/build.acceleo +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/build.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/build.properties deleted file mode 100644 index 064ad77eb48..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/build.properties +++ /dev/null @@ -1,12 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - about.properties,\ - build.acceleo,\ - about.html,\ - plugin.properties,\ - schema/ -customBuildCallbacks = build.acceleo -src.includes = about.html diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/plugin.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/plugin.properties deleted file mode 100644 index 25c07e8c396..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus extra: Qompass Designer core (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/plugin.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/plugin.xml deleted file mode 100644 index 48a64c5147e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/plugin.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/pom.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/pom.xml deleted file mode 100644 index 9d3891de40d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.qompass.designer.core - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/externalGenerator.exsd b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/externalGenerator.exsd deleted file mode 100644 index f91f9c1ce35..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/externalGenerator.exsd +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - [Enter description of this extension point.] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/instanceConfig.exsd b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/instanceConfig.exsd deleted file mode 100644 index 9ebd4f01529..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/instanceConfig.exsd +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - [Enter description of this extension point.] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/language.exsd b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/language.exsd deleted file mode 100644 index 9e7e950f59b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/language.exsd +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - [Enter description of this extension point.] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/ooTransformation.exsd b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/ooTransformation.exsd deleted file mode 100644 index ade738bcc04..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/ooTransformation.exsd +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - [Enter description of this extension point.] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/xtendGenerator.exsd b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/xtendGenerator.exsd deleted file mode 100644 index 33e2446c5f2..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/schema/xtendGenerator.exsd +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - [Enter description of this extension point.] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Activator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Activator.java deleted file mode 100644 index faee3a17083..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Activator.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.core; - -import org.eclipse.papyrus.infra.core.log.LogHelper; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.core"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - public static LogHelper log; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - - // register the login helper - log = new LogHelper(plugin); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CORBAtypeNames.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CORBAtypeNames.java deleted file mode 100644 index 641fb676985..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CORBAtypeNames.java +++ /dev/null @@ -1,23 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -public class CORBAtypeNames { - public static final String Octet = "corba::Octet"; //$NON-NLS-1$ - public static final String Long = "corba::Long"; //$NON-NLS-1$ - public static final String UnsignedLong = "corba::UnsignedLong"; //$NON-NLS-1$ - public static final String Short = "corba::Short"; //$NON-NLS-1$ - public static final String UnsignedShort = "corba::UnsignedShort"; //$NON-NLS-1$ -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CommandSupport.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CommandSupport.java deleted file mode 100644 index 1ec058df103..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CommandSupport.java +++ /dev/null @@ -1,118 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import java.util.Collections; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.operations.IOperationHistory; -import org.eclipse.core.commands.operations.IUndoableOperation; -import org.eclipse.core.commands.operations.OperationHistoryFactory; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForHandlers; - -/** - * Utility function. Allow execution of commands on a transactional command stack - * - * @author ansgar - * - */ -public class CommandSupport { - - /** - * Execute the passed Runnable within a command - * - * @param label - * @param command - */ - public static void exec(String label, ExecutionEvent event, final Runnable command) { - ServiceUtilsForHandlers serviceUtils = ServiceUtilsForHandlers.getInstance(); - try { - exec(serviceUtils.getTransactionalEditingDomain(event), label, command); - } catch (ServiceException e) { - Log.log(IStatus.ERROR, Log.UTILS, Messages.CommandSupport_NoEditingDomain, e); - } - } - - /** - * Execute the passed Runnable with result within a command - * - * @param label - * @param command - */ - public static void exec(String label, ExecutionEvent event, final RunnableWithResult command) { - // ServiceUtilsForActionHandlers serviceUtils = ServiceUtilsForActionHandlers.getInstance(); - ServiceUtilsForHandlers serviceUtils = ServiceUtilsForHandlers.getInstance(); - IOperationHistory history = OperationHistoryFactory.getOperationHistory(); - try { - history.execute(new AbstractTransactionalCommand(serviceUtils.getTransactionalEditingDomain(event), - label, Collections.EMPTY_LIST) { - - @Override - public CommandResult doExecuteWithResult(IProgressMonitor dummy, IAdaptable info) { - return command.run(); - } - }, null, null); - } catch (ExecutionException e) { - Log.log(IStatus.ERROR, Log.UTILS, Messages.CommandSupport_ErrorDuringCmdExec, e); - } catch (ServiceException e) { - Log.log(IStatus.ERROR, Log.UTILS, Messages.CommandSupport_NoEditingDomain, e); - } - } - - /** - * Execute the passed Runnable within a command - * - * @param label - * @param command - */ - public static void exec(TransactionalEditingDomain domain, String label, final Runnable command) { - if (domain == null) { - command.run(); - } - else { - IOperationHistory history = OperationHistoryFactory.getOperationHistory(); - try { - history.execute(new AbstractTransactionalCommand(domain, label, Collections.EMPTY_LIST) { - - @Override - public CommandResult doExecuteWithResult(IProgressMonitor dummy, IAdaptable info) { - command.run(); - return CommandResult.newOKCommandResult(); - } - }, null, null); - } catch (ExecutionException e) { - Activator.log.error(e); - } - } - } - - public static void exec(IUndoableOperation command) { - IOperationHistory history = OperationHistoryFactory.getOperationHistory(); - try { - history.execute(command, new NullProgressMonitor(), null); - } catch (ExecutionException e) { - Activator.log.error(e); - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ConfigUtils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ConfigUtils.java deleted file mode 100644 index ccd34b07609..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ConfigUtils.java +++ /dev/null @@ -1,93 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.ConfigurationProperty; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; - -public class ConfigUtils { - - /** - * Get the configuration properties of a class - * - * @param component - * @return - */ - public static EList getConfigAttributes(Classifier component) { - - EList list = new BasicEList(); - - for (Property part : component.getAllAttributes()) { - if (part instanceof Port) { - continue; - } - Element owner = part.getOwner(); - - if (Utils.allAttributesAreConfigAttributs()) { - // return all attributes - list.add(part); - } - // add all attributes of component types - else if (owner instanceof Class && Utils.isCompType((Class) owner)) { - list.add(part); - } - // otherwise add only attributes tagged as configuration properties - else if (StereotypeUtil.isApplied(part, ConfigurationProperty.class)) { - list.add(part); - } - } - return list; - } - - /** - * Get the configuration attributes behind a container rule - * TODO: rule might not be active - should we still configure it?? - * - * @param aRule - * @return - * @throws TransformationException - */ - public static EList getConfigAttributes(ContainerRule rule) throws TransformationException { - EList list = new BasicEList(); - Class composite = rule.getBase_Class(); // a rule should always have a base class, unless malformed - if (composite == null) { - throw new TransformationException(Messages.ConfigUtils_RuleWithoutBaseClass); - } - for (Property part : composite.getAttributes()) { - if (part instanceof Port) { - continue; - } - Type type = part.getType(); - if (StereotypeUtil.isApplied(part, ConfigurationProperty.class)) { - list.add(part); - } - if (type instanceof Class) { - list.addAll(getConfigAttributes((Class) type)); - } - } - - return list; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CreationUtils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CreationUtils.java deleted file mode 100644 index 517d8822117..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CreationUtils.java +++ /dev/null @@ -1,81 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Namespace; -import org.eclipse.uml2.uml.Package; - -public class CreationUtils { - - /** - * This function returns a Package reference that corresponds to a qualified name. - * Packages are created, if not existing yet - the function is thus a bit similar to - * the unix mkdir -p command. Note that the main model within the list of name-spaces is - * ignored, in order to avoid that a sub-package within a model starts with the name - * of the model. - * - * Caveat: imported elements must be checked beforehand. In case of a package import, - * getMembers (and getImportedMembers) will not return the name of the imported model - * but the elements (directly) owned by the imported model. - * Example: getMember ("BasicTypes") will return null whereas getMember ("CORBA") - * returns a package (CORBA is a package within the model library BasicTypes) - * - * @param model - * a model - * @param list - * a list of namespace elements (as can be obtained via allNamespaces), - * the top-level element is the last within the list. - * @param skipTop - * if true, skip top level namespace element - * @return - */ - public static Package getAndCreate(Package root, EList list, boolean skipTop) { - int offset = (skipTop ? 2 : 1); - for (int i = list.size() - offset; i >= 0; i--) { - Namespace ns = list.get(i); - Log.log(IStatus.INFO, Log.UTILS, "getAndCreate:" + ns.getName()); //$NON-NLS-1$ - - NamedElement pkg = root.getOwnedMember(ns.getName()); - if (pkg == null) { - // package does not exist => create it. - pkg = root.createNestedPackage(ns.getName()); - LazyCopier.copyID(ns, pkg); - // copy stereotype to create package - StUtils.copyStereotypes(ns, pkg); - } - if (!(pkg instanceof Package)) { - break; - } - root = (Package) pkg; - } - return root; - } - - public static Package getAndCreate(Package root, EList list) { - return getAndCreate(root, list, true); - } - - public static Package getAndCreate(Package root, String name) { - NamedElement pkg = root.getMember(name); - if (pkg == null) { - pkg = root.createNestedPackage(name); - } - return (Package) pkg; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Description.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Description.java deleted file mode 100644 index 58868c69112..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Description.java +++ /dev/null @@ -1,83 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.Element; - -public class Description { - - /** - * Return a description of an element. By default search comments that are - * owned by this elements owner (e.g. the class, if we search for a description of a property or the owning package, - * if we search for a description of a class) - * - * @param element - * the element for which to obtain a description - * @return the description of the element - */ - public static String getDescription(Element element) { - return getDescription(element.getOwner(), element); - } - - /** - * Convenience function: Return a description of an element. It will delegate to - * default getDescription, but returns a user specified text, if a description is - * not available in the model. - * - * @param element - * @param unavailable - * The text that is return, if no description is available - * @return - */ - public static String getDescription(Element element, String unavailable) { - String description = getDescription(element); - if (description != null) { - return description; - } - else { - return unavailable; - } - } - - /** - * Return a description or implementation description of an element, i.e. the - * first owned comment that annotated the passed element - * - * @param the - * owner of the comment - * the element for which to obtain a description - * @param annotated - * element - * the element for which to obtain a description - * @return the description of the element - */ - public static String getDescription(Element owner, Element annotatedElement) { - if (owner == null) { - return null; - } - // loop over all owned comments, check those that begins with - // "description" - for (Comment comment : owner.getOwnedComments()) { - // identify "right" comment via annotated element ref (to a specific - // class of the BasicCalls library) instead? - if (comment.getAnnotatedElements().contains(annotatedElement)) { - return comment.getBody(); - } - - } - return Messages.Description_NoAvail; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ElementFilter.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ElementFilter.java deleted file mode 100644 index 297433c35a6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ElementFilter.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.core; - -import org.eclipse.uml2.uml.Element; - -public interface ElementFilter { - public boolean acceptElement(Element element); -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/EnumService.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/EnumService.java deleted file mode 100644 index 0062ec0809f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/EnumService.java +++ /dev/null @@ -1,151 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Dependency; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Enumeration; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.UMLPackage; - - -/** - * Manage enumerations within Acceleo code - */ -public class EnumService { - - private static final String GLOBALENUMS = "globalenums"; //$NON-NLS-1$ - - public static void init() { - enumHash.clear(); - } - - /** - * Return qualified name of enum package which is used to prefix enumerations (namespace) - * - * @param dummy - * @return - */ - public static String enumSvcPrefix() { - return enumPkg.getQualifiedName(); - } - - public static String literalKey(Element dummy, String enumName, String literalKey) { - String prefix = "ID_"; //$NON-NLS-1$ - String literal = ""; //$NON-NLS-1$ - if (literalKey.equals("Port")) { //$NON-NLS-1$ - literal = prefix + TransformationContext.port.getName(); - } - else if (literalKey.equals("Formal")) { //$NON-NLS-1$ - literal = prefix + TransformationContext.formalParameter.getName(); - } - else if (literalKey.equals("Instance")) { //$NON-NLS-1$ - literal = prefix + TransformationContext.instance.getName(); - } - else if (literalKey.equals("Interface")) { //$NON-NLS-1$ - literal = prefix + TransformationContext.classifier.getName(); - } - return literal(enumName, literal); - } - - public static String quoteLiteral(Element dummy, String enumName, String literal) { - return Utils.quoteString(literal(enumName, literal)); - } - - /** - * Create a literal within an enumeration. Both, the literal and the enumeration may be an - * Acceleo template. If the name of the enumeration starts with "L", it is considered as a - * local enumeration, i.e. a nested classifier within the classifier (it has to be a class) - * from the transformation context. - * - * @param enumName - * the name of an enumeration - * @param literal - * the name of a literal within that enumeration. - * @return - */ - public static String literal(String enumName, String literal) { - Enumeration enumeration = enumHash.get(enumName); - if (enumPkg == null) { - return literal; - } - if (enumeration == null) { - if (enumName.startsWith("L")) { //$NON-NLS-1$ - // magic prefix for class local - enumeration = (Enumeration) - ((Class) TransformationContext.classifier).createNestedClassifier(enumName, UMLPackage.eINSTANCE.getEnumeration()); - } - else { - enumeration = enumPkg.createOwnedEnumeration(enumName); - } - enumHash.put(enumName, enumeration); - } - if (enumeration.getOwnedLiteral(literal) == null) { - enumeration.createOwnedLiteral(literal); - } - // declare a dependency to the enumeration from the current classifier - checkAndCreateDependency(TransformationContext.classifier, enumeration); - - if (enumName.startsWith("L")) { //$NON-NLS-1$ - return literal; - } - else { - return GLOBALENUMS + "::" + literal; //$NON-NLS-1$ - } - } - - /** - * Create a dependency between the passed classifier, target pair. The objective - * of this function is that code generators do the necessary to assure that the - * target is known within the classifier (e.g. include directives) - * - * @param classifier - * a classifier - * @param target - * a target, on which the classifier or its code depends. - */ - public static void checkAndCreateDependency(Classifier classifier, NamedElement target) { - boolean found = false; - for (Dependency dep : classifier.getClientDependencies()) { - if (dep.getSuppliers().contains(target)) { - found = true; - } - } - if (!found) { - Dependency dep = classifier.createDependency(target); - dep.setName(String.format("from %s to %s", classifier.getName(), target.getName())); //$NON-NLS-1$ - } - } - - public static void createEnumPackage(Package root) { - init(); - enumPkg = root.createNestedPackage(GLOBALENUMS); - } - - public static Package enumPkg; - - public static void createEnums() { - - } - - private static Map enumHash = new HashMap(); -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Log.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Log.java deleted file mode 100644 index 27777c02ea8..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Log.java +++ /dev/null @@ -1,99 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; - -/** - * Very simple message logging class - * - * @author ansgar - * - */ -public class Log { - - public static final int TRAFO_CONNECTOR = 1; - - public static final int TRAFO_CONTAINER = 2; - - public static final int TRAFO_COPY = 4; - - public static final int TRAFO_SYNC = 8; - - public static final int TEMPLATE_BINDING = 0x10; - - public static final int TEMPLATE_INSTANTIATION = 0x20; - - public static final int DEPLOYMENT = 0x40; - - public static final int DIALOGS = 0x80; - - public static final int UTILS = 0x100; - - public static final int CODEGEN = 0x200; - - public static final int CALC_PORTKIND = 0x400; - - static Map moduleMap; - - static String getModuleInfo(int moduleKind) { - if (moduleMap == null) { - moduleMap = new HashMap(); - moduleMap.put(TRAFO_CONNECTOR, "Trafo connector"); //$NON-NLS-1$ - moduleMap.put(TRAFO_CONTAINER, "Trafo container"); //$NON-NLS-1$ - moduleMap.put(TRAFO_COPY, "Trafo copy"); //$NON-NLS-1$ - moduleMap.put(TRAFO_SYNC, "Synchronization"); //$NON-NLS-1$ - moduleMap.put(TEMPLATE_BINDING, "Template binding"); //$NON-NLS-1$ - moduleMap.put(TEMPLATE_INSTANTIATION, "Template instantiation"); //$NON-NLS-1$ - moduleMap.put(DEPLOYMENT, "Template binding"); //$NON-NLS-1$ - moduleMap.put(DIALOGS, "Qompass dialogs"); //$NON-NLS-1$ - moduleMap.put(UTILS, "Utils"); //$NON-NLS-1$ - moduleMap.put(CODEGEN, "Code generation"); //$NON-NLS-1$ - moduleMap.put(CALC_PORTKIND, "Calculate portkind"); //$NON-NLS-1$ - } - return "Module " + moduleMap.get(moduleKind) + ": "; //$NON-NLS-1$ //$NON-NLS-2$ - } - - public static void log(int msgKind, int moduleKind, String message) { - if (msgKind == IStatus.INFO) { - // only show info messages that match a filter criterion - if ((moduleKind & moduleFilter) != 0) { - Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, message)); - } - } - else { - Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, message)); - } - } - - public static void log(int msgKind, int moduleKind, String message, Exception exception) { - if (msgKind == IStatus.INFO) { - // only show info messages that match a filter criterion - if ((moduleKind & moduleFilter) != 0) { - Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, exception.getMessage(), exception)); - } - } - else { - Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, exception.getMessage(), exception)); - } - } - - // TODO: make it a configuration property - static int moduleFilter = 0; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Messages.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Messages.java deleted file mode 100644 index 645e06be789..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Messages.java +++ /dev/null @@ -1,128 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.core; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.papyrus.qompass.designer.core.messages"; //$NON-NLS-1$ - - public static String BootLoaderGen_AtLeastOneBlockingCall; - - public static String BootLoaderGen_CannotApplyCppInclude; - - public static String BootLoaderGen_CannotRetrieveTemplate; - - public static String CommandSupport_NoEditingDomain; - public static String CommandSupport_ErrorDuringCmdExec; - public static String ConfigUtils_RuleWithoutBaseClass; - public static String DepCreation_SingletonExistsAlready; - - public static String DepCreation_CannotFindImplementation; - - public static String DepCreation_CircularReference; - - public static String DepCreation_DefiningFeatureNull; - - public static String DepCreation_FCMconnectorWithoutBaseClass; - - public static String DepCreation_InfoCreateDepPlan; - - public static String DepCreation_TypeInAttributeUndefined; - - public static String Deploy_0; - - public static String Description_NoAvail; - - public static String LWContainerTrafo_CannotApplyRule; - - public static String ConnectorBinding_CannotFindBinding; - public static String ConnectorBinding_CannotFindBindingForPort; - public static String ConnectorBinding_CannotFindConsistentBinding; - public static String ConnectorBinding_ConnectorsPort; - public static String ConnectorBinding_FormalAlreadyBound; - public static String ConnectorBinding_InfoActualReturnIntfIs; - public static String ConnectorBinding_InfoConnPortConnectedVia; - public static String ConnectorBinding_InfoConnectsPort; - public static String ConnectorBinding_InfoCreateBoundPackage; - - public static String ConnectorBinding_InfoMatchOtherEnd; - - public static String ConnectorBinding_InfoProvidedPortTypeMatches; - public static String ConnectorBinding_NoTemplateSignature; - - public static String ConnectorReification_CannotFindMatchingPort; - public static String ConnectorReification_CouldNotBind; - public static String ConnectorReification_CouldNotConnectPort; - public static String ConnectorReification_CouldNotConnectPortOfType; - public static String ConnectorReification_InfoAddConnectorPart; - public static String ConnectorReification_InfoPortTypes; - public static String ConnectorReification_RequiresUseOfPorts; - public static String ConnectorReification_TemplateTypeNotClass; - - public static String GenerateCode_CouldNotDeleteOldCode; - public static String GenerateCode_GeneratingCodeForNode; - public static String GenerateCode_GeneratingCode; - - public static String TemplateUtils_InfoCreateBoundPackage; - public static String TemplateUtils_InfoGetActualFrom; - public static String TemplateUtils_NoTemplateSignature; - - public static String TemplateInstantiation_TemplateIsNull; - public static String TemplateInstantiationListener_TrafoException; - - public static String CompImplTrafos_CannotFindType; - public static String CompImplTrafos_IntfNotImplemented; - public static String CompTypeTrafos_CannotFindType; - - public static String ContainerTrafo_CannotApplyRule; - public static String ContainerTrafo_CannotFindDelegationConn; - public static String ContainerTrafo_InterceptionRuleButNoInterceptor; - - public static String ContainerTrafo_RecursiveLWnotSupported; - - public static String InstanceConfigurator_InvalidPluginExtension; - - public static String InstantiateDepPlan_AcceleoErrors; - public static String InstantiateDepPlan_AcceleoErrorsCheckLog; - public static String InstantiateDepPlan_CannotGenModel; - public static String InstantiateDepPlan_CheckInputImportPkg; - public static String InstantiateDepPlan_CheckInputImportPkgNoRes; - public static String InstantiateDepPlan_CheckInputModelProfile3; - public static String InstantiateDepPlan_CheckInputModelProfileNoRes; - public static String InstantiateDepPlan_CheckInputModelProfileNoResNoName; - public static String InstantiateDepPlan_ConsultConsole; - public static String InstantiateDepPlan_DepPlanStereotypeNotInitialized; - public static String InstantiateDepPlan_ErrorsDuringTransformation; - public static String InstantiateDepPlan_IllegalArgumentDuringCopy; - public static String InstantiateDepPlan_InfoApplyProfile; - public static String InstantiateDepPlan_InfoDeployingForNode; - public static String InstantiateDepPlan_InfoExpandingConnectors; - public static String InstantiateDepPlan_InfoGeneratingModel; - public static String InstantiateDepPlan_InfoImportPackage; - public static String InstantiateDepPlan_InfoNoneAllocated; - public static String InstantiateDepPlan_TransformationException; - - public static String MainModelTrafo_ChangePartType; - public static String MainModelTrafo_NoDefiningFeature; - public static String MainModelTrafo_NoInstanceAssociated; - - public static String CompImplSync_InfoSyncIntf; - public static String CompImplSync_InfoSyncViaImpl; - public static String CompImplSync_InfoSyncViaType; - - public static String DepPlanUtils_CannotFindAttribute; - public static String DepPlanUtils_ConfigOfPropertyFailed; - - public static String UpdateUtils_CannotApplyFCMstereo; - - public static String XtendTemplateBinding_TemplateNotFound; - - public static String XtendTemplateBinding_TemplateResultIsNotAString; - - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ModelManagement.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ModelManagement.java deleted file mode 100644 index 2971bbff614..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ModelManagement.java +++ /dev/null @@ -1,174 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import java.io.IOException; -import java.util.Iterator; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.uml2.common.util.UML2Util; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Model; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.UMLPackage; - - -/** - * Manages a model (and the associated resource). Allows saving this model. It uses its own static resource set. - * - */ -public class ModelManagement { - - /** - * Create a new model and associate it with a temporary - * resource - */ - public ModelManagement() { - getResourceSet(); - model = UMLFactory.eINSTANCE.createModel(); - resource = resourceSet.createResource(URI.createURI("temp.uml")); //$NON-NLS-1$ - resource.getContents().add(model); - } - - public void dispose() { - if (model != null) { - model.destroy(); - model = null; - } - resourceSet.getResources().remove(resource); - } - - /** - * provide access to the model - * @return the model amanaged by this instance of model manager - */ - public Model getModel() { - return model; - } - - /** - * Save a model within the given project at a default location. - * This location is [model.name/].uml within the project root. - * @link ModelManagement.getPath - * - * @param project - * an existing project - */ - public void saveModel(IProject project) { - saveModel(getPath(project, null, null)); - } - - /** - * Save the model within a given project, folder and postfix - * @param project - * @param modelFolder - * @param modelPostfix - */ - public void saveModel(IProject project, String modelFolder, String modelPostfix) { - String path = this.getPath(project, modelFolder, this.getModel().getName() + modelPostfix); - this.saveModel(path); - } - - /** - * Save a model using the passed path - * - * @param path A string representation of the path. It will be converted into a URI - */ - public void saveModel(String path) { - - try { - URI uri = URI.createURI(path); - - ResourceSetImpl resourceSet = new ResourceSetImpl(); - resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE); - - resource.setURI(uri); - EList contents = resource.getContents(); - - for (Iterator allContents = UML2Util.getAllContents(model, true, false); allContents.hasNext();) { - EObject eObject = allContents.next(); - - if (eObject instanceof Element) { - contents.addAll(((Element) eObject).getStereotypeApplications()); - } - } - resource.save(null); - } - catch (IOException e) { - Activator.log.error(e); - } - } - - /** - * Return a path based on project, folder and file name - * - * @param project - * an existing project - * @param subFolder - * a subfolder within the project (will be created, if it does not exist) - * if null, the project will be saved in the root of the project - * @param filename - * the name of the file or null (in his case, the name of the - * model with the postfix .uml is used) - * - * @return The access path to a file - */ - public String getPath(IProject project, String subFolder, String filename) { - IFile file; - if (filename == null) { - filename = model.getName() + ".uml"; //$NON-NLS-1$ - } - if (subFolder != null) { - IFolder ifolder = project.getFolder(subFolder); - if (!ifolder.exists()) { - try { - ifolder.create(false, true, null); - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - file = ifolder.getFile(filename); - } else { - file = project.getFile(filename); - } - return file.getFullPath().toString(); - } - - /** - * return the used resource set (a singleton) - */ - public static ResourceSet getResourceSet() { - if (resourceSet == null) { - resourceSet = new ResourceSetImpl(); - } - return resourceSet; - } - - private static ResourceSet resourceSet = null; - - private Model model; - - private Resource resource; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/OperationUtils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/OperationUtils.java deleted file mode 100644 index cdd17f48716..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/OperationUtils.java +++ /dev/null @@ -1,166 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import java.util.Iterator; - -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Type; - -public class OperationUtils { - - /** - * Search an identical operation within a class. - * This function is useful to identify (and synchronize) operations. - * - * @param op - * The operation that should be compared. - * @param owner - * @return - */ - public static Operation getSameOperation(Operation op, Class owner) { - for (Operation ownedOp : owner.getOwnedOperations()) { - if (isSameOperation(op, ownedOp)) { - return ownedOp; - } - } - return null; - } - - /** - * Returns true, if two operations are identical. - * An operation is considered identical, if the operation name as well as all - * parameter names and types are equal. Type equality is checked via names only, to - * avoid that identical types within a source and a copy model would yield false. - * - * @param op1 - * first operation - * @param op2 - * second operation - * @return true, if operations are identical - */ - public static boolean isSameOperation(Operation op1, Operation op2) { - return isSameOperation(op1, op2, true); - } - - - /** - * Returns true, if two operations are identical with optional name check. - * An operation is considered identical, if the operation name (optional) as well as all - * parameter names and types are equal. Type equality is checked via names only, to - * avoid that identical types within a source and a copy model would yield false. - * - * @param op1 - * first operation - * @param op2 - * second operation - * @param checkName - * if true, require that operation names are identical - * @return true, if operations are identical - */ - public static boolean isSameOperation(Operation op1, Operation op2, boolean checkName) { - - if (checkName) { - String op1Name = op1.getName(); - String op2Name = op2.getName(); - // one of the names might be null - if (op1Name == null) { - if (op2Name != null) { - return false; - } - } else if (!op1Name.equals(op2Name)) { - return false; - } - } - Iterator parameters1 = op1.getOwnedParameters().iterator(); - Iterator parameters2 = op2.getOwnedParameters().iterator(); - while (parameters1.hasNext() && parameters2.hasNext()) { - Parameter parameter1 = parameters1.next(); - Parameter parameter2 = parameters2.next(); - String par1Name = parameter1.getName(); - Type par1Type = parameter1.getType(); - String par2Name = parameter2.getName(); - Type par2Type = parameter2.getType(); - - // one of the names might be null - if (par1Name == null) { - if (par2Name != null) { - return false; - } - } else if (!par1Name.equals(par2Name)) { - return false; - } - if ((par1Type != null) && (par2Type != null)) { - // the names might be null. Return false, if only one of these is set - if (par1Type.getName() == null) { - if (par2Type.getName() != null) { - return false; - } - } - else if (!par1Type.getName().equals(par2Type.getName())) { - return false; - } - } else if (par1Type != par2Type) { - // at least one of the two must be null due to earlier check - // return false, if they are different, i.e. not both null - return false; - } - if ((parameter1.getUpper() != parameter2.getUpper()) || - (parameter1.getLower() != parameter2.getLower())) { - return false; - } - } - // true, if operations have same number of parameters - return (parameters1.hasNext() == parameters2.hasNext()); - } - - - /** - * synchronize source and target operation - * (remove all parameters, copy afterwards) - * - * @param sourceOp - * the source operation - * @param targetOp - * the target operation - * @param newRoot - * a new root package (e.g. another model). Ensure that types referenced by the - * parameter exist within this root package (copy, if not). Null indicates that no copying - * should be done. - * @return - */ - public static void syncOperation(Operation sourceOp, Operation targetOp) { - if (targetOp != null) { - LazyCopier.copyFeatureModifiers(sourceOp, targetOp); - // ordered and unique are derived from ret-parameter - targetOp.setIsQuery(sourceOp.isQuery()); - targetOp.setIsAbstract(sourceOp.isAbstract()); - targetOp.setName(sourceOp.getName()); - targetOp.getOwnedParameters().clear(); - for (Parameter parameter : sourceOp.getOwnedParameters()) { - Type type = parameter.getType(); - Parameter newParameter = - targetOp.createOwnedParameter(parameter.getLabel(), type); - newParameter.setDirection(parameter.getDirection()); - LazyCopier.copyMultElemModifiers(parameter, newParameter); - StUtils.copyStereotypes(parameter, newParameter); - } - } - StUtils.copyStereotypes(sourceOp, targetOp); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortInfo.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortInfo.java deleted file mode 100644 index ad70a8b6ce0..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortInfo.java +++ /dev/null @@ -1,139 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Port; - -/** - * Information about a port that might belong to an extended port - * It provides information about that port while taking the (optional) parent - * port into account - */ -public class PortInfo { - /** - * Create a new portInfo. - * - * @param port - * @param parentPort - * optional parent port (null, if no parent port exist, i.e. if this is not an extended port) - */ - public PortInfo(Port port, Port parentPort) { - this.port = port; - this.parentPort = parentPort; - } - - /** - * Create a new port info for a combination of Port and sub-port. Compared to the constructor, - * the order of sub and parent port is inverted. The function is useful, if the sub-port is optional - * - * @param port - * a port - * @param subPort - * an optional supPort. - * @return - */ - public static PortInfo fromSubPort(Port port, Port subPort) { - if (subPort != null) { - return new PortInfo(subPort, port); - } - else { - return new PortInfo(port, null); - } - } - - /** - * @return The name of a port. Might be a composite name in case of an extended port - */ - public String getName() { - if (parentPort != null) { - return parentPort.getName() + "_" + port.getName(); //$NON-NLS-1$ - } - else { - return port.getName(); - } - } - - /** - * @return the interface provided by a port or sub-port. Takes conjugation of the parent port into account - */ - public Interface getProvided() { - if ((parentPort != null) && parentPort.isConjugated()) { - return PortUtils.getRequired(port); - } - else { - return PortUtils.getProvided(port); - } - } - - /** - * @return the interface required by a port or sub-port. Takes conjugation of the parent port into account - */ - public Interface getRequired() { - if ((parentPort != null) && parentPort.isConjugated()) { - return PortUtils.getProvided(port); - } - else { - return PortUtils.getRequired(port); - } - } - - /** - * @return true, if port is conjugated. Takes conjugation of the parent port into account - */ - public boolean isConjugated() { - if (parentPort != null) { - return port.isConjugated() != parentPort.isConjugated(); - } - else { - return port.isConjugated(); - } - } - - /** - * TODO: take multiplicity of parent-port into account - * - * @return upper multiplicity of port - */ - public int getUpper() { - return port.getUpper(); - } - - /** - * @return the described port or sub-port - */ - public Port getPort() { - return port; - } - - /** - * @return Return the port of the original model, i.e. the parent port, if the port is actually - * a sub-port or the original port, if it is not. - * This function is useful for testing delegation relationships (which could not exist for a - * sub-port) - */ - public Port getModelPort() { - if (parentPort != null) { - return parentPort; - } - else { - return port; - } - } - - protected Port port; - - protected Port parentPort; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortUtils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortUtils.java deleted file mode 100644 index 9c60af571ef..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortUtils.java +++ /dev/null @@ -1,312 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.PortKind; -import org.eclipse.papyrus.FCM.TemplatePort; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.EncapsulatedClassifier; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.util.UMLUtil; - -public class PortUtils { - - /** - * Return the provided interface associated with the UML port, i.e. - * the derived attribute of the FCM profile - * - * @param port - * the UML port - * @return the provided interface - */ - public static Interface getProvided(Port port) { - if (port.getProvideds().size() > 0) { - // return first standard UML provided port - return port.getProvideds().get(0); - } - return null; - } - - /** - * Return the required interface associated with the UML port, i.e. - * the derived attribute of the FCM profile - * - * @param port - * the UML port - * @return the required interface - */ - public static Interface getRequired(Port port) { - if (port.getRequireds().size() > 0) { - // return first standard UML required port - return port.getRequireds().get(0); - } - return null; - } - - /** - * Return the FCM port (static profile) from a given UML port - * - * @param port - * @return - */ - public static org.eclipse.papyrus.FCM.Port getFCMport(Port port) { - return UMLUtil.getStereotypeApplication(port, org.eclipse.papyrus.FCM.Port.class); - } - - /** - * Return the value of the FCM stereotype attribute "type" - * @param port a UML port - * @return the value of the type attribute - */ - public static Type getFCMType(Port port) { - org.eclipse.papyrus.FCM.Port fcmPort = getFCMport(port); - if (fcmPort != null) { - return fcmPort.getType(); - } - return null; - } - - /** - * Returns all ports (including inherited ones) for an encapsulated classifier - * It will also flatten extended ports - * - * @param ec - * @return - */ - public static EList getAllPorts(EncapsulatedClassifier ec) { - EList ports = new BasicEList(); - for (Property attribute : ec.getAllAttributes()) { - if (attribute instanceof Port) { - ports.add((Port) attribute); - } - } - - // TODO: for the moment, don't add aggregated ports to list. - /* - * ComponentType compType = = UMLUtil.getStereotypeApplication (ec, ComponentType.class); - * for (ContainerRule rule : compType.getContainerRule ()) - * { - * if ((rule.getExtensionKind () == ContainerExtKind.AGGREGATION) && - * (rule.getExtension () != null)) { - * ports.addAll (getAllPorts (rule.getExtension ().getBase_Class ())); - * } - * } - */ - - return ports; - } - - /** - * Returns all ports for an encapsulated classifier. Inherited ports are - * included, except if the superclass is already a component implementation. - * The motivation for this function is that ports inherited by a - * component implementation have already corresponding operations/attributes, - * only ports inherited by types need these definitions in subclasses. - * TODO: support for abstract implementations that partially implement ports - * - * @param ec - * @return - */ - public static EList getAllPorts2(EncapsulatedClassifier ec) { - EList ports = new BasicEList(); - - ports.addAll(ec.getOwnedPorts()); - - for (Classifier general : ec.getGenerals()) { - if ((general instanceof EncapsulatedClassifier) && (!Utils.isCompImpl(general))) { - ports.addAll(getAllPorts2((EncapsulatedClassifier) general)); - } - } - return ports; - } - - /** - * When given a list of ports, flatten the extended ports within this list - * and return a list of port-infos, i.e. information about ports. - * - * @param ports - * A list of ports - * @return A list of port-infos - */ - public static EList flattenExtendedPorts(EList ports) { - EList portInfos = new BasicEList(); - for (Port port : ports) { - portInfos.addAll(flattenExtendedPort(port)); - } - return portInfos; - } - - - /** - * Flatten the given extended port and return a list of port-infos. - * - * @param port - * @return - */ - public static EList flattenExtendedPort(Port port) { - EList portInfos = new BasicEList(); - if (isExtendedPort(port)) { - org.eclipse.papyrus.FCM.Port fcmPort = getFCMport(port); - org.eclipse.uml2.uml.Class cl; - if (isTemplatePort(port)) { - TemplatePort tp = UMLUtil.getStereotypeApplication(port, TemplatePort.class); - if (tp.getBoundType() == null) { - Activator.log.debug("Bound type of template port is null, choosing base class of kind instead"); //$NON-NLS-1$ - cl = fcmPort.getKind().getBase_Class(); - } - else { - cl = tp.getBoundType().getBase_Class(); - } - } - else { - cl = fcmPort.getKind().getBase_Class(); - } - if ((cl != null) && (getAllPorts(cl).size() > 0)) { - EList extendedPorts = getAllPorts(cl); - for (Port extendedPort : extendedPorts) { - portInfos.add(new PortInfo(extendedPort, port)); - } - } - } - else { - portInfos.add(new PortInfo(port, null)); - } - return portInfos; - } - - /** - * Return true, if the passed port is an extended port - * - * @param port - * @return - */ - public static boolean isExtendedPort(Port port) { - org.eclipse.papyrus.FCM.Port fcmPort = getFCMport(port); - if ((fcmPort != null) && (fcmPort.getKind() != null)) { - org.eclipse.uml2.uml.Class cl = fcmPort.getKind().getBase_Class(); - return ((cl != null) && (getAllPorts(cl).size() > 0)); - } - return false; - } - - /** - * Return true, if the passed port is an extended port - * - * @param port - * @return - */ - public static boolean isTemplatePort(Port port) { - return StereotypeUtil.isApplied(port, TemplatePort.class); - } - - /** - * Return the port kind, an element of the static profile - * - * @param port - * @return - */ - public static PortKind getKind(Port port) { - org.eclipse.papyrus.FCM.Port fcmPort = getFCMport(port); - if (fcmPort != null) { - return fcmPort.getKind(); - } - return null; - } - - /** - * Check whether two ports have the same port kind. Since different models apparently - * use different Java instances for the same port kind, the check is therefore based - * on the equality of full qualified name. - * - * @param portA - * @param portB - * @return true, if port kinds are identical - */ - public static boolean sameKinds(Port portA, Port portB) { - PortKind kindA = getKind(portA); - PortKind kindB = getKind(portB); - return kindA == kindB; - } - - /** - * Check whether two ports match, i.e. have the same kind but different conjugation (assembly) - * or same (delegation) - * - * @param portA - * first port - * @param portB - * second port - * @param isAssembly - * true, if the ports should be connected by an assembly connector (i.e. no delegation) - * @return true, if ports match - */ - public static boolean matches(Port portA, Port portB, boolean isAssembly) { - if (isAssembly) { - return ((portA.getType() == portB.getType()) && sameKinds(portA, portB) && (portA.isConjugated() != portB.isConjugated())); - } else { - // delegation - return ((portA.getType() == portB.getType()) && sameKinds(portA, portB) && (portA.isConjugated() == portB.isConjugated())); - } - } - - /** - * Check whether two ports are compatible. i.e. either match or are compatible interface wise - * - * @param portA - * @param portB - * @param isAssembly - * true, if the ports should be connected by an assembly connector (i.e. no delegation) - * @return - */ - public static boolean isCompatible(Port portA, Port portB, boolean isAssembly) { - if (matches(portA, portB, isAssembly)) { - return true; - } - // no match found, try weaker condition: find 1st match for provided ... - if (isAssembly) { - Interface reqA = PortUtils.getRequired(portA); - Interface reqB = PortUtils.getRequired(portB); - Interface prodA = PortUtils.getProvided(portA); - Interface prodB = PortUtils.getProvided(portB); - return (((reqA == null) && isSubInterface(prodA, reqB)) - || ((reqB == null) && isSubInterface(prodB, reqA)) - || (isSubInterface(prodA, reqB) && isSubInterface(prodB, reqA))); - } - else { - return (PortUtils.getProvided(portA) == PortUtils.getProvided(portB)) && - (PortUtils.getRequired(portB) == PortUtils.getRequired(portA)); - } - } - - /** - * return true, if intfA is a sub-interface of intfB, i.e. either both interfaces are identical or one of the - * super-classes (generalizations of intfA) is identical to B. - * more general than interfaceB. - * - * @param intfA - * @param intfB - * @return - */ - public static boolean isSubInterface(Interface intfA, Interface intfB) { - return (intfA == intfB) || (intfA != null && intfA.getGeneralizations().contains(intfB)); - } -} - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ProjectManagement.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ProjectManagement.java deleted file mode 100644 index 3f66f3752a2..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ProjectManagement.java +++ /dev/null @@ -1,55 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.PlatformUI; - -// TODO: mixture of model and Eclipse project management. Move parts depending on CDT into -// a separate plugin - -public class ProjectManagement { - - /** - * Retrieve current project from active editor - * - * @return - */ - public static IProject getCurrentProject() { - IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); - // Maybe null, if opened via model explorer - if (editorPart == null) { - return null; - } - IEditorInput editorInput = editorPart.getEditorInput(); - if (editorInput instanceof IFileEditorInput) { - return ((IFileEditorInput) editorInput).getFile().getProject(); - } - return null; - } - - public static IProject getNamedProject(String projectName) { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - if (root != null) { - return root.getProject(projectName); - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/RunnableWithResult.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/RunnableWithResult.java deleted file mode 100644 index 6ebca20a768..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/RunnableWithResult.java +++ /dev/null @@ -1,29 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import org.eclipse.gmf.runtime.common.core.command.CommandResult; - -public interface RunnableWithResult { - - /** - * Execute a command - * - * @return CommandResult.newOKCommandResult() if successful - * CommandResult.newErrorCommandResult(..) or - * CommandReuslt.newCancelCommandResult(..) otherwise - */ - public CommandResult run(); -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/StUtils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/StUtils.java deleted file mode 100644 index b58b188edc5..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/StUtils.java +++ /dev/null @@ -1,170 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Extension; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Stereotype; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Some functions around stereotype usage. - * - * @author ansgar - * - */ -public class StUtils { - - /** - * Copy the stereotype application from a source to a destination element. The - * function will also copy the stereotype attributes. - * - * @param source - * @param destination - * @return - */ - public static void copyStereotypes(LazyCopier copy, Element source, Element destination) { - for (Stereotype stereotype : source.getAppliedStereotypes()) { - copyAttributes(copy, stereotype.getQualifiedName(), source, destination); - } - } - - public static void copyStereotypes(Element source, Element destination) { - copyStereotypes(null, source, destination); - } - - /** - * copy stereotype attributes. - * - * TODO: verify if it is necessary to distinguish between stereoSource and stereoDest - * (they should be identical, if the resource sets are). - * => simplify code - * - * @param stereotypeName - * @param source - * @param destination - * @return - */ - @SuppressWarnings({ "unchecked" }) - public static boolean copyAttributes(LazyCopier copy, String stereotypeName, Element source, Element destination) { - Stereotype stereoSource = source.getAppliedStereotype(stereotypeName); - Stereotype stereoDest = destination.getApplicableStereotype(stereotypeName); - - if ((stereoSource == null) || (stereoDest == null)) { - return false; - } - Stereotype alreadyApplied = destination.getAppliedStereotype(stereotypeName); - if (alreadyApplied == null) { - // only apply stereotype, if not already applied - destination.applyStereotype(stereoDest); - } - - // getAllAttributes? (but have to avoid attribute base_Class which resets stereotype application) - for (Property attribute : stereoSource.getAllAttributes()) { - String attrName = attribute.getName(); - - if (attrName.length() >= 5) { - // do not copy base_ stereotypes (base_class, base_package and base_PackageImport) - if (attrName.startsWith(Extension.METACLASS_ROLE_PREFIX)) { - continue; - } - } - // do not copy derived attributes - if (attribute.isDerived()) { - continue; - } - - Object value = source.getValue(stereoSource, attrName); - // handle specific case: need to copy referenced containerExt, since it points to element - // in the original model. - /* - * if ((value instanceof EObject) && (attrName.equals ("containerExt"))) { - * continue; - * } - */ - - if (value instanceof EList) { - // copy list - EList newList = new BasicEList(); - for (Object valueEl : (EList) value) { - if ((copy != null) && (valueEl instanceof Element)) { - newList.add(copy.getCopy((Element) valueEl)); - } else { - newList.add(valueEl); - } - } - if (newList.size() > 0) { - destination.setValue(stereoDest, attrName, newList); - } - } else if ((copy != null) && (value instanceof EObject)) { - if (value instanceof Element) { - destination.setValue(stereoDest, attrName, copy.getCopy((Element) value)); - } - // TODO: remove hack: the template port references directly an element of a package template - // the package template should not be copied, but instantiated as done in class TemplatePort - else if (!stereotypeName.endsWith("TemplatePort")) { //$NON-NLS-1$ - // value is likely a stereotype application. If copy does a package-template instantiation, it would - // check whether the passed element is within the package template. This would fail if we pass - // a stereotype application. (could also do check within copy??) - EObject eValue = (EObject) value; - Element base = UMLUtil.getBaseElement(eValue); - EClass eClass = eValue.eClass(); - Element newBase = copy.getCopy(base); - for (EObject stereoApp : newBase.getStereotypeApplications()) { - if (stereoApp.eClass() == eClass) { - destination.setValue(stereoDest, attrName, stereoApp); - break; - } - } - } - else { - destination.setValue(stereoDest, attrName, value); - } - } - else { - destination.setValue(stereoDest, attrName, value); - } - } - - return true; - } - - public static boolean copyAttribute(String stereotypeName, String attribute, Element source, Element destination) { - Stereotype stereotype = source.getAppliedStereotype(stereotypeName); - if (stereotype == null) { - return false; - } - Object value = source.getValue(stereotype, attribute); - destination.applyStereotype(stereotype); - destination.setValue(stereotype, attribute, value); - return true; - } - - public static org.eclipse.papyrus.FCM.Connector getConnector(Connector connector) { - return UMLUtil.getStereotypeApplication(connector, org.eclipse.papyrus.FCM.Connector.class); - } - - public static boolean isConnector(Connector candidate) { - return StereotypeUtil.isApplied(candidate, org.eclipse.papyrus.FCM.Connector.class); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Stereotypes.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Stereotypes.java deleted file mode 100644 index fdaefbed703..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Stereotypes.java +++ /dev/null @@ -1,27 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -/** - * Specific stereotypes. This file should not be used any more - */ -@Deprecated -public class Stereotypes { - - // FT stereotypes - public final static String activeWithVoting = "FTRedundancy::FTActiveWithVotingReplicationStyle"; //$NON-NLS-1$ - - public final static String replicationInfo = "DP::Replication"; //$NON-NLS-1$ -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/UMLTool.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/UMLTool.java deleted file mode 100644 index 448fc15a77c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/UMLTool.java +++ /dev/null @@ -1,410 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * Christophe JOUVRAY - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.xmi.XMLResource; -import org.eclipse.papyrus.C_Cpp.External; -import org.eclipse.papyrus.C_Cpp.NoCodeGen; -import org.eclipse.papyrus.C_Cpp.Typedef; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.BehavioredClassifier; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Dependency; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.InterfaceRealization; -import org.eclipse.uml2.uml.Model; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Namespace; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.ParameterDirectionKind; -import org.eclipse.uml2.uml.PrimitiveType; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Relationship; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.util.UMLUtil; - - -/** - * Collection of utility functions. In contrast to core.Utils, it is chiefly used by xtend classes - */ -public class UMLTool { - - private static final String UNDERSCORE = "_"; //$NON-NLS-1$ - - public static EList reverse(EList list) { - EList reverseList = new BasicEList(); - for (int i=list.size()-1; i>=0; i--) { - reverseList.add(list.get(i)); - } - return reverseList; - } - - /** - * @param operation - * @return all in and inout parameters of an operation - */ - public static EList parametersInInout(Operation operation) { - EList list = new BasicEList(); - for (Parameter parameter : operation.getOwnedParameters()) { - if ((parameter.getDirection().getValue() == ParameterDirectionKind.IN) || - (parameter.getDirection().getValue() == ParameterDirectionKind.INOUT)) { - list.add(parameter); - } - } - return list; - } - - /** - * @param operation - * @return all out, inout and return parameters of an operation - */ - public static EList parametersOutInout(Operation operation) { - EList list = new BasicEList(); - for (Parameter parameter : operation.getOwnedParameters()) { - if ((parameter.getDirection().getValue() == ParameterDirectionKind.OUT) || - (parameter.getDirection().getValue() == ParameterDirectionKind.RETURN) || - (parameter.getDirection().getValue() == ParameterDirectionKind.INOUT)) { - list.add(parameter); - } - } - return list; - } - - /** - * @param operation - * @return all non-return parameters of an operation - */ - public static EList parametersNonRet(Operation operation) { - EList list = new BasicEList(); - for (Parameter parameter : operation.getOwnedParameters()) { - if (parameter.getDirection().getValue() != ParameterDirectionKind.RETURN) { - list.add(parameter); - } - } - return list; - } - - /** - * A small helper function that makes names compliant with variable - * names in programming languages such as C++ or Java - * Unlike varName2, replace scoping signs as well - */ - public static String varName(NamedElement element) { - return varName(element.getName()); - } - - /** - * A small helper function that makes names compliant with variable - * names in programming languages such as C++ or Java - * Unlike varName2, replace scoping signs as well - */ - public static String varName(String umlName) { - umlName = umlName.replace(".", UNDERSCORE); //$NON-NLS-1$ - umlName = umlName.replace(NamedElement.SEPARATOR, UNDERSCORE); - return varName2(umlName); - } - - /** - * A small helper function that makes names compliant with variable - * names in programming languages such as C++ or Java - * TODO: obviously, it is not complete (e.g. in case of "$", national characters ("ä", "é", ...) , ...) - */ - public static String varName2(NamedElement element) { - String umlName = element.getName(); - return varName2(umlName); - } - - /** - * Like varName, but does not replace "." with "_" - * - * @param umlName - * @return - */ - public static String varName2(String umlName) { - umlName = umlName.replace(" ", UNDERSCORE); //$NON-NLS-1$ - umlName = umlName.replace("-", UNDERSCORE); //$NON-NLS-1$ - umlName = umlName.replace("+", UNDERSCORE); //$NON-NLS-1$ - umlName = umlName.replace("?", UNDERSCORE); //$NON-NLS-1$ - return umlName; - } - - public static EList usedNamespaces(NamedElement element) { - EList list = new BasicEList(element.allNamespaces()); - - if (list.size() < 1) { - return null; - } - list.remove(list.size() - 1); // remove last element (top-level) - return list; - } - - /** - * Return a sequence of namespaces for a given element, starting from the "bottom" - * one, i.e. the one in which the element is contained. It will end before the - * searchNS namespace is reached. Returns null, if the element is not contained - * within the search namespace. - * - * @param element - * @param searchNS - * @return - */ - public static EList relativePath(Element element, Namespace searchNS) { - EList pathList = new BasicEList(); - Element owner = element.getOwner(); - if (!(owner instanceof Namespace)) { - // happens, if element is contained in a template signature - return null; - } - Namespace ns = (Namespace) owner; - while (ns != null) { - if (ns == searchNS) { - return pathList; - } - pathList.add(ns); - - ns = (Namespace) ns.getOwner(); - } - return null; - } - - /** - * This method returns all types that are referenced by a classifier. This includes - * attribute types, types within operations as well as inherited types. - * This is useful to generate the #includes - * (which is used by the Acceleo code within the packaging plugin) - */ - public static EList getReferencedClassifiers(Classifier classifier) { - EList list = new UniqueEList(); - list.addAll(classifier.parents()); - - if (classifier instanceof Class) { - // get classifiers referenced by attributes - for (Operation operation : ((Class) classifier).getOwnedOperations()) { - for (Parameter parameter : operation.getOwnedParameters()) { - Type type = parameter.getType(); - if (type instanceof Classifier) { - list.add((Classifier) type); - } - } - } - - // get classifiers referenced by attributes - for (Property attribute : ((Class) classifier).getOwnedAttributes()) { - Type type = attribute.getType(); - if (type instanceof Classifier) { - list.add((Classifier) type); - } - } - } - return list; - } - - /** - * TODO: copy&paste from C++ generator (& specific for C++) - * - * @param ne - * @return - */ - public static String cppQName(NamedElement ne) { - if ((StereotypeUtil.isApplied(ne, External.class)) || (StereotypeUtil.isApplied(ne, NoCodeGen.class))) { - return ne.getName(); - } else { - String qName = ne.getName(); - for (Namespace ns : ne.allNamespaces()) { - if (!(ns instanceof Model)) { - qName = ns.getName() + "::" + qName; //$NON-NLS-1$ - } - } - return qName; - } - } - - /** - * Return the name of a parameter. In case of a return parameter, always return the name - * "retValue". This is quite useful for marshalling operations (which need to assign a - * value to the return parameter, which is sometimes not initialized) - * - * @param parameter - * @return - */ - public static String paramName(Parameter parameter) { - if (parameter.getDirection().getValue() == ParameterDirectionKind.RETURN) { - return "retValue"; //$NON-NLS-1$ - } else { - return parameter.getName(); - } - } - - /** - * Return the interface which owns an operation that is implemented by a class. - * Context: a class might implement several interfaces by defining their operations. - * The operation is useful in the context of state-machines: when a transition is triggered by - * the call of an operation of the class, we'd like to know which interceptor (for which interface) - * belongs to it (since the operations are enumerated within each interface). - * TODO: move operation into state-chart java code - * TODO: would not work for ROOM ports typed with a collaboration - * - * @param operation - * @return the interface which the operation belongs - */ - public static Interface implementsInterface(Operation operation) { - Element owner = operation.getOwner(); - if (owner instanceof BehavioredClassifier) { - String name = operation.getName(); - EList types = new BasicEList(); - for (Parameter parameter : operation.getOwnedParameters()) { - types.add(parameter.getType()); - } - // loop over implemented realizations. Do not rely on FCM derivedElement information - // as it might be missing on some models (it would point from an operation of the class - // to the associated operation of the interface) - for (InterfaceRealization ir : ((BehavioredClassifier) owner).getInterfaceRealizations()) { - // check for types to allow for overloading - Operation candidate = ir.getContract().getOwnedOperation(name, null, types); - if (candidate != null) { - return ir.getContract(); - } - } - } - else if (owner instanceof Interface) { - return (Interface) owner; - } - return null; - } - - /** - * Convenience function: Declare a dependency from source to destination. The function checks, - * if a dependency already exists to avoid double dependencies. - * - * @param source - * source type of the dependency - * @param dest - * destination of the dependency - */ - public static void declareDependency(Type source, Type dest) { - // check, if a relationship already exists - for (Relationship dependency : source.getRelationships(UMLPackage.eINSTANCE.getDependency())) { - if (((Dependency) dependency).getSuppliers().contains(dest)) { - return; - } - } - source.createDependency(dest); - } - - /** - * Get the URI fragment of an element within your model - * Useful for transmitting model references - * - * @param element - * a UML element - * @return - */ - public static String fragment(Element element) { - Resource resource = element.eResource(); - // TODO: use EcoreUtil getURI (InternalEObject) instead? - - if (resource instanceof XMLResource) { - XMLResource xmlResource = (XMLResource) resource; - return "\"" + xmlResource.getURIFragment(element) + "\""; //$NON-NLS-1$//$NON-NLS-2$ - } - return null; - } - - /** - * Get the XML (URI) Id of an element within your model - * Useful for transmitting model references - * - * @param element - * a UML element - * @return - */ - public static String xmlID(Element element) { - Resource resource = element.eResource(); - // TODO: use EcoreUtil getURI (InternalEObject) instead? - - if (resource instanceof XMLResource) { - XMLResource xmlResource = (XMLResource) resource; - return xmlResource.getID(element); - } - return null; - } - - public static String getURI(Element element) { - Resource resource = element.eResource(); - if (resource != null) { - URI uri = resource.getURI(); - return uri.toString(); - } - return null; - } - - /** - * - * TODO: Specific to C++ - * - * @param type - * a type - * @return return the definition of a typedef, if the type has been defined via - * the stereotype CppType of the Cpp profile - */ - public static String dereferenceTypedef(Type type) { - if (type instanceof PrimitiveType) { - Typedef cppType = UMLUtil.getStereotypeApplication(type, Typedef.class); - if (cppType != null) { - return cppType.getDefinition(); - } - } - return type.getQualifiedName(); - - } - - public static String encodeID(String uri) { - // _ becomes escape character. original _ is __, '-' becomes _M - return uri. - replace(UNDERSCORE, UNDERSCORE + UNDERSCORE). - replace("-", "_M"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - public static String decodeID(String encodedURI) { - String result = ""; //$NON-NLS-1$ - for (int i = 0; i < encodedURI.length(); i++) { - char c = encodedURI.charAt(i); - if (c == '_') { - char next = encodedURI.charAt(i + 1); - if (next == 'M') { - result += '-'; - } else if (next == '_') { - result += '_'; - } - i++; - } - else { - result += c; - } - } - return result; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Utils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Utils.java deleted file mode 100644 index ea3a43f07c7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Utils.java +++ /dev/null @@ -1,471 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Iterator; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.FCM.Assembly; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.FCM.Singleton; -import org.eclipse.papyrus.qompass.designer.core.preferences.QompassPreferenceConstants; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.AggregationKind; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.util.UMLUtil; - -public class Utils { - - public static final String QUOTE = "\""; //$NON-NLS-1$ - - /** - * Retrieve an element from a list of named elements via its name - * - * @param namedElementList - * @param name - * @return - */ - public static NamedElement getNamedElementFromList( - EList namedElementList, String name) { - Iterator namedElements = namedElementList - .iterator(); - while (namedElements.hasNext()) { - NamedElement namedElement = namedElements.next(); - if (namedElement.getName().equals(name)) { - return namedElement; - } - } - return null; - } - - /** - * return the top-level owner of an element. This function returns the same - * value as getModel, if the top-level element is a model. While this is the - * case for models, model libraries have a top-level package (not a model). - * In this case, getTop returns the top-level package whereas getModel would - * return null. - * - * @param element - * @return the top-level owning package - * @deprecated Use getRootPackage method in oep.uml.tools.utils.PackageUtil - */ - @Deprecated - public static Package getTop(Element element) { - while (element != null) { - Element owner = element.getOwner(); - if (owner == null) { - if (element instanceof Package) { - return (Package) element; - } - } - element = owner; - } - return null; - } - - /** - * Return package at first level. Useful, since last model transformation - * will put elements under a new "root" - * - * @param element - * @return - */ - public static Package getFirstLevel(Element element) { - Element lastElement = element; - while (element != null) { - Element owner = element.getOwner(); - if (owner == null) { - if (lastElement instanceof Package) { - return (Package) lastElement; - } - } - lastElement = element; - element = owner; - } - return null; - } - - /** - * @param element - * an element which is owned by a model. - * @param subfolder - * the name of a sub-folder within root (created, if not - * existent) - * @return a reference to the sub folder within the root of the model that - * belongs to the passed element. - */ - public static Package getRoot(Element element, String subfolder) { - Package root = getTop(element); - if (root.getNestedPackage(subfolder) != null) { - return root.getNestedPackage(subfolder); - } else { - return root.createNestedPackage(subfolder); - } - } - - /** - * Convenience method enabling to apply getOwnedOperation equally to classes - * and interfaces - * - * @param cl - * @param name - * @param paramNames - * @param paramTypes - * @return - */ - public static Operation createOwnedOperation(Classifier cl, String name, - EList paramNames, EList paramTypes, Type retType) { - if (cl instanceof Class) { - return ((Class) cl).createOwnedOperation(name, paramNames, - paramTypes, retType); - } else if (cl instanceof Interface) { - return ((Interface) cl).createOwnedOperation(name, paramNames, - paramTypes, retType); - } else { - return null; - } - } - - public static Operation getOwnedOperation(Classifier cl, String name, - EList paramNames, EList paramTypes) { - if (cl instanceof Class) { - return ((Class) cl).getOwnedOperation(name, paramNames, paramTypes); - } else if (cl instanceof Interface) { - return ((Interface) cl).getOwnedOperation(name, paramNames, - paramTypes); - } else { - return null; - } - } - - /** - * this method returns the component type of an implementation. It is based - * on the modeling convention that implementations inherit from types. - */ - public static Class componentType(Class implementation) { - if (Utils.isCompImpl(implementation)) { - Iterator superclasses = implementation.getSuperClasses() - .iterator(); - while (superclasses.hasNext()) { - Class componentType = superclasses.next(); - if (Utils.isCompType(componentType)) { - return componentType; - } - } - } - return null; - } - - /** - * return true, if a component (implementation) is a composite, i.e. has - * inner parts - */ - public static boolean isComposite(Class implementation) { - return Utils.isCompImpl(implementation) - && (getParts(implementation).size() > 0); - } - - public static EList getParts(Class implementation) { - if (treatNoneAsComposite()) { - EList parts = new BasicEList(); - for (Property part : implementation.getAttributes()) { - if (part.getAggregation() != AggregationKind.SHARED_LITERAL) { - parts.add(part); - } - } - return parts; - } - else { - return implementation.getParts(); - } - } - - - /** - * @param attribute - * an attribute - * @return true, if the aggregation kind is considered as a composition - */ - public static boolean isComposition(Property attribute) { - if (treatNoneAsComposite()) { - return (attribute.getAggregation() != AggregationKind.SHARED_LITERAL); - } - else { - return (attribute.getAggregation() == AggregationKind.COMPOSITE_LITERAL); - } - } - - /** - * return true, if an instance specification is a composite, i.e. has > 1 - * slots TODO: distinguish parts and configuration attributes - */ - - public static boolean isComposite(InstanceSpecification is) { - return (is.getSlots().size() > 0); - } - - /** - * Get an element via its qualified name. Will find elements from the root - * model and elements in imported models. Also supports target model in - * which imports have been copied (while keeping the top-level name) - * - * @param root - * @param qualifiedName - * @return - */ - public static NamedElement getQualifiedElement(Package root, - String qualifiedName) { - NamedElement namedElement = null; - int index = qualifiedName.indexOf("::"); //$NON-NLS-1$ - if (index != -1) { - // first try using a path without top element (since - // getQualifiedElement is typically used for - // imported elements) - String remainder = qualifiedName.substring(index + 2); - namedElement = getQualifiedElement(root, remainder, qualifiedName); - } - if (namedElement == null) { - // try with complete name as path name, but assume that the element - // has been copied into the model, - // i.e. qualifiedName is prefixed by model name - namedElement = getQualifiedElement(root, qualifiedName, - root.getName() + "::" + qualifiedName); //$NON-NLS-1$ - } - return namedElement; - } - - /** - * Retrieve an element via its qualified name within a package The segments - * of the package may be non unique due to imports - * - * @return the found element, if it exists - */ - public static NamedElement getQualifiedElement(Package root, - String remainingPath, String qualifiedName) { - if (root == null) { - return null; - } - if (!remainingPath.contains(NamedElement.SEPARATOR)) { - for (NamedElement candidate : root.getMembers()) { - String name = candidate.getName(); - if ((name != null) && name.equals(remainingPath)) { - if (candidate.getQualifiedName().equals(qualifiedName)) { - return candidate; - } - } - } - } else { - String segment = remainingPath.split(NamedElement.SEPARATOR)[0]; - String remainder = remainingPath.substring(segment.length() + 2); - for (Element element : root.getMembers()) { - if (element instanceof Package) { - if (((NamedElement) element).getName().equals(segment)) { - NamedElement foundElement = getQualifiedElement( - (Package) element, remainder, qualifiedName); - // return, if not found - if (foundElement != null) { - return foundElement; - } - } - } - } - } - return null; - } - - /** - * Simple check whether an element is in a different model than the passed - * package It will return true, whenever the the top elements do not match. - * This is always true, if the 2nd belongs to a different model, whether - * imported or not. This distinction is however not required in our context. - */ - public static boolean isElementInDifferentModel(Package model, - NamedElement namedElement) { - return model != getTop(namedElement); - } - - /** - * /** - * Check whether a class contains a non-port attribute of a given name - * - * @param cl - * @return - */ - public static boolean hasNonPortOwnedAttribute(Class cl, String name) { - for (Property p : cl.getOwnedAttributes()) { - if (!(p instanceof Port)) { - if (p.getName().equals(name)) { - return true; - } - } - } - return false; - } - - public static EList getAllElementsOfType(Element examineElement, java.lang.Class clazz) - { - EList visitedPackages = new BasicEList(); - return getAllElementsOfType(examineElement, clazz, visitedPackages); - } - - @SuppressWarnings("unchecked") - public static EList getAllElementsOfType(Element examineElement, java.lang.Class clazz, EList visitedPackages) - { - EList list = new UniqueEList(); - for (Element element : examineElement.allOwnedElements()) { - if (element instanceof Package) { - if (!visitedPackages.contains(element)) { - visitedPackages.add(element); - list.addAll(getAllElementsOfType(element, clazz, - visitedPackages)); - } - } else if (clazz.isInstance(element)) { - list.add((T) element); - } - } - return list; - } - - /** - * @param a - * potential implementation - * @return true, if passed classifier is an implementation (i.e. declared - * via stereotypes as component or connector implementation (a sub-type of component implementations, - * therefore no additional check is required) - */ - public static boolean isCompImpl(Classifier implementation) { - return !implementation.isAbstract(); - } - - /** - * Check whether the passed class is a component type (and not a component implementation). - * This includes connector and container types as well. - * - * @param component - * @return - */ - public static boolean isCompType(Class component) { - return component.isAbstract(); - } - - public static boolean isInteractionComponent(Classifier component) { - return StereotypeUtil.isApplied(component, InteractionComponent.class); - } - - public static boolean isSingleton(Class component) { - return StereotypeUtil.isApplied(component, Singleton.class); - } - - public static boolean isAssembly(Class component) { - return StereotypeUtil.isApplied(component, Assembly.class); - } - - public static boolean treatNoneAsComposite() { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - return store.getBoolean(QompassPreferenceConstants.P_TREAT_NONE_AS_COMPOSITE); - } - - public static boolean allAttributesAreConfigAttributs() { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - return store.getBoolean(QompassPreferenceConstants.P_ALL_ATTRIBUTES_ARE_CONFIG_ATTRIBUTES); - } - - /** - * True, if either a component implementation or a type - * - * @param component - * @return - */ - public static boolean isComponent(Class component) { - return (isCompType(component) || isCompImpl(component)); - } - - /** - * Return the absolute file name to a file name given e.g. in the form platform:/plugin/xxx - * - * @param fileName - * the file name using eclipse elements such as platform:/plugin - * @return the absolute file name - */ - public static String getAbsoluteFN(String fileName) { - try { - URL absoluteURL = FileLocator.toFileURL(new URL(fileName)); - return absoluteURL.getFile(); - } catch (MalformedURLException e) { - } catch (IOException e) { - } - return null; - } - - // TODO: need a generic utility function for getting all elements obeying a certain - // criteria from a model - public static EList getAllRules(Package pkg) { - EList visitedPackages = new BasicEList(); - EList contRuleList = new BasicEList(); - getAllRules(pkg, visitedPackages, contRuleList); - return contRuleList; - } - - public static void getAllRules(Package pkg, EList visitedPackages, EList contRuleList) { - for (Element el : pkg.getMembers()) { - if (el instanceof Package) { - if (!visitedPackages.contains(el)) { - visitedPackages.add((Package) el); - getAllRules((Package) el, visitedPackages, contRuleList); - } - } - else if (el instanceof Class) { - if (StereotypeUtil.isApplied(el, ContainerRule.class)) { - ContainerRule rule = UMLUtil.getStereotypeApplication(el, ContainerRule.class); - contRuleList.add(rule); - } - } - } - } - - /** - * Put quotes around a string, unless string already starts with a quote. - * - * @param str - * @return - */ - public static String quoteString(String str) { - if (str.startsWith(QUOTE)) { - return str; - } - else { - return QUOTE + str + QUOTE; - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddMarteAndFcmProfile.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddMarteAndFcmProfile.java deleted file mode 100644 index 8371706e9c7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddMarteAndFcmProfile.java +++ /dev/null @@ -1,148 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ -package org.eclipse.papyrus.qompass.designer.core.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.workspace.AbstractEMFOperation; -import org.eclipse.papyrus.qompass.designer.core.Activator; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.Profile; - -/** - * This class adds the FCM profile, parts of the MARTE profile and required package imports to your model. - */ -public class AddMarteAndFcmProfile extends AbstractEMFOperation { - - public AddMarteAndFcmProfile(Package selectedPkg, int applyCode, TransactionalEditingDomain domain) { - super(domain, CMD_LABEL); - this.selectedPkg = selectedPkg; - this.applyCode = applyCode; - } - - public static final String CMD_LABEL = "Add MARTE/FCM profiles"; //$NON-NLS-1$ - - public static final String FCM_PROFILE_URI = "pathmap://FCM_PROFILES/FCM.profile.uml"; //$NON-NLS-1$ - - public static final String MARTE_PROFILE_URI = "pathmap://Papyrus_PROFILES/MARTE.profile.uml";//$NON-NLS-1$ - - static final String MARTE_FOUNDATIONS = "MARTE_Foundations"; //$NON-NLS-1$ - - static final String MARTE_F_ALLOC = "Alloc"; //$NON-NLS-1$ - - static final String MARTE_DESIGN_MODEL = "MARTE_DesignModel"; //$NON-NLS-1$ - - static final String MARTE_DM_HLAM = "HLAM"; //$NON-NLS-1$ - - static final String MARTE_DM_GCM = "GCM"; //$NON-NLS-1$ - - public static final int APPLY_FCM = 1; - - public static final int APPLY_ALLOC = 2; - - public static final int APPLY_HLAM_GCM = 4; - - Package selectedPkg; - - int applyCode; - - public static Element getContent(URI uri, ResourceSet rs) { - // Resource resource = getTransactionalEditingDomain ().getResourceSet().getResource (uri, true); - Resource resource = rs.getResource(uri, true); - return getContent(resource); - } - - public static Element getContent(Resource resource) { - EList contentObj = resource.getContents(); - if ((contentObj.size() > 0) && (contentObj.get(0) instanceof Element)) { - return (Element) contentObj.get(0); - } - return null; - } - - @Override - protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) - throws ExecutionException { - final ResourceSet resourceSet = selectedPkg.eResource().getResourceSet(); - - try { - /* - * // Apply UML Standard profile - * // Retrieve standard profile - * Profile umlStdProfile = - * (Profile) getContent (URI.createURI(UMLResource.STANDARD_PROFILE_URI)); - * // Apply to new model - * umlModel.applyProfile(umlStdProfile); - */ - - if ((applyCode & APPLY_FCM) != 0) { - // Retrieve FCM profile - Profile fcmProfile = - (Profile) getContent(URI.createURI(FCM_PROFILE_URI), resourceSet); - - // Apply FCM profile and its nested profiles to new model - if (fcmProfile instanceof Profile) { - Profile profile = selectedPkg.getAppliedProfile(fcmProfile.getQualifiedName()); - if ((profile == null) && (!fcmProfile.getOwnedStereotypes().isEmpty())) { - selectedPkg.applyProfile(fcmProfile); - } - } - else { - Activator.log.debug("The FCM profile is not available."); //$NON-NLS-1$ - } - } - - if ((applyCode & (APPLY_ALLOC | APPLY_HLAM_GCM)) != 0) { - // Retrieve MARTE profile - Profile marteProfile = - (Profile) getContent(URI.createURI(MARTE_PROFILE_URI), resourceSet); - - // Apply MARTE::MARTE_DesignModel::HLAM - // & MARTE::MARTE_DesignModel::GCM - if (marteProfile != null) { - PackageableElement foundationModel = marteProfile.getPackagedElement(MARTE_FOUNDATIONS); - if ((foundationModel instanceof Package) && ((applyCode & APPLY_ALLOC) != 0)) { - PackageableElement alloc = ((Package) foundationModel).getPackagedElement(MARTE_F_ALLOC); - selectedPkg.applyProfile((Profile) alloc); - } - PackageableElement designModel = marteProfile.getPackagedElement(MARTE_DESIGN_MODEL); - if ((designModel instanceof Package) && ((applyCode & APPLY_HLAM_GCM) != 0)) { - PackageableElement hlam = ((Package) designModel).getPackagedElement(MARTE_DM_HLAM); - if (hlam instanceof Profile) { - selectedPkg.applyProfile((Profile) hlam); - } - PackageableElement gcm = ((Package) designModel).getPackagedElement(MARTE_DM_GCM); - if (gcm instanceof Profile) { - selectedPkg.applyProfile((Profile) gcm); - } - } - } - else { - Activator.log.debug("The MARTE profile is not available."); //$NON-NLS-1$ - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return Status.OK_STATUS; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddQompassModelLibs.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddQompassModelLibs.java deleted file mode 100644 index 94c6d34f0b9..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddQompassModelLibs.java +++ /dev/null @@ -1,202 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ -package org.eclipse.papyrus.qompass.designer.core.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.workspace.AbstractEMFOperation; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageImport; -import org.eclipse.uml2.uml.UMLFactory; - -/** - * This class adds the FCM profile, parts of the MARTE profile and required package imports to your model. - */ -public class AddQompassModelLibs extends AbstractEMFOperation { - - public AddQompassModelLibs(Package pkg, TransactionalEditingDomain domain) { - super(domain, CMD_LABEL); - selectedPkg = pkg; - availableImportPackages = null; - importList = null; - } - - public static final String CMD_LABEL = "Add Qompass CORE libraries"; //$NON-NLS-1$ - - public static final String EC3M_BASIC_CALLS_URI = "pathmap://QML_CORE/core.uml"; //$NON-NLS-1$ - - public static final String EC3M_MARTE_CALLS_URI = "pathmap://QML_MARTE/marte.uml"; //$NON-NLS-1$ - - protected EList importList; - - protected EList availableImportPackages; - - protected Package selectedPkg; - - /** - * Retrieve a model library from the repository - * - * @param uri - * the URI of the repository - * - * @return - */ - public PackageImport getModelLibraryImportFromURI(URI uri, ResourceSet resourceSet) { - // Try to reach model - Element root = getContent(uri, resourceSet); - if (root instanceof Package) { - - // Import model library - Package libToImport = (Package) root; - // create import package - PackageImport modelLibImport = UMLFactory.eINSTANCE.createPackageImport(); - modelLibImport.setImportedPackage(libToImport); - - return modelLibImport; - } - return null; - } - - public static Element getContent(URI uri, ResourceSet rs) { - // Resource resource = getTransactionalEditingDomain ().getResourceSet().getResource (uri, true); - Resource resource = rs.getResource(uri, true); - return getContent(resource); - } - - public static Element getContent(Resource resource) { - EList contentObj = resource.getContents(); - if ((contentObj.size() > 0) && (contentObj.get(0) instanceof Element)) { - return (Element) contentObj.get(0); - } - return null; - } - - /** - * Check whether a package import is already done - * - * @param selectedPkg - * @param pi - * @return - */ - boolean isAlreadyImported(Package selectedPkg, PackageImport pi) { - for (PackageImport existingPI : selectedPkg.getPackageImports()) { - if ((existingPI.getImportedPackage() == null) || - (pi.getImportedPackage() == null)) { - // import package are null (should not happen?!) - continue; - } - if ((existingPI.getImportedPackage().getName() == null) || - (pi.getImportedPackage().getName() == null)) { - // import package name not set (should not happen?!) - continue; - } else if (existingPI.getImportedPackage().getName().equals(pi.getImportedPackage().getName())) { - return true; - } - } - return false; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - - /** - * Return a list of package-imports for standard Qompass model libraries - * - * @return - * @throws ExecutionException - */ - public EList getAvailableImportPackages() { - if (availableImportPackages != null) { - return availableImportPackages; - } - final ResourceSet resourceSet = selectedPkg.eResource().getResourceSet(); - availableImportPackages = new BasicEList(); - - PackageImport pi = getModelLibraryImportFromURI(URI.createURI(EC3M_BASIC_CALLS_URI), resourceSet); - if (pi != null) { - availableImportPackages.add(pi); - } - pi = getModelLibraryImportFromURI(URI.createURI(EC3M_MARTE_CALLS_URI), resourceSet); - if (pi != null) { - availableImportPackages.add(pi); - } - return availableImportPackages; - } - - /** - * @return a list of package-imports that are already imported (within the selected pkg). - */ - public EList getAlreadyImportedPackages() { - EList availablePackages = getAvailableImportPackages(); - EList selection = new BasicEList(); - for (PackageImport pi : availablePackages) { - if (isAlreadyImported(selectedPkg, pi)) { - selection.add(pi); - } - } - return selection; - } - - /** - * Initialize import list. Must be called, before the command gets executed. - * - * @param importList - * a list of package-imports that will be added to the selectedPkg when - * the command gets executed. - */ - public void setImportList(EList importList) { - this.importList = importList; - } - - - /** - * Initialize import list. Must be called, before the command gets executed. - * Convenience method for dialogs that return an array. - * - * @param importArray - * an array of objects (which must contain package-imports) that will - * be added to the selectedPkg when the command gets executed. - */ - public void setImportList(Object importArray[]) { - importList = new BasicEList(); - for (Object importPkg : importArray) { - if (importPkg instanceof PackageImport) { - importList.add((PackageImport) importPkg); - } - } - } - - @Override - protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) - throws ExecutionException { - - for (PackageImport pi : importList) { - if (!isAlreadyImported(selectedPkg, pi)) { - selectedPkg.getPackageImports().add(pi); - } - } - return Status.OK_STATUS; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/AllocUtils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/AllocUtils.java deleted file mode 100644 index c66d45918b5..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/AllocUtils.java +++ /dev/null @@ -1,373 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.deployment; - -import java.util.Collection; -import java.util.Iterator; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.papyrus.FCM.Fragment; -import org.eclipse.papyrus.MARTE.MARTE_DesignModel.SRM.SW_Concurrency.SwSchedulableResource; -import org.eclipse.papyrus.MARTE.MARTE_Foundations.Alloc.Allocate; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Abstraction; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.ConnectorEnd; -import org.eclipse.uml2.uml.DirectedRelationship; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Node; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.util.UMLUtil; - -public class AllocUtils { - - public static final String startPortName = "start"; //$NON-NLS-1$ - - public static final String startPortType = "IStart"; //$NON-NLS-1$ - - /** - * Retrieve a list of nodes to which the instance is allocated to *or* - * to which one of the contained instances is allocated to (recursively) - * - * @param instance - * @return a list of nodes - */ - public static EList getAllNodes(InstanceSpecification instance) { - EList nodeList = getNodes(instance); - for (Slot slot : instance.getSlots()) { - if (!DepUtils.isShared(slot)) { - InstanceSpecification containedInstance = DepUtils.getInstance(slot); - if (containedInstance != null) { - nodeList.addAll(getAllNodes(containedInstance)); - } - } - } - return nodeList; - } - - /** - * Retrieve a list of nodes to which the set of passed instance is allocated to *or* - * to which one of the contained instances is allocated to (recursively) - * - * @param instanceList a list of instances - * @return a list of nodes - */ - public static EList getAllNodes(Collection instances) { - EList nodeList = new UniqueEList(); - for (InstanceSpecification instance : instances) { - nodeList.addAll(getAllNodes(instance)); - } - return nodeList; - } - /** - * Retrieve a list of nodes to which the instance is allocated to *or* - * to which one of the contained instances is allocated to (recursively) - * - * @param instanceAttribute - * an attribute within a composite that represents a component instance - * or a set thereof, if the composite itself is instantiated multiple times) - * @return a list of nodes - */ - public static Property getThreadAlloc(Property instanceAttribute) { - for (DirectedRelationship relation : instanceAttribute.getSourceDirectedRelationships()) { - if (StereotypeUtil.isApplied(relation, Allocate.class)) { - if (relation.getTargets().size() != 1) { - continue; - } - Element targetElem = relation.getTargets().get(0); - if (!(targetElem instanceof Property)) { - continue; - } - Property target = (Property) targetElem; - if (StereotypeUtil.isApplied(target.getType(), SwSchedulableResource.class)) { - return target; - } - } - } - return null; - } - - - /** - * Retrieve a list of nodes to which the instance is allocated to *or* - * to which one of the containing instances is explicitly allocated - * - * @param instance - * @return a list of nodes - */ - public static EList getAllNodesOrThreadsParent(InstanceSpecification instance) { - EList nodeList = getNodesOrThreads(instance); - Package cdp = instance.getNearestPackage(); - // TODO: not very efficient: loop each time over all instance specifications - for (NamedElement parentNE : cdp.getMembers()) { - if (parentNE instanceof InstanceSpecification) { - // possible parent instance specification - InstanceSpecification parentIS = (InstanceSpecification) parentNE; - if (DepUtils.getContainedInstances(parentIS).contains(instance)) { - nodeList.addAll(getAllNodesOrThreadsParent(parentIS)); - } - } - } - return nodeList; - } - - public static InstanceSpecification getNode(InstanceSpecification instance) { - EList nodeList = getNodes(instance); - if (nodeList.size() != 0) { - return nodeList.get(0); - } - return null; - } - - public static InstanceSpecification getNodeOrThread(InstanceSpecification instanceOrThread) { - EList nodeList = getNodesOrThreads(instanceOrThread); - if (nodeList.size() != 0) { - return nodeList.get(0); - } - return null; - } - - /** - * This method returns a list of nodes (or threads) to which the passed instance is allocated. - * It is based on MARTE Allocation (a stereotyped abstraction) which is a generic - * mechanism to deploy UML elements to nodes. - * - * @param instanceOrThread - * The instance for which we like to know the allocation information - * @return - */ - public static EList getNodesOrThreads(InstanceSpecification instanceOrThread) { - EList nodeList = new UniqueEList(); - - for (DirectedRelationship relationship : instanceOrThread.getSourceDirectedRelationships(UMLPackage.eINSTANCE.getAbstraction())) { - Abstraction abstraction = (Abstraction) relationship; - if (StereotypeUtil.isApplied(abstraction, Allocate.class)) { - for (Element target : abstraction.getTargets()) { - if (target instanceof InstanceSpecification) { - nodeList.add((InstanceSpecification) target); - } - } - } - } - return nodeList; - } - - /** - * This method returns a list of nodes to which the passed instance is allocated. If - * the instance is allocated directly to a node, this node is returned. If the instance - * is allocated to a thread, the allocation of the thread to a node is returned. - * - * @param instanceOrThread - * The instance that should be deployed - * @return - */ - public static EList getNodes(InstanceSpecification instanceOrThread) { - EList nodeList = new UniqueEList(); - EList nodeOrThreads = getNodesOrThreads(instanceOrThread); - for (InstanceSpecification nodeOrThread : nodeOrThreads) - { - Classifier nodeOrThreadC = DepUtils.getClassifier(nodeOrThread); - if (StereotypeUtil.isApplied(nodeOrThreadC, SwSchedulableResource.class)) { - // treat case that instance is allocated to a thread - // follow allocation of Thread - nodeList.add(getNode(nodeOrThread)); - } - else { - nodeList.add(nodeOrThread); - } - } - return nodeList; - } - - /** - * This method updates (and optionally removes) the allocations of an instance - * - * @param instance - * The instance that should be deployed - * @param oldNode - * the old node allocation - * @param newNode - * the new node allocation, may be null to indicate removal - * @return - */ - public static EList updateAllocation(InstanceSpecification instance, InstanceSpecification oldNode, InstanceSpecification newNode) { - EList nodeList = new UniqueEList(); - - Iterator relShipIt = - instance.getSourceDirectedRelationships(UMLPackage.eINSTANCE.getAbstraction()).iterator(); - - while (relShipIt.hasNext()) { - Abstraction abstraction = (Abstraction) relShipIt.next(); - if (StereotypeUtil.isApplied(abstraction, Allocate.class)) { - EList suppliers = abstraction.getSuppliers(); // use suppliers instead of targets (derived) - for (int index = 0; index < suppliers.size(); index++) { - if (suppliers.get(index) == oldNode) { - if (newNode == null) { - // remove relationship completely, since we assume a single target - // (cannot call remove on relShipIt, since list is derived) - abstraction.destroy(); - } else { - suppliers.set(index, newNode); - } - break; - } - } - } - } - return nodeList; - } - - /** - * Retrieve a list of nodes to which the instance is allocated to *or* - * to which one of the contained instances is allocated to (recursively) - * - * @param instance - * @param A - * port of the composite. Contained instances are examined only if - * they have a connection with this port. - * @return a list of nodes - */ - public static EList getAllNodesForPort(InstanceSpecification instance, Port port) { - EList nodeList = getNodes(instance); - Classifier composite = DepUtils.getClassifier(instance); - if (composite instanceof Class) { - Class compositeCL = (Class) composite; - for (Slot slot : instance.getSlots()) { - Property containedProperty = (Property) slot.getDefiningFeature(); - - for (Connector connection : compositeCL.getOwnedConnectors()) { - // is one connector end targeted at the containedProperty ? - ConnectorEnd end = ConnectorUtil.connEndForPart(connection, containedProperty); - if (end == null) { - continue; - } - - // does the connector at the same connect the composite's port? - if (ConnectorUtil.connectsPort(connection, port)) { - Port containedPort = (Port) end.getRole(); - nodeList.addAll(getAllNodesForPort(DepUtils.getInstance(slot), containedPort)); - } - } - } - } - return nodeList; - } - - public static boolean allocate(InstanceSpecification instance, InstanceSpecification node) { - Package cdp = (Package) instance.getOwner(); - Abstraction allocation = (Abstraction) - cdp.createPackagedElement("allocate " + instance.getName() + //$NON-NLS-1$ - " to " + node.getName(), UMLPackage.eINSTANCE.getAbstraction()); //$NON-NLS-1$ - if (StereotypeUtil.apply(allocation, Allocate.class) == null) { - // stereotype application failed - allocation.destroy(); - return false; - } - allocation.getClients().add(instance); - allocation.getSuppliers().add(node); - return true; - } - - /** - * Assign node name to leafs - * - * @param instance - * @param A - * port of the composite. Contained instances are examined only if the - * have a connection with this port. If null, no sub-instances are examined - * @param nodes - * A list of nodes to which leafs are allocated - */ - public static void propagateNodesViaPort(InstanceSpecification instance, Port port, EList nodes) { - if (instance == null) { - return; - } - EList slots = instance.getSlots(); - Class composite = DepUtils.getImplementation(instance); - - // Only set allocation on leafs (TODO: assure that components with configuration attributes are not considered as leafs) - // if(composite.getParts().size() == 0) { - for (InstanceSpecification node : nodes) { - AllocUtils.allocate(instance, node); - } - - if ((composite != null) && (port != null)) { - Class compositeCL = composite; - for (Slot slot : slots) { - Property containedProperty = (Property) slot.getDefiningFeature(); - - Fragment fragment = UMLUtil.getStereotypeApplication(containedProperty, Fragment.class); - if (fragment != null) { - // TODO - /* - * EList colocateWithPort = fragment.getColocateWithPort(); - * // is the port within the list? - * if(Utils.getNamedElementFromList(colocateWithPort, port.getName()) != null) { - * // compare qualified name, since containedPort (stereotype attribute) - * // points to a source model element - * propagateNodesViaPort(DepUtils.getInstance(slot), port, nodes); - * continue; - * } - */ - } - for (Connector connection : compositeCL.getOwnedConnectors()) { - if (ConnectorUtil.connectsPort(connection, port)) { - Log.log(IStatus.INFO, Log.TRAFO_CONNECTOR, "connector: " + connection.getName()); //$NON-NLS-1$ - Log.log(IStatus.INFO, Log.TRAFO_CONNECTOR, "end1: " + connection.getEnds().get(0).getPartWithPort()); //$NON-NLS-1$ - Log.log(IStatus.INFO, Log.TRAFO_CONNECTOR, "end2: " + connection.getEnds().get(1).getPartWithPort()); //$NON-NLS-1$ - ConnectorEnd end = ConnectorUtil.connEndForPart(connection, containedProperty); - // other connector end targeted at containedProperty? - if (end != null) { - Port containedPort = (Port) end.getRole(); - propagateNodesViaPort(DepUtils.getInstance(slot), containedPort, nodes); - } - } - } - } - } - } - - /** - * Return the start Port of a component, i.e. a port that corresponds to the "magic" port name - * start and is typed with the interface IStart - * - * @param component - * a component implementation - * @return The start port or null - */ - public static Port getStartPort(Class component) { - Element startPortElem = Utils.getNamedElementFromList(component.getAllAttributes(), startPortName); - if (startPortElem instanceof Port) { - Port startPort = (Port) startPortElem; - if (startPort.getType().getName().equals(startPortType)) { - return startPort; - } - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/BootLoaderGen.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/BootLoaderGen.java deleted file mode 100644 index 595e5aba037..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/BootLoaderGen.java +++ /dev/null @@ -1,546 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.deployment; - -import java.util.Arrays; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Map; -import java.util.Stack; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.C_Cpp.Include; -import org.eclipse.papyrus.FCM.InitPrecedence; -import org.eclipse.papyrus.MARTE.MARTE_DesignModel.SRM.SW_Concurrency.SwSchedulableResource; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.StUtils; -import org.eclipse.papyrus.qompass.designer.core.UMLTool; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.transformations.ExecuteOOTrafo; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.ConnectorEnd; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.OpaqueBehavior; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.StructuralFeature; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.ValueSpecification; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * The task of the boot-loader is twofold: create the instances of all - * implementations (non-recursive). - * - create Connections: what should be done? - * - * TODO: factor out common code (TemplateInstantiation mechanism & createConnections below) - * Split between C++ specific and C++ independent aspects - */ -public class BootLoaderGen { - - private static final String EMPTYSTR = ""; //$NON-NLS-1$ - - final public static String NODE_INFO = "NodeInfo"; //$NON-NLS-1$ - - final public static String INIT_OP_NAME = "init"; //$NON-NLS-1$ - - final public static String NL = "\n"; //$NON-NLS-1$ - - final public static String EOL = ";\n"; //$NON-NLS-1$ - - final public static String BOOTLOADER_NAME = "BootLoader"; //$NON-NLS-1$ - - /** - * Create a new boot-loader in a specific package - * (which represents a node of the system). - * - * @param copier a lazy copier - * @param nodeIndex the index of the node - * @param numberOfNodes the number of nodes - * @throws TransformationException - */ - public BootLoaderGen(LazyCopier copier, int nodeIndex, int numberOfNodes) - throws TransformationException { - // Class composite = (Class) ut.getClassifier (mainInstance); - // place in root (getModel()) to avoid the problem that the declaration of the bootLoader - // instance is within a namespace (a static attribute on the model level would not solve the - // problem as it must be accessed by function main). - - Class nodeInfo = copier.target.createOwnedClass(NODE_INFO, false); - String headerStr = - "const int nodeIndex = " + nodeIndex + ";" + NL + //$NON-NLS-1$//$NON-NLS-2$ - "const int numberOfNodes = " + numberOfNodes + ";" + NL; //$NON-NLS-1$ //$NON-NLS-2$ - Include cppIncludeNodeInfo = StereotypeUtil.applyApp(nodeInfo, Include.class); - if (cppIncludeNodeInfo == null) { - throw new TransformationException("Can not apply C++ stereotypes during bootloader generation. Please apply the C++ profile to the source model"); - } - cppIncludeNodeInfo.setHeader(headerStr); - - // bootLoader.createOwnedAttribute (mainInstance.getName (), composite); - - m_bootLoader = copier.target.createOwnedClass(BOOTLOADER_NAME, false); - outputSizeof = false; - m_copy = copier; - Class template = (Class) Utils.getQualifiedElement(copier.source, bootloaderQNAME); - if (template == null) { - throw new TransformationException(String.format( - Messages.BootLoaderGen_CannotRetrieveTemplate, bootloaderQNAME)); - } - // TODO: currently, only stereotypes are copied from template - StUtils.copyStereotypes(template, m_bootLoader); - - - // TODO: commented code below already fixed? - /* - * Problem: defaultValue not taken into account by code generator - * => use global variables via cppInclude instead (see below: "bodyStr = ...") - * NamedElement corba_long = Utils.getQualifiedElement (owner, "CORBA::Long"); - * if (corba_long instanceof Type) { - * Property nodeNumber = - * m_bootLoader.createOwnedAttribute ("nodeNumber", (Type) corba_long); - * nodeNumber.setIsStatic (true); - * nodeNumber.setDefault ("0"); // for testing - * Property numberOfNodes = - * m_bootLoader.createOwnedAttribute ("numberOfNodes", (Type) corba_long); - * numberOfNodes.setIsStatic (true); - * numberOfNodes.setDefault ("2"); - * } - */ - Include cppInclude = StereotypeUtil.applyApp(m_bootLoader, Include.class); - if (cppInclude == null) { - throw new TransformationException(Messages.BootLoaderGen_CannotApplyCppInclude); - } - String existingBody = cppInclude.getBody(); - String bodyStr = EMPTYSTR; - - if (outputSizeof) { - bodyStr += - "#include " + NL + //$NON-NLS-1$ - "using namespace std;" + NL; //$NON-NLS-1$ - } - cppInclude.setBody(existingBody + bodyStr); - - // bootLoader.createOwnedAttribute (mainInstance.getName (), composite); - - m_initCode = EMPTYSTR; - m_initCodeRun = EMPTYSTR; - m_activation = new HashMap>(); - m_initCodeCConnections = EMPTYSTR; - m_initCodeCConfig = EMPTYSTR; - - if (outputSizeof) { - m_initCode += "cout << \"sizeof bootloader: \" << sizeof (bootloader) << endl;" + EOL; //$NON-NLS-1$ - } - // indexMap = new HashMap(); - } - - /** - * Return the path from the main instance towards a sub-instance using the proper dereference - * operators, i.e. ".", if the sub-instance is enclosed via composition or "->" if the sub-instance - * is a pointer (since created by the bootloader). - * - * @param slotPath - * @param instance - * @param accessName - * return the name to access the feature. Returns access path to instance, not - * the name of the variable for this instance (if instantiated by bootloader) - * @return - */ - public String getPath(Stack slotPath, InstanceSpecification instance, boolean accessName) { - if (slotPath.size() > 0) { - // start with first instance - String path = slotPath.get(0).getOwningInstance().getName(); - boolean previousInstantiatedByBL = false; - for (Slot pathElement : slotPath) { - if (pathElement != null) { - if (previousInstantiatedByBL && accessName) { - // If an instance is instantiated by the bootloader, it is only referenced via its type in the - // owning composite. Thus, configuration (and activation calls) might fail as the type might not - // have these configuration properties or operations. - // Therefore, configuration and initial calls use - // - the path, if instantiated by the composite - // - the variable name, if done by the bootloader - path = UMLTool.varName(path); // use variable name instead. - } - path += "." + pathElement.getDefiningFeature().getName(); //$NON-NLS-1$ - previousInstantiatedByBL = ExecuteOOTrafo.instantiateViaBootloader(pathElement.getDefiningFeature()); - } - } - if (previousInstantiatedByBL && !accessName) { - // name of the variable for this expression instantiated by the bootloader - path = UMLTool.varName(path); - } - return path; - } - else { - return instance.getName(); // instance has no path via slots, it is a top level instance - } - } - - public Property addInstance(Stack slotPath, InstanceSpecification instance, Class implementation, InstanceSpecification node) - throws TransformationException - { - // TODO: comments not clear. seems unnecessary complex. Problem in general is that access to - // shared instances needs to be configured. - // It should always be possible to configure this instance via a path w/o sharing. - String accessName = getPath(slotPath, instance, true); - String varName = getPath(slotPath, instance, false); - - Property implemPart = null; - - // containing instance not null (=> neither main instance nor singleton) - Slot containerSlot = null; - if (slotPath.size() > 0) { - containerSlot = slotPath.peek(); - - // initialize part/property in containing instance. The containing instance itself is accessed - // via the naming of the associated instance, the part itself via the name of the defining feature. - if (DepUtils.isShared(containerSlot)) { - // we need to initialize the property (a reference) with the given instance - Stack referencePath = DepUtils.getAccessPath(instance); - String referenceVarName = getPath(referencePath, instance, false); - - // add code for initialization - m_initCode += accessName + " = &" + referenceVarName + EOL; //$NON-NLS-1$ - // is a reference which should not be called via activation & start - // return now and skip code below - return implemPart; - } - else if (ExecuteOOTrafo.instantiateViaBootloader(containerSlot.getDefiningFeature())) { - // let bootloader instantiate - implemPart = m_bootLoader.createOwnedAttribute(/* "i_" + */varName, implementation); - // add code for initialization - m_initCode += accessName + " = &" + varName + EOL; //$NON-NLS-1$ - implemPart.setIsComposite(true); - } - } - else { - // top level, either main instance or singleton => bootloader instantiates, create attribute - implemPart = m_bootLoader.createOwnedAttribute(/* "i_" + */varName, implementation); - implemPart.setIsComposite(true); - } - if (outputSizeof) { - m_initCode += "cout << \"sizeof " + implementation.getName() + ": \" << sizeof (" + varName + ") << endl;" + EOL; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ - } - - // if start thread => existing thread activation interceptor? Connection? - if (StereotypeUtil.isApplied(implementation, SwSchedulableResource.class)) { - // yes, but is the thread instance part of the deployment plan?? [mmh, probably yes...] - // call threads start routine here? (via main thread?) which in turn will activate the start routine? - } - - // implementation contains get_start operation => has start port - // which is called automatically - String get_start = PrefixConstants.getP_Prefix + "start"; //$NON-NLS-1$ - - // Need to check whether implementation is an executor which is encapsulated in a container. In this case, only - // the method of the container and not the method of the executor (which owns the same port) maybe called. - // Currently, this check is based on the use of "executor" as reserved part name (validation checks that the - // user does not use this name for application components) - if (hasUnconnectedStartRoutine(m_copy, implementation, containerSlot)) { - if (m_initCodeRun.equals(EMPTYSTR)) { - // call start's run method - // TODO: Need path that uses the right dereference operator ("->" or ".") - m_initCodeRun = varName + "." + get_start + "()->run()" + EOL; //$NON-NLS-1$ //$NON-NLS-2$ - } else { - throw new TransformationException(String.format( - Messages.BootLoaderGen_AtLeastOneBlockingCall, - varName, m_initCodeRun)); - } - } - if (hasUnconnectedLifeCycle(m_copy, implementation, containerSlot)) { - // precedence is checked below (when code is actually produced) - // multiple varNames might share the same implementation. Put a list of variable names into the table - EList varNameList = m_activation.get(implementation); - if (varNameList == null) { - varNameList = new BasicEList(); - } - varNameList.add(varName + "."); //$NON-NLS-1$ - m_activation.put(implementation, varNameList); - } - - // check, if implementation contains a composite if (implementation.getOwnedOperation (StaticOOTrafo.CREATE_CONNECTIONS, null, null) != null) { - boolean bCreateConn = false; - for (Connector connector : implementation.getOwnedConnectors()) { - if (ConnectorUtil.isAssembly(connector)) { - bCreateConn = true; - break; - } - } - - if (bCreateConn) { - m_initCodeCConnections += varName + "." + ExecuteOOTrafo.CREATE_CONNECTIONS +"();\n"; //$NON-NLS-1$ //$NON-NLS-2$ - } - return implemPart; - } - - /** - * Check whether the passed implementation has an unconnected start port. - * This information is required, since only unconnected start ports are automatically called by the - * bootloader, in particular we want to avoid calling a start port of an executor (which is connected) - * and its container. - * - * @param implementation - * @param containerSlot - * @return - */ - public static boolean hasUnconnectedStartRoutine(LazyCopier copy, Class implementation, Slot containerSlot) { - if (implementation != null) { - Port startPort = AllocUtils.getStartPort(implementation); - if (startPort != null) { - return !isConnected(copy, containerSlot, startPort); - } - } - return false; - } - - /** - * Check, if the passed implementation has an unconnected life-cycle interface (activate/deactivate). - * This information is required, since only unconnected life cycle ports are automatically called by the - * bootloader, in particular we want to avoid calling a life cycle port of an executor (which is connected) - * and its container. - * - * @param implementation - * @param name - * @return - */ - public static boolean hasUnconnectedLifeCycle(LazyCopier copy, Class implementation, Slot containerSlot) { - if (implementation != null) { - Element lcPortElem = Utils.getNamedElementFromList(implementation.getAllAttributes(), "lc"); //$NON-NLS-1$ - if (lcPortElem instanceof Port) { - Port lcPort = (Port) lcPortElem; - // check, if port typed with ILifeCycle interface - if (lcPort.getType().getName().equals("ILifeCycle")) { //$NON-NLS-1$ - return !isConnected(copy, containerSlot, lcPort); - } - } - - } - return false; - } - - /** - * The check verifies whether the passed port is connected within - * the context of the composite represented by the passed slot - * - * @param containerSlot - * a slot within an instance that represents a composite class - * @Param a port that is checked for being connected - * @return true, if connected - */ - private static boolean isConnected(LazyCopier copy, Slot containerSlot, Port port) { - if (containerSlot != null) { - StructuralFeature sf = containerSlot.getDefiningFeature(); - if (sf instanceof Property) { - // instance still points to a part in the tmp-model (there are no - // instance specifications in the final model). Therefore, we use copy to - // obtain the mapped instance. - Property part = (Property) copy.copy(sf); - Class composite = part.getClass_(); - for (Connector connector : composite.getOwnedConnectors()) { - // must assure same connector end connects part & port - ConnectorEnd end = ConnectorUtil.connEndForPart(connector, part); - if ((end != null) && (end.getRole() == port)) { - return true; - } - } - } - } - return false; - } - - public void instanceConfig(Stack slotPath, InstanceSpecification instance) throws TransformationException { - Slot slot = slotPath.peek(); - // String varName = getPath(slotPath, instance, false); - StructuralFeature sf = slot.getDefiningFeature(); - if (sf == null) { - throw new TransformationException(String.format("A slot for instance %s has no defining feature", instance.getName())); //$NON-NLS-1$ - } - - String varName = instance.getName() + "." + sf.getName(); //$NON-NLS-1$ - for (ValueSpecification value : slot.getValues()) { - - // only set value, if not null - if (value.stringValue() != null) { - m_initCodeCConfig += varName + " = " + value.stringValue() + EOL; //$NON-NLS-1$ - } - } - } - - public void addCreateConnections() { - // code generators do not handle connectors in a suitable way. Remove - // (alternative: no-code-gen tag, as available for C++) - m_bootLoader.getOwnedConnectors().clear(); - } - - /** - * add the initialize operation. Must be called after a set of addInstance invocations - * @param mainInstance - */ - public void addInit(String language) { - // TODO: use template - Operation init = m_bootLoader.createOwnedOperation(INIT_OP_NAME, null, null); - OpaqueBehavior initBehavior = (OpaqueBehavior) - m_bootLoader.createOwnedBehavior(INIT_OP_NAME, UMLPackage.eINSTANCE.getOpaqueBehavior()); - init.getMethods().add(initBehavior); - - initBehavior.getLanguages().add(language); - String code = m_initCode + "\n"; //$NON-NLS-1$ - if (m_initCodeCConfig.length() > 0) { - code += "\n// instance configuration\n" + //$NON-NLS-1$ - m_initCodeCConfig + "\n"; //$NON-NLS-1$ - } - if (m_initCodeCConnections.length() > 0) { - code += "\n// create connections between instances\n" + //$NON-NLS-1$ - m_initCodeCConnections + "\n"; //$NON-NLS-1$ - } - Comparator comparator = new Comparator() { - - @Override - public int compare(Class clazz1, Class clazz2) { - - InitPrecedence precedenceC1 = UMLUtil.getStereotypeApplication(clazz1, InitPrecedence.class); - InitPrecedence precedenceC2 = UMLUtil.getStereotypeApplication(clazz2, InitPrecedence.class); - if (precedenceC1 != null) { - // need to use named comparison instead of precedenceC1.getInvokeAfter ().contains (clazz2) - // since class referenced by stereotype attribute still points to element in source model - if (Utils.getNamedElementFromList(precedenceC1.getInvokeAfter(), clazz2.getName()) != null) { - return 1; - } - else if (Utils.getNamedElementFromList(precedenceC1.getInvokeBefore(), clazz2.getName()) != null) { - return -1; - } - } - else if (precedenceC2 != null) { - if (Utils.getNamedElementFromList(precedenceC2.getInvokeAfter(), clazz1.getName()) != null) { - return -1; - } - else if (Utils.getNamedElementFromList(precedenceC2.getInvokeBefore(), clazz1.getName()) != null) { - return 1; - } - } - // singletons have precedence over "normal" classes - boolean ci1IsSingleton = Utils.isSingleton(clazz1); - boolean ci2IsSingleton = Utils.isSingleton(clazz2); - if (ci1IsSingleton) { - if (!ci2IsSingleton) { - // not both are singletons - return -1; - } - } - else if (ci2IsSingleton) { - return 1; - } - return 0; - } - }; - Class[] activationKeys = m_activation.keySet().toArray(new Class[0]); - String get_lc = PrefixConstants.getP_Prefix + "lc"; //$NON-NLS-1$ - if (activationKeys.length > 0) { - Arrays.sort(activationKeys, comparator); - code += "// activation code\n"; //$NON-NLS-1$ - for (Class implementation : activationKeys) { - EList varNameList = m_activation.get(implementation); - for (String varName : varNameList) { - code += varName + get_lc + "()->activate();\n"; //$NON-NLS-1$ - } - } - } - - Include cppInclude = UMLUtil.getStereotypeApplication(m_bootLoader, Include.class); - if (m_initCodeRun.length() > 0) { - code += "// initial user start\n" + m_initCodeRun; //$NON-NLS-1$ - } else { - // no component implements the initial start, therefore enter a sleep - // unistd is required (at least on unix systems) for sleep - cppInclude.setPreBody("#include // for sleep\n"); //$NON-NLS-1$ - - code += "// sleep forever\n"; //$NON-NLS-1$ - code += "for (;;) { sleep(100); }\n"; //$NON-NLS-1$ - // throw new TransformationRTException("no component implements the initial start. Assure that one component inherits from the CStart component"); - } - if (activationKeys.length > 0) { - code += "// deactivation code (reverse order)\n"; //$NON-NLS-1$ - - // traverse in reverse order - for (int i = activationKeys.length - 1; i >= 0; i--) { - Class implementation = activationKeys[i]; - EList varNameList = m_activation.get(implementation); - for (String varName : varNameList) { - code += varName + get_lc + "()->deactivate();\n"; //$NON-NLS-1$ - } - } - } - - initBehavior.getBodies().add(code); - } - - public Class getUML() { - return m_bootLoader; - } - - private Class m_bootLoader; - - private final static String bootloaderQNAME = "core::composites::BootLoader"; //$NON-NLS-1$ - - /** - * Initialization code, in particular assignment of part properties within composites - */ - private String m_initCode; - - /** - * Init code for create connections calls in composites with at least one assembly - * connector - */ - private String m_initCodeCConfig; - - /** - * Init code for create connections calls in composites with at least one assembly - * connector - */ - private String m_initCodeCConnections; - - /** - * Init code for blocking "run" calls (related to CStart system component) - */ - private String m_initCodeRun; - - /** - * Map containing activations/de-activations - */ - private Map> m_activation; - - private boolean outputSizeof; - - /** - * copy variable (instances still point to non-copied classes) - */ - private LazyCopier m_copy; - - /** - * Store a map with index values to manage configuration of arrays - */ - // protected Map indexMap; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepCreation.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepCreation.java deleted file mode 100644 index a712642e584..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepCreation.java +++ /dev/null @@ -1,646 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.core.deployment; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Stack; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.AutoIndex; -import org.eclipse.papyrus.FCM.AutoIndexPerNode; -import org.eclipse.papyrus.FCM.ConfigurationProperty; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.CopyAttributeValue; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.FCM.util.FCMUtil; -import org.eclipse.papyrus.qompass.designer.core.CORBAtypeNames; -import org.eclipse.papyrus.qompass.designer.core.ConfigUtils; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationRTException; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.AggregationKind; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.Enumeration; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.InstanceValue; -import org.eclipse.uml2.uml.LiteralInteger; -import org.eclipse.uml2.uml.Node; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.StructuralFeature; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.ValueSpecification; -import org.eclipse.uml2.uml.util.UMLUtil; - -public class DepCreation { - - private static Map map; - - public static final String valueFor = "value for "; //$NON-NLS-1$ - - /** - * Create a slot and add an instance value associated with a part instance - * specification. - * - * @param is - * the instance specification for which a slot should be created - * @param partIS - * the instance specification associated with the slot (to be - * precise with slot's instance value) - * @param part - * the part associated with the slot, i.e. its defining feature - * @return The created slot - */ - public static Slot createSlot(InstanceSpecification is, - InstanceSpecification partIS, Property part) { - // the instance specification of the composite has a slot for each part - // and it points - // to the instance specification associated with the part. - Slot slot = is.createSlot(); - slot.setDefiningFeature(part); - - InstanceValue iv = (InstanceValue) slot.createValue(null, null, - UMLPackage.eINSTANCE.getInstanceValue()); - iv.setInstance(partIS); - return slot; - - } - - /** - * Create a Slot and a value for a configuration attribute - * - * @param attribute - */ - public static Slot createSlotForConfigProp(InstanceSpecification is, - Property attribute) { - - Slot slot = is.createSlot(); - slot.setDefiningFeature(attribute); - // For primitive types, the UML type does not provide sufficient information to decide - // whether it is a string or a numerical value. In case of the C++ profile, primitive - // UML types denote a language specific type, but we want to avoid C++ specific code, if - // possible. - // => pragmatic solution: use LiteralString as default, unless a check for some known numerical - // primitive types holds (in particular the UML as well as Qompass CORBA types) - // In addition, string values are not automatically quoted, i.e. it is possible to enter e.g. - // a float value as a string expression (it also means that a "real" string value must be quoted - // by the user). - Type type = attribute.getType(); - if (type != null) { - String name = type.getName(); - String qname = type.getQualifiedName(); - if (type instanceof Enumeration) { - slot.createValue(valueFor + attribute.getName(), type, UMLPackage.eINSTANCE.getInstanceValue()); - } else if (name.equals("Integer") || qname.equals(CORBAtypeNames.Octet) //$NON-NLS-1$ - || qname.equals(CORBAtypeNames.Long) - || qname.equals(CORBAtypeNames.UnsignedLong) - || qname.equals(CORBAtypeNames.Short) - || qname.equals(CORBAtypeNames.UnsignedShort)) { - slot.createValue(valueFor + attribute.getName(), type, - UMLPackage.eINSTANCE.getLiteralInteger()); - } else if (name.equals("Boolean")) { //$NON-NLS-1$ - slot.createValue(valueFor + attribute.getName(), type, - UMLPackage.eINSTANCE.getLiteralBoolean()); - } else { - slot.createValue(valueFor + attribute.getName(), type, - UMLPackage.eINSTANCE.getLiteralString()); - } - } - return slot; - } - - /** - * Create a string slot and a value for a configuration attribute - * - * @param attribute - */ - public static Slot createStringSlotForConfigProp(InstanceSpecification is, - Property attribute) { - - Slot slot = is.createSlot(); - slot.setDefiningFeature(attribute); - Type type = attribute.getType(); - if (type != null) { - slot.createValue(valueFor + attribute.getName(), type, - UMLPackage.eINSTANCE.getLiteralString()); - } - return slot; - } - - /** - * create a deployment plan, i.e. a set of instances that correspond to an - * implementation which is potentially a composite. In case of the latter, - * this function is called recursively to create deployment plans for the - * parts. Since a composite implementation may optionally specify only the - * type of parts (not the concrete implementation), this function also - * supports that a type is passed. In this case, an implementation is - * automatically assigned. - * - * @param cdp - * the deployment plan (package) in which to create instances - * @param typeOrImplem - * the type - * @param nane - * the name of the instance - * @param createSlotsForConfigValues - * if true, create slots for configuration values - */ - public static InstanceSpecification createDepPlan(Package cdp, - Class typeOrImplem, String name, boolean createSlotsForConfigValues) - throws TransformationException { - return createDepPlan(cdp, typeOrImplem, name, createSlotsForConfigValues, new Stack()); - } - - public static InstanceSpecification createDepPlan(Package cdp, - Class typeOrImplem, String name, boolean createSlotsForConfigValues, Stack visitedClassifiers) - throws TransformationException { - // create an instance specification for the composite - if (visitedClassifiers.contains(typeOrImplem)) { - String path = ""; //$NON-NLS-1$ - for (Classifier cl : visitedClassifiers) { - if (path.length() > 0) { - path += ", "; //$NON-NLS-1$ - } - path += cl.getName(); - } - path += ", " + typeOrImplem.getName(); //$NON-NLS-1$ - throw new TransformationException(String.format( - Messages.DepCreation_CircularReference, - typeOrImplem.getQualifiedName(), path)); - } - visitedClassifiers.push(typeOrImplem); - - InstanceSpecification is; - // treat singleton - if (Utils.isSingleton(typeOrImplem)) { - // is a singleton - exactly one instance exists - InstanceSpecification mainInstance = DepUtils.getMainInstance(cdp); - - // use canonical name for singleton instance - lower case for type-name - String partName = DeployConstants.singletonPrefix + typeOrImplem.getName().toLowerCase(); - name = mainInstance.getName() + DeployConstants.SEP_CHAR + partName; - PackageableElement pe = cdp.getPackagedElement(name); - - if (pe == null) { - // instance specification for singleton does not exist yet => create - - Classifier system = DepUtils.getClassifier(mainInstance); - Property singletonAttr = system.getAttribute(partName, typeOrImplem); - if ((singletonAttr == null) && system instanceof Class) { - singletonAttr = ((Class) system).createOwnedAttribute(partName, typeOrImplem); - singletonAttr.setAggregation(AggregationKind.COMPOSITE_LITERAL); - } - - is = (InstanceSpecification) cdp.createPackagedElement(name, UMLPackage.eINSTANCE.getInstanceSpecification()); - // create slot within main instance - createSlot(mainInstance, is, singletonAttr); - } else if (pe instanceof InstanceSpecification) { - // exists already, return it without recursing into its sub-specifications - return (InstanceSpecification) pe; - } else { - // unlikely case that a packaged element with the name - // exists already, but is not an instance specification - throw new TransformationException(String.format( - Messages.DepCreation_SingletonExistsAlready, name)); - } - } else { - is = (InstanceSpecification) cdp.createPackagedElement(name, UMLPackage.eINSTANCE.getInstanceSpecification()); - } - - if (name.equals(DeployConstants.MAIN_INSTANCE)) { - DepUtils.setMainInstance(cdp, is); - } - - Class implementation = null; - - // treat HW architecture or nodes as implementations - if (Utils.isCompImpl(typeOrImplem) - || typeOrImplem instanceof Node) { - // implementation is known => must be able to do this. - if (typeOrImplem instanceof Class) { - implementation = typeOrImplem; - } - } else { - // problem? further tree expansion might depend on chosen - // implementation) - // TODO: don't know node yet => implementation choice is more - // general than necessary - implementation = DepUtils.chooseImplementation(typeOrImplem, null, null); - } - - if (!(implementation instanceof Class)) { - throw new TransformationException(String.format( - Messages.DepCreation_CannotFindImplementation, - name, typeOrImplem.getName())); - } - // else implementation is instance of Class (and not null) - - is.getClassifiers().add(implementation); - // add connector and container implementations - if (createSlotsForConfigValues) { - EList rules = FCMUtil.getAllContainerRules(implementation); - for (ContainerRule rule : rules) { - addConfigurationOfContainer(rule, is); - } - } - - for (Connector connector : implementation.getOwnedConnectors()) { - org.eclipse.papyrus.FCM.Connector fcmConn = UMLUtil.getStereotypeApplication(connector, org.eclipse.papyrus.FCM.Connector.class); - if (fcmConn != null) { - String partName = name + "." + connector.getName(); //$NON-NLS-1$ - InteractionComponent connectorComp = fcmConn.getIc(); - if (connectorComp != null) { - Class cl = fcmConn.getIc().getBase_Class(); - if (cl == null) { - throw new TransformationException(Messages.DepCreation_FCMconnectorWithoutBaseClass); - } - // create sub-instance for connector. It is not possible to - // create a slot in the owning instance specification, - // since the connector cannot be referenced as a defining-feature - createDepPlan(cdp, cl, partName, createSlotsForConfigValues, visitedClassifiers); - } - } - } - - for (Property attribute : implementation.getAllAttributes()) { - // loop over all attributes (not only parts, since we need to - // capture singletons) - if (attribute instanceof Port) { - continue; - } - Type type = attribute.getType(); - - if (Utils.isComposition(attribute)) { - // composition, attribute is a part - if (((type instanceof Class) && Utils.isComponent((Class) type)) || type instanceof Node) { - Class cl = (Class) type; - - // TODO: ad-hoc replication support. Better solution via design patterns - int upper = attribute.getUpper(); - String infix = ""; //$NON-NLS-1$ - - // TODO: check validation constraints - for (int i = 0; i < upper; i++) { - String partName = name + "." + attribute.getName(); //$NON-NLS-1$ - if (upper > 1) { - partName += "_" + infix + i; //$NON-NLS-1$ - } - InstanceSpecification partIS = createDepPlan(cdp, cl, - partName, createSlotsForConfigValues, visitedClassifiers); - // may not create slot for singleton, since automatically done - if (!Utils.isSingleton((Class) type)) { - createSlot(is, partIS, attribute); - } - } - } else if (StereotypeUtil.isApplied(attribute, ConfigurationProperty.class) - && createSlotsForConfigValues) { - // is a configuration property, create slot - // TODO: implicit assumption that configuration attributes - // are not components - createSlotForConfigProp(is, attribute); - } - } else if (type instanceof Class) { - // no composition - only create slot, if a singleton - // (otherwise, it's not clear with which instance the slot - // should be associated) - Log.log(IStatus.INFO, Log.DEPLOYMENT, String.format( - Messages.DepCreation_InfoCreateDepPlan, type.getQualifiedName())); - if (Utils.isSingleton((Class) type)) { - // is a singleton - exactly one instance exists - // recursive call - pass empty name, since name for singletons is re-calculated. - InstanceSpecification singletonIS = createDepPlan(cdp, - (Class) type, "", createSlotsForConfigValues, visitedClassifiers); //$NON-NLS-1$ - createSlot(is, singletonIS, attribute); - } - } else if (type == null) { - throw new TransformationException(String.format(Messages.DepCreation_TypeInAttributeUndefined, - attribute.getName(), implementation.getName())); - } - } - visitedClassifiers.pop(); - return is; - } - - /** - * Create slot for configuration properties that come from container rules - * - * @param aRule - * @param is - * @throws TransformationException - */ - private static void addConfigurationOfContainer(ContainerRule rule, - InstanceSpecification is) throws TransformationException { - boolean first = true; - for (Property attribute : ConfigUtils.getConfigAttributes(rule)) { - Type type = attribute.getType(); - if ((StereotypeUtil.isApplied(attribute, ConfigurationProperty.class)) - && (type instanceof Classifier)) { - Classifier aggregateOrInterceptor; - if (type instanceof Class) { - aggregateOrInterceptor = DepUtils.chooseImplementation( - (Class) type, new BasicEList(), - null); - } else { - aggregateOrInterceptor = (Classifier) type; - } - // is a configuration property, create slot - if (first) { - // add contExtImpl to list of classifiers that the instance - // specification describes - is.getClassifiers().add(aggregateOrInterceptor); - first = false; - } - // CAVEAT: - // - single value specification for all occurrences of an interceptor - // - Could be done, but: how to know whether user wants single - // vs. interceptor specific configuration? - // - two different interceptors may not share the same type with - // a configuration attribute - createSlotForConfigProp(is, attribute); - } - } - } - - /** - * create a deployment plan, i.e. a set of instances that correspond to an - * implementation which is potentially a composite. In case of the latter, - * this function is called recursively to create deployment plans for the - * parts. Since a composite implementation may optionally specify only the - * type of parts (not the concrete implementation), this function also - * supports that a type is passed. In this case, an implementation is - * automatically assigned. - * - * @param cdp - * the deployment plan (package) in which to create instances - * @param typeOrImplem - * the type - * @param nane - * the name of the instance - * @param createSlotsForConfigValues - * if true, create slots for configuration values - */ - public static InstanceSpecification createPlatformInstances( - Package platform, Class implementation, String name) - throws TransformationException { - // create an instance specification for the composite - InstanceSpecification is = null; - is = (InstanceSpecification) platform.createPackagedElement(name, - UMLPackage.eINSTANCE.getInstanceSpecification()); - is.getClassifiers().add(implementation); - - // add connector and container implementations - - for (Property attribute : implementation.getAllAttributes()) { - // loop over all attributes (not only parts, since we need to - // capture singletons) - if (attribute instanceof Port) { - continue; - } - Type type = attribute.getType(); - - if (Utils.isComposition(attribute)) { - // composition, attribute is a part - if (type instanceof Class) { // should be a node, but do not require it - Class cl = (Class) type; - - int upper = attribute.getUpper(); - String infix = ""; //$NON-NLS-1$ - // TODO: check validation constraints - for (int i = 0; i < upper; i++) { - // prefix with name, unless null - String partName = (name != null) ? name + DeployConstants.SEP_CHAR : ""; //$NON-NLS-1$ - partName += attribute.getName(); - if (upper > 1) { - partName += "_" + infix + i; //$NON-NLS-1$ - } - InstanceSpecification partIS = createPlatformInstances( - platform, cl, partName); - - if (is != null) { - createSlot(is, partIS, attribute); - } - } - } else if (StereotypeUtil.isApplied(attribute, - ConfigurationProperty.class)) { - // is a configuration property, create slot - // TODO: implicit assumption that configuration attributes - // are not components - createSlotForConfigProp(is, attribute); - } - } - } - return is; - } - - /** - * Initialize the automatic values within a deployment plan - and the update - * eventual copies of these values. - * - * @param is - * the main instance of the deployment plan - */ - public static void initAutoValues(InstanceSpecification is) { - Collection isList = new ArrayList(); - isList.add(is); - initAutoValues(isList); - } - - /** - * Initialize the automatic values within a deployment plan - and the update - * eventual copies of these values. - * - * @param is - * the main instance of the deployment plan - */ - public static void initAutoValues(Collection isList) { - map = new HashMap(); - for (InstanceSpecification is : isList) { - initAutoValuesHelper(is); - } - Stack isStack = new Stack(); - for (InstanceSpecification is : isList) { - copyAutoValues(isStack, is); - } - } - - /** - * Initialize the automatic values within a deployment plan. - * - * @param is - * the main instance of the deployment plan - */ - public static void initAutoValuesHelper(InstanceSpecification is) { - for (Slot slot : is.getSlots()) { - StructuralFeature sf = slot.getDefiningFeature(); - if (sf == null) { - throw new RuntimeException(String.format(Messages.DepCreation_DefiningFeatureNull, - slot.getOwningInstance().getName())); - } - if (StereotypeUtil.isApplied(sf, AutoIndex.class)) { - Integer value = null; - Object key; - if (StereotypeUtil.isApplied(sf, AutoIndexPerNode.class)) { - InstanceSpecification nodeOrThread = AllocUtils.getNode(is); - key = sf.getName() + nodeOrThread.getName(); - } else { - key = sf; - } - if (!map.containsKey(key)) { - map.put(key, new Integer(0)); - } - value = map.get(key); - value++; // no need to put incremented value back into map, - // since Integer is a reference => value is updated - - // create slot and value specification (literal-integer) for the - // auto index - LiteralInteger li = (LiteralInteger) slot.createValue( - sf.getName() + DeployConstants.AUTO_POSTFIX, sf.getType(), - UMLPackage.eINSTANCE.getLiteralInteger()); - li.setValue(value); - - // recursion in case of values that are instance values - for (ValueSpecification vs : slot.getValues()) { - if (vs instanceof InstanceValue) { - InstanceSpecification subIS = ((InstanceValue) vs).getInstance(); - initAutoValues(subIS); - } - } - } - } - } - - /** - * Copy automatic values within a deployment plan. - * Attributes can apply the CopyAttributeValue stereotype. The stereotype can point - * to another attribute (source). If the other attribute has a configuration value, it gets - * copied. - * The function takes into account that the source attribute might be in a component that is - * instantiated several times with different configuration values. The attribute that gets the - * copy must use the "nearest" value which means that there must be a common composite that - * contains both attribute (indirectly). - * The main use case is that connector fragments need to have common configuration attributes - * (e-g- server fragment has automatic index value, client fragment needs to copy this value) - * - * @param is - * the main instance of the deployment plan - */ - public static void copyAutoValues(Stack isStack, - InstanceSpecification is) { - isStack.push(is); - for (Slot slot : is.getSlots()) { - StructuralFeature sf = slot.getDefiningFeature(); - if (sf == null) { - throw new TransformationRTException(is.getName() + " has a slot without defining feature"); //$NON-NLS-1$ - } - if (StereotypeUtil.isApplied(sf, CopyAttributeValue.class)) { - CopyAttributeValue cav = UMLUtil.getStereotypeApplication(sf, - CopyAttributeValue.class); - Property source = cav.getSource(); - ValueSpecification vs = getNearestValue(isStack, source); - if (vs instanceof LiteralInteger) { - LiteralInteger liCopy = (LiteralInteger) slot.createValue( - sf.getName() + "_copy", sf.getType(), //$NON-NLS-1$ - UMLPackage.eINSTANCE.getLiteralInteger()); - int value = ((LiteralInteger) vs).getValue(); - liCopy.setValue(value); - } - } - - // recursion in case of values that are instance values - for (ValueSpecification vs : slot.getValues()) { - if (vs instanceof InstanceValue) { - InstanceSpecification subIS = ((InstanceValue) vs).getInstance(); - if (subIS != null) { - copyAutoValues(isStack, subIS); - } - } - } - } - isStack.pop(); - } - - /** - * try to find a value (ValueSpecification) for the passed source element, - * beginning a the "deepest" instance specification of the passed stack. If - * not found, continue at elements higher up in the hierarchy - * - * @param isStack - * a stack of instance specifications corresponding to a path - * within an instance tree - * @param source - * a property (defining feature) for which we search an instance - * specification - * @return The value specifications for the passed source property or null - */ - public static ValueSpecification getNearestValue( - Stack isStack, Property source) { - Stack copy = new Stack(); - copy.addAll(isStack); - while (!copy.isEmpty()) { - InstanceSpecification pop = copy.pop(); - ValueSpecification vs = getNearestValueHelper(isStack, pop, source); - if (vs != null) { - return vs; - } - } - return null; - } - - /** - * Helper for getNearestValue: search for an instance specification that has - * source as defining feature. Start at the passed instance specification, - * but do not recurse into elements that are contained in the stack. - * - * @param isStack - * A stack of instance specifications corresponding to a path - * within an instance tree - * @param is - * the starting instance specification - * @param source - * source a property (defining feature) for which we search an - * instance specification - * @return The value specifications for the passed source property or null - */ - public static ValueSpecification getNearestValueHelper( - Stack isStack, InstanceSpecification is, - Property source) { - for (Slot slot : is.getSlots()) { - StructuralFeature sf = slot.getDefiningFeature(); - if (sf == source) { - // found property, now return first value specification - for (ValueSpecification vs : slot.getValues()) { - return vs; - } - return null; - } - - // recursion in case of values that are instance values - for (ValueSpecification vs : slot.getValues()) { - if (vs instanceof InstanceValue) { - InstanceSpecification subIS = ((InstanceValue) vs) - .getInstance(); - if (!isStack.contains(subIS)) { - // only recurse, if not contained in stack of instance - // specifications (avoid traversing - // the same elements multiple times) - return getNearestValueHelper(isStack, subIS, source); - } - } - } - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepPlanUtils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepPlanUtils.java deleted file mode 100644 index f1f9b08d475..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepPlanUtils.java +++ /dev/null @@ -1,375 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.deployment; - -import java.util.Iterator; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.Enumerator; -import org.eclipse.emf.ecore.ENamedElement; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Enumeration; -import org.eclipse.uml2.uml.EnumerationLiteral; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.InstanceValue; -import org.eclipse.uml2.uml.LiteralInteger; -import org.eclipse.uml2.uml.LiteralString; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.StructuralFeature; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.ValueSpecification; - -public class DepPlanUtils { - - /** - * Return the package in which deployment plans are stored. Caveat: needs to be executed within a - * transition, since the deployment plan package will be created, if it does not exist yet. - * - * @param element - * an arbitrary element of the source model (i.e. the model that will - * store the deployment plan - * @return package in which deployment plans are stored - */ - public static Package getDepPlanRoot(Element element) { - return Utils.getRoot(element, DeployConstants.depPlanFolder); - } - - /** - * Return all deployment plans - * - * @param element - * an arbitrary element of the source model (i.e. the model that will - * store the deployment plan - * @return - */ - public static EList getAllDepPlans(Element element) { - Package root = PackageUtil.getRootPackage(element); - Package depPlanRoot = root.getNestedPackage(DeployConstants.depPlanFolder); - EList depPlanList = new BasicEList(); - if (depPlanRoot != null) { - for (Package pkg : depPlanRoot.getNestedPackages()) { - if (StereotypeUtil.isApplied(pkg, DeploymentPlan.class)) { - depPlanList.add(pkg); - } - } - } - return depPlanList; - } - - public static void delDepPlan(InstanceSpecification is) { - Iterator slots = is.getSlots().iterator(); - while (slots.hasNext()) { - Slot slot = slots.next(); - InstanceSpecification subInstance = getInstance(slot); - if (subInstance != null) { - delDepPlan(subInstance); - } - } - Element owner = is.getOwner(); - if (owner instanceof Package) { - ((Package) owner).getPackagedElements().remove(is); - } - } - - /** - * Return the instance that is defined by a slot value - * - * @param slot - * @return the first slot that corresponds to an instance specification - */ - public static InstanceSpecification getInstance(Slot slot) { - Iterator values = slot.getValues().iterator(); - while (values.hasNext()) { - ValueSpecification value = values.next(); - // instances are accessible via ValueSpecification subclass InstanceValue - if (value instanceof InstanceValue) { - return ((InstanceValue) value).getInstance(); - } - } - return null; - } - - /** - * create a slot for a given sub-instance specification. - * - * @param cdp - * a deployment plan - * @param is - * an instance specification for a composite class - * @param partIS - * the instance specification of a part within the composite - * @param part - * the part within the composite - */ - public static Slot createSlot(Package cdp, InstanceSpecification is, InstanceSpecification partIS, Property part) { - // the instance specification of the composite has a slot for each part and it points - // to the instance specification associated with the part. - Slot slot = is.createSlot(); - slot.setDefiningFeature(part); - - InstanceValue iv = (InstanceValue) - slot.createValue(null, null, UMLPackage.eINSTANCE.getInstanceValue()); - iv.setInstance(partIS); - return slot; - - } - - /** - * Apply the stereotype deployment plan and set the mainInstance value - * - * @param cdp - * the deployment plan - * @param main - * instance the top-level instance specification of the plan - */ - public static void setMainInstance(Package cdp, InstanceSpecification mainInstance) { - DeploymentPlan cdpApp = StereotypeUtil.applyApp(cdp, DeploymentPlan.class); - if (cdpApp != null) { - cdpApp.setMainInstance(mainInstance); - } - } - - /** - * Automatically choose an implementation, i.e. choose the first implementation - * within the component model that implements a given component type. - */ - public static Class autoChooseImplementation(Classifier componentType) { - // choose implementation automatically: get the first one that implements the passed type - // (problem: further tree expansion might depend on chosen implementation) - // get reference to component model, then search all classes contained in it. - Package compModel = Utils.getRoot(componentType, DeployConstants.COMPONENT_MODEL); - Iterator elements = compModel.allOwnedElements().iterator(); - while (elements.hasNext()) { - Element element = elements.next(); - if (element instanceof Class) { - Class candidate = (Class) element; - if (candidate.getSuperClass(componentType.getName()) != null) { - return candidate; - } - } - } - return null; - } - - /** - * Configure an attribute of an instance specification - * - * @param instance - * the instance specification - * @param property - * An ENamedElement denoting the name of an attribute of a classifier that - * is in the classifier list of the instance specification - * @param value - * the string value. An enumeration can be configured via the name of the literal - */ - public static void configureProperty(InstanceSpecification instance, ENamedElement property, String value) { - configureProperty(instance, property.getName(), value); - } - - /** - * Configure an attribute of an instance specification - * - * @param instance - * the instance specification - * @param propertyName - * the name of an attribute of a classifier that is in the classifier list - * of the instance specification - * @param value - * the string value. An enumeration can be configured via the name of the literal - */ - public static void configureProperty(InstanceSpecification instance, String propertyName, String value) { - Classifier extension = DepUtils.getClassifier(instance); - Property attribute = (Property) Utils.getNamedElementFromList(extension.getAllAttributes(), propertyName); - if (attribute == null) { - throw new RuntimeException(String.format(Messages.DepPlanUtils_CannotFindAttribute, propertyName, extension.getName())); - } - configureProperty(instance, attribute, value); - } - - /** - * Configure an attribute of an instance specification - * - * @param instance - * the instance specification - * @param attribute - * an attribute of a classifier that is in the classifier list of the instance specification - * @param value - * the string value. An enumeration can be configured via the name of the literal - */ - public static void configureProperty(InstanceSpecification instance, Property attribute, String value) { - if (attribute.getType() instanceof Enumeration) { - configureEnumProperty(instance, attribute, value); - } - else { - // create a slot for a string value - Slot slotStringVal = DepCreation.createSlotForConfigProp(instance, attribute); - if (slotStringVal.getValues().get(0) instanceof LiteralString) { - ((LiteralString) slotStringVal.getValues().get(0)).setValue(value); - } - else { - // indicates that operation has been called although types do not match - throw new RuntimeException(String.format(Messages.DepPlanUtils_ConfigOfPropertyFailed, attribute.getName())); - } - } - } - - /** - * Configure an attribute of an instance specification - * - * @param instance - * the instance specification - * @param property - * An ENamedElement denoting the name of an attribute of a classifier that - * is in the classifier list of the instance specification - * @param value - * the integer value. - */ - public static void configureProperty(InstanceSpecification instance, ENamedElement property, int value) { - configureProperty(instance, property.getName(), value); - } - - /** - * Configure an attribute of an instance specification - * - * @param instance - * the instance specification - * @param propertyName - * the name of an attribute of a classifier that is in the classifier list - * of the instance specification - * @param value - * the integer value. - */ - public static void configureProperty(InstanceSpecification instance, String propertyName, int value) { - Classifier extension = DepUtils.getClassifier(instance); - Property attribute = (Property) Utils.getNamedElementFromList(extension.getAllAttributes(), propertyName); - if (attribute == null) { - throw new RuntimeException(String.format(Messages.DepPlanUtils_CannotFindAttribute, propertyName, extension.getName())); - } - configureProperty(instance, attribute, value); - } - - /** - * Configure an attribute of an instance specification - * - * @param instance - * the instance specification - * @param attribute - * an attribute of a classifier that is in the classifier list of the instance specification - * @param value - * the integer value. - */ - public static void configureProperty(InstanceSpecification instance, Property attribute, int value) { - Slot slotIntVal = instance.createSlot(); - slotIntVal.setDefiningFeature(attribute); - LiteralInteger intValue = (LiteralInteger) - slotIntVal.createValue("value for " + attribute.getName(), attribute.getType(), UMLPackage.eINSTANCE.getLiteralInteger()); //$NON-NLS-1$ - intValue.setValue(value); - } - - /** - * Convenience function: allow that an ECore named element is passed instead of a property name. This is useful if the - * parameter that should be configured stems from a static profile - * - * @param instance - * The instance of which an attribute should be configured. - * @param property - * The name of the property (denoted by an ENamedElement) that should be configured - * @param value - * its value in form of an element of an ECore enumerator value - */ - public static void configureProperty(InstanceSpecification instance, ENamedElement property, Enumerator value) { - configureProperty(instance, property.getName(), value); - } - - /** - * Configure a property for an enumeration. Enumerations are a bit difficult to handle, since the enumeration literal itself - * must be created first in form of an instance specification - * - * @param instance - * The instance of which an attribute should be configured. - * @param propertyName - * The name of the property that should be configured - * @param value - * its value in form of an element of an ECore enumerator value - */ - public static void configureProperty(InstanceSpecification instance, String propertyName, Enumerator value) { - configureProperty(instance, propertyName, value.getName()); - } - - /** - * Configure a property for an enumeration. Enumerations are a bit difficult to handle, since the enumeration literal itself - * must be created first in form of an instance specification. - * - * @param instance - * The instance of which an attribute should be configured. - * @param propertyName - * The name of the property that should be configured - * @param value - * its value in form of an String. The function does nothing, if no literal corresponds to the passed - * String - */ - public static void configureEnumProperty(InstanceSpecification instance, String propertyName, String literalName) { - Classifier extension = DepUtils.getClassifier(instance); - Property attribute = (Property) Utils.getNamedElementFromList(extension.getAllAttributes(), propertyName); - if (attribute == null) { - throw new RuntimeException(String.format(Messages.DepPlanUtils_CannotFindAttribute, propertyName, extension.getName())); - } - configureEnumProperty(instance, attribute, literalName); - } - - public static void configureEnumProperty(InstanceSpecification instance, Property attribute, String literalName) { - if (attribute.getType() instanceof Enumeration) { - Enumeration enumeration = (Enumeration) attribute.getType(); - for (EnumerationLiteral enumLiteral : enumeration.getOwnedLiterals()) { - if (enumLiteral.getLabel().equals(literalName)) { - Slot slotEnumVal = instance.createSlot(); - slotEnumVal.setDefiningFeature(attribute); - InstanceValue enumLitValue = (InstanceValue) - slotEnumVal.createValue("value for " + attribute.getName(), attribute.getType(), UMLPackage.eINSTANCE.getInstanceValue()); //$NON-NLS-1$ - enumLitValue.setInstance(enumLiteral); - break; - } - } - } - } - - /** - * Update the names of instances within a deployment plan to correspond to changes - * in the hierarchy. In particular, flattening of interaction components requires this update. - * - * @param composite - * System composite - */ - public static void updateInstanceNames(InstanceSpecification instance, String name) { - instance.setName(name); - for (Slot slot : instance.getSlots()) { - InstanceSpecification subInstance = DepUtils.getInstance(slot); - StructuralFeature sf = slot.getDefiningFeature(); - if ((subInstance != null) && !DepUtils.isShared(slot)) { - updateInstanceNames(subInstance, name + DeployConstants.SEP_CHAR + sf.getName()); - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepUtils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepUtils.java deleted file mode 100644 index 9d687ed40d1..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepUtils.java +++ /dev/null @@ -1,564 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.core.deployment; - -import java.util.Iterator; -import java.util.Stack; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature.Setting; -import org.eclipse.papyrus.FCM.CodeGenOptions; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.FCM.ImplementationGroup; -import org.eclipse.papyrus.FCM.ImplementationProperties; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.FCM.Target; -import org.eclipse.papyrus.qompass.designer.core.ElementFilter; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.common.util.UML2Util; -import org.eclipse.uml2.uml.AggregationKind; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.DirectedRelationship; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Generalization; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.InstanceValue; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.StructuralFeature; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.ValueSpecification; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Utilities around instances (within deployment plan) - * [DepPlanUtils?] - * [but missing: creation, ..., allocation?] - * Structuration ?? - * - * @author ansgar - * - */ -public class DepUtils { - - /** - * Check whether a class is an eligible implementation for a certain node, i.e. - * has compatible requirements. - * Requires that setCurrentNode has been called earlier - * TODO: how does that work with connector reification between distributeToNode has been - * called??! - * - * @param implemCandidate - * @return - */ - public static boolean isImplEligible(Class implemCandidate, EList nodes) { - if (!Utils.isCompImpl(implemCandidate)) { - return false; - } - if (nodes != null) { - // now check properties - if (nodes.size() > 1) { - // indicates distribution - InteractionComponent connImpl = UMLUtil.getStereotypeApplication(implemCandidate, InteractionComponent.class); - // if a connector implementation, it must support distribution (in case of multiple nodes) - // TODO: criteria is not optimal, since a composite may be deployed on multiple nodes, - // but a contained connector might still only connect local parts. - if (connImpl != null) { - if (!connImpl.isForDistribution()) { - return false; - } - } - } - // must fit requirements of all nodes - for (InstanceSpecification nodeInstance : nodes) { - Target target = UMLUtil.getStereotypeApplication(nodeInstance, Target.class); - if (target == null) { - // no target information on instance => try to get this - // information from the node referenced by the instance - target = UMLUtil.getStereotypeApplication(DepUtils.getClassifier(nodeInstance), Target.class); - } - if (target != null) { - ImplementationProperties implProps = UMLUtil.getStereotypeApplication(implemCandidate, ImplementationProperties.class); - if (implProps != null) { - if (!implProps.getArch().contains(target.getTargetArch())) { - return false; - } - // TODO: check OS and size as well! - } - } - } - } - return true; - } - - /** - * Find a sub instance via its name. This is in particular useful for connectors that cannot be - * found via a slot, since UML only supports structural features (a connector is only a feature) - * in the definingFeature attribute of a slot. - * - * @param owningInstance - * an owning instance - * @param name - * name of the sub-element (unqualified) - * @return the found sub-instance or null - */ - public static InstanceSpecification getNamedSubInstance(InstanceSpecification owningInstance, String name) { - Element cdp = owningInstance.getOwner(); - String candidateName = owningInstance.getName() + "." + name; //$NON-NLS-1$ - if (cdp instanceof Package) { - for (PackageableElement instance : ((Package) cdp).getPackagedElements()) { - if (instance instanceof InstanceSpecification) { - InstanceSpecification candidate = (InstanceSpecification) instance; - - if (candidateName != null) { - if (candidateName.equals(candidate.getName())) { - return candidate; - } - } - } - } - } - return null; - } - - /** - * Automatically choose an implementation, i.e. if the passed classifier - * (1) is already an implementation, simply return it - * (2) is an implementation group, choose the first implementation that fits the requirements - * (3) is a type: choose the first implementation among the heirs that fits the requirements - * - * @param componentType - * a component type or implementation (class, optionally abstract) - * @param nodes - * a set of instance specification representing nodes on which this component will be allocated - * @param chooser - * A chooser for an implementation in case of multiple candidates - * @return a suitable implementation - */ - public static Class chooseImplementation(Class componentType, EList nodes, ImplementationChooser chooser) { - // choose implementation automatically: get the first one that implements the passed type - // get reference to component model, then search all classes contained in it. - // TODO: assumption that implementations are in same package as type; - - EList implList = new BasicEList(); - if (StereotypeUtil.isApplied(componentType, ImplementationGroup.class)) { - for (Property groupAttribute : componentType.getAttributes()) { - Type implClass = groupAttribute.getType(); - if ((implClass instanceof Class) && isImplEligible((Class) implClass, nodes)) { - InteractionComponent connImpl = UMLUtil.getStereotypeApplication(implClass, InteractionComponent.class); - if ((connImpl != null) && connImpl.isForDistribution()) { - // only add distributed connector, if distributed - // don't put check into - if (nodes.size() > 1) { - implList.add((Class) implClass); - } - } - else { - implList.add((Class) implClass); - } - } - } - } else if (Utils.isCompImpl(componentType)) { - // check this after implementation group, since the latter inherits from component implementation - return componentType; - } else if (Utils.isCompType(componentType)) { - for (DirectedRelationship relship : componentType.getTargetDirectedRelationships()) { - if (relship instanceof Generalization) { - Classifier source = ((Generalization) relship).getSpecific(); - if (source instanceof Class) { - Class implClass = (Class) source; - if (isImplEligible(implClass, nodes)) { - implList.add(implClass); - } - } - } - } - } - if (implList.size() == 0) { - return null; - } else if (implList.size() == 1) { - return implList.get(0); - } else if (chooser != null) { - Class impl = chooser.chooseImplementation(componentType, implList); - if (impl != null) { - return impl; - } - } else if (implList.size() > 0) { - return implList.get(0); - } - return null; - } - - /** - * return an instance specification for the main instance within - * a package. - * - * @param cdp - * the deployment plan - */ - public static InstanceSpecification getMainInstance(Package cdp) { - DeploymentPlan dp = UMLUtil.getStereotypeApplication(cdp, DeploymentPlan.class); - return dp.getMainInstance(); - } - - /** - * Check whether an instance specification is a top-level instance, i.e. not referenced - * by another one. - * @param is an instance specification - */ - public static boolean isTopLevelInstance(InstanceSpecification is) { - return getReferencingSlots(is).size() == 0; - } - - /** - * Apply the stereotype deployment plan and set the mainInstance value - * - * @param cdp - * the deployment plan - * @param main - * instance the top-level instance specification of the plan - */ - public static void setMainInstance(Package cdp, InstanceSpecification mainInstance) { - StereotypeUtil.apply(cdp, DeploymentPlan.class); - DeploymentPlan dp = UMLUtil.getStereotypeApplication(cdp, DeploymentPlan.class); - dp.setMainInstance(mainInstance); - } - - /** - * return the implementation associated with an instance specification, i.e. a - * Class. - * - * @param instance - * @return - */ - public static Class getImplementation(InstanceSpecification instance) { - Classifier cl = getClassifier(instance); - if (cl instanceof Class) { - return (Class) cl; - } - return null; - } - - /** - * Small helper function - * - * @param instance - * an instance specification - * @return returns true, if the stereotype ConnectorComp - * is applied to the classifier associated with an instance specification - */ - public static boolean isConnector(InstanceSpecification instance) { - Classifier cl = getClassifier(instance); - return StereotypeUtil.isApplied(cl, InteractionComponent.class); - } - - /** - * Return the first classifier referenced by an instance specification. Whereas UML supports - * a set of classifiers, we assume that that an instance specification has only one. - * - * @param instance - * the instance, for which we are interested in type information - */ - public static Classifier getClassifier(InstanceSpecification instance) { - Iterator classifierIt = instance.getClassifiers().iterator(); - // simply return the first element (if there is any) - if (classifierIt.hasNext()) { - return classifierIt.next(); - } - return null; - } - - /** - * Return the first instance specification within a deployment plan that instantiates a given - * classifier - * - * @param cdp - * the deployment plan - * @param cl - * the classifier - * @return - */ - public static InstanceSpecification getInstanceForClassifier(Package cdp, Classifier cl) { - for (PackageableElement pe : cdp.getPackagedElements()) { - if (pe instanceof InstanceSpecification) { - InstanceSpecification is = (InstanceSpecification) pe; - if (getClassifier(is) == cl) { - return is; - } - } - } - return null; - } - - /** - * Return the (unique) list of implementations that are contained within an - * instance specification - */ - public static EList getContainedImplementations(InstanceSpecification is) { - Iterator instances = getContainedInstances(is).iterator(); - EList list = new UniqueEList(); - while (instances.hasNext()) { - Classifier implementation = getClassifier(instances.next()); - list.add(implementation); - } - return list; - } - - /** - * Return the slot that is associated with a property - * - * @param is - * an instance specification (of a class having properties) - * @param property - * A property of the classifier associated with the passed instance specification - * @return the associated slot or null, if it does not exist - */ - public static Slot getSlot(InstanceSpecification is, Property property) { - for (Slot slot : is.getSlots()) { - if (slot.getDefiningFeature() == property) { - return slot; - } - } - return null; - } - - /** - * Return the instance referenced by a slot value, i.e. the first instance value associated - * with a slot - * - * @param slot - * @return - */ - public static InstanceSpecification getInstance(Slot slot) { - for (ValueSpecification value : slot.getValues()) { - // instances are accessible via ValueSpecification subclass InstanceValue - if (value instanceof InstanceValue) { - return ((InstanceValue) value).getInstance(); - } - } - return null; - } - - /** - * This method returns the instances contained within a composite instance - * specification for an assembly. - */ - public static EList getContainedInstances(InstanceSpecification is) { - EList contained = new BasicEList(); - for (Slot slot : is.getSlots()) { - InstanceSpecification instance = getInstance(slot); - if (instance != null) { - contained.add(instance); - } - } - return contained; - } - - /** - * This method returns the instances contained within a composite instance - * specification for an assembly. Unlike @see getContainedInstances, this method only - * returns contained instances that are not shared. - */ - public static EList getContainedNonSharedInstances(InstanceSpecification is) { - EList contained = new BasicEList(); - for (Slot slot : is.getSlots()) { - InstanceSpecification instance = getInstance(slot); - if ((instance != null) && !DepUtils.isShared(slot)) { - contained.add(instance); - } - } - return contained; - } - - /** - * return all slots that reference an instance specification - * - * @param is - * @return - */ - public static EList getReferencingSlots(InstanceSpecification is) { - EList list = new BasicEList(); - for (Setting setting : UML2Util.getNonNavigableInverseReferences(is)) { - EObject eObj = setting.getEObject(); - if (eObj instanceof ValueSpecification) { - ValueSpecification vs = (ValueSpecification) eObj; - Element owner = vs.getOwner(); - if (owner instanceof Slot) { - list.add((Slot) owner); - } - } - } - return list; - } - - /** - * Return a slot for a given instance specification. The slot is the first one in a list of slots - * whose value points to the passed instance. - * - * @param is - * an instance that is contained within an composite (i.e. that - * belongs to a part of this composite). - * @return - */ - public static Slot getParentSlot(InstanceSpecification is) { - for (Slot slot : getReferencingSlots(is)) { - if (slot.getDefiningFeature() instanceof Property) { - if (((Property) slot.getDefiningFeature()).getAggregation() == AggregationKind.COMPOSITE_LITERAL) { - return slot; - } - } - } - return null; - } - - /** - * Return an instance specification that refers to the composite in which the - * passed instance is contained - * - * @param is - * an instance that is contained within an composite (i.e. that - * belongs to a part of this composite). - * @return - */ - public static InstanceSpecification getParentIS(InstanceSpecification is) { - Slot parentSlot = getParentSlot(is); - if (parentSlot != null) { - return parentSlot.getOwningInstance(); - } - return null; - } - - /** - * Return the access path in terms of slots to an instance specification, i.e. the - * set of slots starting with the slot within the main instance that identifies the next - * instance until arriving at the passed instance. - * - * @param is - * @return - */ - public static Stack getAccessPath(InstanceSpecification is) { - Stack path = new Stack(); - while (is != null) { - Slot parentSlot = getParentSlot(is); - if (parentSlot == null) { - break; - } - path.insertElementAt(parentSlot, 0); - is = parentSlot.getOwningInstance(); - } - return path; - } - - /** - * Return true, if an instance is shared - * - * @param slot - * @return - */ - public static boolean isShared(Slot slot) { - StructuralFeature df = slot.getDefiningFeature(); - if (df instanceof Property) { - return ((Property) df).getAggregation() == AggregationKind.SHARED_LITERAL; - } - return false; - } - - /** - * Determine which programming language should be generated for a classifier. The - * stereotype CodeGenOptions (which could be on any owning package) is evaluated. - * - * @param pkg - * a classifier - * @return the programming language - */ - public static String getLanguageFromPackage(Package pkg) { - CodeGenOptions codeGenOpt = UMLUtil.getStereotypeApplication(pkg, CodeGenOptions.class); - if ((codeGenOpt != null) && (codeGenOpt.getProgLanguage() != null)) { - return codeGenOpt.getProgLanguage().getBase_Class().getName(); - } - else if (pkg.getOwner() instanceof Package) { - return getLanguageFromPackage((Package) pkg.getOwner()); - } - else { - return null; - } - } - - /** - * Return the target language when given the mainInstance - * @param mainInstance the mainInstance of an application - * @return target language - */ - public static String getTargetLanguage(InstanceSpecification mainInstance) { - Classifier cl = DepUtils.getClassifier(mainInstance); - String targetLanguage = DepUtils.getLanguageFromPackage(cl.getNearestPackage()); - if (targetLanguage == null) { - targetLanguage = "C++"; //$NON-NLS-1$ - } - return targetLanguage; - } - - /** - * Determine the component to OO language. The stereotype CodeGenOptions - * (which could be on any owning package) is evaluated. - * - * @param pkg - * a classifier - * @return the programming language - */ - public static String getOOTransformationFromPackage(Package pkg) { - CodeGenOptions codeGenOpt = UMLUtil.getStereotypeApplication(pkg, CodeGenOptions.class); - if ((codeGenOpt != null) && (codeGenOpt.getProgLanguage() != null)) { - return codeGenOpt.getCompToOOmapping().getBase_Class().getName(); - } - else if (pkg.getOwner() instanceof Package) { - return getLanguageFromPackage((Package) pkg.getOwner()); - } - else { - return null; - } - } - - /** - * Get all instances within a package that comply with a filter criterion. Recurse into sub-packages. - * - * @param pkg - * Starting package for search - * @param instanceList - * list of instances - * @param filter - * filter criterion. - */ - public static void getAllInstances(Package pkg, EList instanceList, ElementFilter filter) { - for (PackageableElement el : pkg.getPackagedElements()) { - if (el instanceof Package) { - getAllInstances((Package) el, instanceList, filter); - } - else if (el instanceof InstanceSpecification) { - InstanceSpecification instance = (InstanceSpecification) el; - if (filter.acceptElement(instance)) { - instanceList.add(instance); - } - } - } - } - - /** - * Return the first value for a slot. - * - * @param slot - * the slot for which the first value should be returned. - * @return - */ - public static ValueSpecification firstValue(Slot slot) { - if (slot.getValues().size() > 0) { - return slot.getValues().get(0); - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/Deploy.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/Deploy.java deleted file mode 100644 index 45ae01fc3db..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/Deploy.java +++ /dev/null @@ -1,188 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.deployment; - -import java.util.Stack; - -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.extensions.InstanceConfigurator; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.StructuralFeature; - -/* - * This file is part of Qompass GenTools - * Copyright (C) 2008 CEA LIST (http://www-list.cea.fr/) - - * initial developer : Ansgar Radermacher, Christophe JOUVRAY from CEA LIST - */ - -public class Deploy { - - /** - * distribute an instance, its contained sub-instances and the referenced - * classifiers to a certain target node - * - * @param copier - * lazy copier from intermediate to target model - * @param gatherConfigData - * an implementation that is able to gather configuration data (e.g. information about dependencies to external libraries) that will be used for project configuration - * @param node - * the instance specification of the target node - * @param nodeIndex - * the index of the target node (used for bootloader generation) - * @param numberOfNodes - * the total number of indexes (used for bootloader generation) - * @throws TransformationException - */ - public Deploy(LazyCopier copier, GatherConfigData gatherConfigData, InstanceSpecification node, - int nodeIndex, int numberOfNodes) - throws TransformationException { - bootLoaderGen = new BootLoaderGen(copier, nodeIndex, numberOfNodes); - bootLoaderGen.addCreateConnections(); - - this.node = node; - - // change to flat copy eventually later (not yet working) - depInstance = new PartialCopy(); - - depInstance.init(copier, bootLoaderGen, node); - - // set a copy listener in order to assure that indirectly added classes - // are taken into account as well - this.copier = copier; - copier.preCopyListeners.add(gatherConfigData); - } - - public void finalize(String language) { - bootLoaderGen.addInit(language); - } - - /** - * distribute an instance, its contained sub-instances and the referenced - * classifiers to a certain node - * - * @param instance - * the specification of the instance to distribute - * @return the instance specification in the target model - * @throws TransformationException - */ - public InstanceSpecification distributeToNode(InstanceSpecification instance) - throws TransformationException { - Stack slotPath = new Stack(); - InstanceSpecification newIS = distributeToNode(false, slotPath, instance); - - return newIS; - } - - /** - * Distribute an instance specification to the node by this - * - * @param allocAll - * @param slotPath - * @param instance - * @throws TransformationException - */ - public InstanceSpecification distributeToNode(boolean allocAll, Stack slotPath, InstanceSpecification instance) - throws TransformationException { - - // once an instance is explicitly allocated on a partition (use of getNodes instead of getAllNodes) - // all of its sub-instances are allocated on the node as well - - if (AllocUtils.getNodesOrThreads(instance).contains(node)) { - allocAll = true; - } - - // obtain implementation within source model - Classifier smImplementation = DepUtils.getClassifier(instance); - if (smImplementation == null) { - throw new TransformationException(String.format( - Messages.Deploy_0, instance.getName())); - } - - // copy implementation into node specific model - InstanceSpecification tmInstance = depInstance.deployInstance(instance, slotPath); - Classifier tmImplementation = DepUtils.getClassifier(tmInstance); - // Classifier tmImplementation = copy.getCopy(smImplementation); - - for (Slot slot : instance.getSlots()) { - InstanceSpecification containedInstance = DepUtils.getInstance(slot); - - if (containedInstance != null) { - if (!DepUtils.isShared(slot)) { - StructuralFeature sf = slot.getDefiningFeature(); - boolean viaAllocAll = allocAll; - if (allocAll && (sf instanceof Property)) { - // only take allocation of parent instance into account, if composition - // However, problematic, since code gets copied anyway. - // viaAllocAll = (((Property) sf).getAggregation() == AggregationKind.COMPOSITE_LITERAL); - } - if (viaAllocAll || AllocUtils.getAllNodes(containedInstance).contains(node)) { - slotPath.push(slot); - if (sf instanceof Property) { - // place configurator before recursive call. Otherwise - // values put here would be ignored. - // TODO: instances are not copied to node model. Thus, the instances here are the same as in the - // configuration on the intermediate model. - // TODO: MIX of bootloaderGeneration and splitting. - InstanceConfigurator.configureInstance(containedInstance, (Property) sf, tmInstance); - } - // distribute subInstance - distributeToNode(allocAll, slotPath, containedInstance); - slotPath.pop(); - } - } else if (allocAll || AllocUtils.getAllNodes(containedInstance).contains(node)) { - slotPath.push(slot); - // bootLoaderGen.instanceConfig(slotPath, instance); - bootLoaderGen.addInstance(slotPath, containedInstance, null, node); - slotPath.pop(); - } - } else { - // slot contains configuration of primitive attribute (no - // sub-instance, but primitive value) - slotPath.push(slot); - bootLoaderGen.instanceConfig(slotPath, instance); - slotPath.pop(); - } - } - - // ... and add the instance to the bootloader (this is done after - // copying the slots to - // ensure that the bootloader generator has the information about - // contained parts & connectors - // TODO: really necessary? - if (tmImplementation instanceof Class) { - bootLoaderGen.addInstance(slotPath, instance, (Class) tmImplementation, node); - } - return tmInstance; - } - - public Class getBootloader() { - return bootLoaderGen.getUML(); - } - - protected BootLoaderGen bootLoaderGen; - - protected InstanceSpecification node; - - protected InstanceDeployer depInstance; - - protected LazyCopier copier; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DeployConstants.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DeployConstants.java deleted file mode 100644 index 0c087999818..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DeployConstants.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.core.deployment; - -public class DeployConstants { - - public static final String singletonPrefix = "singleton_"; //$NON-NLS-1$ - public static final String COMPONENT_MODEL = "ComponentModel"; //$NON-NLS-1$ - public static final String depPlanFolder = "deployment"; //$NON-NLS-1$ - public static final String depPlanFolderHw = "platform"; //$NON-NLS-1$ - public static final String DepPlanPostfix = "DepPlan"; //$NON-NLS-1$ - public static final String DepPlanPostfixHw = "Platform"; //$NON-NLS-1$ - public static final String MAIN_INSTANCE = "mainInstance"; //$NON-NLS-1$ - public static final String SEP_CHAR = "."; //$NON-NLS-1$ - public static final String AUTO_POSTFIX = "_auto"; //$NON-NLS-1$ -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/GatherConfigData.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/GatherConfigData.java deleted file mode 100644 index 62574661a24..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/GatherConfigData.java +++ /dev/null @@ -1,64 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.deployment; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.codegen.extensionpoints.AbstractSettings; -import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; -import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.uml2.uml.Class; - -/** - * Gather configuration data for a code generation project - * In particular, a class might be stereotyped to provide additional information - * about required compilation options (in case of C++ include paths, libraries, ...) - * - * @author ansgar - */ -public class GatherConfigData implements PreCopyListener { - - /** - * Gather configuration data for a code generation project - * Constructor. - * - * @param projectSupport - * A reference to a class providing the language support interface - */ - public GatherConfigData(ILangProjectSupport projectSupport) { - this.projectSupport = projectSupport; - settings = projectSupport.initialConfigurationData(); - } - - @Override - public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { - if (sourceEObj instanceof Class) { - projectSupport.gatherConfigData((Class) sourceEObj, settings); - } - return sourceEObj; - } - - /** - * Return the settings that have been gathered - * @return - */ - public AbstractSettings getSettings() { - return settings; - } - - protected ILangProjectSupport projectSupport; - - protected AbstractSettings settings; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/ImplementationChooser.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/ImplementationChooser.java deleted file mode 100644 index a80a4d4a5df..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/ImplementationChooser.java +++ /dev/null @@ -1,34 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.deployment; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.uml2.uml.Class; - -/** - * Choose a component implementation for a given component type - */ -public interface ImplementationChooser { - /** - * Choose a component implementation from a list of available implementations - * - * @param componentType - * a (abstract) component - * @param implList - * a list of available component implementations - * @return the chosen implementation. - */ - public Class chooseImplementation(Class componentType, EList implList); -}; diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/InstanceDeployer.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/InstanceDeployer.java deleted file mode 100644 index eaf07e3b0a7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/InstanceDeployer.java +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.deployment; - -import java.util.Stack; - -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Slot; - -/** - * Deploy an instance (on a certain node). This operation is specifically non recursive - * - * @author ansgar - * - */ -public interface InstanceDeployer { - - /** - * Initialize the deployment - * - * @param sat - * information about source and target model - * @param bootloader - * the bootloader generator, which will contain instance information - * @param node - * the node onto which the allocation should be done. - */ - public void init(LazyCopier sat, BootLoaderGen bootloader, InstanceSpecification node); - - /** - * Deploy an instance and copy the required classes into the target model. - * In case of a composite (assembly) class that is partially deployed on a target node - * (i.e. a subset of its parts is deployed on the target node, but not composite itself), - * this function may only partially copy the class or omit it completely. - * Parts and connections are not copied in the first place to take care of partially - * deployed composites and added when needed. - * Therefore, this function is also responsible for creating the part associated with the - * instance in the owning composite class and eventually complete connections within the - * composites. - * - * @param is - * an instance (UML instance specification) within the deployment plan - * @param slotPath - * a list (stack) of slots starting from the main instance - * @return the classifier modified for deployment - * @throws TransformationException - */ - public InstanceSpecification deployInstance(InstanceSpecification is, Stack slotPath) throws TransformationException; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/PartialCopy.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/PartialCopy.java deleted file mode 100644 index 6e8f10248fc..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/PartialCopy.java +++ /dev/null @@ -1,126 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.deployment; - -import java.util.Stack; - -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.ConnectorEnd; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; - -/** - * Copy a composite class while taking into account node allocation, i.e. only - * copy parts that are deployed on a certain node (properties that are not typed - * by a component are always copied). This function may be called several times - * and will successively add parts that are required. If the same composite - * (class level) is used in two different contexts, e.g. a socket connector - * serving as client and server on the same node (for the same interface), the - * resulting composite will be complete. On the instance level however, such as - * composite is sub-optimal, since their are two different instances that use a - * different subset. These cases are not very critical, since unused parts are - * not instantiated (overhead = pointer) - * - * The function will change assembly composites - * - * @author ansgar - * - */ -public class PartialCopy implements InstanceDeployer { - - @Override - public void init(LazyCopier copy, BootLoaderGen bootloader, - InstanceSpecification node) { - this.copy = copy; - this.node = node; // only needed for debug output - // add copy listeners --- - // 1. only add required parts - // does nothing for the moment - } - - @Override - public InstanceSpecification deployInstance(InstanceSpecification is, Stack slotPath) throws TransformationException { - Classifier classifier = DepUtils.getClassifier(is); - - // only make a partial copy of the system class (slotPath size 0) for the moment. - if (!(classifier instanceof Class) || slotPath.size() > 0) { - return copy.getCopy(is); - } - if (AllocUtils.getNodes(is).contains(node)) { - return copy.getCopy(is); - } - - Class smCl = (Class) classifier; - - // create parts in target model, if allocated. - for (Slot slot : is.getSlots()) { - copyPart(smCl, slot); - } - // since we copied some of its attributes, the copy class created a shallow copy of the class itself - InstanceSpecification tmIS = (InstanceSpecification) copy.get(is); - return tmIS; - } - - /** - * copy a part of a classifier, without being recursive [shouldn't that be in the generic deploy part?] - * This function is called, whenever a sub-instance is deployed - * Brainstorming: add containing composite to deployInstance? (in this case, deployInstance could create the - * part in the containing composite, if it does not exist yet) - * - * @param cl - * @param newCl - * @param slot - * @param allocAll - * @throws TransformationException - */ - protected void copyPart(Class smCl, Slot slot) throws TransformationException { - Property smPart = (Property) slot.getDefiningFeature(); - // Log.log(Status.INFO, Log.DEPLOYMENT, "smCl:" + smCl.getQualifiedName ()); - // Log.log(Status.INFO, Log.DEPLOYMENT, "tmCl:" + tmCl.getQualifiedName ()); - - // String partName = smPart.getName(); - InstanceSpecification instanceOrThread = DepUtils.getInstance(slot); - // instance may be null, if slot refers to a basic type, e.g. a string - if ((instanceOrThread == null) || AllocUtils.getNodes(instanceOrThread).contains(node)) { - copy.copy(slot); - - // add connectors when possible, i.e. connectors that target the newly added part - for (Connector smConnector : smCl.getOwnedConnectors()) { - // check whether the newly added property enables the addition of connectors - // that connect this port. - if (ConnectorUtil.connectsPart(smConnector, smPart)) { - ConnectorEnd otherEnd = ConnectorUtil.connEndNotPart(smConnector, smPart); - // check whether the part references by the other end (i.e. that not connected with the part) - // TODO: take connections without port into account - Property otherPart = otherEnd.getPartWithPort(); - // compare part names, since connector points to parts within the source model - if ((otherPart == null) || (copy.get(otherPart) != null)) { - copy.copy(smConnector); - } - } - } - } - } - - private InstanceSpecification node; - - private LazyCopier copy; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/BindingHelperExt.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/BindingHelperExt.java deleted file mode 100644 index b62aa607bfe..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/BindingHelperExt.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.extensions; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.FCM.BindingHelper; -import org.eclipse.papyrus.FCM.util.IBindingHelper; -import org.eclipse.papyrus.qompass.designer.core.listeners.PostCopyListener; -import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationRTException; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.TemplateBinding; - - -/** - * Support for binding helper - */ -public class BindingHelperExt { - - public static final String IBINDING_HELPER_ID = org.eclipse.papyrus.FCM.Activator.PLUGIN_ID + ".fcmBindingHelper"; //$NON-NLS-1$ - - /** - * - * @param iConfiguratorName - * @param component - * containing composite (container) - * @param instance - */ - public static EObject applyPreHelper(BindingHelper helper, LazyCopier copier, TemplateBinding binding, EObject sourceEObj) { - IBindingHelper ihelper = getBindingHelper(helper.getBase_Class().getName()); - if (sourceEObj instanceof Element) { - ihelper.handleElement(binding, (Element) sourceEObj); - } - if (ihelper instanceof PreCopyListener) { - return ((PreCopyListener) ihelper).preCopyEObject(copier, sourceEObj); - } - return sourceEObj; - } - - /** - * - * @param iConfiguratorName - * @param component - * containing composite (container) - * @param instance - */ - public static void applyPostHelper(BindingHelper helper, LazyCopier copier, TemplateBinding binding, EObject targetEObj) { - IBindingHelper ihelper = getBindingHelper(helper.getBase_Class().getName()); - if (targetEObj instanceof Element) { - ihelper.handleElement(binding, (Element) targetEObj); - } - if (ihelper instanceof PostCopyListener) { - ((PostCopyListener) ihelper).postCopyEObject(copier, targetEObj); - } - } - - public static IBindingHelper getBindingHelper(BindingHelper helper) { - if (helper != null) { - return getBindingHelper(helper.getBase_Class().getName()); - } - return null; - } - - public static IBindingHelper getBindingHelper(String helperName) { - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] configElements = reg.getConfigurationElementsFor(IBINDING_HELPER_ID); - for (IConfigurationElement configElement : configElements) { - try { - final String configHelperName = configElement.getAttribute("bindingHelperName"); //$NON-NLS-1$ - if (configHelperName.equals(helperName)) { - // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) - final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ - if (obj instanceof IBindingHelper) { - return (IBindingHelper) obj; - } - } - } catch (CoreException exception) { - exception.printStackTrace(); - } - } - throw new TransformationRTException( - String.format("Cannot find binding helper <%s>", helperName)); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/EmbeddingRule.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/EmbeddingRule.java deleted file mode 100644 index 7427a38a21f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/EmbeddingRule.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.extensions; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.papyrus.qompass.designer.core.Activator; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Port; - - -/** - * Support for embedding rules. - * CAVEAT: Currently not used, unclear if kept - */ -@Deprecated -public class EmbeddingRule { - - public static final String IEMBEDDING_RULE_ID = Activator.PLUGIN_ID + ".embeddingRule"; //$NON-NLS-1$ - - /** - * - * @param iConfiguratorName - * @param component - * containing composite (container) - * @param instance - */ - public static void embeddExtension(String embeddingRuleID, InstanceSpecification executorIS, InstanceSpecification instance, Port port) { - IEmbeddingRule iEmbeddingRule = getEmbeddingRule(embeddingRuleID); - if (iEmbeddingRule != null) { - iEmbeddingRule.embeddExtension(executorIS, instance, port); - } - } - - private static IEmbeddingRule getEmbeddingRule(String embeddingRuleID) { - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] configElements = reg.getConfigurationElementsFor(IEMBEDDING_RULE_ID); - for (IConfigurationElement configElement : configElements) { - try { - final String iConfiguratorIDext = configElement.getAttribute("configuratorID"); //$NON-NLS-1$ - if (iConfiguratorIDext.equals(embeddingRuleID)) { - // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) - final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ - if (obj instanceof IEmbeddingRule) { - return (IEmbeddingRule) obj; - } - } - } catch (CoreException exception) { - exception.printStackTrace(); - } - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/ExternalGenerator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/ExternalGenerator.java deleted file mode 100644 index 2094a2239f8..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/ExternalGenerator.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.extensions; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.qompass.designer.core.Activator; -import org.eclipse.uml2.uml.Classifier; - - -/** - * Support for multiple target languages via the Eclipse extension mechanism - */ -public class ExternalGenerator { - - public static final String IEXTERNAL_GENERATOR_ID = Activator.PLUGIN_ID + ".externalGenerator"; //$NON-NLS-1$ - - /** - * - * @param iConfiguratorName - * @param component - * containing composite (container) - * @param instance - */ - public static EList generate(String iGeneratorID, Classifier source) { - IExternalGenerator iExternalGenerator = getExternalGenerator(iGeneratorID); - if (iExternalGenerator != null) { - return iExternalGenerator.generate(source); - } - return null; - } - - private static IExternalGenerator getExternalGenerator(String iGeneratorID) { - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] configElements = reg.getConfigurationElementsFor(IEXTERNAL_GENERATOR_ID); - for (IConfigurationElement configElement : configElements) { - try { - final String iConfiguratorIDext = configElement.getAttribute("extGeneratorID"); //$NON-NLS-1$ - if (iConfiguratorIDext.equals(iGeneratorID)) { - // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) - final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ - if (obj instanceof IExternalGenerator) { - return (IExternalGenerator) obj; - } - } - } catch (CoreException exception) { - exception.printStackTrace(); - } - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IEmbeddingRule.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IEmbeddingRule.java deleted file mode 100644 index 72b573222ad..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IEmbeddingRule.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.extensions; - -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Port; - -/** - * Interface used by Qompass extensions that supports specific embedding rules. - * CAVEAT: Currently not used, unclear if kept - */ -@Deprecated -public interface IEmbeddingRule { - - // TODO: application order? - /** - * configure an instance (within a container) - * - * @param executorIS - * the instance specification of the component that is used as basis for configuring the instance - * @param instance - * the instance of an element of the container. - * @param port - * the port within a container transformation for which the instance is used as an interceptor. - * Is null for "normal" connectors or container extensions is configured. - */ - public void embeddExtension(InstanceSpecification executorIS, InstanceSpecification instance, Port port); -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IExternalGenerator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IExternalGenerator.java deleted file mode 100644 index df578fec3de..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IExternalGenerator.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.extensions; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.uml2.uml.Classifier; - -/** - * Interface used by Qompass extensions that supports specific external code generators, e.g. CORBA and DDS - */ -public interface IExternalGenerator { - - /** - * generate a class by means of an external generator - * - * @param source - * A source element for the generator, e.g. an interface for a CORBA generator - * @returns a list of generated classifiers: - * Even, if the external generator produces code directly, the Java wrapper should return a set - * model elements (may be incomplete) that represent the generated elements. For instance, in case - * of C++, an empty class with the stereotype "extern C" could be returned - */ - public EList generate(Classifier source); -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IInstanceConfigurator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IInstanceConfigurator.java deleted file mode 100644 index fd2231f525d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IInstanceConfigurator.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.extensions; - -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Property; - -/** - * Interface used by Qompass extensions that supports specific instance configurators, - * used for containers. - */ -public interface IInstanceConfigurator { - - /** - * configure an instance (within a container) - * - * @param instance - * the instance of an element which should be configured. - * @param componentPart - * the property that represents the component within the enclosing composite. May be null, if the instance - * that should be configured is the main instance. - * @param parentInstance - * the instance specification of the parent, i.e. the enclosing composite. If the instance that should be - * configured has a container, the parent instance corresponds to the instance specification of this - * container. This instance specification provides thus access to additional infromation available on the - * container level. - */ - public void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance); -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IOOTrafo.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IOOTrafo.java deleted file mode 100644 index df62ee1300a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IOOTrafo.java +++ /dev/null @@ -1,97 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ -package org.eclipse.papyrus.qompass.designer.core.extensions; - -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.uml2.uml.Class; - -/** - * An interface that must be implemented by classes that realize the transformation - * from component-based to object-oriented models. It includes the replacement of - * ports and connectors. Ports are - * replaced with attributes and access operations, connectors within a composite - * by an operation that creates the initial setup. - * - * 1. add an operation that allows to retrieve the reference to an interface provided - * by a port. This operation has a mapping specific name, e.g. get_ - * 2. add an operation that allows to connect a specific port. - * the connect_q operation (*including a - * storage attribute*) for a port with a required interface - * 3. add an implementation for the getcnx_q operation for a port - * with a required interface (the operation itself has been added before) - * - * Problems: need to align bootloader creation with this mapping, since - * the bootloader may be responsible for instantiation - * - * Caveat: Assure that the folder derivedInterfaces already exists in a model. - * Otherwise the call to getProvided/getRequired interface might trigger its - * creation resulting in the corruption of list iterators (ConcurrentAccess - * exception) - * - * New considerations: could the OO trafo be seen as a specific form of the - * LwContainerTrafo? - * [if yes, would that be useful?] Problem: it's not only a merge and operation - * interception, but additional operation(s) for ports. But, it might well - * be based on similar mechanisms as in merging in a template + Java code instead - * of Java code only. Also possible: still have OOTrafo, but there is a collaboration - * between the OO trafo and a LW container rule. - */ -public interface IOOTrafo { - - /** - * Initialize the transformation. Pass the copier and the bootloader to the - * transformation in case it is needed by an implementation of this interface. - * @param copier an instance of the lazy copier that copies from source (intermediate) model to the OO model. - * @param bootloader - */ - public void init(LazyCopier copier, Class bootloader); - - /** - * Transformations adds operations for accessing ports. A common but not necessary - * code generation pattern is to associate different operations with ports that - * provide services (access operations) and ports requiring services (connection operations) - * - * @param implementation - * A component implementation - */ - public void addPortOperations(Class implementation); - - - /** - * Add an operation that connects the parts within a composite class based on the - * UML connector information. - * - * @param compositeImplementation - * A (composite) component implementation - * @throws TransformationException - */ - public void addConnectionOperation(Class compositeImplementation) - throws TransformationException; - - /** - * Transform parts if necessary. This transformation is for target programming languages - * like C++ that support different ways of composition for attributes, i.e. references/pointers - * versus values. In case of the latter, the instantiation of a composite directly implies - * the instantiation of its sub-components. In case of the former, parts need to be instantiated - * by a different mechanism, e.g. by the constructor (which is still a valid correspondence for - * composition in UML at a logical level). - * Another possible use is the support of a more dynamic deployment: it is for instance possible - * to use a use a part-list (single attribute) instead of fixed named attributes. - * - * @param compositeImplementation - * A (composite) component implementation - */ - public void transformParts(Class compositeImplementation); -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IXtend.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IXtend.java deleted file mode 100644 index 1028f6f2ac6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IXtend.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.extensions; - -public interface IXtend { -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/InstanceConfigurator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/InstanceConfigurator.java deleted file mode 100644 index 709c8236cd2..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/InstanceConfigurator.java +++ /dev/null @@ -1,121 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.extensions; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.UseInstanceConfigurator; -import org.eclipse.papyrus.qompass.designer.core.Activator; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.util.UMLUtil; - - -/** - * Support for the configuration of instances via the Eclipse extension mechanism - */ -public class InstanceConfigurator { - - public static final String IINSTANCE_CONFIG_ID = Activator.PLUGIN_ID + ".instanceConfig"; //$NON-NLS-1$ - - public static boolean onNodeModel = false; - - /** - * Configure an instance. The configurator is selected by means of a stereotype on the classifier of - * the passed instance. - * - * @see org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator - * @param instance - * the specification of instance that should be configured - * @param componentPart - * the part representing the instance (before container expansion) - * @param port - * a port within the context of container - */ - public static void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) { - Classifier component = DepUtils.getClassifier(instance); - UseInstanceConfigurator useInstanceConfigurator = UMLUtil.getStereotypeApplication(component, UseInstanceConfigurator.class); - configureInstance(useInstanceConfigurator, instance, componentPart, parentInstance); - } - - /** - * Configure an instance. The configurator is selected by means of a stereotype on the passed container rule. - * - * @see org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator - * @param rule - * the applied container rule - * @param instance - * the specification of instance that should be configured - * @param componentPart - * the part representing the instance (before container expansion) - * @param port - * a port within the context of container - */ - public static void configureInstance(ContainerRule rule, InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) { - UseInstanceConfigurator useInstanceConfigurator = UMLUtil.getStereotypeApplication(rule.getBase_Class(), UseInstanceConfigurator.class); - configureInstance(useInstanceConfigurator, instance, componentPart, parentInstance); - } - - /** - * Configure an instance with a given configurator - * - * @param useInstanceConfigurator - * @param instance - * @param componentPart - * @param containerContext - */ - public static void configureInstance(UseInstanceConfigurator useInstanceConfigurator, InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) { - if (useInstanceConfigurator != null) { - org.eclipse.papyrus.FCM.InstanceConfigurator instanceConfigurator = useInstanceConfigurator.getConfigurator(); - if (instanceConfigurator.isOnNodeModel() == onNodeModel) { - if (instanceConfigurator != null) { - String id = instanceConfigurator.getBase_Class().getName(); - IInstanceConfigurator iConfigurator = getInstanceConfigurator(id); - if (iConfigurator != null) { - iConfigurator.configureInstance(instance, componentPart, parentInstance); - - } - } - } - } - } - - protected static IInstanceConfigurator getInstanceConfigurator(String iConfiguratorID) { - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] configElements = reg.getConfigurationElementsFor(IINSTANCE_CONFIG_ID); - for (IConfigurationElement configElement : configElements) { - try { - final String iConfiguratorIDext = configElement.getAttribute("configuratorID"); //$NON-NLS-1$ - if (iConfiguratorIDext == null) { - throw new RuntimeException(String.format( - Messages.InstanceConfigurator_InvalidPluginExtension, iConfiguratorID)); - } - if (iConfiguratorIDext.equals(iConfiguratorID)) { - // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) - final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ - if (obj instanceof IInstanceConfigurator) { - return (IInstanceConfigurator) obj; - } - } - } catch (CoreException exception) { - exception.printStackTrace(); - } - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/OOTrafo.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/OOTrafo.java deleted file mode 100644 index f96ccad4765..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/OOTrafo.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.extensions; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.papyrus.qompass.designer.core.Activator; -import org.eclipse.papyrus.qompass.designer.core.Messages; - -/** - * Support for different OO transformation via the Eclipse extension - * mechanism - */ -public class OOTrafo { - - public static final String IOO_TRANSFORMATION_ID = Activator.PLUGIN_ID + ".ooTransformation"; //$NON-NLS-1$ - - /** - * Get an OOTransformation for a given ID (language) - * - * @param iOOTrafoID - * the ID of an OO Transformation - * @return - */ - public static IOOTrafo getOOTrafo(String iOOTrafoID) { - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] configElements = reg.getConfigurationElementsFor(IOO_TRANSFORMATION_ID); - for (IConfigurationElement configElement : configElements) { - try { - final String iOOTrafoIDext = configElement.getAttribute("ooTrafoID"); //$NON-NLS-1$ - if (iOOTrafoIDext == null) { - throw new RuntimeException(String.format(Messages.InstanceConfigurator_InvalidPluginExtension, - iOOTrafoID)); - } - if (iOOTrafoIDext.endsWith("." + iOOTrafoID)) { //$NON-NLS-1$ - // TODO: cache returned instance (avoid creating a new - // instance each time => more efficient, no need for static - // attributes) - final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ - if (obj instanceof IOOTrafo) { - return (IOOTrafo) obj; - } - } - } catch (CoreException exception) { - exception.printStackTrace(); - } - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/XtendGenerator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/XtendGenerator.java deleted file mode 100644 index 9737559803b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/XtendGenerator.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.extensions; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.papyrus.qompass.designer.core.Activator; - - -/** - * Support for embedding rules. - * CAVEAT: Currently not used, unclear if kept - */ -public class XtendGenerator { - - public static final String ITEMPLATE_ID = Activator.PLUGIN_ID + ".xtendGenerator"; //$NON-NLS-1$ - - public static IXtend getXtendGenerator(String generatorID) { - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] configElements = reg.getConfigurationElementsFor(ITEMPLATE_ID); - for (IConfigurationElement configElement : configElements) { - try { - final String iTemplateID = configElement.getAttribute("templateID"); //$NON-NLS-1$ - if (iTemplateID.equals(generatorID)) { - // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) - final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ - if (obj instanceof IXtend) { - return (IXtend) obj; - } - } - } catch (CoreException exception) { - exception.printStackTrace(); - } - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerateCode.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerateCode.java deleted file mode 100644 index 1b948ff0cb6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerateCode.java +++ /dev/null @@ -1,195 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.core.generate; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -// deactivated differential code generation for the moment. -/* - import org.eclipse.emf.compare.diff.metamodel.AttributeChange; - import org.eclipse.emf.compare.diff.metamodel.DiffElement; - import org.eclipse.emf.compare.diff.metamodel.DiffModel; - import org.eclipse.emf.compare.diff.metamodel.DifferenceKind; - import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeLeftTarget; - import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeRightTarget; - import org.eclipse.emf.compare.diff.service.DiffService; - import org.eclipse.emf.compare.match.MatchOptions; - import org.eclipse.emf.compare.match.metamodel.MatchModel; - import org.eclipse.emf.compare.match.service.MatchService; - import org.eclipse.emf.compare.util.ModelUtils; - */ -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.ModelManagement; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; - -public class GenerateCode { - - public GenerateCode(IProject genProject, ILangCodegen codegen, ModelManagement genMM, IProgressMonitor monitor) { - this.genProject = genProject; - this.genMM = genMM; - this.monitor = monitor; - this.codegen = codegen; - } - - public void generate(InstanceSpecification node, String targetLanguage, boolean differential) - throws TransformationException, InterruptedException - { - String path = genMM.getPath(genProject, "model", null); //$NON-NLS-1$ - Package genModel = genMM.getModel(); - EObject oldGenModel = null; - if (differential) { - /* - * try { - * oldGenModel = ModelUtils.load(URI.createURI(path), ModelManagement.getResourceSet()); - * } catch (IOException io) { - * } - */ - } - genMM.saveModel(path); - - monitor.worked(1); - - if (genProject == null) { - return; - } - - if (oldGenModel != null) { - // Matching model elements - /* - * Map options = new HashMap(); - * options.put(MatchOptions.OPTION_IGNORE_XMI_ID, true); - * monitor.setTaskName("generating " + targetLanguage + " code for node " + node.getName()); - * monitor.subTask("create difference model for node " + node.getName()); - * monitor.worked(1); - * MatchModel match = MatchService.doMatch(genModel, oldGenModel, options); - * // Computing differences - * DiffModel diffModel = DiffService.doDiff(match, false); - * deleteRemovedClasses(diffModel); - * - * Map alreadyGenerated = new HashMap(); - * monitor.subTask("generate code"); - * - * for(DiffElement diff : diffModel.getDifferences()) { - * if((diff.getKind() == DifferenceKind.ADDITION) || - * (diff.getKind() == DifferenceKind.CHANGE)) { - * EObject modifiedEObj = null; - * if(diff instanceof AttributeChange) { - * modifiedEObj = ((AttributeChange)diff).getLeftElement(); - * } - * else if(diff instanceof ModelElementChangeLeftTarget) { - * modifiedEObj = ((ModelElementChangeLeftTarget)diff).getLeftElement(); - * } - * if(modifiedEObj instanceof Element) { - * PackageableElement modifiedPElement = getNearestClassifierOrPackage((Element)modifiedEObj); - * Element modifiedElement = modifiedPElement; - * // check whether code has already been generated for a parent - * boolean found = false; - * while(modifiedElement != null) { - * modifiedElement = modifiedElement.getOwner(); - * if(alreadyGenerated.containsKey(modifiedElement)) { - * found = true; - * } - * } - * // TODO: re-create code for elements that depend on this one (e.g. if the modified element is a - * // class and its name has changed, caller have to use a different name, even if the model reference - * // has not changed. - * if(!found) { - * alreadyGenerated.put(modifiedPElement, true); - * langSupport.generateCode(monitor, modifiedPElement); - * } - * } - * } - * } - */ - } - else { - if (node == null) { - monitor.setTaskName(String.format(Messages.GenerateCode_GeneratingCode, targetLanguage)); - } - else { - monitor.setTaskName(String.format(Messages.GenerateCode_GeneratingCodeForNode, targetLanguage, node.getName())); - } - IFolder folder = genProject.getFolder(genModel.getName()); - try { - folder.delete(true, null); - } catch (CoreException e) { - throw new TransformationException(String.format(Messages.GenerateCode_CouldNotDeleteOldCode, e.getMessage())); - } - codegen.generateCode(genProject, genModel, monitor); - } - if (monitor.isCanceled()) { - return; - } - monitor.worked(1); - } - - /** - * @param element - * @return - */ - public PackageableElement getNearestClassifierOrPackage(Element element) { - while (element != null) { - if (element instanceof Classifier) { - return (Classifier) element; - } - if (element instanceof Package) { - return (Package) element; - } - element = element.getOwner(); - } - return null; - } - - /* - * public void deleteRemovedClasses(EObject diffModelOrElement) throws TransformationException { - * EList diffs; - * if(diffModelOrElement instanceof DiffModel) { - * diffs = ((DiffModel)diffModelOrElement).getDifferences(); - * } - * else if(diffModelOrElement instanceof DiffElement) { - * diffs = ((DiffElement)diffModelOrElement).getSubDiffElements(); - * } - * else { - * return; - * } - * for(DiffElement diff : diffs) { - * EObject modifiedEObj = null; - * - * if(diff.getKind() == DifferenceKind.DELETION) { - * if(diff instanceof AttributeChange) { - * modifiedEObj = ((AttributeChange)diff).getRightElement();- - * } - * else if(diff instanceof ModelElementChangeRightTarget) { - * modifiedEObj = ((ModelElementChangeRightTarget)diff).getRightElement(); - * } - * } - * else if(diff.getKind() == DifferenceKind.CHANGE) { - * if(diff instanceof AttributeChange) { - * modifiedEObj = ((AttributeChange)diff).getRightElement(); - * } - * } - * if(modifiedEObj instanceof PackageableElement) { - * // => delete tree - * langSupport.cleanCode(monitor, (PackageableElement)modifiedEObj); - * } - * // no recursion needed? - * // deleteRemovedClasses(diff); - * } - * } - */ - - private ModelManagement genMM; - - private IProject genProject; - - private IProgressMonitor monitor; - - private ILangCodegen codegen; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerationOptions.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerationOptions.java deleted file mode 100644 index 48230b2b987..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerationOptions.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.core.generate; - -/** - * Constants for generation options (must be powers of 2) - * - * @author ansgar - * - */ -public interface GenerationOptions { - - final public static int REWRITE_SETTINGS = 1; - - final public static int ONLY_CHANGED = 2; - - final public static int MODEL_ONLY = 4; - - final public static int CAC_ONLY = 8; - -}; diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/DepPlanListener.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/DepPlanListener.java deleted file mode 100644 index f6773177432..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/DepPlanListener.java +++ /dev/null @@ -1,59 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.listeners; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * A model listener that updates a deployment plan, e.g. add, remove or - * rename instance specifications , if the composites referenced - * by a deployment plan change. Since the code is very incomplete, it is - * currently not used. It needs to be clarified what changes are useful, - * in particular whether delete operations in a composite should immediately - * remove the associate slot in instance specifications of the composite and the - * referenced instance specifications. - * - * @author ansgar - * - */ -public class DepPlanListener implements IPapyrusListener { - - @Override - public void notifyChanged(Notification notification) { - // TODO Auto-generated method stub - int evtType = notification.getEventType(); - Object notifier = notification.getNotifier(); - // String name = ""; - - if (evtType == Notification.SET) { - // Object oldValue = notification.getOldValue (); - if (notifier instanceof Package) { - DeploymentPlan de = UMLUtil.getStereotypeApplication((Package) notifier, DeploymentPlan.class); - Object mainInstance = (de != null) ? de.getMainInstance() : null; - if (mainInstance instanceof InstanceSpecification) { - // TODO user wants to declare the system component, the instance specification should be created - // automatically - - } - // if ((oldValue instanceof ) && (notifier instanceof Class)) { - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/InterfaceListener.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/InterfaceListener.java deleted file mode 100644 index a7d4f962536..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/InterfaceListener.java +++ /dev/null @@ -1,64 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.listeners; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.sync.CompImplSync; -import org.eclipse.uml2.uml.BehavioralFeature; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Interface; - -public class InterfaceListener implements IPapyrusListener { - - public static InterfaceListener getInstance() { - if (instance == null) { - instance = new InterfaceListener(); - } - return instance; - } - - private static InterfaceListener instance = null; - - @Override - public void notifyChanged(Notification notification) { - Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Interface adapter"); //$NON-NLS-1$ - int evtType = notification.getEventType(); - Object notifier = notification.getNotifier(); - if (evtType == Notification.SET) { - if (notifier instanceof Class) { - // UMLExecutor.addCCM_intf ((Class) notifier); - } - } else if (evtType == Notification.ADD) { - - if (notifier instanceof Interface) { - // Interface intf = (Interface) notifier; - - // never executed since name is always unset when - // an operation is newly added - } - } else if (evtType == Notification.REMOVE) { - Object oldValue = notification.getOldValue(); - if (oldValue instanceof BehavioralFeature) { - BehavioralFeature toBeRemoved = (BehavioralFeature) oldValue; - - Interface intf = (Interface) notifier; - CompImplSync.syncViaInterface(intf, toBeRemoved); - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ModelListener.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ModelListener.java deleted file mode 100644 index 786dcd051c9..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ModelListener.java +++ /dev/null @@ -1,56 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.listeners; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Port; - -/** - * Main listener for model changes (registered via plugin.xml). It will delegate - * to the sub-listeners for specific sub-elements (type, operation, port, ...) that - * can be found in this package - * - * @author ansgar - * - */ -public class ModelListener implements IPapyrusListener { - - @Override - public void notifyChanged(Notification notification) { - Log.log(IStatus.INFO, Log.TRAFO_SYNC, String.format("ModelListener.notifyChanged: %s", notification.getFeature())); - Object notifier = notification.getNotifier(); - if (notifier instanceof NamedElement) { - String name = ((NamedElement) notifier).getName(); - Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Change notification for element: " + name); - } - - if (notifier instanceof Operation) { - OperationListener.getInstance().notifyChanged(notification); - } else if (notifier instanceof Parameter) { - ParameterListener.getInstance().notifyChanged(notification); - } else if (notifier instanceof Interface) { - InterfaceListener.getInstance().notifyChanged(notification); - } else if (notifier instanceof Port) { - PortListener.getInstance().notifyChanged(notification); - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/OperationListener.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/OperationListener.java deleted file mode 100644 index 4444a92fa73..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/OperationListener.java +++ /dev/null @@ -1,71 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.listeners; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.sync.CompImplSync; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Operation; - -/** - * Track changes of an operation, typically within an interface provided - * by a port. This is used to update derived oeprations, e.g. when parameters - * are added or removed. - * - * @author ansgar - * - */ -public class OperationListener implements IPapyrusListener { - - // TODO: used by TypeAdapter (useful??) - public static OperationListener getInstance() { - if (instance == null) { - instance = new OperationListener(); - } - return instance; - } - - private static OperationListener instance = null; - - @Override - public void notifyChanged(Notification notification) { - int evtType = notification.getEventType(); - Object notifier = notification.getNotifier(); - String name = ""; //$NON-NLS-1$ - if (notifier instanceof NamedElement) { - name = ((NamedElement) notifier).getName(); - } - if ((evtType == Notification.SET) || (evtType == Notification.ADD)) { - Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Operation.adapter, set " + name); - - if (notifier instanceof Operation) { - Operation operation = (Operation) notifier; - - Element owner = operation.getOwner(); - if (owner instanceof Interface) { - Interface intf = (Interface) owner; - CompImplSync.syncViaInterface(intf); - } - } - } else { - Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Operation.adapter, code: " + notification.getEventType() + ", name: " + name); - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ParameterListener.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ParameterListener.java deleted file mode 100644 index c810970ed15..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ParameterListener.java +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.listeners; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.sync.CompImplSync; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; - -public class ParameterListener implements IPapyrusListener { - - public static ParameterListener getInstance() { - if (instance == null) { - instance = new ParameterListener(); - } - return instance; - } - - private static ParameterListener instance = null; - - @Override - public void notifyChanged(Notification notification) { - int evtType = notification.getEventType(); - Object notifier = notification.getNotifier(); - String name = ""; //$NON-NLS-1$ - if (notifier instanceof NamedElement) { - name = ((NamedElement) notifier).getName(); - } - if ((evtType == Notification.SET) || (evtType == Notification.ADD)) { - Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Parameter.adapter, set " + name); - - if (notifier instanceof Parameter) { - Element owner = ((Parameter) notifier).getOwner(); - if (owner instanceof Operation) { - owner = owner.getOwner(); - if (owner instanceof Interface) { - CompImplSync.syncViaInterface((Interface) owner); - } - } - } - } else { - Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Parameter.adapter, code: " + notification.getEventType() + ", name: " + name); - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PortListener.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PortListener.java deleted file mode 100644 index 09039013ee7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PortListener.java +++ /dev/null @@ -1,77 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.listeners; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.ecore.ENamedElement; -import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.sync.CompTypeSync; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Port; - -public class PortListener implements IPapyrusListener { - - public Notifier getTarget() { - // TODO Auto-generated method stub - return null; - } - - public static PortListener getInstance() { - if (instance == null) { - instance = new PortListener(); - } - return instance; - } - - private static PortListener instance; - - - public boolean isAdapterForType(Object type) { - // TODO Auto-generated method stub - return false; - } - - @Override - public void notifyChanged(Notification notification) { - int evtType = notification.getEventType(); - Object notifier = notification.getNotifier(); - - if (evtType == Notification.SET) { - Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Port adapter, set: " + ((NamedElement) notifier).getName()); - Object obj = notification.getFeature(); - if (notifier instanceof Port) { - Port port = (Port) notifier; - if (obj instanceof ENamedElement) { - ENamedElement ne = (ENamedElement) obj; - if (ne.getName().equals("name")) { - String oldName = notification.getOldStringValue(); - CompTypeSync.renamePort((Class) port.getOwner(), port, oldName); - // profile modifications are also be indicated as name changes, but might imply a change - // of provided and required interfaces. - CompTypeSync.syncPort((Class) port.getOwner(), port); - } else if (ne.getName().equals("type")) { - // CompTypeSync.syncPort((Class) port.getOwner(), port); - } - } - } - } else { - Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Port adapter, code: " + notification.getEventType() + ", " + notifier); - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PostCopyListener.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PostCopyListener.java deleted file mode 100644 index 967d4765bf0..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PostCopyListener.java +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.listeners; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; - -/** - * Interface for listeners that are notified when an eObject - * is copied - * - * @see org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier - */ -public interface PostCopyListener { - - /** - * Is called for each EObject after is has been copied. - * - * @param targetEObj - * the EObject that has been copied - */ - public void postCopyEObject(LazyCopier copy, EObject targetEObj); -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PreCopyListener.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PreCopyListener.java deleted file mode 100644 index d865c4a586e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PreCopyListener.java +++ /dev/null @@ -1,38 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.listeners; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; - -/** - * Interface for listeners that are notified when an eObject - * is copied - * - * @see org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier - */ -public interface PreCopyListener { - - /** - * Is called for each EObject that is copied. If it returns null, the - * indicated object should not be copied. If it returns a different object - * than the passed EObject, this object is used (the returned object of the - * first listener is used). - * - * @param sourceEObj - * the added classifier - */ - public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj); -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/GenerateMakefile.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/GenerateMakefile.java deleted file mode 100644 index e2c88564887..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/GenerateMakefile.java +++ /dev/null @@ -1,118 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Manel Fredj - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.make; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.ArrayList; - -import org.eclipse.papyrus.qompass.designer.core.Activator; - -/* - * TODO: - * - Currently not used (and unclear, if useful) - * - * - Determination of root folder - * - files within fileList have relative folder names? (if not assure) - * - supporting def file (not only for Accord) - * - integration with execution - */ - -/** - * Generate a makefile based on found source files, i.e. .cpp files - * - * @author manel - * - */ -@Deprecated -public class GenerateMakefile { - - /** - * Makefile Generation Algorithm: - * For each Node - * include $(ROOT_PATH)/Makefile.defs - * NAME = Util - * SRCS =\ - * File1.cpp\ - * File2.cpp\ - * ... - * FileN.cpp - * include $(ROOT_PATH)/Makefile.rules - */ - public static void generate() { - ArrayList fileList = new ArrayList(); - ArrayList folderList = new ArrayList(); - ArrayList nodeList = new ArrayList(); - ArrayList nodeSources = new ArrayList(); - - ShowFiles showFiles = new ShowFiles("/local/home/ansgar/workspace-v3.3/TestCppProject/AluSocketGen"); //$NON-NLS-1$ - - showFiles.getFilesRec(fileList, folderList); - nodeList = showFiles.findNodesDir(folderList); - for (String node : nodeList) { - nodeSources = showFiles.getNodeSources(fileList, node); - String nodePath = showFiles.getRootPath() + File.pathSeparator + node + File.pathSeparator + "Makefile"; //$NON-NLS-1$ - createFileList(nodePath, nodeSources, node); - } - } - - /** - * Create a list of .cpp files - * - * @param fileName - * @param cppFileList - * @param NodeName - */ - public static void createFileList(String fileName, ArrayList cppFileList, String NodeName) { - // create the makefile - try { - java.io.File makefile = new java.io.File(fileName); - - makefile.createNewFile(); - // not avail in Java 1.5? - // makefile.setWritable(true); - - FileOutputStream writer = new java.io.FileOutputStream(makefile); - - writer.write("include $(ACCORD_ROOT)/Makefile.defs\n\n".getBytes()); //$NON-NLS-1$ - writer.write(("NAME=" + NodeName + "\n\n").getBytes()); //$NON-NLS-1$ //$NON-NLS-2$ - - // Calculate list of sources - writer.write("SRCS=\\\n".getBytes()); //$NON-NLS-1$ - - if (cppFileList != null && cppFileList.size() != 0) { - - // Calculate list of .cpp files - for (int i = 0; i < cppFileList.size(); i++) { - writer.write(("\t" + cppFileList.get(i)).getBytes()); //$NON-NLS-1$ - if (i < cppFileList.size() - 1) { - // add \ to all but last item - writer.write("\\".getBytes()); //$NON-NLS-1$ - } - writer.write("\n".getBytes()); //$NON-NLS-1$ - } - } - writer.write("\n".getBytes()); //$NON-NLS-1$ - - writer.write("include $(ACCORD_ROOT)/Makefile.rules".getBytes()); //$NON-NLS-1$ - - writer.flush(); - writer.close(); - } catch (IOException e) { - Activator.log.error(e); - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/ShowFiles.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/ShowFiles.java deleted file mode 100644 index 2568c45a61d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/ShowFiles.java +++ /dev/null @@ -1,104 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.make; - -import java.io.File; -import java.util.ArrayList; - -@Deprecated -public class ShowFiles { - - /** - * Initialize the ShowFiles class - * - * @param rootPath - * the path of a folder, that in turn contains a set of folders. It is assume that the - * latter contain code related to a specific node - */ - public ShowFiles(String rootPath) { - m_rootPath = rootPath; - } - - private String m_rootPath; - - public String getRootPath() { - return m_rootPath; - } - - /** - * takes as input the list of all directories that are included under a root path (allDir), and - * the root path (in case different from ACCORD_ROOT), and potentially, a list of (non empty) files, - * which will be enriched with the set of source files (.cpp) under all directories under the root path - */ - public void getFilesRec(ArrayList allFiles, ArrayList allDir) { - getFilesRec(allFiles, allDir, m_rootPath); - } - - - public void getFilesRec(ArrayList fileList, ArrayList folderList, String root) { - File f = new File(root); - File[] listFiles = f.listFiles(); - for (File file : listFiles) { - if (file.isDirectory()) { - // call recursively with - getFilesRec(fileList, folderList, file.toString()); - folderList.add(file.toString()); - } else { - if (file.toString().endsWith(".cpp")) { //$NON-NLS-1$ - // found a C++ file - fileList.add(file.toString()); - } - } - } - } - - /** - * takes as input the list of all directories that are included under a root path (folderList), - * in order to provide as a result the subset of directories, corresponding to the nodes - */ - public ArrayList findNodesDir(ArrayList folderList) { - ArrayList allNodes = new ArrayList(); - for (String dir : folderList) { - String tmp = dir.replaceFirst(m_rootPath, ""); //$NON-NLS-1$ - // all the nodes are at the level (ACCORD_ROOT + 1) - tmp = tmp.trim().replaceFirst(File.pathSeparator, ""); //$NON-NLS-1$ - if (!tmp.contains(File.pathSeparator)) { - allNodes.add(tmp.trim()); - } - } - return allNodes; - } - - /** - * takes as input the list of all files that are included under ACCORD_ROOT path (allFiles), and - * the node name (nodeName) in order to provide as a result the subset of files, corresponding to the - * sources of the node (NodeName) - */ - public ArrayList getNodeSources(ArrayList allFiles, String nodeName) { - ArrayList sourceFilesPath = new ArrayList(); - - for (String filePath : allFiles) { - if (filePath.contains(nodeName)) { - // path is related to given node - int index = filePath.indexOf(nodeName); - String tmp = filePath.substring(index); - index = tmp.indexOf(File.pathSeparator); - tmp = tmp.substring(index + 1); - sourceFilesPath.add(tmp.trim()); - } - } - return sourceFilesPath; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/messages.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/messages.properties deleted file mode 100644 index 332fca3462d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/messages.properties +++ /dev/null @@ -1,91 +0,0 @@ -BootLoaderGen_AtLeastOneBlockingCall=There must be at most one blocking "run" operation per node. Not adding "run" call for component instance %s. Existing invocations: %s -BootLoaderGen_CannotApplyCppInclude=Cannot apply cppInclude stereotype. Make sure that C/C++ profile is applied to your model -BootLoaderGen_CannotRetrieveTemplate=Cannot retrieve bootLoader template (should be in %s) -CommandSupport_NoEditingDomain=Can not get editing domain -CommandSupport_ErrorDuringCmdExec=Error during command execution -ConfigUtils_RuleWithoutBaseClass=A container rule has no base class (broken model library?) -DepCreation_SingletonExistsAlready=singleton instantiation: element with name %s exists already in deployment plan, but is not an instance specification -DepCreation_CannotFindImplementation=cannot find suitable implementation for instance <%s> (given type <%s>) -DepCreation_CircularReference=Class %s is referenced in a circle\! Thus, an infinite number of instance specifications would be required.\nrecursion path: -DepCreation_DefiningFeatureNull=The defining feature of a slot of instance %s is null -DepCreation_FCMconnectorWithoutBaseClass=An FCM connector has no base class. Check for broken model library -DepCreation_InfoCreateDepPlan=DepCreation.createDepPlan: %s -DepCreation_TypeInAttributeUndefined=type of attribute %s within class %s is not defined -Deploy_0=Cannot find implementation for instance %s -Description_NoAvail=not available - -LWContainerTrafo_CannotApplyRule=Cannot apply container rule <%s>, since the type of one of its parts is undefined. Check for unresolved proxies in imports - -TemplateUtils_InfoCreateBoundPackage=create bound package (fixed binding): %s within %s -TemplateUtils_InfoGetActualFrom=TemplateInstantiation.getActualFromBinding: substitution formal = %s -TemplateUtils_NoTemplateSignature=no template signature found for %s - -ConnectorBinding_InfoConnPortConnectedVia=connector port <%s> is connected via <%s> -ConnectorBinding_CannotFindBinding=error: can not find a binding for formal parameter %s in the context of composite %s, connector %s and (connector) template %s. -ConnectorBinding_CannotFindBindingForPort=Cannot find a binding for port %s of connector %s. -ConnectorBinding_CannotFindConsistentBinding=cannot find a consistent binding for port %s of connector %s (in %s). Formal already bound to type %s -ConnectorBinding_ConnectorsPort=connects port, otherInterface = %s -ConnectorBinding_FormalAlreadyBound=Formal already bound to type %s -ConnectorBinding_InfoActualReturnIntfIs=actual return interface: %s -ConnectorBinding_InfoConnectsPort=connects port, otherInterface = %s -ConnectorBinding_InfoCreateBoundPackage=create bound package %s within %s -ConnectorBinding_InfoMatchOtherEnd=matchOtherEnd: port %s -ConnectorBinding_InfoProvidedPortTypeMatches=getActual: provided port type matches, port %s. -ConnectorBinding_NoTemplateSignature=ConnectorBinding: no template signature found for %s -ConnectorReification_CannotFindMatchingPort=Connector reification: cannot find a matching port on reified connector %s for port %s. This should not happen and indicates an internal tool chain error. -ConnectorReification_CouldNotBind=could not bind connector implementation template <%s> -ConnectorReification_CouldNotConnectPort=Error: could not connect connector port <%s>. -ConnectorReification_CouldNotConnectPortOfType=Error: could not connect connector port <%s> of type <%s>. -ConnectorReification_InfoAddConnectorPart=ConnectorReification, add part with connector implementation template <%s> and implementation <%s> -ConnectorReification_InfoPortTypes=ConnectorReification: otherPort type: <%s> - port <%s>. -ConnectorReification_RequiresUseOfPorts=Connector reification requires the use of ports (otherwise, the ports of the reified connector can not be assigned unambiguously -ConnectorReification_TemplateTypeNotClass=template type is not a class -GenerateCode_CouldNotDeleteOldCode=Could not delete old code: %s -GenerateCode_GeneratingCode=generating %s code -GenerateCode_GeneratingCodeForNode=generating %s code for node %s - -TemplateInstantiation_TemplateIsNull=Passed template element is null - -TemplateInstantiationListener_TrafoException=TransformationException: %s - -CompImplTrafos_CannotFindType=Can not find type %s. Thus, unable to create suitable connect operation in component to OO transformation. -CompImplTrafos_IntfNotImplemented=Interface <%s> provided by port <%s> of class <%s> is not implemented by the component itself nor does the port delegate to a part -CompTypeTrafos_CannotFindType=Can not find type <%s>. Thus, unable to create suitable connect operation in component to OO transformation - -ContainerTrafo_CannotApplyRule=Cannot apply container rule <%s>, since the type of one of its parts is undefined. Check for unresolved proxies in imports -ContainerTrafo_CannotFindDelegationConn=(during interceptor transformation for container): cannot find existing delegation connector -ContainerTrafo_InterceptionRuleButNoInterceptor=The part %s in rule %s has an interceptionRule, but is not typed with an interaction component -ContainerTrafo_RecursiveLWnotSupported=Recursive lightweight container rules currently not supported -InstanceConfigurator_InvalidPluginExtension=InstanceConfigurator: plugin extension for id %s is invalid -InstantiateDepPlan_AcceleoErrors=Acceleo errors occured -InstantiateDepPlan_AcceleoErrorsCheckLog=Acceleo errors occured during code generation. Please check the error log -InstantiateDepPlan_CannotGenModel=Cannot generate model -InstantiateDepPlan_CheckInputImportPkg=An imported package is null. Verify the imported packages -InstantiateDepPlan_CheckInputImportPkgNoRes=An imported package has no eResource. Verify imported packages -InstantiateDepPlan_CheckInputModelProfile3=Check input model: profile <%s> is not contained in a resource -InstantiateDepPlan_CheckInputModelProfileNoRes=Check input model: the applied profile with URI <%s> has no name and is not contained in a resource -InstantiateDepPlan_CheckInputModelProfileNoResNoName=Check input model: one of the applied profiles has no name and is not contained in a resource -InstantiateDepPlan_ConsultConsole=Consult error log or console for details -InstantiateDepPlan_DepPlanStereotypeNotInitialized=The stereotype attribute of configuration <%s> is not initialized. -InstantiateDepPlan_ErrorsDuringTransformation=An error occurred during transformation -InstantiateDepPlan_IllegalArgumentDuringCopy=An Illegal argument exception occured during the copy of profile applications. This may indicate that the original model contains an invalid profile application\n\n -InstantiateDepPlan_InfoApplyProfile=apply profile -InstantiateDepPlan_InfoDeployingForNode=deploying for node %s -InstantiateDepPlan_InfoExpandingConnectors=expanding connectors and containers -InstantiateDepPlan_InfoGeneratingModel=Generating deployment model ... -InstantiateDepPlan_InfoImportPackage=import package %s -InstantiateDepPlan_InfoNoneAllocated=None of the instances in the deployment plan is allocated to a node. Verify the node allocation. -InstantiateDepPlan_TransformationException=A transformation exception occurred -MainModelTrafo_ChangePartType=change type of part <%s> due to container trafo -MainModelTrafo_NoDefiningFeature=Error: no defining feature associated with <%s>. -MainModelTrafo_NoInstanceAssociated=Error: no instance is associated with slot for feature <%s>. - -CompImplSync_InfoSyncIntf=interface rel-ship %s -CompImplSync_InfoSyncViaImpl=Sync. type and implementation -CompImplSync_InfoSyncViaType=syncViaType => implementation %s - -DepPlanUtils_CannotFindAttribute=cannot find attribute %s in classifier %s -DepPlanUtils_ConfigOfPropertyFailed=configuration of property %s failed: type is not a string -UpdateUtils_CannotApplyFCMstereo=cannot apply FCM stereotype. Check whether profile is applied -XtendTemplateBinding_TemplateNotFound=template with reference <%s.%s> can not be found. Verify whether the reference is correctly spelled, the template has been registered and implements the interface (in oep.designer.core.extensions). -XtendTemplateBinding_TemplateResultIsNotAString=bind template: return result is not a string diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/preferences/QompassPreferenceConstants.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/preferences/QompassPreferenceConstants.java deleted file mode 100644 index 3b3f3c7d2a4..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/preferences/QompassPreferenceConstants.java +++ /dev/null @@ -1,33 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.qompass.designer.core.preferences; - -/** - * Constant definitions for plug-in preferences - */ -public class QompassPreferenceConstants { - - /** - * For attributes, the default "aggregation kind" value is "none". When this option is set - * it will be treated as composite - */ - public static final String P_TREAT_NONE_AS_COMPOSITE = "treatNoneAsComposite"; //$NON-NLS-1$ - - public static final String P_ALL_ATTRIBUTES_ARE_CONFIG_ATTRIBUTES = "allAttributesAreConfigAttributes"; //$NON-NLS-1$ - - public static final String P_SHOW_PROV_REQ_AS_PORT_ICONS = "showProvReqAsPortIcons"; //$NON-NLS-1$ - - public static final String P_CODE_GEN_PREFIX = "codeGenPrefix"; //$NON-NLS-1$ - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompImplSync.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompImplSync.java deleted file mode 100644 index 89659d326da..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompImplSync.java +++ /dev/null @@ -1,451 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.sync; - -import java.util.Iterator; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.qompass.designer.core.CommandSupport; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.OperationUtils; -import org.eclipse.papyrus.qompass.designer.core.PortInfo; -import org.eclipse.papyrus.qompass.designer.core.PortUtils; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants; -import org.eclipse.papyrus.qompass.designer.core.transformations.UpdateUtils; -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.BehavioralFeature; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.ConnectorEnd; -import org.eclipse.uml2.uml.DirectedRelationship; -import org.eclipse.uml2.uml.Generalization; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.InterfaceRealization; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Synchronize component implementation classes. - * An implementation depends on the component type in the following way: - * (1) It has to realize the interfaces that are provided by the components ports, unless - * the port is delegated - * (1b) For each realized interface, its operations need to be implemented (the tool should detect and report - * double entries which can be resolved via delegation) - * (2) It can use interface that are required by the component ports. These changes are reflected in the - * context object, but are currently not propagated on an implementation level. - * - * The first aspect may be triggered by - * (a) modification of the port (name, kind or type) - * (b) modification due to changes of the interface: rename the interface itself or add, remove or rename operations - * and add, remove or rename parameters. - * - * InterfaceRealizations are implemented by means of stereotyped generalizations. This has the advantage - * that the operation itself is inherited and does not have to be synchronized. - * - * @author ansgar - * - */ -public class CompImplSync { - - public static void syncViaInterface(Interface intf) { - syncViaInterface(intf, null); - } - - /** - * Delegate a synchronization operation to one or more implementations when an interface - * (which may have changed) is given. I.e. this operation is called when an operation - * of an implemented interface is added, removed or modified. - * - * @param an - * interface which may be implemented by a set of component implementations. - * @param port - */ - public static void syncViaInterface(Interface intf, BehavioralFeature toBeRemoved) { - // find all implementations of this interface - for (DirectedRelationship relationship : intf.getTargetDirectedRelationships(UMLPackage.eINSTANCE.getInterfaceRealization())) { - InterfaceRealization ir = (InterfaceRealization) relationship; - Classifier cl = ir.getImplementingClassifier(); - if (cl instanceof Class) { - Log.log(IStatus.INFO, Log.TRAFO_SYNC, String.format(Messages.CompImplSync_InfoSyncIntf, cl.getName())); - Class implementation = (Class) cl; - // syncRealizations (implementation); - CompImplSync.interfaceModifications(implementation, toBeRemoved); - } - } - } - - /** - * Delegate a synchronization operation to one or more implementations when a component - * type is given. - * The function will in particular handle realization operations due to provided - * ports and the behaviors associated with it (e.g. opaque-behaviors implementing the provided - * operations of a component) - * - * @param a - * component type or a realized interface - * @param port - */ - public static boolean syncViaType(Class compType, boolean addOnly) { - // find all implementations ... - boolean foundGeneralization = false; - for (DirectedRelationship relationship : compType.getTargetDirectedRelationships(UMLPackage.eINSTANCE.getGeneralization())) { - if (relationship instanceof Generalization) { - foundGeneralization = true; - Classifier cl = ((Generalization) relationship).getSpecific(); - if (cl instanceof Class) { - Log.log(IStatus.INFO, Log.TRAFO_SYNC, String.format(Messages.CompImplSync_InfoSyncViaType, cl.getName())); - Class implementation = (Class) cl; - updatePorts(implementation); - if (Utils.isCompImpl(cl)) { - // add realization relationship only for implementations - if (addOnly) { - addRealizations(implementation); - // syncContextOps (implementation, false); - } else { - syncRealizations(implementation); - // syncContextOps (implementation, true); - } - } - } - } - } - return foundGeneralization; - } - - /* - * public static void renamePortViaType (Class compType, Port port, String oldName) - * { - * // find all implementations ... - * for (DirectedRelationship relationship : - * compType.getTargetDirectedRelationships (UMLPackage.eINSTANCE.getGeneralization ())) - * { - * if (relationship instanceof Generalization) { - * Classifier cl = ((Generalization) relationship).getSpecific (); - * if (cl instanceof Class) { - * renamePort ((Class) cl, port, oldName); - * } - * } - * } - * } - */ - - /** - * Update the ports of a class, i.e. recalculate its derived interfaces - * - * @param component - * @param port - */ - public static void updatePorts(Class implementation) { - for (Port port : PortUtils.getAllPorts(implementation)) { - org.eclipse.papyrus.FCM.Port fcmPort = UMLUtil.getStereotypeApplication(port, org.eclipse.papyrus.FCM.Port.class); - // verify if in same eResource (= editable) - if ((fcmPort != null) && (port.eResource() == implementation.eResource())) { - fcmPort.update(); - } - } - } - - /** - * Add an interface realization relationship from an implementation (Class) towards an interface - * - * @param implementation - * A component implementation - * @param providedIntf - * The interface that is provided at one of its port - */ - protected static void addRealization(final Class implementation, final Interface providedIntf) { - if (!hasRealization(implementation, providedIntf)) { - InterfaceRealization ir = - implementation.createInterfaceRealization(calcRealizationName(providedIntf), providedIntf); - ir.getClients().add(implementation); - ir.getSuppliers().add(providedIntf); - } - } - - /** - * Calculate the name of an interface realization towards an interface that is - * provided at one of its ports - * - * @param providedIntf - * an interface provided by a component - * @return the calculated name - */ - protected static String calcRealizationName(Interface providedIntf) { - String name = providedIntf.getName(); - if (name == null) { - name = "undefined"; //$NON-NLS-1$ - } - return "derived realization of " + name; //$NON-NLS-1$ - } - - /** - * return existing interface-realization relationship - * - * @param implementation - * @param intf - * @return - */ - protected static InterfaceRealization getRealization(Class implementation, Interface intf) { - return implementation.getInterfaceRealization(null, intf); - } - - /** - * check, whether an interface-realization relationship already exists - * - * @param implementation - * @param intf - * @return - */ - protected static boolean hasRealization(Class implementation, Interface intf) { - return getRealization(implementation, intf) != null; - } - - /** - * Synchronize realization (generalization) relationship. - * - * @param implementation - * @param port - */ - public static void syncRealizations(Class implementation) { - EList providedIntfs = addRealizations(implementation); - removeRealizations(providedIntfs, implementation); - } - - /** - * add derived realization relationships of a component implementation - * due to provided interfaces of its ports - * - * TODO: depends on OOTrafo, duplicate functionality - * - * @param implementation a component implementation - */ - public static EList addRealizations(Class implementation) { - // create a list of all provided interfaces and check whether realization relationship - // exists. If not, create - EList providedIntfs = new BasicEList(); - for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { - Interface providedIntf = portInfo.getProvided(); - // check, if there is a getter already. In this case, we assume that we should not synchronize - // operations - String opName = PrefixConstants.getP_Prefix + portInfo.getName(); - if (implementation.getOwnedOperation(opName, null, null) != null) { - continue; - } - ConnectorEnd connEnd = ConnectorUtil.getDelegation(implementation, portInfo.getPort()); - // check that there is no delegation to a part which in turn has to implement the operations. - if ((providedIntf != null) && (connEnd == null)) { - if (providedIntfs.contains(providedIntf)) { - // emit warning that more than one provider for same interface - Log.log(IStatus.WARNING, Log.TRAFO_SYNC, "The interface " + providedIntf.getName() + //$NON-NLS-1$ - " is provided by more than one port of class <" + implementation.getQualifiedName() + //$NON-NLS-1$ - ">, inputs would therefore be undistinguishable"); //$NON-NLS-1$ - } - providedIntfs.add(providedIntf); - InterfaceRealization ir = getRealization(implementation, providedIntf); - if (ir == null) { - addRealization(implementation, providedIntf); - } else { - String name = calcRealizationName(providedIntf); - if (!name.equals(ir.getName())) { - ir.setName(name); - } - } - } - } - return providedIntfs; - } - - /** - * remove derived realization relationships of a component implementation - * due to provided interfaces of its ports, i.e. remove those for which the - * port no longer provides the interface. - * - * @param implementation - */ - private static void removeRealizations(EList providedIntfs, final Class implementation) { - // now loop through all interface realization relations and remove those that are not - // related to a provided port. - final EList toBeRemoved = new BasicEList(); - for (InterfaceRealization ir : implementation.getInterfaceRealizations()) { - String name = ir.getName(); - // automatically added interface realization is identified via its name (simpler - // compared to use of stereotype) - if ((name != null) && name.startsWith("derived")) { //$NON-NLS-1$ - Interface inheritedIntf = ir.getContract(); - if (!providedIntfs.contains(inheritedIntf)) { - toBeRemoved.add(ir); - } - } - } - if (toBeRemoved.size() > 0) { - // remove InterfaceRealization, since not part of provided interfaces - CommandSupport.exec(TransactionUtil.getEditingDomain(implementation), Messages.CompImplSync_InfoSyncViaImpl, new Runnable() { - - @Override - public void run() { - // implCopy = implementation; - for (InterfaceRealization ir : toBeRemoved) { - ir.destroy(); - } - } - }); - } - } - - /** - * The interface that types a port has been modified. Subsequently, the names of - * methods have to be adapted accordingly, methods have to be removed or added - * - * @param implementation - * @param port - * @param newName - */ - public static void interfaceModifications(Class implementation, BehavioralFeature toBeRemoved) { - syncDerivedOperations(implementation); - - EList ownedOperations = implementation.getOwnedOperations(); - // loop through all methods, adapt name according to specification name. - Iterator behaviors = implementation.getOwnedBehaviors().iterator(); - while (behaviors.hasNext()) { - Behavior behavior = behaviors.next(); - BehavioralFeature bf = behavior.getSpecification(); - if ((bf != null) && ownedOperations.contains(bf)) { - BehavioralFeature sourceBf = (BehavioralFeature) - UpdateUtils.getSource(bf); - - // if an operation is scheduled for deletion, it still exists at this - // point (This operation is called by an InterfaceListener which gets called - // before the deletion takes place) and the specification of associated behaviors - // still point to it. Therefore the check toBeRemoved is added. - if (sourceBf != toBeRemoved) { - String name = calcBehaviorName(sourceBf, implementation); - if (!name.equals(behavior.getName())) { - behavior.setName(name); - } - } - } - } - } - - public static void syncDerivedOperations(Class implementation) { - // check for unimplemented operations - // EList relShips = implementation.getSourceDirectedRelationships (UMLPackage.eINSTANCE.getInterfaceRealization ()); - EList realizedInterfaces = new BasicEList(); - // implementation.getInterfaceRealizations returns wrong value?? - - EList ownedOperations = implementation.getOwnedOperations(); - for (InterfaceRealization ir : implementation.getInterfaceRealizations()) { - /* - * for (DirectedRelationship relShip : relShips) - * if (relShip instanceof InterfaceRealization) { - * InterfaceRealization ir = (InterfaceRealization) relShip; - */ - Interface intf = ir.getContract(); - if (intf == null) { - // should not happen? - continue; - } - realizedInterfaces.add(intf); - - for (Operation operation : intf.getAllOperations()) { - Operation copiedOperation = (Operation) - UpdateUtils.getDerivedElement(ownedOperations, operation); - if (copiedOperation == null) { - // no owned operation derived from the interface operation found. - // Would indicate normally that there is no suitable owned operation. - // However: stereotype values may not be available during model load, check - // whether there is an identical operation, before copying one. - copiedOperation = OperationUtils.getSameOperation(operation, implementation); - if (copiedOperation == null) { - copiedOperation = implementation.createOwnedOperation(operation.getName(), null, null); - OperationUtils.syncOperation(operation, copiedOperation); - copiedOperation.setIsAbstract(false); - } - UpdateUtils.setSource(copiedOperation, operation); - } else if (!OperationUtils.isSameOperation(operation, copiedOperation)) { - OperationUtils.syncOperation(operation, copiedOperation); - copiedOperation.setIsAbstract(false); - } - } - } - for (Behavior method : implementation.getOwnedBehaviors()) { - SyncBehaviorParameters.syncParameters(method); - } - - // remove operations that are no longer provided via an interface of a port (and - // that are derived elements, i.e. have a source attribute) - Iterator ownedOpsIter = ownedOperations.iterator(); - while (ownedOpsIter.hasNext()) { - Operation ownedOp = ownedOpsIter.next(); - - DerivedElement de = UMLUtil.getStereotypeApplication(ownedOp, DerivedElement.class); - if (de != null) { - if (de.getSource() instanceof Operation) { - - Operation sourceOp = (Operation) de.getSource(); - // check, whether sourceOp is offered by one of the realized interfaces - boolean contains = false; - for (Interface realizedIntf : realizedInterfaces) { - if (realizedIntf.getAllOperations().contains(sourceOp)) { - contains = true; - } - } - if (!contains) { - // operation belongs to an interface which is not implemented => remove - ownedOpsIter.remove(); - ownedOp.destroy(); - } - } - else if (de.getSource() == null) { - // source element does not exist => remove - ownedOpsIter.remove(); - ownedOp.destroy(); - } - } - } - } - - - - /** - * Calculate the name of a behavior for a given operation - * TODO better handling of overloading (better representation of signature) - * - * @param operation - * @return - */ - private static String calcBehaviorName(BehavioralFeature bf, Classifier cl) { - /* - * Iterator operations = cl.getOperations ().iterator (); - * while (operations.hasNext ()) { - * Operation op = operations.next (); - * if ((op.getName () == bf.getName ()) && (op != bf)) { - * // at least one other operation with same name, return long name - * return bf.getName () + bf.getOwnedParameters ().toString (); - * } - * } - */ - return bf.getName(); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompTypeSync.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompTypeSync.java deleted file mode 100644 index 4bb5070b757..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompTypeSync.java +++ /dev/null @@ -1,55 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.sync; - -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Port; - -/** - * Create a UML like executor, i.e. - * for each port p with a provided interface I, add a get_p to the executor - * for each port q with a required interface I, add an attribute q to the executor. This - * attribute is manipulated by the container. - * - * @author ansgar - * - */ -public class CompTypeSync { - - /** - * Rename the operations/attributes associated with a port, if the ports - * name or type has changed. - * TODO: obsolete, since the port-operations aren't there yet. - * - * @param component - * @param port - */ - public static void renamePort(Class component, Port port, String oldName) { - // CompImplSync.renamePortViaType (component, port, oldName); - // CompImplSync.renamePort(component, port, oldName); - } - - - /** - * Synchronizes the operations/attributes associated with a port - * - * @param component - * @param port - */ - public static void syncPort(Class component, Port port) { - CompImplSync.syncViaType(component, false); - // CompImplSync.syncContextOps (component, true); - } -}; diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/DepPlanSync.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/DepPlanSync.java deleted file mode 100644 index 6dd0266179a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/DepPlanSync.java +++ /dev/null @@ -1,147 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.sync; - -import java.util.Iterator; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationRTException; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.InstanceValue; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.ValueSpecification; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Currently unused synchronization for deployment plans. - * - * @see comp.cea.ec3m.gentools.core.listeners.DepPlanListener - * - * @author ansgar - */ -public class DepPlanSync { - - /** - * Synchronize a deployment plan: remove slots that refer to properties that exist no longer - * and add those that do not exist yet - * - * @param element - * an arbitrary element of the source model (i.e. the model that will - * store the deployment plan - * @throws TransformationException - */ - public static void syncAllDepPlans(Element element) { - for (Package depPlan : DepPlanUtils.getAllDepPlans(element)) { - syncDepPlan(depPlan); - } - } - - /** - * Synchronize a deployment plan: remove slots that refer to properties that exist no longer - * and add those that do not exist yet - * - * @param depPlan - * @throws TransformationException - */ - public static void syncDepPlan(Package depPlan) { - removeUnusedSlots(depPlan); - // EList list = new BasicEList(); - DeploymentPlan cdp = UMLUtil.getStereotypeApplication(depPlan, DeploymentPlan.class); - if (cdp == null) { - return; - } - InstanceSpecification mainInstance = cdp.getMainInstance(); - addCDP(depPlan, mainInstance, mainInstance.getName()); - // now add elements that are not in the plan - although they should - // avoid to replicate code already in dep-creation. => createDepPlan(top) - // strategy: create new dep-plan and compare? - } - - private static void addCDP(Package depPlan, InstanceSpecification instance, String canonicalName) - { - Class implementation = DepUtils.getImplementation(instance); - if (!instance.getName().equals(canonicalName)) { - instance.setName(canonicalName); - } - // check sub-instances - for (Slot slot : instance.getSlots()) { - InstanceSpecification subInstance = DepUtils.getInstance(slot); - if (subInstance != null) { - addCDP(depPlan, subInstance, canonicalName + "." + slot.getDefiningFeature().getName()); //$NON-NLS-1$ - } - } - for (Property attribute : Utils.getParts(implementation)) { - Type type = attribute.getType(); - if (type instanceof Class) { - if (!hasSlot(instance, attribute)) { - try { - InstanceSpecification partIS = - DepCreation.createDepPlan(depPlan, (Class) type, instance.getName() + "." + attribute.getName(), true); //$NON-NLS-1$ - DepPlanUtils.createSlot(depPlan, instance, partIS, attribute); - } catch (TransformationException e) { - Log.log(IStatus.ERROR, Log.DEPLOYMENT, e.getMessage()); - throw new TransformationRTException(e.getMessage()); - } - } - } - } - } - - private static boolean hasSlot(InstanceSpecification instance, Property attribute) { - for (Slot slot : instance.getSlots()) { - if (slot.getDefiningFeature() == attribute) { - return true; - } - } - return false; - } - - public static void removeUnusedSlots(Package depPlan) { - // remove elements that are no longer in the plan - for (NamedElement member : depPlan.getMembers()) { - if (member instanceof InstanceSpecification) { - InstanceSpecification instance = (InstanceSpecification) member; - Iterator slotIt = instance.getSlots().iterator(); - while (slotIt.hasNext()) { - Slot slot = slotIt.next(); - if (slot.getDefiningFeature() == null) { - // property has been removed => remove associated slot - for (ValueSpecification value : slot.getValues()) { - if (value instanceof InstanceValue) { - InstanceSpecification is = ((InstanceValue) value).getInstance(); - DepPlanUtils.delDepPlan(is); - } - } - slot.destroy(); - slotIt.remove(); - } - } - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/InterfaceSync.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/InterfaceSync.java deleted file mode 100644 index 66e85da0cb6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/InterfaceSync.java +++ /dev/null @@ -1,141 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.sync; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.qompass.designer.core.OperationUtils; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Generalization; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Reception; -import org.eclipse.uml2.uml.Signal; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Synchronize the use of a common superclass for signal reception with the - * question whether an interface has at least one owned reception. - */ -public class InterfaceSync { - - public static final String SIG_PREFIX = "SIG_"; //$NON-NLS-1$ - - /** - * Name of an interface for generic reception support within the Qompass - * sysinterfaces modeling library - */ - private static final String SIGNAL_RECEPTION_QN = "sysinterfaces::SignalReception"; //$NON-NLS-1$ - - protected static boolean useGenericSigInterface = false; - - public static void syncSignalReceptionSupport(Interface intf) { - if (useGenericSigInterface) { - syncGenericSignalReceptionSupport(intf); - } else { - syncSpecificSignalReceptionSupport(intf); - } - } - - public static void syncSpecificSignalReceptionSupport(Interface intf) { - for (Reception reception : intf.getOwnedReceptions()) { - Signal signal = reception.getSignal(); - if (signal != null) { - String opName = SIG_PREFIX + signal.getName(); - Operation existingOperation = intf.getOwnedOperation(opName, null, null); - Operation newOperation = UMLFactory.eINSTANCE.createOperation(); - newOperation.setName(opName); - for (Property attribute : signal.getAttributes()) { - Parameter parameter = newOperation.createOwnedParameter(attribute.getName(), attribute.getType()); - parameter.setLower(attribute.getLower()); - parameter.setUpper(attribute.getUpper()); - } - if (existingOperation == null) { - intf.getOwnedOperations().add(newOperation); - } else if (!OperationUtils.isSameOperation(existingOperation, newOperation)) { - OperationUtils.syncOperation(newOperation, existingOperation); - } - DerivedElement de = StereotypeUtil.applyApp(newOperation, DerivedElement.class); - if (de != null) { - de.setSource(reception); - } - } - } - // now remove derived operations that are no longer needed. - EList ownedOperations = new BasicEList(); - ownedOperations.addAll(intf.getOwnedOperations()); - for (Operation operation : ownedOperations) { - DerivedElement de = UMLUtil.getStereotypeApplication(operation, DerivedElement.class); - if (de != null) { - if (de.getSource() instanceof Reception) { - Reception reception = (Reception) de.getSource(); - Signal signal = reception.getSignal(); - if ((signal == null) || !(SIG_PREFIX + signal.getName()).equals(operation.getName())) { - // reception exists, but has no signal or another signal - operation.destroy(); - } - } else { - // reception does not exist any more - operation.destroy(); - } - } - } - } - - public static void syncGenericSignalReceptionSupport(Interface intf) { - - NamedElement genericReceptionNE = Utils.getQualifiedElement(PackageUtil.getRootPackage(intf), SIGNAL_RECEPTION_QN); - if (genericReceptionNE instanceof Interface) { - Interface genericReceptionIntf = (Interface) genericReceptionNE; - if (intf.getOwnedReceptions().size() > 0) { - if (!hasReceptionSupport(intf, genericReceptionIntf)) { - addReceptionSupport(intf, genericReceptionIntf); - } - } else if (hasReceptionSupport(intf, genericReceptionIntf)) { - removeReceptionSupport(intf, genericReceptionIntf); - } - } - } - - public static boolean hasReceptionSupport(Interface intf, Interface genericReceptionIntf) { - // TODO: does it find an indirect reception? - for (Classifier general : intf.getGenerals()) { - if (general == genericReceptionIntf) { - return true; - } - } - return false; - } - - public static void addReceptionSupport(Interface intf, Interface genericReceptionIntf) { - intf.createGeneralization(genericReceptionIntf); - } - - public static void removeReceptionSupport(Interface intf, Interface genericReceptionIntf) { - for (Generalization generalization : intf.getGeneralizations()) { - if (generalization.getGeneral() == genericReceptionIntf) { - generalization.destroy(); - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/SyncBehaviorParameters.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/SyncBehaviorParameters.java deleted file mode 100644 index 8cc35234e1d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/SyncBehaviorParameters.java +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.sync; - -import org.eclipse.papyrus.qompass.designer.core.StUtils; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.BehavioralFeature; -import org.eclipse.uml2.uml.Parameter; - -/** - * Synchronize behavior parameters - * - * A behavior is often a method for a behavioral feature. In this case, UML validation checks that the number and type - * of parameters of the behavior and the behavioral feature match. - * This class synchronizes the parameters of the behavior with that of the behavioral feature. - */ -public class SyncBehaviorParameters { - public static final void syncParameters(Behavior method) { - - BehavioralFeature bf = method.getSpecification(); - if (bf != null) { - method.getOwnedParameters().clear(); - for (Parameter parameter : bf.getOwnedParameters()) { - Parameter newParameter = method.createOwnedParameter(parameter.getName(), parameter.getType()); - newParameter.setDirection(parameter.getDirection()); - LazyCopier.copyMultElemModifiers(parameter, newParameter); - StUtils.copyStereotypes(parameter, newParameter); - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/BindingUtils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/BindingUtils.java deleted file mode 100644 index 1a138465cb1..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/BindingUtils.java +++ /dev/null @@ -1,150 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - */ - -package org.eclipse.papyrus.qompass.designer.core.templates; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.papyrus.C_Cpp.ConstInit; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.PortUtils; -import org.eclipse.papyrus.qompass.designer.core.StUtils; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.OpaqueBehavior; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.util.UMLUtil; - -public class BindingUtils { - - /** - * Bind an operation by copying the signature from the actual. - * - * @param copy - * the copier - * @param actual - * the actual. If an operation, its signature is copied to the template - * @param operation - * The operation template - * @return - */ - public static Operation instantiateOperation(LazyCopier copy, Element actual, Operation operation) { - try { - Operation newOperation = copy.getCopy(operation); - if (actual instanceof Operation) { - for (Parameter parameter : ((Operation) actual).getOwnedParameters()) { - Parameter newParam = EcoreUtil.copy(parameter); // copy parameter via EcoreUtil - newParam.setType(copy.getCopy(parameter.getType())); - newOperation.getOwnedParameters().add(newParam); - StUtils.copyStereotypes(parameter, newParam); // copy stereotypes of the parameter - } - } - TransformationContext.classifier = newOperation.getClass_(); - if (actual instanceof Classifier) { - bindOperation(newOperation, (Classifier) actual); - } - String newName = TextTemplateBinding.bind(operation.getName(), actual, null); - newOperation.setName(newName); - - return newOperation; - } catch (TransformationException e) { - // throw runtime exception - throw new RuntimeException(String.format(Messages.TemplateInstantiationListener_TrafoException, e.getMessage())); - } - } - - /** - * Instantiate a behavior - * - * @param copy - * copier - * @param actual - * actual in template instantiation - * @param opaqueBehavior - * behavior with body in form of an Acceleo template. - * @return instantiated (bound) behavior. - * @throws TransformationException - */ - public static OpaqueBehavior instantiateBehavior(LazyCopier copy, Element actual, OpaqueBehavior opaqueBehavior) throws TransformationException { - OpaqueBehavior newBehavior = copy.getCopy(opaqueBehavior); - if (actual instanceof NamedElement) { - String newName = TextTemplateBinding.bind(opaqueBehavior.getName(), actual, null); - newBehavior.setName(newName); - } - EList bodyList = newBehavior.getBodies(); - for (int i = 0; i < bodyList.size(); i++) { - String body = bodyList.get(i); - TransformationContext.classifier = (Classifier) newBehavior.getOwner(); - // pass qualified operation name as template name. Used to identify script in case of an error - String newBody = TextTemplateBinding.bind(body, actual); - bodyList.set(i, newBody); - } - return newBehavior; - } - - - - /** - * Bind C++ const initializer - * - * @param operation - * @param actual - * @throws TransformationException - */ - public static void bindOperation(Operation operation, Classifier actual) throws TransformationException { - // perform binding in case of C++ initializer - ConstInit cppConstInit = UMLUtil.getStereotypeApplication(operation, ConstInit.class); - if (cppConstInit != null) { - // TODO: specific to C++ - String init = cppConstInit.getInitialisation(); - String newInit = TextTemplateBinding.bind(init, actual); - cppConstInit.setInitialisation(newInit); - } - } - - /** - * @param actual - * the actual template parameter - * @param boundClass - * the bound class - * @param provides - * true, if the provided interface should be returned - * @return the provided or required interface of a port (of the passed - * boundClass) that is typed with the the actual. - */ - public static Interface getInterfaceFromPortTypedWithActual(Type actual, Class boundClass, boolean provided) { - for (Port port : PortUtils.getAllPorts(boundClass)) { - Interface provOrReqIntf; - if (provided) { - provOrReqIntf = PortUtils.getProvided(port); - } else { - provOrReqIntf = PortUtils.getRequired(port); - } - - if ((port.getType() == actual) && (provOrReqIntf != null)) { - return provOrReqIntf; - } - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/ConnectorBinding.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/ConnectorBinding.java deleted file mode 100644 index dca6f447db3..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/ConnectorBinding.java +++ /dev/null @@ -1,455 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.templates; - -import java.util.Iterator; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.qompass.designer.core.CreationUtils; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.PortUtils; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.ConnectableElement; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.ConnectorEnd; -import org.eclipse.uml2.uml.Feature; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Namespace; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.ParameterableElement; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.TemplateParameter; -import org.eclipse.uml2.uml.TemplateParameterSubstitution; -import org.eclipse.uml2.uml.TemplateSignature; -import org.eclipse.uml2.uml.Type; - -/** - * Create an automatic template binding for a connector, i.e. a binding that assures - * that the ports of an interaction component match those of an application component - * (if possible) - */ -public class ConnectorBinding { - - /** - * Helper function for getActual - * - * @param port - * a port of the the connector template (not evaluated except for debugging output) - * @param connector - * the connector that is checked for reification - * @param composite - * a composite class - * @param actual - * the current candidate for an actual, i.e. result of previous attempts to bind (at different connector ends) - * @param isProvided - * is an interface provided or required. - * @return the type at the "other" (makes sense for property connector only) end of a connector - * @throws TransformationException - */ - private static Type matchOtherEnd(Port port, Feature connector, Type actual, boolean isProvided) - throws TransformationException { - if (connector instanceof Connector) { - return matchOtherEnd(port, (Connector) connector, actual, isProvided); - } - else if (connector instanceof Property) { - return matchOtherEnd(port, (Property) connector, actual, isProvided); - } - return null; - } - - private static Type matchOtherEnd(Port port, Connector connector, Type actual, boolean isProvided) - throws TransformationException { - // the template provides the formal parameter at one of its ports. Now examine - // with whom this port is connected, i.e. examine all connectorEnds - // The type of the connected port determines the binding. - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format("", port.getName())); //$NON-NLS-1$ - boolean found = false; - for (ConnectorEnd connEnd : connector.getEnds()) { - // the connector end targets a port of a part or the composite (in case of delegation) - ConnectableElement connElem = connEnd.getRole(); - if (connElem instanceof Port) { - Port otherPort = (Port) connElem; - Interface otherInterface; - - // distinction between assembly or delegation (other end is null) connectors - boolean isAssembly = (connEnd.getPartWithPort() != null); - - if (isProvided == isAssembly) { - // need required for other, if first port isProvided and assembly, or if first port isRequired and delegation - otherInterface = PortUtils.getRequired(otherPort); - } else { - otherInterface = PortUtils.getProvided(otherPort); - } - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format(Messages.ConnectorBinding_ConnectorsPort, otherInterface)); - if (otherInterface != null) { - if (actual == null || actual == otherInterface) { - actual = otherInterface; - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( - Messages.ConnectorBinding_InfoActualReturnIntfIs, actual.getQualifiedName())); - found = true; - } else if (actual != otherInterface) { - continue; - } - } - } - } - if (!found) { - throw new TransformationException(String.format( - Messages.ConnectorBinding_CannotFindConsistentBinding, - port.getName(), connector.getName(), connector.getNamespace().getName(), actual.getName())); - } - return actual; - } - - - private static Type matchOtherEnd(Port port, Property partConnector, Type actual, boolean isProvided) - throws TransformationException { - // the template provides the formal parameter at one of its ports. Now examine - // with whom this port is connected, i.e. examine all connectors of the - // composite. The type of the connected port determines the binding. - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( - Messages.ConnectorBinding_InfoMatchOtherEnd, port.getName())); - - for (Connector connector : partConnector.getClass_().getOwnedConnectors()) { - if (ConnectorUtil.connectsPart(connector, partConnector)) { - // the connector end targets a port of a part or the composite (in case of delegation) - ConnectorEnd connEnd = ConnectorUtil.connEndNotPart(connector, partConnector); - ConnectableElement connElem = connEnd.getRole(); - if (connElem instanceof Port) { - Port otherPort = (Port) connElem; - Interface otherInterface; - - // distinction between assembly or delegation (other end is null) connectors - boolean isAssembly = (connEnd.getPartWithPort() != null); - - if (isProvided == isAssembly) { - // need required for other, if first port isProvided and assembly, or if first port isRequired and delegation - otherInterface = PortUtils.getRequired(otherPort); - } else { - otherInterface = PortUtils.getProvided(otherPort); - } - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format(Messages.ConnectorBinding_InfoConnectsPort, otherInterface)); - if (otherInterface != null) { - if (actual == null) { - actual = otherInterface; - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( - Messages.ConnectorBinding_InfoActualReturnIntfIs, actual.getQualifiedName())); - } else if (actual != otherInterface) { - throw new TransformationException(String.format( - Messages.ConnectorBinding_CannotFindConsistentBinding, - port.getName(), connector.getName(), connector.getNamespace().getName(), actual.getName())); - } - } - } - } - } - return actual; - } - - - /** - * This function tries to bind a formal template parameter to an "actual". The criterion - * for a successful binding is that the (primitive) connections of the reified connector - * part have a matching port kind. - * The function makes a matching based on (1) either provided and required interfaces (2) - * or identical portKinds and different conjugations - * - * @param composite - * The composite in which a binding should be determined. - * @param part - * the part within the composite for which we try to find a binding, - * The information about the part is used to determine which connection - * end belongs to the template part and which to another part/port (which - * determines the binding). - * @param template - * A template class - * @param formal - * the formal template parameter - * @throws TransformationException - * if no consistent binding can be found - * @return the actual - */ - public static Type getActual(Feature partOrConnector, Class template, ParameterableElement formal) - throws TransformationException { - Type actual = null; - - // loop through all ports of the template, use getAllPorts to include inherited ports as well. - for (Port port : PortUtils.getAllPorts(template)) { - Interface providedIntf = PortUtils.getProvided(port); - - // need to check, if the port at the opposite connector is matching, provided that we use a specific - // value for the the formal. Typically, ports of the template are typed with the formal parameter. Thus, - // we would have to infer the formal from a given provided or required interface. This is not possible - // in general (no inverse mapping operation), but the simple case that either the provided or required - // interface is identical to the formal parameter are checked. - // - // 1. provided interface is formal - if (providedIntf == formal) { - actual = matchOtherEnd(port, partOrConnector, actual, true); - } - - // 2. required interface is formal - Interface requiredIntf = PortUtils.getRequired(port); - if (requiredIntf == formal) { - actual = matchOtherEnd(port, partOrConnector, actual, false); - } - - // 3. port type is formal (but none of the two cases above) - // this check is stronger than the first two, since it requires port kind identity. - // If none of the first two variants holds, the port is translating interfaces - // for which this stronger condition holds. - Type type = PortUtils.getFCMType(port); - if ((providedIntf != formal) && (requiredIntf != formal) && (type == formal)) { - // the template provides the formal parameter at one of its ports. Now examine - // with whom this port is connected, i.e. examine all ends of the - // connector. The type of the connected port determines the binding. - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( - Messages.ConnectorBinding_InfoProvidedPortTypeMatches, port.getName())); - boolean found = false; - - if (partOrConnector instanceof Property) { - Property partConnector = (Property) partOrConnector; - // iterate over the connectors of the composite containing the part - for (Connector connector : partConnector.getClass_().getOwnedConnectors()) { - if (ConnectorUtil.connectsPart(connector, partConnector)) { - // the connector end targets a port of a part or the composite (in case of delegation) - ConnectorEnd connEnd = ConnectorUtil.connEndNotPart(connector, partConnector); - actual = matchViaEnd(connEnd, port, partOrConnector, actual); - if (actual != null) { - found = true; - break; - } - } - } - } - else { - for (ConnectorEnd connEnd : ((Connector) partOrConnector).getEnds()) { - actual = matchViaEnd(connEnd, port, partOrConnector, actual); - if (actual != null) { - found = true; - break; - } - } - } - if (!found) { - String errorMsg = createErrorMsg(port, partOrConnector); - throw new TransformationException(errorMsg); - } - } - } - return actual; - } - - protected static String createErrorMsg(Port port, Feature partOrConnector) { - String errorMsg = String.format( - Messages.ConnectorBinding_CannotFindBindingForPort, - port.getName(), partOrConnector.getName()); - for (Classifier cl : partOrConnector.getFeaturingClassifiers()) { - errorMsg += " of class '" + cl.getName() + "'"; //$NON-NLS-1$ //$NON-NLS-2$ - } - errorMsg += ". "; //$NON-NLS-1$ - return errorMsg; - } - - private static Type matchViaEnd(ConnectorEnd connEnd, Port port, Feature partOrConnector, Type actual) throws - TransformationException { - String errorMsg = createErrorMsg(port, partOrConnector); - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, "port: " + port); //$NON-NLS-1$ - // Log.log(Status.INFO, Log.TEMPLATE_BINDING, "role1: " + connector.getEnds().get(0).getRole()); - // Log.log(Status.INFO, Log.TEMPLATE_BINDING, "role2: " + connector.getEnds().get(1).getRole()); - - ConnectableElement connElem = connEnd.getRole(); - if (connElem instanceof Port) { - Port otherPort = (Port) connElem; - - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( - Messages.ConnectorBinding_InfoConnPortConnectedVia, - port.getName(), partOrConnector.getName())); - Type otherType = PortUtils.getFCMType(otherPort); - - - // type must be the same, kind as well. But depending on delegation or not, one of the ports - // must be conjugated - // TODO: isAssembly check will wrongly return false, if no port is connected [well, in this case, the role is not a port but a part] - boolean isAssembly = (connEnd.getPartWithPort() != null); - boolean sameConjugation = (otherPort.isConjugated() == port.isConjugated()); - // if assembly connection, conjugations must be different. - if (isAssembly == sameConjugation) { - return actual; // was: continue - } - - // now compare kinds - if (!PortUtils.sameKinds(port, otherPort)) { - // no match, try next end - return actual; // was: continue - } - - if (otherType != null) { - if (actual == null) { - actual = otherType; - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( - Messages.ConnectorBinding_InfoActualReturnIntfIs, actual.getQualifiedName())); - } else if (actual != otherType) { - throw new TransformationException(errorMsg + " " + String.format( //$NON-NLS-1$ - Messages.ConnectorBinding_FormalAlreadyBound, actual.getName())); - } - } - } - return actual; - } - - /** - * The objective of this function is to find a suitable binding for a part - * typed with a template class (connector) based compatible port types. The binding - * is obtained by examining the connections between the composite and the contained - * part. - * - * @param composite - * the composite which owns the part - * @param containedPart - * the part which represents the connector - * @param template - * an element within a package template (might be deeply nested) which - * has ports that depend on a template parameter. This method tries to find a binding - * for the template parameters that renders the ports of this element compatible with - * the ports of the composition context. - * @return the bound package - * ? binding information, i.e. information about the bound package, whether already bound and the binding. - */ - public static TemplateBinding obtainBinding(Class composite, - Feature connector, Class template, boolean createBinding) throws TransformationException { - // obtain the signature of an element within a package template. - - TemplateSignature signature = TemplateUtils.getSignature(template); - if (signature == null) { - // not a template. This is not an exception, caller need to handle "null" a return - // value indicating that no template instantiation needs to be done. - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( - Messages.ConnectorBinding_NoTemplateSignature, template.getName())); - return null; - } - - // list of actuals (must be ParameterableElements, in our case always a named element as well. - EList actuals = new BasicEList(); - - Package pkgTemplate = (Package) signature.getOwner(); - String name = pkgTemplate.getName(); - - /* - * Signature extension - useful?? (since binding has to be made as well) - * Stereotype sigExtSt = signature.getAppliedStereotype ("FCM::SignatureExt"); - * SignatureExt sigExt = null; - * if (sigExtSt != null) { - * sigExt = (SignatureExt) signature.getStereotypeApplication (sigExtSt); - * } - * - * for (TemplateSignature sig : sigExt.getExtension ()) { - * bindFormal (); - * } - */ - - // loop on template parameters - boolean firstTP = true; - for (TemplateParameter parameter : signature.getParameters()) { - ParameterableElement formal = parameter.getParameteredElement(); - - // now obtain suitable binding for this parameter - look for ports that are typed with - // the formal template parameter - ParameterableElement actual = null; - if (firstTP) { - // only try to match the first template parameter based on ports. - actual = getActual(connector, template, formal); - firstTP = false; - } else { - // additional template parameters that are bound automatically based on their name - // (this might be considered as a hack, it is merely a convention for automatic template - // binding within the Qompass context. - if (formal instanceof NamedElement) { - NamedElement formalNE = (NamedElement) formal; - if ((formal instanceof Class) && (formalNE.getName().equals("T"))) { //$NON-NLS-1$ - actual = composite; - } - if ((formal instanceof Port) && (formalNE.getName().equals("P"))) { //$NON-NLS-1$ - // port (but not available?) - actual = TransformationContext.port; - } - } - } - if (actual instanceof NamedElement) { - actuals.add(actual); - name = name + "_" + ((NamedElement) actual).getName(); //$NON-NLS-1$ - } else { - String reason = String.format( - Messages.ConnectorBinding_CannotFindBinding, - ((NamedElement) formal).getName(), composite.getName(), connector.getName(), template.getName()); - throw new TransformationException(reason); - } - } - - // the bound package is instantiated in the same model, in which the - // composite can be found (avoid modifying an imported model). - - if (!createBinding) { - return null; - } - - Namespace owner = (Namespace) pkgTemplate.getOwner(); - owner = CreationUtils.getAndCreate(composite.getModel(), owner.allNamespaces()); - - Package boundPackage = (Package) owner.getMember(name); - if (boundPackage == null) { - // class does not exist yet, needs to be created. - boundPackage = ((Package) owner).createNestedPackage(name); - - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( - Messages.ConnectorBinding_InfoCreateBoundPackage, name, owner.getName())); - } - - TemplateBinding binding = boundPackage.getTemplateBinding(signature); - if (binding == null) { - // binding is not existing yet (should normally only happen, if the class has - // just been created - but it's better to re-check, even if the bound package - // was already there) - binding = boundPackage.createTemplateBinding(signature); - - Iterator actualsIter = actuals.iterator(); - - // loop on template parameters; - for (TemplateParameter parameter : signature.getParameters()) { - TemplateParameterSubstitution substitution = binding.createParameterSubstitution(); - substitution.setFormal(parameter); - - // now obtain suitable binding for this parameter - look for ports that are typed with - // the formal template parameter - ParameterableElement actual = actualsIter.next(); - // for UML <= 2.1 - // substitution.getActuals ().add ((ParameterableElement) actual); - // for UML > 2.2 - substitution.setActual(actual); - } - } - return binding; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PostTemplateInstantiationListener.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PostTemplateInstantiationListener.java deleted file mode 100644 index 7fbbc0387db..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PostTemplateInstantiationListener.java +++ /dev/null @@ -1,62 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.templates; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.FCM.BindingHelper; -import org.eclipse.papyrus.FCM.Template; -import org.eclipse.papyrus.qompass.designer.core.extensions.BindingHelperExt; -import org.eclipse.papyrus.qompass.designer.core.listeners.PostCopyListener; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Specific tweaking of template instantiation is implemented by means of a PostCopyListener that - * evaluates the template stereotype. - * Chiefly used for text templates - */ -public class PostTemplateInstantiationListener implements PostCopyListener { - - public static PostTemplateInstantiationListener getInstance() { - if (postTemplateInstantiationListener == null) { - postTemplateInstantiationListener = new PostTemplateInstantiationListener(); - } - return postTemplateInstantiationListener; - } - - public void init(LazyCopier copy, TemplateBinding binding) { - this.binding = binding; - } - - private TemplateBinding binding; - - private static PostTemplateInstantiationListener postTemplateInstantiationListener; - - @Override - public void postCopyEObject(LazyCopier copy, EObject targetEObj) { - if (targetEObj instanceof Element) { - - Template template = UMLUtil.getStereotypeApplication((Element) targetEObj, Template.class); - if ((template != null)) { - BindingHelper helper = template.getHelper(); - if (helper != null) { - BindingHelperExt.applyPostHelper(helper, copy, binding, targetEObj); - } - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PreTemplateInstantiationListener.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PreTemplateInstantiationListener.java deleted file mode 100644 index eed7c3ddbb6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PreTemplateInstantiationListener.java +++ /dev/null @@ -1,94 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.templates; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.FCM.BindingHelper; -import org.eclipse.papyrus.FCM.Template; -import org.eclipse.papyrus.qompass.designer.core.extensions.BindingHelperExt; -import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.uml2.uml.BehavioralFeature; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.OpaqueBehavior; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Template instantiation is implemented by means of an CopyListener that - * evaluates the template stereotype. - */ - -public class PreTemplateInstantiationListener implements PreCopyListener { - - public static PreTemplateInstantiationListener getInstance() { - if (preTemplateInstantiationListener == null) { - preTemplateInstantiationListener = new PreTemplateInstantiationListener(); - preTemplateInstantiationListener.treatTemplate = false; - } - return preTemplateInstantiationListener; - } - - public void init(LazyCopier copy, TemplateBinding binding) { - this.binding = binding; - preTemplateInstantiationListener.treatTemplate = false; - } - - private TemplateBinding binding; - - private boolean treatTemplate; - - private static PreTemplateInstantiationListener preTemplateInstantiationListener; - - @Override - public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { - if (treatTemplate) { - return sourceEObj; - } - treatTemplate = true; - EObject targetEObj = checkEObject(copy, sourceEObj); - treatTemplate = false; - return targetEObj; - } - - protected EObject checkEObject(LazyCopier copy, EObject sourceEObj) { - - // Specific treatment of OpaqueBehaviors: Template instantiations are typically managed - // by the associated operation which instantiates operation and behavior. In this case, the - // behavior should not be instantiated. - if (sourceEObj instanceof OpaqueBehavior) { - OpaqueBehavior behavior = (OpaqueBehavior) sourceEObj; - BehavioralFeature bf = behavior.getSpecification(); - if (bf != null) { - Template template = UMLUtil.getStereotypeApplication(bf, Template.class); - if (template != null) { - return null; - } - } - } - - if (sourceEObj instanceof Element) { - - Template template = UMLUtil.getStereotypeApplication((Element) sourceEObj, Template.class); - if ((template != null)) { - BindingHelper helper = template.getHelper(); - if (helper != null) { - return BindingHelperExt.applyPreHelper(helper, copy, binding, sourceEObj); - } - } - } - return sourceEObj; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateInstantiation.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateInstantiation.java deleted file mode 100644 index 2caa5bb8464..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateInstantiation.java +++ /dev/null @@ -1,284 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.templates; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.BindingHelper; -import org.eclipse.papyrus.FCM.Template; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FilterSignatures; -import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FilterTemplate; -import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FixTemplateSync; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Namespace; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.ParameterableElement; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.TemplateParameter; -import org.eclipse.uml2.uml.TemplateParameterSubstitution; -import org.eclipse.uml2.uml.TemplateSignature; -import org.eclipse.uml2.uml.TemplateableElement; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * This class encapsulates functions around template instantiation. - * - * With respect to composite structures, we need to consider two different - * cases: (1) the type of a property is a template class itself (2) the type of - * a property is a sub-class (nesting) of the template class. We consider that - * such a class inherits the template signature of its owner, i.e. it can access - * formal parameters of the owning template class. (3) the type of a property is - * a normal class - */ - -public class TemplateInstantiation { - - public TemplateInstantiation(LazyCopier copy, TemplateBinding binding) throws TransformationException { - this(copy, binding, null); - } - - /** - * - * @param copier_ - * copier - * @param binding - * UML template binding - * @param args - * currently unused - * @throws TransformationException - */ - public TemplateInstantiation(final LazyCopier copier_, final TemplateBinding binding, Object args[]) throws TransformationException { - if (binding == null) { - // user should never see this exception - throw new TransformationException("Passed binding is null"); //$NON-NLS-1$ - } - signature = binding.getSignature(); - if (signature == null) { - throw new TransformationException("Passed template binding does not have a signature"); //$NON-NLS-1$ - } - packageTemplate = (Package) signature.getOwner(); - /* - * copy = (Copy)copy_.clone(); - * // make copy of copy listeners (clone alone does not duplicate contained lists) - * copy.preCopyListeners = new BasicEList(); - * copy.preCopyListeners.addAll(copy_.preCopyListeners); - * copy.postCopyListeners = new BasicEList(); - * copy.postCopyListeners.addAll(copy_.postCopyListeners); - */ - copier = copier_; - - Package boundPackage = (Package) binding.getBoundElement(); - // set template instantiation parameter. Used by Acceleo templates to get relation between - // formal and actual parameters - TransformationContext.setTemplateInstantiation(this); - TransformationContext.copier = copier; - - copier.setPackageTemplate(packageTemplate, boundPackage); - // some parameters of the package template may not be owned. Thus, an additional package - // template is involved in the instantiation - for (TemplateParameter parameter : signature.getParameters()) { - // - if (parameter.getSignature() != signature) { - Package addedPkgTemplate = parameter.getSignature().getNearestPackage(); - copier.setPackageTemplate(addedPkgTemplate, boundPackage); - } - } - - if (boundPackage.getPackagedElements() != null) { - // bound package is not empty, but copy does not know about it. Fill copyMap with information about the relation - // This happens, if the original model already contains template instantiations, e.g. for template ports - if (copier.getMap(signature).keySet().size() == 0) { - syncCopyMap(packageTemplate, boundPackage); - } - } - - this.binding = binding; - - // register a combination of formal/actual in the hashmap - // => copy will replace actual with formal - for (TemplateParameterSubstitution substitution : binding.getParameterSubstitutions()) { - ParameterableElement formal = substitution.getFormal().getParameteredElement(); - ParameterableElement actual = substitution.getActual(); - copier.putPair(formal, actual); - } - - // add copy listeners --- - // remove template signature - if (!copier.preCopyListeners.contains(FilterSignatures.getInstance())) { - copier.preCopyListeners.add(FilterSignatures.getInstance()); - } - - // 2a. special treatment for elements stereotyped with template parameter - if (!copier.preCopyListeners.contains(PreTemplateInstantiationListener.getInstance())) { - copier.preCopyListeners.add(PreTemplateInstantiationListener.getInstance()); - } - PreTemplateInstantiationListener.getInstance().init(copier, binding); - // 2b. special treatment for elements stereotyped with template parameter - if (!copier.postCopyListeners.contains(PostTemplateInstantiationListener.getInstance())) { - copier.postCopyListeners.add(PostTemplateInstantiationListener.getInstance()); - } - PostTemplateInstantiationListener.getInstance().init(copier, binding); - - if (!copier.postCopyListeners.contains(FixTemplateSync.getInstance())) { - copier.postCopyListeners.add(FixTemplateSync.getInstance()); - } - } - - /** - * Synchronize the copy map, i.e. put the correspondences between existing source and target elements into the map. - * Otherwise, a new binding would produce duplicates. - * TODO: A more efficient way would be to cache the copy function and only re-sync, if a new model has been loaded. - * On the other hand, the bound package is normally not very large - * - * @param sourcePkg - * The package template (source) - * @param targetPkg - * The bound package (target) - */ - public void syncCopyMap(Package sourcePkg, Package targetPkg) { - copier.put(sourcePkg, targetPkg); - for (PackageableElement target : targetPkg.getPackagedElements()) { - if (target instanceof NamedElement) { - String targetName = ((NamedElement) target).getName(); - PackageableElement source = sourcePkg.getPackagedElement(targetName); - if ((source instanceof Package) && (target instanceof Package)) { - syncCopyMap((Package) source, (Package) target); - } - else { - copier.put(source, target); - } - } - } - - } - - Package packageTemplate; - - public TemplateBinding binding; - - public LazyCopier copier; - - TemplateSignature signature; - - /** - * Bind a named element. Besides of binding the passed element, this - * operation will bind all elements that are referenced (required) by the - * passed element. - * - * In consequence, typically only a small part of a package template is - * actually created within the bound package. We call this mechanism lazy - * instantiation/binding - * - * @param copier - * Source and target model - * @param namedElement - * A member within the package template which should be bound, - * i.e. for which template instantiation should be performed. - * @param binding - * The binding between the bound package and the package template - */ - @SuppressWarnings("unchecked") - public T bindElement(T namedElement) throws TransformationException { - if (namedElement == null) { - // user should never see this exception - throw new TransformationException(Messages.TemplateInstantiation_TemplateIsNull); - } - - Package boundPackage = (Package) binding.getBoundElement(); - EList path = TemplateUtils.relativePathWithMerge(namedElement, packageTemplate); - Template template = UMLUtil.getStereotypeApplication(namedElement, Template.class); - BindingHelper helper = (template != null) ? - template.getHelper() : null; - - /* - * if((templateKind == TemplateKind.ACCUMULATE) || (templateKind == TemplateKind.LATE_EVALUATION)) { - * // TODO: not very clean yet - * path = TemplateUtils.relativePathWithMerge(namedElement, copy.source); - * if(path == null) { - * // element is imported - * path = namedElement.allNamespaces(); - * } - * boundPackage = copy.target; // CreationUtils.getAndCreate - * // (sat.target, "accumulate"); - * } - */ - - if (path != null) { - // register owning package template (template can be defined in - // multiple packages) - Element owner = TemplateUtils.getTemplateOwner(namedElement, signature); - if (owner != null) { - // note that we might overwrite an existing value - copier.put(owner, boundPackage); - } - } - else { - // element is not part of the package template referenced by the - // binding - if (namedElement instanceof TemplateableElement) { - // check whether the referenced element is part of another - // package template, - // (for which we allow for implicit binding with the first - // template parameter) - TemplateSignature signatureOfNE = TemplateUtils.getSignature((TemplateableElement) namedElement); - if ((signatureOfNE != null) && (signature != signatureOfNE)) { - TemplateBinding subBinding = TemplateUtils.getSubBinding(copier.target, (TemplateableElement) namedElement, binding); - TemplateInstantiation ti = new TemplateInstantiation(copier, subBinding); - Element ret = ti.bindElement(namedElement); - return (T) ret; - } - } - - // => nothing to do with respect to template instantiation, but - // since the template is potentially instantiated in another model, - // the referenced element might need to be copied. - - return copier.getCopy(namedElement); - } - // element is contained in the template package, examine whether it - // already exists in the - // bound package. - - NamedElement existingMember = (NamedElement) copier.get(namedElement); - /* - * if((existingMember != null) && (templateKind != TemplateKind.ACCUMULATE)) { - * // element is already existing (and thus bound), nothing to do - * // additional check, whether the ACCUMULATE information is unset) - * // however: if the element is a package, existence is not sufficient - * // since it might have been created via getAndCreate above - * - * //if(namedElement instanceof Package) { - * // bindPackage((Package)namedElement); - * //} - * return (T)existingMember; - * } - */ - if (existingMember == null) { - FilterTemplate.getInstance().setActive(false); - T copiedElement = copier.getCopy(namedElement); - FilterTemplate.getInstance().setActive(true); - copier.setPackageTemplate(null, null); - return copiedElement; - } - - return (T) existingMember; - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateUtils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateUtils.java deleted file mode 100644 index 0b31ae7efaf..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateUtils.java +++ /dev/null @@ -1,395 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.templates; - -import java.util.Iterator; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.qompass.designer.core.CreationUtils; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.PortUtils; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.ConnectableElement; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.ConnectorEnd; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.EncapsulatedClassifier; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Namespace; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageMerge; -import org.eclipse.uml2.uml.ParameterableElement; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.StructuredClassifier; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.TemplateParameter; -import org.eclipse.uml2.uml.TemplateParameterSubstitution; -import org.eclipse.uml2.uml.TemplateSignature; -import org.eclipse.uml2.uml.TemplateableElement; -import org.eclipse.uml2.uml.Type; - -public class TemplateUtils { - - /** - * Get the template signature of a classifier. If the classifier does not - * have a signature, examine if the owning class provides one - * - * @param template - * The potential template - * @return the signature or null, if none can be found. - */ - public static TemplateSignature getSignature(TemplateableElement template) { - TemplateSignature signature = getSignatureDirect(template); - if (signature != null) { - return signature; - } - - // no signature found, try signature of owning classifier (nested class) - // or package - Element owner = template.getOwner(); - if (owner instanceof TemplateableElement) { - // owned by a classifier, not a package - return getSignature((TemplateableElement) owner); - } else { - return null; - } - } - - public static Element getTemplateOwner(Element ne, TemplateSignature signature) { - if ((ne instanceof TemplateableElement) && getSignatureDirect((TemplateableElement) ne) == signature) { - return ne; - } - Element owner = ne.getOwner(); - if (owner != null) { - return getTemplateOwner(owner, signature); - } - return null; - } - - /** - * Get the template signature of a templateable element (typically a package). The class must - * (1) either own the signature - * (2) or merge with a package which owns the signature. - * Qompass enables the "extension" of existing packages via the package merge mechanism - * - * @param template - * The potential template - * @return the signature or null, if none can be found. - */ - - public static TemplateSignature getSignatureDirect(TemplateableElement template) { - for (Element element : template.getOwnedElements()) { - if (element instanceof TemplateSignature) { - return (TemplateSignature) element; - } - } - - // enable multiple package templates sharing the same signature. - if (template instanceof Package) { - Package pkg = (Package) template; - for (PackageMerge pkgImport : pkg.getPackageMerges()) { - Package importedPkg = pkgImport.getMergedPackage(); - return getSignature(importedPkg); - } - } - return null; - } - - /** - * Create a template binding by using a single, fixed actual (used within - * Qompass for the binding of container extensions depending on the component - * executor) - * - * @param model - * : target model in which to create the bound package - * @param template - * @param fixedActual - * @return - * @throws TransformationException - */ - public static TemplateBinding fixedBinding(Package model, TemplateableElement template, Classifier fixedActual) - throws TransformationException { - // obtain the signature of an element within a package template. - - TemplateSignature signature = getSignature(template); - if (signature == null) { - // not a template, retain original name - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( - Messages.TemplateUtils_NoTemplateSignature, (template instanceof NamedElement ? - ((NamedElement) template).getName() : "undef"))); //$NON-NLS-1$ - return null; - } - - EList actuals = new BasicEList(); - - Package pkgTemplate = (Package) signature.getOwner(); - String name = pkgTemplate.getName(); - - // loop on template parameters; - // for (TemplateParameter parameter : signature.getOwnedParameters ()) { - // ParameterableElement formal = parameter.getParameteredElement(); - - // now obtain suitable binding for this parameter - look for ports that - // are typed with the formal template parameter - - actuals.add(fixedActual); - name = name + "_" + fixedActual.getName(); //$NON-NLS-1$ - // } - - // the bound package is instantiated in the same model, in which the - // composite can be found (avoid modifying an imported model). - // todo: root model as an additional parameter? - Namespace owner = (Namespace) pkgTemplate.getOwner(); - owner = CreationUtils.getAndCreate(model, owner.allNamespaces()); - - Package boundPackage = (Package) owner.getMember(name); - if (boundPackage == null) { - // class does not exist yet, needs to be created. - boundPackage = ((Package) owner).createNestedPackage(name); - - Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( - Messages.TemplateUtils_InfoCreateBoundPackage, name, owner.getName())); - } - - TemplateBinding binding = boundPackage.getTemplateBinding(signature); - if (binding == null) { - // binding is not existing yet (should normally only happen, if the class has - // just been created - but it's better to re-check, even if the bound package - // was already there) - binding = boundPackage.createTemplateBinding(signature); - - Iterator actualsIter = actuals.iterator(); - - // loop on template parameters; - for (TemplateParameter parameter : signature.getOwnedParameters()) { - - TemplateParameterSubstitution substitution = - binding.createParameterSubstitution(); - substitution.setFormal(parameter); - - // now obtain suitable binding for this parameter - look for - // ports that are typed with - // the formal template parameter - Type actual = actualsIter.next(); - substitution.setActual(actual); - } - } - return binding; - } - - /** - * create a "sub" binding in which the first parameter of type Cl is assumed - * to bind the sub-signature TODO: compared type and name of parameters in - * two signatures TODO: support more than one template parameter - * - * @param model - * @param te - * @param existingBinding - * @return - * @throws TransformationException - */ - public static TemplateBinding getSubBinding(Package model, - TemplateableElement te, TemplateBinding existingBinding) - throws TransformationException { - - for (TemplateParameterSubstitution tps : existingBinding.getParameterSubstitutions()) { - ParameterableElement pe = tps.getActual(); - if (pe instanceof Classifier) { - return fixedBinding(model, te, (Classifier) pe); - } - } - return null; - } - - /** - * Adapt the actuals within the binding (which correspond either to an - * element of the source model or an imported element) to the target model. - * - * @param sat - * @param binding - */ - public static void adaptActualsToTargetModel(LazyCopier copy, TemplateBinding binding) { - for (TemplateParameterSubstitution substitution : binding.getParameterSubstitutions()) { - substitution.setActual(copy.getCopy(substitution.getActual())); - } - } - - /** - * Return the actual for a potential formal parameter within a - * templateBinding (move to TemplateUtils?) - * - * @param binding - * a template binding - * @param formal - * a potential formal parameter, i.e. a parameter for which we - * check, if it really corresponds to a formal parameter within - * the template binding. - * @return the actual parameter that is associated with the potential formal - * parameter, or null if the 2nd parameter does not correspond to a - * formal parameter of the binding. - */ - public static Classifier getActualFromBinding(TemplateBinding binding, Type formal) { - for (TemplateParameterSubstitution substitution : binding.getParameterSubstitutions()) { - ParameterableElement pe = substitution.getFormal().getParameteredElement(); - if (pe == formal) { - Log.log(IStatus.INFO, Log.TEMPLATE_INSTANTIATION, String.format( - Messages.TemplateUtils_InfoGetActualFrom, pe)); - return (Classifier) substitution.getActual(); - } - } - return null; - } - - public static Classifier getActualFromBinding(TemplateBinding binding, String formalName) { - for (TemplateParameterSubstitution substitution : binding.getParameterSubstitutions()) { - ParameterableElement pe = substitution.getFormal().getParameteredElement(); - Log.log(IStatus.INFO, Log.TEMPLATE_INSTANTIATION, String.format( - Messages.TemplateUtils_InfoGetActualFrom, pe)); - if ((pe instanceof NamedElement) - && ((NamedElement) pe).getName().equals(formalName)) { - return (Classifier) substitution.getActual(); - } - } - return null; - } - - /** - * Get the first actual from the binding. - * - * @param binding - * the template binding - * @return the first actual. - */ - public static Classifier getFirstActualFromBinding(TemplateBinding binding) { - for (TemplateParameterSubstitution substitution : binding.getParameterSubstitutions()) { - ParameterableElement pe = substitution.getFormal().getParameteredElement(); - Log.log(IStatus.INFO, Log.TEMPLATE_INSTANTIATION, String.format( - Messages.TemplateUtils_InfoGetActualFrom, pe)); - return (Classifier) substitution.getActual(); - } - return null; - } - - /** - * Return a sequence of namespaces for a given element, starting from the "bottom" - * one, i.e. the one in which the element is contained. It will end before the - * searchNS namespace is reached. Returns null, if the element is not contained - * within the search namespace. - * This function will put a merged package into the path (instead of the owner), enabling - * the extension of existing packages. - * - * @param element - * @param searchNS - * @return - */ - public static EList relativePathWithMerge(Element element, Namespace searchNS) { - EList pathList = new BasicEList(); - Element owner = element.getOwner(); - if (!(owner instanceof Namespace)) { - // happens, if element is contained in a template signature - return null; - } - Namespace ns = (Namespace) owner; - while (ns != null) { - if (ns == searchNS) { - return pathList; - } - pathList.add(ns); - - if (ns instanceof Package) { - Package pkg = (Package) ns; - Iterator pkgMerges = pkg.getPackageMerges().iterator(); - // if package merge exists, get first merged package and add it to path - if (pkgMerges.hasNext()) { - PackageMerge pkgImport = pkgMerges.next(); - ns = pkgImport.getMergedPackage(); - continue; - } - } - - ns = (Namespace) ns.getOwner(); - } - return null; - } - - /** - * Re-target connectors after a part has changed its type from template to an instantiation - * of this template. In this case, the roles of the connector ends still reference the port - * of the template instead of the bound template binding. - * The new roles are assigned based on an equal name, assuming that template instantiation - * does not change the name of the ports. - * - * @param composite - * a composite containing connectors - * @param part - * a part within the composite whose type has changed. - */ - public static void retargetConnectors(StructuredClassifier composite, Property part) { - Type partType = part.getType(); - if (partType instanceof EncapsulatedClassifier) { - EncapsulatedClassifier partTypeEC = (EncapsulatedClassifier) partType; - for (Connector connector : composite.getOwnedConnectors()) { - if (ConnectorUtil.connectsPart(connector, part)) { - // the connector end targets a port of a part or the composite (in case of delegation) - ConnectorEnd connEnd = ConnectorUtil.connEndForPart(connector, part); - // redirect role, if pointing to port - if (connEnd.getRole() instanceof Port) { - Port connectedTemplatePort = (Port) connEnd.getRole(); - Port connectedBoundPort = (Port) Utils.getNamedElementFromList( - PortUtils.getAllPorts(partTypeEC), connectedTemplatePort.getName()); - connEnd.setRole(connectedBoundPort); - } - } - } - } - } - - /** - * Re-target connectors after an unknown number of parts have changed their type from template - * to an instantiation of this template. In this case, the roles of the connector ends still - * reference the port of the template instead of the bound template binding. - * The new roles are assigned based on an equal name, assuming that template instantiation - * does not change the name of the ports. - * - * @param composite - * a composite containing connectors - */ - public static void retargetConnectors(StructuredClassifier composite) { - for (Connector connector : composite.getOwnedConnectors()) { - // the connector end targets a port of a part or the composite (in case of delegation) - for (ConnectorEnd connEnd : connector.getEnds()) { - Property part = connEnd.getPartWithPort(); - if ((part != null) && (part.getType() instanceof EncapsulatedClassifier)) { - EncapsulatedClassifier partTypeEC = (EncapsulatedClassifier) part.getType(); - ConnectableElement role = connEnd.getRole(); - EList ports = PortUtils.getAllPorts(partTypeEC); - if ((role instanceof Port) && !ports.contains(role)) { - // role is not in list of ports - Port connectedBoundPort = (Port) Utils.getNamedElementFromList(ports, role.getName()); - connEnd.setRole(connectedBoundPort); - } - } - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TextTemplateBinding.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TextTemplateBinding.java deleted file mode 100644 index aa89bc58c8e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TextTemplateBinding.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright CEA-LIST 2009 - * available under EPL 1.0 licence - * - * This file is part of the Qompass tool chain (www.ec3m.net) - * - * http://www.eclipse.org/legal/epl-v10.html - * - * $Id$ - */ - -package org.eclipse.papyrus.qompass.designer.core.templates; - -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; - -/** - * Wrap different ways to bind a template. This may be either a reference to an - * Xtend template or a specific name template. - */ -public class TextTemplateBinding { - - /** - * Simple template expression that is replaced with the name of a named - * element. Uses an Acceleo syntax - * The objective is that the access to an element name is very common and does - * not need an xtend script behind. - */ - private static final String NAME_IN_BRACKETS = "[name/]"; //$NON-NLS-1$ - - /** - * Simple template expression that is replaced with the name of a named - * element. Slight variation of the Acceleo syntax - */ - private static final String NAME_IN_BRACKETS_SIMPLE = "[name]"; //$NON-NLS-1$ - - /** - * Execute a script passed as parameter. It will be executed in the context - * of a base script that declares the meta-model (UML2) and has additional - * imports (currently none). - * - * @param template - * The template in string form - * @param element - * The UML element to which the template is applied - * @return the evaluated template - */ - public static String bind(String templateStr, Element element) throws TransformationException { - return bind(templateStr, element, null); - } - - /** - * Execute a script passed as parameter. It will be executed in the context - * of a base script that declares the meta-model (UML2). It allows for - * additional arguments - * - * @param template - * The template in string form - * @param element - * The UML element to which the template is applied - * @return the evaluated template - */ - public static String bind(String templateStr, Element element, Object args[]) throws TransformationException { - if (templateStr.startsWith(XtendTemplateBinding.XTEND_MAGIC)) { - return XtendTemplateBinding.bind(templateStr, element, args); - } - else if (element instanceof NamedElement) { - String name = ((NamedElement) element).getName(); - if (templateStr.contains(NAME_IN_BRACKETS)) { - return templateStr.replace(NAME_IN_BRACKETS, name); - } - else if (templateStr.contains(NAME_IN_BRACKETS_SIMPLE)) { - return templateStr.replace(NAME_IN_BRACKETS_SIMPLE, name); - } - } - return templateStr; - // throw new TransformationException("Template is not supported"); //$NON-NLS-1$ - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/XtendTemplateBinding.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/XtendTemplateBinding.java deleted file mode 100644 index 14527c6aa23..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/XtendTemplateBinding.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.core.templates; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.extensions.IXtend; -import org.eclipse.papyrus.qompass.designer.core.extensions.XtendGenerator; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.uml2.uml.Element; - -public class XtendTemplateBinding { - - public static final String XTEND_MAGIC = "!xtend"; //$NON-NLS-1$ - - /** - * Execute a script passed as parameter. It will be executed in the context - * of a base script that declares the meta-model (UML2) and has additional - * imports (currently none). - * - * @param template - * The template in string form - * @param element - * The UML element to which the template is applied - * @return the evaluated template - */ - public static String bind(String templateStr, Element element) throws TransformationException { - return bind(templateStr, element, null); - } - - /** - * Execute a script passed as parameter. It will be executed in the context - * of a base script that declares the meta-model (UML2) and has additional - * imports (currently none). - * - * @param template - * The template in string form - * @param element - * The UML element to which the template is applied - * @return the evaluated template - */ - public static String bind(String templateStr, Element element, Object args[]) throws TransformationException { - String[] templateRef = templateStr.substring(XTEND_MAGIC.length() + 1).split("\\."); //$NON-NLS-1$ - String templateId = templateRef[0].trim(); - String methodName = templateRef[1].trim(); - IXtend generator = XtendGenerator.getXtendGenerator(templateId); - if (generator == null) { - throw new TransformationException(String.format(Messages.XtendTemplateBinding_TemplateNotFound, templateId, methodName)); - } - - try { - Object result; - if (args != null) { - Method method = getMethod(generator, methodName, 1+args.length); - result = method.invoke(generator, element, args); - } - else { - Method method = getMethod(generator, methodName, 1); - result = method.invoke(generator, element); - } - if (result instanceof String) { - return (String) result; - } - else if (result instanceof CharSequence) { - return result.toString(); - } - else { - throw new TransformationException(Messages.XtendTemplateBinding_TemplateResultIsNotAString); - } - } catch (SecurityException | IllegalAccessException - | IllegalArgumentException | InvocationTargetException | NullPointerException e) { - throw new TransformationException(e.getMessage()); - } - } - - public static Method getMethod(IXtend generator, String methodName, int numberOfArguments) { - for (Method method : generator.getClass().getMethods()) { - if (method.getName().equals(methodName) && method.getParameterTypes().length == numberOfArguments) { - return method; - } - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AbstractContainerTrafo.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AbstractContainerTrafo.java deleted file mode 100644 index 75dd752b1df..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AbstractContainerTrafo.java +++ /dev/null @@ -1,114 +0,0 @@ -/*******************************************************************import java.util.HashMap; -import java.util.Map; - -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Package; -s distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Package; - - -public abstract class AbstractContainerTrafo { - - public static void init() { - containers = new HashMap(); - } - - /** - * return the container trafo associated with the tmComponent - * - * @param tmComponent - * @return Container-trafo instance of null - */ - public static AbstractContainerTrafo get(Class tmComponent) { - return containers.get(tmComponent); - } - - /** - * Hash map used to identify for which components we already created a container. - * Indexed with components in target model (but before container expansion) - */ - protected static Map containers; - - public abstract void createContainer(Class smComponent, Class tmComponent) throws TransformationException; - - /** - * Create an instance of the container (UML instance specification) - * - * @param tmComponent - * the component within the target model for which we want to create an instance - * - * @param tmIS - * the existing instance specification for the component before container expansion. - * @param context - * Additional information about the container that is used by instance configurators - */ - public abstract InstanceSpecification createContainerInstance(Class tmComponent, InstanceSpecification tmIS) - throws TransformationException; - - /** - * apply a container rule, i.e. add either a container extension or an - * interceptor to the container - * - * @param smContainerRule - * An container rule - * @param smComponent - * the application component in the source model - * @param tmComponent - * the application component in the target model - * @throws TransformationException - */ - public abstract void applyRule(ContainerRule smContainerRule, Class smComponent, Class tmComponent) - throws TransformationException; - - /** - * The instance specification of the created container - */ - // protected InstanceSpecification containerIS; - - /** - * Copy class from source to target model - */ - protected LazyCopier copier; - - - /** - * Is called after a set of rule applications. - * Does nothing by default - */ - @Override - public void finalize() { - } - - /** - * The created container implementation (prefixed with tm, since part of - * target model) - */ - protected Class tmClass; - - /** - * deployment plan within source model - */ - protected Package smCDP; - - /** - * deployment plan within target model - */ - protected Package tmCDP; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AllocTransfo.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AllocTransfo.java deleted file mode 100644 index 60f563cdb58..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AllocTransfo.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EStructuralFeature.Setting; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; -import org.eclipse.uml2.common.util.UML2Util; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.ConnectorEnd; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.Type; - -/** - * Transform the allocations towards an execution resource (thread) into a suitable connection - * Current restriction: a thread needs to be defined the same composite as the component which - * is allocated to this thread. - */ -public class AllocTransfo { - public static final String MAIN = "main"; //$NON-NLS-1$ - - /** - * - * @param copy - * The copy class. Currently unused - * @param composite - * A composite. We analyze the allocations of the properties within this - * Composite. The composite must be an element of the target model that can be modified. - */ - public void transformAllocs(LazyCopier copy, Class composite) { - EList attributeList = new BasicEList(); - attributeList.addAll(composite.getOwnedAttributes()); // use a copy, since the loop eventually destroys an element of the list. - for (Property attribute : attributeList) { - Type type = attribute.getType(); - if (!(type instanceof Class)) { - continue; - } - Property thread = AllocUtils.getThreadAlloc(attribute); - if (thread != null) { - // this attribute represents a thread. - if (thread.getName().equals(MAIN)) { - // TODO: currently, no support for setting up the priority of the main thread. - // we need to get a cleaner solution for the main thread. - // destroy eventual connector and associated thread => thread as component with unconnected start thread - Connector conn = ConnectorUtil.getConnector(composite, attribute, thread); - // Connector targetConn = copy.getCopy(conn); - // Property targetThread = copy.getCopy(thread); - if (conn != null) { - conn.destroy(); - } - // destroy not only the thread, but also the slot within the composites instance specification - // (that references the thread via its defining feature). - for (Setting setting : UML2Util.getInverseReferences(thread)) { - if (setting.getEObject() instanceof Slot) { - ((Element) setting.getEObject()).destroy(); - } - } - thread.destroy(); - } - // check, if there is already a connector between the attribute and the thread - else if (!ConnectorUtil.existsConnector(composite, attribute, thread)) { - // no connector => create; - Class component = (Class) type; - Connector c = composite.createOwnedConnector("alloc to " + thread.getName()); //$NON-NLS-1$ - ConnectorEnd ce1 = c.createEnd(); - ce1.setPartWithPort(attribute); - // TODO: should really use start port instead... - // ce1.setRole(AllocUtils.getStartPort(component)); - NamedElement ne = Utils.getNamedElementFromList(component.getAllAttributes(), "lc"); //$NON-NLS-1$ - if (ne instanceof Property) { - ce1.setRole((Property) ne); - } - ConnectorEnd ce2 = c.createEnd(); - ce2.setPartWithPort(thread); - Type threadT = thread.getType(); - if (threadT instanceof Class) { - // TODO: nicer way to obtain port ... - Property rLC = ((Class) threadT).getAttribute("rLC", null); //$NON-NLS-1$ - if (rLC instanceof Port) { - ce2.setRole(rLC); - } - } - } - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CompTypeTrafos.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CompTypeTrafos.java deleted file mode 100644 index 4fa6256b36a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CompTypeTrafos.java +++ /dev/null @@ -1,127 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.papyrus.C_Cpp.Ptr; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.PortUtils; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.ParameterDirectionKind; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Type; - -/** - * A collection of transformations related to component-types (or abstract implementations) - * - * 1. Add access operations for ports, i.e. operations that return a reference of a port - * (if port provides interface) and/or allow to connect a port with a given reference - * (if port requires an interface) - * 2. Remove ports (after ports have been replaced with standard properties) - * - * TODO: transformation is specific to C++ - * TODO: currently unused - * - * @author ansgar - * - */ -@Deprecated -public class CompTypeTrafos { - - public static final String INDEX_TYPE_FOR_MULTI_RECEPTACLE = "corba::Long"; //$NON-NLS-1$ - - /** - * Complete access operations recursively, i.e. traverse all packageable - * elements and apply the completeAccessOps operation on classes - * - * @param pkg - * the package for which the completion should start - * @see completeAccessOps(Class) - */ - public static void completeAccessOps(Package pkg) { - for (PackageableElement element : new BasicEList(pkg.getPackagedElements())) { - if (element instanceof Package) { - completeAccessOps((Package) element); - } else if (element instanceof Class) { - completeAccessOps((Class) element); - } - } - } - - /** - * Complete access operations that return the reference. This function is a completion, - * since the access operations have already been added for component implementations - * (partly, if implementation was abstract). - * - * @param component - * the component for which access operation should be completed. - * @return - */ - private static void completeAccessOps(Class component) { - // only owned ports => since the operation is also applied on inherited types. - for (Port port : component.getOwnedPorts()) { - Interface providedIntf = PortUtils.getProvided(port); - if (providedIntf != null) { - // add operation CCM_<%type%> get_ - String getName = PrefixConstants.getP_Prefix + port.getName(); - - // create unless already existing - if (component.getOwnedOperation(getName, null, null) == null) { - Operation op = component.createOwnedOperation(getName, null, null); - op.setIsAbstract(true); - Parameter retParam = op.createOwnedParameter("ret", providedIntf); //$NON-NLS-1$ - retParam.setDirection(ParameterDirectionKind.RETURN_LITERAL); - StereotypeUtil.apply(retParam, Ptr.class); - // StereotypeUtil.apply(op, CppVirtual.class); - } - } - Interface requiredIntf = PortUtils.getRequired(port); - if (requiredIntf != null) { - // add operation CCM_<%type%> connect_q - String connName = PrefixConstants.connectQ_Prefix + port.getName(); - - // create unless already existing - if (component.getOwnedOperation(connName, null, null) == null) { - Operation op = component.createOwnedOperation(connName, null, null); - op.setIsAbstract(true); - boolean multiPort = (port.getUpper() > 1) || (port.getUpper() == -1); // -1 indicates "*" - if (multiPort) { - // add index parameter - Element eLong = Utils.getQualifiedElement(PackageUtil.getRootPackage(component), INDEX_TYPE_FOR_MULTI_RECEPTACLE); - if (eLong instanceof Type) { - op.createOwnedParameter("index", (Type) eLong); //$NON-NLS-1$ - } - else { - throw new RuntimeException(String.format(Messages.CompTypeTrafos_CannotFindType, INDEX_TYPE_FOR_MULTI_RECEPTACLE)); - } - } - Parameter refParam = op.createOwnedParameter("ref", requiredIntf); //$NON-NLS-1$ - refParam.setDirection(ParameterDirectionKind.IN_LITERAL); - StereotypeUtil.apply(refParam, Ptr.class); - // StereotypeUtil.apply(op, CppVirtual.class); - } - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CopyTo.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CopyTo.java deleted file mode 100644 index 7aa54599ebd..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CopyTo.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.EcoreUtil.Copier; -import org.eclipse.uml2.uml.Element; - -/** - * This class enables the copy from a source to a given target element. - * It assumes that a copy has already been created, but will just not copy it... - * Unlike the @see Copy class, the element might be copied to a different place - */ -public class CopyTo { - /** - * Copy an element from the source to a target - * - * @param source - * The element that should be copied - * @param targetContainer - * The container into which it the source should be copied - * @return the copied object - */ - @SuppressWarnings("unchecked") - public static T copyTo(T source, Element targetContainer) { - Copier copier = new Copier(); - EObject sourceContainer = source.eContainer(); - if (sourceContainer != null) { - copier.put(sourceContainer, targetContainer); - } - - EObject copy = copier.copy(source); - copier.copyAll(source.getStereotypeApplications()); - copier.copyReferences(); - return (T) copy; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/ExecuteOOTrafo.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/ExecuteOOTrafo.java deleted file mode 100644 index 17ae079d584..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/ExecuteOOTrafo.java +++ /dev/null @@ -1,175 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.PortKind; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.papyrus.qompass.designer.core.extensions.IOOTrafo; -import org.eclipse.papyrus.qompass.designer.core.extensions.OOTrafo; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.EncapsulatedClassifier; -import org.eclipse.uml2.uml.Model; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.StructuralFeature; -import org.eclipse.uml2.uml.StructuredClassifier; - -public class ExecuteOOTrafo { - - IOOTrafo ooTrafo; - - ExecuteOOTrafo(IOOTrafo ooTrafo) { - this.ooTrafo = ooTrafo; - } - - /** - * Execute the OO transformation for a package, include removal of connectors - * - * @param pkg - * @throws TransformationException - */ - public void transformPackage(Package pkg) throws TransformationException { - recursiveOOTransformation(pkg); - // transformation and removal is not done in same loop. Otherwise it would be possible - // that inherited ports have already been removed. - recursiveRemoval(pkg); - } - - /** - * Execute the OO transformation for a package - * - * @param pkg - * @throws TransformationException - */ - public void recursiveOOTransformation(Package pkg) throws TransformationException { - EList peList = new BasicEList(); - peList.addAll(pkg.getPackagedElements()); - for (PackageableElement element : peList) { - if (element instanceof Package) { - recursiveOOTransformation((Package) element); - } else if (element instanceof Class) { - Class implementation = (Class) element; - // do not apply transformation to port-kinds - if (!StereotypeUtil.isApplied(implementation, PortKind.class)) { - ooTrafo.addPortOperations(implementation); - ooTrafo.addConnectionOperation(implementation); - ooTrafo.transformParts(implementation); - } - } - } - } - - /** - * Remove connectors and ports from elements within a package - * - * @param pkg - * @throws TransformationException - */ - public void recursiveRemoval(Package pkg) throws TransformationException { - EList peList = new BasicEList(); - peList.addAll(pkg.getPackagedElements()); - for (PackageableElement element : peList) { - if (element instanceof Package) { - recursiveRemoval((Package) element); - } - else { - // delete connectors and ports - if (element instanceof StructuredClassifier) { - removeConnectors((StructuredClassifier) element); - } - if (element instanceof EncapsulatedClassifier) { - removePorts((EncapsulatedClassifier) element); - } - } - } - } - - /** - * Helper: remove connectors from a structured classifier (in most cases a - * class) - * - * @param implementation - * A component - */ - public void removeConnectors(StructuredClassifier implementation) { - EList connectors = new BasicEList(); - connectors.addAll(implementation.getOwnedConnectors()); - for (Connector connector : connectors) { - connector.destroy(); - } - } - - /** - * Helper: remove ports from a from an encapsulated classifier (in most - * cases a class) - * - * @param implementation - * A component - */ - public void removePorts(EncapsulatedClassifier implementation) { - EList portListCopy = new BasicEList(); - portListCopy.addAll(implementation.getOwnedPorts()); - // avoid dangling references by calling destroy on the port list - for (Port port : portListCopy) { - port.destroy(); - } - } - - /** - * Transform a component model into an object oriented model. - * - * @param copier a copier - * @param bootloader the generated bootloader - * @param genModel the model to generate into - * @param OOmodel ignored. - * @throws TransformationException - * @deprecated use variant with ignored parameter - */ - @Deprecated - public static void transform(LazyCopier copier, Class bootloader, Model genModel, boolean OOmodel) - throws TransformationException { - transform(copier, bootloader, genModel); - } - - public static void transform(LazyCopier copier, Class bootloader, Model genModel) - throws TransformationException { - String ooTransformation = DepUtils.getOOTransformationFromPackage(genModel); - if (ooTransformation == null) { - // default OO transformation - ooTransformation = "StaticCpp"; //$NON-NLS-1$ - } - IOOTrafo ooTrafo = OOTrafo.getOOTrafo(ooTransformation); - ooTrafo.init(copier, bootloader); - ExecuteOOTrafo executeOOTrafo = new ExecuteOOTrafo(ooTrafo); - executeOOTrafo.transformPackage(genModel); - - // complete access operations? - } - - // TODO: always false. Is it really task of OO trafo to decide whether - // something is - // instantiated by bootloader or not? - public static boolean instantiateViaBootloader(StructuralFeature slot) { - return false; - } - - // TODO: currently used by BOOTLOADER generator. Why needed? - public static final String CREATE_CONNECTIONS = "createConnections"; //$NON-NLS-1$ -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/FlattenInteractionComponents.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/FlattenInteractionComponents.java deleted file mode 100644 index 1d9cabc87c0..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/FlattenInteractionComponents.java +++ /dev/null @@ -1,224 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.ConnectorEnd; -import org.eclipse.uml2.uml.DirectedRelationship; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.StructuralFeature; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Deploy instances in a flat way, i.e. only deploy leaves. "Normal" composites - * still need to be deployed (since they might have a behavior of their own). - * However, composites tagged as assemblies (FCM stereotype attribute) may be - * not be deployed, instead their contents is deployed. - * - * A composite that is not deployed implies that - * - assembly connections within this composite need to move up one or more levels - * in the composite hierarchy - * - re-targeting connections from/to a composite to the inner part (along delegation connections inside - * the composite) - * [Need to stop at a composite] - * - * Problems: need to do that on instance level. It could be that the same composite is instantiated - * at different places in the tree with a different implementation choices => would require different - * variants of the sub-type. - * Solution: a. completely flatten except system of which we know that a single - * instance exists) - * b. forbid that different implementation variants are used by different instances of same composant - * - * CAVEAT: function not yet properly working, - * function currently not used - * - * @author ansgar - * - * - */ -public class FlattenInteractionComponents { - - private static final String FLATTEN_SEP = "_"; //$NON-NLS-1$ - - public static FlattenInteractionComponents getInstance() { - return instance; - } - - private static FlattenInteractionComponents instance = new FlattenInteractionComponents(); - - /** - * flatten an assembly, i.e. remove the passed containedPart (which must be a part within the passed containing - * composite) - * - * @param containingComposite - * @param containedPart - * a part within the passed containing composite - * @param containedComposite - * the type (implementation) of the passed part - */ - public void flattenAssembly(InstanceSpecification instance, Slot slot) - { - Classifier cl = DepUtils.getClassifier(instance); - if ((cl instanceof Class) && (slot != null)) { - InteractionComponent ic = UMLUtil.getStereotypeApplication(cl, InteractionComponent.class); - if ((ic != null) && ic.isForDistribution()) { - Slot containingSlot = DepUtils.getParentSlot(instance); - InstanceSpecification containingInstance = containingSlot.getOwningInstance(); - flattenAssembly((Class) cl, instance, containingInstance, containingSlot); - } - } - // loop over sub-instances and apply flatten recursively. - // create a copy of the slots, since the recursive flatten call might modify - // the number of slots - EList slots = new BasicEList(instance.getSlots()); - for (Slot subISslot : slots) { - InstanceSpecification subIS = DepUtils.getInstance(subISslot); - if (subIS != null) { - flattenAssembly(subIS, subISslot); - } - } - } - - /** - * - * Flatten a composite interaction component, i.e. replace it by the containing fragments. This includes the following actions - * 1. Parts typed with the interaction component must be replaced with a set of parts typed with the fragment. - * 2. Connectors must be redirected. - * - * Please note that we do not delete the original interaction component, but it will not appear in a model generated for a specific node. - * TODO: We need to re-target connectors in all containing composites, but the same containingComposite might have several instances within an application. In this case, - * we only need to move slots. - * - * Well, there are different classes: first: the flattened interaction component and other components that reference the flattened interaction component. - * - * @param composite - * a composite class - * @param instance - * the instance associated with the composite class (1st parameter) - * @param containingInstance - * an instance of the containing composite - * @param containingSlot - * the slot associated with the instance (2nd parameter) - */ - public void flattenAssembly(Class composite, InstanceSpecification instance, InstanceSpecification containingInstance, Slot containingSlot) - { - Classifier containingCompositeCl = DepUtils.getClassifier(containingInstance); - StructuralFeature sfForIA = containingSlot.getDefiningFeature(); - Map replaceParts = new HashMap(); - if ((containingCompositeCl instanceof Class) && (sfForIA instanceof Property)) { - Class containingComposite = (Class) containingCompositeCl; - Property partForIA = (Property) sfForIA; - - for (Property fragmentPart : composite.getAllAttributes()) { - if (fragmentPart instanceof Port) { - continue; - } - String partName = partForIA.getName() + FLATTEN_SEP + fragmentPart.getName(); - // create a new part in the containing composite - Property newPartForFragment = containingComposite.createOwnedAttribute(partName, fragmentPart.getType()); - replaceParts.put(fragmentPart, newPartForFragment); - - boolean foundConnector = false; - // now redirect connectors: find whether a port delegates to the fragment - for (Connector connector : composite.getOwnedConnectors()) { - if (ConnectorUtil.connectsPart(connector, fragmentPart)) { - foundConnector = true; - // internal connector for the part, check whether delegation - ConnectorEnd ce = ConnectorUtil.connEndNotPart(connector, fragmentPart); - if ((ce != null) && (ce.getPartWithPort() == null)) { - // delegation connector, need to re-targed connections to external port - Port port = (Port) ce.getRole(); - // now look for connections to this port in the containingComposite and shortcut these ... - retargetConnections(containingComposite, port, partForIA, newPartForFragment); - } else { - // assembly: assembly connection between fragments are not authorized - } - } - } - if (!foundConnector) { - throw new RuntimeException("the part <" + fragmentPart.getName() + "> within composite <" + composite.getName() + "> is not connected with any of its ports"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } - } - // on instance level: move slots from instance to containingInstance - EList slots = instance.getSlots(); - containingInstance.getSlots().addAll(slots); - // replace defining feature - for (Slot slot : containingInstance.getSlots()) { - StructuralFeature sf = slot.getDefiningFeature(); - if (replaceParts.containsKey(sf)) { - slot.setDefiningFeature(replaceParts.get(sf)); - // assure naming convention for instances: here, we update the name of the instance - // and its sub-instances with the name of the containingInstance - InstanceSpecification subInstance = DepUtils.getInstance(slot); - if ((subInstance != null) && !DepUtils.isShared(slot)) { - DepPlanUtils.updateInstanceNames(subInstance, instance.getName() + FLATTEN_SEP + sf.getName()); - } - } - } - - containingSlot.destroy(); - // destroy relationships of flattened instance, in particular allocation - for (DirectedRelationship dr : instance.getSourceDirectedRelationships()) { - dr.destroy(); - } - instance.destroy(); - partForIA.destroy(); - - // move is - /* - * InstanceSpecification partIS; - * DepUtils.createSlot (cdp, newIS, partIS, newPart); - */ - } - } - - /** - * Find a connection within a connecting - * - * @param containingComposite - * @param port - * A port which delegates to a fragment - * @param part - * the part within the containing composite (1st parameter) point to the interactionComponent - * @param subPart - * a newly created part corresponding to the fragment - */ - public void retargetConnections(Class containingComposite, Port port, Property part, Property subPart) { - for (Connector connector : containingComposite.getOwnedConnectors()) { - if (ConnectorUtil.connectsPart(connector, part) && ConnectorUtil.connectsPort(connector, port)) { - ConnectorEnd ce = ConnectorUtil.connEndForPart(connector, part); - if (ce != null) { - // TODO: only with with connections targeting a port of a part, not with - // those targeting directly a part - ce.setPartWithPort(subPart); - } - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/InstantiateDepPlan.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/InstantiateDepPlan.java deleted file mode 100644 index 5935d0ac8a4..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/InstantiateDepPlan.java +++ /dev/null @@ -1,702 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.common.util.WrappedException; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.papyrus.FCM.Configuration; -import org.eclipse.papyrus.FCM.OperatingSystem; -import org.eclipse.papyrus.FCM.Target; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.papyrus.codegen.extensionpoints.AbstractSettings; -import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; -import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; -import org.eclipse.papyrus.codegen.extensionpoints.LanguageCodegen; -import org.eclipse.papyrus.codegen.extensionpoints.LanguageProjectSupport; -import org.eclipse.papyrus.qompass.designer.core.EnumService; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.ModelManagement; -import org.eclipse.papyrus.qompass.designer.core.ProjectManagement; -import org.eclipse.papyrus.qompass.designer.core.StUtils; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.Deploy; -import org.eclipse.papyrus.qompass.designer.core.deployment.DeployConstants; -import org.eclipse.papyrus.qompass.designer.core.deployment.GatherConfigData; -import org.eclipse.papyrus.qompass.designer.core.extensions.InstanceConfigurator; -import org.eclipse.papyrus.qompass.designer.core.generate.GenerateCode; -import org.eclipse.papyrus.qompass.designer.core.generate.GenerationOptions; -import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FilterRuleApplication; -import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FilterStateMachines; -import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FilterTemplate; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Model; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.Profile; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * This class executes all transformations during the instantiation of a - * deployment plan, i.e. 1. The reification of connectors (including template - * instantiation). This transformation targets a new model 2. Adding - * get_p/connect_q operations to a class (transformation within same model) 3. - * Remove all component types 4. distribute to nodes - * - * @author ansgar - * - */ -public class InstantiateDepPlan { - - /** - * The location of the temporary model (relative to current project). TODO: - * make configurable? - */ - public static final String TEMP_MODEL_FOLDER = "tmpModel"; //$NON-NLS-1$ - - /** - * Postfix of the temporary model (prefix = name of top-level package). - * TODO: make configurable? - */ - public static final String TEMP_MODEL_POSTFIX = "Tmp.uml"; //$NON-NLS-1$ - - /** - * Progress monitor of Eclipse. - */ - protected IProgressMonitor monitor = null; - - protected int generationOptions; - - protected boolean generateCode; - - protected boolean generateCACOnly; - - protected Package srcModelComponentDeploymentPlan = null; - - protected Configuration configuration = null; - - protected IProject project; - - protected IProject genProject; - - public void instantiate(Configuration configuration, - IProgressMonitor monitor, IProject project, int genOptions) { - this.configuration = configuration; - srcModelComponentDeploymentPlan = configuration - .getDeploymentPlan().getBase_Package(); - // - if (srcModelComponentDeploymentPlan == null) { - String message = String - .format(Messages.InstantiateDepPlan_DepPlanStereotypeNotInitialized, - configuration.getBase_Class().getName()); - displayError(Messages.InstantiateDepPlan_TransformationException, - message); - } - - this.project = project; - if (project == null) { - String projectName = configuration.getBase_Class().eResource() - .getURI().toString(); - this.project = ResourcesPlugin.getWorkspace().getRoot() - .getProject(projectName); - } - // - instantiate(monitor, genOptions); - } - - public void instantiate(Package pkg, IProgressMonitor monitor, - IProject project, int genOptions) { - configuration = null; - srcModelComponentDeploymentPlan = pkg; - // - this.project = project; - if (project == null) { - String projectName = pkg.eResource().getURI().toString(); - this.project = ResourcesPlugin.getWorkspace().getRoot() - .getProject(projectName); - } - - // - instantiate(monitor, genOptions); - } - - /** - * Instantiate a deployment plan, i.e. generate an intermediate model via a - * sequence of transformations - * - * @param umlElement - * a deployment plan (UML package) or a configuration (UML class) - * @param monitor - * a progress monitor. - * - * @param project - * the current project. This information is used to store the - * intermediate model in a subfolder (tmpModel) of the current - * project - * @param genOptions - * select whether to produce an intermediate model only, also - * code, ... @see GenerationOptions - */ - private void instantiate(IProgressMonitor monitor, int genOptions) { - try { - initialize(monitor, genOptions); - executeTransformationNew(); - } catch (final TransformationException e) { - printAndDisplayErrorMessage(e, - Messages.InstantiateDepPlan_TransformationException, false); - } catch (final Exception e) { - printAndDisplayErrorMessage(e, - Messages.InstantiateDepPlan_ErrorsDuringTransformation, - true); - } - } - - private void initialize(IProgressMonitor monitor, int genOptions) - throws TransformationException { - this.monitor = monitor; - this.generationOptions = genOptions; - this.generateCode = (genOptions & GenerationOptions.MODEL_ONLY) == 0; - this.generateCACOnly = (genOptions & GenerationOptions.CAC_ONLY) != 0; - - RuleManagement.setConfiguration(configuration); - } - - protected void executeTransformationNew() throws Exception { - ModelManagement intermediateModelManagement = null; - - // 1a: create a new model (and applies same profiles / imports) - Model existingModel = srcModelComponentDeploymentPlan.getModel(); - TransformationContext.sourceRoot = existingModel; - - intermediateModelManagement = createTargetModel(existingModel, - existingModel.getName(), true); - - // get the temporary model - Model intermediateModel = intermediateModelManagement.getModel(); - - // create a package for global enumerations that are used by Acceleo code - EnumService.createEnumPackage(intermediateModel); - - // create a lazy copier towards the intermediate model - LazyCopier intermediateModelCopier = new LazyCopier(existingModel, intermediateModel, false, true); - // add pre-copy and post-copy listeners to the copier - intermediateModelCopier.preCopyListeners.add(FilterTemplate.getInstance()); - - // 1b: reify the connectors "into" the new model - monitor.subTask(Messages.InstantiateDepPlan_InfoExpandingConnectors); - - // obtain the component deployment plan in target model - Package intermediateModelComponentDeploymentPlan = (Package) intermediateModelCopier - .shallowCopy(srcModelComponentDeploymentPlan); - intermediateModelCopier.createShallowContainer(srcModelComponentDeploymentPlan); - - AbstractContainerTrafo.init(); - InstanceConfigurator.onNodeModel = false; - MainModelTrafo mainModelTrafo = new MainModelTrafo(intermediateModelCopier, - intermediateModelComponentDeploymentPlan); - - Map instanceMap = - new HashMap(); - for (PackageableElement pe : srcModelComponentDeploymentPlan.getPackagedElements()) { - if (pe instanceof InstanceSpecification) { - InstanceSpecification instance = (InstanceSpecification) pe; - // check whether a top level instance and not an instance specification of a connector. The latter - // is added, since interaction components might have configuration parameters that appear in the - // deployment plan. Since the container transformation is not executed at this moment, the interaction is - // not represented by a part yet. - if (DepUtils.isTopLevelInstance(instance) && !Utils.isInteractionComponent(DepUtils.getClassifier(instance))) { - InstanceSpecification newInstance = mainModelTrafo.transformInstance(instance, null); - - // -------------------------------------------------------------------- - checkProgressStatus(); - // -------------------------------------------------------------------- - - TransformationUtil.applyInstanceConfigurators(newInstance); - - FlattenInteractionComponents.getInstance().flattenAssembly( - newInstance, null); - TransformationUtil.propagateAllocation(newInstance); - instanceMap.put(instance, newInstance); - } - } - } - - if (!generateCACOnly) { - deployOnNodes(instanceMap, existingModel, intermediateModel); - } - - intermediateModelManagement.saveModel(project, TEMP_MODEL_FOLDER, - TEMP_MODEL_POSTFIX); - - // -------------------------------------------------------------------- - checkProgressStatus(); - // -------------------------------------------------------------------- - - intermediateModelManagement.dispose(); - } - - @Deprecated - protected void executeTransformation() throws Exception { - ModelManagement intermediateModelManagement = null; - - InstanceSpecification mainInstance = DepUtils - .getMainInstance(srcModelComponentDeploymentPlan); - EList nodes = AllocUtils - .getAllNodes(mainInstance); - - initiateProgressMonitor(generateCode, nodes); - - // -------------------------------------------------------------------- - checkProgressStatus(); - // -------------------------------------------------------------------- - - // 1a: create a new model (and applies same profiles / imports) - Model existingModel = srcModelComponentDeploymentPlan.getModel(); - TransformationContext.sourceRoot = existingModel; - - intermediateModelManagement = createTargetModel(existingModel, - existingModel.getName(), true); - - // Declare that the new model is a derivedElement (kind of hack, - // since the source element (attribute of derive element) remains - // undefined). This is used to deactivate automatic transformations - // that should not be applied to the generated model. - - // -------------------------------------------------------------------- - checkProgressStatus(); - // -------------------------------------------------------------------- - - // get the temporary model - Model intermediateModel = intermediateModelManagement.getModel(); - - // create a package for global enumerations that are used by Acceleo code - EnumService.createEnumPackage(intermediateModel); - - // create a lazy copier towards the intermediate model - LazyCopier intermediateModelCopier = new LazyCopier(existingModel, intermediateModel, false, true); - // add pre-copy and post-copy listeners to the copier - intermediateModelCopier.preCopyListeners.add(FilterTemplate.getInstance()); - - // 1b: reify the connectors "into" the new model - monitor.subTask(Messages.InstantiateDepPlan_InfoExpandingConnectors); - - // obtain the component deployment plan in target model - Package intermediateModelComponentDeploymentPlan = (Package) intermediateModelCopier - .shallowCopy(srcModelComponentDeploymentPlan); - intermediateModelCopier.createShallowContainer(srcModelComponentDeploymentPlan); - - AbstractContainerTrafo.init(); - InstanceConfigurator.onNodeModel = false; - MainModelTrafo mainModelTrafo = new MainModelTrafo(intermediateModelCopier, - intermediateModelComponentDeploymentPlan); - InstanceSpecification newMainInstance = mainModelTrafo - .transformInstance(mainInstance, null); - - // -------------------------------------------------------------------- - checkProgressStatus(); - // -------------------------------------------------------------------- - - TransformationUtil.applyInstanceConfigurators(newMainInstance); - - FlattenInteractionComponents.getInstance().flattenAssembly( - newMainInstance, null); - - TransformationUtil.propagateAllocation(newMainInstance); - - intermediateModelManagement.saveModel(project, TEMP_MODEL_FOLDER, - TEMP_MODEL_POSTFIX); - - // -------------------------------------------------------------------- - checkProgressStatus(); - // -------------------------------------------------------------------- - - if (!generateCACOnly) { - // deployOnNodes(mainInstance, existingModel, intermediateModel, - // newMainInstance); - } - - intermediateModelManagement.dispose(); - } - - private void deployOnNodes(Map instanceMap, - Model existingModel, Model tmpModel) - throws TransformationException, InterruptedException { - - // not deploy on each node - DepCreation.initAutoValues(instanceMap.values()); - - EList nodes = AllocUtils.getAllNodes(instanceMap.values()); - if (nodes.size() > 0) { - InstanceConfigurator.onNodeModel = true; - for (int nodeIndex = 0; nodeIndex < nodes.size(); nodeIndex++) { - InstanceSpecification node = nodes.get(nodeIndex); - - deployNode(instanceMap, existingModel, tmpModel, nodes, nodeIndex, node); - } - } else { - throw new TransformationException( - Messages.InstantiateDepPlan_InfoNoneAllocated); - } - } - - private void deployNode(Map instanceMap, - Model existingModel, Model tmpModel, - EList nodes, int nodeIndex, InstanceSpecification node) - throws TransformationException, InterruptedException { - ModelManagement genModelManagement = createTargetModel(existingModel, - MapUtil.rootModelName, false); - Model generatedModel = genModelManagement.getModel(); - - // -------------------------------------------------------------------- - checkProgressStatus(); - // -------------------------------------------------------------------- - - // new model has name "root" and contains a package with the - // existing model - // Package originalRoot = genModel.createNestedPackage - // (existingModel.getName ()); - LazyCopier targetCopy = new LazyCopier(tmpModel, generatedModel, true, true); - // TODO: distribution to nodes is currently not done. How - // can it be realized with a copy filter ? - targetCopy.preCopyListeners.add(FilterStateMachines.getInstance()); - targetCopy.preCopyListeners.add(FilterRuleApplication.getInstance()); - - monitor.setTaskName(String.format( - Messages.InstantiateDepPlan_InfoDeployingForNode, - node.getName())); - - if (instanceMap.isEmpty()) { - return; - } - // get first language (restricted to single target language, acceptable?) - String targetLanguage = DepUtils.getTargetLanguage(instanceMap.keySet().iterator().next()); - ILangProjectSupport projectSupport = configureLanguageSupport(targetLanguage, - existingModel, node); - if (projectSupport == null) { - return; - } - - GatherConfigData gatherConfigData = new GatherConfigData(projectSupport); - Deploy deployment = new Deploy(targetCopy, gatherConfigData, node, - nodeIndex, nodes.size()); - - for (InstanceSpecification topLevelInstance : instanceMap.keySet()) { - InstanceSpecification newTopLevelInstance = instanceMap.get(topLevelInstance); - InstanceSpecification nodeRootIS = deployment.distributeToNode(newTopLevelInstance); - TransformationUtil.updateDerivedInterfaces(nodeRootIS); - } - deployment.finalize(targetLanguage); - if ((generationOptions & GenerationOptions.REWRITE_SETTINGS) != 0) { - projectSupport.setSettings(genProject, gatherConfigData.getSettings()); - } - - // -------------------------------------------------------------------- - checkProgressStatus(); - // -------------------------------------------------------------------- - - removeDerivedInterfacesInRoot(generatedModel); - - ExecuteOOTrafo.transform(targetCopy, deployment.getBootloader(), generatedModel); - - // -------------------------------------------------------------------- - checkProgressStatus(); - // -------------------------------------------------------------------- - - destroyDeploymentPlanFolder(generatedModel); - - if (generateCode) { - ILangCodegen codegen = LanguageCodegen.getGenerator(targetLanguage); - GenerateCode codeGenerator = new GenerateCode(genProject, codegen, genModelManagement, - monitor); - boolean option = (generationOptions & GenerationOptions.ONLY_CHANGED) != 0; - codeGenerator.generate(node, targetLanguage, option); - } - - genModelManagement.dispose(); - } - - /** - * - * @param mainInstance - * @param existingModel - * @param node - * @return null, if no language support is available or no project could be created. - * @throws TransformationException - */ - private ILangProjectSupport configureLanguageSupport( - String targetLanguage, Model existingModel, - InstanceSpecification node) throws TransformationException { - ILangProjectSupport projectSupport = LanguageProjectSupport.getProjectSupport(targetLanguage); - AbstractSettings settings = projectSupport.initialConfigurationData(); - settings.targetOS = getTargetOS(node); - - String modelName = getModelName(existingModel, node); - genProject = ProjectManagement.getNamedProject(modelName); - if ((genProject == null) || !genProject.exists()) { - genProject = projectSupport.createProject(modelName); - // project is new, force re-write of settings - generationOptions |= GenerationOptions.REWRITE_SETTINGS; - } - return projectSupport; - } - - protected String getTargetOS(InstanceSpecification node) { - Target target = UMLUtil.getStereotypeApplication(node, Target.class); - if (target == null) { - // get information from node referenced by the instance - target = UMLUtil.getStereotypeApplication(DepUtils.getClassifier(node), Target.class); - } - if (target != null) { - OperatingSystem os = target.getUsedOS(); - if (os != null) { - return os.getBase_Class().getName(); - } - } - return null; - } - - private void destroyDeploymentPlanFolder(Model generatedModel) { - PackageableElement deploymentPlanFolder = generatedModel - .getPackagedElement(DeployConstants.depPlanFolderHw); - if (deploymentPlanFolder != null) { - deploymentPlanFolder.destroy(); - } - } - - private void removeDerivedInterfacesInRoot(Model generatedModel) { - // 2b: remove derived interfaces in root: derived interfaces - // that can not be placed in the same package as the port type (e.g. - // since read-only type from system library), are put in a top-level - // package called "derivedInterfaces". Due to the copying of imports, - // the top-level package has changed which implies that new derived - // interfaces are put into a different package and the derivedInterfaces - // package in the original root becomes obsolete. Delete this obsolete - // package, if existing. - for (PackageableElement packagedElement : generatedModel - .getPackagedElements()) { - if (packagedElement instanceof Package) { - NamedElement derivedInterfaces = ((Package) packagedElement) - .getPackagedElement("derivedInterfaces"); //$NON-NLS-1$ - if (derivedInterfaces instanceof Package) { - derivedInterfaces.destroy(); - } - } - } - } - - private String getModelName(Model existingModel, InstanceSpecification node) { - String modelName = existingModel.getName() + "_" + node.getName(); //$NON-NLS-1$ - if (configuration != null) { - modelName += "_" + configuration.getBase_Class().getName(); //$NON-NLS-1$ - } else { - modelName += "_" + srcModelComponentDeploymentPlan.getName(); //$NON-NLS-1$ - } - return modelName; - } - - private void initiateProgressMonitor(boolean generateCode, - EList nodes) { - // -- calc # of steps for progress monitor - // 1 (tmpModel creation) + 1 (reification) + 1 (tmpModel save) - // 5x on each deployed node (see below) - // problem? Connector reification is a single, relatively long step - int steps = 3; - steps += 5 * nodes.size(); - if (generateCode) { - steps += nodes.size(); - } - monitor.beginTask(Messages.InstantiateDepPlan_InfoGeneratingModel, - steps); - } - - private void checkProgressStatus() throws InterruptedException { - if (monitor.isCanceled()) { - throw new InterruptedException(); - } - monitor.worked(1); - } - - private void printAndDisplayErrorMessage(Exception e, final String title, - final boolean consultConsole) { - String message = e.toString(); - if (consultConsole) { - message = message + "\n\n" //$NON-NLS-1$ - + Messages.InstantiateDepPlan_ConsultConsole; - } - - printAndDisplayErrorMessage(e, title, message, consultConsole); - } - - private void printAndDisplayErrorMessage(Exception e, final String title, - final String message, final boolean consultConsole) { - e.printStackTrace(); - displayError(title, message); - Log.log(IStatus.ERROR, Log.DEPLOYMENT, "", e); //$NON-NLS-1$ - } - - private void displayError(final String title, final String message) { - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - Shell shell = Display.getDefault().getActiveShell(); - MessageDialog.openInformation(shell, title, message); - } - }); - } - - /** - * Create a new empty model from an existing model that applies the same - * profiles and has the same imports - * - * @param existingModel - * @return - */ - public ModelManagement createTargetModel(Model existingModel, String name, - boolean copyImports) throws TransformationException { - ModelManagement mm = new ModelManagement(); - Model newModel = mm.getModel(); - newModel.setName(name); - - try { - // copy profile application - for (Profile profile : existingModel.getAppliedProfiles()) { - // reload profile in resource of new model - monitor.subTask(Messages.InstantiateDepPlan_InfoApplyProfile - + profile.getQualifiedName()); - - if (profile.eResource() == null) { - String profileName = profile.getQualifiedName(); - if (profileName == null) { - if (profile instanceof MinimalEObjectImpl.Container) { - URI uri = ((MinimalEObjectImpl.Container) profile) - .eProxyURI(); - if (uri != null) { - throw new TransformationException( - String.format( - Messages.InstantiateDepPlan_CheckInputModelProfileNoRes, - uri)); - } - } - throw new TransformationException( - Messages.InstantiateDepPlan_CheckInputModelProfileNoResNoName); - } - throw new TransformationException( - String.format( - Messages.InstantiateDepPlan_CheckInputModelProfile3, - profileName)); - } - - Resource profileResource = null; - try { - profileResource = ModelManagement.getResourceSet() - .getResource(profile.eResource().getURI(), true); - } catch (WrappedException e) { - // read 2nd time (some diagnostic errors are raised only - // once) - Log.log(IStatus.WARNING, - Log.DEPLOYMENT, - "Warning: exception in profile.eResource() " + e.getMessage()); //$NON-NLS-1$ - profileResource = ModelManagement.getResourceSet() - .getResource(profile.eResource().getURI(), true); - } - Profile newProfileTop = (Profile) profileResource.getContents().get(0); - Profile newProfile; - String qname = profile.getQualifiedName(); - if ((qname != null) && qname.contains("::")) { //$NON-NLS-1$ - // profile is a sub-profile within same resource - // TODO: should Copy class copy profile applications? - // Should be handled in shallowContainer class. - // if we put profile/newProfile pair into copy map, copy - // would find (and copy profile - // applications in sub-folders - qname = qname.substring(qname.indexOf("::") + 2); //$NON-NLS-1$ - newProfile = (Profile) Utils.getQualifiedElement( - newProfileTop, qname); - } else { - newProfile = newProfileTop; - } - newProfile.getMember("dummy"); // force profile loading //$NON-NLS-1$ - newModel.applyProfile(newProfile); - } - } catch (IllegalArgumentException e) { - throw new TransformationException( - Messages.InstantiateDepPlan_IllegalArgumentDuringCopy - + e.toString()); - } - - // copy imports (and load resources associated - TODO: might not be - // necessary) - // While this is useful in general, it implies that code for imported - // models - // has been generated and compiled (for the right target) into a - // library. This may be - // quite tedious, unless automatically managed. - // Therefore we do not activate this option in a first pass of the model - // transformations. - if (copyImports) { - for (Package importedPackage : existingModel.getImportedPackages()) { - if (importedPackage == null) { - throw new TransformationException( - Messages.InstantiateDepPlan_CheckInputImportPkg); - } - if (importedPackage.eResource() == null) { - String errorMsg = Messages.InstantiateDepPlan_CheckInputImportPkgNoRes; - if (importedPackage instanceof MinimalEObjectImpl.Container) { - URI uri = ((MinimalEObjectImpl.Container) importedPackage) - .eProxyURI(); - if (uri != null) { - errorMsg += " - URI: " + uri.devicePath(); //$NON-NLS-1$ - } - } - throw new TransformationException(errorMsg); - } - newModel.createPackageImport(importedPackage); - monitor.subTask(String.format( - Messages.InstantiateDepPlan_InfoImportPackage, - importedPackage.getName())); - - try { - importedPackage.eResource().load(null); - newModel.getMember("dummy"); // force loading of model //$NON-NLS-1$ - } catch (IOException e) { - throw new TransformationException(e.getMessage()); - } - - } - } - - StUtils.copyStereotypes(existingModel, newModel); - - return mm; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/LWContainerTrafo.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/LWContainerTrafo.java deleted file mode 100644 index 220e9182c2b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/LWContainerTrafo.java +++ /dev/null @@ -1,436 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.InterceptionRule; -import org.eclipse.papyrus.FCM.Template; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.StUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.papyrus.qompass.designer.core.extensions.InstanceConfigurator; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateInstantiation; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; -import org.eclipse.papyrus.qompass.designer.core.templates.TextTemplateBinding; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier.CopyStatus; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Dependency; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.OpaqueBehavior; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.TemplateSignature; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.profile.standard.Create; -import org.eclipse.uml2.uml.profile.standard.Destroy; - -/** - * A light-weight container transformation. Unlike the standard component-based transformation, this trafo does add a new class. - * It is target for standard object-oriented architecture, enabling in particular to intercept the methods of a class (instead of - * adding interceptors to ports). - * - * @author ansgar - * - */ -public class LWContainerTrafo extends AbstractContainerTrafo { - - public final String origOpPrefix = "orig_"; //$NON-NLS-1$ - - /** - * Constructor - * - * @param sat - * information about source and target model - * @param tmCDP - * deployment plan within target model - */ - public LWContainerTrafo(LazyCopier copy, Package tmCDP) { - this.copier = copy; - this.tmCDP = tmCDP; - interceptionOpMap = new HashMap(); - } - - /** - * creates the executor. Needs to be called *before* the other operations of - * this class. - * - * @param tmComponent - * the implementation of a component - * - * @throws TransformationException - */ - @Override - public void createContainer(Class smClass, Class tmClass) throws TransformationException { - - // for non-components: create a delegation operation for all operations that are provided by a class (excluding those derived by ports) - // Calls on model level use CallOperationAction, will point to existing operation, unless changed. - // If deployed dynamically (no static component deployment), need to change factories as well. - // Pragmatic: rename/add existing operations (as Accord has done), do some renaming and clever model handling (assure - // that code referencing classes via name automatically uses the new class. - // => container with name of existing class, rename existing class. - // possible: move operations into container, existing class gets copy (and update behaviors) - - // TODO: need something simple ... - // requirements: - // - existing creation operations create container (separation activity CreateAction: needs to change.) - // trivially in this case case, since container is no separate entity. - // - => references could be exchanged during copy operation with a suitable copyFilter (=> container transfo becomes a copy filter) - // [in case of ports: quite difficult to handle: if port belongs to abstract components, it may be inherited by multiple components that - // might or might-not have a container => only some references need to be changed] - // => clarify, how container handles super-classes, i.e. if it inherits ports as well (from a container of the abstract component) or not (not trivial at all!) - // TODO: don't copy derived operations - - this.smClass = smClass; - this.tmClass = tmClass; - // create a copy of all operations - operations = new BasicEList(smClass.getOperations()); - } - - public void createInstance() { - } - - /** - * original operation => operation gets interception prefix - * - * Objectives: existing call operations call interception operation. Existing operations include CallOperationActions as well as calls within - * opaque behavior - * This is assured by keeping same model reference for the operation, but associating a new interception behavior, existing behavior will be - * associated - * with a new renamed operation - * - * @param operation - */ - protected Operation createInterceptionOperation(Operation operation) throws TransformationException { - // create copy of operation - Operation copiedOperation = EcoreUtil.copy(operation); - tmClass.getOwnedOperations().add(copiedOperation); - StUtils.copyStereotypes(operation, copiedOperation); - - copiedOperation.setName(origOpPrefix + operation.getName()); - - // create interception code - // TODO: this is Java/C++ specific! - OpaqueBehavior b = (OpaqueBehavior) tmClass.createOwnedBehavior(operation.getName(), UMLPackage.eINSTANCE.getOpaqueBehavior()); - // TODO: this is defined in modellibs.core, no dependency - // String body = CppUtils.cppCall(copiedOperation); - String body = "testBody"; - // TODO: solution is specific to C++ - b.getLanguages().add("C/C++"); //$NON-NLS-1$ - b.getBodies().add(body); - // copy existing methods into new operation, copy method list, - // since adding the method to copied operation will remove these from original operation) - EList methods = new BasicEList(operation.getMethods()); - for (Behavior behavior : methods) { - copiedOperation.getMethods().add(behavior); - } - // new behavior is associated with existing call. - b.setSpecification(operation); - return copiedOperation; - } - - /** - * return the reference of the created container class - * - * @return - */ - public Class getContainer() { - return tmClass; - } - - /** - * apply a container rule, i.e. add either a container extension or an - * interceptor to the container. - * - * @param smContainerRule - * An container rule - * @param smComponent - * the application component in the source model - * @param tmComponent - * the application component in the target model - * @param tmIS - * the instance specification for the application component in the target model - * @throws TransformationException - */ - @Override - public void applyRule(ContainerRule smContainerRule, Class smComponent, Class tmComponent) - throws TransformationException - { - // dependencies of the rule become dependencies of he class. These dependencies must be instantiated - for (Dependency dependency : smContainerRule.getBase_Class().getClientDependencies()) { - // - for (Element target : dependency.getTargets()) { - // target may, or may not be in a template - if (target instanceof Classifier) { - Classifier targetCl = (Classifier) target; - Class extClass = expandAggregationDep((Class) targetCl, smComponent); - tmComponent.createDependency(extClass); - // if(TemplateUtils.getSignature(targetCl) != null) { - // } - } - } - } - - boolean hasConstructor = isOperationStereotypeApplied(Create.class); - boolean hasDestructor = isOperationStereotypeApplied(Destroy.class); - - // register relation to facilitate connector copy - copier.setPackageTemplate(smContainerRule.getBase_Class(), tmClass); - // reset status to in-progress. Otherwise, the copier will not properly add new - // elements. - copier.setStatus(tmClass, CopyStatus.INPROGRESS); - - for (Operation templateOperation : smContainerRule.getBase_Class().getOperations()) { - // Need a specific treatment of Constructor/destructor: if original class has a - // constructor, must add to all constructors, if it has none, copy constructor - boolean templateIsConstructor = StereotypeUtil.isApplied(templateOperation, Create.class); - boolean templateIsDestructor = StereotypeUtil.isApplied(templateOperation, Destroy.class); - - boolean needsMerge = (templateIsConstructor && hasConstructor) || (templateIsDestructor && hasDestructor); - if (needsMerge || StereotypeUtil.isApplied(templateOperation, InterceptionRule.class)) { - // operation is an interceptor: add its content to the methods of the - // original class - expandInterceptorExtension(smContainerRule, templateOperation); - } - else { - // normal operation. Copy from container to class - Operation newOperation = copier.getCopy(templateOperation); - if (StereotypeUtil.isApplied(templateOperation, Template.class)) { - String opBody = getBody(templateOperation); - // operation is not an interceptor, assume binding with class itself - TransformationContext.classifier = tmClass; - opBody = TextTemplateBinding.bind(opBody, smClass, null); - setBody(newOperation, opBody); - } - if (templateIsConstructor) { - newOperation.setName(tmClass.getName()); - } - else if (templateIsConstructor) { - newOperation.setName("~" + tmClass.getName()); - } - } - } - - for (Property part : smContainerRule.getBase_Class().getAllAttributes()) { - Type type = part.getType(); - if (type == null) { - String ruleName = (smContainerRule.getBase_Class() != null) ? smContainerRule.getBase_Class().getName() : "undefined"; //$NON-NLS-1$ - throw new TransformationException(String.format(Messages.LWContainerTrafo_CannotApplyRule, ruleName)); - } - if (part instanceof Port) { - Port newPort = tmClass.createOwnedPort(part.getName(), part.getType()); - StUtils.copyStereotypes(part, newPort); - } - else if (type instanceof Class) { - Class extOrInterceptor = (Class) type; - // DepUtils.chooseImplementation((Class) type, - // new BasicEList(), false); - - if (StereotypeUtil.isApplied(part, InterceptionRule.class)) { - // port.filter - // - } - else { - Property extensionPart = - expandAggregationExtension(part.getName(), extOrInterceptor, tmComponent); - copier.put(part, extensionPart); - copier.setPackageTemplate(null, null); - } - } - else { - Property newAttribute = EcoreUtil.copy(part); - tmClass.getOwnedAttributes().add(newAttribute); - } - } - - // tell copy that tmcontainerImpl is associated with the smContainerRule - // register a package template (although it is not a template) to assure that the connectors - // get copied, although they are in a different resource (only the connectors are copied, not - // the types of the referenced parts). - // [main issue here: properties of container rule are not copies in the sense of identical - // copies] - - // copy.setPackageTemplate(smContainerRule.getBase_Class(), tmClass); - // copy.setPackageTemplate(null, null); - } - - protected boolean isOperationStereotypeApplied(java.lang.Class stereotype) { - for (Operation op : tmClass.getOwnedOperations()) { - if (StereotypeUtil.isApplied(op, stereotype)) { - return true; - } - } - return false; - } - - /** - * This container expansion does not create a new composite. Instead, it - * adds the extension as a part to the copied application component. The - * application component also inherits from the type of the container - * extension in order to avoid copying ports. - */ - Property expandAggregationExtension(String name, Class smContainerExtImpl, Class tmComponent) throws TransformationException { - Class tmContainerExtImpl = expandAggregationDep(smContainerExtImpl, tmComponent); - - // add part associated with the extension to the container - Property extensionPart = tmClass.createOwnedAttribute(name, tmContainerExtImpl); - - // problem: would not be unique in case of multiple extensions - // Copy.copyID(tmComponent, extensionPart, "a"); - extensionPart.setIsComposite(true); - - return extensionPart; - } - - Class expandAggregationDep(Class smContainerExtImpl, Class tmComponent) throws TransformationException { - Class tmContainerExtImpl = null; - - TemplateSignature signature = TemplateUtils.getSignature(smContainerExtImpl); - if (signature == null) { - // no template signature, just copy the container extension into the target model - tmContainerExtImpl = copier.getCopy(smContainerExtImpl); - } else { - // template signature found, instantiate container extension via the - // template binding mechanism - TemplateBinding binding = TemplateUtils.fixedBinding(copier.target, smContainerExtImpl, tmComponent); - Object[] args = new Object[] {}; - TemplateInstantiation ti = new TemplateInstantiation(copier, binding, args); - tmContainerExtImpl = ti.bindElement(smContainerExtImpl); - } - - return tmContainerExtImpl; - } - - /** - * Expand an interceptor definition between the container and the executor. - * Can be called several times with different interception operations (which will then be concatenated) - * - * @throws TransformationException - */ - EList expandInterceptorExtension(ContainerRule smContainerRule, Operation interceptionOperationInRule) - throws TransformationException - { - for (Operation smOperation : operations) { - Operation tmOperation = copier.getCopy(smOperation); - String interceptionBody = getBody(interceptionOperationInRule); - if (StereotypeUtil.isApplied(interceptionOperationInRule, Create.class) != - StereotypeUtil.isApplied(smOperation, Create.class)) { - // if the intercepting operation is a constructor, the intercepted operation must also be a constructor - continue; - } - if (StereotypeUtil.isApplied(interceptionOperationInRule, Destroy.class) != - StereotypeUtil.isApplied(smOperation, Destroy.class)) { - // if the intercepting operation is a destructor, the intercepted operation must also be a destructor - continue; - } - if (StereotypeUtil.isApplied(interceptionOperationInRule, Template.class)) { - // pass operation in source model, since this enables Xtend code to check - // for markers on model - interceptionBody = TextTemplateBinding.bind(interceptionBody, smOperation, null); - } - if (interceptionBody.length() > 0) { - // only add interception operation, if the interception is not empty - interceptionBody = "// --- interception code from rule <" + smContainerRule.getBase_Class().getName() + "> ---\n" + //$NON-NLS-1$ //$NON-NLS-2$ - interceptionBody; - Operation interceptionOpInClass = interceptionOpMap.get(tmOperation); - if (interceptionOpInClass == null) { - createInterceptionOperation(tmOperation); - // existing operation becomes interception operation (by assigning it a new behavior and moving its behavior to a new operation - interceptionOpInClass = tmOperation; - interceptionOpMap.put(tmOperation, interceptionOpInClass); - } - String newBody = interceptionBody + "\n" + //$NON-NLS-1$ - getBody(interceptionOpInClass); - setBody(interceptionOpInClass, newBody); - } - } - return null; - } - - public static String getBody(Operation op) { - for (Behavior behavior : op.getMethods()) { - if (behavior instanceof OpaqueBehavior) { - EList bodies = ((OpaqueBehavior) behavior).getBodies(); - if (bodies.size() > 0) { - // always take first - return bodies.get(0); - } - } - } - return ""; //$NON-NLS-1$ - } - - public static void setBody(Operation op, String body) { - for (Behavior behavior : op.getMethods()) { - if (behavior instanceof OpaqueBehavior) { - EList bodies = ((OpaqueBehavior) behavior).getBodies(); - if (bodies.size() > 0) { - // always take first - bodies.set(0, body); - break; - } - } - } - } - - // protected InstanceSpecification tmClassIS; - protected Class smClass; - - protected EList operations; - - protected Map interceptionOpMap; - - /** - * @see AbstractContainerTrafo.createContainerInstance - */ - @Override - public InstanceSpecification createContainerInstance(Class tmComponent, InstanceSpecification executorIS) throws TransformationException { - InstanceSpecification containerIS = executorIS; - // TODO ... incomplete! - // InstanceConfigurator.configureInstance(smContainerRule, containerIS, null, context); - - // now create instances for the contained elements - for (Property extensionPart : tmComponent.getAttributes()) { - Type tmContainerExtImpl = extensionPart.getType(); - if (tmContainerExtImpl instanceof Class) { - if (DepUtils.getSlot(executorIS, extensionPart) == null) { - // no slot for part exists => assume that the part has been added by the container and create an instance specification for it. - - InstanceSpecification containerExtIS = DepCreation.createDepPlan(tmCDP, (Class) tmContainerExtImpl, containerIS.getName() + "." + //$NON-NLS-1$ - extensionPart.getName(), false); - // configure extension - InstanceConfigurator.configureInstance(containerExtIS, extensionPart, null); - DepCreation.createSlot(containerIS, containerExtIS, extensionPart); - } - } - } - return containerIS; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/LazyCopier.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/LazyCopier.java deleted file mode 100644 index 9ce3514fce5..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/LazyCopier.java +++ /dev/null @@ -1,1044 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Stack; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.util.EcoreUtil.Copier; -import org.eclipse.emf.ecore.util.InternalEList; -import org.eclipse.emf.ecore.xmi.XMLResource; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.listeners.PostCopyListener; -import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Feature; -import org.eclipse.uml2.uml.LiteralBoolean; -import org.eclipse.uml2.uml.LiteralInteger; -import org.eclipse.uml2.uml.LiteralNull; -import org.eclipse.uml2.uml.LiteralString; -import org.eclipse.uml2.uml.LiteralUnlimitedNatural; -import org.eclipse.uml2.uml.MultiplicityElement; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Namespace; -import org.eclipse.uml2.uml.OpaqueExpression; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.Stereotype; -import org.eclipse.uml2.uml.ValueSpecification; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * A specific copier that enables to make iterative and shallow copies of model elements - * from a source to a target model. It also supports copy-listeners, i.e. listeners that - * might apply modifications before and after an element is copied. - * This class is very useful for model transformations that make a lazy copy of elements, - * i.e. copy only elements that are needed in the target model. - * - * Iterative means that you can copy one element after another, i.e. you do not need - * to copy all elements in a single call. - * Shallow means that some elements are incomplete copies. For instance, if you copy an - * attribute of a class into the target model, the copy routine will create the attribute within - * a shallow copy of the original class. The created class is a kind of shallow "container". It - * is required, since we can't create the attribute without having a class, but it would initially - * only contain the attribute that we copy. This class would have the same qualified name as the - * original, i.e. it would be created within shallow packages. - * A shallow copy can be transformed into a "real" copy - * by explicitly copying it. - * - */ -public class LazyCopier extends Copier { - - public enum CopyStatus { - /** - * The status is not known, in most cases this indicates that the object has not yet been copied. - */ - UNKNOWN, - - /** - * A full copy obtained via the copy function. Full means that the contained features have been completely - * copied - */ - FULL, - - /** - * A full copy in progress. Intermediate state of a target element after creation within the copy function, - * before all attributes & references have been copied. - */ - INPROGRESS, - - /** - * A shallow copy, i.e. a copy only containing a subset of the original element. These are typically containers - * for copied objects and avoids that the copies are not enclosed in an object. A shallow copy may become a full - * copy later on. - */ - SHALLOW - } - - /** - * - * @param source - * source package (root) - * @param target - * target package (root) - * @param copyExtResources_ - * copy elements that are not within the same resource instead of referencing them. - * @param copyID - * copyID true, if XML IDs should be copied as well. - */ - public LazyCopier(Package source, Package target, boolean copyExtResources_, boolean copyID) { - this.source = source; - this.target = target; - // useOriginalReferences = false; - copyExtReferences = copyExtResources_; - preCopyListeners = new BasicEList(); - postCopyListeners = new BasicEList(); - templateMapInfo = new HashMap>(); - standardMap = new HashMap(); - statusMap = new HashMap(); - boundPackages = new Stack(); - if (copyExtReferences) { - // original source package becomes a sub-package in the target model - Package newSourceRoot = target.createNestedPackage(source.getName()); - put(source, newSourceRoot); - setStatus(newSourceRoot, CopyStatus.SHALLOW); - } - else { - put(source, target); - setStatus(target, CopyStatus.SHALLOW); - } - this.copyID = copyID; - if (copyID) { - copyID(source, target); - } - }; - - /** - * - */ - private static final long serialVersionUID = -1664013545661635289L; - - /** - * Source model within a transformation - */ - - public Package source; - - /** - * Target model within a transformation - */ - public Package target; - - /** - * if true, copy packages or elements that are imported into the target - * model - */ - public boolean copyExtReferences; - - /** - * Bound package template - */ - protected Namespace boundPackage; - - /** - * Map to identify target objects when given source objects - */ - protected Map standardMap; - - /** - * Map to identify target objects when given source objects - */ - protected Map templateMap; - - /** - * Set of maps for template instantiations - */ - protected Map> templateMapInfo; - - /** - * Map using a target EObject as key - */ - protected Map statusMap; - - protected boolean copyID; - - /** - * Elements within package templates must be treated differently, we have to ensure that: - * (1) several instantiations with same binding of the same package template do not lead to double copies - * (yet, it may be possible that a 2nd instantiation adds contents, e.g. the trace package template could be - * instantiated containing only OTF trace (and superclasses), a second instantiation might add a different trace - * implementation) - * (2) several instantiations with different binding do not prevent classes from being copied that have already - * been copied earlier. - * The solution is to use a different map for the elements with package template. This map is instantiated once - * for each binding (managed by the TemplateInstantiation class) - */ - public Map getMap(EObject sourceEObj) { - boolean withinTemplate = withinTemplate(sourceEObj); - return withinTemplate ? - templateMap : - standardMap; - } - - @Override - public EObject get(Object sourceEObj) { - if (sourceEObj instanceof EObject) { - Map map = getMap((EObject) sourceEObj); - return map.get(sourceEObj); - } - return null; - } - - @Override - public EObject put(EObject sourceEObj, EObject targetEObj) { - if (sourceEObj instanceof EObject) { - Map map = getMap(sourceEObj); - return map.put(sourceEObj, targetEObj); - } - return null; - } - - /** - * Put a pair into the copy map. Unlike the standard put operation, - * the target object is marked as full copy. - * Just using the put operation lead to bug 422899 - [QDesigner] Regression in - * template instantiation - * - * @return - */ - public EObject putPair(EObject sourceEObj, EObject targetEObj) { - EObject target = put(sourceEObj, targetEObj); - setStatus(targetEObj, CopyStatus.FULL); - return target; - } - - @Override - public boolean containsKey(Object sourceEObj) { - if (sourceEObj instanceof EObject) { - Map map = getMap((EObject) sourceEObj); - return map.containsKey(sourceEObj); - } - return false; - } - - @Override - public EObject remove(Object sourceEObj) { - if (sourceEObj instanceof EObject) { - Map map = getMap((EObject) sourceEObj); - return map.remove(sourceEObj); - } - return null; - } - - /** - * Set the status of a copy object - * - * @param targetEObj - * @param status - */ - public void setStatus(EObject targetEObj, CopyStatus status) { - statusMap.put(targetEObj, status); - } - - /** - * return true, if a shallow copy of the passed EObject exists - * - * @param sourceEObj - * @return - */ - public CopyStatus getStatus(EObject targetEObj) { - if (targetEObj != null) { - CopyStatus status = statusMap.get(targetEObj); - if (status != null) { - return status; - } - } - return CopyStatus.UNKNOWN; - } - - /** - * Set the reference of a bound package template. It must be a member of the target model. - * Setting the package template is required to assure that elements that are part of a different - * resource get copied (if the copyExtReferences flag is set to false, copying would not be done otherwise) - * - * @param packageTemplate - * Reference to package (with a template signature) in source model that should be instantiated - * @param boundPackage - * Reference to (an initially empty) package in which the packate template will be instantiated - * during the copy process - */ - public void setPackageTemplate(Namespace packageTemplate, Namespace boundPackage) { - this.boundPackage = boundPackage; - if (packageTemplate == null) { - return; - } - templateMap = - templateMapInfo.get(boundPackage); - if (templateMap == null) { - templateMap = new HashMap(); - templateMapInfo.put(boundPackage, templateMap); - } - // declare relation between packageTemplate and bound package - // but: the owner of the package template is not equal to the packageTemplate (e.g. perClass) - // since we can extend package templates in different models. - standardMap.put(packageTemplate, boundPackage); - } - - public void pushPackageTemplate() { - boundPackages.push(boundPackage); - } - - public void popPackageTemplate() { - boundPackage = boundPackages.pop(); - templateMap = - templateMapInfo.get(boundPackage); - } - - private Stack boundPackages; - - /** - * Remove an element and its children from the map to enable subsequent copies, in particular if the - * same element (e.g. an operation) is bound multiple times within a template instantiation. - * TODO: there must be a better way to do this. - * - * @param element - */ - public void removeForCopy(EObject element) { - templateMap.remove(element); - if (element instanceof Element) { - // also remove applied stereotypes - for (EObject stereoApplication : ((Element) element).getStereotypeApplications()) { - removeForCopy(stereoApplication); - } - } - EClass eClass = element.eClass(); - for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i) - { - EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); - if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) - { - if (eStructuralFeature instanceof EAttribute) { - // copyAttribute((EAttribute)eStructuralFeature, sourceEObj, targetEObj); - } - else { - EReference eReference = (EReference) eStructuralFeature; - if (eReference.isContainment()) { - for (EObject ref : getRefs(eReference, element)) { - removeForCopy(ref); - } - } - else if (!eReference.isContainer()) { - // not contained, but copy reference as well - - } - } - } - } - } - - @SuppressWarnings("unchecked") - public EList getRefs(EReference eReference, EObject eObject) { - EList refs = new BasicEList(); - if (eObject.eIsSet(eReference)) { - if (eReference.isMany()) { - // @SuppressWarnings("unchecked") - refs.addAll((List) eObject.eGet(eReference)); - } else { - refs.add((EObject) eObject.eGet(eReference)); - } - } - return refs; - } - - /** - * Check whether the passed element (within the source model) is within a - * a template, i.e. one of is owners is mapped towards the bound package in - * the target model. Note that multiple owners in the source model may be - * mapped to the same bound package. - * - * @param element - * @return - */ - public boolean withinTemplate(EObject element) { - if (boundPackage != null) { - EObject owner = element; - if ((element.eContainer() == null) && - !(element instanceof Element)) { // has no eContainer and is not a UML element => likely to be a be a stereotype application. - // it is important not to call getBaseElement for all eobjects, since its execution can take - // quite a while (in particular, if not called on a stereotype application) - Element base = UMLUtil.getBaseElement(owner); - if (base != null) { - owner = base; // containment check is done with base element - } - } - while (owner != null) { - owner = owner.eContainer(); - if (get(owner) == boundPackage) { - return true; - } - } - } - return false; - } - - /** - * Returns a copy of the given eObject. - * - * Normally, we do not want to copy elements that are from a different - * resource. There are two exceptions (1) if this is explicitly specified - * (for producing "complete" models) (2) if we want to copy elements from a - * template into the target model. - * - * @param sourceEObj - * the object to copy. - * @return the copy. - */ - @SuppressWarnings("unchecked") - @Override - public EObject copy(EObject sourceEObj) { - if (sourceEObj == null) { - // this case may happen, if elements are systematically copied without checking for - // null references in the application code (e.g. if we copy a part-with-port which might - // be null in case of delegation or connectors without ports - return null; - } - - - EObject targetEObj = get(sourceEObj); - - CopyStatus status = getStatus(targetEObj); - - if (status == CopyStatus.FULL || status == CopyStatus.INPROGRESS) { - // copy already exists, return targetEObj - return targetEObj; - } - - boolean withinTemplate = withinTemplate(sourceEObj); - boolean sameResource = (sourceEObj.eResource() == source.eResource()); - if (!sameResource && !copyExtReferences && !withinTemplate) { - // do not copy if within different resource, unless - // 1. copyImports - // 2. within package template - return sourceEObj; - } - - if (sourceEObj instanceof Stereotype) { - // do not copy Stereotypes, as it would imply copying meta-model elements (the base_X - // attribute of the stereotype is typed with a meta-model element) - return sourceEObj; - } - - for (PreCopyListener listener : preCopyListeners) { - EObject result = listener.preCopyEObject(this, sourceEObj); - if (result != sourceEObj) { - return result; - } - } - - if (sourceEObj instanceof NamedElement) { - String name = ((NamedElement) sourceEObj).getQualifiedName(); - if ((name != null) && name.startsWith("uml::")) { //$NON-NLS-1$ - Log.log(IStatus.ERROR, Log.TRAFO_COPY, "copy for meta-model element \"" + name + //$NON-NLS-1$ - "\" requested. Return original element"); //$NON-NLS-1$ - return sourceEObj; - } - } - // additional sanity check: want to avoid copying (instead of instantiating) elements - // of a package template - if ((sourceEObj instanceof Package) && (!withinTemplate)) { - if (((Package) sourceEObj).getOwnedTemplateSignature() != null) { - Log.log(IStatus.WARNING, Log.TRAFO_COPY, "warning: copying a package template without instantiating a template"); //$NON-NLS-1$ - } - } - - if (status == CopyStatus.SHALLOW) { - // copy exists, but was a shallow copy, change status to INPROGRESS - setStatus(targetEObj, CopyStatus.INPROGRESS); - } - else { - targetEObj = createCopy(sourceEObj); - put(sourceEObj, targetEObj); - setStatus(targetEObj, CopyStatus.INPROGRESS); - if (copyID) { - copyID(sourceEObj, targetEObj); - } - // creates a shallow copy of the container. This container will update containment references (such as packagedElement) - // and thus update links - createShallowContainer(sourceEObj); - } - EClass eClass = sourceEObj.eClass(); - for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i) - { - EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); - if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) - { - if (eStructuralFeature instanceof EAttribute) { - copyAttribute((EAttribute) eStructuralFeature, sourceEObj, targetEObj); - } - else { - EReference eReference = (EReference) eStructuralFeature; - if (eReference.isContainment()) { - copyContainment(eReference, sourceEObj, targetEObj); - } - // some containment relationships require copying the container completely - // e.g. if an owned template signature is referenced, we need to follow the "template" - // reference, which subsets the "owner" relationship. - // e.g. if an operation is referenced, we need to copy the whole interface - // Currently: only the standard owning reference is not copied recursively. - - else if (!eReference.getName().equals("owner") && //$NON-NLS-1$ - (!eReference.getName().equals("owningInstance"))) { //$NON-NLS-1$ - Object feature = sourceEObj.eGet(eStructuralFeature); - if (feature instanceof Element) { - copy((Element) feature); - } else if (feature instanceof EList) { - copyAll((EList) feature); - } - copyReference(eReference, sourceEObj, targetEObj); - } - } - } - else if ((eStructuralFeature instanceof EReference)) { - if (eStructuralFeature.getName().equals("clientDependency")) { //$NON-NLS-1$ - Object feature = sourceEObj.eGet(eStructuralFeature); - - if (feature instanceof Element) { - copy((Element) feature); - } else if (feature instanceof EList) { - copyAll((EList) feature); - } - } - } - } - copyProxyURI(sourceEObj, targetEObj); - copyID(sourceEObj, targetEObj); - copyStereotypes(sourceEObj); - setStatus(targetEObj, CopyStatus.FULL); - - for (PostCopyListener listener : postCopyListeners) { - listener.postCopyEObject(this, targetEObj); - } - - return targetEObj; - } - - /** - * @param sourceEObj - * @return a copy, if it already exists. If it does not exist, return the - * source object itself, if no copy is required, otherwise return null. - */ - public EObject noCopy(EObject sourceEObj) { - boolean withinTemplate = withinTemplate(sourceEObj); - boolean sameResource = (sourceEObj.eResource() == source.eResource()); - if (!sameResource && !copyExtReferences && !withinTemplate) { - return sourceEObj; - } - else { - return get(sourceEObj); - } - } - - /** - * Copy stereotype applications. Since stereotype applications are not part of the containment of an eObject, they are not copied by the - * generic function. - * A problem of copying stereotypes is that it may drag whole hierarchies with it, for instance if we copy the base_ attributes, - * we transform a shallow copy into a normal copy. - * => always make shallow copies of packages, never shallow copies of classes? [the split into fragments is solved, but the split of the system component???] - */ - public void copyStereotypes(EObject sourceEObj, boolean duringShallow) { - if (sourceEObj instanceof Element) { - - for (EObject stereoApplication : ((Element) sourceEObj).getStereotypeApplications()) { - EObject copiedStereoApplication = (duringShallow) ? - shallowCopy(stereoApplication) : - copy(stereoApplication); - - if (copiedStereoApplication != null) { - // UMLUtil.setBaseElement(copiedStereoApplication, (Element) get(sourceEObj)); - // add copied stereotype application to the resource (as top-level objects). - if (!target.eResource().getContents().contains(copiedStereoApplication)) { - target.eResource().getContents().add(copiedStereoApplication); - } - } - } - } - } - - public void copyStereotypes(EObject sourceEObj) { - copyStereotypes(sourceEObj, false); - } - - public void shallowCopyStereotypes(EObject sourceEObj) { - copyStereotypes(sourceEObj, true); - } - - /** - * Copy the containment of an element with respect to a certain reference - * - * @see org.eclipse.emf.ecore.util.EcoreUtil.Copier#copyContainment(org.eclipse.emf.ecore.EReference, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject) - * Differences to referenced function in ECoreUtil - * - If an element in copyAll is null, it is not added - * - List elements are always cleared before copying, since the list elements may already have been - * partially filled by a previous shallow copy - * - * @param eReference - * a reference, such as for instance packagedElement (the - * caller needs to check, is this reference is a containment reference). - * @param eObject - * the source eObject - * @param copyEObject - * the copy of this eObject - */ - @Override - protected void copyContainment(EReference eReference, EObject eObject, EObject copyEObject) { - if (eObject.eIsSet(eReference)) { - if (eReference.isMany()) { - @SuppressWarnings("unchecked") - List source = (List) eObject.eGet(eReference); - @SuppressWarnings("unchecked") - List target = (List) copyEObject.eGet(getTarget(eReference)); - // do not clear (would remove elements that are added by copy listeners) - // But: better enforce exact copy? (listeners could only add in a post-copy step) - // target.clear(); - if (!source.isEmpty()) { - for (EObject copyEObj : copyAll(source)) { - if (copyEObj != null) { - target.add(copyEObj); - } - } - } - } else { - EObject childEObject = (EObject) eObject.eGet(eReference); - copyEObject.eSet(getTarget(eReference), childEObject == null ? null : copy(childEObject)); - } - } - } - - /** - * Copy the containment in a "shallow" way, i.e. copy references to contained objects, if these exist already. - * If called for instance for a package, it will add those elements to the packagedElements list of the - * target package, that have already been copied. - * - * @param eReference - * @param eObject - * @param copyEObject - */ - protected void shallowCopyContainment(EReference eReference, EObject eObject, EObject copyEObject) { - if (eObject.eIsSet(eReference)) { - if (eReference.isMany()) { - @SuppressWarnings("unchecked") - List source = (List) eObject.eGet(eReference); - @SuppressWarnings("unchecked") - List target = (List) copyEObject.eGet(getTarget(eReference)); - if (source.isEmpty()) { - target.clear(); - } else { - for (EObject sourceEObj : source) { - // if eObject has already been copied, add it to target - // don't add, if copyEObj is identical to sourceEObj. This would imply manipulating an - // element of the source model. - EObject copyEObj = noCopy(sourceEObj); - if ((copyEObj != null) && (copyEObj != sourceEObj) && (!target.contains(copyEObj))) { - try { - target.add(copyEObj); - } - catch (Exception e) { - System.err.println(e); - } - } - } - } - } else { - EObject childEObject = (EObject) eObject.eGet(eReference); - // get will return null, if object should not be copied. In this case, we do not want to replace - copyEObject.eSet(getTarget(eReference), childEObject == null ? null : noCopy(childEObject)); - } - } - } - - /** - * Create a "shallow" container for an object, i.e. create (recursively) the owner without - * adding all other children of this owner (e.g. in case of a package, the package itself will - * be created, but not all elements within that package). - * - * @param sourceEObj - */ - public void createShallowContainer(EObject sourceEObj) { - EObject owner = sourceEObj.eContainer(); - EObject copy = null; - EObject lastSource = null; - EList copyStereoList = new BasicEList(); - while (owner != null) { - if (containsKey(owner)) { - // owner is in map, still need to re-copy (update) the containment - // references, since one of the children did not exist before - // - shallowCopy(owner); - if (lastSource != null) { - // StUtils.copyStereotypes(this, (Element)lastSource, (Element)copy); - } - return; - // break; - } - copy = shallowCopy(owner); - // copyStereoList.add(sourceEObj); - owner = owner.eContainer(); - } - // copy the stereotypes after the container has been created completely - for (EObject copyStereo : copyStereoList) { - copyStereotypes(copyStereo); - } - if (copy instanceof PackageableElement) { - // if we copy external resources, we might reach the "top" on the source level - // which becomes a sub-package of the new model. - target.getPackagedElements().add((PackageableElement) copy); - } - } - - /** - * Make a shallow copy of an element, i.e. only create the element itself and not - * all of its contents. If a subset of the containing elements already exist in the copied - * model, update the containment references pointing to these. The function may be called - * multiple times in order to add elements to the containment references that - * have been copied since the previous call (i.e. it is possible to make a shallow copy - * of a package after a single class within it has been copied. It may be called again, - * once a second class within the package has been copied => the packagedElements reference - * of the package will be updated). - * - * It is important that the implementation of this object does not make recursive calls. - * In particular, stereotypes are based on shallow copy as well. This means that stereotype - * attributes that reference other model elements will only be initialized if these elements - * exist already. - * - * @param sourceEObj - * @return - */ - public EObject shallowCopy(EObject sourceEObj) { - boolean first = false; - EObject targetEObj = get(sourceEObj); - if (targetEObj == null) { - targetEObj = createCopy(sourceEObj); - put(sourceEObj, targetEObj); - setStatus(targetEObj, CopyStatus.SHALLOW); - if (copyID) { - copyID(sourceEObj, targetEObj); - } - first = true; - } - else if (getStatus(targetEObj) == CopyStatus.FULL) { - // object has already been completely copied. Nothing to do, return targetEObj. - // Note that this implies that the update of references below is called for full copies - // in progress and shallow copies. The former assures that all copied elements have an - // eContainer during the call of pre-copy listeners (example: if a class is copied, its - // operations are recursively copied, the ownedOperation relationship is only updated - // *afterwards* by the code within the (full) copy operation). - return targetEObj; - } - - shallowCopyStereotypes(sourceEObj); - - EClass eClass = sourceEObj.eClass(); - - for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i) { - EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); - if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) { - if (eStructuralFeature instanceof EAttribute) { - // copy all attributes during first pass after creation of target object - if (first) { - copyAttribute((EAttribute) eStructuralFeature, sourceEObj, targetEObj); - } - } else { - EReference eReference = (EReference) eStructuralFeature; - // create a shallow copy of the containment: update only references already in the copy map - if (sourceEObj != targetEObj) { - shallowCopyContainment(eReference, sourceEObj, targetEObj); - } - } - } - } - return targetEObj; - } - - @SuppressWarnings("unchecked") - public T getCopy(T source) { - return (T) copy(source); - } - - public EList preCopyListeners; - - public EList postCopyListeners; - - /** - * Called to handle the copying of a cross reference; - * this adds values or sets a single value as appropriate for the multiplicity - * while omitting any bidirectional reference that isn't in the copy map. - * - * @param eReference - * the reference to copy. - * @param eObject - * the object from which to copy. - * @param copyEObject - * the object to copy to. - */ - @Override - protected void copyReference(EReference eReference, EObject eObject, EObject copyEObject) - { - if (eObject.eIsSet(eReference)) { - if (eReference.isMany()) { - @SuppressWarnings("unchecked") - InternalEList source = (InternalEList) eObject.eGet(eReference); - @SuppressWarnings("unchecked") - InternalEList target = (InternalEList) copyEObject.eGet(getTarget(eReference)); - if (source.isEmpty()) { - target.clear(); - } - else { - boolean isBidirectional = eReference.getEOpposite() != null; - int index = 0; - for (Iterator k = resolveProxies ? source.iterator() : source.basicIterator(); k.hasNext();) { - EObject referencedEObject = k.next(); - EObject copyReferencedEObject = get(referencedEObject); - // check filters (modification compared to method in superclass) - boolean noCopy = false; - for (PreCopyListener listener : preCopyListeners) { - EObject result = listener.preCopyEObject(this, referencedEObject); - if (result != referencedEObject) { - copyReferencedEObject = result; - noCopy = (result == null); - break; - } - } - if (noCopy) { - continue; - } - if (copyReferencedEObject == null) { - if (useOriginalReferences && !isBidirectional) { - target.addUnique(index, referencedEObject); - ++index; - } - } - else { - if (isBidirectional) { - int position = target.indexOf(copyReferencedEObject); - if (position == -1) { - target.addUnique(index, copyReferencedEObject); - } - else if (index != position) { - target.move(index, copyReferencedEObject); - } - } - else if (!target.contains(copyReferencedEObject)) { - // TODO: does not allow multiple identical elements in the list. Problematic? - // Check above is necessary, since some references that are not - // part of the containment may have already been copied (e.g. in case of - // a TemplateSignature "ownedParameter" subsets "parameter", thus copying - // ownedParameter as part of the containment adds a template parameter) - target.addUnique(index, copyReferencedEObject); - } - ++index; - } - } - } - } - else { - Object referencedEObject = eObject.eGet(eReference, resolveProxies); - if (referencedEObject == null) { - copyEObject.eSet(getTarget(eReference), null); - } - else if (referencedEObject instanceof EObject) { - // difference to original code in EcoreUtil: we obtain a copy (which might be null or the - // source object) of the referenced EObject. This assures that we only set a value of a - // reference to something we actually want to have in the target model. - // Specific problematic case in original code: classifierBehavior is a reference, but assigning such - // a behavior will also add an owned behavior. If we assign a referencedEObject (a behavior) from the - // source model in the target, we will actually remove it from the source model (as it is uniquely owned). - EObject copyReferencedEObject = copy((EObject) referencedEObject); - if (copyReferencedEObject != null) { - copyEObject.eSet(getTarget(eReference), copyReferencedEObject); - } - } - } - } - } - - /** - * Copy all methods from the passed source-model class. - * This function is useful, if the passed class only exist - * as a shallow copy. - * - * @param source - * A class within the source model - */ - public void copyMethods(Class source) { - for (Behavior method : source.getOwnedBehaviors()) { - getCopy(method); - } - } - - /** - * Copy all attributes from the source-model classifier - * This function is useful, if the passed class only exist - * as a shallow copy. - * - * @param source - * A classifier within the source model - */ - public void copyAttributes(Classifier source) { - for (Property attribute : source.getAttributes()) { - getCopy(attribute); - } - } - - /** - * copy all operations from the source-model classifier. - * This function is useful, if the passed class only exist - * as a shallow copy. - * - * @param source - * A classifier within the source model - */ - public void copyOperations(Classifier source) { - for (Operation operation : source.getOperations()) { - getCopy(operation); - } - } - - // TODO: the functions that follow are static and should not be part of this class - // as they use a different way of copying things. - - - public static void copyFeatureModifiers(Feature source, Feature target) { - target.setIsStatic(source.isStatic()); - target.setIsLeaf(source.isLeaf()); - } - - public static void copyMultElemModifiers(MultiplicityElement source, MultiplicityElement target) { - target.setIsOrdered(source.isOrdered()); - target.setIsUnique(source.isUnique()); - target.setLower(source.getLower()); - target.setUpper(source.getUpper()); - } - - /** - * Copy a value to a target slot - * - * @param smValue - * @param target - * @return - */ - public static ValueSpecification copyValue(ValueSpecification value, Slot target) { - ValueSpecification newValue = target.createValue(value.getName(), value.getType(), value.eClass()); - return copyValue(value, newValue); - } - - public static ValueSpecification copyDefaultValue(Property source, Property target) { - ValueSpecification value = source.getDefaultValue(); - if (value != null) { - ValueSpecification newValue = target.createDefaultValue(value.getName(), value.getType(), value.eClass()); - return copyValue(value, newValue); - } else { - return null; - } - } - - public static ValueSpecification copyValue(ValueSpecification smValue, ValueSpecification tmValue) { - if (smValue instanceof OpaqueExpression) { - OpaqueExpression oeValue = (OpaqueExpression) smValue; - OpaqueExpression noeValue = (OpaqueExpression) tmValue; - for (String language : oeValue.getLanguages()) { - noeValue.getLanguages().add(language); - } - for (String body : oeValue.getBodies()) { - noeValue.getBodies().add(body); - } - } else if (smValue instanceof LiteralString) { - ((LiteralString) tmValue).setValue(((LiteralString) smValue).getValue()); - } else if (smValue instanceof LiteralInteger) { - ((LiteralInteger) tmValue).setValue(((LiteralInteger) smValue).getValue()); - } else if (smValue instanceof LiteralUnlimitedNatural) { - ((LiteralUnlimitedNatural) tmValue).setValue(((LiteralUnlimitedNatural) smValue).getValue()); - } else if (smValue instanceof LiteralBoolean) { - ((LiteralBoolean) tmValue).setValue(((LiteralBoolean) smValue).booleanValue()); - } else if (smValue instanceof LiteralNull) { - } - return tmValue; - } - - /** - * Copy the (XML) ID from the source to the destination model element. This - * is useful, if you want to create a diagram for (parts of) the generated - * target model. Otherwise, the IDs would change with each generation and - * references from the diagram to model elements would break (of course, - * they could still break, for instance if structural modifications of the - * source model are made). - * - * @param source - * source model element - * @param dest - * corresponding target model element - */ - public static void copyID(EObject source, EObject target) { - copyID(source, target, ""); //$NON-NLS-1$ - } - - /** - * Copy the (XML) ID from the source to the destination model element. - * Prefix the ID with a string passed as parameter - * - * @param source - * source model element - * @param dest - * corresponding target model element - * @param prefix - * a prefix for the target model ID - */ - @SuppressWarnings("deprecation") - public static void copyID(EObject source, EObject target, String prefix) { - Resource resourceSource = source.eResource(); - Resource resourceTarget = target.eResource(); - // TODO: use EcoreUtil getURI (InternalEObject) instead? - - if ((resourceSource instanceof XMLResource) && (resourceTarget instanceof XMLResource)) { - XMLResource xmlResSource = (XMLResource) resourceSource; - XMLResource xmlResTarget = (XMLResource) resourceTarget; - String id = prefix + xmlResSource.getID(source); - int counter = 0; - String uniqueID = id; - while (xmlResTarget.getIDToEObjectMap().containsKey(uniqueID)) { - uniqueID = id + counter; - counter++; - } - xmlResTarget.setID(target, uniqueID); - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/MainModelTrafo.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/MainModelTrafo.java deleted file mode 100644 index 96feae630a5..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/MainModelTrafo.java +++ /dev/null @@ -1,478 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -/** - * This file is part of Qompass GenTools - * Copyright (C) 2008 CEA LIST (http://www-list.cea.fr/) - - * initial developer : Christophe JOUVRAY from CEA LIST - * Major contributions: Ansgar Radermacher from CEA LIST - */ - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.ContainerRuleKind; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.FCM.util.FCMUtil; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.PortUtils; -import org.eclipse.papyrus.qompass.designer.core.StUtils; -import org.eclipse.papyrus.qompass.designer.core.UMLTool; -import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateInstantiation; -import org.eclipse.papyrus.qompass.designer.core.transformations.connector.ConnectorReification; -import org.eclipse.papyrus.qompass.designer.core.transformations.container.ContainerTrafo; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.EncapsulatedClassifier; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.InstanceValue; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.StructuralFeature; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.ValueSpecification; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * This class executes the main model transformation. It traverses the - * instances of a deployment plan in a recursive way and executes - * connector reification and container expansion. - */ -public class MainModelTrafo { - - - public static final String HW_COMP_PREFIX = "Hwc"; //$NON-NLS-1$ - - /** - * Create a new instance of main-model-transformation - * - * @param copy - * Copier - * @param tmCDP - * deployment plan in target model - */ - public MainModelTrafo(LazyCopier copy, Package tmCDP) { - nodeHandled = new HashMap(); - this.copy = copy; - this.tmCDP = tmCDP; - } - - /** - * Return an instance specification that corresponds to a part. This - * function is useful in the connector context, since it allows to retrieve - * the instance specification that is reference by a connection end-point - * (which points to the part). - * - * @param system - * the instance specification for the assembly - * @param part - * the part within a class - * @return The instance specification for the passed part - */ - public static InstanceSpecification getInstanceForPart( - InstanceSpecification system, Property part) { - for (Slot slot : system.getSlots()) { - if (slot.getDefiningFeature() == part) { - for (ValueSpecification value : slot.getValues()) { - // instances are accessible via ValueSpecification subclass - // InstanceValue - if (value instanceof InstanceValue) { - return (((InstanceValue) value).getInstance()); - } - } - } - } - return null; - } - - /** - * Find a port that would match a connection - * - * @param connectorType - * a connector type, i.e. a component with ports - * @param the - * port on the other side of the connection - * @return the first port (of all ports owned or inherited by the type) that - * is compatible with the passed otherPort. - */ - public static Port getConnectorPort(EncapsulatedClassifier connectorType, - Port otherPort, boolean isAssembly) { - EList ports = PortUtils.getAllPorts(connectorType); - // try to find match via kind - for (Port port : ports) { - if (PortUtils.matches(port, otherPort, isAssembly)) { - return port; - } - } - // no match found, try weaker condition: find 1st match for provided ... - boolean otherEndProvides = PortUtils.getProvided(otherPort) != null; - for (Port port : ports) { - Interface intf; - // if isAssembly: take "opposite" port - if (otherEndProvides != isAssembly) { - intf = PortUtils.getProvided(port); - } else { - intf = PortUtils.getRequired(port); - } - if (intf != null) { - return port; - } - } - return null; - } - - - /** - * This method performs a model transformation that replaces an Qompass - * connector by a property and a set of simple connectors. The type of the - * newly added connector must be instantiated from its template definition - * in order to adapt the connector to its context. This is done in a - * recursive manner on a compositeInstance. The result is a (composite) - * class which has the added connector. The function will also trigger - * container expansion, if necessary. Please note that we use the naming - * convention to prefix elements of the source model (wrt. to the - * transformation) with sm and elements of the target model with tm. - * - * @param smIS - * source model instance specification - * @param smDF - * source model defining feature (null for top-level instance). - * @param inheritedRules - * container rules inherited from containing composite - * @return new instance specification in traget model - * - * @throws TransformationException - */ - public InstanceSpecification transformInstance( - InstanceSpecification smIS, StructuralFeature smDF) throws TransformationException { - Class smComponent = null; - Classifier smCl = DepUtils.getClassifier(smIS); - if (smCl instanceof Class) { - smComponent = (Class) smCl; - } else { - // should not happen - return null; - } - - String instName = smIS.getName(); - // first check, if instance specification exists already. This may be the case for explicitly modeled singleton instances. - InstanceSpecification tmIS = (InstanceSpecification) - tmCDP.getPackagedElement(instName); - if (tmIS == null) { - tmIS = (InstanceSpecification) - tmCDP.createPackagedElement(instName, UMLPackage.eINSTANCE.getInstanceSpecification()); - } - if (smDF == null) { - // no defining feature => must be main instance - // => apply deployment plan stereotype and set main instance - DeploymentPlan newCDP = StereotypeUtil.applyApp(tmCDP, DeploymentPlan.class); - newCDP.setMainInstance(tmIS); - } - - Class tmComponent = copy.getCopy(smComponent); - if (tmComponent == null) { - return null; - } - tmIS.getClassifiers().add(tmComponent); - - // retrieve the component type object from the static profile (in order - // to process rules) - EList rules = FCMUtil.getAllContainerRules(smComponent); - - // get container trafo instance, if already existing - AbstractContainerTrafo containerTrafo = AbstractContainerTrafo.get(tmComponent); - - // general idea: an instance of class ContainerTafo is responsible for a specific component. - // the method createContainerInstance must be called for each instance of the application component - // (caveat: don't mix-up with instance of Java classes of the development tool) - // TODO: since we support multiple container kinds, we need to keep their container map separate! - InstanceSpecification containerIS = null; - if (containerTrafo == null) { - // no container exists, check rules and create eventually - for (ContainerRule rule : rules) { - if (RuleManagement.isRuleActive(rule)) { - // at least one active rule => create container (or get previously instantiated)) - if (containerTrafo == null) { - if (rule.getKind() == ContainerRuleKind.LIGHT_WEIGHT_OO_RULE) { - containerTrafo = new LWContainerTrafo(copy, tmCDP); - } - else { - containerTrafo = new ContainerTrafo(copy, tmCDP, tmIS); - } - containerTrafo.createContainer(smComponent, tmComponent); - } - else { - // configure only?? - } - containerTrafo.applyRule(rule, smComponent, tmComponent); - } - } - if (containerTrafo != null) { - containerTrafo.finalize(); - } - } - if (containerTrafo != null) { - // create instance of container. This is done after rule application, since - // elements that are added by the rules need to be instantiated as well. - // TODO: Cannot mix both rules. - containerIS = containerTrafo.createContainerInstance(tmComponent, tmIS); - } - // ------------------- end of container handling of SW nodes - - // copy node allocation - for (InstanceSpecification smNode : AllocUtils.getNodes(smIS)) { - InstanceSpecification tmNode = copy.getCopy(smNode); - if (containerIS != null) { - // allocate container instead of executor. - AllocUtils.allocate(containerIS, tmNode); - } - else { - AllocUtils.allocate(tmIS, tmNode); - } - - if (!nodeHandled.containsKey(tmNode)) { - // check if node (on an instance level) has already been treated. This is required, since many - // instances might be allocated to the same node. - nodeHandled.put(tmNode, true); - - // check, whether a container rule is applied on the tmNode - Classifier tmCS = DepUtils.getClassifier(tmNode); - if (tmCS instanceof Class) { - // --------------------------- - EList hwRules = FCMUtil.getAllContainerRules(tmCS); - - if (hwRules.size() > 0) { - - ContainerTrafo nodeContainerTrafo = (ContainerTrafo) AbstractContainerTrafo.get((Class) tmCS); - - // issues - // - unlike SW component container, don't update references pointing towards the HW node - // - create additional part in system (top-level) component for the node container - // - container (_cc class) appears in platform component (same package as HW node) - // - port copying and creation of delegation connectors does not make much sense, creation of - // executor itself does not make much sense, additional operation "createHwContainer" - - // obtain property related to node instance - Package smCDP = smIS.getNearestPackage(); - DeploymentPlan smFCM_CDP = UMLUtil.getStereotypeApplication(smCDP, DeploymentPlan.class); - - if (nodeContainerTrafo == null) { - // container does not exist, check rules and create eventually - for (ContainerRule rule : hwRules) { - if (RuleManagement.isRuleActive(rule)) { - if (nodeContainerTrafo == null) { - // at least one active rule => create container (or get previously instantiated)) - nodeContainerTrafo = new ContainerTrafo(copy, tmCDP, tmIS); - nodeContainerTrafo.createHwContainer((Class) tmCS); - nodeContainerTrafo.applyRule(rule, smComponent, tmComponent); - } - } - } - } - if (nodeContainerTrafo != null) { - InstanceSpecification hwContainerIS = - nodeContainerTrafo.createHwContainerInstance(tmComponent, tmNode); - // now add attribute in system (obtain via classifier of main instance in smCDP) - if (smFCM_CDP != null) { - InstanceSpecification smMI = smFCM_CDP.getMainInstance(); - Classifier smSystem = DepUtils.getClassifier(smMI); - Classifier tmSystem = copy.getCopy(smSystem); - InstanceSpecification tmMI = DepUtils.getInstanceForClassifier(tmCDP, tmSystem); - if (tmSystem instanceof Class) { - Property hwcPart = - ((Class) tmSystem).createOwnedAttribute(smNode.getName() + HW_COMP_PREFIX, nodeContainerTrafo.getContainer()); - // and now create a slot for the created instance. - DepPlanUtils.createSlot(tmCDP, tmMI, hwContainerIS, hwcPart); - } - - // now allocate instance - AllocUtils.allocate(hwContainerIS, tmNode); - } - } - } - } - } - } // ------------------- end of container handling of HW nodes - - - // reread instName (may have been changed by container transformation). - instName = tmIS.getName(); - - // copy parts, i.e. referenced slots - // loop on instances (instead of parts), since reification needs to be - // based on used implementations. - for (Slot slot : smIS.getSlots()) { - if (slot.getDefiningFeature() == null) { - throw new TransformationException( - String.format(Messages.MainModelTrafo_NoDefiningFeature, smIS.getName())); - } - StructuralFeature smPartDF = slot.getDefiningFeature(); - if (StereotypeUtil.isApplied(smPartDF.getType(), InteractionComponent.class)) { - if (smPartDF instanceof Property) { - Property tmPart = ConnectorReification.reifyConnector(copy, tmComponent, (Property) smPartDF, tmIS); - // update value specification (to the one just created) - Type type = tmPart.getType(); - InstanceSpecification tmPartIS = EcoreUtil.copy(DepUtils.getInstance(slot)); - tmCDP.getPackagedElements().add(tmPartIS); - if (type instanceof Classifier) { - if (tmPartIS.getClassifiers().size() > 0) { - tmPartIS.getClassifiers().set(0, (Classifier) type); - } - } - DepCreation.createSlot(tmIS, tmPartIS, tmPart); - } - } - else if (smPartDF.getType() instanceof Class) { - - InstanceSpecification smPartIS = DepUtils.getInstance(slot); - if (smPartIS == null) { - throw new TransformationException( - String.format(Messages.MainModelTrafo_NoInstanceAssociated, smPartDF.getName())); - } - - // recursive reification - // returned instance specification in target model is an instance specification for the part - // or for a container for that part. - InstanceSpecification tmPartIS = transformInstance(smPartIS, smPartDF); - // AllocUtils.propagateNodesViaPort (tmPartIS, null, AllocUtils.getNodes(containedInstance)); - - // retrieve part in the target model (it has been created during - // the copyClassifier operation before) - // TODO: avoid cast (use StructuralFeature instead) - Property tmPart = (Property) copy.getCopy(smPartDF); - - // check whether the instance specification has been modified - // (due to a container transformation) - // modification would not be required, if - if ((tmPartIS != null) && (DepUtils.getClassifier(tmPartIS) != tmPart.getType())) { - Log.log(IStatus.INFO, Log.TRAFO_CONNECTOR, String.format(Messages.MainModelTrafo_ChangePartType, tmPart.getName())); - tmPart.setType(DepUtils.getClassifier(tmPartIS)); - } - DepCreation.createSlot(tmIS, tmPartIS, tmPart); - } else { - // assume primitive type, copy slot values - // don't use "copy" to avoid duplicate entries (since not all instance specification created - // before are correctly inserted into the map of "copy"). - Slot tmSlot = EcoreUtil.copy(slot); - tmSlot.setDefiningFeature(copy.getCopy(slot.getDefiningFeature())); - tmIS.getSlots().add(tmSlot); - } - - } - - // NamedElement socket = Utils.getQualifiedElement(smComponent.getModel(), "SocketRuntime::Socket"); - // NamedElement socketCopy = copy.getCopy(socket); - - // loop on connectors - // TODO: check, if true (no instance specification exists for these - unlike a connector which is explicitly specified via a part) - // TODO: quite inefficient (and likely wrong), if same composite is instantiated several times (re-reification of connectors) - for (Connector smConnector : smComponent.getOwnedConnectors()) { - if (StUtils.isConnector(smConnector)) { - org.eclipse.papyrus.FCM.Connector fcmConn = StUtils.getConnector(smConnector); - if (fcmConn != null) { - // found an Qompass connector, connector type is specified. - // => Reify the connector within the target component, i.e. create a new part and - // additional connections for it. - Property connectorPart = ConnectorReification.reifyConnector(copy, tmComponent, - UMLTool.varName(smConnector), smConnector, tmIS); - - if (connectorPart == null) { - continue; - } - - // remove simple connector from composite in target model - Connector tmConnector = copy.getCopy(smConnector); - tmConnector.destroy(); - - // Now create an instance specification for the reified connector - InstanceSpecification tmReifiedConnectorIS = DepCreation.createDepPlan( - tmCDP, (Class) connectorPart.getType(), - instName + "." + smConnector.getName(), false); //$NON-NLS-1$ - - // copy slots from the source deployment plan that are related to connector configuration - InstanceSpecification smConnectorIS = DepUtils.getNamedSubInstance(smIS, smConnector.getName()); - if (smConnectorIS != null) { - // use putPair instead of put only - see bug 426748, avoid that classifier attribute points - // to two classifiers (bound and unbound) - copy.putPair(smConnectorIS, tmReifiedConnectorIS); - // problem: the defining feature of the slot points to the original connector which we don't - // want to copy (would have to be done in context of template binding) - TemplateInstantiation ti = new TemplateInstantiation(copy, ConnectorReification.binding); - for (Slot smSlot : smConnectorIS.getSlots()) { - ti.bindElement(smSlot); - } - } - - Slot partSlot = - DepCreation.createSlot(tmIS, tmReifiedConnectorIS, connectorPart); - - ConnectorReification.propagateNodeAllocation(tmComponent, tmIS, partSlot); - } - } - } - /* - * for(Property part : smComponent.getOwnedAttributes()) { - * Type type = part.getType(); - * if(type != null) { - * if(StereotypeUtil.isApplied(type, InteractionComponent.class)) { - * ConnectorReification.reifyConnector(copy, tmComponent, part, tmIS, null); - * } - * } - * } - */ - - // needs to be called independently - // propagateNodeAllocation (cdp, compositeInstance); - AllocTransfo at = new AllocTransfo(); - at.transformAllocs(copy, tmComponent); - - if (containerIS != null) { - // return containerIS - return containerIS; - } else { - return tmIS; - } - } - - protected Map nodeHandled; - - /** - * Copier from source to target model - */ - protected LazyCopier copy; - - /** - * deployment plan within target model - */ - protected Package tmCDP; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/PrefixConstants.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/PrefixConstants.java deleted file mode 100644 index 8cab7ddf4cf..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/PrefixConstants.java +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -/** - * A set of constants used for the CIF. In particular prefixes for the operations - * to access the implementation of a provided interface and connect a required interface - * - */ -public class PrefixConstants { - - public static String getP_Prefix = "get_"; //$NON-NLS-1$ - - public static String getConnQ_Prefix = ""; //$NON-NLS-1$ - - public static String connectQ_Prefix = "connect_"; //$NON-NLS-1$ - - public static String attributePrefix = ""; //$NON-NLS-1$ - - enum CIFvariant { - UML, CCM - }; - - /** - * Initialize a specific CIF variant - * - * TODO currently unused - * - * @param cif - * Which CIF variant should used? - */ - void init(CIFvariant cif) { - if (cif == CIFvariant.UML) { - getP_Prefix = "get_"; //$NON-NLS-1$ - getConnQ_Prefix = ""; //$NON-NLS-1$ - connectQ_Prefix = "connect_"; //$NON-NLS-1$ - attributePrefix = ""; //$NON-NLS-1$ - } else if (cif == CIFvariant.CCM) { - getP_Prefix = "get_"; //$NON-NLS-1$ - getConnQ_Prefix = "getconnection_"; //$NON-NLS-1$ - connectQ_Prefix = "connect_"; //$NON-NLS-1$ - attributePrefix = "m_"; //$NON-NLS-1$ - } - } -}; diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/RuleManagement.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/RuleManagement.java deleted file mode 100644 index 2692e06cb5a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/RuleManagement.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import org.eclipse.papyrus.FCM.ConfigOption; -import org.eclipse.papyrus.FCM.Configuration; -import org.eclipse.papyrus.FCM.ContainerRule; - -public class RuleManagement { - private static Configuration m_config; - - public static void setConfiguration(Configuration config) { - m_config = config; - } - - /** - * check whether a rule is active in a given configuration - * - * @param aRule - * @return - */ - public static boolean isRuleActive(ContainerRule rule) { - if (m_config != null) { - for (ConfigOption option : m_config.getConfigOptions()) { - if (rule.getForConfig().contains(option)) { - return true; - } - } - } - // not already true via specific configuration. - // => Also turn on rules by default that are not for a specific configuration option - return (rule.getForConfig().size() == 0); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TrafoAndCodegenPackage.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TrafoAndCodegenPackage.java deleted file mode 100644 index 569f3f17512..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TrafoAndCodegenPackage.java +++ /dev/null @@ -1,350 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import java.io.IOException; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.common.util.WrappedException; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.ContainerRuleKind; -import org.eclipse.papyrus.FCM.util.FCMUtil; -import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; -import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; -import org.eclipse.papyrus.codegen.extensionpoints.LanguageCodegen; -import org.eclipse.papyrus.codegen.extensionpoints.LanguageProjectSupport; -import org.eclipse.papyrus.qompass.designer.core.EnumService; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.ModelManagement; -import org.eclipse.papyrus.qompass.designer.core.StUtils; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.papyrus.qompass.designer.core.generate.GenerateCode; -import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FilterTemplate; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Model; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.Profile; - -/** - * This class executes all transformations during the instantiation of a - * deployment plan, i.e. - * 1. The reification of connectors (including template instantiation). This transformation targets a new model - * 2. Adding get_p/connect_q operations to a class (transformation within same model) - * 3. Remove all component types - * 4. distribute to nodes - * - * @author ansgar - * - */ -public class TrafoAndCodegenPackage { - - /** - * Iterate over source model and apply transformation - * - * @param copy - * @param pkg - * @throws TransformationException - */ - public static void applyTrafo(LazyCopier copy, Package pkg) throws TransformationException { - EList peList = new BasicEList(); - peList.addAll(pkg.getPackagedElements()); - for (PackageableElement element : peList) { - if (element instanceof Package) { - applyTrafo(copy, (Package) element); - } - else if (element instanceof Class) { - - Class smImplementation = (Class) element; - Class tmImplementation = copy.getCopy(smImplementation); - - // get container trafo instance, if already existing - AbstractContainerTrafo containerTrafo = AbstractContainerTrafo.get(tmImplementation); - - // we may not apply the transformation to the boot-loader itself, in particular it would transform - // singletons into pointers. - EList rules = FCMUtil.getAllContainerRules(smImplementation); - for (ContainerRule rule : rules) { - // if(RuleManagement.isRuleActive(rule)) { - // at least one active rule => create container (or get previously instantiated)) - if (rule.getKind() == ContainerRuleKind.LIGHT_WEIGHT_OO_RULE) { - if (containerTrafo == null) { - // container does not exist yet, create - containerTrafo = new LWContainerTrafo(copy, null); - containerTrafo.createContainer(smImplementation, tmImplementation); - } - containerTrafo.applyRule(rule, smImplementation, tmImplementation); - } - } - // } - } - } - } - - /** - * Instantiate a deployment plan, i.e. generate an intermediate model via a sequence of transformations - * - * @param cdpOrConfig - * a deployment plan (UML package) or a configuration (UML class) - * @param monitor - * a progress monitor. - * - * @param project - * the current project. This information is used to store the intermediate model in - * a subfolder (tmpModel) of the current project - * @param genOptions - * select whether to produce an intermediate model only, also code, ... @see GenerationOptions - */ - public static void instantiate(Element cdpOrConfig, IProgressMonitor monitor, IProject project) { - if (project == null) { - String projectName = cdpOrConfig.eResource().getURI().toString(); - project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); - } - Model tmpModel = null; - ModelManagement tmpMM = null; - - Package selectedPkg; - if (cdpOrConfig instanceof Package) { - selectedPkg = (Package) cdpOrConfig; - RuleManagement.setConfiguration(null); - } - else { - return; - } - - try { - EnumService.init(); - // Package copyCDP = dt.getCopyCDT (selectedCDP); - - // -- calc # of steps for progress monitor - // 1 (tmpModel creation) + 1 (reification) + 1 (tmpModel save) - // 5x on each deployed node (see below) - // problem? Connector reification is a single, relatively long step - int steps = 3; - - monitor.beginTask(Messages.InstantiateDepPlan_InfoGeneratingModel, steps); - if (monitor.isCanceled()) { - return; - } - - // 1a: create a new model (and applies same profiles / imports) - Model existingModel = selectedPkg.getModel(); - TransformationContext.sourceRoot = existingModel; - tmpMM = createTargetModel(existingModel, monitor, existingModel.getName(), true); - tmpModel = tmpMM.getModel(); - // Declare that the new model is a derivedElement (kind of hack, since the source - // element (attribute of derive element) remains undefined). This is used to - // de-activate automatic transformations that should not be applied to the generated - // model. - monitor.worked(1); - if (monitor.isCanceled()) { - return; - } - - // LateEval.clear(); - - EnumService.createEnumPackage(tmpModel); - - LazyCopier tmpCopy = new LazyCopier(existingModel, tmpModel, false, true); - tmpCopy.preCopyListeners.add(FilterTemplate.getInstance()); - - // 1b: reify the connectors "into" the new model - monitor.subTask(Messages.InstantiateDepPlan_InfoExpandingConnectors); - - // obtain reference to CDP in target model - - AbstractContainerTrafo.init(); - monitor.worked(1); - - // create recursive copy of selectedPackage - tmpCopy.getCopy(selectedPkg); - - // apply container transformation - applyTrafo(tmpCopy, selectedPkg); - - // 1c: late bindings - // LateEval.bindLateOperations(); - // 3: distribute to nodes - - String tmpPath = tmpMM.getPath(project, InstantiateDepPlan.TEMP_MODEL_FOLDER, tmpModel.getName() + InstantiateDepPlan.TEMP_MODEL_POSTFIX); - tmpMM.saveModel(tmpPath); - - String targetLanguage = DepUtils.getLanguageFromPackage(selectedPkg); - if (targetLanguage == null) { - targetLanguage = "C++"; //$NON-NLS-1$ - } - // genProject = project - ModelManagement genMM = tmpMM; - IProject genProject = project; - ILangProjectSupport projectSupport = LanguageProjectSupport.getProjectSupport(targetLanguage); - ILangCodegen codegen = LanguageCodegen.getGenerator(targetLanguage); - - GenerateCode codeGen = new GenerateCode(genProject, codegen, genMM, monitor); - codeGen.generate(null, targetLanguage, false); - - genMM.dispose(); - - if (monitor.isCanceled()) { - return; - } - monitor.worked(1); - - } catch (TransformationException te) { - // Get UI thread to show dialog - final TransformationException teFinal = te; - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - Shell shell = Display.getDefault().getActiveShell(); - MessageDialog.openError(shell, Messages.InstantiateDepPlan_TransformationException, teFinal.getMessage()); - } - }); - Log.log(IStatus.ERROR, Log.DEPLOYMENT, "", teFinal); //$NON-NLS-1$ - } catch (Exception e) { - final Exception eFinal = e; - e.printStackTrace(); - Display.getDefault().syncExec(new Runnable() { - - @Override - public void run() { - Shell shell = Display.getDefault().getActiveShell(); - String msg = eFinal.toString() + "\n\n" + //$NON-NLS-1$ - Messages.InstantiateDepPlan_ConsultConsole; - MessageDialog.openError(shell, Messages.InstantiateDepPlan_ErrorsDuringTransformation, msg); - } - }); - Log.log(IStatus.ERROR, Log.DEPLOYMENT, "", e); //$NON-NLS-1$ - } - if (tmpMM != null) { - tmpMM.dispose(); - } - } - - - /** - * Create a new empty model from an existing model that applies the same - * profiles and has the same imports - * - * @param existingModel - * @return - */ - public static ModelManagement createTargetModel(Model existingModel, IProgressMonitor monitor, String name, boolean copyImports) throws TransformationException { - ModelManagement mm = new ModelManagement(); - Model newModel = mm.getModel(); - newModel.setName(name); - - try { - // copy profile application - for (Profile profile : existingModel.getAppliedProfiles()) { - // reload profile in resource of new model - monitor.subTask(Messages.InstantiateDepPlan_InfoApplyProfile + profile.getQualifiedName()); - - if (profile.eResource() == null) { - String profileName = profile.getQualifiedName(); - if (profileName == null) { - if (profile instanceof MinimalEObjectImpl.Container) { - URI uri = ((MinimalEObjectImpl.Container) profile).eProxyURI(); - if (uri != null) { - throw new TransformationException(String.format(Messages.InstantiateDepPlan_CheckInputModelProfileNoRes, uri)); - } - } - throw new TransformationException(Messages.InstantiateDepPlan_CheckInputModelProfileNoResNoName); - } - throw new TransformationException(String.format(Messages.InstantiateDepPlan_CheckInputModelProfile3, profileName)); - } - - Resource profileResource = null; - try { - profileResource = ModelManagement.getResourceSet().getResource(profile.eResource().getURI(), true); - } catch (WrappedException e) { - // read 2nd time (some diagnostic errors are raised only once) - Log.log(IStatus.WARNING, Log.DEPLOYMENT, "Warning: exception in profile.eResource() " + e.getMessage()); //$NON-NLS-1$ - profileResource = ModelManagement.getResourceSet().getResource(profile.eResource().getURI(), true); - } - Profile newProfileTop = (Profile) profileResource.getContents().get(0); - Profile newProfile; - String qname = profile.getQualifiedName(); - if ((qname != null) && qname.contains("::")) { //$NON-NLS-1$ - // profile is a sub-profile within same resource - // TODO: should Copy class copy profile applications? - // Should be handled in shallowContainer class. - // if we put profile/newProfile pair into copy map, copy would find (and copy profile - // applications in sub-folders - qname = qname.substring(qname.indexOf("::") + 2); //$NON-NLS-1$ - newProfile = (Profile) Utils.getQualifiedElement(newProfileTop, qname); - } - else { - newProfile = newProfileTop; - } - newProfile.getMember("dummy"); // force profile loading //$NON-NLS-1$ - newModel.applyProfile(newProfile); - } - } catch (IllegalArgumentException e) { - throw new TransformationException(Messages.InstantiateDepPlan_IllegalArgumentDuringCopy + e.toString()); - } - - // copy imports (and load resources associated - TODO: might not be necessary) - // While this is useful in general, it implies that code for imported models - // has been generated and compiled (for the right target) into a library. This may be - // quite tedious, unless automatically managed. - // Therefore we do not activate this option in a first pass of the model transformations. - if (copyImports) { - for (Package importedPackage : existingModel.getImportedPackages()) { - if (importedPackage == null) { - throw new TransformationException(Messages.InstantiateDepPlan_CheckInputImportPkg); - } - if (importedPackage.eResource() == null) { - String errorMsg = Messages.InstantiateDepPlan_CheckInputImportPkgNoRes; - if (importedPackage instanceof MinimalEObjectImpl.Container) { - URI uri = ((MinimalEObjectImpl.Container) importedPackage).eProxyURI(); - if (uri != null) { - errorMsg += " - URI: " + uri.devicePath(); //$NON-NLS-1$ - } - } - throw new TransformationException(errorMsg); - } - newModel.createPackageImport(importedPackage); - monitor.subTask(String.format(Messages.InstantiateDepPlan_InfoImportPackage, importedPackage.getName())); - - try { - importedPackage.eResource().load(null); - newModel.getMember("dummy"); // force loading of model //$NON-NLS-1$ - } catch (IOException e) { - throw new TransformationException(e.getMessage()); - } - - } - } - - StUtils.copyStereotypes(existingModel, newModel); - - return mm; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationContext.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationContext.java deleted file mode 100644 index 81f1b2a6bea..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationContext.java +++ /dev/null @@ -1,106 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateInstantiation; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.TemplateBinding; - -/** - * Return information about the current values in the context of a transformation - * e.g. the current instance, the current port (container transformation), ... - * - * TODO: clean separation ContainerContext? (e.g. port should only be in the latter) - * - * @author ansgar - * - */ -public class TransformationContext { - - public static InstanceSpecification instance; - - public static InstanceSpecification getInstance() { - return instance; - } - - public static Port port; - - public static Port getPort() { - return port; - } - - public static Package sourceRoot; - - public static Package getSourceRoot() { - return sourceRoot; - } - - public static LazyCopier copier; - - public static LazyCopier getCopier() { - return copier; - }; - - public static Classifier formalParameter; - - public static Classifier getFormalParameter() { - return formalParameter; - } - - // the element, to which transformations are currently applied. - public static Classifier classifier; - - public static Classifier getClassifier() { - return classifier; - } - - /** - * Set sat and binding context for pkgTemplateParameter function - * - * @param sat - * @param binding - */ - public static void setTemplateInstantiation(TemplateInstantiation ti) { - TransformationContext.ti = ti; - } - - public static TemplateInstantiation ti; - - /** - * Return actual (in the current binding context) from a named package template parameter - * Used during template instantiation: code can access actual template parameter via formal - * - * @param formal - * the name of the formal parameter - * @return the actual - */ - public static String pkgTemplateParameter(String formal) { - Classifier actual = TemplateUtils.getActualFromBinding(ti.binding, formal); - if (actual != null) { - return actual.getQualifiedName(); - } - else { - return ""; //$NON-NLS-1$ - } - } - - public static TemplateBinding getBinding() { - return ti.binding; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationException.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationException.java deleted file mode 100644 index b0331d9e98a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationException.java +++ /dev/null @@ -1,28 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -/** - * Main exception class that is used to represent errors during model transformations - */ -public class TransformationException extends Exception { - - public TransformationException(String reason) { - super(reason); - } - - // String m_reason; - final static long serialVersionUID = 1234; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationRTException.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationRTException.java deleted file mode 100644 index 776cd6b3239..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationRTException.java +++ /dev/null @@ -1,33 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -/** - * Variant of the transformation exception that extends RuntimeException. This - * is sometimes useful, since it avoids to declare exceptions specifically - * - */ -public class TransformationRTException extends RuntimeException { - - public TransformationRTException(String reason) { - super(reason); - } - - /** - * - */ - private static final long serialVersionUID = 1235L; - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationUtil.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationUtil.java deleted file mode 100644 index d696183686e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationUtil.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.papyrus.qompass.designer.core.extensions.InstanceConfigurator; -import org.eclipse.papyrus.qompass.designer.core.sync.CompImplSync; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; - -public class TransformationUtil { - public static void applyInstanceConfigurators(InstanceSpecification instance) { - for (Slot slot : instance.getSlots()) { - InstanceSpecification subInstance = DepUtils.getInstance(slot); - if (!DepUtils.isShared(slot) && (subInstance != null)) { - if (slot.getDefiningFeature() instanceof Property) { - InstanceConfigurator.configureInstance(subInstance, (Property) slot.getDefiningFeature(), instance); - } - applyInstanceConfigurators(subInstance); - } - } - } - - public static void propagateAllocation(InstanceSpecification instance) { - propagateAllocation(instance, new UniqueEList()); - } - - public static void propagateAllocation(InstanceSpecification instance, EList nodes) { - // create copy of node (otherwise, more and more nodes get aggregated. - UniqueEList nodesCopy = new UniqueEList(); - nodesCopy.addAll(nodes); - nodesCopy.addAll(AllocUtils.getNodes(instance)); - for (Slot slot : instance.getSlots()) { - InstanceSpecification subInstance = DepUtils.getInstance(slot); - if (subInstance != null) { - if (DepUtils.isShared(slot)) { - for (InstanceSpecification node : nodesCopy) { - Log.log(IStatus.INFO, Log.DEPLOYMENT, String.format("Propagate node allocation: %s to %s", subInstance.getName(), node.getName())); //$NON-NLS-1$ - AllocUtils.allocate(subInstance, node); - } - } - else { - propagateAllocation(subInstance, nodesCopy); - } - } - } - } - - /** - * Update derived interfaces of ports. This is required, since the Copier does not follow references - * that are referenced via a derived attribute. Derived attributes are used for provided and required - * interfaces in the stereotype attributes of an FCM port. Thus, required (derived) interfaces would be - * unavailable in the copy, if not explicitly updated. - * However, the provided interface is not concerned as it appears in an "implements" relation. If the - * port is connected, the used interface of one port is the provided interface of the port counter part. - * Thus, the explicit update done by this function is not needed in most cases. - * - * see also FixTemplateSync (remove the latter?) - */ - public static void updateDerivedInterfaces(InstanceSpecification instance) { - Classifier cl = DepUtils.getClassifier(instance); - if (cl instanceof Class) { - Class implementation = (Class) cl; - CompImplSync.updatePorts(implementation); - CompImplSync.syncRealizations(implementation); - } - for (Slot slot : instance.getSlots()) { - InstanceSpecification subInstance = DepUtils.getInstance(slot); - if (!DepUtils.isShared(slot) && (subInstance != null)) { - updateDerivedInterfaces(subInstance); - } - } - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/UpdateUtils.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/UpdateUtils.java deleted file mode 100644 index cdf8175be25..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/UpdateUtils.java +++ /dev/null @@ -1,84 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations; - -import java.util.Iterator; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Utility functions for the update derived elements, e.g. operations of a component - * that depend on the operations of an interface that is offered by the component. - */ -public class UpdateUtils { - - public static EList getDerivedElements(Package pkg, NamedElement source) { - EList list = new BasicEList(); - Iterator members = pkg.getOwnedMembers().iterator(); - while (members.hasNext()) { - NamedElement member = members.next(); - if (getSource(member) == source) { - list.add(member); - } - if (member instanceof Package) { - EList subList = getDerivedElements((Package) member, source); - list.addAll(subList); - } - } - return list; - } - - public static Element getDerivedElement(EList list, Element source) { - Iterator elements = list.iterator(); - while (elements.hasNext()) { - Element element = elements.next(); - if (StereotypeUtil.isApplied(element, DerivedElement.class)) { - DerivedElement de = UMLUtil.getStereotypeApplication(element, DerivedElement.class); - if ((de != null) && (de.getSource() == source)) { - return element; - } - } - } - return null; - } - - public static void setSource(Element derivedElement, Element source) { - DerivedElement de = StereotypeUtil.applyApp(derivedElement, DerivedElement.class); - if (de != null) { - de.setSource(source); - } - else { - throw new TransformationRTException(Messages.UpdateUtils_CannotApplyFCMstereo); - } - } - - public static Element getSource(Element element) { - if (StereotypeUtil.isApplied(element, DerivedElement.class)) { - DerivedElement de = UMLUtil.getStereotypeApplication(element, DerivedElement.class); - if (de != null) { - return de.getSource(); - } - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/connector/ConnectorReification.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/connector/ConnectorReification.java deleted file mode 100644 index 14511d3627f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/connector/ConnectorReification.java +++ /dev/null @@ -1,400 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations.connector; - -/** - * This file is part of Qompass GenTools - * Copyright (C) 2008 CEA LIST (http://www-list.cea.fr/) - - * initial developer : Christophe JOUVRAY from CEA LIST - * Major contributions: Ansgar Radermacher from CEA LIST - */ - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.infra.core.Activator; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.PortUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.papyrus.qompass.designer.core.templates.ConnectorBinding; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateInstantiation; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.ConnectableElement; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.ConnectorEnd; -import org.eclipse.uml2.uml.EncapsulatedClassifier; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * This class enables the reification of connectors, i.e. the replacement of - * a UML connector with an interaction component. Reification is primarily - * done on the level of a composite class, the - */ -public class ConnectorReification { - - /** - * Find a port that would match a connection - * - * @param connectorType - * a connector type, i.e. a component with ports - * @param the - * port on the other side of the connection - * @return the first port (of all ports owned or inherited by the type) that - * is compatible with the passed otherPort. - */ - public static Port getConnectorPort(EncapsulatedClassifier connectorType, - Port otherPort, boolean isAssembly) { - EList ports = PortUtils.getAllPorts(connectorType); - // try to find matching port - for (Port port : ports) { - if (PortUtils.isCompatible(port, otherPort, isAssembly)) { - return port; - } - } - throw new RuntimeException(String.format(Messages.ConnectorReification_CannotFindMatchingPort, - connectorType.getName(), otherPort.getQualifiedName())); - } - - /** - * Reify a connector already represented in form of a part (useful for n-ary connectors) - * - * @param copier - * a lazy copier - * @param tmComponent - * containing composite in target target model - * @param smConnectorPart - * Part representing the connector - * @param tmIS - * target instance specification of the composite passed as 2nd parameter - * (required for obtaining node allocation and choosing the right implementation. - * Main use: decide whether a distributed implementation of an interaction component needs to be used) - * @return The created part within tmComponent that represents the reified - * connector - * @throws TransformationException - */ - public static Property reifyConnector(LazyCopier copier, Class tmComponent, - Property smConnectorPart, InstanceSpecification tmIS) - throws TransformationException { - - if (!(smConnectorPart.getType() instanceof Class)) { - // can not happen since caller checks whether type is stereotyped as ConnectorComp - // which extends class - Log.log(IStatus.ERROR, Log.TRAFO_CONNECTOR, Messages.ConnectorReification_TemplateTypeNotClass); - return null; - } - // choose an implementation - Class connectorImplemTemplate = DepUtils.chooseImplementation( - (Class) smConnectorPart.getType(), AllocUtils.getAllNodes(tmIS), null); - - TemplateBinding binding = ConnectorBinding.obtainBinding(tmComponent, - smConnectorPart, connectorImplemTemplate, true); - Class connectorImplem; - - if (binding != null) { - TemplateUtils.adaptActualsToTargetModel(copier, binding); - TemplateInstantiation ti = new TemplateInstantiation(copier, binding); - connectorImplem = ti.bindElement(connectorImplemTemplate); - } else { - // no binding, class is not a template => copy as it is - connectorImplem = copier.getCopy(connectorImplemTemplate); - } - Property tmConnectorPart = copier.getCopy(smConnectorPart); - tmConnectorPart.setType(connectorImplem); - // now re-target connectors towards this part - TemplateUtils.retargetConnectors(tmComponent, tmConnectorPart); - return tmConnectorPart; - } - - /** - * Reify a connector - * - * @param copier - * The coper from source to target mode - * @param tmComponent - * containing composite in target target - * @param name - * name of the connector - * @param smConnector - * connector element within the source model - * @param tmIS - * target instance specification of the composite passed as 2nd parameter - * (required for obtaining node allocation and choosing the right implementation. - * Main use: decide whether a distributed implementation of an interaction component needs to be used) - * @return the created part within tmComponent - * @throws TransformationException - */ - public static Property reifyConnector(LazyCopier copier, Class tmComponent, - String name, Connector smConnector, InstanceSpecification tmIS) - throws TransformationException { - - org.eclipse.papyrus.FCM.Connector fcmConn = UMLUtil.getStereotypeApplication(smConnector, org.eclipse.papyrus.FCM.Connector.class); - - InteractionComponent connType = fcmConn.getIc(); - if (connType == null) { - return null; - } - - // choose an implementation - Class connectorImplemTemplate = DepUtils.chooseImplementation(connType.getBase_Class(), AllocUtils.getAllNodes(tmIS), null); - - // ---- obtain binding & instantiate template type ... - binding = ConnectorBinding.obtainBinding(tmComponent, - smConnector, connectorImplemTemplate, true); - Class connectorImplem; - - if (binding != null) { - TemplateUtils.adaptActualsToTargetModel(copier, binding); - // make copy of bound package and restore it later. Required for nested template instantiations, in particular - // the bound package is set within container transformations and is (by default) restored to "null" afterwards. - // TODO: TemplateInstantiation should do this automatically - copier.pushPackageTemplate(); - TemplateInstantiation ti = new TemplateInstantiation(copier, binding); - connectorImplem = ti.bindElement(connectorImplemTemplate); - copier.popPackageTemplate(); - } else { - // no binding, class is not a template => copy as it is - connectorImplem = copier.getCopy(connectorImplemTemplate); - } - - if (connectorImplem == null) { - throw new TransformationException( - String.format(Messages.ConnectorReification_CouldNotBind, connectorImplemTemplate.getName())); - } - - Property tmConnectorPart = tmComponent.createOwnedAttribute(name, connectorImplemTemplate); - // copy id, but prefix it with "p" (for part) - LazyCopier.copyID(smConnector, tmConnectorPart, "p"); //$NON-NLS-1$ - tmConnectorPart.setIsComposite(true); - - Log.log(IStatus.INFO, Log.TRAFO_CONNECTOR, - String.format(Messages.ConnectorReification_InfoAddConnectorPart, - connectorImplemTemplate.getName(), connectorImplem.getName())); - - // now create (simple) connections towards the new part - int i = 0; - for (ConnectorEnd smEnd : smConnector.getEnds()) { - Connector tmConnector = tmComponent.createOwnedConnector("c " //$NON-NLS-1$ - + name + " " + String.valueOf(i)); //$NON-NLS-1$ - LazyCopier.copyID(smConnector, tmConnector); - i++; - // the new connector connects the existing end with an end of the - // reified connector (the newly created property.) - - // --- first end, connected with the existing end (of another non-connector part) - ConnectorEnd tmEnd1 = tmConnector.createEnd(); - Property smPartWithPort = smEnd.getPartWithPort(); - Property tmPartWithPort = copier.getCopy(smPartWithPort); - ConnectableElement smRole = smEnd.getRole(); - ConnectableElement tmRole = copier.getCopy(smRole); - tmEnd1.setPartWithPort(tmPartWithPort); - tmEnd1.setRole(tmRole); - - // --- 2nd end, connected with the reified connector (new part) - ConnectorEnd tmEnd2 = tmConnector.createEnd(); - tmEnd2.setPartWithPort(tmConnectorPart); - // inheritance between connector type and implementation (ports should be identical) - // TODO: check whether filter condition is unique? (first returned by getConnectorPort is "good" one) - if (tmRole instanceof Port) { - tmEnd2.setRole(getConnectorPort(connectorImplem, (Port) tmRole, (tmPartWithPort != null))); - } else { - throw new TransformationException( - Messages.ConnectorReification_RequiresUseOfPorts); - } - } - - tmConnectorPart.setType(connectorImplem); - // updatePorts(tmComponent, connectorPart, connectorImplem); - // connectContainerPorts(tmComponent, connectorPart); - - return tmConnectorPart; - } - - public static TemplateBinding binding; - - /** - * Simple helper function - * - * @param part - * @param connection - * @return the connector end that is associated with the "other" end of a - * connection, i.e. the end that is not connected with the part - * passed as parameter. - */ - public static ConnectorEnd oppositeConnEnd(Connector connection, - ConnectorEnd myEnd) { - // look for the other end (connectedEnd != myEnd) - for (ConnectorEnd end : connection.getEnds()) { - if (end != myEnd) { - return end; - } - } - return null; - } - - /** - * Components can contain additional ports that are inherited via the - * container extension. These ports should typically be connected with - * additional ports of the (reified) connector. This connection is based on - * equal port types and is done automatically by this function, i.e. it - * cannot be done by the developer. - * - * @param composite - * the composite in which a connector has been reified. - * @param reifiedConnector - * the part associated with the reifiedConnector - */ - static void connectContainerPorts(Class composite, Property reifiedConnector) { - // This function is based on the assumption that the additional ports of the reified - // connector need to be connected with a port of a component that is already - // connected via the "normal" connectors (explicitly modeled by the user). - // For instance, in case of ACCORD-calls, the server component provides the additional - // RTU port via its container. - - // Create a subset of connectors that are connected with the reified connector - EList connSubset = new BasicEList(); - for (Connector connector : composite.getOwnedConnectors()) { - if (ConnectorUtil.connectsPart(connector, reifiedConnector)) { - connSubset.add(connector); - } - } - - for (Port port : PortUtils.getAllPorts((Class) reifiedConnector - .getType())) { - // check, if port is unconnected. - boolean connected = false; - // check whether a port of the reified connector is not yet - // connected. - for (Connector connector : connSubset) { - if (ConnectorUtil.connectsPort(connector, port)) { - connected = true; - } - } - if (!connected) { - // port is not connected yet. Check to find a connectable port - // among all ports of connected parts. - // In the moment, we assume the processes is stopped, as soon as - // the port is connected, i.e. we do not want to connect the port to - // potentially set of ports (todo: restriction always useful?) - for (Connector connector : connSubset) { - ConnectorEnd connEnd = ConnectorUtil.connEndNotPart( - connector, reifiedConnector); - Property otherPart = connEnd.getPartWithPort(); - // this is a part which is connected with the reified - // connector check whether one of its ports is compatible with the - // non-connected port. - if (!(otherPart.getType() instanceof EncapsulatedClassifier)) { - continue; - } - - for (Port otherPort : PortUtils.getAllPorts((EncapsulatedClassifier) otherPart.getType())) { - Log.log(IStatus.INFO, Log.TRAFO_CONNECTOR, String.format( - Messages.ConnectorReification_InfoPortTypes, - otherPort.getType().getQualifiedName(), - port.getType().getQualifiedName())); - if (otherPort.getType() == port.getType()) { - Connector newConnector = composite.createOwnedConnector("connector - container of " //$NON-NLS-1$ - + otherPart.getName()); - ConnectorEnd end1 = newConnector.createEnd(); - ConnectorEnd end2 = newConnector.createEnd(); - end1.setPartWithPort(reifiedConnector); - end1.setRole(port); - end2.setPartWithPort(otherPart); - end2.setRole(otherPort); - connected = true; - break; - } - } - if (connected) { - break; - } - } - if (!connected) { - if (port.getType() == null) { - Activator.log.debug( - String.format(Messages.ConnectorReification_CouldNotConnectPort, port.getName())); - } else { - Activator.log.debug( - String.format(Messages.ConnectorReification_CouldNotConnectPortOfType, port.getName(), port.getType().getName())); - } - } - } - } - } - - /** - * Propagate node allocation into a reified connector (identified via its part) - * - * The allocation algorithm works as follows. - * - get a connector (simple) originating from the passed part - * - get the opposite end of this simple connector and identify the connected part - * (other part, e.g. a part typed with an application component) - * - obtain the nodes to which this other part is allocated: - * - in case of a composite, connections are followed up to a monolithic component - * - propagate the node allocation into the connector (propagation will finally - * allocate leafs within a (composite) connector. - * - * @param composite - * the composite class (e.g. system) in which a connector is reified - * @param compositeIS - * the associated instance specification - * @param partSlot - * the slot associated with the part for which nodes are - * allocated. - */ - public static void propagateNodeAllocation(Class composite, - InstanceSpecification compositeIS, Slot partSlot) { - Property part = (Property) partSlot.getDefiningFeature(); - - // loop over connectors of composite that originate from passed part. - for (Connector connector : composite.getOwnedConnectors()) { - ConnectorEnd myEnd = ConnectorUtil.connEndForPart(connector, part); - if (myEnd == null) { - // the connector does not connect this part - continue; - } - ConnectorEnd otherEnd = ConnectorUtil.connEndNotPart(connector, - part); - - Property otherPart = otherEnd.getPartWithPort(); - Port otherPort = (Port) otherEnd.getRole(); - // Property myPart = myEnd.getPartWithPort(); - Port myPort = (Port) myEnd.getRole(); - - // find instance that is associated with other part. - for (Slot slot : compositeIS.getSlots()) { - if (slot.getDefiningFeature() == otherPart) { - InstanceSpecification containedInstance = DepUtils.getInstance(slot); - EList nodes = AllocUtils.getAllNodesForPort(containedInstance, otherPort); - AllocUtils.propagateNodesViaPort( - DepUtils.getInstance(partSlot), myPort, nodes); - break; - } - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/container/ContainerTrafo.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/container/ContainerTrafo.java deleted file mode 100644 index 927dee07143..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/container/ContainerTrafo.java +++ /dev/null @@ -1,770 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations.container; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.papyrus.FCM.BindTemplate; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.ContainerRuleKind; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.FCM.InterceptionKind; -import org.eclipse.papyrus.FCM.InterceptionRule; -import org.eclipse.papyrus.FCM.Singleton; -import org.eclipse.papyrus.FCM.util.FCMUtil; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.papyrus.qompass.designer.core.Messages; -import org.eclipse.papyrus.qompass.designer.core.PortUtils; -import org.eclipse.papyrus.qompass.designer.core.StUtils; -import org.eclipse.papyrus.qompass.designer.core.UMLTool; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateInstantiation; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; -import org.eclipse.papyrus.qompass.designer.core.transformations.AbstractContainerTrafo; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.RuleManagement; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.qompass.designer.core.transformations.connector.ConnectorReification; -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Association; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.ConnectorEnd; -import org.eclipse.uml2.uml.EncapsulatedClassifier; -import org.eclipse.uml2.uml.Feature; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.TemplateParameter; -import org.eclipse.uml2.uml.TemplateSignature; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.ValueSpecification; -import org.eclipse.uml2.uml.VisibilityKind; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Make the container transformation, i.e. add elements into a container - * - */ -public class ContainerTrafo extends AbstractContainerTrafo { - - public static final String executorPartName = "_executor"; //$NON-NLS-1$ - - public static final String interceptorName = "intercept "; //$NON-NLS-1$ - - public static final String containerPostfix = "_cc"; //$NON-NLS-1$ - - public static final String hwContainerPostfix = "_hwcc"; //$NON-NLS-1$ - - /** - * Constructor - * - * @param sat - * information about source and target model - * @param tmCDP - * deployment plan within target model - */ - public ContainerTrafo(LazyCopier copier, Package tmCDP, InstanceSpecification executorIS) { - this.copier = copier; - this.tmCDP = tmCDP; - this.executorIS = executorIS; - portInfo = new HashMap(); - } - - /** - * creates the executor. Needs to be called *before* the other operations of - * this class. - * - * @param tmComponent - * the implementation of a component - * - * @throws TransformationException - */ - @Override - public void createContainer(Class smComponent, Class tmComponent) throws TransformationException { - Package tmPkgOwner; - if (tmComponent.eResource() == tmCDP.eResource()) { - // tmComponent is in same model as tmContainer - tmPkgOwner = tmComponent.getNearestPackage(); - } - else { - // tmComponent is not a member of the target model. This is the case, if tmComponent is - // in an imported model that has not been copied during the transformation towards an intermediate - // model. - tmPkgOwner = MapUtil.getAndCreate(PackageUtil.getRootPackage(tmCDP), tmComponent.allNamespaces(), true); - } - // create a container with the suitable postfix - tmContainerImpl = tmPkgOwner.createOwnedClass(tmComponent.getName() + containerPostfix, false); - - // Apply singleton to container, if original class is a singleton - boolean isSingleton = StereotypeUtil.isApplied(smComponent, Singleton.class); - if (isSingleton) { - StereotypeUtil.apply(tmContainerImpl, Singleton.class); - } - LazyCopier.copyID(tmComponent, tmContainerImpl, containerPostfix); - - // add part and slot corresponding to component; - executorPart = tmContainerImpl.createOwnedAttribute(executorPartName, tmComponent); - LazyCopier.copyID(tmComponent, executorPart, "e"); //$NON-NLS-1$ - - executorPart.setIsComposite(true); - - // copy ports from the executor (tmComponent) to the container - // (tmContainerImpl) - // TODO: connectors still point to the ports of the executor, implying a non-well-formed - // model. Yet code generation works, as port names are identical - for (Port port : PortUtils.getAllPorts(tmComponent)) { - // copy port - if (port.getVisibility() == VisibilityKind.PUBLIC_LITERAL) { - Port newPort = EcoreUtil.copy(port); // don't use Qompass copy, since this is not a copy from source to target model - tmContainerImpl.getOwnedAttributes().add(newPort); - StUtils.copyStereotypes(port, newPort); - - // create delegation for application port - Connector containerDelegation = tmContainerImpl.createOwnedConnector("delegation " + port.getName()); //$NON-NLS-1$ - LazyCopier.copyID(tmContainerImpl, containerDelegation); - ConnectorEnd end1 = containerDelegation.createEnd(); - end1.setRole(newPort); - ConnectorEnd end2 = containerDelegation.createEnd(); - end2.setPartWithPort(executorPart); - end2.setRole(port); - } - } - - // Inheritance issues: - // currently: container never copies inheritance relationships, but copies inherited ports into container - // Problem: polymorphism would stop working. - // Objective: use inheritance, if possible, but avoid that container inherits from an original non-abstract class (avoid duplication of attributes, ...) - // Option: container inherits from fully abstract super-classes (might have to consider indirect super-classes). - // All connectors and container extension remain within container (i.e. no inheritance of connectors and container extensions) - // Remaining problems: Imagine that component A inherits from component B and both have state-charts. - // => containers of A and B would define a state-Machine and an event pool. - // => No shared pool (but anyway: semantics of this construct is not very clear). - containers.put(tmComponent, this); - } - - /** - * Create a container for a HW class. This is an additional software class - * within the system. There is no executor part, i.e. executorPart remains - * - * @param tmComponent - * the implementation of a component - * - * @throws TransformationException - */ - public void createHwContainer(Class tmComponent) throws TransformationException { - Package tmPkgOwner = (Package) tmComponent.getOwner(); - tmContainerImpl = tmPkgOwner.createOwnedClass(tmComponent.getName() + hwContainerPostfix, false); - LazyCopier.copyID(tmComponent, tmContainerImpl, hwContainerPostfix); - - // register created container - containers.put(tmComponent, this); - } - - /** - * Create an instance of the container (UML instance specification) - * - * @param tmComponent - * the component within the target model for which we want to create an instance - * - * @param tmIS - * the existing instance specification for the component before container expansion. This - * instance specification becomes the new instance specification of the executor. - * @param context - * Additional information about the container that is used by instance configurators - */ - @Override - public InstanceSpecification createContainerInstance(Class tmComponent, InstanceSpecification tmIS) throws TransformationException { - // create an instance specification for the container - InstanceSpecification containerIS = - (InstanceSpecification) tmCDP.createPackagedElement(tmIS.getName(), UMLPackage.eINSTANCE.getInstanceSpecification()); - // assign new name to original instance specification which reflects - // role within containment hierarchy - tmIS.setName(tmIS.getName() + "." + executorPartName); //$NON-NLS-1$ - containerIS.getClassifiers().add(tmContainerImpl); - // existing instance specification (tmIS) is the executor instance specification - DepCreation.createSlot(containerIS, tmIS, executorPart); - counter = 0; - // containers.put(tmComponent, this); - EList connectorSlots = new BasicEList(); - - executorIS = tmIS; - // now create instances for the contained elements - for (Property extensionPart : tmContainerImpl.getAttributes()) { - Type tmContainerExtImpl = extensionPart.getType(); - if (tmContainerExtImpl instanceof Class) { - if (DepUtils.getSlot(containerIS, extensionPart) == null) { - // no slot for part exists => assume that the part has been added by the container and create an instance specification for it. - InstanceSpecification containerExtIS = null; - - String isName = containerIS.getName() + "." + extensionPart.getName(); //$NON-NLS-1$ - - // create sub-instance and slot for extensions - if (containerExtIS == null) { - containerExtIS = DepCreation.createDepPlan(tmCDP, (Class) tmContainerExtImpl, isName, false); - } - Slot partSlot = DepCreation.createSlot(containerIS, containerExtIS, extensionPart); - if (StereotypeUtil.isApplied(tmContainerExtImpl, InteractionComponent.class)) { - connectorSlots.add(partSlot); - } - } - } - } - - // handle propagation of node allocation for connectors. Do that in 2nd loop, since the allocation - // of parts might be incomplete before. - for (Slot connectorSlot : connectorSlots) { - ConnectorReification.propagateNodeAllocation(tmContainerImpl, containerIS, connectorSlot); - } - moveSlots(executorIS); - return containerIS; - } - - /** - * Create an instance of the container (UML instance specification) - * - * @param tmComponent - * @param tmIS - */ - public InstanceSpecification createHwContainerInstance(Class tmComponent, InstanceSpecification tmNode) { - // create an instance specification for the container - InstanceSpecification containerIS = - (InstanceSpecification) tmCDP.createPackagedElement(tmNode.getName() + hwContainerPostfix, UMLPackage.eINSTANCE.getInstanceSpecification()); - // assign new name to original instance specification which reflects - // role within containment hierarchy - containerIS.getClassifiers().add(tmContainerImpl); - // containers.put(tmComponent, this); - counter = 0; - executorIS = tmNode; - // copy slots from HW instance specification - for (Slot slot : tmNode.getSlots()) { - Slot slotCopy = containerIS.createSlot(); - slotCopy.setDefiningFeature(slot.getDefiningFeature()); - // copy values (use CopyTo.copyTo(slot, containerIS) instead?) - for (ValueSpecification value : slot.getValues()) { - LazyCopier.copyValue(value, slotCopy); - } - } - return containerIS; - } - - /** - * return the reference of the created container class - * - * @return - */ - public Class getContainer() { - return tmContainerImpl; - } - - /** - * apply a container rule, i.e. add either a container extension or an - * interceptor to the container - * - * @param smContainerRule - * An container rule - * @param smComponent - * the application component in the source model - * @param tmComponent - * the application component in the target model - * @param tmIS - * the instance specification for the application component in the target model - * @throws TransformationException - */ - @Override - public void applyRule(ContainerRule smContainerRule, Class smComponent, Class tmComponent) - throws TransformationException - { - Map> interceptorPartsMap = new HashMap>(); - - for (Property part : smContainerRule.getBase_Class().getAllAttributes()) { - Type type = part.getType(); - if (type == null) { - String ruleName = (smContainerRule.getBase_Class() != null) ? smContainerRule.getBase_Class().getName() : "undefined"; //$NON-NLS-1$ - throw new TransformationException(String.format( - Messages.ContainerTrafo_CannotApplyRule, ruleName)); - } - if (part instanceof Port) { - Port newPort = tmContainerImpl.createOwnedPort(part.getName(), part.getType()); - StUtils.copyStereotypes(part, newPort); - } - else if (type instanceof Class) { - Class extOrInterceptor = (Class) type; - // DepUtils.chooseImplementation((Class) type, - // new BasicEList(), false); - - if (StereotypeUtil.isApplied(part, InterceptionRule.class)) { - if (StereotypeUtil.isApplied(extOrInterceptor, InteractionComponent.class)) { - - InterceptionRule interceptionRule = UMLUtil.getStereotypeApplication(part, InterceptionRule.class); - InterceptionKind interceptionKind = interceptionRule.getInterceptionKind(); - EList interceptFeatures = interceptionRule.getInterceptionSet(); - EList interceptorParts = - expandInterceptorExtension(interceptionKind, interceptFeatures, extOrInterceptor, tmComponent); - interceptorPartsMap.put(part, interceptorParts); - } - else { - throw new TransformationException(String.format( - Messages.ContainerTrafo_InterceptionRuleButNoInterceptor, - part.getName(), smContainerRule.getBase_Class().getName())); - } - } - else { - Property extensionPart = - expandAggregationExtension(part, extOrInterceptor, tmComponent); - // register relation to facilitate connector copy - copier.setPackageTemplate(smContainerRule.getBase_Class(), tmContainerImpl); - copier.putPair(part, extensionPart); - copier.setPackageTemplate(null, null); - } - } - } - createConnectorForAssociations(); - - // tell copier that tmcontainerImpl is associated with the smContainerRule - // register a package template (although it is not a template) to assure that the connectors - // get copied, although they are in a different resource (only the connectors are copied, not - // the types of the referenced parts). - // [main issue here: properties of container rule are not copies in the sense of identical - // copies] - copier.setPackageTemplate(smContainerRule.getBase_Class(), tmContainerImpl); - - for (Connector connector : smContainerRule.getBase_Class().getOwnedConnectors()) { - Property ruleInterceptorPart = null; - for (Property part : interceptorPartsMap.keySet()) { - if (ConnectorUtil.connectsPart(connector, part)) { - // this connector is a connection between an interceptor (and another part which may not - // be an interceptor => TODO: validation rule yet to write - // we need to copy this connector multiple times, once for each associated interceptor part - ruleInterceptorPart = part; - break; - } - } - if (ruleInterceptorPart != null) { - for (Property interceptorPart : interceptorPartsMap.get(ruleInterceptorPart)) { - // map an interceptor part within rule successively to to an interceptor part - // within the container - copier.putPair(ruleInterceptorPart, interceptorPart); - copier.removeForCopy(connector); - copier.getCopy(connector); - } - } - else { - // check whether FCM connector - org.eclipse.papyrus.FCM.Connector fcmConn = StUtils.getConnector(connector); - if (fcmConn != null) { - ConnectorReification.reifyConnector(copier, tmContainerImpl, - UMLTool.varName(connector), connector, executorIS); - } - else { - copier.remove(connector); - copier.getCopy(connector); - } - } - } - copier.setPackageTemplate(null, null); - - TemplateUtils.retargetConnectors(tmContainerImpl); - } - - /** - * This container expansion does not create a new composite. Instead, it - * adds the extension as a part to the copied application component. The - * application component also inherits from the type of the container - * extension in order to avoid copying ports. - */ - Property expandAggregationExtension(Property smExtensionPart, Class smContainerExtImpl, Class tmComponent) throws TransformationException { - Property extensionPart; - String name = smExtensionPart.getName(); - Class tmContainerExtImpl = null; - - TemplateSignature signature = TemplateUtils.getSignature(smContainerExtImpl); - if (signature == null) { - // no template signature, just copy the container extension into the target model - tmContainerExtImpl = copier.getCopy(smContainerExtImpl); - } - else { - // template signature found, instantiate container extension via template binding mechanism - Classifier actual; - if (StereotypeUtil.isApplied(smExtensionPart, BindTemplate.class)) { - BindTemplate bt = UMLUtil.getStereotypeApplication(smExtensionPart, BindTemplate.class); - // use explicit binding from stereotype - actual = (Classifier) bt.getActual().get(0); - } - else { - // use executor component as actual - actual = tmComponent; - } - // template signature and instantiate container extension via the - // template binding mechanism, use executor component as actual - TemplateBinding binding = TemplateUtils.fixedBinding(copier.target, smContainerExtImpl, actual); - TemplateInstantiation ti = new TemplateInstantiation(copier, binding); - tmContainerExtImpl = ti.bindElement(smContainerExtImpl); - } - - // -------------------------------------------------- - // a container extension could be subject to container rules as well, i.e. need - // to handle recursive rule application. - EList rules = FCMUtil.getAllContainerRules(smContainerExtImpl); - - // get container trafo instance, if already existing - AbstractContainerTrafo containerTrafo = AbstractContainerTrafo.get(tmContainerExtImpl); - - if (containerTrafo == null) { - // no container exists, check rules and create eventually - for (ContainerRule rule : rules) { - if (RuleManagement.isRuleActive(rule)) { - // at least one active rule => create container (or get previously instantiated)) - if (containerTrafo == null) { - if (rule.getKind() == ContainerRuleKind.LIGHT_WEIGHT_OO_RULE) { - throw new TransformationException(Messages.ContainerTrafo_RecursiveLWnotSupported); - } - else { - containerTrafo = new ContainerTrafo(copier, tmCDP, null); - } - containerTrafo.createContainer(smContainerExtImpl, tmContainerExtImpl); - } - else { - // configure only?? - } - containerTrafo.applyRule(rule, smContainerExtImpl, tmContainerExtImpl); - } - } - if (containerTrafo != null) { - containerTrafo.finalize(); - tmContainerExtImpl = ((ContainerTrafo) containerTrafo).getContainer(); - } - } - // -------------------------------------------------- - - // add part associated with the extension to the container - extensionPart = tmContainerImpl.createOwnedAttribute(name, tmContainerExtImpl); - - // Copy.copyID(tmComponent, extensionPart, "a"); - extensionPart.setAggregation(smExtensionPart.getAggregation()); - LazyCopier.copyMultElemModifiers(smExtensionPart, extensionPart); - LazyCopier.copyFeatureModifiers(smExtensionPart, extensionPart); - - return extensionPart; - } - - /** - * Expand an interceptor definition between the container and the executor. - * - * @param extKind - * the interception kind (intercept which ports: all, some, out, ...) - * @param featureList - * The set of ports to intercept (In case of "some" above) - * @param smContainerConnImpl - * The connector (interceptor) implementation in the source model - * @param tmComponent - * the application component (executor) in the target model - * @return - * @throws TransformationException - */ - EList expandInterceptorExtension(InterceptionKind extKind, EList featureList, Class smContainerConnImpl, Class tmComponent) - throws TransformationException - { - EList connectorParts = new BasicEList(); - // replace delegation connectors with extension connector - for (Port port : PortUtils.getAllPorts(tmComponent)) { - // delegate to component via connector - boolean match = true; - if (extKind == InterceptionKind.INTERCEPT_ALL_IN) { - // IN-PORT = provided port - match = (PortUtils.getProvided(port) != null); - } - else if (extKind == InterceptionKind.INTERCEPT_ALL_OUT) { - // IN-PORT = provided port - match = (PortUtils.getRequired(port) != null); - } - else if (extKind == InterceptionKind.INTERCEPT_SOME) { - // comparison based on name, since in different models - match = (Utils.getNamedElementFromList(featureList, port.getName()) != null); - } - else if (extKind == InterceptionKind.INTERCEPT_MATCHING) { - EList interceptorPorts = PortUtils.getAllPorts(smContainerConnImpl); - match = false; - // get first port from interception connector that is typed with a template parameter - for (Port interceptorPort : interceptorPorts) { - if (interceptorPort.getType().getOwner() instanceof TemplateParameter) { - match = (PortUtils.getKind(port) == PortUtils.getKind(interceptorPort)); - break; - } - } - } - - // else INTERCEPT_ALL_PORT => match remains true - if (!match) { - // port does not match criterion, continue with next port - continue; - } - - Property connectorPart; - String interceptionName = interceptorName + port.getName() + counter; - Connector interceptionConnector = null; - // get delegation connector - for (Connector connector : tmContainerImpl.getOwnedConnectors()) { - if (ConnectorUtil.connectsPort(connector, port)) { - interceptionConnector = connector; - break; - } - } - // interceptionConnector = tmContainerImpl.getOwnedConnector - // ("delegation " + port.getName ()); - if (interceptionConnector == null) { - throw new TransformationException(Messages.ContainerTrafo_CannotFindDelegationConn); - } - - interceptionConnector.setName(interceptionName); - org.eclipse.papyrus.FCM.Connector fcmConn = StereotypeUtil.applyApp(interceptionConnector, org.eclipse.papyrus.FCM.Connector.class); - InteractionComponent fcmConnType = UMLUtil.getStereotypeApplication(smContainerConnImpl, InteractionComponent.class); - fcmConn.setIc(fcmConnType); - - // pass target component and port to interceptor (not clean, define - // suitable template signature as for instance in methodCall_comp - TransformationContext.instance = executorIS; - TransformationContext.port = port; - connectorPart = ConnectorReification.reifyConnector(copier, tmContainerImpl, UMLTool.varName(interceptionConnector), interceptionConnector, executorIS); - connectorParts.add(connectorPart); - TransformationContext.port = null; - portInfo.put(connectorPart, port); - // delete intermediate connector (has been replaced by two - // connections to the reified connector) - interceptionConnector.destroy(); - } - counter++; - return connectorParts; - } - - /** - * Move a slot from the executor instance specification to an instance - * specification of an extension/interceptor. This is required, since - * users cannot configure containers directly. The modification is done in - * the target model, i.e. the user model is not affected. - * - * Configuration is based on the idea that we can have multiple classifiers for an - * instance specification and that we add additional slots for attributes of the 2nd - * classifier which becomes "visible" after container transformation. - * Main use: configure priority of thread within container. - * - * TODO: Not clear, whether we should keep this operation, since configuration of elements that are not - * (directly) part of the user model is confusing. Application was: configuration - * of thread priorities within container. - */ - public void moveSlots(InstanceSpecification containerIS) { - // Log.log(Status.INFO, Log.TRAFO_CONTAINER, String.format(Messages.ContainerTrafo_InfoMoveSlots, executorIS.getQualifiedName())); - Classifier mainCl = DepUtils.getClassifier(executorIS); - Iterator slotIt = executorIS.getSlots().iterator(); - while (slotIt.hasNext()) { - Slot slot = slotIt.next(); - String featureName = slot.getDefiningFeature().getName(); - if (!mainCl.getAllAttributes().contains(slot.getDefiningFeature())) { - // defining feature does not belong to main classifier - // => move it to first matching instance specification - for (InstanceSpecification is : DepUtils.getContainedInstances(containerIS)) { - Classifier containedCl = DepUtils.getClassifier(is); - if (Utils.getNamedElementFromList(containedCl.getAllAttributes(), featureName) != null) { - if (executorIS != is) { - // remove slot first from iterator, as addition below removes it from the list (slots are owned) - slotIt.remove(); - is.getSlots().add(slot); - break; - } - } - } - } - } - } - - /** - * Create an connector for parts that have an association. The rationale - * behind this is support connections between the state machine in the container - * and the executor. - * - */ - public void createConnectorForAssociations() { - // TODO: keep list of added parts, only re-check those! - - for (Property part : Utils.getParts(tmContainerImpl)) { - if (part.getType() == null) { - continue; - } - for (Association association : part.getType().getAssociations()) { - // Part has an association. Check if the other association end - // targets one of - // other parts within the container - for (Property end : association.getMemberEnds()) { - Type type = end.getType(); - if ((type != null) && (type != part.getType())) { - // end is not typed with the part we are currently - // examining - // thus, it might belong to another part of the - // composite - for (Property checkPart : Utils.getParts(tmContainerImpl)) { - if (type == checkPart.getType()) { - // found an association between two parts of the - // container => create connection, - // unless already existing. - if (!ConnectorUtil.existsConnector(tmContainerImpl, part, checkPart)) { - Connector conn = tmContainerImpl.createOwnedConnector(part.getName() + "_" + checkPart.getName()); //$NON-NLS-1$ - conn.setType(association); - conn.createEnd().setRole(part); - conn.createEnd().setRole(checkPart); - } - } - } - } - } - } - } - } - - @Override - public void finalize() { - discoverServices(); - } - - /** - * Connector ports of executor with compatible ports offered by container extensions - * (runtime system) - */ - public void discoverServices() { - Type executorType = executorPart.getType(); - if (!(executorType instanceof EncapsulatedClassifier)) { - return; - } - EncapsulatedClassifier ec = (EncapsulatedClassifier) executorType; - for (Port executorPort : ec.getOwnedPorts()) { - for (Property svcPart : tmContainerImpl.getOwnedAttributes()) { - if (svcPart == executorPart) { - continue; - } - Type containerSvcType = svcPart.getType(); - if (containerSvcType instanceof EncapsulatedClassifier) { - EncapsulatedClassifier containerSvc = (EncapsulatedClassifier) containerSvcType; - for (Port svcPort : containerSvc.getOwnedPorts()) { - if (PortUtils.matches(executorPort, svcPort, true)) { - // create connector - Connector c = tmContainerImpl.createOwnedConnector( - String.format("auto from %s to %s", executorPart.getName(), svcPart.getName())); //$NON-NLS-1$ - ConnectorEnd ce1 = c.createEnd(); - ConnectorEnd ce2 = c.createEnd(); - ce1.setPartWithPort(executorPart); - ce1.setRole(executorPort); - ce2.setPartWithPort(svcPart); - ce2.setRole(svcPort); - } - } - } - } - } - } - - /** - * Return the containerTrafo associated with a container. This operation is useful for instance - * configurators that need more information about the container context, in particular to associate - * a part with a port that is intercepted. - * - * @param containerInstance - * the container instance (the parent instance of an instance of a container extension)ight be a container instance) - * @return the containerTrafo info, if found. - */ - public static ContainerTrafo getContainerTrafo(InstanceSpecification containerInstance) { - Classifier containerCandidate = DepUtils.getClassifier(containerInstance); - Property executorPart = containerCandidate.getAttribute(executorPartName, null); - if ((executorPart != null) && executorPart.getType() instanceof Class) { - AbstractContainerTrafo containerTrafo = AbstractContainerTrafo.get((Class) executorPart.getType()); - if (containerTrafo instanceof ContainerTrafo) { - return (ContainerTrafo) containerTrafo; - } - } - return null; - } - - /** - * Utility function to retrieve the executor slot, when given the container instance. - * Needs to be called, after a container instance has been created. - * - * @param containerInstance - * the instance of a container specification - * @return the associated executor slot, or null, if it cannot be found - */ - public static Slot getExecutorSlot(InstanceSpecification containerInstance) { - for (Slot slot : containerInstance.getSlots()) { - if (slot.getDefiningFeature().getName().equals(ContainerTrafo.executorPartName)) { - return slot; - } - } - return null; - } - - /** - * Return the port that is intercepted when given a part - * - * @param containerPart - * a part that participates in a port interception - * @return intercepted port - */ - public Port getInterceptedPort(Property containerPart) { - return portInfo.get(containerPart); - } - - /** - * The attribute within the container that holds the executor, i.e. the - * original component - */ - protected Property executorPart; - - /** - * An instance specification of the executor in the target model (todo: should be source model instead?), i.e. - * of the component before container expansion - */ - protected InstanceSpecification executorIS; - - /** - * The created container implementation (prefixed with tm, since part of - * target model) - */ - protected Class tmContainerImpl; - - /** - * A counter which is used to manage unique names for interceptors (if - * multiple interceptors are applied) - */ - protected int counter; - - /** - * Store information about intercepted port. The map contains a mapping from the part representing - * a reified connector to the port that was intercepted. It is stored, since it might be used by instance - * configurators that configure the container instance. - */ - protected Map portInfo; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterRuleApplication.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterRuleApplication.java deleted file mode 100644 index 93173286910..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterRuleApplication.java +++ /dev/null @@ -1,46 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations.filters; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.FCM.RuleApplication; -import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; - -/** - * Filter the rule application stereotype. The rule application stereotype is not - * required in the target model (per node). It is harmful, since the container rule - * can contain interceptors which typically reference elements from package templates. - * These elements should not should be copied into the target model. - */ -public class FilterRuleApplication implements PreCopyListener { - - public static FilterRuleApplication getInstance() { - if (instance == null) { - instance = new FilterRuleApplication(); - } - return instance; - } - - @Override - public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { - if (sourceEObj instanceof RuleApplication) { - return null; - } - return sourceEObj; - } - - private static FilterRuleApplication instance = null; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterSignatures.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterSignatures.java deleted file mode 100644 index 69e040f9676..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterSignatures.java +++ /dev/null @@ -1,50 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations.filters; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.uml2.uml.TemplateSignature; - - -/** - * Remove signatures from package template (only remove signatures within the - * template, not others) - * - * @author ansgar - * - */ -public class FilterSignatures implements PreCopyListener { - - public static FilterSignatures getInstance() { - if (instance == null) { - instance = new FilterSignatures(); - } - return instance; - } - - @Override - public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { - if (sourceEObj instanceof TemplateSignature) { - if (copy.withinTemplate(sourceEObj)) { - return null; - } - } - return sourceEObj; - } - - private static FilterSignatures instance = null; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterStateMachines.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterStateMachines.java deleted file mode 100644 index bca7a5719a5..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterStateMachines.java +++ /dev/null @@ -1,95 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations.filters; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.papyrus.qompass.designer.core.StUtils; -import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.Region; -import org.eclipse.uml2.uml.StateMachine; -import org.eclipse.uml2.uml.Transition; - -/** - * This filter copies the effect of transitions to the class level. - */ -public class FilterStateMachines implements PreCopyListener { - - public static FilterStateMachines getInstance() { - if (instance == null) { - instance = new FilterStateMachines(); - } - return instance; - } - - @Override - public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { - if (sourceEObj instanceof StateMachine) { - StateMachine sm = (StateMachine) sourceEObj; - Class tmClass = getTargetClass(copy, sm); - - // copy opaque behavior in state machine to class level - for (Region region : sm.getRegions()) { - for (Transition transition : region.getTransitions()) { - Behavior effect = transition.getEffect(); - if (effect != null) { - if (tmClass != null) { - // String newName = sm.getName() + "_" + transition.getName() //$NON-NLS-1$ - // + "_" + effect.getName(); //$NON-NLS-1$ - moveBehavior(effect.getName(), tmClass, effect); - } - } - } - } - // remove state machine - return null; - } - return sourceEObj; - } - - public Class getTargetClass(LazyCopier copy, StateMachine sm) { - Element smOwner = sm.getOwner(); - EObject tmOwner = copy.getMap(smOwner).get(smOwner); - if (tmOwner instanceof Class) { - return (Class) tmOwner; - } - return null; - } - - public void moveBehavior(String newName, Class tmClass, Behavior effect) { - Behavior copiedEffect = EcoreUtil.copy(effect); - if (tmClass.getOwnedOperation(newName, null, null) != null) { - // has already been added - return; - } - Operation operation = tmClass.createOwnedOperation(newName, null, null); - for (Parameter parameter : effect.getOwnedParameters()) { - Parameter newParameter = EcoreUtil.copy(parameter); - operation.getOwnedParameters().add(newParameter); - StUtils.copyStereotypes(parameter, newParameter); - } - copiedEffect.setSpecification(operation); - copiedEffect.setName(newName); - tmClass.getOwnedBehaviors().add(copiedEffect); - } - - private static FilterStateMachines instance = null; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterTemplate.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterTemplate.java deleted file mode 100644 index 288fc1ab64a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterTemplate.java +++ /dev/null @@ -1,75 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations.filters; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.Element; - - -/** - * Do not copy connector related elements, i.e. - * 1. UML connectors with stereotype FCM.Connector - * The rationale behind this is that we want to avoid copying a FCM connector from the source model - * into the target model since the target model should only contain the reified form of the connector - * - * 2. UML classes that are stereotyped as interaction components - * We do not want to copy interaction components, since they typically need to be instantiated. - * TODO: there is no check whether we are actually in a template. An interaction component might be fixed (i.e. not - * depend on template instantiation) and needs to be copied in this case. - * (in most cases, these are not copied anyway, since these are in a different model, - * but we do not want to exclude the case of defining model-local connectors) - * - */ -public class FilterTemplate implements PreCopyListener { - - public FilterTemplate() { - active = true; - } - - public static FilterTemplate getInstance() { - if (instance == null) { - instance = new FilterTemplate(); - } - return instance; - } - - @Override - public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { - if (active && (sourceEObj instanceof Element)) { - Element sourceElem = (Element) sourceEObj; - if ((sourceEObj instanceof Connector) && StereotypeUtil.isApplied(sourceElem, org.eclipse.papyrus.FCM.Connector.class)) { - // return null; - } - if ((sourceEObj instanceof Class) && StereotypeUtil.isApplied(sourceElem, InteractionComponent.class)) { - return null; - } - } - return sourceEObj; - } - - public void setActive(boolean active) { - this.active = active; - } - - private boolean active; - - private static FilterTemplate instance = null; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FixTemplateSync.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FixTemplateSync.java deleted file mode 100644 index fdb7c64d06d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FixTemplateSync.java +++ /dev/null @@ -1,56 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.core.transformations.filters; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.listeners.PostCopyListener; -import org.eclipse.papyrus.qompass.designer.core.sync.CompImplSync; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Class; - -/** - * Synchronize derived realizations (after copying). If re-synchronization is not done, the - * relationship would point to wrong interface, if it is derived and depending on a formal parameter. - * (e.g. derived push interface with formal parameter T would be at wrong location). - * TODO: need better explanation. Solution is quite a hack. - */ -public class FixTemplateSync implements PostCopyListener { - - public static FixTemplateSync getInstance() { - if (instance == null) { - instance = new FixTemplateSync(); - } - return instance; - } - - @Override - public void postCopyEObject(LazyCopier copy, EObject targetEObj) { - // if (copy.get(sourceEObj) isWithinTemplate) - if (!(targetEObj instanceof Behavior)) { - if ((targetEObj instanceof Class) && Utils.isCompImpl((Class) targetEObj)) { - Class implementation = (Class) targetEObj; - CompImplSync.updatePorts(implementation); - CompImplSync.syncRealizations(implementation); - // commented out, since it causes dangling references - // TODO: why needed originally? ( - // CompImplSync.syncDerivedOperations(implementation); - } - } - } - - private static FixTemplateSync instance = null; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/.classpath b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/.classpath deleted file mode 100644 index 248b4c5dc7a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/.project b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/.project deleted file mode 100644 index e75a53b4f3e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.papyrus.qompass.designer.cpp - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.xtext.ui.shared.xtextNature - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f42de363afa..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/META-INF/MANIFEST.MF deleted file mode 100644 index a104bc94858..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - com.google.guava;bundle-version="11.0.0", - org.eclipse.xtext.xbase.lib, - org.eclipse.xtend.lib, - org.eclipse.xtend.lib.macro, - org.eclipse.papyrus.qompass.designer.core;bundle-version="1.2.0", - org.eclipse.uml2.uml;bundle-version="5.0.1", - org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", - org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", - org.eclipse.papyrus.uml.tools;bundle-version="1.2.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.qompass.designer.cpp.Activator -Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.cpp;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/about.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/build.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/build.properties deleted file mode 100644 index 3fa3c740b2b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = src/,\ - xtend-gen/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - plugin.xml diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.properties deleted file mode 100644 index 41efca52119..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus extra: Qompass Designer C++ support (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.xml deleted file mode 100644 index 7e269f6b934..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/pom.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/pom.xml deleted file mode 100644 index 29fa1be894f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.qompass.designer.cpp - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-clean-plugin - - - - xtend-gen - - **/* - - - .gitignore - - - - - - - org.eclipse.xtend - xtend-maven-plugin - - - generate-sources - - compile - - - - - xtend-gen - ${project.build.directory}/xtend-gen/test - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Activator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Activator.java deleted file mode 100644 index 8d1c38fcd87..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Activator.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.cpp; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.cpp"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Constants.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Constants.java deleted file mode 100644 index 546144c98e5..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Constants.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.cpp; - -public class Constants { - public static final String CREATE_CONNECTIONS = "createConnections"; //$NON-NLS-1$ - - public static final String progLang = "C/C++"; //$NON-NLS-1$ - - public static final String retParamName = "ret"; //$NON-NLS-1$ -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Messages.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Messages.java deleted file mode 100644 index ae3f8380e5b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Messages.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.cpp; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.papyrus.qompass.designer.cpp.messages"; //$NON-NLS-1$ - - public static String CompImplTrafos_CannotFindType; - public static String CompImplTrafos_IntfNotImplemented; - public static String CompTypeTrafos_CannotFindType; - - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/messages.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/messages.properties deleted file mode 100644 index c4c2141c7e6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/messages.properties +++ /dev/null @@ -1,3 +0,0 @@ -CompImplTrafos_CannotFindType=Can not find type %s. Thus, unable to create suitable connect operation in component to OO transformation. -CompImplTrafos_IntfNotImplemented=Interface <%s> provided by port <%s> of class <%s> is not implemented by the component itself nor does the port delegate to a part -CompTypeTrafos_CannotFindType=Can not find type <%s>. Thus, unable to create suitable connect operation in component to OO transformation diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppPortMapping.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppPortMapping.xtend deleted file mode 100644 index 05dd7c50459..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppPortMapping.xtend +++ /dev/null @@ -1,553 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ -package org.eclipse.papyrus.qompass.designer.cpp.xtend - -import org.eclipse.papyrus.qompass.designer.core.extensions.IOOTrafo -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.Property -import org.eclipse.uml2.uml.Port -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException -import org.eclipse.papyrus.qompass.designer.core.PortInfo -import org.eclipse.papyrus.qompass.designer.core.PortUtils -import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants -import org.eclipse.papyrus.qompass.designer.core.Utils -import org.eclipse.papyrus.qompass.designer.core.transformations.CompTypeTrafos -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil -import org.eclipse.uml2.uml.AggregationKind -import org.eclipse.uml2.uml.UMLPackage -import org.eclipse.uml2.uml.OpaqueBehavior -import org.eclipse.uml2.uml.ConnectorEnd -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil -import org.eclipse.papyrus.C_Cpp.Ptr -import org.eclipse.uml2.uml.Type -import java.util.HashMap -import java.util.Map -import org.eclipse.uml2.uml.Connector -import org.eclipse.emf.common.util.EList -import org.eclipse.uml2.uml.StructuralFeature -import org.eclipse.papyrus.qompass.designer.cpp.Messages -import org.eclipse.papyrus.qompass.designer.cpp.Constants -import static extension org.eclipse.papyrus.qompass.designer.cpp.xtend.CppUtils.nameRef; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil - -/** - * This class realizes the transformation from component-based to object-oriented - * models. It includes the replacement of ports and connectors. Ports are - * replaced with attributes and access operations, connectors within a composite - * by an operation that creates the initial setup. - * - * 1. add an operation that allows to retrieve the reference to an interface provided - * by a port. This operation has a mapping specific name, e.g. get_ - * 2. add an operation that allows to connect a specific port. - * the connect_q operation (*including a - * storage attribute*) for a port with a required interface - * 3. add an implementation for the getcnx_q operation for a port - * with a required interface (the operation itself has been added before) - * - * TODO: C++ specific, support different "component to OO" mappings - * - * Problems: need to align bootloader creation with this mapping, since - * the bootloader may be responsible for instantiation - * - * Caveat: Assure that the folder derivedInterfaces already exists in a model. - * Otherwise the call to getProvided/getRequired interface might trigger its - * creation resulting in the corruption of list iterators (ConcurrentAccess - * exception) - * - */ -class CppPortMapping implements IOOTrafo { - - // protected LazyCopier copier - - def override init(LazyCopier copier, Class bootloader) { - // this.copier = copier - } - - override addPortOperations(Class implementation) { - addGetPortOperation(implementation) - addConnectPortOperation(implementation) - } - - /** - * Add the get_p operation for each port with a provided interface. It also - * adds a suitable implementation that evaluates delegation connectors from - * the port to a property within the composite. The delegation target could - * either be a normal class (no port) or an inner component. - * - * @param implementation - */ - def addGetPortOperation(Class implementation) { - for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { - val providedIntf = portInfo.getProvided() - if (providedIntf != null) { - - // port provides an interface, add "get_p" operation & - // implementation - val opName = PrefixConstants.getP_Prefix + portInfo.name - var op = implementation.getOwnedOperation(opName, null, null) - if (op != null) { - - // operation already exists. Assume that user wants to - // override standard delegation - if (op.type != providedIntf) { - op.createOwnedParameter(Constants.retParamName, providedIntf) - } - } else { - op = implementation.createOwnedOperation(opName, null, null, providedIntf) - val retParam = op.getOwnedParameters().get(0) - retParam.setName(Constants.retParamName) - StereotypeUtil.apply(retParam, Ptr) - - val behavior = implementation.createOwnedBehavior(opName, UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - op.getMethods().add(behavior) - - val ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) - - // if there is an delegation to an inner property, delegate to - // it - // Make distinction between delegation to component (with a - // port) or - // "normal" class (without). - var String body - if (ce != null) { - val part = ce.partWithPort - val role = ce.role - - body = "return " - if (role instanceof Port) { - - // check whether the part exists within the implementation (might not be the case - // due to partially copied composites). - // Check is based on names, since the connector points to elements within another - // model (copyClassifier does not make a proper connector copy) - // TODO: this will NOT work for extended ports! - body += '''«part.nameRef»«PrefixConstants.getP_Prefix»«role.name»();''' - } else { - - // role is not a port: connector connects directly to a - // structural feature - // without passing via a port - // TODO: check whether structural feature exists - body += role.name - } - } else { - - // no delegation, check whether port implements provided interface - var implementsIntf = implementation.getInterfaceRealization(null, providedIntf) != null - if (!implementsIntf) { - // TODO: This is a hack/workaround. Fix on level of extended port. - // The extended port itself is not copied to the target - // model (since referenced via a stereotype). Therefore, - // a port of an extended port still points to the - // original model. We try whether the providedIntf - // within the target model is within the interface - // realizations. - - // val providedIntfInCopy = copier.getCopy(providedIntf) - // implementsIntf = implementation.getInterfaceRealization(null, providedIntfInCopy) != null - } - if (implementsIntf) { - body = "return this;" - } else { - throw new RuntimeException( - String.format(Messages.CompImplTrafos_IntfNotImplemented, providedIntf.name, - portInfo.port.name, implementation.name)) - } - } - behavior.getLanguages().add(Constants.progLang) - behavior.getBodies().add(body) - } - } - } - } - - /** - * Add a connect_ operation for ports with a required interface. - * Whereas operation and a behavior is added for each owned port, a behavior - * (method) is needed for ports inherited from a component type (the - * behavior is implementation specific, as it needs to take delegation to - * parts into account) - * - * @param implementation - */ - static def addConnectPortOperation(Class implementation) { - for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { - val requiredIntf = portInfo.getRequired() - if (requiredIntf != null) { - - // port requires an interface, add "connect_p" operation & - // implementation - val opName = PrefixConstants.connectQ_Prefix + portInfo.name - - if (implementation.getOwnedOperation(opName, null, null) != null) { - // do not add the operation, if it already exists. This means that the - // user wants to override it with custom behavior. In case of extended - // ports, we may have to do that. - } else { - var op = implementation.createOwnedOperation(opName, null, null) - val boolean multiPort = (portInfo.getUpper() > 1) || (portInfo.getUpper() == -1) // -1 indicates "*" - if (multiPort) { - - // add index parameter - val eLong = Utils.getQualifiedElement(PackageUtil.getRootPackage(implementation), - CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE) - if (eLong instanceof Type) { - op.createOwnedParameter("index", eLong as Type) - } else { - throw new RuntimeException( - String.format(Messages.CompImplTrafos_CannotFindType, - CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE)) - } - } - val refParam = op.createOwnedParameter("ref", requiredIntf) - StereotypeUtil.apply(refParam, Ptr) - - val behavior = implementation.createOwnedBehavior(opName, UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - - op.getMethods().add(behavior) - - val ConnectorEnd ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) - - // if there is an delegation to an inner property, delegate to it - // Make distinction between delegation to component (with a port) or - // "normal" class (without). - var String body - if (ce != null) { - val part = ce.partWithPort - body = part.name - val role = ce.role - if (role instanceof Port) { - // in case of a delegation, use name of target port which might be different - val targetOpName = PrefixConstants.connectQ_Prefix + role.name - body = '''«part.nameRef»«targetOpName»''' - - // TODO: no check that multiplicity of both port matches - if ((portInfo.getUpper() > 1) || (portInfo.getUpper() == -1)) { - body += "(index, ref);"; - } - else { - body += "(ref);"; - } - - } else { - // TODO: does this case make sense? - body += '''«part.name»;''' - } - } else { - // no delegation - create attribute for port - val attributeName = PrefixConstants.attributePrefix + portInfo.name - if (!Utils.hasNonPortOwnedAttribute(implementation, attributeName)) { - val attr = implementation.createOwnedAttribute(attributeName, requiredIntf) - LazyCopier.copyMultElemModifiers(portInfo.port, attr) - - // is shared (should store a reference) - attr.setAggregation(AggregationKind.SHARED_LITERAL) - } - body = attributeName - if(multiPort) body += "[index]" - body += " = ref;" - } - - // TODO: defined by template - behavior.getLanguages().add(Constants.progLang) - behavior.getBodies().add(body) - - // ------------------------- - // add body to get-connection operation (which exists already if the port is also - // owned, since it is synchronized automatically during model edit) - // getConnQ prefix may be empty to indicate that the port is accessed directly - // TODO: reconsider optimization that delegated required ports do not have a - // local attribute & associated operation (an inner class may delegate, but the - // composite may be using it as well). - if ((PrefixConstants.getConnQ_Prefix.length() > 0) && (ce != null)) { - val getConnOpName = PrefixConstants.getConnQ_Prefix + portInfo.name - var getConnOp = implementation.getOwnedOperation(getConnOpName, null, null) - if (getConnOp == null) { - getConnOp = implementation.createOwnedOperation(getConnOpName, null, null, requiredIntf) - val retParam = op.getOwnedParameters().get(0) - retParam.setName(Constants.retParamName) - StereotypeUtil.apply(retParam, Ptr) - } - val getConnBehavior = implementation.createOwnedBehavior(getConnOpName, - UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - getConnOp.getMethods().add(getConnBehavior) - - // no delegation - val String name = PrefixConstants.attributePrefix + portInfo.name - body = '''return «name»;''' - behavior.getLanguages().add(Constants.progLang) - behavior.getBodies().add(body) - } - } - } - } - } - - /** - * Add an operation "createConnections" that implements the connections - * between composite parts. It only takes the assembly connections into - * account, since delegation connectors are handled by the get_ and connect_ - * port operations above. - * - * @param implementation - */ - override addConnectionOperation(Class compositeImplementation) throws TransformationException { - var createConnBody = "" - val Map indexMap = new HashMap() - - for (Connector connector : compositeImplementation.getOwnedConnectors()) { - if (ConnectorUtil.isAssembly(connector)) { - - // Boolean associationBased = false - if (connector.ends.size() != 2) { - throw new TransformationException( - '''Connector <«connector.name»> does not have two ends. This is currently not supported''') - } - val end1 = connector.ends.get(0) - val end2 = connector.ends.get(1) - var cmd = '''// realization of connector <«connector.name»>\n''' - if ((end1.role instanceof Port) && PortUtils.isExtendedPort(end1.role as Port)) { - val port = end1.role as Port - val EList subPorts = PortUtils.flattenExtendedPort(port) - for (PortInfo subPort : subPorts) { - cmd += ''' // realization of connection for sub-port «subPort.port.name»\n''' - cmd += connectPorts(indexMap, connector, end1, end2, subPort.port) - cmd += connectPorts(indexMap, connector, end2, end1, subPort.port) - } - } else { - cmd += connectPorts(indexMap, connector, end1, end2, null) - cmd += connectPorts(indexMap, connector, end2, end1, null) - } - createConnBody += cmd + "\n" - } - } - - // TODO: use template, as in bootloader - if (createConnBody.length() > 0) { - val operation = compositeImplementation.createOwnedOperation(Constants.CREATE_CONNECTIONS, null, null) - - val behavior = compositeImplementation.createOwnedBehavior("b:" + operation.name, - UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - behavior.getLanguages().add(Constants.progLang) - behavior.getBodies().add(createConnBody) - behavior.setSpecification(operation) - } - } - - /** - * Create the body C++ code code that creates a connection between the two ends - * of a connector. This function checks whether the first end really is a receptacle - * and the second really is a facet. - * TODO: cleaner rewrite in xtend - * - * @param indexMap - * a map of indices that are used in case of multiplex - * receptacles - * @param connector - * a connector - * @param receptacleEnd - * an end of the connector that may point to a receptacle port - * @param facetEnd - * an end of the connector that may point to a facet port - * @param subPort - * a sub-port in case of extended ports - * @return - * @throws TransformationException - */ - static def connectPorts(Map indexMap, Connector connector, ConnectorEnd receptacleEnd, - ConnectorEnd facetEnd, Port subPort) throws TransformationException { - val association = connector.type - if ((receptacleEnd.role instanceof Port) && (facetEnd.role instanceof Port)) { - val facetPort = facetEnd.role as Port - val receptaclePort = receptacleEnd.role as Port - val facetPI = PortInfo.fromSubPort(facetPort, subPort) - val receptaclePI = PortInfo.fromSubPort(receptaclePort, subPort) - - if ((facetPI.getProvided() != null) && (receptaclePI.getRequired() != null)) { - val facetPart = facetEnd.partWithPort - val receptaclePart = receptacleEnd.partWithPort - - var subPortName = "" - if(subPort != null) subPortName += "_" + subPort.name - val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) - val setter = '''«receptaclePart.nameRef»connect_«receptaclePort.name» «subPortName»;''' - val getter = '''«facetPart.nameRef»get_«facetPort.name» «subPortName»()''' - return '''«setter»(«indexName»«getter»);\n''' - } - - } else if (receptacleEnd.role instanceof Port) { - - // only the receptacle end is of type port. - val Port receptaclePort = receptacleEnd.role as Port - if (PortUtils.getRequired(receptaclePort) != null) { - val facetPart = facetEnd.role as Property - val receptaclePart = facetEnd.partWithPort - - val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) - val setter = '''«receptaclePart.nameRef»connect_«receptaclePort.name»''' - val getter = '''&«facetPart.name»''' - return '''«setter»(«indexName»«getter»);\n''' - } - } else if (facetEnd.role instanceof Port) { - - // only the facet end is of type port. Unsupported combination - val facetPort = facetEnd.role as Port - if (PortUtils.getProvided(facetPort) != null) { - val facetPart = facetEnd.partWithPort - val receptaclePart = facetEnd.role as Property - - val setter = receptaclePart.name - val getter = '''«facetPart.nameRef»get_«facetPort.name»();''' - return '''«setter» = «getter»;\n''' - } - } else if (association != null) { - - // both connector ends do not target ports. In this case, we require that the connector is typed - // with an association. We use this association to find out which end is navigable and assume that - // the part pointed to by the other end is a pointer that gets initialized with the part of the - // navigable end. - val facetPart = facetEnd.role as Property - val receptaclePart = receptacleEnd.role as Property - - val assocProp1 = association.getMemberEnd(null, facetPart.type) - - // Property assocProp2 = facetPart.getOtherEnd() - if ((assocProp1 != null) && assocProp1.isNavigable) { - val setter = '''«receptaclePart.nameRef»«assocProp1.name»''' - val getter = '''&«facetPart.name»''' - return '''«setter» = «getter»;\n''' - } - } else { - - // not handled (a connector not targeting a port must be typed) - throw new TransformationException( - "Connector <" + connector.name + - "> does not use ports, but it is not typed (only connectors between ports should not be typed)") - } - return "" - } - - /** - * Handle ports with multiplicity > 1. The idea is that we could have - * multiple connections targeting a receptacle. The first connection would - * start with index 0. Implementations can make no assumption which - * connection is associated with a certain index. [want to avoid associative - * array in runtime]. - * - * @param port - * @param end - * @return - */ - static def getIndexName(Map indexMap, Port port, ConnectorEnd end) { - if ((port.getUpper() > 1) || (port.getUpper() == -1)) { - - // index depends of combination of property and port, use connector - // end as key - var indexValue = indexMap.get(end) - if (indexValue == null) { - indexValue = 0 - indexMap.put(end, indexValue) - } - var index = indexValue + ", " - indexValue++ - indexMap.put(end, indexValue) - return index - } - return "" - } - - /** - * Return true, if the bootloader is responsible for the instantiation of a - * part. [Structual difference: bootloader can decide instance based - and - * instances are deployed] - * - * If a part is a component type or an abstract implementation, it cannot be - * instantiated. Thus, a heir has to be selected in the deployment plan. - * Since the selection might be different for different instances of the - * composite, the instantiation is not done by the component itself, but by - * the bootloader. The bootloader also has to instantiate, if different - * allocation variants are required. (this is for instance the case for - * distribution connectors and for the system itself) - * - * If possible, we want to let composites instantiate sub-components, since - * this eases the transition to systems which support reconfiguration. - * - * [TODO: optimization: analyze whether the deployment plan selects a single - * implementation. If yes, let the composite instantiate] - * - * [TODO: elements within an assembly need to be instantiated by composite - - * if System - by bootloader. assembly also need to be instantiated by - * composite!! - * - * @param implementation - * @return - */ - static def instantiateViaBootloader(Class implementation) { - return implementation.isAbstract() || Utils.isAssembly(implementation) - } - - /** - * Return whether a part needs to be instantiated by the bootloader instead - * by the composite in which it is contained. The criteria is based on the - * question whether the containing composite is flattened, as it is the case - * for the system component and the interaction components for distribution. - * - * @param part - * @return - */ - static def instantiateViaBootloader(StructuralFeature part) { - if (part != null) { - if (part.type instanceof Class) { - val implementation = part.type as Class - - // TODO: wrong criteria? (must be shared or not?) - return instantiateViaBootloader(implementation) - } else { - - // not a class, assume primitive type instantiated by composite - return false - } - } - return false - } - - /** - * Transform parts if necessary. - * - * If the bootloader is responsible for creating an instance (if it is a - * abstract type), mark the associated part as a C++ pointer. We do not want - * to change the aggregation kind, since it remains logically a composition, - * it is merely an implementation issue that it must be a pointer for C++ if - * the concrete type is not yet known. - * - * @param compositeImplementation - * a (composite) component - */ - override transformParts(Class compositeImplementation) { - - for (Property attribute : Utils.getParts(compositeImplementation)) { - val type = attribute.type - if (type instanceof Class) { - val cl = type as Class - - // => requires adaptations of boot-loader which is then only - // responsible for creating instances corresponding to types - if (instantiateViaBootloader(cl)) { - StereotypeUtil.apply(attribute, Ptr) - } - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppUtils.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppUtils.xtend deleted file mode 100644 index 1d568623d14..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppUtils.xtend +++ /dev/null @@ -1,26 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.cpp.xtend - -import org.eclipse.uml2.uml.Property ; -import org.eclipse.uml2.uml.AggregationKind -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil -import org.eclipse.papyrus.C_Cpp.Ptr - -public class CppUtils { - public static def nameRef(Property part) { - part.name + refOp(part) - } - - /** - * return the operator for (de-) referencing a part. If the part is - * instantiate via the bootloader, it becomes a pointer. If it is - * instantiated by the composite itself, it is not a pointer, it will be - * instantiated along with the composite - * - * @param part - * @return - */ - public static def refOp(Property part) { - if((part.getAggregation() == AggregationKind.SHARED_LITERAL) || StereotypeUtil.isApplied(part, Ptr)) "->" else "." - } - -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/DynamicCpptoOO.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/DynamicCpptoOO.xtend deleted file mode 100644 index 15a4477e2e4..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/DynamicCpptoOO.xtend +++ /dev/null @@ -1,505 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ -package org.eclipse.papyrus.qompass.designer.cpp.xtend - -import org.eclipse.papyrus.qompass.designer.core.extensions.IOOTrafo -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.Property -import org.eclipse.uml2.uml.Port -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException -import org.eclipse.papyrus.qompass.designer.core.PortInfo -import org.eclipse.papyrus.qompass.designer.core.PortUtils -import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants -import org.eclipse.papyrus.qompass.designer.core.Utils -import org.eclipse.papyrus.qompass.designer.core.transformations.CompTypeTrafos -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil -import org.eclipse.uml2.uml.AggregationKind -import org.eclipse.uml2.uml.UMLPackage -import org.eclipse.uml2.uml.OpaqueBehavior -import org.eclipse.uml2.uml.ConnectorEnd -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil -import org.eclipse.papyrus.C_Cpp.Ptr -import org.eclipse.uml2.uml.Type -import java.util.HashMap -import java.util.Map -import org.eclipse.uml2.uml.Connector -import org.eclipse.emf.common.util.EList -import org.eclipse.papyrus.qompass.designer.cpp.Messages -import org.eclipse.papyrus.qompass.designer.cpp.Constants -import static extension org.eclipse.papyrus.qompass.designer.cpp.xtend.CppUtils.nameRef; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil - -/** - * This class realizes the dynamic variant of the OO-transformation - * - */ -class DynamicCppToOO implements IOOTrafo { - - protected LazyCopier copier - - val static final String PART_MANAGER = "services::PartManager" - - val static final String INIT_PARTS = "initParts" - - // name of generic "parts" attribute for dynamic deployment (TODO: should be inherited) - val static final String PARTS = "parts" - - val static final String progLang = "C/C++" - - protected Class bootloader // why required? - - def override init(LazyCopier copier, Class bootloader) { - this.copier = copier - this.bootloader = bootloader - } - - override addPortOperations(Class implementation) { - addGetPortOperation(implementation) - addConnectPortOperation(implementation) - } - - /** - * Add the get_p operation for each port with a provided interface. It also - * adds a suitable implementation that evaluates delegation connectors from - * the port to a property within the composite. The delegation target could - * either be a normal class (no port) or an inner component. - * - * @param implementation - */ - def addGetPortOperation(Class implementation) { - for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { - val providedIntf = portInfo.getProvided() - if (providedIntf != null) { - - // port provides an interface, add "get_p" operation & - // implementation - val opName = PrefixConstants.getP_Prefix + portInfo.name - var op = implementation.getOwnedOperation(opName, null, null) - if (op != null) { - - // operation already exists. Assume that user wants to - // override standard delegation - if (op.type != providedIntf) { - op.createOwnedParameter(Constants.retParamName, providedIntf) - } - } else { - op = implementation.createOwnedOperation(opName, null, null, providedIntf) - val retParam = op.getOwnedParameters().get(0) - retParam.setName(Constants.retParamName) - StereotypeUtil.apply(retParam, Ptr) - - val behavior = implementation.createOwnedBehavior(opName, UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - op.getMethods().add(behavior) - - val ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) - - // if there is an delegation to an inner property, delegate to - // it - // Make distinction between delegation to component (with a - // port) or - // "normal" class (without). - var String body - if (ce != null) { - val part = ce.partWithPort - val role = ce.role - - body = "return " - if (role instanceof Port) { - - // check whether the part exists within the implementation (might not be the case - // due to partially copied composites). - // Check is based on names, since the connector points to elements within another - // model (copyClassifier does not make a proper connector copy) - // TODO: this will NOT work for extended ports! - body += '''«part.nameRef»«PrefixConstants.getP_Prefix»«role.name»();''' - } else { - - // role is not a port: connector connects directly to a - // structural feature - // without passing via a port - // TODO: check whether structural feature exists - body += role.name - } - } else { - - // no delegation, check whether port implements provided interface - var implementsIntf = implementation.getInterfaceRealization(null, providedIntf) != null - if (!implementsIntf) { - - // The extended port itself is not copied to the target - // model (since referenced via a stereotype). Therefore, - // a port of an extended port still points to the - // original model. We try whether the providedIntf - // within - // the target model is within the interface - // realizations. - val providedIntfInCopy = copier.getCopy(providedIntf) - implementsIntf = implementation.getInterfaceRealization(null, providedIntfInCopy) != null - } - if (implementsIntf) { - body = "return this;" - } else { - throw new RuntimeException( - String.format(Messages.CompImplTrafos_IntfNotImplemented, providedIntf.name, - portInfo.port.name, implementation.name)) - } - } - behavior.getLanguages().add(Constants.progLang) - behavior.getBodies().add(body) - } - } - } - } - - /** - * Add a connect_ operation for ports with a required interface. - * Whereas operation and a behavior is added for each owned port, a behavior - * (method) is needed for ports inherited from a component type (the - * behavior is implementation specific, as it needs to take delegation to - * parts into account) - * - * @param implementation - */ - static def addConnectPortOperation(Class implementation) { - for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { - val requiredIntf = portInfo.getRequired() - if (requiredIntf != null) { - - // port requires an interface, add "connect_p" operation & - // implementation - val opName = PrefixConstants.connectQ_Prefix + portInfo.name - - if (implementation.getOwnedOperation(opName, null, null) != null) { - // do not add the operation, if it already exists. This means that the - // user wants to override it with custom behavior. In case of extended - // ports, we may have to do that. - } else { - var op = implementation.createOwnedOperation(opName, null, null) - val boolean multiPort = (portInfo.getUpper() > 1) || (portInfo.getUpper() == -1) // -1 indicates "*" - if (multiPort) { - - // add index parameter - val eLong = Utils.getQualifiedElement(PackageUtil.getRootPackage(implementation), - CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE) - if (eLong instanceof Type) { - op.createOwnedParameter("index", eLong as Type) - } else { - throw new RuntimeException( - String.format(Messages.CompImplTrafos_CannotFindType, - CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE)) - } - } - val refParam = op.createOwnedParameter("ref", requiredIntf) - StereotypeUtil.apply(refParam, Ptr) - - val behavior = implementation.createOwnedBehavior(opName, UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - - op.getMethods().add(behavior) - - val ConnectorEnd ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) - - // if there is an delegation to an inner property, delegate to it - // Make distinction between delegation to component (with a port) or - // "normal" class (without). - var String body - if (ce != null) { - val part = ce.partWithPort - body = part.name - val role = ce.role - if (role instanceof Port) { - // in case of a delegation, use name of target port which might be different - val targetOpName = PrefixConstants.connectQ_Prefix + role.name - body = '''«part.nameRef»«targetOpName»''' - - // TODO: no check that multiplicity of both port matches - if ((portInfo.getUpper() > 1) || (portInfo.getUpper() == -1)) { - body += "(index, ref);"; - } - else { - body += "(ref);"; - } - - } else { - // TODO: does this case make sense? - body += '''«part.name»;''' - } - } else { - // no delegation - create attribute for port - val attributeName = PrefixConstants.attributePrefix + portInfo.name - if (!Utils.hasNonPortOwnedAttribute(implementation, attributeName)) { - val attr = implementation.createOwnedAttribute(attributeName, requiredIntf) - LazyCopier.copyMultElemModifiers(portInfo.port, attr) - - // is shared (should store a reference) - attr.setAggregation(AggregationKind.SHARED_LITERAL) - } - body = attributeName - if(multiPort) body += "[index]" - body += " = ref;" - } - - // TODO: defined by template - behavior.getLanguages().add(Constants.progLang) - behavior.getBodies().add(body) - - // ------------------------- - // add body to get-connection operation (which exists already if the port is also - // owned, since it is synchronized automatically during model edit) - // getConnQ prefix may be empty to indicate that the port is accessed directly - // TODO: reconsider optimization that delegated required ports do not have a - // local attribute & associated operation (an inner class may delegate, but the - // composite may be using it as well). - if ((PrefixConstants.getConnQ_Prefix.length() > 0) && (ce != null)) { - val getConnOpName = PrefixConstants.getConnQ_Prefix + portInfo.name - var getConnOp = implementation.getOwnedOperation(getConnOpName, null, null) - if (getConnOp == null) { - getConnOp = implementation.createOwnedOperation(getConnOpName, null, null, requiredIntf) - val retParam = op.getOwnedParameters().get(0) - retParam.setName(Constants.retParamName) - StereotypeUtil.apply(retParam, Ptr) - } - val getConnBehavior = implementation.createOwnedBehavior(getConnOpName, - UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - getConnOp.getMethods().add(getConnBehavior) - - // no delegation - val String name = PrefixConstants.attributePrefix + portInfo.name - body = '''return «name»;''' - behavior.getLanguages().add(Constants.progLang) - behavior.getBodies().add(body) - } - } - } - } - } - - /** - * Add an operation "createConnections" that implements the connections - * between composite parts. It only takes the assembly connections into - * account, since delegation connectors are handled by the get_ and connect_ - * port operations above. - * - * @param implementation - */ - override addConnectionOperation(Class compositeImplementation) throws TransformationException { - var createConnBody = "" - val Map indexMap = new HashMap() - - for (Connector connector : compositeImplementation.getOwnedConnectors()) { - if (ConnectorUtil.isAssembly(connector)) { - - // Boolean associationBased = false - if (connector.ends.size() != 2) { - throw new TransformationException( - '''Connector <«connector.name»> does not have two ends. This is currently not supported''') - } - val end1 = connector.ends.get(0) - val end2 = connector.ends.get(1) - var cmd = '''// realization of connector <«connector.name»>\n''' - if ((end1.role instanceof Port) && PortUtils.isExtendedPort(end1.role as Port)) { - val port = end1.role as Port - val EList subPorts = PortUtils.flattenExtendedPort(port) - for (PortInfo subPort : subPorts) { - cmd += ''' // realization of connection for sub-port «subPort.port.name»\n''' - cmd += connectPorts(indexMap, connector, end1, end2, subPort.port) - cmd += connectPorts(indexMap, connector, end2, end1, subPort.port) - } - } else { - cmd += connectPorts(indexMap, connector, end1, end2, null) - cmd += connectPorts(indexMap, connector, end2, end1, null) - } - createConnBody += cmd + "\n" - } - } - - // TODO: use template, as in bootloader - if (createConnBody.length() > 0) { - val operation = compositeImplementation.createOwnedOperation(Constants.CREATE_CONNECTIONS, null, null) - - val behavior = compositeImplementation.createOwnedBehavior("b:" + operation.name, - UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - behavior.getLanguages().add(Constants.progLang) - behavior.getBodies().add(createConnBody) - behavior.setSpecification(operation) - } - } - - /** - * Create the body C++ code code that creates a connection between the two ends - * of a connector. This function checks whether the first end really is a receptacle - * and the second really is a facet. - * TODO: cleaner rewrite in xtend - * - * @param indexMap - * a map of indices that are used in case of multiplex - * receptacles - * @param connector - * a connector - * @param receptacleEnd - * an end of the connector that may point to a receptacle port - * @param facetEnd - * an end of the connector that may point to a facet port - * @param subPort - * a sub-port in case of extended ports - * @return - * @throws TransformationException - */ - static def connectPorts(Map indexMap, Connector connector, ConnectorEnd receptacleEnd, - ConnectorEnd facetEnd, Port subPort) throws TransformationException { - val association = connector.type - if ((receptacleEnd.role instanceof Port) && (facetEnd.role instanceof Port)) { - val facetPort = facetEnd.role as Port - val receptaclePort = receptacleEnd.role as Port - val facetPI = PortInfo.fromSubPort(facetPort, subPort) - val receptaclePI = PortInfo.fromSubPort(receptaclePort, subPort) - - if ((facetPI.getProvided() != null) && (receptaclePI.getRequired() != null)) { - val facetPart = facetEnd.partWithPort - val receptaclePart = receptacleEnd.partWithPort - - var subPortName = "" - if(subPort != null) subPortName += "_" + subPort.name - val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) - val setter = '''«receptaclePart.nameRef»connect_«receptaclePort.name» «subPortName»;''' - val getter = '''«facetPart.nameRef»get_«facetPort.name» «subPortName»()''' - return '''«setter»(«indexName»«getter»);\n''' - } - - } else if (receptacleEnd.role instanceof Port) { - - // only the receptacle end is of type port. - val Port receptaclePort = receptacleEnd.role as Port - if (PortUtils.getRequired(receptaclePort) != null) { - val facetPart = facetEnd.role as Property - val receptaclePart = facetEnd.partWithPort - - val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) - val setter = '''«receptaclePart.nameRef»connect_«receptaclePort.name»''' - val getter = '''&«facetPart.name»''' - return '''«setter»(«indexName»«getter»);\n''' - } - } else if (facetEnd.role instanceof Port) { - - // only the facet end is of type port. Unsupported combination - val facetPort = facetEnd.role as Port - if (PortUtils.getProvided(facetPort) != null) { - val facetPart = facetEnd.partWithPort - val receptaclePart = facetEnd.role as Property - - val setter = receptaclePart.name - val getter = '''«facetPart.nameRef»get_«facetPort.name»();''' - return '''«setter» = «getter»;\n''' - } - } else if (association != null) { - - // both connector ends do not target ports. In this case, we require that the connector is typed - // with an association. We use this association to find out which end is navigable and assume that - // the part pointed to by the other end is a pointer that gets initialized with the part of the - // navigable end. - val facetPart = facetEnd.role as Property - val receptaclePart = receptacleEnd.role as Property - - val assocProp1 = association.getMemberEnd(null, facetPart.type) - - // Property assocProp2 = facetPart.getOtherEnd() - if ((assocProp1 != null) && assocProp1.isNavigable) { - val setter = '''«receptaclePart.nameRef»«assocProp1.name»''' - val getter = '''&«facetPart.name»''' - return '''«setter» = «getter»;\n''' - } - } else { - - // not handled (a connector not targeting a port must be typed) - throw new TransformationException( - "Connector <" + connector.name + - "> does not use ports, but it is not typed (only connectors between ports should not be typed)") - } - return "" - } - - /** - * Handle ports with multiplicity > 1. The idea is that we could have - * multiple connections targeting a receptacle. The first connection would - * start with index 0. Implementations can make no assumption which - * connection is associated with a certain index. [want to avoid associative - * array in runtime]. - * - * @param port - * @param end - * @return - */ - static def getIndexName(Map indexMap, Port port, ConnectorEnd end) { - if ((port.getUpper() > 1) || (port.getUpper() == -1)) { - - // index depends of combination of property and port, use connector - // end as key - var indexValue = indexMap.get(end) - if (indexValue == null) { - indexValue = 0 - indexMap.put(end, indexValue) - } - var index = indexValue + ", " - indexValue++ - indexMap.put(end, indexValue) - return index - } - return "" - } - - /** - * Transform parts if necessary. - * - * @param compositeImplementation - * a (composite) component - */ - override transformParts(Class compositeImplementation) { - -/* - for (Property attribute : Utils.getParts(compositeImplementation)) { - val type = attribute.type - if (type instanceof Class) { - val cl = type as Class - - // always transform into pointer (enable dynamic creation) - StereotypeUtil.apply(attribute, Ptr) - } - } -*/ - var String initPartsBody = "" - for (Property attribute : Utils.getParts(compositeImplementation)) { - val type = attribute.type; - if (type instanceof Class) { - initPartsBody += initPartBody(attribute); - attribute.destroy(); - } - } - - val partManager = Utils.getQualifiedElement(PackageUtil.getRootPackage(compositeImplementation), PART_MANAGER); - if (partManager instanceof Type) { - compositeImplementation.createOwnedAttribute(PARTS, partManager as Type); - } - - val operation = compositeImplementation.createOwnedOperation(INIT_PARTS, null, null); - - val behavior = compositeImplementation.createOwnedBehavior("b:" + operation.name, UMLPackage.eINSTANCE.opaqueBehavior) - as OpaqueBehavior - behavior.getLanguages().add(progLang); - behavior.getBodies().add(initPartsBody); - } - - def initPartBody(Property part) { - "parts.add(" + part.getName() + ", " + part.getType() + ")" - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/StaticCppToOO.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/StaticCppToOO.xtend deleted file mode 100644 index 4788177ede6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/StaticCppToOO.xtend +++ /dev/null @@ -1,550 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ -package org.eclipse.papyrus.qompass.designer.cpp.xtend - -import org.eclipse.papyrus.qompass.designer.core.extensions.IOOTrafo -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.Property -import org.eclipse.uml2.uml.Port -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException -import org.eclipse.papyrus.qompass.designer.core.PortInfo -import org.eclipse.papyrus.qompass.designer.core.PortUtils -import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants -import org.eclipse.papyrus.qompass.designer.core.Utils -import org.eclipse.papyrus.qompass.designer.core.transformations.CompTypeTrafos -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil -import org.eclipse.uml2.uml.AggregationKind -import org.eclipse.uml2.uml.UMLPackage -import org.eclipse.uml2.uml.OpaqueBehavior -import org.eclipse.uml2.uml.ConnectorEnd -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil -import org.eclipse.papyrus.C_Cpp.Ptr -import org.eclipse.uml2.uml.Type -import java.util.HashMap -import java.util.Map -import org.eclipse.uml2.uml.Connector -import org.eclipse.emf.common.util.EList -import org.eclipse.uml2.uml.StructuralFeature -import org.eclipse.papyrus.qompass.designer.cpp.Messages -import org.eclipse.papyrus.qompass.designer.cpp.Constants -import static extension org.eclipse.papyrus.qompass.designer.cpp.xtend.CppUtils.nameRef; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil - -/** - * This class realizes the transformation from component-based to object-oriented - * models. It includes the replacement of ports and connectors. Ports are - * replaced with attributes and access operations, connectors within a composite - * by an operation that creates the initial setup. - * - * 1. add an operation that allows to retrieve the reference to an interface provided - * by a port. This operation has a mapping specific name, e.g. get_ - * 2. add an operation that allows to connect a specific port. - * the connect_q operation (*including a - * storage attribute*) for a port with a required interface - * 3. add an implementation for the getcnx_q operation for a port - * with a required interface (the operation itself has been added before) - * - * Problems: need to align bootloader creation with this mapping, since - * the bootloader may be responsible for instantiation - * - * Caveat: Assure that the folder derivedInterfaces already exists in a model. - * Otherwise the call to getProvided/getRequired interface might trigger its - * creation resulting in the corruption of list iterators (ConcurrentAccess - * exception) - */ -class StaticCppToOO implements IOOTrafo { - - protected LazyCopier copier - - def override init(LazyCopier copier, Class bootloader) { - this.copier = copier - } - - override addPortOperations(Class implementation) { - // only implementations (non abstract classes) have get operations for ports - if (Utils.isCompImpl(implementation)) { - addGetPortOperation(implementation) - } - // but all classes need a connection operation, since it does not rely on an implementation - addConnectPortOperation(implementation) - } - - /** - * Add the get_p operation for each port with a provided interface. It also - * adds a suitable implementation that evaluates delegation connectors from - * the port to a property within the composite. The delegation target could - * either be a normal class (no port) or an inner component. - * - * @param implementation - */ - def addGetPortOperation(Class implementation) { - for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { - val providedIntf = portInfo.getProvided() - if (providedIntf != null) { - - // port provides an interface, add "get_p" operation & - // implementation - val opName = PrefixConstants.getP_Prefix + portInfo.name - var op = implementation.getOwnedOperation(opName, null, null) - if (op != null) { - - // operation already exists. Assume that user wants to - // override standard delegation - if (op.type != providedIntf) { - op.createOwnedParameter(Constants.retParamName, providedIntf) - } - } else { - op = implementation.createOwnedOperation(opName, null, null, providedIntf) - val retParam = op.getOwnedParameters().get(0) - retParam.setName(Constants.retParamName) - StereotypeUtil.apply(retParam, Ptr) - - val behavior = implementation.createOwnedBehavior(opName, - UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - op.getMethods().add(behavior) - - val ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) - - // if there is an delegation to an inner property, delegate to it - // Make distinction between delegation to component (with a port) or - // "normal" class (without). - var String body - if (ce != null) { - val part = ce.partWithPort - val role = ce.role - - body = "return " - if (role instanceof Port) { - - // check whether the part exists within the implementation (might not be the case - // due to partially copied composites). - // Check is based on names, since the connector points to elements within another - // model (copyClassifier does not make a proper connector copy) - // TODO: this will NOT work for extended ports! - body += '''«part.nameRef»«PrefixConstants.getP_Prefix»«role.name»();''' - } else { - - // role is not a port: connector connects directly to a - // structural feature - // without passing via a port - // TODO: check whether structural feature exists - body += role.name - } - } else { - - // no delegation, check whether port implements provided interface - var implementsIntf = implementation.getInterfaceRealization(null, providedIntf) != null - if (!implementsIntf) { - - // The extended port itself is not copied to the target - // model (since referenced via a stereotype). Therefore, - // a port of an extended port still points to the - // original model. We try whether the providedIntf - // within - // the target model is within the interface - // realizations. - val providedIntfInCopy = copier.getCopy(providedIntf) - implementsIntf = implementation.getInterfaceRealization(null, providedIntfInCopy) != null - } - if (implementsIntf) { - body = "return this;" - } else { - throw new RuntimeException( - String.format(Messages.CompImplTrafos_IntfNotImplemented, providedIntf.name, - portInfo.port.name, implementation.name)) - } - } - behavior.getLanguages().add(Constants.progLang) - behavior.getBodies().add(body) - } - } - } - } - - /** - * Add a connect_ operation for ports with a required interface. - * Whereas operation and a behavior is added for each owned port, a behavior - * (method) is needed for ports inherited from a component type (the - * behavior is implementation specific, as it needs to take delegation to - * parts into account) - * - * @param implementation - */ - static def addConnectPortOperation(Class implementation) { - for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { - val requiredIntf = portInfo.getRequired() - if (requiredIntf != null) { - - // port requires an interface, add "connect_p" operation & - // implementation - val opName = PrefixConstants.connectQ_Prefix + portInfo.name - - if (implementation.getOwnedOperation(opName, null, null) != null) { - // do not add the operation, if it already exists. This means that the - // user wants to override it with custom behavior. In case of extended - // ports, we may have to do that. - } else { - var op = implementation.createOwnedOperation(opName, null, null) - val boolean multiPort = (portInfo.getUpper() > 1) || (portInfo.getUpper() == -1) // -1 indicates "*" - if (multiPort) { - - // add index parameter - val eLong = Utils.getQualifiedElement(PackageUtil.getRootPackage(implementation), - CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE) - if (eLong instanceof Type) { - op.createOwnedParameter("index", eLong as Type) - } else { - throw new RuntimeException( - String.format(Messages.CompImplTrafos_CannotFindType, - CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE)) - } - } - val refParam = op.createOwnedParameter("ref", requiredIntf) - StereotypeUtil.apply(refParam, Ptr) - - val behavior = implementation.createOwnedBehavior(opName, - UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - - op.getMethods().add(behavior) - - val ConnectorEnd ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) - - // if there is an delegation to an inner property, delegate to it - // Make distinction between delegation to component (with a port) or - // "normal" class (without). - var String body - if (ce != null) { - val part = ce.partWithPort - body = part.name - val role = ce.role - if (role instanceof Port) { - // in case of a delegation, use name of target port which might be different - val targetOpName = PrefixConstants.connectQ_Prefix + role.name - body = '''«part.nameRef»«targetOpName»''' - - // TODO: no check that multiplicity of both port matches - if ((portInfo.getUpper() > 1) || (portInfo.getUpper() == -1)) { - body += "(index, ref);" - } else { - body += "(ref);" - } - - } else { - // TODO: does this case make sense? - body += '''«part.name»;''' - } - } else { - // no delegation - create attribute for port - val attributeName = PrefixConstants.attributePrefix + portInfo.name - if (!Utils.hasNonPortOwnedAttribute(implementation, attributeName)) { - val attr = implementation.createOwnedAttribute(attributeName, requiredIntf) - LazyCopier.copyMultElemModifiers(portInfo.port, attr) - - // is shared (should store a reference) - attr.setAggregation(AggregationKind.SHARED_LITERAL) - } - body = attributeName - if(multiPort) body += "[index]" - body += " = ref;" - } - - // TODO: defined by template - behavior.getLanguages().add(Constants.progLang) - behavior.getBodies().add(body) - - // ------------------------- - // add body to get-connection operation (which exists already if the port is also - // owned, since it is synchronized automatically during model edit) - // getConnQ prefix may be empty to indicate that the port is accessed directly - // TODO: reconsider optimization that delegated required ports do not have a - // local attribute & associated operation (an inner class may delegate, but the - // composite may be using it as well). - if ((PrefixConstants.getConnQ_Prefix.length() > 0) && (ce != null)) { - val getConnOpName = PrefixConstants.getConnQ_Prefix + portInfo.name - var getConnOp = implementation.getOwnedOperation(getConnOpName, null, null) - if (getConnOp == null) { - getConnOp = implementation.createOwnedOperation(getConnOpName, null, null, requiredIntf) - val retParam = op.getOwnedParameters().get(0) - retParam.setName(Constants.retParamName) - StereotypeUtil.apply(retParam, Ptr) - } - val getConnBehavior = implementation.createOwnedBehavior(getConnOpName, - UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - getConnOp.getMethods().add(getConnBehavior) - - // no delegation - val String name = PrefixConstants.attributePrefix + portInfo.name - body = '''return «name»;''' - behavior.getLanguages().add(Constants.progLang) - behavior.getBodies().add(body) - } - } - } - } - } - - /** - * Add an operation "createConnections" that implements the connections - * between composite parts. It only takes the assembly connections into - * account, since delegation connectors are handled by the get_ and connect_ - * port operations above. - * - * @param implementation - */ - override addConnectionOperation(Class compositeImplementation) throws TransformationException { - var createConnBody = "" - val Map indexMap = new HashMap() - - for (Connector connector : compositeImplementation.getOwnedConnectors()) { - if (ConnectorUtil.isAssembly(connector)) { - - // Boolean associationBased = false - if (connector.ends.size() != 2) { - throw new TransformationException( - '''Connector <«connector.name»> does not have two ends. This is currently not supported''') - } - val end1 = connector.ends.get(0) - val end2 = connector.ends.get(1) - var cmd = '''// realization of connector <«connector.name»>''' + "\n" - if ((end1.role instanceof Port) && PortUtils.isExtendedPort(end1.role as Port)) { - val port = end1.role as Port - val EList subPorts = PortUtils.flattenExtendedPort(port) - for (PortInfo subPort : subPorts) { - cmd += ''' // realization of connection for sub-port «subPort.port.name»''' + "\n" - cmd += connectPorts(indexMap, connector, end1, end2, subPort.port) - cmd += connectPorts(indexMap, connector, end2, end1, subPort.port) - } - } else { - cmd += connectPorts(indexMap, connector, end1, end2, null) - cmd += connectPorts(indexMap, connector, end2, end1, null) - } - createConnBody += cmd + "\n" - } - } - - // TODO: use template, as in bootloader - if (createConnBody.length() > 0) { - val operation = compositeImplementation.createOwnedOperation(Constants.CREATE_CONNECTIONS, null, null) - - val behavior = compositeImplementation.createOwnedBehavior("b:" + operation.name, - UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - behavior.getLanguages().add(Constants.progLang) - behavior.getBodies().add(createConnBody) - behavior.setSpecification(operation) - } - } - - /** - * Create the body C++ code code that creates a connection between the two ends - * of a connector. This function checks whether the first end really is a receptacle - * and the second really is a facet. - * - * @param indexMap - * a map of indices that are used in case of multiplex - * receptacles - * @param connector - * a connector - * @param receptacleEnd - * an end of the connector that may point to a receptacle port - * @param facetEnd - * an end of the connector that may point to a facet port - * @param subPort - * a sub-port in case of extended ports - * @return - * @throws TransformationException - */ - static def connectPorts(Map indexMap, Connector connector, ConnectorEnd receptacleEnd, - ConnectorEnd facetEnd, Port subPort) throws TransformationException { - val association = connector.type - if ((receptacleEnd.role instanceof Port) && (facetEnd.role instanceof Port)) { - val facetPort = facetEnd.role as Port - val receptaclePort = receptacleEnd.role as Port - val facetPI = PortInfo.fromSubPort(facetPort, subPort) - val receptaclePI = PortInfo.fromSubPort(receptaclePort, subPort) - - if ((facetPI.getProvided() != null) && (receptaclePI.getRequired() != null)) { - val facetPart = facetEnd.partWithPort - val receptaclePart = receptacleEnd.partWithPort - - var subPortName = "" - if(subPort != null) subPortName += "_" + subPort.name - val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) - val setter = '''«receptaclePart.nameRef»connect_«receptaclePort.name» «subPortName»''' - val getter = '''«facetPart.nameRef»get_«facetPort.name» «subPortName»()''' - return '''«setter»(«indexName»«getter»);''' + "\n" - } - - } else if (receptacleEnd.role instanceof Port) { - - // only the receptacle end is of type port. - val Port receptaclePort = receptacleEnd.role as Port - if (PortUtils.getRequired(receptaclePort) != null) { - val facetPart = facetEnd.role as Property - val receptaclePart = facetEnd.partWithPort - - val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) - val setter = '''«receptaclePart.nameRef»connect_«receptaclePort.name»''' - val getter = '''&«facetPart.name»''' - return '''«setter»(«indexName»«getter»);''' + "\n" - } - } else if (facetEnd.role instanceof Port) { - - // only the facet end is of type port. Unsupported combination - val facetPort = facetEnd.role as Port - if (PortUtils.getProvided(facetPort) != null) { - val facetPart = facetEnd.partWithPort - val receptaclePart = facetEnd.role as Property - - val setter = receptaclePart.name - val getter = '''«facetPart.nameRef»get_«facetPort.name»();''' - return '''«setter» = «getter»;''' + "\n" - } - } else if (association != null) { - - // both connector ends do not target ports. In this case, we require that the connector is typed - // with an association. We use this association to find out which end is navigable and assume that - // the part pointed to by the other end is a pointer that gets initialized with the part of the - // navigable end. - val facetPart = facetEnd.role as Property - val receptaclePart = receptacleEnd.role as Property - - val assocProp1 = association.getMemberEnd(null, facetPart.type) - - // Property assocProp2 = facetPart.getOtherEnd() - if ((assocProp1 != null) && assocProp1.isNavigable) { - val setter = '''«receptaclePart.nameRef»«assocProp1.name»''' - val getter = '''&«facetPart.name»''' - return '''«setter» = «getter»;''' + "\n" - } - } else { - - // not handled (a connector not targeting a port must be typed) - throw new TransformationException("Connector <" + connector.name + - "> does not use ports, but it is not typed (only connectors between ports should not be typed)") - } - return "" - } - - /** - * Handle ports with multiplicity > 1. The idea is that we could have - * multiple connections targeting a receptacle. The first connection would - * start with index 0. Implementations can make no assumption which - * connection is associated with a certain index. [want to avoid associative - * array in runtime]. - * - * @param port - * @param end - * @return - */ - static def getIndexName(Map indexMap, Port port, ConnectorEnd end) { - if ((port.getUpper() > 1) || (port.getUpper() == -1)) { - - // index depends of combination of property and port, use connector - // end as key - var indexValue = indexMap.get(end) - if (indexValue == null) { - indexValue = 0 - indexMap.put(end, indexValue) - } - var index = indexValue + ", " - indexValue++ - indexMap.put(end, indexValue) - return index - } - return "" - } - - /** - * Return true, if the bootloader is responsible for the instantiation of a - * part. [Structual difference: bootloader can decide instance based - and - * instances are deployed] - * - * If a part is a component type or an abstract implementation, it cannot be - * instantiated. Thus, a heir has to be selected in the deployment plan. - * Since the selection might be different for different instances of the - * composite, the instantiation is not done by the component itself, but by - * the bootloader. The bootloader also has to instantiate, if different - * allocation variants are required. (this is for instance the case for - * distribution connectors and for the system itself) - * - * If possible, we want to let composites instantiate sub-components, since - * this eases the transition to systems which support reconfiguration. - * - * [TODO: optimization: analyze whether the deployment plan selects a single - * implementation. If yes, let the composite instantiate] - * - * [TODO: elements within an assembly need to be instantiated by composite - - * if System - by bootloader. assembly also need to be instantiated by - * composite!! - * - * @param implementation - * @return - */ - static def instantiateViaBootloader(Class implementation) { - return implementation.isAbstract() || Utils.isAssembly(implementation) - } - - /** - * Return whether a part needs to be instantiated by the bootloader instead - * by the composite in which it is contained. The criteria is based on the - * question whether the containing composite is flattened, as it is the case - * for the system component and the interaction components for distribution. - * - * @param part - * @return - */ - static def instantiateViaBootloader(StructuralFeature part) { - if (part != null) { - if (part.type instanceof Class) { - val implementation = part.type as Class - // TODO: wrong criteria? (must be shared or not?) - return instantiateViaBootloader(implementation) - } else { - - // not a class, assume primitive type instantiated by composite - return false - } - } - return false - } - - /** - * Transform parts if necessary. - * - * If the bootloader is responsible for creating an instance (if it is a - * abstract type), mark the associated part as a C++ pointer. We do not want - * to change the aggregation kind, since it remains logically a composition, - * it is merely an implementation issue that it must be a pointer for C++ if - * the concrete type is not yet known. - * - * @param compositeImplementation - * a (composite) component - */ - override transformParts(Class compositeImplementation) { - - for (Property attribute : Utils.getParts(compositeImplementation)) { - val type = attribute.type - if (type instanceof Class) { - val cl = type as Class - - // => requires adaptations of boot-loader which is then only - // responsible for creating instances corresponding to types - if (instantiateViaBootloader(cl)) { - StereotypeUtil.apply(attribute, Ptr) - } - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/xtend-gen/.gitignore b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/xtend-gen/.gitignore deleted file mode 100644 index c96a04f008e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/.classpath b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/.project b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/.project deleted file mode 100644 index 95ded03ad32..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.qompass.designer.doc - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index c537b63063c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/META-INF/MANIFEST.MF deleted file mode 100644 index d043db34c31..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/META-INF/MANIFEST.MF +++ /dev/null @@ -1,14 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.help;bundle-version="3.5.0", - org.eclipse.ui.cheatsheets;bundle-version="3.4.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.qompass.designer.doc.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.doc;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/about.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

November 14, 2008

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/build.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/build.properties deleted file mode 100644 index 7ea784f3854..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/build.properties +++ /dev/null @@ -1,12 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = .,\ - plugin.xml,\ - help/,\ - cheatsheet/,\ - html/,\ - toc.xml,\ - about.html,\ - plugin.properties,\ - META-INF/ -src.includes = about.html diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/AddPorts.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/AddPorts.xml deleted file mode 100644 index 59c01e6c693..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/AddPorts.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - Model the ports of a component - - - - - - - - Select a port from the "Palette", under "Nodes", and create a new - port on a component type or implementation.
-
- Note: a port of a component type is implicitly included in all - component implementations inheriting from it
- Note: inherited ports are not shown by default. In order to visualize these, do - not create a new port, but drag and drop the inherited port from the - model explorer on the component that inherits the port. -
-
- - - - Your ports need to be named and a port kind (see below) needs to be chosen. - There are several ways to change a port name: either via the - "Properties" view or via a textual dialog that is shown once F2 is pressed. - - An Qompass (FCM) port has an additional parameter: it is characterized by a - port kind. The latter defines for instance if the port - provides or requires an interface or consumes a data-type.
- A port kind may require a certain variant of a type: data-flow oriented kinds - require a datatype, client/server port kinds require an interface as port type. The user can - verify the suitability of the port type by observing the derived attributes provided and - required interface. If both are not set, the port is wrongly typed. This rule is part of - a set of Qompass related constraints that can be validated at any time. -
-
- Assign the port kind attribute: - "Properties" view > Profile > under "Port" and "kind". - Select the value of the port kind. The shown list is a collection of all PortKinds that are - defined in the model itself or one of the libraries it imports. For example, if the ports - requires an interface, the value of the port kind is "BasicCalls::PortKind::UseInterface"
- Note that the stereotype "Port" from the profile FCM is applied automatically - on all the ports you add to your model. -
-
- - - - As for the name, this can be either be done via the "Properties" view or via - a textual dialog that is shown once F2 is pressed. But before a type can be selected, it may have to - be created first. - In our example we want to type the port with an interface which is stored in an additional - package called "interfaces". - - As a good practice, you can group interfaces that are referenced by multiple components in a - package called "interfaces" - "model explorer" view > Right-click on - "ComponentModel" package > New child > Package > Name it "interfaces"
-
- Then, under "interfaces" package, create a new class diagram: - "model explorer" view > Right-click on - "interfaces" package > New diagram > Create a new Class Diagram.
-
- Open your class diagram and add an interface and operation in standard Papyrus way. -
-
- - - - The component that is executed at system startup has to be clearly defined. - Such a component has to inherit from the component type "Cstart" that is defined - in the "BasicCalls" library in the package "StdPorts". It has the port "start" with the provided interface - "IStart", containing the operation run. This operation is called at application start.

- The addition of Cstart to your composite diagram is performed in 5 steps:
- 1 - Expand the imports in the "Outline" view > Expand the library - "BasicCalls" > "StdPorts" >. Select "Cstart" component type.
- 2 - Drag and drop the component type "Cstart" in your composite diagram.
- 3 - (Optionally) If you want to visualize the port in the diagram, drag and drop the port - "start" on the newly added "Cstart" component.
- 4 - Add a "Generalization" link that points from your component (type/implementation), - to "Cstart".
- 5 - (Optionally) If you want to visualize the port in the diagram, drag and drop the port - "start" to the application component - - - - - - A component may want to perform actions directly after instantiation and before destruction. - Such a component has to inherit from the component type "LifeCycle" that is defined - in the "BasicCalls" library in the package "StdPorts". It has the port - "lc" with the provided interface "ILifeCycle", containing the operations - activate and deactivate. - The addition of LifeCycle to your composite diagram is performed in 5 steps:
- 1 - Expand the imports in the "Outline" view > Expand the library - "BasicCalls" > "StdPorts" >. Select "LifeCylce" component type.
- 2 - Drag and drop the component type "LifeCycle" in your composite diagram.
- 3 - (Optionally) If you want to visualize the port in the diagram, drag and drop the port - "lc" on the newly added "LifeCylce" component.
- 4 - Add a "Generalization" link that points from your component (type/implementation), - to "Cstart".
- 5 - (Optionally) If you want to visualize the port in the diagram, drag and drop the port - "lc" to the application component -
-
- diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeCompilation.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeCompilation.xml deleted file mode 100644 index a8de088de93..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeCompilation.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Finally, compile the generated code on each node. - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeGeneration.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeGeneration.xml deleted file mode 100644 index 3de326cbd43..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeGeneration.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Once the allocation is specified, the Qompass plug-in applies a sequence of model transformations to generate the code required on each node. - - - - - Select a deployment plan. Right click and choose "Qompass: generate deployment models and code from plan". Choose among - the available options: (1) only generate a target model and not code, (2) re-create compilations settings and (3) only - generate code for types that have changed. The first option is useful for testing purposes or if the intermediate - models produced by Qompass are inputs for other models. - The second option is useful, if additional container or connector elements require additional libraries that would not - found otherwise. But it overrides user settings. - The last option aims to reduce the time for generating an executable: for each elements that is re-generated, the associated - file need to be re-compiled. - The Qompass plug-in applies a sequence of model transformations that
- (1) add and adapt connectors and containers as required by the application, - (2) transform the component model into an object-oriented model, i.e. replace ports with attributes and suitable access operations, - (3) create boot-code that instantiates the components and - (4) calculate the sub-set of the resulting model that is required on each node. - Qompass produces a new plugin for each node of the platform model. It contains a suitable project - definition (Eclipse CDT) in the sense that the build settings (macros, include and library paths) - should be configured for the application needs. It also contains a folder "model" along with - the generated model (called "root.uml") and applies the standard UML model-to-code generators - (currently C++) to produce the code required on each node and " -
-
-
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentDev.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentDev.xml deleted file mode 100644 index 242e723f337..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentDev.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - In this step, you model a component within a composite diagram. - - - - - - The first decision is whether you want to define a component type or a component implementation. - A component type is useful, if you anticipate that more than one implementation are required sooner or later. - The decision is comparable to the decision whether interfaces should be used in an object-oriented - approach: it is more flexible, but requires an additional definition (beside this reflection, there is nothing to do - in this step). - - - - - - As a good practice, we recommend to create a package for each component which will group all - component-related elements e.g. type, implementation(s) and associated diagrams.
- ModelExplorer > Right-click on your "ComponentModel" package > Add child > Package. - Name the created package according to your application needs. A convention (not enforced) used in Qompass is - to use the same name for the package and component type, add the post-fix "Impl" in case of a - component implementation. - Show View > Papyrus > Model Explorer (or select Papyrus perspective)" skip="true"> - - -
-
- - - - Select the package created in the previous step (or the top-level package). Create a composite diagram and open it. Right-click on your package in the - model explorer > new diagram > Create a new Composite Diagram. - - - - - - Create a class. Make it abstract (via the properties view) if it is a component type. - Choose a name which suits your application needs. If you created a type, you - might also want to add an implementation. Convention (not compulsory): use the same name as for the type - and add the postfix "Impl". The link between component type and implementation is manifested by means - of generalization relationship. Use the standard Papyrus mechanisms to create this relationship. - (The realization of an implementation is described in more detail in step 4). - - - - - - A component is optionally enclosed by a so-called container which can perform additional processing. - So called container extensions either intercept incoming port request or perform additional processing. - For further information, consult the Qompass online help. From a user perspective, the choice of a - certain container option is controlled by the application of an ordered set of container rules. - which select the extension or interceptor to use and optionally restrict the use of the rule to - a specific configuration (see deployment)

- - Qompass provides a specific dialog to selected a container extension. This can be found in the context - menu of a component. -
-
- - - - A specific component is typically called "System". It is the main component that will be instantiated - later on. This component is the root of the composition hierarchy, your application components are - parts within it - it is a composite or assembly implementation and further information is therefore - available in the next section. It must not have any ports. - - - -
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentImplementation.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentImplementation.xml deleted file mode 100644 index 335fb27986a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentImplementation.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - A component implementation has to realize the operations of interfaces that are provided by - its ports. For each port, there are two options: either the component implements the interface - itself, or it delegates the port to a part which has to implement the interface. - If a component does not have any parts, we call it primitive (or monolithic). - - - - - - If order to implement the operations of a provided interface, these operations have to be - added to the component first. Since it would be tedious to copy an operation signature manually - and keep it synchronized, Qompass offers an operation "Synchronize derived elements" in the - context menu of a component. It will automatically add an "interface realization" - relationship and the operations of the provided interfaces - as long as there is no delegation - to an internal component. These relationships carry the FCM stereotype "DerivedElement" - in order to indicate that these have been added automatically. - - - - - - The implementation could use either the UML action language or a programming language specific - implementation in form of an opaque behavior definition (not yet supported). Here, we will cover - the case of C++
- Activate the C/C++ view (Views > Papyrus > C/C++). Then, select the operation in the - model explorer or diagram. Enter your code. Note that you can call operations of required ports - by using the port name as a property, i.e. in case of C++ use "portName" -> "operation name" -
- - - - - - -
- - - - An component implementation may have an internal structure, i.e. if may contain other components - via composition. Please note that the containment does not mean that a new component is defined - in an existing one, but that the composite component contains an attribute typed with another - component. If this attribute has the "composition" aggregation style, the creation of - an instance of the composite component implies creating an instance of the contained component.
-
- The "System" component is a specific composite implementation of your system. - It does not have any implementation of its own but is a kind of aggregation container of your - application components and defines how these are connected (see next step). -
- - - - -
- - - - Once the inner parts have been added, the may be connected. Connectors may either delegate - from the composite towards an inner part or connect (assemble) two (or more) internal parts. - A connector may connect either the ports of internal parts or directly an internal part. For the - moment, Qompass supports only the first option. It may be required to drag and drop ports first from - the model explorer to a part (whose type owns the port).
-
- A major concept in Qompass is that of a connector. Instead of simply being a "line" between - parts, a connector may be realized a specific interaction component. Which interaction component - is used, is defined by an FCM stereotype attribute owned by the connector. The Qompass palette allows - you to add a connector with the appropriate FCM stereotype directly to your component.
-
- In addition, Qompass provides a specific dialog for the selection of an interaction component. - (open the context menu, once a connector is selected). -
-
-
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentModel.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentModel.xml deleted file mode 100644 index 7af6183b976..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentModel.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - A component model consists of a set of component definitions. Each component may be either a - primitive (or monolithic) component or a composite component. Whereas the latter contains one - or more parts typed with other components, the former does not contain other components. - Typically, a composite component delegates services provided by some of its ports to inner - components while a primitive component implements the services itself. - There are different strategies, in which order components are implemented, e.g. starting - with the composite components and then defining the sub-components (top-down) or vice-versa - (bottom-up). Both strategies could be mixed. - - - - - In this step, you start by modeling your system in a composite diagram. -

Start modeling the system type and implementation. -

A component defines a type when it has more that one implementation, - or when the evolution of the component envisions to group a set of implementations using a type definition. - Optionally, a component may be abstract, i.e. does not provide an implementation. -

As a good practice, we recommend to define component type only when necessary. -

In the following, we will define a component type for the components that we will create. -
- - - - - - - - - - - - - - - - - - - - -
- - - In this step, you model the monolithic components that your system includes (i.e., the internal parts of your system). -

Start by modeling the components type, implementation, and their ports in a "component diagram" then model their interfaces in "class diagrams". -
-
-
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/DeploymentPlan.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/DeploymentPlan.xml deleted file mode 100644 index 726d08968d4..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/DeploymentPlan.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - Generate the instance specification of the system and its internal parts, specify values for configuration attributes and finally - allocate to nodes - - - - - - Up to now, we have modeled components and their composition, but we have not yet instantiated these. - The convention in Qompass is that a single component, typically called System, is the primary - instance. The instantiation of this component implies an instantiation of its parts which - in turn will instantiate their parts (if composites). This instantiation process is - automated by Qompass. The generated instances are part of a package which we call deployment plan - in the sequence. -
- The automatic generation of the initial deployment plan is performed as follows: - Right click on your "system" component > Qompass: Instantiate system (create deployment plan). - As a result, a "newDeploymentPlan" package is created within "DeploymentPlans". Note that a - deployment plan is a stereotyped UML package serving as a container for the instance - specifications. A stereotype attribute points to the main instance. -
-
- - - - The initial deployment plan contains information about the instances within their system (along with their allocation - to a node, see next step). Each instance may have a set of attributes that are subject to configuration, e.g. a FIFO - component might have an attribute that denotes its size or the application of a specific policy. By default, all - attributes that are part of a component type, are considered as configuration attributes, attributes of implementations - need to be marked explicitly by the stereotype FCM::ConfigProperty. UML supports the specification of values via slots. - This is done in Qompass as well, a custom dialog facilitates this configuration: - Right click on your "system" component > Qompass: Configure instantiate properties. - The dialog displays a set of instance specifications that are associated with the property. The - previous operation should have created these instances (there should be one instance per deployment plan). - Once an instance is selected, the user can select a configuration attribute and provide a value for it. If the attribute - has an attached comment, it is assumed to be a description of the configuration attribute and displayed in the dialog - (this is the case for elements of the Qompass library). - - - - - - In order to deploy the system, the instances created before need to be allocated to a - node. The allocation relationship is transitive in two directions: if a composite component - instance is allocated to a node, all sub-instances (= instances of contained parts) are - implicitly also allocated on this node. Vice versa, a composite needs to exist on all - instances where its sub-instances are allocated. -

- Qompass supports the allocation by means of a specific dialog. It is available in the - context menu of a deployment plan. -
-
- -
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Main.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Main.xml deleted file mode 100644 index 7196d1103ef..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Main.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - Introduction - This guide will walk you though the process of creating an "Qompass-supported" model and generate the code related to your model. - You will create an empty model and build it gradually to finally generate the related code. - - If you need help at any step, click the (?) to the right. Let's get started! - - - - - Either create a new Qompass model or start with a working example - - - - - - - - - - - - - - - - - - - - - - - - - - Conclusion - - - - - - - - - - - - - - - - Conclusion - - - - - - - Conclusion - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddComponents.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddComponents.xml deleted file mode 100644 index f7ec40e7aa4..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddComponents.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - In this step, you model the application components as forseen by MARTE GCM & HLAM. - - - - - - Use the model explorer to create a new composite diagram within the "ComponentModel" package - - - - - Select an element from the MARTE/HLAM palette, i.e. a RtUnit or a PpUnit. These are available, - if the MARTE profile is applied (which should be the case, if you have chosen the Qompass for MARTE template - during model creation). - Now create the GCM component in the diagram. Mapping rules in Qompass will automatically add the FCM implementation - stereotype and set its container rule attribute appropriately to support the two component variants.
- Verify stereotype application/attribute values in the properties/profile view. Alternatively, right click on - the created component and call the "Qompass show/choose container rules" dialog. -
-
- - - Click on the "?" on right to open the online html help - - -
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddPorts.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddPorts.xml deleted file mode 100644 index 38233bc7312..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddPorts.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - In this step you will add ports to your MARTE/GCM components - - - - - Use the model explorer to create a new composite diagram within the "components" package - Use the standard MARTE mechanism to add ports, i.e. client/server or flow ports - the associated - FCM stereotypes will be set automatically. - - - - - Click on "?" on the right to open the online html help - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteMain.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteMain.xml deleted file mode 100644 index e32ef8326fe..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteMain.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - Introduction - This guide will walk you though the process of creating a MARTE model with "Qompass-support" - and generate the code related to your model. - You will create an empty model and build it gradually to finally generate the related code. - If you need help at any step, click the (?) to the right. Let's get started! - - - - - Either create a new Qompass model or start with a working example - - - - - - - - - - - - - - - - - - - - - - - - - - Conclusion - You have now created a MARTE component which has at the same time FCM annotations. You can now - proceed with implementation and deployment as for a standard FCM component - - - - - - - Conclusion
- You have now created a MARTE component which has at the same time FCM annotations. You can now - proceed with implementation and deployment as for a standard FCM component -
- -
- - - - - - - - - - - - Conclusion
- You have now a project, a model and source code for each target. -
- -
- - - - Conclusion
- You have now a binary per target which is ready for deployment. The actual transfer - to the target is out of Qompass's scope. -
- -
-
-
diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteNewModel.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteNewModel.xml deleted file mode 100644 index dbbe1802e86..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteNewModel.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - In this step you will create a new Qompass Model for MARTE, i.e. a MODEL that applied MARTE GCM as well as the - FCM profile. - - - - Start setting up your environment's perspective. - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/NewModel.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/NewModel.xml deleted file mode 100644 index 68c3c72b990..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/NewModel.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - In this step you will create a new Qompass Model which applies the profile and optionally MARTE GCM - - - Start setting up your environment's perspective. - - - - - Start creating the project that will host your model or create a new model within an existing project. - File > New > Project > Papyrus project > Enter your project name, then select UML as diagram language. On the next page, choose one of the Qompass templates - (currently two, one including MARTE and one without) - - - - - - If you need to create additional models within a project, you can do this at any time using the - Papyrus model wizard. In the context of this tutorial, you can simply skip this step. - Enter your model name, then select UML as diagram language. On the next page, choose one of the Qompass templates - (currently two, one including MARTE and one without) - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/OpenExample.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/OpenExample.xml deleted file mode 100644 index e6e0d5537a6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/OpenExample.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - In this step you will create a new Qompass model from an example - - - Start setting up your environment's perspective. - - - - - Creating the project that will host your model. You can skip this step, if you want to create the model - in an existing project. - File > New > Project. Enter your project name. - - - - - - Create a new model from an example. - File > New > Example. Choose an Qompass example. Select the parent folder (it is not possible - to change the name of the example, since the model files reference each other. Use File > Save As after opening, - if required). - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/PlatformModel.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/PlatformModel.xml deleted file mode 100644 index 894c7172939..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/PlatformModel.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - The platform modeling consists in specifying the set of nodes on which the system - will be deployed. - - - - - - The platform definition contains a set of nodes. Each node represents a computation resource on a type level. - The specification of a platform is quite similar to the specification of a composite component: it is done by - means of a component (class) whose parts represent the nodes. Each of the parts is typed with a node. Since a - node is a class as well, the inner structure of a node can be equally modeled via parts. Thus, a hardware - specification can be organized hierarchically. - As for software components, we are in the end interested in the instances of our computation resources. An - operation of the Qompass context menu will create this hardware instances from the class representing the hardware - in a similar way as a deployment plan is created. - - Use the FCM stereotype "Target" on nodes to provide information about supported operating system and - available RAM and ROM (currently only the supported operation system information is evaluated). - A node represents a certain type of a computing resource, UML instance specifications represent a concrete - node instance. This concept is useful, if several identical nodes are used within a system. - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Validation.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Validation.xml deleted file mode 100644 index d9822313b5d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Validation.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Model validation enables the verification of a certain set of rules. Besides the standard UML rules, - Qompass defines a dozen of additional rules, for instance a validation of the typing rules for - ports. - - - - - Verify the validation settings, i.e. the currently active validation rules (constraints). - Open the entry "Model Validation" within Window/Preferences and verify the active constraints. - Qompass related constraints are grouped. - - - - - Validate your model. Click right on an element within the model explorer. Choose - the option "Validate model". Erroneous elements will appear in the Problem view, - will be marked in the model explorer and in the diagrams. Caveat: the model explorer - creates a visual marker for problems found within a child whereas this is not the case for - diagrams. - - - - - Window > Show View > Problems - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/index.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/index.xml deleted file mode 100644 index 6ca8880c3dc..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/index.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/tocconcepts.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/tocconcepts.xml deleted file mode 100644 index a70c9f0c946..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/tocconcepts.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/tocdevguide.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/tocdevguide.xml deleted file mode 100644 index 254dbf34b5d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/tocdevguide.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/tocreference.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/tocreference.xml deleted file mode 100644 index 7f27d062c18..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/help/tocreference.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/bibliography.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/bibliography.html deleted file mode 100644 index a5bec374c1b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/bibliography.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Bibliography - Qompass - - - -Qompass logo -

Bibliography

- -
-
-[1] -
-E. Bruneton, T. Coupaye, and J. Stefani. -The Fractal Component Model, 2004, -Fractal specification. - -
-[2] -
-OMG, CORBA Component Model Specification, V3.3 (part 3 of the - CORBA specification), 2012, -OMG Document formal/2012-11-16. CORBA 3.3 - -
-[3] -
-OMG, UML Profile for MARTE: Modeling and Analysis of Real-Time - Embedded systems, Version 1.0, 2009. -OMG document ptc/2009-11-02.MARTE 1.1 - -
-[4] -
-S. Robert, A. Radermacher, V. Seignole, S. Gérard, V. Watine, and F. Terrier, -Enhancing Interaction Support in the CORBA Component Model. -In A. Rettberg, M. C. Zanella, and F. J. Rammig, editors, From - Specification to Embedded Systems Application, IFIP TC10 Working Conference: - International Embedded Systems Symposium (IESS). Springer, 2005. - -
-[5] -
-S. Robert, A. Radermacher, V. Seignole, S. Gérard, V. Watine, and F. Terrier. -The CORBA Connector Model. -In Proceedings of the 5th International Workshop on Software Engineering and Middleware. ACM Digital Library, 2005. - -
-[6] -
-M. Shaw and D. Garlan, Software Architecture: Perspectives on an Emerging Discipline, Prentice Hall, 1995. -
- - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/codegen.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/codegen.html deleted file mode 100644 index 37adce760f1..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/codegen.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Code generation - - - -Qompass logo - -

Code generation

- -The result of the previous phase is a component model of the application, enriched with reified connectors and expanded containers. -The code generation starting from this model requires two actions: (1) the realization of the component deployment consisting of a -splitting the global model into sub models for each execution node and (2) the transformation of ports and connectors that do not have -a direct equivalent concepts in object-oriented programming languages. - -

-The former is not as trivial as it may seem since dependencies have to be taken into account and composites may have to be -deployed on multiple nodes due to allocations of theirs parts. This imposes constraints such as only read-only attributes in -these composites to ensure consistency. We do not discuss this issue further in the context of this paper and focus on the -second aspect, the transformation of ports and connectors. - -

-Ports and connectors do not possess a direct equivalent in an object-oriented programming language. -Thus, it is necessary to relate component-oriented concepts to object-oriented concepts, i.e. classes, interfaces, attributes -and operations. -We distinguish ports with provided interfaces and ports with required interfaces (a port might also have both). -A port providing an interface is an access point to a service and a caller needs to obtain a reference to this service, in -our implementation pattern via a specific operation. For instance, if a component owns a port "p" providing interface "I", -the realization of a component needs an operation "get_p" returning a reference to the service. The implementation of this -operation is determined automatically: in case of a delegation connector between the port and an internal part of a component, -this reference is returned, otherwise a reference to the component reference itself is returned. - -

-A port with a required interface is an interaction point which requires a reference of another component that provides the -interface. Thus, the component needs to store this reference and provide an operation to initialize the reference in the moment -of instantiation. For instance, a port "q" with an required interface is transformed into an attribute which stores a reference -to a port providing the interface and an operation "connect_q" which initializes this reference. - -

-Connectors within a composite are transformed into a realization of a specific operation that creates the connections between -parts, i.e. contains suitable combinations of some-part.connect_some-port other-part.get_other-port. - -

-Once the transformation of component-based models to object-oriented models is done, a "classical" code generator taking an -object-oriented UML model as input is sufficient for the code generation (in our case C++). -For each class or interface, a C++ class is generated. The UML packages are transformed into C++ name spaces. The organization -of the files follows the same as in Java. A name space corresponds to a directory and thus reflects the package structure in UML. - -

-The dependencies to the external packages are translated into include directives to libraries. The generated code can now -be compiled, for instance in the context of the Eclipse CDT environment. - -

- - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/connector-container.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/connector-container.html deleted file mode 100644 index 057bf4612d1..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/connector-container.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - Connector and container pattern - - - - -Qompass logo -

Connector and container pattern

- -

-The connector pattern is based on the idea of Garlan and Shaw that a realization of an interaction must be -a first class citizen of the application model. It must be possible that an interaction - like an -application component - has multiple realizations and can be configured. The idea of connectors has been -formalized in the context of UML in [4] and [5]: a UML connector - a "line" within a composite class - is replaced by an - interaction component as shown in the left part of Fig. 3. - -

-The interaction component is typically defined in a model library in form of a template. This is required, -since the interaction component must be able to adapt to the context in which it is used. For instance, in case of -an operation call of a component, the interaction component must provide the same operation as the component. -In most cases, the formal parameter of the template is either an interface or a data-type. The implementation of -the interaction component must be adapted as well, in order to correspond to the interface. The implementation body -is thus provided in a form a a template of a typical model-to-text (M2T) language, in our case Acceleo. - -

-The container pattern may be used to modify the way a component interacts with its environment. This pattern has been -identified by existing middleware solutions, such as -CCM[2] and -Fractal[1]. -The container encapsulates an object (component) and can provide additional service and observer or manipulate the -interactions with the component. In order to enhance flexibility (and readability) of the application model, it is -preferable to add information about the container (in form of rules) to the model, but not the container itself. -Thus, a transformation step adds the container to the model. - -

- -

- -
-Connector reification and container expansion -
- -

-The right side of Figure 3 shows this principle: a component "C" is enriched with rules -to apply. This information is evaluated by a transformation that creates the container and adds the elements that are -associated with the rule. The component becomes an executor, i.e the business code behind a component. It is possible -to distinguish two different types of elements within the container: the interceptor and the extensions. The -interceptor is placed on a delegation connection between a port of the container and the executor. The extension is -an additional element which can be connected with external ports of the container. -

- -

- -
-Container rule for a state machine -
- -

-The current container libraries offer for instance the production of execution traces or the realization of mutual access. -An interesting feature is the support for state-machines. Its realization requires three elements within the container: -the state-machine itself, an event pool and an interceptor which feeds the pool (e.g. each time an operation is called, -an associated call event is produced). These elements are captured by the rule shown in Figure 4. - -

-In a similar way as the FIFO interaction component, the state machine and the interceptor are defined in a package template. -The model of the state machine is defined for a component (class). The implementation of the state machines depends on the -formal parameter which is instantiated with a class. The message interceptor is typed with an interface, since it primarily -captures call-events. - -

-The following code fragment describes the template of an operation which manages the execution of a state-machine. -The code, here using the C++ language, is modeled by an UML opaque behavior. The access to the model element is embedded -between [ and /], i.e. [name/] allows to access the name of a UML element. This excerpt shows -the power to adapt the behavior of embedded components via the container to add new functionality that is well separated -of the business code. - -

-

-[for (sm : StateMachine | ownedBehavior->select(oclIsKindOf(StateMachine)))]
-switch(m_currentState)
-{
-    [for (state : State | sm.region.subvertex->select(oclIsKindOf(State)))]
-    case [clazz.name/]_[state.name/]:
-    ...
-    [/for] ...
-
- -

-The instantiation of the template with a fictive class "A" is shown in the next code fragment. This class contains a -state machine with the state "state1", which appears in the code's "switch" statement. In each state, the events defined -as triggers for transitions are compared with the event read from the pool (in which a timer or interceptor write). - -

-

-switch(m_currentState) 
-{
-    case A_state1:
-    ...
-
- -

- -

-


- - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/input-models.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/input-models.html deleted file mode 100644 index 1d910b4c70c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/input-models.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - Qompass - - - -Qompass logo -

Input models

- -The set of input models contains three sub-models that are shortly described in the sequel: -
    -
  1. the software component model, -
  2. the hardware platform and -
  3. the deployment model. -
- -In the context of this page, the input models are discussed without referring to a specific example. Sample models are available via the Qompass -online help or via the "create-new example" dialog of Eclipse. - -

Component model

- -We use the UML MARTE component model that describes components (with their internal behavior), and the interaction points (ports) -characterized by the transferred data or by the provided/required services. Interactions are realized by the design patterns described -in section Connector/Container. -The concurrent behavior is specified via the HLAM (High Level Application Modeling) sub-profile of MARTE. This concurrency model -identifies the components that possesses execution resources (RtUnit) and the shared ones (PpUnit) which do not have execution resources, -but resources that manage the concurrent access. - -

Platform model

- -A hardware architecture is described in a similar way as the logical architecture by composition of elements. A class called -"HWArchitecture" represents the complete platform. The attributes of this class represent nodes. Each node is typed with a class -that captures the properties of this node. Each node can have a further internal structure, a hierarchical structure -can thus be modeled. -

- - -

Deployment model

- -The deployment of an application consists to define the component instance, their configuration and their allocation to an -execution node. The UML composite structure defines the roles that are played by each component of the system. The deployed -component is always an instance of a component that has a specfied allocation to an execution resource (node or thread) and -a specific configuration. In UML, an instance is defined by an "InstanceSpecification", the values of properties are given via -"slots". In case that the property represents a sub-component, the associated value is a further instance specification. The -resulting hierarchical structure is quite difficult to maintain and is automatically generated and maintained by tools. - -A component-based system requires a configuration. The configuration attribute of a timer for instance define its frequency. The -values of this configuration attribute can be defined at two different levels. -
    -
  • on declaration level by associating a default value with an attribute -
  • on instance level, by specify a corresponding slot value -
-Once all component are instantiated and configured, they can be allocated. - -The allocation phase consists of defining the relation between the the instances of software components and those of the platform elements. -The Figure below describes the deployment of the component DeviceControlMonitor and PGController on the hardware platform. The MARTE -"Allocate" relationship is used to describe the allocation model. - -The allocation can be refined by introducing local resources of the platform between the application the hardware platforms -- in -MARTE via the concept of a "SwSchedulableResource". - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/overview.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/overview.html deleted file mode 100644 index 9148d7e6230..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/overview.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Qompass - - - -Qompass logo - -OMG MARTE - -

Overview

- -Qompass Designer is a component based modeling approach that supports the code generation from embedded -systems. Theses systems are characterized by timing and resource constraints - sometimes also -denoted as non-functional properties. Since these systems get more and more complex, it is important -that the non-functional properties are not just specified in the documentation and respected by the -implemented system, but that these are explicitly modeled and suitable code is derived from the model. - -Qompass Designer is part of the Qompass tool-suite integrated into Papyrus. The separation of concerns between -the two tools is that -
    -
  • Qompass analyzer analyzes a system, in particular with respect to schedulability - analysis. It enables the validation of several variants to allocate software components to execution - resources and thus provides an architectural exploration -
  • Qompass designer supports the code generation for a specified architecture. It enables this code - generation by means of a sequence of transformations steps and a final code generation step as - shown in the figure below. -
- -
-Tool Chain overview -
-

- -Qompass is integrated into the open source UML editor Papyrus, -The UML profile MARTE is used for non-functional properties. -Parts of the component model were developed in the context of the French national project Flex-eWare. - -In the sequel, you find information about the -

- -We also recommend the examples section in the documentation index as a starting point for using Qompass, as well as the Qompass wiki page. - -

- - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/DefineNewPortKinds.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/DefineNewPortKinds.html deleted file mode 100644 index 44b6609371a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/DefineNewPortKinds.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Qompass - - - -

How-to create your own port-kinds

- -A port kind characterizes a port. Simple examples of port kinds are (1) the UseInterface and -ProvideInterface kinds which describe client/server ports and (2) PushPublisher which describe a data -publisher port for a given data type. In the first case, the port is typed with the interface that is -provided or required, in the second case, the port is typed with datatype.

-Although it does not formally define its semantics, each port kind should be associated with a -description of the intention behind it. A port kind is always associated with a mapping rule -that describes which interface a port provides and/or requires when in function -of its type (and/or additional information, e.g. coming from a MARTE stereotype). -On the model level, a port kind is first a stereotyped class. It can be created with the Qompass palette. -

-The associated mapping rule is defined defined by means of Java code. You have to create a plugin -that defines the (plug-in) extension port-mapping provided by the FCM profile plugin. The extension -contains the (unqualified) name of the port kind and associated rules for the mapping.

- -The class must implement the interface FCM.util.IMappingRule, i.e. the operations getProvided, -getRequired and needsTransaction. The former two return the provided (required) interface in function -of the port type. The latter indicates whether the calculation of one of these (potentially) modifies -the model by creating/or updating a derived interface and thus requires a transaction. -Examples can be found in the plug-in org.eclipse.papyrus.qompass.designer.stdmappingRules. - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createContainers.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createContainers.html deleted file mode 100644 index 7c9b1ec491e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createContainers.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Qompass - - - -

Qompass container development

- -A container encapsules a component, i.e. it encloses an existing components and delegates ports to -it. The following figure depicts a container enclosing an component. The principal idea is that the -container handles the treatment of non-functional properties. Therefore, the existing component can -focus on the implementation of the business logic. It is therefore also called executor, a term -introduced by the OMG standard CORBA component model (CCM).

-There are two different ways how a container can influence the execution of an executor. Either via -interception or via extension. The two variants are shown in the sequel. - -

How to create a container interceptor

- -A container interceptor is basically a connector between a port of the . Thus, it can be defined in the same way as a -connector, but needs to carry the stereotype interceptor. - -

How to create a container extension

- -A container extension is a - -

How to create a container rule

- -Before you create a container rule, you typically create either a interceptor or a container -extension (see above). - -There are two different kinds of rules: -
    -
  1. local rules that are only visible to a component owning them -
  2. global rules that are visible for all models that import the model library. In both - cases, the container rule is principally a stereotyped UML class. In the first case, it is a - sub-class owned by the component, which is typically created by the container rule dialog available - for the package. In the second the container rule is a normal class owned by a package; use the Qompass - palette to create the rule. Then, right on the rule to edit its properties. - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createInteractionComponents.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createInteractionComponents.html deleted file mode 100644 index d6a0c24d682..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createInteractionComponents.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Qompass - - - -

    Connector Development

    - -The definition of a connector is quite similar to that of a component. Thus, its development is -quite similar as well. The major differences are: -
      -
    • The type of ports are typically generic, i.e. template parameters. -
    • A connector is often distributed, i.e. the connector itself is an assembly of connector fragments -
    • It may be required to define additional port kinds -
    - -In the following steps, we address the issues above in addition to the normal development of a component. - -

    Integration into a package template

    - -The ports of a connector are often generic, since the connector should connect a large variety of -components. Therefore, the type of the ports often refer to a template parameter. For instance, in -case of ports providing or requiring an interface, the BasicCalls model library defines a package -template with the template parameter "I" which denotes an arbitrary interface. -When a new connector is defined, the developer should first verify if a suitable package template -already exists. -The use of a package import declares the extension of a existing package. -It is possible to extend this package template by eds to refer to a generic port type - a port whose type adapts that refers to template parameters -

    - -In the context of a new interaction component definition, it may be necessary to define new port kinds. A port kind associates a semantics (informally) with a port. It consists of a rule for the provided and required interface in function of the port type. -The rule is currently coded in Java and provided via an (Eclipse) extension point defined by the FCM plugin. This extension point is called fcmPortMappingRule and associates the name of a port kind with a class.<br> -The class must implement the interface FCM.util.IMappingRule, i.e. the operations getProvided, getRequired and needsTransaction. The former two return the provided (required) interface in function of the port type. The latter indicates whether the calculation of one of these (potentially) modifies the model by creating/or updating a derived interface and thus requires a transaction. - -

    -An interaction component is the realization of an interaction pattern which is defined by an abstract interaction -component. There are two cases, -

      -
    1. You want to create a new implementation of an existing interaction mechanism -
    2. You want to create an additional interaction mechanism -
    - -A particularity of a connector is that it is typically defined in a package template. In the first case, i.e. -the creation of an existing implementation. -Instead of creating a new package template for each new connector, an existing package template should be -extended - provided that the formal parameters are identical. This favors reuse, e.g. the existing package -template for method calls contains the definition of (a)synchronous connector types as well an enumeration -over all the operation within the interface (template parameter).
    - -There is no means in UML of extending an existing package. In Qompass, a package is extending an existing package -template, if it merges with the existing package template. - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/developer.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/developer.html deleted file mode 100644 index 419936e9f52..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/developer.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - Main Topic - - - - -

    Qompass developer guide

    - -The objective of this guide is to provide information about the architecture of Qompass designer and enable developers to -contribute to its development, i.e. it is not intend for people that want to develop applications with Qompass designer. -This guide is currently quite incomplete and should give a rough overview of the Qompass plug-ins. - -In general, there is a separation between the generic transformation mechanisms and the model libraries defining -interaction components and container extensions. It is quite likely that a contribution only focusses on one of these two, -for instance on a model library for a dedicated interaction mechanism. - -The transformation mechanisms consists of the following plug.ins: -
      -
    • org.eclipse.papyrus.qompass.designer.feature This plugin contains the definition of the Qompass feature -

      -

    • org.eclipse.papyrus.qompass.designer.core: The main Qompass plugin -
    • org.eclipse.papyrus.qompass.designer.validation: A set of validation rules that check the well-formedness of models, - for instance, whether a connection betwee ports if syntactically valid. - The validation plug-ins defines a set of EMF validation rules in form of Java code. - -
    • org.eclipse.papyrus.qompass.designer.cpp: A plugin with support for C++, in particular (1) for the creation - and configuration of Eclipse CDT projects and (2) the interaction with the C++ code generator. -
    • org.eclipse.papyrus.fcm.profile: A plugin container the Flex-eware component model in form of a static profile -
    • org.eclipse.papyrus.codegen.cpp: C++ code generator and simple C++ view - -
    - -

    -In addition to the generation plugins, Qompass contains a set of model libraries that are -dedicated for a specific domain and/or interaction mechanisms. - -

      -
    • org.eclipse.papyrus.qompass.designer.modellibs.core: A set of basic interaction mechanisms and container rules as well - as port kinds along with the calculation of provided and required interface from the port type - and kind ("mapping rules"). -
    • org.eclipse.papyrus.qompass.designer.modellibs.marte: A modeling library for MARTE, contains a set of FCM port kinds - suitable for MARTE (client/server and flow ports) and model elements for RtUnit and PpUnit. - A model listener performs automatic synchronization between MARTE and FCM stereotypes, e.g. - will automatically initialize the FCM port kind attribute with the kind that corresponds to - the MARTE stereotype and apply container rules associated with Rtunit and Ppunit. -
    • org.eclipse.papyrus.qompass.designer.modellibs.distribution: Distribution support via sockets -
    • org.eclipse.papyrus.qompass.designer.modellibs.tracing: Tracing support (container rule and interceptor) for OTF -
    - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/org.eclipse.papyrus.qompass.designer.core.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/org.eclipse.papyrus.qompass.designer.core.html deleted file mode 100644 index 2136ae652a7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/org.eclipse.papyrus.qompass.designer.core.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - Main Topic - - - - -

    org.eclipse.papyrus.qompass.designer.core

    - -This is the main Qompass plugin. It contains the dialogs and model transformations code as well as a -set of utilities classes. -Qompass consists of a set of package (oepqd is an abbreviation for the path org.eclipse.papyrus.qompass.designer): -
      -
    • ccegc.acceleo a driver for the versoin 2.7.x of Acceleo. This driver is used to instantiate text -templates that refer to model elements. These are primarily used for the connector instantiation (since -the implementations given in form of Opaque behaviors need to be instantiated as well. - -
    • oepqd.deployment -
    • oepqd.transformation - Main transformation code -
    • oepqd.synchronization - A part of the utilities that synchronize derived elements, in particular the implementation of - a component which has for instance -
        -
      • implement the interfaces provided by a component port -
      -
    - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/arrow.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/arrow.png deleted file mode 100644 index 1c66a6d427d..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/arrow.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-after-trafo.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-after-trafo.png deleted file mode 100644 index aae501c9e90..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-after-trafo.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-before-trafo.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-before-trafo.png deleted file mode 100644 index 04595b063cb..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-before-trafo.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-selection.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-selection.png deleted file mode 100644 index 3e60881270c..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-selection.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-aggregation.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-aggregation.png deleted file mode 100644 index 9f98f79e705..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-aggregation.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-connector.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-connector.png deleted file mode 100644 index 73cbaea6fa4..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-connector.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor.png deleted file mode 100644 index 88d630ba405..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor2.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor2.png deleted file mode 100644 index 82a0a5031f3..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor2.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-selection.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-selection.png deleted file mode 100644 index 0ee528ca514..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-selection.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.pdf b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.pdf deleted file mode 100644 index 7fd5e843362..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.pdf and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.png deleted file mode 100644 index b0ae3117501..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-flex-eWare-small.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-flex-eWare-small.png deleted file mode 100644 index 42ad4899399..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-flex-eWare-small.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-marte.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-marte.png deleted file mode 100644 index d33ef562b5f..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-marte.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-papyrus.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-papyrus.png deleted file mode 100644 index f85045926f3..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-papyrus.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.odg b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.odg deleted file mode 100644 index a38a594fb7b..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.odg and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.pdf b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.pdf deleted file mode 100644 index a615fa7ce91..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.pdf and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.png deleted file mode 100644 index d22ad2fb51c..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.vsd b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.vsd deleted file mode 100644 index a274050ab84..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.vsd and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass-0.33.jpg b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass-0.33.jpg deleted file mode 100644 index 8c429f9dc5e..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass-0.33.jpg and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass.jpg b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass.jpg deleted file mode 100644 index 26807d913e4..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass.jpg and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-after-trafo.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-after-trafo.png deleted file mode 100644 index c19b14f091a..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-after-trafo.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-before-trafo.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-before-trafo.png deleted file mode 100644 index 3568e8e8e08..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-before-trafo.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-selection.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-selection.png deleted file mode 100644 index 0cf9151893c..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-selection.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-aggregation.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-aggregation.png deleted file mode 100644 index 2f260c5498b..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-aggregation.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor.png deleted file mode 100644 index 43c3f8b4edf..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor2.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor2.png deleted file mode 100644 index 10b73141e50..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor2.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-selection.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-selection.png deleted file mode 100644 index b8a372f44cd..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-selection.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/statemachine-rule.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/statemachine-rule.png deleted file mode 100644 index 2754cb16625..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/statemachine-rule.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.odg b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.odg deleted file mode 100644 index c752e963472..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.odg and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.png deleted file mode 100644 index 68442484be3..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/trace2.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/trace2.png deleted file mode 100644 index e8c9820c4c7..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/img/trace2.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/component.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/component.html deleted file mode 100644 index fb6364efedb..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/component.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Qompass - - - -

    Components

    - -An Qompass component is a UML class (you might also use a UML component), since classes -contain essential properties we require of a component: -
      -
    • they own a set of ports and may interact through these ports. On the port level, a component needs to declare explicitly, - which services it offers and which it requires from other others. It is important that a component does not know which - other component will provide a required service, it only states the required services (interfaces or data-types). Thus, compared - to an element of a classical library, dependencies on other elements are limited and the components are loosely coupled with - their environment -
    • A class may have an explicit internal structure: a set of parts that are typed with other components (UML classes). - The ports of the parts may be connected (assembly), a port of the component itself might delegate to a port of a part. - These components are also called assembly components. -
    - -A component might either be a type or an implementation. The former is mainly an abstract class with a set of ports -and no internal structure. It may inherit from other component types, but not from implementations. -The latter has to realize at least a subset of the services that are provided at its ports (if it does not define all, it -needs to be declared as abstract). The realization could be either done by an implementation written in a specific programming -language or the UML action language or by a delegation to an inner part. - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/container.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/container.html deleted file mode 100644 index 73aaa3d3443..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/container.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Qompass - - - -

    Qompass container development

    - -A container encapsules a component, i.e. it encloses an existing components and delegates ports to -it. The following figure depicts a container enclosing an component. The principal idea is that the -container handles the treatment of non-functional properties. Therefore, the existing component can -focus on the implementation of the business logic. It is therefore also called executor, a term -introduced by the OMG standard CORBA component model (CCM).

    -There are two different ways how a container can influence the execution of an executor. Either via -interception or via extension. The two variants are shown in the sequel. - -

    How to create a container interceptor

    - -A container interceptor is basically a delegation connector between a port of the container and the -executor. Thus, it can be defined in the same way as a connector, but needs to carry the stereotype -interceptor.
    - -An example of a container interceptor - -Further expansion - -

    -Further expansion as for a connector - -

    Container rules

    - -A container rule defines which container extensions and/or interceptors should be applied. The -concept of a container rule has been introduced, since some aggregation/interceptor combinations -depend on each other. Their independ selection would be error prone, instead a single container -rule selects the combination. - -There are two different kinds of rules: -
      -
    1. local rules that are only visible to a component owning them -
    2. global rules that are visible for all models that import the model library. In both - cases, the container rule is principally a stereotyped UML class. In the first case, it is a - sub-class owned by the component, which is typically created by the container rule dialog available - for the package. In the second the container rule is a normal class owned by a package; use the Qompass - palette to create the rule. Then, right on the rule to edit its properties. -
    - -container selection - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/interactionComponent.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/interactionComponent.html deleted file mode 100644 index 98391302fba..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/interactionComponent.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - Interaction components and connectors - - - -

    Interaction components and connectors

    - -An interaction component is a component that is responsible for realizing an interaction between two or more -components.
    - -A UML connector denotes a link between two components, or more precisely between two or more parts (or ports of parts) -within a composition. In UML, the connector only denotes that there is a connection, it does not carry further -annotations that characterize the interaction or how it is implemented. - -
    -In Qompass, a connector carries additional information (via the FCM profile) about a type or implementation -used for its realization, the interaction component.
    - -An interaction component is quite similar to a standard component: there is an optional separation -between its type and its implementation, it owns ports, it may be a composition of parts typed with -other components. -The main difference is that it needs to be generic, since the interaction component has to adapt itself -to the environment in which it is used, e.g. to the interfaces of ports it connectors. -The following figure shows a connector and the referenced connector component. The tool chain -reifies a connector to a connector component during deployment, as shown in the following figure: - -connector before transformation - -connector after transformation - -

    Connector matching algorithm

    - -In order to check whether a connector can be applied, we need to find a binding of its formal template -parameter(s) for which all ports of the connector match a port of the application components with which -it is connected. Of course, a single binding must establish matching for all connector ports at the same -time. A match is fulfilled, if either -
      -
    1. The ports have an identical kind and type, and one of the ports is conjugated (i.e its provided and - required interfaces are swapped). The connector port is typically typed with the formal parameter, i.e. - matching is reached if the formal is bound to the same type as the application port. -
    2. The provided interface of one port has a matching required interface of the opposite port and vice versa. - Assuming again,that a port of the connector is typed with the formal parameter of the template, the - calculation is limited to the case of mapping rules that expose the formal parameter directly as - provided or required interface, i.e. that do not create a derived interface that depends on the - formal parameter. Otherwise, - the calculation of the formal parameter would require a reverse execution of the mapping rule - (calculation of port type when a provided or required interface is given). This implies in practice - that connectors with simple ports using ProvideInterface or UseInterface match: the rule is actually - less strong that the first, since it is possible to match ports that have not specifically be designed - for each other. For instance, the PushProducer port for a dataype DT has a required interface with an - operation "push(in data : DT)". A port with the generic UseInterface kind can match the PushProducer - port. Thus, a synchronous call connector s compatible with a PushProducer/PushConsumer port combination. -
    - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/port.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/port.html deleted file mode 100644 index dc0c832a6c7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/port.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Qompass - - - -

    Ports

    - -Ports are interaction points of components. A component may execute operation calls via a port when -it requires a service. When a component provides a service, a operation of a port is called when the -service is invoked. In Qompass, this abstraction is also used for data oriented ports, as calls are flexible -and well handled by the underlying programming language. For instance, data consumption via polling might -correspond to the call of an "getData" operation (component calls, required interface), -consumption via push the call of an pushData operation (environment calls, provided interface). -

    -From the user view point, the provision or use of a specific interface is an implementation aspect. Therefore, -these two interfaces or not specified, but they are calculated or derived from two other port properties: -its type and its kind. For instance, a "PullConsumer" port kind could be used in -conjunction with a data type and would define the "getData" operation above. - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/portKind.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/portKind.html deleted file mode 100644 index 983c6983f58..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/portKind.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - Qompass - - - -

    Port kinds

    - -A port kind characterizes a port. Simple examples of port kinds are (1) the UseInterface and -ProvideInterface kinds which describe client/server ports and (2) PushPublisher which describe a data -publisher port for a given data type. In the first case, the port is typed with the interface that is -provided or required, in the second case, the port is typed with datatype.

    -Although it does not formally define its semantics, each port kind should be associated with a -description of the intention behind it. A port kind is always associated with a mapping rule -that describes which interface a port provides and/or requires when in function -of its type (and/or additional information, e.g. coming from a MARTE stereotype). - -On the model level, a port kind is first a stereotyped class. In Qompass, the associated mapping rule -is defined defined by means of Java code. but this is mainly an implementation issue. -Examples can be found in the plug-in org.eclipse.papyrus.qompass.designer.stdmappingRules. - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/trafos.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/trafos.html deleted file mode 100644 index 27ad089bcb9..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/trafos.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Qompass - - - -

    Transformations

    - -Before an Qompass component can be deployed, there is a set of transformations that is applied - -
      -
    1. Each port is translated into a tripel of a property, an operation returning a reference to the interface - provided by the port (if any) and an operation allowing to connect the port (if port has a required - interface). - -
    2. Parts: if a part is typed with an abstract component implementation or a component type, it cannot - directly be instantiated in some programming languages, notably C++ (in Java, attributes typed - with a class are always implictly references). For these, there are basically two options: -
        -
      • Change the type of the part and replace it by a concrete implementation. Obviously, this can only - work, if the deployment uses always the same implementaiton for the part. -
      • Assure that the composite only holds a reference to the part, i.e. make the part a pointer and - let the bootloader instantiate the sub-parts. The advantage is that it always works, but would not - do something useful in the context of variable systems. -
      -
    3. -
    - -A component might either be a type or an implementation. The former is mainly a class with a set of ports -and no internal structure. It may inherit from other component types, but not from implementations. -The latter has to realize at least a subset of the services that are provided at its ports (if it does not define all, it -needs to be declared as abstract). The realization could be either done by an implementation written in a specific programming -language or the UML action language or by a delegation to an inner part. - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/sitestyle.css b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/sitestyle.css deleted file mode 100644 index 4f5bb078d99..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/html/sitestyle.css +++ /dev/null @@ -1,13 +0,0 @@ -BODY { font-family: "Helvetica", sans-serif; - background-color: white -} - -A:link { color: #4040c0 } -A:active { color: #909090 } -A:visited { color: #9090f0 } - -TT { - background-color: #d0f8f0; - /* font-family: monospace; */ - /* font-size: 100% */ -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.di deleted file mode 100644 index 63bf1a9db4a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.di +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.notation deleted file mode 100644 index 5c943021045..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.notation +++ /dev/null @@ -1,669 +0,0 @@ - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.uml deleted file mode 100644 index 30494c484ee..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.uml +++ /dev/null @@ -1,173 +0,0 @@ - - - - Declarative information about container elements - - - - Delegation connector: interception - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Additional information about interaction component - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/plugin.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/plugin.properties deleted file mode 100644 index 1fccb2ec96f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus extra: Qompass designer documentation (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/plugin.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/plugin.xml deleted file mode 100644 index 860a13a3743..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/plugin.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/pom.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/pom.xml deleted file mode 100644 index 9f74566da65..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.qompass.designer.doc - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/src/org/eclipse/papyrus/qompass/designer/doc/Activator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/src/org/eclipse/papyrus/qompass/designer/doc/Activator.java deleted file mode 100644 index dd7f6fbd95a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/src/org/eclipse/papyrus/qompass/designer/doc/Activator.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.doc; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/toc.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/toc.xml deleted file mode 100644 index 1f47f46e81f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc/toc.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/.classpath b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/.classpath deleted file mode 100644 index 248b4c5dc7a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/.project b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/.project deleted file mode 100644 index 49ba9131ad8..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.papyrus.qompass.designer.java - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.xtext.ui.shared.xtextNature - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f42de363afa..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/META-INF/MANIFEST.MF deleted file mode 100644 index 9a5c0239ad2..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.uml2.uml;bundle-version="5.0.1", - org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", - org.eclipse.papyrus.qompass.designer.core;bundle-version="1.2.0", - com.google.guava, - org.eclipse.xtext.xbase.lib, - org.eclipse.xtend.lib, - org.eclipse.xtend.lib.macro, - org.eclipse.papyrus.uml.tools;bundle-version="1.2.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.qompass.designer.java.Activator -Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.java;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/about.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

    About This Content

    - -

    November 14, 2008

    -

    License

    - -

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

    - -

    If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

    - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/build.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/build.properties deleted file mode 100644 index 3fa3c740b2b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = src/,\ - xtend-gen/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - plugin.xml diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/plugin.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/plugin.properties deleted file mode 100644 index 5c6ac578195..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus extra: Qompass Designer Java support (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/plugin.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/plugin.xml deleted file mode 100644 index 325c6bd80d0..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/plugin.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/pom.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/pom.xml deleted file mode 100644 index f1ba7db6b51..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.qompass.designer.java - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-clean-plugin - - - - xtend-gen - - **/* - - - .gitignore - - - - - - - org.eclipse.xtend - xtend-maven-plugin - - - generate-sources - - compile - - - - - xtend-gen - ${project.build.directory}/xtend-gen/test - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Activator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Activator.java deleted file mode 100644 index 1e7d5e25650..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Activator.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.java; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.cpp"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Messages.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Messages.java deleted file mode 100644 index 070d1956590..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Messages.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.java; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.papyrus.qompass.designer.cpp.messages"; //$NON-NLS-1$ - - public static String CompImplTrafos_CannotFindType; - public static String CompImplTrafos_IntfNotImplemented; - public static String CompTypeTrafos_CannotFindType; - - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/messages.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/messages.properties deleted file mode 100644 index c4c2141c7e6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/messages.properties +++ /dev/null @@ -1,3 +0,0 @@ -CompImplTrafos_CannotFindType=Can not find type %s. Thus, unable to create suitable connect operation in component to OO transformation. -CompImplTrafos_IntfNotImplemented=Interface <%s> provided by port <%s> of class <%s> is not implemented by the component itself nor does the port delegate to a part -CompTypeTrafos_CannotFindType=Can not find type <%s>. Thus, unable to create suitable connect operation in component to OO transformation diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/xtend/JavaToOO.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/xtend/JavaToOO.xtend deleted file mode 100644 index ef368eb0d76..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/xtend/JavaToOO.xtend +++ /dev/null @@ -1,548 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2015 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ -package org.eclipse.papyrus.qompass.designer.java.xtend - -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.Property -import org.eclipse.uml2.uml.Port -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException -import org.eclipse.papyrus.qompass.designer.core.PortInfo -import org.eclipse.papyrus.qompass.designer.core.PortUtils -import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants -import org.eclipse.papyrus.qompass.designer.core.Utils -import org.eclipse.papyrus.qompass.designer.core.transformations.CompTypeTrafos -import org.eclipse.uml2.uml.AggregationKind -import org.eclipse.uml2.uml.UMLPackage -import org.eclipse.uml2.uml.OpaqueBehavior -import org.eclipse.uml2.uml.ConnectorEnd -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil -import org.eclipse.uml2.uml.Type -import java.util.HashMap -import java.util.Map -import org.eclipse.uml2.uml.Connector -import org.eclipse.emf.common.util.EList -import org.eclipse.uml2.uml.StructuralFeature -import org.eclipse.papyrus.qompass.designer.java.Messages -import org.eclipse.papyrus.qompass.designer.core.extensions.IOOTrafo -import org.eclipse.papyrus.uml.tools.utils.PackageUtil - -/** - * This class realizes the transformation from component-based to object-oriented - * models. It includes the replacement of ports and connectors. Ports are - * replaced with attributes and access operations, connectors within a composite - * by an operation that creates the initial setup. - * - * 1. add an operation that allows to retrieve the reference to an interface provided - * by a port. This operation has a mapping specific name, e.g. get_ - * 2. add an operation that allows to connect a specific port. - * the connect_q operation (*including a - * storage attribute*) for a port with a required interface - * 3. add an implementation for the getcnx_q operation for a port - * with a required interface (the operation itself has been added before) - * - * TODO: C++ specific, support different "component to OO" mappings - * - * Problems: need to align bootloader creation with this mapping, since - * the bootloader may be responsible for instantiation - * - * Caveat: Assure that the folder derivedInterfaces already exists in a model. - * Otherwise the call to getProvided/getRequired interface might trigger its - * creation resulting in the corruption of list iterators (ConcurrentAccess - * exception) - * - */ -class JavaToOO implements IOOTrafo { - - public static final String CREATE_CONNECTIONS = "createConnections" - - protected LazyCopier copier - - protected Class bootloader // why required? - - override init(LazyCopier copier, Class bootloader) { - this.copier = copier - this.bootloader = bootloader - } - - public static final String retParamName = "ret" - - public static final String progLang = "JAVA" - - override addPortOperations(Class implementation) { - addGetPortOperation(implementation) - addConnectPortOperation(implementation) - } - - /** - * Add the get_p operation for each port with a provided interface. It also - * adds a suitable implementation that evaluates delegation connectors from - * the port to a property within the composite. The delegation target could - * either be a normal class (no port) or an inner component. - * - * @param implementation - */ - def addGetPortOperation(Class implementation) { - for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { - val providedIntf = portInfo.getProvided() - if (providedIntf != null) { - - // port provides an interface, add "get_p" operation & - // implementation - val opName = PrefixConstants.getP_Prefix + portInfo.name - var op = implementation.getOwnedOperation(opName, null, null) - if (op != null) { - - // operation already exists. Assume that user wants to - // override standard delegation - if (op.type != providedIntf) { - op.createOwnedParameter(retParamName, providedIntf) - } - } else { - op = implementation.createOwnedOperation(opName, null, null, providedIntf) - val retParam = op.getOwnedParameters().get(0) - retParam.setName(retParamName) - - val behavior = implementation.createOwnedBehavior(opName, UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - op.getMethods().add(behavior) - - val ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) - - // if there is an delegation to an inner property, delegate to - // it - // Make distinction between delegation to component (with a - // port) or - // "normal" class (without). - var String body - if (ce != null) { - val part = ce.partWithPort - val role = ce.role - - body = "return " - if (role instanceof Port) { - - // check whether the part exists within the - // implementation (might not be the case - // due to partially copied composites). - // Check is based on names, since the connector points - // to elements within another - // model (copyClassifier does not make a proper - // connector copy) - // body += part.name + refOp(part) + opName + "();" - // TODO: this will NOT work for extended ports! - body += '''«part.name».«PrefixConstants.getP_Prefix»«role.name»();''' - } else { - - // role is not a port: connector connects directly to a - // structural feature - // without passing via a port - // TODO: check whether structural feature exists - body += role.name - } - } else { - - // no delegation, check whether port implements provided interface - var implementsIntf = implementation.getInterfaceRealization(null, providedIntf) != null - if (!implementsIntf) { - - // The extended port itself is not copied to the target - // model (since referenced via a stereotype). Therefore, - // a port of an extended port still points to the - // original model. We try whether the providedIntf - // within - // the target model is within the interface - // realizations. - val providedIntfInCopy = copier.getCopy(providedIntf) - implementsIntf = implementation.getInterfaceRealization(null, providedIntfInCopy) != null - } - if (implementsIntf) { - body = "return this;" - } else { - throw new RuntimeException( - String.format(Messages.CompImplTrafos_IntfNotImplemented, providedIntf.name, - portInfo.port.name, implementation.name)) - } - } - behavior.getLanguages().add(progLang) - behavior.getBodies().add(body) - } - } - } - } - - /** - * Add a connect_ operation for ports with a required interface. - * Whereas operation and a behavior is added for each owned port, a behavior - * (method) is needed for ports inherited from a component type (the - * behavior is implementation specific, as it needs to take delegation to - * parts into account) - * - * @param implementation - */ - static def addConnectPortOperation(Class implementation) { - for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { - val requiredIntf = portInfo.getRequired() - if (requiredIntf != null) { - - // port requires an interface, add "connect_p" operation & - // implementation - val opName = PrefixConstants.connectQ_Prefix + portInfo.name - - if (implementation.getOwnedOperation(opName, null, null) != null) { - // do not add the operation, if it already exists. This means that the - // user wants to override it with custom behavior. In case of extended - // ports, we may have to do that. - } else { - var op = implementation.createOwnedOperation(opName, null, null) - val boolean multiPort = (portInfo.getUpper() > 1) || (portInfo.getUpper() == -1) // -1 indicates "*" - if (multiPort) { - - // add index parameter - val eLong = Utils.getQualifiedElement(PackageUtil.getRootPackage(implementation), - CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE) - if (eLong instanceof Type) { - op.createOwnedParameter("index", eLong as Type) - } else { - throw new RuntimeException( - String.format(Messages.CompImplTrafos_CannotFindType, - CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE)) - } - } - val refParam = op.createOwnedParameter("ref", requiredIntf) - - val behavior = implementation.createOwnedBehavior(opName, UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - - op.getMethods().add(behavior) - - val ConnectorEnd ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) - - // if there is an delegation to an inner property, delegate to it - // Make distinction between delegation to component (with a port) or - // "normal" class (without). - var String body - if (ce != null) { - val part = ce.partWithPort - body = part.name - val role = ce.role - if (role instanceof Port) { - // in case of a delegation, use name of target port which might be different - val targetOpName = PrefixConstants.connectQ_Prefix + role.name - body = '''«part.name».«targetOpName»''' - - // TODO: no check that multiplicity of both port matches - if ((portInfo.getUpper() > 1) || (portInfo.getUpper() == -1)) { - body += "(index, ref);"; - } - else { - body += "(ref);"; - } - - } else { - // TODO: does this case make sense? - body += '''«part.name»;''' - } - } else { - // no delegation - create attribute for port - val attributeName = PrefixConstants.attributePrefix + portInfo.name - if (!Utils.hasNonPortOwnedAttribute(implementation, attributeName)) { - val attr = implementation.createOwnedAttribute(attributeName, requiredIntf) - LazyCopier.copyMultElemModifiers(portInfo.port, attr) - - // is shared (should store a reference) - attr.setAggregation(AggregationKind.SHARED_LITERAL) - } - body = attributeName - if(multiPort) body += "[index]" - body += " = ref" - } - - // TODO: defined by template - behavior.getLanguages().add(progLang) - behavior.getBodies().add(body) - - // ------------------------- - // add body to get-connection operation (which exists already if the port is also - // owned, since it is synchronized automatically during model edit) - // getConnQ prefix may be empty to indicate that the port is accessed directly - // TODO: reconsider optimization that delegated required ports do not have a - // local attribute & associated operation (an inner class may delegate, but the - // composite may be using it as well). - if ((PrefixConstants.getConnQ_Prefix.length() > 0) && (ce != null)) { - val getConnOpName = PrefixConstants.getConnQ_Prefix + portInfo.name - var getConnOp = implementation.getOwnedOperation(getConnOpName, null, null) - if (getConnOp == null) { - getConnOp = implementation.createOwnedOperation(getConnOpName, null, null, requiredIntf) - val retParam = op.getOwnedParameters().get(0) - retParam.setName(retParamName) - } - val getConnBehavior = implementation.createOwnedBehavior(getConnOpName, - UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - getConnOp.getMethods().add(getConnBehavior) - - // no delegation - val String name = PrefixConstants.attributePrefix + portInfo.name - body = '''return «name»;''' - behavior.getLanguages().add(progLang) - behavior.getBodies().add(body) - } - } - } - } - } - - /** - * Add an operation "createConnections" that implements the connections - * between composite parts. It only takes the assembly connections into - * account, since delegation connectors are handled by the get_ and connect_ - * port operations above. - * - * @param implementation - */ - override addConnectionOperation(Class compositeImplementation) throws TransformationException { - var createConnBody = "" - val Map indexMap = new HashMap() - - for (Connector connector : compositeImplementation.getOwnedConnectors()) { - if (ConnectorUtil.isAssembly(connector)) { - - // Boolean associationBased = false - if (connector.ends.size() != 2) { - throw new TransformationException( - '''Connector <«connector.name»> does not have two ends. This is currently not supported''') - } - val end1 = connector.ends.get(0) - val end2 = connector.ends.get(1) - var cmd = '''// realization of connector <«connector.name»>\n''' - if ((end1.role instanceof Port) && PortUtils.isExtendedPort(end1.role as Port)) { - val port = end1.role as Port - val EList subPorts = PortUtils.flattenExtendedPort(port) - for (PortInfo subPort : subPorts) { - cmd += ''' // realization of connection for sub-port «subPort.port.name»\n''' - cmd += connectPorts(indexMap, connector, end1, end2, subPort.port) - cmd += connectPorts(indexMap, connector, end2, end1, subPort.port) - } - } else { - cmd += connectPorts(indexMap, connector, end1, end2, null) - cmd += connectPorts(indexMap, connector, end2, end1, null) - } - createConnBody += cmd + "\n" - } - } - - // TODO: use template, as in bootloader - if (createConnBody.length() > 0) { - val operation = compositeImplementation.createOwnedOperation(CREATE_CONNECTIONS, null, null) - - val behavior = compositeImplementation.createOwnedBehavior("b:" + operation.name, - UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior - behavior.getLanguages().add(progLang) - behavior.getBodies().add(createConnBody) - behavior.setSpecification(operation) - } - } - - /** - * Create the body C++ code code that creates a connection between the two ends - * of a connector. This function checks whether the first end really is a receptacle - * and the second really is a facet. - * TODO: cleaner rewrite in xtend - * - * @param indexMap - * a map of indices that are used in case of multiplex - * receptacles - * @param connector - * a connector - * @param receptacleEnd - * an end of the connector that may point to a receptacle port - * @param facetEnd - * an end of the connector that may point to a facet port - * @param subPort - * a sub-port in case of extended ports - * @return - * @throws TransformationException - */ - static def connectPorts(Map indexMap, Connector connector, ConnectorEnd receptacleEnd, - ConnectorEnd facetEnd, Port subPort) throws TransformationException { - val association = connector.type - if ((receptacleEnd.role instanceof Port) && (facetEnd.role instanceof Port)) { - val facetPort = facetEnd.role as Port - val receptaclePort = receptacleEnd.role as Port - val facetPI = PortInfo.fromSubPort(facetPort, subPort) - val receptaclePI = PortInfo.fromSubPort(receptaclePort, subPort) - - if ((facetPI.getProvided() != null) && (receptaclePI.getRequired() != null)) { - val facetPart = facetEnd.partWithPort - val receptaclePart = receptacleEnd.partWithPort - - var subPortName = "" - if(subPort != null) subPortName += "_" + subPort.name - val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) - val setter = '''«receptaclePart.name».connect_«receptaclePort.name» «subPortName»;''' - val getter = '''«facetPart.name».get_«facetPort.name» «subPortName»()''' - return '''«setter»(«indexName»«getter»);\n''' - } - - } else if (receptacleEnd.role instanceof Port) { - - // only the receptacle end is of type port. - val Port receptaclePort = receptacleEnd.role as Port - if (PortUtils.getRequired(receptaclePort) != null) { - val facetPart = facetEnd.role as Property - val receptaclePart = facetEnd.partWithPort - - val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) - val setter = '''«receptaclePart.name».connect_«receptaclePort.name»''' - val getter = '''&«facetPart.name»''' - return '''«setter»(«indexName»«getter»);\n''' - } - } else if (facetEnd.role instanceof Port) { - - // only the facet end is of type port. Unsupported combination - val facetPort = facetEnd.role as Port - if (PortUtils.getProvided(facetPort) != null) { - val facetPart = facetEnd.partWithPort - val receptaclePart = facetEnd.role as Property - - val setter = receptaclePart.name - val getter = '''«facetPart.name».get_«facetPort.name»();''' - return '''«setter» = «getter»;\n''' - } - } else if (association != null) { - - // both connector ends do not target ports. In this case, we require that the connector is typed - // with an association. We use this association to find out which end is navigable and assume that - // the part pointed to by the other end is a pointer that gets initialized with the part of the - // navigable end. - val facetPart = facetEnd.role as Property - val receptaclePart = receptacleEnd.role as Property - - val assocProp1 = association.getMemberEnd(null, facetPart.type) - - // Property assocProp2 = facetPart.getOtherEnd() - if ((assocProp1 != null) && assocProp1.isNavigable) { - val setter = '''«receptaclePart.name».«assocProp1.name»''' - val getter = '''&«facetPart.name»''' - return '''«setter» = «getter»;\n''' - } - } else { - - // not handled (a connector not targeting a port must be typed) - throw new TransformationException( - "Connector <" + connector.name + - "> does not use ports, but it is not typed (only connectors between ports should not be typed)") - } - return "" - } - - /** - * Handle ports with multiplicity > 1. The idea is that we could have - * multiple connections targeting a receptacle. The first connection would - * start with index 0. Implementations can make no assumption which - * connection is associated with a certain index. [want to avoid associative - * array in runtime]. - * - * @param port - * @param end - * @return - */ - static def getIndexName(Map indexMap, Port port, ConnectorEnd end) { - if ((port.getUpper() > 1) || (port.getUpper() == -1)) { - - // index depends of combination of property and port, use connector - // end as key - var indexValue = indexMap.get(end) - if (indexValue == null) { - indexValue = 0 - indexMap.put(end, indexValue) - } - var index = indexValue + ", " - indexValue++ - indexMap.put(end, indexValue) - return index - } - return "" - } - - /** - * Return true, if the bootloader is responsible for the instantiation of a - * part. [Structual difference: bootloader can decide instance based - and - * instances are deployed] - * - * If a part is a component type or an abstract implementation, it cannot be - * instantiated. Thus, a heir has to be selected in the deployment plan. - * Since the selection might be different for different instances of the - * composite, the instantiation is not done by the component itself, but by - * the bootloader. The bootloader also has to instantiate, if different - * allocation variants are required. (this is for instance the case for - * distribution connectors and for the system itself) - * - * If possible, we want to let composites instantiate sub-components, since - * this eases the transition to systems which support reconfiguration. - * - * [TODO: optimization: analyze whether the deployment plan selects a single - * implementation. If yes, let the composite instantiate] - * - * [TODO: elements within an assembly need to be instantiated by composite - - * if System - by bootloader. assembly also need to be instantiated by - * composite!! - * - * @param implementation - * @return - */ - static def instantiateViaBootloader(Class implementation) { - return implementation.isAbstract() || Utils.isAssembly(implementation) - } - - /** - * Return whether a part needs to be instantiated by the bootloader instead - * by the composite in which it is contained. The criteria is based on the - * question whether the containing composite is flattened, as it is the case - * for the system component and the interaction components for distribution. - * - * @param part - * @return - */ - static def instantiateViaBootloader(StructuralFeature part) { - if (part != null) { - if (part.type instanceof Class) { - val implementation = part.type as Class - - // TODO: wrong criteria? (must be shared or not?) - return instantiateViaBootloader(implementation) - } else { - - // not a class, assume primitive type instantiated by composite - return false - } - } - return false - } - - /** - * Transform parts if necessary. - * - * If the bootloader is responsible for creating an instance (if it is a - * abstract type), mark the associated part as a C++ pointer. We do not want - * to change the aggregation kind, since it remains logically a composition, - * it is merely an implementation issue that it must be a pointer for C++ if - * the concrete type is not yet known. - * - * @param compositeImplementation - * a (composite) component - */ - override transformParts(Class compositeImplementation) { - - // TODO - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/xtend-gen/.gitignore b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/xtend-gen/.gitignore deleted file mode 100644 index c96a04f008e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/.classpath b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/.classpath deleted file mode 100644 index 098194ca4b7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/.project b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/.project deleted file mode 100644 index ee60ec6da05..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.qompass.designer.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f42de363afa..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 972085ecb3b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,32 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.qompass.designer.ui.handlers -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.emf.ecore, - org.eclipse.uml2.uml, - org.eclipse.core.resources, - org.eclipse.ui.ide, - org.eclipse.papyrus.fcm.profile;bundle-version="1.2.0", - org.eclipse.papyrus.marte.static.profile;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0", - org.eclipse.papyrus.infra.gmfdiag.widgets;bundle-version="1.2.0", - org.eclipse.gef;bundle-version="3.8.0", - org.eclipse.papyrus.uml.profile;bundle-version="1.2.0", - org.eclipse.papyrus.uml.properties;bundle-version="1.2.0", - org.eclipse.papyrus.uml.tools;bundle-version="1.2.0", - org.eclipse.gmf.runtime.common.core;bundle-version="1.7.0", - org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0", - org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0", - org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", - org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", - org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="1.2.0", - org.eclipse.papyrus.qompass.designer.core;bundle-version="1.2.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.qompass.designer.ui.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.ui;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/about.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

    About This Content

    - -

    November 14, 2008

    -

    License

    - -

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

    - -

    If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

    - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/build.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/build.properties deleted file mode 100644 index f1e29af020a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.properties,\ - about.html,\ - icons/,\ - plugin.xml -src.includes = about.html diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/ADLInFlowPort.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/ADLInFlowPort.gif deleted file mode 100644 index e2b32c65cac..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/ADLInFlowPort.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/Qompass-16x16.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/Qompass-16x16.gif deleted file mode 100644 index c47d52ad211..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/Qompass-16x16.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/Stereotype.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/Stereotype.gif deleted file mode 100644 index 145e5d589d8..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/Stereotype.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/allocation.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/allocation.gif deleted file mode 100644 index ced634f9c9c..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/allocation.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/depPlan.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/depPlan.gif deleted file mode 100644 index 712a2485f8d..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/depPlan.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/deploy.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/deploy.gif deleted file mode 100644 index 7a7ced35f3d..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/deploy.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-16x16.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-16x16.gif deleted file mode 100644 index 327caa73f59..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-16x16.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-32x32.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-32x32.gif deleted file mode 100644 index 9e1527b778f..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-32x32.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/sample.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/sample.gif deleted file mode 100644 index 34fb3c9d8cb..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/sample.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/selConnector.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/selConnector.gif deleted file mode 100644 index e47528e5447..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/selConnector.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/selContainer.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/selContainer.gif deleted file mode 100644 index c16516c624b..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/selContainer.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/sync.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/sync.gif deleted file mode 100644 index 5935eb3cbba..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/icons/sync.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/plugin.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/plugin.properties deleted file mode 100644 index 09415057ea6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus extra: Qompass Designer UI (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/plugin.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/plugin.xml deleted file mode 100644 index 8df44b89c05..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/plugin.xml +++ /dev/null @@ -1,248 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/pom.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/pom.xml deleted file mode 100644 index 9745a959a48..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.qompass.designer.ui - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Activator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Activator.java deleted file mode 100644 index 54b1369473a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Activator.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.ui"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Messages.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Messages.java deleted file mode 100644 index 53794a9743b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Messages.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.ui; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.papyrus.qompass.designer.ui.messages"; //$NON-NLS-1$ - - public static String ConfigurePortHandler_ConfigurePorts; - public static String ConfigurePortHandler_ConfigurePortsOfComponent; - public static String ConfigurePortHandler_ConfigureInstance; - - public static String ConfigurePortDialog_AvailPorts; - public static String ConfigurePortDialog_PortConfig; - public static String ConfigurePortDialog_NotAvail; - public static String ConfigurePortDialog_Kind; - public static String ConfigurePortDialog_None; - public static String ConfigurePortDialog_Type; - public static String ConfigurePortDialog_ChangeType; - public static String ConfigurePortDialog_IntfDerived; - public static String ConfigurePortDialog_Provided; - public static String ConfigurePortDialog_Required; - public static String ConfigurePortDialog_Undef; - - public static String CreateDepPlanHandler_CreateDPs; - public static String CreateDepPlanHandler_Sync; - public static String CreateDepPlanHandler_CreateNew; - public static String CreateDepPlanHandler_WhatShouldIDo; - public static String CreateDepPlanHandler_DPwithNameExistsAlready; - public static String CreateDepPlanHandler_DPwithNameExistsNoPackage; - public static String CreateDepPlanHandler_CannotSync; - public static String CreateDepPlanHandler_Cancel; - public static String CreateDepPlanHandler_CreateDP; - public static String CreateDepPlanHandler_CannotCreateDP; - public static String CreateDepPlanHandler_StereoApplicationFailed; - - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AllocationDialog.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AllocationDialog.java deleted file mode 100644 index 14a3e457d49..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AllocationDialog.java +++ /dev/null @@ -1,311 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import org.eclipse.draw2d.Label; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.emf.workspace.AbstractEMFOperation; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.MARTE.MARTE_DesignModel.SRM.SW_Concurrency.SwSchedulableResource; -import org.eclipse.papyrus.infra.widgets.toolbox.utils.DialogUtils; -import org.eclipse.papyrus.qompass.designer.core.CommandSupport; -import org.eclipse.papyrus.qompass.designer.core.ElementFilter; -import org.eclipse.papyrus.qompass.designer.core.commands.AddMarteAndFcmProfile; -import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.BootLoaderGen; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.swt.widgets.TreeColumn; -import org.eclipse.swt.widgets.TreeItem; -import org.eclipse.ui.dialogs.SelectionStatusDialog; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Allocate elements in a deployment plan to a node or thread - * - */ -public class AllocationDialog extends SelectionStatusDialog { - - private DeploymentPlan m_cdp; - - private Tree fTree; - - private Label fLabel; - - private Combo fAlloc; - - private InstanceSpecification currentIS; - - private EList nodeOrThreadList; - - public AllocationDialog(Shell parent, Package cdp) { - super(parent); - m_cdp = UMLUtil.getStereotypeApplication(cdp, DeploymentPlan.class); - nodeOrThreadList = new BasicEList(); - nodeOrThreadList.add(null); // dummy entry for no allocation - DepUtils.getAllInstances(cdp.getModel(), nodeOrThreadList, new ElementFilter() { - - @Override - public boolean acceptElement(Element element) { - if (element instanceof InstanceSpecification) { - InstanceSpecification instance = (InstanceSpecification) element; - if (instance.getName() == null) { - // donn't allocate to root element (detectable via the empty name) - return false; - } - Classifier cl = DepUtils.getClassifier(instance); - if (cl instanceof Class) { - if (StereotypeUtil.isApplied(cl, SwSchedulableResource.class)) { - // threads are valid allocation targets. Therefore, threads are always added to - // list, even if within a deployment plan. - return true; - } - if (StereotypeUtil.isApplied(instance.getNearestPackage(), DeploymentPlan.class)) { - // instance is part of a deployment plan => don't add to list. - return false; - } - return true; - } - } - return false; - } - }); - } - - /** - * @see SelectionStatusDialog#computeResult() - */ - @Override - protected void computeResult() { - // nothing to do - } - - @Override - public Control createDialogArea(Composite parent) { - Composite contents = (Composite) super.createDialogArea(parent); - // (parent, "Container rules", "Avail. extensions/interceptors"); - - fTree = new Tree(contents, SWT.H_SCROLL | SWT.BORDER); - fTree.setHeaderVisible(true); - GridData data = new GridData(GridData.FILL_BOTH); - fTree.setLayoutData(data); - data.heightHint = 150; - // data.widthHint = 200; - - // Turn off drawing to avoid flicker - fTree.setRedraw(false); - - TreeColumn instances = new TreeColumn(fTree, SWT.LEFT); - instances.setText("Instance"); - instances.setWidth(200); - TreeColumn explicitAlloc = new TreeColumn(fTree, SWT.LEFT); - explicitAlloc.setText("explicit allocation"); - explicitAlloc.setWidth(150); - TreeColumn implicitAlloc = new TreeColumn(fTree, SWT.LEFT); - implicitAlloc.setText("implicit allocation"); - implicitAlloc.setWidth(150); - - fillTree(fTree, null, m_cdp.getMainInstance()); - - // Turn drawing back on! - fTree.setRedraw(true); - - fTree.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent e) { - if (fTree.getSelection().length > 0) { - selectInstance(fTree.getSelection()[0]); - } - } - }); - - Label label = new Label(); - label.setText("seletected instance:"); - fLabel = new Label(); - - createAllocInfo(contents); - return contents; - } - - /** - * Helper method to fill a tree with data - * - * @param tree - * the tree to fill - */ - private void fillTree(Tree tree, TreeItem treeItem, InstanceSpecification is) { - TreeItem item; - if (treeItem != null) { - item = new TreeItem(treeItem, SWT.NONE); - } else { - item = new TreeItem(tree, SWT.NONE); - } - item.setData(is); - setTextFromData(item); - - // create children - for (InstanceSpecification subIS : DepUtils.getContainedNonSharedInstances(is)) { - fillTree(tree, item, subIS); - } - } - - // obtain name and explicit/implicit node Allocation - protected void setTextFromData(TreeItem ti) { - Object data = ti.getData(); - if (data instanceof InstanceSpecification) { - InstanceSpecification is = (InstanceSpecification) data; - - String name = is.getName(); - int index = name.lastIndexOf("."); //$NON-NLS-1$ - if (index != -1) { - name = name.substring(index + 1); - } - InstanceSpecification explicitNodeOrThread = AllocUtils.getNodeOrThread(is); - Classifier cl = DepUtils.getClassifier(is); - String nodeName; - if (explicitNodeOrThread == null) { - nodeName = "-"; //$NON-NLS-1$ - } else { - nodeName = getAllocName(explicitNodeOrThread); - } - if (cl instanceof Class) { - if (BootLoaderGen.hasUnconnectedStartRoutine(null, (Class) cl, null)) { - nodeName += " (main)"; //$NON-NLS-1$ - } - } - EList implicitNodes = AllocUtils.getAllNodesOrThreadsParent(is); - implicitNodes.addAll(AllocUtils.getAllNodesOrThreadsParent(is)); - String list = ""; //$NON-NLS-1$ - for (InstanceSpecification node : implicitNodes) { - if (list.equals("")) { //$NON-NLS-1$ - list = getAllocName(node); - } else { - list += ", " + getAllocName(node); //$NON-NLS-1$ - } - } - ti.setText(new String[] { name, nodeName, "[" + list + "]" }); //$NON-NLS-1$//$NON-NLS-2$ - } - } - - protected void refreshTree(TreeItem ti) { - setTextFromData(ti); - for (TreeItem subItem : ti.getItems()) { - refreshTree(subItem); - } - } - - private String getAllocName(InstanceSpecification nodeOrThread) { - if (nodeOrThread == null) { - return "no explicit allocation"; - } else { - String name = nodeOrThread.getName(); - InstanceSpecification threadNode = AllocUtils.getNode(nodeOrThread); - return name + (threadNode != null ? " on " + threadNode.getName() : ""); - } - } - - protected void createAllocInfo(Composite parent) { - // create extension kind combo - fAlloc = DialogUtils.createComboWithText(parent, "Alloc to node:", - SWT.DROP_DOWN | SWT.READ_ONLY, SWT.NONE); - - String items[] = new String[nodeOrThreadList.size()]; - int i = 0; - for (InstanceSpecification nodeOrThread : nodeOrThreadList) { - items[i++] = getAllocName(nodeOrThread); - } - fAlloc.setItems(items); - fAlloc.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent event) { - if (currentIS != null) { - updateAllocation(currentIS, fAlloc.getSelectionIndex()); - // selectionCount should always be 1 - for (TreeItem ti : fTree.getSelection()) { - refreshTree(ti); - } - } - } - }); - - fAlloc.setEnabled(false); - } - - /** - * Select a rule, i.e. update the visual representation from the rule - * - * @param rule - */ - protected void selectInstance(TreeItem item) { - // for (Port port : rule.getPortSet ()) { - // fPorts.setSelection() - // } - currentIS = (InstanceSpecification) item.getData(); - fLabel.setText(currentIS.getName()); - - fAlloc.setEnabled(true); - InstanceSpecification nodeOrThread = AllocUtils.getNodeOrThread(currentIS); - - for (int i = 0; i < nodeOrThreadList.size(); i++) { - if (nodeOrThreadList.get(i) == nodeOrThread) { - fAlloc.select(i); - } - } - } - - private void updateAllocation(InstanceSpecification is, int index) { - InstanceSpecification oldNode = AllocUtils.getNodeOrThread(is); - InstanceSpecification newNode = nodeOrThreadList.get(index); - - if (oldNode == newNode) { - return; - } - - // add or update - if (oldNode == null) { - if (!AllocUtils.allocate(is, newNode)) { - if (MessageDialog.openQuestion(Display.getDefault().getActiveShell(), "Error", - "Stereotype application failed. The profile MARTE::Allocation is probably not applied. Try to apply it?")) { - AbstractEMFOperation applyProfile = new AddMarteAndFcmProfile(PackageUtil.getRootPackage(is), AddMarteAndFcmProfile.APPLY_ALLOC, TransactionUtil.getEditingDomain(is)); - CommandSupport.exec(applyProfile); - AllocUtils.allocate(is, newNode); - } - } - } else { - AllocUtils.updateAllocation(is, oldNode, newNode); - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AttributeLabelProvider.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AttributeLabelProvider.java deleted file mode 100644 index 568acd2541f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AttributeLabelProvider.java +++ /dev/null @@ -1,36 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; - -public class AttributeLabelProvider extends LabelProvider { - - @Override - public String getText(Object element) { - if (element instanceof Property) { - Property p = (Property) element; - Type type = p.getType(); - return p.getClass_().getName() + "." + p.getName() + ((type != null) ? - " : " + type.getQualifiedName() : - ""); - } - else { - return "invalid"; - } - } -}; diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChooseConfigOpt.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChooseConfigOpt.java deleted file mode 100644 index 8c2b5f6cda9..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChooseConfigOpt.java +++ /dev/null @@ -1,245 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import java.util.ArrayList; -import java.util.Collections; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.ConfigOption; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.uml.profile.ui.dialogs.AlphabeticalViewerSorter; -import org.eclipse.papyrus.uml.profile.ui.dialogs.ChooseSetAssistedDialog; -import org.eclipse.papyrus.uml.profile.ui.dialogs.IChooseDialog; -import org.eclipse.papyrus.uml.properties.profile.ui.dialogs.StereotypeQualifiedLabelProvider; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Package; - - -public class ChooseConfigOpt extends ChooseSetAssistedDialog implements IChooseDialog { - - protected EList visitedPackages; - - /** - * LabelProvider for stereotype completion proposal provider with qualified names. - */ - final private StereotypeQualifiedLabelProvider qualifiedLabelProvider = new StereotypeQualifiedLabelProvider(); - - /** - * Default Constructor. - * - * @param parentShell - * the parent shell - * @param theElement - * the UML element to be modified - */ - public ChooseConfigOpt(Shell parentShell, Package model, ContainerRule rule) { - super(parentShell, - "Available configuration options: ", - "Applied configuration options: "); - labelProvider = new ConfigOptionLabelProvider(); - decoratedContentProposalProvider = new ConfigOptContentProposalProvider(); - - for (ConfigOption option : rule.getForConfig()) { - selectedElementList.addElement(option.getBase_Class()); - } - - visitedPackages = new BasicEList(); - EList configOptList = new BasicEList(); - getAvailConfigOpts(model, configOptList); - for (Class current : configOptList) { - if (!selectedElementList.contains(current)) { - possibleElementList.addElement(current); - } - } - } - - private void getAvailConfigOpts(Package pkg, EList configOptList) { - for (Element el : pkg.getMembers()) { - if (el instanceof Package) { - if (!visitedPackages.contains(el)) { - visitedPackages.add((Package) el); - getAvailConfigOpts((Package) el, configOptList); - } - } else if (el instanceof Class) { - if (StereotypeUtil.isApplied(el, ConfigOption.class)) { - configOptList.add((Class) el); - } - } - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog#createDialogArea(org.eclipse.swt.widgets.Composite) - */ - /** - * Creates the dialog area. - * - * @param parent - * the parent - * - * @return the control - */ - @Override - protected Control createDialogArea(Composite parent) { - Control composite = super.createDialogArea(parent); - - // Add 2 columns to the table area - // possibleElementsTable.setLinesVisible(true); - possibleElementsTable.setHeaderVisible(true); - - // 1st column with image/checkboxes - NOTE: The SWT.CENTER has no effect!! - TableColumn column = new TableColumn(possibleElementsTable, SWT.CENTER, 0); - column.setText("Option"); - column.setWidth(100); - column.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent e) { - possibleElementsTableViewer.setSorter(new AlphabeticalViewerSorter(0)); - } - }); - - // 2nd column with task Description - column = new TableColumn(possibleElementsTable, SWT.LEFT, 1); - column.setText("Information"); - column.setWidth(165); - // Add listener to column so tasks are sorted by description when clicked - column.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent e) { - possibleElementsTableViewer.setSorter(new AlphabeticalViewerSorter(1)); - } - }); - - // set sorter to the possible element table viewer - possibleElementsTableViewer.setSorter(new AlphabeticalViewerSorter(0)); - - return composite; - } - - /* - * (non-Javadoc) - * - * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog#runAddElement(java.lang.String) - */ - /** - * Run add element. - * - * @param name - * the name - */ - @Override - protected void runAddElement(String name) { - // find the stereotype in the list - Class option = null; - for (Object possibleElement : possibleElementList.getElements()) { - Class element = (Class) possibleElement; - if (name.equalsIgnoreCase(element.getName()) || - name.equalsIgnoreCase(element.getQualifiedName())) { - option = element; - } - } - if (option != null) { - runActionAdd(option); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog#isSelectableElement(java.lang.String) - */ - /** - * Checks if is selectable element. - * - * @param text - * the text - * - * @return true, if is selectable element - */ - @Override - protected boolean isSelectableElement(String text) { - // iterate through all possibilities and return true if text corresponds - for (Object possibleElement : possibleElementList.getElements()) { - Class element = (Class) possibleElement; - if (text.equalsIgnoreCase(element.getName()) || text.equalsIgnoreCase(element.getQualifiedName())) { - return true; - } - } - return false; - } - - /** - * Content Proposal provider for stereotypes dialog. Propose the simple - * name of the stereotype and its qualified name. - * - * @author Remi Schnekenburger - */ - public class ConfigOptContentProposalProvider extends DecoratedContentProposalProvider { - - /* - * (non-Javadoc) - * - * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog.DecoratedContentProposalProvider#getProposals(java.lang.String, int) - */ - /** - * Gets the proposals. - * - * @param contents - * the contents - * @param position - * the position - * - * @return the proposals - */ - @Override - public DecoratedContentProposal[] getProposals(String contents, int position) { - ArrayList proposals = new ArrayList(); - - if (possibleElementList != null) { - for (Object configOptObj : possibleElementList.getElements()) { - final Class configOpt = (Class) configOptObj; - final String simpleName = configOpt.getName(); - final String qualifiedName = configOpt.getQualifiedName(); - - if (position < simpleName.length() && contents.substring(0, position).equalsIgnoreCase(simpleName.substring(0, position))) { - proposals.add(new DecoratedContentProposal(configOpt, labelProvider)); - } - - if (position < qualifiedName.length() && contents.substring(0, position).equalsIgnoreCase(qualifiedName.substring(0, position))) { - proposals.add(new DecoratedContentProposal(configOpt, qualifiedLabelProvider)); - } - } - } - - Collections.sort(proposals); - return proposals.toArray(new DecoratedContentProposal[proposals.size()]); - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChoosePorts.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChoosePorts.java deleted file mode 100644 index df3f4e3e44f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChoosePorts.java +++ /dev/null @@ -1,244 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import java.util.ArrayList; -import java.util.Collections; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.InterceptionRule; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.uml.profile.ui.dialogs.AlphabeticalViewerSorter; -import org.eclipse.papyrus.uml.profile.ui.dialogs.ChooseSetAssistedDialog; -import org.eclipse.papyrus.uml.profile.ui.dialogs.IChooseDialog; -import org.eclipse.papyrus.uml.properties.profile.ui.dialogs.StereotypeQualifiedLabelProvider; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Feature; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; - - -public class ChoosePorts extends ChooseSetAssistedDialog implements IChooseDialog { - - protected EList visitedPackages; - - /** - * LabelProvider for stereotype completion proposal provider with qualified names. - */ - final private StereotypeQualifiedLabelProvider qualifiedLabelProvider = new StereotypeQualifiedLabelProvider(); - - /** - * Default Constructor. - * - * @param parentShell - * the parent shell - * @param theElement - * the UML element to be modified - */ - public ChoosePorts(Shell parentShell, Class component, InterceptionRule rule) { - super(parentShell, "Available features", "Intercepted features"); - labelProvider = new PortLabelProvider(); - decoratedContentProposalProvider = new ConfigOptContentProposalProvider(); - - for (Feature feature : rule.getInterceptionSet()) { - selectedElementList.addElement(feature); - } - - visitedPackages = new BasicEList(); - if (component != null) { - // local rule with intercept some policy: choose executor ports - for (Property current : component.getOwnedAttributes()) { - if (!selectedElementList.contains(current)) { - possibleElementList.addElement(current); - } - } - for (Feature current : Utils.getAllElementsOfType(component, Feature.class)) { - if (!selectedElementList.contains(current)) { - possibleElementList.addElement(current); - } - } - } else { - // global rule with intercept some policy - // choose all ports vs. ports of "standard components" - Package top = PackageUtil.getRootPackage(rule.getBase_Property()); - for (Feature current : Utils.getAllElementsOfType(top, Feature.class)) { - if (!selectedElementList.contains(current)) { - possibleElementList.addElement(current); - } - } - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog#createDialogArea(org.eclipse.swt.widgets.Composite) - */ - /** - * Creates the dialog area. - * - * @param parent - * the parent - * - * @return the control - */ - @Override - protected Control createDialogArea(Composite parent) { - Control composite = super.createDialogArea(parent); - - // Add 2 columns to the table area - // possibleElementsTable.setLinesVisible(true); - possibleElementsTable.setHeaderVisible(true); - - // 1st column with image/checkboxes - NOTE: The SWT.CENTER has no effect!! - TableColumn column = new TableColumn(possibleElementsTable, SWT.CENTER, 0); - column.setText("Port"); - column.setWidth(60); - column.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent e) { - possibleElementsTableViewer.setSorter(new AlphabeticalViewerSorter(0)); - } - }); - - // 2nd column with task Description - column = new TableColumn(possibleElementsTable, SWT.LEFT, 1); - column.setText("Type"); - column.setWidth(100); - // Add listener to column so tasks are sorted by description when clicked - column.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent e) { - possibleElementsTableViewer.setSorter(new AlphabeticalViewerSorter(1)); - } - }); - - // set sorter to the possible element table viewer - possibleElementsTableViewer.setSorter(new AlphabeticalViewerSorter(0)); - - return composite; - } - - /* - * (non-Javadoc) - * - * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog#runAddElement(java.lang.String) - */ - /** - * Run add element. - * - * @param name - * the name - */ - @Override - protected void runAddElement(String name) { - // find the stereotype in the list - Port port = null; - for (Object possibleElement : possibleElementList.getElements()) { - Port element = (Port) possibleElement; - if (name.equalsIgnoreCase(element.getName()) || name.equalsIgnoreCase(element.getQualifiedName())) { - port = element; - } - } - if (port != null) { - runActionAdd(port); - } - } - - /* - * (non-Javadoc) - * - * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog#isSelectableElement(java.lang.String) - */ - /** - * Checks if is selectable element. - * - * @param text - * the text - * - * @return true, if is selectable element - */ - @Override - protected boolean isSelectableElement(String text) { - // iterate through all possibilities and return true if text corresponds - for (Object possibleElement : possibleElementList.getElements()) { - Port element = (Port) possibleElement; - if (text.equalsIgnoreCase(element.getName()) || text.equalsIgnoreCase(element.getQualifiedName())) { - return true; - } - } - return false; - } - - /** - * Content Proposal provider for stereotypes dialog. Propose the simple - * name of the stereotype and its qualified name. - * - * @author Remi Schnekenburger - */ - public class ConfigOptContentProposalProvider extends DecoratedContentProposalProvider { - - /* - * (non-Javadoc) - * - * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog.DecoratedContentProposalProvider#getProposals(java.lang.String, int) - */ - /** - * Gets the proposals. - * - * @param contents - * the contents - * @param position - * the position - * - * @return the proposals - */ - @Override - public DecoratedContentProposal[] getProposals(String contents, int position) { - ArrayList proposals = new ArrayList(); - - if (possibleElementList != null) { - for (Object portObj : possibleElementList.getElements()) { - final Port port = (Port) portObj; - final String simpleName = port.getName(); - final String qualifiedName = port.getQualifiedName(); - - if (position < simpleName.length() && contents.substring(0, position).equalsIgnoreCase(simpleName.substring(0, position))) { - proposals.add(new DecoratedContentProposal(port, labelProvider)); - } - - if (position < qualifiedName.length() && contents.substring(0, position).equalsIgnoreCase(qualifiedName.substring(0, position))) { - proposals.add(new DecoratedContentProposal(port, qualifiedLabelProvider)); - } - } - } - - Collections.sort(proposals); - return proposals.toArray(new DecoratedContentProposal[proposals.size()]); - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigOptionLabelProvider.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigOptionLabelProvider.java deleted file mode 100644 index ec588505f20..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigOptionLabelProvider.java +++ /dev/null @@ -1,50 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.papyrus.qompass.designer.core.Description; -import org.eclipse.swt.graphics.Image; -import org.eclipse.uml2.uml.Class; - -public class ConfigOptionLabelProvider extends LabelProvider implements ITableLabelProvider { - - @Override - public String getText(Object element) { - return ((Class) element).getName(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) - */ - @Override - public String getColumnText(Object element, int columnIndex) { - if (columnIndex == 0) { - return getText(element); - } else if (columnIndex == 1) { - return Description.getDescription((Class) element); - } - return null; - } - - @Override - public Image getColumnImage(Object element, int columnIndex) { - // TODO Auto-generated method stub - return null; - } -}; diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigureInstanceDialog.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigureInstanceDialog.java deleted file mode 100644 index f5deb6de56c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigureInstanceDialog.java +++ /dev/null @@ -1,642 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ArrayContentProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.util.FCMUtil; -import org.eclipse.papyrus.infra.widgets.toolbox.utils.DialogUtils; -import org.eclipse.papyrus.qompass.designer.core.ConfigUtils; -import org.eclipse.papyrus.qompass.designer.core.Description; -import org.eclipse.papyrus.qompass.designer.core.ElementFilter; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.papyrus.qompass.designer.core.sync.DepPlanSync; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.TreeItem; -import org.eclipse.ui.dialogs.SelectionStatusDialog; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Enumeration; -import org.eclipse.uml2.uml.EnumerationLiteral; -import org.eclipse.uml2.uml.Feature; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.InstanceValue; -import org.eclipse.uml2.uml.LiteralBoolean; -import org.eclipse.uml2.uml.LiteralInteger; -import org.eclipse.uml2.uml.LiteralString; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.ValueSpecification; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Select container rules, either from a list of globally defined rules or from - * local rules which may be created "on the fly" by this dialog. - * - * TODO: extend rule application to instances (problematic, since rules - * transformation is done on type level) - */ -public class ConfigureInstanceDialog extends SelectionStatusDialog { - - protected Class m_component; - - protected Label fDescriptionLabel; - - protected Text fDescription; - - protected TreeViewer fInstanceList; - - protected TableViewer fPropertyList; - - protected Property m_currentAttribute; - - protected final String valueLabelPrefix = "Value:"; //$NON-NLS-1$ - - protected Label fValueLabel; - - protected Text fValue; - - protected Combo fComboValue; - - protected Package m_model; - - protected Feature m_feature; - - protected EList visitedPackages; - - protected boolean m_rulePropertiesOnly; - - protected InstanceSpecification m_instance; - - EList m_instanceList; - - public ConfigureInstanceDialog(Shell parent) { - super(parent); - } - - public boolean init(Class component, ExecutionEvent from) { - // visitedPackages = new BasicEList (); - DepPlanSync.syncAllDepPlans(component); - m_component = component; - m_instance = null; - m_feature = null; - m_model = PackageUtil.getUserModel(from); - if (m_model == null) { - return false; - } - return checkAndGetInstances(); - } - - public boolean init(InstanceSpecification instance, ExecutionEvent from) { - // visitedPackages = new BasicEList (); - DepPlanSync.syncDepPlan(instance.getNearestPackage()); - m_component = DepUtils.getImplementation(instance); - m_instance = instance; - m_feature = null; - m_model = PackageUtil.getUserModel(from); - return checkAndGetInstances(); - } - - public boolean init(Feature feature, ExecutionEvent from) { - // visitedPackages = new BasicEList (); - m_feature = feature; - m_model = PackageUtil.getUserModel(from); - if (m_model == null) { - m_model = PackageUtil.getRootPackage(feature); - } - m_instance = null; - if (feature instanceof Connector) { - org.eclipse.papyrus.FCM.Connector fcmConn = UMLUtil.getStereotypeApplication(feature, - org.eclipse.papyrus.FCM.Connector.class); - if ((fcmConn != null) && (fcmConn.getIc() != null)) { - m_component = fcmConn.getIc().getBase_Class(); - return checkAndGetInstances(); - } - } else if (feature instanceof Property) { - Type type = ((Property) feature).getType(); - if (type instanceof Class) { - m_component = (Class) type; - return checkAndGetInstances(); - } - } - return false; - } - - /** - * A filter class that selects instances associated with the selected feature or component - */ - class InstanceFilter implements ElementFilter { - - private String featureCandidateName; - - @Override - public boolean acceptElement(Element element) { - if (element instanceof InstanceSpecification) { - InstanceSpecification instance = (InstanceSpecification) element; - if (m_feature instanceof Property) { - EList slots = DepUtils.getReferencingSlots(instance); - for (Slot slot : slots) { - if (slot.getDefiningFeature() == m_feature) { - return true; - } - } - } - else if (m_feature instanceof Connector) { - // Connector instances cannot be found via a slot. Since a connector is not a structural feature, - // it cannot be referenced via the "definingFeature" property of a slot. Therefore, the deployment - // plan creation (@see DepCreation.createDepPlan) simply omits slots, but still creates instances - // for the interaction components referenced by an FCM connector. - // TODO: the following code relies on specific order of instances and might not always work. - Element owner = m_feature.getOwner(); - if (DepUtils.getImplementation(instance) == owner) { - // instance is for owner of feature: examine name - featureCandidateName = instance.getName() + "." + m_feature.getName(); //$NON-NLS-1$ - } - else if (featureCandidateName != null) { - if (featureCandidateName.equals(instance.getName())) { - return true; - } - } - } else if (DepUtils.getImplementation(instance) == m_component) { - return true; - } - } - return false; - } - } - - - /** - * retrieve the instance list. Returns false, if no deployment plan could be found. - * - * @return - */ - public boolean checkAndGetInstances() { - visitedPackages = new BasicEList(); - m_instanceList = new BasicEList(); - - ElementFilter filter = new InstanceFilter(); - DepUtils.getAllInstances(m_model, m_instanceList, filter); - - if (m_instanceList.size() == 0) { - Shell shell = Display.getDefault().getActiveShell(); - if (DepPlanUtils.getAllDepPlans(m_model).size() == 0) { - MessageDialog.openInformation(shell, "Instance configuration", - "No deployment plans are defined. Create a deployment plan before configuring instances"); - return false; - } - else if (MessageDialog.openConfirm(shell, "Instance configuration", - "The list of available instances is empty. Synchronize deployment plans?")) { - DepPlanSync.syncAllDepPlans(m_model); - visitedPackages = new BasicEList(); - DepUtils.getAllInstances(m_model, m_instanceList, filter); - - if (m_instanceList.size() == 0) { - MessageDialog - .openInformation( - shell, - "Instance configuration", - "There are still no instances available\n. Check whether you created already a deployment plan for your system. Check as well, if the parts in your a composite use \"composite\" as aggregation kind. (Results of deployment plan synchronizations will be unrolled)"); - return false; - } - } - } - return true; - } - - /** - * @see SelectionStatusDialog#computeResult() - */ - @Override - protected void computeResult() { - // nothing to do - } - - @Override - public Control createDialogArea(Composite parent) { - Composite contents = (Composite) super.createDialogArea(parent); - // (parent, "Container rules", "Avail. extensions/interceptors"); - - createInstanceSelectionGroup(contents); - createInstanceConfigurationGroup(contents); - return contents; - } - - protected void createInstanceSelectionGroup(Composite parent) { - Composite instanceSelection = new Composite(parent, SWT.NONE); - GridLayout grid = new GridLayout(1, true); - GridData groupGridData = new GridData(); - - groupGridData.grabExcessVerticalSpace = true; - groupGridData.grabExcessHorizontalSpace = true; - groupGridData.horizontalAlignment = GridData.FILL; - groupGridData.verticalAlignment = GridData.FILL; - instanceSelection.setLayout(grid); - instanceSelection.setLayoutData(groupGridData); - - /* - * fRules = DialogUtils.createFilteredList (ruleSelGroup, new - * RuleLabelProvider(), 200, 200, SWT.BORDER | SWT.V_SCROLL | - * SWT.H_SCROLL); - */ - - // - // --------------- instance selection ------------------- - // - Group instanceSelGroup = new Group(instanceSelection, SWT.BORDER); - instanceSelGroup.setText(addSpaces("associated instance specifications")); - // ruleGroup.setLayout(new RowLayout (SWT.VERTICAL)); - instanceSelGroup.setLayout(new GridLayout(1, false)); - instanceSelGroup.setLayoutData(groupGridData); - - fInstanceList = new TreeViewer(instanceSelGroup, SWT.BORDER); - - GridData data = new GridData(GridData.FILL_BOTH); - data.heightHint = 100; - data.widthHint = 350; - - fInstanceList.getTree().setLayoutData(data); - fInstanceList.setLabelProvider(new InstanceLabelProvider()); - fInstanceList.setContentProvider(new ITreeContentProvider() { - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - } - - @Override - public void dispose() { - } - - @Override - public boolean hasChildren(Object element) { - return getChildren(element).length > 0; - } - - @Override - public Object getParent(Object element) { - return null; - } - - @Override - public Object[] getElements(Object inputElement) { - return (Object[]) inputElement; - } - - @Override - public Object[] getChildren(Object parentElement) { - if (parentElement instanceof InstanceSpecification) { - return DepUtils.getContainedInstances((InstanceSpecification) parentElement).toArray(); - } - return new Object[0]; - } - }); - - fInstanceList.setInput(m_instanceList.toArray()); - fInstanceList.addSelectionChangedListener(new ISelectionChangedListener() { - - @Override - public void selectionChanged(SelectionChangedEvent event) { - ISelection selection = fInstanceList.getSelection(); - if (selection instanceof StructuredSelection) { - Object[] selected = ((StructuredSelection) selection) - .toArray(); - if ((selected.length == 1) - && (selected[0] instanceof InstanceSpecification)) { - m_instance = (InstanceSpecification) selected[0]; - Classifier cl = DepUtils.getClassifier(m_instance); - fPropertyList.setInput(getConfigAttributes(cl).toArray()); - selectProperty(m_currentAttribute); - } - } - } - }); - if (m_instance != null) { - int index = m_instanceList.indexOf(m_instance); - if (index != -1) { - TreeItem treeItem = fInstanceList.getTree().getItem(index); - fInstanceList.getTree().setSelection(treeItem); - } - } - } - - // create instance configuration group - protected void createInstanceConfigurationGroup(Composite parent) { - GridData groupGridData = DialogUtils.createFillGridData(); - - Group instanceConfigurationGroup = new Group(parent, SWT.BORDER); - instanceConfigurationGroup.setText(addSpaces("Configuration")); - instanceConfigurationGroup.setLayout(new RowLayout(SWT.VERTICAL)); - instanceConfigurationGroup.setLayout(new GridLayout(1, false)); - instanceConfigurationGroup.setLayoutData(groupGridData); - - // fRuleName = new Text (ruleInfoGroup, SWT.NONE); - Label configL = new Label(instanceConfigurationGroup, SWT.NONE); - configL.setText("Available properties:"); - - fPropertyList = new TableViewer(instanceConfigurationGroup, SWT.BORDER); - fPropertyList.setLabelProvider(new AttributeLabelProvider()); - fPropertyList.setContentProvider(new ArrayContentProvider()); - fPropertyList.setInput(getConfigAttributes(m_component).toArray()); - fPropertyList - .addSelectionChangedListener(new ISelectionChangedListener() { - - @Override - public void selectionChanged(SelectionChangedEvent event) { - ISelection selection = fPropertyList.getSelection(); - if (selection instanceof StructuredSelection) { - Object[] selected = ((StructuredSelection) selection) - .toArray(); - if ((selected.length == 1) - && (selected[0] instanceof Property)) { - selectProperty((Property) selected[0]); - } - } - } - }); - - fValueLabel = new Label(instanceConfigurationGroup, SWT.NONE); - - GridData span2 = new GridData(); - span2.horizontalAlignment = GridData.FILL; - span2.grabExcessHorizontalSpace = true; - span2.heightHint = 70; - fPropertyList.getTable().setLayoutData(span2); - - fValue = new Text(instanceConfigurationGroup, SWT.WRAP); - span2 = new GridData(); - span2.horizontalAlignment = GridData.FILL; - span2.grabExcessHorizontalSpace = true; - fValue.setLayoutData(span2); - - fValue.addFocusListener(new FocusListener() { - - @Override - public void focusLost(FocusEvent e) { - // store value, once focus is lost (different element is - // selected) - String valueStr = fValue.getText(); - Slot valueSlot = null; - if (m_instance == null) { - // no instance has been selected - // (field should be inactive, if not selected) - return; - } - for (Slot slot : m_instance.getSlots()) { - if (slot.getDefiningFeature() == m_currentAttribute) { - valueSlot = slot; - } - } - if (valueSlot == null) { - // slot does not exist yet, create - valueSlot = DepCreation.createSlotForConfigProp(m_instance, - m_currentAttribute); - } - for (ValueSpecification value : valueSlot.getValues()) { - if (value instanceof LiteralString) { - ((LiteralString) value).setValue(valueStr); - } else if (value instanceof LiteralInteger) { - ((LiteralInteger) value).setValue(Integer - .parseInt(valueStr)); - } else if (value instanceof LiteralBoolean) { - ((LiteralBoolean) value).setValue(Boolean - .parseBoolean(valueStr)); - } - } - } - - @Override - public void focusGained(FocusEvent e) { - } - }); - - fComboValue = new Combo(instanceConfigurationGroup, SWT.NONE); - span2 = new GridData(); - span2.horizontalAlignment = GridData.FILL; - span2.grabExcessHorizontalSpace = true; - fComboValue.setLayoutData(span2); - - fComboValue.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent event) { - // store value, once focus is lost (different element is - // selected) - int index = fComboValue.getSelectionIndex(); - if (m_instance == null) { - // no instance has been selected - // (field should be inactive, if not selected) - return; - } - Slot valueSlot = null; - for (Slot slot : m_instance.getSlots()) { - if (slot.getDefiningFeature() == m_currentAttribute) { - // slot for enumerations can only be configured with instanceValues. - // Destroy slots with do not contain at least one instanceValue - boolean destroySlot = true; - for (ValueSpecification value : slot.getValues()) { - if (value instanceof InstanceValue) { - destroySlot = false; - } - } - if (destroySlot) { - slot.destroy(); - } - else { - valueSlot = slot; - } - break; - } - } - if (valueSlot == null) { - // slot does not exist yet, create - valueSlot = DepCreation.createSlotForConfigProp(m_instance, - m_currentAttribute); - } - Enumeration enumeration = (Enumeration) m_currentAttribute.getType(); - for (ValueSpecification value : valueSlot.getValues()) { - if (value instanceof InstanceValue) { - ((InstanceValue) value).setInstance(enumeration.getOwnedLiterals().get(index)); - } - } - } - }); - - fDescriptionLabel = new Label(instanceConfigurationGroup, SWT.NONE); - fDescriptionLabel.setText("Description:"); - fDescriptionLabel.setLayoutData(span2); - - span2 = new GridData(); - span2.horizontalAlignment = GridData.FILL; - span2.grabExcessHorizontalSpace = true; - span2.grabExcessVerticalSpace = true; - span2.verticalAlignment = GridData.FILL; - span2.heightHint = 80; - - fDescription = new Text(instanceConfigurationGroup, SWT.NONE | SWT.WRAP - | SWT.V_SCROLL | SWT.READ_ONLY); - fDescription.setLayoutData(span2); - // createMessageArea (ruleInfoGroup); - instanceConfigurationGroup.pack(); - setEnabled(false); - } - - /** - * Select a rule, i.e. update the visual representation from the rule - * - * @param rule - */ - protected void selectProperty(Property attribute) { - m_currentAttribute = attribute; - if ((attribute == null) || (fValue == null)) { - setEnabled(false); - return; - } - setEnabled(true); - fDescription.setText(Description.getDescription(attribute, "not available")); - fValueLabel.setText(getValueLabel(attribute)); - boolean isEnum = m_currentAttribute.getType() instanceof Enumeration; - fValue.setVisible(!isEnum); - fComboValue.setVisible(isEnum); - if (isEnum) { - Enumeration enumeration = (Enumeration) m_currentAttribute.getType(); - EList literals = enumeration.getOwnedLiterals(); - String items[] = new String[literals.size()]; - for (int i = 0; i < literals.size(); i++) { - items[i] = literals.get(i).getName(); - } - fComboValue.setItems(items); - } - - for (Slot slot : m_instance.getSlots()) { - if (slot.getDefiningFeature() == m_currentAttribute) { - for (ValueSpecification value : slot.getValues()) { - if (value instanceof LiteralInteger) { - Integer intVal = ((LiteralInteger) value).getValue(); - fValue.setText(intVal.toString()); - return; - } - if (value instanceof InstanceValue) { - InstanceSpecification enumIS = ((InstanceValue) value).getInstance(); - if (enumIS instanceof EnumerationLiteral) { - EnumerationLiteral literal = (EnumerationLiteral) enumIS; - int index = literal.getEnumeration().getOwnedLiterals().indexOf(literal); - if (index != -1) { - fComboValue.select(index); - } - } - return; - } - else if (value instanceof LiteralBoolean) { - Boolean boolVal = ((LiteralBoolean) value).booleanValue(); - fValue.setText(boolVal.toString()); - return; - } - else if (value instanceof LiteralString) { - fValue.setText(((LiteralString) value).getValue()); - return; - } - } - } - } - fValue.setText(""); //$NON-NLS-1$ - } - - private void setEnabled(boolean enabled) { - fDescriptionLabel.setEnabled(enabled); - fDescription.setEnabled(enabled); - fValueLabel.setEnabled(enabled); - fValue.setEnabled(enabled); - if (!enabled) { - fValue.setText(""); //$NON-NLS-1$ - fDescription.setText(""); //$NON-NLS-1$ - fValueLabel.setText(valueLabelPrefix); - } - } - - private String getValueLabel(Property attribute) { - String label = valueLabelPrefix; - if (attribute.getDefault() != null) { - return label + " " + String.format("(default = %s)", attribute.getDefault()); //$NON-NLS-1$ //$NON-NLS-2$ - } - return label; - } - - private EList getConfigAttributes(Classifier component) { - EList list = new BasicEList(); - // add properties of component - list.addAll(ConfigUtils.getConfigAttributes(component)); - // now add properties of container rules - // TODO: is it possible that multiple container extensions of the same - // type exist, and if yes, how do we configure these? - if (component instanceof Class) { - EList rules = FCMUtil.getAllContainerRules((Class) component); - if (rules != null) { - for (ContainerRule aRule : rules) { - // (many, in case of a composite rule) - try { - list.addAll(ConfigUtils.getConfigAttributes(aRule)); - } catch (TransformationException e) { - } - } - } - } - return list; - } - - /** - * Add a space before and after - * - * @param text - * @return - */ - public static String addSpaces(String text) { - return " " + text + " "; //$NON-NLS-1$ //$NON-NLS-2$ - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigurePortDialog.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigurePortDialog.java deleted file mode 100644 index 7f8bc62475a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigurePortDialog.java +++ /dev/null @@ -1,388 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import java.util.Collections; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ArrayContentProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.papyrus.FCM.PortKind; -import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog; -import org.eclipse.papyrus.infra.widgets.toolbox.utils.DialogUtils; -import org.eclipse.papyrus.qompass.designer.core.Description; -import org.eclipse.papyrus.qompass.designer.core.PortUtils; -import org.eclipse.papyrus.qompass.designer.ui.Messages; -import org.eclipse.papyrus.uml.tools.providers.ServiceEditFilteredContentProvider; -import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.SelectionStatusDialog; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Select container rules, either from a list of globally defined rules or from - * local rules which may be created "on the fly" by this dialog. - * - * TODO: extend rule application to instances (problematic, since rules - * transformation is done on type level) - * - */ -public class ConfigurePortDialog extends SelectionStatusDialog { - - protected Class m_component; - - protected Text fDescription; - - protected TableViewer fPortList; - - protected Port m_currentPort; - - protected Combo fKindCombo; - - protected EList portKindList; - - protected Label fType; - - protected Button fTypeButton; - - protected Label fProvided; - - protected Label fRequired; - - protected Package m_model; - - protected EList m_ports; - - public static final String COLON = ":"; //$NON-NLS-1$ - - public ConfigurePortDialog(Shell parent) { - super(parent); - } - - public boolean init(Port port) { - // visitedPackages = new BasicEList (); - m_component = port.getClass_(); - m_currentPort = port; // preselect port (don't call selectPort before initialization of dialog area); - m_model = PackageUtil.getRootPackage(m_component); - m_ports = PortUtils.getAllPorts(m_component); - return true; - } - - public boolean init(Class clazz) { - // visitedPackages = new BasicEList (); - m_component = clazz; - m_model = PackageUtil.getRootPackage(m_component); - m_currentPort = null; - m_ports = PortUtils.getAllPorts(m_component); - return true; - } - - - /** - * @see SelectionStatusDialog#computeResult() - */ - @Override - protected void computeResult() { - // nothing to do - } - - @Override - public Control createDialogArea(Composite parent) { - Composite contents = (Composite) super.createDialogArea(parent); - // (parent, "Container rules", "Avail. extensions/interceptors"); - - createPortConfigurationGroup(contents); - if (m_currentPort != null) { - int index = m_ports.indexOf(m_currentPort); - if (index != -1) { - fPortList.getTable().setSelection(index); - selectPort(m_currentPort); - } - } - return contents; - } - - // create instance configuration group - protected void createPortConfigurationGroup(Composite parent) { - GridData groupGridData = DialogUtils.createFillGridData(); - - // create grid data - GridData gridData = DialogUtils.createFillGridData(); - GridData gridDataH80Span2 = DialogUtils.createFillGridData(); - gridDataH80Span2.horizontalSpan = 2; - gridDataH80Span2.heightHint = 80; - GridData gridDataH25Span2 = DialogUtils.createFillGridData(); - gridDataH25Span2.horizontalSpan = 2; - gridDataH25Span2.heightHint = 25; - GridData gridDataH60 = DialogUtils.createFillGridData(); - gridDataH60.heightHint = 60; - GridData gridDataSpan2 = DialogUtils.createFillGridData(); - gridDataSpan2.horizontalSpan = 2; - - // fRuleName = new Text (ruleInfoGroup, SWT.NONE); - Group portSelection = new Group(parent, SWT.BORDER); - portSelection.setLayout(new GridLayout(1, false)); - // configL.setLayout(new RowLayout()); - - portSelection.setText(" " + Messages.ConfigurePortDialog_AvailPorts + " "); //$NON-NLS-1$ //$NON-NLS-2$ - portSelection.setLayoutData(gridDataH60); - - fPortList = new TableViewer(portSelection, SWT.BORDER); - fPortList.setLabelProvider(new PortLabelProvider()); - fPortList.setContentProvider(new ArrayContentProvider()); - fPortList.setInput(m_ports.toArray()); - fPortList.getTable().setLayoutData(gridDataH60); - fPortList.addSelectionChangedListener(new ISelectionChangedListener() { - - @Override - public void selectionChanged(SelectionChangedEvent event) { - ISelection selection = fPortList.getSelection(); - if (selection instanceof StructuredSelection) { - Object[] selected = ((StructuredSelection) selection) - .toArray(); - if ((selected.length == 1) - && (selected[0] instanceof Port)) { - selectPort((Port) selected[0]); - } - } - } - }); - portSelection.pack(); - - Group instanceConfigurationGroup = new Group(parent, SWT.BORDER); - instanceConfigurationGroup.setText(" " + Messages.ConfigurePortDialog_AvailPorts + " "); //$NON-NLS-1$ //$NON-NLS-2$ - instanceConfigurationGroup.setLayout(new GridLayout(2, false)); - instanceConfigurationGroup.setLayoutData(groupGridData); - - Label kindText = new Label(instanceConfigurationGroup, SWT.NONE); - kindText.setText(Messages.ConfigurePortDialog_Kind + COLON); - - fKindCombo = new Combo(instanceConfigurationGroup, SWT.NONE); - portKindList = getAvailableKinds(m_model); - if (portKindList.size() == 0) { - MessageDialog.openInformation(Display.getDefault().getActiveShell(), "No port kinds founds", "No port kinds are available. Please import a Qompass model library"); - } - String[] portKindStrList = new String[portKindList.size() + 1]; - portKindStrList[0] = Messages.ConfigurePortDialog_None; - for (int i = 0; i < portKindList.size(); i++) { - portKindStrList[i + 1] = portKindList.get(i).getBase_Class().getName(); - } - fKindCombo.setItems(portKindStrList); - fKindCombo.addSelectionListener(new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - // changePortKind - org.eclipse.papyrus.FCM.Port fcmPort = StereotypeUtil.applyApp(m_currentPort, org.eclipse.papyrus.FCM.Port.class); - if (fcmPort != null) - { - int index = fKindCombo.getSelectionIndex(); - if (index > 0) { - PortKind kind = portKindList.get(index - 1); - fcmPort.setKind(kind); - selectPort(m_currentPort); - } - else { - StereotypeUtil.unapply(m_currentPort, org.eclipse.papyrus.FCM.Port.class); - selectPort(m_currentPort); - } - } - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - Label fTypeLabel = new Label(instanceConfigurationGroup, SWT.NONE); - fTypeLabel.setText(Messages.ConfigurePortDialog_Type + COLON); - fTypeLabel.setLayoutData(gridData); - - fType = new Label(instanceConfigurationGroup, SWT.NONE); - fType.setLayoutData(gridData); - - fTypeButton = new Button(instanceConfigurationGroup, SWT.NONE); - fTypeButton.setText(Messages.ConfigurePortDialog_ChangeType); - fTypeButton.setLayoutData(gridDataH25Span2); - fTypeButton.addSelectionListener(new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - // use Papyrus type selection dialog ... - TreeSelectorDialog tsd = new TreeSelectorDialog(Display.getDefault().getActiveShell()); - - EStructuralFeature feature = UMLPackage.eINSTANCE.getTypedElement_Type(); - ServiceEditFilteredContentProvider contentProvider = - new ServiceEditFilteredContentProvider(m_currentPort, feature, new EObject[] { m_model }); - - EList wantedMetaClasses = new BasicEList(); - wantedMetaClasses.add(feature.getEType()); - // creates (indirect) dependency to org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelContentProvider - contentProvider.setWantedMetaclasses(wantedMetaClasses); - contentProvider.setNotWantedMetaclasses(Collections.EMPTY_LIST); - tsd.setContentProvider(contentProvider); - tsd.setLabelProvider(new UMLLabelProvider()); - tsd.open(); - Object result[] = tsd.getResult(); - if ((result != null) && (result.length == 1)) { - // if(result[0] instanceof IAdaptable) { - // Object type = ((IAdaptable)result[0]).getAdapter(EObject.class); - Object type = result[0]; - if (type instanceof Type) { - m_currentPort.setType((Type) type); - selectPort(m_currentPort); - } - } - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - // Label emptySpace = new Label(instanceConfigurationGroup, SWT.NONE); - // emptySpace.setLayoutData(gridDataSpan2); - - - // Composite derivedInterfaces = new Composite(instanceConfigurationGroup, SWT.NONE); - Group derivedInterfaces = new Group(instanceConfigurationGroup, SWT.NONE); - derivedInterfaces.setLayout(new GridLayout(2, false)); - - // Label dil = new Label(derivedInterfaces, SWT.NONE); - // dil.setText("Interfaces derived from port kind"); - derivedInterfaces.setText(Messages.ConfigurePortDialog_IntfDerived); - // dil.setLayoutData(gridDataSpan2); - derivedInterfaces.setLayoutData(gridDataSpan2); - - Label fProvidedLabel = new Label(derivedInterfaces, SWT.NONE); - fProvidedLabel.setText(Messages.ConfigurePortDialog_Provided + COLON); - fProvided = new Label(derivedInterfaces, SWT.NONE); - fProvided.setLayoutData(gridData); - - Label fRequiredLabel = new Label(derivedInterfaces, SWT.NONE); - fRequiredLabel.setText(Messages.ConfigurePortDialog_Required + COLON); - fRequired = new Label(derivedInterfaces, SWT.NONE); - fRequired.setLayoutData(gridData); - derivedInterfaces.pack(); - - fDescription = new Text(instanceConfigurationGroup, SWT.NONE | SWT.WRAP - | SWT.V_SCROLL | SWT.READ_ONLY); - fDescription.setLayoutData(gridDataH80Span2); - // createMessageArea (ruleInfoGroup); - instanceConfigurationGroup.pack(); - setEnabled(false); - } - - /** - * Select a rule, i.e. update the visual representation from the rule - * - * @param rule - */ - protected void selectPort(Port port) { - m_currentPort = port; - if (port == null) { - setEnabled(false); - return; - } - setEnabled(true); - org.eclipse.papyrus.FCM.Port fcmPort = UMLUtil.getStereotypeApplication(port, org.eclipse.papyrus.FCM.Port.class); - if (port.getType() != null) { - fType.setText(port.getType().getQualifiedName()); - } - else { - fType.setText(Messages.ConfigurePortDialog_Undef); - } - if ((fcmPort != null) && (fcmPort.getKind() != null)) { - PortKind kind = fcmPort.getKind(); - if (portKindList.contains(kind)) { - int index = portKindList.indexOf(kind) + 1; - fKindCombo.select(index); - } - fDescription.setText(Description.getDescription(kind.getBase_Class(), Messages.ConfigurePortDialog_NotAvail)); - Interface providedI = PortUtils.getProvided(port); - Interface requiredI = PortUtils.getRequired(port); - fProvided.setText(providedI != null ? providedI.getQualifiedName() : Messages.ConfigurePortDialog_None); - fRequired.setText(requiredI != null ? requiredI.getQualifiedName() : Messages.ConfigurePortDialog_None); - } - else { - fProvided.setText(port.getProvideds().size() > 0 ? port.getProvideds().get(0).getQualifiedName() : Messages.ConfigurePortDialog_None); - fRequired.setText(port.getRequireds().size() > 0 ? port.getRequireds().get(0).getQualifiedName() : Messages.ConfigurePortDialog_None); - fKindCombo.select(0); - fDescription.setText(""); //$NON-NLS-1$ - } - } - - private void setEnabled(boolean enabled) { - fDescription.setEnabled(enabled); - if (!enabled) { - fDescription.setText(""); //$NON-NLS-1$ - } - } - - protected EList getAvailableKinds(Package pkg) { - EList portKindList = new UniqueEList(); - EList visitedPackages = new BasicEList(); - getAvailableKinds(pkg, portKindList, visitedPackages); - return portKindList; - } - - protected void getAvailableKinds(Package pkg, EList portKindList, EList visitedPackages) { - for (Element el : pkg.getMembers()) { - if (el instanceof Package) { - if (!visitedPackages.contains(el)) { - visitedPackages.add((Package) el); - getAvailableKinds((Package) el, portKindList, visitedPackages); - } - } else if (el instanceof Class) { - PortKind portKind = UMLUtil.getStereotypeApplication(el, PortKind.class); - if (portKind != null) { - portKindList.add(portKind); - } - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConnectorSelectionDialog.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConnectorSelectionDialog.java deleted file mode 100644 index 1652acc7663..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConnectorSelectionDialog.java +++ /dev/null @@ -1,371 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - - -import java.util.Arrays; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.UniqueEList; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.infra.widgets.toolbox.utils.DialogUtils; -import org.eclipse.papyrus.qompass.designer.core.Description; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.templates.ConnectorBinding; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.AbstractElementListSelectionDialog; -import org.eclipse.ui.dialogs.FilteredList; -import org.eclipse.ui.dialogs.SelectionStatusDialog; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Feature; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Select a connector type and implementation (group) - * TODO: show information about the used connector [usage, implem properties, ...] - * similar help for ports? - * - * @author ansgar - * - */ -public class ConnectorSelectionDialog extends AbstractElementListSelectionDialog { - - protected Package m_model; - - protected EList visitedPackages; - - protected Text m_description; - - protected Button fTypeOnly; - - private EList connectorList; - - private Feature m_selectedConnector; - - private Object[] fUpperElements; - - protected FilteredList fUpper; - - protected FilteredList fLower; - - private InteractionComponent initialSelection = null; - - public ConnectorSelectionDialog(Shell parent, Package model, Feature selectedConnector) { - super(parent, new QNameLabelProvider()); - connectorList = new BasicEList(); - visitedPackages = new BasicEList(); - getAllConnectors(model, selectedConnector, connectorList); - m_selectedConnector = selectedConnector; - setMultipleSelection(false); - m_model = model; - } - - @Override - public Control createDialogArea(Composite parent) { - Composite contents = (Composite) super.createDialogArea(parent); - createMessageArea(contents); - // createLabel(contents, "Connector type"); - GridData gridData = DialogUtils.createFillGridData(); - gridData.heightHint = 200; - - Group fUpperGroup = new Group(contents, SWT.NONE); - fUpperGroup.setLayout(new GridLayout()); - fUpperGroup.setLayoutData(gridData); - fUpperGroup.setText(" Abstract interaction components "); //$NON-NLS-1$ - createFilterText(fUpperGroup); - fUpper = createFilteredList(fUpperGroup); - - final Group fLowerGroup = new Group(contents, SWT.NONE); - fLowerGroup.setLayout(new GridLayout()); - fLowerGroup.setLayoutData(gridData); - fLowerGroup.setText(" Realizations/groups of interaction components "); //$NON-NLS-1$ - // createLabel(contents, lowerLabel); - fLower = createFilteredList(fLowerGroup); - fFilteredList = fUpper; - org.eclipse.papyrus.FCM.Connector fcmConnector = UMLUtil.getStereotypeApplication(m_selectedConnector, org.eclipse.papyrus.FCM.Connector.class); - if (fcmConnector != null) { - // getInitialElementSelections(); - initialSelection = fcmConnector.getIc(); - } else { - initialSelection = null; - } - - fTypeOnly = new Button(contents, SWT.CHECK); - fTypeOnly.setText("Select type only"); //$NON-NLS-1$ - SelectionListener fTypeOnlySL = new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - if (fTypeOnly.getSelection()) { - fLower.setEnabled(false); - fLowerGroup.setEnabled(false); - fLower.setSelection(new int[0]); - fLower.setElements(null); - } - else { - fLower.setEnabled(true); - fLowerGroup.setEnabled(true); - handleSelectionChanged(); - } - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }; - fTypeOnly.addSelectionListener(fTypeOnlySL); - - fUpper.setElements(connectorList.toArray()); - - // create initial selections - if (initialSelection instanceof InteractionComponent) { - InteractionComponent componentComp = initialSelection; - Class componentCompBase = componentComp.getBase_Class(); - if (!componentCompBase.isAbstract()) { - // get first superclass that is a component type - Class componentTypeBase = Utils.componentType(componentCompBase); - componentComp = UMLUtil.getStereotypeApplication(componentTypeBase, InteractionComponent.class); - } else { - // fLower.setEnabled (false); - // fLowerGroup.setEnabled(false); - fTypeOnly.setSelection(true); - } - // update status (listener does not evaluate passed data) - fTypeOnlySL.widgetSelected(null); - - // set initial selections - fUpper.setSelection(new Object[] { componentComp.getBase_Class() }); - } - - Label info = createMessageArea(contents); - info.setText("Information about connector implementation:"); //$NON-NLS-1$ - // m_description = createMessageArea(contents); - - GridData descriptionGD = new GridData(); - descriptionGD.horizontalAlignment = GridData.FILL; - descriptionGD.grabExcessHorizontalSpace = true; - descriptionGD.heightHint = 80; - descriptionGD.grabExcessVerticalSpace = true; - descriptionGD.verticalAlignment = GridData.FILL; - - m_description = new Text(contents, SWT.NONE | SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY); - m_description.setLayoutData(descriptionGD); - - fLower.addSelectionListener(new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - Object[] selected = fLower.getSelection(); - if ((selected.length > 0) && (selected[0] instanceof NamedElement)) { - NamedElement selectedNE = (NamedElement) selected[0]; - m_description.setText(Description.getDescription(selectedNE)); - } - else { - m_description.setText(""); - updateOkState(); - } - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - return contents; - } - - @Override - /** - * Update the enablement of the OK button based on whether or not there - * is a selection. - * - */ - protected void updateOkState() { - if (fTypeOnly.getSelection()) { - super.updateOkState(); - } else { - Button okButton = getOkButton(); - if (okButton != null) { - okButton.setEnabled(fLower.getSelection().length != 0); - } - } - } - - - protected Label createLabel(Composite parent, String name) { - if (name == null) { - return null; - } - Label label = new Label(parent, SWT.NONE); - label.setText(name); - label.setFont(parent.getFont()); - return label; - } - - /** - * Creates a label if name was not null. - * - * @param parent - * the parent composite. - * @param name - * the name of the label. - * @return returns a label if a name was given, null otherwise. - */ - - - /** - * @see SelectionStatusDialog#computeResult() - */ - @Override - protected void computeResult() { - Object[] result = new Object[] { getSelectedElement(fTypeOnly.getSelection()) }; - setResult(Arrays.asList(result)); - } - - /** - * @see AbstractElementListSelectionDialog#handleDefaultSelected() - */ - @Override - protected void handleDefaultSelected() { - if (validateCurrentSelection() && (getSelectedElement(false) != null)) { - buttonPressed(IDialogConstants.OK_ID); - } - } - - /** - * @see AbstractElementListSelectionDialog#handleSelectionChanged() - */ - @Override - protected void handleSelectionChanged() { - handleUpperSelectionChanged(); - } - - private void handleUpperSelectionChanged() { - int index = getSelectionIndex(); - if (index >= 0) { - fUpperElements = getFoldedElements(index); - - if ((fUpperElements == null) || fTypeOnly.getSelection()) { - // lower list remains empty, if typeOnly is true - fLower.setElements(new Object[] {}); - } else { - fLower.setElements(getLowerList(fUpperElements[0])); - if (initialSelection instanceof InteractionComponent) { - // select existing selection in lower section - fLower.setSelection(new Object[] { initialSelection }); - // do not try to set it again. - initialSelection = null; - } - } - } - validateCurrentSelection(); - } - - /** - * Returns the selected element from the upper or lower pane. - * - * @return Object - */ - protected Object getSelectedElement(boolean upper) { - Object[] selection; - if (upper) { - selection = fFilteredList.getSelection(); - } else { - selection = fLower.getSelection(); - } - if (selection.length > 0) { - return selection[0]; - } - return null; - } - - protected Object[] getLowerList(Object selectedUpperObj) { - EList connectorList = new UniqueEList(); - if (selectedUpperObj instanceof Class) { - visitedPackages = new BasicEList(); - getImplGroups(m_model, (Class) selectedUpperObj, connectorList); - } - return connectorList.toArray(); - } - - void getAllConnectors(Package pkg, Feature selectedConnector, EList connectorList) { - for (Element el : pkg.getMembers()) { - if (el instanceof Package) { - if (!visitedPackages.contains(el)) { - visitedPackages.add((Package) el); - getAllConnectors((Package) el, selectedConnector, connectorList); - } - } else if (el instanceof Class) { - if (StereotypeUtil.isApplied(el, InteractionComponent.class) && Utils.isCompType((Class) el)) { - - if (selectedConnector == null) { - connectorList.add((Class) el); - } else { - try { - Element owner = selectedConnector.getOwner(); - if (owner instanceof Class) { - Class composite = (Class) owner; - Log.log(IStatus.INFO, Log.DIALOGS, "ConnectorSelectionDialog.getAllConnectors: try to bind connector " + //$NON-NLS-1$ - ((Class) el).getQualifiedName()); - ConnectorBinding.obtainBinding(composite, selectedConnector, (Class) el, false); - connectorList.add((Class) el); - } else { - connectorList.add((Class) el); - } - } catch (TransformationException e) { - // silently ignore exception: it is normal that we cannot find a binding for some connectors - } - } - } - } - } - } - - void getImplGroups(Package pkg, Class selectedConnType, EList implGroupList) { - for (Element el : pkg.getMembers()) { - if (el instanceof Package) { - if (!visitedPackages.contains(el)) { - visitedPackages.add((Package) el); - getImplGroups((Package) el, selectedConnType, implGroupList); - } - } else if (el instanceof Class) { - Class class_ = (Class) el; - if (class_.getGeneralization(selectedConnType) != null) { - implGroupList.add((Class) el); - } - } - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ContainerDialog.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ContainerDialog.java deleted file mode 100644 index 32a4bc5881d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ContainerDialog.java +++ /dev/null @@ -1,309 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.jface.viewers.ArrayContentProvider; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.RuleApplication; -import org.eclipse.papyrus.infra.widgets.toolbox.utils.DialogUtils; -import org.eclipse.papyrus.qompass.designer.core.Description; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.SelectionStatusDialog; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Select container rules, either from a list of globally defined rules - * or from local rules which may be created "on the fly" by this dialog. - * - * TODO: extend rule application to instances (problematic, since rules transformation - * is done on type level) - * - */ -public class ContainerDialog extends SelectionStatusDialog { - - protected Class m_component; - - // protected EList visitedPackages; - protected Text fDescription; - - // protected FilteredList fRules; - protected CheckboxTableViewer fRules; - - // protected Combo fInterceptionKind; - - // protected Button fInterButton; - - // protected Label fPortLabel; - // protected Text fRuleName; - // protected Button fOptionButton; - - // protected Button fPortButton; - - protected ContainerRule m_currentRule; - - protected Package m_model; - - protected boolean m_rulePropertiesOnly; - - public ContainerDialog(Shell parent, Class componentOrRule) { - super(parent); - // visitedPackages = new BasicEList (); - m_rulePropertiesOnly = StereotypeUtil.isApplied(componentOrRule, ContainerRule.class); - if (m_rulePropertiesOnly) { - // m_currentRule = UMLUtil.getStereotypeApplication(componentOrRule, ContainerRule.class); - } else { - m_component = componentOrRule; - } - m_model = PackageUtil.getRootPackage(componentOrRule); - } - - /** - * @see SelectionStatusDialog#computeResult() - */ - @Override - protected void computeResult() { - // nothing to do - } - - @Override - public Control createDialogArea(Composite parent) { - Composite contents = (Composite) super.createDialogArea(parent); - // (parent, "Container rules", "Avail. extensions/interceptors"); - - if (m_rulePropertiesOnly) { - createRuleInfoGroup(contents); - selectRule(m_currentRule); - } else { - createRuleSelectionGroup(contents); - createRuleInfoGroup(contents); - } - return contents; - } - - protected void createRuleSelectionGroup(Composite parent) { - Composite ruleSelections = new Composite(parent, SWT.NONE); - GridLayout grid = new GridLayout(1, true); - GridData groupGridData = new GridData(); - // data3.widthHint = 400; - // data3.heightHint = 300; - groupGridData.grabExcessVerticalSpace = true; - groupGridData.grabExcessHorizontalSpace = true; - groupGridData.horizontalAlignment = GridData.FILL; - groupGridData.verticalAlignment = GridData.FILL; - ruleSelections.setLayout(grid); - ruleSelections.setLayoutData(groupGridData); - ruleSelections.setSize(400, 300); - - /* - * fRules = DialogUtils.createFilteredList (ruleSelGroup, new RuleLabelProvider(), 200, 200, - * SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); - */ - GridData data = new GridData(GridData.FILL_BOTH); - data.heightHint = 150; - data.widthHint = 200; - - ICheckStateListener checkListener = new ICheckStateListener() { - - @Override - public void checkStateChanged(CheckStateChangedEvent event) { - Object obj = event.getElement(); - if (obj instanceof ContainerRule) { - ContainerRule rule = (ContainerRule) obj; - if (event.getChecked()) { - applyRule(rule); - } - else { - unapplyRule(rule); - } - } - } - }; - - // - // --------------- global rules ------------------- - // - Group gRuleSelGroup = new Group(ruleSelections, SWT.BORDER); - gRuleSelGroup.setText(" available rules "); - // ruleGroup.setLayout(new RowLayout (SWT.VERTICAL)); - gRuleSelGroup.setLayout(new GridLayout(1, false)); - gRuleSelGroup.setLayoutData(groupGridData); - - EList globalRuleList = Utils.getAllRules(m_model); - // Table table = new Table(gRuleSelGroup, SWT.CHECK); - fRules = CheckboxTableViewer.newCheckList(gRuleSelGroup, SWT.BORDER); - // fRules = new CheckboxTableViewer(table); - - - GridData data2 = new GridData(GridData.FILL_BOTH); - data2.heightHint = 200; - // data.widthHint = 200; - fRules.getTable().setLayoutData(data); - fRules.setLabelProvider(new RuleLabelProvider()); - fRules.setContentProvider(new ArrayContentProvider()); - - fRules.setInput(globalRuleList.toArray()); - for (ContainerRule rule : globalRuleList) { - if (isRuleApplied(rule)) { - fRules.setChecked(rule, true); - } - } - fRules.addSelectionChangedListener(new ISelectionChangedListener() { - - @Override - public void selectionChanged(SelectionChangedEvent event) { - ISelection selection = fRules.getSelection(); - if (selection instanceof StructuredSelection) { - Object[] selected = ((StructuredSelection) selection).toArray(); - if ((selected.length == 1) && (selected[0] instanceof ContainerRule)) { - if (m_currentRule != selected[0]) { - selectRule((ContainerRule) selected[0]); - } - } - } - } - }); - fRules.addCheckStateListener(checkListener); - } - - protected void createRuleInfoGroup(Composite parent) { - GridData groupGridData = DialogUtils.createFillGridData(); - // data3.widthHint = 400; - // data3.heightHint = 300; - - Group ruleInfoGroup = new Group(parent, SWT.BORDER); - ruleInfoGroup.setText(" rule information "); - // ruleGroup.setLayout(new RowLayout (SWT.VERTICAL)); - ruleInfoGroup.setLayout(new GridLayout(2, false)); - ruleInfoGroup.setLayoutData(groupGridData); - - GridData span2 = new GridData(); - span2.horizontalSpan = 2; - span2.horizontalAlignment = GridData.FILL; - span2.grabExcessHorizontalSpace = true; - span2.grabExcessVerticalSpace = true; - span2.verticalAlignment = GridData.FILL; - span2.heightHint = 80; - - - fDescription = new Text(ruleInfoGroup, SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY); - fDescription.setLayoutData(span2); - // createMessageArea (ruleInfoGroup); - ruleInfoGroup.pack(); - // fPortLabel = new Label (ruleInfoGroup, SWT.NONE); - // fPortLabel.setText ("for Ports"); - // fPortLabel.setEnabled (false); - } - - /** - * Select a rule, i.e. update the visual representation from the rule - * - * @param rule - */ - protected void selectRule(ContainerRule rule) { - m_currentRule = rule; - fDescription.setText(Description.getDescription(rule.getBase_Class())); - } - - /** - * Helper: add a local container rule to the current class - * - * @param name - * the name of the local rule - * @return - */ - ContainerRule addRule(String name) { - Class ruleCl = (Class) - m_component.createNestedClassifier(name, UMLPackage.eINSTANCE.getClass_()); - StereotypeUtil.apply(ruleCl, ContainerRule.class); - return UMLUtil.getStereotypeApplication(ruleCl, ContainerRule.class); - } - - /** - * Helper function: delete a container rule from a class - * - * @param rule - */ - void deleteRule(ContainerRule rule) { - Classifier ruleCl = m_component.getNestedClassifier(rule.getBase_Class().getName()); - if (ruleCl instanceof Class) { - ruleCl.destroy(); - } - } - - /** - * Helper: apply a container rule to current component - * - * @param rule - */ - void applyRule(ContainerRule rule) { - if (!StereotypeUtil.isApplied(m_component, RuleApplication.class)) { - StereotypeUtil.apply(m_component, RuleApplication.class); - } - RuleApplication containerConfig = - UMLUtil.getStereotypeApplication(m_component, RuleApplication.class); - containerConfig.getContainerRule().add(rule); - } - - /** - * Helper: apply a container rule to current component - * - * @param rule - */ - void unapplyRule(ContainerRule rule) { - RuleApplication containerConfig = - UMLUtil.getStereotypeApplication(m_component, RuleApplication.class); - int index = containerConfig.getContainerRule().indexOf(rule); - if ((index >= 0) && (index < containerConfig.getContainerRule().size())) { - containerConfig.getContainerRule().remove(index); - } - } - - /** - * check whether a container rule is applied - * h * @param rule - * - * @return true, if container rule is applied - */ - boolean isRuleApplied(ContainerRule rule) { - RuleApplication containerConfig = - UMLUtil.getStereotypeApplication(m_component, RuleApplication.class); - if (containerConfig != null) { - return containerConfig.getContainerRule().contains(rule); - } - return false; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/GenerationOptionsDialog.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/GenerationOptionsDialog.java deleted file mode 100644 index fd6fc3d2116..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/GenerationOptionsDialog.java +++ /dev/null @@ -1,138 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import java.util.Arrays; - -import org.eclipse.papyrus.qompass.designer.core.generate.GenerationOptions; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.dialogs.SelectionStatusDialog; - -/** - * Select options for code generation. - * - * @author ansgar - */ -public class GenerationOptionsDialog extends SelectionStatusDialog implements GenerationOptions { - - protected Button fButtonModelOnly; - - protected Button fButtonRewriteSettings; - - protected Button fButtonOnlyChanged; - - protected Button fButtonCACOnly; - - public static int oldResultInt = 0; - - public GenerationOptionsDialog(Shell parent) { - super(parent); - } - - /** - * @see SelectionStatusDialog#computeResult() - */ - @Override - protected void computeResult() { - int resultInt = (isRewriteSettings() ? REWRITE_SETTINGS : 0) + - (isOnlyChanged() ? ONLY_CHANGED : 0) + - (isModelOnly() ? MODEL_ONLY : 0) + - (isCACOnly() ? CAC_ONLY : 0); - oldResultInt = resultInt; - Object[] result = new Object[] { - resultInt - }; - setResult(Arrays.asList(result)); - } - - @Override - public Control createDialogArea(Composite parent) { - Composite contents = (Composite) super.createDialogArea(parent); - // (parent, "Container rules", "Avail. extensions/interceptors"); - - fButtonCACOnly = new Button(contents, SWT.CHECK); - fButtonCACOnly.setText("Only perform container and connector expansion (intermediate model without code generation)"); - fButtonCACOnly.addSelectionListener(new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - updateButtonEnableStatus(); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - fButtonCACOnly.setSelection((oldResultInt & CAC_ONLY) != 0); - - fButtonModelOnly = new Button(contents, SWT.CHECK); - fButtonModelOnly.setText("Only generate model (not code)"); - fButtonModelOnly.addSelectionListener(new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - // only write types that have changed does not make sense, if the whole directory is cleaned - boolean modelOnly = fButtonModelOnly.getSelection(); - fButtonOnlyChanged.setEnabled(!modelOnly); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - fButtonModelOnly.setSelection((oldResultInt & MODEL_ONLY) != 0); - - fButtonRewriteSettings = new Button(contents, SWT.CHECK); - fButtonRewriteSettings.setText("Rewrite project settings, if project exists already (may overwrite user settings)"); - fButtonRewriteSettings.setSelection((oldResultInt & REWRITE_SETTINGS) != 0); - - fButtonOnlyChanged = new Button(contents, SWT.CHECK); - fButtonOnlyChanged.setText("Experimental: only write types that have changed (based on a difference model via EMF compare)"); - fButtonOnlyChanged.setSelection((oldResultInt & ONLY_CHANGED) != 0); - - updateButtonEnableStatus(); - return contents; - } - - protected void updateButtonEnableStatus() { - boolean onlyCAC = fButtonCACOnly.getSelection(); - boolean modelOnly = fButtonModelOnly.getSelection(); - fButtonModelOnly.setEnabled(!onlyCAC); - fButtonOnlyChanged.setEnabled(!modelOnly && !onlyCAC); - fButtonRewriteSettings.setEnabled(!onlyCAC); - } - - public boolean isRewriteSettings() { - return fButtonRewriteSettings.getSelection(); - } - - public boolean isOnlyChanged() { - return fButtonOnlyChanged.getSelection(); - } - - public boolean isModelOnly() { - return fButtonModelOnly.getSelection(); - } - - public boolean isCACOnly() { - return fButtonCACOnly.getSelection(); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InstanceLabelProvider.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InstanceLabelProvider.java deleted file mode 100644 index 72ed1a737f8..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InstanceLabelProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; - -public class InstanceLabelProvider extends LabelProvider { - - @Override - public String getText(Object element) { - if (element instanceof NamedElement) { - String instanceName = ((NamedElement) element).getName(); - Element owner = ((Element) element).getOwner(); - if (owner instanceof NamedElement) { - return "Plan " + ((NamedElement) owner).getName() + ": " + instanceName; - } - else { - return instanceName; - } - } - else { - return "not a named element"; - } - } -}; diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InteractiveImplementationChooser.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InteractiveImplementationChooser.java deleted file mode 100644 index bfdcf2d7040..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InteractiveImplementationChooser.java +++ /dev/null @@ -1,55 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.papyrus.qompass.designer.core.deployment.ImplementationChooser; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.NamedElement; - -public class InteractiveImplementationChooser implements ImplementationChooser { - - @Override - public Class chooseImplementation(Class componentType, EList implList) { - // SelectionDialog = SelectionDialog. - ILabelProvider ilabel = new LabelProvider() { - - @Override - public String getText(Object element) { - return ((NamedElement) element).getQualifiedName(); - } - }; - ElementListSelectionDialog dialog = - new ElementListSelectionDialog(Display.getDefault().getActiveShell(), ilabel); - - dialog.setTitle("Multiple implementations found"); - dialog.setMessage("Select an implementation for component type " + componentType.getName()); - - dialog.setElements(implList.toArray()); - - dialog.open(); - Object[] selection = dialog.getResult(); - if (selection.length == 1) { - if (selection[0] instanceof Class) { - return (Class) selection[0]; - } - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/NameLabelProvider.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/NameLabelProvider.java deleted file mode 100644 index fcf8a51c82c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/NameLabelProvider.java +++ /dev/null @@ -1,26 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.uml2.uml.NamedElement; - -public class NameLabelProvider extends LabelProvider { - - @Override - public String getText(Object element) { - return ((NamedElement) element).getName(); - } -}; diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/PortLabelProvider.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/PortLabelProvider.java deleted file mode 100644 index b94bcf1bfca..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/PortLabelProvider.java +++ /dev/null @@ -1,80 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.swt.graphics.Image; -import org.eclipse.uml2.uml.Port; - -/** - * A label provider for either UML or FCM ports - * - * @author ansgar - * - */ -public class PortLabelProvider extends LabelProvider implements ITableLabelProvider { - - /** - * small helper function: simply retrieval of port (element might be either a port or an FCM port) - * - * @param element - * @return - */ - private Port getUMLport(Object element) { - if (element instanceof org.eclipse.papyrus.FCM.Port) { - org.eclipse.papyrus.FCM.Port port = (org.eclipse.papyrus.FCM.Port) element; - if (port != null) { - return port.getBase_Port(); - } - } else if (element instanceof Port) { - return (Port) element; - } - return null; - } - - @Override - public String getText(Object element) { - Port umlPort = getUMLport(element); - if (umlPort != null) { - return umlPort.getName(); - } - return ""; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) - */ - @Override - public String getColumnText(Object element, int columnIndex) { - if (columnIndex == 0) { - return getText(element); - } else if (columnIndex == 1) { - Port umlPort = getUMLport(element); - if (umlPort != null) { - return umlPort.getType().getName(); - } - } - return ""; - } - - @Override - public Image getColumnImage(Object element, int columnIndex) { - // TODO Auto-generated method stub - return null; - } -}; diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/QNameLabelProvider.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/QNameLabelProvider.java deleted file mode 100644 index 0bc904fc210..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/QNameLabelProvider.java +++ /dev/null @@ -1,26 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.uml2.uml.NamedElement; - -public class QNameLabelProvider extends LabelProvider { - - @Override - public String getText(Object element) { - return ((NamedElement) element).getQualifiedName(); - } -}; diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/RuleLabelProvider.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/RuleLabelProvider.java deleted file mode 100644 index 853eaa092b7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/RuleLabelProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.dialogs; - -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.papyrus.FCM.ContainerRule; - -/** - * Return a label for ContainerRules. Since the name of the rule itself, is not - * really interesting for the user, the returned name is based on the interceptor - * (or extension) - * - * @author ansgar - * - */ -public class RuleLabelProvider extends LabelProvider { - - @Override - public String getText(Object element) { - if (element instanceof ContainerRule) { - ContainerRule rule = (ContainerRule) element; - // TODO? Add information about contained parts? - return rule.getBase_Class().getName(); - } - return null; - } -}; diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AddProfileAndModelLibsHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AddProfileAndModelLibsHandler.java deleted file mode 100644 index 588f0bc84de..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AddProfileAndModelLibsHandler.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ -package org.eclipse.papyrus.qompass.designer.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.viewers.ArrayContentProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.papyrus.qompass.designer.core.CommandSupport; -import org.eclipse.papyrus.qompass.designer.core.commands.AddMarteAndFcmProfile; -import org.eclipse.papyrus.qompass.designer.core.commands.AddQompassModelLibs; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.dialogs.ListSelectionDialog; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageImport; - -/** - * This class adds the FCM profile, parts of the MARTE profile and required package imports to your model. - */ -public class AddProfileAndModelLibsHandler extends CmdHandler { - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - if (selectedEObject instanceof Package) { - return true; - } - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - if (!(selectedEObject instanceof Package)) { - return null; - } - final Package selectedPkg = (Package) selectedEObject; - - final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(selectedPkg); - AddMarteAndFcmProfile addProfiles = new AddMarteAndFcmProfile(selectedPkg, - AddMarteAndFcmProfile.APPLY_FCM | AddMarteAndFcmProfile.APPLY_ALLOC | AddMarteAndFcmProfile.APPLY_HLAM_GCM, - domain); - AddQompassModelLibs addModelLibs = new AddQompassModelLibs(selectedPkg, domain); - - final ListSelectionDialog dialog = new ListSelectionDialog(Display.getDefault().getActiveShell(), - addModelLibs.getAvailableImportPackages().toArray(), - new ArrayContentProvider(), - new LabelProvider() { - - @Override - public String getText(Object pi) { - return ((PackageImport) pi).getImportedPackage().getName(); - } - }, - "Select Qompass model libraries for package import.\n" + //$NON-NLS-1$ - "Libraries that are already imported, are selected. Please note that additional\n" + //$NON-NLS-1$ - "Qompass model library might be loaded with the standard \"import registered library\" option\n" + //$NON-NLS-1$ - "\n" + //$NON-NLS-1$ - "Pressing \"Ok\" will continue with the application of the FCM profile and (parts of) the MARTE profile\n");//$NON-NLS-1$ - - dialog.setTitle("Select import library"); //$NON-NLS-1$ - dialog.setInitialElementSelections(addModelLibs.getAlreadyImportedPackages()); - // dialog.setElements (list.toArray ()); - int result = dialog.open(); - if (result == IDialogConstants.OK_ID) { - addModelLibs.setImportList(dialog.getResult()); - CommandSupport.exec(addModelLibs); - CommandSupport.exec(addProfiles); - // open dialog? - // MessageDialog.openWarning(Display.getDefault().getActiveShell(), - // "Warning", "The MARTE profile is not available."); //$NON-NLS-1$ //$NON-NLS-2$ - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AllocateHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AllocateHandler.java deleted file mode 100644 index dd517e153c9..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AllocateHandler.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.qompass.designer.core.CommandSupport; -import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.papyrus.qompass.designer.ui.dialogs.AllocationDialog; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.uml2.uml.Package; - -/** - * Implementation class for ClassAction action - */ -public class AllocateHandler extends CmdHandler { - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - if (selectedEObject instanceof Package) { - return (StereotypeUtil.isApplied((Package) selectedEObject, DeploymentPlan.class)); - } - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public Object execute(ExecutionEvent event) - throws ExecutionException { - if (!(selectedEObject instanceof Package)) { - return null; - } - - final Package cdp = (Package) selectedEObject; - final Shell shell = Display.getDefault().getActiveShell(); - - // org.eclipse.papyrus.qompass.designer.vsl.ParseVSL.test(); - if (DepUtils.getMainInstance(cdp) == null) { - MessageDialog.openInformation(shell, "Error", - "Deployment plan has no main instance (check stereotype attribute mainInstance)"); - return null; - } - - // 1. select possible connectors according to port types - // (only show compatible connectors check-box?) - // 2. select implementation group according to connector type - - // container dialog: either extension, rule or interceptor - // howto select? which? (and howto add/remove?) - Std - dialog is good? - CommandSupport.exec("Instance allocation", event, new RunnableWithResult() { - - @Override - public CommandResult run() { - AllocationDialog allocDialog = - new AllocationDialog(shell, cdp); - allocDialog.setTitle("Allocate instances"); - allocDialog.open(); - if (allocDialog.getReturnCode() == IDialogConstants.OK_ID) { - return CommandResult.newOKCommandResult(); - } - else { - return CommandResult.newCancelledCommandResult(); - } - } - }); - - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigureInstanceHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigureInstanceHandler.java deleted file mode 100644 index 969ecd1d367..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigureInstanceHandler.java +++ /dev/null @@ -1,129 +0,0 @@ -/******************************************************************************* - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.papyrus.qompass.designer.core.CommandSupport; -import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult; -import org.eclipse.papyrus.qompass.designer.ui.dialogs.ConfigureInstanceDialog; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.Feature; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Property; - -/** - * Implementation class for ClassAction action - */ -public class ConfigureInstanceHandler extends CmdHandler { - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - if ((selectedEObject instanceof Class) || - (selectedEObject instanceof Connector) || - (selectedEObject instanceof Property) || - (selectedEObject instanceof InstanceSpecification)) { - return true; - } - return false; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - if (!(selectedEObject instanceof NamedElement)) { - return null; - } - - final NamedElement element = (NamedElement) selectedEObject; - final Shell shell = Display.getDefault().getActiveShell(); - final ExecutionEvent from = event; - - // 1. select possible connectors according to port types - // (only show compatible connectors check-box?) - // 2. select implementation group according to connector type - - if (element instanceof Class) { - // container dialog: either extension, rule or interceptor - // how-to select? which? (and how-to add/remove?) - is standard dialog sufficient? - CommandSupport.exec("Configure associated component instance", event, new RunnableWithResult() { //$NON-NLS-1$ - - @Override - public CommandResult run() { - ConfigureInstanceDialog configureInstanceDialog = - new ConfigureInstanceDialog(shell); - if (configureInstanceDialog.init((Class) element, from)) { - configureInstanceDialog.setTitle("Configure instance"); //$NON-NLS-1$ - configureInstanceDialog.setMessage("Configure instance for component " + element.getName()); //$NON-NLS-1$ - configureInstanceDialog.open(); - if (configureInstanceDialog.getReturnCode() == IDialogConstants.OK_ID) { - return CommandResult.newOKCommandResult(); - } - } - return CommandResult.newCancelledCommandResult(); - } - }); - } else if (element instanceof Feature) { - CommandSupport.exec("Configure associated instance", event, new RunnableWithResult() { //$NON-NLS-1$ - - @Override - public CommandResult run() { - ConfigureInstanceDialog configureInstanceDialog = - new ConfigureInstanceDialog(shell); - if (configureInstanceDialog.init((Feature) element, from)) { - configureInstanceDialog.setTitle("Configure instance"); //$NON-NLS-1$ - configureInstanceDialog.setMessage("Configure instance for property/connector " + element.getName()); //$NON-NLS-1$ - configureInstanceDialog.open(); - if (configureInstanceDialog.getReturnCode() == IDialogConstants.OK_ID) { - return CommandResult.newOKCommandResult(); - } - } - return CommandResult.newCancelledCommandResult(); - } - }); - - - } else if (element instanceof InstanceSpecification) { - - CommandSupport.exec("Configure instance", event, new RunnableWithResult() { //$NON-NLS-1$ - - @Override - public CommandResult run() { - ConfigureInstanceDialog configureInstanceDialog = - new ConfigureInstanceDialog(shell); - if (configureInstanceDialog.init((InstanceSpecification) element, from)) { - configureInstanceDialog.setMessage("Configure instance " + element.getName()); //$NON-NLS-1$ - configureInstanceDialog.open(); - if (configureInstanceDialog.getReturnCode() == IDialogConstants.OK_ID) { - return CommandResult.newOKCommandResult(); - } - } - return CommandResult.newCancelledCommandResult(); - } - }); - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java deleted file mode 100644 index 3dcbc83e054..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java +++ /dev/null @@ -1,102 +0,0 @@ -/******************************************************************************* - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.papyrus.qompass.designer.core.CommandSupport; -import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult; -import org.eclipse.papyrus.qompass.designer.ui.Messages; -import org.eclipse.papyrus.qompass.designer.ui.dialogs.ConfigurePortDialog; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Port; - -/** - * Implementation class for ClassAction action - */ -public class ConfigurePortHandler extends CmdHandler { - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - if ((selectedEObject instanceof Class) || - (selectedEObject instanceof Port)) { - return true; - } - return false; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - if (!(selectedEObject instanceof NamedElement)) { - return null; - } - - final NamedElement element = (NamedElement) selectedEObject; - final Shell shell = Display.getDefault().getActiveShell(); - - // 1. select possible connectors according to port types - // (only show compatible connectors check-box?) - // 2. select implementation group according to connector type - - if (element instanceof Class) { - CommandSupport.exec(Messages.ConfigurePortHandler_ConfigurePorts, event, new RunnableWithResult() { - - @Override - public CommandResult run() { - ConfigurePortDialog configurePortDialog = - new ConfigurePortDialog(shell); - if (configurePortDialog.init((Class) element)) { - configurePortDialog.setTitle(Messages.ConfigurePortHandler_ConfigurePorts); - configurePortDialog.setMessage(Messages.ConfigurePortHandler_ConfigurePortsOfComponent + " " + element.getName()); //$NON-NLS-1$ - configurePortDialog.open(); - if (configurePortDialog.getReturnCode() == IDialogConstants.OK_ID) { - return CommandResult.newOKCommandResult(); - } - } - return CommandResult.newCancelledCommandResult(); - } - }); - } else if (element instanceof Port) { - CommandSupport.exec(Messages.ConfigurePortHandler_ConfigurePorts, event, new RunnableWithResult() { - - @Override - public CommandResult run() { - ConfigurePortDialog configurePortDialog = - new ConfigurePortDialog(shell); - if (configurePortDialog.init((Port) element)) { - configurePortDialog.setTitle(Messages.ConfigurePortHandler_ConfigurePorts); - configurePortDialog.setMessage(Messages.ConfigurePortHandler_ConfigurePorts + " " + element.getName()); //$NON-NLS-1$ - configurePortDialog.open(); - if (configurePortDialog.getReturnCode() == IDialogConstants.OK_ID) { - return CommandResult.newOKCommandResult(); - } - } - return CommandResult.newCancelledCommandResult(); - } - }); - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreateDepPlanHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreateDepPlanHandler.java deleted file mode 100644 index 6ff9c26c533..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreateDepPlanHandler.java +++ /dev/null @@ -1,144 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.papyrus.qompass.designer.core.CommandSupport; -import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DeployConstants; -import org.eclipse.papyrus.qompass.designer.core.sync.DepPlanSync; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.qompass.designer.ui.Messages; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Stereotype; - -public class CreateDepPlanHandler extends CmdHandler { - - private Package depPlans; - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - if ((selectedEObject instanceof Class) && Utils.isCompImpl((Class) selectedEObject)) { - return true; - } - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - if (!(selectedEObject instanceof Class)) { - return null; - } - final Class selectedComposite = (Class) selectedEObject; - - CommandSupport.exec(Messages.CreateDepPlanHandler_CreateDPs, event, new Runnable() { - - @Override - public void run() { - // execute with transaction support - depPlans = DepPlanUtils.getDepPlanRoot(selectedComposite); - } - }); - - try { - String name = selectedComposite.getName() + DeployConstants.DepPlanPostfix; - if (depPlans.getMember(name) != null) { - Shell shell = Display.getDefault().getActiveShell(); - String dialogButtonLabels[] = new String[] { - Messages.CreateDepPlanHandler_Cancel, - Messages.CreateDepPlanHandler_Sync, - Messages.CreateDepPlanHandler_CreateNew - }; - MessageDialog dialog = new MessageDialog(shell, Messages.CreateDepPlanHandler_WhatShouldIDo, null, - String.format(Messages.CreateDepPlanHandler_DPwithNameExistsAlready, name), - MessageDialog.QUESTION, dialogButtonLabels, 0); - int result = dialog.open(); - if (result == 0) { - return null; - } - else if (result == 1) { - NamedElement existing = depPlans.getMember(name); - if (existing instanceof Package) { - DepPlanSync.syncDepPlan((Package) existing); - } - else { - MessageDialog.openError(shell, Messages.CreateDepPlanHandler_CannotSync, - String.format(Messages.CreateDepPlanHandler_DPwithNameExistsNoPackage, name)); - } - } - else { - for (int i = 2;; i++) { - name = selectedComposite.getName() + DeployConstants.DepPlanPostfix + i; - if (depPlans.getMember(name) == null) { - break; - } - } - - } - } - final String depPlanName = name; - - CommandSupport.exec(Messages.CreateDepPlanHandler_CreateDP, event, new RunnableWithResult() { - - @Override - public CommandResult run() { - Package cdp = depPlans.createNestedPackage(depPlanName); - Stereotype st = StereotypeUtil.apply(cdp, org.eclipse.papyrus.FCM.DeploymentPlan.class); - if (st == null) { - MessageDialog.openInformation(Display.getDefault().getActiveShell(), - Messages.CreateDepPlanHandler_CannotCreateDP, - Messages.CreateDepPlanHandler_StereoApplicationFailed); - return CommandResult.newErrorCommandResult(Messages.CreateDepPlanHandler_CannotCreateDP); - } - try { - InstanceSpecification newRootIS = - DepCreation.createDepPlan(cdp, selectedComposite, DeployConstants.MAIN_INSTANCE, true); - DepCreation.initAutoValues(newRootIS); - return CommandResult.newOKCommandResult(); - } - catch (TransformationException e) { - MessageDialog.openInformation(Display.getDefault().getActiveShell(), Messages.CreateDepPlanHandler_CannotCreateDP, - e.getMessage()); - return CommandResult.newErrorCommandResult(e.getMessage()); - } - } - }); - - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreatePlatformHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreatePlatformHandler.java deleted file mode 100644 index 22dc6281a47..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreatePlatformHandler.java +++ /dev/null @@ -1,94 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.papyrus.qompass.designer.core.CommandSupport; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; -import org.eclipse.papyrus.qompass.designer.core.deployment.DeployConstants; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationRTException; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Package; - -public class CreatePlatformHandler extends CmdHandler { - - private Package platform; - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - if (selectedEObject instanceof Class) { - return true; - } - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - if (!(selectedEObject instanceof Class)) { - return null; - } - final Class selectedComposite = (Class) selectedEObject; - - CommandSupport.exec("Create platform model", event, new Runnable() { //$NON-NLS-1$ - - @Override - public void run() { - // execute with transaction support - platform = Utils.getRoot(selectedComposite, DeployConstants.depPlanFolderHw); - } - }); - - final String newPlatform = selectedComposite.getName() + DeployConstants.DepPlanPostfixHw; - - try { - if (platform.getMember(newPlatform) != null) { - Shell shell = Display.getDefault().getActiveShell(); - MessageDialog.openInformation(shell, "Error", //$NON-NLS-1$ - "Platform definition \"" + newPlatform + "\" exists already"); //$NON-NLS-1$ //$NON-NLS-2$ - } else { - CommandSupport.exec("Create platform definition", event, new Runnable() { //$NON-NLS-1$ - - @Override - public void run() { - Package platformPkg = platform.createNestedPackage(newPlatform); - try { - DepCreation.createPlatformInstances(platformPkg, selectedComposite, null); - } - catch (TransformationException e) { - throw new TransformationRTException(e.getMessage()); - } - } - }); - } - } catch (Exception e) { - e.printStackTrace(); - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenCollaborationUseHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenCollaborationUseHandler.java deleted file mode 100644 index 614bc5b139e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenCollaborationUseHandler.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.FCM.Connector; -import org.eclipse.papyrus.FCM.util.FCMUtil; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * TODO: for testing, currently unused - */ -@Deprecated -public class GenCollaborationUseHandler extends CmdHandler { - - /** - * {@inheritDoc} - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - return null; - } - - /** - * /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - public void run(IAction action) { - updateSelectedEObject(); - - org.eclipse.uml2.uml.Connector selectedConnector = (org.eclipse.uml2.uml.Connector) selectedEObject; - Connector fcmConn = UMLUtil.getStereotypeApplication(selectedConnector, Connector.class); - FCMUtil.generateCollaborationUse(fcmConn); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenConnectionPatternHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenConnectionPatternHandler.java deleted file mode 100644 index 5b56d15f739..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenConnectionPatternHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jface.action.IAction; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.FCM.util.FCMUtil; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.ui.IViewPart; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * TODO: for testing, currently unused - */ -@Deprecated -public class GenConnectionPatternHandler extends CmdHandler { - - /** - * {@inheritDoc} - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - return null; - } - - /** - * (non-Javadoc) - * - * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) - */ - public void init(IViewPart view) { - } - - /** - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - public void run(IAction action) { - // only one model is selected - Class selectedClass = (Class) selectedEObject; - Log.log(IStatus.INFO, Log.DIALOGS, "GenConnectionPattern.run: " + selectedClass.getName()); - InteractionComponent connType = UMLUtil.getStereotypeApplication(selectedClass, InteractionComponent.class); - FCMUtil.generateDefaultConnectionPattern(connType); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/InstantiateDepPlanHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/InstantiateDepPlanHandler.java deleted file mode 100644 index 0c16e370d42..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/InstantiateDepPlanHandler.java +++ /dev/null @@ -1,97 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.papyrus.FCM.Configuration; -import org.eclipse.papyrus.qompass.designer.core.ProjectManagement; -import org.eclipse.papyrus.qompass.designer.core.transformations.InstantiateDepPlan; -import org.eclipse.papyrus.qompass.designer.ui.dialogs.GenerationOptionsDialog; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * handler for instantiating a deployment plan - */ -public class InstantiateDepPlanHandler extends CmdHandler { - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - if ((selectedEObject instanceof Package) || (selectedEObject instanceof Class)) { - return true; - } - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - // only one model is selected - selectedCDP = null; - if ((selectedEObject instanceof Package) || (selectedEObject instanceof Class)) { - selectedCDP = (NamedElement) selectedEObject; - } else { - return null; - } - project = ProjectManagement.getCurrentProject(); - - GenerationOptionsDialog optionsDialog = new GenerationOptionsDialog(Display.getDefault().getActiveShell()); - optionsDialog.open(); - if (optionsDialog.getReturnCode() == IDialogConstants.OK_ID) { - - final int genOptions = (Integer) optionsDialog.getResult()[0]; - Job job = new Job("Create deployment model (OO)") { - - @Override - protected IStatus run(IProgressMonitor monitor) { - // execute the task ... - if (selectedCDP instanceof Package) { - new InstantiateDepPlan().instantiate((Package) selectedCDP, monitor, project, genOptions); - } else if (StereotypeUtil.isApplied(selectedCDP, Configuration.class)) { - Configuration configuration = UMLUtil.getStereotypeApplication(selectedCDP, Configuration.class); - new InstantiateDepPlan().instantiate(configuration, monitor, project, genOptions); - } - return Status.OK_STATUS; - } - }; - job.setUser(true); - job.schedule(); - } - - return null; - } - - private NamedElement selectedCDP; - - private IProject project; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectConnectorHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectConnectorHandler.java deleted file mode 100644 index 0dc3eb1607f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectConnectorHandler.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.qompass.designer.core.CommandSupport; -import org.eclipse.papyrus.qompass.designer.ui.dialogs.ConnectorSelectionDialog; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.Feature; -import org.eclipse.uml2.uml.Model; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Implementation class for ClassAction action - */ -public class SelectConnectorHandler extends CmdHandler { - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - if ((selectedEObject instanceof Connector) || (selectedEObject instanceof Property)) { - return true; - } - return false; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - // feature is a common superclass of Connector and Property - if (!(selectedEObject instanceof Feature)) { - return null; - } - // get selected connector - final Feature selectedFeature = (Feature) selectedEObject; - Shell shell = Display.getDefault().getActiveShell(); - - // 1. select possible connectors according to port types - // (only show compatible connectors check-box?) - // 2. select implementation group according to connector type - - Model model = selectedFeature.getModel(); - - ConnectorSelectionDialog elementSelector = - new ConnectorSelectionDialog(shell, model, selectedFeature); - elementSelector.setTitle("Select connector"); - elementSelector.setMessage("Select an implementation for connector " + selectedFeature.getName()); - elementSelector.open(); - if (elementSelector.getReturnCode() == IDialogConstants.OK_ID) { - final Object[] result = elementSelector.getResult(); - if ((result.length == 1) && (result[0] instanceof Class)) { - CommandSupport.exec("Select connector", event, new Runnable() { - - @Override - public void run() { - org.eclipse.papyrus.FCM.Connector fcmSelectedConnector = StereotypeUtil.applyApp(selectedFeature, org.eclipse.papyrus.FCM.Connector.class); - InteractionComponent newConnType = UMLUtil.getStereotypeApplication((Class) result[0], InteractionComponent.class); - fcmSelectedConnector.setIc(newConnType); - } - }); - } - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectContainerHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectContainerHandler.java deleted file mode 100644 index dd7771eea86..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectContainerHandler.java +++ /dev/null @@ -1,120 +0,0 @@ -/******************************************************************************* - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.papyrus.qompass.designer.core.CommandSupport; -import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult; -import org.eclipse.papyrus.qompass.designer.ui.dialogs.ContainerDialog; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; - -/** - * Call the dialogs for selecting a container rule - */ -public class SelectContainerHandler extends CmdHandler { - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - if ((selectedEObject instanceof Class) || - (selectedEObject instanceof InstanceSpecification)) { - return true; - } - if (selectedEObject instanceof Property) { - Type type = ((Property) selectedEObject).getType(); - if (type instanceof Class) { - return true; - } - } - return false; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - if (!(selectedEObject instanceof NamedElement)) { - return null; - } - - NamedElement ne = (NamedElement) selectedEObject; - final Shell shell = Display.getDefault().getActiveShell(); - - if (ne instanceof Property) { - // treat property as the associated type - Type type = ((Property) ne).getType(); - if (type instanceof Class) { - ne = type; - } - } - final NamedElement element = ne; - - // 1. select possible connectors according to port types - // (only show compatible connectors check-box?) - // 2. select implementation group according to connector type - - if (element instanceof Class) { - // container dialog: either extension, rule or interceptor - // howto select? which? (and howto add/remove?) - Std - dialog is good? - CommandSupport.exec("Select container", event, new RunnableWithResult() { - - @Override - public CommandResult run() { - ContainerDialog elementSelector = - new ContainerDialog(shell, (Class) element); - elementSelector.setTitle("Select container rules for component " + element.getName()); - elementSelector.open(); - if (elementSelector.getReturnCode() == IDialogConstants.OK_ID) { - return CommandResult.newOKCommandResult(); - } - else { - return CommandResult.newCancelledCommandResult(); - } - } - }); - } else if (element instanceof InstanceSpecification) { - /* - * ConnectorSelectionDialog elementSelector = - * new ConnectorSelectionDialog (shell, model, (InstanceSpecification) element); - * elementSelector.setTitle("Select connector"); - * elementSelector.setMessage("Select an implementation for connector " + selectedConnector.getName ()); - * elementSelector.open(); - * if (elementSelector.getReturnCode () == IDialogConstants.OK_ID) { - * final Object[] result = elementSelector.getResult (); - * if ((result.length == 2) && (result[0] instanceof Class) && (result[1] instanceof Class)) { - * CommandSupport.exec ("Select connector", new Runnable () { - * public void run () { - * Object newConnType = StereotypeUtil.getApplication ((Class) result[0], ConnectorType.class); - * Object newConnImpl = StereotypeUtil.getApplication ((Class) result[1], ConnectorImpl.class); - * } - * }); - * } - * } - */ - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SyncHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SyncHandler.java deleted file mode 100644 index 93708d5888e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SyncHandler.java +++ /dev/null @@ -1,147 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.qompass.designer.core.CommandSupport; -import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.sync.CompImplSync; -import org.eclipse.papyrus.qompass.designer.core.sync.DepPlanSync; -import org.eclipse.papyrus.qompass.designer.core.sync.InterfaceSync; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationRTException; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Property; - -/** - * Handler for synchronizing derived elements. Will do different - * things, depending on the currently selected object. - */ -public class SyncHandler extends CmdHandler { - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - // if a property is selected, use the associated type - if (selectedEObject instanceof Property) { - selectedEObject = ((Property) selectedEObject).getType(); - } - - if (selectedEObject instanceof Interface) { - return true; - } - if (selectedEObject instanceof Class) { - if (Utils.isComponent((Class) selectedEObject)) { - return true; - } - } - else if (selectedEObject instanceof Package) { - if (StereotypeUtil.isApplied((Package) selectedEObject, DeploymentPlan.class)) { - return true; - } - } - return false; - } - - /** - * {@inheritDoc} - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - // if a property is selected, use the associated type - if (selectedEObject instanceof Property) { - selectedEObject = ((Property) selectedEObject).getType(); - } - - if (selectedEObject instanceof Interface) { - final Interface selectedIntf = (Interface) selectedEObject; - CommandSupport.exec("Synchronize interface", event, new Runnable() { - - @Override - public void run() { - InterfaceSync.syncSignalReceptionSupport(selectedIntf); - } - }); - } - - else if (selectedEObject instanceof Class) { - final Class selectedClass = (Class) selectedEObject; - if (Utils.isCompImpl(selectedClass)) { - CommandSupport.exec("Synchronize component via implementation", event, new RunnableWithResult() { - - @Override - public CommandResult run() { - CompImplSync.updatePorts(selectedClass); - try { - CompImplSync.syncRealizations(selectedClass); - } - catch (TransformationRTException e) { - MessageDialog.openWarning(Display.getDefault().getActiveShell(), "Problems during synchronization", e.getMessage()); - return CommandResult.newErrorCommandResult(e.getMessage()); - } - - // CompImplSync.syncContextOps (selectedClass, true); - CompImplSync.interfaceModifications(selectedClass, null); - return CommandResult.newOKCommandResult(); - } - }); - } else if (Utils.isCompType(selectedClass)) { - CommandSupport.exec("Synchronize component via type", event, new Runnable() { - - @Override - public void run() { - if (!CompImplSync.syncViaType(selectedClass, false)) { - MessageDialog.openWarning(Display.getDefault().getActiveShell(), "Warning: ineffective command", - "Synchronization applied on a component type (abstract class) will synchronize all implementations, i.e. non-abstract classes inheriting from it. However, the selected type has no implementations"); - } - // CompImplSync.syncContextOps (selectedClass, true); - } - }); - } - } - else if (selectedEObject instanceof Package) { - final Package selectedPkg = (Package) selectedEObject; - CommandSupport.exec("Synchronize deployment plan", event, new RunnableWithResult() { - - @Override - public CommandResult run() { - try { - DepPlanSync.syncDepPlan(selectedPkg); - return CommandResult.newOKCommandResult(); - } - catch (TransformationRTException e) { - Shell shell = Display.getDefault().getActiveShell(); - MessageDialog.openError(shell, "Can not synchronize deployment plan", e.getMessage()); - return CommandResult.newErrorCommandResult(e.getMessage()); - } - } - }); - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/TrafoAndCodegenHandler.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/TrafoAndCodegenHandler.java deleted file mode 100644 index f129bdaa807..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/TrafoAndCodegenHandler.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.ui.handlers; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.papyrus.qompass.designer.core.ProjectManagement; -import org.eclipse.papyrus.qompass.designer.core.transformations.TrafoAndCodegenPackage; -import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; -import org.eclipse.uml2.uml.Package; - -public class TrafoAndCodegenHandler extends CmdHandler { - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - updateSelectedEObject(); - return (selectedEObject instanceof Package); - } - - /** - * {@inheritDoc} - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - // only one model is selected - selectedPkg = null; - if (selectedEObject instanceof Package) { - selectedPkg = (Package) selectedEObject; - } else { - return null; - } - project = ProjectManagement.getCurrentProject(); - - Job job = new Job("Execute transformations and generate code") { - - @Override - protected IStatus run(IProgressMonitor monitor) { - // execute the task ... - TrafoAndCodegenPackage.instantiate(selectedPkg, monitor, project); - monitor.done(); - return Status.OK_STATUS; - } - }; - job.setUser(true); - job.schedule(); - - return null; - } - - protected Package selectedPkg; - - protected IProject project; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/messages.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/messages.properties deleted file mode 100644 index 40a457cfc83..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/messages.properties +++ /dev/null @@ -1,27 +0,0 @@ -ConfigurePortHandler_ConfigurePorts=Configure ports -ConfigurePortHandler_ConfigurePortsOfComponent=Configure ports of component -ConfigurePortHandler_ConfigureInstance=Configure instance - -ConfigurePortDialog_AvailPorts=Available Ports -ConfigurePortDialog_PortConfig=Port configuration -ConfigurePortDialog_NotAvail=not available -ConfigurePortDialog_Kind=Kind -ConfigurePortDialog_None=none -ConfigurePortDialog_Type=Type -ConfigurePortDialog_ChangeType=change type -ConfigurePortDialog_IntfDerived=Interfaces derived from kind and type -ConfigurePortDialog_Provided=Provided -ConfigurePortDialog_Required=Required -ConfigurePortDialog_Undef=undefined - -CreateDepPlanHandler_CreateDPs=Create deployment plans -CreateDepPlanHandler_Sync=Synchronize -CreateDepPlanHandler_CreateNew=create new (auto number name) -CreateDepPlanHandler_WhatShouldIDo=What should I do? -CreateDepPlanHandler_DPwithNameExistsAlready=Deployment plan with name %s exists already. You can always synchronize an existing deployment plan via the context menu "Synchronize derived elements" -CreateDepPlanHandler_DPwithNameExistsNoPackage=Element with name %s exists, but is not a package -CreateDepPlanHandler_CannotSync=Cannot synchronize -CreateDepPlanHandler_Cancel=Cancel -CreateDepPlanHandler_CreateDP=Create deployment plan -CreateDepPlanHandler_CannotCreateDP=Cannot create deployment plan -CreateDepPlanHandler_StereoApplicationFailed=Application of stereotype "FCM::DeploymentPlan" failed. Check, if FCM profile is applied diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferenceInitializer.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferenceInitializer.java deleted file mode 100644 index f28c634a309..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferenceInitializer.java +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.qompass.designer.ui.preferences; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.qompass.designer.core.preferences.QompassPreferenceConstants; - -/** - * Class used to initialize default preference values. - */ -public class QompassPreferenceInitializer extends AbstractPreferenceInitializer { - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() - */ - @Override - public void initializeDefaultPreferences() { - IPreferenceStore store = org.eclipse.papyrus.qompass.designer.core.Activator.getDefault().getPreferenceStore(); - store.setDefault(QompassPreferenceConstants.P_SHOW_PROV_REQ_AS_PORT_ICONS, false); - store.setDefault(QompassPreferenceConstants.P_ALL_ATTRIBUTES_ARE_CONFIG_ATTRIBUTES, false); - store.setDefault(QompassPreferenceConstants.P_TREAT_NONE_AS_COMPOSITE, false); - store.setDefault(QompassPreferenceConstants.P_CODE_GEN_PREFIX, "// generated with Qompass toolchain"); - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferencePage.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferencePage.java deleted file mode 100644 index c5552e6020b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferencePage.java +++ /dev/null @@ -1,76 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.qompass.designer.ui.preferences; - -import org.eclipse.jface.preference.BooleanFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.StringFieldEditor; -import org.eclipse.papyrus.qompass.designer.core.Activator; -import org.eclipse.papyrus.qompass.designer.core.preferences.QompassPreferenceConstants; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -/** - * This class represents the EC3M preference page - *

    - * This page is used to modify preferences only. They are stored in the preference store that belongs to the main plug-in class. That way, preferences can be accessed directly via the preference store. - */ - -public class QompassPreferencePage - extends FieldEditorPreferencePage - implements IWorkbenchPreferencePage { - - public QompassPreferencePage() { - super(GRID); - setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription("Qompass options"); - } - - /** - * Creates the field editors. Field editors are abstractions of - * the common GUI blocks needed to manipulate various types - * of preferences. Each field editor knows how to save and - * restore itself. - */ - @Override - public void createFieldEditors() { - addField(new BooleanFieldEditor( - QompassPreferenceConstants.P_SHOW_PROV_REQ_AS_PORT_ICONS, - "&Show icons associated with derived provided/required interfaces instead of kind", - getFieldEditorParent())); - - addField(new BooleanFieldEditor( - QompassPreferenceConstants.P_TREAT_NONE_AS_COMPOSITE, - "Treat aggregation kind \"&None\" as \"Composite\"", - getFieldEditorParent())); - - addField(new BooleanFieldEditor( - QompassPreferenceConstants.P_ALL_ATTRIBUTES_ARE_CONFIG_ATTRIBUTES, - "Treat all attributes as configuration attributes (if false, only attributes of abstract classes and attributes explicitly tagged as FCM::ConfigurationProperty will be considered as configuration attribute", - getFieldEditorParent())); - - addField(new StringFieldEditor( - QompassPreferenceConstants.P_CODE_GEN_PREFIX, - "Code generation prefix: ", getFieldEditorParent())); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ - @Override - public void init(IWorkbench workbench) { - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/.classpath b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/.classpath deleted file mode 100644 index ad32c83a788..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/.project b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/.project deleted file mode 100644 index 896877fb61f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.qompass.designer.validation - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/META-INF/MANIFEST.MF deleted file mode 100644 index d110843ec77..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.uml2.uml;bundle-version="3.0.1", - org.eclipse.emf.validation;bundle-version="1.3.0", - org.eclipse.papyrus.qompass.designer.core;bundle-version="1.2.0", - org.eclipse.papyrus.fcm.profile;bundle-version="1.2.0", - org.eclipse.ui, - org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.qompass.designer.validation.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.validation;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/about.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

    About This Content

    - -

    November 14, 2008

    -

    License

    - -

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

    - -

    If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

    - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/build.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/build.properties deleted file mode 100644 index 1d9f30169a4..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/build.properties +++ /dev/null @@ -1,11 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - .classpath,\ - .project,\ - about.html,\ - icons/,\ - plugin.properties -src.includes = about.html diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/icons/validate.gif b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/icons/validate.gif deleted file mode 100644 index 6efaebec95b..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/icons/validate.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/plugin.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/plugin.properties deleted file mode 100644 index 348b2b9b363..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus extra: Qompass designer validation rules (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/plugin.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/plugin.xml deleted file mode 100644 index 96f6b43d98c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/plugin.xml +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - - - - - - - - - - "Qompass: {0}" - - - The system component (main instance within deployment plan) may not have ports. - - - - - - - "Qompass: {0}" - - - Is there a slot for all properties of a component within an instance specification? - - - - - - - "Qompass: {0}" - - - Verify that a connection does not originate from a caller with to a server with the server multiplicity > 1 - - - - - - - "Qompass: {0}" - - - Verify that at exactly one blocking start routine is defined. - - - - - - - "Qompass: {0}" - - - Check whether a provided port is not connected. Typically, this is not problematic. Therefore, the rule is disabled by default. - - - - - - - "Qompass: {0}" - - - Check whether a required port is not connected. This would result in an error, if the component owning the port tries to invoke a service through that port. - - - - - - - "Qompass: {0}" - - - Operation is not implemented - - - - - - - "Qompass: {0}" - - - Port is not correctly typed - - - - - - - "Qompass: {0}" - - - Behavior without specification - - - - - - - "Qompass: {0}" - - - Verify that a connector can be instantiated, i.e. a consistent connector binding can be found. - - - - - - - "Qompass: {0}" - - - Check whether aggregation kind is consistent with singleton information - - - - - - - "Qompass: {0}" - - - Check whether configuration attributes have a value in the deployment plans - - - - - - - "Qompass: {0}" - - - Check whether an operation contains more than one return parameter - - - - - - - "Qompass: {0}" - - - Check whether a template parameter is referenced out of scope - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/pom.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/pom.xml deleted file mode 100644 index ddc663180e8..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.qompass.designer.validation - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/Activator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/Activator.java deleted file mode 100644 index 00051315823..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/Activator.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.validation; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.validation"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/ValidationDelegateClientSelector.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/ValidationDelegateClientSelector.java deleted file mode 100644 index 2bea425443b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/ValidationDelegateClientSelector.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.validation; - -import org.eclipse.emf.validation.model.IClientSelector; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.PackageImport; - -public class ValidationDelegateClientSelector implements IClientSelector { - - /** - * Queries whether to select the specified object, which indicates that it - * belongs to this client context. - * - * @param object - * a model element of some kind - * @return true if the object matches my client - * context; false, otherwise - */ - @Override - public boolean selects(Object object) { - if (object instanceof PackageImport) { - // return false; - } - return (object instanceof Element); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/AggregationKindValid.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/AggregationKindValid.java deleted file mode 100644 index 60364005ae4..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/AggregationKindValid.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008-2010 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.papyrus.FCM.ConfigurationProperty; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.AggregationKind; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; - -/** - * Verify that aggregation kinds are used well. General rule: - * attributes of a components should have aggregation kind "composite" unless - * (1) the are singletons (implementation property), i.e. there is exactly one instance. - * - * (2) they are *shared*. In this case an enclosing component has to define a property of same type - * and name (open if "same name" restriction is kept, since it implies an implicit relationship - * that would break after name changes. But it allows for having multiple shared properties of same type) - * [it does not make a difference, whether "aggregation" or "none" is used as aggregation kind] - * Alternative? give user a fine control in the instantiation model? Fractal: no need for a single - * composed property? - * - * Rule has been made specific to Qompass, since we verify that configurationProperty is applicable (implying that the - * FCM profile is applied) - * - * @author ansgar - * - */ -public class AggregationKindValid extends AbstractModelConstraint { - - @Override - public IStatus validate(IValidationContext ctx) - { - Property attribute = (Property) ctx.getTarget(); - Type type = attribute.getType(); - if (type instanceof Class) { - AggregationKind aggKind = attribute.getAggregation(); - if (aggKind != AggregationKind.COMPOSITE_LITERAL) { - if (StereotypeUtil.isApplicable(attribute, ConfigurationProperty.class) && !Utils.isSingleton((Class) type)) { - // no composition, but not singleton: warn user to make up a proper deployment plan - // validation has been made Qompass specific by checking whether the Configuration attribute is applicable - - // first check, if the attribute is referenced by an instance specification (via - // the defining feature attribute). Otherwise, do not continue, since the warnings might lead to false - // alerts - return ctx.createFailureStatus("The attribute '" + attribute.getName() + "' has a non-composition aggregation kind, but the referenced type ('" + - type.getName() + "') is not a singleton. The associated instance specifications have to be set-up manually"); - } - } - } - return ctx.createSuccessStatus(); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/BehaviorsWithoutSpecification.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/BehaviorsWithoutSpecification.java deleted file mode 100644 index 87d2b7457f6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/BehaviorsWithoutSpecification.java +++ /dev/null @@ -1,65 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.OpaqueBehavior; - -/** - * Check whether all behaviors have a specification. This happens for instance, if the user - * deletes a specification and "forgets" to delete the associated behavior. - * - * @author ansgar - * - */ -public class BehaviorsWithoutSpecification extends AbstractModelConstraint { - - @Override - public IStatus validate(IValidationContext ctx) { - - OpaqueBehavior behavior = (OpaqueBehavior) ctx.getTarget(); - - if (behavior.getSpecification() == null) { - Element class_ = behavior.getOwner(); - if (StereotypeUtil.isApplicable(class_, DerivedElement.class)) { - // check whether DerivedElement is applicable => indirect check whether FCM is applied (make rule specific to Qompass) - // TODO alternative? check whether behavior is referenced from either an activity, since that is possible in general? - /* - * boolean hasRef = false; - * for (Setting setting : UML2Util.getNonNavigableInverseReferences(behavior)) { - * if (setting.getEObject() ... - * hasRefFromIS = true; - * break; - * } - * } - */ - if (class_ instanceof NamedElement) { - return ctx.createFailureStatus("The behavior '" + behavior.getName() + "' of '" + - ((NamedElement) class_).getQualifiedName() + "' has no specification"); - } - else { - return ctx.createFailureStatus("The behavior '" + behavior.getName() + "' has no specification"); - } - } - } - return ctx.createSuccessStatus(); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConfigurationAttributeNotSet.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConfigurationAttributeNotSet.java deleted file mode 100644 index 87c6f1cb141..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConfigurationAttributeNotSet.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008-2010 CEA LIST. - * All rights reserved. This program and the accompanying materials - * are property of the CEA, their use is subject to specific agreement - * with the CEA. - * - * Contributors: - * CEA LIST - initial API and implementation - *******************************************************************************/ -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.papyrus.FCM.ConfigurationProperty; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Slot; -import org.eclipse.uml2.uml.StructuralFeature; - -/** - * Verify if all configuration attribute have a (user-provided) value. - * - * @author ansgar - * - * TODO: implementation assumes that at least the slot exists - */ -public class ConfigurationAttributeNotSet extends AbstractModelConstraint { - - @Override - public IStatus validate(IValidationContext ctx) - { - Slot slot = (Slot) ctx.getTarget(); - StructuralFeature feature = slot.getDefiningFeature(); - if ((feature != null) && (StereotypeUtil.isApplied(feature, ConfigurationProperty.class))) { - if (slot.getValues().size() == 0) { - return ctx.createFailureStatus("The attribute '" + feature.getName() + "' is tagged as a configuration property, but the associated slot has no value."); - } - } - return ctx.createSuccessStatus(); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorCallMultiplicity.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorCallMultiplicity.java deleted file mode 100644 index 104f433063d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorCallMultiplicity.java +++ /dev/null @@ -1,82 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; - -/** - * Check whether the multiplicity of the ports (of a part) are consistent with the defined connectors, in particular whether a - * port with a required interface is not connected with more connectors than its own multiplicity - * - * @author ansgar - * - * TODO: does not find violation on composite side (partWithPort = null), simplify? (loop over connectors) - */ -public class ConnectorCallMultiplicity extends AbstractModelConstraint -{ - @Override - public IStatus validate(IValidationContext ctx) - { - String portsStr = ""; //$NON-NLS-1$ - - Property part = (Property) ctx.getTarget(); - if (!StereotypeUtil.isApplicable(part, DerivedElement.class)) { - // make rule Qompass specific: only perform check, if the FCM profile is applied (checked via applicability - // the DerviedElement stereotype) - return ctx.createSuccessStatus(); - } - Class owner = part.getClass_(); - if (owner != null) { - if (part.getType() instanceof Class) { - Class class_ = (Class) part.getType(); - for (Port port : class_.getOwnedPorts()) { - if (port.getRequireds().size() > 0) { - int connections = 0; - for (Connector connector : owner.getOwnedConnectors()) { - if (ConnectorUtil.connectsPort(connector, port)) { - connections++; - break; - } - } - if (connections > port.getUpper()) { - if (portsStr.length() != 0) { - portsStr += ", "; //$NON-NLS-1$ - } - portsStr += port.getName(); - } - } - } - } - } - if (portsStr.length() > 0) { - return ctx.createFailureStatus(String.format( - "The port(s) %s with a required interface of part %s have more connections than their multiplicty within composite %s", - portsStr, part.getName(), owner.getQualifiedName())); - - } - else { - return ctx.createSuccessStatus(); - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorConnectable.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorConnectable.java deleted file mode 100644 index 922347bee07..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorConnectable.java +++ /dev/null @@ -1,56 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.papyrus.FCM.InteractionComponent; -import org.eclipse.papyrus.qompass.designer.core.templates.ConnectorBinding; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Check whether a connector is connectable, i.e. whether the ports of application parts match with those - * of the connector types that are chosen. - * - * @author ansgar - * - */ -public class ConnectorConnectable extends AbstractModelConstraint -{ - - @Override - public IStatus validate(IValidationContext ctx) - { - Connector connector = (Connector) ctx.getTarget(); - Class class_ = (Class) connector.getOwner(); - - org.eclipse.papyrus.FCM.Connector fcmConnector = UMLUtil.getStereotypeApplication(connector, org.eclipse.papyrus.FCM.Connector.class); - if (fcmConnector != null) { - InteractionComponent connectorComp = fcmConnector.getIc(); - if (connectorComp != null) { - try { - ConnectorBinding.obtainBinding(class_, connector, connectorComp.getBase_Class(), false); - } catch (TransformationException e) { - return ctx.createFailureStatus("The connector '" + connector.getName() + "' within composite '" + class_.getName() + "' cannot be instantiated: " + e.getMessage()); - } - } - } - return ctx.createSuccessStatus(); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/DuplicateOperation.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/DuplicateOperation.java deleted file mode 100644 index 5989e9ce81f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/DuplicateOperation.java +++ /dev/null @@ -1,27 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -/** - * Check whether two operations have the same name *and* have indistinguishable parameter lists - * - * While UML demands that all members of a name-space have a unique name, this is more strict than - * the requirements of programming languages. Many OO languages allow for identical operation names - * if the operation can be uniquely identified via the type and number of parameters. - * - */ -public class DuplicateOperation { - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ExecutorIsNotUsedAsPartName.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ExecutorIsNotUsedAsPartName.java deleted file mode 100644 index a9fe37c6179..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ExecutorIsNotUsedAsPartName.java +++ /dev/null @@ -1,48 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.papyrus.FCM.RuleApplication; -import org.eclipse.papyrus.qompass.designer.core.transformations.container.ContainerTrafo; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Property; - -/** - * Check whether an attribute used the name that is reserved for executors within a container - * - * - */ -public class ExecutorIsNotUsedAsPartName extends AbstractModelConstraint -{ - @Override - public IStatus validate(IValidationContext ctx) { - - Class class_ = (Class) ctx.getTarget(); - - if (StereotypeUtil.isApplied(class_, RuleApplication.class)) { - // limit check to classes applying a container rule. - for (Property attribute : class_.getOwnedAttributes()) { - if (attribute.getName().equals(ContainerTrafo.executorPartName)) { - return ctx.createFailureStatus("A property may not use the reserved name \"_executor\""); - } - } - } - return ctx.createSuccessStatus(); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InitialEntryPoints.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InitialEntryPoints.java deleted file mode 100644 index ab3bca9e717..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InitialEntryPoints.java +++ /dev/null @@ -1,79 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.qompass.designer.core.deployment.BootLoaderGen; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Verify that at exactly one blocking start routine is defined. - * - * @author ansgar - * - */ -public class InitialEntryPoints extends AbstractModelConstraint { - - @Override - public IStatus validate(IValidationContext ctx) - { - Package pkg = (Package) ctx.getTarget(); - - DeploymentPlan cdp = UMLUtil.getStereotypeApplication(pkg, DeploymentPlan.class); - if (cdp != null) { - InstanceSpecification initIS = cdp.getMainInstance(); - if (initIS != null) { - entryPoints = new BasicEList(); - validate(initIS); - if (entryPoints.size() > 1) { - String msg = ""; //$NON-NLS-1$ - for (String entryPoint : entryPoints) { - if (msg.length() > 0) { - msg += ", "; //$NON-NLS-1$ - } - msg += entryPoint; - } - return ctx.createFailureStatus(String.format("The deployment plan '%s' contains more than one start entry point: %s", pkg.getName(), msg)); //$NON-NLS-1$ - } - } - } - return ctx.createSuccessStatus(); - } - - public void validate(InstanceSpecification is) { - Classifier cl = DepUtils.getClassifier(is); - if (cl instanceof Class) { - Class implementation = (Class) cl; - if (BootLoaderGen.hasUnconnectedStartRoutine(null, implementation, null)) { - entryPoints.add(implementation.getName()); - } - } - for (InstanceSpecification subIS : DepUtils.getContainedInstances(is)) { - validate(subIS); - } - } - - private EList entryPoints; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InstanceSpecificationSlotForAllProperties.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InstanceSpecificationSlotForAllProperties.java deleted file mode 100644 index a3552545253..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InstanceSpecificationSlotForAllProperties.java +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.papyrus.FCM.ConfigurationProperty; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Slot; - -/** - * check whether an instance specification for a classifier defines slots for - * each configuration attribute. This rule is specific to Qompass, since only - * attributes with the ConfigurationProperty stereotypes are checked. - */ -public class InstanceSpecificationSlotForAllProperties extends AbstractModelConstraint { - - @Override - public IStatus validate(IValidationContext ctx) - { - InstanceSpecification is = (InstanceSpecification) ctx.getTarget(); - - if (is.getClassifiers().size() > 0) { - Classifier cl = is.getClassifiers().get(0); - if (cl instanceof Class) { - Class class_ = (Class) cl; - - for (Property attribute : class_.getOwnedAttributes()) { - boolean foundAttribute = false; - if (StereotypeUtil.isApplied(attribute, ConfigurationProperty.class)) { - for (Slot slot : is.getSlots()) { - if (slot.getDefiningFeature() == attribute) { - foundAttribute = true; - break; - } - } - if (foundAttribute == false) { - return ctx.createFailureStatus("The instance specification '" + is.getName() + "' has no slot for property '" + attribute.getName() + "'"); - } - } - } - } - } - return ctx.createSuccessStatus(); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsAreImplemented.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsAreImplemented.java deleted file mode 100644 index 5c14d09c256..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsAreImplemented.java +++ /dev/null @@ -1,47 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Operation; - -/** - * Check whether a non abstract operation has an implementation. - * Whereas this rule would make sense in general, it has been made specific to - * Qompass by verifying whether FCM is applied (check if DerivedElement stereotype - * is applicable) - */ -public class OperationsAreImplemented extends AbstractModelConstraint -{ - @Override - public IStatus validate(IValidationContext ctx) { - - Operation operation = (Operation) ctx.getTarget(); - if (operation.getNamespace() instanceof Interface) { - // operations within an interface are always abstract - return ctx.createSuccessStatus(); - } - if ((!operation.isAbstract() && operation.getMethods().size() == 0) && StereotypeUtil.isApplicable(operation, DerivedElement.class)) { - return ctx.createFailureStatus("The operation '" + operation.getName() + - " has no implementation (and is not marked as abstract)"); - } - return ctx.createSuccessStatus(); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsWithTwoReturnValues.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsWithTwoReturnValues.java deleted file mode 100644 index a08f010803c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsWithTwoReturnValues.java +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.ParameterDirectionKind; - -/** - * Verify that an operation has at most one return parameter - * - * Whereas this rule would make sense in general, it has been made specific to - * Qompass by verifying whether FCM is applied (check if DerivedElement stereotype - * is applicable) - */ -public class OperationsWithTwoReturnValues extends AbstractModelConstraint -{ - @Override - public IStatus validate(IValidationContext ctx) - { - Operation operation = (Operation) ctx.getTarget(); - boolean firstReturn = true; - for (Parameter parameter : operation.getOwnedParameters()) { - if (parameter.getDirection() == ParameterDirectionKind.RETURN_LITERAL) { - if (firstReturn) { - firstReturn = false; - } - else { - if (StereotypeUtil.isApplicable(operation, DerivedElement.class)) { - return ctx.createFailureStatus("The operation '" + operation.getName() + "' has more than one return parameter. It must have at most one"); - } - else { - break; - } - } - } - } - return ctx.createSuccessStatus(); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortIsCorrectlyTyped.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortIsCorrectlyTyped.java deleted file mode 100644 index 345678cc7df..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortIsCorrectlyTyped.java +++ /dev/null @@ -1,45 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Port; - -/** - * Check whether the port is not correctly typed, e.g. the port kind ProvideInterface is used in - * conjunction with a data type. - * Technically, the criterion will be that not both, derived provided and derived required interfaces - * are empty. - * - */ -public class PortIsCorrectlyTyped extends AbstractModelConstraint { - - @Override - public IStatus validate(IValidationContext ctx) - { - Port port = (Port) ctx.getTarget(); - - if ((port.getProvideds().size() == 0) && (port.getRequireds().size() == 0)) { - Class class_ = port.getClass_(); - return ctx.createFailureStatus("The port '" + port.getName() + "' owned by class '" + class_.getQualifiedName() + //$NON-NLS-1$ //$NON-NLS-2$ - "' is not correctly typed, since derived provided and required interface is null"); //$NON-NLS-1$ - } - return ctx.createSuccessStatus(); - - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortKindUnset.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortKindUnset.java deleted file mode 100644 index 3aefcba3cd7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortKindUnset.java +++ /dev/null @@ -1,43 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Check whether the attribute port-kind of the FCM stereotype port is set - * - */ -public class PortKindUnset extends AbstractModelConstraint { - - @Override - public IStatus validate(IValidationContext ctx) - { - Port port = (Port) ctx.getTarget(); - org.eclipse.papyrus.FCM.Port fcmPort = UMLUtil.getStereotypeApplication(port, org.eclipse.papyrus.FCM.Port.class); - if (fcmPort != null) { - - if (fcmPort.getKind() == null) { - return ctx.createFailureStatus("The stereotype attribute 'portKind' of port '" + port.getName() + "' is unset"); - } - } - return ctx.createSuccessStatus(); - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/SystemHasNoPorts.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/SystemHasNoPorts.java deleted file mode 100644 index dd2bcc2a892..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/SystemHasNoPorts.java +++ /dev/null @@ -1,51 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.papyrus.FCM.DeploymentPlan; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Check whether the specific system class. This class can be identified, since it is the - * classifier of the "main-instance" referenced by a deployment plan. - * - */ -public class SystemHasNoPorts extends AbstractModelConstraint { - - @Override - public IStatus validate(IValidationContext ctx) - { - Package pkg = (Package) ctx.getTarget(); - - DeploymentPlan cdp = UMLUtil.getStereotypeApplication(pkg, DeploymentPlan.class); - - if (cdp != null) { - InstanceSpecification mi = cdp.getMainInstance(); - Class class_ = (Class) DepUtils.getClassifier(mi); - - if (class_.getOwnedPorts().size() > 0) { - return ctx.createFailureStatus("The main instance (class '" + class_.getName() + "') of deployment plan '" + pkg.getName() + "' owns ports. It should not, since these ports remain unconnected."); - } - } - return ctx.createSuccessStatus(); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/TemplateRefWithoutBinding.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/TemplateRefWithoutBinding.java deleted file mode 100644 index 77fd10d61e6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/TemplateRefWithoutBinding.java +++ /dev/null @@ -1,81 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.papyrus.FCM.DerivedElement; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.TypedElement; - -/** - * Check whether an element within a package template is referenced via a type from the outside, i.e. an element that is not - * within this package template. This reference is only valid in the context of a template binding. - * (within Qompass, binding is done implicitly via stereotypes - which was perhaps not the best way of doing it) - * - * The rule has been made specific to Qompass by checking whether FCM is applied (check DerivedElement stereotype). - * - */ -public class TemplateRefWithoutBinding extends AbstractModelConstraint { - - @Override - public IStatus validate(IValidationContext ctx) - { - TypedElement te = (TypedElement) ctx.getTarget(); - Type type = te.getType(); - if (type != null) { - Element owner = type.getNearestPackage(); - while (owner != null) { - if (owner instanceof Package) { - Package pkg = (Package) owner; - if (TemplateUtils.getSignatureDirect(pkg) != null) { - if (StereotypeUtil.isApplicable(pkg, DerivedElement.class) && !isWithin(pkg, te)) { - // the type of an element is defined within a package template (pkg), but the typed element (te) itself - // is defined outside of this package - return ctx.createFailureStatus("This element is typed with '" + type.getQualifiedName() + "', but defined outside the package template '" + //$NON-NLS-1$ //$NON-NLS-2$ - pkg.getQualifiedName() + "'"); //$NON-NLS-1$ - } - } - } - owner = owner.getOwner(); - } - } - - return ctx.createSuccessStatus(); - } - - /** - * @param pkg - * A UML package - * @param e - * an element that is eventually part of the package - * @return if passed element is part of the given package - */ - public boolean isWithin(Package pkg, Element e) { - Element owner = e; - while (owner != null) { - owner = owner.getOwner(); - if (owner == pkg) { - return true; - } - } - return false; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedPorts.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedPorts.java deleted file mode 100644 index 34a4672aa66..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedPorts.java +++ /dev/null @@ -1,95 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Connector; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; - -/** - * Check whether a port of a part remains without connection. Whereas it is typically problematic - * for ports with a required interface, we also raise an info for those with a provided interface - * - */ -abstract public class UnconnectedPorts extends AbstractModelConstraint -{ - /** - * Called by one of the sub-classes (does not override a superclass method) - * - * @param ctx - * the validation context - * @param required - * if true, examine required ports, if false provided ports - * @return - */ - public IStatus validatePorts(IValidationContext ctx, boolean required) - { - String portsStr = ""; //$NON-NLS-1$ - - Property attribute = (Property) ctx.getTarget(); - Class owner = attribute.getClass_(); - if (owner != null) { - if (attribute.getType() instanceof Class) { - Class class_ = (Class) attribute.getType(); - for (Port port : class_.getOwnedPorts()) { - if ((port.getRequireds().size() > 0 && required) || - (port.getProvideds().size() > 0 && !required)) { - { - boolean found = false; - for (Connector connector : owner.getOwnedConnectors()) { - if (ConnectorUtil.connectsPort(connector, port)) { - found = true; - break; - } - } - if (!found) { - if (portsStr.length() != 0) { - portsStr += ", "; //$NON-NLS-1$ - } - portsStr += port.getName(); - } - } - } - } - } - } - if (portsStr.length() > 0) { - return ctx.createFailureStatus("The port(s) '" + portsStr + "' of part '" + attribute.getName() + "' remains unconnected within composite class '" + owner.getQualifiedName() + "'"); - - } - else { - return ctx.createSuccessStatus(); - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedProvPorts.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedProvPorts.java deleted file mode 100644 index 81bf5bc64b6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedProvPorts.java +++ /dev/null @@ -1,27 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.IValidationContext; - - -public class UnconnectedProvPorts extends UnconnectedPorts { - - @Override - public IStatus validate(IValidationContext ctx) { - return super.validatePorts(ctx, false); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedReqPorts.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedReqPorts.java deleted file mode 100644 index d24a9f3f9f2..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedReqPorts.java +++ /dev/null @@ -1,27 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.designer.validation.constraints; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.validation.IValidationContext; - - -public class UnconnectedReqPorts extends UnconnectedPorts { - - @Override - public IStatus validate(IValidationContext ctx) { - return super.validatePorts(ctx, true); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/.classpath b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/.classpath deleted file mode 100644 index 098194ca4b7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/.project b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/.project deleted file mode 100644 index 65bf34f1f4e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/.project +++ /dev/null @@ -1,35 +0,0 @@ - - - org.eclipse.papyrus.qompass.designer.vsl - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.acceleo.ide.ui.acceleoBuilder - - - - - - org.eclipse.acceleo.ide.ui.acceleoNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f42de363afa..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/META-INF/MANIFEST.MF deleted file mode 100644 index 7f958871f83..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/META-INF/MANIFEST.MF +++ /dev/null @@ -1,16 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.qompass.designer.vsl -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.papyrus.marte.vsl;bundle-version="1.2.0", - org.eclipse.xtext;bundle-version="2.4.0", - org.eclipse.papyrus.marte.static.profile;bundle-version="1.2.0" -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.qompass.designer.vsl.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.vsl -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/about.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

    About This Content

    - -

    November 14, 2008

    -

    License

    - -

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

    - -

    If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

    - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/build.acceleo b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/build.acceleo deleted file mode 100644 index fb14dcfe540..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/build.acceleo +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/build.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/build.properties deleted file mode 100644 index 2db90a70738..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/build.properties +++ /dev/null @@ -1,10 +0,0 @@ -# -#Sun Dec 02 23:00:20 CET 2012 -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties -output..=bin/ -source..=src/ -customBuildCallbacks=build.acceleo -src.includes = about.html diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/plugin.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/plugin.properties deleted file mode 100644 index e8db6a299e0..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus extra: Qompass designer VSL support (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/pom.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/pom.xml deleted file mode 100644 index 91c022883c7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.qompass.designer.vsl - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Activator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Activator.java deleted file mode 100644 index d69dc572821..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Activator.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.vsl; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.vsl"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Messages.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Messages.java deleted file mode 100644 index 548e47b0be1..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Messages.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.vsl; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.papyrus.qompass.designer.vsl.messages"; //$NON-NLS-1$ - public static String ParseVSL_ErrorInExp_SIZE; - public static String ParseVSL_ErrorInExp_TIME; - public static String ParseVSL_ErrotInExp_FREQ; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.emtl b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.emtl deleted file mode 100644 index 7e3a06641ae..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.emtl +++ /dev/null @@ -1,432 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.java deleted file mode 100644 index a4e1c54e504..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.java +++ /dev/null @@ -1,185 +0,0 @@ -package org.eclipse.papyrus.qompass.designer.vsl; - -import java.util.Collections; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.papyrus.MARTE.utils.MarteUtils; -import org.eclipse.papyrus.MARTE_Library.MeasurementUnits.DataSizeUnitKind; -import org.eclipse.papyrus.MARTE_Library.MeasurementUnits.FrequencyUnitKind; -import org.eclipse.papyrus.MARTE_Library.MeasurementUnits.TimeUnitKind; -import org.eclipse.papyrus.marte.vsl.VSLStandaloneSetupGenerated; -import org.eclipse.xtext.IGrammarAccess; -import org.eclipse.xtext.resource.IResourceFactory; -import org.eclipse.xtext.resource.XtextResource; -import org.eclipse.xtext.util.StringInputStream; - -import com.google.inject.Injector; - - -public class ParseVSL { - - private static final String UNIT = "unit"; //$NON-NLS-1$ - - private static final String VALUE = "value"; //$NON-NLS-1$ - - private Injector injector; - - private static final String SYNTHETIC_SCHEME = "synthetic"; //$NON-NLS-1$ - - - /** - * Parse a VSL expression and return an xtext resource. Users should check for parsing - * errors (getErrors). The resulting set of eObjects is available via the getContents - * operations (as usual). - * - * @param expression - * a VSL expression - * @return a resource relating to the expression. - */ - public XtextResource getXtextResource(String expression) { - if (injector == null) { - VSLStandaloneSetupGenerated setup = new VSLStandaloneSetupGenerated(); - injector = setup.createInjectorAndDoEMFRegistration(); - } - ; - IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); - IGrammarAccess grammarAccess = injector.getInstance(IGrammarAccess.class); - - XtextResource xtextResource = (XtextResource) resourceFactory.createResource( - URI.createURI(SYNTHETIC_SCHEME + ":/" + grammarAccess.getGrammar().getName() + ".vsl")); //$NON-NLS-1$ //$NON-NLS-2$ - - try { - xtextResource.load(new StringInputStream(expression, xtextResource.getEncoding()), Collections.emptyMap()); - } catch (Exception e) { - throw new RuntimeException(e); - } - return xtextResource; - } - - /** - * test function (currently unused) - * - * @param expression - * a VSL expression - */ - public static void parseTest(String expression) { - /* - * ParseVSL parseVSL = new ParseVSL(); - * XtextResource xtextResource = parseVSL.getXtextResource(expression); - * if(xtextResource.getErrors().size() > 0) { - * for(Resource.Diagnostic error : xtextResource.getErrors()) { - * System.err.println(error); - * } - * return; - * } - * EList contents = xtextResource.getContents(); - * System.out.println("contents.size: " + contents.size()); - */ - } - - public static int getSizeFromVSL(String nfpDatasize) { - if (nfpDatasize != null) { - String unit = MarteUtils.getValueFromTuple(nfpDatasize, UNIT); - String value = MarteUtils.getValueFromTuple(nfpDatasize, VALUE); - return Float.valueOf(value).intValue() * getMultiplicatorFromSizeUnit(unit); - } - return 0; - } - - // >>> TODO: from here: ad-hoc functions to retrieve values via simple parser - - /** - * Get the duration in micro-seconds - * - * - * @param nfpDuration - * @return - */ - public static long getDurationFromVSL(String nfpDuration) { - if (nfpDuration != null) { - String unit = MarteUtils.getValueFromTuple(nfpDuration, UNIT); - String value = MarteUtils.getValueFromTuple(nfpDuration, VALUE); - return Float.valueOf(value).intValue() * getMultiplicatorFromTimeUnit(unit); - } - return 0; - } - - /** - * Get the frequency in HZ - * - * @param - * @return - */ - public static long getFrequencyFromVSL(String nfpFrequency) { - if (nfpFrequency != null) { - String unit = MarteUtils.getValueFromTuple(nfpFrequency, UNIT); - String value = MarteUtils.getValueFromTuple(nfpFrequency, VALUE); - return (int) (Float.valueOf(value) * getMultiplicatorFromFrequencyUnit(unit)); - } - return 0; - } - - public static long getPeriodFromArrivalPattern(String arrivalPattern) { - if (arrivalPattern != null) { - String period = MarteUtils.getValueFromTuple(arrivalPattern, "period"); //$NON-NLS-1$ - return getDurationFromVSL(period); - } - return 0; - } - - public static int getMultiplicatorFromSizeUnit(String unit) { - DataSizeUnitKind dsuk = DataSizeUnitKind.get(unit); - if (dsuk == DataSizeUnitKind.BYTE) { - return 1; - } else if (dsuk == DataSizeUnitKind.KB) { - return 1024; - } else if (dsuk == DataSizeUnitKind.MB) { - return 1024 * 1024; - } else if (dsuk == DataSizeUnitKind.GB) { - return 1024 * 1024 * 1024; - } else { - // do not support bits here. - throw new RuntimeException(String.format(Messages.ParseVSL_ErrorInExp_SIZE, unit)); - } - } - - /** - * return the time multiplicator based on micro-seconds unit - * - * @param unit - * @return - */ - public static long getMultiplicatorFromTimeUnit(String unit) { - TimeUnitKind tuk = TimeUnitKind.get(unit); - if (tuk == TimeUnitKind.US) { - return 1; - } - if (tuk == TimeUnitKind.MS) { - return 1000; - } else if (tuk == TimeUnitKind.S) { - return 1000 * 1000; - } else if (tuk == TimeUnitKind.MIN) { - return 60 * 1000 * 1000; - } else { - throw new RuntimeException(String.format(Messages.ParseVSL_ErrorInExp_TIME, unit)); - } - } - - public static float getMultiplicatorFromFrequencyUnit(String unit) { - FrequencyUnitKind fuk = FrequencyUnitKind.get(unit); - if (fuk == FrequencyUnitKind.HZ) { - return 1; - } else if (fuk == FrequencyUnitKind.KHZ) { - return 1000; - } else if (fuk == FrequencyUnitKind.MHZ) { - return 1000 * 1000; - } else if (fuk == FrequencyUnitKind.GHZ) { - return 1000 * 1000 * 1000; - } else if (fuk == FrequencyUnitKind.RPM) { - return 1 / 60; - } else { - // do not support bits here. - throw new RuntimeException(String.format(Messages.ParseVSL_ErrotInExp_FREQ, unit)); - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.mtl b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.mtl deleted file mode 100644 index 9713fa32611..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.mtl +++ /dev/null @@ -1,23 +0,0 @@ -[module ParseVSL('http://www.eclipse.org/uml2/5.0.0/UML')/] - -[comment Copyright (c) 2012 CEA List./] - -[query public getSizeFromVSL(nfpDatasize : String) : Integer = - invoke('org.eclipse.papyrus.qompass.designer.vsl.ParseVSL', - 'getSizeFromVSL(java.lang.String)', - Sequence{nfpDatasize}) /] - -[query public getDurationFromVSL(nfpDuration : String) : Integer = - invoke('org.eclipse.papyrus.qompass.designer.vsl.ParseVSL', - 'getDurationFromVSL(java.lang.String)', - Sequence{nfpDuration}) /] - -[query public implementsInterface2(operation : Operation) : Interface = - invoke('org.eclipse.papyrus.qompass.designer.core.acceleo.UMLTool', - 'implementsInterface(org.eclipse.uml2.uml.Operation)', - Sequence{operation}) /] - -[query public implementsInterface3(str : String) : Interface = - invoke('org.eclipse.papyrus.qompass.designer.core.acceleo.UMLTool', - 'implementsInterface(org.eclipse.uml2.uml.Operation)', - Sequence{str}) /] diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/messages.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/messages.properties deleted file mode 100644 index 115d3394041..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/messages.properties +++ /dev/null @@ -1,3 +0,0 @@ -ParseVSL_ErrorInExp_SIZE=Error parsing VSL expression, unexpected size unit (expecting byte, kb, mb, or gb): '%s' -ParseVSL_ErrorInExp_TIME=Error parsing VSL expression, unexpected duration unit (expecting us, ms, s or min): '%s' -ParseVSL_ErrotInExp_FREQ=Error parsing VSL expression, unexpected frequency unit (expecting Hz, KHz, MHz, GHz or rpm: '%s' diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.classpath b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.classpath deleted file mode 100644 index 358df1bc1d1..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.gitignore b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.gitignore deleted file mode 100644 index 5500bf75774..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tmpModel diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.project b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.project deleted file mode 100644 index 748b00bc5a7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.project +++ /dev/null @@ -1,40 +0,0 @@ - - - org.eclipse.papyrus.qompass.modellibs.core - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.acceleo.ide.ui.acceleoBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.acceleo.ide.ui.acceleoNature - org.eclipse.jdt.core.javanature - org.eclipse.xtext.ui.shared.xtextNature - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index c537b63063c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/ExtendedPort.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/ExtendedPort.java deleted file mode 100644 index 7227b1bdcc7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/ExtendedPort.java +++ /dev/null @@ -1,127 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; - -import org.eclipse.papyrus.FCM.util.IMappingRule; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.papyrus.qompass.designer.core.OperationUtils; -import org.eclipse.papyrus.qompass.designer.core.PortUtils; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Type; - - -/** - * An extended Port in the sense of the DDS4CCM standard: a port typed with a component - * type. Since the component typing the port can have multiple provided and required - * ports, the ports are implicitly owned by the port. Conjugation on the level of an extended - * port level will conjugate all ports of the component typing the port. - * - * The derived interface that is provided will concatenate provided port names within the - * extended port with the port name and provided a "big" interface. - * The derived interface that is required is identical, except for a conjugation on the - * extended port level. - * - * Creates a fixed template binding that binds T (of the extended Port) to the used data type - * - * Here, the idea is that the port type is a classifier, e.g. the data type that is - * transported by a DDS port. The port kind is the extended port, e.g. DDSWrite. - * - * The derived property isExtended of FCM port-kind is true, if the class representing the port-kind owns at least one - * port - * - * @author ansgar - * - */ -public class ExtendedPort implements IMappingRule { - - public Interface getProvided(org.eclipse.papyrus.FCM.Port p, InstanceSpecification config, boolean update) - { - return getDerived(p, false, config, update); - } - - public Interface getRequired(org.eclipse.papyrus.FCM.Port p, InstanceSpecification config, boolean update) - { - return getDerived(p, true, config, update); - } - - public Interface getDerived(org.eclipse.papyrus.FCM.Port extPort, boolean isRequired, InstanceSpecification config, boolean update) - { - Type type = extPort.getBase_Port().getType(); - if(!(type instanceof Classifier)) { - return null; - } - Class extendedPort = extPort.getKind().getBase_Class(); - - String prefix = extendedPort.getName() + "_" + (isRequired ? "R_" : "P_"); - Interface derivedInterface = MapUtil.getOrCreateDerivedInterfaceFP(extPort, prefix, type, update); - if (!update) { - return derivedInterface; - } - if(derivedInterface == null) { - return null; - } - /* - TemplateSignature signature = TemplateUtils.getSignature(type.getNearestPackage()); - if(signature != null) { - Package model = Utils.getTop(derivedInterface); - try { - TemplateBinding binding = - TemplateUtils.fixedBinding(model, extendedPort, (Classifier)type); - Copy copy = new Copy(model, model, false); - TemplateInstantiation ti = new TemplateInstantiation(copy, binding); - // create a bound element of the extended port. Add bound class to derived interface class - Class boundClass = ti.bindNamedElement(extendedPort); - derivedInterface.getNearestPackage().getPackagedElements().add(boundClass); - } catch (TransformationException e) { - return null; - } - } - */ - // obtain first template parameter = port type - // kind.getBase_Class().getNearestPackage().getTemplateParameter(); - - for(Port port : extendedPort.getOwnedPorts()) { - Interface derivedIntf = (isRequired) ? - PortUtils.getRequired(port) : - PortUtils.getProvided(port); - - if(derivedIntf != null) { - for(Operation op : derivedIntf.getAllOperations()) { - String name = port.getName() + "_" + op.getName(); //$NON-NLS-1$ - - // check whether operation already exists. Create, if not - Operation derivedOperation = derivedInterface.getOperation(name, null, null); - if(derivedOperation == null) { - derivedOperation = derivedInterface.createOwnedOperation(name, null, null); - OperationUtils.syncOperation(op, derivedOperation); - derivedOperation.setName(name); - } - else { - if (!OperationUtils.isSameOperation(derivedOperation, op, false)) { - OperationUtils.syncOperation(op, derivedOperation); - derivedOperation.setName(name); - } - } - } - } - } - return derivedInterface; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/components/HelloWorld.cpp b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/components/HelloWorld.cpp deleted file mode 100644 index 3438bbb0d30..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/components/HelloWorld.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// -------------------------------------------------------- -// Code generated by Papyrus C++ -// -------------------------------------------------------- - -#define HelloWorld_components_HelloWorld_BODY - -/************************************************************ - HelloWorld class body - ************************************************************/ - -// include associated header file -#include - -// Derived includes directives -#include - -namespace components { - -// static attributes (if any) - -/** - * - * - */ -void HelloWorld::run() { - cout << "Hello world: " << message << endl; -} - -} // of namespace components - -/************************************************************ - End of HelloWorld class body - ************************************************************/ \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/components/HelloWorld.h b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/components/HelloWorld.h deleted file mode 100644 index de7e6e07050..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/components/HelloWorld.h +++ /dev/null @@ -1,58 +0,0 @@ -// -------------------------------------------------------- -// Code generated by Papyrus C++ -// -------------------------------------------------------- - -#ifndef HELLOWORLD_COMPONENTS_HELLOWORLD_H -#define HELLOWORLD_COMPONENTS_HELLOWORLD_H - -/************************************************************ - HelloWorld class header - ************************************************************/ - -/* Owner package header include */ -#include - -/* Owner package header include */ -#include - -#include - -#include - -namespace components { - -/************************************************************/ -/** - * Configuration attribute within the Hello World component. Its value is configured on the instance level. - */ - -class HelloWorld: public ::StdPorts::Cstart, public IStart { - -public: - - /** - * - */ - String message; - - /** - * - * - */ - void run(); - -}; -/************************************************************/ -/* External declarations (package visibility) */ - -/************************************************************/ - -/* Inline functions */ - -} // of namespace components - -/************************************************************ - End of HelloWorld class header - ************************************************************/ - -#endif diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/platform/MonoNode.cpp b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/platform/MonoNode.cpp deleted file mode 100644 index 487d89a2cde..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/platform/MonoNode.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -------------------------------------------------------- -// Code generated by Papyrus C++ -// -------------------------------------------------------- - -#define HelloWorld_platform_MonoNode_BODY - -/************************************************************ - MonoNode class body - ************************************************************/ - -// include associated header file -#include - -// Derived includes directives - -namespace platform { - -// static attributes (if any) - -}// of namespace platform - -/************************************************************ - End of MonoNode class body - ************************************************************/ \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/platform/MonoNode.h b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/platform/MonoNode.h deleted file mode 100644 index 11ec7186c39..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/HelloWorld/platform/MonoNode.h +++ /dev/null @@ -1,38 +0,0 @@ -// -------------------------------------------------------- -// Code generated by Papyrus C++ -// -------------------------------------------------------- - -#ifndef HELLOWORLD_PLATFORM_MONONODE_H -#define HELLOWORLD_PLATFORM_MONONODE_H - -/************************************************************ - MonoNode class header - ************************************************************/ - -/* Owner package header include */ -#include - -namespace platform { - -/************************************************************/ -/** - * - */ - -class MonoNode { - -}; -/************************************************************/ -/* External declarations (package visibility) */ - -/************************************************************/ - -/* Inline functions */ - -} // of namespace platform - -/************************************************************ - End of MonoNode class header - ************************************************************/ - -#endif diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/META-INF/MANIFEST.MF deleted file mode 100644 index 40d9df64cb6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/META-INF/MANIFEST.MF +++ /dev/null @@ -1,28 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.qompass.modellibs.core, - org.eclipse.papyrus.qompass.modellibs.core.xtend -Require-Bundle: org.eclipse.ui, - org.eclipse.ui.ide;bundle-version="3.8.0", - org.eclipse.core.runtime, - org.eclipse.papyrus.fcm.profile;bundle-version="1.2.0", - org.eclipse.papyrus.qompass.designer.core;bundle-version="1.2.0", - org.eclipse.papyrus.qompass.designer.vsl;bundle-version="1.2.0", - org.eclipse.uml2.uml;bundle-version="4.0.0", - org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", - org.eclipse.core.resources, - org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.wizards;bundle-version="1.2.0", - com.google.guava;bundle-version="11.0.0", - org.eclipse.xtext.xbase.lib, - org.eclipse.xtend.lib, - org.eclipse.xtend.lib.macro -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.qompass.modellibs.core.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.qompass.modellibs.core;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/about.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

    About This Content

    - -

    November 14, 2008

    -

    License

    - -

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

    - -

    If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

    - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/build.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/build.properties deleted file mode 100644 index 4454371265c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/build.properties +++ /dev/null @@ -1,17 +0,0 @@ -# -#Thu Jun 28 15:46:18 CEST 2012 -bin.includes = META-INF/,\ - .,\ - models/,\ - plugin.xml,\ - .classpath,\ - .project,\ - html/,\ - help/,\ - about.html,\ - plugin.properties -output..=bin/ -src.includes = models/,\ - about.html -source.. = src/,\ - xtend-gen/ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-examples.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-examples.xml deleted file mode 100644 index 8e2820fd43f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-examples.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-library.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-library.xml deleted file mode 100644 index 78e5563a605..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-library.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/hello-world.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/hello-world.html deleted file mode 100644 index a8aacf1106c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/hello-world.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - Hello world example with Qompass - - - - -

    Hello world example with Qompass

    - -In the sequel, we outline a simple hello world example using qompass designer. Please note that the example -can be found via File->New->Example in the category Qompass examples. There are also two cheat-sheets that explain how -to create your own example from scratch. -

    - -As for all Qompass examples, there are three different parts that needs to be modeled -

      -
    1. The software components -
    2. An abstraction of the hardware platform -
    3. A so-called deployment plan, i.e. a set of component instance definitions along with their configuration and - allocation of software components to hardware nodes -
    - -In the sequel, we will go through all of these items with a focus on the the definition of the software components. - -

    Definition of software components

    - -The example consists of two components, detailed below - -

    The hello-world component

    - -The hello-world component is shown in the following screen shot. - -
    -The Hello World component -
    -
    -The hello world component inherits from a component called CStart. This is an abstract component defined in the -Qompass core model library. It owns a port (called start) that provides the pre-defined interface IStart. This -interface has a single operation run. Components that provide an interface via a port need to implement this -interface. This include ports that are inherited. In our case, the hello world component needs to implement the IStart -interface, i.e. contain an operation "run" as well as a behavior for this operation.
    -Qompass supports the user by automatically creating derived operations for interfaceS provided via a port, i.e. the operation -signature is copied (and synchronized on demand) from the interface. The developer needs to provide behavior. In UML, behavior -can be specified either via activities or by embedding code in a programming language (opaque behavior) into the model. -Currently, Qompass focuses on the latter,in particular in form of embedded C++ code. A simple C/C++ view allows to enter -the code, as shown in the following screenshot (there is ongoing work concerning a CDT editor integration) - -

    -

    -C/C++ view -
    -

    - -The code outputs "Hello World" and an additional message that is an attribute of the hello world component. The attribute message -is declared as a UML String, but it does not have a particular contents on the level of the component definition. We will -see in the section explaining deployment plans how this contents can be defined. -

    -The specific start port enables a component to get the initial control. Its run operation is called at system -start-up by a generated boot-loader. - -

    A system component

    - -All Qompass applications need to define a top-level component, typically called System that aggregates its components, -in our case the hello-world component. It is defined by means of a composite class, contained components are -modeled via attributes (use composite aggregation for these) typed by the contained components. Note that we define a role (or part) -within a composition, the hello world component declaration is not part of the system class. This role corresponds to an -instance of a class in the deployment plan below.
    -In our simple hello world example, there is a single component only. Thus, there are no connections between components (so called assembly). take a look at the -producer-consumer example to see how the assembly can be done. -

    -

    -The System component -
    - - -

    Definition of an abstract hardware platform

    - -In parallel to the software component, the hardware platform or merely an abstraction thereof can be defined. The main objective -of this step is to define computational nodes on which the software can be allocated. A node isa stereotyped class that defines -for the moment only quite basic information about a computational node, such as the provided memory and operating system. - -

    - -The following screenshot defines a platform for the Hello World component. The HWArchitecture class has a similar -function for the platform as the System class has for the software: it represents the used notes and their interconnections. -In this simple example, the hardware architecture contains a single node.
    -

    -A platform for the Hello World component -
    - -

    Definition of a deployment plan

    - -A deployment plan is a collection of instance specifications, stored within a UML package. It has two objectives. The first is -to configure an instance of a component, i.e. to provide values for configuration attributes. The second is to allocate -instance to processing resources such as threads or directly to a node of the platform definition. - -In case of the hello world component, the message that should be written is a configuration attribute. Qompass provides a -dialog that simplifies the configuration of this attribute. The dialog lists instances and their configuration attributes and -enables the user to provide a value in a text field. On the model level, a corresponding slot and a value specification are -produced.
    - -
    -configure instance dialog -
    - -The allocation is also simplified by means of a custom dialog. The instances of a system are shown by means of a tree structure -and the user can either allocate leafs or a parent node. In our case, the whole system should be allocated to node "monoNode", as -shown in the screenshot below. On the model level, allocation is a MARTE relationship.
    -
    -allocation dialog -
    - -The last screenshot shows the resulting deployment plan, the package containing two instance specifications and the slots along -with the configured values. You also see the allocation of the system component. Note, that the visualization of all instances -in a diagram is often not useful for larger applications, since the graphical visualization does not provide additional -information compared to the tree structure depicted by the dedicated dialog.
    - -
    -resulting deployment plan -
    - -The last step is the code generation which can be executed via the context menu of a deployment plan. The code generation creates an CDT project -which can be compiled and executed. - -

    Compilation, Execution and Debugging

    - -

    For Windows users

    - -If you are using Windows and it is the first time you are running C++ project using Eclipse CDT, -you can face some problems during compilation, execution and debugging of the generated code. - -First of all, be sure that you have defined the environment variable for your C++ compiler. To do so, open a command line window (cmd.exe) and type "gdb". -You should see an output like below. - -
    -command line without error -
    - -If you do not see this output and see the error below, - -
    -command line with error -
    - - -go to "My Computer -> Properties -> Advanced System Parameters". Edit the variable named "PATH" and add the following to the end of its value ";C:\MinGW\bin\" -

    -Moreover, another problem you can face can be having no console output after a successful run of the code. In this case, -

    -Right-click on your project. Select "Properties". -

    -Select the "Run/Debug Settings" Property on the left of the new window. -

    -In the right window, click on your executable to highlight (ie - Test.exe) and click "Edit". -

    -In the Environment tab, hit "New" -

    -Name: PATH -
    -Value: Path to your MinGW bin directory (For example: C:\MinGW\bin) -

    -Click "OK" on all windows to close down. -

    -Try running again, it should print output to the screen. -

    -See this link! - - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/producer-consumer.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/producer-consumer.html deleted file mode 100644 index c7a619f5516..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/producer-consumer.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - Producer-consumer example with Qompass - - - - -

    A simple producer-consumer example

    - -In the sequel, we outline a simple producer consumer example using Qompass designer. Please note that the example -can be found via File->New->Example in the category Qompass examples. It follows the same principles as the -Hello World example, i.e. a separation between components, platform and deployment plan. -

    - -

    Definition of software components

    - -The example consists of three components, a producer, a consumer and the enclosing system component. These components are outlined -in the sequel. - -

    The producer

    - -A data producer needs flow port of type "out" to communicate the data to other components. The following screenshot shows its -definition. - -
    -The push producer -
    - -The producer is the main active component in our system. Therefore, it inherits (as the hello world component) from -the CStart component within the Qompass "core" modeling library and gets an initial execution thread. This thread executes the -component's "run" method is shown below. It executes 20 periods with a length of 200ms (we use only the simple POSIX call usleep -instead of the OS abstraction library to ensure that this example runs on most machines). In each period, an instance of type -PubData is send to the port q. -

    -

    -cout << "publish a value via port q;" << endl;
    -ComponentModel::interfaces::PubData data;
    -data.x = 2;
    -data.y = 3;
    -for (int i = 0; i<20; i++) {
    -    q->push(data);
    -    cout << "." << flush;
    -    // wait 200ms
    -    usleep(200*1000);
    -}
    -
    - -

    The consumer

    - -There are (at least) two different variants to consume data. The first is to actively pull for new data, the second is being notified (pushed) -whenever new data arrives. Although both consumers have a flow-port of type in, the mapping towards provided and required -interfaces is quite different. Whereas the pull consumer calls a pull operation, the push consumer is called from the outside. -This also implies that the pull consumer has its own thread of control, which typically performs the poll with a certain period. - -The following screenshot shows the push variant of the consumer. Since the component is inactive, no additional thread is required. -Data consumption at an "push-in" flow ports corresponds to the implementation of an interface with a push method. This interface -is automatically calculated and a derived (calculated) attribute of the port stereotyped with the FCM profile. - -
    -The push consumer -
    -

    - -The next screenshot shows the pull variant of the consumer. This components inherits from the abstract LifeCycle component that -provides the lifecycle port. The interface associated with this port contains the two operations activate and deactivate. The -lifecycle operations are called after creation, but -- unlike the start call -- should return the control immediately (or after -a very short time).
    -Since we want that the consumer executes a periodic pull operation, we need to launch a new thread in the activation call and let -this thread execute the pull loop. One way to achieve this Qompass is to use a container service that intercepts the -activation call. This service is call runStartThread and is visible in the context menu of the class. - -

    -The pull consumer -
    -

    - -

    The system

    - -Since we use two different variants of a consumer, we need to have two different variants of the system component. -The first variant uses a push consumer. In this case, producer and consumer can be connected directly, since the producer -calls the push operation that is provided by the consumer. - -
    -The System component with a push consumer -
    - -The variant with a pull consumer is a bit more complicated. In this case, both producer and consumer call operations (push and -pull respectively) and we need a mediator between this. A suitable choice is the use of a FIFO queue. The producer pushes data -into the FIFO and the consumer polls for data "at the other end". Instead of explicitly introducing an additional part for the -queue in the system, Qompass supports annotating UML connectors. In this case, we add the information to the connector between -producer and consumer that a FIFO connector should be used. When the code for this system is generated, Qompass replaces the -connection by a reified connector, as shown in the -reference guide - -
    -The System component with a pull consumer -
    - - -

    Definition of an abstract hardware platform

    - -The hardware platform is the same monolithic platform as for the hello world example - -
    -The push consumer -
    - -

    Definition of a deployment plan

    - -There are two deployment plans corresponding to the two variants to consume data. The screenshots below shows both plans -without detailing the contained instance specifications.
    -In addition to the two plans, there are two Configurations that enable activation of container extension. For -instance, the tracing rules are only active in a trace configuration. A configuration refers to a set of configuration -options and a deployment plan, as shown in screenshots. - -
    -The push consumer -
    - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_with_error.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_with_error.png deleted file mode 100644 index b239ab329eb..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_with_error.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_without_error.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_without_error.png deleted file mode 100644 index a03d922c087..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_without_error.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/allocate.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/allocate.png deleted file mode 100644 index 43f70204412..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/allocate.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/c-cpp-view.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/c-cpp-view.png deleted file mode 100644 index c4cc6730243..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/c-cpp-view.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/configure-instance.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/configure-instance.png deleted file mode 100644 index a77b9c3cbcf..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/configure-instance.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/deployment-plan.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/deployment-plan.png deleted file mode 100644 index 969c3b0d62c..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/deployment-plan.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/hello-world.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/hello-world.png deleted file mode 100644 index 78d176b6fa7..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/hello-world.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/platform.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/platform.png deleted file mode 100644 index 93f8f332b2a..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/platform.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/system.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/system.png deleted file mode 100644 index 10446c73b5c..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/system.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/dep-plans.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/dep-plans.png deleted file mode 100644 index 9d5c201fd60..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/dep-plans.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/generated-container.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/generated-container.png deleted file mode 100644 index 4eb00727977..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/generated-container.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/pull-consumer.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/pull-consumer.png deleted file mode 100644 index 950ad42d68c..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/pull-consumer.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-consumer.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-consumer.png deleted file mode 100644 index 83065ace195..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-consumer.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-producer.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-producer.png deleted file mode 100644 index 580db31e964..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-producer.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-pull.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-pull.png deleted file mode 100644 index 08d5286e66a..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-pull.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-push.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-push.png deleted file mode 100644 index 1c3ce96ad33..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-push.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/corba.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/corba.html deleted file mode 100644 index 266c64ef4d2..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/corba.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - CORBA basic types (model library) - - - - -

    A collection of CORBA base types

    - - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/core.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/core.html deleted file mode 100644 index 038fd213f27..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/core.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Core model library - - - - -

    A simple producer-consumer example

    - - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/osal.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/osal.html deleted file mode 100644 index 038fd213f27..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/osal.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Core model library - - - - -

    A simple producer-consumer example

    - - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/statemachine.html b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/statemachine.html deleted file mode 100644 index 038fd213f27..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/statemachine.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Core model library - - - - -

    A simple producer-consumer example

    - - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.di deleted file mode 100644 index a60df8b7c45..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.di +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.notation deleted file mode 100644 index f2f19151607..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.notation +++ /dev/null @@ -1,1221 +0,0 @@ - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.uml deleted file mode 100644 index 55d57426110..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.uml +++ /dev/null @@ -1,395 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - cout << "server: got add request for a=" << a << " and b=" << b << endl; -return a+b; - - - - - - - - - - - - - - - - - - C/C++ - cout << "server: got mult request for a=" << a << " and b=" << b << endl; -return a*b; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Additional "tick" port. The contained tick operation is called by the timer. See composite diagram of system for the assembly - - - - - - - - - - - - - - - - - - - C/C++ - cout << "call via port q: add(2, 3);" << endl; -cout << "result: " << q->add(2, 3) << endl; -cout << "now sleeping 10 seconds" << endl; -sleep(10); -cout << "finishing CClient_impl::run" << endl; - - - C/C++ - cout << "call via port tick: mult(4, 5);" << endl; -cout << "result: " << q->mult(4, 5) << endl; - - - - - - - - - - Period of timer can be configured via -"configure instance properties" popup (once timer attribute is selected) - - - Part of Qompasss modeling library - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Linux and cygwin require different deployment plans, since we use different target platforms - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.di deleted file mode 100644 index 1ea0f4f343e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.di +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.notation deleted file mode 100644 index 6cef3afec90..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.notation +++ /dev/null @@ -1,574 +0,0 @@ - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - multiplicity - name - type - derived - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - multiplicity - name - type - derived - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - -
    -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - -
    -
    - - - -
    - - - - - - - - name - type - derived - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.uml deleted file mode 100644 index 3d3e0752b5c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.uml +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - - - - - - Simple HelloWorld component that prints a message in its "run" operation that is provided via the "start" port - - - - - Part of the Qompass core model library. Provides the specific port "start". The "run" operation (defined within interface IStart) of this port is called by generated boot-code after instantiation and configuration of a component. - - - - Configuration attribute within the Hello World component. Its value is configured on the instance level. - - - - - - - - - - - - - - - - - - C/C++ - cout << "Hello world: " << message << endl; - - - - - - - - - - - - - - - - Simple single node configuration. TargetOS is set to Linux, but will work on any OS, since this simple example does not use the OS abstraction layer - - - - - - - - - - - - - - - - - - This configuration requires the installation of the OTF trace library.<br /> - - - Cross references to composite diagram - - - Deployment plan for system, i.e. set of instance specification along with configuration and allocation - - - - Value mainInstance.hello is a UML instance-value, i.e. a reference to the instance specification on the left. -"Test message" is a StringValue initializing the message attribute - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.di deleted file mode 100644 index c651eaf4315..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.di +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.notation deleted file mode 100644 index d8404d0904b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.notation +++ /dev/null @@ -1,528 +0,0 @@ - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.uml deleted file mode 100644 index a02dc7a2a5f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.uml +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - Simple HelloWorld component that prints a message in its "run" operation that is provided via the "start" port - - - - - Part of the Qompass core model library. Provides the specific port "start". The "run" operation (defined within interface IStart) of this port is called by generated boot-code after instantiation and configuration of a component. - - - - Configuration attribute within the Hello World component. Its value is configured on the instance level. - - - - - - - - - - - - - - - - - - C/C++ - printf ("Hello world: %s", message); - - - - - - - - - - - - - - - - Simple single node configuration. TargetOS is set to Linux, but will work on any OS, since this simple example does not use the OS abstraction layer - - - - - - - - - - - - - - - - - - This configuration requires the installation of the OTF trace library.<br /> - - - Cross references to composite diagram - - - Deployment plan for system, i.e. set of instance specification along with configuration and allocation - - - - Value mainInstance.hello is a UML instance-value, i.e. a reference to the instance specification on the left. -"Test message" is a StringValue initializing the message attribute - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.di deleted file mode 100644 index 670de7fb972..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.di +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.notation deleted file mode 100644 index 83d0bb6c94c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.notation +++ /dev/null @@ -1,574 +0,0 @@ - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - multiplicity - name - type - derived - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - multiplicity - name - type - derived - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - -
    -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - -
    -
    - - - -
    - - - - - - - - name - type - derived - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.uml deleted file mode 100644 index f0ce2f36f68..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.uml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - Simple HelloWorld component that prints a message in its "run" operation that is provided via the "start" port - - - - - Part of the Qompass core model library. Provides the specific port "start". The "run" operation (defined within interface IStart) of this port is called by generated boot-code after instantiation and configuration of a component. - - - - Configuration attribute within the Hello World component. Its value is configured on the instance level. - - - - - - - - - - - - - - - - - - C/C++ - JAVA - cout << "Hello world: " << message << endl; - System.out.println("Hello"); - - - - - - - - - - - - - - - - Simple single node configuration. TargetOS is set to Linux, but will work on any OS, since this simple example does not use the OS abstraction layer - - - - - - - - - - - - - - - - - - This configuration requires the installation of the OTF trace library.<br /> - - - Cross references to composite diagram - - - Deployment plan for system, i.e. set of instance specification along with configuration and allocation - - - - Value mainInstance.hello is a UML instance-value, i.e. a reference to the instance specification on the left. -"Test message" is a StringValue initializing the message attribute - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.di deleted file mode 100644 index fe968580adf..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.di +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.notation deleted file mode 100644 index cbbd906bbaf..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.notation +++ /dev/null @@ -1,1541 +0,0 @@ - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - name - derived - type - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - name - derived - type - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - name - derived - type - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - name - derived - type - - - - - - - - - name - derived - type - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - name - derived - type - - - - - - - - - name - derived - type - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - name - derived - type - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - name - derived - type - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - -
    - - -
    - - -
    - - -
    - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - name - derived - type - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - name - derived - type - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - name - derived - type - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.uml deleted file mode 100644 index 6f14b85b526..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.uml +++ /dev/null @@ -1,453 +0,0 @@ - - - - - - - - - - - - - - - - - - - Variant of the consumper component that uses a "pull style", i.e. actively demands whether new data is available. Since the component is active, it needs to have its own thread. This is realized by the combination of the lifecycle port with a container rule that intercepts the lifecycle operations and executes the activation operation in its own thread. -Use the context menu to find out that the PullConsumer supports the "runStartThread" interceptor which intercepts the lifecycle port. - - - - Part of the Qompass model library. Provides the specific port "lc" (short for lifecycle). The "activate" operation of this port is called by generated boot-code after instantiation and configuration of a component. The deactivation is called before disposing a component - - - - - - - - - - - - C/C++ - cout << "wait for data on port p" << endl; -for (int i = 0; i<25; i++) { - if (p->hasData ()) { - components::interfaces::PubData data = p->pull (); - cout << "received data: x = " << data.x << " y = " << data.y << endl; - } - usleep (100*1000); -} -cout << "finished waiting" << endl; - - - - C/C++ - - - - C/C++ - - - - - - - - - - Push variant of a consumer, i.e. the consumer is called whenever new data is availble. It is not itself active. - - - A MARTE flow port. The synchronisation between MARTE and FCM stereotype is automatic, yet it is possible to refine on FCM level, whether the port uses a push or pull style. In this case, the port uses a push style by setting the port kind to "PushConsumer". - - - The dependency assures that the type PubData is known within the generated code for PushConsumer_impl - - - - - - - - - - - - - C/C++ - cout << "initialization of push consumer" << endl; - - - - - - - - C/C++ - cout << "received data: x = " << data.x << " y = " << data.y << endl; - - - C/C++ - - - - C/C++ - - - - - - - - - - - - - - - - - - - - - - - - - - - - Let the producer instance execute by the main thread by realising the specific port "start", inherited from CStart (part of the Qompass "core" model library). - - - - - - - - - - - - - C/C++ - cout << "publish a value via port q;" << endl; -components::interfaces::PubData data; -data.x = 2; -data.y = 3; -for (int i = 0; i<20; i++) { - q->push (data); - cout << "." << flush; - // wait 200ms - usleep (200*1000); -} - - - - - - - - - - Pull consumer is executed by its own thread. This is specified via a container service (runStartThread) - - - Since producer and consumer call operations (the latter to actively retrieve data), the two ports would be incompatible without using a specific interaction component, in this case. a FIFO. -Use the context menu on a selected connector to specify the interaction component. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The push consumer provides the interface that the producer uses (requires), no specific connector is required - - - - - - - - - - - - - - - - - - - - - - - - - - - Simple single node configuration. TargetOS is set to Linux, but will work on other OS (supporting POSIX threads) - - - - - - - - - - - - - - - - - - This configuration requires the installation of the OTF trace library.<br /> - - - Cross references to diagrams - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.di deleted file mode 100644 index 17cff76e5d5..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.di +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.notation deleted file mode 100644 index 6e4bd7a2591..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.notation +++ /dev/null @@ -1,1655 +0,0 @@ - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.uml deleted file mode 100644 index 4690ec8712c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.uml +++ /dev/null @@ -1,532 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - Variant of the consumper component that uses a "pull style", i.e. actively demands whether new data is available. Since the component is active, it needs to have its own thread. This is realized by the combination of the lifecycle port with a container rule that intercepts the lifecycle operations and executes the activation operation in its own thread. -Use the context menu to find out that the PullConsumer supports the "runStartThread" interceptor which intercepts the lifecycle port. - - - - Part of the Qompass model library. Provides the specific port "lc" (short for lifecycle). The "activate" operation of this port is called by generated boot-code after instantiation and configuration of a component. The deactivation is called before disposing a component - - - - - - - - - - - - - - - - - C/C++ - cout << "wait for data on port p" << endl; -for (int i = 0; i<25; i++) { - if (p->hasData ()) { - components::interfaces::PubData data = p->pull (); - cout << "Componenent " << name << " received data: x = " << data.x << " y = " << data.y << endl; - } - usleep (100*1000); -} -cout << "finished waiting" << endl; - - - - - - - - - Push variant of a consumer, i.e. the consumer is called whenever new data is availble. It is not itself active. - - - A MARTE flow port. The synchronisation between MARTE and FCM stereotype is automatic, yet it is possible to refine on FCM level, whether the port uses a push or pull style. In this case, the port uses a push style by setting the port kind to "PushConsumer". - - - - - - - - - - - - - C/C++ - cout << "initialization of push consumer" << endl; - - - - C/C++ - cout << "received data: x = " << data.x << " y = " << data.y << endl; - - - - - - - - - - - - - - - - - - - - - - - - - Let the producer instance execute by the main thread by realising the specific port "start", inherited from CStart (part of the Qompass "BasicCalls" model library). - - - - - - - - - - - - - - - - C/C++ - cout << "publish a value via port q;" << endl; -components::interfaces::PubData data; -data.x = 2; -data.y = 3; -for (int i = 0; i<20; i++) { - q->push (data); - cout << "." << flush; - // wait 200ms - usleep (200*1000); -} - - - - - - - - - Two consumers use the same queue. In this case, it is arbitrary which one gets which data - - - in this case, the connector is modeled explicitly in order to specify that a single connector instance is used - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The push consumer provides the interface that the producer uses (requires), no specific connector is required, but we need to multiply data - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Simple single node configuration. TargetOS is set to Linux, but will work on other OS (supporting POSIX threads) - - - - - - - - - - - - - - - - - - - - - - - - This configuration requires the installation of the OTF trace library.<br /> - - - Cross references to diagrams - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.png deleted file mode 100644 index 1dc0c2310e4..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.svg b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.svg deleted file mode 100644 index 4336e615b78..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.svg +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -PullConsumer_impl - - - - - - - - lc: ILifeCycle - - - - p: PubData -kind=PullConsumer,requiredInterface=D_PullConsumer_PubData - - -LifeCycle - - - - - - lc: ILifeCycle - -Variant of the consumper component that uses a "pull -style", i.e. actively demands whether new data is -available. Since the component is active, it needs to -have its own thread. This is realized by the combination -of the lifecycle port with a container rule that intercepts -the lifecycle operations and executes the activation -operation in its own thread. -Use the context menu to find out that the PullConsumer -supports the "runStartThread" interceptor which -intercepts the lifecycle port. - - - - - - - - - -Part of the Qompass model library. Provides the specific -port "lc" (short for lifecycle). The "activate" operation of -this port is called by generated boot-code after -instantiation and configuration of a component. The -deactivation is called before disposing a component - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.pdf b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.pdf deleted file mode 100644 index 4a05698fb4f..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.pdf and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.png deleted file mode 100644 index eafd2786511..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.svg b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.svg deleted file mode 100644 index aa89a2be691..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.svg +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -SystemPull_impl - - con: PullConsumer_impl - - - - - - - - p: PubData - - prod: Producer_impl - - - - - - q: PubData - -Pull consumer is executed by its -own thread. This is specified via a -container service (runStartThread) - - - - - - - - - -Since producer and consumer call operations (the latter to actively -retrieve data), the two ports would be incompatible without using -a specific interaction component, in this case. a FIFO. -Use the context menu on a selected connector to specify the -interaction component. - - - - - - - - - - - -«connector» -{ic=FIFO_impl} - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.di deleted file mode 100644 index 4af45b41bca..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.di +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.notation deleted file mode 100644 index 52a0b8e9ee1..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.notation +++ /dev/null @@ -1,256 +0,0 @@ - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.uml deleted file mode 100644 index 16504ba6e28..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.uml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - The CORBA primitive types are defined by means of the C++ profile. For portability, they rely on the (C99) standard include file stdint.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.di deleted file mode 100644 index c60a23070a9..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.di +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.notation deleted file mode 100644 index a64f663c8c1..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.notation +++ /dev/null @@ -1,5392 +0,0 @@ - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - -
    - - - - - - - - -
    - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - -
    - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.uml deleted file mode 100644 index f028cc3615c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.uml +++ /dev/null @@ -1,1369 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - A template for the bootloader generation. - - - This C++ implementation of the template contains principally the definition of the -"main" function and the declaration of the bootloader instance - - - C/C++ - <%createInstances%> - - - - - - - - - Main package template for all call based connectors. The formal parameter is the interface I (which is bound to the actual interface used in a call). -This package is virtually extended by other model libraries who import it. - - - Inheritance hierarchy for (A)SyncCall component types. Separate types for required (rconn) and provided (fconn) ports enable re-use via inheritance ain multiple places (e.g. for AMI ports that use an unmodified provided port and different variants of a required port). -Note that ports on connector side are conjugated - - - - - - - - - - - - - - Description: A simple implementation of asynchronous calls. It will execution requests by means of a single dispatcher thread - - - Simple asynchronous call implementation: returns immediately and executes request in new thread - - - Uses buffer and ASN marshalling. -TODO: configurable buffer size, use data structure (CppParameterStorage) - - - - - - - - - - - - - C/C++ - !xtend AsyncCalls.asyncCall - - - C/C++ - ((AsyncCall_impl *) arg)->dispatch (); -return NULL; - - - - C/C++ - !xtend AsyncCalls.dispatch_ - - - - - - - - - - - - - - - - - - - - (untested) implementation of an asynchronous invocation that uses a thread pool for -spawning new requests - - - - - - - - - - - - - C/C++ - !xtend AsyncCalls.asyncCall - - - C/C++ - ((AsyncCall_impl *) arg)->dispatch (); -return NULL; - - - - C/C++ - !xtend AsyncCalls.dispatchWithThreadPool - - - - - - - - - - - - - - - - - - - - Description: A simple implementation of asynchronous calls. It will execution requests by means of a single dispatcher thread - - - Polling variant of CORBAs asynchronous messaging (AMI), enables asynchronous calls while reading -return values (also called deferred synchronous): -Instead of specified return values, functions return a poller object which may be queried for -the result. -TODO: complete, move into model of Qompass AMI plugin - - - - - - - - - - - - - C/C++ - !xtend AMIPull.operation - - - C/C++ - ((AsyncCall_impl *) arg)->dispatch (); -return NULL; - - - - C/C++ - !xtend AsyncCall.dispatch_ - - - - - - - - - - - - - - - - - - - - - - C/C++ - !xtend MultipleReceptacle.operation_ - - - - - - - - - - - - - - - - - - - - - - - Needs completion: -good(?) write buffer event? -Call operations of buffer component? -[could have done in an identical way for EventPool] - - - Marshalling is done at two levels: -(1) In case of a shared address space, only a callEvent is created. It can be passed between threads within a process. -(2) For remote communication, marshalling into a buffer is done. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - !xtend StructBasedMarshalling.marshall - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Description: This connector is a kind of dummy connector, since it only passes incoming requests to its caller port - - - Minimal connector implementation that does nothing (but passing requests) - - - - - - - - C/C++ - !xtend SyncCalls.syncCall - - - - - - - - - - C/C++ - cout << "this is a sample pre-call interception" << endl; -rconn-><%cppCall%>; -cout << "this is a sample post-call interception" << endl; - - - - - - - A set of Leader followers is instantiated. Each has its own thread and a semaphore. The LF instance waits on its semaphore. When selectLeader is called, a follower is signaled (semaphore is posted) and will become leader. The leader waits for a resource (e.g. a socket) and becomes executor. - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - for (;;) { - // wait to be become active - m_state = FOLLOWER; - sem_wait (&m_sema); - m_state = LEADER; - listener->select(); // no loop, single select - selectLeader (); - m_state = EXECUTOR; - listener->exec(); -} - - - - - C/C++ - // select a new leader from the followers -for (int i = currentIndex+1, j=0; j<POOL_SIZE; i++, j++) -{ - if (i == POOL_SIZE) { - i = 0; - } - if (sr[i].state == FOLLOWER) { - sem_post (&sr[i].m_sema); - break; - } -} - - - C/C++ - sem_init (&m_sema, 0, 0); -m_state = FOLLOWER; - - - C/C++ - for (int i=0; i<POOL_SIZE; i++) { - pthread_create (&m_sr.m_tID, 0, runStatic, &m_sr[i]); -} - - - C/C++ - ((LeaderFollower *) arg)->run(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Data Flow oriented communication: consume passively: provided push operation is called - - - Data Flow oriented communication: produce data via pushing these (calling the required operation) - - - Data Flow oriented communication: produce data via pushing these (calling the required operation) - - - Data Flow oriented communication: produce data via pushing these (calling the required operation) - - - Data Flow oriented communication: consumer data actively by calling the required poll operation - - - In order to support icons, all port kinds are stereotypes, but for Qompass they are classes stereotyped as "PortKind" - - - A bidirectional flow port combining a push-producer and a pull consumer - - - Dummy interface returned by ports who need to update derived interfaces (but can only do so in the context of a transaction). - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - - - - - - Simple provision of typing interface as provided interface - - - Simple provision of typing interface as required interface - - - CORBA asynchronous messaging (AMI): Provision of poller variant of typing interface. Allows client to continue without waiting for the result - - - CORBA asynchronous messaging (AMI): Provision of callback variant of typing interface. Allows client Allows client to continue without waiting for the result - - - - - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - - - - - - - - - Is called during component activation & deactivation. The two functions may not block i.e. return control to the caller after "a very short" period - - - Is called during startup. Expected to block. Only one component instance per node may define it. - - - - - - - - - - - - A thread service supporting the LifeCycle port. Once started, it calls the activate operation (via the required port rLC) of a connected component in a new thread of a specific priority (a configuration attribute). This C++ implementation is based on the POSIX pthread library. It will further assume that the execution is done with root privileges, since these are required to set the thread priority. The thread properties assume round-robin (SCHED_RR) scheduling. - - - - Interceptor variant of thread (inherits all, only difference to Thread superclass: tagged as connector) - - - - Priority of the thread. The interpretation of the value is OS specific. In case of POSIX; priorities are only taken into accound for threads with a FIFO and round-robin scheduliung policy. - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - ((Thread*) arg)->rLC->activate(); -return NULL; - - - - C/C++ - // create thread -pthread_t pt; -pthread_create (&pt, NULL, staticAct, (void *) this); - -// set priority of thread -struct sched_param schedParam; -schedParam.sched_priority = priority; -pthread_setschedparam (pt, SCHED_RR, &schedParam); -// TODO: check return code (in particular, SCHED_RR only works for root) - - - - C/C++ - - - - C/C++ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - if (m_size < POOL_SIZE) { - events[writeIndex] = event; - writeIndex = (writeIndex + 1) % POOL_SIZE; - m_size++; - if (m_size == 1) { - // was 0 before, notify waiting clients - m_cond.signal(); - } -} - - - - - - - - - - C/C++ - return m_size; - - - - - - - - - - - - C/C++ - if (m_size == 0) { - // no element is in pool. Wait until it is placed inside - // TODO: potential race condition - OS_AL::Time::TimeVal wakeup = OS_AL::Time::TimeVal::current(); - wakeup += timeout; - int retCode = m_cond.waitUpto (wakeup); - if (retCode == ETIMEDOUT) { - CallEvent_ event; - event.operationID = ID_TIMEOUT; - return event; - } -} -int current = readIndex; -readIndex = (readIndex+1) % POOL_SIZE; -m_size--; -return events[current]; - - - C/C++ - m_cond.lock(); -readIndex = 0; -writeIndex = 0; -m_size = 0; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <<TextualRepresentation>>public abstract writeEvent (in event:BasicCalls::ContainerServices::Event) ; - - - - - - - - - - - - - - - - - - <<TextualRepresentation>>public abstract size () : BasicCalls::Long ; - - - - - - - - - - - - <<TextualRepresentation>>public abstract readEvent(in timeout : BasicCalls::Long) : BasicCalls::ContainerServices::Event ; - - - - - - - - - - - - - - - - - - The period length of the perdioci timer in ticks. Currently, a tick corresponds to 1 ms (simulation time in the underlying OS abstraction layer). It is planned to support VSL expressions, i.e. a value/unit pair. - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - OS_AL::Time::Timer timer; -OS_AL::Time::TimeVal time = OS_AL::Time::TimeVal::current(); -OS_AL::Time::TimeVal period(periodLength); -for (;;) { - tick->tick(); - time += period; - timer.wakeUp(time); -} - - - C/C++ - - - - C/C++ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This rule adds an interceptor for the lifecycle (lc) port. It will use the Thread implementation that executes the activate method in a new thread of a given priority (property of the interceptor implementation) - - - Adds a periodic timer to the container - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Use for distributed applications - - - - - Use for debugging in general - - - - - Use for tracing. - - - - - - - - - - - - - - - - - - - Elements in this package depend not only on the Interface I (which is a non-owned template parameter taken from the methodCall signature), but also on a class parameter T, which is bound to the component within a container binding. -Be aware that the number of instantiated template packages will be considerably larger compared to a dependency of the interface only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pthread - rt - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.di deleted file mode 100644 index b319be2de9c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.di +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.notation deleted file mode 100644 index ce60a488a78..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.notation +++ /dev/null @@ -1,3896 +0,0 @@ - - - - - - - - - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - -
    -
    -
    -
    -
    - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.uml deleted file mode 100644 index 1570093713d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.uml +++ /dev/null @@ -1,1507 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - currently unused, not sure whether really needed - - - C/C++ - [template (clazz: Class)] -/* --- create internal connections --- */ -[for (connector : Connector | clazz.getOwnedConnectors())]%> - [comment call createConnection (this = connector instance) define in utils /] - // connector [connector.name/] - [createConnection(connector)/] -[/for] -[/template] - - - C/C++ - [template (clazz: Class)] -// createParts -// assign implementations fixed at component design time -[for (Property part | clazz.part)] - [if (type.isImplementation)] - [part.name/] = &m_[part.name/]_impl; - [/if] -[/for] - -// assign implementation fixed at deployment time -[for (Property part | clazz.part)] - [if (type.isImplementation)] -m_[part.name/] = [part.name/] - [/if] -[/for] -[/template] - - - - - - - A template for the bootloader generation. - - - This C++ implementation of the template contains principally the definition of the -"main" function and the declaration of the bootloader instance - - - C/C++ - <%createInstances%> - - - - - - - - - Main package template for all call based connectors. The formal parameter is the interface I (which is bound to the actual interface used in a call). -This package is virtually extended by other model libraries who import it. - - - Inheritance hierarchy for (A)SyncCall component types. Separate types for required (rconn) and provided (fconn) ports enable re-use via inheritance ain multiple places (e.g. for AMI ports that use an unmodified provided port and different variants of a required port). -Note that ports on connector side are conjugated - - - - - - - - - - - - - - Description: A simple implementation of asynchronous calls. It will execution requests by means of a single dispatcher thread - - - Simple asynchronous call implementation: returns immediately and executes request in new thread - - - Uses buffer and ASN marshalling. -TODO: configurable buffer size, use data structure (CppParameterStorage) - - - - - - - - - - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] -[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public op(operation : Operation)] -// TODO: need suitable constant dimensioning -pBuffer = &buffer['['/]500[']'/]; // grows backwards -int operationID = ID_[operation.name/]; - -// now marshall in and inout parameters via ASN.1 -[for (parameter : Parameter | operation.parametersInInout())] -{ - [parameter.type.cppType()/] varName_ASN = [parameter.name/]; - BEncAsnContent (&pBuffer, &varName_ASN); -} -[/for] -BEncAsnContent (&pBuffer, &operationID); - -pthread_t pt; -pthread_create (&pt, NULL, staticDispatch, (void *) this); -// TODO: add semaphore which assures that subsequent calls to [operation.name/] are not executed before dispatch -// has removed the parameters from the pBuffer stack (pBuffer can be corrupted). -[/template] - - - C/C++ - ((AsyncCall_impl *) arg)->dispatch (); -return NULL; - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] -[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public dispatch(clazz : Class)] -int operationID; -BDecAsnContent (&pBuffer, operationID); -switch (operationID) -{ -[for (operation : Operation | clazz.ownedOperation)] - case ID_[operation.name/] - { - [for (parameter : Parameter | operation.parametersInInout()->reverse())] - [parameter.type.cppType()/] [parameter.name/] - { - [parameter.type.cppType()/] varName_ASN; - BDecAsnContent (&pBuffer, &varName_ASN); - [parameter.name/] = varName_ASN; - } - [/for] - // delegate call to executor - rconn->[operation.cppCall()/]; - break; - } -[/for] -} -[/template] - - - - - - - - - - - - - - - - - - - - (untested) implementation of an asynchronous invocation that uses a thread pool for -spawning new requests - - - - - - - - - - - - - C/C++ - [template marshall(operation: Operation)] -// TODO: need suitable constant dimensioning -pBuffer = &buffer[500]; // grows backwards -int operationID = ID_[operation.name/]; - -// now marshall in and inout parameters via ASN.1 -for (parameter : Parameter | parametersInInout(operation)] -{ - [cppType(parameter.type)/] varName_ASN = [parameter.name/]; - BEncAsnContent (&pBuffer, &varName_ASN); -} -[/for] -BEncAsnContent (&pBuffer, &operationID); - -// find associated thread and signal its semaphore -// pass "this" to access buffer -// pthread_t pt; -// pthread_create (&pt, NULL, staticDispatch, (void *) this); -// TODO: add semaphore which assures that 2 snd calls to [operation.name/] is not done before dispatch -// is executed -[/template] - - - - C/C++ - ((AsyncCall_impl *) arg)->dispatch (); -return NULL; - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] -[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public dispatch(clazz : Class)] -int operationID; -BDecAsnContent (&pBuffer, operationID); -switch (operationID) -{ -[for (operation : Operation | clazz.ownedOperation)] - case ID_[operation.name/] - { - [for (parameter : Parameter | operation.parametersInInout()->reverse())] - [parameter.type.cppType()/] [parameter.name/] - { - [cppType(parameter.type)/] varName_ASN; - BDecAsnContent (&pBuffer, &varName_ASN); - [parameter.name/] = varName_ASN; - } - [/for] - // delegate call to executor - [if (not (type = null))] [operation.type.cppType()/] ret = [/if]rconn->[operation.cppCall()/]; - [for (parameter : Parameter | operation.parametersOutInout())] - { - [parameter.type.cppType()/] varName_ASN = [parameter.name/]; - BEncAsnContent (&pBuffer, &varName_ASN); - } - [/for] - resultsReady = 1; - break; - } -[/for] -} -[/template] - - - - - - - - - - - - - - - - - - - - - Description: A simple implementation of asynchronous calls. It will execution requests by means of a single dispatcher thread - - - Polling variant of corbas asynchronous messaging (AMI), enables asynchronous calls while reading -return values (also called deferred synchronous): -Instead of specified return values, functions return a poller object which may be queried for -the result. -TODO: complete, move into model of Qompass AMI plugin - - - - - - - - - - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] -[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public marshall(operation : Operation)] -[if (operation.name.oclAsType(String).endsWith('Poll'))] -[comment polling function/] -if (!resultArrived) { - // wait for result, condition will be fired upon arrival - TimeVal timeVal = TimeVal::current () + timeout; - m_cond.waitUpto (timeout); -} - [for (parameter : Parameter | operation.parametersInInout()->reverse())] - [parameter.type.cppType()/] [parameter.name/]; - { - [parameter.type.cppType()/] varName_ASN; - BDecAsnContent (&pBuffer, &varName_ASN); - [parameter.name/] = varName_ASN; - } - [/for] -} -[if (not (type = null))]return retValue;[/if] -[else] -// TODO: need suitable constant dimensioning -pBuffer = &buffer['['/]500[']'/]; // grows backwards -int operationID = ID_[operation.name/]; - -// now marshall in and inout parameters via ASN.1 -[for (parameter : Parameter | operation.parametersInInout())] - [parameter.type.cppType()/] [parameter.name/]; - { - [parameter.type.cppType()/] varName_ASN = [parameter.name/]; - BEncAsnContent (&pBuffer, &varName_ASN); - } -[/for] -BEncAsnContent (&pBuffer, &operationID); - -pthread_t pt; -pthread_create (&pt, NULL, staticDispatch, (void *) this); -// TODO: add semaphore which assures that subsequent calls to [operation.name/] are not executed before dispatch -// has removed the parameters from the pBuffer stack (pBuffer can be corrupted). -// even worse: buffer will be deallocated even without a 2nd call! -[/if] -[/template] - - - C/C++ - ((AsyncCall_impl *) arg)->dispatch (); -return NULL; - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] -[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public dispatch(clazz : Class)] -int operationID; -BDecAsnContent (&pBuffer, operationID); -switch (operationID) -{ -[for (operation : Operation | clazz.ownedOperation)] - case ID_[operation.name/] - { - [for (parameter : Parameter | operation.parametersInInout()->reverse())] - [parameter.type.cppType()/] [parameter.name/] - { - [cppType(parameter.type)/] varName_ASN; - BDecAsnContent (&pBuffer, &varName_ASN); - [parameter.name/] = varName_ASN; - } - [/for] - // delegate call to executor - [if (not (type = null))] [operation.type.cppType()/] ret = [/if]rconn->[operation.cppCall()/]; - [for (parameter : Parameter | operation.parametersOutInout())] - { - [parameter.type.cppType()/] varName_ASN = [parameter.name/]; - BEncAsnContent (&pBuffer, &varName_ASN); - } - [/for] - resultsReady = 1; - break; - } -[/for] -} -[/template] - - - - - - - - - - - - - - - - - - - - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] -[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public multiply(operation : Operation)] -for (int i=0; i<9; i++) { - if (rconn['['/]i[']'/] != 0) { - rconn['['/]i[']'/]->[operation.cppCall()/]; - } -} -[/template] - - - - - - - - - - - - - - - - - - - - - - - - - - Needs completion: -good(?) write buffer event? -Call operations of buffer component? -[could have done in an identical way for EventPool] - - - Marshalling is done at two levels: -(1) In case of a shared address space, only a callEvent is created. It can be passed between threads within a process. -(2) For remote communication, marshalling into a buffer is done. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - [template marshallStruct(operation : Operation)] -struct ParamData { -[for (parameter : Parameter | parametersInInout(operation))] - int [cppType(name)/]; -[/for] -}; -Event event; -event.ID = [operation.name/]; -event.kind = CallEvent; -ParamData * data = &event.params; -[for (parameter : Parameter | parametersInInout(operation))] - data->[parameter.name/] = [parameter.name/]; -[/for] -out->dispatch(event); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Description: This connector is a kind of dummy connector, since it only passes incoming requests to its caller port - - - Minimal connector implementation that does nothing (but passing requests) - - - - - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public methodCall(operation : Operation)] -// put pre-interceptors here -[comment type is a derived property containing the operations return type/] -[if not (operation.type = null)]return [/if]rconn->[operation.cppCall()/]; -// put post-interceptors here -[/template] - - - - - - - - - - C/C++ - cout << "this is a sample pre-call interception" << endl; -rconn-><%cppCall%>; -cout << "this is a sample post-call interception" << endl; - - - - - - - A set of Leader followers is instantiated. Each has its own thread and a semaphore. The LF instance waits on its semaphore. When selectLeader is called, a follower is signaled (semaphore is posted) and will become leader. The leader waits for a resource (e.g. a socket) and becomes executor. - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - for (;;) { - // wait to be become active - m_state = FOLLOWER; - sem_wait (&m_sema); - m_state = LEADER; - listener->select(); // no loop, single select - selectLeader (); - m_state = EXECUTOR; - listener->exec(); -} - - - - - C/C++ - // select a new leader from the followers -for (int i = currentIndex+1, j=0; j<POOL_SIZE; i++, j++) -{ - if (i == POOL_SIZE) { - i = 0; - } - if (sr[i].state == FOLLOWER) { - sem_post (&sr[i].m_sema); - break; - } -} - - - C/C++ - sem_init (&m_sema, 0, 0); -m_state = FOLLOWER; - - - C/C++ - for (int i=0; i<POOL_SIZE; i++) { - pthread_create (&m_sr.m_tID, 0, runStatic, &m_sr[i]); -} - - - C/C++ - ((LeaderFollower *) arg)->run(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Simple provision of typing interface as provided interface - - - Simple provision of typing interface as required interface - - - corba asynchronous messaging (AMI): Provision of poller variant of typing interface. Allows client to continue without waiting for the result - - - corba asynchronous messaging (AMI): Provision of callback variant of typing interface. Allows client Allows client to continue without waiting for the result - - - Data Flow oriented communication: consume passively: provided push operation is called - - - Data Flow oriented communication: produce data via pushing these (calling the required operation) - - - Data Flow oriented communication: produce data via pushing these (calling the required operation) - - - Data Flow oriented communication: produce data via pushing these (calling the required operation) - - - Data Flow oriented communication: consumer data actively by calling the required poll operation - - - In order to support icons, all port kinds are stereotypes, but for Qompass they are classes stereotyped as "PortKind" - - - A bidirectional flow port combining a push-producer and a pull consumer - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - - - - - - - - - - Is called during component activation & deactivation. The two functions may not block i.e. return control to the caller after "a very short" period - - - Is called during startup. Expected to block. Only one component instance per node may define it. - - - - - - - - - - - - A thread service supporting the LifeCycle port. Once started, it calls the activate operation (via the required port rLC) of a connected component in a new thread of a specific priority (a configuration attribute). This C++ implementation is based on the POSIX pthread library. It will further assume that the execution is done with root privileges, since these are required to set the thread priority. The thread properties assume round-robin (SCHED_RR) scheduling. - - - - Interceptor variant of thread (inherits all, only difference to Thread superclass: tagged as connector) - - - - Priority of the thread. The interpretation of the value is OS specific. In case of POSIX; priorities are only taken into accound for threads with a FIFO and round-robin scheduliung policy. - - - - - - - - - - - - - - - - - - - C/C++ - ((Thread*) arg)->rLC->activate(); -return NULL; - - - - C/C++ - // create thread -pthread_t pt; -pthread_create (&pt, NULL, staticAct, (void *) this); - -// set priority of thread -struct sched_param schedParam; -schedParam.sched_priority = priority; -pthread_setschedparam (pt, SCHED_RR, &schedParam); -// TODO: check return code (in particular, SCHED_RR only works for root) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - events[0] = event; -m_size = 1; -m_cond.signal(); - - - - C/C++ - return m_size; - - - C/C++ - OS_AL::Time::TimeVal wakeup = OS_AL::Time::TimeVal::current(); -wakeup += timeout; -int retCode = m_cond.waitUpto (wakeup); -if (retCode == ETIMEDOUT) { - CallEvent_ event; - event.operationID = ID_TIMEOUT; - return event; -} -m_size = 0; -return events[0]; - - - C/C++ - m_cond.lock(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <<TextualRepresentation>>public abstract writeEvent (in event:BasicCalls::ContainerServices::Event) ; - - - - - - - - - - - - - - - - - - <<TextualRepresentation>>public abstract size () : BasicCalls::Long ; - - - - - - - - - - - - <<TextualRepresentation>>public abstract readEvent(in timeout : BasicCalls::Long) : BasicCalls::ContainerServices::Event ; - - - - - - - - - - - - - - - - - - The period length of the perdioci timer in ticks. Currently, a tick corresponds to 1 ms (simulation time in the underlying OS abstraction layer). It is planned to support VSL expressions, i.e. a value/unit pair. - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - OS_AL::Time::Timer timer; -OS_AL::Time::TimeVal time = OS_AL::Time::TimeVal::current(); -OS_AL::Time::TimeVal period(periodLength); -for (;;) { - tick->tick(); - time += period; - timer.wakeUp(time); -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This rule adds an interceptor for the lifecycle (lc) port. It will use the Thread implementation that executes the activate method in a new thread of a given priority (property of the interceptor implementation) - - - Adds a periodic timer to the container - - - - - - - - - - - - - - - - - - - - - - - - - - - Use for distributed applications - - - - - Use for debugging in general - - - - - Use for tracing. - - - - - - - - - - - - - - - - - - - Elements in this package depend not only on the Interface I (which is a non-owned template parameter taken from the methodCall signature), but also on a class parameter T, which is bound to the component within a container binding. -Be aware that the number of instantiated template packages will be considerably larger compared to a dependency of the interface only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pthread - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pthread - rt - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.di deleted file mode 100644 index bbc117e6eff..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.di +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.notation deleted file mode 100644 index 3af00ab51ac..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.notation +++ /dev/null @@ -1,3896 +0,0 @@ - - - - - - - - - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - -
    -
    -
    -
    -
    - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.uml deleted file mode 100644 index 1570093713d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.uml +++ /dev/null @@ -1,1507 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - currently unused, not sure whether really needed - - - C/C++ - [template (clazz: Class)] -/* --- create internal connections --- */ -[for (connector : Connector | clazz.getOwnedConnectors())]%> - [comment call createConnection (this = connector instance) define in utils /] - // connector [connector.name/] - [createConnection(connector)/] -[/for] -[/template] - - - C/C++ - [template (clazz: Class)] -// createParts -// assign implementations fixed at component design time -[for (Property part | clazz.part)] - [if (type.isImplementation)] - [part.name/] = &m_[part.name/]_impl; - [/if] -[/for] - -// assign implementation fixed at deployment time -[for (Property part | clazz.part)] - [if (type.isImplementation)] -m_[part.name/] = [part.name/] - [/if] -[/for] -[/template] - - - - - - - A template for the bootloader generation. - - - This C++ implementation of the template contains principally the definition of the -"main" function and the declaration of the bootloader instance - - - C/C++ - <%createInstances%> - - - - - - - - - Main package template for all call based connectors. The formal parameter is the interface I (which is bound to the actual interface used in a call). -This package is virtually extended by other model libraries who import it. - - - Inheritance hierarchy for (A)SyncCall component types. Separate types for required (rconn) and provided (fconn) ports enable re-use via inheritance ain multiple places (e.g. for AMI ports that use an unmodified provided port and different variants of a required port). -Note that ports on connector side are conjugated - - - - - - - - - - - - - - Description: A simple implementation of asynchronous calls. It will execution requests by means of a single dispatcher thread - - - Simple asynchronous call implementation: returns immediately and executes request in new thread - - - Uses buffer and ASN marshalling. -TODO: configurable buffer size, use data structure (CppParameterStorage) - - - - - - - - - - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] -[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public op(operation : Operation)] -// TODO: need suitable constant dimensioning -pBuffer = &buffer['['/]500[']'/]; // grows backwards -int operationID = ID_[operation.name/]; - -// now marshall in and inout parameters via ASN.1 -[for (parameter : Parameter | operation.parametersInInout())] -{ - [parameter.type.cppType()/] varName_ASN = [parameter.name/]; - BEncAsnContent (&pBuffer, &varName_ASN); -} -[/for] -BEncAsnContent (&pBuffer, &operationID); - -pthread_t pt; -pthread_create (&pt, NULL, staticDispatch, (void *) this); -// TODO: add semaphore which assures that subsequent calls to [operation.name/] are not executed before dispatch -// has removed the parameters from the pBuffer stack (pBuffer can be corrupted). -[/template] - - - C/C++ - ((AsyncCall_impl *) arg)->dispatch (); -return NULL; - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] -[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public dispatch(clazz : Class)] -int operationID; -BDecAsnContent (&pBuffer, operationID); -switch (operationID) -{ -[for (operation : Operation | clazz.ownedOperation)] - case ID_[operation.name/] - { - [for (parameter : Parameter | operation.parametersInInout()->reverse())] - [parameter.type.cppType()/] [parameter.name/] - { - [parameter.type.cppType()/] varName_ASN; - BDecAsnContent (&pBuffer, &varName_ASN); - [parameter.name/] = varName_ASN; - } - [/for] - // delegate call to executor - rconn->[operation.cppCall()/]; - break; - } -[/for] -} -[/template] - - - - - - - - - - - - - - - - - - - - (untested) implementation of an asynchronous invocation that uses a thread pool for -spawning new requests - - - - - - - - - - - - - C/C++ - [template marshall(operation: Operation)] -// TODO: need suitable constant dimensioning -pBuffer = &buffer[500]; // grows backwards -int operationID = ID_[operation.name/]; - -// now marshall in and inout parameters via ASN.1 -for (parameter : Parameter | parametersInInout(operation)] -{ - [cppType(parameter.type)/] varName_ASN = [parameter.name/]; - BEncAsnContent (&pBuffer, &varName_ASN); -} -[/for] -BEncAsnContent (&pBuffer, &operationID); - -// find associated thread and signal its semaphore -// pass "this" to access buffer -// pthread_t pt; -// pthread_create (&pt, NULL, staticDispatch, (void *) this); -// TODO: add semaphore which assures that 2 snd calls to [operation.name/] is not done before dispatch -// is executed -[/template] - - - - C/C++ - ((AsyncCall_impl *) arg)->dispatch (); -return NULL; - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] -[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public dispatch(clazz : Class)] -int operationID; -BDecAsnContent (&pBuffer, operationID); -switch (operationID) -{ -[for (operation : Operation | clazz.ownedOperation)] - case ID_[operation.name/] - { - [for (parameter : Parameter | operation.parametersInInout()->reverse())] - [parameter.type.cppType()/] [parameter.name/] - { - [cppType(parameter.type)/] varName_ASN; - BDecAsnContent (&pBuffer, &varName_ASN); - [parameter.name/] = varName_ASN; - } - [/for] - // delegate call to executor - [if (not (type = null))] [operation.type.cppType()/] ret = [/if]rconn->[operation.cppCall()/]; - [for (parameter : Parameter | operation.parametersOutInout())] - { - [parameter.type.cppType()/] varName_ASN = [parameter.name/]; - BEncAsnContent (&pBuffer, &varName_ASN); - } - [/for] - resultsReady = 1; - break; - } -[/for] -} -[/template] - - - - - - - - - - - - - - - - - - - - - Description: A simple implementation of asynchronous calls. It will execution requests by means of a single dispatcher thread - - - Polling variant of corbas asynchronous messaging (AMI), enables asynchronous calls while reading -return values (also called deferred synchronous): -Instead of specified return values, functions return a poller object which may be queried for -the result. -TODO: complete, move into model of Qompass AMI plugin - - - - - - - - - - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] -[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public marshall(operation : Operation)] -[if (operation.name.oclAsType(String).endsWith('Poll'))] -[comment polling function/] -if (!resultArrived) { - // wait for result, condition will be fired upon arrival - TimeVal timeVal = TimeVal::current () + timeout; - m_cond.waitUpto (timeout); -} - [for (parameter : Parameter | operation.parametersInInout()->reverse())] - [parameter.type.cppType()/] [parameter.name/]; - { - [parameter.type.cppType()/] varName_ASN; - BDecAsnContent (&pBuffer, &varName_ASN); - [parameter.name/] = varName_ASN; - } - [/for] -} -[if (not (type = null))]return retValue;[/if] -[else] -// TODO: need suitable constant dimensioning -pBuffer = &buffer['['/]500[']'/]; // grows backwards -int operationID = ID_[operation.name/]; - -// now marshall in and inout parameters via ASN.1 -[for (parameter : Parameter | operation.parametersInInout())] - [parameter.type.cppType()/] [parameter.name/]; - { - [parameter.type.cppType()/] varName_ASN = [parameter.name/]; - BEncAsnContent (&pBuffer, &varName_ASN); - } -[/for] -BEncAsnContent (&pBuffer, &operationID); - -pthread_t pt; -pthread_create (&pt, NULL, staticDispatch, (void *) this); -// TODO: add semaphore which assures that subsequent calls to [operation.name/] are not executed before dispatch -// has removed the parameters from the pBuffer stack (pBuffer can be corrupted). -// even worse: buffer will be deallocated even without a 2nd call! -[/if] -[/template] - - - C/C++ - ((AsyncCall_impl *) arg)->dispatch (); -return NULL; - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] -[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public dispatch(clazz : Class)] -int operationID; -BDecAsnContent (&pBuffer, operationID); -switch (operationID) -{ -[for (operation : Operation | clazz.ownedOperation)] - case ID_[operation.name/] - { - [for (parameter : Parameter | operation.parametersInInout()->reverse())] - [parameter.type.cppType()/] [parameter.name/] - { - [cppType(parameter.type)/] varName_ASN; - BDecAsnContent (&pBuffer, &varName_ASN); - [parameter.name/] = varName_ASN; - } - [/for] - // delegate call to executor - [if (not (type = null))] [operation.type.cppType()/] ret = [/if]rconn->[operation.cppCall()/]; - [for (parameter : Parameter | operation.parametersOutInout())] - { - [parameter.type.cppType()/] varName_ASN = [parameter.name/]; - BEncAsnContent (&pBuffer, &varName_ASN); - } - [/for] - resultsReady = 1; - break; - } -[/for] -} -[/template] - - - - - - - - - - - - - - - - - - - - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] -[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public multiply(operation : Operation)] -for (int i=0; i<9; i++) { - if (rconn['['/]i[']'/] != 0) { - rconn['['/]i[']'/]->[operation.cppCall()/]; - } -} -[/template] - - - - - - - - - - - - - - - - - - - - - - - - - - Needs completion: -good(?) write buffer event? -Call operations of buffer component? -[could have done in an identical way for EventPool] - - - Marshalling is done at two levels: -(1) In case of a shared address space, only a callEvent is created. It can be passed between threads within a process. -(2) For remote communication, marshalling into a buffer is done. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - [template marshallStruct(operation : Operation)] -struct ParamData { -[for (parameter : Parameter | parametersInInout(operation))] - int [cppType(name)/]; -[/for] -}; -Event event; -event.ID = [operation.name/]; -event.kind = CallEvent; -ParamData * data = &event.params; -[for (parameter : Parameter | parametersInInout(operation))] - data->[parameter.name/] = [parameter.name/]; -[/for] -out->dispatch(event); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Description: This connector is a kind of dummy connector, since it only passes incoming requests to its caller port - - - Minimal connector implementation that does nothing (but passing requests) - - - - - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public methodCall(operation : Operation)] -// put pre-interceptors here -[comment type is a derived property containing the operations return type/] -[if not (operation.type = null)]return [/if]rconn->[operation.cppCall()/]; -// put post-interceptors here -[/template] - - - - - - - - - - C/C++ - cout << "this is a sample pre-call interception" << endl; -rconn-><%cppCall%>; -cout << "this is a sample post-call interception" << endl; - - - - - - - A set of Leader followers is instantiated. Each has its own thread and a semaphore. The LF instance waits on its semaphore. When selectLeader is called, a follower is signaled (semaphore is posted) and will become leader. The leader waits for a resource (e.g. a socket) and becomes executor. - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - for (;;) { - // wait to be become active - m_state = FOLLOWER; - sem_wait (&m_sema); - m_state = LEADER; - listener->select(); // no loop, single select - selectLeader (); - m_state = EXECUTOR; - listener->exec(); -} - - - - - C/C++ - // select a new leader from the followers -for (int i = currentIndex+1, j=0; j<POOL_SIZE; i++, j++) -{ - if (i == POOL_SIZE) { - i = 0; - } - if (sr[i].state == FOLLOWER) { - sem_post (&sr[i].m_sema); - break; - } -} - - - C/C++ - sem_init (&m_sema, 0, 0); -m_state = FOLLOWER; - - - C/C++ - for (int i=0; i<POOL_SIZE; i++) { - pthread_create (&m_sr.m_tID, 0, runStatic, &m_sr[i]); -} - - - C/C++ - ((LeaderFollower *) arg)->run(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Simple provision of typing interface as provided interface - - - Simple provision of typing interface as required interface - - - corba asynchronous messaging (AMI): Provision of poller variant of typing interface. Allows client to continue without waiting for the result - - - corba asynchronous messaging (AMI): Provision of callback variant of typing interface. Allows client Allows client to continue without waiting for the result - - - Data Flow oriented communication: consume passively: provided push operation is called - - - Data Flow oriented communication: produce data via pushing these (calling the required operation) - - - Data Flow oriented communication: produce data via pushing these (calling the required operation) - - - Data Flow oriented communication: produce data via pushing these (calling the required operation) - - - Data Flow oriented communication: consumer data actively by calling the required poll operation - - - In order to support icons, all port kinds are stereotypes, but for Qompass they are classes stereotyped as "PortKind" - - - A bidirectional flow port combining a push-producer and a pull consumer - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - -
    -
    - - - - -
    -
    - - - - - - - - - - - - - - - Is called during component activation & deactivation. The two functions may not block i.e. return control to the caller after "a very short" period - - - Is called during startup. Expected to block. Only one component instance per node may define it. - - - - - - - - - - - - A thread service supporting the LifeCycle port. Once started, it calls the activate operation (via the required port rLC) of a connected component in a new thread of a specific priority (a configuration attribute). This C++ implementation is based on the POSIX pthread library. It will further assume that the execution is done with root privileges, since these are required to set the thread priority. The thread properties assume round-robin (SCHED_RR) scheduling. - - - - Interceptor variant of thread (inherits all, only difference to Thread superclass: tagged as connector) - - - - Priority of the thread. The interpretation of the value is OS specific. In case of POSIX; priorities are only taken into accound for threads with a FIFO and round-robin scheduliung policy. - - - - - - - - - - - - - - - - - - - C/C++ - ((Thread*) arg)->rLC->activate(); -return NULL; - - - - C/C++ - // create thread -pthread_t pt; -pthread_create (&pt, NULL, staticAct, (void *) this); - -// set priority of thread -struct sched_param schedParam; -schedParam.sched_priority = priority; -pthread_setschedparam (pt, SCHED_RR, &schedParam); -// TODO: check return code (in particular, SCHED_RR only works for root) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - events[0] = event; -m_size = 1; -m_cond.signal(); - - - - C/C++ - return m_size; - - - C/C++ - OS_AL::Time::TimeVal wakeup = OS_AL::Time::TimeVal::current(); -wakeup += timeout; -int retCode = m_cond.waitUpto (wakeup); -if (retCode == ETIMEDOUT) { - CallEvent_ event; - event.operationID = ID_TIMEOUT; - return event; -} -m_size = 0; -return events[0]; - - - C/C++ - m_cond.lock(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <<TextualRepresentation>>public abstract writeEvent (in event:BasicCalls::ContainerServices::Event) ; - - - - - - - - - - - - - - - - - - <<TextualRepresentation>>public abstract size () : BasicCalls::Long ; - - - - - - - - - - - - <<TextualRepresentation>>public abstract readEvent(in timeout : BasicCalls::Long) : BasicCalls::ContainerServices::Event ; - - - - - - - - - - - - - - - - - - The period length of the perdioci timer in ticks. Currently, a tick corresponds to 1 ms (simulation time in the underlying OS abstraction layer). It is planned to support VSL expressions, i.e. a value/unit pair. - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - OS_AL::Time::Timer timer; -OS_AL::Time::TimeVal time = OS_AL::Time::TimeVal::current(); -OS_AL::Time::TimeVal period(periodLength); -for (;;) { - tick->tick(); - time += period; - timer.wakeUp(time); -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This rule adds an interceptor for the lifecycle (lc) port. It will use the Thread implementation that executes the activate method in a new thread of a given priority (property of the interceptor implementation) - - - Adds a periodic timer to the container - - - - - - - - - - - - - - - - - - - - - - - - - - - Use for distributed applications - - - - - Use for debugging in general - - - - - Use for tracing. - - - - - - - - - - - - - - - - - - - Elements in this package depend not only on the Interface I (which is a non-owned template parameter taken from the methodCall signature), but also on a class parameter T, which is bound to the component within a container binding. -Be aware that the number of instantiated template packages will be considerably larger compared to a dependency of the interface only - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pthread - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pthread - rt - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.di deleted file mode 100644 index 169236cea8a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.di +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.notation deleted file mode 100644 index d1c8d75a52d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.notation +++ /dev/null @@ -1,1865 +0,0 @@ - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.uml deleted file mode 100644 index 9b65b43823d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.uml +++ /dev/null @@ -1,432 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - Implementation stores an attribute (fixed size array) of template data type - - - This is an implementation of a FIFO of a fixed size (20 elements of the data type it carries). - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - if (m_filled > 0) { - int current_pos = m_pull_pos; - - m_pull_pos ++; - m_filled --; - if (m_pull_pos == m_size) { - m_pull_pos = 0; - } - return m_fifo [current_pos]; -} - - - C/C++ - // copy passed parameters ... -if (m_filled < m_size) { - m_fifo [m_push_pos] = data; - m_push_pos ++; - m_filled ++; - if (m_push_pos == m_size) { - m_push_pos = 0; - } -} - - - C/C++ - return (m_filled > 0); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Simple storage of last data that has been received. Unlike FIFO, data can be read several times. - - - This is an implementation of a FIFO of a configurable size (default: 20 elements). - - - - Configuration attribute: the size of the FIFO - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - if (m_filled > 0) { - int current_pos = m_pull_pos; - - m_pull_pos ++; - m_filled --; - if (m_pull_pos == m_size) { - m_pull_pos = 0; - } - return m_fifo [current_pos]; -} - - - - - - - C/C++ - // copy passed parameters ... -if (m_filled < m_size) { - m_fifo [m_push_pos] = data; - m_push_pos ++; - m_filled ++; - if (m_push_pos == m_size) { - m_push_pos = 0; - } -} - - - - - - - - C/C++ - return (m_filled > 0); - - - C/C++ - !xtend FIFO.activate - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - return m_data; - - - C/C++ - // copy passed parameter ... -m_data = data; - - - - C/C++ - // only return true, once first data has been received -return true; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - return m_data; - - - C/C++ - // copy passed parameter ... -m_data = data; - - - - C/C++ - // only return true, once first data has been received -return true; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.png deleted file mode 100644 index 74dfe916ca6..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.svg b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.svg deleted file mode 100644 index 42b2257c295..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.svg +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.png deleted file mode 100644 index 75ba94039ae..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.svg b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.svg deleted file mode 100644 index bc6bba9e681..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.svg +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.png deleted file mode 100644 index 5fb219bc960..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.svg b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.svg deleted file mode 100644 index ef00466fc55..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.svg +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.png deleted file mode 100644 index f84ec4584ea..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.svg b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.svg deleted file mode 100644 index 3d3f1f8259f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.svg +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.png deleted file mode 100644 index b89b982bf35..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.svg b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.svg deleted file mode 100644 index 7572b29a6d6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.svg +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.png deleted file mode 100644 index 81cf72f17b5..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.svg b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.svg deleted file mode 100644 index 0b555b8f3fc..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.svg +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/In.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/In.png deleted file mode 100644 index 74dfe916ca6..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/In.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/InOut.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/InOut.png deleted file mode 100644 index 75ba94039ae..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/InOut.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Out.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Out.png deleted file mode 100644 index 5fb219bc960..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Out.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Provided.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Provided.png deleted file mode 100644 index f84ec4584ea..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Provided.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/ProvidedRequired.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/ProvidedRequired.png deleted file mode 100644 index b89b982bf35..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/ProvidedRequired.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Required.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Required.png deleted file mode 100644 index 81cf72f17b5..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Required.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/In.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/In.png deleted file mode 100644 index 6a58521116d..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/In.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/InOut.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/InOut.png deleted file mode 100644 index f054cdefbc2..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/InOut.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Out.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Out.png deleted file mode 100644 index 91c7eef436d..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Out.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Provided.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Provided.png deleted file mode 100644 index 9403c7fc698..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Provided.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/ProvidedRequired.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/ProvidedRequired.png deleted file mode 100644 index 6b26d4fcaf6..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/ProvidedRequired.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Required.png b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Required.png deleted file mode 100644 index 569d4d982e9..00000000000 Binary files a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Required.png and /dev/null differ diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.di deleted file mode 100644 index a91f94ef62c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.di +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.notation deleted file mode 100644 index 8686e2eff0d..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.notation +++ /dev/null @@ -1,7725 +0,0 @@ - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.uml deleted file mode 100644 index f5f50bfcf69..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.uml +++ /dev/null @@ -1,11645 +0,0 @@ - - - - - - - - - - - - Declared in MessageBuffer.h, -but outside of the class Section - - - - The message buffer is used to store different data types that can be -added to (read from) the buffer by means of overloaded << (>>) operators. - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - m_data_start = m_buffer; - - - - - - - - C/C++ - return (m_reader_ptr - m_data_start); - - - - - - - - C/C++ - return (m_writer_ptr - m_data_start); - - - C/C++ - m_reader_ptr = m_data_start; - - - C/C++ - m_writer_ptr = m_data_start; - - - C/C++ - resetReader (); - resetWriter (); - - - - C/C++ - m_data_start = m_buffer; - reset (); - - - - - - - - C/C++ - memcpy (m_buffer, msgBuf.m_buffer, MAX_MESSAGE_SIZE); - // m_data_start is modified by a subclass, thus, we cannot simply - // reset m_data_start to m_buffer - m_data_start = m_buffer + (msgBuf.m_data_start - msgBuf.m_buffer); - m_reader_ptr = m_buffer + (msgBuf.m_reader_ptr - msgBuf.m_buffer); - m_writer_ptr = m_buffer + (msgBuf.m_writer_ptr - msgBuf.m_buffer); - - - - - - - - - - - - - - C/C++ - if (m_writer_ptr + size > m_buffer + MAX_MESSAGE_SIZE) { - OSAL_ERROR("Message buffer too small"); - } - memcpy (m_writer_ptr, ptr, size); - // keep alignment of pointers - m_writer_ptr += (size + MB_ALIGNMENT - 1) & (- MB_ALIGNMENT); - - - - - - - - - - - - - - C/C++ - if (m_reader_ptr + size > m_buffer + MAX_MESSAGE_SIZE) { - OSAL_ERROR("read past end of buffer"); - } - memcpy (ptr, m_reader_ptr, size); - m_reader_ptr += (size + MB_ALIGNMENT - 1) & (- MB_ALIGNMENT); - - - - - - - - - - - - - - - - C/C++ - msg.addToBuffer( &bstr.nbytes, sizeof (size_t)); -msg.addToBuffer( bstr.charTable, bstr.nbytes+1); -return msg; - - - - - - - - - - - - - - - - C/C++ - unsigned int length; -msg.getFromBuffer (&length, sizeof (size_t)); -if (length < bstr.charTableSize) { - msg.getFromBuffer (bstr.charTable, length+1); - bstr.nbytes = length; - bstr.current = bstr.charTable; -} -return msg; - - - - - Copy constructor for a message buffer. Needed to adjust - read and write pointers after copying - - - - - - - - - - Reset the reader pointer into the message buffer - - - - - Reset the writer pointer into the message buffer - - - - - Reset the reader and writer pointer into the message buffer - - - - - - - - - - - - - - - - - - - Method used to add a value to the buffer. Don't use this - method but the overloaded << operator. - - - - - - - - - - - - - - - Method used retrieve a value from the buffer. Don't use this - method but the overloaded >> operator. - - - - - - - - - - - - - - - This constructor is there fore efficiency reasons: it does not - initialize the reader and writer pointers. It is used by subclasses - that modify the data_start and therefore need to invoke reset - afterwards. Thus, it prevents that reset is called multiple times. - - - - - - - - - declare specific marshalling operators for BString, since -(1) this is more efficient -(2) a memory copy based marshalling would copy pointers that become - bogus in a different address space. - - - - - - - - - - - - - - - - - - - - - - - - - - - A Message Header that is prefixed to all messages - - - - - - - - - - - - - - - - - - - - - - - - - This subtype of MessageBuffer adds a MessageHeader at the beginning. -For the sake of efficiency, the storage of the header is mapped directly -into the buffer (works only for homogeneous architectures). - - - - - - - - C/C++ - return (MessageHeader *) m_buffer; - - - - - - - - C/C++ - getHeader ()->msgType = msgType; - - - - - - - - C/C++ - return (getHeader ()->sender == ProDesc::getZoneNumber ()); - - - C/C++ - m_data_start += sizeof (MessageHeader); - reset (); - - - - - - - - C/C++ - m_data_start += sizeof (MessageHeader); - - - - - - - C/C++ - - - - C/C++ - getHeader ()->sender = ProDesc::getZoneNumber (); - - - - - define a copy constructor (which does nothing besides calling the - copy constructor of the super class) - - - - - - - - - needs to be called for each allocated instance. The initialization of - the zone number has been removed from the constructor, since the zone - number is not defined at compile time [todo: would that be a good - idea?] and its initialization would not work for statically declared - messages. - initZoneNumber is called by Message's init function. - - - - - set the message type (see MsgType constant definition in - ToChannel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - start of the shared memory section - - - - - - - - start for user data within the shared memory section (after Mutex) - - - - - - - - current address for new allocations - - - - - - - - - - - - C/C++ - return m_address0; - - - - - - - C/C++ - return &m_name; - - - - - - - C/C++ - return m_mutex; - - - - - - - - C/C++ - return m_key; - - - - - - - - C/C++ - return m_id; - - - - - - - - C/C++ - return shmSize; - - - - - - - - C/C++ - shmSize = cr_operand; - - - C/C++ - set_shmSize (-1); - // constructor without args is useful e.g. for use as element of an array - - - - - - - - - - - - - - - - - - - - - - - C/C++ - set_shmSize (-1); - - int r; - -#ifdef SYNCHRO_VxWorks - r = openIntern (char1, 0, 0, size, synchro); -#else - r = openIntern (char1, O_RDWR | O_CREAT, 0777, size, synchro); -#endif - if (r == -1) - OSAL_ERROR ("ON open(O_RDWR | O_CREAT, ...)"); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - int r; - - m_name = name; -#ifdef SYNCHRO_VxWorks - r = openIntern (char1, 0, 0, size, synchro); -#else - r = openIntern (char1, O_RDWR | O_CREAT, 0777, size, synchro); -#endif - - return r; - - - - - - - - - - - - - - C/C++ - void * r; - - r = (void *) m_address; - char * newAddr; - - newAddr = m_address + itemSize; - if (newAddr - m_address0 > shmSize) - { - BString500 s1 ("allocation fails: shared memory '"); - OSAL_ERROR (s1 << m_name.data () - << "' : shmSize= " << shmSize << " is too small"); - } - - m_address = newAddr; - - return r; - - - - - - - - - C/C++ - int r = 0; - -#if defined SYNCHRO_Linux - //cout<<"SHM name : "<<m_name.data()<<endl; - r = shm_unlink (m_name.data ()); - //if(r == -1) - // PRINTerr("ON shm_unlink"); - -#elif defined SYNCHRO_Solaris || defined SYNCHRO_Cygwin - if (m_id != -1) - { - r = shmdt (m_address00); // detach - if (r == -1) - PRINTerr ("ON shmdt (m_address)"); - else - { - struct shmid_ds semStat; - r = shmctl (m_id, IPC_STAT, &semStat); - if (r == -1) - PRINTerr ("ON shmctl(m_id, IPC_STAT, )"); - else if (semStat.shm_nattch == 0) - { /**** Only for the last process coming here ****/ - r = shmctl (m_id, IPC_RMID, NULL); - if (r == -1) - PRINTerr ("ON shmctl( ,IPC_RMID, )"); - //essai DS 7/11/02 pour virer les fichiers *.shmKey - //mais n'a pas l'air de marcher en Solaris 2.7 - // et gnu - //::unlink(m_name.data()); // remove the file system entry, - // BUT so, 'key' would not be const - } - } - } -#endif - - return r; - - - - C/C++ - if (m_mutex != NULL) { - delete m_mutex; - } - unlink (); - - - - - - - - - - - - - - - - - - - C/C++ - if (creator) - { - /**** Only for the 1st process coming here ****/ - // 4-- check if shared memory is filled with 0 - for (int i = 0; i < size; ++i) -#ifndef SYNCHRO_VxWorks - if (m_address00[i]) - { - BString500 s1 ("shm zone not clean. DO : ipcrm -M "); - OSAL_ERROR (s1 << (long) m_key); - } -#else - m_address00[i] = '\0'; -#endif - // 5- If access synchronisation is wanted, use of a shared mutex - if (synchro) - { - // a mutex needs to be allocated in shared memory - // and initialised once - m_mutex = new (allocate (sizeof (SM_Mutex))) SM_Mutex (); - m_address0 = m_address; // Hide this first item - } - } - else - { - /**** for next processes : allocate, but not initialize ****/ - // we need a semaphore to block up to the end of the - // zone memory initialuzation - // 5- If access synchronisation is wanted, use of a shared m_mutex - if (synchro) - { - // a mutex needs to be allocated in shared memory - m_mutex = (SM_Mutex *) allocate (sizeof (SM_Mutex)); - m_address0 = m_address; // Hide this first item - } - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - TRACEpr (VM); - PR (showI); - - int r = 0; - - shmSize = size; // required size - if (synchro) - size += sizeof (SM_Mutex); // useful size - -//============================================================ -#if defined SYNCHRO_Linux - // creation of a new segment - r = m_id = shm_open (m_name.data (), oflag, 00777); - if (m_id == -1) - { - OSAL_ERROR ("ON shm_open"); - } - // the returned id is a file descriptor. Thus, the size of the - // memory identified by the descriptor can be set via ftruncate - if (ftruncate (m_id, size) == -1) - OSAL_ERROR ("ON ftruncate"); - // mapping memory - m_address00 = - (char *) mmap (0, size, PROT_READ | PROT_WRITE, MAP_SHARED, m_id, 0); - - if (m_address00 == MAP_FAILED) - OSAL_ERROR ("ON mmap"); - // creation of a mutex at the address m_address00 - m_mutex = (SM_Mutex *) m_address00; - // address0 : adress of the start of the available segment - m_address0 = m_address00 + sizeof (SM_Mutex); - //address : current adress - m_address = m_address0; - -//============================================================ - -#elif SYNCHRO_VxWorks - - // 'm_name' specified a physical address visiable for the CPU - /* currently not used - long memPart; // memory partition - m_name.setBase (16); - m_name >> memPart; - */ - - #ifdef MultiCPU // for multi CPU, with optional VxMP component - //--- See VxWorks5.3.1 Programmer's Guide, Example 6-3 ------- - // [todo the system partition is preallocated, but where du we see - // the generation of the kernel? sysMemTop()?] - { - SEM_ID localSemId; - typedef struct shared_buff - { - SEM_ID semSmId; - char buff[]; // [size CHUNK_SIZE ?] - } SHARED_BUFF; - SHARED_BUFF *laOfAlSMB; // local address of shared memory block - SHARED_BUFF *gaOfAlSMB; // global address of shared Memory block - int objType; - - // is this the first demand of the 'shared memory block' of the - // system partition? - r = smNameFind (m_name.data (), (void **) &gaOfAlSMB, &objType, - WAIT_FOREVER); - if (r == -1 && errno != S_smNameLib_NAME_NOT_FOUND) - OSAL_ERROR ("ON smNameFind()"); - if (r == OK) - { - // CREATION - laOfAlSMB = (SHARED_BUFF *) smMemMalloc (size); - if (laOfAlSMB == NULL) - OSAL_ERROR ("ON smMemMalloc()"); - m_address = m_address0 = m_address00 = laOfAlSMB; - - if (synchro) - { - localSemId = semBSmCreate (SEM_QFIFO, SEM_EMPTY); - if (localSemId == NULL) - OSAL_ERROR ("ON semBSmCreate()"); - laOfAlSMB->semSmId = (SEM_ID) htonl ((int) localSemId); - } - - r = (char *) smNameAdd (m_name.data (), - (void *) smObjLocalToGlobal (laOfAlSMB), - T_SM_BLOCK); - if (r == -1) - OSAL_ERROR ("ON smNameAdd()"); - - if (synchro) - { - r = semGive (localSemId); - if (r == -1) - OSAL_ERROR ("ON semGive()"); - } - init1 (TRUE, synchro, size); - } - else - { - // RE-UTILISATION - laOfAlSMB = (SHARED_BUFF *) smObjGlobalToLocal (gaOfAlSMB); - m_address = m_address0 = m_address00 = laOfAlSMB; - localSemId = (SEM_ID) ntohl ((int) laOfAlSMB->semSmId); - if (synchro) - { - r = semTake (localSemId, WAIT_FOREVER); - if (r == -1) - OSAL_ERROR ("ON semTake()"); - } - } - // --------------------------------------------------------------- - } - #else // monoCPU - #ifdef OutOfHeap - id = (int) memPartCreate (m_address00, size); - if (id == NULL) - OSAL_ERROR ("ON memPartCreate()"); - m_address00 = memPartAlloc (m_id, size /* -?? */ ); - if (m_address00 == NULL) - OSAL_ERROR ("ON memPartAlloc()"); - #else - m_address00 = new char[size]; - #endif - m_address = m_address0 = m_address00; - init1 (TRUE, synchro, size); // 1 seul process (createur) - #endif - - // ============================================================ - -#elif defined SYNCHRO_Solaris || defined SYNCHRO_Cygwin - m_name << ".shmKey"; // add a suffix to recognize it with Ipcrm - - // 1- Get the key from the name ---------------------------------------- - - // #define GET_KEY 1 //--- version proposed by SUN, BUT - // the key returned by ftok() is: 0xCHMMMINO - // CH is the character char1 - // INO is the inodenumber of the file & 0xFFF - // MMM is the minor unit number of the file system, but if the file - // system is mounted via NFS, it is not guaranted to find the - // same minor number after a reboot which prevents us to conserve - // this number within a script for its destruction -// #define GET_KEY 2 //--- version perso -#define GET_KEY 1 -#if GET_KEY == 1 - while (m_key == -1) - { - m_key = ftok (m_name.data (), char1); - if (m_key == -1) - { - int fd =::creat (m_name.data (), 00777); - if (fd == -1) - { - BString500 s1 ("ON ::creat('"); - OSAL_ERROR (s1 << m_name << "', 00777)"); - } - close (fd); - } - } -#else // GET_KEY == 2 - int fd =::creat (m_name.data (), 00777); - if (fd == -1) - { - BString500 s1 ("ON ::creat('"); - OSAL_ERROR (s1 << m_name.data () << "', 00777)"); - } - struct stat st; - if (fstat (fd, &st) == -1) { - OSAL_ERROR ("ON fstat(fd, &st)"); - } - - // inode number is unique inside a filesystem - m_key = (st.st_ino + classKey) & 0xFFFFFF; - // (st_ino,st_dev) uniquely identifies regular files - // but ino_t and dev_t are of type ulong_t: too large for a m_key ! - - m_key |= ((char1 & 0xFF) << 24); - // m_key = 0xCHINODEI does not guarantee uniqueness for the same inode on - // two file systems - // but ftok() guarantees less (+ dependency de mount NFS ...) - close (fd); - -#endif //--- GET_KEY - -#define ATT_SHM 2 - // 1 shmget(IPC_CREAT | IPC_EXCL): in case of no error - // it is for the creator, who makes initializations - // although it is not the first attached. - - // 2- Get the shared memory identifier --------------------------------- - -#if ATT_SHM == 1 - r = m_id = shmget (m_key, size, 00777 | IPC_CREAT); - if (r == -1) - OSAL_ERROR ("ON shmget(m_key, size, 00777 | IPC_CREAT)"); - - // 3 - Attach the shared memory to an address in the calling - // address-space (zone) - m_address = m_address0 = m_address00 = (char *) shmat (m_id, 0, 0); - if ((int) m_address0 == -1) - OSAL_ERROR ("ON shmat(m_id, )"); - - { - // CriticalSection. Who is taking it? - struct shmid_ds stat; - r = shmctl (m_id, IPC_STAT, &stat); - if (r == -1) - OSAL_ERROR ("ON shmctl(shmId, IPC_STAT, )"); - init1 (stat.shm_nattch < 2, synchro, size); - } - -#else // ATT_SHM == 2 -------------------------------------------------- - bool creator; - errno = 0; - r = m_id = shmget (m_key, size, 00777 | IPC_CREAT | IPC_EXCL); - if (r == -1) - { - if (errno == EEXIST) - { - r = m_id = shmget (m_key, size, 0); - // we know we are not the creator (first who demands) of the zone - creator = FALSE; - if (r == -1) - OSAL_ERROR ("ON shmget(m_key, size, 0)"); - } - else - OSAL_ERROR ("ON shmget(m_key, size, IPC_CREAT | IPC_EXCL)"); - } - else - { - // For the creator of this shared memory: - creator = TRUE; - } - - // 3 - Attach the shared memory to an address in the calling - // address-space (zone) - m_address = m_address0 = m_address00 = (char *) shmat (m_id, 0, 0); - if ((int) m_address0 == -1) - OSAL_ERROR ("ON shmat(m_id, )"); - - init1 (creator, synchro, size); -#endif // ATT_SHM - -#endif // SYNCHRO_Solaris || SYNCHRO_Cygwin - // ============================================================ - - PR ("for " << m_name << " , m_key= " << (long) m_key - << ", required size= " << shmSize << ", effective size= " - << size << showI - << ", adr00 = " << (void *) m_address00 - << ", adr0 = " << (void *) m_address0 - << ", adr = " << (void *) m_address << showI); - - return r; - - - - - - create a new shared memory segment. The constructor will call the - method open. See open for a description of the parameters. - - - - - - - - - - - - - - - - - - - - - - - - - - The passed name is a path name (which must refer to an existing, - accessible file). Together with the least significant 8 bits of - char1 (which must be nonzero) a key for the access is generated. - - oflag is not used. - - If synchro is TRUE, an instance of class SM_Mutex is place at the - begin of the segment, increasing its size. The first process - establishing a connection that to ensure that the segment is - initialized with zeros. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - return the segment address (if existent) of the current process - This address is might not be the same for all processes, but all - addresses point to the same place. - - - - - - - - - - - - - - - - Returns the address of an element of size itemSize. If the sequence - of successive allocate calls is the same for all communicating - processes, they share the same view of the segment organization. - If there is not enough space for the item, the process is stopped - with an error message. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Dependency is problematic, since pthread is not used by all OS - - - - Abstraction of an operating system thread. It is possible to control -priorities and the thread's lifecycle (suspend/resume/exit). - -\code -Example: - -class Run { -void run (); -static void run_fct (void * arg); -} - -void Run::run_fct (void * arg) -{ -((Run*) myThreadCode)->run (); -} - -void Run::run () -{ -// do something ... -} - -Thread myThread ("MyThread"); -myThread.exec (myThreadCode); -\endcode - - - - - - - - - - - - - - A thread also has a name that should be provided by the constructor -It is primarily used to enhance the readability of the trace output. - - - - - - - The semaphore is used for different purposes in vxWorks and -Linux/Solaris, respectively. - - - - - - - - - - - - - - - - - - - - in case, of a joinable thread, this attribute indicates whether the -thread has already been joined. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - return m_threadAttributes; - - - - - - - - C/C++ - return m_threadAttributes.getDetached (); - - - - - - - C/C++ - m_name = name; - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - TRACEpr (VM); - PR ("Thread::Thread (...)" << showI); - - if (attrPtr != NULL) { - m_threadAttributes = *attrPtr; - } - int r = exec (startRoutine, arg, exPrio); - - if (r < 0) { - OSAL_ERROR ("could not exec thread"); - } - - set_of_threads.append (this); - - - - - - - - - - - - C/C++ - if (attrPtr != NULL) { - m_threadAttributes = *attrPtr; - } - - set_of_threads.append (this); - - - - C/C++ - TRACEpr (VM); - PR ("Thread::~Thread () : isDetached () = " << isDetached () - << ", m_joined= " << m_joined << showI); - - if (!isDetached () && !m_joined) { - // don't join, if thread hasn't been executed yet. - if (m_threadId != 0) { - PR ("really delete thread, m_threadId: " << m_threadId << showI); - join (); - } - } - set_of_threads.eraseValue (this); - - - - C/C++ - TRACEpr (VM); - PR ("Thread::initZ ()" << showI); - -#if defined THREAD_VxWorks - bool stackFill = ProDesc::isEnvTrue ("A_StackFill"); - m_vx_options = VX_FP_TASK | (stackFill ? 0 : VX_NO_STACK_FILL); -#elif defined THREAD_Linux || defined THREAD_POSIX4 - m_suspendPriority = 1; // lowest priority for SCHED_RR/SCHED_FIFO -#endif - - - - - - - - - - - - - - C/C++ - // blocked by default -modifySigMask (SIG_BLOCK, SIGRTMIN); -((Thread*) arg)->entryRoutine (); - - - - - - - - C/C++ - #if defined THREAD_POSIX4 - return pthread_self (); - -#elif defined THREAD_Solaris - return thr_self (); - -#elif defined THREAD_VxWorks //-VxW - return taskIdSelf (); -#endif - - - - - - - - C/C++ - ThreadId id = getId (); - for (int i = 0; i < set_of_threads.size (); i++) { - if (set_of_threads.get(i)->m_threadId == id) { - return set_of_threads.get(i)->m_name; - } - } - return threadName_main; - - - - - - - - - C/C++ - TRACEpr (VM); - PR ("Thread::getPriority ()" << showI); - - int priority; - -#if defined THREAD_POSIX4 - SchedParam schedParam; - int policy; - if (pthread_getschedparam (getId (), &policy, &schedParam)) { - OSAL_ERROR ("ON pthread_getschedparam(...)"); - } - priority = schedParam.sched_priority; - -#elif defined THREAD_Solaris - - // errno= thr_getprio(thr_self(), &pri); - // if (errno) OSAL_ERROR("ON thr_getprio()"); - - pcparms_t params; - params.pc_cid = PC_CLNULL; - long l; - l = priocntl (P_LWPID, _lwp_self (), PC_GETPARMS, (caddr_t) & params); - if (l == -1L) - OSAL_ERROR ("ON priocntl( , PC_GETPARMS, )"); - - rtparms_t *rtParms = (rtparms_t *) params.pc_clparms; - prio = rtParms->rt_pri; - -#elif defined THREAD_VxWorks - if (taskPriorityGet (taskIdSelf (), &prio)) //-VxW - OSAL_ERROR ("ON taskPriorityGet()"); -#endif - - return priority; - - - - - - - - - C/C++ - TRACEpr (VM); - PR ("Thread::setPriority (" << prio << "), old prio: " - << getPriority () << showI); - -#if defined THREAD_POSIX4 - SchedParam schedParam; - schedParam.sched_priority = prio; - - if (pthread_setschedparam (getId (), m_policy, &schedParam)) { - OSAL_ERROR ("ON pthread_setschedparam (...)"); - } - -#elif defined THREAD_Solaris - pcparms_t params; - params.pc_cid = ProDesc::_classId (); - long l; - - rtparms_t *rtParms = (rtparms_t *) params.pc_clparms; - rtParms->rt_pri = prio; - rtParms->rt_tqsecs = 0; - rtParms->rt_tqnsecs = RT_NOCHANGE; - l = priocntl (P_LWPID, _lwp_self (), PC_SETPARMS, (caddr_t) & params); - if (l == -1L) - { - BString500 tmp ("to pri= "); - tmp << prio << ", ON priocntl( , PC_SETPARMS, )"; - OSAL_ERROR (tmp); - } - -#elif defined THREAD_VxWorks - if (taskPrioritySet (taskIdSelf (), prio)) //-VxW - OSAL_ERROR ("ON taskPrioritySet()"); -#endif - PR (" after setting, prio= " << getPriority () << showI); - - - - - - - - - C/C++ - return ProDesc::getPrioMax (); - - - - - - - - - - - - - - - - C/C++ - TRACEpr (VM); - PR ("Thread::changeSigMask (...)" << showI); - -#if defined THREAD_POSIX4 || defined THREAD_Linux - errno = pthread_sigmask (how, newSet, oldSet); - if (errno) { - OSAL_ERROR ("ON pthread_sigmask()"); - } -#elif defined THREAD_Solaris - errno = thr_sigsetmask (how, newSet, oldSet); - if (errno) { - OSAL_ERROR ("ON thr_sigsetmask()"); - } -#elif defined THREAD_VxWorks - if (sigprocmask (how, newSet, oldSet)) { //-VxW - OSAL_ERROR ("ON sigprocmask()"); - } -#endif - - - - - - - - - - - - - - C/C++ - sigset_t sigSet; - if (sigemptyset (&sigSet) == -1) { - OSAL_ERROR ("ON sigemptyset( )"); - } - if (sigaddset (&sigSet, signalID) == -1) { // add 'sig' as a signal - OSAL_ERROR ("ON sigaddset( )"); - } - - Thread::changeSigMask (how, &sigSet, NULL); // modify signal mask - - - - C/C++ - sigset_t sigSet; - changeSigMask (SIG_UNBLOCK, NULL, &sigSet); // get current signal mask - - PRINTpr ("signals to block for current thread "); - PR (" : \n\t\t"); - - for (int s = 1; s < SIGRTMAX; ++s) { - if (sigismember (&sigSet, s)) - { -#ifdef SYSTEM_VxWorks - PR (s << ", "); -#else - PR (strsignal (s) << ", "); -#endif - } - } - - PR (showI); - - - - - - - - - C/C++ - TRACEpr (VM); - PR ("Thread::exit ()" << showI); - -#if defined THREAD_POSIX4 || defined THREAD_Linux - throw ("Thread::exit() : throw()"); // an attempt for exception catching - pthread_exit (status); - -#elif defined THREAD_Solaris - throw ("Thread::exit() : throw()"); // an attempt for exception catching - thr_exit (status); - -#elif defined THREAD_VxWorks - // throw("Thread::exit(): throw()"); => 'use -fhandle-exceptions to enable' - // but VxWorks does not support C/C++ exceptions - int code = status ? *(int *) status : 0; - ::exit (code); -#endif - - - - - - - - - - - - - - - - - - - - - - - C/C++ - // NEW 3/01 : added argument execPrio -m_startRoutine = startRoutine; // save pointer for entryRoutine -m_startArg = arg; // save pointer for entryRoutine -m_execPrio = execPrio; // demanded priority - -m_threadAttributes.getDetached (); - -#if defined THREAD_POSIX4 - - pthread_attr_t attributes; - pthread_attr_init (&attributes); - pthread_attr_setdetachstate (&attributes, - (isDetached () ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE)); - if (m_threadAttributes.getStackAddr () != NULL) { -#ifdef THREAD_LINUX - pthread_attr_setstack (&attributes, - m_threadAttributes.getStackAddr (), - m_threadAttributes.getStackSize ()); -#endif - } - else if (m_threadAttributes.getStackSize () != 0) { - pthread_attr_setstacksize (&attributes, - m_threadAttributes.getStackSize ()); - } - - if (execPrio != DefaultExecPrio) { - if (m_RTthreads) { - pthread_attr_setinheritsched (&attributes, PTHREAD_EXPLICIT_SCHED); - } - pthread_attr_setschedpolicy (&attributes, m_policy); - sched_param sp; - sp.sched_priority = execPrio; - pthread_attr_setschedparam (&attributes, &sp); - } - - errno = pthread_create (&m_threadId, &attributes, - entryRoutC, (void *) this); // , startRoutine, arg - -#elif defined THREAD_Solaris - long flags = THR_BOUND; // THR_NEW_LWP leads to SIGLWP; - if (ProDesc::existEnv ("A_ThreadFlags")) - { - OS_AL::Util::BString500 s (ProDesc::getEnv ("A_ThreadFlags")); - if (s == "THR_BOUND") - flags = THR_BOUND; - else if (s == "THR_NEW_LWP") - flags = THR_NEW_LWP; - else - OSAL_ERROR - ("Recognised values for A_ThreadFlags : THR_BOUND, THR_NEW_LWP."); - } - if (isDetached ()) { - flags |= THR_DETACHED; - } - errno = thr_create ( - m_threadAttributes.getStackAddr (), - m_threadAttributes.getStackSize (), - (PfAvpRvp) entryRoutC, (void *) this, // , startRoutine, arg - flags, &thrId); - -#elif defined THREAD_VxWorks - if (execPrio == DefaultExecPrio) - { - // priority of this tasks inherits by current tasks - if (taskPriorityGet (taskIdSelf (), &m_execPrio)) //-VxW - PRINTerr ("ON taskPriorityGet()"); - } - m_threadId = - taskSpawn (NULL, m_execPrio, m_vx_options, - (int) m_threadAttributes.getStackSize (), - (FUNCPTR) entryRoutC, (int) this, 0, 0, 0, 0, 0, 0, 0, 0, 0); - if (m_threadId != -1) - errno = 0; // OK - -#endif - if ((errno && (errno != EINTR))) { - if (errno == EPERM) { - OS_AL::Util::Print warning; - warning << "warning: insufficient permission to create rt-thread (must be root)" << showI; - if (m_RTthreads) - { - warning << "falling back to non-rt threads" << showI; - m_RTthreads = false; - // retry exec - // use "return" to avoid that semaphore wait is executed twice - return exec (startRoutine, arg, execPrio); - } - } - else { - OSAL_ERROR (OS_AL::Util::BString50 ("thread_create() failed with code ") << errno); - } - } - -#if defined THREAD_POSIX4 || THREAD_Linux || THREAD_Solaris - // No error on thread_create... continue - m_semaphore.wait(); - -#endif -TRACEpr (VM); -PR ("return." << showI); -return errno; - - - - C/C++ - #if defined THREAD_Solaris - lwpId = _lwp_self (); -#endif -#if !defined THREAD_VxWorks // else done in taskSpawn () - // synchronization to force the system to start this thread - // [todo: necessary?] - m_semaphore.post (); -#endif - -m_startRoutine (m_startArg); // go to user function - -#ifdef THREAD_VxWorks - if (!isDetached ()) - m_semaphore.post (); -#endif - -m_threadId = (pthread_t) ThExecOUT; // quasi completed - - - - - - - - - C/C++ - pthread_t currentId; - -#if defined THREAD_POSIX4 || defined THREAD_Linux - currentId = pthread_self (); - -#elif defined THREAD_Solaris - currentId = thr_self (); - -#elif defined THREAD_VxWorks - currentId = taskIdSelf (); //-VxW -#endif - -return (currentId == m_threadId); - - - - - - - - - - - - - C/C++ - return (otherThread.m_threadId == m_threadId); - - - - - - - - C/C++ - TRACEpr (VM); -PR ("Thread::resume ()" << showI); - -OS_AL::Util::Print pr2; -pr2 << "in resume" << showI; -int r = 0; - -if (m_threadId == 0) - OSAL_ERROR ("call exec() first"); - -if ((int) m_threadId != ThExecOUT) -{ // Execution not completed -#if defined THREAD_POSIX4 - // version that uses priority modification - SchedParam schedParam; - schedParam.sched_priority = m_execPrio; - r = pthread_setschedparam (m_threadId, m_policy, &schedParam); - - if (r && r != ESRCH) { - OS_AL::Util::Print pr; - pr << "Thread::resume: cannot change thread priority. Are you root?" - << showI; - } - -#elif defined THREAD_Solaris - r = thr_continue (m_threadId); - // only ESRCH is possible - -#elif defined THREAD_VxWorks - if (taskResume (m_threadId) == -1) { //-VxW - r = errno; - } - else { - r = 0; - } - -#endif -} -else { - r = 0; // Execution has been completed -} - -return r; - - - - - - - - - C/C++ - TRACEpr (VM); -PR ("Thread::suspend ()" << showI); - -int r = 0; - -if (m_threadId == 0) { - OSAL_ERROR ("Thread::suspend (): call exec() first"); -} -OS_AL::Util::Print pr2; -pr2 << "in suspend" << showI; - -if ((int) m_threadId != ThExecOUT) -{ -#if defined THREAD_POSIX4 || defined THREAD_Linux - // suspend by setting priority to a low value. Only works for root - SchedParam schedParam; - schedParam.sched_priority = m_suspendPriority; - - if (pthread_setschedparam (m_threadId, m_policy, &schedParam) != 0) { - OS_AL::Util::Print pr2; - pr2 << "Thread::suspend: cannot change thread priority. Are you root?" - << showI; - } -#elif defined THREAD_Solaris - // version with real suspension: - r = thr_suspend (m_threadId); - // only ESRCH is possible -#elif defined THREAD_VxWorks - if (taskSuspend (m_threadId) == -1) { //-VxW - r = errno; - } - else { - r = 0; - } -#endif -} -else { - OSAL_ERROR ("Execution has been completed."); -} -return r; - - - - C/C++ - TRACEpr (VM); -PR ("Thread::runBackground ()" << showI); - -OS_AL::Util::Print pr2; -pr2 << "run background" << showI; -if (m_threadId == 0) { - OSAL_ERROR ("Tread::runBackground (): call exec() first"); -} - -if ((int) m_threadId != ThExecOUT) { - int backgroundPriority = 0; // background priority - setPriority (backgroundPriority); -} -else { - OSAL_ERROR ("Execution has been completed."); -} - - - - - - - - - C/C++ - TRACEpr (VM); -PR ("Thread::join (...)" << showI); - -if ((int) m_threadId != ThExecOUT) -{ - int r; - - if (isDetached ()) { - errno = EINVAL; // join is forbiden (and not necessary) - } - else { // attached - if (m_joined) { - errno = EINVAL; // already joined - } - else { -#if defined THREAD_POSIX4 || defined THREAD_Linux - PR ("join thread 1" << showI); - // if (pthread_equal (m_threadId, pthread_self ()) == 0) - { - PR ("join thread 2" << showI); - r = errno = pthread_join (m_threadId, status); - } -#elif defined THREAD_Solaris - errno = 0; - r = errno = thr_join (m_threadId, NULL, status); - -#elif defined THREAD_VxWorks - m_semaphore.wait (); - m_joined = true; -#endif - -#if defined THREAD_POSIX4 || defined THREAD_Linux || defined THREAD_Solaris - if (r == 0) { - m_joined = true; - } -#endif - } - } - if (errno && (errno != ESRCH)) { - OSAL_ERROR ("join of threads failed"); - } -} -// else Execution has been completed. OK. - - - - - - - - - C/C++ - TRACEpr (VM); - PR ("Thread::cancel ()" << showI); - - int r; - - if (m_threadId == 0) - OSAL_ERROR ("call exec() firstly."); - - if ((int) m_threadId != ThExecOUT) - { -#if defined THREAD_POSIX4 || defined THREAD_Linux - // treat as well? setCancelState(), setCancelType(), testCancel(), - // cleanupPush(), cleanupPop() ?? - r = errno = pthread_cancel (m_threadId); -#elif defined THREAD_Solaris - r = errno = thr_kill (m_threadId, CancelThSIG); - -#elif defined THREAD_VxWorks - // use taskSafe() and taskUnsafe() ?? - r = taskDelete (m_threadId); - -#endif - - if (errno) - { - OS_AL::Util::BString500 tmp ("m_threadId= "); - tmp << m_threadId; - OSAL_ERROR (tmp); - } - } - else - r = 0; // Execution has been completed. OK. - - return r; - - - - - create a new thread. The passed parameter @param name is used to -identify the thread in the trace files. - -By default, the Thread will block the SIGRTMIN signal which is -used by class Timer - - - - - - - - - - - - - - - - - - - - - - - - - - - - create a new thread by passing its name and optionally a -pointer to ThreadAttributes. - -By default, the Thread will block the SIGRTMIN signal which is -used by class Timer - - - - - - - - - - C++ - NULL - - - - - - - initialize the suspend priority of threads in this zone -and the suspension mode (static method). This method has to -be called during the application startup. - - - - - This routine wraps the thread execution (static method) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - provides access to the thread attributes (also for modification) - - - - - - - - - denotes whether the thread is detached or joinable - - - - - - - - - - changes the signal mask for the calling thread as described by -the how and newmask arguments. If oldmask is not NULL, the previous -signal mask is stored in the location pointed to by oldmask. - -The meaning of the how and newmask arguments is the same as for -sig-procmask(2). If how is SIG_SETMASK, the signal mask is set to -newmask. -If how is SIG_BLOCK, the signals specified to newmask are added to -the current signal mask. -If how is SIG_UNBLOCK, the signals specified to newmask are removed -from the current signal mask. -Recall that signal masks are set on a per-thread basis, but signal -actions and signal handlers, as set with sigaction(2), are shared -between all threads. - - - - - - - - - - - - - - - - - - similar changeSigMask, used by Main and ServiceRequest classes. -Compared to changeSigMask, it is more convenient to use if a single -signal is modified, since the user does not have to create a set and -add the signal to it. - - - - - - - - - - - - - - - - - - - - - - - This method initiates the execution of a new thread. The new thread -will start the entryRoutine, which acts as a wrapper for the execution -of the passed startRoutine. The parameter arg will be passed to it -(often a "this" pointer, if a static method is passed). - -The last parameter is the Tasks priority. It is optional, if not -given, the priority has a default value. - -Don't confuse this method with the Task::exec which will execute -periodic tasks. - - - - - - - - - - - - - - - - - - - - - - - - - - checks whether the currently executing thread has the same ID as -the one for which this operation is called - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Attributes of a thread, i.e. stack information and whether a thread -is detached (becomes independent from initiator) or joinable (it -can be/has to be explicitly joined by the thread initiator). - -=> see pthread documentation - - - - - - - - - - - - - - - - - - - - - - - C/C++ - return m_stackSize; - - - - - - - - C/C++ - m_stackAddress = stackAddress; - - - - - - - - C/C++ - return m_stackAddress; - - - - - - - - C/C++ - m_detached = detached; - - - - - - - - C/C++ - return m_detached; - - - C/C++ - m_stackAddress = NULL; -#if defined THREAD_POSIX4 || THREAD_Linux - m_stackSize = 0; // use defaults from system -#else - m_stackSize = 0x10000; // default values : 64 Kbytes -#endif - m_detached = true; - - - - - - - - - - - - - - C/C++ - #ifdef THREAD_LINUX - if (stackSize != 0 && stackSize < PTHREAD_STACK_MIN) { -#else - if (stackSize != 0) { -#endif - return -EINVAL; - } - else - { - m_stackSize = stackSize; - return 0; - } - - - - - create a thread with default attributes: -- a stack address chosen by the system -- a stack size of 64K in case of Solaris and vxWorks - or the system default, in case of Linux -- detached - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - return m_argc; - - - - - - - - C/C++ - return m_argv; - - - - - - - - - - - - - C/C++ - return m_argv[pos]; - - - - - - - C/C++ - m_zoneName = zoneName; - - - - - - - C/C++ - return m_zoneName; - - - - - - - - C/C++ - #if defined SYSTEM_POSIX4 - return getpid (); -#elif defined SYSTEM_Solaris - return getpid (); -#elif defined SYSTEM_VxWorks - return Thread::getMyId (); -#else - SYSTEM_x_not_defined; - return -1; -#endif - - - - - - - - - C/C++ - #if defined SYSTEM_POSIX4 - return getppid (); -#elif defined SYSTEM_Solaris - return getppid (); -#elif defined SYSTEM_VxWorks - return -1; -#else - SYSTEM_x_not_defined; - return -1; -#endif - - - - - - - - - C/C++ - return m_pauseOnErr; - - - - - - - - C/C++ - return m_classId; - - - - - - - - C/C++ - return m_numberOfProcesses; - - - - - - - - C/C++ - return m_policy; - - - - - - - - C/C++ - TRACEpr (F9); -m_sigOnErr = errSig; - -m_pauseOnErr = isEnvTrue ("A_PauseOnErr"); -errno = 0; - -if (existEnv ("A_NumberOfProcesses")) -{ - m_numberOfProcesses = atoi (getEnv ("A_NumberOfProcesses")); - if (m_numberOfProcesses < 1) - { - OSAL_ERROR - ("The environment variable 'A_NumberOfProcesses' must be > 0"); - } -} - -#if defined SYSTEM_Solaris - pcparms_t params; - params.pc_cid = PC_CLNULL; // To force update of pc_cid - long l; - l = priocntl (P_PID, getPid (), PC_GETPARMS, (caddr_t) & params); - if (l == -1L) - OSAL_ERROR ("ON priocntl( , PC_GETPARMS, )"); - classId = params.pc_cid; - - pcinfo_t infos; - infos.pc_cid = classId; // Infos about current process - l = priocntl ((idtype_t) 0, (id_t) 0, PC_GETCLINFO, (caddr_t) & infos); - if (l == -1L) - OSAL_ERROR ("ON priocntl( , PC_GETCLINFO, )"); - - m_prioMax = 59; - m_prioMin = 0; - -#else // SYSTEM_POSIX4, SYSTEM_Linux and SYSTEM_VxWorks - - m_policy = sched_getscheduler (getPid ()); - if (m_policy == -1) - OSAL_ERROR ("ON sched_getscheduler(myPid)"); - PR (" Current scheduling policy is "); - PR ((m_policy == SCHED_FIFO ? "SCHED_FIFO" : - (m_policy == SCHED_RR ? "SCHED_RR" : "SCHED_OTHER"))); - - posixPriorityNumbering = true; // for VxWorks, otherwise number inversion - - m_prioMax = sched_get_priority_max (m_policy); - if (m_prioMax == -1) - OSAL_ERROR ("ON sched_get_priority_max()"); - m_prioMin = sched_get_priority_min (m_policy); - if (m_prioMin == -1) - OSAL_ERROR ("ON sched_get_priority_min()"); - -#endif - -PR (", priority mini for a thread =" << m_prioMin); -PR (", priority maxi for a thread =" << m_prioMax << showI); - - - - - - - - - - - - - - C/C++ - bool r = false; -const char *p =::getenv (name); -if (p && *p != '\0') - r = true; - -return r; - - - - - - - - - - - - - - C/C++ - // a call to getenv(3C) is standard UNIX -const char *p =::getenv (name); - -// result is "" if name is not found in environment - -return (p ? p : ""); - - - - - - - - - - - - - - - - - - - C/C++ - int r = 0; // default return value 0 (variable does not exist or empty) - -const char *p = ::getenv (name); -if (p && *p != '\0') -{ - char *pEnd; - r = (int) strtol (p, &pEnd, base); - if (pEnd == p) { - // the variable exists, but is not numeric - OS_AL::Util::BString200 s ("Environment variable '"); - s << name << "' should be integer."; - OSAL_ERROR (s); - } -} - -return r; - - - - - - - - - - - - - - C/C++ - bool r = false; // if variable does not exist -const char *p = ::getenv (name); -if (p) { - char c = *p; - if (c == 't' || c == 'T' || // true or TRUE or True or ... - c == 'y' || c == 'Y') { // yes or YES or Yes or ... - r = true; - } - else if (c == 'f' || c == 'F' || c == 'n' || c == 'N') { - // false is already assigned - } - else { - OS_AL::Util::BString200 str (name); - OSAL_ERROR (str << " is not boolean."); - } -} - -return r; - - - - - - - - - C/C++ - if (m_sigOnErr == 0) { - init (); -} - -return m_numberOfProcesses; - - - - - - - - - - - - - - C/C++ - m_argc = argc; -m_argv = argv; - - - - - - - - - C/C++ - if ((zoneNumber < 0) || (zoneNumber >= m_numberOfProcesses)) { - OSAL_ERROR ("requires : 0 <= number < numberOfProcesses"); -} -m_zoneNumber = zoneNumber; - - - - - - - - C/C++ - if (m_zoneNumber == -1) { - OSAL_ERROR ("zone number not yet assigned"); -} - -return m_zoneNumber; - - - - - - - - C/C++ - if (m_sigOnErr == 0) { - init (); -} - -return m_prioMax; - - - - - - - - C/C++ - if (m_sigOnErr == 0) { - init (); -} - -return m_prioMin; - - - - - - - - C/C++ - int r = 0; - -if (prio < getPrioMin () || prio > getPrioMax ()) -{ - OS_AL::Util::BString200 s ("priority = "); - s << prio << " out of range [" << getPrioMin () - << ", " << getPrioMax () << "]"; - OSAL_ERROR (s); -} - -#ifdef SYSTEM_VxWorks -OSAL_ERROR ("Not available with VxWorks"); //-VxW -// sched_setparam() set a task's priority for VxWorks -// for us, a task is a thread -// VxWorks is mono-process (only 1 address space) -// so inter-process facilities like this one should not be required - -#elif defined SYSTEM_POSIX4 -struct sched_param params; -params.sched_priority = prio; - -r = sched_setparam (0, &params); -if (r == -1) - OSAL_ERROR ("ON sched_setparam()"); - -#elif defined SYSTEM_Linux -if (getPolicy () != SCHED_OTHER) -{ - // SCHED_RR or SCHED_FIFO: use POSIX functions to change static priority - struct sched_param params; - params.sched_priority = prio; - r = sched_setparam (0, &params); - if (r == -1) - OSAL_ERROR ("ON sched_setparam()"); -} -else -{ - // TIME-SHARING - // We have to be super-user to modify the priority -} -#else -if (getPolicy () != SCHED_OTHER) -{ // REAL-TIME - pcparms_t params; - params.pc_cid = classId; - long l; - - rtparms_t *rtParms = (rtparms_t *) params.pc_clparms; - rtParms->rt_pri = pri; - rtParms->rt_tqsecs = 0; - rtParms->rt_tqnsecs = RT_NOCHANGE; - l = priocntl (P_PID, getPid (), PC_SETPARMS, (caddr_t) & params); - if (l == -1L) - OSAL_ERROR ("ON priocntl( , PC_SETPARMS, )"); -} -else { - // TIME-SHARING - // We have to be super-user to modify the priority -} -#endif - - - - - - - - C/C++ - TRACEpr (F9); - -int prio = getMyPriority (); -PR ("old priority = " << prio); - -#ifdef SYSTEM_VxWorks - prio = -1; - OSAL_ERROR ("Not available with VxWorks"); //-VxW - -#elif defined SYSTEM_POSIX4 - setMyPriority (prio - decrement); - -#else - // Linux or other - if (getPolicy () != SCHED_OTHER) - { // REAL-TIME - setMyPriority (prio - decrement); - } - else - { // TIME-SHARING - if (nice (decrement) == -1) - OSAL_ERROR ("ON nice()"); - } - PR (", new = " << getMyPriority() << showI); -#endif - - - - - - - - C/C++ - int prio; - -#if defined SYSTEM_VxWorks - prio = -1; - OSAL_ERROR ("Not available with VxWorks"); //-VxW - -#elif defined SYSTEM_POSIX4 - struct sched_param params; - int r; - - r = sched_getparam (0, &params); - if (r == -1) - OSAL_ERROR ("ON sched_getparam()"); - prio = params.sched_priority; - - -#elif defined SYSTEM_Linux - if (getPolicy () != SCHED_OTHER) - { - // SCHED_RR or SCHED_FIFO: use POSIX functions to get static priority - struct sched_param params; - int r; - - r = sched_getparam (0, &params); - if (r == -1) - OSAL_ERROR ("ON sched_getparam()"); - prio = params.sched_priority; - } - else - { - // SCHED_OTHER: i.e. time-sharing like for Solaris: dynamic priority - errno = 0; - prio = getpriority (PRIO_PROCESS, getPid ()); - if ((prio == -1) && (errno != 0)) - OSAL_ERROR ("ON getpriority()"); - } -#else - pcparms_t params; - params.pc_cid = classId; - long l; - l = priocntl (P_PID, P_MYID, PC_GETPARMS, (caddr_t) & params); - if (l == -1L) - OSAL_ERROR ("ON priocntl( , PC_GETPARMS, )"); - - if (isRealTime ()) - { // REAL-TIME - rtparms_t *rtParms = (rtparms_t *) params.pc_clparms; - prio = rtParms->rt_pri; - } - else - { // TIME-SHARING - tsparms_t *tsParms = (tsparms_t *) params.pc_clparms; - prio = tsParms->ts_upri; - } -#endif - - return prio; - - - - - - - - - - - - - - - - - - C/C++ - OS_AL::Util::BString500 str0 ("error in "); -exitErrP (str0 << file << ":" << line << " : " << str); - - - - - - - - - - - - - - - - - - C/C++ - OS_AL::Util::BString500 str0 ("error in "); -exitErrP (str0 << file << ":" << line << " : " << str); - - - - - - - - C/C++ - if (m_sigOnErr == 0) - init (); - -OS_AL::Util::Print pr1; -pr1 << str << showErr; - -if (errno) - pr1 << " - error code/msg: " << strerror (errno); -errno = 0; - -if (m_pauseOnErr) { - OS_AL::Util::Print pr2; - pr2 << "\n\t pausing due to error!" << showI; - pause (); // or for(;;) for debugger: debug appliX pid -} - -// removed code that sends a signal instead of exiting -// [todo: reason might have been clean-up?] -exit (1); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provide information about the system, mainly UTS information -(uname), as well as the number of processors, the number of message -queues. -Only partially used. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - return m_cpuNb; - - - - - - - - C/C++ - m_cpuNb = cpuNb; - - - - - - - - C/C++ - return m_mqMax; - - - - - - - - C/C++ - m_mqMax = mqMax; - - - - - - - - C/C++ - return m_semsMax; - - - - - - - - C/C++ - m_semsMax = semsMax; - - - - - - - - C/C++ - return m_hostId; - - - - - - - - C/C++ - return m_hostName; - - - - - - - - C/C++ - return m_machine; - - - - - - - - C/C++ - return m_release; - - - - - - - - C/C++ - return m_sysname; - - - - - - - - C/C++ - return m_version; - - - C/C++ - m_hostName = m_machine = m_release = m_sysname = m_version = ""; - - // ======================================================================= -#if defined SYSTEM_Cygwin - m_cpuNb = 1; // default value - - // Max number of opened MQ - m_mqMax = _SC_MQ_OPEN_MAX; - // Max number of semaphores - m_semsMax = _SC_SEM_NSEMS_MAX; - - // other system infos - m_hostId = gethostid (); - int hostIndex = 0; - -#elif defined SYSTEM_POSIX4 || defined SYSTEM_Linux - m_cpuNb = 1; // default value - - //*** Max number of Message Queues ***// - errno = 0; - m_mqMax = _POSIX_MQ_OPEN_MAX; - - errno = 0; - m_semsMax = _POSIX_SEM_NSEMS_MAX; - - // other system infos - m_hostId = gethostid (); - - // ======================================================================= -#elif defined SYSTEM_Solaris - // Number of configured CPUs - // or? _SC_NPROCESSORS_ONLN (see sysconf(3C) ) - m_cpuNb = sysconf (_SC_NPROCESSORS_CONF); - - //*** Max number of Message Queues ***// - errno = 0; - m_mqMax = sysconf (_SC_OPEN_MAX); // _SC_MQ_OPEN_MAX 'not defined...' - - if (m_mqMax == -1) - OSAL_ERROR ("ON sysconf(_SC_OPEN_MAX)"); - - //*** Max number of Semaphores ***// - /* - semsMax= sysconf(_SC_SEM_NSEMS_MAX); - Extract of sysconf(3C) : If sysconf() fails due to - a value of name that is not defined on the system, the func- - tion will return a value of -1 without changing the value of - errno - */ - - /* in which library is _sysconf() ? - #include <sys/sysconfig.h> - int _sysconf(int); - - semsMax = _sysconf(_CONFIG_SEM_NSEMS_MAX); - if (semsMax == -1) - OSAL_ERROR("ON sysconf(SEM_NSEMS_MAX)"); - */ - m_semsMax = 25; // semget( ) --> EINVAL au dela de 25 - - // ======================================================================= - -#elif defined SYSTEM_VxWorks - m_cpuNb = 1; // default value - - //*** Max number of Message Queues ***// - errno = 0; - m_mqMax = SM_OBJ_MAX_MSG_Q; - - //*** Max number of Semaphores ***// - errno = 0; - m_semsMax = SM_OBJ_MAX_SEM; - - // ======================================================================= -#endif - - -#if defined SYSTEM_Linux || defined SYSTEM_Solaris - struct utsname names; - if (uname (&names) < 0) - OSAL_ERROR ("ON uname( )"); - - m_hostName = names.nodename; - m_sysname = names.sysname; - m_release = names.release; - m_version = names.version; - m_machine = names.machine; -#endif - -#ifdef DEBUG - activateDebugTimer (); -#endif - - - - - - returns the number of CPUs - - - - - - - - - - - - - - - - - returns the number of message queues (useful?) - - - - - - - - - - - - - - - - - returns the number of semaphores - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provide a context for storing pointers (get/savePtr). -There is currently only one use of this class in SRcompeting (and the -getPtr part is commented out => reconsider whether this class is needed) - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - return key; - - - - - - - - C/C++ - key = cr_operand; - - - - - - - C/C++ - return dataPtr; - - - - - - - C/C++ - dataPtr = cr_operand; - - - C/C++ - set_dataPtr (NULL); - - TRACEpr (VM); - PR (showI); - - if (++instanceNb > 1) - { - OSAL_ERROR ("in ThreadContext::ThreadContext: ++instanceNb > 1"); - } - - // puisque seulement 1 instance , key peut être non 'static' - // et pas de précaution par mutex -#if defined THREAD_POSIX4 - errno = pthread_key_create (&key, NULL); - if (errno) { - OSAL_ERROR ("ON pthread_key_create()"); - } - -#elif defined THREAD_Solaris - errno = thr_keycreate (&key, NULL); - if (errno) { - OSAL_ERROR ("ON thr_keycreate()"); - } - -#elif defined THREAD_VxWorks //-VxW - ; -#endif - - - - - - - - C/C++ - // A utiliser au début du code exécuté par un thread nouveau susceptible - // d'avoir besoin du pointeur (spécifique de ce thread) - // via une variable globale (cf. operateur -> surchargé) - - TRACEpr (VM); - PR (showI); - - dataPtr = ptr; -#if defined THREAD_POSIX4 - errno = pthread_setspecific (key, dataPtr); - if (errno) { - OSAL_ERROR ("ON pthread_setspecific()"); - } - -#elif defined THREAD_Solaris - errno = thr_setspecific (key, dataPtr); - if (errno) { - OSAL_ERROR ("ON thr_setspecific()"); - } - -#elif defined THREAD_VxWorks //-VxW - errno = taskVarAdd (0, (int *) &dataPtr); - if (errno) { - OSAL_ERROR ("ON taskVarAdd()"); - } -#endif - - - - - - - - C/C++ - // useful to allow check : - // if (globalVar.getPtr() ==NULL) // in client side, - // before globalVar->memberOfCLASS - - // Get the thread specific pointer -#if defined THREAD_POSIX4 - dataPtr = (CLASS *) pthread_getspecific (key); - -#elif defined THREAD_Solaris - errno = thr_getspecific (key, (void **) &dataPtr); - if (errno) { - OSAL_ERROR ("ON thr_getspecific()"); - } - -#elif defined THREAD_VxWorks //-VxW - // l'attribut 'dataPtr' doit être restauré par le système - // pour ce thread à chaque fois qu'il est réélu pour la CPU - ; -#endif - - return dataPtr; - - - - - - - - C/C++ - // Overload of -> - // since the unique instance of ThrCtxt<CLASS> is a global variable - // directly accessed (not via a pointer) - // operator-> can't be confused with access to members of ThrCtxt<CLASS> - // globalVar.savePtr(...) - // globalVar->memberOfCLASS // to Access to the thread specific data - - TRACEpr (VM); - PR (showI); - - CLASS *dataP = getPtr (); - - if (dataP == NULL) { - OSAL_ERROR ("lack of previous 'globalVar.savePtr(...)'"); - } - - return dataP; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - must be stereotyped CppFriend ()not availbale for the moment for classes) - - - - The class BOL (Bounded ordered list) is a template class applied to a -certain type element type (ELType). The list consists of cells of type -ListCell<ELType>: the elements are stored by value in each cell. The -element type must have a default constructor. - -The element type has to fulfill two criterions: - - It has to define a comparison relation to enable the insertion of an - element at the right position within the list. It requires the existence - of the operators ElType::operator>= and ElType::operator!= - - - the second criterion rests on the identity of data of two elements, - independently of the value being used for their scheduling. It makes it - possible to compare two elements or to seek an element in the list and to - modify it. It requires l'existence of the method ElType::sameAs() and - possibly of the operator ElType::operator= - -These two criteria can be independent. The super class of BOL, SMO, -redefines the new operator to allows for specifying an address where to -the instance should be located in memory. The class BOL can be used for -any management * of ordered lists according to specified comparison -criterions'. A list of unlimited size has to create and release memory -dynamicylly, which is expensive. Moreover, one list divided between -several processes and established in a shared memory segment of fixed -size must itself be of a limited size that has to be known at creation. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - TRACEpr (F7); - - ListCell *cur = beginning, *lstCelPtr = NULL; - for (; cur->next; cur = cur->next) { - if (element.sameAs (cur->next->value)) - { - lstCelPtr = cur; - break; - } - } - PR ("BOL< ElType >::findElement"); - - - return (lstCelPtr); - - - - - - - - - - - - C/C++ - TRACEpr (F7); - PR ("BOL< ElType >::findPrevious"); - - ListCell *cur = beginning; - for (; cur->next && element >= cur->next->value; cur = cur->next); - - return (cur); - - - - - - - - - - - - C/C++ - // Recherche de la place de la cellule dans la liste : - if (!(element >= beginning->value)) // C'est le premier. - { - cellule->next = beginning; - beginning = cellule; - // Il y avait au départ plus d'un élément, - // le dernier et le premier sont donc différents, - // endElement est donc à jour. - } - else if (element >= endElement->value) // Dernier élément - { - endElement->next = cellule; - endElement = cellule; - cellule->next = NULL; - } - else // Autres cas : - { - ListCell *newPrevCel = findPrevious (element); - - // Réinsertion de la cellule : - cellule->next = newPrevCel->next; - newPrevCel->next = cellule; - } - - - - - - - - C/C++ - return current; - - - - - - - C/C++ - current = cr_operand; - - - - - - - C/C++ - return beginning; - - - - - - - C/C++ - beginning = cr_operand; - - - - - - - C/C++ - return endElement; - - - - - - - C/C++ - endElement = cr_operand; - - - - - - - C/C++ - return freeMemory; - - - - - - - C/C++ - freeMemory = cr_operand; - - - - - - - C/C++ - return endOfMemory; - - - - - - - C/C++ - endOfMemory = cr_operand; - - - - - - - C/C++ - return firstFreeCellule; - - - - - - - C/C++ - firstFreeCellule = cr_operand; - - - - - - - - C/C++ - TRACEpr (F7); - PR (" $$$ endOfMemory : " << (void *) endOfMemory); - PR (" - freeMemory : " << (void *) freeMemory); - PR (" = " << (int) endOfMemory - (int) freeMemory << showI); - - - - - - - - - - - - C/C++ - TRACEpr (F7); - ElType *elementPtr = NULL; - - ListCell *newCellule = new (this) ListCell (element); - - PR ("newCellule=" << (void *) newCellule << showI); - - if (newCellule) - { - PR ("beginning=" << (void *) beginning); - PR (", endElement=" << (void *) endElement << showI); - - if (!beginning) - { // Cas liste vide : - current = endElement = beginning = newCellule; - PR (element << " : single element."); - } - else if (!(element >= beginning->value)) - { // Cas élément plus petit que tous les autres (plus petit que le premier) : - newCellule->next = beginning; - beginning = newCellule; - PR (element << " : element stored ahead."); - } - else if (element >= endElement->value) - { // Cas élément plus grand que tous les autres, ou égal au(x) plus grand(s), - // (supérieur ou égal au dernier de la liste): - endElement->next = newCellule; - endElement = newCellule; - PR (element << " : element stored at bottom."); - } - else - { - // Cas général, élément à insérer en milieu de liste: - ListCell *prevCel = findPrevious (element); - PR ("prevCel=" << (void *) prevCel << showI); - newCellule->next = prevCel->next; - prevCel->next = newCellule; - PR (element << " : element stored after : " << prevCel->value); - } - - elementPtr = &(newCellule->value); - } - PR (showI); - - return elementPtr; - - - - - - - - - - - - - C/C++ - TRACEpr (F7); - PR (showI); - bool result = FALSE; - - if (beginning) - { // List not empty. - if (element.sameAs (beginning->value)) - { // Cas où l'élément est le premier de la liste : - ListCell *nextBeginning = beginning->next; - - if (endElement == beginning) - endElement = NULL; - - beginning->free (this); - - current = beginning = nextBeginning; - // Sinon, current risque d'indiquer un élément inexistant ; - - result = TRUE; - } - else - { // Autres cas : - ListCell *prevCel = findElement (element); - - if (prevCel) - { // L'élément est trouvé. - // prevCel->next est toujours non NULL, car c'est - // le précédent. S'il n'y en a pas, c'est soit que la - // liste est vide (beginning == NULL), soit qu'elle n'a - // qu'un élément, c'est alors aussi le premier et c'est - // traité avant ! - ListCell *destroyedCel = prevCel->next; - - if (prevCel->next->next) - prevCel->next = prevCel->next->next; - else // prevCel->next == endElement - { - prevCel->next = NULL; - endElement = prevCel; - } - - if (current == destroyedCel) - current = beginning; - // Sinon, current risque d'indiquer un élément inexistant. - destroyedCel->free (this); - result = TRUE; - } - else - OSAL_ERROR ("Element not found !"); - // ERROR ( "HORREUR, Element inexistant..." ) ; - } - } - else - OSAL_ERROR ("empty list !"); - // ERROR ( "HORREUR, Retrait d'un element dans une liste vide..." ) ; - - return result; - - - - - - - - C/C++ - TRACEpr (F7); - PR (showI); - - ElType *element = NULL; - - if (beginning) - element = &(beginning->value); - else - OSAL_ERROR ("empty list !"); -// ERROR ( "HORREUR, Demande du premier élément d'une liste vide..." ) ; - - return ((element)); - - - - - - - - C/C++ - TRACEpr (F7); - PR (showI); - - ElType *element = NULL; - - if (endElement) - element = &(endElement->value); - else - OSAL_ERROR ("empty list !"); -// ERROR ("HORREUR, Demande du dernier élément d'une liste vide...") ; - - return ((element)); - - - - - - - - C/C++ - TRACEpr (F7); - PR (showI); - - ElType *element = NULL; - - if (beginning) - { - element = &(beginning->value); - current = beginning; - } - else - OSAL_ERROR ("empty list !"); - - return element; - - - - - - - - C/C++ - TRACEpr (F7); - PR (showI); - - ElType *element = NULL; - - if (endElement) - { - element = &(endElement->value); - current = endElement; - } - else { - OSAL_ERROR ("empty list !"); - } - - return element; - - - - - - - - - - - - - C/C++ - TRACEpr (F7); - PR (showI); - - ElType *element = NULL; - - while (current != NULL && (index--) > 0) - { - if (current->next != NULL) - { - element = &(current->next->value); - current = current->next; - } - else { - // current->next == NULL - current = NULL; - } - } - - return element; - - - - - - - - - - - - C/C++ - TRACEpr (F7); - PR (showI); - - ElType *elementPtr = NULL; - - if (beginning) - { // List not empty - if (element.sameAs (beginning->value)) - { // Cas où l'élément est le premier : - elementPtr = &(beginning->value); - - if (element != (*elementPtr)) - { // Sa valeur est différente - beginning->value = element; - if (beginning->next) - { // La liste contient plus d'un élément - if (element >= beginning->next->value) - modifyFirst (element); - // else, on ne modifie pas la place, il reste le premier. - } - // else, la liste n'a qu'un élément, c'est donc le premier. - } - // else, sa valeur est la même que celle qu'on veut mettre, - // on ne fait donc rien. - } - - else { - ListCell *prevCel = findElement (element); - - if (prevCel) - { // L'élément est trouvé - // prevCel->next est toujours non NULL, - // car c'est le "précédent". S'il n'y en a pas, - // c'est soit que la la liste est vide (beginning == NULL), - // soit qu'elle n'a qu'un élément qui est alors aussi le - // premier et cela a été traité avant ! - - elementPtr = &(prevCel->next->value); - - if (element != (*elementPtr)) - { // Valeur différente. - // Mémorisation et mise à jour de la cellule : - ListCell *cellule = prevCel->next; - cellule->value = element; - - // Retrait de la cellule de la liste : - if (cellule == endElement) - endElement = prevCel; - prevCel->next = prevCel->next->next; - - // Recherche de la place de la cellule dans la liste : - modifyCellule (element, cellule); - - - } - // else, sa valeur est la même que celle qu'on veut mettre, - // on ne fait donc rien. - } - else - OSAL_ERROR ("Element not found !"); - } - } - else { - OSAL_ERROR ("empty list !"); - } - - return elementPtr; - - - - - - - - - - - - C/C++ - TRACEpr (F7); - PR (showI); - - ElType *elementPtr = NULL; - - if (beginning) - { // List not empty - if (element.sameAs (beginning->value)) - // This is the first element - elementPtr = &(beginning->value); - else - { - ListCell *prevCel = findElement (element); - - if (prevCel) - elementPtr = &(prevCel->next->value); - //else - // ERROR ( "Element not found !" ) ; - } - } - else { - OSAL_ERROR ("empty list !"); - } - - return elementPtr; - - - - - - - - - C/C++ - TRACEpr (F7); - PR (showI); - - return (beginning ? FALSE : TRUE); - - - - C/C++ - current = beginning; - ListCell *destroyedCel; - while (current) - { - destroyedCel = current; - current = current->next; - destroyedCel->free (this); - } - - current = beginning = endElement = NULL; - - - - - - - - C/C++ - // Retrait de la cellule : - - ListCell *oldBeginning = beginning; - beginning = beginning->next; - - if (element >= endElement->value) - { - // if this element is bigger than the others: - endElement->next = oldBeginning; - endElement = oldBeginning; - oldBeginning->next = NULL; - } - else - { - // general case, element is inserted in the middle - ListCell *prevCel = findPrevious (element); - - oldBeginning->next = prevCel->next; - prevCel->next = oldBeginning; - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - ListCell *allocatedCellule = NULL; - - if (currentList->firstFreeCellule) - { - allocatedCellule = currentList->firstFreeCellule; - currentList->firstFreeCellule = - currentList->firstFreeCellule->next; - } - else if (currentList->freeMemory) - { - allocatedCellule = currentList->freeMemory; - - if (currentList->freeMemory < currentList->endOfMemory) { - currentList->freeMemory++; - } - else if (currentList->freeMemory == currentList->endOfMemory) { - currentList->freeMemory = NULL; - } - else { - OSAL_ERROR ("Bad allocation pointers !"); - } - } - else { - OSAL_ERROR ("Bounded list is full !"); - } - - return allocatedCellule; - - - - - - - - C/C++ - next = currentList->firstFreeCellule; - currentList->firstFreeCellule = this; - - delete this; - - - - - - - - C/C++ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - declare the standard new-operator as private, since its invocation -should be replaced by the call to the new operator defined above -(with the additional parameter currentList). -I.e. don't use "new ListCell", use "new (this) ListCell" instead - - - - - - - - - - - - - - - - - A circular buffer - seems to be unused (besides the tests). -[todo:] missing the possibility to delete elements from the buffer - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - - - - - - - - - C/C++ - return (full ? nbElem : current); - - - - - - - - C/C++ - return nbElem; - - - - - - - C/C++ - vector[current++] = el; - -if (current == nbElem) -{ - current = 0; // if end is reached, start add the beginning - full = TRUE; // only useful the first time -} - - - - - - - - - - - - C/C++ - int index = -1; - - if ((relativeIndex >= 0) && (relativeIndex < nbElem)) - { - if (full) - { - index = current + relativeIndex; - if (index >= nbElem) { - index -= nbElem; - } - } - } - else if ((relativeIndex < 0) && (relativeIndex >= -nbElem)) - { - if (full || (relativeIndex >= -current)) - { - index = current + relativeIndex; - if (index < 0) { - index += nbElem; - } - } - } - - if (index != -1) { - return vector + index; - } - else { - return NULL; - } - - - - Create a circular buffer containing a certain number of objects of type -ElType. The type and the number of elements are template parameters. - - - - - - - - - - - Get an element from the buffer. The index is relative to the last -addition to the buffer: negative values address "backward" elements -(-1 addresses the last added), positive values "forward" elements -(only useful, if the buffer has already been completely filled). - -Thus, values in the range [-m_nbElem, m_nbElem] are possible. -Returns NULL, if index is out of bounds or no element stored so far -under this index. - - - - - - - - - - - - - - returns the number of elements currently in the buffer. - - - - - - - - - - returns the size of the buffer. - - - - - - - - - - - Manage a set of pointers to an element type (passed as template instance) -This class roughly resembles Objecteering's set_of macro and is used to -migrate existing code easily to other case tools. - -The second class for the template instantiation needs to be a -"const variant" of the first class. - -Caveat: this class uses dynamic memory allocation -=> todo: create a purely static variant - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - return cardinal_number; - - - - - - - - - - - - C/C++ - return content[index]; - - - - - - - - - - - - - C/C++ - int size = 0x10; - -while (size < desired_size) -{ - if (size < size_block) { - size = size*2; - } - else { - size += size_block; - } -} -return size; - - - - - - - - - - - - - - C/C++ - size_block = init_size_block; -real_size = adjust_size(init_size); -content = new T [real_size]; -cardinal_number = 0; - - - - C/C++ - delete [] content; - - - - - - - - - - - - C/C++ - for (int i = 0; i < cardinal_number; i++) { - if (content[i] == entry) { - return i; - } -} - -return -1; - - - - - - - - C/C++ - if (cardinal_number >= real_size) -{ - real_size = adjust_size(cardinal_number + 1); - T * new_content = new T [real_size]; - memcpy(new_content, content, cardinal_number * sizeof(T)); - delete [] content; - content = new_content; -} -content[cardinal_number++] = (T) entry; - - - - - - - - - - - - - C/C++ - if (cardinal_number >= real_size) -{ - real_size = adjust_size(cardinal_number + 1); - T * new_content = new T [real_size]; - memcpy(new_content, content, cardinal_number * sizeof(T)); - delete [] content; - content = new_content; -} -if (index < cardinal_number) { - memmove( - &(content[index+1]), - &(content[index]), - (cardinal_number-index) * sizeof(T)); -} -content[index] = (T) entry; -cardinal_number++; - - - - - - - - - - - - C/C++ - for (int i = 0; i < cardinal_number; i++) { - if (content[i] == entry) { - erase(i); - return true; // only erase first entry - } -} -return false; - - - - - - - - - - - - - - C/C++ - if (index_to == -1) { - index_to = index_from; -} - -if (index_to >= cardinal_number) { - // out of bounds - return; -} -int remaining_elements = cardinal_number - (index_to + 1); -cardinal_number -= (index_to - index_from + 1); - -if (remaining_elements > 0) -{ - memmove( - &(content[index_from]), - &(content[index_to+1]), - remaining_elements * sizeof(T)); -} - - - - - - - - - - - - - - - - - - - - Return the number of elements currently in the set - - - - - - - - - - Retrieve an element at index from the set - - - - - - - - - - - - - - find. Find an element in the set. The index of the first element that -matches is returned. If the element cannot be found, -1 is returned. - - - - - - - - - - - - - - Insert an element at position given by index into the set. - - - - - - - - - - - - - - append an element to the set, it will occupy the last index. - - - - - - - - - erase an element from the set based on its value. The first element -with a matching value (not further elements that might match as well) -will be removed from the list. Returns true, if a matching value is -be found. - - - - - - - - - - - - - - Erase entries from the set based on an "from" and "to" index. If -the latter is not supplied, only one element is erased (to = from). -Please note that subsequent entries change their position. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TODO : -Incomplete attribute and operation definitions - - - - Manages system semaphores with counters (mainly based on Posix semaphores) - - - - - - - - - - - - C/C++ - TRACEpr (F7); - PR ("Semaphore::Semaphore (" << initValue << ")" << showI); - - errno = 0; -#if defined SYNCHRO_Solaris - errno = sema_init (&m_sema, initValue, USYNC_THREAD, NULL); -#else - sem_init (&m_sema, 0, initValue); // function sets errno on error -#endif - - if (errno) { - OSAL_ERROR ("Semaphore init failed"); - } - - - - C/C++ - TRACEpr (F7); - PR ("Semaphore::~Semaphore ()" << showI); - - errno = 0; -#if defined SYNCHRO_Solaris - errno = sema_destroy (&m_sema); -#else - sem_destroy (&m_sema); // function sets errno on error -#endif - - if (errno) { - OSAL_ERROR (""); - } - - - - - - - - - C/C++ - TRACEpr (F7); - PR ("Semaphore::post ()" << showI); - - errno = 0; - -#if defined SYNCHRO_Solaris - errno = sema_post (&m_sema); -#else - sem_post (&m_sema); // function sets errno if r not 0 -#endif - - if (errno) { - OSAL_ERROR (""); } - - return errno; - - - - - - - - - C/C++ - TRACEpr (F7); - PR ("Semaphore::wait ()" << showI); - int r; - errno = 0; - for (;;) - { -#if defined SYNCHRO_Solaris - errno = sema_wait (&m_sema); - if ((errno == 0) || (errno == EBUSY)) - break; -#elif defined SYNCHRO_POSIX4 || defined SYNCHRO_VxWorks - r = sem_wait (&m_sema); // sem_wait sets errno if r not 0 - if ((r == 0) || (errno == EAGAIN)) - break; -#else - #error define synchronization strategy -#endif - if (errno != EINTR) - OSAL_ERROR ("wait returned error code"); - errno = 0; - } - - return errno; - - - - - - - - - C/C++ - TRACEpr (F7); - PR ("Semaphore::trywait ()" << showI); - int r; - errno = 0; - - for (;;) - { -#if defined SYNCHRO_Solaris - errno = sema_trywait (&m_sema); - if ((errno == 0) || (errno == EBUSY)) - break; -#elif defined SYNCHRO_POSIX4 || defined SYNCHRO_VxWorks - r = sem_trywait (&m_sema); // sem_trywait sets errno if r not 0 - if ((r == 0) || (errno == EAGAIN)) - break; -#else - #error define synchronization strategy -#endif - if (errno != EINTR) - OSAL_ERROR ("tryWait returned error code"); - errno = 0; - } - PR ("Semaphore::tryWait () - returns value (errno): " << errno << showI); - - return errno; - - - - - - - - - C/C++ - TRACEpr (F7); - PR ("Semaphore::getValue ()" << showI); - - int value; - sem_getvalue ((sem_t*) &m_sema, &value); - return value; - - - - - - - - - - - - - - This operation unlocks the semaphore. - It increments atomically the counter and if other threads are - blocked waiting, it unblocks one of these. - - - - - - - - - - This operation locks the semaphore only if that semaphore is currently - not locked - that is, if the semaphore value is currently positive. - - The underlying posix function is executed in a loop, since it could - legally return with an error code, if it is interrupted by a - signal (EINTR). - - Returns 0 on success or the error code - - - - - - - - - - This operation locks the semaphore. - If the counter is zero, this method blocks the current thread until the - counter is positive. Afterwords it decrements the counter atomically. - - The underlying posix function is executed in a loop, since it could - legally return with an error code, if it is interrupted by a - signal (EINTR). - - Returns 0 on success or the error code - - - - - - - - - - Provide access to the semaphore counter - - - - - - - - - - - Allows to synchronize N threads: N-1 threads arriving at the barrier -are blocked, the last arriving thread unblocks all threads. - -Only one thread creates the barrier, other threads should only use -references. -In addition to an inefficient (file based!) implementation, we use -directly the pthread barrier. - - - - - - - C/C++ - return m_name; -} - - - - - - - - - - - - - - - - - - - - - - - block, until the number of threads specified in the constructor - invoke this method - - - - - - Interface to lock a file (like flock in POSIX) -This class is currently a candidate for being removed from the -virtual machine, since file based locking is seldom relevant in -embedded system. Its main use is the inefficient fallback implementation -variant of the barrier (if Posix functions are not available) - - - - - - - - - - - - - - - - - - - - - - C/C++ - m_fd = fd; - - - - - - - - - - - - - C/C++ - TRACEpr (VM); - PR ("Lock::Lock (...)" << showI); - - // probably not a good idea to reset a global error variable here - // errno = 0; - -/* #if defined SYNCHRO_VxWorks // it compiles on VxWorks - OSAL_ERROR ("Not implemented for VxWorks"); - #endif */ - - - - C/C++ - TRACEpr (VM); - PR ("Lock::take" << showI); - - m_flock.l_type = m_lockType; - m_flock.l_whence = 0; - m_flock.l_start = (off_t) 0; - m_flock.l_len = (off_t) 0; - - if (fcntl (m_fd, F_SETLKW, &m_flock) < 0) { // wait if hold - OSAL_ERROR ("ON fcntl(m_fd, F_SETLKW:F_WRLCK) "); - } - - - - - - - - - C/C++ - TRACEpr (VM); - - int r; - m_flock.l_type = m_lockType; - m_flock.l_whence = 0; - m_flock.l_start = (off_t) 0; - m_flock.l_len = (off_t) 0; - - while ((r = fcntl (m_fd, F_SETLK, &m_flock)) < 0) // NO wait if hold - { - if (errno == 0 || errno == EAGAIN) - break; - if (errno != EINTR) - OSAL_ERROR (""); - errno = 0; - } - - PR ("Lock::tryTake () - return value (errno): " << errno << showI); - return errno; - - - - C/C++ - TRACEpr (VM); - PR ("Lock::release ()" << showI); - - m_flock.l_type = F_UNLCK; - m_flock.l_whence = 0; - m_flock.l_start = (off_t) 0; - m_flock.l_len = (off_t) 0; - - if (fcntl (m_fd, F_SETLK, &m_flock) < 0) { - OSAL_ERROR (""); - } - - - - - - - - - - - - - C/C++ - TRACEpr (VM); - PR ("Lock::getInfo" << showI); - - infoP->l_whence = 0; - infoP->l_start = 0L; - infoP->l_len = 0L; - infoP->l_type = m_lockType; - if (fcntl (m_fd, F_GETLK, infoP) == -1) { - OSAL_ERROR (""); - } - - // return TRUE, if lock busy - return (infoP->l_type != F_UNLCK); - - - - - Create a lock for a file that is identified by a file descriptor. This - descriptor can be obtained for instance using the "open". The second, - optional parameter denotes whether the lock is also exclusive for - reading (otherwise, only the write access is protected). The default - value "true" guarantees exlusive read and write access. - - - - - - - - - - - - - - - - this method can be called to initialize the file descriptor, if it - is not yet known at creation time. This should only be called once - after construction (and before take/release). - - - - - - - - - - take a lock. This method blocks, until the lock is available - - - - - a non-blocking variant of take. It returns the error code of the - underlying function fcntl or 0, if take was successfull - - - - - - - - - - release the lock - - - - - - - - - - - - - - - - - - - - - - - - - - Allows to manage system locks to prevent threads from simultaneous -execution of the same section (see CriticalSection) - - - - - - - C/C++ - creatEff (IntraProcess); - - - C/C++ - TRACEpr (F7); -PR ("before Mutex::lock()" << showI); -#if defined SYNCHRO_POSIX4 - int error = pthread_mutex_lock (&m_mutexS); - -#elif defined SYNCHRO_Solaris - int error = mutex_lock (&m_mutexS); - -#elif defined SYNCHRO_VxWorks - int error = 0; - if (semTake (m_mutexS, WAIT_FOREVER) != OK) - OSAL_ERROR ("ON semTake()"); -#endif - - if (error) { // == EDEADLK : the current thread already owns the mutex - OSAL_ERROR ("can't lock mutex"); - } - - - - C/C++ - TRACEpr (F7); -PR ("Mutex::unlock ()" << showI); - -#if defined SYNCHRO_POSIX4 - int error = pthread_mutex_unlock (&m_mutexS); - -#elif defined SYNCHRO_Solaris - int error = mutex_unlock (&m_mutexS); - -#elif defined SYNCHRO_VxWorks - int error = 0; - if (semGive (m_mutexS) != OK) - OSAL_ERROR ("ON semGive()"); -#endif - -if (error) { // == EPERM : the current thread does not own the mutex - OSAL_ERROR ("can't unlock mutex"); -} - - - - - - - - C/C++ - TRACEpr (F7); -PR ("before Mutex::trylock()"<< showI); - -#define Nretry 3 // re-try N times if EINTR - -int i; -int error; -for (i = 0; i < Nretry; ++i) -{ -#if defined SYNCHRO_POSIX4 - error = pthread_mutex_trylock (&m_mutexS); - -#elif defined SYNCHRO_Solaris - error = mutex_trylock (&m_mutexS); - -#elif defined SYNCHRO_VxWorks - error = semTake (m_mutexS, NO_WAIT); - if (error == S_objLib_OBJ_UNAVAILABLE) { - error = EBUSY; - } - -#endif - if (error == 0 || error == EBUSY) { - break; - } - if (error != EINTR) { - OSAL_ERROR (""); - } -} -if (i == Nretry) { - OSAL_ERROR ("EINTR Nretry times"); -} - -// errno == EBUSY : the mutex could not be acquired because it was already -// locked -return error; - - - - C/C++ - int error; -#if defined SYNCHRO_POSIX4 - TRACEpr (F7); - PR ("Mutex::~Mutex: m_mutexS = " << &m_mutexS << showI); - error = pthread_mutex_destroy (&m_mutexS); - -#elif defined SYNCHRO_Solaris - error = mutex_destroy (&m_mutexS); - -#elif defined SYNCHRO_VxWorks - if (semDelete (m_mutexS) == OK) { - error = 0; - } - else { - error = -1; - } -#endif - -if (error) { - OSAL_ERROR ("cannot delete Mutex"); -} - - - - - - - - - C/C++ - // any value is equally valable as argument -// inutile d'avoir une portee InterProcess couteuse si le process est seul. - -creatEff (OS_AL::ProcessingResources::ProDesc::getNumerOfProcesses() > 1 ? InterProcess : IntraProcess); - - - - - - - - C/C++ - // -------------------------------------------- -#if defined SYNCHRO_POSIX4 -pthread_mutexattr_t attr; // mutex attributes object -int result = pthread_mutexattr_init (&attr); // and initialized by only 1 process -// ?? comment savoir que je suis le premier ?? ..................... -if (result != 0) { - OSAL_ERROR ("ON pthread_mutexattr_init()"); -} -if (scope == InterProcess) { - result = pthread_mutexattr_setpshared (&attr, PTHREAD_PROCESS_SHARED); - if (errno != 0) { - OSAL_ERROR ("ON pthread_mutexattr_setpshared()"); - } -} -result = pthread_mutex_init (&m_mutexS, &attr); -if (result != 0) { - OSAL_ERROR ("ON pthread_mutex_init()"); -} - -// pthread_mutexattr_destroy(&attr); // required? - -// -------------------------------------------- -#elif defined SYNCHRO_Solaris -if (scope != InterProcess) { - // initial RAZ, with only 1 thread - // #include <string.h> - // memset(&m_mutexS, 0, sizeof(MutexStruc)); - char *pc = (char *) &m_mutexS; - for (int k = 0; k < sizeof (MutexStruc); ++k) { - *pC/C++ = '\0'; // initial reset - } -} - //else - // only 1 process must reset this structure - -int result = mutex_init ((MutexStruc *) & m_mutexS, - (scope == InterProcess) ? USYNC_PROCESS : USYNC_THREAD, NULL); -if (result != 0) { - OSAL_ERROR ("ON mutex_init()"); -} - -// -------------------------------------------- -#elif defined SYNCHRO_VxWorks -if (scope == InterProcess) { - OSAL_ERROR ("Only 1 processus for VxWorks"); -} -#if defined SYNCHRO_VxWorks_MES -m_mutexS = semMCreate (SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE); -#else -m_mutexS = semBCreate (SEM_Q_PRIORITY, SEM_FULL); -#endif -if (m_mutexS == NULL) { - OSAL_ERROR ("ON semaphore create()"); -} - -// -------------------------------------------- -#else -#error SYNCHRO_?? not defined -#endif - -TRACEpr (F7); -PR ("after Mutex::createEff()" << showI); - - - - - - - - - C/C++ - TRACEpr (F7); -PR ("Mutex::print (" << label << "), errno= " << errno << showI); - -unsigned short *pc1; -int size; -#if defined SYNCHRO_VxWorks - if (m_mutexS == NULL) { - OSAL_ERROR ("m_mutexS == NULL"); - } - pc1 = (unsigned short *) m_mutexS; - size = 40; // sizeof(class semaphore); - - semShow (m_mutexS, 1); // dump of system structure - //-- errno= 0; -#else - pc1 = (unsigned short *) &m_mutexS; - size = sizeof (MutexId); -#endif - -char buffer[200]; -char *pb = buffer; -unsigned short *pc = pc1; -for (int k = 0; k < size; k += 2) -{ - if (k % 16 == 0) - pb += sprintf (pb, "\n\t"); - pb += sprintf (pb, "%4.4x ", *pc++); - if ((pb - buffer) > (int) sizeof (buffer)) - OSAL_ERROR ("Enlarge size of buffer."); -} - -PR (", dump of m_mutexS at 0x" << pc1 << ": " << buffer << showI); - - - - - - - Locks the mutex. If the mutex is currently unlocked, it becomes locked - and owned by the calling thread, and returns immediately. - If the mutex is already locked by another thread, "lock" suspends the - calling thread until the mutex is unlocked. - - - - - Unlocks the given mutex. The mutex is assumed to be locked and owned - by the calling thread on entrance to unlock. - unlock always returns the mutex to the unlocked state (we do not use the - pthread option "recursive", which decrements the locking count of the mutex - [number of lock operations performed on it by the calling thread], and - only when this count reaches zero is the mutex actually unlocked). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Protects the code following a declaration of an instance of this class -against an interruption for signal handling and against reentrance of -this code. It is associated with an instance of class Mutex (passed in -the constructor). - -Example: -Management of a list (see class SR_List) that can be accessed by multiple -threads. To assure data integrity, each list instance contains a mutex, -all public methods look like: -SR_Liste::append() -{ - CriticalSection cs(mutex); - ... -} // end of critical section. - - - - - - - - - - - - - - - - - - - C/C++ - m_mutex = mutex; - - sigfillset (&m_maskAll); - Thread::changeSigMask (SIG_SETMASK, &m_maskAll, &m_oldMask); - - m_mutex->lock (); - - - - - - - - C/C++ - m_mutex = shmPtr->getMutex (); - - sigfillset (&m_maskAll); - Thread::changeSigMask (SIG_SETMASK, &m_maskAll, &m_oldMask); - m_mutex->lock (); - - - - C/C++ - if (m_mutex) { - m_mutex->unlock (); - } - - Thread::changeSigMask (SIG_SETMASK, &m_oldMask, NULL); - - - - - Create a Critical section using the passed mutex pointer - - - - - - - - - Create a critical section using the mutex provided by the SharedMemory - - - - - - - - - The destructor will release the mutex. - - - - - - - - - - - - - - - - - - Allows to authorize the access to data shared between multiple threads. -Access can be shared by multiple reades, but there can only be one writer. - - - - - - - - - - - C/C++ - return rwl; - - - - - - - C/C++ - rwl = cr_operand; - - - C/C++ - #if defined SYNCHRO_Solaris - errno = rwlock_init (&rwl, USYNC_THREAD, NULL); - -#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux - errno = pthread_rwlock_init (&rwl, NULL); - -#elif defined SYNCHRO_VxWorks - rwl.readers = 0; // pas de lecteur au début - rwl.writers = 0; // pas d'écrivain au début - - rwl.readersMut = semBCreate (SEM_Q_FIFO, SEM_FULL); //initialisation - rwl.writersMut = semBCreate (SEM_Q_FIFO, SEM_FULL); //des - rwl.readMut = semBCreate (SEM_Q_FIFO, SEM_FULL); //mutexes - rwl.writeSem = semCCreate (SEM_Q_FIFO, 1); //et des - rwl.readSem = semCCreate (SEM_Q_FIFO, 1); //semaphores - - if ((rwl.readersMut != NULL) && (rwl.writersMut != NULL) - && (rwl.readMut != NULL) - && (rwl.writeSem != NULL) && (rwl.readSem != NULL)) - errno = 0; - else - errno = ENOMEM; // semBCreate et semCCreate ne positionnent pas errno - - -#else // RWLock_Simulation - rwl.readers = 0; //pas de lecteur au début - rwl.writers = 0; //pas d'écrivain au début - errno = 0; -#endif - - if (errno) { - OSAL_ERROR (""); - } - - - - C/C++ - #if defined SYNCHRO_Solaris - errno = rwlock_destroy (&rwl); - -#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux - errno = pthread_rwlock_destroy (&rwl); - - -#elif defined SYNCHRO_VxWorks //-VxW - errno = 0; // je suppose qu'1 exécution OK ne touche pas errno - semDelete (rwl.readersMut); - semDelete (rwl.writersMut); - semDelete (rwl.readMut); - semDelete (rwl.readSem); - semDelete (rwl.writeSem); - -#else - errno = 0; -#endif - - if (errno) { - OSAL_ERROR (""); - } - - - - C/C++ - #if defined SYNCHRO_Solaris - errno = rw_rdlock (&rwl); - -#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux - errno = pthread_rwlock_rdlock (&rwl); - -#elif defined SYNCHRO_VxWorks - errno = 0; - if (semTake (rwl.readMut, WAIT_FOREVER) == OK) - if (semTake (rwl.readSem, WAIT_FOREVER) == OK) - if (semTake (rwl.readersMut, WAIT_FOREVER) == OK) //début de section critique - { - rwl.readers++; //incremente nb de lecteurs - if (rwl.readers == 1) //si premier lecteur alors il - semTake (rwl.writeSem, WAIT_FOREVER); //bloque l'ecriture - if (semGive (rwl.readersMut) == OK) //fin de section critique - if (semGive (rwl.readSem) == OK) - semGive (rwl.readMut); - } - -#else // RWLock_Simulation - errno = 0; - rwl.readMut.lock (); - rwl.readSem.wait (); - rwl.readersMut.lock (); // début de section critique - { - rwl.readers++; //incrémente nb de lecteurs - if (rwl.readers == 1) //si premier lecteur alors il - rwl.writeSem.wait (); //bloque l'ecriture - } - rwl.readersMut.unlock (); // fin de section critique - rwl.readSem.post (); - rwl.readMut.unlock (); - -#endif - - if (errno) { - OSAL_ERROR (""); - } - - - - C/C++ - #if defined SYNCHRO_Solaris - errno = rw_wrlock (&rwl); - -#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux - errno = pthread_rwlock_wrlock (&rwl); - -#elif defined SYNCHRO_VxWorks - errno = 0; - if (semTake (rwl.writersMut, WAIT_FOREVER) == OK) //début de section critique - { - if (++rwl.writers == 1) //si premier écrivain, alors - semTake (rwl.readSem, WAIT_FOREVER); // attendre fin des lecteurs et les bloquer - if (semGive (rwl.writersMut) == OK) //fin de section critique - semTake (rwl.writeSem, WAIT_FOREVER); //verrouille acces en ecriture/lecture pour autres - } - -#else // RWLock_Simulation - errno = 0; - rwl.writersMut.lock (); // début de section critique - if (++rwl.writers == 1) //si premier écrivain, alors - rwl.readSem.wait (); // attendre fin des lecteurs et les bloquer - rwl.writersMut.unlock (); // fin de section critique - rwl.writeSem.wait (); // demande à écrire seul -#endif - - if (errno) { - OSAL_ERROR (""); - } - - - - C/C++ - #if defined SYNCHRO_Solaris - errno = rw_unlock (&rwl); - -#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux - errno = pthread_rwlock_unlock (&rwl); - -#elif defined SYNCHRO_VxWorks - errno = 0; - // test, if a reader or writer requires end - if (rwl.readers) - { - if (semTake (rwl.readersMut, WAIT_FOREVER) == OK) - { - // entered critical section (through semTake) - if (--rwl.readers == 0) // if last reader, authorize writers - semGive (rwl.writeSem); - semGive (rwl.readersMut); // end of critical section - } - } - else if (rwl.writers) - { - if (semGive (rwl.writeSem) == OK) // authorize other writers - if (semTake (rwl.writersMut, WAIT_FOREVER) == OK) - { - // entered critical section (through semTake) - if (--rwl.writers == 0) // if last writer, authorize readers - semGive (rwl.readSem); - semGive (rwl.writersMut); // end of critical section - } - } - else - OSAL_ERROR ("readers==0 && writers==0"); - -#else // RWLock_Simulation - errno = 0; - // test, if a reader or writer requires end - if (rwl.readers) - { - rwl.readersMut.lock (); // enter ciritical section - if (--rwl.readers == 0) // if last reader, authorize writers - rwl.writeSem.post (); - rwl.readersMut.unlock (); // end of critical section - } - else if (rwl.writers) - { - rwl.writeSem.post (); // authorize other writer - rwl.writersMut.lock (); // enter critical section - if (--rwl.writers == 0) // if last writer, authorize readers - rwl.readSem.post (); - rwl.writersMut.unlock (); // end of critical section - } - else - OSAL_ERROR ("readers==0 && writers==0"); -#endif - - if (errno) - OSAL_ERROR (""); - - - - - - - - - C/C++ - #if defined SYNCHRO_Solaris - errno = rw_tryrdlock (&rwl); - -#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux - errno = pthread_rwlock_tryrdlock (&rwl); - - -#elif defined SYNCHRO_VxWorks - if (semTake (rwl.readMut, WAIT_FOREVER) == OK) - if (semTake (rwl.readSem, WAIT_FOREVER) == OK) // VERIFIER ??????????? - if (semTake (rwl.readersMut, WAIT_FOREVER) == OK) - { - // entered critical section (through semTake) - rwl.readers++; // increment number of readers - if (rwl.readers == 1) // if first reader, ... - semTake (rwl.writeSem, NO_WAIT); // ... block writer // VERIFIER ??????????? - if (semGive (rwl.readersMut) == OK) // end of critical section - if (semGive (rwl.readSem) == OK) - semGive (rwl.readMut); - } - -#else // RWLock_Simulation - errno = 0; - rwl.readMut.lock (); - if (rwl.readSem.tryWait () == 0) - { - rwl.readersMut.lock (); // begin of critical section - { - rwl.readers++; // increment number of readers - if (rwl.readers == 1) // if first reader, ... - rwl.writeSem.wait (); // ... block writer - } - rwl.readersMut.unlock (); // end of critical section - rwl.readSem.post (); - } - rwl.readMut.unlock (); -#endif - - if (errno && errno != EBUSY) - OSAL_ERROR (""); - - return errno; - - - - - - - - - C/C++ - #if defined SYNCHRO_Solaris - errno = rw_trywrlock (&rwl); - -#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux - errno = pthread_rwlock_trywrlock (&rwl); - -#elif defined SYNCHRO_VxWorks - errno = 0; - if (semTake (rwl.writeSem, NO_WAIT) == OK) // request write access - { - if (semTake (rwl.writersMut, WAIT_FOREVER) == OK) - { - // entered critical section (through semTake) - if (++rwl.writers == 1) //si premier ecrivain alors il - semTake (rwl.readSem, WAIT_FOREVER); //bloque les lecteurs - semGive (rwl.writersMut); //fin de section critique - } - } - else - { - if (errno == S_objLib_OBJ_UNAVAILABLE) - errno = EBUSY; - } - -#else // RWLock_Simulation - errno = 0; - rwl.writersMut.lock (); // begin of critical section - { - rwl.writers++; // increment number of readers - if (rwl.writers == 1) // if first reader, ... - rwl.readSem.wait (); // ... block writers - } - rwl.writersMut.unlock (); // end of critical section - rwl.writeSem.wait (); // lock write/read access for others -#endif - - if (errno && errno != EBUSY) - OSAL_ERROR (""); - - return errno; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From the Posix man page: -A condition (short for ``condition variable'') is a synchronization -device that allows threads to suspend execution and relinquish the -processors until some predicate on shared data is satisfied. The basic -operations on conditions are: signal the condition (when the predicate -becomes true), and wait for the condition, suspending the thread -execution until another thread signals the condition. - -A condition variable must always be associated with a mutex, to avoid -the race condition where a thread prepares to wait on a condition -variable and another thread signals the condition just before the -first thread actually waits on it. - - - - - - - - - - - - - - - - C/C++ - #if defined SYNCHRO_POSIX4 - int error = pthread_cond_init (&m_condition, NULL); - -#elif defined SYNCHRO_Solaris - int error = cond_init (&m_condition, USYNC_THREAD, 0); - -#elif defined SYNCHRO_VxWorks - OSAL_ERROR ("Not available with VxWorks"); - // maybe a mechanism can be implemented by means of a signal pendants - -#else - #error SYNCHRO_???? not defined -#endif - -if (error) { - OSAL_ERROR ("Condition constructor failed"); -} - - - C/C++ - if (m_isLocked) { - unlock (); -} - -#if defined SYNCHRO_POSIX4 || defined SYNCHRO_Linux - int error = pthread_cond_destroy (&m_condition); -#elif defined SYNCHRO_Solaris - int error = cond_destroy (&m_condition); -#endif - -if (error) { - OSAL_ERROR ("destructor failed"); -} - - - C/C++ - m_mutex.lock (); -m_isLocked = true; - - - - C/C++ - if (!m_isLocked) { - // OSAL_ERROR ("already unlocked"); -} -m_mutex.unlock (); -m_isLocked = false; - - - - - - - - - C/C++ - for (;;) { -#if defined SYNCHRO_POSIX4 - /* - * POSIX man page: - * The pthread_cond_timedwait() and pthread_cond_wait() functions shall - * block on a condition variable. They shall be called with mutex locked - * by the calling thread or undefined behavior results. - */ - - int result = pthread_cond_wait (&m_condition, &m_mutex.m_mutexS); - -#elif defined SYNCHRO_Solaris - int result = cond_wait (&m_condition, &m_mutex.m_mutexS); - -#endif - if (result == 0) { - // upon successful return, the lock is re-locked - m_isLocked = true; - return result; - } - if (result == EPERM) { - OSAL_ERROR ("wait failed (EPERM - operation not permitted)"); - } - else if (result != EINTR) { - OSAL_ERROR ("wait failed"); - } -} - - - - - - - - - - - - C/C++ - TRACEpr (VM); -PR ("Condition::waitUpTo ()" << showI); - -int result; -if (date.hasPassed ()) { - result = ERANGE; // it is too late ! -} -else { - result = 0; - - m_isLocked = false; // cond_timedwait will unlock the lock - OS_AL::Time::TimeVal absTime = date + OS_AL::Time::TimeVal::sysStartTime(); -#if defined SYNCHRO_POSIX4 - struct timespec finalDate; // final date in standard type - finalDate.tv_sec = absTime.getSec(); - finalDate.tv_nsec = absTime.getUsec() * 1000; - - for (;;) { - result = pthread_cond_timedwait (&m_condition, &m_mutex.m_mutexS, &finalDate); -#elif defined SYNCHRO_Solaris - timestruc_t finalDate; // final date in standard type - finalDate.tv_sec = absTime.getSec(); - finalDate.tv_nsec = absTime.getUsec() * 1000; - - for (;;) { - result = cond_timedwait (&m_condition, &m_mutex.m_mutexS, &finalDate); -#else - // not supported in vxWorks, open loop to satisfy the compilers - for (;;) { - result = 0; -#endif - if ((result == 0) || (result == ETIMEDOUT)) { - break; - } - if (result != EINTR) { - OS_AL::Util::BString500 s1 ("date="); - OSAL_ERROR (s1 << finalDate.tv_sec << " sec. , " << finalDate.tv_nsec); - } - } -} - -// upon successful return, the lock is re-locked -if (result == 0) { - m_isLocked = true; -} -return result; - - - - - - - - - C/C++ - #if defined SYNCHRO_POSIX4 || defined SYNCHRO_Linux -int result = pthread_cond_signal (&m_condition); - -#elif defined SYNCHRO_Solaris -int result = cond_signal (&m_condition); - -#endif - -if (result != 0) { - OSAL_ERROR ("could not signal condition"); -} - -return result; - - - - - - - - C/C++ - #if defined SYNCHRO_POSIX4 || defined SYNCHRO_Linux -int result = pthread_cond_broadcast (&m_condition); - -#elif defined SYNCHRO_Solaris -int result = cond_broadcast (&m_condition); - -#endif - -if (result != 0) { - OSAL_ERROR (""); -} - -return result; - - - - - - - - - wait, until the condition variable is signaled. - - The associated mutex must be locked before calling waitUpto. It will - be re-locked at the end of the call. - - - - - - - - - - wait, until the condition variable is signaled or the given date - has pased. - - The associated mutex must be locked before calling waitUpto. It will - be re-locked at the end of the call. - - - - - - - - - - - - - - signal the condition. A thread that is currently waiting for the - condition will continue. If multiple threads are waiting, only one - of these will continue. - - - - - - - - - - signal the condition. Other threads that are currently waiting for the - condition will continue. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - int receivedSigID; - sigset_t sigset; - sigemptyset (&sigset); - sigaddset (&sigset, SIGRTMIN); - for (;;) { - sigwait (&sigset, &receivedSigID); - int overruns = debugTimer.getOverrun (); - if (overruns > 0) { - TRACEpr (F6); - PR ("detected return from debugger" << showI); - TimeVal delta; - overruns++; // the actual delay is between overruns and overruns+1 - delta.setSec ((overruns / DBG_TICKS_PER_SECOND)); - delta.setUsec ((overruns % DBG_TICKS_PER_SECOND) * - DBG_RESOLUTION_MS * 1000); - TimeVal::adjustTime (delta); - PR ("adjusted time" << showI); - } - } - return NULL; - - - C/C++ - itimerspec its = { - {0, DBG_RESOLUTION_MS*1000*1000}, - {0, DBG_RESOLUTION_MS*1000*1000} - }; - - // need high priority (1) - Thread::modifySigMask (SIG_BLOCK, SIGRTMIN); - // not declared globally, since initialization order of gcc is incorrect - // (set_of_threads is initialized after) - overrunCheckThread = new Thread ("dbg-check"); - overrunCheckThread->exec (checkOverruns, NULL, 10); - - debugTimer.setTime (0, &its); - - - - - todo: need to use thread abstraction - - - - - - - - - - - - - - - - Abstraction of a Timer - -This class serves two different functions: if an instance is -created via the constructor, it provides a (posix) timer. The configuration -of this timer is done by means of the method settime, which allows -principally to configure a period length and the initial delay. - -In addtion, the timer class offers the possibility to use system -functions for waiting a specific time: - - - sleep - - wakeup - - wakePeriodicforZero - -In order to use These, it is not necessary to create a timer instance, -these operations are static. - - - - - - - C/C++ - m_id = TimerNotAssigned; - -#if defined TIMER_POSIX4 - #define ITIMER CLOCK_REALTIME // or CLOCK_MONOTONIC - - // With evp==NULL and SA_SIGINFO set , - // SIGALRM will be sent to the process (or to the thread - // not masked for this signal) - // replace SIG_IGN by a handleSigAlarm() ?????? - // mask other signals !! - - // initialisation of sigaction structure - struct sigaction act; - //act.sa_handler = (VOIDFUNCPTR) sigHandler; - //act.sa_mask = 0; - //act.sa_flags = 0; - // we have to define a handler with the following arguments: - // void sigHandler(int sig, int code, SIGCONTEXT *sigContext) {}; - - if (sigaction (SIGALRM, &act, NULL)) - OSAL_ERROR ("ON sigaction()"); - - struct sigevent sig_event; - sig_event.sigev_notify = SIGEV_SIGNAL; - sig_event.sigev_value.sival_ptr = this; - sig_event.sigev_signo = SIGRTMIN; - // sig_event.sigev_notify_function = SysTimer_impl::handler_fct; - // sig_event.sigev_notify_attributes = NULL; - - int r = timer_create (ITIMER, &sig_event, &m_id); - if (r == -1) - OSAL_ERROR ("ON timer_create()"); - -#elif defined TIMER_Solaris - #define ITIMER ITIMER_REAL // PAS CONSEILLÉ par Doc SunOS5.5 - //#define ITIMER ITIMER_VIRTUAL ??? - #define SIG_ITIMER SIGALRM // or SIGVTALRM - - // - // Si la Realtime Library de Solaris ne marche vraiment pas pour les timers - // masquer ce thread contre les autres signaux !! - // faire la methode de classe handleTimerSignal() contenant seulement : - // flag= 1; - // - //**** Prepare signal receiving - // struct sigaction sigAct; - // sigAct.sa_handler= (VOIDFUNCPTR) sigHandler); - // sigAct.sa_mask= 0; - // sigAct.sa_flags= 0; - // sigaction(SIGALRM, &sigAct, NULL); - // - // void (*f)(int); - // f= sigset(SIG_ITIMER, (void(*)(int))handleTimerSignal); - // if (f == SIG_ERR) - // OSAL_ERROR("ON sigset(SIG_ITIMER, )"); - - PRINTpr ("not yet implemented."); - pr << shErr; -#else - #error Timer_??? not defined -#endif - - - - C/C++ - int r; - -#if defined TIMER_POSIX4 - if (m_id != TimerNotAssigned) - { - r = timer_delete (m_id); - if (r == -1) { - OSAL_ERROR ("ON timer_delete()"); - } - } -#elif defined TIMER_Solaris - // [todo: resource leak?] -#else - #error Timer_??? not defined -#endif - - - - - - - - - - - - - - - - - - C/C++ - int count = 0; - - OS_AL::Util::Print pr2; - pr2 << txt; - - while (*intPtr) // while pointed integer is not zero - { - if (txt.length () != 0) // print if txt string is not empty - { - pr2 << "value *intPtr = " << *intPtr << " - wait " << duration - << " timetick(s)" << showI; - } - count ++; - Timer::sleep (duration); - - if (!(errno == EINTR || errno == ETIME)) - OSAL_ERROR (""); - } - pr2.clean (); - - TRACEpr (F7); - PR (txt << "> return after " << count - << " * " << duration << " timeticks" << showI); - - - - - - - - - - - - - - - - - - - - - - C/C++ - int r = 0; - -#if defined TIMER_POSIX4 || defined TIMER_Linux - // flags == TIMER_RELTIME ou TIMER_ABSTIME - r = timer_settime (m_id, flags, value, oldValue); - if (r == -1) - OSAL_ERROR ("ON timer_settime()"); - -#elif defined TIMER_Solaris - struct itimerval val, oldVal; - val.it_interval.tv_sec = value->it_interval.tv_sec; - val.it_interval.tv_usec = value->it_interval.tv_nsec / 1000; - val.it_value.tv_sec = value->it_value.tv_sec; - val.it_value.tv_usec = value->it_value.tv_nsec / 1000; - - if (setitimer (ITIMER, &val, &oldVal)) - OSAL_ERROR ("ON setitimer()"); - - if (oldValue) - { - oldValue->it_interval.tv_sec = oldVal.it_interval.tv_sec; - oldValue->it_interval.tv_nsec = oldVal.it_interval.tv_usec * 1000; - oldValue->it_value.tv_sec = oldVal.it_value.tv_sec; - oldValue->it_value.tv_nsec = oldVal.it_value.tv_usec * 1000; - } -#else - #error Timer_??? not defined -#endif - - return r; - - - - - - - - - - - - - C/C++ - int r = 0; - -#if defined TIMER_POSIX4 || defined TIMER_Linux - r = timer_gettime (m_id, value); - if (r == -1) - OSAL_ERROR ("ON timer_gettime()"); - -#elif defined TIMER_Solaris - struct itimerval val; - val.it_interval.tv_sec = value->it_interval.tv_sec; - val.it_interval.tv_usec = value->it_interval.tv_nsec / 1000; - val.it_value.tv_sec = value->it_value.tv_sec; - val.it_value.tv_usec = value->it_value.tv_nsec / 1000; - - if (getitimer (ITIMER, &val)) - OSAL_ERROR ("ON getitimer()"); -#else - #error Timer_??? not defined -#endif - - return r; - - - - - - - - - C/C++ - int r; - -#if defined TIMER_Linux - r = timer_getoverrun (m_id); - if (r == -1) - OSAL_ERROR ("ON timer_getoverrun()"); - -#elif defined TIMER_Cygwin || defined TIMER_Solaris - // not supported - r = 0; -#else - #error Timer_??? not defined -#endif - - return r; - - - - - - - - - - - - - - C/C++ - int r = 0; - - if (duration > 0) - { - TimeVal finalDate = TimeVal::current () + TimeVal (duration); - r = wakeUp (finalDate); - } - - return r; - - - - - - - - - - - - - C/C++ - int r = 0; - - if (!date.hasPassed ()) { - TimeVal remainder; - do { - r = waitDate (date, remainder); - } while (remainder > 0); - } - return r; - - - - - - - - - - - - - - - - - C/C++ - int r; - -#ifdef SYSTEM_Solaris - mutex_t sleepLock = DEFAULTMUTEX; // without init(), requires zeroed memory - cond_t sleepCond = DEFAULTCV; // this condition variable will never be unblocked - struct timespec final; // final date in standard type - TimeVal absTime = finalDate + TimeVal::sysStartTime (); - final.tv_sec = absTime.getSec (); - final.tv_nsec = absTime.getUsec () * 1000; - - mutex_lock (&sleepLock); - errno = r = cond_timedwait (&sleepCond, &sleepLock, &final); - mutex_unlock (&sleepLock); - // cond_destroy(&sleepCond); - // mutex_destroy(&sleepLock); - - if (errno == ETIME || errno == 0) { - r = 0; - remainder.setSec (0); - remainder.setNSec (0); - } - else if (errno == EINTR) { - // call has been interrupted by signal - r = 1; - remainder = finalDate - TimeVal::current (); - } - else { - OSAL_ERROR ("ON cond_timedwait()"); - } -#else - struct timespec delay, remainingTime; - TimeVal delayTime = finalDate - TimeVal::current (); -// #define PRECISE_WAIT -#ifdef PRECISE_WAIT - // idea: wait some ms less with nanosleep, perform busy wait after - // [todo:] does not work for remainingTime - TimeVal some_ms; - some_ms.setUsec (5*1000); - - TimeVal sleepTime = delayTime - some_ms; - delay.tv_sec = sleepTime.getSec (); - delay.tv_nsec = sleepTime.getNsec (); - r = 0; - if (sleepTime > 0) { - r = nanosleep (&delay, &remainingTime); - } - // perform busy wait for last (upto) 10 ms - do { - delayTime = finalDate - TimeVal::current (); - } - while (delayTime > 0); -#else - delay.tv_sec = delayTime.getSec (); - delay.tv_nsec = delayTime.getNsec (); - r = nanosleep (&delay, &remainingTime); -#endif - if (r == 0) - { - remainder = 0; - } - else - { - if (errno != EINTR) - OSAL_ERROR ("ON nanosleep()"); - r = 1; - // todo: remainder not used? - remainder.setSec (remainingTime.tv_sec); - remainder.setNsec (remainingTime.tv_nsec); - } -#endif - - return r; - - - - - - - activate the timer, i.e. pass an itimerspec value with initial delay -and period length. In addition, the first parameter flags is a bit -vector. If it includes TIMER_ABSTIME, it denotes that an absolute -time value for is passed as initial delay. -[Todo: would be more consistent to pass two Accord TimeVals] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if the signal associated with a timer expiration is not handled, -an overrun counter is increased with each expiration. It can be used -to detect an overload - - - - - - - - - - sleep for a certain duration (defined in time units, see -TimeVal::_moduleSec) - -If the process receives a signal, the OS sleep is interrupted -(e.g. nanosleep in case of Posix). This sleep method will recall the -OS sleep function until the specified time has passed. - - - - - - - - - - - - - - - continue computation after the (absolute) date has passed. This -function shares other properties with the sleep function. - - - - - - - - - - - - - - wait, until the variable *intPtr becomes zero, The parameter duration -determines the interval in which the variable is checked. If the -parameter txt is not empty, its contents is printed out during each -check. - -Should be considered as deprecated? (not used) - - - - - - - - - - - - - - - - - - - - used by wakeUp and sleep - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - return m_timeScale; - - - - - - - - C/C++ - return m_timespec.tv_sec; - - - - - - - - C/C++ - return m_timespec.tv_nsec / 1000; - - - - - - - - C/C++ - return m_timespec.tv_nsec; - - - - - - - - C/C++ - m_timespec.tv_sec = sec; - - - - - - - - C/C++ - m_timespec.tv_nsec = usec * 1000; - - - - - - - - C/C++ - m_timespec.tv_nsec = nsec; - - - - - - - C/C++ - return m_sysStartTime; - - - - - - - - C/C++ - int s = OS_AL::ProcessingResources::ProDesc::getEnvInt ("A_TimeScale"); -if (s <= 0) -{ - OS_AL::Util::BString500 bstr ( - "--- Environment variable 'A_TimeScale' must be positive (length of ticks in microseconds)"); - OSAL_ERROR (bstr); -} -else { - s = 1000; // default value 1000 µs = 1 ms - - OS_AL::Util::Print print; - print << - " --- Environment variable 'A_TimeScale' not found. Time intervals are assumed expressed in milliseconds." << showI; -} - -return s; - - - C/C++ - this->ticks(); -reset (); - - - - - - - C/C++ - this->ticks(); -m_timespec = t2.m_timespec; - - - - - - - - - C/C++ - this->ticks(); -setSec (ticks / m_moduloSec); -setUsec ((ticks % m_moduloSec) * m_timeScale); - - - - - - - - C/C++ - TimeVal current; -current.update (); -return current; - - - - C/C++ - /* -if (m_bFrozen) { - *this = m_freezeTime; -} -else { -*/ - *this = systemTime () - m_sysStartTime; -// } - - - - - - - - C/C++ - TimeVal current; -clock_gettime (CLOCK_REALTIME, &current.m_timespec); - -return current; - - - - - - - - - - - - C/C++ - m_timespec = tv2.m_timespec; - -return *this; - - - - - - - - - - - - C/C++ - m_timespec.tv_sec += incr.m_timespec.tv_sec; -m_timespec.tv_nsec += incr.m_timespec.tv_nsec; - -if (m_timespec.tv_nsec >= 1000*1000*1000) -{ - m_timespec.tv_sec ++; - m_timespec.tv_nsec -= 1000*1000*1000; -} - -return *this; - - - - - - - - - - - - C/C++ - m_timespec.tv_sec -= incr.m_timespec.tv_sec; -m_timespec.tv_nsec -= incr.m_timespec.tv_nsec; - -if (m_timespec.tv_nsec < 0) -{ - m_timespec.tv_sec --; - m_timespec.tv_nsec += 1000*1000*1000; -} - -return *this; - - - - - - - - - - - - C/C++ - TimeVal r (*this); -r += tv2; - -return r; - - - - - - - - - - - - C/C++ - TimeVal r (*this); -r -= tv2; - -return r; - - - - - - - - - - - - - C/C++ - return ( - (getSec () < tv2.getSec ()) || - (getSec () == tv2.getSec () && getNsec () < tv2.getNsec ())); - - - - - - - - - - - - - C/C++ - return ( - (getSec () < tv2.getSec ()) || - (getSec () == tv2.getSec () && getNsec () <= tv2.getNsec ())); - - - - - - - - - - - - - C/C++ - return ( - (getSec () == tv2.getSec ()) && (getNsec () == tv2.getNsec ())); - - - - - - - - - - - - C/C++ - return (!(*this == tv2)); - - - - - - - - - - - - C/C++ - return ( - (getSec () > tv2.getSec ()) || - (getSec () == tv2.getSec () && getNsec () >= tv2.getNsec ())); - - - - - - - - - - - - - C/C++ - return ( - (getSec () > tv2.getSec ()) || - (getSec () == tv2.getSec () && getNsec () > tv2.getNsec ())); - - - - - - - - - C/C++ - TimeVal current = TimeVal::current (); - -return ( - (getSec () < current.getSec ()) || - (getSec () == current.getSec () && getNsec () <= current.getNsec ())); - - - - C/C++ - m_timespec.tv_sec = 0; -m_timespec.tv_nsec = 0; - - - - - - - - - C/C++ - // m_moduloSec is 1000000 / m_timeScale -return - (getSec () * m_moduloSec) + - (getUsec () / m_timeScale); - - - - - - - - C/C++ - // adjust startTime -m_sysStartTime += delta; - - - - - create a new TimeVal and initilize it with 0 - - - - - copy constructor - - - - - - - - - create a TimeValue when given a number of ticks - - - - - - - - - - - - - - - - - update with current "accord" time, returned time is relative to -start of system and can be frozen (useful for debugging) - - - - - return current time (see update) - - - - - - - - - return current system time - - - - - - - - - - - - - - - - - - - increase/decrease time by increment/decrement - - - - - - - - - - - - - - - - - - - - - - - +/- operators that adds/substracts another timeval - - - - - - - - - - - - - - - - - - - - - - - all kinds of comparisons ... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - return the number of ticks represented by the timevalue - - - - - - - - - - returns true, if the current system time is later than this timeValue. -The method is called "hasPassed", since it can be used as a test -whether a deadline has passed - assuming that the stored timevalue -represents this deadline. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - set seconds and µ-seconds to zero - - - - - - - - - - - - - - - - - - adjust the current time after the execution has been stopped -(principally for debugging). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Incomplete. Without LeftShiftTrace - - - - The class Trace supports tracing. It should by instantiated -by passing a value of type Flag. These flags specify the trace -category (for instance traces related to an abstract object) and -are defined in class FlagSet. An environment variable controls -at execution time which trace categories are actually producing -output. - -Instead of directly creating instances of class Trace (on the stack), -the developer should use the macro TRACEpr which respects the compile -time flag ENABLE_TRACING. It creates the instance "pr" on the stack, -if ENABLE_TRACING is set. - -Messages to the instance "pr" are sent via the overloaded operator<<, -the supported datatypes are the same as for class Print (in fact, -the operators delegate the calls to an internal object of type print). -As for class Trace, the developer should use the macro PR to do this. -Don't forget to pass at least one "showI" to the trace instance before -it gets out of scope - otherwise the output would be empty. - -\code -Example: - function f () - { - TRACEpr (AO); // if ENABLE_TRACING => Trace pr (Flag_AO); - PR ("Function f << showI"); - PR ("This is message number " << number << showI); - } -\endcode - - - - - - - - - - - - - - - - - - - - - - C/C++ - return m_status; - - - - - - - C/C++ - if (!m_status) - PRINTerr ("NO Print for this Trace instance"); - - return (*m_prt); - - - - - - - - C/C++ - m_traceMark = traceMark; - - - - - - - - - - - - - - - - - query status - should not be called by user code (only used by overloaded operators) - - - - - - - - - - modify status - should not be called by user code (only used by overloaded operators) - - - - - - - - - - - - - - - - - - This class contains some static methods that manage a set of flags. -It is possible to add, substract or setup flags. - - - - - - - - - - - - - - - - - - C/C++ - return (f & current); - - - - - - - - - - - C/C++ - Flag old = (Flag) current; - current |= f; - - return old; - - - - - - - - - - - - C/C++ - Flag old = (Flag) current; - current = current & (~f); - - return old; - - - - - - - - - - - - C/C++ - Flag old = (Flag) current; - current = f; - - return old; - - - - - - - - - - - - C/C++ - int flags = 0; - for (unsigned int i = 0; i < fStr.length (); ++i) - { - const char f = fStr[i]; - switch (f) - { - case 'A': - flags |= FLAG_Ap; - break; - case 'C': - flags |= FLAG_Ch; - break; - case 'G': - flags |= FLAG_Gr; - break; - case 'O': - flags |= FLAG_AO; - break; - case 'R': - flags |= FLAG_RB; - break; - case 'S': - flags |= FLAG_Sc; - break; - case 'T': - flags |= FLAG_Ti; - break; - case 'U': - flags |= FLAG_Ut; - break; - case 'V': - flags |= FLAG_VM; - break; - case 'Z': - flags |= FLAG_Z; - break; - case '1': - flags |= FLAG_F1; - break; - case '2': - flags |= FLAG_F2; - break; - case '3': - flags |= FLAG_F3; - break; - case '4': - flags |= FLAG_F4; - break; - case '5': - flags |= FLAG_F5; - break; - case '6': - flags |= FLAG_F6; - break; - case '7': - flags |= FLAG_F7; - break; - case '8': - flags |= FLAG_F8; - break; - case '9': - flags |= FLAG_F9; - break; - case 'a': - flags |= FLAG_Fa; - break; - case 'b': - flags |= FLAG_Fb; - break; - case 'c': - flags |= FLAG_Fc; - break; - case 'd': - flags |= FLAG_Fd; - break; - case 'e': - flags |= FLAG_Fe; - break; - case 'f': - flags |= FLAG_Ff; - break; - case 'g': - flags |= FLAG_Fg; - break; - case 'h': - flags |= FLAG_Fh; - break; - case 'i': - flags |= FLAG_Fi; - break; - default: - PRINTpr ("unknown flag : "); - pr << f << showErr; - break; - } - } - Flag old = setUp ((Flag) flags); - - return old; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * An enumeration of flags that is used for tracing (at different places) - * It forms a bit vector. In the list below, we list the flags that - * are available, together with the letter in the A_Trace<zone-nr> - * environment variable that is used to activate the tracing. - * (if one zone is used, A_Trace0 defines the tracing that is - * activated) - * - * * FLAG_Ap 'A': appliation tracing - * * FLAG_Ch 'C': Message channel/queue (in case of distribution) - * * FLAG_Gr 'G': currently unused - * * FLAG_AO 'O': active object - * * FLAG_RB 'R': rbox - used for passing out and return parameters - * back to a caller - * * FLAG_Sc 'S': Scheduling - * * FLAG_Ti 'T': Task related - * * FLAG_Ut 'U': currently unused - * * FLAG_VM 'V': virtual machine (now OS abstraction layer), i.e. for - * Threads, SharedMemory and synchronisation classes - * such as Lock, Barrier and Condition - * * FLAG_Z 'Z': Related to zone aspects, used by ZoneController and - * in class Main. - * * FLAG_F1 '1': currently unused (used by a test program) - * * FLAG_F2 '2': currently unused - * * FLAG_F3 '3': currently unused - * * FLAG_F4 '4': currently unused - * * FLAG_F5 '5': currently unused (used by a test program) - * * FLAG_F6 '6': Indicates "return from debugger detection" in - * Time/DebugTimer and deadline violations - * * FLAG_F7 '7': Related to "container" classes, i.e. class - * CircularBuffer and BOL (Bounded ordered list) - * * FLAG_F8 '8': used for class SR_List (list of service requests) - * * FLAG_F9 '9': used for class ProDesc - * * FLAG_Fa 'a': currently unused - * * FLAG_Fb 'b': currently unused - * * FLAG_Fc 'c': currently unused - * * FLAG_Fd 'd': deadline control - * * FLAG_Fe 'e': currently unused - * * FLAG_Ff 'f': currently unused - * * FLAG_Fg 'g': currently unused - * * FLAG_Fh 'h': currently unused - * * FLAG_Fi 'i': currently unused - * * FLAG_Fj 'j': currently unused - * * FLAG_Fk 'k': currently unused - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A template for bounded string of arbitrary size. Most common functions -are factored out to the superclass BString. Constructors and the -storage - who cannot be defined in the superclass - are defined here. - - - - - - - - - - - - - - C/C++ - charTable = m_charStorage; -charTableSize = maxSize; -commonInit (); - - - - - - - - - - - - - - C/C++ - charTable = m_charStorage; -charTableSize = maxSize; -commonInit (); - -concat (ch, nChar); - - - - - - - - C/C++ - charTable = m_charStorage; -charTableSize = maxSize; -commonInit (); - -concat (bString.data()); - - - - - - - - C/C++ - charTable = m_charStorage; -charTableSize = maxSize; -commonInit (); - -concat (bString.data()); - - - - - - - - - C/C++ - charTable = m_charStorage; -charTableSize = maxSize; -commonInit (); - -concat (constCharP); - - - - - - Initialize a BString with a specific character and optionally a -number of repetitions. - - - - - - - - - - - - - - Create a BStringT given another bounded string of arbitrary size. - - - - - - The copy constructor. -Although it would be always ok to use the constructor above, this copy -constructor is necessary to avoid that the compiler implicitly -inserts a default copy constructor. - - - - - - Initialize a bounded string with a character pointer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A superclass for the template class BStringT. It factors out -all functions that do not depend on the template parameter. -Since it does not provide storage for the string, never instantiate -this class but BStringT instead (to enforce this, the constructor -is protected) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - the amount of memory allocated for the string table - - - - - - - - the length of the string in bytes (not the amount of memory allocated) - - - - - - - - - - - - - - - - - C/C++ - return charTable[index]; - - - - - - - - - - - - C/C++ - *this += d; -return *this; - - - - - - - - C/C++ - return charTableSize; - - - - - - - - - - - - - C/C++ - return !strcmp (charTable, constCharP); - - - - - - - - - - - - C/C++ - return !strcmp (charTable, bString.charTable); - - - - - - - - - - - - - C/C++ - return strcmp (charTable, consCharP); - - - - - - - - - - - - C/C++ - return strcmp (charTable, bString.charTable); - - - - - - - - C/C++ - return charTable; - - - - - - - - C/C++ - return nbytes; - - - - - - - - - - - - - C/C++ - unsigned int old = numBase; -numBase = newBase; - -return old; - - - - - - - - - C/C++ - return current - charTable; - - - - - - - - C/C++ - return m_scanOk; - - - - - - - - C/C++ - return m_separator; - - - - - - - - C/C++ - m_separator = separator; - - - - - - - - C/C++ - charTable = current = (char*) charP; -numBase = 0; -m_separator = StdSeparators; -charTableSize = 0; -nbytes = strlen(charP); - - - - - - - - - C/C++ - nbytes = 0; -concat (constCharP); -current = charTable; - - - - - - - - C/C++ - nbytes = 0; -concat (bString.charTable); -current = charTable; - - - - - - - - - C/C++ - char buffer[sizeof(unsigned int)*2+1]; - -sprintf (buffer, "%x", (unsigned int) 0 /*vp*/); -concat (buffer); - - - - - - - - - C/C++ - concat (constCharP); - - - - - - - - C/C++ - concat (c, 1); - - - - - - - - C/C++ - concat (bStr2.data()); - - - - - - - - - C/C++ - // actually, we would need a calculation of the needed buffer size: -// round-up the log10 of maxint + 2 bytes for the sign and the -// trailing 0, but it is simpler to come up with something "big enough" -char buffer[30]; -sprintf (buffer, "%i", i); -concat (buffer); - - - - - - - - - C/C++ - char buffer[30]; -sprintf (buffer, "%d", (int) l); -concat (buffer); - - - - - - - - - C/C++ - char buffer[30]; -sprintf (buffer, "%g", d); -concat (buffer); - - - - - - - - - C/C++ - char buffer[30]; -sprintf (buffer, "%f", f); -concat (buffer); - - - - - - - - - C/C++ - char buffer[30]; -sprintf (buffer, "%u", ui); -concat (buffer); - - - - - - - - - C/C++ - char buffer[30]; -sprintf (buffer, "%u", (unsigned int) ul); -concat (buffer); - - - - - - - - - - - - - - - - - - - C/C++ - unsigned int n = 0; - -for (; current < charTable + nbytes; ++current) -{ - if (strrchr (m_separator, *current) != NULL) - { // *current IS a separator - if (n > 0) - break; // end of word - // else // separators before word - } - else - { // *current IS a character of word - if (n >= sizeBuff - 1) - { - break; // truncate if word too long - } - // with NO WARNING ! but caller may test : - // if (n == sizeBuff-1) ... - buff[n++] = *current; // store a character of word - } -} - -buff[n] = '\0'; // append a null terminator - -return n; - - - - - - - - - - - - - C/C++ - char buff[2]; -if (getWord (buff, sizeof (buff)) > 0) -{ - c = buff[0]; -} -m_scanOk = (current < charTable + nbytes); -return *this; - - - - - - - - - - - - - C/C++ - char *lastP; -//double k= strtol(current, &lastP, numBase); -double k = strtod (current, &lastP); - -m_scanOk = (current != lastP); -if (m_scanOk) { - d = k; // don't modify arg, if extraction failed - current = lastP; -} -return *this; - - - - - - - - - - - - - C/C++ - char *lastP; -//float k= strtol(current, &lastP, numBase); - #ifdef SYSTEM_VxWorks -// strtof seems to be missin in vxWorks -float k = strtod (current, &lastP); - #else -float k = strtof (current, &lastP); - #endif - -m_scanOk = (current != lastP); -if (m_scanOk) { - f = k; // don't modify arg, if extraction failed - current = lastP; -} -return *this; - - - - - - - - - - - - - C/C++ - char *lastP; -int k = strtol (current, &lastP, numBase); - -m_scanOk = (current != lastP); -if (m_scanOk) { - i = k; // don't modify arg, if extraction failed - current = lastP; -} -return *this; - - - - - - - - - - - - - C/C++ - char *lastP; -long k = strtol (current, &lastP, numBase); - -m_scanOk = (current != lastP); -if (m_scanOk) { - l = k; // don't modify arg, if extraction failed - current = lastP; -} -return *this; - - - - - - - - - - - - - C/C++ - char *lastP; -long k = strtol (current, &lastP, numBase); - -m_scanOk = (current != lastP); -if (m_scanOk) { - ui = k; // don't modify arg, if extraction failed - current = lastP; -} -return *this; - - - - - - - - - - - - - C/C++ - char *lastP; -unsigned long k = strtol (current, &lastP, numBase); - -m_scanOk = (current != lastP); -if (m_scanOk) { - ul = k; // don't modify arg, if extraction failed - current = lastP; -} -return *this; - - - - - - - - - C/C++ - char *target = charTable + nbytes; -char *bound = charTable + charTableSize; -while (target != bound && *constCharP != '\0') -{ - *target++ = *constCharP++; - nbytes++; -} -if (target == bound) - OSAL_ERROR ("Bounded character table too short"); -*target = '\0'; - - - - - - - - - - - - - - C/C++ - char *target = charTable + nbytes; -char *bound = charTable + charTableSize; -unsigned int i = 0; -while (target != bound && i < size) -{ - *target++ = *constCharP++; - nbytes++; - i++; -} -if (target == bound) - OSAL_ERROR ("Bounded character table too short"); -*target = '\0'; - - - - - - - - - - - - - - C/C++ - if (nbytes + nChar >= charTableSize) { - OSAL_ERROR ("Bounded character table too short"); -} - -unsigned int i; -char *cP = charTable + nbytes; -for (i = 0; i < nChar; i++) { // concat stops on terminating zero - *cP++ = ch; -} -*cP = '\0'; -nbytes += nChar; - - - - C/C++ - numBase = 0; -current = charTable; - -m_separator = StdSeparators; - -charTable[0] = '\0'; -nbytes = 0; - - - - - - - - - C/C++ - if (pos > (unsigned int) (current - charTable + nbytes)) { - OSAL_ERROR ("BString::setPosition pos > current-begin"); -} - -current = charTable + pos; - - - - - - - - - - - - - C/C++ - *this += vp; -return *this; - - - - - - - - - - - - C/C++ - *this += constCharP; -return *this; - - - - - - - - - - - - C/C++ - *this += c; -return *this; - - - - - - - - - - - - C/C++ - *this += i; -return *this; - - - - - - - - - - - - C/C++ - *this += l; -return *this; - - - - - - - - - - - - C/C++ - *this += ui; -return *this; - - - - - - - - - - - - C/C++ - *this += ul; -return *this; - - - - - - - - - - - - C/C++ - *this += f; -return *this; - - - - - - - - - - - C/C++ - *this += bStr; -return *this; - - - - forbid the creation of an BString without storage. - - - - - forbid the implicit copying of a BString without storage. -If the copying to a BStringT type should be avoided for the sake -of efficiency, an assignment to a reference type (BString&) should be -used explicitly. -The constructor is declared private to avoid that the default -copy constructor of a subclass will based on it (which won't work, -since it is empty). Effectively, we force that the subclass declares -its own copy constructor. - - - - - - - - - create a string wrapper for a const char* -A string initialized with this pointer has a size of 0 (allocated -memory) and cannot be modified. It is a convenient way to pass -C-strings directly to functions that have a const BString & -parameter. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Scan string to retrieve one of the following types. If the scanning -was successfull (see operation scanOk), the current scan position -is set just behind the input consumed. Therefore, a successive -invocation of this operator will continue scanning at the new -position (see get/setPosition) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - the standard index operator - - - - - - - - - - - - - - - Indicates, whether the last scan (via operator >>) was successfull - - - - - - - - - - Set numerical base for the scanning of longs and integer) -(the default value 0 indicates base 10) - - - - - - - - - - - - - - - Get the current position within the string for scanning -(via operator >>). - - - - - - - - - - Set the current position within the string for scanning -(via operator >>). - - - - - - - - comparison operators with the obvious semantics ... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provide access to the memory location of the string. Use with care, -since it allows a caller to corrupt the string contents. - - - - - - - - - - get the string containing separator characters that are used by -getWord and during the scanning of characters. - - - - - - - - set the string containing separator characters. Only the address of -the passed string is stored (no copy is made). Therefore, the passed -string may not be a local variable that might run out of scope. - - - - - - - - retrieve a pointer to a part of the character string - - - - - - - - - - - - - - returns the size of the allocated memory (i.e. the maximum length -of the string) - - - - - - - - returns the length of the string - - - - - - - - - internal function that appends (concatenates) a string to the -character table - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - return middle; - - - - - - - - C/C++ - return middle; - - - - - - - - C/C++ - m_mark = mark; - - - - - - - - - - - - C/C++ - middle = str; -return *this; - - - - - - - - - - - - - C/C++ - middle = ccp; -return *this; - - - - - - - - - - - - C/C++ - middle << str; -return *this; - - - - - - - - - - - - - C/C++ - middle << ccp; -return *this; - - - - C/C++ - - - - - - - - - - C/C++ - m_initFlag = 1; -m_head = ccp; - - - - - - - - C/C++ - return m_head; - - - - - - - - - C/C++ - BString500 bstr; -bstr << OS_AL::ProcessingResources::Thread::getName () << " "; -bstr << OS_AL::Time::TimeVal::current ().ticks () << " "; - -if (m_initFlag) { - bstr << m_head; -} -bstr << ErrMark << ccp; -if (errno) - bstr << " - error " << errno - << " (" << strerror (errno) << ")"; -cout << bstr.data () << endl; -errno = 0; - - - - - - - - - - - - - - - - - - - C/C++ - BString500 str (file); -str << line << charP; -printErr (str.data ()); - - - - - - - - - - - - - - C/C++ - BString500 prefix; -// prefix << "ID: " << (void*) Thread::getId () << " "; -prefix << OS_AL::ProcessingResources::Thread::getName () << " "; -prefix << OS_AL::Time::TimeVal::current ().ticks () << " "; -if (m_initFlag) { - prefix << m_head; -} -prefix << mark << begin; - -if (log) { - // messages with file stamp - clog << prefix.data () << middle.data() << endl; -} -else { - cout << prefix.data () << middle.data() << endl; -} -m_shown = 1; - - - - C/C++ - middle = ""; -m_shown = 1; // allows to avoid showing empty instances - - - - - - - - - - - - - C/C++ - middle << ch; -return *this; - - - - - - - - - - - C/C++ - print (StdMark); -clean (); -return *this; - - - - C/C++ - if (m_shown == 0) { - print (m_mark.data ()); // print residual middle text - printErr ("Instance of print destroyed, before it was shown (missing \"showI\"). Stored text is: "); - print (" <<"); -#if StopIfNeverShown == 1 - exit(1); -#endif -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Predefined types and variables to provoke output). The (dummy) types are -used to overload the << operator and statically choose the associated -method if an instance (declared below) is passed. -Show: output the whole line immediately and reset the output string - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pthread - rt - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.di deleted file mode 100644 index 6432ab900ff..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.di +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.notation deleted file mode 100644 index 66345951ba3..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.notation +++ /dev/null @@ -1,2575 +0,0 @@ - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    - - - - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.uml deleted file mode 100644 index af9181b76ac..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.uml +++ /dev/null @@ -1,516 +0,0 @@ - - - - - Call event interceptor, interacts with state-machine. It will handle in particular call events that are intercepted by the port operations - - - Container rule for state machine realization. It consists of a collaboration of a call event interceptor, an event pool, the state-machine itself and a thread for this state-machine. The latter means that the state-machine will execute in its own thread and poll the pool for new events. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - !xtend StateMachineGen.eventInterceptor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - !xtend StateMachineGen.processEvents - - - - - C/C++ - !xtend StateMachineGen.activate - - - - - - - - - - - - - - - - - - - - - - - - - - - Animation service configurator takes care of allocating the RemoveAnimService on the "right" node and to connect local and remote service configurators. - - - - - - - - - - - - - C/C++ - if (outAnimSvc != 0) { - outAnimSvc->leaveState(stateEnum, eInstance); -} - - - - C/C++ - if (outAnimSvc != 0) { - outAnimSvc->enterState(stateEnum, eInstance); -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <<TextualRepresentation>>public abstract enterState (in stateEnum : StateMachine::Short, in eInstance : String) ; - - - - - - - - - - - - - - - <<TextualRepresentation>>public abstract leaveState(in eState : StateMachine::Short, in eInstance : String) ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Container rule for an OO state machine. The main difference is that we use OO variants of the contained elements and replace the interception connector by an interception operation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - !xtend StateMachineGen.eventInterceptorOO - - - C/C++ - // create connection between thread and this class -thread.connect_rLC(get_lc()); - - - C/C++ - !xtend StateMachineGen.processEvents - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.di deleted file mode 100644 index dbd0aabd9ce..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.di +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.notation deleted file mode 100644 index 0122891b2b9..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.notation +++ /dev/null @@ -1,269 +0,0 @@ - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - parametersName - parametersDirection - name - parametersType - returnType - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.uml deleted file mode 100644 index 35fb7fa4914..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.uml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - Support for Signal Reception. Interfaces that have at least one signal reception should also inherit from this interface in order to allow for signal reception. -Currently not clear whether that should be done as part of the component to OO transformation or within the application model on user demand. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <<TextualRepresentation>>public addEvent () { } - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.di deleted file mode 100644 index 61f9c2fac17..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.di +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.notation deleted file mode 100644 index 989a0923956..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.notation +++ /dev/null @@ -1,119 +0,0 @@ - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.uml deleted file mode 100644 index aec9cff4984..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.uml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.di b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.di deleted file mode 100644 index 9ff5520aae6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.di +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.notation b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.notation deleted file mode 100644 index 57b432f3a65..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.notation +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.uml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.uml deleted file mode 100644 index b90cad4bdad..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.uml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.properties b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.properties deleted file mode 100644 index 2e655ccb549..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus extra: Qompass core model library (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.xml deleted file mode 100644 index ed77d369a14..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - class="org.eclipse.papyrus.qompass.designer.gentools.cpp.CppLanguageSupport" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/pom.xml b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/pom.xml deleted file mode 100644 index 36f46641d87..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.qompass.modellibs.core - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-clean-plugin - - - - xtend-gen - - **/* - - - .gitignore - - - - - - - org.eclipse.xtend - xtend-maven-plugin - - - generate-sources - - compile - - - - - xtend-gen - ${project.build.directory}/xtend-gen/test - - - - - diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/Activator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/Activator.java deleted file mode 100644 index 8859e978d40..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/Activator.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core; - -import org.eclipse.papyrus.infra.core.log.LogHelper; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.modellibs.core"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - public static LogHelper log; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - - // register the login helper - log = new LogHelper(plugin); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java deleted file mode 100644 index 5972200b5ff..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java +++ /dev/null @@ -1,27 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core; - -import org.eclipse.papyrus.uml.diagram.wizards.ModelCopyWizard; - -/** - * Copy wizard for the HelloWorld example - */ -public class HelloWorldModelWizard extends ModelCopyWizard { - - public HelloWorldModelWizard() { - super("HelloWorld"); //$NON-NLS-1$ - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java deleted file mode 100644 index 38ae39a4204..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java +++ /dev/null @@ -1,27 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core; - -import org.eclipse.papyrus.uml.diagram.wizards.ModelCopyWizard; - -/** - * Copy wizard for the ProducerConsumer example - */ -public class ProducerConsumerModelWizard extends ModelCopyWizard { - - public ProducerConsumerModelWizard() { - super("ProducerConsumer"); //$NON-NLS-1$ - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindCppIncludeToFirstActual.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindCppIncludeToFirstActual.java deleted file mode 100644 index a8e25cbbf12..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindCppIncludeToFirstActual.java +++ /dev/null @@ -1,73 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.bindinghelpers; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.C_Cpp.Include; -import org.eclipse.papyrus.FCM.util.IBindingHelper; -import org.eclipse.papyrus.qompass.designer.core.listeners.PostCopyListener; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; -import org.eclipse.papyrus.qompass.designer.core.templates.TextTemplateBinding; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Instantiate (bind Acceleo template) the text within a C++Include stereotype. - * - * The actual is the first actual within the template binding. This function does not check - * whether the classifier has the template stereotype. - * - * Note: this function is C++ specific, but many parts of the model library are C++ specific as well - * - */ -public class BindCppIncludeToFirstActual implements PostCopyListener, IBindingHelper { - - @Override - public void postCopyEObject(LazyCopier copy, EObject targetEObj) { - // if (copy.get(sourceEObj) isWithinTemplate) - if (targetEObj instanceof Classifier) { - - Classifier targetCl = (Classifier) targetEObj; - try { - Classifier actual = TemplateUtils.getFirstActualFromBinding(binding); - Include cppInclude = UMLUtil.getStereotypeApplication(targetCl, Include.class); - if ((actual != null) && (cppInclude != null)) { - TransformationContext.classifier = targetCl; - String newBody = TextTemplateBinding.bind(cppInclude.getBody(), actual, null); - String newPreBody = TextTemplateBinding.bind(cppInclude.getPreBody(), actual, null); - String newHeader = TextTemplateBinding.bind(cppInclude.getHeader(), actual, null); - cppInclude.setBody(newBody); - cppInclude.setPreBody(newPreBody); - cppInclude.setHeader(newHeader); - } - } catch (TransformationException e) { - // create nested exception - throw new RuntimeException(e); - } - } - } - - protected TemplateBinding binding; - - @Override - public void handleElement(TemplateBinding binding, Element object) { - this.binding = binding; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindOperation.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindOperation.java deleted file mode 100644 index 6b2d352e1ee..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindOperation.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core.bindinghelpers; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.FCM.util.IBindingHelper; -import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; -import org.eclipse.papyrus.qompass.designer.core.templates.BindingUtils; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.qompass.modellibs.core.Activator; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.OpaqueBehavior; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.TemplateBinding; - -/** - * Bind an operation to an actual, i.e. evaluate the Acceleo template within the opaque behavior associated with - * the operation. - */ -public class BindOperation implements IBindingHelper, PreCopyListener { - - private TemplateBinding binding; - - @Override - public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { - - if (sourceEObj instanceof Operation) { - Operation operation = (Operation) sourceEObj; - Classifier actual = TemplateUtils.getFirstActualFromBinding(binding); - - Operation newOperation = BindingUtils.instantiateOperation(copy, actual, operation); - for (Behavior method : operation.getMethods()) { - if (method instanceof OpaqueBehavior) { - try { - Behavior newBehavior = - BindingUtils.instantiateBehavior(copy, actual, (OpaqueBehavior) method); - newBehavior.setSpecification(newOperation); - } catch (TransformationException e) { - Activator.log.error(e); - } - } - } - return newOperation; - } - return sourceEObj; - } - - @Override - public void handleElement(TemplateBinding binding, Element object) { - this.binding = binding; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/InstantiateCppIncludeWithItSelf.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/InstantiateCppIncludeWithItSelf.java deleted file mode 100644 index cd4a730ee30..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/InstantiateCppIncludeWithItSelf.java +++ /dev/null @@ -1,74 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.bindinghelpers; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.C_Cpp.Include; -import org.eclipse.papyrus.FCM.Template; -import org.eclipse.papyrus.FCM.util.IBindingHelper; -import org.eclipse.papyrus.qompass.designer.core.listeners.PostCopyListener; -import org.eclipse.papyrus.qompass.designer.core.templates.TextTemplateBinding; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Instantiate (bind Acceleo template) the text within a C++Include stereotype. - * - * Difference to InstantiateCppInclude: This function does not obtain the actual from a template - * binding. Instead it takes the classifier having the Template stereotype as actual. - * TODO: What's the use of this function. The classifier is known at this time - unless in a template? - * - * Note: this function is C++ specific, but many parts of the model library are C++ specific as well - * - */ -@Deprecated -public class InstantiateCppIncludeWithItSelf implements PostCopyListener, IBindingHelper { - - @Override - public void postCopyEObject(LazyCopier copy, EObject targetEObj) { - // if (copy.get(sourceEObj) isWithinTemplate) - if (targetEObj instanceof Classifier) { - // TODO: C++ specific code! - Classifier targetCl = (Classifier) targetEObj; - Template template = UMLUtil.getStereotypeApplication(targetCl, Template.class); - // apply, in case of pass-classifier - if ((template != null) && (template.getHelper() == null)) { - try { - Include cppInclude = UMLUtil.getStereotypeApplication(targetCl, Include.class); - TransformationContext.classifier = targetCl; - String newBody = TextTemplateBinding.bind(cppInclude.getBody(), targetCl, null); - String newPreBody = TextTemplateBinding.bind(cppInclude.getPreBody(), targetCl, null); - String newHeader = TextTemplateBinding.bind(cppInclude.getHeader(), targetCl, null); - cppInclude.setBody(newBody); - cppInclude.setPreBody(newPreBody); - cppInclude.setHeader(newHeader); - } catch (TransformationException e) { - // create nested exception - throw new RuntimeException(e); - } - } - } - } - - @Override - public void handleElement(TemplateBinding binding, Element object) { - // don't need to handle binding - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/LoopOperations.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/LoopOperations.java deleted file mode 100644 index 996363af3dd..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/LoopOperations.java +++ /dev/null @@ -1,130 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.bindinghelpers; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.papyrus.FCM.util.IBindingHelper; -import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; -import org.eclipse.papyrus.qompass.designer.core.templates.BindingUtils; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; -import org.eclipse.papyrus.qompass.designer.core.templates.TextTemplateBinding; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.qompass.modellibs.core.Activator; -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.EnumerationLiteral; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.OpaqueBehavior; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.Type; - -/** - * This binding helper loops over all operations of the actual template parameter - * (typically an interface) - * - */ -public class LoopOperations implements IBindingHelper, PreCopyListener { - - private TemplateBinding binding; - - @Override - public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { - - if (sourceEObj instanceof Operation) { - Operation operation = (Operation) sourceEObj; - - Classifier actual = TemplateUtils.getFirstActualFromBinding(binding); - - if (!(actual instanceof Interface)) { - return sourceEObj; - } - Interface passedActualIntf = (Interface) actual; - Operation last = null; - EList removalList = new BasicEList(); - for (Operation intfOperation : passedActualIntf.getAllOperations()) { - for (Element removalElement : removalList) { - copy.removeForCopy(removalElement); // enable subsequent instantiations - } - removalList.clear(); - last = BindingUtils.instantiateOperation(copy, intfOperation, operation); - removalList.add(operation); - for (Behavior method : operation.getMethods()) { - if (method instanceof OpaqueBehavior) { - try { - Behavior newBehavior = - BindingUtils.instantiateBehavior(copy, intfOperation, (OpaqueBehavior) method); - newBehavior.setSpecification(last); - } catch (TransformationException e) { - Activator.log.error(e); - ; - } - // removalList.add(method); - copy.removeForCopy(method); // enable subsequent instantiations - } - } - } - // from a logical viewpoint, we need to copy parameters & name, but not the - // operation identity. - copy.put(operation, last); - return last; - /* - * else { // not LOOP_OPERATIONS - * Operation newOperation = instantiateOperation(actual, template, operation, boundClass); - * for(Behavior method : operation.getMethods()) { - * if(method instanceof OpaqueBehavior) { - * Behavior newBehavior = - * instantiateBehavior(actual, template, (OpaqueBehavior)method); - * newBehavior.setSpecification(newOperation); - * } - * } - * return newOperation; - */ - } - else if (sourceEObj instanceof EnumerationLiteral) { - EnumerationLiteral literal = (EnumerationLiteral) sourceEObj; - Classifier actual = TemplateUtils.getFirstActualFromBinding(binding); - // Type passedActual = getPassedActual(template, actual, boundClass); - Type passedActual = actual; - if (!(passedActual instanceof Interface)) { - return sourceEObj; - } - Interface passedActualIntf = (Interface) passedActual; - EnumerationLiteral newLiteral = null; - for (Operation intfOperation : passedActualIntf.getAllOperations()) { - copy.removeForCopy(literal); - newLiteral = copy.getCopy(literal); - try { - String newName = TextTemplateBinding.bind(literal.getName(), intfOperation, null); - newLiteral.setName(newName); - } catch (TransformationException e) { - Activator.log.error(e); - newLiteral.setName("none"); //$NON-NLS-1$ - } - } - return newLiteral; - } - return null; - } - - @Override - public void handleElement(TemplateBinding binding, Element object) { - this.binding = binding; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/embeddingrules/AccordCall.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/embeddingrules/AccordCall.java deleted file mode 100644 index e76e284f645..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/embeddingrules/AccordCall.java +++ /dev/null @@ -1,95 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.embeddingrules; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.papyrus.FCM.Connector; -import org.eclipse.papyrus.FCM.util.ConnectorTypeUtil; -import org.eclipse.papyrus.FCM.util.FCMUtil; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.ConnectableElement; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.util.UMLUtil; - -/** - * Embedding rule - * TODO: currently unused - * - */ -// @unused -public class AccordCall extends ConnectorTypeUtil { - - private ConnectableElement clientRole = null; - private ConnectableElement serverRole = null; - private ConnectableElement rtuRole = null; - private ConnectableElement connectorRole = null; - - @Override - public FCMUtil.RoleBindingTable getRoleBindings(Connector connector) { - super.getRoleBindings(connector); - - clientRole = bindingTable.getRoleKeyByName("client"); - serverRole = bindingTable.getRoleKeyByName("server"); - rtuRole = bindingTable.getRoleKeyByName("rtu"); - connectorRole = bindingTable.getRoleKeyByName("connector"); - - for (org.eclipse.uml2.uml.ConnectorEnd end : connector.getBase_Connector().getEnds()) { - if (end.getRole() instanceof org.eclipse.uml2.uml.Port) { - org.eclipse.uml2.uml.Port port = (org.eclipse.uml2.uml.Port) end.getRole(); - org.eclipse.uml2.uml.Property part = end.getPartWithPort(); - if (StereotypeUtil.isApplied(port, org.eclipse.papyrus.FCM.Port.class)) { - org.eclipse.papyrus.FCM.Port fcmPort = UMLUtil.getStereotypeApplication(port, org.eclipse.papyrus.FCM.Port.class); - if (fcmPort.getKind().getBase_Class().getName().equals("UseInterfaceWithRtf")) { - // => elements associated with the connector end play the client role - List clientActors = new ArrayList(); - clientActors.add(port); - clientActors.add(part); - bindingTable.addEntry(clientRole, clientActors); - } - else if (fcmPort.getKind().getBase_Class().getName().equals("ProvideInterface")) { - // => elements associated with the connector end play the server role - List serverActors = new ArrayList(); - serverActors.add(port); - serverActors.add(part); - bindingTable.addEntry(serverRole, serverActors); - // the property playing the server role must also play the rtu role - port = ((org.eclipse.uml2.uml.Class) part.getType()).getOwnedPort("rtu", null); - if (port == null) { - if (((org.eclipse.uml2.uml.Class) part.getType()).getInheritedMember("rtu") != null && - ((org.eclipse.uml2.uml.Class) part.getType()).getInheritedMember("rtu") instanceof org.eclipse.uml2.uml.Port) { - port = (org.eclipse.uml2.uml.Port) ((org.eclipse.uml2.uml.Class) part.getType()).getInheritedMember("rtu"); - } - else { - System.out.println("Could not find a port rtu on part " + part.getName() + " : " + part.getType()); - } - } - if (port != null) { - List rtuActors = new ArrayList(); - rtuActors.add(port); - rtuActors.add(part); - bindingTable.addEntry(rtuRole, rtuActors); - } - } - } - } - } - List connectorActors = new ArrayList(); - connectorActors.add(connector.getBase_Connector()); - bindingTable.addEntry(connectorRole, connectorActors); - return bindingTable; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/AnimServiceConfigurator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/AnimServiceConfigurator.java deleted file mode 100644 index b33d4053ed2..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/AnimServiceConfigurator.java +++ /dev/null @@ -1,68 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.iconfigurators; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; -import org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Property; - -/** - * Configurator for the Eclipse animation server. This instance is systematically - * allocated to a node named "Eclipse" call event (for a state machine): it sets the - * portID attribute of the call event interceptor. The interceptor uses this - * attribute to initialize the portID attribute within the produced CallEvent - * data structure. - * - * @author ansgar - * - */ -public class AnimServiceConfigurator implements IInstanceConfigurator { - - public final static String eclipseAnimService = "Eclipse"; //$NON-NLS-1$ - - /** - * Configure the instance of a CallEvent interceptor. The configuration parameter is the - * index of the port which gets intercepted. It is obtained via an enumeration - * - * @see org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator#configureInstance(org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.Port) - * - * @param instance - * the instance that should be configured - * @param componentPart - * the part representing this instance - * @param context - * container context - */ - @Override - public void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) - { - EList nodes = AllocUtils.getAllNodesOrThreadsParent(parentInstance); - if (nodes.size() > 0) { - InstanceSpecification node = nodes.get(0); - // problem: instance specification is within intermediate model, thus incomplete. - // option: explicitly pre-create singletons (and allocate these?) - NamedElement animService = node.getNearestPackage().getMember(eclipseAnimService); - if (animService instanceof InstanceSpecification) { - AllocUtils.allocate(instance, (InstanceSpecification) animService); - return; - } - } - // throw new TransformationRTException(String.format("Cannot find node <%s> in platform definition", eclipseAnimService)); - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/CallEventConfigurator.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/CallEventConfigurator.java deleted file mode 100644 index db9831cd43a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/CallEventConfigurator.java +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.iconfigurators; - -import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; -import org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Property; - -/** - * Configurator of a call event (for a state machine): it sets the - * portID attribute of the call event interceptor. The interceptor uses this - * attribute to initialize the portID attribute within the produced CallEvent - * data structure. - * - * @author ansgar - * - */ -public class CallEventConfigurator implements IInstanceConfigurator { - - public final static String portAttribute = "portID"; //$NON-NLS-1$ - - /** - * Configure the instance of a CallEvent interceptor. The configuration parameter is the - * index of the port which gets intercepted. It is obtained via an enumeration - * - * @see org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator#configureInstance(org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.Port) - * - * @param instance - * the instance that should be configured - * @param componentPart - * the part representing this instance - * @param context - * container context - */ - @Override - public void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) - { - if (parentInstance != null) { - // make sure that there is an enum par port - // String literalName = "port_" + UMLTool.varName(context.port); //$NON-NLS-1$ - - // the associated enumeration is declared by the statemachine (which is included by the bootloader as well) - - DepPlanUtils.configureProperty(instance, portAttribute, 0); - } - } - -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIcallback.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIcallback.java deleted file mode 100644 index 74809d9cc9b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIcallback.java +++ /dev/null @@ -1,162 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; - -import java.util.Iterator; - -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.util.IMappingRule; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.ParameterDirectionKind; -import org.eclipse.uml2.uml.Type; - - -public class AMIcallback implements IMappingRule { - - private static final String _REPLY = "_reply_"; //$NON-NLS-1$ - private static final String _REQUEST = "_request_"; //$NON-NLS-1$ - private static final String AMI_CB = "AMI_CB"; //$NON-NLS-1$ - - @Override - public Type calcDerivedType(Port p, boolean update) { - Type type = p.getType(); - if (!(type instanceof Interface)) { - return null; - } - - Interface typingInterface = (Interface) type; - Class derivedType = MapUtil.getDerivedClass(p, AMI_CB); - Interface derivedRequestInterface = MapUtil.getDerivedInterface(p, _REQUEST); - Interface derivedReplyInterface = MapUtil.getDerivedInterface(p, _REPLY); - MapUtil.addUsage(derivedType, derivedRequestInterface); // caller can use (require) the request interface - MapUtil.addRealization(derivedType, derivedReplyInterface); // callers must implement (provide) the reply interface - - if (!update) { - return derivedType; - } - - // ----------------------------------------------- - // calculate "request" interface (OUT parameter are removed) - // ----------------------------------------------- - for (Operation operation : typingInterface.getOwnedOperations()) { - String name = operation.getName(); - - // check whether operation already exists. Create, if not - Operation derivedOperation = derivedRequestInterface.getOperation(name, null, null); - if (derivedOperation == null) { - derivedOperation = derivedRequestInterface.createOwnedOperation(name, null, null); - } - - // request operation contains only in and inout parameters - for (Parameter parameter : operation.getOwnedParameters()) { - if ((parameter.getDirection() == ParameterDirectionKind.IN_LITERAL) || - (parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL)) { - - String paramName = parameter.getName(); - Type paramType = parameter.getType(); - if (derivedOperation.getOwnedParameter(paramName, paramType) == null) { - Parameter newParameter = derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType()); - newParameter.setDirection(parameter.getDirection()); - newParameter.setLower(parameter.getLower()); - newParameter.setUpper(parameter.getUpper()); - } - } - } - - // remove those parameters that exist in derived, but not original interface. - Iterator derivedParameters = derivedOperation.getOwnedParameters().iterator(); - while (derivedParameters.hasNext()) { - Parameter parameter = derivedParameters.next(); - String paramName = parameter.getName(); - Type paramType = parameter.getType(); - if (operation.getOwnedParameter(paramName, paramType) == null) { - // not on in original interface, remove from derived as well - derivedParameters.remove(); - } - } - } - - // check whether operations in derived interface exist in original interface - // (remove, if not) - Iterator derivedRequestOperations = derivedRequestInterface.getOwnedOperations().iterator(); - while (derivedRequestOperations.hasNext()) { - Operation derivedOperation = derivedRequestOperations.next(); - String name = derivedOperation.getName(); - if (name == null) { - continue; - } - if (typingInterface.getOperation(name, null, null) == null) { - // not in typing interface, remove - derivedRequestOperations.remove(); - } - } - - // ----------------------------------------------- - // calculate "reply" interface (with OUT and INOUT parameter transformed into in parameters) - // ----------------------------------------------- - for (Operation operation : typingInterface.getOwnedOperations()) { - String name = operation.getName(); - - if (AMIpoll.hasOutParameters(operation)) { - - // check whether operation already exists. Create, if not - Operation derivedOperation = derivedReplyInterface.getOperation(name, null, null); - if (derivedOperation == null) { - derivedOperation = derivedReplyInterface.createOwnedOperation(name, null, null); - } - - // each non-in parameter is in the poll operation. - for (Parameter parameter : operation.getOwnedParameters()) { - if (parameter.getDirection() != ParameterDirectionKind.IN_LITERAL) { // OUT and INOUT - - String paramName = parameter.getName(); - Type paramType = parameter.getType(); - if (derivedOperation.getOwnedParameter(paramName, paramType) == null) { - Parameter newParameter = derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType()); - newParameter.setDirection(ParameterDirectionKind.IN_LITERAL); - newParameter.setLower(parameter.getLower()); - newParameter.setUpper(parameter.getUpper()); - } - } - } - - // remove those parameters that exist in derived, but not original interface. - Iterator derivedParameters = derivedOperation.getOwnedParameters().iterator(); - while (derivedParameters.hasNext()) { - Parameter parameter = derivedParameters.next(); - String paramName = parameter.getName(); - Type paramType = parameter.getType(); - if (operation.getOwnedParameter(paramName, paramType) == null) { - // not on in original interface, remove from derived as well - derivedParameters.remove(); - } - } - } - } - - // check whether operations in derived interface exist in original interface - // (remove, if not) - Iterator derivedReplyOperations = derivedReplyInterface.getOwnedOperations().iterator(); - while (derivedRequestOperations.hasNext()) { - Operation derivedOperation = derivedReplyOperations.next(); - String name = derivedOperation.getName(); - if (name == null) { - continue; - } - if (typingInterface.getOperation(name, null, null) == null) { - // not in typing interface, remove - derivedReplyOperations.remove(); - } - } - - return derivedType; - } - - @Override - public boolean needsUpdate(Port p) { - // TODO: insufficient condition - return (calcDerivedType(p, false) == null); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIpoll.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIpoll.java deleted file mode 100644 index 220f2021465..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIpoll.java +++ /dev/null @@ -1,161 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; - -import java.util.Iterator; - -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.util.IMappingRule; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.ParameterDirectionKind; -import org.eclipse.uml2.uml.Type; - - -/** - * Implement a CORBA AMI style polling interface - * This is defined in the CORBA 3 standard in section 22.6.2 - * A difference is that we do not return the poller object, but the client uses the original port. - * This has the consequence that it is not possible to make multiple asynchronous requests. - * - * A second difference is that we do not keep the normal methods in the same interface and prefix the - * new ones. (which would probably be a good idea). - * - */ -public class AMIpoll implements IMappingRule { - - private static final String IAMI_POLL = "IAMIPoll_"; //$NON-NLS-1$ - private static final String AMI_POLL = "AMIPoll_"; //$NON-NLS-1$ - - @Override - public Type calcDerivedType(Port p, boolean update) { - Type type = p.getType(); - if (!(type instanceof Interface)) { - return null; - } - - Class derivedType = MapUtil.getDerivedClass(p, AMI_POLL); - Interface typingInterface = (Interface) type; - Interface derivedInterface = MapUtil.getDerivedInterface(p, IAMI_POLL); - MapUtil.addUsage(derivedType, derivedInterface); - - if (!update) { - return derivedType; - } - - for (Operation operation : typingInterface.getOwnedOperations()) { - String name = operation.getName(); - - // check whether operation already exists. Create, if not - Operation derivedOperation = derivedInterface.getOperation(name, null, null); - if (derivedOperation == null) { - derivedOperation = derivedInterface.createOwnedOperation(name, null, null); - } - - if (hasOutParameters(operation)) { - String pollName = name + "Poll"; //$NON-NLS-1$ - Operation derivedPollOperation = derivedInterface.getOperation(pollName, null, null); - if (derivedPollOperation == null) { - derivedPollOperation = derivedInterface.createOwnedOperation(pollName, null, null); - } - - // each non-in parameter is in the poll operation. - derivedPollOperation.createOwnedParameter("timeout", null); //$NON-NLS-1$ - - for (Parameter parameter : operation.getOwnedParameters()) { - if (parameter.getDirection() != ParameterDirectionKind.IN_LITERAL) { - - String paramName = parameter.getName(); - Type paramType = parameter.getType(); - if (derivedPollOperation.getOwnedParameter(paramName, paramType) == null) { - Parameter newParameter = - derivedPollOperation.createOwnedParameter(parameter.getName(), parameter.getType()); - newParameter.setDirection(parameter.getDirection()); - newParameter.setLower(parameter.getLower()); - newParameter.setUpper(parameter.getUpper()); - } - } - } - } - // each in and inout parameter is in the request operation. - for (Parameter parameter : operation.getOwnedParameters()) { - if ((parameter.getDirection() == ParameterDirectionKind.IN_LITERAL) || - (parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL)) { - - String paramName = parameter.getName(); - Type paramType = parameter.getType(); - if (derivedOperation.getOwnedParameter(paramName, paramType) == null) { - Parameter newParameter = - derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType()); - newParameter.setDirection(parameter.getDirection()); - newParameter.setLower(parameter.getLower()); - newParameter.setUpper(parameter.getUpper()); - } - } - } - // remove those parameters that exist in derived, but not original interface. - Iterator derivedParameters = derivedOperation.getOwnedParameters().iterator(); - while (derivedParameters.hasNext()) { - Parameter parameter = derivedParameters.next(); - String paramName = parameter.getName(); - Type paramType = parameter.getType(); - if ((!paramName.equals("timeout")) && //$NON-NLS-1$ - (operation.getOwnedParameter(paramName, paramType) == null)) { - // not on in original interface, remove from derived as well - derivedParameters.remove(); - } - } - } - - // check whether operations in derived interface exist in original interface - // (remove, if not) - Iterator derivedOperations = derivedInterface.getOwnedOperations().iterator(); - while (derivedOperations.hasNext()) { - Operation derivedOperation = derivedOperations.next(); - String name = derivedOperation.getName(); - if (name == null) { - continue; - } - if (name.endsWith("Poll")) { //$NON-NLS-1$ - // remove Poll postfix - name = name.substring(0, name.length() - 4); - } - if (typingInterface.getOperation(name, null, null) == null) { - // not in typing interface, remove - derivedOperations.remove(); - } - } - - return derivedType; - } - - public static boolean hasOutParameters(Operation operation) { - for (Parameter parameter : operation.getOwnedParameters()) { - if (parameter.getDirection() != ParameterDirectionKind.IN_LITERAL) { - return true; - } - } - return false; - } - - @Override - public boolean needsUpdate(Port p) { - // TODO: insufficient condition - return (calcDerivedType(p, false) == null); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort.java deleted file mode 100644 index 3d08ffae8bf..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort.java +++ /dev/null @@ -1,132 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; - -import org.eclipse.papyrus.FCM.util.IMappingRule; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.papyrus.qompass.designer.core.OperationUtils; -import org.eclipse.papyrus.qompass.designer.core.PortUtils; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Type; - - -/** - * An extended Port in the sense of the DDS4CCM standard: a port typed with a component - * type. Since the component typing the port can have multiple provided and required - * ports, the ports are implicitly owned by the port. Conjugation on the level of an extended - * port level will conjugate all ports of the component typing the port. - * - * The derived interface that is provided will concatenate provided port names within the - * extended port with the port name and provided a "big" interface. - * The derived interface that is required is identical, except for a conjugation on the - * extended port level. - * - * Creates a fixed template binding that binds T (of the extended Port) to the used data type - * - * Here, the idea is that the port type is a classifier, e.g. the data type that is - * transported by a DDS port. The port kind is the extended port, e.g. DDSWrite. - * - * The derived property isExtended of FCM port-kind is true, if the class representing the port-kind owns at least one - * port - * - * TODO: This class has become obsolete now, since extended DDS ports are now supported via flattening - * - */ -@Deprecated -public class ExtendedPort implements IMappingRule { - - public static final String PROV_PREFIX = "P_"; //$NON-NLS-1$ - - public static final String REQ_PREFIX = "R_"; //$NON-NLS-1$ - - @Override - public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p) { - return needsUpdate(p, false) || - needsUpdate(p, true); - } - - public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p, boolean isRequired) { - return true; - } - - @Override - public Type calcDerivedType(org.eclipse.papyrus.FCM.Port p, boolean update) - { - Type type = p.getType(); - if (!(type instanceof Classifier)) { - return null; - } - Class extendedPort = p.getKind().getBase_Class(); - - String prefix = extendedPort.getName() + "_" + (p.getBase_Port().isConjugated() ? REQ_PREFIX : PROV_PREFIX); //$NON-NLS-1$ - Interface derivedInterface = MapUtil.getDerivedInterface(p, prefix, true); - if (!update) { - return derivedInterface; - } - if (derivedInterface == null) { - return null; - } - /* - * TemplateSignature signature = TemplateUtils.getSignature(type.getNearestPackage()); - * if(signature != null) { - * Package model = Utils.getTop(derivedInterface); - * try { - * TemplateBinding binding = - * TemplateUtils.fixedBinding(model, extendedPort, (Classifier)type); - * Copy copy = new Copy(model, model, false); - * TemplateInstantiation ti = new TemplateInstantiation(copy, binding); - * // create a bound element of the extended port. Add bound class to derived interface class - * Class boundClass = ti.bindNamedElement(extendedPort); - * derivedInterface.getNearestPackage().getPackagedElements().add(boundClass); - * } catch (TransformationException e) { - * return null; - * } - * } - */ - // obtain first template parameter = port type - // kind.getBase_Class().getNearestPackage().getTemplateParameter(); - - for (Port port : extendedPort.getOwnedPorts()) { - Interface derivedIntf = (p.getBase_Port().isConjugated()) ? - PortUtils.getRequired(port) : - PortUtils.getProvided(port); - - if (derivedIntf != null) { - for (Operation op : derivedIntf.getAllOperations()) { - String name = port.getName() + "_" + op.getName(); //$NON-NLS-1$ - - // check whether operation already exists. Create, if not - Operation derivedOperation = derivedInterface.getOperation(name, null, null); - if (derivedOperation == null) { - derivedOperation = derivedInterface.createOwnedOperation(name, null, null); - OperationUtils.syncOperation(op, derivedOperation); - derivedOperation.setName(name); - } - else { - if (!OperationUtils.isSameOperation(derivedOperation, op, false)) { - OperationUtils.syncOperation(op, derivedOperation); - derivedOperation.setName(name); - } - } - } - } - } - return derivedInterface; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort2.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort2.java deleted file mode 100644 index f12eadcdc4c..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort2.java +++ /dev/null @@ -1,138 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; - -import org.eclipse.papyrus.FCM.util.IMappingRule; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.papyrus.qompass.designer.core.PortUtils; -import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Type; - - -/** - * An extended Port in the sense of the DDS4CCM standard: a port typed with a component - * type (the extended port, not the data type that is transported). Since the component typing - * the port can have multiple provided and required - * ports, the ports are implicitly owned by the port. Conjugation on the level of an extended - * port level will conjugate all ports of the component typing the port. - * - * The derived interface that is provided will allow a caller to access individual ports. It - * is therefore a reference to the interfaces get_ operations provided by a - * component. - * The derived interface that is required is identical, except for a conjugation on the - * extended port level. - * - * What is the difference to ExtendedPort? - * - */ -public class ExtendedPort2 implements IMappingRule { - - public static final String CONJ_PREFIX = "C2_"; //$NON-NLS-1$ - - public static final String NORM_PREFIX = "N2_"; //$NON-NLS-1$ - - @Override - public Type calcDerivedType(org.eclipse.papyrus.FCM.Port p, boolean update) { - - Type type = p.getType(); - if (!(type instanceof Class)) { - return null; - } - - Class extendedPort = (Class) type; - boolean isConjugated = p.getBase_Port().isConjugated(); - String prefix = isConjugated ? CONJ_PREFIX : NORM_PREFIX; - Class derivedClass = MapUtil.getDerivedClass(p, prefix, update); - Interface providedInterface = MapUtil.getDerivedInterface(p, prefix, update); - Interface requiredInterface = MapUtil.getDerivedInterface(p, prefix, update); - if (!update) { - return derivedClass; - } - if (derivedClass == null) { - return null; - } - for (Port port : extendedPort.getOwnedPorts()) { - // if the extended port is conjugated, each of the provided/required are (implicitly) - // conjugated [TODO: is PortUtils aware of it? - probably yes] - Interface reqIntf = PortUtils.getRequired(port); - - if (reqIntf != null) { - String name = PrefixConstants.getP_Prefix + port.getName(); - - // check whether operation already exists. Create, if not - Operation derivedOperation = requiredInterface.getOperation(name, null, null); - if (derivedOperation == null) { - derivedOperation = requiredInterface.createOwnedOperation(name, null, null); - } - } - - Interface provIntf = PortUtils.getProvided(port); - - if (provIntf != null) { - String name = PrefixConstants.getConnQ_Prefix + port.getName(); - - // check whether operation already exists. Create, if not - Operation derivedOperation = providedInterface.getOperation(name, null, null); - if (derivedOperation == null) { - derivedOperation = providedInterface.createOwnedOperation(name, null, null); - } - } - } - return derivedClass; - } - - @Override - public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p) { - return needsUpdate(p, false) || - needsUpdate(p, true); - } - - public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p, boolean isConjugated) { - Type type = p.getBase_Port().getType(); - if (!(type instanceof Class)) { - return false; - } - - Class extendedPort = (Class) type; - String prefix = isConjugated ? CONJ_PREFIX : NORM_PREFIX; - Interface derivedInterface = MapUtil.getDerivedInterface(p, prefix); - - if (derivedInterface == null) { - return true; - } - for (Port port : extendedPort.getOwnedPorts()) { - // if the extended port is conjugated, each of the provided/required are (implicitly) - // conjugated [TODO: is PortUtils aware of it? - probably yes] - Interface provIntf = (isConjugated) ? - PortUtils.getRequired(port) : - PortUtils.getProvided(port); - - if (provIntf != null) { - String name = PrefixConstants.getP_Prefix + port.getName(); - - // check whether operation already exists. Create, if not - Operation derivedOperation = derivedInterface.getOperation(name, null, null); - if (derivedOperation == null) { - return true; - } - } - } - return false; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ProvideInterface.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ProvideInterface.java deleted file mode 100644 index 2432ddcdc42..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ProvideInterface.java +++ /dev/null @@ -1,37 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; - -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.util.IMappingRule; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Type; - -public class ProvideInterface implements IMappingRule -{ - @Override - public Type calcDerivedType(Port p, boolean update) { - Type type = p.getBase_Port().getType(); - if (type instanceof Interface) { - return ((Interface) type); - } - return null; - } - - @Override - public boolean needsUpdate(Port p) { - return false; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PullConsumer.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PullConsumer.java deleted file mode 100644 index 84c73d33c96..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PullConsumer.java +++ /dev/null @@ -1,162 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.util.IMappingRule; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.DataType; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.PrimitiveType; -import org.eclipse.uml2.uml.Signal; -import org.eclipse.uml2.uml.Type; - -/** - * Will generate a suitable callable interface pulling consumer. The port is typed with a primitive type - * or data type. The generated interface has a " pull as well as a "boolean hasData()" operation). - */ -public class PullConsumer implements IMappingRule { - - public static String PULL_I_PREFIX = "PullConsumer_"; //$NON-NLS-1$ - - public static String PULL_C_PREFIX = "CPullConsumer_"; //$NON-NLS-1$ - - public static String PULL_OP_NAME = "pull"; //$NON-NLS-1$ - - public static String HASDATA_OP_NAME = "hasData"; //$NON-NLS-1$ - - public static String RET_PAR_NAME = "ret"; //$NON-NLS-1$ - - public static String BOOL_QNAME = "corba::Boolean"; //$NON-NLS-1$ - - @Override - public boolean needsUpdate(Port p) { - Type type = p.getType(); - - if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { - - Interface derivedInterface = MapUtil.getDerivedInterface(p, PULL_I_PREFIX); - if (derivedInterface == null) { - return true; - } - Operation derivedOperation = derivedInterface.getOperation(PULL_OP_NAME, null, null); - if (derivedOperation == null) { - return true; - } - EList parameters = derivedOperation.getOwnedParameters(); - if (parameters.size() != 1) { - return true; - } else { - Parameter parameter = parameters.get(0); - if (!parameter.getName().equals(RET_PAR_NAME)) { - return true; - } - if (parameter.getType() != type) { - return true; - } - } - } - return false; - } - - public static PullConsumer getInstance() { - if (instance == null) { - instance = new PullConsumer(); - } - return instance; - } - - @Override - public Type calcDerivedType(Port p, boolean update) { - org.eclipse.uml2.uml.Port umlPort = p.getBase_Port(); - Element owner = umlPort.getOwner(); - String ownerStr = ""; //$NON-NLS-1$ - if (owner instanceof NamedElement) { - ownerStr = " of class " + ((NamedElement) owner).getQualifiedName(); //$NON-NLS-1$ - } - Log.log(IStatus.INFO, Log.CALC_PORTKIND, - p.getKind().getBase_Class().getName() + " => GetRequired on " + umlPort.getName() + ownerStr); - Type type = p.getType(); - - if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { - - Class derivedClass = MapUtil.getDerivedClass(p, PULL_C_PREFIX, update); - Interface derivedInterface = MapUtil.getDerivedInterface(p, PULL_I_PREFIX, update); - MapUtil.addUsage(derivedClass, derivedInterface); - if (!update) { - return derivedClass; - } - if (derivedInterface == null) { - return null; - } - // check whether operation already exists. Create, if not - Operation derivedOperationPull = derivedInterface.getOperation(PULL_OP_NAME, null, null); - if (derivedOperationPull == null) { - derivedOperationPull = derivedInterface.createOwnedOperation(PULL_OP_NAME, null, null, type); - } - EList parameters = derivedOperationPull.getOwnedParameters(); - if (parameters.size() > 0) { - Parameter parameter = parameters.get(0); - if ((parameter.getName() == null) || (!parameter.getName().equals(RET_PAR_NAME))) { - parameter.setName(RET_PAR_NAME); - } - if (parameter.getType() != type) { - parameter.setType(type); - } - } - Package model = PackageUtil.getRootPackage(umlPort); - Element element = Utils.getQualifiedElement(model, BOOL_QNAME); - Type booleanType = null; - if (element instanceof Type) { - booleanType = (Type) element; - } - - // check whether operation already exists. Create, if not - Operation derivedOperationHasData = derivedInterface.getOperation(HASDATA_OP_NAME, null, null); - if (derivedOperationHasData == null) { - derivedOperationHasData = derivedInterface.createOwnedOperation(HASDATA_OP_NAME, null, null, booleanType); - } - - parameters = derivedOperationHasData.getOwnedParameters(); - if (parameters.size() > 0) { - Parameter parameter = parameters.get(0); - if ((parameter.getName() == null) || (!parameter.getName().equals(RET_PAR_NAME))) { - parameter.setName(RET_PAR_NAME); - } - if ((booleanType != null) && (parameter.getType() != booleanType)) { - // added != null check - parameter.setType(booleanType); - } - } - - return derivedClass; - } else { - return null; - } - } - - protected static PullConsumer instance; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushConsumer.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushConsumer.java deleted file mode 100644 index f0375f8840e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushConsumer.java +++ /dev/null @@ -1,110 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.util.IMappingRule; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.uml2.uml.DataType; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.PrimitiveType; -import org.eclipse.uml2.uml.Signal; -import org.eclipse.uml2.uml.Type; - -/** - * Will generate a suitable called interface push consumer. The port is typed with a primitive type - * or data type. The generated interface has a "push (data )" operation ). - * - * The interface is identical to that of a PushProducer (and will be shared). - * - * @author ansgar - */ -public class PushConsumer implements IMappingRule { - - public static String PUSH_OP_PREFIX = "push"; //$NON-NLS-1$ - - public static String PUSH_OP_PARNAME = "data"; //$NON-NLS-1$ - - @Override - public boolean needsUpdate(Port p) { - Type type = p.getBase_Port().getType(); - - if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { - - Interface derivedInterface = MapUtil.getDerivedInterface(p, PushProducer.PUSH_I_PREFIX); - if (derivedInterface == null) { - return true; - } - - Operation derivedOperation = derivedInterface.getOperation(PUSH_OP_PREFIX, null, null); - if (derivedOperation == null) { - return true; - } - EList parameters = derivedOperation.getOwnedParameters(); - if (parameters.size() != 1) { - return true; - } else { - Parameter parameter = parameters.get(0); - if (!parameter.getName().equals(PUSH_OP_PARNAME)) { - return true; - } - if (parameter.getType() != type) { - return true; - } - } - } - return false; - } - - @Override - public Type calcDerivedType(Port p, boolean update) { - Log.log(IStatus.INFO, Log.CALC_PORTKIND, - p.getKind().getBase_Class().getName() + " => GetProvided on " + p.getBase_Port().getName()); - Type type = p.getType(); - - if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { - - Interface derivedInterface = MapUtil.getDerivedInterface(p, PushProducer.PUSH_I_PREFIX, update); - if (!update) { - return derivedInterface; - } - if (derivedInterface == null) { - // may happen, if within template (do not want creation of derived interfaces in template) - return null; - } - - // check whether operation already exists. Create, if not - Operation derivedOperation = derivedInterface.getOperation(PUSH_OP_PREFIX, null, null); - if (derivedOperation == null) { - derivedOperation = derivedInterface.createOwnedOperation(PUSH_OP_PREFIX, null, null); - } - EList parameters = derivedOperation.getOwnedParameters(); - if (parameters.size() == 0) { - derivedOperation.createOwnedParameter(PUSH_OP_PARNAME, type); - } else { - parameters.get(0).setName(PUSH_OP_PARNAME); - parameters.get(0).setType(type); - } - return derivedInterface; - } else { - return null; - } - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java deleted file mode 100644 index d719977a2db..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java +++ /dev/null @@ -1,75 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; - -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.util.IMappingRule; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.DataType; -import org.eclipse.uml2.uml.PrimitiveType; -import org.eclipse.uml2.uml.Signal; -import org.eclipse.uml2.uml.Type; - -/** - * Create a bidirectional port with a push producer and a pull consumer - * TODO: Objective is not clear - * Will generate a suitable callable interface pulling consumer. The port is typed with a primitive type - * or data type. The generated interface has a " pull as well as a "boolean hasData()" operation). - */ -public class PushProdPullCons implements IMappingRule { - - @Override - public Type calcDerivedType(Port p, boolean update) { - Type type = p.getType(); - - if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { - - Class derivedClass = MapUtil.getDerivedClass(p, "PushProdPullcons", update); - if (!update) { - return derivedClass; - } - - // obtain derived interface for other port kind (Caveat: some rules get the prefix from the - // name of the port kind attached to port "p" which would produce wrong results. - Type derivedInterfacePushProd = PushProducer.getInstance().calcDerivedType(p, update); - Type derivedInterfacePullCons = PullConsumer.getInstance().calcDerivedType(p, update); - - /* - if (derivedInterface == null) { - return null; - } - - if (!derivedInterface.getGenerals().contains(derivedInterfacePushProd)) { - derivedInterface.createGeneralization(derivedInterfacePushProd); - } - if (!derivedInterface.getGenerals().contains(derivedInterfacePullCons)) { - derivedInterface.createGeneralization(derivedInterfacePullCons); - } - return derivedInterface; - */ - return null; - } - else { - return null; - } - } - - @Override - public boolean needsUpdate(Port p) { - return PushProducer.getInstance().needsUpdate(p) || - PullConsumer.getInstance().needsUpdate(p); - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProducer.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProducer.java deleted file mode 100644 index e7933346b8f..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProducer.java +++ /dev/null @@ -1,130 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.util.IMappingRule; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.DataType; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.PrimitiveType; -import org.eclipse.uml2.uml.Signal; -import org.eclipse.uml2.uml.Type; - -/** - * Will generate a suitable callable interface push provider. The port is typed with a primitive type - * or data type. The generated interface has a "push (data )" operation - * - * The interface is identical to that of a PushConsumer (and will be shared). - * - * @author ansgar - */ -public class PushProducer implements IMappingRule { - - public static String PUSH_I_PREFIX = "Push_"; //$NON-NLS-1$ - - public static String PUSH_C_PREFIX = "CPush_"; //$NON-NLS-1$ - - public static String PUSH_OP_NAME = "push"; //$NON-NLS-1$ - - public static String PUSH_OP_PARNAME = "data"; //$NON-NLS-1$ - - public static PushProducer getInstance() { - if (instance == null) { - instance = new PushProducer(); - } - return instance; - } - - @Override - public boolean needsUpdate(Port p) { - Type type = p.getBase_Port().getType(); - - if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { - - Interface derivedInterface = MapUtil.getDerivedInterface(p, PUSH_I_PREFIX); - if (derivedInterface == null) { - return true; - } - - Operation derivedOperation = derivedInterface.getOperation(PUSH_OP_NAME, null, null); - if (derivedOperation == null) { - return true; - } - EList parameters = derivedOperation.getOwnedParameters(); - if (parameters.size() != 1) { - return true; - } else { - Parameter parameter = parameters.get(0); - if (!parameter.getName().equals(PUSH_OP_PARNAME)) { - return true; - } - if (parameter.getType() != type) { - return true; - } - } - } - return false; - } - - @Override - public Type calcDerivedType(Port p, boolean update) { - Log.log(IStatus.INFO, Log.CALC_PORTKIND, p.getKind().getBase_Class().getName() + " => GetRequired on " + p.getBase_Port().getName()); - Type type = p.getType(); - - if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { - - Interface derivedInterface = MapUtil.getDerivedInterface(p, PUSH_I_PREFIX, update); - Class derivedType = MapUtil.getDerivedClass(p, PUSH_C_PREFIX, update); - MapUtil.addUsage(derivedType, derivedInterface); - if (!update) { - return derivedType; - } - if (derivedInterface == null) { - // may happen, if within template (do not want creation of derived interfaces in template) - return null; - } - - // check whether operation already exists. Create, if not - Operation derivedOperation = derivedInterface.getOperation(PUSH_OP_NAME, null, null); - if (derivedOperation == null) { - derivedOperation = derivedInterface.createOwnedOperation(PUSH_OP_NAME, null, null); - } - EList parameters = derivedOperation.getOwnedParameters(); - if (parameters.size() == 0) { - derivedOperation.createOwnedParameter(PUSH_OP_PARNAME, type); - } else { - Parameter parameter = parameters.get(0); - if (!parameter.getName().equals(PUSH_OP_PARNAME)) { - parameter.setName(PUSH_OP_PARNAME); - } - if (parameter.getType() != type) { - parameter.setType(type); - } - } - return derivedType; - } else { - return null; - } - } - - protected static PushProducer instance; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/TemplatePort.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/TemplatePort.java deleted file mode 100644 index 62dce7e7709..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/TemplatePort.java +++ /dev/null @@ -1,183 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.FCM.PortKind; -import org.eclipse.papyrus.FCM.util.ITemplateMappingRule; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateInstantiation; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; -import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; -import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FixTemplateSync; -import org.eclipse.papyrus.qompass.modellibs.core.Activator; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.Namespace; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.TemplateSignature; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.util.UMLUtil; - - -/** - * An extended Port in the sense of the DDS4CCM standard: a port typed with a component - * type. Since the component typing the port can have multiple provided and required - * ports, the ports are implicitly owned by the port. Conjugation on the level of an extended - * port level will conjugate all ports of the component typing the port. - * - * The derived interface that is provided will concatenate provided port names within the - * extended port with the port name and provided a "big" interface. - * The derived interface that is required is identical, except for a conjugation on the - * extended port level. - * - * Creates a fixed template binding that binds T (of the extended Port) to the used data type - * - * Here, the idea is that the port type is a classifier, e.g. the data type that is - * transported by a DDS port. The port kind is the extended port, e.g. DDSWrite. - * - * The derived property isExtended of FCM port-kind is true, if the class representing the port-kind owns at least one - * port - * - * @author ansgar - * - */ -public class TemplatePort implements ITemplateMappingRule { - - @Override - public Type calcDerivedType(org.eclipse.papyrus.FCM.Port p, boolean update) { - // TODO: unify template mapping rule and normal one. - return null; - } - - @Override - public PortKind getBoundType(org.eclipse.papyrus.FCM.Port p) - { - Port port = p.getBase_Port(); - Type type = port.getType(); - if (!(type instanceof Classifier)) { - return null; - } - if (p.getKind() == null) { - return null; - } - Class extendedPort = p.getKind().getBase_Class(); - TemplateSignature signature = TemplateUtils.getSignature(extendedPort.getNearestPackage()); - Package pkgTemplate = signature.getNearestPackage(); - if (pkgTemplate != null) { - EList path = TemplateUtils.relativePathWithMerge(extendedPort, pkgTemplate); - - String name = pkgTemplate.getName() + "_" + type.getName(); //$NON-NLS-1$ - Package model = PackageUtil.getRootPackage(port); - Package pkg = model.getNestedPackage(name); - if (pkg == null) { - model = Utils.getFirstLevel(port); // try whether package template exists here - // required for target model with additional "root" folder - pkg = model.getNestedPackage(name); - } - if (pkg != null) { - for (Namespace pathElem : path) { - pkg = pkg.getNestedPackage(pathElem.getName()); - if (pkg == null) { - return null; - } - } - PackageableElement boundClass = pkg.getPackagedElement(extendedPort.getName()); - if (boundClass != null) { - return UMLUtil.getStereotypeApplication(boundClass, PortKind.class); - } - } - } - return null; - } - - @Override - public void updateBinding(org.eclipse.papyrus.FCM.Port p) { - Port port = p.getBase_Port(); - Type type = port.getType(); - if (!(type instanceof Classifier)) { - return; - } - Class extendedPort = p.getKind().getBase_Class(); - - TemplateSignature signature = TemplateUtils.getSignature(extendedPort.getNearestPackage()); - if (signature != null) { - Package model = PackageUtil.getRootPackage(port); - try { - TemplateBinding binding = - TemplateUtils.fixedBinding(model, extendedPort, (Classifier) type); - LazyCopier copy = new LazyCopier(model, model, false, true); - TemplateInstantiation ti = new TemplateInstantiation(copy, binding); - // remove listener synchronizing implementation, since it would add derived - // elements for the extended port itself (e.g. provided operations) - if (copy.postCopyListeners.contains(FixTemplateSync.getInstance())) { - copy.postCopyListeners.remove(FixTemplateSync.getInstance()); - } - - // create a bound element of the extended port. Add bound class to derived interface class - ti.bindElement(extendedPort); - } catch (TransformationException e) { - Activator.log.error("Could not create template binding", e); - } - } - } - - @Override - public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p) { - Port port = p.getBase_Port(); - Type type = port.getType(); - if (!(type instanceof Classifier)) { - return false; - } - if (p.getKind() == null) { - return false; - } - Class extendedPort = p.getKind().getBase_Class(); - TemplateSignature signature = TemplateUtils.getSignature(extendedPort.getNearestPackage()); - Package pkgTemplate = signature.getNearestPackage(); - if (pkgTemplate != null) { - EList path = TemplateUtils.relativePathWithMerge(extendedPort, pkgTemplate); - - String name = pkgTemplate.getName() + "_" + type.getName(); //$NON-NLS-1$ - Package model = PackageUtil.getRootPackage(port); - Package pkg = model.getNestedPackage(name); - if (pkg == null) { - model = Utils.getFirstLevel(port); // try whether package template exists here - // required for target model with additional "root" folder - pkg = model.getNestedPackage(name); - } - if (pkg != null) { - for (Namespace pathElem : path) { - pkg = pkg.getNestedPackage(pathElem.getName()); - if (pkg == null) { - return true; - } - } - PackageableElement boundClass = pkg.getPackagedElement(extendedPort.getName()); - if (boundClass != null) { - if (UMLUtil.getStereotypeApplication(boundClass, PortKind.class) != null) { - return false; - } - } - } - } - return true; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseConjIntf.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseConjIntf.java deleted file mode 100644 index cee9f055d01..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseConjIntf.java +++ /dev/null @@ -1,187 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; - -import java.util.Iterator; - -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.util.IMappingRule; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.ParameterDirectionKind; -import org.eclipse.uml2.uml.Type; - -/** - * Use a conjugated interface (!= conjugated port), i.e. an interface in which the roles "in" and "out" - * of each parameter of an operation are inversed. This transformation is useful in the context of transforming - * a "push" interface into a "pull" interface, i.e. instead of calling and providing values values to the - * called component via "in", the called components queries us and obtains these values as out parameters. - * TODO: This rules is currently not used, since data flow operation are currently either based on a datatype - * or a MARTE FlowPort - * - * @author ansgar - * - */ -public class UseConjIntf implements IMappingRule { - - private static final String CONJ_INTF_TYPE = "ConjIntfType_"; //$NON-NLS-1$ - private static final String CONJ_INTF = "ConjIntf_"; //$NON-NLS-1$ - - @Override - public Type calcDerivedType(Port p, boolean update) { - Type type = p.getBase_Port().getType(); - if (!(type instanceof Interface)) { - return null; - } - - Interface typingInterface = (Interface) type; - Interface derivedInterface = MapUtil.getDerivedInterface(p, CONJ_INTF, update); - Class derivedType = MapUtil.getDerivedClass(p, CONJ_INTF_TYPE, update); - if (!update) { - return derivedType; - } - if (derivedInterface == null) { - return null; - } - MapUtil.addUsage(derivedType, derivedInterface); - for (Operation operation : typingInterface.getOwnedOperations()) { - String name = operation.getName(); - - // check whether operation already exists. Create, if not - Operation derivedOperation = derivedInterface.getOperation(name, null, null); - if (derivedOperation == null) { - derivedOperation = derivedInterface.createOwnedOperation(name, null, null); - } - - // TODO: move to Copy (factor code, ensure that these values are handled in case of model copies ...) - derivedOperation.setIsAbstract(operation.isAbstract()); - derivedOperation.setIsStatic(operation.isStatic()); // (does not make sense for an interface, if true) - derivedOperation.setIsUnique(operation.isUnique()); - derivedOperation.setIsQuery(operation.isQuery()); - - for (Parameter parameter : operation.getOwnedParameters()) { - String paramName = parameter.getName(); - Type paramType = parameter.getType(); - if (derivedOperation.getOwnedParameter(paramName, paramType) == null) { - Parameter newParameter = - derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType()); - ParameterDirectionKind direction = parameter.getDirection(); - if (direction == ParameterDirectionKind.IN_LITERAL) { - newParameter.setDirection(ParameterDirectionKind.OUT_LITERAL); - } - else if (direction == ParameterDirectionKind.OUT_LITERAL) { - newParameter.setDirection(ParameterDirectionKind.IN_LITERAL); - } - else { - newParameter.setDirection(direction); - } - newParameter.setLower(parameter.getLower()); - newParameter.setUpper(parameter.getUpper()); - } - } - // remove those parameters that exist in derived, but not original interface. - Iterator derivedParameters = derivedOperation.getOwnedParameters().iterator(); - while (derivedParameters.hasNext()) { - Parameter parameter = derivedParameters.next(); - String paramName = parameter.getName(); - Type paramType = parameter.getType(); - if (operation.getOwnedParameter(paramName, paramType) == null) { - // not on in original interface, remove from derived as well - derivedParameters.remove(); - } - } - } - - // check whether operations in derived interface exist in original interface - // (remove, if not) - Iterator derivedOperations = derivedInterface.getOwnedOperations().iterator(); - while (derivedOperations.hasNext()) { - Operation derivedOperation = derivedOperations.next(); - String name = derivedOperation.getName(); - if (typingInterface.getOperation(name, null, null) == null) { - // not in typing interface, remove - if (derivedInterface.getOperations().remove(derivedOperation)) { - derivedOperations = derivedInterface.getOwnedOperations().iterator(); - } - } - } - return derivedType; - } - - @Override - public boolean needsUpdate(Port p) { - Type type = p.getType(); - if (!(type instanceof Interface)) { - return false; - } - - Interface typingInterface = (Interface) type; - Interface derivedInterface = MapUtil.getOrCreateDerivedInterface(p, CONJ_INTF); - Class derivedType = MapUtil.getOrCreateDerivedClass(p, CONJ_INTF_TYPE); - if ((derivedInterface == null) || (derivedType == null)) { - return true; - } - for (Operation operation : typingInterface.getOwnedOperations()) { - String name = operation.getName(); - - // check whether operation already exists. Create, if not - Operation derivedOperation = derivedInterface.getOperation(name, null, null); - if (derivedOperation == null) { - return true; - } - - // TODO: move to Copy (factor code, ensure that these values are handled in case of model copies ...) - derivedOperation.setIsAbstract(operation.isAbstract()); - derivedOperation.setIsStatic(operation.isStatic()); // (does not make sense for an interface, if true) - derivedOperation.setIsUnique(operation.isUnique()); - derivedOperation.setIsQuery(operation.isQuery()); - - for (Parameter parameter : operation.getOwnedParameters()) { - String paramName = parameter.getName(); - Type paramType = parameter.getType(); - if (derivedOperation.getOwnedParameter(paramName, paramType) == null) { - return true; - } - } - // remove those parameters that exist in derived, but not original interface. - Iterator derivedParameters = derivedOperation.getOwnedParameters().iterator(); - while (derivedParameters.hasNext()) { - Parameter parameter = derivedParameters.next(); - String paramName = parameter.getName(); - Type paramType = parameter.getType(); - if (operation.getOwnedParameter(paramName, paramType) == null) { - // not on in original operation - return true; - } - } - } - - // check whether operations in derived interface exist in original interface - // (remove, if not) - Iterator derivedOperations = derivedInterface.getOwnedOperations().iterator(); - while (derivedOperations.hasNext()) { - Operation derivedOperation = derivedOperations.next(); - String name = derivedOperation.getName(); - if (typingInterface.getOperation(name, null, null) == null) { - // not in typing interface - return true; - } - } - return false; - } -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseInterface.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseInterface.java deleted file mode 100644 index 26af9111517..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseInterface.java +++ /dev/null @@ -1,42 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2013 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher ansgar.radermacher@cea.fr - * - *****************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; - -import org.eclipse.papyrus.FCM.Port; -import org.eclipse.papyrus.FCM.util.IMappingRule; -import org.eclipse.papyrus.FCM.util.MapUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Type; - - -public class UseInterface implements IMappingRule -{ - @Override - public Type calcDerivedType(Port p, boolean update) { - Type type = p.getType(); - if (type instanceof Interface) { - Class useType = MapUtil.getDerivedClass(p, "Use_", update); //$NON-NLS-1$ - MapUtil.addUsage(useType, (Interface) type); - return useType; - } - return null; - } - - @Override - public boolean needsUpdate(Port p) { - return false; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AMIPull.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AMIPull.xtend deleted file mode 100644 index d1e1fb28303..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AMIPull.xtend +++ /dev/null @@ -1,34 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -import org.eclipse.uml2.uml.Operation -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.Marshalling.* - -class AMIPull { - def operation_(Operation operation) ''' - «IF operation.name.endsWith("Poll")» - // comment polling function - if (!resultArrived) { - // wait for result, condition will be fired upon arrival - TimeVal timeVal = TimeVal::current () + timeout; - m_cond.waitUpto (timeout); - } - «operation.unmarshall» - } - «IF operation.type != null»return retValue;«ENDIF» - «ELSE» - // TODO: need suitable constant dimensioning - pBuffer = &buffer[500]; // grows backwards - int operationID = ID_[operation.name/]; - - // now marshall in and inout parameters via ASN.1 - «operation.marshall» - BEncAsnContent (&pBuffer, &operationID); - - pthread_t pt; - pthread_create (&pt, NULL, staticDispatch, (void *) this); - // TODO: add semaphore which assures that subsequent calls to [operation.name/] are not executed before dispatch - // has removed the parameters from the pBuffer stack (pBuffer can be corrupted). - // even worse: buffer will be deallocated even without a 2nd call! - «ENDIF» - ''' -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AsyncCalls.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AsyncCalls.xtend deleted file mode 100644 index fa7cb846212..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AsyncCalls.xtend +++ /dev/null @@ -1,57 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -import org.eclipse.uml2.uml.Operation -import org.eclipse.uml2.uml.Class -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.* -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.Marshalling.* - -class AsyncCalls { - def asyncCall(Operation operation) ''' - // TODO: need suitable constant dimensioning - pBuffer = &buffer[500]; // grows backwards - «operation.marshall» - int operationID = ID_[operation.name/]; - BEncAsnContent (&pBuffer, &operationID); - - pthread_t pt; - pthread_create (&pt, NULL, staticDispatch, (void *) this); - // TODO: add semaphore which assures that subsequent calls to «operation.name» are not executed before dispatch - // has removed the parameters from the pBuffer stack (pBuffer can be corrupted). - ''' - - def dispatch_(Class clazz) ''' - int operationID; - BDecAsnContent (&pBuffer, operationID); - switch (operationID) { - «FOR operation : clazz.ownedOperations» - case ID_«operation.name» - { - - // delegate call to executor - rconn->«operation.cppCall»; - break; - } - «ENDFOR» - } - ''' - - def dispatchWithThreadPool(Class clazz) ''' - int operationID; - BDecAsnContent (&pBuffer, operationID); - switch (operationID) { - «FOR operation : clazz.ownedOperations» - case ID_«operation.name» - { - «operation.unmarshall» - // delegate call to executor - rconn->«operation.cppCall»; - «IF operation.type != null»«operation.type.cppType» ret = «ENDIF»rconn->«operation.cppCall»; - «operation.marshallOutInout» - resultsReady = 1; - break; - } - «ENDFOR» - } - } - ''' -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/BehaviorUtil.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/BehaviorUtil.java deleted file mode 100644 index e815c2c332b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/BehaviorUtil.java +++ /dev/null @@ -1,111 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core.xtend; - -import org.eclipse.uml2.uml.Behavior; -import org.eclipse.uml2.uml.BehavioredClassifier; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Constraint; -import org.eclipse.uml2.uml.OpaqueBehavior; -import org.eclipse.uml2.uml.OpaqueExpression; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Parameter; -import org.eclipse.uml2.uml.ParameterDirectionKind; -import org.eclipse.uml2.uml.Transition; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLPackage; - -public class BehaviorUtil { - private static final String DEFAULT_LANGUAGE = "C++"; //$NON-NLS-1$ - - public static void set(Behavior behavior, String selectLanguage, String textblock) { - if (behavior instanceof OpaqueBehavior) { - OpaqueBehavior ob = (OpaqueBehavior) behavior; - if (ob.getLanguages().size() == 0) { - ob.getLanguages().add(DEFAULT_LANGUAGE); - ob.getBodies().add(textblock); - } - else { - int i = 0; - for (String language : ob.getLanguages()) { - if (selectLanguage.equals(language)) { - if (i < ob.getBodies().size()) { - ob.getBodies().set(i, textblock); - } - break; - } - } - } - } - } - - public static void set(Behavior behavior, String textblock) { - set(behavior, DEFAULT_LANGUAGE, textblock); - } - - public static OpaqueBehavior createOpaqueBehavior(BehavioredClassifier clazz, Operation operation) { - OpaqueBehavior ob = (OpaqueBehavior) - clazz.createOwnedBehavior(operation.getName(), UMLPackage.eINSTANCE.getOpaqueBehavior()); - ob.setSpecification(operation); - return ob; - } - - public static OpaqueBehavior createOpaqueEffect(Transition transition) { - OpaqueBehavior ob = (OpaqueBehavior) - transition.createEffect("", UMLPackage.eINSTANCE.getOpaqueBehavior()); //$NON-NLS-1$ - return ob; - } - - public static OpaqueExpression createOpaqueExpression(Constraint constraint, String guardCode) { - OpaqueExpression oe = (OpaqueExpression) - constraint.createSpecification("", null, UMLPackage.eINSTANCE.getOpaqueExpression()); //$NON-NLS-1$ - oe.getLanguages().add(DEFAULT_LANGUAGE); - oe.getBodies().add(guardCode); - return oe; - } - - public static String body(Constraint constraint) { - if (constraint.getSpecification() instanceof OpaqueExpression) { - OpaqueExpression oe = (OpaqueExpression) constraint.getSpecification(); - if (oe.getBodies().size() > 0) { - return oe.getBodies().get(0); - } - } - return constraint.getSpecification().stringValue(); - } - - /** - * Create an operation with an operation return type - * - * @param clazz - * @param name - * @param retType - * @return - */ - public static Operation createOperation(Class clazz, String name, Type retType) { - Operation operation = clazz.createOwnedOperation(name, null, null); - if (retType != null) { - Parameter parameter = operation.createOwnedParameter("ret", retType); //$NON-NLS-1$ - parameter.setDirection(ParameterDirectionKind.RETURN_LITERAL); - } - return operation; - } - - public static String body(Behavior behavior) { - return body(behavior, DEFAULT_LANGUAGE); - } - - public static String body(Behavior behavior, String selectLanguage) { - if (behavior instanceof OpaqueBehavior) { - OpaqueBehavior ob = (OpaqueBehavior) behavior; - int i = 0; - for (String language : ob.getLanguages()) { - if (selectLanguage.equals(language)) { - if (i < ob.getBodies().size()) { - return ob.getBodies().get(i); - } - break; - } - } - } - return null; - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/CppUtils.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/CppUtils.xtend deleted file mode 100644 index fb028cc5f16..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/CppUtils.xtend +++ /dev/null @@ -1,81 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -import org.eclipse.papyrus.qompass.designer.core.UMLTool -import org.eclipse.uml2.uml.NamedElement -import org.eclipse.uml2.uml.Operation -import org.eclipse.uml2.uml.Parameter -import org.eclipse.uml2.uml.ParameterDirectionKind -import org.eclipse.uml2.uml.Type - -class CppUtils { - - /** - * create the C++ signature for an operation (including parenthesis) - */ - public static def cppSignature(Operation operation) ''' - «operation.name»(«FOR parameter : operation.ownedParameters SEPARATOR(', ')» - «parameter.cppParameter» - «ENDFOR» - ''' - - - /** - * make a C++ call, pass all parameters except the return parameter - */ - public static def cppCall(Operation operation) ''' - «operation.name»(«FOR parameter : UMLTool.parametersNonRet(operation) SEPARATOR(', ')» - «parameter.name» - «ENDFOR») - ''' - - /** - * make a C++ call, pass all parameters except the return parameter, prefix with "return", - * if there is a return type in the operations declaration - */ - public static def returnCppCall(Operation operation) ''' - «IF (operation.type != null)»return «ENDIF»«operation.cppCall» - ''' - - public static def cppParameter(Parameter parameter) ''' - «parameter.type»«IF (parameter.direction == ParameterDirectionKind.OUT)»_out«ENDIF» «parameter.name» - ''' - - public static def cppType(Type type) ''' - «IF (type.qualifiedName == 'UMLPrimitiveTypes::Boolean')» - bool - «ELSEIF (type.qualifiedName == 'UMLPrimitiveTypes::Integer')» - int - «ELSE» - «UMLTool.dereferenceTypedef(type)» - «ENDIF» - ''' - - - public static def cppRetType(Operation operation) ''' - «IF (operation.type == null)» - void - «ELSE» - «operation.type.cppType» - «ENDIF» - ''' - - /** - * Open a set of C++ namespaces associated with the packages of of the passed named element - * TODO: use indentTab? => requires making this script recursive - * Need to include referenced types (assuming a naming convention? - */ - public static def openNamespace(NamedElement namedElement) ''' - «FOR ns : UMLTool.usedNamespaces(namedElement).reverse» - namespace «ns.name» - «ENDFOR» - ''' - - /** - * Close a set of C++ namespaces associated with the packages of of the passed named element - */ - public static def closeNamespace(NamedElement namedElement) ''' - «FOR ns : UMLTool.usedNamespaces(namedElement)» - }; // of namespace [ns.name/] - «ENDFOR» - ''' -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/FIFO.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/FIFO.xtend deleted file mode 100644 index 59440deec7b..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/FIFO.xtend +++ /dev/null @@ -1,13 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -import org.eclipse.uml2.uml.DataType -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext - -class FIFO { - def activate(DataType datatype) ''' - if (m_size == 0) { - cerr << "Warning: size of FIFO is not properly configured (size = 0)" << endl; - } - m_fifo = new «TransformationContext.pkgTemplateParameter("T")»[m_size]; - ''' -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/GlobalConstants.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/GlobalConstants.xtend deleted file mode 100644 index b2a19cce408..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/GlobalConstants.xtend +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* -* Copyright (c) 2014 Zeligsoft (2009) Limited and others. -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v1.0 -* which accompanies this distribution, and is available at -* http://www.eclipse.org/legal/epl-v10.html -*******************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -class GlobalConstants { - public static val QUAL_NAME_SEP = "." - public static val FUNC_NAME_QUAL_NAME_SEP = "__" - public static val FUNC_NAME_PART_SEP = "____" - public static val INJECT_FUNC_NAME = "inject" - public static val INITIALIZE_FUNC_NAME = "initialize" - public static val STATE_FUNC_PREFIX = "state_" - public static val JUNCTION_FUNC_PREFIX = "junction_" - public static val CHOICE_FUNC_PREFIX = "choice_" - public static val ACTION_CHAIN_FUNC_PREFIX = "actionchain_" - public static val ACTION_FUNC_PREFIX = "action_" - public static val GUARD_FUNC_PREFIX = "guard_" - public static val USER_ACTION_FUNC_PREFIX = "useraction_" - public static val USER_GUARD_FUNC_PREFIX = "userguard_" - public static val EXIT_ACTION_FUNC_PREFIX = "exitaction_" - public static val ENTRY_ACTION_FUNC_PREFIX = "entryaction_" - public static val TRANS_ACTION_FUNC_PREFIX = "transitionaction_" - public static val SAVE_HISTORY_FUNC_NAME = "save_history" - public static val CHECK_HISTORY_FUNC_NAME = "check_history" - public static val CHECK_HISTORY_FUNC_PREFIX = "checkhistory_" - public static val CURRENT_STATE_FIELD_NAME = "currentState" - public static val HISTORY_TABLE_NAME = "history" - public static val UNDEFINED = "SPECIAL_INTERNAL_STATE_UNDEFINED" - public static val UNVISITED = "SPECIAL_INTERNAL_STATE_UNVISITED" - public static val STATE_TYPE_NAME = "State" - public static val PORT_TYPE_NAME = "Port" - public static val SIGNAL_TYPE_NAME = "Signal" - public static val INJECT_FUNC_PARAM = "msg" - public static val INITIALIZE_FUNC_PARAM = "msg" - public static val STATE_FUNC_PARAM = "msg" - public static val JUNC_FUNC_PARAM = "msg" - public static val CHOICE_FUNC_PARAM = "msg" - public static val CHAIN_FUNC_PARAM = "msg" - public static val ACTION_FUNC_PARAM = "msg" - public static val ACTION_DATA_VARIABLE = "rtdata" - public static val EMPTY_ACTION_COMMENT = "// (Automatically generated stub for an empty action)" - public static val MISSING_CODE_COMMENT = "// (No C++ code found for this action)" - public static val MISSING_CONSTRAINT_BODY = "false" - public static val FRESH_NAME_PREFIX = "new_" - public static val FRESH_ENTRYPOINT_NAME_PREFIX = "new_entrypoint_" - public static val FRESH_EXITPOINT_NAME_PREFIX = "new_exitpoint_" - public static val FRESH_CHOICEPOINT_NAME_PREFIX = "new_choice_" - public static val FRESH_JUNCTIONPOINT_NAME_PREFIX = "new_junction_" - public static var FRESH_TRANSITION_NAME_PREFIX = "new_transition_" - -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/Marshalling.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/Marshalling.xtend deleted file mode 100644 index 02d93031b6a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/Marshalling.xtend +++ /dev/null @@ -1,51 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -import org.eclipse.uml2.uml.Operation -import static extension org.eclipse.papyrus.qompass.designer.core.UMLTool.* -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.cppType -import org.eclipse.uml2.uml.Parameter - -class Marshalling { - def static marshall(Operation operation) ''' - // now marshall in and inout parameters via ASN.1 - «FOR parameter : operation.parametersInInout» - «parameter.marshall» - «ENDFOR» - ''' - - def static marshallOutInout(Operation operation) ''' - // now marshall out and inout parameters via ASN.1 - «FOR parameter : operation.parametersOutInout» - «parameter.marshall» - «ENDFOR» - ''' - - def static marshall(Parameter parameter) ''' - { - «parameter.type.cppType» varName_ASN = «parameter.name»; - BEncAsnContent (&pBuffer, &varName_ASN); - } - ''' - - def static unmarshall(Operation operation) ''' - «FOR parameter : operation.parametersInInout.reverse» - «parameter.unmarshall» - «ENDFOR» - ''' - - def static unmarshallOutInout(Operation operation) ''' - «FOR parameter : operation.parametersOutInout.reverse» - «parameter.unmarshall» - «ENDFOR» - ''' - - def static unmarshall(Parameter parameter) ''' - «parameter.type.cppType» «parameter.name» - { - «parameter.type.cppType» varName_ASN; - BDecAsnContent (&pBuffer, &varName_ASN); - «parameter.name» = varName_ASN; - } - ''' - -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/MultipleReceptacle.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/MultipleReceptacle.xtend deleted file mode 100644 index 0f73ff273e2..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/MultipleReceptacle.xtend +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -import org.eclipse.uml2.uml.Operation -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.cppCall - -class MultipleReceptacle { - def operation_(Operation operation) ''' - for (int i=0; i<9; i++) { - if (rconn[i] != 0) { - rconn[i]->«operation.cppCall»; - } - } - ''' -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineGen.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineGen.xtend deleted file mode 100644 index 310526b1998..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineGen.xtend +++ /dev/null @@ -1,412 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -import org.eclipse.emf.common.util.BasicEList -import org.eclipse.emf.common.util.EList -import org.eclipse.emf.ecore.util.EcoreUtil -import org.eclipse.papyrus.C_Cpp.Ptr -import org.eclipse.papyrus.FCM.DerivedElement -import org.eclipse.papyrus.qompass.designer.core.StUtils -import org.eclipse.papyrus.qompass.designer.core.Utils -import org.eclipse.papyrus.qompass.designer.core.UMLTool -import org.eclipse.papyrus.qompass.designer.core.extensions.IXtend -import org.eclipse.papyrus.qompass.designer.core.sync.InterfaceSync -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil -import org.eclipse.uml2.uml.Behavior -import org.eclipse.uml2.uml.BehavioredClassifier -import org.eclipse.uml2.uml.CallEvent -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.OpaqueExpression -import org.eclipse.uml2.uml.Operation -import org.eclipse.uml2.uml.Pseudostate -import org.eclipse.uml2.uml.PseudostateKind -import org.eclipse.uml2.uml.Reception -import org.eclipse.uml2.uml.Signal -import org.eclipse.uml2.uml.SignalEvent -import org.eclipse.uml2.uml.State -import org.eclipse.uml2.uml.StateMachine -import org.eclipse.uml2.uml.TimeEvent -import org.eclipse.uml2.uml.Transition -import org.eclipse.uml2.uml.Trigger -import org.eclipse.uml2.uml.Type -import org.eclipse.uml2.uml.ValueSpecification -import org.eclipse.uml2.uml.Vertex -import org.eclipse.uml2.uml.util.UMLUtil - -import static org.eclipse.papyrus.qompass.designer.core.EnumService.* -import static org.eclipse.papyrus.qompass.designer.vsl.ParseVSL.* - -import static extension org.eclipse.papyrus.qompass.designer.core.UMLTool.* -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.BehaviorUtil.* -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.cppCall -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.StateMachineUtil.* -import org.eclipse.papyrus.uml.tools.utils.PackageUtil -import org.eclipse.uml2.uml.UMLPackage -import org.eclipse.uml2.uml.Enumeration - -class StateMachineGen implements IXtend { - - Class clazz - - boolean ooPattern = true; - - def getStateMachine(Class clazz) { - // organized in a loop. But effectively supports single state machine - for (smBehavior : (clazz as BehavioredClassifier).ownedBehaviors.filter[it instanceof StateMachine]) { - return smBehavior as StateMachine - } - return null - } - - def activate(Class clazz) { - val sm = clazz.stateMachine - val flattener = new UMLFlattener - flattener.transform(sm) - activate(clazz, sm) - } - - def activate(Class clazz, StateMachine sm) ''' - m_currentState = STATE_«sm.region.initialState.name»; -#ifdef SM_VERBOSE - cout << "SM «clazz.name»: in state «sm.region.initialState.name»" << endl; -#endif - for (;;) { - processEvents(); - } - ''' - - def processEvents(Class clazz) { - val sm = clazz.stateMachine - // - Option to put processElements into original class (but, would need to copy dependencies & attributes) - // create new operation in class owning the state machine. - // val operation = clazz.createOperation("processEvents", null) - // val ob = clazz.createOpaqueBehavior(operation) - // ob.set(clazz.processEventsSM(sm).toString) - // return "executor->processEvents();" - this.clazz = clazz - return clazz.processEventsSM(sm) - } - - def eventInterceptor(Operation operation) ''' - «/*TODO: need better way to detect signal*/» - «operation.eventInterceptorCommon» - event.portID = portID; - out->writeEvent(event); - - «IF (operation.type != null)»return «ENDIF»rconn->«operation.cppCall»; - ''' - - /** - * OO variant of event interceptor. Adds call event to pool and - * then calls the original method (handled by LW container) - */ - def eventInterceptorOO(Operation operation) ''' - «operation.eventInterceptorCommon» - ''' - - def eventInterceptorCommon(Operation operation) ''' - «val derivedElement = UMLUtil.getStereotypeApplication(operation, DerivedElement)» - «IF (derivedElement != null) && (derivedElement.source instanceof Reception)» - «val signal = (derivedElement.source as Reception).signal» - // create event with global signal ID - core::ContainerServices::CallEvent_ event; - event.operationID = «literal(SIGNAL_ENUM, operation.name)»; - // map signal into value-buffer and copy attributes - ::«signal.qualifiedName» * signal = (::«signal.qualifiedName» *) &event.params; - «FOR attribute : signal.ownedAttributes» - signal->«attribute.name» = «attribute.name»; - «ENDFOR» - «PackageUtil.getRootPackage(operation).declareDependencyToSignalIDs» - «UMLTool.declareDependency(TransformationContext.classifier, signal)» - «ELSE» - // create event with operationID/portID and pass call - core::ContainerServices::CallEvent_ event; - «IF ooPattern» - event.operationID = OP_ID_«operation.name»; - «ELSE» - event.operationID = ID_«operation.name»; - «ENDIF» - «ENDIF» - ''' - - def processEventsSM(BehavioredClassifier clazz, StateMachine sm) ''' - // processEvents body - generated by Qompass - // - // supports ports «FOR port : (clazz as Class).ownedPorts» «literal('PortEnum_'+clazz.name, 'port_'+clazz.name+'_'+port.name)»«ENDFOR» - - core::ContainerServices::CallEvent_ event; - int timeout; - int newState; - bool needsTrigger; - - switch(m_currentState) { - «FOR state : sm.region.subvertices» - case «literal('LStateIDs_'+clazz.name, 'STATE_'+state.name)»: - // -------- treatment of accepted events - «state.acceptableEvents» - break; - «ENDFOR» - default: - OSAL_ERROR ("Inconsistent state"); - break; - } - if (animOut != 0) { - animOut->enterState(newState, «clazz.fragment»); - } - ''' - - /* - * Pass the actual to which the port is bound. In case of a CallEvent, pass the implemented interface - * (Not the class to which the state machine is bound). This is useful in the context of components - * whose ports implement an interface - */ - def cetrigger(Operation operation) { - val intf = operation.implementsInterface - if (intf != null) { - val packageRef = intf.boundPackageRef - // declare dependency to OperationIDs enumeration - packageRef.declareDependencyToOperationIDs - '''«packageRef.qualifiedName»::ID_«operation.name»''' - } - else { - // create operationIDs literal - literal("LOperationIDs", '''OP_ID_«operation.name»''') - } - } - - // Use service for global enumerations - def setrigger(Trigger trigger) { - val se = trigger.event as SignalEvent - literal(SIGNAL_ENUM, InterfaceSync.SIG_PREFIX + se.signal.name) - } - - /** - * create code for acceptable events - * - * big restriction: will only analyse first of possibly multiple triggers - */ - def acceptableEvents(Vertex state) ''' - // loop on state - // execute action ... - timeout = -1; // no timeout by default - «FOR transition : state.outgoings» - «IF transition.triggers.size > 0» - «val trigger = transition.triggers.get(0)» - «IF (trigger.event instanceof TimeEvent)» - «val timeEvent = trigger.event as TimeEvent» - // transition «transition.name» - trigger: TimeEvent, expression «(timeEvent.when.expr as OpaqueExpression).bodies.get(0)». - timeout = «getDurationFromVSL((timeEvent.when.expr as OpaqueExpression).bodies.get(0))»/1000; - «ENDIF» - «ENDIF» - «ENDFOR» - - «IF ((state instanceof State) && (state as State).entry != null)» - // execute entry action - executor->«(state as State).entry.name»(); - «ENDIF» - - needsTrigger = true; - - «IF hasTransitionWithoutTrigger(state)» - «FOR transition : state.outgoings» - «IF transition.triggers.size == 0» - «IF transition.guard != null» - «transition.guard.specification.createGuardFct(null)» - if (executor->«transition.guard.specification.name»()) { - «ENDIF» - newState = STATE_«transition.target.name»; -#ifdef SM_VERBOSE - cout << "SM «clazz.name»: transition to state «transition.target.name»" << endl; -#endif - «IF (transition.effect != null)» - executor->«effectName(transition)»(); - «ENDIF» - needsTrigger = false; - «IF transition.guard != null» - } - «ENDIF» - «ENDIF» - «ENDFOR» - «ENDIF» - - if (needsTrigger) { - // get an event from the pool. - «IF ooPattern» - event = eventPool.readEvent(timeout); - «ELSE» - event = ep->readEvent(timeout); - «ENDIF» - } - else { - event.operationID = -1; - } - - «val allOutgoings = state.outgoings» - «FOR transition : allOutgoings» - «IF transition.triggers.size > 0» - // has «transition.triggers.size» outgoing transitions - «val trigger = transition.triggers.get(0)» - «IF (trigger.event instanceof TimeEvent)» - // transition «transition.name» - trigger: TimeEvent (there should be at most one outgoing timed transition per state). - if (event.operationID == core::ContainerServices::EventPool::ID_TIMEOUT) { - «IF transition.guard != null» - «transition.guard.specification.createGuardFct(null)» - if (executor->«transition.guard.specification.name»()) { - «ENDIF» - newState = STATE_«transition.target.name»; -#ifdef SM_VERBOSE - cout << "SM «clazz.name»: transition to state «transition.target.name»" << endl; -#endif - «IF (transition.effect != null)» - executor->«effectName(transition)»(); - «ENDIF» - «IF transition.guard != null» - } - «ENDIF» - } - «ENDIF» - «IF (trigger.event instanceof CallEvent)» - // transition «trigger.name» - trigger: CallEvent («trigger.event.name»), operation «(trigger.event as CallEvent).operation.name» - if (event.operationID == «cetrigger((trigger.event as CallEvent).operation)») { - newState = STATE_«transition.target.name»; -#ifdef SM_VERBOSE - cout << "SM «clazz.name»: transition to state «transition.target.name»" << endl; -#endif - «IF (transition.effect != null)» - executor->«effectName(transition)»(); - «ENDIF» - } - «ENDIF» - «IF (trigger.event instanceof SignalEvent)» - «val signalEvent = trigger.event as SignalEvent» - // transition «trigger.name» - trigger: SignalEvent («signalEvent.name»), signal «signalEvent.signal.name» - if (event.operationID == «setrigger(trigger)») { - «IF (transition.effect != null) || (transition.guard != null)» - // map signal to parameter section - ::«signalEvent.signal.qualifiedName» * signal = (::«signalEvent.signal.qualifiedName» *) &event.params; - «ENDIF» - «IF transition.guard != null» - «transition.guard.specification.createGuardFct(signalEvent)» - if (executor->«transition.guard.specification.name»(signal)) { - «ENDIF» - newState = STATE_«transition.target.name»; -#ifdef SM_VERBOSE - cout << "SM «clazz.name»: transition to state «transition.target.name» (due to signal «signalEvent.signal.name»)" << endl; -#endif - «IF (transition.effect != null)» - «transition.effect.addSignalParameter(signalEvent.signal)» - executor->«effectName(transition)»(«IF signalEvent.signal.attributes.size > 0»signal«ENDIF»); - «ENDIF» - // ok = EvQUEUE ; - «IF transition.guard != null» - } - «ENDIF» - } - «ENDIF» - «ENDIF» - «ENDFOR» - - if (newState != m_currentState) { - m_currentState = newState; - «IF ((state instanceof State) && (state as State).exit != null)» - // execute exit action - executor->«(state as State).exit.name»(); - «ENDIF» - - - } - ''' - - def boolean hasTransitionWithoutTrigger(Vertex state) { - for (transition : state.outgoings) { - if (transition.triggers.size == 0) { - return true; - } - } - return false; - } - - def EList calculateTransitions(Vertex state) { - val allOutgoings = new BasicEList - allOutgoings.addAll(state.outgoings) - for (transition : state.outgoings) { - if (transition.target instanceof Pseudostate) { - val ps = transition.target as Pseudostate - if (ps.kind == PseudostateKind.JUNCTION_LITERAL) { - allOutgoings.addAll(ps.outgoings.clone) - } - } - } - return allOutgoings - } - - /** - * Effects are moved from behaviors embedded into transitions towards behaviors of the class. Calculate the name of these - * effects. The class FilterStateMachines moves the effects (TODO: single name calculation) - */ - def effectName(Transition transition) { - // transition.containingStateMachine.name + "_" + transition.effect.name - if (transition.effect.name == null) { - throw new TransformationException( - String.format("effect of transition has no name (in SM %s)", transition.containingStateMachine.name)) - } - transition.effect.name - } - - def void addSignalParameter(Behavior behavior, Signal signal) { - if (behavior.ownedParameters.size == 0) { - val parameter = behavior.createOwnedParameter("signal", signal) - StereotypeUtil.apply(parameter, Ptr) - } - } - - def void moveBehavior(String newName, Class tmClass, Behavior effect) { - val copiedEffect = EcoreUtil.copy(effect) - if (tmClass.getOwnedOperation(newName, null, null) != null) { - // has already been added - return; - } - val operation = tmClass.createOwnedOperation(newName, null, null); - for (parameter : effect.getOwnedParameters()) { - val newParameter = EcoreUtil.copy(parameter); - operation.getOwnedParameters().add(newParameter); - StUtils.copyStereotypes(parameter, newParameter); - } - copiedEffect.setSpecification(operation); - copiedEffect.setName(newName); - tmClass.getOwnedBehaviors().add(copiedEffect); - } - - static final String CLIB_BOOL = "AnsiCLibrary::bool" - - def void createGuardFct(ValueSpecification specification, SignalEvent event) { - val name = specification.getName() - - if (clazz.getOwnedBehavior(name) != null) { - return - } - var booleanNamedElement = Utils.getQualifiedElement(TransformationContext.sourceRoot, CLIB_BOOL); - - if (booleanNamedElement instanceof Type) { - val booleanType = TransformationContext.copier.getCopy(booleanNamedElement) as Type - val operation = clazz.createOperation(name, booleanType as Type) - if (event != null) { - val sigParam = operation.createOwnedParameter("signal", event.signal) - StereotypeUtil.apply(sigParam, Ptr) - } - val ob = clazz.createOpaqueBehavior(operation) - if (specification instanceof OpaqueExpression) { - ob.getLanguages().addAll(specification.getLanguages()); - for (String body : specification.getBodies()) { - ob.getBodies().add("return " + body + ";"); - } - } - } - else { - System.out.println("was"); - } - // if (tmClass.getOwnedOperation(newName, null, null) != null) { - // copiedEffect.setSpecification(operation); - } -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineUtil.java b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineUtil.java deleted file mode 100644 index d33d2a0c9fb..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineUtil.java +++ /dev/null @@ -1,260 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core.xtend; - -import java.util.Collection; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.papyrus.qompass.designer.core.UMLTool; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.Pseudostate; -import org.eclipse.uml2.uml.PseudostateKind; -import org.eclipse.uml2.uml.Region; -import org.eclipse.uml2.uml.State; -import org.eclipse.uml2.uml.StateMachine; -import org.eclipse.uml2.uml.TemplateBinding; -import org.eclipse.uml2.uml.Transition; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.Vertex; - - -public class StateMachineUtil { - public static Region region(State state) { - EList regions = state.getRegions(); - if (regions.size() > 0) { - return regions.get(0); - } - return null; - } - - public static Region region(StateMachine stateMachine) { - EList regions = stateMachine.getRegions(); - if (regions.size() > 0) { - return regions.get(0); - } - return null; - } - - public static EList subStates(State state) { - Region region = region(state); - return (region != null) ? states(region) : new BasicEList(); - } - - public static EList states(StateMachine stateMachine) { - Region region = region(stateMachine); - return (region != null) ? states(region) : new BasicEList(); - } - - public static EList states(Region region) { - EList states = new BasicEList(); - for (org.eclipse.uml2.uml.Vertex vertex : region.getSubvertices()) { - if (vertex instanceof State) { - states.add((State) vertex); - } - } - return states; - } - - public static EList entryPoints(State state) { - EList pseudoStates = new BasicEList(); - for (Pseudostate pseudoState : state.getConnectionPoints()) { - if (pseudoState.getKind() == PseudostateKind.ENTRY_POINT_LITERAL) { - pseudoStates.add(pseudoState); - } - } - return pseudoStates; - } - - public static EList exitPoints(State state) { - EList pseudoStates = new BasicEList(); - for (Pseudostate pseudoState : state.getConnectionPoints()) { - if (pseudoState.getKind() == PseudostateKind.EXIT_POINT_LITERAL) { - pseudoStates.add(pseudoState); - } - } - return pseudoStates; - } - - public static EList junctionPoints(Region region) { - return filteredPseudoStates(region, PseudostateKind.JUNCTION_LITERAL); - } - - public static EList choicePoints(Region region) { - return filteredPseudoStates(region, PseudostateKind.CHOICE_LITERAL); - } - - public static EList filteredPseudoStates(Region region, PseudostateKind kind) { - EList pseudoStates = new BasicEList(); - for (Vertex vertex : region.getSubvertices()) { - if (vertex instanceof Pseudostate) { - Pseudostate pseudoState = (Pseudostate) vertex; - if (pseudoState.getKind() == kind) { - pseudoStates.add(pseudoState); - } - } - } - return pseudoStates; - } - - public static Pseudostate firstPseudoState(Region region, PseudostateKind kind) { - for (Vertex vertex : region.getSubvertices()) { - if (vertex instanceof Pseudostate) { - Pseudostate pseudoState = (Pseudostate) vertex; - if (pseudoState.getKind() == kind) { - return pseudoState; - } - } - } - return null; - } - - /** - * @return The set of all transitions ending indirectly on the state. - * This is, those which end on one of the state's entry points. - */ - public static Collection indirectIncomings(State state) { - EList indirectIncoming = new BasicEList(); - for (Pseudostate p : entryPoints(state)) { - for (Transition t : p.getIncomings()) { - indirectIncoming.add(t); - } - } - return indirectIncoming; - } - - /** - * @return The set of all transitions ending indirectly on the state. - * This is, those which end on one of the state's entry points. - */ - public static Collection indirectOutgoings(State state) { - EList indirectIncoming = new BasicEList(); - for (Pseudostate p : entryPoints(state)) { - for (Transition t : p.getIncomings()) { - indirectIncoming.add(t); - } - } - return indirectIncoming; - } - - - /** - * @return The set of all direct and indirect incoming transitions to the state. - */ - public static Collection allIncomings(State state) { - EList allIncoming = new BasicEList(); - for (Transition t : state.getIncomings()) { - allIncoming.add(t); - } - allIncoming.addAll(indirectIncomings(state)); - return allIncoming; - } - - /** - * @return The set of all direct and indirect incoming transitions to the state. - */ - public static Collection allOutgoings(State state) { - EList allIncoming = new BasicEList(); - for (Transition t : state.getIncomings()) { - allIncoming.add(t); - } - allIncoming.addAll(indirectOutgoings(state)); - return allIncoming; - } - - /** - * Adds all the inner elements of a composite state to self, except for the - * initial, entry, exit and history pseudo-states. - * - * This operation moves those elements, as it removes them from their - * original container and sets their owner to the recipient. - */ - public static void moveContents(Region targetRegion, State source) { - Region sourceRegion = region(source); - EList vertices = new BasicEList(sourceRegion.getSubvertices()); - for (Vertex v : vertices) { - // move states and pseudostates - targetRegion.getSubvertices().add(v); - } - EList transitions = new BasicEList(sourceRegion.getTransitions()); - for (Transition t : transitions) { - targetRegion.getTransitions().add(t); - } - } - - public static Pseudostate initialState(Region region) { - return firstPseudoState(region, PseudostateKind.INITIAL_LITERAL); - } - - public static Pseudostate deepHistory(Region region) { - return firstPseudoState(region, PseudostateKind.DEEP_HISTORY_LITERAL); - } - - public static State createState(Region region, String name) { - return (State) region.createSubvertex(name, UMLPackage.eINSTANCE.getState()); - } - - public static Pseudostate createPseudostate(Region region, String name) { - return (Pseudostate) region.createSubvertex(name, UMLPackage.eINSTANCE.getPseudostate()); - } - - /** - * Return the bound package in the context of template instantiation for a given actual. - * - * This is required by the state machine template which needs to access operation IDs - * provided by the call interceptor. - * - * @param actual - * The actual for template binding - * @return - */ - public static Package boundPackageRef(Type actual) { - for (Package nestedPkg : PackageUtil.getRootPackage(actual).getNestedPackages()) { - // search for bound package templates who are bound to the same actual - // TODO: search is ambiguous, if same actual is used more than once - if (nestedPkg.getTemplateBindings().size() > 0) { - TemplateBinding binding = nestedPkg.getTemplateBindings().get(0); - if (actual == TemplateUtils.getFirstActualFromBinding(binding)) { - return nestedPkg; - } - } - } - return null; - } - - /** - * Declares a dependency from the current classifier which is produced by template instantiation - * to the element (enum) "OperationIDs", if found within the passed package. - * - * @param pkg - * @return - */ - public static void declareDependencyToOperationIDs(Package pkg) { - PackageableElement type = pkg.getPackagedElement("OperationIDs"); //$NON-NLS-1$ - if (type instanceof Type) { - UMLTool.declareDependency(TransformationContext.classifier, (Type) type); - } - } - - /** - * Declares a dependency from the current classifier which is produced by template instantiation - * to the element (enum) "SignalIDs", if found within the passed package. - * - * @param pkg - * the package in which an enumeration is looked up - * @return - */ - public static void declareDependencyToSignalIDs(Package pkg) { - NamedElement type = Utils.getQualifiedElement(pkg, "globalenums::" + SIGNAL_ENUM); //$NON-NLS-1$ - if (type instanceof Type) { - UMLTool.declareDependency(TransformationContext.classifier, (Type) type); - } - } - - static final String SIGNAL_ENUM = "SignalIDs"; -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StructBasedMarshalling.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StructBasedMarshalling.xtend deleted file mode 100644 index 89d085b3937..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StructBasedMarshalling.xtend +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -import org.eclipse.uml2.uml.Operation -import static extension org.eclipse.papyrus.qompass.designer.core.UMLTool.* -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.cppType - -// TODO: original model code does effectively do more than marshalling -class StructBasedMarshalling { - def static marshall(Operation operation) ''' - struct ParamData { - «FOR parameter : operation.parametersInInout» - «parameter.type.cppType» «parameter.name»; - «ENDFOR» - }; - Event event; - event.ID = [operation.name/]; - event.kind = CallEvent; - ParamData * data = &event.params; - «FOR parameter : operation.parametersInInout» - data->[parameter.name/] = [parameter.name/]; - «ENDFOR» - out->dispatch(event); - ''' - -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/SyncCalls.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/SyncCalls.xtend deleted file mode 100644 index 96952f2f8d1..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/SyncCalls.xtend +++ /dev/null @@ -1,13 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -import org.eclipse.uml2.uml.Operation -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.* - -class SyncCalls { - def syncCall(Operation operation) ''' - // put pre-interceptors here - [comment type is a derived property containing the operations return type/] - «IF operation.type != null»return «ENDIF»rconn->«operation.cppCall»; - // put post-interceptors here - ''' -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLAction.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLAction.xtend deleted file mode 100644 index 3cbc6f2da3a..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLAction.xtend +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* -* Copyright (c) 2014 Zeligsoft, CEA and others. -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v1.0 -* which accompanies this distribution, and is available at -* http://www.eclipse.org/legal/epl-v10.html -*******************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -import org.eclipse.xtend.lib.annotations.Accessors -import org.eclipse.uml2.uml.Behavior -import java.util.List -import java.util.ArrayList - -/** - * An action in the sense of the invocation of a behavior. - * This means that the actual behavior is not described here. The action - * is referencing the behavior and providing information how to invoke the - * behavior. - * The action has no prefix: the name of the referenced behavior needs to be prefixed, if necessary - * - * @author Ansgar (based on code from eposse) - * - */ -class UMLAction { - - /** Source UMLRT model element. */ - @Accessors Behavior origin - - // list of parameters for a call, simply a list of strings. if null => no parameters - public List callParams; - - new(Behavior origin) { - this.origin = origin - } - - /** - * Add a parameter - */ - def addParam(String parameter) { - if (callParams == null) { - callParams = new ArrayList() - } - callParams.add = parameter - } - - def getSpecification() { - origin.specification - } - - def getFuncName() { - origin.name - } - - override toString() '''Action(«origin.name»)''' - -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLChain.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLChain.xtend deleted file mode 100644 index 05bf596b9a6..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLChain.xtend +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* -* Copyright (c) 2014 Zeligsoft (2009) Limited and others. -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v1.0 -* which accompanies this distribution, and is available at -* http://www.eclipse.org/legal/epl-v10.html -*******************************************************************************/ - -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -import java.util.HashMap -import java.util.List -import java.util.Map -import org.eclipse.uml2.uml.Behavior -import org.eclipse.uml2.uml.Transition -import org.eclipse.xtend.lib.annotations.Accessors - -/** - * A chain of state entry, exit and transition actions for a "flat" - * {@link Transition}. - * - * @author eposse - * - */ -class UMLChain { - - @Accessors List actions - @Accessors Transition owner - - static Map chains; - - new () { - actions = newArrayList - } - - new (List actions) { - this.actions = newArrayList(actions) // We need this to be mutable. - } - - def static void initChains() { - chains = new HashMap(); - } - - /** - * Return the chain of behaviors associated with a transition - * IF the chain does not exist yet, it will be created (and stored in a hash map) - * @param t - * @return - */ - def static UMLChain chain(Transition t) { - var UMLChain chain = chains.get(t) - if (chain == null) { - chain = new UMLChain() - chain.setOwner(t) - chains.put(t, chain) - } - return chain - } - - def append(UMLAction action) { - actions.add(action) - return this - } - - def append(Behavior behavior) { - if (behavior != null) { - append(new UMLAction(behavior)) - } - return this - } - - def prepend(UMLAction action) { - actions.add(0, action) - return this - } - - def prepend(Behavior behavior) { - prepend(new UMLAction(behavior)) - return this - } - - def getOwner() { - owner - } - - def setOwner(Transition t) { - owner = t - // add transition effect to action list - append(t.effect) - } -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlatModel2Cpp.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlatModel2Cpp.xtend deleted file mode 100644 index fe1b522e4bf..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlatModel2Cpp.xtend +++ /dev/null @@ -1,667 +0,0 @@ -/******************************************************************************* -* Copyright (c) 2014 Zeligsoft, CEA and others. -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v1.0 -* which accompanies this distribution, and is available at -* http://www.eclipse.org/legal/epl-v10.html -*******************************************************************************/ -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -import org.eclipse.uml2.uml.Port -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.Property -import org.eclipse.uml2.uml.State -import org.eclipse.uml2.uml.StateMachine -import org.eclipse.uml2.uml.Transition -import java.util.Map -import org.eclipse.uml2.uml.NamedElement -import java.util.Collection -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.StateMachineUtil.* -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.BehaviorUtil.* -import org.eclipse.uml2.uml.UMLPackage -import org.eclipse.uml2.uml.Enumeration -import org.eclipse.uml2.uml.EnumerationLiteral -import org.eclipse.uml2.uml.Pseudostate -import org.eclipse.uml2.uml.PseudostateKind -import org.eclipse.uml2.uml.Operation -import org.eclipse.uml2.uml.OpaqueBehavior -import org.eclipse.uml2.uml.Parameter -import org.eclipse.uml2.uml.CallEvent -import org.eclipse.uml2.uml.Stereotype -import org.eclipse.uml2.uml.Type -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.UMLChain.chain -import java.util.List -import org.eclipse.papyrus.qompass.designer.core.EnumService - -/** - * This class contains the transformation from flat UML-RT state machines to the - * C/C++ language model. - * - * It implements the algorithms described in the technical report - * - * E. Posse. "Transforming flat UML-RT State Machines to a C/C++ language model". - * Technical Report ZTR-2014-EP-002, Version 2, Zeligsoft, Sep 2014. - * - * Ansgar Radermacher (CEA): translation to UML transformation - * @author eposse - */ -class UMLFlatModel2Cpp { - - /** - * The CppCodePattern that is being used for this transformation operation. - */ - - /** The source state machine to transform */ - StateMachine machine - Class clazz - - /** Elements that go into the generated model. */ - Enumeration statesDeclaration - Property currentStateField - Map stateEnumerators - Property historyTableDeclaration - Operation saveHistoryFunction - Map actionChainFunctions - Map junctionPointFunctions - Map choicePointFunctions - Map stateFunctions - Operation injectFunc - Operation initializeFunc - Stereotype refStereo - Stereotype constStereo - - new() { - stateEnumerators = newHashMap - // userActionFunctions = newHashMap - actionChainFunctions = newHashMap - junctionPointFunctions = newHashMap - choicePointFunctions = newHashMap - stateFunctions = newHashMap - } - - /** - * This is the main method of the transformation. It performs the - * transformation by invoking methods that generate each part of the - * target language model. - */ - def transform(StateMachine m) { - machine = m - clazz = m.owner as Class - - generateStatesDeclaration - generateCurrentStateField - generateHistoryTableDeclaration - generateSaveHistoryFunction - // generateAllUserActionFunctions - generateAllActionChainFunctions - generateAllJunctionFunctions - generateAllChoicePointFunctions - generateAllStateFunctions - generateInjectFunc - generateInitializeFunc - } - - /** - * Builds an enum type for the states of the state machine. - * - * The generated code would be something like: - * - *

    -     * enum State { s0, s1, s1_s0, s1_s1, s2, ... };
    -     * 
    - */ - def generateStatesDeclaration() { - - val clazz = machine.owner as Class - statesDeclaration = clazz.createNestedClassifier(GlobalConstants.STATE_TYPE_NAME, - UMLPackage.eINSTANCE.getEnumeration) as Enumeration - for (s : machine.states) { - if (s.name == null) { - s.name = "undefined" - } - val stateLiteral = statesDeclaration.createOwnedLiteral(s.name) - stateEnumerators.put(s, stateLiteral) - } - statesDeclaration.createOwnedLiteral(GlobalConstants.UNVISITED) - - // stateEnumerators.put(State.UNVISITED, unvisitedStateLiteral) - } - - /** - * Generates a field to hold the current state. - * - * The generated code would be something like: --- * - *

    -     * 
    -     * State currentState;
    -     * 
    -     * 
    - */ - def generateCurrentStateField() { - currentStateField = clazz.createOwnedAttribute(GlobalConstants.CURRENT_STATE_FIELD_NAME, statesDeclaration) - } - - /** - * Generates a declaration for the history table for the state machine. - * - * The generated code would be something like: - * - *

    - * State[] history = { UNDEFINED, ..., UNDEFINED }; - */ - def generateHistoryTableDeclaration() { - - // TODO: currentStateField already used (probably wrong!) - historyTableDeclaration = clazz.createOwnedAttribute(GlobalConstants.HISTORY_TABLE_NAME, statesDeclaration) - val numStates = machine.states.size - - // use CppArray instead? - // TODO - // currentStateField.upper = numStates - - // get constructor TODO - var ctor = clazz.getOwnedOperation(clazz.getName(), null, null) - var OpaqueBehavior ctorOB - if (ctor != null) { - ctorOB = ctor.methods.get(0) as OpaqueBehavior - } - if (ctor == null) { - ctor = clazz.createOperation(clazz.getName(), null) - ctorOB = clazz.createOpaqueBehavior(ctor) - } - - // TODO: might be more than one constructor - ctorOB.set(''' - int i = 0; - while (i<«numStates») { - «GlobalConstants.HISTORY_TABLE_NAME»[i++] = «GlobalConstants.UNVISITED»; - }''') - } - - /** - * Generates a function that saves history. - * - * The code generated is as follows: - * - *

    -     * 
    -     * void saveHistory(State compositeState, State subState) {
    -     *     history[compositeState] = subState;
    -     * }
    -     * 
    -     * 
    - * - * where State is the capsule's state type (an enum) and - * history is the capsule's history table. - * - *

    Note: The current implementation generates this as a normal - * function but it should be either a macro or an inline function. - * However the C/C++ language model does not currently support these. - * - * @see - * #generateStatesDeclaration - * #generateHistoryTableDeclaration - */ - def generateSaveHistoryFunction() { - - // Create the operation programmatically. Yet, it would be better - // to provide a model template for this - // [LW container-transformation - // saveHist(State compositeState, State subState) { - // historyTable[param1] = param2; - // } - saveHistoryFunction = clazz.createOwnedOperation(GlobalConstants.SAVE_HISTORY_FUNC_NAME, null, null) - saveHistoryFunction.createOwnedParameter("compositeState", stateType) - saveHistoryFunction.createOwnedParameter("subState", stateType) - // behavior might exist already (created by flattener) - var funcOB = clazz.getOwnedBehavior(GlobalConstants.SAVE_HISTORY_FUNC_NAME) - if (funcOB == null) { - funcOB = clazz.createOpaqueBehavior(saveHistoryFunction) - } - else { - funcOB.specification = saveHistoryFunction - } - funcOB.set("history[compositeState] = subState;") - } - - /** - * Generate function declarations for transition action chains. - * - *

    Each function generated will have a sequence of calls, invoking either - * the action functions generated by {@link generateActionFunc} for - * transition, state entry and state exit actions, as well as invoking - * "save history" actions produced by the flattening transformation. - */ - def generateAllActionChainFunctions() { - for (t : machine.region.transitions) { - val f = generateActionFunc(t) - actionChainFunctions.put(t, f) - } - } - - /** - * Generates the function declaration for a single action chain. - */ - def generateActionFunc(Transition t) { - val transitionFuncName = GlobalConstants.TRANS_ACTION_FUNC_PREFIX + "__" + t.name - val transitionFunc = clazz.createOwnedOperation(transitionFuncName, null, null) - transitionFunc.createRTMessageParam(GlobalConstants.CHAIN_FUNC_PARAM) - var transitionFuncOB = t.effect - if (transitionFuncOB == null) { - transitionFuncOB = clazz.createOpaqueBehavior(transitionFunc); - } - else { - transitionFuncOB.specification = transitionFunc - clazz.ownedBehaviors.add(transitionFuncOB) - } - - val chainFuncName = GlobalConstants.ACTION_FUNC_PREFIX + "__" + t.name - val chainFunc = clazz.createOwnedOperation(chainFuncName, null, null) - chainFunc.createRTMessageParam(GlobalConstants.CHAIN_FUNC_PARAM) - val chainFuncOB = clazz.createOpaqueBehavior(chainFunc); - - // now examine chain (separate function generateActionInvocation in original code) - // Generates a call to an action, either user action or action generated by - // the transformation. - var code = "" - for (action : t.chain.actions) { - code += call(action.specification, action.callParams) - } - chainFuncOB.set(code) - return chainFuncOB as OpaqueBehavior - } - - // def Enumerator getEnum(CppEnum enum1, String string) { - // throw new UnsupportedOperationException("TODO: auto-generated method stub") - // } - /** - * Generates all functions corresponding to choice points. - */ - def generateAllChoicePointFunctions() { - for (c : machine.region.choicePoints) { - val f = generateChoiceFunc(c) - choicePointFunctions.put(c, f) - } - } - - /** - * Generates the function corresponding to a given choice point. - */ - def generateChoiceFunc(Pseudostate p) { - val funcName = GlobalConstants.CHOICE_FUNC_PREFIX + p.name - val funcDecl = clazz.createOperation(funcName, null) - val param = funcDecl.createRTMessageParam(GlobalConstants.CHOICE_FUNC_PARAM) - val funcDeclOB = clazz.createOpaqueBehavior(funcDecl) - - // if (generateGuard) { [actFunc/](param); [DestStatement] - var code = "" - for (t : p.outgoings) { - code += ''' - if («t.guard.body») { - «call(actionChainFunctions.get(t), param.name)» - // TODO: return instead - «currentStateField.name» = «getDestination(t, false)»; - } - ''' - } - funcDeclOB.set(code) - return funcDeclOB - } - - /** - * Generates all functions corresponding to junction points. - */ - def generateAllJunctionFunctions() { - for (j : machine.region.junctionPoints) { - val f = generateJunctionFunc(j) - junctionPointFunctions.put(j, f) - } - } - - /** - * Generates the function corresponding to a specific junction point. - */ - def generateJunctionFunc( - Pseudostate p - ) { - val funcName = GlobalConstants.JUNCTION_FUNC_PREFIX + p.name - val funcDecl = clazz.createOperation(funcName, null) - val funcDeclOB = clazz.createOpaqueBehavior(funcDecl) - funcDecl.createRTMessageParam(GlobalConstants.JUNC_FUNC_PARAM) - val t = p.outgoings.get(0) // There should be only one. - var code = "" - if (t != null) { - val actFunc = actionChainFunctions.get(t) - code += call(actFunc, GlobalConstants.JUNC_FUNC_PARAM) - } - code += getDestination(t, false) - funcDeclOB.set(code) - funcDeclOB - } - - /** - * Generates all functions corresponding to states. - */ - def generateAllStateFunctions() { - for (s : machine.states) { - val f = generateStateFunc(s) - stateFunctions.put(s, f) - } - } - - /** - * Generates the function corresponding to a given state. - */ - def generateStateFunc(State state) { - val name = GlobalConstants.STATE_FUNC_PREFIX + state.name - val retType = statesDeclaration - val func = clazz.createOperation(name, retType) - val param = func.createRTMessageParam(GlobalConstants.STATE_FUNC_PARAM) - val funcOB = clazz.createOpaqueBehavior(func) - val table = getPortTransitionsTable(state) - - val code = ''' - switch («getPortCond(param)») { - «FOR port : table.keySet» - case «enumeratorFor(port)»: - switch(«getSigCond(param)») { - «FOR t : table.get(port)» - «FOR trigger : t.triggers.filter[it.ports.contains(port)]» - case «enumeratorFor(trigger.event as CallEvent)»: - «IF (t.guard != null)»if (t.guard) { «ENDIF» - «actionChainFunctions.get(t).name»(«param.name»); - return «getDestination(t, false)»; - «IF (t.guard != null)»}«ENDIF» - «ENDFOR» - «ENDFOR» - } - «ENDFOR» - } - ''' - funcOB.set(code) - funcOB - } - - /** - * Builds a table that contains for each port, all the outgoing transitions - * of a given state whose trigger has that port. - * - * @param s a {@link State} - * @return a table T indexed by {@link Port}s such that for each port p, the - * entry T[p] contains all outgoing {@link Transition}s from s - * whose trigger has port p. - */ - private def getPortTransitionsTable(State s) { - val table = newHashMap - for (t : s.outgoings) { - for (trigger : t.triggers) { - for (p : trigger.ports) { - if (!table.containsKey(p)) { - table.put(p, newHashSet) - } - table.get(p).add(t) - } - } - } - return table - } - - /** - * Obtains the function call corresponding to a transition's destination. - * - * @param t - The {@link Transition} - * @param init - Whether we are looking for the destination to be obtained - * in the ized method or in the inject method. - */ - private def getDestination(Transition t, boolean init) { - var String retVal - if (t.target instanceof Pseudostate) { - val ps = t.target as Pseudostate - if (ps.kind == PseudostateKind.CHOICE_LITERAL) { - val func = choicePointFunctions.get(ps) - retVal = func.getName() + "();" - } else if (ps.kind == PseudostateKind.JUNCTION_LITERAL) { - val func = junctionPointFunctions.get(ps) - retVal = func.getName() + "();" - } - } else { - retVal = stateEnumerators.get(t.target).name - } - if (init) { - // currentStateField = << code >> - retVal = '''«currentStateField.name» = «retVal»;''' - } - retVal - } - - /** - * Generates the main 'inject' function that receives and handles events. - */ - def generateInjectFunc() { - injectFunc = clazz.createOperation(GlobalConstants.INJECT_FUNC_NAME, null) - - // injectFunc.setVirtual() - injectFunc.createRTMessageParam(GlobalConstants.INJECT_FUNC_PARAM) - val injectFuncOB = clazz.createOpaqueBehavior(injectFunc) - val code = ''' - switch(stateCond) { - «FOR s : machine.states» - case «enumFor(s)»: - «currentStateField.name» = «call(stateFunctions.get(s), GlobalConstants.INJECT_FUNC_PARAM)» - break; - «ENDFOR» - } - ''' - injectFuncOB.set(code) - injectFunc - } - - - /** - * Build the initialize function which performs the initial transition. - * - *

    This assumes that the top level of the state machine must have an - * initial pseudo-state, and that there is exactly one outgoing transition - * from such initial point. - * - *

    If there is no initial point, the body of the initialize method is - * empty. - */ - def generateInitializeFunc() { - initializeFunc = clazz.createOperation(GlobalConstants.INITIALIZE_FUNC_NAME, null) - - // initializeFunc.setVirtual() - initializeFunc.createRTMessageParam(GlobalConstants.INITIALIZE_FUNC_PARAM) - val initializeFuncOB = clazz.createOpaqueBehavior(initializeFunc) - - var code = "" - if (machine.region.initialState != null) { - val initialTransition = machine.region.initialState.outgoings.get(0); - if (initialTransition != null) { - val actFunc = actionChainFunctions.get(initialTransition) - if (actFunc != null) { - code += call(actFunc, GlobalConstants.INITIALIZE_FUNC_PARAM) - } - } - code += getDestination(initialTransition, true) - initializeFuncOB.set(code) - } - } - - def call(NamedElement fct, String param) ''' - «fct.name»(«param»); - ''' - - def call(NamedElement fct, List params) ''' - «IF params != null» - «fct.name»(«FOR param : params SEPARATOR ', '»«param»«ENDFOR»); - «ELSE» - «fct.name»(); - «ENDIF» - ''' - - /** - * Generates the compilation unit for the state machine (*) - * - *

    Notes: This implementation generates only a list of elements - * to be consumed by the capsule generator which is assumed to be - * responsible for putting together the full compilation unit. - */ - /* - def generateCompilationUnit() { - // already added? - - cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, statesDeclaration); - cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, currentStateField) - cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, historyTableDeclaration) - cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, saveHistoryFunction) - for (action : userActionFunctions.keySet) { - cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, userActionFunctions.get(action)) - } - for (chain : actionChainFunctions.keySet) { - cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, actionChainFunctions.get(chain)) - } - for (junction : junctionPointFunctions.keySet) { - cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, junctionPointFunctions.get(junction)) - } - for (choice : choicePointFunctions.keySet) { - cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, choicePointFunctions.get(choice)) - } - for (state : stateFunctions.keySet) { - cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, stateFunctions.get(state)) - } - - return generatedModel - } - */ - /** - * Auxiliary methods - */ - private def getStateType() { - statesDeclaration - } - - private def getRTMessageType() { - // TODO: import umlrts instead of declaring it in model - val umlrts = clazz.getModel().getPackagedElement("umlrts") as org.eclipse.uml2.uml.Package - umlrts.getPackagedElement("RTMessage") as org.eclipse.uml2.uml.Type; - } - - private def createRTMessageParam(Operation operation, String paramName) { - val param = operation.createOwnedParameter(paramName, RTMessageType) - if (refStereo == null) { - refStereo = param.getApplicableStereotype("C_Cpp::Ref") - } - if (refStereo != null) { - param.applyStereotype(refStereo) - } - if (constStereo == null) { - constStereo = param.getApplicableStereotype("C_Cpp::Const") - } - if (constStereo != null) { - param.applyStereotype(constStereo) - } - param - } - - // TODO - why not used any more? - private def getRTDataType(Transition t) { - var Type rtdataType = null - val Collection types = newHashSet - for (trigger : t.triggers) { - val evt = trigger.event as CallEvent - val params = evt.operation.ownedParameters - if (! params.empty) { - val first = params.get(0) - types.add(first.type) - } - } - if (types.size == 1) { - val type = types.get(0) - // TODO - was - createType - rtdataType = type - } - rtdataType - } - - private def enumFor(State s) { - stateEnumerators.get(s).label - } - - private def dispatch enumeratorFor(Port port) { - val enumerator = EnumService.literal('PortID', port.name) - enumerator - } - - private def dispatch enumeratorFor(CallEvent ce) { - val operation = ce.operation - val protocolCls = EnumService.literal('ProtocolClass', (operation.getInterface().owner as NamedElement).name); - '''«protocolCls»::signal_«ce.name»''' - } - - /** - * Builds an expression to obtain the port enum id for the switch. - * - *

    It assumes that the message parameter to the inject function is a - * pointer to the RTMessage type, as returned by {@link #getRTMessageType}, - * this is, the signature of the inject function must be: - * - *

    -     * void inject(UMLRTMessage * msg)
    -     * 
    - * - *

    It also assumes that the port id and signal id are accessible from - * this type. Basically the assumption is that the relevant definitions are - * as follows: - * - *

    - *

    -     * 
    -     * class UMLRTMessage : ... {
    -     * public:
    -     *     UMLRTPort * destPort;
    -     *     UMLRTSignal * signal;
    -     * }
    -     *
    -     * struct UMLRTPort {
    -     *     int id;
    -     *     // ...
    -     * }
    -     *
    -     * class UMLRTSignal {
    -     * public:
    -     *     int id;
    -     *     // ...
    -     * }
    -     * 
    -     * 
    - * - *

    ... where the typed UMLRTPortId and - * UMLRTSignalId can be cast to the Port and - * Signal enum types generated in the state machine's class. - * - *

    Given this assumptions, the port condition generated has the form: - * - *

    (Port)(msg->destPort)->id
    - * - *

    and the signal condition is: - * - *

    (ProtocolX::Signal)(msg->signal)->getId()
    - * - *

    where ProtocolX is the name of the port's protocol - */ - private def getPortCond(Parameter param) { - //val messagePortField = UMLRTMessage.destPort() - //val portIdField = UMLRTCommsPort.id() - //'''«param.name».«messagePortField.name»->«portIdField.name»''' - '''TODO''' - } - - private def getSigCond(Parameter param) { - //val messageSignalField = UMLRTMessage.signal() - //val signalIdAccessor = UMLRTSignal.getId() - //'''«param.name»->«messageSignalField.name»->«signalIdAccessor.name»()''' - '''TODO''' - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlattener.xtend b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlattener.xtend deleted file mode 100644 index 002469ae5b0..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlattener.xtend +++ /dev/null @@ -1,556 +0,0 @@ -/******************************************************************************* -* Copyright (c) 2014 Zeligsoft, CEA and others. -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v1.0 -* which accompanies this distribution, and is available at -* http://www.eclipse.org/legal/epl-v10.html -*******************************************************************************/ -package org.eclipse.papyrus.qompass.modellibs.core.xtend - -import org.eclipse.uml2.uml.Behavior -import org.eclipse.uml2.uml.Class -import org.eclipse.uml2.uml.NamedElement -import org.eclipse.uml2.uml.Pseudostate -import org.eclipse.uml2.uml.PseudostateKind -import org.eclipse.uml2.uml.Region -import org.eclipse.uml2.uml.State -import org.eclipse.uml2.uml.StateMachine -import org.eclipse.uml2.uml.Transition -import org.eclipse.uml2.uml.UMLPackage -import org.eclipse.uml2.uml.Vertex - -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.BehaviorUtil.* -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.StateMachineUtil.* -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.UMLChain.chain -import org.eclipse.uml2.uml.OpaqueBehavior - -/** - * This class contains the transformation for flattening UML-RT state machines - * - * It implements the algorithms described in the technical report - * - * E. Posse. "Flattening UML-RT State Machines". - * Technical Report ZTR-2014-EP-001, Version 2, Zeligsoft, Sep 2014. - * - * @author eposse - */ -class UMLFlattener { - - val FRESH_NAME_PREFIX = "p" - val FRESH_ENTRYPOINT_NAME_PREFIX = "entrypoint_" - val FRESH_EXITPOINT_NAME_PREFIX = "exitpoint_" - val FRESH_CHOICEPOINT_NAME_PREFIX = "c" - val FRESH_JUNCTIONPOINT_NAME_PREFIX = "j" - var FRESH_TRANSITION_NAME_PREFIX = "transition_" - - var freshNameCounter = 0 - var freshEntryPointNameCounter = 0 - var freshExitPointNameCounter = 0 - var freshChoicePointNameCounter = 0 - var freshJunctionPointNameCounter = 0 - var freshTransitionNameCounter = 0 - - var Behavior saveHistoryBehavior = null - var Class clazz - - /** - * Flattens a UML-RT state machine, removing composite states, and making - * explicit transitions implied by group transitions, history points and - * initial points. - * - * This is the 'main' method of the transformer. It performs the - * transformation in-place. - * - * @param m a {@link StateMachine} - * @return the flat {@link StateMachine} m with all composite states, group - * transitions, history and initial pseudo-states removed. - */ - def StateMachine transform(StateMachine m) { - var StateMachine intermediateModel - clazz = m.owner as Class - UMLChain.initChains - phase0QualifyNames(m.region, m.name) - phase1(m) - intermediateModel = phase2(m) - return intermediateModel - } - - /** - * Change the names of states and transitions: prefix them with the names - * of the stateMachine and composite states. - */ - protected def void phase0QualifyNames(Region region, String parentName) { - for (Transition transition : region.transitions) { - transition.name = parentName + '_' + transition.name - } - for (Vertex vertex : region.subvertices) { - vertex.name = parentName + '_' + vertex.name - if (vertex instanceof State) { - val State state = vertex as State - for (subRegion : state.regions) { - phase0QualifyNames(subRegion, vertex.name) - } - } - } - } - - - /** - * Makes explicit transitions implied by group transitions, history points - * and initial points. - */ - protected def StateMachine phase1(StateMachine m) { - for (State s : m.states) { - phase1ProcessState(s) - } - return m - } - - def void phase1ProcessState(State state) { - phase1ProcessSimpleState(state) - if (!state.regions.empty) { - phase1ProcessCompositeState(state) - } - } - - /** - * Moves a simple state's entry actions to its incoming transitions and - * the state's exit actions to its outgoing transitions. - * - */ - def void phase1ProcessSimpleState(State state) { - // TODO: should that be done in UML2FlatBody (need chain?) - if (state.entry != null) { - val entryOp = clazz.createOperation(entryFctName(state), null); - state.entry.name = entryFctName(state) - // add specification - state.entry.specification = entryOp; - // clazz.ownedBehaviors.add(state.entry) - for (Transition t : state.incomings) { - t.chain.append(state.entry) - } - } - if (state.exit != null) { - val exitOp = clazz.createOperation(exitFctName(state), null); - state.exit.name = exitFctName(state) - // add specification - state.exit.specification = exitOp; - // clazz.ownedBehaviors.add(state.exit) - for (Transition t : state.allOutgoings) { - t.chain.prepend(state.exit) - } - } - } - - def entryFctName(State state) { - GlobalConstants.ENTRY_ACTION_FUNC_PREFIX + GlobalConstants.FUNC_NAME_QUAL_NAME_SEP + state.name + GlobalConstants.FUNC_NAME_QUAL_NAME_SEP + state.entry.name - } - - def exitFctName(State state) { - GlobalConstants.EXIT_ACTION_FUNC_PREFIX + GlobalConstants.FUNC_NAME_QUAL_NAME_SEP + state.name + GlobalConstants.FUNC_NAME_QUAL_NAME_SEP + state.exit.name - } - - /** - * Creates entry transitions for incoming arrows ending at the composite - * state's boundary or history pseudo-state. Creates exit transitions - * implied by group transitions. - */ - def void phase1ProcessCompositeState(State state) { - - // if (state.substates.empty) { - // replaceBySimpleState(state) - // return - // } - // Deal with incoming transitions - // TODO (ar): such a state can have entry and exit as well, no? - annotateExplicitEntryTransitions(state) - createEntryPoints(state) - var historyChoicePoint = replaceHistoryPoint(state) - removeInitialTransition(state, historyChoicePoint) - - // Deal with outgoing transitions - annotateExplicitExitTransitions(state) - createExitPoints(state) - createExitTransitions(state) - - // Process sub-states - for (State subState : state.subStates) { - phase1ProcessState(subState) - } - } - - /** - * Prepends the state's entry action to each explicit entry transition - * (transition from an entry point to a sub-state). - */ - def annotateExplicitEntryTransitions(State state) { - for (Pseudostate p : state.entryPoints) { - if (!p.outgoings.empty) { - for (Transition t : p.outgoings) { - t.chain.append(state.entry) - } - } - } - } - - /** - * Creates entry points for every direct incoming transition (transition - * ending directly on the state's boundary). - */ - def createEntryPoints(State state) { - for (Transition t : state.incomings) { - val p = state.createConnectionPoint(state.newFreshEntryPointName) - p.kind = PseudostateKind.ENTRY_POINT_LITERAL - t.target = p - } //TODO: maybe remove all directIncomming? - } - - /** - * Replaces the (deep)history pseudo-state with a choice point with transitions - * to each sub-state with conditions checking the value of the history table - * entry for this composite-state. - */ - def Pseudostate replaceHistoryPoint(State state) { - - // transform history state into a choice point - val c = state.region.deepHistory; - - if (c != null) { - // No need to redirect incoming transitions, since we transform the history - // state with a choice point - c.kind = PseudostateKind.CHOICE_LITERAL; - } - else { - return null; - } - - // Create transitions from the choice point to each sub-state with the - // appropriate guard. - for (State subState : state.subStates) { - var Vertex targetVertex - if (subState.regions.size() == 0) { - targetVertex = subState - } - else { - targetVertex = subState.region.deepHistory - if (targetVertex == null) { - targetVertex = subState - } - } - - val newTransition = state.region.createTransition(state.newFreshTransitionName) - newTransition.source = c; - newTransition.target = targetVertex; - val guard = newTransition.createGuard("CheckHistory"); - guard.createOpaqueExpression('''history[«state.name»] == «subState.name»''') - if (state.entry != null) { - newTransition.chain.append(state.entry) - } - } - // If there was an initial pseudo-state, create a transition from the - // choice point to the initial state where the guard will be true if - // the composite state has not been visited before. - val initialState = state.region.initialState - if (initialState != null) { - val initialTransition = initialState.outgoings.get(0) - - val newTransition = state.region.createTransition(state.newFreshTransitionName) - newTransition.source = c; - newTransition.target = initialTransition.target; - val guard = newTransition.createGuard("CheckHistory"); - guard.createOpaqueExpression('''history[«state.name»] == «GlobalConstants.UNVISITED»''') - // TODO: not sure, if semantics is the same. - if (initialTransition.effect != null) { - // caveat: assigining the effect to the new transition will remove it from the original - // (initial will be removed later on => not a problem?) - newTransition.effect = initialTransition.effect; - newTransition.chain.append(newTransition.effect) - } - newTransition.chain.append(state.entry) - } - // If there was no initial pseudo-state, create a 'dummy' simple state - // representing "staying at the boundary", and create a transition from - // the choice point to this dummy state, where the guard is true if - // the state has not been visited before. - else { - // The name should be different name because one of the sub-states - // may have the same name as the composite. - val border = state.region.createState(state.newFreshName); - - val newTransition = state.region.createTransition(state.newFreshTransitionName); - newTransition.source = c; - newTransition.target = border; - val guard = newTransition.createGuard("Check History") - guard.createOpaqueExpression('''history[«state.name»] == «GlobalConstants.UNVISITED»''') - if (state.entry != null) { - newTransition.chain.append(state.entry) - } - } - return c - } - - /** - * Remove the initial pseudo-state and transition and create a transition - * from each entry point which does not have an explicit entry transition - * to a sub-state, to the initial state. - */ - def removeInitialTransition(State state, Pseudostate historyChoicePoint) { - val initialState = state.region.initialState - if (initialState != null) { - val initialTransition = initialState.outgoings.get(0) // There should be exactly one initial transition - for (Pseudostate p : state.entryPoints) { - if (p.outgoings.empty) { - val newTransition = - state.region.createTransition(state.newFreshTransitionName) - newTransition.source = p - newTransition.target = initialTransition.target - newTransition.chain.append(state.entry) - newTransition.chain.append(initialTransition.effect); - } - } - state.region.transitions.remove(initialTransition) - // initialTransition.targetVertex.incomingTransitions.remove(initialTransition) // TODO: this might not be enough if the initial transition ends in a pseudo-state - // state.removeInitial - } - else { - for (Pseudostate p : state.entryPoints) { - if (p.outgoings.empty) { - val newTransition = - state.region.createTransition(state.newFreshTransitionName) - newTransition.setSource(p) - newTransition.setTarget(historyChoicePoint) - newTransition.effect = state.entry; - } - } - } - } - - /** - * Annotate explicit exit transitions (transitions from a sub-state to an - * exit point) with a "history saving action", an action that sets the - * history table entry for the composite state according to the sub-state - * that is exited. - */ - def annotateExplicitExitTransitions(State state) { - for (Pseudostate p : state.exitPoints) { - if (!p.incomings.empty) { - for (Transition t : p.incomings) { - if (saveHistoryBehavior == null) { - createSaveHistoryBehavior - } - // Actions can have specific subclasses in the Zeligsoft model. Here we use a single generic class. - // Therefore we add call information explicitly. - val UMLAction saveHistoryAction = new UMLAction(saveHistoryBehavior) - saveHistoryAction.addParam = state.name - saveHistoryAction.addParam = t.source.name - t.chain.append = saveHistoryAction - if (state.exit != null) { - t.chain.append(state.exit) - } - } - } - } - } - - /** - * Create exit points for each direct outgoing transition (transition leaving - * directly from the composite state's boundary). - */ - def createExitPoints(State state) { - for (Transition t : state.outgoings) { - val p = state.createConnectionPoint(state.newFreshExitPointName); - p.kind = PseudostateKind.EXIT_POINT_LITERAL - t.source = p; - } - } - - def createSaveHistoryBehavior() { - // create an opaque behavior without body. This will be added later in the UMLFlat2Cpp operation - saveHistoryBehavior = clazz.createOwnedBehavior(GlobalConstants.SAVE_HISTORY_FUNC_NAME, - UMLPackage.eINSTANCE.getOpaqueBehavior() - ); - } - - /** - * Create explicit exit transitions implied by group transitions. For each - * group transition creates a transition from every sub-state to the - * group-transitions's source exit point. It annotates these transitions - * with a "history saving action", an action which stores the sub-state - * in the history table entry for this composite state. - */ - def createExitTransitions(State state) { - - // Iterate over exit points, looking for group transitions. - for (Pseudostate p : state.exitPoints) { - - // If the exit point doesn't have incoming transitions then there - // is at least one group transition from it. - if (p.incomings.empty) { - - // Create explicit transitions from every sub-state to this - // exit point... - for (State subState : state.subStates) { - - // ...for each group transition leaving the exit point. - for (Transition t : p.outgoings) { - - if (saveHistoryBehavior == null) { - createSaveHistoryBehavior - } - // Append the history saving action and the state's - // exit action. - val newTransition = state.region.createTransition(state.newFreshTransitionName) - newTransition.source = subState - newTransition.target = p - // make a copy (adding it to triggers list would remove it from original transition). - for (trigger : t.triggers) { - val newTrigger = newTransition.createTrigger(trigger.name) - newTrigger.event = trigger.event - } - // newTransition.triggers.addAll(t.triggers) - newTransition.guard = t.guard - val UMLAction saveHistoryAction = new UMLAction(saveHistoryBehavior) - saveHistoryAction.addParam = state.name - saveHistoryAction.addParam = subState.name - newTransition.chain.append(saveHistoryAction) - newTransition.chain.append(state.exit) - // make a copy of the effect (but: quite bad, since we might create several copies of same effect) - if (t.effect instanceof OpaqueBehavior) { - val newBehavior = newTransition.createOpaqueEffect - newBehavior.name = t.effect.name - newBehavior.set = t.effect.body - } - } - } - - // Remove the trigger and guard from the old group transition, - // but leave the transition. - // TODO: we must replace the direct group transition with an indirect group transition leaving from the exit point - for (Transition t : p.outgoings) { - t.triggers.clear - t.guard = null - t.effect = null - } - } - } - } - - /** - * Flatten composite states. - */ - protected def StateMachine phase2(StateMachine m) { - for (State s : m.states.clone) { - phase2ProcessState(s) - if (!s.subStates.empty) { - m.region.moveContents(s) - // remove regions from composite state - s.regions.clear - } - } - return m - } - - /** - * Removes entry and exit points of a simple state, making all transitions - * to and from it, direct. - */ - def dispatch void phase2ProcessState(State state) { - if (state.regions.empty) { - phase2ProcessSimpleState(state) - } - else { - phase2ProcessComplexState(state) - } - // change name afterwards (avoid that new names are taken into account recursively) - } - - /** - * Removes entry and exit points of a simple state, making all transitions - * to and from it, direct. - */ - def dispatch void phase2ProcessSimpleState(State state) { - for (Transition t : state.indirectIncomings) { - t.target = state // TODO: Potential problem: depending on the set implementation we may be modifying the iterator - } - for (Transition t : state.outgoings) { - t.source = state - } - for (Pseudostate p : state.entryPoints) { - state.connectionPoints.remove(p) - } - for (Pseudostate p : state.exitPoints) { - state.connectionPoints.remove(p) - } - } - - /** - * Replaces all entry and exit points of the composite state with junction - * points, and recursively apply this to sub-states. - */ - def dispatch void phase2ProcessComplexState(State state) { - // Replace connection points with junction points - for (Pseudostate p : state.connectionPoints.clone) { - var j = state.region.createPseudostate(GlobalConstants.JUNCTION_FUNC_PREFIX + p.name) - j.kind = PseudostateKind.JUNCTION_LITERAL - - for (Transition t : p.incomings) { - t.target = j - } - for (Transition t : p.outgoings) { - t.source = j - } - if (p.kind == PseudostateKind.ENTRY_POINT_LITERAL) { - state.connectionPoints.remove(p) - } - else if (p.kind == PseudostateKind.EXIT_POINT_LITERAL) { - state.connectionPoints.remove(p) - } - } - - // Process substates - for (State subState : state.subStates.clone) { - phase2ProcessState(subState) - if (!subState.regions.empty) { - state.region.moveContents(subState) - subState.regions.clear - } - } - } - - /** - * Auxiliary methods - */ - def String getNewFreshName(NamedElement parent) { - freshNameCounter ++ - return parent.namePrefix + FRESH_NAME_PREFIX + freshNameCounter - } - - def String getNewFreshEntryPointName(NamedElement parent) { - freshEntryPointNameCounter ++ - return parent.namePrefix + FRESH_ENTRYPOINT_NAME_PREFIX + freshEntryPointNameCounter - } - - def String getNewFreshExitPointName(NamedElement parent) { - freshExitPointNameCounter ++ - return parent.namePrefix + FRESH_EXITPOINT_NAME_PREFIX + freshExitPointNameCounter - } - - def String getNewFreshChoicePointName(NamedElement parent) { - freshChoicePointNameCounter ++ - return parent.namePrefix + FRESH_CHOICEPOINT_NAME_PREFIX + freshChoicePointNameCounter - } - - def String getNewFreshJunctionPointName(NamedElement parent) { - freshJunctionPointNameCounter ++ - return parent.namePrefix + FRESH_JUNCTIONPOINT_NAME_PREFIX + freshJunctionPointNameCounter - } - - def String getNewFreshTransitionName(NamedElement parent) { - freshTransitionNameCounter ++ - return parent.namePrefix + FRESH_TRANSITION_NAME_PREFIX + freshTransitionNameCounter - } - - def namePrefix(NamedElement ne) { - return ne.name + "_" - } -} diff --git a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/xtend-gen/.gitignore b/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/xtend-gen/.gitignore deleted file mode 100644 index c96a04f008e..00000000000 --- a/extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.classpath b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.classpath deleted file mode 100644 index 098194ca4b7..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.project b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.project deleted file mode 100644 index 07350fea43f..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.infra.services.tracepoints - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f42de363afa..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/META-INF/MANIFEST.MF deleted file mode 100644 index 36e9fe9b7ba..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/META-INF/MANIFEST.MF +++ /dev/null @@ -1,30 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.emf;bundle-version="2.6.0", - org.eclipse.emf.ecore;bundle-version="2.6.1", - org.eclipse.core.resources;bundle-version="3.6.0", - org.apache.commons.lang;bundle-version="2.3.0", - org.eclipse.emf.edit.ui;bundle-version="2.6.0", - org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.0.100", - org.eclipse.papyrus.infra.core;bundle-version="1.2.0", - org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0", - org.eclipse.papyrus.infra.services.decoration;bundle-version="1.2.0", - org.eclipse.uml2.uml;bundle-version="4.0.0", - org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", - org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", - org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.2.0", - org.eclipse.papyrus.infra.services.markerlistener;bundle-version="1.2.0" -Export-Package: org.eclipse.papyrus.infra.services.tracepoints, - org.eclipse.papyrus.infra.services.tracepoints.commands, - org.eclipse.papyrus.infra.services.tracepoints.dialogs, - org.eclipse.papyrus.infra.services.tracepoints.preferences -Bundle-Vendor: %pluginProvider -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-ManifestVersion: 2 -Bundle-Activator: org.eclipse.papyrus.infra.services.tracepoints.Activator -Bundle-SymbolicName: org.eclipse.papyrus.infra.services.tracepoints;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/about.html b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

    About This Content

    - -

    November 14, 2008

    -

    License

    - -

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

    - -

    If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

    - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/build.properties b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/build.properties deleted file mode 100644 index 8e1f07ccf86..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/build.properties +++ /dev/null @@ -1,13 +0,0 @@ -# -#Mon Sep 12 09:30:24 CEST 2011 -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - plugin.xml,\ - icons/,\ - schema/ -output..=bin/ -src.includes = about.html -source..=src/ -bin..=bin/ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_16x16.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_16x16.gif deleted file mode 100644 index a831fe72782..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_16x16.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_9x9.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_9x9.gif deleted file mode 100644 index 3678b09c6bf..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_9x9.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp.gif deleted file mode 100644 index 173661c5df7..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp_disabled.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp_disabled.gif deleted file mode 100644 index 5ea466bcb2a..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp_disabled.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_16x16.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_16x16.gif deleted file mode 100644 index 74b26c31a4d..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_16x16.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_9x9.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_9x9.gif deleted file mode 100644 index d6d8d31b06f..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_9x9.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/debug.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/debug.gif deleted file mode 100644 index d90a29fead8..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/debug.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/properties.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/properties.gif deleted file mode 100644 index 1dc19a31a0f..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/properties.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_11x12.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_11x12.gif deleted file mode 100644 index c04edf8e83e..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_11x12.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_16x16.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_16x16.gif deleted file mode 100644 index 29ec606076f..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_16x16.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_11x12.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_11x12.gif deleted file mode 100644 index f3e7b3d6791..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_11x12.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_16x16.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_16x16.gif deleted file mode 100644 index 76c65b6196f..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_16x16.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.properties b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.properties deleted file mode 100644 index 3cabfa42274..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2010 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus Tracepoint Integration (Incubation) -pluginProvider=Eclipse Modeling Project diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.xml b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.xml deleted file mode 100644 index 80dceda93de..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/pom.xml b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/pom.xml deleted file mode 100644 index 543d8bee3aa..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../../releng/extra - - org.eclipse.papyrus.infra.services.tracepoints - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/schema/traceMechanism.exsd b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/schema/traceMechanism.exsd deleted file mode 100644 index ba8ed1aca6d..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/schema/traceMechanism.exsd +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - Possibility to add implementations of a trace mechanism - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Activator.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Activator.java deleted file mode 100644 index 8054e407ef6..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Activator.java +++ /dev/null @@ -1,90 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints; - -import org.eclipse.papyrus.infra.core.log.LogHelper; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -// TODO: Auto-generated Javadoc -/** - * The activator class controls the plug-in life cycle. - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - /** The Constant PLUGIN_ID. */ - public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.services.tracepoints"; //$NON-NLS-1$ - - // The shared instance - /** The plugin. */ - private static Activator plugin; - - /** The log service. */ - public static LogHelper log; - - /** - * The constructor. - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - * - * @param context - * @throws Exception - */ - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - log = new LogHelper(plugin); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - * - * @param context - * @throws Exception - */ - - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - log = null; - super.stop(context); - } - - /** - * Returns the shared instance. - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/ITraceMechanism.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/ITraceMechanism.java deleted file mode 100644 index 17ef8dd24f1..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/ITraceMechanism.java +++ /dev/null @@ -1,74 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; - - -/** - * The trace mechanism itself is not specific for specific implementations such - * as instrumenting code generators. Thus, the following interface may be defined - * by extensions that provide an implementation of a trace point. - * The first operation gets a set of available trace implementations that are supplied - * by the extension (in conjunction with other mechanisms). - * This interface is used for mechanisms that have a way of implementing trace point - * - * @author ansgar - * - */ -public interface ITraceMechanism { - - /** - * @param eObj - * the element on which tracing is applied. It is passed, since the - * list of available trace mechanisms may depend on this object - * @return a list of IDs corresponding to available trace mechanisms - */ - EList getTraceMechanismIDs(EObject eObj); - - /** - * Provide a description of the trace mechanism - * - * @param id - * the id of the trace mechanism - * @return its description - */ - String getTraceMechanismDescription(EObject eObj, String id); - - /** - * Apply the tracing. This usually means that an implementation specific - * mechanism will add additional information to the EObject, for instance - * in form of additional markings or stereotypes (there is no assumption - * how this is actually done). The idea is that these markings will be - * evaluated during code generation to produce the right result. - * - * @param id - * the ID of a trace mechanism - * @param element - * the element that should be trace - * @param traceOption - * an encoded trace option. e.g. that only the called operation - * should be trace and not the values of the passed parameters. - */ - boolean applyTraceMechanism(EObject eObj, String id, int traceOption); - - /** - * Configure the trace mechanisms for runtime, in particular evaluate activate/inactive - * tracepoint settings to obtain a suitable runtime configuration. - * - * @return - */ - boolean configureTraceMechanisms(); -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/MarkerUtils.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/MarkerUtils.java deleted file mode 100644 index a96b35d64f2..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/MarkerUtils.java +++ /dev/null @@ -1,84 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.services.tracepoints; - -import java.util.MissingResourceException; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; -import org.eclipse.papyrus.infra.core.markers.MarkerConstants; - -/** - * Utilities for Markers (TODO: some of these are generic marker services (move to infra core markers) and not specific to tracepoints). - * - * @author ansgar - * - */ -public class MarkerUtils { - - public static URI getURI(IMarker marker) { - String uriOfMarkerStr = marker.getAttribute(MarkerConstants.uri, null); - if (uriOfMarkerStr != null) { - return URI.createURI(uriOfMarkerStr); - } - return null; - } - - /** - * return the EObject of a marker (provided that it is a marker with a URI) - * - * @param marker - * @return the associated EObject - */ - public static EObject getEObjectOfMarker(IMarker marker) { - return getEObjectOfMarker(resourceSet, marker); - } - - /** - * return the EObject of a marker (provided that it is a marker with a URI) - * - * @param pResourceSet - * : the resourceSet into which the model associated with the eObject should - * be loaded - * @param marker - * @return the associated EObject - */ - public static EObject getEObjectOfMarker(ResourceSet pResourceSet, IMarker marker) { - URI uriOfMarker = getURI(marker); - if (uriOfMarker != null) { - try { - pResourceSet.getResource(uriOfMarker.trimFragment(), true); - return pResourceSet.getEObject(uriOfMarker, true); - } catch (MissingResourceException e) { - throw new RuntimeException("MarkerUtils.getEObjectOfMarker: " + e.getMessage()); //$NON-NLS-1$ - } - } - return null; - } - - public static boolean isActive(IMarker marker) { - return marker.getAttribute(TracepointConstants.isActive, false); - } - - /** - * our own copy of resource set - * we do not use the Papyrus resourceSet, since every editor keeps his own copy of the resource set (which is probably - * quite bad) and thus no resourceSet would be available, if Papyrus is not open. - */ - public static ResourceSet resourceSet = new ResourceSetImpl(); -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Messages.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Messages.java deleted file mode 100644 index 3db820e80cb..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Messages.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.eclipse.papyrus.infra.services.tracepoints; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.papyrus.infra.services.tracepoints.messages"; //$NON-NLS-1$ - - public static String TraceActionSelection_ClassOptions; - public static String TraceActionSelection_ImplementationOptions; - public static String TraceActionSelection_NoPluginsProvideTraceExt; - public static String TraceActionSelection_NotAvail; - public static String TraceActionSelection_OperationOptions; - public static String TraceActionSelection_SelectTraceAction; - public static String TraceActionSelection_StateOptions; - - public static String TPPreferencePage_ClassOptions; - public static String TPPreferencePage_OperationOptions; - public static String TPPreferencePage_StateOptions; - public static String TPPreferencePage_TMforOperations; - public static String TPPreferencePage_TMforPorts; - public static String TPPreferencePage_TMforStateMachines; - public static String TPPreferencePage_TraceOptions; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceActions.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceActions.java deleted file mode 100644 index 9935817b45b..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceActions.java +++ /dev/null @@ -1,206 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.infra.services.tracepoints.preferences.TPPreferenceConstants; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.State; - -/** - * Set of enumerations that indicates what we want to trace. - * - * @author ansgar - * - */ -public class TraceActions { - - public enum TraceScope { - clazz, - operation, - state, - activity, - }; - - /** - * Options for tracing a class. Note that some options need additional information, e.g. "all operations" - * needs additional information how operations are traced - */ - public enum TAClass { - Creation, - Destruction, - AllOperations, - AllPorts, - AllStates - // +(?) all properties/all operations - // +(all ports?) - // +all state changes? (hierarchical propagation?) - - }; - - /** - * Different ways to trace operations: put only the call itself or the values of the parameters into - * a trace event. - */ - public enum TAOperation { - OnlyCall, - ParameterValues, // here exclusive (parameter values and OnlyCall may not be selected at the same time) - }; - - /** - * Not used for the moment - */ - public enum TAAttribute { - PropertyRead, - PropertyWrite; // write old and new value - }; - - /** - * Options to trace state - */ - public enum TAState { - StateEnter, // add incoming transition to trace? - StateLeave, // add outgoing transition to trace? - Transition // nothing (?) (triggers are known? - no, could be one out of many triggers) - }; - - /** - * Not used for the moment - */ - public enum TAActivity { - activity // (i.e. call operation action) explicit choice of (named attribute?) - }; - - public static String[][] getStringFields(Enum[] enumValues) { - int i = 0; - String[][] taOptions = new String[enumValues.length][2]; - for (Enum tLiteral : enumValues) { - taOptions[i][1] = tLiteral.name(); - taOptions[i][0] = tLiteral.name(); - i++; - } - return taOptions; - } - - public enum TraceFeature { - Class, - Port, - State, - Operation - }; - - /** - * Obtain the definition of a trace option in case of traces on classes - * - * @param traceAction - * @param subFeature - * the trace feature which we want to obtain, i.e. class, state or operation - * from a composite action string in case of class trace points - * @return - */ - public static String getOptions(String traceAction, TraceFeature subFeature) { - String prefix = getStringPrefix(subFeature); - int pos = traceAction.indexOf(prefix); - if (pos == -1) { - return null; - } else { - // comma is used as separation character. - pos += prefix.length(); - int endPos = traceAction.indexOf(',', pos); - if (endPos == -1) { - return traceAction.substring(pos); - } - return traceAction.substring(pos, endPos); - } - } - - /** - * Get the prefix that is used in each case of a class action to distinguish class, state and operation actions. - * - * @param feature - * The trace feature for which we set an action - * @return - */ - public static String getStringPrefix(TraceFeature feature) { - if (feature == TraceFeature.Class) { - return "C:"; //$NON-NLS-1$ - } - if (feature == TraceFeature.Port) { - return "P:"; //$NON-NLS-1$ - } - else if (feature == TraceFeature.State) { - return "S:"; //$NON-NLS-1$ - } - else if (feature == TraceFeature.Operation) { - return "O:"; //$NON-NLS-1$ - } - return null; - } - - /** - * Initialize an action string that will be stored in the trace marker from the configured actions - * in the preferences. In case of a class, the value is a combination of different options - * that are prefixed to enable a unique classification - * - * @param feature - * The trace feature for which we set an action - * @return - */ - public static String actionFromPreferences(TraceFeature feature) { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - if (feature == TraceFeature.Class) { - return compositeClassOption(store.getInt(TPPreferenceConstants.P_TRACE_OPTION_CLASS), - store.getInt(TPPreferenceConstants.P_TRACE_OPTION_STATE), - store.getInt(TPPreferenceConstants.P_TRACE_OPTION_OP)); - } - else if (feature == TraceFeature.State) { - return store.getString(TPPreferenceConstants.P_TRACE_OPTION_STATE); - } - else if (feature == TraceFeature.Operation) { - return store.getString(TPPreferenceConstants.P_TRACE_OPTION_OP); - } - return ""; //$NON-NLS-1$ - } - - public static String compositeClassOption(int classOption, int stateOption, int operationOption) { - return getStringPrefix(TraceFeature.Class) + classOption + "," + //$NON-NLS-1$ - getStringPrefix(TraceFeature.State) + stateOption + "," + //$NON-NLS-1$ - getStringPrefix(TraceFeature.Operation) + operationOption; - } - - /** - * Convenience function, return the action defined in the preferences in function of the model element - * - * @param element - * @return - */ - public static String actionFromPreferences(EObject element) { - return actionFromPreferences(getTraceFeature(element)); - } - - - public static TraceFeature getTraceFeature(EObject element) { - if (element instanceof State) { - return TraceFeature.State; - } - else if (element instanceof Operation) { - return TraceFeature.Operation; - } - else if (element instanceof org.eclipse.uml2.uml.Class) { - return TraceFeature.Class; - } - return null; - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceFunctions.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceFunctions.java deleted file mode 100644 index a0a62b30f80..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceFunctions.java +++ /dev/null @@ -1,125 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.papyrus.infra.services.decoration.IDecorationSpecificFunctions; -import org.eclipse.papyrus.infra.services.decoration.util.Decoration.PreferedPosition; -import org.eclipse.papyrus.infra.services.decoration.util.IPapyrusDecoration; -import org.eclipse.papyrus.infra.services.markerlistener.IPapyrusMarker; - - -public class TraceFunctions implements IDecorationSpecificFunctions { - - public static final String activeBreakpoint16 = "icons/etool16/brkp_16x16.gif"; //$NON-NLS-1$ - - public static final String inActiveBreakpoint16 = "icons/etool16/brkpd_16x16.gif"; //$NON-NLS-1$ - - public static final String activeTracepoint16 = "icons/etool16/trcp_16x16.gif"; //$NON-NLS-1$ - - public static final String inActiveTracepoint16 = "icons/etool16/trcpd_16x16.gif"; //$NON-NLS-1$ - - public static final String activeBreakpoint9 = "icons/etool16/brkp_9x9.gif"; //$NON-NLS-1$ - - public static final String inActiveBreakpoint9 = "icons/etool16/brkpd_9x9.gif"; //$NON-NLS-1$ - - public static final String activeTracepoint11 = "icons/etool16/trcp_11x12.gif"; //$NON-NLS-1$ - - public static final String inActiveTracepoint11 = "icons/etool16/trcp_11x12.gif"; //$NON-NLS-1$ - - /** - * Return the image descriptor associated with a trace or breakpoint marker - */ - @Override - public ImageDescriptor getImageDescriptorForGE(IPapyrusMarker marker) { - - - org.eclipse.papyrus.infra.widgets.Activator widgetsActivator = - org.eclipse.papyrus.infra.widgets.Activator.getDefault(); - ImageDescriptor overlay = null; - boolean isActive = marker.getAttribute(TracepointConstants.isActive, false); - boolean isTracepoint = marker.getAttribute(TracepointConstants.isTracepoint, false); - if (isTracepoint) { - overlay = isActive ? - widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, activeTracepoint16) : - widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, inActiveTracepoint16); - } - else { - overlay = isActive ? - widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, activeBreakpoint16) : - widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, inActiveBreakpoint16); - } - - return overlay; - } - - /** - * Return the image descriptor associated with a trace or breakpoint marker - */ - @Override - public ImageDescriptor getImageDescriptorForME(IPapyrusMarker marker) { - org.eclipse.papyrus.infra.widgets.Activator widgetsActivator = - org.eclipse.papyrus.infra.widgets.Activator.getDefault(); - ImageDescriptor overlay = null; - boolean isActive = marker.getAttribute(TracepointConstants.isActive, false); - boolean isTracepoint = marker.getAttribute(TracepointConstants.isTracepoint, false); - if (isTracepoint) { - overlay = isActive ? - widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, activeTracepoint11) : - widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, inActiveTracepoint11); - } - else { - overlay = isActive ? - widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, activeBreakpoint9) : - widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, inActiveBreakpoint9); - } - - return overlay; - } - - @Override - public PreferedPosition getPreferedPosition(IPapyrusMarker marker) { - return PreferedPosition.SOUTH_EAST; - } - - @Override - public String getMessage(IPapyrusMarker marker) { - boolean isActive = marker.getAttribute(TracepointConstants.isActive, false); - boolean isTracepoint = marker.getAttribute(TracepointConstants.isTracepoint, false); - return (isActive ? "active" : "inactive") + " " + //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ - (isTracepoint ? "trace point" : "break point"); //$NON-NLS-1$//$NON-NLS-2$ - } - - public int getPriority(IMarker marker) { - return 0; // all markers have same priority (and we should not have multiple markers on the same model element). - } - - @Override - public IPapyrusDecoration markerPropagation(EList childDecorations) { - return null; - } - - @Override - public MarkChildren supportsMarkerPropagation() { - return MarkChildren.NO; - } - - @Override - public int getPriority(IPapyrusMarker marker) { - // TODO Auto-generated method stub - return 0; - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceMechanism.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceMechanism.java deleted file mode 100644 index 3d64bbdc4bb..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceMechanism.java +++ /dev/null @@ -1,88 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TraceFeature; -import org.eclipse.papyrus.infra.services.tracepoints.preferences.TPPreferenceConstants; - - -/** - * Support for multiple trace mechanisms via the Eclipse extension mechanism - */ - -public class TraceMechanism { - - public static final String ITRACE_MECHANISM_ID = Activator.PLUGIN_ID + ".traceMechanism"; //$NON-NLS-1$ - - public static EList getTraceMechanisms() - { - EList mechanisms = new BasicEList(); - IExtensionRegistry reg = Platform.getExtensionRegistry(); - IConfigurationElement[] configElements = reg.getConfigurationElementsFor(ITRACE_MECHANISM_ID); - for (IConfigurationElement configElement : configElements) { - try { - // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) - final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ - if (obj instanceof ITraceMechanism) { - mechanisms.add((ITraceMechanism) obj); - } - } catch (CoreException exception) { - exception.printStackTrace(); - } - } - return mechanisms; - } - - /** - * get the ID of the default realization mechanism. In case of classes, need to store multiple mechanisms (how to trace states, how to trace - * operations) - * - * @return - */ - public static String getMechanismFromPreferences(TraceFeature feature) { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - if (store != null) { - if (feature == TraceFeature.Class) { - return TraceActions.getStringPrefix(TraceFeature.Port) + store.getInt(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_PORT) + "," + //$NON-NLS-1$ - TraceActions.getStringPrefix(TraceFeature.State) + store.getInt(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM) + "," + //$NON-NLS-1$ - TraceActions.getStringPrefix(TraceFeature.Operation) + store.getInt(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP); - } - else if (feature == TraceFeature.State) { - return store.getString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM); - } - else if (feature == TraceFeature.Operation) { - return store.getString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP); - } - } - return ""; //$NON-NLS-1$ - } - - /** - * Convenience function. Return defaultTraceMechanisms in function of the element being traced. - * - * @param element - * @return - */ - public static String getDefaultMechanism(EObject element) { - return getMechanismFromPreferences(TraceActions.getTraceFeature(element)); - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceState.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceState.java deleted file mode 100644 index f6e98d06d71..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceState.java +++ /dev/null @@ -1,20 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints; - - -public class TraceState { - - public static boolean skipAllTracepoints = false; -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TracepointConstants.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TracepointConstants.java deleted file mode 100644 index 2246147467b..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TracepointConstants.java +++ /dev/null @@ -1,35 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints; - - - -public class TracepointConstants { - - /** - * The id of the marker used for tracepoints and breakpoints - */ - public static final String tpOrbpMarker = "org.eclipse.papyrus.tporbpmarker"; //$NON-NLS-1$ - - public static final String isActive = "isActive"; //$NON-NLS-1$ - - /** - * if true, marker is a tracepoint. Otherwise it is a breakpoint. - */ - public static final String isTracepoint = "isTracepoint"; //$NON-NLS-1$ - - public static final String traceAction = "traceAction"; //$NON-NLS-1$ - - public static final String traceMechanism = "traceMechanism"; //$NON-NLS-1$ -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/AbstractTracepointCommand.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/AbstractTracepointCommand.java deleted file mode 100644 index aaece766bed..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/AbstractTracepointCommand.java +++ /dev/null @@ -1,167 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermarcher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints.commands; - -import java.util.Collections; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; -import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.infra.core.markers.MarkerConstants; -import org.eclipse.papyrus.infra.services.tracepoints.Activator; -import org.eclipse.papyrus.infra.services.tracepoints.ITraceMechanism; -import org.eclipse.papyrus.infra.services.tracepoints.TraceMechanism; -import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; -import org.eclipse.papyrus.infra.services.tracepoints.preferences.TPPreferenceConstants; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.State; - -/** - * Action used for pasting either a model element or a shape (i.e. the model element represented - * by the shape). Delegates to PasteShapeOrElementCommand - * - * @author Ansgar Radermacher (CEA LIST) - */ -abstract public class AbstractTracepointCommand extends AbstractTransactionalCommand { - - protected TransactionalEditingDomain domain; - - protected EObject selectedElement; - - /** - * Creates a new ImportLibraryFromRepositoryCommand - * - * @param editingDomain - * editing domain that manages the changed objects - * @param runnable - * process that executes the modifications - * @param label - * the label of the command - * @param description - * description of the command - */ - - public AbstractTracepointCommand(String label, TransactionalEditingDomain domain, EObject selectedElement) { - super(domain, label, Collections.EMPTY_LIST); - this.domain = domain; - this.selectedElement = selectedElement; - } - - protected void updateResourceAndURI() { - resource = selectedElement.eResource(); - uri = resource.getURI() + "#" + resource.getURIFragment(selectedElement); //$NON-NLS-1$ - iresource = WorkspaceSynchronizer.getFile(selectedElement.eResource()); - } - - protected IMarker findMarker(String type) { - - if (iresource != null) { - try { - for (IMarker marker : iresource.findMarkers(type, false, IResource.DEPTH_INFINITE)) { - String markerURI = marker.getAttribute(MarkerConstants.uri, ""); //$NON-NLS-1$ - if ((markerURI != null) && markerURI.equals(uri)) { - return marker; - } - } - } catch (CoreException ce) { - } - } - return null; - } - - protected IMarker toggleMarker() { - try { - if (iresource != null) { - IMarker marker = findMarker(TracepointConstants.tpOrbpMarker); - if (marker == null) { // marker does not exist => create - marker = iresource.createMarker(TracepointConstants.tpOrbpMarker); - marker.setAttribute(MarkerConstants.uri, uri); - marker.setAttribute(TracepointConstants.isActive, true); - return marker; - } - else { - // marker exists => delete - marker.delete(); - } - } - } catch (CoreException ce) { - } - return null; - } - - protected void toggleMarkerActivation() { - try { - if (iresource != null) { - IMarker marker = findMarker(TracepointConstants.tpOrbpMarker); - if (marker == null) { // marker does not exist => create - marker = iresource.createMarker(TracepointConstants.tpOrbpMarker); - marker.setAttribute(MarkerConstants.uri, uri); - marker.setAttribute(TracepointConstants.isActive, true); - - // apply trace mechanism according to default in preferences - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - String id = null; - if (selectedElement instanceof Operation) { - id = store.getDefaultString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP); - } - else if (selectedElement instanceof Port) { - id = store.getDefaultString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_PORT); - } - else if (selectedElement instanceof State) { - id = store.getDefaultString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM); - } - if (id != null) { - EList mechanisms = TraceMechanism.getTraceMechanisms(); - for (ITraceMechanism mechanism : mechanisms) { - for (String providedID : mechanism.getTraceMechanismIDs(selectedElement)) { - if (id.equals(providedID)) { - mechanism.applyTraceMechanism(selectedElement, id, 0); - } - } - } - } - } - else { - // marker exists => change activation status - boolean isSet = marker.getAttribute(TracepointConstants.isActive, false); - marker.setAttribute(TracepointConstants.isActive, !isSet); - } - } - } catch (CoreException ce) { - throw new RuntimeException(ce); - } - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canExecute() { - return (selectedElement != null); - } - - protected Resource resource; - - protected IResource iresource; - - protected String uri; -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointActivationCommand.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointActivationCommand.java deleted file mode 100644 index 5fc0cce53ae..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointActivationCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.services.tracepoints.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; - - -public class ToggleBreakpointActivationCommand extends AbstractTracepointCommand { - - public ToggleBreakpointActivationCommand(EObject selectedElement) { - super("Toggle Breakpoint activation", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ - } - - /** - * {@inheritDoc} - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - updateResourceAndURI(); - toggleMarkerActivation(); - return null; - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointCommand.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointCommand.java deleted file mode 100644 index f5d0b1df3aa..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointCommand.java +++ /dev/null @@ -1,41 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.services.tracepoints.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; - - -public class ToggleBreakpointCommand extends AbstractTracepointCommand { - - public ToggleBreakpointCommand(EObject selectedElement) { - super("Toggle Breakpoint", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ - } - - /** - * {@inheritDoc} - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException - { - updateResourceAndURI(); - toggleMarker(); - return null; - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointActivationCommand.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointActivationCommand.java deleted file mode 100644 index 60d3fc81eb4..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointActivationCommand.java +++ /dev/null @@ -1,41 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.services.tracepoints.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; - - -public class ToggleTracepointActivationCommand extends AbstractTracepointCommand { - - public ToggleTracepointActivationCommand(EObject selectedElement) { - super("Toggle tracepoint activation", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ - } - - /** - * {@inheritDoc} - */ - @Override - public CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - - updateResourceAndURI(); - toggleMarkerActivation(); - return null; - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointCommand.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointCommand.java deleted file mode 100644 index f1353a264e0..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointCommand.java +++ /dev/null @@ -1,54 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.papyrus.infra.services.tracepoints.TraceActions; -import org.eclipse.papyrus.infra.services.tracepoints.TraceMechanism; -import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; - - -public class ToggleTracepointCommand extends AbstractTracepointCommand { - - public ToggleTracepointCommand(EObject selectedElement) { - super("Toggle tracepoint", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ - } - - /** - * {@inheritDoc} - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - updateResourceAndURI(); - try { - IMarker marker = toggleMarker(); - if (marker != null) { - marker.setAttribute(TracepointConstants.isTracepoint, true); - // set default options from preferences - marker.setAttribute(TracepointConstants.traceAction, TraceActions.actionFromPreferences(selectedElement)); - marker.setAttribute(TracepointConstants.traceMechanism, TraceMechanism.getDefaultMechanism(selectedElement)); - } - } catch (CoreException e) { - - } - return null; - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java deleted file mode 100644 index c61c0834ce1..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java +++ /dev/null @@ -1,82 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.services.tracepoints.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; -import org.eclipse.papyrus.infra.services.tracepoints.dialogs.TraceActionSelection; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.Element; - - -public class TracepointPropertiesCommand extends AbstractTracepointCommand { - - public TracepointPropertiesCommand(EObject selectedElement) { - super("Tracepoint properties", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ - } - - /** - * {@inheritDoc} - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException - { - updateResourceAndURI(); - selectTraceActions(); - return null; - } - - protected void selectTraceActions() { - IMarker marker = findMarker(TracepointConstants.tpOrbpMarker); - if (marker != null) { - // should normally always hold, since this is checked in canExecute - TraceActionSelection tad = new TraceActionSelection(Display.getDefault().getActiveShell(), marker, (Element) selectedElement); - tad.open(); - if (tad.getReturnCode() == IDialogConstants.OK_ID) { - Object[] result = tad.getResult(); - String traceAction = (String) result[0]; - String traceMechanism = (String) result[1]; - try { - marker.setAttribute(TracepointConstants.traceAction, traceAction); - marker.setAttribute(TracepointConstants.traceMechanism, traceMechanism); - } catch (CoreException e) { - } - } - } - } - - /** - * {@inheritDoc} - */ - @Override - public boolean canExecute() { - if (selectedElement != null) { - updateResourceAndURI(); - IMarker marker = findMarker(TracepointConstants.tpOrbpMarker); - if (marker != null) { - return marker.getAttribute(TracepointConstants.isTracepoint, false); - } - } - return false; - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/dialogs/TraceActionSelection.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/dialogs/TraceActionSelection.java deleted file mode 100644 index ce47f430c72..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/dialogs/TraceActionSelection.java +++ /dev/null @@ -1,304 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.services.tracepoints.dialogs; - -import java.util.Arrays; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.papyrus.infra.services.tracepoints.ITraceMechanism; -import org.eclipse.papyrus.infra.services.tracepoints.Messages; -import org.eclipse.papyrus.infra.services.tracepoints.TraceActions; -import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAClass; -import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAOperation; -import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAState; -import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TraceFeature; -import org.eclipse.papyrus.infra.services.tracepoints.TraceMechanism; -import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; -import org.eclipse.papyrus.infra.services.tracepoints.preferences.BinaryEncodedMChoiceFieldEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.TreeItem; -import org.eclipse.ui.dialogs.SelectionStatusDialog; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.State; - -public class TraceActionSelection extends SelectionStatusDialog { - - protected CheckboxTableViewer fTraceImplementations; - - protected Text fDescription; - - IMarker m_marker; - - BinaryEncodedMChoiceFieldEditor classOptions; - - BinaryEncodedMChoiceFieldEditor operationOptions; - - BinaryEncodedMChoiceFieldEditor stateOptions; - - /** - * The model element that has a trace marker - */ - private Element m_me; - - public TraceActionSelection(Shell parent, IMarker marker, Element me) { - super(parent); - m_me = me; - m_marker = marker; - // int traceAction = marker.getAttribute(TracepointConstants.traceAction, 0); - } - - - /** - * @see SelectionStatusDialog#computeResult() - * need to return two values: trace action & mechanism - */ - @Override - protected void computeResult() { - // nothing to do - String traceActionValue = null; - if (m_me instanceof State) { - traceActionValue = stateOptions.getResult(); - } - else if (m_me instanceof Class) { - traceActionValue = TraceActions.compositeClassOption( - classOptions.getIntResult(), - stateOptions.getIntResult(), - operationOptions.getIntResult()); - } - else if (m_me instanceof State) { - traceActionValue = stateOptions.getResult(); - } - else if (m_me instanceof Operation) { - traceActionValue = operationOptions.getResult(); - } - String traceMechanism = ""; //$NON-NLS-1$ - for (Object tableElement : fTraceImplementations.getCheckedElements()) { - traceMechanism = (String) tableElement; - } - ; - - Object[] result = new Object[] { - traceActionValue, - traceMechanism - }; - setResult(Arrays.asList(result)); - } - - class EnumLabelProvider extends LabelProvider implements ITableLabelProvider { - - @Override - public String getColumnText(Object obj, int index) { - if (obj instanceof Enum) { - return ((Enum) obj).name(); - } - return obj.toString(); - } - - @Override - public Image getColumnImage(Object obj, int index) { - return null; - } - } - - class TraceMechanismsCP implements IStructuredContentProvider { - - @Override - public void inputChanged(Viewer v, Object oldInput, Object newInput) { - } - - @Override - public void dispose() { - } - - @Override - public Object[] getElements(Object parent) { - Object items[] = null; - // - // Implementations of a tracing mechanism are depending on the injection mechanism and (likely) on the - // programming language. Therefore, they are not part of this plugin shipped with Papyrus, but use an - // extension mechanism. - - EList mechanisms = TraceMechanism.getTraceMechanisms(); - if (mechanisms.size() == 0) { - items = new String[] { Messages.TraceActionSelection_NoPluginsProvideTraceExt }; - } - else { - EList idList = new BasicEList(); - for (ITraceMechanism mechanism : mechanisms) { - for (String id : mechanism.getTraceMechanismIDs(m_me)) { - idList.add(id); - } - } - items = idList.toArray(new String[0]); - } - return items; - } - } - - @Override - public Control createDialogArea(Composite parent) { - Composite contents = (Composite) super.createDialogArea(parent); - - Label label = new Label(contents, SWT.NONE); - label.setText(Messages.TraceActionSelection_SelectTraceAction); - - // need context dependent dialogs on options - // we may need more than one options (e.g. AllOperations + OperationsWithParameters + (begin/end or both?)) - // clean way: accumulate all options, distribute them automatically accordingly. Better (even if less efficient, if strings) - - String[][] taClassOptions = TraceActions.getStringFields(TAClass.values()); - String[][] taStateOptions = TraceActions.getStringFields(TAState.values()); - String[][] taOperationOptions = TraceActions.getStringFields(TAOperation.values()); - String actionString = m_marker.getAttribute(TracepointConstants.traceAction, ""); //$NON-NLS-1$ - String mechanismID = m_marker.getAttribute(TracepointConstants.traceMechanism, ""); //$NON-NLS-1$ - - if (m_me instanceof State) { - stateOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_StateOptions, 3, taStateOptions, contents, true); - stateOptions.setupViaString(actionString); - } - else if (m_me instanceof Class) { - classOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_ClassOptions, 3, taClassOptions, contents, true); - stateOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_StateOptions, 3, taStateOptions, contents, true); - operationOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_OperationOptions, 3, taOperationOptions, contents, true); - classOptions.setupViaString(TraceActions.getOptions(actionString, TraceFeature.Class)); - stateOptions.setupViaString(TraceActions.getOptions(actionString, TraceFeature.State)); - operationOptions.setupViaString(TraceActions.getOptions(actionString, TraceFeature.Operation)); - } - else if (m_me instanceof Operation) { - operationOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_OperationOptions, 3, taOperationOptions, contents, true); - operationOptions.setupViaString(actionString); - } - - Group implementationGroup = new Group(parent, SWT.NONE); - implementationGroup.setText(Messages.TraceActionSelection_ImplementationOptions); - - // need additional item how the trace mechanism should be realized, i.e. available tracing mechanisms - fTraceImplementations = CheckboxTableViewer.newCheckList(implementationGroup, SWT.H_SCROLL | SWT.V_SCROLL); - - fTraceImplementations.setContentProvider(new TraceMechanismsCP()); - fTraceImplementations.setInput(this); - fTraceImplementations.setChecked(mechanismID, true); // TODO: likely not to work - - fTraceImplementations.addCheckStateListener(new ICheckStateListener() { - - @Override - public void checkStateChanged(CheckStateChangedEvent event) { - Object element = event.getElement(); - boolean isChecked = event.getChecked(); - // assure radio button functionality - if (isChecked) { - for (Object checkedElement : fTraceImplementations.getCheckedElements()) { - if (checkedElement != element) { - fTraceImplementations.setChecked(checkedElement, false); - } - } - } - } - }); - - fTraceImplementations.addSelectionChangedListener(new ISelectionChangedListener() { - - @Override - public void selectionChanged(SelectionChangedEvent event) { - ISelection selection = event.getSelection(); - if (selection instanceof IStructuredSelection) { - Object first = ((IStructuredSelection) selection).getFirstElement(); - if (first instanceof String) { - EList mechanisms = TraceMechanism.getTraceMechanisms(); - boolean noDesc = true; - for (ITraceMechanism mechanism : mechanisms) { - String description = mechanism.getTraceMechanismDescription(m_me, (String) first); - if (description != null) { - fDescription.setText(description); - noDesc = false; - break; - } - } - if (noDesc) { - fDescription.setText(Messages.TraceActionSelection_NotAvail); - } - } - } - } - }); - - fDescription = new Text(implementationGroup, SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY); - - GridData span = new GridData(); - span.horizontalAlignment = GridData.FILL; - span.grabExcessHorizontalSpace = true; - span.grabExcessVerticalSpace = true; - span.verticalAlignment = GridData.FILL; - span.heightHint = 250; - - // fTraceActions.getTable().setLayoutData(span); - implementationGroup.setLayout(new GridLayout()); - implementationGroup.setLayoutData(span); - - GridData span2 = new GridData(); - span2.horizontalAlignment = GridData.FILL; - span2.grabExcessHorizontalSpace = true; - span2.grabExcessVerticalSpace = true; - span2.verticalAlignment = GridData.FILL; - span2.heightHint = 80; - fDescription.setLayoutData(span2); - fTraceImplementations.getTable().setLayoutData(span2); - - // ruleGroup.setLayout(new RowLayout (SWT.VERTICAL)); - parent.setLayout(new GridLayout(1, false)); - // parent.setLayoutData(groupGridData); - return contents; - } - - // obtain name and explicit/implicit node Allocation - protected void setTextFromData(TreeItem ti) { - Object data = ti.getData(); - if (data instanceof InstanceSpecification) { - // ti.setText(new String[]{ name, nodeName, "[" + list + "]" }); - } - } - - protected void refreshTree(TreeItem ti) { - setTextFromData(ti); - for (TreeItem subItem : ti.getItems()) { - refreshTree(subItem); - } - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/AbstractCommandHandler.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/AbstractCommandHandler.java deleted file mode 100644 index 5f4c6281690..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/AbstractCommandHandler.java +++ /dev/null @@ -1,166 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints.handler; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.emf.utils.BusinessModelResolver; -import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForHandlers; -import org.eclipse.papyrus.infra.services.tracepoints.Activator; -import org.eclipse.ui.PlatformUI; - -/** - *
    - *
    - * This abstract command handler manages:
    - * - current selection in order to build a list of the selected {@link EObject}
    - * - execute the command (returned by children) in Papyrus {@link TransactionalEditingDomain}
    - * - calculate the command enablement and visibility regarding the command executability
    - * (the command is now shown in menu if not executable).
    - *
    - * 
    - */ -public abstract class AbstractCommandHandler extends AbstractHandler { - - /** - *
    -	 *
    -	 * Returns the command to execute (to be implemented
    -	 * in children implementing this class)
    -	 *
    -	 * @return the command to execute
    -	 *
    -	 * 
    - */ - protected abstract Command getCommand(); - - /** - *
    -	 * Get the selected element, the first selected element if several are selected or null
    -	 * if no selection or the selection is not an {@link EObject}.
    -	 *
    -	 * @return selected {@link EObject} or null
    -	 * 
    - * - */ - protected EObject getSelectedElement() { - EObject eObject = null; - Object selection = null; - - // Get current selection - selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(); - - // Get first element if the selection is an IStructuredSelection - if (selection instanceof IStructuredSelection) { - IStructuredSelection structuredSelection = (IStructuredSelection) selection; - selection = structuredSelection.getFirstElement(); - } - - // Treat non-null selected object (try to adapt and return EObject) - if (selection != null) { - Object businessObject = BusinessModelResolver.getInstance().getBusinessModel(selection); - if (businessObject instanceof EObject) { - eObject = (EObject) businessObject; - } - } - return eObject; - } - - /** - *
    -	 * Parse current selection and extract the list of {@link EObject} from
    -	 * this selection.
    -	 *
    -	 * This also tries to adapt selected element into {@link EObject}
    -	 * (for example to get the {@link EObject} from a selection in the ModelExplorer).
    -	 *
    -	 * @return a list of currently selected {@link EObject}
    -	 * 
    - * - */ - protected List getSelectedElements() { - - List selectedEObjects = new ArrayList(); - - // Parse current selection - ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(); - if (selection instanceof IStructuredSelection) { - IStructuredSelection structuredSelection = (IStructuredSelection) selection; - for (Object current : structuredSelection.toArray()) { - // Adapt current selection to EObject - if (current instanceof IAdaptable) { - selectedEObjects.add((EObject) ((IAdaptable) current).getAdapter(EObject.class)); - } - } - } else { // Not a IStructuredSelection - if (selection != null) { - // Adapt current selection to EObject - if (selection instanceof IAdaptable) { - selectedEObjects.add((EObject) ((IAdaptable) selection).getAdapter(EObject.class)); - } - } - } - - return selectedEObjects; - } - - /** - * - * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) - * - * @param event - * @return null - * @throws ExecutionException - */ - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - try { - ServiceUtilsForHandlers util = ServiceUtilsForHandlers.getInstance(); - util.getTransactionalEditingDomain(event).getCommandStack().execute(getCommand()); - } catch (ServiceException e) { - Activator.log.error("Unexpected error while executing command.", e); //$NON-NLS-1$ - } - - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isEnabled() { - return getCommand().canExecute(); - } - - /** - * - * @return true (visible) when the command can be executed. - */ - public boolean isVisible() { - return getCommand().canExecute(); - } - - -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointActivationHandler.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointActivationHandler.java deleted file mode 100644 index 2d79fc944ac..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointActivationHandler.java +++ /dev/null @@ -1,33 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.services.tracepoints.handler; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; -import org.eclipse.papyrus.infra.services.tracepoints.commands.ToggleBreakpointActivationCommand; - -/** - * Handler for toggling breakpoint activation. Delegates to associated command - * - * @author Ansgar Radermacher (CEA LIST) - */ -public class ToggleBreakpointActivationHandler extends AbstractCommandHandler { - - @Override - protected Command getCommand() { - // not useful to cache command, since selected element may change - return new GMFtoEMFCommandWrapper(new ToggleBreakpointActivationCommand(getSelectedElement())); - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointHandler.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointHandler.java deleted file mode 100644 index 30a64d1f7aa..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointHandler.java +++ /dev/null @@ -1,33 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.services.tracepoints.handler; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; -import org.eclipse.papyrus.infra.services.tracepoints.commands.ToggleBreakpointCommand; - -/** - * Handler for toggling a break point. Delegates to associated command - * - * @author Ansgar Radermacher (CEA LIST) - */ -public class ToggleBreakpointHandler extends AbstractCommandHandler { - - @Override - protected Command getCommand() { - // not useful to cache command, since selected element may change - return new GMFtoEMFCommandWrapper(new ToggleBreakpointCommand(getSelectedElement())); - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointActivationHandler.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointActivationHandler.java deleted file mode 100644 index 778ff6f23ba..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointActivationHandler.java +++ /dev/null @@ -1,33 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.services.tracepoints.handler; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; -import org.eclipse.papyrus.infra.services.tracepoints.commands.ToggleTracepointActivationCommand; - -/** - * Handler for toggling tracepoint activation. Delegates to associated command - * - * @author Ansgar Radermacher (CEA LIST) - */ -public class ToggleTracepointActivationHandler extends AbstractCommandHandler { - - @Override - protected Command getCommand() { - // not useful to cache command, since selected element may change - return new GMFtoEMFCommandWrapper(new ToggleTracepointActivationCommand(getSelectedElement())); - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointHandler.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointHandler.java deleted file mode 100644 index b1334b8f784..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointHandler.java +++ /dev/null @@ -1,33 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.services.tracepoints.handler; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; -import org.eclipse.papyrus.infra.services.tracepoints.commands.ToggleTracepointCommand; - -/** - * Handler for toggling a tracepoint. Delegates to associated command - * - * @author Ansgar Radermacher (CEA LIST) - */ -public class ToggleTracepointHandler extends AbstractCommandHandler { - - @Override - protected Command getCommand() { - // not useful to cache command, since selected element may change - return new GMFtoEMFCommandWrapper(new ToggleTracepointCommand(getSelectedElement())); - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/TracepointPropertiesHandler.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/TracepointPropertiesHandler.java deleted file mode 100644 index b191d9bb6c4..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/TracepointPropertiesHandler.java +++ /dev/null @@ -1,33 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.services.tracepoints.handler; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; -import org.eclipse.papyrus.infra.services.tracepoints.commands.TracepointPropertiesCommand; - -/** - * Handler for changing the properties of a tracepoint. Delegates to associated command - * - * @author Ansgar Radermacher (CEA LIST) - */ -public class TracepointPropertiesHandler extends AbstractCommandHandler { - - @Override - protected Command getCommand() { - // not useful to cache command, since selected element may change - return new GMFtoEMFCommandWrapper(new TracepointPropertiesCommand(getSelectedElement())); - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/messages.properties b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/messages.properties deleted file mode 100644 index 94ce99780de..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/messages.properties +++ /dev/null @@ -1,15 +0,0 @@ -TPPreferencePage_ClassOptions=Class options -TPPreferencePage_OperationOptions=Operations options -TPPreferencePage_StateOptions=State options -TPPreferencePage_TMforOperations=Trace Mechanism for operations (+construction/destruction) -TPPreferencePage_TMforPorts=Trace Mechanism for ports -TPPreferencePage_TMforStateMachines=Trace Mechanism for state machines -TPPreferencePage_TraceOptions=Trace options - -TraceActionSelection_ClassOptions=Class options -TraceActionSelection_ImplementationOptions=Implementation options -TraceActionSelection_NoPluginsProvideTraceExt=no plugins provide trace extension mechanism -TraceActionSelection_NotAvail= -TraceActionSelection_OperationOptions=Operation options -TraceActionSelection_SelectTraceAction=Select trace action for this element -TraceActionSelection_StateOptions=State options \ No newline at end of file diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/BinaryEncodedMChoiceFieldEditor.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/BinaryEncodedMChoiceFieldEditor.java deleted file mode 100644 index f0889b96393..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/BinaryEncodedMChoiceFieldEditor.java +++ /dev/null @@ -1,134 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.infra.services.tracepoints.preferences; - -import org.eclipse.swt.widgets.Composite; - - -/** - * A class derived from the MultipleChoiceFieldEditor. - * It encodes a multiple choice value in a binary way, i.e. bit I is set in the result, if the i-th choice is active. - * This class can also be used outside a preference page - * - * @author ansgar - * - */ -public class BinaryEncodedMChoiceFieldEditor extends MultipleChoiceFieldEditor { - - /** - * @param name - * The preference ID - * @param labeltext - * the label text - * @param numColumns - * the number of columns - * @param labelsAndValues - * a two dimensional array containing the labels and values - * @param parent - * the parent SWT composite (field editor parent) - * @param useGroup - * display contents within a group - */ - public BinaryEncodedMChoiceFieldEditor(String name, String labeltext, int numColumns, String[][] labelsAndValues, Composite parent, boolean useGroup) { - super(name, labeltext, numColumns, labelsAndValues, parent, useGroup); - } - - - /** - * Convenience constructor, if used outside a preference page - * - * @param labeltext - * the label text - * @param numColumns - * the number of columns - * @param labelsAndValues - * a two dimensional array containing the labels and values - * @param parent - * the parent SWT composite (field editor parent) - * @param useGroup - * display contents within a group - */ - public BinaryEncodedMChoiceFieldEditor(String labeltext, int numColumns, String[][] labelsAndValues, Composite parent, boolean useGroup) { - super("", labeltext, numColumns, labelsAndValues, parent, useGroup); //$NON-NLS-1$ - } - - /** - * Use this function to initialize the set/non-set flags within the dialog from a binary encoded value, - * if you use the dialog outside a preference page - * - * @param currentValue - */ - public void setupViaString(String currentValue) { - setupControls(currentValue); - } - - /** - * Use this function to get the results, - * if you use the dialog outside a preference page - * - * @return the result - */ - public String getResult() { - result = gatherSettings(); - return result; - } - - /** - * Convenience function returning an integer result instead of a String result - * (requires double conversion that is difficult to avoid, since calculateResults needs to return - * a string); - * - * @return - */ - public int getIntResult() { - if (getResult() == null) { - return 0; - } - return Integer.parseInt(getResult()); - } - - @Override - protected String calculateResult(String[][] settings) { - int traceActionValue = 0; - int index = 0; - for (String setting[] : settings) { - // [0] = name, [1] = value [2] = checked - if (setting[2].equals("true")) { //$NON-NLS-1$ - traceActionValue += 1 << index; - } - index++; - } - ; - return String.valueOf(traceActionValue); - } - - @Override - protected boolean isSelected(String fieldName, String valueToSet) { - try { - int value = new Integer(valueToSet); - int index = 0; - for (String setting[] : labelsAndValues) { - // [0] = name, [1] = value [2] = checked - if (setting[0].equals(fieldName)) { - return (value & (1 << index)) > 0; - } - index++; - } - ; - } catch (NumberFormatException e) { - } - return false; - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/MultipleChoiceFieldEditor.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/MultipleChoiceFieldEditor.java deleted file mode 100644 index 2bd41aadfa5..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/MultipleChoiceFieldEditor.java +++ /dev/null @@ -1,235 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - *******************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints.preferences; - -import org.eclipse.jface.preference.FieldEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; - - -/** - * @author Dennis Hübner - Initial contribution and API - * [used within Papyrus to avoid dependency to Xtext, minor visibility modification] - * - */ -public abstract class MultipleChoiceFieldEditor extends FieldEditor { - - private Composite checkBoxBox; - - private final boolean useGroup; - - protected final String[][] labelsAndValues; - - private final int numColumns; - - private Button[] checkBoxButtons; - - protected String result; - - public MultipleChoiceFieldEditor(String name, String labeltext, int numColumns, String[][] labelsAndValues, - Composite fieldEditorParent, boolean useGroup) { - init(name, labeltext); - this.numColumns = numColumns; - this.labelsAndValues = labelsAndValues.clone(); - this.useGroup = useGroup; - createControl(fieldEditorParent); - } - - /** - * @param settings - * String[][fieldName,fieldValue,isChecked] - * @return value as String - */ - protected abstract String calculateResult(String[][] settings); - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int) - */ - @Override - protected void adjustForNumColumns(int numColumns) { - Control control = getLabelControl(); - if (control != null) { - ((GridData) control.getLayoutData()).horizontalSpan = numColumns; - } - ((GridData) checkBoxBox.getLayoutData()).horizontalSpan = numColumns; - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt - * .widgets.Composite, int) - */ - @Override - protected void doFillIntoGrid(Composite parent, int numColumns) { - if (useGroup) { - Control control = getCheckBoxControl(parent); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - control.setLayoutData(gd); - } - else { - Control control = getLabelControl(parent); - GridData gd = new GridData(); - gd.horizontalSpan = numColumns; - control.setLayoutData(gd); - control = getCheckBoxControl(parent); - gd = new GridData(); - gd.horizontalSpan = numColumns; - control.setLayoutData(gd); - } - } - - private Control getCheckBoxControl(Composite parent) { - if (checkBoxBox == null) { - Font font = parent.getFont(); - if (useGroup) { - Group group = new Group(parent, SWT.NONE); - group.setFont(font); - String text = getLabelText(); - if (text != null) { - group.setText(text); - } - checkBoxBox = group; - GridLayout layout = new GridLayout(); - layout.horizontalSpacing = HORIZONTAL_GAP; - layout.numColumns = numColumns; - checkBoxBox.setLayout(layout); - } - else { - checkBoxBox = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.horizontalSpacing = HORIZONTAL_GAP; - layout.numColumns = numColumns; - checkBoxBox.setLayout(layout); - checkBoxBox.setFont(font); - } - - checkBoxButtons = new Button[labelsAndValues.length]; - for (int i = 0; i < labelsAndValues.length; i++) { - Button checkBox = new Button(checkBoxBox, SWT.CHECK | SWT.LEFT); - checkBoxButtons[i] = checkBox; - String[] labelAndValue = labelsAndValues[i]; - checkBox.setText(labelAndValue[0]); - checkBox.setData(labelAndValue[1]); - checkBox.setFont(font); - checkBox.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent event) { - setPresentsDefaultValue(false); - String oldResult = result; - result = gatherSettings(); - fireValueChanged(VALUE, oldResult, result); - } - }); - } - checkBoxBox.addDisposeListener(new DisposeListener() { - - @Override - public void widgetDisposed(DisposeEvent event) { - checkBoxBox = null; - checkBoxButtons = null; - } - }); - } - else { - checkParent(checkBoxBox, parent); - } - return checkBoxBox; - } - - protected String gatherSettings() { - String[][] settings = new String[checkBoxButtons.length][3]; - for (int i = 0; i < checkBoxButtons.length; i++) { - Button currentCheckBox = checkBoxButtons[i]; - String name = currentCheckBox.getText(); - String value = (String) currentCheckBox.getData(); - String checked = String.valueOf(currentCheckBox.getSelection()); - settings[i] = new String[] { name, value, checked }; - } - return calculateResult(settings); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.preference.FieldEditor#doLoad() - */ - @Override - public void doLoad() { - setupControls(getPreferenceStore().getString(getPreferenceName())); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault() - */ - @Override - protected void doLoadDefault() { - setupControls(getPreferenceStore().getDefaultString(getPreferenceName())); - } - - protected void setupControls(String valueToSet) { - for (int i = 0; i < checkBoxButtons.length; i++) { - Button currentCheckBox = checkBoxButtons[i]; - currentCheckBox.setSelection(isSelected(currentCheckBox.getText(), valueToSet)); - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.preference.FieldEditor#doStore() - */ - @Override - protected void doStore() { - if (result == null) { - return; - } - getPreferenceStore().setValue(getPreferenceName(), result); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls() - */ - @Override - public int getNumberOfControls() { - return 1; - } - - @Override - public void setEnabled(boolean enabled, Composite parent) { - if (!useGroup) { - super.setEnabled(enabled, parent); - } - for (Button button : checkBoxButtons) { - button.setEnabled(enabled); - } - } - - abstract protected boolean isSelected(String fieldName, String valueToSet); -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceConstants.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceConstants.java deleted file mode 100644 index 805ae8a3b87..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceConstants.java +++ /dev/null @@ -1,51 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints.preferences; - -/** - * Constant definitions for plug-in preferences - */ -public class TPPreferenceConstants { - - /** - * The trace mechanism that should be used by default - */ - public static final String P_TRACE_IMPLEMENTATION_PORT = "papyrus.trace.implementation.port"; //$NON-NLS-1$ - - /** - * The trace mechanism that should be used by default - */ - public static final String P_TRACE_IMPLEMENTATION_OP = "papyrus.trace.implementation.op"; //$NON-NLS-1$ - - /** - * The trace mechanism that should be used by default - */ - public static final String P_TRACE_IMPLEMENTATION_SM = "papyrus.trace.implementation.sm"; //$NON-NLS-1$ - - - /** - * Options for trace implementation via state machines - */ - public static final String P_TRACE_OPTION_CLASS = "papyrus.trace.option.class"; //$NON-NLS-1$ - - /** - * Options for trace implementation for operations - */ - public static final String P_TRACE_OPTION_STATE = "papyrus.trace.option.state"; //$NON-NLS-1$ - - /** - * Options for trace implementation via state machines - */ - public static final String P_TRACE_OPTION_OP = "papyrus.trace.option.op"; //$NON-NLS-1$ -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceInitializer.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceInitializer.java deleted file mode 100644 index 4280caa8c4e..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceInitializer.java +++ /dev/null @@ -1,54 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints.preferences; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.papyrus.infra.services.tracepoints.Activator; -import org.eclipse.papyrus.infra.services.tracepoints.ITraceMechanism; -import org.eclipse.papyrus.infra.services.tracepoints.TraceMechanism; - -/** - * Class used to initialize default preference values. - */ -public class TPPreferenceInitializer extends AbstractPreferenceInitializer { - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() - */ - @Override - public void initializeDefaultPreferences() { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - EList mechanisms = TraceMechanism.getTraceMechanisms(); - String mechanismID = ""; //$NON-NLS-1$ - if (mechanisms.size() > 0) { - ITraceMechanism mechanism = mechanisms.get(0); - // TODO: function need to support null object - EList mechanismIDs = mechanism.getTraceMechanismIDs(null); - if (mechanismIDs.size() > 0) { - mechanismID = mechanismIDs.get(0); - } - } - store.setDefault(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_PORT, mechanismID); - store.setDefault(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP, mechanismID); - store.setDefault(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM, mechanismID); - - store.setDefault(TPPreferenceConstants.P_TRACE_OPTION_CLASS, 3); - store.setDefault(TPPreferenceConstants.P_TRACE_OPTION_STATE, 0); - store.setDefault(TPPreferenceConstants.P_TRACE_OPTION_OP, 0); - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferencePage.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferencePage.java deleted file mode 100644 index eb4008a2308..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferencePage.java +++ /dev/null @@ -1,108 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ -package org.eclipse.papyrus.infra.services.tracepoints.preferences; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.jface.preference.ComboFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.jface.preference.RadioGroupFieldEditor; -import org.eclipse.papyrus.infra.services.tracepoints.Activator; -import org.eclipse.papyrus.infra.services.tracepoints.ITraceMechanism; -import org.eclipse.papyrus.infra.services.tracepoints.Messages; -import org.eclipse.papyrus.infra.services.tracepoints.TraceActions; -import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAClass; -import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAOperation; -import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAState; -import org.eclipse.papyrus.infra.services.tracepoints.TraceMechanism; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -/** - * This class represents the TracePoint preference page - *

    - * This page is used to modify preferences only. They are stored in the preference store that belongs to the main plug-in class. That way, preferences can be accessed directly via the preference store. - */ - -public class TPPreferencePage - extends FieldEditorPreferencePage - implements IWorkbenchPreferencePage { - - public TPPreferencePage() { - super(GRID); - setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription(Messages.TPPreferencePage_TraceOptions); - } - - /** - * Creates the field editors. Field editors are abstractions of - * the common GUI blocks needed to manipulate various types - * of preferences. Each field editor knows how to save and - * restore itself. - */ - @Override - public void createFieldEditors() { - EList mechanisms = TraceMechanism.getTraceMechanisms(); - int elements = 0; - for (ITraceMechanism mechanism : mechanisms) { - // TODO: function need to support null object - EList mechanismIDs = mechanism.getTraceMechanismIDs(null); - elements += mechanismIDs.size(); - } - String[][] mechList = new String[elements][2]; - elements = 0; - for (ITraceMechanism mechanism : mechanisms) { - // TODO: function need to support null object - EList mechanismIDs = mechanism.getTraceMechanismIDs(null); - for (String id : mechanismIDs) { - mechList[elements][1] = id; - mechList[elements][0] = mechanism.getTraceMechanismDescription(null, id); - elements++; - } - } - - String[][] taClassOptions = TraceActions.getStringFields(TAClass.values()); - String[][] taStateOptions = TraceActions.getStringFields(TAState.values()); - String[][] taOperationOptions = TraceActions.getStringFields(TAOperation.values()); - - addField(new BinaryEncodedMChoiceFieldEditor(TPPreferenceConstants.P_TRACE_OPTION_CLASS, Messages.TPPreferencePage_ClassOptions, 3, taClassOptions, getFieldEditorParent(), true)); - - addField(new BinaryEncodedMChoiceFieldEditor(TPPreferenceConstants.P_TRACE_OPTION_STATE, Messages.TPPreferencePage_StateOptions, 3, taStateOptions, getFieldEditorParent(), true)); - - addField(new RadioGroupFieldEditor( - TPPreferenceConstants.P_TRACE_OPTION_OP, - Messages.TPPreferencePage_OperationOptions, 3, taOperationOptions, getFieldEditorParent(), true)); - - addField(new ComboFieldEditor( - TPPreferenceConstants.P_TRACE_IMPLEMENTATION_PORT, - Messages.TPPreferencePage_TMforPorts, mechList, getFieldEditorParent())); - - addField(new ComboFieldEditor( - TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP, - Messages.TPPreferencePage_TMforOperations, mechList, getFieldEditorParent())); - - addField(new ComboFieldEditor( - TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM, - Messages.TPPreferencePage_TMforStateMachines, mechList, getFieldEditorParent())); - - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ - @Override - public void init(IWorkbench workbench) { - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.classpath b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.classpath deleted file mode 100644 index 248b4c5dc7a..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.gitignore b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.gitignore deleted file mode 100644 index 5500bf75774..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tmpModel diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.project b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.project deleted file mode 100644 index e5477bc69be..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.project +++ /dev/null @@ -1,47 +0,0 @@ - - - org.eclipse.papyrus.qompass.modellibs.tracing - - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.acceleo.ide.ui.acceleoBuilder - - - compilation.kind - compilation.absolute.path - - - compliance - pragmatic - - - resource.kind - xmi - - - - - - org.eclipse.pde.PluginNature - org.eclipse.acceleo.ide.ui.acceleoNature - org.eclipse.jdt.core.javanature - org.eclipse.xtext.ui.shared.xtextNature - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f42de363afa..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/META-INF/MANIFEST.MF deleted file mode 100644 index 6908c801140..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/META-INF/MANIFEST.MF +++ /dev/null @@ -1,28 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: org.eclipse.papyrus.qompass.modellibs.tracing, - org.eclipse.papyrus.qompass.modellibs.tracing.acceleo -Require-Bundle: org.eclipse.papyrus.fcm.profile;bundle-version="1.2.0", - org.eclipse.papyrus.qompass.modellibs.core;bundle-version="1.2.0", - org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.papyrus.qompass.designer.core;bundle-version="1.2.0", - org.eclipse.papyrus.infra.services.tracepoints;bundle-version="1.2.0", - org.eclipse.papyrus.infra.core;bundle-version="1.2.0", - org.eclipse.emf.workspace;bundle-version="1.5.0", - org.eclipse.uml2.uml;bundle-version="4.0.0", - org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", - org.eclipse.papyrus.qompass.designer.ui;bundle-version="1.2.0", - org.eclipse.papyrus.uml.diagram.wizards;bundle-version="1.2.0", - com.google.guava;bundle-version="11.0.0", - org.eclipse.xtext.xbase.lib, - org.eclipse.xtend.lib, - org.eclipse.xtend.lib.macro -Bundle-Vendor: %providerName -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.qompass.modellibs.tracing.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.qompass.modellibs.tracing;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/about.html b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

    About This Content

    - -

    November 14, 2008

    -

    License

    - -

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

    - -

    If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

    - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo deleted file mode 100644 index 9ce34a99746..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.properties b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.properties deleted file mode 100644 index a9d7f6eeed9..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.properties +++ /dev/null @@ -1,14 +0,0 @@ -source.. = src/,\ - xtend-gen/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - models/,\ - build.properties,\ - help/,\ - html/,\ - about.html,\ - plugin.properties -customBuildCallbacks = build.acceleo -src.includes = about.html diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/help/tocconcepts.xml b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/help/tocconcepts.xml deleted file mode 100644 index 0344ca208f3..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/help/tocconcepts.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image001.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image001.gif deleted file mode 100755 index 5271b605b82..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image001.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image002.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image002.gif deleted file mode 100755 index d82c319e550..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image002.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image003.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image003.gif deleted file mode 100755 index fae2ca8952f..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image003.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image004.jpg b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image004.jpg deleted file mode 100755 index 864120f480a..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image004.jpg and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image005.jpg b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image005.jpg deleted file mode 100755 index 9c9d1935d00..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image005.jpg and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image006.jpg b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image006.jpg deleted file mode 100755 index d732917a0fc..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image006.jpg and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image007.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image007.gif deleted file mode 100755 index 2a26c4ddaa7..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image007.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image008.jpg b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image008.jpg deleted file mode 100755 index a332638c7e5..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image008.jpg and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image009.jpg b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image009.jpg deleted file mode 100755 index bb1eed8a3b3..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image009.jpg and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/userguide.htm b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/userguide.htm deleted file mode 100644 index b2f52da6ea1..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/userguide.htm +++ /dev/null @@ -1,213 +0,0 @@ - - -Model-Based Tracing of UML models in Papyrus - - -

    Model-Based Tracing of UML models in Papyrus

    -

    -
    -

    1. Introduction

    -

    -The Papyrus Trace Framework allows -annotating UML model elements with a trace annotation. Different kind of model -elements can be annotated, such as operations or ports. These annotations are -shown by means of a decoration icon. When the code of the application is -generated, the trace declaration must lead to an instrumentation of the -generated code for a specific trace implementation, in our case primarily -LTTng.

    -

    2. Annotating Model elements

    -

    Several model elements can be annotated -with trace information. In the sequel, we list these and outline the different -trace options.

    -

    1. Class/component itself. When a class is annotated, by default its -creation and destruction is traced. In addition, a class has several features -(such as operations and attributes). These can be traced without having to -place a tracepoint on the feature itself. The user can choose whether he wants -to trace in addition all attributes, all operations or all states. This choice -is available in the tracing context menu, after the tracepoint has been -applied.

    -

    2. Port of a component

    -

    -If a port of a component is traced, an interceptor is placed within the components container. The -interceptor traces the operations that are associated with a port. For -instance, a data-flow port is associated with push or pull operations that take -the concerned data type as parameter.

    -

    -

    3. Operation of a class

    -

    A tracepoint may -be placed on an operation of a class. This means that an interceptor (on class -level) will create a trace event before and/or after the operation has been -called. In addition, there is the option to add the operation name and the -model reference into the trace point, or ' in addition ' all of the operations -parameters. If the trace event is produced before the application invocation, -out parameters and return values are not part of the trace event.

    -

    -

    4. Property of a class

    -

    Properties -(attributes) of a class can be traced, if the attribute's type is itself a -class. In this case, the tracepoint is interpreted as a trace on the instance. -It implies activating tracing on the attributes type, but restricting the -production of a trace to the role (instance) that the type plays within the class -declaring the attribute. This mechanism can be realized within the framework, -but is not implemented at the moment.

    -

    5. -Trace -an instance specification

    -

    Putting a trace -point on an instance specification is quite similar to putting a trace point to -an attribute: the classifier referenced by the instance specification will have -trace support but actual tracing is restricted to concrete instance. Not implemented (planned for 2013)

    -

    -

    6. -State -(within a statechart)

    -

    If a class defines a state-chart, the -states can be annotated with a trace marker. A trace event is produced, if the -state is entered and/or left (configurable via option). Not implemented -(planned for 2013)

    -

    7. -Transition: -A transition can be annotated. A trace event is produced, when the transition -is fired.

    -

    -

    -

    Code produced for a trace -annotation

    -

    2.1 -Trace declaration

    -

    In LTTng, a trace events need to have a -declaration. We distinguish events that have a generic declaration and those -requiring a specific declaration. For instance, a call event for an operation -has a generic declaration, if parameters are not included: all that is needed -is the operation name (or identifier). Although we could always use a generic -declaration with the operation name as parameter, we declare the name (and URI -reference) in the events declaration, i.e. in its meta-data. Thus, an event -instance does not include the model URI and is therefore quite lcompact on the -expense of a potentially large number of different events.

    -

    In general, the event declaration includes -a model reference, e.g. ref. to port or operation and event data. In case of an -operation call, the event data corresponds to the values of parameter and an -identification of the associated instance. The following code fragment shows, -how a tracepoint is declared in case of a port interception. Here, the port 'p', -typed with interface ICompute is traced, these are the actual of a package -template with the two formal parameters interface and port.

    -

    We use a canonical name for the event type -which is composed of the model name, the name of a package template and the -actual variables for the template. In our example, the model is called -ClientServerTraceTest, the package methodCall_port_ICompute_p (the underlying package -template is called methodCall_port, the actual for the two formals Interface -and port are 'ICompute' and 'p', respectively). The second parameter for the -event declaration is the elements name, e.g. the operation name ('add' in the -example) in case of a traced operation.

    -
    -

    TRACEPOINT_EVENT(ClientServerTraceTest_methodCall_port_ICompute_p, -add,

    -

    -TP_ARGS(const char *, instanceName, int, a, int, b),

    -

    -TP_FIELDS(

    -

    -ctf_string(instanceName, instanceName)

    -

    -ctf_integer(int, a, a)

    -

    -ctf_integer(int, b, b)

    -

    )

    -

    )

    -

    TRACEPOINT_MODEL_EMF_URI(ClientServerTraceTest_methodCall_port_ICompute_p, -add, "platform:/resource/org.eclipse.papyrus.qompass.designer.examples/model/ClientServerTraceTest.uml#_4KiE8DLbEd2qeKRLMdIx_A")

    -
    -

    -

    For each trace event, the added -instrumentation code with invoke the tracepoint, in case of the example above -by

    -
    -

    tracepoint(ClientServerTraceTest_methodCall_port_ICompute_p, add, instanceName, a, b);

    -
    -

    Note that instanceName is an attribute of the interception -class, i.e. not a fixed string, a and b are the actual parameters of an -operation.

    -

    3. Example

    -

    This section demonstrates the use of the trace -mechanism by means of a very simple application, called client/server trace -test. The model is available via the 'new example' menu. Select the example -from the 'Qompass examples' folder.

    -

    trace4.png

    -

    Figure 1: Tracepoint on operation, shown in model -explorer, diagram and trace view

    -

    Figure 1 shows a -small test application. A tracepoint is placed on an operation testOp. The -tracepoint is also visible in the tracepoint view (first selected entry) and in -the model explorer and the left. The tracepoint view is an additional view that -can be shown via the Eclipse standard 'show view' dialog, appearing in the -Papyrus category.

    -

    -

    -

    trace9.png

    -

    Figure 2: Set trace points via context menu

    -

    Figure 2 shows a -part of the context menu of a model element in the model explorer or a diagram. -It contains a sub-menu called 'Tracing' that contains trace related functions. -In particular, it is possible to toggle a tracepoint, i.e. add or remove a -tracepoint. A tracepoint can be active or inactive. While the instrumentation -is always added, i.e. also when the tracepoint is inactive, trace events should -only be produced for an active tracepoint. This sould be done via the LTTng -runtime control mechanisms.

    -

    -

    -

    Figure 4: Preference dialog for tracing

    -

    Figure 4 shows the -preference dialog for tracing within the Papyrus category. The dialog captures -the different options how a tracepoint of a class, a state and on an operation -should be interpreted, e.g. whether an operation is be trace with or without -parameter values.

    -

    In addition to these options, the -instrumentation has a modular realization mechanism and the default -implementation among available implementations can be chosen. The Qompass model -library contains for instance not only an LTTng based trace implementation, but -also one based on OTF (open trace format).

    -

    -

    -

    -

    Figure 5: Trace event view via TMF

    -

    Once the tracepoints are set, an -application can be compiled and executed. Currently, the runtime trace options -must be set manually (e.g. enable all events). The generated trace can be -imported by means of the TMF (trace monitoring framework) which is part of the -LTTng linux-tools. Figure 5 -shows the event view of this framework (note that the view will be replaced by -an editor from version 2.0 on) displaying the trace of the client/server trace -test model. The screenshot shows the event timestamp, type and content. It -depicts that the type corresponds to a qualified name in the model element and -that the contents contains parameter values.

    -

    -

    -

    Figure 6: Trace event view, filtered (only 'testOp' -is shown)

    -

    In Figure 6, the event view has been restricted -to the operation 'testOp' by means of a context operation of an element in the -model explorer or diagram. In this case, only events for the operation testOp -are shown.

    -
    - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.di b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.di deleted file mode 100644 index de6e71c6b4a..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.di +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.notation b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.notation deleted file mode 100644 index 0a038c23221..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.notation +++ /dev/null @@ -1,1600 +0,0 @@ - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - - - - -
    - - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - -
    - - - -
    - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.uml b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.uml deleted file mode 100644 index 58b4c73f332..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.uml +++ /dev/null @@ -1,398 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - cout << "a=" << a << " b=" << b << " a+b=" << a+b << endl; -return a+b; - - - - - - - - - - - - - - - - - - C/C++ - cout << "a*b=" << a*b; -return a*b; - - - - - - C++ - My opaque behavior - - - - - - C++ - // This is a C++ operation body - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This interface contains services that are used by the client and provided by the server component - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The client component inherits a specific port from the Cstart componen type: the port "start" which provides interface IRunnable containing a single operation "run". By implementing this operation, the client gets initial control, comparable to a function "main" in classificla programming languages. - - - This realization relationship has been added automatically by Qompass, it is derived from the fact that class CClient_impl implements the port "start" which provides the interface "IStart" - - - The operation "run" (not the associated behavior) has been added automatically by Qompass in order to implement the operations of interfaces provided by ports, in this case of the operations of the "IStart" interface. It would be tedious to manually copy operations from an interface, as it would imply copying the complete signature with all parameters. The component developper has to provide a suitable behavior. A validation rule verifies if operations without behavior exist. - - - - - These two interface are part of the "BasicCalls" Qompass model library. The IStart interface is "special", since the Qompass model transformations check for it existance in order to pass the "main" control to this component. A validation rule checks, if exactly one component instance provides this interface via the "start" port. - - - - - - - - - - - - C/C++ - cout << "call via port q: add (2, 3);" << endl; -for (int i=0; i<20; i++) { - cout << "result: " << q->add (2, (i+3)) << endl; - usleep((i+10)*5*1000); - cout << "result: " << q->mult (3.0, 7.0) << endl; - usleep(20*1000); - testOp(i*2); - usleep(30*1000); -} - - - C/C++ - cout << "This is a test operation" << endl; - - - - - - - - - - - A composite class in which two attributes represent the component instances client and server, respectively. The assembly between ports is done on this level. -A single class represents the complete application, typically called "System" or "System_impl". Such a class provides the information to calculate a tree of instance specifications, a so-called deployment plan. Check out the context menu. can be generated from the - - - This connection between ports is stereotyped. The "connector" provides information which specific interaction component is responsible for realising this connection. The interaction component is part of an Qompass model library. Select the connection and check out the Qompass pop "Show/choose connector type or implementation". In this case an group of implementations has been chosen, which contains a socket connection in case of distribution and a direct connection, if co-localized - - - - - - - - - - - - - - - - - - - - The hardware architecture is also defined by means of a composite class (comparable to the software architecture). The types (NodeA and NodeB) can be stereotyped with information about the used target platform (FCM stereotype target). As for software architecture, instances specification for nodes are derived from this class. Use "Qompass: create platform definition" in the context menu. - - - The physical connection between two nodes is represented by a UML connector. Currently, this information is not evaluated by Qompass, but it is planned to analyze for instance whether the throughput (specified by means of MARTE) is sufficient with requirements of the software - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A deployment configuration that activates the tracing container rule which will provide OTF tracing. The deployment configuration is linked with the "monolithic" deployment plan - - - deployment plan (= set of instances along with their configuration and allocation) "monolithic". All instances are allocated to node instance "monoNode". Check out the node allocation with the pop-up "Qompass: allocate to node". -Initiate the deployment and code generation with the pop-up "Qompass: generate deployment model and code from plan". - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.di b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.di deleted file mode 100644 index 8ead0589857..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.di +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.notation b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.notation deleted file mode 100644 index 8d26d0ae915..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.notation +++ /dev/null @@ -1,1090 +0,0 @@ - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - -
    -
    -
    -
    -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - -
    - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.uml b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.uml deleted file mode 100644 index dec7c68c5a4..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.uml +++ /dev/null @@ -1,457 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - Variant of the consumper component that uses a "pull style", i.e. actively demands whether new data is available. Since the component is active, it needs to have its own thread. This is realized by the combination of the lifecycle port with a container rule that intercepts the lifecycle operations and executes the activation operation in its own thread. -Use the context menu to find out that the PullConsumer supports the "runStartThread" interceptor which intercepts the lifecycle port. - - - - Part of the Qompass model library. Provides the specific port "lc" (short for lifecycle). The "activate" operation of this port is called by generated boot-code after instantiation and configuration of a component. The deactivation is called before disposing a component - - - - - - - - - - - - C/C++ - cout << "wait for data on port p" << endl; -for (int i = 0; i<25; i++) { - if (p->hasData ()) { - ComponentModel::interfaces::PubData data = p->pull (); - cout << "received data: x = " << data.x << " y = " << data.y << endl; - } - usleep (100*1000); -} -cout << "finished waiting" << endl; - - - - - - - - - Push variant of a consumer, i.e. the consumer is called whenever new data is availble. It is not itself active. - - - A MARTE flow port. The synchronisation between MARTE and FCM stereotype is automatic, yet it is possible to refine on FCM level, whether the port uses a push or pull style. In this case, the port uses a push style by setting the port kind to "PushConsumer". - - - - - - - - - - - - - C/C++ - cout << "initialization of push consumer" << endl; - - - - C/C++ - cout << "received data: x = " << data.x << " y = " << data.y << endl; - - - - - - - - - - - - - - - - - - - - - - - - - Let the producer instance execute by the main thread by realising the specific port "start", inherited from CStart (part of the Qompass "core" model library). - - - - - - - - - - - - - C/C++ - cout << "publish a value via port q;" << endl; -ComponentModel::interfaces::PubData data; -data.x = 2; -data.y = 3; -for (int i = 0; i<20; i++) { - q->push (data); - cout << "." << flush; - // wait 200ms - usleep (200*1000); -} - - - - - - - - - Pull consumer is executed by its own thread. This is specified via a container service (runStartThread) - - - Since producer and consumer call operations (the latter to actively retrieve data), the two ports would be incompatible without using a specific interaction component, in this case. a FIFO. -Use the context menu on a selected connector to specify the interaction component. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The push consumer provides the interface that the producer uses (requires), no specific connector is required - - - - - - - - - - - - - - - - - - - - - - - - - Simple single node configuration. TargetOS is set to Linux, but will work on other OS (supporting POSIX threads) - - - - - - - - - - - - - - - - - - - - - - - - This configuration requires the installation of the OTF trace library.<br /> - - - Cross references to diagrams - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - false - - - - false - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.di b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.di deleted file mode 100644 index 4b69336c601..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.di +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.notation b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.notation deleted file mode 100644 index 62727ee1920..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.notation +++ /dev/null @@ -1,410 +0,0 @@ - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - -
    - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.uml b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.uml deleted file mode 100644 index 99e6bd2e3e9..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.uml +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - cout << "a=" << a << " b=" << b << " a+b=" << a+b << endl; -return a+b; - - - - - - - - - - - - - - - - - - C/C++ - cout << "a*b=" << a*b; -return a*b; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This interface contains services that are used by the client and provided by the server component - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The operation "run" (not the associated behavior) has been added automatically by Qompass in order to implement the operations of interfaces provided by ports, in this case of the operations of the "IStart" interface. It would be tedious to manually copy operations from an interface, as it would imply copying the complete signature with all parameters. The component developper has to provide a suitable behavior. A validation rule verifies if operations without behavior exist. - - - - - - - - C/C++ - cout << "call via port q: add (2, 3);" << endl; -for (int i=0; i<20; i++) { - cout << "result: " << q->add (2, (i+3)) << endl; - usleep((i+10)*5*1000); - cout << "result: " << q->mult (3.0, 7.0) << endl; - usleep(20*1000); - testOp(i*2); - usleep(30*1000); -} - - - C/C++ - cout << "This is a test operation" << endl; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.di b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.di deleted file mode 100644 index ebdd073cf33..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.di +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.notation b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.notation deleted file mode 100644 index f71f3401d51..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.notation +++ /dev/null @@ -1,1684 +0,0 @@ - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - -
    - - -
    - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.uml b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.uml deleted file mode 100644 index 73635b6b22a..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.uml +++ /dev/null @@ -1,750 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - Variant of OTF trace that only reports values that change. - - - A prior variant had a link with the methodCall_comp signature, since the operationIDs should be different, depending on the called component. This leads to a large number of generated classes. Current solution: configure the IDs on an instance level via ths InstanceConfigurator - - - - Trace implementation based on OTF trace library. Aggregates singleton TraceInit - - - - - - - - - - - - - - - - - - - - C/C++ - [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] -[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] - -[template public traceOp(operation: Operation)] - -// <instance>_<port>_<operation> -// easier: <component>_<port>_<operation> -updateTimestamp (); -if (!hasDeclaredFunctions) { - declareFunctions(); - hasDeclaredFunctions = true; -} -Tracing::TraceInit::wait(); -int processID = Tracing::TraceInit::getProcessID(); -OTF_Writer * writer = Tracing::TraceInit::getWriter(); -OTF_Writer_writeEnter (writer, timestamp.ticks(), <%enumSvcPrefix%>::id_<%owner.varName%>_<%varName%>, processID, 0); -OTF_Writer_writeEventComment (writer, timestamp.ticks(), processID, portName); -OTF_Writer_writeEventComment (writer, timestamp.ticks(), processID, instanceName); -Tracing::TraceInit::post(); -[if not (type = null)] [type.cppType()/] ret = [/if]rconn->[operation.cppCall()/]; -updateTimestamp (); -Tracing::TraceInit::wait(); -OTF_Writer_writeLeave (writer, timestamp.ticks(), <%enumSvcPrefix%>::id_<%owner.varName%>_<%varName%>, processID, 0); -Tracing::TraceInit::post(); -[if not (type = null)] return ret;[/if] -[/template] - - - C/C++ - timestamp = OS_AL::Time::TimeVal::current (); -// gettimeofday (&currentTime, NULL); -// timestamp = ... - - - C/C++ - // function groups are badly supported in OTF, since writeEnter/Leave do not support them -// thus intial plan that each interface corresponds to a function group has not been implemented -int fctGroupID = 0; -int streamNr = 0; -OTF_Writer * writer = Tracing::TraceInit::getWriter(); -<%for (getAllOperations) {%> -OTF_Writer_writeDefFunction (writer, streamNr, <%enumSvcPrefix%>::id_<%owner.varName%>_<%varName%>, <%quoteLiteral("InterfaceEnum", "id_<%owner.varName%>_<%varName%>")%>, fctGroupID, 0); -<%}%> - - - - <<TextualRepresentation>>public '<%name%>' () { } - - - - - - - - - - - -
    - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - // <instance>_<port>_<operation> -// easier: <component>_<port>_<operation> -OTF_Writer * writer = Tracing::Trace::TraceInit::getWriter(); -int processID = Tracing::Trace::TraceInit::getProcessID(); -updateTimestamp (); -// need to store parameter values, but that is not simple, as we are not in the data-flow context -// => need specific data-flow trace -// (costly) solution? string comparison? [string has which size?] howto get string representation of each parameter?? (in particular for structs) -// too complicated... -// three specific data_flow trace, offering identical (but conjugated ports). PushP/PushP, PullC/PullC, PushC/PushC => three interceptors, howto select? - -/* -if (m_first) { - m_first = false; - doTrace = true; -} -else -*/ -bool doTrace = true; -OS_AL::Util::BString200 parameters; -parameters << "port=" << portName << " "; -if (doTrace) { - Tracing::Trace::TraceInit::wait(); - <%for (parametersInInout) {%> - <%if (filter("DataType")) {%> - <%for (ownedAttribute) {%> - parameters << <%name%> << "#"; - <%}%> - <%} else {%> - parameters << <%name%> << "#"; - <%}%> - <%}%> - OTF_Writer_writeEnter (writer, timestamp.ticks(), Tracing::Trace::ID_<%args(0).varName%>_<%varName%>, processID, 0); - Tracing::Trace::TraceInit::post(); -} -<%if (type != null) {%><%type.cppType%> ret = <%}%>rconn-><%cppCall%>; -<%if (type != null) {%>parameters << "r=" - <%if (type.filter("DataType")) {%> - <%for (type.ownedAttribute) {%> - << ret.<%name%> << "#" - <%}%>; - <%}else{%> - << ret; - <%}%> -<%}%> -updateTimestamp (); -if (doTrace) { - Tracing::Trace::TraceInit::wait(); - OTF_Writer_writeEventComment (writer, timestamp.ticks(), processID, parameters.data()); - OTF_Writer_writeLeave (writer, timestamp.ticks(), Tracing::Trace::ID_<%args(0).varName%>_<%varName%>, processID, 0); - Tracing::Trace::TraceInit::post(); -} -<%if (type != null) {%>return ret;<%}%> - - - C/C++ - m_first = true; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OTF (Open trace format) tracing mechanism - - - An OTF based trace mechanism that tracks value changes - - - LTTng based trace mechanism for port interception - - - LTTng LW mechanism for operations - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - [import org::eclipse::papyrus::qompass::modellibs::tracing::acceleo::traceLTTng/] - -[template public anOperation(operation : Operation)] -[operation.invokeTP()/] -[/template] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - const char *filename= "trace.otf"; - -//OTF_FileManager* manager; - -uint32_t streams= 1; - -/* file handles available */ -uint32_t files= 10; - -/* per-stream buffer size */ -uint32_t buffersize= 10*1024; - -/* compression on/off, test without compression to look at ASCII trace files */ -// int compression= 0; - -/************************************* -* INIT * -*************************************/ -manager= OTF_FileManager_open( files ); -// assert( NULL != manager ); - -writer = OTF_Writer_open( filename, streams, manager ); -OTF_Writer_setBufferSizes( writer, buffersize ); - -streamNr = 1; - -OTF_Writer_writeDefTimerResolution( writer, - streamNr /* uint32_t stream */, - 1e3 /* uint64_t ticksPerSecond */ ); - -// initial post -sema.post(); - - - C/C++ - return writer; - - - C/C++ - - - - C/C++ - // do not close in deactivate, since additional calls to OTF_write may occur later. -OTF_Writer_close(writer); - - - - C/C++ - int id = OS_AL::ProcessingResources::Thread::getId (); -for (int i = 0; i < processSet.size (); i++) { - if (processSet.get(i) == id) { - return i+1; - } -} -// not known yet => add -processSet.append(id); -int processID = processSet.size(); -char name[16]; -sprintf(name, "id: %x", id); -OTF_Writer_writeDefProcess(writer, streamNr, processID, name, 0); -// OS_AL name only valid for threads created with OS_AL -// OTF_Writer_writeDefProcess(writer, streamNr, processID, OS_AL::ProcessingResources::Thread::getName().data(), 0); -// not required -// OTF_Writer_assignProcess(writer, processID, streamNr); -// OTF_Writer_mapProcess(writer, processID); -OTF_Writer_writeBeginProcess (writer, 0, processID); -return processID; - - - C/C++ - sema.wait(); - - - C/C++ - sema.post(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C/C++ - OTF_Writer_writeDefFunctionGroup (writer, 0, "application functions"); -<%for (ownedLiteral) {%> - OTF_Writer_writeDefFunction (writer, 0, <%name%>, "<%name%>", 0, 0); -<%}%> - - - - - - - - - - - - - C/C++ - !xtend TraceLTTng.declareTracepointEventCreateClass - - - C/C++ - !xtend TraceLTTng.declareTracepointEventDestroyClass - - - - - - - - - - - - - Interceptor for LTTng calls - - - Trace Provider class. Delegates to LTTng xtend file for code generation - - - - - - C/C++ - !xtend TraceLTTng.invokeTP - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.properties b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.properties deleted file mode 100644 index 3909dafe6fc..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus extra: Qompass model library for tracing (Incubation) -providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.xml b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.xml deleted file mode 100644 index 7a1427bd9c9..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/pom.xml b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/pom.xml deleted file mode 100644 index 631e12913d8..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../../releng/extra - - org.eclipse.papyrus.qompass.modellibs.tracing - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-clean-plugin - - - - xtend-gen - - **/* - - - .gitignore - - - - - - - org.eclipse.xtend - xtend-maven-plugin - - - generate-sources - - compile - - - - - xtend-gen - ${project.build.directory}/xtend-gen/test - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/Activator.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/Activator.java deleted file mode 100644 index bd40f7d0f5b..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/Activator.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.tracing; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.modellibs.tracing"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java deleted file mode 100644 index ad9530592fc..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.tracing; - -import org.eclipse.papyrus.uml.diagram.wizards.ModelCopyWizard; - -/** - * Copy wizard for the ClientServerTraceTest example - */ - -public class ClientServerTraceTestModelWizard extends ModelCopyWizard { - - public ClientServerTraceTestModelWizard() { - super("ClientServerTraceTest"); //$NON-NLS-1$ - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorOTF.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorOTF.java deleted file mode 100644 index 64cdef2bc3c..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorOTF.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.tracing; - -import org.eclipse.papyrus.qompass.designer.core.PortUtils; -import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; -import org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator; -import org.eclipse.papyrus.qompass.designer.core.transformations.container.ContainerTrafo; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Interface; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; - - -public class IConfiguratorOTF implements IInstanceConfigurator { - - static final String PROP_PORT_NAME = "portName"; //$NON-NLS-1$ - - static final String PROP_INSTANCE_NAME = "instanceName"; //$NON-NLS-1$ - - /** - * Configure the passed trace instance - * - * @see org.eclipse.papyrus.qompass.designer.gentools.core.extensions.IInstanceConfigurator - */ - @Override - public void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) { - // The tracing code needs informations about the component instance and port. - - DepPlanUtils.configureProperty(instance, PROP_INSTANCE_NAME, StringConstants.QUOTE + instance.getName() + StringConstants.QUOTE); - - // port in context => interception of port => provide information about port and interface - ContainerTrafo containerTrafo = ContainerTrafo.getContainerTrafo(parentInstance); - if (containerTrafo == null) { - return; - } - Port port = containerTrafo.getInterceptedPort(componentPart); - if (port != null) { - // obtain required or provided interface (TODO: will fail, if both are provided!) - Interface intf = PortUtils.getProvided(port); - if (intf == null) { - intf = PortUtils.getRequired(port); - } - - DepPlanUtils.configureProperty(instance, PROP_PORT_NAME, StringConstants.QUOTE + port.getName() + StringConstants.QUOTE); - if (intf != null) { - // this is specific for OTF: - // each container contains an attribute (id_) for each operation. This is configured here, - // since we add instance information to the trace (is that useful??, seems like a hack) - // TODO: originally, we used executorIS *in source model* - for (Operation op : intf.getOperations()) { - String id = PackageUtil.getRootPackage(instance).getName() + "::Tracing::Trace::ID_" + //$NON-NLS-1$ - instance.getName().replace(".", "_") + "_" + op.getName(); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ - DepPlanUtils.configureProperty(instance, "id_" + op.getName(), id); //$NON-NLS-1$ - } - } - } - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorTrace.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorTrace.java deleted file mode 100644 index 4f7eaaf41d6..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorTrace.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.tracing; - -import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; -import org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator; -import org.eclipse.papyrus.qompass.designer.core.transformations.container.ContainerTrafo; -import org.eclipse.uml2.uml.InstanceSpecification; -import org.eclipse.uml2.uml.Port; -import org.eclipse.uml2.uml.Property; - -public class IConfiguratorTrace implements IInstanceConfigurator { - - static final String PROP_PORT_NAME = "portName"; //$NON-NLS-1$ - - static final String PROP_INSTANCE_NAME = "instanceName"; //$NON-NLS-1$ - - /** - * Configure the passed trace instance - * - * @see org.eclipse.papyrus.qompass.designer.gentools.core.extensions.IInstanceConfigurator - */ - @Override - public void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) { - // The tracing code needs informations about the component instance and port. - - String instanceName = instance.getName(); - int index = instanceName.lastIndexOf("."); //$NON-NLS-1$ - if (index != -1) { - String lastSegment = instanceName.substring(index + 1); - if (lastSegment.startsWith(ContainerTrafo.interceptorName)) { - instanceName = instanceName.substring(0, index); - } - } - - DepPlanUtils.configureProperty(instance, PROP_INSTANCE_NAME, StringConstants.QUOTE + instanceName + StringConstants.QUOTE); - - // port in context => interception of port => provide information about port and interface - ContainerTrafo containerTrafo = ContainerTrafo.getContainerTrafo(parentInstance); - if (containerTrafo != null) { - Port port = containerTrafo.getInterceptedPort(componentPart); - if (port != null) { - DepPlanUtils.configureProperty(instance, PROP_PORT_NAME, StringConstants.QUOTE + port.getName() + StringConstants.QUOTE); - } - } - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/QompassTraceMechanism.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/QompassTraceMechanism.java deleted file mode 100644 index 8e286a6792e..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/QompassTraceMechanism.java +++ /dev/null @@ -1,188 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.tracing; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.papyrus.FCM.ConfigOption; -import org.eclipse.papyrus.FCM.ContainerRule; -import org.eclipse.papyrus.FCM.RuleApplication; -import org.eclipse.papyrus.infra.core.resource.ModelSet; -import org.eclipse.papyrus.infra.core.services.ServiceException; -import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers; -import org.eclipse.papyrus.infra.services.tracepoints.ITraceMechanism; -import org.eclipse.papyrus.infra.services.tracepoints.MarkerUtils; -import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAOperation; -import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; -import org.eclipse.papyrus.qompass.designer.core.Description; -import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.qompass.designer.core.Utils; -import org.eclipse.papyrus.uml.tools.utils.PackageUtil; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; -import org.eclipse.uml2.uml.Class; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.Property; - -public class QompassTraceMechanism implements ITraceMechanism { - - public static final String EC3M_TRACING_URI = "pathmap://QML_TRACE/tracing.uml"; //$NON-NLS-1$ - - public static final URI tracingURI = URI.createURI(EC3M_TRACING_URI); - - @Override - public EList getTraceMechanismIDs(EObject eObj) { - EList ids = new BasicEList(); - // obtain list of all available container rules via Utils. Restrict to those doing tracing. - EList containerRules = getContainerRules(eObj); - for (ContainerRule containerRule : containerRules) { - if (isForTracing(containerRule)) { - Class clazz = containerRule.getBase_Class(); - ids.add(clazz.getName()); - } - } - if (ids.size() == 0) { - ids.add("dummy qompass rule"); - } - return ids; - } - - @Override - public String getTraceMechanismDescription(EObject eObj, String id) { - EList containerRules = getContainerRules(eObj); - for (ContainerRule containerRule : containerRules) { - if (isForTracing(containerRule)) { - Class clazz = containerRule.getBase_Class(); - if (clazz.getName().equals(id)) { - return Description.getDescription(clazz); - } - } - } - return null; - } - - /** - * Apply the trace mechanism, i.e. set or unset the appropriate ContainerRule for tracing. - * Currently handles trace on class. - * - * Basic idea: always apply same container rule. But container rule expansion is different in function of set tracepoints. - * Need to unapply, if there is no longer a trace needing it. - */ - @Override - public boolean applyTraceMechanism(EObject eObj, String id, int traceOption) { - Class clazzContext = getClassContext(eObj); - if (clazzContext == null) { - return false; - } - EList containerRules = getContainerRules(eObj); - for (ContainerRule containerRule : containerRules) { - if (isForTracing(containerRule)) { - Class clazz = containerRule.getBase_Class(); - - if (clazz.getName().equals(id)) { - if (traceOption == TAOperation.OnlyCall.ordinal()) { - // yes => what do we then (i.e. how is mapping done??) - } - RuleApplication ruleApplication = StereotypeUtil.applyApp(clazzContext, RuleApplication.class); - if ((ruleApplication != null) && !ruleApplication.getContainerRule().contains(containerRule)) { - ruleApplication.getContainerRule().add(containerRule); - return true; - } - } - } - } - return false; - } - - // QompassTraceMechanism - - public boolean isForTracing(ContainerRule rule) { - for (ConfigOption co : rule.getForConfig()) { - // TODO: not very clean to used fixed string - if (co.getBase_Class().getName().equals("Trace")) { //$NON-NLS-1$ - return true; - } - } - return false; - } - - /** - * Return the class (component) for which we need to apply a container rule - * to enable the tracing of the passed eObject. This eObject may be - * (1) A class, in this case it could be returned directly - * (2) An operation. In this case, the owning class is returned (caveat: operation might belong to an interface) - * (3) A property of the class (including ports). - * - * @param eObj - * see description above - * @return the class to a container rule may be applied - */ - public Class getClassContext(EObject eObj) { - if (eObj instanceof Class) { - return (Class) eObj; - } else if (eObj instanceof Operation) { - return ((Operation) eObj).getClass_(); - } else if (eObj instanceof Property) { - return ((Property) eObj).getClass_(); - } else { - return null; - } - } - - public EList getContainerRules(EObject eObj) { - if (eObj == null) { - // load rules of registered Tracing model library - try { - ModelSet ms = ServiceUtilsForActionHandlers.getInstance().getModelSet(); - Resource rs = ms.getResource(tracingURI, true); - EList contents = rs.getContents(); - if ((contents.size() > 0) && (contents.get(0) instanceof Package)) { - return Utils.getAllRules((Package) contents.get(0)); - } - } catch (ServiceException e) { - Log.log(IStatus.ERROR, Log.TRAFO_CONTAINER, e.getMessage()); - } - return new BasicEList(); - } else { - Package top = PackageUtil.getRootPackage((Element) eObj); - return Utils.getAllRules(top); - } - } - - @Override - public boolean configureTraceMechanisms() { - String config = ""; //$NON-NLS-1$ - // TODO: config is never evaluated - try { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - - if (root != null) { - Object tracePoints[] = root.findMarkers(TracepointConstants.tpOrbpMarker, true, IResource.DEPTH_INFINITE); - for (Object tracePointObj : tracePoints) { - if (tracePointObj instanceof IMarker) { - IMarker tracePoint = (IMarker) tracePointObj; - EObject eobj = MarkerUtils.getEObjectOfMarker(tracePoint); - if (MarkerUtils.isActive(tracePoint)) { - if (eobj instanceof NamedElement) { - config += ((NamedElement) eobj).getQualifiedName(); - } - } - } - } - } - } catch (CoreException e) { - Log.log(IStatus.ERROR, Log.TRAFO_CONTAINER, e.getMessage()); - } - return true; - } - -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/StringConstants.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/StringConstants.java deleted file mode 100644 index d3ced2536a6..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/StringConstants.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.tracing; - -public class StringConstants { - public static final String QUOTE = "\""; //$NON-NLS-1$ -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceCout.xtend b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceCout.xtend deleted file mode 100644 index 396d9860fb6..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceCout.xtend +++ /dev/null @@ -1,18 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.tracing.acceleo - -import org.eclipse.uml2.uml.Operation -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.* -import org.eclipse.papyrus.qompass.designer.core.extensions.IXtend - -class TraceCout implements IXtend { - - public def traceOp(Operation operation) ''' - // declare operation & use it directly. Problem: declaration can not be within the scope of an operation - updateTimestamp(); - cout << "enter operation: " << «operation.name» << " at " << timestamp.ticks() << " parameters: " - «FOR parameter : operation.ownedParameters» << "«parameter.name» (of type «parameter.type.name») "«ENDFOR» << endl; - - «IF (operation.type != null)» type.cppType ret = «ENDIF»rconn->«operation.cppCall»; - «IF (operation.type != null)» return ret;«ENDIF» - ''' -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceLTTng.xtend b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceLTTng.xtend deleted file mode 100644 index be837094ae1..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceLTTng.xtend +++ /dev/null @@ -1,198 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.tracing.acceleo - -import org.eclipse.uml2.uml.Classifier -import org.eclipse.uml2.uml.Parameter -import org.eclipse.uml2.uml.DataType -import org.eclipse.uml2.uml.Type -import org.eclipse.uml2.uml.Operation - -import static extension org.eclipse.papyrus.qompass.modellibs.tracing.acceleo.TraceUtils.* -import static extension org.eclipse.papyrus.qompass.designer.core.UMLTool.* -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.* -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext -import org.eclipse.papyrus.qompass.designer.core.extensions.IXtend -import org.eclipse.uml2.uml.PrimitiveType - -class TraceLTTng implements IXtend { - - public def declareTP(Classifier cl) ''' - #if !defined(HFILENAME_H) || defined(TRACEPOINT_HEADER_MULTI_READ) - #define HFILENAME_H - - #ifdef __cplusplus - extern "C" { - #endif - - #include - «FOR operation : cl.getAllOperations()» - «IF TraceUtils.hasTrace(operation)» - «declareTPop(tpName1(), operation)» - «ENDIF» - «ENDFOR» - - #undef TRACEPOINT_PROVIDER - #define TRACEPOINT_PROVIDER «tpName1» - - #undef TRACEPOINT_INCLUDE_FILE - #define TRACEPOINT_INCLUDE_FILE «TransformationContext.classifier.getQualifiedName().replaceAll('::', '/')».h - - #include - - #ifdef __cplusplus - } - #endif - - #endif - ''' - - public def declareEMF_URI(Classifier cl) ''' - #include - - TRACEPOINT_MODEL_EMF_URI(UMLmodel, starting, "«TransformationContext.sourceRoot.getURI»") - ''' - - public def declareTPop(String tpName, Operation operation) ''' - #include - - // declare trace point - TRACEPOINT_EVENT(«tpName1()», «operation.tpName2», - TP_ARGS(const char *, instanceName«IF (operation.parametersInInout.size > 0)», «ENDIF»«FOR parameter : operation.parametersInInout SEPARATOR(', ')»«parameter.flattenParNameAndType»«ENDFOR»), - TP_FIELDS( - ctf_string(instanceName, instanceName) - «FOR parameter : operation.parametersInInout» - «TransformationContext.classifier.declareDependency(parameter.type)»«flattenCtfType(parameter.type, parameter.name)» - «ENDFOR» - ) - ) - TRACEPOINT_MODEL_EMF_URI(«tpName1», «operation.tpName2», "«operation.modelRef»") - ''' - - public def declareTracepointEventCreateClass(Classifier clazz) ''' - TRACEPOINT_EVENT(«tpName1», createClass, «clazz.qualifiedName») - ''' - - public def declareTracepointEventDestroyClass(Classifier clazz) ''' - TRACEPOINT_EVENT(«tpName1», destroyClass, «clazz.qualifiedName») - ''' - - public def declareCreateDestroy(String tpName) ''' - TRACEPOINT_EVENT(«tpName», createClass, - TP_ARGS(const char *, classURI), - TP_FIELDS( - ctf_string(classURI, classURI) - ) - ) - TRACEPOINT_EVENT(«tpName», destroyClass, - TP_ARGS(const char *, className), - TP_FIELDS( - ctf_string(xmdID, className) - ) - ) - ''' - - /** - * The name that is used for the trace provider - */ - def tpName1() { - TransformationContext.binding.getNearestPackage.qualifiedName.varName - } - - - /** - * The name that is used for the type - */ - def tpName2(Operation operation) { - operation.name - } - - /** - * Reference either the port (if available in the context) or the operation that is traced - */ - def modelRef(Operation operation) { - val uri = TransformationContext.sourceRoot.eResource.URI - if (TransformationContext.port == null) { - uri + "#" + operation.xmlID() - } - else { - uri + "#" + TransformationContext.port.xmlID() - } - } - - public def declareTraceOp(Operation operation) { - } - - public def invokeTP(Operation operation) ''' - // create event with operationID/portID and pass call - «IF (operation.hasTrace)» - // use (call) tracepoint - tracepoint(«tpName1()», «operation.tpName2()», instanceName«IF (operation.parametersInInout.size > 0)», «ENDIF»«FOR parameter : operation.parametersInInout() SEPARATOR(', ')»«parameter.flattenParName.toString.trim»«ENDFOR»); - «ENDIF» - «IF (operation.type != null)»return «ENDIF»rconn->«operation.cppCall»; - ''' - - - def flattenParNameAndType(Parameter parameter) ''' - «IF (parameter.type instanceof DataType) && !(parameter.type instanceof PrimitiveType)» - «FOR attribute : (parameter.type as DataType).attributes SEPARATOR(', ')»«attribute.type.cppTypeWB.toString.trim», «parameter.name + '_' + attribute.name»«ENDFOR» - «ELSE» - «parameter.type.cppTypeWB.toString.trim», «parameter.name» - «ENDIF» - ''' - - def flattenParName(Parameter parameter) ''' - «IF (parameter.type instanceof DataType) && !(parameter.type instanceof PrimitiveType)» - «FOR attribute : (parameter.type as DataType).attributes SEPARATOR(', ')»«parameter.name».«attribute.name»«ENDFOR» - «ELSE» - «parameter.name» - «ENDIF» - ''' - - - def flattenCtfType(Type type, String name) ''' - «IF (type instanceof DataType) && !(type instanceof PrimitiveType)» - «FOR attribute : (type as DataType).attributes SEPARATOR('\n')» - «ctfType(attribute.type, name + '_' + attribute.name)» - «ENDFOR» - «ELSE» - «ctfType(type, name)» - «ENDIF» - ''' - - - /** - * Support for C++ types with boolean - */ - def cppTypeWB(Type type) ''' - «IF - (type.qualifiedName == 'UMLPrimitiveTypes::Boolean') || - (type.qualifiedName == 'PrimitiveTypes::Boolean') || - (type.qualifiedName == 'CORBA::Boolean')» - /* bool */ unsigned char - «ELSE» - «type.cppType» - «ENDIF» - ''' - - - /** - * Calculate the typename, defaulting to ctf_integer - * TODO: treat pointer & ref stereotypes (can only evaulate on parameter or attribute, not on Type) - * - */ - def ctfType(Type type, String name) ''' - «IF - (type.qualifiedName == 'CORBA::String') || - (type.qualifiedName == 'PrimitiveTypes::String') || - (type.qualifiedName == 'UMLPrimitiveTypes::String')» - ctf_string(«name», «name») - «ELSEIF - (type.qualifiedName == 'CORBA::Float') || - (type.qualifiedName == 'CORBA::Double') || - (type.qualifiedName == 'AnsiCLibrary::float') || - (type.qualifiedName == 'AnsiCLibrary::double')» - ctf_float(«type.cppType», «name», «name») - «ELSE» - ctf_integer(«type.cppTypeWB», «name», «name») - «ENDIF» - ''' -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceOTF.xtend b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceOTF.xtend deleted file mode 100644 index 39d65986c6a..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceOTF.xtend +++ /dev/null @@ -1,33 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.tracing.acceleo - -import org.eclipse.uml2.uml.Operation -import static extension org.eclipse.papyrus.qompass.designer.core.UMLTool.* -import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.* -import org.eclipse.papyrus.qompass.designer.core.EnumService -import org.eclipse.uml2.uml.NamedElement -import org.eclipse.papyrus.qompass.designer.core.extensions.IXtend - -class TraceOTF implements IXtend { - public def traceOp(Operation operation) ''' - // __ - // easier: __ - updateTimestamp (); - if (!hasDeclaredFunctions) { - declareFunctions(); - hasDeclaredFunctions = true; - } - Tracing::TraceInit::wait(); - int processID = Tracing::TraceInit::getProcessID(); - OTF_Writer * writer = Tracing::TraceInit::getWriter(); - OTF_Writer_writeEnter (writer, timestamp.ticks(), «EnumService.enumSvcPrefix»::id_«(operation.owner as NamedElement).varName»_«operation.varName», processID, 0); - OTF_Writer_writeEventComment (writer, timestamp.ticks(), processID, portName); - OTF_Writer_writeEventComment (writer, timestamp.ticks(), processID, instanceName); - Tracing::TraceInit::post(); - «IF (operation.type != null)» type.cppType ret = «ENDIF»rconn->«operation.cppCall»; - updateTimestamp (); - Tracing::TraceInit::wait(); - OTF_Writer_writeLeave (writer, timestamp.ticks(), «EnumService.enumSvcPrefix»::id_«(operation.owner as NamedElement).varName»_«operation.varName», processID, 0); - Tracing::TraceInit::post(); - «IF (operation.type != null)» return ret;«ENDIF» - ''' -} \ No newline at end of file diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceUtils.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceUtils.java deleted file mode 100644 index 7e20fb3019f..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceUtils.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.papyrus.qompass.modellibs.tracing.acceleo; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; -import org.eclipse.papyrus.infra.services.tracepoints.MarkerUtils; -import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; -import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; -import org.eclipse.uml2.uml.Element; - -public class TraceUtils { - - public static IMarker[] getMarkersForEObject(EObject eObject, String markerType) { - Resource resource = eObject.eResource(); - IFile file = WorkspaceSynchronizer.getFile(resource); - if (file != null) { - try { - return file.findMarkers(markerType, true, IResource.DEPTH_INFINITE); - } catch (CoreException e) { - } - } - return new IMarker[0]; - } - - public static boolean hasTrace(Element eObject) { - IMarker markers[] = getMarkersForEObject(eObject, TracepointConstants.tpOrbpMarker); - for (IMarker marker : markers) { - // explicitly pass resourceSet of eObject we want to compare. Otherwise, the marker utils would - // load resources into its own resource set (leading to non-comparable eObjects) - EObject eObjOfMarker = MarkerUtils.getEObjectOfMarker(eObject.eResource().getResourceSet(), marker); - if (eObjOfMarker == eObject) { - return true; - } - } - // TODO: testing workaround (always return true for port based transformations) - if (TransformationContext.getPort() != null) { - return true; - } - return false; - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/xtend-gen/.gitignore b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/xtend-gen/.gitignore deleted file mode 100644 index c96a04f008e..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/xtend-gen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/.classpath b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/.classpath deleted file mode 100644 index 098194ca4b7..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/.project b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/.project deleted file mode 100644 index 657d2f7a65c..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.papyrus.views.tracepoints - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f42de363afa..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/META-INF/MANIFEST.MF b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/META-INF/MANIFEST.MF deleted file mode 100644 index a5d9938325c..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/META-INF/MANIFEST.MF +++ /dev/null @@ -1,25 +0,0 @@ -Manifest-Version: 1.0 -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.papyrus.infra.services.tracepoints;bundle-version="1.2.0", - org.eclipse.core.resources;bundle-version="3.7.0", - org.eclipse.emf.ecore;bundle-version="2.8.0", - org.eclipse.gef;bundle-version="3.8.0", - org.eclipse.uml2.uml;bundle-version="4.0.0", - org.eclipse.papyrus.infra.core;bundle-version="1.2.0", - org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0", - org.eclipse.emf.transaction;bundle-version="1.4.0", - org.eclipse.gmf.runtime.common.core;bundle-version="1.4.1", - org.eclipse.gmf.runtime.common.ui;bundle-version="1.5.0", - org.eclipse.ui.ide;bundle-version="3.8.100", - org.eclipse.papyrus.infra.services.markerlistener;bundle-version="1.2.0", - org.eclipse.papyrus.infra.services.decoration;bundle-version="1.2.0" -Bundle-Vendor: %pluginProvider -Bundle-ActivationPolicy: lazy -Bundle-Version: 1.2.0.qualifier -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-Activator: org.eclipse.papyrus.views.tracepoints.Activator -Bundle-ManifestVersion: 2 -Bundle-SymbolicName: org.eclipse.papyrus.views.tracepoints;singleton:=true -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/about.html b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

    About This Content

    - -

    November 14, 2008

    -

    License

    - -

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

    - -

    If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

    - - - \ No newline at end of file diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/build.properties b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/build.properties deleted file mode 100644 index 379a4d0a4b0..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = plugin.xml,\ - META-INF/,\ - .,\ - icons/,\ - about.html,\ - plugin.properties -src.includes = about.html diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/breakpoint_view.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/breakpoint_view.gif deleted file mode 100644 index f529c5a4225..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/breakpoint_view.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/gotoobj_tsk.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/gotoobj_tsk.gif deleted file mode 100644 index cf62b63ae3e..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/gotoobj_tsk.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/skip_brkp.gif b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/skip_brkp.gif deleted file mode 100644 index c1751c3ff4f..00000000000 Binary files a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/skip_brkp.gif and /dev/null differ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.properties b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.properties deleted file mode 100644 index b02f21505bc..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.properties +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -pluginName=Papyrus Tracepoint View (Incubation) -pluginProvider=Eclipse Modeling Project diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.xml b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.xml deleted file mode 100644 index 208df21df9f..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/pom.xml b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/pom.xml deleted file mode 100644 index dd166aa0d33..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../../releng/extra - - org.eclipse.papyrus.views.tracepoints - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-plugin - \ No newline at end of file diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/Activator.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/Activator.java deleted file mode 100644 index 9be427595b3..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/Activator.java +++ /dev/null @@ -1,80 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.views.tracepoints; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.papyrus.views.tracepoints"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - /** - * Returns an image descriptor for the image file at the given - * plug-in relative path - * - * @param path - * the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TraceViewImages.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TraceViewImages.java deleted file mode 100644 index 52e0379c5bd..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TraceViewImages.java +++ /dev/null @@ -1,44 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.views.tracepoints.views; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.papyrus.views.tracepoints.Activator; -import org.eclipse.swt.graphics.Image; - - -public class TraceViewImages { - - public static ImageDescriptor getGotoObjID() { - org.eclipse.papyrus.infra.widgets.Activator widgetsActivator = - org.eclipse.papyrus.infra.widgets.Activator.getDefault(); - return widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, "icons/gotoobj_tsk.gif"); - } - - public static ImageDescriptor getSkipAllID() { - org.eclipse.papyrus.infra.widgets.Activator widgetsActivator = - org.eclipse.papyrus.infra.widgets.Activator.getDefault(); - return widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, "icons/skip_brkp.gif"); - } - - public static Image getSkipAllImage() { - if (skipAllImage == null) { - skipAllImage = getSkipAllID().createImage(); - } - return skipAllImage; - } - - protected static Image skipAllImage = null; -} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TracepointView.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TracepointView.java deleted file mode 100644 index d628a81b917..00000000000 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TracepointView.java +++ /dev/null @@ -1,540 +0,0 @@ -/***************************************************************************** - * Copyright (c) 2012 CEA LIST. - * - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ansgar Radermacher (CEA LIST) - Initial API and implementation - * - *****************************************************************************/ - -package org.eclipse.papyrus.views.tracepoints.views; - - -import java.util.Map; - -import javax.swing.text.View; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gef.GraphicalEditPart; -import org.eclipse.gmf.runtime.common.ui.resources.FileChangeManager; -import org.eclipse.gmf.runtime.common.ui.resources.IFileObserver; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.util.OpenStrategy; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.ICheckStateProvider; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerSorter; -import org.eclipse.papyrus.infra.services.markerlistener.IPapyrusMarker; -import org.eclipse.papyrus.infra.services.tracepoints.MarkerUtils; -import org.eclipse.papyrus.infra.services.tracepoints.TraceFunctions; -import org.eclipse.papyrus.infra.services.tracepoints.TraceState; -import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; -import org.eclipse.papyrus.infra.services.tracepoints.dialogs.TraceActionSelection; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.ISelectionListener; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.ide.IDE; -import org.eclipse.ui.ide.IGotoMarker; -import org.eclipse.ui.part.ViewPart; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.NamedElement; - - -/** - * This sample class demonstrates how to plug-in a new - * workbench view. The view shows data obtained from the - * model. The sample creates a dummy model on the fly, - * but a real implementation would connect to the model - * available either in this or another plug-in (e.g. the workspace). - * The view is connected to the model using a content provider. - *

    - * The view uses a label provider to define how model objects should be presented in the view. Each view can present the same model objects using different labels and icons, if needed. Alternatively, a single label provider can be shared between views in order - * to ensure that objects of the same type are presented in the same way everywhere. - *

    - */ - -public class TracepointView extends ViewPart implements ISelectionListener { - - /** - * The ID of the view as specified by the extension. - */ - public static final String ID = "org.eclipse.papyrus.views.tracepoints.views.Tracepoints"; - - - private CheckboxTableViewer viewer; - - protected Action actionDelete; - - protected Action actionDeleteAll; - - protected Action actionGoto; - - protected Action actionSkip; - - protected Action actionTraceSelect; - - private Action doubleClickAction; - - private IFileObserver fileObserver = null; - - protected TraceActionSelection tas; - - /** - * The content provider class is responsible for - * providing objects to the view. It can wrap - * existing objects in adapters or simply return - * objects as-is. These objects may be sensitive - * to the current input of the view, or ignore - * it and always show the same content - * (like Task List, for example). - */ - class ViewContentProvider implements IStructuredContentProvider { - - @Override - public void inputChanged(Viewer v, Object oldInput, Object newInput) { - } - - @Override - public void dispose() { - } - - @Override - public Object[] getElements(Object parent) { - try { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - if (root != null) { - return root.findMarkers(TracepointConstants.tpOrbpMarker, true, IResource.DEPTH_INFINITE); - } - } catch (CoreException e) { - } - return new String[] {}; - } - } - - - - class ViewLabelProvider extends LabelProvider implements ITableLabelProvider { - - public ViewLabelProvider() { - this.traceImage = new TraceFunctions(); - } - - @Override - public String getColumnText(Object obj, int index) { - if (obj instanceof IMarker) { - EObject eobj = MarkerUtils.getEObjectOfMarker((IMarker) obj); - if (eobj instanceof NamedElement) { - return ((NamedElement) eobj).getQualifiedName(); - } else if (eobj != null) { - return eobj.toString(); - } - } - return getText(obj); - - } - - @Override - public Image getColumnImage(Object obj, int index) { - if (TraceState.skipAllTracepoints) { - return TraceViewImages.getSkipAllImage(); - } - if (obj instanceof IPapyrusMarker) { - IPapyrusMarker marker = (IPapyrusMarker) obj; - ImageDescriptor id = traceImage.getImageDescriptorForGE(marker); - if (id != null) { - // TODO: leaks! - return id.createImage(); - } - } - return null; - } - - private TraceFunctions traceImage; - } - - class NameSorter extends ViewerSorter { - } - - /** - * The constructor. - */ - public TracepointView() { - } - - /** - * This is a callback that will allow us - * to create the viewer and initialize it. - */ - @Override - public void createPartControl(Composite parent) { - viewer = CheckboxTableViewer.newCheckList(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - viewer.setContentProvider(new ViewContentProvider()); - viewer.setLabelProvider(new ViewLabelProvider()); - viewer.setCheckStateProvider(new ICheckStateProvider() { - - @Override - public boolean isGrayed(Object element) { - return false; - } - - @Override - public boolean isChecked(Object element) { - if (element instanceof IMarker) { - IMarker marker = (IMarker) element; - return marker.getAttribute(TracepointConstants.isActive, false); - } - return false; - } - }); - - viewer.setSorter(new NameSorter()); - viewer.setInput(getViewSite()); - - getViewSite().getPage().addSelectionListener(this); - - - // Create the help context id for the viewer's control - PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "org.eclipse.papyrus.views.tracepoints.viewer"); - makeActions(); - hookContextMenu(); - hookDoubleClickAction(); - contributeToActionBars(); - viewer.addCheckStateListener(new ICheckStateListener() { - - @Override - public void checkStateChanged(CheckStateChangedEvent event) { - Object element = event.getElement(); - boolean isChecked = event.getChecked(); - if (element instanceof IMarker) { - IMarker marker = (IMarker) element; - try { - marker.setAttribute(TracepointConstants.isActive, isChecked); - switchUI(); - } catch (CoreException e) { - } - } - } - }); - - fileObserver = new IFileObserver() { - - @Override - public void handleMarkerDeleted(IMarker marker, @SuppressWarnings("rawtypes") Map attributes) { - switchUI(); - } - - @Override - public void handleMarkerChanged(IMarker marker) { - switchUI(); - } - - @Override - public void handleMarkerAdded(IMarker marker) { - switchUI(); - } - - // TODO need to handle? - @Override - public void handleFileRenamed(IFile oldFile, IFile file) { - } - - @Override - public void handleFileMoved(IFile oldFile, IFile file) { - } - - @Override - public void handleFileDeleted(IFile file) { - } - - @Override - public void handleFileChanged(IFile file) { - } - }; - - FileChangeManager.getInstance().addFileObserver(fileObserver); - } - - @Override - public void dispose() { - if (fileObserver != null) { - FileChangeManager.getInstance().addFileObserver(fileObserver); - } - super.dispose(); - } - - public void switchUI() { - Display.getDefault().asyncExec(new Runnable() { - - @Override - public void run() { - // ... do any work that updates the screen ... - viewer.refresh(); - } - }); - } - - private void hookContextMenu() { - MenuManager menuMgr = new MenuManager("#PopupMenu"); - menuMgr.setRemoveAllWhenShown(true); - menuMgr.addMenuListener(new IMenuListener() { - - @Override - public void menuAboutToShow(IMenuManager manager) { - TracepointView.this.fillContextMenu(manager); - } - }); - Menu menu = menuMgr.createContextMenu(viewer.getControl()); - viewer.getControl().setMenu(menu); - getSite().registerContextMenu(menuMgr, viewer); - } - - private void contributeToActionBars() { - IActionBars bars = getViewSite().getActionBars(); - fillLocalPullDown(bars.getMenuManager()); - fillLocalToolBar(bars.getToolBarManager()); - } - - protected void fillLocalPullDown(IMenuManager manager) { - manager.add(actionDelete); - manager.add(new Separator()); - manager.add(actionGoto); - } - - protected void fillContextMenu(IMenuManager manager) { - manager.add(actionDelete); - manager.add(actionGoto); - // Other plug-ins can contribute there actions here - manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - } - - protected void fillLocalToolBar(IToolBarManager manager) { - manager.add(actionDelete); - manager.add(actionDeleteAll); - manager.add(actionGoto); - manager.add(actionSkip); - manager.add(actionTraceSelect); - } - - protected void makeActions() { - actionSkip = new Action("Skip all", IAction.AS_CHECK_BOX) { - - @Override - public void run() { - TraceState.skipAllTracepoints = !TraceState.skipAllTracepoints; - switchUI(); - } - }; - actionSkip.setChecked(TraceState.skipAllTracepoints); - - actionSkip.setImageDescriptor(TraceViewImages.getSkipAllID()); - actionSkip.setToolTipText("Toggle skipping all trace/break points"); - - actionDelete = new Action("Delete") { - - @Override - public void run() { - ISelection selection = viewer.getSelection(); - Object obj = ((IStructuredSelection) selection).getFirstElement(); - if (obj instanceof IMarker) { - IMarker marker = (IMarker) obj; - try { - marker.delete(); - } catch (CoreException e) { - } - } - } - }; - actionDelete.setToolTipText("Delete trace/breakpoint"); - actionDelete.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ELCL_REMOVE)); - - actionDeleteAll = new Action() { - - @Override - public void run() { - - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - if (root != null) { - try { - root.deleteMarkers(TracepointConstants.tpOrbpMarker, true, 0); - } catch (CoreException e) { - } - } - } - }; - actionDeleteAll.setText("Delete all"); - actionDeleteAll.setToolTipText("Delete all trace/breakpoint"); - actionDeleteAll.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ELCL_REMOVEALL)); - - actionGoto = new Action() { - - @Override - public void run() { - ISelection selection = viewer.getSelection(); - Object obj = ((IStructuredSelection) selection).getFirstElement(); - if (obj instanceof IMarker) { - IMarker marker = (IMarker) obj; - boolean onlyNavigatoToActiveEditor = false; - IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - if (onlyNavigatoToActiveEditor) { - IEditorPart part = activePage.getActiveEditor(); - if (part instanceof IGotoMarker) { - ((IGotoMarker) part).gotoMarker(marker); - } - } else { - try { - IDE.openEditor(activePage, marker, OpenStrategy.activateOnOpen()); - } catch (PartInitException e) { - - } - } - } - } - }; - actionGoto.setText("Goto"); - actionGoto.setToolTipText("Navigate to trace/breakpoint"); - actionGoto.setImageDescriptor(TraceViewImages.getGotoObjID()); - doubleClickAction = actionGoto; - - actionTraceSelect = new Action() { - - @Override - public void run() { - ISelection selection = viewer.getSelection(); - Object obj = ((IStructuredSelection) selection).getFirstElement(); - if (obj instanceof IMarker) { - // EditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(input, null); - IMarker marker = (IMarker) obj; - EObject eobj = MarkerUtils.getEObjectOfMarker(marker); - if (eobj instanceof Element) { - TraceActionSelection tad = new TraceActionSelection(Display.getDefault().getActiveShell(), (IMarker) obj, (Element) eobj); - tad.open(); - if (tad.getReturnCode() == IDialogConstants.OK_ID) { - Object[] result = tad.getResult(); - int traceAction = (Integer) result[0]; - String traceMechanism = (String) result[1]; - try { - marker.setAttribute(TracepointConstants.traceAction, traceAction); - marker.setAttribute(TracepointConstants.traceMechanism, traceMechanism); - } catch (CoreException e) { - } - } - } - } - } - - }; - actionTraceSelect.setText("trace action"); - actionTraceSelect.setToolTipText("Select trace action"); - actionTraceSelect.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD)); - } - - protected void hookDoubleClickAction() { - viewer.addDoubleClickListener(new IDoubleClickListener() { - - @Override - public void doubleClick(DoubleClickEvent event) { - doubleClickAction.run(); - } - }); - } - - /** - * Passing the focus request to the viewer's control. - */ - @Override - public void setFocus() { - viewer.getControl().setFocus(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, - * org.eclipse.jface.viewers.ISelection) - */ - // TODO: function not used currently - @Override - public void selectionChanged(IWorkbenchPart part, ISelection selection) { - - IStructuredSelection sSelection = null; - if (selection instanceof IStructuredSelection) { - sSelection = (IStructuredSelection) selection; - } - - // exclude case of an empty selection which is not a Tree selection, since changing views provokes an - // empty selection (selection gets lost, although same element remains selected) - if ((selection != null) && (sSelection != null) && sSelection.isEmpty()) { - return; - } - currentElement = null; - - // No available selection: switch to default panel - if ((sSelection == null) || (sSelection.size() != 1)) { - switchUI(); - return; - } - - // Retrieve selected object - Object currentObject = sSelection.getFirstElement(); - // If the object is an edit part, try to get semantic bridge - if (currentObject instanceof GraphicalEditPart) { - GraphicalEditPart editPart = (GraphicalEditPart) currentObject; - if (editPart.getModel() instanceof View) { - View view = (View) editPart.getModel(); - if (view.getElement() instanceof Element) { - currentObject = view.getElement(); - } - } - } else if (currentObject instanceof IAdaptable) { - // modisco ModelElementItem supports IAdaptable (cleaner than cast / dependency with modisco) - currentObject = ((IAdaptable) currentObject).getAdapter(EObject.class); - } - - if (currentObject instanceof Element) { - currentElement = (Element) currentObject; - // switchUI(); - } - } - - protected Element currentElement; -} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/.classpath b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/.project b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/.project new file mode 100644 index 00000000000..29f34de0ecf --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/.project @@ -0,0 +1,35 @@ + + + org.eclipse.papyrus.cpp.cdtproject + + + ec3m.genTools.core + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + fr.obeo.acceleo.gen.ui.acceleoGenBuilder + + + + + + fr.obeo.acceleo.gen.ui.acceleoGenNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c537b63063c --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..ff6f3ed5154 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/META-INF/MANIFEST.MF @@ -0,0 +1,24 @@ +Manifest-Version: 1.0 +Export-Package: org.eclipse.papyrus.cpp.cdtproject +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.emf.ecore, + org.eclipse.uml2.uml, + org.eclipse.cdt.ui, + org.eclipse.ui.ide, + org.eclipse.core.resources, + org.eclipse.cdt.managedbuilder.core;bundle-version="8.0.0", + org.eclipse.cdt.core;bundle-version="5.4.0", + org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", + org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.2.0", + org.eclipse.cdt.managedbuilder.ui;bundle-version="8.0.0", + org.eclipse.papyrus.codegen.base;bundle-version="1.2.0" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.cpp.cdtproject.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.cpp.cdtproject;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/about.html b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    November 14, 2008

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/build.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/build.properties new file mode 100644 index 00000000000..7b3c227b84a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + plugin.properties,\ + about.html +src.includes = about.html diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/plugin.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/plugin.properties new file mode 100644 index 00000000000..48c00f652ce --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus extra: Qompass C++ support (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/plugin.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/plugin.xml new file mode 100644 index 00000000000..8c640146657 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/plugin.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/pom.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/pom.xml new file mode 100644 index 00000000000..32c15b387e5 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.cpp.cdtproject + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/Activator.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/Activator.java new file mode 100644 index 00000000000..ad6ab20019d --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.cpp.cdtproject; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.cpp.cdtproject"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CCNamedProjectWizard.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CCNamedProjectWizard.java new file mode 100644 index 00000000000..b712ac949aa --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CCNamedProjectWizard.java @@ -0,0 +1,47 @@ +package org.eclipse.papyrus.cpp.cdtproject; + +import org.eclipse.cdt.ui.wizards.CCProjectWizard; +import org.eclipse.jface.wizard.IWizardPage; + +/** + * Variant of CCProjectWizard that allows for setting an initial + * project name. It creates the pages and sets the initial name. + * It does not use the standard CDTMainWizardPage but a variant + * called CDTMainWizardPageV that skips the first validation which + * would other trigger an error. + * + * @see org.eclipse.papyrus.cpp.cdtproject.CDTMainWizardPageV + */ +public class CCNamedProjectWizard extends CCProjectWizard { + + public CCNamedProjectWizard(String projectName) { + this.projectName = projectName; + dontAdd = false; + } + + @Override + public void addPages() { + dontAdd = true; + // avoid that page is actually added, since we want to add our page below + super.addPages(); + dontAdd = false; + String title = fMainPage.getTitle(); + String desc = fMainPage.getDescription(); + fMainPage = new CDTMainWizardPageV(fMainPage.getName()); + fMainPage.setTitle(title); + fMainPage.setDescription(desc); + fMainPage.setInitialProjectName(projectName); + addPage(fMainPage); + } + + @Override + public void addPage(IWizardPage page) { + if (!dontAdd) { + super.addPage(page); + } + } + + private String projectName; + + private boolean dontAdd; +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTMainWizardPageV.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTMainWizardPageV.java new file mode 100644 index 00000000000..9066abf68d1 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTMainWizardPageV.java @@ -0,0 +1,33 @@ +package org.eclipse.papyrus.cpp.cdtproject; + +import org.eclipse.cdt.ui.wizards.CDTMainWizardPage; + +/** + * Variant of the CDTMainWizardPage that skips the first validation. This + * is required in the context of setting an initial project name, since the + * update of the project name will trigger a validation which stops with an + * exception, since some elements (notable tree) are not yet initialized. + * + * Verify if future versions of CDT still require this "hack" {@link CDTMainWizardPage} + * + * @author ansgar + * + */ +public class CDTMainWizardPageV extends CDTMainWizardPage { + + public CDTMainWizardPageV(String pageName) { + super(pageName); + firstValidate = true; + } + + @Override + protected boolean validatePage() { + if (firstValidate) { + return true; + } else { + return super.validatePage(); + } + } + + private boolean firstValidate; +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTSettings.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTSettings.java new file mode 100644 index 00000000000..7f44c642855 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CDTSettings.java @@ -0,0 +1,28 @@ +package org.eclipse.papyrus.cpp.cdtproject; + +import java.util.List; + +import org.eclipse.papyrus.codegen.extensionpoints.AbstractSettings; + +public class CDTSettings extends AbstractSettings { + + /** + * include paths for compiler + */ + List includePaths; + + /** + * list of libraries for linker + */ + List libs; + + /** + * list of library paths for linker + */ + List libPaths; + + /** + * list of predefined macros (#define) + */ + List macros; +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CNamedProjectWizard.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CNamedProjectWizard.java new file mode 100644 index 00000000000..af5e1592c11 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CNamedProjectWizard.java @@ -0,0 +1,47 @@ +package org.eclipse.papyrus.cpp.cdtproject; + +import org.eclipse.cdt.ui.wizards.CProjectWizard; +import org.eclipse.jface.wizard.IWizardPage; + +/** + * Variant of CProjectWizard that allows for setting an initial + * project name. It creates the pages and sets the initial name. + * It does not use the standard CDTMainWizardPage but a variant + * called CDTMainWizardPageV that skips the first validation which + * would other trigger an error. + * + * @see org.eclipse.papyrus.cpp.cdtproject.CDTMainWizardPageV + */ +public class CNamedProjectWizard extends CProjectWizard { + + public CNamedProjectWizard(String projectName) { + this.projectName = projectName; + dontAdd = false; + } + + @Override + public void addPages() { + dontAdd = true; + // avoid that page is actually added, since we want to add our page below + super.addPages(); + dontAdd = false; + String title = fMainPage.getTitle(); + String desc = fMainPage.getDescription(); + fMainPage = new CDTMainWizardPageV(fMainPage.getName()); + fMainPage.setTitle(title); + fMainPage.setDescription(desc); + fMainPage.setInitialProjectName(projectName); + addPage(fMainPage); + } + + @Override + public void addPage(IWizardPage page) { + if (!dontAdd) { + super.addPage(page); + } + } + + private String projectName; + + private boolean dontAdd; +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CProjectSupport.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CProjectSupport.java new file mode 100644 index 00000000000..9f020fd2354 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CProjectSupport.java @@ -0,0 +1,16 @@ +package org.eclipse.papyrus.cpp.cdtproject; + +import org.eclipse.core.resources.IProject; +import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; + +/** + * C project support + */ +public class CProjectSupport extends C_CppProjectSupport implements ILangProjectSupport { + + @Override + public IProject createProject(String projectName) { + IProject project = super.createProject(projectName); + return project; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/C_CppProjectSupport.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/C_CppProjectSupport.java new file mode 100644 index 00000000000..f86106b7577 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/C_CppProjectSupport.java @@ -0,0 +1,225 @@ +package org.eclipse.papyrus.cpp.cdtproject; + +import org.eclipse.cdt.core.model.CoreModel; +import org.eclipse.cdt.core.settings.model.CIncludePathEntry; +import org.eclipse.cdt.core.settings.model.CMacroEntry; +import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; +import org.eclipse.cdt.core.settings.model.ICFolderDescription; +import org.eclipse.cdt.core.settings.model.ICLanguageSetting; +import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; +import org.eclipse.cdt.core.settings.model.ICProjectDescription; +import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager; +import org.eclipse.cdt.core.settings.model.ICSettingEntry; +import org.eclipse.cdt.managedbuilder.core.BuildException; +import org.eclipse.cdt.managedbuilder.core.IConfiguration; +import org.eclipse.cdt.managedbuilder.core.IOption; +import org.eclipse.cdt.managedbuilder.core.ITool; +import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; +import org.eclipse.cdt.ui.wizards.CDTCommonProjectWizard; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.UniqueEList; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.papyrus.C_Cpp.ExternLibrary; +import org.eclipse.papyrus.codegen.extensionpoints.AbstractSettings; +import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Supports the creation and configuration of CDT projects + */ +public class C_CppProjectSupport implements ILangProjectSupport { + + // TODO specific "root" is only required for component based code generation + private static final String ROOT = "root"; //$NON-NLS-1$ + + private static final String C = "c"; //$NON-NLS-1$ + + private static final String CPP = "cpp"; //$NON-NLS-1$ + + private int dialogStatus; + + /** + * Create a C++ project. + * Caller should test before calling, whether the project exists already + * + * @param projectName + * @return the created project + */ + @Override + public IProject createProject(String projectName) + { + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + + IProject project = root.getProject(projectName); + dialogStatus = 0; + try { + IWorkbench wb = PlatformUI.getWorkbench(); + + // create CDT wizard for C++ or C + final CDTCommonProjectWizard wiz = this instanceof CppProjectSupport ? + new CCNamedProjectWizard(projectName) : + new CNamedProjectWizard(projectName); + + wiz.setWindowTitle("create project " + projectName); //$NON-NLS-1$ + wiz.init(wb, null); + + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + WizardDialog wizDiag = new WizardDialog(Display.getCurrent().getActiveShell(), wiz); + + wizDiag.create(); + dialogStatus = wizDiag.open(); + } + }); + } catch (Exception e) { + e.printStackTrace(); + project = null; + } + if (dialogStatus == 1) { + // corresponds to Cancel + return null; + } + if ((project == null) || !project.exists()) { + throw new RuntimeException("Could not create CDT project. This might indicate that there is a problem with your CDT installation."); //$NON-NLS-1$ + } + return project; + } + + @Override + public void setSettings(IProject project, AbstractSettings abstractSettings) + { + CDTSettings settings = (CDTSettings) abstractSettings; + try { + // ((CProject) project). + // IProjectDescription desc = m_project.getDescription(); + + ICProjectDescriptionManager mngr = + CoreModel.getDefault().getProjectDescriptionManager(); + ICProjectDescription cdesc = mngr.getProjectDescription(project, true); + + // loop over all configurations + for (ICConfigurationDescription configDescr : cdesc.getConfigurations()) { + + ICFolderDescription folderDescription = + configDescr.getRootFolderDescription(); + + ICLanguageSetting[] languageSettings = folderDescription.getLanguageSettings(); + + // copy string array into ICLanguageSetting array + ICLanguageSettingEntry[] icIncludePaths = new ICLanguageSettingEntry[settings.includePaths.size()]; + for (int i = 0; i < settings.includePaths.size(); i++) { + icIncludePaths[i] = new CIncludePathEntry(settings.includePaths.get(i), ICSettingEntry.VALUE_WORKSPACE_PATH); + } + + // define name of used operating system from model (attribute of "Target" stereotype) + // and add it to list of macros + if (settings.targetOS != null) { + settings.macros.add("OS_" + settings.targetOS); //$NON-NLS-1$ + } + + // define macros + EList icMacros = + new BasicEList(); + for (int i = 0; i < settings.macros.size(); i++) { + // TODO: need to define values for macros as well? + icMacros.add(new CMacroEntry(settings.macros.get(i), "", 0)); //$NON-NLS-1$ + } + + // now set include path and preprocessor code + for (ICLanguageSetting lang : languageSettings) { + // selection better via ID? (instead of extension) + // Log.log(Status.INFO, Log.CODEGEN, "CppLanguageSupport: lang.getID: " + lang.getId() + " lang.getLanguageID: " + lang.getLanguageId()); + for (String ext : lang.getSourceExtensions()) { + if (ext.equals(CPP) || ext.equals(C)) { + lang.setSettingEntries(ICSettingEntry.INCLUDE_PATH, icIncludePaths); + ICLanguageSettingEntry icOldMacros[] = + lang.getSettingEntries(ICSettingEntry.MACRO); + for (ICLanguageSettingEntry entry : icOldMacros) { + icMacros.add(entry); + } + lang.setSettingEntries(ICSettingEntry.MACRO, icMacros); + break; + } + } + } + IConfiguration main = ManagedBuildManager.getConfigurationForDescription(configDescr); + // change artifact name + // main.setArtifactName(main.getArtifactName () + ".bin"); + + // add to -l (libraries) + ITool cfTool = main.calculateTargetTool(); + + // IOption libOption = cfTool.getOptionBy(IOption.TYPE_LIB); + + for (IOption opt : cfTool.getOptions()) { + if (opt.getValueType() == IOption.LIBRARIES) { + main.setOption(cfTool, opt, settings.libs.toArray(new String[0])); + } else if (opt.getValueType() == IOption.LIBRARY_PATHS) { + main.setOption(cfTool, opt, settings.libPaths.toArray(new String[0])); + } + } + mngr.setProjectDescription(project, cdesc, true, null); + } + ManagedBuildManager.saveBuildInfo(project, true); + } catch (BuildException be) { + throw new RuntimeException(be.getMessage()); + } catch (CoreException ce) { + throw new RuntimeException(ce.getMessage()); + } + } + + @Override + public AbstractSettings initialConfigurationData() { + CDTSettings settings = new CDTSettings(); + settings.includePaths = new UniqueEList(); + // include project directory (all paths are relative to it => ".") + settings.includePaths.add("."); //$NON-NLS-1$ + // include also "root" (relative path) + settings.includePaths.add(ROOT); + + settings.libs = new UniqueEList(); + settings.libPaths = new UniqueEList(); + settings.macros = new UniqueEList(); + return settings; + } + + @Override + public void gatherConfigData(Class implementation, AbstractSettings abstractSettings) { + CDTSettings settings = (CDTSettings) abstractSettings; + Element owner = implementation.getOwner(); + while (owner instanceof Package) { + ExternLibrary cppLibrary = UMLUtil.getStereotypeApplication(owner, ExternLibrary.class); + if ((cppLibrary != null) && (settings != null)) { + settings.includePaths.addAll(cppLibrary.getIncludes()); + for (String libPath : cppLibrary.getLibPaths()) { + if (libPath.startsWith("/")) { + // libPaths starting with a slash are relative to workspace location + // TODO: need to support absolute paths (host file system?) as well? + // (additional prefix. Eclipse standards?) Problem: workspace_loc is added + // automatically for absolute includePaths + settings.libPaths.add("${workspace_loc:" + libPath + "}"); + } else { + // relative to project root, otherwise + settings.libPaths.add(libPath); + } + } + settings.libs.addAll(cppLibrary.getLibs()); + settings.macros.addAll(cppLibrary.getMacros()); + } + owner = owner.getOwner(); + } + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CppProjectSupport.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CppProjectSupport.java new file mode 100644 index 00000000000..aaebf98d1d7 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject/src/org/eclipse/papyrus/cpp/cdtproject/CppProjectSupport.java @@ -0,0 +1,17 @@ +package org.eclipse.papyrus.cpp.cdtproject; + +import org.eclipse.core.resources.IProject; +import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; + +/** + * C++ project support + */ +public class CppProjectSupport extends C_CppProjectSupport implements ILangProjectSupport { + + @Override + public IProject createProject(String projectName) { + IProject project = super.createProject(projectName); + + return project; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/.classpath b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/.project b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/.project new file mode 100644 index 00000000000..6973103854a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.cpp.codegen.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c537b63063c --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..ae0bde0353e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/META-INF/MANIFEST.MF @@ -0,0 +1,26 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.emf.common;bundle-version="2.8.0", + org.eclipse.emf.ecore;bundle-version="2.8.0", + org.eclipse.papyrus.infra.core;bundle-version="1.2.0", + org.eclipse.uml2.uml;bundle-version="4.0.0", + org.eclipse.papyrus.cpp.codegen;bundle-version="1.2.0", + org.eclipse.jface.text;bundle-version="3.8.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", + org.eclipse.cdt.core;bundle-version="5.5.0", + org.eclipse.papyrus.codegen.base;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", + org.eclipse.core.resources, + org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0", + org.eclipse.papyrus.qompass.ui;bundle-version="1.2.0" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.cpp.codegen.ui.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.cpp.codegen.ui;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/about.html b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    November 14, 2008

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/build.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/build.properties new file mode 100644 index 00000000000..93bba3b6fa4 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + icons/,\ + plugin.properties,\ + plugin.xml,\ + about.html +src.includes = about.html diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/icons/codegen.gif b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/icons/codegen.gif new file mode 100644 index 00000000000..c416117e54e Binary files /dev/null and b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/icons/codegen.gif differ diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/plugin.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/plugin.properties new file mode 100644 index 00000000000..53638e41626 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus C++ code generation UI (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/plugin.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/plugin.xml new file mode 100644 index 00000000000..eaee4cb817a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/plugin.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/pom.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/pom.xml new file mode 100644 index 00000000000..5513933621a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.cpp.codegen.ui + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/Activator.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/Activator.java new file mode 100644 index 00000000000..7a8e531ea10 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/Activator.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.ui; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.cpp.codegen.ui"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + public static LogHelper log; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + + // register the login helper + log = new LogHelper(plugin); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/CDTprojectHandler.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/CDTprojectHandler.java new file mode 100644 index 00000000000..ca4efce5b24 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/CDTprojectHandler.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.emf.common.util.URI; +import org.eclipse.papyrus.codegen.extensionpoints.AbstractSettings; +import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; +import org.eclipse.papyrus.codegen.extensionpoints.LanguageProjectSupport; +import org.eclipse.papyrus.cpp.codegen.utils.LocateCppProject; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; + +/** + * Handler for C++ code generation + */ +public class CDTprojectHandler extends CmdHandler { + + private static final String LANGUAGE_NAME = "C++"; //$NON-NLS-1$ + + // ------------------------------------------------------------------------ + // Execution + // ------------------------------------------------------------------------ + + @Override + public boolean isEnabled() { + updateSelectedEObject(); + + if (selectedEObject instanceof Package || selectedEObject instanceof Classifier) { + URI uri = selectedEObject.eResource().getURI(); + + // URIConverter uriConverter = resource.getResourceSet().getURIConverter(); + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + if (uri.segmentCount() < 2) { + return false; + } + IProject modelProject = root.getProject(uri.segment(1)); + return modelProject.exists(); + } + + return false; + } + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + if (selectedEObject instanceof PackageableElement) { + PackageableElement pe = (PackageableElement) selectedEObject; + + IProject modelProject = LocateCppProject.getTargetProject(pe, true); + if (modelProject == null) { + return null; + } + + // get the container for the current element + ILangProjectSupport langSupport = LanguageProjectSupport.getProjectSupport(LANGUAGE_NAME); + if (langSupport != null) { + AbstractSettings settings = langSupport.initialConfigurationData(); + langSupport.setSettings(modelProject, settings); + } + else { + return null; + } + } + return null; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/GenerateCodeHandler.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/GenerateCodeHandler.java new file mode 100644 index 00000000000..8755e9c615c --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/handlers/GenerateCodeHandler.java @@ -0,0 +1,123 @@ +/******************************************************************************* + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.papyrus.cpp.codegen.transformation.CppModelElementsCreator; +import org.eclipse.papyrus.cpp.codegen.utils.ClassUtils; +import org.eclipse.papyrus.cpp.codegen.utils.LocateCppProject; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; + +/** + * Handler for C++ code generation + */ +public class GenerateCodeHandler extends CmdHandler { + + private static final boolean Headless = Boolean.getBoolean("papyrus.run-headless"); + + // ------------------------------------------------------------------------ + // Execution + // ------------------------------------------------------------------------ + + @Override + public boolean isEnabled() { + updateSelectedEObject(); + + if (selectedEObject instanceof Package || selectedEObject instanceof Classifier) { + URI uri = selectedEObject.eResource().getURI(); + + // URIConverter uriConverter = resource.getResourceSet().getURIConverter(); + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + if (uri.segmentCount() < 2) { + return false; + } + IProject modelProject = root.getProject(uri.segment(1)); + return modelProject.exists(); + } + + return false; + } + + /** + * Generate code for a passed packageable element and the elements required by it (in the sense of #included statements) + * + * @param mec + * model elements creator + * @param pe + * the element that should be generated + * @param alreadyHandled + * list of packageable elements for which code has already been generated. + * @param recurse + * if the passed packageableElement is a package, generate code for its contents (recursively). + */ + public void generate(CppModelElementsCreator mec, PackageableElement pe, EList alreadyHandled, boolean recurse) { + alreadyHandled.add(pe); + mec.createPackageableElement(pe, null, false); + // Eventual refresh is done in createPackageableElement + + // if recursion is active, go into all sub-elements + if (pe instanceof Package && recurse) { + for (PackageableElement subPe : ((Package) pe).getPackagedElements()) { + if (!alreadyHandled.contains(subPe)) { + generate(mec, subPe, alreadyHandled, recurse); + } + } + } + + // add required classifiers + if (pe instanceof Classifier) { + EList requiredClassifiers = ClassUtils.includedClassifiers((Classifier) pe); + for (Classifier requiredClassifier : requiredClassifiers) { + if (!alreadyHandled.contains(requiredClassifier)) { + generate(mec, requiredClassifier, alreadyHandled, false); + } + } + } + + // owning package is required by generated code. + Package owningPackage = pe.getNearestPackage(); + if ((owningPackage != null) && (owningPackage != pe)) { + if (!alreadyHandled.contains(owningPackage)) { + generate(mec, owningPackage, alreadyHandled, false); + } + } + } + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + if (selectedEObject instanceof PackageableElement) { + PackageableElement pe = (PackageableElement) selectedEObject; + + IProject modelProject = LocateCppProject.getTargetProject(pe, true); + if (modelProject == null) { + return null; + } + + // get the container for the current element + CppModelElementsCreator mec = new CppModelElementsCreator(modelProject); + generate(mec, pe, new BasicEList(), true); + } + return null; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/preferences/CodegenPreferencePage.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/preferences/CodegenPreferencePage.java new file mode 100644 index 00000000000..2c84930aecd --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui/src/org/eclipse/papyrus/cpp/codegen/ui/preferences/CodegenPreferencePage.java @@ -0,0 +1,117 @@ +/******************************************************************************* + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.ui.preferences; + +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.jface.preference.StringFieldEditor; +import org.eclipse.jface.text.Document; +import org.eclipse.jface.text.source.SourceViewer; +import org.eclipse.papyrus.cpp.codegen.Activator; +import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenConstants; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Group; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; + + +/** + * This class represents a preference page that is contributed to the + * Preferences dialog. By subclassing FieldEditorPreferencePage , + * we can use the field support built into JFace that allows us to create a page + * that is small and knows how to save, restore and apply itself. + *

    + * This page is used to modify preferences only. They are stored in the preference store that belongs to the main plug-in class. That way, preferences can be accessed directly via the preference store. + */ + +public class CodegenPreferencePage extends FieldEditorPreferencePage implements + IWorkbenchPreferencePage { + + private Document pCommentDoc = new Document(); + + public CodegenPreferencePage() { + super(GRID); + setPreferenceStore(Activator.getDefault().getPreferenceStore()); + setDescription("This preferences page allows to customize Papyrus C++ code generation"); + } + + public void addTextField(String name, String label, Document currentDoc) { + // /////////////////////////////////////////////////////////////////////// + // Create a Group for the text + // /////////////////////////////////////////////////////////////////////// + Group txtGroup = new Group(getFieldEditorParent(), SWT.RESIZE); + txtGroup.setLayout(new FillLayout()); + txtGroup.setText(label); + GridData gd = new GridData(GridData.FILL_BOTH /* FILL_HORIZONTAL */); + // gd.heightHint = 250; + gd.horizontalSpan = 2; + txtGroup.setLayoutData(gd); + + // Text area + SourceViewer txtViewer = new SourceViewer(txtGroup, null, SWT.MULTI + | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); + + txtViewer.setDocument(currentDoc); + + // Retrieving existing preference + String content = getPreferenceStore().getString(name); + + // Loading preference in txt zone + currentDoc.set(content); + + } + + /** + * Creates the field editors. Field editors are abstractions of the common + * GUI blocks needed to manipulate various types of preferences. Each field + * editor knows how to save and restore itself. + */ + + @Override + public void createFieldEditors() { + + addField(new StringFieldEditor(CppCodeGenConstants.P_HEADER_SUFFIX, + "Suffix for C++ header files ", getFieldEditorParent())); + addField(new StringFieldEditor(CppCodeGenConstants.P_IMPLEM_SUFFIX, + "Suffix for C++ implementation files ", getFieldEditorParent())); + addField(new StringFieldEditor(CppCodeGenConstants.P_PROJECT_PREFIX, + "Prefix for generated C++ (CDT) projects ", getFieldEditorParent())); + + // Add P_COMMENT_HEADER + addTextField(CppCodeGenConstants.P_COMMENT_HEADER, "Header for generated files", + pCommentDoc); + } + + @Override + public void init(IWorkbench workbench) { + } + + @Override + public void performDefaults() { + + // initialize comment field from default + pCommentDoc.set(getPreferenceStore().getDefaultString(CppCodeGenConstants.P_COMMENT_HEADER)); + super.performDefaults(); + } + + @Override + public boolean performOk() { + + // Store txt for P_COMMENT_HEADER + String currentComment = pCommentDoc.get(); + getPreferenceStore().setValue(CppCodeGenConstants.P_COMMENT_HEADER, currentComment); + + return super.performOk(); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/.classpath b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/.classpath new file mode 100644 index 00000000000..358df1bc1d1 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/.project b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/.project new file mode 100644 index 00000000000..1b4a71a36b8 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/.project @@ -0,0 +1,52 @@ + + + org.eclipse.papyrus.cpp.codegen + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.acceleo.ide.ui.acceleoBuilder + + + compilation.kind + compilation.absolute.path + + + compliance + pragmatic + + + resource.kind + xmi + + + + + + org.eclipse.acceleo.ide.ui.acceleoNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..508918952e5 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/META-INF/MANIFEST.MF @@ -0,0 +1,41 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.jface.text, + org.eclipse.uml2.uml;bundle-version="4.1.0", + org.eclipse.core.resources, + org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", + org.eclipse.ui.ide;bundle-version="3.8.0", + org.eclipse.core.filesystem;bundle-version="1.3.200", + org.eclipse.cdt.core;resolution:=optional, + org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", + org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", + org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.2.0", + org.eclipse.xtend.lib, + com.google.guava;bundle-version="11.0.0", + org.eclipse.xtext.xbase.lib, + org.eclipse.uml2.uml.profile.standard;bundle-version="1.0.0", + org.eclipse.papyrus.codegen.base;bundle-version="1.2.0" +Export-Package: org.eclipse.papyrus.cpp.codegen;uses:="org.eclipse.ui.plugin, + org.osgi.framework, + org.eclipse.uml2.uml", + org.eclipse.papyrus.cpp.codegen.preferences;uses:="org.eclipse.jface.preference, + org.eclipse.core.runtime.preferences", + org.eclipse.papyrus.cpp.codegen.transformation; uses:="org.eclipse.core.runtime, + org.eclipse.papyrus.acceleo, + org.eclipse.core.resources, + org.eclipse.uml2.uml", + org.eclipse.papyrus.cpp.codegen.utils;uses:="org.eclipse.emf.ecore, + org.eclipse.emf.common.util, + org.eclipse.uml2.uml", + org.eclipse.papyrus.cpp.codegen.xtend +Bundle-Vendor: %providerName +Eclipse-LazyStart: true +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.cpp.codegen.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.cpp.codegen;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/about.html b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    November 14, 2008

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/build.acceleo b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/build.acceleo new file mode 100644 index 00000000000..26abe5ae4c9 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/build.acceleo @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/build.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/build.properties new file mode 100644 index 00000000000..143d4e25c7d --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/build.properties @@ -0,0 +1,13 @@ +# +#Tue Mar 26 23:29:07 CET 2013 +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + plugin.properties,\ + about.html,\ + build.acceleo,\ + src/org/eclipse/papyrus/cpp/codegen/utils/messages.properties +output..=bin/ +src.includes=about.html +source..=src/,xtend-gen/ +customBuildCallbacks=build.acceleo diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/plugin.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/plugin.properties new file mode 100644 index 00000000000..c14d7642918 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus C++ code generation (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/plugin.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/plugin.xml new file mode 100644 index 00000000000..5cdc98728ed --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/plugin.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/pom.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/pom.xml new file mode 100644 index 00000000000..b78a7f04301 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.cpp.codegen + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-clean-plugin + + + + xtend-gen + + **/* + + + .gitignore + + + + + + + org.eclipse.xtend + xtend-maven-plugin + + + generate-sources + + compile + + + + + xtend-gen + ${project.build.directory}/xtend-gen/test + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Activator.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Activator.java new file mode 100644 index 00000000000..f61e97bca9c --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Activator.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2012 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ +package org.eclipse.papyrus.cpp.codegen; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.cpp.codegen"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + public static LogHelper log; + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + /** + * The constructor + */ + public Activator() { + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + log = new LogHelper(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Constants.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Constants.java new file mode 100644 index 00000000000..e1f5d37c6ec --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Constants.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2015 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen; + +import java.util.regex.Pattern; + +/** + * String constants for the code generation + * + * @author ansgar + * + */ +public class Constants { + + public static final String includeHFile = "// include associated header file"; //$NON-NLS-1$ + + public static final String cppIncPreBodyStart = "// Include from CppInclude stereotype (pre-body)"; //$NON-NLS-1$ + + public static final String cppIncPreBodyEnd = "// End of CppInclude stereotype (pre-body)"; //$NON-NLS-1$ + + public static final String cppIncBodyStart = "// Include from CppInclude declaration (body)"; //$NON-NLS-1$ + + public static final String cppIncBodyEnd = "// End of CppInclude stereotype (body)";//$NON-NLS-1$ + + public static final String derivedIncludes = "// Derived includes directives";//$NON-NLS-1$ + + public static final String forwardDecl = "// forward declarations"; //$NON-NLS-1$ + + public static final String staticAttributes = "// static attributes (if any)"; //$NON-NLS-1$ + + public static final String undefinedType = "undefined"; //$NON-NLS-1$ + + // support the languages "C++", "C/C++" as well as "cpp". The '+' needs to be escaped in a regular epression + public static final Pattern supportedLanguages = Pattern.compile("C\\+\\+|C/C\\+\\+|cpp"); //$NON-NLS-1$ + + public static final String DOT = "."; //$NON-NLS-1$ +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/CppLangCodegen.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/CppLangCodegen.java new file mode 100644 index 00000000000..3dc87c06e27 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/CppLangCodegen.java @@ -0,0 +1,138 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2015 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - ansgar.radermacher@cea.fr initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.codegen.base.ModelElementsCreator; +import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen2; +import org.eclipse.papyrus.codegen.extensionpoints.MethodInfo; +import org.eclipse.papyrus.codegen.extensionpoints.SyncInformation; +import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenUtils; +import org.eclipse.papyrus.cpp.codegen.transformation.CppModelElementsCreator; +import org.eclipse.papyrus.cpp.codegen.utils.LocateCppProject; +import org.eclipse.papyrus.cpp.codegen.xtend.CppParameter; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.ParameterDirectionKind; +import org.eclipse.uml2.uml.Profile; + +/** + * C++ language support + * + */ +public class CppLangCodegen implements ILangCodegen2 { + + protected ModelElementsCreator creator = null; + + protected IProject lastProject = null; + + @Override + public String getDescription() { + return Messages.C_CppLangCodegen_GeneratorDesc; + } + + /** + * Check whether the code generator is able to produce code for the passed element: + * it must be a classifier and the C++ profile must be applied. + */ + @Override + public boolean isEligible(Element modelElement) { + if (modelElement instanceof Classifier) { + Package nearestPackage = modelElement.getNearestPackage(); + if (nearestPackage != null) { + // check whether the C++ profile is applied + for (Profile profile : nearestPackage.getAllAppliedProfiles()) { + if (C_CppPackage.eINSTANCE.getName().equals(profile.getName())) { + return true; + } + } + } + } + return false; + } + + @Override + public String getSuffix(FILE_KIND fileKind) { + if (fileKind == FILE_KIND.BODY) { + return CppCodeGenUtils.getBodySuffix(); + } else { + return CppCodeGenUtils.getHeaderSuffix(); + } + } + + @Override + public void generateCode(IProject project, PackageableElement element, IProgressMonitor monitor) { + manageCreator(project, element); + creator.createPackageableElement(element, monitor); + } + + @Override + public void cleanCode(IProject project, PackageableElement element, IProgressMonitor monitor) { + manageCreator(project, element); + creator.removePackageableElement(element, monitor); + } + + @Override + public String getFileName(IProject project, NamedElement element) { + manageCreator(project, element); + return creator.getFileName(element); + } + + @Override + public IProject getTargetProject(PackageableElement pe, boolean createIfMissing) { + return LocateCppProject.getTargetProject(pe, createIfMissing); + } + + protected void manageCreator(IProject project, Element element) { + if ((project == null) && (element instanceof PackageableElement)) { + project = getTargetProject((PackageableElement) element, false); + } + if ((creator == null) || (project != lastProject)) { + lastProject = project; + creator = new CppModelElementsCreator(project); + } + } + + @Override + public SyncInformation getSyncInformation(String methodName, String body) { + return null; + } + + @Override + public MethodInfo getMethodInfo(NamedElement operationOrBehavior) { + MethodInfo mi = new MethodInfo(operationOrBehavior.getName()); + EList parameters = null; + if (operationOrBehavior instanceof Operation) { + parameters = ((Operation) operationOrBehavior).getOwnedParameters(); + } else if (operationOrBehavior instanceof Behavior) { + parameters = ((Behavior) operationOrBehavior).getOwnedParameters(); + } + + if (parameters != null) { + for (Parameter parameter : parameters) { + if (parameter.getDirection() != ParameterDirectionKind.RETURN_LITERAL) { + mi.addParameterType(CppParameter.CppParameterForCDT(parameter).toString()); + } + } + } + return mi; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Messages.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Messages.java new file mode 100644 index 00000000000..ff7d9277d4c --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/Messages.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2015 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.cpp.codegen.messages"; //$NON-NLS-1$ + public static String C_CppLangCodegen_GeneratorDesc; + public static String CppModelElementsCreator_CannotFormatContent; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/messages.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/messages.properties new file mode 100644 index 00000000000..611b7081e7e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/messages.properties @@ -0,0 +1,2 @@ +C_CppLangCodegen_GeneratorDesc=General purpose C++ code generator for object-oriented models. Uses the CEA C/C++ profile +CppModelElementsCreator_CannotFormatContent=Cannot format content diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenConstants.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenConstants.java new file mode 100644 index 00000000000..9993ad5e07d --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenConstants.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2012 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.preferences; + +public class CppCodeGenConstants { + + /** + * Suffix for generated header files + */ + public static final String P_HEADER_SUFFIX = "headSuffix"; //$NON-NLS-1$ + + /** + * Suffix for generated body/implementation files + */ + public static final String P_IMPLEM_SUFFIX = "implSuffix"; //$NON-NLS-1$ + + /** + * Suffix for generated body/implementation files + */ + public static final String P_OUT_INOUT_OP = "outInoutOp"; //$NON-NLS-1$ + + /** + * User defined comment header in generated files + */ + public static final String P_COMMENT_HEADER = "commentHeader"; //$NON-NLS-1$ + + /** + * Suffix for generated header files + */ + public static final String P_PROJECT_PREFIX = "projectPrefix"; //$NON-NLS-1$ + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenPreferenceInitializer.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenPreferenceInitializer.java new file mode 100644 index 00000000000..7dd59fbe605 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenPreferenceInitializer.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2012 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.preferences; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.cpp.codegen.Activator; + + +public class CppCodeGenPreferenceInitializer extends AbstractPreferenceInitializer { + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() + */ + @Override + public void initializeDefaultPreferences() { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + store.setDefault(CppCodeGenConstants.P_HEADER_SUFFIX, "h"); //$NON-NLS-1$ + store.setDefault(CppCodeGenConstants.P_IMPLEM_SUFFIX, "cpp"); //$NON-NLS-1$ + store.setDefault(CppCodeGenConstants.P_OUT_INOUT_OP, "*"); //$NON-NLS-1$ + store.setDefault(CppCodeGenConstants.P_PROJECT_PREFIX, "org.eclipse.papyrus.cppgen."); //$NON-NLS-1$ + + // Default value for P_COMMENT_HEADER + String NL = System.getProperties().getProperty("line.separator"); //$NON-NLS-1$ + String defaultValue = + "// --------------------------------------------------------" + NL + //$NON-NLS-1$ + "// Code generated by Papyrus C++" + NL + //$NON-NLS-1$ + "// --------------------------------------------------------" + NL + NL; //$NON-NLS-1$ + store.setDefault(CppCodeGenConstants.P_COMMENT_HEADER, defaultValue); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenUtils.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenUtils.java new file mode 100644 index 00000000000..69a18f191c0 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/preferences/CppCodeGenUtils.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2012 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.preferences; + +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.cpp.codegen.Activator; + +/** + * Utility class that returns the preference values + * + * @author ansgar + * + */ +public class CppCodeGenUtils { + + protected static IPreferenceStore preferenceStore = null; + + public static String getHeaderSuffix() { + initPreferenceStore(); + return preferenceStore.getString(CppCodeGenConstants.P_HEADER_SUFFIX); + } + + public static String getBodySuffix() { + initPreferenceStore(); + return preferenceStore.getString(CppCodeGenConstants.P_IMPLEM_SUFFIX); + } + + public static String getOutInoutOp() { + initPreferenceStore(); + return preferenceStore.getString(CppCodeGenConstants.P_OUT_INOUT_OP); + } + + public static String getCommentHeader() { + initPreferenceStore(); + return preferenceStore.getString(CppCodeGenConstants.P_COMMENT_HEADER); + } + + public static void initPreferenceStore() { + if (preferenceStore == null) { + preferenceStore = Activator.getDefault().getPreferenceStore(); + } + } + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppLocationStrategy.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppLocationStrategy.java new file mode 100644 index 00000000000..ccddad6f9cc --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppLocationStrategy.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.cpp.codegen.transformation; + +import org.eclipse.papyrus.codegen.base.HierarchyLocationStrategy; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; + + +public class CppLocationStrategy extends HierarchyLocationStrategy { + + public static final String PKG_PREFIX = "Pkg_"; //$NON-NLS-1$ + + /** + * Return the filename for a given named element. + * + * @param element + * a named element + * @return filename for this element + */ + public String getFileName(NamedElement element) { + if (element instanceof Package) { + // specific prefix for packages + String folder = super.getFileName(element); + if (folder.length() > 0) { + folder += HierarchyLocationStrategy.SEP_CHAR; + } + return folder + PKG_PREFIX + element.getName(); + } + else return super.getFileName(element); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppModelElementsCreator.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppModelElementsCreator.java new file mode 100644 index 00000000000..ff974a517e5 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/transformation/CppModelElementsCreator.java @@ -0,0 +1,243 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2012 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.transformation; + +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.ToolFactory; +import org.eclipse.cdt.core.formatter.CodeFormatter; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.text.BadLocationException; +import org.eclipse.jface.text.Document; +import org.eclipse.jface.text.IDocument; +import org.eclipse.papyrus.C_Cpp.ExternLibrary; +import org.eclipse.papyrus.C_Cpp.External; +import org.eclipse.papyrus.C_Cpp.Include; +import org.eclipse.papyrus.C_Cpp.ManualGeneration; +import org.eclipse.papyrus.C_Cpp.NoCodeGen; +import org.eclipse.papyrus.C_Cpp.Template; +import org.eclipse.papyrus.codegen.base.GenUtils; +import org.eclipse.papyrus.codegen.base.IPFileSystemAccess; +import org.eclipse.papyrus.codegen.base.ModelElementsCreator; +import org.eclipse.papyrus.codegen.base.ProjectBasedFileAccess; +import org.eclipse.papyrus.cpp.codegen.Activator; +import org.eclipse.papyrus.cpp.codegen.Constants; +import org.eclipse.papyrus.cpp.codegen.Messages; +import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenUtils; +import org.eclipse.papyrus.cpp.codegen.xtend.CppClassifierGenerator; +import org.eclipse.papyrus.cpp.codegen.xtend.CppPackageHeaderGenerator; +import org.eclipse.text.edits.MalformedTreeException; +import org.eclipse.text.edits.TextEdit; +import org.eclipse.uml2.uml.Association; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Enumeration; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.PrimitiveType; +import org.eclipse.uml2.uml.Relationship; +import org.eclipse.uml2.uml.Signal; +import org.eclipse.uml2.uml.SignalEvent; +import org.eclipse.uml2.uml.Usage; +import org.eclipse.uml2.uml.util.UMLUtil; + + + +/** + * Main class of C++ code generator + * + * @author Ansgar Radermacher (ansgar.radermacher@cea.fr) + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +public class CppModelElementsCreator extends ModelElementsCreator { + + /** + * Constructor. + * + * @param project + * the project in which the generated code should be placed + */ + public CppModelElementsCreator(IProject project) { + this(new ProjectBasedFileAccess(project), null); + } + + /** + * Constructor, allows for non-standard commentHeader + * + * @param project + * the project in which the generated code should be placed + * @param commentHeader + * Custom prefix for each generated file + */ + public CppModelElementsCreator(IProject project, String commentHeader) { + this(new ProjectBasedFileAccess(project), commentHeader); + } + + /** + * Constructor. Pass caller defined file system access and commentHeader + * + * @param project + * the project in which the generated code should be placed + * @param commentHeader + * commentHeader. If null, take from preferences + */ + public CppModelElementsCreator(IPFileSystemAccess fileSystemAccess, String commentHeader) { + super(fileSystemAccess, new CppLocationStrategy()); + this.commentHeader = (commentHeader != null) ? + commentHeader : + CppCodeGenUtils.getCommentHeader(); + hppExt = CppCodeGenUtils.getHeaderSuffix(); + cppExt = CppCodeGenUtils.getBodySuffix(); + } + + protected String hppExt; + + protected String cppExt; + + protected String commentHeader; + + /** + * Creates the files corresponding to the class. For a "simple" class + * generates 2 headers (one for the privates concrete operations and one for + * the attributes, public operations and virtual / abstract operations and + * one body file. + * + * @param folder + * @param classifier + * @throws CoreException + */ + @Override + protected void createPackageableElementFile(PackageableElement element, IProgressMonitor monitor) { + if (element instanceof Package) { + generatePkg((Package) element); + } + + else if ((element instanceof PrimitiveType) || (element instanceof Enumeration) || (element instanceof Usage)) { + // do nothing, included in package + } + else if (element instanceof Classifier) { + generateClassifier((Classifier) element); + } + else if (element instanceof Relationship) { + // no code generation for relationships + } + else if (element instanceof Signal) { + // TODO: not supported, but do nothing + } + else if (element instanceof SignalEvent) { + // TODO: not supported, but do nothing + } + else { + Activator.log.debug("C++ code generator: unsupported model element " + element); //$NON-NLS-1$ + } + } + + protected void generateClassifier(Classifier classifier) { + + // treat case of manual code generation + if (GenUtils.hasStereotype(classifier, ManualGeneration.class)) { + final ManualGeneration mg = UMLUtil.getStereotypeApplication(classifier, ManualGeneration.class); + final Include cppInclude = UMLUtil.getStereotypeApplication(classifier, Include.class); + final String fileContentH = commentHeader + cppInclude.getHeader(); + + // generate header code + final String fileNameH = locStrategy.getFileName(classifier) + Constants.DOT + hppExt; + + generateFile(fileNameH, fileContentH); + + // generate body code + String fileContentB = commentHeader + + cppInclude.getPreBody() + GenUtils.NL + + cppInclude.getBody() + GenUtils.NL; + String ext = GenUtils.maskNull(mg.getExtensionBody()); + if (ext.length() == 0) { + ext = cppExt; + } + String fileNameB = locStrategy.getFileName(classifier) + Constants.DOT + ext; + generateFile(fileNameB, fileContentB); + } + + // Only generate when no CppNoCodeGen stereotype is applied to the class + else if ((!noCodeGen(classifier)) && (!GenUtils.hasStereotype(classifier, Template.class)) && + (!(classifier instanceof Association))) { + + // Template Bound Class + if (GenUtils.isTemplateBoundElement(classifier)) { + final String bindHeaderFileName = locStrategy.getFileName(classifier) + Constants.DOT + hppExt; + generateFile(bindHeaderFileName, commentHeader + CppClassifierGenerator.generateBindHeaderCode(classifier)); + + final String bindBodyFileName = locStrategy.getFileName(classifier) + Constants.DOT + cppExt; + generateFile(bindBodyFileName, commentHeader + CppClassifierGenerator.generateBindBodyCode(classifier)); + } + else { + // Class Header file generation + final String classHeaderFileName = locStrategy.getFileName(classifier) + Constants.DOT + hppExt; + generateFile(classHeaderFileName, commentHeader + CppClassifierGenerator.generateClassHeaderCode(classifier)); + + // Class Body file generation + if (classifier instanceof Class) { + final String classBodyFileName = locStrategy.getFileName(classifier) + Constants.DOT + cppExt; + generateFile(classBodyFileName, commentHeader + CppClassifierGenerator.generateClassBodyCode(classifier)); + } + } + } + } + + protected void generatePkg(Package pkg) { + final String fileName = locStrategy.getFileName(pkg) + Constants.DOT + hppExt; + generateFile(fileName, CppPackageHeaderGenerator.generateCode(pkg).toString()); + } + + protected void generateFile(String fileName, String content) { + fileSystemAccess.generateFile(fileName, format(content)); + } + + /** + * Apply the user's currently selected formatting options to the input content. Return the + * input String in case of error. + */ + private static String format(String content) { + + // do nothing if the CDT plugin is not loaded + if (Platform.getBundle(CCorePlugin.PLUGIN_ID) == null) + return content; + + CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(null); + IDocument doc = new Document(content); + + TextEdit edit = codeFormatter.format(CodeFormatter.K_TRANSLATION_UNIT, doc.get(), 0, doc.get().length(), 0, null); + + if (edit == null) { + Activator.log.debug(Messages.CppModelElementsCreator_CannotFormatContent); + return content; + } + + try { + edit.apply(doc); + return doc.get(); + } catch (MalformedTreeException e) { + Activator.log.error(e); + } catch (BadLocationException e) { + Activator.log.error(e); + } + return content; + } + + protected boolean noCodeGen(Element element) { + return GenUtils.hasStereotype(element, NoCodeGen.class) || + GenUtils.hasStereotype(element, External.class) || + GenUtils.hasStereotypeTree(element, ExternLibrary.class); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ClassUtils.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ClassUtils.java new file mode 100644 index 00000000000..7653753411f --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ClassUtils.java @@ -0,0 +1,81 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2012 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.utils; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.UniqueEList; +import org.eclipse.papyrus.codegen.base.GenUtils; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Operation; + +/** + * A set of utility functions related to classes. + * + * @author ansgar (ansgar.radermacher@cea.fr) + * + */ +public class ClassUtils { + + /** + * Calculate the list of classifiers that needs to be included + * + * @param currentClass + * @return + */ + public static EList includedClassifiers(Classifier currentClass) { + // Retrieve package used by current package (dependencies) + // use a unique list to avoid duplicates + EList usedClasses = new UniqueEList(); + + // class attributes dependencies + usedClasses.addAll(GenUtils.getOwnedAttributeTypes(currentClass)); + // operation parameters dependencies + usedClasses.addAll(GenUtils.getTypesViaOperations(currentClass)); + // inner classifier dependencies + usedClasses.addAll(GenUtils.getInnerClassifierTypes(currentClass)); + // realized interface dependencies + if (currentClass instanceof Class) { + Class clazz = (Class) currentClass; + EList implementedInterfaces = clazz.getImplementedInterfaces(); + usedClasses.addAll(implementedInterfaces); + } + // dependencies and associations + usedClasses.addAll(GenUtils.getTypesViaRelationshipsNoDeps(currentClass)); + + // template parameters are declared locally (if owned) and do not correspond to a file + // that can be included + usedClasses.removeAll(GenUtils.getTemplateParameteredElements(currentClass)); + return usedClasses; + } + + /** + * Retrieve the list of operations of classes nested in the current class + * without the operations directly owned by the current class + * + * @param currentClass + * @return + */ + public static EList nestedOperations(Classifier currentClass) { + EList nestedOperations = new UniqueEList(); + + for (Element element : currentClass.allOwnedElements()) { + if (element instanceof Operation && !(element.getOwner().equals(currentClass))) { + nestedOperations.add((Operation) element); + } + } + + return nestedOperations; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java new file mode 100644 index 00000000000..36043a363ad --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/CppGenUtils.java @@ -0,0 +1,351 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2013 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.utils; + +import java.util.Iterator; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.papyrus.C_Cpp.ExternLibrary; +import org.eclipse.papyrus.C_Cpp.External; +import org.eclipse.papyrus.C_Cpp.NoCodeGen; +import org.eclipse.papyrus.C_Cpp.Typedef; +import org.eclipse.papyrus.C_Cpp.Visibility; +import org.eclipse.papyrus.codegen.base.GenUtils; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.ClassifierTemplateParameter; +import org.eclipse.uml2.uml.ConnectableElementTemplateParameter; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.LiteralBoolean; +import org.eclipse.uml2.uml.LiteralInteger; +import org.eclipse.uml2.uml.LiteralString; +import org.eclipse.uml2.uml.LiteralUnlimitedNatural; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Namespace; +import org.eclipse.uml2.uml.OperationTemplateParameter; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.ParameterableElement; +import org.eclipse.uml2.uml.PrimitiveType; +import org.eclipse.uml2.uml.TemplateParameter; +import org.eclipse.uml2.uml.VisibilityKind; +import org.eclipse.uml2.uml.util.UMLUtil; + + + +/** + * Some utilities specific to C++ code generation: a set of static methods that is intended + * for use from Acceleo templates. + * + * @author wassim, ansgar + * + */ +public class CppGenUtils { + + public static final String ANSI_C_LIB = "AnsiCLibrary"; //$NON-NLS-1$ + + /** + * Return a list of template parameters without type + * + * @param classifier + * @return + */ + public static String getTemplateParametersWoType(Classifier classifier) { + String tparamWoType = ""; //$NON-NLS-1$ + + Iterator it = GenUtils.getTemplateParameters(classifier).iterator(); + + while (it.hasNext()) { + TemplateParameter currentTParam = it.next(); + tparamWoType = tparamWoType + GenUtils.getTemplateName(currentTParam); + + if (it.hasNext()) { + tparamWoType = tparamWoType + ", "; //$NON-NLS-1$ + } + } + return tparamWoType; + } + + /** + * The standard UML and MARTE libraries do not apply the stereotype "Typedef". Yet, we want to treat these + * types in an identical way, i.e. we use a typedef to the associated primitive C++ type + * + * @param type + * @return + */ + public static String getStdtypes(PrimitiveType type) { + Object owner = type.getOwner(); + String owningPkgName = ""; //$NON-NLS-1$ + if (owner instanceof Package) { + owningPkgName = ((Package) owner).getName(); + } + if (owningPkgName.equals("PrimitiveTypes") || // used in UML >= 2.4 //$NON-NLS-1$ + owningPkgName.equals("UMLPrimitiveTypes") || // used in UML < 2.4 //$NON-NLS-1$ + owningPkgName.equals("MARTE_PrimitivesTypes")) { //$NON-NLS-1$ + String td = null; + String name = type.getName(); + + if (name.equals("Boolean")) { //$NON-NLS-1$ + td = "bool"; //$NON-NLS-1$ + } + else if (name.equals("Integer")) { //$NON-NLS-1$ + td = "int"; //$NON-NLS-1$ + } + else if (name.equals("Unlimited Natural")) { //$NON-NLS-1$ + td = "unsigned long"; //$NON-NLS-1$ + } + else if (name.equals("Real")) { //$NON-NLS-1$ + td = "float"; //$NON-NLS-1$ + } + else if (name.equals("String")) { //$NON-NLS-1$ + td = "const char *"; //$NON-NLS-1$ + } + else if (name.equals("Unlimited Natural")) { //$NON-NLS-1$ + td = "unsigned long"; //$NON-NLS-1$ + } + if (td != null) { + return "typedef " + td + " " + name + ";"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } + // else unknown within UMLPrimitiveTypes, treat in standard way + } + + return ""; //$NON-NLS-1$ + } + + /** + * Return a kind of qualifiedName, except if + * - The named element has the stereotype External or NoCodeGen + * - The named element is part of the ANSI C library + * - The named element is a primitive type that has no further definition via a stereotype (TODO: why is this required/useful?) + * + * @param ne + * @return + */ + public static String cppQualifiedName(NamedElement ne) { + if (ne == null) { + return "undefined"; //$NON-NLS-1$ + } + Object owner = ne.getOwner(); + String owningPkgName = ""; //$NON-NLS-1$ + if (owner instanceof Package) { + owningPkgName = ((Package) owner).getName(); + } + if (GenUtils.hasStereotype(ne, External.class) || + GenUtils.hasStereotypeTree(ne, NoCodeGen.class) || + GenUtils.hasStereotypeTree(ne, ExternLibrary.class)) { + return ne.getName(); + } + else if (owningPkgName.equals(ANSI_C_LIB)) { + // always use the short name for types within the ANSI C library + return ne.getName(); + } + else if (owner instanceof ClassifierTemplateParameter) { + // return short name for template in Type + return ne.getName(); + } + + String qName = ne.getName(); + if (currentNS == ne.getNamespace()) { + // return simple name, if in current namespace + return qName; + } + if (ne instanceof PrimitiveType) { + if (!GenUtils.hasStereotype(ne, Typedef.class) && (getStdtypes((PrimitiveType) ne).length() == 0)) { + // is a primitive type without further definition and not a standard primitive type + // => assume that it is a external type without namespace + return qName; + } + } + + for (Namespace ns : ne.allNamespaces()) { + // don't add qualified name for specific top-level namespace "root". + // TODO: specific workaround for the way Qompass creates its target model. Needs to be removed. + if (!((ns.getOwner() == null) && ns.getName().equals("root"))) { //$NON-NLS-1$ + qName = ns.getName() + "::" + qName; //$NON-NLS-1$ + } + } + if (qName.contains("::")) { //$NON-NLS-1$ + // is a qualified name => make path absolute + return "::" + qName; //$NON-NLS-1$ + } else { + return qName; + } + } + + + /** + * Returns the string that is used within a C++ template declaration, e.g. the "Class XY" in template. + * + * @return the template type formated as string + */ + public static String getTemplateTypeName(TemplateParameter templateParam) { + String prefix = ""; //$NON-NLS-1$ + String name = ""; //$NON-NLS-1$ + + // Retrieve name of the ParameteredElement (when possible = it is a NamedElement + ParameterableElement pElt = templateParam.getParameteredElement(); + if ((pElt != null) && (pElt instanceof NamedElement)) { + name = ((NamedElement) pElt).getName(); + if (templateParam instanceof ClassifierTemplateParameter) { + // prefix name with "class" to indicate that the following type is a classifier + prefix = "class "; //$NON-NLS-1$ + } else if (templateParam instanceof OperationTemplateParameter) { + // no prefix + } else if (templateParam instanceof ConnectableElementTemplateParameter) { + // no prefix + } else {// uml2TemplateParameter instanceof TemplateParameter + // TODO: literal integer is a value specification, but we use the fact that is also a named element + // e.g. would produce an parameter and ignore the value behind (which is ok for the + // declaration of the template, but not for its use. + if (pElt instanceof LiteralInteger) { + prefix = "int "; //$NON-NLS-1$ + } else if (pElt instanceof LiteralString) { + prefix = "String "; //$NON-NLS-1$ + } else if (pElt instanceof LiteralBoolean) { + prefix = "Boolean "; //$NON-NLS-1$ + } else if (pElt instanceof LiteralUnlimitedNatural) { + prefix = "UnlimitedNatural "; //$NON-NLS-1$ + } else { + prefix = pElt.eClass().getName() + " "; //$NON-NLS-1$ + } + } + } else { + name = "undefined"; //$NON-NLS-1$ + } + + return (prefix + name); + } + + + /** + * Return a C++ namespace definition for a named element + * + * @param ne + * a named element + * @return a C++ namespace definition for a named element + */ + public static String getNamespace(NamedElement ne) { + String namespace = ""; //$NON-NLS-1$ + for (Namespace ns : ne.allNamespaces()) { + if (ns.getOwner() != null) { + String nsName = ns.getName(); + if (!namespace.equals("")) { //$NON-NLS-1$ + nsName += "::"; //$NON-NLS-1$ + } + namespace = nsName + namespace; + } + } + if (!namespace.equals("")) { //$NON-NLS-1$ + namespace = "\n" + "using namespace " + namespace + ";\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } + return namespace; + } + + /** + * Return a C++ open-namespace definition for a named element + * + * @param ne + * a named element + * @return a C++ open-namespace definition for a named element + */ + public static String openNS(NamedElement ne) { + String openNS = ""; //$NON-NLS-1$ + currentNS = ne.getNamespace(); + if (ne instanceof Package) { + openNS = "namespace " + ne.getName() + " {\n"; //$NON-NLS-1$ //$NON-NLS-2$ + } + for (Namespace ns : ne.allNamespaces()) { + if (ns.getOwner() != null) { // skip top-level package (useful?) + openNS = "namespace " + ns.getName() + " {\n" + openNS; //$NON-NLS-1$ //$NON-NLS-2$ + } + } + return openNS; + } + + + /** + * Return a C++ close-namespace definition for a named element + * + * @param ne + * a named element + * @return a C++ close-namespace definition for a named element + */ + public static String closeNS(NamedElement ne) { + String closeNS = ""; //$NON-NLS-1$ + if (ne instanceof Package) { + closeNS = "} // of namespace " + ne.getName() + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ + } + for (Namespace ns : ne.allNamespaces()) { + if (ns.getOwner() != null) { + closeNS += "} // of namespace " + ns.getName() + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ + } + } + return closeNS; + } + + + /** + * Return the C++ visibility (on generalizations) in text form. Return public, if no stereotype + * visibility exists + * + * @param element + * @return + */ + public static String getGeneralizationVisibility(Element element) { + // get visibility and target name + Visibility cppVisibility = UMLUtil.getStereotypeApplication(element, Visibility.class); + if (cppVisibility != null) { + return cppVisibility.getValue(); + } else { + return "public"; //$NON-NLS-1$ + } + } + + private static Namespace currentNS; + + private static VisibilityKind currVisibility = null; + private static final Pattern EmptySectionRegex = Pattern.compile("^\\s*$"); //$NON-NLS-1$ + + /** + * Update the current visibility to the specified value without writing this value to + * the output. This is to be used when setting the default visibility of a class/struct. + */ + public static void resetVisibility(VisibilityKind v) { + currVisibility = v; + } + + /** + * Create a section of code with the appropriate visibility. Merges the content with + * the previously declared visibility (if appropriate). Ignore empty content. + */ + public static String getSection(VisibilityKind visibility, String content) { + // Bug 425208: Don't update the visibility until we know for sure that it + // will be written to the output. + VisibilityKind newVisibility = null; + if (!visibility.equals(currVisibility)) { + newVisibility = visibility; + } + + // Filter out empty sections. + Matcher m = EmptySectionRegex.matcher(content); + if (content.isEmpty() || m.matches()) { + return ""; //$NON-NLS-1$ + } + + // Don't write duplicate visibility modifiers. + if (newVisibility == null) { + return content; + } + + currVisibility = newVisibility; + return currVisibility.toString() + ":\n" + content; //$NON-NLS-1$ + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ILocateCppProject.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ILocateCppProject.java new file mode 100644 index 00000000000..2cdb5d6d945 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/ILocateCppProject.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2013 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.utils; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.uml2.uml.PackageableElement; + +public interface ILocateCppProject { + + /** + * Locate and return the target project for the given packageable element. Return null if + * no target project can be found. + * + * Ensures that the target project is correctly setup to contain generated C/C++ code. Does + * not create a new project, but may modify existing ones. + * + * @param pe + * a packageable element within a model + * @param createIfMissing + * if true, ask the user to apply the C++ nature if required. + * @return the associated project, if the C++ nature is applied. + */ + public IProject getTargetProject(PackageableElement pe, boolean createIfMissing); + + public IFile getTargetFile(); +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/LocateCppProject.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/LocateCppProject.java new file mode 100644 index 00000000000..fad9e7249b4 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/LocateCppProject.java @@ -0,0 +1,130 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2013 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.utils; + +import org.eclipse.cdt.core.CCProjectNature; +import org.eclipse.cdt.core.CProjectNature; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; +import org.eclipse.papyrus.codegen.extensionpoints.LanguageProjectSupport; +import org.eclipse.papyrus.cpp.codegen.Activator; +import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenConstants; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.swt.widgets.Display; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; + +public class LocateCppProject { + public static final String LANGUAGE_NAME = "C++"; //$NON-NLS-1$ + + private static final boolean Headless = Boolean.getBoolean("papyrus.run-headless"); //$NON-NLS-1$ + + /** + * Locate and return the target project for the given packageable element. Return null if + * no target project can be found. + * + * Ensures that the target project is correctly setup to contain generated C/C++ code. Does + * not create a new project, but may modify existing ones. + * + * @param pe + * a packageable element within a model + * @param createIfMissing + * if true, ask the user to apply the C++ nature if required. + * @return the associated project, if the C++ nature is applied. + */ + public static IProject getTargetProject(PackageableElement pe, boolean createIfMissing) { + Package rootPkg = PackageUtil.getRootPackage(pe); + + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + String prefix = store != null ? store.getString(CppCodeGenConstants.P_PROJECT_PREFIX) : "bad preferences."; //$NON-NLS-1$ + String projectName = prefix + rootPkg.getName(); + IProject modelProject = root.getProject(projectName); + if (!modelProject.exists()) { + if (Headless) + { + try { + modelProject.create(null); + } catch (CoreException e) { + return null; + } + } + else + { + boolean create = createIfMissing && openQuestion( + Messages.LocateCppProject_CreateTargetProjectTitle, + String.format(Messages.LocateCppProject_CreateTargetProjectDesc, projectName)); + if (create) { + ILangProjectSupport langSupport = LanguageProjectSupport.getProjectSupport(LANGUAGE_NAME); + if (langSupport != null) { + modelProject = langSupport.createProject(projectName); + langSupport.setSettings(modelProject, langSupport.initialConfigurationData()); + if (modelProject == null) { + return null; + } + } + else { + return null; + } + } + else { + return null; + } + } + } + + // Make sure the target project is open. If it was just created then it is likely open, + // however if it is an old project then it could have been closed. + if (!modelProject.isOpen()) { + try { + modelProject.open(null); + } catch (CoreException e) { + return null; + } + } + + // Make sure the target project has the C and C++ build natures. + try { + if (!modelProject.hasNature(CCProjectNature.CC_NATURE_ID)) { + boolean apply = createIfMissing && (Headless || openQuestion( + Messages.LocateCppProject_ApplyCNatureTitle, + Messages.LocateCppProject_ApplyCNatureDesc)); + if (!apply) { + return null; + } + CProjectNature.addCNature(modelProject, null); + CCProjectNature.addCCNature(modelProject, null); + } + } catch (CoreException e) { + Activator.log.error(e); + } + return modelProject; + } + + private static boolean openQuestion(final String title, final String message) + { + final boolean[] ret = new boolean[] { false }; + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + ret[0] = MessageDialog.openQuestion(Display.getCurrent().getActiveShell(), title, message); + } + }); + return ret[0]; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Messages.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Messages.java new file mode 100644 index 00000000000..aa1c639f0c9 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Messages.java @@ -0,0 +1,18 @@ +package org.eclipse.papyrus.cpp.codegen.utils; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.cpp.codegen.utils.messages"; //$NON-NLS-1$ + public static String LocateCppProject_ApplyCNatureTitle; + public static String LocateCppProject_ApplyCNatureDesc; + public static String LocateCppProject_CreateTargetProjectTitle; + public static String LocateCppProject_CreateTargetProjectDesc; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.java new file mode 100644 index 00000000000..a55f4f6c0a0 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/Modifier.java @@ -0,0 +1,189 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2012 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.utils; + +import org.eclipse.papyrus.C_Cpp.Array; +import org.eclipse.papyrus.C_Cpp.Const; +import org.eclipse.papyrus.C_Cpp.Mutable; +import org.eclipse.papyrus.C_Cpp.Ptr; +import org.eclipse.papyrus.C_Cpp.Ref; +import org.eclipse.papyrus.C_Cpp.StorageClass; +import org.eclipse.papyrus.C_Cpp.Volatile; +import org.eclipse.papyrus.codegen.base.GenUtils; +import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenUtils; +import org.eclipse.uml2.uml.AggregationKind; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.MultiplicityElement; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.ParameterDirectionKind; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Utility functions managing the "modifier" of an element, i.e. additional + * information whether a passed parameter or an attribute is a pointer, a + * reference, an array or constant. + * + * @author ansgar + * + */ +public class Modifier { + + public static String modPtr(Element propertyOrParameter) { + // Pointer + String ptr = ""; //$NON-NLS-1$ + Ptr cppPtr = UMLUtil.getStereotypeApplication(propertyOrParameter, Ptr.class); + if (cppPtr != null) { + ptr = (cppPtr.getDeclaration() != null) ? cppPtr.getDeclaration() : "*"; //$NON-NLS-1$ + } else { + ptr = ""; //$NON-NLS-1$ + } + if (propertyOrParameter instanceof Property) { + if (((Property) propertyOrParameter).getAggregation() == AggregationKind.SHARED_LITERAL) { + ptr += "*"; //$NON-NLS-1$ + } + } + boolean ptrOrRef = GenUtils.hasStereotype(propertyOrParameter, Ref.class) + || GenUtils.hasStereotype(propertyOrParameter, Ptr.class); + + // out and inout parameter are realized by means of a pointer + if (propertyOrParameter instanceof Parameter) { + ParameterDirectionKind directionKind = ((Parameter) propertyOrParameter).getDirection(); + if (directionKind == ParameterDirectionKind.OUT_LITERAL || directionKind == ParameterDirectionKind.INOUT_LITERAL) { + // parameter is an out or inout parameter. If the user already either a pointer or reference, use this. + if (!ptrOrRef) { + // .. otherwise add the oeprator from the preferences + ptr += CppCodeGenUtils.getOutInoutOp(); + } + } + } + return ptr; + } + + public static String modRef(Element propertyOrParameter) { + // Ref + return GenUtils.hasStereotype(propertyOrParameter, Ref.class) ? "&" : ""; //$NON-NLS-1$ //$NON-NLS-2$ + } + + public static String modArray(Element propertyOrParameter) { + // Array + Array cppArray = UMLUtil.getStereotypeApplication(propertyOrParameter, Array.class); + String array = ""; //$NON-NLS-1$ + if (cppArray != null) { + // explicit array definition + array = (cppArray.getDefinition() != null) ? cppArray.getDefinition() : "[]"; //$NON-NLS-1$ + } else { + // calculate array from multiplicity definition + int multiplicity = 1; + if (propertyOrParameter instanceof MultiplicityElement) { + multiplicity = ((MultiplicityElement) propertyOrParameter).getUpper(); + } + array = ""; //$NON-NLS-1$ + if (multiplicity == -1) { + array = "[]"; //$NON-NLS-1$ + } else if (multiplicity > 1) { + array = "[" + multiplicity + "]"; //$NON-NLS-1$ //$NON-NLS-2$ + } + } + return array; + } + + /** + * return modifier for const and volatile + * @param propertyOrParameter + * @return + */ + public static String modCVQualifier(Element propertyOrParameter) { + String cvQualifier = ""; //$NON-NLS-1$ + // CVQualifiers cannot be used with static functions + if (propertyOrParameter instanceof Operation && ((Operation) propertyOrParameter).isStatic()) { + // do nothing + } + // Const + else if (GenUtils.hasStereotype(propertyOrParameter, Const.class)) { + // Volatile with const + if (GenUtils.hasStereotype(propertyOrParameter, Volatile.class)) { + cvQualifier = (propertyOrParameter instanceof Operation) ? " const volatile" //$NON-NLS-1$ + : // added at the end of operation, prefix with " " + "const volatile "; // before operation or //$NON-NLS-1$ + // parameter, postfix with " " + } + // Const without Volatile + else { + cvQualifier = (propertyOrParameter instanceof Operation) ? " const" //$NON-NLS-1$ + : // added at the end of operation, prefix with " " + "const "; // before operation or //$NON-NLS-1$ + // parameter, postfix with " " + } + } + // Volatile without const + else if (GenUtils.hasStereotype(propertyOrParameter, Volatile.class)) { + cvQualifier = (propertyOrParameter instanceof Operation) ? " volatile" //$NON-NLS-1$ + : // added at the end of operation, prefix with " " + "volatile "; // before operation or parameter, //$NON-NLS-1$ + // postfix with " " + } + + // Mutable (non-static attribute only) + if (GenUtils.hasStereotype(propertyOrParameter, Mutable.class)) { + if (propertyOrParameter instanceof Property && !((Property) propertyOrParameter).isStatic()) { + cvQualifier = "mutable " + cvQualifier; + } + } + + return cvQualifier; + } + + /** + * return modifier for storage class + * @param propertyOrParameter + * @return + */ + public static String modSCQualifier(Element propertyOrParameter) { + StorageClass sc = UMLUtil.getStereotypeApplication(propertyOrParameter, StorageClass.class); + if (sc != null) { + return sc.getStorageClass().getLiteral() + " "; //$NON-NLS-1$ + } + return ""; //$NON-NLS-1$ + } + + /** + * Return inform about the direction of a parameter in form of a comment + * + * @param propertyOperationOrParameter + * @return + */ + public static String dirInfo(Element propertyOperationOrParameter) { + if (propertyOperationOrParameter instanceof Parameter) { + ParameterDirectionKind directionKind = ((Parameter) propertyOperationOrParameter).getDirection(); + if (directionKind == ParameterDirectionKind.IN_LITERAL) { + return " /*in*/"; //$NON-NLS-1$ + } else if (directionKind == ParameterDirectionKind.OUT_LITERAL) { + return " /*out*/"; //$NON-NLS-1$ + } else if (directionKind == ParameterDirectionKind.INOUT_LITERAL) { + return " /*inout*/"; //$NON-NLS-1$ + } + } + return ""; //$NON-NLS-1$ + } + + /** + * initialize the ptr/ref/array/isConst attributes. + * + * @param propertyOperationOrParameter + */ + public static void update(Element propertyOperationOrParameter) { + + + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/messages.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/messages.properties new file mode 100644 index 00000000000..617270b5e1e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/utils/messages.properties @@ -0,0 +1,4 @@ +LocateCppProject_ApplyCNatureTitle=Need to apply C++ nature +LocateCppProject_ApplyCNatureDesc=Code generation requires that the underlying project has a C++ nature. Do you want to apply this nature? +LocateCppProject_CreateTargetProjectDesc=Code generation needs to create a CDT project called "%s". Do you want to do this? +LocateCppProject_CreateTargetProjectTitle=Target project does not exist diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppAttribute.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppAttribute.xtend new file mode 100644 index 00000000000..9324fe993b2 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppAttribute.xtend @@ -0,0 +1,92 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.uml2.uml.Classifier +import org.eclipse.uml2.uml.Class +import org.eclipse.uml2.uml.DataType +import org.eclipse.uml2.uml.Interface +import org.eclipse.uml2.uml.Signal +import org.eclipse.uml2.uml.Property +import org.eclipse.papyrus.codegen.base.GenUtils +import org.eclipse.papyrus.C_Cpp.Const +import org.eclipse.papyrus.cpp.codegen.utils.Modifier +import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils +import org.eclipse.papyrus.C_Cpp.Mutable + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppAttribute { + + // Loop over attributes. Check that the attribute is not a static const. + // Constant static attributes are declared within the class declaration + static def CppStaticAttributes(Classifier classifier) { + var code = ''' + // static attributes (if any) + «FOR ownedAttribute : getOwnedAttributes(classifier)» + «IF (ownedAttribute.isStatic)» + «CppStaticAttributeImplementation(ownedAttribute)» + «ENDIF» + «ENDFOR» + ''' + return code + } + + // return a list of owned attributes, empty set, if null + static def getOwnedAttributes(Classifier cl) { + val attributes = getOwnedAttributesWNull(cl) + if (attributes == null) { + emptySet + } + else { + attributes + } + } + + // return a list of owned attributes, since this is not supported directly on a classifier + static def getOwnedAttributesWNull(Classifier cl) { + if (cl instanceof Class) { + (cl as Class).ownedAttributes + } else if (cl instanceof DataType) { + (cl as DataType).ownedAttributes + } else if (cl instanceof Interface) { + (cl as Interface).ownedAttributes + } else if (cl instanceof Signal) { + (cl as Signal).ownedAttributes + } else { + //Sequence{} + } + } + + static def CppStaticAttributeImplementation(Property attribute) ''' + «CppDocumentation.CppElementDoc(attribute)» + «Modifier.modCVQualifier(attribute)» «CppGenUtils.cppQualifiedName(attribute.type)»«Modifier.modPtr(attribute)»«Modifier.modRef(attribute)» «attribute.class_.name»::«attribute.name»«Modifier.modArray(attribute)»«defaultValue(attribute)»; + ''' + + static def defaultValue(Property attribute) { + if ((attribute.defaultValue != null) && attribute.isStatic) { + "=" + attribute.defaultValue.stringValue() + } + } + + static def CppAttributeDeclaration(Property attribute) ''' + «CppDocumentation.CppElementDoc(attribute)» + «staticValue(attribute)» «Modifier.modCVQualifier(attribute)»«CppGenUtils.cppQualifiedName(attribute.type)»«Modifier. + modPtr(attribute)»«Modifier.modRef(attribute)» «attribute.name»«Modifier.modArray(attribute)»; + ''' + + static def staticValue(Property attribute) { + if (attribute.isStatic) 'static' + } + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassAttributesDeclaration.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassAttributesDeclaration.xtend new file mode 100644 index 00000000000..06990f4229b --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassAttributesDeclaration.xtend @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.uml2.uml.Classifier +import org.eclipse.uml2.uml.VisibilityKind + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppClassAttributesDeclaration { + static def CppClassAttributesDeclaration(Classifier clazz, VisibilityKind visibilityFilter) ''' + «FOR oa : CppAttribute.getOwnedAttributes(clazz).filter[it.visibility == visibilityFilter]» + «CppAttribute.CppAttributeDeclaration(oa)» + «ENDFOR» + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassFriendDeclaration.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassFriendDeclaration.xtend new file mode 100644 index 00000000000..eafcc2b3cc7 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassFriendDeclaration.xtend @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.uml2.uml.Classifier +import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils +import org.eclipse.papyrus.C_Cpp.Friend +import org.eclipse.papyrus.C_Cpp.NoCodeGen +import org.eclipse.papyrus.codegen.base.GenUtils + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppClassFriendDeclaration { + static def CppClassFriendDeclaration(Classifier friend) ''' + friend class «CppGenUtils.cppQualifiedName(friend)» + ''' + + static def CppClassIncludeFriendDeclaration(Classifier clazz) { + for (uc : GenUtils.getUsedClassifiers(clazz)) { + if (GenUtils.hasStereotype(uc, Friend) && (!GenUtils.hasStereotype(uc, NoCodeGen))) { + CppClassFriendDeclaration(uc) + } + } + } +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeClassDeclaration.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeClassDeclaration.xtend new file mode 100644 index 00000000000..ab952f290cb --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeClassDeclaration.xtend @@ -0,0 +1,69 @@ +package org.eclipse.papyrus.cpp.codegen.xtend + +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + import org.eclipse.papyrus.C_Cpp.CppRoot +import org.eclipse.uml2.uml.Package +import org.eclipse.uml2.uml.Classifier +import org.eclipse.emf.common.util.EList +import org.eclipse.papyrus.C_Cpp.NoCodeGen +import org.eclipse.papyrus.C_Cpp.External +import org.eclipse.uml2.uml.Enumeration +import org.eclipse.uml2.uml.PrimitiveType +import java.util.List +import java.util.ArrayList +import org.eclipse.papyrus.cpp.codegen.utils.ClassUtils +import org.eclipse.papyrus.codegen.base.GenUtils + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppClassIncludeClassDeclaration { + + static def cppOwnerPackageIncludePath(Package pkg) { + if ((pkg != null) && (!GenUtils.hasStereotype(pkg, CppRoot))) { + return GenUtils.getFullPath(pkg) + '/Pkg_' + pkg.name + '.h' + } else { + return null + } + } + + static def CppClassAllIncludesDeclarationBody(Classifier classifier) { + cppClassAllIncludes(classifier, GenUtils.getTypesViaDependencies(classifier)) + } + + static def cppClassAllIncludes(Classifier classifier, EList list) { + var List newList = new ArrayList() + for (cl : list) { + //var String str = null + if ((cl != classifier) && (!GenUtils.hasStereotype(cl, NoCodeGen)) || (GenUtils.hasStereotype(cl, External))) { + if ((cl instanceof Enumeration) || (cl instanceof PrimitiveType)) { + if ((cl.owner != null) && (cl.owner instanceof Package)) { + var includePath = (cl.owner as Package).cppOwnerPackageIncludePath + if (!newList.contains(includePath)) newList.add(includePath) + } else { + //str = null + } + } else { + newList.addAll(CppClassIncludeDeclaration.cppClassIncludes(cl)) + } + } else { + //str = null + } + } + return newList.filter[str | str != null] + } + + static def CppClassAllIncludes(Classifier clazz) { + cppClassAllIncludes(clazz, ClassUtils.includedClassifiers(clazz)) + } +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeDeclaration.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeDeclaration.xtend new file mode 100644 index 00000000000..a07a939e125 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassIncludeDeclaration.xtend @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import java.util.ArrayList +import java.util.List +import org.eclipse.papyrus.C_Cpp.ExternLibrary +import org.eclipse.papyrus.C_Cpp.External +import org.eclipse.papyrus.C_Cpp.Template +import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenUtils +import org.eclipse.uml2.uml.NamedElement +import org.eclipse.uml2.uml.util.UMLUtil +import org.eclipse.papyrus.codegen.base.GenUtils + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppClassIncludeDeclaration { + + static def cppClassIncludes(NamedElement ne) { + var List result = new ArrayList() + if (GenUtils.hasStereotypeTree(ne, ExternLibrary)) { + result = GenUtils.getApplicationTree(ne, ExternLibrary).includes + } else { + result.add(includeName(ne)) + } + return result + } + + static def includeName(NamedElement ne) { + if (GenUtils.hasStereotypeTree(ne, Template)) { + return UMLUtil.getStereotypeApplication(ne, Template).declaration + } else { + if (GenUtils.hasStereotypeTree(ne, External)) { + return UMLUtil.getStereotypeApplication(ne, External).name + } else { + // standard case (no stereotypes are applied) + return GenUtils.getFullPath(ne.nearestPackage) + '/' + ne.name + '.' + CppCodeGenUtils.getHeaderSuffix() + } + } + } +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassInheritedDeclarations.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassInheritedDeclarations.xtend new file mode 100644 index 00000000000..b6b81c0c5a9 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassInheritedDeclarations.xtend @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.papyrus.C_Cpp.NoCodeGen +import org.eclipse.papyrus.C_Cpp.Visibility +import org.eclipse.uml2.uml.Classifier +import org.eclipse.uml2.uml.Generalization +import org.eclipse.uml2.uml.InterfaceRealization +import org.eclipse.uml2.uml.Relationship +import org.eclipse.uml2.uml.util.UMLUtil +import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils +import org.eclipse.papyrus.codegen.base.GenUtils + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppClassInheritedDeclarations { + + static def CppClassInheritedDeclarations(Classifier clazz) ''' + «IF (filteredRelationships(clazz).length > 0)» : «ENDIF» + «FOR fr: filteredRelationships(clazz) SEPARATOR ', \n'» + «getCppVisibility(fr)» «CppGenUtils.cppQualifiedName(fr.targets.get(0) as Classifier)»«ENDFOR» + ''' + + //Return a list of relationships that are either Generalizations or InterfaceRealiazations + //and the target does not point to a classifier that has the no-code-gen Stereotype + //TODO: not sure if it makes sense NOT to declare an inheritance, since we do not generate code. + static def filteredRelationships(Classifier clazz) { + clazz.sourceDirectedRelationships.filter[((it instanceof Generalization) || (it instanceof InterfaceRealization)) && + (it.targets.size > 0) && (!GenUtils.hasStereotype(it.targets.get(0), NoCodeGen)) + ] + } + + static def getCppVisibility(Relationship relationship) { + if (GenUtils.hasStereotype(relationship, Visibility)) { + (UMLUtil.getStereotypeApplication(relationship, Visibility) as Visibility).value + } else { + 'public' + } + } +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsDeclaration.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsDeclaration.xtend new file mode 100644 index 00000000000..e41bb495982 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsDeclaration.xtend @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.uml2.uml.Classifier +import org.eclipse.uml2.uml.OpaqueBehavior +import org.eclipse.uml2.uml.VisibilityKind + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppClassOperationsDeclaration { + + static def CppClassOperationsDeclaration(Classifier clazz, VisibilityKind visibilityFilter) ''' + «FOR op : CppOperations.getOwnedOperations(clazz).filter[it.visibility == visibilityFilter]» + + «CppOperations.CppOperationDeclaration(op)» + «ENDFOR» + «FOR b : clazz.eAllContents.toList.filter(OpaqueBehavior).filter[it.visibility == visibilityFilter]» + «IF b.specification == null» + + // opaque behavior without specification (typically from state machine) + «CppOperations.CppBehaviorDeclaration(b)» + «ENDIF» + «ENDFOR» + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsImplementation.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsImplementation.xtend new file mode 100644 index 00000000000..091d40b4f93 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassOperationsImplementation.xtend @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.uml2.uml.Classifier +import org.eclipse.papyrus.C_Cpp.NoCodeGen +import org.eclipse.uml2.uml.OpaqueBehavior +import org.eclipse.papyrus.C_Cpp.Inline +import org.eclipse.papyrus.codegen.base.GenUtils + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppClassOperationsImplementation { + + // implementations of a classifier, parameter controls whether only inline (or only not inline) operations + //are produced + static def CppClassOperationsImplementation(Classifier clazz, boolean inline) ''' + «FOR ownedOperation : CppOperations.getOwnedOperations(clazz).filter[(!(GenUtils.hasStereotype(it, NoCodeGen) || it.isAbstract)) && (GenUtils.hasStereotype(it, org.eclipse.papyrus.C_Cpp.Inline) == inline)] SEPARATOR "\n"» + «CppOperations.CppOperationImplementation(ownedOperation)» + «ENDFOR» + + «FOR nestedOperation : CppOperations.getNestedOperations(clazz).filter[(!(GenUtils.hasStereotype(it, NoCodeGen) || it.isAbstract)) && (GenUtils.hasStereotype(it, org.eclipse.papyrus.C_Cpp.Inline) == inline)] SEPARATOR "\n"» + «CppOperations.CppOperationImplementation(nestedOperation)» + «ENDFOR» + + «FOR b : clazz.eAllContents.toIterable.filter[(it instanceof OpaqueBehavior) && GenUtils.hasStereotype((it as OpaqueBehavior), Inline)==inline]» + «IF (b as OpaqueBehavior).specification == null» + // opaque behavior without specification (typically from state machine) + «CppOperations.CppBehaviorImplementation(b as OpaqueBehavior)» + «ENDIF» + «ENDFOR» + ''' + +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassTypeAndEnum.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassTypeAndEnum.xtend new file mode 100644 index 00000000000..65b23596901 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassTypeAndEnum.xtend @@ -0,0 +1,72 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.papyrus.C_Cpp.NoCodeGen +import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils +import org.eclipse.uml2.uml.Classifier +import org.eclipse.uml2.uml.Element +import org.eclipse.uml2.uml.Enumeration +import org.eclipse.uml2.uml.Namespace +import org.eclipse.uml2.uml.Package +import org.eclipse.uml2.uml.PrimitiveType +import org.eclipse.uml2.uml.VisibilityKind +import org.eclipse.papyrus.codegen.base.GenUtils +import org.eclipse.uml2.uml.DataType +import org.eclipse.uml2.uml.UMLFactory + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppClassTypeAndEnum { + + static def CppClassTypeAndEnum(Classifier clazz) ''' + «var publicStr = TypesAndEnumsForVisibility(clazz, VisibilityKind.PUBLIC_LITERAL).toString» + «CppGenUtils.getSection(VisibilityKind.PUBLIC_LITERAL, publicStr)» + «var protectedStr = TypesAndEnumsForVisibility(clazz, VisibilityKind.PROTECTED_LITERAL).toString» + «CppGenUtils.getSection(VisibilityKind.PROTECTED_LITERAL, protectedStr)» + «var privateStr = TypesAndEnumsForVisibility(clazz, VisibilityKind.PRIVATE_LITERAL).toString» + «CppGenUtils.getSection(VisibilityKind.PRIVATE_LITERAL, privateStr)» + ''' + + static def CppClassTypeAndEnumPackage(Package pkg) { + TypesAndEnumsForVisibility(pkg, VisibilityKind.get(VisibilityKind.PACKAGE)) + TypesAndEnumsForVisibility(pkg, VisibilityKind.get(VisibilityKind.PUBLIC)) + } + + static def TypesAndEnumsForVisibility(Namespace ne, VisibilityKind visibilityFilter) ''' + «FOR ownedElement : ne.ownedElements» + «TypeAndEnumForVisibility(ownedElement, visibilityFilter)» + «ENDFOR» + ''' + + static def TypeAndEnumForVisibility(Element element, VisibilityKind visibilityFilter) { + if ((!GenUtils.hasStereotype(element, NoCodeGen)) && (element instanceof Classifier)) { + var elementVisibility = (element as Classifier).visibility + var value = elementVisibility.value + if ((value == visibilityFilter.value)) { + if (element instanceof Enumeration) { + return CppEnumerations.CppEnumerationDefinition(element as Enumeration) + } else if (element instanceof PrimitiveType) { + return CppPrimitiveTypes.CppPrimitiveTypeDefinition(element as PrimitiveType) + } else if ((element instanceof DataType || element.eClass.equals(UMLFactory.eINSTANCE.getUMLPackage().getClass_())) && !(element.owner instanceof Package)) { + if (GenUtils.isTemplateBoundElement(element as Classifier)) { + return CppInnerClassifiers.CppInnerBindDefinition(element as Classifier) + } else { + return CppInnerClassifiers.CppInnerClassDefinition(element as Classifier) + } + + } + } + } + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassifierGenerator.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassifierGenerator.xtend new file mode 100644 index 00000000000..41af9c68a4b --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppClassifierGenerator.xtend @@ -0,0 +1,253 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.papyrus.C_Cpp.Union +import org.eclipse.papyrus.codegen.base.GenUtils +import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenUtils +import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils +import org.eclipse.uml2.uml.Classifier +import org.eclipse.uml2.uml.DataType +import org.eclipse.uml2.uml.NamedElement +import org.eclipse.uml2.uml.VisibilityKind +import org.eclipse.uml2.uml.profile.standard.Create + +/** + * @author Ansgar Radermacher (ansgar.radermacher@cea.fr) + */ +class CppClassifierGenerator { + + static def generateBindHeaderCode(Classifier classifier) ''' + #ifndef «GenUtils.getFullNameUC(classifier)»_H + #define «GenUtils.getFullNameUC(classifier)»_H + + /************************************************************ + «classifier.name» template binding header + ************************************************************/ + + «CppIncludeUtil.includeDirective(CppClassIncludeClassDeclaration.cppOwnerPackageIncludePath(classifier.package))» + + «FOR path : getSortedIncludePathList(classifier)» + «CppIncludeUtil.includeDirective(path)» + «ENDFOR» + + «CppIncludeUtil.CppIncludeHeader(classifier)» + + «var tb = GenUtils.getTemplateBinding(classifier)» + «var templateElement = tb.targets.get(0)» + «CppIncludeUtil.includeDirective( + GenUtils.getFullPath(classifier.package) + '/' + (templateElement.owner as NamedElement).name + '.' + + CppCodeGenUtils.getHeaderSuffix())» + + «CppGenUtils.openNS(classifier)» + /************************************************************/ + typedef «(templateElement.owner as NamedElement).name»<«FOR ps : tb.parameterSubstitutions SEPARATOR ', '»« + CppTemplates.CppTemplateBindingParameter(ps)»«ENDFOR»> «classifier.name»; + + «CppGenUtils.closeNS(classifier)» + + /************************************************************ + End of «classifier.name» template binding header + ************************************************************/ + + #endif + ''' + + static def getSortedIncludePathList(Classifier classifier) { + var includePathList = CppClassIncludeClassDeclaration.CppClassAllIncludes(classifier).sort; + return includePathList + } + + static def generateBindBodyCode(Classifier classifier) ''' + #define «GenUtils.getFullNameUC(classifier)»_BODY + + /************************************************************ + «classifier.name» template binding body + ************************************************************/ + + «CppIncludeUtil.CppIncludePreBody(classifier)» + + // include associated header file + «CppIncludeUtil.includeDirective( + GenUtils.getFullPath(classifier.package) + '/' + classifier.name + '.' + CppCodeGenUtils.getHeaderSuffix())» + + «CppIncludeUtil.CppIncludeBody(classifier)» + + «CppGenUtils.openNS(classifier)» + + // Derived includes directives + «FOR path : CppClassIncludeClassDeclaration.CppClassAllIncludes(classifier).sort» + «CppIncludeUtil.includeDirective(path)» + «ENDFOR» + + /************************************************************/ + «var tb = GenUtils.getTemplateBinding(classifier)» + «var templateElement = tb.targets.get(0)» + template class «(templateElement.owner as NamedElement).name»<«FOR ps : tb.parameterSubstitutions SEPARATOR ', '»« + CppTemplates.CppTemplateBindingParameter(ps)»«ENDFOR»>; + + «CppGenUtils.closeNS(classifier)» + + /************************************************************ + End of «classifier.name» template binding body + ************************************************************/ + ''' + + static def generateClassHeaderCode(Classifier classifier) ''' + #ifndef «GenUtils.getFullNameUC(classifier)»_H + #define «GenUtils.getFullNameUC(classifier)»_H + + /************************************************************ + «classifier.name» class header + ************************************************************/ + + «CppIncludeUtil.includeDirective(CppClassIncludeClassDeclaration.cppOwnerPackageIncludePath(classifier.package))» + + «FOR path : getSortedIncludePathList(classifier)» + «CppIncludeUtil.includeDirective(path)» + «ENDFOR» + + «CppIncludeUtil.CppIncludeHeader(classifier)» + + «CppGenUtils.openNS(classifier)» + + /************************************************************/ + «CppDocumentation.CppElementDoc(classifier)» + «CppTemplates.templateSignature(classifier)»«classUnionOrStruct(classifier)» «classifier.name»«CppClassInheritedDeclarations. + CppClassInheritedDeclarations(classifier)» { + «CppClassFriendDeclaration.CppClassIncludeFriendDeclaration(classifier)»«CppClassTypeAndEnum.CppClassTypeAndEnum(classifier)» + «var publicVisibility = VisibilityKind.PUBLIC_LITERAL» + «CppGenUtils.getSection(publicVisibility, defaultInitializer(classifier))» + «CppGenUtils.getSection(publicVisibility, + CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, publicVisibility).toString)» + «CppGenUtils.getSection(publicVisibility, + CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, publicVisibility).toString)» + + «var protectedVisibility = VisibilityKind.PROTECTED_LITERAL» + «CppGenUtils.getSection(protectedVisibility, + CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, protectedVisibility).toString)» + «CppGenUtils.getSection(protectedVisibility, + CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, protectedVisibility).toString)» + + «var privateVisibility = VisibilityKind.PRIVATE_LITERAL» + «CppGenUtils.getSection(privateVisibility, + CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, privateVisibility).toString)» + «CppGenUtils.getSection(privateVisibility, + CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, privateVisibility).toString)» + }; + /************************************************************/ + /* External declarations (package visibility) */ + «var packageVisibility = VisibilityKind.PACKAGE_LITERAL» + «CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, packageVisibility)» + «CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, packageVisibility)» + /************************************************************/ + + «IF CppTemplates.isTemplate(classifier)» + /************************************************************/ + /* Template functions */ + «CppClassOperationsImplementation.CppClassOperationsImplementation(classifier, false)» + «ENDIF» + + /* Inline functions */ + «CppClassOperationsImplementation.CppClassOperationsImplementation(classifier, true)» + «CppGenUtils.closeNS(classifier)» + + /************************************************************ + End of «classifier.name» class header + ************************************************************/ + + #endif + ''' + + static def classUnionOrStruct(Classifier classifier) { + if (GenUtils.hasStereotype(classifier, Union)) { + return 'union' + } else { + if (classifier instanceof DataType) { + CppGenUtils.resetVisibility(VisibilityKind.PUBLIC_LITERAL) + return 'struct' + } else { + CppGenUtils.resetVisibility(VisibilityKind.PRIVATE_LITERAL) + return 'class' + } + } + } + + /** + * default initializer for non-static attributes with a default value TODO: should be disabled by default, since non-static members can be initialized directly in C++ 011 + */ + static def defaultInitializer(Classifier classifier) { + + /* Bug 422373: The default initializer should not be generated if there are any user-defined + constructors. In plain C++ code, the existence of a constructor with parameters + means that the compiler will not synthesize a default one. + + E.g., this would be invalid in plain C++ code: + class T1 { }; + class T2 { public: T(int); }; + T1 * t1 = new T1; // OK, sythesized default constructor used + T2 * t2a = new T2(5); // OK, user-defined constructor used + T2 * t2b = new T2; // ERROR, default constructor was not synthesized + + Also, if the user has provided a default constructor in the code, we don't need + to generate a second copy here. A default constructor should only be generated + here if the compiler would have synthesized one anyhow. Otherwise the default + property values should be set in the constructors that are generated by + CppClassOperationsDeclaration. + */ + var code = ''' + «IF CppOperations.getOwnedOperations(classifier).filter[GenUtils.hasStereotype(it, Create)].empty» + «var attributeList = classifier.attributes.filter[ + (it.isStatic == false) && (it.defaultValue != null) && (it.defaultValue.stringValue != null)]» + «IF !attributeList.empty» + «classifier.name»() : «FOR a : attributeList SEPARATOR ', '»«a.name»(«a.defaultValue.stringValue»)«ENDFOR» {} + «ENDIF» + «ENDIF»''' + return code.trim + } + + static def generateClassBodyCode(Classifier classifier) ''' + #define «GenUtils.getFullName(classifier)»_BODY + + /************************************************************ + «classifier.name» class body + ************************************************************/ + + «CppIncludeUtil.CppIncludePreBody(classifier)» + + // include associated header file + «CppIncludeUtil.includeDirective( + GenUtils.getFullPath(classifier.nearestPackage) + '/' + classifier.name + '.' + + CppCodeGenUtils.getHeaderSuffix())» + + // Derived includes directives + «FOR path : CppClassIncludeClassDeclaration.CppClassAllIncludesDeclarationBody(classifier).sort» + «CppIncludeUtil.includeDirective(path)» + «ENDFOR» + + «CppIncludeUtil.CppIncludeBody(classifier)» + + «CppGenUtils.openNS(classifier)» + + «CppAttribute.CppStaticAttributes(classifier)» + + «IF !classifier.isTemplate» + «CppClassOperationsImplementation.CppClassOperationsImplementation(classifier, false)» + «ENDIF» + + «CppGenUtils.closeNS(classifier)» + + /************************************************************ + End of «classifier.name» class body + ************************************************************/ + ''' +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppDocumentation.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppDocumentation.xtend new file mode 100644 index 00000000000..de7dcd05ec5 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppDocumentation.xtend @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.uml2.uml.Element +import org.eclipse.uml2.uml.Operation +import org.eclipse.uml2.uml.Parameter +import org.eclipse.uml2.uml.Behavior +import org.eclipse.uml2.uml.ParameterDirectionKind +import org.eclipse.papyrus.codegen.base.GenUtils + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppDocumentation { + static def CppElementDoc(Element argument) ''' + /** + * «GenUtils.getComments(argument).replaceAll('\n', '\n * ')» + */ + ''' + + static def CppOperationDoc(Operation operation) ''' + /** + * «GenUtils.getComments(operation).replaceAll('\n', '\n * ')» + «FOR op: operation.ownedParameters»«CppParamDoc(op)»«ENDFOR» + */ + ''' + + static def CppParamDoc(Parameter parameter) ''' + * «IF (parameter.direction == ParameterDirectionKind.RETURN_LITERAL) + »@return«ELSE»@param«ENDIF» «parameter.name» «GenUtils.getComments(parameter).replaceAll('\n', '\n * ')» + ''' + + static def CppBehaviorDoc(Behavior behavior) ''' + /** + * «GenUtils.getComments(behavior).replaceAll('\n', '\n * ')» + * «FOR op : behavior.ownedParameters»«CppParamDoc(op)»«ENDFOR» + */ + ''' +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppEnumerations.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppEnumerations.xtend new file mode 100644 index 00000000000..7ab2661f252 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppEnumerations.xtend @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.uml2.uml.Enumeration +import org.eclipse.papyrus.C_Cpp.CppInit +import org.eclipse.uml2.uml.util.UMLUtil +import org.eclipse.papyrus.codegen.base.GenUtils + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppEnumerations { + static def CppEnumerationDefinition(Enumeration enumeration) ''' + «CppDocumentation.CppElementDoc(enumeration)» + enum «enumeration.name» { + «FOR ownedLiteral : enumeration.ownedLiterals» + «CppDocumentation.CppElementDoc(ownedLiteral)» + «ownedLiteral.name»«IF GenUtils.hasStereotype(ownedLiteral, CppInit)»«UMLUtil. + getStereotypeApplication(ownedLiteral, CppInit).value»«ENDIF», + «ENDFOR» + }; + ''' +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppIncludeUtil.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppIncludeUtil.xtend new file mode 100644 index 00000000000..c8623883fe1 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppIncludeUtil.xtend @@ -0,0 +1,86 @@ +package org.eclipse.papyrus.cpp.codegen.xtend + +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + import org.eclipse.uml2.uml.NamedElement +import org.eclipse.papyrus.C_Cpp.Include +import org.eclipse.uml2.uml.util.UMLUtil +import org.eclipse.papyrus.codegen.base.GenUtils + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppIncludeUtil { + static def includeDirective(String path) { + if ((path != null) && (path.length > 0)) + return '''#include ''' + '"' + path + '"' + } + + static def CppIncludeHeader(NamedElement ne) { + if (GenUtils.hasStereotype(ne, Include)) { + UMLUtil.getStereotypeApplication(ne, Include) + var header = UMLUtil.getStereotypeApplication(ne, Include).header + if ((header != null) && (header.length > 0)) { + var includeHeader = constIncludeHeaderStart + GenUtils.cleanCR(header) + '\n' + + constIncludeHeaderEnd + return includeHeader + } + } + } + + static def constIncludeHeaderStart() ''' + // Include from Include stereotype (header) + ''' + + static def constIncludeHeaderEnd() ''' + // End of Include stereotype (header) + ''' + + static def CppIncludePreBody(NamedElement ne) { + if (GenUtils.hasStereotype(ne, Include)) { + var String preBody = UMLUtil.getStereotypeApplication(ne, Include).preBody + if ((preBody != null) && (preBody.length > 0)) { + var includePreBody = constIncludePreBodyStart + GenUtils.cleanCR(preBody) + '\n' + + constIncludePreBodyEnd + return includePreBody + } + } + } + + static def constIncludePreBodyStart() ''' + // Include from Include stereotype (pre-body) + ''' + + static def constIncludePreBodyEnd() ''' + // End of Include stereotype (pre-body) + ''' + + static def CppIncludeBody(NamedElement ne) { + if (GenUtils.hasStereotype(ne, Include)) { + var String body = UMLUtil.getStereotypeApplication(ne, Include).body + if ((body != null) && (body.length > 0)) { + var includeBody = constIncludeBodyStart + GenUtils.cleanCR(body) + '\n' + + constIncludeBodyEnd + return includeBody + } + } + } + + static def constIncludeBodyStart() ''' + // Include from Include declaration (body) + ''' + + static def constIncludeBodyEnd() ''' + // End of Include declaration (body) + ''' + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppInnerClassifiers.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppInnerClassifiers.xtend new file mode 100644 index 00000000000..78938c09623 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppInnerClassifiers.xtend @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (c) 2015 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.uml2.uml.Classifier +import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils +import org.eclipse.uml2.uml.VisibilityKind +import org.eclipse.papyrus.codegen.base.GenUtils +import org.eclipse.uml2.uml.NamedElement + +/** + * @author Shuai Li (CEA) + */ + +class CppInnerClassifiers { + static def CppInnerClassDefinition(Classifier classifier) ''' + «CppDocumentation.CppElementDoc(classifier)» + «CppTemplates.templateSignature(classifier)»«CppClassifierGenerator.classUnionOrStruct(classifier)» «classifier.name»«CppClassInheritedDeclarations. + CppClassInheritedDeclarations(classifier)» { + «CppClassFriendDeclaration.CppClassIncludeFriendDeclaration(classifier)»«CppClassTypeAndEnum.CppClassTypeAndEnum(classifier)» + «var publicVisibility = VisibilityKind.PUBLIC_LITERAL» + «CppGenUtils.getSection(publicVisibility, CppClassifierGenerator.defaultInitializer(classifier))» + «CppGenUtils.getSection(publicVisibility, + CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, publicVisibility).toString)» + «CppGenUtils.getSection(publicVisibility, + CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, publicVisibility).toString)» + + «var protectedVisibility = VisibilityKind.PROTECTED_LITERAL» + «CppGenUtils.getSection(protectedVisibility, + CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, protectedVisibility).toString)» + «CppGenUtils.getSection(protectedVisibility, + CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, protectedVisibility).toString)» + + «var privateVisibility = VisibilityKind.PRIVATE_LITERAL» + «CppGenUtils.getSection(privateVisibility, + CppClassAttributesDeclaration.CppClassAttributesDeclaration(classifier, privateVisibility).toString)» + «CppGenUtils.getSection(privateVisibility, + CppClassOperationsDeclaration.CppClassOperationsDeclaration(classifier, privateVisibility).toString)» + }; + ''' + + static def CppInnerBindDefinition(Classifier classifier) ''' + «var tb = GenUtils.getTemplateBinding(classifier)» + «var templateElement = tb.targets.get(0)» + /************************************************************/ + typedef «(templateElement.owner as NamedElement).name»<«FOR ps : tb.parameterSubstitutions SEPARATOR ', '»« + CppTemplates.CppTemplateBindingParameter(ps)»«ENDFOR»> «classifier.name»; + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppOperations.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppOperations.xtend new file mode 100644 index 00000000000..557bd5b1c90 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppOperations.xtend @@ -0,0 +1,204 @@ +package org.eclipse.papyrus.cpp.codegen.xtend + +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + import org.eclipse.papyrus.C_Cpp.Inline +import org.eclipse.papyrus.C_Cpp.Virtual +import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils +import org.eclipse.papyrus.cpp.codegen.utils.Modifier +import org.eclipse.uml2.uml.Behavior +import org.eclipse.uml2.uml.Class +import org.eclipse.uml2.uml.Classifier +import org.eclipse.uml2.uml.DataType +import org.eclipse.uml2.uml.Element +import org.eclipse.uml2.uml.Interface +import org.eclipse.uml2.uml.OpaqueBehavior +import org.eclipse.uml2.uml.Operation +import org.eclipse.uml2.uml.profile.standard.Create +import org.eclipse.uml2.uml.profile.standard.Destroy +import org.eclipse.papyrus.C_Cpp.ConstInit +import org.eclipse.uml2.uml.util.UMLUtil +import org.eclipse.papyrus.cpp.codegen.Constants +import org.eclipse.uml2.uml.NamedElement +import org.eclipse.uml2.uml.Region +import org.eclipse.papyrus.cpp.codegen.utils.ClassUtils +import org.eclipse.papyrus.codegen.base.GenUtils +import org.eclipse.papyrus.C_Cpp.Variadic +import org.eclipse.uml2.uml.ParameterDirectionKind + +class CppOperations { + static def CppOperationImplementation(Operation operation) ''' + «CppDocumentation.CppOperationDoc(operation)» + «IF (operation.name == 'main')» + «CppReturnSpec(operation)»«operation.name»(«CppParameter.CppOperationParameters(operation,false)») { + «GenUtils.getBody(operation, Constants.supportedLanguages)» + } + «ELSE» + «CppTemplates.templateSignature(operation)»«InlineTxt(operation)»«CppReturnSpec(operation)»«GenUtils.getNestedOperationFarthestClassifierOwnerNamespace(operation)»«CppTemplates.templateShortSignature(operation)»::«destructor(operation)»«operation.name»(«CppParameter.CppOperationParameters(operation, false)»«variadicParameter(operation)»)«throwss(operation)»«Modifier.modCVQualifier(operation)»«CppConstInit(operation)» { + «GenUtils.getBody(operation, Constants.supportedLanguages)» + } + «ENDIF» + ''' + + static def CppReturnSpec(Operation operation) { + if ((operation.type == null) || isConsOrDestructor(operation)) { + ConsDestructorOrVoid(operation) + } else { + Modifier.modCVQualifier(operation.getReturnResult())+' '+CppGenUtils.cppQualifiedName(operation.type)+Modifier.modPtr(operation.getReturnResult())+Modifier.modRef(operation.getReturnResult())+' ' + } + } + + static def CppReturnSpec(Behavior behavior) ''' + «IF (GenUtils.returnResult(behavior) == null)»void «ELSE»«Modifier.modCVQualifier(GenUtils.returnResult(behavior))» «CppGenUtils.cppQualifiedName(GenUtils.returnResult(behavior).type)»«Modifier.modPtr(GenUtils.returnResult(behavior))»«Modifier.modRef(GenUtils.returnResult(behavior))» «ENDIF» + ''' + + static def throwss(Operation operation) ''' + «IF operation.raisedExceptions.length > 0» + throws «FOR re : operation.raisedExceptions SEPARATOR ','»«re.name»«ENDFOR» + «ENDIF» + ''' + + static def ConsDestructorOrVoid(Operation operation) { + if (isConsOrDestructor(operation)) { + + } else { + 'void ' + } + } + + static def isConsOrDestructor(Operation operation) { + GenUtils.hasStereotype(operation, Create) || GenUtils.hasStereotype(operation, Destroy) + } + + static def CppConstInit(Operation operation) { + if (GenUtils.hasStereotype(operation, ConstInit) && GenUtils.hasStereotype(operation, Create)) { + ": " + UMLUtil.getStereotypeApplication(operation, ConstInit).initialisation + } + } + + // return a list of owned operations, return emptyset, if null + static def getOwnedOperations(Classifier cl) { + val operations = getOwnedOperationsWNull(cl) + if (operations == null) { + emptySet + } + else { + operations + } + } + + // return a list of owned operations, since this is not supported directly on a classifier + static def getOwnedOperationsWNull(Classifier cl) { + if (cl instanceof Class) { + (cl as Class).ownedOperations + } else { + if (cl instanceof DataType) { + (cl as DataType).ownedOperations + } else { + if (cl instanceof Interface) { + (cl as Interface).ownedOperations + } else { + // Sequence{} + } + } + } + } + + static def getNestedOperations(Classifier c1) { + val operations = getNestedOperationsWNull(c1) + if (operations == null) { + emptySet + } + else { + operations + } + } + + static def getNestedOperationsWNull(Classifier cl) { + if (cl instanceof Class || cl instanceof Interface) { + ClassUtils.nestedOperations(cl) + } + } + + static def CppBehaviorImplementation(OpaqueBehavior behavior) ''' + «CppDocumentation.CppBehaviorDoc(behavior)» + «CppReturnSpec(behavior)»«GenUtils.getNestedBehaviorFarthestClassifierOwnerNamespace(behavior)»::«behavior.qualifiedBehaviorName»(«CppParameter.CppBehaviorParameters(behavior, false)»)«Modifier.modCVQualifier(behavior)» { + «GenUtils.getBodyFromOB(behavior, Constants.supportedLanguages)» + } + ''' + + static def CppOperationDeclaration(Operation operation) ''' + «CppDocumentation.CppOperationDoc(operation)» + «InlineTxt(operation)»«virtualTxt(operation)»«staticTxt(operation)»«CppReturnSpec(operation)»«destructor(operation)»«operation.name»(«CppParameter.CppOperationParameters(operation,true)»«variadicParameter(operation)»)«Modifier.modCVQualifier(operation)»«virtualSuffix(operation)»; + ''' + + static def InlineTxt(Element element) { + if (GenUtils.hasStereotype(element, Inline)) 'inline ' + } + + static def virtualTxt(Operation operation) { + if ((operation.interface != null) || (operation.isAbstract) || (GenUtils.hasStereotype(operation, Virtual))) 'virtual ' + } + + static def staticTxt(Operation operation) { + if (operation.isStatic) 'static ' + } + + static def destructor(Operation operation) { + if (GenUtils.hasStereotype(operation, Destroy) && (!operation.name.startsWith('~'))) { + '~' + } else { + '' + } + } + + static def public virtualSuffix(Operation operation) { + if ((operation.interface != null) || (operation.isAbstract)) ' = 0' + } + + static def CppBehaviorDeclaration(Behavior behavior) ''' + «CppDocumentation.CppBehaviorDoc(behavior)» + «InlineTxt(behavior)»«CppReturnSpec(behavior)»«behavior.qualifiedBehaviorName»(«CppParameter.CppBehaviorParameters(behavior, true)»)«Modifier.modCVQualifier(behavior)»; + ''' + + static def qualifiedBehaviorName(Behavior behavior) { + var ne = behavior as NamedElement + var name = behavior.name + while ((ne != null) && !(ne instanceof Classifier) || (ne instanceof Behavior)) { + if (ne.owner instanceof NamedElement) { + ne = ne.owner as NamedElement + } + if (ne.owner instanceof Region) { + name = ne.name + "_" + name + } + } + return name + } + + static def variadicParameter(Operation operation) { + var hasParameters = false; + var i = 0; + if (GenUtils.hasStereotype(operation, Variadic)) { + while (i < operation.ownedParameters.size && !hasParameters) { + if (operation.ownedParameters.get(i).direction != ParameterDirectionKind.RETURN_LITERAL) { + hasParameters = true; + } + } + + if (hasParameters) { + ', ...' + } else { + '...' + } + } + } +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPackageHeaderGenerator.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPackageHeaderGenerator.xtend new file mode 100644 index 00000000000..4698312f2b8 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPackageHeaderGenerator.xtend @@ -0,0 +1,64 @@ +package org.eclipse.papyrus.cpp.codegen.xtend + +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +import org.eclipse.papyrus.cpp.codegen.preferences.CppCodeGenUtils +import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils +import org.eclipse.uml2.uml.Package +import org.eclipse.papyrus.codegen.base.GenUtils + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppPackageHeaderGenerator { + + static def generateCode(Package pkg) ''' + #ifndef PKG_«GenUtils.getFullNameUC(pkg)» + #define PKG_«GenUtils.getFullNameUC(pkg)» + + /************************************************************ + Pkg_«pkg.name» package header + ************************************************************/ + + «CppIncludeUtil.includeDirective(CppClassIncludeClassDeclaration.cppOwnerPackageIncludePath(pkg.nestingPackage))» + + #ifndef _IN_ + #define _IN_ + #endif + #ifndef _OUT_ + #define _OUT_ + #endif + #ifndef _INOUT_ + #define _INOUT_ + #endif + + + /* Package dependency header include */ + «FOR p: GenUtils.getUsedPackages(pkg)» + «var path = GenUtils.getFullPath(p) + "/Pkg_"+ p.name + "." + CppCodeGenUtils.getHeaderSuffix» + «CppIncludeUtil.includeDirective(path)» + «ENDFOR» + + «CppIncludeUtil.CppIncludeHeader(pkg)» + «CppGenUtils.openNS(pkg)» + + // Types defined within the package + «CppClassTypeAndEnum.CppClassTypeAndEnumPackage(pkg)» + «CppGenUtils.closeNS(pkg)» + + /************************************************************ + End of Pkg_«pkg.name» package header + ************************************************************/ + + #endif + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppParameter.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppParameter.xtend new file mode 100644 index 00000000000..160265df9b8 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppParameter.xtend @@ -0,0 +1,62 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.uml2.uml.Operation +import org.eclipse.uml2.uml.Parameter +import org.eclipse.papyrus.cpp.codegen.utils.Modifier +import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils +import org.eclipse.uml2.uml.ParameterDirectionKind +import org.eclipse.uml2.uml.Behavior +import org.eclipse.papyrus.C_Cpp.Array +import org.eclipse.uml2.uml.util.UMLUtil + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppParameter { + + static def CppOperationParameters(Operation operation, boolean showDefault) ''' + «FOR ownedParameter : operation.ownedParameters.filter[it.direction != ParameterDirectionKind.RETURN_LITERAL] SEPARATOR ', '»«CppParameter(ownedParameter, showDefault)»«ENDFOR»''' + + /** + * comment signature for a given behavior (e.g. effect within state machine) + */ + static def CppBehaviorParameters(Behavior behavior, boolean showDefault) ''' + «FOR ownedParameter : behavior.ownedParameters.filter[it.direction != ParameterDirectionKind.RETURN_LITERAL] SEPARATOR ', '»«CppParameter(ownedParameter, showDefault)»«ENDFOR» + ''' + + /** + * C++ parameter. Default values are added, if parameter showDefault is true (implementation signature + */ + static def CppParameter(Parameter parameter, boolean showDefault) { + Modifier.modCVQualifier(parameter) + Modifier.modSCQualifier(parameter) + CppGenUtils.cppQualifiedName(parameter.type) + + Modifier.modPtr(parameter) + Modifier.modRef(parameter) + Modifier.dirInfo(parameter) + " " + parameter.name + + Modifier.modArray(parameter) + {if (showDefault) defaultValue(parameter) else ""} + } + + /** + * CppParameterCalculation for CDT + */ + static def CppParameterForCDT(Parameter parameter) { + var paramStr = Modifier.modCVQualifier(parameter) + Modifier.modSCQualifier(parameter) + CppGenUtils.cppQualifiedName(parameter.type) + + Modifier.modPtr(parameter) + Modifier.modRef(parameter) + if (UMLUtil.getStereotypeApplication(parameter, Array) != null) { + paramStr += "[]" + } + return paramStr + } + + static def defaultValue(Parameter parameter) { + if (parameter.defaultValue != null) " = " + parameter.defaultValue.stringValue() else "" + } +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPrimitiveTypes.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPrimitiveTypes.xtend new file mode 100644 index 00000000000..46fcb612a72 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppPrimitiveTypes.xtend @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.uml2.uml.PrimitiveType +import org.eclipse.papyrus.C_Cpp.Typedef +import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils +import org.eclipse.uml2.uml.util.UMLUtil +import org.eclipse.papyrus.codegen.base.GenUtils + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppPrimitiveTypes { + + /** Support two different kinds of primitive types + * (1) those that are native types of the programming language such as long + * For these, no additional definition has to be done and they should be referenced + * with their name only + * (2) those that correspond to a typedef (e.g. typedef long ErrorType). These require + * a typedef definition within the package and need to be referenced with their + * fully qualified name (e.g. MyPackage::ErrorType) + * (3) Sometimes the name of the type defined by a typedef does not appear at the end, e.g. + * when defining functionPointers such as "typedef int (*HandlerFct) (void*);" + * (a function with a void* argument returning int) + * Support this case via a specific 'typeName' constant that gets replaced by the name of the + * type + */ + static def CppPrimitiveTypeDefinition(PrimitiveType primitiveType) ''' + «CppDocumentation.CppElementDoc(primitiveType)» + «IF GenUtils.hasStereotype(primitiveType, Typedef)» + typedef «UMLUtil.getStereotypeApplication(primitiveType, Typedef).definition.replaceAll('typeName', primitiveType.name)» + «IF !UMLUtil.getStereotypeApplication(primitiveType, Typedef).definition.contains('typeName')»«primitiveType.name»«ENDIF»; + + «ELSE» + «CppGenUtils.getStdtypes(primitiveType)» + + «ENDIF» + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppTemplates.xtend b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppTemplates.xtend new file mode 100644 index 00000000000..13c207c8708 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/src/org/eclipse/papyrus/cpp/codegen/xtend/CppTemplates.xtend @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (c) 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + + package org.eclipse.papyrus.cpp.codegen.xtend + +import org.eclipse.uml2.uml.Operation +import org.eclipse.uml2.uml.Classifier +import org.eclipse.papyrus.cpp.codegen.utils.CppGenUtils +import org.eclipse.uml2.uml.TemplateParameterSubstitution +import org.eclipse.uml2.uml.NamedElement +import org.eclipse.uml2.uml.LiteralInteger +import org.eclipse.papyrus.codegen.base.GenUtils + +/** + * @author Önder GÜRCAN (onder.gurcan@cea.fr) + */ +class CppTemplates { + + static def templateSignature(Operation operation) { + templateSignature(operation.owner as Classifier) + } + + static def templateSignature(Classifier clazz)''' + «IF (isTemplate(clazz))» + template<«FOR templateParam : GenUtils.getTemplateParameters(clazz) SEPARATOR ', '»«CppGenUtils.getTemplateTypeName(templateParam)»«ENDFOR»> + «ENDIF» + ''' + + static def templateShortSignature(Operation operation) { + templateShortSignature(operation.owner as Classifier) + } + + static def templateShortSignature(Classifier clazz)''' + «IF (isTemplate(clazz))» + <«FOR templateParam : GenUtils.getTemplateParameters(clazz) SEPARATOR ', '»«GenUtils.getTemplateName(templateParam)»«ENDFOR»> + «ENDIF» + ''' + + static def isTemplate(Classifier clazz) { + GenUtils.getTemplateParameters(clazz).size() > 0 + } + + static def CppTemplateBindingParameter(TemplateParameterSubstitution tps) { + if (tps.actual instanceof LiteralInteger) { + (tps.actual as LiteralInteger).value + } else { + (tps.actual as NamedElement).name + } + } +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/xtend-gen/.gitignore b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/xtend-gen/.gitignore new file mode 100644 index 00000000000..c96a04f008e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen/xtend-gen/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/.classpath b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/.project b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/.project new file mode 100644 index 00000000000..3e3d8136716 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.cpp.examples + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c537b63063c --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..85f6beaf683 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/META-INF/MANIFEST.MF @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.papyrus.uml.diagram.wizards;bundle-version="1.2.0" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.cpp.examples.Activator +Bundle-SymbolicName: org.eclipse.papyrus.cpp.examples;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/about.html b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    November 14, 2008

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/build.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/build.properties new file mode 100644 index 00000000000..9cd110db55b --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + about.html,\ + plugin.xml,\ + models/ +src.includes = about.html diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.di b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.di new file mode 100644 index 00000000000..b61e898b639 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.di @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.notation b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.notation new file mode 100644 index 00000000000..38ed3da34a5 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.notation @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.uml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.uml new file mode 100644 index 00000000000..05f811b27a4 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/models/examples/HelloWorldOO.uml @@ -0,0 +1,43 @@ + + + + + + Simple HelloWorld component that prints a message in its "run" operation + + + + Class with main function. This function is not declared (since it would always be a member function), but directly added via the ManualGeneration stereptype). + + + The dependency is necessary, since the use of the class HelloWorld is happening inside the body (types appearing in the signature of operations or attributes are managed automatically). + + + Use the package to generate code. Open the context menu and select "generate code". + + + + C/C++ + cout << "Hello world" << endl; + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/plugin.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/plugin.properties new file mode 100644 index 00000000000..ed68cd6714a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus C/C++ examples (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/plugin.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/plugin.xml new file mode 100644 index 00000000000..17282114c08 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/plugin.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/pom.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/pom.xml new file mode 100644 index 00000000000..d8dd48c29a8 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.cpp.examples + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/Activator.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/Activator.java new file mode 100644 index 00000000000..4611a96f62d --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.cpp.examples; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.cpp.examples"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/HelloWorldOOModelWizard.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/HelloWorldOOModelWizard.java new file mode 100644 index 00000000000..ee3400e6c43 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples/src/org/eclipse/papyrus/cpp/examples/HelloWorldOOModelWizard.java @@ -0,0 +1,27 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.cpp.examples; + +import org.eclipse.papyrus.uml.diagram.wizards.ModelCopyWizard; + +/** + * Copy wizard for the HelloWorld example + */ +public class HelloWorldOOModelWizard extends ModelCopyWizard { + + public HelloWorldOOModelWizard() { + super("HelloWorldOO"); //$NON-NLS-1$ + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/.classpath b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/.project b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/.project new file mode 100644 index 00000000000..12be9afc369 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.cpp.library.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c537b63063c --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..1e27c1e4fc6 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/META-INF/MANIFEST.MF @@ -0,0 +1,12 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.papyrus.cpp.library.ui;singleton:=true +Bundle-Version: 1.2.0.qualifier +Bundle-Activator: org.eclipse.papyrus.cpp.library.ui.Activator +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.ui, + org.eclipse.papyrus.uml.extensionpoints;bundle-version="1.2.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy +Bundle-Vendor: %providerName diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/about.html b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    November 14, 2008

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/build.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/build.properties new file mode 100644 index 00000000000..c52dd5f5b4a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + icons/,\ + plugin.properties,\ + about.html +src.includes = about.html diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/icons/transfo_cpp.gif b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/icons/transfo_cpp.gif new file mode 100644 index 00000000000..7caaa0fdae8 Binary files /dev/null and b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/icons/transfo_cpp.gif differ diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/plugin.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/plugin.properties new file mode 100644 index 00000000000..f07d7e63ef6 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus C/C++ library - Papyrus-dependent UI registration (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/plugin.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/plugin.xml new file mode 100644 index 00000000000..c99f8715dd6 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/plugin.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/pom.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/pom.xml new file mode 100644 index 00000000000..fa23868009e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.cpp.library.ui + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/src/org/eclipse/papyrus/cpp/library/ui/Activator.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/src/org/eclipse/papyrus/cpp/library/ui/Activator.java new file mode 100644 index 00000000000..489c2549aeb --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui/src/org/eclipse/papyrus/cpp/library/ui/Activator.java @@ -0,0 +1,50 @@ +package org.eclipse.papyrus.cpp.library.ui; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.cpp.library.ui"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.classpath b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.classpath new file mode 100644 index 00000000000..121e527a938 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.project b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.project new file mode 100644 index 00000000000..3857c77079e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.cpp.library + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..7f1c4878394 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.emf.ecore, + org.eclipse.uml2.uml;bundle-version="5.0.0" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.cpp.library.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.cpp.library;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/about.html b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    November 14, 2008

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/build.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/build.properties new file mode 100644 index 00000000000..c5bd7ea6135 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + models/,\ + about.html,\ + plugin.properties +src.includes = about.html diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/models/AnsiCLibrary.di b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/models/AnsiCLibrary.di new file mode 100644 index 00000000000..27d5dafd653 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/models/AnsiCLibrary.di @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/models/AnsiCLibrary.notation b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/models/AnsiCLibrary.notation new file mode 100644 index 00000000000..039e96e9c0b --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/models/AnsiCLibrary.notation @@ -0,0 +1,348 @@ + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/models/AnsiCLibrary.uml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/models/AnsiCLibrary.uml new file mode 100644 index 00000000000..00ee3486b79 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/models/AnsiCLibrary.uml @@ -0,0 +1,37 @@ + + + + + Platform independent fixed size types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/plugin.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/plugin.properties new file mode 100644 index 00000000000..17e06150837 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus C/C++ profile (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/plugin.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/plugin.xml new file mode 100644 index 00000000000..af856732602 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/plugin.xml @@ -0,0 +1,10 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/pom.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/pom.xml new file mode 100644 index 00000000000..9eaa91aaf31 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.cpp.library + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/src/org/eclipse/papyrus/cpp/library/Activator.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/src/org/eclipse/papyrus/cpp/library/Activator.java new file mode 100644 index 00000000000..8aa6783549d --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library/src/org/eclipse/papyrus/cpp/library/Activator.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.cpp.library; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/.classpath b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/.project b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/.project new file mode 100644 index 00000000000..6b25ba93cbc --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.cpp.profile.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c537b63063c --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..0b018987d0c --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/META-INF/MANIFEST.MF @@ -0,0 +1,12 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.papyrus.cpp.profile.ui;singleton:=true +Bundle-Version: 1.2.0.qualifier +Bundle-Activator: org.eclipse.papyrus.cpp.profile.ui.Activator +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.ui, + org.eclipse.papyrus.uml.extensionpoints;bundle-version="1.2.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy +Bundle-Vendor: %providerName diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/about.html b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    November 14, 2008

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/build.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/build.properties new file mode 100644 index 00000000000..c52dd5f5b4a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + icons/,\ + plugin.properties,\ + about.html +src.includes = about.html diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/icons/transfo_cpp.gif b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/icons/transfo_cpp.gif new file mode 100644 index 00000000000..7caaa0fdae8 Binary files /dev/null and b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/icons/transfo_cpp.gif differ diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/plugin.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/plugin.properties new file mode 100644 index 00000000000..75bf9a1ecb0 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus C/C++ profile - Papyrus-dependent UI registration (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/plugin.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/plugin.xml new file mode 100644 index 00000000000..85f6a4f453d --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/plugin.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/pom.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/pom.xml new file mode 100644 index 00000000000..6f28d6a7837 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.cpp.profile.ui + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/src/org/eclipse/papyrus/cpp/profile/ui/Activator.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/src/org/eclipse/papyrus/cpp/profile/ui/Activator.java new file mode 100644 index 00000000000..3f888a06a2e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui/src/org/eclipse/papyrus/cpp/profile/ui/Activator.java @@ -0,0 +1,50 @@ +package org.eclipse.papyrus.cpp.profile.ui; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.cpp.profile.ui"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.classpath b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.project b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.project new file mode 100644 index 00000000000..1d8b98f86c4 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.cpp.profile + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..a43afee6ea3 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.emf.ecore, + org.eclipse.uml2.uml;bundle-version="5.0.0" +Export-Package: org.eclipse.papyrus.C_Cpp, + org.eclipse.papyrus.C_Cpp.impl, + org.eclipse.papyrus.C_Cpp.util, + org.eclipse.papyrus.cpp.profile +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.cpp.profile.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.cpp.profile;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/about.html b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    November 14, 2008

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/build.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/build.properties new file mode 100644 index 00000000000..8904618deb7 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/build.properties @@ -0,0 +1,10 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + profiles/,\ + libraries/,\ + about.html,\ + plugin.properties +src.includes = about.html diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.di b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.di new file mode 100644 index 00000000000..27d5dafd653 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.di @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.notation b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.notation new file mode 100644 index 00000000000..039e96e9c0b --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.notation @@ -0,0 +1,348 @@ + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.uml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.uml new file mode 100644 index 00000000000..00ee3486b79 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/libraries/AnsiCLibrary.uml @@ -0,0 +1,37 @@ + + + + + Platform independent fixed size types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/plugin.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/plugin.properties new file mode 100644 index 00000000000..17e06150837 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus C/C++ profile (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/plugin.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/plugin.xml new file mode 100644 index 00000000000..74b5096608a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/plugin.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/pom.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/pom.xml new file mode 100644 index 00000000000..19a9f1410e6 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.cpp.profile + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.ecore b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.ecore new file mode 100644 index 00000000000..65ebda94e6b --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.ecore @@ -0,0 +1,205 @@ + + + + +
    + + + + + + + +
    + + + + + + + + + + +
    + + + + + + +
    + + + + + + + + + + +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.genmodel b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.genmodel new file mode 100644 index 00000000000..1273b29c170 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.genmodel @@ -0,0 +1,196 @@ + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + C_Cpp.profile.uml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.di b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.di new file mode 100644 index 00000000000..134e5584ee5 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.di @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.notation b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.notation new file mode 100644 index 00000000000..5acb64df288 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.notation @@ -0,0 +1,1835 @@ + + + + + +
    + + +
    + + +
    + + + + + +
    + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + name + derived + type + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + name + derived + multiplicity + type + + + + + + +
    + + + name + derived + multiplicity + type + + + + + + +
    + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + name + derived + multiplicity + type + + + + + + +
    + + + name + derived + multiplicity + type + + + + + + +
    + + + name + derived + multiplicity + type + + + + + + +
    + + + name + derived + multiplicity + type + + + + + + +
    + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + name + type + derived + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + name + derived + type + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + name + derived + type + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + name + derived + type + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.uml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.uml new file mode 100644 index 00000000000..624c26dd6b5 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/C_Cpp.profile.uml @@ -0,0 +1,529 @@ + + + + + "declaration" attribute should only be used, if more than one indirections of pointers (often "**") + + + An arbitrary string that is added to header and body file. Although primarily intended for manual include directives, it can be used for arbitrary definitions. +"preBody" is added to a C++ body file before automatic include statements, "body" after + + + Some toolkits require a quite particular way of use. For instance, LTTng requires the use of C (not C++) for the declaration of a trace provider and the header file is read several time with redefined macros. Therefore, the code generator supports a "manual" generation mode, in which primarily the contents of the CppInclude directive is written. + + + Mark a package as External Library. If this package is used, the associated CDT project will be configured accordingly. + + + No code generation should be done for this element. This also means that no include directive is generated, if the class is referenced. + + + Indicates that this package shoudl be a root package, i.e. its contents should appear on top level folder during generation. Currently not used + + + Declare a new type that is based on another type. +Can be used to define for instance primitive types (like int). Can also be used for function pointers (see wiki) + + + The extension from Include to Class is not necessary, as Classifier is already extended, but kept for compatibility with old models + + + External classes reference existing C++ classes, but are typcially empty in the model. An include directive is generated if classes depend on these. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.di b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.di new file mode 100644 index 00000000000..89f2786c0ea --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.di @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.notation b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.notation new file mode 100644 index 00000000000..8d2827ae033 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.notation @@ -0,0 +1,650 @@ + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.uml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.uml new file mode 100644 index 00000000000..8684a4b4967 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/profiles/PapyrusC.profile.uml @@ -0,0 +1,4143 @@ + + + + + +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Array.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Array.java new file mode 100644 index 00000000000..54cbd8163d2 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Array.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Association; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Property; + +/** + * + * A representation of the model object 'Array'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Array#getBase_parameter Base parameter}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Array#getDefinition Definition}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Array#getBase_property Base property}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Array#getBase_association Base association}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getArray() + * @model + * @generated + */ +public interface Array extends EObject { + /** + * Returns the value of the 'Base parameter' reference. + * + *

    + * If the meaning of the 'Base parameter' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base parameter' reference. + * @see #setBase_parameter(Parameter) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getArray_Base_parameter() + * @model ordered="false" + * @generated + */ + Parameter getBase_parameter(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Array#getBase_parameter Base parameter}' reference. + * + * + * @param value the new value of the 'Base parameter' reference. + * @see #getBase_parameter() + * @generated + */ + void setBase_parameter(Parameter value); + + /** + * Returns the value of the 'Definition' attribute. + * + *

    + * If the meaning of the 'Definition' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Definition' attribute. + * @see #setDefinition(String) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getArray_Definition() + * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" + * @generated + */ + String getDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Array#getDefinition Definition}' attribute. + * + * + * @param value the new value of the 'Definition' attribute. + * @see #getDefinition() + * @generated + */ + void setDefinition(String value); + + /** + * Returns the value of the 'Base property' reference. + * + *

    + * If the meaning of the 'Base property' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base property' reference. + * @see #setBase_property(Property) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getArray_Base_property() + * @model ordered="false" + * @generated + */ + Property getBase_property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Array#getBase_property Base property}' reference. + * + * + * @param value the new value of the 'Base property' reference. + * @see #getBase_property() + * @generated + */ + void setBase_property(Property value); + + /** + * Returns the value of the 'Base association' reference. + * + *

    + * If the meaning of the 'Base association' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base association' reference. + * @see #setBase_association(Association) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getArray_Base_association() + * @model ordered="false" + * @generated + */ + Association getBase_association(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Array#getBase_association Base association}' reference. + * + * + * @param value the new value of the 'Base association' reference. + * @see #getBase_association() + * @generated + */ + void setBase_association(Association value); + +} // Array diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppFactory.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppFactory.java new file mode 100644 index 00000000000..23497620ac3 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppFactory.java @@ -0,0 +1,268 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage + * @generated + */ +public interface C_CppFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + C_CppFactory eINSTANCE = org.eclipse.papyrus.C_Cpp.impl.C_CppFactoryImpl.init(); + + /** + * Returns a new object of class 'Ptr'. + * + * + * @return a new object of class 'Ptr'. + * @generated + */ + Ptr createPtr(); + + /** + * Returns a new object of class 'Include'. + * + * + * @return a new object of class 'Include'. + * @generated + */ + Include createInclude(); + + /** + * Returns a new object of class 'Manual Generation'. + * + * + * @return a new object of class 'Manual Generation'. + * @generated + */ + ManualGeneration createManualGeneration(); + + /** + * Returns a new object of class 'Extern Library'. + * + * + * @return a new object of class 'Extern Library'. + * @generated + */ + ExternLibrary createExternLibrary(); + + /** + * Returns a new object of class 'No Code Gen'. + * + * + * @return a new object of class 'No Code Gen'. + * @generated + */ + NoCodeGen createNoCodeGen(); + + /** + * Returns a new object of class 'Cpp Root'. + * + * + * @return a new object of class 'Cpp Root'. + * @generated + */ + CppRoot createCppRoot(); + + /** + * Returns a new object of class 'Array'. + * + * + * @return a new object of class 'Array'. + * @generated + */ + Array createArray(); + + /** + * Returns a new object of class 'Const'. + * + * + * @return a new object of class 'Const'. + * @generated + */ + Const createConst(); + + /** + * Returns a new object of class 'Ref'. + * + * + * @return a new object of class 'Ref'. + * @generated + */ + Ref createRef(); + + /** + * Returns a new object of class 'External'. + * + * + * @return a new object of class 'External'. + * @generated + */ + External createExternal(); + + /** + * Returns a new object of class 'Const Init'. + * + * + * @return a new object of class 'Const Init'. + * @generated + */ + ConstInit createConstInit(); + + /** + * Returns a new object of class 'Friend'. + * + * + * @return a new object of class 'Friend'. + * @generated + */ + Friend createFriend(); + + /** + * Returns a new object of class 'Inline'. + * + * + * @return a new object of class 'Inline'. + * @generated + */ + Inline createInline(); + + /** + * Returns a new object of class 'Virtual'. + * + * + * @return a new object of class 'Virtual'. + * @generated + */ + Virtual createVirtual(); + + /** + * Returns a new object of class 'Typedef'. + * + * + * @return a new object of class 'Typedef'. + * @generated + */ + Typedef createTypedef(); + + /** + * Returns a new object of class 'Visibility'. + * + * + * @return a new object of class 'Visibility'. + * @generated + */ + Visibility createVisibility(); + + /** + * Returns a new object of class 'Cpp Init'. + * + * + * @return a new object of class 'Cpp Init'. + * @generated + */ + CppInit createCppInit(); + + /** + * Returns a new object of class 'Template'. + * + * + * @return a new object of class 'Template'. + * @generated + */ + Template createTemplate(); + + /** + * Returns a new object of class 'Template Binding'. + * + * + * @return a new object of class 'Template Binding'. + * @generated + */ + TemplateBinding createTemplateBinding(); + + /** + * Returns a new object of class 'Template Parameter'. + * + * + * @return a new object of class 'Template Parameter'. + * @generated + */ + TemplateParameter createTemplateParameter(); + + /** + * Returns a new object of class 'Union'. + * + * + * @return a new object of class 'Union'. + * @generated + */ + Union createUnion(); + + /** + * Returns a new object of class 'Storage Class'. + * + * + * @return a new object of class 'Storage Class'. + * @generated + */ + StorageClass createStorageClass(); + + /** + * Returns a new object of class 'Volatile'. + * + * + * @return a new object of class 'Volatile'. + * @generated + */ + Volatile createVolatile(); + + /** + * Returns a new object of class 'Variadic'. + * + * + * @return a new object of class 'Variadic'. + * @generated + */ + Variadic createVariadic(); + + /** + * Returns a new object of class 'Mutable'. + * + * + * @return a new object of class 'Mutable'. + * @generated + */ + Mutable createMutable(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + C_CppPackage getC_CppPackage(); + +} // C_CppFactory diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppPackage.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppPackage.java new file mode 100644 index 00000000000..e58139c0869 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/C_CppPackage.java @@ -0,0 +1,2980 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
      + *
    • each class,
    • + *
    • each feature of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppFactory + * @model kind="package" + * @generated + */ +public interface C_CppPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "C_Cpp"; //$NON-NLS-1$ + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.eclipse.org/papyrus/C_Cpp/1"; //$NON-NLS-1$ + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "C_Cpp"; //$NON-NLS-1$ + + /** + * The singleton instance of the package. + * + * + * @generated + */ + C_CppPackage eINSTANCE = org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.PtrImpl Ptr}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.PtrImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getPtr() + * @generated + */ + int PTR = 0; + + /** + * The feature id for the 'Base parameter' reference. + * + * + * @generated + * @ordered + */ + int PTR__BASE_PARAMETER = 0; + + /** + * The feature id for the 'Base property' reference. + * + * + * @generated + * @ordered + */ + int PTR__BASE_PROPERTY = 1; + + /** + * The feature id for the 'Declaration' attribute. + * + * + * @generated + * @ordered + */ + int PTR__DECLARATION = 2; + + /** + * The number of structural features of the 'Ptr' class. + * + * + * @generated + * @ordered + */ + int PTR_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'Ptr' class. + * + * + * @generated + * @ordered + */ + int PTR_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl Include}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.IncludeImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getInclude() + * @generated + */ + int INCLUDE = 1; + + /** + * The feature id for the 'Body' attribute. + * + * + * @generated + * @ordered + */ + int INCLUDE__BODY = 0; + + /** + * The feature id for the 'Pre Body' attribute. + * + * + * @generated + * @ordered + */ + int INCLUDE__PRE_BODY = 1; + + /** + * The feature id for the 'Header' attribute. + * + * + * @generated + * @ordered + */ + int INCLUDE__HEADER = 2; + + /** + * The feature id for the 'Base package' reference. + * + * + * @generated + * @ordered + */ + int INCLUDE__BASE_PACKAGE = 3; + + /** + * The feature id for the 'Base class' reference. + * + * + * @generated + * @ordered + */ + int INCLUDE__BASE_CLASS = 4; + + /** + * The feature id for the 'Base Classifier' reference. + * + * + * @generated + * @ordered + */ + int INCLUDE__BASE_CLASSIFIER = 5; + + /** + * The number of structural features of the 'Include' class. + * + * + * @generated + * @ordered + */ + int INCLUDE_FEATURE_COUNT = 6; + + /** + * The number of operations of the 'Include' class. + * + * + * @generated + * @ordered + */ + int INCLUDE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.ManualGenerationImpl Manual Generation}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.ManualGenerationImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getManualGeneration() + * @generated + */ + int MANUAL_GENERATION = 2; + + /** + * The feature id for the 'Extension Body' attribute. + * + * + * @generated + * @ordered + */ + int MANUAL_GENERATION__EXTENSION_BODY = 0; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int MANUAL_GENERATION__BASE_CLASS = 1; + + /** + * The number of structural features of the 'Manual Generation' class. + * + * + * @generated + * @ordered + */ + int MANUAL_GENERATION_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Manual Generation' class. + * + * + * @generated + * @ordered + */ + int MANUAL_GENERATION_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl Extern Library}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getExternLibrary() + * @generated + */ + int EXTERN_LIBRARY = 3; + + /** + * The feature id for the 'Include Paths' attribute list. + * + * + * @generated + * @ordered + */ + int EXTERN_LIBRARY__INCLUDE_PATHS = 0; + + /** + * The feature id for the 'Base package' reference. + * + * + * @generated + * @ordered + */ + int EXTERN_LIBRARY__BASE_PACKAGE = 1; + + /** + * The feature id for the 'Lib Paths' attribute list. + * + * + * @generated + * @ordered + */ + int EXTERN_LIBRARY__LIB_PATHS = 2; + + /** + * The feature id for the 'Macros' attribute list. + * + * + * @generated + * @ordered + */ + int EXTERN_LIBRARY__MACROS = 3; + + /** + * The feature id for the 'Libs' attribute list. + * + * + * @generated + * @ordered + */ + int EXTERN_LIBRARY__LIBS = 4; + + /** + * The feature id for the 'Includes' attribute list. + * + * + * @generated + * @ordered + */ + int EXTERN_LIBRARY__INCLUDES = 5; + + /** + * The number of structural features of the 'Extern Library' class. + * + * + * @generated + * @ordered + */ + int EXTERN_LIBRARY_FEATURE_COUNT = 6; + + /** + * The number of operations of the 'Extern Library' class. + * + * + * @generated + * @ordered + */ + int EXTERN_LIBRARY_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.NoCodeGenImpl No Code Gen}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.NoCodeGenImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getNoCodeGen() + * @generated + */ + int NO_CODE_GEN = 4; + + /** + * The feature id for the 'Base element' reference. + * + * + * @generated + * @ordered + */ + int NO_CODE_GEN__BASE_ELEMENT = 0; + + /** + * The number of structural features of the 'No Code Gen' class. + * + * + * @generated + * @ordered + */ + int NO_CODE_GEN_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'No Code Gen' class. + * + * + * @generated + * @ordered + */ + int NO_CODE_GEN_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.CppRootImpl Cpp Root}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.CppRootImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getCppRoot() + * @generated + */ + int CPP_ROOT = 5; + + /** + * The feature id for the 'Base package' reference. + * + * + * @generated + * @ordered + */ + int CPP_ROOT__BASE_PACKAGE = 0; + + /** + * The number of structural features of the 'Cpp Root' class. + * + * + * @generated + * @ordered + */ + int CPP_ROOT_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Cpp Root' class. + * + * + * @generated + * @ordered + */ + int CPP_ROOT_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.ArrayImpl Array}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.ArrayImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getArray() + * @generated + */ + int ARRAY = 6; + + /** + * The feature id for the 'Base parameter' reference. + * + * + * @generated + * @ordered + */ + int ARRAY__BASE_PARAMETER = 0; + + /** + * The feature id for the 'Definition' attribute. + * + * + * @generated + * @ordered + */ + int ARRAY__DEFINITION = 1; + + /** + * The feature id for the 'Base property' reference. + * + * + * @generated + * @ordered + */ + int ARRAY__BASE_PROPERTY = 2; + + /** + * The feature id for the 'Base association' reference. + * + * + * @generated + * @ordered + */ + int ARRAY__BASE_ASSOCIATION = 3; + + /** + * The number of structural features of the 'Array' class. + * + * + * @generated + * @ordered + */ + int ARRAY_FEATURE_COUNT = 4; + + /** + * The number of operations of the 'Array' class. + * + * + * @generated + * @ordered + */ + int ARRAY_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.ConstImpl Const}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.ConstImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getConst() + * @generated + */ + int CONST = 7; + + /** + * The feature id for the 'Base parameter' reference. + * + * + * @generated + * @ordered + */ + int CONST__BASE_PARAMETER = 0; + + /** + * The feature id for the 'Base property' reference. + * + * + * @generated + * @ordered + */ + int CONST__BASE_PROPERTY = 1; + + /** + * The feature id for the 'Base operation' reference. + * + * + * @generated + * @ordered + */ + int CONST__BASE_OPERATION = 2; + + /** + * The number of structural features of the 'Const' class. + * + * + * @generated + * @ordered + */ + int CONST_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'Const' class. + * + * + * @generated + * @ordered + */ + int CONST_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.RefImpl Ref}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.RefImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getRef() + * @generated + */ + int REF = 8; + + /** + * The feature id for the 'Base parameter' reference. + * + * + * @generated + * @ordered + */ + int REF__BASE_PARAMETER = 0; + + /** + * The feature id for the 'Base property' reference. + * + * + * @generated + * @ordered + */ + int REF__BASE_PROPERTY = 1; + + /** + * The number of structural features of the 'Ref' class. + * + * + * @generated + * @ordered + */ + int REF_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Ref' class. + * + * + * @generated + * @ordered + */ + int REF_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.ExternalImpl External}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.ExternalImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getExternal() + * @generated + */ + int EXTERNAL = 9; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int EXTERNAL__NAME = 0; + + /** + * The feature id for the 'Base Classifier' reference. + * + * + * @generated + * @ordered + */ + int EXTERNAL__BASE_CLASSIFIER = 1; + + /** + * The number of structural features of the 'External' class. + * + * + * @generated + * @ordered + */ + int EXTERNAL_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'External' class. + * + * + * @generated + * @ordered + */ + int EXTERNAL_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.ConstInitImpl Const Init}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.ConstInitImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getConstInit() + * @generated + */ + int CONST_INIT = 10; + + /** + * The feature id for the 'Initialisation' attribute. + * + * + * @generated + * @ordered + */ + int CONST_INIT__INITIALISATION = 0; + + /** + * The feature id for the 'Base operation' reference. + * + * + * @generated + * @ordered + */ + int CONST_INIT__BASE_OPERATION = 1; + + /** + * The number of structural features of the 'Const Init' class. + * + * + * @generated + * @ordered + */ + int CONST_INIT_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Const Init' class. + * + * + * @generated + * @ordered + */ + int CONST_INIT_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.FriendImpl Friend}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.FriendImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getFriend() + * @generated + */ + int FRIEND = 11; + + /** + * The feature id for the 'Base dependency' reference. + * + * + * @generated + * @ordered + */ + int FRIEND__BASE_DEPENDENCY = 0; + + /** + * The feature id for the 'Base operation' reference. + * + * + * @generated + * @ordered + */ + int FRIEND__BASE_OPERATION = 1; + + /** + * The number of structural features of the 'Friend' class. + * + * + * @generated + * @ordered + */ + int FRIEND_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Friend' class. + * + * + * @generated + * @ordered + */ + int FRIEND_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.InlineImpl Inline}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.InlineImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getInline() + * @generated + */ + int INLINE = 12; + + /** + * The feature id for the 'Base operation' reference. + * + * + * @generated + * @ordered + */ + int INLINE__BASE_OPERATION = 0; + + /** + * The number of structural features of the 'Inline' class. + * + * + * @generated + * @ordered + */ + int INLINE_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Inline' class. + * + * + * @generated + * @ordered + */ + int INLINE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.VirtualImpl Virtual}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.VirtualImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVirtual() + * @generated + */ + int VIRTUAL = 13; + + /** + * The feature id for the 'Base operation' reference. + * + * + * @generated + * @ordered + */ + int VIRTUAL__BASE_OPERATION = 0; + + /** + * The number of structural features of the 'Virtual' class. + * + * + * @generated + * @ordered + */ + int VIRTUAL_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Virtual' class. + * + * + * @generated + * @ordered + */ + int VIRTUAL_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.TypedefImpl Typedef}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.TypedefImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTypedef() + * @generated + */ + int TYPEDEF = 14; + + /** + * The feature id for the 'Definition' attribute. + * + * + * @generated + * @ordered + */ + int TYPEDEF__DEFINITION = 0; + + /** + * The feature id for the 'Base primitivetype' reference. + * + * + * @generated + * @ordered + */ + int TYPEDEF__BASE_PRIMITIVETYPE = 1; + + /** + * The number of structural features of the 'Typedef' class. + * + * + * @generated + * @ordered + */ + int TYPEDEF_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Typedef' class. + * + * + * @generated + * @ordered + */ + int TYPEDEF_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.VisibilityImpl Visibility}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.VisibilityImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVisibility() + * @generated + */ + int VISIBILITY = 15; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int VISIBILITY__VALUE = 0; + + /** + * The feature id for the 'Base generalization' reference. + * + * + * @generated + * @ordered + */ + int VISIBILITY__BASE_GENERALIZATION = 1; + + /** + * The number of structural features of the 'Visibility' class. + * + * + * @generated + * @ordered + */ + int VISIBILITY_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Visibility' class. + * + * + * @generated + * @ordered + */ + int VISIBILITY_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.CppInitImpl Cpp Init}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.CppInitImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getCppInit() + * @generated + */ + int CPP_INIT = 16; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int CPP_INIT__VALUE = 0; + + /** + * The feature id for the 'Base enumerationliteral' reference. + * + * + * @generated + * @ordered + */ + int CPP_INIT__BASE_ENUMERATIONLITERAL = 1; + + /** + * The number of structural features of the 'Cpp Init' class. + * + * + * @generated + * @ordered + */ + int CPP_INIT_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Cpp Init' class. + * + * + * @generated + * @ordered + */ + int CPP_INIT_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.TemplateImpl Template}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.TemplateImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTemplate() + * @generated + */ + int TEMPLATE = 17; + + /** + * The feature id for the 'Declaration' attribute. + * + * + * @generated + * @ordered + */ + int TEMPLATE__DECLARATION = 0; + + /** + * The feature id for the 'Base class' reference. + * + * + * @generated + * @ordered + */ + int TEMPLATE__BASE_CLASS = 1; + + /** + * The number of structural features of the 'Template' class. + * + * + * @generated + * @ordered + */ + int TEMPLATE_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Template' class. + * + * + * @generated + * @ordered + */ + int TEMPLATE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.TemplateBindingImpl Template Binding}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.TemplateBindingImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTemplateBinding() + * @generated + */ + int TEMPLATE_BINDING = 18; + + /** + * The feature id for the 'Binding' attribute. + * + * + * @generated + * @ordered + */ + int TEMPLATE_BINDING__BINDING = 0; + + /** + * The feature id for the 'Base templatebinding' reference. + * + * + * @generated + * @ordered + */ + int TEMPLATE_BINDING__BASE_TEMPLATEBINDING = 1; + + /** + * The number of structural features of the 'Template Binding' class. + * + * + * @generated + * @ordered + */ + int TEMPLATE_BINDING_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Template Binding' class. + * + * + * @generated + * @ordered + */ + int TEMPLATE_BINDING_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.TemplateParameterImpl Template Parameter}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.TemplateParameterImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTemplateParameter() + * @generated + */ + int TEMPLATE_PARAMETER = 19; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int TEMPLATE_PARAMETER__NAME = 0; + + /** + * The feature id for the 'Base templateparameter' reference. + * + * + * @generated + * @ordered + */ + int TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER = 1; + + /** + * The number of structural features of the 'Template Parameter' class. + * + * + * @generated + * @ordered + */ + int TEMPLATE_PARAMETER_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Template Parameter' class. + * + * + * @generated + * @ordered + */ + int TEMPLATE_PARAMETER_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.UnionImpl Union}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.UnionImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getUnion() + * @generated + */ + int UNION = 20; + + /** + * The feature id for the 'Base Data Type' reference. + * + * + * @generated + * @ordered + */ + int UNION__BASE_DATA_TYPE = 0; + + /** + * The number of structural features of the 'Union' class. + * + * + * @generated + * @ordered + */ + int UNION_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Union' class. + * + * + * @generated + * @ordered + */ + int UNION_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl Storage Class}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getStorageClass() + * @generated + */ + int STORAGE_CLASS = 21; + + /** + * The feature id for the 'Storage Class' attribute. + * + * + * @generated + * @ordered + */ + int STORAGE_CLASS__STORAGE_CLASS = 0; + + /** + * The feature id for the 'Base Property' reference. + * + * + * @generated + * @ordered + */ + int STORAGE_CLASS__BASE_PROPERTY = 1; + + /** + * The feature id for the 'Base Parameter' reference. + * + * + * @generated + * @ordered + */ + int STORAGE_CLASS__BASE_PARAMETER = 2; + + /** + * The number of structural features of the 'Storage Class' class. + * + * + * @generated + * @ordered + */ + int STORAGE_CLASS_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'Storage Class' class. + * + * + * @generated + * @ordered + */ + int STORAGE_CLASS_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.VolatileImpl Volatile}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.VolatileImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVolatile() + * @generated + */ + int VOLATILE = 22; + + /** + * The feature id for the 'Base parameter' reference. + * + * + * @generated + * @ordered + */ + int VOLATILE__BASE_PARAMETER = 0; + + /** + * The feature id for the 'Base property' reference. + * + * + * @generated + * @ordered + */ + int VOLATILE__BASE_PROPERTY = 1; + + /** + * The feature id for the 'Base operation' reference. + * + * + * @generated + * @ordered + */ + int VOLATILE__BASE_OPERATION = 2; + + /** + * The number of structural features of the 'Volatile' class. + * + * + * @generated + * @ordered + */ + int VOLATILE_FEATURE_COUNT = 3; + + /** + * The number of operations of the 'Volatile' class. + * + * + * @generated + * @ordered + */ + int VOLATILE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.VariadicImpl Variadic}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.VariadicImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVariadic() + * @generated + */ + int VARIADIC = 23; + + /** + * The feature id for the 'Base operation' reference. + * + * + * @generated + * @ordered + */ + int VARIADIC__BASE_OPERATION = 0; + + /** + * The number of structural features of the 'Variadic' class. + * + * + * @generated + * @ordered + */ + int VARIADIC_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Variadic' class. + * + * + * @generated + * @ordered + */ + int VARIADIC_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.impl.MutableImpl Mutable}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.MutableImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getMutable() + * @generated + */ + int MUTABLE = 24; + + /** + * The feature id for the 'Base property' reference. + * + * + * @generated + * @ordered + */ + int MUTABLE__BASE_PROPERTY = 0; + + /** + * The number of structural features of the 'Mutable' class. + * + * + * @generated + * @ordered + */ + int MUTABLE_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Mutable' class. + * + * + * @generated + * @ordered + */ + int MUTABLE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.VisibilityKind Visibility Kind}' enum. + * + * + * @see org.eclipse.papyrus.C_Cpp.VisibilityKind + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVisibilityKind() + * @generated + */ + int VISIBILITY_KIND = 25; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.EAccessKind EAccess Kind}' enum. + * + * + * @see org.eclipse.papyrus.C_Cpp.EAccessKind + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getEAccessKind() + * @generated + */ + int EACCESS_KIND = 26; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.C_Cpp.EStorageClass EStorage Class}' enum. + * + * + * @see org.eclipse.papyrus.C_Cpp.EStorageClass + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getEStorageClass() + * @generated + */ + int ESTORAGE_CLASS = 27; + + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Ptr Ptr}'. + * + * + * @return the meta object for class 'Ptr'. + * @see org.eclipse.papyrus.C_Cpp.Ptr + * @generated + */ + EClass getPtr(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Ptr#getBase_parameter Base parameter}'. + * + * + * @return the meta object for the reference 'Base parameter'. + * @see org.eclipse.papyrus.C_Cpp.Ptr#getBase_parameter() + * @see #getPtr() + * @generated + */ + EReference getPtr_Base_parameter(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Ptr#getBase_property Base property}'. + * + * + * @return the meta object for the reference 'Base property'. + * @see org.eclipse.papyrus.C_Cpp.Ptr#getBase_property() + * @see #getPtr() + * @generated + */ + EReference getPtr_Base_property(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Ptr#getDeclaration Declaration}'. + * + * + * @return the meta object for the attribute 'Declaration'. + * @see org.eclipse.papyrus.C_Cpp.Ptr#getDeclaration() + * @see #getPtr() + * @generated + */ + EAttribute getPtr_Declaration(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Include Include}'. + * + * + * @return the meta object for class 'Include'. + * @see org.eclipse.papyrus.C_Cpp.Include + * @generated + */ + EClass getInclude(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Include#getBody Body}'. + * + * + * @return the meta object for the attribute 'Body'. + * @see org.eclipse.papyrus.C_Cpp.Include#getBody() + * @see #getInclude() + * @generated + */ + EAttribute getInclude_Body(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Include#getPreBody Pre Body}'. + * + * + * @return the meta object for the attribute 'Pre Body'. + * @see org.eclipse.papyrus.C_Cpp.Include#getPreBody() + * @see #getInclude() + * @generated + */ + EAttribute getInclude_PreBody(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Include#getHeader Header}'. + * + * + * @return the meta object for the attribute 'Header'. + * @see org.eclipse.papyrus.C_Cpp.Include#getHeader() + * @see #getInclude() + * @generated + */ + EAttribute getInclude_Header(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Include#getBase_package Base package}'. + * + * + * @return the meta object for the reference 'Base package'. + * @see org.eclipse.papyrus.C_Cpp.Include#getBase_package() + * @see #getInclude() + * @generated + */ + EReference getInclude_Base_package(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Include#getBase_class Base class}'. + * + * + * @return the meta object for the reference 'Base class'. + * @see org.eclipse.papyrus.C_Cpp.Include#getBase_class() + * @see #getInclude() + * @generated + */ + EReference getInclude_Base_class(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Include#getBase_Classifier Base Classifier}'. + * + * + * @return the meta object for the reference 'Base Classifier'. + * @see org.eclipse.papyrus.C_Cpp.Include#getBase_Classifier() + * @see #getInclude() + * @generated + */ + EReference getInclude_Base_Classifier(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.ManualGeneration Manual Generation}'. + * + * + * @return the meta object for class 'Manual Generation'. + * @see org.eclipse.papyrus.C_Cpp.ManualGeneration + * @generated + */ + EClass getManualGeneration(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.ManualGeneration#getExtensionBody Extension Body}'. + * + * + * @return the meta object for the attribute 'Extension Body'. + * @see org.eclipse.papyrus.C_Cpp.ManualGeneration#getExtensionBody() + * @see #getManualGeneration() + * @generated + */ + EAttribute getManualGeneration_ExtensionBody(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.ManualGeneration#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.C_Cpp.ManualGeneration#getBase_Class() + * @see #getManualGeneration() + * @generated + */ + EReference getManualGeneration_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary Extern Library}'. + * + * + * @return the meta object for class 'Extern Library'. + * @see org.eclipse.papyrus.C_Cpp.ExternLibrary + * @generated + */ + EClass getExternLibrary(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getIncludePaths Include Paths}'. + * + * + * @return the meta object for the attribute list 'Include Paths'. + * @see org.eclipse.papyrus.C_Cpp.ExternLibrary#getIncludePaths() + * @see #getExternLibrary() + * @generated + */ + EAttribute getExternLibrary_IncludePaths(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getBase_package Base package}'. + * + * + * @return the meta object for the reference 'Base package'. + * @see org.eclipse.papyrus.C_Cpp.ExternLibrary#getBase_package() + * @see #getExternLibrary() + * @generated + */ + EReference getExternLibrary_Base_package(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getLibPaths Lib Paths}'. + * + * + * @return the meta object for the attribute list 'Lib Paths'. + * @see org.eclipse.papyrus.C_Cpp.ExternLibrary#getLibPaths() + * @see #getExternLibrary() + * @generated + */ + EAttribute getExternLibrary_LibPaths(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getMacros Macros}'. + * + * + * @return the meta object for the attribute list 'Macros'. + * @see org.eclipse.papyrus.C_Cpp.ExternLibrary#getMacros() + * @see #getExternLibrary() + * @generated + */ + EAttribute getExternLibrary_Macros(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getLibs Libs}'. + * + * + * @return the meta object for the attribute list 'Libs'. + * @see org.eclipse.papyrus.C_Cpp.ExternLibrary#getLibs() + * @see #getExternLibrary() + * @generated + */ + EAttribute getExternLibrary_Libs(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getIncludes Includes}'. + * + * + * @return the meta object for the attribute list 'Includes'. + * @see org.eclipse.papyrus.C_Cpp.ExternLibrary#getIncludes() + * @see #getExternLibrary() + * @generated + */ + EAttribute getExternLibrary_Includes(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.NoCodeGen No Code Gen}'. + * + * + * @return the meta object for class 'No Code Gen'. + * @see org.eclipse.papyrus.C_Cpp.NoCodeGen + * @generated + */ + EClass getNoCodeGen(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.NoCodeGen#getBase_element Base element}'. + * + * + * @return the meta object for the reference 'Base element'. + * @see org.eclipse.papyrus.C_Cpp.NoCodeGen#getBase_element() + * @see #getNoCodeGen() + * @generated + */ + EReference getNoCodeGen_Base_element(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.CppRoot Cpp Root}'. + * + * + * @return the meta object for class 'Cpp Root'. + * @see org.eclipse.papyrus.C_Cpp.CppRoot + * @generated + */ + EClass getCppRoot(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.CppRoot#getBase_package Base package}'. + * + * + * @return the meta object for the reference 'Base package'. + * @see org.eclipse.papyrus.C_Cpp.CppRoot#getBase_package() + * @see #getCppRoot() + * @generated + */ + EReference getCppRoot_Base_package(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Array Array}'. + * + * + * @return the meta object for class 'Array'. + * @see org.eclipse.papyrus.C_Cpp.Array + * @generated + */ + EClass getArray(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Array#getBase_parameter Base parameter}'. + * + * + * @return the meta object for the reference 'Base parameter'. + * @see org.eclipse.papyrus.C_Cpp.Array#getBase_parameter() + * @see #getArray() + * @generated + */ + EReference getArray_Base_parameter(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Array#getDefinition Definition}'. + * + * + * @return the meta object for the attribute 'Definition'. + * @see org.eclipse.papyrus.C_Cpp.Array#getDefinition() + * @see #getArray() + * @generated + */ + EAttribute getArray_Definition(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Array#getBase_property Base property}'. + * + * + * @return the meta object for the reference 'Base property'. + * @see org.eclipse.papyrus.C_Cpp.Array#getBase_property() + * @see #getArray() + * @generated + */ + EReference getArray_Base_property(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Array#getBase_association Base association}'. + * + * + * @return the meta object for the reference 'Base association'. + * @see org.eclipse.papyrus.C_Cpp.Array#getBase_association() + * @see #getArray() + * @generated + */ + EReference getArray_Base_association(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Const Const}'. + * + * + * @return the meta object for class 'Const'. + * @see org.eclipse.papyrus.C_Cpp.Const + * @generated + */ + EClass getConst(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Const#getBase_parameter Base parameter}'. + * + * + * @return the meta object for the reference 'Base parameter'. + * @see org.eclipse.papyrus.C_Cpp.Const#getBase_parameter() + * @see #getConst() + * @generated + */ + EReference getConst_Base_parameter(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Const#getBase_property Base property}'. + * + * + * @return the meta object for the reference 'Base property'. + * @see org.eclipse.papyrus.C_Cpp.Const#getBase_property() + * @see #getConst() + * @generated + */ + EReference getConst_Base_property(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Const#getBase_operation Base operation}'. + * + * + * @return the meta object for the reference 'Base operation'. + * @see org.eclipse.papyrus.C_Cpp.Const#getBase_operation() + * @see #getConst() + * @generated + */ + EReference getConst_Base_operation(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Ref Ref}'. + * + * + * @return the meta object for class 'Ref'. + * @see org.eclipse.papyrus.C_Cpp.Ref + * @generated + */ + EClass getRef(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Ref#getBase_parameter Base parameter}'. + * + * + * @return the meta object for the reference 'Base parameter'. + * @see org.eclipse.papyrus.C_Cpp.Ref#getBase_parameter() + * @see #getRef() + * @generated + */ + EReference getRef_Base_parameter(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Ref#getBase_property Base property}'. + * + * + * @return the meta object for the reference 'Base property'. + * @see org.eclipse.papyrus.C_Cpp.Ref#getBase_property() + * @see #getRef() + * @generated + */ + EReference getRef_Base_property(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.External External}'. + * + * + * @return the meta object for class 'External'. + * @see org.eclipse.papyrus.C_Cpp.External + * @generated + */ + EClass getExternal(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.External#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.papyrus.C_Cpp.External#getName() + * @see #getExternal() + * @generated + */ + EAttribute getExternal_Name(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.External#getBase_Classifier Base Classifier}'. + * + * + * @return the meta object for the reference 'Base Classifier'. + * @see org.eclipse.papyrus.C_Cpp.External#getBase_Classifier() + * @see #getExternal() + * @generated + */ + EReference getExternal_Base_Classifier(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.ConstInit Const Init}'. + * + * + * @return the meta object for class 'Const Init'. + * @see org.eclipse.papyrus.C_Cpp.ConstInit + * @generated + */ + EClass getConstInit(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.ConstInit#getInitialisation Initialisation}'. + * + * + * @return the meta object for the attribute 'Initialisation'. + * @see org.eclipse.papyrus.C_Cpp.ConstInit#getInitialisation() + * @see #getConstInit() + * @generated + */ + EAttribute getConstInit_Initialisation(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.ConstInit#getBase_operation Base operation}'. + * + * + * @return the meta object for the reference 'Base operation'. + * @see org.eclipse.papyrus.C_Cpp.ConstInit#getBase_operation() + * @see #getConstInit() + * @generated + */ + EReference getConstInit_Base_operation(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Friend Friend}'. + * + * + * @return the meta object for class 'Friend'. + * @see org.eclipse.papyrus.C_Cpp.Friend + * @generated + */ + EClass getFriend(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Friend#getBase_dependency Base dependency}'. + * + * + * @return the meta object for the reference 'Base dependency'. + * @see org.eclipse.papyrus.C_Cpp.Friend#getBase_dependency() + * @see #getFriend() + * @generated + */ + EReference getFriend_Base_dependency(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Friend#getBase_operation Base operation}'. + * + * + * @return the meta object for the reference 'Base operation'. + * @see org.eclipse.papyrus.C_Cpp.Friend#getBase_operation() + * @see #getFriend() + * @generated + */ + EReference getFriend_Base_operation(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Inline Inline}'. + * + * + * @return the meta object for class 'Inline'. + * @see org.eclipse.papyrus.C_Cpp.Inline + * @generated + */ + EClass getInline(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Inline#getBase_operation Base operation}'. + * + * + * @return the meta object for the reference 'Base operation'. + * @see org.eclipse.papyrus.C_Cpp.Inline#getBase_operation() + * @see #getInline() + * @generated + */ + EReference getInline_Base_operation(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Virtual Virtual}'. + * + * + * @return the meta object for class 'Virtual'. + * @see org.eclipse.papyrus.C_Cpp.Virtual + * @generated + */ + EClass getVirtual(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Virtual#getBase_operation Base operation}'. + * + * + * @return the meta object for the reference 'Base operation'. + * @see org.eclipse.papyrus.C_Cpp.Virtual#getBase_operation() + * @see #getVirtual() + * @generated + */ + EReference getVirtual_Base_operation(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Typedef Typedef}'. + * + * + * @return the meta object for class 'Typedef'. + * @see org.eclipse.papyrus.C_Cpp.Typedef + * @generated + */ + EClass getTypedef(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Typedef#getDefinition Definition}'. + * + * + * @return the meta object for the attribute 'Definition'. + * @see org.eclipse.papyrus.C_Cpp.Typedef#getDefinition() + * @see #getTypedef() + * @generated + */ + EAttribute getTypedef_Definition(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Typedef#getBase_primitivetype Base primitivetype}'. + * + * + * @return the meta object for the reference 'Base primitivetype'. + * @see org.eclipse.papyrus.C_Cpp.Typedef#getBase_primitivetype() + * @see #getTypedef() + * @generated + */ + EReference getTypedef_Base_primitivetype(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Visibility Visibility}'. + * + * + * @return the meta object for class 'Visibility'. + * @see org.eclipse.papyrus.C_Cpp.Visibility + * @generated + */ + EClass getVisibility(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Visibility#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see org.eclipse.papyrus.C_Cpp.Visibility#getValue() + * @see #getVisibility() + * @generated + */ + EAttribute getVisibility_Value(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Visibility#getBase_generalization Base generalization}'. + * + * + * @return the meta object for the reference 'Base generalization'. + * @see org.eclipse.papyrus.C_Cpp.Visibility#getBase_generalization() + * @see #getVisibility() + * @generated + */ + EReference getVisibility_Base_generalization(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.CppInit Cpp Init}'. + * + * + * @return the meta object for class 'Cpp Init'. + * @see org.eclipse.papyrus.C_Cpp.CppInit + * @generated + */ + EClass getCppInit(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.CppInit#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see org.eclipse.papyrus.C_Cpp.CppInit#getValue() + * @see #getCppInit() + * @generated + */ + EAttribute getCppInit_Value(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.CppInit#getBase_enumerationliteral Base enumerationliteral}'. + * + * + * @return the meta object for the reference 'Base enumerationliteral'. + * @see org.eclipse.papyrus.C_Cpp.CppInit#getBase_enumerationliteral() + * @see #getCppInit() + * @generated + */ + EReference getCppInit_Base_enumerationliteral(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Template Template}'. + * + * + * @return the meta object for class 'Template'. + * @see org.eclipse.papyrus.C_Cpp.Template + * @generated + */ + EClass getTemplate(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.Template#getDeclaration Declaration}'. + * + * + * @return the meta object for the attribute 'Declaration'. + * @see org.eclipse.papyrus.C_Cpp.Template#getDeclaration() + * @see #getTemplate() + * @generated + */ + EAttribute getTemplate_Declaration(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Template#getBase_class Base class}'. + * + * + * @return the meta object for the reference 'Base class'. + * @see org.eclipse.papyrus.C_Cpp.Template#getBase_class() + * @see #getTemplate() + * @generated + */ + EReference getTemplate_Base_class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.TemplateBinding Template Binding}'. + * + * + * @return the meta object for class 'Template Binding'. + * @see org.eclipse.papyrus.C_Cpp.TemplateBinding + * @generated + */ + EClass getTemplateBinding(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.TemplateBinding#getBinding Binding}'. + * + * + * @return the meta object for the attribute 'Binding'. + * @see org.eclipse.papyrus.C_Cpp.TemplateBinding#getBinding() + * @see #getTemplateBinding() + * @generated + */ + EAttribute getTemplateBinding_Binding(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.TemplateBinding#getBase_templatebinding Base templatebinding}'. + * + * + * @return the meta object for the reference 'Base templatebinding'. + * @see org.eclipse.papyrus.C_Cpp.TemplateBinding#getBase_templatebinding() + * @see #getTemplateBinding() + * @generated + */ + EReference getTemplateBinding_Base_templatebinding(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.TemplateParameter Template Parameter}'. + * + * + * @return the meta object for class 'Template Parameter'. + * @see org.eclipse.papyrus.C_Cpp.TemplateParameter + * @generated + */ + EClass getTemplateParameter(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.TemplateParameter#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.papyrus.C_Cpp.TemplateParameter#getName() + * @see #getTemplateParameter() + * @generated + */ + EAttribute getTemplateParameter_Name(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.TemplateParameter#getBase_templateparameter Base templateparameter}'. + * + * + * @return the meta object for the reference 'Base templateparameter'. + * @see org.eclipse.papyrus.C_Cpp.TemplateParameter#getBase_templateparameter() + * @see #getTemplateParameter() + * @generated + */ + EReference getTemplateParameter_Base_templateparameter(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Union Union}'. + * + * + * @return the meta object for class 'Union'. + * @see org.eclipse.papyrus.C_Cpp.Union + * @generated + */ + EClass getUnion(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Union#getBase_DataType Base Data Type}'. + * + * + * @return the meta object for the reference 'Base Data Type'. + * @see org.eclipse.papyrus.C_Cpp.Union#getBase_DataType() + * @see #getUnion() + * @generated + */ + EReference getUnion_Base_DataType(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.StorageClass Storage Class}'. + * + * + * @return the meta object for class 'Storage Class'. + * @see org.eclipse.papyrus.C_Cpp.StorageClass + * @generated + */ + EClass getStorageClass(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.C_Cpp.StorageClass#getStorageClass Storage Class}'. + * + * + * @return the meta object for the attribute 'Storage Class'. + * @see org.eclipse.papyrus.C_Cpp.StorageClass#getStorageClass() + * @see #getStorageClass() + * @generated + */ + EAttribute getStorageClass_StorageClass(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Property Base Property}'. + * + * + * @return the meta object for the reference 'Base Property'. + * @see org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Property() + * @see #getStorageClass() + * @generated + */ + EReference getStorageClass_Base_Property(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Parameter Base Parameter}'. + * + * + * @return the meta object for the reference 'Base Parameter'. + * @see org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Parameter() + * @see #getStorageClass() + * @generated + */ + EReference getStorageClass_Base_Parameter(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Volatile Volatile}'. + * + * + * @return the meta object for class 'Volatile'. + * @see org.eclipse.papyrus.C_Cpp.Volatile + * @generated + */ + EClass getVolatile(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_parameter Base parameter}'. + * + * + * @return the meta object for the reference 'Base parameter'. + * @see org.eclipse.papyrus.C_Cpp.Volatile#getBase_parameter() + * @see #getVolatile() + * @generated + */ + EReference getVolatile_Base_parameter(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_property Base property}'. + * + * + * @return the meta object for the reference 'Base property'. + * @see org.eclipse.papyrus.C_Cpp.Volatile#getBase_property() + * @see #getVolatile() + * @generated + */ + EReference getVolatile_Base_property(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_operation Base operation}'. + * + * + * @return the meta object for the reference 'Base operation'. + * @see org.eclipse.papyrus.C_Cpp.Volatile#getBase_operation() + * @see #getVolatile() + * @generated + */ + EReference getVolatile_Base_operation(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Variadic Variadic}'. + * + * + * @return the meta object for class 'Variadic'. + * @see org.eclipse.papyrus.C_Cpp.Variadic + * @generated + */ + EClass getVariadic(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Variadic#getBase_operation Base operation}'. + * + * + * @return the meta object for the reference 'Base operation'. + * @see org.eclipse.papyrus.C_Cpp.Variadic#getBase_operation() + * @see #getVariadic() + * @generated + */ + EReference getVariadic_Base_operation(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.C_Cpp.Mutable Mutable}'. + * + * + * @return the meta object for class 'Mutable'. + * @see org.eclipse.papyrus.C_Cpp.Mutable + * @generated + */ + EClass getMutable(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.C_Cpp.Mutable#getBase_property Base property}'. + * + * + * @return the meta object for the reference 'Base property'. + * @see org.eclipse.papyrus.C_Cpp.Mutable#getBase_property() + * @see #getMutable() + * @generated + */ + EReference getMutable_Base_property(); + + /** + * Returns the meta object for enum '{@link org.eclipse.papyrus.C_Cpp.VisibilityKind Visibility Kind}'. + * + * + * @return the meta object for enum 'Visibility Kind'. + * @see org.eclipse.papyrus.C_Cpp.VisibilityKind + * @generated + */ + EEnum getVisibilityKind(); + + /** + * Returns the meta object for enum '{@link org.eclipse.papyrus.C_Cpp.EAccessKind EAccess Kind}'. + * + * + * @return the meta object for enum 'EAccess Kind'. + * @see org.eclipse.papyrus.C_Cpp.EAccessKind + * @generated + */ + EEnum getEAccessKind(); + + /** + * Returns the meta object for enum '{@link org.eclipse.papyrus.C_Cpp.EStorageClass EStorage Class}'. + * + * + * @return the meta object for enum 'EStorage Class'. + * @see org.eclipse.papyrus.C_Cpp.EStorageClass + * @generated + */ + EEnum getEStorageClass(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + C_CppFactory getC_CppFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
      + *
    • each class,
    • + *
    • each feature of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.PtrImpl Ptr}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.PtrImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getPtr() + * @generated + */ + EClass PTR = eINSTANCE.getPtr(); + + /** + * The meta object literal for the 'Base parameter' reference feature. + * + * + * @generated + */ + EReference PTR__BASE_PARAMETER = eINSTANCE.getPtr_Base_parameter(); + + /** + * The meta object literal for the 'Base property' reference feature. + * + * + * @generated + */ + EReference PTR__BASE_PROPERTY = eINSTANCE.getPtr_Base_property(); + + /** + * The meta object literal for the 'Declaration' attribute feature. + * + * + * @generated + */ + EAttribute PTR__DECLARATION = eINSTANCE.getPtr_Declaration(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl Include}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.IncludeImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getInclude() + * @generated + */ + EClass INCLUDE = eINSTANCE.getInclude(); + + /** + * The meta object literal for the 'Body' attribute feature. + * + * + * @generated + */ + EAttribute INCLUDE__BODY = eINSTANCE.getInclude_Body(); + + /** + * The meta object literal for the 'Pre Body' attribute feature. + * + * + * @generated + */ + EAttribute INCLUDE__PRE_BODY = eINSTANCE.getInclude_PreBody(); + + /** + * The meta object literal for the 'Header' attribute feature. + * + * + * @generated + */ + EAttribute INCLUDE__HEADER = eINSTANCE.getInclude_Header(); + + /** + * The meta object literal for the 'Base package' reference feature. + * + * + * @generated + */ + EReference INCLUDE__BASE_PACKAGE = eINSTANCE.getInclude_Base_package(); + + /** + * The meta object literal for the 'Base class' reference feature. + * + * + * @generated + */ + EReference INCLUDE__BASE_CLASS = eINSTANCE.getInclude_Base_class(); + + /** + * The meta object literal for the 'Base Classifier' reference feature. + * + * + * @generated + */ + EReference INCLUDE__BASE_CLASSIFIER = eINSTANCE.getInclude_Base_Classifier(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.ManualGenerationImpl Manual Generation}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.ManualGenerationImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getManualGeneration() + * @generated + */ + EClass MANUAL_GENERATION = eINSTANCE.getManualGeneration(); + + /** + * The meta object literal for the 'Extension Body' attribute feature. + * + * + * @generated + */ + EAttribute MANUAL_GENERATION__EXTENSION_BODY = eINSTANCE.getManualGeneration_ExtensionBody(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference MANUAL_GENERATION__BASE_CLASS = eINSTANCE.getManualGeneration_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl Extern Library}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getExternLibrary() + * @generated + */ + EClass EXTERN_LIBRARY = eINSTANCE.getExternLibrary(); + + /** + * The meta object literal for the 'Include Paths' attribute list feature. + * + * + * @generated + */ + EAttribute EXTERN_LIBRARY__INCLUDE_PATHS = eINSTANCE.getExternLibrary_IncludePaths(); + + /** + * The meta object literal for the 'Base package' reference feature. + * + * + * @generated + */ + EReference EXTERN_LIBRARY__BASE_PACKAGE = eINSTANCE.getExternLibrary_Base_package(); + + /** + * The meta object literal for the 'Lib Paths' attribute list feature. + * + * + * @generated + */ + EAttribute EXTERN_LIBRARY__LIB_PATHS = eINSTANCE.getExternLibrary_LibPaths(); + + /** + * The meta object literal for the 'Macros' attribute list feature. + * + * + * @generated + */ + EAttribute EXTERN_LIBRARY__MACROS = eINSTANCE.getExternLibrary_Macros(); + + /** + * The meta object literal for the 'Libs' attribute list feature. + * + * + * @generated + */ + EAttribute EXTERN_LIBRARY__LIBS = eINSTANCE.getExternLibrary_Libs(); + + /** + * The meta object literal for the 'Includes' attribute list feature. + * + * + * @generated + */ + EAttribute EXTERN_LIBRARY__INCLUDES = eINSTANCE.getExternLibrary_Includes(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.NoCodeGenImpl No Code Gen}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.NoCodeGenImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getNoCodeGen() + * @generated + */ + EClass NO_CODE_GEN = eINSTANCE.getNoCodeGen(); + + /** + * The meta object literal for the 'Base element' reference feature. + * + * + * @generated + */ + EReference NO_CODE_GEN__BASE_ELEMENT = eINSTANCE.getNoCodeGen_Base_element(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.CppRootImpl Cpp Root}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.CppRootImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getCppRoot() + * @generated + */ + EClass CPP_ROOT = eINSTANCE.getCppRoot(); + + /** + * The meta object literal for the 'Base package' reference feature. + * + * + * @generated + */ + EReference CPP_ROOT__BASE_PACKAGE = eINSTANCE.getCppRoot_Base_package(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.ArrayImpl Array}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.ArrayImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getArray() + * @generated + */ + EClass ARRAY = eINSTANCE.getArray(); + + /** + * The meta object literal for the 'Base parameter' reference feature. + * + * + * @generated + */ + EReference ARRAY__BASE_PARAMETER = eINSTANCE.getArray_Base_parameter(); + + /** + * The meta object literal for the 'Definition' attribute feature. + * + * + * @generated + */ + EAttribute ARRAY__DEFINITION = eINSTANCE.getArray_Definition(); + + /** + * The meta object literal for the 'Base property' reference feature. + * + * + * @generated + */ + EReference ARRAY__BASE_PROPERTY = eINSTANCE.getArray_Base_property(); + + /** + * The meta object literal for the 'Base association' reference feature. + * + * + * @generated + */ + EReference ARRAY__BASE_ASSOCIATION = eINSTANCE.getArray_Base_association(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.ConstImpl Const}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.ConstImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getConst() + * @generated + */ + EClass CONST = eINSTANCE.getConst(); + + /** + * The meta object literal for the 'Base parameter' reference feature. + * + * + * @generated + */ + EReference CONST__BASE_PARAMETER = eINSTANCE.getConst_Base_parameter(); + + /** + * The meta object literal for the 'Base property' reference feature. + * + * + * @generated + */ + EReference CONST__BASE_PROPERTY = eINSTANCE.getConst_Base_property(); + + /** + * The meta object literal for the 'Base operation' reference feature. + * + * + * @generated + */ + EReference CONST__BASE_OPERATION = eINSTANCE.getConst_Base_operation(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.RefImpl Ref}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.RefImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getRef() + * @generated + */ + EClass REF = eINSTANCE.getRef(); + + /** + * The meta object literal for the 'Base parameter' reference feature. + * + * + * @generated + */ + EReference REF__BASE_PARAMETER = eINSTANCE.getRef_Base_parameter(); + + /** + * The meta object literal for the 'Base property' reference feature. + * + * + * @generated + */ + EReference REF__BASE_PROPERTY = eINSTANCE.getRef_Base_property(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.ExternalImpl External}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.ExternalImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getExternal() + * @generated + */ + EClass EXTERNAL = eINSTANCE.getExternal(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute EXTERNAL__NAME = eINSTANCE.getExternal_Name(); + + /** + * The meta object literal for the 'Base Classifier' reference feature. + * + * + * @generated + */ + EReference EXTERNAL__BASE_CLASSIFIER = eINSTANCE.getExternal_Base_Classifier(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.ConstInitImpl Const Init}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.ConstInitImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getConstInit() + * @generated + */ + EClass CONST_INIT = eINSTANCE.getConstInit(); + + /** + * The meta object literal for the 'Initialisation' attribute feature. + * + * + * @generated + */ + EAttribute CONST_INIT__INITIALISATION = eINSTANCE.getConstInit_Initialisation(); + + /** + * The meta object literal for the 'Base operation' reference feature. + * + * + * @generated + */ + EReference CONST_INIT__BASE_OPERATION = eINSTANCE.getConstInit_Base_operation(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.FriendImpl Friend}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.FriendImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getFriend() + * @generated + */ + EClass FRIEND = eINSTANCE.getFriend(); + + /** + * The meta object literal for the 'Base dependency' reference feature. + * + * + * @generated + */ + EReference FRIEND__BASE_DEPENDENCY = eINSTANCE.getFriend_Base_dependency(); + + /** + * The meta object literal for the 'Base operation' reference feature. + * + * + * @generated + */ + EReference FRIEND__BASE_OPERATION = eINSTANCE.getFriend_Base_operation(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.InlineImpl Inline}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.InlineImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getInline() + * @generated + */ + EClass INLINE = eINSTANCE.getInline(); + + /** + * The meta object literal for the 'Base operation' reference feature. + * + * + * @generated + */ + EReference INLINE__BASE_OPERATION = eINSTANCE.getInline_Base_operation(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.VirtualImpl Virtual}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.VirtualImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVirtual() + * @generated + */ + EClass VIRTUAL = eINSTANCE.getVirtual(); + + /** + * The meta object literal for the 'Base operation' reference feature. + * + * + * @generated + */ + EReference VIRTUAL__BASE_OPERATION = eINSTANCE.getVirtual_Base_operation(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.TypedefImpl Typedef}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.TypedefImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTypedef() + * @generated + */ + EClass TYPEDEF = eINSTANCE.getTypedef(); + + /** + * The meta object literal for the 'Definition' attribute feature. + * + * + * @generated + */ + EAttribute TYPEDEF__DEFINITION = eINSTANCE.getTypedef_Definition(); + + /** + * The meta object literal for the 'Base primitivetype' reference feature. + * + * + * @generated + */ + EReference TYPEDEF__BASE_PRIMITIVETYPE = eINSTANCE.getTypedef_Base_primitivetype(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.VisibilityImpl Visibility}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.VisibilityImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVisibility() + * @generated + */ + EClass VISIBILITY = eINSTANCE.getVisibility(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute VISIBILITY__VALUE = eINSTANCE.getVisibility_Value(); + + /** + * The meta object literal for the 'Base generalization' reference feature. + * + * + * @generated + */ + EReference VISIBILITY__BASE_GENERALIZATION = eINSTANCE.getVisibility_Base_generalization(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.CppInitImpl Cpp Init}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.CppInitImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getCppInit() + * @generated + */ + EClass CPP_INIT = eINSTANCE.getCppInit(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute CPP_INIT__VALUE = eINSTANCE.getCppInit_Value(); + + /** + * The meta object literal for the 'Base enumerationliteral' reference feature. + * + * + * @generated + */ + EReference CPP_INIT__BASE_ENUMERATIONLITERAL = eINSTANCE.getCppInit_Base_enumerationliteral(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.TemplateImpl Template}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.TemplateImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTemplate() + * @generated + */ + EClass TEMPLATE = eINSTANCE.getTemplate(); + + /** + * The meta object literal for the 'Declaration' attribute feature. + * + * + * @generated + */ + EAttribute TEMPLATE__DECLARATION = eINSTANCE.getTemplate_Declaration(); + + /** + * The meta object literal for the 'Base class' reference feature. + * + * + * @generated + */ + EReference TEMPLATE__BASE_CLASS = eINSTANCE.getTemplate_Base_class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.TemplateBindingImpl Template Binding}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.TemplateBindingImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTemplateBinding() + * @generated + */ + EClass TEMPLATE_BINDING = eINSTANCE.getTemplateBinding(); + + /** + * The meta object literal for the 'Binding' attribute feature. + * + * + * @generated + */ + EAttribute TEMPLATE_BINDING__BINDING = eINSTANCE.getTemplateBinding_Binding(); + + /** + * The meta object literal for the 'Base templatebinding' reference feature. + * + * + * @generated + */ + EReference TEMPLATE_BINDING__BASE_TEMPLATEBINDING = eINSTANCE.getTemplateBinding_Base_templatebinding(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.TemplateParameterImpl Template Parameter}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.TemplateParameterImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getTemplateParameter() + * @generated + */ + EClass TEMPLATE_PARAMETER = eINSTANCE.getTemplateParameter(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute TEMPLATE_PARAMETER__NAME = eINSTANCE.getTemplateParameter_Name(); + + /** + * The meta object literal for the 'Base templateparameter' reference feature. + * + * + * @generated + */ + EReference TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER = eINSTANCE.getTemplateParameter_Base_templateparameter(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.UnionImpl Union}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.UnionImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getUnion() + * @generated + */ + EClass UNION = eINSTANCE.getUnion(); + + /** + * The meta object literal for the 'Base Data Type' reference feature. + * + * + * @generated + */ + EReference UNION__BASE_DATA_TYPE = eINSTANCE.getUnion_Base_DataType(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl Storage Class}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getStorageClass() + * @generated + */ + EClass STORAGE_CLASS = eINSTANCE.getStorageClass(); + + /** + * The meta object literal for the 'Storage Class' attribute feature. + * + * + * @generated + */ + EAttribute STORAGE_CLASS__STORAGE_CLASS = eINSTANCE.getStorageClass_StorageClass(); + + /** + * The meta object literal for the 'Base Property' reference feature. + * + * + * @generated + */ + EReference STORAGE_CLASS__BASE_PROPERTY = eINSTANCE.getStorageClass_Base_Property(); + + /** + * The meta object literal for the 'Base Parameter' reference feature. + * + * + * @generated + */ + EReference STORAGE_CLASS__BASE_PARAMETER = eINSTANCE.getStorageClass_Base_Parameter(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.VolatileImpl Volatile}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.VolatileImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVolatile() + * @generated + */ + EClass VOLATILE = eINSTANCE.getVolatile(); + + /** + * The meta object literal for the 'Base parameter' reference feature. + * + * + * @generated + */ + EReference VOLATILE__BASE_PARAMETER = eINSTANCE.getVolatile_Base_parameter(); + + /** + * The meta object literal for the 'Base property' reference feature. + * + * + * @generated + */ + EReference VOLATILE__BASE_PROPERTY = eINSTANCE.getVolatile_Base_property(); + + /** + * The meta object literal for the 'Base operation' reference feature. + * + * + * @generated + */ + EReference VOLATILE__BASE_OPERATION = eINSTANCE.getVolatile_Base_operation(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.VariadicImpl Variadic}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.VariadicImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVariadic() + * @generated + */ + EClass VARIADIC = eINSTANCE.getVariadic(); + + /** + * The meta object literal for the 'Base operation' reference feature. + * + * + * @generated + */ + EReference VARIADIC__BASE_OPERATION = eINSTANCE.getVariadic_Base_operation(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.impl.MutableImpl Mutable}' class. + * + * + * @see org.eclipse.papyrus.C_Cpp.impl.MutableImpl + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getMutable() + * @generated + */ + EClass MUTABLE = eINSTANCE.getMutable(); + + /** + * The meta object literal for the 'Base property' reference feature. + * + * + * @generated + */ + EReference MUTABLE__BASE_PROPERTY = eINSTANCE.getMutable_Base_property(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.VisibilityKind Visibility Kind}' enum. + * + * + * @see org.eclipse.papyrus.C_Cpp.VisibilityKind + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getVisibilityKind() + * @generated + */ + EEnum VISIBILITY_KIND = eINSTANCE.getVisibilityKind(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.EAccessKind EAccess Kind}' enum. + * + * + * @see org.eclipse.papyrus.C_Cpp.EAccessKind + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getEAccessKind() + * @generated + */ + EEnum EACCESS_KIND = eINSTANCE.getEAccessKind(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.C_Cpp.EStorageClass EStorage Class}' enum. + * + * + * @see org.eclipse.papyrus.C_Cpp.EStorageClass + * @see org.eclipse.papyrus.C_Cpp.impl.C_CppPackageImpl#getEStorageClass() + * @generated + */ + EEnum ESTORAGE_CLASS = eINSTANCE.getEStorageClass(); + + } + +} // C_CppPackage diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Const.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Const.java new file mode 100644 index 00000000000..62008d61ba0 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Const.java @@ -0,0 +1,114 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Property; + +/** + * + * A representation of the model object 'Const'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Const#getBase_parameter Base parameter}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Const#getBase_property Base property}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Const#getBase_operation Base operation}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConst() + * @model + * @generated + */ +public interface Const extends EObject { + /** + * Returns the value of the 'Base parameter' reference. + * + *

    + * If the meaning of the 'Base parameter' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base parameter' reference. + * @see #setBase_parameter(Parameter) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConst_Base_parameter() + * @model ordered="false" + * @generated + */ + Parameter getBase_parameter(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Const#getBase_parameter Base parameter}' reference. + * + * + * @param value the new value of the 'Base parameter' reference. + * @see #getBase_parameter() + * @generated + */ + void setBase_parameter(Parameter value); + + /** + * Returns the value of the 'Base property' reference. + * + *

    + * If the meaning of the 'Base property' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base property' reference. + * @see #setBase_property(Property) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConst_Base_property() + * @model ordered="false" + * @generated + */ + Property getBase_property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Const#getBase_property Base property}' reference. + * + * + * @param value the new value of the 'Base property' reference. + * @see #getBase_property() + * @generated + */ + void setBase_property(Property value); + + /** + * Returns the value of the 'Base operation' reference. + * + *

    + * If the meaning of the 'Base operation' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base operation' reference. + * @see #setBase_operation(Operation) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConst_Base_operation() + * @model ordered="false" + * @generated + */ + Operation getBase_operation(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Const#getBase_operation Base operation}' reference. + * + * + * @param value the new value of the 'Base operation' reference. + * @see #getBase_operation() + * @generated + */ + void setBase_operation(Operation value); + +} // Const diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ConstInit.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ConstInit.java new file mode 100644 index 00000000000..70939be35c4 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ConstInit.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Operation; + +/** + * + * A representation of the model object 'Const Init'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.ConstInit#getInitialisation Initialisation}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.ConstInit#getBase_operation Base operation}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConstInit() + * @model + * @generated + */ +public interface ConstInit extends EObject { + /** + * Returns the value of the 'Initialisation' attribute. + * + *

    + * If the meaning of the 'Initialisation' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Initialisation' attribute. + * @see #setInitialisation(String) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConstInit_Initialisation() + * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" + * @generated + */ + String getInitialisation(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.ConstInit#getInitialisation Initialisation}' attribute. + * + * + * @param value the new value of the 'Initialisation' attribute. + * @see #getInitialisation() + * @generated + */ + void setInitialisation(String value); + + /** + * Returns the value of the 'Base operation' reference. + * + *

    + * If the meaning of the 'Base operation' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base operation' reference. + * @see #setBase_operation(Operation) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getConstInit_Base_operation() + * @model required="true" ordered="false" + * @generated + */ + Operation getBase_operation(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.ConstInit#getBase_operation Base operation}' reference. + * + * + * @param value the new value of the 'Base operation' reference. + * @see #getBase_operation() + * @generated + */ + void setBase_operation(Operation value); + +} // ConstInit diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppInit.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppInit.java new file mode 100644 index 00000000000..8f239695d33 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppInit.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.EnumerationLiteral; + +/** + * + * A representation of the model object 'Cpp Init'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.CppInit#getValue Value}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.CppInit#getBase_enumerationliteral Base enumerationliteral}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getCppInit() + * @model + * @generated + */ +public interface CppInit extends EObject { + /** + * Returns the value of the 'Value' attribute. + * + *

    + * If the meaning of the 'Value' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Value' attribute. + * @see #setValue(int) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getCppInit_Value() + * @model unique="false" dataType="org.eclipse.uml2.types.Integer" required="true" ordered="false" + * @generated + */ + int getValue(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.CppInit#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(int value); + + /** + * Returns the value of the 'Base enumerationliteral' reference. + * + *

    + * If the meaning of the 'Base enumerationliteral' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base enumerationliteral' reference. + * @see #setBase_enumerationliteral(EnumerationLiteral) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getCppInit_Base_enumerationliteral() + * @model required="true" ordered="false" + * @generated + */ + EnumerationLiteral getBase_enumerationliteral(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.CppInit#getBase_enumerationliteral Base enumerationliteral}' reference. + * + * + * @param value the new value of the 'Base enumerationliteral' reference. + * @see #getBase_enumerationliteral() + * @generated + */ + void setBase_enumerationliteral(EnumerationLiteral value); + +} // CppInit diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppRoot.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppRoot.java new file mode 100644 index 00000000000..2f603ef6f4e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/CppRoot.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Cpp Root'. + * + * + * + * Indicates that this package shoudl be a root package, i.e. its contents should appear on top level folder during generation. Currently not used + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.CppRoot#getBase_package Base package}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getCppRoot() + * @model + * @generated + */ +public interface CppRoot extends EObject { + /** + * Returns the value of the 'Base package' reference. + * + *

    + * If the meaning of the 'Base package' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base package' reference. + * @see #setBase_package(org.eclipse.uml2.uml.Package) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getCppRoot_Base_package() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Package getBase_package(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.CppRoot#getBase_package Base package}' reference. + * + * + * @param value the new value of the 'Base package' reference. + * @see #getBase_package() + * @generated + */ + void setBase_package(org.eclipse.uml2.uml.Package value); + +} // CppRoot diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EAccessKind.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EAccessKind.java new file mode 100644 index 00000000000..57a8c292c1f --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EAccessKind.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'EAccess Kind', + * and utility methods for working with them. + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getEAccessKind() + * @model + * @generated + */ +public enum EAccessKind implements Enumerator { + /** + * The 'Read' literal object. + * + * + * @see #READ_VALUE + * @generated + * @ordered + */ + READ(0, "read", "read"), //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Write' literal object. + * + * + * @see #WRITE_VALUE + * @generated + * @ordered + */ + WRITE(1, "write", "write"), //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Read Write' literal object. + * + * + * @see #READ_WRITE_VALUE + * @generated + * @ordered + */ + READ_WRITE(2, "readWrite", "readWrite"); //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Read' literal value. + * + *

    + * If the meaning of 'Read' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #READ + * @model name="read" + * @generated + * @ordered + */ + public static final int READ_VALUE = 0; + + /** + * The 'Write' literal value. + * + *

    + * If the meaning of 'Write' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #WRITE + * @model name="write" + * @generated + * @ordered + */ + public static final int WRITE_VALUE = 1; + + /** + * The 'Read Write' literal value. + * + *

    + * If the meaning of 'Read Write' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #READ_WRITE + * @model name="readWrite" + * @generated + * @ordered + */ + public static final int READ_WRITE_VALUE = 2; + + /** + * An array of all the 'EAccess Kind' enumerators. + * + * + * @generated + */ + private static final EAccessKind[] VALUES_ARRAY = + new EAccessKind[] { + READ, + WRITE, + READ_WRITE, + }; + + /** + * A public read-only list of all the 'EAccess Kind' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'EAccess Kind' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static EAccessKind get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + EAccessKind result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'EAccess Kind' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static EAccessKind getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + EAccessKind result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'EAccess Kind' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static EAccessKind get(int value) { + switch (value) { + case READ_VALUE: return READ; + case WRITE_VALUE: return WRITE; + case READ_WRITE_VALUE: return READ_WRITE; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private EAccessKind(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} // EAccessKind diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EStorageClass.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EStorageClass.java new file mode 100644 index 00000000000..09807524d5a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/EStorageClass.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'EStorage Class', + * and utility methods for working with them. + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getEStorageClass() + * @model + * @generated + */ +public enum EStorageClass implements Enumerator { + /** + * The 'Volatile' literal object. + * + * + * @see #VOLATILE_VALUE + * @generated + * @ordered + */ + VOLATILE(0, "volatile", "volatile"), //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Register' literal object. + * + * + * @see #REGISTER_VALUE + * @generated + * @ordered + */ + REGISTER(1, "register", "register"), //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Extern' literal object. + * + * + * @see #EXTERN_VALUE + * @generated + * @ordered + */ + EXTERN(2, "extern", "extern"); //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Volatile' literal value. + * + *

    + * If the meaning of 'Volatile' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #VOLATILE + * @model name="volatile" + * @generated + * @ordered + */ + public static final int VOLATILE_VALUE = 0; + + /** + * The 'Register' literal value. + * + *

    + * If the meaning of 'Register' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #REGISTER + * @model name="register" + * @generated + * @ordered + */ + public static final int REGISTER_VALUE = 1; + + /** + * The 'Extern' literal value. + * + *

    + * If the meaning of 'Extern' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #EXTERN + * @model name="extern" + * @generated + * @ordered + */ + public static final int EXTERN_VALUE = 2; + + /** + * An array of all the 'EStorage Class' enumerators. + * + * + * @generated + */ + private static final EStorageClass[] VALUES_ARRAY = + new EStorageClass[] { + VOLATILE, + REGISTER, + EXTERN, + }; + + /** + * A public read-only list of all the 'EStorage Class' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'EStorage Class' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static EStorageClass get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + EStorageClass result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'EStorage Class' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static EStorageClass getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + EStorageClass result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'EStorage Class' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static EStorageClass get(int value) { + switch (value) { + case VOLATILE_VALUE: return VOLATILE; + case REGISTER_VALUE: return REGISTER; + case EXTERN_VALUE: return EXTERN; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private EStorageClass(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} // EStorageClass diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ExternLibrary.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ExternLibrary.java new file mode 100644 index 00000000000..21811e3917f --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ExternLibrary.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Extern Library'. + * + * + * + * Mark a package as External Library. If this package is used, the associated CDT project will be configured accordingly. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getIncludePaths Include Paths}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getBase_package Base package}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getLibPaths Lib Paths}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getMacros Macros}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getLibs Libs}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getIncludes Includes}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary() + * @model + * @generated + */ +public interface ExternLibrary extends EObject { + /** + * Returns the value of the 'Include Paths' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

    + * If the meaning of the 'Include Paths' attribute list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Include Paths' attribute list. + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary_IncludePaths() + * @model unique="false" dataType="org.eclipse.uml2.types.String" ordered="false" + * @generated + */ + EList getIncludePaths(); + + /** + * Returns the value of the 'Base package' reference. + * + *

    + * If the meaning of the 'Base package' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base package' reference. + * @see #setBase_package(org.eclipse.uml2.uml.Package) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary_Base_package() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Package getBase_package(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary#getBase_package Base package}' reference. + * + * + * @param value the new value of the 'Base package' reference. + * @see #getBase_package() + * @generated + */ + void setBase_package(org.eclipse.uml2.uml.Package value); + + /** + * Returns the value of the 'Lib Paths' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

    + * If the meaning of the 'Lib Paths' attribute list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Lib Paths' attribute list. + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary_LibPaths() + * @model dataType="org.eclipse.uml2.types.String" ordered="false" + * @generated + */ + EList getLibPaths(); + + /** + * Returns the value of the 'Macros' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

    + * If the meaning of the 'Macros' attribute list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Macros' attribute list. + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary_Macros() + * @model dataType="org.eclipse.uml2.types.String" ordered="false" + * @generated + */ + EList getMacros(); + + /** + * Returns the value of the 'Libs' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

    + * If the meaning of the 'Libs' attribute list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Libs' attribute list. + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary_Libs() + * @model dataType="org.eclipse.uml2.types.String" ordered="false" + * @generated + */ + EList getLibs(); + + /** + * Returns the value of the 'Includes' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

    + * If the meaning of the 'Includes' attribute list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Includes' attribute list. + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternLibrary_Includes() + * @model dataType="org.eclipse.uml2.types.String" ordered="false" + * @generated + */ + EList getIncludes(); + +} // ExternLibrary diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/External.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/External.java new file mode 100644 index 00000000000..26d9af0e307 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/External.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Classifier; + +/** + * + * A representation of the model object 'External'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.External#getName Name}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.External#getBase_Classifier Base Classifier}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternal() + * @model + * @generated + */ +public interface External extends EObject { + /** + * Returns the value of the 'Name' attribute. + * + *

    + * If the meaning of the 'Name' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternal_Name() + * @model unique="false" dataType="org.eclipse.uml2.types.String" ordered="false" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.External#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Base Classifier' reference. + * + *

    + * If the meaning of the 'Base Classifier' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Classifier' reference. + * @see #setBase_Classifier(Classifier) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getExternal_Base_Classifier() + * @model required="true" ordered="false" + * @generated + */ + Classifier getBase_Classifier(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.External#getBase_Classifier Base Classifier}' reference. + * + * + * @param value the new value of the 'Base Classifier' reference. + * @see #getBase_Classifier() + * @generated + */ + void setBase_Classifier(Classifier value); + +} // External diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Friend.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Friend.java new file mode 100644 index 00000000000..3971ecf9257 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Friend.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Dependency; +import org.eclipse.uml2.uml.Operation; + +/** + * + * A representation of the model object 'Friend'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Friend#getBase_dependency Base dependency}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Friend#getBase_operation Base operation}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getFriend() + * @model + * @generated + */ +public interface Friend extends EObject { + /** + * Returns the value of the 'Base dependency' reference. + * + *

    + * If the meaning of the 'Base dependency' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base dependency' reference. + * @see #setBase_dependency(Dependency) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getFriend_Base_dependency() + * @model ordered="false" + * @generated + */ + Dependency getBase_dependency(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Friend#getBase_dependency Base dependency}' reference. + * + * + * @param value the new value of the 'Base dependency' reference. + * @see #getBase_dependency() + * @generated + */ + void setBase_dependency(Dependency value); + + /** + * Returns the value of the 'Base operation' reference. + * + *

    + * If the meaning of the 'Base operation' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base operation' reference. + * @see #setBase_operation(Operation) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getFriend_Base_operation() + * @model ordered="false" + * @generated + */ + Operation getBase_operation(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Friend#getBase_operation Base operation}' reference. + * + * + * @param value the new value of the 'Base operation' reference. + * @see #getBase_operation() + * @generated + */ + void setBase_operation(Operation value); + +} // Friend diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Include.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Include.java new file mode 100644 index 00000000000..734252a47b3 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Include.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Classifier; + +/** + * + * A representation of the model object 'Include'. + * + * + * + * An arbitrary string that is added to header and body file. Although primarily intended for manual include directives, it can be used for arbitrary definitions. + * "preBody" is added to a C++ body file before automatic include statements, "body" after + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Include#getBody Body}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Include#getPreBody Pre Body}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Include#getHeader Header}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Include#getBase_package Base package}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Include#getBase_class Base class}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Include#getBase_Classifier Base Classifier}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude() + * @model + * @generated + */ +public interface Include extends EObject { + /** + * Returns the value of the 'Body' attribute. + * The default value is "". + * + *

    + * If the meaning of the 'Body' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Body' attribute. + * @see #setBody(String) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude_Body() + * @model default="" dataType="org.eclipse.uml2.types.String" ordered="false" + * @generated + */ + String getBody(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Include#getBody Body}' attribute. + * + * + * @param value the new value of the 'Body' attribute. + * @see #getBody() + * @generated + */ + void setBody(String value); + + /** + * Returns the value of the 'Pre Body' attribute. + * The default value is "". + * + *

    + * If the meaning of the 'Pre Body' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Pre Body' attribute. + * @see #setPreBody(String) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude_PreBody() + * @model default="" dataType="org.eclipse.uml2.types.String" ordered="false" + * @generated + */ + String getPreBody(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Include#getPreBody Pre Body}' attribute. + * + * + * @param value the new value of the 'Pre Body' attribute. + * @see #getPreBody() + * @generated + */ + void setPreBody(String value); + + /** + * Returns the value of the 'Header' attribute. + * The default value is "". + * + *

    + * If the meaning of the 'Header' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Header' attribute. + * @see #setHeader(String) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude_Header() + * @model default="" dataType="org.eclipse.uml2.types.String" ordered="false" + * @generated + */ + String getHeader(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Include#getHeader Header}' attribute. + * + * + * @param value the new value of the 'Header' attribute. + * @see #getHeader() + * @generated + */ + void setHeader(String value); + + /** + * Returns the value of the 'Base package' reference. + * + *

    + * If the meaning of the 'Base package' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base package' reference. + * @see #setBase_package(org.eclipse.uml2.uml.Package) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude_Base_package() + * @model ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Package getBase_package(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Include#getBase_package Base package}' reference. + * + * + * @param value the new value of the 'Base package' reference. + * @see #getBase_package() + * @generated + */ + void setBase_package(org.eclipse.uml2.uml.Package value); + + /** + * Returns the value of the 'Base class' reference. + * + *

    + * If the meaning of the 'Base class' reference isn't clear, + * there really should be more of a description here... + *

    + * + * @return the value of the 'Base class' reference. + * @see #setBase_class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude_Base_class() + * @model ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Include#getBase_class Base class}' reference. + * + * + * @param value the new value of the 'Base class' reference. + * @see #getBase_class() + * @generated + */ + void setBase_class(org.eclipse.uml2.uml.Class value); + + /** + * Returns the value of the 'Base Classifier' reference. + * + *

    + * If the meaning of the 'Base Classifier' reference isn't clear, + * there really should be more of a description here... + *

    + * + * @return the value of the 'Base Classifier' reference. + * @see #setBase_Classifier(Classifier) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInclude_Base_Classifier() + * @model ordered="false" + * @generated + */ + Classifier getBase_Classifier(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Include#getBase_Classifier Base Classifier}' reference. + * + * + * @param value the new value of the 'Base Classifier' reference. + * @see #getBase_Classifier() + * @generated + */ + void setBase_Classifier(Classifier value); + +} // Include diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Inline.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Inline.java new file mode 100644 index 00000000000..737bc194134 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Inline.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Operation; + +/** + * + * A representation of the model object 'Inline'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Inline#getBase_operation Base operation}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInline() + * @model + * @generated + */ +public interface Inline extends EObject { + /** + * Returns the value of the 'Base operation' reference. + * + *

    + * If the meaning of the 'Base operation' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base operation' reference. + * @see #setBase_operation(Operation) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getInline_Base_operation() + * @model required="true" ordered="false" + * @generated + */ + Operation getBase_operation(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Inline#getBase_operation Base operation}' reference. + * + * + * @param value the new value of the 'Base operation' reference. + * @see #getBase_operation() + * @generated + */ + void setBase_operation(Operation value); + +} // Inline diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ManualGeneration.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ManualGeneration.java new file mode 100644 index 00000000000..b28650aae64 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/ManualGeneration.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Manual Generation'. + * + * + * + * Some toolkits require a quite particular way of use. For instance, LTTng requires the use of C (not C++) for the declaration of a trace provider and the header file is read several time with redefined macros. Therefore, the code generator supports a "manual" generation mode, in which primarily the contents of the CppInclude directive is written. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.ManualGeneration#getExtensionBody Extension Body}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.ManualGeneration#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getManualGeneration() + * @model + * @generated + */ +public interface ManualGeneration extends EObject { + /** + * Returns the value of the 'Extension Body' attribute. + * + *

    + * If the meaning of the 'Extension Body' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Extension Body' attribute. + * @see #setExtensionBody(String) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getManualGeneration_ExtensionBody() + * @model dataType="org.eclipse.uml2.types.String" required="true" ordered="false" + * @generated + */ + String getExtensionBody(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.ManualGeneration#getExtensionBody Extension Body}' attribute. + * + * + * @param value the new value of the 'Extension Body' attribute. + * @see #getExtensionBody() + * @generated + */ + void setExtensionBody(String value); + + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getManualGeneration_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.ManualGeneration#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // ManualGeneration diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Mutable.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Mutable.java new file mode 100644 index 00000000000..9ca0a41cd6a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Mutable.java @@ -0,0 +1,52 @@ +/** + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.uml2.uml.Property; + +/** + * + * A representation of the model object 'Mutable'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Mutable#getBase_property Base property}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getMutable() + * @model + * @generated + */ +public interface Mutable extends EObject { + /** + * Returns the value of the 'Base property' reference. + * + *

    + * If the meaning of the 'Base property' reference isn't clear, + * there really should be more of a description here... + *

    + * + * @return the value of the 'Base property' reference. + * @see #setBase_property(Property) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getMutable_Base_property() + * @model required="true" ordered="false" + * @generated + */ + Property getBase_property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Mutable#getBase_property Base property}' reference. + * + * + * @param value the new value of the 'Base property' reference. + * @see #getBase_property() + * @generated + */ + void setBase_property(Property value); + +} // Mutable diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/NoCodeGen.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/NoCodeGen.java new file mode 100644 index 00000000000..2436e6bddc4 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/NoCodeGen.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Element; + +/** + * + * A representation of the model object 'No Code Gen'. + * + * + * + * No code generation should be done for this element. This also means that no include directive is generated, if the class is referenced. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.NoCodeGen#getBase_element Base element}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getNoCodeGen() + * @model + * @generated + */ +public interface NoCodeGen extends EObject { + /** + * Returns the value of the 'Base element' reference. + * + *

    + * If the meaning of the 'Base element' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base element' reference. + * @see #setBase_element(Element) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getNoCodeGen_Base_element() + * @model required="true" ordered="false" + * @generated + */ + Element getBase_element(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.NoCodeGen#getBase_element Base element}' reference. + * + * + * @param value the new value of the 'Base element' reference. + * @see #getBase_element() + * @generated + */ + void setBase_element(Element value); + +} // NoCodeGen diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ptr.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ptr.java new file mode 100644 index 00000000000..ce60c416a38 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ptr.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Property; + +/** + * + * A representation of the model object 'Ptr'. + * + * + * + * "declaration" attribute should only be used, if more than one indirections of pointers (often "**") + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Ptr#getBase_parameter Base parameter}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Ptr#getBase_property Base property}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Ptr#getDeclaration Declaration}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getPtr() + * @model + * @generated + */ +public interface Ptr extends EObject { + /** + * Returns the value of the 'Base parameter' reference. + * + *

    + * If the meaning of the 'Base parameter' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base parameter' reference. + * @see #setBase_parameter(Parameter) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getPtr_Base_parameter() + * @model ordered="false" + * @generated + */ + Parameter getBase_parameter(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Ptr#getBase_parameter Base parameter}' reference. + * + * + * @param value the new value of the 'Base parameter' reference. + * @see #getBase_parameter() + * @generated + */ + void setBase_parameter(Parameter value); + + /** + * Returns the value of the 'Base property' reference. + * + *

    + * If the meaning of the 'Base property' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base property' reference. + * @see #setBase_property(Property) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getPtr_Base_property() + * @model ordered="false" + * @generated + */ + Property getBase_property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Ptr#getBase_property Base property}' reference. + * + * + * @param value the new value of the 'Base property' reference. + * @see #getBase_property() + * @generated + */ + void setBase_property(Property value); + + /** + * Returns the value of the 'Declaration' attribute. + * + *

    + * If the meaning of the 'Declaration' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Declaration' attribute. + * @see #setDeclaration(String) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getPtr_Declaration() + * @model unique="false" dataType="org.eclipse.uml2.types.String" ordered="false" + * @generated + */ + String getDeclaration(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Ptr#getDeclaration Declaration}' attribute. + * + * + * @param value the new value of the 'Declaration' attribute. + * @see #getDeclaration() + * @generated + */ + void setDeclaration(String value); + +} // Ptr diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ref.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ref.java new file mode 100644 index 00000000000..535918f01cf --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Ref.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Property; + +/** + * + * A representation of the model object 'Ref'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Ref#getBase_parameter Base parameter}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Ref#getBase_property Base property}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getRef() + * @model + * @generated + */ +public interface Ref extends EObject { + /** + * Returns the value of the 'Base parameter' reference. + * + *

    + * If the meaning of the 'Base parameter' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base parameter' reference. + * @see #setBase_parameter(Parameter) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getRef_Base_parameter() + * @model ordered="false" + * @generated + */ + Parameter getBase_parameter(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Ref#getBase_parameter Base parameter}' reference. + * + * + * @param value the new value of the 'Base parameter' reference. + * @see #getBase_parameter() + * @generated + */ + void setBase_parameter(Parameter value); + + /** + * Returns the value of the 'Base property' reference. + * + *

    + * If the meaning of the 'Base property' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base property' reference. + * @see #setBase_property(Property) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getRef_Base_property() + * @model ordered="false" + * @generated + */ + Property getBase_property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Ref#getBase_property Base property}' reference. + * + * + * @param value the new value of the 'Base property' reference. + * @see #getBase_property() + * @generated + */ + void setBase_property(Property value); + +} // Ref diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/StorageClass.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/StorageClass.java new file mode 100644 index 00000000000..478fd5e5fb6 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/StorageClass.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Property; + +/** + * + * A representation of the model object 'Storage Class'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.StorageClass#getStorageClass Storage Class}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Property Base Property}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Parameter Base Parameter}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getStorageClass() + * @model + * @generated + */ +public interface StorageClass extends EObject { + /** + * Returns the value of the 'Storage Class' attribute. + * The literals are from the enumeration {@link org.eclipse.papyrus.C_Cpp.EStorageClass}. + * + *

    + * If the meaning of the 'Storage Class' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Storage Class' attribute. + * @see org.eclipse.papyrus.C_Cpp.EStorageClass + * @see #setStorageClass(EStorageClass) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getStorageClass_StorageClass() + * @model unique="false" required="true" ordered="false" + * @generated + */ + EStorageClass getStorageClass(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.StorageClass#getStorageClass Storage Class}' attribute. + * + * + * @param value the new value of the 'Storage Class' attribute. + * @see org.eclipse.papyrus.C_Cpp.EStorageClass + * @see #getStorageClass() + * @generated + */ + void setStorageClass(EStorageClass value); + + /** + * Returns the value of the 'Base Property' reference. + * + *

    + * If the meaning of the 'Base Property' reference isn't clear, + * there really should be more of a description here... + *

    + * + * @return the value of the 'Base Property' reference. + * @see #setBase_Property(Property) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getStorageClass_Base_Property() + * @model ordered="false" + * @generated + */ + Property getBase_Property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Property Base Property}' reference. + * + * + * @param value the new value of the 'Base Property' reference. + * @see #getBase_Property() + * @generated + */ + void setBase_Property(Property value); + + /** + * Returns the value of the 'Base Parameter' reference. + * + *

    + * If the meaning of the 'Base Parameter' reference isn't clear, + * there really should be more of a description here... + *

    + * + * @return the value of the 'Base Parameter' reference. + * @see #setBase_Parameter(Parameter) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getStorageClass_Base_Parameter() + * @model ordered="false" + * @generated + */ + Parameter getBase_Parameter(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.StorageClass#getBase_Parameter Base Parameter}' reference. + * + * + * @param value the new value of the 'Base Parameter' reference. + * @see #getBase_Parameter() + * @generated + */ + void setBase_Parameter(Parameter value); + +} // StorageClass diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Template.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Template.java new file mode 100644 index 00000000000..66d729cb018 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Template.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Template'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Template#getDeclaration Declaration}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Template#getBase_class Base class}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplate() + * @model + * @generated + */ +public interface Template extends EObject { + /** + * Returns the value of the 'Declaration' attribute. + * + *

    + * If the meaning of the 'Declaration' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Declaration' attribute. + * @see #setDeclaration(String) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplate_Declaration() + * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" + * @generated + */ + String getDeclaration(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Template#getDeclaration Declaration}' attribute. + * + * + * @param value the new value of the 'Declaration' attribute. + * @see #getDeclaration() + * @generated + */ + void setDeclaration(String value); + + /** + * Returns the value of the 'Base class' reference. + * + *

    + * If the meaning of the 'Base class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base class' reference. + * @see #setBase_class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplate_Base_class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Template#getBase_class Base class}' reference. + * + * + * @param value the new value of the 'Base class' reference. + * @see #getBase_class() + * @generated + */ + void setBase_class(org.eclipse.uml2.uml.Class value); + +} // Template diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateBinding.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateBinding.java new file mode 100644 index 00000000000..5f9e868c814 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateBinding.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Template Binding'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.TemplateBinding#getBinding Binding}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.TemplateBinding#getBase_templatebinding Base templatebinding}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplateBinding() + * @model + * @generated + */ +public interface TemplateBinding extends EObject { + /** + * Returns the value of the 'Binding' attribute. + * + *

    + * If the meaning of the 'Binding' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Binding' attribute. + * @see #setBinding(String) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplateBinding_Binding() + * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" + * @generated + */ + String getBinding(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.TemplateBinding#getBinding Binding}' attribute. + * + * + * @param value the new value of the 'Binding' attribute. + * @see #getBinding() + * @generated + */ + void setBinding(String value); + + /** + * Returns the value of the 'Base templatebinding' reference. + * + *

    + * If the meaning of the 'Base templatebinding' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base templatebinding' reference. + * @see #setBase_templatebinding(org.eclipse.uml2.uml.TemplateBinding) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplateBinding_Base_templatebinding() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.TemplateBinding getBase_templatebinding(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.TemplateBinding#getBase_templatebinding Base templatebinding}' reference. + * + * + * @param value the new value of the 'Base templatebinding' reference. + * @see #getBase_templatebinding() + * @generated + */ + void setBase_templatebinding(org.eclipse.uml2.uml.TemplateBinding value); + +} // TemplateBinding diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateParameter.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateParameter.java new file mode 100644 index 00000000000..1c67ebfec79 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/TemplateParameter.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Template Parameter'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.TemplateParameter#getName Name}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.TemplateParameter#getBase_templateparameter Base templateparameter}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplateParameter() + * @model + * @generated + */ +public interface TemplateParameter extends EObject { + /** + * Returns the value of the 'Name' attribute. + * + *

    + * If the meaning of the 'Name' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplateParameter_Name() + * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.TemplateParameter#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Base templateparameter' reference. + * + *

    + * If the meaning of the 'Base templateparameter' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base templateparameter' reference. + * @see #setBase_templateparameter(org.eclipse.uml2.uml.TemplateParameter) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTemplateParameter_Base_templateparameter() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.TemplateParameter getBase_templateparameter(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.TemplateParameter#getBase_templateparameter Base templateparameter}' reference. + * + * + * @param value the new value of the 'Base templateparameter' reference. + * @see #getBase_templateparameter() + * @generated + */ + void setBase_templateparameter(org.eclipse.uml2.uml.TemplateParameter value); + +} // TemplateParameter diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Typedef.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Typedef.java new file mode 100644 index 00000000000..99be18e2013 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Typedef.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.PrimitiveType; + +/** + * + * A representation of the model object 'Typedef'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Typedef#getDefinition Definition}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Typedef#getBase_primitivetype Base primitivetype}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTypedef() + * @model + * @generated + */ +public interface Typedef extends EObject { + /** + * Returns the value of the 'Definition' attribute. + * + *

    + * If the meaning of the 'Definition' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Definition' attribute. + * @see #setDefinition(String) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTypedef_Definition() + * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" + * @generated + */ + String getDefinition(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Typedef#getDefinition Definition}' attribute. + * + * + * @param value the new value of the 'Definition' attribute. + * @see #getDefinition() + * @generated + */ + void setDefinition(String value); + + /** + * Returns the value of the 'Base primitivetype' reference. + * + *

    + * If the meaning of the 'Base primitivetype' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base primitivetype' reference. + * @see #setBase_primitivetype(PrimitiveType) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getTypedef_Base_primitivetype() + * @model required="true" ordered="false" + * @generated + */ + PrimitiveType getBase_primitivetype(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Typedef#getBase_primitivetype Base primitivetype}' reference. + * + * + * @param value the new value of the 'Base primitivetype' reference. + * @see #getBase_primitivetype() + * @generated + */ + void setBase_primitivetype(PrimitiveType value); + +} // Typedef diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Union.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Union.java new file mode 100644 index 00000000000..1edfbd0d38a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Union.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.DataType; + +/** + * + * A representation of the model object 'Union'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Union#getBase_DataType Base Data Type}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getUnion() + * @model + * @generated + */ +public interface Union extends EObject { + /** + * Returns the value of the 'Base Data Type' reference. + * + *

    + * If the meaning of the 'Base Data Type' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Data Type' reference. + * @see #setBase_DataType(DataType) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getUnion_Base_DataType() + * @model required="true" ordered="false" + * @generated + */ + DataType getBase_DataType(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Union#getBase_DataType Base Data Type}' reference. + * + * + * @param value the new value of the 'Base Data Type' reference. + * @see #getBase_DataType() + * @generated + */ + void setBase_DataType(DataType value); + +} // Union diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Variadic.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Variadic.java new file mode 100644 index 00000000000..37ead44821e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Variadic.java @@ -0,0 +1,52 @@ +/** + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.uml2.uml.Operation; + +/** + * + * A representation of the model object 'Variadic'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Variadic#getBase_operation Base operation}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVariadic() + * @model + * @generated + */ +public interface Variadic extends EObject { + /** + * Returns the value of the 'Base operation' reference. + * + *

    + * If the meaning of the 'Base operation' reference isn't clear, + * there really should be more of a description here... + *

    + * + * @return the value of the 'Base operation' reference. + * @see #setBase_operation(Operation) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVariadic_Base_operation() + * @model required="true" ordered="false" + * @generated + */ + Operation getBase_operation(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Variadic#getBase_operation Base operation}' reference. + * + * + * @param value the new value of the 'Base operation' reference. + * @see #getBase_operation() + * @generated + */ + void setBase_operation(Operation value); + +} // Variadic diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Virtual.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Virtual.java new file mode 100644 index 00000000000..60b209bef50 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Virtual.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Operation; + +/** + * + * A representation of the model object 'Virtual'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Virtual#getBase_operation Base operation}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVirtual() + * @model + * @generated + */ +public interface Virtual extends EObject { + /** + * Returns the value of the 'Base operation' reference. + * + *

    + * If the meaning of the 'Base operation' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base operation' reference. + * @see #setBase_operation(Operation) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVirtual_Base_operation() + * @model required="true" ordered="false" + * @generated + */ + Operation getBase_operation(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Virtual#getBase_operation Base operation}' reference. + * + * + * @param value the new value of the 'Base operation' reference. + * @see #getBase_operation() + * @generated + */ + void setBase_operation(Operation value); + +} // Virtual diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Visibility.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Visibility.java new file mode 100644 index 00000000000..aea7299af55 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Visibility.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Generalization; + +/** + * + * A representation of the model object 'Visibility'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Visibility#getValue Value}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Visibility#getBase_generalization Base generalization}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVisibility() + * @model + * @generated + */ +public interface Visibility extends EObject { + /** + * Returns the value of the 'Value' attribute. + * + *

    + * If the meaning of the 'Value' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Value' attribute. + * @see #setValue(String) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVisibility_Value() + * @model unique="false" dataType="org.eclipse.uml2.types.String" required="true" ordered="false" + * @generated + */ + String getValue(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Visibility#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(String value); + + /** + * Returns the value of the 'Base generalization' reference. + * + *

    + * If the meaning of the 'Base generalization' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base generalization' reference. + * @see #setBase_generalization(Generalization) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVisibility_Base_generalization() + * @model required="true" ordered="false" + * @generated + */ + Generalization getBase_generalization(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Visibility#getBase_generalization Base generalization}' reference. + * + * + * @param value the new value of the 'Base generalization' reference. + * @see #getBase_generalization() + * @generated + */ + void setBase_generalization(Generalization value); + +} // Visibility diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/VisibilityKind.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/VisibilityKind.java new file mode 100644 index 00000000000..4ea258e178e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/VisibilityKind.java @@ -0,0 +1,251 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Visibility Kind', + * and utility methods for working with them. + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVisibilityKind() + * @model + * @generated + */ +public enum VisibilityKind implements Enumerator { + /** + * The 'Private' literal object. + * + * + * @see #PRIVATE_VALUE + * @generated + * @ordered + */ + PRIVATE(0, "private", "private"), //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Protected' literal object. + * + * + * @see #PROTECTED_VALUE + * @generated + * @ordered + */ + PROTECTED(1, "protected", "protected"), //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Public' literal object. + * + * + * @see #PUBLIC_VALUE + * @generated + * @ordered + */ + PUBLIC(2, "public", "public"); //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Private' literal value. + * + *

    + * If the meaning of 'Private' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #PRIVATE + * @model name="private" + * @generated + * @ordered + */ + public static final int PRIVATE_VALUE = 0; + + /** + * The 'Protected' literal value. + * + *

    + * If the meaning of 'Protected' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #PROTECTED + * @model name="protected" + * @generated + * @ordered + */ + public static final int PROTECTED_VALUE = 1; + + /** + * The 'Public' literal value. + * + *

    + * If the meaning of 'Public' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #PUBLIC + * @model name="public" + * @generated + * @ordered + */ + public static final int PUBLIC_VALUE = 2; + + /** + * An array of all the 'Visibility Kind' enumerators. + * + * + * @generated + */ + private static final VisibilityKind[] VALUES_ARRAY = + new VisibilityKind[] { + PRIVATE, + PROTECTED, + PUBLIC, + }; + + /** + * A public read-only list of all the 'Visibility Kind' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Visibility Kind' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static VisibilityKind get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + VisibilityKind result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Visibility Kind' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static VisibilityKind getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + VisibilityKind result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Visibility Kind' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static VisibilityKind get(int value) { + switch (value) { + case PRIVATE_VALUE: return PRIVATE; + case PROTECTED_VALUE: return PROTECTED; + case PUBLIC_VALUE: return PUBLIC; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private VisibilityKind(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} // VisibilityKind diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Volatile.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Volatile.java new file mode 100644 index 00000000000..6a80992fc11 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/Volatile.java @@ -0,0 +1,104 @@ +/** + */ +package org.eclipse.papyrus.C_Cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Property; + +/** + * + * A representation of the model object 'Volatile'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_parameter Base parameter}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_property Base property}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_operation Base operation}
    • + *
    + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVolatile() + * @model + * @generated + */ +public interface Volatile extends EObject { + /** + * Returns the value of the 'Base parameter' reference. + * + *

    + * If the meaning of the 'Base parameter' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base parameter' reference. + * @see #setBase_parameter(Parameter) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVolatile_Base_parameter() + * @model ordered="false" + * @generated + */ + Parameter getBase_parameter(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_parameter Base parameter}' reference. + * + * + * @param value the new value of the 'Base parameter' reference. + * @see #getBase_parameter() + * @generated + */ + void setBase_parameter(Parameter value); + + /** + * Returns the value of the 'Base property' reference. + * + *

    + * If the meaning of the 'Base property' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base property' reference. + * @see #setBase_property(Property) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVolatile_Base_property() + * @model ordered="false" + * @generated + */ + Property getBase_property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_property Base property}' reference. + * + * + * @param value the new value of the 'Base property' reference. + * @see #getBase_property() + * @generated + */ + void setBase_property(Property value); + + /** + * Returns the value of the 'Base operation' reference. + * + *

    + * If the meaning of the 'Base operation' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base operation' reference. + * @see #setBase_operation(Operation) + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#getVolatile_Base_operation() + * @model ordered="false" + * @generated + */ + Operation getBase_operation(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.C_Cpp.Volatile#getBase_operation Base operation}' reference. + * + * + * @param value the new value of the 'Base operation' reference. + * @see #getBase_operation() + * @generated + */ + void setBase_operation(Operation value); + +} // Volatile diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ArrayImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ArrayImpl.java new file mode 100644 index 00000000000..91a71d01d85 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ArrayImpl.java @@ -0,0 +1,362 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.Array; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.uml2.uml.Association; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Property; + +/** + * + * An implementation of the model object 'Array'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ArrayImpl#getBase_parameter Base parameter}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ArrayImpl#getDefinition Definition}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ArrayImpl#getBase_property Base property}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ArrayImpl#getBase_association Base association}
    • + *
    + * + * @generated + */ +public class ArrayImpl extends MinimalEObjectImpl.Container implements Array { + /** + * The cached value of the '{@link #getBase_parameter() Base parameter}' reference. + * + * + * @see #getBase_parameter() + * @generated + * @ordered + */ + protected Parameter base_parameter; + + /** + * The default value of the '{@link #getDefinition() Definition}' attribute. + * + * + * @see #getDefinition() + * @generated + * @ordered + */ + protected static final String DEFINITION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDefinition() Definition}' attribute. + * + * + * @see #getDefinition() + * @generated + * @ordered + */ + protected String definition = DEFINITION_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_property() Base property}' reference. + * + * + * @see #getBase_property() + * @generated + * @ordered + */ + protected Property base_property; + + /** + * The cached value of the '{@link #getBase_association() Base association}' reference. + * + * + * @see #getBase_association() + * @generated + * @ordered + */ + protected Association base_association; + + /** + * + * + * @generated + */ + protected ArrayImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.ARRAY; + } + + /** + * + * + * @generated + */ + @Override + public Parameter getBase_parameter() { + if (base_parameter != null && base_parameter.eIsProxy()) { + InternalEObject oldBase_parameter = (InternalEObject)base_parameter; + base_parameter = (Parameter)eResolveProxy(oldBase_parameter); + if (base_parameter != oldBase_parameter) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.ARRAY__BASE_PARAMETER, oldBase_parameter, base_parameter)); + } + } + return base_parameter; + } + + /** + * + * + * @generated + */ + public Parameter basicGetBase_parameter() { + return base_parameter; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_parameter(Parameter newBase_parameter) { + Parameter oldBase_parameter = base_parameter; + base_parameter = newBase_parameter; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.ARRAY__BASE_PARAMETER, oldBase_parameter, base_parameter)); + } + + /** + * + * + * @generated + */ + @Override + public String getDefinition() { + return definition; + } + + /** + * + * + * @generated + */ + @Override + public void setDefinition(String newDefinition) { + String oldDefinition = definition; + definition = newDefinition; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.ARRAY__DEFINITION, oldDefinition, definition)); + } + + /** + * + * + * @generated + */ + @Override + public Property getBase_property() { + if (base_property != null && base_property.eIsProxy()) { + InternalEObject oldBase_property = (InternalEObject)base_property; + base_property = (Property)eResolveProxy(oldBase_property); + if (base_property != oldBase_property) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.ARRAY__BASE_PROPERTY, oldBase_property, base_property)); + } + } + return base_property; + } + + /** + * + * + * @generated + */ + public Property basicGetBase_property() { + return base_property; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_property(Property newBase_property) { + Property oldBase_property = base_property; + base_property = newBase_property; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.ARRAY__BASE_PROPERTY, oldBase_property, base_property)); + } + + /** + * + * + * @generated + */ + @Override + public Association getBase_association() { + if (base_association != null && base_association.eIsProxy()) { + InternalEObject oldBase_association = (InternalEObject)base_association; + base_association = (Association)eResolveProxy(oldBase_association); + if (base_association != oldBase_association) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.ARRAY__BASE_ASSOCIATION, oldBase_association, base_association)); + } + } + return base_association; + } + + /** + * + * + * @generated + */ + public Association basicGetBase_association() { + return base_association; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_association(Association newBase_association) { + Association oldBase_association = base_association; + base_association = newBase_association; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.ARRAY__BASE_ASSOCIATION, oldBase_association, base_association)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.ARRAY__BASE_PARAMETER: + if (resolve) return getBase_parameter(); + return basicGetBase_parameter(); + case C_CppPackage.ARRAY__DEFINITION: + return getDefinition(); + case C_CppPackage.ARRAY__BASE_PROPERTY: + if (resolve) return getBase_property(); + return basicGetBase_property(); + case C_CppPackage.ARRAY__BASE_ASSOCIATION: + if (resolve) return getBase_association(); + return basicGetBase_association(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.ARRAY__BASE_PARAMETER: + setBase_parameter((Parameter)newValue); + return; + case C_CppPackage.ARRAY__DEFINITION: + setDefinition((String)newValue); + return; + case C_CppPackage.ARRAY__BASE_PROPERTY: + setBase_property((Property)newValue); + return; + case C_CppPackage.ARRAY__BASE_ASSOCIATION: + setBase_association((Association)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.ARRAY__BASE_PARAMETER: + setBase_parameter((Parameter)null); + return; + case C_CppPackage.ARRAY__DEFINITION: + setDefinition(DEFINITION_EDEFAULT); + return; + case C_CppPackage.ARRAY__BASE_PROPERTY: + setBase_property((Property)null); + return; + case C_CppPackage.ARRAY__BASE_ASSOCIATION: + setBase_association((Association)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.ARRAY__BASE_PARAMETER: + return base_parameter != null; + case C_CppPackage.ARRAY__DEFINITION: + return DEFINITION_EDEFAULT == null ? definition != null : !DEFINITION_EDEFAULT.equals(definition); + case C_CppPackage.ARRAY__BASE_PROPERTY: + return base_property != null; + case C_CppPackage.ARRAY__BASE_ASSOCIATION: + return base_association != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (definition: "); + result.append(definition); + result.append(')'); + return result.toString(); + } + +} // ArrayImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppFactoryImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppFactoryImpl.java new file mode 100644 index 00000000000..e16267d1b13 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppFactoryImpl.java @@ -0,0 +1,518 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.impl.EFactoryImpl; +import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.eclipse.papyrus.C_Cpp.Array; +import org.eclipse.papyrus.C_Cpp.C_CppFactory; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Const; +import org.eclipse.papyrus.C_Cpp.ConstInit; +import org.eclipse.papyrus.C_Cpp.CppInit; +import org.eclipse.papyrus.C_Cpp.CppRoot; +import org.eclipse.papyrus.C_Cpp.EAccessKind; +import org.eclipse.papyrus.C_Cpp.EStorageClass; +import org.eclipse.papyrus.C_Cpp.ExternLibrary; +import org.eclipse.papyrus.C_Cpp.External; +import org.eclipse.papyrus.C_Cpp.Friend; +import org.eclipse.papyrus.C_Cpp.Include; +import org.eclipse.papyrus.C_Cpp.Inline; +import org.eclipse.papyrus.C_Cpp.ManualGeneration; +import org.eclipse.papyrus.C_Cpp.Mutable; +import org.eclipse.papyrus.C_Cpp.NoCodeGen; +import org.eclipse.papyrus.C_Cpp.Ptr; +import org.eclipse.papyrus.C_Cpp.Ref; +import org.eclipse.papyrus.C_Cpp.StorageClass; +import org.eclipse.papyrus.C_Cpp.Template; +import org.eclipse.papyrus.C_Cpp.TemplateBinding; +import org.eclipse.papyrus.C_Cpp.TemplateParameter; +import org.eclipse.papyrus.C_Cpp.Typedef; +import org.eclipse.papyrus.C_Cpp.Union; +import org.eclipse.papyrus.C_Cpp.Variadic; +import org.eclipse.papyrus.C_Cpp.Virtual; +import org.eclipse.papyrus.C_Cpp.Visibility; +import org.eclipse.papyrus.C_Cpp.VisibilityKind; +import org.eclipse.papyrus.C_Cpp.Volatile; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class C_CppFactoryImpl extends EFactoryImpl implements C_CppFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static C_CppFactory init() { + try { + C_CppFactory theC_CppFactory = (C_CppFactory)EPackage.Registry.INSTANCE.getEFactory(C_CppPackage.eNS_URI); + if (theC_CppFactory != null) { + return theC_CppFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new C_CppFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public C_CppFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case C_CppPackage.PTR: return createPtr(); + case C_CppPackage.INCLUDE: return createInclude(); + case C_CppPackage.MANUAL_GENERATION: return createManualGeneration(); + case C_CppPackage.EXTERN_LIBRARY: return createExternLibrary(); + case C_CppPackage.NO_CODE_GEN: return createNoCodeGen(); + case C_CppPackage.CPP_ROOT: return createCppRoot(); + case C_CppPackage.ARRAY: return createArray(); + case C_CppPackage.CONST: return createConst(); + case C_CppPackage.REF: return createRef(); + case C_CppPackage.EXTERNAL: return createExternal(); + case C_CppPackage.CONST_INIT: return createConstInit(); + case C_CppPackage.FRIEND: return createFriend(); + case C_CppPackage.INLINE: return createInline(); + case C_CppPackage.VIRTUAL: return createVirtual(); + case C_CppPackage.TYPEDEF: return createTypedef(); + case C_CppPackage.VISIBILITY: return createVisibility(); + case C_CppPackage.CPP_INIT: return createCppInit(); + case C_CppPackage.TEMPLATE: return createTemplate(); + case C_CppPackage.TEMPLATE_BINDING: return createTemplateBinding(); + case C_CppPackage.TEMPLATE_PARAMETER: return createTemplateParameter(); + case C_CppPackage.UNION: return createUnion(); + case C_CppPackage.STORAGE_CLASS: return createStorageClass(); + case C_CppPackage.VOLATILE: return createVolatile(); + case C_CppPackage.VARIADIC: return createVariadic(); + case C_CppPackage.MUTABLE: return createMutable(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public Object createFromString(EDataType eDataType, String initialValue) { + switch (eDataType.getClassifierID()) { + case C_CppPackage.VISIBILITY_KIND: + return createVisibilityKindFromString(eDataType, initialValue); + case C_CppPackage.EACCESS_KIND: + return createEAccessKindFromString(eDataType, initialValue); + case C_CppPackage.ESTORAGE_CLASS: + return createEStorageClassFromString(eDataType, initialValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public String convertToString(EDataType eDataType, Object instanceValue) { + switch (eDataType.getClassifierID()) { + case C_CppPackage.VISIBILITY_KIND: + return convertVisibilityKindToString(eDataType, instanceValue); + case C_CppPackage.EACCESS_KIND: + return convertEAccessKindToString(eDataType, instanceValue); + case C_CppPackage.ESTORAGE_CLASS: + return convertEStorageClassToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public Ptr createPtr() { + PtrImpl ptr = new PtrImpl(); + return ptr; + } + + /** + * + * + * @generated + */ + @Override + public Include createInclude() { + IncludeImpl include = new IncludeImpl(); + return include; + } + + /** + * + * + * @generated + */ + @Override + public ManualGeneration createManualGeneration() { + ManualGenerationImpl manualGeneration = new ManualGenerationImpl(); + return manualGeneration; + } + + /** + * + * + * @generated + */ + @Override + public ExternLibrary createExternLibrary() { + ExternLibraryImpl externLibrary = new ExternLibraryImpl(); + return externLibrary; + } + + /** + * + * + * @generated + */ + @Override + public NoCodeGen createNoCodeGen() { + NoCodeGenImpl noCodeGen = new NoCodeGenImpl(); + return noCodeGen; + } + + /** + * + * + * @generated + */ + @Override + public CppRoot createCppRoot() { + CppRootImpl cppRoot = new CppRootImpl(); + return cppRoot; + } + + /** + * + * + * @generated + */ + @Override + public Array createArray() { + ArrayImpl array = new ArrayImpl(); + return array; + } + + /** + * + * + * @generated + */ + @Override + public Const createConst() { + ConstImpl const_ = new ConstImpl(); + return const_; + } + + /** + * + * + * @generated + */ + @Override + public Ref createRef() { + RefImpl ref = new RefImpl(); + return ref; + } + + /** + * + * + * @generated + */ + @Override + public External createExternal() { + ExternalImpl external = new ExternalImpl(); + return external; + } + + /** + * + * + * @generated + */ + @Override + public ConstInit createConstInit() { + ConstInitImpl constInit = new ConstInitImpl(); + return constInit; + } + + /** + * + * + * @generated + */ + @Override + public Friend createFriend() { + FriendImpl friend = new FriendImpl(); + return friend; + } + + /** + * + * + * @generated + */ + @Override + public Inline createInline() { + InlineImpl inline = new InlineImpl(); + return inline; + } + + /** + * + * + * @generated + */ + @Override + public Virtual createVirtual() { + VirtualImpl virtual = new VirtualImpl(); + return virtual; + } + + /** + * + * + * @generated + */ + @Override + public Typedef createTypedef() { + TypedefImpl typedef = new TypedefImpl(); + return typedef; + } + + /** + * + * + * @generated + */ + @Override + public Visibility createVisibility() { + VisibilityImpl visibility = new VisibilityImpl(); + return visibility; + } + + /** + * + * + * @generated + */ + @Override + public CppInit createCppInit() { + CppInitImpl cppInit = new CppInitImpl(); + return cppInit; + } + + /** + * + * + * @generated + */ + @Override + public Template createTemplate() { + TemplateImpl template = new TemplateImpl(); + return template; + } + + /** + * + * + * @generated + */ + @Override + public TemplateBinding createTemplateBinding() { + TemplateBindingImpl templateBinding = new TemplateBindingImpl(); + return templateBinding; + } + + /** + * + * + * @generated + */ + @Override + public TemplateParameter createTemplateParameter() { + TemplateParameterImpl templateParameter = new TemplateParameterImpl(); + return templateParameter; + } + + /** + * + * + * @generated + */ + @Override + public Union createUnion() { + UnionImpl union = new UnionImpl(); + return union; + } + + /** + * + * + * @generated + */ + @Override + public StorageClass createStorageClass() { + StorageClassImpl storageClass = new StorageClassImpl(); + return storageClass; + } + + /** + * + * + * @generated + */ + @Override + public Volatile createVolatile() { + VolatileImpl volatile_ = new VolatileImpl(); + return volatile_; + } + + /** + * + * + * @generated + */ + public Variadic createVariadic() { + VariadicImpl variadic = new VariadicImpl(); + return variadic; + } + + /** + * + * + * @generated + */ + public Mutable createMutable() { + MutableImpl mutable = new MutableImpl(); + return mutable; + } + + /** + * + * + * @generated + */ + public VisibilityKind createVisibilityKindFromString(EDataType eDataType, String initialValue) { + VisibilityKind result = VisibilityKind.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertVisibilityKindToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public EAccessKind createEAccessKindFromString(EDataType eDataType, String initialValue) { + EAccessKind result = EAccessKind.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertEAccessKindToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public EStorageClass createEStorageClassFromString(EDataType eDataType, String initialValue) { + EStorageClass result = EStorageClass.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertEStorageClassToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + @Override + public C_CppPackage getC_CppPackage() { + return (C_CppPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static C_CppPackage getPackage() { + return C_CppPackage.eINSTANCE; + } + +} // C_CppFactoryImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppPackageImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppPackageImpl.java new file mode 100644 index 00000000000..9d62fda5089 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/C_CppPackageImpl.java @@ -0,0 +1,1464 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.impl.EPackageImpl; +import org.eclipse.papyrus.C_Cpp.Array; +import org.eclipse.papyrus.C_Cpp.C_CppFactory; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Const; +import org.eclipse.papyrus.C_Cpp.ConstInit; +import org.eclipse.papyrus.C_Cpp.CppInit; +import org.eclipse.papyrus.C_Cpp.CppRoot; +import org.eclipse.papyrus.C_Cpp.EAccessKind; +import org.eclipse.papyrus.C_Cpp.EStorageClass; +import org.eclipse.papyrus.C_Cpp.ExternLibrary; +import org.eclipse.papyrus.C_Cpp.External; +import org.eclipse.papyrus.C_Cpp.Friend; +import org.eclipse.papyrus.C_Cpp.Include; +import org.eclipse.papyrus.C_Cpp.Inline; +import org.eclipse.papyrus.C_Cpp.ManualGeneration; +import org.eclipse.papyrus.C_Cpp.Mutable; +import org.eclipse.papyrus.C_Cpp.NoCodeGen; +import org.eclipse.papyrus.C_Cpp.Ptr; +import org.eclipse.papyrus.C_Cpp.Ref; +import org.eclipse.papyrus.C_Cpp.StorageClass; +import org.eclipse.papyrus.C_Cpp.Template; +import org.eclipse.papyrus.C_Cpp.TemplateBinding; +import org.eclipse.papyrus.C_Cpp.TemplateParameter; +import org.eclipse.papyrus.C_Cpp.Typedef; +import org.eclipse.papyrus.C_Cpp.Union; +import org.eclipse.papyrus.C_Cpp.Variadic; +import org.eclipse.papyrus.C_Cpp.Virtual; +import org.eclipse.papyrus.C_Cpp.Visibility; +import org.eclipse.papyrus.C_Cpp.VisibilityKind; +import org.eclipse.papyrus.C_Cpp.Volatile; +import org.eclipse.uml2.types.TypesPackage; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class C_CppPackageImpl extends EPackageImpl implements C_CppPackage { + /** + * + * + * @generated + */ + private EClass ptrEClass = null; + + /** + * + * + * @generated + */ + private EClass includeEClass = null; + + /** + * + * + * @generated + */ + private EClass manualGenerationEClass = null; + + /** + * + * + * @generated + */ + private EClass externLibraryEClass = null; + + /** + * + * + * @generated + */ + private EClass noCodeGenEClass = null; + + /** + * + * + * @generated + */ + private EClass cppRootEClass = null; + + /** + * + * + * @generated + */ + private EClass arrayEClass = null; + + /** + * + * + * @generated + */ + private EClass constEClass = null; + + /** + * + * + * @generated + */ + private EClass refEClass = null; + + /** + * + * + * @generated + */ + private EClass externalEClass = null; + + /** + * + * + * @generated + */ + private EClass constInitEClass = null; + + /** + * + * + * @generated + */ + private EClass friendEClass = null; + + /** + * + * + * @generated + */ + private EClass inlineEClass = null; + + /** + * + * + * @generated + */ + private EClass virtualEClass = null; + + /** + * + * + * @generated + */ + private EClass typedefEClass = null; + + /** + * + * + * @generated + */ + private EClass visibilityEClass = null; + + /** + * + * + * @generated + */ + private EClass cppInitEClass = null; + + /** + * + * + * @generated + */ + private EClass templateEClass = null; + + /** + * + * + * @generated + */ + private EClass templateBindingEClass = null; + + /** + * + * + * @generated + */ + private EClass templateParameterEClass = null; + + /** + * + * + * @generated + */ + private EClass unionEClass = null; + + /** + * + * + * @generated + */ + private EClass storageClassEClass = null; + + /** + * + * + * @generated + */ + private EClass volatileEClass = null; + + /** + * + * + * @generated + */ + private EClass variadicEClass = null; + + /** + * + * + * @generated + */ + private EClass mutableEClass = null; + + /** + * + * + * @generated + */ + private EEnum visibilityKindEEnum = null; + + /** + * + * + * @generated + */ + private EEnum eAccessKindEEnum = null; + + /** + * + * + * @generated + */ + private EEnum eStorageClassEEnum = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

    Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage#eNS_URI + * @see #init() + * @generated + */ + private C_CppPackageImpl() { + super(eNS_URI, C_CppFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

    This method is used to initialize {@link C_CppPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static C_CppPackage init() { + if (isInited) return (C_CppPackage)EPackage.Registry.INSTANCE.getEPackage(C_CppPackage.eNS_URI); + + // Obtain or create and register package + C_CppPackageImpl theC_CppPackage = (C_CppPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof C_CppPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new C_CppPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + UMLPackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theC_CppPackage.createPackageContents(); + + // Initialize created meta-data + theC_CppPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theC_CppPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(C_CppPackage.eNS_URI, theC_CppPackage); + return theC_CppPackage; + } + + /** + * + * + * @generated + */ + @Override + public EClass getPtr() { + return ptrEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getPtr_Base_parameter() { + return (EReference)ptrEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getPtr_Base_property() { + return (EReference)ptrEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getPtr_Declaration() { + return (EAttribute)ptrEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getInclude() { + return includeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getInclude_Body() { + return (EAttribute)includeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getInclude_PreBody() { + return (EAttribute)includeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getInclude_Header() { + return (EAttribute)includeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInclude_Base_package() { + return (EReference)includeEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + public EReference getInclude_Base_class() { + return (EReference)includeEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + public EReference getInclude_Base_Classifier() { + return (EReference)includeEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EClass getManualGeneration() { + return manualGenerationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getManualGeneration_ExtensionBody() { + return (EAttribute)manualGenerationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getManualGeneration_Base_Class() { + return (EReference)manualGenerationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getExternLibrary() { + return externLibraryEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExternLibrary_IncludePaths() { + return (EAttribute)externLibraryEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getExternLibrary_Base_package() { + return (EReference)externLibraryEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExternLibrary_LibPaths() { + return (EAttribute)externLibraryEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExternLibrary_Macros() { + return (EAttribute)externLibraryEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExternLibrary_Libs() { + return (EAttribute)externLibraryEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExternLibrary_Includes() { + return (EAttribute)externLibraryEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EClass getNoCodeGen() { + return noCodeGenEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getNoCodeGen_Base_element() { + return (EReference)noCodeGenEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCppRoot() { + return cppRootEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCppRoot_Base_package() { + return (EReference)cppRootEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getArray() { + return arrayEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getArray_Base_parameter() { + return (EReference)arrayEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getArray_Definition() { + return (EAttribute)arrayEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getArray_Base_property() { + return (EReference)arrayEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getArray_Base_association() { + return (EReference)arrayEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getConst() { + return constEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getConst_Base_parameter() { + return (EReference)constEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getConst_Base_property() { + return (EReference)constEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getConst_Base_operation() { + return (EReference)constEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getRef() { + return refEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getRef_Base_parameter() { + return (EReference)refEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getRef_Base_property() { + return (EReference)refEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getExternal() { + return externalEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getExternal_Name() { + return (EAttribute)externalEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getExternal_Base_Classifier() { + return (EReference)externalEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getConstInit() { + return constInitEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getConstInit_Initialisation() { + return (EAttribute)constInitEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getConstInit_Base_operation() { + return (EReference)constInitEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getFriend() { + return friendEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getFriend_Base_dependency() { + return (EReference)friendEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getFriend_Base_operation() { + return (EReference)friendEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getInline() { + return inlineEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getInline_Base_operation() { + return (EReference)inlineEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getVirtual() { + return virtualEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getVirtual_Base_operation() { + return (EReference)virtualEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTypedef() { + return typedefEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTypedef_Definition() { + return (EAttribute)typedefEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTypedef_Base_primitivetype() { + return (EReference)typedefEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getVisibility() { + return visibilityEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getVisibility_Value() { + return (EAttribute)visibilityEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getVisibility_Base_generalization() { + return (EReference)visibilityEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCppInit() { + return cppInitEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCppInit_Value() { + return (EAttribute)cppInitEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCppInit_Base_enumerationliteral() { + return (EReference)cppInitEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTemplate() { + return templateEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTemplate_Declaration() { + return (EAttribute)templateEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTemplate_Base_class() { + return (EReference)templateEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTemplateBinding() { + return templateBindingEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTemplateBinding_Binding() { + return (EAttribute)templateBindingEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTemplateBinding_Base_templatebinding() { + return (EReference)templateBindingEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTemplateParameter() { + return templateParameterEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTemplateParameter_Name() { + return (EAttribute)templateParameterEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTemplateParameter_Base_templateparameter() { + return (EReference)templateParameterEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getUnion() { + return unionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getUnion_Base_DataType() { + return (EReference)unionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getStorageClass() { + return storageClassEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getStorageClass_StorageClass() { + return (EAttribute)storageClassEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getStorageClass_Base_Property() { + return (EReference)storageClassEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getStorageClass_Base_Parameter() { + return (EReference)storageClassEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getVolatile() { + return volatileEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getVolatile_Base_parameter() { + return (EReference)volatileEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getVolatile_Base_property() { + return (EReference)volatileEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getVolatile_Base_operation() { + return (EReference)volatileEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getVariadic() { + return variadicEClass; + } + + /** + * + * + * @generated + */ + public EReference getVariadic_Base_operation() { + return (EReference)variadicEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getMutable() { + return mutableEClass; + } + + /** + * + * + * @generated + */ + public EReference getMutable_Base_property() { + return (EReference)mutableEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EEnum getVisibilityKind() { + return visibilityKindEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getEAccessKind() { + return eAccessKindEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getEStorageClass() { + return eStorageClassEEnum; + } + + /** + * + * + * @generated + */ + @Override + public C_CppFactory getC_CppFactory() { + return (C_CppFactory)getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + ptrEClass = createEClass(PTR); + createEReference(ptrEClass, PTR__BASE_PARAMETER); + createEReference(ptrEClass, PTR__BASE_PROPERTY); + createEAttribute(ptrEClass, PTR__DECLARATION); + + includeEClass = createEClass(INCLUDE); + createEAttribute(includeEClass, INCLUDE__BODY); + createEAttribute(includeEClass, INCLUDE__PRE_BODY); + createEAttribute(includeEClass, INCLUDE__HEADER); + createEReference(includeEClass, INCLUDE__BASE_PACKAGE); + createEReference(includeEClass, INCLUDE__BASE_CLASS); + createEReference(includeEClass, INCLUDE__BASE_CLASSIFIER); + + manualGenerationEClass = createEClass(MANUAL_GENERATION); + createEAttribute(manualGenerationEClass, MANUAL_GENERATION__EXTENSION_BODY); + createEReference(manualGenerationEClass, MANUAL_GENERATION__BASE_CLASS); + + externLibraryEClass = createEClass(EXTERN_LIBRARY); + createEAttribute(externLibraryEClass, EXTERN_LIBRARY__INCLUDE_PATHS); + createEReference(externLibraryEClass, EXTERN_LIBRARY__BASE_PACKAGE); + createEAttribute(externLibraryEClass, EXTERN_LIBRARY__LIB_PATHS); + createEAttribute(externLibraryEClass, EXTERN_LIBRARY__MACROS); + createEAttribute(externLibraryEClass, EXTERN_LIBRARY__LIBS); + createEAttribute(externLibraryEClass, EXTERN_LIBRARY__INCLUDES); + + noCodeGenEClass = createEClass(NO_CODE_GEN); + createEReference(noCodeGenEClass, NO_CODE_GEN__BASE_ELEMENT); + + cppRootEClass = createEClass(CPP_ROOT); + createEReference(cppRootEClass, CPP_ROOT__BASE_PACKAGE); + + arrayEClass = createEClass(ARRAY); + createEReference(arrayEClass, ARRAY__BASE_PARAMETER); + createEAttribute(arrayEClass, ARRAY__DEFINITION); + createEReference(arrayEClass, ARRAY__BASE_PROPERTY); + createEReference(arrayEClass, ARRAY__BASE_ASSOCIATION); + + constEClass = createEClass(CONST); + createEReference(constEClass, CONST__BASE_PARAMETER); + createEReference(constEClass, CONST__BASE_PROPERTY); + createEReference(constEClass, CONST__BASE_OPERATION); + + refEClass = createEClass(REF); + createEReference(refEClass, REF__BASE_PARAMETER); + createEReference(refEClass, REF__BASE_PROPERTY); + + externalEClass = createEClass(EXTERNAL); + createEAttribute(externalEClass, EXTERNAL__NAME); + createEReference(externalEClass, EXTERNAL__BASE_CLASSIFIER); + + constInitEClass = createEClass(CONST_INIT); + createEAttribute(constInitEClass, CONST_INIT__INITIALISATION); + createEReference(constInitEClass, CONST_INIT__BASE_OPERATION); + + friendEClass = createEClass(FRIEND); + createEReference(friendEClass, FRIEND__BASE_DEPENDENCY); + createEReference(friendEClass, FRIEND__BASE_OPERATION); + + inlineEClass = createEClass(INLINE); + createEReference(inlineEClass, INLINE__BASE_OPERATION); + + virtualEClass = createEClass(VIRTUAL); + createEReference(virtualEClass, VIRTUAL__BASE_OPERATION); + + typedefEClass = createEClass(TYPEDEF); + createEAttribute(typedefEClass, TYPEDEF__DEFINITION); + createEReference(typedefEClass, TYPEDEF__BASE_PRIMITIVETYPE); + + visibilityEClass = createEClass(VISIBILITY); + createEAttribute(visibilityEClass, VISIBILITY__VALUE); + createEReference(visibilityEClass, VISIBILITY__BASE_GENERALIZATION); + + cppInitEClass = createEClass(CPP_INIT); + createEAttribute(cppInitEClass, CPP_INIT__VALUE); + createEReference(cppInitEClass, CPP_INIT__BASE_ENUMERATIONLITERAL); + + templateEClass = createEClass(TEMPLATE); + createEAttribute(templateEClass, TEMPLATE__DECLARATION); + createEReference(templateEClass, TEMPLATE__BASE_CLASS); + + templateBindingEClass = createEClass(TEMPLATE_BINDING); + createEAttribute(templateBindingEClass, TEMPLATE_BINDING__BINDING); + createEReference(templateBindingEClass, TEMPLATE_BINDING__BASE_TEMPLATEBINDING); + + templateParameterEClass = createEClass(TEMPLATE_PARAMETER); + createEAttribute(templateParameterEClass, TEMPLATE_PARAMETER__NAME); + createEReference(templateParameterEClass, TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER); + + unionEClass = createEClass(UNION); + createEReference(unionEClass, UNION__BASE_DATA_TYPE); + + storageClassEClass = createEClass(STORAGE_CLASS); + createEAttribute(storageClassEClass, STORAGE_CLASS__STORAGE_CLASS); + createEReference(storageClassEClass, STORAGE_CLASS__BASE_PROPERTY); + createEReference(storageClassEClass, STORAGE_CLASS__BASE_PARAMETER); + + volatileEClass = createEClass(VOLATILE); + createEReference(volatileEClass, VOLATILE__BASE_PARAMETER); + createEReference(volatileEClass, VOLATILE__BASE_PROPERTY); + createEReference(volatileEClass, VOLATILE__BASE_OPERATION); + + variadicEClass = createEClass(VARIADIC); + createEReference(variadicEClass, VARIADIC__BASE_OPERATION); + + mutableEClass = createEClass(MUTABLE); + createEReference(mutableEClass, MUTABLE__BASE_PROPERTY); + + // Create enums + visibilityKindEEnum = createEEnum(VISIBILITY_KIND); + eAccessKindEEnum = createEEnum(EACCESS_KIND); + eStorageClassEEnum = createEEnum(ESTORAGE_CLASS); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + UMLPackage theUMLPackage = (UMLPackage)EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI); + TypesPackage theTypesPackage = (TypesPackage)EPackage.Registry.INSTANCE.getEPackage(TypesPackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes, features, and operations; add parameters + initEClass(ptrEClass, Ptr.class, "Ptr", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getPtr_Base_parameter(), theUMLPackage.getParameter(), null, "base_parameter", null, 0, 1, Ptr.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getPtr_Base_property(), theUMLPackage.getProperty(), null, "base_property", null, 0, 1, Ptr.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getPtr_Declaration(), theTypesPackage.getString(), "declaration", null, 0, 1, Ptr.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(includeEClass, Include.class, "Include", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getInclude_Body(), theTypesPackage.getString(), "body", "", 0, 1, Include.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getInclude_PreBody(), theTypesPackage.getString(), "preBody", "", 0, 1, Include.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getInclude_Header(), theTypesPackage.getString(), "header", "", 0, 1, Include.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getInclude_Base_package(), theUMLPackage.getPackage(), null, "base_package", null, 0, 1, Include.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getInclude_Base_class(), theUMLPackage.getClass_(), null, "base_class", null, 0, 1, Include.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getInclude_Base_Classifier(), theUMLPackage.getClassifier(), null, "base_Classifier", null, 0, 1, Include.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(manualGenerationEClass, ManualGeneration.class, "ManualGeneration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getManualGeneration_ExtensionBody(), theTypesPackage.getString(), "extensionBody", null, 1, 1, ManualGeneration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getManualGeneration_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, ManualGeneration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(externLibraryEClass, ExternLibrary.class, "ExternLibrary", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getExternLibrary_IncludePaths(), theTypesPackage.getString(), "includePaths", null, 0, -1, ExternLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getExternLibrary_Base_package(), theUMLPackage.getPackage(), null, "base_package", null, 1, 1, ExternLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getExternLibrary_LibPaths(), theTypesPackage.getString(), "libPaths", null, 0, -1, ExternLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getExternLibrary_Macros(), theTypesPackage.getString(), "macros", null, 0, -1, ExternLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getExternLibrary_Libs(), theTypesPackage.getString(), "libs", null, 0, -1, ExternLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getExternLibrary_Includes(), theTypesPackage.getString(), "includes", null, 0, -1, ExternLibrary.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(noCodeGenEClass, NoCodeGen.class, "NoCodeGen", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getNoCodeGen_Base_element(), theUMLPackage.getElement(), null, "base_element", null, 1, 1, NoCodeGen.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(cppRootEClass, CppRoot.class, "CppRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCppRoot_Base_package(), theUMLPackage.getPackage(), null, "base_package", null, 1, 1, CppRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(arrayEClass, Array.class, "Array", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getArray_Base_parameter(), theUMLPackage.getParameter(), null, "base_parameter", null, 0, 1, Array.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getArray_Definition(), theTypesPackage.getString(), "definition", null, 1, 1, Array.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getArray_Base_property(), theUMLPackage.getProperty(), null, "base_property", null, 0, 1, Array.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getArray_Base_association(), theUMLPackage.getAssociation(), null, "base_association", null, 0, 1, Array.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(constEClass, Const.class, "Const", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getConst_Base_parameter(), theUMLPackage.getParameter(), null, "base_parameter", null, 0, 1, Const.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getConst_Base_property(), theUMLPackage.getProperty(), null, "base_property", null, 0, 1, Const.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getConst_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 0, 1, Const.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(refEClass, Ref.class, "Ref", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getRef_Base_parameter(), theUMLPackage.getParameter(), null, "base_parameter", null, 0, 1, Ref.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getRef_Base_property(), theUMLPackage.getProperty(), null, "base_property", null, 0, 1, Ref.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(externalEClass, External.class, "External", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getExternal_Name(), theTypesPackage.getString(), "name", null, 0, 1, External.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getExternal_Base_Classifier(), theUMLPackage.getClassifier(), null, "base_Classifier", null, 1, 1, External.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(constInitEClass, ConstInit.class, "ConstInit", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getConstInit_Initialisation(), theTypesPackage.getString(), "initialisation", null, 1, 1, ConstInit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getConstInit_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 1, 1, ConstInit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(friendEClass, Friend.class, "Friend", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getFriend_Base_dependency(), theUMLPackage.getDependency(), null, "base_dependency", null, 0, 1, Friend.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getFriend_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 0, 1, Friend.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(inlineEClass, Inline.class, "Inline", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getInline_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 1, 1, Inline.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(virtualEClass, Virtual.class, "Virtual", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getVirtual_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 1, 1, Virtual.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(typedefEClass, Typedef.class, "Typedef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getTypedef_Definition(), theTypesPackage.getString(), "definition", null, 1, 1, Typedef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getTypedef_Base_primitivetype(), theUMLPackage.getPrimitiveType(), null, "base_primitivetype", null, 1, 1, Typedef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(visibilityEClass, Visibility.class, "Visibility", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getVisibility_Value(), theTypesPackage.getString(), "value", null, 1, 1, Visibility.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getVisibility_Base_generalization(), theUMLPackage.getGeneralization(), null, "base_generalization", null, 1, 1, Visibility.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(cppInitEClass, CppInit.class, "CppInit", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getCppInit_Value(), theTypesPackage.getInteger(), "value", null, 1, 1, CppInit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getCppInit_Base_enumerationliteral(), theUMLPackage.getEnumerationLiteral(), null, "base_enumerationliteral", null, 1, 1, CppInit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(templateEClass, Template.class, "Template", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getTemplate_Declaration(), theTypesPackage.getString(), "declaration", null, 1, 1, Template.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getTemplate_Base_class(), theUMLPackage.getClass_(), null, "base_class", null, 1, 1, Template.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(templateBindingEClass, TemplateBinding.class, "TemplateBinding", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getTemplateBinding_Binding(), theTypesPackage.getString(), "binding", null, 1, 1, TemplateBinding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getTemplateBinding_Base_templatebinding(), theUMLPackage.getTemplateBinding(), null, "base_templatebinding", null, 1, 1, TemplateBinding.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(templateParameterEClass, TemplateParameter.class, "TemplateParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getTemplateParameter_Name(), theTypesPackage.getString(), "name", null, 1, 1, TemplateParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getTemplateParameter_Base_templateparameter(), theUMLPackage.getTemplateParameter(), null, "base_templateparameter", null, 1, 1, TemplateParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(unionEClass, Union.class, "Union", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getUnion_Base_DataType(), theUMLPackage.getDataType(), null, "base_DataType", null, 1, 1, Union.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(storageClassEClass, StorageClass.class, "StorageClass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getStorageClass_StorageClass(), this.getEStorageClass(), "storageClass", null, 1, 1, StorageClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getStorageClass_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 0, 1, StorageClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getStorageClass_Base_Parameter(), theUMLPackage.getParameter(), null, "base_Parameter", null, 0, 1, StorageClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(volatileEClass, Volatile.class, "Volatile", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getVolatile_Base_parameter(), theUMLPackage.getParameter(), null, "base_parameter", null, 0, 1, Volatile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getVolatile_Base_property(), theUMLPackage.getProperty(), null, "base_property", null, 0, 1, Volatile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getVolatile_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 0, 1, Volatile.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(variadicEClass, Variadic.class, "Variadic", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getVariadic_Base_operation(), theUMLPackage.getOperation(), null, "base_operation", null, 1, 1, Variadic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(mutableEClass, Mutable.class, "Mutable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getMutable_Base_property(), theUMLPackage.getProperty(), null, "base_property", null, 1, 1, Mutable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + // Initialize enums and add enum literals + initEEnum(visibilityKindEEnum, VisibilityKind.class, "VisibilityKind"); + addEEnumLiteral(visibilityKindEEnum, VisibilityKind.PRIVATE); + addEEnumLiteral(visibilityKindEEnum, VisibilityKind.PROTECTED); + addEEnumLiteral(visibilityKindEEnum, VisibilityKind.PUBLIC); + + initEEnum(eAccessKindEEnum, EAccessKind.class, "EAccessKind"); + addEEnumLiteral(eAccessKindEEnum, EAccessKind.READ); + addEEnumLiteral(eAccessKindEEnum, EAccessKind.WRITE); + addEEnumLiteral(eAccessKindEEnum, EAccessKind.READ_WRITE); + + initEEnum(eStorageClassEEnum, EStorageClass.class, "EStorageClass"); + addEEnumLiteral(eStorageClassEEnum, EStorageClass.VOLATILE); + addEEnumLiteral(eStorageClassEEnum, EStorageClass.REGISTER); + addEEnumLiteral(eStorageClassEEnum, EStorageClass.EXTERN); + + // Create resource + createResource(eNS_URI); + } + +} // C_CppPackageImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstImpl.java new file mode 100644 index 00000000000..0f14741165d --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstImpl.java @@ -0,0 +1,292 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Const; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Property; + +/** + * + * An implementation of the model object 'Const'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ConstImpl#getBase_parameter Base parameter}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ConstImpl#getBase_property Base property}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ConstImpl#getBase_operation Base operation}
    • + *
    + * + * @generated + */ +public class ConstImpl extends MinimalEObjectImpl.Container implements Const { + /** + * The cached value of the '{@link #getBase_parameter() Base parameter}' reference. + * + * + * @see #getBase_parameter() + * @generated + * @ordered + */ + protected Parameter base_parameter; + + /** + * The cached value of the '{@link #getBase_property() Base property}' reference. + * + * + * @see #getBase_property() + * @generated + * @ordered + */ + protected Property base_property; + + /** + * The cached value of the '{@link #getBase_operation() Base operation}' reference. + * + * + * @see #getBase_operation() + * @generated + * @ordered + */ + protected Operation base_operation; + + /** + * + * + * @generated + */ + protected ConstImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.CONST; + } + + /** + * + * + * @generated + */ + @Override + public Parameter getBase_parameter() { + if (base_parameter != null && base_parameter.eIsProxy()) { + InternalEObject oldBase_parameter = (InternalEObject)base_parameter; + base_parameter = (Parameter)eResolveProxy(oldBase_parameter); + if (base_parameter != oldBase_parameter) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.CONST__BASE_PARAMETER, oldBase_parameter, base_parameter)); + } + } + return base_parameter; + } + + /** + * + * + * @generated + */ + public Parameter basicGetBase_parameter() { + return base_parameter; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_parameter(Parameter newBase_parameter) { + Parameter oldBase_parameter = base_parameter; + base_parameter = newBase_parameter; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CONST__BASE_PARAMETER, oldBase_parameter, base_parameter)); + } + + /** + * + * + * @generated + */ + @Override + public Property getBase_property() { + if (base_property != null && base_property.eIsProxy()) { + InternalEObject oldBase_property = (InternalEObject)base_property; + base_property = (Property)eResolveProxy(oldBase_property); + if (base_property != oldBase_property) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.CONST__BASE_PROPERTY, oldBase_property, base_property)); + } + } + return base_property; + } + + /** + * + * + * @generated + */ + public Property basicGetBase_property() { + return base_property; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_property(Property newBase_property) { + Property oldBase_property = base_property; + base_property = newBase_property; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CONST__BASE_PROPERTY, oldBase_property, base_property)); + } + + /** + * + * + * @generated + */ + @Override + public Operation getBase_operation() { + if (base_operation != null && base_operation.eIsProxy()) { + InternalEObject oldBase_operation = (InternalEObject)base_operation; + base_operation = (Operation)eResolveProxy(oldBase_operation); + if (base_operation != oldBase_operation) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.CONST__BASE_OPERATION, oldBase_operation, base_operation)); + } + } + return base_operation; + } + + /** + * + * + * @generated + */ + public Operation basicGetBase_operation() { + return base_operation; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_operation(Operation newBase_operation) { + Operation oldBase_operation = base_operation; + base_operation = newBase_operation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CONST__BASE_OPERATION, oldBase_operation, base_operation)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.CONST__BASE_PARAMETER: + if (resolve) return getBase_parameter(); + return basicGetBase_parameter(); + case C_CppPackage.CONST__BASE_PROPERTY: + if (resolve) return getBase_property(); + return basicGetBase_property(); + case C_CppPackage.CONST__BASE_OPERATION: + if (resolve) return getBase_operation(); + return basicGetBase_operation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.CONST__BASE_PARAMETER: + setBase_parameter((Parameter)newValue); + return; + case C_CppPackage.CONST__BASE_PROPERTY: + setBase_property((Property)newValue); + return; + case C_CppPackage.CONST__BASE_OPERATION: + setBase_operation((Operation)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.CONST__BASE_PARAMETER: + setBase_parameter((Parameter)null); + return; + case C_CppPackage.CONST__BASE_PROPERTY: + setBase_property((Property)null); + return; + case C_CppPackage.CONST__BASE_OPERATION: + setBase_operation((Operation)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.CONST__BASE_PARAMETER: + return base_parameter != null; + case C_CppPackage.CONST__BASE_PROPERTY: + return base_property != null; + case C_CppPackage.CONST__BASE_OPERATION: + return base_operation != null; + } + return super.eIsSet(featureID); + } + +} // ConstImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstInitImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstInitImpl.java new file mode 100644 index 00000000000..0e0bfc786c3 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ConstInitImpl.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.ConstInit; +import org.eclipse.uml2.uml.Operation; + +/** + * + * An implementation of the model object 'Const Init'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ConstInitImpl#getInitialisation Initialisation}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ConstInitImpl#getBase_operation Base operation}
    • + *
    + * + * @generated + */ +public class ConstInitImpl extends MinimalEObjectImpl.Container implements ConstInit { + /** + * The default value of the '{@link #getInitialisation() Initialisation}' attribute. + * + * + * @see #getInitialisation() + * @generated + * @ordered + */ + protected static final String INITIALISATION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getInitialisation() Initialisation}' attribute. + * + * + * @see #getInitialisation() + * @generated + * @ordered + */ + protected String initialisation = INITIALISATION_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_operation() Base operation}' reference. + * + * + * @see #getBase_operation() + * @generated + * @ordered + */ + protected Operation base_operation; + + /** + * + * + * @generated + */ + protected ConstInitImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.CONST_INIT; + } + + /** + * + * + * @generated + */ + @Override + public String getInitialisation() { + return initialisation; + } + + /** + * + * + * @generated + */ + @Override + public void setInitialisation(String newInitialisation) { + String oldInitialisation = initialisation; + initialisation = newInitialisation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CONST_INIT__INITIALISATION, oldInitialisation, initialisation)); + } + + /** + * + * + * @generated + */ + @Override + public Operation getBase_operation() { + if (base_operation != null && base_operation.eIsProxy()) { + InternalEObject oldBase_operation = (InternalEObject)base_operation; + base_operation = (Operation)eResolveProxy(oldBase_operation); + if (base_operation != oldBase_operation) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.CONST_INIT__BASE_OPERATION, oldBase_operation, base_operation)); + } + } + return base_operation; + } + + /** + * + * + * @generated + */ + public Operation basicGetBase_operation() { + return base_operation; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_operation(Operation newBase_operation) { + Operation oldBase_operation = base_operation; + base_operation = newBase_operation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CONST_INIT__BASE_OPERATION, oldBase_operation, base_operation)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.CONST_INIT__INITIALISATION: + return getInitialisation(); + case C_CppPackage.CONST_INIT__BASE_OPERATION: + if (resolve) return getBase_operation(); + return basicGetBase_operation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.CONST_INIT__INITIALISATION: + setInitialisation((String)newValue); + return; + case C_CppPackage.CONST_INIT__BASE_OPERATION: + setBase_operation((Operation)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.CONST_INIT__INITIALISATION: + setInitialisation(INITIALISATION_EDEFAULT); + return; + case C_CppPackage.CONST_INIT__BASE_OPERATION: + setBase_operation((Operation)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.CONST_INIT__INITIALISATION: + return INITIALISATION_EDEFAULT == null ? initialisation != null : !INITIALISATION_EDEFAULT.equals(initialisation); + case C_CppPackage.CONST_INIT__BASE_OPERATION: + return base_operation != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (initialisation: "); + result.append(initialisation); + result.append(')'); + return result.toString(); + } + +} // ConstInitImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppInitImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppInitImpl.java new file mode 100644 index 00000000000..51cded9d983 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppInitImpl.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.CppInit; +import org.eclipse.uml2.uml.EnumerationLiteral; + +/** + * + * An implementation of the model object 'Cpp Init'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.CppInitImpl#getValue Value}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.CppInitImpl#getBase_enumerationliteral Base enumerationliteral}
    • + *
    + * + * @generated + */ +public class CppInitImpl extends MinimalEObjectImpl.Container implements CppInit { + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final int VALUE_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected int value = VALUE_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_enumerationliteral() Base enumerationliteral}' reference. + * + * + * @see #getBase_enumerationliteral() + * @generated + * @ordered + */ + protected EnumerationLiteral base_enumerationliteral; + + /** + * + * + * @generated + */ + protected CppInitImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.CPP_INIT; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public void setValue(int newValue) { + int oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CPP_INIT__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + @Override + public EnumerationLiteral getBase_enumerationliteral() { + if (base_enumerationliteral != null && base_enumerationliteral.eIsProxy()) { + InternalEObject oldBase_enumerationliteral = (InternalEObject)base_enumerationliteral; + base_enumerationliteral = (EnumerationLiteral)eResolveProxy(oldBase_enumerationliteral); + if (base_enumerationliteral != oldBase_enumerationliteral) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.CPP_INIT__BASE_ENUMERATIONLITERAL, oldBase_enumerationliteral, base_enumerationliteral)); + } + } + return base_enumerationliteral; + } + + /** + * + * + * @generated + */ + public EnumerationLiteral basicGetBase_enumerationliteral() { + return base_enumerationliteral; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_enumerationliteral(EnumerationLiteral newBase_enumerationliteral) { + EnumerationLiteral oldBase_enumerationliteral = base_enumerationliteral; + base_enumerationliteral = newBase_enumerationliteral; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CPP_INIT__BASE_ENUMERATIONLITERAL, oldBase_enumerationliteral, base_enumerationliteral)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.CPP_INIT__VALUE: + return getValue(); + case C_CppPackage.CPP_INIT__BASE_ENUMERATIONLITERAL: + if (resolve) return getBase_enumerationliteral(); + return basicGetBase_enumerationliteral(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.CPP_INIT__VALUE: + setValue((Integer)newValue); + return; + case C_CppPackage.CPP_INIT__BASE_ENUMERATIONLITERAL: + setBase_enumerationliteral((EnumerationLiteral)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.CPP_INIT__VALUE: + setValue(VALUE_EDEFAULT); + return; + case C_CppPackage.CPP_INIT__BASE_ENUMERATIONLITERAL: + setBase_enumerationliteral((EnumerationLiteral)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.CPP_INIT__VALUE: + return value != VALUE_EDEFAULT; + case C_CppPackage.CPP_INIT__BASE_ENUMERATIONLITERAL: + return base_enumerationliteral != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (value: "); + result.append(value); + result.append(')'); + return result.toString(); + } + +} // CppInitImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppRootImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppRootImpl.java new file mode 100644 index 00000000000..99ecba8d819 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/CppRootImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.CppRoot; + +/** + * + * An implementation of the model object 'Cpp Root'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.CppRootImpl#getBase_package Base package}
    • + *
    + * + * @generated + */ +public class CppRootImpl extends MinimalEObjectImpl.Container implements CppRoot { + /** + * The cached value of the '{@link #getBase_package() Base package}' reference. + * + * + * @see #getBase_package() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Package base_package; + + /** + * + * + * @generated + */ + protected CppRootImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.CPP_ROOT; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Package getBase_package() { + if (base_package != null && base_package.eIsProxy()) { + InternalEObject oldBase_package = (InternalEObject)base_package; + base_package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_package); + if (base_package != oldBase_package) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.CPP_ROOT__BASE_PACKAGE, oldBase_package, base_package)); + } + } + return base_package; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Package basicGetBase_package() { + return base_package; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_package(org.eclipse.uml2.uml.Package newBase_package) { + org.eclipse.uml2.uml.Package oldBase_package = base_package; + base_package = newBase_package; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.CPP_ROOT__BASE_PACKAGE, oldBase_package, base_package)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.CPP_ROOT__BASE_PACKAGE: + if (resolve) return getBase_package(); + return basicGetBase_package(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.CPP_ROOT__BASE_PACKAGE: + setBase_package((org.eclipse.uml2.uml.Package)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.CPP_ROOT__BASE_PACKAGE: + setBase_package((org.eclipse.uml2.uml.Package)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.CPP_ROOT__BASE_PACKAGE: + return base_package != null; + } + return super.eIsSet(featureID); + } + +} // CppRootImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternLibraryImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternLibraryImpl.java new file mode 100644 index 00000000000..3be2fad1a1a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternLibraryImpl.java @@ -0,0 +1,370 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.emf.ecore.util.EDataTypeEList; +import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.ExternLibrary; + +/** + * + * An implementation of the model object 'Extern Library'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl#getIncludePaths Include Paths}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl#getBase_package Base package}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl#getLibPaths Lib Paths}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl#getMacros Macros}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl#getLibs Libs}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ExternLibraryImpl#getIncludes Includes}
    • + *
    + * + * @generated + */ +public class ExternLibraryImpl extends MinimalEObjectImpl.Container implements ExternLibrary { + /** + * The cached value of the '{@link #getIncludePaths() Include Paths}' attribute list. + * + * + * @see #getIncludePaths() + * @generated + * @ordered + */ + protected EList includePaths; + + /** + * The cached value of the '{@link #getBase_package() Base package}' reference. + * + * + * @see #getBase_package() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Package base_package; + + /** + * The cached value of the '{@link #getLibPaths() Lib Paths}' attribute list. + * + * + * @see #getLibPaths() + * @generated + * @ordered + */ + protected EList libPaths; + + /** + * The cached value of the '{@link #getMacros() Macros}' attribute list. + * + * + * @see #getMacros() + * @generated + * @ordered + */ + protected EList macros; + + /** + * The cached value of the '{@link #getLibs() Libs}' attribute list. + * + * + * @see #getLibs() + * @generated + * @ordered + */ + protected EList libs; + + /** + * The cached value of the '{@link #getIncludes() Includes}' attribute list. + * + * + * @see #getIncludes() + * @generated + * @ordered + */ + protected EList includes; + + /** + * + * + * @generated + */ + protected ExternLibraryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.EXTERN_LIBRARY; + } + + /** + * + * + * @generated + */ + @Override + public EList getIncludePaths() { + if (includePaths == null) { + includePaths = new EDataTypeEList(String.class, this, C_CppPackage.EXTERN_LIBRARY__INCLUDE_PATHS); + } + return includePaths; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Package getBase_package() { + if (base_package != null && base_package.eIsProxy()) { + InternalEObject oldBase_package = (InternalEObject)base_package; + base_package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_package); + if (base_package != oldBase_package) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.EXTERN_LIBRARY__BASE_PACKAGE, oldBase_package, base_package)); + } + } + return base_package; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Package basicGetBase_package() { + return base_package; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_package(org.eclipse.uml2.uml.Package newBase_package) { + org.eclipse.uml2.uml.Package oldBase_package = base_package; + base_package = newBase_package; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.EXTERN_LIBRARY__BASE_PACKAGE, oldBase_package, base_package)); + } + + /** + * + * + * @generated + */ + @Override + public EList getLibPaths() { + if (libPaths == null) { + libPaths = new EDataTypeUniqueEList(String.class, this, C_CppPackage.EXTERN_LIBRARY__LIB_PATHS); + } + return libPaths; + } + + /** + * + * + * @generated + */ + @Override + public EList getMacros() { + if (macros == null) { + macros = new EDataTypeUniqueEList(String.class, this, C_CppPackage.EXTERN_LIBRARY__MACROS); + } + return macros; + } + + /** + * + * + * @generated + */ + @Override + public EList getLibs() { + if (libs == null) { + libs = new EDataTypeUniqueEList(String.class, this, C_CppPackage.EXTERN_LIBRARY__LIBS); + } + return libs; + } + + /** + * + * + * @generated + */ + @Override + public EList getIncludes() { + if (includes == null) { + includes = new EDataTypeUniqueEList(String.class, this, C_CppPackage.EXTERN_LIBRARY__INCLUDES); + } + return includes; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.EXTERN_LIBRARY__INCLUDE_PATHS: + return getIncludePaths(); + case C_CppPackage.EXTERN_LIBRARY__BASE_PACKAGE: + if (resolve) return getBase_package(); + return basicGetBase_package(); + case C_CppPackage.EXTERN_LIBRARY__LIB_PATHS: + return getLibPaths(); + case C_CppPackage.EXTERN_LIBRARY__MACROS: + return getMacros(); + case C_CppPackage.EXTERN_LIBRARY__LIBS: + return getLibs(); + case C_CppPackage.EXTERN_LIBRARY__INCLUDES: + return getIncludes(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.EXTERN_LIBRARY__INCLUDE_PATHS: + getIncludePaths().clear(); + getIncludePaths().addAll((Collection)newValue); + return; + case C_CppPackage.EXTERN_LIBRARY__BASE_PACKAGE: + setBase_package((org.eclipse.uml2.uml.Package)newValue); + return; + case C_CppPackage.EXTERN_LIBRARY__LIB_PATHS: + getLibPaths().clear(); + getLibPaths().addAll((Collection)newValue); + return; + case C_CppPackage.EXTERN_LIBRARY__MACROS: + getMacros().clear(); + getMacros().addAll((Collection)newValue); + return; + case C_CppPackage.EXTERN_LIBRARY__LIBS: + getLibs().clear(); + getLibs().addAll((Collection)newValue); + return; + case C_CppPackage.EXTERN_LIBRARY__INCLUDES: + getIncludes().clear(); + getIncludes().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.EXTERN_LIBRARY__INCLUDE_PATHS: + getIncludePaths().clear(); + return; + case C_CppPackage.EXTERN_LIBRARY__BASE_PACKAGE: + setBase_package((org.eclipse.uml2.uml.Package)null); + return; + case C_CppPackage.EXTERN_LIBRARY__LIB_PATHS: + getLibPaths().clear(); + return; + case C_CppPackage.EXTERN_LIBRARY__MACROS: + getMacros().clear(); + return; + case C_CppPackage.EXTERN_LIBRARY__LIBS: + getLibs().clear(); + return; + case C_CppPackage.EXTERN_LIBRARY__INCLUDES: + getIncludes().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.EXTERN_LIBRARY__INCLUDE_PATHS: + return includePaths != null && !includePaths.isEmpty(); + case C_CppPackage.EXTERN_LIBRARY__BASE_PACKAGE: + return base_package != null; + case C_CppPackage.EXTERN_LIBRARY__LIB_PATHS: + return libPaths != null && !libPaths.isEmpty(); + case C_CppPackage.EXTERN_LIBRARY__MACROS: + return macros != null && !macros.isEmpty(); + case C_CppPackage.EXTERN_LIBRARY__LIBS: + return libs != null && !libs.isEmpty(); + case C_CppPackage.EXTERN_LIBRARY__INCLUDES: + return includes != null && !includes.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (includePaths: "); + result.append(includePaths); + result.append(", libPaths: "); + result.append(libPaths); + result.append(", macros: "); + result.append(macros); + result.append(", libs: "); + result.append(libs); + result.append(", includes: "); + result.append(includes); + result.append(')'); + return result.toString(); + } + +} // ExternLibraryImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternalImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternalImpl.java new file mode 100644 index 00000000000..02982a5840c --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ExternalImpl.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.External; +import org.eclipse.uml2.uml.Classifier; + +/** + * + * An implementation of the model object 'External'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ExternalImpl#getName Name}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ExternalImpl#getBase_Classifier Base Classifier}
    • + *
    + * + * @generated + */ +public class ExternalImpl extends MinimalEObjectImpl.Container implements External { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_Classifier() Base Classifier}' reference. + * + * + * @see #getBase_Classifier() + * @generated + * @ordered + */ + protected Classifier base_Classifier; + + /** + * + * + * @generated + */ + protected ExternalImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.EXTERNAL; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.EXTERNAL__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public Classifier getBase_Classifier() { + if (base_Classifier != null && base_Classifier.eIsProxy()) { + InternalEObject oldBase_Classifier = (InternalEObject)base_Classifier; + base_Classifier = (Classifier)eResolveProxy(oldBase_Classifier); + if (base_Classifier != oldBase_Classifier) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.EXTERNAL__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier)); + } + } + return base_Classifier; + } + + /** + * + * + * @generated + */ + public Classifier basicGetBase_Classifier() { + return base_Classifier; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Classifier(Classifier newBase_Classifier) { + Classifier oldBase_Classifier = base_Classifier; + base_Classifier = newBase_Classifier; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.EXTERNAL__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.EXTERNAL__NAME: + return getName(); + case C_CppPackage.EXTERNAL__BASE_CLASSIFIER: + if (resolve) return getBase_Classifier(); + return basicGetBase_Classifier(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.EXTERNAL__NAME: + setName((String)newValue); + return; + case C_CppPackage.EXTERNAL__BASE_CLASSIFIER: + setBase_Classifier((Classifier)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.EXTERNAL__NAME: + setName(NAME_EDEFAULT); + return; + case C_CppPackage.EXTERNAL__BASE_CLASSIFIER: + setBase_Classifier((Classifier)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.EXTERNAL__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case C_CppPackage.EXTERNAL__BASE_CLASSIFIER: + return base_Classifier != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} // ExternalImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/FriendImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/FriendImpl.java new file mode 100644 index 00000000000..128e37db5aa --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/FriendImpl.java @@ -0,0 +1,229 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Friend; +import org.eclipse.uml2.uml.Dependency; +import org.eclipse.uml2.uml.Operation; + +/** + * + * An implementation of the model object 'Friend'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.FriendImpl#getBase_dependency Base dependency}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.FriendImpl#getBase_operation Base operation}
    • + *
    + * + * @generated + */ +public class FriendImpl extends MinimalEObjectImpl.Container implements Friend { + /** + * The cached value of the '{@link #getBase_dependency() Base dependency}' reference. + * + * + * @see #getBase_dependency() + * @generated + * @ordered + */ + protected Dependency base_dependency; + + /** + * The cached value of the '{@link #getBase_operation() Base operation}' reference. + * + * + * @see #getBase_operation() + * @generated + * @ordered + */ + protected Operation base_operation; + + /** + * + * + * @generated + */ + protected FriendImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.FRIEND; + } + + /** + * + * + * @generated + */ + @Override + public Dependency getBase_dependency() { + if (base_dependency != null && base_dependency.eIsProxy()) { + InternalEObject oldBase_dependency = (InternalEObject)base_dependency; + base_dependency = (Dependency)eResolveProxy(oldBase_dependency); + if (base_dependency != oldBase_dependency) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.FRIEND__BASE_DEPENDENCY, oldBase_dependency, base_dependency)); + } + } + return base_dependency; + } + + /** + * + * + * @generated + */ + public Dependency basicGetBase_dependency() { + return base_dependency; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_dependency(Dependency newBase_dependency) { + Dependency oldBase_dependency = base_dependency; + base_dependency = newBase_dependency; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.FRIEND__BASE_DEPENDENCY, oldBase_dependency, base_dependency)); + } + + /** + * + * + * @generated + */ + @Override + public Operation getBase_operation() { + if (base_operation != null && base_operation.eIsProxy()) { + InternalEObject oldBase_operation = (InternalEObject)base_operation; + base_operation = (Operation)eResolveProxy(oldBase_operation); + if (base_operation != oldBase_operation) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.FRIEND__BASE_OPERATION, oldBase_operation, base_operation)); + } + } + return base_operation; + } + + /** + * + * + * @generated + */ + public Operation basicGetBase_operation() { + return base_operation; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_operation(Operation newBase_operation) { + Operation oldBase_operation = base_operation; + base_operation = newBase_operation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.FRIEND__BASE_OPERATION, oldBase_operation, base_operation)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.FRIEND__BASE_DEPENDENCY: + if (resolve) return getBase_dependency(); + return basicGetBase_dependency(); + case C_CppPackage.FRIEND__BASE_OPERATION: + if (resolve) return getBase_operation(); + return basicGetBase_operation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.FRIEND__BASE_DEPENDENCY: + setBase_dependency((Dependency)newValue); + return; + case C_CppPackage.FRIEND__BASE_OPERATION: + setBase_operation((Operation)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.FRIEND__BASE_DEPENDENCY: + setBase_dependency((Dependency)null); + return; + case C_CppPackage.FRIEND__BASE_OPERATION: + setBase_operation((Operation)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.FRIEND__BASE_DEPENDENCY: + return base_dependency != null; + case C_CppPackage.FRIEND__BASE_OPERATION: + return base_operation != null; + } + return super.eIsSet(featureID); + } + +} // FriendImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/IncludeImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/IncludeImpl.java new file mode 100644 index 00000000000..e8d5bf7b6da --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/IncludeImpl.java @@ -0,0 +1,468 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Include; +import org.eclipse.uml2.uml.Classifier; + +/** + * + * An implementation of the model object 'Include'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl#getBody Body}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl#getPreBody Pre Body}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl#getHeader Header}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl#getBase_package Base package}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl#getBase_class Base class}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.IncludeImpl#getBase_Classifier Base Classifier}
    • + *
    + * + * @generated + */ +public class IncludeImpl extends MinimalEObjectImpl.Container implements Include { + /** + * The default value of the '{@link #getBody() Body}' attribute. + * + * + * @see #getBody() + * @generated + * @ordered + */ + protected static final String BODY_EDEFAULT = ""; //$NON-NLS-1$ + + /** + * The cached value of the '{@link #getBody() Body}' attribute. + * + * + * @see #getBody() + * @generated + * @ordered + */ + protected String body = BODY_EDEFAULT; + + /** + * The default value of the '{@link #getPreBody() Pre Body}' attribute. + * + * + * @see #getPreBody() + * @generated + * @ordered + */ + protected static final String PRE_BODY_EDEFAULT = ""; //$NON-NLS-1$ + + /** + * The cached value of the '{@link #getPreBody() Pre Body}' attribute. + * + * + * @see #getPreBody() + * @generated + * @ordered + */ + protected String preBody = PRE_BODY_EDEFAULT; + + /** + * The default value of the '{@link #getHeader() Header}' attribute. + * + * + * @see #getHeader() + * @generated + * @ordered + */ + protected static final String HEADER_EDEFAULT = ""; //$NON-NLS-1$ + + /** + * The cached value of the '{@link #getHeader() Header}' attribute. + * + * + * @see #getHeader() + * @generated + * @ordered + */ + protected String header = HEADER_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_package() Base package}' reference. + * + * + * @see #getBase_package() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Package base_package; + + /** + * The cached value of the '{@link #getBase_class() Base class}' reference. + * + * + * @see #getBase_class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_class; + + /** + * The cached value of the '{@link #getBase_Classifier() Base Classifier}' reference. + * + * + * @see #getBase_Classifier() + * @generated + * @ordered + */ + protected Classifier base_Classifier; + + /** + * + * + * @generated + */ + protected IncludeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.INCLUDE; + } + + /** + * + * + * @generated + */ + @Override + public String getBody() { + return body; + } + + /** + * + * + * @generated + */ + @Override + public void setBody(String newBody) { + String oldBody = body; + body = newBody; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INCLUDE__BODY, oldBody, body)); + } + + /** + * + * + * @generated + */ + @Override + public String getPreBody() { + return preBody; + } + + /** + * + * + * @generated + */ + @Override + public void setPreBody(String newPreBody) { + String oldPreBody = preBody; + preBody = newPreBody; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INCLUDE__PRE_BODY, oldPreBody, preBody)); + } + + /** + * + * + * @generated + */ + @Override + public String getHeader() { + return header; + } + + /** + * + * + * @generated + */ + @Override + public void setHeader(String newHeader) { + String oldHeader = header; + header = newHeader; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INCLUDE__HEADER, oldHeader, header)); + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Package getBase_package() { + if (base_package != null && base_package.eIsProxy()) { + InternalEObject oldBase_package = (InternalEObject)base_package; + base_package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_package); + if (base_package != oldBase_package) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.INCLUDE__BASE_PACKAGE, oldBase_package, base_package)); + } + } + return base_package; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Package basicGetBase_package() { + return base_package; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_package(org.eclipse.uml2.uml.Package newBase_package) { + org.eclipse.uml2.uml.Package oldBase_package = base_package; + base_package = newBase_package; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INCLUDE__BASE_PACKAGE, oldBase_package, base_package)); + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class getBase_class() { + if (base_class != null && base_class.eIsProxy()) { + InternalEObject oldBase_class = (InternalEObject)base_class; + base_class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_class); + if (base_class != oldBase_class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.INCLUDE__BASE_CLASS, oldBase_class, base_class)); + } + } + return base_class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_class() { + return base_class; + } + + /** + * + * + * @generated + */ + public void setBase_class(org.eclipse.uml2.uml.Class newBase_class) { + org.eclipse.uml2.uml.Class oldBase_class = base_class; + base_class = newBase_class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INCLUDE__BASE_CLASS, oldBase_class, base_class)); + } + + /** + * + * + * @generated + */ + public Classifier getBase_Classifier() { + if (base_Classifier != null && base_Classifier.eIsProxy()) { + InternalEObject oldBase_Classifier = (InternalEObject)base_Classifier; + base_Classifier = (Classifier)eResolveProxy(oldBase_Classifier); + if (base_Classifier != oldBase_Classifier) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.INCLUDE__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier)); + } + } + return base_Classifier; + } + + /** + * + * + * @generated + */ + public Classifier basicGetBase_Classifier() { + return base_Classifier; + } + + /** + * + * + * @generated + */ + public void setBase_Classifier(Classifier newBase_Classifier) { + Classifier oldBase_Classifier = base_Classifier; + base_Classifier = newBase_Classifier; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INCLUDE__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.INCLUDE__BODY: + return getBody(); + case C_CppPackage.INCLUDE__PRE_BODY: + return getPreBody(); + case C_CppPackage.INCLUDE__HEADER: + return getHeader(); + case C_CppPackage.INCLUDE__BASE_PACKAGE: + if (resolve) return getBase_package(); + return basicGetBase_package(); + case C_CppPackage.INCLUDE__BASE_CLASS: + if (resolve) return getBase_class(); + return basicGetBase_class(); + case C_CppPackage.INCLUDE__BASE_CLASSIFIER: + if (resolve) return getBase_Classifier(); + return basicGetBase_Classifier(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.INCLUDE__BODY: + setBody((String)newValue); + return; + case C_CppPackage.INCLUDE__PRE_BODY: + setPreBody((String)newValue); + return; + case C_CppPackage.INCLUDE__HEADER: + setHeader((String)newValue); + return; + case C_CppPackage.INCLUDE__BASE_PACKAGE: + setBase_package((org.eclipse.uml2.uml.Package)newValue); + return; + case C_CppPackage.INCLUDE__BASE_CLASS: + setBase_class((org.eclipse.uml2.uml.Class)newValue); + return; + case C_CppPackage.INCLUDE__BASE_CLASSIFIER: + setBase_Classifier((Classifier)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.INCLUDE__BODY: + setBody(BODY_EDEFAULT); + return; + case C_CppPackage.INCLUDE__PRE_BODY: + setPreBody(PRE_BODY_EDEFAULT); + return; + case C_CppPackage.INCLUDE__HEADER: + setHeader(HEADER_EDEFAULT); + return; + case C_CppPackage.INCLUDE__BASE_PACKAGE: + setBase_package((org.eclipse.uml2.uml.Package)null); + return; + case C_CppPackage.INCLUDE__BASE_CLASS: + setBase_class((org.eclipse.uml2.uml.Class)null); + return; + case C_CppPackage.INCLUDE__BASE_CLASSIFIER: + setBase_Classifier((Classifier)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.INCLUDE__BODY: + return BODY_EDEFAULT == null ? body != null : !BODY_EDEFAULT.equals(body); + case C_CppPackage.INCLUDE__PRE_BODY: + return PRE_BODY_EDEFAULT == null ? preBody != null : !PRE_BODY_EDEFAULT.equals(preBody); + case C_CppPackage.INCLUDE__HEADER: + return HEADER_EDEFAULT == null ? header != null : !HEADER_EDEFAULT.equals(header); + case C_CppPackage.INCLUDE__BASE_PACKAGE: + return base_package != null; + case C_CppPackage.INCLUDE__BASE_CLASS: + return base_class != null; + case C_CppPackage.INCLUDE__BASE_CLASSIFIER: + return base_Classifier != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (body: "); + result.append(body); + result.append(", preBody: "); + result.append(preBody); + result.append(", header: "); + result.append(header); + result.append(')'); + return result.toString(); + } + +} // IncludeImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/InlineImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/InlineImpl.java new file mode 100644 index 00000000000..091904f7416 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/InlineImpl.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Inline; +import org.eclipse.uml2.uml.Operation; + +/** + * + * An implementation of the model object 'Inline'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.InlineImpl#getBase_operation Base operation}
    • + *
    + * + * @generated + */ +public class InlineImpl extends MinimalEObjectImpl.Container implements Inline { + /** + * The cached value of the '{@link #getBase_operation() Base operation}' reference. + * + * + * @see #getBase_operation() + * @generated + * @ordered + */ + protected Operation base_operation; + + /** + * + * + * @generated + */ + protected InlineImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.INLINE; + } + + /** + * + * + * @generated + */ + @Override + public Operation getBase_operation() { + if (base_operation != null && base_operation.eIsProxy()) { + InternalEObject oldBase_operation = (InternalEObject)base_operation; + base_operation = (Operation)eResolveProxy(oldBase_operation); + if (base_operation != oldBase_operation) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.INLINE__BASE_OPERATION, oldBase_operation, base_operation)); + } + } + return base_operation; + } + + /** + * + * + * @generated + */ + public Operation basicGetBase_operation() { + return base_operation; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_operation(Operation newBase_operation) { + Operation oldBase_operation = base_operation; + base_operation = newBase_operation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.INLINE__BASE_OPERATION, oldBase_operation, base_operation)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.INLINE__BASE_OPERATION: + if (resolve) return getBase_operation(); + return basicGetBase_operation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.INLINE__BASE_OPERATION: + setBase_operation((Operation)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.INLINE__BASE_OPERATION: + setBase_operation((Operation)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.INLINE__BASE_OPERATION: + return base_operation != null; + } + return super.eIsSet(featureID); + } + +} // InlineImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ManualGenerationImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ManualGenerationImpl.java new file mode 100644 index 00000000000..4507d67ed3b --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/ManualGenerationImpl.java @@ -0,0 +1,235 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.ManualGeneration; + +/** + * + * An implementation of the model object 'Manual Generation'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ManualGenerationImpl#getExtensionBody Extension Body}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.ManualGenerationImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class ManualGenerationImpl extends MinimalEObjectImpl.Container implements ManualGeneration { + /** + * The default value of the '{@link #getExtensionBody() Extension Body}' attribute. + * + * + * @see #getExtensionBody() + * @generated + * @ordered + */ + protected static final String EXTENSION_BODY_EDEFAULT = null; + + /** + * The cached value of the '{@link #getExtensionBody() Extension Body}' attribute. + * + * + * @see #getExtensionBody() + * @generated + * @ordered + */ + protected String extensionBody = EXTENSION_BODY_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected ManualGenerationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.MANUAL_GENERATION; + } + + /** + * + * + * @generated + */ + @Override + public String getExtensionBody() { + return extensionBody; + } + + /** + * + * + * @generated + */ + @Override + public void setExtensionBody(String newExtensionBody) { + String oldExtensionBody = extensionBody; + extensionBody = newExtensionBody; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.MANUAL_GENERATION__EXTENSION_BODY, oldExtensionBody, extensionBody)); + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.MANUAL_GENERATION__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.MANUAL_GENERATION__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.MANUAL_GENERATION__EXTENSION_BODY: + return getExtensionBody(); + case C_CppPackage.MANUAL_GENERATION__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.MANUAL_GENERATION__EXTENSION_BODY: + setExtensionBody((String)newValue); + return; + case C_CppPackage.MANUAL_GENERATION__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.MANUAL_GENERATION__EXTENSION_BODY: + setExtensionBody(EXTENSION_BODY_EDEFAULT); + return; + case C_CppPackage.MANUAL_GENERATION__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.MANUAL_GENERATION__EXTENSION_BODY: + return EXTENSION_BODY_EDEFAULT == null ? extensionBody != null : !EXTENSION_BODY_EDEFAULT.equals(extensionBody); + case C_CppPackage.MANUAL_GENERATION__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (extensionBody: "); + result.append(extensionBody); + result.append(')'); + return result.toString(); + } + +} // ManualGenerationImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/MutableImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/MutableImpl.java new file mode 100644 index 00000000000..d0d2217c44d --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/MutableImpl.java @@ -0,0 +1,157 @@ +/** + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Mutable; + +import org.eclipse.uml2.uml.Property; + +/** + * + * An implementation of the model object 'Mutable'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.MutableImpl#getBase_property Base property}
    • + *
    + * + * @generated + */ +public class MutableImpl extends MinimalEObjectImpl.Container implements Mutable { + /** + * The cached value of the '{@link #getBase_property() Base property}' reference. + * + * + * @see #getBase_property() + * @generated + * @ordered + */ + protected Property base_property; + /** + * + * + * @generated + */ + protected MutableImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.MUTABLE; + } + + /** + * + * + * @generated + */ + public Property getBase_property() { + if (base_property != null && base_property.eIsProxy()) { + InternalEObject oldBase_property = (InternalEObject)base_property; + base_property = (Property)eResolveProxy(oldBase_property); + if (base_property != oldBase_property) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.MUTABLE__BASE_PROPERTY, oldBase_property, base_property)); + } + } + return base_property; + } + + /** + * + * + * @generated + */ + public Property basicGetBase_property() { + return base_property; + } + + /** + * + * + * @generated + */ + public void setBase_property(Property newBase_property) { + Property oldBase_property = base_property; + base_property = newBase_property; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.MUTABLE__BASE_PROPERTY, oldBase_property, base_property)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.MUTABLE__BASE_PROPERTY: + if (resolve) return getBase_property(); + return basicGetBase_property(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.MUTABLE__BASE_PROPERTY: + setBase_property((Property)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.MUTABLE__BASE_PROPERTY: + setBase_property((Property)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.MUTABLE__BASE_PROPERTY: + return base_property != null; + } + return super.eIsSet(featureID); + } + +} //MutableImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/NoCodeGenImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/NoCodeGenImpl.java new file mode 100644 index 00000000000..123867448aa --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/NoCodeGenImpl.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.NoCodeGen; +import org.eclipse.uml2.uml.Element; + +/** + * + * An implementation of the model object 'No Code Gen'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.NoCodeGenImpl#getBase_element Base element}
    • + *
    + * + * @generated + */ +public class NoCodeGenImpl extends MinimalEObjectImpl.Container implements NoCodeGen { + /** + * The cached value of the '{@link #getBase_element() Base element}' reference. + * + * + * @see #getBase_element() + * @generated + * @ordered + */ + protected Element base_element; + + /** + * + * + * @generated + */ + protected NoCodeGenImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.NO_CODE_GEN; + } + + /** + * + * + * @generated + */ + @Override + public Element getBase_element() { + if (base_element != null && base_element.eIsProxy()) { + InternalEObject oldBase_element = (InternalEObject)base_element; + base_element = (Element)eResolveProxy(oldBase_element); + if (base_element != oldBase_element) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.NO_CODE_GEN__BASE_ELEMENT, oldBase_element, base_element)); + } + } + return base_element; + } + + /** + * + * + * @generated + */ + public Element basicGetBase_element() { + return base_element; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_element(Element newBase_element) { + Element oldBase_element = base_element; + base_element = newBase_element; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.NO_CODE_GEN__BASE_ELEMENT, oldBase_element, base_element)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.NO_CODE_GEN__BASE_ELEMENT: + if (resolve) return getBase_element(); + return basicGetBase_element(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.NO_CODE_GEN__BASE_ELEMENT: + setBase_element((Element)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.NO_CODE_GEN__BASE_ELEMENT: + setBase_element((Element)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.NO_CODE_GEN__BASE_ELEMENT: + return base_element != null; + } + return super.eIsSet(featureID); + } + +} // NoCodeGenImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/PtrImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/PtrImpl.java new file mode 100644 index 00000000000..e0d4cf2d577 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/PtrImpl.java @@ -0,0 +1,299 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Ptr; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Property; + +/** + * + * An implementation of the model object 'Ptr'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.PtrImpl#getBase_parameter Base parameter}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.PtrImpl#getBase_property Base property}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.PtrImpl#getDeclaration Declaration}
    • + *
    + * + * @generated + */ +public class PtrImpl extends MinimalEObjectImpl.Container implements Ptr { + /** + * The cached value of the '{@link #getBase_parameter() Base parameter}' reference. + * + * + * @see #getBase_parameter() + * @generated + * @ordered + */ + protected Parameter base_parameter; + + /** + * The cached value of the '{@link #getBase_property() Base property}' reference. + * + * + * @see #getBase_property() + * @generated + * @ordered + */ + protected Property base_property; + + /** + * The default value of the '{@link #getDeclaration() Declaration}' attribute. + * + * + * @see #getDeclaration() + * @generated + * @ordered + */ + protected static final String DECLARATION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDeclaration() Declaration}' attribute. + * + * + * @see #getDeclaration() + * @generated + * @ordered + */ + protected String declaration = DECLARATION_EDEFAULT; + + /** + * + * + * @generated + */ + protected PtrImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.PTR; + } + + /** + * + * + * @generated + */ + @Override + public Parameter getBase_parameter() { + if (base_parameter != null && base_parameter.eIsProxy()) { + InternalEObject oldBase_parameter = (InternalEObject)base_parameter; + base_parameter = (Parameter)eResolveProxy(oldBase_parameter); + if (base_parameter != oldBase_parameter) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.PTR__BASE_PARAMETER, oldBase_parameter, base_parameter)); + } + } + return base_parameter; + } + + /** + * + * + * @generated + */ + public Parameter basicGetBase_parameter() { + return base_parameter; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_parameter(Parameter newBase_parameter) { + Parameter oldBase_parameter = base_parameter; + base_parameter = newBase_parameter; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.PTR__BASE_PARAMETER, oldBase_parameter, base_parameter)); + } + + /** + * + * + * @generated + */ + @Override + public Property getBase_property() { + if (base_property != null && base_property.eIsProxy()) { + InternalEObject oldBase_property = (InternalEObject)base_property; + base_property = (Property)eResolveProxy(oldBase_property); + if (base_property != oldBase_property) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.PTR__BASE_PROPERTY, oldBase_property, base_property)); + } + } + return base_property; + } + + /** + * + * + * @generated + */ + public Property basicGetBase_property() { + return base_property; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_property(Property newBase_property) { + Property oldBase_property = base_property; + base_property = newBase_property; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.PTR__BASE_PROPERTY, oldBase_property, base_property)); + } + + /** + * + * + * @generated + */ + @Override + public String getDeclaration() { + return declaration; + } + + /** + * + * + * @generated + */ + @Override + public void setDeclaration(String newDeclaration) { + String oldDeclaration = declaration; + declaration = newDeclaration; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.PTR__DECLARATION, oldDeclaration, declaration)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.PTR__BASE_PARAMETER: + if (resolve) return getBase_parameter(); + return basicGetBase_parameter(); + case C_CppPackage.PTR__BASE_PROPERTY: + if (resolve) return getBase_property(); + return basicGetBase_property(); + case C_CppPackage.PTR__DECLARATION: + return getDeclaration(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.PTR__BASE_PARAMETER: + setBase_parameter((Parameter)newValue); + return; + case C_CppPackage.PTR__BASE_PROPERTY: + setBase_property((Property)newValue); + return; + case C_CppPackage.PTR__DECLARATION: + setDeclaration((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.PTR__BASE_PARAMETER: + setBase_parameter((Parameter)null); + return; + case C_CppPackage.PTR__BASE_PROPERTY: + setBase_property((Property)null); + return; + case C_CppPackage.PTR__DECLARATION: + setDeclaration(DECLARATION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.PTR__BASE_PARAMETER: + return base_parameter != null; + case C_CppPackage.PTR__BASE_PROPERTY: + return base_property != null; + case C_CppPackage.PTR__DECLARATION: + return DECLARATION_EDEFAULT == null ? declaration != null : !DECLARATION_EDEFAULT.equals(declaration); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (declaration: "); + result.append(declaration); + result.append(')'); + return result.toString(); + } + +} // PtrImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/RefImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/RefImpl.java new file mode 100644 index 00000000000..59529e7d1e4 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/RefImpl.java @@ -0,0 +1,229 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Ref; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Property; + +/** + * + * An implementation of the model object 'Ref'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.RefImpl#getBase_parameter Base parameter}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.RefImpl#getBase_property Base property}
    • + *
    + * + * @generated + */ +public class RefImpl extends MinimalEObjectImpl.Container implements Ref { + /** + * The cached value of the '{@link #getBase_parameter() Base parameter}' reference. + * + * + * @see #getBase_parameter() + * @generated + * @ordered + */ + protected Parameter base_parameter; + + /** + * The cached value of the '{@link #getBase_property() Base property}' reference. + * + * + * @see #getBase_property() + * @generated + * @ordered + */ + protected Property base_property; + + /** + * + * + * @generated + */ + protected RefImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.REF; + } + + /** + * + * + * @generated + */ + @Override + public Parameter getBase_parameter() { + if (base_parameter != null && base_parameter.eIsProxy()) { + InternalEObject oldBase_parameter = (InternalEObject)base_parameter; + base_parameter = (Parameter)eResolveProxy(oldBase_parameter); + if (base_parameter != oldBase_parameter) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.REF__BASE_PARAMETER, oldBase_parameter, base_parameter)); + } + } + return base_parameter; + } + + /** + * + * + * @generated + */ + public Parameter basicGetBase_parameter() { + return base_parameter; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_parameter(Parameter newBase_parameter) { + Parameter oldBase_parameter = base_parameter; + base_parameter = newBase_parameter; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.REF__BASE_PARAMETER, oldBase_parameter, base_parameter)); + } + + /** + * + * + * @generated + */ + @Override + public Property getBase_property() { + if (base_property != null && base_property.eIsProxy()) { + InternalEObject oldBase_property = (InternalEObject)base_property; + base_property = (Property)eResolveProxy(oldBase_property); + if (base_property != oldBase_property) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.REF__BASE_PROPERTY, oldBase_property, base_property)); + } + } + return base_property; + } + + /** + * + * + * @generated + */ + public Property basicGetBase_property() { + return base_property; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_property(Property newBase_property) { + Property oldBase_property = base_property; + base_property = newBase_property; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.REF__BASE_PROPERTY, oldBase_property, base_property)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.REF__BASE_PARAMETER: + if (resolve) return getBase_parameter(); + return basicGetBase_parameter(); + case C_CppPackage.REF__BASE_PROPERTY: + if (resolve) return getBase_property(); + return basicGetBase_property(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.REF__BASE_PARAMETER: + setBase_parameter((Parameter)newValue); + return; + case C_CppPackage.REF__BASE_PROPERTY: + setBase_property((Property)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.REF__BASE_PARAMETER: + setBase_parameter((Parameter)null); + return; + case C_CppPackage.REF__BASE_PROPERTY: + setBase_property((Property)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.REF__BASE_PARAMETER: + return base_parameter != null; + case C_CppPackage.REF__BASE_PROPERTY: + return base_property != null; + } + return super.eIsSet(featureID); + } + +} // RefImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/StorageClassImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/StorageClassImpl.java new file mode 100644 index 00000000000..e2300c07f8e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/StorageClassImpl.java @@ -0,0 +1,296 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.EStorageClass; +import org.eclipse.papyrus.C_Cpp.StorageClass; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Property; + +/** + * + * An implementation of the model object 'Storage Class'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl#getStorageClass Storage Class}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl#getBase_Property Base Property}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.StorageClassImpl#getBase_Parameter Base Parameter}
    • + *
    + * + * @generated + */ +public class StorageClassImpl extends MinimalEObjectImpl.Container implements StorageClass { + /** + * The default value of the '{@link #getStorageClass() Storage Class}' attribute. + * + * + * @see #getStorageClass() + * @generated + * @ordered + */ + protected static final EStorageClass STORAGE_CLASS_EDEFAULT = EStorageClass.VOLATILE; + + /** + * The cached value of the '{@link #getStorageClass() Storage Class}' attribute. + * + * + * @see #getStorageClass() + * @generated + * @ordered + */ + protected EStorageClass storageClass = STORAGE_CLASS_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_Property() Base Property}' reference. + * + * + * @see #getBase_Property() + * @generated + * @ordered + */ + protected Property base_Property; + + /** + * The cached value of the '{@link #getBase_Parameter() Base Parameter}' reference. + * + * + * @see #getBase_Parameter() + * @generated + * @ordered + */ + protected Parameter base_Parameter; + + /** + * + * + * @generated + */ + protected StorageClassImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.STORAGE_CLASS; + } + + /** + * + * + * @generated + */ + @Override + public EStorageClass getStorageClass() { + return storageClass; + } + + /** + * + * + * @generated + */ + @Override + public void setStorageClass(EStorageClass newStorageClass) { + EStorageClass oldStorageClass = storageClass; + storageClass = newStorageClass == null ? STORAGE_CLASS_EDEFAULT : newStorageClass; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.STORAGE_CLASS__STORAGE_CLASS, oldStorageClass, storageClass)); + } + + /** + * + * + * @generated + */ + public Property getBase_Property() { + if (base_Property != null && base_Property.eIsProxy()) { + InternalEObject oldBase_Property = (InternalEObject)base_Property; + base_Property = (Property)eResolveProxy(oldBase_Property); + if (base_Property != oldBase_Property) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.STORAGE_CLASS__BASE_PROPERTY, oldBase_Property, base_Property)); + } + } + return base_Property; + } + + /** + * + * + * @generated + */ + public Property basicGetBase_Property() { + return base_Property; + } + + /** + * + * + * @generated + */ + public void setBase_Property(Property newBase_Property) { + Property oldBase_Property = base_Property; + base_Property = newBase_Property; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.STORAGE_CLASS__BASE_PROPERTY, oldBase_Property, base_Property)); + } + + /** + * + * + * @generated + */ + public Parameter getBase_Parameter() { + if (base_Parameter != null && base_Parameter.eIsProxy()) { + InternalEObject oldBase_Parameter = (InternalEObject)base_Parameter; + base_Parameter = (Parameter)eResolveProxy(oldBase_Parameter); + if (base_Parameter != oldBase_Parameter) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.STORAGE_CLASS__BASE_PARAMETER, oldBase_Parameter, base_Parameter)); + } + } + return base_Parameter; + } + + /** + * + * + * @generated + */ + public Parameter basicGetBase_Parameter() { + return base_Parameter; + } + + /** + * + * + * @generated + */ + public void setBase_Parameter(Parameter newBase_Parameter) { + Parameter oldBase_Parameter = base_Parameter; + base_Parameter = newBase_Parameter; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.STORAGE_CLASS__BASE_PARAMETER, oldBase_Parameter, base_Parameter)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.STORAGE_CLASS__STORAGE_CLASS: + return getStorageClass(); + case C_CppPackage.STORAGE_CLASS__BASE_PROPERTY: + if (resolve) return getBase_Property(); + return basicGetBase_Property(); + case C_CppPackage.STORAGE_CLASS__BASE_PARAMETER: + if (resolve) return getBase_Parameter(); + return basicGetBase_Parameter(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.STORAGE_CLASS__STORAGE_CLASS: + setStorageClass((EStorageClass)newValue); + return; + case C_CppPackage.STORAGE_CLASS__BASE_PROPERTY: + setBase_Property((Property)newValue); + return; + case C_CppPackage.STORAGE_CLASS__BASE_PARAMETER: + setBase_Parameter((Parameter)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.STORAGE_CLASS__STORAGE_CLASS: + setStorageClass(STORAGE_CLASS_EDEFAULT); + return; + case C_CppPackage.STORAGE_CLASS__BASE_PROPERTY: + setBase_Property((Property)null); + return; + case C_CppPackage.STORAGE_CLASS__BASE_PARAMETER: + setBase_Parameter((Parameter)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.STORAGE_CLASS__STORAGE_CLASS: + return storageClass != STORAGE_CLASS_EDEFAULT; + case C_CppPackage.STORAGE_CLASS__BASE_PROPERTY: + return base_Property != null; + case C_CppPackage.STORAGE_CLASS__BASE_PARAMETER: + return base_Parameter != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (storageClass: "); + result.append(storageClass); + result.append(')'); + return result.toString(); + } + +} // StorageClassImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateBindingImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateBindingImpl.java new file mode 100644 index 00000000000..097340a211b --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateBindingImpl.java @@ -0,0 +1,235 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.TemplateBinding; + +/** + * + * An implementation of the model object 'Template Binding'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.TemplateBindingImpl#getBinding Binding}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.TemplateBindingImpl#getBase_templatebinding Base templatebinding}
    • + *
    + * + * @generated + */ +public class TemplateBindingImpl extends MinimalEObjectImpl.Container implements TemplateBinding { + /** + * The default value of the '{@link #getBinding() Binding}' attribute. + * + * + * @see #getBinding() + * @generated + * @ordered + */ + protected static final String BINDING_EDEFAULT = null; + + /** + * The cached value of the '{@link #getBinding() Binding}' attribute. + * + * + * @see #getBinding() + * @generated + * @ordered + */ + protected String binding = BINDING_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_templatebinding() Base templatebinding}' reference. + * + * + * @see #getBase_templatebinding() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.TemplateBinding base_templatebinding; + + /** + * + * + * @generated + */ + protected TemplateBindingImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.TEMPLATE_BINDING; + } + + /** + * + * + * @generated + */ + @Override + public String getBinding() { + return binding; + } + + /** + * + * + * @generated + */ + @Override + public void setBinding(String newBinding) { + String oldBinding = binding; + binding = newBinding; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TEMPLATE_BINDING__BINDING, oldBinding, binding)); + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.TemplateBinding getBase_templatebinding() { + if (base_templatebinding != null && base_templatebinding.eIsProxy()) { + InternalEObject oldBase_templatebinding = (InternalEObject)base_templatebinding; + base_templatebinding = (org.eclipse.uml2.uml.TemplateBinding)eResolveProxy(oldBase_templatebinding); + if (base_templatebinding != oldBase_templatebinding) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.TEMPLATE_BINDING__BASE_TEMPLATEBINDING, oldBase_templatebinding, base_templatebinding)); + } + } + return base_templatebinding; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.TemplateBinding basicGetBase_templatebinding() { + return base_templatebinding; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_templatebinding(org.eclipse.uml2.uml.TemplateBinding newBase_templatebinding) { + org.eclipse.uml2.uml.TemplateBinding oldBase_templatebinding = base_templatebinding; + base_templatebinding = newBase_templatebinding; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TEMPLATE_BINDING__BASE_TEMPLATEBINDING, oldBase_templatebinding, base_templatebinding)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.TEMPLATE_BINDING__BINDING: + return getBinding(); + case C_CppPackage.TEMPLATE_BINDING__BASE_TEMPLATEBINDING: + if (resolve) return getBase_templatebinding(); + return basicGetBase_templatebinding(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.TEMPLATE_BINDING__BINDING: + setBinding((String)newValue); + return; + case C_CppPackage.TEMPLATE_BINDING__BASE_TEMPLATEBINDING: + setBase_templatebinding((org.eclipse.uml2.uml.TemplateBinding)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.TEMPLATE_BINDING__BINDING: + setBinding(BINDING_EDEFAULT); + return; + case C_CppPackage.TEMPLATE_BINDING__BASE_TEMPLATEBINDING: + setBase_templatebinding((org.eclipse.uml2.uml.TemplateBinding)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.TEMPLATE_BINDING__BINDING: + return BINDING_EDEFAULT == null ? binding != null : !BINDING_EDEFAULT.equals(binding); + case C_CppPackage.TEMPLATE_BINDING__BASE_TEMPLATEBINDING: + return base_templatebinding != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (binding: "); + result.append(binding); + result.append(')'); + return result.toString(); + } + +} // TemplateBindingImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateImpl.java new file mode 100644 index 00000000000..17a3a741071 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateImpl.java @@ -0,0 +1,235 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Template; + +/** + * + * An implementation of the model object 'Template'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.TemplateImpl#getDeclaration Declaration}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.TemplateImpl#getBase_class Base class}
    • + *
    + * + * @generated + */ +public class TemplateImpl extends MinimalEObjectImpl.Container implements Template { + /** + * The default value of the '{@link #getDeclaration() Declaration}' attribute. + * + * + * @see #getDeclaration() + * @generated + * @ordered + */ + protected static final String DECLARATION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDeclaration() Declaration}' attribute. + * + * + * @see #getDeclaration() + * @generated + * @ordered + */ + protected String declaration = DECLARATION_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_class() Base class}' reference. + * + * + * @see #getBase_class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_class; + + /** + * + * + * @generated + */ + protected TemplateImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.TEMPLATE; + } + + /** + * + * + * @generated + */ + @Override + public String getDeclaration() { + return declaration; + } + + /** + * + * + * @generated + */ + @Override + public void setDeclaration(String newDeclaration) { + String oldDeclaration = declaration; + declaration = newDeclaration; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TEMPLATE__DECLARATION, oldDeclaration, declaration)); + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_class() { + if (base_class != null && base_class.eIsProxy()) { + InternalEObject oldBase_class = (InternalEObject)base_class; + base_class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_class); + if (base_class != oldBase_class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.TEMPLATE__BASE_CLASS, oldBase_class, base_class)); + } + } + return base_class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_class() { + return base_class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_class(org.eclipse.uml2.uml.Class newBase_class) { + org.eclipse.uml2.uml.Class oldBase_class = base_class; + base_class = newBase_class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TEMPLATE__BASE_CLASS, oldBase_class, base_class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.TEMPLATE__DECLARATION: + return getDeclaration(); + case C_CppPackage.TEMPLATE__BASE_CLASS: + if (resolve) return getBase_class(); + return basicGetBase_class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.TEMPLATE__DECLARATION: + setDeclaration((String)newValue); + return; + case C_CppPackage.TEMPLATE__BASE_CLASS: + setBase_class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.TEMPLATE__DECLARATION: + setDeclaration(DECLARATION_EDEFAULT); + return; + case C_CppPackage.TEMPLATE__BASE_CLASS: + setBase_class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.TEMPLATE__DECLARATION: + return DECLARATION_EDEFAULT == null ? declaration != null : !DECLARATION_EDEFAULT.equals(declaration); + case C_CppPackage.TEMPLATE__BASE_CLASS: + return base_class != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (declaration: "); + result.append(declaration); + result.append(')'); + return result.toString(); + } + +} // TemplateImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateParameterImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateParameterImpl.java new file mode 100644 index 00000000000..2ba65fbebfb --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TemplateParameterImpl.java @@ -0,0 +1,235 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.TemplateParameter; + +/** + * + * An implementation of the model object 'Template Parameter'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.TemplateParameterImpl#getName Name}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.TemplateParameterImpl#getBase_templateparameter Base templateparameter}
    • + *
    + * + * @generated + */ +public class TemplateParameterImpl extends MinimalEObjectImpl.Container implements TemplateParameter { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_templateparameter() Base templateparameter}' reference. + * + * + * @see #getBase_templateparameter() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.TemplateParameter base_templateparameter; + + /** + * + * + * @generated + */ + protected TemplateParameterImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.TEMPLATE_PARAMETER; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TEMPLATE_PARAMETER__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.TemplateParameter getBase_templateparameter() { + if (base_templateparameter != null && base_templateparameter.eIsProxy()) { + InternalEObject oldBase_templateparameter = (InternalEObject)base_templateparameter; + base_templateparameter = (org.eclipse.uml2.uml.TemplateParameter)eResolveProxy(oldBase_templateparameter); + if (base_templateparameter != oldBase_templateparameter) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER, oldBase_templateparameter, base_templateparameter)); + } + } + return base_templateparameter; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.TemplateParameter basicGetBase_templateparameter() { + return base_templateparameter; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_templateparameter(org.eclipse.uml2.uml.TemplateParameter newBase_templateparameter) { + org.eclipse.uml2.uml.TemplateParameter oldBase_templateparameter = base_templateparameter; + base_templateparameter = newBase_templateparameter; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER, oldBase_templateparameter, base_templateparameter)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.TEMPLATE_PARAMETER__NAME: + return getName(); + case C_CppPackage.TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER: + if (resolve) return getBase_templateparameter(); + return basicGetBase_templateparameter(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.TEMPLATE_PARAMETER__NAME: + setName((String)newValue); + return; + case C_CppPackage.TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER: + setBase_templateparameter((org.eclipse.uml2.uml.TemplateParameter)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.TEMPLATE_PARAMETER__NAME: + setName(NAME_EDEFAULT); + return; + case C_CppPackage.TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER: + setBase_templateparameter((org.eclipse.uml2.uml.TemplateParameter)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.TEMPLATE_PARAMETER__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case C_CppPackage.TEMPLATE_PARAMETER__BASE_TEMPLATEPARAMETER: + return base_templateparameter != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + +} // TemplateParameterImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TypedefImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TypedefImpl.java new file mode 100644 index 00000000000..dd30383f008 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/TypedefImpl.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Typedef; +import org.eclipse.uml2.uml.PrimitiveType; + +/** + * + * An implementation of the model object 'Typedef'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.TypedefImpl#getDefinition Definition}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.TypedefImpl#getBase_primitivetype Base primitivetype}
    • + *
    + * + * @generated + */ +public class TypedefImpl extends MinimalEObjectImpl.Container implements Typedef { + /** + * The default value of the '{@link #getDefinition() Definition}' attribute. + * + * + * @see #getDefinition() + * @generated + * @ordered + */ + protected static final String DEFINITION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDefinition() Definition}' attribute. + * + * + * @see #getDefinition() + * @generated + * @ordered + */ + protected String definition = DEFINITION_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_primitivetype() Base primitivetype}' reference. + * + * + * @see #getBase_primitivetype() + * @generated + * @ordered + */ + protected PrimitiveType base_primitivetype; + + /** + * + * + * @generated + */ + protected TypedefImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.TYPEDEF; + } + + /** + * + * + * @generated + */ + @Override + public String getDefinition() { + return definition; + } + + /** + * + * + * @generated + */ + @Override + public void setDefinition(String newDefinition) { + String oldDefinition = definition; + definition = newDefinition; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TYPEDEF__DEFINITION, oldDefinition, definition)); + } + + /** + * + * + * @generated + */ + @Override + public PrimitiveType getBase_primitivetype() { + if (base_primitivetype != null && base_primitivetype.eIsProxy()) { + InternalEObject oldBase_primitivetype = (InternalEObject)base_primitivetype; + base_primitivetype = (PrimitiveType)eResolveProxy(oldBase_primitivetype); + if (base_primitivetype != oldBase_primitivetype) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.TYPEDEF__BASE_PRIMITIVETYPE, oldBase_primitivetype, base_primitivetype)); + } + } + return base_primitivetype; + } + + /** + * + * + * @generated + */ + public PrimitiveType basicGetBase_primitivetype() { + return base_primitivetype; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_primitivetype(PrimitiveType newBase_primitivetype) { + PrimitiveType oldBase_primitivetype = base_primitivetype; + base_primitivetype = newBase_primitivetype; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.TYPEDEF__BASE_PRIMITIVETYPE, oldBase_primitivetype, base_primitivetype)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.TYPEDEF__DEFINITION: + return getDefinition(); + case C_CppPackage.TYPEDEF__BASE_PRIMITIVETYPE: + if (resolve) return getBase_primitivetype(); + return basicGetBase_primitivetype(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.TYPEDEF__DEFINITION: + setDefinition((String)newValue); + return; + case C_CppPackage.TYPEDEF__BASE_PRIMITIVETYPE: + setBase_primitivetype((PrimitiveType)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.TYPEDEF__DEFINITION: + setDefinition(DEFINITION_EDEFAULT); + return; + case C_CppPackage.TYPEDEF__BASE_PRIMITIVETYPE: + setBase_primitivetype((PrimitiveType)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.TYPEDEF__DEFINITION: + return DEFINITION_EDEFAULT == null ? definition != null : !DEFINITION_EDEFAULT.equals(definition); + case C_CppPackage.TYPEDEF__BASE_PRIMITIVETYPE: + return base_primitivetype != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (definition: "); + result.append(definition); + result.append(')'); + return result.toString(); + } + +} // TypedefImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/UnionImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/UnionImpl.java new file mode 100644 index 00000000000..ece4ef86bb1 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/UnionImpl.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Union; +import org.eclipse.uml2.uml.DataType; + +/** + * + * An implementation of the model object 'Union'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.UnionImpl#getBase_DataType Base Data Type}
    • + *
    + * + * @generated + */ +public class UnionImpl extends MinimalEObjectImpl.Container implements Union { + /** + * The cached value of the '{@link #getBase_DataType() Base Data Type}' reference. + * + * + * @see #getBase_DataType() + * @generated + * @ordered + */ + protected DataType base_DataType; + + /** + * + * + * @generated + */ + protected UnionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.UNION; + } + + /** + * + * + * @generated + */ + @Override + public DataType getBase_DataType() { + if (base_DataType != null && base_DataType.eIsProxy()) { + InternalEObject oldBase_DataType = (InternalEObject)base_DataType; + base_DataType = (DataType)eResolveProxy(oldBase_DataType); + if (base_DataType != oldBase_DataType) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.UNION__BASE_DATA_TYPE, oldBase_DataType, base_DataType)); + } + } + return base_DataType; + } + + /** + * + * + * @generated + */ + public DataType basicGetBase_DataType() { + return base_DataType; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_DataType(DataType newBase_DataType) { + DataType oldBase_DataType = base_DataType; + base_DataType = newBase_DataType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.UNION__BASE_DATA_TYPE, oldBase_DataType, base_DataType)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.UNION__BASE_DATA_TYPE: + if (resolve) return getBase_DataType(); + return basicGetBase_DataType(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.UNION__BASE_DATA_TYPE: + setBase_DataType((DataType)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.UNION__BASE_DATA_TYPE: + setBase_DataType((DataType)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.UNION__BASE_DATA_TYPE: + return base_DataType != null; + } + return super.eIsSet(featureID); + } + +} // UnionImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VariadicImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VariadicImpl.java new file mode 100644 index 00000000000..d59834ca4ad --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VariadicImpl.java @@ -0,0 +1,157 @@ +/** + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Variadic; + +import org.eclipse.uml2.uml.Operation; + +/** + * + * An implementation of the model object 'Variadic'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.VariadicImpl#getBase_operation Base operation}
    • + *
    + * + * @generated + */ +public class VariadicImpl extends MinimalEObjectImpl.Container implements Variadic { + /** + * The cached value of the '{@link #getBase_operation() Base operation}' reference. + * + * + * @see #getBase_operation() + * @generated + * @ordered + */ + protected Operation base_operation; + /** + * + * + * @generated + */ + protected VariadicImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.VARIADIC; + } + + /** + * + * + * @generated + */ + public Operation getBase_operation() { + if (base_operation != null && base_operation.eIsProxy()) { + InternalEObject oldBase_operation = (InternalEObject)base_operation; + base_operation = (Operation)eResolveProxy(oldBase_operation); + if (base_operation != oldBase_operation) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.VARIADIC__BASE_OPERATION, oldBase_operation, base_operation)); + } + } + return base_operation; + } + + /** + * + * + * @generated + */ + public Operation basicGetBase_operation() { + return base_operation; + } + + /** + * + * + * @generated + */ + public void setBase_operation(Operation newBase_operation) { + Operation oldBase_operation = base_operation; + base_operation = newBase_operation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VARIADIC__BASE_OPERATION, oldBase_operation, base_operation)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.VARIADIC__BASE_OPERATION: + if (resolve) return getBase_operation(); + return basicGetBase_operation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.VARIADIC__BASE_OPERATION: + setBase_operation((Operation)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.VARIADIC__BASE_OPERATION: + setBase_operation((Operation)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.VARIADIC__BASE_OPERATION: + return base_operation != null; + } + return super.eIsSet(featureID); + } + +} //VariadicImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VirtualImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VirtualImpl.java new file mode 100644 index 00000000000..0455159368d --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VirtualImpl.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Virtual; +import org.eclipse.uml2.uml.Operation; + +/** + * + * An implementation of the model object 'Virtual'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.VirtualImpl#getBase_operation Base operation}
    • + *
    + * + * @generated + */ +public class VirtualImpl extends MinimalEObjectImpl.Container implements Virtual { + /** + * The cached value of the '{@link #getBase_operation() Base operation}' reference. + * + * + * @see #getBase_operation() + * @generated + * @ordered + */ + protected Operation base_operation; + + /** + * + * + * @generated + */ + protected VirtualImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.VIRTUAL; + } + + /** + * + * + * @generated + */ + @Override + public Operation getBase_operation() { + if (base_operation != null && base_operation.eIsProxy()) { + InternalEObject oldBase_operation = (InternalEObject)base_operation; + base_operation = (Operation)eResolveProxy(oldBase_operation); + if (base_operation != oldBase_operation) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.VIRTUAL__BASE_OPERATION, oldBase_operation, base_operation)); + } + } + return base_operation; + } + + /** + * + * + * @generated + */ + public Operation basicGetBase_operation() { + return base_operation; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_operation(Operation newBase_operation) { + Operation oldBase_operation = base_operation; + base_operation = newBase_operation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VIRTUAL__BASE_OPERATION, oldBase_operation, base_operation)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.VIRTUAL__BASE_OPERATION: + if (resolve) return getBase_operation(); + return basicGetBase_operation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.VIRTUAL__BASE_OPERATION: + setBase_operation((Operation)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.VIRTUAL__BASE_OPERATION: + setBase_operation((Operation)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.VIRTUAL__BASE_OPERATION: + return base_operation != null; + } + return super.eIsSet(featureID); + } + +} // VirtualImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VisibilityImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VisibilityImpl.java new file mode 100644 index 00000000000..6d865b6a19e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VisibilityImpl.java @@ -0,0 +1,236 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Visibility; +import org.eclipse.uml2.uml.Generalization; + +/** + * + * An implementation of the model object 'Visibility'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.VisibilityImpl#getValue Value}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.VisibilityImpl#getBase_generalization Base generalization}
    • + *
    + * + * @generated + */ +public class VisibilityImpl extends MinimalEObjectImpl.Container implements Visibility { + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final String VALUE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected String value = VALUE_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_generalization() Base generalization}' reference. + * + * + * @see #getBase_generalization() + * @generated + * @ordered + */ + protected Generalization base_generalization; + + /** + * + * + * @generated + */ + protected VisibilityImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.VISIBILITY; + } + + /** + * + * + * @generated + */ + @Override + public String getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public void setValue(String newValue) { + String oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VISIBILITY__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + @Override + public Generalization getBase_generalization() { + if (base_generalization != null && base_generalization.eIsProxy()) { + InternalEObject oldBase_generalization = (InternalEObject)base_generalization; + base_generalization = (Generalization)eResolveProxy(oldBase_generalization); + if (base_generalization != oldBase_generalization) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.VISIBILITY__BASE_GENERALIZATION, oldBase_generalization, base_generalization)); + } + } + return base_generalization; + } + + /** + * + * + * @generated + */ + public Generalization basicGetBase_generalization() { + return base_generalization; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_generalization(Generalization newBase_generalization) { + Generalization oldBase_generalization = base_generalization; + base_generalization = newBase_generalization; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VISIBILITY__BASE_GENERALIZATION, oldBase_generalization, base_generalization)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.VISIBILITY__VALUE: + return getValue(); + case C_CppPackage.VISIBILITY__BASE_GENERALIZATION: + if (resolve) return getBase_generalization(); + return basicGetBase_generalization(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.VISIBILITY__VALUE: + setValue((String)newValue); + return; + case C_CppPackage.VISIBILITY__BASE_GENERALIZATION: + setBase_generalization((Generalization)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.VISIBILITY__VALUE: + setValue(VALUE_EDEFAULT); + return; + case C_CppPackage.VISIBILITY__BASE_GENERALIZATION: + setBase_generalization((Generalization)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.VISIBILITY__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + case C_CppPackage.VISIBILITY__BASE_GENERALIZATION: + return base_generalization != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (value: "); + result.append(value); + result.append(')'); + return result.toString(); + } + +} // VisibilityImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VolatileImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VolatileImpl.java new file mode 100644 index 00000000000..6ac65d9f088 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/impl/VolatileImpl.java @@ -0,0 +1,291 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + */ +package org.eclipse.papyrus.C_Cpp.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Volatile; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Property; + +/** + * + * An implementation of the model object 'Volatile'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.VolatileImpl#getBase_parameter Base parameter}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.VolatileImpl#getBase_property Base property}
    • + *
    • {@link org.eclipse.papyrus.C_Cpp.impl.VolatileImpl#getBase_operation Base operation}
    • + *
    + * + * @generated + */ +public class VolatileImpl extends MinimalEObjectImpl.Container implements Volatile { + /** + * The cached value of the '{@link #getBase_parameter() Base parameter}' reference. + * + * + * @see #getBase_parameter() + * @generated + * @ordered + */ + protected Parameter base_parameter; + + /** + * The cached value of the '{@link #getBase_property() Base property}' reference. + * + * + * @see #getBase_property() + * @generated + * @ordered + */ + protected Property base_property; + + /** + * The cached value of the '{@link #getBase_operation() Base operation}' reference. + * + * + * @see #getBase_operation() + * @generated + * @ordered + */ + protected Operation base_operation; + + /** + * + * + * @generated + */ + protected VolatileImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return C_CppPackage.Literals.VOLATILE; + } + + /** + * + * + * @generated + */ + @Override + public Parameter getBase_parameter() { + if (base_parameter != null && base_parameter.eIsProxy()) { + InternalEObject oldBase_parameter = (InternalEObject)base_parameter; + base_parameter = (Parameter)eResolveProxy(oldBase_parameter); + if (base_parameter != oldBase_parameter) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.VOLATILE__BASE_PARAMETER, oldBase_parameter, base_parameter)); + } + } + return base_parameter; + } + + /** + * + * + * @generated + */ + public Parameter basicGetBase_parameter() { + return base_parameter; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_parameter(Parameter newBase_parameter) { + Parameter oldBase_parameter = base_parameter; + base_parameter = newBase_parameter; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VOLATILE__BASE_PARAMETER, oldBase_parameter, base_parameter)); + } + + /** + * + * + * @generated + */ + @Override + public Property getBase_property() { + if (base_property != null && base_property.eIsProxy()) { + InternalEObject oldBase_property = (InternalEObject)base_property; + base_property = (Property)eResolveProxy(oldBase_property); + if (base_property != oldBase_property) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.VOLATILE__BASE_PROPERTY, oldBase_property, base_property)); + } + } + return base_property; + } + + /** + * + * + * @generated + */ + public Property basicGetBase_property() { + return base_property; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_property(Property newBase_property) { + Property oldBase_property = base_property; + base_property = newBase_property; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VOLATILE__BASE_PROPERTY, oldBase_property, base_property)); + } + + /** + * + * + * @generated + */ + @Override + public Operation getBase_operation() { + if (base_operation != null && base_operation.eIsProxy()) { + InternalEObject oldBase_operation = (InternalEObject)base_operation; + base_operation = (Operation)eResolveProxy(oldBase_operation); + if (base_operation != oldBase_operation) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, C_CppPackage.VOLATILE__BASE_OPERATION, oldBase_operation, base_operation)); + } + } + return base_operation; + } + + /** + * + * + * @generated + */ + public Operation basicGetBase_operation() { + return base_operation; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_operation(Operation newBase_operation) { + Operation oldBase_operation = base_operation; + base_operation = newBase_operation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, C_CppPackage.VOLATILE__BASE_OPERATION, oldBase_operation, base_operation)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case C_CppPackage.VOLATILE__BASE_PARAMETER: + if (resolve) return getBase_parameter(); + return basicGetBase_parameter(); + case C_CppPackage.VOLATILE__BASE_PROPERTY: + if (resolve) return getBase_property(); + return basicGetBase_property(); + case C_CppPackage.VOLATILE__BASE_OPERATION: + if (resolve) return getBase_operation(); + return basicGetBase_operation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case C_CppPackage.VOLATILE__BASE_PARAMETER: + setBase_parameter((Parameter)newValue); + return; + case C_CppPackage.VOLATILE__BASE_PROPERTY: + setBase_property((Property)newValue); + return; + case C_CppPackage.VOLATILE__BASE_OPERATION: + setBase_operation((Operation)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case C_CppPackage.VOLATILE__BASE_PARAMETER: + setBase_parameter((Parameter)null); + return; + case C_CppPackage.VOLATILE__BASE_PROPERTY: + setBase_property((Property)null); + return; + case C_CppPackage.VOLATILE__BASE_OPERATION: + setBase_operation((Operation)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case C_CppPackage.VOLATILE__BASE_PARAMETER: + return base_parameter != null; + case C_CppPackage.VOLATILE__BASE_PROPERTY: + return base_property != null; + case C_CppPackage.VOLATILE__BASE_OPERATION: + return base_operation != null; + } + return super.eIsSet(featureID); + } + +} // VolatileImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppAdapterFactory.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppAdapterFactory.java new file mode 100644 index 00000000000..b00c2921104 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppAdapterFactory.java @@ -0,0 +1,584 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.C_Cpp.Array; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Const; +import org.eclipse.papyrus.C_Cpp.ConstInit; +import org.eclipse.papyrus.C_Cpp.CppInit; +import org.eclipse.papyrus.C_Cpp.CppRoot; +import org.eclipse.papyrus.C_Cpp.ExternLibrary; +import org.eclipse.papyrus.C_Cpp.External; +import org.eclipse.papyrus.C_Cpp.Friend; +import org.eclipse.papyrus.C_Cpp.Include; +import org.eclipse.papyrus.C_Cpp.Inline; +import org.eclipse.papyrus.C_Cpp.ManualGeneration; +import org.eclipse.papyrus.C_Cpp.Mutable; +import org.eclipse.papyrus.C_Cpp.NoCodeGen; +import org.eclipse.papyrus.C_Cpp.Ptr; +import org.eclipse.papyrus.C_Cpp.Ref; +import org.eclipse.papyrus.C_Cpp.StorageClass; +import org.eclipse.papyrus.C_Cpp.Template; +import org.eclipse.papyrus.C_Cpp.TemplateBinding; +import org.eclipse.papyrus.C_Cpp.TemplateParameter; +import org.eclipse.papyrus.C_Cpp.Typedef; +import org.eclipse.papyrus.C_Cpp.Union; +import org.eclipse.papyrus.C_Cpp.Variadic; +import org.eclipse.papyrus.C_Cpp.Virtual; +import org.eclipse.papyrus.C_Cpp.Visibility; +import org.eclipse.papyrus.C_Cpp.Volatile; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage + * @generated + */ +public class C_CppAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static C_CppPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public C_CppAdapterFactory() { + if (modelPackage == null) { + modelPackage = C_CppPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected C_CppSwitch modelSwitch = + new C_CppSwitch() { + @Override + public Adapter casePtr(Ptr object) { + return createPtrAdapter(); + } + @Override + public Adapter caseInclude(Include object) { + return createIncludeAdapter(); + } + @Override + public Adapter caseManualGeneration(ManualGeneration object) { + return createManualGenerationAdapter(); + } + @Override + public Adapter caseExternLibrary(ExternLibrary object) { + return createExternLibraryAdapter(); + } + @Override + public Adapter caseNoCodeGen(NoCodeGen object) { + return createNoCodeGenAdapter(); + } + @Override + public Adapter caseCppRoot(CppRoot object) { + return createCppRootAdapter(); + } + @Override + public Adapter caseArray(Array object) { + return createArrayAdapter(); + } + @Override + public Adapter caseConst(Const object) { + return createConstAdapter(); + } + @Override + public Adapter caseRef(Ref object) { + return createRefAdapter(); + } + @Override + public Adapter caseExternal(External object) { + return createExternalAdapter(); + } + @Override + public Adapter caseConstInit(ConstInit object) { + return createConstInitAdapter(); + } + @Override + public Adapter caseFriend(Friend object) { + return createFriendAdapter(); + } + @Override + public Adapter caseInline(Inline object) { + return createInlineAdapter(); + } + @Override + public Adapter caseVirtual(Virtual object) { + return createVirtualAdapter(); + } + @Override + public Adapter caseTypedef(Typedef object) { + return createTypedefAdapter(); + } + @Override + public Adapter caseVisibility(Visibility object) { + return createVisibilityAdapter(); + } + @Override + public Adapter caseCppInit(CppInit object) { + return createCppInitAdapter(); + } + @Override + public Adapter caseTemplate(Template object) { + return createTemplateAdapter(); + } + @Override + public Adapter caseTemplateBinding(TemplateBinding object) { + return createTemplateBindingAdapter(); + } + @Override + public Adapter caseTemplateParameter(TemplateParameter object) { + return createTemplateParameterAdapter(); + } + @Override + public Adapter caseUnion(Union object) { + return createUnionAdapter(); + } + @Override + public Adapter caseStorageClass(StorageClass object) { + return createStorageClassAdapter(); + } + @Override + public Adapter caseVolatile(Volatile object) { + return createVolatileAdapter(); + } + @Override + public Adapter caseVariadic(Variadic object) { + return createVariadicAdapter(); + } + @Override + public Adapter caseMutable(Mutable object) { + return createMutableAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Ptr Ptr}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Ptr + * @generated + */ + public Adapter createPtrAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Include Include}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Include + * @generated + */ + public Adapter createIncludeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.ManualGeneration Manual Generation}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.ManualGeneration + * @generated + */ + public Adapter createManualGenerationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.ExternLibrary Extern Library}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.ExternLibrary + * @generated + */ + public Adapter createExternLibraryAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.NoCodeGen No Code Gen}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.NoCodeGen + * @generated + */ + public Adapter createNoCodeGenAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.CppRoot Cpp Root}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.CppRoot + * @generated + */ + public Adapter createCppRootAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Array Array}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Array + * @generated + */ + public Adapter createArrayAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Const Const}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Const + * @generated + */ + public Adapter createConstAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Ref Ref}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Ref + * @generated + */ + public Adapter createRefAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.External External}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.External + * @generated + */ + public Adapter createExternalAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.ConstInit Const Init}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.ConstInit + * @generated + */ + public Adapter createConstInitAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Friend Friend}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Friend + * @generated + */ + public Adapter createFriendAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Inline Inline}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Inline + * @generated + */ + public Adapter createInlineAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Virtual Virtual}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Virtual + * @generated + */ + public Adapter createVirtualAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Typedef Typedef}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Typedef + * @generated + */ + public Adapter createTypedefAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Visibility Visibility}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Visibility + * @generated + */ + public Adapter createVisibilityAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.CppInit Cpp Init}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.CppInit + * @generated + */ + public Adapter createCppInitAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Template Template}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Template + * @generated + */ + public Adapter createTemplateAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.TemplateBinding Template Binding}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.TemplateBinding + * @generated + */ + public Adapter createTemplateBindingAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.TemplateParameter Template Parameter}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.TemplateParameter + * @generated + */ + public Adapter createTemplateParameterAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Union Union}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Union + * @generated + */ + public Adapter createUnionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.StorageClass Storage Class}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.StorageClass + * @generated + */ + public Adapter createStorageClassAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Volatile Volatile}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Volatile + * @generated + */ + public Adapter createVolatileAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Variadic Variadic}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Variadic + * @generated + */ + public Adapter createVariadicAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.C_Cpp.Mutable Mutable}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.C_Cpp.Mutable + * @generated + */ + public Adapter createMutableAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} // C_CppAdapterFactory diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceFactoryImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceFactoryImpl.java new file mode 100644 index 00000000000..606f055aab1 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceFactoryImpl.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.util; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; +import org.eclipse.emf.ecore.xmi.XMLResource; + +/** + * + * The Resource Factory associated with the package. + * + * @see org.eclipse.papyrus.C_Cpp.util.C_CppResourceImpl + * @generated + */ +public class C_CppResourceFactoryImpl extends ResourceFactoryImpl { + /** + * Creates an instance of the resource factory. + * + * + * @generated + */ + public C_CppResourceFactoryImpl() { + super(); + } + + /** + * Creates an instance of the resource. + * + * + * @generated + */ + @Override + public Resource createResource(URI uri) { + XMLResource result = new C_CppResourceImpl(uri); + return result; + } + +} // C_CppResourceFactoryImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceImpl.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceImpl.java new file mode 100644 index 00000000000..c728ce68f13 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppResourceImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.util; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; + +/** + * + * The Resource associated with the package. + * + * @see org.eclipse.papyrus.C_Cpp.util.C_CppResourceFactoryImpl + * @generated + */ +public class C_CppResourceImpl extends XMLResourceImpl { + /** + * Creates an instance of the resource. + * + * + * @param uri the URI of the new resource. + * @generated + */ + public C_CppResourceImpl(URI uri) { + super(uri); + } + +} // C_CppResourceImpl diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppSwitch.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppSwitch.java new file mode 100644 index 00000000000..cc3991bb0e4 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppSwitch.java @@ -0,0 +1,646 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.util.Switch; +import org.eclipse.papyrus.C_Cpp.Array; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; +import org.eclipse.papyrus.C_Cpp.Const; +import org.eclipse.papyrus.C_Cpp.ConstInit; +import org.eclipse.papyrus.C_Cpp.CppInit; +import org.eclipse.papyrus.C_Cpp.CppRoot; +import org.eclipse.papyrus.C_Cpp.ExternLibrary; +import org.eclipse.papyrus.C_Cpp.External; +import org.eclipse.papyrus.C_Cpp.Friend; +import org.eclipse.papyrus.C_Cpp.Include; +import org.eclipse.papyrus.C_Cpp.Inline; +import org.eclipse.papyrus.C_Cpp.ManualGeneration; +import org.eclipse.papyrus.C_Cpp.Mutable; +import org.eclipse.papyrus.C_Cpp.NoCodeGen; +import org.eclipse.papyrus.C_Cpp.Ptr; +import org.eclipse.papyrus.C_Cpp.Ref; +import org.eclipse.papyrus.C_Cpp.StorageClass; +import org.eclipse.papyrus.C_Cpp.Template; +import org.eclipse.papyrus.C_Cpp.TemplateBinding; +import org.eclipse.papyrus.C_Cpp.TemplateParameter; +import org.eclipse.papyrus.C_Cpp.Typedef; +import org.eclipse.papyrus.C_Cpp.Union; +import org.eclipse.papyrus.C_Cpp.Variadic; +import org.eclipse.papyrus.C_Cpp.Virtual; +import org.eclipse.papyrus.C_Cpp.Visibility; +import org.eclipse.papyrus.C_Cpp.Volatile; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see org.eclipse.papyrus.C_Cpp.C_CppPackage + * @generated + */ +public class C_CppSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static C_CppPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public C_CppSwitch() { + if (modelPackage == null) { + modelPackage = C_CppPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case C_CppPackage.PTR: { + Ptr ptr = (Ptr)theEObject; + T result = casePtr(ptr); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.INCLUDE: { + Include include = (Include)theEObject; + T result = caseInclude(include); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.MANUAL_GENERATION: { + ManualGeneration manualGeneration = (ManualGeneration)theEObject; + T result = caseManualGeneration(manualGeneration); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.EXTERN_LIBRARY: { + ExternLibrary externLibrary = (ExternLibrary)theEObject; + T result = caseExternLibrary(externLibrary); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.NO_CODE_GEN: { + NoCodeGen noCodeGen = (NoCodeGen)theEObject; + T result = caseNoCodeGen(noCodeGen); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.CPP_ROOT: { + CppRoot cppRoot = (CppRoot)theEObject; + T result = caseCppRoot(cppRoot); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.ARRAY: { + Array array = (Array)theEObject; + T result = caseArray(array); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.CONST: { + Const const_ = (Const)theEObject; + T result = caseConst(const_); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.REF: { + Ref ref = (Ref)theEObject; + T result = caseRef(ref); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.EXTERNAL: { + External external = (External)theEObject; + T result = caseExternal(external); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.CONST_INIT: { + ConstInit constInit = (ConstInit)theEObject; + T result = caseConstInit(constInit); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.FRIEND: { + Friend friend = (Friend)theEObject; + T result = caseFriend(friend); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.INLINE: { + Inline inline = (Inline)theEObject; + T result = caseInline(inline); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.VIRTUAL: { + Virtual virtual = (Virtual)theEObject; + T result = caseVirtual(virtual); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.TYPEDEF: { + Typedef typedef = (Typedef)theEObject; + T result = caseTypedef(typedef); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.VISIBILITY: { + Visibility visibility = (Visibility)theEObject; + T result = caseVisibility(visibility); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.CPP_INIT: { + CppInit cppInit = (CppInit)theEObject; + T result = caseCppInit(cppInit); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.TEMPLATE: { + Template template = (Template)theEObject; + T result = caseTemplate(template); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.TEMPLATE_BINDING: { + TemplateBinding templateBinding = (TemplateBinding)theEObject; + T result = caseTemplateBinding(templateBinding); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.TEMPLATE_PARAMETER: { + TemplateParameter templateParameter = (TemplateParameter)theEObject; + T result = caseTemplateParameter(templateParameter); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.UNION: { + Union union = (Union)theEObject; + T result = caseUnion(union); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.STORAGE_CLASS: { + StorageClass storageClass = (StorageClass)theEObject; + T result = caseStorageClass(storageClass); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.VOLATILE: { + Volatile volatile_ = (Volatile)theEObject; + T result = caseVolatile(volatile_); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.VARIADIC: { + Variadic variadic = (Variadic)theEObject; + T result = caseVariadic(variadic); + if (result == null) result = defaultCase(theEObject); + return result; + } + case C_CppPackage.MUTABLE: { + Mutable mutable = (Mutable)theEObject; + T result = caseMutable(mutable); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Ptr'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Ptr'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePtr(Ptr object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Include'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Include'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInclude(Include object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Manual Generation'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Manual Generation'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseManualGeneration(ManualGeneration object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Extern Library'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Extern Library'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseExternLibrary(ExternLibrary object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'No Code Gen'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'No Code Gen'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseNoCodeGen(NoCodeGen object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Cpp Root'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Cpp Root'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCppRoot(CppRoot object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Array'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Array'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseArray(Array object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Const'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Const'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConst(Const object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Ref'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Ref'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRef(Ref object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'External'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'External'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseExternal(External object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Const Init'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Const Init'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConstInit(ConstInit object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Friend'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Friend'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFriend(Friend object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Inline'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Inline'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInline(Inline object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Virtual'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Virtual'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseVirtual(Virtual object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Typedef'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Typedef'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTypedef(Typedef object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Visibility'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Visibility'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseVisibility(Visibility object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Cpp Init'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Cpp Init'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCppInit(CppInit object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Template'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Template'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTemplate(Template object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Template Binding'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Template Binding'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTemplateBinding(TemplateBinding object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Template Parameter'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Template Parameter'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTemplateParameter(TemplateParameter object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Union'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Union'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseUnion(Union object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Storage Class'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Storage Class'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseStorageClass(StorageClass object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Volatile'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Volatile'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseVolatile(Volatile object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Variadic'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Variadic'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseVariadic(Variadic object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Mutable'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Mutable'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseMutable(Mutable object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} // C_CppSwitch diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppXMLProcessor.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppXMLProcessor.java new file mode 100644 index 00000000000..e66da34caf6 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/C_Cpp/util/C_CppXMLProcessor.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + */ +package org.eclipse.papyrus.C_Cpp.util; + +import java.util.Map; + +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.xmi.util.XMLProcessor; +import org.eclipse.papyrus.C_Cpp.C_CppPackage; + +/** + * This class contains helper methods to serialize and deserialize XML documents + * + * + * @generated + */ +public class C_CppXMLProcessor extends XMLProcessor { + + /** + * Public constructor to instantiate the helper. + * + * + * @generated + */ + public C_CppXMLProcessor() { + super((EPackage.Registry.INSTANCE)); + C_CppPackage.eINSTANCE.eClass(); + } + + /** + * Register for "*" and "xml" file extensions the C_CppResourceFactoryImpl factory. + * + * + * @generated + */ + @Override + protected Map getRegistrations() { + if (registrations == null) { + super.getRegistrations(); + registrations.put(XML_EXTENSION, new C_CppResourceFactoryImpl()); + registrations.put(STAR_EXTENSION, new C_CppResourceFactoryImpl()); + } + return registrations; + } + +} // C_CppXMLProcessor diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/cpp/profile/Activator.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/cpp/profile/Activator.java new file mode 100644 index 00000000000..6e341a2a8dc --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile/src/org/eclipse/papyrus/cpp/profile/Activator.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.cpp.profile; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/.cproject b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/.cproject new file mode 100644 index 00000000000..7625f2eab4a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/.cproject @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/.gitignore b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/.gitignore new file mode 100644 index 00000000000..b946e6f080e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/.gitignore @@ -0,0 +1,2 @@ +TestCDTintegration +Debug diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/.project b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/.project new file mode 100644 index 00000000000..81efcb02b14 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/.project @@ -0,0 +1,83 @@ + + + org.eclipse.papyrus.cpp.test + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/TestCDT/Debug} + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.di b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.di new file mode 100644 index 00000000000..b1b3ed6ae2a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.di @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.notation b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.notation new file mode 100644 index 00000000000..322e298d2d9 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.notation @@ -0,0 +1,151 @@ + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.uml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.uml new file mode 100644 index 00000000000..46032827278 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCCodeGen.uml @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + + + C/C++ + + + + C/C++ + my Text + + + C/C++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + // Now let's add some code +arg[0] = 1; + + + + Here you can document operation1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.di b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.di new file mode 100644 index 00000000000..3acfa5281bc --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.di @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.notation b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.notation new file mode 100644 index 00000000000..6c917c29662 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.notation @@ -0,0 +1,283 @@ + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + +
    + + +
    + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + +
    + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.uml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.uml new file mode 100644 index 00000000000..968950faadb --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.test/model/TestCDTintegration.uml @@ -0,0 +1,182 @@ + + + + + This class contains a state machine + + + + + + + + + + + + + + + + + + C/C++ + + + + C/C++ + my Text + + + C/C++ + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + // this effect is a C++ +// opaque behavior with several lines + + + + + + + + + C/C++ + // Aber hier geht's, oder? + + + + C/C++ + // this effect is a C++ np +// opaque behavior with several lines + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + // Now let's add some code +cout << "value: " << arg; + + + + + + C/C++ + // Now let's add some code +args[0] = 2; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/.classpath b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/.project b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/.project new file mode 100644 index 00000000000..d1004a0c6d3 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.texteditor.cdt + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..2317f744580 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/META-INF/MANIFEST.MF @@ -0,0 +1,35 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.ui.editors;bundle-version="3.7.0", + org.eclipse.emf.ecore;bundle-version="2.7.0", + org.eclipse.uml2.uml;bundle-version="3.2.0", + org.eclipse.jface.text;bundle-version="3.7.0", + org.eclipse.gmf.runtime.emf.type.core, + org.eclipse.cdt.core;bundle-version="5.4.0", + org.eclipse.cdt.ui;bundle-version="5.4.0", + org.eclipse.cdt.codan.ui.cxx;bundle-version="3.2.0", + org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core;bundle-version="1.2.0", + org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", + org.eclipse.papyrus.uml.tools;bundle-version="1.2.0", + org.eclipse.papyrus.texteditor.model;bundle-version="1.2.0", + org.eclipse.ui.ide;bundle-version="3.9.0", + org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", + org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0", + org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0", + org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.2.0", + org.eclipse.papyrus.cpp.codegen;bundle-version="1.2.0", + org.eclipse.papyrus.qompass.ui;bundle-version="1.2.0" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.texteditor.cdt.Activator +Bundle-ManifestVersion: 2 +Bundle-Description: %pluginDescription +Bundle-SymbolicName: org.eclipse.papyrus.texteditor.cdt;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/about.html b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/build.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/build.properties new file mode 100644 index 00000000000..dca8cd871c9 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/build.properties @@ -0,0 +1,10 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + about.html,\ + build.properties,\ + icons/,\ + plugin.properties +src.includes = about.html diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.gif b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.gif new file mode 100644 index 00000000000..0d1a28947ba Binary files /dev/null and b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.gif differ diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.xcf b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.xcf new file mode 100644 index 00000000000..1749c428883 Binary files /dev/null and b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/icons/texteditor.xcf differ diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/plugin.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/plugin.properties new file mode 100644 index 00000000000..7e334617814 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/plugin.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus CDT editor integration (Incubation) +providerName=Eclipse Modeling Project + +pluginDescription=This plugin provides a editor for uml.Comment. The informations are stored in the .notation \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/plugin.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/plugin.xml new file mode 100644 index 00000000000..56bc6713d41 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/plugin.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/pom.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/pom.xml new file mode 100644 index 00000000000..6809579191e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.texteditor.cdt + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Activator.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Activator.java new file mode 100644 index 00000000000..f69ef78e6f2 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Activator.java @@ -0,0 +1,71 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.texteditor.cdt; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.texteditor.cdt"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + public static LogHelper log; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + log = new LogHelper(this); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/AddProfileAndModelLibsHandler.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/AddProfileAndModelLibsHandler.java new file mode 100644 index 00000000000..fa0e02c1594 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/AddProfileAndModelLibsHandler.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2015 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation + * + *******************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.emf.common.command.CommandStack; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageImport; +import org.eclipse.uml2.uml.Profile; +import org.eclipse.uml2.uml.UMLFactory; +import org.eclipse.uml2.uml.resource.UMLResource; + +/** + * This class adds the C++ profile as well as the ANSI-C library to your model. + * + * TODO: currently not used. + */ +public class AddProfileAndModelLibsHandler { + + static final String CPP_PROFILE_URI = "pathmap://CPP_PROFILES/C_Cpp.profile.uml"; //$NON-NLS-1$ + + static final String ANSIC_LIBRARY_URI = "pathmap://CPP_LIBRARIES/Ansi_C.library.uml"; //$NON-NLS-1$ + + /** + * Retrieve a model library from the repository + * + * @param uri + * the URI of the repository + * + * @return + */ + public PackageImport getModelLibraryImportFromURI(URI uri, EditingDomain domain) { + // Try to reach model + Element root = getContent(uri, domain); + if (root instanceof Package) { + + // Import model library + Package libToImport = (Package) root; + // create import package + PackageImport modelLibImport = UMLFactory.eINSTANCE.createPackageImport(); + modelLibImport.setImportedPackage(libToImport); + + return modelLibImport; + } + return null; + } + + public static Element getContent(URI uri, EditingDomain domain) { + // Resource resource = getTransactionalEditingDomain ().getResourceSet().getResource (uri, true); + Resource resource = domain.getResourceSet().getResource(uri, true); + return getContent(resource); + } + + public static Element getContent(Resource resource) { + EList contentObj = resource.getContents(); + if ((contentObj.size() > 0) && (contentObj.get(0) instanceof Element)) { + return (Element) contentObj.get(0); + } + return null; + } + + /** + * Check whether a package import is already done + * + * @param selectedPkg + * @param pi + * @return + */ + boolean isAlreadyImported(Package selectedPkg, PackageImport pi) { + for (PackageImport existingPI : selectedPkg.getPackageImports()) { + if ((existingPI.getImportedPackage() == null) || + (pi.getImportedPackage() == null)) { + // import package are null (should not happen?!) + continue; + } + if ((existingPI.getImportedPackage().getName() == null) || + (pi.getImportedPackage().getName() == null)) { + // import package name not set (should not happen?!) + continue; + } else if (existingPI.getImportedPackage().getName().equals(pi.getImportedPackage().getName())) { + return true; + } + } + return false; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) + */ + /** + * {@inheritDoc} + */ + public void addProfileAndImport(final Package selectedPkg) throws ExecutionException { + + final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(selectedPkg); + CommandStack stack = domain.getCommandStack(); + stack.execute(new RecordingCommand(domain, "Add C++ profile & ANSI-C library") { //$NON-NLS-1$ + @Override + public void doExecute() { + // add primitive types + // create import package to primitiveType + PackageImport pi = getModelLibraryImportFromURI(URI.createURI(UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI), domain); + selectedPkg.getPackageImports().add(pi); + addCppProfile(selectedPkg, domain); + }; + }); + } + + public static void addCppProfile(Package selectedPkg, TransactionalEditingDomain domain) { + + // Retrieve C++ profile + Profile cppProfile = + (Profile) getContent(URI.createURI(CPP_PROFILE_URI), domain); + + // Apply C++ profile to model + if (cppProfile instanceof Profile) { + Profile profile = selectedPkg.getAppliedProfile(cppProfile.getQualifiedName()); + if ((profile == null) && (!cppProfile.getOwnedStereotypes().isEmpty())) { + selectedPkg.applyProfile(cppProfile); + } + } + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/CommandSupport.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/CommandSupport.java new file mode 100644 index 00000000000..a3e32434420 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/CommandSupport.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 2015 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation + * + *******************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt; + +import java.util.Collections; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.operations.IOperationHistory; +import org.eclipse.core.commands.operations.OperationHistoryFactory; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers; + +/** + * Utility function. Allow execution of commands on a transactional command stack + */ +public class CommandSupport { + + /** + * Execute the passed Runnable within a command + * + * @param label + * @param command + */ + public static void exec(String label, final Runnable command) { + ServiceUtilsForActionHandlers serviceUtils = ServiceUtilsForActionHandlers.getInstance(); + try { + exec(serviceUtils.getTransactionalEditingDomain(), label, command); + } catch (ServiceException e) { + // Log.log(Log.ERROR_MSG, Log.UTILS, "Can not get editing domain"); + } + } + + /** + * Execute the passed Runnable within a command + * + * @param label + * @param command + */ + public static void exec(TransactionalEditingDomain domain, String label, final Runnable command) { + if (domain == null) { + command.run(); + } + else { + IOperationHistory history = OperationHistoryFactory.getOperationHistory(); + try { + history.execute(new AbstractTransactionalCommand(domain, label, Collections.EMPTY_LIST) { + + @Override + public CommandResult doExecuteWithResult(IProgressMonitor dummy, IAdaptable info) { + command.run(); + return CommandResult.newOKCommandResult(); + } + }, null, null); + } catch (ExecutionException e) { + e.printStackTrace(); + } + } + } + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/TextEditorConstants.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/TextEditorConstants.java new file mode 100644 index 00000000000..2436b7373b5 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/TextEditorConstants.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright (c) 2013 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation + * + *******************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt; + +import java.util.regex.Pattern; + +public class TextEditorConstants { + + /** + * Regular expression for accepted language for compatible CDT code generators + */ + public static final Pattern CPP = Pattern.compile("C\\+\\+|c\\+\\+|CPP|cpp|C|c"); //$NON-NLS-1$ +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Utils.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Utils.java new file mode 100644 index 00000000000..2beb89ab936 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/Utils.java @@ -0,0 +1,187 @@ +/******************************************************************************* + * Copyright (c) 2015 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation + * + *******************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt; + +import org.eclipse.papyrus.codegen.extensionpoints.GenerationConstants; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; + +/** + * Collection of utility operations that are used by the CDT editor. + */ +public class Utils { + + public static final String nsSep = "::"; //$NON-NLS-1$ + + /** + * Decrease the indentation of a text block. This function is used during synchronization, since + * the code within an opaque behavior is not indented, whereas the code of an operation within a + * file is indented with a tab. + */ + public static String decreaseIndent(char[] contents, int start, int end) { + String newBlock = ""; //$NON-NLS-1$ + boolean newLine = true; + int consume = 0; + for (int i = start; i < end; i++) { + char c = contents[i]; + + // consume either a tab or 4 spaces; + if (newLine && (c == '\t')) { + consume = 1; + } + if (newLine && (c == ' ')) { + consume = 4; + } + + if (consume == 0) { + newBlock += c; + } + else if (c == ' ') { + consume--; + } + else { + consume = 0; + } + if ((c == '\n') || (c == '\r')) { + newLine = true; + } + else { + newLine = false; + } + } + return newBlock; + } + + /** + * Get an element via its qualified name. Will find elements from the root + * model and elements in imported models. Also supports target model in + * which imports have been copied (while keeping the top-level name) + * + * @param root + * @param qualifiedName + * @return + */ + public static NamedElement getQualifiedElement(Package root, + String qualifiedName) { + NamedElement namedElement = null; + int index = qualifiedName.indexOf(nsSep); + if (index != -1) { + // first try using a path without top element (since + // getQualifiedElement is typically used for + // imported elements) + String remainder = qualifiedName.substring(index + 2); + namedElement = getQualifiedElement(root, remainder, qualifiedName); + } + if (namedElement == null) { + // try with complete name as path name, but assume that the element + // has been copied into the model, + // i.e. qualifiedName is prefixed by model name + namedElement = getQualifiedElement(root, qualifiedName, + root.getName() + nsSep + qualifiedName); + } + return namedElement; + } + + /** + * Retrieve an element via its qualified name within a package The segments + * of the package may be non unique due to imports + * + * @return the found element, if it exists + */ + public static NamedElement getQualifiedElement(Package root, + String remainingPath, String qualifiedName) { + if (root == null) { + return null; + } + if (!remainingPath.contains(nsSep)) { + for (NamedElement candidate : root.getMembers()) { + String name = candidate.getName(); + if ((name != null) && name.equals(remainingPath)) { + if (candidate.getQualifiedName().equals(qualifiedName)) { + return candidate; + } + } + } + } else { + String segment = remainingPath.split(nsSep)[0]; + String remainder = remainingPath.substring(segment.length() + 2); + for (Element element : root.getMembers()) { + if (element instanceof Package) { + if (((NamedElement) element).getName().equals(segment)) { + NamedElement foundElement = getQualifiedElement( + (Package) element, remainder, qualifiedName); + // return, if not found + if (foundElement != null) { + return foundElement; + } + } + } + } + } + return null; + } + + /** + * return the top-level owner of an element. This function returns the same + * value as getModel, if the top-level element is a model. While this is the + * case for models, model libraries have a top-level package (not a model). + * In this case, getTop returns the top-level package whereas getModel would + * return null. + * + * @param element + * @return the top-level owning package + */ + public static Package getTop(Element element) { + while (element != null) { + Element owner = element.getOwner(); + if (owner == null) { + if (element instanceof Package) { + return (Package) element; + } + } + element = owner; + } + return null; + } + + /** + * Remove generated code from a body (everything between the GENERATED_START flag + * + * @param bodyStr + * @return + */ + public static String removeGenerated(String bodyStr) { + for (;;) { + int startPos = bodyStr.indexOf(GenerationConstants.GENERATED_START); + if (startPos == -1) { + break; + } + // search line break of previous line (if any) + while ((startPos > 0) && bodyStr.charAt(startPos) != '\r' && bodyStr.charAt(startPos) != '\n') { + startPos--; + } + int endPos = bodyStr.indexOf(GenerationConstants.GENERATED_END, startPos); + if (endPos == -1) { + break; + } + endPos += GenerationConstants.GENERATED_END.length(); + // stop at first non white-space character after comment. + while ((endPos < bodyStr.length()) && Character.isWhitespace(bodyStr.charAt(endPos))) { + endPos++; + } + bodyStr = bodyStr.substring(0, startPos) + bodyStr.substring(endPos); + } + return bodyStr; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/DelegatingSourceViewer.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/DelegatingSourceViewer.java new file mode 100644 index 00000000000..f5d61481370 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/DelegatingSourceViewer.java @@ -0,0 +1,400 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt.editor; + +import java.util.Iterator; +import java.util.List; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.jface.text.IAutoIndentStrategy; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.IEventConsumer; +import org.eclipse.jface.text.IFindReplaceTarget; +import org.eclipse.jface.text.IRegion; +import org.eclipse.jface.text.ITextDoubleClickStrategy; +import org.eclipse.jface.text.ITextHover; +import org.eclipse.jface.text.ITextInputListener; +import org.eclipse.jface.text.ITextListener; +import org.eclipse.jface.text.ITextOperationTarget; +import org.eclipse.jface.text.IUndoManager; +import org.eclipse.jface.text.IViewportListener; +import org.eclipse.jface.text.TextPresentation; +import org.eclipse.jface.text.source.Annotation; +import org.eclipse.jface.text.source.IAnnotationHover; +import org.eclipse.jface.text.source.IAnnotationModel; +import org.eclipse.jface.text.source.ISourceViewer; +import org.eclipse.jface.text.source.SourceViewerConfiguration; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Point; +import org.eclipse.uml2.uml.Classifier; + +/** + * Unsuccessful attempt to create a delegating source viewer that changes the implementation of + * the operation getSelectionProvider of a source viewer. This does not work in case of CDT since the + * source viewer is cast to CSourceViewer later. + * + * CURRENTLY NOT USED + */ +@Deprecated +public class DelegatingSourceViewer implements ISourceViewer { + + public DelegatingSourceViewer(ISourceViewer delegationTarget, Classifier classifier) { + // super(null, null, null, false, 0, null); + this.dt = delegationTarget; + this.cl = classifier; + + sp = new ISelectionProvider() { + + @Override + public void setSelection(ISelection selection) { + } + + @Override + public void removeSelectionChangedListener( + ISelectionChangedListener listener) { + System.err.println("removeSelectionChangedListener"); + } + + @Override + public ISelection getSelection() { + return new IStructuredSelection() { + + @Override + public boolean isEmpty() { + return false; + } + + @Override + public List toList() { + List l = new BasicEList(); + l.add(cl); + return l; + } + + @Override + public Object[] toArray() { + return new Object[] { cl }; + } + + @Override + public int size() { + // TODO Auto-generated method stub + return 1; + } + + @Override + public Iterator iterator() { + return null; + } + + @Override + public Object getFirstElement() { + return cl; + } + }; + } + + @Override + public void addSelectionChangedListener(ISelectionChangedListener listener) { + // TODO Auto-generated method stub + System.err.println("add SelectionChangedListener"); + + } + }; + } + + ISourceViewer dt; + + Classifier cl; + + ISelectionProvider sp; + + @Override + public StyledText getTextWidget() { + return dt.getTextWidget(); + } + + @Override + public void setUndoManager(IUndoManager undoManager) { + dt.setUndoManager(undoManager); + } + + @Override + public void setTextDoubleClickStrategy( + ITextDoubleClickStrategy strategy, String contentType) { + dt.setTextDoubleClickStrategy(strategy, contentType); + } + + @Override + public void setAutoIndentStrategy(IAutoIndentStrategy strategy, + String contentType) { + dt.setAutoIndentStrategy(strategy, contentType); + } + + @Override + public void setTextHover(ITextHover textViewerHover, + String contentType) { + dt.setTextHover(textViewerHover, contentType); + } + + @Override + public void activatePlugins() { + dt.activatePlugins(); + } + + @Override + public void resetPlugins() { + dt.resetPlugins(); + } + + @Override + public void addViewportListener(IViewportListener listener) { + dt.addViewportListener(listener); + } + + @Override + public void removeViewportListener(IViewportListener listener) { + dt.removeViewportListener(listener); + } + + @Override + public void addTextListener(ITextListener listener) { + dt.addTextListener(listener); + } + + @Override + public void removeTextListener(ITextListener listener) { + dt.removeTextListener(listener); + } + + @Override + public void addTextInputListener(ITextInputListener listener) { + dt.addTextInputListener(listener); + } + + @Override + public void removeTextInputListener(ITextInputListener listener) { + dt.removeTextInputListener(listener); + } + + @Override + public void setDocument(IDocument document) { + dt.setDocument(document); + } + + @Override + public IDocument getDocument() { + return dt.getDocument(); + } + + @Override + public void setEventConsumer(IEventConsumer consumer) { + dt.setEventConsumer(consumer); + + } + + @Override + public void setEditable(boolean editable) { + dt.setEditable(editable); + } + + @Override + public boolean isEditable() { + return dt.isEditable(); + } + + @Override + public void setDocument(IDocument document, int modelRangeOffset, + int modelRangeLength) { + dt.setDocument(document, modelRangeOffset, modelRangeLength); + } + + @Override + public void setVisibleRegion(int offset, int length) { + dt.setVisibleRegion(offset, length); + } + + @Override + public void resetVisibleRegion() { + dt.resetVisibleRegion(); + } + + @Override + public IRegion getVisibleRegion() { + return dt.getVisibleRegion(); + } + + @Override + public boolean overlapsWithVisibleRegion(int offset, int length) { + return dt.overlapsWithVisibleRegion(offset, length); + } + + @Override + public void changeTextPresentation(TextPresentation presentation, + boolean controlRedraw) { + dt.changeTextPresentation(presentation, controlRedraw); + } + + @Override + public void invalidateTextPresentation() { + dt.invalidateTextPresentation(); + + } + + @Override + public void setTextColor(Color color) { + dt.setTextColor(color); + } + + @Override + public void setTextColor(Color color, int offset, int length, + boolean controlRedraw) { + dt.setTextColor(color, offset, length, controlRedraw); + } + + @Override + public ITextOperationTarget getTextOperationTarget() { + return dt.getTextOperationTarget(); + } + + @Override + public IFindReplaceTarget getFindReplaceTarget() { + return dt.getFindReplaceTarget(); + } + + @Override + public void setDefaultPrefixes(String[] defaultPrefixes, + String contentType) { + dt.setDefaultPrefixes(defaultPrefixes, contentType); + + } + + @Override + public void setIndentPrefixes(String[] indentPrefixes, + String contentType) { + dt.setIndentPrefixes(indentPrefixes, contentType); + } + + @Override + public void setSelectedRange(int offset, int length) { + dt.setSelectedRange(offset, length); + } + + @Override + public Point getSelectedRange() { + return dt.getSelectedRange(); + } + + @Override + public ISelectionProvider getSelectionProvider() { + return dt.getSelectionProvider(); + } + + @Override + public void revealRange(int offset, int length) { + dt.revealRange(offset, length); + } + + @Override + public void setTopIndex(int index) { + dt.setTopIndex(index); + } + + @Override + public int getTopIndex() { + return dt.getTopIndex(); + } + + @Override + public int getTopIndexStartOffset() { + return dt.getTopIndexStartOffset(); + } + + @Override + public int getBottomIndex() { + return dt.getBottomIndex(); + } + + @Override + public int getBottomIndexEndOffset() { + return dt.getBottomIndexEndOffset(); + } + + @Override + public int getTopInset() { + return dt.getTopInset(); + } + + @Override + public void configure(SourceViewerConfiguration configuration) { + dt.configure(configuration); + } + + @Override + public void setAnnotationHover(IAnnotationHover annotationHover) { + dt.setAnnotationHover(annotationHover); + } + + @Override + public void setDocument(IDocument document, + IAnnotationModel annotationModel) { + dt.setDocument(document, annotationModel); + } + + @Override + public void setDocument(IDocument document, + IAnnotationModel annotationModel, int modelRangeOffset, + int modelRangeLength) { + dt.setDocument(document, annotationModel, modelRangeOffset, modelRangeLength); + + } + + @Override + public IAnnotationModel getAnnotationModel() { + return dt.getAnnotationModel(); + } + + @Override + public void setRangeIndicator(Annotation rangeIndicator) { + dt.setRangeIndicator(rangeIndicator); + + } + + @Override + public void setRangeIndication(int offset, int length, + boolean moveCursor) { + dt.setRangeIndication(offset, length, moveCursor); + } + + @Override + public IRegion getRangeIndication() { + return dt.getRangeIndication(); + } + + @Override + public void removeRangeIndication() { + dt.removeRangeIndication(); + } + + @Override + public void showAnnotations(boolean show) { + dt.showAnnotations(show); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/PapyrusCDTEditor.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/PapyrusCDTEditor.java new file mode 100644 index 00000000000..4ae37530cac --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/editor/PapyrusCDTEditor.java @@ -0,0 +1,395 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.texteditor.cdt.editor; + +import org.eclipse.cdt.codan.internal.ui.cxx.CodanCReconciler; +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.core.model.ISourceRange; +import org.eclipse.cdt.core.model.ISourceReference; +import org.eclipse.cdt.core.model.ITranslationUnit; +import org.eclipse.cdt.internal.ui.editor.CEditor; +import org.eclipse.cdt.ui.CDTUITools; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EValidator; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.text.ITextSelection; +import org.eclipse.jface.text.source.ISourceViewer; +import org.eclipse.jface.text.source.IVerticalRuler; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.papyrus.infra.core.lifecycleevents.DoSaveEvent; +import org.eclipse.papyrus.infra.core.lifecycleevents.ILifeCycleEventsProvider; +import org.eclipse.papyrus.infra.core.lifecycleevents.ISaveAndDirtyService; +import org.eclipse.papyrus.infra.core.lifecycleevents.ISaveEventListener; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.texteditor.cdt.Activator; +import org.eclipse.papyrus.texteditor.cdt.sync.ObtainICElement; +import org.eclipse.papyrus.texteditor.cdt.sync.RevealCurrentOperation; +import org.eclipse.papyrus.texteditor.cdt.sync.SyncCDTtoModel; +import org.eclipse.papyrus.texteditor.cdt.sync.SyncModelToCDT; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.FocusListener; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.ide.IGotoMarker; +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.texteditor.ITextEditorActionConstants; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; + +/** + * A specialization of the CDT editor made for integration into Papyrus + * + */ +public class PapyrusCDTEditor extends CEditor { + + /** the service registry */ + protected final ServicesRegistry registry; + + /** the papyrus text instance */ + protected final TextEditorModel papyrusTextInstance; + + /** the text listener */ + protected FocusListener focusListener; + + public static final String EDITOR_DEFAULT_NAME = "CDT Editor"; + + public static final String EDITOR_TYPE = "CDTEditorInPapyrus"; //$NON-NLS-1$ + + protected SyncCDTtoModel syncCpp; + + protected RevealCurrentOperation reveal; + + protected Adapter gotoListener; + + /** + * + * Constructor. + * + * @param registry + * @param papyrusTextInstance + */ + public PapyrusCDTEditor(final ServicesRegistry registry, final TextEditorModel papyrusTextInstance) { + super(); + gotoListener = null; + this.registry = registry; + this.papyrusTextInstance = papyrusTextInstance; + try { + saveAndDirtyService = registry.getService(ISaveAndDirtyService.class); + saveAndDirtyService.registerIsaveablePart(this); + ILifeCycleEventsProvider lifeCycleEvents = registry.getService(ILifeCycleEventsProvider.class); + ISaveEventListener preSaveEvent = new ISaveEventListener() { + + @Override + public void doSaveAs(DoSaveEvent event) { + // TODO Auto-generated method stub + } + + @Override + public void doSave(DoSaveEvent event) { + syncCpp.syncCDTtoModel(); + } + }; + lifeCycleEvents.addAboutToDoSaveListener(preSaveEvent); + } catch (ServiceException e) { + Activator.log.error(e); + } + } + + /** + * override method in order to save & restore action bars entries + */ + @Override + public void createPartControl(Composite parent) { + // save Papyrus (GMF) handlers + IActionBars actionBars = getEditorSite().getActionBars(); + if ((actionBars != null) && (gmfUndo == null)) { + gmfUndo = actionBars.getGlobalActionHandler(ITextEditorActionConstants.UNDO); + gmfRedo = actionBars.getGlobalActionHandler(ITextEditorActionConstants.REDO); + } + + super.createPartControl(parent); + + if (actionBars != null) { + // save CDT (textEditor) handlers + textUndo = actionBars.getGlobalActionHandler(ITextEditorActionConstants.UNDO); + textRedo = actionBars.getGlobalActionHandler(ITextEditorActionConstants.REDO); + // & restore Papyrus bar + actionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, gmfUndo); + actionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, gmfRedo); + actionBars.updateActionBars(); + } + + gotoListener = new Adapter() { + + // assure that gotoElement is called, if the element in the model gets updated + @Override + public void notifyChanged(Notification notification) { + if (notification.getEventType() == Notification.SET) { + Object newValue = notification.getNewValue(); + if (newValue instanceof NamedElement) { + gotoElement((NamedElement) newValue); + } + + } + } + + @Override + public Notifier getTarget() { + return null; + } + + @Override + public void setTarget(Notifier newTarget) { + } + + @Override + public boolean isAdapterForType(Object type) { + return false; + } + }; + papyrusTextInstance.eAdapters().add(gotoListener); + + if (papyrusTextInstance.getSelectedObject() instanceof NamedElement) { + gotoElement((NamedElement) papyrusTextInstance.getSelectedObject()); + } + } + + /** + * + * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite, org.eclipse.jface.text.source.IVerticalRuler, int) + * + * @param parent + * @param ruler + * @param styles + * @return + */ + @Override + public ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { + + final ISourceViewer viewer = super.createSourceViewer(parent, ruler, styles); + // ISourceViewer viewer = new DelegatingSourceViewer(origViewer, (Classifier)papyrusTextInstance.getEditedObject()); + focusListener = new FocusListener() { + + @Override + public void focusLost(FocusEvent e) { + // potential problem for undo/redo!! + if (isDirty()) { + doSave(new NullProgressMonitor()); + syncCpp.syncCDTtoModel(); + Classifier classifier = (Classifier) papyrusTextInstance.getEditedObject(); + // regenerate code. TODO: raises update dialog + // SyncModelToCDT.syncModelToCDT(classifier); + } + // restore handlers + IActionBars actionBars = getEditorSite().getActionBars(); + if (actionBars != null) { + if ((gmfUndo != null) && (gmfRedo != null)) { + actionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, gmfUndo); + actionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, gmfRedo); + actionBars.updateActionBars(); + } + } + } + + @Override + public void focusGained(FocusEvent e) { + // restore handlers + IActionBars actionBars = getEditorSite().getActionBars(); + if (actionBars != null) { + if ((textUndo != null) && (textRedo != null)) { + actionBars.setGlobalActionHandler(ITextEditorActionConstants.UNDO, textUndo); + actionBars.setGlobalActionHandler(ITextEditorActionConstants.REDO, textRedo); + actionBars.updateActionBars(); + } + } + } + }; + // register focus listener + viewer.getTextWidget().addFocusListener(focusListener); + SelectionListener selectionListener = new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + IEditorPart ep = getEditorSite().getPage().getActiveEditor(); + ISelection selection = getSelectionProvider().getSelection(); + if ((ep instanceof IGotoMarker) && (selection instanceof ITextSelection)) { + if (((ITextSelection) selection).getLength() > 0) { + // don't try to navigate during selection of a chunk of text. + return; + } + IMarker marker; + /* + * create a temporary validation marker on the + * srcFile file, call the gotoMarker operation of the editor + * and remove the marker afterwards. + * TODO: operation activates the model-explorer + */ + try { + Element element = reveal.obtainSelectedElement((ITextSelection) selection); + String modelURI = EcoreUtil.getURI(element).toString(); + marker = srcFile.createMarker(EValidator.MARKER); + marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO); // set severity before URI to avoid marker update without associated icon + marker.setAttribute(EValidator.URI_ATTRIBUTE, modelURI); + IWorkbenchPage wbpage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + IWorkbenchPart activePart = wbpage.getActivePart(); + ((IGotoMarker) ep).gotoMarker(marker); + // reactivate this editor + wbpage.activate(activePart); + marker.delete(); + } catch (CoreException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }; + + // TODO: don't add selection listener for the moment. It can cause deadlocks (setting a marker attribute while file is locked, reproducible with cut (^X) on selection) + // viewer.getTextWidget().addSelectionListener(selectionListener); + + return viewer; + } + + /** + * Goto a specific element within the text editor. Currently, only methods are supported. + * + * @param element + * @throws CoreException + */ + public void gotoElement(NamedElement element) { + ICElement ice = CDTUITools.getEditorInputCElement(m_input); + + if (ice instanceof ITranslationUnit) { + ITranslationUnit itu = (ITranslationUnit) ice; + ICElement icElement = ObtainICElement.getICElement(syncCpp.getCodeGen(), itu, element); + if (icElement instanceof ISourceReference) { + try { + ISourceRange range = ((ISourceReference) icElement).getSourceRange(); + + ISourceViewer viewer = getSourceViewer(); + viewer.revealRange(range.getStartPos(), 1); + viewer.setSelectedRange(range.getStartPos(), range.getLength()); + return; + } catch (CoreException e) { + Activator.log.error(e); + } + } + } + } + + @Override + public boolean isDirty() { + boolean isDirty = super.isDirty(); + if (isDirty != oldDirty) { + oldDirty = isDirty; + // hack. Normally, the saveAndDirtyService detects this itself (should find a solution how it can do that) + // ((SaveAndDirtyService) saveAndDirtyService).fireIsDirtyChanged(); + } + return isDirty; + } + + /** + * We override this method because setInput can't be overriden for TextEditor. + * We replace the default Papyrus input with the CPP file + * + * @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput) + * + * @param input + * @throws CoreException + */ + @Override + protected void doSetInput(IEditorInput input) throws CoreException { + + URI uri = papyrusTextInstance.eResource().getURI(); + Classifier classifier = (Classifier) papyrusTextInstance.getEditedObject(); + String generatorID = papyrusTextInstance.getGeneratorID(); + srcFile = SyncModelToCDT.syncModelToCDT(classifier, generatorID); + if (srcFile == null || !srcFile.exists()) { + throw new PartInitException("Code generation before editing failed. Please check error log"); + } + IEditorInput newInput = new FileEditorInput(srcFile); + + // IStorage storage = new TextStorage(string); + super.doSetInput(newInput); + + syncCpp = new SyncCDTtoModel(newInput, classifier, uri.segment(1), generatorID); + m_input = newInput; + reveal = new RevealCurrentOperation(newInput, classifier, uri.segment(1)); + + // add the reconciler to get syntax check and completion. (still no full checks) + addReconcileListener(new CodanCReconciler()); + } + + /** + * + * @see org.eclipse.ui.editors.text.TextEditor#dispose() + * + */ + @Override + public void dispose() { + + saveAndDirtyService.removeIsaveablePart(this); + if (gotoListener != null) { + papyrusTextInstance.eAdapters().remove(gotoListener); + } + + // we remove the listener + StyledText st = getSourceViewer().getTextWidget(); + st.removeFocusListener(focusListener); + super.dispose(); + // assure that embedded text widget is disposed now. Otherwise, it will be closed + // later, when the editorSite is already set to null by Papyrus (mainEditorSite attribute in MultiPageEditorSite4x) + // resulting in a null pointer exception and resulting inconsistencies in the Papyrus editor. + st.dispose(); + } + + protected IAction gmfUndo, gmfRedo; + + protected IAction textUndo, textRedo; + + protected boolean oldDirty; + + protected ISaveAndDirtyService saveAndDirtyService; + + protected IFile srcFile; + + protected ISelectionProvider sp; + + protected IEditorInput m_input; +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/factory/PapyrusCDTEditorFactory.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/factory/PapyrusCDTEditorFactory.java new file mode 100644 index 00000000000..f4f552858e7 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/factory/PapyrusCDTEditorFactory.java @@ -0,0 +1,210 @@ +/***************************************************************************** + * Copyright (c) 2013, 2014 CEA LIST and others. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * Ansgar Radermacher (CEA LIST) - Minor adaptations + * Christian W. Damus (CEA) - bug 392301 + * + *****************************************************************************/ +package org.eclipse.papyrus.texteditor.cdt.factory; + +import org.eclipse.papyrus.infra.core.editor.BackboneException; +import org.eclipse.papyrus.infra.core.extension.diagrameditor.AbstractEditorFactory; +import org.eclipse.papyrus.infra.core.multidiagram.actionbarcontributor.ActionBarContributorRegistry; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.texteditor.cdt.Activator; +import org.eclipse.papyrus.texteditor.cdt.editor.PapyrusCDTEditor; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.part.EditorActionBarContributor; + + +public class PapyrusCDTEditorFactory extends AbstractEditorFactory { + + /** + * Constructor. + */ + public PapyrusCDTEditorFactory() { + super(PapyrusCDTEditor.class, PapyrusCDTEditor.EDITOR_TYPE); + } + + /** + * Create the IPageModel that is used by the SashWindows to manage the editor. + * + * @see org.eclipse.papyrus.infra.core.editorsfactory.IEditorFactory#createIPageModel(java.lang.Object) + * + * @param pageIdentifier + * The model pushed in the sashmodel by the creation command + * @return A model implementing the IPageModel + */ + @Override + public IPageModel createIPageModel(Object pageIdentifier) { + return new TextEditorModelDelegate(pageIdentifier); + } + + /** + * @see org.eclipse.papyrus.infra.core.editorsfactory.IEditorFactory#isPageModelFactoryFor(java.lang.Object) + * + * @param pageIdentifier + * @return + */ + @Override + public boolean isPageModelFactoryFor(Object pageIdentifier) { + if (pageIdentifier instanceof TextEditorModel) { + return ((TextEditorModel) pageIdentifier).getType().equals(this.getExpectedType()); + } + return false; + } + + /** + * IEditorModel used internally by the SashContainer. This model know how to handle IEditor creation. + * + */ + class TextEditorModelDelegate implements IEditorModel { + + /** + * The created editor. + */ + private IEditorPart editor; + + /** + * The raw model stored in the SashProvider. + */ + private TextEditorModel rawEditorModel; + + /** + * + * Constructor. + */ + public TextEditorModelDelegate(Object pageIdentifier) { + rawEditorModel = (TextEditorModel) pageIdentifier; + } + + /** + * Create the IEditor for the diagram. + * + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel#createIEditorPart() + * @return + * @throws PartInitException + * + */ + @Override + public IEditorPart createIEditorPart() throws PartInitException { + try { + // we use this way when there is one factory for several editor types + // Constructor c = getDiagramClass().getConstructor(ServicesRegistry.class, TextEditorModel.class); + // editor = (IEditorPart)c.newInstance(servicesRegistry, rawModel); + + // we use this way when there is only one editor type + editor = new PapyrusCDTEditor(getServiceRegistry(), rawEditorModel); + return editor; + + } catch (Exception e) { + // Lets propagate. This is an implementation problem that should be solved by + // programmer. + throw new PartInitException("Can't create TextEditor", e); + } + + } + + /** + * Get the action bar requested by the Editor. + * + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IEditorModel#getActionBarContributor() + * @return + * + */ + @Override + public EditorActionBarContributor getActionBarContributor() { + + String actionBarId = editorDescriptor.getActionBarContributorId(); + + // Do nothing if no EditorActionBarContributor is specify. + if (actionBarId == null || actionBarId.length() == 0) { + return null; + } + + // Try to get it. + + // Get ServiceRegistry + // ServicesRegistry serviceRegistry = getServicesRegistry(); + ActionBarContributorRegistry registry; + try { + registry = getServiceRegistry().getService(ActionBarContributorRegistry.class); + } catch (ServiceException e) { + // Service not found + Activator.log.error(e); + return null; + } + + try { + return registry.getActionBarContributor(actionBarId); + } catch (BackboneException e) { + Activator.log.error(e); + return null; + } + } + + /** + * Get the underlying RawModel. Return the TextEditor (normally returns a diagram) + * + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getRawModel() + * @return + * + */ + @Override + public Object getRawModel() { + return rawEditorModel; + } + + /** + * Get the icon to be shown by Tabs + * + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getTabIcon() + * @return + * + */ + @Override + public Image getTabIcon() { + org.eclipse.papyrus.infra.widgets.Activator widgetsActivator = + org.eclipse.papyrus.infra.widgets.Activator.getDefault(); + if (widgetsActivator == null) { + return null; + } + String path = getEditorDescriptor().getIconURL(); + if (path.startsWith(Activator.PLUGIN_ID)) { + // remove PLUGIN-ID prefix from the path (since the image will be searched relative to plugin) + path = path.substring(Activator.PLUGIN_ID.length()); + } + return widgetsActivator.getImage(Activator.PLUGIN_ID, path); + } + + /** + * Get the title of the Diagram. + * + * @see org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageModel#getTabTitle() + * @return + * + */ + @Override + public String getTabTitle() { + return rawEditorModel.getName(); + } + + @Override + public void dispose() { + // Pass. The tab icon is a plugin-shared image + } + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/handler/PapyrusCDTEditorHandler.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/handler/PapyrusCDTEditorHandler.java new file mode 100644 index 00000000000..7d6df1edfc4 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/handler/PapyrusCDTEditorHandler.java @@ -0,0 +1,308 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr + * + *****************************************************************************/ +package org.eclipse.papyrus.texteditor.cdt.handler; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Status; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.workspace.AbstractEMFOperation; +import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; +import org.eclipse.papyrus.codegen.extensionpoints.LanguageCodegen; +import org.eclipse.papyrus.commands.CheckedOperationHistory; +import org.eclipse.papyrus.infra.core.resource.NotFoundException; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager; +import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.ISashWindowsContentProvider; +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.DiSashModelManager; +import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer; +import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef; +import org.eclipse.papyrus.infra.core.sashwindows.di.SashPanel; +import org.eclipse.papyrus.infra.core.sashwindows.di.TabFolder; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.core.utils.ServiceUtils; +import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForHandlers; +import org.eclipse.papyrus.texteditor.cdt.Activator; +import org.eclipse.papyrus.texteditor.cdt.TextEditorConstants; +import org.eclipse.papyrus.texteditor.cdt.editor.PapyrusCDTEditor; +import org.eclipse.papyrus.texteditor.cdt.modelresource.TextEditorModelSharedResource; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelFactory; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Display; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Transition; +import org.eclipse.uml2.uml.UMLPackage; + + +/** + * The handler creates a new CDT editor + */ +public class PapyrusCDTEditorHandler extends CmdHandler { + + + public PapyrusCDTEditorHandler() { + } + + /** + * + * @see org.eclipse.infra.core.commands.AbstractHandler#isEnabled() + * + * @return + */ + @Override + public boolean isEnabled() { + updateSelectedEObject(); + // Filter Classes (including Behaviors, since Behavior inherits from Class), Operation and Transition + if (selectedEObject instanceof Class || + selectedEObject instanceof Operation || + selectedEObject instanceof Transition) + { + URI uri = selectedEObject.eResource().getURI(); + + // URIConverter uriConverter = resource.getResourceSet().getURIConverter(); + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + if (uri.segmentCount() < 2) { + return false; + } + IProject modelProject = root.getProject(uri.segment(1)); + return modelProject.exists(); + } + return false; + } + + /** + * @see org.eclipse.infra.core.commands.IHandler#execute(org.eclipse.infra.core.commands.ExecutionEvent) + * + * @param event + * @return + * @throws ExecutionException + */ + @Override + public Object execute(final ExecutionEvent event) throws ExecutionException { + try { + final ServicesRegistry serviceRegistry = ServiceUtilsForHandlers.getInstance().getServiceRegistry(event); + TransactionalEditingDomain domain = ServiceUtils.getInstance().getTransactionalEditingDomain(serviceRegistry); + + // Create the transactional command + AbstractEMFOperation command = new AbstractEMFOperation(domain, "Create CDT editor") { + + @Override + protected IStatus doExecute(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { + try { + PapyrusCDTEditorHandler.this.doExecute(serviceRegistry); + } catch (ServiceException e) { + Activator.log.error(e); + return Status.CANCEL_STATUS; + } catch (NotFoundException e) { + Activator.log.error(e); + return Status.CANCEL_STATUS; + } + return Status.OK_STATUS; + } + }; + + // Execute the command + CheckedOperationHistory.getInstance().execute(command, new NullProgressMonitor(), null); + } catch (ExecutionException e) { + Activator.log.error("Can't create a CDT editor", e); + } catch (ServiceException e) { + Activator.log.error("Service exception during creation of CDT editor", e); + } + return null; + } + + + /** + * Do the execution of the command. + * + * @param serviceRegistry + * @throws ServiceException + * @throws NotFoundException + */ + public void doExecute(final ServicesRegistry serviceRegistry) throws ServiceException, NotFoundException { + // Get the page manager allowing to add/open an editor. + final IPageManager pageMngr = ServiceUtils.getInstance().getIPageManager(serviceRegistry); + + Classifier classifierToEdit = getClassifierToEdit(); + TextEditorModel editorModel = getEditorModel(serviceRegistry, classifierToEdit); + if (editorModel == null) { + // no editor exist for the given file => create + editorModel = createEditorModel(serviceRegistry, classifierToEdit); + if (editorModel == null) { + return; + } + } + ILangCodegen codegen = LanguageCodegen.getGenerator(TextEditorConstants.CPP, editorModel.getGeneratorID()); + + if (codegen.getTargetProject(classifierToEdit, true) == null) { + return; + } + + if (selectedEObject instanceof Transition) { + Transition transition = (Transition) selectedEObject; + if (transition.getEffect() == null) { + Behavior effect = transition.createEffect("effectOf" + transition.getName(), UMLPackage.eINSTANCE.getOpaqueBehavior()); //$NON-NLS-1$ + } + } + // add the new editor model to the sash. + editorModel.setSelectedObject(selectedEObject); + + final TextEditorModel editorModelFinal = editorModel; + // open asynchronously to prevent handler cycles, see bug 434484 + Display.getDefault().asyncExec(new Runnable() { + + @Override + public void run() { + if (pageMngr.isOpen(editorModelFinal)) { + // select existing editor + pageMngr.selectPage(editorModelFinal); + } + else { + pageMngr.openPage(editorModelFinal); + } + try { + // move page to the RIGHT + DiSashModelManager modelMngr = ServiceUtils.getInstance().getService(DiSashModelManager.class, serviceRegistry); + ISashWindowsContentProvider sashContentProvider = modelMngr.getISashWindowsContentProvider(); + Object rootModel = sashContentProvider.getRootModel(); + + if (rootModel instanceof TabFolder) { + // root = tabFolder, i.e. there is a single folder + ISashWindowsContainer sashContainer = ServiceUtils.getInstance().getISashWindowsContainer(serviceRegistry); + int index = lookupIndex((TabFolder) rootModel, editorModelFinal); + if (index != -1) { + sashContentProvider.createFolder(sashContainer.getSelectedTabFolderModel(), index, sashContainer.getSelectedTabFolderModel(), SWT.RIGHT); + } + } + else if (rootModel instanceof SashPanel) { + // multiple tab-folders exist. Find existing one and move editorModel to other + // TODO + // ISashWindowsContainer sashContainer = ServiceUtils.getInstance().getISashWindowsContainer(serviceRegistry); + // sashContentProvider.movePage(sashContainer.getSelectedTabFolderModel(), lookupIndex(sourceTab, editorModel), targetTabModel, -1); + } + } catch (ServiceException e) { + + } + } + + }); + + } + + /** + * Create a model identifying the editor. This model will be saved with the sash + * + * @return + * @throws ServiceException + * @throws NotFoundException + * The model where to save the TableInstance is not found. + */ + protected TextEditorModel createEditorModel(final ServicesRegistry serviceRegistry, Classifier classifierToEdit) throws ServiceException, NotFoundException { + TextEditorModel editorModel = TextEditorModelFactory.eINSTANCE.createTextEditorModel(); + + editorModel.setEditedObject(classifierToEdit); + editorModel.setType(PapyrusCDTEditor.EDITOR_TYPE); + editorModel.setName("CDT " + classifierToEdit.getName()); //$NON-NLS-1$ + ILangCodegen codegen = LanguageCodegen.chooseGenerator(TextEditorConstants.CPP, classifierToEdit); + if (codegen == null) { + return null; + } + editorModel.setGeneratorID(LanguageCodegen.getID(codegen)); + TextEditorModelSharedResource model = (TextEditorModelSharedResource) + ServiceUtils.getInstance().getModelSet(serviceRegistry).getModelChecked(TextEditorModelSharedResource.MODEL_ID); + model.addTextEditorModel(editorModel); + + return editorModel; + } + + /** + * The classifier to edit - corresponding to the selected object. + * + * @return + */ + protected Classifier getClassifierToEdit() { + if (selectedEObject instanceof Operation) { + return ((Operation) selectedEObject).getFeaturingClassifiers().get(0); + } + else if (selectedEObject instanceof Transition) { + return ((Transition) selectedEObject).getContainer().getStateMachine().getContext(); + } + else if (selectedEObject instanceof Behavior) { + Element owner = (Behavior) selectedEObject; + while (owner != null) { + owner = owner.getOwner(); + if ((owner instanceof Classifier) && !(owner instanceof Behavior)) { + return (Classifier) owner; + } + } + return null; + } + else if (selectedEObject instanceof Classifier) { + // must be class or datatype + return (Classifier) selectedEObject; + } + return null; + } + + /** + * return the editor model corresponding to an EObject + * + * @param serviceRegistry + * the service registry + * @param classifierToEdit + * The classifier for which a CDT editor should be opened + * @return + * @throws ServiceException + * @throws NotFoundException + */ + protected TextEditorModel getEditorModel(final ServicesRegistry serviceRegistry, Classifier classifierToEdit) throws ServiceException, NotFoundException { + TextEditorModelSharedResource model = (TextEditorModelSharedResource) + ServiceUtils.getInstance().getModelSet(serviceRegistry).getModelChecked(TextEditorModelSharedResource.MODEL_ID); + return model.getTextEditorModel(classifierToEdit); + } + + /** + * Recursively search in sash models for a FolderModel. + * Return the first encountered folder. + * + * @param panelModel + * @return + */ + public static int lookupIndex(TabFolder folder, Object model) { + + int index = 0; + for (PageRef pr : folder.getChildren()) { + if (pr.getPageIdentifier() == model) { + return index; + } + index++; + } + return -1; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ChangeKind.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ChangeKind.java new file mode 100644 index 00000000000..c6e407ed35f --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ChangeKind.java @@ -0,0 +1,7 @@ +package org.eclipse.papyrus.texteditor.cdt.listener; + +public enum ChangeKind { + INTERFACE, + IMPLEMENTATION, + OPERATION +}; diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/Closure.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/Closure.java new file mode 100644 index 00000000000..b81203d94bc --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/Closure.java @@ -0,0 +1,81 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt.listener; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature.Setting; +import org.eclipse.uml2.common.util.UML2Util; +import org.eclipse.uml2.uml.Association; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; + +/** + * Calculate the closure of classifiers that need to be re-generated, if a + * classifier changes + * + * There are two different reasons for the need to re-generate a classifier: + * (1) one of the elements that it contains has changed + * (2) an element outside the containment close is changed. An example is a superclass + * that changes its name or an association target. In many cases, classifier depend + * on names of outside elements, but the also require a regeneration if the element + * is deleted. + * We need to take the change-kind into account. E.g. if the name of an operation in A changes, we need to + * re-generate class A, but we only need to regenerate class B (inheriting from A), if it actually + * redefines that operation. + */ +public class Closure { + public static EList calc(Classifier cl) { + EList list = new BasicEList(); + calc(cl, list); + return list; + } + + public static void calc(Classifier cl, EList list) { + if (cl != null) { + for (Setting setting : UML2Util.getNonNavigableInverseReferences(cl)) { + EObject eObj = setting.getEObject(); + if (eObj instanceof Element) { + Classifier referencedCl = nearestClassifier(eObj); + if (!list.contains(referencedCl) && (!(referencedCl instanceof Association))) { + list.add(referencedCl); + calc(referencedCl, list); + } + } + } + } + } + + public static boolean isContained(EObject parent, EObject possibleChild) { + while (possibleChild != null) { + if (parent == possibleChild) { + return true; + } + possibleChild = possibleChild.eContainer(); + } + return false; + } + + public static Classifier nearestClassifier(EObject eObj) { + while (eObj != null) { + if (eObj instanceof Classifier) { + return (Classifier) eObj; + } + eObj = eObj.eContainer(); + } + return null; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ModelListener.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ModelListener.java new file mode 100644 index 00000000000..18bc74c536e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/ModelListener.java @@ -0,0 +1,135 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt.listener; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.UniqueEList; +import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; +import org.eclipse.papyrus.uml.tools.listeners.PapyrusStereotypeListener; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.DirectedRelationship; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Feature; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Parameter; + +/** + * Main listener for model changes (registered via plugin.xml). It will delegate + * to the sub-listeners for specific sub-elements (type, operation, port, ...) that + * can be found in this package + * + * @author ansgar + * + */ +public class ModelListener implements IPapyrusListener { + + /** + * set to true, if a synchronization from an CDT editor to the model is active + */ + public static boolean syncFromEditor; + + @Override + public void notifyChanged(Notification notification) { + Object notifier = notification.getNotifier(); + int eventType = notification.getEventType(); + if (syncFromEditor) { + return; + } + if ((eventType == Notification.REMOVING_ADAPTER) || + (eventType == Notification.RESOLVE)) { + // does not indicate a modification of the element + return; + } + // System.err.println(eventType + ": " + notifier); + + OperationHistoryListener.init(); + try { + // TODO: kind of get nearest classifier + + if (notifier instanceof Classifier) { + Classifier classifier = (Classifier) notifier; + if ((eventType == Notification.REMOVE) || + (eventType == PapyrusStereotypeListener.MODIFIED_STEREOTYPE)) { + regenList.add(classifier); + } + // don't treat addition here, since operations/properties do not have their final names yet + // IStorage storage = new TextStorage(string); + } + if (notifier instanceof Behavior) { + Behavior behavior = (Behavior) notifier; + if (eventType == Notification.SET) { + // name modification + if (behavior.getSpecification() == null) { + } + } + else if (eventType == Notification.ADD) { + // modification of an opaque behavior in Papyrus implied remove&add operations + Classifier nearestCl = getNearestClassifier(behavior); + if (nearestCl != null) { + regenList.add(nearestCl); + } + } + } + + else if (notifier instanceof Feature) { + // if a feature is added, it is first generated with a dummy name, then the name is corrected. + Feature feature = (Feature) notifier; + Element owner = feature.getOwner(); + if (owner instanceof Classifier) { + // System.out.println(owner); + regenList.add((Classifier) owner); + } + } + else if (notifier instanceof Parameter) { + Parameter parameter = (Parameter) notifier; + if (parameter.getOperation() != null) { + Element owner = parameter.getOperation().getOwner(); + if (owner instanceof Classifier) { + // System.out.println(owner); + regenList.add((Classifier) owner); + } + } + } + else if (notifier instanceof DirectedRelationship) { + // if a feature is added, it is first generated with a dummy name, then the name is corrected. + DirectedRelationship dr = (DirectedRelationship) notifier; + for (Element client : dr.getSources()) { + if (client instanceof Classifier) { + // System.out.println(client); + regenList.add((Classifier) client); + } + } + } + else if (notifier instanceof Package) { + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static Classifier getNearestClassifier(Element element) { + while (element != null) { + if (!(element instanceof Behavior) && (element instanceof Classifier)) { + return (Classifier) element; + } + element = element.getOwner(); + } + return null; + } + + static EList regenList = new UniqueEList(); +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/OperationHistoryListener.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/OperationHistoryListener.java new file mode 100644 index 00000000000..ca34d6ab0ba --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/listener/OperationHistoryListener.java @@ -0,0 +1,76 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt.listener; + +import org.eclipse.core.commands.operations.IOperationHistoryListener; +import org.eclipse.core.commands.operations.OperationHistoryEvent; +import org.eclipse.core.commands.operations.OperationHistoryFactory; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.infra.core.resource.NotFoundException; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.core.utils.ServiceUtils; +import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject; +import org.eclipse.papyrus.texteditor.cdt.Activator; +import org.eclipse.papyrus.texteditor.cdt.modelresource.TextEditorModelSharedResource; +import org.eclipse.papyrus.texteditor.cdt.sync.SyncModelToCDT; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; +import org.eclipse.uml2.uml.Classifier; + +public class OperationHistoryListener implements IOperationHistoryListener { + + public static void init() { + if (ohl == null) { + ohl = new OperationHistoryListener(); + OperationHistoryFactory.getOperationHistory().addOperationHistoryListener(ohl); + } + } + + private static OperationHistoryListener ohl = null; + + @Override + public void historyNotification(OperationHistoryEvent event) { + int eventType = event.getEventType(); + if (eventType == OperationHistoryEvent.OPERATION_ADDED || eventType == OperationHistoryEvent.REDONE + || eventType == OperationHistoryEvent.UNDONE) { + + EList regenListCopy = new BasicEList(ModelListener.regenList); + ModelListener.regenList.clear(); + + // re-generate files from list - if they are still in a resource + for (Classifier cl : regenListCopy) { + if (cl.eResource() != null) { + try { + ServicesRegistry serviceRegistry = ServiceUtilsForEObject.getInstance().getServiceRegistry(cl); + TextEditorModelSharedResource model = (TextEditorModelSharedResource) ServiceUtils.getInstance() + .getModelSet(serviceRegistry).getModelChecked(TextEditorModelSharedResource.MODEL_ID); + + if (model != null) { + TextEditorModel tem = model.getTextEditorModel(cl); + if (tem != null) { + SyncModelToCDT.syncModelToCDT(cl, tem.getGeneratorID()); + } + } + } catch (ServiceException e) { + Activator.log.error(e); + } catch (NotFoundException e) { + Activator.log.error(e); + } + } + } + } + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/modelresource/TextEditorModelSharedResource.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/modelresource/TextEditorModelSharedResource.java new file mode 100644 index 00000000000..7781972dd12 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/modelresource/TextEditorModelSharedResource.java @@ -0,0 +1,120 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.texteditor.cdt.modelresource; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource; +import org.eclipse.papyrus.infra.core.resource.IModel; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; + + +public class TextEditorModelSharedResource extends AbstractModelWithSharedResource implements IModel { + + + /** + * File extension used for notation. + */ + public static final String NOTATION_FILE_EXTENSION = "notation"; //$NON-NLS-1$ + + /** + * Model ID. + */ + public static final String MODEL_ID = "org.eclipse.papyrus.exteditor.cdt.CDTEditorModelSharedResource"; //$NON-NLS-1$ + + + /** + * + * Constructor. + * + */ + public TextEditorModelSharedResource() { + + } + + + /** + * Get the file extension used for this model. + * + * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getModelFileExtension() + * + * @return + */ + @Override + protected String getModelFileExtension() { + return NOTATION_FILE_EXTENSION; + } + + /** + * Get the identifier used to register this model. + * + * @see org.eclipse.papyrus.infra.core.resource.AbstractBaseModel#getIdentifier() + * + * @return + */ + @Override + public String getIdentifier() { + return MODEL_ID; + } + + + /** + * Add a new initialized {@link TextEditorModel} to the model. + * + * @param textInstance + * The textInstance to add. + */ + public void addTextEditorModel(TextEditorModel textInstance) { + getResource().getContents().add(textInstance); + } + + /** + * Add a new initialized {@link PapyrustextInstance} to the model. + * + * @param textInstance + * The textInstance to add. + */ + public void removeTextEditorModel(TextEditorModel textInstance) { + getResource().getContents().remove(textInstance); + } + + /** + * @param editedObject + * an edited element + * @return an editor reference for a given object if an editor exists, or null + */ + public TextEditorModel getTextEditorModel(EObject editedObject) { + for (EObject textInstanceEO : getResource().getContents()) { + if (textInstanceEO instanceof TextEditorModel) { + TextEditorModel textInstance = (TextEditorModel) textInstanceEO; + if (textInstance.getEditedObject() == editedObject) { + return textInstance; + } + } + } + return null; + } + + /** + * + * @see org.eclipse.papyrus.infra.core.resource.AbstractModelWithSharedResource#isModelRoot(org.eclipse.emf.ecore.EObject) + * + * @param object + * @return + */ + @Override + protected boolean isModelRoot(EObject object) { + return false; + } + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceConstants.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceConstants.java new file mode 100644 index 00000000000..ca20cafca87 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceConstants.java @@ -0,0 +1,33 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.texteditor.cdt.preferences; + +/** + * Constant definitions for plug-in preferences + */ +public class CDTPreferenceConstants { + + /** + * Default option for opening the editor at a specified location. Store uses directly the SWT constants + */ + public static final String P_OPEN_LOCATION = "openLocation"; //$NON-NLS-1$ + + /** + * For attributes, the default "aggregation kind" value is "none". When this option is set + * it will be treated as composite + */ + public static final String P_SYNC_PERMANENTLY = "syncPermanently"; //$NON-NLS-1$ + + public static final String P_SYNC_ALL_FILES = "syncAllFiles"; //$NON-NLS-1$ +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceInitializer.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceInitializer.java new file mode 100644 index 00000000000..494838690c5 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferenceInitializer.java @@ -0,0 +1,39 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt.preferences; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.texteditor.cdt.Activator; +import org.eclipse.swt.SWT; + +/** + * Class used to initialize default preference values. + */ +public class CDTPreferenceInitializer extends AbstractPreferenceInitializer { + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() + */ + @Override + public void initializeDefaultPreferences() { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + store.setDefault(CDTPreferenceConstants.P_OPEN_LOCATION, SWT.RIGHT); + store.setDefault(CDTPreferenceConstants.P_SYNC_ALL_FILES, false); + store.setDefault(CDTPreferenceConstants.P_SYNC_PERMANENTLY, false); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferencePage.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferencePage.java new file mode 100644 index 00000000000..efc94febace --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/preferences/CDTPreferencePage.java @@ -0,0 +1,64 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.texteditor.cdt.preferences; + +import org.eclipse.jface.preference.BooleanFieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.papyrus.texteditor.cdt.Activator; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; + + +/** + * This class represents the EC3M preference page + *

    + * This page is used to modify preferences only. They are stored in the preference store that belongs to the main plug-in class. That way, preferences can be accessed directly via the preference store. + */ + +public class CDTPreferencePage + extends FieldEditorPreferencePage + implements IWorkbenchPreferencePage { + + public CDTPreferencePage() { + super(GRID); + setPreferenceStore(Activator.getDefault().getPreferenceStore()); + setDescription("CDT editor integration options"); //$NON-NLS-1$ + } + + /** + * Creates the field editors. Field editors are abstractions of + * the common GUI blocks needed to manipulate various types + * of preferences. Each field editor knows how to save and + * restore itself. + */ + @Override + public void createFieldEditors() { + addField(new BooleanFieldEditor( + CDTPreferenceConstants.P_SYNC_PERMANENTLY, "&Synchronize permanently (otherwise only on demand)", //$NON-NLS-1$ + getFieldEditorParent())); + + addField(new BooleanFieldEditor( + CDTPreferenceConstants.P_SYNC_ALL_FILES, "Synchronize all classes (otherwise synchronize only classes with open editor)", //$NON-NLS-1$ + getFieldEditorParent())); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) + */ + @Override + public void init(IWorkbench workbench) { + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/FindTransition.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/FindTransition.java new file mode 100644 index 00000000000..e737e45abf3 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/FindTransition.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2013 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation + * + *******************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt.sync; + +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Transition; + +/** + * Find the behavior in the model from a given method in the code. Used during the + * back synchronization from code to model. + */ +public class FindTransition { + + private static final String UNDERSCORE = "_"; //$NON-NLS-1$ + + public static Behavior findBehavior(Classifier cl, String methodName) { + for (Element element : cl.allOwnedElements()) { + if (element instanceof Transition) { + Transition transition = (Transition) element; + Behavior effect = transition.getEffect(); + if ((effect != null) && behaviorMatches(effect, methodName)) { + return transition.getEffect(); + } + } + } + return null; + } + + public static boolean behaviorMatches(Behavior behavior, String methodName) { + return + methodName.endsWith(NamedElement.SEPARATOR + behavior.getName()) || + methodName.endsWith(UNDERSCORE + behavior.getName()); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ObtainICElement.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ObtainICElement.java new file mode 100644 index 00000000000..e5457380c45 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ObtainICElement.java @@ -0,0 +1,129 @@ +/******************************************************************************* + * Copyright (c) 2015 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation + * + *******************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt.sync; + +import java.util.Iterator; + +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.core.model.IFunctionDeclaration; +import org.eclipse.cdt.core.model.IParent; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; +import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen2; +import org.eclipse.papyrus.codegen.extensionpoints.MethodInfo; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.ParameterDirectionKind; +import org.eclipse.uml2.uml.Transition; + + +/** + * This class is used to select the operation the user wants to edit after opening the editor. + * In case of transition, the selection is based on simple name only (either prefixed with the name separator or with an + * underscore - based on the assumption that scoped names are either kept or flattened using underscore as separator + * + */ +public class ObtainICElement { + + /** + * Return the ICelement associated with a UML element. Currently, only methods are supported. + * + * @param parent + * the parent (typically the translation unit of a CDT file) + * @param element + * A named UML element + * @throws CoreException + */ + public static ICElement getICElement(ILangCodegen codegen, IParent parent, NamedElement element) { + MethodInfo methodInfo = null; + NamedElement operationOrBehavior = element; + if (element instanceof Transition) { + operationOrBehavior = ((Transition) element).getEffect(); + } + + // no behavior found => not possible to locate element + if (operationOrBehavior == null) { + return null; + } + + if (codegen instanceof ILangCodegen2) { + // get generator specific method info. + methodInfo = ((ILangCodegen2) codegen).getMethodInfo(operationOrBehavior); + } + if (methodInfo == null) { + // use default behavior. + if (element instanceof Behavior) { + methodInfo = MethodInfo.fromBehavior((Behavior) operationOrBehavior); + } + else if (element instanceof Operation) { + methodInfo = MethodInfo.fromOperation((Operation) operationOrBehavior); + } + else { + return null; + } + } + + try { + for (ICElement child : parent.getChildren()) { + if (child instanceof IParent) { + return getICElement(codegen, (IParent) child, element); + } + if (child instanceof IFunctionDeclaration) { + IFunctionDeclaration function = (IFunctionDeclaration) child; + + // does the element name match? (CDT provides className::methodName information). Since we are in the scope of + // the class, we only verify the postfix part of the name + if (child.getElementName().endsWith(NamedElement.SEPARATOR + methodInfo.getName())) { + // check, if parameters match. This handles most common overloading cases (it does not handle functions that + // only differ with respect to the modifiers + Iterator paramIter = methodInfo.getParameterTypes().iterator(); + boolean match = methodInfo.getParameterTypes().size() == function.getParameterTypes().length; + if (match) { + for (String cdtParamType : function.getParameterTypes()) { + String umlParamType = paramIter.next(); + if (!cdtParamType.equals(umlParamType)) { + match = false; + break; + } + } + if (match) { + return child; + } + } + } + } + } + } catch (CoreException e) { + } + return null; + } + + /** + * Count the number of parameters without taking the return parameter into account + * + * @param list + * @return + */ + public static int countParameters(EList list) { + int params = 0; + for (Parameter par : list) { + if (par.getDirection() != ParameterDirectionKind.RETURN_LITERAL) { + params++; + } + } + return params; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ParameterModifiers.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ParameterModifiers.java new file mode 100644 index 00000000000..8601ac73484 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/ParameterModifiers.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2013 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation + * + *******************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt.sync; + +/** + * Simple grouping of modifier related parameters + */ +public class ParameterModifiers { + public ParameterModifiers() { + isPointer = false; + isRef = false; + isRegister = false; + array = ""; //$NON-NLS-1$ + } + + /** + * true, if parameter is a pointer + */ + boolean isPointer; + + /** + * true, if parameter is a reference + */ + boolean isRef; + + /** + * true, if parameter is a register + */ + boolean isRegister; + + /** + * value of array modifiers (e.g. [2]) + */ + String array ; +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/RevealCurrentOperation.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/RevealCurrentOperation.java new file mode 100644 index 00000000000..cf53a0b5468 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/RevealCurrentOperation.java @@ -0,0 +1,128 @@ +/******************************************************************************* + * Copyright (c) 2015 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation + * + *******************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt.sync; + +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.dom.ast.IASTNodeSelector; +import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; +import org.eclipse.cdt.core.index.IIndex; +import org.eclipse.cdt.core.model.CModelException; +import org.eclipse.cdt.core.model.CoreModel; +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.core.model.ICProject; +import org.eclipse.cdt.core.model.IFunctionDeclaration; +import org.eclipse.cdt.core.model.IParent; +import org.eclipse.cdt.core.model.ISourceRange; +import org.eclipse.cdt.core.model.ISourceReference; +import org.eclipse.cdt.core.model.ITranslationUnit; +import org.eclipse.cdt.ui.CDTUITools; +import org.eclipse.jface.text.ITextSelection; +import org.eclipse.papyrus.infra.core.Activator; +import org.eclipse.ui.IEditorInput; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Operation; + + +public class RevealCurrentOperation { + + public RevealCurrentOperation(IEditorInput input, Classifier classifier, String projectName) { + m_input = input; + m_classifier = classifier; + m_projectName = projectName; + } + + public Element obtainSelectedElement(ITextSelection selection) { + ICElement ice = CDTUITools.getEditorInputCElement(m_input); + + if (ice instanceof ITranslationUnit) { + ICProject project = CoreModel.getDefault().getCModel().getCProject(m_projectName); + + IIndex index = null; + try { + index = CCorePlugin.getIndexManager().getIndex(project); + index.acquireReadLock(); + + // index = CCorePlugin.getIndexManager().getIndex(project); + ITranslationUnit itu = (ITranslationUnit) ice; + // hack: force re-evaluation of AST node, requires modified CDT! + // Seems to be no longer required. + // ASTProvider.getASTProvider().fCache.setActiveElement(itu); + + IASTTranslationUnit ast = itu.getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS); + IASTNodeSelector selector = ast.getNodeSelector(null); + + String opName = findOperation(itu, selector, itu, selection); + if (opName != null) { + int sep = opName.lastIndexOf("::"); //$NON-NLS-1$ + if (sep != -1) { + opName = opName.substring(sep + 2); + } + Operation operation = m_classifier.getOperation(opName, null, null); + if (operation != null) { + return operation; + } + } + + } catch (CModelException e) { + Activator.getDefault().getLog().log(e.getStatus()); + } catch (Exception e) { + System.err.println(e); + } finally { + if (index != null) { + index.releaseReadLock(); + } + } + } + return m_classifier; + } + + /** + * Examine the children of a translation unit in order to extract the methods that are defined within + * the unit + * + * @param itu + * @param selector + * @param parent + * @throws CModelException + */ + public String findOperation(ITranslationUnit itu, IASTNodeSelector selector, IParent parent, ITextSelection selection) throws CModelException { + + for (ICElement child : parent.getChildren()) { + if (child instanceof IParent) { + return findOperation(itu, selector, (IParent) child, selection); + } + ISourceRange range = null; + if (child instanceof ISourceReference) { + range = ((ISourceReference) child).getSourceRange(); + } + if (child instanceof IFunctionDeclaration) { + // function declaration is a superclass for method declaration (but need to trace functions differently?) + String name = ((IFunctionDeclaration) child).getElementName(); + int pos = selection.getOffset(); + if ((pos >= range.getStartPos()) && (pos < range.getStartPos() + range.getLength())) { + return name; + } + } + } + return null; + } + + + + protected IEditorInput m_input; + + protected Classifier m_classifier; + + protected String m_projectName; +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncCDTtoModel.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncCDTtoModel.java new file mode 100644 index 00000000000..1a0d635b974 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncCDTtoModel.java @@ -0,0 +1,635 @@ +/******************************************************************************* + * Copyright (c) 2013 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation + * + *******************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt.sync; + +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.dom.ast.ExpansionOverlapsBoundaryException; +import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement; +import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier; +import org.eclipse.cdt.core.dom.ast.IASTFileLocation; +import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator; +import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition; +import org.eclipse.cdt.core.dom.ast.IASTName; +import org.eclipse.cdt.core.dom.ast.IASTNode; +import org.eclipse.cdt.core.dom.ast.IASTNodeSelector; +import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration; +import org.eclipse.cdt.core.dom.ast.IASTStatement; +import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; +import org.eclipse.cdt.core.index.IIndex; +import org.eclipse.cdt.core.model.CModelException; +import org.eclipse.cdt.core.model.CoreModel; +import org.eclipse.cdt.core.model.ICElement; +import org.eclipse.cdt.core.model.ICProject; +import org.eclipse.cdt.core.model.IFunctionDeclaration; +import org.eclipse.cdt.core.model.IMethodDeclaration; +import org.eclipse.cdt.core.model.IParent; +import org.eclipse.cdt.core.model.ISourceRange; +import org.eclipse.cdt.core.model.ISourceReference; +import org.eclipse.cdt.core.model.ITranslationUnit; +import org.eclipse.cdt.core.model.IWorkingCopy; +import org.eclipse.cdt.core.parser.IToken; +import org.eclipse.cdt.ui.CDTUITools; +import org.eclipse.cdt.ui.CUIPlugin; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.C_Cpp.Array; +import org.eclipse.papyrus.C_Cpp.Const; +import org.eclipse.papyrus.C_Cpp.EStorageClass; +import org.eclipse.papyrus.C_Cpp.Include; +import org.eclipse.papyrus.C_Cpp.Ptr; +import org.eclipse.papyrus.C_Cpp.Ref; +import org.eclipse.papyrus.C_Cpp.StorageClass; +import org.eclipse.papyrus.C_Cpp.Volatile; +import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; +import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen2; +import org.eclipse.papyrus.codegen.extensionpoints.LanguageCodegen; +import org.eclipse.papyrus.codegen.extensionpoints.SyncInformation; +import org.eclipse.papyrus.cpp.codegen.Constants; +import org.eclipse.papyrus.infra.core.Activator; +import org.eclipse.papyrus.texteditor.cdt.CommandSupport; +import org.eclipse.papyrus.texteditor.cdt.TextEditorConstants; +import org.eclipse.papyrus.texteditor.cdt.Utils; +import org.eclipse.papyrus.texteditor.cdt.listener.ModelListener; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.papyrus.uml.tools.utils.UMLUtil; +import org.eclipse.ui.IEditorInput; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.BehavioralFeature; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Comment; +import org.eclipse.uml2.uml.DataType; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.OpaqueBehavior; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.UMLPackage; + +public class SyncCDTtoModel implements Runnable { + + public static final String REGISTER = "register"; //$NON-NLS-1$ + + public static final String CONST = "const"; //$NON-NLS-1$ + + public static final String VOLATILE = "volatile"; //$NON-NLS-1$ + + public static final String sAtParam = "@param"; //$NON-NLS-1$ + + public static final String ansiCLib = "AnsiCLibrary"; //$NON-NLS-1$ + + public SyncCDTtoModel(IEditorInput input, Classifier classifier, String projectName, String generatorID) { + m_input = input; + m_classifier = classifier; + m_projectName = projectName; + m_codegen = LanguageCodegen.getGenerator(TextEditorConstants.CPP, generatorID); + } + + + public final String c_cpp_langID = "C/C++"; //$NON-NLS-1$ + + public void syncCDTtoModel() { + CommandSupport.exec("update model from CDT", this); + } + + @Override + public void run() { + ICElement ice = CDTUITools.getEditorInputCElement(m_input); + ModelListener.syncFromEditor = true; + + if (ice instanceof ITranslationUnit) { + ICProject project = CoreModel.getDefault().getCModel().getCProject(m_projectName); + + IIndex index = null; + try { + index = CCorePlugin.getIndexManager().getIndex(project); + index.acquireReadLock(); + + // index = CCorePlugin.getIndexManager().getIndex(project); + ITranslationUnit itu = (ITranslationUnit) ice; + // hack: force re-evaluation of AST node, requires modified CDT! + // Seems to be no longer required. + // ASTProvider.getASTProvider().fCache.setActiveElement(itu); + + IASTTranslationUnit ast = itu.getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS); + IASTNodeSelector selector = ast.getNodeSelector(null); + + examineChildren(itu, selector, itu); + updateCppInclude(itu); + + CUIPlugin.getDefault().getProblemMarkerManager(); + if (itu instanceof IWorkingCopy) { + // ((IWorkingCopy)itu).commit(true, new + // NullProgressMonitor()); + // ((IWorkingCopy)itu).reconcile(); + ((IWorkingCopy) itu).reconcile(true, new NullProgressMonitor()); + // ((IWorkingCopy)itu).reconcile(true, true, new + // NullProgressMonitor()); + } + + } catch (CModelException e) { + Activator.getDefault().getLog().log(e.getStatus()); + } catch (Exception e) { + System.err.println(e); + } finally { + if (index != null) { + index.releaseReadLock(); + } + } + } + ModelListener.syncFromEditor = false; + } + + /** + * Examine the children of a translation unit in order to extract the + * methods that are defined within hte unit + * + * @param itu + * @param selector + * @param parent + * @throws CModelException + */ + public void examineChildren(ITranslationUnit itu, IASTNodeSelector selector, IParent parent) + throws CModelException { + + int position = 0; + // if (parent instanceof Namespace) { + for (ICElement child : parent.getChildren()) { + if (child instanceof IParent) { + examineChildren(itu, selector, (IParent) child); + } + ISourceRange range = null; + if (child instanceof ISourceReference) { + range = ((ISourceReference) child).getSourceRange(); + } + if (child instanceof IFunctionDeclaration) { + // function declaration is a superclass for method declaration + // (but need to trace functions differently?) + String name = ((IFunctionDeclaration) child).getElementName(); + IASTNode node = selector.findEnclosingNode(range.getStartPos(), range.getLength()); + if (node instanceof IASTFunctionDefinition) { + IASTFunctionDefinition definition = (IASTFunctionDefinition) node; + IASTFunctionDeclarator declarator = definition.getDeclarator(); + String unfilteredBody = getBody(itu, definition); + // get additional information about method synchronization from generator + SyncInformation syncInfo = null; + if (m_codegen instanceof ILangCodegen2) { + syncInfo = ((ILangCodegen2) m_codegen).getSyncInformation(name, unfilteredBody); + } + String body = Utils.removeGenerated(unfilteredBody); + if (syncInfo == null || !syncInfo.isGenerated) { + // only update method, if it is not generated + NamedElement ne = updateMethod(position, parent, name, body, declarator, syncInfo); + updateComment(itu, definition, ne); + } + // System.err.println("body source <" + body + ">"); + } + position++; + } + } + } + + /** + * update the contents of the CppInclude directive + * + * @param itu + * the translation unit + */ + public void updateCppInclude(ITranslationUnit itu) { + String contents = new String(itu.getContents()); + int preBodyStart = contents.indexOf(Constants.cppIncPreBodyStart); + int preBodyEnd = contents.indexOf(Constants.cppIncPreBodyEnd); + String preBody = ""; //$NON-NLS-1$ + String body = ""; //$NON-NLS-1$ + if (preBodyStart != -1) { + preBodyStart += Constants.cppIncPreBodyStart.length(); + if (preBodyEnd > preBodyStart) { + preBody = contents.substring(preBodyStart, preBodyEnd).trim(); + } + } + + int bodyStart = contents.indexOf(Constants.cppIncBodyStart); + int bodyEnd = contents.indexOf(Constants.cppIncBodyEnd); + + if (bodyStart != -1) { + bodyStart += Constants.cppIncBodyStart.length() + 1; + if (bodyEnd > bodyStart) { + body = contents.substring(bodyStart, bodyEnd).trim(); + } + } + if (body.length() > 0 || preBody.length() > 0) { + Include include = StereotypeUtil.applyApp(m_classifier, Include.class); + if (include != null) { + include.setPreBody(preBody); + include.setBody(body); + } + } + } + + /** + * Update a method in the model based on the qualified name. + * + * @param position + * The position of the method within the file. Used to identify + * renaming operations + * @param parent + * the CDT parent which is used to get a list of children + * @param qualifiedName + * the qualified name of a method + * @param body + * the method body + * @param declarator + * the declarator for the method + * @return the operation or the behavior within the model that got updated. The latter is returned in + * case of behaviors that do not have a specification (e.g. the effect of a transition). + */ + public NamedElement updateMethod(int position, IParent parent, String qualifiedName, String body, + IASTFunctionDeclarator declarator, SyncInformation syncInfo) { + + String names[] = qualifiedName.split(Utils.nsSep); + String name = names[names.length - 1]; + + Operation operation = null; + Behavior behavior = null; + + if (syncInfo == null || (syncInfo.behavior == null && syncInfo.createBehaviorName == null)) { + operation = getModelOperationFromName(name, parent, position); + if (operation != null) { + operation.setName(name); + } else { + // it is possible that the C++ method corresponds to the effect + // of a transition. try to locate the behavior (without using an operation) + behavior = FindTransition.findBehavior(m_classifier, name); + if (behavior == null) { + // still null => create new operation in model + if (m_classifier instanceof Class) { + operation = ((Class) m_classifier).createOwnedOperation(name, null, null); + } else if (m_classifier instanceof DataType) { + operation = ((DataType) m_classifier).createOwnedOperation(name, null, null); + } + } + } + } + else if (syncInfo.behavior != null) { + // operation is still null (=> does not enter operation != null case below) + behavior = syncInfo.behavior; + } + else if ((syncInfo.createBehaviorName != null) && (m_classifier instanceof Class)) { + Class clazz = (Class) m_classifier; + behavior = (OpaqueBehavior) clazz.createOwnedBehavior(syncInfo.createBehaviorName, + UMLPackage.eINSTANCE.getOpaqueBehavior().eClass()); + } + + if (operation != null) { + if (operation.getMethods().size() == 0) { + // operation exists, but does not have any method => create + + if (m_classifier instanceof Class) { + behavior = ((Class) m_classifier).createOwnedBehavior(name, UMLPackage.eINSTANCE.getOpaqueBehavior()); + } else if (m_classifier instanceof DataType) { + // ob = (OpaqueBehavior) ((DataType) + // m_classifier).createOwnedBehavior(name, + // UMLPackage.eINSTANCE.getOpaqueBehavior()); + } + behavior.setSpecification(operation); + behavior.setIsReentrant(false); + } + else { + behavior = operation.getMethods().get(0); + // operation has at least one method, this may not be null. + if (!behavior.getName().equals(name)) { + behavior.setName(name); + } + } + } + + // assertions: operation can be null, behavior is always non-null + + // Remove all parameters from operation / behavior (they will be added later). + // Calling parameters.clear() is not sufficient. Otherwise stereotype + // applications to unresolved elements remain in the model + if (operation != null) { + UMLUtil.destroyElements(operation.getOwnedParameters()); + } + UMLUtil.destroyElements(behavior.getOwnedParameters()); + + for (IASTNode declaratorChild : declarator.getChildren()) { + if (declaratorChild instanceof IASTParameterDeclaration) { + IASTParameterDeclaration parameter = (IASTParameterDeclaration) declaratorChild; + IASTName parameterName = parameter.getDeclarator().getName(); + IASTDeclSpecifier parameterType = parameter.getDeclSpecifier(); + ParameterModifiers modifiers = new ParameterModifiers(); + String parameterTypeName = ""; //$NON-NLS-1$ + try { + IToken token = parameter.getDeclarator().getSyntax(); + while (token != null) { + String tokenStr = token.toString(); + if (tokenStr.equals("*")) { //$NON-NLS-1$ + modifiers.isPointer = true; + } else if (tokenStr.equals("&")) { //$NON-NLS-1$ + modifiers.isRef = true; + } else if (tokenStr.equals("[")) { //$NON-NLS-1$ + while (token != null) { + modifiers.array += token.toString(); + token = token.getNext(); + } + if (token == null) { + break; + } + } + token = token.getNext(); + } + + token = parameterType.getSyntax(); + while (token != null) { + String tokenStr = token.toString(); + if (tokenStr.equals("*")) { //$NON-NLS-1$ + // TODO: check, if this can be called (depending on + // * position with different semantics?) + modifiers.isPointer = true; + } else if (tokenStr.equals("&")) { //$NON-NLS-1$ + modifiers.isRef = true; + } else if (tokenStr.equals(REGISTER)) { + modifiers.isRegister = true; + } else if (tokenStr.equals(CONST) || tokenStr.equals(VOLATILE)) { + // do nothing (use isConst() or isVolatile() operation of parameterType) + // is not part of parameter type + } else { + if (parameterTypeName.length() > 0) { + parameterTypeName += " "; //$NON-NLS-1$ + } + parameterTypeName += tokenStr; + } + token = token.getNext(); + } + } catch (ExpansionOverlapsBoundaryException e) { + } + + NamedElement namedElemParamType = Utils.getQualifiedElement(Utils.getTop(m_classifier), + parameterTypeName); + if (namedElemParamType == null) { + namedElemParamType = Utils.getQualifiedElement(Utils.getTop(m_classifier), + ansiCLib + Utils.nsSep + parameterTypeName); + } + if (parameterType.isRestrict()) { + } + Parameter umlParameter = null; + Type paramType = namedElemParamType instanceof Type ? (Type) namedElemParamType : null; + if (operation != null) { + umlParameter = operation.createOwnedParameter(parameterName.toString(), paramType); + applyParameterModifiers(parameterType, umlParameter, modifiers); + } + umlParameter = behavior.createOwnedParameter(parameterName.toString(), paramType); + applyParameterModifiers(parameterType, umlParameter, modifiers); + } + } + + if (behavior instanceof OpaqueBehavior) { + OpaqueBehavior ob = (OpaqueBehavior) behavior; + if (ob.getBodies().size() == 0) { + ob.getLanguages().add(c_cpp_langID); + ob.getBodies().add(""); //$NON-NLS-1$ + } + for (int i = 0; i < ob.getLanguages().size(); i++) { + // update first body of one of the languages supported by CDT. This implies that + // it is actually not possible to have separate C and C++ bodes in the same opaque + // behavior (which is rarely a good idea). + String language = ob.getLanguages().get(i); + if (TextEditorConstants.CPP.matcher(language).matches() || c_cpp_langID.equals(language)) { + if (i < ob.getBodies().size()) { + // should always be true, unless sync between + // languages/bodies is lost + ob.getBodies().set(i, body); + } + } + } + } + if (operation != null) { + return operation; + } + else { + return behavior; + } + } + + /** + * Apply the modifiers for a parameter, notably the stereotypes of the C++ profile + * + * @param parameterType the CDT AST parameter specification + * @param umlParameter the UML parameter (to which a stereotype should be applied) + * @param modifiers the modifiers that should be applied (stored in an instance of class ParameterModifiers) + */ + public void applyParameterModifiers(IASTDeclSpecifier parameterType, Parameter umlParameter, ParameterModifiers modifiers) { + if (parameterType.isConst()) { + StereotypeUtil.apply(umlParameter, Const.class); + } + if (parameterType.isVolatile()) { + StereotypeUtil.apply(umlParameter, Volatile.class); + } + if (modifiers.isRegister) { + StorageClass sc = StereotypeUtil.applyApp(umlParameter, StorageClass.class); + if (sc != null) { + sc.setStorageClass(EStorageClass.REGISTER); + } + } + if (modifiers.isPointer) { + StereotypeUtil.apply(umlParameter, Ptr.class); + } else if (modifiers.isRef) { + StereotypeUtil.apply(umlParameter, Ref.class); + } + if (modifiers.array.length() > 0) { + Array arraySt = StereotypeUtil.applyApp(umlParameter, Array.class); + if (arraySt != null && !modifiers.array.equals("[]") && (!modifiers.array.equals("[ ]"))) { //$NON-NLS-1$//$NON-NLS-2$ + arraySt.setDefinition(modifiers.array); + } + } + } + + /** + * Obtain an operation from the model by using the name of a CDT method. + * If an operation of the given name does not exist, it might indicate that + * the method has been renamed. + * + * @param name the operation name within CDT + * @param parent the parent of the CDT method within CDT editor model + * @param position the position within the other methods. This information is used to locate methods + * within the model that might have been renamed in the CDT editor. + * @return + */ + public Operation getModelOperationFromName(String name, IParent parent, int position) { + Operation operation = m_classifier.getOperation(name, null, null); + + if (operation == null) { + // operation is not found via name in the model. try to locate the operation in the model at the same + // "position" as the method in the file and + // verify that this method does not have the same name as any method + // in the CDT file. + if (position < m_classifier.getOperations().size()) { + operation = m_classifier.getOperations().get(position); + String modelName = operation.getName(); + try { + for (ICElement child : parent.getChildren()) { + if (child instanceof IMethodDeclaration) { + String cdtName = ((IMethodDeclaration) child).getElementName(); + if (cdtName.equals(modelName)) { + // an existing operation in the CDT file already + // has this name + operation = null; + break; + } + } + } + } catch (CModelException e) { + } + } + } + return operation; + } + + public static String getBody(ITranslationUnit itu, IASTFunctionDefinition definition) { + IASTStatement body = definition.getBody(); + + if (body instanceof IASTCompoundStatement) { + IASTCompoundStatement bodyComp = (IASTCompoundStatement) body; + + IASTFileLocation bodyLoc = bodyComp.getFileLocation(); + int start = bodyLoc.getNodeOffset(); + int end = start + bodyLoc.getNodeLength(); + char contents[] = itu.getContents(); + // body contains enclosing { } which we need to remove (+2, -2). We + // cannot use the + // first and last statement, since leading and trailing comments are + // not part of the AST tree. + return Utils.decreaseIndent(contents, start + 2, end - 2); + } + return ""; //$NON-NLS-1$ + } + + /** + * update a comment of a named element. Besides the comment of the element itself, comments on contained + * parameters are handled. + * + * @param itu a translation unit + * @param definition + * @param ne a named element that is either an operation or a behavior (in order to update parameters) + */ + public void updateComment(ITranslationUnit itu, IASTFunctionDefinition definition, NamedElement ne) { + IASTFileLocation bodyLoc = definition.getFileLocation(); + int start = bodyLoc.getNodeOffset() - 1; + int end = start; + char contents[] = itu.getContents(); + String comment = ""; //$NON-NLS-1$ + // backward scan for beginning /* + while (start > 0) { + if (contents[start] == '/' && contents[start + 1] == '*') { + start += "/**".length(); // TODO: common string //$NON-NLS-1$ + // constants with generator + for (int i = start; i < end; i++) { + comment += contents[i]; + } + comment = comment.replace("\n * ", "\n"). //$NON-NLS-1$//$NON-NLS-2$ + replace("*/", "").trim(); //$NON-NLS-1$//$NON-NLS-2$ + break; + } + start--; + } + if (comment.length() > 0) { + // filter @param + int atParam = comment.indexOf(sAtParam); + String commentMethodOnly = (atParam != -1) ? comment.substring(0, atParam).trim() : comment; + + EList commentsUML = ne.getOwnedComments(); + Comment commentUML; + if (commentsUML.size() == 0) { + commentUML = ne.createOwnedComment(); + commentUML.getAnnotatedElements().add(commentUML); + } else { + commentUML = commentsUML.get(0); + } + while (atParam != -1) { + int currentAtParam = atParam; + atParam = comment.indexOf(sAtParam, atParam + 1); + String commentParam = (atParam != -1) ? comment.substring(currentAtParam, atParam) + : comment.substring(currentAtParam); + Comment commentParamUML; + int atParamName = sAtParam.length(); + + while ((atParamName < commentParam.length()) + && Character.isWhitespace(commentParam.charAt(atParamName))) { + atParamName++; + } + int atParamNameEnd = atParamName; + while ((atParamNameEnd < commentParam.length()) + && !Character.isWhitespace(commentParam.charAt(atParamNameEnd))) { + atParamNameEnd++; + } + if (atParamNameEnd < commentParam.length() - 1) { + String parameterName = commentParam.substring(atParamName, atParamNameEnd); + String commentParamText = commentParam.substring(atParamNameEnd).trim(); + Parameter parameter = null; + if (ne instanceof BehavioralFeature) { + parameter = ((BehavioralFeature) ne).getOwnedParameter(parameterName, null, false, false); + } + else if (ne instanceof Behavior) { + parameter = ((Behavior) ne).getOwnedParameter(parameterName, null, false, false); + } + if (parameter != null) { + EList commentsParamUML = parameter.getOwnedComments(); + if (commentsParamUML.size() == 0) { + commentParamUML = parameter.createOwnedComment(); + commentParamUML.getAnnotatedElements().add(commentParamUML); + } else { + commentParamUML = commentsParamUML.get(0); + } + commentParamUML.setBody(commentParamText); + } else { + // parameter is not found in model, e.g. either renamed + // or not yet existing + // store comment in operation comment + commentMethodOnly += "\n " + sAtParam + parameterName + //$NON-NLS-1$ + " not found(!) " + commentParamText; //$NON-NLS-1$ + } + } + } + commentUML.setBody(commentMethodOnly); + } + } + + /** + * Accessor + * @return value of codegen attribute + */ + public ILangCodegen getCodeGen() { + return m_codegen; + } + + /** + * input of the CDT editor. Used to obtain code within editor. + */ + protected IEditorInput m_input; + + /** + * The classifier (class) that is currently edited + */ + protected Classifier m_classifier; + + /** + * name of CDT project in which the generated code is stored. + */ + protected String m_projectName; + + /** + * reference to code generator + */ + protected ILangCodegen m_codegen; +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncModelToCDT.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncModelToCDT.java new file mode 100644 index 00000000000..207dfa013c9 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/sync/SyncModelToCDT.java @@ -0,0 +1,80 @@ +/******************************************************************************* + * Copyright (c) 2013 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - ansgar.radermacher@cea.fr CEA LIST - initial API and implementation + * + *******************************************************************************/ + +package org.eclipse.papyrus.texteditor.cdt.sync; + +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.Path; +import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; +import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen.FILE_KIND; +import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen2; +import org.eclipse.papyrus.codegen.extensionpoints.LanguageCodegen; +import org.eclipse.papyrus.cpp.codegen.Constants; +import org.eclipse.papyrus.infra.core.Activator; +import org.eclipse.papyrus.texteditor.cdt.TextEditorConstants; +import org.eclipse.uml2.uml.Classifier; + +/** + * Main listener for model changes (registered via plugin.xml). It will delegate + * to the sub-listeners for specific sub-elements (type, operation, port, ...) that + * can be found in this package + * + */ +public class SyncModelToCDT { + + private static final String CPP_SUFFIX = "cpp"; //$NON-NLS-1$ + /** + * set to true, if a synchronization from an CDT editor to the model is active + */ + public static boolean syncFromEditor; + + public static IFile syncModelToCDT(Classifier classifier, String generatorID) { + if ((classifier == null) || (classifier.eResource() == null)) { + return null; + } + + ILangCodegen codegen = LanguageCodegen.getGenerator(TextEditorConstants.CPP, generatorID); + + IProject modelProject = codegen.getTargetProject(classifier, false); + if (modelProject == null) { + return null; + } + + IContainer srcPkg = null; + IFile cppFile = null; + try { + codegen.generateCode(modelProject, classifier, null); // need listener for sync in both directions! + + String suffix = (codegen instanceof ILangCodegen2) ? + suffix = ((ILangCodegen2) codegen).getSuffix(FILE_KIND.BODY) : CPP_SUFFIX; + + cppFile = modelProject.getFile(new Path(codegen.getFileName(modelProject, classifier) + Constants.DOT + suffix)); + + // IStorage storage = new TextStorage(string); + } finally { + // Refresh the container for the newly created files. This needs to be done even + // during error because of the possibility for partial results. + try { + if (srcPkg != null) { + srcPkg.refreshLocal(IResource.DEPTH_INFINITE, null); + } + } catch (CoreException e) { + Activator.log.error(e); + } + } + return cppFile; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/.classpath b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/.project b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/.project new file mode 100644 index 00000000000..c547cbe1809 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.views.cpp + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c537b63063c --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..3e836907323 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/META-INF/MANIFEST.MF @@ -0,0 +1,34 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.uml2.uml, + org.eclipse.emf.ecore.edit, + org.eclipse.gmf.runtime.notation;bundle-version="1.4.0", + org.eclipse.gef;bundle-version="3.6.0", + org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", + org.eclipse.ui.editors;bundle-version="3.6.1", + org.eclipse.papyrus.infra.core;bundle-version="1.2.0", + org.eclipse.jface.text;bundle-version="3.8.0", + org.eclipse.emf.transaction;bundle-version="1.4.0", + org.eclipse.gmf.runtime.common.core;bundle-version="1.4.1", + org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0", + org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", + org.eclipse.uml2.uml.profile.standard;bundle-version="1.0.100" +Export-Package: org.eclipse.papyrus.views.cpp; uses:="org.eclipse.ui, + com.cea.papyrus.views.panels, + org.eclipse.jface.viewers, + org.eclipse.ui.part, + org.eclipse.uml2.uml, + org.eclipse.swt.widgets" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.views.cpp.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.views.cpp;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/about.html b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    November 14, 2008

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/about.ini b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/about.ini new file mode 100644 index 00000000000..9b4b2c53944 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/about.ini @@ -0,0 +1,17 @@ +# about.ini + +# feature image (for about info...) +featureImage = resources/icons/Papyrus_32x32.gif + +#about text +aboutText =\ +Papyrus Cpp Code generation\n\ +\n\ +Version: 1.6.2\n\ +\n\ +(c) Copyright CEA 2006, 2007. All rights reserved.\n\ +\n\ +This program and the accompanying materials are made available under\n\ +the terms of the Eclipse Public License v1.0 which accompanies this\n\ +distribution, and is available at http://www.eclipse.org/legal/epl-v10.html\n\ +\ \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/build.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/build.properties new file mode 100644 index 00000000000..b961dfd1fd2 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/build.properties @@ -0,0 +1,10 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + plugin.xml,\ + resources/,\ + about.ini,\ + about.html +src.includes = about.html diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/plugin.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/plugin.properties new file mode 100644 index 00000000000..7ced719d446 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Simple Papyrus C++ view (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/plugin.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/plugin.xml new file mode 100644 index 00000000000..90b2f91a207 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/plugin.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/pom.xml b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/pom.xml new file mode 100644 index 00000000000..088bc59db8a --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.views.cpp + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/Papyrus_32x32.gif b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/Papyrus_32x32.gif new file mode 100644 index 00000000000..a57b9d92dee Binary files /dev/null and b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/Papyrus_32x32.gif differ diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/save_edit.gif b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/save_edit.gif new file mode 100644 index 00000000000..499dd0ca602 Binary files /dev/null and b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/save_edit.gif differ diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp.gif b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp.gif new file mode 100644 index 00000000000..7caaa0fdae8 Binary files /dev/null and b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp.gif differ diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp_old.gif b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp_old.gif new file mode 100644 index 00000000000..4b39411daf5 Binary files /dev/null and b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/transfo_cpp_old.gif differ diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/undo_edit.gif b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/undo_edit.gif new file mode 100644 index 00000000000..eae118ad168 Binary files /dev/null and b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/resources/icons/undo_edit.gif differ diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/AbstractCppPanelView.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/AbstractCppPanelView.java new file mode 100644 index 00000000000..d04e1955e35 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/AbstractCppPanelView.java @@ -0,0 +1,107 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2010 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.cpp; + +import org.eclipse.papyrus.views.panels.CppAbstractPanel; +import org.eclipse.papyrus.views.panels.PanelFactory; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.ISelectionListener; +import org.eclipse.ui.part.ViewPart; +import org.eclipse.uml2.uml.Element; + + +/** + * This class extends ViewPart. This class draws the Accord/Cpp + * panel in the Modeling Perspective. It also implements ISelectionListener in order to know which element is selected + * in the workbench. In fact, the content of the view changes depending on the + * type of the element selected + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public abstract class AbstractCppPanelView extends ViewPart implements ISelectionListener { + + /** parent composite of the panels contained by this view */ + protected Composite parent; + + /** stores the current target */ + protected Object currentTarget; + + /** keeps the reference to the panel (abstract class) */ + protected CppAbstractPanel panel; + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) + */ + @Override + public void createPartControl(Composite parent) { + getViewSite().getPage().addSelectionListener(this); + this.parent = parent; + panel = createPanel(parent, 0, null); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.part.WorkbenchPart#setFocus() + */ + @Override + public void setFocus() { + // delegate focus to the panel + panel.setFocus(); + } + + /** + * Changes the panel displayed in the view, depending on the type of the + * newly selected element. + */ + protected void switchUI() { + /* + * test to check if the panel is not disposed. Closing the panel + * view and open it again creates a second instance of panel, one of + * it is disposed, the new one is active + */ + if (!panel.isDisposed()) { + panel.exitAction(); + panel.dispose(); + + if (currentTarget != null && currentTarget instanceof Element) { + // creates the new panel given the current target + panel = createPanel(parent, 0, (Element) currentTarget); + } else { + panel = createPanel(parent, 0, null); + } + + panel.setBounds(panel.getParent().getBounds()); + panel.entryAction(); + } + } + + + /** + * Creates the new panel, when switching UI. + *

    + * This class should be overloaded when working with RSA or other tools, using a new PanelFactory + * + * @param parent + * the parent of the new panel + * @param style + * the SWT style of this panel + * @param element + * the element for which the panel is created + * @return the newly created panel + */ + protected CppAbstractPanel createPanel(Composite parent, int style, Element element) { + return PanelFactory.eINSTANCE.createPanel(parent, 0, currentTarget); + } +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.java new file mode 100644 index 00000000000..589debbdf42 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.java @@ -0,0 +1,160 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2010 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ +package org.eclipse.papyrus.views.cpp; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.views.cpp"; + + // The shared instance + private static Activator plugin; + + // Resource bundle. + public static final Font VIEW_FONT = new Font(null, "Bitstream Vera Sans Mono", 10, SWT.NORMAL); + + private static final String RESOURCE_NAME = PLUGIN_ID + ".Activator"; + + public static final String ICONS_PATH = "resources/icons/"; + + public static final String DEFAULT_IMAGE = ICONS_PATH + "default.gif"; + + public static final String SAVE_IMAGE = ICONS_PATH + "save_edit.gif"; + + public static final String UNDO_IMAGE = ICONS_PATH + "undo_edit.gif"; + + public static final String WARNING_IMAGE = ICONS_PATH + "warning.gif"; + + private ResourceBundle resourceBundle; + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + /** + * The constructor + */ + public Activator() { + plugin = this; + try { + resourceBundle = ResourceBundle.getBundle(RESOURCE_NAME); + } catch (MissingResourceException mre) { + // Log.exception(mre); + resourceBundle = null; + } + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the string from the plugin's resource bundle, or 'key' if not + * found. + */ + public static String getResourceString(String key) { + ResourceBundle bundle = getDefault().getResourceBundle(); + try { + return (bundle != null) ? bundle.getString(key) : key; + } catch (MissingResourceException e) { + return key; + } + } + + /** + * Returns the plugin's resource bundle, + */ + public ResourceBundle getResourceBundle() { + return resourceBundle; + } + + /** + * Returns an org.eclipse.swt.graphics.Image identified by + * its key.
    + * By default, it returns a default image. This image is the image placed in + * the directory resources/icons/default.gif + * + * @param key + * the key of the image + * @return the Image + */ + public static Image getImage(String key) { + ImageRegistry registry = getDefault().getImageRegistry(); + Image image = registry.get(key); + if (image == null) { + ImageDescriptor desc = AbstractUIPlugin + .imageDescriptorFromPlugin(PLUGIN_ID, key); + registry.put(key, desc); + image = registry.get(key); + } + if (image == null && !key.equals(DEFAULT_IMAGE)) { + image = getImage(DEFAULT_IMAGE); + } + + return image; + } + + /** + * Log the given exception into the plugin log. + * + * @param e + * the exception to log + */ + public static void log(Exception e) { + getDefault().getLog().log(new Status( + IStatus.ERROR, + PLUGIN_ID, + IStatus.OK, + "exception caught: " + e.getMessage(), + e)); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.properties b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.properties new file mode 100644 index 00000000000..79979449eba --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/Activator.properties @@ -0,0 +1,96 @@ +# Defaut Panel +panel.default.text=Please select a UML item on diagram or in the Model explorer + +# Operation Panel +panel.operation.button.save=Save +panel.operation.button.save.tooltip=Save Cpp operation body into its method Activity +panel.operation.button.cancel=Cancel +panel.operation.button.cancel.tooltip=Ignore modifications made since last save action +panel.operation.dialog.saveorignore.title=Warning : modifications not saved +panel.operation.dialog.saveorignore.body=Do you want to save modifications for the body of this method ? +panel.operation.dialog.saveorignore.button.save=Save +panel.operation.dialog.saveorignore.button.ignore=Ignore + +# Class Panel +panel.class.button.save=Save +panel.class.button.save.tooltip=Save Cpp include associated to this class + +panel.class.button.cancel=Cancel +panel.class.button.cancel.tooltip=Ignore modifications made since last save action + +panel.class.dialog.saveorignore.title=Warning : modifications not saved +panel.class.dialog.saveorignore=Do you want to save modifications for the include declared in this class ? +panel.class.dialog.saveorignore.button.save=Save +panel.class.dialog.saveorignore.button.ignore=Ignore + +# Package Panel +panel.package.button.save=Save +panel.package.button.save.tooltip=Save Cpp include associated to this package + +panel.package.button.cancel=Cancel +panel.package.button.cancel.tooltip=Ignore modifications made since last save action + +panel.package.dialog.saveorignore.title=Warning : modifications not saved +panel.package.dialog.saveorignore=Do you want to save modifications for the include declared in this package ? +panel.package.dialog.saveorignore.button.save=Save +panel.package.dialog.saveorignore.button.ignore=Ignore + +# PrimitiveType Panel +panel.type.button.save=Save +panel.type.button.save.tooltip=Save Cpp type definition associated to this primitive type + +panel.type.button.cancel=Cancel +panel.type.button.cancel.tooltip=Ignore modifications made since last save action + +panel.type.dialog.saveorignore.title=Warning : modifications not saved +panel.type.dialog.saveorignore=Do you want to save modifications for the type defined here ? +panel.type.dialog.saveorignore.button.save=Save +panel.type.dialog.saveorignore.button.ignore=Ignore + +# Property Panel +panel.property.button.save=Save +panel.property.button.save.tooltip=Save Cpp Property informations + +panel.property.button.cancel=Cancel +panel.property.button.cancel.tooltip=Ignore modifications made since last save action + +panel.property.dialog.saveorignore.title=Warning : modifications not saved +panel.property.dialog.saveorignore=Do you want to save modifications for the Property defined here ? +panel.property.dialog.saveorignore.button.save=Save +panel.property.dialog.saveorignore.button.ignore=Ignore + +# Parameter Panel +panel.parameter.button.save=Save +panel.parameter.button.save.tooltip=Save Cpp Parameter informations + +panel.parameter.button.cancel=Cancel +panel.parameter.button.cancel.tooltip=Ignore modifications made since last save action + +panel.parameter.dialog.saveorignore.title=Warning : modifications not saved +panel.parameter.dialog.saveorignore=Do you want to save modifications for the Parameter defined here ? +panel.parameter.dialog.saveorignore.button.save=Save +panel.parameter.dialog.saveorignore.button.ignore=Ignore + +# TemplateBinding Panel +panel.templatebinding.button.save=Save +panel.templatebinding.button.save.tooltip=Save Cpp TemplateBinding informations + +panel.templatebinding.button.cancel=Cancel +panel.templatebinding.button.cancel.tooltip=Ignore modifications made since last save action + +panel.templatebinding.dialog.saveorignore.title=Warning : modifications not saved +panel.templatebinding.dialog.saveorignore=Do you want to save modifications for the TemplateBinding defined here ? +panel.templatebinding.dialog.saveorignore.button.save=Save +panel.templatebinding.dialog.saveorignore.button.ignore=Ignore + +# TemplateParameter Panel +panel.templateparameter.button.save=Save +panel.templateparameter.button.save.tooltip=Save Cpp TemplateParameter informations + +panel.templateparameter.button.cancel=Cancel +panel.templateparameter.button.cancel.tooltip=Ignore modifications made since last save action + +panel.templateparameter.dialog.saveorignore.title=Warning : modifications not saved +panel.templateparameter.dialog.saveorignore=Do you want to save modifications for the TemplateParameter defined here ? +panel.templateparameter.dialog.saveorignore.button.save=Save +panel.templateparameter.dialog.saveorignore.button.ignore=Ignore diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CommandSupport.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CommandSupport.java new file mode 100644 index 00000000000..ab69b52fd0d --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CommandSupport.java @@ -0,0 +1,81 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2010 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.cpp; + +import java.util.Collections; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.operations.IOperationHistory; +import org.eclipse.core.commands.operations.OperationHistoryFactory; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; +import org.eclipse.papyrus.infra.core.utils.EditorUtils; + +/** + * Utility function. Allow adaption to command stack + * + * @author ansgar + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public class CommandSupport +{ + /** + * Execute the passed Runnable within a command + * + * @param label + * @param command + */ + public static void exec(String label, final Runnable command) + { + TransactionalEditingDomain domain = EditorUtils.getTransactionalEditingDomain(); + IOperationHistory history = OperationHistoryFactory.getOperationHistory(); + try { + history.execute(new AbstractTransactionalCommand(domain, label, Collections.EMPTY_LIST) { + @Override + public CommandResult doExecuteWithResult(IProgressMonitor dummy, IAdaptable info) { + command.run(); + return CommandResult.newOKCommandResult(); + } + }, null, null); + } catch (ExecutionException e) { + e.printStackTrace(); + } + } + + /** + * Execute the passed Runnable within a command + * + * @param label + * @param command + */ + public static void exec(TransactionalEditingDomain domain, String label, final Runnable command) + { + // do works, undo does not (but is selectable in Papyrus Model explorer) + IOperationHistory history = OperationHistoryFactory.getOperationHistory(); + try { + history.execute(new AbstractTransactionalCommand(domain, label, Collections.EMPTY_LIST) { + @Override + public CommandResult doExecuteWithResult(IProgressMonitor dummy, IAdaptable info) { + command.run(); + return CommandResult.newOKCommandResult(); + } + }, null, null); + } catch (ExecutionException e) { + e.printStackTrace(); + } + } + +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CppPanelView.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CppPanelView.java new file mode 100644 index 00000000000..677adbf80db --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/cpp/CppPanelView.java @@ -0,0 +1,91 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.cpp; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.papyrus.infra.emf.utils.EMFHelper; +import org.eclipse.papyrus.views.panels.CppAbstractPanel; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.uml2.uml.Element; + + +/** + * This class extends ViewPart. This class draws the Accord/Cpp + * panel in the Modeling Perspective. It also implements ISelectionListener in order to know which element is selected + * in the workbench. In fact, the content of the view changes depending on the + * type of the element selected + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public class CppPanelView extends AbstractCppPanelView { + + /** + * Creates the new panel, when switching UI. + *

    + * This class should be overloaded when working with RSA or other tools, using a new PanelFactory + * + * @param parent + * the parent of the new panel + * @param style + * the SWT style of this panel + * @param element + * the element for which the panel is created + * @return the newly created panel + */ + @Override + protected CppAbstractPanel createPanel(Composite parent, int style, + Element element) { + return org.eclipse.papyrus.views.panels.PanelFactory.eINSTANCE + .createPanel(parent, 0, currentTarget); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, + * org.eclipse.jface.viewers.ISelection) + */ + @Override + public void selectionChanged(IWorkbenchPart part, ISelection selection) { + + IStructuredSelection sSelection = null; + if (selection instanceof IStructuredSelection) { + sSelection = (IStructuredSelection) selection; + } + + // exclude case of an empty selection which is not a Tree selection, since changing views provokes an + // empty selection (selection gets lost, although same element remains selected) + if ((selection != null) && (sSelection != null) && sSelection.isEmpty()) { + return; + } + + // No available selection: switch to default panel + if ((sSelection == null) || (sSelection.size() != 1)) { + currentTarget = null; + switchUI(); + return; + } + + // Retrieve selected object + EObject currentObject = EMFHelper.getEObject(sSelection.getFirstElement()); + + if (currentObject instanceof Element) { + if (currentTarget != currentObject) { + currentTarget = currentObject; + switchUI(); + } + } + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/listeners/UMLElementPanelListener.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/listeners/UMLElementPanelListener.java new file mode 100644 index 00000000000..6c7f1b59a6c --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/listeners/UMLElementPanelListener.java @@ -0,0 +1,90 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ +package org.eclipse.papyrus.views.listeners; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.papyrus.views.panels.CppAbstractPanel; + + + +/** + * Listener for a uml element, for a given AccordCppAbstractPanel. + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public class UMLElementPanelListener implements Adapter { + + /** element listened */ + private Notifier target; + + /** panel that listens to this element */ + protected CppAbstractPanel panel; + + /** + * Creates a new UMLElementListener for the given panel. + * + * @param panel + * the panel that describes this element + */ + public UMLElementPanelListener(CppAbstractPanel panel) { + this.panel = panel; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification) + */ + @Override + public void notifyChanged(Notification notification) { + if (notification.getEventType() != Notification.REMOVING_ADAPTER) { + panel.reset(); // equivalent to a refresh + } + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.emf.common.notify.Adapter#getTarget() + */ + @Override + public Notifier getTarget() { + return this.target; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.emf.common.notify.Adapter#setTarget(org.eclipse.emf.common.notify.Notifier) + */ + @Override + public void setTarget(Notifier newTarget) { + this.target = newTarget; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.emf.common.notify.Adapter#isAdapterForType(java.lang.Object) + */ + @Override + public boolean isAdapterForType(Object type) { + Class class_ = target.getClass(); + // if class is not null + if (class_ != null) { + return class_.equals(type); + } + // default case: it is not an adapter + return false; + } +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppAbstractPanel.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppAbstractPanel.java new file mode 100644 index 00000000000..7a7ee2cbaba --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppAbstractPanel.java @@ -0,0 +1,447 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.panels; + +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.text.Document; +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.source.SourceViewer; +import org.eclipse.papyrus.views.cpp.Activator; +import org.eclipse.papyrus.views.listeners.UMLElementPanelListener; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.layout.FormLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Group; +import org.eclipse.uml2.uml.Element; + + +/** + * @deprecated This view will be replaced by a XWT view for the C++ profile + */ +@Deprecated +public abstract class CppAbstractPanel extends Composite { + + static final Font pluginFont = new Font(null, "Bitstream Vera Sans Mono", 10, SWT.NORMAL); + + public static final int H_SPACE = 10; + + // string representing the ID of the language + // this is the string contained in the language attribute of Activity + protected static final String C_CPP_ID = "C/C++"; //$NON-NLS-1$ + + protected static final String CPP_ID = "C++"; //$NON-NLS-1$ + + protected static final String C_ID = "C"; //$NON-NLS-1$ + + // CppInclude text area + protected Button buttonSave; + + protected Button buttonCancel; + + /** Listener for modifications on the UML element */ + protected UMLElementPanelListener umlListener = null; + + public CppAbstractPanel(Composite parent, int style) { + + super(parent, style); + this.setLayout(new FormLayout()); + FormData layoutData = new FormData(); + layoutData.top = new FormAttachment(0); + layoutData.bottom = new FormAttachment(100); + layoutData.left = new FormAttachment(0); + layoutData.right = new FormAttachment(100); + this.setLayoutData(layoutData); + this.setBackground(parent.getBackground()); + this.setVisible(true); + } + + public abstract Control createContent(); + + + // ///////////////////////////////////////////////////////////////////// + // Following method are used to create text area w/o coloration + // ///////////////////////////////////////////////////////////////////// + // /** + // * + // */ + // protected FastPartitioner createPartitioner() { + // FastPartitioner pluginPartitioner = new FastPartitioner( + // new CPartitionScanner(), new String[] { + // CPartitionScanner.C_SINGLE_LINE_COMMENT, + // CPartitionScanner.C_MULTILINE_COMMENT, + // CPartitionScanner.C_STRING + // } + // ); + // + // return pluginPartitioner; + // } + + + /** + * Create a group for a text area + * + * @param textArea + * parent composite + * @param name + * of the group + * @param t_previous + * attached to top border + * @param l_previous + * attached to left border + * @param toRight + * should group reach right border of parent + * @param height + * of text in percent of group size + * @param width + * of text in percent of group size + * @param toBottom + * should group reach bottom of parent + * @return new Group + */ + protected Group createGroup( + Composite textArea + , String name + , Control t_previous + , Control l_previous + , boolean toRight + , int height + , int width + , boolean toBottom) { + + Group groupBody = new Group(textArea, SWT.NONE); + + groupBody.setBackground(textArea.getBackground()); + groupBody.setLayout(new FormLayout()); + groupBody.setText(" " + name + " "); //$NON-NLS-1$ //$NON-NLS-2$ + groupBody.setFont(Activator.VIEW_FONT); + + FormData data = new FormData(); + if (t_previous != null) { + data.top = new FormAttachment(t_previous, H_SPACE); + } + + if (l_previous != null) { + data.left = new FormAttachment(l_previous, H_SPACE); + } + + if (data.top == null) { + data.top = new FormAttachment(0, H_SPACE); + } + + if (data.left == null) { + data.left = new FormAttachment(0, H_SPACE); + } + + if (toBottom) { + data.bottom = new FormAttachment(100, -H_SPACE); + } else if (height != 0) { + data.bottom = new FormAttachment(height); + } + + if (toRight) { + data.right = new FormAttachment(100, -H_SPACE); + } else { + data.right = new FormAttachment(width, 0); + } + + groupBody.setLayoutData(data); + return groupBody; + } + + /** + * Create a simple viewer without coloration + * + * @param doc + * @param group + * @return + */ + protected SourceViewer createViewer(IDocument doc, Group group) { + + SourceViewer viewer = + new SourceViewer(group, null, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); + + viewer.setDocument(doc); + + viewer.getTextWidget().setLayout(new FormLayout()); + FormData viewerData = new FormData(); + viewerData.height = 20; + viewerData.top = new FormAttachment(0); + viewerData.bottom = new FormAttachment(100); + viewerData.left = new FormAttachment(0); + viewerData.right = new FormAttachment(100); + viewer.getTextWidget().setLayoutData(viewerData); + + return viewer; + } + + /** + * + * @param doc + * @param group + * @return + */ + protected SourceViewer createViewerC(IDocument doc, Group group) { + return createViewer(doc, group); + } + + /** + * Create a simple document + * + * @return + */ + protected IDocument createDocument() { + IDocument doc = new Document(); + + return doc; + } + + /** + * Create a C/C++ (see cdt) document + * + * @return + */ + protected IDocument createDocumentC() { + return createDocument(); + } + + // ///////////////////////////////////////////////////////////////////// + + /** + * Create save and reset button in the top - right of the structure + * + */ + protected void createSaveResetButtons() { + + // /////////////////////////////////////////////////////////////////////// + // Create a composite that contain the "Save/Cancel" buttons + // /////////////////////////////////////////////////////////////////////// + + buttonSave = new Button(this, SWT.PUSH); + buttonSave.setImage(Activator.getImage(Activator.SAVE_IMAGE)); + buttonSave.setToolTipText(Activator.getResourceString("panel.class.button.save.tooltip")); //$NON-NLS-1$ + buttonSave.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent arg0) { + save(); + } + }); + + buttonCancel = new Button(this, SWT.PUSH); + buttonCancel.setImage(Activator.getImage(Activator.UNDO_IMAGE)); + buttonCancel.setToolTipText(Activator.getResourceString("panel.class.button.cancel.tooltip")); //$NON-NLS-1$ + buttonCancel.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent arg0) { + reset(); + } + }); + + FormData dataC = new FormData(); + dataC.right = new FormAttachment(100, -H_SPACE); + dataC.top = new FormAttachment(0, H_SPACE); + buttonCancel.setLayoutData(dataC); + + FormData dataS = new FormData(); + dataS.right = new FormAttachment(buttonCancel, -H_SPACE); + dataS.top = new FormAttachment(0, H_SPACE); + buttonSave.setLayoutData(dataS); + } + + /** + * Create new button + * + * @param name + * of the button + * @param parent + * composite that owns the button + * @param previous + * structure on which button is left attached + * @return the newly created button + */ + protected Button createButton(String name, Composite parent, Button previous) { + Button newButton = new Button(parent, SWT.CHECK); + + newButton.setBackground(parent.getBackground()); + newButton.setText(name); + FormData data = new FormData(); + + if (previous == null) { + data.left = new FormAttachment(0, H_SPACE); + } else { + data.left = new FormAttachment(previous, H_SPACE); + } + + data.top = new FormAttachment(0, H_SPACE); + newButton.setLayoutData(data); + + return newButton; + } + + /** + * Selection listener that match button status and a particular stereotype + * + * @param button + * @param stereotypeName + */ + protected void addStereotypeSelectionListener(final Button button, final String stereotypeName) { + + button.addSelectionListener( + new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + + updateModel(); + refreshPanel(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + } + ); + } + + /** + * Action executed just after the panel is created for the specific element. + */ + public void entryAction() { + reset(); + } + + /** + * Action executed just before moving to the new element. + */ + public void exitAction() { + boolean modelChanged = false; + + // check if model was modified (read only action) + modelChanged = checkModifications(); + + // model has change, must go in a write transaction => save + if (modelChanged) { + MessageDialog dialog = new MessageDialog( + Display.getCurrent().getActiveShell(), + Activator.getResourceString("panel.property.dialog.saveorignore.title"), //$NON-NLS-1$ + Activator.getImage(Activator.WARNING_IMAGE), + Activator.getResourceString("panel.property.dialog.saveorignore"), //$NON-NLS-1$ + 0, + new String[] { + Activator.getResourceString("panel.property.dialog.saveorignore.button.save"), //$NON-NLS-1$ + Activator.getResourceString("panel.property.dialog.saveorignore.button.ignore") }, //$NON-NLS-1$ + 0); + dialog.open(); + if (dialog.getReturnCode() == 0) { // saveButton pressed + save(); + } + } + } + + /** + * Check if the content of the panel has modification against the corresponding UML element. + * + * @return true if the panel has modification against the model + */ + public abstract boolean checkModifications(); + + /** + * Action executed when save button is pressed + */ + public abstract void save(); + + /** + * Action executed when reset button is pressed + */ + public void reset() { + boolean modelValid = true; + modelValid = isModelValid(); + if (!modelValid) { + updateModel(); + } + refreshPanel(); + } + + /** + * Refresh panel + */ + protected abstract void refreshPanel(); + + /** + * Makes the model coherent with the AccordCpp Methodology + */ + protected void updateModel() { + } + + /** + * Check if model is coherent with the AccordCpp Methodology + * + * @return true if the model is coherent with the AccordCpp Methodology + */ + protected boolean isModelValid() { + return true; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.swt.widgets.Widget#dispose() + */ + @Override + public void dispose() { + if (getSelectedElement() != null && umlListener != null) { + getSelectedElement().eAdapters().remove(umlListener); + } + super.dispose(); + } + + /** + * Returns the selected element + *

    + * Warning: it can be null + * + * @return the selected element + */ + public abstract Element getSelectedElement(); + + /** + * Sets the new selected element + * + * @param newElement + * the new selected element + */ + public void setSelectedElement(Element newElement) { + if (newElement != null && umlListener != null) { + newElement.eAdapters().add(umlListener); + } + } + + protected static void openInformation(final String title, final String message) + { + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + MessageDialog.openInformation(Display.getCurrent().getActiveShell(), title, message); + } + }); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppBehaviorPanel.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppBehaviorPanel.java new file mode 100644 index 00000000000..00a143d0f99 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppBehaviorPanel.java @@ -0,0 +1,275 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.panels; + +import org.eclipse.jface.text.IDocument; +import org.eclipse.papyrus.C_Cpp.Virtual; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.papyrus.views.cpp.CommandSupport; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.OpaqueBehavior; + + +/** + * Panel displayed when an Operation is selected + * + * TODO: instead of keeping isAbstract and pureVirtual Stereotype synchronized, pure virtual + * could be removed from the panel + * @deprecated This view will be replaced by a XWT view for the C++ profile + */ +@Deprecated +public class CppBehaviorPanel extends CppAbstractPanel { + + private Group groupBody; + + // document used by the viewer + private IDocument docBody; + + private Behavior selectedBehavior; + + Element selectedEOwner; + + protected String origBody; + + public CppBehaviorPanel(Composite parent, int style) { + super(parent, style); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() + */ + @Override + public Behavior getSelectedElement() { + return selectedBehavior; + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) + */ + @Override + public void setSelectedElement(Element newElement) { + super.setSelectedElement(newElement); + if (newElement instanceof Behavior) { + this.selectedBehavior = (Behavior) newElement; + // Retrieve the owner + this.selectedEOwner = selectedBehavior.getOwner(); + } + else { + throw new RuntimeException("bad selection: " + newElement + " should be an uml2 Behavior"); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() + */ + @Override + public Control createContent() + { + // ///////////////////////////////////////////////////////////////////// + // Create save reset buttons with superclass method + // ///////////////////////////////////////////////////////////////////// + createSaveResetButtons(); + + // ///////////////////////////////////////////////////////////////////// + // Constructor init list + // ///////////////////////////////////////////////////////////////////// + + // ///////////////////////////////////////////////////////////////////// + // Body + // ///////////////////////////////////////////////////////////////////// + + docBody = createDocumentC(); + groupBody = createGroup( + this, + "Method body", //$NON-NLS-1$ + buttonSave, + null, + true, + 0, + 0, + true); + // Use CDT CEditor coloration + createViewerC(docBody, groupBody); + + // ///////////////////////////////////////////////////////////////////// + + return this; + } + + + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#save() + */ + @Override + public void save() + { + if (selectedBehavior == null) { + /* Log.debug("saveBody : selectedOperation is null"); */ + } else { + CommandSupport.exec("C++ behavior save", new Runnable() { + + @Override + public void run() { + // Body + setCppBody(selectedBehavior, docBody.get()); + origBody = docBody.get(); + } + }); + } + + } + + public static String getCppBody(Behavior behavior) + { + if (behavior instanceof OpaqueBehavior) { + OpaqueBehavior ob = (OpaqueBehavior) behavior; + int i = 0; + for (String language : ob.getLanguages()) { + if (language.equals(C_CPP_ID)) { + return ob.getBodies().get(i); + } + else if (language.equals(CPP_ID)) { + return ob.getBodies().get(i); + } + else if (language.equals(C_ID)) { + return ob.getBodies().get(i); + } + i++; + } + } + return ""; + } + + public static void setCppBody(Behavior behavior, String body) + { + boolean done = false; + if (behavior instanceof OpaqueBehavior) { + OpaqueBehavior ob = (OpaqueBehavior) behavior; + int i = 0; + for (String language : ob.getLanguages()) { + if (language.equals(C_CPP_ID) || language.equals(CPP_ID) || language.equals(C_ID)) { + done = true; + ob.getBodies().set(i, body); + break; + } + i++; + } + if (!done) { + ob.getLanguages().add(C_CPP_ID); + ob.getBodies().add(body); + } + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() + */ + @Override + public void entryAction() { + super.entryAction(); + reset(); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#exitAction() + */ + @Override + public void exitAction() { + // do exit action, only if the owner is a class + if (selectedEOwner instanceof Class) { + super.exitAction(); + } + } + + @Override + public boolean checkModifications() { + if (!(docBody.get().equals(origBody))) { + return true; + } + return false; + } + + @Override + protected void refreshPanel() { + if (selectedBehavior == null) { + /* Log.debug("resetBody : selectedOperation is null"); */ + } + else { + String body = getCppBody(selectedBehavior); + origBody = body; + docBody.set(body); + } + } + + @Override + protected boolean isModelValid() { + if (selectedBehavior == null) { + return true; + } + if (selectedEOwner instanceof Class) { + + if (selectedBehavior.isAbstract()) { + if (!StereotypeUtil.isApplied(selectedBehavior, Virtual.class)) { + return false; + } + } + } else { + // owner is interface + if (!selectedBehavior.isAbstract()) { + return false; + } + if (StereotypeUtil.isApplied(selectedBehavior, Virtual.class)) { + return false; + } + } + return true; + + } + + @Override + protected void updateModel() + { + CommandSupport.exec("C++ behavior save", new Runnable() { + + @Override + public void run() + { + if (selectedBehavior == null) { + return; + } + if (selectedEOwner instanceof Class) { + } + else { + selectedBehavior.setIsAbstract(true); + } + } + }); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppClassPanel.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppClassPanel.java new file mode 100644 index 00000000000..7d3d6c40d07 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppClassPanel.java @@ -0,0 +1,225 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.panels; + +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.source.SourceViewer; +import org.eclipse.papyrus.C_Cpp.Include; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.papyrus.views.cpp.CommandSupport; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.util.UMLUtil; + + + +/** + * Panel displayed when a Class is selected + * @deprecated This view will be replaced by a XWT view for the C++ profile + */ +@Deprecated +public class CppClassPanel extends CppAbstractPanel { + + // document used by the viewer for header include + private IDocument headerDocument; + + @SuppressWarnings("unused") + private SourceViewer headerViewer; + + private Group headerGroup; + + // document used by the viewer for body include + private IDocument bodyDocument; + + @SuppressWarnings("unused") + private SourceViewer bodyViewer; + + private Group bodyGroup; + + // Current selection + private Class selectedClass; + + protected String origHeader; + + protected String origBody; + + public CppClassPanel(Composite parent, int style) { + super(parent, style); + } + + /** + * @return Returns the selectedOperation. + */ + @Override + public org.eclipse.uml2.uml.Class getSelectedElement() { + return selectedClass; + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Object) + */ + @Override + public void setSelectedElement(Element newElement) { + super.setSelectedElement(newElement); + if (newElement instanceof Class) { + this.selectedClass = (Class) newElement; + } + else { + throw new RuntimeException("bad selection: " + newElement + " should be an uml2 Class"); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContentHI() + */ + @Override + public Control createContent() { + + // ///////////////////////////////////////////////////////////////////// + // Create save reset buttons with superclass method + // ///////////////////////////////////////////////////////////////////// + createSaveResetButtons(); + + // /////////////////////////////////////////////////////////////////////// + // Create a Group for the header include declarations + // /////////////////////////////////////////////////////////////////////// + headerDocument = createDocumentC(); + headerGroup = createGroup( + this + , "Header include declarations" + , buttonSave + , null + , true + , 50 + , 0 + , false); + // Use CDT CEditor coloration + headerViewer = createViewerC(headerDocument, headerGroup); + // /////////////////////////////////////////////////////////////////////// + // Create a Group for the body include declarations + // /////////////////////////////////////////////////////////////////////// + bodyDocument = createDocumentC(); + bodyGroup = createGroup( + this + , "Body include declarations" + , headerGroup + , null + , true + , 0 + , 0 + , true); + // Use CDT CEditor coloration + bodyViewer = createViewerC(bodyDocument, bodyGroup); + + // /////////////////////////////////////////////////////////////////////// + + return this; + } + + /** + * Saves the include declarations for a 'Class' + */ + @Override + public void save() + { + if (selectedClass == null) { + /* Log.debug("saveBody : selectedOperation is null"); */ + } else { + CommandSupport.exec("C++ header/body save", new Runnable() { + + @Override + public void run() { + if (headerDocument.get().equals("") + && bodyDocument.get().equals("")) { + StereotypeUtil.unapply(selectedClass, Include.class); + } else { + Include cppInclude = StereotypeUtil.applyApp(selectedClass, Include.class); + cppInclude.setHeader(headerDocument.get()); + origHeader = headerDocument.get(); + cppInclude.setBody(bodyDocument.get()); + origBody = bodyDocument.get(); + } + } + }); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#entryAction() + */ + @Override + public void entryAction() { + super.entryAction(); + reset(); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#checkModifications() + */ + @Override + public boolean checkModifications() { + // String headerInModel = ""; + // String bodyInModel = ""; + + /* + Include cppInclude = UMLUtil.getStereotypeApplication(selectedClass, Include.class); + if (cppInclude != null) { + headerInModel = cppInclude.getHeader(); + bodyInModel = cppInclude.getBody(); + } + */ + + boolean headerChanged = !headerDocument.get().equals(origHeader); + boolean bodyChanged = !bodyDocument.get().equals(origBody); + + return (headerChanged | bodyChanged); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() + */ + @Override + protected void refreshPanel() { + if (selectedClass == null) { + } + else { + Include cppInclude = UMLUtil.getStereotypeApplication(selectedClass, Include.class); + if (cppInclude != null) { + // get the text in the tagged value + String currentHI = cppInclude.getHeader(); + origHeader = currentHI; + headerDocument.set(currentHI); + String currentBI = cppInclude.getBody(); + origBody = currentBI; + bodyDocument.set(currentBI); + } else { + origHeader = ""; //$NON-NLS-1$ + headerDocument.set(""); //$NON-NLS-1$ + origBody = ""; //$NON-NLS-1$ + bodyDocument.set(""); //$NON-NLS-1$ + } + } + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppDefaultPanel.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppDefaultPanel.java new file mode 100644 index 00000000000..2d0c1419e51 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppDefaultPanel.java @@ -0,0 +1,104 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ +package org.eclipse.papyrus.views.panels; + +import org.eclipse.papyrus.views.cpp.Activator; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.uml2.uml.Element; + + +/** + * Default panel when selection is not relevant. + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public class CppDefaultPanel extends CppAbstractPanel { + + /** Label used to display text */ + private Label label; + + /** + * Constructs a new instance of this class given its parent and a style + * value describing its behavior and appearance. + * + * @param parent + * the composite parent of this element + * @param style + * the style for this panel + * @see SWT + */ + public CppDefaultPanel(Composite parent, int style) { + super(parent, style); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#createContent() + */ + @Override + public Control createContent() { + GridLayout layout = new GridLayout(); + layout.numColumns = 2; + this.setLayout(layout); + + label = new Label(this, SWT.NONE); + label.setText(Activator.getResourceString("panel.default.text")); + GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL); + gridData.horizontalSpan = 2; + label.setLayoutData(gridData); + + return null; + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#save() + */ + @Override + public void save() { + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() + */ + @Override + public Element getSelectedElement() { + return null; + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(org.eclipse.uml2.uml.Element) + */ + @Override + public void setSelectedElement(Element newElement) { + } + + @Override + public boolean checkModifications() { + return false; + } + + @Override + protected void refreshPanel() { + + } +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppGeneralizationPanel.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppGeneralizationPanel.java new file mode 100644 index 00000000000..40fc2e0a61e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppGeneralizationPanel.java @@ -0,0 +1,268 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.panels; + +import org.eclipse.papyrus.C_Cpp.Visibility; +import org.eclipse.papyrus.views.cpp.Activator; +import org.eclipse.papyrus.views.cpp.CommandSupport; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.layout.RowLayout; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Generalization; +import org.eclipse.uml2.uml.util.UMLUtil; + + + +/** + * Panel displayed when a Generalization is selected + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public class CppGeneralizationPanel extends CppAbstractPanel { + + private static final String PROTECTED = "protected"; //$NON-NLS-1$ + + private static final String PUBLIC = "public"; //$NON-NLS-1$ + + private static final String PRIVATE = "private"; //$NON-NLS-1$ + + /** Combo box to display visibility */ + private Combo vPropCombo; + + /** current selected generalization */ + private Generalization selectedGeneralization; + + public CppGeneralizationPanel(Composite parent, int style) { + super(parent, style); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() + */ + @Override + public Generalization getSelectedElement() { + return selectedGeneralization; + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(org.eclipse.uml2.uml.Element) + */ + @Override + public void setSelectedElement(Element newElement) { + super.setSelectedElement(newElement); + if (newElement instanceof Generalization) { + this.selectedGeneralization = (Generalization) newElement; + } else { + throw new RuntimeException("bad selection: " + newElement + " should be a UML2 generalization"); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() + */ + @Override + public Control createContent() + { + // creates a composite + + GridLayout gridLayout = new GridLayout(); + gridLayout.numColumns = 1; + this.setLayout(gridLayout); + + // Contains checkboxes associated to stereotypes + Group qualifierGroup = new Group(this, 0); + qualifierGroup.setLayout(new RowLayout()); + qualifierGroup.setText("Generalization visibility"); + + // Visibility properties combo box + vPropCombo = new Combo(qualifierGroup, SWT.DROP_DOWN | SWT.READ_ONLY); + String items[] = { PUBLIC, PROTECTED, PRIVATE }; + vPropCombo.setItems(items); + vPropCombo.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent event) { + checkVirtual(); + } + }); + + this.pack(); + return this; + } + + /** + * Called when the visibility qualifier is modified + */ + public void checkVirtual() + { + // Treat the generalization + int comboSelected = vPropCombo.getSelectionIndex(); + + final String visibilityVal; + switch (comboSelected) { + case 0: /* public */ + visibilityVal = PUBLIC; + break; + case 1: /* protected */ + visibilityVal = PROTECTED; + break; + case 2: /* private */ + visibilityVal = PRIVATE; + break; + default: /* public */ + visibilityVal = PUBLIC; + break; + } + final Visibility visibility = UMLUtil.getStereotypeApplication(selectedGeneralization, Visibility.class); + if (visibility != null) { + String vis = visibility.getValue(); + if (!vis.equals(visibilityVal)) { + CommandSupport.exec("Set visibility for generalization", new Runnable() { + + @Override + public void run() { + visibility.setValue(visibilityVal); + } + }); + } + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() + */ + @Override + public void entryAction() { + super.entryAction(); + reset(); + } + + // Required by super class + @Override + public void save() { + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#checkModifications() + */ + @Override + public boolean checkModifications() { + // no specific stereotypes tagged value to save + return false; + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() + */ + @Override + protected void refreshPanel() + { + if (selectedGeneralization != null) { + final Visibility visibility = UMLUtil.getStereotypeApplication(selectedGeneralization, Visibility.class); + if (visibility != null) { + String vis = visibility.getValue(); + + if (vis.equals(PUBLIC)) { + vPropCombo.select(0); + } else if (vis.equals(PROTECTED)) { + vPropCombo.select(1); + } else if (vis.equals(PRIVATE)) { + vPropCombo.select(2); + } else { + Activator.log(new RuntimeException("Generalization: should never happen, model should be corrected before")); + vPropCombo.select(0); + } + } else { + // no visibility applied, defaults to public + vPropCombo.select(0); + } + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#isModelValid() + */ + @Override + protected boolean isModelValid() + { + if (selectedGeneralization == null) { + return true; + } + + final Visibility visibility = UMLUtil.getStereotypeApplication(selectedGeneralization, Visibility.class); + if (visibility != null) { + String vis = visibility.getValue(); + + if ((vis.equals(PUBLIC) || vis.equals(PROTECTED)) || vis.equals(PRIVATE)) { + return true; + } + else { + return false; + } + } + else { + return false; + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#updateModel() + */ + @Override + protected void updateModel() { + super.updateModel(); + if (selectedGeneralization == null) { + return; + } + + final Visibility visibility = UMLUtil.getStereotypeApplication(selectedGeneralization, Visibility.class); + if (visibility != null) { + if (!isModelValid()) { + CommandSupport.exec("Correct illegal visibility value", new Runnable() { + + @Override + public void run() { + visibility.setValue(PUBLIC); + } + }); + } + } + else { + // good idea? apply value, even if visibility unspecified + // GenUtils.setStereotype (selectedGeneralization, Visibility.class, true); + // GenUtils.setTaggedValue (selectedGeneralization, Visibility.class, "value", "public"); + } + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppOperationPanel.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppOperationPanel.java new file mode 100644 index 00000000000..25bfd8992ec --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppOperationPanel.java @@ -0,0 +1,647 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.panels; + +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.source.ISourceViewer; +import org.eclipse.papyrus.C_Cpp.Const; +import org.eclipse.papyrus.C_Cpp.ConstInit; +import org.eclipse.papyrus.C_Cpp.Friend; +import org.eclipse.papyrus.C_Cpp.Inline; +import org.eclipse.papyrus.C_Cpp.Virtual; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.papyrus.views.cpp.CommandSupport; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.OpaqueBehavior; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.profile.standard.Create; +import org.eclipse.uml2.uml.profile.standard.Destroy; +import org.eclipse.uml2.uml.util.UMLUtil; + + +/** + * Panel displayed when an Operation is selected + * + * TODO: instead of keeping isAbstract and pureVirtual Stereotype synchronized, pure virtual + * could be removed from the panel + * @deprecated This view will be replaced by a XWT view for the C++ profile + */ +@Deprecated +public class CppOperationPanel extends CppAbstractPanel { + + @SuppressWarnings("unused") + private ISourceViewer viewerBody; + + @SuppressWarnings("unused") + private ISourceViewer viewerConstInit; + + private Group groupBody; + + private Group groupCInit; + + // document used by the viewer + private IDocument docBody; + + private IDocument docConstInit; + + private Button isStatic; + + private Button isInline; + + private Button isConst; + + private Button isFriend; + + private Button isCreate; + + private Button isDestroy; + + private Combo vPropCombo; + + private Operation selectedOperation; + + Element selectedEOwner; + + protected String origBody; + + public CppOperationPanel(Composite parent, int style) { + super(parent, style); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() + */ + @Override + public Operation getSelectedElement() { + return selectedOperation; + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) + */ + @Override + public void setSelectedElement(Element newElement) { + super.setSelectedElement(newElement); + if (newElement instanceof Operation) { + this.selectedOperation = (Operation) newElement; + // Retrieve the owner + this.selectedEOwner = selectedOperation.getOwner(); + } + else { + throw new RuntimeException("bad selection: " + newElement + " should be an uml2 Operation"); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() + */ + @Override + public Control createContent() + { + // ///////////////////////////////////////////////////////////////////// + // Create checkboxes + // ///////////////////////////////////////////////////////////////////// + isStatic = createButton("isStatic", this, null); + isInline = createButton("isInline", this, isStatic); + isConst = createButton("isConst", this, isInline); + isFriend = createButton("isFriend", this, isConst); + isCreate = createButton("isCreate", this, isFriend); + isDestroy = createButton("isDestroy", this, isCreate); + + // ///////////////////////////////////////////////////////////////////// + // Add checkboxes listeners + // ///////////////////////////////////////////////////////////////////// + isStatic.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + CommandSupport.exec("C++ operation save", new Runnable() { + + @Override + public void run() { + updateModel(); + } + }); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + addStereotypeSelectionListener(isInline, "Inline"); + addStereotypeSelectionListener(isConst, "Const"); + addStereotypeSelectionListener(isFriend, "Friend"); + addStereotypeSelectionListener(isCreate, "Create"); + addStereotypeSelectionListener(isDestroy, "Destroy"); + + // ///////////////////////////////////////////////////////////////////// + // Virtual properties combo box + // ///////////////////////////////////////////////////////////////////// + vPropCombo = new Combo(this, SWT.DROP_DOWN | SWT.READ_ONLY); + String items[] = { "not virtual", "virtual", "pure virtual" }; + vPropCombo.setItems(items); + vPropCombo.setText("Virtual operation qualifiers"); + vPropCombo.addSelectionListener( + new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent event) { + checkVirtual(); + reset(); + } + }); + + FormData data = new FormData(); + data.left = new FormAttachment(isDestroy, H_SPACE); + data.top = new FormAttachment(0, H_SPACE); + vPropCombo.setLayoutData(data); + + // ///////////////////////////////////////////////////////////////////// + // Create save reset buttons with superclass method + // ///////////////////////////////////////////////////////////////////// + createSaveResetButtons(); + + // ///////////////////////////////////////////////////////////////////// + // Constructor init list + // ///////////////////////////////////////////////////////////////////// + docConstInit = createDocument(); + groupCInit = createGroup( + this + , "Constructor initialisation list" + , isStatic + , null + , true + , 0 + , 0 + , false); + + // Use CDT CEditor coloration + viewerConstInit = createViewer(docConstInit, groupCInit); + + // ///////////////////////////////////////////////////////////////////// + // Body + // ///////////////////////////////////////////////////////////////////// + + docBody = createDocumentC(); + groupBody = createGroup( + this + , "Method body" + , groupCInit + , null + , true + , 0 + , 0 + , true); + // Use CDT CEditor coloration + viewerBody = createViewerC(docBody, groupBody); + + // ///////////////////////////////////////////////////////////////////// + + return this; + } + + + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#save() + */ + @Override + public void save() + { + if (selectedOperation == null) { + /* Log.debug("saveBody : selectedOperation is null"); */ + } else { + CommandSupport.exec("C++ operation save", new Runnable() { + + @Override + public void run() { + String newConstInit = docConstInit.get(); + if (newConstInit.equals("")) { //$NON-NLS-1$ + StereotypeUtil.unapply(selectedOperation, ConstInit.class); + } else { + ConstInit cppConstInit = + StereotypeUtil.applyApp(selectedOperation, ConstInit.class); + cppConstInit.setInitialisation(newConstInit); + } + + // Body + setCppBody(selectedOperation, docBody.get()); + origBody = docBody.get(); + } + }); + } + + } + + public static String getCppBody(Operation operation) + { + // get the body of the operation + for (Behavior behavior : operation.getMethods()) { + if (behavior instanceof OpaqueBehavior) { + OpaqueBehavior ob = (OpaqueBehavior) behavior; + int i = 0; + for (String language : ob.getLanguages()) { + if (language.equals(C_CPP_ID)) { + return ob.getBodies().get(i); + } + else if (language.equals(CPP_ID)) { + return ob.getBodies().get(i); + } + else if (language.equals(C_ID)) { + return ob.getBodies().get(i); + } + i++; + } + } + } + return ""; //$NON-NLS-1$ + } + + public static void setCppBody(Operation operation, String body) + { + boolean done = false; + for (Behavior behavior : operation.getMethods()) { + if (behavior instanceof OpaqueBehavior) { + OpaqueBehavior ob = (OpaqueBehavior) behavior; + int i = 0; + for (String language : ob.getLanguages()) { + if (language.equals(C_CPP_ID) || language.equals(CPP_ID) || language.equals(C_ID)) { + done = true; + ob.getBodies().set(i, body); + break; + } + i++; + } + } + if (done) { + break; + } + } + if (!done) { + OpaqueBehavior ob = (OpaqueBehavior) + operation.getClass_().createOwnedBehavior(operation.getName(), UMLPackage.eINSTANCE.getOpaqueBehavior()); + ob.getLanguages().add(C_CPP_ID); + ob.getBodies().add(body); + ob.setSpecification(operation); + } + + } + + /** + * Called when the static checkbox is modified + */ + protected void checkStatic() + { + boolean boxState = isStatic.getSelection(); + + selectedOperation.setIsStatic(boxState); + } + + /** + * Called when the inline checkbox is modified + */ + protected void checkInline() { + // get the text in the activity + boolean boxState = isInline.getSelection(); + + if (boxState != StereotypeUtil.isApplied(selectedOperation, Inline.class)) { + if (boxState) { + StereotypeUtil.apply(selectedOperation, Inline.class); + } + else { + StereotypeUtil.unapply(selectedOperation, Inline.class); + } + } + } + + /** + * Called when the const checkbox is modified + */ + protected void checkConst() { + + boolean boxState = isConst.getSelection(); + + if (boxState != StereotypeUtil.isApplied(selectedOperation, Const.class)) { + if (boxState) { + StereotypeUtil.apply(selectedOperation, Const.class); + } + else { + StereotypeUtil.unapply(selectedOperation, Const.class); + } + } + } + + /** + * Called when the friend checkbox is modified + */ + protected void checkFriend() { + + boolean boxState = isFriend.getSelection(); + + if (boxState != StereotypeUtil.isApplied(selectedOperation, Friend.class)) { + if (boxState) { + StereotypeUtil.apply(selectedOperation, Friend.class); + } + else { + StereotypeUtil.unapply(selectedOperation, Friend.class); + } + } + } + + /** + * Called when the create checkbox is modified + */ + protected void checkCreate() { + // get the text in the activity + boolean boxState = isCreate.getSelection(); + + if (boxState) { + StereotypeUtil.apply(selectedOperation, Create.class); + } + else { + StereotypeUtil.unapply(selectedOperation, ConstInit.class); + StereotypeUtil.unapply(selectedOperation, Create.class); + } + + groupCInit.setEnabled(boxState); + } + + /** + * Called when the destroy checkbox is modified + */ + protected void checkDestroy() { + // get the text in the activity + boolean boxState = isDestroy.getSelection(); + + if (boxState) { + StereotypeUtil.apply(selectedOperation, Destroy.class); + } + else { + StereotypeUtil.unapply(selectedOperation, Destroy.class); + } + } + + /** + * Called when the virtual qualifier is modified + */ + protected void checkVirtual() { + + // Treat the operation + int comboSelected = 2; + + // If owner is a class + if (selectedEOwner instanceof org.eclipse.uml2.uml.Class) { + comboSelected = vPropCombo.getSelectionIndex(); + } else { + // Assume this is an interface + comboSelected = 2; + } + + if (comboSelected == 0 /* not virtual */) { + + selectedOperation.setIsAbstract(false); + StereotypeUtil.unapply(selectedOperation, Virtual.class); + } + else if (comboSelected == 1 /* virtual */) { + + selectedOperation.setIsAbstract(false); + StereotypeUtil.apply(selectedOperation, Virtual.class); + } + else if (comboSelected == 2 /* pure virtual */) { + + selectedOperation.setIsAbstract(true); + StereotypeUtil.apply(selectedOperation, Virtual.class); + } + + // Treat the owner class + if (selectedEOwner instanceof Class) { + Class ownerCl = (Class) selectedEOwner; + + ownerCl.setIsAbstract(ownerCl.isAbstract()); + } // else nothing + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() + */ + @Override + public void entryAction() { + super.entryAction(); + reset(); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#exitAction() + */ + @Override + public void exitAction() { + // do exit action, only if the owner is a class + if (selectedEOwner instanceof Class) { + super.exitAction(); + } + } + + @Override + public boolean checkModifications() { + // check if ConstInit has changed + String valueConstInit = ""; //$NON-NLS-1$ + ConstInit constInit = UMLUtil.getStereotypeApplication(selectedOperation, ConstInit.class); + if (constInit != null) { + valueConstInit = constInit.getInitialisation(); + } + if (!docConstInit.get().equals(valueConstInit)) { + return true; + } + + // String methodBody = getCppBody(selectedOperation); + if (!(docBody.get().equals(origBody))) { + return true; + } + + return false; + } + + @Override + protected void refreshPanel() { + if (selectedOperation == null) { + /* Log.debug("resetBody : selectedOperation is null"); */ + } else { + + // get the text in the activity if parent is a class + if (selectedEOwner instanceof Class) { + + // This part is done for a class only + ConstInit constInit = UMLUtil.getStereotypeApplication(selectedOperation, ConstInit.class); + if (constInit != null) { + docConstInit.set(constInit.getInitialisation()); + } + + // Don't show this unless the operation is a constructor + if (isCreate.getSelection()) { + groupCInit.setEnabled(true); + } else { + docConstInit.set(""); //$NON-NLS-1$ + groupCInit.setEnabled(false); + } + + String body = getCppBody(selectedOperation); + origBody = body; + docBody.set(body); + + // Combo Box + if (selectedOperation.isAbstract()) { + vPropCombo.select(2); + // Nothing in body and body unavailable + docBody.set(""); //$NON-NLS-1$ + groupBody.setEnabled(false); + } + else { + if (StereotypeUtil.isApplied(selectedOperation, Virtual.class)) { + vPropCombo.select(1); + groupBody.setEnabled(true); + } + else { + vPropCombo.select(0); + groupBody.setEnabled(true); + } + } + + // Inline + if (StereotypeUtil.isApplied(selectedOperation, Inline.class)) { + isInline.setSelection(true); + } + + } + else { + // Don't show text areas nor buttons + groupBody.setVisible(false); + buttonSave.setVisible(false); + buttonCancel.setVisible(false); + + // Methods are virtual pure + vPropCombo.select(2); + vPropCombo.setEnabled(false); + + // Inline not visible + isInline.setVisible(false); + } + + isStatic.setSelection(selectedOperation.isStatic()); + isConst.setSelection(StereotypeUtil.isApplied(selectedOperation, Const.class)); + isFriend.setSelection(StereotypeUtil.isApplied(selectedOperation, Friend.class)); + isCreate.setSelection(StereotypeUtil.isApplied(selectedOperation, Create.class)); + isDestroy.setSelection(StereotypeUtil.isApplied(selectedOperation, Destroy.class)); + } + } + + @Override + protected boolean isModelValid() { + if (selectedOperation == null) { + return true; + } + if (selectedEOwner instanceof Class) { + + if (selectedOperation.isAbstract()) { + if (!StereotypeUtil.isApplied(selectedOperation, Virtual.class)) { + return false; + } + } + } else { + // owner is interface + if (!selectedOperation.isAbstract()) { + return false; + } + if (StereotypeUtil.isApplied(selectedOperation, Virtual.class)) { + return false; + } + } + return true; + + } + + @Override + protected void updateModel() + { + CommandSupport.exec("C++ operation save", new Runnable() { + + @Override + public void run() + { + // Check button changes + checkStatic(); + checkConst(); + checkCreate(); + checkDestroy(); + checkInline(); + checkFriend(); + + if (selectedOperation == null) { + return; + } + if (selectedEOwner instanceof Class) { + // toggle Stereotypes pure virtual if element is abstract + if (selectedOperation.isAbstract()) { + if (!StereotypeUtil.isApplied(selectedOperation, Virtual.class)) { + // selectedOperation.toggleStereotype("VirtualPure", true); + // selectedOperation.toggleStereotype("Virtual", false); + } else { + // selectedOperation.toggleStereotype("Virtual", false); + } + } + + // if element is abstract and has VirtualPure, set to Virtual only + if (!selectedOperation.isAbstract()) { + if (StereotypeUtil.isApplied(selectedOperation, Virtual.class)) { + // selectedOperation.toggleStereotype("VirtualPure", false); + // selectedOperation.toggleStereotype("Virtual", true); + } else { + // selectedOperation.toggleStereotype("VirtualPure", false); + // selectedOperation.toggleStereotype("Virtual", false); + } + } + } + else { + selectedOperation.setIsAbstract(true); + // selectedOperation.toggleStereotype("Virtual", false); + // selectedOperation.toggleStereotype("VirtualPure", true); + } + } + }); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPackagePanel.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPackagePanel.java new file mode 100644 index 00000000000..ef8b80141c4 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPackagePanel.java @@ -0,0 +1,183 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.panels; + +import org.eclipse.jface.text.IDocument; +import org.eclipse.papyrus.C_Cpp.Include; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.papyrus.views.cpp.CommandSupport; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.util.UMLUtil; + + +/** + * Panel displayed when a Package is selected + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public class CppPackagePanel extends CppAbstractPanel { + + // document used by the viewer for header include + private IDocument headerDocument; + + // private SourceViewer headerViewer; + private Group headerGroup; + + // Current selection + private Package selectedPackage; + + /** + * Default constructor + * + * @param parent + * the composite parent of this panel + * @param style + * the SWT style of this panel + */ + public CppPackagePanel(Composite parent, int style) { + super(parent, style); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() + */ + @Override + public org.eclipse.uml2.uml.Package getSelectedElement() { + return selectedPackage; + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) + */ + @Override + public void setSelectedElement(Element newElement) { + super.setSelectedElement(newElement); + if (newElement instanceof Package) { + this.selectedPackage = (Package) newElement; + } + else { + throw new RuntimeException("bad selection: " + newElement + " should be an uml2 Package"); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContentHI() + */ + @Override + public Control createContent() { + + // ///////////////////////////////////////////////////////////////////// + // Create a composite that contain the "Save/Cancel" buttons + // ///////////////////////////////////////////////////////////////////// + createSaveResetButtons(); + + // ///////////////////////////////////////////////////////////////////// + // Package header declaration + // ///////////////////////////////////////////////////////////////////// + headerDocument = createDocumentC(); + headerGroup = createGroup( + this + , "Header include declarations" + , buttonSave + , null + , true + , 0 + , 0 + , true); + // Use CDT CEditor coloration + // headerViewer + createViewerC(headerDocument, headerGroup); + + // ///////////////////////////////////////////////////////////////////// + return this; + } + + /** + * Saves the include declarations for a 'Package' + */ + @Override + public void save() + { + if (selectedPackage == null) { + /* Log.debug("saveBody : selectedPackage is null"); */ + } + else { + CommandSupport.exec("C++ package save", new Runnable() { + + @Override + public void run() + { + if (headerDocument.get().equals("")) { + StereotypeUtil.unapply(selectedPackage, Include.class); + } else { + Include cppInclude = StereotypeUtil.applyApp(selectedPackage, Include.class); + cppInclude.setHeader(headerDocument.get()); + } + } + }); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() + */ + @Override + protected void refreshPanel() { + if (selectedPackage != null) { + Include cppInclude = UMLUtil.getStereotypeApplication(selectedPackage, Include.class); + if (cppInclude != null) { + headerDocument.set(cppInclude.getHeader()); + } + else { + headerDocument.set(""); + } + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() + */ + @Override + public void entryAction() { + super.entryAction(); + reset(); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#checkModifications() + */ + @Override + public boolean checkModifications() { + String headerInModel = ""; + Include cppInclude = UMLUtil.getStereotypeApplication(selectedPackage, Include.class); + if (cppInclude != null) { + headerInModel = cppInclude.getHeader(); + } + return (!(headerDocument.get().equals(headerInModel))); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppParameterPanel.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppParameterPanel.java new file mode 100644 index 00000000000..15b1ff3bda2 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppParameterPanel.java @@ -0,0 +1,346 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.panels; + +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.source.SourceViewer; +import org.eclipse.papyrus.C_Cpp.Array; +import org.eclipse.papyrus.C_Cpp.Const; +import org.eclipse.papyrus.C_Cpp.Ptr; +import org.eclipse.papyrus.C_Cpp.Ref; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.papyrus.views.cpp.CommandSupport; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Parameter; + + +/** + * Panel displayed when a Parameter is selected + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public class CppParameterPanel extends CppAbstractPanel { + + private Button isConst; + + private Parameter selectedParameter; + + // document used by the viewer + private IDocument docPtr; + + private IDocument docRef; + + private IDocument docArray; + + private IDocument docDefault; + + @SuppressWarnings("unused") + private SourceViewer viewerPtr; + + @SuppressWarnings("unused") + private SourceViewer viewerRef; + + @SuppressWarnings("unused") + private SourceViewer viewerArray; + + @SuppressWarnings("unused") + private SourceViewer viewerDefault; + + private Group groupPtr; + + private Group groupRef; + + private Group groupArray; + + private Group groupDefault; + + public CppParameterPanel(Composite parent, int style) { + super(parent, style); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordAbstractPanel#getSelectedElement() + */ + @Override + public org.eclipse.uml2.uml.Parameter getSelectedElement() { + return selectedParameter; + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordAbstractPanel#setSelectedElement(java.lang.Element) + */ + @Override + public void setSelectedElement(Element newElement) { + super.setSelectedElement(newElement); + if (newElement instanceof Parameter) { + this.selectedParameter = (Parameter) newElement; + } + else { + throw new RuntimeException("bad selection: " + newElement + " should be an uml2 Parameter"); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() + */ + @Override + public Control createContent() { + // ///////////////////////////////////////////////////////////////////// + // Create save reset buttons with superclass method + // ///////////////////////////////////////////////////////////////////// + createSaveResetButtons(); + + // ///////////////////////////////////////////////////////////////////// + // Create checkboxes + // ///////////////////////////////////////////////////////////////////// + isConst = createButton("isConst", this, null); + + // ///////////////////////////////////////////////////////////////////// + // Add checkboxes listeners + // ///////////////////////////////////////////////////////////////////// + addStereotypeSelectionListener(isConst, "Const"); + + // ///////////////////////////////////////////////////////////////////// + // Pointer declaration + // ///////////////////////////////////////////////////////////////////// + docPtr = createDocument(); + groupPtr = createGroup( + this + , "Pointer declaration" + , buttonSave + , null + , false + , 0 + , 25 + , false); + + // Use CDT CEditor coloration + viewerPtr = createViewer(docPtr, groupPtr); + + // ///////////////////////////////////////////////////////////////////// + // Pointer declaration + // ///////////////////////////////////////////////////////////////////// + docRef = createDocument(); + groupRef = createGroup( + this + , "Reference declaration" + , buttonSave + , groupPtr + , false + , 0 + , 50 + , false); + + // Use CDT CEditor coloration + viewerRef = createViewer(docRef, groupRef); + + // ///////////////////////////////////////////////////////////////////// + // Pointer declaration + // ///////////////////////////////////////////////////////////////////// + docDefault = createDocument(); + groupDefault = createGroup( + this + , "Default value" + , buttonSave + , groupRef + , false + , 0 + , 75 + , false); + + // Use CDT CEditor coloration + viewerDefault = createViewer(docDefault, groupDefault); + + // ///////////////////////////////////////////////////////////////////// + // Pointer declaration + // ///////////////////////////////////////////////////////////////////// + docArray = createDocument(); + groupArray = createGroup( + this + , "Array value ([...])" + , buttonSave + , groupDefault + , true + , 0 + , 0 + , false); + + // Use CDT CEditor coloration + viewerArray = createViewer(docArray, groupArray); + + // ///////////////////////////////////////////////////////////////////// + // Return control + // ///////////////////////////////////////////////////////////////////// + + return this; + } + + /** + * Saves the body for an 'Parameter' + */ + @Override + public void save() + { + if (selectedParameter == null) { + /* Log.debug("saveBody : selectedParameter is null"); */ + } + else { + CommandSupport.exec("C++ parameter save", new Runnable() { + + @Override + public void run() + { + // Treat Pointer + String newPtr = docPtr.get(); + if (newPtr.equals("")) { + StereotypeUtil.unapply(selectedParameter, Ptr.class); + } + else { + StereotypeUtil.apply(selectedParameter, Ptr.class); + } + + // Treat Reference + String newRef = docRef.get(); + if (newRef.equals("")) { + StereotypeUtil.unapply(selectedParameter, Ref.class); + } + else { + StereotypeUtil.apply(selectedParameter, Ref.class); + } + + // Treat DefaultValue + // need common class for facilitating this + // selectedParameter.setDefaultValue(selectedParameter.createDefaultValue("default", selectedParameter.getType(), null); + + // Treat Array + String newArray = docArray.get(); + if (newArray.equals("")) { + StereotypeUtil.unapply(selectedParameter, Array.class); + } + else { + StereotypeUtil.apply(selectedParameter, Array.class); + // StereotypeUtil.setTaggedValue(selectedParameter, Array.class, "definition", newArray); + } + } + }); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordAbstractPanel#refreshPanel() + */ + @Override + protected void refreshPanel() { + if (selectedParameter != null) { + // Const + + isConst.setSelection(StereotypeUtil.isApplied(selectedParameter, Const.class)); + // TODO: examine effect; + // isConst.setSelection(selectedParameter.getEffect?); + + docPtr.set(StereotypeUtil.isApplied(selectedParameter, Ptr.class) ? "*" : ""); + docRef.set(StereotypeUtil.isApplied(selectedParameter, Ref.class) ? "&" : ""); + docDefault.set(selectedParameter.getDefault()); + docArray.set(StereotypeUtil.isApplied(selectedParameter, Array.class) ? "[]" : ""); + // need definition? + } + } + + /** + * Called when the static checkbox is modified + */ + protected void checkConst() { + + boolean boxState = isConst.getSelection(); + + if (boxState) { + if (!StereotypeUtil.isApplied(selectedParameter, Const.class)) { + StereotypeUtil.apply(selectedParameter, Const.class); + } + } else { + if (StereotypeUtil.isApplied(selectedParameter, Const.class)) { + StereotypeUtil.unapply(selectedParameter, Const.class); + } + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() + */ + @Override + public void entryAction() { + super.entryAction(); + reset(); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordAbstractPanel#checkModifications() + */ + @Override + public boolean checkModifications() { + String ptrValue = StereotypeUtil.isApplied(selectedParameter, Ptr.class) ? "*" : ""; + if (!docPtr.get().equals(ptrValue)) { + return true; + } + + String refValue = StereotypeUtil.isApplied(selectedParameter, Ref.class) ? "&" : ""; + if (!docRef.get().equals(refValue)) { + return true; + } + + String defaultValue = selectedParameter.getDefault(); + if (defaultValue == null) { + if (!docDefault.get().equals("")) { + return true; + } + } + else if (!docDefault.get().equals(defaultValue)) { + return true; + } + + String arrayValue = StereotypeUtil.isApplied(selectedParameter, Array.class) ? "[]" : ""; + if (!docArray.get().equals(arrayValue)) { + return true; + } + return false; + } + + @Override + protected void updateModel() { + + // Check button changes + CommandSupport.exec("C++ parameter update", new Runnable() { + + @Override + public void run() + { + checkConst(); + } + }); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPrimitiveTypePanel.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPrimitiveTypePanel.java new file mode 100644 index 00000000000..adee09cef57 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPrimitiveTypePanel.java @@ -0,0 +1,167 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.panels; + +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.source.SourceViewer; +import org.eclipse.papyrus.C_Cpp.Typedef; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.papyrus.views.cpp.CommandSupport; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.PrimitiveType; +import org.eclipse.uml2.uml.util.UMLUtil; + + +/** + * Panel displayed when a PrimitiveType is selected + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public class CppPrimitiveTypePanel extends CppAbstractPanel { + + // document used by the viewer for definition of the type + @SuppressWarnings("unused") + private SourceViewer typeViewer; + + private Group typeGroup; + + private IDocument typeDocument; + + // Current selection + private PrimitiveType selectedPType; + + public CppPrimitiveTypePanel(Composite parent, int style) { + super(parent, style); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() + */ + @Override + public PrimitiveType getSelectedElement() { + return selectedPType; + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) + */ + @Override + public void setSelectedElement(Element newElement) { + super.setSelectedElement(newElement); + if (newElement instanceof PrimitiveType) { + this.selectedPType = (PrimitiveType) newElement; + } + else { + throw new RuntimeException("bad selection: " + newElement + " should be an uml2 PrimitiveType"); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContentHI() + */ + @Override + public Control createContent() { + + // ///////////////////////////////////////////////////////////////////// + // Create save reset buttons with superclass method + // ///////////////////////////////////////////////////////////////////// + createSaveResetButtons(); + + // ///////////////////////////////////////////////////////////////////// + // Type definition text area + // ///////////////////////////////////////////////////////////////////// + + typeDocument = createDocumentC(); + typeGroup = createGroup(this, "Type definition", buttonSave, null, true, 0, 0, true); + // Use CDT CEditor coloration + typeViewer = createViewerC(typeDocument, typeGroup); + + // ///////////////////////////////////////////////////////////////////// + + return this; + } + + /** + * Saves the include declarations for a 'PrimitiveType' + */ + @Override + public void save() { + if (selectedPType == null) { + /* Log.debug("saveBody : selectedOperation is null"); */ + } + else { + CommandSupport.exec("C++ primitive type save", new Runnable() { + + @Override + public void run() + { + if (typeDocument.get().equals("")) { + StereotypeUtil.unapply(selectedPType, Typedef.class); + } + else { + Typedef cppType = StereotypeUtil.applyApp(selectedPType, Typedef.class); + cppType.setDefinition(typeDocument.get()); + } + } + }); + } + } + + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() + */ + @Override + protected void refreshPanel() { + if (selectedPType != null) { + Typedef cppType = UMLUtil.getStereotypeApplication(selectedPType, Typedef.class); + typeDocument.set(cppType != null ? cppType.getDefinition() : ""); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() + */ + @Override + public void entryAction() { + super.entryAction(); + reset(); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#checkModifications() + */ + @Override + public boolean checkModifications() { + Typedef cppType = UMLUtil.getStereotypeApplication(selectedPType, Typedef.class); + String typeInModel = cppType != null ? cppType.getDefinition() : ""; + if (!typeDocument.get().equals(typeInModel)) { + return true; + } + return false; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPropertyPanel.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPropertyPanel.java new file mode 100644 index 00000000000..2d449799e6e --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppPropertyPanel.java @@ -0,0 +1,384 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ +package org.eclipse.papyrus.views.panels; + +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.source.SourceViewer; +import org.eclipse.papyrus.C_Cpp.Array; +import org.eclipse.papyrus.C_Cpp.Const; +import org.eclipse.papyrus.C_Cpp.Ptr; +import org.eclipse.papyrus.C_Cpp.Ref; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.papyrus.views.cpp.CommandSupport; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Property; + + +/** + * Panel displayed when a Property is selected + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public class CppPropertyPanel extends CppAbstractPanel { + + private Button isStatic; + + private Button isConst; + + private Property selectedProperty; + + // document used by the viewer + private IDocument docPtr; + + private IDocument docRef; + + private IDocument docArray; + + private IDocument docDefault; + + @SuppressWarnings("unused") + private SourceViewer viewerPtr; + + @SuppressWarnings("unused") + private SourceViewer viewerRef; + + @SuppressWarnings("unused") + private SourceViewer viewerArray; + + @SuppressWarnings("unused") + private SourceViewer viewerDefault; + + private Group groupPtr; + + private Group groupRef; + + private Group groupArray; + + private Group groupDefault; + + public CppPropertyPanel(Composite parent, int style) { + super(parent, style); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() + */ + @Override + public Property getSelectedElement() { + return selectedProperty; + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) + */ + @Override + public void setSelectedElement(Element newElement) { + super.setSelectedElement(newElement); + if (newElement instanceof Property) { + this.selectedProperty = (Property) newElement; + } + else { + throw new RuntimeException("bad selection: " + newElement + " should be an uml2 Property"); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() + */ + @Override + public Control createContent() { + // ///////////////////////////////////////////////////////////////////// + // Create save reset buttons with superclass method + // ///////////////////////////////////////////////////////////////////// + createSaveResetButtons(); + + // ///////////////////////////////////////////////////////////////////// + // Create checkboxes + // ///////////////////////////////////////////////////////////////////// + isStatic = createButton("isStatic", this, null); + isConst = createButton("isConst", this, isStatic); + + // ///////////////////////////////////////////////////////////////////// + // Add checkboxes listeners + // ///////////////////////////////////////////////////////////////////// + isStatic.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + updateModel(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + addStereotypeSelectionListener(isConst, "Const"); + + // ///////////////////////////////////////////////////////////////////// + // Pointer declaration + // ///////////////////////////////////////////////////////////////////// + docPtr = createDocument(); + groupPtr = createGroup( + this + , "Pointer declaration" + , buttonSave + , null + , false + , 0 + , 25 + , false); + + // Use CDT CEditor coloration + viewerPtr = createViewer(docPtr, groupPtr); + + // ///////////////////////////////////////////////////////////////////// + // Pointer declaration + // ///////////////////////////////////////////////////////////////////// + docRef = createDocument(); + groupRef = createGroup( + this + , "Reference declaration" + , buttonSave + , groupPtr + , false + , 0 + , 50 + , false); + + // Use CDT CEditor coloration + viewerRef = createViewer(docRef, groupRef); + + // ///////////////////////////////////////////////////////////////////// + // Pointer declaration + // ///////////////////////////////////////////////////////////////////// + docDefault = createDocument(); + groupDefault = createGroup( + this + , "Default value" + , buttonSave + , groupRef + , false + , 0 + , 75 + , false); + + // Use CDT CEditor coloration + viewerDefault = createViewer(docDefault, groupDefault); + + // ///////////////////////////////////////////////////////////////////// + // Pointer declaration + // ///////////////////////////////////////////////////////////////////// + docArray = createDocument(); + groupArray = createGroup( + this + , "Array value ([...])" + , buttonSave + , groupDefault + , true + , 0 + , 0 + , false); + + // Use CDT CEditor coloration + viewerArray = createViewer(docArray, groupArray); + + // ///////////////////////////////////////////////////////////////////// + // Return control + // ///////////////////////////////////////////////////////////////////// + + return this; + } + + /** + * Saves the body for an 'Property' + */ + @Override + public void save() + { + if (selectedProperty == null) { + /* Log.debug("saveBody : selectedProperty is null"); */ + } + else { + CommandSupport.exec("C++ package save", new Runnable() { + + @Override + public void run() + { + // Treat Pointer + String newPtr = docPtr.get(); + if (newPtr.equals("")) { + StereotypeUtil.unapply(selectedProperty, Ptr.class); + } + else { + StereotypeUtil.apply(selectedProperty, Ptr.class); + } + + // Treat Reference + String newRef = docRef.get(); + if (newRef.equals("")) { + StereotypeUtil.unapply(selectedProperty, Ref.class); + } + else { + StereotypeUtil.apply(selectedProperty, Ref.class); + } + + // Treat DefaultValue + // need common class for facilitating this + // selectedParameter.setDefaultValue(selectedParameter.createDefaultValue("default", selectedParameter.getType(), null); + + // Treat Array + String newArray = docArray.get(); + if (newArray.equals("")) { + StereotypeUtil.unapply(selectedProperty, Array.class); + } + else { + StereotypeUtil.apply(selectedProperty, Array.class); + } + } + }); + } + + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() + */ + @Override + protected void refreshPanel() { + if (selectedProperty == null) { + /* Log.debug("resetBody : selectedProperty is null"); */ + } + else { + isStatic.setSelection(selectedProperty.isStatic()); + isConst.setSelection(StereotypeUtil.isApplied(selectedProperty, Const.class)); + docPtr.set(StereotypeUtil.isApplied(selectedProperty, Ptr.class) ? "*" : ""); + docRef.set(StereotypeUtil.isApplied(selectedProperty, Ref.class) ? "&" : ""); + docDefault.set(selectedProperty.getDefault()); + docArray.set(StereotypeUtil.isApplied(selectedProperty, Array.class) ? "[]" : ""); + } + } + + /** + * Called when the static checkbox is modified + */ + protected void checkStatic() { + + boolean boxState = isStatic.getSelection(); + + selectedProperty.setIsStatic(boxState); + } + + /** + * Called when the const checkbox is modified + */ + protected void checkConst() { + boolean boxState = isConst.getSelection(); + + if (StereotypeUtil.isApplied(selectedProperty, Const.class) != boxState) { + if (boxState) { + StereotypeUtil.apply(selectedProperty, Const.class); + } + else { + StereotypeUtil.unapply(selectedProperty, Const.class); + } + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#entryAction() + */ + @Override + public void entryAction() { + super.entryAction(); + reset(); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#exitAction() + */ + @Override + public void exitAction() { + super.exitAction(); + } + + /** + * Checks if the content of the panel is different to the model + *

    + * This is a read only operation + * + * @return true if one of the element of the model is not up-to-date + * with the content of the panel + */ + @Override + public boolean checkModifications() { + String ptrValue = StereotypeUtil.isApplied(selectedProperty, Ptr.class) ? "*" : ""; + if (!docPtr.get().equals(ptrValue)) { + return true; + } + + String refValue = StereotypeUtil.isApplied(selectedProperty, Ref.class) ? "&" : ""; + if (!docRef.get().equals(refValue)) { + return true; + } + + String defaultValue = selectedProperty.getDefault(); + if (defaultValue == null) { + if (!docDefault.get().equals("")) { + return true; + } + } + else if (!docDefault.get().equals(defaultValue)) { + return true; + } + + String arrayValue = StereotypeUtil.isApplied(selectedProperty, Array.class) ? "[]" : ""; + if (!docArray.get().equals(arrayValue)) { + return true; + } + return false; + + } + + + @Override + protected void updateModel() + { + CommandSupport.exec("C++ property save", new Runnable() { + + @Override + public void run() + { + // Check button changes + checkStatic(); + checkConst(); + + } + }); + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateBindingPanel.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateBindingPanel.java new file mode 100644 index 00000000000..ff62c9613f1 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateBindingPanel.java @@ -0,0 +1,178 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.panels; + +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.source.SourceViewer; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.papyrus.views.cpp.CommandSupport; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.util.UMLUtil; + + +/** + * Panel displayed when a TemplateBinding is selected + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public class CppTemplateBindingPanel extends CppAbstractPanel { + + private TemplateBinding selectedTB; + + // document used by the viewer + private IDocument docBinding; + + @SuppressWarnings("unused") + private SourceViewer viewerBinding; + + private Group groupBinding; + + public CppTemplateBindingPanel(Composite parent, int style) { + super(parent, style); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() + */ + @Override + public TemplateBinding getSelectedElement() { + return selectedTB; + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) + */ + @Override + public void setSelectedElement(Element newElement) { + super.setSelectedElement(newElement); + if (newElement instanceof TemplateBinding) { + this.selectedTB = (TemplateBinding) newElement; + } + else { + throw new RuntimeException("bad selection: " + newElement + " should be an uml2 TemplateBinding"); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() + */ + @Override + public Control createContent() { + + // ///////////////////////////////////////////////////////////////////// + // Create save reset buttons with superclass method + // ///////////////////////////////////////////////////////////////////// + createSaveResetButtons(); + + // ///////////////////////////////////////////////////////////////////// + // Body + // ///////////////////////////////////////////////////////////////////// + + docBinding = createDocumentC(); + groupBinding = createGroup( + this + , "Binding declaration (<...>)" + , groupBinding + , null + , true + , 0 + , 0 + , true); + // Use CDT CEditor coloration + viewerBinding = createViewerC(docBinding, groupBinding); + + // ///////////////////////////////////////////////////////////////////// + + return this; + } + + /** + * Saves the body for an 'TemplateBinding' + */ + @Override + public void save() + { + if (selectedTB == null) { + /* Log.debug("saveBody : selectedTemplateBinding is null"); */ + } + else { + CommandSupport.exec("C++ template binding save", new Runnable() { + + @Override + public void run() + { + // Treat Pointer + String newB = docBinding.get(); + if (newB.equals("")) { + StereotypeUtil.unapply(selectedTB, TemplateBinding.class); + } else { + org.eclipse.papyrus.C_Cpp.TemplateBinding templateBinding = StereotypeUtil.applyApp(selectedTB, org.eclipse.papyrus.C_Cpp.TemplateBinding.class); + // TODO: use UML template bindings? + templateBinding.setBinding(newB); + } + } + }); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() + */ + @Override + protected void refreshPanel() { + if (selectedTB != null) { + org.eclipse.papyrus.C_Cpp.TemplateBinding templateBinding = UMLUtil.getStereotypeApplication(selectedTB, org.eclipse.papyrus.C_Cpp.TemplateBinding.class); + // TODO: use UML template bindings? + docBinding.set(templateBinding != null ? templateBinding.getBinding() : ""); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#entryAction() + */ + @Override + public void entryAction() { + super.entryAction(); + reset(); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#checkModifications() + */ + @Override + public boolean checkModifications() { + org.eclipse.papyrus.C_Cpp.TemplateBinding templateBinding = UMLUtil.getStereotypeApplication(selectedTB, org.eclipse.papyrus.C_Cpp.TemplateBinding.class); + // TODO: use UML template bindings? + String bindingValue = templateBinding != null ? templateBinding.getBinding() : ""; + if (!docBinding.get().equals(bindingValue)) { + return true; + } + return false; + + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateParameterPanel.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateParameterPanel.java new file mode 100644 index 00000000000..4726c644d03 --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/CppTemplateParameterPanel.java @@ -0,0 +1,181 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.panels; + +import org.eclipse.jface.text.IDocument; +import org.eclipse.jface.text.source.SourceViewer; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.papyrus.views.cpp.CommandSupport; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.TemplateParameter; +import org.eclipse.uml2.uml.util.UMLUtil; + + +/** + * Panel displayed when a TemplateParameter is selected + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public class CppTemplateParameterPanel extends CppAbstractPanel { + + private TemplateParameter selectedTP; + + // document used by the viewer + @SuppressWarnings("unused") + private SourceViewer viewerParameter; + + private Group groupParameter; + + private IDocument docParameter; + + public CppTemplateParameterPanel(Composite parent, int style) { + super(parent, style); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#getSelectedElement() + */ + @Override + public TemplateParameter getSelectedElement() { + return selectedTP; + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#setSelectedElement(java.lang.Element) + */ + @Override + public void setSelectedElement(Element newElement) { + super.setSelectedElement(newElement); + if (newElement instanceof TemplateParameter) { + this.selectedTP = (TemplateParameter) newElement; + } + else { + throw new RuntimeException("bad selection: " + newElement + " should be an uml2 TemplateParameter"); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accorduml.ui.views.panels.AccordUMLAbstractPanel#createContent() + */ + @Override + public Control createContent() { + + // ///////////////////////////////////////////////////////////////////// + // Create save reset buttons with superclass method + // ///////////////////////////////////////////////////////////////////// + createSaveResetButtons(); + + // ///////////////////////////////////////////////////////////////////// + // TemplateParameter declaration + // ///////////////////////////////////////////////////////////////////// + docParameter = createDocumentC(); + groupParameter = createGroup( + this + , "Parameter name" + , buttonSave + , null + , true + , 0 + , 0 + , true); + // Use CDT CEditor coloration + viewerParameter = createViewerC(docParameter, groupParameter); + + // ///////////////////////////////////////////////////////////////////// + // Return control on this composite + // ///////////////////////////////////////////////////////////////////// + + return this; + } + + /** + * Saves the body for an 'Property' + */ + @Override + public void save() + { + if (selectedTP == null) { + /* Log.debug("saveBody : selectedProperty is null"); */ + } + else { + CommandSupport.exec("C++ template parameter save", new Runnable() { + + @Override + public void run() + { + // Treat Parameter name + String newB = docParameter.get(); + if (newB.equals("")) { + StereotypeUtil.unapply(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class); + } + else { + org.eclipse.papyrus.C_Cpp.TemplateParameter templateParameter = StereotypeUtil.applyApp(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class); + templateParameter.setName(newB); + } + } + }); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#refreshPanel() + */ + @Override + protected void refreshPanel() { + if (selectedTP == null) { + /* Log.debug("resetBody : selectedProperty is null"); */ + } else { + + org.eclipse.papyrus.C_Cpp.TemplateParameter templateParameter = UMLUtil.getStereotypeApplication(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class); + String parameterName = templateParameter != null ? templateParameter.getName() : ""; + docParameter.set(parameterName); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#entryAction() + */ + @Override + public void entryAction() { + super.entryAction(); + reset(); + } + + /* + * (non-Javadoc) + * + * @see com.cea.accordcpp.core.ui.panels.AccordCppAbstractPanel#checkModifications() + */ + @Override + public boolean checkModifications() { + org.eclipse.papyrus.C_Cpp.TemplateParameter templateParameter = UMLUtil.getStereotypeApplication(selectedTP, org.eclipse.papyrus.C_Cpp.TemplateParameter.class); + // TODO: use UML template bindings? + String parameterName = templateParameter != null ? templateParameter.getName() : ""; + if (!docParameter.get().equals(parameterName)) { + return true; + } + return false; + } +} diff --git a/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/PanelFactory.java b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/PanelFactory.java new file mode 100644 index 00000000000..ae12cb171da --- /dev/null +++ b/extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp/src/org/eclipse/papyrus/views/panels/PanelFactory.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2007 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.views.panels; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.OpaqueBehavior; +import org.eclipse.uml2.uml.Transition; +import org.eclipse.uml2.uml.UMLPackage; + + +/** + * Factory that creates panel given element type. + * @deprecated This view will be replaced by an XWT view for the C++ profile + */ +@Deprecated +public class PanelFactory { + + /** Singleton instance for this factory */ + public static PanelFactory eINSTANCE = new PanelFactory(); + + /** + * Default constructor (private visibility for singleton pattern) + */ + protected PanelFactory() { + } + + /** + * Creates a panel for the given object. The object should be an {@link Element}. If not, + * it returns a default panel. + * + * @param parent + * the composite parent for the new panel + * @param style + * the SWT style of the panel + * @param object + * the object for which the panel is created + * @return the newly created panel + */ + public CppAbstractPanel createPanel(Composite parent, int style, Object object) { + CppAbstractPanel panel; + if (object instanceof Element) { + panel = createPanel(parent, style, (Element) object); + } else { + panel = createPanel(parent, style, null); + } + return panel; + } + + /** + * Creates a panel for the given element. + * + * @param parent + * the composite parent for the new panel + * @param style + * the SWT style of the panel + * @param element + * the UML2 element for which the panel is created + * @return the newly created panel + */ + public CppAbstractPanel createPanel(Composite parent, int style, Element element) { + CppAbstractPanel panel = null; + int metaclassID = -1; // -1 => default case + if (element instanceof Transition) { + // navigate from transition to effect, if it exists (and has an opaque behavior) + Behavior effect = ((Transition) element).getEffect(); + if (effect instanceof OpaqueBehavior) { + element = effect; + } + } + if (element != null) { + metaclassID = element.eClass().getClassifierID(); + } + + switch (metaclassID) { + + case UMLPackage.OPERATION: + panel = new CppOperationPanel(parent, style); + break; + + case UMLPackage.OPAQUE_BEHAVIOR: + panel = new CppBehaviorPanel(parent, style); + break; + + case UMLPackage.CLASS: + panel = new CppClassPanel(parent, style); + break; + + case UMLPackage.PACKAGE: + panel = new CppPackagePanel(parent, style); + break; + + case UMLPackage.MODEL: + panel = new CppPackagePanel(parent, style); + break; + + case UMLPackage.PRIMITIVE_TYPE: + panel = new CppPrimitiveTypePanel(parent, style); + break; + + // same panel for property and its child elements + case UMLPackage.PROPERTY: + case UMLPackage.EXTENSION_END: + case UMLPackage.PORT: + panel = new CppPropertyPanel(parent, style); + break; + + case UMLPackage.PARAMETER: + panel = new CppParameterPanel(parent, style); + break; + + case UMLPackage.TEMPLATE_PARAMETER: + panel = new CppTemplateParameterPanel(parent, style); + break; + + case UMLPackage.TEMPLATE_BINDING: + panel = new CppTemplateBindingPanel(parent, style); + break; + + case UMLPackage.GENERALIZATION: + panel = new CppGeneralizationPanel(parent, style); + break; + + default: + panel = new CppDefaultPanel(parent, style); + break; + } + + panel.createContent(); + panel.setSelectedElement(element); + return panel; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java-updatesite/.project b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java-updatesite/.project new file mode 100644 index 00000000000..0cc00efb223 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java-updatesite/.project @@ -0,0 +1,17 @@ + + + org.eclipse.papyrus.java-updatesite + + + + + + org.eclipse.pde.UpdateSiteBuilder + + + + + + org.eclipse.pde.UpdateSiteNature + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java-updatesite/site.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java-updatesite/site.xml new file mode 100644 index 00000000000..7ca05aad69a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java-updatesite/site.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + Java Classes generator. This feature allows to generate Java classes from Papyrus classes and packages. It also allows to generate projects. + + + + + This profile is used by the Java generator and the Java reverse to add additional properties to the UML model. These properties allows to change the names, specify project target, source targets, ... + + + + + Tools related to the Java language. This set of plugins allows to reverse java code to a Papyrus model, and to generate Java code from a Papyrus model. + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.classpath b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.project b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.project new file mode 100644 index 00000000000..189ce3e8668 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.java.generator.jdtsynchronizer + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..9c9e594967b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.uml2.uml, + org.eclipse.m2m.qvt.oml, + org.eclipse.papyrus.java.generator.metamodel.jdt;bundle-version="1.2.0", + org.eclipse.core.runtime, + org.eclipse.papyrus.java.generator.transfo.umltojdt;bundle-version="1.2.0", + org.eclipse.jdt.core, + org.eclipse.jface.text, + org.eclipse.jdt.launching, + org.eclipse.core.resources +Export-Package: org.eclipse.papyrus.java.generator.jdtsynchronizer +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.java.generator.jdtsynchronizer;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/about.html b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/build.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/build.properties new file mode 100644 index 00000000000..81e0fbf3cff --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + icons/,\ + about.html,\ + plugin.properties +src.includes = about.html diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generate.psd b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generate.psd new file mode 100644 index 00000000000..9a555a938e1 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generate.psd differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generation.png b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generation.png new file mode 100644 index 00000000000..6a55c438352 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/generation.png differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/sample.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/sample.gif new file mode 100644 index 00000000000..34fb3c9d8cb Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/icons/sample.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/plugin.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/plugin.properties new file mode 100644 index 00000000000..41b9da94450 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/plugin.properties @@ -0,0 +1,18 @@ +################################################################################# +# Copyright (c) 2011 Nicolas Deblock & Manuel Giles. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation +# Manuel Giles giles.manu@live.fr - Initial API and implementation +# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception +# +################################################################################# + + +pluginName = Jdt Synchronizer (Incubation) +providerName = Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/pom.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/pom.xml new file mode 100644 index 00000000000..9361e773d27 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.java.generator.jdtsynchronizer + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/GeneratorPreference.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/GeneratorPreference.java new file mode 100644 index 00000000000..56af682c908 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/GeneratorPreference.java @@ -0,0 +1,77 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.jdtsynchronizer; + +public interface GeneratorPreference { + + /** + * indicate if methods of inherits interfaces must be implement in a class + * + * @return + */ + public boolean implementMethodsOfIntefaces(); + + /** + * indicate if methods of inherit abstract class must be implement in a class + * + * @return + */ + public boolean implementMethodsOfAbstractClass(); + + /** + * indicate if getters must be create + * + * @return + */ + public boolean generateGetters(); + + /** + * indicate if setters must be create + * + * @return + */ + public boolean generateSetters(); + + /** + * indicate if a package must be generate + * + * @param packageQualifiedName + * package to generate + * @return + */ + public boolean isPackageToGenerate(String packageQualifiedName); + + /** + * + * @return generic class to use for the association * (multi-value) + */ + public String genericClassForMultiValue(); + + /** + * Return true if we want to stop on first error, false if we want to continue anyway. + * + * @return + */ + public boolean stopOnFirstError(); + + /** + * + * @return the default source folder name where the generator have to generate Java files and packages. + */ + public String defaultSourceFolderName(); + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/RunGenerator.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/RunGenerator.java new file mode 100644 index 00000000000..4ff03a7e505 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/RunGenerator.java @@ -0,0 +1,228 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.jdtsynchronizer; + +import java.io.File; +import java.io.FileNotFoundException; +import java.util.List; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.URIConverter; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import org.eclipse.m2m.qvt.oml.BasicModelExtent; +import org.eclipse.m2m.qvt.oml.ExecutionContextImpl; +import org.eclipse.m2m.qvt.oml.ExecutionDiagnostic; +import org.eclipse.m2m.qvt.oml.ModelExtent; +import org.eclipse.m2m.qvt.oml.TransformationExecutor; +import org.eclipse.papyrus.java.generator.jdtsynchronizer.impl.SynchJDTJavaModel; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; +import org.eclipse.papyrus.java.generator.transfo.umltojdt.UmltojdtActivator; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.resource.UMLResource; + +/** + * Class to Run the QVT Transformation, and then the Java generation + */ +public class RunGenerator { + + /** + * This is the metamodele + */ + private EList inObjects; + + /** + * Constructor of RunGenerator using .uml file + * + * @param UMLFileUrl + * the '.uml' file's url + * @throws FileNotFoundException + */ + public RunGenerator(String umlFileUrl) throws FileNotFoundException { + + // charge the model of the '.uml' file + inObjects = loadUmlModel(umlFileUrl); + } + + /** + * Constructor of RunGenerator using EList metamodel + * + * @param UMLFileUrl + * the '.uml' file's url + */ + public RunGenerator(EList inObjects) { + this.inObjects = inObjects; + } + + /** + * run code generation using QVTo transformation + * + * @throws JDTVisitorException + */ + public void runGeneration(GeneratorPreference preference) throws JDTVisitorException { + // Create an options model using the Eclipse Preferences + EList inOptions = createOptionModelFromEclipsePreferences(preference); + + // Refer to an existing transformation via URI + final URI scriptUri = + URI.createURI("platform:/plugin/" + UmltojdtActivator.PLUGIN_ID + UmltojdtActivator.PATH_QVT_FILE); + + List outObjects = runTransformation(scriptUri, inObjects, inOptions); + + if (outObjects.size() == 0) { + throw new JDTVisitorException("No classes or packages produced from the transformation. Nothing is generated."); + } + + if (outObjects.size() > 1) { + System.err.println("Warning, JDT modele has more than one root. Found root:"); + for (EObject el : outObjects) { + System.err.println(((JDTJavaElement) el).getElementName()); + } + System.err.println("-------"); + } + + // finally, we synchronize the JDT model with org.eclipse.jdt.core + if (outObjects.size() > 0) { + /* + * TODO : if metamodel have some root node, we make a loop + * JDTJavaElement proj = (JDTJavaElement) outObjects.get(0); + * + * JDTVisitor visitor = new SynchJDTJavaModel(); + * proj.accept(visitor); + */ + for (Object o : outObjects) { + if (o instanceof JDTJavaModel) { + JDTJavaElement proj = (JDTJavaElement) o; + JDTVisitor visitor = new SynchJDTJavaModel(preference); + proj.accept(visitor); + } + + } + } + } + + /** + * Create a new GeneratorOptions model and inject eclipse preferences on it. + * + * @param preference + * eclipse preferences + * @return a new instance of Options, where options.defaultSourceFolder have been initialized. + */ + private EList createOptionModelFromEclipsePreferences(GeneratorPreference preference) { + GeneratoroptionsmmFactory optionsFactory = GeneratoroptionsmmFactory.eINSTANCE; + + // Create a new Options object and inject the default source folder name from Eclipse preferences + Options options = optionsFactory.createOptions(); + options.setDefaultSourceFolder(preference.defaultSourceFolderName()); + + // Add options to the model + EList optionsContents = new BasicEList(1); + optionsContents.add(options); + + return optionsContents; + } + + /** + * Run QVTo transformation using the scriptUri and the inObjects model + * + * @param scriptUri + * The script QVTo + * @param inObjects + * The entry model + * @param inOptions2 + * @return The output model + */ + private List runTransformation(URI scriptUri, EList inObjects, EList inOptions) { + // initialize the transformation + // First, you need to instantiate a Registry: + EPackage.Registry registry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE); + + // which is used to register the meta-models in E:\workspace\modelesUML\org.eclipse.papyrus.java.javagen.mmJDT\metaModel + + JdtmmPackage mm1 = JdtmmPackage.eINSTANCE; + registry.put(mm1.getNsURI(), mm1); + + // class which allow to execute the transformation + TransformationExecutor t = new TransformationExecutor(scriptUri, registry); + ExecutionContextImpl executionContext = new ExecutionContextImpl(); + + // allow to contains the model uml + ModelExtent input = new BasicModelExtent(inObjects); + ModelExtent inputOptions = new BasicModelExtent(inOptions); + ModelExtent output = new BasicModelExtent(); + // make the transformation + ExecutionDiagnostic executionDiagnostic = t.execute(executionContext, input, inputOptions, output); + + // the errors + System.out.println(executionDiagnostic.getMessage()); + for (Diagnostic d : executionDiagnostic.getChildren()) { + System.out.println(d.getMessage()); + } + + + // we take the out JDT model in a list + return output.getContents(); + } + + + /** + * Allow to charge the uml model in a list + * + * @param url + * the '.uml' file's url + * @return the charge model + * @throws FileNotFoundException + */ + private EList loadUmlModel(String url) throws FileNotFoundException { + + ResourceSet resourceSet = new ResourceSetImpl(); + + // charge the metamodel util for read the model + resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE); + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE); + // Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "uml", new UMLResourceFactoryImpl()); + + Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl()); + URIConverter.URI_MAP.put(URI.createURI("pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml"), URI.createFileURI(System.getProperty("user.dir") + "/Model_Libs/UMLPrimitiveTypes.library.uml")); + + // the '.uml' file's url + File file = new File(url); + if (!file.exists()) { + throw new FileNotFoundException("File " + new File(url).getAbsolutePath() + " not found"); + } + URI fileURI = URI.createFileURI(new File(url).getAbsolutePath()); + + // demand load the resource for this file. + Resource resource = resourceSet.getResource(fileURI, true); + + return resource.getContents(); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCommentable.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCommentable.java new file mode 100644 index 00000000000..5a196a155b0 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCommentable.java @@ -0,0 +1,161 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; + +import java.util.List; + +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.dom.AST; +import org.eclipse.jdt.core.dom.ASTParser; +import org.eclipse.jdt.core.dom.BodyDeclaration; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.Javadoc; +import org.eclipse.jdt.core.dom.TagElement; +import org.eclipse.jdt.core.dom.TextElement; +import org.eclipse.jdt.core.dom.TypeDeclaration; +import org.eclipse.jface.text.BadLocationException; +import org.eclipse.jface.text.Document; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; +import org.eclipse.text.edits.MalformedTreeException; +import org.eclipse.text.edits.TextEdit; + +/** + * Useful for class who have to generate Javadoc comment. + * + * @author Deblock Nicolas & Manuel Giles + * + */ +public abstract class SynchJDTCommentable implements JDTVisitor { + + + /** + * search the element to insert the Javadoc in compilation unit + * + * @param cu + * @param typeName + * @return + */ + protected abstract BodyDeclaration searchElementToInsert(CompilationUnit cu, IJavaElement elementName); + + /** + * return javaDoc tag to add. Call in function createJavaDocFor() + * + * @return javaDoc tag to add in a List with String = "@tag comment" + */ + protected abstract List getJavadocTags(); + + /** + * Reads a ICompilationUnit and creates the AST DOM for manipulating the + * Java source file + * + * @param unit + * @return + */ + private static CompilationUnit parse(ICompilationUnit unit) { + ASTParser parser = ASTParser.newParser(AST.JLS3); + parser.setKind(ASTParser.K_COMPILATION_UNIT); + parser.setSource(unit); + parser.setResolveBindings(true); + return (CompilationUnit) parser.createAST(null); // parse + } + + + /** + * Create a JavaDoc for a a objet who extends IJavaElement and IMethod + * (IType or IMethod by example) + * + * @param ielement + * the element you want add javadoc + * @param icu + * the compilation unit of ielement + * @param comment + * body of the comment + * @param auteur + * author of the compilation unit + * @throws JavaModelException + * @throws BadLocationException + * @throws MalformedTreeException + */ + protected void createJavaDocFor(U ielement, ICompilationUnit icu, String comment, String author) throws JavaModelException, MalformedTreeException, BadLocationException { + + CompilationUnit cu = parse(icu); + // Authorize modification + cu.recordModifications(); + // create document + Document document = new Document(icu.getBuffer().getContents()); + + // Creating the new JavaDoc node + AST ast = cu.getAST(); + Javadoc jc = ast.newJavadoc(); + + TagElement tag = ast.newTagElement(); + if (comment != null) { + TextElement te = ast.newTextElement(); + tag.fragments().add(te); + te.setText(comment); + } + jc.tags().add(tag); + + List javadocTags = getJavadocTags(); + if (javadocTags != null) { + for (String s : javadocTags) { + tag = ast.newTagElement(); + tag.setTagName(s); + jc.tags().add(tag); + } + } + // add javadoc to type + BodyDeclaration classType = searchElementToInsert(cu, ielement); + if (classType != null) { + classType.setJavadoc(jc); + } + + // Applying changes + TextEdit text = cu.rewrite(document, icu.getJavaProject().getOptions(true)); + text.apply(document); + + // set buffer of compilation unit + icu.getBuffer().setContents(document.get()); + + } + + /** + * search type in type declaration + * + * @param classType + * type declaration + * @param typeName + * typeName type name research + * @return + */ + protected TypeDeclaration searchType(TypeDeclaration classType, String typeName) { + if (classType.getName().toString().equals(typeName)) { + return classType; + } + + for (Object objct : classType.getTypes()) { + TypeDeclaration ct = (TypeDeclaration) objct; + if (ct.getName().toString().equals(typeName)) { + return ct; + } + searchType(ct, typeName); + } + return null; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCompilationUnit.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCompilationUnit.java new file mode 100644 index 00000000000..1e6f34fb515 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTCompilationUnit.java @@ -0,0 +1,95 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; + +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jdt.core.IPackageFragment; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; + +/** + * Allow to generate compilation Unit + * + * @author Deblock Nicolas & Manuel Giles + * + */ +public class SynchJDTCompilationUnit extends EObjectImpl implements JDTVisitor { + + private IPackageFragment ipack; + + private GeneratorPreference preference; + + /** + * Constructor + * + * @param ipack + * the IPackageFragment parent + */ + public SynchJDTCompilationUnit(IPackageFragment ipack, GeneratorPreference preference) { + super(); + this.ipack = ipack; + this.preference = preference; + } + + @Override + public void visit(JDTJavaElement element) throws JDTVisitorException { + // if element can't be generated, we stop all + if (!element.isGenerated()) { + return; + } + if (SynchTools.isPrimiveType(element.getElementName()) && !element.getElementName().equals("String")) { + return; + } + + JDTCompilationUnit cu = (JDTCompilationUnit) element; + try { + ICompilationUnit icu = SynchTools.searchIJavaElement(ipack.getCompilationUnits(), cu.getElementName() + ".java"); + + if (icu == null) { + icu = ipack.createCompilationUnit(cu.getElementName() + ".java", "", true, null); + if (!ipack.getElementName().equals(IPackageFragment.DEFAULT_PACKAGE_NAME)) { + icu.createPackageDeclaration(ipack.getElementName(), null); + } + } + + // call the children JDTType + JDTVisitor visitor = new SynchJDTType(icu, preference); + + for (JDTType type : cu.getTypes()) { + type.accept(visitor); + } + + // save the compilation unit + icu.save(null, true); + } catch (JavaModelException e) { + e.printStackTrace(); + throw new JDTVisitorException(e.getMessage(), e.getCause()); + } catch (Exception e) { + e.printStackTrace(); + throw new JDTVisitorException(e.getMessage(), e.getCause()); + } + + + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTField.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTField.java new file mode 100644 index 00000000000..485ef9ce603 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTField.java @@ -0,0 +1,217 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; + +import java.util.List; + +import org.eclipse.jdt.core.IField; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IType; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.dom.BodyDeclaration; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.FieldDeclaration; +import org.eclipse.jdt.core.dom.TypeDeclaration; +import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; + +/** + * Allow to generate field in a type + * + * @author Deblock Nicolas & Manuel Giles + * + */ +public class SynchJDTField extends SynchJDTCommentable { + + private IType itype; + + private JDTField field; + + private GeneratorPreference preference; + + /** + * Constructor + * + * @param itype + * the type parent + */ + public SynchJDTField(IType itype, GeneratorPreference preference) { + super(); + this.itype = itype; + this.preference = preference; + } + + @Override + public void visit(JDTJavaElement element) throws JDTVisitorException { + // if element can't be generated, we stop all + if (!element.isGenerated()) { + return; + } + + field = (JDTField) element; + + StringBuffer buffer = new StringBuffer(); + try { + IField ifield = SynchTools.searchIJavaElement(itype.getFields(), field.getElementName()); + if (ifield == null && field.getType() != null) { + // first : find the import package + // create import when it's not a primitive type + SynchTools.createImport(itype, field.getOwner(), field.getType()); + + + // visibility + buffer.append("\n" + SynchTools.getVisibility(field).toString()); + + // // if it's an association * + if (field.isMultiValued()) { + buffer.append(SynchTools.getMultiValued(itype, field.getType().getElementName(), preference)); + } else { + buffer.append(field.getType().getElementName()); + } + + + // create type + buffer.append(" " + field.getElementName()); + + if (field.getValue() != null) { + buffer.append(" = "); + if (field.getType().getElementName().equals("char")) { + buffer.append("'" + field.getValue().toString() + "'"); + } else if (field.getType().getElementName().equals("String")) { + buffer.append("\"" + field.getValue().toString() + "\""); + } else { + buffer.append(field.getValue().toString()); + } + } + + buffer.append(";"); + + // create type + ifield = itype.createField(buffer.toString(), null, true, null); + + // add javadoc to method + createJavaDocFor(ifield, ifield.getCompilationUnit(), field.getComment(), ""); + } + else if (field.getType() == null) { + System.err.println("No type specified for " + + field.getOwner().getQualifiedName() + + "." + field.getElementName()); + } + + + // Generate explicit imports + generateExplicitImports(field, itype); + + } catch (JavaModelException e) { + // e.printStackTrace(); + String msg = "Can't generate field (class='" + + field.getOwner().getQualifiedName() + + "', msg= " + e.getMessage() + + ", buffer=" + buffer.toString() + + ")"; + // System.err.println(msg); + // throw new JDTVisitorException( msg, e.getCause()); + propagateException(msg, e); + } catch (Exception e) { + // e.printStackTrace(); + // throw new JDTVisitorException(e.getMessage(), e.getCause()); + propagateException(e.getMessage(), e); + } + } + + /** + * Propagate a {@link JDTVisitorException} if the flag is not set + * + * @param msg + * @param e + * @throws JDTVisitorException + */ + private void propagateException(String msg, Throwable e) throws JDTVisitorException { + + if (preference.stopOnFirstError()) { + throw new JDTVisitorException(msg, e.getCause()); + } + else { + // Show error + System.err.println(msg); + e.printStackTrace(); + } + } + + @Override + protected BodyDeclaration searchElementToInsert(CompilationUnit cu, + IJavaElement field) { + + // search Itype parent + if (field.getParent() instanceof IType) { + IType itype = (IType) field.getParent(); + // find the good type + TypeDeclaration type = searchType((TypeDeclaration) cu.types().get(0), itype.getElementName()); + + // search the method. Fortunately, there are no method getSignature() for the type FieldDeclaration. + // So, we search manually + for (FieldDeclaration fs : type.getFields()) { + if (fs.toString().contains((field.getElementName()))) { + return fs; + } + } + } + return null; + } + + @Override + protected List getJavadocTags() { + // any javadoc tag + return null; + } + + /** + * Generate imports that are explicitly declared in the type + * + * @param field2 + * The src type to be transformed + * @param destType + * The jdt dest type to be generated + * @throws JavaModelException + * @throws JDTVisitorException + */ + private void generateExplicitImports(JDTField field2, IType destType) throws JDTVisitorException { + + + // Add explicit type + for (JDTType anImport : field2.getExplicitRequiredImports()) { + try { + destType.getCompilationUnit().createImport(anImport.getQualifiedName(), null, null); + } catch (Exception e) { + propagateException(destType.getFullyQualifiedName() + "Can't add explicit import " + anImport.getQualifiedName(), e); + } + } + + // Add explicit plain text types + for (String anImport : field2.getExplicitPlainTextRequiredImports()) { + try { + destType.getCompilationUnit().createImport(anImport, null, null); + } catch (JavaModelException e) { + propagateException(destType.getFullyQualifiedName() + "Can't add explicit plain text import " + anImport, e); + } + } + + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTGetterSetter.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTGetterSetter.java new file mode 100644 index 00000000000..b1939423c7c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTGetterSetter.java @@ -0,0 +1,168 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; + +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IMethod; +import org.eclipse.jdt.core.IType; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.dom.BodyDeclaration; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.MethodDeclaration; +import org.eclipse.jdt.core.dom.TypeDeclaration; +import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; + +public class SynchJDTGetterSetter extends SynchJDTMethod { + + private JDTField field; + + private GeneratorPreference preference; + + public SynchJDTGetterSetter(IType it, GeneratorPreference preference) { + super(it, preference); + this.preference = preference; + } + + + @Override + public void visit(JDTJavaElement element) throws JDTVisitorException { + this.field = (JDTField) element; + // error if field.getType() == null. indicate in console only + if (field.getType() == null) { + System.err.println("l31 SunchJDTGetterSetter : field.getType() est null pour " + field.getElementName() + " dans " + field.getOwner().getElementName()); + return; + } + + + try { + // name of field + String fieldNameCap = field.getElementName().replaceFirst(".", (field.getElementName().charAt(0) + "").toUpperCase()); + + // generate getter + if (field.getGenerateGetter() == TrueFalseDefault.TRUE || // user demand generate getter + field.getGenerateGetter() == TrueFalseDefault.DEFAULT && preference.generateGetters()) { // or no demand, look at preferences + StringBuffer bufferGet = new StringBuffer(); + + bufferGet.append("public "); + + // handle MultiValued + if (field.isMultiValued()) { + bufferGet.append(SynchTools.getMultiValued(itype, field.getType().getElementName(), preference)); + } else { + bufferGet.append(field.getType().getElementName()); + } + + + bufferGet.append(" get" + fieldNameCap + "() {\n " + + "\t return " + field.getElementName() + "; \n} \n"); + + + + + IMethod imethod = SynchTools.searchIJavaElement(itype.getMethods(), "get" + fieldNameCap); + if (imethod == null) { + IMethod methodGet = itype.createMethod(bufferGet.toString(), null, true, null); + createJavaDocFor(methodGet, itype.getCompilationUnit(), "Getter of " + field.getElementName(), ""); + } + } + + + // generate setter + if (field.getGenerateSetter() == TrueFalseDefault.TRUE || // user demand generate setter + field.getGenerateSetter() == TrueFalseDefault.DEFAULT && preference.generateSetters()) { // or no demand, look at preferences + StringBuffer bufferSet = new StringBuffer(); + + bufferSet.append("public void set" + fieldNameCap + "("); + + // handle MultiValued + if (field.isMultiValued()) { + bufferSet.append(SynchTools.getMultiValued(itype, field.getType().getElementName(), preference)); + } else { + bufferSet.append(field.getType().getElementName()); + } + + bufferSet.append(" " + field.getElementName() + ") { \n" + + "\t this." + field.getElementName() + " = " + field.getElementName() + "; \n} \n "); + + + + + IMethod imethod = SynchTools.searchIJavaElement(itype.getMethods(), "set" + fieldNameCap); + if (imethod == null) { + IMethod methodSet = itype.createMethod(bufferSet.toString(), null, true, null); + createJavaDocFor(methodSet, itype.getCompilationUnit(), "Setter of " + field.getElementName(), ""); + } + } + } catch (JavaModelException e) { + e.printStackTrace(); + throw new JDTVisitorException(e.getMessage(), e.getCause()); + } catch (Exception e) { + e.printStackTrace(); + throw new JDTVisitorException(e.getMessage(), e.getCause()); + } + } + + + @Override + // search the method to insert Javadoc + protected BodyDeclaration searchElementToInsert(CompilationUnit cu, + IJavaElement method) { + + // search Itype parent + if (method.getParent() instanceof IType) { + IType itype = (IType) method.getParent(); + // find the good type + TypeDeclaration type = searchType((TypeDeclaration) cu.types().get(0), itype.getElementName()); + + // search the method. Fortunately, there are no method getSignature() for the type MethodDeclaration. + // So, we search manually + for (MethodDeclaration m : type.getMethods()) { + if (m.getName().toString().equals(method.getElementName())) { + // verify the signature + return m; + /* + * TODO + * if(m.parameters() !=null && m.parameters().size() == 0 && this.method.getParameters().size() == 0) + * return m; + * if(m.parameters().size() == this.method.getParameters().size()) { + * int numParam = 0; + * boolean goodSignature = true; + * for(Object paramObj : m.parameters()) { + * if(paramObj instanceof SingleVariableDeclaration) { + * SingleVariableDeclaration param = (SingleVariableDeclaration) paramObj; + * if(!param.getType().toString().equals(this.method.getParameters().get(numParam).getType().getElementName())) + * goodSignature = false; + * + * numParam++; + * } + * } + * if(goodSignature) + * return m; + * } + */ + } + } + } + + return null; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaModel.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaModel.java new file mode 100644 index 00000000000..7dc71d9ccef --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaModel.java @@ -0,0 +1,73 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; + + +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.jdt.core.IJavaModel; +import org.eclipse.jdt.core.JavaCore; +import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; + +/** + * Allow to generate Code thanks to a JDT model + * + * @author Deblock Nicolas & Manuel Giles + * + */ +public class SynchJDTJavaModel implements JDTVisitor { + + private GeneratorPreference preference; + + /** + * Constructor + * + * @param modelJDT + * the model JDT to generate + */ + public SynchJDTJavaModel(GeneratorPreference preference) { + this.preference = preference; + } + + @Override + public void visit(JDTJavaElement element) throws JDTVisitorException { + // if element can't be generated, we stop all + // if(!element.isGenerated()) return ; + + if (!(element instanceof JDTJavaModel)) { + return; + } + // cast element to JDTJavaModel + JDTJavaModel model = (JDTJavaModel) element; + + // research the IJavaModel + IWorkspaceRoot iroot = ResourcesPlugin.getWorkspace().getRoot(); + IJavaModel ijm = JavaCore.create(iroot); + + + // browse all JDTJavaProject and call the visit + JDTVisitor visitor = new SynchJDTJavaProject(ijm, iroot, preference); + for (JDTJavaProject root : model.getJavaProject()) { + root.accept(visitor); + } + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaProject.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaProject.java new file mode 100644 index 00000000000..fa545843b69 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTJavaProject.java @@ -0,0 +1,145 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IProjectDescription; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.jdt.core.IClasspathEntry; +import org.eclipse.jdt.core.IJavaModel; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.launching.IVMInstall; +import org.eclipse.jdt.launching.JavaRuntime; +import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util.JdtmmPreference; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; + +/** + * Allow to generate Code thanks to a JDT model + * + * @author Deblock Nicolas & Manuel Giles + * + */ +public class SynchJDTJavaProject implements JDTVisitor { + + private IJavaModel ijm; + + private IWorkspaceRoot iroot; + + private GeneratorPreference preference; + + /** + * Constructor + * + * @param modelJDT + * the model JDT to generate + */ + public SynchJDTJavaProject(IJavaModel ijm, IWorkspaceRoot iroot, GeneratorPreference preference) { + this.ijm = ijm; + this.iroot = iroot; + this.preference = preference; + } + + + @Override + public void visit(JDTJavaElement element) throws JDTVisitorException { + // if element can't be generated, we stop all + if (!element.isGenerated()) { + return; + } + + if (!(element instanceof JDTJavaProject)) { + return; + } + // cast element to JDTJavaProject + JDTJavaProject project = (JDTJavaProject) element; + + // set the multi-value for the metamodel + JdtmmPreference.setClassMultiValue(preference.genericClassForMultiValue().substring(preference.genericClassForMultiValue().lastIndexOf(".") + 1)); + + + // search IJavaProject + // IProject projet = iroot.getProject(project.getElementName()); + IJavaProject ijavaProjet = ijm.getJavaProject(project.getElementName()); + IProject proj; + + // if ijavaProjet don't exist, create this! + if (!ijavaProjet.exists()) { + try { + proj = iroot.getProject(project.getElementName()); + if (!proj.exists()) { + proj.create(null); + proj.open(null); + } else if (!proj.isOpen()) { + proj.open(null); + } + + // Specifies type of project + IProjectDescription description = proj.getDescription(); + description.setNatureIds(new String[] { JavaCore.NATURE_ID }); + proj.setDescription(description, null); + } catch (CoreException e) { + e.printStackTrace(); + throw new JDTVisitorException(e.getMessage()); + } + + ijavaProjet = JavaCore.create(proj); + } + + // include the default JRE library if don't exist + List entries = new ArrayList(); + IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall(); + boolean creerJRE = true; + + + try { + // take libs to project class path + for (IClasspathEntry elem : ijavaProjet.getRawClasspath()) { + if (elem.getPath().toString().contains(JavaRuntime.JRE_CONTAINER)) { + creerJRE = false; + } + entries.add(elem); + } + // if jre don't exist, we add it to classpath + if (creerJRE) { + entries.add(JavaCore.newContainerEntry(JavaRuntime.newJREContainerPath(vmInstall))); + ijavaProjet.setRawClasspath(entries.toArray(new IClasspathEntry[entries.size()]), null); + } + } catch (JavaModelException e) { + e.printStackTrace(); + throw new JDTVisitorException(e.getMessage(), e.getCause()); + } + + + + // browse all PackageFragmentRoot and call the visit + JDTVisitor visitor = new SynchJDTPackageFragmentRoot(ijavaProjet, preference); + for (JDTPackageFragmentRoot root : project.getPackageFragmentRoots()) { + root.accept(visitor); + } + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTMethod.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTMethod.java new file mode 100644 index 00000000000..f7b07b36d9c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTMethod.java @@ -0,0 +1,387 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; + + +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.jdt.core.Flags; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IMethod; +import org.eclipse.jdt.core.IType; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.dom.BodyDeclaration; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.MethodDeclaration; +import org.eclipse.jdt.core.dom.SingleVariableDeclaration; +import org.eclipse.jdt.core.dom.TagElement; +import org.eclipse.jdt.core.dom.TypeDeclaration; +import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; + + +/** + * Allow to generate Method in a IType + * + * @author Deblock Nicolas & Manuel Giles + * + */ +public class SynchJDTMethod extends SynchJDTCommentable { + + protected IType itype; + + private JDTMethod method; + + private GeneratorPreference preference; + + /** + * Constructor + * + * @param itype + * the type parent + */ + public SynchJDTMethod(IType itype, GeneratorPreference preference) { + super(); + this.itype = itype; + this.preference = preference; + } + + + + @Override + public void visit(JDTJavaElement element) throws JDTVisitorException { + // if element can't be generated, we stop all + if (!element.isGenerated()) { + return; + } + + method = (JDTMethod) element; + // IntroduceParameterObjectDescript + IMethod imethod = null; + + try { + // See if the method exist + boolean createMethod = true; + + for (IMethod m : itype.getMethods()) { + // if it's the same name, and the same parameterTypes, the method exist + if (m.getElementName().equals(method.getElementName()) && m.getSignature().equals(method.getJDTSignature())) { + // stop all + createMethod = false; + imethod = m; + break; + } + } + + if (createMethod) { + StringBuffer methodStr = new StringBuffer("\n"); + + // visibility + if (itype.isInterface()) { + methodStr.append("public "); + } else { + methodStr.append(SynchTools.getVisibility(method).toString()); + } + + // if method is a constructor, no return Type, and name is class name + if (method.isConstructor()) { + methodStr.append(itype.getElementName() + "("); + } + else { + // return type + if (method.getReturnType() != null) { + // Compute the type, taken into account multivalue + String type = getTypeAsString(method.getReturnType()); + // put the import package + SynchTools.createImport(itype, method.getOwner(), method.getReturnType().getType()); + + methodStr.append(type + " "); + } + else { + methodStr.append("void "); + } + // method name + methodStr.append(method.getElementName() + "("); + } + // parameters + // System.out.println(method.getParam() + " " + method.getParameterTypes()); + int nbParam = 0; + for (JDTParameter p : method.getParameters()) { + String typeName = p.getElementName(); + String type = "Undefined"; + if (p.getType() != null) { + // Compute the type, taken into account multivalue + type = getTypeAsString(p); + // put the import package + SynchTools.createImport(itype, method.getOwner(), p.getType()); + } + + + if (nbParam > 0) { + methodStr.append(", "); + } + methodStr.append(type + " " + typeName); + nbParam++; + } + + // close + methodStr.append(")"); + + // throws + if (method.getExceptions() != null && method.getExceptions().size() > 0) { + methodStr.append(" throws "); + int nbExc = 0; + for (JDTType exception : method.getExceptions()) { + if (nbExc > 0) { + methodStr.append(", "); + } + methodStr.append(exception.getElementName()); + if (!SynchTools.isPrimiveType(exception.getQualifiedName()) && exception.getQualifiedName().contains(".")) { + itype.getCompilationUnit().createImport(exception.getQualifiedName(), null, null); + } + nbExc++; + } + } + + + // Do we need a body ? + if (itype.isInterface() || Flags.isAbstract(method.getFlags())) { + methodStr.append(";"); + } + else { + // Generate Body. Open the body + methodStr.append(" {"); + // If there is a declared body, use it. Otherwise, use the default body. + if (method.getBodies().size() > 0) { + + for (JDTMethodBody body : method.getBodies()) { + methodStr.append("\n\t"); + methodStr.append(body.asText()); + } + // methodStr.append("\n"); + } + else { + // Default body + methodStr.append(" \n\t// TODO Auto-generated method"); + if (method.getReturnType() != null) { + methodStr.append("\n\treturn " + SynchTools.defaultReturn(method.getReturnType().getType().getElementName()) + ";"); + } + + } + // Close the body + methodStr.append("\n }"); + } + + // create the method + imethod = itype.createMethod(methodStr.toString(), null, true, null); + } + + // add javadoc to method + createJavaDocFor(imethod, imethod.getCompilationUnit(), method.getComment(), ""); + // Add explicit imports + generateExplicitImports(method, itype); + } catch (JavaModelException e) { + // e.printStackTrace(); + // throw new JDTVisitorException(e.getMessage(), e.getCause()); + propagateException(e.getMessage(), e); + } catch (Exception e) { + // e.printStackTrace(); + // throw new JDTVisitorException(e.getMessage(), e.getCause()); + propagateException(e.getMessage(), e); + } + + + } + + + /** + * Get the type of the parameter as a String. Take into account the multivalue setting. + * + * @param p + * @return + * @throws JavaModelException + */ + private String getTypeAsString(JDTParameter p) throws JavaModelException { + String type; + if (p.isMultiValued()) { + type = SynchTools.getMultiValued(itype, p.getType().getElementName(), preference); + } else { + type = p.getType().getElementName(); + } + return type; + } + + + + + + /** *************** methods override by SynchJDTCommentable ************** */ + + + @Override + /** + * search the method to insert Javadoc + * + * @see org.eclipse.papyrus.java.generator.jdtsynchronizer.impl.SynchJDTCommentable#searchElementToInsert(org.eclipse.jdt.core.dom.CompilationUnit, org.eclipse.jdt.core.IJavaElement) + * + * @param cu + * @param method + * @return + */ + protected BodyDeclaration searchElementToInsert(CompilationUnit cu, IJavaElement method) { + + // search Itype parent + if (method.getParent() instanceof IType) { + IType itype = (IType) method.getParent(); + // find the good type + TypeDeclaration type = searchType((TypeDeclaration) cu.types().get(0), itype.getElementName()); + + // search the method. Fortunately, there are no method getSignature() for the type MethodDeclaration. + // So, we search manually + for (MethodDeclaration m : type.getMethods()) { + if (m.getName().toString().equals(method.getElementName())) { + // verify the signature + if (m.parameters() != null && m.parameters().size() == 0 && this.method.getParameters().size() == 0) { + return m; + } + if (m.parameters().size() == this.method.getParameters().size()) { + int numParam = 0; + boolean goodSignature = true; + for (Object paramObj : m.parameters()) { + if (paramObj instanceof SingleVariableDeclaration) { + SingleVariableDeclaration param = (SingleVariableDeclaration) paramObj; + if (!param.getType().toString().equals(this.method.getParameters().get(numParam).getType().getElementName())) { + goodSignature = false; + } + + numParam++; + } + } + if (goodSignature) { + return m; + } + } + } + } + } + + return null; + } + + @Override + protected List getJavadocTags() { + List lst = new LinkedList(); + if (method == null) { + return lst; + } + + // parameters + for (JDTParameter param : method.getParameters()) { + String comment = param.getComment(); + if (comment == null) { + comment = ""; + } + lst.add(TagElement.TAG_PARAM + " " + param.getElementName() + " " + comment); + } + + // return + if (method.getReturnType() != null) { + String comment = method.getReturnType().getComment(); + if (comment == null) { + comment = ""; + } + lst.add(TagElement.TAG_RETURN + " " + comment); + } + + // exception + // TODO prendre en compte notion de commentaire + if (method.getExceptions() != null) { + for (JDTType exception : method.getExceptions()) { + // String comment = exception.getComment(); + // if(comment == null) comment = ""; + lst.add(TagElement.TAG_THROWS + " " + exception.getElementName()); + } + } + + + + return lst; + } + + + + /** + * Propagate a {@link JDTVisitorException} if the flag is not set + * + * @param msg + * @param e + * @throws JDTVisitorException + */ + private void propagateException(String msg, Throwable e) throws JDTVisitorException { + + if (preference.stopOnFirstError()) { + throw new JDTVisitorException(msg, e.getCause()); + } + else { + // Show error + System.err.println(msg); + e.printStackTrace(); + } + } + + + + /** + * Generate imports that are explicitly declared in the type + * + * @param srcType + * The src type to be transformed + * @param destType + * The jdt dest type to be generated + * @throws JavaModelException + * @throws JDTVisitorException + */ + private void generateExplicitImports(JDTMethod srcType, IType destType) throws JDTVisitorException { + + + // Add explicit type + for (JDTType anImport : srcType.getExplicitRequiredImports()) { + try { + destType.getCompilationUnit().createImport(anImport.getQualifiedName(), null, null); + } catch (Exception e) { + propagateException(destType.getFullyQualifiedName() + "Can't add explicit import " + anImport.getQualifiedName(), e); + } + } + + // Add explicit plain text types + for (String anImport : srcType.getExplicitPlainTextRequiredImports()) { + try { + destType.getCompilationUnit().createImport(anImport, null, null); + } catch (JavaModelException e) { + propagateException(destType.getFullyQualifiedName() + "Can't add explicit plain text import " + anImport, e); + } + } + + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragment.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragment.java new file mode 100644 index 00000000000..7426838392c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragment.java @@ -0,0 +1,112 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; + +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IPackageFragment; +import org.eclipse.jdt.core.IPackageFragmentRoot; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; + + +/** + * allow to generate package fragment + * + * @author Deblock Nicolas & Manuel Giles + * + */ +public class SynchJDTPackageFragment extends EObjectImpl implements JDTVisitor { + + public IPackageFragmentRoot iroot; + + private GeneratorPreference preference; + + /** + * Constructor + * + * @param iroot + * the IPackageFragmentRoot parent + */ + public SynchJDTPackageFragment(IPackageFragmentRoot iroot, GeneratorPreference preference) { + super(); + this.iroot = iroot; + this.preference = preference; + } + + + @Override + public void visit(JDTJavaElement element) throws JDTVisitorException { + // if element can't be generated, we stop all + if (!element.isGenerated()) { + return; + } + if (!preference.isPackageToGenerate(element.getElementName())) { + return; + } + + JDTPackageFragment packag = (JDTPackageFragment) element; + + try { + // search the package + IJavaElement tmp = null; + IPackageFragment ipack = null; + + + if ((tmp = SynchTools.searchIJavaElement(iroot.getChildren(), packag.getElementName())) != null && + tmp instanceof IPackageFragment) { + ipack = (IPackageFragment) tmp; + } + + // if name=null, it's the default package + if (packag.getQualifiedName() == null) { + // generate Compilation unit without package + IJavaElement defaultPackageElement = SynchTools.searchIJavaElement(iroot.getChildren(), IPackageFragment.DEFAULT_PACKAGE_NAME); + if (defaultPackageElement != null) { + ipack = (IPackageFragment) defaultPackageElement; + } + } + + // if the package don't exist, we create it! + if (ipack == null) { + + // find the name of the package + ipack = iroot.createPackageFragment(packag.getQualifiedName(), true, null); + + } + + // call the children compilationUnit + JDTVisitor visitor = new SynchJDTCompilationUnit(ipack, preference); + for (JDTCompilationUnit cu : packag.getCompilationUnits()) { + cu.accept(visitor); + } + + } catch (JavaModelException e) { + e.printStackTrace(); + throw new JDTVisitorException(e.getMessage(), e.getCause()); + } catch (Exception e) { + e.printStackTrace(); + throw new JDTVisitorException(e.getMessage(), e.getCause()); + } + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragmentRoot.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragmentRoot.java new file mode 100644 index 00000000000..cf023088416 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTPackageFragmentRoot.java @@ -0,0 +1,120 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; + + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.jdt.core.IClasspathEntry; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.IPackageFragmentRoot; +import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; + + +/** + * allow to generate package fragment root + * + * @author Deblock Nicolas & Manuel Giles + * + */ +public class SynchJDTPackageFragmentRoot implements JDTVisitor { + + private IJavaProject iprojet; + + private GeneratorPreference preference; + + /** + * Constructor + * + * @param iprojet + * the project parent + */ + public SynchJDTPackageFragmentRoot(IJavaProject iprojet, GeneratorPreference preference) { + super(); + this.iprojet = iprojet; + this.preference = preference; + } + + + + @Override + public void visit(JDTJavaElement element) throws JDTVisitorException { + // if element can't be generated, we stop all + if (!element.isGenerated()) { + return; + } + + JDTPackageFragmentRoot root = (JDTPackageFragmentRoot) element; + + try { + // research JDTPackageFragmentRoot + IPackageFragmentRoot iroot = SynchTools.searchIJavaElement(iprojet.getAllPackageFragmentRoots(), root.getElementName()); + + // if IPackageFragmentRoot don't exist, we create this + if (iroot == null) { + // create the folder + IFolder sourceFolder = iprojet.getProject().getFolder(root.getElementName()); + try { + sourceFolder.create(false, true, null); + } catch (CoreException e) { + // folder already exist + } + + iroot = iprojet.getPackageFragmentRoot(sourceFolder); + IClasspathEntry[] oldEntries = iprojet.getRawClasspath(); + List newEntries = new ArrayList(); + + // copy the old entries in new entries + for (int i = 0; i < oldEntries.length; i++) { + // don't take the /projectName, else an exception are throw + if (oldEntries[i] != null && !oldEntries[i].getPath().toString().equals("/" + iprojet.getElementName())) { + newEntries.add(oldEntries[i]); + } + } + + // add the new packageFragmentRoot + newEntries.add(JavaCore.newSourceEntry(iroot.getPath())); + + IClasspathEntry[] newEntriesArray = new IClasspathEntry[newEntries.size()]; + newEntries.toArray(newEntriesArray); + + iprojet.setRawClasspath(newEntriesArray, null); + + } + + // call children + JDTVisitor visitPackageFragment = new SynchJDTPackageFragment(iroot, preference); + for (JDTPackageFragment ipack : root.getPackageFragments()) { + ipack.accept(visitPackageFragment); + } + + } catch (JavaModelException e) { + e.printStackTrace(); + throw new JDTVisitorException(e.getMessage(), e.getCause()); + } + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTType.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTType.java new file mode 100644 index 00000000000..7d9560f1cc7 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchJDTType.java @@ -0,0 +1,435 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; + + +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jdt.core.Flags; +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IType; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.TagElement; +import org.eclipse.jdt.core.dom.TypeDeclaration; +import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; + + +/** + * Synchronize a JDTType with JDT. + * Can create a type to a ICompilationUnit or to a IType (useful for intern class). + * + * @author Deblock Nicolas & Giles Manuel + * + */ +public class SynchJDTType extends SynchJDTCommentable { + + /** + * Useful to create a type in a ICompilationUnit + * If icu is null, itype can't be null + */ + private ICompilationUnit icu; + + private GeneratorPreference preference; + + /** + * Useful to create a type in a IType + * If itype is null, icu can't be null + */ + private IType itype; + + /** + * Create a type to a ICompilationUnit + * + * @param icu + */ + public SynchJDTType(ICompilationUnit icu, GeneratorPreference preference) { + super(); + this.icu = icu; + this.preference = preference; + } + + /** + * Create a type to a IType (useful for intern class) + * + * @param itype + */ + public SynchJDTType(IType itype, GeneratorPreference preference) { + super(); + this.itype = itype; + this.preference = preference; + } + + + + @Override + public void visit(JDTJavaElement element) throws JDTVisitorException { + // if element can't be generated, we stop all + if (!element.isGenerated()) { + return; + } + if (SynchTools.isPrimiveType(element.getElementName()) && !element.getElementName().equals("String")) { + return; + } + + JDTType type = (JDTType) element; + + try { + IType it = SynchTools.searchIJavaElement(getTypes(), type.getElementName()); + + // generate type + if (it == null) { + StringBuffer buffer = new StringBuffer(); + + buffer.append(SynchTools.getVisibility(type)); + + // System.out.println("\n\n \t \t ####### " + type.isEnum()); + + if (type.isClass()) { + buffer.append("class "); + } else if (type.isInterface()) { + buffer.append("interface "); + } else if (type.isEnum()) { + + // System.out.println( type.getFields()); + + // generate the field + StringBuffer fieldStr = new StringBuffer(); + int i = 0; + for (JDTField field : type.getFields()) { + if (i > 0) { + fieldStr.append(",\n"); + } + fieldStr.append("\t" + field.getElementName()); + i++; + } + if (!type.getFields().isEmpty()) { + fieldStr.append(";\n\n"); + } + + it = createType("public enum " + type.getElementName() + " { \n" + fieldStr + " \n } ", null, true, null); + return; + /* + * it = createType("public enum " + type.getElementName() + " { \n" + + * fieldStr + + * "\tprivate final int value;\n\n"+ + * + * "\tprivate "+ type.getElementName() +"(int value) {\n"+ + * "\t\tthis.value = value;\n"+ + * "\t}\n\n"+ + * + * "\tpublic int getValue() {\n" + + * "\t\treturn this.value;\n" + + * "\t}\n" + + * "\n}", null, true, null); + * return; + */ + + } + // else, generate nothing + else { + return; + } + + buffer.append(type.getElementName()); + + if (type.getSuperClass() != null) { + buffer.append(" extends "); + buffer.append(type.getSuperClass().getElementName()); + + } + + if (type.getSuperInterfaces() != null && type.getSuperInterfaces().size() > 0) { + if (type.isInterface()) { + buffer.append(" extends "); + } else { + buffer.append(" implements "); + } + + int i = 0; + for (JDTType superInterface : type.getSuperInterfaces()) { + if (i != 0) { + buffer.append(", "); + } + buffer.append(superInterface.getElementName()); + i++; + } + } + + it = createType(buffer.toString() + " { \n\n}", null, true, null); + } + + // add imports + if (type.getSuperClass() != null) { + SynchTools.createImport(it, type, type.getSuperClass()); + } + + if (type.getSuperInterfaces() != null) { + for (JDTType superInterface : type.getSuperInterfaces()) { + SynchTools.createImport(it, type, superInterface); + } + } + + + + // add javaDoc comment + if (type.getComment() != null && !type.getComment().isEmpty()) { + createJavaDocFor(it, it.getCompilationUnit(), type.getComment(), ""); + } + + + // generate field + if (!type.isEnum()) { + JDTVisitor visitor = new SynchJDTField(it, preference); + for (JDTField field : type.getFields()) { + field.accept(visitor); + } + } + + // generate getters and setters + JDTVisitor vgettersetter = new SynchJDTGetterSetter(it, preference); + if (type.isClass()) { + for (JDTField field : type.getFields()) { + field.accept(vgettersetter); + } + } + + + // generate method + JDTVisitor vmethod = new SynchJDTMethod(it, preference); + for (JDTMethod method : type.getMethods()) { + method.accept(vmethod); + } + + // The class implements interface methods only if it's not an abstract class + if (!Flags.isAbstract(type.getFlags())) { + + // recover the superclass + JDTType superClass = type.getSuperClass(); + + // recover the interfaces + List allSuperInterfaces = getAllSuperInterfaces(type); + + // Implement the abstract methods of the superClass (recursive method) + if (preference.implementMethodsOfAbstractClass()) { + implementSuperClassAbstractMethods(it, superClass); + } + + // implements interfaces methods of the super-interfaces + if (preference.implementMethodsOfIntefaces()) { + for (JDTType superInterface : allSuperInterfaces) { + for (JDTMethod superInterfaceMethod : superInterface.getMethods()) { + superInterfaceMethod.accept(vmethod); + } + } + } + } + + + // generate nested class + JDTVisitor vClass = new SynchJDTType(it, preference); + for (JDTType child : type.getTypes()) { + child.accept(vClass); + } + + // Generate explicit imports + generateExplicitImports(type, it); + + } catch (JavaModelException e) { + e.printStackTrace(); + throw new JDTVisitorException(e.getMessage(), e.getCause()); + } catch (Exception e) { + e.printStackTrace(); + throw new JDTVisitorException(e.getMessage(), e.getCause()); + } + + + } + + /** + * Generate imports that are explicitly declared in the type + * + * @param it + * The jdt type to be generated + * @throws JavaModelException + * @throws JDTVisitorException + */ + private void generateExplicitImports(JDTType containerType, IType it) throws JDTVisitorException { + + + // Add explicit type + for (JDTType anImport : containerType.getExplicitRequiredImports()) { + try { + it.getCompilationUnit().createImport(anImport.getQualifiedName(), null, null); + } catch (Exception e) { + propagateException(it.getFullyQualifiedName() + "Can't add explicit import " + anImport.getQualifiedName(), e); + } + } + + // Add explicit plain text types + for (String anImport : containerType.getExplicitPlainTextRequiredImports()) { + try { + it.getCompilationUnit().createImport(anImport, null, null); + } catch (JavaModelException e) { + propagateException(it.getFullyQualifiedName() + "Can't add explicit plain text import " + anImport, e); + } + } + + } + + /** + * get current type + * + * @return + * @throws JavaModelException + */ + private IType[] getTypes() throws JavaModelException { + if (icu != null) { + return icu.getTypes(); + } + return itype.getTypes(); + } + + /** + * create type for a element 'sibling' + * + * @param contents + * the source contents of the type declaration to add + * @param sibling + * the existing element which the type will be inserted immediately before (if null, then this type will be inserted as the last type + * declaration + * @param force + * a flag in case the same name already exists in this type + * @param monitor + * the progress monitor to notify + * @return the newly inserted type + * @throws JavaModelException + */ + private IType createType(String contents, IJavaElement sibling, boolean force, IProgressMonitor monitor) throws JavaModelException + { + if (icu != null) { + return icu.createType(contents, sibling, force, monitor); + } + + return itype.createType(contents, sibling, force, monitor); + } + + + @Override + protected TypeDeclaration searchElementToInsert(CompilationUnit cu, IJavaElement typeName) { + if (!(cu.types().get(0) instanceof TypeDeclaration)) { + return null; + } + TypeDeclaration classType = (TypeDeclaration) cu.types().get(0); + return searchType(classType, typeName.getElementName()); + + } + + @Override + protected List getJavadocTags() { + List lst = new LinkedList(); + lst.add(TagElement.TAG_AUTHOR); + return lst; + } + + /** + * Collect all super interfaces from the super class and the super interfaces (JDTType). Recursive method. + * + * @param superClass + * @return List of all super interfaces + */ + public List getAllSuperInterfaces(JDTType _type) { + List superInterfaces = new LinkedList(); + + // recover its own interfaces + superInterfaces.addAll(_type.getSuperInterfaces()); + + // add interfaces of the super class if it's abstract + if (_type.getSuperClass() != null && _type.getSuperClass().isAbstract()) { + superInterfaces.addAll(getAllSuperInterfaces(_type.getSuperClass())); + } + + // add interfaces of the super interfaces + for (JDTType superInterface : _type.getSuperInterfaces()) { + superInterfaces.addAll(getAllSuperInterfaces(superInterface)); + } + + return superInterfaces; + } + + /** + * Implement the abstract methods of the superClass if the superClass is abstract. It's a recursive method on the super class of the super class. + * + * @param it + * @param superClass + * @throws JDTVisitorException + */ + public void implementSuperClassAbstractMethods(IType it, JDTType superClass) throws JDTVisitorException { + if (superClass == null) { + return; + } + + JDTVisitor vmethod = new SynchJDTMethod(it, preference); + + if (Flags.isAbstract(superClass.getFlags())) { + for (JDTMethod superClassAbstractMethod : superClass.getMethods()) { + // Skip if method is not abstract + if (!superClassAbstractMethod.isAbstract()) { + continue; + } + // Remove the abstract flag to not generate the method with the keyword "abstract" + superClassAbstractMethod.setAbstract(false); + superClassAbstractMethod.accept(vmethod); + superClassAbstractMethod.setAbstract(true); + } + + // Recursive call on the super class of superClass + JDTType superClassSuperClass = superClass.getSuperClass(); + if (superClassSuperClass != null) { + implementSuperClassAbstractMethods(it, superClassSuperClass); + } + } + } + + /** + * Propagate a {@link JDTVisitorException} if the flag is not set + * + * @param msg + * @param e + * @throws JDTVisitorException + */ + private void propagateException(String msg, Throwable e) throws JDTVisitorException { + + if (preference.stopOnFirstError()) { + throw new JDTVisitorException(msg, e.getCause()); + } + else { + // Show error + System.err.println(msg); + e.printStackTrace(); + } + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchTools.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchTools.java new file mode 100644 index 00000000000..89a4d4a586d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer/src/org/eclipse/papyrus/java/generator/jdtsynchronizer/impl/SynchTools.java @@ -0,0 +1,325 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.jdtsynchronizer.impl; + + + +import org.eclipse.jdt.core.Flags; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IType; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; + +/** + * gathers all the util function to synchronize with JDT + * + * @author Nicolas Deblock and Manuel Giles + * + */ +public class SynchTools { + + + /** + * Find a IJavaElement in a list of IJavaElement + * It's util to search a children of a IJavaElement + * + * @param + * a IJavaElement + * @param lstElement + * list of IJavaElement + * @param elementName + * name of IJavaElement which is search + * @return the element who is search, null if there is no element find + */ + public static U searchIJavaElement(U[] lstElement, String elementName) { + for (U e : lstElement) { + if (e.getElementName().equals(elementName)) { + return e; + } + } + return null; + } + + /** + * return the visibility of jdtMember : + * public or private or protected, abstract, static, final, synchronized + * + * @param jdtMember + * @return visibility of jdtMember + */ + public static String getVisibility(JDTMember jdtMember) { + StringBuffer buffer = new StringBuffer(); + + if (Flags.isPublic(jdtMember.getFlags())) { + buffer.append("public "); + } + if (Flags.isPrivate(jdtMember.getFlags())) { + buffer.append("private "); + } + if (Flags.isProtected(jdtMember.getFlags())) { + buffer.append("protected "); + } + + if (Flags.isAbstract(jdtMember.getFlags())) { + buffer.append("abstract "); + } + + if (Flags.isStatic(jdtMember.getFlags())) { + buffer.append("static "); + } + if (Flags.isFinal(jdtMember.getFlags())) { + buffer.append("final "); + } + if (Flags.isSynchronized(jdtMember.getFlags())) { + buffer.append("synchronized "); + } + return buffer.toString(); + } + + /** + * allow to know if a type is primitive + * + * @param typename + * @return true if typename is a primive type + */ + public static boolean isPrimiveType(String typename) { + if (typename.equals("byte")) { + return true; + } + if (typename.equals("char")) { + return true; + } + if (typename.equals("double")) { + return true; + } + if (typename.equals("float")) { + return true; + } + if (typename.equals("int")) { + return true; + } + if (typename.equals("long")) { + return true; + } + if (typename.equals("short")) { + return true; + } + if (typename.equals("boolean")) { + return true; + } + if (typename.equals("String")) { + return true; + } + return false; + } + + /** + * Check if a name represents a pure Java primitive type. + * Pure Java primitive type are Java primitive types that are keywords and not Classes (ie excluding String). + * + * + * @param typename + * @return true if typename is a primive type + */ + public static boolean isPureJavaPrimiveType(String typename) { + if (typename.equals("byte")) { + return true; + } + if (typename.equals("char")) { + return true; + } + if (typename.equals("double")) { + return true; + } + if (typename.equals("float")) { + return true; + } + if (typename.equals("int")) { + return true; + } + if (typename.equals("long")) { + return true; + } + if (typename.equals("short")) { + return true; + } + if (typename.equals("boolean")) { + return true; + } + if (typename.equals("String")) { + return true; + } + return false; + } + + /** + * return the default return of a type (ex: 0 for a int, false for a boolean, null for a class,...) + * + * @param typename + * @return true if typename is a primive type + */ + public static String defaultReturn(String typename) { + if (typename.equals("byte")) { + return "0"; + } + if (typename.equals("char")) { + return "0"; + } + if (typename.equals("double")) { + return "0"; + } + if (typename.equals("float")) { + return "0"; + } + if (typename.equals("int")) { + return "0"; + } + if (typename.equals("long")) { + return "0"; + } + if (typename.equals("short")) { + return "0"; + } + if (typename.equals("boolean")) { + return "false"; + } + + return "null"; + } + + /** + * return the Class of a primitive type (ex : int => Integer) + * + * @param typename + * @return true if typename is a primive type + */ + private static String getPrimiveTypeClass(String typename) { + if (typename.equals("byte")) { + return "Byte"; + } + if (typename.equals("char")) { + return "Character"; + } + if (typename.equals("double")) { + return "Double"; + } + if (typename.equals("float")) { + return "Float"; + } + if (typename.equals("int")) { + return "Integer"; + } + if (typename.equals("long")) { + return "Long"; + } + if (typename.equals("short")) { + return "Short"; + } + if (typename.equals("boolean")) { + return "Boolean"; + } + return typename; + } + + + public static String getPackageFragment(JDTType type) { + try { + if (type.getCompilationUnit() != null) { + return type.getCompilationUnit().getPackageFragment().getQualifiedName(); + } else { + return getPackageFragment(type.getOwner()); + } + } catch (NullPointerException e) { + // id null pointer exception, we return null + return null; + } + } + + public static void createImport(IType itype, JDTType currentType, JDTType importType) throws JavaModelException { + String packageCurrentType = getPackageFragment(currentType); + String packageImportType = getPackageFragment(importType); + + // if no package to import, stop + if (packageImportType == null) { + return; + } + + + // if they have the same package, and if it is not a nested class, we stop + if (packageCurrentType != null && importType.getCompilationUnit() != null && packageCurrentType.equals(packageImportType)) { + return; + } + + // Check if the last segment name is not a primitive name. + // Stop if it is the case (otherwise createImport() throw an exception) + if( isPureJavaPrimiveType(importType.getElementName())) { + return; + } + + String _import = importType.getQualifiedName(); + if (!SynchTools.isPrimiveType(_import) && _import.contains(".")) { + itype.getCompilationUnit().createImport(_import, null, null); + } + } + + /** + * Get the multivalued declaration for the specified typeName. + * + * @param type + * The enclosing type that will contains the declaration. Requested to ajust import. + * @param typeName + * The type for wich a multivalued statement is requested + * @param preference + * The preferences + * @return The multivalued statement for the specified typeName. + * + * @throws JavaModelException + */ + public static String getMultiValued(IType type, String typeName, GeneratorPreference preference) throws JavaModelException { + // create the import + String _classQualifiedName = preference.genericClassForMultiValue(); + String _class = _classQualifiedName.substring(_classQualifiedName.lastIndexOf(".") + 1); + + type.getCompilationUnit().createImport(_classQualifiedName, null, null); + return _class + "<" + getPrimiveTypeClass(typeName) + ">"; + } + + /** + * Get the multivalued declaration for the specified typeName. + * + * @param type + * The enclosing type that will contains the declaration. Requested to ajust import. + * @param typeName + * The type for wich a multivalued statement is requested + * @param preference + * The preferences + * @return The multivalued statement for the specified typeName. + * + * @throws JavaModelException + */ + public static String getMultiValued(IType type, JDTType valueType, GeneratorPreference preference) throws JavaModelException { + // create the import + String _classQualifiedName = preference.genericClassForMultiValue(); + String _class = _classQualifiedName.substring(_classQualifiedName.lastIndexOf(".") + 1); + + type.getCompilationUnit().createImport(_classQualifiedName, null, null); + return _class + "<" + getPrimiveTypeClass(valueType.getElementName()) + ">"; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.classpath b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.project b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.project new file mode 100644 index 00000000000..0288cbb8ed8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.java.generator.metamodel.jdt.edit + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..22a5ba0c5dc --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Export-Package: org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider, + org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.papyrus.java.generator.metamodel.jdt;bundle-version="1.2.0";visibility:=reexport, + org.eclipse.emf.edit;visibility:=reexport, + org.eclipse.uml2.types;visibility:=reexport, + org.eclipse.uml2.common.edit;visibility:=reexport +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-Version: 1.2.0.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider.GeneratoroptionsmmEditPlugin$Implementation +Bundle-SymbolicName: org.eclipse.papyrus.java.generator.metamodel.jdt.edit;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/about.html b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/build.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/build.properties new file mode 100644 index 00000000000..b686a6bcfc4 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/build.properties @@ -0,0 +1,12 @@ +# + +bin.includes = .,\ + icons/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties,\ + about.html +jars.compile.order = . +source.. = src/ +output.. = bin/ +src.includes = about.html diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTClass.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTClass.gif new file mode 100644 index 00000000000..5b6f7bd4d41 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTClass.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTEnum.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTEnum.gif new file mode 100644 index 00000000000..b7364612037 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTEnum.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTInterface.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTInterface.gif new file mode 100644 index 00000000000..fb66338ebff Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTInterface.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTType.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTType.gif new file mode 100644 index 00000000000..f7c61c23bbd Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTCompilationUnit_types_JDTType.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaModel_javaProject_JDTJavaProject.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaModel_javaProject_JDTJavaProject.gif new file mode 100644 index 00000000000..41c86b3dbc1 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaModel_javaProject_JDTJavaProject.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaProject_packageFragmentRoots_JDTPackageFragmentRoot.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaProject_packageFragmentRoots_JDTPackageFragmentRoot.gif new file mode 100644 index 00000000000..07adaab9f3a Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTJavaProject_packageFragmentRoots_JDTPackageFragmentRoot.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMember_typeParameters_JDTTypeParameter.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMember_typeParameters_JDTTypeParameter.gif new file mode 100644 index 00000000000..c3c4510a051 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMember_typeParameters_JDTTypeParameter.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_JDTOpaqueBody.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_JDTOpaqueBody.gif new file mode 100644 index 00000000000..e5d4d731cc6 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_JDTOpaqueBody.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_OpaqueMethodBody.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_OpaqueMethodBody.gif new file mode 100644 index 00000000000..d5f8c8dbcfb Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_bodies_OpaqueMethodBody.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_parameters_JDTParameter.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_parameters_JDTParameter.gif new file mode 100644 index 00000000000..d7724b60a25 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_parameters_JDTParameter.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_returnType_JDTParameter.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_returnType_JDTParameter.gif new file mode 100644 index 00000000000..d7724b60a25 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTMethod_returnType_JDTParameter.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragmentRoot_packageFragments_JDTPackageFragment.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragmentRoot_packageFragments_JDTPackageFragment.gif new file mode 100644 index 00000000000..932fde3646a Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragmentRoot_packageFragments_JDTPackageFragment.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_compilationUnits_JDTCompilationUnit.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_compilationUnits_JDTCompilationUnit.gif new file mode 100644 index 00000000000..953143344d9 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_compilationUnits_JDTCompilationUnit.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_packageFragments_JDTPackageFragment.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_packageFragments_JDTPackageFragment.gif new file mode 100644 index 00000000000..df3eebc9432 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTPackageFragment_packageFragments_JDTPackageFragment.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_fields_JDTField.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_fields_JDTField.gif new file mode 100644 index 00000000000..2c2ef1ff95c Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_fields_JDTField.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_methods_JDTMethod.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_methods_JDTMethod.gif new file mode 100644 index 00000000000..a64a033a18c Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_methods_JDTMethod.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTClass.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTClass.gif new file mode 100644 index 00000000000..e5f323d1f47 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTClass.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTEnum.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTEnum.gif new file mode 100644 index 00000000000..a6e5cfd32c1 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTEnum.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTInterface.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTInterface.gif new file mode 100644 index 00000000000..2f6d3eba40f Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTInterface.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTType.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTType.gif new file mode 100644 index 00000000000..11148cf465f Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/ctool16/CreateJDTType_types_JDTType.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTClass.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTClass.gif new file mode 100644 index 00000000000..10d222998af Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTClass.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTCompilationUnit.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTCompilationUnit.gif new file mode 100644 index 00000000000..05dc74ad5da Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTCompilationUnit.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTEnum.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTEnum.gif new file mode 100644 index 00000000000..ed874747401 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTEnum.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTException.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTException.gif new file mode 100644 index 00000000000..c4fb30e9687 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTException.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTField.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTField.gif new file mode 100644 index 00000000000..1e5345fb323 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTField.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportContainer.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportContainer.gif new file mode 100644 index 00000000000..53500daf98e Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportContainer.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportDeclaration.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportDeclaration.gif new file mode 100644 index 00000000000..d3dc5a9ad81 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTImportDeclaration.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTInterface.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTInterface.gif new file mode 100644 index 00000000000..c3370c7ddd5 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTInterface.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaElement.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaElement.gif new file mode 100644 index 00000000000..94c953e013b Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaElement.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaModel.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaModel.gif new file mode 100644 index 00000000000..4365960a04b Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaModel.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaProject.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaProject.gif new file mode 100644 index 00000000000..a26660ec28f Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTJavaProject.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTMethod.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTMethod.gif new file mode 100644 index 00000000000..30f0c48da8d Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTMethod.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTOpaqueBody.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTOpaqueBody.gif new file mode 100644 index 00000000000..5a9bc7514fa Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTOpaqueBody.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragment.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragment.gif new file mode 100644 index 00000000000..c414fe9f728 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragment.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragmentRoot.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragmentRoot.gif new file mode 100644 index 00000000000..48e3cf22687 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTPackageFragmentRoot.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTParameter.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTParameter.gif new file mode 100644 index 00000000000..7c2aaac84ee Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTParameter.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTTypeParameter.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTTypeParameter.gif new file mode 100644 index 00000000000..94c953e013b Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/JDTTypeParameter.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/OpaqueMethodBody.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/OpaqueMethodBody.gif new file mode 100644 index 00000000000..98b351f1c44 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/OpaqueMethodBody.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/Options.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/Options.gif new file mode 100644 index 00000000000..cdd3b76e3c0 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/icons/full/obj16/Options.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.properties new file mode 100644 index 00000000000..2f93b958827 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.properties @@ -0,0 +1,22 @@ +# + +pluginName = Jdt metamodel Edit Support (Incubation) +providerName = Eclipse Modeling Project + +_UI_CreateChild_text = {0} +_UI_CreateChild_text2 = {1} {0} +_UI_CreateChild_text3 = {1} +_UI_CreateChild_tooltip = Create New {0} Under {1} Feature +_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}. +_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent. + +_UI_PropertyDescriptor_description = The {0} of the {1} + +_UI_Options_type = Options +_UI_Unknown_type = Object + +_UI_Unknown_datatype= Value + +_UI_Options_defaultSourceFolder_feature = Default Source Folder +_UI_Unknown_feature = Unspecified + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.xml new file mode 100644 index 00000000000..df8624cdbb7 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/plugin.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/pom.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/pom.xml new file mode 100644 index 00000000000..15615586c14 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.java.generator.metamodel.jdt.edit + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmEditPlugin.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmEditPlugin.java new file mode 100644 index 00000000000..3e8e80040f5 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmEditPlugin.java @@ -0,0 +1,95 @@ +/** + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider; + +import org.eclipse.emf.common.EMFPlugin; +import org.eclipse.emf.common.util.ResourceLocator; + +/** + * This is the central singleton for the Generatoroptionsmm edit plugin. + * + * + * + * @generated + */ +public final class GeneratoroptionsmmEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * + * @generated + */ + public static final GeneratoroptionsmmEditPlugin INSTANCE = new GeneratoroptionsmmEditPlugin(); + + /** + * Keep track of the singleton. + * + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * + * @generated + */ + public GeneratoroptionsmmEditPlugin() { + super(new ResourceLocator[] { + }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * + * @generated + */ + public static class Implementation extends EclipsePlugin { + /** + * Creates an instance. + * + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmItemProviderAdapterFactory.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmItemProviderAdapterFactory.java new file mode 100644 index 00000000000..88634641cf3 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/GeneratoroptionsmmItemProviderAdapterFactory.java @@ -0,0 +1,221 @@ +/** + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.edit.provider.ChangeNotifier; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.IChangeNotifier; +import org.eclipse.emf.edit.provider.IDisposable; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.INotifyChangedListener; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.util.GeneratoroptionsmmAdapterFactory; + +/** + * This is the factory that is used to provide the interfaces needed to support Viewers. + * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. + * The adapters also support Eclipse property sheets. + * Note that most of the adapters are shared among multiple instances. + * + * + * + * @generated + */ +public class GeneratoroptionsmmItemProviderAdapterFactory extends GeneratoroptionsmmAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { + /** + * This keeps track of the root adapter factory that delegates to this adapter factory. + * + * + * + * @generated + */ + protected ComposedAdapterFactory parentAdapterFactory; + + /** + * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. + * + * + * + * @generated + */ + protected IChangeNotifier changeNotifier = new ChangeNotifier(); + + /** + * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. + * + * + * + * @generated + */ + protected Collection supportedTypes = new ArrayList(); + + /** + * This constructs an instance. + * + * + * + * @generated + */ + public GeneratoroptionsmmItemProviderAdapterFactory() { + supportedTypes.add(IEditingDomainItemProvider.class); + supportedTypes.add(IStructuredItemContentProvider.class); + supportedTypes.add(ITreeItemContentProvider.class); + supportedTypes.add(IItemLabelProvider.class); + supportedTypes.add(IItemPropertySource.class); + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options} instances. + * + * + * + * @generated + */ + protected OptionsItemProvider optionsItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options}. + * + * + * + * @generated + */ + @Override + public Adapter createOptionsAdapter() { + if (optionsItemProvider == null) { + optionsItemProvider = new OptionsItemProvider(this); + } + + return optionsItemProvider; + } + + /** + * This returns the root adapter factory that contains this factory. + * + * + * + * @generated + */ + @Override + public ComposeableAdapterFactory getRootAdapterFactory() { + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); + } + + /** + * This sets the composed adapter factory that contains this factory. + * + * + * + * @generated + */ + @Override + public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { + this.parentAdapterFactory = parentAdapterFactory; + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isFactoryForType(Object type) { + return supportedTypes.contains(type) || super.isFactoryForType(type); + } + + /** + * This implementation substitutes the factory itself as the key for the adapter. + * + * + * + * @generated + */ + @Override + public Adapter adapt(Notifier notifier, Object type) { + return super.adapt(notifier, this); + } + + /** + * + * + * + * @generated + */ + @Override + public Object adapt(Object object, Object type) { + if (isFactoryForType(type)) { + Object adapter = super.adapt(object, type); + if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { + return adapter; + } + } + + return null; + } + + /** + * This adds a listener. + * + * + * + * @generated + */ + @Override + public void addListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.addListener(notifyChangedListener); + } + + /** + * This removes a listener. + * + * + * + * @generated + */ + @Override + public void removeListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.removeListener(notifyChangedListener); + } + + /** + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. + * + * + * + * @generated + */ + @Override + public void fireNotifyChanged(Notification notification) { + changeNotifier.fireNotifyChanged(notification); + + if (parentAdapterFactory != null) { + parentAdapterFactory.fireNotifyChanged(notification); + } + } + + /** + * This disposes all of the item providers created by this factory. + * + * + * + * @generated + */ + @Override + public void dispose() { + if (optionsItemProvider != null) { + optionsItemProvider.dispose(); + } + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/OptionsItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/OptionsItemProvider.java new file mode 100644 index 00000000000..57d2268c2de --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/provider/OptionsItemProvider.java @@ -0,0 +1,164 @@ +/** + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options} object. + * + * + * + * @generated + */ +public class OptionsItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public OptionsItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addDefaultSourceFolderPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Default Source Folder feature. + * + * + * + * @generated + */ + protected void addDefaultSourceFolderPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Options_defaultSourceFolder_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Options_defaultSourceFolder_feature", "_UI_Options_type"), + GeneratoroptionsmmPackage.Literals.OPTIONS__DEFAULT_SOURCE_FOLDER, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns Options.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Options")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((Options) object).getDefaultSourceFolder(); + return label == null || label.length() == 0 ? + getString("_UI_Options_type") : + getString("_UI_Options_type") + " " + label; + } + + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(Options.class)) { + case GeneratoroptionsmmPackage.OPTIONS__DEFAULT_SOURCE_FOLDER: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return GeneratoroptionsmmEditPlugin.INSTANCE; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTClassItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTClassItemProvider.java new file mode 100644 index 00000000000..a0298c0858e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTClassItemProvider.java @@ -0,0 +1,135 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass} object. + * + * + * + * @generated + */ +public class JDTClassItemProvider + extends JDTTypeItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTClassItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns JDTClass.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTClass")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTClass) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTClass_type") : + getString("_UI_JDTClass_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTCompilationUnitItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTCompilationUnitItemProvider.java new file mode 100644 index 00000000000..6f0ec9edd1c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTCompilationUnitItemProvider.java @@ -0,0 +1,242 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.uml2.common.edit.command.SubsetAddCommand; +import org.eclipse.uml2.common.edit.command.SubsetSupersetReplaceCommand; +import org.eclipse.uml2.common.edit.command.SupersetRemoveCommand; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit} object. + * + * + * + * @generated + */ +public class JDTCompilationUnitItemProvider + extends JDTTypeRootItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTCompilationUnitItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES); + } + return childrenFeatures; + } + + /** + * + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns JDTCompilationUnit.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTCompilationUnit")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTCompilationUnit) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTCompilationUnit_type") : + getString("_UI_JDTCompilationUnit_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTCompilationUnit.class)) { + case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES, + JdtmmFactory.eINSTANCE.createJDTClass())); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES, + JdtmmFactory.eINSTANCE.createJDTInterface())); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES, + JdtmmFactory.eINSTANCE.createJDTEnum())); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createAddCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection, int) + * + * + * @generated + */ + @Override + protected Command createAddCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection, int index) { + if (feature == JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES) { + return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); + } + return super.createAddCommand(domain, owner, feature, collection, index); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection) + * + * + * @generated + */ + @Override + protected Command createRemoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection) { + if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { + return new SupersetRemoveCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES }, collection); + } + return super.createRemoveCommand(domain, owner, feature, collection); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createReplaceCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject, java.util.Collection) + * + * + * @generated + */ + @Override + protected Command createReplaceCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, EObject value, Collection collection) { + if (feature == JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); + } + if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, null, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_COMPILATION_UNIT__TYPES }, value, collection); + } + return super.createReplaceCommand(domain, owner, feature, value, collection); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTEnumItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTEnumItemProvider.java new file mode 100644 index 00000000000..03cc577662b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTEnumItemProvider.java @@ -0,0 +1,135 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum} object. + * + * + * + * @generated + */ +public class JDTEnumItemProvider + extends JDTTypeItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTEnumItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns JDTEnum.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTEnum")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTEnum) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTEnum_type") : + getString("_UI_JDTEnum_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTExceptionItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTExceptionItemProvider.java new file mode 100644 index 00000000000..7425bf22b7a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTExceptionItemProvider.java @@ -0,0 +1,145 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException} object. + * + * + * + * @generated + */ +public class JDTExceptionItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTExceptionItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns JDTException.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTException")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_JDTException_type"); + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return JdtmmEditPlugin.INSTANCE; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTFieldItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTFieldItemProvider.java new file mode 100644 index 00000000000..06ce121e867 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTFieldItemProvider.java @@ -0,0 +1,343 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField} object. + * + * + * + * @generated + */ +public class JDTFieldItemProvider + extends JDTMemberItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTFieldItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addAbstractPropertyDescriptor(object); + addFinalPropertyDescriptor(object); + addStaticPropertyDescriptor(object); + addIsMultiValuedPropertyDescriptor(object); + addTypePropertyDescriptor(object); + addValuePropertyDescriptor(object); + addGenerateGetterPropertyDescriptor(object); + addGenerateSetterPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Abstract feature. + * + * + * + * @generated + */ + protected void addAbstractPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTField_abstract_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTField_abstract_feature", "_UI_JDTField_type"), + JdtmmPackage.Literals.JDT_FIELD__ABSTRACT, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Final feature. + * + * + * + * @generated + */ + protected void addFinalPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTField_final_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTField_final_feature", "_UI_JDTField_type"), + JdtmmPackage.Literals.JDT_FIELD__FINAL, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Static feature. + * + * + * + * @generated + */ + protected void addStaticPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTField_static_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTField_static_feature", "_UI_JDTField_type"), + JdtmmPackage.Literals.JDT_FIELD__STATIC, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Multi Valued feature. + * + * + * + * @generated + */ + protected void addIsMultiValuedPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTField_isMultiValued_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTField_isMultiValued_feature", "_UI_JDTField_type"), + JdtmmPackage.Literals.JDT_FIELD__IS_MULTI_VALUED, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Type feature. + * + * + * + * @generated + */ + protected void addTypePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTField_type_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTField_type_feature", "_UI_JDTField_type"), + JdtmmPackage.Literals.JDT_FIELD__TYPE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Value feature. + * + * + * + * @generated + */ + protected void addValuePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTField_value_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTField_value_feature", "_UI_JDTField_type"), + JdtmmPackage.Literals.JDT_FIELD__VALUE, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Generate Getter feature. + * + * + * + * @generated + */ + protected void addGenerateGetterPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTField_generateGetter_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTField_generateGetter_feature", "_UI_JDTField_type"), + JdtmmPackage.Literals.JDT_FIELD__GENERATE_GETTER, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Generate Setter feature. + * + * + * + * @generated + */ + protected void addGenerateSetterPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTField_generateSetter_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTField_generateSetter_feature", "_UI_JDTField_type"), + JdtmmPackage.Literals.JDT_FIELD__GENERATE_SETTER, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns JDTField.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTField")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTField) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTField_type") : + getString("_UI_JDTField_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTField.class)) { + case JdtmmPackage.JDT_FIELD__ABSTRACT: + case JdtmmPackage.JDT_FIELD__FINAL: + case JdtmmPackage.JDT_FIELD__STATIC: + case JdtmmPackage.JDT_FIELD__IS_MULTI_VALUED: + case JdtmmPackage.JDT_FIELD__VALUE: + case JdtmmPackage.JDT_FIELD__GENERATE_GETTER: + case JdtmmPackage.JDT_FIELD__GENERATE_SETTER: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportContainerItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportContainerItemProvider.java new file mode 100644 index 00000000000..db59b9cf788 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportContainerItemProvider.java @@ -0,0 +1,135 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer} object. + * + * + * + * @generated + */ +public class JDTImportContainerItemProvider + extends JDTParentJavaElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTImportContainerItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns JDTImportContainer.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTImportContainer")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTImportContainer) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTImportContainer_type") : + getString("_UI_JDTImportContainer_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportDeclarationItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportDeclarationItemProvider.java new file mode 100644 index 00000000000..00b887558c4 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTImportDeclarationItemProvider.java @@ -0,0 +1,135 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration} object. + * + * + * + * @generated + */ +public class JDTImportDeclarationItemProvider + extends JDTJavaElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTImportDeclarationItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns JDTImportDeclaration.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTImportDeclaration")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTImportDeclaration) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTImportDeclaration_type") : + getString("_UI_JDTImportDeclaration_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTInterfaceItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTInterfaceItemProvider.java new file mode 100644 index 00000000000..53afb9f522a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTInterfaceItemProvider.java @@ -0,0 +1,135 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface} object. + * + * + * + * @generated + */ +public class JDTInterfaceItemProvider + extends JDTTypeItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTInterfaceItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns JDTInterface.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTInterface")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTInterface) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTInterface_type") : + getString("_UI_JDTInterface_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaElementItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaElementItemProvider.java new file mode 100644 index 00000000000..3b3ae3d9dab --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaElementItemProvider.java @@ -0,0 +1,270 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement} object. + * + * + * + * @generated + */ +public class JDTJavaElementItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTJavaElementItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addElementNamePropertyDescriptor(object); + addElementTypePropertyDescriptor(object); + addCommentPropertyDescriptor(object); + addGeneratedPropertyDescriptor(object); + addParentPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Parent feature. + * + * + * + * @generated + */ + protected void addParentPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTJavaElement_parent_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTJavaElement_parent_feature", "_UI_JDTJavaElement_type"), + JdtmmPackage.Literals.JDT_JAVA_ELEMENT__PARENT, + false, + false, + false, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Element Name feature. + * + * + * + * @generated + */ + protected void addElementNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTJavaElement_elementName_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTJavaElement_elementName_feature", "_UI_JDTJavaElement_type"), + JdtmmPackage.Literals.JDT_JAVA_ELEMENT__ELEMENT_NAME, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Element Type feature. + * + * + * + * @generated + */ + protected void addElementTypePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTJavaElement_elementType_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTJavaElement_elementType_feature", "_UI_JDTJavaElement_type"), + JdtmmPackage.Literals.JDT_JAVA_ELEMENT__ELEMENT_TYPE, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Comment feature. + * + * + * + * @generated + */ + protected void addCommentPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTJavaElement_comment_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTJavaElement_comment_feature", "_UI_JDTJavaElement_type"), + JdtmmPackage.Literals.JDT_JAVA_ELEMENT__COMMENT, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Generated feature. + * + * + * + * @generated + */ + protected void addGeneratedPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTJavaElement_generated_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTJavaElement_generated_feature", "_UI_JDTJavaElement_type"), + JdtmmPackage.Literals.JDT_JAVA_ELEMENT__GENERATED, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTJavaElement) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTJavaElement_type") : + getString("_UI_JDTJavaElement_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTJavaElement.class)) { + case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_NAME: + case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_TYPE: + case JdtmmPackage.JDT_JAVA_ELEMENT__COMMENT: + case JdtmmPackage.JDT_JAVA_ELEMENT__GENERATED: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return JdtmmEditPlugin.INSTANCE; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaModelItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaModelItemProvider.java new file mode 100644 index 00000000000..3c1c389f517 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaModelItemProvider.java @@ -0,0 +1,181 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel} object. + * + * + * + * @generated + */ +public class JDTJavaModelItemProvider + extends JDTParentJavaElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTJavaModelItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(JdtmmPackage.Literals.JDT_JAVA_MODEL__JAVA_PROJECT); + } + return childrenFeatures; + } + + /** + * + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns JDTJavaModel.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTJavaModel")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTJavaModel) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTJavaModel_type") : + getString("_UI_JDTJavaModel_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTJavaModel.class)) { + case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_JAVA_MODEL__JAVA_PROJECT, + JdtmmFactory.eINSTANCE.createJDTJavaProject())); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaProjectItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaProjectItemProvider.java new file mode 100644 index 00000000000..f1c6006b642 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTJavaProjectItemProvider.java @@ -0,0 +1,232 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.uml2.common.edit.command.SubsetAddCommand; +import org.eclipse.uml2.common.edit.command.SubsetSupersetReplaceCommand; +import org.eclipse.uml2.common.edit.command.SupersetRemoveCommand; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject} object. + * + * + * + * @generated + */ +public class JDTJavaProjectItemProvider + extends JDTParentJavaElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTJavaProjectItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(JdtmmPackage.Literals.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS); + } + return childrenFeatures; + } + + /** + * + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns JDTJavaProject.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTJavaProject")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTJavaProject) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTJavaProject_type") : + getString("_UI_JDTJavaProject_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTJavaProject.class)) { + case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS, + JdtmmFactory.eINSTANCE.createJDTPackageFragmentRoot())); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createAddCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection, int) + * + * + * @generated + */ + @Override + protected Command createAddCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection, int index) { + if (feature == JdtmmPackage.Literals.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS) { + return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); + } + return super.createAddCommand(domain, owner, feature, collection, index); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection) + * + * + * @generated + */ + @Override + protected Command createRemoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection) { + if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { + return new SupersetRemoveCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS }, collection); + } + return super.createRemoveCommand(domain, owner, feature, collection); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createReplaceCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject, java.util.Collection) + * + * + * @generated + */ + @Override + protected Command createReplaceCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, EObject value, Collection collection) { + if (feature == JdtmmPackage.Literals.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); + } + if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, null, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS }, value, collection); + } + return super.createReplaceCommand(domain, owner, feature, value, collection); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMemberItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMemberItemProvider.java new file mode 100644 index 00000000000..28301611c75 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMemberItemProvider.java @@ -0,0 +1,247 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember} object. + * + * + * + * @generated + */ +public class JDTMemberItemProvider + extends JDTParentJavaElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTMemberItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addVisibilityPropertyDescriptor(object); + addExplicitRequiredImportsPropertyDescriptor(object); + addExplicitPlainTextRequiredImportsPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Visibility feature. + * + * + * + * @generated + */ + protected void addVisibilityPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTMember_visibility_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTMember_visibility_feature", "_UI_JDTMember_type"), + JdtmmPackage.Literals.JDT_MEMBER__VISIBILITY, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Explicit Required Imports feature. + * + * + * + * @generated + */ + protected void addExplicitRequiredImportsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTMember_explicitRequiredImports_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTMember_explicitRequiredImports_feature", "_UI_JDTMember_type"), + JdtmmPackage.Literals.JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Explicit Plain Text Required Imports feature. + * + * + * + * @generated + */ + protected void addExplicitPlainTextRequiredImportsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTMember_explicitPlainTextRequiredImports_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTMember_explicitPlainTextRequiredImports_feature", "_UI_JDTMember_type"), + JdtmmPackage.Literals.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(JdtmmPackage.Literals.JDT_MEMBER__TYPE_PARAMETERS); + } + return childrenFeatures; + } + + /** + * + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTMember) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTMember_type") : + getString("_UI_JDTMember_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTMember.class)) { + case JdtmmPackage.JDT_MEMBER__VISIBILITY: + case JdtmmPackage.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_MEMBER__TYPE_PARAMETERS, + JdtmmFactory.eINSTANCE.createJDTTypeParameter())); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodBodyItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodBodyItemProvider.java new file mode 100644 index 00000000000..6e2cc034d23 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodBodyItemProvider.java @@ -0,0 +1,117 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody} object. + * + * + * + * @generated + */ +public class JDTMethodBodyItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTMethodBodyItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_JDTMethodBody_type"); + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return JdtmmEditPlugin.INSTANCE; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodItemProvider.java new file mode 100644 index 00000000000..c99f0c834ec --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTMethodItemProvider.java @@ -0,0 +1,371 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod} object. + * + * + * + * @generated + */ +public class JDTMethodItemProvider + extends JDTMemberItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTMethodItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addAbstractPropertyDescriptor(object); + addFinalPropertyDescriptor(object); + addStaticPropertyDescriptor(object); + addExceptionsPropertyDescriptor(object); + addSynchronizedPropertyDescriptor(object); + addConstructorPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Abstract feature. + * + * + * + * @generated + */ + protected void addAbstractPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTMethod_abstract_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTMethod_abstract_feature", "_UI_JDTMethod_type"), + JdtmmPackage.Literals.JDT_METHOD__ABSTRACT, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Final feature. + * + * + * + * @generated + */ + protected void addFinalPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTMethod_final_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTMethod_final_feature", "_UI_JDTMethod_type"), + JdtmmPackage.Literals.JDT_METHOD__FINAL, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Static feature. + * + * + * + * @generated + */ + protected void addStaticPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTMethod_static_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTMethod_static_feature", "_UI_JDTMethod_type"), + JdtmmPackage.Literals.JDT_METHOD__STATIC, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Exceptions feature. + * + * + * + * @generated + */ + protected void addExceptionsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTMethod_exceptions_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTMethod_exceptions_feature", "_UI_JDTMethod_type"), + JdtmmPackage.Literals.JDT_METHOD__EXCEPTIONS, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Synchronized feature. + * + * + * + * @generated + */ + protected void addSynchronizedPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTMethod_synchronized_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTMethod_synchronized_feature", "_UI_JDTMethod_type"), + JdtmmPackage.Literals.JDT_METHOD__SYNCHRONIZED, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Constructor feature. + * + * + * + * @generated + */ + protected void addConstructorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTMethod_constructor_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTMethod_constructor_feature", "_UI_JDTMethod_type"), + JdtmmPackage.Literals.JDT_METHOD__CONSTRUCTOR, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(JdtmmPackage.Literals.JDT_METHOD__RETURN_TYPE); + childrenFeatures.add(JdtmmPackage.Literals.JDT_METHOD__PARAMETERS); + childrenFeatures.add(JdtmmPackage.Literals.JDT_METHOD__BODIES); + } + return childrenFeatures; + } + + /** + * + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns JDTMethod.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTMethod")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTMethod) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTMethod_type") : + getString("_UI_JDTMethod_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTMethod.class)) { + case JdtmmPackage.JDT_METHOD__ABSTRACT: + case JdtmmPackage.JDT_METHOD__FINAL: + case JdtmmPackage.JDT_METHOD__STATIC: + case JdtmmPackage.JDT_METHOD__SYNCHRONIZED: + case JdtmmPackage.JDT_METHOD__CONSTRUCTOR: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case JdtmmPackage.JDT_METHOD__RETURN_TYPE: + case JdtmmPackage.JDT_METHOD__PARAMETERS: + case JdtmmPackage.JDT_METHOD__BODIES: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_METHOD__RETURN_TYPE, + JdtmmFactory.eINSTANCE.createJDTParameter())); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_METHOD__PARAMETERS, + JdtmmFactory.eINSTANCE.createJDTParameter())); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_METHOD__BODIES, + JdtmmFactory.eINSTANCE.createJDTOpaqueBody())); + } + + /** + * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}. + * + * + * + * @generated + */ + @Override + public String getCreateChildText(Object owner, Object feature, Object child, Collection selection) { + Object childFeature = feature; + Object childObject = child; + + boolean qualify = + childFeature == JdtmmPackage.Literals.JDT_METHOD__RETURN_TYPE || + childFeature == JdtmmPackage.Literals.JDT_METHOD__PARAMETERS; + + if (qualify) { + return getString("_UI_CreateChild_text2", + new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) }); + } + return super.getCreateChildText(owner, feature, child, selection); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTOpaqueBodyItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTOpaqueBodyItemProvider.java new file mode 100644 index 00000000000..4f60a443ca8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTOpaqueBodyItemProvider.java @@ -0,0 +1,153 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody} object. + * + * + * + * @generated + */ +public class JDTOpaqueBodyItemProvider + extends JDTMethodBodyItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTOpaqueBodyItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + add_bodyPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the body feature. + * + * + * + * @generated + */ + protected void add_bodyPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTOpaqueBody__body_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTOpaqueBody__body_feature", "_UI_JDTOpaqueBody_type"), + JdtmmPackage.Literals.JDT_OPAQUE_BODY__BODY, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns JDTOpaqueBody.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTOpaqueBody")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTOpaqueBody) object).get_body(); + return label == null || label.length() == 0 ? + getString("_UI_JDTOpaqueBody_type") : + getString("_UI_JDTOpaqueBody_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTOpaqueBody.class)) { + case JdtmmPackage.JDT_OPAQUE_BODY__BODY: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentItemProvider.java new file mode 100644 index 00000000000..105e8771d7a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentItemProvider.java @@ -0,0 +1,232 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.uml2.common.edit.command.SubsetAddCommand; +import org.eclipse.uml2.common.edit.command.SubsetSupersetReplaceCommand; +import org.eclipse.uml2.common.edit.command.SupersetRemoveCommand; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment} object. + * + * + * + * @generated + */ +public class JDTPackageFragmentItemProvider + extends JDTParentJavaElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTPackageFragmentItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS); + } + return childrenFeatures; + } + + /** + * + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns JDTPackageFragment.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTPackageFragment")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTPackageFragment) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTPackageFragment_type") : + getString("_UI_JDTPackageFragment_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTPackageFragment.class)) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS, + JdtmmFactory.eINSTANCE.createJDTCompilationUnit())); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createAddCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection, int) + * + * + * @generated + */ + @Override + protected Command createAddCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection, int index) { + if (feature == JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS) { + return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); + } + return super.createAddCommand(domain, owner, feature, collection, index); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection) + * + * + * @generated + */ + @Override + protected Command createRemoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection) { + if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { + return new SupersetRemoveCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS }, collection); + } + return super.createRemoveCommand(domain, owner, feature, collection); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createReplaceCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject, java.util.Collection) + * + * + * @generated + */ + @Override + protected Command createReplaceCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, EObject value, Collection collection) { + if (feature == JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); + } + if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, null, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS }, value, collection); + } + return super.createReplaceCommand(domain, owner, feature, value, collection); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentRootItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentRootItemProvider.java new file mode 100644 index 00000000000..422c5ef7803 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTPackageFragmentRootItemProvider.java @@ -0,0 +1,232 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.uml2.common.edit.command.SubsetAddCommand; +import org.eclipse.uml2.common.edit.command.SubsetSupersetReplaceCommand; +import org.eclipse.uml2.common.edit.command.SupersetRemoveCommand; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot} object. + * + * + * + * @generated + */ +public class JDTPackageFragmentRootItemProvider + extends JDTParentJavaElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTPackageFragmentRootItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS); + } + return childrenFeatures; + } + + /** + * + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns JDTPackageFragmentRoot.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTPackageFragmentRoot")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTPackageFragmentRoot) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTPackageFragmentRoot_type") : + getString("_UI_JDTPackageFragmentRoot_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTPackageFragmentRoot.class)) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS, + JdtmmFactory.eINSTANCE.createJDTPackageFragment())); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createAddCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection, int) + * + * + * @generated + */ + @Override + protected Command createAddCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection, int index) { + if (feature == JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS) { + return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); + } + return super.createAddCommand(domain, owner, feature, collection, index); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection) + * + * + * @generated + */ + @Override + protected Command createRemoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection) { + if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { + return new SupersetRemoveCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS }, collection); + } + return super.createRemoveCommand(domain, owner, feature, collection); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createReplaceCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject, java.util.Collection) + * + * + * @generated + */ + @Override + protected Command createReplaceCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, EObject value, Collection collection) { + if (feature == JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); + } + if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, null, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS }, value, collection); + } + return super.createReplaceCommand(domain, owner, feature, value, collection); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParameterItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParameterItemProvider.java new file mode 100644 index 00000000000..5b752d26f95 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParameterItemProvider.java @@ -0,0 +1,218 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter} object. + * + * + * + * @generated + */ +public class JDTParameterItemProvider + extends JDTMemberItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTParameterItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addFinalPropertyDescriptor(object); + addIsMultiValuedPropertyDescriptor(object); + addTypePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Final feature. + * + * + * + * @generated + */ + protected void addFinalPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTParameter_final_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTParameter_final_feature", "_UI_JDTParameter_type"), + JdtmmPackage.Literals.JDT_PARAMETER__FINAL, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Multi Valued feature. + * + * + * + * @generated + */ + protected void addIsMultiValuedPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTParameter_isMultiValued_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTParameter_isMultiValued_feature", "_UI_JDTParameter_type"), + JdtmmPackage.Literals.JDT_PARAMETER__IS_MULTI_VALUED, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Type feature. + * + * + * + * @generated + */ + protected void addTypePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTParameter_type_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTParameter_type_feature", "_UI_JDTParameter_type"), + JdtmmPackage.Literals.JDT_PARAMETER__TYPE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns JDTParameter.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTParameter")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTParameter) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTParameter_type") : + getString("_UI_JDTParameter_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTParameter.class)) { + case JdtmmPackage.JDT_PARAMETER__FINAL: + case JdtmmPackage.JDT_PARAMETER__IS_MULTI_VALUED: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentItemProvider.java new file mode 100644 index 00000000000..86e1fbe2a9f --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentItemProvider.java @@ -0,0 +1,193 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent} object. + * + * + * + * @generated + */ +public class JDTParentItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTParentItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addChildrenPropertyDescriptor(object); + addFlagsPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Flags feature. + * + * + * + * @generated + */ + protected void addFlagsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTParent_flags_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTParent_flags_feature", "_UI_JDTParent_type"), + JdtmmPackage.Literals.JDT_PARENT__FLAGS, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Children feature. + * + * + * + * @generated + */ + protected void addChildrenPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTParent_children_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTParent_children_feature", "_UI_JDTParent_type"), + JdtmmPackage.Literals.JDT_PARENT__CHILDREN, + false, + false, + false, + null, + null, + null)); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + JDTParent jdtParent = (JDTParent) object; + return getString("_UI_JDTParent_type") + " " + jdtParent.getFlags(); + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTParent.class)) { + case JdtmmPackage.JDT_PARENT__FLAGS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return JdtmmEditPlugin.INSTANCE; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentJavaElementItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentJavaElementItemProvider.java new file mode 100644 index 00000000000..069b6c12c76 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTParentJavaElementItemProvider.java @@ -0,0 +1,181 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement} object. + * + * + * + * @generated + */ +public class JDTParentJavaElementItemProvider + extends JDTJavaElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTParentJavaElementItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addChildrenPropertyDescriptor(object); + addFlagsPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Flags feature. + * + * + * + * @generated + */ + protected void addFlagsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTParent_flags_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTParent_flags_feature", "_UI_JDTParent_type"), + JdtmmPackage.Literals.JDT_PARENT__FLAGS, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Children feature. + * + * + * + * @generated + */ + protected void addChildrenPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTParent_children_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTParent_children_feature", "_UI_JDTParent_type"), + JdtmmPackage.Literals.JDT_PARENT__CHILDREN, + false, + false, + false, + null, + null, + null)); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTParentJavaElement) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTParentJavaElement_type") : + getString("_UI_JDTParentJavaElement_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTParentJavaElement.class)) { + case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeItemProvider.java new file mode 100644 index 00000000000..7a99105e5a1 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeItemProvider.java @@ -0,0 +1,508 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.uml2.common.edit.command.SubsetAddCommand; +import org.eclipse.uml2.common.edit.command.SubsetSupersetReplaceCommand; +import org.eclipse.uml2.common.edit.command.SupersetRemoveCommand; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType} object. + * + * + * + * @generated + */ +public class JDTTypeItemProvider + extends JDTMemberItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTTypeItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addClassPropertyDescriptor(object); + addInterfacePropertyDescriptor(object); + addEnumPropertyDescriptor(object); + addAbstractPropertyDescriptor(object); + addFinalPropertyDescriptor(object); + addStaticPropertyDescriptor(object); + addSuperInterfacesPropertyDescriptor(object); + addSuperClassPropertyDescriptor(object); + addSuperInterfaceNamesPropertyDescriptor(object); + addSuperClassNamePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Class feature. + * + * + * + * @generated + */ + protected void addClassPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTType_class_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTType_class_feature", "_UI_JDTType_type"), + JdtmmPackage.Literals.JDT_TYPE__CLASS, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Interface feature. + * + * + * + * @generated + */ + protected void addInterfacePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTType_interface_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTType_interface_feature", "_UI_JDTType_type"), + JdtmmPackage.Literals.JDT_TYPE__INTERFACE, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Enum feature. + * + * + * + * @generated + */ + protected void addEnumPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTType_enum_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTType_enum_feature", "_UI_JDTType_type"), + JdtmmPackage.Literals.JDT_TYPE__ENUM, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Abstract feature. + * + * + * + * @generated + */ + protected void addAbstractPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTType_abstract_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTType_abstract_feature", "_UI_JDTType_type"), + JdtmmPackage.Literals.JDT_TYPE__ABSTRACT, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Final feature. + * + * + * + * @generated + */ + protected void addFinalPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTType_final_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTType_final_feature", "_UI_JDTType_type"), + JdtmmPackage.Literals.JDT_TYPE__FINAL, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Static feature. + * + * + * + * @generated + */ + protected void addStaticPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTType_static_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTType_static_feature", "_UI_JDTType_type"), + JdtmmPackage.Literals.JDT_TYPE__STATIC, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Super Interfaces feature. + * + * + * + * @generated + */ + protected void addSuperInterfacesPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTType_superInterfaces_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTType_superInterfaces_feature", "_UI_JDTType_type"), + JdtmmPackage.Literals.JDT_TYPE__SUPER_INTERFACES, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Super Class feature. + * + * + * + * @generated + */ + protected void addSuperClassPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTType_superClass_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTType_superClass_feature", "_UI_JDTType_type"), + JdtmmPackage.Literals.JDT_TYPE__SUPER_CLASS, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Super Interface Names feature. + * + * + * + * @generated + */ + protected void addSuperInterfaceNamesPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTType_superInterfaceNames_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTType_superInterfaceNames_feature", "_UI_JDTType_type"), + JdtmmPackage.Literals.JDT_TYPE__SUPER_INTERFACE_NAMES, + false, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Super Class Name feature. + * + * + * + * @generated + */ + protected void addSuperClassNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JDTType_superClassName_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JDTType_superClassName_feature", "_UI_JDTType_type"), + JdtmmPackage.Literals.JDT_TYPE__SUPER_CLASS_NAME, + false, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(JdtmmPackage.Literals.JDT_TYPE__METHODS); + childrenFeatures.add(JdtmmPackage.Literals.JDT_TYPE__FIELDS); + childrenFeatures.add(JdtmmPackage.Literals.JDT_TYPE__TYPES); + } + return childrenFeatures; + } + + /** + * + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTType) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTType_type") : + getString("_UI_JDTType_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JDTType.class)) { + case JdtmmPackage.JDT_TYPE__CLASS: + case JdtmmPackage.JDT_TYPE__INTERFACE: + case JdtmmPackage.JDT_TYPE__ENUM: + case JdtmmPackage.JDT_TYPE__ABSTRACT: + case JdtmmPackage.JDT_TYPE__FINAL: + case JdtmmPackage.JDT_TYPE__STATIC: + case JdtmmPackage.JDT_TYPE__SUPER_INTERFACE_NAMES: + case JdtmmPackage.JDT_TYPE__SUPER_CLASS_NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case JdtmmPackage.JDT_TYPE__METHODS: + case JdtmmPackage.JDT_TYPE__FIELDS: + case JdtmmPackage.JDT_TYPE__TYPES: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_TYPE__METHODS, + JdtmmFactory.eINSTANCE.createJDTMethod())); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_TYPE__FIELDS, + JdtmmFactory.eINSTANCE.createJDTField())); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_TYPE__TYPES, + JdtmmFactory.eINSTANCE.createJDTClass())); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_TYPE__TYPES, + JdtmmFactory.eINSTANCE.createJDTInterface())); + + newChildDescriptors.add + (createChildParameter + (JdtmmPackage.Literals.JDT_TYPE__TYPES, + JdtmmFactory.eINSTANCE.createJDTEnum())); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createAddCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection, int) + * + * + * @generated + */ + @Override + protected Command createAddCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection, int index) { + if (feature == JdtmmPackage.Literals.JDT_TYPE__METHODS) { + return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); + } + if (feature == JdtmmPackage.Literals.JDT_TYPE__FIELDS) { + return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); + } + if (feature == JdtmmPackage.Literals.JDT_TYPE__TYPES) { + return new SubsetAddCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, collection, index); + } + return super.createAddCommand(domain, owner, feature, collection, index); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createRemoveCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, java.util.Collection) + * + * + * @generated + */ + @Override + protected Command createRemoveCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Collection collection) { + if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { + return new SupersetRemoveCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_TYPE__METHODS, JdtmmPackage.Literals.JDT_TYPE__FIELDS, JdtmmPackage.Literals.JDT_TYPE__TYPES }, collection); + } + return super.createRemoveCommand(domain, owner, feature, collection); + } + + /** + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#createReplaceCommand(org.eclipse.emf.edit.domain.EditingDomain, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EStructuralFeature, org.eclipse.emf.ecore.EObject, java.util.Collection) + * + * + * @generated + */ + @Override + protected Command createReplaceCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, EObject value, Collection collection) { + if (feature == JdtmmPackage.Literals.JDT_TYPE__METHODS) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); + } + if (feature == JdtmmPackage.Literals.JDT_TYPE__FIELDS) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); + } + if (feature == JdtmmPackage.Literals.JDT_TYPE__TYPES) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_PARENT__CHILDREN }, null, value, collection); + } + if (feature == JdtmmPackage.Literals.JDT_PARENT__CHILDREN) { + return new SubsetSupersetReplaceCommand(domain, owner, feature, null, new EStructuralFeature[] { JdtmmPackage.Literals.JDT_TYPE__METHODS, JdtmmPackage.Literals.JDT_TYPE__FIELDS, JdtmmPackage.Literals.JDT_TYPE__TYPES }, value, collection); + } + return super.createReplaceCommand(domain, owner, feature, value, collection); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeParameterItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeParameterItemProvider.java new file mode 100644 index 00000000000..855887da62c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeParameterItemProvider.java @@ -0,0 +1,135 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter} object. + * + * + * + * @generated + */ +public class JDTTypeParameterItemProvider + extends JDTJavaElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTTypeParameterItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns JDTTypeParameter.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JDTTypeParameter")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTTypeParameter) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTTypeParameter_type") : + getString("_UI_JDTTypeParameter_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeRootItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeRootItemProvider.java new file mode 100644 index 00000000000..8863ab761cf --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JDTTypeRootItemProvider.java @@ -0,0 +1,123 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot} object. + * + * + * + * @generated + */ +public class JDTTypeRootItemProvider + extends JDTParentJavaElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JDTTypeRootItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JDTTypeRoot) object).getElementName(); + return label == null || label.length() == 0 ? + getString("_UI_JDTTypeRoot_type") : + getString("_UI_JDTTypeRoot_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmEditPlugin.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmEditPlugin.java new file mode 100644 index 00000000000..3dd25b4756d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmEditPlugin.java @@ -0,0 +1,115 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + +import org.eclipse.emf.common.EMFPlugin; +import org.eclipse.emf.common.util.ResourceLocator; + +/** + * This is the central singleton for the Jdtmm edit plugin. + * + * + * + * @generated + */ +public final class JdtmmEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * + * @generated + */ + public static final JdtmmEditPlugin INSTANCE = new JdtmmEditPlugin(); + + /** + * Keep track of the singleton. + * + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * + * @generated + */ + public JdtmmEditPlugin() { + super(new ResourceLocator[] { + }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * + * @generated + */ + public static class Implementation extends EclipsePlugin { + /** + * Creates an instance. + * + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmItemProviderAdapterFactory.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmItemProviderAdapterFactory.java new file mode 100644 index 00000000000..406acea650c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/provider/JdtmmItemProviderAdapterFactory.java @@ -0,0 +1,661 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.edit.provider.ChangeNotifier; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.IChangeNotifier; +import org.eclipse.emf.edit.provider.IDisposable; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.INotifyChangedListener; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util.JdtmmAdapterFactory; + +/** + * This is the factory that is used to provide the interfaces needed to support Viewers. + * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. + * The adapters also support Eclipse property sheets. + * Note that most of the adapters are shared among multiple instances. + * + * + * + * @generated + */ +public class JdtmmItemProviderAdapterFactory extends JdtmmAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { + /** + * This keeps track of the root adapter factory that delegates to this adapter factory. + * + * + * + * @generated + */ + protected ComposedAdapterFactory parentAdapterFactory; + + /** + * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. + * + * + * + * @generated + */ + protected IChangeNotifier changeNotifier = new ChangeNotifier(); + + /** + * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. + * + * + * + * @generated + */ + protected Collection supportedTypes = new ArrayList(); + + /** + * This constructs an instance. + * + * + * + * @generated + */ + public JdtmmItemProviderAdapterFactory() { + supportedTypes.add(IEditingDomainItemProvider.class); + supportedTypes.add(IStructuredItemContentProvider.class); + supportedTypes.add(ITreeItemContentProvider.class); + supportedTypes.add(IItemLabelProvider.class); + supportedTypes.add(IItemPropertySource.class); + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter} instances. + * + * + * + * @generated + */ + protected JDTTypeParameterItemProvider jdtTypeParameterItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTTypeParameterAdapter() { + if (jdtTypeParameterItemProvider == null) { + jdtTypeParameterItemProvider = new JDTTypeParameterItemProvider(this); + } + + return jdtTypeParameterItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField} instances. + * + * + * + * @generated + */ + protected JDTFieldItemProvider jdtFieldItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTFieldAdapter() { + if (jdtFieldItemProvider == null) { + jdtFieldItemProvider = new JDTFieldItemProvider(this); + } + + return jdtFieldItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod} instances. + * + * + * + * @generated + */ + protected JDTMethodItemProvider jdtMethodItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTMethodAdapter() { + if (jdtMethodItemProvider == null) { + jdtMethodItemProvider = new JDTMethodItemProvider(this); + } + + return jdtMethodItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter} instances. + * + * + * + * @generated + */ + protected JDTParameterItemProvider jdtParameterItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTParameterAdapter() { + if (jdtParameterItemProvider == null) { + jdtParameterItemProvider = new JDTParameterItemProvider(this); + } + + return jdtParameterItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit} instances. + * + * + * + * @generated + */ + protected JDTCompilationUnitItemProvider jdtCompilationUnitItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTCompilationUnitAdapter() { + if (jdtCompilationUnitItemProvider == null) { + jdtCompilationUnitItemProvider = new JDTCompilationUnitItemProvider(this); + } + + return jdtCompilationUnitItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment} instances. + * + * + * + * @generated + */ + protected JDTPackageFragmentItemProvider jdtPackageFragmentItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTPackageFragmentAdapter() { + if (jdtPackageFragmentItemProvider == null) { + jdtPackageFragmentItemProvider = new JDTPackageFragmentItemProvider(this); + } + + return jdtPackageFragmentItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot} instances. + * + * + * + * @generated + */ + protected JDTPackageFragmentRootItemProvider jdtPackageFragmentRootItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTPackageFragmentRootAdapter() { + if (jdtPackageFragmentRootItemProvider == null) { + jdtPackageFragmentRootItemProvider = new JDTPackageFragmentRootItemProvider(this); + } + + return jdtPackageFragmentRootItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject} instances. + * + * + * + * @generated + */ + protected JDTJavaProjectItemProvider jdtJavaProjectItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTJavaProjectAdapter() { + if (jdtJavaProjectItemProvider == null) { + jdtJavaProjectItemProvider = new JDTJavaProjectItemProvider(this); + } + + return jdtJavaProjectItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel} instances. + * + * + * + * @generated + */ + protected JDTJavaModelItemProvider jdtJavaModelItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTJavaModelAdapter() { + if (jdtJavaModelItemProvider == null) { + jdtJavaModelItemProvider = new JDTJavaModelItemProvider(this); + } + + return jdtJavaModelItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass} instances. + * + * + * + * @generated + */ + protected JDTClassItemProvider jdtClassItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTClassAdapter() { + if (jdtClassItemProvider == null) { + jdtClassItemProvider = new JDTClassItemProvider(this); + } + + return jdtClassItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface} instances. + * + * + * + * @generated + */ + protected JDTInterfaceItemProvider jdtInterfaceItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTInterfaceAdapter() { + if (jdtInterfaceItemProvider == null) { + jdtInterfaceItemProvider = new JDTInterfaceItemProvider(this); + } + + return jdtInterfaceItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum} instances. + * + * + * + * @generated + */ + protected JDTEnumItemProvider jdtEnumItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTEnumAdapter() { + if (jdtEnumItemProvider == null) { + jdtEnumItemProvider = new JDTEnumItemProvider(this); + } + + return jdtEnumItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration} instances. + * + * + * + * @generated + */ + protected JDTImportDeclarationItemProvider jdtImportDeclarationItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTImportDeclarationAdapter() { + if (jdtImportDeclarationItemProvider == null) { + jdtImportDeclarationItemProvider = new JDTImportDeclarationItemProvider(this); + } + + return jdtImportDeclarationItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer} instances. + * + * + * + * @generated + */ + protected JDTImportContainerItemProvider jdtImportContainerItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTImportContainerAdapter() { + if (jdtImportContainerItemProvider == null) { + jdtImportContainerItemProvider = new JDTImportContainerItemProvider(this); + } + + return jdtImportContainerItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException} instances. + * + * + * + * @generated + */ + protected JDTExceptionItemProvider jdtExceptionItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTExceptionAdapter() { + if (jdtExceptionItemProvider == null) { + jdtExceptionItemProvider = new JDTExceptionItemProvider(this); + } + + return jdtExceptionItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody} instances. + * + * + * + * @generated + */ + protected JDTOpaqueBodyItemProvider jdtOpaqueBodyItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody}. + * + * + * + * @generated + */ + @Override + public Adapter createJDTOpaqueBodyAdapter() { + if (jdtOpaqueBodyItemProvider == null) { + jdtOpaqueBodyItemProvider = new JDTOpaqueBodyItemProvider(this); + } + + return jdtOpaqueBodyItemProvider; + } + + /** + * This returns the root adapter factory that contains this factory. + * + * + * + * @generated + */ + @Override + public ComposeableAdapterFactory getRootAdapterFactory() { + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); + } + + /** + * This sets the composed adapter factory that contains this factory. + * + * + * + * @generated + */ + @Override + public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { + this.parentAdapterFactory = parentAdapterFactory; + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isFactoryForType(Object type) { + return supportedTypes.contains(type) || super.isFactoryForType(type); + } + + /** + * This implementation substitutes the factory itself as the key for the adapter. + * + * + * + * @generated + */ + @Override + public Adapter adapt(Notifier notifier, Object type) { + return super.adapt(notifier, this); + } + + /** + * + * + * + * @generated + */ + @Override + public Object adapt(Object object, Object type) { + if (isFactoryForType(type)) { + Object adapter = super.adapt(object, type); + if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { + return adapter; + } + } + + return null; + } + + /** + * This adds a listener. + * + * + * + * @generated + */ + @Override + public void addListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.addListener(notifyChangedListener); + } + + /** + * This removes a listener. + * + * + * + * @generated + */ + @Override + public void removeListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.removeListener(notifyChangedListener); + } + + /** + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. + * + * + * + * @generated + */ + @Override + public void fireNotifyChanged(Notification notification) { + changeNotifier.fireNotifyChanged(notification); + + if (parentAdapterFactory != null) { + parentAdapterFactory.fireNotifyChanged(notification); + } + } + + /** + * This disposes all of the item providers created by this factory. + * + * + * + * @generated + */ + @Override + public void dispose() { + if (jdtMethodItemProvider != null) { + jdtMethodItemProvider.dispose(); + } + if (jdtTypeParameterItemProvider != null) { + jdtTypeParameterItemProvider.dispose(); + } + if (jdtFieldItemProvider != null) { + jdtFieldItemProvider.dispose(); + } + if (jdtCompilationUnitItemProvider != null) { + jdtCompilationUnitItemProvider.dispose(); + } + if (jdtPackageFragmentItemProvider != null) { + jdtPackageFragmentItemProvider.dispose(); + } + if (jdtPackageFragmentRootItemProvider != null) { + jdtPackageFragmentRootItemProvider.dispose(); + } + if (jdtJavaProjectItemProvider != null) { + jdtJavaProjectItemProvider.dispose(); + } + if (jdtJavaModelItemProvider != null) { + jdtJavaModelItemProvider.dispose(); + } + if (jdtParameterItemProvider != null) { + jdtParameterItemProvider.dispose(); + } + if (jdtClassItemProvider != null) { + jdtClassItemProvider.dispose(); + } + if (jdtInterfaceItemProvider != null) { + jdtInterfaceItemProvider.dispose(); + } + if (jdtEnumItemProvider != null) { + jdtEnumItemProvider.dispose(); + } + if (jdtImportDeclarationItemProvider != null) { + jdtImportDeclarationItemProvider.dispose(); + } + if (jdtImportContainerItemProvider != null) { + jdtImportContainerItemProvider.dispose(); + } + if (jdtExceptionItemProvider != null) { + jdtExceptionItemProvider.dispose(); + } + if (jdtOpaqueBodyItemProvider != null) { + jdtOpaqueBodyItemProvider.dispose(); + } + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.classpath b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.project b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.project new file mode 100644 index 00000000000..3d0615d9665 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.java.generator.metamodel.jdt.editor + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..14f61d6d866 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Export-Package: org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.presentation +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources;visibility:=reexport, + org.eclipse.papyrus.java.generator.metamodel.jdt.edit;bundle-version="1.2.0";visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.eclipse.emf.edit.ui;visibility:=reexport, + org.eclipse.ui.ide;visibility:=reexport +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-Version: 1.2.0.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.presentation.GeneratoroptionsmmEditorPlugin$Implementation +Bundle-SymbolicName: org.eclipse.papyrus.java.generator.metamodel.jdt.editor;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/about.html b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/build.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/build.properties new file mode 100644 index 00000000000..f4610251623 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/build.properties @@ -0,0 +1,12 @@ +# + +bin.includes = .,\ + icons/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties,\ + about.html +jars.compile.order = . +source.. = src/ +output.. = bin +src.includes = about.html diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/obj16/JdtmmModelFile.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/obj16/JdtmmModelFile.gif new file mode 100644 index 00000000000..a99fd8140c4 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/obj16/JdtmmModelFile.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/wizban/NewJdtmm.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/wizban/NewJdtmm.gif new file mode 100644 index 00000000000..897c9baa83c Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/icons/full/wizban/NewJdtmm.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.properties new file mode 100644 index 00000000000..e799174fb7c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.properties @@ -0,0 +1,53 @@ +# + +pluginName = Jdt metamodel Editor (Incubation) +providerName = Eclipse Modeling Project + +_UI_GeneratoroptionsmmEditor_menu = &Generatoroptionsmm Editor + +_UI_CreateChild_menu_item = &New Child +_UI_CreateSibling_menu_item = N&ew Sibling + +_UI_ShowPropertiesView_menu_item = Show &Properties View +_UI_RefreshViewer_menu_item = &Refresh + +_UI_SelectionPage_label = Selection +_UI_ParentPage_label = Parent +_UI_ListPage_label = List +_UI_TreePage_label = Tree +_UI_TablePage_label = Table +_UI_TreeWithColumnsPage_label = Tree with Columns +_UI_ObjectColumn_label = Object +_UI_SelfColumn_label = Self + +_UI_NoObjectSelected = Selected Nothing +_UI_SingleObjectSelected = Selected Object: {0} +_UI_MultiObjectSelected = Selected {0} Objects + +_UI_OpenEditorError_label = Open Editor + +_UI_Wizard_category = Example EMF Model Creation Wizards + +_UI_CreateModelError_message = Problems encountered in file "{0}" + +_UI_GeneratoroptionsmmModelWizard_label = Generatoroptionsmm Model +_UI_GeneratoroptionsmmModelWizard_description = Create a new Generatoroptionsmm model + +_UI_GeneratoroptionsmmEditor_label = Generatoroptionsmm Model Editor + +_UI_GeneratoroptionsmmEditorFilenameDefaultBase = My +_UI_GeneratoroptionsmmEditorFilenameExtensions = generatoroptionsmm + +_UI_Wizard_label = New + +_WARN_FilenameExtension = The file name must end in ''.{0}'' +_WARN_FilenameExtensions = The file name must have one of the following extensions: {0} + +_UI_ModelObject = &Model Object +_UI_XMLEncoding = &XML Encoding +_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1 +_UI_Wizard_initial_object_description = Select a model object to create + +_UI_FileConflict_label = File Conflict +_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes? + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.xml new file mode 100644 index 00000000000..811f7e9bc6f --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/plugin.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + %_UI_GeneratoroptionsmmModelWizard_description + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/pom.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/pom.xml new file mode 100644 index 00000000000..fe4b79411ab --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.java.generator.metamodel.jdt.editor + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmActionBarContributor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmActionBarContributor.java new file mode 100644 index 00000000000..ba68a1509a8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmActionBarContributor.java @@ -0,0 +1,441 @@ +/** + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.presentation; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.ui.viewer.IViewerProvider; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.domain.IEditingDomainProvider; +import org.eclipse.emf.edit.ui.action.ControlAction; +import org.eclipse.emf.edit.ui.action.CreateChildAction; +import org.eclipse.emf.edit.ui.action.CreateSiblingAction; +import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; +import org.eclipse.emf.edit.ui.action.LoadResourceAction; +import org.eclipse.emf.edit.ui.action.ValidateAction; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.ActionContributionItem; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IContributionItem; +import org.eclipse.jface.action.IContributionManager; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.jface.action.SubContributionItem; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.PartInitException; + +/** + * This is the action bar contributor for the Generatoroptionsmm model editor. + * + * + * + * @generated + */ +public class GeneratoroptionsmmActionBarContributor + extends EditingDomainActionBarContributor + implements ISelectionChangedListener { + /** + * This keeps track of the active editor. + * + * + * + * @generated + */ + protected IEditorPart activeEditorPart; + + /** + * This keeps track of the current selection provider. + * + * + * + * @generated + */ + protected ISelectionProvider selectionProvider; + + /** + * This action opens the Properties view. + * + * + * + * @generated + */ + protected IAction showPropertiesViewAction = + new Action(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { + @Override + public void run() { + try { + getPage().showView("org.eclipse.ui.views.PropertySheet"); + } + catch (PartInitException exception) { + GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); + } + } + }; + + /** + * This action refreshes the viewer of the current editor if the editor + * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. + * + * + * + * @generated + */ + protected IAction refreshViewerAction = + new Action(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) { + @Override + public boolean isEnabled() { + return activeEditorPart instanceof IViewerProvider; + } + + @Override + public void run() { + if (activeEditorPart instanceof IViewerProvider) { + Viewer viewer = ((IViewerProvider) activeEditorPart).getViewer(); + if (viewer != null) { + viewer.refresh(); + } + } + } + }; + + /** + * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor + * generated for the current selection by the item provider. + * + * + * + * @generated + */ + protected Collection createChildActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateChild actions. + * + * + * + * @generated + */ + protected IMenuManager createChildMenuManager; + + /** + * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor + * generated for the current selection by the item provider. + * + * + * + * @generated + */ + protected Collection createSiblingActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateSibling actions. + * + * + * + * @generated + */ + protected IMenuManager createSiblingMenuManager; + + /** + * This creates an instance of the contributor. + * + * + * + * @generated + */ + public GeneratoroptionsmmActionBarContributor() { + super(ADDITIONS_LAST_STYLE); + loadResourceAction = new LoadResourceAction(); + validateAction = new ValidateAction(); + controlAction = new ControlAction(); + } + + /** + * This adds Separators for editor additions to the tool bar. + * + * + * + * @generated + */ + @Override + public void contributeToToolBar(IToolBarManager toolBarManager) { + toolBarManager.add(new Separator("generatoroptionsmm-settings")); + toolBarManager.add(new Separator("generatoroptionsmm-additions")); + } + + /** + * This adds to the menu bar a menu and some separators for editor additions, + * as well as the sub-menus for object creation items. + * + * + * + * @generated + */ + @Override + public void contributeToMenu(IMenuManager menuManager) { + super.contributeToMenu(menuManager); + + IMenuManager submenuManager = new MenuManager(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmEditor_menu"), "org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmmMenuID"); + menuManager.insertAfter("additions", submenuManager); + submenuManager.add(new Separator("settings")); + submenuManager.add(new Separator("actions")); + submenuManager.add(new Separator("additions")); + submenuManager.add(new Separator("additions-end")); + + // Prepare for CreateChild item addition or removal. + // + createChildMenuManager = new MenuManager(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + submenuManager.insertBefore("additions", createChildMenuManager); + + // Prepare for CreateSibling item addition or removal. + // + createSiblingMenuManager = new MenuManager(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + submenuManager.insertBefore("additions", createSiblingMenuManager); + + // Force an update because Eclipse hides empty menus now. + // + submenuManager.addMenuListener + (new IMenuListener() { + @Override + public void menuAboutToShow(IMenuManager menuManager) { + menuManager.updateAll(true); + } + }); + + addGlobalActions(submenuManager); + } + + /** + * When the active editor changes, this remembers the change and registers with it as a selection provider. + * + * + * + * @generated + */ + @Override + public void setActiveEditor(IEditorPart part) { + super.setActiveEditor(part); + activeEditorPart = part; + + // Switch to the new selection provider. + // + if (selectionProvider != null) { + selectionProvider.removeSelectionChangedListener(this); + } + if (part == null) { + selectionProvider = null; + } + else { + selectionProvider = part.getSite().getSelectionProvider(); + selectionProvider.addSelectionChangedListener(this); + + // Fake a selection changed event to update the menus. + // + if (selectionProvider.getSelection() != null) { + selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection())); + } + } + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener}, + * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings + * that can be added to the selected object and updating the menus accordingly. + * + * + * + * @generated + */ + @Override + public void selectionChanged(SelectionChangedEvent event) { + // Remove any menu items for old selection. + // + if (createChildMenuManager != null) { + depopulateManager(createChildMenuManager, createChildActions); + } + if (createSiblingMenuManager != null) { + depopulateManager(createSiblingMenuManager, createSiblingActions); + } + + // Query the new selection for appropriate new child/sibling descriptors + // + Collection newChildDescriptors = null; + Collection newSiblingDescriptors = null; + + ISelection selection = event.getSelection(); + if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) { + Object object = ((IStructuredSelection) selection).getFirstElement(); + + EditingDomain domain = ((IEditingDomainProvider) activeEditorPart).getEditingDomain(); + + newChildDescriptors = domain.getNewChildDescriptors(object, null); + newSiblingDescriptors = domain.getNewChildDescriptors(null, object); + } + + // Generate actions for selection; populate and redraw the menus. + // + createChildActions = generateCreateChildActions(newChildDescriptors, selection); + createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection); + + if (createChildMenuManager != null) { + populateManager(createChildMenuManager, createChildActions, null); + createChildMenuManager.update(true); + } + if (createSiblingMenuManager != null) { + populateManager(createSiblingMenuManager, createSiblingActions, null); + createSiblingMenuManager.update(true); + } + } + + /** + * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in descriptors, + * and returns the collection of these actions. + * + * + * + * @generated + */ + protected Collection generateCreateChildActions(Collection descriptors, ISelection selection) { + Collection actions = new ArrayList(); + if (descriptors != null) { + for (Object descriptor : descriptors) { + actions.add(new CreateChildAction(activeEditorPart, selection, descriptor)); + } + } + return actions; + } + + /** + * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in descriptors, + * and returns the collection of these actions. + * + * + * + * @generated + */ + protected Collection generateCreateSiblingActions(Collection descriptors, ISelection selection) { + Collection actions = new ArrayList(); + if (descriptors != null) { + for (Object descriptor : descriptors) { + actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); + } + } + return actions; + } + + /** + * This populates the specified manager with {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection, + * by inserting them before the specified contribution item contributionID. + * If contributionID is null, they are simply added. + * + * + * + * @generated + */ + protected void populateManager(IContributionManager manager, Collection actions, String contributionID) { + if (actions != null) { + for (IAction action : actions) { + if (contributionID != null) { + manager.insertBefore(contributionID, action); + } + else { + manager.add(action); + } + } + } + } + + /** + * This removes from the specified manager all {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection. + * + * + * + * @generated + */ + protected void depopulateManager(IContributionManager manager, Collection actions) { + if (actions != null) { + IContributionItem[] items = manager.getItems(); + for (int i = 0; i < items.length; i++) { + // Look into SubContributionItems + // + IContributionItem contributionItem = items[i]; + while (contributionItem instanceof SubContributionItem) { + contributionItem = ((SubContributionItem) contributionItem).getInnerItem(); + } + + // Delete the ActionContributionItems with matching action. + // + if (contributionItem instanceof ActionContributionItem) { + IAction action = ((ActionContributionItem) contributionItem).getAction(); + if (actions.contains(action)) { + manager.remove(contributionItem); + } + } + } + } + } + + /** + * This populates the pop-up menu before it appears. + * + * + * + * @generated + */ + @Override + public void menuAboutToShow(IMenuManager menuManager) { + super.menuAboutToShow(menuManager); + MenuManager submenuManager = null; + + submenuManager = new MenuManager(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + populateManager(submenuManager, createChildActions, null); + menuManager.insertBefore("edit", submenuManager); + + submenuManager = new MenuManager(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + populateManager(submenuManager, createSiblingActions, null); + menuManager.insertBefore("edit", submenuManager); + } + + /** + * This inserts global actions before the "additions-end" separator. + * + * + * + * @generated + */ + @Override + protected void addGlobalActions(IMenuManager menuManager) { + menuManager.insertAfter("additions-end", new Separator("ui-actions")); + menuManager.insertAfter("ui-actions", showPropertiesViewAction); + + refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); + menuManager.insertAfter("ui-actions", refreshViewerAction); + + super.addGlobalActions(menuManager); + } + + /** + * This ensures that a delete action will clean up all references to deleted objects. + * + * + * + * @generated + */ + @Override + protected boolean removeAllReferencesOnDelete() { + return true; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditor.java new file mode 100644 index 00000000000..61e6583d63e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditor.java @@ -0,0 +1,1884 @@ +/** + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.presentation; + + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.EventObject; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceChangeEvent; +import org.eclipse.core.resources.IResourceChangeListener; +import org.eclipse.core.resources.IResourceDelta; +import org.eclipse.core.resources.IResourceDeltaVisitor; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.emf.common.command.BasicCommandStack; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CommandStack; +import org.eclipse.emf.common.command.CommandStackListener; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.ui.MarkerHelper; +import org.eclipse.emf.common.ui.ViewerPane; +import org.eclipse.emf.common.ui.editor.ProblemEditorPart; +import org.eclipse.emf.common.ui.viewer.IViewerProvider; +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.EContentAdapter; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.domain.IEditingDomainProvider; +import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; +import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory; +import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; +import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; +import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter; +import org.eclipse.emf.edit.ui.dnd.LocalTransfer; +import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter; +import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; +import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; +import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider; +import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper; +import org.eclipse.emf.edit.ui.util.EditUIUtil; +import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IStatusLineManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.util.LocalSelectionTransfer; +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ListViewer; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.StructuredViewer; +import org.eclipse.jface.viewers.TableLayout; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider.GeneratoroptionsmmItemProviderAdapterFactory; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CTabFolder; +import org.eclipse.swt.dnd.DND; +import org.eclipse.swt.dnd.FileTransfer; +import org.eclipse.swt.dnd.Transfer; +import org.eclipse.swt.events.ControlAdapter; +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.swt.widgets.TreeColumn; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.IPartListener; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.actions.WorkspaceModifyOperation; +import org.eclipse.ui.dialogs.SaveAsDialog; +import org.eclipse.ui.ide.IGotoMarker; +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.MultiPageEditorPart; +import org.eclipse.ui.views.contentoutline.ContentOutline; +import org.eclipse.ui.views.contentoutline.ContentOutlinePage; +import org.eclipse.ui.views.contentoutline.IContentOutlinePage; +import org.eclipse.ui.views.properties.IPropertySheetPage; +import org.eclipse.ui.views.properties.PropertySheet; +import org.eclipse.ui.views.properties.PropertySheetPage; + + +/** + * This is an example of a Generatoroptionsmm model editor. + * + * + * + * @generated + */ +public class GeneratoroptionsmmEditor + extends MultiPageEditorPart + implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker { + /** + * This keeps track of the editing domain that is used to track all changes to the model. + * + * + * + * @generated + */ + protected AdapterFactoryEditingDomain editingDomain; + + /** + * This is the one adapter factory used for providing views of the model. + * + * + * + * @generated + */ + protected ComposedAdapterFactory adapterFactory; + + /** + * This is the content outline page. + * + * + * + * @generated + */ + protected IContentOutlinePage contentOutlinePage; + + /** + * This is a kludge... + * + * + * + * @generated + */ + protected IStatusLineManager contentOutlineStatusLineManager; + + /** + * This is the content outline page's viewer. + * + * + * + * @generated + */ + protected TreeViewer contentOutlineViewer; + + /** + * This is the property sheet page. + * + * + * + * @generated + */ + protected List propertySheetPages = new ArrayList(); + + /** + * This is the viewer that shadows the selection in the content outline. + * The parent relation must be correctly defined for this to work. + * + * + * + * @generated + */ + protected TreeViewer selectionViewer; + + /** + * This inverts the roll of parent and child in the content provider and show parents as a tree. + * + * + * + * @generated + */ + protected TreeViewer parentViewer; + + /** + * This shows how a tree view works. + * + * + * + * @generated + */ + protected TreeViewer treeViewer; + + /** + * This shows how a list view works. + * A list viewer doesn't support icons. + * + * + * + * @generated + */ + protected ListViewer listViewer; + + /** + * This shows how a table view works. + * A table can be used as a list with icons. + * + * + * + * @generated + */ + protected TableViewer tableViewer; + + /** + * This shows how a tree view with columns works. + * + * + * + * @generated + */ + protected TreeViewer treeViewerWithColumns; + + /** + * This keeps track of the active viewer pane, in the book. + * + * + * + * @generated + */ + protected ViewerPane currentViewerPane; + + /** + * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer. + * + * + * + * @generated + */ + protected Viewer currentViewer; + + /** + * This listens to which ever viewer is active. + * + * + * + * @generated + */ + protected ISelectionChangedListener selectionChangedListener; + + /** + * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor. + * + * + * + * @generated + */ + protected Collection selectionChangedListeners = new ArrayList(); + + /** + * This keeps track of the selection of the editor as a whole. + * + * + * + * @generated + */ + protected ISelection editorSelection = StructuredSelection.EMPTY; + + /** + * The MarkerHelper is responsible for creating workspace resource markers presented + * in Eclipse's Problems View. + * + * + * + * @generated + */ + protected MarkerHelper markerHelper = new EditUIMarkerHelper(); + + /** + * This listens for when the outline becomes active + * + * + * + * @generated + */ + protected IPartListener partListener = + new IPartListener() { + @Override + public void partActivated(IWorkbenchPart p) { + if (p instanceof ContentOutline) { + if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) { + getActionBarContributor().setActiveEditor(GeneratoroptionsmmEditor.this); + + setCurrentViewer(contentOutlineViewer); + } + } + else if (p instanceof PropertySheet) { + if (propertySheetPages.contains(((PropertySheet) p).getCurrentPage())) { + getActionBarContributor().setActiveEditor(GeneratoroptionsmmEditor.this); + handleActivate(); + } + } + else if (p == GeneratoroptionsmmEditor.this) { + handleActivate(); + } + } + + @Override + public void partBroughtToTop(IWorkbenchPart p) { + // Ignore. + } + + @Override + public void partClosed(IWorkbenchPart p) { + // Ignore. + } + + @Override + public void partDeactivated(IWorkbenchPart p) { + // Ignore. + } + + @Override + public void partOpened(IWorkbenchPart p) { + // Ignore. + } + }; + + /** + * Resources that have been removed since last activation. + * + * + * + * @generated + */ + protected Collection removedResources = new ArrayList(); + + /** + * Resources that have been changed since last activation. + * + * + * + * @generated + */ + protected Collection changedResources = new ArrayList(); + + /** + * Resources that have been saved. + * + * + * + * @generated + */ + protected Collection savedResources = new ArrayList(); + + /** + * Map to store the diagnostic associated with a resource. + * + * + * + * @generated + */ + protected Map resourceToDiagnosticMap = new LinkedHashMap(); + + /** + * Controls whether the problem indication should be updated. + * + * + * + * @generated + */ + protected boolean updateProblemIndication = true; + + /** + * Adapter used to update the problem indication when resources are demanded loaded. + * + * + * + * @generated + */ + protected EContentAdapter problemIndicationAdapter = + new EContentAdapter() { + @Override + public void notifyChanged(Notification notification) { + if (notification.getNotifier() instanceof Resource) { + switch (notification.getFeatureID(Resource.class)) { + case Resource.RESOURCE__IS_LOADED: + case Resource.RESOURCE__ERRORS: + case Resource.RESOURCE__WARNINGS: { + Resource resource = (Resource) notification.getNotifier(); + Diagnostic diagnostic = analyzeResourceProblems(resource, null); + if (diagnostic.getSeverity() != Diagnostic.OK) { + resourceToDiagnosticMap.put(resource, diagnostic); + } + else { + resourceToDiagnosticMap.remove(resource); + } + + if (updateProblemIndication) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + updateProblemIndication(); + } + }); + } + break; + } + } + } + else { + super.notifyChanged(notification); + } + } + + @Override + protected void setTarget(Resource target) { + basicSetTarget(target); + } + + @Override + protected void unsetTarget(Resource target) { + basicUnsetTarget(target); + resourceToDiagnosticMap.remove(target); + if (updateProblemIndication) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + updateProblemIndication(); + } + }); + } + } + }; + + /** + * This listens for workspace changes. + * + * + * + * @generated + */ + protected IResourceChangeListener resourceChangeListener = + new IResourceChangeListener() { + @Override + public void resourceChanged(IResourceChangeEvent event) { + IResourceDelta delta = event.getDelta(); + try { + class ResourceDeltaVisitor implements IResourceDeltaVisitor { + protected ResourceSet resourceSet = editingDomain.getResourceSet(); + protected Collection changedResources = new ArrayList(); + protected Collection removedResources = new ArrayList(); + + @Override + public boolean visit(IResourceDelta delta) { + if (delta.getResource().getType() == IResource.FILE) { + if (delta.getKind() == IResourceDelta.REMOVED || + delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) { + Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false); + if (resource != null) { + if (delta.getKind() == IResourceDelta.REMOVED) { + removedResources.add(resource); + } + else if (!savedResources.remove(resource)) { + changedResources.add(resource); + } + } + } + return false; + } + + return true; + } + + public Collection getChangedResources() { + return changedResources; + } + + public Collection getRemovedResources() { + return removedResources; + } + } + + final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(); + delta.accept(visitor); + + if (!visitor.getRemovedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + removedResources.addAll(visitor.getRemovedResources()); + if (!isDirty()) { + getSite().getPage().closeEditor(GeneratoroptionsmmEditor.this, false); + } + } + }); + } + + if (!visitor.getChangedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + changedResources.addAll(visitor.getChangedResources()); + if (getSite().getPage().getActiveEditor() == GeneratoroptionsmmEditor.this) { + handleActivate(); + } + } + }); + } + } + catch (CoreException exception) { + GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); + } + } + }; + + /** + * Handles activation of the editor or it's associated views. + * + * + * + * @generated + */ + protected void handleActivate() { + // Recompute the read only state. + // + if (editingDomain.getResourceToReadOnlyMap() != null) { + editingDomain.getResourceToReadOnlyMap().clear(); + + // Refresh any actions that may become enabled or disabled. + // + setSelection(getSelection()); + } + + if (!removedResources.isEmpty()) { + if (handleDirtyConflict()) { + getSite().getPage().closeEditor(GeneratoroptionsmmEditor.this, false); + } + else { + removedResources.clear(); + changedResources.clear(); + savedResources.clear(); + } + } + else if (!changedResources.isEmpty()) { + changedResources.removeAll(savedResources); + handleChangedResources(); + changedResources.clear(); + savedResources.clear(); + } + } + + /** + * Handles what to do with changed resources on activation. + * + * + * + * @generated + */ + protected void handleChangedResources() { + if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { + if (isDirty()) { + changedResources.addAll(editingDomain.getResourceSet().getResources()); + } + editingDomain.getCommandStack().flush(); + + updateProblemIndication = false; + for (Resource resource : changedResources) { + if (resource.isLoaded()) { + resource.unload(); + try { + resource.load(Collections.EMPTY_MAP); + } catch (IOException exception) { + if (!resourceToDiagnosticMap.containsKey(resource)) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + } + } + } + + if (AdapterFactoryEditingDomain.isStale(editorSelection)) { + setSelection(StructuredSelection.EMPTY); + } + + updateProblemIndication = true; + updateProblemIndication(); + } + } + + /** + * Updates the problems indication with the information described in the specified diagnostic. + * + * + * + * @generated + */ + protected void updateProblemIndication() { + if (updateProblemIndication) { + BasicDiagnostic diagnostic = + new BasicDiagnostic + (Diagnostic.OK, + "org.eclipse.papyrus.java.generator.metamodel.jdt.editor", + 0, + null, + new Object[] { editingDomain.getResourceSet() }); + for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) { + if (childDiagnostic.getSeverity() != Diagnostic.OK) { + diagnostic.add(childDiagnostic); + } + } + + int lastEditorPage = getPageCount() - 1; + if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) { + ((ProblemEditorPart) getEditor(lastEditorPage)).setDiagnostic(diagnostic); + if (diagnostic.getSeverity() != Diagnostic.OK) { + setActivePage(lastEditorPage); + } + } + else if (diagnostic.getSeverity() != Diagnostic.OK) { + ProblemEditorPart problemEditorPart = new ProblemEditorPart(); + problemEditorPart.setDiagnostic(diagnostic); + problemEditorPart.setMarkerHelper(markerHelper); + try { + addPage(++lastEditorPage, problemEditorPart, getEditorInput()); + setPageText(lastEditorPage, problemEditorPart.getPartName()); + setActivePage(lastEditorPage); + showTabs(); + } catch (PartInitException exception) { + GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); + } + } + + if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { + markerHelper.deleteMarkers(editingDomain.getResourceSet()); + if (diagnostic.getSeverity() != Diagnostic.OK) { + try { + markerHelper.createMarkers(diagnostic); + } catch (CoreException exception) { + GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); + } + } + } + } + } + + /** + * Shows a dialog that asks if conflicting changes should be discarded. + * + * + * + * @generated + */ + protected boolean handleDirtyConflict() { + return MessageDialog.openQuestion + (getSite().getShell(), + getString("_UI_FileConflict_label"), + getString("_WARN_FileConflict")); + } + + /** + * This creates a model editor. + * + * + * + * @generated + */ + public GeneratoroptionsmmEditor() { + super(); + initializeEditingDomain(); + } + + /** + * This sets up the editing domain for the model editor. + * + * + * + * @generated + */ + protected void initializeEditingDomain() { + // Create an adapter factory that yields item providers. + // + adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); + + adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new GeneratoroptionsmmItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); + + // Create the command stack that will notify this editor as commands are executed. + // + BasicCommandStack commandStack = new BasicCommandStack(); + + // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. + // + commandStack.addCommandStackListener + (new CommandStackListener() { + @Override + public void commandStackChanged(final EventObject event) { + getContainer().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + firePropertyChange(IEditorPart.PROP_DIRTY); + + // Try to select the affected objects. + // + Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand(); + if (mostRecentCommand != null) { + setSelectionToViewer(mostRecentCommand.getAffectedObjects()); + } + for (Iterator i = propertySheetPages.iterator(); i.hasNext();) { + PropertySheetPage propertySheetPage = i.next(); + if (propertySheetPage.getControl().isDisposed()) { + i.remove(); + } + else { + propertySheetPage.refresh(); + } + } + } + }); + } + }); + + // Create the editing domain with a special command stack. + // + editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap()); + } + + /** + * This is here for the listener to be able to call it. + * + * + * + * @generated + */ + @Override + protected void firePropertyChange(int action) { + super.firePropertyChange(action); + } + + /** + * This sets the selection into whichever viewer is active. + * + * + * + * @generated + */ + public void setSelectionToViewer(Collection collection) { + final Collection theSelection = collection; + // Make sure it's okay. + // + if (theSelection != null && !theSelection.isEmpty()) { + Runnable runnable = + new Runnable() { + @Override + public void run() { + // Try to select the items in the current content viewer of the editor. + // + if (currentViewer != null) { + currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); + } + } + }; + getSite().getShell().getDisplay().asyncExec(runnable); + } + } + + /** + * This returns the editing domain as required by the {@link IEditingDomainProvider} interface. + * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}. + * + * + * + * @generated + */ + @Override + public EditingDomain getEditingDomain() { + return editingDomain; + } + + /** + * + * + * + * @generated + */ + public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { + /** + * + * + * + * @generated + */ + public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * + * + * + * @generated + */ + @Override + public Object[] getElements(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * + * @generated + */ + @Override + public Object[] getChildren(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean hasChildren(Object object) { + Object parent = super.getParent(object); + return parent != null; + } + + /** + * + * + * + * @generated + */ + @Override + public Object getParent(Object object) { + return null; + } + } + + /** + * + * + * + * @generated + */ + public void setCurrentViewerPane(ViewerPane viewerPane) { + if (currentViewerPane != viewerPane) { + if (currentViewerPane != null) { + currentViewerPane.showFocus(false); + } + currentViewerPane = viewerPane; + } + setCurrentViewer(currentViewerPane.getViewer()); + } + + /** + * This makes sure that one content viewer, either for the current page or the outline view, if it has focus, + * is the current one. + * + * + * + * @generated + */ + public void setCurrentViewer(Viewer viewer) { + // If it is changing... + // + if (currentViewer != viewer) { + if (selectionChangedListener == null) { + // Create the listener on demand. + // + selectionChangedListener = + new ISelectionChangedListener() { + // This just notifies those things that are affected by the section. + // + @Override + public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { + setSelection(selectionChangedEvent.getSelection()); + } + }; + } + + // Stop listening to the old one. + // + if (currentViewer != null) { + currentViewer.removeSelectionChangedListener(selectionChangedListener); + } + + // Start listening to the new one. + // + if (viewer != null) { + viewer.addSelectionChangedListener(selectionChangedListener); + } + + // Remember it. + // + currentViewer = viewer; + + // Set the editors selection based on the current viewer's selection. + // + setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection()); + } + } + + /** + * This returns the viewer as required by the {@link IViewerProvider} interface. + * + * + * + * @generated + */ + @Override + public Viewer getViewer() { + return currentViewer; + } + + /** + * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. + * + * + * + * @generated + */ + protected void createContextMenuFor(StructuredViewer viewer) { + MenuManager contextMenu = new MenuManager("#PopUp"); + contextMenu.add(new Separator("additions")); + contextMenu.setRemoveAllWhenShown(true); + contextMenu.addMenuListener(this); + Menu menu = contextMenu.createContextMenu(viewer.getControl()); + viewer.getControl().setMenu(menu); + getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); + + int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; + Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() }; + viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); + viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); + } + + /** + * This is the method called to load a resource into the editing domain's resource set based on the editor's input. + * + * + * + * @generated + */ + public void createModel() { + URI resourceURI = EditUIUtil.getURI(getEditorInput()); + Exception exception = null; + Resource resource = null; + try { + // Load the resource through the editing domain. + // + resource = editingDomain.getResourceSet().getResource(resourceURI, true); + } catch (Exception e) { + exception = e; + resource = editingDomain.getResourceSet().getResource(resourceURI, false); + } + + Diagnostic diagnostic = analyzeResourceProblems(resource, exception); + if (diagnostic.getSeverity() != Diagnostic.OK) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter); + } + + /** + * Returns a diagnostic describing the errors and warnings listed in the resource + * and the specified exception (if any). + * + * + * + * @generated + */ + public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) { + if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) { + BasicDiagnostic basicDiagnostic = + new BasicDiagnostic + (Diagnostic.ERROR, + "org.eclipse.papyrus.java.generator.metamodel.jdt.editor", + 0, + getString("_UI_CreateModelError_message", resource.getURI()), + new Object[] { exception == null ? (Object) resource : exception }); + basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); + return basicDiagnostic; + } + else if (exception != null) { + return new BasicDiagnostic(Diagnostic.ERROR, + "org.eclipse.papyrus.java.generator.metamodel.jdt.editor", + 0, + getString("_UI_CreateModelError_message", resource.getURI()), + new Object[] { exception }); + } + else { + return Diagnostic.OK_INSTANCE; + } + } + + /** + * This is the method used by the framework to install your own controls. + * + * + * + * @generated + */ + @Override + public void createPages() { + // Creates the model from the editor input + // + createModel(); + + // Only creates the other pages if there is something that can be edited + // + if (!getEditingDomain().getResourceSet().getResources().isEmpty()) { + // Create a page for the selection tree view. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), GeneratoroptionsmmEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + Tree tree = new Tree(composite, SWT.MULTI); + TreeViewer newTreeViewer = new TreeViewer(tree); + return newTreeViewer; + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + selectionViewer = (TreeViewer) viewerPane.getViewer(); + selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + + selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + selectionViewer.setInput(editingDomain.getResourceSet()); + selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); + viewerPane.setTitle(editingDomain.getResourceSet()); + + new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); + + createContextMenuFor(selectionViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_SelectionPage_label")); + } + + // Create a page for the parent tree view. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), GeneratoroptionsmmEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + Tree tree = new Tree(composite, SWT.MULTI); + TreeViewer newTreeViewer = new TreeViewer(tree); + return newTreeViewer; + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + parentViewer = (TreeViewer) viewerPane.getViewer(); + parentViewer.setAutoExpandLevel(30); + parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory)); + parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(parentViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_ParentPage_label")); + } + + // This is the page for the list viewer + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), GeneratoroptionsmmEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new ListViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + listViewer = (ListViewer) viewerPane.getViewer(); + listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(listViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_ListPage_label")); + } + + // This is the page for the tree viewer + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), GeneratoroptionsmmEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TreeViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + treeViewer = (TreeViewer) viewerPane.getViewer(); + treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory); + + createContextMenuFor(treeViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TreePage_label")); + } + + // This is the page for the table viewer. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), GeneratoroptionsmmEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TableViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + tableViewer = (TableViewer) viewerPane.getViewer(); + + Table table = tableViewer.getTable(); + TableLayout layout = new TableLayout(); + table.setLayout(layout); + table.setHeaderVisible(true); + table.setLinesVisible(true); + + TableColumn objectColumn = new TableColumn(table, SWT.NONE); + layout.addColumnData(new ColumnWeightData(3, 100, true)); + objectColumn.setText(getString("_UI_ObjectColumn_label")); + objectColumn.setResizable(true); + + TableColumn selfColumn = new TableColumn(table, SWT.NONE); + layout.addColumnData(new ColumnWeightData(2, 100, true)); + selfColumn.setText(getString("_UI_SelfColumn_label")); + selfColumn.setResizable(true); + + tableViewer.setColumnProperties(new String[] { "a", "b" }); + tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(tableViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TablePage_label")); + } + + // This is the page for the table tree viewer. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), GeneratoroptionsmmEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TreeViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + treeViewerWithColumns = (TreeViewer) viewerPane.getViewer(); + + Tree tree = treeViewerWithColumns.getTree(); + tree.setLayoutData(new FillLayout()); + tree.setHeaderVisible(true); + tree.setLinesVisible(true); + + TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE); + objectColumn.setText(getString("_UI_ObjectColumn_label")); + objectColumn.setResizable(true); + objectColumn.setWidth(250); + + TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE); + selfColumn.setText(getString("_UI_SelfColumn_label")); + selfColumn.setResizable(true); + selfColumn.setWidth(200); + + treeViewerWithColumns.setColumnProperties(new String[] { "a", "b" }); + treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(treeViewerWithColumns); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); + } + + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + setActivePage(0); + } + }); + } + + // Ensures that this editor will only display the page's tab + // area if there are more than one page + // + getContainer().addControlListener + (new ControlAdapter() { + boolean guard = false; + + @Override + public void controlResized(ControlEvent event) { + if (!guard) { + guard = true; + hideTabs(); + guard = false; + } + } + }); + + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + updateProblemIndication(); + } + }); + } + + /** + * If there is just one page in the multi-page editor part, + * this hides the single tab at the bottom. + * + * + * + * @generated + */ + protected void hideTabs() { + if (getPageCount() <= 1) { + setPageText(0, ""); + if (getContainer() instanceof CTabFolder) { + ((CTabFolder) getContainer()).setTabHeight(1); + Point point = getContainer().getSize(); + getContainer().setSize(point.x, point.y + 6); + } + } + } + + /** + * If there is more than one page in the multi-page editor part, + * this shows the tabs at the bottom. + * + * + * + * @generated + */ + protected void showTabs() { + if (getPageCount() > 1) { + setPageText(0, getString("_UI_SelectionPage_label")); + if (getContainer() instanceof CTabFolder) { + ((CTabFolder) getContainer()).setTabHeight(SWT.DEFAULT); + Point point = getContainer().getSize(); + getContainer().setSize(point.x, point.y - 6); + } + } + } + + /** + * This is used to track the active viewer. + * + * + * + * @generated + */ + @Override + protected void pageChange(int pageIndex) { + super.pageChange(pageIndex); + + if (contentOutlinePage != null) { + handleContentOutlineSelection(contentOutlinePage.getSelection()); + } + } + + /** + * This is how the framework determines which interfaces we implement. + * + * + * + * @generated + */ + @SuppressWarnings("rawtypes") + @Override + public Object getAdapter(Class key) { + if (key.equals(IContentOutlinePage.class)) { + return showOutlineView() ? getContentOutlinePage() : null; + } + else if (key.equals(IPropertySheetPage.class)) { + return getPropertySheetPage(); + } + else if (key.equals(IGotoMarker.class)) { + return this; + } + else { + return super.getAdapter(key); + } + } + + /** + * This accesses a cached version of the content outliner. + * + * + * + * @generated + */ + public IContentOutlinePage getContentOutlinePage() { + if (contentOutlinePage == null) { + // The content outline is just a tree. + // + class MyContentOutlinePage extends ContentOutlinePage { + @Override + public void createControl(Composite parent) { + super.createControl(parent); + contentOutlineViewer = getTreeViewer(); + contentOutlineViewer.addSelectionChangedListener(this); + + // Set up the tree viewer. + // + contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + contentOutlineViewer.setInput(editingDomain.getResourceSet()); + + // Make sure our popups work. + // + createContextMenuFor(contentOutlineViewer); + + if (!editingDomain.getResourceSet().getResources().isEmpty()) { + // Select the root object in the view. + // + contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); + } + } + + @Override + public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { + super.makeContributions(menuManager, toolBarManager, statusLineManager); + contentOutlineStatusLineManager = statusLineManager; + } + + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + } + + contentOutlinePage = new MyContentOutlinePage(); + + // Listen to selection so that we can handle it is a special way. + // + contentOutlinePage.addSelectionChangedListener + (new ISelectionChangedListener() { + // This ensures that we handle selections correctly. + // + @Override + public void selectionChanged(SelectionChangedEvent event) { + handleContentOutlineSelection(event.getSelection()); + } + }); + } + + return contentOutlinePage; + } + + /** + * This accesses a cached version of the property sheet. + * + * + * + * @generated + */ + public IPropertySheetPage getPropertySheetPage() { + PropertySheetPage propertySheetPage = + new ExtendedPropertySheetPage(editingDomain) { + @Override + public void setSelectionToViewer(List selection) { + GeneratoroptionsmmEditor.this.setSelectionToViewer(selection); + GeneratoroptionsmmEditor.this.setFocus(); + } + + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + }; + propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); + propertySheetPages.add(propertySheetPage); + + return propertySheetPage; + } + + /** + * This deals with how we want selection in the outliner to affect the other views. + * + * + * + * @generated + */ + public void handleContentOutlineSelection(ISelection selection) { + if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) { + Iterator selectedElements = ((IStructuredSelection) selection).iterator(); + if (selectedElements.hasNext()) { + // Get the first selected element. + // + Object selectedElement = selectedElements.next(); + + // If it's the selection viewer, then we want it to select the same selection as this selection. + // + if (currentViewerPane.getViewer() == selectionViewer) { + ArrayList selectionList = new ArrayList(); + selectionList.add(selectedElement); + while (selectedElements.hasNext()) { + selectionList.add(selectedElements.next()); + } + + // Set the selection to the widget. + // + selectionViewer.setSelection(new StructuredSelection(selectionList)); + } + else { + // Set the input to the widget. + // + if (currentViewerPane.getViewer().getInput() != selectedElement) { + currentViewerPane.getViewer().setInput(selectedElement); + currentViewerPane.setTitle(selectedElement); + } + } + } + } + } + + /** + * This is for implementing {@link IEditorPart} and simply tests the command stack. + * + * + * + * @generated + */ + @Override + public boolean isDirty() { + return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded(); + } + + /** + * This is for implementing {@link IEditorPart} and simply saves the model file. + * + * + * + * @generated + */ + @Override + public void doSave(IProgressMonitor progressMonitor) { + // Save only resources that have actually changed. + // + final Map saveOptions = new HashMap(); + saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); + saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED); + + // Do the work within an operation because this is a long running activity that modifies the workbench. + // + WorkspaceModifyOperation operation = + new WorkspaceModifyOperation() { + // This is the method that gets invoked when the operation runs. + // + @Override + public void execute(IProgressMonitor monitor) { + // Save the resources to the file system. + // + boolean first = true; + for (Resource resource : editingDomain.getResourceSet().getResources()) { + if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) { + try { + long timeStamp = resource.getTimeStamp(); + resource.save(saveOptions); + if (resource.getTimeStamp() != timeStamp) { + savedResources.add(resource); + } + } + catch (Exception exception) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + first = false; + } + } + } + }; + + updateProblemIndication = false; + try { + // This runs the options, and shows progress. + // + new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation); + + // Refresh the necessary state. + // + ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone(); + firePropertyChange(IEditorPart.PROP_DIRTY); + } catch (Exception exception) { + // Something went wrong that shouldn't. + // + GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); + } + updateProblemIndication = true; + updateProblemIndication(); + } + + /** + * This returns whether something has been persisted to the URI of the specified resource. + * The implementation uses the URI converter from the editor's resource set to try to open an input stream. + * + * + * + * @generated + */ + protected boolean isPersisted(Resource resource) { + boolean result = false; + try { + InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI()); + if (stream != null) { + result = true; + stream.close(); + } + } catch (IOException e) { + // Ignore + } + return result; + } + + /** + * This always returns true because it is not currently supported. + * + * + * + * @generated + */ + @Override + public boolean isSaveAsAllowed() { + return true; + } + + /** + * This also changes the editor's input. + * + * + * + * @generated + */ + @Override + public void doSaveAs() { + SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); + saveAsDialog.open(); + IPath path = saveAsDialog.getResult(); + if (path != null) { + IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); + if (file != null) { + doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); + } + } + } + + /** + * + * + * + * @generated + */ + protected void doSaveAs(URI uri, IEditorInput editorInput) { + (editingDomain.getResourceSet().getResources().get(0)).setURI(uri); + setInputWithNotify(editorInput); + setPartName(editorInput.getName()); + IProgressMonitor progressMonitor = + getActionBars().getStatusLineManager() != null ? + getActionBars().getStatusLineManager().getProgressMonitor() : + new NullProgressMonitor(); + doSave(progressMonitor); + } + + /** + * + * + * + * @generated + */ + @Override + public void gotoMarker(IMarker marker) { + List targetObjects = markerHelper.getTargetObjects(editingDomain, marker); + if (!targetObjects.isEmpty()) { + setSelectionToViewer(targetObjects); + } + } + + /** + * This is called during startup. + * + * + * + * @generated + */ + @Override + public void init(IEditorSite site, IEditorInput editorInput) { + setSite(site); + setInputWithNotify(editorInput); + setPartName(editorInput.getName()); + site.setSelectionProvider(this); + site.getPage().addPartListener(partListener); + ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE); + } + + /** + * + * + * + * @generated + */ + @Override + public void setFocus() { + if (currentViewerPane != null) { + currentViewerPane.setFocus(); + } + else { + getControl(getActivePage()).setFocus(); + } + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * + * @generated + */ + @Override + public void addSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.add(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * + * @generated + */ + @Override + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.remove(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. + * + * + * + * @generated + */ + @Override + public ISelection getSelection() { + return editorSelection; + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection. + * Calling this result will notify the listeners. + * + * + * + * @generated + */ + @Override + public void setSelection(ISelection selection) { + editorSelection = selection; + + for (ISelectionChangedListener listener : selectionChangedListeners) { + listener.selectionChanged(new SelectionChangedEvent(this, selection)); + } + setStatusLineManager(selection); + } + + /** + * + * + * + * @generated + */ + public void setStatusLineManager(ISelection selection) { + IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? + contentOutlineStatusLineManager : getActionBars().getStatusLineManager(); + + if (statusLineManager != null) { + if (selection instanceof IStructuredSelection) { + Collection collection = ((IStructuredSelection) selection).toList(); + switch (collection.size()) { + case 0: { + statusLineManager.setMessage(getString("_UI_NoObjectSelected")); + break; + } + case 1: { + String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next()); + statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); + break; + } + default: { + statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); + break; + } + } + } + else { + statusLineManager.setMessage(""); + } + } + } + + /** + * This looks up a string in the plugin's plugin.properties file. + * + * + * + * @generated + */ + private static String getString(String key) { + return GeneratoroptionsmmEditorPlugin.INSTANCE.getString(key); + } + + /** + * This looks up a string in plugin.properties, making a substitution. + * + * + * + * @generated + */ + private static String getString(String key, Object s1) { + return GeneratoroptionsmmEditorPlugin.INSTANCE.getString(key, new Object[] { s1 }); + } + + /** + * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu. + * + * + * + * @generated + */ + @Override + public void menuAboutToShow(IMenuManager menuManager) { + ((IMenuListener) getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); + } + + /** + * + * + * + * @generated + */ + public EditingDomainActionBarContributor getActionBarContributor() { + return (EditingDomainActionBarContributor) getEditorSite().getActionBarContributor(); + } + + /** + * + * + * + * @generated + */ + public IActionBars getActionBars() { + return getActionBarContributor().getActionBars(); + } + + /** + * + * + * + * @generated + */ + public AdapterFactory getAdapterFactory() { + return adapterFactory; + } + + /** + * + * + * + * @generated + */ + @Override + public void dispose() { + updateProblemIndication = false; + + ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); + + getSite().getPage().removePartListener(partListener); + + adapterFactory.dispose(); + + if (getActionBarContributor().getActiveEditor() == this) { + getActionBarContributor().setActiveEditor(null); + } + + for (PropertySheetPage propertySheetPage : propertySheetPages) { + propertySheetPage.dispose(); + } + + if (contentOutlinePage != null) { + contentOutlinePage.dispose(); + } + + super.dispose(); + } + + /** + * Returns whether the outline view should be presented to the user. + * + * + * + * @generated + */ + protected boolean showOutlineView() { + return true; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditorPlugin.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditorPlugin.java new file mode 100644 index 00000000000..b9c5d54c04b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmEditorPlugin.java @@ -0,0 +1,96 @@ +/** + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.presentation; + +import org.eclipse.emf.common.EMFPlugin; +import org.eclipse.emf.common.ui.EclipseUIPlugin; +import org.eclipse.emf.common.util.ResourceLocator; + +/** + * This is the central singleton for the Generatoroptionsmm editor plugin. + * + * + * + * @generated + */ +public final class GeneratoroptionsmmEditorPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * + * @generated + */ + public static final GeneratoroptionsmmEditorPlugin INSTANCE = new GeneratoroptionsmmEditorPlugin(); + + /** + * Keep track of the singleton. + * + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * + * @generated + */ + public GeneratoroptionsmmEditorPlugin() { + super(new ResourceLocator[] { + }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * + * @generated + */ + public static class Implementation extends EclipseUIPlugin { + /** + * Creates an instance. + * + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmModelWizard.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmModelWizard.java new file mode 100644 index 00000000000..0eaf5624b1a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/presentation/GeneratoroptionsmmModelWizard.java @@ -0,0 +1,636 @@ +/** + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.presentation; + + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.MissingResourceException; +import java.util.StringTokenizer; + +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.emf.common.CommonPlugin; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.provider.GeneratoroptionsmmEditPlugin; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.INewWizard; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.actions.WorkspaceModifyOperation; +import org.eclipse.ui.dialogs.WizardNewFileCreationPage; +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.ISetSelectionTarget; + + +/** + * This is a simple wizard for creating a new model file. + * + * + * + * @generated + */ +public class GeneratoroptionsmmModelWizard extends Wizard implements INewWizard { + /** + * The supported extensions for created files. + * + * + * + * @generated + */ + public static final List FILE_EXTENSIONS = + Collections.unmodifiableList(Arrays.asList(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmEditorFilenameExtensions").split("\\s*,\\s*"))); + + /** + * A formatted list of supported file extensions, suitable for display. + * + * + * + * @generated + */ + public static final String FORMATTED_FILE_EXTENSIONS = + GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); + + /** + * This caches an instance of the model package. + * + * + * + * @generated + */ + protected GeneratoroptionsmmPackage generatoroptionsmmPackage = GeneratoroptionsmmPackage.eINSTANCE; + + /** + * This caches an instance of the model factory. + * + * + * + * @generated + */ + protected GeneratoroptionsmmFactory generatoroptionsmmFactory = generatoroptionsmmPackage.getGeneratoroptionsmmFactory(); + + /** + * This is the file creation page. + * + * + * + * @generated + */ + protected GeneratoroptionsmmModelWizardNewFileCreationPage newFileCreationPage; + + /** + * This is the initial object creation page. + * + * + * + * @generated + */ + protected GeneratoroptionsmmModelWizardInitialObjectCreationPage initialObjectCreationPage; + + /** + * Remember the selection during initialization for populating the default container. + * + * + * + * @generated + */ + protected IStructuredSelection selection; + + /** + * Remember the workbench during initialization. + * + * + * + * @generated + */ + protected IWorkbench workbench; + + /** + * Caches the names of the types that can be created as the root object. + * + * + * + * @generated + */ + protected List initialObjectNames; + + /** + * This just records the information. + * + * + * + * @generated + */ + @Override + public void init(IWorkbench workbench, IStructuredSelection selection) { + this.workbench = workbench; + this.selection = selection; + setWindowTitle(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(GeneratoroptionsmmEditorPlugin.INSTANCE.getImage("full/wizban/NewGeneratoroptionsmm"))); + } + + /** + * Returns the names of the types that can be created as the root object. + * + * + * + * @generated + */ + protected Collection getInitialObjectNames() { + if (initialObjectNames == null) { + initialObjectNames = new ArrayList(); + for (EClassifier eClassifier : generatoroptionsmmPackage.getEClassifiers()) { + if (eClassifier instanceof EClass) { + EClass eClass = (EClass) eClassifier; + if (!eClass.isAbstract()) { + initialObjectNames.add(eClass.getName()); + } + } + } + Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator()); + } + return initialObjectNames; + } + + /** + * Create a new model. + * + * + * + * @generated + */ + protected EObject createInitialModel() { + EClass eClass = (EClass) generatoroptionsmmPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); + EObject rootObject = generatoroptionsmmFactory.create(eClass); + return rootObject; + } + + /** + * Do the work after everything is specified. + * + * + * + * @generated + */ + @Override + public boolean performFinish() { + try { + // Remember the file. + // + final IFile modelFile = getModelFile(); + + // Do the work within an operation. + // + WorkspaceModifyOperation operation = + new WorkspaceModifyOperation() { + @Override + protected void execute(IProgressMonitor progressMonitor) { + try { + // Create a resource set + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Get the URI of the model file. + // + URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true); + + // Create a resource for this file. + // + Resource resource = resourceSet.createResource(fileURI); + + // Add the initial model object to the contents. + // + EObject rootObject = createInitialModel(); + if (rootObject != null) { + resource.getContents().add(rootObject); + } + + // Save the contents of the resource to the file system. + // + Map options = new HashMap(); + options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding()); + resource.save(options); + } + catch (Exception exception) { + GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); + } + finally { + progressMonitor.done(); + } + } + }; + + getContainer().run(false, false, operation); + + // Select the new file resource in the current view. + // + IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); + IWorkbenchPage page = workbenchWindow.getActivePage(); + final IWorkbenchPart activePart = page.getActivePart(); + if (activePart instanceof ISetSelectionTarget) { + final ISelection targetSelection = new StructuredSelection(modelFile); + getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + ((ISetSelectionTarget) activePart).selectReveal(targetSelection); + } + }); + } + + // Open an editor on the new file. + // + try { + page.openEditor + (new FileEditorInput(modelFile), + workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId()); + } catch (PartInitException exception) { + MessageDialog.openError(workbenchWindow.getShell(), GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); + return false; + } + + return true; + } catch (Exception exception) { + GeneratoroptionsmmEditorPlugin.INSTANCE.log(exception); + return false; + } + } + + /** + * This is the one page of the wizard. + * + * + * + * @generated + */ + public class GeneratoroptionsmmModelWizardNewFileCreationPage extends WizardNewFileCreationPage { + /** + * Pass in the selection. + * + * + * + * @generated + */ + public GeneratoroptionsmmModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) { + super(pageId, selection); + } + + /** + * The framework calls this to see if the file is correct. + * + * + * + * @generated + */ + @Override + protected boolean validatePage() { + if (super.validatePage()) { + String extension = new Path(getFileName()).getFileExtension(); + if (extension == null || !FILE_EXTENSIONS.contains(extension)) { + String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; + setErrorMessage(GeneratoroptionsmmEditorPlugin.INSTANCE.getString(key, new Object[] { FORMATTED_FILE_EXTENSIONS })); + return false; + } + return true; + } + return false; + } + + /** + * + * + * + * @generated + */ + public IFile getModelFile() { + return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName())); + } + } + + /** + * This is the page where the type of object to create is selected. + * + * + * + * @generated + */ + public class GeneratoroptionsmmModelWizardInitialObjectCreationPage extends WizardPage { + /** + * + * + * + * @generated + */ + protected Combo initialObjectField; + + /** + * @generated + * + * + */ + protected List encodings; + + /** + * + * + * + * @generated + */ + protected Combo encodingField; + + /** + * Pass in the selection. + * + * + * + * @generated + */ + public GeneratoroptionsmmModelWizardInitialObjectCreationPage(String pageId) { + super(pageId); + } + + /** + * + * + * + * @generated + */ + @Override + public void createControl(Composite parent) { + Composite composite = new Composite(parent, SWT.NONE); + { + GridLayout layout = new GridLayout(); + layout.numColumns = 1; + layout.verticalSpacing = 12; + composite.setLayout(layout); + + GridData data = new GridData(); + data.verticalAlignment = GridData.FILL; + data.grabExcessVerticalSpace = true; + data.horizontalAlignment = GridData.FILL; + composite.setLayoutData(data); + } + + Label containerLabel = new Label(composite, SWT.LEFT); + { + containerLabel.setText(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_ModelObject")); + + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + containerLabel.setLayoutData(data); + } + + initialObjectField = new Combo(composite, SWT.BORDER); + { + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + data.grabExcessHorizontalSpace = true; + initialObjectField.setLayoutData(data); + } + + for (String objectName : getInitialObjectNames()) { + initialObjectField.add(getLabel(objectName)); + } + + if (initialObjectField.getItemCount() == 1) { + initialObjectField.select(0); + } + initialObjectField.addModifyListener(validator); + + Label encodingLabel = new Label(composite, SWT.LEFT); + { + encodingLabel.setText(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_XMLEncoding")); + + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + encodingLabel.setLayoutData(data); + } + encodingField = new Combo(composite, SWT.BORDER); + { + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + data.grabExcessHorizontalSpace = true; + encodingField.setLayoutData(data); + } + + for (String encoding : getEncodings()) { + encodingField.add(encoding); + } + + encodingField.select(0); + encodingField.addModifyListener(validator); + + setPageComplete(validatePage()); + setControl(composite); + } + + /** + * + * + * + * @generated + */ + protected ModifyListener validator = + new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + setPageComplete(validatePage()); + } + }; + + /** + * + * + * + * @generated + */ + protected boolean validatePage() { + return getInitialObjectName() != null && getEncodings().contains(encodingField.getText()); + } + + /** + * + * + * + * @generated + */ + @Override + public void setVisible(boolean visible) { + super.setVisible(visible); + if (visible) { + if (initialObjectField.getItemCount() == 1) { + initialObjectField.clearSelection(); + encodingField.setFocus(); + } + else { + encodingField.clearSelection(); + initialObjectField.setFocus(); + } + } + } + + /** + * + * + * + * @generated + */ + public String getInitialObjectName() { + String label = initialObjectField.getText(); + + for (String name : getInitialObjectNames()) { + if (getLabel(name).equals(label)) { + return name; + } + } + return null; + } + + /** + * + * + * + * @generated + */ + public String getEncoding() { + return encodingField.getText(); + } + + /** + * Returns the label for the specified type name. + * + * + * + * @generated + */ + protected String getLabel(String typeName) { + try { + return GeneratoroptionsmmEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); + } catch (MissingResourceException mre) { + GeneratoroptionsmmEditorPlugin.INSTANCE.log(mre); + } + return typeName; + } + + /** + * + * + * + * @generated + */ + protected Collection getEncodings() { + if (encodings == null) { + encodings = new ArrayList(); + for (StringTokenizer stringTokenizer = new StringTokenizer(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens();) { + encodings.add(stringTokenizer.nextToken()); + } + } + return encodings; + } + } + + /** + * The framework calls this to create the contents of the wizard. + * + * + * + * @generated + */ + @Override + public void addPages() { + // Create a page, set the title, and the initial model file name. + // + newFileCreationPage = new GeneratoroptionsmmModelWizardNewFileCreationPage("Whatever", selection); + newFileCreationPage.setTitle(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmModelWizard_label")); + newFileCreationPage.setDescription(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmModelWizard_description")); + newFileCreationPage.setFileName(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0)); + addPage(newFileCreationPage); + + // Try and get the resource selection to determine a current directory for the file dialog. + // + if (selection != null && !selection.isEmpty()) { + // Get the resource... + // + Object selectedElement = selection.iterator().next(); + if (selectedElement instanceof IResource) { + // Get the resource parent, if its a file. + // + IResource selectedResource = (IResource) selectedElement; + if (selectedResource.getType() == IResource.FILE) { + selectedResource = selectedResource.getParent(); + } + + // This gives us a directory... + // + if (selectedResource instanceof IFolder || selectedResource instanceof IProject) { + // Set this for the container. + // + newFileCreationPage.setContainerFullPath(selectedResource.getFullPath()); + + // Make up a unique new name here. + // + String defaultModelBaseFilename = GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmEditorFilenameDefaultBase"); + String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0); + String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; + for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) { + modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; + } + newFileCreationPage.setFileName(modelFilename); + } + } + } + initialObjectCreationPage = new GeneratoroptionsmmModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage.setTitle(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_GeneratoroptionsmmModelWizard_label")); + initialObjectCreationPage.setDescription(GeneratoroptionsmmEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description")); + addPage(initialObjectCreationPage); + } + + /** + * Get the file from the page. + * + * + * + * @generated + */ + public IFile getModelFile() { + return newFileCreationPage.getModelFile(); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmActionBarContributor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmActionBarContributor.java new file mode 100644 index 00000000000..e86713e1c5d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmActionBarContributor.java @@ -0,0 +1,461 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.presentation; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.ui.viewer.IViewerProvider; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.domain.IEditingDomainProvider; +import org.eclipse.emf.edit.ui.action.ControlAction; +import org.eclipse.emf.edit.ui.action.CreateChildAction; +import org.eclipse.emf.edit.ui.action.CreateSiblingAction; +import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; +import org.eclipse.emf.edit.ui.action.LoadResourceAction; +import org.eclipse.emf.edit.ui.action.ValidateAction; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.ActionContributionItem; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IContributionItem; +import org.eclipse.jface.action.IContributionManager; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.jface.action.SubContributionItem; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.PartInitException; + +/** + * This is the action bar contributor for the Jdtmm model editor. + * + * + * + * @generated + */ +public class JdtmmActionBarContributor + extends EditingDomainActionBarContributor + implements ISelectionChangedListener { + /** + * This keeps track of the active editor. + * + * + * + * @generated + */ + protected IEditorPart activeEditorPart; + + /** + * This keeps track of the current selection provider. + * + * + * + * @generated + */ + protected ISelectionProvider selectionProvider; + + /** + * This action opens the Properties view. + * + * + * + * @generated + */ + protected IAction showPropertiesViewAction = + new Action(JdtmmEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { + @Override + public void run() { + try { + getPage().showView("org.eclipse.ui.views.PropertySheet"); + } + catch (PartInitException exception) { + JdtmmEditorPlugin.INSTANCE.log(exception); + } + } + }; + + /** + * This action refreshes the viewer of the current editor if the editor + * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. + * + * + * + * @generated + */ + protected IAction refreshViewerAction = + new Action(JdtmmEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) { + @Override + public boolean isEnabled() { + return activeEditorPart instanceof IViewerProvider; + } + + @Override + public void run() { + if (activeEditorPart instanceof IViewerProvider) { + Viewer viewer = ((IViewerProvider) activeEditorPart).getViewer(); + if (viewer != null) { + viewer.refresh(); + } + } + } + }; + + /** + * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor + * generated for the current selection by the item provider. + * + * + * + * @generated + */ + protected Collection createChildActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateChild actions. + * + * + * + * @generated + */ + protected IMenuManager createChildMenuManager; + + /** + * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor + * generated for the current selection by the item provider. + * + * + * + * @generated + */ + protected Collection createSiblingActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateSibling actions. + * + * + * + * @generated + */ + protected IMenuManager createSiblingMenuManager; + + /** + * This creates an instance of the contributor. + * + * + * + * @generated + */ + public JdtmmActionBarContributor() { + super(ADDITIONS_LAST_STYLE); + loadResourceAction = new LoadResourceAction(); + validateAction = new ValidateAction(); + controlAction = new ControlAction(); + } + + /** + * This adds Separators for editor additions to the tool bar. + * + * + * + * @generated + */ + @Override + public void contributeToToolBar(IToolBarManager toolBarManager) { + toolBarManager.add(new Separator("jdtmm-settings")); + toolBarManager.add(new Separator("jdtmm-additions")); + } + + /** + * This adds to the menu bar a menu and some separators for editor additions, + * as well as the sub-menus for object creation items. + * + * + * + * @generated + */ + @Override + public void contributeToMenu(IMenuManager menuManager) { + super.contributeToMenu(menuManager); + + IMenuManager submenuManager = new MenuManager(JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmEditor_menu"), "org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmmMenuID"); + menuManager.insertAfter("additions", submenuManager); + submenuManager.add(new Separator("settings")); + submenuManager.add(new Separator("actions")); + submenuManager.add(new Separator("additions")); + submenuManager.add(new Separator("additions-end")); + + // Prepare for CreateChild item addition or removal. + // + createChildMenuManager = new MenuManager(JdtmmEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + submenuManager.insertBefore("additions", createChildMenuManager); + + // Prepare for CreateSibling item addition or removal. + // + createSiblingMenuManager = new MenuManager(JdtmmEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + submenuManager.insertBefore("additions", createSiblingMenuManager); + + // Force an update because Eclipse hides empty menus now. + // + submenuManager.addMenuListener + (new IMenuListener() { + @Override + public void menuAboutToShow(IMenuManager menuManager) { + menuManager.updateAll(true); + } + }); + + addGlobalActions(submenuManager); + } + + /** + * When the active editor changes, this remembers the change and registers with it as a selection provider. + * + * + * + * @generated + */ + @Override + public void setActiveEditor(IEditorPart part) { + super.setActiveEditor(part); + activeEditorPart = part; + + // Switch to the new selection provider. + // + if (selectionProvider != null) { + selectionProvider.removeSelectionChangedListener(this); + } + if (part == null) { + selectionProvider = null; + } + else { + selectionProvider = part.getSite().getSelectionProvider(); + selectionProvider.addSelectionChangedListener(this); + + // Fake a selection changed event to update the menus. + // + if (selectionProvider.getSelection() != null) { + selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection())); + } + } + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener}, + * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings + * that can be added to the selected object and updating the menus accordingly. + * + * + * + * @generated + */ + @Override + public void selectionChanged(SelectionChangedEvent event) { + // Remove any menu items for old selection. + // + if (createChildMenuManager != null) { + depopulateManager(createChildMenuManager, createChildActions); + } + if (createSiblingMenuManager != null) { + depopulateManager(createSiblingMenuManager, createSiblingActions); + } + + // Query the new selection for appropriate new child/sibling descriptors + // + Collection newChildDescriptors = null; + Collection newSiblingDescriptors = null; + + ISelection selection = event.getSelection(); + if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) { + Object object = ((IStructuredSelection) selection).getFirstElement(); + + EditingDomain domain = ((IEditingDomainProvider) activeEditorPart).getEditingDomain(); + + newChildDescriptors = domain.getNewChildDescriptors(object, null); + newSiblingDescriptors = domain.getNewChildDescriptors(null, object); + } + + // Generate actions for selection; populate and redraw the menus. + // + createChildActions = generateCreateChildActions(newChildDescriptors, selection); + createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection); + + if (createChildMenuManager != null) { + populateManager(createChildMenuManager, createChildActions, null); + createChildMenuManager.update(true); + } + if (createSiblingMenuManager != null) { + populateManager(createSiblingMenuManager, createSiblingActions, null); + createSiblingMenuManager.update(true); + } + } + + /** + * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in descriptors, + * and returns the collection of these actions. + * + * + * + * @generated + */ + protected Collection generateCreateChildActions(Collection descriptors, ISelection selection) { + Collection actions = new ArrayList(); + if (descriptors != null) { + for (Object descriptor : descriptors) { + actions.add(new CreateChildAction(activeEditorPart, selection, descriptor)); + } + } + return actions; + } + + /** + * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in descriptors, + * and returns the collection of these actions. + * + * + * + * @generated + */ + protected Collection generateCreateSiblingActions(Collection descriptors, ISelection selection) { + Collection actions = new ArrayList(); + if (descriptors != null) { + for (Object descriptor : descriptors) { + actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); + } + } + return actions; + } + + /** + * This populates the specified manager with {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection, + * by inserting them before the specified contribution item contributionID. + * If contributionID is null, they are simply added. + * + * + * + * @generated + */ + protected void populateManager(IContributionManager manager, Collection actions, String contributionID) { + if (actions != null) { + for (IAction action : actions) { + if (contributionID != null) { + manager.insertBefore(contributionID, action); + } + else { + manager.add(action); + } + } + } + } + + /** + * This removes from the specified manager all {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection. + * + * + * + * @generated + */ + protected void depopulateManager(IContributionManager manager, Collection actions) { + if (actions != null) { + IContributionItem[] items = manager.getItems(); + for (int i = 0; i < items.length; i++) { + // Look into SubContributionItems + // + IContributionItem contributionItem = items[i]; + while (contributionItem instanceof SubContributionItem) { + contributionItem = ((SubContributionItem) contributionItem).getInnerItem(); + } + + // Delete the ActionContributionItems with matching action. + // + if (contributionItem instanceof ActionContributionItem) { + IAction action = ((ActionContributionItem) contributionItem).getAction(); + if (actions.contains(action)) { + manager.remove(contributionItem); + } + } + } + } + } + + /** + * This populates the pop-up menu before it appears. + * + * + * + * @generated + */ + @Override + public void menuAboutToShow(IMenuManager menuManager) { + super.menuAboutToShow(menuManager); + MenuManager submenuManager = null; + + submenuManager = new MenuManager(JdtmmEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + populateManager(submenuManager, createChildActions, null); + menuManager.insertBefore("edit", submenuManager); + + submenuManager = new MenuManager(JdtmmEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + populateManager(submenuManager, createSiblingActions, null); + menuManager.insertBefore("edit", submenuManager); + } + + /** + * This inserts global actions before the "additions-end" separator. + * + * + * + * @generated + */ + @Override + protected void addGlobalActions(IMenuManager menuManager) { + menuManager.insertAfter("additions-end", new Separator("ui-actions")); + menuManager.insertAfter("ui-actions", showPropertiesViewAction); + + refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); + menuManager.insertAfter("ui-actions", refreshViewerAction); + + super.addGlobalActions(menuManager); + } + + /** + * This ensures that a delete action will clean up all references to deleted objects. + * + * + * + * @generated + */ + @Override + protected boolean removeAllReferencesOnDelete() { + return true; + } + +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditor.java new file mode 100644 index 00000000000..fa9eb69be34 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditor.java @@ -0,0 +1,1897 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.presentation; + + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.EventObject; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceChangeEvent; +import org.eclipse.core.resources.IResourceChangeListener; +import org.eclipse.core.resources.IResourceDelta; +import org.eclipse.core.resources.IResourceDeltaVisitor; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.emf.common.command.BasicCommandStack; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CommandStack; +import org.eclipse.emf.common.command.CommandStackListener; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.ui.MarkerHelper; +import org.eclipse.emf.common.ui.ViewerPane; +import org.eclipse.emf.common.ui.editor.ProblemEditorPart; +import org.eclipse.emf.common.ui.viewer.IViewerProvider; +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EValidator; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.EContentAdapter; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.domain.IEditingDomainProvider; +import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; +import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory; +import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; +import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; +import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter; +import org.eclipse.emf.edit.ui.dnd.LocalTransfer; +import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter; +import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; +import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; +import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider; +import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper; +import org.eclipse.emf.edit.ui.util.EditUIUtil; +import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IStatusLineManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ListViewer; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.StructuredViewer; +import org.eclipse.jface.viewers.TableLayout; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider.JdtmmItemProviderAdapterFactory; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CTabFolder; +import org.eclipse.swt.dnd.DND; +import org.eclipse.swt.dnd.Transfer; +import org.eclipse.swt.events.ControlAdapter; +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.swt.widgets.TreeColumn; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.IPartListener; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.actions.WorkspaceModifyOperation; +import org.eclipse.ui.dialogs.SaveAsDialog; +import org.eclipse.ui.ide.IGotoMarker; +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.MultiPageEditorPart; +import org.eclipse.ui.views.contentoutline.ContentOutline; +import org.eclipse.ui.views.contentoutline.ContentOutlinePage; +import org.eclipse.ui.views.contentoutline.IContentOutlinePage; +import org.eclipse.ui.views.properties.IPropertySheetPage; +import org.eclipse.ui.views.properties.PropertySheet; +import org.eclipse.ui.views.properties.PropertySheetPage; + + +/** + * This is an example of a Jdtmm model editor. + * + * + * + * @generated + */ +public class JdtmmEditor + extends MultiPageEditorPart + implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker { + /** + * This keeps track of the editing domain that is used to track all changes to the model. + * + * + * + * @generated + */ + protected AdapterFactoryEditingDomain editingDomain; + + /** + * This is the one adapter factory used for providing views of the model. + * + * + * + * @generated + */ + protected ComposedAdapterFactory adapterFactory; + + /** + * This is the content outline page. + * + * + * + * @generated + */ + protected IContentOutlinePage contentOutlinePage; + + /** + * This is a kludge... + * + * + * + * @generated + */ + protected IStatusLineManager contentOutlineStatusLineManager; + + /** + * This is the content outline page's viewer. + * + * + * + * @generated + */ + protected TreeViewer contentOutlineViewer; + + /** + * This is the property sheet page. + * + * + * + * @generated + */ + protected PropertySheetPage propertySheetPage; + + /** + * This is the viewer that shadows the selection in the content outline. + * The parent relation must be correctly defined for this to work. + * + * + * + * @generated + */ + protected TreeViewer selectionViewer; + + /** + * This inverts the roll of parent and child in the content provider and show parents as a tree. + * + * + * + * @generated + */ + protected TreeViewer parentViewer; + + /** + * This shows how a tree view works. + * + * + * + * @generated + */ + protected TreeViewer treeViewer; + + /** + * This shows how a list view works. + * A list viewer doesn't support icons. + * + * + * + * @generated + */ + protected ListViewer listViewer; + + /** + * This shows how a table view works. + * A table can be used as a list with icons. + * + * + * + * @generated + */ + protected TableViewer tableViewer; + + /** + * This shows how a tree view with columns works. + * + * + * + * @generated + */ + protected TreeViewer treeViewerWithColumns; + + /** + * This keeps track of the active viewer pane, in the book. + * + * + * + * @generated + */ + protected ViewerPane currentViewerPane; + + /** + * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer. + * + * + * + * @generated + */ + protected Viewer currentViewer; + + /** + * This listens to which ever viewer is active. + * + * + * + * @generated + */ + protected ISelectionChangedListener selectionChangedListener; + + /** + * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor. + * + * + * + * @generated + */ + protected Collection selectionChangedListeners = new ArrayList(); + + /** + * This keeps track of the selection of the editor as a whole. + * + * + * + * @generated + */ + protected ISelection editorSelection = StructuredSelection.EMPTY; + + /** + * The MarkerHelper is responsible for creating workspace resource markers presented + * in Eclipse's Problems View. + * + * + * + * @generated + */ + protected MarkerHelper markerHelper = new EditUIMarkerHelper(); + + /** + * This listens for when the outline becomes active + * + * + * + * @generated + */ + protected IPartListener partListener = + new IPartListener() { + @Override + public void partActivated(IWorkbenchPart p) { + if (p instanceof ContentOutline) { + if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) { + getActionBarContributor().setActiveEditor(JdtmmEditor.this); + + setCurrentViewer(contentOutlineViewer); + } + } + else if (p instanceof PropertySheet) { + if (((PropertySheet) p).getCurrentPage() == propertySheetPage) { + getActionBarContributor().setActiveEditor(JdtmmEditor.this); + handleActivate(); + } + } + else if (p == JdtmmEditor.this) { + handleActivate(); + } + } + + @Override + public void partBroughtToTop(IWorkbenchPart p) { + // Ignore. + } + + @Override + public void partClosed(IWorkbenchPart p) { + // Ignore. + } + + @Override + public void partDeactivated(IWorkbenchPart p) { + // Ignore. + } + + @Override + public void partOpened(IWorkbenchPart p) { + // Ignore. + } + }; + + /** + * Resources that have been removed since last activation. + * + * + * + * @generated + */ + protected Collection removedResources = new ArrayList(); + + /** + * Resources that have been changed since last activation. + * + * + * + * @generated + */ + protected Collection changedResources = new ArrayList(); + + /** + * Resources that have been saved. + * + * + * + * @generated + */ + protected Collection savedResources = new ArrayList(); + + /** + * Map to store the diagnostic associated with a resource. + * + * + * + * @generated + */ + protected Map resourceToDiagnosticMap = new LinkedHashMap(); + + /** + * Controls whether the problem indication should be updated. + * + * + * + * @generated + */ + protected boolean updateProblemIndication = true; + + /** + * Adapter used to update the problem indication when resources are demanded loaded. + * + * + * + * @generated + */ + protected EContentAdapter problemIndicationAdapter = + new EContentAdapter() { + @Override + public void notifyChanged(Notification notification) { + if (notification.getNotifier() instanceof Resource) { + switch (notification.getFeatureID(Resource.class)) { + case Resource.RESOURCE__IS_LOADED: + case Resource.RESOURCE__ERRORS: + case Resource.RESOURCE__WARNINGS: { + Resource resource = (Resource) notification.getNotifier(); + Diagnostic diagnostic = analyzeResourceProblems(resource, null); + if (diagnostic.getSeverity() != Diagnostic.OK) { + resourceToDiagnosticMap.put(resource, diagnostic); + } + else { + resourceToDiagnosticMap.remove(resource); + } + + if (updateProblemIndication) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + updateProblemIndication(); + } + }); + } + break; + } + } + } + else { + super.notifyChanged(notification); + } + } + + @Override + protected void setTarget(Resource target) { + basicSetTarget(target); + } + + @Override + protected void unsetTarget(Resource target) { + basicUnsetTarget(target); + } + }; + + /** + * This listens for workspace changes. + * + * + * + * @generated + */ + protected IResourceChangeListener resourceChangeListener = + new IResourceChangeListener() { + @Override + public void resourceChanged(IResourceChangeEvent event) { + IResourceDelta delta = event.getDelta(); + try { + class ResourceDeltaVisitor implements IResourceDeltaVisitor { + protected ResourceSet resourceSet = editingDomain.getResourceSet(); + protected Collection changedResources = new ArrayList(); + protected Collection removedResources = new ArrayList(); + + @Override + public boolean visit(IResourceDelta delta) { + if (delta.getResource().getType() == IResource.FILE) { + if (delta.getKind() == IResourceDelta.REMOVED || + delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) { + Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false); + if (resource != null) { + if (delta.getKind() == IResourceDelta.REMOVED) { + removedResources.add(resource); + } + else if (!savedResources.remove(resource)) { + changedResources.add(resource); + } + } + } + } + + return true; + } + + public Collection getChangedResources() { + return changedResources; + } + + public Collection getRemovedResources() { + return removedResources; + } + } + + final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(); + delta.accept(visitor); + + if (!visitor.getRemovedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + removedResources.addAll(visitor.getRemovedResources()); + if (!isDirty()) { + getSite().getPage().closeEditor(JdtmmEditor.this, false); + } + } + }); + } + + if (!visitor.getChangedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + changedResources.addAll(visitor.getChangedResources()); + if (getSite().getPage().getActiveEditor() == JdtmmEditor.this) { + handleActivate(); + } + } + }); + } + } + catch (CoreException exception) { + JdtmmEditorPlugin.INSTANCE.log(exception); + } + } + }; + + /** + * Handles activation of the editor or it's associated views. + * + * + * + * @generated + */ + protected void handleActivate() { + // Recompute the read only state. + // + if (editingDomain.getResourceToReadOnlyMap() != null) { + editingDomain.getResourceToReadOnlyMap().clear(); + + // Refresh any actions that may become enabled or disabled. + // + setSelection(getSelection()); + } + + if (!removedResources.isEmpty()) { + if (handleDirtyConflict()) { + getSite().getPage().closeEditor(JdtmmEditor.this, false); + } + else { + removedResources.clear(); + changedResources.clear(); + savedResources.clear(); + } + } + else if (!changedResources.isEmpty()) { + changedResources.removeAll(savedResources); + handleChangedResources(); + changedResources.clear(); + savedResources.clear(); + } + } + + /** + * Handles what to do with changed resources on activation. + * + * + * + * @generated + */ + protected void handleChangedResources() { + if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { + if (isDirty()) { + changedResources.addAll(editingDomain.getResourceSet().getResources()); + } + editingDomain.getCommandStack().flush(); + + updateProblemIndication = false; + for (Resource resource : changedResources) { + if (resource.isLoaded()) { + resource.unload(); + try { + resource.load(Collections.EMPTY_MAP); + } catch (IOException exception) { + if (!resourceToDiagnosticMap.containsKey(resource)) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + } + } + } + + if (AdapterFactoryEditingDomain.isStale(editorSelection)) { + setSelection(StructuredSelection.EMPTY); + } + + updateProblemIndication = true; + updateProblemIndication(); + } + } + + /** + * Updates the problems indication with the information described in the specified diagnostic. + * + * + * + * @generated + */ + protected void updateProblemIndication() { + if (updateProblemIndication) { + BasicDiagnostic diagnostic = + new BasicDiagnostic + (Diagnostic.OK, + "org.eclipse.papyrus.java.generator.metamodel.jdt.editor", + 0, + null, + new Object[] { editingDomain.getResourceSet() }); + for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) { + if (childDiagnostic.getSeverity() != Diagnostic.OK) { + diagnostic.add(childDiagnostic); + } + } + + int lastEditorPage = getPageCount() - 1; + if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) { + ((ProblemEditorPart) getEditor(lastEditorPage)).setDiagnostic(diagnostic); + if (diagnostic.getSeverity() != Diagnostic.OK) { + setActivePage(lastEditorPage); + } + } + else if (diagnostic.getSeverity() != Diagnostic.OK) { + ProblemEditorPart problemEditorPart = new ProblemEditorPart(); + problemEditorPart.setDiagnostic(diagnostic); + problemEditorPart.setMarkerHelper(markerHelper); + try { + addPage(++lastEditorPage, problemEditorPart, getEditorInput()); + setPageText(lastEditorPage, problemEditorPart.getPartName()); + setActivePage(lastEditorPage); + showTabs(); + } catch (PartInitException exception) { + JdtmmEditorPlugin.INSTANCE.log(exception); + } + } + + if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { + markerHelper.deleteMarkers(editingDomain.getResourceSet()); + if (diagnostic.getSeverity() != Diagnostic.OK) { + try { + markerHelper.createMarkers(diagnostic); + } catch (CoreException exception) { + JdtmmEditorPlugin.INSTANCE.log(exception); + } + } + } + } + } + + /** + * Shows a dialog that asks if conflicting changes should be discarded. + * + * + * + * @generated + */ + protected boolean handleDirtyConflict() { + return MessageDialog.openQuestion + (getSite().getShell(), + getString("_UI_FileConflict_label"), + getString("_WARN_FileConflict")); + } + + /** + * This creates a model editor. + * + * + * + * @generated + */ + public JdtmmEditor() { + super(); + initializeEditingDomain(); + } + + /** + * This sets up the editing domain for the model editor. + * + * + * + * @generated + */ + protected void initializeEditingDomain() { + // Create an adapter factory that yields item providers. + // + adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); + + adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new JdtmmItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); + + // Create the command stack that will notify this editor as commands are executed. + // + BasicCommandStack commandStack = new BasicCommandStack(); + + // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. + // + commandStack.addCommandStackListener + (new CommandStackListener() { + @Override + public void commandStackChanged(final EventObject event) { + getContainer().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + firePropertyChange(IEditorPart.PROP_DIRTY); + + // Try to select the affected objects. + // + Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand(); + if (mostRecentCommand != null) { + setSelectionToViewer(mostRecentCommand.getAffectedObjects()); + } + if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) { + propertySheetPage.refresh(); + } + } + }); + } + }); + + // Create the editing domain with a special command stack. + // + editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap()); + } + + /** + * This is here for the listener to be able to call it. + * + * + * + * @generated + */ + @Override + protected void firePropertyChange(int action) { + super.firePropertyChange(action); + } + + /** + * This sets the selection into whichever viewer is active. + * + * + * + * @generated + */ + public void setSelectionToViewer(Collection collection) { + final Collection theSelection = collection; + // Make sure it's okay. + // + if (theSelection != null && !theSelection.isEmpty()) { + Runnable runnable = + new Runnable() { + @Override + public void run() { + // Try to select the items in the current content viewer of the editor. + // + if (currentViewer != null) { + currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); + } + } + }; + getSite().getShell().getDisplay().asyncExec(runnable); + } + } + + /** + * This returns the editing domain as required by the {@link IEditingDomainProvider} interface. + * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}. + * + * + * + * @generated + */ + @Override + public EditingDomain getEditingDomain() { + return editingDomain; + } + + /** + * + * + * + * @generated + */ + public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { + /** + * + * + * + * @generated + */ + public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * + * + * + * @generated + */ + @Override + public Object[] getElements(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * + * @generated + */ + @Override + public Object[] getChildren(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean hasChildren(Object object) { + Object parent = super.getParent(object); + return parent != null; + } + + /** + * + * + * + * @generated + */ + @Override + public Object getParent(Object object) { + return null; + } + } + + /** + * + * + * + * @generated + */ + public void setCurrentViewerPane(ViewerPane viewerPane) { + if (currentViewerPane != viewerPane) { + if (currentViewerPane != null) { + currentViewerPane.showFocus(false); + } + currentViewerPane = viewerPane; + } + setCurrentViewer(currentViewerPane.getViewer()); + } + + /** + * This makes sure that one content viewer, either for the current page or the outline view, if it has focus, + * is the current one. + * + * + * + * @generated + */ + public void setCurrentViewer(Viewer viewer) { + // If it is changing... + // + if (currentViewer != viewer) { + if (selectionChangedListener == null) { + // Create the listener on demand. + // + selectionChangedListener = + new ISelectionChangedListener() { + // This just notifies those things that are affected by the section. + // + @Override + public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { + setSelection(selectionChangedEvent.getSelection()); + } + }; + } + + // Stop listening to the old one. + // + if (currentViewer != null) { + currentViewer.removeSelectionChangedListener(selectionChangedListener); + } + + // Start listening to the new one. + // + if (viewer != null) { + viewer.addSelectionChangedListener(selectionChangedListener); + } + + // Remember it. + // + currentViewer = viewer; + + // Set the editors selection based on the current viewer's selection. + // + setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection()); + } + } + + /** + * This returns the viewer as required by the {@link IViewerProvider} interface. + * + * + * + * @generated + */ + @Override + public Viewer getViewer() { + return currentViewer; + } + + /** + * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. + * + * + * + * @generated + */ + protected void createContextMenuFor(StructuredViewer viewer) { + MenuManager contextMenu = new MenuManager("#PopUp"); + contextMenu.add(new Separator("additions")); + contextMenu.setRemoveAllWhenShown(true); + contextMenu.addMenuListener(this); + Menu menu = contextMenu.createContextMenu(viewer.getControl()); + viewer.getControl().setMenu(menu); + getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); + + int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; + Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() }; + viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); + viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); + } + + /** + * This is the method called to load a resource into the editing domain's resource set based on the editor's input. + * + * + * + * @generated + */ + public void createModel() { + URI resourceURI = EditUIUtil.getURI(getEditorInput()); + Exception exception = null; + Resource resource = null; + try { + // Load the resource through the editing domain. + // + resource = editingDomain.getResourceSet().getResource(resourceURI, true); + } catch (Exception e) { + exception = e; + resource = editingDomain.getResourceSet().getResource(resourceURI, false); + } + + Diagnostic diagnostic = analyzeResourceProblems(resource, exception); + if (diagnostic.getSeverity() != Diagnostic.OK) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter); + } + + /** + * Returns a diagnostic describing the errors and warnings listed in the resource + * and the specified exception (if any). + * + * + * + * @generated + */ + public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) { + if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) { + BasicDiagnostic basicDiagnostic = + new BasicDiagnostic + (Diagnostic.ERROR, + "org.eclipse.papyrus.java.generator.metamodel.jdt.editor", + 0, + getString("_UI_CreateModelError_message", resource.getURI()), + new Object[] { exception == null ? (Object) resource : exception }); + basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); + return basicDiagnostic; + } + else if (exception != null) { + return new BasicDiagnostic(Diagnostic.ERROR, + "org.eclipse.papyrus.java.generator.metamodel.jdt.editor", + 0, + getString("_UI_CreateModelError_message", resource.getURI()), + new Object[] { exception }); + } + else { + return Diagnostic.OK_INSTANCE; + } + } + + /** + * This is the method used by the framework to install your own controls. + * + * + * + * @generated + */ + @Override + public void createPages() { + // Creates the model from the editor input + // + createModel(); + + // Only creates the other pages if there is something that can be edited + // + if (!getEditingDomain().getResourceSet().getResources().isEmpty()) { + // Create a page for the selection tree view. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), JdtmmEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + Tree tree = new Tree(composite, SWT.MULTI); + TreeViewer newTreeViewer = new TreeViewer(tree); + return newTreeViewer; + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + selectionViewer = (TreeViewer) viewerPane.getViewer(); + selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + + selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + selectionViewer.setInput(editingDomain.getResourceSet()); + selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); + viewerPane.setTitle(editingDomain.getResourceSet()); + + new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); + + createContextMenuFor(selectionViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_SelectionPage_label")); + } + + // Create a page for the parent tree view. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), JdtmmEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + Tree tree = new Tree(composite, SWT.MULTI); + TreeViewer newTreeViewer = new TreeViewer(tree); + return newTreeViewer; + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + parentViewer = (TreeViewer) viewerPane.getViewer(); + parentViewer.setAutoExpandLevel(30); + parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory)); + parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(parentViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_ParentPage_label")); + } + + // This is the page for the list viewer + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), JdtmmEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new ListViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + listViewer = (ListViewer) viewerPane.getViewer(); + listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(listViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_ListPage_label")); + } + + // This is the page for the tree viewer + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), JdtmmEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TreeViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + treeViewer = (TreeViewer) viewerPane.getViewer(); + treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory); + + createContextMenuFor(treeViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TreePage_label")); + } + + // This is the page for the table viewer. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), JdtmmEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TableViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + tableViewer = (TableViewer) viewerPane.getViewer(); + + Table table = tableViewer.getTable(); + TableLayout layout = new TableLayout(); + table.setLayout(layout); + table.setHeaderVisible(true); + table.setLinesVisible(true); + + TableColumn objectColumn = new TableColumn(table, SWT.NONE); + layout.addColumnData(new ColumnWeightData(3, 100, true)); + objectColumn.setText(getString("_UI_ObjectColumn_label")); + objectColumn.setResizable(true); + + TableColumn selfColumn = new TableColumn(table, SWT.NONE); + layout.addColumnData(new ColumnWeightData(2, 100, true)); + selfColumn.setText(getString("_UI_SelfColumn_label")); + selfColumn.setResizable(true); + + tableViewer.setColumnProperties(new String[] { "a", "b" }); + tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(tableViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TablePage_label")); + } + + // This is the page for the table tree viewer. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), JdtmmEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TreeViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + treeViewerWithColumns = (TreeViewer) viewerPane.getViewer(); + + Tree tree = treeViewerWithColumns.getTree(); + tree.setLayoutData(new FillLayout()); + tree.setHeaderVisible(true); + tree.setLinesVisible(true); + + TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE); + objectColumn.setText(getString("_UI_ObjectColumn_label")); + objectColumn.setResizable(true); + objectColumn.setWidth(250); + + TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE); + selfColumn.setText(getString("_UI_SelfColumn_label")); + selfColumn.setResizable(true); + selfColumn.setWidth(200); + + treeViewerWithColumns.setColumnProperties(new String[] { "a", "b" }); + treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(treeViewerWithColumns); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); + } + + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + setActivePage(0); + } + }); + } + + // Ensures that this editor will only display the page's tab + // area if there are more than one page + // + getContainer().addControlListener + (new ControlAdapter() { + boolean guard = false; + + @Override + public void controlResized(ControlEvent event) { + if (!guard) { + guard = true; + hideTabs(); + guard = false; + } + } + }); + + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + updateProblemIndication(); + } + }); + } + + /** + * If there is just one page in the multi-page editor part, + * this hides the single tab at the bottom. + * + * + * + * @generated + */ + protected void hideTabs() { + if (getPageCount() <= 1) { + setPageText(0, ""); + if (getContainer() instanceof CTabFolder) { + ((CTabFolder) getContainer()).setTabHeight(1); + Point point = getContainer().getSize(); + getContainer().setSize(point.x, point.y + 6); + } + } + } + + /** + * If there is more than one page in the multi-page editor part, + * this shows the tabs at the bottom. + * + * + * + * @generated + */ + protected void showTabs() { + if (getPageCount() > 1) { + setPageText(0, getString("_UI_SelectionPage_label")); + if (getContainer() instanceof CTabFolder) { + ((CTabFolder) getContainer()).setTabHeight(SWT.DEFAULT); + Point point = getContainer().getSize(); + getContainer().setSize(point.x, point.y - 6); + } + } + } + + /** + * This is used to track the active viewer. + * + * + * + * @generated + */ + @Override + protected void pageChange(int pageIndex) { + super.pageChange(pageIndex); + + if (contentOutlinePage != null) { + handleContentOutlineSelection(contentOutlinePage.getSelection()); + } + } + + /** + * This is how the framework determines which interfaces we implement. + * + * + * + * @generated + */ + @SuppressWarnings("rawtypes") + @Override + public Object getAdapter(Class key) { + if (key.equals(IContentOutlinePage.class)) { + return showOutlineView() ? getContentOutlinePage() : null; + } + else if (key.equals(IPropertySheetPage.class)) { + return getPropertySheetPage(); + } + else if (key.equals(IGotoMarker.class)) { + return this; + } + else { + return super.getAdapter(key); + } + } + + /** + * This accesses a cached version of the content outliner. + * + * + * + * @generated + */ + public IContentOutlinePage getContentOutlinePage() { + if (contentOutlinePage == null) { + // The content outline is just a tree. + // + class MyContentOutlinePage extends ContentOutlinePage { + @Override + public void createControl(Composite parent) { + super.createControl(parent); + contentOutlineViewer = getTreeViewer(); + contentOutlineViewer.addSelectionChangedListener(this); + + // Set up the tree viewer. + // + contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + contentOutlineViewer.setInput(editingDomain.getResourceSet()); + + // Make sure our popups work. + // + createContextMenuFor(contentOutlineViewer); + + if (!editingDomain.getResourceSet().getResources().isEmpty()) { + // Select the root object in the view. + // + contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); + } + } + + @Override + public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { + super.makeContributions(menuManager, toolBarManager, statusLineManager); + contentOutlineStatusLineManager = statusLineManager; + } + + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + } + + contentOutlinePage = new MyContentOutlinePage(); + + // Listen to selection so that we can handle it is a special way. + // + contentOutlinePage.addSelectionChangedListener + (new ISelectionChangedListener() { + // This ensures that we handle selections correctly. + // + @Override + public void selectionChanged(SelectionChangedEvent event) { + handleContentOutlineSelection(event.getSelection()); + } + }); + } + + return contentOutlinePage; + } + + /** + * This accesses a cached version of the property sheet. + * + * + * + * @generated + */ + public IPropertySheetPage getPropertySheetPage() { + if (propertySheetPage == null) { + propertySheetPage = + new ExtendedPropertySheetPage(editingDomain) { + @Override + public void setSelectionToViewer(List selection) { + JdtmmEditor.this.setSelectionToViewer(selection); + JdtmmEditor.this.setFocus(); + } + + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + }; + propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); + } + + return propertySheetPage; + } + + /** + * This deals with how we want selection in the outliner to affect the other views. + * + * + * + * @generated + */ + public void handleContentOutlineSelection(ISelection selection) { + if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) { + Iterator selectedElements = ((IStructuredSelection) selection).iterator(); + if (selectedElements.hasNext()) { + // Get the first selected element. + // + Object selectedElement = selectedElements.next(); + + // If it's the selection viewer, then we want it to select the same selection as this selection. + // + if (currentViewerPane.getViewer() == selectionViewer) { + ArrayList selectionList = new ArrayList(); + selectionList.add(selectedElement); + while (selectedElements.hasNext()) { + selectionList.add(selectedElements.next()); + } + + // Set the selection to the widget. + // + selectionViewer.setSelection(new StructuredSelection(selectionList)); + } + else { + // Set the input to the widget. + // + if (currentViewerPane.getViewer().getInput() != selectedElement) { + currentViewerPane.getViewer().setInput(selectedElement); + currentViewerPane.setTitle(selectedElement); + } + } + } + } + } + + /** + * This is for implementing {@link IEditorPart} and simply tests the command stack. + * + * + * + * @generated + */ + @Override + public boolean isDirty() { + return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded(); + } + + /** + * This is for implementing {@link IEditorPart} and simply saves the model file. + * + * + * + * @generated + */ + @Override + public void doSave(IProgressMonitor progressMonitor) { + // Save only resources that have actually changed. + // + final Map saveOptions = new HashMap(); + saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); + + // Do the work within an operation because this is a long running activity that modifies the workbench. + // + WorkspaceModifyOperation operation = + new WorkspaceModifyOperation() { + // This is the method that gets invoked when the operation runs. + // + @Override + public void execute(IProgressMonitor monitor) { + // Save the resources to the file system. + // + boolean first = true; + for (Resource resource : editingDomain.getResourceSet().getResources()) { + if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) { + try { + long timeStamp = resource.getTimeStamp(); + resource.save(saveOptions); + if (resource.getTimeStamp() != timeStamp) { + savedResources.add(resource); + } + } + catch (Exception exception) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + first = false; + } + } + } + }; + + updateProblemIndication = false; + try { + // This runs the options, and shows progress. + // + new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation); + + // Refresh the necessary state. + // + ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone(); + firePropertyChange(IEditorPart.PROP_DIRTY); + } catch (Exception exception) { + // Something went wrong that shouldn't. + // + JdtmmEditorPlugin.INSTANCE.log(exception); + } + updateProblemIndication = true; + updateProblemIndication(); + } + + /** + * This returns whether something has been persisted to the URI of the specified resource. + * The implementation uses the URI converter from the editor's resource set to try to open an input stream. + * + * + * + * @generated + */ + protected boolean isPersisted(Resource resource) { + boolean result = false; + try { + InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI()); + if (stream != null) { + result = true; + stream.close(); + } + } catch (IOException e) { + // Ignore + } + return result; + } + + /** + * This always returns true because it is not currently supported. + * + * + * + * @generated + */ + @Override + public boolean isSaveAsAllowed() { + return true; + } + + /** + * This also changes the editor's input. + * + * + * + * @generated + */ + @Override + public void doSaveAs() { + SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); + saveAsDialog.open(); + IPath path = saveAsDialog.getResult(); + if (path != null) { + IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); + if (file != null) { + doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); + } + } + } + + /** + * + * + * + * @generated + */ + protected void doSaveAs(URI uri, IEditorInput editorInput) { + (editingDomain.getResourceSet().getResources().get(0)).setURI(uri); + setInputWithNotify(editorInput); + setPartName(editorInput.getName()); + IProgressMonitor progressMonitor = + getActionBars().getStatusLineManager() != null ? + getActionBars().getStatusLineManager().getProgressMonitor() : + new NullProgressMonitor(); + doSave(progressMonitor); + } + + /** + * + * + * + * @generated + */ + @Override + public void gotoMarker(IMarker marker) { + try { + if (marker.getType().equals(EValidator.MARKER)) { + String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null); + if (uriAttribute != null) { + URI uri = URI.createURI(uriAttribute); + EObject eObject = editingDomain.getResourceSet().getEObject(uri, true); + if (eObject != null) { + setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject))); + } + } + } + } catch (CoreException exception) { + JdtmmEditorPlugin.INSTANCE.log(exception); + } + } + + /** + * This is called during startup. + * + * + * + * @generated + */ + @Override + public void init(IEditorSite site, IEditorInput editorInput) { + setSite(site); + setInputWithNotify(editorInput); + setPartName(editorInput.getName()); + site.setSelectionProvider(this); + site.getPage().addPartListener(partListener); + ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE); + } + + /** + * + * + * + * @generated + */ + @Override + public void setFocus() { + if (currentViewerPane != null) { + currentViewerPane.setFocus(); + } + else { + getControl(getActivePage()).setFocus(); + } + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * + * @generated + */ + @Override + public void addSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.add(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * + * @generated + */ + @Override + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.remove(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. + * + * + * + * @generated + */ + @Override + public ISelection getSelection() { + return editorSelection; + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection. + * Calling this result will notify the listeners. + * + * + * + * @generated + */ + @Override + public void setSelection(ISelection selection) { + editorSelection = selection; + + for (ISelectionChangedListener listener : selectionChangedListeners) { + listener.selectionChanged(new SelectionChangedEvent(this, selection)); + } + setStatusLineManager(selection); + } + + /** + * + * + * + * @generated + */ + public void setStatusLineManager(ISelection selection) { + IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? + contentOutlineStatusLineManager : getActionBars().getStatusLineManager(); + + if (statusLineManager != null) { + if (selection instanceof IStructuredSelection) { + Collection collection = ((IStructuredSelection) selection).toList(); + switch (collection.size()) { + case 0: { + statusLineManager.setMessage(getString("_UI_NoObjectSelected")); + break; + } + case 1: { + String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next()); + statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); + break; + } + default: { + statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); + break; + } + } + } + else { + statusLineManager.setMessage(""); + } + } + } + + /** + * This looks up a string in the plugin's plugin.properties file. + * + * + * + * @generated + */ + private static String getString(String key) { + return JdtmmEditorPlugin.INSTANCE.getString(key); + } + + /** + * This looks up a string in plugin.properties, making a substitution. + * + * + * + * @generated + */ + private static String getString(String key, Object s1) { + return JdtmmEditorPlugin.INSTANCE.getString(key, new Object[] { s1 }); + } + + /** + * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu. + * + * + * + * @generated + */ + @Override + public void menuAboutToShow(IMenuManager menuManager) { + ((IMenuListener) getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); + } + + /** + * + * + * + * @generated + */ + public EditingDomainActionBarContributor getActionBarContributor() { + return (EditingDomainActionBarContributor) getEditorSite().getActionBarContributor(); + } + + /** + * + * + * + * @generated + */ + public IActionBars getActionBars() { + return getActionBarContributor().getActionBars(); + } + + /** + * + * + * + * @generated + */ + public AdapterFactory getAdapterFactory() { + return adapterFactory; + } + + /** + * + * + * + * @generated + */ + @Override + public void dispose() { + updateProblemIndication = false; + + ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); + + getSite().getPage().removePartListener(partListener); + + adapterFactory.dispose(); + + if (getActionBarContributor().getActiveEditor() == this) { + getActionBarContributor().setActiveEditor(null); + } + + if (propertySheetPage != null) { + propertySheetPage.dispose(); + } + + if (contentOutlinePage != null) { + contentOutlinePage.dispose(); + } + + super.dispose(); + } + + /** + * Returns whether the outline view should be presented to the user. + * + * + * + * @generated + */ + protected boolean showOutlineView() { + return true; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditorPlugin.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditorPlugin.java new file mode 100644 index 00000000000..399c138dfb8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmEditorPlugin.java @@ -0,0 +1,116 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.presentation; + +import org.eclipse.emf.common.EMFPlugin; +import org.eclipse.emf.common.ui.EclipseUIPlugin; +import org.eclipse.emf.common.util.ResourceLocator; + +/** + * This is the central singleton for the Jdtmm editor plugin. + * + * + * + * @generated + */ +public final class JdtmmEditorPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * + * @generated + */ + public static final JdtmmEditorPlugin INSTANCE = new JdtmmEditorPlugin(); + + /** + * Keep track of the singleton. + * + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * + * @generated + */ + public JdtmmEditorPlugin() { + super(new ResourceLocator[] { + }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * + * @generated + */ + public static class Implementation extends EclipseUIPlugin { + /** + * Creates an instance. + * + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmModelWizard.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmModelWizard.java new file mode 100644 index 00000000000..3b0642514e6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/presentation/JdtmmModelWizard.java @@ -0,0 +1,656 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.presentation; + + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.MissingResourceException; +import java.util.StringTokenizer; + +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.emf.common.CommonPlugin; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.provider.JdtmmEditPlugin; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.INewWizard; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.actions.WorkspaceModifyOperation; +import org.eclipse.ui.dialogs.WizardNewFileCreationPage; +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.ISetSelectionTarget; + + +/** + * This is a simple wizard for creating a new model file. + * + * + * + * @generated + */ +public class JdtmmModelWizard extends Wizard implements INewWizard { + /** + * The supported extensions for created files. + * + * + * + * @generated + */ + public static final List FILE_EXTENSIONS = + Collections.unmodifiableList(Arrays.asList(JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmEditorFilenameExtensions").split("\\s*,\\s*"))); + + /** + * A formatted list of supported file extensions, suitable for display. + * + * + * + * @generated + */ + public static final String FORMATTED_FILE_EXTENSIONS = + JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); + + /** + * This caches an instance of the model package. + * + * + * + * @generated + */ + protected JdtmmPackage jdtmmPackage = JdtmmPackage.eINSTANCE; + + /** + * This caches an instance of the model factory. + * + * + * + * @generated + */ + protected JdtmmFactory jdtmmFactory = jdtmmPackage.getJdtmmFactory(); + + /** + * This is the file creation page. + * + * + * + * @generated + */ + protected JdtmmModelWizardNewFileCreationPage newFileCreationPage; + + /** + * This is the initial object creation page. + * + * + * + * @generated + */ + protected JdtmmModelWizardInitialObjectCreationPage initialObjectCreationPage; + + /** + * Remember the selection during initialization for populating the default container. + * + * + * + * @generated + */ + protected IStructuredSelection selection; + + /** + * Remember the workbench during initialization. + * + * + * + * @generated + */ + protected IWorkbench workbench; + + /** + * Caches the names of the types that can be created as the root object. + * + * + * + * @generated + */ + protected List initialObjectNames; + + /** + * This just records the information. + * + * + * + * @generated + */ + @Override + public void init(IWorkbench workbench, IStructuredSelection selection) { + this.workbench = workbench; + this.selection = selection; + setWindowTitle(JdtmmEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(JdtmmEditorPlugin.INSTANCE.getImage("full/wizban/NewJdtmm"))); + } + + /** + * Returns the names of the types that can be created as the root object. + * + * + * + * @generated + */ + protected Collection getInitialObjectNames() { + if (initialObjectNames == null) { + initialObjectNames = new ArrayList(); + for (EClassifier eClassifier : jdtmmPackage.getEClassifiers()) { + if (eClassifier instanceof EClass) { + EClass eClass = (EClass) eClassifier; + if (!eClass.isAbstract()) { + initialObjectNames.add(eClass.getName()); + } + } + } + Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator()); + } + return initialObjectNames; + } + + /** + * Create a new model. + * + * + * + * @generated + */ + protected EObject createInitialModel() { + EClass eClass = (EClass) jdtmmPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); + EObject rootObject = jdtmmFactory.create(eClass); + return rootObject; + } + + /** + * Do the work after everything is specified. + * + * + * + * @generated + */ + @Override + public boolean performFinish() { + try { + // Remember the file. + // + final IFile modelFile = getModelFile(); + + // Do the work within an operation. + // + WorkspaceModifyOperation operation = + new WorkspaceModifyOperation() { + @Override + protected void execute(IProgressMonitor progressMonitor) { + try { + // Create a resource set + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Get the URI of the model file. + // + URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true); + + // Create a resource for this file. + // + Resource resource = resourceSet.createResource(fileURI); + + // Add the initial model object to the contents. + // + EObject rootObject = createInitialModel(); + if (rootObject != null) { + resource.getContents().add(rootObject); + } + + // Save the contents of the resource to the file system. + // + Map options = new HashMap(); + options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding()); + resource.save(options); + } + catch (Exception exception) { + JdtmmEditorPlugin.INSTANCE.log(exception); + } + finally { + progressMonitor.done(); + } + } + }; + + getContainer().run(false, false, operation); + + // Select the new file resource in the current view. + // + IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); + IWorkbenchPage page = workbenchWindow.getActivePage(); + final IWorkbenchPart activePart = page.getActivePart(); + if (activePart instanceof ISetSelectionTarget) { + final ISelection targetSelection = new StructuredSelection(modelFile); + getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + ((ISetSelectionTarget) activePart).selectReveal(targetSelection); + } + }); + } + + // Open an editor on the new file. + // + try { + page.openEditor + (new FileEditorInput(modelFile), + workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId()); + } catch (PartInitException exception) { + MessageDialog.openError(workbenchWindow.getShell(), JdtmmEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); + return false; + } + + return true; + } catch (Exception exception) { + JdtmmEditorPlugin.INSTANCE.log(exception); + return false; + } + } + + /** + * This is the one page of the wizard. + * + * + * + * @generated + */ + public class JdtmmModelWizardNewFileCreationPage extends WizardNewFileCreationPage { + /** + * Pass in the selection. + * + * + * + * @generated + */ + public JdtmmModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) { + super(pageId, selection); + } + + /** + * The framework calls this to see if the file is correct. + * + * + * + * @generated + */ + @Override + protected boolean validatePage() { + if (super.validatePage()) { + String extension = new Path(getFileName()).getFileExtension(); + if (extension == null || !FILE_EXTENSIONS.contains(extension)) { + String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; + setErrorMessage(JdtmmEditorPlugin.INSTANCE.getString(key, new Object[] { FORMATTED_FILE_EXTENSIONS })); + return false; + } + return true; + } + return false; + } + + /** + * + * + * + * @generated + */ + public IFile getModelFile() { + return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName())); + } + } + + /** + * This is the page where the type of object to create is selected. + * + * + * + * @generated + */ + public class JdtmmModelWizardInitialObjectCreationPage extends WizardPage { + /** + * + * + * + * @generated + */ + protected Combo initialObjectField; + + /** + * @generated + * + * + */ + protected List encodings; + + /** + * + * + * + * @generated + */ + protected Combo encodingField; + + /** + * Pass in the selection. + * + * + * + * @generated + */ + public JdtmmModelWizardInitialObjectCreationPage(String pageId) { + super(pageId); + } + + /** + * + * + * + * @generated + */ + @Override + public void createControl(Composite parent) { + Composite composite = new Composite(parent, SWT.NONE); + { + GridLayout layout = new GridLayout(); + layout.numColumns = 1; + layout.verticalSpacing = 12; + composite.setLayout(layout); + + GridData data = new GridData(); + data.verticalAlignment = GridData.FILL; + data.grabExcessVerticalSpace = true; + data.horizontalAlignment = GridData.FILL; + composite.setLayoutData(data); + } + + Label containerLabel = new Label(composite, SWT.LEFT); + { + containerLabel.setText(JdtmmEditorPlugin.INSTANCE.getString("_UI_ModelObject")); + + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + containerLabel.setLayoutData(data); + } + + initialObjectField = new Combo(composite, SWT.BORDER); + { + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + data.grabExcessHorizontalSpace = true; + initialObjectField.setLayoutData(data); + } + + for (String objectName : getInitialObjectNames()) { + initialObjectField.add(getLabel(objectName)); + } + + if (initialObjectField.getItemCount() == 1) { + initialObjectField.select(0); + } + initialObjectField.addModifyListener(validator); + + Label encodingLabel = new Label(composite, SWT.LEFT); + { + encodingLabel.setText(JdtmmEditorPlugin.INSTANCE.getString("_UI_XMLEncoding")); + + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + encodingLabel.setLayoutData(data); + } + encodingField = new Combo(composite, SWT.BORDER); + { + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + data.grabExcessHorizontalSpace = true; + encodingField.setLayoutData(data); + } + + for (String encoding : getEncodings()) { + encodingField.add(encoding); + } + + encodingField.select(0); + encodingField.addModifyListener(validator); + + setPageComplete(validatePage()); + setControl(composite); + } + + /** + * + * + * + * @generated + */ + protected ModifyListener validator = + new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + setPageComplete(validatePage()); + } + }; + + /** + * + * + * + * @generated + */ + protected boolean validatePage() { + return getInitialObjectName() != null && getEncodings().contains(encodingField.getText()); + } + + /** + * + * + * + * @generated + */ + @Override + public void setVisible(boolean visible) { + super.setVisible(visible); + if (visible) { + if (initialObjectField.getItemCount() == 1) { + initialObjectField.clearSelection(); + encodingField.setFocus(); + } + else { + encodingField.clearSelection(); + initialObjectField.setFocus(); + } + } + } + + /** + * + * + * + * @generated + */ + public String getInitialObjectName() { + String label = initialObjectField.getText(); + + for (String name : getInitialObjectNames()) { + if (getLabel(name).equals(label)) { + return name; + } + } + return null; + } + + /** + * + * + * + * @generated + */ + public String getEncoding() { + return encodingField.getText(); + } + + /** + * Returns the label for the specified type name. + * + * + * + * @generated + */ + protected String getLabel(String typeName) { + try { + return JdtmmEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); + } catch (MissingResourceException mre) { + JdtmmEditorPlugin.INSTANCE.log(mre); + } + return typeName; + } + + /** + * + * + * + * @generated + */ + protected Collection getEncodings() { + if (encodings == null) { + encodings = new ArrayList(); + for (StringTokenizer stringTokenizer = new StringTokenizer(JdtmmEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens();) { + encodings.add(stringTokenizer.nextToken()); + } + } + return encodings; + } + } + + /** + * The framework calls this to create the contents of the wizard. + * + * + * + * @generated + */ + @Override + public void addPages() { + // Create a page, set the title, and the initial model file name. + // + newFileCreationPage = new JdtmmModelWizardNewFileCreationPage("Whatever", selection); + newFileCreationPage.setTitle(JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmModelWizard_label")); + newFileCreationPage.setDescription(JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmModelWizard_description")); + newFileCreationPage.setFileName(JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0)); + addPage(newFileCreationPage); + + // Try and get the resource selection to determine a current directory for the file dialog. + // + if (selection != null && !selection.isEmpty()) { + // Get the resource... + // + Object selectedElement = selection.iterator().next(); + if (selectedElement instanceof IResource) { + // Get the resource parent, if its a file. + // + IResource selectedResource = (IResource) selectedElement; + if (selectedResource.getType() == IResource.FILE) { + selectedResource = selectedResource.getParent(); + } + + // This gives us a directory... + // + if (selectedResource instanceof IFolder || selectedResource instanceof IProject) { + // Set this for the container. + // + newFileCreationPage.setContainerFullPath(selectedResource.getFullPath()); + + // Make up a unique new name here. + // + String defaultModelBaseFilename = JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmEditorFilenameDefaultBase"); + String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0); + String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; + for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) { + modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; + } + newFileCreationPage.setFileName(modelFilename); + } + } + } + initialObjectCreationPage = new JdtmmModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage.setTitle(JdtmmEditorPlugin.INSTANCE.getString("_UI_JdtmmModelWizard_label")); + initialObjectCreationPage.setDescription(JdtmmEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description")); + addPage(initialObjectCreationPage); + } + + /** + * Get the file from the page. + * + * + * + * @generated + */ + public IFile getModelFile() { + return newFileCreationPage.getModelFile(); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.classpath b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.project b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.project new file mode 100644 index 00000000000..6da221b42e4 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.java.generator.metamodel.jdt + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..09af16320e6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.uml2.common;bundle-version="1.5.0", + org.eclipse.jdt.core;bundle-version="3.6.0", + org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport, + org.eclipse.uml2.types;visibility:=reexport +Export-Package: org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm, + org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl, + org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.util, + org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm, + org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl, + org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util, + org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.java.generator.metamodel.jdt;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/about.html b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/build.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/build.properties new file mode 100644 index 00000000000..90dc876dc50 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/build.properties @@ -0,0 +1,16 @@ + +# +# +# +# $Id$ + +bin.includes = .,\ + model/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties,\ + about.html +jars.compile.order = . +source.. = src/ +output.. = bin/ +src.includes = about.html diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.di b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.di new file mode 100644 index 00000000000..bf9abab340f --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.di @@ -0,0 +1,2 @@ + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.ecore b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.ecore new file mode 100644 index 00000000000..94f441e8179 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.ecore @@ -0,0 +1,12 @@ + + + +
    + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.genmodel b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.genmodel new file mode 100644 index 00000000000..185bb8cd48b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.genmodel @@ -0,0 +1,40 @@ + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + generatoroptionsmm.uml + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.notation b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.notation new file mode 100644 index 00000000000..b9668edc339 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.notation @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.uml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.uml new file mode 100644 index 00000000000..984402e4517 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/generatorOptions/generatoroptionsmm.uml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.di b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.di new file mode 100644 index 00000000000..2ad562c2abc --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.di @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.ecore b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.ecore new file mode 100644 index 00000000000..8d8c40c7c1b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.ecore @@ -0,0 +1,243 @@ + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.genmodel b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.genmodel new file mode 100644 index 00000000000..5661529e011 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.genmodel @@ -0,0 +1,191 @@ + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + jdtmm.uml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.notation b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.notation new file mode 100644 index 00000000000..a43c9740861 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.notation @@ -0,0 +1,3094 @@ + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + +
    +
    +
    +
    +
    + + + + + + + +
    + + +
    + + +
    + + +
    +
    +
    +
    +
    + + + + + + + +
    + + +
    + + +
    + + +
    +
    +
    +
    +
    + + + + + + + +
    + + +
    + + +
    + + +
    +
    +
    +
    +
    + + + + + + + +
    + + +
    + + +
    + + +
    +
    +
    +
    +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.uml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.uml new file mode 100644 index 00000000000..30b14aa8114 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/jdtmm.uml @@ -0,0 +1,481 @@ + + + + + Can have different type of body: opaque, expr (not yet implemented, ...) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This class is not part of JDT. It is added as a convenience to simplify the double inheritance from +JDTParent and JDTJavaElement + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.di b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.di new file mode 100644 index 00000000000..9084770dd56 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.di @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.notation b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.notation new file mode 100644 index 00000000000..73830701e82 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.notation @@ -0,0 +1,1614 @@ + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.uml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.uml new file mode 100644 index 00000000000..0421e23299d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/model/reverse/reverseJDT.uml @@ -0,0 +1,20911 @@ + + + + + + + + + + + + * Utility class to decode or create a binding key. + * <p> + * This class is not intended to be subclassed by clients. + * </p> + * + * @see org.eclipse.jdt.core.dom.IBinding#getKey() + * @since 3.1 + + + + + + + * Creates a new array type binding key from the given type binding key and the given array dimension. + * <p> + * For example: + * <pre> + * <code> + * createArrayTypeBindingKey("Ljava/lang/Object;", 1) -> "[Ljava/lang/Object;" + * createArrayTypeBindingKey("I", 2) -> "[[I" + * </code> + * </pre> + * </p> + * + * @param typeKey the binding key of the given type + * @param arrayDimension the given array dimension + * @return a new array type binding key + + + + + + + + + + * Creates a new parameterized type binding key from the given generic type binding key and the given argument type binding keys. + * If the argument type keys array is empty, then a raw type binding key is created. + * <p> + * For example: + * <pre> + * <code> + * createParameterizedTypeBindingKey( + * "Ljava/util/Map&lt;TK;TV;&gt;;", + * new String[] {"Ljava/lang/String;", "Ljava/lang/Object;"}) -&gt; + * "Ljava/util/Map&lt;Ljava/lang/String;Ljava/lang/Object;&gt;;" + * createParameterizedTypeBindingKey( + * "Ljava/util/List&lt;TE;&gt;;", new String[] {}) -&gt; + * "Ljava/util/List&lt;&gt;;" + * </code> + * </pre> + * </p> + * + * @param genericTypeKey the binding key of the generic type + * @param argumentTypeKeys the possibly empty list of binding keys of argument types + * @return a new parameterized type binding key + + + + + + + + + + + + + * Creates a new type binding key from the given type name. The type name must be either + * a fully qualified name, an array type name or a primitive type name. + * If the type name is fully qualified, then it is expected to be dot-based. + * Note that inner types, generic types and parameterized types are not supported. + * <p> + * For example: + * <pre> + * <code> + * createTypeBindingKey("int") -> "I" + * createTypeBindingKey("java.lang.String") -> "Ljava/lang/String;" + * createTypeBindingKey("boolean[]") -> "[Z" + * </code> + * </pre> + * </p> + * + * @param typeName the possibly qualified type name + * @return a new type binding key + + + + + + + + + * Creates a new type variable binding key from the given type variable name and the given declaring key. + * The declaring key can either be a type binding key or a method binding key. + * <p> + * For example: + * <pre> + * <code> + * createTypeVariableBindingKey("T", "Ljava/util/List&lt;TE;&gt;;") -&gt; + * "Ljava/util/List&lt;TE;&gt;;:TT;" + * createTypeVariableBindingKey("SomeTypeVariable", "Lp/X;.foo()V") -&gt; + * "Lp/X;.foo()V:TSomeTypeVariable;" + * </code> + * </pre> + * </p> + * + * @param typeVariableName the name of the given type variable + * @param declaringKey the binding key of the type or method the type variable belongs to + * @return a new type variable binding key + + + + + + + + + + * Creates a new wildcard type binding key from the given type binding key and the given wildcard kind + * (one of {@link Signature#C_STAR}, {@link Signature#C_SUPER}, or {@link Signature#C_EXTENDS}. + * If the wildcard is {@link Signature#C_STAR}, the given type binding key is ignored. + * <p> + * For example: + * <pre> + * <code> + * createWilcardTypeBindingKey(null, Signature.C_STAR) -&gt; "*" + * createWilcardTypeBindingKey("Ljava/util/List&lt;TE;&gt;;", + * Signature.C_SUPER) -&gt; "-Ljava/util/List&lt;TE;&gt;;" + * createWilcardTypeBindingKey("Ljava/util/ArrayList;", Signature.C_EXTENDS) -&gt; + * "+Ljava/util/ArrayList;" + * </code> + * </pre> + * </p> + * + * @param typeKey the binding key of the given type + * @param kind one of {@link Signature#C_STAR}, {@link Signature#C_SUPER}, or {@link Signature#C_EXTENDS} + * @return a new wildcard type binding key + * @deprecated This method is missing crucial information necessary for proper wildcard binding key creation. + * @see org.eclipse.jdt.core.BindingKey#createWildcardTypeBindingKey(String, char, String, int) + + + + + + + + + + * Creates a new wildcard type binding key from the given generic type binding key, the given wildcard + * kind (one of {@link Signature#C_STAR}, {@link Signature#C_SUPER}, or {@link Signature#C_EXTENDS} + * the given bound type binding key and the given rank. If the wildcard kind is {@link Signature#C_STAR}, + * the given bound type binding key is ignored. + * <p> + * For example: + * <pre> + * <code> + * createWildcardTypeBindingKey("Ljava/util/ArrayList;", Signature.C_STAR, null, 0) -&gt; "Ljava/util/ArrayList;{0}*" + * createWildcardTypeBindingKey("Ljava/util/ArrayList;", Signature.C_SUPER, "Ljava/lang/String;", 0) -&gt; "Ljava/util/ArrayList;{0}-Ljava/lang/String;" + * createWildcardTypeBindingKey("Ljava/util/HashMap;", Signature.C_EXTENDS, "Ljava/lang/String;", 1) -&gt; + * "Ljava/util/HashMap;{1}+Ljava/lang/String;" + * </code> + * </pre> + * </p> + * + * @param genericTypeKey the binding key of the generic type + * @param boundKind one of {@link Signature#C_STAR}, {@link Signature#C_SUPER}, or {@link Signature#C_EXTENDS} + * @param boundTypeKey the binding key of the bounding type. + * @param rank the relative position of this wild card type in the parameterization of the generic type. + * @return a new wildcard type binding key + * @since 3.5 + + + + + + + + + + + + * Returns the thrown exception signatures of the element represented by this binding key. + * If this binding key does not represent a method or does not throw any exception, + * returns an empty array. + * + * @return the thrown exceptions signatures + * @since 3.3 + + + + + + + + + + + * Returns the type argument signatures of the element represented by this binding key. + * If this binding key doesn't represent a parameterized type or a parameterized method, + * returns an empty array. + * + * @return the type argument signatures + + + + + + + + + + + * Returns whether this binding key represents a raw type. + * + * @return whether this binding key represents a raw type + + + + + + + + * Returns whether this binding key represents a parameterized type, or if its declaring type is a parameterized type. + * + * @return whether this binding key represents a parameterized type + + + + + + + + * Returns whether this binding key represents a parameterized method, or if its declaring method is a parameterized method. + * + * @return whether this binding key represents a parameterized method + + + + + + + + * Transforms this binding key into a resolved signature. + * If this binding key represents a field, the returned signature is + * the field type's signature. + * + * @return the resolved signature for this binding key + * @see Signature + * @since 3.2 + + + + + + + + + + + + * A buffer changed event describes how a buffer has changed. These events are + * used in <code>IBufferChangedListener</code> notifications. + * <p> + * For text insertions, <code>getOffset</code> is the offset + * of the first inserted character, <code>getText</code> is the + * inserted text, and <code>getLength</code> is 0. + * </p> + * <p> + * For text removals, <code>getOffset</code> is the offset + * of the first removed character, <code>getText</code> is <code>null</code>, + * and <code>getLength</code> is the length of the text that was removed. + * </p> + * <p> + * For replacements (including <code>IBuffer.setContents</code>), + * <code>getOffset</code> is the offset + * of the first replaced character, <code>getText</code> is the replacement + * text, and <code>getLength</code> is the length of the original text + * that was replaced. + * </p> + * <p> + * When a buffer is closed, <code>getOffset</code> is 0, <code>getLength</code> + * is 0, and <code>getText</code> is <code>null</code>. + * </p> + * + * @see IBuffer + * @noextend This class is not intended to be subclassed by clients. + + + + + + + * The length of text that has been modified in the buffer. + + + + + + + * The offset into the buffer where the modification took place. + + + + + + + * The text that was modified. + + + + + + + + * Returns the buffer which has changed. + * + * @return the buffer affected by the change + + + + + + + + * Abstract base implementation of all classpath variable initializers. + * Classpath variable initializers are used in conjunction with the + * "org.eclipse.jdt.core.classpathVariableInitializer" extension point. + * <p> + * Clients should subclass this class to implement a specific classpath + * variable initializer. The subclass must have a public 0-argument + * constructor and a concrete implementation of <code>initialize</code>. + * + * @see IClasspathEntry + * @since 2.0 + + + + + + * Binds a value to the workspace classpath variable with the given name, + * or fails silently if this cannot be done. + * <p> + * A variable initializer is automatically activated whenever a variable value + * is needed and none has been recorded so far. The implementation of + * the initializer can set the corresponding variable using + * <code>JavaCore#setClasspathVariable</code>. + * + * @param variable the name of the workspace classpath variable + * that requires a binding + * + * @see JavaCore#getClasspathVariable(String) + * @see JavaCore#setClasspathVariable(String, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor) + * @see JavaCore#setClasspathVariables(String[], org.eclipse.core.runtime.IPath[], org.eclipse.core.runtime.IProgressMonitor) + + + + + + + + + * Completion context. + * + * Represent the context in which the completion occurs. + * + * @see CompletionRequestor#acceptContext(CompletionContext) + * @since 3.1 + * @noinstantiate This class is not intended to be instantiated by clients. + + + + + + * The completed token is the first token of a member declaration.<br> + * e.g. + * <pre> + * public class X { + * Foo| // completion occurs at | + * } + * </pre> + * + * @see #getTokenLocation() + * + * @since 3.4 + + + + + + + * The completed token is the first token of a statement.<br> + * e.g. + * <pre> + * public class X { + * public void bar() { + * Foo| // completion occurs at | + * } + * } + * </pre> + * + * @see #getTokenLocation() + * + * @since 3.4 + + + + + + + * The completion token is unknown. + * @since 3.2 + + + + + + + * The completion token is a name. + * @since 3.2 + + + + + + + * The completion token is a string literal. + * The string literal ends quote can be not present the source. + * <code>"foo"</code> or <code>"foo</code>. + * @since 3.2 + + + + + + + * Tell user whether completion takes place in a javadoc comment or not. + * + * @return boolean true if completion takes place in a javadoc comment, false otherwise. + * @since 3.2 + + + + + + + + * Tell user whether completion takes place in text area of a javadoc comment or not. + * + * @return boolean true if completion takes place in a text area of a javadoc comment, false otherwise. + * @since 3.2 + + + + + + + + * Tell user whether completion takes place in a formal reference of a javadoc tag or not. + * Tags with formal reference are: + * <ul> + * <li>&#64;see</li> + * <li>&#64;throws</li> + * <li>&#64;exception</li> + * <li>{&#64;link Object}</li> + * <li>{&#64;linkplain Object}</li> + * <li>{&#64;value} when compiler compliance is set at leats to 1.5</li> + * </ul> + * + * @return boolean true if completion takes place in formal reference of a javadoc tag, false otherwise. + * @since 3.2 + + + + + + + + * Returns whether this completion context is an extended context. + * Some methods of this context can be used only if this context is an extended context but an extended context consumes more memory. + * + * @return <code>true</code> if this completion context is an extended context. + * + * @since 3.4 + + + + + + + + * Return signatures of expected types of a potential completion proposal at the completion position. + * + * It's not mandatory to a completion proposal to respect this expectation. + * + * @return signatures expected types of a potential completion proposal at the completion position or + * <code>null</code> if there is no expected types. + * + * @see Signature + + + + + + + + + + + * Return keys of expected types of a potential completion proposal at the completion position. + * + * It's not mandatory to a completion proposal to respect this expectation. + * + * @return keys of expected types of a potential completion proposal at the completion position or + * <code>null</code> if there is no expected types. + * + * @see org.eclipse.jdt.core.dom.ASTParser#createASTs(ICompilationUnit[], String[], org.eclipse.jdt.core.dom.ASTRequestor, org.eclipse.core.runtime.IProgressMonitor) + + + + + + + + + + + * Returns the completed token. + * This token is either the identifier or Java language keyword + * or the string literal under, immediately preceding, + * the original request offset. If the original request offset + * is not within or immediately after an identifier or keyword or + * a string literal then the returned value is <code>null</code>. + * + * @return completed token or <code>null</code> + * @since 3.2 + + + + + + + + + + + * Returns the kind of completion token being proposed. + * <p> + * The set of different kinds of completion token is + * expected to change over time. It is strongly recommended + * that clients do <b>not</b> assume that the kind is one of the + * ones they know about, and code defensively for the + * possibility of unexpected future growth. + * </p> + * + * @return the kind; one of the kind constants declared on + * this class whose name starts with <code>TOKEN_KIND</code>, + * or possibly a kind unknown to the caller + * @since 3.2 + + + + + + + + * Returns the location of completion token being proposed. + * The returned location is a bit mask which can contain some values + * of the constants declared on this class whose name starts with <code>TL</code>, + * or possibly values unknown to the caller. + * + * <p> + * The set of different location values is expected to change over time. + * It is strongly recommended that clients do <b>not</b> assume that + * the location contains only known value, and code defensively for + * the possibility of unexpected future growth. + * </p> + * + * @return the location + * + * @since 3.4 + + + + + + + + * Returns the character index of the start of the + * subrange in the source file buffer containing the + * relevant token being completed. This + * token is either the identifier or Java language keyword + * under, or immediately preceding, the original request + * offset. If the original request offset is not within + * or immediately after an identifier or keyword, then the + * position returned is original request offset and the + * token range is empty. + * + * @return character index of token start position (inclusive) + * @since 3.2 + + + + + + + + + + + * Returns the offset position in the source file buffer + * after which code assist is requested. + * + * @return offset position in the source file buffer + * @since 3.2 + + + + + + + + * Returns the innermost enclosing Java element which contains the completion location or <code>null</code> if this element cannot be computed. + * The returned Java element and all Java elements in the same compilation unit which can be navigated to from the returned Java element are special Java elements: + * <ul> + * <li>they are based on the current content of the compilation unit's buffer, they are not the result of a reconcile operation</li> + * <li>they are not updated if the buffer changes.</li> + * <li>they do not contain local types which are not visible from the completion location.</li> + * <li>they do not give information about categories. {@link IMember#getCategories()} will return an empty array</li> + * </ul> + * + * Reasons for returning <code>null</code> include: + * <ul> + * <li>the compilation unit no longer exists</li> + * <li>the completion occurred in a binary type. However this restriction might be relaxed in the future.</li> + * </ul> + * + * @return the innermost enclosing Java element which contains the completion location or <code>null</code> if this element cannot be computed. + * + * @exception UnsupportedOperationException if the context is not an extended context + * + * @since 3.4 + + + + + + + + * Utility class for decoding additional flags in completion proposal. + * <p> + * This class provides static methods only; it is not intended to be + * instantiated or subclassed by clients. + * </p> + * + * @see CompletionProposal#getAdditionalFlags() + * + * @since 3.3 + + + + + + * Constant representing the absence of any flag + + + + + + + * Constant representing a static import + + + + + + + * Returns whether the given integer includes the {@link #StaticImport} flag. + * + * @param flags the flags + * @return <code>true</code> if the {@link #StaticImport} flag is included + + + + + + + + + + * Completion proposal. + * <p> + * In typical usage, the user working in a Java code editor issues + * a code assist command. This command results in a call to + * <code>ICodeAssist.codeComplete(position, completionRequestor)</code> + * passing the current position in the source code. The code assist + * engine analyzes the code in the buffer, determines what kind of + * Java language construct is at that position, and proposes ways + * to complete that construct. These proposals are instances of + * the class <code>CompletionProposal</code>. These proposals, + * perhaps after sorting and filtering, are presented to the user + * to make a choice. + * </p> + * <p> + * The proposal is as follows: insert + * the {@linkplain #getCompletion() completion string} into the + * source file buffer, replacing the characters between + * {@linkplain #getReplaceStart() the start} + * and {@linkplain #getReplaceEnd() end}. The string + * can be arbitrary; for example, it might include not only the + * name of a method but a set of parentheses. Moreover, the source + * range may include source positions before or after the source + * position where <code>ICodeAssist.codeComplete</code> was invoked. + * The rest of the information associated with the proposal is + * to provide context that may help a user to choose from among + * competing proposals. + * </p> + * <p> + * The completion engine creates instances of this class. + * </p> + * + * @see ICodeAssist#codeComplete(int, CompletionRequestor) + * @since 3.0 + * @noinstantiate This class is not intended to be instantiated by clients. + * @noextend This class is not intended to be subclassed by clients. + + + + + + * Completion is a declaration of an anonymous class. + * This kind of completion might occur in a context like + * <code>"new List(^;"</code> and complete it to + * <code>"new List() {}"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type being implemented or subclassed + * </li> + * <li>{@link #getDeclarationKey()} - + * the type unique key of the type being implemented or subclassed + * </li> + * <li>{@link #getSignature()} - + * the method signature of the constructor that is referenced + * </li> + * <li>{@link #getKey()} - + * the method unique key of the constructor that is referenced + * if the declaring type is not an interface + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags of the constructor that is referenced + * </li> + * </ul> + * </p> + * + * @see #getKind() + + + + + + + * Completion is a reference to a field. + * This kind of completion might occur in a context like + * <code>"this.ref^ = 0;"</code> and complete it to + * <code>"this.refcount = 0;"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags (including ACC_ENUM) of the field that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the field that is referenced + * </li> + * <li>{@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + * </li> + * </ul> + * </p> + * + * @see #getKind() + + + + + + + * Completion is a keyword. + * This kind of completion might occur in a context like + * <code>"public cl^ Foo {}"</code> and complete it to + * <code>"public class Foo {}"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getName()} - + * the keyword token + * </li> + * <li>{@link #getFlags()} - + * the corresponding modifier flags if the keyword is a modifier + * </li> + * </ul> + * </p> + * + * @see #getKind() + + + + + + + * Completion is a reference to a label. + * This kind of completion might occur in a context like + * <code>"break lo^;"</code> and complete it to + * <code>"break loop;"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getName()} - + * the simple name of the label that is referenced + * </li> + * </ul> + * </p> + * + * @see #getKind() + + + + + + + * Completion is a reference to a local variable. + * This kind of completion might occur in a context like + * <code>"ke^ = 4;"</code> and complete it to + * <code>"keys = 4;"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getFlags()} - + * the modifiers flags of the local variable that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the local variable that is referenced + * </li> + * <li>{@link #getSignature()} - + * the type signature of the local variable's type + * </li> + * </ul> + * </p> + * + * @see #getKind() + + + + + + + * Completion is a reference to a method. + * This kind of completion might occur in a context like + * <code>"System.out.pr^();"</code> and complete it to + * <code>""System.out.println();"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the method that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags of the method that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the method that is referenced + * </li> + * <li>{@link #getSignature()} - + * the method signature of the method that is referenced + * </li> + * </ul> + * </p> + * + * @see #getKind() + + + + + + + * Completion is a declaration of a method. + * This kind of completion might occur in a context like + * <code>"new List() {si^};"</code> and complete it to + * <code>"new List() {public int size() {} };"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the + * method that is being overridden or implemented + * </li> + * <li>{@link #getDeclarationKey()} - + * the unique of the type that declares the + * method that is being overridden or implemented + * </li> + * <li>{@link #getName()} - + * the simple name of the method that is being overridden + * or implemented + * </li> + * <li>{@link #getSignature()} - + * the method signature of the method that is being + * overridden or implemented + * </li> + * <li>{@link #getKey()} - + * the method unique key of the method that is being + * overridden or implemented + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags of the method that is being + * overridden or implemented + * </li> + * </ul> + * </p> + * + * @see #getKind() + + + + + + + * Completion is a reference to a package. + * This kind of completion might occur in a context like + * <code>"import java.u^.*;"</code> and complete it to + * <code>"import java.util.*;"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the dot-based package name of the package that is referenced + * </li> + * </ul> + * </p> + * + * @see #getKind() + + + + + + + * Completion is a reference to a type. Any kind of type + * is allowed, including primitive types, reference types, + * array types, parameterized types, and type variables. + * This kind of completion might occur in a context like + * <code>"public static Str^ key;"</code> and complete it to + * <code>"public static String key;"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the dot-based package name of the package that contains + * the type that is referenced + * </li> + * <li>{@link #getSignature()} - + * the type signature of the type that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags (including Flags.AccInterface, AccEnum, + * and AccAnnotation) of the type that is referenced + * </li> + * </ul> + * </p> + * + * @see #getKind() + + + + + + + * Completion is a declaration of a variable (locals, parameters, + * fields, etc.). + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getName()} - + * the simple name of the variable being declared + * </li> + * <li>{@link #getSignature()} - + * the type signature of the type of the variable + * being declared + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags of the variable being declared + * </li> + * </ul> + * </p> + * @see #getKind() + + + + + + + * Completion is a declaration of a new potential method. + * This kind of completion might occur in a context like + * <code>"new List() {si^};"</code> and complete it to + * <code>"new List() {public int si() {} };"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the + * method that is being created + * </li> + * <li>{@link #getName()} - + * the simple name of the method that is being created + * </li> + * <li>{@link #getSignature()} - + * the method signature of the method that is being + * created + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags of the method that is being + * created + * </li> + * </ul> + * </p> + * + * @see #getKind() + * @since 3.1 + + + + + + + * Completion is a reference to a method name. + * This kind of completion might occur in a context like + * <code>"import p.X.fo^"</code> and complete it to + * <code>"import p.X.foo;"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the method that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags of the method that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the method that is referenced + * </li> + * <li>{@link #getSignature()} - + * the method signature of the method that is referenced + * </li> + * </ul> + * </p> + * + * @see #getKind() + * @since 3.1 + + + + + + + * Completion is a reference to annotation's attribute. + * This kind of completion might occur in a context like + * <code>"@Annot(attr^=value)"</code> and complete it to + * <code>"@Annot(attribute^=value)"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the annotation that declares the attribute that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags of the attribute that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the attribute that is referenced + * </li> + * <li>{@link #getSignature()} - + * the type signature of the attribute's type (as opposed to the + * signature of the type in which the referenced attribute + * is declared) + * </li> + * </ul> + * </p> + * + * @see #getKind() + * @since 3.1 + + + + + + + * Completion is a link reference to a field in a javadoc text. + * This kind of completion might occur in a context like + * <code>" * blabla System.o^ blabla"</code> and complete it to + * <code>" * blabla {&#64;link System#out } blabla"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags (including ACC_ENUM) of the field that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the field that is referenced + * </li> + * <li>{@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + * </li> + * </ul> + * </p> + * + * @see #getKind() + * @since 3.2 + + + + + + + * Completion is a link reference to a method in a javadoc text. + * This kind of completion might occur in a context like + * <code>" * blabla Runtime#get^ blabla"</code> and complete it to + * <code>" * blabla {&#64;link Runtime#getRuntime() }"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the method that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags of the method that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the method that is referenced + * </li> + * <li>{@link #getSignature()} - + * the method signature of the method that is referenced + * </li> + * </ul> + * </p> + * + * @see #getKind() + * @since 3.2 + + + + + + + * Completion is a link reference to a type in a javadoc text. + * Any kind of type is allowed, including primitive types, reference types, + * array types, parameterized types, and type variables. + * This kind of completion might occur in a context like + * <code>" * blabla Str^ blabla"</code> and complete it to + * <code>" * blabla {&#64;link String } blabla"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the dot-based package name of the package that contains + * the type that is referenced + * </li> + * <li>{@link #getSignature()} - + * the type signature of the type that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags (including Flags.AccInterface, AccEnum, + * and AccAnnotation) of the type that is referenced + * </li> + * </ul> + * </p> + * + * @see #getKind() + * @since 3.2 + + + + + + + * Completion is a value reference to a static field in a javadoc text. + * This kind of completion might occur in a context like + * <code>" * blabla System.o^ blabla"</code> and complete it to + * <code>" * blabla {&#64;value System#out } blabla"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags (including ACC_ENUM) of the field that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the field that is referenced + * </li> + * <li>{@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + * </li> + * </ul> + * </p> + * + * @see #getKind() + * @since 3.2 + + + + + + + * Completion is a method argument or a class/method type parameter + * in javadoc param tag. + * This kind of completion might occur in a context like + * <code>" * @param arg^ blabla"</code> and complete it to + * <code>" * @param argument blabla"</code>. + * or + * <code>" * @param &lt;T^ blabla"</code> and complete it to + * <code>" * @param &lt;TT&gt; blabla"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags (including ACC_ENUM) of the field that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the field that is referenced + * </li> + * <li>{@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + * </li> + * </ul> + * </p> + * + * @see #getKind() + * @since 3.2 + + + + + + + * Completion is a javadoc block tag. + * This kind of completion might occur in a context like + * <code>" * @s^ blabla"</code> and complete it to + * <code>" * @see blabla"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags (including ACC_ENUM) of the field that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the field that is referenced + * </li> + * <li>{@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + * </li> + * </ul> + * </p> + * + * @see #getKind() + * @since 3.2 + + + + + + + * Completion is a javadoc inline tag. + * This kind of completion might occur in a context like + * <code>" * Insert @l^ Object"</code> and complete it to + * <code>" * Insert {&#64;link Object }"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags (including ACC_ENUM) of the field that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the field that is referenced + * </li> + * <li>{@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + * </li> + * </ul> + * </p> + * + * @see #getKind() + * @since 3.2 + + + + + + + * Completion is an import of reference to a static field. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is imported + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags (including ACC_ENUM) of the field that is imported + * </li> + * <li>{@link #getName()} - + * the simple name of the field that is imported + * </li> + * <li>{@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + * </li> + * <li>{@link #getAdditionalFlags()} - + * the completion flags (including ComletionFlags.StaticImport) + * of the proposed import + * </li> + * </ul> + * </p> + * + * @see #getKind() + * + * @since 3.3 + + + + + + + * Completion is an import of reference to a static method. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the method that is imported + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags of the method that is imported + * </li> + * <li>{@link #getName()} - + * the simple name of the method that is imported + * </li> + * <li>{@link #getSignature()} - + * the method signature of the method that is imported + * </li> + * <li>{@link #getAdditionalFlags()} - + * the completion flags (including ComletionFlags.StaticImport) + * of the proposed import + * </li> + * </ul> + * </p> + * + * @see #getKind() + * + * @since 3.3 + + + + + + + * Completion is an import of reference to a type. + * Only reference to reference types are allowed. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the dot-based package name of the package that contains + * the type that is imported + * </li> + * <li>{@link #getSignature()} - + * the type signature of the type that is imported + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags (including Flags.AccInterface, AccEnum, + * and AccAnnotation) of the type that is imported + * </li> + * <li>{@link #getAdditionalFlags()} - + * the completion flags (including ComletionFlags.StaticImport) + * of the proposed import + * </li> + * </ul> + * </p> + * + * @see #getKind() + * + * @since 3.3 + + + + + + + * Completion is a reference to a method with a casted receiver. + * This kind of completion might occur in a context like + * <code>"receiver.fo^();"</code> and complete it to + * <code>""((X)receiver).foo();"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the method that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags of the method that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the method that is referenced + * </li> + * <li>{@link #getReceiverSignature()} - + * the type signature of the receiver type. It's the type of the cast expression. + * </li> + * <li>{@link #getSignature()} - + * the method signature of the method that is referenced + * </li> + * </ul> + * </p> + * + * @see #getKind() + * + * @since 3.4 + + + + + + + * Completion is a reference to a field with a casted receiver. + * This kind of completion might occur in a context like + * <code>"recevier.ref^ = 0;"</code> and complete it to + * <code>"((X)receiver).refcount = 0;"</code>. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the field that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags (including ACC_ENUM) of the field that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the field that is referenced + * </li> + * <li>{@link #getReceiverSignature()} - + * the type signature of the receiver type. It's the type of the cast expression. + * </li> + * <li>{@link #getSignature()} - + * the type signature of the field's type (as opposed to the + * signature of the type in which the referenced field + * is declared) + * </li> + * + * </ul> + * </p> + * + * @see #getKind() + * + * @since 3.4 + + + + + + + * Completion is a reference to a constructor. + * This kind of completion might occur in a context like + * <code>"new Lis"</code> and complete it to + * <code>"new List();"</code> if List is a class that is not abstract. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type that declares the constructor that is referenced + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags of the constructor that is referenced + * </li> + * <li>{@link #getName()} - + * the simple name of the constructor that is referenced + * </li> + * <li>{@link #getSignature()} - + * the method signature of the constructor that is referenced + * </li> + * </ul> + * </p> + * <p> + * This kind of proposal could require a long computation, so they are computed only if completion operation is called with a {@link IProgressMonitor} + * (e.g. {@link ICodeAssist#codeComplete(int, CompletionRequestor, IProgressMonitor)}).<br> + * This kind of proposal is always is only proposals with a {@link #TYPE_REF} required proposal, so this kind of required proposal must be allowed: + * <code>requestor.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION, TYPE_REF, true)</code>. + * </p> + * + * @see #getKind() + * @see CompletionRequestor#setAllowsRequiredProposals(int, int, boolean) + * + * @since 3.5 + + + + + + + * Completion is a reference of a constructor of an anonymous class. + * This kind of completion might occur in a context like + * <code>"new Lis^;"</code> and complete it to + * <code>"new List() {}"</code> if List is an interface or abstract class. + * <p> + * The following additional context information is available + * for this kind of completion proposal at little extra cost: + * <ul> + * <li>{@link #getDeclarationSignature()} - + * the type signature of the type being implemented or subclassed + * </li> + * <li>{@link #getDeclarationKey()} - + * the type unique key of the type being implemented or subclassed + * </li> + * <li>{@link #getSignature()} - + * the method signature of the constructor that is referenced + * </li> + * <li>{@link #getKey()} - + * the method unique key of the constructor that is referenced + * if the declaring type is not an interface + * </li> + * <li>{@link #getFlags()} - + * the modifiers flags of the constructor that is referenced + * </li> + * </ul> + * </p> + * <p> + * This kind of proposal could require a long computation, so they are computed only if completion operation is called with a {@link IProgressMonitor} + * (e.g. {@link ICodeAssist#codeComplete(int, CompletionRequestor, IProgressMonitor)})<br> + * This kind of proposal is always is only proposals with a {@link #TYPE_REF} required proposal, so this kind of required proposal must be allowed: + * <code>requestor.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION, TYPE_REF, true)</code>. + * </p> + * + * @see #getKind() + * @see CompletionRequestor#setAllowsRequiredProposals(int, int, boolean) + * + * @since 3.5 + + + + + + + * First valid completion kind. + * + * @since 3.1 + + + + + + + * Last valid completion kind. + * + * @since 3.1 + + + + + + + * Creates a basic completion proposal. All instance + * field have plausible default values unless otherwise noted. + * <p> + * Note that the constructors for this class are internal to the + * Java model implementation. Clients cannot directly create + * CompletionProposal objects. + * </p> + * + * @param kind one of the kind constants declared on this class + * @param completionOffset original offset of code completion request + * @return a new completion proposal + + + + + + + + + + * Returns the completion flags relevant in the context, or + * <code>CompletionFlags.Default</code> if none. + * <p> + * This field is available for the following kinds of + * completion proposals: + * <ul> + * <li><code>FIELD_IMPORT</code> - completion flags + * of the attribute that is referenced. Completion flags for + * this proposal kind can only include <code>CompletionFlags.StaticImport</code></li> + * <li><code>METHOD_IMPORT</code> - completion flags + * of the attribute that is referenced. Completion flags for + * this proposal kind can only include <code>CompletionFlags.StaticImport</code></li> + * <li><code>TYPE_IMPORT</code> - completion flags + * of the attribute that is referenced. Completion flags for + * this proposal kind can only include <code>CompletionFlags.StaticImport</code></li> + * </ul> + * For other kinds of completion proposals, this method returns + * <code>CompletionFlags.Default</code>. + * </p> + * + * @return the completion flags, or + * <code>CompletionFlags.Default</code> if none + * @see CompletionFlags + * + * @since 3.3 + + + + + + + + * Sets the completion flags relevant in the context. + * <p> + * If not set, defaults to none. + * </p> + * <p> + * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + * </p> + * + * @param additionalFlags the completion flags, or + * <code>CompletionFlags.Default</code> if none + * + * @since 3.3 + + + + + + + + * Returns the kind of completion being proposed. + * <p> + * The set of different kinds of completion proposals is + * expected to change over time. It is strongly recommended + * that clients do <b>not</b> assume that the kind is one of the + * ones they know about, and code defensively for the + * possibility of unexpected future growth. + * </p> + * + * @return the kind; one of the kind constants + * declared on this class, or possibly a kind unknown + * to the caller + + + + + + + + + + + * Returns the character index of the start of the + * subrange in the source file buffer containing the + * relevant token being completed. This + * token is either the identifier or Java language keyword + * under, or immediately preceding, the original request + * offset. If the original request offset is not within + * or immediately after an identifier or keyword, then the + * position returned is original request offset and the + * token range is empty. + * + * @return character index of token start position (inclusive) + + + + + + + + * Returns the character index of the end (exclusive) of the subrange + * in the source file buffer containing the + * relevant token. When there is no relevant token, the + * range is empty + * (<code>getEndToken() == getStartToken()</code>). + * + * @return character index of token end position (exclusive) + + + + + + + + * Sets the character indices of the subrange in the + * source file buffer containing the relevant token being + * completed. This token is either the identifier or + * Java language keyword under, or immediately preceding, + * the original request offset. If the original request + * offset is not within or immediately after an identifier + * or keyword, then the source range begins at original + * request offset and is empty. + * <p> + * If not set, defaults to empty subrange at [0,0). + * </p> + * + * @param startIndex character index of token start position (inclusive) + * @param endIndex character index of token end position (exclusive) + + + + + + + + + * Returns the proposed sequence of characters to insert into the + * source file buffer, replacing the characters at the specified + * source range. The string can be arbitrary; for example, it might + * include not only the name of a method but a set of parentheses. + * <p> + * The client must not modify the array returned. + * </p> + * + * @return the completion string + + + + + + + + + + + * Sets the proposed sequence of characters to insert into the + * source file buffer, replacing the characters at the specified + * source range. The string can be arbitrary; for example, it might + * include not only the name of a method but a set of parentheses. + * <p> + * If not set, defaults to an empty character array. + * </p> + * <p> + * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + * </p> + * + * @param completion the completion string + + + + + + + + + + + * Returns the character index of the start of the + * subrange in the source file buffer to be replaced + * by the completion string. If the subrange is empty + * (<code>getReplaceEnd() == getReplaceStart()</code>), + * the completion string is to be inserted at this + * index. + * <p> + * Note that while the token subrange is precisely + * specified, the replacement range is loosely + * constrained and may not bear any direct relation + * to the original request offset. For example, + * it would be possible for a type completion to + * propose inserting an import declaration at the + * top of the compilation unit; or the completion + * might include trailing parentheses and + * punctuation for a method completion. + * </p> + * + * @return replacement start position (inclusive) + + + + + + + + * Returns the character index of the end of the + * subrange in the source file buffer to be replaced + * by the completion string. If the subrange is empty + * (<code>getReplaceEnd() == getReplaceStart()</code>), + * the completion string is to be inserted at this + * index. + * + * @return replacement end position (exclusive) + + + + + + + + * Sets the character indices of the subrange in the + * source file buffer to be replaced by the completion + * string. If the subrange is empty + * (<code>startIndex == endIndex</code>), + * the completion string is to be inserted at this + * index. + * <p> + * If not set, defaults to empty subrange at [0,0). + * </p> + * <p> + * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + * </p> + * + * @param startIndex character index of replacement start position (inclusive) + * @param endIndex character index of replacement end position (exclusive) + + + + + + + + + * Returns the relative relevance rating of this proposal. + * + * @return relevance rating of this proposal; ratings are positive; higher means better + + + + + + + + * Sets the relative relevance rating of this proposal. + * <p> + * If not set, defaults to the lowest possible rating (1). + * </p> + * <p> + * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + * </p> + * + * @param rating relevance rating of this proposal; ratings are positive; higher means better + + + + + + + + * Returns the type signature or package name of the relevant + * declaration in the context, or <code>null</code> if none. + * <p> + * This field is available for the following kinds of + * completion proposals: + * <ul> + * <li><code>ANNOTATION_ATTRIBUT_REF</code> - type signature + * of the annotation that declares the attribute that is referenced</li> + * <li><code>ANONYMOUS_CLASS_DECLARATION</code> - type signature + * of the type that is being subclassed or implemented</li> + * <li><code>FIELD_IMPORT</code> - type signature + * of the type that declares the field that is imported</li> + * <li><code>FIELD_REF</code> - type signature + * of the type that declares the field that is referenced</li> + * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code> - type signature + * of the type that declares the field that is referenced</li> + * <li><code>METHOD_IMPORT</code> - type signature + * of the type that declares the method that is imported</li> + * <li><code>METHOD_REF</code> - type signature + * of the type that declares the method that is referenced</li> + * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code> - type signature + * of the type that declares the method that is referenced</li> + * <li><code>METHOD_DECLARATION</code> - type signature + * of the type that declares the method that is being + * implemented or overridden</li> + * <li><code>PACKAGE_REF</code> - dot-based package + * name of the package that is referenced</li> + * <li><code>TYPE_IMPORT</code> - dot-based package + * name of the package containing the type that is imported</li> + * <li><code>TYPE_REF</code> - dot-based package + * name of the package containing the type that is referenced</li> + * <li><code>POTENTIAL_METHOD_DECLARATION</code> - type signature + * of the type that declares the method that is being created</li> + * </ul> + * For kinds of completion proposals, this method returns + * <code>null</code>. Clients must not modify the array + * returned. + * </p> + * + * @return a type signature or a package name (depending + * on the kind of completion), or <code>null</code> if none + * @see Signature + + + + + + + + + + + * Returns the key of the relevant + * declaration in the context, or <code>null</code> if none. + * <p> + * This field is available for the following kinds of + * completion proposals: + * <ul> + * <li><code>ANONYMOUS_CLASS_DECLARATION</code> - key + * of the type that is being subclassed or implemented</li> + * <li><code>METHOD_DECLARATION</code> - key + * of the type that declares the method that is being + * implemented or overridden</li> + * </ul> + * For kinds of completion proposals, this method returns + * <code>null</code>. Clients must not modify the array + * returned. + * </p> + * + * @return a key, or <code>null</code> if none + * @see org.eclipse.jdt.core.dom.ASTParser#createASTs(ICompilationUnit[], String[], org.eclipse.jdt.core.dom.ASTRequestor, IProgressMonitor) + * @since 3.1 + + + + + + + + + + + * Sets the type or package signature of the relevant + * declaration in the context, or <code>null</code> if none. + * <p> + * If not set, defaults to none. + * </p> + * <p> + * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + * </p> + * + * @param signature the type or package signature, or + * <code>null</code> if none + + + + + + + + + + + * Sets the type or package key of the relevant + * declaration in the context, or <code>null</code> if none. + * <p> + * If not set, defaults to none. + * </p> + * <p> + * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + * </p> + * + * @param key the type or package key, or + * <code>null</code> if none + * @since 3.1 + + + + + + + + + + + * Returns the simple name of the method, field, + * member, or variable relevant in the context, or + * <code>null</code> if none. + * <p> + * This field is available for the following kinds of + * completion proposals: + * <ul> + * <li><code>ANNOTATION_ATTRIBUT_REF</code> - the name of the attribute</li> + * <li><code>FIELD_IMPORT</code> - the name of the field</li> + * <li><code>FIELD_REF</code> - the name of the field</li> + * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code> - the name of the field</li> + * <li><code>KEYWORD</code> - the keyword</li> + * <li><code>LABEL_REF</code> - the name of the label</li> + * <li><code>LOCAL_VARIABLE_REF</code> - the name of the local variable</li> + * <li><code>METHOD_IMPORT</code> - the name of the method</li> + * <li><code>METHOD_REF</code> - the name of the method (the type simple name for constructor)</li> + * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code> - the name of the method</li> + * <li><code>METHOD_DECLARATION</code> - the name of the method (the type simple name for constructor)</li> + * <li><code>VARIABLE_DECLARATION</code> - the name of the variable</li> + * <li><code>POTENTIAL_METHOD_DECLARATION</code> - the name of the method</li> + * </ul> + * For kinds of completion proposals, this method returns + * <code>null</code>. Clients must not modify the array + * returned. + * </p> + * + * @return the keyword, field, method, local variable, or member + * name, or <code>null</code> if none + + + + + + + + + + + * Sets the simple name of the method (type simple name for constructor), field, + * member, or variable relevant in the context, or + * <code>null</code> if none. + * <p> + * If not set, defaults to none. + * </p> + * <p> + * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + * </p> + * + * @param name the keyword, field, method, local variable, + * or member name, or <code>null</code> if none + + + + + + + + + + + * Returns the signature of the method or type + * relevant in the context, or <code>null</code> if none. + * <p> + * This field is available for the following kinds of + * completion proposals: + * <ul> + * <li><code>ANNOTATION_ATTRIBUT_REF</code> - the type signature + * of the referenced attribute's type</li> + * <li><code>ANONYMOUS_CLASS_DECLARATION</code> - method signature + * of the constructor that is being invoked</li> + * <li><code>FIELD_IMPORT</code> - the type signature + * of the referenced field's type</li> + * <li><code>FIELD_REF</code> - the type signature + * of the referenced field's type</li> + * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code> - the type signature + * of the referenced field's type</li> + * <li><code>LOCAL_VARIABLE_REF</code> - the type signature + * of the referenced local variable's type</li> + * <li><code>METHOD_IMPORT</code> - method signature + * of the method that is imported</li> + * <li><code>METHOD_REF</code> - method signature + * of the method that is referenced</li> + * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code> - method signature + * of the method that is referenced</li> + * <li><code>METHOD_DECLARATION</code> - method signature + * of the method that is being implemented or overridden</li> + * <li><code>TYPE_IMPORT</code> - type signature + * of the type that is imported</li> + * <li><code>TYPE_REF</code> - type signature + * of the type that is referenced</li> + * <li><code>VARIABLE_DECLARATION</code> - the type signature + * of the type of the variable being declared</li> + * <li><code>POTENTIAL_METHOD_DECLARATION</code> - method signature + * of the method that is being created</li> + * </ul> + * For kinds of completion proposals, this method returns + * <code>null</code>. Clients must not modify the array + * returned. + * </p> + * + * @return the signature, or <code>null</code> if none + * @see Signature + + + + + + + + + + + * Returns the key relevant in the context, + * or <code>null</code> if none. + * <p> + * This field is available for the following kinds of + * completion proposals: + * <ul> + * <li><code>ANONYMOUS_CLASS_DECLARATION</code> - method key + * of the constructor that is being invoked, or <code>null</code> if + * the declaring type is an interface</li> + * <li><code>METHOD_DECLARATION</code> - method key + * of the method that is being implemented or overridden</li> + * </ul> + * For kinds of completion proposals, this method returns + * <code>null</code>. Clients must not modify the array + * returned. + * </p> + * + * @return the key, or <code>null</code> if none + * @see org.eclipse.jdt.core.dom.ASTParser#createASTs(ICompilationUnit[], String[], org.eclipse.jdt.core.dom.ASTRequestor, IProgressMonitor) + * @since 3.1 + + + + + + + + + + + * Sets the signature of the method, field type, member type, + * relevant in the context, or <code>null</code> if none. + * <p> + * If not set, defaults to none. + * </p> + * <p> + * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + * </p> + * + * @param signature the signature, or <code>null</code> if none + + + + + + + + + + + * Sets the key of the method, field type, member type, + * relevant in the context, or <code>null</code> if none. + * <p> + * If not set, defaults to none. + * </p> + * <p> + * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + * </p> + * + * @param key the key, or <code>null</code> if none + * @since 3.1 + + + + + + + + + + + * Returns the modifier flags relevant in the context, or + * <code>Flags.AccDefault</code> if none. + * <p> + * This field is available for the following kinds of + * completion proposals: + * <ul> + * <li><code>ANNOTATION_ATTRIBUT_REF</code> - modifier flags + * of the attribute that is referenced; + * <li><code>ANONYMOUS_CLASS_DECLARATION</code> - modifier flags + * of the constructor that is referenced</li> + * <li><code>FIELD_IMPORT</code> - modifier flags + * of the field that is imported.</li> + * <li><code>FIELD_REF</code> - modifier flags + * of the field that is referenced; + * <code>Flags.AccEnum</code> can be used to recognize + * references to enum constants + * </li> + * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code> - modifier flags + * of the field that is referenced. + * </li> + * <li><code>KEYWORD</code> - modifier flag + * corresponding to the modifier keyword</li> + * <li><code>LOCAL_VARIABLE_REF</code> - modifier flags + * of the local variable that is referenced</li> + * <li><code>METHOD_IMPORT</code> - modifier flags + * of the method that is imported; + * </li> + * <li><code>METHOD_REF</code> - modifier flags + * of the method that is referenced; + * <code>Flags.AccAnnotation</code> can be used to recognize + * references to annotation type members + * </li> + * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code> - modifier flags + * of the method that is referenced. + * </li> + * <li><code>METHOD_DECLARATION</code> - modifier flags + * for the method that is being implemented or overridden</li> + * <li><code>TYPE_IMPORT</code> - modifier flags + * of the type that is imported; <code>Flags.AccInterface</code> + * can be used to recognize references to interfaces, + * <code>Flags.AccEnum</code> enum types, + * and <code>Flags.AccAnnotation</code> annotation types</li> + * <li><code>TYPE_REF</code> - modifier flags + * of the type that is referenced; <code>Flags.AccInterface</code> + * can be used to recognize references to interfaces, + * <code>Flags.AccEnum</code> enum types, + * and <code>Flags.AccAnnotation</code> annotation types + * </li> + * <li><code>VARIABLE_DECLARATION</code> - modifier flags + * for the variable being declared</li> + * <li><code>POTENTIAL_METHOD_DECLARATION</code> - modifier flags + * for the method that is being created</li> + * </ul> + * For other kinds of completion proposals, this method returns + * <code>Flags.AccDefault</code>. + * </p> + * + * @return the modifier flags, or + * <code>Flags.AccDefault</code> if none + * @see Flags + + + + + + + + * Sets the modifier flags relevant in the context. + * <p> + * If not set, defaults to none. + * </p> + * <p> + * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + * </p> + * + * @param flags the modifier flags, or + * <code>Flags.AccDefault</code> if none + + + + + + + + * Returns the required completion proposals. + * The proposal can be apply only if these required completion proposals are also applied. + * If the required proposal aren't applied the completion could create completion problems. + * + * <p> + * This field is available for the following kinds of + * completion proposals: + * <ul> + * <li><code>FIELD_REF</code> - The allowed required proposals for this kind are: + * <ul> + * <li><code>TYPE_REF</code></li> + * <li><code>TYPE_IMPORT</code></li> + * <li><code>FIELD_IMPORT</code></li> + * </ul> + * </li> + * <li><code>METHOD_REF</code> - The allowed required proposals for this kind are: + * <ul> + * <li><code>TYPE_REF</code></li> + * <li><code>TYPE_IMPORT</code></li> + * <li><code>METHOD_IMPORT</code></li> + * </ul> + * </li> + * </li> + * <li><code>TYPE_REF</code> - The allowed required proposals for this kind are: + * <ul> + * <li><code>TYPE_REF</code></li> + * </ul> + * </li> + * <li><code>CONSTRUCTOR_INVOCATION</code> - The allowed required proposals for this kind are: + * <ul> + * <li><code>TYPE_REF</code></li> + * </ul> + * </li> + * <li><code>ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION</code> - The allowed required proposals for this kind are: + * <ul> + * <li><code>TYPE_REF</code></li> + * </ul> + * </li> + * <li><code>ANONYMOUS_CLASS_DECLARATION</code> - The allowed required proposals for this kind are: + * <ul> + * <li><code>TYPE_REF</code></li> + * </ul> + * </li> + * </ul> + * </p> + * <p> + * Other kinds of required proposals will be returned in the future, therefore clients of this + * API must allow with {@link CompletionRequestor#setAllowsRequiredProposals(int, int, boolean)} + * only kinds which are in this list to avoid unexpected results in the future. + * </p> + * <p> + * A required proposal of a given kind is proposed even if {@link CompletionRequestor#isIgnored(int)} + * return <code>true</code> for that kind. + * </p> + * <p> + * A required completion proposal cannot have required completion proposals. + * </p> + * + * @return the required completion proposals, or <code>null</code> if none. + * + * @see CompletionRequestor#setAllowsRequiredProposals(int, int,boolean) + * + * @since 3.3 + + + + + + + + + + + * Sets the list of required completion proposals, or <code>null</code> if none. + * <p> + * If not set, defaults to none. + * </p> + * <p> + * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + * </p> + * + * @param proposals the list of required completion proposals, or + * <code>null</code> if none + * @since 3.3 + + + + + + + + + + + * Finds the method parameter names. + * This information is relevant to method reference (and + * method declaration proposals). Returns <code>null</code> + * if not available or not relevant. + * <p> + * The client must not modify the array returned. + * </p> + * <p> + * <b>Note that this is an expensive thing to compute, which may require + * parsing Java source files, etc. Use sparingly.</b> + * </p> + * + * @param monitor the progress monitor, or <code>null</code> if none + * @return the parameter names, or <code>null</code> if none + * or not available or not relevant + + + + + + + + + + + + * Sets the method parameter names. + * This information is relevant to method reference (and + * method declaration proposals). + * <p> + * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + * </p> + * + * @param parameterNames the parameter names, or <code>null</code> if none + + + + + + + + + + + * Returns the accessibility of the proposal. + * <p> + * This field is available for the following kinds of + * completion proposals: + * <ul> + * <li><code>TYPE_REF</code> - accessibility of the type</li> + * </ul> + * For these kinds of completion proposals, this method returns + * {@link IAccessRule#K_ACCESSIBLE} or {@link IAccessRule#K_DISCOURAGED} + * or {@link IAccessRule#K_NON_ACCESSIBLE}. + * By default this method return {@link IAccessRule#K_ACCESSIBLE}. + * </p> + * + * @see IAccessRule + * + * @return the accessibility of the proposal + * + * @since 3.1 + + + + + + + + * Returns whether this proposal is a constructor. + * <p> + * This field is available for the following kinds of + * completion proposals: + * <ul> + * <li><code>METHOD_REF</code> - return <code>true</code> + * if the referenced method is a constructor</li> + * <li><code>METHOD_DECLARATION</code> - return <code>true</code> + * if the declared method is a constructor</li> + * </ul> + * For kinds of completion proposals, this method returns + * <code>false</code>. + * </p> + * + * @return <code>true</code> if the proposal is a constructor. + * @since 3.1 + + + + + + + + * Returns the type signature or package name of the relevant + * receiver in the context, or <code>null</code> if none. + * <p> + * This field is available for the following kinds of + * completion proposals: + * <ul> + * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code> - type signature + * of the type that cast the receiver of the field that is referenced</li> + * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code> - type signature + * of the type that cast the receiver of the method that is referenced</li> + * </ul> + * For kinds of completion proposals, this method returns + * <code>null</code>. Clients must not modify the array + * returned. + * </p> + * + * @return a type signature or a package name (depending + * on the kind of completion), or <code>null</code> if none + * @see Signature + * + * @since 3.4 + + + + + + + + + + + * Returns the character index of the start of the + * subrange in the source file buffer containing the + * relevant receiver of the member being completed. This + * receiver is an expression. + * + * <p> + * This field is available for the following kinds of + * completion proposals: + * <ul> + * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code></li> + * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code></li> + * </ul> + * For kinds of completion proposals, this method returns <code>0</code>. + * </p> + * + * @return character index of receiver start position (inclusive) + * + * @since 3.4 + + + + + + + + * Returns the character index of the end (exclusive) of the subrange + * in the source file buffer containing the + * relevant receiver of the member being completed. + * + * * <p> + * This field is available for the following kinds of + * completion proposals: + * <ul> + * <li><code>FIELD_REF_WITH_CASTED_RECEIVER</code></li> + * <li><code>METHOD_REF_WITH_CASTED_RECEIVER</code></li> + * </ul> + * For kinds of completion proposals, this method returns <code>0</code>. + * </p> + * + * @return character index of receiver end position (exclusive) + * + * @since 3.4 + + + + + + + + * Sets the type or package signature of the relevant + * receiver in the context, or <code>null</code> if none. + * <p> + * If not set, defaults to none. + * </p> + * <p> + * The completion engine creates instances of this class and sets + * its properties; this method is not intended to be used by other clients. + * </p> + * + * @param signature the type or package signature, or + * <code>null</code> if none + * + * @since 3.4 + + + + + + + + + + + * Sets the character indices of the subrange in the + * source file buffer containing the relevant receiver + * of the member being completed. + * + * <p> + * If not set, defaults to empty subrange at [0,0). + * </p> + * + * @param startIndex character index of receiver start position (inclusive) + * @param endIndex character index of receiver end position (exclusive) + * + * @since 3.4 + + + + + + + + + + * Abstract base class for a completion requestor which is passed completion + * proposals as they are generated in response to a code assist request. + * <p> + * This class is intended to be subclassed by clients. + * </p> + * <p> + * The code assist engine normally invokes methods on completion + * requestor in the following sequence: + * <pre> + * requestor.beginReporting(); + * requestor.acceptContext(context); + * requestor.accept(proposal_1); + * requestor.accept(proposal_2); + * ... + * requestor.endReporting(); + * </pre> + * If, however, the engine is unable to offer completion proposals + * for whatever reason, <code>completionFailure</code> is called + * with a problem object describing why completions were unavailable. + * In this case, the sequence of calls is: + * <pre> + * requestor.beginReporting(); + * requestor.acceptContext(context); + * requestor.completionFailure(problem); + * requestor.endReporting(); + * </pre> + * In either case, the bracketing <code>beginReporting</code> + * <code>endReporting</code> calls are always made as well as + * <code>acceptContext</code> call. + * </p> + * <p> + * The class was introduced in 3.0 as a more evolvable replacement + * for the <code>ICompletionRequestor</code> interface. + * </p> + * + * @see ICodeAssist + * @since 3.0 + + + + + + * The set of CompletionProposal kinds that this requestor + * ignores; <code>0</code> means the set is empty. + * 1 << completionProposalKind + + + + + + + + + + + * The set of CompletionProposal kinds that this requestor + * allows for required proposals; <code>0</code> means the set is empty. + * 1 << completionProposalKind + + + + + + + + * Returns whether the given kind of completion proposal is ignored. + * + * @param completionProposalKind one of the kind constants declared + * on <code>CompletionProposal</code> + * @return <code>true</code> if the given kind of completion proposal + * is ignored by this requestor, and <code>false</code> if it is of + * interest + * @see #setIgnored(int, boolean) + * @see CompletionProposal#getKind() + + + + + + + + + * Sets whether the given kind of completion proposal is ignored. + * + * @param completionProposalKind one of the kind constants declared + * on <code>CompletionProposal</code> + * @param ignore <code>true</code> if the given kind of completion proposal + * is ignored by this requestor, and <code>false</code> if it is of + * interest + * @see #isIgnored(int) + * @see CompletionProposal#getKind() + + + + + + + + + * Returns whether a proposal of a given kind with a required proposal + * of the given kind is allowed. + * + * @param proposalKind one of the kind constants declared + * @param requiredProposalKind one of the kind constants declared + * on <code>CompletionProposal</code> + * @return <code>true</code> if a proposal of a given kind with a required proposal + * of the given kind is allowed by this requestor, and <code>false</code> + * if it isn't of interest. + * <p> + * By default, all kinds of required proposals aren't allowed. + * </p> + * @see #setAllowsRequiredProposals(int, int, boolean) + * @see CompletionProposal#getKind() + * @see CompletionProposal#getRequiredProposals() + * + * @since 3.3 + + + + + + + + + + * Sets whether a proposal of a given kind with a required proposal + * of the given kind is allowed. + * + * A required proposal of a given kind is proposed even if {@link #isIgnored(int)} + * return <code>true</code> for that kind. + * + * Currently only a subset of kinds support required proposals. To see what combinations + * are supported you must look at {@link CompletionProposal#getRequiredProposals()} + * documentation. + * + * @param proposalKind one of the kind constants declared + * @param requiredProposalKind one of the kind constants declared + * on <code>CompletionProposal</code> + * @param allow <code>true</code> if a proposal of a given kind with a required proposal + * of the given kind is allowed by this requestor, and <code>false</code> + * if it isn't of interest + * @see #isAllowingRequiredProposals(int, int) + * @see CompletionProposal#getKind() + * @see CompletionProposal#getRequiredProposals() + * + * @since 3.3 + + + + + + + + + + * Returns the favorite references which are used to compute some completion proposals. + * <p> + * A favorite reference is a qualified reference as it can be seen in an import statement.<br> + * e.g. <code>{"java.util.Arrays"}</code><br> + * It can be an on demand reference.<br> + * e.g. <code>{"java.util.Arrays.*"}</code> + * It can be a reference to a static method or field (as in a static import)<br> + * e.g. <code>{"java.util.Arrays.equals"}</code> + * </p> + * <p> + * Currently only on demand type references (<code>"java.util.Arrays.*"</code>), + * references to a static method or a static field are used to compute completion proposals. + * Other kind of reference could be used in the future. + * </p> + * @return favorite imports + * + * @since 3.3 + + + + + + + + + + + * Set the favorite references which will be used to compute some completion proposals. + * A favorite reference is a qualified reference as it can be seen in an import statement.<br> + * + * @param favoriteImports + * + * @see #getFavoriteReferences() + * + * @since 3.3 + + + + + + + + + + + * Pro forma notification sent before reporting a batch of + * completion proposals. + * <p> + * The default implementation of this method does nothing. + * Clients may override. + * </p> + + + + + + + * Pro forma notification sent after reporting a batch of + * completion proposals. + * <p> + * The default implementation of this method does nothing. + * Clients may override. + * </p> + + + + + + + * Notification of failure to produce any completions. + * The problem object explains what prevented completing. + * <p> + * The default implementation of this method does nothing. + * Clients may override to receive this kind of notice. + * </p> + * + * @param problem the problem object + + + + + + + + * Proposes a completion. Has no effect if the kind of proposal + * is being ignored by this requestor. Callers should consider + * checking {@link #isIgnored(int)} before avoid creating proposal + * objects that would only be ignored. + * <p> + * Similarly, implementers should check + * {@link #isIgnored(int) isIgnored(proposal.getKind())} + * and ignore proposals that have been declared as uninteresting. + * The proposal object passed is only valid for the duration of + * completion operation. + * + * @param proposal the completion proposal + * @exception IllegalArgumentException if the proposal is null + + + + + + + + * Propose the context in which the completion occurs. + * <p> + * This method is called one and only one time before any call to + * {@link #accept(CompletionProposal)}. + * The default implementation of this method does nothing. + * Clients may override. + * </p> + * @param context the completion context + * + * @since 3.1 + + + + + + + + * Returns whether this requestor requires an extended context. + * + * By default this method return <code>false</code>. + * + * @return <code>true</code> if this requestor requires an extended context. + * + * @see CompletionContext#isExtended() + * + * @since 3.4 + + + + + + + + * Sets whether this requestor requires an extended context. + * + * @param require <code>true</code> if this requestor requires an extended context. + * + * @see CompletionContext#isExtended() + * + * @since 3.4 + + + + + + + + + + + + + * Adapter of the requestor interface <code>ICompletionRequestor</code>. + * <p> + * This class is intended to be instantiated and subclassed by clients. + * </p> + * + * @see ICompletionRequestor + * @since 2.0 + * @deprecated Subclass {@link CompletionRequestor} instead. + + + + + + + * This class is the entry point for source corrections. + * + * This class is intended to be instantiated by clients. + * + * @since 2.0 + * @noextend This class is not intended to be subclassed by clients. + + + + + + * This field is not intended to be used by client. + + + + + + + * This field is not intended to be used by client. + + + + + + + * This field is not intended to be used by client. + + + + + + + + * An element changed event describes a change to the structure or contents + * of a tree of Java elements. The changes to the elements are described by + * the associated delta object carried by this event. + * <p> + * This class is not intended to be instantiated or subclassed by clients. + * Instances of this class are automatically created by the Java model. + * </p> + * + * @see IElementChangedListener + * @see IJavaElementDelta + * @noinstantiate This class is not intended to be instantiated by clients. + * @noextend This class is not intended to be subclassed by clients. + + + + + + + * Event type constant (bit mask) indicating an after-the-fact + * report of creations, deletions, and modifications + * to one or more Java element(s) expressed as a hierarchical + * java element delta as returned by <code>getDelta()</code>. + * + * Note: this notification occurs during the corresponding POST_CHANGE + * resource change notification, and contains a full delta accounting for + * any JavaModel operation and/or resource change. + * + * @see IJavaElementDelta + * @see org.eclipse.core.resources.IResourceChangeEvent + * @see #getDelta() + * @since 2.0 + + + + + + + * Event type constant (bit mask) indicating an after-the-fact + * report of creations, deletions, and modifications + * to one or more Java element(s) expressed as a hierarchical + * java element delta as returned by <code>getDelta</code>. + * + * Note: this notification occurs during the corresponding PRE_AUTO_BUILD + * resource change notification. The delta, which is notified here, only contains + * information relative to the previous JavaModel operations (in other words, + * it ignores the possible resources which have changed outside Java operations). + * In particular, it is possible that the JavaModel be inconsistent with respect to + * resources, which got modified outside JavaModel operations (it will only be + * fully consistent once the POST_CHANGE notification has occurred). + * + * @see IJavaElementDelta + * @see org.eclipse.core.resources.IResourceChangeEvent + * @see #getDelta() + * @since 2.0 + * @deprecated - no longer used, such deltas are now notified during POST_CHANGE + + + + + + + * Event type constant (bit mask) indicating an after-the-fact + * report of creations, deletions, and modifications + * to one or more Java element(s) expressed as a hierarchical + * java element delta as returned by <code>getDelta</code>. + * + * Note: this notification occurs as a result of a working copy reconcile + * operation. + * + * @see IJavaElementDelta + * @see org.eclipse.core.resources.IResourceChangeEvent + * @see #getDelta() + * @since 2.0 + + + + + + + + + * Returns the delta describing the change. + * + * @return the delta describing the change + + + + + + + + * Utility class for decoding modifier flags in Java elements. + * <p> + * This class provides static methods only. + * </p> + * <p> + * Note that the numeric values of these flags match the ones for class files + * as described in the Java Virtual Machine Specification. The AST class + * <code>Modifier</code> provides the same functionality as this class, only in + * the <code>org.eclipse.jdt.core.dom</code> package. + * </p> + * + * @see IMember#getFlags() + * @noinstantiate This class is not intended to be instantiated by clients. + + + + + + * Constant representing the absence of any flag + * @since 3.0 + + + + + + + * Public access flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Private access flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Protected access flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Static access flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Final access flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Synchronized access flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Volatile property flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Transient property flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Native property flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Interface property flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Abstract property flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Strictfp property flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Super property flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Synthetic property flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Deprecated property flag. See The Java Virtual Machine Specification for more details. + * @since 2.0 + + + + + + + * Bridge method property flag (added in J2SE 1.5). Used to flag a compiler-generated + * bridge methods. + * See The Java Virtual Machine Specification for more details. + * @since 3.0 + + + + + + + * Varargs method property flag (added in J2SE 1.5). + * Used to flag variable arity method declarations. + * See The Java Virtual Machine Specification for more details. + * @since 3.0 + + + + + + + * Enum property flag (added in J2SE 1.5). + * See The Java Virtual Machine Specification for more details. + * @since 3.0 + + + + + + + * Annotation property flag (added in J2SE 1.5). + * See The Java Virtual Machine Specification for more details. + * @since 3.0 + + + + + + + * Returns whether the given integer includes the <code>abstract</code> modifier. + * + * @param flags the flags + * @return <code>true</code> if the <code>abstract</code> modifier is included + + + + + + + + + * Returns whether the given integer includes the indication that the + * element is deprecated (<code>@deprecated</code> tag in Javadoc comment). + * + * @param flags the flags + * @return <code>true</code> if the element is marked as deprecated + + + + + + + + + * Returns whether the given integer includes the <code>final</code> modifier. + * + * @param flags the flags + * @return <code>true</code> if the <code>final</code> modifier is included + + + + + + + + + * Returns whether the given integer includes the <code>interface</code> modifier. + * + * @param flags the flags + * @return <code>true</code> if the <code>interface</code> modifier is included + * @since 2.0 + + + + + + + + + * Returns whether the given integer includes the <code>native</code> modifier. + * + * @param flags the flags + * @return <code>true</code> if the <code>native</code> modifier is included + + + + + + + + + * Returns whether the given integer does not include one of the + * <code>public</code>, <code>private</code>, or <code>protected</code> flags. + * + * @param flags the flags + * @return <code>true</code> if no visibility flag is set + * @since 3.2 + + + + + + + + + * Returns whether the given integer includes the <code>private</code> modifier. + * + * @param flags the flags + * @return <code>true</code> if the <code>private</code> modifier is included + + + + + + + + + * Returns whether the given integer includes the <code>protected</code> modifier. + * + * @param flags the flags + * @return <code>true</code> if the <code>protected</code> modifier is included + + + + + + + + + * Returns whether the given integer includes the <code>public</code> modifier. + * + * @param flags the flags + * @return <code>true</code> if the <code>public</code> modifier is included + + + + + + + + + * Returns whether the given integer includes the <code>static</code> modifier. + * + * @param flags the flags + * @return <code>true</code> if the <code>static</code> modifier is included + + + + + + + + + * Returns whether the given integer includes the <code>super</code> modifier. + * + * @param flags the flags + * @return <code>true</code> if the <code>super</code> modifier is included + * @since 3.2 + + + + + + + + + * Returns whether the given integer includes the <code>strictfp</code> modifier. + * + * @param flags the flags + * @return <code>true</code> if the <code>strictfp</code> modifier is included + + + + + + + + + * Returns whether the given integer includes the <code>synchronized</code> modifier. + * + * @param flags the flags + * @return <code>true</code> if the <code>synchronized</code> modifier is included + + + + + + + + + * Returns whether the given integer includes the indication that the + * element is synthetic. + * + * @param flags the flags + * @return <code>true</code> if the element is marked synthetic + + + + + + + + + * Returns whether the given integer includes the <code>transient</code> modifier. + * + * @param flags the flags + * @return <code>true</code> if the <code>transient</code> modifier is included + + + + + + + + + * Returns whether the given integer includes the <code>volatile</code> modifier. + * + * @param flags the flags + * @return <code>true</code> if the <code>volatile</code> modifier is included + + + + + + + + + * Returns whether the given integer has the <code>AccBridge</code> + * bit set. + * + * @param flags the flags + * @return <code>true</code> if the <code>AccBridge</code> flag is included + * @see #AccBridge + * @since 3.0 + + + + + + + + + * Returns whether the given integer has the <code>AccVarargs</code> + * bit set. + * + * @param flags the flags + * @return <code>true</code> if the <code>AccVarargs</code> flag is included + * @see #AccVarargs + * @since 3.0 + + + + + + + + + * Returns whether the given integer has the <code>AccEnum</code> + * bit set. + * + * @param flags the flags + * @return <code>true</code> if the <code>AccEnum</code> flag is included + * @see #AccEnum + * @since 3.0 + + + + + + + + + * Returns whether the given integer has the <code>AccAnnotation</code> + * bit set. + * + * @param flags the flags + * @return <code>true</code> if the <code>AccAnnotation</code> flag is included + * @see #AccAnnotation + * @since 3.0 + + + + + + + + + * Returns a standard string describing the given modifier flags. + * Only modifier flags are included in the output; deprecated, + * synthetic, bridge, etc. flags are ignored. + * <p> + * The flags are output in the following order: + * <pre> + * <code>public</code> <code>protected</code> <code>private</code> + * <code>static</code> + * <code>abstract</code> <code>final</code> <code>native</code> <code>synchronized</code> <code>transient</code> <code>volatile</code> <code>strictfp</code> + * </pre> + * This is a compromise between the orders specified in sections 8.1.1, + * 8.3.1, 8.4.3, 8.8.3, 9.1.1, and 9.3 of <em>The Java Language + * Specification, Second Edition</em> (JLS2). + * </p> + * <p> + * Note that the flags of a method can include the AccVarargs flag that has no standard description. Since the AccVarargs flag has the same value as + * the AccTransient flag (valid for fields only), attempting to get the description of method modifiers with the AccVarargs flag set would result in an + * unexpected description. Clients should ensure that the AccVarargs is not included in the flags of a method as follows: + * <pre> + * IMethod method = ... + * int flags = method.getFlags() & ~Flags.AccVarargs; + * return Flags.toString(flags); + * </pre> + * </p> + * <p> + * Examples results: + * <pre> + * <code>"public static final"</code> + * <code>"private native"</code> + * </pre> + * </p> + * + * @param flags the flags + * @return the standard string representation of the given flags + + + + + + + + + + * Describes an access rule to source and class files on a classpath entry. + * An access rule is composed of a file pattern and a kind (accessible, + * non accessible, or discouraged). + * <p> + * On a given classpath entry, the access rules are considered in the order given + * when the entry was created. When a source or class file matches an access + * rule's pattern, the access rule's kind define whether the file is considered + * accessible, non accessible, or its access is discouraged. If the source or class + * file doesn't match any accessible rule, it is considered accessible. A source or class + * file that is not accessible or discouraged can still be refered to but it is tagged as being not + * accessible - the Java builder will create a problem marker for example. + * The severity of the marker created from a non accessible rule is controled through + * the {@link JavaCore#COMPILER_PB_FORBIDDEN_REFERENCE} compiler option. + * The severity of the marker created from a discouraged rule is controled through + * the {@link JavaCore#COMPILER_PB_DISCOURAGED_REFERENCE} compiler option. + * Note this is different from inclusion and exclusion patterns on source classpath entries, + * where a source file that is excluded is not even compiled. + * Files patterns look like relative file paths with wildcards and are interpreted relative + * to each entry's path. + * File patterns are case-sensitive and they can contain '**', '*' or '?' wildcards (see + * {@link IClasspathEntry#getExclusionPatterns()} for the full description + * of their syntax and semantics). + * Note that file patterns must not include the file extension. + * <code>com/xyz/tests/MyClass</code> is a valid file pattern, whereas + * <code>com/xyz/tests/MyClass.class</code> is not valid. + * </p> + * <p> + * For example, if one of the entry path is <code>/Project/someLib.jar</code>, + * there are no accessible rules, and there is one non accessible rule whith pattern + * <code>com/xyz/tests/&#42;&#42;</code>, then class files + * like <code>/Project/someLib.jar/com/xyz/Foo.class</code> + * and <code>/Project/someLib.jar/com/xyz/utils/Bar.class</code> would be accessible, + * whereas <code>/Project/someLib.jar/com/xyz/tests/T1.class</code> + * and <code>/Project/someLib.jar/com/xyz/tests/quick/T2.class</code> would not be + * accessible. + * </p> + * <p> + * This interface is not intended to be implemented by clients. + * </p> + * + * @since 3.1 + + + + + + * Constant indicating that files matching the rule's pattern are accessible. + + + + + + + * Constant indicating that files matching the rule's pattern are non accessible. + + + + + + + * Constant indicating that access to the files matching the rule's pattern is discouraged. + + + + + + + * <p>Flag indicating that whether a type matching this rule should be ignored iff a type with + * the same qualified name can be found on a later classpath entry with a better + * accessibility.</p> + * <p>E.g. if a type p.X matches a rule K_NON_ACCESSIBLE | IGNORE_IF_BETTER + * on a library entry 'lib1' and another type p.X also matches a rule + * K_DISCOURAGED on library entry 'lib2' ('lib2' being after 'lib1' on the + * classpath), then p.X from 'lib2' will be used and reported as + * discouraged.</p> + * + * @since 3.2 + + + + + + + * Returns the file pattern for this access rule. + * + * @return the file pattern for this access rule + + + + + + + + * Returns the kind of this access rule (one of {@link #K_ACCESSIBLE}, {@link #K_NON_ACCESSIBLE} + * or {@link #K_DISCOURAGED}). + * + * @return the kind of this access rule + + + + + + + + * <p>Returns whether a type matching this rule should be ignored iff a type with + * the same qualified name can be found on a later classpath entry with a better + * accessibility.</p> + * <p>E.g. if a type p.X matches a rule K_NON_ACCESSIBLE | IGNORE_IF_BETTER + * on a library entry 'lib1' and another type p.X also matches a rule + * K_DISCOURAGED on library entry 'lib2' ('lib2' being after 'lib1' on the + * classpath), then p.X from 'lib2' will be used and reported as + * discouraged.</p> + * + * @return whether a type matching this rule should be ignored iff a type + * with the same qualified name can be found on a later classpath + * entry with a better accessibility + * @since 3.2 + + + + + + + + + * Common protocol for Java elements that can be annotated. + * <p> + * This interface is not intended to be implemented by clients. + * </p> + * + * @since 3.4 + + + + + + * Returns the annotation with the given name declared on this element. + * This is a handle-only method. The annotation may or may not exist. + * + * @param name the given simple name + * @return the annotation with the given name declared on this element + + + + + + + + * Represents an annotation on a package declaration, a type, a method, a field + * or a local variable in a compilation unit or a class file. + * <p> + * Annotations are obtained using {@link IAnnotatable#getAnnotation(String)}. + * </p><p> + * Note that annotations are not children of their declaring element. + * To get a list of the annotations use {@link IAnnotatable#getAnnotations()}. + * </p> + * <p> + * This interface is not intended to be implemented or extended by clients. + * </p> + * + * @since 3.4 + + + + + + + * A buffer contains the text contents of a resource. It is not language-specific. + * The contents may be in the process of being edited, differing from the actual contents of the + * underlying resource. A buffer has an owner, which is an <code>IOpenable</code>. + * If a buffer does not have an underlying resource, saving the buffer has no effect. + * Buffers can be read-only. + * <p> + * Note that java model operations that manipulate an <code>IBuffer</code> (for example, + * <code>IType.createMethod(...)</code>) ensures that the same line delimiter + * (either <code>"\n"</code> or <code>"\r"</code> or <code>"\r\n"</code>) is + * used across the whole buffer. Thus these operations may change the line delimiter(s) + * included in the string to be append, or replaced. + * However implementers of this interface should be aware that other clients of <code>IBuffer</code> + * might not do such transformations beforehand. + * <p> + * This interface may be implemented by clients. + * </p> + + + + + + * Implementors of {@link IBuffer} can additionally implement {@link IBuffer.ITextEditCapability}. + * This adds the capability to apply text edits to the buffer and will be used by + * {@link ICompilationUnit#applyTextEdit(TextEdit, IProgressMonitor)}. + * + * <p> + * This interface may be implemented by clients. + * </p> + * @since 3.4 + + + + + + * Applies a text edit to this underlying buffer. + * + * @param edit the edit to apply + * @param monitor the progress monitor to use or <code>null</code> if no progress should be reported + * @return the undo edit + * @throws JavaModelException if this edit can not be applied to the buffer. Reasons include: + * <ul> + * <li>The provided edit can not be applied as there is a problem with the text edit locations ({@link IJavaModelStatusConstants#BAD_TEXT_EDIT_LOCATION})}.</li> + * </ul> + + + + + + + + + + + + * A listener, which gets notified when the contents of a specific buffer + * have changed, or when the buffer is closed. + * When a buffer is closed, the listener is notified <em>after</em> the buffer has been closed. + * A listener is not notified when a buffer is saved. + * <p> + * This interface may be implemented by clients. + * </p> + + + + + + * Notifies that the given event has occurred. + * + * @param event the change event + + + + + + + + + * A factory that creates <code>IBuffer</code>s for openables. + * <p> + * This interface may be implemented by clients. + * </p> + * @since 2.0 + * @deprecated Use {@link WorkingCopyOwner} instead + + + + + + + * Represents an entire binary type (single <code>.class</code> file). + * A class file has a single child of type <code>IType</code>. + * Class file elements need to be opened before they can be navigated. + * If a class file cannot be parsed, its structure remains unknown. Use + * <code>IJavaElement.isStructureKnown</code> to determine whether this is the + * case. + * <p> + * Note: <code>IClassFile</code> extends <code>ISourceReference</code>. + * Source can be obtained for a class file if and only if source has been attached to this + * class file. The source associated with a class file is the source code of + * the compilation unit it was (nominally) generated from. + * </p> + * + * @see IPackageFragmentRoot#attachSource(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, IProgressMonitor) + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + * Changes this class file handle into a working copy. A new {@link IBuffer} is + * created using the given owner. Uses the primary owner if <code>null</code> is + * specified. + * <p> + * When switching to working copy mode, problems are reported to the given + * {@link IProblemRequestor}. Note that once in working copy mode, the given + * {@link IProblemRequestor} is ignored. Only the original {@link IProblemRequestor} + * is used to report subsequent problems. + * </p> + * <p> + * Once in working copy mode, changes to this working copy or its children are done in memory. + * Only the new buffer is affected. + * </p> + * <p> + * Using {@link ICompilationUnit#commitWorkingCopy(boolean, IProgressMonitor)} on the working copy + * will throw a <code>JavaModelException</code> as a class file is implicetly read-only. + * </p> + * <p> + * If this class file was already in working copy mode, an internal counter is incremented and no + * other action is taken on this working copy. To bring this working copy back into the original mode + * (where it reflects the underlying resource), {@link ICompilationUnit#discardWorkingCopy} must be call as many + * times as {@link #becomeWorkingCopy(IProblemRequestor, WorkingCopyOwner, IProgressMonitor)}. + * </p> + * <p> + * The primary compilation unit of a class file's working copy does not exist if the class file is not + * in working copy mode (<code>classFileWorkingCopy.getPrimary().exists() == false</code>). + * </p> + * <p> + * The resource of a class file's working copy is <code>null</code> if the class file is in an external jar file. + * </p> + * + * @param problemRequestor a requestor which will get notified of problems detected during + * reconciling as they are discovered. The requestor can be set to <code>null</code> indicating + * that the client is not interested in problems. + * @param owner the given {@link WorkingCopyOwner}, or <code>null</code> for the primary owner + * @param monitor a progress monitor used to report progress while opening this compilation unit + * or <code>null</code> if no progress should be reported + * @return a working copy for this class file + * @throws JavaModelException if this compilation unit could not become a working copy. + * @see ICompilationUnit#discardWorkingCopy() + * @since 3.2 + * @deprecated Use {@link ITypeRoot#getWorkingCopy(WorkingCopyOwner, IProgressMonitor)} instead. + * Note that if this deprecated method is used, problems will be reported to the given problem requestor + * as well as the problem requestor returned by the working copy owner (if not null). + + + + + + + + + + + * Returns the bytes contained in this class file. + * + * @return the bytes contained in this class file + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @since 3.3 + + + + + + + + + + + * Returns the type contained in this class file. + * This is a handle-only method. The type may or may not exist. + * + * @return the type contained in this class file + + + + + + + + * Returns a working copy on the source associated with this class file using the given + * factory to create the buffer, or <code>null</code> if there is no source associated + * with the class file. + * <p> + * The buffer will be automatically initialized with the source of the class file + * upon creation. + * <p> + * The only valid operations on this working copy are <code>getBuffer()</code> or <code>getOriginalElement</code>. + * + * @param monitor a progress monitor used to report progress while opening this compilation unit + * or <code>null</code> if no progress should be reported + * @param factory the factory that creates a buffer that is used to get the content of the working copy + * or <code>null</code> if the internal factory should be used + * @return a a working copy on the source associated with this class file + * @exception JavaModelException if the source of this class file can + * not be determined. Reasons include: + * <ul> + * <li> This class file does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * </ul> + * @since 2.0 + * @deprecated Use {@link ITypeRoot#getWorkingCopy(WorkingCopyOwner, IProgressMonitor)} instead + + + + + + + + + + * Returns whether this type represents a class. This is not guaranteed to be + * instantaneous, as it may require parsing the underlying file. + * + * @return <code>true</code> if the class file represents a class. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + * Returns whether this type represents an interface. This is not guaranteed to + * be instantaneous, as it may require parsing the underlying file. + * + * @return <code>true</code> if the class file represents an interface. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + + * A classpath attribute defines a name/value pair that can be persisted with a classpath entry. Such an attribute + * can be created using the factory method {@link JavaCore#newClasspathAttribute(String, String) newClasspathAttribute(String name, String value)}. + * + * @see JavaCore#newContainerEntry( + * org.eclipse.core.runtime.IPath containerPath, + * IAccessRule[] accessRules, + * IClasspathAttribute[] extraAttributes, + * boolean isExported) + * @see JavaCore#newLibraryEntry( + * org.eclipse.core.runtime.IPath path, + * org.eclipse.core.runtime.IPath sourceAttachmentPath, + * org.eclipse.core.runtime.IPath sourceAttachmentRootPath, + * IAccessRule[] accessRules, + * IClasspathAttribute[] extraAttributes, + * boolean isExported) + * @see JavaCore#newProjectEntry( + * org.eclipse.core.runtime.IPath path, + * IAccessRule[] accessRules, + * boolean combineAccessRestrictions, + * IClasspathAttribute[] extraAttributes, + * boolean isExported) + * @see JavaCore#newSourceEntry( + * org.eclipse.core.runtime.IPath path, + * org.eclipse.core.runtime.IPath[] inclusionPatterns, + * org.eclipse.core.runtime.IPath[] exclusionPatterns, + * org.eclipse.core.runtime.IPath specificOutputLocation, + * IClasspathAttribute[] extraAttributes) + * @see JavaCore#newVariableEntry( + * org.eclipse.core.runtime.IPath variablePath, + * org.eclipse.core.runtime.IPath variableSourceAttachmentPath, + * org.eclipse.core.runtime.IPath variableSourceAttachmentRootPath, + * IAccessRule[] accessRules, + * IClasspathAttribute[] extraAttributes, + * boolean isExported) + * @since 3.1 + * @noimplement This interface is not intended to be implemented by clients. + + + + + + * Constant for the name of the javadoc location attribute. + * + * <p>The value for this attribute has to be the string representation of a URL.</p> + * + * @since 3.1 + + + + + + + * Constant for the name of the optional attribute. The possible values + * for this attribute are <code>"true"</code> or <code>"false"</code>. + * When not present, <code>"false"</code> is assumed. + * If the value of this attribute is <code>"true"</code>, the classpath entry + * is optional. If the underlying resource or jar file doesn't exist, no error + * is reported and the classpath entry is ignored. + * + * @since 3.2 + + + + + + + * Returns the name of this classpath attribute. + * + * @return the name of this classpath attribute. + * @since 3.1 + + + + + + + + * Returns the value of this classpath attribute. + * + * @return the value of this classpath attribute. + * @since 3.1 + + + + + + + + + * Interface of a classpath container. + * A classpath container provides a way to indirectly reference a set of classpath entries through + * a classpath entry of kind <code>CPE_CONTAINER</code>. Typically, a classpath container can + * be used to describe a complex library composed of multiple JARs or projects, considering also + * that containers can map to different set of entries on each project, in other words, several + * projects can reference the same generic container path, but have each of them actually bound + * to a different container object. + * <p> + * The set of entries associated with a classpath container may contain any of the following: + * <ul> + * <li> library entries (<code>CPE_LIBRARY</code>) </li> + * <li> project entries (<code>CPE_PROJECT</code>) </li> + * </ul> + * In particular, a classpath container can neither reference further classpath containers or classpath variables. + * <p> + * A library entry can reference other libraries through the Class-Path section of the JAR's MANIFEST.MF file. If the + * container wants such referenced entries to be part of the classpath, the container must explicitly add them to the + * array returned from {@link #getClasspathEntries()}. + * <p> + * Classpath container values are persisted locally to the workspace, but are not preserved from a + * session to another. It is thus highly recommended to register a <code>ClasspathContainerInitializer</code> + * for each referenced container (through the extension point "org.eclipse.jdt.core.ClasspathContainerInitializer"). + * <p> + * @see IClasspathEntry + * @since 2.0 + + + + + + * Kind for a container mapping to an application library + + + + + + + * Kind for a container mapping to a system library + + + + + + + * Kind for a container mapping to a default system library, implicitly contributed by the runtime + + + + + + + * Answers the set of classpath entries this container is mapping to. + * <p> + * The set of entries associated with a classpath container may contain any of the following: + * <ul> + * <li> library entries (<code>CPE_LIBRARY</code>) </li> + * <li> project entries (<code>CPE_PROJECT</code>) </li> + * </ul> + * A classpath container can neither reference further classpath containers + * or classpath variables. + * <p> + * A library entry can reference other libraries through the Class-Path section of the JAR's MANIFEST.MF file. If + * the container wants such referenced entries to be part of the classpath, the container must explicitly add them + * to the result. + * <p> + * This method is called by the Java model when it needs to resolve this + * classpath container entry into a list of library and project entries. + * The method is typically called exactly once for a given Java project, + * and the resulting list of entries cached internally by the Java model. + * This method must not be called by other clients. + * <p> + * There are a wide variety of conditions under which this method may be + * invoked. To ensure that the implementation does not interfere with + * correct functioning of the Java model, the implementation should use + * only the following Java model APIs: + * <ul> + * <li>{@link JavaCore#newLibraryEntry(IPath, IPath, IPath, boolean)} and variants</li> + * <li>{@link JavaCore#newProjectEntry(IPath, boolean)} and variants</li> + * <li>{@link JavaCore#create(org.eclipse.core.resources.IWorkspaceRoot)}</li> + * <li>{@link JavaCore#create(org.eclipse.core.resources.IProject)}</li> + * <li>{@link JavaCore#getReferencedClasspathEntries(IClasspathEntry, IJavaProject)} with <code>null</code> as project</li> + * <li>{@link IJavaModel#getJavaProjects()}</li> + * <li>{@link IJavaProject#getRawClasspath()}</li> + * <li>{@link IJavaProject#readRawClasspath()}</li> + * <li>{@link IJavaProject#getOutputLocation()}</li> + * <li>{@link IJavaProject#readOutputLocation()}</li> + * <li>Java element operations marked as "handle-only"</li> + * </ul> + * The effects of using other Java model APIs are unspecified. + * </p> + * + * @return IClasspathEntry[] - the classpath entries this container represents + * @see IClasspathEntry + + + + + + + + * An entry on a Java project classpath identifying one or more package fragment + * roots. A classpath entry has a content kind (either source, + * {@link IPackageFragmentRoot#K_SOURCE}, or binary, {@link IPackageFragmentRoot#K_BINARY}), which is inherited + * by each package fragment root and package fragment associated with the entry. + * <p> + * A classpath entry can refer to any of the following:<ul> + * + * <li>Source code in the current project. In this case, the entry identifies a + * root folder in the current project containing package fragments and + * source files with one of the {@link JavaCore#getJavaLikeExtensions() + * Java-like extensions}. The root folder itself represents a default + * package, subfolders represent package fragments, and files with a + * Java-like extension (e.g. <code>.java</code> files) + * represent compilation units. All compilation units will be compiled when + * the project is built. The classpath entry must specify the + * absolute path to the root folder. Entries of this kind are + * associated with the {@link #CPE_SOURCE} constant. + * Source classpath entries can carry inclusion and exclusion patterns for + * selecting which source files appear as compilation + * units and get compiled when the project is built. + * </li> + * + * <li>A binary library in the current project, in another project, or in the external + * file system. In this case the entry identifies a JAR (or root folder) containing + * package fragments and <code>.class</code> files. The classpath entry + * must specify the absolute path to the JAR (or root folder), and in case it refers + * to an external JAR, then there is no associated resource in the workbench. Entries + * of this kind are associated with the {@link #CPE_LIBRARY} constant.</li> + * + * <li>A required project. In this case the entry identifies another project in + * the workspace. The required project is used as a binary library when compiling + * (that is, the builder looks in the output location of the required project + * for required <code>.class</code> files when building). When performing other + * "development" operations - such as code assist, code resolve, type hierarchy + * creation, etc. - the source code of the project is referred to. Thus, development + * is performed against a required project's source code, and compilation is + * performed against a required project's last built state. The + * classpath entry must specify the absolute path to the + * project. Entries of this kind are associated with the {@link #CPE_PROJECT} + * constant. + * Note: referencing a required project with a classpath entry refers to the source + * code or associated <code>.class</code> files located in its output location. + * It will also automatically include any other libraries or projects that the required project's classpath + * refers to, iff the corresponding classpath entries are tagged as being exported + * ({@link IClasspathEntry#isExported}). + * Unless exporting some classpath entries, classpaths are not chained by default - + * each project must specify its own classpath in its entirety.</li> + * + * <li> A path beginning in a classpath variable defined globally to the workspace. + * Entries of this kind are associated with the {@link #CPE_VARIABLE} constant. + * Classpath variables are created using {@link JavaCore#setClasspathVariable(String, IPath, org.eclipse.core.runtime.IProgressMonitor)}, + * and gets resolved, to either a project or library entry, using + * {@link JavaCore#getResolvedClasspathEntry(IClasspathEntry)}. + * It is also possible to register an automatic initializer ({@link ClasspathVariableInitializer}), + * which will be invoked through the extension point "org.eclipse.jdt.core.classpathVariableInitializer". + * After resolution, a classpath variable entry may either correspond to a project or a library entry. </li> + * + * <li> A named classpath container identified by its container path. + * A classpath container provides a way to indirectly reference a set of classpath entries through + * a classpath entry of kind {@link #CPE_CONTAINER}. Typically, a classpath container can + * be used to describe a complex library composed of multiple JARs, projects or classpath variables, + * considering also that containers can be mapped differently on each project. Several projects can + * reference the same generic container path, but have each of them actually bound to a different + * container object. + * The container path is a formed by a first ID segment followed with extra segments, + * which can be used as additional hints for resolving this container reference. If no container was ever + * recorded for this container path onto this project (using {@link JavaCore#setClasspathContainer}, + * then a {@link ClasspathContainerInitializer} will be activated if any was registered for this + * container ID onto the extension point "org.eclipse.jdt.core.classpathContainerInitializer". + * A classpath container entry can be resolved explicitly using {@link JavaCore#getClasspathContainer} + * and the resulting container entries can contain any non-container entry. In particular, it may contain variable + * entries, which in turn needs to be resolved before being directly used. + * <br> Also note that the container resolution APIs include an IJavaProject argument, so as to allow the same + * container path to be interpreted in different ways for different projects. </li> + * </ul> + * </p> + * The result of {@link IJavaProject#getResolvedClasspath} will have all entries of type + * {@link #CPE_VARIABLE} and {@link #CPE_CONTAINER} resolved to a set of + * {@link #CPE_SOURCE}, {@link #CPE_LIBRARY} or {@link #CPE_PROJECT} + * classpath entries. + * <p> + * Any classpath entry other than a source folder (kind {@link #CPE_SOURCE}) can + * be marked as being exported. Exported entries are automatically contributed to + * dependent projects, along with the project's default output folder, which is + * implicitly exported, and any auxiliary output folders specified on source + * classpath entries. The project's output folder(s) are always listed first, + * followed by the any exported entries. + * <p> + * Classpath entries can be created via methods on {@link JavaCore}. + * </p> + * + * @see JavaCore#newLibraryEntry(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath) + * @see JavaCore#newProjectEntry(org.eclipse.core.runtime.IPath) + * @see JavaCore#newSourceEntry(org.eclipse.core.runtime.IPath) + * @see JavaCore#newVariableEntry(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath) + * @see JavaCore#newContainerEntry(org.eclipse.core.runtime.IPath) + * @see ClasspathVariableInitializer + * @see ClasspathContainerInitializer + * @noimplement This interface is not intended to be implemented by clients. + + + + + + * Entry kind constant describing a classpath entry identifying a + * library. A library is a folder or JAR containing package + * fragments consisting of pre-compiled binaries. + + + + + + + * Entry kind constant describing a classpath entry identifying a + * required project. + + + + + + + * Entry kind constant describing a classpath entry identifying a + * folder containing package fragments with source code + * to be compiled. + + + + + + + * Entry kind constant describing a classpath entry defined using + * a path that begins with a classpath variable reference. + + + + + + + * Entry kind constant describing a classpath entry representing + * a name classpath container. + * + * @since 2.0 + + + + + + + * Returns whether the access rules of the project's exported entries should be combined with this entry's access rules. + * Returns true for container entries. + * Returns false otherwise. + * + * @return whether the access rules of the project's exported entries should be combined with this entry's access rules + * @since 3.1 + + + + + + + + * Returns the possibly empty list of access rules for this entry. + * + * @return the possibly empty list of access rules for this entry + * @since 3.1 + + + + + + + + + + + * Returns the kind of files found in the package fragments identified by this + * classpath entry. + * + * @return {@link IPackageFragmentRoot#K_SOURCE} for files containing + * source code, and {@link IPackageFragmentRoot#K_BINARY} for binary + * class files. + * There is no specified value for an entry denoting a variable ({@link #CPE_VARIABLE}) + * or a classpath container ({@link #CPE_CONTAINER}). + + + + + + + + * Returns the kind of this classpath entry. + * + * @return one of: + * <ul> + * <li>{@link #CPE_SOURCE} - this entry describes a source root in + its project + * <li>{@link #CPE_LIBRARY} - this entry describes a folder or JAR + containing binaries + * <li>{@link #CPE_PROJECT} - this entry describes another project + * + * <li>{@link #CPE_VARIABLE} - this entry describes a project or library + * indirectly via a classpath variable in the first segment of the path + * * + * <li>{@link #CPE_CONTAINER} - this entry describes set of entries + * referenced indirectly via a classpath container + * </ul> + + + + + + + + * Returns the set of patterns used to exclude resources or classes associated with + * this classpath entry. + * <p> + * For source classpath entries, + * exclusion patterns allow specified portions of the resource tree rooted + * at this source entry's path to be filtered out. If no exclusion patterns + * are specified, this source entry includes all relevent files. Each path + * specified must be a relative path, and will be interpreted relative + * to this source entry's path. File patterns are case-sensitive. A file + * matched by one or more of these patterns is excluded from the + * corresponding package fragment root. + * Exclusion patterns have higher precedence than inclusion patterns; + * in other words, exclusion patterns can remove files for the ones that + * are to be included, not the other way around. + * </p> + * <p> + * Note that there is no need to supply a pattern to exclude ".class" files + * because a source entry filters these out automatically. + * </p> + * <p> + * The pattern mechanism is similar to Ant's. Each pattern is represented as + * a relative path. The path segments can be regular file or folder names or simple patterns + * involving standard wildcard characters. + * </p> + * <p> + * '*' matches 0 or more characters within a segment. So + * <code>*.java</code> matches <code>.java</code>, <code>a.java</code> + * and <code>Foo.java</code>, but not <code>Foo.properties</code> + * (does not end with <code>.java</code>). + * </p> + * <p> + * '?' matches 1 character within a segment. So <code>?.java</code> + * matches <code>a.java</code>, <code>A.java</code>, + * but not <code>.java</code> or <code>xyz.java</code> (neither have + * just one character before <code>.java</code>). + * </p> + * <p> + * Combinations of *'s and ?'s are allowed. + * </p> + * <p> + * The special pattern '**' matches zero or more segments. In a source entry, + * a path like <code>tests/</code> that ends in a trailing separator is interpreted + * as <code>tests/&#42;&#42;</code>, and would match everything under + * the folder named <code>tests</code>. + * </p> + * <p> + * Example patterns in source entries (assuming that "java" is the only {@link JavaCore#getJavaLikeExtensions() Java-like extension}): + * <ul> + * <li> + * <code>tests/&#42;&#42;</code> (or simply <code>tests/</code>) + * matches all files under a root folder + * named <code>tests</code>. This includes <code>tests/Foo.java</code> + * and <code>tests/com/example/Foo.java</code>, but not + * <code>com/example/tests/Foo.java</code> (not under a root folder named + * <code>tests</code>). + * </li> + * <li> + * <code>tests/&#42;</code> matches all files directly below a root + * folder named <code>tests</code>. This includes <code>tests/Foo.java</code> + * and <code>tests/FooHelp.java</code> + * but not <code>tests/com/example/Foo.java</code> (not directly under + * a folder named <code>tests</code>) or + * <code>com/Foo.java</code> (not under a folder named <code>tests</code>). + * </li> + * <li> + * <code>&#42;&#42;/tests/&#42;&#42;</code> matches all files under any + * folder named <code>tests</code>. This includes <code>tests/Foo.java</code>, + * <code>com/examples/tests/Foo.java</code>, and + * <code>com/examples/tests/unit/Foo.java</code>, but not + * <code>com/example/Foo.java</code> (not under a folder named + * <code>tests</code>). + * </li> + * </ul> + * </p> + * + * @return the possibly empty list of resource exclusion patterns + * associated with this classpath entry, or <code>null</code> if this kind + * of classpath entry does not support exclusion patterns + * @since 2.1 + + + + + + + + + + + * Returns the extra classpath attributes for this classpath entry. Returns an empty array if this entry + * has no extra attributes. + * + * @return the possibly empty list of extra classpath attributes for this classpath entry + * @since 3.1 + + + + + + + + + + + * Returns the set of patterns used to explicitly define resources or classes + * to be included with this classpath entry. + * <p> + * For source classpath entries, + * when no inclusion patterns are specified, the source entry includes all + * relevent files in the resource tree rooted at this source entry's path. + * Specifying one or more inclusion patterns means that only the specified + * portions of the resource tree are to be included. Each path specified + * must be a relative path, and will be interpreted relative to this source + * entry's path. File patterns are case-sensitive. A file matched by one or + * more of these patterns is included in the corresponding package fragment + * root unless it is excluded by one or more of this entrie's exclusion + * patterns. Exclusion patterns have higher precedence than inclusion + * patterns; in other words, exclusion patterns can remove files for the + * ones that are to be included, not the other way around. + * </p> + * <p> + * See {@link #getExclusionPatterns()} for a discussion of the syntax and + * semantics of path patterns. The absence of any inclusion patterns is + * semantically equivalent to the explicit inclusion pattern + * <code>&#42;&#42;</code>. + * </p> + * <p> + * Example patterns in source entries: + * <ul> + * <li> + * The inclusion pattern <code>src/&#42;&#42;</code> by itself includes all + * files under a root folder named <code>src</code>. + * </li> + * <li> + * The inclusion patterns <code>src/&#42;&#42;</code> and + * <code>tests/&#42;&#42;</code> includes all files under the root folders + * named <code>src</code> and <code>tests</code>. + * </li> + * <li> + * The inclusion pattern <code>src/&#42;&#42;</code> together with the + * exclusion pattern <code>src/&#42;&#42;/Foo.java</code> includes all + * files under a root folder named <code>src</code> except for ones + * named <code>Foo.java</code>. + * </li> + * </ul> + * </p> + * + * @return the possibly empty list of resource inclusion patterns + * associated with this classpath entry, or <code>null</code> if this kind + * of classpath entry does not support inclusion patterns + * @since 3.0 + + + + + + + + + + + * Returns the full path to the specific location where the builder writes + * <code>.class</code> files generated for this source entry + * (entry kind {@link #CPE_SOURCE}). + * <p> + * Source entries can optionally be associated with a specific output location. + * If none is provided, the source entry will be implicitly associated with its project + * default output location (see {@link IJavaProject#getOutputLocation}). + * </p><p> + * NOTE: A specific output location cannot coincidate with another source/library entry. + * </p> + * + * @return the full path to the specific location where the builder writes + * <code>.class</code> files for this source entry, or <code>null</code> + * if using default output folder + * @since 2.1 + + + + + + + + * Returns the path of this classpath entry. + * + * The meaning of the path of a classpath entry depends on its entry kind:<ul> + * <li>Source code in the current project ({@link #CPE_SOURCE}) - + * The path associated with this entry is the absolute path to the root folder. </li> + * <li>A binary library in the current project ({@link #CPE_LIBRARY}) - the path + * associated with this entry is the absolute path to the JAR (or root folder), and + * in case it refers to an external library, then there is no associated resource in + * the workbench. + * <li>A required project ({@link #CPE_PROJECT}) - the path of the entry denotes the + * path to the corresponding project resource.</li> + * <li>A variable entry ({@link #CPE_VARIABLE}) - the first segment of the path + * is the name of a classpath variable. If this classpath variable + * is bound to the path <i>P</i>, the path of the corresponding classpath entry + * is computed by appending to <i>P</i> the segments of the returned + * path without the variable.</li> + * <li> A container entry ({@link #CPE_CONTAINER}) - the path of the entry + * is the name of the classpath container, which can be bound indirectly to a set of classpath + * entries after resolution. The containerPath is a formed by a first ID segment followed with + * extra segments that can be used as additional hints for resolving this container + * reference (also see {@link IClasspathContainer}). + * </li> + * </ul> + * + * @return the path of this classpath entry + + + + + + + + * Returns the path to the source archive or folder associated with this + * classpath entry, or <code>null</code> if this classpath entry has no + * source attachment. + * <p> + * Only library and variable classpath entries may have source attachments. + * For library classpath entries, the result path (if present) locates a source + * archive or folder. This archive or folder can be located in a project of the + * workspace or outside the workspace. For variable classpath entries, the + * result path (if present) has an analogous form and meaning as the + * variable path, namely the first segment is the name of a classpath variable. + * </p> + * + * @return the path to the source archive or folder, or <code>null</code> if none + + + + + + + + * Returns the path within the source archive or folder where package fragments + * are located. An empty path indicates that packages are located at + * the root of the source archive or folder. Returns a non-<code>null</code> value + * if and only if {@link #getSourceAttachmentPath} returns + * a non-<code>null</code> value. + * + * @return the path within the source archive or folder, or <code>null</code> if + * not applicable + + + + + + + + * Returns the classpath entry that is making a reference to this classpath entry. For entry kinds + * {@link #CPE_LIBRARY}, the return value is the entry that is representing the JAR that includes + * <code>this</code> in the MANIFEST.MF file's Class-Path section. For entry kinds other than + * {@link #CPE_LIBRARY}, this returns <code>null</code>. For those entries that are on the raw classpath already, + * this returns <code>null</code>. + * <p> + * It is possible that multiple library entries refer to the same entry + * via the MANIFEST.MF file. In those cases, this method returns the first classpath entry + * that appears in the raw classpath. However, this does not mean that the other referencing + * entries do not relate to their referenced entries. + * See {@link JavaCore#getReferencedClasspathEntries(IClasspathEntry, IJavaProject)} for + * more details. + * </p> + * + * @return the classpath entry that is referencing this entry or <code>null</code> if + * not applicable. + * @since 3.6 + + + + + + + + * Returns whether this entry is exported to dependent projects. + * Always returns <code>false</code> for source entries (kind + * {@link #CPE_SOURCE}), which cannot be exported. + * + * @return <code>true</code> if exported, and <code>false</code> otherwise + * @since 2.0 + + + + + + + + * This is a helper method, which returns the resolved classpath entry denoted + * by an entry (if it is a variable entry). It is obtained by resolving the variable + * reference in the first segment. Returns <code>null</code> if unable to resolve using + * the following algorithm: + * <ul> + * <li> if variable segment cannot be resolved, returns <code>null</code></li> + * <li> finds a project, JAR or binary folder in the workspace at the resolved path location</li> + * <li> if none finds an external JAR file or folder outside the workspace at the resolved path location </li> + * <li> if none returns <code>null</code></li> + * </ul> + * <p> + * Variable source attachment is also resolved and recorded in the resulting classpath entry. + * <p> + * @return the resolved library or project classpath entry, or <code>null</code> + * if the given path could not be resolved to a classpath entry + * <p> + * Note that this deprecated API doesn't handle CPE_CONTAINER entries. + * + * @deprecated Use {@link JavaCore#getResolvedClasspathEntry(IClasspathEntry)} instead + + + + + + + + + * Common protocol for Java elements that support source code assist and code + * resolve. + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + * A completion requestor accepts results as they are computed and is aware + * of source positions to complete the various different results. + * <p> + * This interface may be implemented by clients. + * </p> + * + * @see ICodeAssist + * @deprecated Use {@link CompletionRequestor} instead. + + + + + + * Code assist notification of a class completion. + * + * @param packageName Declaring package name of the class. + * @param className Name of the class. + * @param completionName The completion for the class. + * Can include ';' for imported classes. + * @param modifiers The modifiers of the class. + * @param completionStart The start position of insertion of the name of the class. + * @param completionEnd The end position of insertion of the name of the class. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + + + + + + + + + + + + + + + + + + + + + + * Code assist notification of a compilation error detected during completion. + * @param marker Only problems which are categorized as errors are notified to the requestor, + * warnings are silently ignored. + * In case an error got signaled, no other completions might be available, + * therefore the problem message should be presented to the user. + * The source positions of the problem are related to the source where it was + * detected (might be in another compilation unit, if it was indirectly requested + * during the code assist process). + * Note: the problem knows its originating file name. + + + + + + + + * Code assist notification of a field completion. + * + * @param declaringTypePackageName Name of the package in which the type that contains this field is declared. + * + * @param declaringTypeName Name of the type declaring this new field. + * + * @param name Name of the field. + * + * @param typePackageName Name of the package in which the type of this field is declared. + * + * @param typeName Name of the type of this field. + * + * @param completionName The completion for the field. + * + * @param modifiers The modifiers of this field. + * + * @param completionStart The start position of insertion of the name of this field. + * + * @param completionEnd The end position of insertion of the name of this field. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Base types are in the form "int" or "boolean". + * Array types are in the qualified form "M[]" or "int[]". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Code assist notification of an interface completion. + * + * @param packageName Declaring package name of the interface. + * @param interfaceName Name of the interface. + * @param completionName The completion for the interface. + * Can include ';' for imported interfaces. + * @param modifiers The modifiers of the interface. + * @param completionStart The start position of insertion of the name of the interface. + * @param completionEnd The end position of insertion of the name of the interface. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + + + + + + + + + + + + + + + + + + + + + + * Code assist notification of a keyword completion. + * + * @param keywordName The keyword source. + * @param completionStart The start position of insertion of the name of this keyword. + * @param completionEnd The end position of insertion of the name of this keyword. + + + + + + + + + + + + + * Code assist notification of a label completion. + * + * @param labelName The label source. + * @param completionStart The start position of insertion of the name of this label. + * @param completionEnd The end position of insertion of the name of this label. + + + + + + + + + + + + + * Code assist notification of a local variable completion. + * + * @param name Name of the new local variable. + * + * @param typePackageName Name of the package in which the type of this new local variable is declared. + * + * @param typeName Name of the type of this new local variable. + * + * @param modifiers The modifiers of this new local variable. + * + * @param completionStart The start position of insertion of the name of this new local variable. + * + * @param completionEnd The end position of insertion of the name of this new local variable. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Base types are in the form "int" or "boolean". + * Array types are in the qualified form "M[]" or "int[]". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + + + + + + + + + + + + + + + + + + + + + + * Code assist notification of a method completion. + * + * @param declaringTypePackageName Name of the package in which the type that contains this new method is declared. + * + * @param declaringTypeName Name of the type declaring this new method. + * + * @param selector Name of the new method. + * + * @param parameterPackageNames Names of the packages in which the parameter types are declared. + * Should contain as many elements as parameterTypeNames. + * + * @param parameterTypeNames Names of the parameters types. + * Should contain as many elements as parameterPackageNames. + * + * @param returnTypePackageName Name of the package in which the return type is declared. + * + * @param returnTypeName Name of the return type of this new method, should be <code>null</code> for a constructor. + * + * @param completionName The completion for the method. + * Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it. + * + * @param modifiers The modifiers of this new method. + * + * @param completionStart The start position of insertion of the name of this new method. + * + * @param completionEnd The end position of insertion of the name of this new method. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Base types are in the form "int" or "boolean". + * Array types are in the qualified form "M[]" or "int[]". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + * + * NOTE: parameter names can be retrieved from the source model after the user selects a specific method. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Code assist notification of a modifier completion. + * + * @param modifierName The new modifier. + * @param completionStart The start position of insertion of the name of this new modifier. + * @param completionEnd The end position of insertion of the name of this new modifier. + + + + + + + + + + + + + * Code assist notification of a package completion. + * + * @param packageName The package name. + * @param completionName The completion for the package. + * Can include '.*;' for imports. + * @param completionStart The start position of insertion of the name of this new package. + * @param completionEnd The end position of insertion of the name of this new package. + * + * NOTE - All package names are presented in their readable form: + * Package names are in the form "a.b.c". + * The default package is represented by an empty array. + + + + + + + + + + + + + + + + + * Code assist notification of a type completion. + * + * @param packageName Declaring package name of the type. + * @param typeName Name of the type. + * @param completionName The completion for the type. + * Can include ';' for imported types. + * @param completionStart The start position of insertion of the name of the type. + * @param completionEnd The end position of insertion of the name of the type. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + + + + + + + + + + + + + + + + + + + + + + * Specification for a generic source code formatter. Client plug-ins can contribute + * an implementation for an ICodeFormatter, through the extension point "org.eclipse.jdt.core.codeFormatter". + * In case none is found, a default formatter can be provided through the ToolFactory. + * + * @see ToolFactory#createCodeFormatter() + * @see ToolFactory#createDefaultCodeFormatter(java.util.Map options) + * @since 2.0 + * @deprecated Use {@link org.eclipse.jdt.core.formatter.CodeFormatter} instead (note: options have changed) + + + + + + * Formats the String <code>sourceString</code>, + * and returns a string containing the formatted version. + * + * @param string the string to format + * @param indentationLevel the initial indentation level, used + * to shift left/right the entire source fragment. An initial indentation + * level of zero has no effect. + * @param positions an array of positions to map. These are + * character-based source positions inside the original source, + * arranged in non-decreasing order, for which corresponding positions in + * the formatted source will be computed (so as to relocate elements associated + * with the original source). It updates the positions array with updated + * positions. If set to <code>null</code>, then no positions are mapped. + * @param lineSeparator the line separator to use in formatted source, + * if set to <code>null</code>, then the platform default one will be used. + * @return the formatted output string. + + + + + + + + + + + + + + + + * Represents an entire Java compilation unit (source file with one of the + * {@link JavaCore#getJavaLikeExtensions() Java-like extensions}). + * Compilation unit elements need to be opened before they can be navigated or manipulated. + * The children are of type {@link IPackageDeclaration}, + * {@link IImportContainer}, and {@link IType}, + * and appear in the order in which they are declared in the source. + * If a source file cannot be parsed, its structure remains unknown. + * Use {@link IJavaElement#isStructureKnown} to determine whether this is + * the case. + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + + * Constant indicating that a reconcile operation should not return an AST. + * @since 3.0 + + + + + + + * Constant indicating that a reconcile operation should recompute the problems + * even if the source hasn't changed. + * @since 3.3 + + + + + + + * Constant indicating that a reconcile operation should enable the statements recovery. + * @see ASTParser#setStatementsRecovery(boolean) + * @since 3.3 + + + + + + + * Constant indicating that a reconcile operation should enable the bindings recovery + * @see ASTParser#setBindingsRecovery(boolean) + * @see IBinding#isRecovered() + * @since 3.3 + + + + + + + * Constant indicating that a reconcile operation could ignore to parse the method bodies. + * @see ASTParser#setIgnoreMethodBodies(boolean) + * @since 3.5.2 + + + + + + + * Applies a text edit to the compilation unit's buffer. + * <p> + * Note that the edit is simply applied to the compilation unit's buffer. + * In particular the undo edit is not grouped with previous undo edits + * if the buffer doesn't implement {@link IBuffer.ITextEditCapability}. + * If it does, the exact semantics for grouping undo edit depends + * on how {@link IBuffer.ITextEditCapability#applyTextEdit(TextEdit, IProgressMonitor)} + * is implemented. + * </p> + * + * @param edit the edit to apply + * @param monitor the progress monitor to use or <code>null</code> if no progress should be reported + * @return the undo edit + * @throws JavaModelException if this edit can not be applied to the compilation unit's buffer. Reasons include: + * <ul> + * <li>This compilation unit does not exist ({@link IJavaModelStatusConstants#ELEMENT_DOES_NOT_EXIST}).</li> + * <li>The provided edit can not be applied as there is a problem with the text edit locations ({@link IJavaModelStatusConstants#BAD_TEXT_EDIT_LOCATION}).</li> + * </ul> + * + * @since 3.4 + + + + + + + + + + * Changes this compilation unit handle into a working copy. A new {@link IBuffer} is + * created using this compilation unit handle's owner. Uses the primary owner if none was + * specified when this compilation unit handle was created. + * <p> + * When switching to working copy mode, problems are reported to given + * {@link IProblemRequestor}. Note that once in working copy mode, the given + * {@link IProblemRequestor} is ignored. Only the original {@link IProblemRequestor} + * is used to report subsequent problems. + * </p> + * <p> + * Once in working copy mode, changes to this compilation unit or its children are done in memory. + * Only the new buffer is affected. Using {@link #commitWorkingCopy(boolean, IProgressMonitor)} + * will bring the underlying resource in sync with this compilation unit. + * </p> + * <p> + * If this compilation unit was already in working copy mode, an internal counter is incremented and no + * other action is taken on this compilation unit. To bring this compilation unit back into the original mode + * (where it reflects the underlying resource), {@link #discardWorkingCopy} must be call as many + * times as {@link #becomeWorkingCopy(IProblemRequestor, IProgressMonitor)}. + * </p> + * + * @param problemRequestor a requestor which will get notified of problems detected during + * reconciling as they are discovered. The requestor can be set to <code>null</code> indicating + * that the client is not interested in problems. + * @param monitor a progress monitor used to report progress while opening this compilation unit + * or <code>null</code> if no progress should be reported + * @throws JavaModelException if this compilation unit could not become a working copy. + * @see #discardWorkingCopy() + * @since 3.0 + * + * @deprecated Use {@link #becomeWorkingCopy(IProgressMonitor)} instead. + * Note that if this deprecated method is used, problems will be reported to the given problem requestor + * as well as the problem requestor returned by the working copy owner (if not null). + + + + + + + + + * Changes this compilation unit handle into a working copy. A new {@link IBuffer} is + * created using this compilation unit handle's owner. Uses the primary owner if none was + * specified when this compilation unit handle was created. + * <p> + * When switching to working copy mode, problems are reported to the {@link IProblemRequestor + * problem requestor} of the {@link WorkingCopyOwner working copy owner}. + * </p><p> + * Once in working copy mode, changes to this compilation unit or its children are done in memory. + * Only the new buffer is affected. Using {@link #commitWorkingCopy(boolean, IProgressMonitor)} + * will bring the underlying resource in sync with this compilation unit. + * </p><p> + * If this compilation unit was already in working copy mode, an internal counter is incremented and no + * other action is taken on this compilation unit. To bring this compilation unit back into the original mode + * (where it reflects the underlying resource), {@link #discardWorkingCopy} must be call as many + * times as {@link #becomeWorkingCopy(IProblemRequestor, IProgressMonitor)}. + * </p> + * + * @param monitor a progress monitor used to report progress while opening this compilation unit + * or <code>null</code> if no progress should be reported + * @throws JavaModelException if this compilation unit could not become a working copy. + * @see #discardWorkingCopy() + * @since 3.3 + + + + + + + + * Commits the contents of this working copy to its underlying resource. + * + * <p>It is possible that the contents of the original resource have changed + * since this working copy was created, in which case there is an update conflict. + * The value of the <code>force</code> parameter affects the resolution of + * such a conflict:<ul> + * <li> <code>true</code> - in this case the contents of this working copy are applied to + * the underlying resource even though this working copy was created before + * a subsequent change in the resource</li> + * <li> <code>false</code> - in this case a {@link JavaModelException} is thrown</li> + * </ul> + * <p> + * Since 2.1, a working copy can be created on a not-yet existing compilation + * unit. In particular, such a working copy can then be committed in order to create + * the corresponding compilation unit. + * </p> + * @param force a flag to handle the cases when the contents of the original resource have changed + * since this working copy was created + * @param monitor the given progress monitor + * @throws JavaModelException if this working copy could not commit. Reasons include: + * <ul> + * <li> A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource + * <li> This element is not a working copy (INVALID_ELEMENT_TYPES) + * <li> A update conflict (described above) (UPDATE_CONFLICT) + * </ul> + * @since 3.0 + + + + + + + + + * Creates and returns an non-static import declaration in this compilation unit + * with the given name. This method is equivalent to + * <code>createImport(name, Flags.AccDefault, sibling, monitor)</code>. + * + * @param name the name of the import declaration to add as defined by JLS2 7.5. (For example: <code>"java.io.File"</code> or + * <code>"java.awt.*"</code>) + * @param sibling the existing element which the import declaration will be inserted immediately before (if + * <code> null </code>, then this import will be inserted as the last import declaration. + * @param monitor the progress monitor to notify + * @return the newly inserted import declaration (or the previously existing one in case attempting to create a duplicate) + * + * @throws JavaModelException if the element could not be created. Reasons include: + * <ul> + * <li> This Java element does not exist or the specified sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource + * <li> The specified sibling is not a child of this compilation unit (INVALID_SIBLING) + * <li> The name is not a valid import name (INVALID_NAME) + * </ul> + * @see #createImport(String, IJavaElement, int, IProgressMonitor) + + + + + + + + + + + * Creates and returns an import declaration in this compilation unit + * with the given name. + * <p> + * Optionally, the new element can be positioned before the specified + * sibling. If no sibling is specified, the element will be inserted + * as the last import declaration in this compilation unit. + * <p> + * If the compilation unit already includes the specified import declaration, + * the import is not generated (it does not generate duplicates). + * Note that it is valid to specify both a single-type import and an on-demand import + * for the same package, for example <code>"java.io.File"</code> and + * <code>"java.io.*"</code>, in which case both are preserved since the semantics + * of this are not the same as just importing <code>"java.io.*"</code>. + * Importing <code>"java.lang.*"</code>, or the package in which the compilation unit + * is defined, are not treated as special cases. If they are specified, they are + * included in the result. + * <p> + * Note: This API element is only needed for dealing with Java code that uses + * new language features of J2SE 5.0. + * </p> + * + * @param name the name of the import declaration to add as defined by JLS2 7.5. (For example: <code>"java.io.File"</code> or + * <code>"java.awt.*"</code>) + * @param sibling the existing element which the import declaration will be inserted immediately before (if + * <code> null </code>, then this import will be inserted as the last import declaration. + * @param flags {@link Flags#AccStatic} for static imports, or + * {@link Flags#AccDefault} for regular imports; other modifier flags + * are ignored + * @param monitor the progress monitor to notify + * @return the newly inserted import declaration (or the previously existing one in case attempting to create a duplicate) + * + * @throws JavaModelException if the element could not be created. Reasons include: + * <ul> + * <li> This Java element does not exist or the specified sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource + * <li> The specified sibling is not a child of this compilation unit (INVALID_SIBLING) + * <li> The name is not a valid import name (INVALID_NAME) + * </ul> + * @see Flags + * @since 3.0 + + + + + + + + + + + + * Creates and returns a package declaration in this compilation unit + * with the given package name. + * + * <p>If the compilation unit already includes the specified package declaration, + * it is not generated (it does not generate duplicates). + * + * @param name the name of the package declaration to add as defined by JLS2 7.4. (For example, <code>"java.lang"</code>) + * @param monitor the progress monitor to notify + * @return the newly inserted package declaration (or the previously existing one in case attempting to create a duplicate) + * + * @throws JavaModelException if the element could not be created. Reasons include: + * <ul> + * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource + * <li> The name is not a valid package name (INVALID_NAME) + * </ul> + + + + + + + + + + * Creates and returns a type in this compilation unit with the + * given contents. If this compilation unit does not exist, one + * will be created with an appropriate package declaration. + * <p> + * Optionally, the new type can be positioned before the specified + * sibling. If <code>sibling</code> is <code>null</code>, the type will be appended + * to the end of this compilation unit. + * + * <p>It is possible that a type with the same name already exists in this compilation unit. + * The value of the <code>force</code> parameter affects the resolution of + * such a conflict:<ul> + * <li> <code>true</code> - in this case the type is created with the new contents</li> + * <li> <code>false</code> - in this case a {@link JavaModelException} is thrown</li> + * </ul> + * + * @param contents the source contents of the type declaration to add. + * @param sibling the existing element which the type will be inserted immediately before (if + * <code>null</code>, then this type will be inserted as the last type declaration. + * @param force a <code>boolean</code> flag indicating how to deal with duplicates + * @param monitor the progress monitor to notify + * @return the newly inserted type + * + * @throws JavaModelException if the element could not be created. Reasons include: + * <ul> + * <li>The specified sibling element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A {@link org.eclipse.core.runtime.CoreException} occurred while updating an underlying resource + * <li> The specified sibling is not a child of this compilation unit (INVALID_SIBLING) + * <li> The contents could not be recognized as a type declaration (INVALID_CONTENTS) + * <li> There was a naming collision with an existing type (NAME_COLLISION) + * </ul> + + + + + + + + + + + + * Changes this compilation unit in working copy mode back to its original mode. + * <p> + * This has no effect if this compilation unit was not in working copy mode. + * </p> + * <p> + * If {@link #becomeWorkingCopy(IProgressMonitor)} method was called several + * times on this compilation unit, {@link #discardWorkingCopy()} must be called + * as many times before it switches back to the original mode. Same as + * for method {@link #getWorkingCopy(IProgressMonitor)}. + * </p> + * + * @throws JavaModelException if this working copy could not return in its original mode. + * @see #becomeWorkingCopy(IProblemRequestor, IProgressMonitor) + * @since 3.0 + + + + + + + * Finds the elements in this compilation unit that correspond to + * the given element. + * An element A corresponds to an element B if: + * <ul> + * <li>A has the same element name as B. + * <li>If A is a method, A must have the same number of arguments as + * B and the simple names of the argument types must be equals. + * <li>The parent of A corresponds to the parent of B recursively up to + * their respective compilation units. + * <li>A exists. + * </ul> + * Returns <code>null</code> if no such java elements can be found + * or if the given element is not included in a compilation unit. + * + * @param element the given element + * @return the found elements in this compilation unit that correspond to the given element + * @since 3.0 + + + + + + + + + + + + * Finds the working copy for this compilation unit, given a {@link WorkingCopyOwner}. + * If no working copy has been created for this compilation unit associated with this + * working copy owner, returns <code>null</code>. + * <p> + * Users of this method must not destroy the resulting working copy. + * + * @param owner the given {@link WorkingCopyOwner} + * @return the found working copy for this compilation unit, <code>null</code> if none + * @see WorkingCopyOwner + * @since 3.0 + + + + + + + + + * Returns all types declared in this compilation unit in the order + * in which they appear in the source. + * This includes all top-level types and nested member types. + * It does NOT include local types (types defined in methods). + * + * @return the array of top-level and member types defined in a compilation unit, in declaration order. + * @throws JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + + + + * Returns the first import declaration in this compilation unit with the given name. + * This is a handle-only method. The import declaration may or may not exist. This + * is a convenience method - imports can also be accessed from a compilation unit's + * import container. + * + * @param name the name of the import to find as defined by JLS2 7.5. (For example: <code>"java.io.File"</code> + * or <code>"java.awt.*"</code>) + * @return a handle onto the corresponding import declaration. The import declaration may or may not exist. + + + + + + + + + * Returns the import container for this compilation unit. + * This is a handle-only method. The import container may or + * may not exist. The import container can used to access the + * imports. + * @return a handle onto the corresponding import container. The + * import contain may or may not exist. + + + + + + + + * Returns the import declarations in this compilation unit + * in the order in which they appear in the source. This is + * a convenience method - import declarations can also be + * accessed from a compilation unit's import container. + * + * @return the import declarations in this compilation unit + * @throws JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + + + + * Returns the primary compilation unit (whose owner is the primary owner) + * this working copy was created from, or this compilation unit if this a primary + * compilation unit. + * <p> + * Note that the returned primary compilation unit can be in working copy mode. + * </p> + * + * @return the primary compilation unit this working copy was created from, + * or this compilation unit if it is primary + * @since 3.0 + + + + + + + + * Returns <tt>null</tt> if this <code>ICompilationUnit</code> is the primary + * working copy, or this <code>ICompilationUnit</code> is not a working copy, + * otherwise the <code>WorkingCopyOwner</code> + * + * @return <tt>null</tt> if this <code>ICompilationUnit</code> is the primary + * working copy, or this <code>ICompilationUnit</code> is not a working copy, + * otherwise the <code>WorkingCopyOwner</code> + * @since 3.0 + + + + + + + + * Returns the first package declaration in this compilation unit with the given package name + * (there normally is at most one package declaration). + * This is a handle-only method. The package declaration may or may not exist. + * + * @param name the name of the package declaration as defined by JLS2 7.4. (For example, <code>"java.lang"</code>) + * @return the first package declaration in this compilation unit with the given package name + + + + + + + + + * Returns the package declarations in this compilation unit + * in the order in which they appear in the source. + * There normally is at most one package declaration. + * + * @return an array of package declaration (normally of size one) + * + * @throws JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + + + + * Returns the top-level type declared in this compilation unit with the given simple type name. + * The type name has to be a valid compilation unit name. + * This is a handle-only method. The type may or may not exist. + * + * @param name the simple name of the requested type in the compilation unit + * @return a handle onto the corresponding type. The type may or may not exist. + * @see JavaConventions#validateCompilationUnitName(String name, String sourceLevel, String complianceLevel) + + + + + + + + + * Returns the top-level types declared in this compilation unit + * in the order in which they appear in the source. + * + * @return the top-level types declared in this compilation unit + * @throws JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + + + + * Returns a new working copy of this compilation unit if it is a primary compilation unit, + * or this compilation unit if it is already a non-primary working copy. + * <p> + * Note: if intending to share a working copy amongst several clients, then + * {@link #getWorkingCopy(WorkingCopyOwner, IProblemRequestor, IProgressMonitor)} + * should be used instead. + * </p><p> + * When the working copy instance is created, an ADDED IJavaElementDelta is + * reported on this working copy. + * </p><p> + * Once done with the working copy, users of this method must discard it using + * {@link #discardWorkingCopy()}. + * </p><p> + * Since 2.1, a working copy can be created on a not-yet existing compilation + * unit. In particular, such a working copy can then be committed in order to create + * the corresponding compilation unit. + * </p> + * @param monitor a progress monitor used to report progress while opening this compilation unit + * or <code>null</code> if no progress should be reported + * @throws JavaModelException if the contents of this element can + * not be determined. + * @return a new working copy of this element if this element is not + * a working copy, or this element if this element is already a working copy + * @since 3.0 + + + + + + + + + * Returns a shared working copy on this compilation unit using the given working copy owner to create + * the buffer, or this compilation unit if it is already a non-primary working copy. + * This API can only answer an already existing working copy if it is based on the same + * original compilation unit AND was using the same working copy owner (that is, as defined by {@link Object#equals}). + * <p> + * The life time of a shared working copy is as follows: + * <ul> + * <li>The first call to {@link #getWorkingCopy(WorkingCopyOwner, IProblemRequestor, IProgressMonitor)} + * creates a new working copy for this element</li> + * <li>Subsequent calls increment an internal counter.</li> + * <li>A call to {@link #discardWorkingCopy()} decrements the internal counter.</li> + * <li>When this counter is 0, the working copy is discarded. + * </ul> + * So users of this method must discard exactly once the working copy. + * <p> + * Note that the working copy owner will be used for the life time of this working copy, that is if the + * working copy is closed then reopened, this owner will be used. + * The buffer will be automatically initialized with the original's compilation unit content + * upon creation. + * <p> + * When the shared working copy instance is created, an ADDED IJavaElementDelta is reported on this + * working copy. + * </p><p> + * Since 2.1, a working copy can be created on a not-yet existing compilation + * unit. In particular, such a working copy can then be committed in order to create + * the corresponding compilation unit. + * </p> + * @param owner the working copy owner that creates a buffer that is used to get the content + * of the working copy + * @param problemRequestor a requestor which will get notified of problems detected during + * reconciling as they are discovered. The requestor can be set to <code>null</code> indicating + * that the client is not interested in problems. + * @param monitor a progress monitor used to report progress while opening this compilation unit + * or <code>null</code> if no progress should be reported + * @throws JavaModelException if the contents of this element can + * not be determined. + * @return a new working copy of this element using the given factory to create + * the buffer, or this element if this element is already a working copy + * @since 3.0 + * @deprecated Use {@link ITypeRoot#getWorkingCopy(WorkingCopyOwner, IProgressMonitor)} instead. + * Note that if this deprecated method is used, problems will be reported on the passed problem requester + * as well as on the problem requestor returned by the working copy owner (if not null). + + + + + + + + + + + * Returns whether the resource of this working copy has changed since the + * inception of this working copy. + * Returns <code>false</code> if this compilation unit is not in working copy mode. + * + * @return whether the resource has changed + * @since 3.0 + + + + + + + + * Returns whether this element is a working copy. + * + * @return true if this element is a working copy, false otherwise + * @since 3.0 + + + + + + + + * Reconciles the contents of this working copy, sends out a Java delta + * notification indicating the nature of the change of the working copy since + * the last time it was either reconciled or made consistent + * ({@link IOpenable#makeConsistent(IProgressMonitor)}), and returns a + * compilation unit AST if requested. + * <p> + * It performs the reconciliation by locally caching the contents of + * the working copy, updating the contents, then creating a delta + * over the cached contents and the new contents, and finally firing + * this delta. + * <p> + * The boolean argument allows to force problem detection even if the + * working copy is already consistent. + * </p> + * <p> + * This functionality allows to specify a working copy owner which is used + * during problem detection. All references contained in the working copy are + * resolved against other units; for which corresponding owned working copies + * are going to take precedence over their original compilation units. If + * <code>null</code> is passed in, then the primary working copy owner is used. + * </p> + * <p> + * Compilation problems found in the new contents are notified through the + * {@link IProblemRequestor} interface which was passed at + * creation, and no longer as transient markers. + * </p> + * <p> + * Note: Since 3.0, added/removed/changed inner types generate change deltas. + * </p> + * <p> + * If requested, a DOM AST representing the compilation unit is returned. + * Its bindings are computed only if the problem requestor is active. + * This method returns <code>null</code> if the creation of the DOM AST was not requested, + * or if the requested level of AST API is not supported, or if the working copy was + * already consistent. + * </p> + * + * <p> + * This method doesn't perform statements recovery. To recover statements with syntax + * errors, {@link #reconcile(int, boolean, boolean, WorkingCopyOwner, IProgressMonitor)} must be use. + * </p> + * + * @param astLevel either {@link #NO_AST} if no AST is wanted, + * or the {@linkplain AST#newAST(int) AST API level} of the AST if one is wanted + * @param forceProblemDetection boolean indicating whether problem should be + * recomputed even if the source hasn't changed + * @param owner the owner of working copies that take precedence over the + * original compilation units, or <code>null</code> if the primary working + * copy owner should be used + * @param monitor a progress monitor + * @return the compilation unit AST or <code>null</code> if not requested, + * or if the requested level of AST API is not supported, + * or if the working copy was consistent + * @throws JavaModelException if the contents of the original element + * cannot be accessed. Reasons include: + * <ul> + * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * </ul> + * @since 3.0 + + + + + + + + + + + + * Reconciles the contents of this working copy, sends out a Java delta + * notification indicating the nature of the change of the working copy since + * the last time it was either reconciled or made consistent + * ({@link IOpenable#makeConsistent(IProgressMonitor)}), and returns a + * compilation unit AST if requested. + * <p> + * It performs the reconciliation by locally caching the contents of + * the working copy, updating the contents, then creating a delta + * over the cached contents and the new contents, and finally firing + * this delta. + * <p> + * The boolean argument allows to force problem detection even if the + * working copy is already consistent. + * </p> + * <p> + * This functionality allows to specify a working copy owner which is used + * during problem detection. All references contained in the working copy are + * resolved against other units; for which corresponding owned working copies + * are going to take precedence over their original compilation units. If + * <code>null</code> is passed in, then the primary working copy owner is used. + * </p> + * <p> + * Compilation problems found in the new contents are notified through the + * {@link IProblemRequestor} interface which was passed at + * creation, and no longer as transient markers. + * </p> + * <p> + * Note: Since 3.0, added/removed/changed inner types generate change deltas. + * </p> + * <p> + * If requested, a DOM AST representing the compilation unit is returned. + * Its bindings are computed only if the problem requestor is active. + * This method returns <code>null</code> if the creation of the DOM AST was not requested, + * or if the requested level of AST API is not supported, or if the working copy was + * already consistent. + * </p> + * + * <p> + * If statements recovery is enabled then this method tries to rebuild statements + * with syntax error. Otherwise statements with syntax error won't be present in + * the returning DOM AST. + * </p> + * + * @param astLevel either {@link #NO_AST} if no AST is wanted, + * or the {@linkplain AST#newAST(int) AST API level} of the AST if one is wanted + * @param forceProblemDetection boolean indicating whether problem should be + * recomputed even if the source hasn't changed + * @param enableStatementsRecovery if <code>true</code> statements recovery is enabled. + * @param owner the owner of working copies that take precedence over the + * original compilation units, or <code>null</code> if the primary working + * copy owner should be used + * @param monitor a progress monitor + * @return the compilation unit AST or <code>null</code> if not requested, + * or if the requested level of AST API is not supported, + * or if the working copy was consistent + * @throws JavaModelException if the contents of the original element + * cannot be accessed. Reasons include: + * <ul> + * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * </ul> + * @since 3.2 + + + + + + + + + + + + + * Reconciles the contents of this working copy, sends out a Java delta + * notification indicating the nature of the change of the working copy since + * the last time it was either reconciled or made consistent + * ({@link IOpenable#makeConsistent(IProgressMonitor)}), and returns a + * compilation unit AST if requested. + * + * <p> + * If the problem detection is forced by passing the {@link #FORCE_PROBLEM_DETECTION} bit in the given reconcile flag, + * problem detection is run even if the working copy is already consistent. + * </p> + * + * <p> + * It performs the reconciliation by locally caching the contents of + * the working copy, updating the contents, then creating a delta + * over the cached contents and the new contents, and finally firing + * this delta.</p> + * + * <p> + * This functionality allows to specify a working copy owner which is used + * during problem detection. All references contained in the working copy are + * resolved against other units; for which corresponding owned working copies + * are going to take precedence over their original compilation units. If + * <code>null</code> is passed in, then the primary working copy owner is used. + * </p> + * <p> + * Compilation problems found in the new contents are notified through the + * {@link IProblemRequestor} interface which was passed at + * creation, and no longer as transient markers. + * </p> + * <p> + * Note: Since 3.0, added/removed/changed inner types generate change deltas. + * </p> + * <p> + * If requested, a DOM AST representing the compilation unit is returned. + * Its bindings are computed only if the problem requestor is active. + * This method returns <code>null</code> if the creation of the DOM AST was not requested, + * or if the requested level of AST API is not supported, or if the working copy was + * already consistent. + * </p> + * + * <p> + * If statements recovery is enabled by passing the {@link #ENABLE_STATEMENTS_RECOVERY} bit in the given reconcile flag + * then this method tries to rebuild statements with syntax error. Otherwise statements with syntax error won't be + * present in the returning DOM AST.</p> + * <p> + * If bindings recovery is enabled by passing the {@link #ENABLE_BINDINGS_RECOVERY} bit in the given reconcile flag + * then this method tries to resolve bindings even if the type resolution contains errors.</p> + * <p> + * The given reconcile flags is a bit-mask of the different constants ({@link #ENABLE_BINDINGS_RECOVERY}, + * {@link #ENABLE_STATEMENTS_RECOVERY}, {@link #FORCE_PROBLEM_DETECTION}). Unspecified values are left for future use. + * </p> + * + * @param astLevel either {@link #NO_AST} if no AST is wanted, + * or the {@linkplain AST#newAST(int) AST API level} of the AST if one is wanted + * @param reconcileFlags the given reconcile flags + * @param owner the owner of working copies that take precedence over the + * original compilation units, or <code>null</code> if the primary working + * copy owner should be used + * @param monitor a progress monitor + * @return the compilation unit AST or <code>null</code> if not requested, + * or if the requested level of AST API is not supported, + * or if the working copy was consistent + * @throws JavaModelException if the contents of the original element + * cannot be accessed. Reasons include: + * <ul> + * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * </ul> + * @see #FORCE_PROBLEM_DETECTION + * @see #ENABLE_BINDINGS_RECOVERY + * @see #ENABLE_STATEMENTS_RECOVERY + * @since 3.3 + + + + + + + + + + + + * Restores the contents of this working copy to the current contents of + * this working copy's original element. Has no effect if this element + * is not a working copy. + * + * <p>Note: This is the inverse of committing the content of the + * working copy to the original element with {@link #commitWorkingCopy(boolean, IProgressMonitor)}. + * + * @throws JavaModelException if the contents of the original element + * cannot be accessed. Reasons include: + * <ul> + * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * </ul> + * @since 3.0 + + + + + + + + * A completion requestor accepts results as they are computed and is aware + * of source positions to complete the various different results. + * <p> + * This interface may be implemented by clients. + * </p> + * + * @see ICodeAssist + * @since 2.0 + * @deprecated Use {@link CompletionRequestor} instead. + + + + + + * Code assist notification of an anonymous type declaration completion. + * @param superTypePackageName Name of the package that contains the super type of this + * new anonymous type declaration. + * @param superTypeName Name of the super type of this new anonymous type declaration. + * @param parameterPackageNames Names of the packages in which the parameter types are declared. + * Should contain as many elements as parameterTypeNames. + * @param parameterTypeNames Names of the parameter types. + * Should contain as many elements as parameterPackageNames. + * @param parameterNames Names of the parameters. + * Should contain as many elements as parameterPackageNames. + * @param completionName The completion for the anonymous type declaration. + * Can include zero, one or two brackets. If the closing bracket is included, + * then the cursor should be placed before it. + * @param modifiers The modifiers of the constructor. + * @param completionStart The start position of insertion of the name of this new anonymous type declaration. + * @param completionEnd The end position of insertion of the name of this new anonymous type declaration. + * @param relevance The relevance of the completion proposal + * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. + * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance + * value is higher. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Base types are in the form "int" or "boolean". + * Array types are in the qualified form "M[]" or "int[]". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + * + * NOTE: parameter names can be retrieved from the source model after the user selects a specific method. + * + * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Code assist notification of a class completion. + * + * @param packageName Declaring package name of the class. + * @param className Name of the class. + * @param completionName The completion for the class. Can include ';' for imported classes. + * @param modifiers The modifiers of the class. + * @param completionStart The start position of insertion of the name of the class. + * @param completionEnd The end position of insertion of the name of the class. + * @param relevance The relevance of the completion proposal + * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. + * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance + * value is higher. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + * + * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. + + + + + + + + + + + + + + + + + + + + + + + * Code assist notification of a compilation error detected during completion. + * @param error Only problems which are categorized as non-syntax errors are notified to the + * requestor, warnings are silently ignored. + * In case an error got signalled, no other completions might be available, + * therefore the problem message should be presented to the user. + * The source positions of the problem are related to the source where it was + * detected (might be in another compilation unit, if it was indirectly requested + * during the code assist process). + * Note: the problem knows its originating file name. + * + * @deprecated Use {@link CompletionRequestor#completionFailure(IProblem)} instead. + + + + + + + + * Code assist notification of a field completion. + * + * @param declaringTypePackageName Name of the package in which the type that contains this field is declared. + * @param declaringTypeName Name of the type declaring this new field. + * @param name Name of the field. + * @param typePackageName Name of the package in which the type of this field is declared. + * @param typeName Name of the type of this field. + * @param completionName The completion for the field. + * @param modifiers The modifiers of this field. + * @param completionStart The start position of insertion of the name of this field. + * @param completionEnd The end position of insertion of the name of this field. + * @param relevance The relevance of the completion proposal + * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. + * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance + * value is higher. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Base types are in the form "int" or "boolean". + * Array types are in the qualified form "M[]" or "int[]". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + * + * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Code assist notification of an interface completion. + * + * @param packageName Declaring package name of the interface. + * @param interfaceName Name of the interface. + * @param completionName The completion for the interface. Can include ';' for imported interfaces. + * @param modifiers The modifiers of the interface. + * @param completionStart The start position of insertion of the name of the interface. + * @param completionEnd The end position of insertion of the name of the interface. + * @param relevance The relevance of the completion proposal + * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. + * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance + * value is higher. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + * + * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. + + + + + + + + + + + + + + + + + + + + + + + * Code assist notification of a keyword completion. + * @param keywordName The keyword source. + * @param completionStart The start position of insertion of the name of this keyword. + * @param completionEnd The end position of insertion of the name of this keyword. + * @param relevance The relevance of the completion proposal + * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. + * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance + * value is higher. + * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. + + + + + + + + + + + + + + * Code assist notification of a label completion. + * + * @param labelName The label source. + * @param completionStart The start position of insertion of the name of this label. + * @param completionEnd The end position of insertion of the name of this label. + * @param relevance The relevance of the completion proposal + * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. + * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance + * value is higher. + * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. + + + + + + + + + + + + + + * Code assist notification of a local variable completion. + * + * @param name Name of the new local variable. + * @param typePackageName Name of the package in which the type of this new local variable is declared. + * @param typeName Name of the type of this new local variable. + * @param modifiers The modifiers of this new local variable. + * @param completionStart The start position of insertion of the name of this new local variable. + * @param completionEnd The end position of insertion of the name of this new local variable. + * @param relevance The relevance of the completion proposal + * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. + * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance + * value is higher. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Base types are in the form "int" or "boolean". + * Array types are in the qualified form "M[]" or "int[]". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + * + * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. + + + + + + + + + + + + + + + + + + + + + + + * Code assist notification of a method completion. + * + * @param declaringTypePackageName Name of the package in which the type that contains this new method is declared. + * @param declaringTypeName Name of the type declaring this new method. + * @param selector Name of the new method. + * @param parameterPackageNames Names of the packages in which the parameter types are declared. + * Should contain as many elements as parameterTypeNames. + * @param parameterTypeNames Names of the parameter types. + * Should contain as many elements as parameterPackageNames. + * @param parameterNames Names of the parameters. + * Should contain as many elements as parameterPackageNames. + * @param returnTypePackageName Name of the package in which the return type is declared. + * @param returnTypeName Name of the return type of this new method, should be <code>null</code> for a constructor. + * @param completionName The completion for the method. Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it. + * @param modifiers The modifiers of this new method. + * @param completionStart The start position of insertion of the name of this new method. + * @param completionEnd The end position of insertion of the name of this new method. + * @param relevance The relevance of the completion proposal + * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. + * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance + * value is higher. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Base types are in the form "int" or "boolean". + * Array types are in the qualified form "M[]" or "int[]". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + * + * NOTE: parameter names can be retrieved from the source model after the user selects a specific method. + * + * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Code assist notification of a method completion. + * + * @param declaringTypePackageName Name of the package in which the type that contains this new method is declared. + * @param declaringTypeName Name of the type declaring this new method. + * @param selector Name of the new method. + * @param parameterPackageNames Names of the packages in which the parameter types are declared. + * Should contain as many elements as parameterTypeNames. + * @param parameterTypeNames Names of the parameter types. + * Should contain as many elements as parameterPackageNames. + * @param parameterNames Names of the parameters. + * Should contain as many elements as parameterPackageNames. + * @param returnTypePackageName Name of the package in which the return type is declared. + * @param returnTypeName Name of the return type of this new method, should be <code>null</code> for a constructor. + * @param completionName The completion for the method. Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it. + * @param modifiers The modifiers of this new method. + * @param completionStart The start position of insertion of the name of this new method. + * @param completionEnd The end position of insertion of the name of this new method. + * @param relevance The relevance of the completion proposal + * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. + * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance + * value is higher. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Base types are in the form "int" or "boolean". + * Array types are in the qualified form "M[]" or "int[]". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + * + * NOTE: parameter names can be retrieved from the source model after the user selects a specific method. + * + * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Code assist notification of a modifier completion. + * + * @param modifierName The new modifier. + * @param completionStart The start position of insertion of the name of this new modifier. + * @param completionEnd The end position of insertion of the name of this new modifier. + * @param relevance The relevance of the completion proposal + * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. + * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance + * value is higher. + * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. + + + + + + + + + + + + + + * Code assist notification of a package completion. + * + * @param packageName The package name. + * @param completionName The completion for the package. Can include '.*;' for imports. + * @param completionStart The start position of insertion of the name of this new package. + * @param completionEnd The end position of insertion of the name of this new package. + * @param relevance The relevance of the completion proposal + * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. + * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance + * value is higher. + * + * NOTE - All package names are presented in their readable form: + * Package names are in the form "a.b.c". + * The default package is represented by an empty array. + * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. + + + + + + + + + + + + + + + + + + * Code assist notification of a type completion. + * + * @param packageName Declaring package name of the type. + * @param typeName Name of the type. + * @param completionName The completion for the type. Can include ';' for imported types. + * @param completionStart The start position of insertion of the name of the type. + * @param completionEnd The end position of insertion of the name of the type. + * @param relevance The relevance of the completion proposal + * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. + * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance + * value is higher. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. + + + + + + + + + + + + + + + + + + + + + + * Code assist notification of a variable name completion. + * + * @param typePackageName Name of the package in which the type of this variable is declared. + * @param typeName Name of the type of this variable. + * @param name Name of the variable. + * @param completionName The completion for the variable. + * @param completionStart The start position of insertion of the name of this variable. + * @param completionEnd The end position of insertion of the name of this variable. + * @param relevance The relevance of the completion proposal + * It is a positive integer which are used for determine if this proposal is more relevant than another proposal. + * This value can only be used for compare relevance. A proposal is more relevant than another if his relevance + * value is higher. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Base types are in the form "int" or "boolean". + * Array types are in the qualified form "M[]" or "int[]". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + * @deprecated Use {@link CompletionRequestor#accept(CompletionProposal)} instead. + + + + + + + + + + + + + + + + + + + + + + + + + + + * A callback interface for receiving java problem correction. + * + * @since 2.0 + + + + + + * Notification of a class correction. + * + * @param packageName Declaring package name of the class. + * @param className Name of the class. + * @param correctionName The correction for the class. + * @param modifiers The modifiers of the class. + * @param correctionStart The start position of insertion of the correction of the class. + * @param correctionEnd The end position of insertion of the correction of the class. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + + + + + + + + + + + + + + + + + + + + + + * Notification of a field correction. + * + * @param declaringTypePackageName Name of the package in which the type that contains this field is declared. + * @param declaringTypeName Name of the type declaring this field. + * @param name Name of the field. + * @param typePackageName Name of the package in which the type of this field is declared. + * @param typeName Name of the type of this field. + * @param correctionName The correction for the field. + * @param modifiers The modifiers of this field. + * @param correctionStart The start position of insertion of the correction of this field. + * @param correctionEnd The end position of insertion of the correction of this field. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Base types are in the form "int" or "boolean". + * Array types are in the qualified form "M[]" or "int[]". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Notification of an interface correction. + * + * @param packageName Declaring package name of the interface. + * @param interfaceName Name of the interface. + * @param correctionName The correction for the interface. + * Can include ';' for imported interfaces. + * @param modifiers The modifiers of the interface. + * @param correctionStart The start position of insertion of the correction of the interface. + * @param correctionEnd The end position of insertion of the correction of the interface. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + + + + + + + + + + + + + + + + + + + + + + * Notification of a local variable correction. + * + * @param name Name of the local variable. + * @param typePackageName Name of the package in which the type of this local variable is declared. + * @param typeName Name of the type of this local variable. + * @param modifiers The modifiers of this local variable. + * @param correctionStart The start position of insertion of the correction of this local variable. + * @param correctionEnd The end position of insertion of the correction of this local variable. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Base types are in the form "int" or "boolean". + * Array types are in the qualified form "M[]" or "int[]". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + + + + + + + + + + + + + + + + + + + + + + * Notification of a method correction. + * + * @param declaringTypePackageName Name of the package in which the type that contains this method is declared. + * @param declaringTypeName Name of the type declaring this method. + * @param selector Name of the method. + * @param parameterPackageNames Names of the packages in which the parameter types are declared. + * Should contain as many elements as parameterTypeNames. + * @param parameterTypeNames Names of the parameter types. + * Should contain as many elements as parameterPackageNames. + * @param parameterNames Names of the parameters. + * Should contain as many elements as parameterPackageNames. + * @param returnTypePackageName Name of the package in which the return type is declared. + * @param returnTypeName Name of the return type of this method, should be <code>null</code> for a constructor. + * @param correctionName The correction for the method. + * Can include zero, one or two brackets. If the closing bracket is included, then the cursor should be placed before it. + * @param modifiers The modifiers of this method. + * @param correctionStart The start position of insertion of the correction of this method. + * @param correctionEnd The end position of insertion of the correction of this method. + * + * NOTE - All package and type names are presented in their readable form: + * Package names are in the form "a.b.c". + * Base types are in the form "int" or "boolean". + * Array types are in the qualified form "M[]" or "int[]". + * Nested type names are in the qualified form "A.M". + * The default package is represented by an empty array. + * + * NOTE: parameter names can be retrieved from the source model after the user selects a specific method. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Notification of a package correction. + * + * @param packageName The package name. + * @param correctionName The correction for the package. + * Can include '.*;' for imports. + * @param correctionStart The start position of insertion of the correction of this package. + * @param correctionEnd The end position of insertion of the correction of this package. + * + * NOTE - All package names are presented in their readable form: + * Package names are in the form "a.b.c". + * The default package is represented by an empty array. + + + + + + + + + + + + + + + + + + * An element changed listener receives notification of changes to Java elements + * maintained by the Java model. + * <p> + * This interface may be implemented by clients. + * </p> + + + + + + * Notifies that one or more attributes of one or more Java elements have changed. + * The specific details of the change are described by the given event. + * + * @param event the change event + + + + + + + + + * Represents a field declared in a type. + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + * Returns the constant value associated with this field + * or <code>null</code> if this field has none. The field needs to be static and final to have + * a constant value. + * Returns an instance of the wrapper type corresponding to the the type of the field. + * <table border="1"> + * <tr> + * <th>field type</th> + * <th>wrapper type</th> + * </tr> + * <tr> + * <td>int + * </td> + * <td>java.lang.Integer + * </td> + * </tr> + * <tr> + * <td>byte + * </td> + * <td>java.lang.Byte + * </td> + * </tr> + * <tr> + * <td>boolean + * </td> + * <td>java.lang.Boolean + * </td> + * </tr> + * <tr> + * <td>char + * </td> + * <td>java.lang.Character + * </td> + * </tr> + * <tr> + * <td>double + * </td> + * <td>java.lang.Double + * </td> + * </tr> + * <tr> + * <td>float + * </td> + * <td>java.lang.Float + * </td> + * </tr> + * <tr> + * <td>long + * </td> + * <td>java.lang.Long + * </td> + * </tr> + * <tr> + * <td>short + * </td> + * <td>java.lang.Short + * </td> + * </tr> + * <tr> + * <td>java.lang.String + * </td> + * <td>java.lang.String + * </td> + * </tr> + * </table> + * + * @return the constant value associated with this field or <code>null</code> if this field has none. + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + * Returns the simple name of this field. + * @return the simple name of this field. + + + + + + + + * Returns the binding key for this field only if the given field is {@link #isResolved() resolved}. + * A binding key is a key that uniquely identifies this field. It allows access to generic info + * for parameterized fields. + * + * <p>If the given field is not resolved, the returned key is simply the java element's key. + * </p> + * @return the binding key for this field + * @see org.eclipse.jdt.core.dom.IBinding#getKey() + * @see BindingKey + * @see #isResolved() + * @since 3.1 + + + + + + + + * Returns the type signature of this field. For enum constants, + * this returns the signature of the declaring enum class. + * <p> + * The type signature may be either unresolved (for source types) + * or resolved (for binary types), and either basic (for basic types) + * or rich (for parameterized types). See {@link Signature} for details. + * </p> + * + * @return the type signature of this field + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @see Signature + + + + + + + + * Returns whether this field represents an enum constant. + * + * @return whether this field represents an enum constant + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @since 3.1 + + + + + + + + * Returns whether this field represents a resolved field. + * If a field is resolved, its key contains resolved information. + * + * @return whether this field represents a resolved field. + * @since 3.1 + + + + + + + + + * Represents an import container is a child of a Java compilation unit that contains + * all (and only) the import declarations. If a compilation unit has no import + * declarations, no import container will be present. + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + + * Returns the first import declaration in this import container with the given name. + * This is a handle-only method. The import declaration may or may not exist. + * + * @param name the given name + * + * @return the first import declaration in this import container with the given name + + + + + + + + + + * Represents an import declaration in Java compilation unit. + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + + * Returns the name that has been imported. + * For an on-demand import, this includes the trailing <code>".*"</code>. + * For example, for the statement <code>"import java.util.*"</code>, + * this returns <code>"java.util.*"</code>. + * For the statement <code>"import java.util.Hashtable"</code>, + * this returns <code>"java.util.Hashtable"</code>. + * + * @return the name that has been imported + + + + + + + + * Returns the modifier flags for this import. The flags can be examined using class + * <code>Flags</code>. Only the static flag is meaningful for import declarations. + * + * @return the modifier flags for this import + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @see Flags + * @since 3.0 + + + + + + + + * Returns whether the import is on-demand. An import is on-demand if it ends + * with <code>".*"</code>. + * @return true if the import is on-demand, false otherwise + + + + + + + + + * Represents a stand-alone instance or class (static) initializer in a type. + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + * A jar entry corresponding to a non-Java resource in an archive {@link IPackageFragment} or {@link IPackageFragmentRoot}. + * <p> + * One can navigate the non-Java resource tree using the {@link #getChildren()} and {@link #getParent()} methods. + * Jar entry resources are either files ({@link #isFile()} returns true) or directories ({@link #isFile()} returns false). + * Files don't have any children and the returned array is always empty. + * </p><p> + * Jar entry resources that refer to the same element are guaranteed to be equal, but not necessarily identical. + * <p> + * + * @since 3.3 + + + + + + + * Returns the list of children of this jar entry resource. + * Returns an empty array if this jar entry is a file, or if this jar entry is a directory and it has no children. + * + * @return the children of this jar entry resource + + + + + + + + + + + * Returns the full, absolute path of this jar entry resource relative to the archive this jar + * entry belongs to. + * <p> + * A jar entry resource's full path indicates the route from the root of the archive + * to the jar entry resource. Within an archive, there is exactly one such path + * for any given jar entry resource. </p> + * <p> + * The returned path is absolute (i.e. it starts with a separator) and it never has a trailing separator. + * </p> + * + * @return the absolute path of this jar entry resource + + + + + + + + * Returns the parent of this jar entry resource. This is either an {@link IJarEntryResource}, an {@link IPackageFragment} + * or an {@link IPackageFragmentRoot}. + * + * @return the parent of this jar entry resource + + + + + + + + * Returns the package fragment root this jar entry resource belongs to. + * + * @return the package fragment root this jar entry resource belongs to. + + + + + + + + * Common protocol for all elements provided by the Java model. + * Java model elements are exposed to clients as handles to the actual underlying element. + * The Java model may hand out any number of handles for each element. Handles + * that refer to the same element are guaranteed to be equal, but not necessarily identical. + * <p> + * Methods annotated as "handle-only" do not require underlying elements to exist. + * Methods that require underlying elements to exist throw + * a <code>JavaModelException</code> when an underlying element is missing. + * <code>JavaModelException.isDoesNotExist</code> can be used to recognize + * this common special case. + * </p> + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + * Constant representing a Java model (workspace level object). + * A Java element with this type can be safely cast to {@link IJavaModel}. + + + + + + + * Constant representing a Java project. + * A Java element with this type can be safely cast to {@link IJavaProject}. + + + + + + + * Constant representing a package fragment root. + * A Java element with this type can be safely cast to {@link IPackageFragmentRoot}. + + + + + + + * Constant representing a package fragment. + * A Java element with this type can be safely cast to {@link IPackageFragment}. + + + + + + + * Constant representing a Java compilation unit. + * A Java element with this type can be safely cast to {@link ICompilationUnit}. + + + + + + + * Constant representing a class file. + * A Java element with this type can be safely cast to {@link IClassFile}. + + + + + + + * Constant representing a type (a class or interface). + * A Java element with this type can be safely cast to {@link IType}. + + + + + + + * Constant representing a field. + * A Java element with this type can be safely cast to {@link IField}. + + + + + + + * Constant representing a method or constructor. + * A Java element with this type can be safely cast to {@link IMethod}. + + + + + + + * Constant representing a stand-alone instance or class initializer. + * A Java element with this type can be safely cast to {@link IInitializer}. + + + + + + + * Constant representing a package declaration within a compilation unit. + * A Java element with this type can be safely cast to {@link IPackageDeclaration}. + + + + + + + * Constant representing all import declarations within a compilation unit. + * A Java element with this type can be safely cast to {@link IImportContainer}. + + + + + + + * Constant representing an import declaration within a compilation unit. + * A Java element with this type can be safely cast to {@link IImportDeclaration}. + + + + + + + * Constant representing a local variable declaration. + * A Java element with this type can be safely cast to {@link ILocalVariable}. + * @since 3.0 + + + + + + + * Constant representing a type parameter declaration. + * A Java element with this type can be safely cast to {@link ITypeParameter}. + * @since 3.1 + + + + + + + * Constant representing an annotation. + * A Java element with this type can be safely cast to {@link IAnnotation}. + * @since 3.4 + + + + + + + * Returns whether this Java element exists in the model. + * <p> + * Java elements are handle objects that may or may not be backed by an + * actual element. Java elements that are backed by an actual element are + * said to "exist", and this method returns <code>true</code>. For Java + * elements that are not working copies, it is always the case that if the + * element exists, then its parent also exists (provided it has one) and + * includes the element as one of its children. It is therefore possible + * to navigated to any existing Java element from the root of the Java model + * along a chain of existing Java elements. On the other hand, working + * copies are said to exist until they are destroyed (with + * <code>IWorkingCopy.destroy</code>). Unlike regular Java elements, a + * working copy never shows up among the children of its parent element + * (which may or may not exist). + * </p> + * + * @return <code>true</code> if this element exists in the Java model, and + * <code>false</code> if this element does not exist + + + + + + + + * Returns the first ancestor of this Java element that has the given type. + * Returns <code>null</code> if no such an ancestor can be found. + * This is a handle-only method. + * + * @param ancestorType the given type + * @return the first ancestor of this Java element that has the given type, null if no such an ancestor can be found + * @since 2.0 + + + + + + + + + * <p>Returns the Javadoc as an html source if this element has an attached javadoc, + * null otherwise.</p> + * <p>This should be used only for binary elements. Source elements will always return null.</p> + * <p>The encoding used to read the javadoc is the one defined by the content type of the + * file. If none is defined, then the project's encoding of this java element is used. If the project's + * encoding cannot be retrieved, then the platform encoding is used.</p> + * <p>In case of the javadoc doesn't exist for this element, null is returned.</p> + * + * <p>The html is extracted from the attached javadoc and provided as is. No + * transformation or validation is done.</p> + * + * @param monitor the given progress monitor + * @exception JavaModelException if:<ul> + * <li>this element does not exist</li> + * <li>retrieving the attached javadoc fails (timed-out, invalid URL, ...)</li> + * <li>the format of the javadoc doesn't match expected standards (different anchors,...)</li> + * </ul> + * @return the extracted javadoc from the attached javadoc, null if none + * @see IClasspathAttribute#JAVADOC_LOCATION_ATTRIBUTE_NAME + * @since 3.2 + + + + + + + + + * Returns the resource that corresponds directly to this element, + * or <code>null</code> if there is no resource that corresponds to + * this element. + * <p> + * For example, the corresponding resource for an <code>ICompilationUnit</code> + * is its underlying <code>IFile</code>. The corresponding resource for + * an <code>IPackageFragment</code> that is not contained in an archive + * is its underlying <code>IFolder</code>. An <code>IPackageFragment</code> + * contained in an archive has no corresponding resource. Similarly, there + * are no corresponding resources for <code>IMethods</code>, + * <code>IFields</code>, etc. + * <p> + * + * @return the corresponding resource, or <code>null</code> if none + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + * Returns the name of this element. This is a handle-only method. + * + * @return the element name + + + + + + + + * Returns this element's kind encoded as an integer. + * This is a handle-only method. + * + * @return the kind of element; one of the constants declared in + * <code>IJavaElement</code> + * @see IJavaElement + + + + + + + + * Returns a string representation of this element handle. The format of + * the string is not specified; however, the identifier is stable across + * workspace sessions, and can be used to recreate this handle via the + * <code>JavaCore.create(String)</code> method. + * + * @return the string handle identifier + * @see JavaCore#create(java.lang.String) + + + + + + + + * Returns the Java model. + * This is a handle-only method. + * + * @return the Java model + + + + + + + + * Returns the Java project this element is contained in, + * or <code>null</code> if this element is not contained in any Java project + * (for instance, the <code>IJavaModel</code> is not contained in any Java + * project). + * This is a handle-only method. + * + * @return the containing Java project, or <code>null</code> if this element is + * not contained in a Java project + + + + + + + + * Returns the first openable parent. If this element is openable, the element + * itself is returned. Returns <code>null</code> if this element doesn't have + * an openable parent. + * This is a handle-only method. + * + * @return the first openable parent or <code>null</code> if this element doesn't have + * an openable parent. + * @since 2.0 + + + + + + + + * Returns the element directly containing this element, + * or <code>null</code> if this element has no parent. + * This is a handle-only method. + * + * @return the parent element, or <code>null</code> if this element has no parent + + + + + + + + * Returns the path to the innermost resource enclosing this element. + * If this element is not included in an external library, + * the path returned is the full, absolute path to the underlying resource, + * relative to the workbench. + * If this element is included in an external library, + * the path returned is the absolute path to the archive or to the + * folder in the file system. + * This is a handle-only method. + * + * @return the path to the innermost resource enclosing this element + * @since 2.0 + + + + + + + + * Returns the primary element (whose compilation unit is the primary compilation unit) + * this working copy element was created from, or this element if it is a descendant of a + * primary compilation unit or if it is not a descendant of a working copy (e.g. it is a + * binary member). + * The returned element may or may not exist. + * + * @return the primary element this working copy element was created from, or this + * element. + * @since 3.0 + + + + + + + + * Returns the innermost resource enclosing this element. + * If this element is included in an archive and this archive is not external, + * this is the underlying resource corresponding to the archive. + * If this element is included in an external library, <code>null</code> + * is returned. + * This is a handle-only method. + * + * @return the innermost resource enclosing this element, <code>null</code> if this + * element is included in an external archive + * @since 2.0 + + + + + + + + * Returns the scheduling rule associated with this Java element. + * This is a handle-only method. + * + * @return the scheduling rule associated with this Java element + * @since 3.0 + + + + + + + + * Returns the smallest underlying resource that contains + * this element, or <code>null</code> if this element is not contained + * in a resource. + * + * @return the underlying resource, or <code>null</code> if none + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its underlying resource + + + + + + + + * Returns whether this Java element is read-only. An element is read-only + * if its structure cannot be modified by the java model. + * <p> + * Note this is different from IResource.isReadOnly(). For example, .jar + * files are read-only as the java model doesn't know how to add/remove + * elements in this file, but the underlying IFile can be writable. + * <p> + * This is a handle-only method. + * + * @return <code>true</code> if this element is read-only + + + + + + + + + + + + * A Java element delta describes changes in Java element between two discrete + * points in time. Given a delta, clients can access the element that has + * changed, and any children that have changed. + * <p> + * Deltas have a different status depending on the kind of change they represent. + * The list below summarizes each status (as returned by {@link #getKind}) + * and its meaning (see individual constants for a more detailled description): + * <ul> + * <li>{@link #ADDED} - The element described by the delta has been added.</li> + * <li>{@link #REMOVED} - The element described by the delta has been removed.</li> + * <li>{@link #CHANGED} - The element described by the delta has been changed in some way. + * Specification of the type of change is provided by {@link #getFlags} which returns the following values: + * <ul> + * <li>{@link #F_ADDED_TO_CLASSPATH} - A classpath entry corresponding to the element + * has been added to the project's classpath. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}.</li> + * <li>{@link #F_ARCHIVE_CONTENT_CHANGED} - The contents of an archive + * has changed in some way. This flag is only valid if the element is an {@link IPackageFragmentRoot} + * which is an archive.</li> + * <li>{@link #F_CHILDREN} - A child of the element has changed in some way. This flag + * is only valid if the element is an {@link IParent}.</li> + * <li>{@link #F_CLASSPATH_REORDER} - A classpath entry corresponding to the element + * has changed position in the project's classpath. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}.</li> + * <li>{@link #F_CLOSED} - The underlying {@link org.eclipse.core.resources.IProject} + * has been closed. This flag is only valid if the element is an {@link IJavaProject}.</li> + * <li>{@link #F_CONTENT} - The contents of the element have been altered. This flag + * is only valid for elements which correspond to files.</li> + *<li>{@link #F_FINE_GRAINED} - The delta is a fine-grained delta, that is, an analysis down + * to the members level was done to determine if there were structural changes to members of the element.</li> + * <li>{@link #F_MODIFIERS} - The modifiers on the element have changed in some way. + * This flag is only valid if the element is an {@link IMember}.</li> + * <li>{@link #F_OPENED} - The underlying {@link org.eclipse.core.resources.IProject} + * has been opened. This flag is only valid if the element is an {@link IJavaProject}.</li> + * <li>{@link #F_REMOVED_FROM_CLASSPATH} - A classpath entry corresponding to the element + * has been removed from the project's classpath. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}.</li> + * <li>{@link #F_SOURCEATTACHED} - The source attachment path or the source attachment root path + * of a classpath entry corresponding to the element was added. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}.</li> + * <li>{@link #F_SOURCEDETACHED} - The source attachment path or the source attachment root path + * of a classpath entry corresponding to the element was removed. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}.</li> + * <li>{@link #F_SUPER_TYPES} - One of the supertypes of an {@link IType} has changed</li>. + * </ul> + * </li> + * </ul> + * </p> + * <p> + * Move operations are indicated by other change flags, layered on top + * of the change flags described above. If element A is moved to become B, + * the delta for the change in A will have status {@link #REMOVED}, + * with change flag {@link #F_MOVED_TO}. In this case, + * {@link #getMovedToElement} on delta A will return the handle for B. + * The delta for B will have status {@link #ADDED}, with change flag + * {@link #F_MOVED_FROM}, and {@link #getMovedFromElement} on delta + * B will return the handle for A. (Note, the handle to A in this case represents + * an element that no longer exists). + * </p> + * <p> + * Note that the move change flags only describe the changes to a single element, they + * do not imply anything about the parent or children of the element. + * </p> + * <p> + * The {@link #F_ADDED_TO_CLASSPATH}, {@link #F_REMOVED_FROM_CLASSPATH} and + * {@link #F_CLASSPATH_REORDER} flags are triggered by changes to a project's classpath. They do not mean that + * the underlying resource was added, removed or changed. For example, if a project P already contains a folder src, then + * adding a classpath entry with the 'P/src' path to the project's classpath will result in an {@link IJavaElementDelta} + * with the {@link #F_ADDED_TO_CLASSPATH} flag for the {@link IPackageFragmentRoot} P/src. + * On the contrary, if a resource is physically added, removed or changed and this resource corresponds to a classpath + * entry of the project, then an {@link IJavaElementDelta} with the {@link #ADDED}, + * {@link #REMOVED}, or {@link #CHANGED} kind will be fired. + * </p> + * <p> + * Note that when a source attachment path or a source attachment root path is changed, then the flags of the delta contain + * both {@link #F_SOURCEATTACHED} and {@link #F_SOURCEDETACHED}. + * </p> + * <p> + * No assumptions should be made on whether the java element delta tree is rooted at the {@link IJavaModel} + * level or not. + * </p> + * <p> + * {@link IJavaElementDelta} object are not valid outside the dynamic scope + * of the notification. + * </p> + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + * Status constant indicating that the element has been added. + * Note that an added java element delta has no children, as they are all implicitely added. + + + + + + + * Status constant indicating that the element has been removed. + * Note that a removed java element delta has no children, as they are all implicitely removed. + + + + + + + * Status constant indicating that the element has been changed, + * as described by the change flags. + * + * @see #getFlags() + + + + + + + * Change flag indicating that the content of the element has changed. + * This flag is only valid for elements which correspond to files. + + + + + + + * Change flag indicating that the modifiers of the element have changed. + * This flag is only valid if the element is an {@link IMember}. + + + + + + + * Change flag indicating that there are changes to the children of the element. + * This flag is only valid if the element is an {@link IParent}. + + + + + + + * Change flag indicating that the element was moved from another location. + * The location of the old element can be retrieved using {@link #getMovedFromElement}. + + + + + + + * Change flag indicating that the element was moved to another location. + * The location of the new element can be retrieved using {@link #getMovedToElement}. + + + + + + + * Change flag indicating that a classpath entry corresponding to the element has been added to the project's classpath. + * This flag is only valid if the element is an {@link IPackageFragmentRoot}. + + + + + + + * Change flag indicating that a classpath entry corresponding to the element has been removed from the project's + * classpath. This flag is only valid if the element is an {@link IPackageFragmentRoot}. + + + + + + + * Change flag indicating that a classpath entry corresponding to the element has changed position in the project's + * classpath. This flag is only valid if the element is an {@link IPackageFragmentRoot}. + * @deprecated Use {@link #F_REORDER} instead. + + + + + + + * Change flag indicating that the element has changed position relatively to its siblings. + * If the element is an {@link IPackageFragmentRoot}, a classpath entry corresponding + * to the element has changed position in the project's classpath. + * + * @since 2.1 + + + + + + + * Change flag indicating that the underlying {@link org.eclipse.core.resources.IProject} has been + * opened. This flag is only valid if the element is an {@link IJavaProject}. + + + + + + + * Change flag indicating that the underlying {@link org.eclipse.core.resources.IProject} has been + * closed. This flag is only valid if the element is an {@link IJavaProject}. + + + + + + + * Change flag indicating that one of the supertypes of an {@link IType} + * has changed. + + + + + + + * Change flag indicating that the source attachment path or the source attachment root path of a classpath entry + * corresponding to the element was added. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}. + + + + + + + * Change flag indicating that the source attachment path or the source attachment root path of a classpath entry + * corresponding to the element was removed. This flag is only valid if the element is an + * {@link IPackageFragmentRoot}. + + + + + + + * Change flag indicating that this is a fine-grained delta, that is, an analysis down + * to the members level was done to determine if there were structural changes to + * members. + * <p> + * Clients can use this flag to find out if a compilation unit + * that have a {@link #F_CONTENT} change should assume that there are + * no finer grained changes ({@link #F_FINE_GRAINED} is set) or if + * finer grained changes were not considered ({@link #F_FINE_GRAINED} + * is not set). + * + * @since 2.0 + + + + + + + * Change flag indicating that the element's archive content on the classpath has changed. + * This flag is only valid if the element is an {@link IPackageFragmentRoot} + * which is an archive. + * + * @see IPackageFragmentRoot#isArchive() + * @since 2.0 + + + + + + + * Change flag indicating that a compilation unit has become a primary working copy, or that a + * primary working copy has reverted to a compilation unit. + * This flag is only valid if the element is an {@link ICompilationUnit}. + * + * @since 3.0 + + + + + + + * Change flag indicating that the {@link IJavaProject#getRawClasspath() raw classpath} + * (or the {@link IJavaProject#getOutputLocation() output folder}) of a project has changed. + * This flag is only valid if the element is an {@link IJavaProject}. + * Also see {@link #F_RESOLVED_CLASSPATH_CHANGED}, which indicates that there is a + * change to the {@link IJavaProject#getResolvedClasspath(boolean) resolved class path}. + * The resolved classpath can change without the raw classpath changing (e.g. + * if a container resolves to a different set of classpath entries). + * And conversely, it is possible to construct a case where the raw classpath + * can change without the resolved classpath changing. + * + * @since 3.0 + + + + + + + * Change flag indicating that the resource of a primary compilation unit has changed. + * This flag is only valid if the element is a primary {@link ICompilationUnit}. + * + * @since 3.0 + + + + + + + * Change flag indicating that a reconcile operation has affected the compilation unit AST created in a + * previous reconcile operation. Use {@link #getCompilationUnitAST()} to retrieve the AST (if any is available). + * This flag is only valid if the element is an {@link ICompilationUnit} in working copy mode. + * + * @since 3.2 + + + + + + + * Change flag indicating that the categories of the element have changed. + * This flag is only valid if the element is an {@link IMember}. + * + * @since 3.2 + + + + + + + * Change flag indicating that the {@link IJavaProject#getResolvedClasspath(boolean) + * resolved classpath} of a project has changed. + * This flag is only valid if the element is an {@link IJavaProject}. + * Also see {@link #F_CLASSPATH_CHANGED}, which indicates that there is a + * change to the {@link IJavaProject#getRawClasspath() raw class path}. + * The resolved classpath can change without the raw classpath changing (e.g. + * if a container resolves to a different set of classpath entries). + * And conversely, it is possible to construct a case where the raw classpath + * can change without the resolved classpath changing. + * + * @since 3.4 + + + + + + + * Change flag indicating that the annotations of the element have changed. + * Use {@link #getAnnotationDeltas()} to get the added/removed/changed annotations. + * This flag is only valid if the element is an {@link IAnnotatable}. + * + * @since 3.4 + + + + + + + * Returns deltas for the children that have been added. + * @return deltas for the children that have been added + + + + + + + + + + + * Returns deltas for the affected (added, removed, or changed) children. + * @return deltas for the affected (added, removed, or changed) children + + + + + + + + + + + * Returns deltas for affected annotations (added, removed, or changed). + * Returns an empty array if no annotations was affected, or if this delta's element is not + * an {@link IAnnotatable}. + * + * @return deltas for affected annotations (added, removed, or changed) + * + * @since 3.4 + + + + + + + + + + + * Returns the compilation unit AST created by the last reconcile operation on this delta's element. + * This returns a non-null value if and only if: + * <ul> + * <li>the last reconcile operation on this working copy requested an AST</li> + * <li>this delta's element is an {@link ICompilationUnit} in working copy mode</li> + * <li>the delta comes from a {@link ElementChangedEvent#POST_RECONCILE} event + * </ul> + * + * @return the AST created during the last reconcile operation + * @see ICompilationUnit#reconcile(int, boolean, WorkingCopyOwner, org.eclipse.core.runtime.IProgressMonitor) + * @see #F_AST_AFFECTED + * @since 3.2 + + + + + + + + * Returns deltas for the children which have changed. + * @return deltas for the children which have changed + + + + + + + + + + + * Returns the element that this delta describes a change to. + * @return the element that this delta describes a change to + + + + + + + + * Returns flags that describe how an element has changed. + * Such flags should be tested using the <code>&</code> operand. For example: + * <pre> + * if ((delta.getFlags() & IJavaElementDelta.F_CONTENT) != 0) { + * // the delta indicates a content change + * } + * </pre> + * + * @return flags that describe how an element has changed + + + + + + + + * Returns the kind of this delta - one of {@link #ADDED}, {@link #REMOVED}, + * or {@link #CHANGED}. + * + * @return the kind of this delta + + + + + + + + * Returns an element describing this element before it was moved + * to its current location, or <code>null</code> if the + * {@link #F_MOVED_FROM} change flag is not set. + * + * @return an element describing this element before it was moved + * to its current location, or <code>null</code> if the + * {@link #F_MOVED_FROM} change flag is not set + + + + + + + + * Returns an element describing this element in its new location, + * or <code>null</code> if the {@link #F_MOVED_TO} change + * flag is not set. + * + * @return an element describing this element in its new location, + * or <code>null</code> if the {@link #F_MOVED_TO} change + * flag is not set + + + + + + + + * Returns deltas for the children which have been removed. + * + * @return deltas for the children which have been removed + + + + + + + + + + + * Returns the collection of resource deltas. + * <p> + * Note that resource deltas, like Java element deltas, are generally only valid + * for the dynamic scope of an event notification. Clients must not hang on to + * these objects. + * </p> + * + * @return the underlying resource deltas, or <code>null</code> if none + + + + + + + + + + + + + + + * Represent the root Java element corresponding to the workspace. + * Since there is only one such root element, it is commonly referred to as + * <em>the</em> Java model element. + * The Java model element needs to be opened before it can be navigated or manipulated. + * The Java model element has no parent (it is the root of the Java element + * hierarchy). Its children are <code>IJavaProject</code>s. + * <p> + * This interface provides methods for performing copy, move, rename, and + * delete operations on multiple Java elements. + * </p> + * <p> + * An instance of one of these handles can be created via + * <code>JavaCore.create(workspace.getRoot())</code>. + * </p> + * + * @see JavaCore#create(org.eclipse.core.resources.IWorkspaceRoot) + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + + * Returns whether this Java model contains an <code>IJavaElement</code> whose + * resource is the given resource or a non-Java resource which is the given resource. + * <p> + * Note: no existency check is performed on the argument resource. If it is not accessible + * (see <code>IResource.isAccessible()</code>) yet but would be located in Java model + * range, then it will return <code>true</code>. + * </p><p> + * If the resource is accessible, it can be reached by navigating the Java model down using the + * <code>getChildren()</code> and/or <code>getNonJavaResources()</code> methods. + * </p> + * @param resource the resource to check + * @return true if the resource is accessible through the Java model + * @since 2.1 + + + + + + + + + * Copies the given elements to the specified container(s). + * If one container is specified, all elements are copied to that + * container. If more than one container is specified, the number of + * elements and containers must match, and each element is copied to + * its associated container. + * <p> + * Optionally, each copy can positioned before a sibling + * element. If <code>null</code> is specified for a given sibling, the copy + * is inserted as the last child of its associated container. + * </p> + * <p> + * Optionally, each copy can be renamed. If + * <code>null</code> is specified for the new name, the copy + * is not renamed. + * </p> + * <p> + * Optionally, any existing child in the destination container with + * the same name can be replaced by specifying <code>true</code> for + * force. Otherwise an exception is thrown in the event that a name + * collision occurs. + * </p> + * + * @param elements the elements to copy + * @param containers the container, or list of containers + * @param siblings the list of siblings element any of which may be + * <code>null</code>; or <code>null</code> + * @param renamings the list of new names any of which may be + * <code>null</code>; or <code>null</code> + * @param replace <code>true</code> if any existing child in a target container + * with the target name should be replaced, and <code>false</code> to throw an + * exception in the event of a name collision + * @param monitor a progress monitor + * @exception JavaModelException if an element could not be copied. Reasons include: + * <ul> + * <li> There is no element to process (NO_ELEMENTS_TO_PROCESS). The given elements is null or empty</li> + * <li> A specified element, container, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while updating an underlying resource</li> + * <li> A container is of an incompatible type (<code>INVALID_DESTINATION</code>)</li> + * <li> A sibling is not a child of it associated container (<code>INVALID_SIBLING</code>)</li> + * <li> A new name is invalid (<code>INVALID_NAME</code>)</li> + * <li> A child in its associated container already exists with the same + * name and <code>replace</code> has been specified as <code>false</code> (<code>NAME_COLLISION</code>)</li> + * <li> A container or element is read-only (<code>READ_ONLY</code>) </li> + * </ul> + * @see org.eclipse.jdt.core.IJavaModelStatusConstants#INVALID_DESTINATION + + + + + + + + + + + + + + + + + + + + + + + + + * Deletes the given elements, forcing the operation if necessary and specified. + * + * @param elements the elements to delete + * @param force a flag controlling whether underlying resources that are not + * in sync with the local file system will be tolerated + * @param monitor a progress monitor + * @exception JavaModelException if an element could not be deleted. Reasons include: + * <ul> + * <li> There is no element to process (NO_ELEMENTS_TO_PROCESS). The given elements is null or empty</li> + * <li> A specified element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while updating an underlying resource</li> + * <li> An element is read-only (<code>READ_ONLY</code>) </li> + * </ul> + + + + + + + + + + + + + * Returns the Java project with the given name. The given name must be a valid + * path segment as defined by {@link IPath#isValidSegment(String)}. + * This is a handle-only method. + * The project may or may not exist. + * + * @param name the name of the Java project + * @return the Java project with the given name + + + + + + + + + * Returns the Java projects in this Java model, or an empty array if there + * are none. + * + * @return the Java projects in this Java model, or an empty array if there + * are none + * @exception JavaModelException if this request fails. + + + + + + + + + + + * Returns an array of non-Java resources (that is, non-Java projects) in + * the workspace. + * <p> + * Non-Java projects include all projects that are closed (even if they have the + * Java nature). + * </p> + * + * @return an array of non-Java projects (<code>IProject</code>s) contained + * in the workspace. + * @throws JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @since 2.1 + + + + + + + + + + + * Returns the workspace associated with this Java model. + * + * @return the workspace associated with this Java model + + + + + + + + * Moves the given elements to the specified container(s). + * If one container is specified, all elements are moved to that + * container. If more than one container is specified, the number of + * elements and containers must match, and each element is moved to + * its associated container. + * <p> + * Optionally, each element can positioned before a sibling + * element. If <code>null</code> is specified for sibling, the element + * is inserted as the last child of its associated container. + * </p> + * <p> + * Optionally, each element can be renamed. If + * <code>null</code> is specified for the new name, the element + * is not renamed. + * </p> + * <p> + * Optionally, any existing child in the destination container with + * the same name can be replaced by specifying <code>true</code> for + * force. Otherwise an exception is thrown in the event that a name + * collision occurs. + * </p> + * + * @param elements the elements to move + * @param containers the container, or list of containers + * @param siblings the list of siblings element any of which may be + * <code>null</code>; or <code>null</code> + * @param renamings the list of new names any of which may be + * <code>null</code>; or <code>null</code> + * @param replace <code>true</code> if any existing child in a target container + * with the target name should be replaced, and <code>false</code> to throw an + * exception in the event of a name collision + * @param monitor a progress monitor + * @exception JavaModelException if an element could not be moved. Reasons include: + * <ul> + * <li> There is no element to process (NO_ELEMENTS_TO_PROCESS). The given elements is null or empty</li> + * <li> A specified element, container, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while updating an underlying resource</li> + * <li> A container is of an incompatible type (<code>INVALID_DESTINATION</code>)</li> + * <li> A sibling is not a child of it associated container (<code>INVALID_SIBLING</code>)</li> + * <li> A new name is invalid (<code>INVALID_NAME</code>)</li> + * <li> A child in its associated container already exists with the same + * name and <code>replace</code> has been specified as <code>false</code> (<code>NAME_COLLISION</code>)</li> + * <li> A container or element is read-only (<code>READ_ONLY</code>) </li> + * </ul> + * + * @exception IllegalArgumentException any element or container is <code>null</code> + * @see org.eclipse.jdt.core.IJavaModelStatusConstants#INVALID_DESTINATION + + + + + + + + + + + + + + + + + + + + + + + + + * Triggers an update of the JavaModel with respect to the referenced external archives. + * This operation will issue a JavaModel delta describing the discovered changes, in term + * of Java element package fragment roots added, removed or changed. + * Note that a collection of elements can be passed so as to narrow the set of archives + * to refresh (passing <code>null</code> along is equivalent to refreshing the entire mode). + * The elements can be: + * <ul> + * <li> package fragment roots corresponding to external archives + * <li> Java projects, which referenced external archives will be refreshed + * <li> Java model, all referenced external archives will be refreshed. + * </ul> + * <p> In case an archive is used by multiple projects, the delta issued will account for + * all of them. This means that even if a project was not part of the elements scope, it + * may still be notified of changes if it is referencing a library comprised in the scope. + * <p> + * <b>Since 3.7</b>, a project refresh automatically triggers a refresh of external archives. + * Hence, this method doesn't need to be explicitly called after a project refresh. + * <p> + * @param elementsScope - a collection of elements defining the scope of the refresh + * @param monitor - a progress monitor used to report progress + * @exception JavaModelException in one of the corresponding situation: + * <ul> + * <li> an exception occurs while accessing project resources </li> + * </ul> + * + * @see IJavaElementDelta + * @since 2.0 + + + + + + + + + + + + * Renames the given elements as specified. + * If one container is specified, all elements are renamed within that + * container. If more than one container is specified, the number of + * elements and containers must match, and each element is renamed within + * its associated container. + * + * @param elements the elements to rename + * @param destinations the container, or list of containers + * @param names the list of new names + * @param replace <code>true</code> if an existing child in a target container + * with the target name should be replaced, and <code>false</code> to throw an + * exception in the event of a name collision + * @param monitor a progress monitor + * @exception JavaModelException if an element could not be renamed. Reasons include: + * <ul> + * <li> There is no element to process (NO_ELEMENTS_TO_PROCESS). The given elements is null or empty</li> + * <li> A specified element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while updating an underlying resource + * <li> A new name is invalid (<code>INVALID_NAME</code>) + * <li> A child already exists with the same name and <code>replace</code> has been specified as <code>false</code> (<code>NAME_COLLISION</code>) + * <li> An element is read-only (<code>READ_ONLY</code>) + * </ul> + + + + + + + + + + + + + + + + + + + + + + * Markers used by the Java model. + * <p> + * This interface declares constants only. + * </p> + * @noimplement This interface is not intended to be implemented by clients. + + + + + + * Java model problem marker type (value + * <code>"org.eclipse.jdt.core.problem"</code>). This can be used to + * recognize those markers in the workspace that flag problems detected by + * the Java tooling during compilation. + + + + + + + * Java model transient problem marker type (value + * <code>"org.eclipse.jdt.core.transient_problem"</code>). This can be + * used to recognize those markers in the workspace that flag transient + * problems detected by the Java tooling (such as a problem detected by the + * outliner, or a problem detected during a code completion). Since 1.0, + * transient problems are reported as <code>IProblem</code> through + * various API. Only the evaluation API is still producing markers for + * transient problems. + * + * @see org.eclipse.jdt.core.compiler.IProblem + * @see org.eclipse.jdt.core.eval.ICodeSnippetRequestor#acceptProblem(org.eclipse.core.resources.IMarker,String, + * int) + + + + + + + * Java model task marker type (value + * <code>"org.eclipse.jdt.core.task"</code>). This can be used to + * recognize task markers in the workspace that correspond to tasks + * specified in Java source comments and detected during compilation (for + * example, 'TO-DO: ...'). Tasks are identified by a task tag, which can be + * customized through <code>JavaCore</code> option + * <code>"org.eclipse.jdt.core.compiler.taskTag"</code>. + * + * @since 2.1 + + + + + + + * Id marker attribute (value <code>"arguments"</code>). Arguments are + * concatenated into one String, prefixed with an argument count (followed + * with colon separator) and separated with '#' characters. For example: { + * "foo", "bar" } is encoded as "2:foo#bar", { } is encoded as "0:". + * <p>Empty argument is encoded as three spaces (" ").</p> + * <p>If the argument contains a '#', the character is doubled.<br> + * {"foo#test", "bar" } is encoded as "2:foo##test#bar" + * </p> + * + * @since 2.0 + * @see CorrectionEngine#getProblemArguments(IMarker) + + + + + + + * ID marker attribute (value <code>"id"</code>). + + + + + + + * ID category marker attribute (value <code>"categoryId"</code>) + * @since 3.2 + + + + + + + * Flags marker attribute (value <code>"flags"</code>). Reserved for + * future use. + + + + + + + * Cycle detected marker attribute (value <code>"cycleDetected"</code>). + * Used only on buildpath problem markers. The value of this attribute is + * either "true" or "false". + + + + + + + * Build path problem marker type (value + * <code>"org.eclipse.jdt.core.buildpath_problem"</code>). This can be + * used to recognize those markers in the workspace that flag problems + * detected by the Java tooling during classpath setting. + + + + + + + * Classpath file format marker attribute (value + * <code>"classpathFileFormat"</code>). Used only on buildpath problem + * markers. The value of this attribute is either "true" or "false". + * + * @since 2.0 + + + + + + + + * Represents the outcome of an Java model operation. Status objects are + * used inside <code>JavaModelException</code> objects to indicate what went + * wrong. + * <p> + * Java model status object are distinguished by their plug-in id: + * <code>getPlugin</code> returns <code>"org.eclipse.jdt.core"</code>. + * <code>getCode</code> returns one of the status codes declared in + * <code>IJavaModelStatusConstants</code>. + * </p> + * <p> + * A Java model status may also carry additional information (that is, in + * addition to the information defined in <code>IStatus</code>): + * <ul> + * <li>elements - optional handles to Java elements associated with the failure</li> + * <li>string - optional string associated with the failure</li> + * </ul> + * + * @see org.eclipse.core.runtime.IStatus + * @see IJavaModelStatusConstants + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + * Returns any Java elements associated with the failure (see specification + * of the status code), or an empty array if no elements are related to this + * particular status code. + * + * @return the list of Java element culprits + * @see IJavaModelStatusConstants + + + + + + + + + + + * Returns the path associated with the failure (see specification + * of the status code), or <code>null</code> if the failure is not + * one of <code>DEVICE_PATH</code>, <code>INVALID_PATH</code>, + * <code>PATH_OUTSIDE_PROJECT</code>, or <code>RELATIVE_PATH</code>. + * + * @return the path that caused the failure, or <code>null</code> if none + * @see IJavaModelStatusConstants#DEVICE_PATH + * @see IJavaModelStatusConstants#INVALID_PATH + * @see IJavaModelStatusConstants#PATH_OUTSIDE_PROJECT + * @see IJavaModelStatusConstants#RELATIVE_PATH + + + + + + + + * Returns the string associated with the failure (see specification + * of the status code), or <code>null</code> if no string is related to this + * particular status code. + * + * @return the string culprit, or <code>null</code> if none + * @see IJavaModelStatusConstants + * @deprecated Use {@link IStatus#getMessage()} instead + + + + + + + + * Returns whether this status indicates that a Java model element does not exist. + * This convenience method is equivalent to + * <code>getCode() == IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST</code>. + * + * @return <code>true</code> if the status code indicates that a Java model + * element does not exist + * @see IJavaModelStatusConstants#ELEMENT_DOES_NOT_EXIST + + + + + + + + + * Status codes used with Java model status objects. + * <p> + * This interface declares constants only. + * </p> + * + * @see IJavaModelStatus + * @see org.eclipse.core.runtime.IStatus#getCode() + * @noimplement This interface is not intended to be implemented by clients. + + + + + + * Status constant indicating that a container path was resolved + * to invalid entries (null or container). + * + * @since 2.0 + + + + + + + * Status constant indicating that a container path was not resolvable + * indicating either the referred container is undefined, unbound. + * + * @since 2.0 + + + + + + + * Status constant indicating that a classpath entry was invalid + + + + + + + * Status constant indicating that a variable path was not resolvable + * indicating either the referred variable is undefined, unbound or the resolved + * variable path does not correspond to an existing file or folder. + + + + + + + * Status constant indicating a core exception occurred. + * Use <code>getException</code> to retrieve a <code>CoreException</code>. + + + + + + + * Status constant indicating one or more of the elements + * supplied are not of a valid type for the operation to + * process. + * The element(s) can be retrieved using <code>getElements</code> on the status object. + + + + + + + * Status constant indicating that no elements were + * provided to the operation for processing. + + + + + + + * Status constant indicating that one or more elements + * supplied do not exist. + * The element(s) can be retrieved using <code>getElements</code> on the status object. + * + * @see IJavaModelStatus#isDoesNotExist() + + + + + + + * Status constant indicating that a <code>null</code> path was + * supplied to the operation. + + + + + + + * Status constant indicating that a path outside of the + * project was supplied to the operation. The path can be retrieved using + * <code>getPath</code> on the status object. + + + + + + + * Status constant indicating that a relative path + * was supplied to the operation when an absolute path is + * required. The path can be retrieved using <code>getPath</code> on the + * status object. + + + + + + + * Status constant indicating that a path specifying a device + * was supplied to the operation when a path with no device is + * required. The path can be retrieved using <code>getPath</code> on the + * status object. + + + + + + + * Status constant indicating that a string + * was supplied to the operation that was <code>null</code>. + + + + + + + * Status constant indicating that the operation encountered + * a read-only element. + * The element(s) can be retrieved using <code>getElements</code> on the status object. + + + + + + + * Status constant indicating that a naming collision would occur + * if the operation proceeded. + + + + + + + * Status constant indicating that a destination provided for a copy/move/rename operation + * is invalid. The destination for a package fragment must be a package fragment root; the + * destination for a compilation unit must be a package fragment; the destination for + * a package declaration or import declaration must be a compilation unit; the + * destination for a type must be a type or compilation unit; the destination for any + * type member (other than a type) must be a type. <br> + * + * The destination element can be retrieved using <code>getElements</code> on the status object. + + + + + + + * Status constant indicating that a path provided to an operation + * is invalid. The path can be retrieved using <code>getPath</code> on the + * status object. + + + + + + + * Status constant indicating the given source position is out of bounds. + + + + + + + * Status constant indicating there is an update conflict + * for a working copy. The compilation unit on which the + * working copy is based has changed since the working copy + * was created. + + + + + + + * Status constant indicating that <code>null</code> was specified + * as a name argument. + + + + + + + * Status constant indicating that a name provided is not syntactically correct. + * The name can be retrieved from <code>getString</code>. + + + + + + + * Status constant indicating that the specified contents + * are not valid. + + + + + + + * Status constant indicating that an <code>java.io.IOException</code> + * occurred. + + + + + + + * Status constant indicating that a <code>DOMException</code> + * occurred. + + + + + + + * Status constant indicating that a <code>TargetException</code> + * occurred. + + + + + + + * Status constant indicating that the Java builder + * could not be initialized. + + + + + + + * Status constant indicating that the Java builder's last built state + * could not be serialized or deserialized. + + + + + + + * Status constant indicating that an error was encountered while + * trying to evaluate a code snippet, or other item. + + + + + + + * Status constant indicating that a sibling specified is not valid. + + + + + + + * Status indicating that a Java element could not be created because + * the underlying resource is invalid. + * @see JavaCore + + + + + + + * Status indicating that a Java element could not be created because + * the underlying resource is not of an appropriate type. + * @see JavaCore + + + + + + + * Status indicating that a Java element could not be created because + * the project owning underlying resource does not have the Java nature. + * @see JavaCore + + + + + + + * Status indicating that the package declaration in a <code>ICompilationUnit</code> + * does not correspond to the <code>IPackageFragment</code> it belongs to. + * The <code>getString</code> method of the associated status object + * gives the name of the package in which the <code>ICompilationUnit</code> is + * declared. + + + + + + + * Status indicating that the corresponding resource has no local contents yet. + * This might happen when attempting to use a resource before its contents + * has been made locally available. + + + + + + + * Status indicating that a .classpath file is ill-formed, and thus cannot + * be read/written successfully. + * @since 2.1 + + + + + + + * Status indicating that a project is involved in a build path cycle. + * @since 2.1 + + + + + + + * Status constant indicating that an inclusion or an exclusion pattern got specified + * on a classpath source entry, though it was explicitely disabled + * according to its project preference settings. + * @see org.eclipse.jdt.core.IJavaProject#getOptions(boolean) + * @since 2.1 + + + + + + + * Status constant indicating that a specific output location got associated + * with a source entry, though it was explicitely disabled according to its project + * preference settings. + * @see org.eclipse.jdt.core.IJavaProject#getOptions(boolean) + * @since 2.1 + + + + + + + * Status constant indicating that a project is prerequisiting some library for which the + * classfile JDK version level is more recent than the project JDK target level setting. + * This can indicate some binary incompatibility issues later on. + * @since 3.0 + + + + + + + * Status constant indicating that a compiler failure occurred. + * @since 3.0 + + + + + + + * Status constant indicating that an element is not on its project's claspath. + * @since 3.1 + + + + + + + * <p>Status constant indicating that the attached javadoc content cannot be retrieved due to multiple reasons: + * invalid url, incorrect proxy, wrong authentication,...</p> + * + * @since 3.2 + + + + + + + * <p>Status constant indicating that the attached javadoc content format is unrecognized.</p> + * + * @since 3.2 + + + + + + + * <p>Status constant indicating that the variable is deprecated.</p> + * + * @since 3.3 + + + + + + + * <p>Status constant indicating that a text edit can not be applied as there + * is a problem with the text edit location.</p> + * + * @since 3.4 + + + + + + + * <p>Status constant indicating that the attached javadoc content cannot be retrieved due to timeout + * @since 3.7 + + + + + + + + * A Java project represents a view of a project resource in terms of Java + * elements such as package fragments, types, methods and fields. + * A project may contain several package roots, which contain package fragments. + * A package root corresponds to an underlying folder or JAR. + * <p> + * Each Java project has a classpath, defining which folders contain source code and + * where required libraries are located. Each Java project also has an output location, + * defining where the builder writes <code>.class</code> files. A project that + * references packages in another project can access the packages by including + * the required project in a classpath entry. The Java model will present the + * source elements in the required project; when building, the compiler will use + * the corresponding generated class files from the required project's output + * location(s)). The classpath format is a sequence of classpath entries + * describing the location and contents of package fragment roots. + * </p> + * Java project elements need to be opened before they can be navigated or manipulated. + * The children of a Java project are the package fragment roots that are + * defined by the classpath and contained in this project (in other words, it + * does not include package fragment roots for other projects). + * </p> + * <p> + * An instance of one of these handles can be created via + * <code>JavaCore.create(project)</code>. + * </p> + * + * @see JavaCore#create(org.eclipse.core.resources.IProject) + * @see IClasspathEntry + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + + * Decodes the classpath entry that has been encoded in the given string + * in the context of this project. + * Returns null if the encoded entry is malformed. + * + * @param encodedEntry the encoded classpath entry + * @return the decoded classpath entry, or <code>null</code> if unable to decode it + * @since 3.2 + + + + + + + + + * Encodes the given classpath entry into a string in the context of this project. + * + * @param classpathEntry the classpath entry to encode + * @return the encoded classpath entry + * @since 3.2 + + + + + + + + + * Returns the <code>IJavaElement</code> corresponding to the given + * classpath-relative path, or <code>null</code> if no such + * <code>IJavaElement</code> is found. The result is one of an + * <code>ICompilationUnit</code>, <code>IClassFile</code>, or + * <code>IPackageFragment</code>. + * <p> + * When looking for a package fragment, there might be several potential + * matches; only one of them is returned. + * + * <p>For example, the path "java/lang/Object.java", would result in the + * <code>ICompilationUnit</code> or <code>IClassFile</code> corresponding to + * "java.lang.Object". The path "java/lang" would result in the + * <code>IPackageFragment</code> for "java.lang". + * @param path the given classpath-relative path + * @exception JavaModelException if the given path is <code>null</code> + * or absolute + * @return the <code>IJavaElement</code> corresponding to the given + * classpath-relative path, or <code>null</code> if no such + * <code>IJavaElement</code> is found + + + + + + + + + * Returns the <code>IJavaElement</code> corresponding to the given + * classpath-relative path, or <code>null</code> if no such + * <code>IJavaElement</code> is found. The result is one of an + * <code>ICompilationUnit</code>, <code>IClassFile</code>, or + * <code>IPackageFragment</code>. If it is an <code>ICompilationUnit</code>, + * its owner is the given owner. + * <p> + * When looking for a package fragment, there might be several potential + * matches; only one of them is returned. + * + * <p>For example, the path "java/lang/Object.java", would result in the + * <code>ICompilationUnit</code> or <code>IClassFile</code> corresponding to + * "java.lang.Object". The path "java/lang" would result in the + * <code>IPackageFragment</code> for "java.lang". + * @param path the given classpath-relative path + * @param owner the owner of the returned compilation unit, ignored if it is + * not a compilation unit. + * @exception JavaModelException if the given path is <code>null</code> + * or absolute + * @return the <code>IJavaElement</code> corresponding to the given + * classpath-relative path, or <code>null</code> if no such + * <code>IJavaElement</code> is found + * @since 3.0 + + + + + + + + + + * Finds the Java element corresponding to the given binding key if any, + * else returns <code>null</code>. Elements are looked up using this + * project's classpath. The first element corresponding to + * the given key on this project's classpath is returned. + * <p>Possible elements are: + * <ul> + * <li>{@link IPackageFragment} for a binding key from an + * {@link IPackageBinding}</li> + * <li>{@link IType} for a binding key from an {@link ITypeBinding}</li> + * <li>{@link IMethod} for a binding key from an {@link IMethodBinding}</li> + * <li>{@link IField} for a binding key from an {@link IVariableBinding} + * representing a {@link IVariableBinding#isField() field}</li> + * <li>{@link ITypeParameter} for a binding key from an {@link ITypeBinding} + * representing a {@link ITypeBinding#isTypeVariable() type + * variable}</li> + * <li>{@link IAnnotation} for a binding key from an + * {@link IAnnotationBinding}</li> + * </ul></p> + * <p>Note: if two methods correspond to the binding key because their + * parameter types' simple names are the same, then the first one is returned. + * For example, if a class defines two methods <code>foo(p1.Y, String)</code> + * and <code>foo(p2.Y, String)</code>, in both cases the parameter type's + * simple names are <code>{"Y", "String"}</code>. Thus + * <code>foo(p1.Y, String)</code> is returned.</p> + * + * @param bindingKey the given binding key + * @param owner the owner of the returned element's compilation unit, + * or <code>null</code> if the default working copy owner must be + * used + * @exception JavaModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the Java element corresponding to the given key, + * or <code>null</code> if no such Java element is found + * @since 3.4 + + + + + + + + + + * Returns the first existing package fragment on this project's classpath + * whose path matches the given (absolute) path, or <code>null</code> if none + * exist. + * The path can be: + * - internal to the workbench: "/Project/src" + * - external to the workbench: "c:/jdk/classes.zip/java/lang" + * @param path the given absolute path + * @exception JavaModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first existing package fragment on this project's classpath + * whose path matches the given (absolute) path, or <code>null</code> if none + * exist + + + + + + + + + * Returns the existing package fragment root on this project's classpath + * whose path matches the given (absolute) path, or <code>null</code> if + * one does not exist. + * The path can be: + * - internal to the workbench: "/Compiler/src" + * - external to the workbench: "c:/jdk/classes.zip" + * @param path the given absolute path + * @exception JavaModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the existing package fragment root on this project's classpath + * whose path matches the given (absolute) path, or <code>null</code> if + * one does not exist + + + + + + + + + * Returns the existing package fragment roots identified by the given entry. + * A classpath entry within the current project identifies a single root. + * <p> + * If the classpath entry denotes a variable, it will be resolved and return + * the roots of the target entry (empty if not resolvable). + * <p> + * If the classpath entry denotes a container, it will be resolved and return + * the roots corresponding to the set of container entries (empty if not resolvable). + * <p> + * The result does not include package fragment roots in other projects + * referenced on this project's classpath. + * + * @param entry the given entry + * @return the existing package fragment roots identified by the given entry + * @see IClasspathContainer + * @since 2.1 + + + + + + + + + + + + * Returns the first type found following this project's classpath + * with the given fully qualified name or <code>null</code> if none is found. + * The fully qualified name is a dot-separated name. For example, + * a class B defined as a member type of a class A in package x.y should have a + * the fully qualified name "x.y.A.B". + * + * Note that in order to be found, a type name (or its toplevel enclosing + * type name) must match its corresponding compilation unit name. As a + * consequence, secondary types cannot be found using this functionality. + * To find secondary types use {@link #findType(String, IProgressMonitor)} instead. + * + * @param fullyQualifiedName the given fully qualified name + * @exception JavaModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's classpath + * with the given fully qualified name or <code>null</code> if none is found + * @see IType#getFullyQualifiedName(char) + * @since 2.0 + + + + + + + + + * Same functionality as {@link #findType(String)} but also look for secondary + * types if given name does not match a compilation unit name. + * + * @param fullyQualifiedName the given fully qualified name + * @param progressMonitor the progress monitor to report progress to, + * or <code>null</code> if no progress monitor is provided + * @exception JavaModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's classpath + * with the given fully qualified name or <code>null</code> if none is found + * @see IType#getFullyQualifiedName(char) + * @since 3.2 + + + + + + + + + + * Returns the first type found following this project's classpath + * with the given fully qualified name or <code>null</code> if none is found. + * The fully qualified name is a dot-separated name. For example, + * a class B defined as a member type of a class A in package x.y should have a + * the fully qualified name "x.y.A.B". + * If the returned type is part of a compilation unit, its owner is the given + * owner. + * + * Note that in order to be found, a type name (or its toplevel enclosing + * type name) must match its corresponding compilation unit name. As a + * consequence, secondary types cannot be found using this functionality. + * To find secondary types use {@link #findType(String, WorkingCopyOwner, IProgressMonitor)} + * instead. + * + * @param fullyQualifiedName the given fully qualified name + * @param owner the owner of the returned type's compilation unit + * @exception JavaModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's classpath + * with the given fully qualified name or <code>null</code> if none is found + * @see IType#getFullyQualifiedName(char) + * @since 3.0 + + + + + + + + + + * Same functionality as {@link #findType(String, WorkingCopyOwner)} + * but also look for secondary types if given name does not match + * a compilation unit name. + * + * @param fullyQualifiedName the given fully qualified name + * @param owner the owner of the returned type's compilation unit + * @param progressMonitor the progress monitor to report progress to, + * or <code>null</code> if no progress monitor is provided + * @exception JavaModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's classpath + * with the given fully qualified name or <code>null</code> if none is found + * @see IType#getFullyQualifiedName(char) + * @since 3.2 + + + + + + + + + + + * Returns the first type found following this project's classpath + * with the given package name and type qualified name + * or <code>null</code> if none is found. + * The package name is a dot-separated name. + * The type qualified name is also a dot-separated name. For example, + * a class B defined as a member type of a class A should have the + * type qualified name "A.B". + * + * Note that in order to be found, a type name (or its toplevel enclosing + * type name) must match its corresponding compilation unit name. As a + * consequence, secondary types cannot be found using this functionality. + * To find secondary types use {@link #findType(String, String, IProgressMonitor)} + * instead. + * + * @param packageName the given package name + * @param typeQualifiedName the given type qualified name + * @exception JavaModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's classpath + * with the given package name and type qualified name + * or <code>null</code> if none is found + * @see IType#getTypeQualifiedName(char) + * @since 2.0 + + + + + + + + + + * Same functionality as {@link #findType(String, String)} but also look for + * secondary types if given name does not match a compilation unit name. + * + * @param packageName the given package name + * @param typeQualifiedName the given type qualified name + * @param progressMonitor the progress monitor to report progress to, + * or <code>null</code> if no progress monitor is provided + * @exception JavaModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's classpath + * with the given fully qualified name or <code>null</code> if none is found + * @see IType#getFullyQualifiedName(char) + * @since 3.2 + + + + + + + + + + + * Returns the first type found following this project's classpath + * with the given package name and type qualified name + * or <code>null</code> if none is found. + * The package name is a dot-separated name. + * The type qualified name is also a dot-separated name. For example, + * a class B defined as a member type of a class A should have the + * type qualified name "A.B". + * If the returned type is part of a compilation unit, its owner is the given + * owner. + * + * Note that in order to be found, a type name (or its toplevel enclosing + * type name) must match its corresponding compilation unit name. As a + * consequence, secondary types cannot be found using this functionality. + * To find secondary types use {@link #findType(String, String, WorkingCopyOwner, IProgressMonitor)} + * instead. + * + * @param packageName the given package name + * @param typeQualifiedName the given type qualified name + * @param owner the owner of the returned type's compilation unit + * @exception JavaModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's classpath + * with the given package name and type qualified name + * or <code>null</code> if none is found + * @see IType#getTypeQualifiedName(char) + * @since 3.0 + + + + + + + + + + + * Same functionality as {@link #findType(String, String, WorkingCopyOwner)} + * but also look for secondary types if given name does not match a compilation unit name. + * + * @param packageName the given package name + * @param typeQualifiedName the given type qualified name + * @param owner the owner of the returned type's compilation unit + * @param progressMonitor the progress monitor to report progress to, + * or <code>null</code> if no progress monitor is provided + * @exception JavaModelException if this project does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the first type found following this project's classpath + * with the given fully qualified name or <code>null</code> if none is found + * @see IType#getFullyQualifiedName(char) + * @since 3.2 + + + + + + + + + + + + * Returns all of the existing package fragment roots that exist + * on the classpath, in the order they are defined by the classpath. + * + * @return all of the existing package fragment roots that exist + * on the classpath + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + + + + * Returns an array of non-Java resources directly contained in this project. + * It does not transitively answer non-Java resources contained in folders; + * these would have to be explicitly iterated over. + * <p> + * Non-Java resources includes other files and folders located in the + * project not accounted for by any of it source or binary package fragment + * roots. If the project is a source folder itself, resources excluded from the + * corresponding source classpath entry by one or more exclusion patterns + * are considered non-Java resources and will appear in the result + * (possibly in a folder) + * </p> + * + * @return an array of non-Java resources (<code>IFile</code>s and/or + * <code>IFolder</code>s) directly contained in this project + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + + + + * Helper method for returning one option value only. Equivalent to <code>(String)this.getOptions(inheritJavaCoreOptions).get(optionName)</code> + * Note that it may answer <code>null</code> if this option does not exist, or if there is no custom value for it. + * <p> + * For a complete description of the configurable options, see <code>JavaCore#getDefaultOptions</code>. + * </p> + * + * @param optionName the name of an option + * @param inheritJavaCoreOptions - boolean indicating whether JavaCore options should be inherited as well + * @return the String value of a given option + * @see JavaCore#getDefaultOptions() + * @since 2.1 + + + + + + + + + + * Returns the table of the current custom options for this project. Projects remember their custom options, + * in other words, only the options different from the the JavaCore global options for the workspace. + * A boolean argument allows to directly merge the project options with global ones from <code>JavaCore</code>. + * <p> + * For a complete description of the configurable options, see <code>JavaCore#getDefaultOptions</code>. + * </p> + * + * @param inheritJavaCoreOptions - boolean indicating whether JavaCore options should be inherited as well + * @return table of current settings of all options + * (key type: <code>String</code>; value type: <code>String</code>) + * @see JavaCore#getDefaultOptions() + * @since 2.1 + + + + + + + + + * Returns the default output location for this project as a workspace- + * relative absolute path. + * <p> + * The default output location is where class files are ordinarily generated + * (and resource files, copied). Each source classpath entry can also + * specify an output location for the generated class files (and copied + * resource files) corresponding to compilation units under that source + * folder. This makes it possible to arrange generated class files for + * different source folders in different output folders, and not + * necessarily the default output folder. This means that the generated + * class files for the project may end up scattered across several folders, + * rather than all in the default output folder (which is more standard). + * </p> + * + * @return the workspace-relative absolute path of the default output folder + * @exception JavaModelException if this element does not exist + * @see #setOutputLocation(org.eclipse.core.runtime.IPath, IProgressMonitor) + * @see IClasspathEntry#getOutputLocation() + + + + + + + + * Returns a package fragment root for an external library + * (a ZIP archive - e.g. a <code>.jar</code>, a <code>.zip</code> file, etc. - + * or - since 3.4 - a class folder) at the specified file system path. + * This is a handle-only method. The underlying <code>java.io.File</code> + * may or may not exist. No resource is associated with this local library + * package fragment root. + * + * @param externalLibraryPath the library's file system path + * @return a package fragment root for the external library at the specified file system path + + + + + + + + + * Returns a package fragment root for the given resource, which + * must either be a folder representing the top of a package hierarchy, + * or a ZIP archive (e.g. a <code>.jar</code>, a <code>.zip</code> file, etc.) + * This is a handle-only method. The underlying resource may or may not exist. + * + * @param resource the given resource + * @return a package fragment root for the given resource, which + * must either be a folder representing the top of a package hierarchy, + * or a ZIP archive (e.g. a <code>.jar</code>, a <code>.zip</code> file, etc.) + + + + + + + + + * Returns all of the package fragment roots contained in this + * project, identified on this project's resolved classpath. The result + * does not include package fragment roots in other projects referenced + * on this project's classpath. + * + * <p>NOTE: This is equivalent to <code>getChildren()</code>. + * + * @return all of the package fragment roots contained in this + * project, identified on this project's resolved classpath + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + + + + * Returns the existing package fragment roots identified by the given entry. + * A classpath entry within the current project identifies a single root. + * <p> + * If the classpath entry denotes a variable, it will be resolved and return + * the roots of the target entry (empty if not resolvable). + * <p> + * If the classpath entry denotes a container, it will be resolved and return + * the roots corresponding to the set of container entries (empty if not resolvable). + * <p> + * The result does not include package fragment roots in other projects + * referenced on this project's classpath. + * + * @param entry the given entry + * @return the existing package fragment roots identified by the given entry + * @see IClasspathContainer + * @deprecated Use {@link IJavaProject#findPackageFragmentRoots(IClasspathEntry)} instead + + + + + + + + + + + + * Returns all package fragments in all package fragment roots contained + * in this project. This is a convenience method. + * + * Note that the package fragment roots corresponds to the resolved + * classpath of the project. + * + * @return all package fragments in all package fragment roots contained + * in this project + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + + + + * Returns the <code>IProject</code> on which this <code>IJavaProject</code> + * was created. This is handle-only method. + * + * @return the <code>IProject</code> on which this <code>IJavaProject</code> + * was created + + + + + + + + * Returns the raw classpath for the project, as a list of classpath + * entries. This corresponds to the exact set of entries which were assigned + * using <code>setRawClasspath</code>, in particular such a classpath may + * contain classpath variable and classpath container entries. Classpath + * variable and classpath container entries can be resolved using the + * helper method <code>getResolvedClasspath</code>; classpath variable + * entries also can be resolved individually using + * <code>JavaCore#getClasspathVariable</code>). + * <p> + * Both classpath containers and classpath variables provides a level of + * indirection that can make the <code>.classpath</code> file stable across + * workspaces. + * As an example, classpath variables allow a classpath to no longer refer + * directly to external JARs located in some user specific location. + * The classpath can simply refer to some variables defining the proper + * locations of these external JARs. Similarly, classpath containers + * allows classpath entries to be computed dynamically by the plug-in that + * defines that kind of classpath container. + * </p> + * <p> + * Note that in case the project isn't yet opened, the classpath will + * be read directly from the associated <tt>.classpath</tt> file. + * </p> + * + * @return the raw classpath for the project, as a list of classpath entries + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @see IClasspathEntry + + + + + + + + + + + * Returns the names of the projects that are directly required by this + * project. A project is required if it is in its classpath. + * <p> + * The project names are returned in the order they appear on the classpath. + * + * @return the names of the projects that are directly required by this + * project in classpath order + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + + + + * This is a helper method returning the resolved classpath for the project + * as a list of simple (non-variable, non-container) classpath entries. + * All classpath variable and classpath container entries in the project's + * raw classpath will be replaced by the simple classpath entries they + * resolve to. + * <p> + * The resulting resolved classpath is accurate for the given point in time. + * If the project's raw classpath is later modified, or if classpath + * variables are changed, the resolved classpath can become out of date. + * Because of this, hanging on resolved classpath is not recommended. + * </p> + * <p> + * Note that if the resolution creates duplicate entries + * (i.e. {@link IClasspathEntry entries} which are {@link Object#equals(Object)}), + * only the first one is added to the resolved classpath. + * </p> + * + * @param ignoreUnresolvedEntry indicates how to handle unresolvable + * variables and containers; <code>true</code> indicates that missing + * variables and unresolvable classpath containers should be silently + * ignored, and that the resulting list should consist only of the + * entries that could be successfully resolved; <code>false</code> indicates + * that a <code>JavaModelException</code> should be thrown for the first + * unresolved variable or container + * @return the resolved classpath for the project as a list of simple + * classpath entries, where all classpath variable and container entries + * have been resolved and substituted with their final target entries + * @exception JavaModelException in one of the corresponding situation: + * <ul> + * <li>this element does not exist</li> + * <li>an exception occurs while accessing its corresponding resource</li> + * <li>a classpath variable or classpath container was not resolvable + * and <code>ignoreUnresolvedEntry</code> is <code>false</code>.</li> + * </ul> + * @see IClasspathEntry + + + + + + + + + + + + * Returns whether this project has been built at least once and thus whether it has a build state. + * @return true if this project has been built at least once, false otherwise + + + + + + + + * Returns whether setting this project's classpath to the given classpath entries + * would result in a cycle. + * + * If the set of entries contains some variables, those are resolved in order to determine + * cycles. + * + * @param entries the given classpath entries + * @return true if the given classpath entries would result in a cycle, false otherwise + + + + + + + + + + + + * Returns whether the given element is on the classpath of this project, + * that is, referenced from a classpath entry and not explicitly excluded + * using an exclusion pattern. + * + * @param element the given element + * @return <code>true</code> if the given element is on the classpath of + * this project, <code>false</code> otherwise + * @see IClasspathEntry#getInclusionPatterns() + * @see IClasspathEntry#getExclusionPatterns() + * @since 2.0 + + + + + + + + + * Returns whether the given resource is on the classpath of this project, + * that is, referenced from a classpath entry and not explicitly excluded + * using an exclusion pattern. + * + * @param resource the given resource + * @return <code>true</code> if the given resource is on the classpath of + * this project, <code>false</code> otherwise + * @see IClasspathEntry#getInclusionPatterns() + * @see IClasspathEntry#getExclusionPatterns() + * @since 2.1 + + + + + + + + + * Creates a new evaluation context. + * @return a new evaluation context. + + + + + + + + * Creates and returns a type hierarchy for all types in the given + * region, considering subtypes within that region. + * + * @param monitor the given progress monitor + * @param region the given region + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @exception IllegalArgumentException if region is <code>null</code> + * @return a type hierarchy for all types in the given + * region, considering subtypes within that region + + + + + + + + + + * Creates and returns a type hierarchy for all types in the given + * region, considering subtypes within that region and considering types in the + * working copies with the given owner. + * In other words, the owner's working copies will take + * precedence over their original compilation units in the workspace. + * <p> + * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + * <p> + * + * @param monitor the given progress monitor + * @param region the given region + * @param owner the owner of working copies that take precedence over their original compilation units + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @exception IllegalArgumentException if region is <code>null</code> + * @return a type hierarchy for all types in the given + * region, considering subtypes within that region + * @since 3.0 + + + + + + + + + + + * Creates and returns a type hierarchy for the given type considering + * subtypes in the specified region. + * + * @param type the given type + * @param region the given region + * @param monitor the given monitor + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * + * @exception IllegalArgumentException if type or region is <code>null</code> + * @return a type hierarchy for the given type considering + * subtypes in the specified region + + + + + + + + + + + * Creates and returns a type hierarchy for the given type considering + * subtypes in the specified region and considering types in the + * working copies with the given owner. + * In other words, the owner's working copies will take + * precedence over their original compilation units in the workspace. + * <p> + * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + * <p> + * + * @param type the given type + * @param region the given region + * @param monitor the given monitor + * @param owner the owner of working copies that take precedence over their original compilation units + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * + * @exception IllegalArgumentException if type or region is <code>null</code> + * @return a type hierarchy for the given type considering + * subtypes in the specified region + * @since 3.0 + + + + + + + + + + + + * Returns the default output location for the project as defined by its <code>.classpath</code> file from disk, or <code>null</code> + * if unable to read the file. + * <p> + * This output location may differ from the in-memory one returned by <code>getOutputLocation</code>, in case the + * automatic reconciliation mechanism has not been performed yet. Usually, any change to the <code>.classpath</code> file + * is automatically noticed and reconciled at the next resource change notification event. + * However, if the file is modified within an operation, where this change needs to be taken into account before the + * operation ends, then the output location from disk can be read using this method, and further assigned to the project + * using <code>setRawClasspath(...)</code>. + * <p> + * The default output location is where class files are ordinarily generated + * (and resource files, copied). Each source classpath entry can also + * specify an output location for the generated class files (and copied + * resource files) corresponding to compilation units under that source + * folder. This makes it possible to arrange generated class files for + * different source folders in different output folders, and not + * necessarily the default output folder. This means that the generated + * class files for the project may end up scattered across several folders, + * rather than all in the default output folder (which is more standard). + * <p> + * In order to manually force a project classpath refresh, one can simply assign the project classpath using the result of this + * method, as follows: + * <code>proj.setRawClasspath(proj.readRawClasspath(), proj.readOutputLocation(), monitor)</code> + * (note that the <code>readRawClasspath/readOutputLocation</code> methods could return <code>null</code>). + * <p> + * @return the workspace-relative absolute path of the default output folder + * @see #getOutputLocation() + * @since 3.0 + + + + + + + + * Returns the raw classpath for the project as defined by its + * <code>.classpath</code> file from disk, or <code>null</code> + * if unable to read the file. + * <p> + * This classpath may differ from the in-memory classpath returned by + * <code>getRawClasspath</code>, in case the automatic reconciliation + * mechanism has not been performed yet. Usually, any change to the + * <code>.classpath</code> file is automatically noticed and reconciled at + * the next resource change notification event. However, if the file is + * modified within an operation, where this change needs to be taken into + * account before the operation ends, then the classpath from disk can be + * read using this method, and further assigned to the project using + * <code>setRawClasspath(...)</code>. + * </p> + * <p> + * Classpath variable and classpath container entries can be resolved using + * the helper method <code>getResolvedClasspath</code>; classpath variable + * entries also can be resolved individually using + * <code>JavaCore#getClasspathVariable</code>). + * </p> + * <p> + * Note that no check is performed whether the project has the Java nature + * set, allowing an existing <code>.classpath</code> file to be considered + * independantly (unlike <code>getRawClasspath</code> which requires the + * Java nature to be associated with the project). + * </p> + * <p> + * In order to manually force a project classpath refresh, one can simply + * assign the project classpath using the result of this method, as follows: + * <code>proj.setRawClasspath(proj.readRawClasspath(), proj.readOutputLocation(), monitor)</code> + * (note that the <code>readRawClasspath/readOutputLocation</code> methods + * could return <code>null</code>). + * </p> + * + * @return the raw classpath from disk for the project, as a list of + * classpath entries + * @see #getRawClasspath() + * @see IClasspathEntry + * @since 3.0 + + + + + + + + + + + * Helper method for setting one option value only. + *<p> + * Equivalent to: + * <pre> + * Map options = this.getOptions(false); + * map.put(optionName, optionValue); + * this.setOptions(map) + * </pre> + * <p> + * For a complete description of the configurable options, see <code>JavaCore#getDefaultOptions</code>. + * </p> + * + * @param optionName the name of an option + * @param optionValue the value of the option to set. If <code>null</code>, then the option + * is removed from project preferences. + * @throws NullPointerException if <code>optionName</code> is <code>null</code> + * (see {@link org.osgi.service.prefs.Preferences#put(String, String)}). + * @see JavaCore#getDefaultOptions() + * @since 3.0 + + + + + + + + + * Sets the project custom options. All and only the options explicitly included in the given table + * are remembered; all previous option settings are forgotten, including ones not explicitly + * mentioned. + * <p> + * For a complete description of the configurable options, see <code>JavaCore#getDefaultOptions</code>. + * </p> + * + * @param newOptions the new options (key type: <code>String</code>; value type: <code>String</code>), + * or <code>null</code> to flush all custom options (clients will automatically get the global JavaCore options). + * @see JavaCore#getDefaultOptions() + * @since 2.1 + + + + + + + + * Sets the default output location of this project to the location + * described by the given workspace-relative absolute path. + * <p> + * The default output location is where class files are ordinarily generated + * (and resource files, copied). Each source classpath entries can also + * specify an output location for the generated class files (and copied + * resource files) corresponding to compilation units under that source + * folder. This makes it possible to arrange that generated class files for + * different source folders to end up in different output folders, and not + * necessarily the default output folder. This means that the generated + * class files for the project may end up scattered across several folders, + * rather than all in the default output folder (which is more standard). + * </p> + * + * @param path the workspace-relative absolute path of the default output + * folder + * @param monitor the progress monitor + * + * @exception JavaModelException if the classpath could not be set. Reasons include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> The path refers to a location not contained in this project (<code>PATH_OUTSIDE_PROJECT</code>) + * <li> The path is not an absolute path (<code>RELATIVE_PATH</code>) + * <li> The path is nested inside a package fragment root of this project (<code>INVALID_PATH</code>) + * <li> The output location is being modified during resource change event notification (CORE_EXCEPTION) + * </ul> + * @see #getOutputLocation() + * @see IClasspathEntry#getOutputLocation() + + + + + + + + + * Sets both the classpath of this project and its default output + * location at once. The classpath is defined using a list of classpath + * entries. In particular such a classpath may contain classpath variable entries. + * Classpath variable entries can be resolved individually ({@link JavaCore#getClasspathVariable(String)}), + * or the full classpath can be resolved at once using the helper method {@link #getResolvedClasspath(boolean)}. + * <p> + * A classpath variable provides an indirection level for better sharing a classpath. As an example, it allows + * a classpath to no longer refer directly to external JARs located in some user specific location. The classpath + * can simply refer to some variables defining the proper locations of these external JARs. + * </p><p> + * If it is specified that this operation cannot modify resources, the .classpath file will not be written to disk + * and no error marker will be generated. To synchronize the .classpath with the in-memory classpath, + * one can use <code>setRawClasspath(readRawClasspath(), true, monitor)</code>. + * </p><p> + * Setting the classpath to <code>null</code> specifies a default classpath + * (the project root). Setting the classpath to an empty array specifies an + * empty classpath. + * </p><p> + * If a cycle is detected while setting this classpath (and if resources can be modified), an error marker will be added + * to the project closing the cycle. + * To avoid this problem, use {@link #hasClasspathCycle(IClasspathEntry[])} + * before setting the classpath. + * <p> + * This operation acquires a lock on the workspace's root. + * + * @param entries a list of classpath entries + * @param outputLocation the default output location + * @param canModifyResources whether resources should be written to disk if needed + * @param monitor the given progress monitor + * @exception JavaModelException if the classpath could not be set. Reasons include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> The classpath is being modified during resource change event notification (CORE_EXCEPTION) + * <li> The classpath failed the validation check as defined by {@link JavaConventions#validateClasspath(IJavaProject, IClasspathEntry[], IPath)} + * </ul> + * @see IClasspathEntry + * @since 3.2 + + + + + + + + + + + + + + * Sets the classpath of this project using a list of classpath entries. In particular such a classpath may contain + * classpath variable entries. Classpath variable entries can be resolved individually ({@link JavaCore#getClasspathVariable(String)}), + * or the full classpath can be resolved at once using the helper method {@link #getResolvedClasspath(boolean)}. + * <p> + * A classpath variable provides an indirection level for better sharing a classpath. As an example, it allows + * a classpath to no longer refer directly to external JARs located in some user specific location. The classpath + * can simply refer to some variables defining the proper locations of these external JARs. + * </p><p> + * If it is specified that this operation cannot modify resources, the .classpath file will not be written to disk + * and no error marker will be generated. To synchronize the .classpath with the in-memory classpath, + * one can use <code>setRawClasspath(readRawClasspath(), true, monitor)</code>. + * </p><p> + * Setting the classpath to <code>null</code> specifies a default classpath + * (the project root). Setting the classpath to an empty array specifies an + * empty classpath. + * </p><p> + * If a cycle is detected while setting this classpath (and if resources can be modified), an error marker will be added + * to the project closing the cycle. + * To avoid this problem, use {@link #hasClasspathCycle(IClasspathEntry[])} + * before setting the classpath. + * <p> + * This operation acquires a lock on the workspace's root. + * + * @param entries a list of classpath entries + * @param canModifyResources whether resources should be written to disk if needed + * @param monitor the given progress monitor + * @exception JavaModelException if the classpath could not be set. Reasons include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> The classpath is being modified during resource change event notification (CORE_EXCEPTION) + * <li> The classpath failed the validation check as defined by {@link JavaConventions#validateClasspath(IJavaProject, IClasspathEntry[], IPath)} + * </ul> + * @see IClasspathEntry + * @since 3.2 + + + + + + + + + + + + + * Works similar to {@link #setRawClasspath(IClasspathEntry[], IPath, IProgressMonitor)} and + * additionally allows persisting the given array of referenced entries for this project. + * The referenced entries and their attributes are stored in the .classpath file of this + * project. For details on referenced entries, see + * {@link JavaCore#getReferencedClasspathEntries(IClasspathEntry, IJavaProject)} + * and {@link IClasspathEntry#getReferencingEntry()}. + * <p> + * Since the referenced entries are stored in the .classpath file, clients can store additional + * information that belong to these entries and retrieve them across sessions, though the referenced + * entries themselves may not be present in the raw classpath. By passing a <code>null</code> + * referencedEntries, clients can choose not to modify the already persisted referenced entries, + * which is fully equivalent to {@link #setRawClasspath(IClasspathEntry[], IPath, IProgressMonitor)}. + * If an empty array is passed as referencedEntries, the already persisted referenced entries, + * if any, will be cleared. + * </p> <p> + * If there are duplicates of a referenced entry or if any of the <code>referencedEntries</code> + * is already present in the raw classpath(<code>entries</code>) those referenced entries will + * be excluded and not be persisted. + *</p> + * @param entries a list of classpath entries + * @param referencedEntries the list of referenced classpath entries to be persisted + * @param outputLocation the default output location + * @param monitor the given progress monitor + * @exception JavaModelException if the classpath could not be set. Reasons include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> The classpath is being modified during resource change event notification (CORE_EXCEPTION) + * <li> The classpath failed the validation check as defined by {@link JavaConventions#validateClasspath(IJavaProject, IClasspathEntry[], IPath)} + * </ul> + * @see IClasspathEntry + * @see #getReferencedClasspathEntries() + * @since 3.6 + + + + + + + + + + + + + + + + + * Returns the list of referenced classpath entries stored in the .classpath file of <code>this</code> + * java project. Clients can store the referenced classpath entries using + * {@link #setRawClasspath(IClasspathEntry[], IClasspathEntry[], IPath, IProgressMonitor)} + * If the client has not stored any referenced entries for this project, an empty array is returned. + * + * @throws JavaModelException + * @return an array of referenced classpath entries stored for this java project or an empty array if none + * stored earlier. + * @since 3.6 + + + + + + + + + + + * Sets the classpath of this project using a list of classpath entries. In particular such a classpath may contain + * classpath variable entries. Classpath variable entries can be resolved individually ({@link JavaCore#getClasspathVariable(String)}), + * or the full classpath can be resolved at once using the helper method {@link #getResolvedClasspath(boolean)}. + * <p> + * A classpath variable provides an indirection level for better sharing a classpath. As an example, it allows + * a classpath to no longer refer directly to external JARs located in some user specific location. The classpath + * can simply refer to some variables defining the proper locations of these external JARs. + * <p> + * Setting the classpath to <code>null</code> specifies a default classpath + * (the project root). Setting the classpath to an empty array specifies an + * empty classpath. + * <p> + * If a cycle is detected while setting this classpath, an error marker will be added + * to the project closing the cycle. + * To avoid this problem, use {@link #hasClasspathCycle(IClasspathEntry[])} + * before setting the classpath. + * <p> + * This operation acquires a lock on the workspace's root. + * + * @param entries a list of classpath entries + * @param monitor the given progress monitor + * @exception JavaModelException if the classpath could not be set. Reasons include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> The classpath is being modified during resource change event notification (CORE_EXCEPTION) + * <li> The classpath failed the validation check as defined by {@link JavaConventions#validateClasspath(IJavaProject, IClasspathEntry[], IPath)} + * </ul> + * @see IClasspathEntry + + + + + + + + + + + + * Sets the both the classpath of this project and its default output + * location at once. The classpath is defined using a list of classpath + * entries. In particular, such a classpath may contain classpath variable + * entries. Classpath variable entries can be resolved individually (see + * ({@link JavaCore#getClasspathVariable(String)}), or the full classpath can be + * resolved at once using the helper method + * {@link #getResolvedClasspath(boolean)}. + * <p> + * A classpath variable provides an indirection level for better sharing a + * classpath. As an example, it allows a classpath to no longer refer + * directly to external JARs located in some user specific location. The + * classpath can simply refer to some variables defining the proper + * locations of these external JARs. + * </p> + * <p> + * Setting the classpath to <code>null</code> specifies a default classpath + * (the project root). Setting the classpath to an empty array specifies an + * empty classpath. + * </p> + * <p> + * If a cycle is detected while setting this classpath, an error marker will + * be added to the project closing the cycle. To avoid this problem, use + * {@link #hasClasspathCycle(IClasspathEntry[])} before setting + * the classpath. + * </p> + * <p> + * This operation acquires a lock on the workspace's root. + * </p> + * + * @param entries a list of classpath entries + * @param monitor the progress monitor + * @param outputLocation the default output location + * @exception JavaModelException if the classpath could not be set. Reasons + * include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> Two or more entries specify source roots with the same or overlapping paths (NAME_COLLISION) + * <li> A entry of kind <code>CPE_PROJECT</code> refers to this project (INVALID_PATH) + * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li>The output location path refers to a location not contained in this project (<code>PATH_OUTSIDE_PROJECT</code>) + * <li>The output location path is not an absolute path (<code>RELATIVE_PATH</code>) + * <li>The output location path is nested inside a package fragment root of this project (<code>INVALID_PATH</code>) + * <li> The classpath is being modified during resource change event notification (CORE_EXCEPTION) + * </ul> + * @see IClasspathEntry + * @since 2.0 + + + + + + + + + + + + + + * Represents a local variable declared in a method or an initializer. + * <code>ILocalVariable</code> are pseudo-elements created as the result of a <code>ICodeAssist.codeSelect(...)</code> + * operation. They are not part of the Java model (<code>exists()</code> returns whether the parent exists rather than + * whether the local variable exists in the parent) and they are not included in the children of an <code>IMethod</code> + * or an <code>IInitializer</code>. + * <p> + * In particular such a pseudo-element should not be used as a handle. For example its name range won't be updated + * if the underlying source changes. + * </p> + * + * @since 3.0 + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + * Common protocol for Java elements that can be members of types. + * This set consists of <code>IType</code>, <code>IMethod</code>, + * <code>IField</code>, and <code>IInitializer</code>. + * <p> + * The children are listed in the order in which they appear in the source or class file. + * </p> + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + + + * Returns the categories defined by this member's Javadoc. A category is the identifier + * following the tag <code>@category</code> in the member's Javadoc. + * Returns an empty array if no category is defined in this member's Javadoc. + * + * @return the categories defined by this member's doc + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 3.2 + + + + + + + + + + + * Returns the class file in which this member is declared, or <code>null</code> + * if this member is not declared in a class file (for example, a source type). + * This is a handle-only method. + * + * @return the class file in which this member is declared, or <code>null</code> + * if this member is not declared in a class file (for example, a source type) + + + + + + + + * Returns the compilation unit in which this member is declared, or <code>null</code> + * if this member is not declared in a compilation unit (for example, a binary type). + * This is a handle-only method. + * + * @return the compilation unit in which this member is declared, or <code>null</code> + * if this member is not declared in a compilation unit (for example, a binary type) + + + + + + + + * Returns the type in which this member is declared, or <code>null</code> + * if this member is not declared in a type (for example, a top-level type). + * This is a handle-only method. + * + * @return the type in which this member is declared, or <code>null</code> + * if this member is not declared in a type (for example, a top-level type) + + + + + + + + * Returns the modifier flags for this member. The flags can be examined using class + * <code>Flags</code>. + * <p> + * Note that only flags as indicated in the source are returned. Thus if an interface + * defines a method <code>void myMethod();</code> the flags don't include the + * 'public' flag. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the modifier flags for this member + * @see Flags + + + + + + + + * Returns the Javadoc range if this element is from source or if this element + * is a binary element with an attached source, null otherwise. + * + * <p>If this element is from source, the javadoc range is + * extracted from the corresponding source.</p> + * <p>If this element is from a binary, the javadoc is extracted from the + * attached source if present.</p> + * <p>If this element's openable is not consistent, then null is returned.</p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return a source range corresponding to the javadoc source or <code>null</code> + * if no source is available, this element has no javadoc comment or + * this element's openable is not consistent + * @see IOpenable#isConsistent() + * @since 3.2 + + + + + + + + * Returns the position relative to the order this member is defined in the source. + * Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0). + * <p> + * Two members m1 and m2 that are equal (e.g. 2 fields with the same name in + * the same type) can be distinguished using their occurrence counts. If member + * m1 appears first in the source, it will have an occurrence count of 1. If member + * m2 appears right after member m1, it will have an occurrence count of 2. + * </p><p> + * The occurrence count can be used to distinguish initializers inside a type + * or anonymous types inside a method. + * </p><p> + * This is a handle-only method. The member may or may not be present. + * </p> + * + * @return the position relative to the order this member is defined in the source + * @since 3.2 + + + + + + + + * Returns the Java type root in which this member is declared. + * This is a handle-only method. + * + * @return the Java type root in which this member is declared. + * @since 3.3 + + + + + + + + * Returns the local or anonymous type declared in this source member with the given simple name and/or + * with the specified position relative to the order they are defined in the source. + * The name is empty if it is an anonymous type. + * Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0). + * This is a handle-only method. The type may or may not exist. + * Throws a <code>RuntimeException</code> if this member is not a source member. + * + * @param name the given simple name + * @param occurrenceCount the specified position + * @return the type with the given name and/or with the specified position relative to the order they are defined in the source + * @since 3.0 + + + + + + + + + + * Returns whether this member is from a class file. + * This is a handle-only method. + * + * @return <code>true</code> if from a class file, and <code>false</code> if + * from a compilation unit + + + + + + + + + * Represents a member-value pair of an annotation. + * The {@link #getValue() value} is represented by an {@link Object}. To get the exact + * type of this object, use its {@link #getValueKind() value kind}. If this value is an array, + * {@link #getValue()} returns an instance of {@link Object}[] and the value kind returns + * the kind of the elements in this array. + * <p> + * This interface is not intended to be implemented or extended by clients. + * </p> + * + * @since 3.4 + + + + + + * Constant indicating that the value kind is an <code>int</code> represented by + * an instance of {@link Integer}. + + + + + + + * Constant indicating that the value kind is a <code>byte</code> represented by + * an instance of {@link Byte}. + + + + + + + * Constant indicating that the value kind is a <code>short</code> represented by + * an instance of {@link Short}. + + + + + + + * Constant indicating that the value kind is a <code>char</code> represented by + * an instance of {@link Character}. + + + + + + + * Constant indicating that the value kind is a <code>float</code> represented by + * an instance of {@link Float}. + + + + + + + * Constant indicating that the value kind is a <code>double</code> represented by + * an instance of {@link Double}. + + + + + + + * Constant indicating that the value kind is a <code>long</code> represented by + * an instance of {@link Long}. + + + + + + + * Constant indicating that the value kind is a <code>boolean</code> represented by + * an instance of {@link Boolean}. + + + + + + + * Constant indicating that the value kind is a {@link String} represented by + * the corresponding {@link String}. + + + + + + + * Constant indicating that the value kind is an annotation represented by + * an instance of {@link IAnnotation}. + + + + + + + * Constant indicating that the value kind is a {@link Class} represented by + * the name of the class (i.e. a {@link String}. If the member-value pair is coming from + * a compilation unit, this is either a simple name (e.g. for <code>MyType.class</code>, + * the name is "MyType"), or a qualified name (e.g. for <code>x.y.MyType.MyNestedType.class</code>, + * the name is "x.y.MyType.MyNestedType"). If the member-value pair is coming from a class file, this is + * always a fully qualified name. + * <p> + * Note that one can use {@link IType#resolveType(String)} and e.g. + * {@link IJavaProject#findType(String, String, org.eclipse.core.runtime.IProgressMonitor)} + * to find the corresponding {@link IType}. + * </p> + + + + + + + * Constant indicating that the value is a qualified name represented by a + * {@link String}. The qualified name refers to an enum constant or another + * compile-time constant if the code is correct (e.g. "MyEnum.FIRST"). + + + + + + + * Constant indicating that the value is a simple name represented by a + * {@link String}. The simple name refers to an enum constant or another + * compile-time constant if the code is correct (e.g. "FIRST" when there is + * a static import for "MyEnum.FIRST"). + + + + + + + * Constant indicating that the value kind is unknown at this stage. The value is unknown in the + * following cases: + * <ul> + * <li>the value is an expression that would need to be further analyzed to determine its kind. For + * example, in <code>@MyAnnot(1 + 2.3)</code> the kind of the expression "1 + 2.3" is + * unknown</li> + * <li>the value is an array of size 0, e.g. <code>@MyAnnot({})</code></li> + * <li>the value is an array that contains at least one expression that would need to be further + * analyzed to determine its kind. For example, in <code>@MyAnnot({3.4, 1 + 2.3})</code>, + * the kind of the second element "1 + 2.3" is unknown.</li> + * <li>the value is an array that contains heterogeneous values, e.g. + * <code>@MyAnnot({1, 2.3, "abc"})</code></li> + * </ul> + * If the value kind is unknown, the returned value is always either <code>null</code>, or an + * array containing {@link Object}s and/or <code>null</code>s for unknown elements. + + + + + + + * Returns the member's name of this member-value pair. + * + * @return the member's name of this member-value pair. + + + + + + + + * Returns the value of this member-value pair. The type of this value + * is function of this member-value pair's {@link #getValueKind() value kind}. It is an + * instance of {@link Object}[] if the value is an array. + * <p> + * If the value kind is {@link #K_UNKNOWN} and the value is not an array, then the + * value is <code>null</code>. + * If the value kind is {@link #K_UNKNOWN} and the value is an array, then the + * value is an array containing {@link Object}s and/or <code>null</code>s for + * unknown elements. + * See {@link #K_UNKNOWN} for more details. + * </p> + * @return the value of this member-value pair. + + + + + + + + * Returns the value kind of this member-value pair. This indicates the instance of + * the returned {@link #getValue() value}, or the instance of the elements if the value + * is an array. The value kind is one of the following constants: + * {@link #K_ANNOTATION}, {@link #K_BOOLEAN}, {@link #K_BYTE}, {@link #K_CHAR}, + * {@link #K_CLASS}, {@link #K_DOUBLE}, {@link #K_FLOAT}, {@link #K_INT}, {@link #K_LONG}, + * {@link #K_QUALIFIED_NAME}, {@link #K_SIMPLE_NAME}, {@link #K_SHORT}, {@link #K_STRING}, + * {@link #K_UNKNOWN}. + * + * @return the value kind of this member-value pair + + + + + + + + + * Represents a method (or constructor) declared in a type. + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + * Returns a {@link IMemberValuePair member value pair} representing the default + * value of this method if any, or <code>null</code> if this method's parent is + * not an annotation type, or else if this method does not have a default value. + * <p> + * Note that {@link IMemberValuePair#getValue()} might return <code>null</code>. + * Please see this method for more details. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return a member pair value if any, or <code>null</code> if none + * @since 3.4 + + + + + + + + * Returns the simple name of this method. + * For a constructor, this returns the simple name of the declaring type. + * Note: This holds whether the constructor appears in a source or binary type + * (even though class files internally define constructor names to be <code>"&lt;init&gt;"</code>). + * For the class initialization methods in binary types, this returns + * the special name <code>"&lt;clinit&gt;"</code>. + * This is a handle-only method. + * @return the simple name of this method + + + + + + + + * Returns the type signatures of the exceptions this method throws, + * in the order declared in the source. Returns an empty array + * if this method throws no exceptions. + * <p> + * For example, a source method declaring <code>"throws IOException"</code>, + * would return the array <code>{"QIOException;"}</code>. + * </p> + * <p> + * The type signatures may be either unresolved (for source types) + * or resolved (for binary types), and either basic (for basic types) + * or rich (for parameterized types). See {@link Signature} for details. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the type signatures of the exceptions this method throws, + * in the order declared in the source, an empty array if this method throws no exceptions + * @see Signature + + + + + + + + + + + * Returns the formal type parameter signatures for this method. + * Returns an empty array if this method has no formal type parameters. + * <p> + * The formal type parameter signatures may be either unresolved (for source + * types) or resolved (for binary types). See {@link Signature} for details. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the formal type parameter signatures of this method, + * in the order declared in the source, an empty array if none + * @see Signature + * @since 3.0 + * @deprecated Use {@link #getTypeParameters()} instead + + + + + + + + + + + * Returns the formal type parameters for this method. + * Returns an empty array if this method has no formal type parameters. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the formal type parameters of this method, + * in the order declared in the source, an empty array if none + * @since 3.1 + + + + + + + + * Common protocol for Java elements that must be opened before they can be + * navigated or modified. Opening a textual element (such as a compilation unit) + * involves opening a buffer on its contents. While open, any changes to the buffer + * can be reflected in the element's structure; + * see {@link #isConsistent} and {@link #makeConsistent(IProgressMonitor)}. + * <p> + * To reduce complexity in clients, elements are automatically opened + * by the Java model as element properties are accessed. The Java model maintains + * an LRU cache of open elements, and automatically closes elements as they + * are swapped out of the cache to make room for other elements. Elements with + * unsaved changes are never removed from the cache, and thus, if the client + * maintains many open elements with unsaved + * changes, the LRU cache can grow in size (in this case the cache is not + * bounded). However, as elements are saved, the cache will shrink back to its + * original bounded size. + * </p> + * <p> + * To open an element, all openable parent elements must be open. + * The Java model automatically opens parent elements, as it automatically opens elements. + * Opening an element may provide access to direct children and other descendants, + * but does not automatically open any descendents which are themselves {@link IOpenable}. + * For example, opening a compilation unit provides access to all its constituent elements, + * but opening a package fragment does not open all compilation units in the package fragment. + * </p> + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + * Closes this element and its buffer (if any). + * Closing an element which is not open has no effect. + * + * <p>Note: although {@link #close} is exposed in the API, clients are + * not expected to open and close elements - the Java model does this automatically + * as elements are accessed. + * + * @exception JavaModelException if an error occurs closing this element + + + + + + + * Finds and returns the recommended line separator for this element. + * The element's buffer is first searched and the first line separator in this buffer is returned if any. + * Otherwise the preference {@link org.eclipse.core.runtime.Platform#PREF_LINE_SEPARATOR} + * on this element's project or workspace is returned. + * Finally if no such preference is set, the system line separator is returned. + * + * @return the recommended line separator for this element + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 3.2 + + + + + + + + * Returns the buffer opened for this element, or <code>null</code> + * if this element does not have a buffer. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the buffer opened for this element, or <code>null</code> + * if this element does not have a buffer + + + + + + + + * Returns <code>true</code> if this element is open and: + * <ul> + * <li>its buffer has unsaved changes, or + * <li>one of its descendants has unsaved changes, or + * <li>a working copy has been created on one of this + * element's children and has not yet destroyed + * </ul> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return <code>true</code> if this element is open and: + * <ul> + * <li>its buffer has unsaved changes, or + * <li>one of its descendants has unsaved changes, or + * <li>a working copy has been created on one of this + * element's children and has not yet destroyed + * </ul> + + + + + + + + * Returns whether the element is consistent with its underlying resource or buffer. + * The element is consistent when opened, and is consistent if the underlying resource + * or buffer has not been modified since it was last consistent. + * + * <p>NOTE: Child consistency is not considered. For example, a package fragment + * responds <code>true</code> when it knows about all of its + * compilation units present in its underlying folder. However, one or more of + * the compilation units could be inconsistent. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if the element is consistent with its underlying resource or buffer, false otherwise. + * @see IOpenable#makeConsistent(IProgressMonitor) + + + + + + + + * Returns whether this openable is open. This is a handle-only method. + * @return true if this openable is open, false otherwise + + + + + + + + * Makes this element consistent with its underlying resource or buffer + * by updating the element's structure and properties as necessary. + *<p> + * Note: Using this functionality on a working copy will interfere with any + * subsequent reconciling operation. Indeed, the next + * {@link ICompilationUnit#reconcile(int, boolean, WorkingCopyOwner, IProgressMonitor)} or + * {@link ICompilationUnit#reconcile(int, boolean, boolean, WorkingCopyOwner, IProgressMonitor)} + * operation will not account for changes which occurred before an + * explicit use of {@link #makeConsistent(IProgressMonitor)} + * <p> + * @param progress the given progress monitor + * @exception JavaModelException if the element is unable to access the contents + * of its underlying resource. Reasons include: + * <ul> + * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * </ul> + * @see IOpenable#isConsistent() + * @see ICompilationUnit#reconcile(int, boolean, WorkingCopyOwner, IProgressMonitor) + + + + + + + + * Opens this element and all parent elements that are not already open. + * For compilation units, a buffer is opened on the contents of the underlying resource. + * + * <p>Note: although {@link #open} is exposed in the API, clients are + * not expected to open and close elements - the Java model does this automatically + * as elements are accessed. + * + * @param progress the given progress monitor + * @exception JavaModelException if an error occurs accessing the contents + * of its underlying resource. Reasons include: + * <ul> + * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * </ul> + + + + + + + + * Saves any changes in this element's buffer to its underlying resource + * via a workspace resource operation. This has no effect if the element has no underlying + * buffer, or if there are no unsaved changed in the buffer. + * <p> + * The <code>force</code> parameter controls how this method deals with + * cases where the workbench is not completely in sync with the local file system. + * If <code>false</code> is specified, this method will only attempt + * to overwrite a corresponding file in the local file system provided + * it is in sync with the workbench. This option ensures there is no + * unintended data loss; it is the recommended setting. + * However, if <code>true</code> is specified, an attempt will be made + * to write a corresponding file in the local file system, + * overwriting any existing one if need be. + * In either case, if this method succeeds, the resource will be marked + * as being local (even if it wasn't before). + * <p> + * As a result of this operation, the element is consistent with its underlying + * resource or buffer. + * + * @param progress the given progress monitor + * @param force it controls how this method deals with + * cases where the workbench is not completely in sync with the local file system + * @exception JavaModelException if an error occurs accessing the contents + * of its underlying resource. Reasons include: + * <ul> + * <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li>This Java element is read-only (READ_ONLY)</li> + * </ul> + + + + + + + + + + * Represents a package declaration in Java compilation unit. + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + * A package fragment is a portion of the workspace corresponding to an entire package, + * or to a portion thereof. The distinction between a package fragment and a package + * is that a package with some name is the union of all package fragments in the class path + * which have the same name. + * <p> + * Package fragments elements need to be opened before they can be navigated or manipulated. + * The children are of type <code>ICompilationUnit</code> (representing a source file) or + * <code>IClassFile</code> (representing a binary class file). + * The children are listed in no particular order. + * </p> + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + + + * <p> + * The name of package fragment for the default package (value: the empty + * string, <code>""</code>). + * </p> + + + + + + + * Returns whether this fragment contains at least one Java resource. + * @return true if this fragment contains at least one Java resource, false otherwise + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + + + + + + + + * Creates and returns a compilation unit in this package fragment + * with the specified name and contents. No verification is performed + * on the contents. + * + * <p>It is possible that a compilation unit with the same name already exists in this + * package fragment. + * The value of the <code>force</code> parameter affects the resolution of + * such a conflict:<ul> + * <li> <code>true</code> - in this case the compilation is created with the new contents</li> + * <li> <code>false</code> - in this case a <code>JavaModelException</code> is thrown</li> + * </ul> + * + * @param contents the given contents + * @param force specify how to handle conflict is the same name already exists + * @param monitor the given progress monitor + * @param name the given name + * @exception JavaModelException if the element could not be created. Reasons include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while creating an underlying resource + * <li> The name is not a valid compilation unit name (INVALID_NAME) + * <li> The contents are <code>null</code> (INVALID_CONTENTS) + * </ul> + * @return a compilation unit in this package fragment + * with the specified name and contents + + + + + + + + + + + + * Returns the class file with the specified name + * in this package (for example, <code>"Object.class"</code>). + * The ".class" suffix is required. + * This is a handle-only method. The class file may or may not be present. + * @param name the given name + * @return the class file with the specified name in this package + + + + + + + + + * Returns all of the class files in this package fragment. + * + * <p>Note: it is possible that a package fragment contains only + * compilation units (in other words, its kind is <code>K_SOURCE</code>), in + * which case this method returns an empty collection. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return all of the class files in this package fragment + + + + + + + + + + + * Returns the compilation unit with the specified name + * in this package (for example, <code>"Object.java"</code>). + * The name has to be a valid compilation unit name. + * This is a handle-only method. The compilation unit may or may not be present. + * + * @param name the given name + * @return the compilation unit with the specified name in this package + * @see JavaConventions#validateCompilationUnitName(String name, String sourceLevel, String complianceLevel) + + + + + + + + + * Returns all of the compilation units in this package fragment. + * + * <p>Note: it is possible that a package fragment contains only + * class files (in other words, its kind is <code>K_BINARY</code>), in which + * case this method returns an empty collection. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return all of the compilation units in this package fragment + + + + + + + + + + + * Returns all of the compilation units in this package fragment that are + * in working copy mode and that have the given owner. + * <p> + * Only existing working copies are returned. So a compilation unit handle that has no + * corresponding resource on disk will be included if and only if is in working copy mode. + * </p> + * <p>Note: it is possible that a package fragment contains only + * class files (in other words, its kind is <code>K_BINARY</code>), in which + * case this method returns an empty collection. + * </p> + * + * @param owner the owner of the returned compilation units + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return all of the compilation units in this package fragment + * @since 3.0 + + + + + + + + + + + + * Returns the dot-separated package name of this fragment, for example + * <code>"java.lang"</code>, or <code>""</code> (the empty string), + * for the default package. + * + * @return the dot-separated package name of this fragment + + + + + + + + * Returns this package fragment's root kind encoded as an integer. + * A package fragment can contain source files (i.e. files with one of + * the {@link JavaCore#getJavaLikeExtensions() Java-like extensions}), + * or <code>.class</code> files. This is a convenience method. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return this package fragment's root kind encoded as an integer + * @see IPackageFragmentRoot#K_SOURCE + * @see IPackageFragmentRoot#K_BINARY + + + + + + + + * Returns an array of non-Java resources contained in this package fragment. + * <p> + * Non-Java resources includes other files and folders located in the same + * directory as the compilation units or class files for this package + * fragment. Source files excluded from this package by virtue of + * inclusion/exclusion patterns on the corresponding source classpath entry + * are considered non-Java resources and will appear in the result + * (possibly in a folder). + * </p><p> + * Since 3.3, if this package fragment is inside an archive, the non-Java resources + * are a tree of {@link IJarEntryResource}s. One can navigate this tree using + * the {@link IJarEntryResource#getChildren()} and + * {@link IJarEntryResource#getParent()} methods. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return an array of non-Java resources (<code>IFile</code>s, + * <code>IFolder</code>s, or <code>IStorage</code>s if the + * package fragment is in an archive) contained in this package + * fragment + * @see IClasspathEntry#getInclusionPatterns() + * @see IClasspathEntry#getExclusionPatterns() + + + + + + + + + + + * Returns whether this package fragment's name is + * a prefix of other package fragments in this package fragment's + * root. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this package fragment's name is a prefix of other package fragments in this package fragment's root, false otherwise + + + + + + + + * Returns whether this package fragment is a default package. + * This is a handle-only method. + * + * @return true if this package fragment is a default package + + + + + + + + + * A package fragment root contains a set of package fragments. + * It corresponds to an underlying resource which is either a folder, + * JAR, or zip. In the case of a folder, all descendant folders represent + * package fragments. For a given child folder representing a package fragment, + * the corresponding package name is composed of the folder names between the folder + * for this root and the child folder representing the package, separated by '.'. + * In the case of a JAR or zip, the contents of the archive dictates + * the set of package fragments in an analogous manner. + * Package fragment roots need to be opened before they can be navigated or manipulated. + * The children are of type <code>IPackageFragment</code>, and are in no particular order. + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + + * Kind constant for a source path root. Indicates this root + * only contains source files. + + + + + + + * Kind constant for a binary path root. Indicates this + * root only contains binary files. + + + + + + + * Empty root path + + + + + + + * Update model flag constant (bit mask value 1) indicating that the operation + * is to not copy/move/delete the package fragment root resource. + * @since 2.1 + + + + + + + * Update model flag constant (bit mask value 2) indicating that the operation + * is to update the classpath of the originating project. + * @since 2.1 + + + + + + + * Update model flag constant (bit mask value 4) indicating that the operation + * is to update the classpath of all referring projects except the originating project. + * @since 2.1 + + + + + + + * Update model flag constant (bit mask value 8) indicating that the operation + * is to update the classpath of the destination project. + * @since 2.1 + + + + + + + * Update model flag constant (bit mask value 16) indicating that the operation + * is to replace the resource and the destination project's classpath entry. + * @since 2.1 + + + + + + + * Attaches the source archive identified by the given absolute path to this + * binary package fragment root. <code>rootPath</code> specifies the location + * of the root within the archive or folder (empty specifies the default root + * and <code>null</code> specifies the root path should be detected). + * Once a source archive or folder is attached to the package fragment root, + * the <code>getSource</code> and <code>getSourceRange</code> + * methods become operational for binary types/members. + * To detach a source archive or folder from a package fragment root, specify + * <code>null</code> as the source path. + * + * @param sourcePath the given absolute path to the source archive or folder + * @param rootPath specifies the location of the root within the archive + * (empty specifies the default root and <code>null</code> specifies + * automatic detection of the root path) + * @param monitor the given progress monitor + * @exception JavaModelException if this operation fails. Reasons include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while updating a server property + * <li> This package fragment root is not of kind binary (INVALID_ELEMENT_TYPES) + * <li> The path provided is not absolute (RELATIVE_PATH) + * </ul> + + + + + + + + + + * Copies the resource of this package fragment root to the destination path + * as specified by <code>IResource.copy(IPath, int, IProgressMonitor)</code> + * but excluding nested source folders. + * <p> + * If <code>NO_RESOURCE_MODIFICATION</code> is specified in + * <code>updateModelFlags</code> or if this package fragment root is external, + * this operation doesn't copy the resource. <code>updateResourceFlags</code> + * is then ignored. + * </p><p> + * If <code>DESTINATION_PROJECT_CLASSPATH</code> is specified in + * <code>updateModelFlags</code>, updates the classpath of the + * destination's project (if it is a Java project). If a non-<code>null</code> + * sibling is specified, a copy of this root's classpath entry is inserted before the + * sibling on the destination project's raw classpath. If <code>null</code> is + * specified, the classpath entry is added at the end of the raw classpath. + * </p><p> + * If <code>REPLACE</code> is specified in <code>updateModelFlags</code>, + * overwrites the resource at the destination path if any. + * If the same classpath entry already exists on the destination project's raw + * classpath, then the sibling is ignored and the new classpath entry replaces the + * existing one. + * </p><p> + * If no flags is specified in <code>updateModelFlags</code> (using + * <code>IResource.NONE</code>), the default behavior applies: the + * resource is copied (if this package fragment root is not external) and the + * classpath is not updated. + * </p> + * + * @param destination the destination path + * @param updateResourceFlags bit-wise or of update resource flag constants + * (<code>IResource.FORCE</code> and <code>IResource.SHALLOW</code>) + * @param updateModelFlags bit-wise or of update resource flag constants + * (<code>DESTINATION_PROJECT_CLASSPATH</code> and + * <code>NO_RESOURCE_MODIFICATION</code>) + * @param sibling the classpath entry before which a copy of the classpath + * entry should be inserted or <code>null</code> if the classpath entry should + * be inserted at the end + * @param monitor a progress monitor + * + * @exception JavaModelException if this root could not be copied. Reasons + * include: + * <ul> + * <li> This root does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while copying the + * resource or updating a classpath</li> + * <li> + * The destination is not inside an existing project and <code>updateModelFlags</code> + * has been specified as <code>DESTINATION_PROJECT_CLASSPATH</code> + * (INVALID_DESTINATION)</li> + * <li> The sibling is not a classpath entry on the destination project's + * raw classpath (INVALID_SIBLING)</li> + * <li> The same classpath entry already exists on the destination project's + * classpath (NAME_COLLISION) and <code>updateModelFlags</code> + * has not been specified as <code>REPLACE</code></li> + * </ul> + * @see org.eclipse.core.resources.IResource#copy(IPath, boolean, IProgressMonitor) + * @since 2.1 + + + + + + + + + + + + * Creates and returns a package fragment in this root with the + * given dot-separated package name. An empty string specifies the default package. + * This has the side effect of creating all package + * fragments that are a prefix of the new package fragment which + * do not exist yet. If the package fragment already exists, this + * has no effect. + * + * For a description of the <code>force</code> flag, see <code>IFolder.create</code>. + * + * @param name the given dot-separated package name + * @param force a flag controlling how to deal with resources that + * are not in sync with the local file system + * @param monitor the given progress monitor + * @exception JavaModelException if the element could not be created. Reasons include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while creating an underlying resource + * <li> This package fragment root is read only (READ_ONLY) + * <li> The name is not a valid package name (INVALID_NAME) + * </ul> + * @return a package fragment in this root with the given dot-separated package name + * @see org.eclipse.core.resources.IFolder#create(boolean, boolean, IProgressMonitor) + + + + + + + + + + + * Deletes the resource of this package fragment root as specified by + * <code>IResource.delete(int, IProgressMonitor)</code> but excluding nested + * source folders. + * <p> + * If <code>NO_RESOURCE_MODIFICATION</code> is specified in + * <code>updateModelFlags</code> or if this package fragment root is external, + * this operation doesn't delete the resource. <code>updateResourceFlags</code> + * is then ignored. + * </p><p> + * If <code>ORIGINATING_PROJECT_CLASSPATH</code> is specified in + * <code>updateModelFlags</code>, update the raw classpath of this package + * fragment root's project by removing the corresponding classpath entry. + * </p><p> + * If <code>OTHER_REFERRING_PROJECTS_CLASSPATH</code> is specified in + * <code>updateModelFlags</code>, update the raw classpaths of all other Java + * projects referring to this root's resource by removing the corresponding classpath + * entries. + * </p><p> + * If no flags is specified in <code>updateModelFlags</code> (using + * <code>IResource.NONE</code>), the default behavior applies: the + * resource is deleted (if this package fragment root is not external) and no + * classpaths are updated. + * </p> + * + * @param updateResourceFlags bit-wise or of update resource flag constants + * (<code>IResource.FORCE</code> and <code>IResource.KEEP_HISTORY</code>) + * @param updateModelFlags bit-wise or of update resource flag constants + * (<code>ORIGINATING_PROJECT_CLASSPATH</code>, + * <code>OTHER_REFERRING_PROJECTS_CLASSPATH</code> and + * <code>NO_RESOURCE_MODIFICATION</code>) + * @param monitor a progress monitor + * + * @exception JavaModelException if this root could not be deleted. Reasons + * include: + * <ul> + * <li> This root does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while deleting the resource + * or updating a classpath + * </li> + * </ul> + * @see org.eclipse.core.resources.IResource#delete(boolean, IProgressMonitor) + * @since 2.1 + + + + + + + + + + * Returns this package fragment root's kind encoded as an integer. + * A package fragment root can contain source files (i.e. files with one + * of the {@link JavaCore#getJavaLikeExtensions() Java-like extensions}, + * or <code>.class</code> files, but not both. + * If the underlying folder or archive contains other kinds of files, they are ignored. + * In particular, <code>.class</code> files are ignored under a source package fragment root, + * and source files are ignored under a binary package fragment root. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return this package fragment root's kind encoded as an integer + * @see IPackageFragmentRoot#K_SOURCE + * @see IPackageFragmentRoot#K_BINARY + + + + + + + + * Returns an array of non-Java resources contained in this package fragment root. + * <p> + * Non-Java resources includes other files and folders located in the same + * directories as the compilation units or class files under this package + * fragment root. Resources excluded from this package fragment root + * by virtue of inclusion/exclusion patterns on the corresponding source classpath + * entry are considered non-Java resources and will appear in the result + * (possibly in a folder). Thus when a nested source folder is excluded, it will appear + * in the non-Java resources of the outer folder. + * </p><p> + * Since 3.3, if this package fragment root is an archive, the non-Java resources + * are a tree of {@link IJarEntryResource}s. One can navigate this tree using + * the {@link IJarEntryResource#getChildren()} and + * {@link IJarEntryResource#getParent()} methods. + * </p> + * + * @return an array of non-Java resources (<code>IFile</code>s, + * <code>IFolder</code>s, or <code>IStorage</code>s if the + * package fragment root is in archive) contained in this package + * fragment root + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @see IClasspathEntry#getInclusionPatterns() + * @see IClasspathEntry#getExclusionPatterns() + + + + + + + + + + + * Returns the package fragment with the given package name. + * An empty string indicates the default package. + * This is a handle-only operation. The package fragment + * may or may not exist. + * + * @param packageName the given package name + * @return the package fragment with the given package name + + + + + + + + + * Returns the first raw classpath entry that corresponds to this package + * fragment root. + * A raw classpath entry corresponds to a package fragment root if once resolved + * this entry's path is equal to the root's path. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the first raw classpath entry that corresponds to this package fragment root + * @since 2.0 + + + + + + + + * Returns the first resolved classpath entry that corresponds to this package fragment root. + * A resolved classpath entry is said to correspond to a root if the path of the resolved + * entry is equal to the root's path. + * + * @return the first resolved classpath entry that corresponds to this package fragment root + * @throws JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 3.6 + + + + + + + + * Returns the absolute path to the source archive attached to + * this package fragment root's binary archive. + * + * @return the absolute path to the corresponding source archive, + * or <code>null</code> if this package fragment root's binary archive + * has no corresponding source archive, or if this package fragment root + * is not a binary archive + * @exception JavaModelException if this operation fails + + + + + + + + * Returns the path within this package fragment root's source archive. + * An empty path indicates that packages are located at the root of the + * source archive. + * + * @return the path within the corresponding source archive, + * or <code>null</code> if this package fragment root's binary archive + * has no corresponding source archive, or if this package fragment root + * is not a binary archive + * @exception JavaModelException if this operation fails + + + + + + + + * Returns whether this package fragment root's underlying + * resource is a binary archive (a JAR or zip file). + * <p> + * This is a handle-only method. + * </p> + * + * @return true if this package fragment root's underlying resource is a binary archive, false otherwise + + + + + + + + * Returns whether this package fragment root is external + * to the workbench (that is, a local file), and has no + * underlying resource. + * <p> + * This is a handle-only method. + * </p> + * + * @return true if this package fragment root is external + * to the workbench (that is, a local file), and has no + * underlying resource, false otherwise + + + + + + + + * Moves the resource of this package fragment root to the destination path + * as specified by <code>IResource.move(IPath,int,IProgressMonitor)</code> + * but excluding nested source folders. + * <p> + * If <code>NO_RESOURCE_MODIFICATION</code> is specified in + * <code>updateModelFlags</code> or if this package fragment root is external, + * this operation doesn't move the resource. <code>updateResourceFlags</code> + * is then ignored. + * </p><p> + * If <code>DESTINATION_PROJECT_CLASSPATH</code> is specified in + * <code>updateModelFlags</code>, updates the classpath of the + * destination's project (if it is a Java project). If a non-<code>null</code> + * sibling is specified, a copy of this root's classpath entry is inserted before the + * sibling on the destination project's raw classpath. If <code>null</code> is + * specified, the classpath entry is added at the end of the raw classpath. + * </p><p> + * If <code>ORIGINATING_PROJECT_CLASSPATH</code> is specified in + * <code>updateModelFlags</code>, update the raw classpath of this package + * fragment root's project by removing the corresponding classpath entry. + * </p><p> + * If <code>OTHER_REFERRING_PROJECTS_CLASSPATH</code> is specified in + * <code>updateModelFlags</code>, update the raw classpaths of all other Java + * projects referring to this root's resource by removing the corresponding classpath + * entries. + * </p><p> + * If <code>REPLACE</code> is specified in <code>updateModelFlags</code>, + * overwrites the resource at the destination path if any. + * If the same classpath entry already exists on the destination project's raw + * classpath, then the sibling is ignored and the new classpath entry replaces the + * existing one. + * </p><p> + * If no flags is specified in <code>updateModelFlags</code> (using + * <code>IResource.NONE</code>), the default behavior applies: the + * resource is moved (if this package fragment root is not external) and no + * classpaths are updated. + * </p> + * + * @param destination the destination path + * @param updateResourceFlags bit-wise or of update flag constants + * (<code>IResource.FORCE</code>, <code>IResource.KEEP_HISTORY</code> + * and <code>IResource.SHALLOW</code>) + * @param updateModelFlags bit-wise or of update resource flag constants + * (<code>DESTINATION_PROJECT_CLASSPATH</code>, + * <code>ORIGINATING_PROJECT_CLASSPATH</code>, + * <code>OTHER_REFERRING_PROJECTS_CLASSPATH</code> and + * <code>NO_RESOURCE_MODIFICATION</code>) + * @param sibling the classpath entry before which a copy of the classpath + * entry should be inserted or <code>null</code> if the classpath entry should + * be inserted at the end + * @param monitor a progress monitor + * + * @exception JavaModelException if this root could not be moved. Reasons + * include: + * <ul> + * <li> This root does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while copying the + * resource or updating a classpath</li> + * <li> + * The destination is not inside an existing project and <code>updateModelFlags</code> + * has been specified as <code>DESTINATION_PROJECT_CLASSPATH</code> + * (INVALID_DESTINATION)</li> + * <li> The sibling is not a classpath entry on the destination project's + * raw classpath (INVALID_SIBLING)</li> + * <li> The same classpath entry already exists on the destination project's + * classpath (NAME_COLLISION) and <code>updateModelFlags</code> + * has not been specified as <code>REPLACE</code></li> + * </ul> + * @see org.eclipse.core.resources.IResource#move(IPath, boolean, IProgressMonitor) + * @since 2.1 + + + + + + + + + + + + + * Common protocol for Java elements that contain other Java elements. + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + * Returns the immediate children of this element. + * Unless otherwise specified by the implementing element, + * the children are in no particular order. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @return the immediate children of this element + + + + + + + + + + + * Returns whether this element has one or more immediate children. + * This is a convenience method, and may be more efficient than + * testing whether <code>getChildren</code> is an empty array. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + * @return true if the immediate children of this element, false otherwise + + + + + + + + + * A callback interface for receiving java problem as they are discovered + * by some Java operation. + * + * @see IProblem + * @since 2.0 + + + + + + * Notification of a Java problem. + * + * @param problem IProblem - The discovered Java problem. + + + + + + + + * Notification sent before starting the problem detection process. + * Typically, this would tell a problem collector to clear previously recorded problems. + + + + + + + * Notification sent after having completed problem detection process. + * Typically, this would tell a problem collector that no more problems should be expected in this + * iteration. + + + + + + + * Predicate allowing the problem requestor to signal whether or not it is currently + * interested by problem reports. When answering <code>false</code>, problem will + * not be discovered any more until the next iteration. + * + * This predicate will be invoked once prior to each problem detection iteration. + * + * @return boolean - indicates whether the requestor is currently interested by problems. + + + + + + + + + * A Java model region describes a hierarchical set of elements. + * Regions are often used to describe a set of elements to be considered + * when performing operations; for example, the set of elements to be + * considered during a search. A region may include elements from different + * projects. + * <p> + * When an element is included in a region, all of its children + * are considered to be included. Children of an included element + * <b>cannot</b> be selectively excluded. + * </p> + * <p> + * Instances can be created via the <code>JavaCore.newRegion</code>. + * </p> + * + * @see JavaCore#newRegion() + * @noimplement This interface is not intended to be implemented by clients. + + + + + + * Adds the given element and all of its descendents to this region. + * If the specified element is already included, or one of its + * ancestors is already included, this has no effect. If the element + * being added is an ancestor of an element already contained in this + * region, the ancestor subsumes the descendent. + * + * @param element the given element + + + + + + + + * Returns whether the given element is contained in this region. + * + * @param element the given element + * @return true if the given element is contained in this region, false otherwise + + + + + + + + + * Returns the top level elements in this region. + * All descendents of these elements are also included in this region. + * + * @return the top level elements in this region + + + + + + + + + + + * Removes the specified element from the region and returns + * <code>true</code> if successful, <code>false</code> if the remove + * fails. If an ancestor of the given element is included, the + * remove fails (in other words, it is not possible to selectively + * exclude descendants of included ancestors). + * + * @param element the given element + * @return <code>true</code> if successful, <code>false</code> if the remove fails + + + + + + + + + + * Common protocol for Java elements that support source code manipulations such + * as copy, move, rename, and delete. + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + * Copies this element to the given container. + * + * @param container the container + * @param sibling the sibling element before which the copy should be inserted, + * or <code>null</code> if the copy should be inserted as the last child of + * the container + * @param rename the new name for the element, or <code>null</code> if the copy + * retains the name of this element + * @param replace <code>true</code> if any existing child in the container with + * the target name should be replaced, and <code>false</code> to throw an + * exception in the event of a name collision + * @param monitor a progress monitor + * @exception JavaModelException if this element could not be copied. Reasons include: + * <ul> + * <li> This Java element, container element, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while updating an underlying resource + * <li> The container is of an incompatible type (INVALID_DESTINATION) + * <li> The sibling is not a child of the given container (INVALID_SIBLING) + * <li> The new name is invalid (INVALID_NAME) + * <li> A child in the container already exists with the same name (NAME_COLLISION) + * and <code>replace</code> has been specified as <code>false</code> + * <li> The container or this element is read-only (READ_ONLY) + * </ul> + * + * @exception IllegalArgumentException if container is <code>null</code> + * @see org.eclipse.jdt.core.IJavaModelStatusConstants#INVALID_DESTINATION + + + + + + + + + + + + * Deletes this element, forcing if specified and necessary. + * + * @param force a flag controlling whether underlying resources that are not + * in sync with the local file system will be tolerated (same as the force flag + * in IResource operations). + * @param monitor a progress monitor + * @exception JavaModelException if this element could not be deleted. Reasons include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while updating an underlying resource (CORE_EXCEPTION)</li> + * <li> This element is read-only (READ_ONLY)</li> + * </ul> + + + + + + + + + * Moves this element to the given container. + * + * @param container the container + * @param sibling the sibling element before which the element should be inserted, + * or <code>null</code> if the element should be inserted as the last child of + * the container + * @param rename the new name for the element, or <code>null</code> if the + * element retains its name + * @param replace <code>true</code> if any existing child in the container with + * the target name should be replaced, and <code>false</code> to throw an + * exception in the event of a name collision + * @param monitor a progress monitor + * @exception JavaModelException if this element could not be moved. Reasons include: + * <ul> + * <li> This Java element, container element, or sibling does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while updating an underlying resource + * <li> The container is of an incompatible type (INVALID_DESTINATION) + * <li> The sibling is not a child of the given container (INVALID_SIBLING) + * <li> The new name is invalid (INVALID_NAME) + * <li> A child in the container already exists with the same name (NAME_COLLISION) + * and <code>replace</code> has been specified as <code>false</code> + * <li> The container or this element is read-only (READ_ONLY) + * </ul> + * + * @exception IllegalArgumentException if container is <code>null</code> + * @see org.eclipse.jdt.core.IJavaModelStatusConstants#INVALID_DESTINATION + + + + + + + + + + + + * Renames this element to the given name. + * + * @param name the new name for the element + * @param replace <code>true</code> if any existing element with the target name + * should be replaced, and <code>false</code> to throw an exception in the + * event of a name collision + * @param monitor a progress monitor + * @exception JavaModelException if this element could not be renamed. Reasons include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while updating an underlying resource + * <li> The new name is invalid (INVALID_NAME) + * <li> A child in the container already exists with the same name (NAME_COLLISION) + * and <code>replace</code> has been specified as <code>false</code> + * <li> This element is read-only (READ_ONLY) + * </ul> + + + + + + + + + + + * A source range defines an element's source coordinates relative to + * its source buffer. + * + * <p>Clients may use the method {@link org.eclipse.jdt.core.SourceRange#isAvailable(ISourceRange)} + * in order to find out if a source range is available. This method returns <code>false</code> + * when the source range offset is equals to <code>-1</code>.</p> + * + * <p>Clients may use the default implementation provided by {@link SourceRange}.</p> + * + * @see SourceRange + * @noimplement This interface is not intended to be implemented by clients. + + + + + + * Returns the number of characters of the source code for this element, + * relative to the source buffer in which this element is contained. + * + * @return the number of characters of the source code for this element, + * relative to the source buffer in which this element is contained + + + + + + + + * Returns the 0-based index of the first character of the source code for this element, + * relative to the source buffer in which this element is contained. However, if the element + * has no associated source code, an implementation may return -1. + * + * @return the 0-based index of the first character of the source code for this element, + * relative to the source buffer in which this element is contained. However, if the element + * has no associated source code, an implementation may return -1. + + + + + + + + + * Common protocol for Java elements that have associated source code. + * This set consists of {@link IClassFile}, {@link ICompilationUnit}, + * {@link IPackageDeclaration}, {@link IImportDeclaration}, + * {@link IImportContainer}, {@link IType}, {@link IField}, + * {@link IMethod}, {@link IInitializer}, {@link ITypeParameter}, + * {@link ILocalVariable}, and {@link IAnnotation}. + * <p> + * Note: For <code>IClassFile</code>, <code>IType</code> and other members + * derived from a binary type, the implementation returns source iff the + * element has attached source code. + * </p> + * <p> + * Source reference elements may be working copies if they were created from + * a compilation unit that is a working copy. + * </p> + * + * @see IPackageFragmentRoot#attachSource(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor) + * @noimplement This interface is not intended to be implemented by clients. + + + + + + * Returns whether this element exists in the model. + * + * @return <code>true</code> if this element exists in the Java model + * @since 2.0 + + + + + + + + * Returns the source code associated with this element. + * This extracts the substring from the source buffer containing this source + * element. This corresponds to the source range that would be returned by + * <code>getSourceRange</code>. + * <p> + * For class files, this returns the source of the entire compilation unit + * associated with the class file (if there is one). + * </p> + * + * @return the source code, or <code>null</code> if this element has no + * associated source code + * @exception JavaModelException if an exception occurs while accessing its corresponding resource + + + + + + + + * Returns the source range associated with this element. + * <p> + * For class files, this returns the range of the entire compilation unit + * associated with the class file (if there is one). + * </p> + * <p> + * If this element has no associated source code, either <code>null</code> is returned, + * or a source range with a -1 offset and a 0 length. {@link SourceRange#isAvailable(ISourceRange)} + * can be used to detect that case. + * </p> + * + * @return the source range, or either <code>null</code> or [-1, 0] if this element has no + * associated source code + * @exception JavaModelException if an exception occurs while accessing its corresponding resource + * @see SourceRange#isAvailable(ISourceRange) + + + + + + + + * Returns the name range associated with this element. + * + * <p>If the element is an {@link IMember}, it returns + * the source range of this member's simple name, + * or <code>null</code> if this member does not have a name + * (for example, an initializer), or if this member does not have + * associated source code (for example, a binary type).</p> + * + * <p>If this element is an {@link IImportDeclaration}, the source range + * of this import declaration's name, or <code>null</code> if this import + * declaration does not have associated source code (for example, a binary type). + * <br>The source range for the name includes the trailing '*' if the call to + * {@link IImportDeclaration#isOnDemand()} returns true. + * </p> + * + * <p>If this element is an {@link IPackageDeclaration}, the source range of + * this package declaration's name, or <code>null</code> if this package + * declaration does not have associated source code (for example, a binary type).</p> + * + * <p>If this element is an {@link IAnnotation}, the source range of + * this annotation's name, or <code>null</code> if this annotation does not have + * associated source code (for example, in a binary type).</p> + * + * <p>If this element is an {@link ITypeParameter}, the source range of this + * type parameter's name, or <code>null</code> if this type parameter does not have + * associated source code (for example, in a binary type).</p> + * + * <p>If this element is an {@link ITypeRoot} or {@link IImportContainer}, it + * returns null.</p> + * + * @return the name range associated with this element, or <code>null</code> if + * not available + * + * @since 3.7 + + + + + + + + + * Represents either a source type in a compilation unit (either a top-level + * type, a member type, a local type or an anonymous type) + * or a binary type in a class file. Enumeration classes and annotation + * types are subkinds of classes and interfaces, respectively. + * <p> + * Note that the element name of an anonymous source type is always empty. + * </p><p> + * If a binary type cannot be parsed, its structure remains unknown. + * Use <code>IJavaElement.isStructureKnown</code> to determine whether this + * is the case. + * </p> + * <p> + * The children are of type <code>IMember</code>, which includes <code>IField</code>, + * <code>IMethod</code>, <code>IInitializer</code> and <code>IType</code>. + * The children are listed in the order in which they appear in the source or class file. + * </p> + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + * Do code completion inside a code snippet in the context of the current type. + * + * If the type has access to its source code and the insertion position is valid, + * then completion is performed against the source. Otherwise the completion is performed + * against the type structure and the given locals variables. + * + * @param snippet the code snippet + * @param insertion the position with in source where the snippet + * is inserted. This position must not be in comments. + * A possible value is -1, if the position is not known. + * @param position the position within snippet where the user + * is performing code assist. + * @param localVariableTypeNames an array (possibly empty) of fully qualified + * type names of local variables visible at the current scope + * @param localVariableNames an array (possibly empty) of local variable names + * that are visible at the current scope + * @param localVariableModifiers an array (possible empty) of modifiers for + * local variables + * @param isStatic whether the current scope is in a static context + * @param requestor the completion requestor + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 2.0 + * @deprecated Use {@link #codeComplete(char[],int,int,char[][],char[][],int[],boolean,CompletionRequestor)} instead. + + + + + + + + + + + + + + + + + + + + + + + + + + + * Do code completion inside a code snippet in the context of the current type. + * It considers types in the working copies with the given owner first. In other words, + * the owner's working copies will take precedence over their original compilation units + * in the workspace. + * <p> + * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + * </p><p> + * If the type has access to its source code and the insertion position is valid, + * then completion is performed against the source. Otherwise the completion is performed + * against the type structure and the given locals variables. + * </p> + * + * @param snippet the code snippet + * @param insertion the position with in source where the snippet + * is inserted. This position must not be in comments. + * A possible value is -1, if the position is not known. + * @param position the position with in snippet where the user + * is performing code assist. + * @param localVariableTypeNames an array (possibly empty) of fully qualified + * type names of local variables visible at the current scope + * @param localVariableNames an array (possibly empty) of local variable names + * that are visible at the current scope + * @param localVariableModifiers an array (possible empty) of modifiers for + * local variables + * @param isStatic whether the current scope is in a static context + * @param requestor the completion requestor + * @param owner the owner of working copies that take precedence over their original compilation units + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 3.0 + * @deprecated Use {@link #codeComplete(char[],int,int,char[][],char[][],int[],boolean,CompletionRequestor,WorkingCopyOwner)} instead. + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Do code completion inside a code snippet in the context of the current type. + * + * If the type has access to its source code and the insertion position is valid, + * then completion is performed against the source. Otherwise the completion is performed + * against the type structure and the given locals variables. + * + * @param snippet the code snippet + * @param insertion the position with in source where the snippet + * is inserted. This position must not be in comments. + * A possible value is -1, if the position is not known. + * @param position the position within snippet where the user + * is performing code assist. + * @param localVariableTypeNames an array (possibly empty) of fully qualified + * type names of local variables visible at the current scope + * @param localVariableNames an array (possibly empty) of local variable names + * that are visible at the current scope + * @param localVariableModifiers an array (possible empty) of modifiers for + * local variables + * @param isStatic whether the current scope is in a static context + * @param requestor the completion requestor + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 3.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + * Do code completion inside a code snippet in the context of the current type. + * + * If the type has access to its source code and the insertion position is valid, + * then completion is performed against the source. Otherwise the completion is performed + * against the type structure and the given locals variables. + * <p> + * If {@link IProgressMonitor} is not <code>null</code> then some proposals which + * can be very long to compute are proposed. To avoid that the code assist operation + * take too much time a {@link IProgressMonitor} which automatically cancel the code + * assist operation when a specified amount of time is reached could be used. + * + * <pre> + * new IProgressMonitor() { + * private final static int TIMEOUT = 500; //ms + * private long endTime; + * public void beginTask(String name, int totalWork) { + * fEndTime= System.currentTimeMillis() + TIMEOUT; + * } + * public boolean isCanceled() { + * return endTime <= System.currentTimeMillis(); + * } + * ... + * }; + * </pre> + * <p> + * + * @param snippet the code snippet + * @param insertion the position with in source where the snippet + * is inserted. This position must not be in comments. + * A possible value is -1, if the position is not known. + * @param position the position within snippet where the user + * is performing code assist. + * @param localVariableTypeNames an array (possibly empty) of fully qualified + * type names of local variables visible at the current scope + * @param localVariableNames an array (possibly empty) of local variable names + * that are visible at the current scope + * @param localVariableModifiers an array (possible empty) of modifiers for + * local variables + * @param isStatic whether the current scope is in a static context + * @param requestor the completion requestor + * @param monitor the progress monitor used to report progress + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Do code completion inside a code snippet in the context of the current type. + * It considers types in the working copies with the given owner first. In other words, + * the owner's working copies will take precedence over their original compilation units + * in the workspace. + * <p> + * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + * </p><p> + * If the type has access to its source code and the insertion position is valid, + * then completion is performed against the source. Otherwise the completion is performed + * against the type structure and the given locals variables. + * </p> + * + * @param snippet the code snippet + * @param insertion the position with in source where the snippet + * is inserted. This position must not be in comments. + * A possible value is -1, if the position is not known. + * @param position the position with in snippet where the user + * is performing code assist. + * @param localVariableTypeNames an array (possibly empty) of fully qualified + * type names of local variables visible at the current scope + * @param localVariableNames an array (possibly empty) of local variable names + * that are visible at the current scope + * @param localVariableModifiers an array (possible empty) of modifiers for + * local variables + * @param isStatic whether the current scope is in a static context + * @param requestor the completion requestor + * @param owner the owner of working copies that take precedence over their original compilation units + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 3.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Do code completion inside a code snippet in the context of the current type. + * It considers types in the working copies with the given owner first. In other words, + * the owner's working copies will take precedence over their original compilation units + * in the workspace. + * <p> + * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + * </p><p> + * If the type has access to its source code and the insertion position is valid, + * then completion is performed against the source. Otherwise the completion is performed + * against the type structure and the given locals variables. + * </p> + * <p> + * If {@link IProgressMonitor} is not <code>null</code> then some proposals which + * can be very long to compute are proposed. To avoid that the code assist operation + * take too much time a {@link IProgressMonitor} which automatically cancel the code + * assist operation when a specified amount of time is reached could be used. + * + * <pre> + * new IProgressMonitor() { + * private final static int TIMEOUT = 500; //ms + * private long endTime; + * public void beginTask(String name, int totalWork) { + * endTime= System.currentTimeMillis() + TIMEOUT; + * } + * public boolean isCanceled() { + * return endTime <= System.currentTimeMillis(); + * } + * ... + * }; + * </pre> + * <p> + * + * @param snippet the code snippet + * @param insertion the position with in source where the snippet + * is inserted. This position must not be in comments. + * A possible value is -1, if the position is not known. + * @param position the position with in snippet where the user + * is performing code assist. + * @param localVariableTypeNames an array (possibly empty) of fully qualified + * type names of local variables visible at the current scope + * @param localVariableNames an array (possibly empty) of local variable names + * that are visible at the current scope + * @param localVariableModifiers an array (possible empty) of modifiers for + * local variables + * @param isStatic whether the current scope is in a static context + * @param requestor the completion requestor + * @param owner the owner of working copies that take precedence over their original compilation units + * @param monitor the progress monitor used to report progress + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Creates and returns a field in this type with the + * given contents. + * <p> + * Optionally, the new element can be positioned before the specified + * sibling. If no sibling is specified, the element will be inserted + * as the last field declaration in this type.</p> + * + * <p>It is possible that a field with the same name already exists in this type. + * The value of the <code>force</code> parameter affects the resolution of + * such a conflict:<ul> + * <li> <code>true</code> - in this case the field is created with the new contents</li> + * <li> <code>false</code> - in this case a <code>JavaModelException</code> is thrown</li> + * </ul></p> + * + * @param contents the given contents + * @param sibling the given sibling + * @param force a flag in case the same name already exists in this type + * @param monitor the given progress monitor + * @exception JavaModelException if the element could not be created. Reasons include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while updating an underlying resource + * <li> The specified sibling is not a child of this type (INVALID_SIBLING) + * <li> The contents could not be recognized as a field declaration (INVALID_CONTENTS) + * <li> This type is read-only (binary) (READ_ONLY) + * <li> There was a naming collision with an existing field (NAME_COLLISION) + * </ul> + * @return a field in this type with the given contents + + + + + + + + + + + + * Creates and returns a static initializer in this type with the + * given contents. + * <p> + * Optionally, the new element can be positioned before the specified + * sibling. If no sibling is specified, the new initializer is positioned + * after the last existing initializer declaration, or as the first member + * in the type if there are no initializers.</p> + * + * @param contents the given contents + * @param sibling the given sibling + * @param monitor the given progress monitor + * @exception JavaModelException if the element could not be created. Reasons include: + * <ul> + * <li> This element does not exist + * <li> A <code>CoreException</code> occurred while updating an underlying resource + * <li> The specified sibling is not a child of this type (INVALID_SIBLING) + * <li> The contents could not be recognized as an initializer declaration (INVALID_CONTENTS) + * <li> This type is read-only (binary) (READ_ONLY) + * </ul> + * @return a static initializer in this type with the given contents + + + + + + + + + + + * Creates and returns a method or constructor in this type with the + * given contents. + * <p> + * Optionally, the new element can be positioned before the specified + * sibling. If no sibling is specified, the element will be appended + * to this type. + * + * <p>It is possible that a method with the same signature already exists in this type. + * The value of the <code>force</code> parameter affects the resolution of + * such a conflict:<ul> + * <li> <code>true</code> - in this case the method is created with the new contents</li> + * <li> <code>false</code> - in this case a <code>JavaModelException</code> is thrown</li> + * </ul></p> + * + * @param contents the given contents + * @param sibling the given sibling + * @param force a flag in case the same name already exists in this type + * @param monitor the given progress monitor + * @exception JavaModelException if the element could not be created. Reasons include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while updating an underlying resource + * <li> The specified sibling is not a child of this type (INVALID_SIBLING) + * <li> The contents could not be recognized as a method or constructor + * declaration (INVALID_CONTENTS) + * <li> This type is read-only (binary) (READ_ONLY) + * <li> There was a naming collision with an existing method (NAME_COLLISION) + * </ul> + * @return a method or constructor in this type with the given contents + + + + + + + + + + + + * Creates and returns a type in this type with the + * given contents. + * <p> + * Optionally, the new type can be positioned before the specified + * sibling. If no sibling is specified, the type will be appended + * to this type.</p> + * + * <p>It is possible that a type with the same name already exists in this type. + * The value of the <code>force</code> parameter affects the resolution of + * such a conflict:<ul> + * <li> <code>true</code> - in this case the type is created with the new contents</li> + * <li> <code>false</code> - in this case a <code>JavaModelException</code> is thrown</li> + * </ul></p> + * + * @param contents the given contents + * @param sibling the given sibling + * @param force a flag in case the same name already exists in this type + * @param monitor the given progress monitor + * @exception JavaModelException if the element could not be created. Reasons include: + * <ul> + * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * <li> A <code>CoreException</code> occurred while updating an underlying resource + * <li> The specified sibling is not a child of this type (INVALID_SIBLING) + * <li> The contents could not be recognized as a type declaration (INVALID_CONTENTS) + * <li> This type is read-only (binary) (READ_ONLY) + * <li> There was a naming collision with an existing field (NAME_COLLISION) + * </ul> + * @return a type in this type with the given contents + + + + + + + + + + + + * Finds the methods in this type that correspond to + * the given method. + * A method m1 corresponds to another method m2 if: + * <ul> + * <li>m1 has the same element name as m2. + * <li>m1 has the same number of arguments as m2 and + * the simple names of the argument types must be equals. + * <li>m1 exists. + * </ul> + * @param method the given method + * @return the found method or <code>null</code> if no such methods can be found. + * + * @since 2.0 + + + + + + + + + + + + * Returns the children of this type that have the given category as a <code>@category</code> tag. + * Returns an empty array if no children with this category exist. + * + * <p> + * The results are listed in the order in which they appear in the source or class file. + * </p> + * + * @return the children for the given category. + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 3.2 + + + + + + + + + + + + * Returns the simple name of this type, unqualified by package or enclosing type. + * This is a handle-only method. + * + * @return the simple name of this type + + + + + + + + * Returns the field with the specified name + * in this type (for example, <code>"bar"</code>). + * This is a handle-only method. The field may or may not exist. + * + * @param name the given name + * @return the field with the specified name in this type + + + + + + + + + * Returns the fields declared by this type in the order in which they appear + * in the source or class file. For binary types, this includes synthetic fields. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the fields declared by this type + + + + + + + + + + + * Returns the fully qualified name of this type, + * including qualification for any containing types and packages. + * This is the name of the package, followed by <code>'.'</code>, + * followed by the type-qualified name. + * <p> + * <b>Note</b>: The enclosing type separator used in the type-qualified + * name is <code>'$'</code>, not <code>'.'</code>. + * </p> + * This method is fully equivalent to <code>getFullyQualifiedName('$')</code>. + * This is a handle-only method. + * + * @see IType#getTypeQualifiedName() + * @see IType#getFullyQualifiedName(char) + * @return the fully qualified name of this type + + + + + + + + * Returns the fully qualified name of this type, + * including qualification for any containing types and packages. + * This is the name of the package, followed by <code>'.'</code>, + * followed by the type-qualified name using the <code>enclosingTypeSeparator</code>. + * + * For example: + * <ul> + * <li>the fully qualified name of a class B defined as a member of a class A in a compilation unit A.java + * in a package x.y using the '.' separator is "x.y.A.B"</li> + * <li>the fully qualified name of a class B defined as a member of a class A in a compilation unit A.java + * in a package x.y using the '$' separator is "x.y.A$B"</li> + * <li>the fully qualified name of a binary type whose class file is x/y/A$B.class + * using the '.' separator is "x.y.A.B"</li> + * <li>the fully qualified name of a binary type whose class file is x/y/A$B.class + * using the '$' separator is "x.y.A$B"</li> + * <li>the fully qualified name of an anonymous binary type whose class file is x/y/A$1.class + * using the '.' separator is "x.y.A.1"</li> + * </ul> + * + * This is a handle-only method. + * + * @param enclosingTypeSeparator the given enclosing type separator + * @return the fully qualified name of this type, including qualification for any containing types and packages + * @see IType#getTypeQualifiedName(char) + * @since 2.0 + + + + + + + + + * Returns this type's fully qualified name using a '.' enclosing type separator + * followed by its type parameters between angle brackets if it is a generic type. + * For example, "p.X&lt;T&gt;", "java.util.Map&lt;java.lang.String, p.X&gt;" + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the fully qualified parameterized representation of this type + * @since 3.1 + + + + + + + + * Returns the initializer with the specified position relative to + * the order they are defined in the source. + * Numbering starts at 1 (thus the first occurrence is occurrence 1, not occurrence 0). + * This is a handle-only method. The initializer may or may not be present. + * + * @param occurrenceCount the specified position + * @return the initializer with the specified position relative to the order they are defined in the source + + + + + + + + + * Returns the initializers declared by this type. For binary types this is an + * empty collection. For source types, the results are listed in the order in + * which they appear in the source. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the initializers declared by this type + + + + + + + + + + + * Returns the binding key for this type only if the given type is {@link #isResolved() resolved}. + * A binding key is a key that uniquely identifies this type. It allows access + * to generic info for parameterized types. + * + * <p>If the given type is not resolved, the returned key is simply the java element's key. + * </p> + * @return the binding key for this type + * @see org.eclipse.jdt.core.dom.IBinding#getKey() + * @see BindingKey + * @since 3.1 + * @see #isResolved() + + + + + + + + * Returns the method with the specified name and parameter types + * in this type (for example, <code>"foo", {"I", "QString;"}</code>). + * To get the handle for a constructor, the name specified must be the + * simple name of the enclosing type. + * This is a handle-only method. The method may or may not be present. + * <p> + * The type signatures may be either unresolved (for source types) + * or resolved (for binary types), and either basic (for basic types) + * or rich (for parameterized types). See {@link Signature} for details. + * </p> + * + * @param name the given name + * @param parameterTypeSignatures the given parameter types + * @return the method with the specified name and parameter types in this type + + + + + + + + + + + + + * Returns the methods and constructors declared by this type. + * For binary types, this may include the special <code>&lt;clinit&gt;</code> method + * and synthetic methods. + * <p> + * The results are listed in the order in which they appear in the source or class file. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the methods and constructors declared by this type + + + + + + + + + + + * Returns the package fragment in which this element is defined. + * This is a handle-only method. + * + * @return the package fragment in which this element is defined + + + + + + + + * Returns the name of this type's superclass, or <code>null</code> + * for source types that do not specify a superclass. + * <p> + * For interfaces, the superclass name is always <code>"java.lang.Object"</code>. + * For source types, the name as declared is returned, for binary types, + * the resolved, qualified name is returned. + * For anonymous types, the superclass name is the name appearing after the 'new' keyword'. + * If the superclass is a parameterized type, the string + * may include its type arguments enclosed in "&lt;&gt;". + * If the returned string is needed for anything other than display + * purposes, use {@link #getSuperclassTypeSignature()} which returns + * a structured type signature string containing more precise information. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the name of this type's superclass, or <code>null</code> for source types that do not specify a superclass + + + + + + + + * Returns the type signature of this type's superclass, or + * <code>null</code> if none. + * <p> + * The type signature may be either unresolved (for source types) + * or resolved (for binary types), and either basic (for basic types) + * or rich (for parameterized types). See {@link Signature} for details. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the type signature of this type's superclass, or + * <code>null</code> if none + * @since 3.0 + + + + + + + + * Returns the type signatures of the interfaces that this type + * implements or extends, in the order in which they are listed in the + * source. + * <p> + * For classes and enum types, this gives the interfaces that this + * class implements. For interfaces and annotation types, + * this gives the interfaces that this interface extends. + * An empty collection is returned if this type does not implement or + * extend any interfaces. For anonymous types, an empty collection is + * always returned. + * </p> + * <p> + * The type signatures may be either unresolved (for source types) + * or resolved (for binary types), and either basic (for basic types) + * or rich (for parameterized types). See {@link Signature} for details. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the type signatures of interfaces that this type implements + * or extends, in the order in which they are listed in the source, + * an empty collection if none + * @since 3.0 + + + + + + + + + + + * Returns the names of interfaces that this type implements or extends, + * in the order in which they are listed in the source. + * <p> + * For classes, this gives the interfaces that this class implements. + * For interfaces, this gives the interfaces that this interface extends. + * An empty collection is returned if this type does not implement or + * extend any interfaces. For source types, simple names are returned, + * for binary types, qualified names are returned. + * For anonymous types, an empty collection is always returned. + * If the list of supertypes includes parameterized types, + * the string may include type arguments enclosed in "&lt;&gt;". + * If the result is needed for anything other than display + * purposes, use {@link #getSuperInterfaceTypeSignatures()} which returns + * structured signature strings containing more precise information. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the names of interfaces that this type implements or extends, in the order in which they are listed in the source, + * an empty collection if none + + + + + + + + + + + * Returns the formal type parameter signatures for this type. + * Returns an empty array if this type has no formal type parameters. + * <p> + * The formal type parameter signatures may be either unresolved (for source + * types) or resolved (for binary types). See {@link Signature} for details. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the formal type parameter signatures of this type, + * in the order declared in the source, an empty array if none + * @see Signature + * @since 3.0 + + + + + + + + + + + * Returns the formal type parameters for this type. + * Returns an empty array if this type has no formal type parameters. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the formal type parameters of this type, + * in the order declared in the source, an empty array if none + * @since 3.1 + + + + + + + + + + + * Returns the member type declared in this type with the given simple name. + * This is a handle-only method. The type may or may not exist. + * + * @param name the given simple name + * @return the member type declared in this type with the given simple name + + + + + + + + + * Returns the type parameter declared in this type with the given name. + * This is a handle-only method. The type parameter may or may not exist. + * + * @param name the given simple name + * @return the type parameter declared in this type with the given name + * @since 3.1 + + + + + + + + + * Returns the type-qualified name of this type, + * including qualification for any enclosing types, + * but not including package qualification. + * For source types, this consists of the simple names of any enclosing types, + * separated by <code>'$'</code>, followed by the simple name of this type + * or the occurrence count of this type if it is anonymous. + * For binary types, this is the name of the class file without the ".class" suffix. + * This method is fully equivalent to <code>getTypeQualifiedName('$')</code>. + * This is a handle-only method. + * + * @see #getTypeQualifiedName(char) + * @return the type-qualified name of this type + + + + + + + + * Returns the type-qualified name of this type, + * including qualification for any enclosing types, + * but not including package qualification. + * For source types, this consists of the simple names of any enclosing types, + * separated by <code>enclosingTypeSeparator</code>, followed by the + * simple name of this type or the occurrence count of this type if it is anonymous. + * For binary types, this is the name of the class file without the ".class" suffix, + * and - since 3.4 - the '$' characters in the class file name are replaced with the + * <code>enclosingTypeSeparator</code> character. + * + * For example: + * <ul> + * <li>the type qualified name of a class B defined as a member of a class A + * using the '.' separator is "A.B"</li> + * <li>the type qualified name of a class B defined as a member of a class A + * using the '$' separator is "A$B"</li> + * <li>the type qualified name of a binary type whose class file is A$B.class + * using the '.' separator is "A.B"</li> + * <li>the type qualified name of a binary type whose class file is A$B.class + * using the '$' separator is "A$B"</li> + * <li>the type qualified name of an anonymous binary type whose class file is A$1.class + * using the '.' separator is "A.1"</li> + * </ul> + * + * This is a handle-only method. + * + * @param enclosingTypeSeparator the specified enclosing type separator + * @return the type-qualified name of this type + * @since 2.0 + + + + + + + + + * Returns the immediate member types declared by this type. + * The results are listed in the order in which they appear in the source or class file. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return the immediate member types declared by this type + + + + + + + + + + + * Returns whether this type represents an anonymous type. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this type represents an anonymous type, false otherwise + * @since 2.0 + + + + + + + + * Returns whether this type represents a class. + * <p> + * Note that a class can neither be an interface, an enumeration class, nor an annotation type. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this type represents a class, false otherwise + + + + + + + + * Returns whether this type represents an enumeration class. + * <p> + * Note that an enumeration class can neither be a class, an interface, nor an annotation type. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this type represents an enumeration class, + * false otherwise + * @since 3.0 + + + + + + + + * Returns whether this type represents an interface. + * <p> + * Note that an interface can also be an annotation type, but it can neither be a class nor an enumeration class. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this type represents an interface, false otherwise + + + + + + + + * Returns whether this type represents an annotation type. + * <p> + * Note that an annotation type is also an interface, but it can neither be a class nor an enumeration class. + * </p> + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this type represents an annotation type, + * false otherwise + * @since 3.0 + + + + + + + + * Returns whether this type represents a local type. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this type represents a local type, false otherwise + * @since 2.0 + + + + + + + + * Returns whether this type represents a member type. + * + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return true if this type represents a member type, false otherwise + * @since 2.0 + + + + + + + + * Returns whether this type represents a resolved type. + * If a type is resolved, its key contains resolved information. + * + * @return whether this type represents a resolved type. + * @since 3.1 + + + + + + + + * Loads a previously saved ITypeHierarchy from an input stream. A type hierarchy can + * be stored using ITypeHierachy#store(OutputStream). + * + * Only hierarchies originally created by the following methods can be loaded: + * <ul> + * <li>IType#newSupertypeHierarchy(IProgressMonitor)</li> + * <li>IType#newTypeHierarchy(IJavaProject, IProgressMonitor)</li> + * <li>IType#newTypeHierarchy(IProgressMonitor)</li> + * </ul> + * + * @param input stream where hierarchy will be read + * @param monitor the given progress monitor + * @return the stored hierarchy + * @exception JavaModelException if the hierarchy could not be restored, reasons include: + * - type is not the focus of the hierarchy or + * - unable to read the input stream (wrong format, IOException during reading, ...) + * @see ITypeHierarchy#store(java.io.OutputStream, IProgressMonitor) + * @since 2.1 + + + + + + + + + + * Creates and returns a type hierarchy for this type containing + * this type and all of its supertypes. + * + * @param monitor the given progress monitor + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return a type hierarchy for this type containing this type and all of its supertypes + + + + + + + + + * Creates and returns a type hierarchy for this type containing + * this type and all of its supertypes, considering types in the given + * working copies. In other words, the list of working copies will take + * precedence over their original compilation units in the workspace. + * <p> + * Note that passing an empty working copy will be as if the original compilation + * unit had been deleted. + * </p> + * + * @param workingCopies the working copies that take precedence over their original compilation units + * @param monitor the given progress monitor + * @return a type hierarchy for this type containing this type and all of its supertypes + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 3.0 + + + + + + + + + + + + + * Creates and returns a type hierarchy for this type containing + * this type and all of its supertypes, considering types in the given + * working copies. In other words, the list of working copies will take + * precedence over their original compilation units in the workspace. + * <p> + * Note that passing an empty working copy will be as if the original compilation + * unit had been deleted. + * </p> + * + * @param workingCopies the working copies that take precedence over their original compilation units + * @param monitor the given progress monitor + * @return a type hierarchy for this type containing this type and all of its supertypes + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 2.0 + * @deprecated Use {@link #newSupertypeHierarchy(ICompilationUnit[], IProgressMonitor)} instead + + + + + + + + + + + + + * Creates and returns a type hierarchy for this type containing + * this type and all of its supertypes, considering types in the + * working copies with the given owner. + * In other words, the owner's working copies will take + * precedence over their original compilation units in the workspace. + * <p> + * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + * <p> + * + * @param owner the owner of working copies that take precedence over their original compilation units + * @param monitor the given progress monitor + * @return a type hierarchy for this type containing this type and all of its supertypes + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 3.0 + + + + + + + + + + * Creates and returns a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes + * in the context of the given project. + * + * @param project the given project + * @param monitor the given progress monitor + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes + * in the context of the given project + + + + + + + + + + * Creates and returns a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes + * in the context of the given project, considering types in the + * working copies with the given owner. + * In other words, the owner's working copies will take + * precedence over their original compilation units in the workspace. + * <p> + * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + * <p> + * + * @param project the given project + * @param owner the owner of working copies that take precedence over their original compilation units + * @param monitor the given progress monitor + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes + * in the context of the given project + * @since 3.0 + + + + + + + + + + + * Creates and returns a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace. + * + * @param monitor the given progress monitor + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @return a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace + + + + + + + + + * Creates and returns a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace, + * considering types in the given working copies. In other words, the list of working + * copies that will take precedence over their original compilation units in the workspace. + * <p> + * Note that passing an empty working copy will be as if the original compilation + * unit had been deleted. + * + * @param workingCopies the working copies that take precedence over their original compilation units + * @param monitor the given progress monitor + * @return a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 3.0 + + + + + + + + + + + + + * Creates and returns a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace, + * considering types in the given working copies. In other words, the list of working + * copies that will take precedence over their original compilation units in the workspace. + * <p> + * Note that passing an empty working copy will be as if the original compilation + * unit had been deleted. + * + * @param workingCopies the working copies that take precedence over their original compilation units + * @param monitor the given progress monitor + * @return a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 2.0 + * @deprecated Use {@link #newTypeHierarchy(ICompilationUnit[], IProgressMonitor)} instead + + + + + + + + + + + + + * Creates and returns a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace, + * considering types in the working copies with the given owner. + * In other words, the owner's working copies will take + * precedence over their original compilation units in the workspace. + * <p> + * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + * <p> + * + * @param owner the owner of working copies that take precedence over their original compilation units + * @param monitor the given progress monitor + * @return a type hierarchy for this type containing + * this type, all of its supertypes, and all its subtypes in the workspace + * @exception JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource. + * @since 3.0 + + + + + + + + + + * Resolves the given type name within the context of this type (depending on the type hierarchy + * and its imports). + * <p> + * Multiple answers might be found in case there are ambiguous matches. + * </p> + * <p> + * Each matching type name is decomposed as an array of two strings, the first denoting the package + * name (dot-separated) and the second being the type name. The package name is empty if it is the + * default package. The type name is the type qualified name using a '.' enclosing type separator. + * </p> + * <p> + * Returns <code>null</code> if unable to find any matching type. + * </p> + *<p> + * For example, resolution of <code>"Object"</code> would typically return + * <code>{{"java.lang", "Object"}}</code>. Another resolution that returns + * <code>{{"", "X.Inner"}}</code> represents the inner type Inner defined in type X in the + * default package. + * </p> + * + * @param typeName the given type name + * @exception JavaModelException if code resolve could not be performed. + * @return the resolved type names or <code>null</code> if unable to find any matching type + * @see #getTypeQualifiedName(char) + + + + + + + + + + + + * Resolves the given type name within the context of this type (depending on the type hierarchy + * and its imports) and using the given owner's working copies, considering types in the + * working copies with the given owner. In other words, the owner's working copies will take + * precedence over their original compilation units in the workspace. + * <p> + * Note that if a working copy is empty, it will be as if the original compilation + * unit had been deleted. + * </p> + * <p>Multiple answers might be found in case there are ambiguous matches. + * </p> + * <p> + * Each matching type name is decomposed as an array of two strings, the first denoting the package + * name (dot-separated) and the second being the type name. The package name is empty if it is the + * default package. The type name is the type qualified name using a '.' enclosing type separator. + * </p> + * <p> + * Returns <code>null</code> if unable to find any matching type. + *</p> + *<p> + * For example, resolution of <code>"Object"</code> would typically return + * <code>{{"java.lang", "Object"}}</code>. Another resolution that returns + * <code>{{"", "X.Inner"}}</code> represents the inner type Inner defined in type X in the + * default package. + * </p> + * + * @param typeName the given type name + * @param owner the owner of working copies that take precedence over their original compilation units + * @exception JavaModelException if code resolve could not be performed. + * @return the resolved type names or <code>null</code> if unable to find any matching type + * @see #getTypeQualifiedName(char) + * @since 3.0 + + + + + + + + + + + + + + * A type hierarchy provides navigations between a type and its resolved + * supertypes and subtypes for a specific type or for all types within a region. + * Supertypes may extend outside of the type hierarchy's region in which it was + * created such that the root of the hierarchy is always included. For example, if a type + * hierarchy is created for a <code>java.io.File</code>, and the region the hierarchy was + * created in is the package fragment <code>java.io</code>, the supertype + * <code>java.lang.Object</code> will still be included. As a historical quirk, + * <code>java.lang.Object</code> has always been included in type hierarchies + * created on interface types. + * <p> + * A type hierarchy is static and can become stale. Although consistent when + * created, it does not automatically track changes in the model. + * As changes in the model potentially invalidate the hierarchy, change notifications + * are sent to registered <code>ITypeHierarchyChangedListener</code>s. Listeners should + * use the <code>exists</code> method to determine if the hierarchy has become completely + * invalid (for example, when the type or project the hierarchy was created on + * has been removed). To refresh a hierarchy, use the <code>refresh</code> method. + * </p> + * <p> + * The type hierarchy may contain cycles due to malformed supertype declarations. + * Most type hierarchy queries are oblivious to cycles; the <code>getAll* </code> + * methods are implemented such that they are unaffected by cycles. + * </p> + * + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + * A listener which gets notified when a particular type hierarchy object + * changes. + * <p> + * This interface may be implemented by clients. + * </p> + + + + + + * Notifies that the given type hierarchy has changed in some way and should + * be refreshed at some point to make it consistent with the current state of + * the Java model. + * + * @param typeHierarchy the given type hierarchy + + + + + + + + + * Represents a type parameter defined by a type or a method + * in a compilation unit or a class file. + * <p> + * Type parameters are obtained using {@link IType#getTypeParameter(String)} and + * {@link IMethod#getTypeParameter(String)}. + * </p><p> + * Note that type parameters are not children of their declaring type or method. To get a list + * of the type parameters use {@link IType#getTypeParameters()} for a type and use + * {@link IMethod#getTypeParameters()} for a method. + * </p> + * + * @since 3.1 + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + * Returns the names of the class and interface bounds of this type parameter. Returns an empty + * array if this type parameter has no bounds. A bound name is the name as it appears in the + * source (without the <code>extends</code> keyword) if the type parameter comes from a + * compilation unit. It is the dot-separated fully qualified name of the bound if the type + * parameter comes from a class file. + * + * @return the names of the bounds + * @throws JavaModelException if this element does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + + + + * Returns the signatures for this type parameter's bounds. The type parameter may have + * been declared as part of a type or a method. The signatures represent only the individual + * bounds and do not include the type variable name or the <code>extends</code> keyword. + * The signatures may be either unresolved (for source types) or resolved (for binary types). + * See {@link Signature} for details. + * + * @return the signatures for the bounds of this formal type parameter + * @throws JavaModelException + * if this element does not exist or if an exception occurs while accessing its corresponding resource. + * @see Signature + * @since 3.6 + + + + + + + + + + + * Returns the declaring member of this type parameter. This can be either an <code>IType</code> + * or an <code>IMethod</code>. + * <p> + * This is a handle-only method. + * </p> + * + * @return the declaring member of this type parameter. + + + + + + + + * Returns the Java type root in which this type parameter is declared. + * <p> + * This is a handle-only method. + * </p> + * + * @return the Java type root in which this type parameter is declared + * @since 3.7 + + + + + + + + * Represents an entire Java type root (either an <code>ICompilationUnit</code> + * or an <code>IClassFile</code>). + * + * @see ICompilationUnit Note that methods {@link #findPrimaryType()} and {@link #getElementAt(int)} + * were already implemented in this interface respectively since version 3.0 and version 1.0. + * @see IClassFile Note that method {@link #getWorkingCopy(WorkingCopyOwner, IProgressMonitor)} + * was already implemented in this interface since version 3.0. + * @since 3.3 + * @noimplement This interface is not intended to be implemented by clients. + + + + + + + + + + + * Finds the primary type of this Java type root (that is, the type with the same name as the + * compilation unit, or the type of a class file), or <code>null</code> if no such a type exists. + * + * @return the found primary type of this Java type root, or <code>null</code> if no such a type exists + + + + + + + + * Returns the smallest element within this Java type root that + * includes the given source position (that is, a method, field, etc.), or + * <code>null</code> if there is no element other than the Java type root + * itself at the given position, or if the given position is not + * within the source range of the source of this Java type root. + * + * @param position a source position inside the Java type root + * @return the innermost Java element enclosing a given source position or <code>null</code> + * if none (excluding the Java type root). + * @throws JavaModelException if the Java type root does not exist or if an + * exception occurs while accessing its corresponding resource + + + + + + + + + + * Common protocol for Java elements that support working copies. + * <p> + * A working copy of a Java element acts just like a regular element (handle), + * except it is not attached to an underlying resource. A working copy is not + * visible to the rest of the Java model. Changes in a working copy's + * buffer are not realized in a resource. To bring the Java model up-to-date with a working + * copy's contents, an explicit commit must be performed on the working copy. + * Other operations performed on a working copy update the + * contents of the working copy's buffer but do not commit the contents + * of the working copy. + * </p> + * <p> + * Note: The contents of a working copy is determined when a working + * copy is created, based on the current content of the element the working + * copy is created from. If a working copy is an <code>IOpenable</code> and is explicitly + * closed, the working copy's buffer will be thrown away. However, clients should not + * explicitly open and close working copies. + * </p> + * <p> + * The client that creates a working copy is responsible for + * destroying the working copy. The Java model will never automatically + * destroy or close a working copy. (Note that destroying a working copy + * does not commit it to the model, it only frees up the memory occupied by + * the element). After a working copy is destroyed, the working copy cannot + * be accessed again. Non-handle methods will throw a + * <code>JavaModelException</code> indicating the Java element does not exist. + * </p> + * <p> + * A working copy cannot be created from another working copy. + * Calling <code>getWorkingCopy</code> on a working copy returns the receiver. + * </p> + * + * @deprecated Use {@link ICompilationUnit} instead + * @noimplement This interface is not intended to be implemented by clients. + + + + + + * Commits the contents of this working copy to its original element + * and underlying resource, bringing the Java model up-to-date with + * the current contents of the working copy. + * + * <p>It is possible that the contents of the original resource have changed + * since this working copy was created, in which case there is an update conflict. + * The value of the <code>force</code> parameter affects the resolution of + * such a conflict:<ul> + * <li> <code>true</code> - in this case the contents of this working copy are applied to + * the underlying resource even though this working copy was created before + * a subsequent change in the resource</li> + * <li> <code>false</code> - in this case a <code>JavaModelException</code> is thrown</li> + * </ul> + * <p> + * Since 2.1, a working copy can be created on a not-yet existing compilation + * unit. In particular, such a working copy can then be committed in order to create + * the corresponding compilation unit. + * </p> + * @param force a flag to handle the cases when the contents of the original resource have changed + * since this working copy was created + * @param monitor the given progress monitor + * @exception JavaModelException if this working copy could not commit. Reasons include: + * <ul> + * <li> A <code>CoreException</code> occurred while updating an underlying resource + * <li> This element is not a working copy (INVALID_ELEMENT_TYPES) + * <li> A update conflict (described above) (UPDATE_CONFLICT) + * </ul> + * @deprecated Use {@link ICompilationUnit#commitWorkingCopy(boolean, IProgressMonitor)} instead. + + + + + + + + + * Destroys this working copy, closing its buffer and discarding + * its structure. Subsequent attempts to access non-handle information + * for this working copy will result in <code>IJavaModelException</code>s. Has + * no effect if this element is not a working copy. + * <p> + * If this working copy is shared, it is destroyed only when the number of calls to + * <code>destroy()</code> is the same as the number of calls to <code> + * getSharedWorkingCopy(IProgressMonitor, IBufferFactory)</code>. + * </p><p> + * When it is destroyed, a REMOVED IJavaElementDelta is reported on this + * working copy. + * </p> + * @deprecated Use {@link ICompilationUnit#discardWorkingCopy()} instead. + + + + + + + * Finds the shared working copy for this element, given a <code>IBuffer</code> factory. + * If no working copy has been created for this element associated with this + * buffer factory, returns <code>null</code>. + * <p> + * Users of this method must not destroy the resulting working copy. + * + * @param bufferFactory the given <code>IBuffer</code> factory + * @return the found shared working copy for this element, <code>null</code> if none + * @see IBufferFactory + * @since 2.0 + * + * @deprecated Use {@link ICompilationUnit#findWorkingCopy(WorkingCopyOwner)} instead. + + + + + + + + + * Returns the original element the specified working copy element was created from, + * or <code>null</code> if this is not a working copy element. This is a handle + * only method, the returned element may or may not exist. + * + * @param workingCopyElement the specified working copy element + * @return the original element the specified working copy element was created from, + * or <code>null</code> if this is not a working copy element + * + * @deprecated Use {@link IJavaElement#getPrimaryElement()} instead. + + + + + + + + + * Returns the original element this working copy was created from, + * or <code>null</code> if this is not a working copy. + * + * @return the original element this working copy was created from, + * or <code>null</code> if this is not a working copy + * + * @deprecated Use {@link ICompilationUnit#getPrimaryElement()} instead. + + + + + + + + * Finds the elements in this compilation unit that correspond to + * the given element. + * An element A corresponds to an element B if: + * <ul> + * <li>A has the same element name as B. + * <li>If A is a method, A must have the same number of arguments as + * B and the simple names of the argument types must be equals. + * <li>The parent of A corresponds to the parent of B recursively up to + * their respective compilation units. + * <li>A exists. + * </ul> + * Returns <code>null</code> if no such java elements can be found + * or if the given element is not included in a compilation unit. + * + * @param element the given element + * @return the found elements in this compilation unit that correspond to the given element + * @since 2.0 + * + * @deprecated Use {@link ICompilationUnit#findElements(IJavaElement)} instead. + + + + + + + + + + + + * Finds the primary type of this compilation unit (that is, the type with the same name as the + * compilation unit), or <code>null</code> if no such a type exists. + * + * @return the found primary type of this compilation unit, or <code>null</code> if no such a type exists + * @since 2.0 + * + * @deprecated Use {@link ITypeRoot#findPrimaryType()} instead. + + + + + + + + * Returns a shared working copy on this element using the given factory to create + * the buffer, or this element if this element is already a working copy. + * This API can only answer an already existing working copy if it is based on the same + * original compilation unit AND was using the same buffer factory (that is, as defined by <code>Object.equals</code>). + * <p> + * The life time of a shared working copy is as follows: + * <ul> + * <li>The first call to <code>getSharedWorkingCopy(...)</code> creates a new working copy for this + * element</li> + * <li>Subsequent calls increment an internal counter.</li> + * <li>A call to <code>destroy()</code> decrements the internal counter.</li> + * <li>When this counter is 0, the working copy is destroyed. + * </ul> + * So users of this method must destroy exactly once the working copy. + * <p> + * Note that the buffer factory will be used for the life time of this working copy, that is if the + * working copy is closed then reopened, this factory will be used. + * The buffer will be automatically initialized with the original's compilation unit content + * upon creation. + * <p> + * When the shared working copy instance is created, an ADDED IJavaElementDelta is reported on this + * working copy. + * + * @param monitor a progress monitor used to report progress while opening this compilation unit + * or <code>null</code> if no progress should be reported + * @param factory the factory that creates a buffer that is used to get the content of the working copy + * or <code>null</code> if the internal factory should be used + * @param problemRequestor a requestor which will get notified of problems detected during + * reconciling as they are discovered. The requestor can be set to <code>null</code> indicating + * that the client is not interested in problems. + * @exception JavaModelException if the contents of this element can + * not be determined. + * @return a shared working copy on this element using the given factory to create + * the buffer, or this element if this element is already a working copy + * @see IBufferFactory + * @see IProblemRequestor + * @since 2.0 + * + * @deprecated Use {@link ICompilationUnit#getWorkingCopy(WorkingCopyOwner, IProblemRequestor, IProgressMonitor)} instead. + + + + + + + + + + + * Returns a new working copy of this element if this element is not + * a working copy, or this element if this element is already a working copy. + * <p> + * Note: if intending to share a working copy amongst several clients, then + * <code>#getSharedWorkingCopy</code> should be used instead. + * </p><p> + * When the working copy instance is created, an ADDED IJavaElementDelta is + * reported on this working copy. + * </p><p> + * Since 2.1, a working copy can be created on a not-yet existing compilation + * unit. In particular, such a working copy can then be committed in order to create + * the corresponding compilation unit. + * </p> + * @exception JavaModelException if the contents of this element can + * not be determined. + * @return a new working copy of this element if this element is not + * a working copy, or this element if this element is already a working copy + * + * @deprecated Use {@link ICompilationUnit#getWorkingCopy(IProgressMonitor)} instead. + + + + + + + + * Returns a new working copy of this element using the given factory to create + * the buffer, or this element if this element is already a working copy. + * Note that this factory will be used for the life time of this working copy, that is if the + * working copy is closed then reopened, this factory will be reused. + * The buffer will be automatically initialized with the original's compilation unit content + * upon creation. + * <p> + * Note: if intending to share a working copy amongst several clients, then + * <code>#getSharedWorkingCopy</code> should be used instead. + * </p><p> + * When the working copy instance is created, an ADDED IJavaElementDelta is + * reported on this working copy. + * </p><p> + * Since 2.1, a working copy can be created on a not-yet existing compilation + * unit. In particular, such a working copy can then be committed in order to create + * the corresponding compilation unit. + * </p> + * @param monitor a progress monitor used to report progress while opening this compilation unit + * or <code>null</code> if no progress should be reported + * @param factory the factory that creates a buffer that is used to get the content of the working copy + * or <code>null</code> if the internal factory should be used + * @param problemRequestor a requestor which will get notified of problems detected during + * reconciling as they are discovered. The requestor can be set to <code>null</code> indicating + * that the client is not interested in problems. + * @exception JavaModelException if the contents of this element can + * not be determined. + * @return a new working copy of this element using the given factory to create + * the buffer, or this element if this element is already a working copy + * @since 2.0 + * + * @deprecated Use {@link ICompilationUnit#getWorkingCopy(WorkingCopyOwner, IProblemRequestor, IProgressMonitor)} instead. + + + + + + + + + + + * Returns whether this working copy's original element's content + * has not changed since the inception of this working copy. + * + * @param resource this working copy's resource + * @return true if this working copy's original element's content + * has not changed since the inception of this working copy, false otherwise + * + * @deprecated Use {@link ICompilationUnit#hasResourceChanged()} instead. + + + + + + + + + * Returns whether this element is a working copy. + * + * @return true if this element is a working copy, false otherwise + * + * @deprecated Use {@link ICompilationUnit#isWorkingCopy()} instead. + + + + + + + + * Reconciles the contents of this working copy. + * It performs the reconciliation by locally caching the contents of + * the working copy, updating the contents, then creating a delta + * over the cached contents and the new contents, and finally firing + * this delta. + * <p> + * If the working copy hasn't changed, then no problem will be detected, + * this is equivalent to <code>IWorkingCopy#reconcile(false, null)</code>.</p> + * <p> + * Compilation problems found in the new contents are notified through the + * <code>IProblemRequestor</code> interface which was passed at + * creation, and no longer as transient markers. Therefore this API will + * return <code>null</code>.</p> + * <p> + * Note: Since 3.0 added/removed/changed inner types generate change deltas.</p> + * + * @exception JavaModelException if the contents of the original element + * cannot be accessed. Reasons include: + * <ul> + * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * </ul> + * @return <code>null</code> + * + * @deprecated Use {@link ICompilationUnit#reconcile(int, boolean, WorkingCopyOwner, IProgressMonitor)} instead. + + + + + + + + + + + * Reconciles the contents of this working copy. + * It performs the reconciliation by locally caching the contents of + * the working copy, updating the contents, then creating a delta + * over the cached contents and the new contents, and finally firing + * this delta. + * <p> + * The boolean argument allows to force problem detection even if the + * working copy is already consistent.</p> + * <p> + * Compilation problems found in the new contents are notified through the + * <code>IProblemRequestor</code> interface which was passed at + * creation, and no longer as transient markers. Therefore this API answers + * nothing.</p> + * <p> + * Note: Since 3.0 added/removed/changed inner types generate change deltas.</p> + * + * @param forceProblemDetection boolean indicating whether problem should be recomputed + * even if the source hasn't changed. + * @param monitor a progress monitor + * @exception JavaModelException if the contents of the original element + * cannot be accessed. Reasons include: + * <ul> + * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * </ul> + * @since 2.0 + * + * @deprecated Use {@link ICompilationUnit#reconcile(int, boolean, WorkingCopyOwner, IProgressMonitor)} instead. + + + + + + + + + * Restores the contents of this working copy to the current contents of + * this working copy's original element. Has no effect if this element + * is not a working copy. + * + * <p>Note: This is the inverse of committing the content of the + * working copy to the original element with <code>commit(boolean, IProgressMonitor)</code>. + * + * @exception JavaModelException if the contents of the original element + * cannot be accessed. Reasons include: + * <ul> + * <li> The original Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li> + * </ul> + * @deprecated Use {@link ICompilationUnit#restore()} instead. + + + + + + + + * Provides methods for checking Java-specific conventions such as name syntax. + * <p> + * This class provides static methods and constants only. + * </p> + * @noinstantiate This class is not intended to be instantiated by clients. + + + + + + + + + * Returns whether the given package fragment root paths are considered + * to overlap. + * <p> + * Two root paths overlap if one is a prefix of the other, or they point to + * the same location. However, a JAR is allowed to be nested in a root. + * + * @param rootPath1 the first root path + * @param rootPath2 the second root path + * @return true if the given package fragment root paths are considered to overlap, false otherwise + * @deprecated Overlapping roots are allowed in 2.1 + + + + + + + + + + + + + + + + + + + * Validate the given compilation unit name. + * <p> + * A compilation unit name must obey the following rules: + * <ul> + * <li> it must not be null + * <li> it must be suffixed by a dot ('.') followed by one of the + * {@link JavaCore#getJavaLikeExtensions() Java-like extensions} + * <li> its prefix must be a valid identifier + * <li> it must not contain any characters or substrings that are not valid + * on the file system on which workspace root is located. + * </ul> + * </p> + * @param name the name of a compilation unit + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a compilation unit name, otherwise a status + * object indicating what is wrong with the name + * @deprecated Use {@link #validateCompilationUnitName(String id, String sourceLevel, String complianceLevel)} instead + + + + + + + + + * Validate the given compilation unit name for the given source and compliance levels. + * <p> + * A compilation unit name must obey the following rules: + * <ul> + * <li> it must not be null + * <li> it must be suffixed by a dot ('.') followed by one of the + * {@link JavaCore#getJavaLikeExtensions() Java-like extensions} + * <li> its prefix must be a valid identifier + * <li> it must not contain any characters or substrings that are not valid + * on the file system on which workspace root is located. + * </ul> + * </p> + * @param name the name of a compilation unit + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a compilation unit name, otherwise a status + * object indicating what is wrong with the name + * @since 3.3 + + + + + + + + + + + * Validate the given .class file name. + * <p> + * A .class file name must obey the following rules: + * <ul> + * <li> it must not be null + * <li> it must include the <code>".class"</code> suffix + * <li> its prefix must be a valid identifier + * <li> it must not contain any characters or substrings that are not valid + * on the file system on which workspace root is located. + * </ul> + * </p> + * @param name the name of a .class file + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a .class file name, otherwise a status + * object indicating what is wrong with the name + * @since 2.0 + * @deprecated Use {@link #validateClassFileName(String id, String sourceLevel, String complianceLevel)} instead + + + + + + + + + * Validate the given .class file name for the given source and compliance levels. + * <p> + * A .class file name must obey the following rules: + * <ul> + * <li> it must not be null + * <li> it must include the <code>".class"</code> suffix + * <li> its prefix must be a valid identifier + * <li> it must not contain any characters or substrings that are not valid + * on the file system on which workspace root is located. + * </ul> + * </p> + * @param name the name of a .class file + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a .class file name, otherwise a status + * object indicating what is wrong with the name + * @since 3.3 + + + + + + + + + + + * Validate the given field name. + * <p> + * Syntax of a field name corresponds to VariableDeclaratorId (JLS2 8.3). + * For example, <code>"x"</code>. + * + * @param name the name of a field + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a field name, otherwise a status + * object indicating what is wrong with the name + * @deprecated Use {@link #validateFieldName(String id, String sourceLevel, String complianceLevel)} instead + + + + + + + + + * Validate the given field name for the given source and compliance levels. + * <p> + * Syntax of a field name corresponds to VariableDeclaratorId (JLS2 8.3). + * For example, <code>"x"</code>. + * + * @param name the name of a field + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a field name, otherwise a status + * object indicating what is wrong with the name + * @since 3.3 + + + + + + + + + + + * Validate the given Java identifier. + * The identifier must not have the same spelling as a Java keyword, + * boolean literal (<code>"true"</code>, <code>"false"</code>), or null literal (<code>"null"</code>). + * See section 3.8 of the <em>Java Language Specification, Second Edition</em> (JLS2). + * A valid identifier can act as a simple type name, method name or field name. + * + * @param id the Java identifier + * @return a status object with code <code>IStatus.OK</code> if + * the given identifier is a valid Java identifier, otherwise a status + * object indicating what is wrong with the identifier + * @deprecated Use {@link #validateIdentifier(String id, String sourceLevel, String complianceLevel)} instead + + + + + + + + + * Validate the given Java identifier for the given source and compliance levels + * The identifier must not have the same spelling as a Java keyword, + * boolean literal (<code>"true"</code>, <code>"false"</code>), or null literal (<code>"null"</code>). + * See section 3.8 of the <em>Java Language Specification, Second Edition</em> (JLS2). + * A valid identifier can act as a simple type name, method name or field name. + * + * @param id the Java identifier + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code <code>IStatus.OK</code> if + * the given identifier is a valid Java identifier, otherwise a status + * object indicating what is wrong with the identifier + * @since 3.3 + + + + + + + + + + + * Validate the given import declaration name. + * <p> + * The name of an import corresponds to a fully qualified type name + * or an on-demand package name as defined by ImportDeclaration (JLS2 7.5). + * For example, <code>"java.util.*"</code> or <code>"java.util.Hashtable"</code>. + * + * @param name the import declaration + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as an import declaration, otherwise a status + * object indicating what is wrong with the name + * @deprecated Use {@link #validateImportDeclaration(String id, String sourceLevel, String complianceLevel)} instead + + + + + + + + + * Validate the given import declaration name for the given source and compliance levels. + * <p> + * The name of an import corresponds to a fully qualified type name + * or an on-demand package name as defined by ImportDeclaration (JLS2 7.5). + * For example, <code>"java.util.*"</code> or <code>"java.util.Hashtable"</code>. + * + * @param name the import declaration + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as an import declaration, otherwise a status + * object indicating what is wrong with the name + * @since 3.3 + + + + + + + + + + + * Validate the given Java type name, either simple or qualified. + * For example, <code>"java.lang.Object"</code>, or <code>"Object"</code>. + * <p> + * + * @param name the name of a type + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a Java type name, + * a status with code <code>IStatus.WARNING</code> + * indicating why the given name is discouraged, + * otherwise a status object indicating what is wrong with + * the name + * @deprecated Use {@link #validateJavaTypeName(String id, String sourceLevel, String complianceLevel)} instead + + + + + + + + + * Validate the given Java type name, either simple or qualified, for the given source and compliance levels. + * + * <p>For example, <code>"java.lang.Object"</code>, or <code>"Object"</code>.</p> + * + * <p>The source level and compliance level values should be taken from the constant defined inside + * {@link JavaCore} class. The constants are named <code>JavaCore#VERSION_1_x</code>, x being set + * between '1' and '7'. + * </p> + * + * @param name the name of a type + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a Java type name, + * a status with code <code>IStatus.WARNING</code> + * indicating why the given name is discouraged, + * otherwise a status object indicating what is wrong with + * the name + * @since 3.3 + * @see JavaCore#VERSION_1_1 + * @see JavaCore#VERSION_1_2 + * @see JavaCore#VERSION_1_3 + * @see JavaCore#VERSION_1_4 + * @see JavaCore#VERSION_1_5 + * @see JavaCore#VERSION_1_6 + * @see JavaCore#VERSION_1_7 + + + + + + + + + + + * Validate the given method name. + * The special names "&lt;init&gt;" and "&lt;clinit&gt;" are not valid. + * <p> + * The syntax for a method name is defined by Identifier + * of MethodDeclarator (JLS2 8.4). For example "println". + * + * @param name the name of a method + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a method name, otherwise a status + * object indicating what is wrong with the name + * @deprecated Use {@link #validateMethodName(String id, String sourceLevel, String complianceLevel)} instead + + + + + + + + + * Validate the given method name for the given source and compliance levels. + * The special names "&lt;init&gt;" and "&lt;clinit&gt;" are not valid. + * <p> + * The syntax for a method name is defined by Identifier + * of MethodDeclarator (JLS2 8.4). For example "println". + * + * @param name the name of a method + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a method name, otherwise a status + * object indicating what is wrong with the name + * @since 3.3 + + + + + + + + + + + * Validate the given package name. + * <p> + * The syntax of a package name corresponds to PackageName as + * defined by PackageDeclaration (JLS2 7.4). For example, <code>"java.lang"</code>. + * <p> + * Note that the given name must be a non-empty package name (that is, attempting to + * validate the default package will return an error status.) + * Also it must not contain any characters or substrings that are not valid + * on the file system on which workspace root is located. + * + * @param name the name of a package + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a package name, otherwise a status + * object indicating what is wrong with the name + * @deprecated Use {@link #validatePackageName(String id, String sourceLevel, String complianceLevel)} instead + + + + + + + + + * Validate the given package name for the given source and compliance levels. + * <p> + * The syntax of a package name corresponds to PackageName as + * defined by PackageDeclaration (JLS2 7.4). For example, <code>"java.lang"</code>. + * <p> + * Note that the given name must be a non-empty package name (that is, attempting to + * validate the default package will return an error status.) + * Also it must not contain any characters or substrings that are not valid + * on the file system on which workspace root is located. + * + * @param name the name of a package + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a package name, otherwise a status + * object indicating what is wrong with the name + * @since 3.3 + + + + + + + + + + + * Validate a given classpath and output location for a project, using the following rules: + * <ul> + * <li> Classpath entries cannot collide with each other; that is, all entry paths must be unique. + * <li> The project output location path cannot be null, must be absolute and located inside the project. + * <li> Specific output locations (specified on source entries) can be null, if not they must be located inside the project, + * <li> A project entry cannot refer to itself directly (that is, a project cannot prerequisite itself). + * <li> Classpath entries or output locations cannot coincidate or be nested in each other, except for the following scenarii listed below: + * <ul><li> A source folder can coincidate with its own output location, in which case this output can then contain library archives. + * However, a specific output location cannot coincidate with any library or a distinct source folder than the one referring to it. </li> + * <li> A source/library folder can be nested in any source folder as long as the nested folder is excluded from the enclosing one. </li> + * <li> An output location can be nested in a source folder, if the source folder coincidates with the project itself, or if the output + * location is excluded from the source folder. + * </ul> + * </ul> + * + * Note that the classpath entries are not validated automatically. Only bound variables or containers are considered + * in the checking process (this allows to perform a consistency check on a classpath which has references to + * yet non existing projects, folders, ...). + * <p> + * This validation is intended to anticipate classpath issues prior to assigning it to a project. In particular, it will automatically + * be performed during the classpath setting operation (if validation fails, the classpath setting will not complete). + * <p> + * @param javaProject the given java project + * @param rawClasspath the given classpath + * @param projectOutputLocation the given output location + * @return a status object with code <code>IStatus.OK</code> if + * the given classpath and output location are compatible, otherwise a status + * object indicating what is wrong with the classpath or output location + * @since 2.0 + + + + + + + + + + + + + + * Returns a Java model status describing the problem related to this classpath entry if any, + * a status object with code <code>IStatus.OK</code> if the entry is fine (that is, if the + * given classpath entry denotes a valid element to be referenced onto a classpath). + * + * @param project the given java project + * @param entry the given classpath entry + * @param checkSourceAttachment a flag to determine if source attachment should be checked + * @return a java model status describing the problem related to this classpath entry if any, a status object with code <code>IStatus.OK</code> if the entry is fine + * @since 2.0 + + + + + + + + + + + * Validate the given type variable name. + * <p> + * Syntax of a type variable name corresponds to a Java identifier (JLS3 4.3). + * For example, <code>"E"</code>. + * + * @param name the name of a type variable + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a type variable name, otherwise a status + * object indicating what is wrong with the name + * @since 3.1 + * @deprecated Use {@link #validateTypeVariableName(String id, String sourceLevel, String complianceLevel)} instead + + + + + + + + + * Validate the given type variable name for the given source and compliance levels. + * <p> + * Syntax of a type variable name corresponds to a Java identifier (JLS3 4.3). + * For example, <code>"E"</code>. + * + * @param name the name of a type variable + * @param sourceLevel the source level + * @param complianceLevel the compliance level + * @return a status object with code <code>IStatus.OK</code> if + * the given name is valid as a type variable name, otherwise a status + * object indicating what is wrong with the name + * @since 3.3 + + + + + + + + + + + + * The plug-in runtime class for the Java model plug-in containing the core + * (UI-free) support for Java projects. + * <p> + * Like all plug-in runtime classes (subclasses of <code>Plugin</code>), this + * class is automatically instantiated by the platform when the plug-in gets + * activated. Clients must not attempt to instantiate plug-in runtime classes + * directly. + * </p> + * <p> + * The single instance of this class can be accessed from any plug-in declaring + * the Java model plug-in as a prerequisite via + * <code>JavaCore.getJavaCore()</code>. The Java model plug-in will be activated + * automatically if not already active. + * </p> + * @noinstantiate This class is not intended to be instantiated by clients. + + + + + + + + + + + + * The plug-in identifier of the Java core support + * (value <code>"org.eclipse.jdt.core"</code>). + + + + + + + * The identifier for the Java builder + * (value <code>"org.eclipse.jdt.core.javabuilder"</code>). + + + + + + + * The identifier for the Java model + * (value <code>"org.eclipse.jdt.core.javamodel"</code>). + + + + + + + * The identifier for the Java nature + * (value <code>"org.eclipse.jdt.core.javanature"</code>). + * The presence of this nature on a project indicates that it is + * Java-capable. + * + * @see org.eclipse.core.resources.IProject#hasNature(java.lang.String) + + + + + + + * Name of the handle id attribute in a Java marker. + + + + + + + * Name of the User Library Container id. + * @since 3.0 + + + + + + + * Compiler option ID: Generating Local Variable Debug Attribute. + * <p>When generated, this attribute will enable local variable names + * to be displayed in debugger, only in place where variables are + * definitely assigned (.class file is then bigger). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.debug.localVariable"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "generate", "do not generate" }</code></dd> + * <dt>Default:</dt><dd><code>"generate"</code></dd> + * </dl> + * @category CompilerOptionID + + + + + + + * Compiler option ID: Generating Line Number Debug Attribute. + * <p>When generated, this attribute will enable source code highlighting in debugger + * (.class file is then bigger). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.debug.lineNumber"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "generate", "do not generate" }</code></dd> + * <dt>Default:</dt><dd><code>"generate"</code></dd> + * </dl> + * @category CompilerOptionID + + + + + + + * Compiler option ID: Generating Source Debug Attribute. + * <p>When generated, this attribute will enable the debugger to present the + * corresponding source code. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.debug.sourceFile"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "generate", "do not generate" }</code></dd> + * <dt>Default:</dt><dd><code>"generate"</code></dd> + * </dl> + * @category CompilerOptionID + + + + + + + * Compiler option ID: Preserving Unused Local Variables. + * <p>Unless requested to preserve unused local variables (that is, never read), the + * compiler will optimize them out, potentially altering debugging. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.codegen.unusedLocal"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "preserve", "optimize out" }</code></dd> + * <dt>Default:</dt><dd><code>"preserve"</code></dd> + * </dl> + * @category CompilerOptionID + + + + + + + * Compiler option ID: Defining Target Java Platform. + * <p>For binary compatibility reason, .class files can be tagged to with certain VM versions and later. + * <p>Note that <code>"1.4"</code> target requires to toggle compliance mode to <code>"1.4"</code>, <code>"1.5"</code> target requires + * to toggle compliance mode to <code>"1.5"</code>, <code>"1.6"</code> target requires to toggle compliance mode to <code>"1.6"</code> and + * <code>"1.7"</code> target requires to toggle compliance mode to <code>"1.7"</code>. + * <code>"cldc1.1"</code> requires the source version to be <code>"1.3"</code> and the compliance version to be <code>"1.4"</code> or lower. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.codegen.targetPlatform"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "cldc1.1" }</code></dd> + * <dt>Default:</dt><dd><code>"1.2"</code></dd> + * </dl> + * @category CompilerOptionID + + + + + + + * Compiler option ID: Inline JSR Bytecode Instruction. + * <p>When enabled, the compiler will no longer generate JSR instructions, but rather inline corresponding + * subroutine code sequences (mostly corresponding to try finally blocks). The generated code will thus + * get bigger, but will load faster on virtual machines since the verification process is then much simpler. + * <p>This mode is anticipating support for the Java Specification Request 202. + * <p>Note that JSR inlining is optional only for target platform lesser than 1.5. From 1.5 on, the JSR + * inlining is mandatory (also see related setting {@link #COMPILER_CODEGEN_TARGET_PLATFORM}). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Javadoc Comment Support. + * <p>When this support is disabled, the compiler will ignore all javadoc problems options settings + * and will not report any javadoc problem. It will also not find any reference in javadoc comment and + * DOM AST Javadoc node will be only a flat text instead of having structured tag elements. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.doc.comment.support"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"enabled"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * @deprecated Discontinued since turning off would violate language specs. + * @category DeprecatedOptionID + + + + + + + * @deprecated Discontinued since turning off would violate language specs. + * @category DeprecatedOptionID + + + + + + + * Compiler option ID: Reporting Attempt to Override Package Visible Method. + * <p>A package visible method, which is any method that is not explicitly + * declared as public, protected or private, is not visible from other + * packages, and thus cannot be overridden from another package. + * Attempting to override a package visible method from another package + * introduces a new method that is unrelated to the original one. When + * enabling this option, the compiler will signal such situations as an + * error or a warning. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Method With Constructor Name. + * <p>Naming a method with a constructor name is generally considered poor + * style programming. When enabling this option, the compiler will signal such + * scenarii either as an error or a warning. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.methodWithConstructorName"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Deprecation. + * <p>When enabled, the compiler will signal use of deprecated API either as an + * error or a warning. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.deprecation"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Deprecation Inside Deprecated Code. + * <p>When enabled, the compiler will signal use of deprecated API inside deprecated code. + * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_DEPRECATION}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 2.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Deprecation When Overriding Deprecated Method. + * <p>When enabled, the compiler will signal the declaration of a method overriding a deprecated one. + * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_DEPRECATION}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Hidden Catch Block. + * <p>Locally to a try statement, some catch blocks may hide others. For example, + * <pre> + * try { throw new java.io.CharConversionException(); + * } catch (java.io.CharConversionException e) { + * } catch (java.io.IOException e) {}. + * </pre> + * When enabling this option, the compiler will issue an error or a warning for hidden + * catch blocks corresponding to checked exceptions. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Unused Local. + * <p>When enabled, the compiler will issue an error or a warning for unused local + * variables (that is, variables never read from). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedLocal"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Unused Parameter. + * <p>When enabled, the compiler will issue an error or a warning for unused method + * parameters (that is, parameters never read from). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedParameter"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Unused Parameter if Implementing Abstract Method. + * <p>When enabled, the compiler will signal unused parameters in abstract method implementations. + * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_UNUSED_PARAMETER}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 2.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Unused Parameter if Overriding Concrete Method. + * <p>When enabled, the compiler will signal unused parameters in methods overriding concrete ones. + * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_UNUSED_PARAMETER}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 2.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Consider Reference in Doc Comment for Unused Parameter Check. + * <p>When enabled, the compiler will consider doc comment references to parameters (i.e. <code>@param</code> clauses) for the unused + * parameter check. Thus, documented parameters will be considered as mandated as per doc contract. + * <p>The severity of the unused parameter problem is controlled with option {@link #COMPILER_PB_UNUSED_PARAMETER}. + * <p>Note: this option has no effect until the doc comment support is enabled according to the + * option {@link #COMPILER_DOC_COMMENT_SUPPORT}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"enabled"</code></dd> + * </dl> + * @since 3.3 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Unused Import. + * <p>When enabled, the compiler will issue an error or a warning for unused import + * reference. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedImport"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 2.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Presence of Type Arguments for a Non-Generic Method Invocation. + * <p>When enabled, the compiler will issue an error or a warning whenever type arguments are encountered for a + * non-generic method invocation. Note that prior to compliance level is <code>"1.7"</code>, this situation would automatically result + * in an error. From Java7 on, unused type arguments are being tolerated, and optionally warned against. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedTypeArgumentsForMethodInvocation"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.4 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Synthetic Access Emulation. + * <p>When enabled, the compiler will issue an error or a warning whenever it emulates + * access to a non-accessible member of an enclosing type. Such access can have + * performance implications. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Non-Externalized String Literal. + * <p>When enabled, the compiler will issue an error or a warning for non externalized + * String literal (that is, not tagged with <code>//$NON-NLS-&lt;n&gt;$</code>). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 2.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Usage of <code>'assert'</code> Identifier. + * <p>When enabled, the compiler will issue an error or a warning whenever <code>'assert'</code> is + * used as an identifier (reserved keyword in 1.4). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.assertIdentifier"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 2.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Usage of <code>'enum'</code> Identifier. + * <p>When enabled, the compiler will issue an error or a warning whenever <code>'enum'</code> is + * used as an identifier (reserved keyword in 1.5). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.enumIdentifier"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Non-Static Reference to a Static Member. + * <p>When enabled, the compiler will issue an error or a warning whenever a static field + * or method is accessed with an expression receiver. A reference to a static member should + * be qualified with a type name. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 2.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Indirect Reference to a Static Member. + * <p>When enabled, the compiler will issue an error or a warning whenever a static field + * or method is accessed in an indirect way. A reference to a static member should + * preferably be qualified with its declaring type name. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.indirectStaticAccess"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Assignment with no Effect. + * <p>When enabled, the compiler will issue an error or a warning whenever an assignment + * has no effect (e.g <code>'x = x'</code>). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.noEffectAssignment"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 2.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Interface Method not Compatible with non-Inherited Methods. + * <p>When enabled, the compiler will issue an error or a warning whenever an interface + * defines a method incompatible with a non-inherited <code>Object</code> method. Until this conflict + * is resolved, such an interface cannot be implemented, For example, + * <pre> + * interface I { + * int clone(); + * } + * </pre> + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 2.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Unused Private Members. + * <p>When enabled, the compiler will issue an error or a warning whenever a private + * method or field is declared but never used within the same unit. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedPrivateMember"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 2.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Local Variable Declaration Hiding another Variable. + * <p>When enabled, the compiler will issue an error or a warning whenever a local variable + * declaration is hiding some field or local variable (either locally, inherited or defined in enclosing type). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.localVariableHiding"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Special Parameter Hiding another Field. + * <p>When enabled, the compiler will signal cases where a constructor or setter method parameter declaration + * is hiding some field (either locally, inherited or defined in enclosing type). + * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_LOCAL_VARIABLE_HIDING}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Field Declaration Hiding another Variable. + * <p>When enabled, the compiler will issue an error or a warning whenever a field + * declaration is hiding some field or local variable (either locally, inherited or defined in enclosing type). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.fieldHiding"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Type Declaration Hiding another Type. + * <p>When enabled, the compiler will issue an error or a warning in situations where a type parameter + * declaration is hiding some type, when a nested type is hiding some type parameter, or when + * a nested type is hiding another nested type defined in same unit. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.typeParameterHiding"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Possible Accidental Boolean Assignment. + * <p>When enabled, the compiler will issue an error or a warning if a boolean assignment is acting as the condition + * of a control statement (where it probably was meant to be a boolean comparison). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Switch Fall-Through Case. + * <p>When enabled, the compiler will issue an error or a warning if a case may be + * entered by falling through previous case. Empty cases are allowed. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.fallthroughCase"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.2 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Empty Statements and Unnecessary Semicolons. + * <p>When enabled, the compiler will issue an error or a warning if an empty statement or a + * unnecessary semicolon is encountered. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.emptyStatement"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.booleanMethodThrowingException"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + * @deprecated - this option has no effect + + + + + + + * Compiler option ID: Reporting Unnecessary Type Check. + * <p>When enabled, the compiler will issue an error or a warning when a cast or an <code>instanceof</code> operation + * is unnecessary. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Unnecessary Else. + * <p>When enabled, the compiler will issue an error or a warning when a statement is unnecessarily + * nested within an <code>else</code> clause (in situation where then clause is not completing normally). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unnecessaryElse"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Undocumented Empty Block. + * <p>When enabled, the compiler will issue an error or a warning when an empty block is detected and it is not + * documented with any comment. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Finally Blocks Not Completing Normally. + * <p>When enabled, the compiler will issue an error or a warning when a finally block does not complete normally. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Unused Declared Thrown Exception. + * <p>When enabled, the compiler will issue an error or a warning when a + * method or a constructor is declaring a checked exception as thrown, + * but its body actually raises neither that exception, nor any other + * exception extending it. + * <p>This diagnostic is further tuned by options + * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_INCLUDE_DOC_COMMENT_REFERENCE}, + * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE}, + * and {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Unused Declared Thrown Exception in Overriding Method. + * <p>When disabled, the compiler will report unused declared thrown + * exceptions neither on overriding methods nor on implementing methods. + * <p>The severity of the unused declared thrown exception problem is + * controlled with option {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION}. + * <p>This diagnostic is further tuned by options + * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_INCLUDE_DOC_COMMENT_REFERENCE} and + * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Consider Reference in Doc Comment for Unused Declared Thrown Exception Check. + * <p>When enabled, the compiler will consider doc comment references to + * exceptions (i.e. <code>@throws</code> clauses) for the unused + * declared thrown exception check. Thus, documented exceptions will be + * considered as mandated as per doc contract. + * <p>The severity of the unused declared thrown exception problem is controlled with option {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION}. + * <p>Note: this option has no effect until the doc comment support is enabled according to the + * option {@link #COMPILER_DOC_COMMENT_SUPPORT}. + * <p>This diagnostic is further tuned by options + * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_EXEMPT_EXCEPTION_AND_THROWABLE} + * and {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"enabled"</code></dd> + * </dl> + * @since 3.4 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Unused Declared Thrown Exception Exempts Exception And Throwable. + * <p>When enabled, the compiler will issue an error or a warning when a + * method or a constructor is declaring a checked exception else than + * {@link java.lang.Throwable} or {@link java.lang.Exception} as thrown, + * but its body actually raises neither that exception, nor any other + * exception extending it. When disabled, the compiler will issue an + * error or a warning when a method or a constructor is declaring a + * checked exception (including {@link java.lang.Throwable} and + * {@link java.lang.Exception}) as thrown, but its body actually raises + * neither that exception, nor any other exception extending it. + * <p>The severity of the unused declared thrown exception problem is + * controlled with option + * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION}. + * <p>This diagnostic is further tuned by options + * {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_INCLUDE_DOC_COMMENT_REFERENCE} + * and {@link #COMPILER_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"enabled"</code></dd> + * </dl> + * @since 3.4 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Unqualified Access to Field. + * <p>When enabled, the compiler will issue an error or a warning when a field is access without any qualification. + * In order to improve code readability, it should be qualified, e.g. <code>'x'</code> should rather be written <code>'this.x'</code>. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * @deprecated Use {@link #COMPILER_PB_UNCHECKED_TYPE_OPERATION} instead. + * @since 3.1 + * @category DeprecatedOptionID + + + + + + + * Compiler option ID: Reporting Unchecked Type Operation. + * <p>When enabled, the compiler will issue an error or a warning whenever an operation involves generic types, and potentially + * invalidates type safety since involving raw types (e.g. invoking <code>#foo(X&lt;String&gt;)</code> with arguments <code>(X)</code>). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Raw Type Reference. + * <p>When enabled, the compiler will issue an error or a warning when detecting references to raw types. Raw types are + * discouraged, and are intended to help interfacing with legacy code. In the future, the language specification may + * reject raw references to generic types. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.rawTypeReference"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.2 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting of Unavoidable Generic Type Problems. + * <p> When enabled, the compiler will issue an error or warning even when it detects a generic type problem + * that could not have been avoided by the programmer. As an example, a type may be forced to use raw types + * in its method signatures and return types because the methods it overrides from a super type are declared to + * use raw types in the first place. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"enabled"</code></dd> + * </dl> + * @since 3.7 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting final Bound for Type Parameter. + * <p>When enabled, the compiler will issue an error or a warning whenever a generic type parameter is associated with a + * bound corresponding to a final type; since final types cannot be further extended, the parameter is pretty useless. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.finalParameterBound"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Missing Declaration of serialVersionUID Field on Serializable Class. + * <p>When enabled, the compiler will issue an error or a warning whenever a serializable class is missing a local declaration + * of a <code>serialVersionUID</code> field. This field must be declared as static final and be of type <code>long</code>. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingSerialVersion"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Varargs Argument Needing a Cast in Method/Constructor Invocation. + * <p>When enabled, the compiler will issue an error or a warning whenever a varargs arguments should be cast + * when passed to a method/constructor invocation. (e.g. <code>Class.getMethod(String name, Class ... args )</code> + * invoked with arguments <code>("foo", null)</code>). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Boxing/Unboxing Conversion. + * <p>When enabled, the compiler will issue an error or a warning whenever a boxing or an unboxing + * conversion is performed. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.autoboxing"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Use of Annotation Type as Super Interface. + * <p>When enabled, the compiler will issue an error or a warning whenever an annotation type is used + * as a super-interface. Though legal, this is discouraged. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.annotationSuperInterface"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Missing <code>@Override</code> Annotation. + * <p>When enabled, the compiler will issue an error or a warning whenever encountering a method + * declaration which overrides a superclass method but has no <code>@Override</code> annotation. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Missing <code>@Override</code> Annotation for interface method implementation. + * <p>When enabled, the compiler will issue an error or a warning whenever encountering a method + * declaration which overrides or implements a superinterface method but has no <code>@Override</code> annotation.</p> + * <p>This option only has an effect if the compiler compliance is 1.6 or greater.</p> + * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_MISSING_OVERRIDE_ANNOTATION}.</p> + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"enabled"</code></dd> + * </dl> + * @since 3.6 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Missing <code>@Deprecated</code> Annotation. + * <p>When enabled, the compiler will issue an error or a warning whenever encountering a declaration + * carrying a <code>@deprecated</code> doc tag but having no corresponding <code>@Deprecated</code> annotation. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Missing HashCode Method. + * <p>When enabled, the compiler will issue an error or a warning if a type + * overrides Object.equals(Object) but does not override hashCode(). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.5 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Dead Code. + * <p>When enabled, the compiler will issue an error or a warning if some non fatal dead code is detected. For instance, <code>if (false) foo();</code> + * is not reported as truly unreachable code by the Java Language Specification. If this diagnostic is enabled, then the invocation of <code>foo()</code> is + * going to be signaled as being dead code. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.deadCode"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.5 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Dead Code Inside Trivial If Statement. + * <p>When enabled, the compiler will signal presence of dead code inside trivial IF statement, e.g. <code>if (DEBUG)...</code>.. + * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_DEAD_CODE}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.deadCodeInTrivialIfStatement"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.5 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Incomplete Enum Switch. + * <p>When enabled, the compiler will issue an error or a warning whenever + * an enum constant has no corresponding case label in an enum switch + * statement. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * @since 3.1 + * @deprecated Use {@link #COMPILER_PB_NULL_REFERENCE} instead. + * @category DeprecatedOptionID + + + + + + + * Compiler option ID: Reporting Unreferenced Label. + * <p>When enabled, the compiler will issue an error or a warning when encountering a labeled statement which label + * is never explicitly referenced. A label is considered to be referenced if its name explicitly appears behind a break + * or continue statement; for instance the following label would be considered unreferenced: + * <code>LABEL: { break; }</code> + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedLabel"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.2 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Invalid Javadoc Comment. + * <p>This is the generic control for the severity of Javadoc problems. + * When enabled, the compiler will issue an error or a warning for a problem in Javadoc. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.invalidJavadoc"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Invalid Javadoc Tags. + * <p>When enabled, the compiler will signal unbound or unexpected reference tags in Javadoc. + * A <code>@throws</code> tag referencing an undeclared exception would be considered as unexpected. + * <p>Note that this diagnosis can be enabled based on the visibility of the construct associated with the Javadoc; + * also see the setting {@link #COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.invalidJavadocTags"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Invalid Javadoc Tags with Deprecated References. + * <p>Specify whether the compiler will report deprecated references used in Javadoc tags. + * <p>Note that this diagnosis can be enabled based on the visibility of the construct associated with the Javadoc; + * also see the setting {@link #COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Invalid Javadoc Tags with Not Visible References. + * <p>Specify whether the compiler will report non-visible references used in Javadoc tags. + * <p>Note that this diagnosis can be enabled based on the visibility of the construct associated with the Javadoc; + * also see the setting {@link #COMPILER_PB_INVALID_JAVADOC_TAGS_VISIBILITY}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Visibility Level For Invalid Javadoc Tags. + * <p>Set the minimum visibility level for Javadoc tag problems. Below this level problems will be ignored. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "public", "protected", "default", "private" }</code></dd> + * <dt>Default:</dt><dd><code>"public"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting missing tag description. + * <p>When enabled, the compiler will report a warning or an error for any Javadoc tag missing a required description. + * <p>The severity of the problem is controlled with option {@link #COMPILER_PB_INVALID_JAVADOC}. + * <p>It does not depend on option {@link #COMPILER_PB_INVALID_JAVADOC_TAGS}. + * <p>When this option is valued to {@link #COMPILER_PB_MISSING_JAVADOC_TAG_DESCRIPTION_ALL_STANDARD_TAGS}, + * a subset of the standard <a href="http://java.sun.com/javase/6/docs/technotes/tools/windows/javadoc.html#javadoctags">Javadoc tags</a> + * that have a description, text or label are checked. While this set may grow in the future, note that user-defined tags are not and will not be checked. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "return_tag", "all_standard_tags", "no_tag" }</code></dd> + * <dt>Default:</dt><dd><code>"return_tag"</code></dd> + * </dl> + * @since 3.4 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Missing Javadoc Tags. + * <p>This is the generic control for the severity of Javadoc missing tag problems. + * When enabled, the compiler will issue an error or a warning when tags are missing in Javadoc comments. + * <p>Note that this diagnosis can be enabled based on the visibility of the construct associated with the Javadoc; + * also see the setting {@link #COMPILER_PB_MISSING_JAVADOC_TAGS_VISIBILITY}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocTags"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Visibility Level For Missing Javadoc Tags. + * <p>Set the minimum visibility level for Javadoc missing tag problems. Below this level problems will be ignored. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "public", "protected", "default", "private" }</code></dd> + * <dt>Default:</dt><dd><code>"public"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Missing Javadoc Tags on Overriding Methods. + * <p>Specify whether the compiler will verify overriding methods in order to report Javadoc missing tag problems. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Missing Javadoc Tags for Method Type Parameters. + * <p>Specify whether a missing <code>@param</code> for a type parameter in a method declaration should be reported. + * When enabled, the compiler will issue a missing Javadoc tag error or warning for a type parameter without a + * corresponding <code>@param</code> tag.</p> + * <p>This option only has an effect if the compiler compliance is 1.5 or greater.</p> + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.7 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Missing Javadoc Comments. + * <p>This is the generic control for the severity of missing Javadoc comment problems. + * When enabled, the compiler will issue an error or a warning when Javadoc comments are missing. + * <p>Note that this diagnosis can be enabled based on the visibility of the construct associated with the expected Javadoc; + * also see the setting {@link #COMPILER_PB_MISSING_JAVADOC_COMMENTS_VISIBILITY}. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocComments"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Visibility Level For Missing Javadoc Comments. + * <p>Set the minimum visibility level for missing Javadoc problems. Below this level problems will be ignored. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "public", "protected", "default", "private" }</code></dd> + * <dt>Default:</dt><dd><code>"public"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Missing Javadoc Comments on Overriding Methods. + * <p>Specify whether the compiler will verify overriding methods in order to report missing Javadoc comment problems. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Usage of <code>char[]</code> Expressions in String Concatenations. + * <p>When enabled, the compiler will issue an error or a warning whenever a <code>char[]</code> expression + * is used in String concatenations (for example, <code>"hello" + new char[]{'w','o','r','l','d'}</code>). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 2.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Maximum Number of Problems Reported per Compilation Unit. + * <p>Specify the maximum number of problems reported on each compilation unit. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.maxProblemPerUnit"</code></dd> + * <dt>Possible values:</dt><dd><code>"&lt;n&gt;"</code> where <code>&lt;n&gt;</code> is zero or a positive integer (if zero then all problems are reported).</dd> + * <dt>Default:</dt><dd><code>"100"</code></dd> + * </dl> + * @since 2.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Treating Optional Error as Fatal. + * <p>When enabled, optional errors (i.e. optional problems which severity is set to <code>"error"</code>) will be treated as standard + * compiler errors, yielding problem methods/types preventing from running offending code until the issue got resolved.</p> + * <p>When disabled, optional errors are only considered as warnings, still carrying an error indication to make them more + * severe. Note that by default, optional errors are not fatal. Non-optional errors are + * always fatal.</p> + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.fatalOptionalError"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.2 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Parameter Assignment. + * <p>When enabled, the compiler will issue an error or a warning if a parameter is + * assigned to. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.parameterAssignment"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.2 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting a method that qualifies as static, but not declared static. + * <p>When enabled, the compiler will issue an error or a warning if a method has + * not been declared as <code>static</code>, even though it qualifies as one. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.7 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting a method that may qualify as static, but not declared static. + * <p>When enabled, the compiler will issue an error or a warning if a method has + * not been declared as <code>static</code>, even though it may qualify as one, + * when another method doesn't override it. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.7 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Setting Source Compatibility Mode. + * <p>Specify whether which source level compatibility is used. From 1.4 on, <code>'assert'</code> is a keyword + * reserved for assertion support. Also note, than when toggling to 1.4 mode, the target VM + * level should be set to <code>"1.4"</code> and the compliance mode should be <code>"1.4"</code>. + * <p>Source level 1.5 is necessary to enable generics, autoboxing, covariance, annotations, enumerations + * enhanced for loop, static imports and varargs. Once toggled, the target VM level should be set to <code>"1.5"</code> + * and the compliance mode should be <code>"1.5"</code>. + * <p>Source level 1.6 is necessary to enable the computation of stack map tables. Once toggled, the target + * VM level should be set to <code>"1.6"</code> and the compliance mode should be <code>"1.6"</code>. + * <p>Once the source level 1.7 is toggled, the target VM level should be set to <code>"1.7"</code> and the compliance mode + * should be <code>"1.7"</code>. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.source"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "1.3", "1.4", "1.5", "1.6", "1.7" }</code></dd> + * <dt>Default:</dt><dd><code>"1.3"</code></dd> + * </dl> + * @since 2.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Setting Compliance Level. + * <p>Select the compliance level for the compiler. In <code>"1.3"</code> mode, source and target settings + * should not go beyond <code>"1.3"</code> level. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.compliance"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "1.3", "1.4", "1.5", "1.6", "1.7" }</code></dd> + * <dt>Default:</dt><dd><code>"1.4"</code></dd> + * </dl> + * @since 2.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Defining the Automatic Task Priorities. + * <p>In parallel with the Automatic Task Tags, this list defines the priorities (high, normal or low) + * of the task markers issued by the compiler. + * If the default is specified, the priority of each task marker is <code>"NORMAL"</code>.</p> + * <p>Task Priorities and task tags must have the same length. If task priorities are set, then task tags should also + * be set.</p> + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.taskPriorities"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "&lt;priority&gt;[,&lt;priority&gt;]*" }</code> where <code>&lt;priority&gt;</code> is one of <code>"HIGH"</code>, <code>"NORMAL"</code> or <code>"LOW"</code></dd> + * <dt>Default:</dt><dd><code>"NORMAL,HIGH,NORMAL"</code></dd> + * </dl> + * @since 2.1 + * @category CompilerOptionID + * @see #COMPILER_TASK_TAGS + + + + + + + * Compiler option ID: Defining the Automatic Task Tags. + * <p>When the tag list is not empty, the compiler will issue a task marker whenever it encounters + * one of the corresponding tags inside any comment in Java source code. + * <p>Generated task messages will start with the tag, and range until the next line separator, + * comment ending, or tag.</p> + * <p>When a given line of code bears multiple tags, each tag will be reported separately. + * Moreover, a tag immediately followed by another tag will be reported using the contents of the + * next non-empty tag of the line, if any.</p> + * <p>Note that tasks messages are trimmed. If a tag is starting with a letter or digit, then it cannot be leaded by + * another letter or digit to be recognized (<code>"fooToDo"</code> will not be recognized as a task for tag <code>"ToDo"</code>, but <code>"foo#ToDo"</code> + * will be detected for either tag <code>"ToDo"</code> or <code>"#ToDo"</code>). Respectively, a tag ending with a letter or digit cannot be followed + * by a letter or digit to be recognized (<code>"ToDofoo"</code> will not be recognized as a task for tag <code>"ToDo"</code>, but <code>"ToDo:foo"</code> will + * be detected either for tag <code>"ToDo"</code> or <code>"ToDo:"</code>).</p> + * <p>Task Priorities and task tags must have the same length. If task tags are set, then task priorities should also + * be set.</p> + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.taskTags"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "&lt;tag&gt;[,&lt;tag&gt;]*" }</code> where <code>&lt;tag&gt;</code> is a String without any wild-card or leading/trailing spaces</dd> + * <dt>Default:</dt><dd><code>"TODO,FIXME,XXX"</code></dd> + * </dl> + * @since 2.1 + * @category CompilerOptionID + * @see #COMPILER_TASK_PRIORITIES + + + + + + + * Compiler option ID: Determining whether task tags are case-sensitive. + * <p>When enabled, task tags are considered in a case-sensitive way. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.taskCaseSensitive"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"enabled"</code></dd> + * </dl> + * @since 3.0 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Forbidden Reference to Type with Restricted Access. + * <p>When enabled, the compiler will issue an error or a warning when referring to a type that is non accessible, as defined according + * to the access rule specifications. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.forbiddenReference"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"error"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Discouraged Reference to Type with Restricted Access. + * <p>When enabled, the compiler will issue an error or a warning when referring to a type with discouraged access, as defined according + * to the access rule specifications. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.discouragedReference"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Determining Effect of <code>@SuppressWarnings</code>. + * <p>When enabled, the <code>@SuppressWarnings</code> annotation can be used to suppress some compiler warnings. + * <p>When disabled, all <code>@SupressWarnings</code> annotations are ignored; i.e., warnings are reported. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.suppressWarnings"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"enabled"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Raise null related errors or warnings arising because of assert statements. + * <p>When enabled, the compiler will flag all null related errors or warnings that have been enabled by the user, + * irrespective of whether a variable occurred in an assert statement.</p> + * <p>When disabled, the compiler will not flag null related errors or warnings on variables that got marked as maybe or definitely + * <code>null</code> in an assert statement upstream.</p> + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.7 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Further Determining the Effect of <code>@SuppressWarnings</code> if also + * {@link #COMPILER_PB_SUPPRESS_WARNINGS} is enabled. + * <p>When enabled, the <code>@SuppressWarnings</code> annotation can additionally be used to suppress + * optional compiler diagnostics that have been configured as {@link #ERROR}. + * <p>When disabled, all <code>@SuppressWarnings</code> annotations only affects warnings. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.6 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Unhandled Warning Token for <code>@SuppressWarnings</code>. + * <p>When enabled, the compiler will issue an error or a warning when encountering a token + * it cannot handle inside a <code>@SuppressWarnings</code> annotation. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unhandledWarningToken"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.1 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Unnecessary <code>@SuppressWarnings</code>. + * <p>When enabled, the compiler will issue an error or a warning when encountering <code>@SuppressWarnings</code> annotation + * for which no corresponding warning got detected in the code. This diagnostic is provided to help developers to get + * rid of transient <code>@SuppressWarnings</code> no longer needed. Note that <code>@SuppressWarnings("all")</code> is still + * silencing the warning for unnecessary <code>@SuppressWarnings</code>, as it is the master switch to silence ALL warnings. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedWarningToken"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.4 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Null Dereference. + * <p>When enabled, the compiler will issue an error or a warning whenever a + * variable that is statically known to hold a null value is used to + * access a field or method.</p> + * <p>Assert statements are ignored unless {@link #COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS} + * is enabled.</p> + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.nullReference"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.2 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Potential Null Dereference. + * <p>When enabled, the compiler will issue an error or a warning whenever a + * variable that has formerly been tested against null but is not (no more) + * statically known to hold a non-null value is used to access a field or + * method.</p> + * <p>Assert statements are ignored unless {@link #COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS} + * is enabled.</p> + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.potentialNullReference"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.3 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Redundant Null Check. + * <p>When enabled, the compiler will issue an error or a warning whenever a + * variable that is statically known to hold a null or a non-null value + * is tested against null.</p> + * <p>Assert statements are ignored unless {@link #COMPILER_PB_INCLUDE_ASSERTS_IN_NULL_ANALYSIS} + * is enabled.</p> + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.redundantNullCheck"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.3 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Overriding method that doesn't call the super method invocation. + * <p>When enabled, the compiler will issue an error or a warning if a method is overriding a method without calling + * the super invocation. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.overridingMethodWithoutSuperInvocation"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.3 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Redundant Superinterface. + * <p>When enabled, the compiler will issue an error or a warning if a type + * explicitly implements an interface that is already implemented by any + * of its supertypes. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.redundantSuperinterface"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.4 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Comparison of Identical Expressions. + * <p>When enabled, the compiler will issue an error or a warning if a comparison + * is involving identical operands (e.g <code>'x == x'</code>). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.comparingIdentical"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 3.5 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Missing Synchronized Modifier On Inherited Method. + * <p>When enabled, the compiler will issue an error or a warning if a method + * overrides a synchronized method without having a synchronized modifier. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.5 + * @category CompilerOptionID + + + + + + + * Compiler option ID: Reporting Allocation of an Unused Object. + * <p>When enabled, the compiler will issue an error or a warning if an object is allocated but never used, + * neither by holding a reference nor by invoking one of the object's methods. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.6 + * @category CompilerOptionID + + + + + + + * Core option ID: Computing Project Build Order. + * <p>Indicate whether JavaCore should enforce the project build order to be based on + * the classpath prerequisite chain. When requesting to compute, this takes over + * the platform default order (based on project references). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.computeJavaBuildOrder"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "compute", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @category CoreOptionID + + + + + + + * Core option ID: Specifying Filters for Resource Copying Control. + * <p>Allow to specify some filters to control the resource copy process. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.builder.resourceCopyExclusionFilter"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "&lt;name&gt;[,&lt;name&gt;]* }</code> where <code>&lt;name&gt;</code> is a file name pattern (* and ? wild-cards allowed) + * or the name of a folder which ends with <code>'/'</code></dd> + * <dt>Default:</dt><dd><code>""</code></dd> + * </dl> + * @since 2.0 + * @category CoreOptionID + + + + + + + * Core option ID: Reporting Duplicate Resources. + * <p>Indicate the severity of the problem reported when more than one occurrence + * of a resource is to be copied into the output location. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.builder.duplicateResourceTask"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning" }</code></dd> + * <dt>Default:</dt><dd><code>"warning"</code></dd> + * </dl> + * @since 2.1 + * @category CoreOptionID + + + + + + + * Core option ID: Cleaning Output Folder(s). + * <p>Indicate whether the JavaBuilder is allowed to clean the output folders + * when performing full build operations. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.builder.cleanOutputFolder"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "clean", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"clean"</code></dd> + * </dl> + * @since 2.1 + * @category CoreOptionID + + + + + + + * Core option ID: Recreate Modified class files in Output Folder. + * <p>Indicate whether the JavaBuilder should check for any changes to .class files + * in the output folders while performing incremental build operations. If changes + * are detected to managed .class files, then a full build is performed, otherwise + * the changes are left as is. Tools further altering generated .class files, like optimizers, + * should ensure this option remains set in its default state of ignore. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.2 + * @category CoreOptionID + + + + + + + * Core option ID: Reporting Incomplete Classpath. + * <p>Indicate the severity of the problem reported when an entry on the classpath does not exist, + * is not legite or is not visible (for example, a referenced project is closed). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.incompleteClasspath"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning"}</code></dd> + * <dt>Default:</dt><dd><code>"error"</code></dd> + * </dl> + * @since 2.1 + * @category CoreOptionID + + + + + + + * Core option ID: Reporting Classpath Cycle. + * <p>Indicate the severity of the problem reported when a project is involved in a cycle. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.circularClasspath"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning" }</code></dd> + * <dt>Default:</dt><dd><code>"error"</code></dd> + * </dl> + * @since 2.1 + * @category CoreOptionID + + + + + + + * Core option ID: Reporting Incompatible JDK Level for Required Binaries. + * <p>Indicate the severity of the problem reported when a project prerequisites another project + * or library with an incompatible target JDK level (e.g. project targeting 1.1 vm, but compiled against 1.4 libraries). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.incompatibleJDKLevel"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"ignore"</code></dd> + * </dl> + * @since 3.0 + * @category CoreOptionID + + + + + + + * Core option ID: Abort if Invalid Classpath. + * <p>Allow to toggle the builder to abort if the classpath is invalid. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.builder.invalidClasspath"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "abort", "ignore" }</code></dd> + * <dt>Default:</dt><dd><code>"abort"</code></dd> + * </dl> + * @since 2.0 + * @category CoreOptionID + + + + + + + * Core option ID: Default Source Encoding Format. + * <p>Get the default encoding format of source files. This value is + * immutable and preset to the result of <code>ResourcesPlugin.getEncoding()</code>. + * <p>It is offered as a convenience shortcut only. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.encoding"</code></dd> + * <dt>value:</dt><dd><code>&lt;immutable, platform default value&gt;</code></dd> + * </dl> + * @since 2.0 + * @category CoreOptionID + + + + + + + * Core option ID: Enabling Usage of Classpath Exclusion Patterns. + * <p>When disabled, no entry on a project classpath can be associated with + * an exclusion pattern. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.classpath.exclusionPatterns"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"enabled"</code></dd> + * </dl> + * @since 2.1 + * @category CoreOptionID + + + + + + + * Core option ID: Enabling Usage of Classpath Multiple Output Locations. + * <p>When disabled, no entry on a project classpath can be associated with + * a specific output location, preventing thus usage of multiple output locations. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.classpath.multipleOutputLocations"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"enabled"</code></dd> + * </dl> + * @since 2.1 + * @category CoreOptionID + + + + + + + * Core option ID: Set the timeout value for retrieving the method's parameter names from javadoc. + * <p>Timeout in milliseconds to retrieve the method's parameter names from javadoc. + * <p>If the value is <code>0</code>, the parameter names are not fetched and the raw names are returned. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.timeoutForParameterNameFromAttachedJavadoc"</code></dd> + * <dt>Possible values:</dt><dd><code>"&lt;n&gt;"</code>, where <code>n</code> is an integer greater than or equal to <code>0</code></dd> + * <dt>Default:</dt><dd><code>"50"</code></dd> + * </dl> + * @since 3.2 + * @category CoreOptionID + + + + + + + * @since 2.0 + * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION}, + * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_BLOCK} , + * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION}, + * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION}, + * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_SWITCH}, + * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION} instead. + * @category DeprecatedOptionID + + + + + + + * @since 2.0 + * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT}, + * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT}, + * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT}, + * {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT} instead. + * @category DeprecatedOptionID + + + + + + + * @since 2.0 + * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_COMPACT_ELSE_IF} instead. + * @category DeprecatedOptionID + + + + + + + * @since 2.0 + * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK} instead. + * @category DeprecatedOptionID + + + + + + + * @since 2.0 + * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE} instead. + * @category DeprecatedOptionID + + + + + + + * @since 2.0 + * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_LINE_SPLIT} instead + * @category DeprecatedOptionID + + + + + + + * @since 2.0 + * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR} instead. + * @category DeprecatedOptionID + + + + + + + * @since 2.0 + * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_TAB_CHAR} instead. + * @category DeprecatedOptionID + + + + + + + * @since 2.0 + * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_TAB_SIZE} instead. + * @category DeprecatedOptionID + + + + + + + * @since 2.1 + * @deprecated Use {@link org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants#FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST} instead. + * @category DeprecatedOptionID + + + + + + + * Code assist option ID: Activate Visibility Sensitive Completion. + * <p>When active, completion doesn't show that you can not see + * (for example, you can not see private methods of a super class). + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.visibilityCheck"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 2.0 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Activate Deprecation Sensitive Completion. + * <p>When enabled, completion doesn't propose deprecated members and types. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.deprecationCheck"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.2 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Activate Camel Case Sensitive Completion. + * <p>When enabled, completion shows proposals whose name match the CamelCase + * pattern. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.camelCaseMatch"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"enabled"</code></dd> + * </dl> + * @since 3.2 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Automatic Qualification of Implicit Members. + * <p>When active, completion automatically qualifies completion on implicit + * field references and message expressions. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.forceImplicitQualification"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 2.0 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Define the Prefixes for Field Name. + * <p>When the prefixes is non empty, completion for field name will begin with + * one of the proposed prefixes. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.fieldPrefixes"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "&lt;prefix&gt;[,&lt;prefix&gt;]*" }</code> where <code>&lt;prefix&gt;</code> is a String without any wild-card</dd> + * <dt>Default:</dt><dd><code>""</code></dd> + * </dl> + * @since 2.1 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Define the Prefixes for Static Field Name. + * <p>When the prefixes is non empty, completion for static field name will begin with + * one of the proposed prefixes. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.staticFieldPrefixes"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "&lt;prefix&gt;[,&lt;prefix&gt;]*" }</code> where <code>&lt;prefix&gt;</code> is a String without any wild-card</dd> + * <dt>Default:</dt><dd><code>""</code></dd> + * </dl> + * @since 2.1 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Define the Prefixes for Static Final Field Name. + * <p>When the prefixes is non empty, completion for static final field name will begin with + * one of the proposed prefixes. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "&lt;prefix&gt;[,&lt;prefix&gt;]*" }</code> where <code>&lt;prefix&gt;</code> is a String without any wild-card</dd> + * <dt>Default:</dt><dd><code>""</code></dd> + * </dl> + * @since 3.5 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Define the Prefixes for Local Variable Name. + * <p>When the prefixes is non empty, completion for local variable name will begin with + * one of the proposed prefixes. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.localPrefixes"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "&lt;prefix&gt;[,&lt;prefix&gt;]*" }</code> where <code>&lt;prefix&gt;</code> is a String without any wild-card</dd> + * <dt>Default:</dt><dd><code>""</code></dd> + * </dl> + * @since 2.1 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Define the Prefixes for Argument Name. + * <p>When the prefixes is non empty, completion for argument name will begin with + * one of the proposed prefixes. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.argumentPrefixes"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "&lt;prefix&gt;[,&lt;prefix&gt;]*" }</code> where <code>&lt;prefix&gt;</code> is a String without any wild-card</dd> + * <dt>Default:</dt><dd><code>""</code></dd> + * </dl> + * @since 2.1 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Define the Suffixes for Field Name. + * <p>When the suffixes is non empty, completion for field name will end with + * one of the proposed suffixes. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.fieldSuffixes"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "&lt;suffix&gt;[,&lt;suffix&gt;]*" }</code> where <code>&lt;suffix&gt;</code> is a String without any wild-card</dd> + * <dt>Default:</dt><dd><code>""</code></dd> + * </dl> + * @since 2.1 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Define the Suffixes for Static Field Name. + * <p>When the suffixes is non empty, completion for static field name will end with + * one of the proposed suffixes. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.staticFieldSuffixes"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "&lt;suffix&gt;[,&lt;suffix&gt;]*" }</code>< where <code>&lt;suffix&gt;</code> is a String without any wild-card</dd> + * <dt>Default:</dt><dd><code>""</code></dd> + * </dl> + * @since 2.1 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Define the Suffixes for Static Final Field Name. + * <p>When the suffixes is non empty, completion for static final field name will end with + * one of the proposed suffixes. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "&lt;suffix&gt;[,&lt;suffix&gt;]*" }</code>< where <code>&lt;suffix&gt;</code> is a String without any wild-card</dd> + * <dt>Default:</dt><dd><code>""</code></dd> + * </dl> + * @since 3.5 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Define the Suffixes for Local Variable Name. + * <p>When the suffixes is non empty, completion for local variable name will end with + * one of the proposed suffixes. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.localSuffixes"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "&lt;suffix&gt;[,&lt;suffix&gt;]*" }</code> where <code>&lt;suffix&gt;</code> is a String without any wild-card</dd> + * <dt>Default:</dt><dd><code>""</code></dd> + * </dl> + * @since 2.1 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Define the Suffixes for Argument Name. + * <p>When the suffixes is non empty, completion for argument name will end with + * one of the proposed suffixes. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.argumentSuffixes"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "&lt;suffix&gt;[,&lt;suffix&gt;]*" }</code> where <code>&lt;suffix&gt;</code> is a String without any wild-card</dd> + * <dt>Default:</dt><dd><code>""</code></dd> + * </dl> + * @since 2.1 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Activate Forbidden Reference Sensitive Completion. + * <p>When enabled, completion doesn't propose elements which match a + * forbidden reference rule. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.forbiddenReferenceCheck"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"enabled"</code></dd> + * </dl> + * @since 3.1 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Activate Discouraged Reference Sensitive Completion. + * <p>When enabled, completion doesn't propose elements which match a + * discouraged reference rule. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.discouragedReferenceCheck"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"disabled"</code></dd> + * </dl> + * @since 3.1 + * @category CodeAssistOptionID + + + + + + + * Code assist option ID: Activate Suggestion of Static Import. + * <p>When enabled, completion proposals can contain static import + * pattern. + * <dl> + * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.codeComplete.suggestStaticImports"</code></dd> + * <dt>Possible values:</dt><dd><code>{ "enabled", "disabled" }</code></dd> + * <dt>Default:</dt><dd><code>"enabled"</code></dd> + * </dl> + * @since 3.3 + * @category CodeAssistOptionID + + + + + + + * @deprecated Use {@link #DEFAULT_TASK_TAGS} instead. + * @since 2.1 + * @category DeprecatedOptionValue + + + + + + + * @deprecated Use {@link #DEFAULT_TASK_PRIORITIES} instead. + * @since 2.1 + * @category DeprecatedOptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @category OptionValue + + + + + + + * Configurable option value for {@link #COMPILER_TASK_PRIORITIES}: {@value}. + * @since 2.1 + * @category OptionValue + + + + + + + * Configurable option value for {@link #COMPILER_TASK_PRIORITIES}: {@value}. + * @since 2.1 + * @category OptionValue + + + + + + + * Configurable option value for {@link #COMPILER_TASK_PRIORITIES}: {@value}. + * @since 2.1 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.2 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.3 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.4 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 2.1 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.0 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.1 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.4 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.4 + * @category OptionValue + + + + + + + * Configurable option value: {@value}. + * @since 3.4 + * @category OptionValue + + + + + + + * Value of the content-type for Java source files. Use this value to retrieve the Java content type + * from the content type manager, and to add new Java-like extensions to this content type. + * + * @see org.eclipse.core.runtime.content.IContentTypeManager#getContentType(String) + * @see #getJavaLikeExtensions() + * @since 3.2 + + + + + + + * Adds the given listener for changes to Java elements. + * Has no effect if an identical listener is already registered. + * + * This listener will only be notified during the POST_CHANGE resource change notification + * and any reconcile operation (POST_RECONCILE). + * For finer control of the notification, use <code>addElementChangedListener(IElementChangedListener,int)</code>, + * which allows to specify a different eventMask. + * + * @param listener the listener + * @see ElementChangedEvent + + + + + + + + * Adds the given listener for changes to Java elements. + * Has no effect if an identical listener is already registered. + * After completion of this method, the given listener will be registered for exactly + * the specified events. If they were previously registered for other events, they + * will be deregistered. + * <p> + * Once registered, a listener starts receiving notification of changes to + * java elements in the model. The listener continues to receive + * notifications until it is replaced or removed. + * </p> + * <p> + * Listeners can listen for several types of event as defined in <code>ElementChangeEvent</code>. + * Clients are free to register for any number of event types however if they register + * for more than one, it is their responsibility to ensure they correctly handle the + * case where the same java element change shows up in multiple notifications. + * Clients are guaranteed to receive only the events for which they are registered. + * </p> + * + * @param listener the listener + * @param eventMask the bit-wise OR of all event types of interest to the listener + * @see IElementChangedListener + * @see ElementChangedEvent + * @see #removeElementChangedListener(IElementChangedListener) + * @since 2.0 + + + + + + + + + * Configures the given marker attribute map for the given Java element. + * Used for markers, which denote a Java element rather than a resource. + * + * @param attributes the mutable marker attribute map (key type: <code>String</code>, + * value type: <code>String</code>) + * @param element the Java element for which the marker needs to be configured + + + + + + + + + + + + + + + + + + + + + * Adds the given listener for POST_CHANGE resource change events to the Java core. + * The listener is guaranteed to be notified of the POST_CHANGE resource change event before + * the Java core starts processing the resource change event itself. + * <p> + * Has no effect if an identical listener is already registered. + * </p> + * + * @param listener the listener + * @see #removePreProcessingResourceChangedListener(IResourceChangeListener) + * @since 3.0 + * @deprecated use addPreProcessingResourceChangedListener(listener, IResourceChangeEvent.POST_CHANGE) instead + + + + + + + + * Adds the given listener for resource change events of the given types to the Java core. + * The listener is guaranteed to be notified of the resource change event before + * the Java core starts processing the resource change event itself. + * <p> + * If an identical listener is already registered, the given event types are added to the event types + * of interest to the listener. + * </p> + * <p> + * Supported event types are: + * <ul> + * <li>{@link IResourceChangeEvent#PRE_BUILD}</li> + * <li>{@link IResourceChangeEvent#POST_BUILD}</li> + * <li>{@link IResourceChangeEvent#POST_CHANGE}</li> + * <li>{@link IResourceChangeEvent#PRE_DELETE}</li> + * <li>{@link IResourceChangeEvent#PRE_CLOSE}</li> + * </ul> + * This list may increase in the future. + * </p> + * + * @param listener the listener + * @param eventMask the bit-wise OR of all event types of interest to the + * listener + * @see #removePreProcessingResourceChangedListener(IResourceChangeListener) + * @see IResourceChangeEvent + * @since 3.2 + + + + + + + + + * Configures the given marker for the given Java element. + * Used for markers, which denote a Java element rather than a resource. + * + * @param marker the marker to be configured + * @param element the Java element for which the marker needs to be configured + * @exception CoreException if the <code>IMarker.setAttribute</code> on the marker fails + + + + + + + + + * Returns the Java model element corresponding to the given handle identifier + * generated by <code>IJavaElement.getHandleIdentifier()</code>, or + * <code>null</code> if unable to create the associated element. + * + * @param handleIdentifier the given handle identifier + * @return the Java element corresponding to the handle identifier + + + + + + + + + + * A checked exception representing a failure in the Java model. + * Java model exceptions contain a Java-specific status object describing the + * cause of the exception. + * <p> + * Instances of this class are automatically created by the Java model + * when problems arise, so there is generally no need for clients to create + * instances. + * </p> + * + * @see IJavaModelStatus + * @see IJavaModelStatusConstants + * + * @noextend This class is not intended to be subclassed by clients. + + + + + + + + + * Returns the underlying <code>Throwable</code> that caused the failure. + * + * @return the wrappered <code>Throwable</code>, or <code>null</code> if the + * direct case of the failure was at the Java model layer + + + + + + + + * Returns the Java model status object for this exception. + * Equivalent to <code>(IJavaModelStatus) getStatus()</code>. + * + * @return a status object + + + + + + + + * Returns whether this exception indicates that a Java model element does not + * exist. Such exceptions have a status with a code of + * <code>IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST</code> or + * <code>IJavaModelStatusConstants.ELEMENT_NOT_ON_CLASSPATH</code>. + * This is a convenience method. + * + * @return <code>true</code> if this exception indicates that a Java model + * element does not exist + * @see IJavaModelStatus#isDoesNotExist() + * @see IJavaModelStatusConstants#ELEMENT_DOES_NOT_EXIST + * @see IJavaModelStatusConstants#ELEMENT_NOT_ON_CLASSPATH + + + + + + + + * Prints this exception's stack trace to the given print stream. + * + * @param output the print stream + * @since 3.0 + + + + + + + + * Prints this exception's stack trace to the given print writer. + * + * @param output the print writer + * @since 3.0 + + + + + + + + + + + + * Provides methods for computing Java-specific names. + * <p> + * The behavior of the methods is dependent of several JavaCore options. + * <p> + * The possible options are : + * <ul> + * <li> {@link JavaCore#CODEASSIST_FIELD_PREFIXES} : Define the Prefixes for Field Name.</li> + * <li> {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} : Define the Suffixes for Field Name.</li> + * + * <li> {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES} : Define the Prefixes for Static Field Name.</li> + * <li> {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} : Define the Suffixes for Static Field Name.</li> + * + * <li> {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_PREFIXES} : Define the Prefixes for Static Final Field Name.</li> + * <li> {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES} : Define the Suffixes for Static Final Field Name.</li> + * + * <li> {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} : Define the Prefixes for Local Variable Name.</li> + * <li> {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES} : Define the Suffixes for Local Variable Name.</li> + * + * <li> {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} : Define the Prefixes for Argument Name.</li> + * <li> {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES} : Define the Suffixes for Argument Name.</li> + * </ul> + * </p> + * <p> + * For a complete description of the configurable options, see {@link JavaCore#getDefaultOptions()}. + * To programmatically change these options, see {@link JavaCore#setOptions(java.util.Hashtable)}. + * </p> + * <p> + * This class provides static methods and constants only. + * </p> + * + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * @since 2.1 + * @noinstantiate This class is not intended to be instantiated by clients. + + + + + + + + + + + + + + + + + + * Variable kind which represents a static field. + * + * @since 3.5 + + + + + + + * Variable kind which represents an instance field. + * + * @since 3.5 + + + + + + + * Variable kind which represents a static final field. + * + * @since 3.5 + + + + + + + * Variable kind which represents an argument. + * + * @since 3.5 + + + + + + + * Variable kind which represents a local variable. + * + * @since 3.5 + + + + + + + * The base name associated to this base name kind is a simple name. + * When this base name is used the whole name is considered. + * + * @see #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean) + * + * @since 3.5 + + + + + + + * The base name associated to this base name kind is a simple type name. + * When this base name is used all the words of the name are considered. + * + * @see #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean) + * + * @since 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Remove prefix and suffix from an argument name. + * <p> + * If argument name prefix is <code>pre</code> and argument name suffix is <code>suf</code> + * then for an argument named <code>preArgsuf</code> the result of this method is <code>arg</code>. + * If there is no prefix or suffix defined in JavaCore options the result is the unchanged + * name <code>preArgsuf</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} and + * {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES}. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param javaProject project which contains the argument. + * @param argumentName argument's name. + * @return char[] the name without prefix and suffix. + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * + * @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead with {@link #VK_PARAMETER} as variable kind. + + + + + + + + + + + + + + + + * Remove prefix and suffix from an argument name. + * <p> + * If argument name prefix is <code>pre</code> and argument name suffix is <code>suf</code> + * then for an argument named <code>preArgsuf</code> the result of this method is <code>arg</code>. + * If there is no prefix or suffix defined in JavaCore options the result is the unchanged + * name <code>preArgsuf</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} and + * {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES}. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param javaProject project which contains the argument. + * @param argumentName argument's name. + * @return char[] the name without prefix and suffix. + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * + * @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead with {@link #VK_PARAMETER} as variable kind. + + + + + + + + + + * Remove prefix and suffix from a field name. + * <p> + * If field name prefix is <code>pre</code> and field name suffix is <code>suf</code> + * then for a field named <code>preFieldsuf</code> the result of this method is <code>field</code>. + * If there is no prefix or suffix defined in JavaCore options the result is the unchanged + * name <code>preFieldsuf</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES} } , + * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param javaProject project which contains the field. + * @param fieldName field's name. + * @param modifiers field's modifiers as defined by the class + * <code>Flags</code>. + * @return char[] the name without prefix and suffix. + * @see Flags + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * + * @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead + * with {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FIELD} as variable kind. + + + + + + + + + + + + + + + + + * Remove prefix and suffix from a field name. + * <p> + * If field name prefix is <code>pre</code> and field name suffix is <code>suf</code> + * then for a field named <code>preFieldsuf</code> the result of this method is <code>field</code>. + * If there is no prefix or suffix defined in JavaCore options the result is the unchanged + * name <code>preFieldsuf</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param javaProject project which contains the field. + * @param fieldName field's name. + * @param modifiers field's modifiers as defined by the class + * <code>Flags</code>. + * @return char[] the name without prefix and suffix. + * @see Flags + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * + * @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead + * with {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FIELD} as variable kind. + + + + + + + + + + + * Remove prefix and suffix from a local variable name. + * <p> + * If local variable name prefix is <code>pre</code> and local variable name suffix is <code>suf</code> + * then for a local variable named <code>preLocalsuf</code> the result of this method is <code>local</code>. + * If there is no prefix or suffix defined in JavaCore options the result is the unchanged + * name <code>preLocalsuf</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and + * {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param javaProject project which contains the variable. + * @param localName variable's name. + * @return char[] the name without prefix and suffix. + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * + * @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead with {@link #VK_LOCAL} as variable kind. + + + + + + + + + + + + + + + + * Remove prefix and suffix from a local variable name. + * <p> + * If local variable name prefix is <code>pre</code> and local variable name suffix is <code>suf</code> + * then for a local variable named <code>preLocalsuf</code> the result of this method is <code>local</code>. + * If there is no prefix or suffix defined in JavaCore options the result is the unchanged + * name <code>preLocalsuf</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and + * {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param javaProject project which contains the variable. + * @param localName variable's name. + * @return char[] the name without prefix and suffix. + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * + * @deprecated Use {@link #getBaseName(int, String, IJavaProject)} instead with {@link #VK_LOCAL} as variable kind. + + + + + + + + + + * Returns a base name which could be used to generate the given variable name with {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)}. + * <p> + * e.g.<br> + * If the variable is a {@link #VK_LOCAL} and the variable name is <code>variableName</code> then the base name will be <code>variableName</code>.<br> + * If the variable is a {@link #VK_STATIC_FINAL_FIELD} and the variable name is <code>VARIABLE_NAME</code> then the base name will be <code>variableName</code>.<br> + * </p> + * <p> + * Prefixes and suffixes defined in JavaCore options will be also removed from the variable name.<br> + * Each variable kind is affected by the following JavaCore options: + * <ul> + * <li>{@link #VK_PARAMETER}: {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} and {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES}</li> + * <li>{@link #VK_LOCAL}: {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}</li> + * <li>{@link #VK_INSTANCE_FIELD}: {@link JavaCore#CODEASSIST_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_FIELD_SUFFIXES}</li> + * <li>{@link #VK_STATIC_FIELD}: {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES}</li> + * <li>{@link #VK_STATIC_FINAL_FIELD}: {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES}</li> + * </ul> + * </p> + * <p> + * e.g.<br> + * If the variable is a {@link #VK_LOCAL}, the variable name is <code>preVariableNamesuf</code>, a possible prefix is <code>pre</code> and a possible suffix is <code>suf</code> + * then the base name will be <code>variableName</code>.<br> + * </p> + * + * @param variableKind specifies what type the variable is: {@link #VK_LOCAL}, {@link #VK_PARAMETER}, {@link #VK_STATIC_FIELD}, + * {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FINAL_FIELD}. + * @param variableName a variable name + * @param javaProject project which contains the variable or <code>null</code> to take into account only workspace settings. + * + * @see #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean) + * @since 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + * Suggest names for an argument. The name is computed from argument's type + * and possible prefixes or suffixes are added. + * <p> + * If the type of the argument is <code>TypeName</code>, the prefix for argument is <code>pre</code> + * and the suffix for argument is <code>suf</code> then the proposed names are <code>preTypeNamesuf</code> + * and <code>preNamesuf</code>. If there is no prefix or suffix the proposals are <code>typeName</code> + * and <code>name</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} and + * {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES}. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param javaProject project which contains the argument. + * @param packageName package of the argument's type. + * @param qualifiedTypeName argument's type. + * @param dim argument's dimension (0 if the argument is not an array). + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be <code>null</code> if there is no excluded names. + * @return char[][] an array of names. + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * + * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead with {@link #VK_PARAMETER} as variable kind. + + + + + + + + + + + + + + + + + + + + + + + + + * Suggest names for an argument. The name is computed from argument's type + * and possible prefixes or suffixes are added. + * <p> + * If the type of the argument is <code>TypeName</code>, the prefix for argument is <code>pre</code> + * and the suffix for argument is <code>suf</code> then the proposed names are <code>preTypeNamesuf</code> + * and <code>preNamesuf</code>. If there is no prefix or suffix the proposals are <code>typeName</code> + * and <code>name</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} and + * {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES}. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param javaProject project which contains the argument. + * @param packageName package of the argument's type. + * @param qualifiedTypeName argument's type. + * @param dim argument's dimension (0 if the argument is not an array). + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be <code>null</code> if there is no excluded names. + * @return char[][] an array of names. + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * + * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead with {@link #VK_PARAMETER} as variable kind. + + + + + + + + + + + + + + + + + + + * Suggest names for a field. The name is computed from field's type + * and possible prefixes or suffixes are added. + * <p> + * If the type of the field is <code>TypeName</code>, the prefix for field is <code>pre</code> + * and the suffix for field is <code>suf</code> then the proposed names are <code>preTypeNamesuf</code> + * and <code>preNamesuf</code>. If there is no prefix or suffix the proposals are <code>typeName</code> + * and <code>name</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} and for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param javaProject project which contains the field. + * @param packageName package of the field's type. + * @param qualifiedTypeName field's type. + * @param dim field's dimension (0 if the field is not an array). + * @param modifiers field's modifiers as defined by the class + * <code>Flags</code>. + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be <code>null</code> if there is no excluded names. + * @return char[][] an array of names. + * @see Flags + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * + * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead + * with {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FIELD} as variable kind. + + + + + + + + + + + + + + + + + + + + + + + + + + * Suggest names for a field. The name is computed from field's type + * and possible prefixes or suffixes are added. + * <p> + * If the type of the field is <code>TypeName</code>, the prefix for field is <code>pre</code> + * and the suffix for field is <code>suf</code> then the proposed names are <code>preTypeNamesuf</code> + * and <code>preNamesuf</code>. If there is no prefix or suffix the proposals are <code>typeName</code> + * and <code>name</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} and for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param javaProject project which contains the field. + * @param packageName package of the field's type. + * @param qualifiedTypeName field's type. + * @param dim field's dimension (0 if the field is not an array). + * @param modifiers field's modifiers as defined by the class + * <code>Flags</code>. + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be <code>null</code> if there is no excluded names. + * @return char[][] an array of names. + * @see Flags + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * + * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead + * with {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FIELD} as variable kind. + + + + + + + + + + + + + + + + + + + + * Suggest name for a getter method. The name is computed from field's name + * and possible prefixes or suffixes are removed. + * <p> + * If the field name is <code>preFieldNamesuf</code> and the prefix for field is <code>pre</code> and + * the suffix for field is <code>suf</code> then the prosposed name is <code>isFieldName</code> for boolean field or + * <code>getFieldName</code> for others. If there is no prefix and suffix the proposal is <code>isPreFieldNamesuf</code> + * for boolean field or <code>getPreFieldNamesuf</code> for others. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param project project which contains the field. + * @param fieldName field's name's. + * @param modifiers field's modifiers as defined by the class + * <code>Flags</code>. + * @param isBoolean <code>true</code> if the field's type is boolean + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be <code>null</code> if there is no excluded names. + * @return char[] a name. + * @see Flags + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + + + + + + + + + + + + + + + + + + + + + + * Suggest name for a getter method. The name is computed from field's name + * and possible prefixes or suffixes are removed. + * <p> + * If the field name is <code>preFieldNamesuf</code> and the prefix for field is <code>pre</code> and + * the suffix for field is <code>suf</code> then the prosposed name is <code>isFieldName</code> for boolean field or + * <code>getFieldName</code> for others. If there is no prefix and suffix the proposal is <code>isPreFieldNamesuf</code> + * for boolean field or <code>getPreFieldNamesuf</code> for others. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param project project which contains the field. + * @param fieldName field's name's. + * @param modifiers field's modifiers as defined by the class + * <code>Flags</code>. + * @param isBoolean <code>true</code> if the field's type is boolean + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be <code>null</code> if there is no excluded names. + * @return char[] a name. + * @see Flags + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + + + + + + + + + + + + + + + + * Suggest names for a local variable. The name is computed from variable's type + * and possible prefixes or suffixes are added. + * <p> + * If the type of the local variable is <code>TypeName</code>, the prefix for local variable is <code>pre</code> + * and the suffix for local variable is <code>suf</code> then the proposed names are <code>preTypeNamesuf</code> + * and <code>preNamesuf</code>. If there is no prefix or suffix the proposals are <code>typeName</code> + * and <code>name</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and + * {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param javaProject project which contains the variable. + * @param packageName package of the variable's type. + * @param qualifiedTypeName variable's type. + * @param dim variable's dimension (0 if the variable is not an array). + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be <code>null</code> if there is no excluded names. + * @return char[][] an array of names. + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * + * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead with {@link #VK_LOCAL} as variable kind. + + + + + + + + + + + + + + + + + + + + + + + + + * Suggest names for a local variable. The name is computed from variable's type + * and possible prefixes or suffixes are added. + * <p> + * If the type of the local variable is <code>TypeName</code>, the prefix for local variable is <code>pre</code> + * and the suffix for local variable is <code>suf</code> then the proposed names are <code>preTypeNamesuf</code> + * and <code>preNamesuf</code>. If there is no prefix or suffix the proposals are <code>typeName</code> + * and <code>name</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and + * {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param javaProject project which contains the variable. + * @param packageName package of the variable's type. + * @param qualifiedTypeName variable's type. + * @param dim variable's dimension (0 if the variable is not an array). + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be <code>null</code> if there is no excluded names. + * @return char[][] an array of names. + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * + * @deprecated Use {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)} instead with {@link #VK_LOCAL} as variable kind. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Suggest name for a setter method. The name is computed from field's name + * and possible prefixes or suffixes are removed. + * <p> + * If the field name is <code>preFieldNamesuf</code> and the prefix for field is <code>pre</code> and + * the suffix for field is <code>suf</code> then the proposed name is <code>setFieldName</code>. + * If there is no prefix and suffix the proposal is <code>setPreFieldNamesuf</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param project project which contains the field. + * @param fieldName field's name's. + * @param modifiers field's modifiers as defined by the class + * <code>Flags</code>. + * @param isBoolean <code>true</code> if the field's type is boolean + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be <code>null</code> if there is no excluded names. + * @return char[] a name. + * @see Flags + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + + + + + + + + + + + + + + + + + + + + + + * Suggest name for a setter method. The name is computed from field's name + * and possible prefixes or suffixes are removed. + * <p> + * If the field name is <code>preFieldNamesuf</code> and the prefix for field is <code>pre</code> and + * the suffix for field is <code>suf</code> then the proposed name is <code>setFieldName</code>. + * If there is no prefix and suffix the proposal is <code>setPreFieldNamesuf</code>. + * </p> + * <p> + * This method is affected by the following JavaCore options : {@link JavaCore#CODEASSIST_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} for instance field and {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES}, + * {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} for static field. + * </p> + * <p> + * For a complete description of these configurable options, see <code>getDefaultOptions</code>. + * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. + * </p> + * + * @param project project which contains the field. + * @param fieldName field's name's. + * @param modifiers field's modifiers as defined by the class + * <code>Flags</code>. + * @param isBoolean <code>true</code> if the field's type is boolean + * @param excludedNames a list of names which cannot be suggested (already used names). + * Can be <code>null</code> if there is no excluded names. + * @return char[] a name. + * @see Flags + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + + + + + + + + + + + + + + + + * Suggests names for a variable. The name is computed from a base name and possible prefixes or suffixes are added. + * + * <p> + * The base name is used to compute the variable name. + * Some different kinds of base names are possible and each kind is associated to a different heuristic to compute variable names.<br> + * The heuristic depends also on the kind of the variable. Each kind of variable is identified by a constant starting with <code>VK_</code>.<br> + * When a prefix and a suffix can be added then all combinations of prefix and suffix are suggested. + * If the name is <code>name</code>, the prefix is <code>pre</code> and the suffix is <code>suf</code> then the suggested names will be + * <code>prenamesuf</code>, <code>prename</code>, <code>namesuf</code> and <code>name</code>.<br> + * <br> + * The different kinds of base names are: + * <ul> + * <li>{@link #BK_NAME}: the base name is a Java name and the whole base name is considered to compute the variable names. A prefix and a suffix can be added.<br> + * There is a heuristic by variable kind. + * <ul> + * <li>{@link #VK_PARAMETER}, {@link #VK_LOCAL}, {@link #VK_INSTANCE_FIELD} and {@link #VK_STATIC_FIELD}:<br> + * In this case the first word will be converted to lower case and the other characters won't be changed.<br> + * If the base name is <code>SimpleName</code> then the suggested name will be <code>simpleName</code>.<br></li> + * <li>{@link #VK_STATIC_FINAL_FIELD} :<br> + * In this case all letters of the name will be converted to upper case and words will be separated by an underscore (<code>"_"</code>).<br> + * If the base name is <code>SimpleName</code> then the suggested name will be <code>SIMPLE_NAME</code>.</li> + * </ul></li> + * <li>{@link #BK_TYPE_NAME}: the base name is a Java simple type name (e.g. <code>HashMap</code>) and all the words of the base name are considered to compute the variable names. A prefix and a suffix can be added to these names.<br> + * There is a heuristic by variable kind. + * <ul> + * <li>{@link #VK_PARAMETER}, {@link #VK_LOCAL}, {@link #VK_INSTANCE_FIELD} and {@link #VK_STATIC_FIELD}:<br> + * In this case a variable name will contain some words of the base name and the first word will be converted to lower case.<br> + * If the type is <code>TypeName</code> then the suggested names will be <code>typeName</code> and <code>name</code>.</li> + * <li>{@link #VK_STATIC_FINAL_FIELD} :<br> + * In this case a variable name will contain some words of the base name, all letters of the name will be converted to upper case and segments will be separated by a underscore (<code>"_"</code>).<br> + * If the base name is <code>TypeName</code> then the suggested name will be <code>TYPE_NAME</code> and <code>NAME</code>.</li> + * </ul></li> + * </ul> + * Some other kinds could be added in the future. + * </p> + * <p> + * Each variable kind is affected by the following JavaCore options: + * <ul> + * <li>{@link #VK_PARAMETER}: {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} and {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES}</li> + * <li>{@link #VK_LOCAL}: {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}</li> + * <li>{@link #VK_INSTANCE_FIELD}: {@link JavaCore#CODEASSIST_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_FIELD_SUFFIXES}</li> + * <li>{@link #VK_STATIC_FIELD}: {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES}</li> + * <li>{@link #VK_STATIC_FINAL_FIELD}: {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES}</li> + * </ul> + * </p> + * <p> + * For a complete description of these configurable options, see {@link JavaCore#getDefaultOptions()}. + * To programmatically change these options, see {@link JavaCore#setOptions(java.util.Hashtable)} and {@link IJavaProject#setOptions(java.util.Map)} + * </p> + * <p> + * Proposed names are sorted by relevance (best proposal first).<br> + * The names are proposed in the following order: + * <ol> + * <li>Names with prefix and suffix. Longer names are proposed first</li> + * <li>Names with prefix. Longer names are proposed first</li> + * <li>Names with suffix. Longer names are proposed first</li> + * <li>Names without prefix and suffix. Longer names are proposed first</li> + * </ol> + * </p> + * + * @param variableKind specifies what type the variable is: {@link #VK_LOCAL}, {@link #VK_PARAMETER}, {@link #VK_STATIC_FIELD}, + * {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FINAL_FIELD}. + * @param baseNameKind specifies what type the base name is: {@link #BK_NAME} or {@link #BK_TYPE_NAME} + * @param baseName name used to compute the suggested names. + * @param javaProject project which contains the variable or <code>null</code> to take into account only workspace settings. + * @param dim variable dimension (0 if the field is not an array). + * @param excluded a list of names which cannot be suggested (already used names). + * Can be <code>null</code> if there are no excluded names. + * @param evaluateDefault if <code>true</code>, the result is guaranteed to contain at least one result. If <code>false</code>, the result can be an empty array. + * @return String[] an array of names. + * @see JavaCore#setOptions(java.util.Hashtable) + * @see JavaCore#getDefaultOptions() + * + * @since 3.5 + + + + + + + + + + + + + + + + + + + + + + * Provides methods for encoding and decoding type and method signature strings. + * <p> + * Signatures obtained from parsing source files (i.e. files with one of the + * {@link JavaCore#getJavaLikeExtensions() Java-like extensions}) differ subtly + * from ones obtained from pre-compiled binary (".class") files in class names are + * usually left unresolved in the former. For example, the normal resolved form + * of the type "String" embeds the class's package name ("Ljava.lang.String;" + * or "Ljava/lang/String;"), whereas the unresolved form contains only what is + * written "QString;". + * </p> + * <p> + * Generic types introduce to the Java language in J2SE 1.5 add three new + * facets to signatures: type variables, parameterized types with type arguments, + * and formal type parameters. <i>Rich</i> signatures containing these facets + * only occur when dealing with code that makes overt use of the new language + * features. All other code, and certainly all Java code written or compiled + * with J2SE 1.4 or earlier, involved only <i>simple</i> signatures. + * </p> + * <p> + * Note that the "Q" and "!" formats are specific to Eclipse; the remainder + * are specified in the JVM spec. + * </p> + * <p> + * The syntax for a type signature is: + * <pre> + * TypeSignature ::= + * "B" // byte + * | "C" // char + * | "D" // double + * | "F" // float + * | "I" // int + * | "J" // long + * | "S" // short + * | "V" // void + * | "Z" // boolean + * | "T" + Identifier + ";" // type variable + * | "[" + TypeSignature // array X[] + * | "!" + TypeSignature // capture-of ? + * | ResolvedClassTypeSignature + * | UnresolvedClassTypeSignature + * + * ResolvedClassTypeSignature ::= // resolved named type (in compiled code) + * "L" + Identifier + OptionalTypeArguments + * ( ( "." | "/" ) + Identifier + OptionalTypeArguments )* + ";" + * | OptionalTypeParameters + "L" + Identifier + + * ( ( "." | "/" ) + Identifier )* + ";" + * + * UnresolvedClassTypeSignature ::= // unresolved named type (in source code) + * "Q" + Identifier + OptionalTypeArguments + * ( ( "." | "/" ) + Identifier + OptionalTypeArguments )* + ";" + * | OptionalTypeParameters "Q" + Identifier + + * ( ( "." | "/" ) + Identifier )* + ";" + * + * OptionalTypeArguments ::= + * "&lt;" + TypeArgument+ + "&gt;" + * | + * + * TypeArgument ::= + * | TypeSignature + * | "*" // wildcard ? + * | "+" TypeSignature // wildcard ? extends X + * | "-" TypeSignature // wildcard ? super X + * + * OptionalTypeParameters ::= + * "&lt;" + FormalTypeParameterSignature+ + "&gt;" + * | + * </pre> + * </p> + * <p> + * Examples: + * <ul> + * <li><code>"[[I"</code> denotes <code>int[][]</code></li> + * <li><code>"Ljava.lang.String;"</code> denotes <code>java.lang.String</code> in compiled code</li> + * <li><code>"QString;"</code> denotes <code>String</code> in source code</li> + * <li><code>"Qjava.lang.String;"</code> denotes <code>java.lang.String</code> in source code</li> + * <li><code>"[QString;"</code> denotes <code>String[]</code> in source code</li> + * <li><code>"QMap&lt;QString;*&gt;;"</code> denotes <code>Map&lt;String,?&gt;</code> in source code</li> + * <li><code>"Qjava.util.List&ltTV;&gt;;"</code> denotes <code>java.util.List&lt;V&gt;</code> in source code</li> + * <li><code>"&ltE;&gt;Ljava.util.List;"</code> denotes <code>&lt;E&gt;java.util.List</code> in source code</li> + * </ul> + * </p> + * <p> + * The syntax for a method signature is: + * <pre> + * MethodSignature ::= OptionalTypeParameters + "(" + ParamTypeSignature* + ")" + ReturnTypeSignature + * ParamTypeSignature ::= TypeSignature + * ReturnTypeSignature ::= TypeSignature + * </pre> + * <p> + * Examples: + * <ul> + * <li><code>"()I"</code> denotes <code>int foo()</code></li> + * <li><code>"([Ljava.lang.String;)V"</code> denotes <code>void foo(java.lang.String[])</code> in compiled code</li> + * <li><code>"(QString;)QObject;"</code> denotes <code>Object foo(String)</code> in source code</li> + * </ul> + * </p> + * <p> + * The syntax for a formal type parameter signature is: + * <pre> + * FormalTypeParameterSignature ::= + * TypeVariableName + OptionalClassBound + InterfaceBound* + * TypeVariableName ::= Identifier + * OptionalClassBound ::= + * ":" + * | ":" + TypeSignature + * InterfaceBound ::= + * ":" + TypeSignature + * </pre> + * <p> + * Examples: + * <ul> + * <li><code>"X:"</code> denotes <code>X</code></li> + * <li><code>"X:QReader;"</code> denotes <code>X extends Reader</code> in source code</li> + * <li><code>"X:QReader;:QSerializable;"</code> denotes <code>X extends Reader & Serializable</code> in source code</li> + * </ul> + * </p> + * <p> + * This class provides static methods and constants only. + * </p> + * <p>Note: An empty signature is considered to be syntactically incorrect. So most methods will throw + * an IllegalArgumentException if an empty signature is provided.</p> + * + * @noinstantiate This class is not intended to be instantiated by clients. + + + + + + * Character constant indicating the primitive type boolean in a signature. + * Value is <code>'Z'</code>. + + + + + + + * Character constant indicating the primitive type byte in a signature. + * Value is <code>'B'</code>. + + + + + + + * Character constant indicating the primitive type char in a signature. + * Value is <code>'C'</code>. + + + + + + + * Character constant indicating the primitive type double in a signature. + * Value is <code>'D'</code>. + + + + + + + * Character constant indicating the primitive type float in a signature. + * Value is <code>'F'</code>. + + + + + + + * Character constant indicating the primitive type int in a signature. + * Value is <code>'I'</code>. + + + + + + + * Character constant indicating the semicolon in a signature. + * Value is <code>';'</code>. + + + + + + + * Character constant indicating the colon in a signature. + * Value is <code>':'</code>. + * @since 3.0 + + + + + + + * Character constant indicating the primitive type long in a signature. + * Value is <code>'J'</code>. + + + + + + + * Character constant indicating the primitive type short in a signature. + * Value is <code>'S'</code>. + + + + + + + * Character constant indicating result type void in a signature. + * Value is <code>'V'</code>. + + + + + + + * Character constant indicating the start of a resolved type variable in a + * signature. Value is <code>'T'</code>. + * @since 3.0 + + + + + + + * Character constant indicating an unbound wildcard type argument + * in a signature. + * Value is <code>'*'</code>. + * @since 3.0 + + + + + + + * Character constant indicating an exception in a signature. + * Value is <code>'^'</code>. + * @since 3.1 + + + + + + + * Character constant indicating a bound wildcard type argument + * in a signature with extends clause. + * Value is <code>'+'</code>. + * @since 3.1 + + + + + + + * Character constant indicating a bound wildcard type argument + * in a signature with super clause. + * Value is <code>'-'</code>. + * @since 3.1 + + + + + + + * Character constant indicating the dot in a signature. + * Value is <code>'.'</code>. + + + + + + + * Character constant indicating the dollar in a signature. + * Value is <code>'$'</code>. + + + + + + + * Character constant indicating an array type in a signature. + * Value is <code>'['</code>. + + + + + + + * Character constant indicating the start of a resolved, named type in a + * signature. Value is <code>'L'</code>. + + + + + + + * Character constant indicating the start of an unresolved, named type in a + * signature. Value is <code>'Q'</code>. + + + + + + + * Character constant indicating the end of a named type in a signature. + * Value is <code>';'</code>. + + + + + + + * Character constant indicating the start of a parameter type list in a + * signature. Value is <code>'('</code>. + + + + + + + * Character constant indicating the end of a parameter type list in a + * signature. Value is <code>')'</code>. + + + + + + + * Character constant indicating the start of a formal type parameter + * (or type argument) list in a signature. Value is <code>'&lt;'</code>. + * @since 3.0 + + + + + + + * Character constant indicating the end of a generic type list in a + * signature. Value is <code>'&gt;'</code>. + * @since 3.0 + + + + + + + * Character constant indicating a capture of a wildcard type in a + * signature. Value is <code>'!'</code>. + * @since 3.1 + + + + + + + * String constant for the signature of the primitive type boolean. + * Value is <code>"Z"</code>. + + + + + + + * String constant for the signature of the primitive type byte. + * Value is <code>"B"</code>. + + + + + + + * String constant for the signature of the primitive type char. + * Value is <code>"C"</code>. + + + + + + + * String constant for the signature of the primitive type double. + * Value is <code>"D"</code>. + + + + + + + * String constant for the signature of the primitive type float. + * Value is <code>"F"</code>. + + + + + + + * String constant for the signature of the primitive type int. + * Value is <code>"I"</code>. + + + + + + + * String constant for the signature of the primitive type long. + * Value is <code>"J"</code>. + + + + + + + * String constant for the signature of the primitive type short. + * Value is <code>"S"</code>. + + + + + + String constant for the signature of result type void. + * Value is <code>"V"</code>. + + + + + + + * Kind constant for a class type signature. + * @see #getTypeSignatureKind(String) + * @since 3.0 + + + + + + + * Kind constant for a base (primitive or void) type signature. + * @see #getTypeSignatureKind(String) + * @since 3.0 + + + + + + + * Kind constant for a type variable signature. + * @see #getTypeSignatureKind(String) + * @since 3.0 + + + + + + + * Kind constant for an array type signature. + * @see #getTypeSignatureKind(String) + * @since 3.0 + + + + + + + * Kind constant for a wildcard type signature. + * @see #getTypeSignatureKind(String) + * @since 3.1 + + + + + + + * Kind constant for the capture of a wildcard type signature. + * @see #getTypeSignatureKind(String) + * @since 3.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Creates a new type signature with the given amount of array nesting added + * to the given type signature. + * + * @param typeSignature the type signature + * @param arrayCount the desired number of levels of array nesting + * @return the encoded array type signature + * + * @since 2.0 + + + + + + + + + + + + + + + + * Creates a new type signature with the given amount of array nesting added + * to the given type signature. + * + * @param typeSignature the type signature + * @param arrayCount the desired number of levels of array nesting + * @return the encoded array type signature + + + + + + + + + + * Creates a method signature from the given parameter and return type + * signatures. The encoded method signature is dot-based. + * + * @param parameterTypes the list of parameter type signatures + * @param returnType the return type signature + * @return the encoded method signature + * + * @since 2.0 + + + + + + + + + + + + + + + + + + + * Creates a method signature from the given parameter and return type + * signatures. The encoded method signature is dot-based. This method + * is equivalent to + * <code>createMethodSignature(parameterTypes, returnType)</code>. + * + * @param parameterTypes the list of parameter type signatures + * @param returnType the return type signature + * @return the encoded method signature + * @see Signature#createMethodSignature(char[][], char[]) + + + + + + + + + + + + + * Creates a new type parameter signature with the given name and bounds. + * + * @param typeParameterName the type parameter name + * @param boundSignatures the signatures of associated bounds or empty array if none + * @return the encoded type parameter signature + * + * @since 3.1 + + + + + + + + + + + + + + + + + + + * Creates a new type parameter signature with the given name and bounds. + * + * @param typeParameterName the type parameter name + * @param boundSignatures the signatures of associated bounds or empty array if none + * @return the encoded type parameter signature + * + * @since 3.1 + + + + + + + + + + + + + * Creates a new type signature from the given type name encoded as a character + * array. The type name may contain primitive types, array types or parameterized types. + * This method is equivalent to + * <code>createTypeSignature(new String(typeName),isResolved)</code>, although + * more efficient for callers with character arrays rather than strings. If the + * type name is qualified, then it is expected to be dot-based. + * + * @param typeName the possibly qualified type name + * @param isResolved <code>true</code> if the type name is to be considered + * resolved (for example, a type name from a binary class file), and + * <code>false</code> if the type name is to be considered unresolved + * (for example, a type name found in source code) + * @return the encoded type signature + * @see #createTypeSignature(java.lang.String,boolean) + + + + + + + + + + + + + * Creates a new type signature from the given type name encoded as a character + * array. The type name may contain primitive types or array types or parameterized types. + * This method is equivalent to + * <code>createTypeSignature(new String(typeName),isResolved).toCharArray()</code>, + * although more efficient for callers with character arrays rather than strings. + * If the type name is qualified, then it is expected to be dot-based. + * + * @param typeName the possibly qualified type name + * @param isResolved <code>true</code> if the type name is to be considered + * resolved (for example, a type name from a binary class file), and + * <code>false</code> if the type name is to be considered unresolved + * (for example, a type name found in source code) + * @return the encoded type signature + * @see #createTypeSignature(java.lang.String,boolean) + * + * @since 2.0 + + + + + + + + + + + + + + + + + + + + + + + + + + * A source range defines an element's source coordinates relative to + * its source buffer. + * + * @see ISourceRange + * @since 3.6 + + + + + + + + + * Helper method that answers whether a valid source range is available + * in the given ISourceRange. When an element has no associated source + * code, Java Model APIs may return either <code>null</code> or a range of + * [-1, 0] to indicate an invalid range. This utility method can be used + * to detect that case. + * + * @param range a source range, can be <code>null</code> + * @return <code>true</code> iff range is not null and range.getOffset() is not -1 + + + + + + + + + + + + + * @see ISourceRange + + + + + + + + * @see ISourceRange + + + + + + + + + + + + + + + * Factory for creating various compiler tools, such as scanners, parsers and compilers. + * <p> + * This class provides static methods only. + * </p> + * + * @since 2.0 + * @noinstantiate This class is not intended to be instantiated by clients. + * @noextend This class is not intended to be subclassed by clients. + + + + + + * This mode is used for formatting new code when some formatter options should not be used. + * In particular, options that preserve the indentation of comments are not used. + * In the future, newly added options may be ignored as well. + * <p>Clients that are formatting new code are recommended to use this mode. + * </p> + * + * @see DefaultCodeFormatterConstants#FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN + * @see DefaultCodeFormatterConstants#FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN + * @see #createCodeFormatter(Map, int) + * @since 3.3 + + + + + + + * This mode is used for formatting existing code when all formatter options should be used. + * In particular, options that preserve the indentation of comments are used. + * <p>Clients that are formatting existing code are recommended to use this mode. + * </p> + * + * @see DefaultCodeFormatterConstants#FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN + * @see DefaultCodeFormatterConstants#FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN + * @see #createCodeFormatter(Map, int) + * @since 3.3 + + + + + + + * Create an instance of a code formatter. A code formatter implementation can be contributed via the + * extension point "org.eclipse.jdt.core.codeFormatter". If unable to find a registered extension, the factory + * will default to using the default code formatter. + * + * @return an instance of a code formatter + * @see ICodeFormatter + * @see ToolFactory#createDefaultCodeFormatter(Map) + * @deprecated The extension point has been deprecated, use {@link #createCodeFormatter(Map)} instead. + + + + + + + + * Create an instance of the built-in code formatter. + * <p>The given options should at least provide the source level ({@link JavaCore#COMPILER_SOURCE}), + * the compiler compliance level ({@link JavaCore#COMPILER_COMPLIANCE}) and the target platform + * ({@link JavaCore#COMPILER_CODEGEN_TARGET_PLATFORM}). + * Without these options, it is not possible for the code formatter to know what kind of source it needs to format. + * </p><p> + * Note this is equivalent to <code>createCodeFormatter(options, M_FORMAT_NEW)</code>. Thus some code formatter options + * may be ignored. See @{link {@link #M_FORMAT_NEW} for more details. + * </p> + * @param options - the options map to use for formatting with the default code formatter. Recognized options + * are documented on <code>JavaCore#getDefaultOptions()</code>. If set to <code>null</code>, then use + * the current settings from <code>JavaCore#getOptions</code>. + * @return an instance of the built-in code formatter + * @see CodeFormatter + * @see JavaCore#getOptions() + * @since 3.0 + + + + + + + + + * Create an instance of the built-in code formatter. + * <p>The given options should at least provide the source level ({@link JavaCore#COMPILER_SOURCE}), + * the compiler compliance level ({@link JavaCore#COMPILER_COMPLIANCE}) and the target platform + * ({@link JavaCore#COMPILER_CODEGEN_TARGET_PLATFORM}). + * Without these options, it is not possible for the code formatter to know what kind of source it needs to format. + * </p> + * <p>The given mode determines what options should be enabled when formatting the code. It can have the following + * values: {@link #M_FORMAT_NEW}, {@link #M_FORMAT_EXISTING}, but other values may be added in the future. + * </p> + * + * @param options the options map to use for formatting with the default code formatter. Recognized options + * are documented on <code>JavaCore#getDefaultOptions()</code>. If set to <code>null</code>, then use + * the current settings from <code>JavaCore#getOptions</code>. + * @param mode the given mode to modify the given options. + * + * @return an instance of the built-in code formatter + * @see CodeFormatter + * @see JavaCore#getOptions() + * @since 3.3 + + + + + + + + + + * Create a classfile bytecode disassembler, able to produce a String representation of a given classfile. + * + * @return a classfile bytecode disassembler + * @see ClassFileBytesDisassembler + * @since 2.1 + + + + + + + + * Create a classfile bytecode disassembler, able to produce a String representation of a given classfile. + * + * @return a classfile bytecode disassembler + * @see org.eclipse.jdt.core.util.IClassFileDisassembler + * @deprecated Use {@link #createDefaultClassFileBytesDisassembler()} instead + + + + + + + + * Create a classfile reader onto a classfile Java element. + * Create a default classfile reader, able to expose the internal representation of a given classfile + * according to the decoding flag used to initialize the reader. + * Answer null if the file named fileName doesn't represent a valid .class file. + * + * The decoding flags are described in IClassFileReader. + * + * @param classfile the classfile element to introspect + * @param decodingFlag the flag used to decode the class file reader. + * @return a default classfile reader + * + * @see IClassFileReader + + + + + + + + + + * Create a default classfile reader, able to expose the internal representation of a given classfile + * according to the decoding flag used to initialize the reader. + * Answer null if the input stream contents cannot be retrieved + * + * The decoding flags are described in IClassFileReader. + * + * @param stream the given input stream to read + * @param decodingFlag the flag used to decode the class file reader. + * @return a default classfile reader + * + * @see IClassFileReader + * @since 3.2 + + + + + + + + + + * Create a default classfile reader, able to expose the internal representation of a given classfile + * according to the decoding flag used to initialize the reader. + * Answer null if the file named fileName doesn't represent a valid .class file. + * The fileName has to be an absolute OS path to the given .class file. + * + * The decoding flags are described in IClassFileReader. + * + * @param fileName the name of the file to be read + * @param decodingFlag the flag used to decode the class file reader. + * @return a default classfile reader + * + * @see IClassFileReader + + + + + + + + + + * Create a default classfile reader, able to expose the internal representation of a given classfile + * according to the decoding flag used to initialize the reader. + * Answer null if the file named zipFileName doesn't represent a valid zip file or if the zipEntryName + * is not a valid entry name for the specified zip file or if the bytes don't represent a valid + * .class file according to the JVM specifications. + * + * The decoding flags are described in IClassFileReader. + * + * @param zipFileName the name of the zip file + * @param zipEntryName the name of the entry in the zip file to be read + * @param decodingFlag the flag used to decode the class file reader. + * @return a default classfile reader + * @see IClassFileReader + + + + + + + + + + + * Create an instance of the default code formatter. + * + * @param options - the options map to use for formatting with the default code formatter. Recognized options + * are documented on <code>JavaCore#getDefaultOptions()</code>. If set to <code>null</code>, then use + * the current settings from <code>JavaCore#getOptions</code>. + * @return an instance of the built-in code formatter + * @see ICodeFormatter + * @see ToolFactory#createCodeFormatter() + * @see JavaCore#getOptions() + * @deprecated Use {@link #createCodeFormatter(Map)} instead but note the different options + + + + + + + + + * Create a scanner, indicating the level of detail requested for tokenizing. The scanner can then be + * used to tokenize some source in a Java aware way. + * Here is a typical scanning loop: + * + * <code> + * <pre> + * IScanner scanner = ToolFactory.createScanner(false, false, false, false); + * scanner.setSource("int i = 0;".toCharArray()); + * while (true) { + * int token = scanner.getNextToken(); + * if (token == ITerminalSymbols.TokenNameEOF) break; + * System.out.println(token + " : " + new String(scanner.getCurrentTokenSource())); + * } + * </pre> + * </code> + * + * <p>By default the compliance used to create the scanner is the workspace's compliance when running inside the IDE + * or 1.4 if running from outside of a headless eclipse. + * </p> + * + * @param tokenizeComments if set to <code>false</code>, comments will be silently consumed + * @param tokenizeWhiteSpace if set to <code>false</code>, white spaces will be silently consumed, + * @param assertMode if set to <code>false</code>, occurrences of 'assert' will be reported as identifiers + * ({@link ITerminalSymbols#TokenNameIdentifier}), whereas if set to <code>true</code>, it + * would report assert keywords ({@link ITerminalSymbols#TokenNameassert}). Java 1.4 has introduced + * a new 'assert' keyword. + * @param recordLineSeparator if set to <code>true</code>, the scanner will record positions of encountered line + * separator ends. In case of multi-character line separators, the last character position is considered. These positions + * can then be extracted using {@link IScanner#getLineEnds()}. Only non-unicode escape sequences are + * considered as valid line separators. + * @return a scanner + * @see org.eclipse.jdt.core.compiler.IScanner + * @see #createScanner(boolean, boolean, boolean, String, String) + + + + + + + + + + + + * Create a scanner, indicating the level of detail requested for tokenizing. The scanner can then be + * used to tokenize some source in a Java aware way. + * Here is a typical scanning loop: + * + * <code> + * <pre> + * IScanner scanner = ToolFactory.createScanner(false, false, false, false); + * scanner.setSource("int i = 0;".toCharArray()); + * while (true) { + * int token = scanner.getNextToken(); + * if (token == ITerminalSymbols.TokenNameEOF) break; + * System.out.println(token + " : " + new String(scanner.getCurrentTokenSource())); + * } + * </pre> + * </code> + * + * <p>By default the compliance used to create the scanner is the workspace's compliance when running inside the IDE + * or 1.4 if running from outside of a headless eclipse. + * </p> + * + * @param tokenizeComments if set to <code>false</code>, comments will be silently consumed + * @param tokenizeWhiteSpace if set to <code>false</code>, white spaces will be silently consumed, + * @param recordLineSeparator if set to <code>true</code>, the scanner will record positions of encountered line + * separator ends. In case of multi-character line separators, the last character position is considered. These positions + * can then be extracted using {@link IScanner#getLineEnds()}. Only non-unicode escape sequences are + * considered as valid line separators. + * @param sourceLevel if set to <code>&quot;1.3&quot;</code> or <code>null</code>, occurrences of 'assert' will be reported as identifiers + * ({@link ITerminalSymbols#TokenNameIdentifier}), whereas if set to <code>&quot;1.4&quot;</code>, it + * would report assert keywords ({@link ITerminalSymbols#TokenNameassert}). Java 1.4 has introduced + * a new 'assert' keyword. + * @return a scanner + * @see org.eclipse.jdt.core.compiler.IScanner + * @see #createScanner(boolean, boolean, boolean, String, String) + * @since 3.0 + + + + + + + + + + + + * Create a scanner, indicating the level of detail requested for tokenizing. The scanner can then be + * used to tokenize some source in a Java aware way. + * Here is a typical scanning loop: + * + * <code> + * <pre> + * IScanner scanner = ToolFactory.createScanner(false, false, false, false); + * scanner.setSource("int i = 0;".toCharArray()); + * while (true) { + * int token = scanner.getNextToken(); + * if (token == ITerminalSymbols.TokenNameEOF) break; + * System.out.println(token + " : " + new String(scanner.getCurrentTokenSource())); + * } + * </pre> + * </code> + * + * @param tokenizeComments if set to <code>false</code>, comments will be silently consumed + * @param tokenizeWhiteSpace if set to <code>false</code>, white spaces will be silently consumed, + * @param recordLineSeparator if set to <code>true</code>, the scanner will record positions of encountered line + * separator ends. In case of multi-character line separators, the last character position is considered. These positions + * can then be extracted using {@link IScanner#getLineEnds()}. Only non-unicode escape sequences are + * considered as valid line separators. + * @param sourceLevel if set to <code>&quot;1.3&quot;</code> or <code>null</code>, occurrences of 'assert' will be reported as identifiers + * ({@link ITerminalSymbols#TokenNameIdentifier}), whereas if set to <code>&quot;1.4&quot;</code>, it + * would report assert keywords ({@link ITerminalSymbols#TokenNameassert}). Java 1.4 has introduced + * a new 'assert' keyword. + * @param complianceLevel This is used to support the Unicode 4.0 character sets. if set to 1.5 or above, + * the Unicode 4.0 is supporte, otherwise Unicode 3.0 is supported. + * @return a scanner + * @see org.eclipse.jdt.core.compiler.IScanner + * + * @since 3.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * The owner of an {@link ICompilationUnit} handle in working copy mode. + * An owner is used to identify a working copy and to create its buffer. + * <p> + * Clients should subclass this class to instantiate a working copy owner that is specific to their need and that + * they can pass in to various APIs (e.g. {@link IType#resolveType(String, WorkingCopyOwner)}. + * Clients can also override the default implementation of {@link #createBuffer(ICompilationUnit)}. + * </p><p> + * Note: even though this class has no abstract method, which means that it provides functional default behavior, + * it is still an abstract class, as clients are intended to own their owner implementation. + * </p> + * @see ICompilationUnit#becomeWorkingCopy(org.eclipse.core.runtime.IProgressMonitor) + * @see ICompilationUnit#discardWorkingCopy() + * @see ICompilationUnit#getWorkingCopy(org.eclipse.core.runtime.IProgressMonitor) + * @since 3.0 + + + + + + * Sets the buffer provider of the primary working copy owner. Note that even if the + * buffer provider is a working copy owner, only its <code>createBuffer(ICompilationUnit)</code> + * method is used by the primary working copy owner. It doesn't replace the internal primary + * working owner. + * <p> + * This method is for internal use by the jdt-related plug-ins. + * Clients outside of the jdt should not reference this method. + * </p> + * + * @param primaryBufferProvider the primary buffer provider + + + + + + + + * Creates a buffer for the given working copy. + * The new buffer will be initialized with the contents of the underlying file + * if and only if it was not already initialized by the compilation owner (a buffer is + * uninitialized if its content is <code>null</code>). + * <p> + * Note: This buffer will be associated to the working copy for its entire life-cycle. Another + * working copy on same unit but owned by a different owner would not share the same buffer + * unless its owner decided to implement such a sharing behaviour. + * </p> + * + * @param workingCopy the working copy of the buffer + * @return IBuffer the created buffer for the given working copy + * @see IBuffer + + + + + + + + + * Returns the problem requestor used by a working copy of this working copy owner. + * <p> + * By default, no problem requestor is configured. Clients can override this + * method to provide a requestor. + * </p> + * + * @param workingCopy The problem requestor used for the given working copy. + * @return the problem requestor to be used by working copies of this working + * copy owner or <code>null</code> if no problem requestor is configured. + * + * @since 3.3 + + + + + + + + + * Returns the source of the compilation unit that defines the given type in + * the given package, or <code>null</code> if the type is unknown to this + * owner. + * <p>This method is called before the normal lookup (i.e. before looking + * at the project's classpath and before looking at the working copies of this + * owner.)</p> + * <p>This allows to provide types that are not normally available, or to hide + * types that would normally be available by returning an empty source for + * the given type and package.</p> + * <p>Example of use: + * <pre> + * WorkingCopyOwner owner = new WorkingCopyOwner() { + * public String findSource(String typeName, String packageName) { + * if ("to.be".equals(packageName) && "Generated".equals(typeName)) { + * return + * "package to.be;\n" + + * "public class Generated {\n" + + * "}"; + * } + * return super.findSource(typeName, packageName); + * } + * public boolean isPackage(String[] pkg) { + * switch (pkg.length) { + * case 1: + * return "to".equals(pkg[0]); + * case 2: + * return "to".equals(pkg[0]) && "be".equals(pkg[1]); + * } + * return false; + * } + * }; + * // Working copy on X.java with the following contents: + * // public class X extends to.be.Generated { + * // } + * ICompilationUnit workingCopy = ... + * ASTParser parser = ASTParser.newParser(AST.JLS3); + * parser.setSource(workingCopy); + * parser.setResolveBindings(true); + * parser.setWorkingCopyOwner(owner); + * CompilationUnit cu = (CompilationUnit) parser.createAST(null); + * assert cu.getProblems().length == 0; + * </pre> + * </p> + * + * @param typeName the simple name of the type to lookup + * @param packageName the dot-separated name of the package of type + * @return the source of the compilation unit that defines the given type in + * the given package, or <code>null</code> if the type is unknown + * @see #isPackage(String[]) + * @since 3.5 + + + + + + + + + + * Returns whether the given package segments represent a package. + * <p>This method is called before the normal lookup (i.e. before looking + * at the project's classpath and before looking at the working copies of this + * owner.)</p> + * <p>This allows to provide packages that are not normally available.</p> + * <p>If <code>false</code> is returned, then normal lookup is used on + * this package.</p> + * + * @param pkg the segments of a package to lookup + * @return whether the given package segments represent a package. + * @see #findSource(String, String) + * @since 3.5 + + + + + + + + + + + + * Returns a new working copy with the given name using this working copy owner to + * create its buffer. + * <p> + * This working copy always belongs to the default package in a package + * fragment root that corresponds to its Java project, and this Java project never exists. + * However this Java project has the given classpath that is used when resolving names + * in this working copy. + * </p><p> + * A DOM AST created using this working copy will have bindings resolved using the given + * classpath, and problem are reported to the given problem requestor. + * <p></p> + * <code>JavaCore#getOptions()</code> is used to create the DOM AST as it is not + * possible to set the options on the non-existing Java project. + * </p><p> + * When the working copy instance is created, an {@link IJavaElementDelta#ADDED added delta} is + * reported on this working copy. + * </p><p> + * Once done with the working copy, users of this method must discard it using + * {@link ICompilationUnit#discardWorkingCopy()}. + * </p><p> + * Note that when such working copy is committed, only its buffer is saved (see + * {@link IBuffer#save(IProgressMonitor, boolean)}) but no resource is created. + * </p><p> + * This method is not intended to be overriden by clients. + * </p> + * + * @param name the name of the working copy (e.g. "X.java") + * @param classpath the classpath used to resolve names in this working copy + * @param problemRequestor a requestor which will get notified of problems detected during + * reconciling as they are discovered. The requestor can be set to <code>null</code> indicating + * that the client is not interested in problems. + * @param monitor a progress monitor used to report progress while opening the working copy + * or <code>null</code> if no progress should be reported + * @throws JavaModelException if the contents of this working copy can + * not be determined. + * @return a new working copy + * @see ICompilationUnit#becomeWorkingCopy(IProblemRequestor, IProgressMonitor) + * @since 3.2 + * + * @deprecated Use {@link #newWorkingCopy(String, IClasspathEntry[], IProgressMonitor)} instead. + * Note that if this deprecated method is used, problems may be reported twice + * if the given requestor is not the same as the current working copy owner one. + + + + + + + + + + + + + + + * Returns a new working copy with the given name using this working copy owner to + * create its buffer. + * <p> + * This working copy always belongs to the default package in a package + * fragment root that corresponds to its Java project, and this Java project never exists. + * However this Java project has the given classpath that is used when resolving names + * in this working copy. + * </p><p> + * If a DOM AST is created using this working copy, then given classpath will be used + * if bindings need to be resolved. Problems will be reported to the problem requestor + * of the current working copy owner problem if it is not <code>null</code>. + * <p></p> + * Options used to create the DOM AST are got from {@link JavaCore#getOptions()} + * as it is not possible to set the options on a non-existing Java project. + * </p><p> + * When the working copy instance is created, an {@link IJavaElementDelta#ADDED added delta} is + * reported on this working copy. + * </p><p> + * Once done with the working copy, users of this method must discard it using + * {@link ICompilationUnit#discardWorkingCopy()}. + * </p><p> + * Note that when such working copy is committed, only its buffer is saved (see + * {@link IBuffer#save(IProgressMonitor, boolean)}) but no resource is created. + * </p><p> + * This method is not intended to be overriden by clients. + * </p> + * + * @param name the name of the working copy (e.g. "X.java") + * @param classpath the classpath used to resolve names in this working copy + * @param monitor a progress monitor used to report progress while opening the working copy + * or <code>null</code> if no progress should be reported + * @throws JavaModelException if the contents of this working copy can + * not be determined. + * @return a new working copy + * @see ICompilationUnit#becomeWorkingCopy(IProgressMonitor) + * + * @since 3.3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.properties new file mode 100644 index 00000000000..0a19e739f6a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.properties @@ -0,0 +1,19 @@ +################################################################################# +# Copyright (c) 2011 Nicolas Deblock & Manuel Giles. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation +# Manuel Giles giles.manu@live.fr - Initial API and implementation +# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception +# +################################################################################# + + +pluginName = Jdt metamodel (Incubation) +providerName = Eclipse Modeling Project + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.xml new file mode 100644 index 00000000000..1d95f211dfb --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/plugin.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/pom.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/pom.xml new file mode 100644 index 00000000000..8fd67e862bf --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.java.generator.metamodel.jdt + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmFactory.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmFactory.java new file mode 100644 index 00000000000..574aafc167a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmFactory.java @@ -0,0 +1,57 @@ +/***************************************************************************** + * Copyright (c) 2014 Jonathan Geoffroy + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception + * + *****************************************************************************/ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage + * @generated + */ +public interface GeneratoroptionsmmFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * + * @generated + */ + GeneratoroptionsmmFactory eINSTANCE = org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.GeneratoroptionsmmFactoryImpl.init(); + + /** + * Returns a new object of class 'Options'. + * + * + * + * @return a new object of class 'Options'. + * @generated + */ + Options createOptions(); + + /** + * Returns the package supported by this factory. + * + * + * + * @return the package supported by this factory. + * @generated + */ + GeneratoroptionsmmPackage getGeneratoroptionsmmPackage(); + +} // GeneratoroptionsmmFactory diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmPackage.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmPackage.java new file mode 100644 index 00000000000..d67b1c8d5b3 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/GeneratoroptionsmmPackage.java @@ -0,0 +1,187 @@ +/***************************************************************************** + * Copyright (c) 2014 Jonathan Geoffroy + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception + * + *****************************************************************************/ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
      + *
    • each class,
    • + *
    • each feature of each class,
    • + *
    • each operation of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmFactory + * @model kind="package" + * annotation="http://www.eclipse.org/uml2/2.0.0/UML originalName='GeneratorOptionsMM'" + * @generated + */ +public interface GeneratoroptionsmmPackage extends EPackage { + /** + * The package name. + * + * + * + * @generated + */ + String eNAME = "generatoroptionsmm"; + + /** + * The package namespace URI. + * + * + * + * @generated + */ + String eNS_URI = "http:///GeneratorOptionsMM.ecore"; + + /** + * The package namespace name. + * + * + * + * @generated + */ + String eNS_PREFIX = "GeneratorOptionsMM"; + + /** + * The singleton instance of the package. + * + * + * + * @generated + */ + GeneratoroptionsmmPackage eINSTANCE = org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.GeneratoroptionsmmPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.OptionsImpl Options}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.OptionsImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.GeneratoroptionsmmPackageImpl#getOptions() + * @generated + */ + int OPTIONS = 0; + + /** + * The feature id for the 'Default Source Folder' attribute. + * + * + * + * @generated + * @ordered + */ + int OPTIONS__DEFAULT_SOURCE_FOLDER = 0; + + /** + * The number of structural features of the 'Options' class. + * + * + * + * @generated + * @ordered + */ + int OPTIONS_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Options' class. + * + * + * + * @generated + * @ordered + */ + int OPTIONS_OPERATION_COUNT = 0; + + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options Options}'. + * + * + * + * @return the meta object for class 'Options'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options + * @generated + */ + EClass getOptions(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options#getDefaultSourceFolder Default Source Folder}'. + * + * + * + * @return the meta object for the attribute 'Default Source Folder'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options#getDefaultSourceFolder() + * @see #getOptions() + * @generated + */ + EAttribute getOptions_DefaultSourceFolder(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + GeneratoroptionsmmFactory getGeneratoroptionsmmFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
      + *
    • each class,
    • + *
    • each feature of each class,
    • + *
    • each operation of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.OptionsImpl Options}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.OptionsImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.GeneratoroptionsmmPackageImpl#getOptions() + * @generated + */ + EClass OPTIONS = eINSTANCE.getOptions(); + + /** + * The meta object literal for the 'Default Source Folder' attribute feature. + * + * + * + * @generated + */ + EAttribute OPTIONS__DEFAULT_SOURCE_FOLDER = eINSTANCE.getOptions_DefaultSourceFolder(); + + } + +} // GeneratoroptionsmmPackage diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/Options.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/Options.java new file mode 100644 index 00000000000..d2940a2afc6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/Options.java @@ -0,0 +1,63 @@ +/***************************************************************************** + * Copyright (c) 2014 Jonathan Geoffroy + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception + * + *****************************************************************************/ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Options'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options#getDefaultSourceFolder Default Source Folder}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage#getOptions() + * @model + * @generated + */ +public interface Options extends EObject { + /** + * Returns the value of the 'Default Source Folder' attribute. + * + *

    + * If the meaning of the 'Default Source Folder' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Default Source Folder' attribute. + * @see #setDefaultSourceFolder(String) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage#getOptions_DefaultSourceFolder() + * @model dataType="org.eclipse.uml2.types.String" required="true" ordered="false" + * @generated + */ + String getDefaultSourceFolder(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options#getDefaultSourceFolder Default Source Folder}' attribute. + * + * + * + * @param value + * the new value of the 'Default Source Folder' attribute. + * @see #getDefaultSourceFolder() + * @generated + */ + void setDefaultSourceFolder(String value); + +} // Options diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmFactoryImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmFactoryImpl.java new file mode 100644 index 00000000000..04e8b13c3c9 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmFactoryImpl.java @@ -0,0 +1,114 @@ +/***************************************************************************** + * Copyright (c) 2014 Jonathan Geoffroy + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception + * + *****************************************************************************/ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.impl.EFactoryImpl; +import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; + +/** + * + * An implementation of the model Factory. + * + * + * @generated + */ +public class GeneratoroptionsmmFactoryImpl extends EFactoryImpl implements GeneratoroptionsmmFactory { + /** + * Creates the default factory implementation. + * + * + * + * @generated + */ + public static GeneratoroptionsmmFactory init() { + try { + GeneratoroptionsmmFactory theGeneratoroptionsmmFactory = (GeneratoroptionsmmFactory) EPackage.Registry.INSTANCE.getEFactory(GeneratoroptionsmmPackage.eNS_URI); + if (theGeneratoroptionsmmFactory != null) { + return theGeneratoroptionsmmFactory; + } + } catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new GeneratoroptionsmmFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * + * @generated + */ + public GeneratoroptionsmmFactoryImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case GeneratoroptionsmmPackage.OPTIONS: + return createOptions(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Options createOptions() { + OptionsImpl options = new OptionsImpl(); + return options; + } + + /** + * + * + * + * @generated + */ + @Override + public GeneratoroptionsmmPackage getGeneratoroptionsmmPackage() { + return (GeneratoroptionsmmPackage) getEPackage(); + } + + /** + * + * + * + * @deprecated + * @generated + */ + @Deprecated + public static GeneratoroptionsmmPackage getPackage() { + return GeneratoroptionsmmPackage.eINSTANCE; + } + +} // GeneratoroptionsmmFactoryImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmPackageImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmPackageImpl.java new file mode 100644 index 00000000000..1ff4792db08 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/GeneratoroptionsmmPackageImpl.java @@ -0,0 +1,229 @@ +/***************************************************************************** + * Copyright (c) 2014 Jonathan Geoffroy + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception + * + *****************************************************************************/ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.impl.EPackageImpl; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; +import org.eclipse.uml2.types.TypesPackage; + +/** + * + * An implementation of the model Package. + * + * + * @generated + */ +public class GeneratoroptionsmmPackageImpl extends EPackageImpl implements GeneratoroptionsmmPackage { + /** + * + * + * + * @generated + */ + private EClass optionsEClass = null; + + /** + * Creates an instance of the model Package, registered with {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

    + * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also performs initialization of the package, or returns the registered package, if one already exists. + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage#eNS_URI + * @see #init() + * @generated + */ + private GeneratoroptionsmmPackageImpl() { + super(eNS_URI, GeneratoroptionsmmFactory.eINSTANCE); + } + + /** + * + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

    + * This method is used to initialize {@link GeneratoroptionsmmPackage#eINSTANCE} when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static GeneratoroptionsmmPackage init() { + if (isInited) { + return (GeneratoroptionsmmPackage) EPackage.Registry.INSTANCE.getEPackage(GeneratoroptionsmmPackage.eNS_URI); + } + + // Obtain or create and register package + GeneratoroptionsmmPackageImpl theGeneratoroptionsmmPackage = (GeneratoroptionsmmPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof GeneratoroptionsmmPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) + : new GeneratoroptionsmmPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + TypesPackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theGeneratoroptionsmmPackage.createPackageContents(); + + // Initialize created meta-data + theGeneratoroptionsmmPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theGeneratoroptionsmmPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(GeneratoroptionsmmPackage.eNS_URI, theGeneratoroptionsmmPackage); + return theGeneratoroptionsmmPackage; + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getOptions() { + return optionsEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getOptions_DefaultSourceFolder() { + return (EAttribute) optionsEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public GeneratoroptionsmmFactory getGeneratoroptionsmmFactory() { + return (GeneratoroptionsmmFactory) getEFactoryInstance(); + } + + /** + * + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) { + return; + } + isCreated = true; + + // Create classes and their features + optionsEClass = createEClass(OPTIONS); + createEAttribute(optionsEClass, OPTIONS__DEFAULT_SOURCE_FOLDER); + } + + /** + * + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) { + return; + } + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + TypesPackage theTypesPackage = (TypesPackage) EPackage.Registry.INSTANCE.getEPackage(TypesPackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes, features, and operations; add parameters + initEClass(optionsEClass, Options.class, "Options", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getOptions_DefaultSourceFolder(), theTypesPackage.getString(), "defaultSourceFolder", null, 1, 1, Options.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http://www.eclipse.org/uml2/2.0.0/UML + createUMLAnnotations(); + } + + /** + * Initializes the annotations for http://www.eclipse.org/uml2/2.0.0/UML. + * + * + * + * @generated + */ + protected void createUMLAnnotations() { + String source = "http://www.eclipse.org/uml2/2.0.0/UML"; + addAnnotation(this, + source, + new String[] { + "originalName", "GeneratorOptionsMM" + }); + } + +} // GeneratoroptionsmmPackageImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/OptionsImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/OptionsImpl.java new file mode 100644 index 00000000000..da0c05436b7 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/impl/OptionsImpl.java @@ -0,0 +1,187 @@ +/***************************************************************************** + * Copyright (c) 2014 Jonathan Geoffroy + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception + * + *****************************************************************************/ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; + +/** + * + * An implementation of the model object 'Options'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.impl.OptionsImpl#getDefaultSourceFolder Default Source Folder}
    • + *
    + *

    + * + * @generated + */ +public class OptionsImpl extends MinimalEObjectImpl.Container implements Options { + /** + * The default value of the '{@link #getDefaultSourceFolder() Default Source Folder}' attribute. + * + * + * + * @see #getDefaultSourceFolder() + * @generated + * @ordered + */ + protected static final String DEFAULT_SOURCE_FOLDER_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDefaultSourceFolder() Default Source Folder}' attribute. + * + * + * + * @see #getDefaultSourceFolder() + * @generated + * @ordered + */ + protected String defaultSourceFolder = DEFAULT_SOURCE_FOLDER_EDEFAULT; + + /** + * + * + * + * @generated + */ + protected OptionsImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return GeneratoroptionsmmPackage.Literals.OPTIONS; + } + + /** + * + * + * + * @generated + */ + @Override + public String getDefaultSourceFolder() { + return defaultSourceFolder; + } + + /** + * + * + * + * @generated + */ + @Override + public void setDefaultSourceFolder(String newDefaultSourceFolder) { + String oldDefaultSourceFolder = defaultSourceFolder; + defaultSourceFolder = newDefaultSourceFolder; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, GeneratoroptionsmmPackage.OPTIONS__DEFAULT_SOURCE_FOLDER, oldDefaultSourceFolder, defaultSourceFolder)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case GeneratoroptionsmmPackage.OPTIONS__DEFAULT_SOURCE_FOLDER: + return getDefaultSourceFolder(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case GeneratoroptionsmmPackage.OPTIONS__DEFAULT_SOURCE_FOLDER: + setDefaultSourceFolder((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case GeneratoroptionsmmPackage.OPTIONS__DEFAULT_SOURCE_FOLDER: + setDefaultSourceFolder(DEFAULT_SOURCE_FOLDER_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case GeneratoroptionsmmPackage.OPTIONS__DEFAULT_SOURCE_FOLDER: + return DEFAULT_SOURCE_FOLDER_EDEFAULT == null ? defaultSourceFolder != null : !DEFAULT_SOURCE_FOLDER_EDEFAULT.equals(defaultSourceFolder); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (defaultSourceFolder: "); + result.append(defaultSourceFolder); + result.append(')'); + return result.toString(); + } + +} // OptionsImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmAdapterFactory.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmAdapterFactory.java new file mode 100644 index 00000000000..b3559f01418 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmAdapterFactory.java @@ -0,0 +1,139 @@ +/***************************************************************************** + * Copyright (c) 2014 Jonathan Geoffroy + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception + * + *****************************************************************************/ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage + * @generated + */ +public class GeneratoroptionsmmAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * + * @generated + */ + protected static GeneratoroptionsmmPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * + * @generated + */ + public GeneratoroptionsmmAdapterFactory() { + if (modelPackage == null) { + modelPackage = GeneratoroptionsmmPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject) object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * + * @generated + */ + protected GeneratoroptionsmmSwitch modelSwitch = + new GeneratoroptionsmmSwitch() { + @Override + public Adapter caseOptions(Options object) { + return createOptionsAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * + * @param target + * the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject) target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options Options}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options + * @generated + */ + public Adapter createOptionsAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} // GeneratoroptionsmmAdapterFactory diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmSwitch.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmSwitch.java new file mode 100644 index 00000000000..e4b8935cc3a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/generatoroptionsmm/util/GeneratoroptionsmmSwitch.java @@ -0,0 +1,131 @@ +/***************************************************************************** + * Copyright (c) 2014 Jonathan Geoffroy + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Jonathan Geoffroy geoffroy.jonathan@gmail.com - Meta-model conception + * + *****************************************************************************/ +package org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.util.Switch; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.Options; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.generatoroptionsmm.GeneratoroptionsmmPackage + * @generated + */ +public class GeneratoroptionsmmSwitch extends Switch { + /** + * The cached model package + * + * + * + * @generated + */ + protected static GeneratoroptionsmmPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * + * @generated + */ + public GeneratoroptionsmmSwitch() { + if (modelPackage == null) { + modelPackage = GeneratoroptionsmmPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * + * @parameter ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case GeneratoroptionsmmPackage.OPTIONS: { + Options options = (Options) theEObject; + T result = caseOptions(options); + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Options'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Options'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseOptions(Options object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} // GeneratoroptionsmmSwitch diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTClass.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTClass.java new file mode 100644 index 00000000000..2479b25ad4e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTClass.java @@ -0,0 +1,37 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + + +/** + * + * A representation of the model object 'JDT Class'. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTClass() + * @model + * @generated + */ +public interface JDTClass extends JDTType { +} // JDTClass diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTCompilationUnit.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTCompilationUnit.java new file mode 100644 index 00000000000..c9cace0f946 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTCompilationUnit.java @@ -0,0 +1,106 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.common.util.EList; + + +/** + * + * A representation of the model object 'JDT Compilation Unit'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getPackageFragment Package Fragment}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getTypes Types}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTCompilationUnit() + * @model + * @generated + */ +public interface JDTCompilationUnit extends JDTTypeRoot { + + /** + * Returns the value of the 'Package Fragment' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getCompilationUnits Compilation Units}'. + *

    + * This feature redefines the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Package Fragment' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Package Fragment' container reference. + * @see #setPackageFragment(JDTPackageFragment) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTCompilationUnit_PackageFragment() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getCompilationUnits + * @model opposite="compilationUnits" transient="false" ordered="false" + * @generated + */ + JDTPackageFragment getPackageFragment(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getPackageFragment Package Fragment}' container reference. + * + * + * + * @param value + * the new value of the 'Package Fragment' container reference. + * @see #getPackageFragment() + * @generated + */ + void setPackageFragment(JDTPackageFragment value); + + /** + * Returns the value of the 'Types' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType}. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getCompilationUnit Compilation Unit}'. + *

    + * This feature subsets the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Types' reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Types' containment reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTCompilationUnit_Types() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getCompilationUnit + * @model opposite="compilationUnit" containment="true" ordered="false" + * @generated + */ + EList getTypes(); +} // JDTCompilationUnit diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTEnum.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTEnum.java new file mode 100644 index 00000000000..2a762c988be --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTEnum.java @@ -0,0 +1,37 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + + +/** + * + * A representation of the model object 'JDT Enum'. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTEnum() + * @model + * @generated + */ +public interface JDTEnum extends JDTType { +} // JDTEnum diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTException.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTException.java new file mode 100644 index 00000000000..bb72424f0f7 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTException.java @@ -0,0 +1,38 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'JDT Exception'. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTException() + * @model + * @generated + */ +public interface JDTException extends EObject { +} // JDTException diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTField.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTField.java new file mode 100644 index 00000000000..39c29010ee8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTField.java @@ -0,0 +1,322 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + + +/** + * + * A representation of the model object 'JDT Field'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isAbstract Abstract}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isFinal Final}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isStatic Static}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isMultiValued Is Multi Valued}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getType Type}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getValue Value}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateGetter Generate Getter}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateSetter Generate Setter}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getOwner Owner}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField() + * @model + * @generated + */ +public interface JDTField extends JDTMember { + + /** + * Returns the value of the 'Owner' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getFields Fields}'. + *

    + * This feature redefines the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Owner' container reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Owner' container reference. + * @see #setOwner(JDTType) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_Owner() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getFields + * @model opposite="fields" required="true" transient="false" ordered="false" + * @generated + */ + JDTType getOwner(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getOwner Owner}' container reference. + * + * + * + * @param value + * the new value of the 'Owner' container reference. + * @see #getOwner() + * @generated + */ + void setOwner(JDTType value); + + /** + * Returns the value of the 'Abstract' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Abstract' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Abstract' attribute. + * @see #setAbstract(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_Abstract() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" + * @generated + */ + boolean isAbstract(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isAbstract Abstract}' attribute. + * + * + * + * @param value + * the new value of the 'Abstract' attribute. + * @see #isAbstract() + * @generated + */ + void setAbstract(boolean value); + + /** + * Returns the value of the 'Final' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Final' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Final' attribute. + * @see #setFinal(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_Final() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" + * @generated + */ + boolean isFinal(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isFinal Final}' attribute. + * + * + * + * @param value + * the new value of the 'Final' attribute. + * @see #isFinal() + * @generated + */ + void setFinal(boolean value); + + /** + * Returns the value of the 'Static' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Static' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Static' attribute. + * @see #setStatic(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_Static() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" + * @generated + */ + boolean isStatic(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isStatic Static}' attribute. + * + * + * + * @param value + * the new value of the 'Static' attribute. + * @see #isStatic() + * @generated + */ + void setStatic(boolean value); + + /** + * Returns the value of the 'Is Multi Valued' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Is Multi Valued' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Multi Valued' attribute. + * @see #setIsMultiValued(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_IsMultiValued() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" + * @generated + */ + boolean isMultiValued(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isMultiValued Is Multi Valued}' attribute. + * + * + * + * @param value + * the new value of the 'Is Multi Valued' attribute. + * @see #isMultiValued() + * @generated + */ + void setIsMultiValued(boolean value); + + /** + * Returns the value of the 'Type' reference. + * + *

    + * If the meaning of the 'Type' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Type' reference. + * @see #setType(JDTType) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_Type() + * @model ordered="false" + * @generated + */ + JDTType getType(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getType Type}' reference. + * + * + * + * @param value + * the new value of the 'Type' reference. + * @see #getType() + * @generated + */ + void setType(JDTType value); + + /** + * Returns the value of the 'Value' attribute. + * + *

    + * If the meaning of the 'Value' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Value' attribute. + * @see #setValue(String) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_Value() + * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" + * @generated + */ + String getValue(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getValue Value}' attribute. + * + * + * + * @param value + * the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(String value); + + /** + * Returns the value of the 'Generate Getter' attribute. + * The literals are from the enumeration {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault}. + * + *

    + * If the meaning of the 'Generate Getter' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Generate Getter' attribute. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault + * @see #setGenerateGetter(TrueFalseDefault) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_GenerateGetter() + * @model required="true" ordered="false" + * @generated + */ + TrueFalseDefault getGenerateGetter(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateGetter Generate Getter}' attribute. + * + * + * + * @param value + * the new value of the 'Generate Getter' attribute. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault + * @see #getGenerateGetter() + * @generated + */ + void setGenerateGetter(TrueFalseDefault value); + + /** + * Returns the value of the 'Generate Setter' attribute. + * The literals are from the enumeration {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault}. + * + *

    + * If the meaning of the 'Generate Setter' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Generate Setter' attribute. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault + * @see #setGenerateSetter(TrueFalseDefault) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTField_GenerateSetter() + * @model required="true" ordered="false" + * @generated + */ + TrueFalseDefault getGenerateSetter(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateSetter Generate Setter}' attribute. + * + * + * + * @param value + * the new value of the 'Generate Setter' attribute. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault + * @see #getGenerateSetter() + * @generated + */ + void setGenerateSetter(TrueFalseDefault value); + +} // JDTField diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportContainer.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportContainer.java new file mode 100644 index 00000000000..44e4feeb27b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportContainer.java @@ -0,0 +1,37 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + + +/** + * + * A representation of the model object 'JDT Import Container'. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTImportContainer() + * @model + * @generated + */ +public interface JDTImportContainer extends JDTParentJavaElement { +} // JDTImportContainer diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportDeclaration.java new file mode 100644 index 00000000000..31f45b7481a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTImportDeclaration.java @@ -0,0 +1,37 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + + +/** + * + * A representation of the model object 'JDT Import Declaration'. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTImportDeclaration() + * @model + * @generated + */ +public interface JDTImportDeclaration extends JDTJavaElement { +} // JDTImportDeclaration diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTInterface.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTInterface.java new file mode 100644 index 00000000000..140bba30001 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTInterface.java @@ -0,0 +1,37 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + + +/** + * + * A representation of the model object 'JDT Interface'. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTInterface() + * @model + * @generated + */ +public interface JDTInterface extends JDTType { +} // JDTInterface diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaElement.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaElement.java new file mode 100644 index 00000000000..d928b385700 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaElement.java @@ -0,0 +1,207 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; + +/** + * + * A representation of the model object 'JDT Java Element'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementName Element Name}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementType Element Type}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getComment Comment}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#isGenerated Generated}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent Parent}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaElement() + * @model abstract="true" + * @generated + */ +public interface JDTJavaElement extends EObject { + + /** + * Returns the value of the 'Parent' reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren Children}'. + * + *

    + * If the meaning of the 'Parent' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Parent' reference. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaElement_Parent() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren + * @model opposite="children" transient="true" changeable="false" ordered="false" + * @generated + */ + JDTParent getParent(); + + /** + * Returns the value of the 'Element Name' attribute. + * + *

    + * If the meaning of the 'Element Name' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Element Name' attribute. + * @see #setElementName(String) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaElement_ElementName() + * @model unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" + * @generated + */ + String getElementName(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementName Element Name}' attribute. + * + * + * + * @param value + * the new value of the 'Element Name' attribute. + * @see #getElementName() + * @generated + */ + void setElementName(String value); + + /** + * Returns the value of the 'Element Type' attribute. + * + *

    + * If the meaning of the 'Element Type' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Element Type' attribute. + * @see #setElementType(int) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaElement_ElementType() + * @model unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.int" required="true" ordered="false" + * @generated + */ + int getElementType(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementType Element Type}' attribute. + * + * + * + * @param value + * the new value of the 'Element Type' attribute. + * @see #getElementType() + * @generated + */ + void setElementType(int value); + + /** + * Returns the value of the 'Comment' attribute. + * + *

    + * If the meaning of the 'Comment' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Comment' attribute. + * @see #setComment(String) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaElement_Comment() + * @model unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" + * @generated + */ + String getComment(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getComment Comment}' attribute. + * + * + * + * @param value + * the new value of the 'Comment' attribute. + * @see #getComment() + * @generated + */ + void setComment(String value); + + /** + * Returns the value of the 'Generated' attribute. + * + *

    + * If the meaning of the 'Generated' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Generated' attribute. + * @see #setGenerated(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaElement_Generated() + * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" + * @generated + */ + boolean isGenerated(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#isGenerated Generated}' attribute. + * + * + * + * @param value + * the new value of the 'Generated' attribute. + * @see #isGenerated() + * @generated + */ + void setGenerated(boolean value); + + /** + * + * + * + * @model kind="operation" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" + * @generated + */ + String getQualifiedName(); + + /** + * + * + * + * @model exceptions="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTVisitorException" visitorDataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.Visitor" visitorRequired="true" visitorOrdered="false" + * @generated + */ + void accept(JDTVisitor visitor) throws JDTVisitorException; + + /** + * + * + * + * @model kind="operation" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" + * @generated + */ + String getJDTSignature(); + +} // JDTJavaElement diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaModel.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaModel.java new file mode 100644 index 00000000000..825af4b4dd9 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaModel.java @@ -0,0 +1,63 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.common.util.EList; + + +/** + * + * A representation of the model object 'JDT Java Model'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel#getJavaProject Java Project}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaModel() + * @model + * @generated + */ +public interface JDTJavaModel extends JDTParentJavaElement { + + /** + * Returns the value of the 'Java Project' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject}. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getJavaModel Java Model}'. + * + *

    + * If the meaning of the 'Java Project' containment reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Java Project' containment reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaModel_JavaProject() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getJavaModel + * @model opposite="javaModel" containment="true" ordered="false" + * @generated + */ + EList getJavaProject(); +} // JDTJavaModel diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaProject.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaProject.java new file mode 100644 index 00000000000..02d6e63656a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTJavaProject.java @@ -0,0 +1,100 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'JDT Java Project'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getJavaModel Java Model}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getPackageFragmentRoots Package Fragment Roots}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaProject() + * @model + * @generated + */ +public interface JDTJavaProject extends JDTParentJavaElement { + + /** + * Returns the value of the 'Java Model' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel#getJavaProject Java Project}'. + * + *

    + * If the meaning of the 'Java Model' container reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Java Model' container reference. + * @see #setJavaModel(JDTJavaModel) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaProject_JavaModel() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel#getJavaProject + * @model opposite="javaProject" transient="false" ordered="false" + * @generated + */ + JDTJavaModel getJavaModel(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getJavaModel Java Model}' container reference. + * + * + * + * @param value + * the new value of the 'Java Model' container reference. + * @see #getJavaModel() + * @generated + */ + void setJavaModel(JDTJavaModel value); + + /** + * Returns the value of the 'Package Fragment Roots' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot}. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getJavaProject Java Project}'. + *

    + * This feature subsets the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Package Fragment Roots' containment reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Package Fragment Roots' containment reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTJavaProject_PackageFragmentRoots() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getJavaProject + * @model opposite="javaProject" containment="true" ordered="false" + * @generated + */ + EList getPackageFragmentRoots(); + +} // JDTJavaProject diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMember.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMember.java new file mode 100644 index 00000000000..eacd3ae38fd --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMember.java @@ -0,0 +1,130 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.common.util.EList; + + +/** + * + * A representation of the model object 'JDT Member'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getTypeParameters Type Parameters}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getVisibility Visibility}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getExplicitRequiredImports Explicit Required Imports}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMember() + * @model abstract="true" + * @generated + */ +public interface JDTMember extends JDTParentJavaElement { + + /** + * Returns the value of the 'Type Parameters' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter}. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter#getDeclaringMember Declaring Member}'. + * + *

    + * If the meaning of the 'Type Parameters' containment reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Type Parameters' containment reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMember_TypeParameters() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter#getDeclaringMember + * @model opposite="declaringMember" containment="true" ordered="false" + * @generated + */ + EList getTypeParameters(); + + /** + * Returns the value of the 'Visibility' attribute. + * The default value is "public". + * The literals are from the enumeration {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind}. + * + *

    + * If the meaning of the 'Visibility' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Visibility' attribute. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind + * @see #setVisibility(VisibilityKind) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMember_Visibility() + * @model default="public" unique="false" required="true" transient="true" volatile="true" derived="true" ordered="false" + * @generated + */ + VisibilityKind getVisibility(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getVisibility Visibility}' attribute. + * + * + * + * @param value + * the new value of the 'Visibility' attribute. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind + * @see #getVisibility() + * @generated + */ + void setVisibility(VisibilityKind value); + + /** + * Returns the value of the 'Explicit Required Imports' reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType}. + * + *

    + * If the meaning of the 'Explicit Required Imports' reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Explicit Required Imports' reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMember_ExplicitRequiredImports() + * @model ordered="false" + * @generated + */ + EList getExplicitRequiredImports(); + + /** + * Returns the value of the 'Explicit Plain Text Required Imports' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

    + * If the meaning of the 'Explicit Plain Text Required Imports' attribute list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Explicit Plain Text Required Imports' attribute list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMember_ExplicitPlainTextRequiredImports() + * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" ordered="false" + * @generated + */ + EList getExplicitPlainTextRequiredImports(); +} // JDTMember diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethod.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethod.java new file mode 100644 index 00000000000..3b9910e6807 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethod.java @@ -0,0 +1,316 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.common.util.EList; + + +/** + * + * A representation of the model object 'JDT Method'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getOwner Owner}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getReturnType Return Type}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getParameters Parameters}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isAbstract Abstract}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isFinal Final}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isStatic Static}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getExceptions Exceptions}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isSynchronized Synchronized}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isConstructor Constructor}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getBodies Bodies}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod() + * @model + * @generated + */ +public interface JDTMethod extends JDTMember { + + /** + * Returns the value of the 'Return Type' containment reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getReturnOwner Return Owner}'. + * + *

    + * If the meaning of the 'Return Type' containment reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Return Type' containment reference. + * @see #setReturnType(JDTParameter) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_ReturnType() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getReturnOwner + * @model opposite="returnOwner" containment="true" ordered="false" + * @generated + */ + JDTParameter getReturnType(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getReturnType Return Type}' containment reference. + * + * + * + * @param value + * the new value of the 'Return Type' containment reference. + * @see #getReturnType() + * @generated + */ + void setReturnType(JDTParameter value); + + /** + * Returns the value of the 'Parameters' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter}. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getParameterOwner Parameter Owner}'. + * + *

    + * If the meaning of the 'Parameters' containment reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Parameters' containment reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Parameters() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getParameterOwner + * @model opposite="parameterOwner" containment="true" ordered="false" + * @generated + */ + EList getParameters(); + + /** + * Returns the value of the 'Exceptions' reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType}. + * + *

    + * If the meaning of the 'Exceptions' reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Exceptions' reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Exceptions() + * @model ordered="false" + * @generated + */ + EList getExceptions(); + + /** + * Returns the value of the 'Synchronized' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Synchronized' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Synchronized' attribute. + * @see #setSynchronized(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Synchronized() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" + * @generated + */ + boolean isSynchronized(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isSynchronized Synchronized}' attribute. + * + * + * + * @param value + * the new value of the 'Synchronized' attribute. + * @see #isSynchronized() + * @generated + */ + void setSynchronized(boolean value); + + /** + * Returns the value of the 'Constructor' attribute. + * + *

    + * If the meaning of the 'Constructor' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Constructor' attribute. + * @see #setConstructor(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Constructor() + * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" + * @generated + */ + boolean isConstructor(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isConstructor Constructor}' attribute. + * + * + * + * @param value + * the new value of the 'Constructor' attribute. + * @see #isConstructor() + * @generated + */ + void setConstructor(boolean value); + + /** + * Returns the value of the 'Bodies' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody}. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody#getOwner Owner}'. + * + *

    + * If the meaning of the 'Bodies' containment reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Bodies' containment reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Bodies() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody#getOwner + * @model opposite="owner" containment="true" ordered="false" + * @generated + */ + EList getBodies(); + + /** + * Returns the value of the 'Abstract' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Abstract' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Abstract' attribute. + * @see #setAbstract(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Abstract() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" + * @generated + */ + boolean isAbstract(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isAbstract Abstract}' attribute. + * + * + * + * @param value + * the new value of the 'Abstract' attribute. + * @see #isAbstract() + * @generated + */ + void setAbstract(boolean value); + + /** + * Returns the value of the 'Final' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Final' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Final' attribute. + * @see #setFinal(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Final() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" + * @generated + */ + boolean isFinal(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isFinal Final}' attribute. + * + * + * + * @param value + * the new value of the 'Final' attribute. + * @see #isFinal() + * @generated + */ + void setFinal(boolean value); + + /** + * Returns the value of the 'Static' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Static' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Static' attribute. + * @see #setStatic(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Static() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" + * @generated + */ + boolean isStatic(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isStatic Static}' attribute. + * + * + * + * @param value + * the new value of the 'Static' attribute. + * @see #isStatic() + * @generated + */ + void setStatic(boolean value); + + /** + * Returns the value of the 'Owner' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getMethods Methods}'. + *

    + * This feature redefines the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Owner' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Owner' container reference. + * @see #setOwner(JDTType) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethod_Owner() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getMethods + * @model opposite="methods" required="true" transient="false" ordered="false" + * @generated + */ + JDTType getOwner(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getOwner Owner}' container reference. + * + * + * + * @param value + * the new value of the 'Owner' container reference. + * @see #getOwner() + * @generated + */ + void setOwner(JDTType value); +} // JDTMethod diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethodBody.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethodBody.java new file mode 100644 index 00000000000..970acbffbcd --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTMethodBody.java @@ -0,0 +1,71 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'JDT Method Body'. + * + * + * + * Can have different type of body: opaque, expr (not yet implemented, ...) + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody#getOwner Owner}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethodBody() + * @model abstract="true" + * @generated + */ +public interface JDTMethodBody extends EObject { + /** + * Returns the value of the 'Owner' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getBodies Bodies}'. + * + *

    + * If the meaning of the 'Owner' container reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Owner' container reference. + * @see #setOwner(JDTMethod) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTMethodBody_Owner() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getBodies + * @model opposite="bodies" required="true" transient="false" ordered="false" + * @generated + */ + JDTMethod getOwner(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody#getOwner Owner}' container reference. + * + * + * + * @param value + * the new value of the 'Owner' container reference. + * @see #getOwner() + * @generated + */ + void setOwner(JDTMethod value); + + /** + * + * + * + * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" + * @generated + */ + String asText(); + +} // JDTMethodBody diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTOpaqueBody.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTOpaqueBody.java new file mode 100644 index 00000000000..9e6d2280f01 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTOpaqueBody.java @@ -0,0 +1,55 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + + +/** + * + * A representation of the model object 'JDT Opaque Body'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody#get_body body}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTOpaqueBody() + * @model + * @generated + */ +public interface JDTOpaqueBody extends JDTMethodBody { + /** + * Returns the value of the 'body' attribute. + * + *

    + * If the meaning of the 'body' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'body' attribute. + * @see #set_body(String) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTOpaqueBody__body() + * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" ordered="false" + * @generated + */ + String get_body(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody#get_body body}' attribute. + * + * + * + * @param value + * the new value of the 'body' attribute. + * @see #get_body() + * @generated + */ + void set_body(String value); + +} // JDTOpaqueBody diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragment.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragment.java new file mode 100644 index 00000000000..fbf0e3ab93d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragment.java @@ -0,0 +1,106 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.common.util.EList; + + +/** + * + * A representation of the model object 'JDT Package Fragment'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getPackageFragmentRoot Package Fragment Root}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getCompilationUnits Compilation Units}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTPackageFragment() + * @model + * @generated + */ +public interface JDTPackageFragment extends JDTParentJavaElement { + + /** + * Returns the value of the 'Package Fragment Root' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getPackageFragments Package Fragments}'. + *

    + * This feature redefines the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Package Fragment Root' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Package Fragment Root' container reference. + * @see #setPackageFragmentRoot(JDTPackageFragmentRoot) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTPackageFragment_PackageFragmentRoot() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getPackageFragments + * @model opposite="packageFragments" transient="false" ordered="false" + * @generated + */ + JDTPackageFragmentRoot getPackageFragmentRoot(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getPackageFragmentRoot Package Fragment Root}' container reference. + * + * + * + * @param value + * the new value of the 'Package Fragment Root' container reference. + * @see #getPackageFragmentRoot() + * @generated + */ + void setPackageFragmentRoot(JDTPackageFragmentRoot value); + + /** + * Returns the value of the 'Compilation Units' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit}. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getPackageFragment Package Fragment}'. + *

    + * This feature subsets the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Compilation Units' reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Compilation Units' containment reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTPackageFragment_CompilationUnits() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getPackageFragment + * @model opposite="packageFragment" containment="true" ordered="false" + * @generated + */ + EList getCompilationUnits(); +} // JDTPackageFragment diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragmentRoot.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragmentRoot.java new file mode 100644 index 00000000000..2b34e6990de --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTPackageFragmentRoot.java @@ -0,0 +1,106 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.common.util.EList; + + +/** + * + * A representation of the model object 'JDT Package Fragment Root'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getJavaProject Java Project}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getPackageFragments Package Fragments}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTPackageFragmentRoot() + * @model + * @generated + */ +public interface JDTPackageFragmentRoot extends JDTParentJavaElement { + + /** + * Returns the value of the 'Java Project' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getPackageFragmentRoots Package Fragment Roots}'. + *

    + * This feature redefines the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Java Project' container reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Java Project' container reference. + * @see #setJavaProject(JDTJavaProject) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTPackageFragmentRoot_JavaProject() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getPackageFragmentRoots + * @model opposite="packageFragmentRoots" transient="false" ordered="false" + * @generated + */ + JDTJavaProject getJavaProject(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getJavaProject Java Project}' container reference. + * + * + * + * @param value + * the new value of the 'Java Project' container reference. + * @see #getJavaProject() + * @generated + */ + void setJavaProject(JDTJavaProject value); + + /** + * Returns the value of the 'Package Fragments' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment}. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getPackageFragmentRoot Package Fragment Root}'. + *

    + * This feature subsets the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Package Fragments' reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Package Fragments' containment reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTPackageFragmentRoot_PackageFragments() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getPackageFragmentRoot + * @model opposite="packageFragmentRoot" containment="true" ordered="false" + * @generated + */ + EList getPackageFragments(); +} // JDTPackageFragmentRoot diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParameter.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParameter.java new file mode 100644 index 00000000000..7e23a137536 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParameter.java @@ -0,0 +1,193 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + + +/** + * + * A representation of the model object 'JDT Parameter'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getParameterOwner Parameter Owner}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isFinal Final}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isMultiValued Is Multi Valued}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getType Type}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getReturnOwner Return Owner}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParameter() + * @model + * @generated + */ +public interface JDTParameter extends JDTMember { + + /** + * Returns the value of the 'Parameter Owner' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getParameters Parameters}'. + * + *

    + * If the meaning of the 'Parameter Owner' container reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Parameter Owner' container reference. + * @see #setParameterOwner(JDTMethod) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParameter_ParameterOwner() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getParameters + * @model opposite="parameters" transient="false" ordered="false" + * @generated + */ + JDTMethod getParameterOwner(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getParameterOwner Parameter Owner}' container reference. + * + * + * + * @param value + * the new value of the 'Parameter Owner' container reference. + * @see #getParameterOwner() + * @generated + */ + void setParameterOwner(JDTMethod value); + + /** + * Returns the value of the 'Final' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Final' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Final' attribute. + * @see #setFinal(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParameter_Final() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" + * @generated + */ + boolean isFinal(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isFinal Final}' attribute. + * + * + * + * @param value + * the new value of the 'Final' attribute. + * @see #isFinal() + * @generated + */ + void setFinal(boolean value); + + /** + * Returns the value of the 'Is Multi Valued' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Is Multi Valued' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Multi Valued' attribute. + * @see #setIsMultiValued(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParameter_IsMultiValued() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" + * @generated + */ + boolean isMultiValued(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isMultiValued Is Multi Valued}' attribute. + * + * + * + * @param value + * the new value of the 'Is Multi Valued' attribute. + * @see #isMultiValued() + * @generated + */ + void setIsMultiValued(boolean value); + + /** + * Returns the value of the 'Type' reference. + * + *

    + * If the meaning of the 'Type' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Type' reference. + * @see #setType(JDTType) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParameter_Type() + * @model ordered="false" + * @generated + */ + JDTType getType(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getType Type}' reference. + * + * + * + * @param value + * the new value of the 'Type' reference. + * @see #getType() + * @generated + */ + void setType(JDTType value); + + /** + * Returns the value of the 'Return Owner' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getReturnType Return Type}'. + * + *

    + * If the meaning of the 'Return Owner' container reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Return Owner' container reference. + * @see #setReturnOwner(JDTMethod) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParameter_ReturnOwner() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getReturnType + * @model opposite="returnType" transient="false" ordered="false" + * @generated + */ + JDTMethod getReturnOwner(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getReturnOwner Return Owner}' container reference. + * + * + * + * @param value + * the new value of the 'Return Owner' container reference. + * @see #getReturnOwner() + * @generated + */ + void setReturnOwner(JDTMethod value); +} // JDTParameter diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParent.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParent.java new file mode 100644 index 00000000000..273a3cad656 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParent.java @@ -0,0 +1,111 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'JDT Parent'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren Children}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getFlags Flags}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParent() + * @model abstract="true" + * @generated + */ +public interface JDTParent extends EObject { + + /** + * Returns the value of the 'Flags' attribute. + * + *

    + * If the meaning of the 'Flags' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Flags' attribute. + * @see #setFlags(int) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParent_Flags() + * @model unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.int" required="true" ordered="false" + * @generated + */ + int getFlags(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getFlags Flags}' attribute. + * + * + * + * @param value + * the new value of the 'Flags' attribute. + * @see #getFlags() + * @generated + */ + void setFlags(int value); + + /** + * + * + * + * @model dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" flagDataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.int" flagRequired="true" flagOrdered="false" + * @generated + */ + boolean isFlagSet(int flag); + + /** + * Returns the value of the 'Children' reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement}. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent Parent}'. + * + *

    + * If the meaning of the 'Children' reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Children' reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParent_Children() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent + * @model opposite="parent" transient="true" changeable="false" volatile="true" ordered="false" + * @generated + */ + EList getChildren(); + + /** + * + * + * + * @model flagDataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.int" flagRequired="true" flagOrdered="false" valueDataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" valueRequired="true" valueOrdered="false" + * @generated + */ + void setFlag(int flag, boolean value); + +} // JDTParent diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParentJavaElement.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParentJavaElement.java new file mode 100644 index 00000000000..c64fd494880 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTParentJavaElement.java @@ -0,0 +1,37 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + + +/** + * + * A representation of the model object 'JDT Parent Java Element'. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTParentJavaElement() + * @model abstract="true" + * @generated + */ +public interface JDTParentJavaElement extends JDTJavaElement, JDTParent { +} // JDTParentJavaElement diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTType.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTType.java new file mode 100644 index 00000000000..8b83fef2790 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTType.java @@ -0,0 +1,452 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'JDT Type'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getMethods Methods}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getFields Fields}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getCompilationUnit Compilation Unit}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isClass Class}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isInterface Interface}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isEnum Enum}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isAbstract Abstract}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isFinal Final}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isStatic Static}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getTypes Types}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getOwner Owner}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperInterfaces Super Interfaces}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClass Super Class}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperInterfaceNames Super Interface Names}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClassName Super Class Name}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType() + * @model abstract="true" + * @generated + */ +public interface JDTType extends JDTMember { + + /** + * Returns the value of the 'Methods' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod}. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getOwner Owner}'. + *

    + * This feature subsets the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Methods' containment reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Methods' containment reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Methods() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getOwner + * @model opposite="owner" containment="true" ordered="false" + * @generated + */ + EList getMethods(); + + /** + * Returns the value of the 'Compilation Unit' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getTypes Types}'. + *

    + * This feature redefines the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Compilation Unit' container reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Compilation Unit' container reference. + * @see #setCompilationUnit(JDTCompilationUnit) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_CompilationUnit() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getTypes + * @model opposite="types" transient="false" ordered="false" + * @generated + */ + JDTCompilationUnit getCompilationUnit(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getCompilationUnit Compilation Unit}' container reference. + * + * + * + * @param value + * the new value of the 'Compilation Unit' container reference. + * @see #getCompilationUnit() + * @generated + */ + void setCompilationUnit(JDTCompilationUnit value); + + /** + * Returns the value of the 'Class' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Class' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Class' attribute. + * @see #setClass_(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Class() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" + * @generated + */ + boolean isClass(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isClass Class}' attribute. + * + * + * + * @param value + * the new value of the 'Class' attribute. + * @see #isClass() + * @generated + */ + void setClass_(boolean value); + + /** + * Returns the value of the 'Interface' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Interface' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Interface' attribute. + * @see #setInterface(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Interface() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" + * @generated + */ + boolean isInterface(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isInterface Interface}' attribute. + * + * + * + * @param value + * the new value of the 'Interface' attribute. + * @see #isInterface() + * @generated + */ + void setInterface(boolean value); + + /** + * Returns the value of the 'Enum' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Enum' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Enum' attribute. + * @see #setEnum(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Enum() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" ordered="false" + * @generated + */ + boolean isEnum(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isEnum Enum}' attribute. + * + * + * + * @param value + * the new value of the 'Enum' attribute. + * @see #isEnum() + * @generated + */ + void setEnum(boolean value); + + /** + * Returns the value of the 'Abstract' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Abstract' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Abstract' attribute. + * @see #setAbstract(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Abstract() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" + * @generated + */ + boolean isAbstract(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isAbstract Abstract}' attribute. + * + * + * + * @param value + * the new value of the 'Abstract' attribute. + * @see #isAbstract() + * @generated + */ + void setAbstract(boolean value); + + /** + * Returns the value of the 'Final' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Final' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Final' attribute. + * @see #setFinal(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Final() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" + * @generated + */ + boolean isFinal(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isFinal Final}' attribute. + * + * + * + * @param value + * the new value of the 'Final' attribute. + * @see #isFinal() + * @generated + */ + void setFinal(boolean value); + + /** + * Returns the value of the 'Static' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'Static' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Static' attribute. + * @see #setStatic(boolean) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Static() + * @model default="false" unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.boolean" required="true" transient="true" volatile="true" derived="true" ordered="false" + * @generated + */ + boolean isStatic(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isStatic Static}' attribute. + * + * + * + * @param value + * the new value of the 'Static' attribute. + * @see #isStatic() + * @generated + */ + void setStatic(boolean value); + + /** + * Returns the value of the 'Types' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType}. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getOwner Owner}'. + *

    + * This feature subsets the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Types' containment reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Types' containment reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Types() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getOwner + * @model opposite="owner" containment="true" ordered="false" + * @generated + */ + EList getTypes(); + + /** + * Returns the value of the 'Owner' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getTypes Types}'. + *

    + * This feature redefines the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() Parent}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Owner' container reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Owner' container reference. + * @see #setOwner(JDTType) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Owner() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getTypes + * @model opposite="types" transient="false" ordered="false" + * @generated + */ + JDTType getOwner(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getOwner Owner}' container reference. + * + * + * + * @param value + * the new value of the 'Owner' container reference. + * @see #getOwner() + * @generated + */ + void setOwner(JDTType value); + + /** + * Returns the value of the 'Super Interfaces' reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType}. + * + *

    + * If the meaning of the 'Super Interfaces' reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Super Interfaces' reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_SuperInterfaces() + * @model ordered="false" + * @generated + */ + EList getSuperInterfaces(); + + /** + * Returns the value of the 'Super Class' reference. + * + *

    + * If the meaning of the 'Super Class' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Super Class' reference. + * @see #setSuperClass(JDTType) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_SuperClass() + * @model ordered="false" + * @generated + */ + JDTType getSuperClass(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClass Super Class}' reference. + * + * + * + * @param value + * the new value of the 'Super Class' reference. + * @see #getSuperClass() + * @generated + */ + void setSuperClass(JDTType value); + + /** + * Returns the value of the 'Super Interface Names' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

    + * If the meaning of the 'Super Interface Names' attribute list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Super Interface Names' attribute list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_SuperInterfaceNames() + * @model unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" transient="true" changeable="false" volatile="true" derived="true" ordered="false" + * @generated + */ + EList getSuperInterfaceNames(); + + /** + * Returns the value of the 'Super Class Name' attribute. + * + *

    + * If the meaning of the 'Super Class Name' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Super Class Name' attribute. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_SuperClassName() + * @model unique="false" dataType="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.String" required="true" transient="true" changeable="false" volatile="true" derived="true" ordered="false" + * @generated + */ + String getSuperClassName(); + + /** + * Returns the value of the 'Fields' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField}. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getOwner Owner}'. + *

    + * This feature subsets the following features: + *

      + *
    • '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() Children}'
    • + *
    + *

    + * + *

    + * If the meaning of the 'Fields' containment reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Fields' containment reference list. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTType_Fields() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getOwner + * @model opposite="owner" containment="true" ordered="false" + * @generated + */ + EList getFields(); + +} // JDTType diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeParameter.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeParameter.java new file mode 100644 index 00000000000..0b417a44a06 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeParameter.java @@ -0,0 +1,74 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + + +/** + * + * A representation of the model object 'JDT Type Parameter'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter#getDeclaringMember Declaring Member}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTTypeParameter() + * @model + * @generated + */ +public interface JDTTypeParameter extends JDTJavaElement { + + /** + * Returns the value of the 'Declaring Member' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getTypeParameters Type Parameters}'. + * + *

    + * If the meaning of the 'Declaring Member' container reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Declaring Member' container reference. + * @see #setDeclaringMember(JDTMember) + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTTypeParameter_DeclaringMember() + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getTypeParameters + * @model opposite="typeParameters" transient="false" ordered="false" + * @generated + */ + JDTMember getDeclaringMember(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter#getDeclaringMember Declaring Member}' container reference. + * + * + * + * @param value + * the new value of the 'Declaring Member' container reference. + * @see #getDeclaringMember() + * @generated + */ + void setDeclaringMember(JDTMember value); + +} // JDTTypeParameter diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeRoot.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeRoot.java new file mode 100644 index 00000000000..daffc8a54d7 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JDTTypeRoot.java @@ -0,0 +1,37 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + + +/** + * + * A representation of the model object 'JDT Type Root'. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getJDTTypeRoot() + * @model abstract="true" + * @generated + */ +public interface JDTTypeRoot extends JDTParentJavaElement { +} // JDTTypeRoot diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmFactory.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmFactory.java new file mode 100644 index 00000000000..e257924008d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmFactory.java @@ -0,0 +1,217 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage + * @generated + */ +public interface JdtmmFactory extends EFactory { + + /** + * The singleton instance of the factory. + * + * + * + * @generated + */ + JdtmmFactory eINSTANCE = org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmFactoryImpl.init(); + + /** + * Returns a new object of class 'JDT Type Parameter'. + * + * + * + * @return a new object of class 'JDT Type Parameter'. + * @generated + */ + JDTTypeParameter createJDTTypeParameter(); + + /** + * Returns a new object of class 'JDT Field'. + * + * + * + * @return a new object of class 'JDT Field'. + * @generated + */ + JDTField createJDTField(); + + /** + * Returns a new object of class 'JDT Method'. + * + * + * + * @return a new object of class 'JDT Method'. + * @generated + */ + JDTMethod createJDTMethod(); + + /** + * Returns a new object of class 'JDT Class'. + * + * + * + * @return a new object of class 'JDT Class'. + * @generated + */ + JDTClass createJDTClass(); + + /** + * Returns a new object of class 'JDT Interface'. + * + * + * + * @return a new object of class 'JDT Interface'. + * @generated + */ + JDTInterface createJDTInterface(); + + /** + * Returns a new object of class 'JDT Enum'. + * + * + * + * @return a new object of class 'JDT Enum'. + * @generated + */ + JDTEnum createJDTEnum(); + + /** + * Returns a new object of class 'JDT Compilation Unit'. + * + * + * + * @return a new object of class 'JDT Compilation Unit'. + * @generated + */ + JDTCompilationUnit createJDTCompilationUnit(); + + /** + * Returns a new object of class 'JDT Import Declaration'. + * + * + * + * @return a new object of class 'JDT Import Declaration'. + * @generated + */ + JDTImportDeclaration createJDTImportDeclaration(); + + /** + * Returns a new object of class 'JDT Import Container'. + * + * + * + * @return a new object of class 'JDT Import Container'. + * @generated + */ + JDTImportContainer createJDTImportContainer(); + + /** + * Returns a new object of class 'JDT Parameter'. + * + * + * + * @return a new object of class 'JDT Parameter'. + * @generated + */ + JDTParameter createJDTParameter(); + + /** + * Returns a new object of class 'JDT Exception'. + * + * + * + * @return a new object of class 'JDT Exception'. + * @generated + */ + JDTException createJDTException(); + + /** + * Returns a new object of class 'JDT Opaque Body'. + * + * + * + * @return a new object of class 'JDT Opaque Body'. + * @generated + */ + JDTOpaqueBody createJDTOpaqueBody(); + + /** + * Returns a new object of class 'JDT Java Model'. + * + * + * + * @return a new object of class 'JDT Java Model'. + * @generated + */ + JDTJavaModel createJDTJavaModel(); + + /** + * Returns a new object of class 'JDT Package Fragment'. + * + * + * + * @return a new object of class 'JDT Package Fragment'. + * @generated + */ + JDTPackageFragment createJDTPackageFragment(); + + /** + * Returns a new object of class 'JDT Package Fragment Root'. + * + * + * + * @return a new object of class 'JDT Package Fragment Root'. + * @generated + */ + JDTPackageFragmentRoot createJDTPackageFragmentRoot(); + + /** + * Returns a new object of class 'JDT Java Project'. + * + * + * + * @return a new object of class 'JDT Java Project'. + * @generated + */ + JDTJavaProject createJDTJavaProject(); + + /** + * Returns the package supported by this factory. + * + * + * + * @return the package supported by this factory. + * @generated + */ + JdtmmPackage getJdtmmPackage(); + +} // JdtmmFactory diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmPackage.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmPackage.java new file mode 100644 index 00000000000..f69bbbaaebd --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/JdtmmPackage.java @@ -0,0 +1,5215 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
      + *
    • each class,
    • + *
    • each feature of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory + * @model kind="package" + * @generated + */ +public interface JdtmmPackage extends EPackage { + + /** + * The package name. + * + * + * + * @generated + */ + String eNAME = "jdtmm"; + + /** + * The package namespace URI. + * + * + * + * @generated + */ + String eNS_URI = "http:///jdtmm.ecore"; + + /** + * The package namespace name. + * + * + * + * @generated + */ + String eNS_PREFIX = "jdtmm"; + + /** + * The singleton instance of the package. + * + * + * + * @generated + */ + JdtmmPackage eINSTANCE = org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodBodyImpl JDT Method Body}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodBodyImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTMethodBody() + * @generated + */ + int JDT_METHOD_BODY = 0; + + /** + * The feature id for the 'Owner' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD_BODY__OWNER = 0; + + /** + * The number of structural features of the 'JDT Method Body' class. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD_BODY_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl JDT Java Element}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTJavaElement() + * @generated + */ + int JDT_JAVA_ELEMENT = 5; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_ELEMENT__ELEMENT_NAME = 0; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_ELEMENT__ELEMENT_TYPE = 1; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_ELEMENT__COMMENT = 2; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_ELEMENT__GENERATED = 3; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_ELEMENT__PARENT = 4; + + /** + * The number of structural features of the 'JDT Java Element' class. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_ELEMENT_FEATURE_COUNT = 5; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentImpl JDT Parent}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTParent() + * @generated + */ + int JDT_PARENT = 4; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentJavaElementImpl JDT Parent Java Element}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentJavaElementImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTParentJavaElement() + * @generated + */ + int JDT_PARENT_JAVA_ELEMENT = 3; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME = JDT_JAVA_ELEMENT__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE = JDT_JAVA_ELEMENT__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARENT_JAVA_ELEMENT__COMMENT = JDT_JAVA_ELEMENT__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARENT_JAVA_ELEMENT__GENERATED = JDT_JAVA_ELEMENT__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_PARENT_JAVA_ELEMENT__PARENT = JDT_JAVA_ELEMENT__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_PARENT_JAVA_ELEMENT__CHILDREN = JDT_JAVA_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARENT_JAVA_ELEMENT__FLAGS = JDT_JAVA_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'JDT Parent Java Element' class. + * + * + * + * @generated + * @ordered + */ + int JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT = JDT_JAVA_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl JDT Member}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTMember() + * @generated + */ + int JDT_MEMBER = 2; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_MEMBER__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_MEMBER__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_MEMBER__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_MEMBER__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_MEMBER__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_MEMBER__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_MEMBER__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; + + /** + * The feature id for the 'Type Parameters' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_MEMBER__TYPE_PARAMETERS = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Visibility' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_MEMBER__VISIBILITY = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Explicit Required Imports' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Explicit Plain Text Required Imports' attribute list. + * + * + * + * @generated + * @ordered + */ + int JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 3; + + /** + * The number of structural features of the 'JDT Member' class. + * + * + * + * @generated + * @ordered + */ + int JDT_MEMBER_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 4; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeParameterImpl JDT Type Parameter}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeParameterImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTTypeParameter() + * @generated + */ + int JDT_TYPE_PARAMETER = 6; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl JDT Field}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTField() + * @generated + */ + int JDT_FIELD = 8; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl JDT Type}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTType() + * @generated + */ + int JDT_TYPE = 7; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl JDT Method}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTMethod() + * @generated + */ + int JDT_METHOD = 1; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__ELEMENT_NAME = JDT_MEMBER__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__ELEMENT_TYPE = JDT_MEMBER__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__COMMENT = JDT_MEMBER__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__GENERATED = JDT_MEMBER__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__PARENT = JDT_MEMBER__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__CHILDREN = JDT_MEMBER__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__FLAGS = JDT_MEMBER__FLAGS; + + /** + * The feature id for the 'Type Parameters' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__TYPE_PARAMETERS = JDT_MEMBER__TYPE_PARAMETERS; + + /** + * The feature id for the 'Visibility' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__VISIBILITY = JDT_MEMBER__VISIBILITY; + + /** + * The feature id for the 'Explicit Required Imports' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__EXPLICIT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Explicit Plain Text Required Imports' attribute list. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Owner' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__OWNER = JDT_MEMBER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Return Type' containment reference. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__RETURN_TYPE = JDT_MEMBER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Parameters' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__PARAMETERS = JDT_MEMBER_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Abstract' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__ABSTRACT = JDT_MEMBER_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Final' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__FINAL = JDT_MEMBER_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Static' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__STATIC = JDT_MEMBER_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Exceptions' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__EXCEPTIONS = JDT_MEMBER_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Synchronized' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__SYNCHRONIZED = JDT_MEMBER_FEATURE_COUNT + 7; + + /** + * The feature id for the 'Constructor' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__CONSTRUCTOR = JDT_MEMBER_FEATURE_COUNT + 8; + + /** + * The feature id for the 'Bodies' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD__BODIES = JDT_MEMBER_FEATURE_COUNT + 9; + + /** + * The number of structural features of the 'JDT Method' class. + * + * + * + * @generated + * @ordered + */ + int JDT_METHOD_FEATURE_COUNT = JDT_MEMBER_FEATURE_COUNT + 10; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_PARENT__CHILDREN = 0; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARENT__FLAGS = 1; + + /** + * The number of structural features of the 'JDT Parent' class. + * + * + * + * @generated + * @ordered + */ + int JDT_PARENT_FEATURE_COUNT = 2; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_PARAMETER__ELEMENT_NAME = JDT_JAVA_ELEMENT__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_PARAMETER__ELEMENT_TYPE = JDT_JAVA_ELEMENT__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_PARAMETER__COMMENT = JDT_JAVA_ELEMENT__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_PARAMETER__GENERATED = JDT_JAVA_ELEMENT__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_PARAMETER__PARENT = JDT_JAVA_ELEMENT__PARENT; + + /** + * The feature id for the 'Declaring Member' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_PARAMETER__DECLARING_MEMBER = JDT_JAVA_ELEMENT_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'JDT Type Parameter' class. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_PARAMETER_FEATURE_COUNT = JDT_JAVA_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__ELEMENT_NAME = JDT_MEMBER__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__ELEMENT_TYPE = JDT_MEMBER__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__COMMENT = JDT_MEMBER__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__GENERATED = JDT_MEMBER__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__PARENT = JDT_MEMBER__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__CHILDREN = JDT_MEMBER__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__FLAGS = JDT_MEMBER__FLAGS; + + /** + * The feature id for the 'Type Parameters' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__TYPE_PARAMETERS = JDT_MEMBER__TYPE_PARAMETERS; + + /** + * The feature id for the 'Visibility' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__VISIBILITY = JDT_MEMBER__VISIBILITY; + + /** + * The feature id for the 'Explicit Required Imports' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__EXPLICIT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Explicit Plain Text Required Imports' attribute list. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Methods' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__METHODS = JDT_MEMBER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Fields' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__FIELDS = JDT_MEMBER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Compilation Unit' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__COMPILATION_UNIT = JDT_MEMBER_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Class' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__CLASS = JDT_MEMBER_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Interface' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__INTERFACE = JDT_MEMBER_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Enum' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__ENUM = JDT_MEMBER_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Abstract' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__ABSTRACT = JDT_MEMBER_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Final' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__FINAL = JDT_MEMBER_FEATURE_COUNT + 7; + + /** + * The feature id for the 'Static' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__STATIC = JDT_MEMBER_FEATURE_COUNT + 8; + + /** + * The feature id for the 'Types' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__TYPES = JDT_MEMBER_FEATURE_COUNT + 9; + + /** + * The feature id for the 'Owner' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__OWNER = JDT_MEMBER_FEATURE_COUNT + 10; + + /** + * The feature id for the 'Super Interfaces' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__SUPER_INTERFACES = JDT_MEMBER_FEATURE_COUNT + 11; + + /** + * The feature id for the 'Super Class' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__SUPER_CLASS = JDT_MEMBER_FEATURE_COUNT + 12; + + /** + * The feature id for the 'Super Interface Names' attribute list. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__SUPER_INTERFACE_NAMES = JDT_MEMBER_FEATURE_COUNT + 13; + + /** + * The feature id for the 'Super Class Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE__SUPER_CLASS_NAME = JDT_MEMBER_FEATURE_COUNT + 14; + + /** + * The number of structural features of the 'JDT Type' class. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_FEATURE_COUNT = JDT_MEMBER_FEATURE_COUNT + 15; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__ELEMENT_NAME = JDT_MEMBER__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__ELEMENT_TYPE = JDT_MEMBER__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__COMMENT = JDT_MEMBER__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__GENERATED = JDT_MEMBER__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__PARENT = JDT_MEMBER__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__CHILDREN = JDT_MEMBER__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__FLAGS = JDT_MEMBER__FLAGS; + + /** + * The feature id for the 'Type Parameters' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__TYPE_PARAMETERS = JDT_MEMBER__TYPE_PARAMETERS; + + /** + * The feature id for the 'Visibility' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__VISIBILITY = JDT_MEMBER__VISIBILITY; + + /** + * The feature id for the 'Explicit Required Imports' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__EXPLICIT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Explicit Plain Text Required Imports' attribute list. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Abstract' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__ABSTRACT = JDT_MEMBER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Final' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__FINAL = JDT_MEMBER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Static' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__STATIC = JDT_MEMBER_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Is Multi Valued' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__IS_MULTI_VALUED = JDT_MEMBER_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Type' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__TYPE = JDT_MEMBER_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Value' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__VALUE = JDT_MEMBER_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Generate Getter' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__GENERATE_GETTER = JDT_MEMBER_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Generate Setter' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__GENERATE_SETTER = JDT_MEMBER_FEATURE_COUNT + 7; + + /** + * The feature id for the 'Owner' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD__OWNER = JDT_MEMBER_FEATURE_COUNT + 8; + + /** + * The number of structural features of the 'JDT Field' class. + * + * + * + * @generated + * @ordered + */ + int JDT_FIELD_FEATURE_COUNT = JDT_MEMBER_FEATURE_COUNT + 9; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTClassImpl JDT Class}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTClassImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTClass() + * @generated + */ + int JDT_CLASS = 16; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTInterfaceImpl JDT Interface}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTInterfaceImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTInterface() + * @generated + */ + int JDT_INTERFACE = 17; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTEnumImpl JDT Enum}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTEnumImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTEnum() + * @generated + */ + int JDT_ENUM = 18; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeRootImpl JDT Type Root}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeRootImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTTypeRoot() + * @generated + */ + int JDT_TYPE_ROOT = 10; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl JDT Compilation Unit}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTCompilationUnit() + * @generated + */ + int JDT_COMPILATION_UNIT = 9; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportDeclarationImpl JDT Import Declaration}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportDeclarationImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTImportDeclaration() + * @generated + */ + int JDT_IMPORT_DECLARATION = 19; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportContainerImpl JDT Import Container}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportContainerImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTImportContainer() + * @generated + */ + int JDT_IMPORT_CONTAINER = 20; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl JDT Parameter}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTParameter() + * @generated + */ + int JDT_PARAMETER = 15; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl JDT Package Fragment}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTPackageFragment() + * @generated + */ + int JDT_PACKAGE_FRAGMENT = 11; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl JDT Package Fragment Root}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTPackageFragmentRoot() + * @generated + */ + int JDT_PACKAGE_FRAGMENT_ROOT = 12; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl JDT Java Project}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTJavaProject() + * @generated + */ + int JDT_JAVA_PROJECT = 13; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaModelImpl JDT Java Model}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaModelImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTJavaModel() + * @generated + */ + int JDT_JAVA_MODEL = 14; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_ROOT__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_ROOT__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_ROOT__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_ROOT__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_ROOT__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_ROOT__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_ROOT__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; + + /** + * The number of structural features of the 'JDT Type Root' class. + * + * + * + * @generated + * @ordered + */ + int JDT_TYPE_ROOT_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_COMPILATION_UNIT__ELEMENT_NAME = JDT_TYPE_ROOT__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_COMPILATION_UNIT__ELEMENT_TYPE = JDT_TYPE_ROOT__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_COMPILATION_UNIT__COMMENT = JDT_TYPE_ROOT__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_COMPILATION_UNIT__GENERATED = JDT_TYPE_ROOT__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_COMPILATION_UNIT__PARENT = JDT_TYPE_ROOT__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_COMPILATION_UNIT__CHILDREN = JDT_TYPE_ROOT__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_COMPILATION_UNIT__FLAGS = JDT_TYPE_ROOT__FLAGS; + + /** + * The feature id for the 'Package Fragment' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT = JDT_TYPE_ROOT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Types' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_COMPILATION_UNIT__TYPES = JDT_TYPE_ROOT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'JDT Compilation Unit' class. + * + * + * + * @generated + * @ordered + */ + int JDT_COMPILATION_UNIT_FEATURE_COUNT = JDT_TYPE_ROOT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; + + /** + * The feature id for the 'Package Fragment Root' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Compilation Units' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'JDT Package Fragment' class. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT_ROOT__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT_ROOT__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT_ROOT__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT_ROOT__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT_ROOT__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT_ROOT__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT_ROOT__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; + + /** + * The feature id for the 'Java Project' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Package Fragments' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'JDT Package Fragment Root' class. + * + * + * + * @generated + * @ordered + */ + int JDT_PACKAGE_FRAGMENT_ROOT_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_PROJECT__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_PROJECT__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_PROJECT__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_PROJECT__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_PROJECT__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_PROJECT__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_PROJECT__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; + + /** + * The feature id for the 'Java Model' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_PROJECT__JAVA_MODEL = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Package Fragment Roots' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'JDT Java Project' class. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_PROJECT_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_MODEL__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_MODEL__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_MODEL__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_MODEL__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_MODEL__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_MODEL__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_MODEL__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; + + /** + * The feature id for the 'Java Project' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_MODEL__JAVA_PROJECT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'JDT Java Model' class. + * + * + * + * @generated + * @ordered + */ + int JDT_JAVA_MODEL_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__ELEMENT_NAME = JDT_MEMBER__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__ELEMENT_TYPE = JDT_MEMBER__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__COMMENT = JDT_MEMBER__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__GENERATED = JDT_MEMBER__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__PARENT = JDT_MEMBER__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__CHILDREN = JDT_MEMBER__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__FLAGS = JDT_MEMBER__FLAGS; + + /** + * The feature id for the 'Type Parameters' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__TYPE_PARAMETERS = JDT_MEMBER__TYPE_PARAMETERS; + + /** + * The feature id for the 'Visibility' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__VISIBILITY = JDT_MEMBER__VISIBILITY; + + /** + * The feature id for the 'Explicit Required Imports' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__EXPLICIT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Explicit Plain Text Required Imports' attribute list. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Parameter Owner' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__PARAMETER_OWNER = JDT_MEMBER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Final' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__FINAL = JDT_MEMBER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Is Multi Valued' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__IS_MULTI_VALUED = JDT_MEMBER_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Type' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__TYPE = JDT_MEMBER_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Return Owner' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER__RETURN_OWNER = JDT_MEMBER_FEATURE_COUNT + 4; + + /** + * The number of structural features of the 'JDT Parameter' class. + * + * + * + * @generated + * @ordered + */ + int JDT_PARAMETER_FEATURE_COUNT = JDT_MEMBER_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__ELEMENT_NAME = JDT_TYPE__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__ELEMENT_TYPE = JDT_TYPE__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__COMMENT = JDT_TYPE__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__GENERATED = JDT_TYPE__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__PARENT = JDT_TYPE__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__CHILDREN = JDT_TYPE__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__FLAGS = JDT_TYPE__FLAGS; + + /** + * The feature id for the 'Type Parameters' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__TYPE_PARAMETERS = JDT_TYPE__TYPE_PARAMETERS; + + /** + * The feature id for the 'Visibility' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__VISIBILITY = JDT_TYPE__VISIBILITY; + + /** + * The feature id for the 'Explicit Required Imports' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__EXPLICIT_REQUIRED_IMPORTS = JDT_TYPE__EXPLICIT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Explicit Plain Text Required Imports' attribute list. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_TYPE__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Methods' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__METHODS = JDT_TYPE__METHODS; + + /** + * The feature id for the 'Fields' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__FIELDS = JDT_TYPE__FIELDS; + + /** + * The feature id for the 'Compilation Unit' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__COMPILATION_UNIT = JDT_TYPE__COMPILATION_UNIT; + + /** + * The feature id for the 'Class' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__CLASS = JDT_TYPE__CLASS; + + /** + * The feature id for the 'Interface' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__INTERFACE = JDT_TYPE__INTERFACE; + + /** + * The feature id for the 'Enum' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__ENUM = JDT_TYPE__ENUM; + + /** + * The feature id for the 'Abstract' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__ABSTRACT = JDT_TYPE__ABSTRACT; + + /** + * The feature id for the 'Final' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__FINAL = JDT_TYPE__FINAL; + + /** + * The feature id for the 'Static' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__STATIC = JDT_TYPE__STATIC; + + /** + * The feature id for the 'Types' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__TYPES = JDT_TYPE__TYPES; + + /** + * The feature id for the 'Owner' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__OWNER = JDT_TYPE__OWNER; + + /** + * The feature id for the 'Super Interfaces' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__SUPER_INTERFACES = JDT_TYPE__SUPER_INTERFACES; + + /** + * The feature id for the 'Super Class' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__SUPER_CLASS = JDT_TYPE__SUPER_CLASS; + + /** + * The feature id for the 'Super Interface Names' attribute list. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__SUPER_INTERFACE_NAMES = JDT_TYPE__SUPER_INTERFACE_NAMES; + + /** + * The feature id for the 'Super Class Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS__SUPER_CLASS_NAME = JDT_TYPE__SUPER_CLASS_NAME; + + /** + * The number of structural features of the 'JDT Class' class. + * + * + * + * @generated + * @ordered + */ + int JDT_CLASS_FEATURE_COUNT = JDT_TYPE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__ELEMENT_NAME = JDT_TYPE__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__ELEMENT_TYPE = JDT_TYPE__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__COMMENT = JDT_TYPE__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__GENERATED = JDT_TYPE__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__PARENT = JDT_TYPE__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__CHILDREN = JDT_TYPE__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__FLAGS = JDT_TYPE__FLAGS; + + /** + * The feature id for the 'Type Parameters' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__TYPE_PARAMETERS = JDT_TYPE__TYPE_PARAMETERS; + + /** + * The feature id for the 'Visibility' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__VISIBILITY = JDT_TYPE__VISIBILITY; + + /** + * The feature id for the 'Explicit Required Imports' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__EXPLICIT_REQUIRED_IMPORTS = JDT_TYPE__EXPLICIT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Explicit Plain Text Required Imports' attribute list. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_TYPE__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Methods' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__METHODS = JDT_TYPE__METHODS; + + /** + * The feature id for the 'Fields' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__FIELDS = JDT_TYPE__FIELDS; + + /** + * The feature id for the 'Compilation Unit' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__COMPILATION_UNIT = JDT_TYPE__COMPILATION_UNIT; + + /** + * The feature id for the 'Class' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__CLASS = JDT_TYPE__CLASS; + + /** + * The feature id for the 'Interface' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__INTERFACE = JDT_TYPE__INTERFACE; + + /** + * The feature id for the 'Enum' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__ENUM = JDT_TYPE__ENUM; + + /** + * The feature id for the 'Abstract' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__ABSTRACT = JDT_TYPE__ABSTRACT; + + /** + * The feature id for the 'Final' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__FINAL = JDT_TYPE__FINAL; + + /** + * The feature id for the 'Static' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__STATIC = JDT_TYPE__STATIC; + + /** + * The feature id for the 'Types' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__TYPES = JDT_TYPE__TYPES; + + /** + * The feature id for the 'Owner' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__OWNER = JDT_TYPE__OWNER; + + /** + * The feature id for the 'Super Interfaces' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__SUPER_INTERFACES = JDT_TYPE__SUPER_INTERFACES; + + /** + * The feature id for the 'Super Class' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__SUPER_CLASS = JDT_TYPE__SUPER_CLASS; + + /** + * The feature id for the 'Super Interface Names' attribute list. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__SUPER_INTERFACE_NAMES = JDT_TYPE__SUPER_INTERFACE_NAMES; + + /** + * The feature id for the 'Super Class Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE__SUPER_CLASS_NAME = JDT_TYPE__SUPER_CLASS_NAME; + + /** + * The number of structural features of the 'JDT Interface' class. + * + * + * + * @generated + * @ordered + */ + int JDT_INTERFACE_FEATURE_COUNT = JDT_TYPE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__ELEMENT_NAME = JDT_TYPE__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__ELEMENT_TYPE = JDT_TYPE__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__COMMENT = JDT_TYPE__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__GENERATED = JDT_TYPE__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__PARENT = JDT_TYPE__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__CHILDREN = JDT_TYPE__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__FLAGS = JDT_TYPE__FLAGS; + + /** + * The feature id for the 'Type Parameters' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__TYPE_PARAMETERS = JDT_TYPE__TYPE_PARAMETERS; + + /** + * The feature id for the 'Visibility' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__VISIBILITY = JDT_TYPE__VISIBILITY; + + /** + * The feature id for the 'Explicit Required Imports' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__EXPLICIT_REQUIRED_IMPORTS = JDT_TYPE__EXPLICIT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Explicit Plain Text Required Imports' attribute list. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JDT_TYPE__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS; + + /** + * The feature id for the 'Methods' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__METHODS = JDT_TYPE__METHODS; + + /** + * The feature id for the 'Fields' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__FIELDS = JDT_TYPE__FIELDS; + + /** + * The feature id for the 'Compilation Unit' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__COMPILATION_UNIT = JDT_TYPE__COMPILATION_UNIT; + + /** + * The feature id for the 'Class' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__CLASS = JDT_TYPE__CLASS; + + /** + * The feature id for the 'Interface' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__INTERFACE = JDT_TYPE__INTERFACE; + + /** + * The feature id for the 'Enum' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__ENUM = JDT_TYPE__ENUM; + + /** + * The feature id for the 'Abstract' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__ABSTRACT = JDT_TYPE__ABSTRACT; + + /** + * The feature id for the 'Final' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__FINAL = JDT_TYPE__FINAL; + + /** + * The feature id for the 'Static' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__STATIC = JDT_TYPE__STATIC; + + /** + * The feature id for the 'Types' containment reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__TYPES = JDT_TYPE__TYPES; + + /** + * The feature id for the 'Owner' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__OWNER = JDT_TYPE__OWNER; + + /** + * The feature id for the 'Super Interfaces' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__SUPER_INTERFACES = JDT_TYPE__SUPER_INTERFACES; + + /** + * The feature id for the 'Super Class' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__SUPER_CLASS = JDT_TYPE__SUPER_CLASS; + + /** + * The feature id for the 'Super Interface Names' attribute list. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__SUPER_INTERFACE_NAMES = JDT_TYPE__SUPER_INTERFACE_NAMES; + + /** + * The feature id for the 'Super Class Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM__SUPER_CLASS_NAME = JDT_TYPE__SUPER_CLASS_NAME; + + /** + * The number of structural features of the 'JDT Enum' class. + * + * + * + * @generated + * @ordered + */ + int JDT_ENUM_FEATURE_COUNT = JDT_TYPE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_DECLARATION__ELEMENT_NAME = JDT_JAVA_ELEMENT__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_DECLARATION__ELEMENT_TYPE = JDT_JAVA_ELEMENT__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_DECLARATION__COMMENT = JDT_JAVA_ELEMENT__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_DECLARATION__GENERATED = JDT_JAVA_ELEMENT__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_DECLARATION__PARENT = JDT_JAVA_ELEMENT__PARENT; + + /** + * The number of structural features of the 'JDT Import Declaration' class. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_DECLARATION_FEATURE_COUNT = JDT_JAVA_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Element Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_CONTAINER__ELEMENT_NAME = JDT_PARENT_JAVA_ELEMENT__ELEMENT_NAME; + + /** + * The feature id for the 'Element Type' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_CONTAINER__ELEMENT_TYPE = JDT_PARENT_JAVA_ELEMENT__ELEMENT_TYPE; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_CONTAINER__COMMENT = JDT_PARENT_JAVA_ELEMENT__COMMENT; + + /** + * The feature id for the 'Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_CONTAINER__GENERATED = JDT_PARENT_JAVA_ELEMENT__GENERATED; + + /** + * The feature id for the 'Parent' reference. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_CONTAINER__PARENT = JDT_PARENT_JAVA_ELEMENT__PARENT; + + /** + * The feature id for the 'Children' reference list. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_CONTAINER__CHILDREN = JDT_PARENT_JAVA_ELEMENT__CHILDREN; + + /** + * The feature id for the 'Flags' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_CONTAINER__FLAGS = JDT_PARENT_JAVA_ELEMENT__FLAGS; + + /** + * The number of structural features of the 'JDT Import Container' class. + * + * + * + * @generated + * @ordered + */ + int JDT_IMPORT_CONTAINER_FEATURE_COUNT = JDT_PARENT_JAVA_ELEMENT_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTExceptionImpl JDT Exception}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTExceptionImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTException() + * @generated + */ + int JDT_EXCEPTION = 21; + + /** + * The number of structural features of the 'JDT Exception' class. + * + * + * + * @generated + * @ordered + */ + int JDT_EXCEPTION_FEATURE_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTOpaqueBodyImpl JDT Opaque Body}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTOpaqueBodyImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTOpaqueBody() + * @generated + */ + int JDT_OPAQUE_BODY = 22; + + /** + * The feature id for the 'Owner' container reference. + * + * + * + * @generated + * @ordered + */ + int JDT_OPAQUE_BODY__OWNER = JDT_METHOD_BODY__OWNER; + + /** + * The feature id for the 'body' attribute. + * + * + * + * @generated + * @ordered + */ + int JDT_OPAQUE_BODY__BODY = JDT_METHOD_BODY_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'JDT Opaque Body' class. + * + * + * + * @generated + * @ordered + */ + int JDT_OPAQUE_BODY_FEATURE_COUNT = JDT_METHOD_BODY_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind Visibility Kind}' enum. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getVisibilityKind() + * @generated + */ + int VISIBILITY_KIND = 23; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault True False Default}' enum. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getTrueFalseDefault() + * @generated + */ + int TRUE_FALSE_DEFAULT = 24; + + /** + * The meta object id for the 'boolean' data type. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getboolean() + * @generated + */ + int BOOLEAN = 27; + + /** + * The meta object id for the 'int' data type. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getint() + * @generated + */ + int INT = 26; + + /** + * The meta object id for the 'String' data type. + * + * + * + * @see java.lang.String + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getString() + * @generated + */ + int STRING = 25; + + + /** + * The meta object id for the 'JDT Visitor Exception' data type. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTVisitorException() + * @generated + */ + int JDT_VISITOR_EXCEPTION = 28; + + /** + * The meta object id for the 'Visitor' data type. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getVisitor() + * @generated + */ + int VISITOR = 29; + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody JDT Method Body}'. + * + * + * + * @return the meta object for class 'JDT Method Body'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody + * @generated + */ + EClass getJDTMethodBody(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody#getOwner Owner}'. + * + * + * + * @return the meta object for the container reference 'Owner'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody#getOwner() + * @see #getJDTMethodBody() + * @generated + */ + EReference getJDTMethodBody_Owner(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement JDT Java Element}'. + * + * + * + * @return the meta object for class 'JDT Java Element'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement + * @generated + */ + EClass getJDTJavaElement(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent Parent}'. + * + * + * + * @return the meta object for the reference 'Parent'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getParent() + * @see #getJDTJavaElement() + * @generated + */ + EReference getJDTJavaElement_Parent(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementName Element Name}'. + * + * + * + * @return the meta object for the attribute 'Element Name'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementName() + * @see #getJDTJavaElement() + * @generated + */ + EAttribute getJDTJavaElement_ElementName(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementType Element Type}'. + * + * + * + * @return the meta object for the attribute 'Element Type'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getElementType() + * @see #getJDTJavaElement() + * @generated + */ + EAttribute getJDTJavaElement_ElementType(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getComment Comment}'. + * + * + * + * @return the meta object for the attribute 'Comment'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#getComment() + * @see #getJDTJavaElement() + * @generated + */ + EAttribute getJDTJavaElement_Comment(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#isGenerated Generated}'. + * + * + * + * @return the meta object for the attribute 'Generated'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement#isGenerated() + * @see #getJDTJavaElement() + * @generated + */ + EAttribute getJDTJavaElement_Generated(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent JDT Parent}'. + * + * + * + * @return the meta object for class 'JDT Parent'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent + * @generated + */ + EClass getJDTParent(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getFlags Flags}'. + * + * + * + * @return the meta object for the attribute 'Flags'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getFlags() + * @see #getJDTParent() + * @generated + */ + EAttribute getJDTParent_Flags(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren Children}'. + * + * + * + * @return the meta object for the reference list 'Children'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent#getChildren() + * @see #getJDTParent() + * @generated + */ + EReference getJDTParent_Children(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember JDT Member}'. + * + * + * + * @return the meta object for class 'JDT Member'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember + * @generated + */ + EClass getJDTMember(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getTypeParameters Type Parameters}'. + * + * + * + * @return the meta object for the containment reference list 'Type Parameters'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getTypeParameters() + * @see #getJDTMember() + * @generated + */ + EReference getJDTMember_TypeParameters(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getVisibility Visibility}'. + * + * + * + * @return the meta object for the attribute 'Visibility'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getVisibility() + * @see #getJDTMember() + * @generated + */ + EAttribute getJDTMember_Visibility(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getExplicitRequiredImports Explicit Required Imports}'. + * + * + * + * @return the meta object for the reference list 'Explicit Required Imports'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getExplicitRequiredImports() + * @see #getJDTMember() + * @generated + */ + EReference getJDTMember_ExplicitRequiredImports(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}'. + * + * + * + * @return the meta object for the attribute list 'Explicit Plain Text Required Imports'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember#getExplicitPlainTextRequiredImports() + * @see #getJDTMember() + * @generated + */ + EAttribute getJDTMember_ExplicitPlainTextRequiredImports(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement JDT Parent Java Element}'. + * + * + * + * @return the meta object for class 'JDT Parent Java Element'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement + * @generated + */ + EClass getJDTParentJavaElement(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter JDT Type Parameter}'. + * + * + * + * @return the meta object for class 'JDT Type Parameter'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter + * @generated + */ + EClass getJDTTypeParameter(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter#getDeclaringMember Declaring Member}'. + * + * + * + * @return the meta object for the container reference 'Declaring Member'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter#getDeclaringMember() + * @see #getJDTTypeParameter() + * @generated + */ + EReference getJDTTypeParameter_DeclaringMember(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField JDT Field}'. + * + * + * + * @return the meta object for class 'JDT Field'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField + * @generated + */ + EClass getJDTField(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getOwner Owner}'. + * + * + * + * @return the meta object for the container reference 'Owner'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getOwner() + * @see #getJDTField() + * @generated + */ + EReference getJDTField_Owner(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getType Type}'. + * + * + * + * @return the meta object for the reference 'Type'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getType() + * @see #getJDTField() + * @generated + */ + EReference getJDTField_Type(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getValue Value}'. + * + * + * + * @return the meta object for the attribute 'Value'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getValue() + * @see #getJDTField() + * @generated + */ + EAttribute getJDTField_Value(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateGetter Generate Getter}'. + * + * + * + * @return the meta object for the attribute 'Generate Getter'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateGetter() + * @see #getJDTField() + * @generated + */ + EAttribute getJDTField_GenerateGetter(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateSetter Generate Setter}'. + * + * + * + * @return the meta object for the attribute 'Generate Setter'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#getGenerateSetter() + * @see #getJDTField() + * @generated + */ + EAttribute getJDTField_GenerateSetter(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isAbstract Abstract}'. + * + * + * + * @return the meta object for the attribute 'Abstract'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isAbstract() + * @see #getJDTField() + * @generated + */ + EAttribute getJDTField_Abstract(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isFinal Final}'. + * + * + * + * @return the meta object for the attribute 'Final'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isFinal() + * @see #getJDTField() + * @generated + */ + EAttribute getJDTField_Final(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isStatic Static}'. + * + * + * + * @return the meta object for the attribute 'Static'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isStatic() + * @see #getJDTField() + * @generated + */ + EAttribute getJDTField_Static(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isMultiValued Is Multi Valued}'. + * + * + * + * @return the meta object for the attribute 'Is Multi Valued'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField#isMultiValued() + * @see #getJDTField() + * @generated + */ + EAttribute getJDTField_IsMultiValued(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType JDT Type}'. + * + * + * + * @return the meta object for class 'JDT Type'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType + * @generated + */ + EClass getJDTType(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getMethods Methods}'. + * + * + * + * @return the meta object for the containment reference list 'Methods'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getMethods() + * @see #getJDTType() + * @generated + */ + EReference getJDTType_Methods(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getCompilationUnit Compilation Unit}'. + * + * + * + * @return the meta object for the container reference 'Compilation Unit'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getCompilationUnit() + * @see #getJDTType() + * @generated + */ + EReference getJDTType_CompilationUnit(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isClass Class}'. + * + * + * + * @return the meta object for the attribute 'Class'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isClass() + * @see #getJDTType() + * @generated + */ + EAttribute getJDTType_Class(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isInterface Interface}'. + * + * + * + * @return the meta object for the attribute 'Interface'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isInterface() + * @see #getJDTType() + * @generated + */ + EAttribute getJDTType_Interface(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isEnum Enum}'. + * + * + * + * @return the meta object for the attribute 'Enum'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isEnum() + * @see #getJDTType() + * @generated + */ + EAttribute getJDTType_Enum(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isAbstract Abstract}'. + * + * + * + * @return the meta object for the attribute 'Abstract'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isAbstract() + * @see #getJDTType() + * @generated + */ + EAttribute getJDTType_Abstract(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isFinal Final}'. + * + * + * + * @return the meta object for the attribute 'Final'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isFinal() + * @see #getJDTType() + * @generated + */ + EAttribute getJDTType_Final(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isStatic Static}'. + * + * + * + * @return the meta object for the attribute 'Static'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#isStatic() + * @see #getJDTType() + * @generated + */ + EAttribute getJDTType_Static(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getTypes Types}'. + * + * + * + * @return the meta object for the containment reference list 'Types'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getTypes() + * @see #getJDTType() + * @generated + */ + EReference getJDTType_Types(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getOwner Owner}'. + * + * + * + * @return the meta object for the container reference 'Owner'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getOwner() + * @see #getJDTType() + * @generated + */ + EReference getJDTType_Owner(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperInterfaces Super Interfaces}'. + * + * + * + * @return the meta object for the reference list 'Super Interfaces'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperInterfaces() + * @see #getJDTType() + * @generated + */ + EReference getJDTType_SuperInterfaces(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClass Super Class}'. + * + * + * + * @return the meta object for the reference 'Super Class'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClass() + * @see #getJDTType() + * @generated + */ + EReference getJDTType_SuperClass(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperInterfaceNames Super Interface Names}'. + * + * + * + * @return the meta object for the attribute list 'Super Interface Names'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperInterfaceNames() + * @see #getJDTType() + * @generated + */ + EAttribute getJDTType_SuperInterfaceNames(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClassName Super Class Name}'. + * + * + * + * @return the meta object for the attribute 'Super Class Name'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getSuperClassName() + * @see #getJDTType() + * @generated + */ + EAttribute getJDTType_SuperClassName(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getFields Fields}'. + * + * + * + * @return the meta object for the containment reference list 'Fields'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType#getFields() + * @see #getJDTType() + * @generated + */ + EReference getJDTType_Fields(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod JDT Method}'. + * + * + * + * @return the meta object for class 'JDT Method'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod + * @generated + */ + EClass getJDTMethod(); + + /** + * Returns the meta object for the containment reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getReturnType Return Type}'. + * + * + * + * @return the meta object for the containment reference 'Return Type'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getReturnType() + * @see #getJDTMethod() + * @generated + */ + EReference getJDTMethod_ReturnType(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getParameters Parameters}'. + * + * + * + * @return the meta object for the containment reference list 'Parameters'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getParameters() + * @see #getJDTMethod() + * @generated + */ + EReference getJDTMethod_Parameters(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getExceptions Exceptions}'. + * + * + * + * @return the meta object for the reference list 'Exceptions'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getExceptions() + * @see #getJDTMethod() + * @generated + */ + EReference getJDTMethod_Exceptions(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isSynchronized Synchronized}'. + * + * + * + * @return the meta object for the attribute 'Synchronized'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isSynchronized() + * @see #getJDTMethod() + * @generated + */ + EAttribute getJDTMethod_Synchronized(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isConstructor Constructor}'. + * + * + * + * @return the meta object for the attribute 'Constructor'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isConstructor() + * @see #getJDTMethod() + * @generated + */ + EAttribute getJDTMethod_Constructor(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getBodies Bodies}'. + * + * + * + * @return the meta object for the containment reference list 'Bodies'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getBodies() + * @see #getJDTMethod() + * @generated + */ + EReference getJDTMethod_Bodies(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isAbstract Abstract}'. + * + * + * + * @return the meta object for the attribute 'Abstract'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isAbstract() + * @see #getJDTMethod() + * @generated + */ + EAttribute getJDTMethod_Abstract(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isFinal Final}'. + * + * + * + * @return the meta object for the attribute 'Final'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isFinal() + * @see #getJDTMethod() + * @generated + */ + EAttribute getJDTMethod_Final(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isStatic Static}'. + * + * + * + * @return the meta object for the attribute 'Static'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#isStatic() + * @see #getJDTMethod() + * @generated + */ + EAttribute getJDTMethod_Static(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getOwner Owner}'. + * + * + * + * @return the meta object for the container reference 'Owner'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod#getOwner() + * @see #getJDTMethod() + * @generated + */ + EReference getJDTMethod_Owner(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass JDT Class}'. + * + * + * + * @return the meta object for class 'JDT Class'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass + * @generated + */ + EClass getJDTClass(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface JDT Interface}'. + * + * + * + * @return the meta object for class 'JDT Interface'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface + * @generated + */ + EClass getJDTInterface(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum JDT Enum}'. + * + * + * + * @return the meta object for class 'JDT Enum'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum + * @generated + */ + EClass getJDTEnum(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot JDT Type Root}'. + * + * + * + * @return the meta object for class 'JDT Type Root'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot + * @generated + */ + EClass getJDTTypeRoot(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit JDT Compilation Unit}'. + * + * + * + * @return the meta object for class 'JDT Compilation Unit'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit + * @generated + */ + EClass getJDTCompilationUnit(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getPackageFragment Package Fragment}'. + * + * + * + * @return the meta object for the container reference 'Package Fragment'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getPackageFragment() + * @see #getJDTCompilationUnit() + * @generated + */ + EReference getJDTCompilationUnit_PackageFragment(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getTypes Types}'. + * + * + * + * @return the meta object for the containment reference list 'Types'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit#getTypes() + * @see #getJDTCompilationUnit() + * @generated + */ + EReference getJDTCompilationUnit_Types(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration JDT Import Declaration}'. + * + * + * + * @return the meta object for class 'JDT Import Declaration'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration + * @generated + */ + EClass getJDTImportDeclaration(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer JDT Import Container}'. + * + * + * + * @return the meta object for class 'JDT Import Container'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer + * @generated + */ + EClass getJDTImportContainer(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter JDT Parameter}'. + * + * + * + * @return the meta object for class 'JDT Parameter'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter + * @generated + */ + EClass getJDTParameter(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getParameterOwner Parameter Owner}'. + * + * + * + * @return the meta object for the container reference 'Parameter Owner'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getParameterOwner() + * @see #getJDTParameter() + * @generated + */ + EReference getJDTParameter_ParameterOwner(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isFinal Final}'. + * + * + * + * @return the meta object for the attribute 'Final'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isFinal() + * @see #getJDTParameter() + * @generated + */ + EAttribute getJDTParameter_Final(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isMultiValued Is Multi Valued}'. + * + * + * + * @return the meta object for the attribute 'Is Multi Valued'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#isMultiValued() + * @see #getJDTParameter() + * @generated + */ + EAttribute getJDTParameter_IsMultiValued(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getType Type}'. + * + * + * + * @return the meta object for the reference 'Type'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getType() + * @see #getJDTParameter() + * @generated + */ + EReference getJDTParameter_Type(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getReturnOwner Return Owner}'. + * + * + * + * @return the meta object for the container reference 'Return Owner'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter#getReturnOwner() + * @see #getJDTParameter() + * @generated + */ + EReference getJDTParameter_ReturnOwner(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException JDT Exception}'. + * + * + * + * @return the meta object for class 'JDT Exception'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException + * @generated + */ + EClass getJDTException(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody JDT Opaque Body}'. + * + * + * + * @return the meta object for class 'JDT Opaque Body'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody + * @generated + */ + EClass getJDTOpaqueBody(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody#get_body body}'. + * + * + * + * @return the meta object for the attribute 'body'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody#get_body() + * @see #getJDTOpaqueBody() + * @generated + */ + EAttribute getJDTOpaqueBody__body(); + + /** + * Returns the meta object for enum '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind Visibility Kind}'. + * + * + * + * @return the meta object for enum 'Visibility Kind'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind + * @generated + */ + EEnum getVisibilityKind(); + + /** + * Returns the meta object for enum '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault True False Default}'. + * + * + * + * @return the meta object for enum 'True False Default'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault + * @generated + */ + EEnum getTrueFalseDefault(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel JDT Java Model}'. + * + * + * + * @return the meta object for class 'JDT Java Model'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel + * @generated + */ + EClass getJDTJavaModel(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel#getJavaProject Java Project}'. + * + * + * + * @return the meta object for the containment reference list 'Java Project'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel#getJavaProject() + * @see #getJDTJavaModel() + * @generated + */ + EReference getJDTJavaModel_JavaProject(); + + /** + * Returns the meta object for data type 'boolean'. + * + * + * + * @return the meta object for data type 'boolean'. + * @model instanceClass="boolean" + * @generated + */ + EDataType getboolean(); + + /** + * Returns the meta object for data type 'int'. + * + * + * + * @return the meta object for data type 'int'. + * @model instanceClass="int" + * @generated + */ + EDataType getint(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment JDT Package Fragment}'. + * + * + * + * @return the meta object for class 'JDT Package Fragment'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment + * @generated + */ + EClass getJDTPackageFragment(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getPackageFragmentRoot Package Fragment Root}'. + * + * + * + * @return the meta object for the container reference 'Package Fragment Root'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getPackageFragmentRoot() + * @see #getJDTPackageFragment() + * @generated + */ + EReference getJDTPackageFragment_PackageFragmentRoot(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getCompilationUnits Compilation Units}'. + * + * + * + * @return the meta object for the containment reference list 'Compilation Units'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment#getCompilationUnits() + * @see #getJDTPackageFragment() + * @generated + */ + EReference getJDTPackageFragment_CompilationUnits(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot JDT Package Fragment Root}'. + * + * + * + * @return the meta object for class 'JDT Package Fragment Root'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot + * @generated + */ + EClass getJDTPackageFragmentRoot(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getJavaProject Java Project}'. + * + * + * + * @return the meta object for the container reference 'Java Project'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getJavaProject() + * @see #getJDTPackageFragmentRoot() + * @generated + */ + EReference getJDTPackageFragmentRoot_JavaProject(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getPackageFragments Package Fragments}'. + * + * + * + * @return the meta object for the containment reference list 'Package Fragments'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot#getPackageFragments() + * @see #getJDTPackageFragmentRoot() + * @generated + */ + EReference getJDTPackageFragmentRoot_PackageFragments(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject JDT Java Project}'. + * + * + * + * @return the meta object for class 'JDT Java Project'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject + * @generated + */ + EClass getJDTJavaProject(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getJavaModel Java Model}'. + * + * + * + * @return the meta object for the container reference 'Java Model'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getJavaModel() + * @see #getJDTJavaProject() + * @generated + */ + EReference getJDTJavaProject_JavaModel(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getPackageFragmentRoots Package Fragment Roots}'. + * + * + * + * @return the meta object for the containment reference list 'Package Fragment Roots'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject#getPackageFragmentRoots() + * @see #getJDTJavaProject() + * @generated + */ + EReference getJDTJavaProject_PackageFragmentRoots(); + + /** + * Returns the meta object for data type '{@link java.lang.String String}'. + * + * + * + * @return the meta object for data type 'String'. + * @see java.lang.String + * @model instanceClass="java.lang.String" + * @generated + */ + EDataType getString(); + + /** + * Returns the meta object for data type '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException JDT Visitor Exception}'. + * + * + * + * @return the meta object for data type 'JDT Visitor Exception'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException + * @model instanceClass="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException" + * @generated + */ + EDataType getJDTVisitorException(); + + /** + * Returns the meta object for data type '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor Visitor}'. + * + * + * + * @return the meta object for data type 'Visitor'. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor + * @model instanceClass="org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor" + * @generated + */ + EDataType getVisitor(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + JdtmmFactory getJdtmmFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
      + *
    • each class,
    • + *
    • each feature of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * + * @generated + */ + interface Literals { + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodBodyImpl JDT Method Body}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodBodyImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTMethodBody() + * @generated + */ + EClass JDT_METHOD_BODY = eINSTANCE.getJDTMethodBody(); + + /** + * The meta object literal for the 'Owner' container reference feature. + * + * + * + * @generated + */ + EReference JDT_METHOD_BODY__OWNER = eINSTANCE.getJDTMethodBody_Owner(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl JDT Java Element}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTJavaElement() + * @generated + */ + EClass JDT_JAVA_ELEMENT = eINSTANCE.getJDTJavaElement(); + + /** + * The meta object literal for the 'Parent' reference feature. + * + * + * + * @generated + */ + EReference JDT_JAVA_ELEMENT__PARENT = eINSTANCE.getJDTJavaElement_Parent(); + + /** + * The meta object literal for the 'Element Name' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_JAVA_ELEMENT__ELEMENT_NAME = eINSTANCE.getJDTJavaElement_ElementName(); + + /** + * The meta object literal for the 'Element Type' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_JAVA_ELEMENT__ELEMENT_TYPE = eINSTANCE.getJDTJavaElement_ElementType(); + + /** + * The meta object literal for the 'Comment' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_JAVA_ELEMENT__COMMENT = eINSTANCE.getJDTJavaElement_Comment(); + + /** + * The meta object literal for the 'Generated' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_JAVA_ELEMENT__GENERATED = eINSTANCE.getJDTJavaElement_Generated(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentImpl JDT Parent}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTParent() + * @generated + */ + EClass JDT_PARENT = eINSTANCE.getJDTParent(); + + /** + * The meta object literal for the 'Flags' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_PARENT__FLAGS = eINSTANCE.getJDTParent_Flags(); + + /** + * The meta object literal for the 'Children' reference list feature. + * + * + * + * @generated + */ + EReference JDT_PARENT__CHILDREN = eINSTANCE.getJDTParent_Children(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl JDT Member}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTMember() + * @generated + */ + EClass JDT_MEMBER = eINSTANCE.getJDTMember(); + + /** + * The meta object literal for the 'Type Parameters' containment reference list feature. + * + * + * + * @generated + */ + EReference JDT_MEMBER__TYPE_PARAMETERS = eINSTANCE.getJDTMember_TypeParameters(); + + /** + * The meta object literal for the 'Visibility' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_MEMBER__VISIBILITY = eINSTANCE.getJDTMember_Visibility(); + + /** + * The meta object literal for the 'Explicit Required Imports' reference list feature. + * + * + * + * @generated + */ + EReference JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS = eINSTANCE.getJDTMember_ExplicitRequiredImports(); + + /** + * The meta object literal for the 'Explicit Plain Text Required Imports' attribute list feature. + * + * + * + * @generated + */ + EAttribute JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = eINSTANCE.getJDTMember_ExplicitPlainTextRequiredImports(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentJavaElementImpl JDT Parent Java Element}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentJavaElementImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTParentJavaElement() + * @generated + */ + EClass JDT_PARENT_JAVA_ELEMENT = eINSTANCE.getJDTParentJavaElement(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeParameterImpl JDT Type Parameter}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeParameterImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTTypeParameter() + * @generated + */ + EClass JDT_TYPE_PARAMETER = eINSTANCE.getJDTTypeParameter(); + + /** + * The meta object literal for the 'Declaring Member' container reference feature. + * + * + * + * @generated + */ + EReference JDT_TYPE_PARAMETER__DECLARING_MEMBER = eINSTANCE.getJDTTypeParameter_DeclaringMember(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl JDT Field}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTField() + * @generated + */ + EClass JDT_FIELD = eINSTANCE.getJDTField(); + + /** + * The meta object literal for the 'Owner' container reference feature. + * + * + * + * @generated + */ + EReference JDT_FIELD__OWNER = eINSTANCE.getJDTField_Owner(); + + /** + * The meta object literal for the 'Type' reference feature. + * + * + * + * @generated + */ + EReference JDT_FIELD__TYPE = eINSTANCE.getJDTField_Type(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_FIELD__VALUE = eINSTANCE.getJDTField_Value(); + + /** + * The meta object literal for the 'Generate Getter' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_FIELD__GENERATE_GETTER = eINSTANCE.getJDTField_GenerateGetter(); + + /** + * The meta object literal for the 'Generate Setter' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_FIELD__GENERATE_SETTER = eINSTANCE.getJDTField_GenerateSetter(); + + /** + * The meta object literal for the 'Abstract' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_FIELD__ABSTRACT = eINSTANCE.getJDTField_Abstract(); + + /** + * The meta object literal for the 'Final' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_FIELD__FINAL = eINSTANCE.getJDTField_Final(); + + /** + * The meta object literal for the 'Static' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_FIELD__STATIC = eINSTANCE.getJDTField_Static(); + + /** + * The meta object literal for the 'Is Multi Valued' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_FIELD__IS_MULTI_VALUED = eINSTANCE.getJDTField_IsMultiValued(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl JDT Type}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTType() + * @generated + */ + EClass JDT_TYPE = eINSTANCE.getJDTType(); + + /** + * The meta object literal for the 'Methods' containment reference list feature. + * + * + * + * @generated + */ + EReference JDT_TYPE__METHODS = eINSTANCE.getJDTType_Methods(); + + /** + * The meta object literal for the 'Compilation Unit' container reference feature. + * + * + * + * @generated + */ + EReference JDT_TYPE__COMPILATION_UNIT = eINSTANCE.getJDTType_CompilationUnit(); + + /** + * The meta object literal for the 'Class' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_TYPE__CLASS = eINSTANCE.getJDTType_Class(); + + /** + * The meta object literal for the 'Interface' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_TYPE__INTERFACE = eINSTANCE.getJDTType_Interface(); + + /** + * The meta object literal for the 'Enum' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_TYPE__ENUM = eINSTANCE.getJDTType_Enum(); + + /** + * The meta object literal for the 'Abstract' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_TYPE__ABSTRACT = eINSTANCE.getJDTType_Abstract(); + + /** + * The meta object literal for the 'Final' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_TYPE__FINAL = eINSTANCE.getJDTType_Final(); + + /** + * The meta object literal for the 'Static' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_TYPE__STATIC = eINSTANCE.getJDTType_Static(); + + /** + * The meta object literal for the 'Types' containment reference list feature. + * + * + * + * @generated + */ + EReference JDT_TYPE__TYPES = eINSTANCE.getJDTType_Types(); + + /** + * The meta object literal for the 'Owner' container reference feature. + * + * + * + * @generated + */ + EReference JDT_TYPE__OWNER = eINSTANCE.getJDTType_Owner(); + + /** + * The meta object literal for the 'Super Interfaces' reference list feature. + * + * + * + * @generated + */ + EReference JDT_TYPE__SUPER_INTERFACES = eINSTANCE.getJDTType_SuperInterfaces(); + + /** + * The meta object literal for the 'Super Class' reference feature. + * + * + * + * @generated + */ + EReference JDT_TYPE__SUPER_CLASS = eINSTANCE.getJDTType_SuperClass(); + + /** + * The meta object literal for the 'Super Interface Names' attribute list feature. + * + * + * + * @generated + */ + EAttribute JDT_TYPE__SUPER_INTERFACE_NAMES = eINSTANCE.getJDTType_SuperInterfaceNames(); + + /** + * The meta object literal for the 'Super Class Name' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_TYPE__SUPER_CLASS_NAME = eINSTANCE.getJDTType_SuperClassName(); + + /** + * The meta object literal for the 'Fields' containment reference list feature. + * + * + * + * @generated + */ + EReference JDT_TYPE__FIELDS = eINSTANCE.getJDTType_Fields(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl JDT Method}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTMethod() + * @generated + */ + EClass JDT_METHOD = eINSTANCE.getJDTMethod(); + + /** + * The meta object literal for the 'Return Type' containment reference feature. + * + * + * + * @generated + */ + EReference JDT_METHOD__RETURN_TYPE = eINSTANCE.getJDTMethod_ReturnType(); + + /** + * The meta object literal for the 'Parameters' containment reference list feature. + * + * + * + * @generated + */ + EReference JDT_METHOD__PARAMETERS = eINSTANCE.getJDTMethod_Parameters(); + + /** + * The meta object literal for the 'Exceptions' reference list feature. + * + * + * + * @generated + */ + EReference JDT_METHOD__EXCEPTIONS = eINSTANCE.getJDTMethod_Exceptions(); + + /** + * The meta object literal for the 'Synchronized' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_METHOD__SYNCHRONIZED = eINSTANCE.getJDTMethod_Synchronized(); + + /** + * The meta object literal for the 'Constructor' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_METHOD__CONSTRUCTOR = eINSTANCE.getJDTMethod_Constructor(); + + /** + * The meta object literal for the 'Bodies' containment reference list feature. + * + * + * + * @generated + */ + EReference JDT_METHOD__BODIES = eINSTANCE.getJDTMethod_Bodies(); + + /** + * The meta object literal for the 'Abstract' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_METHOD__ABSTRACT = eINSTANCE.getJDTMethod_Abstract(); + + /** + * The meta object literal for the 'Final' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_METHOD__FINAL = eINSTANCE.getJDTMethod_Final(); + + /** + * The meta object literal for the 'Static' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_METHOD__STATIC = eINSTANCE.getJDTMethod_Static(); + + /** + * The meta object literal for the 'Owner' container reference feature. + * + * + * + * @generated + */ + EReference JDT_METHOD__OWNER = eINSTANCE.getJDTMethod_Owner(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTClassImpl JDT Class}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTClassImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTClass() + * @generated + */ + EClass JDT_CLASS = eINSTANCE.getJDTClass(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTInterfaceImpl JDT Interface}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTInterfaceImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTInterface() + * @generated + */ + EClass JDT_INTERFACE = eINSTANCE.getJDTInterface(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTEnumImpl JDT Enum}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTEnumImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTEnum() + * @generated + */ + EClass JDT_ENUM = eINSTANCE.getJDTEnum(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeRootImpl JDT Type Root}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeRootImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTTypeRoot() + * @generated + */ + EClass JDT_TYPE_ROOT = eINSTANCE.getJDTTypeRoot(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl JDT Compilation Unit}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTCompilationUnit() + * @generated + */ + EClass JDT_COMPILATION_UNIT = eINSTANCE.getJDTCompilationUnit(); + + /** + * The meta object literal for the 'Package Fragment' container reference feature. + * + * + * + * @generated + */ + EReference JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT = eINSTANCE.getJDTCompilationUnit_PackageFragment(); + + /** + * The meta object literal for the 'Types' containment reference list feature. + * + * + * + * @generated + */ + EReference JDT_COMPILATION_UNIT__TYPES = eINSTANCE.getJDTCompilationUnit_Types(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportDeclarationImpl JDT Import Declaration}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportDeclarationImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTImportDeclaration() + * @generated + */ + EClass JDT_IMPORT_DECLARATION = eINSTANCE.getJDTImportDeclaration(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportContainerImpl JDT Import Container}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTImportContainerImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTImportContainer() + * @generated + */ + EClass JDT_IMPORT_CONTAINER = eINSTANCE.getJDTImportContainer(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl JDT Parameter}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTParameter() + * @generated + */ + EClass JDT_PARAMETER = eINSTANCE.getJDTParameter(); + + /** + * The meta object literal for the 'Parameter Owner' container reference feature. + * + * + * + * @generated + */ + EReference JDT_PARAMETER__PARAMETER_OWNER = eINSTANCE.getJDTParameter_ParameterOwner(); + + /** + * The meta object literal for the 'Final' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_PARAMETER__FINAL = eINSTANCE.getJDTParameter_Final(); + + /** + * The meta object literal for the 'Is Multi Valued' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_PARAMETER__IS_MULTI_VALUED = eINSTANCE.getJDTParameter_IsMultiValued(); + + /** + * The meta object literal for the 'Type' reference feature. + * + * + * + * @generated + */ + EReference JDT_PARAMETER__TYPE = eINSTANCE.getJDTParameter_Type(); + + /** + * The meta object literal for the 'Return Owner' container reference feature. + * + * + * + * @generated + */ + EReference JDT_PARAMETER__RETURN_OWNER = eINSTANCE.getJDTParameter_ReturnOwner(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTExceptionImpl JDT Exception}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTExceptionImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTException() + * @generated + */ + EClass JDT_EXCEPTION = eINSTANCE.getJDTException(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTOpaqueBodyImpl JDT Opaque Body}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTOpaqueBodyImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTOpaqueBody() + * @generated + */ + EClass JDT_OPAQUE_BODY = eINSTANCE.getJDTOpaqueBody(); + + /** + * The meta object literal for the 'body' attribute feature. + * + * + * + * @generated + */ + EAttribute JDT_OPAQUE_BODY__BODY = eINSTANCE.getJDTOpaqueBody__body(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind Visibility Kind}' enum. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getVisibilityKind() + * @generated + */ + EEnum VISIBILITY_KIND = eINSTANCE.getVisibilityKind(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault True False Default}' enum. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getTrueFalseDefault() + * @generated + */ + EEnum TRUE_FALSE_DEFAULT = eINSTANCE.getTrueFalseDefault(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaModelImpl JDT Java Model}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaModelImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTJavaModel() + * @generated + */ + EClass JDT_JAVA_MODEL = eINSTANCE.getJDTJavaModel(); + + /** + * The meta object literal for the 'Java Project' containment reference list feature. + * + * + * + * @generated + */ + EReference JDT_JAVA_MODEL__JAVA_PROJECT = eINSTANCE.getJDTJavaModel_JavaProject(); + + /** + * The meta object literal for the 'boolean' data type. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getboolean() + * @generated + */ + EDataType BOOLEAN = eINSTANCE.getboolean(); + + /** + * The meta object literal for the 'int' data type. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getint() + * @generated + */ + EDataType INT = eINSTANCE.getint(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl JDT Package Fragment}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTPackageFragment() + * @generated + */ + EClass JDT_PACKAGE_FRAGMENT = eINSTANCE.getJDTPackageFragment(); + + /** + * The meta object literal for the 'Package Fragment Root' container reference feature. + * + * + * + * @generated + */ + EReference JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT = eINSTANCE.getJDTPackageFragment_PackageFragmentRoot(); + + /** + * The meta object literal for the 'Compilation Units' containment reference list feature. + * + * + * + * @generated + */ + EReference JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS = eINSTANCE.getJDTPackageFragment_CompilationUnits(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl JDT Package Fragment Root}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTPackageFragmentRoot() + * @generated + */ + EClass JDT_PACKAGE_FRAGMENT_ROOT = eINSTANCE.getJDTPackageFragmentRoot(); + + /** + * The meta object literal for the 'Java Project' container reference feature. + * + * + * + * @generated + */ + EReference JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT = eINSTANCE.getJDTPackageFragmentRoot_JavaProject(); + + /** + * The meta object literal for the 'Package Fragments' containment reference list feature. + * + * + * + * @generated + */ + EReference JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS = eINSTANCE.getJDTPackageFragmentRoot_PackageFragments(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl JDT Java Project}' class. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTJavaProject() + * @generated + */ + EClass JDT_JAVA_PROJECT = eINSTANCE.getJDTJavaProject(); + + /** + * The meta object literal for the 'Java Model' container reference feature. + * + * + * + * @generated + */ + EReference JDT_JAVA_PROJECT__JAVA_MODEL = eINSTANCE.getJDTJavaProject_JavaModel(); + + /** + * The meta object literal for the 'Package Fragment Roots' containment reference list feature. + * + * + * + * @generated + */ + EReference JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS = eINSTANCE.getJDTJavaProject_PackageFragmentRoots(); + + /** + * The meta object literal for the 'String' data type. + * + * + * + * @see java.lang.String + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getString() + * @generated + */ + EDataType STRING = eINSTANCE.getString(); + + /** + * The meta object literal for the 'JDT Visitor Exception' data type. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getJDTVisitorException() + * @generated + */ + EDataType JDT_VISITOR_EXCEPTION = eINSTANCE.getJDTVisitorException(); + + /** + * The meta object literal for the 'Visitor' data type. + * + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JdtmmPackageImpl#getVisitor() + * @generated + */ + EDataType VISITOR = eINSTANCE.getVisitor(); + + } + +} // JdtmmPackage diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/TrueFalseDefault.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/TrueFalseDefault.java new file mode 100644 index 00000000000..dae01bcc8c7 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/TrueFalseDefault.java @@ -0,0 +1,278 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'True False Default', + * and utility methods for working with them. + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getTrueFalseDefault() + * @model + * @generated + */ +public enum TrueFalseDefault implements Enumerator { + /** + * The 'True' literal object. + * + * + * + * @see #TRUE_VALUE + * @generated + * @ordered + */ + TRUE(0, "true", "true"), + + /** + * The 'False' literal object. + * + * + * + * @see #FALSE_VALUE + * @generated + * @ordered + */ + FALSE(1, "false", "false"), + + /** + * The 'Default' literal object. + * + * + * + * @see #DEFAULT_VALUE + * @generated + * @ordered + */ + DEFAULT(2, "default", "default"); + + /** + * The 'True' literal value. + * + *

    + * If the meaning of 'True' literal object isn't clear, there really should be more of a description here... + *

    + * + * + * @see #TRUE + * @model name="true" + * @generated + * @ordered + */ + public static final int TRUE_VALUE = 0; + + /** + * The 'False' literal value. + * + *

    + * If the meaning of 'False' literal object isn't clear, there really should be more of a description here... + *

    + * + * + * @see #FALSE + * @model name="false" + * @generated + * @ordered + */ + public static final int FALSE_VALUE = 1; + + /** + * The 'Default' literal value. + * + *

    + * If the meaning of 'Default' literal object isn't clear, there really should be more of a description here... + *

    + * + * + * @see #DEFAULT + * @model name="default" + * @generated + * @ordered + */ + public static final int DEFAULT_VALUE = 2; + + /** + * An array of all the 'True False Default' enumerators. + * + * + * + * @generated + */ + private static final TrueFalseDefault[] VALUES_ARRAY = + new TrueFalseDefault[] { + TRUE, + FALSE, + DEFAULT, + }; + + /** + * A public read-only list of all the 'True False Default' enumerators. + * + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'True False Default' literal with the specified literal value. + * + * + * + * @generated + */ + public static TrueFalseDefault get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + TrueFalseDefault result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'True False Default' literal with the specified name. + * + * + * + * @generated + */ + public static TrueFalseDefault getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + TrueFalseDefault result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'True False Default' literal with the specified integer value. + * + * + * + * @generated + */ + public static TrueFalseDefault get(int value) { + switch (value) { + case TRUE_VALUE: + return TRUE; + case FALSE_VALUE: + return FALSE; + case DEFAULT_VALUE: + return DEFAULT; + } + return null; + } + + /** + * + * + * + * @generated + */ + private final int value; + + /** + * + * + * + * @generated + */ + private final String name; + + /** + * + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * + * @generated + */ + private TrueFalseDefault(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} // TrueFalseDefault diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/VisibilityKind.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/VisibilityKind.java new file mode 100644 index 00000000000..7297efd22a2 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/VisibilityKind.java @@ -0,0 +1,278 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Visibility Kind', + * and utility methods for working with them. + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#getVisibilityKind() + * @model + * @generated + */ +public enum VisibilityKind implements Enumerator { + /** + * The 'Public' literal object. + * + * + * + * @see #PUBLIC_VALUE + * @generated + * @ordered + */ + PUBLIC(0, "public", "public"), + + /** + * The 'Protected' literal object. + * + * + * + * @see #PROTECTED_VALUE + * @generated + * @ordered + */ + PROTECTED(1, "protected", "protected"), + + /** + * The 'Private' literal object. + * + * + * + * @see #PRIVATE_VALUE + * @generated + * @ordered + */ + PRIVATE(2, "private", "private"); + + /** + * The 'Public' literal value. + * + *

    + * If the meaning of 'Public' literal object isn't clear, there really should be more of a description here... + *

    + * + * + * @see #PUBLIC + * @model name="public" + * @generated + * @ordered + */ + public static final int PUBLIC_VALUE = 0; + + /** + * The 'Protected' literal value. + * + *

    + * If the meaning of 'Protected' literal object isn't clear, there really should be more of a description here... + *

    + * + * + * @see #PROTECTED + * @model name="protected" + * @generated + * @ordered + */ + public static final int PROTECTED_VALUE = 1; + + /** + * The 'Private' literal value. + * + *

    + * If the meaning of 'Private' literal object isn't clear, there really should be more of a description here... + *

    + * + * + * @see #PRIVATE + * @model name="private" + * @generated + * @ordered + */ + public static final int PRIVATE_VALUE = 2; + + /** + * An array of all the 'Visibility Kind' enumerators. + * + * + * + * @generated + */ + private static final VisibilityKind[] VALUES_ARRAY = + new VisibilityKind[] { + PUBLIC, + PROTECTED, + PRIVATE, + }; + + /** + * A public read-only list of all the 'Visibility Kind' enumerators. + * + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Visibility Kind' literal with the specified literal value. + * + * + * + * @generated + */ + public static VisibilityKind get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + VisibilityKind result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Visibility Kind' literal with the specified name. + * + * + * + * @generated + */ + public static VisibilityKind getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + VisibilityKind result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Visibility Kind' literal with the specified integer value. + * + * + * + * @generated + */ + public static VisibilityKind get(int value) { + switch (value) { + case PUBLIC_VALUE: + return PUBLIC; + case PROTECTED_VALUE: + return PROTECTED; + case PRIVATE_VALUE: + return PRIVATE; + } + return null; + } + + /** + * + * + * + * @generated + */ + private final int value; + + /** + * + * + * + * @generated + */ + private final String name; + + /** + * + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * + * @generated + */ + private VisibilityKind(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} // VisibilityKind diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTClassImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTClassImpl.java new file mode 100644 index 00000000000..db43f78bd57 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTClassImpl.java @@ -0,0 +1,61 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * An implementation of the model object 'JDT Class'. + * + *

    + *

    + * + * @generated + */ +public class JDTClassImpl extends JDTTypeImpl implements JDTClass { + + /** + * + * + * + * @generated + */ + protected JDTClassImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_CLASS; + } + +} // JDTClassImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTCompilationUnitImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTCompilationUnitImpl.java new file mode 100644 index 00000000000..d01d7d3bd83 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTCompilationUnitImpl.java @@ -0,0 +1,375 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; +import org.eclipse.uml2.common.util.SubsetSupersetEObjectContainmentWithInverseEList; + +/** + * + * An implementation of the model object 'JDT Compilation Unit'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl#getChildren Children}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl#getPackageFragment Package Fragment}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTCompilationUnitImpl#getTypes Types}
    • + *
    + *

    + * + * @generated + */ +public class JDTCompilationUnitImpl extends JDTTypeRootImpl implements JDTCompilationUnit { + + /** + * The cached value of the '{@link #getTypes() Types}' containment reference list. + * + * + * + * @see #getTypes() + * @generated + * @ordered + */ + protected EList types; + + /** + * + * + * + * @generated + */ + protected JDTCompilationUnitImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_COMPILATION_UNIT; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getChildren() { + return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_COMPILATION_UNIT__CHILDREN, CHILDREN_ESUBSETS); + } + + /** + * The array of subset feature identifiers for the '{@link #getChildren() Children}' reference list. + * + * + * + * @see #getChildren() + * @generated + * @ordered + */ + protected static final int[] CHILDREN_ESUBSETS = new int[] { JdtmmPackage.JDT_COMPILATION_UNIT__TYPES }; + + /** + * + * + * + * @generated + */ + @Override + public JDTPackageFragment getPackageFragment() { + if (eContainerFeatureID() != JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT) { + return null; + } + return (JDTPackageFragment) eContainer(); + } + + /** + * + * + * + * @generated + */ + public NotificationChain basicSetPackageFragment(JDTPackageFragment newPackageFragment, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newPackageFragment, JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT, msgs); + return msgs; + } + + /** + * + * + * + * @generated + */ + @Override + public void setPackageFragment(JDTPackageFragment newPackageFragment) { + if (newPackageFragment != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT && newPackageFragment != null)) { + if (EcoreUtil.isAncestor(this, newPackageFragment)) { + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + } + NotificationChain msgs = null; + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + if (newPackageFragment != null) { + msgs = ((InternalEObject) newPackageFragment).eInverseAdd(this, JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS, JDTPackageFragment.class, msgs); + } + msgs = basicSetPackageFragment(newPackageFragment, msgs); + if (msgs != null) { + msgs.dispatch(); + } + } + else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT, newPackageFragment, newPackageFragment)); + } + } + + /** + * + * + * + * @generated + */ + public boolean isSetPackageFragment() { + return getPackageFragment() != null; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getTypes() { + if (types == null) { + types = new SubsetSupersetEObjectContainmentWithInverseEList(JDTType.class, this, JdtmmPackage.JDT_COMPILATION_UNIT__TYPES, TYPES_ESUPERSETS, null, JdtmmPackage.JDT_TYPE__COMPILATION_UNIT); + } + return types; + } + + /** + * The array of superset feature identifiers for the '{@link #getTypes() Types}' containment reference list. + * + * + * + * @see #getTypes() + * @generated + * @ordered + */ + protected static final int[] TYPES_ESUPERSETS = new int[] { JdtmmPackage.JDT_COMPILATION_UNIT__CHILDREN }; + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetPackageFragment((JDTPackageFragment) otherEnd, msgs); + case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: + return ((InternalEList) (InternalEList) getTypes()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: + return basicSetPackageFragment(null, msgs); + case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: + return ((InternalEList) getTypes()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: + return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS, JDTPackageFragment.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: + return getPackageFragment(); + case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: + return getTypes(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: + setPackageFragment((JDTPackageFragment) newValue); + return; + case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: + getTypes().clear(); + getTypes().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: + setPackageFragment((JDTPackageFragment) null); + return; + case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: + getTypes().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT: + return isSetPackageFragment(); + case JdtmmPackage.JDT_COMPILATION_UNIT__TYPES: + return types != null && !types.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isSetChildren() { + return super.isSetChildren() + || eIsSet(JdtmmPackage.JDT_COMPILATION_UNIT__TYPES); + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParent getParent() { + return getPackageFragment(); + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParent basicGetParent() { + return getPackageFragment(); + } + + /** + * + * + * + * @generated + */ + public boolean isSetParent() { + return false; + } + +} // JDTCompilationUnitImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTEnumImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTEnumImpl.java new file mode 100644 index 00000000000..22e94d54f07 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTEnumImpl.java @@ -0,0 +1,61 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * An implementation of the model object 'JDT Enum'. + * + *

    + *

    + * + * @generated + */ +public class JDTEnumImpl extends JDTTypeImpl implements JDTEnum { + + /** + * + * + * + * @generated + */ + protected JDTEnumImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_ENUM; + } + +} // JDTEnumImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTExceptionImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTExceptionImpl.java new file mode 100644 index 00000000000..dccb6aa5f6d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTExceptionImpl.java @@ -0,0 +1,62 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * An implementation of the model object 'JDT Exception'. + * + *

    + *

    + * + * @generated + */ +public class JDTExceptionImpl extends EObjectImpl implements JDTException { + + /** + * + * + * + * @generated + */ + protected JDTExceptionImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_EXCEPTION; + } + +} // JDTExceptionImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTFieldImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTFieldImpl.java new file mode 100644 index 00000000000..4e99b219be8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTFieldImpl.java @@ -0,0 +1,749 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.jdt.core.Flags; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault; + +/** + * + * An implementation of the model object 'JDT Field'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#isAbstract Abstract}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#isFinal Final}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#isStatic Static}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#isMultiValued Is Multi Valued}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#getType Type}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#getValue Value}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#getGenerateGetter Generate Getter}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#getGenerateSetter Generate Setter}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTFieldImpl#getOwner Owner}
    • + *
    + *

    + * + * @generated + */ +public class JDTFieldImpl extends JDTMemberImpl implements JDTField { + + /** + * The default value of the '{@link #isAbstract() Abstract}' attribute. + * + * + * + * @see #isAbstract() + * @generated + * @ordered + */ + protected static final boolean ABSTRACT_EDEFAULT = false; + + /** + * The default value of the '{@link #isFinal() Final}' attribute. + * + * + * + * @see #isFinal() + * @generated + * @ordered + */ + protected static final boolean FINAL_EDEFAULT = false; + + /** + * The default value of the '{@link #isStatic() Static}' attribute. + * + * + * + * @see #isStatic() + * @generated + * @ordered + */ + protected static final boolean STATIC_EDEFAULT = false; + + /** + * The default value of the '{@link #isMultiValued() Is Multi Valued}' attribute. + * + * + * + * @see #isMultiValued() + * @generated + * @ordered + */ + protected static final boolean IS_MULTI_VALUED_EDEFAULT = false; + + /** + * The cached value of the '{@link #isMultiValued() Is Multi Valued}' attribute. + * + * + * + * @see #isMultiValued() + * @generated + * @ordered + */ + protected boolean isMultiValued = IS_MULTI_VALUED_EDEFAULT; + + /** + * The cached value of the '{@link #getType() Type}' reference. + * + * + * + * @see #getType() + * @generated + * @ordered + */ + protected JDTType type; + + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final String VALUE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected String value = VALUE_EDEFAULT; + + /** + * The default value of the '{@link #getGenerateGetter() Generate Getter}' attribute. + * + * + * + * @see #getGenerateGetter() + * @generated + * @ordered + */ + protected static final TrueFalseDefault GENERATE_GETTER_EDEFAULT = TrueFalseDefault.TRUE; + + /** + * The cached value of the '{@link #getGenerateGetter() Generate Getter}' attribute. + * + * + * + * @see #getGenerateGetter() + * @generated + * @ordered + */ + protected TrueFalseDefault generateGetter = GENERATE_GETTER_EDEFAULT; + + /** + * The default value of the '{@link #getGenerateSetter() Generate Setter}' attribute. + * + * + * + * @see #getGenerateSetter() + * @generated + * @ordered + */ + protected static final TrueFalseDefault GENERATE_SETTER_EDEFAULT = TrueFalseDefault.TRUE; + + /** + * The cached value of the '{@link #getGenerateSetter() Generate Setter}' attribute. + * + * + * + * @see #getGenerateSetter() + * @generated + * @ordered + */ + protected TrueFalseDefault generateSetter = GENERATE_SETTER_EDEFAULT; + + /** + * + * + * + * @generated + */ + protected JDTFieldImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_FIELD; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTType getOwner() { + if (eContainerFeatureID() != JdtmmPackage.JDT_FIELD__OWNER) { + return null; + } + return (JDTType) eContainer(); + } + + /** + * + * + * + * @generated + */ + public NotificationChain basicSetOwner(JDTType newOwner, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newOwner, JdtmmPackage.JDT_FIELD__OWNER, msgs); + return msgs; + } + + /** + * + * + * + * @generated + */ + @Override + public void setOwner(JDTType newOwner) { + if (newOwner != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_FIELD__OWNER && newOwner != null)) { + if (EcoreUtil.isAncestor(this, newOwner)) { + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + } + NotificationChain msgs = null; + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + if (newOwner != null) { + msgs = ((InternalEObject) newOwner).eInverseAdd(this, JdtmmPackage.JDT_TYPE__FIELDS, JDTType.class, msgs); + } + msgs = basicSetOwner(newOwner, msgs); + if (msgs != null) { + msgs.dispatch(); + } + } + else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_FIELD__OWNER, newOwner, newOwner)); + } + } + + /** + * + * + * + * @generated + */ + public boolean isSetOwner() { + return getOwner() != null; + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isAbstract() { + // TODO: implement this method to return the 'Abstract' attribute + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isMultiValued() { + return isMultiValued; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsMultiValued(boolean newIsMultiValued) { + boolean oldIsMultiValued = isMultiValued; + isMultiValued = newIsMultiValued; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_FIELD__IS_MULTI_VALUED, oldIsMultiValued, isMultiValued)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public JDTType getType() { + if (type != null && type.eIsProxy()) { + InternalEObject oldType = (InternalEObject) type; + type = (JDTType) eResolveProxy(oldType); + if (type != oldType) { + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.RESOLVE, JdtmmPackage.JDT_FIELD__TYPE, oldType, type)); + } + } + } + return type; + } + + /** + * + * + * + * @generated + */ + public JDTType basicGetType() { + return type; + } + + /** + * + * + * + * @generated + */ + @Override + public void setType(JDTType newType) { + JDTType oldType = type; + type = newType; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_FIELD__TYPE, oldType, type)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public String getValue() { + return value; + } + + /** + * + * + * + * @generated + */ + @Override + public void setValue(String newValue) { + String oldValue = value; + value = newValue; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_FIELD__VALUE, oldValue, value)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public TrueFalseDefault getGenerateGetter() { + return generateGetter; + } + + /** + * + * + * + * @generated + */ + @Override + public void setGenerateGetter(TrueFalseDefault newGenerateGetter) { + TrueFalseDefault oldGenerateGetter = generateGetter; + generateGetter = newGenerateGetter == null ? GENERATE_GETTER_EDEFAULT : newGenerateGetter; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_FIELD__GENERATE_GETTER, oldGenerateGetter, generateGetter)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public TrueFalseDefault getGenerateSetter() { + return generateSetter; + } + + /** + * + * + * + * @generated + */ + @Override + public void setGenerateSetter(TrueFalseDefault newGenerateSetter) { + TrueFalseDefault oldGenerateSetter = generateSetter; + generateSetter = newGenerateSetter == null ? GENERATE_SETTER_EDEFAULT : newGenerateSetter; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_FIELD__GENERATE_SETTER, oldGenerateSetter, generateSetter)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_FIELD__OWNER: + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetOwner((JDTType) otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_FIELD__OWNER: + return basicSetOwner(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case JdtmmPackage.JDT_FIELD__OWNER: + return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_TYPE__FIELDS, JDTType.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_FIELD__ABSTRACT: + return isAbstract(); + case JdtmmPackage.JDT_FIELD__FINAL: + return isFinal(); + case JdtmmPackage.JDT_FIELD__STATIC: + return isStatic(); + case JdtmmPackage.JDT_FIELD__IS_MULTI_VALUED: + return isMultiValued(); + case JdtmmPackage.JDT_FIELD__TYPE: + if (resolve) { + return getType(); + } + return basicGetType(); + case JdtmmPackage.JDT_FIELD__VALUE: + return getValue(); + case JdtmmPackage.JDT_FIELD__GENERATE_GETTER: + return getGenerateGetter(); + case JdtmmPackage.JDT_FIELD__GENERATE_SETTER: + return getGenerateSetter(); + case JdtmmPackage.JDT_FIELD__OWNER: + return getOwner(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_FIELD__ABSTRACT: + setAbstract((Boolean) newValue); + return; + case JdtmmPackage.JDT_FIELD__FINAL: + setFinal((Boolean) newValue); + return; + case JdtmmPackage.JDT_FIELD__STATIC: + setStatic((Boolean) newValue); + return; + case JdtmmPackage.JDT_FIELD__IS_MULTI_VALUED: + setIsMultiValued((Boolean) newValue); + return; + case JdtmmPackage.JDT_FIELD__TYPE: + setType((JDTType) newValue); + return; + case JdtmmPackage.JDT_FIELD__VALUE: + setValue((String) newValue); + return; + case JdtmmPackage.JDT_FIELD__GENERATE_GETTER: + setGenerateGetter((TrueFalseDefault) newValue); + return; + case JdtmmPackage.JDT_FIELD__GENERATE_SETTER: + setGenerateSetter((TrueFalseDefault) newValue); + return; + case JdtmmPackage.JDT_FIELD__OWNER: + setOwner((JDTType) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_FIELD__ABSTRACT: + setAbstract(ABSTRACT_EDEFAULT); + return; + case JdtmmPackage.JDT_FIELD__FINAL: + setFinal(FINAL_EDEFAULT); + return; + case JdtmmPackage.JDT_FIELD__STATIC: + setStatic(STATIC_EDEFAULT); + return; + case JdtmmPackage.JDT_FIELD__IS_MULTI_VALUED: + setIsMultiValued(IS_MULTI_VALUED_EDEFAULT); + return; + case JdtmmPackage.JDT_FIELD__TYPE: + setType((JDTType) null); + return; + case JdtmmPackage.JDT_FIELD__VALUE: + setValue(VALUE_EDEFAULT); + return; + case JdtmmPackage.JDT_FIELD__GENERATE_GETTER: + setGenerateGetter(GENERATE_GETTER_EDEFAULT); + return; + case JdtmmPackage.JDT_FIELD__GENERATE_SETTER: + setGenerateSetter(GENERATE_SETTER_EDEFAULT); + return; + case JdtmmPackage.JDT_FIELD__OWNER: + setOwner((JDTType) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_FIELD__ABSTRACT: + return isAbstract() != ABSTRACT_EDEFAULT; + case JdtmmPackage.JDT_FIELD__FINAL: + return isFinal() != FINAL_EDEFAULT; + case JdtmmPackage.JDT_FIELD__STATIC: + return isStatic() != STATIC_EDEFAULT; + case JdtmmPackage.JDT_FIELD__IS_MULTI_VALUED: + return isMultiValued != IS_MULTI_VALUED_EDEFAULT; + case JdtmmPackage.JDT_FIELD__TYPE: + return type != null; + case JdtmmPackage.JDT_FIELD__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + case JdtmmPackage.JDT_FIELD__GENERATE_GETTER: + return generateGetter != GENERATE_GETTER_EDEFAULT; + case JdtmmPackage.JDT_FIELD__GENERATE_SETTER: + return generateSetter != GENERATE_SETTER_EDEFAULT; + case JdtmmPackage.JDT_FIELD__OWNER: + return isSetOwner(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (isMultiValued: "); + result.append(isMultiValued); + result.append(", value: "); + result.append(value); + result.append(", generateGetter: "); + result.append(generateGetter); + result.append(", generateSetter: "); + result.append(generateSetter); + result.append(')'); + return result.toString(); + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParent getParent() { + return getOwner(); + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParent basicGetParent() { + return getOwner(); + } + + /** + * + * + * + * @generated + */ + public boolean isSetParent() { + return false; + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isFinal() { + // TODO: implement this method to return the 'Final' attribute + // Ensure that you remove @generated or mark it @generated NOT + return isFlagSet(Flags.AccFinal); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isStatic() { + return isFlagSet(Flags.AccStatic); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setAbstract(boolean newAbstract) { + // Ensure that you remove @generated or mark it @generated NOT + setFlag(Flags.AccAbstract, newAbstract); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setFinal(boolean newFinal) { + + setFlag(Flags.AccFinal, newFinal); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setStatic(boolean newStatic) { + setFlag(Flags.AccStatic, newStatic); + } + +} // JDTFieldImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportContainerImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportContainerImpl.java new file mode 100644 index 00000000000..778b6c46e40 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportContainerImpl.java @@ -0,0 +1,61 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * An implementation of the model object 'JDT Import Container'. + * + *

    + *

    + * + * @generated + */ +public class JDTImportContainerImpl extends JDTParentJavaElementImpl implements JDTImportContainer { + + /** + * + * + * + * @generated + */ + protected JDTImportContainerImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_IMPORT_CONTAINER; + } + +} // JDTImportContainerImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportDeclarationImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportDeclarationImpl.java new file mode 100644 index 00000000000..3312ffe75ba --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTImportDeclarationImpl.java @@ -0,0 +1,61 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * An implementation of the model object 'JDT Import Declaration'. + * + *

    + *

    + * + * @generated + */ +public class JDTImportDeclarationImpl extends JDTJavaElementImpl implements JDTImportDeclaration { + + /** + * + * + * + * @generated + */ + protected JDTImportDeclarationImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_IMPORT_DECLARATION; + } + +} // JDTImportDeclarationImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTInterfaceImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTInterfaceImpl.java new file mode 100644 index 00000000000..289b0d528bf --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTInterfaceImpl.java @@ -0,0 +1,61 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * An implementation of the model object 'JDT Interface'. + * + *

    + *

    + * + * @generated + */ +public class JDTInterfaceImpl extends JDTTypeImpl implements JDTInterface { + + /** + * + * + * + * @generated + */ + protected JDTInterfaceImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_INTERFACE; + } + +} // JDTInterfaceImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaElementImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaElementImpl.java new file mode 100644 index 00000000000..cb4cdf8284e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaElementImpl.java @@ -0,0 +1,453 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; + +/** + * + * An implementation of the model object 'JDT Java Element'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl#getElementName Element Name}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl#getElementType Element Type}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl#getComment Comment}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl#isGenerated Generated}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaElementImpl#getParent Parent}
    • + *
    + *

    + * + * @generated + */ +public abstract class JDTJavaElementImpl extends EObjectImpl implements JDTJavaElement { + + /** + * The default value of the '{@link #getElementName() Element Name}' attribute. + * + * + * + * @see #getElementName() + * @generated + * @ordered + */ + protected static final String ELEMENT_NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getElementName() Element Name}' attribute. + * + * + * + * @see #getElementName() + * @generated + * @ordered + */ + protected String elementName = ELEMENT_NAME_EDEFAULT; + + /** + * The default value of the '{@link #getElementType() Element Type}' attribute. + * + * + * + * @see #getElementType() + * @generated + * @ordered + */ + protected static final int ELEMENT_TYPE_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getElementType() Element Type}' attribute. + * + * + * + * @see #getElementType() + * @generated + * @ordered + */ + protected int elementType = ELEMENT_TYPE_EDEFAULT; + + /** + * The default value of the '{@link #getComment() Comment}' attribute. + * + * + * + * @see #getComment() + * @generated + * @ordered + */ + protected static final String COMMENT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getComment() Comment}' attribute. + * + * + * + * @see #getComment() + * @generated + * @ordered + */ + protected String comment = COMMENT_EDEFAULT; + + /** + * The default value of the '{@link #isGenerated() Generated}' attribute. + * + * + * + * @see #isGenerated() + * @generated + * @ordered + */ + protected static final boolean GENERATED_EDEFAULT = false; + + /** + * The cached value of the '{@link #isGenerated() Generated}' attribute. + * + * + * + * @see #isGenerated() + * @generated + * @ordered + */ + protected boolean generated = GENERATED_EDEFAULT; + + /** + * + * + * + * @generated + */ + protected JDTJavaElementImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_JAVA_ELEMENT; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParent getParent() { + JDTParent parent = basicGetParent(); + return parent != null && parent.eIsProxy() ? (JDTParent) eResolveProxy((InternalEObject) parent) : parent; + } + + /** + * + * + * + * @generated + */ + public JDTParent basicGetParent() { + // TODO: implement this method to return the 'Parent' reference + // -> do not perform proxy resolution + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * + * @generated + */ + @Override + public String getElementName() { + return elementName; + } + + /** + * + * + * + * @generated + */ + @Override + public void setElementName(String newElementName) { + String oldElementName = elementName; + elementName = newElementName; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_NAME, oldElementName, elementName)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public int getElementType() { + return elementType; + } + + /** + * + * + * + * @generated + */ + @Override + public void setElementType(int newElementType) { + int oldElementType = elementType; + elementType = newElementType; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_TYPE, oldElementType, elementType)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public String getComment() { + return comment; + } + + /** + * + * + * + * @generated + */ + @Override + public void setComment(String newComment) { + String oldComment = comment; + comment = newComment; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_JAVA_ELEMENT__COMMENT, oldComment, comment)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isGenerated() { + return generated; + } + + /** + * + * + * + * @generated + */ + @Override + public void setGenerated(boolean newGenerated) { + boolean oldGenerated = generated; + generated = newGenerated; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_JAVA_ELEMENT__GENERATED, oldGenerated, generated)); + } + } + + /** + * + * + * + * @generated not + */ + @Override + public String getQualifiedName() { + return getElementName(); + } + + /** + * + * + * + * @throws JDTVisitorException + * @generated NOT + */ + @Override + public void accept(JDTVisitor visitor) throws JDTVisitorException { + visitor.visit(this); + } + + /** + * + * + * + * @generated + */ + @Override + public String getJDTSignature() { + // TODO: implement this method + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_NAME: + return getElementName(); + case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_TYPE: + return getElementType(); + case JdtmmPackage.JDT_JAVA_ELEMENT__COMMENT: + return getComment(); + case JdtmmPackage.JDT_JAVA_ELEMENT__GENERATED: + return isGenerated(); + case JdtmmPackage.JDT_JAVA_ELEMENT__PARENT: + if (resolve) { + return getParent(); + } + return basicGetParent(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_NAME: + setElementName((String) newValue); + return; + case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_TYPE: + setElementType((Integer) newValue); + return; + case JdtmmPackage.JDT_JAVA_ELEMENT__COMMENT: + setComment((String) newValue); + return; + case JdtmmPackage.JDT_JAVA_ELEMENT__GENERATED: + setGenerated((Boolean) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_NAME: + setElementName(ELEMENT_NAME_EDEFAULT); + return; + case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_TYPE: + setElementType(ELEMENT_TYPE_EDEFAULT); + return; + case JdtmmPackage.JDT_JAVA_ELEMENT__COMMENT: + setComment(COMMENT_EDEFAULT); + return; + case JdtmmPackage.JDT_JAVA_ELEMENT__GENERATED: + setGenerated(GENERATED_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_NAME: + return ELEMENT_NAME_EDEFAULT == null ? elementName != null : !ELEMENT_NAME_EDEFAULT.equals(elementName); + case JdtmmPackage.JDT_JAVA_ELEMENT__ELEMENT_TYPE: + return elementType != ELEMENT_TYPE_EDEFAULT; + case JdtmmPackage.JDT_JAVA_ELEMENT__COMMENT: + return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment); + case JdtmmPackage.JDT_JAVA_ELEMENT__GENERATED: + return generated != GENERATED_EDEFAULT; + case JdtmmPackage.JDT_JAVA_ELEMENT__PARENT: + return basicGetParent() != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (elementName: "); + result.append(elementName); + result.append(", elementType: "); + result.append(elementType); + result.append(", comment: "); + result.append(comment); + result.append(", generated: "); + result.append(generated); + result.append(')'); + return result.toString(); + } + +} // JDTJavaElementImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaModelImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaModelImpl.java new file mode 100644 index 00000000000..ac4c2ac89db --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaModelImpl.java @@ -0,0 +1,193 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * An implementation of the model object 'JDT Java Model'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaModelImpl#getJavaProject Java Project}
    • + *
    + *

    + * + * @generated + */ +public class JDTJavaModelImpl extends JDTParentJavaElementImpl implements JDTJavaModel { + + /** + * The cached value of the '{@link #getJavaProject() Java Project}' containment reference list. + * + * + * + * @see #getJavaProject() + * @generated + * @ordered + */ + protected EList javaProject; + + /** + * + * + * + * @generated + */ + protected JDTJavaModelImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_JAVA_MODEL; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getJavaProject() { + if (javaProject == null) { + javaProject = new EObjectContainmentWithInverseEList(JDTJavaProject.class, this, JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT, JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL); + } + return javaProject; + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: + return ((InternalEList) (InternalEList) getJavaProject()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: + return ((InternalEList) getJavaProject()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: + return getJavaProject(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: + getJavaProject().clear(); + getJavaProject().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: + getJavaProject().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT: + return javaProject != null && !javaProject.isEmpty(); + } + return super.eIsSet(featureID); + } + +} // JDTJavaModelImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaProjectImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaProjectImpl.java new file mode 100644 index 00000000000..a085e987b2d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTJavaProjectImpl.java @@ -0,0 +1,333 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; +import org.eclipse.uml2.common.util.SubsetSupersetEObjectContainmentWithInverseEList; + +/** + * + * An implementation of the model object 'JDT Java Project'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl#getChildren Children}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl#getJavaModel Java Model}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTJavaProjectImpl#getPackageFragmentRoots Package Fragment Roots}
    • + *
    + *

    + * + * @generated + */ +public class JDTJavaProjectImpl extends JDTParentJavaElementImpl implements JDTJavaProject { + + /** + * The cached value of the '{@link #getPackageFragmentRoots() Package Fragment Roots}' containment reference list. + * + * + * + * @see #getPackageFragmentRoots() + * @generated + * @ordered + */ + protected EList packageFragmentRoots; + + /** + * + * + * + * @generated + */ + protected JDTJavaProjectImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_JAVA_PROJECT; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getChildren() { + return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_JAVA_PROJECT__CHILDREN, CHILDREN_ESUBSETS); + } + + /** + * The array of subset feature identifiers for the '{@link #getChildren() Children}' reference list. + * + * + * + * @see #getChildren() + * @generated + * @ordered + */ + protected static final int[] CHILDREN_ESUBSETS = new int[] { JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS }; + + /** + * + * + * + * @generated + */ + @Override + public JDTJavaModel getJavaModel() { + if (eContainerFeatureID() != JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL) { + return null; + } + return (JDTJavaModel) eContainer(); + } + + /** + * + * + * + * @generated + */ + public NotificationChain basicSetJavaModel(JDTJavaModel newJavaModel, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newJavaModel, JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL, msgs); + return msgs; + } + + /** + * + * + * + * @generated + */ + @Override + public void setJavaModel(JDTJavaModel newJavaModel) { + if (newJavaModel != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL && newJavaModel != null)) { + if (EcoreUtil.isAncestor(this, newJavaModel)) { + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + } + NotificationChain msgs = null; + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + if (newJavaModel != null) { + msgs = ((InternalEObject) newJavaModel).eInverseAdd(this, JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT, JDTJavaModel.class, msgs); + } + msgs = basicSetJavaModel(newJavaModel, msgs); + if (msgs != null) { + msgs.dispatch(); + } + } + else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL, newJavaModel, newJavaModel)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public EList getPackageFragmentRoots() { + if (packageFragmentRoots == null) { + packageFragmentRoots = new SubsetSupersetEObjectContainmentWithInverseEList(JDTPackageFragmentRoot.class, this, JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS, PACKAGE_FRAGMENT_ROOTS_ESUPERSETS, null, + JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT); + } + return packageFragmentRoots; + } + + /** + * The array of superset feature identifiers for the '{@link #getPackageFragmentRoots() Package Fragment Roots}' containment reference list. + * + * + * + * @see #getPackageFragmentRoots() + * @generated + * @ordered + */ + protected static final int[] PACKAGE_FRAGMENT_ROOTS_ESUPERSETS = new int[] { JdtmmPackage.JDT_JAVA_PROJECT__CHILDREN }; + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetJavaModel((JDTJavaModel) otherEnd, msgs); + case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: + return ((InternalEList) (InternalEList) getPackageFragmentRoots()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: + return basicSetJavaModel(null, msgs); + case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: + return ((InternalEList) getPackageFragmentRoots()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: + return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_JAVA_MODEL__JAVA_PROJECT, JDTJavaModel.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: + return getJavaModel(); + case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: + return getPackageFragmentRoots(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: + setJavaModel((JDTJavaModel) newValue); + return; + case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: + getPackageFragmentRoots().clear(); + getPackageFragmentRoots().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: + setJavaModel((JDTJavaModel) null); + return; + case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: + getPackageFragmentRoots().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_JAVA_PROJECT__JAVA_MODEL: + return getJavaModel() != null; + case JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS: + return packageFragmentRoots != null && !packageFragmentRoots.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isSetChildren() { + return super.isSetChildren() + || eIsSet(JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS); + } + +} // JDTJavaProjectImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMemberImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMemberImpl.java new file mode 100644 index 00000000000..281a07e2051 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMemberImpl.java @@ -0,0 +1,363 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; +import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.jdt.core.Flags; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind; + +/** + * + * An implementation of the model object 'JDT Member'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl#getTypeParameters Type Parameters}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl#getVisibility Visibility}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl#getExplicitRequiredImports Explicit Required Imports}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMemberImpl#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
    • + *
    + *

    + * + * @generated + */ +public abstract class JDTMemberImpl extends JDTParentJavaElementImpl implements JDTMember { + + /** + * The cached value of the '{@link #getTypeParameters() Type Parameters}' containment reference list. + * + * + * + * @see #getTypeParameters() + * @generated + * @ordered + */ + protected EList typeParameters; + + /** + * The default value of the '{@link #getVisibility() Visibility}' attribute. + * + * + * + * @see #getVisibility() + * @generated + * @ordered + */ + protected static final VisibilityKind VISIBILITY_EDEFAULT = VisibilityKind.PUBLIC; + + /** + * The cached value of the '{@link #getExplicitRequiredImports() Explicit Required Imports}' reference list. + * + * + * + * @see #getExplicitRequiredImports() + * @generated + * @ordered + */ + protected EList explicitRequiredImports; + + /** + * The cached value of the '{@link #getExplicitPlainTextRequiredImports() Explicit Plain Text Required Imports}' attribute list. + * + * + * + * @see #getExplicitPlainTextRequiredImports() + * @generated + * @ordered + */ + protected EList explicitPlainTextRequiredImports; + + /** + * + * + * + * @generated + */ + protected JDTMemberImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_MEMBER; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getTypeParameters() { + if (typeParameters == null) { + typeParameters = new EObjectContainmentWithInverseEList(JDTTypeParameter.class, this, JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS, JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER); + } + return typeParameters; + } + + /** + * + * + * + * @generated NOT + */ + @Override + public VisibilityKind getVisibility() { + + if (Flags.isPublic(flags)) { + return VisibilityKind.PUBLIC; + } else if (Flags.isProtected(flags)) { + return VisibilityKind.PROTECTED; + } else if (Flags.isPrivate(flags)) { + return VisibilityKind.PRIVATE; + } + + // default + return VisibilityKind.PUBLIC; + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setVisibility(VisibilityKind newVisibility) { + + switch (newVisibility) { + case PUBLIC: + setFlag(Flags.AccPublic, true); + setFlag(Flags.AccProtected, false); + setFlag(Flags.AccPrivate, false); + break; + case PROTECTED: + setFlag(Flags.AccPublic, false); + setFlag(Flags.AccProtected, true); + setFlag(Flags.AccPrivate, false); + break; + case PRIVATE: + setFlag(Flags.AccPublic, false); + setFlag(Flags.AccProtected, false); + setFlag(Flags.AccPrivate, true); + break; + } + } + + /** + * + * + * + * @generated + */ + @Override + public EList getExplicitRequiredImports() { + if (explicitRequiredImports == null) { + explicitRequiredImports = new EObjectResolvingEList(JDTType.class, this, JdtmmPackage.JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS); + } + return explicitRequiredImports; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getExplicitPlainTextRequiredImports() { + if (explicitPlainTextRequiredImports == null) { + explicitPlainTextRequiredImports = new EDataTypeUniqueEList(String.class, this, JdtmmPackage.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); + } + return explicitPlainTextRequiredImports; + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: + return ((InternalEList) (InternalEList) getTypeParameters()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: + return ((InternalEList) getTypeParameters()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: + return getTypeParameters(); + case JdtmmPackage.JDT_MEMBER__VISIBILITY: + return getVisibility(); + case JdtmmPackage.JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS: + return getExplicitRequiredImports(); + case JdtmmPackage.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + return getExplicitPlainTextRequiredImports(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: + getTypeParameters().clear(); + getTypeParameters().addAll((Collection) newValue); + return; + case JdtmmPackage.JDT_MEMBER__VISIBILITY: + setVisibility((VisibilityKind) newValue); + return; + case JdtmmPackage.JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS: + getExplicitRequiredImports().clear(); + getExplicitRequiredImports().addAll((Collection) newValue); + return; + case JdtmmPackage.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + getExplicitPlainTextRequiredImports().clear(); + getExplicitPlainTextRequiredImports().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: + getTypeParameters().clear(); + return; + case JdtmmPackage.JDT_MEMBER__VISIBILITY: + setVisibility(VISIBILITY_EDEFAULT); + return; + case JdtmmPackage.JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS: + getExplicitRequiredImports().clear(); + return; + case JdtmmPackage.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + getExplicitPlainTextRequiredImports().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS: + return typeParameters != null && !typeParameters.isEmpty(); + case JdtmmPackage.JDT_MEMBER__VISIBILITY: + return getVisibility() != VISIBILITY_EDEFAULT; + case JdtmmPackage.JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS: + return explicitRequiredImports != null && !explicitRequiredImports.isEmpty(); + case JdtmmPackage.JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + return explicitPlainTextRequiredImports != null && !explicitPlainTextRequiredImports.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (explicitPlainTextRequiredImports: "); + result.append(explicitPlainTextRequiredImports); + result.append(')'); + return result.toString(); + } + + +} // JDTMemberImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodBodyImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodBodyImpl.java new file mode 100644 index 00000000000..9cc13471a7c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodBodyImpl.java @@ -0,0 +1,232 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * An implementation of the model object 'JDT Method Body'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodBodyImpl#getOwner Owner}
    • + *
    + *

    + * + * @generated + */ +public abstract class JDTMethodBodyImpl extends EObjectImpl implements JDTMethodBody { + /** + * + * + * + * @generated + */ + protected JDTMethodBodyImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_METHOD_BODY; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTMethod getOwner() { + if (eContainerFeatureID() != JdtmmPackage.JDT_METHOD_BODY__OWNER) { + return null; + } + return (JDTMethod) eContainer(); + } + + /** + * + * + * + * @generated + */ + public NotificationChain basicSetOwner(JDTMethod newOwner, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newOwner, JdtmmPackage.JDT_METHOD_BODY__OWNER, msgs); + return msgs; + } + + /** + * + * + * + * @generated + */ + @Override + public void setOwner(JDTMethod newOwner) { + if (newOwner != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_METHOD_BODY__OWNER && newOwner != null)) { + if (EcoreUtil.isAncestor(this, newOwner)) { + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + } + NotificationChain msgs = null; + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + if (newOwner != null) { + msgs = ((InternalEObject) newOwner).eInverseAdd(this, JdtmmPackage.JDT_METHOD__BODIES, JDTMethod.class, msgs); + } + msgs = basicSetOwner(newOwner, msgs); + if (msgs != null) { + msgs.dispatch(); + } + } + else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_METHOD_BODY__OWNER, newOwner, newOwner)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public String asText() { + // TODO: implement this method + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_METHOD_BODY__OWNER: + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetOwner((JDTMethod) otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_METHOD_BODY__OWNER: + return basicSetOwner(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case JdtmmPackage.JDT_METHOD_BODY__OWNER: + return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_METHOD__BODIES, JDTMethod.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_METHOD_BODY__OWNER: + return getOwner(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_METHOD_BODY__OWNER: + setOwner((JDTMethod) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_METHOD_BODY__OWNER: + setOwner((JDTMethod) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_METHOD_BODY__OWNER: + return getOwner() != null; + } + return super.eIsSet(featureID); + } + +} // JDTMethodBodyImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodImpl.java new file mode 100644 index 00000000000..59aabb752f5 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTMethodImpl.java @@ -0,0 +1,779 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.jdt.core.Flags; +import org.eclipse.jdt.core.Signature; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * An implementation of the model object 'JDT Method'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#getOwner Owner}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#getReturnType Return Type}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#getParameters Parameters}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#isAbstract Abstract}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#isFinal Final}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#isStatic Static}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#getExceptions Exceptions}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#isSynchronized Synchronized}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#isConstructor Constructor}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTMethodImpl#getBodies Bodies}
    • + *
    + *

    + * + * @generated + */ +public class JDTMethodImpl extends JDTMemberImpl implements JDTMethod { + + /** + * The cached value of the '{@link #getReturnType() Return Type}' containment reference. + * + * + * + * @see #getReturnType() + * @generated + * @ordered + */ + protected JDTParameter returnType; + + /** + * The cached value of the '{@link #getParameters() Parameters}' containment reference list. + * + * + * + * @see #getParameters() + * @generated + * @ordered + */ + protected EList parameters; + + /** + * The default value of the '{@link #isAbstract() Abstract}' attribute. + * + * + * + * @see #isAbstract() + * @generated + * @ordered + */ + protected static final boolean ABSTRACT_EDEFAULT = false; + + /** + * The default value of the '{@link #isFinal() Final}' attribute. + * + * + * + * @see #isFinal() + * @generated + * @ordered + */ + protected static final boolean FINAL_EDEFAULT = false; + + /** + * The default value of the '{@link #isStatic() Static}' attribute. + * + * + * + * @see #isStatic() + * @generated + * @ordered + */ + protected static final boolean STATIC_EDEFAULT = false; + + /** + * The cached value of the '{@link #getExceptions() Exceptions}' reference list. + * + * + * + * @see #getExceptions() + * @generated + * @ordered + */ + protected EList exceptions; + + /** + * The default value of the '{@link #isSynchronized() Synchronized}' attribute. + * + * + * + * @see #isSynchronized() + * @generated + * @ordered + */ + protected static final boolean SYNCHRONIZED_EDEFAULT = false; + + /** + * The default value of the '{@link #isConstructor() Constructor}' attribute. + * + * + * + * @see #isConstructor() + * @generated + * @ordered + */ + protected static final boolean CONSTRUCTOR_EDEFAULT = false; + + /** + * The cached value of the '{@link #isConstructor() Constructor}' attribute. + * + * + * + * @see #isConstructor() + * @generated + * @ordered + */ + protected boolean constructor = CONSTRUCTOR_EDEFAULT; + + /** + * The cached value of the '{@link #getBodies() Bodies}' containment reference list. + * + * + * + * @see #getBodies() + * @generated + * @ordered + */ + protected EList bodies; + + /** + * + * + * + * @generated + */ + protected JDTMethodImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_METHOD; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParameter getReturnType() { + return returnType; + } + + /** + * + * + * + * @generated + */ + public NotificationChain basicSetReturnType(JDTParameter newReturnType, NotificationChain msgs) { + JDTParameter oldReturnType = returnType; + returnType = newReturnType; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_METHOD__RETURN_TYPE, oldReturnType, newReturnType); + if (msgs == null) { + msgs = notification; + } else { + msgs.add(notification); + } + } + return msgs; + } + + /** + * + * + * + * @generated + */ + @Override + public void setReturnType(JDTParameter newReturnType) { + if (newReturnType != returnType) { + NotificationChain msgs = null; + if (returnType != null) { + msgs = ((InternalEObject) returnType).eInverseRemove(this, JdtmmPackage.JDT_PARAMETER__RETURN_OWNER, JDTParameter.class, msgs); + } + if (newReturnType != null) { + msgs = ((InternalEObject) newReturnType).eInverseAdd(this, JdtmmPackage.JDT_PARAMETER__RETURN_OWNER, JDTParameter.class, msgs); + } + msgs = basicSetReturnType(newReturnType, msgs); + if (msgs != null) { + msgs.dispatch(); + } + } + else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_METHOD__RETURN_TYPE, newReturnType, newReturnType)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public EList getParameters() { + if (parameters == null) { + parameters = new EObjectContainmentWithInverseEList(JDTParameter.class, this, JdtmmPackage.JDT_METHOD__PARAMETERS, JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER); + } + return parameters; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getExceptions() { + if (exceptions == null) { + exceptions = new EObjectResolvingEList(JDTType.class, this, JdtmmPackage.JDT_METHOD__EXCEPTIONS); + } + return exceptions; + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isSynchronized() { + // Ensure that you remove @generated or mark it @generated NOT + return isFlagSet(Flags.AccSynchronized); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setSynchronized(boolean newSynchronized) { + // Ensure that you remove @generated or mark it @generated NOT + setFlag(Flags.AccSynchronized, newSynchronized); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isConstructor() { + return constructor; + } + + /** + * + * + * + * @generated + */ + @Override + public void setConstructor(boolean newConstructor) { + boolean oldConstructor = constructor; + constructor = newConstructor; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_METHOD__CONSTRUCTOR, oldConstructor, constructor)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public EList getBodies() { + if (bodies == null) { + bodies = new EObjectContainmentWithInverseEList(JDTMethodBody.class, this, JdtmmPackage.JDT_METHOD__BODIES, JdtmmPackage.JDT_METHOD_BODY__OWNER); + } + return bodies; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTType getOwner() { + if (eContainerFeatureID() != JdtmmPackage.JDT_METHOD__OWNER) { + return null; + } + return (JDTType) eContainer(); + } + + /** + * + * + * + * @generated + */ + public NotificationChain basicSetOwner(JDTType newOwner, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newOwner, JdtmmPackage.JDT_METHOD__OWNER, msgs); + return msgs; + } + + /** + * + * + * + * @generated + */ + @Override + public void setOwner(JDTType newOwner) { + if (newOwner != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_METHOD__OWNER && newOwner != null)) { + if (EcoreUtil.isAncestor(this, newOwner)) { + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + } + NotificationChain msgs = null; + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + if (newOwner != null) { + msgs = ((InternalEObject) newOwner).eInverseAdd(this, JdtmmPackage.JDT_TYPE__METHODS, JDTType.class, msgs); + } + msgs = basicSetOwner(newOwner, msgs); + if (msgs != null) { + msgs.dispatch(); + } + } + else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_METHOD__OWNER, newOwner, newOwner)); + } + } + + /** + * + * + * + * @generated + */ + public boolean isSetOwner() { + return getOwner() != null; + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_METHOD__OWNER: + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetOwner((JDTType) otherEnd, msgs); + case JdtmmPackage.JDT_METHOD__RETURN_TYPE: + if (returnType != null) { + msgs = ((InternalEObject) returnType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JdtmmPackage.JDT_METHOD__RETURN_TYPE, null, msgs); + } + return basicSetReturnType((JDTParameter) otherEnd, msgs); + case JdtmmPackage.JDT_METHOD__PARAMETERS: + return ((InternalEList) (InternalEList) getParameters()).basicAdd(otherEnd, msgs); + case JdtmmPackage.JDT_METHOD__BODIES: + return ((InternalEList) (InternalEList) getBodies()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_METHOD__OWNER: + return basicSetOwner(null, msgs); + case JdtmmPackage.JDT_METHOD__RETURN_TYPE: + return basicSetReturnType(null, msgs); + case JdtmmPackage.JDT_METHOD__PARAMETERS: + return ((InternalEList) getParameters()).basicRemove(otherEnd, msgs); + case JdtmmPackage.JDT_METHOD__BODIES: + return ((InternalEList) getBodies()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case JdtmmPackage.JDT_METHOD__OWNER: + return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_TYPE__METHODS, JDTType.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_METHOD__OWNER: + return getOwner(); + case JdtmmPackage.JDT_METHOD__RETURN_TYPE: + return getReturnType(); + case JdtmmPackage.JDT_METHOD__PARAMETERS: + return getParameters(); + case JdtmmPackage.JDT_METHOD__ABSTRACT: + return isAbstract(); + case JdtmmPackage.JDT_METHOD__FINAL: + return isFinal(); + case JdtmmPackage.JDT_METHOD__STATIC: + return isStatic(); + case JdtmmPackage.JDT_METHOD__EXCEPTIONS: + return getExceptions(); + case JdtmmPackage.JDT_METHOD__SYNCHRONIZED: + return isSynchronized(); + case JdtmmPackage.JDT_METHOD__CONSTRUCTOR: + return isConstructor(); + case JdtmmPackage.JDT_METHOD__BODIES: + return getBodies(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_METHOD__OWNER: + setOwner((JDTType) newValue); + return; + case JdtmmPackage.JDT_METHOD__RETURN_TYPE: + setReturnType((JDTParameter) newValue); + return; + case JdtmmPackage.JDT_METHOD__PARAMETERS: + getParameters().clear(); + getParameters().addAll((Collection) newValue); + return; + case JdtmmPackage.JDT_METHOD__ABSTRACT: + setAbstract((Boolean) newValue); + return; + case JdtmmPackage.JDT_METHOD__FINAL: + setFinal((Boolean) newValue); + return; + case JdtmmPackage.JDT_METHOD__STATIC: + setStatic((Boolean) newValue); + return; + case JdtmmPackage.JDT_METHOD__EXCEPTIONS: + getExceptions().clear(); + getExceptions().addAll((Collection) newValue); + return; + case JdtmmPackage.JDT_METHOD__SYNCHRONIZED: + setSynchronized((Boolean) newValue); + return; + case JdtmmPackage.JDT_METHOD__CONSTRUCTOR: + setConstructor((Boolean) newValue); + return; + case JdtmmPackage.JDT_METHOD__BODIES: + getBodies().clear(); + getBodies().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_METHOD__OWNER: + setOwner((JDTType) null); + return; + case JdtmmPackage.JDT_METHOD__RETURN_TYPE: + setReturnType((JDTParameter) null); + return; + case JdtmmPackage.JDT_METHOD__PARAMETERS: + getParameters().clear(); + return; + case JdtmmPackage.JDT_METHOD__ABSTRACT: + setAbstract(ABSTRACT_EDEFAULT); + return; + case JdtmmPackage.JDT_METHOD__FINAL: + setFinal(FINAL_EDEFAULT); + return; + case JdtmmPackage.JDT_METHOD__STATIC: + setStatic(STATIC_EDEFAULT); + return; + case JdtmmPackage.JDT_METHOD__EXCEPTIONS: + getExceptions().clear(); + return; + case JdtmmPackage.JDT_METHOD__SYNCHRONIZED: + setSynchronized(SYNCHRONIZED_EDEFAULT); + return; + case JdtmmPackage.JDT_METHOD__CONSTRUCTOR: + setConstructor(CONSTRUCTOR_EDEFAULT); + return; + case JdtmmPackage.JDT_METHOD__BODIES: + getBodies().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_METHOD__OWNER: + return isSetOwner(); + case JdtmmPackage.JDT_METHOD__RETURN_TYPE: + return returnType != null; + case JdtmmPackage.JDT_METHOD__PARAMETERS: + return parameters != null && !parameters.isEmpty(); + case JdtmmPackage.JDT_METHOD__ABSTRACT: + return isAbstract() != ABSTRACT_EDEFAULT; + case JdtmmPackage.JDT_METHOD__FINAL: + return isFinal() != FINAL_EDEFAULT; + case JdtmmPackage.JDT_METHOD__STATIC: + return isStatic() != STATIC_EDEFAULT; + case JdtmmPackage.JDT_METHOD__EXCEPTIONS: + return exceptions != null && !exceptions.isEmpty(); + case JdtmmPackage.JDT_METHOD__SYNCHRONIZED: + return isSynchronized() != SYNCHRONIZED_EDEFAULT; + case JdtmmPackage.JDT_METHOD__CONSTRUCTOR: + return constructor != CONSTRUCTOR_EDEFAULT; + case JdtmmPackage.JDT_METHOD__BODIES: + return bodies != null && !bodies.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (constructor: "); + result.append(constructor); + result.append(')'); + return result.toString(); + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParent getParent() { + return getOwner(); + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParent basicGetParent() { + return getOwner(); + } + + /** + * + * + * + * @generated + */ + public boolean isSetParent() { + return false; + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isAbstract() { + // Ensure that you remove @generated or mark it @generated NOT + return isFlagSet(Flags.AccAbstract); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isFinal() { + // Ensure that you remove @generated or mark it @generated NOT + return isFlagSet(Flags.AccFinal); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isStatic() { + return isFlagSet(Flags.AccStatic); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setAbstract(boolean newAbstract) { + // Ensure that you remove @generated or mark it @generated NOT + setFlag(Flags.AccAbstract, newAbstract); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setFinal(boolean newFinal) { + + setFlag(Flags.AccFinal, newFinal); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setStatic(boolean newStatic) { + setFlag(Flags.AccStatic, newStatic); + } + + @Override + public String getJDTSignature() { + List lst = new ArrayList(); + + // signature of parameter + for (JDTParameter p : parameters) { + lst.add(p.getJDTSignature()); + } + + String[] params = new String[lst.size()]; + lst.toArray(params); + + // signature of return + String returnTypeStr = Signature.createTypeSignature("void", false); + if (returnType != null) { + returnTypeStr = returnType.getJDTSignature(); + } + + return Signature.createMethodSignature(params, returnTypeStr); + } + + +} // JDTMethodImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTOpaqueBodyImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTOpaqueBodyImpl.java new file mode 100644 index 00000000000..13f1b15dd2b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTOpaqueBodyImpl.java @@ -0,0 +1,191 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * An implementation of the model object 'JDT Opaque Body'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTOpaqueBodyImpl#get_body body}
    • + *
    + *

    + * + * @generated + */ +public class JDTOpaqueBodyImpl extends JDTMethodBodyImpl implements JDTOpaqueBody { + /** + * The default value of the '{@link #get_body() body}' attribute. + * + * + * + * @see #get_body() + * @generated + * @ordered + */ + protected static final String _BODY_EDEFAULT = null; + + /** + * The cached value of the '{@link #get_body() body}' attribute. + * + * + * + * @see #get_body() + * @generated + * @ordered + */ + protected String _body = _BODY_EDEFAULT; + + /** + * + * + * + * @generated + */ + protected JDTOpaqueBodyImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_OPAQUE_BODY; + } + + /** + * + * + * + * @generated + */ + @Override + public String get_body() { + return _body; + } + + /** + * + * + * + * @generated + */ + @Override + public void set_body(String new_body) { + String old_body = _body; + _body = new_body; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_OPAQUE_BODY__BODY, old_body, _body)); + } + } + + /** + * + * + * + * @generated NOT + */ + @Override + public String asText() { + return get_body(); + } + + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_OPAQUE_BODY__BODY: + return get_body(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_OPAQUE_BODY__BODY: + set_body((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_OPAQUE_BODY__BODY: + set_body(_BODY_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_OPAQUE_BODY__BODY: + return _BODY_EDEFAULT == null ? _body != null : !_BODY_EDEFAULT.equals(_body); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (_body: "); + result.append(_body); + result.append(')'); + return result.toString(); + } + +} // JDTOpaqueBodyImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentImpl.java new file mode 100644 index 00000000000..d3eff0ac3cb --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentImpl.java @@ -0,0 +1,376 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; +import org.eclipse.uml2.common.util.SubsetSupersetEObjectContainmentWithInverseEList; + +/** + * + * An implementation of the model object 'JDT Package Fragment'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl#getChildren Children}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl#getPackageFragmentRoot Package Fragment Root}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentImpl#getCompilationUnits Compilation Units}
    • + *
    + *

    + * + * @generated + */ +public class JDTPackageFragmentImpl extends JDTParentJavaElementImpl implements JDTPackageFragment { + + /** + * The cached value of the '{@link #getCompilationUnits() Compilation Units}' containment reference list. + * + * + * + * @see #getCompilationUnits() + * @generated + * @ordered + */ + protected EList compilationUnits; + + /** + * + * + * + * @generated + */ + protected JDTPackageFragmentImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getChildren() { + return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_PACKAGE_FRAGMENT__CHILDREN, CHILDREN_ESUBSETS); + } + + /** + * The array of subset feature identifiers for the '{@link #getChildren() Children}' reference list. + * + * + * + * @see #getChildren() + * @generated + * @ordered + */ + protected static final int[] CHILDREN_ESUBSETS = new int[] { JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS }; + + /** + * + * + * + * @generated + */ + @Override + public JDTPackageFragmentRoot getPackageFragmentRoot() { + if (eContainerFeatureID() != JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT) { + return null; + } + return (JDTPackageFragmentRoot) eContainer(); + } + + /** + * + * + * + * @generated + */ + public NotificationChain basicSetPackageFragmentRoot(JDTPackageFragmentRoot newPackageFragmentRoot, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newPackageFragmentRoot, JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT, msgs); + return msgs; + } + + /** + * + * + * + * @generated + */ + @Override + public void setPackageFragmentRoot(JDTPackageFragmentRoot newPackageFragmentRoot) { + if (newPackageFragmentRoot != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT && newPackageFragmentRoot != null)) { + if (EcoreUtil.isAncestor(this, newPackageFragmentRoot)) { + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + } + NotificationChain msgs = null; + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + if (newPackageFragmentRoot != null) { + msgs = ((InternalEObject) newPackageFragmentRoot).eInverseAdd(this, JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS, JDTPackageFragmentRoot.class, msgs); + } + msgs = basicSetPackageFragmentRoot(newPackageFragmentRoot, msgs); + if (msgs != null) { + msgs.dispatch(); + } + } + else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT, newPackageFragmentRoot, newPackageFragmentRoot)); + } + } + + /** + * + * + * + * @generated + */ + public boolean isSetPackageFragmentRoot() { + return getPackageFragmentRoot() != null; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getCompilationUnits() { + if (compilationUnits == null) { + compilationUnits = new SubsetSupersetEObjectContainmentWithInverseEList(JDTCompilationUnit.class, this, JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS, COMPILATION_UNITS_ESUPERSETS, null, + JdtmmPackage.JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT); + } + return compilationUnits; + } + + /** + * The array of superset feature identifiers for the '{@link #getCompilationUnits() Compilation Units}' containment reference list. + * + * + * + * @see #getCompilationUnits() + * @generated + * @ordered + */ + protected static final int[] COMPILATION_UNITS_ESUPERSETS = new int[] { JdtmmPackage.JDT_PACKAGE_FRAGMENT__CHILDREN }; + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetPackageFragmentRoot((JDTPackageFragmentRoot) otherEnd, msgs); + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: + return ((InternalEList) (InternalEList) getCompilationUnits()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: + return basicSetPackageFragmentRoot(null, msgs); + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: + return ((InternalEList) getCompilationUnits()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: + return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS, JDTPackageFragmentRoot.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: + return getPackageFragmentRoot(); + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: + return getCompilationUnits(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: + setPackageFragmentRoot((JDTPackageFragmentRoot) newValue); + return; + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: + getCompilationUnits().clear(); + getCompilationUnits().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: + setPackageFragmentRoot((JDTPackageFragmentRoot) null); + return; + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: + getCompilationUnits().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT: + return isSetPackageFragmentRoot(); + case JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS: + return compilationUnits != null && !compilationUnits.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isSetChildren() { + return super.isSetChildren() + || eIsSet(JdtmmPackage.JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS); + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParent getParent() { + return getPackageFragmentRoot(); + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParent basicGetParent() { + return getPackageFragmentRoot(); + } + + /** + * + * + * + * @generated + */ + public boolean isSetParent() { + return false; + } + +} // JDTPackageFragmentImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentRootImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentRootImpl.java new file mode 100644 index 00000000000..07c30c7406f --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTPackageFragmentRootImpl.java @@ -0,0 +1,376 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; +import org.eclipse.uml2.common.util.SubsetSupersetEObjectContainmentWithInverseEList; + +/** + * + * An implementation of the model object 'JDT Package Fragment Root'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl#getChildren Children}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl#getJavaProject Java Project}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTPackageFragmentRootImpl#getPackageFragments Package Fragments}
    • + *
    + *

    + * + * @generated + */ +public class JDTPackageFragmentRootImpl extends JDTParentJavaElementImpl implements JDTPackageFragmentRoot { + + /** + * The cached value of the '{@link #getPackageFragments() Package Fragments}' containment reference list. + * + * + * + * @see #getPackageFragments() + * @generated + * @ordered + */ + protected EList packageFragments; + + /** + * + * + * + * @generated + */ + protected JDTPackageFragmentRootImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_PACKAGE_FRAGMENT_ROOT; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getChildren() { + return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__CHILDREN, CHILDREN_ESUBSETS); + } + + /** + * The array of subset feature identifiers for the '{@link #getChildren() Children}' reference list. + * + * + * + * @see #getChildren() + * @generated + * @ordered + */ + protected static final int[] CHILDREN_ESUBSETS = new int[] { JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS }; + + /** + * + * + * + * @generated + */ + @Override + public JDTJavaProject getJavaProject() { + if (eContainerFeatureID() != JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT) { + return null; + } + return (JDTJavaProject) eContainer(); + } + + /** + * + * + * + * @generated + */ + public NotificationChain basicSetJavaProject(JDTJavaProject newJavaProject, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newJavaProject, JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT, msgs); + return msgs; + } + + /** + * + * + * + * @generated + */ + @Override + public void setJavaProject(JDTJavaProject newJavaProject) { + if (newJavaProject != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT && newJavaProject != null)) { + if (EcoreUtil.isAncestor(this, newJavaProject)) { + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + } + NotificationChain msgs = null; + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + if (newJavaProject != null) { + msgs = ((InternalEObject) newJavaProject).eInverseAdd(this, JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS, JDTJavaProject.class, msgs); + } + msgs = basicSetJavaProject(newJavaProject, msgs); + if (msgs != null) { + msgs.dispatch(); + } + } + else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT, newJavaProject, newJavaProject)); + } + } + + /** + * + * + * + * @generated + */ + public boolean isSetJavaProject() { + return getJavaProject() != null; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getPackageFragments() { + if (packageFragments == null) { + packageFragments = new SubsetSupersetEObjectContainmentWithInverseEList(JDTPackageFragment.class, this, JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS, PACKAGE_FRAGMENTS_ESUPERSETS, null, + JdtmmPackage.JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT); + } + return packageFragments; + } + + /** + * The array of superset feature identifiers for the '{@link #getPackageFragments() Package Fragments}' containment reference list. + * + * + * + * @see #getPackageFragments() + * @generated + * @ordered + */ + protected static final int[] PACKAGE_FRAGMENTS_ESUPERSETS = new int[] { JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__CHILDREN }; + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetJavaProject((JDTJavaProject) otherEnd, msgs); + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: + return ((InternalEList) (InternalEList) getPackageFragments()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: + return basicSetJavaProject(null, msgs); + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: + return ((InternalEList) getPackageFragments()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: + return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS, JDTJavaProject.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: + return getJavaProject(); + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: + return getPackageFragments(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: + setJavaProject((JDTJavaProject) newValue); + return; + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: + getPackageFragments().clear(); + getPackageFragments().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: + setJavaProject((JDTJavaProject) null); + return; + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: + getPackageFragments().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT: + return isSetJavaProject(); + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS: + return packageFragments != null && !packageFragments.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isSetChildren() { + return super.isSetChildren() + || eIsSet(JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS); + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParent getParent() { + return getJavaProject(); + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParent basicGetParent() { + return getJavaProject(); + } + + /** + * + * + * + * @generated + */ + public boolean isSetParent() { + return false; + } + +} // JDTPackageFragmentRootImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParameterImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParameterImpl.java new file mode 100644 index 00000000000..587f6e113d2 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParameterImpl.java @@ -0,0 +1,515 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.jdt.core.Flags; +import org.eclipse.jdt.core.Signature; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util.JdtmmPreference; + +/** + * + * An implementation of the model object 'JDT Parameter'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl#getParameterOwner Parameter Owner}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl#isFinal Final}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl#isMultiValued Is Multi Valued}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl#getType Type}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParameterImpl#getReturnOwner Return Owner}
    • + *
    + *

    + * + * @generated + */ +public class JDTParameterImpl extends JDTMemberImpl implements JDTParameter { + + /** + * The default value of the '{@link #isFinal() Final}' attribute. + * + * + * + * @see #isFinal() + * @generated + * @ordered + */ + protected static final boolean FINAL_EDEFAULT = false; + + /** + * The default value of the '{@link #isMultiValued() Is Multi Valued}' attribute. + * + * + * + * @see #isMultiValued() + * @generated + * @ordered + */ + protected static final boolean IS_MULTI_VALUED_EDEFAULT = false; + + /** + * The cached value of the '{@link #isMultiValued() Is Multi Valued}' attribute. + * + * + * + * @see #isMultiValued() + * @generated + * @ordered + */ + protected boolean isMultiValued = IS_MULTI_VALUED_EDEFAULT; + + /** + * The cached value of the '{@link #getType() Type}' reference. + * + * + * + * @see #getType() + * @generated + * @ordered + */ + protected JDTType type; + + /** + * + * + * + * @generated + */ + protected JDTParameterImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_PARAMETER; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTMethod getParameterOwner() { + if (eContainerFeatureID() != JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER) { + return null; + } + return (JDTMethod) eContainer(); + } + + /** + * + * + * + * @generated + */ + public NotificationChain basicSetParameterOwner(JDTMethod newParameterOwner, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newParameterOwner, JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER, msgs); + return msgs; + } + + /** + * + * + * + * @generated + */ + @Override + public void setParameterOwner(JDTMethod newParameterOwner) { + if (newParameterOwner != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER && newParameterOwner != null)) { + if (EcoreUtil.isAncestor(this, newParameterOwner)) { + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + } + NotificationChain msgs = null; + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + if (newParameterOwner != null) { + msgs = ((InternalEObject) newParameterOwner).eInverseAdd(this, JdtmmPackage.JDT_METHOD__PARAMETERS, JDTMethod.class, msgs); + } + msgs = basicSetParameterOwner(newParameterOwner, msgs); + if (msgs != null) { + msgs.dispatch(); + } + } + else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER, newParameterOwner, newParameterOwner)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isMultiValued() { + return isMultiValued; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsMultiValued(boolean newIsMultiValued) { + boolean oldIsMultiValued = isMultiValued; + isMultiValued = newIsMultiValued; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PARAMETER__IS_MULTI_VALUED, oldIsMultiValued, isMultiValued)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public JDTType getType() { + if (type != null && type.eIsProxy()) { + InternalEObject oldType = (InternalEObject) type; + type = (JDTType) eResolveProxy(oldType); + if (type != oldType) { + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.RESOLVE, JdtmmPackage.JDT_PARAMETER__TYPE, oldType, type)); + } + } + } + return type; + } + + /** + * + * + * + * @generated + */ + public JDTType basicGetType() { + return type; + } + + /** + * + * + * + * @generated + */ + @Override + public void setType(JDTType newType) { + JDTType oldType = type; + type = newType; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PARAMETER__TYPE, oldType, type)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public JDTMethod getReturnOwner() { + if (eContainerFeatureID() != JdtmmPackage.JDT_PARAMETER__RETURN_OWNER) { + return null; + } + return (JDTMethod) eContainer(); + } + + /** + * + * + * + * @generated + */ + public NotificationChain basicSetReturnOwner(JDTMethod newReturnOwner, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newReturnOwner, JdtmmPackage.JDT_PARAMETER__RETURN_OWNER, msgs); + return msgs; + } + + /** + * + * + * + * @generated + */ + @Override + public void setReturnOwner(JDTMethod newReturnOwner) { + if (newReturnOwner != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_PARAMETER__RETURN_OWNER && newReturnOwner != null)) { + if (EcoreUtil.isAncestor(this, newReturnOwner)) { + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + } + NotificationChain msgs = null; + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + if (newReturnOwner != null) { + msgs = ((InternalEObject) newReturnOwner).eInverseAdd(this, JdtmmPackage.JDT_METHOD__RETURN_TYPE, JDTMethod.class, msgs); + } + msgs = basicSetReturnOwner(newReturnOwner, msgs); + if (msgs != null) { + msgs.dispatch(); + } + } + else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PARAMETER__RETURN_OWNER, newReturnOwner, newReturnOwner)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetParameterOwner((JDTMethod) otherEnd, msgs); + case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetReturnOwner((JDTMethod) otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: + return basicSetParameterOwner(null, msgs); + case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: + return basicSetReturnOwner(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: + return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_METHOD__PARAMETERS, JDTMethod.class, msgs); + case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: + return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_METHOD__RETURN_TYPE, JDTMethod.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: + return getParameterOwner(); + case JdtmmPackage.JDT_PARAMETER__FINAL: + return isFinal(); + case JdtmmPackage.JDT_PARAMETER__IS_MULTI_VALUED: + return isMultiValued(); + case JdtmmPackage.JDT_PARAMETER__TYPE: + if (resolve) { + return getType(); + } + return basicGetType(); + case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: + return getReturnOwner(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: + setParameterOwner((JDTMethod) newValue); + return; + case JdtmmPackage.JDT_PARAMETER__FINAL: + setFinal((Boolean) newValue); + return; + case JdtmmPackage.JDT_PARAMETER__IS_MULTI_VALUED: + setIsMultiValued((Boolean) newValue); + return; + case JdtmmPackage.JDT_PARAMETER__TYPE: + setType((JDTType) newValue); + return; + case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: + setReturnOwner((JDTMethod) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: + setParameterOwner((JDTMethod) null); + return; + case JdtmmPackage.JDT_PARAMETER__FINAL: + setFinal(FINAL_EDEFAULT); + return; + case JdtmmPackage.JDT_PARAMETER__IS_MULTI_VALUED: + setIsMultiValued(IS_MULTI_VALUED_EDEFAULT); + return; + case JdtmmPackage.JDT_PARAMETER__TYPE: + setType((JDTType) null); + return; + case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: + setReturnOwner((JDTMethod) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_PARAMETER__PARAMETER_OWNER: + return getParameterOwner() != null; + case JdtmmPackage.JDT_PARAMETER__FINAL: + return isFinal() != FINAL_EDEFAULT; + case JdtmmPackage.JDT_PARAMETER__IS_MULTI_VALUED: + return isMultiValued != IS_MULTI_VALUED_EDEFAULT; + case JdtmmPackage.JDT_PARAMETER__TYPE: + return type != null; + case JdtmmPackage.JDT_PARAMETER__RETURN_OWNER: + return getReturnOwner() != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (isMultiValued: "); + result.append(isMultiValued); + result.append(')'); + return result.toString(); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isFinal() { + // TODO: implement this method to return the 'Final' attribute + // Ensure that you remove @generated or mark it @generated NOT + return isFlagSet(Flags.AccFinal); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setFinal(boolean newFinal) { + + setFlag(Flags.AccFinal, newFinal); + } + + @Override + public String getJDTSignature() { + if (this.isMultiValued()) { + return Signature.createTypeSignature(JdtmmPreference.getMultiValued(type.getElementName()), false); + } + return type.getJDTSignature(); + } +} // JDTParameterImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentImpl.java new file mode 100644 index 00000000000..6307b67f243 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentImpl.java @@ -0,0 +1,254 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; + +/** + * + * An implementation of the model object 'JDT Parent'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentImpl#getChildren Children}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentImpl#getFlags Flags}
    • + *
    + *

    + * + * @generated + */ +public abstract class JDTParentImpl extends EObjectImpl implements JDTParent { + + /** + * The default value of the '{@link #getFlags() Flags}' attribute. + * + * + * + * @see #getFlags() + * @generated + * @ordered + */ + protected static final int FLAGS_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getFlags() Flags}' attribute. + * + * + * + * @see #getFlags() + * @generated + * @ordered + */ + protected int flags = FLAGS_EDEFAULT; + + /** + * + * + * + * @generated + */ + protected JDTParentImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_PARENT; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getChildren() { + return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_PARENT__CHILDREN, null); + } + + /** + * + * + * + * @generated + */ + @Override + public int getFlags() { + return flags; + } + + /** + * + * + * + * @generated + */ + @Override + public void setFlags(int newFlags) { + int oldFlags = flags; + flags = newFlags; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PARENT__FLAGS, oldFlags, flags)); + } + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setFlag(int flag, boolean value) { + + if (value == true) { + setFlags(getFlags() | (flag)); + } else { + setFlags(getFlags() & ~(flag)); + } + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isFlagSet(int flag) { + + return (getFlags() & flag) != 0; + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_PARENT__CHILDREN: + return getChildren(); + case JdtmmPackage.JDT_PARENT__FLAGS: + return getFlags(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_PARENT__FLAGS: + setFlags((Integer) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_PARENT__FLAGS: + setFlags(FLAGS_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_PARENT__CHILDREN: + return isSetChildren(); + case JdtmmPackage.JDT_PARENT__FLAGS: + return flags != FLAGS_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (flags: "); + result.append(flags); + result.append(')'); + return result.toString(); + } + + /** + * + * + * + * @generated + */ + public boolean isSetChildren() { + return false; + } + +} // JDTParentImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentJavaElementImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentJavaElementImpl.java new file mode 100644 index 00000000000..7a45658d162 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTParentJavaElementImpl.java @@ -0,0 +1,296 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; + +/** + * + * An implementation of the model object 'JDT Parent Java Element'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentJavaElementImpl#getChildren Children}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTParentJavaElementImpl#getFlags Flags}
    • + *
    + *

    + * + * @generated + */ +public abstract class JDTParentJavaElementImpl extends JDTJavaElementImpl implements JDTParentJavaElement { + + /** + * The default value of the '{@link #getFlags() Flags}' attribute. + * + * + * + * @see #getFlags() + * @generated + * @ordered + */ + protected static final int FLAGS_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getFlags() Flags}' attribute. + * + * + * + * @see #getFlags() + * @generated + * @ordered + */ + protected int flags = FLAGS_EDEFAULT; + + /** + * + * + * + * @generated + */ + protected JDTParentJavaElementImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_PARENT_JAVA_ELEMENT; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getChildren() { + return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__CHILDREN, null); + } + + /** + * + * + * + * @generated + */ + @Override + public int getFlags() { + return flags; + } + + /** + * + * + * + * @generated + */ + @Override + public void setFlags(int newFlags) { + int oldFlags = flags; + flags = newFlags; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS, oldFlags, flags)); + } + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setFlag(int flag, boolean value) { + + if (value == true) { + setFlags(getFlags() | (flag)); + } else { + setFlags(getFlags() & ~(flag)); + } + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isFlagSet(int flag) { + + return (getFlags() & flag) != 0; + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__CHILDREN: + return getChildren(); + case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS: + return getFlags(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS: + setFlags((Integer) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS: + setFlags(FLAGS_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__CHILDREN: + return isSetChildren(); + case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS: + return flags != FLAGS_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == JDTParent.class) { + switch (derivedFeatureID) { + case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__CHILDREN: + return JdtmmPackage.JDT_PARENT__CHILDREN; + case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS: + return JdtmmPackage.JDT_PARENT__FLAGS; + default: + return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == JDTParent.class) { + switch (baseFeatureID) { + case JdtmmPackage.JDT_PARENT__CHILDREN: + return JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__CHILDREN; + case JdtmmPackage.JDT_PARENT__FLAGS: + return JdtmmPackage.JDT_PARENT_JAVA_ELEMENT__FLAGS; + default: + return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (flags: "); + result.append(flags); + result.append(')'); + return result.toString(); + } + + /** + * + * + * + * @generated + */ + public boolean isSetChildren() { + return false; + } + +} // JDTParentJavaElementImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeImpl.java new file mode 100644 index 00000000000..554572a55be --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeImpl.java @@ -0,0 +1,1117 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.notify.NotifyingList; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.jdt.core.Flags; +import org.eclipse.jdt.core.Signature; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.utils.DerivedNotifyingEList; +import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; +import org.eclipse.uml2.common.util.SubsetSupersetEObjectContainmentWithInverseEList; + +/** + * + * An implementation of the model object 'JDT Type'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getChildren Children}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getMethods Methods}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getFields Fields}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getCompilationUnit Compilation Unit}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#isClass Class}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#isInterface Interface}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#isEnum Enum}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#isAbstract Abstract}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#isFinal Final}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#isStatic Static}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getTypes Types}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getOwner Owner}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getSuperInterfaces Super Interfaces}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getSuperClass Super Class}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getSuperInterfaceNames Super Interface Names}
    • + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeImpl#getSuperClassName Super Class Name}
    • + *
    + *

    + * + * @generated + */ +public abstract class JDTTypeImpl extends JDTMemberImpl implements JDTType { + + /** + * The cached value of the '{@link #getMethods() Methods}' containment reference list. + * + * + * + * @see #getMethods() + * @generated + * @ordered + */ + protected EList methods; + + /** + * The cached value of the '{@link #getFields() Fields}' containment reference list. + * + * + * + * @see #getFields() + * @generated + * @ordered + */ + protected EList fields; + + /** + * The default value of the '{@link #isClass() Class}' attribute. + * + * + * + * @see #isClass() + * @generated + * @ordered + */ + protected static final boolean CLASS_EDEFAULT = false; + + /** + * The cached value of the '{@link #isClass() Class}' attribute. + * + * + * + * @see #isClass() + * @generated + * @ordered + */ + protected boolean class_ = CLASS_EDEFAULT; + + /** + * The default value of the '{@link #isInterface() Interface}' attribute. + * + * + * + * @see #isInterface() + * @generated + * @ordered + */ + protected static final boolean INTERFACE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isInterface() Interface}' attribute. + * + * + * + * @see #isInterface() + * @generated + * @ordered + */ + protected boolean interface_ = INTERFACE_EDEFAULT; + + /** + * The default value of the '{@link #isEnum() Enum}' attribute. + * + * + * + * @see #isEnum() + * @generated + * @ordered + */ + protected static final boolean ENUM_EDEFAULT = false; + + /** + * The cached value of the '{@link #isEnum() Enum}' attribute. + * + * + * + * @see #isEnum() + * @generated + * @ordered + */ + protected boolean enum_ = ENUM_EDEFAULT; + + /** + * The default value of the '{@link #isAbstract() Abstract}' attribute. + * + * + * + * @see #isAbstract() + * @generated + * @ordered + */ + protected static final boolean ABSTRACT_EDEFAULT = false; + + /** + * The default value of the '{@link #isFinal() Final}' attribute. + * + * + * + * @see #isFinal() + * @generated + * @ordered + */ + protected static final boolean FINAL_EDEFAULT = false; + + /** + * The default value of the '{@link #isStatic() Static}' attribute. + * + * + * + * @see #isStatic() + * @generated + * @ordered + */ + protected static final boolean STATIC_EDEFAULT = false; + + /** + * The cached value of the '{@link #getTypes() Types}' containment reference list. + * + * + * + * @see #getTypes() + * @generated + * @ordered + */ + protected EList types; + + /** + * The cached value of the '{@link #getSuperInterfaces() Super Interfaces}' reference list. + * + * + * + * @see #getSuperInterfaces() + * @generated + * @ordered + */ + protected EList superInterfaces; + + /** + * The cached value of the '{@link #getSuperClass() Super Class}' reference. + * + * + * + * @see #getSuperClass() + * @generated + * @ordered + */ + protected JDTType superClass; + + /** + * The default value of the '{@link #getSuperClassName() Super Class Name}' attribute. + * + * + * + * @see #getSuperClassName() + * @generated + * @ordered + */ + protected static final String SUPER_CLASS_NAME_EDEFAULT = null; + + /** + * + * + * + * @generated + */ + protected JDTTypeImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_TYPE; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getChildren() { + return new DerivedUnionEObjectEList(JDTJavaElement.class, this, JdtmmPackage.JDT_TYPE__CHILDREN, CHILDREN_ESUBSETS); + } + + /** + * The array of subset feature identifiers for the '{@link #getChildren() Children}' reference list. + * + * + * + * @see #getChildren() + * @generated + * @ordered + */ + protected static final int[] CHILDREN_ESUBSETS = new int[] { JdtmmPackage.JDT_TYPE__METHODS, JdtmmPackage.JDT_TYPE__FIELDS, JdtmmPackage.JDT_TYPE__TYPES }; + + /** + * + * + * + * @generated + */ + @Override + public EList getMethods() { + if (methods == null) { + methods = new SubsetSupersetEObjectContainmentWithInverseEList(JDTMethod.class, this, JdtmmPackage.JDT_TYPE__METHODS, METHODS_ESUPERSETS, null, JdtmmPackage.JDT_METHOD__OWNER); + } + return methods; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTCompilationUnit getCompilationUnit() { + if (eContainerFeatureID() != JdtmmPackage.JDT_TYPE__COMPILATION_UNIT) { + return null; + } + return (JDTCompilationUnit) eContainer(); + } + + /** + * + * + * + * @generated + */ + public NotificationChain basicSetCompilationUnit(JDTCompilationUnit newCompilationUnit, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newCompilationUnit, JdtmmPackage.JDT_TYPE__COMPILATION_UNIT, msgs); + return msgs; + } + + /** + * + * + * + * @generated + */ + @Override + public void setCompilationUnit(JDTCompilationUnit newCompilationUnit) { + if (newCompilationUnit != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_TYPE__COMPILATION_UNIT && newCompilationUnit != null)) { + if (EcoreUtil.isAncestor(this, newCompilationUnit)) { + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + } + NotificationChain msgs = null; + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + if (newCompilationUnit != null) { + msgs = ((InternalEObject) newCompilationUnit).eInverseAdd(this, JdtmmPackage.JDT_COMPILATION_UNIT__TYPES, JDTCompilationUnit.class, msgs); + } + msgs = basicSetCompilationUnit(newCompilationUnit, msgs); + if (msgs != null) { + msgs.dispatch(); + } + } + else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE__COMPILATION_UNIT, newCompilationUnit, newCompilationUnit)); + } + } + + /** + * + * + * + * @generated + */ + public boolean isSetCompilationUnit() { + return getCompilationUnit() != null; + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isClass() { + return class_; + } + + /** + * + * + * + * @generated + */ + @Override + public void setClass_(boolean newClass) { + boolean oldClass = class_; + class_ = newClass; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE__CLASS, oldClass, class_)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isInterface() { + return interface_; + } + + /** + * + * + * + * @generated + */ + @Override + public void setInterface(boolean newInterface) { + boolean oldInterface = interface_; + interface_ = newInterface; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE__INTERFACE, oldInterface, interface_)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isEnum() { + return enum_; + } + + /** + * + * + * + * @generated + */ + @Override + public void setEnum(boolean newEnum) { + boolean oldEnum = enum_; + enum_ = newEnum; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE__ENUM, oldEnum, enum_)); + } + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isAbstract() { + // Ensure that you remove @generated or mark it @generated NOT + return isFlagSet(Flags.AccAbstract); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setAbstract(boolean newAbstract) { + // Ensure that you remove @generated or mark it @generated NOT + setFlag(Flags.AccAbstract, newAbstract); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isFinal() { + // TODO: implement this method to return the 'Final' attribute + // Ensure that you remove @generated or mark it @generated NOT + return isFlagSet(Flags.AccFinal); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setFinal(boolean newFinal) { + + setFlag(Flags.AccFinal, newFinal); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isStatic() { + return isFlagSet(Flags.AccStatic); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setStatic(boolean newStatic) { + setFlag(Flags.AccStatic, newStatic); + } + + /** + * + * + * + * @generated + */ + @Override + public EList getTypes() { + if (types == null) { + types = new SubsetSupersetEObjectContainmentWithInverseEList(JDTType.class, this, JdtmmPackage.JDT_TYPE__TYPES, TYPES_ESUPERSETS, null, JdtmmPackage.JDT_TYPE__OWNER); + } + return types; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTType getOwner() { + if (eContainerFeatureID() != JdtmmPackage.JDT_TYPE__OWNER) { + return null; + } + return (JDTType) eContainer(); + } + + /** + * + * + * + * @generated + */ + public NotificationChain basicSetOwner(JDTType newOwner, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newOwner, JdtmmPackage.JDT_TYPE__OWNER, msgs); + return msgs; + } + + /** + * + * + * + * @generated + */ + @Override + public void setOwner(JDTType newOwner) { + if (newOwner != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_TYPE__OWNER && newOwner != null)) { + if (EcoreUtil.isAncestor(this, newOwner)) { + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + } + NotificationChain msgs = null; + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + if (newOwner != null) { + msgs = ((InternalEObject) newOwner).eInverseAdd(this, JdtmmPackage.JDT_TYPE__TYPES, JDTType.class, msgs); + } + msgs = basicSetOwner(newOwner, msgs); + if (msgs != null) { + msgs.dispatch(); + } + } + else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE__OWNER, newOwner, newOwner)); + } + } + + /** + * + * + * + * @generated + */ + public boolean isSetOwner() { + return getOwner() != null; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getSuperInterfaces() { + if (superInterfaces == null) { + superInterfaces = new EObjectResolvingEList(JDTType.class, this, JdtmmPackage.JDT_TYPE__SUPER_INTERFACES); + } + return superInterfaces; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTType getSuperClass() { + if (superClass != null && superClass.eIsProxy()) { + InternalEObject oldSuperClass = (InternalEObject) superClass; + superClass = (JDTType) eResolveProxy(oldSuperClass); + if (superClass != oldSuperClass) { + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.RESOLVE, JdtmmPackage.JDT_TYPE__SUPER_CLASS, oldSuperClass, superClass)); + } + } + } + return superClass; + } + + /** + * + * + * + * @generated + */ + public JDTType basicGetSuperClass() { + return superClass; + } + + /** + * + * + * + * @generated + */ + @Override + public void setSuperClass(JDTType newSuperClass) { + JDTType oldSuperClass = superClass; + superClass = newSuperClass; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE__SUPER_CLASS, oldSuperClass, superClass)); + } + } + + + DerivedNotifyingEList superInterfaceNames; + + /** + * Returns the names of interfaces that this type implements or extends, + * in the order in which they are listed in the source. + *

    + * For classes, this gives the interfaces that this class implements. For interfaces, this gives the interfaces that this interface extends. An empty collection is returned if this type does not implement or extend any interfaces. * + * + * + * @generated NOT + */ + @Override + public EList getSuperInterfaceNames() { + // TODO: implement this method to return the 'Super Interface Names' attribute list + // Ensure that you remove @generated or mark it @generated NOT + + // Return empty collection if there is nothing + if (getSuperInterfaces().size() == 0) { + return ECollections.emptyEList(); + } + + if (superInterfaceNames == null) { + // Create a derived list that return the names instead of the original elements. + superInterfaceNames = new DerivedNotifyingEList((NotifyingList) getSuperInterfaces()) { + + /** + * Return the name of the JDTtype. + */ + @Override + protected String doGet(int index) { + return getBackupList().get(index).getElementName(); + } + }; + } + + return superInterfaceNames; + } + + + + /** + * Returns the name of this type's superclass, or null for source types that do not specify a superclass. + * + * + * + * @generated NOT + */ + @Override + public String getSuperClassName() { + // TODO: implement this method to return the 'Super Class Name' attribute + // Ensure that you remove @generated or mark it @generated NOT + if (getSuperClass() != null) { + return getSuperClass().getElementName(); + } + // No superclass + return null; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getFields() { + if (fields == null) { + fields = new SubsetSupersetEObjectContainmentWithInverseEList(JDTField.class, this, JdtmmPackage.JDT_TYPE__FIELDS, FIELDS_ESUPERSETS, null, JdtmmPackage.JDT_FIELD__OWNER); + } + return fields; + } + + /** + * The array of superset feature identifiers for the '{@link #getMethods() Methods}' containment reference list. + * + * + * + * @see #getMethods() + * @generated + * @ordered + */ + protected static final int[] METHODS_ESUPERSETS = new int[] { JdtmmPackage.JDT_TYPE__CHILDREN }; + + /** + * The array of superset feature identifiers for the '{@link #getFields() Fields}' containment reference list. + * + * + * + * @see #getFields() + * @generated + * @ordered + */ + protected static final int[] FIELDS_ESUPERSETS = new int[] { JdtmmPackage.JDT_TYPE__CHILDREN }; + + /** + * The array of superset feature identifiers for the '{@link #getTypes() Types}' containment reference list. + * + * + * + * @see #getTypes() + * @generated + * @ordered + */ + protected static final int[] TYPES_ESUPERSETS = new int[] { JdtmmPackage.JDT_TYPE__CHILDREN }; + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_TYPE__METHODS: + return ((InternalEList) (InternalEList) getMethods()).basicAdd(otherEnd, msgs); + case JdtmmPackage.JDT_TYPE__FIELDS: + return ((InternalEList) (InternalEList) getFields()).basicAdd(otherEnd, msgs); + case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetCompilationUnit((JDTCompilationUnit) otherEnd, msgs); + case JdtmmPackage.JDT_TYPE__TYPES: + return ((InternalEList) (InternalEList) getTypes()).basicAdd(otherEnd, msgs); + case JdtmmPackage.JDT_TYPE__OWNER: + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetOwner((JDTType) otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_TYPE__METHODS: + return ((InternalEList) getMethods()).basicRemove(otherEnd, msgs); + case JdtmmPackage.JDT_TYPE__FIELDS: + return ((InternalEList) getFields()).basicRemove(otherEnd, msgs); + case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: + return basicSetCompilationUnit(null, msgs); + case JdtmmPackage.JDT_TYPE__TYPES: + return ((InternalEList) getTypes()).basicRemove(otherEnd, msgs); + case JdtmmPackage.JDT_TYPE__OWNER: + return basicSetOwner(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: + return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_COMPILATION_UNIT__TYPES, JDTCompilationUnit.class, msgs); + case JdtmmPackage.JDT_TYPE__OWNER: + return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_TYPE__TYPES, JDTType.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_TYPE__METHODS: + return getMethods(); + case JdtmmPackage.JDT_TYPE__FIELDS: + return getFields(); + case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: + return getCompilationUnit(); + case JdtmmPackage.JDT_TYPE__CLASS: + return isClass(); + case JdtmmPackage.JDT_TYPE__INTERFACE: + return isInterface(); + case JdtmmPackage.JDT_TYPE__ENUM: + return isEnum(); + case JdtmmPackage.JDT_TYPE__ABSTRACT: + return isAbstract(); + case JdtmmPackage.JDT_TYPE__FINAL: + return isFinal(); + case JdtmmPackage.JDT_TYPE__STATIC: + return isStatic(); + case JdtmmPackage.JDT_TYPE__TYPES: + return getTypes(); + case JdtmmPackage.JDT_TYPE__OWNER: + return getOwner(); + case JdtmmPackage.JDT_TYPE__SUPER_INTERFACES: + return getSuperInterfaces(); + case JdtmmPackage.JDT_TYPE__SUPER_CLASS: + if (resolve) { + return getSuperClass(); + } + return basicGetSuperClass(); + case JdtmmPackage.JDT_TYPE__SUPER_INTERFACE_NAMES: + return getSuperInterfaceNames(); + case JdtmmPackage.JDT_TYPE__SUPER_CLASS_NAME: + return getSuperClassName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_TYPE__METHODS: + getMethods().clear(); + getMethods().addAll((Collection) newValue); + return; + case JdtmmPackage.JDT_TYPE__FIELDS: + getFields().clear(); + getFields().addAll((Collection) newValue); + return; + case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: + setCompilationUnit((JDTCompilationUnit) newValue); + return; + case JdtmmPackage.JDT_TYPE__CLASS: + setClass_((Boolean) newValue); + return; + case JdtmmPackage.JDT_TYPE__INTERFACE: + setInterface((Boolean) newValue); + return; + case JdtmmPackage.JDT_TYPE__ENUM: + setEnum((Boolean) newValue); + return; + case JdtmmPackage.JDT_TYPE__ABSTRACT: + setAbstract((Boolean) newValue); + return; + case JdtmmPackage.JDT_TYPE__FINAL: + setFinal((Boolean) newValue); + return; + case JdtmmPackage.JDT_TYPE__STATIC: + setStatic((Boolean) newValue); + return; + case JdtmmPackage.JDT_TYPE__TYPES: + getTypes().clear(); + getTypes().addAll((Collection) newValue); + return; + case JdtmmPackage.JDT_TYPE__OWNER: + setOwner((JDTType) newValue); + return; + case JdtmmPackage.JDT_TYPE__SUPER_INTERFACES: + getSuperInterfaces().clear(); + getSuperInterfaces().addAll((Collection) newValue); + return; + case JdtmmPackage.JDT_TYPE__SUPER_CLASS: + setSuperClass((JDTType) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_TYPE__METHODS: + getMethods().clear(); + return; + case JdtmmPackage.JDT_TYPE__FIELDS: + getFields().clear(); + return; + case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: + setCompilationUnit((JDTCompilationUnit) null); + return; + case JdtmmPackage.JDT_TYPE__CLASS: + setClass_(CLASS_EDEFAULT); + return; + case JdtmmPackage.JDT_TYPE__INTERFACE: + setInterface(INTERFACE_EDEFAULT); + return; + case JdtmmPackage.JDT_TYPE__ENUM: + setEnum(ENUM_EDEFAULT); + return; + case JdtmmPackage.JDT_TYPE__ABSTRACT: + setAbstract(ABSTRACT_EDEFAULT); + return; + case JdtmmPackage.JDT_TYPE__FINAL: + setFinal(FINAL_EDEFAULT); + return; + case JdtmmPackage.JDT_TYPE__STATIC: + setStatic(STATIC_EDEFAULT); + return; + case JdtmmPackage.JDT_TYPE__TYPES: + getTypes().clear(); + return; + case JdtmmPackage.JDT_TYPE__OWNER: + setOwner((JDTType) null); + return; + case JdtmmPackage.JDT_TYPE__SUPER_INTERFACES: + getSuperInterfaces().clear(); + return; + case JdtmmPackage.JDT_TYPE__SUPER_CLASS: + setSuperClass((JDTType) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_TYPE__METHODS: + return methods != null && !methods.isEmpty(); + case JdtmmPackage.JDT_TYPE__FIELDS: + return fields != null && !fields.isEmpty(); + case JdtmmPackage.JDT_TYPE__COMPILATION_UNIT: + return isSetCompilationUnit(); + case JdtmmPackage.JDT_TYPE__CLASS: + return class_ != CLASS_EDEFAULT; + case JdtmmPackage.JDT_TYPE__INTERFACE: + return interface_ != INTERFACE_EDEFAULT; + case JdtmmPackage.JDT_TYPE__ENUM: + return enum_ != ENUM_EDEFAULT; + case JdtmmPackage.JDT_TYPE__ABSTRACT: + return isAbstract() != ABSTRACT_EDEFAULT; + case JdtmmPackage.JDT_TYPE__FINAL: + return isFinal() != FINAL_EDEFAULT; + case JdtmmPackage.JDT_TYPE__STATIC: + return isStatic() != STATIC_EDEFAULT; + case JdtmmPackage.JDT_TYPE__TYPES: + return types != null && !types.isEmpty(); + case JdtmmPackage.JDT_TYPE__OWNER: + return isSetOwner(); + case JdtmmPackage.JDT_TYPE__SUPER_INTERFACES: + return superInterfaces != null && !superInterfaces.isEmpty(); + case JdtmmPackage.JDT_TYPE__SUPER_CLASS: + return superClass != null; + case JdtmmPackage.JDT_TYPE__SUPER_INTERFACE_NAMES: + return !getSuperInterfaceNames().isEmpty(); + case JdtmmPackage.JDT_TYPE__SUPER_CLASS_NAME: + return SUPER_CLASS_NAME_EDEFAULT == null ? getSuperClassName() != null : !SUPER_CLASS_NAME_EDEFAULT.equals(getSuperClassName()); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (class: "); + result.append(class_); + result.append(", interface: "); + result.append(interface_); + result.append(", enum: "); + result.append(enum_); + result.append(')'); + return result.toString(); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isSetChildren() { + return super.isSetChildren() + || eIsSet(JdtmmPackage.JDT_TYPE__METHODS) + || eIsSet(JdtmmPackage.JDT_TYPE__FIELDS) + || eIsSet(JdtmmPackage.JDT_TYPE__TYPES); + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParent getParent() { + return getCompilationUnit(); + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParent basicGetParent() { + return getCompilationUnit(); + } + + /** + * + * + * + * @generated + */ + public boolean isSetParent() { + return false; + } + + @Override + public String getJDTSignature() { + return Signature.createTypeSignature(getElementName(), false); + } + + @Override + public String getQualifiedName() { + // if it's a intern class, it's special + if (getOwner() != null) { + return getOwner().getQualifiedName() + "." + getElementName(); + } + + // else, return the qualified name of the package + "." + the name of the type + if (getCompilationUnit().getPackageFragment() == null) { + return getElementName(); + } + if (getCompilationUnit().getPackageFragment().getQualifiedName() == null) { + return getElementName(); + } + return getCompilationUnit().getPackageFragment().getQualifiedName() + "." + getElementName(); + } +} // JDTTypeImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeParameterImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeParameterImpl.java new file mode 100644 index 00000000000..0f11bdd4e26 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeParameterImpl.java @@ -0,0 +1,235 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * An implementation of the model object 'JDT Type Parameter'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl.JDTTypeParameterImpl#getDeclaringMember Declaring Member}
    • + *
    + *

    + * + * @generated + */ +public class JDTTypeParameterImpl extends JDTJavaElementImpl implements JDTTypeParameter { + + /** + * + * + * + * @generated + */ + protected JDTTypeParameterImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_TYPE_PARAMETER; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTMember getDeclaringMember() { + if (eContainerFeatureID() != JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER) { + return null; + } + return (JDTMember) eContainer(); + } + + /** + * + * + * + * @generated + */ + public NotificationChain basicSetDeclaringMember(JDTMember newDeclaringMember, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newDeclaringMember, JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER, msgs); + return msgs; + } + + /** + * + * + * + * @generated + */ + @Override + public void setDeclaringMember(JDTMember newDeclaringMember) { + if (newDeclaringMember != eInternalContainer() || (eContainerFeatureID() != JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER && newDeclaringMember != null)) { + if (EcoreUtil.isAncestor(this, newDeclaringMember)) { + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + } + NotificationChain msgs = null; + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + if (newDeclaringMember != null) { + msgs = ((InternalEObject) newDeclaringMember).eInverseAdd(this, JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS, JDTMember.class, msgs); + } + msgs = basicSetDeclaringMember(newDeclaringMember, msgs); + if (msgs != null) { + msgs.dispatch(); + } + } + else if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER, newDeclaringMember, newDeclaringMember)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: + if (eInternalContainer() != null) { + msgs = eBasicRemoveFromContainer(msgs); + } + return basicSetDeclaringMember((JDTMember) otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: + return basicSetDeclaringMember(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: + return eInternalContainer().eInverseRemove(this, JdtmmPackage.JDT_MEMBER__TYPE_PARAMETERS, JDTMember.class, msgs); + } + return super.eBasicRemoveFromContainerFeature(msgs); + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: + return getDeclaringMember(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: + setDeclaringMember((JDTMember) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: + setDeclaringMember((JDTMember) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JdtmmPackage.JDT_TYPE_PARAMETER__DECLARING_MEMBER: + return getDeclaringMember() != null; + } + return super.eIsSet(featureID); + } + +} // JDTTypeParameterImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeRootImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeRootImpl.java new file mode 100644 index 00000000000..feab7e6748f --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JDTTypeRootImpl.java @@ -0,0 +1,61 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * An implementation of the model object 'JDT Type Root'. + * + *

    + *

    + * + * @generated + */ +public abstract class JDTTypeRootImpl extends JDTParentJavaElementImpl implements JDTTypeRoot { + + /** + * + * + * + * @generated + */ + protected JDTTypeRootImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JdtmmPackage.Literals.JDT_TYPE_ROOT; + } + +} // JDTTypeRootImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmFactoryImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmFactoryImpl.java new file mode 100644 index 00000000000..9a567bb769e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmFactoryImpl.java @@ -0,0 +1,558 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.impl.EFactoryImpl; +import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; + +/** + * + * An implementation of the model Factory. + * + * + * @generated + */ +public class JdtmmFactoryImpl extends EFactoryImpl implements JdtmmFactory { + + /** + * Creates the default factory implementation. + * + * + * + * @generated + */ + public static JdtmmFactory init() { + try { + JdtmmFactory theJdtmmFactory = (JdtmmFactory) EPackage.Registry.INSTANCE.getEFactory("http:///jdtmm.ecore"); + if (theJdtmmFactory != null) { + return theJdtmmFactory; + } + } catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new JdtmmFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * + * @generated + */ + public JdtmmFactoryImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case JdtmmPackage.JDT_METHOD: + return createJDTMethod(); + case JdtmmPackage.JDT_TYPE_PARAMETER: + return createJDTTypeParameter(); + case JdtmmPackage.JDT_FIELD: + return createJDTField(); + case JdtmmPackage.JDT_COMPILATION_UNIT: + return createJDTCompilationUnit(); + case JdtmmPackage.JDT_PACKAGE_FRAGMENT: + return createJDTPackageFragment(); + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT: + return createJDTPackageFragmentRoot(); + case JdtmmPackage.JDT_JAVA_PROJECT: + return createJDTJavaProject(); + case JdtmmPackage.JDT_JAVA_MODEL: + return createJDTJavaModel(); + case JdtmmPackage.JDT_PARAMETER: + return createJDTParameter(); + case JdtmmPackage.JDT_CLASS: + return createJDTClass(); + case JdtmmPackage.JDT_INTERFACE: + return createJDTInterface(); + case JdtmmPackage.JDT_ENUM: + return createJDTEnum(); + case JdtmmPackage.JDT_IMPORT_DECLARATION: + return createJDTImportDeclaration(); + case JdtmmPackage.JDT_IMPORT_CONTAINER: + return createJDTImportContainer(); + case JdtmmPackage.JDT_EXCEPTION: + return createJDTException(); + case JdtmmPackage.JDT_OPAQUE_BODY: + return createJDTOpaqueBody(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Object createFromString(EDataType eDataType, String initialValue) { + switch (eDataType.getClassifierID()) { + case JdtmmPackage.VISIBILITY_KIND: + return createVisibilityKindFromString(eDataType, initialValue); + case JdtmmPackage.TRUE_FALSE_DEFAULT: + return createTrueFalseDefaultFromString(eDataType, initialValue); + case JdtmmPackage.STRING: + return createStringFromString(eDataType, initialValue); + case JdtmmPackage.INT: + return createintFromString(eDataType, initialValue); + case JdtmmPackage.BOOLEAN: + return createbooleanFromString(eDataType, initialValue); + case JdtmmPackage.JDT_VISITOR_EXCEPTION: + return createJDTVisitorExceptionFromString(eDataType, initialValue); + case JdtmmPackage.VISITOR: + return createVisitorFromString(eDataType, initialValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * + * @generated + */ + @Override + public String convertToString(EDataType eDataType, Object instanceValue) { + switch (eDataType.getClassifierID()) { + case JdtmmPackage.VISIBILITY_KIND: + return convertVisibilityKindToString(eDataType, instanceValue); + case JdtmmPackage.TRUE_FALSE_DEFAULT: + return convertTrueFalseDefaultToString(eDataType, instanceValue); + case JdtmmPackage.STRING: + return convertStringToString(eDataType, instanceValue); + case JdtmmPackage.INT: + return convertintToString(eDataType, instanceValue); + case JdtmmPackage.BOOLEAN: + return convertbooleanToString(eDataType, instanceValue); + case JdtmmPackage.JDT_VISITOR_EXCEPTION: + return convertJDTVisitorExceptionToString(eDataType, instanceValue); + case JdtmmPackage.VISITOR: + return convertVisitorToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * + * @generated + */ + @Override + public JDTTypeParameter createJDTTypeParameter() { + JDTTypeParameterImpl jdtTypeParameter = new JDTTypeParameterImpl(); + return jdtTypeParameter; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTField createJDTField() { + JDTFieldImpl jdtField = new JDTFieldImpl(); + return jdtField; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTMethod createJDTMethod() { + JDTMethodImpl jdtMethod = new JDTMethodImpl(); + return jdtMethod; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTCompilationUnit createJDTCompilationUnit() { + JDTCompilationUnitImpl jdtCompilationUnit = new JDTCompilationUnitImpl(); + return jdtCompilationUnit; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTPackageFragment createJDTPackageFragment() { + JDTPackageFragmentImpl jdtPackageFragment = new JDTPackageFragmentImpl(); + return jdtPackageFragment; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTPackageFragmentRoot createJDTPackageFragmentRoot() { + JDTPackageFragmentRootImpl jdtPackageFragmentRoot = new JDTPackageFragmentRootImpl(); + return jdtPackageFragmentRoot; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTJavaProject createJDTJavaProject() { + JDTJavaProjectImpl jdtJavaProject = new JDTJavaProjectImpl(); + return jdtJavaProject; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTClass createJDTClass() { + JDTClassImpl jdtClass = new JDTClassImpl(); + return jdtClass; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTInterface createJDTInterface() { + JDTInterfaceImpl jdtInterface = new JDTInterfaceImpl(); + return jdtInterface; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTEnum createJDTEnum() { + JDTEnumImpl jdtEnum = new JDTEnumImpl(); + return jdtEnum; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTImportDeclaration createJDTImportDeclaration() { + JDTImportDeclarationImpl jdtImportDeclaration = new JDTImportDeclarationImpl(); + return jdtImportDeclaration; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTImportContainer createJDTImportContainer() { + JDTImportContainerImpl jdtImportContainer = new JDTImportContainerImpl(); + return jdtImportContainer; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTParameter createJDTParameter() { + JDTParameterImpl jdtParameter = new JDTParameterImpl(); + return jdtParameter; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTException createJDTException() { + JDTExceptionImpl jdtException = new JDTExceptionImpl(); + return jdtException; + } + + /** + * + * + * + * @generated + */ + @Override + public JDTOpaqueBody createJDTOpaqueBody() { + JDTOpaqueBodyImpl jdtOpaqueBody = new JDTOpaqueBodyImpl(); + return jdtOpaqueBody; + } + + /** + * + * + * + * @generated + */ + public VisibilityKind createVisibilityKindFromString(EDataType eDataType, String initialValue) { + VisibilityKind result = VisibilityKind.get(initialValue); + if (result == null) { + throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + } + return result; + } + + /** + * + * + * + * @generated + */ + public String convertVisibilityKindToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * + * @generated + */ + public TrueFalseDefault createTrueFalseDefaultFromString(EDataType eDataType, String initialValue) { + TrueFalseDefault result = TrueFalseDefault.get(initialValue); + if (result == null) { + throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + } + return result; + } + + /** + * + * + * + * @generated + */ + public String convertTrueFalseDefaultToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * + * @generated + */ + @Override + public JDTJavaModel createJDTJavaModel() { + JDTJavaModelImpl jdtJavaModel = new JDTJavaModelImpl(); + return jdtJavaModel; + } + + /** + * + * + * + * @generated + */ + public Integer createintFromString(EDataType eDataType, String initialValue) { + return (Integer) super.createFromString(eDataType, initialValue); + } + + /** + * + * + * + * @generated + */ + public String convertintToString(EDataType eDataType, Object instanceValue) { + return super.convertToString(eDataType, instanceValue); + } + + /** + * + * + * + * @generated + */ + public String createStringFromString(EDataType eDataType, String initialValue) { + return (String) super.createFromString(eDataType, initialValue); + } + + /** + * + * + * + * @generated + */ + public String convertStringToString(EDataType eDataType, Object instanceValue) { + return super.convertToString(eDataType, instanceValue); + } + + /** + * + * + * + * @generated + */ + public JDTVisitorException createJDTVisitorExceptionFromString(EDataType eDataType, String initialValue) { + return (JDTVisitorException) super.createFromString(eDataType, initialValue); + } + + /** + * + * + * + * @generated + */ + public String convertJDTVisitorExceptionToString(EDataType eDataType, Object instanceValue) { + return super.convertToString(eDataType, instanceValue); + } + + /** + * + * + * + * @generated + */ + public JDTVisitor createVisitorFromString(EDataType eDataType, String initialValue) { + return (JDTVisitor) super.createFromString(eDataType, initialValue); + } + + /** + * + * + * + * @generated + */ + public String convertVisitorToString(EDataType eDataType, Object instanceValue) { + return super.convertToString(eDataType, instanceValue); + } + + /** + * + * + * + * @generated + */ + public Boolean createbooleanFromString(EDataType eDataType, String initialValue) { + return (Boolean) super.createFromString(eDataType, initialValue); + } + + /** + * + * + * + * @generated + */ + public String convertbooleanToString(EDataType eDataType, Object instanceValue) { + return super.convertToString(eDataType, instanceValue); + } + + /** + * + * + * + * @generated + */ + @Override + public JdtmmPackage getJdtmmPackage() { + return (JdtmmPackage) getEPackage(); + } + + /** + * + * + * + * @deprecated + * @generated + */ + @Deprecated + public static JdtmmPackage getPackage() { + return JdtmmPackage.eINSTANCE; + } + +} // JdtmmFactoryImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmPackageImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmPackageImpl.java new file mode 100644 index 00000000000..3050ecf23e4 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/impl/JdtmmPackageImpl.java @@ -0,0 +1,1905 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Meta-model conception + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Meta-model conception + * Manuel Giles giles.manu@live.fr - Meta-model conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.impl; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.impl.EPackageImpl; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmFactory; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.TrueFalseDefault; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.VisibilityKind; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitor; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; + +/** + * + * An implementation of the model Package. + * + * + * @generated + */ +public class JdtmmPackageImpl extends EPackageImpl implements JdtmmPackage { + + /** + * + * + * + * @generated + */ + private EClass jdtMethodBodyEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtJavaElementEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtParentEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtMemberEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtParentJavaElementEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtTypeParameterEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtFieldEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtTypeEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtMethodEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtCompilationUnitEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtTypeRootEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtPackageFragmentEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtPackageFragmentRootEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtJavaProjectEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtClassEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtInterfaceEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtEnumEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtImportDeclarationEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtImportContainerEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtParameterEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtExceptionEClass = null; + + /** + * + * + * + * @generated + */ + private EClass jdtOpaqueBodyEClass = null; + + /** + * + * + * + * @generated + */ + private EEnum visibilityKindEEnum = null; + + /** + * + * + * + * @generated + */ + private EEnum trueFalseDefaultEEnum = null; + + /** + * + * + * + * @generated + */ + private EClass jdtJavaModelEClass = null; + + /** + * + * + * + * @generated + */ + private EDataType intEDataType = null; + + /** + * + * + * + * @generated + */ + private EDataType stringEDataType = null; + + /** + * + * + * + * @generated + */ + private EDataType jdtVisitorExceptionEDataType = null; + + /** + * + * + * + * @generated + */ + private EDataType visitorEDataType = null; + + /** + * + * + * + * @generated + */ + private EDataType booleanEDataType = null; + + /** + * Creates an instance of the model Package, registered with {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

    + * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also performs initialization of the package, or returns the registered package, if one already exists. + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage#eNS_URI + * @see #init() + * @generated + */ + private JdtmmPackageImpl() { + super(eNS_URI, JdtmmFactory.eINSTANCE); + } + + /** + * + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

    + * This method is used to initialize {@link JdtmmPackage#eINSTANCE} when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static JdtmmPackage init() { + if (isInited) { + return (JdtmmPackage) EPackage.Registry.INSTANCE.getEPackage(JdtmmPackage.eNS_URI); + } + + // Obtain or create and register package + JdtmmPackageImpl theJdtmmPackage = (JdtmmPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof JdtmmPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new JdtmmPackageImpl()); + + isInited = true; + + // Create package meta-data objects + theJdtmmPackage.createPackageContents(); + + // Initialize created meta-data + theJdtmmPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theJdtmmPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(JdtmmPackage.eNS_URI, theJdtmmPackage); + return theJdtmmPackage; + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTMethodBody() { + return jdtMethodBodyEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTMethodBody_Owner() { + return (EReference) jdtMethodBodyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTJavaElement() { + return jdtJavaElementEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTJavaElement_Parent() { + return (EReference) jdtJavaElementEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTJavaElement_ElementName() { + return (EAttribute) jdtJavaElementEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTJavaElement_ElementType() { + return (EAttribute) jdtJavaElementEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTJavaElement_Comment() { + return (EAttribute) jdtJavaElementEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTJavaElement_Generated() { + return (EAttribute) jdtJavaElementEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTParent() { + return jdtParentEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTParent_Flags() { + return (EAttribute) jdtParentEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTParent_Children() { + return (EReference) jdtParentEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTMember() { + return jdtMemberEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTMember_TypeParameters() { + return (EReference) jdtMemberEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTMember_Visibility() { + return (EAttribute) jdtMemberEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTMember_ExplicitRequiredImports() { + return (EReference) jdtMemberEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTMember_ExplicitPlainTextRequiredImports() { + return (EAttribute) jdtMemberEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTParentJavaElement() { + return jdtParentJavaElementEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTTypeParameter() { + return jdtTypeParameterEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTTypeParameter_DeclaringMember() { + return (EReference) jdtTypeParameterEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTField() { + return jdtFieldEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTField_Owner() { + return (EReference) jdtFieldEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTField_Type() { + return (EReference) jdtFieldEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTField_Value() { + return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTField_GenerateGetter() { + return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTField_GenerateSetter() { + return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTField_Abstract() { + return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTField_Final() { + return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTField_Static() { + return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTField_IsMultiValued() { + return (EAttribute) jdtFieldEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTType() { + return jdtTypeEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTType_Methods() { + return (EReference) jdtTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTType_CompilationUnit() { + return (EReference) jdtTypeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTType_Class() { + return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTType_Interface() { + return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTType_Enum() { + return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTType_Abstract() { + return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTType_Final() { + return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTType_Static() { + return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTType_Types() { + return (EReference) jdtTypeEClass.getEStructuralFeatures().get(9); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTType_Owner() { + return (EReference) jdtTypeEClass.getEStructuralFeatures().get(10); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTType_SuperInterfaces() { + return (EReference) jdtTypeEClass.getEStructuralFeatures().get(11); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTType_SuperClass() { + return (EReference) jdtTypeEClass.getEStructuralFeatures().get(12); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTType_SuperInterfaceNames() { + return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(13); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTType_SuperClassName() { + return (EAttribute) jdtTypeEClass.getEStructuralFeatures().get(14); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTType_Fields() { + return (EReference) jdtTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTMethod() { + return jdtMethodEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTMethod_ReturnType() { + return (EReference) jdtMethodEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTMethod_Parameters() { + return (EReference) jdtMethodEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTMethod_Exceptions() { + return (EReference) jdtMethodEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTMethod_Synchronized() { + return (EAttribute) jdtMethodEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTMethod_Constructor() { + return (EAttribute) jdtMethodEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTMethod_Bodies() { + return (EReference) jdtMethodEClass.getEStructuralFeatures().get(9); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTMethod_Abstract() { + return (EAttribute) jdtMethodEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTMethod_Final() { + return (EAttribute) jdtMethodEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTMethod_Static() { + return (EAttribute) jdtMethodEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTMethod_Owner() { + return (EReference) jdtMethodEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTCompilationUnit() { + return jdtCompilationUnitEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTCompilationUnit_PackageFragment() { + return (EReference) jdtCompilationUnitEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTCompilationUnit_Types() { + return (EReference) jdtCompilationUnitEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTTypeRoot() { + return jdtTypeRootEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTPackageFragment() { + return jdtPackageFragmentEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTPackageFragment_PackageFragmentRoot() { + return (EReference) jdtPackageFragmentEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTPackageFragment_CompilationUnits() { + return (EReference) jdtPackageFragmentEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTPackageFragmentRoot() { + return jdtPackageFragmentRootEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTPackageFragmentRoot_JavaProject() { + return (EReference) jdtPackageFragmentRootEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTPackageFragmentRoot_PackageFragments() { + return (EReference) jdtPackageFragmentRootEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTJavaProject() { + return jdtJavaProjectEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTJavaProject_JavaModel() { + return (EReference) jdtJavaProjectEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTJavaProject_PackageFragmentRoots() { + return (EReference) jdtJavaProjectEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTClass() { + return jdtClassEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTInterface() { + return jdtInterfaceEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTEnum() { + return jdtEnumEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTImportDeclaration() { + return jdtImportDeclarationEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTImportContainer() { + return jdtImportContainerEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTParameter() { + return jdtParameterEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTParameter_ParameterOwner() { + return (EReference) jdtParameterEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTParameter_Final() { + return (EAttribute) jdtParameterEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTParameter_IsMultiValued() { + return (EAttribute) jdtParameterEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTParameter_Type() { + return (EReference) jdtParameterEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTParameter_ReturnOwner() { + return (EReference) jdtParameterEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTException() { + return jdtExceptionEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTOpaqueBody() { + return jdtOpaqueBodyEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJDTOpaqueBody__body() { + return (EAttribute) jdtOpaqueBodyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EEnum getVisibilityKind() { + return visibilityKindEEnum; + } + + /** + * + * + * + * @generated + */ + @Override + public EEnum getTrueFalseDefault() { + return trueFalseDefaultEEnum; + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJDTJavaModel() { + return jdtJavaModelEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJDTJavaModel_JavaProject() { + return (EReference) jdtJavaModelEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EDataType getint() { + return intEDataType; + } + + /** + * + * + * + * @generated + */ + @Override + public EDataType getString() { + return stringEDataType; + } + + /** + * + * + * + * @generated + */ + @Override + public EDataType getJDTVisitorException() { + return jdtVisitorExceptionEDataType; + } + + /** + * + * + * + * @generated + */ + @Override + public EDataType getVisitor() { + return visitorEDataType; + } + + /** + * + * + * + * @generated + */ + @Override + public EDataType getboolean() { + return booleanEDataType; + } + + /** + * + * + * + * @generated + */ + @Override + public JdtmmFactory getJdtmmFactory() { + return (JdtmmFactory) getEFactoryInstance(); + } + + /** + * + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) { + return; + } + isCreated = true; + + // Create classes and their features + jdtMethodBodyEClass = createEClass(JDT_METHOD_BODY); + createEReference(jdtMethodBodyEClass, JDT_METHOD_BODY__OWNER); + + jdtMethodEClass = createEClass(JDT_METHOD); + createEReference(jdtMethodEClass, JDT_METHOD__OWNER); + createEReference(jdtMethodEClass, JDT_METHOD__RETURN_TYPE); + createEReference(jdtMethodEClass, JDT_METHOD__PARAMETERS); + createEAttribute(jdtMethodEClass, JDT_METHOD__ABSTRACT); + createEAttribute(jdtMethodEClass, JDT_METHOD__FINAL); + createEAttribute(jdtMethodEClass, JDT_METHOD__STATIC); + createEReference(jdtMethodEClass, JDT_METHOD__EXCEPTIONS); + createEAttribute(jdtMethodEClass, JDT_METHOD__SYNCHRONIZED); + createEAttribute(jdtMethodEClass, JDT_METHOD__CONSTRUCTOR); + createEReference(jdtMethodEClass, JDT_METHOD__BODIES); + + jdtMemberEClass = createEClass(JDT_MEMBER); + createEReference(jdtMemberEClass, JDT_MEMBER__TYPE_PARAMETERS); + createEAttribute(jdtMemberEClass, JDT_MEMBER__VISIBILITY); + createEReference(jdtMemberEClass, JDT_MEMBER__EXPLICIT_REQUIRED_IMPORTS); + createEAttribute(jdtMemberEClass, JDT_MEMBER__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); + + jdtParentJavaElementEClass = createEClass(JDT_PARENT_JAVA_ELEMENT); + + jdtParentEClass = createEClass(JDT_PARENT); + createEReference(jdtParentEClass, JDT_PARENT__CHILDREN); + createEAttribute(jdtParentEClass, JDT_PARENT__FLAGS); + + jdtJavaElementEClass = createEClass(JDT_JAVA_ELEMENT); + createEAttribute(jdtJavaElementEClass, JDT_JAVA_ELEMENT__ELEMENT_NAME); + createEAttribute(jdtJavaElementEClass, JDT_JAVA_ELEMENT__ELEMENT_TYPE); + createEAttribute(jdtJavaElementEClass, JDT_JAVA_ELEMENT__COMMENT); + createEAttribute(jdtJavaElementEClass, JDT_JAVA_ELEMENT__GENERATED); + createEReference(jdtJavaElementEClass, JDT_JAVA_ELEMENT__PARENT); + + jdtTypeParameterEClass = createEClass(JDT_TYPE_PARAMETER); + createEReference(jdtTypeParameterEClass, JDT_TYPE_PARAMETER__DECLARING_MEMBER); + + jdtTypeEClass = createEClass(JDT_TYPE); + createEReference(jdtTypeEClass, JDT_TYPE__METHODS); + createEReference(jdtTypeEClass, JDT_TYPE__FIELDS); + createEReference(jdtTypeEClass, JDT_TYPE__COMPILATION_UNIT); + createEAttribute(jdtTypeEClass, JDT_TYPE__CLASS); + createEAttribute(jdtTypeEClass, JDT_TYPE__INTERFACE); + createEAttribute(jdtTypeEClass, JDT_TYPE__ENUM); + createEAttribute(jdtTypeEClass, JDT_TYPE__ABSTRACT); + createEAttribute(jdtTypeEClass, JDT_TYPE__FINAL); + createEAttribute(jdtTypeEClass, JDT_TYPE__STATIC); + createEReference(jdtTypeEClass, JDT_TYPE__TYPES); + createEReference(jdtTypeEClass, JDT_TYPE__OWNER); + createEReference(jdtTypeEClass, JDT_TYPE__SUPER_INTERFACES); + createEReference(jdtTypeEClass, JDT_TYPE__SUPER_CLASS); + createEAttribute(jdtTypeEClass, JDT_TYPE__SUPER_INTERFACE_NAMES); + createEAttribute(jdtTypeEClass, JDT_TYPE__SUPER_CLASS_NAME); + + jdtFieldEClass = createEClass(JDT_FIELD); + createEAttribute(jdtFieldEClass, JDT_FIELD__ABSTRACT); + createEAttribute(jdtFieldEClass, JDT_FIELD__FINAL); + createEAttribute(jdtFieldEClass, JDT_FIELD__STATIC); + createEAttribute(jdtFieldEClass, JDT_FIELD__IS_MULTI_VALUED); + createEReference(jdtFieldEClass, JDT_FIELD__TYPE); + createEAttribute(jdtFieldEClass, JDT_FIELD__VALUE); + createEAttribute(jdtFieldEClass, JDT_FIELD__GENERATE_GETTER); + createEAttribute(jdtFieldEClass, JDT_FIELD__GENERATE_SETTER); + createEReference(jdtFieldEClass, JDT_FIELD__OWNER); + + jdtCompilationUnitEClass = createEClass(JDT_COMPILATION_UNIT); + createEReference(jdtCompilationUnitEClass, JDT_COMPILATION_UNIT__PACKAGE_FRAGMENT); + createEReference(jdtCompilationUnitEClass, JDT_COMPILATION_UNIT__TYPES); + + jdtTypeRootEClass = createEClass(JDT_TYPE_ROOT); + + jdtPackageFragmentEClass = createEClass(JDT_PACKAGE_FRAGMENT); + createEReference(jdtPackageFragmentEClass, JDT_PACKAGE_FRAGMENT__PACKAGE_FRAGMENT_ROOT); + createEReference(jdtPackageFragmentEClass, JDT_PACKAGE_FRAGMENT__COMPILATION_UNITS); + + jdtPackageFragmentRootEClass = createEClass(JDT_PACKAGE_FRAGMENT_ROOT); + createEReference(jdtPackageFragmentRootEClass, JDT_PACKAGE_FRAGMENT_ROOT__JAVA_PROJECT); + createEReference(jdtPackageFragmentRootEClass, JDT_PACKAGE_FRAGMENT_ROOT__PACKAGE_FRAGMENTS); + + jdtJavaProjectEClass = createEClass(JDT_JAVA_PROJECT); + createEReference(jdtJavaProjectEClass, JDT_JAVA_PROJECT__JAVA_MODEL); + createEReference(jdtJavaProjectEClass, JDT_JAVA_PROJECT__PACKAGE_FRAGMENT_ROOTS); + + jdtJavaModelEClass = createEClass(JDT_JAVA_MODEL); + createEReference(jdtJavaModelEClass, JDT_JAVA_MODEL__JAVA_PROJECT); + + jdtParameterEClass = createEClass(JDT_PARAMETER); + createEReference(jdtParameterEClass, JDT_PARAMETER__PARAMETER_OWNER); + createEAttribute(jdtParameterEClass, JDT_PARAMETER__FINAL); + createEAttribute(jdtParameterEClass, JDT_PARAMETER__IS_MULTI_VALUED); + createEReference(jdtParameterEClass, JDT_PARAMETER__TYPE); + createEReference(jdtParameterEClass, JDT_PARAMETER__RETURN_OWNER); + + jdtClassEClass = createEClass(JDT_CLASS); + + jdtInterfaceEClass = createEClass(JDT_INTERFACE); + + jdtEnumEClass = createEClass(JDT_ENUM); + + jdtImportDeclarationEClass = createEClass(JDT_IMPORT_DECLARATION); + + jdtImportContainerEClass = createEClass(JDT_IMPORT_CONTAINER); + + jdtExceptionEClass = createEClass(JDT_EXCEPTION); + + jdtOpaqueBodyEClass = createEClass(JDT_OPAQUE_BODY); + createEAttribute(jdtOpaqueBodyEClass, JDT_OPAQUE_BODY__BODY); + + // Create enums + visibilityKindEEnum = createEEnum(VISIBILITY_KIND); + trueFalseDefaultEEnum = createEEnum(TRUE_FALSE_DEFAULT); + + // Create data types + stringEDataType = createEDataType(STRING); + intEDataType = createEDataType(INT); + booleanEDataType = createEDataType(BOOLEAN); + jdtVisitorExceptionEDataType = createEDataType(JDT_VISITOR_EXCEPTION); + visitorEDataType = createEDataType(VISITOR); + } + + /** + * + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) { + return; + } + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + jdtMethodEClass.getESuperTypes().add(this.getJDTMember()); + jdtMemberEClass.getESuperTypes().add(this.getJDTParentJavaElement()); + jdtParentJavaElementEClass.getESuperTypes().add(this.getJDTJavaElement()); + jdtParentJavaElementEClass.getESuperTypes().add(this.getJDTParent()); + jdtTypeParameterEClass.getESuperTypes().add(this.getJDTJavaElement()); + jdtTypeEClass.getESuperTypes().add(this.getJDTMember()); + jdtFieldEClass.getESuperTypes().add(this.getJDTMember()); + jdtCompilationUnitEClass.getESuperTypes().add(this.getJDTTypeRoot()); + jdtTypeRootEClass.getESuperTypes().add(this.getJDTParentJavaElement()); + jdtPackageFragmentEClass.getESuperTypes().add(this.getJDTParentJavaElement()); + jdtPackageFragmentRootEClass.getESuperTypes().add(this.getJDTParentJavaElement()); + jdtJavaProjectEClass.getESuperTypes().add(this.getJDTParentJavaElement()); + jdtJavaModelEClass.getESuperTypes().add(this.getJDTParentJavaElement()); + jdtParameterEClass.getESuperTypes().add(this.getJDTMember()); + jdtClassEClass.getESuperTypes().add(this.getJDTType()); + jdtInterfaceEClass.getESuperTypes().add(this.getJDTType()); + jdtEnumEClass.getESuperTypes().add(this.getJDTType()); + jdtImportDeclarationEClass.getESuperTypes().add(this.getJDTJavaElement()); + jdtImportContainerEClass.getESuperTypes().add(this.getJDTParentJavaElement()); + jdtOpaqueBodyEClass.getESuperTypes().add(this.getJDTMethodBody()); + + // Initialize classes and features; add operations and parameters + initEClass(jdtMethodBodyEClass, JDTMethodBody.class, "JDTMethodBody", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJDTMethodBody_Owner(), this.getJDTMethod(), this.getJDTMethod_Bodies(), "owner", null, 1, 1, JDTMethodBody.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + addEOperation(jdtMethodBodyEClass, this.getString(), "asText", 1, 1, IS_UNIQUE, !IS_ORDERED); + + initEClass(jdtMethodEClass, JDTMethod.class, "JDTMethod", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJDTMethod_Owner(), this.getJDTType(), this.getJDTType_Methods(), "owner", null, 1, 1, JDTMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEReference(getJDTMethod_ReturnType(), this.getJDTParameter(), this.getJDTParameter_ReturnOwner(), "returnType", null, 0, 1, JDTMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTMethod_Parameters(), this.getJDTParameter(), this.getJDTParameter_ParameterOwner(), "parameters", null, 0, -1, JDTMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTMethod_Abstract(), this.getboolean(), "abstract", "false", 1, 1, JDTMethod.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTMethod_Final(), this.getboolean(), "final", "false", 1, 1, JDTMethod.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTMethod_Static(), this.getboolean(), "static", "false", 1, 1, JDTMethod.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEReference(getJDTMethod_Exceptions(), this.getJDTType(), null, "exceptions", null, 0, -1, JDTMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTMethod_Synchronized(), this.getboolean(), "synchronized", "false", 1, 1, JDTMethod.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTMethod_Constructor(), this.getboolean(), "constructor", null, 1, 1, JDTMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTMethod_Bodies(), this.getJDTMethodBody(), this.getJDTMethodBody_Owner(), "bodies", null, 0, -1, JDTMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(jdtMemberEClass, JDTMember.class, "JDTMember", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJDTMember_TypeParameters(), this.getJDTTypeParameter(), this.getJDTTypeParameter_DeclaringMember(), "typeParameters", null, 0, -1, JDTMember.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTMember_Visibility(), this.getVisibilityKind(), "visibility", "public", 1, 1, JDTMember.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEReference(getJDTMember_ExplicitRequiredImports(), this.getJDTType(), null, "explicitRequiredImports", null, 0, -1, JDTMember.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTMember_ExplicitPlainTextRequiredImports(), this.getString(), "explicitPlainTextRequiredImports", null, 0, -1, JDTMember.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(jdtParentJavaElementEClass, JDTParentJavaElement.class, "JDTParentJavaElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(jdtParentEClass, JDTParent.class, "JDTParent", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJDTParent_Children(), this.getJDTJavaElement(), this.getJDTJavaElement_Parent(), "children", null, 0, -1, JDTParent.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTParent_Flags(), this.getint(), "flags", null, 1, 1, JDTParent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + EOperation op = addEOperation(jdtParentEClass, null, "setFlag", 1, 1, IS_UNIQUE, !IS_ORDERED); + addEParameter(op, this.getint(), "flag", 1, 1, IS_UNIQUE, !IS_ORDERED); + addEParameter(op, this.getboolean(), "value", 1, 1, IS_UNIQUE, !IS_ORDERED); + + op = addEOperation(jdtParentEClass, this.getboolean(), "isFlagSet", 1, 1, IS_UNIQUE, !IS_ORDERED); + addEParameter(op, this.getint(), "flag", 1, 1, IS_UNIQUE, !IS_ORDERED); + + initEClass(jdtJavaElementEClass, JDTJavaElement.class, "JDTJavaElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getJDTJavaElement_ElementName(), this.getString(), "elementName", null, 1, 1, JDTJavaElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTJavaElement_ElementType(), this.getint(), "elementType", null, 1, 1, JDTJavaElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTJavaElement_Comment(), this.getString(), "comment", null, 1, 1, JDTJavaElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTJavaElement_Generated(), this.getboolean(), "generated", null, 1, 1, JDTJavaElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTJavaElement_Parent(), this.getJDTParent(), this.getJDTParent_Children(), "parent", null, 0, 1, JDTJavaElement.class, IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + addEOperation(jdtJavaElementEClass, this.getString(), "getQualifiedName", 1, 1, IS_UNIQUE, !IS_ORDERED); + + op = addEOperation(jdtJavaElementEClass, null, "accept", 1, 1, IS_UNIQUE, !IS_ORDERED); + addEParameter(op, this.getVisitor(), "visitor", 1, 1, IS_UNIQUE, !IS_ORDERED); + addEException(op, this.getJDTVisitorException()); + + addEOperation(jdtJavaElementEClass, this.getString(), "getJDTSignature", 1, 1, IS_UNIQUE, !IS_ORDERED); + + initEClass(jdtTypeParameterEClass, JDTTypeParameter.class, "JDTTypeParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJDTTypeParameter_DeclaringMember(), this.getJDTMember(), this.getJDTMember_TypeParameters(), "declaringMember", null, 0, 1, JDTTypeParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(jdtTypeEClass, JDTType.class, "JDTType", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJDTType_Methods(), this.getJDTMethod(), this.getJDTMethod_Owner(), "methods", null, 0, -1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEReference(getJDTType_Fields(), this.getJDTField(), this.getJDTField_Owner(), "fields", null, 0, -1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTType_CompilationUnit(), this.getJDTCompilationUnit(), this.getJDTCompilationUnit_Types(), "compilationUnit", null, 0, 1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTType_Class(), this.getboolean(), "class", "false", 1, 1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTType_Interface(), this.getboolean(), "interface", "false", 1, 1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTType_Enum(), this.getboolean(), "enum", "false", 1, 1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTType_Abstract(), this.getboolean(), "abstract", "false", 1, 1, JDTType.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTType_Final(), this.getboolean(), "final", "false", 1, 1, JDTType.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTType_Static(), this.getboolean(), "static", "false", 1, 1, JDTType.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEReference(getJDTType_Types(), this.getJDTType(), this.getJDTType_Owner(), "types", null, 0, -1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTType_Owner(), this.getJDTType(), this.getJDTType_Types(), "owner", null, 0, 1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTType_SuperInterfaces(), this.getJDTType(), null, "superInterfaces", null, 0, -1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTType_SuperClass(), this.getJDTType(), null, "superClass", null, 0, 1, JDTType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTType_SuperInterfaceNames(), this.getString(), "superInterfaceNames", null, 0, -1, JDTType.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTType_SuperClassName(), this.getString(), "superClassName", null, 1, 1, JDTType.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + + initEClass(jdtFieldEClass, JDTField.class, "JDTField", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getJDTField_Abstract(), this.getboolean(), "abstract", "false", 1, 1, JDTField.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTField_Final(), this.getboolean(), "final", "false", 1, 1, JDTField.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTField_Static(), this.getboolean(), "static", "false", 1, 1, JDTField.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTField_IsMultiValued(), this.getboolean(), "isMultiValued", "false", 1, 1, JDTField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTField_Type(), this.getJDTType(), null, "type", null, 0, 1, JDTField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTField_Value(), this.getString(), "value", null, 1, 1, JDTField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTField_GenerateGetter(), this.getTrueFalseDefault(), "generateGetter", null, 1, 1, JDTField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTField_GenerateSetter(), this.getTrueFalseDefault(), "generateSetter", null, 1, 1, JDTField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTField_Owner(), this.getJDTType(), this.getJDTType_Fields(), "owner", null, 1, 1, JDTField.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(jdtCompilationUnitEClass, JDTCompilationUnit.class, "JDTCompilationUnit", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJDTCompilationUnit_PackageFragment(), this.getJDTPackageFragment(), this.getJDTPackageFragment_CompilationUnits(), "packageFragment", null, 0, 1, JDTCompilationUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTCompilationUnit_Types(), this.getJDTType(), this.getJDTType_CompilationUnit(), "types", null, 0, -1, JDTCompilationUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(jdtTypeRootEClass, JDTTypeRoot.class, "JDTTypeRoot", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(jdtPackageFragmentEClass, JDTPackageFragment.class, "JDTPackageFragment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJDTPackageFragment_PackageFragmentRoot(), this.getJDTPackageFragmentRoot(), this.getJDTPackageFragmentRoot_PackageFragments(), "packageFragmentRoot", null, 0, 1, JDTPackageFragment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTPackageFragment_CompilationUnits(), this.getJDTCompilationUnit(), this.getJDTCompilationUnit_PackageFragment(), "compilationUnits", null, 0, -1, JDTPackageFragment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(jdtPackageFragmentRootEClass, JDTPackageFragmentRoot.class, "JDTPackageFragmentRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJDTPackageFragmentRoot_JavaProject(), this.getJDTJavaProject(), this.getJDTJavaProject_PackageFragmentRoots(), "javaProject", null, 0, 1, JDTPackageFragmentRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTPackageFragmentRoot_PackageFragments(), this.getJDTPackageFragment(), this.getJDTPackageFragment_PackageFragmentRoot(), "packageFragments", null, 0, -1, JDTPackageFragmentRoot.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(jdtJavaProjectEClass, JDTJavaProject.class, "JDTJavaProject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJDTJavaProject_JavaModel(), this.getJDTJavaModel(), this.getJDTJavaModel_JavaProject(), "javaModel", null, 0, 1, JDTJavaProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTJavaProject_PackageFragmentRoots(), this.getJDTPackageFragmentRoot(), this.getJDTPackageFragmentRoot_JavaProject(), "packageFragmentRoots", null, 0, -1, JDTJavaProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(jdtJavaModelEClass, JDTJavaModel.class, "JDTJavaModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJDTJavaModel_JavaProject(), this.getJDTJavaProject(), this.getJDTJavaProject_JavaModel(), "javaProject", null, 0, -1, JDTJavaModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(jdtParameterEClass, JDTParameter.class, "JDTParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJDTParameter_ParameterOwner(), this.getJDTMethod(), this.getJDTMethod_Parameters(), "parameterOwner", null, 0, 1, JDTParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTParameter_Final(), this.getboolean(), "final", "false", 1, 1, JDTParameter.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, !IS_ORDERED); + initEAttribute(getJDTParameter_IsMultiValued(), this.getboolean(), "isMultiValued", "false", 1, 1, JDTParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTParameter_Type(), this.getJDTType(), null, "type", null, 0, 1, JDTParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJDTParameter_ReturnOwner(), this.getJDTMethod(), this.getJDTMethod_ReturnType(), "returnOwner", null, 0, 1, JDTParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(jdtClassEClass, JDTClass.class, "JDTClass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(jdtInterfaceEClass, JDTInterface.class, "JDTInterface", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(jdtEnumEClass, JDTEnum.class, "JDTEnum", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(jdtImportDeclarationEClass, JDTImportDeclaration.class, "JDTImportDeclaration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(jdtImportContainerEClass, JDTImportContainer.class, "JDTImportContainer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(jdtExceptionEClass, JDTException.class, "JDTException", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + + initEClass(jdtOpaqueBodyEClass, JDTOpaqueBody.class, "JDTOpaqueBody", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getJDTOpaqueBody__body(), this.getString(), "_body", null, 1, 1, JDTOpaqueBody.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + // Initialize enums and add enum literals + initEEnum(visibilityKindEEnum, VisibilityKind.class, "VisibilityKind"); + addEEnumLiteral(visibilityKindEEnum, VisibilityKind.PUBLIC); + addEEnumLiteral(visibilityKindEEnum, VisibilityKind.PROTECTED); + addEEnumLiteral(visibilityKindEEnum, VisibilityKind.PRIVATE); + + initEEnum(trueFalseDefaultEEnum, TrueFalseDefault.class, "TrueFalseDefault"); + addEEnumLiteral(trueFalseDefaultEEnum, TrueFalseDefault.TRUE); + addEEnumLiteral(trueFalseDefaultEEnum, TrueFalseDefault.FALSE); + addEEnumLiteral(trueFalseDefaultEEnum, TrueFalseDefault.DEFAULT); + + // Initialize data types + initEDataType(stringEDataType, String.class, "String", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(intEDataType, int.class, "int", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(booleanEDataType, boolean.class, "boolean", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(jdtVisitorExceptionEDataType, JDTVisitorException.class, "JDTVisitorException", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(visitorEDataType, JDTVisitor.class, "Visitor", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // redefines + createRedefinesAnnotations(); + // union + createUnionAnnotations(); + // subsets + createSubsetsAnnotations(); + } + + /** + * Initializes the annotations for union. + * + * + * + * @generated + */ + protected void createUnionAnnotations() { + String source = "union"; + addAnnotation(getJDTParent_Children(), + source, + new String[] { + }); + } + + /** + * Initializes the annotations for redefines. + * + * + * + * @generated + */ + protected void createRedefinesAnnotations() { + String source = "redefines"; + addAnnotation(getJDTMethod_Owner(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") + }); + addAnnotation(getJDTType_CompilationUnit(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") + }); + addAnnotation(getJDTType_Owner(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") + }); + addAnnotation(getJDTField_Owner(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") + }); + addAnnotation(getJDTCompilationUnit_PackageFragment(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") + }); + addAnnotation(getJDTPackageFragment_PackageFragmentRoot(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") + }); + addAnnotation(getJDTPackageFragmentRoot_JavaProject(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTJavaElement/parent") + }); + } + + /** + * Initializes the annotations for subsets. + * + * + * + * @generated + */ + protected void createSubsetsAnnotations() { + String source = "subsets"; + addAnnotation(getJDTType_Methods(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTParent/children") + }); + addAnnotation(getJDTType_Fields(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTParent/children") + }); + addAnnotation(getJDTType_Types(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTParent/children") + }); + addAnnotation(getJDTCompilationUnit_Types(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTParent/children") + }); + addAnnotation(getJDTPackageFragment_CompilationUnits(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTParent/children") + }); + addAnnotation(getJDTPackageFragmentRoot_PackageFragments(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTParent/children") + }); + addAnnotation(getJDTJavaProject_PackageFragmentRoots(), + source, + new String[] { + }, + new URI[] { + URI.createURI(eNS_URI).appendFragment("//JDTParent/children") + }); + } + +} // JdtmmPackageImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmAdapterFactory.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmAdapterFactory.java new file mode 100644 index 00000000000..aa76f9d5313 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmAdapterFactory.java @@ -0,0 +1,595 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage + * @generated + */ +public class JdtmmAdapterFactory extends AdapterFactoryImpl { + + /** + * The cached model package. + * + * + * + * @generated + */ + protected static JdtmmPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * + * @generated + */ + public JdtmmAdapterFactory() { + if (modelPackage == null) { + modelPackage = JdtmmPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject) object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * + * @generated + */ + protected JdtmmSwitch modelSwitch = + new JdtmmSwitch() { + @Override + public Adapter caseJDTMethodBody(JDTMethodBody object) { + return createJDTMethodBodyAdapter(); + } + + @Override + public Adapter caseJDTMethod(JDTMethod object) { + return createJDTMethodAdapter(); + } + + @Override + public Adapter caseJDTMember(JDTMember object) { + return createJDTMemberAdapter(); + } + + @Override + public Adapter caseJDTParentJavaElement(JDTParentJavaElement object) { + return createJDTParentJavaElementAdapter(); + } + + @Override + public Adapter caseJDTParent(JDTParent object) { + return createJDTParentAdapter(); + } + + @Override + public Adapter caseJDTJavaElement(JDTJavaElement object) { + return createJDTJavaElementAdapter(); + } + + @Override + public Adapter caseJDTTypeParameter(JDTTypeParameter object) { + return createJDTTypeParameterAdapter(); + } + + @Override + public Adapter caseJDTType(JDTType object) { + return createJDTTypeAdapter(); + } + + @Override + public Adapter caseJDTField(JDTField object) { + return createJDTFieldAdapter(); + } + + @Override + public Adapter caseJDTCompilationUnit(JDTCompilationUnit object) { + return createJDTCompilationUnitAdapter(); + } + + @Override + public Adapter caseJDTTypeRoot(JDTTypeRoot object) { + return createJDTTypeRootAdapter(); + } + + @Override + public Adapter caseJDTPackageFragment(JDTPackageFragment object) { + return createJDTPackageFragmentAdapter(); + } + + @Override + public Adapter caseJDTPackageFragmentRoot(JDTPackageFragmentRoot object) { + return createJDTPackageFragmentRootAdapter(); + } + + @Override + public Adapter caseJDTJavaProject(JDTJavaProject object) { + return createJDTJavaProjectAdapter(); + } + + @Override + public Adapter caseJDTJavaModel(JDTJavaModel object) { + return createJDTJavaModelAdapter(); + } + + @Override + public Adapter caseJDTParameter(JDTParameter object) { + return createJDTParameterAdapter(); + } + + @Override + public Adapter caseJDTClass(JDTClass object) { + return createJDTClassAdapter(); + } + + @Override + public Adapter caseJDTInterface(JDTInterface object) { + return createJDTInterfaceAdapter(); + } + + @Override + public Adapter caseJDTEnum(JDTEnum object) { + return createJDTEnumAdapter(); + } + + @Override + public Adapter caseJDTImportDeclaration(JDTImportDeclaration object) { + return createJDTImportDeclarationAdapter(); + } + + @Override + public Adapter caseJDTImportContainer(JDTImportContainer object) { + return createJDTImportContainerAdapter(); + } + + @Override + public Adapter caseJDTException(JDTException object) { + return createJDTExceptionAdapter(); + } + + @Override + public Adapter caseJDTOpaqueBody(JDTOpaqueBody object) { + return createJDTOpaqueBodyAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * + * @param target + * the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject) target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody JDT Method Body}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody + * @generated + */ + public Adapter createJDTMethodBodyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement JDT Java Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement + * @generated + */ + public Adapter createJDTJavaElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent JDT Parent}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent + * @generated + */ + public Adapter createJDTParentAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember JDT Member}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember + * @generated + */ + public Adapter createJDTMemberAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement JDT Parent Java Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement + * @generated + */ + public Adapter createJDTParentJavaElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter JDT Type Parameter}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter + * @generated + */ + public Adapter createJDTTypeParameterAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField JDT Field}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField + * @generated + */ + public Adapter createJDTFieldAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType JDT Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType + * @generated + */ + public Adapter createJDTTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod JDT Method}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod + * @generated + */ + public Adapter createJDTMethodAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter JDT Parameter}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter + * @generated + */ + public Adapter createJDTParameterAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit JDT Compilation Unit}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit + * @generated + */ + public Adapter createJDTCompilationUnitAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot JDT Type Root}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot + * @generated + */ + public Adapter createJDTTypeRootAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment JDT Package Fragment}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment + * @generated + */ + public Adapter createJDTPackageFragmentAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot JDT Package Fragment Root}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot + * @generated + */ + public Adapter createJDTPackageFragmentRootAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject JDT Java Project}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject + * @generated + */ + public Adapter createJDTJavaProjectAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel JDT Java Model}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel + * @generated + */ + public Adapter createJDTJavaModelAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass JDT Class}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass + * @generated + */ + public Adapter createJDTClassAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface JDT Interface}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface + * @generated + */ + public Adapter createJDTInterfaceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum JDT Enum}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum + * @generated + */ + public Adapter createJDTEnumAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration JDT Import Declaration}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration + * @generated + */ + public Adapter createJDTImportDeclarationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer JDT Import Container}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer + * @generated + */ + public Adapter createJDTImportContainerAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException JDT Exception}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException + * @generated + */ + public Adapter createJDTExceptionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody JDT Opaque Body}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody + * @generated + */ + public Adapter createJDTOpaqueBodyAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} // JdtmmAdapterFactory diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmPreference.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmPreference.java new file mode 100644 index 00000000000..71f10f9be80 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmPreference.java @@ -0,0 +1,58 @@ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util; + +public class JdtmmPreference { + + private static String classMultiValue = "List"; + + /** + * Set value of class used for the MultiValue + * + * @param classMultiValue + */ + public static void setClassMultiValue(String classMultiValue) { + JdtmmPreference.classMultiValue = classMultiValue; + } + + /** + * get value of class used for the MultiValue + * + * @param classMultiValue + */ + public static String getMultiValued(String typeName) { + return classMultiValue + "<" + getPrimiveTypeClass(typeName) + ">"; + } + + /** + * return the Class of a primitive type (ex : int => Integer) + * + * @param typename + * @return true if typename is a primive type + */ + private static String getPrimiveTypeClass(String typename) { + if (typename.equals("byte")) { + return "Byte"; + } + if (typename.equals("char")) { + return "Character"; + } + if (typename.equals("double")) { + return "Double"; + } + if (typename.equals("float")) { + return "Float"; + } + if (typename.equals("int")) { + return "Integer"; + } + if (typename.equals("long")) { + return "Long"; + } + if (typename.equals("short")) { + return "Short"; + } + if (typename.equals("boolean")) { + return "Boolean"; + } + return typename; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmSwitch.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmSwitch.java new file mode 100644 index 00000000000..54c63e6116d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/util/JdtmmSwitch.java @@ -0,0 +1,880 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.util.Switch; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTClass; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTCompilationUnit; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTEnum; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTException; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTField; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportContainer; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTImportDeclaration; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTInterface; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaModel; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaProject; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMember; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethod; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTMethodBody; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTOpaqueBody; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragment; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTPackageFragmentRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParent; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTParentJavaElement; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTType; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeParameter; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTTypeRoot; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * + * @see org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JdtmmPackage + * @generated + */ +public class JdtmmSwitch extends Switch { + + /** + * The cached model package + * + * + * + * @generated + */ + protected static JdtmmPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * + * @generated + */ + public JdtmmSwitch() { + if (modelPackage == null) { + modelPackage = JdtmmPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * + * @parameter ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case JdtmmPackage.JDT_METHOD_BODY: { + JDTMethodBody jdtMethodBody = (JDTMethodBody) theEObject; + T result = caseJDTMethodBody(jdtMethodBody); + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_METHOD: { + JDTMethod jdtMethod = (JDTMethod) theEObject; + T result = caseJDTMethod(jdtMethod); + if (result == null) { + result = caseJDTMember(jdtMethod); + } + if (result == null) { + result = caseJDTParentJavaElement(jdtMethod); + } + if (result == null) { + result = caseJDTJavaElement(jdtMethod); + } + if (result == null) { + result = caseJDTParent(jdtMethod); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_MEMBER: { + JDTMember jdtMember = (JDTMember) theEObject; + T result = caseJDTMember(jdtMember); + if (result == null) { + result = caseJDTParentJavaElement(jdtMember); + } + if (result == null) { + result = caseJDTJavaElement(jdtMember); + } + if (result == null) { + result = caseJDTParent(jdtMember); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_PARENT_JAVA_ELEMENT: { + JDTParentJavaElement jdtParentJavaElement = (JDTParentJavaElement) theEObject; + T result = caseJDTParentJavaElement(jdtParentJavaElement); + if (result == null) { + result = caseJDTJavaElement(jdtParentJavaElement); + } + if (result == null) { + result = caseJDTParent(jdtParentJavaElement); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_PARENT: { + JDTParent jdtParent = (JDTParent) theEObject; + T result = caseJDTParent(jdtParent); + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_JAVA_ELEMENT: { + JDTJavaElement jdtJavaElement = (JDTJavaElement) theEObject; + T result = caseJDTJavaElement(jdtJavaElement); + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_TYPE_PARAMETER: { + JDTTypeParameter jdtTypeParameter = (JDTTypeParameter) theEObject; + T result = caseJDTTypeParameter(jdtTypeParameter); + if (result == null) { + result = caseJDTJavaElement(jdtTypeParameter); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_TYPE: { + JDTType jdtType = (JDTType) theEObject; + T result = caseJDTType(jdtType); + if (result == null) { + result = caseJDTMember(jdtType); + } + if (result == null) { + result = caseJDTParentJavaElement(jdtType); + } + if (result == null) { + result = caseJDTJavaElement(jdtType); + } + if (result == null) { + result = caseJDTParent(jdtType); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_FIELD: { + JDTField jdtField = (JDTField) theEObject; + T result = caseJDTField(jdtField); + if (result == null) { + result = caseJDTMember(jdtField); + } + if (result == null) { + result = caseJDTParentJavaElement(jdtField); + } + if (result == null) { + result = caseJDTJavaElement(jdtField); + } + if (result == null) { + result = caseJDTParent(jdtField); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_COMPILATION_UNIT: { + JDTCompilationUnit jdtCompilationUnit = (JDTCompilationUnit) theEObject; + T result = caseJDTCompilationUnit(jdtCompilationUnit); + if (result == null) { + result = caseJDTTypeRoot(jdtCompilationUnit); + } + if (result == null) { + result = caseJDTParentJavaElement(jdtCompilationUnit); + } + if (result == null) { + result = caseJDTJavaElement(jdtCompilationUnit); + } + if (result == null) { + result = caseJDTParent(jdtCompilationUnit); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_TYPE_ROOT: { + JDTTypeRoot jdtTypeRoot = (JDTTypeRoot) theEObject; + T result = caseJDTTypeRoot(jdtTypeRoot); + if (result == null) { + result = caseJDTParentJavaElement(jdtTypeRoot); + } + if (result == null) { + result = caseJDTJavaElement(jdtTypeRoot); + } + if (result == null) { + result = caseJDTParent(jdtTypeRoot); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_PACKAGE_FRAGMENT: { + JDTPackageFragment jdtPackageFragment = (JDTPackageFragment) theEObject; + T result = caseJDTPackageFragment(jdtPackageFragment); + if (result == null) { + result = caseJDTParentJavaElement(jdtPackageFragment); + } + if (result == null) { + result = caseJDTJavaElement(jdtPackageFragment); + } + if (result == null) { + result = caseJDTParent(jdtPackageFragment); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_PACKAGE_FRAGMENT_ROOT: { + JDTPackageFragmentRoot jdtPackageFragmentRoot = (JDTPackageFragmentRoot) theEObject; + T result = caseJDTPackageFragmentRoot(jdtPackageFragmentRoot); + if (result == null) { + result = caseJDTParentJavaElement(jdtPackageFragmentRoot); + } + if (result == null) { + result = caseJDTJavaElement(jdtPackageFragmentRoot); + } + if (result == null) { + result = caseJDTParent(jdtPackageFragmentRoot); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_JAVA_PROJECT: { + JDTJavaProject jdtJavaProject = (JDTJavaProject) theEObject; + T result = caseJDTJavaProject(jdtJavaProject); + if (result == null) { + result = caseJDTParentJavaElement(jdtJavaProject); + } + if (result == null) { + result = caseJDTJavaElement(jdtJavaProject); + } + if (result == null) { + result = caseJDTParent(jdtJavaProject); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_JAVA_MODEL: { + JDTJavaModel jdtJavaModel = (JDTJavaModel) theEObject; + T result = caseJDTJavaModel(jdtJavaModel); + if (result == null) { + result = caseJDTParentJavaElement(jdtJavaModel); + } + if (result == null) { + result = caseJDTJavaElement(jdtJavaModel); + } + if (result == null) { + result = caseJDTParent(jdtJavaModel); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_PARAMETER: { + JDTParameter jdtParameter = (JDTParameter) theEObject; + T result = caseJDTParameter(jdtParameter); + if (result == null) { + result = caseJDTMember(jdtParameter); + } + if (result == null) { + result = caseJDTParentJavaElement(jdtParameter); + } + if (result == null) { + result = caseJDTJavaElement(jdtParameter); + } + if (result == null) { + result = caseJDTParent(jdtParameter); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_CLASS: { + JDTClass jdtClass = (JDTClass) theEObject; + T result = caseJDTClass(jdtClass); + if (result == null) { + result = caseJDTType(jdtClass); + } + if (result == null) { + result = caseJDTMember(jdtClass); + } + if (result == null) { + result = caseJDTParentJavaElement(jdtClass); + } + if (result == null) { + result = caseJDTJavaElement(jdtClass); + } + if (result == null) { + result = caseJDTParent(jdtClass); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_INTERFACE: { + JDTInterface jdtInterface = (JDTInterface) theEObject; + T result = caseJDTInterface(jdtInterface); + if (result == null) { + result = caseJDTType(jdtInterface); + } + if (result == null) { + result = caseJDTMember(jdtInterface); + } + if (result == null) { + result = caseJDTParentJavaElement(jdtInterface); + } + if (result == null) { + result = caseJDTJavaElement(jdtInterface); + } + if (result == null) { + result = caseJDTParent(jdtInterface); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_ENUM: { + JDTEnum jdtEnum = (JDTEnum) theEObject; + T result = caseJDTEnum(jdtEnum); + if (result == null) { + result = caseJDTType(jdtEnum); + } + if (result == null) { + result = caseJDTMember(jdtEnum); + } + if (result == null) { + result = caseJDTParentJavaElement(jdtEnum); + } + if (result == null) { + result = caseJDTJavaElement(jdtEnum); + } + if (result == null) { + result = caseJDTParent(jdtEnum); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_IMPORT_DECLARATION: { + JDTImportDeclaration jdtImportDeclaration = (JDTImportDeclaration) theEObject; + T result = caseJDTImportDeclaration(jdtImportDeclaration); + if (result == null) { + result = caseJDTJavaElement(jdtImportDeclaration); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_IMPORT_CONTAINER: { + JDTImportContainer jdtImportContainer = (JDTImportContainer) theEObject; + T result = caseJDTImportContainer(jdtImportContainer); + if (result == null) { + result = caseJDTParentJavaElement(jdtImportContainer); + } + if (result == null) { + result = caseJDTJavaElement(jdtImportContainer); + } + if (result == null) { + result = caseJDTParent(jdtImportContainer); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_EXCEPTION: { + JDTException jdtException = (JDTException) theEObject; + T result = caseJDTException(jdtException); + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JdtmmPackage.JDT_OPAQUE_BODY: { + JDTOpaqueBody jdtOpaqueBody = (JDTOpaqueBody) theEObject; + T result = caseJDTOpaqueBody(jdtOpaqueBody); + if (result == null) { + result = caseJDTMethodBody(jdtOpaqueBody); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Method Body'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Method Body'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTMethodBody(JDTMethodBody object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Java Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Java Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTJavaElement(JDTJavaElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Parent'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Parent'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTParent(JDTParent object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Member'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Member'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTMember(JDTMember object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Parent Java Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Parent Java Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTParentJavaElement(JDTParentJavaElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Type Parameter'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Type Parameter'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTTypeParameter(JDTTypeParameter object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Field'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Field'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTField(JDTField object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTType(JDTType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Method'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Method'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTMethod(JDTMethod object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Parameter'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Parameter'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTParameter(JDTParameter object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Compilation Unit'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Compilation Unit'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTCompilationUnit(JDTCompilationUnit object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Type Root'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Type Root'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTTypeRoot(JDTTypeRoot object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Package Fragment'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Package Fragment'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTPackageFragment(JDTPackageFragment object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Package Fragment Root'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Package Fragment Root'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTPackageFragmentRoot(JDTPackageFragmentRoot object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Java Project'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Java Project'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTJavaProject(JDTJavaProject object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Java Model'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Java Model'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTJavaModel(JDTJavaModel object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Class'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Class'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTClass(JDTClass object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Interface'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Interface'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTInterface(JDTInterface object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Enum'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Enum'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTEnum(JDTEnum object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Import Declaration'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Import Declaration'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTImportDeclaration(JDTImportDeclaration object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Import Container'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Import Container'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTImportContainer(JDTImportContainer object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Exception'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Exception'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTException(JDTException object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'JDT Opaque Body'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'JDT Opaque Body'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJDTOpaqueBody(JDTOpaqueBody object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} // JdtmmSwitch diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitor.java new file mode 100644 index 00000000000..96f258be762 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitor.java @@ -0,0 +1,39 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor; + +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.JDTJavaElement; + + +/** + * + */ +public interface JDTVisitor { + + /** + * + * @param element + */ + void visit(JDTJavaElement element) throws JDTVisitorException; + +} // JDTVisitor diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitorException.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitorException.java new file mode 100644 index 00000000000..d2d1d0b8ae8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/jdtmm/visitor/JDTVisitorException.java @@ -0,0 +1,42 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor; + +public class JDTVisitorException extends Exception { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public JDTVisitorException() { + super(); + } + + public JDTVisitorException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + + public JDTVisitorException(String arg0) { + super(arg0); + } + + public JDTVisitorException(Throwable arg0) { + super(arg0); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/utils/DerivedNotifyingEList.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/utils/DerivedNotifyingEList.java new file mode 100644 index 00000000000..6f5bdd9b327 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt/src/org/eclipse/papyrus/java/generator/metamodel/jdt/utils/DerivedNotifyingEList.java @@ -0,0 +1,442 @@ +/***************************************************************************** + * Copyright (c) 2010 LIFL & CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin (LIFL) cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.metamodel.jdt.utils; + +import java.util.AbstractSequentialList; +import java.util.ListIterator; +import java.util.NoSuchElementException; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.notify.NotifyingList; +import org.eclipse.emf.common.notify.impl.AdapterImpl; +import org.eclipse.emf.common.notify.impl.NotificationImpl; +import org.eclipse.emf.common.util.AbstractEList; +import org.eclipse.emf.common.util.EList; + + +/** + * A List derived from an original list. + * + *
    + * Some code from org.eclipse.emf.common.util.AbstractEList + * + * @author cedric dumoulin + * + * @param E + * Expected type of this derived list's item. I.e. the type returned by this list get() method. + * @param T + * Type of the original list elements' + */ +public abstract class DerivedNotifyingEList extends AbstractSequentialList implements EList, NotifyingList { + + + /** + * The original List + */ + protected NotifyingList backupList; + + /** + * Notifier used to notify changes in the list + */ + private Object notifier; + + /** + * Feature in the list that correspond to the list. + */ + private Object feature; + + /** + * Feature ID + */ + private int featureID; + + /** + * Listener on backuplist. + * TODO : use weakreference in order to enable garbage on this class. + */ + private Adapter backupListChangeListener = new AdapterImpl() { + + /** + * Event receive when the backupList is changed. + * + * @param msg + */ + @Override + public void notifyChanged(Notification msg) { + + // Retains only changes from the backuplist + if (msg.getNotifier() != backupList.getNotifier() || msg.getFeature() != backupList.getFeature()) { + return; + } + + // create a new Notification and throw event to its Notifier + NotificationImpl newNotification = createNotification(msg); + newNotification.dispatch(); + + } + }; + + /** + * Constructor. + * The backupList is used as notifier. Feature is set to null and featureID to 0. + * + */ + public DerivedNotifyingEList(NotifyingList backupList) { + + this(backupList, backupList.getNotifier(), null, 0); + } + + /** + * Constructor. + * + * @param backupList + * @param notifier + * @param feature + * @param featureID + */ + public DerivedNotifyingEList(NotifyingList backupList, Object feature, int featureID) { + + this(backupList, backupList.getNotifier(), feature, featureID); + } + + /** + * Final Constructor.
    + * Feature and featureID should be different from the backupList.feature and backupList.featureID + * + * @param backupList + * @param notifier + * @param feature + * The feature in the notifier that represent this list. + * @param featureID + * The feature ID + */ + public DerivedNotifyingEList(NotifyingList backupList, Object notifier, Object feature, int featureID) { + + // Check values + if (feature == backupList.getFeature() || featureID == backupList.getFeatureID()) { + throw new IllegalArgumentException("Feature and featureID should be different from the backupList.feature and backupList.featureID. [" + + feature + "==" + + backupList.getFeature() + " - " + + featureID + "==" + + backupList.getFeatureID() + + "]"); + } + + // Set properties + this.backupList = backupList; + this.notifier = notifier; + this.feature = feature; + this.featureID = featureID; + attachListener(); + } + + /** + * Listen to changes in backupList. + */ + protected void attachListener() { + ((Notifier) notifier).eAdapters().add(backupListChangeListener); + } + + /** + * @see org.eclipse.emf.common.notify.NotifyingList#getNotifier() + * + * @return + */ + @Override + public Object getNotifier() { + return notifier; + } + + /** + * @see org.eclipse.emf.common.notify.NotifyingList#getFeature() + * + * @return + */ + @Override + public Object getFeature() { + return feature; + } + + /** + * @see org.eclipse.emf.common.notify.NotifyingList#getFeatureID() + * + * @return + */ + @Override + public int getFeatureID() { + return featureID; + } + + /** + * Creates a notification. + * + * @param eventType + * the type of change that has occurred. + * @param oldObject + * the value of the notifier's feature before the change occurred. + * @param newObject + * the value of the notifier's feature after the change occurred. + * @param index + * the position at which the change occurred. + * @return a new notification. + */ + protected NotificationImpl createNotification(Notification origNotification) + { + + return new NotificationImpl(origNotification.getEventType(), origNotification.getOldValue(), origNotification.getNewValue(), origNotification.getPosition(), origNotification.wasSet()) + { + + @Override + public Object getNotifier() + { + return DerivedNotifyingEList.this.getNotifier(); + } + + @Override + public Object getFeature() + { + return DerivedNotifyingEList.this.getFeature(); + } + + @Override + public int getFeatureID(Class expectedClass) + { + return DerivedNotifyingEList.this.getFeatureID(); + } + }; + } + + public NotifyingList getBackupList() { + return backupList; + } + + /** + * Get the object at the specified index in the backup list. + * Subclass should override in order to return the proper object. + * + * @param index + * @return + */ + abstract protected E doGet(int index); + + /** + * @see org.eclipse.emf.common.util.EList#move(int, java.lang.Object) + * + * @param newPosition + * @param object + */ + @Override + public void move(int newPosition, E object) { + move(newPosition, indexOf(object)); + } + + /** + * @see org.eclipse.emf.common.util.EList#move(int, int) + * + * @param newPosition + * @param oldPosition + * @return + */ + @Override + public E move(int newPosition, int oldPosition) { + throw new UnsupportedOperationException(); + } + + /** + * @see java.util.AbstractCollection#size() + * + * @return + */ + @Override + public int size() { + return backupList.size(); + } + + /** + * @see java.util.AbstractSequentialList#listIterator(int) + * + * @param index + * @return + */ + @Override + public ListIterator listIterator(int index) { + return new DerivedListIterator(index); + } + + /** + * + * + * @param + */ + public class DerivedListIterator implements ListIterator { + + /** + * The current position of the iterator. + */ + protected int cursor = 0; + + /** + * The previous position of the iterator. + */ + protected int lastCursor = -1; + + /** + * The modification count of the containing list. + */ + protected int expectedModCount = modCount; + + + /** + * Creates an instance advanced to the index. + * + * @param index + * the starting index. + */ + public DerivedListIterator(int index) + { + cursor = index; + } + + /** + * Returns whether there are more objects. + * + * @return whether there are more objects. + */ + @Override + public boolean hasNext() + { + return cursor != size(); + } + + /** + * Returns the next object and advances the iterator. + * This implementation delegates to {@link #doNext doNext}. + * + * @return the next object. + * @exception NoSuchElementException + * if the iterator is done. + */ + @Override + public E next() + { + try + { + E next = doGet(cursor); + lastCursor = cursor++; + return next; + } catch (IndexOutOfBoundsException exception) + { + throw new NoSuchElementException(); + } + } + + /** + * Returns whether there are more objects for {@link #previous}. + * Returns whether there are more objects. + */ + @Override + public boolean hasPrevious() + { + return cursor != 0; + } + + /** + * Returns the previous object and advances the iterator. + * This implementation delegates to {@link #doPrevious doPrevious}. + * + * @return the previous object. + * @exception NoSuchElementException + * if the iterator is done. + */ + @Override + public E previous() + { + try + { + E previous = doGet(--cursor); + lastCursor = cursor; + return previous; + } catch (IndexOutOfBoundsException exception) + { + throw new NoSuchElementException(); + } + } + + /** + * Returns the index of the object that would be returned by calling {@link #next() next}. + * + * @return the index of the object that would be returned by calling next. + */ + @Override + public int nextIndex() + { + return cursor; + } + + /** + * Returns the index of the object that would be returned by calling {@link #previous previous}. + * + * @return the index of the object that would be returned by calling previous. + */ + @Override + public int previousIndex() + { + return cursor - 1; + } + + /** + * Sets the object at the index of the last call to {@link #next() next} or {@link #previous previous}. + * This implementation delegates to {@link AbstractEList#set set}. + * + * @param object + * the object to set. + * @exception IllegalStateException + * if next or previous have not yet been called, + * or {@link #remove(Object) remove} or {@link #add add} have already been called + * after the last call to next or previous. + */ + @Override + public void set(E object) + { + throw new UnsupportedOperationException(); + } + + /** + * Adds the object at the {@link #next() next} index and advances the iterator past it. + * This implementation delegates to {@link #doAdd(Object) doAdd(E)}. + * + * @param object + * the object to add. + */ + @Override + public void add(E object) + { + throw new UnsupportedOperationException(); + } + + /** + * @see java.util.ListIterator#remove() + * + */ + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.classpath b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.project b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.project new file mode 100644 index 00000000000..42aed9bd201 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.project @@ -0,0 +1,38 @@ + + + org.eclipse.papyrus.java.generator.transfo.umltojdt + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.m2m.qvt.oml.project.QVTOBuilder + + + src_container + transforms + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.m2m.qvt.oml.project.QVTONature + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..e126b18f3b0 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/META-INF/MANIFEST.MF @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Export-Package: org.eclipse.papyrus.java.generator.transfo.umltojdt +Require-Bundle: org.eclipse.core.runtime +Bundle-Vendor: %providerName +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.java.generator.transfo.umltojdt +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/about.html b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/build.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/build.properties new file mode 100644 index 00000000000..60a87c754ae --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + transforms/,\ + plugin.properties,\ + about.html +src.includes = about.html diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.di b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.di new file mode 100644 index 00000000000..9d143f73599 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.di @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.notation b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.notation new file mode 100644 index 00000000000..08d0a52ccd9 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.notation @@ -0,0 +1,775 @@ + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.uml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.uml new file mode 100644 index 00000000000..dda3161236d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/doc/rulesInheritance.uml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/plugin.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/plugin.properties new file mode 100644 index 00000000000..7d387085329 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/plugin.properties @@ -0,0 +1,19 @@ + +################################################################################# +# Copyright (c) 2011 Nicolas Deblock & Manuel Giles. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation +# Manuel Giles giles.manu@live.fr - Initial API and implementation +# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception +# +################################################################################# + + +pluginName=Papyrus Java Classes Generator transformations (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/pom.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/pom.xml new file mode 100644 index 00000000000..73c69ddba04 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.java.generator.transfo.umltojdt + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/src/org/eclipse/papyrus/java/generator/transfo/umltojdt/UmltojdtActivator.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/src/org/eclipse/papyrus/java/generator/transfo/umltojdt/UmltojdtActivator.java new file mode 100644 index 00000000000..d4160d94245 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/src/org/eclipse/papyrus/java/generator/transfo/umltojdt/UmltojdtActivator.java @@ -0,0 +1,71 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial transformation and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial transformation and implementation + * Manuel Giles giles.manu@live.fr - Initial transformation and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.transfo.umltojdt; + +import org.eclipse.core.runtime.Plugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class UmltojdtActivator extends Plugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.java.generator.transfo.umltojdt"; + public static final String PATH_QVT_FILE = "/transforms/uml/uml2jdt2.qvto"; + + // The shared instance + private static UmltojdtActivator plugin; + + /** + * The constructor + */ + public UmltojdtActivator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static UmltojdtActivator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/algo.txt b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/algo.txt new file mode 100644 index 00000000000..bdcd72a922b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/algo.txt @@ -0,0 +1,167 @@ + + +class Data { + + projectName + srcName + packageName +} + +/** + * + */ +Type::markType( Type type, defSrc, defPrj ) { + if( type.data == null ) + type.data = getTypeData(); + +} + +// Get or create the Data for this Type +Type::getTypeData(defSrc, defPrj) : Data { + + // Check if it exist + if( type.data != null ) + return type.data ; + + // Create it + Data data = new Data(); + // srcName = si stereotype ==> stereotype; sinon si parent ==> parent.srcName; sinon defSrc + if( parent != null ) { + parentData = parent.getData(defSrc, defPrj); + data.srcName = getStereotype( , "src", parentData.srcName ); + projectName = getStereotype( , "project", parentData.projectName ); + packageName = parentData.packageName; + } + else { + data.srcName = getStereotype( , "src", defSrc ); + projectName = getStereotype( , "project", defPrj ); + packageName = DFLT_PACKAGE_NAME; + } + + return type.data; +} + +// Get or create the Data for this Package +// Check if the package is a src or project +Package::getTypeData(defSrc, defPrj) : Data { + + // Check if it exist + if( type.data != null ) + return type.data ; + + // Create it + // Data data = new Data(); + + // Are we a "src" ? + if( isStereotyped("src") ) { + return createTypeDataFromSrcFolder(defSrc, defPrj); + } + else if( isStereotyped("project") ) { + return createTypeDataFromProject(defSrc, defPrj); + } + else if( self.isTypeOf(uml::Model) ) { + // This is a simple package + return createTypeDataFromUmlModel(defSrc, defPrj); + } + else { + // This is a simple package + return createTypeDataFromSimplePackage(defSrc, defPrj); + } +} + +// Get or create the Data for this simple Package +// +// Don't check if the package is a src or project +Package::createTypeDataFromSimplePackage(defSrc, defPrj) : Data { + + Data data = new Data(); + // srcName = si stereotype ==> stereotype; sinon si parent ==> parent.srcName; sinon defSrc + if( parent != null ) { + parentData = parent.getData(defSrc, defPrj); + data.srcName = getStereotype( "JavaPackage", "src", parentData.srcName ); + projectName = getStereotype( , "project", parentData.projectName ); + // packageName = parentData.packageName + "." + (stereotype ? stereotype: self.name) + packageName = computePackageName( parentData.packageName, getStereotype( , "name", self.name ) ); + } + else { + data.srcName = getStereotype( "JavaPackage", "src", defSrc ); + projectName = getStereotype( , "project", defPrj ); + packageName = getStereotype( , "name", self.name ); + } + + return type.data; + +} + +// Compute the package name from the prefix and suffix. +// check if prefix is null or size=0 +computePackageName( prefix, suffix ) { + if( prefix != null && prefix != "") + return prefix + "." + suffix; + else + return suffix; +} + +// Get or create the Data for a Package Stereotypes "SrcFolder" +// +// Don't Check if the package is a src or project +Package::createTypeDataFromSourceFolder(defSrc, defPrj) : Data { + + Data data = new Data(); + // srcName = si stereotype ==> stereotype; sinon si parent ==> parent.srcName; sinon defSrc + if( parent != null ) { + // Lookup for Project + parentData = parent.getData(defSrc, defPrj); + data.srcName = getStereotype( "JavaSrcFolder", "src", parentData.srcName ); + projectName = getStereotype( , "project", parentData.projectName ); + // packageName = "" or null, as we are in a srcFolder (root of packages) + packageName = null; + } + else { + data.srcName = getStereotype( "JavaPackage", "src", defSrc ); + projectName = getStereotype( , "project", defPrj ); + packageName = null; + } + + return type.data; +} + +// Get or create the Data for a Package Stereotypes "Project" +// +// Don't Check if the package is a src or project +Package::createTypeDataFromProjectFolder(defSrc, defPrj) : Data { + + Data data = new Data(); + + data.srcName = getStereotype( "JavaProject", "src", defSrc ); + projectName = getStereotype( , "project", defPrj ); + packageName = null; + + return type.data; +} + +// Get or create the Data for a uml::Model +// This is the root, so stop recursivity +// Don't Check if the package is a src or project +Package::createTypeDataFromUmlModel(defSrc, defPrj) : Data { + + Data data = new Data(); + + data.srcName = gdefSrc; + projectName = defPrj ; + packageName = null; + + return type.data; +} + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/stereotypeUtil.qvto b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/stereotypeUtil.qvto new file mode 100644 index 00000000000..98c70005c93 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/stereotypeUtil.qvto @@ -0,0 +1,99 @@ +/***************************************************************************** + * Copyright (c) 2011 Cedric Dumoulin + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial implementation + * + *****************************************************************************/ + + library stereotypeUtil; + +/* Model type declarations +*/ +modeltype mmUML uses "http://www.eclipse.org/uml2/3.0.0/UML"; + +/* + * Get the specified taggedValue. Return the found property value, or the provided default value if not + * taggedValue can be found. + */ +query mmUML::NamedElement::getTaggedValue(stereotypeName : String, taggedValueName : String, defaultValue : OclAny) : OclAny { + + var value : OclAny := defaultValue; + var stereotype := self.getAppliedStereotype(stereotypeName); + if (stereotype.oclIsUndefined()) + then + return value + endif; + + var taggedValue := self.getValue(stereotype, taggedValueName); + if taggedValue.oclIsUndefined() + then + return defaultValue + endif; + + return taggedValue; +} + +query mmUML::NamedElement::getTaggedValues(stereotypeName : String, taggedValueName : String, defaultValue : Set(OclAny)) : Set(OclAny) { + + var value : Set(OclAny) := defaultValue; + var stereotype := self.getAppliedStereotype(stereotypeName); + if (stereotype.oclIsUndefined()) + then + return value + endif; + + var taggedValue := self.getValue(stereotype, taggedValueName); + if taggedValue->size() <=0 + then + return defaultValue + endif; + + return taggedValue->asSet(); +} + + +/* + * Get a tagged value by its name and the sterotype name. + * Return null if no stereotype of taggedValue is defined. + */ +query uml::NamedElement::getBooleanTaggedValue( stereotypeName : String, taggedValueName : String ) : Boolean { + + return self.getTaggedValue(stereotypeName, taggedValueName, null).oclAsType(Boolean); +} + +/* + * Get the specified taggedValue. Return the found property value, or the provided default value if not + * taggedValue can be found. + */ +query mmUML::NamedElement::getBooleanTaggedValue(stereotypeName : String, valueName : String, defaultValue : Boolean) : Boolean { + + return self.getTaggedValue(stereotypeName, valueName, defaultValue).oclAsType(Boolean); +} + + +/* + * Get the specified taggedValue. Return the found property value, or the provided default value if not + * taggedValue can be found. + */ +query mmUML::NamedElement::getStringTaggedValue(stereotypeName : String, valueName : String, defaultValue : String) : String { + + return self.getTaggedValue(stereotypeName, valueName, defaultValue).oclAsType(String); +} + +/* + * Get the specified taggedValue. Return the found property value, or the provided default value if not + * taggedValue can be found. + */ +query mmUML::NamedElement::getEnumTaggedValue(stereotypeName : String, valueName : String, defaultValue : String) : String { + var ret = self.getTaggedValue(stereotypeName, valueName,defaultValue); + if (not ret.oclIsTypeOf(EnumerationLiteral)) then return defaultValue endif; + return self.getTaggedValue(stereotypeName, valueName,defaultValue).oclAsType(EnumerationLiteral).name; +} + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/uml2jdt2.qvto b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/uml2jdt2.qvto new file mode 100644 index 00000000000..e2a43a4cf6e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt/transforms/uml/uml2jdt2.qvto @@ -0,0 +1,1269 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Cedric Dumoulin & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial transformation and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial transformation and implementation + * Manuel Giles giles.manu@live.fr - Initial transformation and implementation + * + *****************************************************************************/ + +import stereotypeUtil; +import Strings; + +/* Model type declarations +*/ +modeltype UMLmm uses "http://www.eclipse.org/uml2/3.0.0/UML"; +modeltype JDTmm uses 'http:///jdtmm.ecore'; +modeltype GeneratorOptionsMM uses 'http:///GeneratorOptionsMM.ecore'; +modeltype JavaProfile uses java('http://www.eclipse.org/papyrus/JAVA/1'); + +/** + * + */ +transformation uml2jdt2( in uml: UMLmm, in options : GeneratorOptionsMM, out jdt: JDTmm) + extends stereotypeUtil; + +/** Root of java stereotypes */ +intermediate property UMLmm::STEREOTYPE_JAVA_NAMED_ELEMENT : String; +intermediate property UMLmm::STEREOTYPE_JAVA_GEN : String; +/** Apply to any Types */ +intermediate property UMLmm::STEREOTYPE_JAVA_CLASS : String; +intermediate property UMLmm::STEREOTYPE_JAVA_METHOD : String; +intermediate property UMLmm::STEREOTYPE_JAVA_PROPERTY : String; +intermediate property UMLmm::STEREOTYPE_JAVA_PROJECT : String; +intermediate property UMLmm::STEREOTYPE_JAVA_SRC_FOLDER : String; +intermediate property UMLmm::STEREOTYPE_JAVA_PACKAGE : String; +intermediate property UMLmm::STEREOTYPE_PRIMITIVETYPE : String; + +intermediate property UMLmm::TAGVALUE_SRC : String; +intermediate property UMLmm::TAGVALUE_PROJECT : String; +intermediate property UMLmm::TAGVALUE_NAME : String; +intermediate property UMLmm::TAGVALUE_GENERATED : String; +intermediate property UMLmm::TAGVALUE_IMPLEMENTATION_CLASS : String; +intermediate property UMLmm::TAGVALUE_EXPLICIT_REQUIRED_IMPORTS : String; +intermediate property UMLmm::TAGVALUE_EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS : String; +intermediate property UMLmm::NO_PACKAGE : String; +/** Default name values for generation */ +intermediate property UMLmm::GENERATION_DEFAULT_SRC_NAME : String; +intermediate property UMLmm::GENERATION_DEFAULT_PROJECT_NAME : String; + +/** + * The main operation. This is the entry point of the transformation. + */ +main() { + + // Initialize global variables + uml.STEREOTYPE_JAVA_NAMED_ELEMENT := "java::JavaNamedElement"; + uml.STEREOTYPE_JAVA_GEN := "java::JavaGen"; + uml.STEREOTYPE_JAVA_CLASS := "java::JavaClass"; + uml.STEREOTYPE_JAVA_METHOD := "java::JavaMethod"; + uml.STEREOTYPE_JAVA_PROPERTY := "java::JavaProperty"; + uml.STEREOTYPE_JAVA_PROJECT := "java::JavaProject"; + uml.STEREOTYPE_JAVA_SRC_FOLDER := "java::JavaSrcFolder"; + uml.STEREOTYPE_JAVA_PACKAGE := "java::JavaPackage_"; + uml.STEREOTYPE_PRIMITIVETYPE := "java::PrimitiveType"; + + uml.TAGVALUE_SRC := "srcName"; + uml.TAGVALUE_NAME := "name"; + uml.TAGVALUE_GENERATED := "isGenerated"; + uml.TAGVALUE_PROJECT := "projectName"; + uml.TAGVALUE_IMPLEMENTATION_CLASS := "implementationClass"; + uml.TAGVALUE_EXPLICIT_REQUIRED_IMPORTS := "explicitRequiredImports"; + uml.TAGVALUE_EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS := "explicitPlainTextRequiredImports"; + uml.NO_PACKAGE := null; + + // Default names + uml.GENERATION_DEFAULT_SRC_NAME := options.objectsOfType(GeneratorOptionsMM::Options)->asSequence()->first().defaultSourceFolder; + uml.GENERATION_DEFAULT_PROJECT_NAME := "defaultProject"; + + // Select only object that we want to generate + var types : Set(uml::Type) := uml.objects()[uml::Type]->select(o | + o.oclIsTypeOf(uml::Class) + or o.oclIsTypeOf(uml::Interface) + or o.oclIsTypeOf(uml::PrimitiveType) + or o.oclIsTypeOf(uml::Enumeration) ); + + log('------------------------ Start marking input elements'); + // First pass: mark uml::Type objects + types -> map markUmlType(uml.GENERATION_DEFAULT_SRC_NAME, uml.GENERATION_DEFAULT_PROJECT_NAME); + // show result + log('------------------------ Show results'); + types -> map showMarkedType(); + log('------------------------ Show packages results'); + uml.objects()[uml::Package] -> map showMarkedType(); + // Second pass: transform marked objects + log('------------------------ Start transformation'); + types -> map transformTypeToType(); + + log('------------------------ Done'); + +} + +/** + * A query used to check if a stereotype is applied to an UML element + */ +query uml::Element::isStereotyped( stereotypeName : String ) : Boolean { + var stereotype = self.getAppliedStereotype(stereotypeName); + return not stereotype.oclIsUndefined(); +} + +/** + * Is the specified type a Compilation Unit ? + */ +query uml::Type::isCompilationUnit( ) : Boolean { + + // A compilation unit is a type whose owner is a Package + return self.owner.oclIsKindOf(Package); +} + +/** + * Get the interfaces associated to the Classifier + */ +query uml::Classifier::generalInterfaces() : Set(uml::Interface) { + // Get interface linked by a generalization +// var res : Set(uml::Interface) := self.generalization -> select( p | p.general.oclIsTypeOf(uml::Interface)) +// -> collect(p | p.general.oclAsType(uml::Interface)) -> asSet(); + var res : Set(uml::Interface) := self.generalization.general[uml::Interface] -> asSet(); + + return res; +} + +/** + * Get the class associated to a stereotype. This work for static profile. + */ +query uml::NamedElement::getStereotype(stereotypeName:String) : OclAny { + + var stereotype := self.getAppliedStereotype(stereotypeName); + if (stereotype.oclIsUndefined()) + then + return null + endif; + + return self.getStereotypeApplication(stereotype); +} + + +/** + * Get the JavaClass stereotype from a classifier. + */ +query uml::Classifier::getJavaClassStereotype() : JavaProfile::JavaClass { + + return self.getStereotype(uml.STEREOTYPE_JAVA_CLASS).oclAsType(JavaProfile::JavaClass); +} + +/** + * Get the JavaClass stereotype from a classifier. + */ +query uml::Operation::getJavaMethodStereotype() : JavaProfile::JavaMethod { + + return self.getStereotype(uml.STEREOTYPE_JAVA_METHOD).oclAsType(JavaProfile::JavaMethod); +} + +/** + * Get the JavaClass stereotype from a classifier. + */ +query uml::Property::getJavaPropertyStereotype() : JavaProfile::JavaProperty { + + return self.getStereotype(uml.STEREOTYPE_JAVA_PROPERTY).oclAsType(JavaProfile::JavaProperty); +} + +/** + * Get the ExplicitImports from a classifier. + * Explicit imports are stored in a Stereotype. + */ +query uml::Classifier::getExplicitPlainTextRequiredImports() : Set(String) { + + var emptySet : Set(String) := Set{}; + return self.getTaggedValue( uml.STEREOTYPE_JAVA_CLASS, + uml.TAGVALUE_EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS, + OclAny ) [String]->asSet(); +} + +/** + * Get the interfaces associated to the Classifier + */ +query uml::BehavioredClassifier::generalInterfacesForClass() : Set(uml::Interface) +{ + // Get interface linked by a generalization + // var res : Set(uml::Interface) := self.generalization -> select( p | p.general.oclIsTypeOf(uml::Interface)) + // -> collect(p | p.general.oclAsType(uml::Interface)) -> asSet(); + var res : Set(uml::Interface) := self.generalization.general[uml::Interface] -> asSet(); + + // manage the interfaceRealisation + res += self.oclAsType(uml::BehavioredClassifier).interfaceRealization.supplier[uml::Interface]; + + return res; +} + +/** + * Get the general Class associated to the Enumeration + */ +query uml::Enumeration::general() : uml::Class { + // Get interface linked by a generalization + var res : uml::Class := self.generalization.general[uml::Class] -> asOrderedSet() -> first(); + + return res; +} + +/** + * return true if the element is marked has "toGenerate". Return false otherwise. + */ +query uml::NamedElement::isGenerated() : Boolean { + // by default, generated are true + var generated := true; + + self.getApplicableStereotypes()->forEach(st) { + generated := self->getBooleanTaggedValue("java::"+st.name, "isGenerated",generated)->asOrderedSet()->first(); + }; + + return generated; +} + + +/** + * Compute additional data associated to self. + * How to compute such datas is dependant of the type of self, so dispatch to the appropriate method. + * + * Common ancestor. Dispatch to correct method according to the element's type. + */ +helper NamedElement::getData(defaultSrcName : String, defaultProjectName : String) : TypeMarker { + +// log("NamedElement::getData(self.name=" + self.name + ") "); + + // overloading doesn't work, so we do it manually + if( self.oclIsKindOf(uml::PrimitiveType)) then { + return self.oclAsType(uml::PrimitiveType).getDataFromPrimitiveType( defaultSrcName, defaultProjectName); + } endif; + + if( self.oclIsKindOf(uml::Type)) then { + return self.oclAsType(uml::Type).getDataFromType( defaultSrcName, defaultProjectName); + } + else { + if( self.oclIsKindOf(uml::Package)) then { + return self.oclAsType(uml::Package).getDataFromPackage( defaultSrcName, defaultProjectName); + } endif; + } endif; + // not defined + return null; +} + +/** + * Compute the additional data for a uml::Type. + * Recursively set the additional data for the parent (owner) of this type. + */ +helper Type::getDataFromType( defaultSrcName : String, defaultProjectName : String) : TypeMarker { + + log( "Type::getDataFromType(self.name=" + self.name + ")"); + // Check if data already exist + if not self.data.oclIsUndefined() + then + return self.data + endif; + + // Create it + log("Type::getData() - start creation"); + var data : TypeMarker := object TypeMarker {}; + + var parent :uml::Namespace := self.namespace; + if parent != null + then { + // + var parentData : TypeMarker := parent.getData(defaultSrcName, defaultProjectName); + data.srcName := self.getStringTaggedValue(uml.STEREOTYPE_JAVA_CLASS, uml.TAGVALUE_SRC, parentData.srcName); + data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_CLASS, uml.TAGVALUE_PROJECT, parentData.projectName ); + data.packageName := parentData.packageName; + data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_CLASS, uml.TAGVALUE_GENERATED, true ); + } + else { + data.srcName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_CLASS, uml.TAGVALUE_SRC, defaultSrcName ); + data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_CLASS, uml.TAGVALUE_PROJECT, defaultProjectName ); + data.packageName := uml.NO_PACKAGE; + data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_CLASS, uml.TAGVALUE_GENERATED, true ); + } + endif; + + + self.data := data; + return data; +} + +/** + * Compute the additional data for a uml::Type. + * Recursively set the additional data for the parent (owner) of this type. + * + * Primitive types are stored in the package declared in uml.TAGVALUE_IMPLEMENTATION_CLASS. + * If no implementation class is declared, use the same scheme as Classes. + */ +helper PrimitiveType::getDataFromPrimitiveType( defaultSrcName : String, defaultProjectName : String) : TypeMarker { + + log("Type::getDataFromPrimitiveType(self.name=" + self.name + ")"); + // Check if data already exist + if not self.data.oclIsUndefined() + then + return self.data + endif; + + // Create it + log("Type::getData() - start creation"); + var data : TypeMarker := object TypeMarker {}; + + var parent :uml::Namespace := self.namespace; + if parent != null + then { + // + var parentData : TypeMarker := parent.getData(defaultSrcName, defaultProjectName); + data.srcName := self.getStringTaggedValue(uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_SRC, parentData.srcName); + data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_PROJECT, parentData.projectName ); + data.packageName := parentData.packageName; + data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_GENERATED, parentData.generated ); + } + else { + data.srcName := self.getStringTaggedValue( uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_SRC, defaultSrcName ); + data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_PROJECT, defaultProjectName ); + data.packageName := uml.NO_PACKAGE; + data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_GENERATED, true ); + } + endif; + + // Check if an instance name is set + var instanceClassName := self.getStringTaggedValue(uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_IMPLEMENTATION_CLASS, null); + if( not instanceClassName.oclIsUndefined()) then { + // Try to get the package name from the provided qualified name. + // If none is specified, use the regular package name. + var packageName : String := instanceClassName.findPackageFromQualifiedName(data.packageName); + data.packageName := packageName; + } endif; + + self.data := data; + return data; +} + +/** + * Get the package name of the specified qualifiedname. Return the package name if there is one. + * Return the nameIfNotFound value if no package is set in qualifiedName. + * @param nameIfNotFound Default name returned if no package specified in provided String + */ +query String::findPackageFromQualifiedName( nameIfNotFound : String) : String { + + // Get the index of the last segment + var cur : int := self.lastIndexOf('.'); + // return empty string if not found + var res : String; + // Do strange comparison because of trouble with + // QVTo + if 0>(cur) then { + res := nameIfNotFound; + } + else { + res := self.substring( 1, cur); + } endif; + + return res; +} + +/** + * Get the last name from the specified qualifiedname. + */ +query String::lastNameFromQualifiedName( ) : String { + + // Get the index of the last segment + var cur : Integer := self.lastIndexOf('.'); + // return empty string if not found + var res : String; + // Do strange comparison because of trouble with + // QVTo + if 0>(cur) then { + // Only one name ==> return it + res := self; + } + else { + cur := cur+2; + res := self.substring( cur, self.size()); + } endif; + + return res; +} + + +/** + * Get generation data associated to a Package. + * Associated stereotype are taken into account to compute the GenData + */ +helper Package::getDataFromPackage(defaultSrcName : String, defaultProjectName : String) : TypeMarker { + + log("Type::getDataFromPackage(self.name=" + self.name + ")"); + // Check if data already exist + if not self.data.oclIsUndefined() + then + return self.data + endif; + + var data : TypeMarker; + + // Switch to correct helper, according to stereotype + switch { + case (self.isStereotyped( uml.STEREOTYPE_JAVA_SRC_FOLDER) ) { + // SrcFolder + data := self.createDataFromSrcFolder(defaultSrcName, defaultProjectName); + } + case ( self.isStereotyped( uml.STEREOTYPE_JAVA_PROJECT) ) { + // JavaProject + data := self.createDataFromJavaProject(defaultSrcName, defaultProjectName); + } + case ( self.isStereotyped( uml.STEREOTYPE_JAVA_PACKAGE)) { + // Treat it as a Java Package + // uml::Model and uml::Package can be marked with this stereotype. + // When a uml::Model is marked as package, it is not considered anymore as a root for packages + data := self.createDataFromSimplePackage(defaultSrcName, defaultProjectName); + } + case ( self.oclIsTypeOf(uml::Model) ) { + // uml::Model + // uml::Model is considered as the root of packages. + // So, stop on type Model, except if a STEREOTYPE_JAVA_PACKAGE is set. + data := self.createDataFromUmlModel(defaultSrcName, defaultProjectName); + } + else { + // Default Package + data := self.createDataFromSimplePackage(defaultSrcName, defaultProjectName); + } + }; + + self.data := data; + return data; +} + +/** + * Get or create the Data for a Package Stereotypes "SrcFolder" + */ +helper Package::createDataFromSrcFolder(defaultSrcName : String, defaultProjectName : String) : TypeMarker { + + var data := object TypeMarker {}; + var parent : Namespace := self.namespace; + + if parent != null + then { + // + var parentData : TypeMarker := parent.getData(defaultSrcName, defaultProjectName); + // We are in an SrcFolder, so srcName is either the stereotype.srcName or self.name + data.srcName := self.getStringTaggedValue(uml.STEREOTYPE_JAVA_SRC_FOLDER, uml.TAGVALUE_SRC, self.name); + data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_SRC_FOLDER, uml.TAGVALUE_PROJECT, parentData.projectName ); + // packageName = "" or null, as we are in a srcFolder (root of packages) + data.packageName := uml.NO_PACKAGE; + // Compute generated: (parent.generated == false ? false : taggedValue || true ) + data.generated := if parentData.generated = false then false else self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_SRC_FOLDER, uml.TAGVALUE_GENERATED, true ) endif; + } + else { + data.srcName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_SRC_FOLDER, uml.TAGVALUE_SRC, self.name ); + data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_SRC_FOLDER, uml.TAGVALUE_PROJECT, defaultProjectName ); + // packageName = "" or null, as we are in a srcFolder (root of packages) + data.packageName := uml.NO_PACKAGE; + data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_SRC_FOLDER, uml.TAGVALUE_GENERATED, true ); + } + endif; + + +// self.data := data; + return data; +} + +/** + * Get or create the Data for this simple Package + * Don't check if the package is a src or project + */ +helper Package::createDataFromSimplePackage(defaultSrcName : String, defaultProjectName : String) : TypeMarker { + + var data := object TypeMarker {}; + var parent : Namespace := self.namespace; + + if parent != null + then { + // + var parentData : TypeMarker := parent.getData(defaultSrcName, defaultProjectName); + data.srcName := self.getStringTaggedValue(uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_SRC, parentData.srcName); + data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_PROJECT, parentData.projectName ); + data.packageName := self.computePackageName( parentData.packageName, self.getStringTaggedValue(uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_NAME, self.name) ); + data.generated := if parentData.generated = false then false else self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_GENERATED, true ) endif; + } + else { + // This is the root node, and maybe the stereotype overide some values. + data.srcName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_SRC, defaultSrcName ); + data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_PROJECT, self.name ); + data.packageName := self.getStringTaggedValue(uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_NAME, self.name); + data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_PACKAGE, uml.TAGVALUE_GENERATED, true ); + } + endif; + + +// self.data := data; + return data; +} + +/** + * + */ +helper Package::computePackageName( parentName : String, selfName : String) : String { + if( parentName.oclIsUndefined() or parentName.length() = 0) then { + return selfName; + } endif; + + return parentName + "." + selfName; +} + +/** + * Get or create the Data for a Package Stereotypes "Project" + */ +helper Package::createDataFromJavaProject(defaultSrcName : String, defaultProjectName : String) : TypeMarker { + + var data := object TypeMarker {}; + + data.srcName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_PROJECT, uml.TAGVALUE_SRC, defaultSrcName ); + // We are in a JavaProject, so the name is either the setereotype.projectName, or the folder name + data.projectName := self.getStringTaggedValue( uml.STEREOTYPE_JAVA_PROJECT, uml.TAGVALUE_PROJECT, self.name ); + // packageName = "" or null, as we are in a srcFolder (root of packages) + data.packageName := uml.NO_PACKAGE; + data.generated := self.getBooleanTaggedValue( uml.STEREOTYPE_JAVA_PROJECT, uml.TAGVALUE_GENERATED, true ); + return data; +} + +/** + * Get or create the Data for a uml::Model with no stereotype + * This is the root, so stop recursivity + */ +helper Package::createDataFromUmlModel(defaultSrcName : String, defaultProjectName : String) : TypeMarker { + + var data := object TypeMarker {}; + + data.srcName := defaultSrcName; + // Use the name of the Model as project name. + data.projectName := self.name; + // packageName = "" or null, as we are in a srcFolder (root of packages) + data.packageName := uml.NO_PACKAGE; + data.generated := true; + return data; +} + +/** + * A class used to hold data on a type + */ +intermediate class TypeMarker { + isCompilationUnit : Boolean; + projectName : String; + srcName : String; + packageName : String; + generated : Boolean = true; + + } + + // log this object +query TypeMarker::show() : String { + return self.projectName + "-" + self.srcName + "-" + self.packageName; +/* + + "(isCu=" + self.isCompilationUnit.repr() + + ", isGenerated=" + self.generated.repr() + + ")"; +*/ + }; + +/** + * Add a property to the uml::Type. This property is filled during the first pass. + * The first pass collect the data that are used during the second pass. + */ +intermediate property uml::NamedElement::data : TypeMarker; + + + +/** + * Show the content of marked type + */ +mapping uml::NamedElement::showMarkedType() +{ + log( '--------- ' + self.name + " ---------"); + log( 'uml=' + self.repr()); + log( 'data=' + self.data.repr()); + + log( 'projectName=' + self.data.projectName); + log( 'srcName =' + self.data.srcName.repr()); + log( 'packageName=' + self.data.packageName); + log( 'generated =' + self.data.generated.repr()); +} + +/** + * Map a model to a JavaModel. + * Compute and associate additional data (in a TypeMarker class) to the type. + * Recursively ensure that the data are associated to the container of this type. + */ +mapping uml::Type::markUmlType(defaultSrcName : String, defaultProjectName : String) +// when { self.isCompilationUnit() } +{ +// log("------ try to get data for " + self.name); + if( self.data.oclIsUndefined() ) then { + log("Compute associated data for '" + self.name + "'"); + self.data := self.getData( defaultSrcName, defaultProjectName); + } endif; +} + +/** + * Map a model to a JavaModel. + * Compute and associate additional data (in a TypeMarker class) to the type. + * Recursively ensure that the data are associated to the container of this type. + */ +mapping uml::Type::markUmlType() +{ + self.map markUmlType( uml.GENERATION_DEFAULT_SRC_NAME, uml.GENERATION_DEFAULT_PROJECT_NAME); +} + +/** + * + */ +mapping uml::Namespace::getNamespaceMarker() : TypeMarker { + + init { +// if not self.namespaceMarker.oclIsUndefined() then return self.namespaceMarker endif; + } + + +} + +/* ******************************************************************** */ +/* */ +/* ******************************************************************** */ +abstract mapping uml::NamedElement::transformNamedElementToJavaElement() : JDTmm::JDTJavaElement +{ + // by default, isGenerated are true + generated := self.isGenerated(); + //generated := self.data.generated; + + comment := self.ownedComment.body->asOrderedSet()->first(); + log("************************************" + self.name,comment); +} + + +mapping uml::Type::transformTypeToType() : JDTmm::JDTType + disjuncts Class::generateCuClass, Class::generateNestedClass, + Interface::generateCuInterface, Interface::generateNestedInterface, + Enumeration::generateCuEnumeration, Enumeration::generateNestedEnumeration, + PrimitiveType::generateCuPrimitiveType +{ + +} + +helper createOrRetrieveJavaModel2() : JDTJavaModel { + // get the model unique instance, or create it. + var model : JDTJavaModel := resolveoneIn(createOrRetrieveJavaModel).oclAsType(JDTJavaModel); + if( model.oclIsUndefined()) then { + model := map createOrRetrieveJavaModel(); + } endif; + return model; +} + +/** + * Generate a Class that should be a CompilationUnit and set its CompilationUnit + */ +mapping uml::Class::generateCuClass() : JDTmm::JDTClass + inherits Class::generateClass /*, NamedElement::transformNamedElementToJavaElement */ + when { self.isCompilationUnit() } +{ + log("------- transform", self.qualifiedName); + compilationUnit := self.map type2CompilationUnit(); +} + +/** + * Generate a Class that is nested in another Type + */ +mapping uml::Class::generateNestedClass() : JDTmm::JDTClass + inherits Class::generateClass +when { not self.isCompilationUnit() } +{ + log("------- transform", self.qualifiedName); + // We are NOT a compilation unit, so our parent is a Type + owner := self.namespace.oclAsType(uml::Type).map transformTypeToType(); +} + +/** + * Generate a Class. + * set all except its compilationUnit and its owner + */ +mapping uml::Class::generateClass() : JDTmm::JDTClass + inherits Classifier::mapTypeToType +{ +// log( "Interfaces:"); +// self.generalInterfaces()->forEach(c) { +// log( " interface=", c.name); +// }; + log("------- transform", self.qualifiedName); + interface := false; + _class := true; + _enum := false; + + // map inheritance + superClass := self.superClass[uml::Class] -> asOrderedSet() -> first().map transformTypeToType(); + // map interfaces + superInterfaces := self.generalInterfacesForClass() -> map transformTypeToType(); + // Properties + fields := self.ownedAttribute.map propertyToField(); + // Compute property from associations + // This is already computed from the previous case, as such + // properties are marked with owner=Classifier +// fields += self.ownedAttribute.map propertyToAssociationField(); + fields += self[uml::AssociationClass].memberEnd.map propertyToFieldOfAssociationClass(); + + //fields.type := self->generateClass() -> asOrderedSet() -> first(); + // Methods + methods := self.ownedOperation -> map operationToMethod(); +} + + +/** + * Create a Compilation Unit, and set its packageFragment + */ +mapping uml::Type::type2CompilationUnit() : JDTCompilationUnit + inherits NamedElement::transformNamedElementToJavaElement +{ + + elementName := self.name; + // Compute the package fragment from the GenData associated to the type + var res : JDTPackageFragment := self.data.map typeMarkerToPackageFragment(); + +// log( "try to set package fragment found packageFragment=", res); +// log( " type(.packageFragment)=", self); + + // Set the packageFragment of this CU + // next call has a bug, so we do the opposite affectation: + // add this CU to its packageFragment +// packageFragment := res; + res.compilationUnits += result; +} + +/** + * Generate a Interface that should be a CompilationUnit and set its CompilationUnit + */ +mapping uml::Interface::generateCuInterface() : JDTmm::JDTInterface + inherits Interface::generateInterface /*, NamedElement::transformNamedElementToJavaElement */ + when { self.isCompilationUnit() } +{ + log("------- transform", self.qualifiedName); + compilationUnit := self.map type2CompilationUnit(); + +} + +/** + * Generate a Interface that is nested in another Type + */ +mapping uml::Interface::generateNestedInterface() : JDTmm::JDTInterface + inherits Interface::generateInterface +when { not self.isCompilationUnit() } +{ + log("------- transform", self.qualifiedName); + // We are NOT a compilation unit, so our parent is a Type + owner := self.namespace.oclAsType(uml::Type).map transformTypeToType(); +} + +/** + * Generate a Interface. + * set all except its compilationUnit and its owner + */ +mapping uml::Interface::generateInterface() : JDTmm::JDTInterface + inherits Classifier::mapTypeToType +{ + interface := true; + _class := false; + _enum := false; + + // map interfaces + superInterfaces := self.generalInterfaces() -> map transformTypeToType(); + // Properties + fields := self.ownedAttribute -> map propertyToField(); + // Methods + methods := self.ownedOperation -> map operationToMethod(); + + +} + +/** + * Generate a Enumeration that should be a CompilationUnit and set its CompilationUnit + */ +mapping uml::Enumeration::generateCuEnumeration() : JDTmm::JDTEnum + inherits Enumeration::generateEnumeration /*, NamedElement::transformNamedElementToJavaElement */ + when { self.isCompilationUnit() } +{ + log("------- transform", self.qualifiedName); + compilationUnit := self.map type2CompilationUnit(); + +} + +/** + * Generate a Enumeration that is nested in another Type + */ +mapping uml::Enumeration::generateNestedEnumeration() : JDTmm::JDTEnum + inherits Enumeration::generateEnumeration +when { not self.isCompilationUnit() } +{ + log("------- transform", self.qualifiedName); + // We are NOT a compilation unit, so our parent is a Type + owner := self.namespace.oclAsType(uml::Type).map transformTypeToType(); +} + +/** + * Generate a Enumeration. + * set all except its compilationUnit and its owner + */ +mapping uml::Enumeration::generateEnumeration() : JDTmm::JDTEnum + inherits Classifier::mapTypeToType +{ + interface := false; + _class := false; + _enum := true; + + // map inheritance + superClass := self.general().map transformTypeToType(); + // map interfaces + superInterfaces := self.generalInterfaces() -> map transformTypeToType(); + + // Properties + fields := self.ownedAttribute -> map propertyToField(); + + // Litterals ?? + fields += self.ownedLiteral -> map enumerationLiteral2Field(); + + + // Methods + methods := self.ownedOperation -> map operationToMethod(); + +} + +mapping uml::EnumerationLiteral::enumerationLiteral2Field() : JDTmm::JDTField +{ + elementName := self.name; + // visibility + visibility := self.visibility.visibilityToVisibility(); + // modifiers + final := false; + _static := false; + // multiplicity + isMultiValued := false; + // type + type := null; +} + +/** + * Generate a primitive type + */ +mapping uml::PrimitiveType::generateCuPrimitiveType() : JDTmm::JDTClass + inherits Classifier::mapTypeToType +{ + log("------- transform", self.qualifiedName); + compilationUnit := self.map type2CompilationUnit(); + + // Compute elementName + // Check if another name is set in instanceClassname + // Set only the last name, because the package name is set previously in the compilationUnit. + var instanceName : String := self.getStringTaggedValue(uml.STEREOTYPE_PRIMITIVETYPE, uml.TAGVALUE_IMPLEMENTATION_CLASS, null); + elementName := if( instanceName.oclIsUndefined()) + then self.name + else instanceName.lastNameFromQualifiedName() + endif; + + // Adjust compilation unit name + compilationUnit.elementName := elementName; + + generated := self.data.generated; +} + +/** + * Generate a Enumeration. + * set all except its compilationUnit and its owner + */ +abstract mapping uml::Classifier::mapTypeToType() : JDTmm::JDTType + inherits NamedElement::transformNamedElementToJavaElement +{ + + // Ensure that data are set + if( self.data.oclIsUndefined()) then { + self.map markUmlType(); + } endif; + + elementName := self.name; + // visibility + visibility := self.visibility.visibilityToVisibility(); + // modifiers + _abstract := self.getBooleanTaggedValue("java::JavaClass", "isAbstract",self.isAbstract); + final := self.getBooleanTaggedValue("java::JavaClass", "isFinal",self.isLeaf); + _static := self.getBooleanTaggedValue("java::JavaClass", "isStatic", false); + generated := self.data.generated; + + // Explicit imports + explicitRequiredImports += self.elementImport.target[uml::Classifier] -> map transformTypeToType(); + // Explicit imports from stereotype + var ext:JavaProfile::JavaClass := self.getJavaClassStereotype(); + if( ext <> null) then { + explicitRequiredImports += ext.explicitRequiredImports -> map transformTypeToType(); + explicitPlainTextRequiredImports += ext.explicitPlainTextRequiredImports + } endif; + +} + +/** + * Transform the visibility. + */ +query uml::VisibilityKind::visibilityToVisibility() : jdtmm::VisibilityKind { + + if( self = uml::VisibilityKind::public ) then return jdtmm::VisibilityKind::public endif; + if( self = uml::VisibilityKind::protected ) then return jdtmm::VisibilityKind::protected endif; + if( self = uml::VisibilityKind::private ) then return jdtmm::VisibilityKind::private endif; + + // Can't happen' + return jdtmm::VisibilityKind::public; +} + +/** + * Map a Property to a field + */ +mapping uml::Property::propertyToField() : JDTField + inherits NamedElement::transformNamedElementToJavaElement +{ + // + elementName := self.name; + // visibility + visibility := self.visibility.visibilityToVisibility(); + // modifiers + final := self.getBooleanTaggedValue("java::JavaProperty", "isFinal",self.isLeaf); + _static := self.getBooleanTaggedValue("java::JavaProperty", "isStatic", self.isStatic); + // getter setter + generateGetter := self.getEnumTaggedValue("java::JavaProperty", "generateGetter", "default").getTrueFalseDefaultValue(); + generateSetter := self.getEnumTaggedValue("java::JavaProperty", "generateSetter", "default").getTrueFalseDefaultValue(); + + // multiplicity + isMultiValued := self.upper < 1; + // type + type := self.type.map transformTypeToType(); + + // Specify the default value + if(not self.defaultValue.isNull() ) then { + value := self.defaultValue.valueSpecificationToString(); + } endif; + + // Explicit imports from stereotype + var ext:JavaProfile::JavaProperty := self.getJavaPropertyStereotype(); + if( ext <> null) then { + explicitRequiredImports += ext.explicitRequiredImports -> map transformTypeToType(); + explicitPlainTextRequiredImports += ext.explicitPlainTextRequiredImports + } endif; + +} + +/** + * Compute the default value from the ValueSpecification. + * Check if this is a special case. + * + */ +query uml::ValueSpecification::valueSpecificationToString() : String { + + switch { + case (self.oclIsTypeOf(uml::InstanceValue)) { + var iv := self.oclAsType(uml::InstanceValue ); + + // Is it an EnumLiteral ? + if( iv.instance.oclIsTypeOf(uml::EnumerationLiteral)) then { + // This is an enum literal. Prefix it with its typeName + return iv.type.name + "." + iv.instance.name; + } endif; + } + else { + return self.stringValue() + } + }; + return ""; +} + +/** + * Return the value of the enumeration literal for Enum 'TrueFalseDefault' + */ +query String::getTrueFalseDefaultValue(): TrueFalseDefault { + if(self = "true") then + return TrueFalseDefault::_true + else + if(self = "false") then + return TrueFalseDefault::_false + endif + endif; + + return TrueFalseDefault::_default; +} +/** + * Map a Property to a field of a association class + */ +mapping uml::Property::propertyToFieldOfAssociationClass() : JDTField + inherits Property::propertyToField +{ + +} + +/** + * Map a Property to a association field assoc+nameOfProperty + */ +mapping uml::Property::propertyToAssociationField() : JDTField + inherits Property::propertyToField +when { + not self.association.oclIsUndefined() +} +{ + // handle the class association + elementName := "assoc"+ self.name.firstToUpper(); + type := self.association.map transformTypeToType()->asOrderedSet()->first(); +} + +/** + * Map a Operation to a Method + */ +mapping uml::Operation::operationToMethod() : JDTMethod + inherits NamedElement::transformNamedElementToJavaElement +{ + // + elementName := self.name; + // visibility + visibility := self.visibility.visibilityToVisibility(); + // modifiers + final := self.getBooleanTaggedValue("java::JavaMethod", "isFinal",self.isLeaf); + _static := self.getBooleanTaggedValue("java::JavaMethod", "isStatic", self.isStatic); + _abstract := self.getBooleanTaggedValue("java::JavaMethod", "isAbstract", self.isAbstract); + synchronized := self.getBooleanTaggedValue("java::JavaMethod", "isSynchronized", false); + + // constructor + _constructor := self.getBooleanTaggedValue("java::JavaMethod", "isConstructor", false); + + // arguments + returnType := self.ownedParameter->select(m| m.direction.repr()="return")->first().map parameterToParameter(); + parameters := self.ownedParameter->select(m| m.direction.repr()!="return")-> map parameterToParameter(); + + // Body + bodies := self.method -> map BehaviorToMethodBody(); + // exception + exceptions := self.raisedException -> map transformTypeToType(); + + // Explicit imports from stereotype + var ext:JavaProfile::JavaMethod := self.getJavaMethodStereotype(); + if( ext <> null) then { + explicitRequiredImports += ext.explicitRequiredImports -> map transformTypeToType(); + explicitPlainTextRequiredImports += ext.explicitPlainTextRequiredImports + } endif; + +} + +mapping uml::Parameter::parameterToParameter() : jdtmm::JDTParameter + inherits NamedElement::transformNamedElementToJavaElement +{ + // + elementName := self.name; + // modifiers + final := self.getBooleanTaggedValue("java::JavaClass", "isFinal",false); + // multiplicity + isMultiValued := self.upper < 1; + // type + type := self.type.map transformTypeToType(); +} + +/** + * Transform a Behavior to a JDTMethodBody. + * Root rule of transforming a Behavior to a JDTMethodBody. The real transformation ois done in sub-rules + * (with the same name, but different input type). + * + * Behavior can't be transformed to JDTMethodBody, so create a JDTMethodBody with an error message. + */ +mapping uml::Behavior::BehaviorToMethodBody() : jdtmm::JDTMethodBody { + init { + var jdtBody := object JDTOpaqueBody {}; + jdtBody._body := "Don't know how to map a Behavior to a Java Body"; + result := jdtBody; + } +} + +/** + * Transform an OpaqueBehavior to a MethodBody. + * As we return a subclass of JDTMethodBody, delegate to the appropriate rule. + */ +mapping uml::OpaqueBehavior::BehaviorToMethodBody() : jdtmm::JDTMethodBody { + init { + result := self.map OpaqueBehaviorToOpaqueBody(); + } + +} + +/** + * Transform an OpaqueBehavior to a OpaqueBody + */ +mapping uml::OpaqueBehavior::OpaqueBehaviorToOpaqueBody() : jdtmm::JDTOpaqueBody { + +// log("OpaqueBehavior found"); + + // Look for the java index + var index : Integer := self.language->indexOf("Java"); + if ( index >= 0) then { + _body := self.body->at(index); + } + else { + _body := "// No 'Java' body found. Please set a 'Java' body in the OpaqueBehavior associted to method."; + } + endif; +} + + + + + +/** + * Get or create the PackageFragment corresponding to the TypeMarker + */ +mapping TypeMarker::typeMarkerToPackageFragment() : JDTPackageFragment { + + init { + // Check if the fragment already exist + + // First, lookup fragment root + var srcRoot:JDTPackageFragmentRoot := self.map typeMarkerToPackageFragmentRoot(); + + // Second, lookup in srcRoot for an fragment with the same name + result := srcRoot.packageFragments -> select( fragment | self.packageName=fragment.elementName)-> asSequence()-> first(); + + if( result.oclIsUndefined()) then { + log("create fragment " + self.packageName ); + } + else { + log("reuse fragment '" + result.elementName + "'' for gendata " + self.show() ); + } endif; + + // Ideally, we should return here. But this is not allowed in this qvt version + // return; + } + + // Initialize our object if it is not already done + if( packageFragmentRoot.oclIsUndefined() ) then { + + // Try one of the end of the relation. Some QVT implementation fail on the first end, + // So use the second. (In any cases, we should only affect one end, EMF will do the second end) + // packageFragmentRoot := srcRoot; // self.map typeMarkerToPackageFragmentRoot(); + srcRoot.packageFragments += result; + elementName := self.packageName; + + // Get the isGenerated Flag + // Need to know the flag that has been set in the corresponding package. + // But here, we only got the genData associated to the CompilationUnit, so we + // can't know the flag value. + // TODO: improve the algorithm to be able to get the package's flag value + // actually, always set it to true + generated := true; + +/* + // if package is generated=false, put generated=false for the children's package + if(generated = false) then { + log("c'est false"); + srcRoot.packageFragments->forEach(pack) { + log("**********************"+pack.elementName, pack.elementName.indexOf(elementName)); + if (pack.elementName.indexOf(elementName) != -1) then { + pack.generated := false; + log("************************ elementName passé à ", generated); + } endif; + }; + } endif; +*/ + } endif; + +} + +/** + * Get or create the PackageFragmentRoot corresponding to the TypeMarker + */ +mapping TypeMarker::typeMarkerToPackageFragmentRoot() : JDTPackageFragmentRoot { + + init { + // Check if the fragment already exist + + // First, lookup corresponding project + var project:JDTJavaProject := self.map typeMarkerToJavaProject(); + + // Second, lookup in project for an srcRoot with the same name + result := project.packageFragmentRoots -> select( srcRoot | self.srcName=srcRoot.elementName)-> asSequence()-> first(); + + if( result.oclIsUndefined()) then { + log("create PackageFragmentRoot " + self.srcName ); + } + else { + log("reuse PackageFragmentRoot '" + result.elementName + "' for gendata " + self.show() ); + } endif; + + + // Ideally, we should return here. But this is not allowed in this qvt version + // return; + } + + // Initialize our object if it is not already done + if( javaProject.oclIsUndefined() ) then { + javaProject := project; // self.map typeMarkerToJavaProject(); + elementName := self.srcName; + // Get the isGenerated Flag + // Need to know the flag that has been set in the corresponding package. + // But here, we only got the genData associated to the CompilationUnit, so we + // can't know the flag value. + // TODO: improve the algorithm to be able to get the package's flag value + // actually, always set it to true + generated := true; + } endif; +} + +/** + * Get or create the PackageJavaProject corresponding to the TypeMarker + */ +mapping TypeMarker::typeMarkerToJavaProject() : JDTJavaProject { + + init { + // Lookup if there is a Project already created for this projectName + // resolveIn return a list of object created with the specified mapping rule + // Then, we loukup in the list for an element with the requested name. + result := resolveIn(TypeMarker::typeMarkerToJavaProject) + ->select( project | self.projectName=project.oclAsType(JDTJavaProject).elementName)->first().oclAsType(JDTJavaProject); + + + if( result.oclIsUndefined()) then { + log("create project " + self.projectName ); + } + else { + log("reuse project '" + result.elementName + "'' for gendata " + self.show() ); + } endif; + + + // Ideally, we should return here. But this is not allowed in this qvt version + // return; + } + + // Initialize our object if it is not already done + if( javaModel.oclIsUndefined() ) then { + javaModel := map createOrRetrieveJavaModel(); + elementName := self.projectName; + // Get the isGenerated Flag + // Need to know the flag that has been set in the corresponding package. + // But here, we only got the genData associated to the CompilationUnit, so we + // can't know the flag value. + // TODO: improve the algorithm to be able to get the package's flag value + // actually, always set it to true + generated := true; + } endif; +} + +/** + * + */ +mapping createOrRetrieveJavaModel () : JDTJavaModel { +init { + // result := resolveoneIn(createOrRetrieveJavaModel).oclAsType(JDTJavaModel); +// if not result.oclIsUndefined() then{ return c; }endif; +} + generated := true; + elementName := "JavaModel"; +} + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.classpath b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.classpath new file mode 100644 index 00000000000..8a8f1668cdc --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.project b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.project new file mode 100644 index 00000000000..4f0ff984c7b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.java.generator.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..b5234389f4e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Export-Package: org.eclipse.papyrus.java.generator.ui +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.emf.ecore, + org.eclipse.uml2.uml, + org.eclipse.ui.ide, + org.eclipse.core.resources;bundle-version="3.6.0", + org.eclipse.papyrus.java.generator.metamodel.jdt;bundle-version="1.2.0", + org.eclipse.jdt.core, + org.eclipse.jdt.ui, + org.eclipse.papyrus.java.generator.jdtsynchronizer;bundle-version="1.2.0" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.java.generator.ui.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.java.generator.ui;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/about.html b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/build.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/build.properties new file mode 100644 index 00000000000..7915e442db0 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + icons/,\ + about.html,\ + plugin.properties +src.includes = about.html diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/icons/generate.psd b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/icons/generate.psd new file mode 100644 index 00000000000..9a555a938e1 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/icons/generate.psd differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/icons/generation.png b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/icons/generation.png new file mode 100644 index 00000000000..6a55c438352 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/icons/generation.png differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/icons/sample.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/icons/sample.gif new file mode 100644 index 00000000000..34fb3c9d8cb Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/icons/sample.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/plugin.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/plugin.properties new file mode 100644 index 00000000000..c561698838c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/plugin.properties @@ -0,0 +1,19 @@ + +################################################################################# +# Copyright (c) 2011 Nicolas Deblock & Manuel Giles. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation +# Manuel Giles giles.manu@live.fr - Initial API and implementation +# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API +# +################################################################################# + + +pluginName=Papyrus Java Classes Generator UI (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/plugin.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/plugin.xml new file mode 100644 index 00000000000..4a4fdf7e6a6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/plugin.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/pom.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/pom.xml new file mode 100644 index 00000000000..ac1f67981b8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.java.generator.ui + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/Activator.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/Activator.java new file mode 100644 index 00000000000..bf812d8fb4e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/Activator.java @@ -0,0 +1,70 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.ui; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.java.generator.ui"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/handlers/GenerateJavaCodeHandler.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/handlers/GenerateJavaCodeHandler.java new file mode 100644 index 00000000000..5adfd0698df --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/handlers/GenerateJavaCodeHandler.java @@ -0,0 +1,246 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.ui.handlers; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.TreeSelection; +import org.eclipse.papyrus.java.generator.jdtsynchronizer.RunGenerator; +import org.eclipse.papyrus.java.generator.metamodel.jdt.jdtmm.visitor.JDTVisitorException; +import org.eclipse.papyrus.java.generator.ui.Activator; +import org.eclipse.papyrus.java.generator.ui.preference.GeneratorPreferenceImpl; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.NamedElement; + +/** + * Handler used to launch Java code generation from a selected UML element. + * + * @author Cedric dumoulin + * + */ +public class GenerateJavaCodeHandler extends AbstractHandler implements IHandler { + + + /** + * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) + * @param event + * @return + * @throws ExecutionException + * + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + // Get selection + // Can't be done in the job. + List objects = lookupSelectedElements(); + // Execute handler + doExecute(objects); + + return null; + } + + /** + * Get the name used in the {@link RecordingCommand}. This name will be visible in + * undo/redo. + * + * @return The command name to show. + */ + public String getCommandName() { + return "Generate Java Code"; + } + + /** + * Return a list of selected domain (UML) elements. + * + * @return + */ + protected List getSelectedUmlObject() { + List selections = lookupSelectedElements(); + + List results = new ArrayList(); + + // create model with EList objects + for (Object obj : selections) { + // Adapt object to NamedElement + NamedElement ele = null; + if (obj instanceof IAdaptable) { + ele = (NamedElement) ((IAdaptable) obj).getAdapter(NamedElement.class); + } + if (ele == null) { + ele = (NamedElement) Platform.getAdapterManager().getAdapter(obj, NamedElement.class); + } + + // Add uml element if found + if (ele != null) { + results.add(ele); + } + + } + + return results; + } + + /** + * Do the execution of the command. + * + * @param objects + * List of object to generate Java code from. + */ + protected void doExecute(final List objects) { + + Job job = new Job("Generate java classes ") { + + @Override + protected IStatus run(IProgressMonitor monitor) { + // execute the task ... + + try { + IStatus status = doExecute(monitor, objects); + monitor.done(); + return status; + } + catch (Exception e) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); + } + finally { + + } + + + } + }; + + job.setUser(true); + job.schedule(); + + } + + /** + * Do the execution of the command. + * + * @param objects + * List of object to generate Java code from. + */ + protected IStatus doExecute(IProgressMonitor monitor, List objects) { + monitor.beginTask("Generate ...", 3); + + // create a EList who is the model + EList model = new BasicEList(); + + // create model with EList objects + for (Object obj : objects) { + // Adapt object to NamedElement + NamedElement ele = null; + if (obj instanceof IAdaptable) { + ele = (NamedElement) ((IAdaptable) obj).getAdapter(NamedElement.class); + } + if (ele == null) { + ele = (NamedElement) Platform.getAdapterManager().getAdapter(obj, NamedElement.class); + } + + // Add uml element if found + if (ele != null) { + model.add(ele); + } + + } + monitor.worked(1); + + // recover window + // IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + + // Check if there is a right selection + if (model.size() <= 0) { + String msg = "No UML element selected. Please select one or more UML element to generate"; + // MessageDialog.openInformation(window.getShell(),"No Selection", msg); + + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, msg); + + } + + // error message + String message = ""; + + + try { + // run code generator + RunGenerator runGen = new RunGenerator(model); + runGen.runGeneration(new GeneratorPreferenceImpl()); + } catch (JDTVisitorException e) { + // error message + StringBuffer stackTrace = new StringBuffer(); + for (StackTraceElement trace : e.getStackTrace()) { + stackTrace.append("at " + trace.getMethodName() + "(" + trace.getClassName() + ":" + trace.getLineNumber() + ")\n"); + } + + IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); + // ErrorDialog errDg = new ErrorDialog(window.getShell(), "Error encountered during code generation", + // "Error encountered during code generation", + // status, + // Status.ERROR); + // errDg.open(); + return status; + } + + // if(message.isEmpty()) message = "Code generated successfully!"; + + monitor.worked(2); + // MessageDialog.openInformation(window.getShell(),"Code generation",message); + + return Status.OK_STATUS; + } + + /** + * Lookup selected objects in UI. + * + * @return + */ + private List lookupSelectedElements() { + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + ISelection selection = page.getSelection(); + // System.out.println("check " + selection); + if (selection instanceof IStructuredSelection) + { + IStructuredSelection structuredSelection = (IStructuredSelection) selection; + return structuredSelection.toList(); + } + else if (selection instanceof TreeSelection) { + TreeSelection treeSelection = (TreeSelection) selection; + return treeSelection.toList(); + + } + return null; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GeneratorPreferenceImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GeneratorPreferenceImpl.java new file mode 100644 index 00000000000..4b781af05c2 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GeneratorPreferenceImpl.java @@ -0,0 +1,103 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.ui.preference; + +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.java.generator.jdtsynchronizer.GeneratorPreference; +import org.eclipse.papyrus.java.generator.ui.Activator; + +public class GeneratorPreferenceImpl implements GeneratorPreference { + + /** + * allow to gather default value + */ + private IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + + + @Override + public boolean implementMethodsOfIntefaces() { + return store.getBoolean(PreferenceConstants.P_IMPLEMENT_METHODS_OF_INTERFACES_AND_ABSTRACT_CLASS); + } + + @Override + public boolean implementMethodsOfAbstractClass() { + return store.getBoolean(PreferenceConstants.P_IMPLEMENT_METHODS_OF_INTERFACES_AND_ABSTRACT_CLASS); + } + + @Override + public boolean generateGetters() { + return store.getBoolean(PreferenceConstants.P_GENERATE_GETTERS); + } + + @Override + public boolean generateSetters() { + return store.getBoolean(PreferenceConstants.P_GENERATE_SETTERS); + } + + @Override + public boolean isPackageToGenerate(String packageQualifiedName) { + if (packageQualifiedName == null || packageQualifiedName.isEmpty()) { + return true; + } + + // gather list of packages : + String listStr = store.getString(PreferenceConstants.P_FILTER_OF_PACKAGE_NOT_TO_GENERATE); + + // if list of package don't exist, return true + if (listStr == null || listStr.isEmpty()) { + return true; + } + + // gather list in a table + String[] listPackage = listStr.split(";"); + + for (String _package : listPackage) { + if (_package.equals(packageQualifiedName)) { + return false; + } + + // if package have a *, we delete * + String packageWithoutStar = _package; + if (_package.contains("*")) { + packageWithoutStar = _package.substring(0, _package.indexOf("*") - 1); + } + + if (packageQualifiedName.contains(packageWithoutStar)) { + return false; + } + } + + // by default, return true + return true; + } + + @Override + public String genericClassForMultiValue() { + return store.getString(PreferenceConstants.P_GENERIC_CLASS_FOR_MULTIVALUE); + } + + @Override + public boolean stopOnFirstError() { + return store.getBoolean(PreferenceConstants.P_STOP_ON_FIRST_ERROR); + } + + @Override + public String defaultSourceFolderName() { + return store.getString(PreferenceConstants.P_DEFAULT_SOURCE_FOLDER_NAME); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GenericClassFieldEditor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GenericClassFieldEditor.java new file mode 100644 index 00000000000..61abda9df3c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/GenericClassFieldEditor.java @@ -0,0 +1,69 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.ui.preference; + +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.search.IJavaSearchConstants; +import org.eclipse.jdt.core.search.IJavaSearchScope; +import org.eclipse.jdt.core.search.SearchEngine; +import org.eclipse.jdt.internal.core.BinaryType; +import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.preference.StringButtonFieldEditor; +import org.eclipse.swt.widgets.Composite; + + +/** + * Used to choice a generic class + * + * @author DEBLOCK Nicolas and GILES Manuel + * + */ +public class GenericClassFieldEditor extends StringButtonFieldEditor { + + public GenericClassFieldEditor(String name, String labelText, Composite parent) { + super(name, labelText, parent); + } + + @Override + protected String changePressed() { + + // search scope + IJavaSearchScope scope = SearchEngine.createWorkspaceScope(); + FilteredTypesSelectionDialog d = new FilteredTypesSelectionDialog(getShell(), false, null, scope, IJavaSearchConstants.TYPE); + d.open(); + Object[] pack = d.getResult(); + BinaryType result = (BinaryType) pack[0]; + try { + // if it's not a generic class, generate a error message + if (!(result.getClassFile().getType().getFullyQualifiedParameterizedName().contains("<") && result.getClassFile().getType().getFullyQualifiedParameterizedName().contains(">"))) { + String errorMessage = "Erreur : " + result.getElementName() + " is not a generic class"; + MessageDialog.openError(getShell(), "Error", errorMessage); + return getStringValue(); + } + } catch (JavaModelException e) { + e.printStackTrace(); + String errorMessage = "Erreur : " + e.getMessage(); + MessageDialog.openError(getShell(), "Error", errorMessage); + } + + + return result.getPackageFragment().getElementName() + "." + result.getElementName(); + } + + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PackageListEditor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PackageListEditor.java new file mode 100644 index 00000000000..20c81ae56e7 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PackageListEditor.java @@ -0,0 +1,87 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.ui.preference; + +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.jdt.internal.ui.preferences.TypeFilterInputDialog; +import org.eclipse.jface.preference.ListEditor; +import org.eclipse.jface.window.Window; +import org.eclipse.swt.widgets.Composite; + +/** + * + * Used to select packages from the dialog. + * + * @author DEBLOCK Nicolas and GILES Manuel + */ +public class PackageListEditor extends ListEditor { + + /** + * Constructor. + * + * @param name + * @param labelText + * @param parent + */ + PackageListEditor(String name, String labelText, Composite parent) { + super(name, labelText, parent); + } + + @Override + /** + * Functionality for New button. + * Shows a browser dialog to select a file and returns that file. + */ + protected String getNewInputObject() { + // Dialog p = new JDialog(); + List l = new LinkedList(); + + + TypeFilterInputDialog d = new TypeFilterInputDialog(getShell(), l); + d.open(); + Object pack = d.getResult(); + + // Return null if user clicked on "cancel" button, to not add ampty package on the list + if (d.getReturnCode() == Window.CANCEL) { + return null; + } + return pack.toString(); + } + + @Override + protected String createList(String[] items) { + StringBuffer str = new StringBuffer(); + for (String item : items) { + str.append(item + ";"); + } + return str.toString(); + } + + /* + * (non-Javadoc) + * initialize list of items + * + * @see org.eclipse.jface.preference.ListEditor#parseString(java.lang.String) + */ + @Override + protected String[] parseString(String stringList) { + return stringList.split(";"); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceConstants.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceConstants.java new file mode 100644 index 00000000000..674c6f07c68 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceConstants.java @@ -0,0 +1,41 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.ui.preference; + +/** + * Constant definitions for plug-in preferences + */ +public class PreferenceConstants { + + public static final String P_PREFERENCE_ID = "org.eclipse.papyrus.java.generator.ui.preference.PreferencePage"; + + public static final String P_IMPLEMENT_METHODS_OF_INTERFACES_AND_ABSTRACT_CLASS = "implementsMethosOfIntefacesAndAbstractClass"; + + public static final String P_GENERATE_GETTERS = "generateGetter"; + + public static final String P_GENERATE_SETTERS = "generateSetter"; + + public static final String P_FILTER_OF_PACKAGE_NOT_TO_GENERATE = "filterOfPackageNotToGenerate"; + + public static final String P_GENERIC_CLASS_FOR_MULTIVALUE = "genericClassForMultiValue"; + + public static final String P_STOP_ON_FIRST_ERROR = "stopOnFirstError"; + + public static final String P_DEFAULT_SOURCE_FOLDER_NAME = "defaultSourceFolderName"; + + public static final String LABEL_DEFAULT_SOURCE_FOLDER_NAME = "Default source folder name"; +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceInitializer.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceInitializer.java new file mode 100644 index 00000000000..5bbb763db45 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferenceInitializer.java @@ -0,0 +1,47 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.ui.preference; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.java.generator.ui.Activator; + + +/** + * Class used to initialize default preference values. + */ +public class PreferenceInitializer extends AbstractPreferenceInitializer { + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() + */ + @Override + public void initializeDefaultPreferences() { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + + store.setDefault(PreferenceConstants.P_IMPLEMENT_METHODS_OF_INTERFACES_AND_ABSTRACT_CLASS, true); + store.setDefault(PreferenceConstants.P_GENERATE_GETTERS, true); + store.setDefault(PreferenceConstants.P_GENERATE_SETTERS, true); + store.setDefault(PreferenceConstants.P_FILTER_OF_PACKAGE_NOT_TO_GENERATE, "java.*;javax.*"); + store.setDefault(PreferenceConstants.P_GENERIC_CLASS_FOR_MULTIVALUE, "java.util.List"); + store.setDefault(PreferenceConstants.P_STOP_ON_FIRST_ERROR, true); + store.setDefault(PreferenceConstants.P_DEFAULT_SOURCE_FOLDER_NAME, "src"); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferencePage.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferencePage.java new file mode 100644 index 00000000000..626d3a8f871 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui/src/org/eclipse/papyrus/java/generator/ui/preference/PreferencePage.java @@ -0,0 +1,109 @@ +/***************************************************************************** + * Copyright (c) 2011 Nicolas Deblock & Manuel Giles. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nicolas Deblock nico.deblock@gmail.com - Initial API and implementation + * Manuel Giles giles.manu@live.fr - Initial API and implementation + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Idea of the java generator project & help for the conception + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.generator.ui.preference; + +import org.eclipse.jface.preference.BooleanFieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.papyrus.java.generator.ui.Activator; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; + +/** + * This class represents a preference page that + * is contributed to the Preferences dialog. By + * subclassing FieldEditorPreferencePage, we + * can use the field support built into JFace that allows + * us to create a page that is small and knows how to + * save, restore and apply itself. + *

    + * This page is used to modify preferences only. They are stored in the preference store that belongs to the main plug-in class. That way, preferences can be accessed directly via the preference store. + */ + +public class PreferencePage + extends FieldEditorPreferencePage + implements IWorkbenchPreferencePage { + + public PreferencePage() { + super(GRID); + } + + /** + * Creates the field editors. Field editors are abstractions of + * the common GUI blocks needed to manipulate various types + * of preferences. Each field editor knows how to save and + * restore itself. + */ + @Override + public void createFieldEditors() { + + // implements methods of inherits interfaces and abstract class + addField(new BooleanFieldEditor( + PreferenceConstants.P_STOP_ON_FIRST_ERROR, + "Stop on first error", + getFieldEditorParent())); + + // implements methods of inherits interfaces and abstract class + addField(new BooleanFieldEditor( + PreferenceConstants.P_IMPLEMENT_METHODS_OF_INTERFACES_AND_ABSTRACT_CLASS, + "Implement methods of inherits interfaces and abstract class", + getFieldEditorParent())); + + + // generate getters setters + addField(new BooleanFieldEditor( + PreferenceConstants.P_GENERATE_GETTERS, + "Generate getters", + getFieldEditorParent())); + + addField(new BooleanFieldEditor( + PreferenceConstants.P_GENERATE_SETTERS, + "Generate setters", + getFieldEditorParent())); + + // filter of package not to generate + addField(new PackageListEditor( + PreferenceConstants.P_FILTER_OF_PACKAGE_NOT_TO_GENERATE, + "Filter of package to not generate", + getFieldEditorParent())); + + addField(new GenericClassFieldEditor( + PreferenceConstants.P_GENERIC_CLASS_FOR_MULTIVALUE, + "Generic class to use for association * ", + getFieldEditorParent())); + + + // text input field for the default source folder name + addField(new GenericClassFieldEditor( + PreferenceConstants.P_DEFAULT_SOURCE_FOLDER_NAME, + PreferenceConstants.LABEL_DEFAULT_SOURCE_FOLDER_NAME, + getFieldEditorParent())); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) + */ + @Override + public void init(IWorkbench workbench) { + setPreferenceStore(Activator.getDefault().getPreferenceStore()); + setDescription("Edit your preferences to generate Java classes with papyrus"); + } + + + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.classpath b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.project b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.project new file mode 100644 index 00000000000..f1c67ae603d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.java.profile.edit + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..e2c700d5d7d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.papyrus.java.profile;bundle-version="1.2.0";visibility:=reexport, + org.eclipse.uml2.uml.edit;visibility:=reexport, + org.eclipse.core.runtime +Export-Package: org.eclipse.papyrus.java.profile.java.provider +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.java.profile.java.provider.JavaEditPlugin$Implementation +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.java.profile.edit;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/about.html b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/build.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/build.properties new file mode 100644 index 00000000000..890b147293b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/build.properties @@ -0,0 +1,16 @@ + +# +# +# +# $Id$ + +bin.includes = .,\ + icons/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties,\ + about.html +jars.compile.order = . +source.. = src/ +output.. = bin/ +src.includes = about.html diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaClass.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaClass.gif new file mode 100644 index 00000000000..134551bff7e Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaClass.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaMethod.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaMethod.gif new file mode 100644 index 00000000000..b3643da048a Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaMethod.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaPackage_.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaPackage_.gif new file mode 100644 index 00000000000..e4b530eca17 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaPackage_.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaParameter.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaParameter.gif new file mode 100644 index 00000000000..10d222998af Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaParameter.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProject.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProject.gif new file mode 100644 index 00000000000..badaab0664a Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProject.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProperty.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProperty.gif new file mode 100644 index 00000000000..33854e98c25 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaProperty.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaSrcFolder.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaSrcFolder.gif new file mode 100644 index 00000000000..98b351f1c44 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/JavaSrcFolder.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/PrimitiveType.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/PrimitiveType.gif new file mode 100644 index 00000000000..35ef84e20e2 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/icons/full/obj16/PrimitiveType.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/plugin.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/plugin.properties new file mode 100644 index 00000000000..dfb7e79f433 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/plugin.properties @@ -0,0 +1,86 @@ + + +################################################################################# +# Copyright (c) 2011-2013 Cedric Dumoulin. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API +# +################################################################################# + +pluginName = Profile for Java classes generation Edit Support (Incubation) +providerName = Eclipse Modeling Project + +_UI_CreateChild_text = {0} +_UI_CreateChild_text2 = {1} {0} +_UI_CreateChild_text3 = {1} +_UI_CreateChild_tooltip = Create New {0} Under {1} Feature +_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}. +_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent. + +_UI_PropertyDescriptor_description = The {0} of the {1} + +_UI_JavaClass_type = Class +_UI_JavaGen_type = Gen +_UI_JavaNamedElement_type = Named Element +_UI_JavaPackage__type = Package +_UI_JavaMethod_type = Method +_UI_JavaParameter_type = Parameter +_UI_JavaProperty_type = Property +_UI_PrimitiveType_type = Primitive Type +_UI_JavaProject_type = Project +_UI_JavaSrcFolder_type = Src Folder +_UI_Unknown_type = Object + +_UI_Unknown_datatype= Value + +_UI_JavaClass_base_Classifier_feature = Base Classifier +_UI_JavaClass_isFinal_feature = Is Final +_UI_JavaClass_isAbstract_feature = Is Abstract +_UI_JavaClass_isStatic_feature = Is Static +_UI_JavaGen_srcName_feature = Src Name +_UI_JavaGen_projectName_feature = Project Name +_UI_JavaNamedElement_name_feature = Name +_UI_JavaNamedElement_author_feature = Author +_UI_JavaNamedElement_version_feature = Version +_UI_JavaNamedElement_comment_feature = Comment +_UI_JavaNamedElement_isGenerated_feature = Is Generated +_UI_JavaPackage__packageName_feature = Package Name +_UI_JavaPackage__base_Package_feature = Base Package +_UI_JavaMethod_isStatic_feature = Is Static +_UI_JavaMethod_isFinal_feature = Is Final +_UI_JavaMethod_isAbstract_feature = Is Abstract +_UI_JavaMethod_isNative_feature = Is Native +_UI_JavaMethod_isSynchronized_feature = Is Synchronized +_UI_JavaMethod_isConstructor_feature = Is Constructor +_UI_JavaMethod_base_Operation_feature = Base Operation +_UI_JavaParameter_isFinal_feature = Is Final +_UI_JavaParameter_base_Parameter_feature = Base Parameter +_UI_JavaProperty_isAbstract_feature = Is Abstract +_UI_JavaProperty_isFinal_feature = Is Final +_UI_JavaProperty_base_Property_feature = Base Property +_UI_JavaProperty_isTransient_feature = Is Transient +_UI_JavaProperty_generateGetter_feature = Generate Getter +_UI_JavaProperty_generateSetter_feature = Generate Setter +_UI_JavaProperty_isStatic_feature = Is Static +_UI_PrimitiveType_implementationClass_feature = Implementation Class +_UI_PrimitiveType_base_PrimitiveType_feature = Base Primitive Type +_UI_JavaProject_base_Package_feature = Base Package +_UI_JavaSrcFolder_base_Package_feature = Base Package +_UI_Unknown_feature = Unspecified + +_UI_TrueFalseDefault_true_literal = true +_UI_TrueFalseDefault_false_literal = false +_UI_TrueFalseDefault_default_literal = default +_UI_PrimitiveType_collectionImplementationClass_feature = Collection Implementation Class +_UI_JavaClass_explicitPlainTextRequiredImports_feature = Explicit Plain Text Required Imports +_UI_JavaClass_explicitRequiredImports_feature = Explicit Required Imports +_UI_JavaMethod_explicitPlainTextRequiredImports_feature = Explicit Plain Text Required Imports +_UI_JavaProperty_explicitPlainTextRequiredImports_feature = Explicit Plain Text Required Imports +_UI_JavaMethod_explicitRequiredImports_feature = Explicit Required Imports +_UI_JavaProperty_explicitRequiredImports_feature = Explicit Required Imports diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/plugin.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/plugin.xml new file mode 100644 index 00000000000..24301c02945 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/plugin.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/pom.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/pom.xml new file mode 100644 index 00000000000..6e00e35bf8c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.java.profile.edit + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaClassItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaClassItemProvider.java new file mode 100644 index 00000000000..5bc9f8a6b1b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaClassItemProvider.java @@ -0,0 +1,276 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.profile.java.JavaClass; +import org.eclipse.papyrus.java.profile.java.JavaPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaClass} object. + * + * + * + * @generated + */ +public class JavaClassItemProvider + extends JavaGenItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JavaClassItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addBase_ClassifierPropertyDescriptor(object); + addIsFinalPropertyDescriptor(object); + addIsAbstractPropertyDescriptor(object); + addIsStaticPropertyDescriptor(object); + addExplicitPlainTextRequiredImportsPropertyDescriptor(object); + addExplicitRequiredImportsPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Base Classifier feature. + * + * + * + * @generated + */ + protected void addBase_ClassifierPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaClass_base_Classifier_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaClass_base_Classifier_feature", "_UI_JavaClass_type"), + JavaPackage.Literals.JAVA_CLASS__BASE_CLASSIFIER, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Final feature. + * + * + * + * @generated + */ + protected void addIsFinalPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaClass_isFinal_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaClass_isFinal_feature", "_UI_JavaClass_type"), + JavaPackage.Literals.JAVA_CLASS__IS_FINAL, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Abstract feature. + * + * + * + * @generated + */ + protected void addIsAbstractPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaClass_isAbstract_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaClass_isAbstract_feature", "_UI_JavaClass_type"), + JavaPackage.Literals.JAVA_CLASS__IS_ABSTRACT, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Static feature. + * + * + * + * @generated + */ + protected void addIsStaticPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaClass_isStatic_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaClass_isStatic_feature", "_UI_JavaClass_type"), + JavaPackage.Literals.JAVA_CLASS__IS_STATIC, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Explicit Plain Text Required Imports feature. + * + * + * + * @generated + */ + protected void addExplicitPlainTextRequiredImportsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaClass_explicitPlainTextRequiredImports_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaClass_explicitPlainTextRequiredImports_feature", "_UI_JavaClass_type"), + JavaPackage.Literals.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Explicit Required Imports feature. + * + * + * + * @generated + */ + protected void addExplicitRequiredImportsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaClass_explicitRequiredImports_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaClass_explicitRequiredImports_feature", "_UI_JavaClass_type"), + JavaPackage.Literals.JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns JavaClass.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaClass")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JavaClass) object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_JavaClass_type") : + getString("_UI_JavaClass_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JavaClass.class)) { + case JavaPackage.JAVA_CLASS__IS_FINAL: + case JavaPackage.JAVA_CLASS__IS_ABSTRACT: + case JavaPackage.JAVA_CLASS__IS_STATIC: + case JavaPackage.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaEditPlugin.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaEditPlugin.java new file mode 100644 index 00000000000..f0cbef55544 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaEditPlugin.java @@ -0,0 +1,103 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.provider; + +import org.eclipse.emf.common.EMFPlugin; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.provider.EcoreEditPlugin; +import org.eclipse.uml2.uml.edit.UMLEditPlugin; + +/** + * This is the central singleton for the Java edit plugin. + * + * + * + * @generated + */ +public final class JavaEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * + * @generated + */ + public static final JavaEditPlugin INSTANCE = new JavaEditPlugin(); + + /** + * Keep track of the singleton. + * + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * + * @generated + */ + public JavaEditPlugin() { + super(new ResourceLocator[] { + UMLEditPlugin.INSTANCE, + EcoreEditPlugin.INSTANCE, + }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * + * @generated + */ + public static class Implementation extends EclipsePlugin { + /** + * Creates an instance. + * + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaGenItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaGenItemProvider.java new file mode 100644 index 00000000000..b17fd0fa212 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaGenItemProvider.java @@ -0,0 +1,166 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.profile.java.JavaGen; +import org.eclipse.papyrus.java.profile.java.JavaPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaGen} object. + * + * + * + * @generated + */ +public class JavaGenItemProvider + extends JavaNamedElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JavaGenItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addSrcNamePropertyDescriptor(object); + addProjectNamePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Src Name feature. + * + * + * + * @generated + */ + protected void addSrcNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaGen_srcName_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaGen_srcName_feature", "_UI_JavaGen_type"), + JavaPackage.Literals.JAVA_GEN__SRC_NAME, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Project Name feature. + * + * + * + * @generated + */ + protected void addProjectNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaGen_projectName_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaGen_projectName_feature", "_UI_JavaGen_type"), + JavaPackage.Literals.JAVA_GEN__PROJECT_NAME, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JavaGen) object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_JavaGen_type") : + getString("_UI_JavaGen_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JavaGen.class)) { + case JavaPackage.JAVA_GEN__SRC_NAME: + case JavaPackage.JAVA_GEN__PROJECT_NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaItemProviderAdapterFactory.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaItemProviderAdapterFactory.java new file mode 100644 index 00000000000..9b126fc37ee --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaItemProviderAdapterFactory.java @@ -0,0 +1,421 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.provider; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.edit.provider.ChangeNotifier; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.IChangeNotifier; +import org.eclipse.emf.edit.provider.IDisposable; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.INotifyChangedListener; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.papyrus.java.profile.java.util.JavaAdapterFactory; + +/** + * This is the factory that is used to provide the interfaces needed to support Viewers. + * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. + * The adapters also support Eclipse property sheets. + * Note that most of the adapters are shared among multiple instances. + * + * + * + * @generated + */ +public class JavaItemProviderAdapterFactory extends JavaAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { + /** + * This keeps track of the root adapter factory that delegates to this adapter factory. + * + * + * + * @generated + */ + protected ComposedAdapterFactory parentAdapterFactory; + + /** + * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. + * + * + * + * @generated + */ + protected IChangeNotifier changeNotifier = new ChangeNotifier(); + + /** + * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. + * + * + * + * @generated + */ + protected Collection supportedTypes = new ArrayList(); + + /** + * This constructs an instance. + * + * + * + * @generated + */ + public JavaItemProviderAdapterFactory() { + supportedTypes.add(IEditingDomainItemProvider.class); + supportedTypes.add(IStructuredItemContentProvider.class); + supportedTypes.add(ITreeItemContentProvider.class); + supportedTypes.add(IItemLabelProvider.class); + supportedTypes.add(IItemPropertySource.class); + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaClass} instances. + * + * + * + * @generated + */ + protected JavaClassItemProvider javaClassItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaClass}. + * + * + * + * @generated + */ + @Override + public Adapter createJavaClassAdapter() { + if (javaClassItemProvider == null) { + javaClassItemProvider = new JavaClassItemProvider(this); + } + + return javaClassItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaPackage_} instances. + * + * + * + * @generated + */ + protected JavaPackage_ItemProvider javaPackage_ItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaPackage_}. + * + * + * + * @generated + */ + @Override + public Adapter createJavaPackage_Adapter() { + if (javaPackage_ItemProvider == null) { + javaPackage_ItemProvider = new JavaPackage_ItemProvider(this); + } + + return javaPackage_ItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaMethod} instances. + * + * + * + * @generated + */ + protected JavaMethodItemProvider javaMethodItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaMethod}. + * + * + * + * @generated + */ + @Override + public Adapter createJavaMethodAdapter() { + if (javaMethodItemProvider == null) { + javaMethodItemProvider = new JavaMethodItemProvider(this); + } + + return javaMethodItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaParameter} instances. + * + * + * + * @generated + */ + protected JavaParameterItemProvider javaParameterItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaParameter}. + * + * + * + * @generated + */ + @Override + public Adapter createJavaParameterAdapter() { + if (javaParameterItemProvider == null) { + javaParameterItemProvider = new JavaParameterItemProvider(this); + } + + return javaParameterItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaProperty} instances. + * + * + * + * @generated + */ + protected JavaPropertyItemProvider javaPropertyItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaProperty}. + * + * + * + * @generated + */ + @Override + public Adapter createJavaPropertyAdapter() { + if (javaPropertyItemProvider == null) { + javaPropertyItemProvider = new JavaPropertyItemProvider(this); + } + + return javaPropertyItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.PrimitiveType} instances. + * + * + * + * @generated + */ + protected PrimitiveTypeItemProvider primitiveTypeItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.PrimitiveType}. + * + * + * + * @generated + */ + @Override + public Adapter createPrimitiveTypeAdapter() { + if (primitiveTypeItemProvider == null) { + primitiveTypeItemProvider = new PrimitiveTypeItemProvider(this); + } + + return primitiveTypeItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaProject} instances. + * + * + * + * @generated + */ + protected JavaProjectItemProvider javaProjectItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaProject}. + * + * + * + * @generated + */ + @Override + public Adapter createJavaProjectAdapter() { + if (javaProjectItemProvider == null) { + javaProjectItemProvider = new JavaProjectItemProvider(this); + } + + return javaProjectItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder} instances. + * + * + * + * @generated + */ + protected JavaSrcFolderItemProvider javaSrcFolderItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder}. + * + * + * + * @generated + */ + @Override + public Adapter createJavaSrcFolderAdapter() { + if (javaSrcFolderItemProvider == null) { + javaSrcFolderItemProvider = new JavaSrcFolderItemProvider(this); + } + + return javaSrcFolderItemProvider; + } + + /** + * This returns the root adapter factory that contains this factory. + * + * + * + * @generated + */ + @Override + public ComposeableAdapterFactory getRootAdapterFactory() { + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); + } + + /** + * This sets the composed adapter factory that contains this factory. + * + * + * + * @generated + */ + @Override + public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { + this.parentAdapterFactory = parentAdapterFactory; + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isFactoryForType(Object type) { + return supportedTypes.contains(type) || super.isFactoryForType(type); + } + + /** + * This implementation substitutes the factory itself as the key for the adapter. + * + * + * + * @generated + */ + @Override + public Adapter adapt(Notifier notifier, Object type) { + return super.adapt(notifier, this); + } + + /** + * + * + * + * @generated + */ + @Override + public Object adapt(Object object, Object type) { + if (isFactoryForType(type)) { + Object adapter = super.adapt(object, type); + if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { + return adapter; + } + } + + return null; + } + + /** + * This adds a listener. + * + * + * + * @generated + */ + @Override + public void addListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.addListener(notifyChangedListener); + } + + /** + * This removes a listener. + * + * + * + * @generated + */ + @Override + public void removeListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.removeListener(notifyChangedListener); + } + + /** + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. + * + * + * + * @generated + */ + @Override + public void fireNotifyChanged(Notification notification) { + changeNotifier.fireNotifyChanged(notification); + + if (parentAdapterFactory != null) { + parentAdapterFactory.fireNotifyChanged(notification); + } + } + + /** + * This disposes all of the item providers created by this factory. + * + * + * + * @generated + */ + @Override + public void dispose() { + if (javaClassItemProvider != null) { + javaClassItemProvider.dispose(); + } + if (javaPackage_ItemProvider != null) { + javaPackage_ItemProvider.dispose(); + } + if (javaMethodItemProvider != null) { + javaMethodItemProvider.dispose(); + } + if (javaParameterItemProvider != null) { + javaParameterItemProvider.dispose(); + } + if (javaPropertyItemProvider != null) { + javaPropertyItemProvider.dispose(); + } + if (primitiveTypeItemProvider != null) { + primitiveTypeItemProvider.dispose(); + } + if (javaProjectItemProvider != null) { + javaProjectItemProvider.dispose(); + } + if (javaSrcFolderItemProvider != null) { + javaSrcFolderItemProvider.dispose(); + } + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaMethodItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaMethodItemProvider.java new file mode 100644 index 00000000000..c30e779e6aa --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaMethodItemProvider.java @@ -0,0 +1,351 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.profile.java.JavaMethod; +import org.eclipse.papyrus.java.profile.java.JavaPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaMethod} object. + * + * + * + * @generated + */ +public class JavaMethodItemProvider + extends JavaNamedElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JavaMethodItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addIsStaticPropertyDescriptor(object); + addIsFinalPropertyDescriptor(object); + addIsAbstractPropertyDescriptor(object); + addIsNativePropertyDescriptor(object); + addIsSynchronizedPropertyDescriptor(object); + addIsConstructorPropertyDescriptor(object); + addBase_OperationPropertyDescriptor(object); + addExplicitPlainTextRequiredImportsPropertyDescriptor(object); + addExplicitRequiredImportsPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Is Static feature. + * + * + * + * @generated + */ + protected void addIsStaticPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaMethod_isStatic_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_isStatic_feature", "_UI_JavaMethod_type"), + JavaPackage.Literals.JAVA_METHOD__IS_STATIC, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Final feature. + * + * + * + * @generated + */ + protected void addIsFinalPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaMethod_isFinal_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_isFinal_feature", "_UI_JavaMethod_type"), + JavaPackage.Literals.JAVA_METHOD__IS_FINAL, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Abstract feature. + * + * + * + * @generated + */ + protected void addIsAbstractPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaMethod_isAbstract_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_isAbstract_feature", "_UI_JavaMethod_type"), + JavaPackage.Literals.JAVA_METHOD__IS_ABSTRACT, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Native feature. + * + * + * + * @generated + */ + protected void addIsNativePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaMethod_isNative_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_isNative_feature", "_UI_JavaMethod_type"), + JavaPackage.Literals.JAVA_METHOD__IS_NATIVE, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Synchronized feature. + * + * + * + * @generated + */ + protected void addIsSynchronizedPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaMethod_isSynchronized_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_isSynchronized_feature", "_UI_JavaMethod_type"), + JavaPackage.Literals.JAVA_METHOD__IS_SYNCHRONIZED, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Constructor feature. + * + * + * + * @generated + */ + protected void addIsConstructorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaMethod_isConstructor_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_isConstructor_feature", "_UI_JavaMethod_type"), + JavaPackage.Literals.JAVA_METHOD__IS_CONSTRUCTOR, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Base Operation feature. + * + * + * + * @generated + */ + protected void addBase_OperationPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaMethod_base_Operation_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_base_Operation_feature", "_UI_JavaMethod_type"), + JavaPackage.Literals.JAVA_METHOD__BASE_OPERATION, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Explicit Plain Text Required Imports feature. + * + * + * + * @generated + */ + protected void addExplicitPlainTextRequiredImportsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaMethod_explicitPlainTextRequiredImports_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_explicitPlainTextRequiredImports_feature", "_UI_JavaMethod_type"), + JavaPackage.Literals.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Explicit Required Imports feature. + * + * + * + * @generated + */ + protected void addExplicitRequiredImportsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaMethod_explicitRequiredImports_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaMethod_explicitRequiredImports_feature", "_UI_JavaMethod_type"), + JavaPackage.Literals.JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns JavaMethod.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaMethod")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JavaMethod) object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_JavaMethod_type") : + getString("_UI_JavaMethod_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JavaMethod.class)) { + case JavaPackage.JAVA_METHOD__IS_STATIC: + case JavaPackage.JAVA_METHOD__IS_FINAL: + case JavaPackage.JAVA_METHOD__IS_ABSTRACT: + case JavaPackage.JAVA_METHOD__IS_NATIVE: + case JavaPackage.JAVA_METHOD__IS_SYNCHRONIZED: + case JavaPackage.JAVA_METHOD__IS_CONSTRUCTOR: + case JavaPackage.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaNamedElementItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaNamedElementItemProvider.java new file mode 100644 index 00000000000..9f0a4b9e6e1 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaNamedElementItemProvider.java @@ -0,0 +1,255 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.profile.java.JavaNamedElement; +import org.eclipse.papyrus.java.profile.java.JavaPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaNamedElement} object. + * + * + * + * @generated + */ +public class JavaNamedElementItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JavaNamedElementItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addNamePropertyDescriptor(object); + addAuthorPropertyDescriptor(object); + addVersionPropertyDescriptor(object); + addCommentPropertyDescriptor(object); + addIsGeneratedPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Name feature. + * + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaNamedElement_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaNamedElement_name_feature", "_UI_JavaNamedElement_type"), + JavaPackage.Literals.JAVA_NAMED_ELEMENT__NAME, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Author feature. + * + * + * + * @generated + */ + protected void addAuthorPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaNamedElement_author_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaNamedElement_author_feature", "_UI_JavaNamedElement_type"), + JavaPackage.Literals.JAVA_NAMED_ELEMENT__AUTHOR, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Version feature. + * + * + * + * @generated + */ + protected void addVersionPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaNamedElement_version_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaNamedElement_version_feature", "_UI_JavaNamedElement_type"), + JavaPackage.Literals.JAVA_NAMED_ELEMENT__VERSION, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Comment feature. + * + * + * + * @generated + */ + protected void addCommentPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaNamedElement_comment_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaNamedElement_comment_feature", "_UI_JavaNamedElement_type"), + JavaPackage.Literals.JAVA_NAMED_ELEMENT__COMMENT, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Generated feature. + * + * + * + * @generated + */ + protected void addIsGeneratedPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaNamedElement_isGenerated_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaNamedElement_isGenerated_feature", "_UI_JavaNamedElement_type"), + JavaPackage.Literals.JAVA_NAMED_ELEMENT__IS_GENERATED, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JavaNamedElement) object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_JavaNamedElement_type") : + getString("_UI_JavaNamedElement_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JavaNamedElement.class)) { + case JavaPackage.JAVA_NAMED_ELEMENT__NAME: + case JavaPackage.JAVA_NAMED_ELEMENT__AUTHOR: + case JavaPackage.JAVA_NAMED_ELEMENT__VERSION: + case JavaPackage.JAVA_NAMED_ELEMENT__COMMENT: + case JavaPackage.JAVA_NAMED_ELEMENT__IS_GENERATED: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return JavaEditPlugin.INSTANCE; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPackage_ItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPackage_ItemProvider.java new file mode 100644 index 00000000000..3220ea94e6d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPackage_ItemProvider.java @@ -0,0 +1,177 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaPackage_; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaPackage_} object. + * + * + * + * @generated + */ +public class JavaPackage_ItemProvider + extends JavaGenItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JavaPackage_ItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addPackageNamePropertyDescriptor(object); + addBase_PackagePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Package Name feature. + * + * + * + * @generated + */ + protected void addPackageNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaPackage__packageName_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaPackage__packageName_feature", "_UI_JavaPackage__type"), + JavaPackage.Literals.JAVA_PACKAGE___PACKAGE_NAME, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Base Package feature. + * + * + * + * @generated + */ + protected void addBase_PackagePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaPackage__base_Package_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaPackage__base_Package_feature", "_UI_JavaPackage__type"), + JavaPackage.Literals.JAVA_PACKAGE___BASE_PACKAGE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns JavaPackage_.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaPackage_")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JavaPackage_) object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_JavaPackage__type") : + getString("_UI_JavaPackage__type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JavaPackage_.class)) { + case JavaPackage.JAVA_PACKAGE___PACKAGE_NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaParameterItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaParameterItemProvider.java new file mode 100644 index 00000000000..006b8d41606 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaParameterItemProvider.java @@ -0,0 +1,177 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaParameter; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaParameter} object. + * + * + * + * @generated + */ +public class JavaParameterItemProvider + extends JavaNamedElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JavaParameterItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addIsFinalPropertyDescriptor(object); + addBase_ParameterPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Is Final feature. + * + * + * + * @generated + */ + protected void addIsFinalPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaParameter_isFinal_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaParameter_isFinal_feature", "_UI_JavaParameter_type"), + JavaPackage.Literals.JAVA_PARAMETER__IS_FINAL, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Base Parameter feature. + * + * + * + * @generated + */ + protected void addBase_ParameterPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaParameter_base_Parameter_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaParameter_base_Parameter_feature", "_UI_JavaParameter_type"), + JavaPackage.Literals.JAVA_PARAMETER__BASE_PARAMETER, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns JavaParameter.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaParameter")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JavaParameter) object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_JavaParameter_type") : + getString("_UI_JavaParameter_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JavaParameter.class)) { + case JavaPackage.JAVA_PARAMETER__IS_FINAL: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaProjectItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaProjectItemProvider.java new file mode 100644 index 00000000000..3fafb280255 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaProjectItemProvider.java @@ -0,0 +1,145 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaProject; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaProject} object. + * + * + * + * @generated + */ +public class JavaProjectItemProvider + extends JavaGenItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JavaProjectItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addBase_PackagePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Base Package feature. + * + * + * + * @generated + */ + protected void addBase_PackagePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaProject_base_Package_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaProject_base_Package_feature", "_UI_JavaProject_type"), + JavaPackage.Literals.JAVA_PROJECT__BASE_PACKAGE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns JavaProject.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaProject")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JavaProject) object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_JavaProject_type") : + getString("_UI_JavaProject_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPropertyItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPropertyItemProvider.java new file mode 100644 index 00000000000..4d3b1342181 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaPropertyItemProvider.java @@ -0,0 +1,351 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaProperty; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaProperty} object. + * + * + * + * @generated + */ +public class JavaPropertyItemProvider + extends JavaNamedElementItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JavaPropertyItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addIsAbstractPropertyDescriptor(object); + addIsFinalPropertyDescriptor(object); + addBase_PropertyPropertyDescriptor(object); + addIsTransientPropertyDescriptor(object); + addGenerateGetterPropertyDescriptor(object); + addGenerateSetterPropertyDescriptor(object); + addIsStaticPropertyDescriptor(object); + addExplicitPlainTextRequiredImportsPropertyDescriptor(object); + addExplicitRequiredImportsPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Is Abstract feature. + * + * + * + * @generated + */ + protected void addIsAbstractPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaProperty_isAbstract_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_isAbstract_feature", "_UI_JavaProperty_type"), + JavaPackage.Literals.JAVA_PROPERTY__IS_ABSTRACT, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Final feature. + * + * + * + * @generated + */ + protected void addIsFinalPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaProperty_isFinal_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_isFinal_feature", "_UI_JavaProperty_type"), + JavaPackage.Literals.JAVA_PROPERTY__IS_FINAL, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Base Property feature. + * + * + * + * @generated + */ + protected void addBase_PropertyPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaProperty_base_Property_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_base_Property_feature", "_UI_JavaProperty_type"), + JavaPackage.Literals.JAVA_PROPERTY__BASE_PROPERTY, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Transient feature. + * + * + * + * @generated + */ + protected void addIsTransientPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaProperty_isTransient_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_isTransient_feature", "_UI_JavaProperty_type"), + JavaPackage.Literals.JAVA_PROPERTY__IS_TRANSIENT, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Generate Getter feature. + * + * + * + * @generated + */ + protected void addGenerateGetterPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaProperty_generateGetter_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_generateGetter_feature", "_UI_JavaProperty_type"), + JavaPackage.Literals.JAVA_PROPERTY__GENERATE_GETTER, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Generate Setter feature. + * + * + * + * @generated + */ + protected void addGenerateSetterPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaProperty_generateSetter_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_generateSetter_feature", "_UI_JavaProperty_type"), + JavaPackage.Literals.JAVA_PROPERTY__GENERATE_SETTER, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Is Static feature. + * + * + * + * @generated + */ + protected void addIsStaticPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaProperty_isStatic_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_isStatic_feature", "_UI_JavaProperty_type"), + JavaPackage.Literals.JAVA_PROPERTY__IS_STATIC, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Explicit Plain Text Required Imports feature. + * + * + * + * @generated + */ + protected void addExplicitPlainTextRequiredImportsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaProperty_explicitPlainTextRequiredImports_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_explicitPlainTextRequiredImports_feature", "_UI_JavaProperty_type"), + JavaPackage.Literals.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Explicit Required Imports feature. + * + * + * + * @generated + */ + protected void addExplicitRequiredImportsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaProperty_explicitRequiredImports_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaProperty_explicitRequiredImports_feature", "_UI_JavaProperty_type"), + JavaPackage.Literals.JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns JavaProperty.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaProperty")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JavaProperty) object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_JavaProperty_type") : + getString("_UI_JavaProperty_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(JavaProperty.class)) { + case JavaPackage.JAVA_PROPERTY__IS_ABSTRACT: + case JavaPackage.JAVA_PROPERTY__IS_FINAL: + case JavaPackage.JAVA_PROPERTY__IS_TRANSIENT: + case JavaPackage.JAVA_PROPERTY__GENERATE_GETTER: + case JavaPackage.JAVA_PROPERTY__GENERATE_SETTER: + case JavaPackage.JAVA_PROPERTY__IS_STATIC: + case JavaPackage.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaSrcFolderItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaSrcFolderItemProvider.java new file mode 100644 index 00000000000..524bcd7e059 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/JavaSrcFolderItemProvider.java @@ -0,0 +1,145 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaSrcFolder; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder} object. + * + * + * + * @generated + */ +public class JavaSrcFolderItemProvider + extends JavaGenItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public JavaSrcFolderItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addBase_PackagePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Base Package feature. + * + * + * + * @generated + */ + protected void addBase_PackagePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_JavaSrcFolder_base_Package_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_JavaSrcFolder_base_Package_feature", "_UI_JavaSrcFolder_type"), + JavaPackage.Literals.JAVA_SRC_FOLDER__BASE_PACKAGE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns JavaSrcFolder.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/JavaSrcFolder")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((JavaSrcFolder) object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_JavaSrcFolder_type") : + getString("_UI_JavaSrcFolder_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/PrimitiveTypeItemProvider.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/PrimitiveTypeItemProvider.java new file mode 100644 index 00000000000..1ec2a9c9a48 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit/src/org/eclipse/papyrus/java/profile/java/provider/PrimitiveTypeItemProvider.java @@ -0,0 +1,202 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.PrimitiveType; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.java.profile.java.PrimitiveType} object. + * + * + * + * @generated + */ +public class PrimitiveTypeItemProvider + extends JavaGenItemProvider + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * + * @generated + */ + public PrimitiveTypeItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addImplementationClassPropertyDescriptor(object); + addBase_PrimitiveTypePropertyDescriptor(object); + addCollectionImplementationClassPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Implementation Class feature. + * + * + * + * @generated + */ + protected void addImplementationClassPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_PrimitiveType_implementationClass_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_PrimitiveType_implementationClass_feature", "_UI_PrimitiveType_type"), + JavaPackage.Literals.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Base Primitive Type feature. + * + * + * + * @generated + */ + protected void addBase_PrimitiveTypePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_PrimitiveType_base_PrimitiveType_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_PrimitiveType_base_PrimitiveType_feature", "_UI_PrimitiveType_type"), + JavaPackage.Literals.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Collection Implementation Class feature. + * + * + * + * @generated + */ + protected void addCollectionImplementationClassPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_PrimitiveType_collectionImplementationClass_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_PrimitiveType_collectionImplementationClass_feature", "_UI_PrimitiveType_type"), + JavaPackage.Literals.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns PrimitiveType.gif. + * + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/PrimitiveType")); + } + + /** + * This returns the label text for the adapted class. + * + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((PrimitiveType) object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_PrimitiveType_type") : + getString("_UI_PrimitiveType_type") + " " + label; + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(PrimitiveType.class)) { + case JavaPackage.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS: + case JavaPackage.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.classpath b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.project b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.project new file mode 100644 index 00000000000..b093010c682 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.java.profile.editor + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..4406bae6a12 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/META-INF/MANIFEST.MF @@ -0,0 +1,17 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.papyrus.java.profile.edit;bundle-version="1.2.0";visibility:=reexport, + org.eclipse.emf.edit.ui;visibility:=reexport, + org.eclipse.ui.ide;visibility:=reexport, + org.eclipse.core.resources +Export-Package: org.eclipse.papyrus.java.profile.java.presentation +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.java.profile.java.presentation.JavaEditorPlugin$Implementation +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.java.profile.editor;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/about.html b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/build.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/build.properties new file mode 100644 index 00000000000..e0979c7d60f --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/build.properties @@ -0,0 +1,16 @@ + +# +# +# +# $Id$ + +bin.includes = .,\ + icons/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties,\ + about.html +jars.compile.order = . +source.. = src/ +output.. = bin +src.includes = about.html diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/icons/full/obj16/JavaModelFile.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/icons/full/obj16/JavaModelFile.gif new file mode 100644 index 00000000000..53eb7d4f381 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/icons/full/obj16/JavaModelFile.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/icons/full/wizban/NewJava.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/icons/full/wizban/NewJava.gif new file mode 100644 index 00000000000..5306a816d4c Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/icons/full/wizban/NewJava.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/plugin.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/plugin.properties new file mode 100644 index 00000000000..f21e2f2baf8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/plugin.properties @@ -0,0 +1,65 @@ + +################################################################################# +# Copyright (c) 2011-2013 Cedric Dumoulin. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API +# +################################################################################# + +pluginName = Profile for Java classes generation Editor Support (Incubation) +providerName = Eclipse Modeling Project + +_UI_JavaEditor_menu = &Java Editor + +_UI_CreateChild_menu_item = &New Child +_UI_CreateSibling_menu_item = N&ew Sibling + +_UI_ShowPropertiesView_menu_item = Show &Properties View +_UI_RefreshViewer_menu_item = &Refresh + +_UI_SelectionPage_label = Selection +_UI_ParentPage_label = Parent +_UI_ListPage_label = List +_UI_TreePage_label = Tree +_UI_TablePage_label = Table +_UI_TreeWithColumnsPage_label = Tree with Columns +_UI_ObjectColumn_label = Object +_UI_SelfColumn_label = Self + +_UI_NoObjectSelected = Selected Nothing +_UI_SingleObjectSelected = Selected Object: {0} +_UI_MultiObjectSelected = Selected {0} Objects + +_UI_OpenEditorError_label = Open Editor + +_UI_Wizard_category = Example EMF Model Creation Wizards + +_UI_CreateModelError_message = Problems encountered in file "{0}" + +_UI_JavaModelWizard_label = Java Model +_UI_JavaModelWizard_description = Create a new Java model + +_UI_JavaEditor_label = Java Model Editor + +_UI_JavaEditorFilenameDefaultBase = My +_UI_JavaEditorFilenameExtensions = java + +_UI_Wizard_label = New + +_WARN_FilenameExtension = The file name must end in ''.{0}'' +_WARN_FilenameExtensions = The file name must have one of the following extensions: {0} + +_UI_ModelObject = &Model Object +_UI_XMLEncoding = &XML Encoding +_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1 +_UI_Wizard_initial_object_description = Select a model object to create + +_UI_FileConflict_label = File Conflict +_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes? + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/plugin.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/plugin.xml new file mode 100644 index 00000000000..83b63b9cb2c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/plugin.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + %_UI_JavaModelWizard_description + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/pom.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/pom.xml new file mode 100644 index 00000000000..bc9d1af8099 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.java.profile.editor + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaActionBarContributor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaActionBarContributor.java new file mode 100644 index 00000000000..f73a9c3c7a1 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaActionBarContributor.java @@ -0,0 +1,445 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.presentation; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.ui.viewer.IViewerProvider; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.domain.IEditingDomainProvider; +import org.eclipse.emf.edit.ui.action.ControlAction; +import org.eclipse.emf.edit.ui.action.CreateChildAction; +import org.eclipse.emf.edit.ui.action.CreateSiblingAction; +import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; +import org.eclipse.emf.edit.ui.action.LoadResourceAction; +import org.eclipse.emf.edit.ui.action.ValidateAction; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.ActionContributionItem; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IContributionItem; +import org.eclipse.jface.action.IContributionManager; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.jface.action.SubContributionItem; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.PartInitException; + +/** + * This is the action bar contributor for the Java model editor. + * + * + * + * @generated + */ +public class JavaActionBarContributor + extends EditingDomainActionBarContributor + implements ISelectionChangedListener { + /** + * This keeps track of the active editor. + * + * + * + * @generated + */ + protected IEditorPart activeEditorPart; + + /** + * This keeps track of the current selection provider. + * + * + * + * @generated + */ + protected ISelectionProvider selectionProvider; + + /** + * This action opens the Properties view. + * + * + * + * @generated + */ + protected IAction showPropertiesViewAction = + new Action(JavaEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { + @Override + public void run() { + try { + getPage().showView("org.eclipse.ui.views.PropertySheet"); + } + catch (PartInitException exception) { + JavaEditorPlugin.INSTANCE.log(exception); + } + } + }; + + /** + * This action refreshes the viewer of the current editor if the editor + * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. + * + * + * + * @generated + */ + protected IAction refreshViewerAction = + new Action(JavaEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) { + @Override + public boolean isEnabled() { + return activeEditorPart instanceof IViewerProvider; + } + + @Override + public void run() { + if (activeEditorPart instanceof IViewerProvider) { + Viewer viewer = ((IViewerProvider) activeEditorPart).getViewer(); + if (viewer != null) { + viewer.refresh(); + } + } + } + }; + + /** + * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor + * generated for the current selection by the item provider. + * + * + * + * @generated + */ + protected Collection createChildActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateChild actions. + * + * + * + * @generated + */ + protected IMenuManager createChildMenuManager; + + /** + * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor + * generated for the current selection by the item provider. + * + * + * + * @generated + */ + protected Collection createSiblingActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateSibling actions. + * + * + * + * @generated + */ + protected IMenuManager createSiblingMenuManager; + + /** + * This creates an instance of the contributor. + * + * + * + * @generated + */ + public JavaActionBarContributor() { + super(ADDITIONS_LAST_STYLE); + loadResourceAction = new LoadResourceAction(); + validateAction = new ValidateAction(); + controlAction = new ControlAction(); + } + + /** + * This adds Separators for editor additions to the tool bar. + * + * + * + * @generated + */ + @Override + public void contributeToToolBar(IToolBarManager toolBarManager) { + toolBarManager.add(new Separator("java-settings")); + toolBarManager.add(new Separator("java-additions")); + } + + /** + * This adds to the menu bar a menu and some separators for editor additions, + * as well as the sub-menus for object creation items. + * + * + * + * @generated + */ + @Override + public void contributeToMenu(IMenuManager menuManager) { + super.contributeToMenu(menuManager); + + IMenuManager submenuManager = new MenuManager(JavaEditorPlugin.INSTANCE.getString("_UI_JavaEditor_menu"), "org.eclipse.papyrus.java.profile.javaMenuID"); + menuManager.insertAfter("additions", submenuManager); + submenuManager.add(new Separator("settings")); + submenuManager.add(new Separator("actions")); + submenuManager.add(new Separator("additions")); + submenuManager.add(new Separator("additions-end")); + + // Prepare for CreateChild item addition or removal. + // + createChildMenuManager = new MenuManager(JavaEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + submenuManager.insertBefore("additions", createChildMenuManager); + + // Prepare for CreateSibling item addition or removal. + // + createSiblingMenuManager = new MenuManager(JavaEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + submenuManager.insertBefore("additions", createSiblingMenuManager); + + // Force an update because Eclipse hides empty menus now. + // + submenuManager.addMenuListener + (new IMenuListener() { + @Override + public void menuAboutToShow(IMenuManager menuManager) { + menuManager.updateAll(true); + } + }); + + addGlobalActions(submenuManager); + } + + /** + * When the active editor changes, this remembers the change and registers with it as a selection provider. + * + * + * + * @generated + */ + @Override + public void setActiveEditor(IEditorPart part) { + super.setActiveEditor(part); + activeEditorPart = part; + + // Switch to the new selection provider. + // + if (selectionProvider != null) { + selectionProvider.removeSelectionChangedListener(this); + } + if (part == null) { + selectionProvider = null; + } + else { + selectionProvider = part.getSite().getSelectionProvider(); + selectionProvider.addSelectionChangedListener(this); + + // Fake a selection changed event to update the menus. + // + if (selectionProvider.getSelection() != null) { + selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection())); + } + } + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener}, + * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings + * that can be added to the selected object and updating the menus accordingly. + * + * + * + * @generated + */ + @Override + public void selectionChanged(SelectionChangedEvent event) { + // Remove any menu items for old selection. + // + if (createChildMenuManager != null) { + depopulateManager(createChildMenuManager, createChildActions); + } + if (createSiblingMenuManager != null) { + depopulateManager(createSiblingMenuManager, createSiblingActions); + } + + // Query the new selection for appropriate new child/sibling descriptors + // + Collection newChildDescriptors = null; + Collection newSiblingDescriptors = null; + + ISelection selection = event.getSelection(); + if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) { + Object object = ((IStructuredSelection) selection).getFirstElement(); + + EditingDomain domain = ((IEditingDomainProvider) activeEditorPart).getEditingDomain(); + + newChildDescriptors = domain.getNewChildDescriptors(object, null); + newSiblingDescriptors = domain.getNewChildDescriptors(null, object); + } + + // Generate actions for selection; populate and redraw the menus. + // + createChildActions = generateCreateChildActions(newChildDescriptors, selection); + createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection); + + if (createChildMenuManager != null) { + populateManager(createChildMenuManager, createChildActions, null); + createChildMenuManager.update(true); + } + if (createSiblingMenuManager != null) { + populateManager(createSiblingMenuManager, createSiblingActions, null); + createSiblingMenuManager.update(true); + } + } + + /** + * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in descriptors, + * and returns the collection of these actions. + * + * + * + * @generated + */ + protected Collection generateCreateChildActions(Collection descriptors, ISelection selection) { + Collection actions = new ArrayList(); + if (descriptors != null) { + for (Object descriptor : descriptors) { + actions.add(new CreateChildAction(activeEditorPart, selection, descriptor)); + } + } + return actions; + } + + /** + * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in descriptors, + * and returns the collection of these actions. + * + * + * + * @generated + */ + protected Collection generateCreateSiblingActions(Collection descriptors, ISelection selection) { + Collection actions = new ArrayList(); + if (descriptors != null) { + for (Object descriptor : descriptors) { + actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); + } + } + return actions; + } + + /** + * This populates the specified manager with {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection, + * by inserting them before the specified contribution item contributionID. + * If contributionID is null, they are simply added. + * + * + * + * @generated + */ + protected void populateManager(IContributionManager manager, Collection actions, String contributionID) { + if (actions != null) { + for (IAction action : actions) { + if (contributionID != null) { + manager.insertBefore(contributionID, action); + } + else { + manager.add(action); + } + } + } + } + + /** + * This removes from the specified manager all {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection. + * + * + * + * @generated + */ + protected void depopulateManager(IContributionManager manager, Collection actions) { + if (actions != null) { + IContributionItem[] items = manager.getItems(); + for (int i = 0; i < items.length; i++) { + // Look into SubContributionItems + // + IContributionItem contributionItem = items[i]; + while (contributionItem instanceof SubContributionItem) { + contributionItem = ((SubContributionItem) contributionItem).getInnerItem(); + } + + // Delete the ActionContributionItems with matching action. + // + if (contributionItem instanceof ActionContributionItem) { + IAction action = ((ActionContributionItem) contributionItem).getAction(); + if (actions.contains(action)) { + manager.remove(contributionItem); + } + } + } + } + } + + /** + * This populates the pop-up menu before it appears. + * + * + * + * @generated + */ + @Override + public void menuAboutToShow(IMenuManager menuManager) { + super.menuAboutToShow(menuManager); + MenuManager submenuManager = null; + + submenuManager = new MenuManager(JavaEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + populateManager(submenuManager, createChildActions, null); + menuManager.insertBefore("edit", submenuManager); + + submenuManager = new MenuManager(JavaEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + populateManager(submenuManager, createSiblingActions, null); + menuManager.insertBefore("edit", submenuManager); + } + + /** + * This inserts global actions before the "additions-end" separator. + * + * + * + * @generated + */ + @Override + protected void addGlobalActions(IMenuManager menuManager) { + menuManager.insertAfter("additions-end", new Separator("ui-actions")); + menuManager.insertAfter("ui-actions", showPropertiesViewAction); + + refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); + menuManager.insertAfter("ui-actions", refreshViewerAction); + + super.addGlobalActions(menuManager); + } + + /** + * This ensures that a delete action will clean up all references to deleted objects. + * + * + * + * @generated + */ + @Override + protected boolean removeAllReferencesOnDelete() { + return true; + } + +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditor.java new file mode 100644 index 00000000000..4ac8d8e0bc8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditor.java @@ -0,0 +1,1885 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.presentation; + + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.EventObject; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceChangeEvent; +import org.eclipse.core.resources.IResourceChangeListener; +import org.eclipse.core.resources.IResourceDelta; +import org.eclipse.core.resources.IResourceDeltaVisitor; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.emf.common.command.BasicCommandStack; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CommandStack; +import org.eclipse.emf.common.command.CommandStackListener; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.ui.MarkerHelper; +import org.eclipse.emf.common.ui.ViewerPane; +import org.eclipse.emf.common.ui.editor.ProblemEditorPart; +import org.eclipse.emf.common.ui.viewer.IViewerProvider; +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EValidator; +import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.EContentAdapter; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.domain.IEditingDomainProvider; +import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; +import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory; +import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; +import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; +import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter; +import org.eclipse.emf.edit.ui.dnd.LocalTransfer; +import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter; +import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; +import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; +import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider; +import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper; +import org.eclipse.emf.edit.ui.util.EditUIUtil; +import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IStatusLineManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.viewers.ColumnWeightData; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ListViewer; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.StructuredViewer; +import org.eclipse.jface.viewers.TableLayout; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.papyrus.java.profile.java.provider.JavaItemProviderAdapterFactory; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CTabFolder; +import org.eclipse.swt.dnd.DND; +import org.eclipse.swt.dnd.Transfer; +import org.eclipse.swt.events.ControlAdapter; +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.swt.widgets.TreeColumn; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.IPartListener; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.actions.WorkspaceModifyOperation; +import org.eclipse.ui.dialogs.SaveAsDialog; +import org.eclipse.ui.ide.IGotoMarker; +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.MultiPageEditorPart; +import org.eclipse.ui.views.contentoutline.ContentOutline; +import org.eclipse.ui.views.contentoutline.ContentOutlinePage; +import org.eclipse.ui.views.contentoutline.IContentOutlinePage; +import org.eclipse.ui.views.properties.IPropertySheetPage; +import org.eclipse.ui.views.properties.PropertySheet; +import org.eclipse.ui.views.properties.PropertySheetPage; +import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory; + + +/** + * This is an example of a Java model editor. + * + * + * + * @generated + */ +public class JavaEditor + extends MultiPageEditorPart + implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker { + /** + * This keeps track of the editing domain that is used to track all changes to the model. + * + * + * + * @generated + */ + protected AdapterFactoryEditingDomain editingDomain; + + /** + * This is the one adapter factory used for providing views of the model. + * + * + * + * @generated + */ + protected ComposedAdapterFactory adapterFactory; + + /** + * This is the content outline page. + * + * + * + * @generated + */ + protected IContentOutlinePage contentOutlinePage; + + /** + * This is a kludge... + * + * + * + * @generated + */ + protected IStatusLineManager contentOutlineStatusLineManager; + + /** + * This is the content outline page's viewer. + * + * + * + * @generated + */ + protected TreeViewer contentOutlineViewer; + + /** + * This is the property sheet page. + * + * + * + * @generated + */ + protected PropertySheetPage propertySheetPage; + + /** + * This is the viewer that shadows the selection in the content outline. + * The parent relation must be correctly defined for this to work. + * + * + * + * @generated + */ + protected TreeViewer selectionViewer; + + /** + * This inverts the roll of parent and child in the content provider and show parents as a tree. + * + * + * + * @generated + */ + protected TreeViewer parentViewer; + + /** + * This shows how a tree view works. + * + * + * + * @generated + */ + protected TreeViewer treeViewer; + + /** + * This shows how a list view works. + * A list viewer doesn't support icons. + * + * + * + * @generated + */ + protected ListViewer listViewer; + + /** + * This shows how a table view works. + * A table can be used as a list with icons. + * + * + * + * @generated + */ + protected TableViewer tableViewer; + + /** + * This shows how a tree view with columns works. + * + * + * + * @generated + */ + protected TreeViewer treeViewerWithColumns; + + /** + * This keeps track of the active viewer pane, in the book. + * + * + * + * @generated + */ + protected ViewerPane currentViewerPane; + + /** + * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer. + * + * + * + * @generated + */ + protected Viewer currentViewer; + + /** + * This listens to which ever viewer is active. + * + * + * + * @generated + */ + protected ISelectionChangedListener selectionChangedListener; + + /** + * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor. + * + * + * + * @generated + */ + protected Collection selectionChangedListeners = new ArrayList(); + + /** + * This keeps track of the selection of the editor as a whole. + * + * + * + * @generated + */ + protected ISelection editorSelection = StructuredSelection.EMPTY; + + /** + * The MarkerHelper is responsible for creating workspace resource markers presented + * in Eclipse's Problems View. + * + * + * + * @generated + */ + protected MarkerHelper markerHelper = new EditUIMarkerHelper(); + + /** + * This listens for when the outline becomes active + * + * + * + * @generated + */ + protected IPartListener partListener = + new IPartListener() { + @Override + public void partActivated(IWorkbenchPart p) { + if (p instanceof ContentOutline) { + if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) { + getActionBarContributor().setActiveEditor(JavaEditor.this); + + setCurrentViewer(contentOutlineViewer); + } + } + else if (p instanceof PropertySheet) { + if (((PropertySheet) p).getCurrentPage() == propertySheetPage) { + getActionBarContributor().setActiveEditor(JavaEditor.this); + handleActivate(); + } + } + else if (p == JavaEditor.this) { + handleActivate(); + } + } + + @Override + public void partBroughtToTop(IWorkbenchPart p) { + // Ignore. + } + + @Override + public void partClosed(IWorkbenchPart p) { + // Ignore. + } + + @Override + public void partDeactivated(IWorkbenchPart p) { + // Ignore. + } + + @Override + public void partOpened(IWorkbenchPart p) { + // Ignore. + } + }; + + /** + * Resources that have been removed since last activation. + * + * + * + * @generated + */ + protected Collection removedResources = new ArrayList(); + + /** + * Resources that have been changed since last activation. + * + * + * + * @generated + */ + protected Collection changedResources = new ArrayList(); + + /** + * Resources that have been saved. + * + * + * + * @generated + */ + protected Collection savedResources = new ArrayList(); + + /** + * Map to store the diagnostic associated with a resource. + * + * + * + * @generated + */ + protected Map resourceToDiagnosticMap = new LinkedHashMap(); + + /** + * Controls whether the problem indication should be updated. + * + * + * + * @generated + */ + protected boolean updateProblemIndication = true; + + /** + * Adapter used to update the problem indication when resources are demanded loaded. + * + * + * + * @generated + */ + protected EContentAdapter problemIndicationAdapter = + new EContentAdapter() { + @Override + public void notifyChanged(Notification notification) { + if (notification.getNotifier() instanceof Resource) { + switch (notification.getFeatureID(Resource.class)) { + case Resource.RESOURCE__IS_LOADED: + case Resource.RESOURCE__ERRORS: + case Resource.RESOURCE__WARNINGS: { + Resource resource = (Resource) notification.getNotifier(); + Diagnostic diagnostic = analyzeResourceProblems(resource, null); + if (diagnostic.getSeverity() != Diagnostic.OK) { + resourceToDiagnosticMap.put(resource, diagnostic); + } + else { + resourceToDiagnosticMap.remove(resource); + } + + if (updateProblemIndication) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + updateProblemIndication(); + } + }); + } + break; + } + } + } + else { + super.notifyChanged(notification); + } + } + + @Override + protected void setTarget(Resource target) { + basicSetTarget(target); + } + + @Override + protected void unsetTarget(Resource target) { + basicUnsetTarget(target); + } + }; + + /** + * This listens for workspace changes. + * + * + * + * @generated + */ + protected IResourceChangeListener resourceChangeListener = + new IResourceChangeListener() { + @Override + public void resourceChanged(IResourceChangeEvent event) { + IResourceDelta delta = event.getDelta(); + try { + class ResourceDeltaVisitor implements IResourceDeltaVisitor { + protected ResourceSet resourceSet = editingDomain.getResourceSet(); + protected Collection changedResources = new ArrayList(); + protected Collection removedResources = new ArrayList(); + + @Override + public boolean visit(IResourceDelta delta) { + if (delta.getResource().getType() == IResource.FILE) { + if (delta.getKind() == IResourceDelta.REMOVED || + delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS) { + Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false); + if (resource != null) { + if (delta.getKind() == IResourceDelta.REMOVED) { + removedResources.add(resource); + } + else if (!savedResources.remove(resource)) { + changedResources.add(resource); + } + } + } + } + + return true; + } + + public Collection getChangedResources() { + return changedResources; + } + + public Collection getRemovedResources() { + return removedResources; + } + } + + final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(); + delta.accept(visitor); + + if (!visitor.getRemovedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + removedResources.addAll(visitor.getRemovedResources()); + if (!isDirty()) { + getSite().getPage().closeEditor(JavaEditor.this, false); + } + } + }); + } + + if (!visitor.getChangedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + changedResources.addAll(visitor.getChangedResources()); + if (getSite().getPage().getActiveEditor() == JavaEditor.this) { + handleActivate(); + } + } + }); + } + } + catch (CoreException exception) { + JavaEditorPlugin.INSTANCE.log(exception); + } + } + }; + + /** + * Handles activation of the editor or it's associated views. + * + * + * + * @generated + */ + protected void handleActivate() { + // Recompute the read only state. + // + if (editingDomain.getResourceToReadOnlyMap() != null) { + editingDomain.getResourceToReadOnlyMap().clear(); + + // Refresh any actions that may become enabled or disabled. + // + setSelection(getSelection()); + } + + if (!removedResources.isEmpty()) { + if (handleDirtyConflict()) { + getSite().getPage().closeEditor(JavaEditor.this, false); + } + else { + removedResources.clear(); + changedResources.clear(); + savedResources.clear(); + } + } + else if (!changedResources.isEmpty()) { + changedResources.removeAll(savedResources); + handleChangedResources(); + changedResources.clear(); + savedResources.clear(); + } + } + + /** + * Handles what to do with changed resources on activation. + * + * + * + * @generated + */ + protected void handleChangedResources() { + if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { + if (isDirty()) { + changedResources.addAll(editingDomain.getResourceSet().getResources()); + } + editingDomain.getCommandStack().flush(); + + updateProblemIndication = false; + for (Resource resource : changedResources) { + if (resource.isLoaded()) { + resource.unload(); + try { + resource.load(Collections.EMPTY_MAP); + } catch (IOException exception) { + if (!resourceToDiagnosticMap.containsKey(resource)) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + } + } + } + + if (AdapterFactoryEditingDomain.isStale(editorSelection)) { + setSelection(StructuredSelection.EMPTY); + } + + updateProblemIndication = true; + updateProblemIndication(); + } + } + + /** + * Updates the problems indication with the information described in the specified diagnostic. + * + * + * + * @generated + */ + protected void updateProblemIndication() { + if (updateProblemIndication) { + BasicDiagnostic diagnostic = + new BasicDiagnostic + (Diagnostic.OK, + "org.eclipse.papyrus.java.profile.editor", + 0, + null, + new Object[] { editingDomain.getResourceSet() }); + for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) { + if (childDiagnostic.getSeverity() != Diagnostic.OK) { + diagnostic.add(childDiagnostic); + } + } + + int lastEditorPage = getPageCount() - 1; + if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) { + ((ProblemEditorPart) getEditor(lastEditorPage)).setDiagnostic(diagnostic); + if (diagnostic.getSeverity() != Diagnostic.OK) { + setActivePage(lastEditorPage); + } + } + else if (diagnostic.getSeverity() != Diagnostic.OK) { + ProblemEditorPart problemEditorPart = new ProblemEditorPart(); + problemEditorPart.setDiagnostic(diagnostic); + problemEditorPart.setMarkerHelper(markerHelper); + try { + addPage(++lastEditorPage, problemEditorPart, getEditorInput()); + setPageText(lastEditorPage, problemEditorPart.getPartName()); + setActivePage(lastEditorPage); + showTabs(); + } catch (PartInitException exception) { + JavaEditorPlugin.INSTANCE.log(exception); + } + } + + if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { + markerHelper.deleteMarkers(editingDomain.getResourceSet()); + if (diagnostic.getSeverity() != Diagnostic.OK) { + try { + markerHelper.createMarkers(diagnostic); + } catch (CoreException exception) { + JavaEditorPlugin.INSTANCE.log(exception); + } + } + } + } + } + + /** + * Shows a dialog that asks if conflicting changes should be discarded. + * + * + * + * @generated + */ + protected boolean handleDirtyConflict() { + return MessageDialog.openQuestion + (getSite().getShell(), + getString("_UI_FileConflict_label"), + getString("_WARN_FileConflict")); + } + + /** + * This creates a model editor. + * + * + * + * @generated + */ + public JavaEditor() { + super(); + initializeEditingDomain(); + } + + /** + * This sets up the editing domain for the model editor. + * + * + * + * @generated + */ + protected void initializeEditingDomain() { + // Create an adapter factory that yields item providers. + // + adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); + + adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new JavaItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new UMLItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new EcoreItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); + + // Create the command stack that will notify this editor as commands are executed. + // + BasicCommandStack commandStack = new BasicCommandStack(); + + // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. + // + commandStack.addCommandStackListener + (new CommandStackListener() { + @Override + public void commandStackChanged(final EventObject event) { + getContainer().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + firePropertyChange(IEditorPart.PROP_DIRTY); + + // Try to select the affected objects. + // + Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand(); + if (mostRecentCommand != null) { + setSelectionToViewer(mostRecentCommand.getAffectedObjects()); + } + if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) { + propertySheetPage.refresh(); + } + } + }); + } + }); + + // Create the editing domain with a special command stack. + // + editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap()); + } + + /** + * This is here for the listener to be able to call it. + * + * + * + * @generated + */ + @Override + protected void firePropertyChange(int action) { + super.firePropertyChange(action); + } + + /** + * This sets the selection into whichever viewer is active. + * + * + * + * @generated + */ + public void setSelectionToViewer(Collection collection) { + final Collection theSelection = collection; + // Make sure it's okay. + // + if (theSelection != null && !theSelection.isEmpty()) { + Runnable runnable = + new Runnable() { + @Override + public void run() { + // Try to select the items in the current content viewer of the editor. + // + if (currentViewer != null) { + currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); + } + } + }; + getSite().getShell().getDisplay().asyncExec(runnable); + } + } + + /** + * This returns the editing domain as required by the {@link IEditingDomainProvider} interface. + * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}. + * + * + * + * @generated + */ + @Override + public EditingDomain getEditingDomain() { + return editingDomain; + } + + /** + * + * + * + * @generated + */ + public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { + /** + * + * + * + * @generated + */ + public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * + * + * + * @generated + */ + @Override + public Object[] getElements(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * + * @generated + */ + @Override + public Object[] getChildren(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean hasChildren(Object object) { + Object parent = super.getParent(object); + return parent != null; + } + + /** + * + * + * + * @generated + */ + @Override + public Object getParent(Object object) { + return null; + } + } + + /** + * + * + * + * @generated + */ + public void setCurrentViewerPane(ViewerPane viewerPane) { + if (currentViewerPane != viewerPane) { + if (currentViewerPane != null) { + currentViewerPane.showFocus(false); + } + currentViewerPane = viewerPane; + } + setCurrentViewer(currentViewerPane.getViewer()); + } + + /** + * This makes sure that one content viewer, either for the current page or the outline view, if it has focus, + * is the current one. + * + * + * + * @generated + */ + public void setCurrentViewer(Viewer viewer) { + // If it is changing... + // + if (currentViewer != viewer) { + if (selectionChangedListener == null) { + // Create the listener on demand. + // + selectionChangedListener = + new ISelectionChangedListener() { + // This just notifies those things that are affected by the section. + // + @Override + public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { + setSelection(selectionChangedEvent.getSelection()); + } + }; + } + + // Stop listening to the old one. + // + if (currentViewer != null) { + currentViewer.removeSelectionChangedListener(selectionChangedListener); + } + + // Start listening to the new one. + // + if (viewer != null) { + viewer.addSelectionChangedListener(selectionChangedListener); + } + + // Remember it. + // + currentViewer = viewer; + + // Set the editors selection based on the current viewer's selection. + // + setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection()); + } + } + + /** + * This returns the viewer as required by the {@link IViewerProvider} interface. + * + * + * + * @generated + */ + @Override + public Viewer getViewer() { + return currentViewer; + } + + /** + * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. + * + * + * + * @generated + */ + protected void createContextMenuFor(StructuredViewer viewer) { + MenuManager contextMenu = new MenuManager("#PopUp"); + contextMenu.add(new Separator("additions")); + contextMenu.setRemoveAllWhenShown(true); + contextMenu.addMenuListener(this); + Menu menu = contextMenu.createContextMenu(viewer.getControl()); + viewer.getControl().setMenu(menu); + getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); + + int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; + Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() }; + viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); + viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); + } + + /** + * This is the method called to load a resource into the editing domain's resource set based on the editor's input. + * + * + * + * @generated + */ + public void createModel() { + URI resourceURI = EditUIUtil.getURI(getEditorInput()); + Exception exception = null; + Resource resource = null; + try { + // Load the resource through the editing domain. + // + resource = editingDomain.getResourceSet().getResource(resourceURI, true); + } catch (Exception e) { + exception = e; + resource = editingDomain.getResourceSet().getResource(resourceURI, false); + } + + Diagnostic diagnostic = analyzeResourceProblems(resource, exception); + if (diagnostic.getSeverity() != Diagnostic.OK) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter); + } + + /** + * Returns a diagnostic describing the errors and warnings listed in the resource + * and the specified exception (if any). + * + * + * + * @generated + */ + public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) { + if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) { + BasicDiagnostic basicDiagnostic = + new BasicDiagnostic + (Diagnostic.ERROR, + "org.eclipse.papyrus.java.profile.editor", + 0, + getString("_UI_CreateModelError_message", resource.getURI()), + new Object[] { exception == null ? (Object) resource : exception }); + basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); + return basicDiagnostic; + } + else if (exception != null) { + return new BasicDiagnostic(Diagnostic.ERROR, + "org.eclipse.papyrus.java.profile.editor", + 0, + getString("_UI_CreateModelError_message", resource.getURI()), + new Object[] { exception }); + } + else { + return Diagnostic.OK_INSTANCE; + } + } + + /** + * This is the method used by the framework to install your own controls. + * + * + * + * @generated + */ + @Override + public void createPages() { + // Creates the model from the editor input + // + createModel(); + + // Only creates the other pages if there is something that can be edited + // + if (!getEditingDomain().getResourceSet().getResources().isEmpty()) { + // Create a page for the selection tree view. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), JavaEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + Tree tree = new Tree(composite, SWT.MULTI); + TreeViewer newTreeViewer = new TreeViewer(tree); + return newTreeViewer; + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + selectionViewer = (TreeViewer) viewerPane.getViewer(); + selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + + selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + selectionViewer.setInput(editingDomain.getResourceSet()); + selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); + viewerPane.setTitle(editingDomain.getResourceSet()); + + new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); + + createContextMenuFor(selectionViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_SelectionPage_label")); + } + + // Create a page for the parent tree view. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), JavaEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + Tree tree = new Tree(composite, SWT.MULTI); + TreeViewer newTreeViewer = new TreeViewer(tree); + return newTreeViewer; + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + parentViewer = (TreeViewer) viewerPane.getViewer(); + parentViewer.setAutoExpandLevel(30); + parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory)); + parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(parentViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_ParentPage_label")); + } + + // This is the page for the list viewer + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), JavaEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new ListViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + listViewer = (ListViewer) viewerPane.getViewer(); + listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(listViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_ListPage_label")); + } + + // This is the page for the tree viewer + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), JavaEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TreeViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + treeViewer = (TreeViewer) viewerPane.getViewer(); + treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory); + + createContextMenuFor(treeViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TreePage_label")); + } + + // This is the page for the table viewer. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), JavaEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TableViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + tableViewer = (TableViewer) viewerPane.getViewer(); + + Table table = tableViewer.getTable(); + TableLayout layout = new TableLayout(); + table.setLayout(layout); + table.setHeaderVisible(true); + table.setLinesVisible(true); + + TableColumn objectColumn = new TableColumn(table, SWT.NONE); + layout.addColumnData(new ColumnWeightData(3, 100, true)); + objectColumn.setText(getString("_UI_ObjectColumn_label")); + objectColumn.setResizable(true); + + TableColumn selfColumn = new TableColumn(table, SWT.NONE); + layout.addColumnData(new ColumnWeightData(2, 100, true)); + selfColumn.setText(getString("_UI_SelfColumn_label")); + selfColumn.setResizable(true); + + tableViewer.setColumnProperties(new String[] { "a", "b" }); + tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(tableViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TablePage_label")); + } + + // This is the page for the table tree viewer. + // + { + ViewerPane viewerPane = + new ViewerPane(getSite().getPage(), JavaEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TreeViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + treeViewerWithColumns = (TreeViewer) viewerPane.getViewer(); + + Tree tree = treeViewerWithColumns.getTree(); + tree.setLayoutData(new FillLayout()); + tree.setHeaderVisible(true); + tree.setLinesVisible(true); + + TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE); + objectColumn.setText(getString("_UI_ObjectColumn_label")); + objectColumn.setResizable(true); + objectColumn.setWidth(250); + + TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE); + selfColumn.setText(getString("_UI_SelfColumn_label")); + selfColumn.setResizable(true); + selfColumn.setWidth(200); + + treeViewerWithColumns.setColumnProperties(new String[] { "a", "b" }); + treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(treeViewerWithColumns); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); + } + + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + setActivePage(0); + } + }); + } + + // Ensures that this editor will only display the page's tab + // area if there are more than one page + // + getContainer().addControlListener + (new ControlAdapter() { + boolean guard = false; + + @Override + public void controlResized(ControlEvent event) { + if (!guard) { + guard = true; + hideTabs(); + guard = false; + } + } + }); + + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + updateProblemIndication(); + } + }); + } + + /** + * If there is just one page in the multi-page editor part, + * this hides the single tab at the bottom. + * + * + * + * @generated + */ + protected void hideTabs() { + if (getPageCount() <= 1) { + setPageText(0, ""); + if (getContainer() instanceof CTabFolder) { + ((CTabFolder) getContainer()).setTabHeight(1); + Point point = getContainer().getSize(); + getContainer().setSize(point.x, point.y + 6); + } + } + } + + /** + * If there is more than one page in the multi-page editor part, + * this shows the tabs at the bottom. + * + * + * + * @generated + */ + protected void showTabs() { + if (getPageCount() > 1) { + setPageText(0, getString("_UI_SelectionPage_label")); + if (getContainer() instanceof CTabFolder) { + ((CTabFolder) getContainer()).setTabHeight(SWT.DEFAULT); + Point point = getContainer().getSize(); + getContainer().setSize(point.x, point.y - 6); + } + } + } + + /** + * This is used to track the active viewer. + * + * + * + * @generated + */ + @Override + protected void pageChange(int pageIndex) { + super.pageChange(pageIndex); + + if (contentOutlinePage != null) { + handleContentOutlineSelection(contentOutlinePage.getSelection()); + } + } + + /** + * This is how the framework determines which interfaces we implement. + * + * + * + * @generated + */ + @SuppressWarnings("rawtypes") + @Override + public Object getAdapter(Class key) { + if (key.equals(IContentOutlinePage.class)) { + return showOutlineView() ? getContentOutlinePage() : null; + } + else if (key.equals(IPropertySheetPage.class)) { + return getPropertySheetPage(); + } + else if (key.equals(IGotoMarker.class)) { + return this; + } + else { + return super.getAdapter(key); + } + } + + /** + * This accesses a cached version of the content outliner. + * + * + * + * @generated + */ + public IContentOutlinePage getContentOutlinePage() { + if (contentOutlinePage == null) { + // The content outline is just a tree. + // + class MyContentOutlinePage extends ContentOutlinePage { + @Override + public void createControl(Composite parent) { + super.createControl(parent); + contentOutlineViewer = getTreeViewer(); + contentOutlineViewer.addSelectionChangedListener(this); + + // Set up the tree viewer. + // + contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + contentOutlineViewer.setInput(editingDomain.getResourceSet()); + + // Make sure our popups work. + // + createContextMenuFor(contentOutlineViewer); + + if (!editingDomain.getResourceSet().getResources().isEmpty()) { + // Select the root object in the view. + // + contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); + } + } + + @Override + public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { + super.makeContributions(menuManager, toolBarManager, statusLineManager); + contentOutlineStatusLineManager = statusLineManager; + } + + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + } + + contentOutlinePage = new MyContentOutlinePage(); + + // Listen to selection so that we can handle it is a special way. + // + contentOutlinePage.addSelectionChangedListener + (new ISelectionChangedListener() { + // This ensures that we handle selections correctly. + // + @Override + public void selectionChanged(SelectionChangedEvent event) { + handleContentOutlineSelection(event.getSelection()); + } + }); + } + + return contentOutlinePage; + } + + /** + * This accesses a cached version of the property sheet. + * + * + * + * @generated + */ + public IPropertySheetPage getPropertySheetPage() { + if (propertySheetPage == null) { + propertySheetPage = + new ExtendedPropertySheetPage(editingDomain) { + @Override + public void setSelectionToViewer(List selection) { + JavaEditor.this.setSelectionToViewer(selection); + JavaEditor.this.setFocus(); + } + + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + }; + propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); + } + + return propertySheetPage; + } + + /** + * This deals with how we want selection in the outliner to affect the other views. + * + * + * + * @generated + */ + public void handleContentOutlineSelection(ISelection selection) { + if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) { + Iterator selectedElements = ((IStructuredSelection) selection).iterator(); + if (selectedElements.hasNext()) { + // Get the first selected element. + // + Object selectedElement = selectedElements.next(); + + // If it's the selection viewer, then we want it to select the same selection as this selection. + // + if (currentViewerPane.getViewer() == selectionViewer) { + ArrayList selectionList = new ArrayList(); + selectionList.add(selectedElement); + while (selectedElements.hasNext()) { + selectionList.add(selectedElements.next()); + } + + // Set the selection to the widget. + // + selectionViewer.setSelection(new StructuredSelection(selectionList)); + } + else { + // Set the input to the widget. + // + if (currentViewerPane.getViewer().getInput() != selectedElement) { + currentViewerPane.getViewer().setInput(selectedElement); + currentViewerPane.setTitle(selectedElement); + } + } + } + } + } + + /** + * This is for implementing {@link IEditorPart} and simply tests the command stack. + * + * + * + * @generated + */ + @Override + public boolean isDirty() { + return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded(); + } + + /** + * This is for implementing {@link IEditorPart} and simply saves the model file. + * + * + * + * @generated + */ + @Override + public void doSave(IProgressMonitor progressMonitor) { + // Save only resources that have actually changed. + // + final Map saveOptions = new HashMap(); + saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); + + // Do the work within an operation because this is a long running activity that modifies the workbench. + // + WorkspaceModifyOperation operation = + new WorkspaceModifyOperation() { + // This is the method that gets invoked when the operation runs. + // + @Override + public void execute(IProgressMonitor monitor) { + // Save the resources to the file system. + // + boolean first = true; + for (Resource resource : editingDomain.getResourceSet().getResources()) { + if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) { + try { + long timeStamp = resource.getTimeStamp(); + resource.save(saveOptions); + if (resource.getTimeStamp() != timeStamp) { + savedResources.add(resource); + } + } + catch (Exception exception) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + first = false; + } + } + } + }; + + updateProblemIndication = false; + try { + // This runs the options, and shows progress. + // + new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation); + + // Refresh the necessary state. + // + ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone(); + firePropertyChange(IEditorPart.PROP_DIRTY); + } catch (Exception exception) { + // Something went wrong that shouldn't. + // + JavaEditorPlugin.INSTANCE.log(exception); + } + updateProblemIndication = true; + updateProblemIndication(); + } + + /** + * This returns whether something has been persisted to the URI of the specified resource. + * The implementation uses the URI converter from the editor's resource set to try to open an input stream. + * + * + * + * @generated + */ + protected boolean isPersisted(Resource resource) { + boolean result = false; + try { + InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI()); + if (stream != null) { + result = true; + stream.close(); + } + } catch (IOException e) { + // Ignore + } + return result; + } + + /** + * This always returns true because it is not currently supported. + * + * + * + * @generated + */ + @Override + public boolean isSaveAsAllowed() { + return true; + } + + /** + * This also changes the editor's input. + * + * + * + * @generated + */ + @Override + public void doSaveAs() { + SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); + saveAsDialog.open(); + IPath path = saveAsDialog.getResult(); + if (path != null) { + IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); + if (file != null) { + doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); + } + } + } + + /** + * + * + * + * @generated + */ + protected void doSaveAs(URI uri, IEditorInput editorInput) { + (editingDomain.getResourceSet().getResources().get(0)).setURI(uri); + setInputWithNotify(editorInput); + setPartName(editorInput.getName()); + IProgressMonitor progressMonitor = + getActionBars().getStatusLineManager() != null ? + getActionBars().getStatusLineManager().getProgressMonitor() : + new NullProgressMonitor(); + doSave(progressMonitor); + } + + /** + * + * + * + * @generated + */ + @Override + public void gotoMarker(IMarker marker) { + try { + if (marker.getType().equals(EValidator.MARKER)) { + String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null); + if (uriAttribute != null) { + URI uri = URI.createURI(uriAttribute); + EObject eObject = editingDomain.getResourceSet().getEObject(uri, true); + if (eObject != null) { + setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject))); + } + } + } + } catch (CoreException exception) { + JavaEditorPlugin.INSTANCE.log(exception); + } + } + + /** + * This is called during startup. + * + * + * + * @generated + */ + @Override + public void init(IEditorSite site, IEditorInput editorInput) { + setSite(site); + setInputWithNotify(editorInput); + setPartName(editorInput.getName()); + site.setSelectionProvider(this); + site.getPage().addPartListener(partListener); + ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE); + } + + /** + * + * + * + * @generated + */ + @Override + public void setFocus() { + if (currentViewerPane != null) { + currentViewerPane.setFocus(); + } + else { + getControl(getActivePage()).setFocus(); + } + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * + * @generated + */ + @Override + public void addSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.add(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * + * @generated + */ + @Override + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.remove(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. + * + * + * + * @generated + */ + @Override + public ISelection getSelection() { + return editorSelection; + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection. + * Calling this result will notify the listeners. + * + * + * + * @generated + */ + @Override + public void setSelection(ISelection selection) { + editorSelection = selection; + + for (ISelectionChangedListener listener : selectionChangedListeners) { + listener.selectionChanged(new SelectionChangedEvent(this, selection)); + } + setStatusLineManager(selection); + } + + /** + * + * + * + * @generated + */ + public void setStatusLineManager(ISelection selection) { + IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ? + contentOutlineStatusLineManager : getActionBars().getStatusLineManager(); + + if (statusLineManager != null) { + if (selection instanceof IStructuredSelection) { + Collection collection = ((IStructuredSelection) selection).toList(); + switch (collection.size()) { + case 0: { + statusLineManager.setMessage(getString("_UI_NoObjectSelected")); + break; + } + case 1: { + String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next()); + statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); + break; + } + default: { + statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); + break; + } + } + } + else { + statusLineManager.setMessage(""); + } + } + } + + /** + * This looks up a string in the plugin's plugin.properties file. + * + * + * + * @generated + */ + private static String getString(String key) { + return JavaEditorPlugin.INSTANCE.getString(key); + } + + /** + * This looks up a string in plugin.properties, making a substitution. + * + * + * + * @generated + */ + private static String getString(String key, Object s1) { + return JavaEditorPlugin.INSTANCE.getString(key, new Object[] { s1 }); + } + + /** + * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu. + * + * + * + * @generated + */ + @Override + public void menuAboutToShow(IMenuManager menuManager) { + ((IMenuListener) getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); + } + + /** + * + * + * + * @generated + */ + public EditingDomainActionBarContributor getActionBarContributor() { + return (EditingDomainActionBarContributor) getEditorSite().getActionBarContributor(); + } + + /** + * + * + * + * @generated + */ + public IActionBars getActionBars() { + return getActionBarContributor().getActionBars(); + } + + /** + * + * + * + * @generated + */ + public AdapterFactory getAdapterFactory() { + return adapterFactory; + } + + /** + * + * + * + * @generated + */ + @Override + public void dispose() { + updateProblemIndication = false; + + ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); + + getSite().getPage().removePartListener(partListener); + + adapterFactory.dispose(); + + if (getActionBarContributor().getActiveEditor() == this) { + getActionBarContributor().setActiveEditor(null); + } + + if (propertySheetPage != null) { + propertySheetPage.dispose(); + } + + if (contentOutlinePage != null) { + contentOutlinePage.dispose(); + } + + super.dispose(); + } + + /** + * Returns whether the outline view should be presented to the user. + * + * + * + * @generated + */ + protected boolean showOutlineView() { + return true; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditorPlugin.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditorPlugin.java new file mode 100644 index 00000000000..9db89df6630 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaEditorPlugin.java @@ -0,0 +1,104 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.presentation; + +import org.eclipse.emf.common.EMFPlugin; +import org.eclipse.emf.common.ui.EclipseUIPlugin; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.provider.EcoreEditPlugin; +import org.eclipse.uml2.uml.edit.UMLEditPlugin; + +/** + * This is the central singleton for the Java editor plugin. + * + * + * + * @generated + */ +public final class JavaEditorPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * + * @generated + */ + public static final JavaEditorPlugin INSTANCE = new JavaEditorPlugin(); + + /** + * Keep track of the singleton. + * + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * + * @generated + */ + public JavaEditorPlugin() { + super(new ResourceLocator[] { + UMLEditPlugin.INSTANCE, + EcoreEditPlugin.INSTANCE, + }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * + * @generated + */ + public static class Implementation extends EclipseUIPlugin { + /** + * Creates an instance. + * + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaModelWizard.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaModelWizard.java new file mode 100644 index 00000000000..8a22e9e9187 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor/src/org/eclipse/papyrus/java/profile/java/presentation/JavaModelWizard.java @@ -0,0 +1,640 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.presentation; + + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.MissingResourceException; +import java.util.StringTokenizer; + +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.emf.common.CommonPlugin; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.papyrus.java.profile.java.JavaFactory; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.provider.JavaEditPlugin; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.INewWizard; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.actions.WorkspaceModifyOperation; +import org.eclipse.ui.dialogs.WizardNewFileCreationPage; +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.ISetSelectionTarget; + + +/** + * This is a simple wizard for creating a new model file. + * + * + * + * @generated + */ +public class JavaModelWizard extends Wizard implements INewWizard { + /** + * The supported extensions for created files. + * + * + * + * @generated + */ + public static final List FILE_EXTENSIONS = + Collections.unmodifiableList(Arrays.asList(JavaEditorPlugin.INSTANCE.getString("_UI_JavaEditorFilenameExtensions").split("\\s*,\\s*"))); + + /** + * A formatted list of supported file extensions, suitable for display. + * + * + * + * @generated + */ + public static final String FORMATTED_FILE_EXTENSIONS = + JavaEditorPlugin.INSTANCE.getString("_UI_JavaEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); + + /** + * This caches an instance of the model package. + * + * + * + * @generated + */ + protected JavaPackage javaPackage = JavaPackage.eINSTANCE; + + /** + * This caches an instance of the model factory. + * + * + * + * @generated + */ + protected JavaFactory javaFactory = javaPackage.getJavaFactory(); + + /** + * This is the file creation page. + * + * + * + * @generated + */ + protected JavaModelWizardNewFileCreationPage newFileCreationPage; + + /** + * This is the initial object creation page. + * + * + * + * @generated + */ + protected JavaModelWizardInitialObjectCreationPage initialObjectCreationPage; + + /** + * Remember the selection during initialization for populating the default container. + * + * + * + * @generated + */ + protected IStructuredSelection selection; + + /** + * Remember the workbench during initialization. + * + * + * + * @generated + */ + protected IWorkbench workbench; + + /** + * Caches the names of the types that can be created as the root object. + * + * + * + * @generated + */ + protected List initialObjectNames; + + /** + * This just records the information. + * + * + * + * @generated + */ + @Override + public void init(IWorkbench workbench, IStructuredSelection selection) { + this.workbench = workbench; + this.selection = selection; + setWindowTitle(JavaEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(JavaEditorPlugin.INSTANCE.getImage("full/wizban/NewJava"))); + } + + /** + * Returns the names of the types that can be created as the root object. + * + * + * + * @generated + */ + protected Collection getInitialObjectNames() { + if (initialObjectNames == null) { + initialObjectNames = new ArrayList(); + for (EClassifier eClassifier : javaPackage.getEClassifiers()) { + if (eClassifier instanceof EClass) { + EClass eClass = (EClass) eClassifier; + if (!eClass.isAbstract()) { + initialObjectNames.add(eClass.getName()); + } + } + } + Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator()); + } + return initialObjectNames; + } + + /** + * Create a new model. + * + * + * + * @generated + */ + protected EObject createInitialModel() { + EClass eClass = (EClass) javaPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); + EObject rootObject = javaFactory.create(eClass); + return rootObject; + } + + /** + * Do the work after everything is specified. + * + * + * + * @generated + */ + @Override + public boolean performFinish() { + try { + // Remember the file. + // + final IFile modelFile = getModelFile(); + + // Do the work within an operation. + // + WorkspaceModifyOperation operation = + new WorkspaceModifyOperation() { + @Override + protected void execute(IProgressMonitor progressMonitor) { + try { + // Create a resource set + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Get the URI of the model file. + // + URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true); + + // Create a resource for this file. + // + Resource resource = resourceSet.createResource(fileURI); + + // Add the initial model object to the contents. + // + EObject rootObject = createInitialModel(); + if (rootObject != null) { + resource.getContents().add(rootObject); + } + + // Save the contents of the resource to the file system. + // + Map options = new HashMap(); + options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding()); + resource.save(options); + } + catch (Exception exception) { + JavaEditorPlugin.INSTANCE.log(exception); + } + finally { + progressMonitor.done(); + } + } + }; + + getContainer().run(false, false, operation); + + // Select the new file resource in the current view. + // + IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); + IWorkbenchPage page = workbenchWindow.getActivePage(); + final IWorkbenchPart activePart = page.getActivePart(); + if (activePart instanceof ISetSelectionTarget) { + final ISelection targetSelection = new StructuredSelection(modelFile); + getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + ((ISetSelectionTarget) activePart).selectReveal(targetSelection); + } + }); + } + + // Open an editor on the new file. + // + try { + page.openEditor + (new FileEditorInput(modelFile), + workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId()); + } catch (PartInitException exception) { + MessageDialog.openError(workbenchWindow.getShell(), JavaEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); + return false; + } + + return true; + } catch (Exception exception) { + JavaEditorPlugin.INSTANCE.log(exception); + return false; + } + } + + /** + * This is the one page of the wizard. + * + * + * + * @generated + */ + public class JavaModelWizardNewFileCreationPage extends WizardNewFileCreationPage { + /** + * Pass in the selection. + * + * + * + * @generated + */ + public JavaModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) { + super(pageId, selection); + } + + /** + * The framework calls this to see if the file is correct. + * + * + * + * @generated + */ + @Override + protected boolean validatePage() { + if (super.validatePage()) { + String extension = new Path(getFileName()).getFileExtension(); + if (extension == null || !FILE_EXTENSIONS.contains(extension)) { + String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; + setErrorMessage(JavaEditorPlugin.INSTANCE.getString(key, new Object[] { FORMATTED_FILE_EXTENSIONS })); + return false; + } + return true; + } + return false; + } + + /** + * + * + * + * @generated + */ + public IFile getModelFile() { + return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName())); + } + } + + /** + * This is the page where the type of object to create is selected. + * + * + * + * @generated + */ + public class JavaModelWizardInitialObjectCreationPage extends WizardPage { + /** + * + * + * + * @generated + */ + protected Combo initialObjectField; + + /** + * @generated + * + * + */ + protected List encodings; + + /** + * + * + * + * @generated + */ + protected Combo encodingField; + + /** + * Pass in the selection. + * + * + * + * @generated + */ + public JavaModelWizardInitialObjectCreationPage(String pageId) { + super(pageId); + } + + /** + * + * + * + * @generated + */ + @Override + public void createControl(Composite parent) { + Composite composite = new Composite(parent, SWT.NONE); + { + GridLayout layout = new GridLayout(); + layout.numColumns = 1; + layout.verticalSpacing = 12; + composite.setLayout(layout); + + GridData data = new GridData(); + data.verticalAlignment = GridData.FILL; + data.grabExcessVerticalSpace = true; + data.horizontalAlignment = GridData.FILL; + composite.setLayoutData(data); + } + + Label containerLabel = new Label(composite, SWT.LEFT); + { + containerLabel.setText(JavaEditorPlugin.INSTANCE.getString("_UI_ModelObject")); + + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + containerLabel.setLayoutData(data); + } + + initialObjectField = new Combo(composite, SWT.BORDER); + { + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + data.grabExcessHorizontalSpace = true; + initialObjectField.setLayoutData(data); + } + + for (String objectName : getInitialObjectNames()) { + initialObjectField.add(getLabel(objectName)); + } + + if (initialObjectField.getItemCount() == 1) { + initialObjectField.select(0); + } + initialObjectField.addModifyListener(validator); + + Label encodingLabel = new Label(composite, SWT.LEFT); + { + encodingLabel.setText(JavaEditorPlugin.INSTANCE.getString("_UI_XMLEncoding")); + + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + encodingLabel.setLayoutData(data); + } + encodingField = new Combo(composite, SWT.BORDER); + { + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + data.grabExcessHorizontalSpace = true; + encodingField.setLayoutData(data); + } + + for (String encoding : getEncodings()) { + encodingField.add(encoding); + } + + encodingField.select(0); + encodingField.addModifyListener(validator); + + setPageComplete(validatePage()); + setControl(composite); + } + + /** + * + * + * + * @generated + */ + protected ModifyListener validator = + new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + setPageComplete(validatePage()); + } + }; + + /** + * + * + * + * @generated + */ + protected boolean validatePage() { + return getInitialObjectName() != null && getEncodings().contains(encodingField.getText()); + } + + /** + * + * + * + * @generated + */ + @Override + public void setVisible(boolean visible) { + super.setVisible(visible); + if (visible) { + if (initialObjectField.getItemCount() == 1) { + initialObjectField.clearSelection(); + encodingField.setFocus(); + } + else { + encodingField.clearSelection(); + initialObjectField.setFocus(); + } + } + } + + /** + * + * + * + * @generated + */ + public String getInitialObjectName() { + String label = initialObjectField.getText(); + + for (String name : getInitialObjectNames()) { + if (getLabel(name).equals(label)) { + return name; + } + } + return null; + } + + /** + * + * + * + * @generated + */ + public String getEncoding() { + return encodingField.getText(); + } + + /** + * Returns the label for the specified type name. + * + * + * + * @generated + */ + protected String getLabel(String typeName) { + try { + return JavaEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); + } catch (MissingResourceException mre) { + JavaEditorPlugin.INSTANCE.log(mre); + } + return typeName; + } + + /** + * + * + * + * @generated + */ + protected Collection getEncodings() { + if (encodings == null) { + encodings = new ArrayList(); + for (StringTokenizer stringTokenizer = new StringTokenizer(JavaEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens();) { + encodings.add(stringTokenizer.nextToken()); + } + } + return encodings; + } + } + + /** + * The framework calls this to create the contents of the wizard. + * + * + * + * @generated + */ + @Override + public void addPages() { + // Create a page, set the title, and the initial model file name. + // + newFileCreationPage = new JavaModelWizardNewFileCreationPage("Whatever", selection); + newFileCreationPage.setTitle(JavaEditorPlugin.INSTANCE.getString("_UI_JavaModelWizard_label")); + newFileCreationPage.setDescription(JavaEditorPlugin.INSTANCE.getString("_UI_JavaModelWizard_description")); + newFileCreationPage.setFileName(JavaEditorPlugin.INSTANCE.getString("_UI_JavaEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0)); + addPage(newFileCreationPage); + + // Try and get the resource selection to determine a current directory for the file dialog. + // + if (selection != null && !selection.isEmpty()) { + // Get the resource... + // + Object selectedElement = selection.iterator().next(); + if (selectedElement instanceof IResource) { + // Get the resource parent, if its a file. + // + IResource selectedResource = (IResource) selectedElement; + if (selectedResource.getType() == IResource.FILE) { + selectedResource = selectedResource.getParent(); + } + + // This gives us a directory... + // + if (selectedResource instanceof IFolder || selectedResource instanceof IProject) { + // Set this for the container. + // + newFileCreationPage.setContainerFullPath(selectedResource.getFullPath()); + + // Make up a unique new name here. + // + String defaultModelBaseFilename = JavaEditorPlugin.INSTANCE.getString("_UI_JavaEditorFilenameDefaultBase"); + String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0); + String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; + for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) { + modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; + } + newFileCreationPage.setFileName(modelFilename); + } + } + } + initialObjectCreationPage = new JavaModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage.setTitle(JavaEditorPlugin.INSTANCE.getString("_UI_JavaModelWizard_label")); + initialObjectCreationPage.setDescription(JavaEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description")); + addPage(initialObjectCreationPage); + } + + /** + * Get the file from the page. + * + * + * + * @generated + */ + public IFile getModelFile() { + return newFileCreationPage.getModelFile(); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.classpath b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.project b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.project new file mode 100644 index 00000000000..f90e9a5b55b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.java.profile + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..1cd3c3071ad --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/META-INF/MANIFEST.MF @@ -0,0 +1,17 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.eclipse.uml2.uml;visibility:=reexport +Export-Package: org.eclipse.papyrus.java.profile.java, + org.eclipse.papyrus.java.profile.java.impl, + org.eclipse.papyrus.java.profile.java.util +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.java.profile;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/about.html b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/build.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/build.properties new file mode 100644 index 00000000000..a3690e680da --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/build.properties @@ -0,0 +1,17 @@ + +# +# +# +# $Id$ + +bin.includes = .,\ + models/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties,\ + icons/,\ + about.html +jars.compile.order = . +source.. = src/ +output.. = bin/ +src.includes = about.html diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/icons/javaprofile.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/icons/javaprofile.gif new file mode 100644 index 00000000000..34fb3c9d8cb Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/icons/javaprofile.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.ecore b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.ecore new file mode 100644 index 00000000000..f2ce423a3eb --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.ecore @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.di b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.di new file mode 100644 index 00000000000..61e2f6a31f3 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.di @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.genmodel b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.genmodel new file mode 100644 index 00000000000..c2f4684879d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.genmodel @@ -0,0 +1,105 @@ + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + java.profile.uml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.notation b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.notation new file mode 100644 index 00000000000..a5335966efb --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.notation @@ -0,0 +1,821 @@ + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.uml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.uml new file mode 100644 index 00000000000..9aff0b63659 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/models/java.profile.uml @@ -0,0 +1,5729 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The implementation class to use when this primitive type is encountered with a cardinality greater than 1. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/plugin.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/plugin.properties new file mode 100644 index 00000000000..bc49c812cb7 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/plugin.properties @@ -0,0 +1,16 @@ + +################################################################################# +# Copyright (c) 2011-2013 Cedric Dumoulin. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API +# +################################################################################# + +pluginName = Profile for Java classes generation (Incubation) +providerName = Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/plugin.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/plugin.xml new file mode 100644 index 00000000000..9ebf9f7c10b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/plugin.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/pom.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/pom.xml new file mode 100644 index 00000000000..4a12fdfdbb7 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.java.profile + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaClass.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaClass.java new file mode 100644 index 00000000000..86b0fc45fd6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaClass.java @@ -0,0 +1,209 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.uml2.uml.Classifier; + +/** + * + * A representation of the model object 'Class'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaClass#getBase_Classifier Base Classifier}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaClass#isFinal Is Final}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaClass#isAbstract Is Abstract}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaClass#isStatic Is Static}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaClass#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaClass#getExplicitRequiredImports Explicit Required Imports}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass() + * @model + * @generated + */ +public interface JavaClass extends JavaGen { + /** + * Returns the value of the 'Base Classifier' reference. + * + *

    + * If the meaning of the 'Base Classifier' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Base Classifier' reference. + * @see #setBase_Classifier(Classifier) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass_Base_Classifier() + * @model required="true" ordered="false" + * @generated + */ + Classifier getBase_Classifier(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaClass#getBase_Classifier Base Classifier}' reference. + * + * + * + * @param value + * the new value of the 'Base Classifier' reference. + * @see #getBase_Classifier() + * @generated + */ + void setBase_Classifier(Classifier value); + + /** + * Returns the value of the 'Is Final' attribute. + * + *

    + * If the meaning of the 'Is Final' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Final' attribute. + * @see #setIsFinal(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass_IsFinal() + * @model unique="false" required="true" ordered="false" + * @generated + */ + boolean isFinal(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaClass#isFinal Is Final}' attribute. + * + * + * + * @param value + * the new value of the 'Is Final' attribute. + * @see #isFinal() + * @generated + */ + void setIsFinal(boolean value); + + /** + * Returns the value of the 'Is Abstract' attribute. + * + *

    + * If the meaning of the 'Is Abstract' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Abstract' attribute. + * @see #setIsAbstract(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass_IsAbstract() + * @model unique="false" required="true" ordered="false" + * @generated + */ + boolean isAbstract(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaClass#isAbstract Is Abstract}' attribute. + * + * + * + * @param value + * the new value of the 'Is Abstract' attribute. + * @see #isAbstract() + * @generated + */ + void setIsAbstract(boolean value); + + /** + * Returns the value of the 'Is Static' attribute. + * + *

    + * If the meaning of the 'Is Static' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Static' attribute. + * @see #setIsStatic(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass_IsStatic() + * @model unique="false" required="true" ordered="false" + * @generated + */ + boolean isStatic(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaClass#isStatic Is Static}' attribute. + * + * + * + * @param value + * the new value of the 'Is Static' attribute. + * @see #isStatic() + * @generated + */ + void setIsStatic(boolean value); + + /** + * Returns the value of the 'Explicit Plain Text Required Imports' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

    + * If the meaning of the 'Explicit Plain Text Required Imports' attribute list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Explicit Plain Text Required Imports' attribute list. + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass_ExplicitPlainTextRequiredImports() + * @model unique="false" ordered="false" + * @generated + */ + EList getExplicitPlainTextRequiredImports(); + + /** + * Returns the value of the 'Explicit Required Imports' reference list. + * The list contents are of type {@link org.eclipse.uml2.uml.Classifier}. + * + *

    + * If the meaning of the 'Explicit Required Imports' reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Explicit Required Imports' reference list. + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaClass_ExplicitRequiredImports() + * @model ordered="false" + * @generated + */ + EList getExplicitRequiredImports(); + + /** + * Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name' from the 'Explicit Required Imports' reference list. + * + * + * + * @param name + * The 'Name' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. + * @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name', or null. + * @see #getExplicitRequiredImports() + * @generated + */ + Classifier getExplicitRequiredImports(String name); + + /** + * Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name' from the 'Explicit Required Imports' reference list. + * + * + * + * @param name + * The 'Name' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. + * @param ignoreCase + * Whether to ignore case in {@link java.lang.String} comparisons. + * @param eClass + * The Ecore class of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. + * @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name', or null. + * @see #getExplicitRequiredImports() + * @generated + */ + Classifier getExplicitRequiredImports(String name, boolean ignoreCase, EClass eClass); + +} // JavaClass diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaFactory.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaFactory.java new file mode 100644 index 00000000000..6adbd7ca301 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaFactory.java @@ -0,0 +1,120 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage + * @generated + */ +public interface JavaFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * + * @generated + */ + JavaFactory eINSTANCE = org.eclipse.papyrus.java.profile.java.impl.JavaFactoryImpl.init(); + + /** + * Returns a new object of class 'Class'. + * + * + * + * @return a new object of class 'Class'. + * @generated + */ + JavaClass createJavaClass(); + + /** + * Returns a new object of class 'Package '. + * + * + * + * @return a new object of class 'Package '. + * @generated + */ + JavaPackage_ createJavaPackage_(); + + /** + * Returns a new object of class 'Method'. + * + * + * + * @return a new object of class 'Method'. + * @generated + */ + JavaMethod createJavaMethod(); + + /** + * Returns a new object of class 'Parameter'. + * + * + * + * @return a new object of class 'Parameter'. + * @generated + */ + JavaParameter createJavaParameter(); + + /** + * Returns a new object of class 'Property'. + * + * + * + * @return a new object of class 'Property'. + * @generated + */ + JavaProperty createJavaProperty(); + + /** + * Returns a new object of class 'Primitive Type'. + * + * + * + * @return a new object of class 'Primitive Type'. + * @generated + */ + PrimitiveType createPrimitiveType(); + + /** + * Returns a new object of class 'Project'. + * + * + * + * @return a new object of class 'Project'. + * @generated + */ + JavaProject createJavaProject(); + + /** + * Returns a new object of class 'Src Folder'. + * + * + * + * @return a new object of class 'Src Folder'. + * @generated + */ + JavaSrcFolder createJavaSrcFolder(); + + /** + * Returns the package supported by this factory. + * + * + * + * @return the package supported by this factory. + * @generated + */ + JavaPackage getJavaPackage(); + +} // JavaFactory diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaGen.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaGen.java new file mode 100644 index 00000000000..a4342630684 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaGen.java @@ -0,0 +1,84 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java; + + +/** + * + * A representation of the model object 'Gen'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaGen#getSrcName Src Name}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaGen#getProjectName Project Name}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaGen() + * @model abstract="true" + * @generated + */ +public interface JavaGen extends JavaNamedElement { + /** + * Returns the value of the 'Src Name' attribute. + * + *

    + * If the meaning of the 'Src Name' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Src Name' attribute. + * @see #setSrcName(String) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaGen_SrcName() + * @model unique="false" required="true" ordered="false" + * @generated + */ + String getSrcName(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaGen#getSrcName Src Name}' attribute. + * + * + * + * @param value + * the new value of the 'Src Name' attribute. + * @see #getSrcName() + * @generated + */ + void setSrcName(String value); + + /** + * Returns the value of the 'Project Name' attribute. + * + *

    + * If the meaning of the 'Project Name' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Project Name' attribute. + * @see #setProjectName(String) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaGen_ProjectName() + * @model unique="false" required="true" ordered="false" + * @generated + */ + String getProjectName(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaGen#getProjectName Project Name}' attribute. + * + * + * + * @param value + * the new value of the 'Project Name' attribute. + * @see #getProjectName() + * @generated + */ + void setProjectName(String value); + +} // JavaGen diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaMethod.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaMethod.java new file mode 100644 index 00000000000..b0230672d39 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaMethod.java @@ -0,0 +1,297 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Operation; + +/** + * + * A representation of the model object 'Method'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#isStatic Is Static}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#isFinal Is Final}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#isAbstract Is Abstract}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#isNative Is Native}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#isSynchronized Is Synchronized}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#isConstructor Is Constructor}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#getBase_Operation Base Operation}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaMethod#getExplicitRequiredImports Explicit Required Imports}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod() + * @model + * @generated + */ +public interface JavaMethod extends JavaNamedElement { + /** + * Returns the value of the 'Is Static' attribute. + * + *

    + * If the meaning of the 'Is Static' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Static' attribute. + * @see #setIsStatic(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_IsStatic() + * @model unique="false" required="true" ordered="false" + * @generated + */ + boolean isStatic(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isStatic Is Static}' attribute. + * + * + * + * @param value + * the new value of the 'Is Static' attribute. + * @see #isStatic() + * @generated + */ + void setIsStatic(boolean value); + + /** + * Returns the value of the 'Is Final' attribute. + * + *

    + * If the meaning of the 'Is Final' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Final' attribute. + * @see #setIsFinal(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_IsFinal() + * @model unique="false" required="true" ordered="false" + * @generated + */ + boolean isFinal(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isFinal Is Final}' attribute. + * + * + * + * @param value + * the new value of the 'Is Final' attribute. + * @see #isFinal() + * @generated + */ + void setIsFinal(boolean value); + + /** + * Returns the value of the 'Is Abstract' attribute. + * + *

    + * If the meaning of the 'Is Abstract' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Abstract' attribute. + * @see #setIsAbstract(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_IsAbstract() + * @model unique="false" required="true" ordered="false" + * @generated + */ + boolean isAbstract(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isAbstract Is Abstract}' attribute. + * + * + * + * @param value + * the new value of the 'Is Abstract' attribute. + * @see #isAbstract() + * @generated + */ + void setIsAbstract(boolean value); + + /** + * Returns the value of the 'Is Native' attribute. + * + *

    + * If the meaning of the 'Is Native' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Native' attribute. + * @see #setIsNative(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_IsNative() + * @model unique="false" required="true" ordered="false" + * @generated + */ + boolean isNative(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isNative Is Native}' attribute. + * + * + * + * @param value + * the new value of the 'Is Native' attribute. + * @see #isNative() + * @generated + */ + void setIsNative(boolean value); + + /** + * Returns the value of the 'Is Synchronized' attribute. + * + *

    + * If the meaning of the 'Is Synchronized' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Synchronized' attribute. + * @see #setIsSynchronized(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_IsSynchronized() + * @model unique="false" required="true" ordered="false" + * @generated + */ + boolean isSynchronized(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isSynchronized Is Synchronized}' attribute. + * + * + * + * @param value + * the new value of the 'Is Synchronized' attribute. + * @see #isSynchronized() + * @generated + */ + void setIsSynchronized(boolean value); + + /** + * Returns the value of the 'Is Constructor' attribute. + * + *

    + * If the meaning of the 'Is Constructor' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Constructor' attribute. + * @see #setIsConstructor(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_IsConstructor() + * @model unique="false" required="true" ordered="false" + * @generated + */ + boolean isConstructor(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isConstructor Is Constructor}' attribute. + * + * + * + * @param value + * the new value of the 'Is Constructor' attribute. + * @see #isConstructor() + * @generated + */ + void setIsConstructor(boolean value); + + /** + * Returns the value of the 'Base Operation' reference. + * + *

    + * If the meaning of the 'Base Operation' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Base Operation' reference. + * @see #setBase_Operation(Operation) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_Base_Operation() + * @model required="true" ordered="false" + * @generated + */ + Operation getBase_Operation(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#getBase_Operation Base Operation}' reference. + * + * + * + * @param value + * the new value of the 'Base Operation' reference. + * @see #getBase_Operation() + * @generated + */ + void setBase_Operation(Operation value); + + /** + * Returns the value of the 'Explicit Plain Text Required Imports' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

    + * If the meaning of the 'Explicit Plain Text Required Imports' attribute list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Explicit Plain Text Required Imports' attribute list. + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_ExplicitPlainTextRequiredImports() + * @model unique="false" ordered="false" + * @generated + */ + EList getExplicitPlainTextRequiredImports(); + + /** + * Returns the value of the 'Explicit Required Imports' reference list. + * The list contents are of type {@link org.eclipse.uml2.uml.Classifier}. + * + *

    + * If the meaning of the 'Explicit Required Imports' reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Explicit Required Imports' reference list. + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaMethod_ExplicitRequiredImports() + * @model ordered="false" + * @generated + */ + EList getExplicitRequiredImports(); + + /** + * Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name' from the 'Explicit Required Imports' reference list. + * + * + * + * @param name + * The 'Name' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. + * @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name', or null. + * @see #getExplicitRequiredImports() + * @generated + */ + Classifier getExplicitRequiredImports(String name); + + /** + * Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name' from the 'Explicit Required Imports' reference list. + * + * + * + * @param name + * The 'Name' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. + * @param ignoreCase + * Whether to ignore case in {@link java.lang.String} comparisons. + * @param eClass + * The Ecore class of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. + * @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name', or null. + * @see #getExplicitRequiredImports() + * @generated + */ + Classifier getExplicitRequiredImports(String name, boolean ignoreCase, EClass eClass); + +} // JavaMethod diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaNamedElement.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaNamedElement.java new file mode 100644 index 00000000000..0ae050419d3 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaNamedElement.java @@ -0,0 +1,173 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Named Element'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getName Name}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getAuthor Author}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getVersion Version}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getComment Comment}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#isGenerated Is Generated}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaNamedElement() + * @model abstract="true" + * @generated + */ +public interface JavaNamedElement extends EObject { + /** + * Returns the value of the 'Name' attribute. + * + *

    + * If the meaning of the 'Name' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaNamedElement_Name() + * @model unique="false" required="true" ordered="false" + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getName Name}' attribute. + * + * + * + * @param value + * the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Author' attribute. + * + *

    + * If the meaning of the 'Author' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Author' attribute. + * @see #setAuthor(String) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaNamedElement_Author() + * @model unique="false" required="true" ordered="false" + * @generated + */ + String getAuthor(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getAuthor Author}' attribute. + * + * + * + * @param value + * the new value of the 'Author' attribute. + * @see #getAuthor() + * @generated + */ + void setAuthor(String value); + + /** + * Returns the value of the 'Version' attribute. + * + *

    + * If the meaning of the 'Version' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Version' attribute. + * @see #setVersion(String) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaNamedElement_Version() + * @model unique="false" required="true" ordered="false" + * @generated + */ + String getVersion(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getVersion Version}' attribute. + * + * + * + * @param value + * the new value of the 'Version' attribute. + * @see #getVersion() + * @generated + */ + void setVersion(String value); + + /** + * Returns the value of the 'Comment' attribute. + * + *

    + * If the meaning of the 'Comment' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Comment' attribute. + * @see #setComment(String) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaNamedElement_Comment() + * @model unique="false" required="true" ordered="false" + * @generated + */ + String getComment(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getComment Comment}' attribute. + * + * + * + * @param value + * the new value of the 'Comment' attribute. + * @see #getComment() + * @generated + */ + void setComment(String value); + + /** + * Returns the value of the 'Is Generated' attribute. + * The default value is "true". + * + *

    + * If the meaning of the 'Is Generated' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Generated' attribute. + * @see #setIsGenerated(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaNamedElement_IsGenerated() + * @model default="true" unique="false" required="true" ordered="false" + * @generated + */ + boolean isGenerated(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#isGenerated Is Generated}' attribute. + * + * + * + * @param value + * the new value of the 'Is Generated' attribute. + * @see #isGenerated() + * @generated + */ + void setIsGenerated(boolean value); + +} // JavaNamedElement diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage.java new file mode 100644 index 00000000000..32e0cda8c6a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage.java @@ -0,0 +1,2348 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
      + *
    • each class,
    • + *
    • each feature of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * + * @see org.eclipse.papyrus.java.profile.java.JavaFactory + * @model kind="package" + * @generated + */ +public interface JavaPackage extends EPackage { + /** + * The package name. + * + * + * + * @generated + */ + String eNAME = "java"; + + /** + * The package namespace URI. + * + * + * + * @generated + */ + String eNS_URI = "http://www.eclipse.org/papyrus/JAVA/1"; + + /** + * The package namespace name. + * + * + * + * @generated + */ + String eNS_PREFIX = "java"; + + /** + * The singleton instance of the package. + * + * + * + * @generated + */ + JavaPackage eINSTANCE = org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl Named Element}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaNamedElement() + * @generated + */ + int JAVA_NAMED_ELEMENT = 2; + + /** + * The feature id for the 'Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_NAMED_ELEMENT__NAME = 0; + + /** + * The feature id for the 'Author' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_NAMED_ELEMENT__AUTHOR = 1; + + /** + * The feature id for the 'Version' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_NAMED_ELEMENT__VERSION = 2; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_NAMED_ELEMENT__COMMENT = 3; + + /** + * The feature id for the 'Is Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_NAMED_ELEMENT__IS_GENERATED = 4; + + /** + * The number of structural features of the 'Named Element' class. + * + * + * + * @generated + * @ordered + */ + int JAVA_NAMED_ELEMENT_FEATURE_COUNT = 5; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaGenImpl Gen}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaGenImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaGen() + * @generated + */ + int JAVA_GEN = 1; + + /** + * The feature id for the 'Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_GEN__NAME = JAVA_NAMED_ELEMENT__NAME; + + /** + * The feature id for the 'Author' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_GEN__AUTHOR = JAVA_NAMED_ELEMENT__AUTHOR; + + /** + * The feature id for the 'Version' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_GEN__VERSION = JAVA_NAMED_ELEMENT__VERSION; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_GEN__COMMENT = JAVA_NAMED_ELEMENT__COMMENT; + + /** + * The feature id for the 'Is Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_GEN__IS_GENERATED = JAVA_NAMED_ELEMENT__IS_GENERATED; + + /** + * The feature id for the 'Src Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_GEN__SRC_NAME = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Project Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_GEN__PROJECT_NAME = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Gen' class. + * + * + * + * @generated + * @ordered + */ + int JAVA_GEN_FEATURE_COUNT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl Class}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaClass() + * @generated + */ + int JAVA_CLASS = 0; + + /** + * The feature id for the 'Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS__NAME = JAVA_GEN__NAME; + + /** + * The feature id for the 'Author' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS__AUTHOR = JAVA_GEN__AUTHOR; + + /** + * The feature id for the 'Version' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS__VERSION = JAVA_GEN__VERSION; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS__COMMENT = JAVA_GEN__COMMENT; + + /** + * The feature id for the 'Is Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS__IS_GENERATED = JAVA_GEN__IS_GENERATED; + + /** + * The feature id for the 'Src Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS__SRC_NAME = JAVA_GEN__SRC_NAME; + + /** + * The feature id for the 'Project Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS__PROJECT_NAME = JAVA_GEN__PROJECT_NAME; + + /** + * The feature id for the 'Base Classifier' reference. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS__BASE_CLASSIFIER = JAVA_GEN_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Is Final' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS__IS_FINAL = JAVA_GEN_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Is Abstract' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS__IS_ABSTRACT = JAVA_GEN_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Is Static' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS__IS_STATIC = JAVA_GEN_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Explicit Plain Text Required Imports' attribute list. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JAVA_GEN_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Explicit Required Imports' reference list. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS = JAVA_GEN_FEATURE_COUNT + 5; + + /** + * The number of structural features of the 'Class' class. + * + * + * + * @generated + * @ordered + */ + int JAVA_CLASS_FEATURE_COUNT = JAVA_GEN_FEATURE_COUNT + 6; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaPackage_Impl Package }' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackage_Impl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaPackage_() + * @generated + */ + int JAVA_PACKAGE_ = 3; + + /** + * The feature id for the 'Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PACKAGE___NAME = JAVA_GEN__NAME; + + /** + * The feature id for the 'Author' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PACKAGE___AUTHOR = JAVA_GEN__AUTHOR; + + /** + * The feature id for the 'Version' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PACKAGE___VERSION = JAVA_GEN__VERSION; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PACKAGE___COMMENT = JAVA_GEN__COMMENT; + + /** + * The feature id for the 'Is Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PACKAGE___IS_GENERATED = JAVA_GEN__IS_GENERATED; + + /** + * The feature id for the 'Src Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PACKAGE___SRC_NAME = JAVA_GEN__SRC_NAME; + + /** + * The feature id for the 'Project Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PACKAGE___PROJECT_NAME = JAVA_GEN__PROJECT_NAME; + + /** + * The feature id for the 'Package Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PACKAGE___PACKAGE_NAME = JAVA_GEN_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Base Package' reference. + * + * + * + * @generated + * @ordered + */ + int JAVA_PACKAGE___BASE_PACKAGE = JAVA_GEN_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Package ' class. + * + * + * + * @generated + * @ordered + */ + int JAVA_PACKAGE__FEATURE_COUNT = JAVA_GEN_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl Method}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaMethod() + * @generated + */ + int JAVA_METHOD = 4; + + /** + * The feature id for the 'Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__NAME = JAVA_NAMED_ELEMENT__NAME; + + /** + * The feature id for the 'Author' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__AUTHOR = JAVA_NAMED_ELEMENT__AUTHOR; + + /** + * The feature id for the 'Version' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__VERSION = JAVA_NAMED_ELEMENT__VERSION; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__COMMENT = JAVA_NAMED_ELEMENT__COMMENT; + + /** + * The feature id for the 'Is Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__IS_GENERATED = JAVA_NAMED_ELEMENT__IS_GENERATED; + + /** + * The feature id for the 'Is Static' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__IS_STATIC = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Is Final' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__IS_FINAL = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Is Abstract' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__IS_ABSTRACT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Is Native' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__IS_NATIVE = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Is Synchronized' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__IS_SYNCHRONIZED = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Is Constructor' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__IS_CONSTRUCTOR = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Base Operation' reference. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__BASE_OPERATION = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Explicit Plain Text Required Imports' attribute list. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 7; + + /** + * The feature id for the 'Explicit Required Imports' reference list. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 8; + + /** + * The number of structural features of the 'Method' class. + * + * + * + * @generated + * @ordered + */ + int JAVA_METHOD_FEATURE_COUNT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 9; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaParameterImpl Parameter}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaParameterImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaParameter() + * @generated + */ + int JAVA_PARAMETER = 5; + + /** + * The feature id for the 'Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PARAMETER__NAME = JAVA_NAMED_ELEMENT__NAME; + + /** + * The feature id for the 'Author' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PARAMETER__AUTHOR = JAVA_NAMED_ELEMENT__AUTHOR; + + /** + * The feature id for the 'Version' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PARAMETER__VERSION = JAVA_NAMED_ELEMENT__VERSION; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PARAMETER__COMMENT = JAVA_NAMED_ELEMENT__COMMENT; + + /** + * The feature id for the 'Is Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PARAMETER__IS_GENERATED = JAVA_NAMED_ELEMENT__IS_GENERATED; + + /** + * The feature id for the 'Is Final' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PARAMETER__IS_FINAL = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Base Parameter' reference. + * + * + * + * @generated + * @ordered + */ + int JAVA_PARAMETER__BASE_PARAMETER = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Parameter' class. + * + * + * + * @generated + * @ordered + */ + int JAVA_PARAMETER_FEATURE_COUNT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl Property}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaProperty() + * @generated + */ + int JAVA_PROPERTY = 6; + + /** + * The feature id for the 'Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__NAME = JAVA_NAMED_ELEMENT__NAME; + + /** + * The feature id for the 'Author' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__AUTHOR = JAVA_NAMED_ELEMENT__AUTHOR; + + /** + * The feature id for the 'Version' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__VERSION = JAVA_NAMED_ELEMENT__VERSION; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__COMMENT = JAVA_NAMED_ELEMENT__COMMENT; + + /** + * The feature id for the 'Is Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__IS_GENERATED = JAVA_NAMED_ELEMENT__IS_GENERATED; + + /** + * The feature id for the 'Is Abstract' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__IS_ABSTRACT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Is Final' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__IS_FINAL = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Base Property' reference. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__BASE_PROPERTY = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Is Transient' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__IS_TRANSIENT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Generate Getter' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__GENERATE_GETTER = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Generate Setter' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__GENERATE_SETTER = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 5; + + /** + * The feature id for the 'Is Static' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__IS_STATIC = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 6; + + /** + * The feature id for the 'Explicit Plain Text Required Imports' attribute list. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 7; + + /** + * The feature id for the 'Explicit Required Imports' reference list. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 8; + + /** + * The number of structural features of the 'Property' class. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROPERTY_FEATURE_COUNT = JAVA_NAMED_ELEMENT_FEATURE_COUNT + 9; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl Primitive Type}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getPrimitiveType() + * @generated + */ + int PRIMITIVE_TYPE = 7; + + /** + * The feature id for the 'Name' attribute. + * + * + * + * @generated + * @ordered + */ + int PRIMITIVE_TYPE__NAME = JAVA_GEN__NAME; + + /** + * The feature id for the 'Author' attribute. + * + * + * + * @generated + * @ordered + */ + int PRIMITIVE_TYPE__AUTHOR = JAVA_GEN__AUTHOR; + + /** + * The feature id for the 'Version' attribute. + * + * + * + * @generated + * @ordered + */ + int PRIMITIVE_TYPE__VERSION = JAVA_GEN__VERSION; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int PRIMITIVE_TYPE__COMMENT = JAVA_GEN__COMMENT; + + /** + * The feature id for the 'Is Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int PRIMITIVE_TYPE__IS_GENERATED = JAVA_GEN__IS_GENERATED; + + /** + * The feature id for the 'Src Name' attribute. + * + * + * + * @generated + * @ordered + */ + int PRIMITIVE_TYPE__SRC_NAME = JAVA_GEN__SRC_NAME; + + /** + * The feature id for the 'Project Name' attribute. + * + * + * + * @generated + * @ordered + */ + int PRIMITIVE_TYPE__PROJECT_NAME = JAVA_GEN__PROJECT_NAME; + + /** + * The feature id for the 'Implementation Class' attribute. + * + * + * + * @generated + * @ordered + */ + int PRIMITIVE_TYPE__IMPLEMENTATION_CLASS = JAVA_GEN_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Base Primitive Type' reference. + * + * + * + * @generated + * @ordered + */ + int PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE = JAVA_GEN_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Collection Implementation Class' attribute. + * + * + * + * @generated + * @ordered + */ + int PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS = JAVA_GEN_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Primitive Type' class. + * + * + * + * @generated + * @ordered + */ + int PRIMITIVE_TYPE_FEATURE_COUNT = JAVA_GEN_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaProjectImpl Project}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaProjectImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaProject() + * @generated + */ + int JAVA_PROJECT = 8; + + /** + * The feature id for the 'Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROJECT__NAME = JAVA_GEN__NAME; + + /** + * The feature id for the 'Author' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROJECT__AUTHOR = JAVA_GEN__AUTHOR; + + /** + * The feature id for the 'Version' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROJECT__VERSION = JAVA_GEN__VERSION; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROJECT__COMMENT = JAVA_GEN__COMMENT; + + /** + * The feature id for the 'Is Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROJECT__IS_GENERATED = JAVA_GEN__IS_GENERATED; + + /** + * The feature id for the 'Src Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROJECT__SRC_NAME = JAVA_GEN__SRC_NAME; + + /** + * The feature id for the 'Project Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROJECT__PROJECT_NAME = JAVA_GEN__PROJECT_NAME; + + /** + * The feature id for the 'Base Package' reference. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROJECT__BASE_PACKAGE = JAVA_GEN_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Project' class. + * + * + * + * @generated + * @ordered + */ + int JAVA_PROJECT_FEATURE_COUNT = JAVA_GEN_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaSrcFolderImpl Src Folder}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaSrcFolderImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaSrcFolder() + * @generated + */ + int JAVA_SRC_FOLDER = 9; + + /** + * The feature id for the 'Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_SRC_FOLDER__NAME = JAVA_GEN__NAME; + + /** + * The feature id for the 'Author' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_SRC_FOLDER__AUTHOR = JAVA_GEN__AUTHOR; + + /** + * The feature id for the 'Version' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_SRC_FOLDER__VERSION = JAVA_GEN__VERSION; + + /** + * The feature id for the 'Comment' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_SRC_FOLDER__COMMENT = JAVA_GEN__COMMENT; + + /** + * The feature id for the 'Is Generated' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_SRC_FOLDER__IS_GENERATED = JAVA_GEN__IS_GENERATED; + + /** + * The feature id for the 'Src Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_SRC_FOLDER__SRC_NAME = JAVA_GEN__SRC_NAME; + + /** + * The feature id for the 'Project Name' attribute. + * + * + * + * @generated + * @ordered + */ + int JAVA_SRC_FOLDER__PROJECT_NAME = JAVA_GEN__PROJECT_NAME; + + /** + * The feature id for the 'Base Package' reference. + * + * + * + * @generated + * @ordered + */ + int JAVA_SRC_FOLDER__BASE_PACKAGE = JAVA_GEN_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Src Folder' class. + * + * + * + * @generated + * @ordered + */ + int JAVA_SRC_FOLDER_FEATURE_COUNT = JAVA_GEN_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.java.profile.java.TrueFalseDefault True False Default}' enum. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getTrueFalseDefault() + * @generated + */ + int TRUE_FALSE_DEFAULT = 10; + + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaClass Class}'. + * + * + * + * @return the meta object for class 'Class'. + * @see org.eclipse.papyrus.java.profile.java.JavaClass + * @generated + */ + EClass getJavaClass(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaClass#getBase_Classifier Base Classifier}'. + * + * + * + * @return the meta object for the reference 'Base Classifier'. + * @see org.eclipse.papyrus.java.profile.java.JavaClass#getBase_Classifier() + * @see #getJavaClass() + * @generated + */ + EReference getJavaClass_Base_Classifier(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaClass#isFinal Is Final}'. + * + * + * + * @return the meta object for the attribute 'Is Final'. + * @see org.eclipse.papyrus.java.profile.java.JavaClass#isFinal() + * @see #getJavaClass() + * @generated + */ + EAttribute getJavaClass_IsFinal(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaClass#isAbstract Is Abstract}'. + * + * + * + * @return the meta object for the attribute 'Is Abstract'. + * @see org.eclipse.papyrus.java.profile.java.JavaClass#isAbstract() + * @see #getJavaClass() + * @generated + */ + EAttribute getJavaClass_IsAbstract(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaClass#isStatic Is Static}'. + * + * + * + * @return the meta object for the attribute 'Is Static'. + * @see org.eclipse.papyrus.java.profile.java.JavaClass#isStatic() + * @see #getJavaClass() + * @generated + */ + EAttribute getJavaClass_IsStatic(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.java.profile.java.JavaClass#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}'. + * + * + * + * @return the meta object for the attribute list 'Explicit Plain Text Required Imports'. + * @see org.eclipse.papyrus.java.profile.java.JavaClass#getExplicitPlainTextRequiredImports() + * @see #getJavaClass() + * @generated + */ + EAttribute getJavaClass_ExplicitPlainTextRequiredImports(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.profile.java.JavaClass#getExplicitRequiredImports Explicit Required Imports}'. + * + * + * + * @return the meta object for the reference list 'Explicit Required Imports'. + * @see org.eclipse.papyrus.java.profile.java.JavaClass#getExplicitRequiredImports() + * @see #getJavaClass() + * @generated + */ + EReference getJavaClass_ExplicitRequiredImports(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaGen Gen}'. + * + * + * + * @return the meta object for class 'Gen'. + * @see org.eclipse.papyrus.java.profile.java.JavaGen + * @generated + */ + EClass getJavaGen(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaGen#getSrcName Src Name}'. + * + * + * + * @return the meta object for the attribute 'Src Name'. + * @see org.eclipse.papyrus.java.profile.java.JavaGen#getSrcName() + * @see #getJavaGen() + * @generated + */ + EAttribute getJavaGen_SrcName(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaGen#getProjectName Project Name}'. + * + * + * + * @return the meta object for the attribute 'Project Name'. + * @see org.eclipse.papyrus.java.profile.java.JavaGen#getProjectName() + * @see #getJavaGen() + * @generated + */ + EAttribute getJavaGen_ProjectName(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement Named Element}'. + * + * + * + * @return the meta object for class 'Named Element'. + * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement + * @generated + */ + EClass getJavaNamedElement(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getName Name}'. + * + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement#getName() + * @see #getJavaNamedElement() + * @generated + */ + EAttribute getJavaNamedElement_Name(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getAuthor Author}'. + * + * + * + * @return the meta object for the attribute 'Author'. + * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement#getAuthor() + * @see #getJavaNamedElement() + * @generated + */ + EAttribute getJavaNamedElement_Author(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getVersion Version}'. + * + * + * + * @return the meta object for the attribute 'Version'. + * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement#getVersion() + * @see #getJavaNamedElement() + * @generated + */ + EAttribute getJavaNamedElement_Version(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#getComment Comment}'. + * + * + * + * @return the meta object for the attribute 'Comment'. + * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement#getComment() + * @see #getJavaNamedElement() + * @generated + */ + EAttribute getJavaNamedElement_Comment(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement#isGenerated Is Generated}'. + * + * + * + * @return the meta object for the attribute 'Is Generated'. + * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement#isGenerated() + * @see #getJavaNamedElement() + * @generated + */ + EAttribute getJavaNamedElement_IsGenerated(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaPackage_ Package }'. + * + * + * + * @return the meta object for class 'Package '. + * @see org.eclipse.papyrus.java.profile.java.JavaPackage_ + * @generated + */ + EClass getJavaPackage_(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaPackage_#getPackageName Package Name}'. + * + * + * + * @return the meta object for the attribute 'Package Name'. + * @see org.eclipse.papyrus.java.profile.java.JavaPackage_#getPackageName() + * @see #getJavaPackage_() + * @generated + */ + EAttribute getJavaPackage__PackageName(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaPackage_#getBase_Package Base Package}'. + * + * + * + * @return the meta object for the reference 'Base Package'. + * @see org.eclipse.papyrus.java.profile.java.JavaPackage_#getBase_Package() + * @see #getJavaPackage_() + * @generated + */ + EReference getJavaPackage__Base_Package(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaMethod Method}'. + * + * + * + * @return the meta object for class 'Method'. + * @see org.eclipse.papyrus.java.profile.java.JavaMethod + * @generated + */ + EClass getJavaMethod(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isStatic Is Static}'. + * + * + * + * @return the meta object for the attribute 'Is Static'. + * @see org.eclipse.papyrus.java.profile.java.JavaMethod#isStatic() + * @see #getJavaMethod() + * @generated + */ + EAttribute getJavaMethod_IsStatic(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isFinal Is Final}'. + * + * + * + * @return the meta object for the attribute 'Is Final'. + * @see org.eclipse.papyrus.java.profile.java.JavaMethod#isFinal() + * @see #getJavaMethod() + * @generated + */ + EAttribute getJavaMethod_IsFinal(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isAbstract Is Abstract}'. + * + * + * + * @return the meta object for the attribute 'Is Abstract'. + * @see org.eclipse.papyrus.java.profile.java.JavaMethod#isAbstract() + * @see #getJavaMethod() + * @generated + */ + EAttribute getJavaMethod_IsAbstract(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isNative Is Native}'. + * + * + * + * @return the meta object for the attribute 'Is Native'. + * @see org.eclipse.papyrus.java.profile.java.JavaMethod#isNative() + * @see #getJavaMethod() + * @generated + */ + EAttribute getJavaMethod_IsNative(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isSynchronized Is Synchronized}'. + * + * + * + * @return the meta object for the attribute 'Is Synchronized'. + * @see org.eclipse.papyrus.java.profile.java.JavaMethod#isSynchronized() + * @see #getJavaMethod() + * @generated + */ + EAttribute getJavaMethod_IsSynchronized(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#isConstructor Is Constructor}'. + * + * + * + * @return the meta object for the attribute 'Is Constructor'. + * @see org.eclipse.papyrus.java.profile.java.JavaMethod#isConstructor() + * @see #getJavaMethod() + * @generated + */ + EAttribute getJavaMethod_IsConstructor(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#getBase_Operation Base Operation}'. + * + * + * + * @return the meta object for the reference 'Base Operation'. + * @see org.eclipse.papyrus.java.profile.java.JavaMethod#getBase_Operation() + * @see #getJavaMethod() + * @generated + */ + EReference getJavaMethod_Base_Operation(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}'. + * + * + * + * @return the meta object for the attribute list 'Explicit Plain Text Required Imports'. + * @see org.eclipse.papyrus.java.profile.java.JavaMethod#getExplicitPlainTextRequiredImports() + * @see #getJavaMethod() + * @generated + */ + EAttribute getJavaMethod_ExplicitPlainTextRequiredImports(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.profile.java.JavaMethod#getExplicitRequiredImports Explicit Required Imports}'. + * + * + * + * @return the meta object for the reference list 'Explicit Required Imports'. + * @see org.eclipse.papyrus.java.profile.java.JavaMethod#getExplicitRequiredImports() + * @see #getJavaMethod() + * @generated + */ + EReference getJavaMethod_ExplicitRequiredImports(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaParameter Parameter}'. + * + * + * + * @return the meta object for class 'Parameter'. + * @see org.eclipse.papyrus.java.profile.java.JavaParameter + * @generated + */ + EClass getJavaParameter(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaParameter#isFinal Is Final}'. + * + * + * + * @return the meta object for the attribute 'Is Final'. + * @see org.eclipse.papyrus.java.profile.java.JavaParameter#isFinal() + * @see #getJavaParameter() + * @generated + */ + EAttribute getJavaParameter_IsFinal(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaParameter#getBase_Parameter Base Parameter}'. + * + * + * + * @return the meta object for the reference 'Base Parameter'. + * @see org.eclipse.papyrus.java.profile.java.JavaParameter#getBase_Parameter() + * @see #getJavaParameter() + * @generated + */ + EReference getJavaParameter_Base_Parameter(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaProperty Property}'. + * + * + * + * @return the meta object for class 'Property'. + * @see org.eclipse.papyrus.java.profile.java.JavaProperty + * @generated + */ + EClass getJavaProperty(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isAbstract Is Abstract}'. + * + * + * + * @return the meta object for the attribute 'Is Abstract'. + * @see org.eclipse.papyrus.java.profile.java.JavaProperty#isAbstract() + * @see #getJavaProperty() + * @generated + */ + EAttribute getJavaProperty_IsAbstract(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isFinal Is Final}'. + * + * + * + * @return the meta object for the attribute 'Is Final'. + * @see org.eclipse.papyrus.java.profile.java.JavaProperty#isFinal() + * @see #getJavaProperty() + * @generated + */ + EAttribute getJavaProperty_IsFinal(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getBase_Property Base Property}'. + * + * + * + * @return the meta object for the reference 'Base Property'. + * @see org.eclipse.papyrus.java.profile.java.JavaProperty#getBase_Property() + * @see #getJavaProperty() + * @generated + */ + EReference getJavaProperty_Base_Property(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isTransient Is Transient}'. + * + * + * + * @return the meta object for the attribute 'Is Transient'. + * @see org.eclipse.papyrus.java.profile.java.JavaProperty#isTransient() + * @see #getJavaProperty() + * @generated + */ + EAttribute getJavaProperty_IsTransient(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateGetter Generate Getter}'. + * + * + * + * @return the meta object for the attribute 'Generate Getter'. + * @see org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateGetter() + * @see #getJavaProperty() + * @generated + */ + EAttribute getJavaProperty_GenerateGetter(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateSetter Generate Setter}'. + * + * + * + * @return the meta object for the attribute 'Generate Setter'. + * @see org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateSetter() + * @see #getJavaProperty() + * @generated + */ + EAttribute getJavaProperty_GenerateSetter(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isStatic Is Static}'. + * + * + * + * @return the meta object for the attribute 'Is Static'. + * @see org.eclipse.papyrus.java.profile.java.JavaProperty#isStatic() + * @see #getJavaProperty() + * @generated + */ + EAttribute getJavaProperty_IsStatic(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}'. + * + * + * + * @return the meta object for the attribute list 'Explicit Plain Text Required Imports'. + * @see org.eclipse.papyrus.java.profile.java.JavaProperty#getExplicitPlainTextRequiredImports() + * @see #getJavaProperty() + * @generated + */ + EAttribute getJavaProperty_ExplicitPlainTextRequiredImports(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getExplicitRequiredImports Explicit Required Imports}'. + * + * + * + * @return the meta object for the reference list 'Explicit Required Imports'. + * @see org.eclipse.papyrus.java.profile.java.JavaProperty#getExplicitRequiredImports() + * @see #getJavaProperty() + * @generated + */ + EReference getJavaProperty_ExplicitRequiredImports(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType Primitive Type}'. + * + * + * + * @return the meta object for class 'Primitive Type'. + * @see org.eclipse.papyrus.java.profile.java.PrimitiveType + * @generated + */ + EClass getPrimitiveType(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getImplementationClass Implementation Class}'. + * + * + * + * @return the meta object for the attribute 'Implementation Class'. + * @see org.eclipse.papyrus.java.profile.java.PrimitiveType#getImplementationClass() + * @see #getPrimitiveType() + * @generated + */ + EAttribute getPrimitiveType_ImplementationClass(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getBase_PrimitiveType Base Primitive Type}'. + * + * + * + * @return the meta object for the reference 'Base Primitive Type'. + * @see org.eclipse.papyrus.java.profile.java.PrimitiveType#getBase_PrimitiveType() + * @see #getPrimitiveType() + * @generated + */ + EReference getPrimitiveType_Base_PrimitiveType(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getCollectionImplementationClass Collection Implementation Class}'. + * + * + * + * @return the meta object for the attribute 'Collection Implementation Class'. + * @see org.eclipse.papyrus.java.profile.java.PrimitiveType#getCollectionImplementationClass() + * @see #getPrimitiveType() + * @generated + */ + EAttribute getPrimitiveType_CollectionImplementationClass(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaProject Project}'. + * + * + * + * @return the meta object for class 'Project'. + * @see org.eclipse.papyrus.java.profile.java.JavaProject + * @generated + */ + EClass getJavaProject(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaProject#getBase_Package Base Package}'. + * + * + * + * @return the meta object for the reference 'Base Package'. + * @see org.eclipse.papyrus.java.profile.java.JavaProject#getBase_Package() + * @see #getJavaProject() + * @generated + */ + EReference getJavaProject_Base_Package(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder Src Folder}'. + * + * + * + * @return the meta object for class 'Src Folder'. + * @see org.eclipse.papyrus.java.profile.java.JavaSrcFolder + * @generated + */ + EClass getJavaSrcFolder(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder#getBase_Package Base Package}'. + * + * + * + * @return the meta object for the reference 'Base Package'. + * @see org.eclipse.papyrus.java.profile.java.JavaSrcFolder#getBase_Package() + * @see #getJavaSrcFolder() + * @generated + */ + EReference getJavaSrcFolder_Base_Package(); + + /** + * Returns the meta object for enum '{@link org.eclipse.papyrus.java.profile.java.TrueFalseDefault True False Default}'. + * + * + * + * @return the meta object for enum 'True False Default'. + * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault + * @generated + */ + EEnum getTrueFalseDefault(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + JavaFactory getJavaFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
      + *
    • each class,
    • + *
    • each feature of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl Class}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaClass() + * @generated + */ + EClass JAVA_CLASS = eINSTANCE.getJavaClass(); + + /** + * The meta object literal for the 'Base Classifier' reference feature. + * + * + * + * @generated + */ + EReference JAVA_CLASS__BASE_CLASSIFIER = eINSTANCE.getJavaClass_Base_Classifier(); + + /** + * The meta object literal for the 'Is Final' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_CLASS__IS_FINAL = eINSTANCE.getJavaClass_IsFinal(); + + /** + * The meta object literal for the 'Is Abstract' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_CLASS__IS_ABSTRACT = eINSTANCE.getJavaClass_IsAbstract(); + + /** + * The meta object literal for the 'Is Static' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_CLASS__IS_STATIC = eINSTANCE.getJavaClass_IsStatic(); + + /** + * The meta object literal for the 'Explicit Plain Text Required Imports' attribute list feature. + * + * + * + * @generated + */ + EAttribute JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = eINSTANCE.getJavaClass_ExplicitPlainTextRequiredImports(); + + /** + * The meta object literal for the 'Explicit Required Imports' reference list feature. + * + * + * + * @generated + */ + EReference JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS = eINSTANCE.getJavaClass_ExplicitRequiredImports(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaGenImpl Gen}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaGenImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaGen() + * @generated + */ + EClass JAVA_GEN = eINSTANCE.getJavaGen(); + + /** + * The meta object literal for the 'Src Name' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_GEN__SRC_NAME = eINSTANCE.getJavaGen_SrcName(); + + /** + * The meta object literal for the 'Project Name' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_GEN__PROJECT_NAME = eINSTANCE.getJavaGen_ProjectName(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl Named Element}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaNamedElement() + * @generated + */ + EClass JAVA_NAMED_ELEMENT = eINSTANCE.getJavaNamedElement(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_NAMED_ELEMENT__NAME = eINSTANCE.getJavaNamedElement_Name(); + + /** + * The meta object literal for the 'Author' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_NAMED_ELEMENT__AUTHOR = eINSTANCE.getJavaNamedElement_Author(); + + /** + * The meta object literal for the 'Version' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_NAMED_ELEMENT__VERSION = eINSTANCE.getJavaNamedElement_Version(); + + /** + * The meta object literal for the 'Comment' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_NAMED_ELEMENT__COMMENT = eINSTANCE.getJavaNamedElement_Comment(); + + /** + * The meta object literal for the 'Is Generated' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_NAMED_ELEMENT__IS_GENERATED = eINSTANCE.getJavaNamedElement_IsGenerated(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaPackage_Impl Package }' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackage_Impl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaPackage_() + * @generated + */ + EClass JAVA_PACKAGE_ = eINSTANCE.getJavaPackage_(); + + /** + * The meta object literal for the 'Package Name' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_PACKAGE___PACKAGE_NAME = eINSTANCE.getJavaPackage__PackageName(); + + /** + * The meta object literal for the 'Base Package' reference feature. + * + * + * + * @generated + */ + EReference JAVA_PACKAGE___BASE_PACKAGE = eINSTANCE.getJavaPackage__Base_Package(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl Method}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaMethod() + * @generated + */ + EClass JAVA_METHOD = eINSTANCE.getJavaMethod(); + + /** + * The meta object literal for the 'Is Static' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_METHOD__IS_STATIC = eINSTANCE.getJavaMethod_IsStatic(); + + /** + * The meta object literal for the 'Is Final' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_METHOD__IS_FINAL = eINSTANCE.getJavaMethod_IsFinal(); + + /** + * The meta object literal for the 'Is Abstract' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_METHOD__IS_ABSTRACT = eINSTANCE.getJavaMethod_IsAbstract(); + + /** + * The meta object literal for the 'Is Native' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_METHOD__IS_NATIVE = eINSTANCE.getJavaMethod_IsNative(); + + /** + * The meta object literal for the 'Is Synchronized' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_METHOD__IS_SYNCHRONIZED = eINSTANCE.getJavaMethod_IsSynchronized(); + + /** + * The meta object literal for the 'Is Constructor' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_METHOD__IS_CONSTRUCTOR = eINSTANCE.getJavaMethod_IsConstructor(); + + /** + * The meta object literal for the 'Base Operation' reference feature. + * + * + * + * @generated + */ + EReference JAVA_METHOD__BASE_OPERATION = eINSTANCE.getJavaMethod_Base_Operation(); + + /** + * The meta object literal for the 'Explicit Plain Text Required Imports' attribute list feature. + * + * + * + * @generated + */ + EAttribute JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = eINSTANCE.getJavaMethod_ExplicitPlainTextRequiredImports(); + + /** + * The meta object literal for the 'Explicit Required Imports' reference list feature. + * + * + * + * @generated + */ + EReference JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS = eINSTANCE.getJavaMethod_ExplicitRequiredImports(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaParameterImpl Parameter}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaParameterImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaParameter() + * @generated + */ + EClass JAVA_PARAMETER = eINSTANCE.getJavaParameter(); + + /** + * The meta object literal for the 'Is Final' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_PARAMETER__IS_FINAL = eINSTANCE.getJavaParameter_IsFinal(); + + /** + * The meta object literal for the 'Base Parameter' reference feature. + * + * + * + * @generated + */ + EReference JAVA_PARAMETER__BASE_PARAMETER = eINSTANCE.getJavaParameter_Base_Parameter(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl Property}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaProperty() + * @generated + */ + EClass JAVA_PROPERTY = eINSTANCE.getJavaProperty(); + + /** + * The meta object literal for the 'Is Abstract' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_PROPERTY__IS_ABSTRACT = eINSTANCE.getJavaProperty_IsAbstract(); + + /** + * The meta object literal for the 'Is Final' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_PROPERTY__IS_FINAL = eINSTANCE.getJavaProperty_IsFinal(); + + /** + * The meta object literal for the 'Base Property' reference feature. + * + * + * + * @generated + */ + EReference JAVA_PROPERTY__BASE_PROPERTY = eINSTANCE.getJavaProperty_Base_Property(); + + /** + * The meta object literal for the 'Is Transient' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_PROPERTY__IS_TRANSIENT = eINSTANCE.getJavaProperty_IsTransient(); + + /** + * The meta object literal for the 'Generate Getter' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_PROPERTY__GENERATE_GETTER = eINSTANCE.getJavaProperty_GenerateGetter(); + + /** + * The meta object literal for the 'Generate Setter' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_PROPERTY__GENERATE_SETTER = eINSTANCE.getJavaProperty_GenerateSetter(); + + /** + * The meta object literal for the 'Is Static' attribute feature. + * + * + * + * @generated + */ + EAttribute JAVA_PROPERTY__IS_STATIC = eINSTANCE.getJavaProperty_IsStatic(); + + /** + * The meta object literal for the 'Explicit Plain Text Required Imports' attribute list feature. + * + * + * + * @generated + */ + EAttribute JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS = eINSTANCE.getJavaProperty_ExplicitPlainTextRequiredImports(); + + /** + * The meta object literal for the 'Explicit Required Imports' reference list feature. + * + * + * + * @generated + */ + EReference JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS = eINSTANCE.getJavaProperty_ExplicitRequiredImports(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl Primitive Type}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getPrimitiveType() + * @generated + */ + EClass PRIMITIVE_TYPE = eINSTANCE.getPrimitiveType(); + + /** + * The meta object literal for the 'Implementation Class' attribute feature. + * + * + * + * @generated + */ + EAttribute PRIMITIVE_TYPE__IMPLEMENTATION_CLASS = eINSTANCE.getPrimitiveType_ImplementationClass(); + + /** + * The meta object literal for the 'Base Primitive Type' reference feature. + * + * + * + * @generated + */ + EReference PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE = eINSTANCE.getPrimitiveType_Base_PrimitiveType(); + + /** + * The meta object literal for the 'Collection Implementation Class' attribute feature. + * + * + * + * @generated + */ + EAttribute PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS = eINSTANCE.getPrimitiveType_CollectionImplementationClass(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaProjectImpl Project}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaProjectImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaProject() + * @generated + */ + EClass JAVA_PROJECT = eINSTANCE.getJavaProject(); + + /** + * The meta object literal for the 'Base Package' reference feature. + * + * + * + * @generated + */ + EReference JAVA_PROJECT__BASE_PACKAGE = eINSTANCE.getJavaProject_Base_Package(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.impl.JavaSrcFolderImpl Src Folder}' class. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.impl.JavaSrcFolderImpl + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getJavaSrcFolder() + * @generated + */ + EClass JAVA_SRC_FOLDER = eINSTANCE.getJavaSrcFolder(); + + /** + * The meta object literal for the 'Base Package' reference feature. + * + * + * + * @generated + */ + EReference JAVA_SRC_FOLDER__BASE_PACKAGE = eINSTANCE.getJavaSrcFolder_Base_Package(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.java.profile.java.TrueFalseDefault True False Default}' enum. + * + * + * + * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault + * @see org.eclipse.papyrus.java.profile.java.impl.JavaPackageImpl#getTrueFalseDefault() + * @generated + */ + EEnum TRUE_FALSE_DEFAULT = eINSTANCE.getTrueFalseDefault(); + + } + +} // JavaPackage diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage_.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage_.java new file mode 100644 index 00000000000..72f5dd43ebc --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaPackage_.java @@ -0,0 +1,84 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java; + + +/** + * + * A representation of the model object 'Package '. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaPackage_#getPackageName Package Name}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaPackage_#getBase_Package Base Package}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaPackage_() + * @model + * @generated + */ +public interface JavaPackage_ extends JavaGen { + /** + * Returns the value of the 'Package Name' attribute. + * + *

    + * If the meaning of the 'Package Name' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Package Name' attribute. + * @see #setPackageName(String) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaPackage__PackageName() + * @model unique="false" required="true" ordered="false" + * @generated + */ + String getPackageName(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaPackage_#getPackageName Package Name}' attribute. + * + * + * + * @param value + * the new value of the 'Package Name' attribute. + * @see #getPackageName() + * @generated + */ + void setPackageName(String value); + + /** + * Returns the value of the 'Base Package' reference. + * + *

    + * If the meaning of the 'Base Package' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Base Package' reference. + * @see #setBase_Package(org.eclipse.uml2.uml.Package) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaPackage__Base_Package() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Package getBase_Package(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaPackage_#getBase_Package Base Package}' reference. + * + * + * + * @param value + * the new value of the 'Base Package' reference. + * @see #getBase_Package() + * @generated + */ + void setBase_Package(org.eclipse.uml2.uml.Package value); + +} // JavaPackage_ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaParameter.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaParameter.java new file mode 100644 index 00000000000..788372013f5 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaParameter.java @@ -0,0 +1,85 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java; + +import org.eclipse.uml2.uml.Parameter; + +/** + * + * A representation of the model object 'Parameter'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaParameter#isFinal Is Final}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaParameter#getBase_Parameter Base Parameter}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaParameter() + * @model + * @generated + */ +public interface JavaParameter extends JavaNamedElement { + /** + * Returns the value of the 'Is Final' attribute. + * + *

    + * If the meaning of the 'Is Final' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Final' attribute. + * @see #setIsFinal(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaParameter_IsFinal() + * @model unique="false" required="true" ordered="false" + * @generated + */ + boolean isFinal(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaParameter#isFinal Is Final}' attribute. + * + * + * + * @param value + * the new value of the 'Is Final' attribute. + * @see #isFinal() + * @generated + */ + void setIsFinal(boolean value); + + /** + * Returns the value of the 'Base Parameter' reference. + * + *

    + * If the meaning of the 'Base Parameter' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Base Parameter' reference. + * @see #setBase_Parameter(Parameter) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaParameter_Base_Parameter() + * @model required="true" ordered="false" + * @generated + */ + Parameter getBase_Parameter(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaParameter#getBase_Parameter Base Parameter}' reference. + * + * + * + * @param value + * the new value of the 'Base Parameter' reference. + * @see #getBase_Parameter() + * @generated + */ + void setBase_Parameter(Parameter value); + +} // JavaParameter diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProject.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProject.java new file mode 100644 index 00000000000..122301f6388 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProject.java @@ -0,0 +1,55 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java; + + +/** + * + * A representation of the model object 'Project'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaProject#getBase_Package Base Package}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProject() + * @model + * @generated + */ +public interface JavaProject extends JavaGen { + /** + * Returns the value of the 'Base Package' reference. + * + *

    + * If the meaning of the 'Base Package' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Base Package' reference. + * @see #setBase_Package(org.eclipse.uml2.uml.Package) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProject_Base_Package() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Package getBase_Package(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProject#getBase_Package Base Package}' reference. + * + * + * + * @param value + * the new value of the 'Base Package' reference. + * @see #getBase_Package() + * @generated + */ + void setBase_Package(org.eclipse.uml2.uml.Package value); + +} // JavaProject diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProperty.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProperty.java new file mode 100644 index 00000000000..7ddf1e1bff6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaProperty.java @@ -0,0 +1,305 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Property; + +/** + * + * A representation of the model object 'Property'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#isAbstract Is Abstract}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#isFinal Is Final}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#getBase_Property Base Property}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#isTransient Is Transient}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateGetter Generate Getter}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateSetter Generate Setter}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#isStatic Is Static}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaProperty#getExplicitRequiredImports Explicit Required Imports}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty() + * @model + * @generated + */ +public interface JavaProperty extends JavaNamedElement { + /** + * Returns the value of the 'Is Abstract' attribute. + * + *

    + * If the meaning of the 'Is Abstract' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Abstract' attribute. + * @see #setIsAbstract(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_IsAbstract() + * @model unique="false" required="true" ordered="false" + * @generated + */ + boolean isAbstract(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isAbstract Is Abstract}' attribute. + * + * + * + * @param value + * the new value of the 'Is Abstract' attribute. + * @see #isAbstract() + * @generated + */ + void setIsAbstract(boolean value); + + /** + * Returns the value of the 'Is Final' attribute. + * + *

    + * If the meaning of the 'Is Final' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Final' attribute. + * @see #setIsFinal(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_IsFinal() + * @model unique="false" required="true" ordered="false" + * @generated + */ + boolean isFinal(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isFinal Is Final}' attribute. + * + * + * + * @param value + * the new value of the 'Is Final' attribute. + * @see #isFinal() + * @generated + */ + void setIsFinal(boolean value); + + /** + * Returns the value of the 'Base Property' reference. + * + *

    + * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Base Property' reference. + * @see #setBase_Property(Property) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_Base_Property() + * @model required="true" ordered="false" + * @generated + */ + Property getBase_Property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getBase_Property Base Property}' reference. + * + * + * + * @param value + * the new value of the 'Base Property' reference. + * @see #getBase_Property() + * @generated + */ + void setBase_Property(Property value); + + /** + * Returns the value of the 'Is Transient' attribute. + * + *

    + * If the meaning of the 'Is Transient' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Transient' attribute. + * @see #setIsTransient(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_IsTransient() + * @model unique="false" required="true" ordered="false" + * @generated + */ + boolean isTransient(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isTransient Is Transient}' attribute. + * + * + * + * @param value + * the new value of the 'Is Transient' attribute. + * @see #isTransient() + * @generated + */ + void setIsTransient(boolean value); + + /** + * Returns the value of the 'Generate Getter' attribute. + * The default value is "default". + * The literals are from the enumeration {@link org.eclipse.papyrus.java.profile.java.TrueFalseDefault}. + * + *

    + * If the meaning of the 'Generate Getter' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Generate Getter' attribute. + * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault + * @see #setGenerateGetter(TrueFalseDefault) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_GenerateGetter() + * @model default="default" required="true" ordered="false" + * @generated + */ + TrueFalseDefault getGenerateGetter(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateGetter Generate Getter}' attribute. + * + * + * + * @param value + * the new value of the 'Generate Getter' attribute. + * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault + * @see #getGenerateGetter() + * @generated + */ + void setGenerateGetter(TrueFalseDefault value); + + /** + * Returns the value of the 'Generate Setter' attribute. + * The default value is "default". + * The literals are from the enumeration {@link org.eclipse.papyrus.java.profile.java.TrueFalseDefault}. + * + *

    + * If the meaning of the 'Generate Setter' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Generate Setter' attribute. + * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault + * @see #setGenerateSetter(TrueFalseDefault) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_GenerateSetter() + * @model default="default" required="true" ordered="false" + * @generated + */ + TrueFalseDefault getGenerateSetter(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#getGenerateSetter Generate Setter}' attribute. + * + * + * + * @param value + * the new value of the 'Generate Setter' attribute. + * @see org.eclipse.papyrus.java.profile.java.TrueFalseDefault + * @see #getGenerateSetter() + * @generated + */ + void setGenerateSetter(TrueFalseDefault value); + + /** + * Returns the value of the 'Is Static' attribute. + * + *

    + * If the meaning of the 'Is Static' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Is Static' attribute. + * @see #setIsStatic(boolean) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_IsStatic() + * @model required="true" ordered="false" + * @generated + */ + boolean isStatic(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaProperty#isStatic Is Static}' attribute. + * + * + * + * @param value + * the new value of the 'Is Static' attribute. + * @see #isStatic() + * @generated + */ + void setIsStatic(boolean value); + + /** + * Returns the value of the 'Explicit Plain Text Required Imports' attribute list. + * The list contents are of type {@link java.lang.String}. + * + *

    + * If the meaning of the 'Explicit Plain Text Required Imports' attribute list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Explicit Plain Text Required Imports' attribute list. + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_ExplicitPlainTextRequiredImports() + * @model unique="false" ordered="false" + * @generated + */ + EList getExplicitPlainTextRequiredImports(); + + /** + * Returns the value of the 'Explicit Required Imports' reference list. + * The list contents are of type {@link org.eclipse.uml2.uml.Classifier}. + * + *

    + * If the meaning of the 'Explicit Required Imports' reference list isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Explicit Required Imports' reference list. + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaProperty_ExplicitRequiredImports() + * @model ordered="false" + * @generated + */ + EList getExplicitRequiredImports(); + + /** + * Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name' from the 'Explicit Required Imports' reference list. + * + * + * + * @param name + * The 'Name' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. + * @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name', or null. + * @see #getExplicitRequiredImports() + * @generated + */ + Classifier getExplicitRequiredImports(String name); + + /** + * Retrieves the first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name' from the 'Explicit Required Imports' reference list. + * + * + * + * @param name + * The 'Name' of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. + * @param ignoreCase + * Whether to ignore case in {@link java.lang.String} comparisons. + * @param eClass + * The Ecore class of the {@link org.eclipse.uml2.uml.Classifier} to retrieve, or null. + * @return The first {@link org.eclipse.uml2.uml.Classifier} with the specified 'Name', or null. + * @see #getExplicitRequiredImports() + * @generated + */ + Classifier getExplicitRequiredImports(String name, boolean ignoreCase, EClass eClass); + +} // JavaProperty diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaSrcFolder.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaSrcFolder.java new file mode 100644 index 00000000000..25bf1c52ed5 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/JavaSrcFolder.java @@ -0,0 +1,55 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java; + + +/** + * + * A representation of the model object 'Src Folder'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder#getBase_Package Base Package}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaSrcFolder() + * @model + * @generated + */ +public interface JavaSrcFolder extends JavaGen { + /** + * Returns the value of the 'Base Package' reference. + * + *

    + * If the meaning of the 'Base Package' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Base Package' reference. + * @see #setBase_Package(org.eclipse.uml2.uml.Package) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getJavaSrcFolder_Base_Package() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Package getBase_Package(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder#getBase_Package Base Package}' reference. + * + * + * + * @param value + * the new value of the 'Base Package' reference. + * @see #getBase_Package() + * @generated + */ + void setBase_Package(org.eclipse.uml2.uml.Package value); + +} // JavaSrcFolder diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/PrimitiveType.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/PrimitiveType.java new file mode 100644 index 00000000000..00d52854f23 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/PrimitiveType.java @@ -0,0 +1,113 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java; + + +/** + * + * A representation of the model object 'Primitive Type'. + * + * + *

    + * The following features are supported: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getImplementationClass Implementation Class}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getBase_PrimitiveType Base Primitive Type}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getCollectionImplementationClass Collection Implementation Class}
    • + *
    + *

    + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getPrimitiveType() + * @model + * @generated + */ +public interface PrimitiveType extends JavaGen { + /** + * Returns the value of the 'Implementation Class' attribute. + * + *

    + * If the meaning of the 'Implementation Class' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Implementation Class' attribute. + * @see #setImplementationClass(String) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getPrimitiveType_ImplementationClass() + * @model unique="false" required="true" ordered="false" + * @generated + */ + String getImplementationClass(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getImplementationClass Implementation Class}' attribute. + * + * + * + * @param value + * the new value of the 'Implementation Class' attribute. + * @see #getImplementationClass() + * @generated + */ + void setImplementationClass(String value); + + /** + * Returns the value of the 'Base Primitive Type' reference. + * + *

    + * If the meaning of the 'Base Primitive Type' reference isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Base Primitive Type' reference. + * @see #setBase_PrimitiveType(org.eclipse.uml2.uml.PrimitiveType) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getPrimitiveType_Base_PrimitiveType() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.PrimitiveType getBase_PrimitiveType(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getBase_PrimitiveType Base Primitive Type}' reference. + * + * + * + * @param value + * the new value of the 'Base Primitive Type' reference. + * @see #getBase_PrimitiveType() + * @generated + */ + void setBase_PrimitiveType(org.eclipse.uml2.uml.PrimitiveType value); + + /** + * Returns the value of the 'Collection Implementation Class' attribute. + * + *

    + * If the meaning of the 'Collection Implementation Class' attribute isn't clear, there really should be more of a description here... + *

    + * + * + * @return the value of the 'Collection Implementation Class' attribute. + * @see #setCollectionImplementationClass(String) + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getPrimitiveType_CollectionImplementationClass() + * @model unique="false" required="true" ordered="false" + * @generated + */ + String getCollectionImplementationClass(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType#getCollectionImplementationClass Collection Implementation Class}' attribute. + * + * + * + * @param value + * the new value of the 'Collection Implementation Class' attribute. + * @see #getCollectionImplementationClass() + * @generated + */ + void setCollectionImplementationClass(String value); + +} // PrimitiveType diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/TrueFalseDefault.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/TrueFalseDefault.java new file mode 100644 index 00000000000..99d15305e4e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/TrueFalseDefault.java @@ -0,0 +1,262 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'True False Default', + * and utility methods for working with them. + * + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#getTrueFalseDefault() + * @model + * @generated + */ +public enum TrueFalseDefault implements Enumerator { + /** + * The 'True' literal object. + * + * + * + * @see #TRUE_VALUE + * @generated + * @ordered + */ + TRUE(0, "true", "true"), + + /** + * The 'False' literal object. + * + * + * + * @see #FALSE_VALUE + * @generated + * @ordered + */ + FALSE(1, "false", "false"), + + /** + * The 'Default' literal object. + * + * + * + * @see #DEFAULT_VALUE + * @generated + * @ordered + */ + DEFAULT(2, "default", "default"); + + /** + * The 'True' literal value. + * + *

    + * If the meaning of 'True' literal object isn't clear, there really should be more of a description here... + *

    + * + * + * @see #TRUE + * @model name="true" + * @generated + * @ordered + */ + public static final int TRUE_VALUE = 0; + + /** + * The 'False' literal value. + * + *

    + * If the meaning of 'False' literal object isn't clear, there really should be more of a description here... + *

    + * + * + * @see #FALSE + * @model name="false" + * @generated + * @ordered + */ + public static final int FALSE_VALUE = 1; + + /** + * The 'Default' literal value. + * + *

    + * If the meaning of 'Default' literal object isn't clear, there really should be more of a description here... + *

    + * + * + * @see #DEFAULT + * @model name="default" + * @generated + * @ordered + */ + public static final int DEFAULT_VALUE = 2; + + /** + * An array of all the 'True False Default' enumerators. + * + * + * + * @generated + */ + private static final TrueFalseDefault[] VALUES_ARRAY = + new TrueFalseDefault[] { + TRUE, + FALSE, + DEFAULT, + }; + + /** + * A public read-only list of all the 'True False Default' enumerators. + * + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'True False Default' literal with the specified literal value. + * + * + * + * @generated + */ + public static TrueFalseDefault get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + TrueFalseDefault result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'True False Default' literal with the specified name. + * + * + * + * @generated + */ + public static TrueFalseDefault getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + TrueFalseDefault result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'True False Default' literal with the specified integer value. + * + * + * + * @generated + */ + public static TrueFalseDefault get(int value) { + switch (value) { + case TRUE_VALUE: + return TRUE; + case FALSE_VALUE: + return FALSE; + case DEFAULT_VALUE: + return DEFAULT; + } + return null; + } + + /** + * + * + * + * @generated + */ + private final int value; + + /** + * + * + * + * @generated + */ + private final String name; + + /** + * + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * + * @generated + */ + private TrueFalseDefault(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} // TrueFalseDefault diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaClassImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaClassImpl.java new file mode 100644 index 00000000000..d6dc2b051f1 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaClassImpl.java @@ -0,0 +1,486 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EDataTypeEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.papyrus.java.profile.java.JavaClass; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.uml2.uml.Classifier; + +/** + * + * An implementation of the model object 'Class'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl#getBase_Classifier Base Classifier}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl#isFinal Is Final}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl#isAbstract Is Abstract}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl#isStatic Is Static}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaClassImpl#getExplicitRequiredImports Explicit Required Imports}
    • + *
    + *

    + * + * @generated + */ +public class JavaClassImpl extends JavaGenImpl implements JavaClass { + /** + * The cached value of the '{@link #getBase_Classifier() Base Classifier}' reference. + * + * + * + * @see #getBase_Classifier() + * @generated + * @ordered + */ + protected Classifier base_Classifier; + + /** + * The default value of the '{@link #isFinal() Is Final}' attribute. + * + * + * + * @see #isFinal() + * @generated + * @ordered + */ + protected static final boolean IS_FINAL_EDEFAULT = false; + + /** + * The cached value of the '{@link #isFinal() Is Final}' attribute. + * + * + * + * @see #isFinal() + * @generated + * @ordered + */ + protected boolean isFinal = IS_FINAL_EDEFAULT; + + /** + * The default value of the '{@link #isAbstract() Is Abstract}' attribute. + * + * + * + * @see #isAbstract() + * @generated + * @ordered + */ + protected static final boolean IS_ABSTRACT_EDEFAULT = false; + + /** + * The cached value of the '{@link #isAbstract() Is Abstract}' attribute. + * + * + * + * @see #isAbstract() + * @generated + * @ordered + */ + protected boolean isAbstract = IS_ABSTRACT_EDEFAULT; + + /** + * The default value of the '{@link #isStatic() Is Static}' attribute. + * + * + * + * @see #isStatic() + * @generated + * @ordered + */ + protected static final boolean IS_STATIC_EDEFAULT = false; + + /** + * The cached value of the '{@link #isStatic() Is Static}' attribute. + * + * + * + * @see #isStatic() + * @generated + * @ordered + */ + protected boolean isStatic = IS_STATIC_EDEFAULT; + + /** + * The cached value of the '{@link #getExplicitPlainTextRequiredImports() Explicit Plain Text Required Imports}' attribute list. + * + * + * + * @see #getExplicitPlainTextRequiredImports() + * @generated + * @ordered + */ + protected EList explicitPlainTextRequiredImports; + + /** + * The cached value of the '{@link #getExplicitRequiredImports() Explicit Required Imports}' reference list. + * + * + * + * @see #getExplicitRequiredImports() + * @generated + * @ordered + */ + protected EList explicitRequiredImports; + + /** + * + * + * + * @generated + */ + protected JavaClassImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JavaPackage.Literals.JAVA_CLASS; + } + + /** + * + * + * + * @generated + */ + @Override + public Classifier getBase_Classifier() { + if (base_Classifier != null && base_Classifier.eIsProxy()) { + InternalEObject oldBase_Classifier = (InternalEObject) base_Classifier; + base_Classifier = (Classifier) eResolveProxy(oldBase_Classifier); + if (base_Classifier != oldBase_Classifier) { + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_CLASS__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier)); + } + } + } + return base_Classifier; + } + + /** + * + * + * + * @generated + */ + public Classifier basicGetBase_Classifier() { + return base_Classifier; + } + + /** + * + * + * + * @generated + */ + @Override + public void setBase_Classifier(Classifier newBase_Classifier) { + Classifier oldBase_Classifier = base_Classifier; + base_Classifier = newBase_Classifier; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_CLASS__BASE_CLASSIFIER, oldBase_Classifier, base_Classifier)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isFinal() { + return isFinal; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsFinal(boolean newIsFinal) { + boolean oldIsFinal = isFinal; + isFinal = newIsFinal; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_CLASS__IS_FINAL, oldIsFinal, isFinal)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isAbstract() { + return isAbstract; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsAbstract(boolean newIsAbstract) { + boolean oldIsAbstract = isAbstract; + isAbstract = newIsAbstract; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_CLASS__IS_ABSTRACT, oldIsAbstract, isAbstract)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isStatic() { + return isStatic; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsStatic(boolean newIsStatic) { + boolean oldIsStatic = isStatic; + isStatic = newIsStatic; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_CLASS__IS_STATIC, oldIsStatic, isStatic)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public EList getExplicitPlainTextRequiredImports() { + if (explicitPlainTextRequiredImports == null) { + explicitPlainTextRequiredImports = new EDataTypeEList(String.class, this, JavaPackage.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); + } + return explicitPlainTextRequiredImports; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getExplicitRequiredImports() { + if (explicitRequiredImports == null) { + explicitRequiredImports = new EObjectResolvingEList(Classifier.class, this, JavaPackage.JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS); + } + return explicitRequiredImports; + } + + /** + * + * + * + * @generated + */ + @Override + public Classifier getExplicitRequiredImports(String name) { + return getExplicitRequiredImports(name, false, null); + } + + /** + * + * + * + * @generated + */ + @Override + public Classifier getExplicitRequiredImports(String name, boolean ignoreCase, EClass eClass) { + explicitRequiredImportsLoop: for (Classifier explicitRequiredImports : getExplicitRequiredImports()) { + if (eClass != null && !eClass.isInstance(explicitRequiredImports)) { + continue explicitRequiredImportsLoop; + } + if (name != null && !(ignoreCase ? name.equalsIgnoreCase(explicitRequiredImports.getName()) : name.equals(explicitRequiredImports.getName()))) { + continue explicitRequiredImportsLoop; + } + return explicitRequiredImports; + } + return null; + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JavaPackage.JAVA_CLASS__BASE_CLASSIFIER: + if (resolve) { + return getBase_Classifier(); + } + return basicGetBase_Classifier(); + case JavaPackage.JAVA_CLASS__IS_FINAL: + return isFinal(); + case JavaPackage.JAVA_CLASS__IS_ABSTRACT: + return isAbstract(); + case JavaPackage.JAVA_CLASS__IS_STATIC: + return isStatic(); + case JavaPackage.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + return getExplicitPlainTextRequiredImports(); + case JavaPackage.JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS: + return getExplicitRequiredImports(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JavaPackage.JAVA_CLASS__BASE_CLASSIFIER: + setBase_Classifier((Classifier) newValue); + return; + case JavaPackage.JAVA_CLASS__IS_FINAL: + setIsFinal((Boolean) newValue); + return; + case JavaPackage.JAVA_CLASS__IS_ABSTRACT: + setIsAbstract((Boolean) newValue); + return; + case JavaPackage.JAVA_CLASS__IS_STATIC: + setIsStatic((Boolean) newValue); + return; + case JavaPackage.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + getExplicitPlainTextRequiredImports().clear(); + getExplicitPlainTextRequiredImports().addAll((Collection) newValue); + return; + case JavaPackage.JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS: + getExplicitRequiredImports().clear(); + getExplicitRequiredImports().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_CLASS__BASE_CLASSIFIER: + setBase_Classifier((Classifier) null); + return; + case JavaPackage.JAVA_CLASS__IS_FINAL: + setIsFinal(IS_FINAL_EDEFAULT); + return; + case JavaPackage.JAVA_CLASS__IS_ABSTRACT: + setIsAbstract(IS_ABSTRACT_EDEFAULT); + return; + case JavaPackage.JAVA_CLASS__IS_STATIC: + setIsStatic(IS_STATIC_EDEFAULT); + return; + case JavaPackage.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + getExplicitPlainTextRequiredImports().clear(); + return; + case JavaPackage.JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS: + getExplicitRequiredImports().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_CLASS__BASE_CLASSIFIER: + return base_Classifier != null; + case JavaPackage.JAVA_CLASS__IS_FINAL: + return isFinal != IS_FINAL_EDEFAULT; + case JavaPackage.JAVA_CLASS__IS_ABSTRACT: + return isAbstract != IS_ABSTRACT_EDEFAULT; + case JavaPackage.JAVA_CLASS__IS_STATIC: + return isStatic != IS_STATIC_EDEFAULT; + case JavaPackage.JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + return explicitPlainTextRequiredImports != null && !explicitPlainTextRequiredImports.isEmpty(); + case JavaPackage.JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS: + return explicitRequiredImports != null && !explicitRequiredImports.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (isFinal: "); + result.append(isFinal); + result.append(", isAbstract: "); + result.append(isAbstract); + result.append(", isStatic: "); + result.append(isStatic); + result.append(", explicitPlainTextRequiredImports: "); + result.append(explicitPlainTextRequiredImports); + result.append(')'); + return result.toString(); + } + +} // JavaClassImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaFactoryImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaFactoryImpl.java new file mode 100644 index 00000000000..815339c6983 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaFactoryImpl.java @@ -0,0 +1,270 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.impl.EFactoryImpl; +import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.eclipse.papyrus.java.profile.java.JavaClass; +import org.eclipse.papyrus.java.profile.java.JavaFactory; +import org.eclipse.papyrus.java.profile.java.JavaMethod; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaPackage_; +import org.eclipse.papyrus.java.profile.java.JavaParameter; +import org.eclipse.papyrus.java.profile.java.JavaProject; +import org.eclipse.papyrus.java.profile.java.JavaProperty; +import org.eclipse.papyrus.java.profile.java.JavaSrcFolder; +import org.eclipse.papyrus.java.profile.java.PrimitiveType; +import org.eclipse.papyrus.java.profile.java.TrueFalseDefault; + +/** + * + * An implementation of the model Factory. + * + * + * @generated + */ +public class JavaFactoryImpl extends EFactoryImpl implements JavaFactory { + /** + * Creates the default factory implementation. + * + * + * + * @generated + */ + public static JavaFactory init() { + try { + JavaFactory theJavaFactory = (JavaFactory) EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/JAVA/1"); + if (theJavaFactory != null) { + return theJavaFactory; + } + } catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new JavaFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * + * @generated + */ + public JavaFactoryImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case JavaPackage.JAVA_CLASS: + return createJavaClass(); + case JavaPackage.JAVA_PACKAGE_: + return createJavaPackage_(); + case JavaPackage.JAVA_METHOD: + return createJavaMethod(); + case JavaPackage.JAVA_PARAMETER: + return createJavaParameter(); + case JavaPackage.JAVA_PROPERTY: + return createJavaProperty(); + case JavaPackage.PRIMITIVE_TYPE: + return createPrimitiveType(); + case JavaPackage.JAVA_PROJECT: + return createJavaProject(); + case JavaPackage.JAVA_SRC_FOLDER: + return createJavaSrcFolder(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Object createFromString(EDataType eDataType, String initialValue) { + switch (eDataType.getClassifierID()) { + case JavaPackage.TRUE_FALSE_DEFAULT: + return createTrueFalseDefaultFromString(eDataType, initialValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * + * @generated + */ + @Override + public String convertToString(EDataType eDataType, Object instanceValue) { + switch (eDataType.getClassifierID()) { + case JavaPackage.TRUE_FALSE_DEFAULT: + return convertTrueFalseDefaultToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * + * @generated + */ + @Override + public JavaClass createJavaClass() { + JavaClassImpl javaClass = new JavaClassImpl(); + return javaClass; + } + + /** + * + * + * + * @generated + */ + @Override + public JavaPackage_ createJavaPackage_() { + JavaPackage_Impl javaPackage_ = new JavaPackage_Impl(); + return javaPackage_; + } + + /** + * + * + * + * @generated + */ + @Override + public JavaMethod createJavaMethod() { + JavaMethodImpl javaMethod = new JavaMethodImpl(); + return javaMethod; + } + + /** + * + * + * + * @generated + */ + @Override + public JavaParameter createJavaParameter() { + JavaParameterImpl javaParameter = new JavaParameterImpl(); + return javaParameter; + } + + /** + * + * + * + * @generated + */ + @Override + public JavaProperty createJavaProperty() { + JavaPropertyImpl javaProperty = new JavaPropertyImpl(); + return javaProperty; + } + + /** + * + * + * + * @generated + */ + @Override + public PrimitiveType createPrimitiveType() { + PrimitiveTypeImpl primitiveType = new PrimitiveTypeImpl(); + return primitiveType; + } + + /** + * + * + * + * @generated + */ + @Override + public JavaProject createJavaProject() { + JavaProjectImpl javaProject = new JavaProjectImpl(); + return javaProject; + } + + /** + * + * + * + * @generated + */ + @Override + public JavaSrcFolder createJavaSrcFolder() { + JavaSrcFolderImpl javaSrcFolder = new JavaSrcFolderImpl(); + return javaSrcFolder; + } + + /** + * + * + * + * @generated + */ + public TrueFalseDefault createTrueFalseDefaultFromString(EDataType eDataType, String initialValue) { + TrueFalseDefault result = TrueFalseDefault.get(initialValue); + if (result == null) { + throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + } + return result; + } + + /** + * + * + * + * @generated + */ + public String convertTrueFalseDefaultToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * + * @generated + */ + @Override + public JavaPackage getJavaPackage() { + return (JavaPackage) getEPackage(); + } + + /** + * + * + * + * @deprecated + * @generated + */ + @Deprecated + public static JavaPackage getPackage() { + return JavaPackage.eINSTANCE; + } + +} // JavaFactoryImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaGenImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaGenImpl.java new file mode 100644 index 00000000000..d9fb5127c2b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaGenImpl.java @@ -0,0 +1,240 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.papyrus.java.profile.java.JavaGen; +import org.eclipse.papyrus.java.profile.java.JavaPackage; + +/** + * + * An implementation of the model object 'Gen'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaGenImpl#getSrcName Src Name}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaGenImpl#getProjectName Project Name}
    • + *
    + *

    + * + * @generated + */ +public abstract class JavaGenImpl extends JavaNamedElementImpl implements JavaGen { + /** + * The default value of the '{@link #getSrcName() Src Name}' attribute. + * + * + * + * @see #getSrcName() + * @generated + * @ordered + */ + protected static final String SRC_NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getSrcName() Src Name}' attribute. + * + * + * + * @see #getSrcName() + * @generated + * @ordered + */ + protected String srcName = SRC_NAME_EDEFAULT; + + /** + * The default value of the '{@link #getProjectName() Project Name}' attribute. + * + * + * + * @see #getProjectName() + * @generated + * @ordered + */ + protected static final String PROJECT_NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getProjectName() Project Name}' attribute. + * + * + * + * @see #getProjectName() + * @generated + * @ordered + */ + protected String projectName = PROJECT_NAME_EDEFAULT; + + /** + * + * + * + * @generated + */ + protected JavaGenImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JavaPackage.Literals.JAVA_GEN; + } + + /** + * + * + * + * @generated + */ + @Override + public String getSrcName() { + return srcName; + } + + /** + * + * + * + * @generated + */ + @Override + public void setSrcName(String newSrcName) { + String oldSrcName = srcName; + srcName = newSrcName; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_GEN__SRC_NAME, oldSrcName, srcName)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public String getProjectName() { + return projectName; + } + + /** + * + * + * + * @generated + */ + @Override + public void setProjectName(String newProjectName) { + String oldProjectName = projectName; + projectName = newProjectName; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_GEN__PROJECT_NAME, oldProjectName, projectName)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JavaPackage.JAVA_GEN__SRC_NAME: + return getSrcName(); + case JavaPackage.JAVA_GEN__PROJECT_NAME: + return getProjectName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JavaPackage.JAVA_GEN__SRC_NAME: + setSrcName((String) newValue); + return; + case JavaPackage.JAVA_GEN__PROJECT_NAME: + setProjectName((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_GEN__SRC_NAME: + setSrcName(SRC_NAME_EDEFAULT); + return; + case JavaPackage.JAVA_GEN__PROJECT_NAME: + setProjectName(PROJECT_NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_GEN__SRC_NAME: + return SRC_NAME_EDEFAULT == null ? srcName != null : !SRC_NAME_EDEFAULT.equals(srcName); + case JavaPackage.JAVA_GEN__PROJECT_NAME: + return PROJECT_NAME_EDEFAULT == null ? projectName != null : !PROJECT_NAME_EDEFAULT.equals(projectName); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (srcName: "); + result.append(srcName); + result.append(", projectName: "); + result.append(projectName); + result.append(')'); + return result.toString(); + } + +} // JavaGenImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaMethodImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaMethodImpl.java new file mode 100644 index 00000000000..ba74887b921 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaMethodImpl.java @@ -0,0 +1,670 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EDataTypeEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.papyrus.java.profile.java.JavaMethod; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Operation; + +/** + * + * An implementation of the model object 'Method'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#isStatic Is Static}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#isFinal Is Final}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#isAbstract Is Abstract}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#isNative Is Native}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#isSynchronized Is Synchronized}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#isConstructor Is Constructor}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#getBase_Operation Base Operation}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaMethodImpl#getExplicitRequiredImports Explicit Required Imports}
    • + *
    + *

    + * + * @generated + */ +public class JavaMethodImpl extends JavaNamedElementImpl implements JavaMethod { + /** + * The default value of the '{@link #isStatic() Is Static}' attribute. + * + * + * + * @see #isStatic() + * @generated + * @ordered + */ + protected static final boolean IS_STATIC_EDEFAULT = false; + + /** + * The cached value of the '{@link #isStatic() Is Static}' attribute. + * + * + * + * @see #isStatic() + * @generated + * @ordered + */ + protected boolean isStatic = IS_STATIC_EDEFAULT; + + /** + * The default value of the '{@link #isFinal() Is Final}' attribute. + * + * + * + * @see #isFinal() + * @generated + * @ordered + */ + protected static final boolean IS_FINAL_EDEFAULT = false; + + /** + * The cached value of the '{@link #isFinal() Is Final}' attribute. + * + * + * + * @see #isFinal() + * @generated + * @ordered + */ + protected boolean isFinal = IS_FINAL_EDEFAULT; + + /** + * The default value of the '{@link #isAbstract() Is Abstract}' attribute. + * + * + * + * @see #isAbstract() + * @generated + * @ordered + */ + protected static final boolean IS_ABSTRACT_EDEFAULT = false; + + /** + * The cached value of the '{@link #isAbstract() Is Abstract}' attribute. + * + * + * + * @see #isAbstract() + * @generated + * @ordered + */ + protected boolean isAbstract = IS_ABSTRACT_EDEFAULT; + + /** + * The default value of the '{@link #isNative() Is Native}' attribute. + * + * + * + * @see #isNative() + * @generated + * @ordered + */ + protected static final boolean IS_NATIVE_EDEFAULT = false; + + /** + * The cached value of the '{@link #isNative() Is Native}' attribute. + * + * + * + * @see #isNative() + * @generated + * @ordered + */ + protected boolean isNative = IS_NATIVE_EDEFAULT; + + /** + * The default value of the '{@link #isSynchronized() Is Synchronized}' attribute. + * + * + * + * @see #isSynchronized() + * @generated + * @ordered + */ + protected static final boolean IS_SYNCHRONIZED_EDEFAULT = false; + + /** + * The cached value of the '{@link #isSynchronized() Is Synchronized}' attribute. + * + * + * + * @see #isSynchronized() + * @generated + * @ordered + */ + protected boolean isSynchronized = IS_SYNCHRONIZED_EDEFAULT; + + /** + * The default value of the '{@link #isConstructor() Is Constructor}' attribute. + * + * + * + * @see #isConstructor() + * @generated + * @ordered + */ + protected static final boolean IS_CONSTRUCTOR_EDEFAULT = false; + + /** + * The cached value of the '{@link #isConstructor() Is Constructor}' attribute. + * + * + * + * @see #isConstructor() + * @generated + * @ordered + */ + protected boolean isConstructor = IS_CONSTRUCTOR_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_Operation() Base Operation}' reference. + * + * + * + * @see #getBase_Operation() + * @generated + * @ordered + */ + protected Operation base_Operation; + + /** + * The cached value of the '{@link #getExplicitPlainTextRequiredImports() Explicit Plain Text Required Imports}' attribute list. + * + * + * + * @see #getExplicitPlainTextRequiredImports() + * @generated + * @ordered + */ + protected EList explicitPlainTextRequiredImports; + + /** + * The cached value of the '{@link #getExplicitRequiredImports() Explicit Required Imports}' reference list. + * + * + * + * @see #getExplicitRequiredImports() + * @generated + * @ordered + */ + protected EList explicitRequiredImports; + + /** + * + * + * + * @generated + */ + protected JavaMethodImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JavaPackage.Literals.JAVA_METHOD; + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isStatic() { + return isStatic; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsStatic(boolean newIsStatic) { + boolean oldIsStatic = isStatic; + isStatic = newIsStatic; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__IS_STATIC, oldIsStatic, isStatic)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isFinal() { + return isFinal; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsFinal(boolean newIsFinal) { + boolean oldIsFinal = isFinal; + isFinal = newIsFinal; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__IS_FINAL, oldIsFinal, isFinal)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isAbstract() { + return isAbstract; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsAbstract(boolean newIsAbstract) { + boolean oldIsAbstract = isAbstract; + isAbstract = newIsAbstract; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__IS_ABSTRACT, oldIsAbstract, isAbstract)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isNative() { + return isNative; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsNative(boolean newIsNative) { + boolean oldIsNative = isNative; + isNative = newIsNative; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__IS_NATIVE, oldIsNative, isNative)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isSynchronized() { + return isSynchronized; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsSynchronized(boolean newIsSynchronized) { + boolean oldIsSynchronized = isSynchronized; + isSynchronized = newIsSynchronized; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__IS_SYNCHRONIZED, oldIsSynchronized, isSynchronized)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isConstructor() { + return isConstructor; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsConstructor(boolean newIsConstructor) { + boolean oldIsConstructor = isConstructor; + isConstructor = newIsConstructor; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__IS_CONSTRUCTOR, oldIsConstructor, isConstructor)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Operation getBase_Operation() { + if (base_Operation != null && base_Operation.eIsProxy()) { + InternalEObject oldBase_Operation = (InternalEObject) base_Operation; + base_Operation = (Operation) eResolveProxy(oldBase_Operation); + if (base_Operation != oldBase_Operation) { + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_METHOD__BASE_OPERATION, oldBase_Operation, base_Operation)); + } + } + } + return base_Operation; + } + + /** + * + * + * + * @generated + */ + public Operation basicGetBase_Operation() { + return base_Operation; + } + + /** + * + * + * + * @generated + */ + @Override + public void setBase_Operation(Operation newBase_Operation) { + Operation oldBase_Operation = base_Operation; + base_Operation = newBase_Operation; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_METHOD__BASE_OPERATION, oldBase_Operation, base_Operation)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public EList getExplicitPlainTextRequiredImports() { + if (explicitPlainTextRequiredImports == null) { + explicitPlainTextRequiredImports = new EDataTypeEList(String.class, this, JavaPackage.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); + } + return explicitPlainTextRequiredImports; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getExplicitRequiredImports() { + if (explicitRequiredImports == null) { + explicitRequiredImports = new EObjectResolvingEList(Classifier.class, this, JavaPackage.JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS); + } + return explicitRequiredImports; + } + + /** + * + * + * + * @generated + */ + @Override + public Classifier getExplicitRequiredImports(String name) { + return getExplicitRequiredImports(name, false, null); + } + + /** + * + * + * + * @generated + */ + @Override + public Classifier getExplicitRequiredImports(String name, boolean ignoreCase, EClass eClass) { + explicitRequiredImportsLoop: for (Classifier explicitRequiredImports : getExplicitRequiredImports()) { + if (eClass != null && !eClass.isInstance(explicitRequiredImports)) { + continue explicitRequiredImportsLoop; + } + if (name != null && !(ignoreCase ? name.equalsIgnoreCase(explicitRequiredImports.getName()) : name.equals(explicitRequiredImports.getName()))) { + continue explicitRequiredImportsLoop; + } + return explicitRequiredImports; + } + return null; + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JavaPackage.JAVA_METHOD__IS_STATIC: + return isStatic(); + case JavaPackage.JAVA_METHOD__IS_FINAL: + return isFinal(); + case JavaPackage.JAVA_METHOD__IS_ABSTRACT: + return isAbstract(); + case JavaPackage.JAVA_METHOD__IS_NATIVE: + return isNative(); + case JavaPackage.JAVA_METHOD__IS_SYNCHRONIZED: + return isSynchronized(); + case JavaPackage.JAVA_METHOD__IS_CONSTRUCTOR: + return isConstructor(); + case JavaPackage.JAVA_METHOD__BASE_OPERATION: + if (resolve) { + return getBase_Operation(); + } + return basicGetBase_Operation(); + case JavaPackage.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + return getExplicitPlainTextRequiredImports(); + case JavaPackage.JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS: + return getExplicitRequiredImports(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JavaPackage.JAVA_METHOD__IS_STATIC: + setIsStatic((Boolean) newValue); + return; + case JavaPackage.JAVA_METHOD__IS_FINAL: + setIsFinal((Boolean) newValue); + return; + case JavaPackage.JAVA_METHOD__IS_ABSTRACT: + setIsAbstract((Boolean) newValue); + return; + case JavaPackage.JAVA_METHOD__IS_NATIVE: + setIsNative((Boolean) newValue); + return; + case JavaPackage.JAVA_METHOD__IS_SYNCHRONIZED: + setIsSynchronized((Boolean) newValue); + return; + case JavaPackage.JAVA_METHOD__IS_CONSTRUCTOR: + setIsConstructor((Boolean) newValue); + return; + case JavaPackage.JAVA_METHOD__BASE_OPERATION: + setBase_Operation((Operation) newValue); + return; + case JavaPackage.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + getExplicitPlainTextRequiredImports().clear(); + getExplicitPlainTextRequiredImports().addAll((Collection) newValue); + return; + case JavaPackage.JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS: + getExplicitRequiredImports().clear(); + getExplicitRequiredImports().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_METHOD__IS_STATIC: + setIsStatic(IS_STATIC_EDEFAULT); + return; + case JavaPackage.JAVA_METHOD__IS_FINAL: + setIsFinal(IS_FINAL_EDEFAULT); + return; + case JavaPackage.JAVA_METHOD__IS_ABSTRACT: + setIsAbstract(IS_ABSTRACT_EDEFAULT); + return; + case JavaPackage.JAVA_METHOD__IS_NATIVE: + setIsNative(IS_NATIVE_EDEFAULT); + return; + case JavaPackage.JAVA_METHOD__IS_SYNCHRONIZED: + setIsSynchronized(IS_SYNCHRONIZED_EDEFAULT); + return; + case JavaPackage.JAVA_METHOD__IS_CONSTRUCTOR: + setIsConstructor(IS_CONSTRUCTOR_EDEFAULT); + return; + case JavaPackage.JAVA_METHOD__BASE_OPERATION: + setBase_Operation((Operation) null); + return; + case JavaPackage.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + getExplicitPlainTextRequiredImports().clear(); + return; + case JavaPackage.JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS: + getExplicitRequiredImports().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_METHOD__IS_STATIC: + return isStatic != IS_STATIC_EDEFAULT; + case JavaPackage.JAVA_METHOD__IS_FINAL: + return isFinal != IS_FINAL_EDEFAULT; + case JavaPackage.JAVA_METHOD__IS_ABSTRACT: + return isAbstract != IS_ABSTRACT_EDEFAULT; + case JavaPackage.JAVA_METHOD__IS_NATIVE: + return isNative != IS_NATIVE_EDEFAULT; + case JavaPackage.JAVA_METHOD__IS_SYNCHRONIZED: + return isSynchronized != IS_SYNCHRONIZED_EDEFAULT; + case JavaPackage.JAVA_METHOD__IS_CONSTRUCTOR: + return isConstructor != IS_CONSTRUCTOR_EDEFAULT; + case JavaPackage.JAVA_METHOD__BASE_OPERATION: + return base_Operation != null; + case JavaPackage.JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + return explicitPlainTextRequiredImports != null && !explicitPlainTextRequiredImports.isEmpty(); + case JavaPackage.JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS: + return explicitRequiredImports != null && !explicitRequiredImports.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (isStatic: "); + result.append(isStatic); + result.append(", isFinal: "); + result.append(isFinal); + result.append(", isAbstract: "); + result.append(isAbstract); + result.append(", isNative: "); + result.append(isNative); + result.append(", isSynchronized: "); + result.append(isSynchronized); + result.append(", isConstructor: "); + result.append(isConstructor); + result.append(", explicitPlainTextRequiredImports: "); + result.append(explicitPlainTextRequiredImports); + result.append(')'); + return result.toString(); + } + +} // JavaMethodImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaNamedElementImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaNamedElementImpl.java new file mode 100644 index 00000000000..f3876cd8961 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaNamedElementImpl.java @@ -0,0 +1,424 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.java.profile.java.JavaNamedElement; +import org.eclipse.papyrus.java.profile.java.JavaPackage; + +/** + * + * An implementation of the model object 'Named Element'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl#getName Name}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl#getAuthor Author}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl#getVersion Version}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl#getComment Comment}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaNamedElementImpl#isGenerated Is Generated}
    • + *
    + *

    + * + * @generated + */ +public abstract class JavaNamedElementImpl extends EObjectImpl implements JavaNamedElement { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getAuthor() Author}' attribute. + * + * + * + * @see #getAuthor() + * @generated + * @ordered + */ + protected static final String AUTHOR_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAuthor() Author}' attribute. + * + * + * + * @see #getAuthor() + * @generated + * @ordered + */ + protected String author = AUTHOR_EDEFAULT; + + /** + * The default value of the '{@link #getVersion() Version}' attribute. + * + * + * + * @see #getVersion() + * @generated + * @ordered + */ + protected static final String VERSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getVersion() Version}' attribute. + * + * + * + * @see #getVersion() + * @generated + * @ordered + */ + protected String version = VERSION_EDEFAULT; + + /** + * The default value of the '{@link #getComment() Comment}' attribute. + * + * + * + * @see #getComment() + * @generated + * @ordered + */ + protected static final String COMMENT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getComment() Comment}' attribute. + * + * + * + * @see #getComment() + * @generated + * @ordered + */ + protected String comment = COMMENT_EDEFAULT; + + /** + * The default value of the '{@link #isGenerated() Is Generated}' attribute. + * + * + * + * @see #isGenerated() + * @generated + * @ordered + */ + protected static final boolean IS_GENERATED_EDEFAULT = true; + + /** + * The cached value of the '{@link #isGenerated() Is Generated}' attribute. + * + * + * + * @see #isGenerated() + * @generated + * @ordered + */ + protected boolean isGenerated = IS_GENERATED_EDEFAULT; + + /** + * + * + * + * @generated + */ + protected JavaNamedElementImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JavaPackage.Literals.JAVA_NAMED_ELEMENT; + } + + /** + * + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_NAMED_ELEMENT__NAME, oldName, name)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public String getAuthor() { + return author; + } + + /** + * + * + * + * @generated + */ + @Override + public void setAuthor(String newAuthor) { + String oldAuthor = author; + author = newAuthor; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_NAMED_ELEMENT__AUTHOR, oldAuthor, author)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public String getVersion() { + return version; + } + + /** + * + * + * + * @generated + */ + @Override + public void setVersion(String newVersion) { + String oldVersion = version; + version = newVersion; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_NAMED_ELEMENT__VERSION, oldVersion, version)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public String getComment() { + return comment; + } + + /** + * + * + * + * @generated + */ + @Override + public void setComment(String newComment) { + String oldComment = comment; + comment = newComment; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_NAMED_ELEMENT__COMMENT, oldComment, comment)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isGenerated() { + return isGenerated; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsGenerated(boolean newIsGenerated) { + boolean oldIsGenerated = isGenerated; + isGenerated = newIsGenerated; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_NAMED_ELEMENT__IS_GENERATED, oldIsGenerated, isGenerated)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JavaPackage.JAVA_NAMED_ELEMENT__NAME: + return getName(); + case JavaPackage.JAVA_NAMED_ELEMENT__AUTHOR: + return getAuthor(); + case JavaPackage.JAVA_NAMED_ELEMENT__VERSION: + return getVersion(); + case JavaPackage.JAVA_NAMED_ELEMENT__COMMENT: + return getComment(); + case JavaPackage.JAVA_NAMED_ELEMENT__IS_GENERATED: + return isGenerated(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JavaPackage.JAVA_NAMED_ELEMENT__NAME: + setName((String) newValue); + return; + case JavaPackage.JAVA_NAMED_ELEMENT__AUTHOR: + setAuthor((String) newValue); + return; + case JavaPackage.JAVA_NAMED_ELEMENT__VERSION: + setVersion((String) newValue); + return; + case JavaPackage.JAVA_NAMED_ELEMENT__COMMENT: + setComment((String) newValue); + return; + case JavaPackage.JAVA_NAMED_ELEMENT__IS_GENERATED: + setIsGenerated((Boolean) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_NAMED_ELEMENT__NAME: + setName(NAME_EDEFAULT); + return; + case JavaPackage.JAVA_NAMED_ELEMENT__AUTHOR: + setAuthor(AUTHOR_EDEFAULT); + return; + case JavaPackage.JAVA_NAMED_ELEMENT__VERSION: + setVersion(VERSION_EDEFAULT); + return; + case JavaPackage.JAVA_NAMED_ELEMENT__COMMENT: + setComment(COMMENT_EDEFAULT); + return; + case JavaPackage.JAVA_NAMED_ELEMENT__IS_GENERATED: + setIsGenerated(IS_GENERATED_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_NAMED_ELEMENT__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case JavaPackage.JAVA_NAMED_ELEMENT__AUTHOR: + return AUTHOR_EDEFAULT == null ? author != null : !AUTHOR_EDEFAULT.equals(author); + case JavaPackage.JAVA_NAMED_ELEMENT__VERSION: + return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version); + case JavaPackage.JAVA_NAMED_ELEMENT__COMMENT: + return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment); + case JavaPackage.JAVA_NAMED_ELEMENT__IS_GENERATED: + return isGenerated != IS_GENERATED_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(", author: "); + result.append(author); + result.append(", version: "); + result.append(version); + result.append(", comment: "); + result.append(comment); + result.append(", isGenerated: "); + result.append(isGenerated); + result.append(')'); + return result.toString(); + } + +} // JavaNamedElementImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackageImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackageImpl.java new file mode 100644 index 00000000000..c692fe3aa4f --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackageImpl.java @@ -0,0 +1,978 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.impl.EPackageImpl; +import org.eclipse.papyrus.java.profile.java.JavaClass; +import org.eclipse.papyrus.java.profile.java.JavaFactory; +import org.eclipse.papyrus.java.profile.java.JavaGen; +import org.eclipse.papyrus.java.profile.java.JavaMethod; +import org.eclipse.papyrus.java.profile.java.JavaNamedElement; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaPackage_; +import org.eclipse.papyrus.java.profile.java.JavaParameter; +import org.eclipse.papyrus.java.profile.java.JavaProject; +import org.eclipse.papyrus.java.profile.java.JavaProperty; +import org.eclipse.papyrus.java.profile.java.JavaSrcFolder; +import org.eclipse.papyrus.java.profile.java.PrimitiveType; +import org.eclipse.papyrus.java.profile.java.TrueFalseDefault; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * + * An implementation of the model Package. + * + * + * @generated + */ +public class JavaPackageImpl extends EPackageImpl implements JavaPackage { + /** + * + * + * + * @generated + */ + private EClass javaClassEClass = null; + + /** + * + * + * + * @generated + */ + private EClass javaGenEClass = null; + + /** + * + * + * + * @generated + */ + private EClass javaNamedElementEClass = null; + + /** + * + * + * + * @generated + */ + private EClass javaPackage_EClass = null; + + /** + * + * + * + * @generated + */ + private EClass javaMethodEClass = null; + + /** + * + * + * + * @generated + */ + private EClass javaParameterEClass = null; + + /** + * + * + * + * @generated + */ + private EClass javaPropertyEClass = null; + + /** + * + * + * + * @generated + */ + private EClass primitiveTypeEClass = null; + + /** + * + * + * + * @generated + */ + private EClass javaProjectEClass = null; + + /** + * + * + * + * @generated + */ + private EClass javaSrcFolderEClass = null; + + /** + * + * + * + * @generated + */ + private EEnum trueFalseDefaultEEnum = null; + + /** + * Creates an instance of the model Package, registered with {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

    + * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also performs initialization of the package, or returns the registered package, if one already exists. + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.papyrus.java.profile.java.JavaPackage#eNS_URI + * @see #init() + * @generated + */ + private JavaPackageImpl() { + super(eNS_URI, JavaFactory.eINSTANCE); + } + + /** + * + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

    + * This method is used to initialize {@link JavaPackage#eINSTANCE} when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static JavaPackage init() { + if (isInited) { + return (JavaPackage) EPackage.Registry.INSTANCE.getEPackage(JavaPackage.eNS_URI); + } + + // Obtain or create and register package + JavaPackageImpl theJavaPackage = (JavaPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof JavaPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new JavaPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + UMLPackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theJavaPackage.createPackageContents(); + + // Initialize created meta-data + theJavaPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theJavaPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(JavaPackage.eNS_URI, theJavaPackage); + return theJavaPackage; + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJavaClass() { + return javaClassEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJavaClass_Base_Classifier() { + return (EReference) javaClassEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaClass_IsFinal() { + return (EAttribute) javaClassEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaClass_IsAbstract() { + return (EAttribute) javaClassEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaClass_IsStatic() { + return (EAttribute) javaClassEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaClass_ExplicitPlainTextRequiredImports() { + return (EAttribute) javaClassEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJavaClass_ExplicitRequiredImports() { + return (EReference) javaClassEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJavaGen() { + return javaGenEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaGen_SrcName() { + return (EAttribute) javaGenEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaGen_ProjectName() { + return (EAttribute) javaGenEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJavaNamedElement() { + return javaNamedElementEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaNamedElement_Name() { + return (EAttribute) javaNamedElementEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaNamedElement_Author() { + return (EAttribute) javaNamedElementEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaNamedElement_Version() { + return (EAttribute) javaNamedElementEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaNamedElement_Comment() { + return (EAttribute) javaNamedElementEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaNamedElement_IsGenerated() { + return (EAttribute) javaNamedElementEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJavaPackage_() { + return javaPackage_EClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaPackage__PackageName() { + return (EAttribute) javaPackage_EClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJavaPackage__Base_Package() { + return (EReference) javaPackage_EClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJavaMethod() { + return javaMethodEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaMethod_IsStatic() { + return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaMethod_IsFinal() { + return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaMethod_IsAbstract() { + return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaMethod_IsNative() { + return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaMethod_IsSynchronized() { + return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaMethod_IsConstructor() { + return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJavaMethod_Base_Operation() { + return (EReference) javaMethodEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaMethod_ExplicitPlainTextRequiredImports() { + return (EAttribute) javaMethodEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJavaMethod_ExplicitRequiredImports() { + return (EReference) javaMethodEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJavaParameter() { + return javaParameterEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaParameter_IsFinal() { + return (EAttribute) javaParameterEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJavaParameter_Base_Parameter() { + return (EReference) javaParameterEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJavaProperty() { + return javaPropertyEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaProperty_IsAbstract() { + return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaProperty_IsFinal() { + return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJavaProperty_Base_Property() { + return (EReference) javaPropertyEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaProperty_IsTransient() { + return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaProperty_GenerateGetter() { + return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaProperty_GenerateSetter() { + return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaProperty_IsStatic() { + return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getJavaProperty_ExplicitPlainTextRequiredImports() { + return (EAttribute) javaPropertyEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJavaProperty_ExplicitRequiredImports() { + return (EReference) javaPropertyEClass.getEStructuralFeatures().get(8); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getPrimitiveType() { + return primitiveTypeEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getPrimitiveType_ImplementationClass() { + return (EAttribute) primitiveTypeEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getPrimitiveType_Base_PrimitiveType() { + return (EReference) primitiveTypeEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * + * @generated + */ + @Override + public EAttribute getPrimitiveType_CollectionImplementationClass() { + return (EAttribute) primitiveTypeEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJavaProject() { + return javaProjectEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJavaProject_Base_Package() { + return (EReference) javaProjectEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EClass getJavaSrcFolder() { + return javaSrcFolderEClass; + } + + /** + * + * + * + * @generated + */ + @Override + public EReference getJavaSrcFolder_Base_Package() { + return (EReference) javaSrcFolderEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * + * @generated + */ + @Override + public EEnum getTrueFalseDefault() { + return trueFalseDefaultEEnum; + } + + /** + * + * + * + * @generated + */ + @Override + public JavaFactory getJavaFactory() { + return (JavaFactory) getEFactoryInstance(); + } + + /** + * + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) { + return; + } + isCreated = true; + + // Create classes and their features + javaClassEClass = createEClass(JAVA_CLASS); + createEReference(javaClassEClass, JAVA_CLASS__BASE_CLASSIFIER); + createEAttribute(javaClassEClass, JAVA_CLASS__IS_FINAL); + createEAttribute(javaClassEClass, JAVA_CLASS__IS_ABSTRACT); + createEAttribute(javaClassEClass, JAVA_CLASS__IS_STATIC); + createEAttribute(javaClassEClass, JAVA_CLASS__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); + createEReference(javaClassEClass, JAVA_CLASS__EXPLICIT_REQUIRED_IMPORTS); + + javaGenEClass = createEClass(JAVA_GEN); + createEAttribute(javaGenEClass, JAVA_GEN__SRC_NAME); + createEAttribute(javaGenEClass, JAVA_GEN__PROJECT_NAME); + + javaNamedElementEClass = createEClass(JAVA_NAMED_ELEMENT); + createEAttribute(javaNamedElementEClass, JAVA_NAMED_ELEMENT__NAME); + createEAttribute(javaNamedElementEClass, JAVA_NAMED_ELEMENT__AUTHOR); + createEAttribute(javaNamedElementEClass, JAVA_NAMED_ELEMENT__VERSION); + createEAttribute(javaNamedElementEClass, JAVA_NAMED_ELEMENT__COMMENT); + createEAttribute(javaNamedElementEClass, JAVA_NAMED_ELEMENT__IS_GENERATED); + + javaPackage_EClass = createEClass(JAVA_PACKAGE_); + createEAttribute(javaPackage_EClass, JAVA_PACKAGE___PACKAGE_NAME); + createEReference(javaPackage_EClass, JAVA_PACKAGE___BASE_PACKAGE); + + javaMethodEClass = createEClass(JAVA_METHOD); + createEAttribute(javaMethodEClass, JAVA_METHOD__IS_STATIC); + createEAttribute(javaMethodEClass, JAVA_METHOD__IS_FINAL); + createEAttribute(javaMethodEClass, JAVA_METHOD__IS_ABSTRACT); + createEAttribute(javaMethodEClass, JAVA_METHOD__IS_NATIVE); + createEAttribute(javaMethodEClass, JAVA_METHOD__IS_SYNCHRONIZED); + createEAttribute(javaMethodEClass, JAVA_METHOD__IS_CONSTRUCTOR); + createEReference(javaMethodEClass, JAVA_METHOD__BASE_OPERATION); + createEAttribute(javaMethodEClass, JAVA_METHOD__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); + createEReference(javaMethodEClass, JAVA_METHOD__EXPLICIT_REQUIRED_IMPORTS); + + javaParameterEClass = createEClass(JAVA_PARAMETER); + createEAttribute(javaParameterEClass, JAVA_PARAMETER__IS_FINAL); + createEReference(javaParameterEClass, JAVA_PARAMETER__BASE_PARAMETER); + + javaPropertyEClass = createEClass(JAVA_PROPERTY); + createEAttribute(javaPropertyEClass, JAVA_PROPERTY__IS_ABSTRACT); + createEAttribute(javaPropertyEClass, JAVA_PROPERTY__IS_FINAL); + createEReference(javaPropertyEClass, JAVA_PROPERTY__BASE_PROPERTY); + createEAttribute(javaPropertyEClass, JAVA_PROPERTY__IS_TRANSIENT); + createEAttribute(javaPropertyEClass, JAVA_PROPERTY__GENERATE_GETTER); + createEAttribute(javaPropertyEClass, JAVA_PROPERTY__GENERATE_SETTER); + createEAttribute(javaPropertyEClass, JAVA_PROPERTY__IS_STATIC); + createEAttribute(javaPropertyEClass, JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); + createEReference(javaPropertyEClass, JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS); + + primitiveTypeEClass = createEClass(PRIMITIVE_TYPE); + createEAttribute(primitiveTypeEClass, PRIMITIVE_TYPE__IMPLEMENTATION_CLASS); + createEReference(primitiveTypeEClass, PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE); + createEAttribute(primitiveTypeEClass, PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS); + + javaProjectEClass = createEClass(JAVA_PROJECT); + createEReference(javaProjectEClass, JAVA_PROJECT__BASE_PACKAGE); + + javaSrcFolderEClass = createEClass(JAVA_SRC_FOLDER); + createEReference(javaSrcFolderEClass, JAVA_SRC_FOLDER__BASE_PACKAGE); + + // Create enums + trueFalseDefaultEEnum = createEEnum(TRUE_FALSE_DEFAULT); + } + + /** + * + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) { + return; + } + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + UMLPackage theUMLPackage = (UMLPackage) EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + javaClassEClass.getESuperTypes().add(this.getJavaGen()); + javaGenEClass.getESuperTypes().add(this.getJavaNamedElement()); + javaPackage_EClass.getESuperTypes().add(this.getJavaGen()); + javaMethodEClass.getESuperTypes().add(this.getJavaNamedElement()); + javaParameterEClass.getESuperTypes().add(this.getJavaNamedElement()); + javaPropertyEClass.getESuperTypes().add(this.getJavaNamedElement()); + primitiveTypeEClass.getESuperTypes().add(this.getJavaGen()); + javaProjectEClass.getESuperTypes().add(this.getJavaGen()); + javaSrcFolderEClass.getESuperTypes().add(this.getJavaGen()); + + // Initialize classes and features; add operations and parameters + initEClass(javaClassEClass, JavaClass.class, "JavaClass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJavaClass_Base_Classifier(), theUMLPackage.getClassifier(), null, "base_Classifier", null, 1, 1, JavaClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getJavaClass_IsFinal(), ecorePackage.getEBoolean(), "isFinal", null, 1, 1, JavaClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaClass_IsAbstract(), ecorePackage.getEBoolean(), "isAbstract", null, 1, 1, JavaClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaClass_IsStatic(), ecorePackage.getEBoolean(), "isStatic", null, 1, 1, JavaClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaClass_ExplicitPlainTextRequiredImports(), ecorePackage.getEString(), "explicitPlainTextRequiredImports", null, 0, -1, JavaClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEReference(getJavaClass_ExplicitRequiredImports(), theUMLPackage.getClassifier(), null, "explicitRequiredImports", null, 0, -1, JavaClass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(javaGenEClass, JavaGen.class, "JavaGen", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getJavaGen_SrcName(), ecorePackage.getEString(), "srcName", null, 1, 1, JavaGen.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaGen_ProjectName(), ecorePackage.getEString(), "projectName", null, 1, 1, JavaGen.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(javaNamedElementEClass, JavaNamedElement.class, "JavaNamedElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getJavaNamedElement_Name(), ecorePackage.getEString(), "name", null, 1, 1, JavaNamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaNamedElement_Author(), ecorePackage.getEString(), "author", null, 1, 1, JavaNamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaNamedElement_Version(), ecorePackage.getEString(), "version", null, 1, 1, JavaNamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaNamedElement_Comment(), ecorePackage.getEString(), "comment", null, 1, 1, JavaNamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaNamedElement_IsGenerated(), ecorePackage.getEBoolean(), "isGenerated", "true", 1, 1, JavaNamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(javaPackage_EClass, JavaPackage_.class, "JavaPackage_", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getJavaPackage__PackageName(), ecorePackage.getEString(), "packageName", null, 1, 1, JavaPackage_.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJavaPackage__Base_Package(), theUMLPackage.getPackage(), null, "base_Package", null, 1, 1, JavaPackage_.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(javaMethodEClass, JavaMethod.class, "JavaMethod", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getJavaMethod_IsStatic(), ecorePackage.getEBoolean(), "isStatic", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaMethod_IsFinal(), ecorePackage.getEBoolean(), "isFinal", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaMethod_IsAbstract(), ecorePackage.getEBoolean(), "isAbstract", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaMethod_IsNative(), ecorePackage.getEBoolean(), "isNative", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaMethod_IsSynchronized(), ecorePackage.getEBoolean(), "isSynchronized", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaMethod_IsConstructor(), ecorePackage.getEBoolean(), "isConstructor", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJavaMethod_Base_Operation(), theUMLPackage.getOperation(), null, "base_Operation", null, 1, 1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getJavaMethod_ExplicitPlainTextRequiredImports(), ecorePackage.getEString(), "explicitPlainTextRequiredImports", null, 0, -1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEReference(getJavaMethod_ExplicitRequiredImports(), theUMLPackage.getClassifier(), null, "explicitRequiredImports", null, 0, -1, JavaMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(javaParameterEClass, JavaParameter.class, "JavaParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getJavaParameter_IsFinal(), ecorePackage.getEBoolean(), "isFinal", null, 1, 1, JavaParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJavaParameter_Base_Parameter(), theUMLPackage.getParameter(), null, "base_Parameter", null, 1, 1, JavaParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + + initEClass(javaPropertyEClass, JavaProperty.class, "JavaProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getJavaProperty_IsAbstract(), ecorePackage.getEBoolean(), "isAbstract", null, 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaProperty_IsFinal(), ecorePackage.getEBoolean(), "isFinal", null, 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getJavaProperty_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + initEAttribute(getJavaProperty_IsTransient(), ecorePackage.getEBoolean(), "isTransient", null, 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaProperty_GenerateGetter(), this.getTrueFalseDefault(), "generateGetter", "default", 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaProperty_GenerateSetter(), this.getTrueFalseDefault(), "generateSetter", "default", 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaProperty_IsStatic(), ecorePackage.getEBoolean(), "isStatic", null, 1, 1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getJavaProperty_ExplicitPlainTextRequiredImports(), ecorePackage.getEString(), "explicitPlainTextRequiredImports", null, 0, -1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, + !IS_DERIVED, !IS_ORDERED); + initEReference(getJavaProperty_ExplicitRequiredImports(), theUMLPackage.getClassifier(), null, "explicitRequiredImports", null, 0, -1, JavaProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + + initEClass(primitiveTypeEClass, PrimitiveType.class, "PrimitiveType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getPrimitiveType_ImplementationClass(), ecorePackage.getEString(), "implementationClass", null, 1, 1, PrimitiveType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEReference(getPrimitiveType_Base_PrimitiveType(), theUMLPackage.getPrimitiveType(), null, "base_PrimitiveType", null, 1, 1, PrimitiveType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); + initEAttribute(getPrimitiveType_CollectionImplementationClass(), ecorePackage.getEString(), "collectionImplementationClass", null, 1, 1, PrimitiveType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(javaProjectEClass, JavaProject.class, "JavaProject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJavaProject_Base_Package(), theUMLPackage.getPackage(), null, "base_Package", null, 1, 1, JavaProject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + initEClass(javaSrcFolderEClass, JavaSrcFolder.class, "JavaSrcFolder", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getJavaSrcFolder_Base_Package(), theUMLPackage.getPackage(), null, "base_Package", null, 1, 1, JavaSrcFolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, + !IS_ORDERED); + + // Initialize enums and add enum literals + initEEnum(trueFalseDefaultEEnum, TrueFalseDefault.class, "TrueFalseDefault"); + addEEnumLiteral(trueFalseDefaultEEnum, TrueFalseDefault.TRUE); + addEEnumLiteral(trueFalseDefaultEEnum, TrueFalseDefault.FALSE); + addEEnumLiteral(trueFalseDefaultEEnum, TrueFalseDefault.DEFAULT); + + // Create resource + createResource(eNS_URI); + } + +} // JavaPackageImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackage_Impl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackage_Impl.java new file mode 100644 index 00000000000..845bb0e70d8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPackage_Impl.java @@ -0,0 +1,250 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaPackage_; + +/** + * + * An implementation of the model object 'Package '. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPackage_Impl#getPackageName Package Name}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPackage_Impl#getBase_Package Base Package}
    • + *
    + *

    + * + * @generated + */ +public class JavaPackage_Impl extends JavaGenImpl implements JavaPackage_ { + /** + * The default value of the '{@link #getPackageName() Package Name}' attribute. + * + * + * + * @see #getPackageName() + * @generated + * @ordered + */ + protected static final String PACKAGE_NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getPackageName() Package Name}' attribute. + * + * + * + * @see #getPackageName() + * @generated + * @ordered + */ + protected String packageName = PACKAGE_NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_Package() Base Package}' reference. + * + * + * + * @see #getBase_Package() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Package base_Package; + + /** + * + * + * + * @generated + */ + protected JavaPackage_Impl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JavaPackage.Literals.JAVA_PACKAGE_; + } + + /** + * + * + * + * @generated + */ + @Override + public String getPackageName() { + return packageName; + } + + /** + * + * + * + * @generated + */ + @Override + public void setPackageName(String newPackageName) { + String oldPackageName = packageName; + packageName = newPackageName; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PACKAGE___PACKAGE_NAME, oldPackageName, packageName)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Package getBase_Package() { + if (base_Package != null && base_Package.eIsProxy()) { + InternalEObject oldBase_Package = (InternalEObject) base_Package; + base_Package = (org.eclipse.uml2.uml.Package) eResolveProxy(oldBase_Package); + if (base_Package != oldBase_Package) { + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_PACKAGE___BASE_PACKAGE, oldBase_Package, base_Package)); + } + } + } + return base_Package; + } + + /** + * + * + * + * @generated + */ + public org.eclipse.uml2.uml.Package basicGetBase_Package() { + return base_Package; + } + + /** + * + * + * + * @generated + */ + @Override + public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { + org.eclipse.uml2.uml.Package oldBase_Package = base_Package; + base_Package = newBase_Package; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PACKAGE___BASE_PACKAGE, oldBase_Package, base_Package)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JavaPackage.JAVA_PACKAGE___PACKAGE_NAME: + return getPackageName(); + case JavaPackage.JAVA_PACKAGE___BASE_PACKAGE: + if (resolve) { + return getBase_Package(); + } + return basicGetBase_Package(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JavaPackage.JAVA_PACKAGE___PACKAGE_NAME: + setPackageName((String) newValue); + return; + case JavaPackage.JAVA_PACKAGE___BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_PACKAGE___PACKAGE_NAME: + setPackageName(PACKAGE_NAME_EDEFAULT); + return; + case JavaPackage.JAVA_PACKAGE___BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_PACKAGE___PACKAGE_NAME: + return PACKAGE_NAME_EDEFAULT == null ? packageName != null : !PACKAGE_NAME_EDEFAULT.equals(packageName); + case JavaPackage.JAVA_PACKAGE___BASE_PACKAGE: + return base_Package != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (packageName: "); + result.append(packageName); + result.append(')'); + return result.toString(); + } + +} // JavaPackage_Impl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaParameterImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaParameterImpl.java new file mode 100644 index 00000000000..e554cd837cc --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaParameterImpl.java @@ -0,0 +1,251 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaParameter; +import org.eclipse.uml2.uml.Parameter; + +/** + * + * An implementation of the model object 'Parameter'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaParameterImpl#isFinal Is Final}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaParameterImpl#getBase_Parameter Base Parameter}
    • + *
    + *

    + * + * @generated + */ +public class JavaParameterImpl extends JavaNamedElementImpl implements JavaParameter { + /** + * The default value of the '{@link #isFinal() Is Final}' attribute. + * + * + * + * @see #isFinal() + * @generated + * @ordered + */ + protected static final boolean IS_FINAL_EDEFAULT = false; + + /** + * The cached value of the '{@link #isFinal() Is Final}' attribute. + * + * + * + * @see #isFinal() + * @generated + * @ordered + */ + protected boolean isFinal = IS_FINAL_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_Parameter() Base Parameter}' reference. + * + * + * + * @see #getBase_Parameter() + * @generated + * @ordered + */ + protected Parameter base_Parameter; + + /** + * + * + * + * @generated + */ + protected JavaParameterImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JavaPackage.Literals.JAVA_PARAMETER; + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isFinal() { + return isFinal; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsFinal(boolean newIsFinal) { + boolean oldIsFinal = isFinal; + isFinal = newIsFinal; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PARAMETER__IS_FINAL, oldIsFinal, isFinal)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Parameter getBase_Parameter() { + if (base_Parameter != null && base_Parameter.eIsProxy()) { + InternalEObject oldBase_Parameter = (InternalEObject) base_Parameter; + base_Parameter = (Parameter) eResolveProxy(oldBase_Parameter); + if (base_Parameter != oldBase_Parameter) { + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_PARAMETER__BASE_PARAMETER, oldBase_Parameter, base_Parameter)); + } + } + } + return base_Parameter; + } + + /** + * + * + * + * @generated + */ + public Parameter basicGetBase_Parameter() { + return base_Parameter; + } + + /** + * + * + * + * @generated + */ + @Override + public void setBase_Parameter(Parameter newBase_Parameter) { + Parameter oldBase_Parameter = base_Parameter; + base_Parameter = newBase_Parameter; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PARAMETER__BASE_PARAMETER, oldBase_Parameter, base_Parameter)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JavaPackage.JAVA_PARAMETER__IS_FINAL: + return isFinal(); + case JavaPackage.JAVA_PARAMETER__BASE_PARAMETER: + if (resolve) { + return getBase_Parameter(); + } + return basicGetBase_Parameter(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JavaPackage.JAVA_PARAMETER__IS_FINAL: + setIsFinal((Boolean) newValue); + return; + case JavaPackage.JAVA_PARAMETER__BASE_PARAMETER: + setBase_Parameter((Parameter) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_PARAMETER__IS_FINAL: + setIsFinal(IS_FINAL_EDEFAULT); + return; + case JavaPackage.JAVA_PARAMETER__BASE_PARAMETER: + setBase_Parameter((Parameter) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_PARAMETER__IS_FINAL: + return isFinal != IS_FINAL_EDEFAULT; + case JavaPackage.JAVA_PARAMETER__BASE_PARAMETER: + return base_Parameter != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (isFinal: "); + result.append(isFinal); + result.append(')'); + return result.toString(); + } + +} // JavaParameterImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaProjectImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaProjectImpl.java new file mode 100644 index 00000000000..7c356b1ec6a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaProjectImpl.java @@ -0,0 +1,172 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaProject; + +/** + * + * An implementation of the model object 'Project'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaProjectImpl#getBase_Package Base Package}
    • + *
    + *

    + * + * @generated + */ +public class JavaProjectImpl extends JavaGenImpl implements JavaProject { + /** + * The cached value of the '{@link #getBase_Package() Base Package}' reference. + * + * + * + * @see #getBase_Package() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Package base_Package; + + /** + * + * + * + * @generated + */ + protected JavaProjectImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JavaPackage.Literals.JAVA_PROJECT; + } + + /** + * + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Package getBase_Package() { + if (base_Package != null && base_Package.eIsProxy()) { + InternalEObject oldBase_Package = (InternalEObject) base_Package; + base_Package = (org.eclipse.uml2.uml.Package) eResolveProxy(oldBase_Package); + if (base_Package != oldBase_Package) { + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_PROJECT__BASE_PACKAGE, oldBase_Package, base_Package)); + } + } + } + return base_Package; + } + + /** + * + * + * + * @generated + */ + public org.eclipse.uml2.uml.Package basicGetBase_Package() { + return base_Package; + } + + /** + * + * + * + * @generated + */ + @Override + public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { + org.eclipse.uml2.uml.Package oldBase_Package = base_Package; + base_Package = newBase_Package; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROJECT__BASE_PACKAGE, oldBase_Package, base_Package)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JavaPackage.JAVA_PROJECT__BASE_PACKAGE: + if (resolve) { + return getBase_Package(); + } + return basicGetBase_Package(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JavaPackage.JAVA_PROJECT__BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_PROJECT__BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_PROJECT__BASE_PACKAGE: + return base_Package != null; + } + return super.eIsSet(featureID); + } + +} // JavaProjectImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPropertyImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPropertyImpl.java new file mode 100644 index 00000000000..e1214355ae8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaPropertyImpl.java @@ -0,0 +1,671 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.util.EDataTypeEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaProperty; +import org.eclipse.papyrus.java.profile.java.TrueFalseDefault; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Property; + +/** + * + * An implementation of the model object 'Property'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#isAbstract Is Abstract}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#isFinal Is Final}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#getBase_Property Base Property}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#isTransient Is Transient}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#getGenerateGetter Generate Getter}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#getGenerateSetter Generate Setter}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#isStatic Is Static}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#getExplicitPlainTextRequiredImports Explicit Plain Text Required Imports}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaPropertyImpl#getExplicitRequiredImports Explicit Required Imports}
    • + *
    + *

    + * + * @generated + */ +public class JavaPropertyImpl extends JavaNamedElementImpl implements JavaProperty { + /** + * The default value of the '{@link #isAbstract() Is Abstract}' attribute. + * + * + * + * @see #isAbstract() + * @generated + * @ordered + */ + protected static final boolean IS_ABSTRACT_EDEFAULT = false; + + /** + * The cached value of the '{@link #isAbstract() Is Abstract}' attribute. + * + * + * + * @see #isAbstract() + * @generated + * @ordered + */ + protected boolean isAbstract = IS_ABSTRACT_EDEFAULT; + + /** + * The default value of the '{@link #isFinal() Is Final}' attribute. + * + * + * + * @see #isFinal() + * @generated + * @ordered + */ + protected static final boolean IS_FINAL_EDEFAULT = false; + + /** + * The cached value of the '{@link #isFinal() Is Final}' attribute. + * + * + * + * @see #isFinal() + * @generated + * @ordered + */ + protected boolean isFinal = IS_FINAL_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_Property() Base Property}' reference. + * + * + * + * @see #getBase_Property() + * @generated + * @ordered + */ + protected Property base_Property; + + /** + * The default value of the '{@link #isTransient() Is Transient}' attribute. + * + * + * + * @see #isTransient() + * @generated + * @ordered + */ + protected static final boolean IS_TRANSIENT_EDEFAULT = false; + + /** + * The cached value of the '{@link #isTransient() Is Transient}' attribute. + * + * + * + * @see #isTransient() + * @generated + * @ordered + */ + protected boolean isTransient = IS_TRANSIENT_EDEFAULT; + + /** + * The default value of the '{@link #getGenerateGetter() Generate Getter}' attribute. + * + * + * + * @see #getGenerateGetter() + * @generated + * @ordered + */ + protected static final TrueFalseDefault GENERATE_GETTER_EDEFAULT = TrueFalseDefault.DEFAULT; + + /** + * The cached value of the '{@link #getGenerateGetter() Generate Getter}' attribute. + * + * + * + * @see #getGenerateGetter() + * @generated + * @ordered + */ + protected TrueFalseDefault generateGetter = GENERATE_GETTER_EDEFAULT; + + /** + * The default value of the '{@link #getGenerateSetter() Generate Setter}' attribute. + * + * + * + * @see #getGenerateSetter() + * @generated + * @ordered + */ + protected static final TrueFalseDefault GENERATE_SETTER_EDEFAULT = TrueFalseDefault.DEFAULT; + + /** + * The cached value of the '{@link #getGenerateSetter() Generate Setter}' attribute. + * + * + * + * @see #getGenerateSetter() + * @generated + * @ordered + */ + protected TrueFalseDefault generateSetter = GENERATE_SETTER_EDEFAULT; + + /** + * The default value of the '{@link #isStatic() Is Static}' attribute. + * + * + * + * @see #isStatic() + * @generated + * @ordered + */ + protected static final boolean IS_STATIC_EDEFAULT = false; + + /** + * The cached value of the '{@link #isStatic() Is Static}' attribute. + * + * + * + * @see #isStatic() + * @generated + * @ordered + */ + protected boolean isStatic = IS_STATIC_EDEFAULT; + + /** + * The cached value of the '{@link #getExplicitPlainTextRequiredImports() Explicit Plain Text Required Imports}' attribute list. + * + * + * + * @see #getExplicitPlainTextRequiredImports() + * @generated + * @ordered + */ + protected EList explicitPlainTextRequiredImports; + + /** + * The cached value of the '{@link #getExplicitRequiredImports() Explicit Required Imports}' reference list. + * + * + * + * @see #getExplicitRequiredImports() + * @generated + * @ordered + */ + protected EList explicitRequiredImports; + + /** + * + * + * + * @generated + */ + protected JavaPropertyImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JavaPackage.Literals.JAVA_PROPERTY; + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isAbstract() { + return isAbstract; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsAbstract(boolean newIsAbstract) { + boolean oldIsAbstract = isAbstract; + isAbstract = newIsAbstract; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__IS_ABSTRACT, oldIsAbstract, isAbstract)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isFinal() { + return isFinal; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsFinal(boolean newIsFinal) { + boolean oldIsFinal = isFinal; + isFinal = newIsFinal; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__IS_FINAL, oldIsFinal, isFinal)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Property getBase_Property() { + if (base_Property != null && base_Property.eIsProxy()) { + InternalEObject oldBase_Property = (InternalEObject) base_Property; + base_Property = (Property) eResolveProxy(oldBase_Property); + if (base_Property != oldBase_Property) { + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_PROPERTY__BASE_PROPERTY, oldBase_Property, base_Property)); + } + } + } + return base_Property; + } + + /** + * + * + * + * @generated + */ + public Property basicGetBase_Property() { + return base_Property; + } + + /** + * + * + * + * @generated + */ + @Override + public void setBase_Property(Property newBase_Property) { + Property oldBase_Property = base_Property; + base_Property = newBase_Property; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__BASE_PROPERTY, oldBase_Property, base_Property)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isTransient() { + return isTransient; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsTransient(boolean newIsTransient) { + boolean oldIsTransient = isTransient; + isTransient = newIsTransient; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__IS_TRANSIENT, oldIsTransient, isTransient)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public TrueFalseDefault getGenerateGetter() { + return generateGetter; + } + + /** + * + * + * + * @generated + */ + @Override + public void setGenerateGetter(TrueFalseDefault newGenerateGetter) { + TrueFalseDefault oldGenerateGetter = generateGetter; + generateGetter = newGenerateGetter == null ? GENERATE_GETTER_EDEFAULT : newGenerateGetter; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__GENERATE_GETTER, oldGenerateGetter, generateGetter)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public TrueFalseDefault getGenerateSetter() { + return generateSetter; + } + + /** + * + * + * + * @generated + */ + @Override + public void setGenerateSetter(TrueFalseDefault newGenerateSetter) { + TrueFalseDefault oldGenerateSetter = generateSetter; + generateSetter = newGenerateSetter == null ? GENERATE_SETTER_EDEFAULT : newGenerateSetter; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__GENERATE_SETTER, oldGenerateSetter, generateSetter)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public boolean isStatic() { + return isStatic; + } + + /** + * + * + * + * @generated + */ + @Override + public void setIsStatic(boolean newIsStatic) { + boolean oldIsStatic = isStatic; + isStatic = newIsStatic; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_PROPERTY__IS_STATIC, oldIsStatic, isStatic)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public EList getExplicitPlainTextRequiredImports() { + if (explicitPlainTextRequiredImports == null) { + explicitPlainTextRequiredImports = new EDataTypeEList(String.class, this, JavaPackage.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS); + } + return explicitPlainTextRequiredImports; + } + + /** + * + * + * + * @generated + */ + @Override + public EList getExplicitRequiredImports() { + if (explicitRequiredImports == null) { + explicitRequiredImports = new EObjectResolvingEList(Classifier.class, this, JavaPackage.JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS); + } + return explicitRequiredImports; + } + + /** + * + * + * + * @generated + */ + @Override + public Classifier getExplicitRequiredImports(String name) { + return getExplicitRequiredImports(name, false, null); + } + + /** + * + * + * + * @generated + */ + @Override + public Classifier getExplicitRequiredImports(String name, boolean ignoreCase, EClass eClass) { + explicitRequiredImportsLoop: for (Classifier explicitRequiredImports : getExplicitRequiredImports()) { + if (eClass != null && !eClass.isInstance(explicitRequiredImports)) { + continue explicitRequiredImportsLoop; + } + if (name != null && !(ignoreCase ? name.equalsIgnoreCase(explicitRequiredImports.getName()) : name.equals(explicitRequiredImports.getName()))) { + continue explicitRequiredImportsLoop; + } + return explicitRequiredImports; + } + return null; + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JavaPackage.JAVA_PROPERTY__IS_ABSTRACT: + return isAbstract(); + case JavaPackage.JAVA_PROPERTY__IS_FINAL: + return isFinal(); + case JavaPackage.JAVA_PROPERTY__BASE_PROPERTY: + if (resolve) { + return getBase_Property(); + } + return basicGetBase_Property(); + case JavaPackage.JAVA_PROPERTY__IS_TRANSIENT: + return isTransient(); + case JavaPackage.JAVA_PROPERTY__GENERATE_GETTER: + return getGenerateGetter(); + case JavaPackage.JAVA_PROPERTY__GENERATE_SETTER: + return getGenerateSetter(); + case JavaPackage.JAVA_PROPERTY__IS_STATIC: + return isStatic(); + case JavaPackage.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + return getExplicitPlainTextRequiredImports(); + case JavaPackage.JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS: + return getExplicitRequiredImports(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JavaPackage.JAVA_PROPERTY__IS_ABSTRACT: + setIsAbstract((Boolean) newValue); + return; + case JavaPackage.JAVA_PROPERTY__IS_FINAL: + setIsFinal((Boolean) newValue); + return; + case JavaPackage.JAVA_PROPERTY__BASE_PROPERTY: + setBase_Property((Property) newValue); + return; + case JavaPackage.JAVA_PROPERTY__IS_TRANSIENT: + setIsTransient((Boolean) newValue); + return; + case JavaPackage.JAVA_PROPERTY__GENERATE_GETTER: + setGenerateGetter((TrueFalseDefault) newValue); + return; + case JavaPackage.JAVA_PROPERTY__GENERATE_SETTER: + setGenerateSetter((TrueFalseDefault) newValue); + return; + case JavaPackage.JAVA_PROPERTY__IS_STATIC: + setIsStatic((Boolean) newValue); + return; + case JavaPackage.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + getExplicitPlainTextRequiredImports().clear(); + getExplicitPlainTextRequiredImports().addAll((Collection) newValue); + return; + case JavaPackage.JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS: + getExplicitRequiredImports().clear(); + getExplicitRequiredImports().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_PROPERTY__IS_ABSTRACT: + setIsAbstract(IS_ABSTRACT_EDEFAULT); + return; + case JavaPackage.JAVA_PROPERTY__IS_FINAL: + setIsFinal(IS_FINAL_EDEFAULT); + return; + case JavaPackage.JAVA_PROPERTY__BASE_PROPERTY: + setBase_Property((Property) null); + return; + case JavaPackage.JAVA_PROPERTY__IS_TRANSIENT: + setIsTransient(IS_TRANSIENT_EDEFAULT); + return; + case JavaPackage.JAVA_PROPERTY__GENERATE_GETTER: + setGenerateGetter(GENERATE_GETTER_EDEFAULT); + return; + case JavaPackage.JAVA_PROPERTY__GENERATE_SETTER: + setGenerateSetter(GENERATE_SETTER_EDEFAULT); + return; + case JavaPackage.JAVA_PROPERTY__IS_STATIC: + setIsStatic(IS_STATIC_EDEFAULT); + return; + case JavaPackage.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + getExplicitPlainTextRequiredImports().clear(); + return; + case JavaPackage.JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS: + getExplicitRequiredImports().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_PROPERTY__IS_ABSTRACT: + return isAbstract != IS_ABSTRACT_EDEFAULT; + case JavaPackage.JAVA_PROPERTY__IS_FINAL: + return isFinal != IS_FINAL_EDEFAULT; + case JavaPackage.JAVA_PROPERTY__BASE_PROPERTY: + return base_Property != null; + case JavaPackage.JAVA_PROPERTY__IS_TRANSIENT: + return isTransient != IS_TRANSIENT_EDEFAULT; + case JavaPackage.JAVA_PROPERTY__GENERATE_GETTER: + return generateGetter != GENERATE_GETTER_EDEFAULT; + case JavaPackage.JAVA_PROPERTY__GENERATE_SETTER: + return generateSetter != GENERATE_SETTER_EDEFAULT; + case JavaPackage.JAVA_PROPERTY__IS_STATIC: + return isStatic != IS_STATIC_EDEFAULT; + case JavaPackage.JAVA_PROPERTY__EXPLICIT_PLAIN_TEXT_REQUIRED_IMPORTS: + return explicitPlainTextRequiredImports != null && !explicitPlainTextRequiredImports.isEmpty(); + case JavaPackage.JAVA_PROPERTY__EXPLICIT_REQUIRED_IMPORTS: + return explicitRequiredImports != null && !explicitRequiredImports.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (isAbstract: "); + result.append(isAbstract); + result.append(", isFinal: "); + result.append(isFinal); + result.append(", isTransient: "); + result.append(isTransient); + result.append(", generateGetter: "); + result.append(generateGetter); + result.append(", generateSetter: "); + result.append(generateSetter); + result.append(", isStatic: "); + result.append(isStatic); + result.append(", explicitPlainTextRequiredImports: "); + result.append(explicitPlainTextRequiredImports); + result.append(')'); + return result.toString(); + } + +} // JavaPropertyImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaSrcFolderImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaSrcFolderImpl.java new file mode 100644 index 00000000000..e52396f2794 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/JavaSrcFolderImpl.java @@ -0,0 +1,172 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaSrcFolder; + +/** + * + * An implementation of the model object 'Src Folder'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.JavaSrcFolderImpl#getBase_Package Base Package}
    • + *
    + *

    + * + * @generated + */ +public class JavaSrcFolderImpl extends JavaGenImpl implements JavaSrcFolder { + /** + * The cached value of the '{@link #getBase_Package() Base Package}' reference. + * + * + * + * @see #getBase_Package() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Package base_Package; + + /** + * + * + * + * @generated + */ + protected JavaSrcFolderImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JavaPackage.Literals.JAVA_SRC_FOLDER; + } + + /** + * + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Package getBase_Package() { + if (base_Package != null && base_Package.eIsProxy()) { + InternalEObject oldBase_Package = (InternalEObject) base_Package; + base_Package = (org.eclipse.uml2.uml.Package) eResolveProxy(oldBase_Package); + if (base_Package != oldBase_Package) { + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.JAVA_SRC_FOLDER__BASE_PACKAGE, oldBase_Package, base_Package)); + } + } + } + return base_Package; + } + + /** + * + * + * + * @generated + */ + public org.eclipse.uml2.uml.Package basicGetBase_Package() { + return base_Package; + } + + /** + * + * + * + * @generated + */ + @Override + public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { + org.eclipse.uml2.uml.Package oldBase_Package = base_Package; + base_Package = newBase_Package; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.JAVA_SRC_FOLDER__BASE_PACKAGE, oldBase_Package, base_Package)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JavaPackage.JAVA_SRC_FOLDER__BASE_PACKAGE: + if (resolve) { + return getBase_Package(); + } + return basicGetBase_Package(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JavaPackage.JAVA_SRC_FOLDER__BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_SRC_FOLDER__BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package) null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JavaPackage.JAVA_SRC_FOLDER__BASE_PACKAGE: + return base_Package != null; + } + return super.eIsSet(featureID); + } + +} // JavaSrcFolderImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/PrimitiveTypeImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/PrimitiveTypeImpl.java new file mode 100644 index 00000000000..45fa400b2ee --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/impl/PrimitiveTypeImpl.java @@ -0,0 +1,311 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.PrimitiveType; + +/** + * + * An implementation of the model object 'Primitive Type'. + * + *

    + * The following features are implemented: + *

      + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl#getImplementationClass Implementation Class}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl#getBase_PrimitiveType Base Primitive Type}
    • + *
    • {@link org.eclipse.papyrus.java.profile.java.impl.PrimitiveTypeImpl#getCollectionImplementationClass Collection Implementation Class}
    • + *
    + *

    + * + * @generated + */ +public class PrimitiveTypeImpl extends JavaGenImpl implements PrimitiveType { + /** + * The default value of the '{@link #getImplementationClass() Implementation Class}' attribute. + * + * + * + * @see #getImplementationClass() + * @generated + * @ordered + */ + protected static final String IMPLEMENTATION_CLASS_EDEFAULT = null; + + /** + * The cached value of the '{@link #getImplementationClass() Implementation Class}' attribute. + * + * + * + * @see #getImplementationClass() + * @generated + * @ordered + */ + protected String implementationClass = IMPLEMENTATION_CLASS_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_PrimitiveType() Base Primitive Type}' reference. + * + * + * + * @see #getBase_PrimitiveType() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.PrimitiveType base_PrimitiveType; + + /** + * The default value of the '{@link #getCollectionImplementationClass() Collection Implementation Class}' attribute. + * + * + * + * @see #getCollectionImplementationClass() + * @generated + * @ordered + */ + protected static final String COLLECTION_IMPLEMENTATION_CLASS_EDEFAULT = null; + + /** + * The cached value of the '{@link #getCollectionImplementationClass() Collection Implementation Class}' attribute. + * + * + * + * @see #getCollectionImplementationClass() + * @generated + * @ordered + */ + protected String collectionImplementationClass = COLLECTION_IMPLEMENTATION_CLASS_EDEFAULT; + + /** + * + * + * + * @generated + */ + protected PrimitiveTypeImpl() { + super(); + } + + /** + * + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return JavaPackage.Literals.PRIMITIVE_TYPE; + } + + /** + * + * + * + * @generated + */ + @Override + public String getImplementationClass() { + return implementationClass; + } + + /** + * + * + * + * @generated + */ + @Override + public void setImplementationClass(String newImplementationClass) { + String oldImplementationClass = implementationClass; + implementationClass = newImplementationClass; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS, oldImplementationClass, implementationClass)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.PrimitiveType getBase_PrimitiveType() { + if (base_PrimitiveType != null && base_PrimitiveType.eIsProxy()) { + InternalEObject oldBase_PrimitiveType = (InternalEObject) base_PrimitiveType; + base_PrimitiveType = (org.eclipse.uml2.uml.PrimitiveType) eResolveProxy(oldBase_PrimitiveType); + if (base_PrimitiveType != oldBase_PrimitiveType) { + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE, oldBase_PrimitiveType, base_PrimitiveType)); + } + } + } + return base_PrimitiveType; + } + + /** + * + * + * + * @generated + */ + public org.eclipse.uml2.uml.PrimitiveType basicGetBase_PrimitiveType() { + return base_PrimitiveType; + } + + /** + * + * + * + * @generated + */ + @Override + public void setBase_PrimitiveType(org.eclipse.uml2.uml.PrimitiveType newBase_PrimitiveType) { + org.eclipse.uml2.uml.PrimitiveType oldBase_PrimitiveType = base_PrimitiveType; + base_PrimitiveType = newBase_PrimitiveType; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE, oldBase_PrimitiveType, base_PrimitiveType)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public String getCollectionImplementationClass() { + return collectionImplementationClass; + } + + /** + * + * + * + * @generated + */ + @Override + public void setCollectionImplementationClass(String newCollectionImplementationClass) { + String oldCollectionImplementationClass = collectionImplementationClass; + collectionImplementationClass = newCollectionImplementationClass; + if (eNotificationRequired()) { + eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS, oldCollectionImplementationClass, collectionImplementationClass)); + } + } + + /** + * + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case JavaPackage.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS: + return getImplementationClass(); + case JavaPackage.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE: + if (resolve) { + return getBase_PrimitiveType(); + } + return basicGetBase_PrimitiveType(); + case JavaPackage.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS: + return getCollectionImplementationClass(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case JavaPackage.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS: + setImplementationClass((String) newValue); + return; + case JavaPackage.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE: + setBase_PrimitiveType((org.eclipse.uml2.uml.PrimitiveType) newValue); + return; + case JavaPackage.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS: + setCollectionImplementationClass((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case JavaPackage.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS: + setImplementationClass(IMPLEMENTATION_CLASS_EDEFAULT); + return; + case JavaPackage.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE: + setBase_PrimitiveType((org.eclipse.uml2.uml.PrimitiveType) null); + return; + case JavaPackage.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS: + setCollectionImplementationClass(COLLECTION_IMPLEMENTATION_CLASS_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case JavaPackage.PRIMITIVE_TYPE__IMPLEMENTATION_CLASS: + return IMPLEMENTATION_CLASS_EDEFAULT == null ? implementationClass != null : !IMPLEMENTATION_CLASS_EDEFAULT.equals(implementationClass); + case JavaPackage.PRIMITIVE_TYPE__BASE_PRIMITIVE_TYPE: + return base_PrimitiveType != null; + case JavaPackage.PRIMITIVE_TYPE__COLLECTION_IMPLEMENTATION_CLASS: + return COLLECTION_IMPLEMENTATION_CLASS_EDEFAULT == null ? collectionImplementationClass != null : !COLLECTION_IMPLEMENTATION_CLASS_EDEFAULT.equals(collectionImplementationClass); + } + return super.eIsSet(featureID); + } + + /** + * + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) { + return super.toString(); + } + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (implementationClass: "); + result.append(implementationClass); + result.append(", collectionImplementationClass: "); + result.append(collectionImplementationClass); + result.append(')'); + return result.toString(); + } + +} // PrimitiveTypeImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaAdapterFactory.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaAdapterFactory.java new file mode 100644 index 00000000000..5e966089922 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaAdapterFactory.java @@ -0,0 +1,321 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.java.profile.java.JavaClass; +import org.eclipse.papyrus.java.profile.java.JavaGen; +import org.eclipse.papyrus.java.profile.java.JavaMethod; +import org.eclipse.papyrus.java.profile.java.JavaNamedElement; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaPackage_; +import org.eclipse.papyrus.java.profile.java.JavaParameter; +import org.eclipse.papyrus.java.profile.java.JavaProject; +import org.eclipse.papyrus.java.profile.java.JavaProperty; +import org.eclipse.papyrus.java.profile.java.JavaSrcFolder; +import org.eclipse.papyrus.java.profile.java.PrimitiveType; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage + * @generated + */ +public class JavaAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * + * @generated + */ + protected static JavaPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * + * @generated + */ + public JavaAdapterFactory() { + if (modelPackage == null) { + modelPackage = JavaPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject) object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * + * @generated + */ + protected JavaSwitch modelSwitch = + new JavaSwitch() { + @Override + public Adapter caseJavaClass(JavaClass object) { + return createJavaClassAdapter(); + } + + @Override + public Adapter caseJavaGen(JavaGen object) { + return createJavaGenAdapter(); + } + + @Override + public Adapter caseJavaNamedElement(JavaNamedElement object) { + return createJavaNamedElementAdapter(); + } + + @Override + public Adapter caseJavaPackage_(JavaPackage_ object) { + return createJavaPackage_Adapter(); + } + + @Override + public Adapter caseJavaMethod(JavaMethod object) { + return createJavaMethodAdapter(); + } + + @Override + public Adapter caseJavaParameter(JavaParameter object) { + return createJavaParameterAdapter(); + } + + @Override + public Adapter caseJavaProperty(JavaProperty object) { + return createJavaPropertyAdapter(); + } + + @Override + public Adapter casePrimitiveType(PrimitiveType object) { + return createPrimitiveTypeAdapter(); + } + + @Override + public Adapter caseJavaProject(JavaProject object) { + return createJavaProjectAdapter(); + } + + @Override + public Adapter caseJavaSrcFolder(JavaSrcFolder object) { + return createJavaSrcFolderAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * + * @param target + * the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject) target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaClass Class}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.profile.java.JavaClass + * @generated + */ + public Adapter createJavaClassAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaGen Gen}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.profile.java.JavaGen + * @generated + */ + public Adapter createJavaGenAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaNamedElement Named Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.profile.java.JavaNamedElement + * @generated + */ + public Adapter createJavaNamedElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaPackage_ Package }'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.profile.java.JavaPackage_ + * @generated + */ + public Adapter createJavaPackage_Adapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaMethod Method}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.profile.java.JavaMethod + * @generated + */ + public Adapter createJavaMethodAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaParameter Parameter}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.profile.java.JavaParameter + * @generated + */ + public Adapter createJavaParameterAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaProperty Property}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.profile.java.JavaProperty + * @generated + */ + public Adapter createJavaPropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.PrimitiveType Primitive Type}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.profile.java.PrimitiveType + * @generated + */ + public Adapter createPrimitiveTypeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaProject Project}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.profile.java.JavaProject + * @generated + */ + public Adapter createJavaProjectAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.java.profile.java.JavaSrcFolder Src Folder}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * + * @return the new adapter. + * @see org.eclipse.papyrus.java.profile.java.JavaSrcFolder + * @generated + */ + public Adapter createJavaSrcFolderAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} // JavaAdapterFactory diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceFactoryImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceFactoryImpl.java new file mode 100644 index 00000000000..38cc336adf6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceFactoryImpl.java @@ -0,0 +1,56 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.util; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; +import org.eclipse.emf.ecore.xmi.XMLResource; + +/** + * + * The Resource Factory associated with the package. + * + * + * @see org.eclipse.papyrus.java.profile.java.util.JavaResourceImpl + * @generated + */ +public class JavaResourceFactoryImpl extends ResourceFactoryImpl { + /** + * Creates an instance of the resource factory. + * + * + * + * @generated + */ + public JavaResourceFactoryImpl() { + super(); + } + + /** + * Creates an instance of the resource. + * + * + * + * @generated + */ + @Override + public Resource createResource(URI uri) { + XMLResource result = new JavaResourceImpl(uri); + result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); + result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); + + result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE); + + result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); + result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); + + result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE); + return result; + } + +} // JavaResourceFactoryImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceImpl.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceImpl.java new file mode 100644 index 00000000000..6f18c504479 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaResourceImpl.java @@ -0,0 +1,34 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.util; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; + +/** + * + * The Resource associated with the package. + * + * + * @see org.eclipse.papyrus.java.profile.java.util.JavaResourceFactoryImpl + * @generated + */ +public class JavaResourceImpl extends XMLResourceImpl { + /** + * Creates an instance of the resource. + * + * + * + * @param uri + * the URI of the new resource. + * @generated + */ + public JavaResourceImpl(URI uri) { + super(uri); + } + +} // JavaResourceImpl diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaSwitch.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaSwitch.java new file mode 100644 index 00000000000..85d4994bcb2 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaSwitch.java @@ -0,0 +1,400 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.util.Switch; +import org.eclipse.papyrus.java.profile.java.JavaClass; +import org.eclipse.papyrus.java.profile.java.JavaGen; +import org.eclipse.papyrus.java.profile.java.JavaMethod; +import org.eclipse.papyrus.java.profile.java.JavaNamedElement; +import org.eclipse.papyrus.java.profile.java.JavaPackage; +import org.eclipse.papyrus.java.profile.java.JavaPackage_; +import org.eclipse.papyrus.java.profile.java.JavaParameter; +import org.eclipse.papyrus.java.profile.java.JavaProject; +import org.eclipse.papyrus.java.profile.java.JavaProperty; +import org.eclipse.papyrus.java.profile.java.JavaSrcFolder; +import org.eclipse.papyrus.java.profile.java.PrimitiveType; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * + * @see org.eclipse.papyrus.java.profile.java.JavaPackage + * @generated + */ +public class JavaSwitch extends Switch { + /** + * The cached model package + * + * + * + * @generated + */ + protected static JavaPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * + * @generated + */ + public JavaSwitch() { + if (modelPackage == null) { + modelPackage = JavaPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * + * @parameter ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case JavaPackage.JAVA_CLASS: { + JavaClass javaClass = (JavaClass) theEObject; + T result = caseJavaClass(javaClass); + if (result == null) { + result = caseJavaGen(javaClass); + } + if (result == null) { + result = caseJavaNamedElement(javaClass); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JavaPackage.JAVA_GEN: { + JavaGen javaGen = (JavaGen) theEObject; + T result = caseJavaGen(javaGen); + if (result == null) { + result = caseJavaNamedElement(javaGen); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JavaPackage.JAVA_NAMED_ELEMENT: { + JavaNamedElement javaNamedElement = (JavaNamedElement) theEObject; + T result = caseJavaNamedElement(javaNamedElement); + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JavaPackage.JAVA_PACKAGE_: { + JavaPackage_ javaPackage_ = (JavaPackage_) theEObject; + T result = caseJavaPackage_(javaPackage_); + if (result == null) { + result = caseJavaGen(javaPackage_); + } + if (result == null) { + result = caseJavaNamedElement(javaPackage_); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JavaPackage.JAVA_METHOD: { + JavaMethod javaMethod = (JavaMethod) theEObject; + T result = caseJavaMethod(javaMethod); + if (result == null) { + result = caseJavaNamedElement(javaMethod); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JavaPackage.JAVA_PARAMETER: { + JavaParameter javaParameter = (JavaParameter) theEObject; + T result = caseJavaParameter(javaParameter); + if (result == null) { + result = caseJavaNamedElement(javaParameter); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JavaPackage.JAVA_PROPERTY: { + JavaProperty javaProperty = (JavaProperty) theEObject; + T result = caseJavaProperty(javaProperty); + if (result == null) { + result = caseJavaNamedElement(javaProperty); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JavaPackage.PRIMITIVE_TYPE: { + PrimitiveType primitiveType = (PrimitiveType) theEObject; + T result = casePrimitiveType(primitiveType); + if (result == null) { + result = caseJavaGen(primitiveType); + } + if (result == null) { + result = caseJavaNamedElement(primitiveType); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JavaPackage.JAVA_PROJECT: { + JavaProject javaProject = (JavaProject) theEObject; + T result = caseJavaProject(javaProject); + if (result == null) { + result = caseJavaGen(javaProject); + } + if (result == null) { + result = caseJavaNamedElement(javaProject); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + case JavaPackage.JAVA_SRC_FOLDER: { + JavaSrcFolder javaSrcFolder = (JavaSrcFolder) theEObject; + T result = caseJavaSrcFolder(javaSrcFolder); + if (result == null) { + result = caseJavaGen(javaSrcFolder); + } + if (result == null) { + result = caseJavaNamedElement(javaSrcFolder); + } + if (result == null) { + result = defaultCase(theEObject); + } + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Class'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Class'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJavaClass(JavaClass object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Gen'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Gen'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJavaGen(JavaGen object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Named Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Named Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJavaNamedElement(JavaNamedElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Package '. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Package '. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJavaPackage_(JavaPackage_ object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Method'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Method'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJavaMethod(JavaMethod object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Parameter'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Parameter'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJavaParameter(JavaParameter object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Property'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJavaProperty(JavaProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Primitive Type'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Primitive Type'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePrimitiveType(PrimitiveType object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Project'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Project'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJavaProject(JavaProject object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Src Folder'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'Src Folder'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseJavaSrcFolder(JavaSrcFolder object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * + * @param object + * the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} // JavaSwitch diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaXMLProcessor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaXMLProcessor.java new file mode 100644 index 00000000000..117391bb1f6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile/src/org/eclipse/papyrus/java/profile/java/util/JavaXMLProcessor.java @@ -0,0 +1,54 @@ +/** + * + * + * + * $Id$ + */ +package org.eclipse.papyrus.java.profile.java.util; + +import java.util.Map; + +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.xmi.util.XMLProcessor; +import org.eclipse.papyrus.java.profile.java.JavaPackage; + +/** + * This class contains helper methods to serialize and deserialize XML documents + * + * + * + * @generated + */ +public class JavaXMLProcessor extends XMLProcessor { + + /** + * Public constructor to instantiate the helper. + * + * + * + * @generated + */ + public JavaXMLProcessor() { + super((EPackage.Registry.INSTANCE)); + JavaPackage.eINSTANCE.eClass(); + } + + /** + * Register for "*" and "xml" file extensions the JavaResourceFactoryImpl factory. + * + * + * + * @generated + */ + @Override + protected Map getRegistrations() { + if (registrations == null) { + super.getRegistrations(); + registrations.put(XML_EXTENSION, new JavaResourceFactoryImpl()); + registrations.put(STAR_EXTENSION, new JavaResourceFactoryImpl()); + } + return registrations; + } + +} // JavaXMLProcessor diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.classpath b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.project b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.project new file mode 100644 index 00000000000..6456ba27df1 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.java.reverse.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.core.resources.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..2697efedfa3 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +encoding//src/org/eclipse/papyrus/java/reverse/ui/dnd/messages.properties=ISO-8859-1 +encoding//src/org/eclipse/papyrus/java/reverse/ui/messages.properties=ISO-8859-1 diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..b24c01b97bd --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.emf.transaction;bundle-version="1.2.0", + org.eclipse.gef;bundle-version="3.4.0", + org.eclipse.jdt.core;bundle-version="3.4.0", + org.eclipse.papyrus.java.reverse;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core;bundle-version="1.2.0", + org.eclipse.papyrus.uml.tools;bundle-version="1.2.0", + org.eclipse.gmf.runtime.diagram.core, + org.eclipse.papyrus.infra.gmfdiag.dnd;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf.diagram.common;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.java.reverse.ui.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.java.reverse.ui;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/about.html b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/build.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/build.properties new file mode 100644 index 00000000000..1dc01a0a02a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/build.properties @@ -0,0 +1,11 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + icons/,\ + plugin.properties,\ + about.html +src.includes = .classpath,\ + about.html,\ + build.properties diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/icons/associationFromProperty.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/icons/associationFromProperty.gif new file mode 100644 index 00000000000..b4fbec9c849 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/icons/associationFromProperty.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/icons/javaReverse.gif b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/icons/javaReverse.gif new file mode 100644 index 00000000000..68d40f7e2d5 Binary files /dev/null and b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/icons/javaReverse.gif differ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/plugin.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/plugin.properties new file mode 100644 index 00000000000..fba264cf201 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/plugin.properties @@ -0,0 +1,16 @@ + +################################################################################# +# Copyright (c) 2010-2013 Cedric Dumoulin. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API +# +################################################################################# + +pluginName = Java Reverse UI (Incubation) +providerName = Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/plugin.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/plugin.xml new file mode 100644 index 00000000000..6e744e206e8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/plugin.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/pom.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/pom.xml new file mode 100644 index 00000000000..1d28d2448a1 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.java.reverse.ui + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Activator.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Activator.java new file mode 100644 index 00000000000..2ac94758559 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.java.reverse.ui; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.java.reverse.ui"; + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DisplayReverse.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DisplayReverse.java new file mode 100644 index 00000000000..caac0a8c995 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DisplayReverse.java @@ -0,0 +1,181 @@ +/***************************************************************************** + * Copyright (c) 2014 Jonathan Geoffroy. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Jonathan Geoffroy geoffroy.jonathan@gmail.com initial implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.reverse.ui; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.TreeIterator; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; +import org.eclipse.gmf.runtime.diagram.core.services.ViewService; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IPackageFragment; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.uml2.uml.Model; +import org.eclipse.uml2.uml.NamedElement; + +/** + * Command which allow to display java elements into papyrus diagram. + * The java element must exists into papyrus model (for example by using reverse plugin) + * + * @author Jonathan Geoffroy + * + */ +public class DisplayReverse { + + private static final String MODEL_TYPE = "2005", PACKAGE_TYPE = "2007", CU_TYPE = "2008"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + + /** + * items to display into papyrus diagram + */ + private List items; + + /** + * Contains all uml resources. + * Used to improve research into umlModel. + */ + private Map umlModelNames; + + /** + * Graphical container for the reverse result + */ + private Diagram diagram; + + /** + * model to display into diagram. Null if user doesn't want to display any model + */ + private Model model; + + /** + * Constructor. + * + * @param items + * items to display into papyrus diagram + * @param diagram + * container where to display items + * @param umlModel + * resource representing the papyrus uml model + * @param model + * model to display into diagram. Null if user doesn't want to display any model + */ + public DisplayReverse(List items, Diagram diagram, Resource umlModel, Model model) { + super(); + this.items = items; + this.diagram = diagram; + this.model = model; + + // Change uml model collection to improve search + umlModelNames = new HashMap(); + TreeIterator tree = umlModel.getAllContents(); + while (tree.hasNext()) { + for (EObject o : tree.next().eContents()) { + /* + * Only add reversable elements. + * The non Named element cannot been added into model (comments ...) + */ + if (o instanceof NamedElement) { + // Add it into items to display + NamedElement e = (NamedElement) o; + umlModelNames.put(e.getName(), e); + } + } + } + + + } + + /** + * Execute the display command. + * Should call this method when you want display the selection into papyrus diagram. + * + * @throws JavaModelException + */ + public void execute() throws JavaModelException { + // Display the model + if (model != null) { + display(model.getName(), MODEL_TYPE); + } + + // Cross selection to display each selected item + for (IJavaElement item : items) { + scanJavaElement(item); + } + } + + /** + * Scan a Compilation Unit item + * Just display it + * + * @param item + * a selection compilation unit + */ + private void scanCU(ICompilationUnit item) { + String itemName = item.getElementName().substring(0, item.getElementName().length() - 5); // remove ".java" to the compilation unit name + display(itemName, CU_TYPE); + } + + /** + * Scan a package. + * Display it and cross its childs to display all sub-packages (and recursively) + * + * @param item + * the package to scan + * @throws JavaModelException + */ + private void scanPackage(IPackageFragment item) throws JavaModelException { + String itemName = item.getElementName(); + display(itemName, PACKAGE_TYPE); + } + + /** + * scan and display a JavaElement by delegates to scan{typeOfJavaElement} + * + * @param item + * the item to display + * @throws JavaModelException + */ + private void scanJavaElement(IJavaElement item) throws JavaModelException { + try { + switch (item.getElementType()) { + case IJavaElement.PACKAGE_FRAGMENT: + scanPackage((IPackageFragment) item); + break; + case IJavaElement.COMPILATION_UNIT: + scanCU((ICompilationUnit) item); + break; + } + } catch (NullPointerException e) { + System.err.println(item.getElementName() + "is NOT in selected uml model"); //$NON-NLS-1$ + } + } + + /** + * Display an element into papyrus diagram + * + * @param itemName + * the name of element to display + */ + private void display(String itemName, String type) { + EObject item = this.umlModelNames.get(itemName); + if (!diagram.getChildren().contains(item)) { + ViewService.createNode(diagram, item, type, new PreferencesHint("org.eclipse.papyrus.uml.diagram.clazz")); //$NON-NLS-1$ + } + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DndReverseCodeHandler.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DndReverseCodeHandler.java new file mode 100644 index 00000000000..5c5568282c7 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/DndReverseCodeHandler.java @@ -0,0 +1,246 @@ +/***************************************************************************** + * Copyright (c) 2014 Jonathan Geoffroy. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Jonathan Geoffroy geoffroy.jonathan@gmail.com initial implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.java.reverse.ui; + +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.TreeSet; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.TreeIterator; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.gmf.runtime.notation.impl.ShapeImpl; +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.TreeSelection; +import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor; +import org.eclipse.papyrus.java.reverse.ui.dialog.DndReverseCodeDialog; +import org.eclipse.papyrus.java.reverse.ui.dialog.ReverseCodeDialog; +import org.eclipse.papyrus.uml.diagram.common.util.MDTUtil; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Model; +import org.eclipse.uml2.uml.NamedElement; + +/** + * Handler to display reverse result into current papyrus diagram + * This Handler is activated when user drag'n'drop java resource into papyrus diagram.
    + * It display just non displayed java resource. + * Moreover, it use DndReverseCodeDialog to know if it have to display model, packages and CompilationUnit or not. + * + * @author Jonathan Geoffroy + * + */ +public class DndReverseCodeHandler extends ReverseCodeHandler { + + /** + * true if and only if user want to display reversed compilation unit + */ + private boolean displayCU; + + /** + * true if and only if user want to display reversed packages + */ + private boolean displayPackages; + + /** + * true if and only if user want to display reversed model + */ + private boolean displayModel; + + @Override + /** + * Find all resource to display (selection - resources which are already in the diagram), run the reverse command, before running the display command
    + * @see org.eclipse.papyrus.java.reverse.ui.ReverseCodeHandler#doExecute(org.eclipse.papyrus.java.reverse.ui.dialog.ReverseCodeDialog) + * + * @param dialog + */ + protected void doExecute(ReverseCodeDialog dialog) { + // Get user preferences on dialog + DndReverseCodeDialog dndDialog = (DndReverseCodeDialog) dialog; + displayModel = dndDialog.displayModel(); + displayPackages = dndDialog.displayPackages(); + displayCU = dndDialog.displayCU(); + + // get current selection + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + ISelection selection = page.getSelection(); + TreeSelection treeSelection = (TreeSelection) selection; + + // Find active papyrus diagram + Diagram diagram = null; + IEditorPart activeEditor = MDTUtil.getActiveEditor(); + if (activeEditor != null) { + if (activeEditor instanceof IMultiDiagramEditor) { + diagram = (Diagram) ((IMultiDiagramEditor) activeEditor).getAdapter(Diagram.class); + } + } + + // Remove items already in diagram from selection + List listSelection; + try { + listSelection = selectionMinusAlreadyInDiagram(treeSelection, diagram); + } catch (JavaModelException e1) { + e1.printStackTrace(); + return; + } + + // Run the reverse + super.doExecute(dialog); + + // Find model to display + Model model = null; + if (displayModel) { + String modelName = dndDialog.getValue(); + model = getModelToDisplay(diagram, modelName); + } + + // Run the reverse displayer + DisplayReverse displayReverse = new DisplayReverse(listSelection, diagram, getUmlResource(), model); + try { + displayReverse.execute(); + } catch (JavaModelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + + @Override + protected ReverseCodeDialog getDialog(Shell shell, String modelUid) { + return new DndReverseCodeDialog(shell, modelUid, null, null); + } + + /** + * + * @param selection + * java resources selected + * @param diagram + * opened papyrus diagram + * @return selection - resources already in diagram + * @throws JavaModelException + */ + private List selectionMinusAlreadyInDiagram(TreeSelection selection, Diagram diagram) throws JavaModelException { + // Add all diagram elements to Set + TreeSet alreadyExists = new TreeSet(); + EList diagramList = diagram.getChildren(); + Iterator diagramIt = diagramList.iterator(); + ShapeImpl item; + NamedElement e; + while (diagramIt.hasNext()) { + item = (ShapeImpl) diagramIt.next(); + e = (NamedElement) (item.getElement()); + alreadyExists.add(e.getName()); + } + + // remove all elements of Set from selection + TreeSelectionList selectionList = new TreeSelectionList(selection, displayPackages, displayCU); + ListIterator selectionIterator = selectionList.listIterator(); + String selectionItemName; + while (selectionIterator.hasNext()) { + selectionItemName = getName(selectionIterator.next()); + if (selectionItemName != null && alreadyExists.contains(selectionItemName)) { + selectionIterator.remove(); + } + } + + return selectionList; + } + + /** + * Find the name of item For java compilation unit, remove ".java" extension + * + * @param item + * @return the name of item. + */ + private String getName(IJavaElement item) { + String name = item.getElementName(); + if (item instanceof ICompilationUnit) { + return name.substring(0, name.length() - 5); + } + return name; + } + + /** + * find a model named modelName + * + * @param modelName + * the name of the model the find + * @return the model which named modelName, or null if it doesn't exists into the current papyrus uml resource + */ + public Model getModel(String modelName) { + TreeIterator tree = getUmlResource().getAllContents(); + while (tree.hasNext()) { + for (EObject o : tree.next().eContents()) { + if (o instanceof Model) { + // Add it into items to display + Model model = (Model) o; + + // Search for model + if (model.getName().equals(modelName)) { + System.out.println("model = " + model); + return model; + } + } + } + } + System.out.println("model = null"); + return null; + } + + /** + * find the model named modelName, and get it only if it has to be displayed + * + * @param diagram + * active papyrus diagram + * @param modelName + * the name of the model to find + * @return model corresponding to the modelName if it has to be displayed, i.e. if it doesn't already displayed into the diagram, or null + * otherwise + */ + private Model getModelToDisplay(Diagram diagram, String modelName) { + Model model = getModel(modelName); + if (model != null && !isInDiagram(diagram, model)) { + System.out.println("display model " + model); + return model; + } + System.out.println("don't display model"); + return null; + } + + /** + * + * @param diagram + * @param model + * @return true if model is in diagram + */ + private boolean isInDiagram(Diagram diagram, Model model) { + EList diagramList = diagram.getChildren(); + Iterator diagramIt = diagramList.iterator(); + ShapeImpl item; + while (diagramIt.hasNext()) { + item = (ShapeImpl) diagramIt.next(); + if (item.getElement() == model) { + return true; + } + } + return false; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/JavaCodeReverse.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/JavaCodeReverse.java new file mode 100644 index 00000000000..a9190952dcc --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/JavaCodeReverse.java @@ -0,0 +1,287 @@ +/** + * + */ +package org.eclipse.papyrus.java.reverse.ui; + +import japa.parser.JavaParser; +import japa.parser.ParseException; +import japa.parser.ast.CompilationUnit; + +import java.io.StringReader; +import java.util.Iterator; +import java.util.List; + +import javagen.umlparser.CompilationUnitAnalyser; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IPackageFragment; +import org.eclipse.jdt.core.IPackageFragmentRoot; +import org.eclipse.jdt.core.ITypeRoot; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.TreeSelection; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PlatformUI; +import org.eclipse.uml2.uml.Package; + +/** + * @author dumoulin + * + */ +public class JavaCodeReverse { + + CompilationUnitAnalyser javaAnalyser; + + /** + * Constructor. + * + * @param model + */ + public JavaCodeReverse(Resource model) { + javaAnalyser = new CompilationUnitAnalyser(model); + } + + /** + * Constructor. + * + * @param model + */ + public JavaCodeReverse(Package rootPackage, String generatedPackageName, List searchPaths) { + javaAnalyser = new CompilationUnitAnalyser(rootPackage, generatedPackageName, searchPaths); + } + + + /** + * @throws CoreException + * @throws ParseException + * + */ + public void reverseResource(IResource resource) throws ParseException, CoreException { + System.out.println("reverseResource(" + resource.getName() + ")"); + + if (resource instanceof IFile) { + reverseFile((IFile) resource); + } else if (resource instanceof IFolder) { + reverseFolder((IFolder) resource); + } else if (resource instanceof IProject) { + reverseProject((IProject) resource); + } + + } + + /** + * Walk throw each file in folder + * + * @param resource + * @param model + * @throws CoreException + * @throws ParseException + */ + private void reverseFolder(IFolder folder) throws CoreException, ParseException { + + for (IResource resource : folder.members()) { + reverseResource(resource); + } + + } + + /** + * Walk throw each file in folder + * + * @param resource + * @param model + * @throws CoreException + * @throws ParseException + */ + private void reverseProject(IProject folder) throws CoreException, ParseException { + + for (IResource resource : folder.members()) { + reverseResource(resource); + } + + } + + /** + * Reverse a file + * + * @param resource + * @throws CoreException + * @throws ParseException + */ + private void reverseFile(IFile file) throws ParseException, CoreException { + System.out.println("try to reverseFile(" + file.getName() + ")"); + if (!"java".equals(file.getFileExtension())) { + return; + } + + System.out.println("reverseFile(" + file.getName() + ")"); + + CompilationUnit cu = JavaParser.parse(file.getContents()); + javaAnalyser.processCompilationUnit(cu); + } + + /** + * @throws CoreException + * @throws ParseException + * + */ + public void reverseJavaElement(IJavaElement element) throws ParseException, CoreException + { + System.out.println("reverseJavaElement(" + element.getElementName() + ")"); + + if (element instanceof ITypeRoot) + { + reverseCompilationUnit((ITypeRoot) element); + } + else if (element instanceof IPackageFragment) + { + reversePackageFragment((IPackageFragment) element); + } + else if (element instanceof IPackageFragmentRoot) + { + reversePackageFragmentRoot((IPackageFragmentRoot) element); + } + else + { + System.err.println("Can't reverse Java Element " + element); + } + + } + + /** + * + * @param element + * @throws ParseException + * @throws CoreException + */ + private void reversePackageFragmentRoot(IPackageFragmentRoot element) throws ParseException, CoreException { + + System.out.println("reversePackageFragmentRoot(" + element.getElementName() + ")"); + + IJavaElement[] children = element.getChildren(); + for (IJavaElement child : children) { + reverseJavaElement(child); + } + + } + + /** + * + * @param element + * @throws ParseException + * @throws CoreException + */ + private void reversePackageFragment(IPackageFragment element) throws ParseException, CoreException { + + System.out.println("reversePackageFragment(" + element.getElementName() + ")"); + + IJavaElement[] children = element.getChildren(); + for (IJavaElement child : children) { + reverseJavaElement(child); + } + } + + /** + * Reverse a file + * + * @param resource + * @throws CoreException + * @throws ParseException + */ + private void reverseCompilationUnit(ITypeRoot unit) throws ParseException, CoreException { + System.out.println("try to reverseUnit(" + unit.getElementName() + ")"); + System.out.println("file type=(" + unit.getElementType() + ")"); + + String source = unit.getSource(); + if (source == null) + { + System.err.println("No source attached to unit '" + unit.getElementName() + "'"); + return; + } + + + CompilationUnit cu = JavaParser.parse(new StringReader(source)); + javaAnalyser.processCompilationUnit(cu); + } + + /** + * Real Implementation of the command. + * + * @param generationPackageName + * @param searchPaths + */ + public void executeCodeReverse(Resource umlResource, String generationPackageName, List searchPaths) { + System.out.println("executeCodeReverse()"); + + // Get current selection + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + ISelection selection = page.getSelection(); + + TreeSelection treeSelection = (TreeSelection) selection; + // String filename = treeSelection. + @SuppressWarnings("rawtypes") + Iterator iter = treeSelection.iterator(); + while (iter.hasNext()) { + Object obj = iter.next(); + // Translate java ICompilationUnit to Iresource + if (obj instanceof ICompilationUnit) { + ICompilationUnit u = (ICompilationUnit) obj; + try { + obj = u.getCorrespondingResource(); + } catch (JavaModelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + if (obj instanceof IPackageFragment) + { + IPackageFragment u = (IPackageFragment) obj; + try { + IResource res = u.getCorrespondingResource(); + if (res != null) { + obj = res; + } + } catch (JavaModelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + // This happen when selection is an element from a jar + if (obj instanceof IJavaElement) + { + IJavaElement u = (IJavaElement) obj; + try { + + reverseJavaElement(u); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + // This is a regular java file + if (obj instanceof IResource) + { + try { + reverseResource((IResource) obj); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + System.out.println("reverse done"); + + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Messages.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Messages.java new file mode 100644 index 00000000000..38577506c0d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/Messages.java @@ -0,0 +1,19 @@ +package org.eclipse.papyrus.java.reverse.ui; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + + private static final String BUNDLE_NAME = "org.eclipse.papyrus.java.reverse.ui.messages"; //$NON-NLS-1$ + + public static String ReverseCodeHandler_NoModelError_Message; + + public static String ReverseCodeHandler_NoModelError_Title; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/ReverseCodeHandler.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/ReverseCodeHandler.java new file mode 100644 index 00000000000..433344eba35 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/ReverseCodeHandler.java @@ -0,0 +1,196 @@ +/** + * + */ +package org.eclipse.papyrus.java.reverse.ui; + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.jface.dialogs.ErrorDialog; +import org.eclipse.jface.window.Window; +import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.utils.EditorUtils; +import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers; +import org.eclipse.papyrus.java.reverse.ui.dialog.ReverseCodeDialog; +import org.eclipse.papyrus.uml.tools.model.UmlUtils; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; +import org.eclipse.uml2.uml.Package; + + +/** + * @author dumoulin + * + */ +public class ReverseCodeHandler extends AbstractHandler implements IHandler { + + private static String DefaultGenerationModeleName = "generated"; + + /** + * Method called when button is pressed. + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + // Try to find uml resource + final Resource umlResource; + try { + umlResource = getUmlResource(); + } catch (NullPointerException e) { + // No uml resource available. User must open a model. We open an error dialog with an explicit message to advice user. + Shell shell = HandlerUtil.getActiveShell(event); + Status errorStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ReverseCodeHandler_NoModelError_Title); + ErrorDialog.openError(shell, "", Messages.ReverseCodeHandler_NoModelError_Message, errorStatus); + + // Stop the reverse execution. + return null; + } + ; + + String modelUid = getModelUid(umlResource); + System.out.println("Model uid :" + modelUid); + + // Get reverse parameters from a dialog + Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart().getSite().getShell(); + // ReverseCodeDialog dialog = new ReverseCodeDialog(shell, DefaultGenerationPackageName, Arrays.asList("generated") ); + final ReverseCodeDialog dialog = getDialog(shell, modelUid); + + int res = dialog.open(); + // System.out.println("dialog result =" + res); + if (res == Window.CANCEL) { + System.out.println("Canceled by user."); + return null; + } + + // Execute the reverse with provided parameters + TransactionalEditingDomain editingDomain; + try { + editingDomain = getEditingDomain(); + } catch (ServiceException e) { + // Can't get editing domain + e.printStackTrace(); + throw new ExecutionException(e.getMessage()); + } + + RecordingCommand command = new RecordingCommand(editingDomain, "Reverse Java Code") { + + @Override + protected void doExecute() { + ReverseCodeHandler.this.doExecute(dialog); + } + + }; + + editingDomain.getCommandStack().execute(command); + + + return null; + } + + /** + * Find the modelUid name contains into umlResource taken in parameter + * + * @param umlResource + * @return the modelUid name + */ + private String getModelUid(Resource umlResource) { + // Try to compute a uid identifying the model. Used to store user settings. + String modelUid = umlResource.getURI().toPlatformString(true); + if (modelUid == null) { + System.err.println("Can't compute relatif model uid. Use absolute one"); + modelUid = umlResource.getURI().path(); + } + return modelUid; + } + + /** + * Command ran in a RecordingCommand, after the dialog + * Run the @link{JavaCodeReverse.executeCodeReverse} + * Shall be override to change command behavior + */ + protected void doExecute(ReverseCodeDialog dialog) { + // Create searchpaths. Add the rootmodelname as prefix. + final List searchPaths = Arrays.asList(dialog.getSearchPath()); + Resource umlResource = getUmlResource(); + String packageName = getPackageName(dialog); + JavaCodeReverse reverse = new JavaCodeReverse(getRootPackage(umlResource), packageName, searchPaths); + reverse.executeCodeReverse(umlResource, packageName, searchPaths); + } + + /** + * The dialog used for user. + * + * @param shell + * @param modelUid + * @return the dialog to show to user + */ + protected ReverseCodeDialog getDialog(Shell shell, String modelUid) { + return new ReverseCodeDialog(shell, modelUid, null, null); + } + + /** + * Find the name of the model provided by the dialog + * + * @param dialog + * opened dialog to user + * @return the name of the model. If the user has changed this name, return the name provided by the user; return the default model name + * otherwise. + */ + protected String getPackageName(ReverseCodeDialog dialog) { + String generationPackageName = dialog.getValue(); + if (generationPackageName == null || generationPackageName.length() == 0) { + generationPackageName = DefaultGenerationModeleName; + } + return generationPackageName; + } + + /** + * Get the uml resource used by the model. + * + * @return the Uml Resource + */ + protected Resource getUmlResource() { + Resource umlResource = UmlUtils.getUmlModel().getResource(); + return umlResource; + } + + /** + * Get the name of the root model. + * + * @return + */ + protected Package getRootPackage(Resource umlResource) { + Package rootPackage = (Package) umlResource.getContents().get(0); + return rootPackage; + } + + /** + * Get the current MultiDiagramEditor. + * + * @return + */ + protected IMultiDiagramEditor getMultiDiagramEditor() { + return EditorUtils.getMultiDiagramEditor(); + } + + /** + * Get the main editing doamin. + * + * @return + * @throws ServiceException + */ + protected TransactionalEditingDomain getEditingDomain() throws ServiceException { + return ServiceUtilsForActionHandlers.getInstance().getTransactionalEditingDomain(); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/TreeSelectionList.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/TreeSelectionList.java new file mode 100644 index 00000000000..370a9c0319e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/TreeSelectionList.java @@ -0,0 +1,153 @@ +/***************************************************************************** + * Copyright (c) 2014 Jonathan Geoffroy. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Jonathan Geoffroy geoffroy.jonathan@gmail.com initial implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.java.reverse.ui; + +import java.util.Iterator; +import java.util.LinkedList; + +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IPackageFragment; +import org.eclipse.jdt.core.IPackageFragmentRoot; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jface.viewers.TreeSelection; + +/** + * Transform a TreeSelection collection, provided by java resource selection, into a java List (java.util.List).
    + * Add each element of TreeSelection which have to be displayed. i.e. include packages if includePackages == true; include compilation + * unit if inclupdeCU == true
    + * Note the each element of TreeSelection is a IJavaElement. + * + * @author Jonathan Geoffroy + * + */ +public class TreeSelectionList extends LinkedList { + + /** + * + */ + private static final long serialVersionUID = -5749380826507346600L; + + /** + * True if and only if this list includes packages + */ + private boolean includePackages; + + /** + * True if and only if this list includes packages + */ + private boolean includeCU; + + /** + * + * Constructor. + * + * @param treeSelection + * java resources selection + * @param includePackages + * True if and only if this list includes packages from treeSelection + * @param includeCU + * True if and only if this list includes compilation units from treeSelection + * @throws JavaModelException + */ + public TreeSelectionList(TreeSelection treeSelection, boolean includePackages, boolean includeCU) throws JavaModelException { + super(); + this.includePackages = includePackages; + this.includeCU = includeCU; + + // Add each treeSelection item into the list + addAll(treeSelection); + } + + /** + * + * @param selection + * @throws JavaModelException + */ + private void addAll(TreeSelection selection) throws JavaModelException { + Iterator selectionIterator = selection.iterator(); + while (selectionIterator.hasNext()) { + IJavaElement item = selectionIterator.next(); + scanJavaElement(item); + } + } + + /** + * Scan a Compilation Unit item + * Just add it if it's necessary + * + * @param item + * a selection compilation unit + */ + private void scanCU(ICompilationUnit item) { + if (includeCU) { + add(item); + } + } + + /** + * Scan a package. + * add it if it's necessary and cross its childs to display all sub-packages (and recursively) + * + * @param item + * the package to scan + * @throws JavaModelException + */ + private void scanPackage(IPackageFragment item) throws JavaModelException { + if (includePackages) { + add(item); + } + + // Recursive search in tree + for (IJavaElement child : item.getChildren()) { + scanJavaElement(child); + } + } + + /** + * Scan a source folder. + * add its childs (and recursively) by calling scanJavaElement on each child + * + * @param item + * the folder to scan + * @throws JavaModelException + */ + private void scanFolder(IPackageFragmentRoot item) throws JavaModelException { + // Recursive search in tree + for (IJavaElement child : item.getChildren()) { + scanJavaElement(child); + } + } + + /** + * scan and add a JavaElement by delegates to scan{typeOfJavaElement} + * + * @param item + * the item to display + * @throws JavaModelException + */ + private void scanJavaElement(IJavaElement item) throws JavaModelException { + switch (item.getElementType()) { + case IJavaElement.PACKAGE_FRAGMENT_ROOT: + scanFolder((IPackageFragmentRoot) item); + break; + case IJavaElement.PACKAGE_FRAGMENT: + scanPackage((IPackageFragment) item); + break; + case IJavaElement.COMPILATION_UNIT: + scanCU((ICompilationUnit) item); + break; + } + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/DndReverseCodeDialog.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/DndReverseCodeDialog.java new file mode 100644 index 00000000000..05180af829d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/DndReverseCodeDialog.java @@ -0,0 +1,93 @@ +package org.eclipse.papyrus.java.reverse.ui.dialog; + +import java.util.List; + +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.papyrus.java.reverse.ui.Activator; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; + + +public class DndReverseCodeDialog extends ReverseCodeDialog { + + private static final String DISPLAY_MODEL_UID = ":DISPLAY_MODEL"; //$NON-NLS-1$ + private static final String DISPLAY_PACKAGES_UID = ":DISPLAY_PACKAGES"; //$NON-NLS-1$ + private static final String DISPLAY_CU_UID = ":DISPLAY_CU"; //$NON-NLS-1$ + private Button displayModelCheckbox; + private Button displayPackagesCheckbox; + private Button displayCUCheckbox; + + private boolean displayModel; + private boolean displayPackages; + private boolean displayCU; + + public DndReverseCodeDialog(Shell parentShell, String modelUid, String initialValue, List searchPathsInitialValues) { + super(parentShell, modelUid, initialValue, searchPathsInitialValues); + + } + + @Override + protected Control createDialogArea(Composite parent) { + IDialogSettings settings = Activator.getDefault().getDialogSettings(); + Composite composite = (Composite) super.createDialogArea(parent); + + // Create button to display or not the model + displayModelCheckbox = new Button(composite, SWT.CHECK); + displayModelCheckbox.setText("Display reversed Model into diagram"); + displayModelCheckbox.setSelection(settings.getBoolean(MODEL_UID + DISPLAY_MODEL_UID)); + + // Create button to display or not package + displayPackagesCheckbox = new Button(composite, SWT.CHECK); + displayPackagesCheckbox.setText("Display reversed UML::packages into diagram"); + displayPackagesCheckbox.setSelection(settings.getBoolean(MODEL_UID + DISPLAY_PACKAGES_UID)); + + // Create button to display or not CompilationUnit + displayCUCheckbox = new Button(composite, SWT.CHECK); + displayCUCheckbox.setText("Display UML::classes, UML::interfaces, UML::enumerations into diagram"); + displayCUCheckbox.setSelection(settings.getBoolean(MODEL_UID + DISPLAY_CU_UID)); + + return composite; + } + + @Override + protected void okPressed() { + // add selection into fields to prevent dialog disposing + displayModel = displayModelCheckbox.getSelection(); + displayPackages = displayPackagesCheckbox.getSelection(); + displayCU = displayCUCheckbox.getSelection(); + + // save selection into settings + IDialogSettings settings = Activator.getDefault().getDialogSettings(); + settings.put(MODEL_UID + DISPLAY_MODEL_UID, displayModel); + settings.put(MODEL_UID + DISPLAY_PACKAGES_UID, displayPackages); + settings.put(MODEL_UID + DISPLAY_CU_UID, displayCU); + super.okPressed(); + } + + /** + * + * @return true if displayModelCheckbox is checked + */ + public boolean displayModel() { + return displayModel; + } + + /** + * + * @return true if displayPackagesCheckbox is checked + */ + public boolean displayPackages() { + return displayPackages; + } + + /** + * + * @return true if displayCUCheckbox is checked + */ + public boolean displayCU() { + return displayCU; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/InputListDialog.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/InputListDialog.java new file mode 100644 index 00000000000..f8c4fd0a58e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/InputListDialog.java @@ -0,0 +1,332 @@ +/** + * + */ +package org.eclipse.papyrus.java.reverse.ui.dialog; + +import java.util.List; + +import org.eclipse.jface.resource.JFaceResources; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + +/** + * @author dumoulin + * + */ +public class InputListDialog { + + /** Message to be show */ + private String message; + + /** Message to be show */ + private String tooltips; + + /** List of fields to show */ + private List fieldList; + + /** + * Input text widget. + */ + private Text addToListText; + + private org.eclipse.swt.widgets.List listWidget; + + /** + * Constructor. + * + * @param msg + * @param list + */ + public InputListDialog(String msg, List list) { + this.message = msg; + this.fieldList = list; + } + + + + /** + * @param tooltips + * the tooltips to set + */ + public void setTooltips(String tooltips) { + this.tooltips = tooltips; + } + + + /** + * Return the selected list. + * + * @return + */ + public String[] getList() { + return listWidget.getItems(); + } + + /** + * + * @param parent + * @return + */ + public Control createDialogArea(Composite parent) { + // create composite + Composite composite = parent; + // create message + if (message != null) { + Label label = new Label(composite, SWT.WRAP); + label.setText(message); + GridData data = new GridData(GridData.GRAB_HORIZONTAL + /* | GridData.GRAB_VERTICAL */| GridData.HORIZONTAL_ALIGN_FILL + | GridData.VERTICAL_ALIGN_CENTER); + // data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); + label.setLayoutData(data); + label.setFont(parent.getFont()); + setToolTip(label, tooltips); + ; + } + + // button + createButtonBar(composite); + + // list + listWidget = new org.eclipse.swt.widgets.List(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.RESIZE); + + GridData listData = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL); + + listData.heightHint = 100; + listWidget.setLayoutData(listData); + setToolTip(listWidget, tooltips); + if (fieldList != null) { + for (String item : fieldList) { + listWidget.add(item); + } + } + + // applyDialogFont(composite); + return composite; + } + + + /** + * Set the tooltips if not null. + * + * @param parent + * @param tooltips + */ + private void setToolTip(Control parent, String tooltips) { + if (tooltips != null) { + parent.setToolTipText(tooltips); + } + } + + /** + * Returns the style bits that should be used for the input text field. + * Defaults to a single line entry. Subclasses may override. + * + * @return the integer style bits that should be used when creating the + * input text + * + * @since 3.4 + */ + protected int getInputTextStyle() { + return SWT.SINGLE | SWT.BORDER; + } + + /** + * Creates and returns the contents of this dialog's button bar. + *

    + * The Dialog implementation of this framework method lays out a button bar and calls the createButtonsForButtonBar framework method to populate it. Subclasses may override. + *

    + *

    + * The returned control's layout data must be an instance of GridData. + *

    + * + * @param parent + * the parent composite to contain the button bar + * @return the button bar control + */ + protected Control createButtonBar(Composite parent) { + Composite composite = new Composite(parent, SWT.NONE); + // create a layout with spacing and margins appropriate for the font + // size. + GridLayout layout = new GridLayout(); + layout.numColumns = 0; // this is incremented by createButton + layout.makeColumnsEqualWidth = false; + // layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); + // layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); + // layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); + // layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); + composite.setLayout(layout); + GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL + | GridData.VERTICAL_ALIGN_CENTER); + composite.setLayoutData(data); + composite.setFont(parent.getFont()); + + // Add the buttons to the button bar. + createButtonsForButtonBar(composite); + return composite; + } + + /** + * Adds buttons to this dialog's button bar. + *

    + * The Dialog implementation of this framework method adds standard ok and cancel buttons using the createButton framework method. These standard buttons will be accessible from getCancelButton, and + * getOKButton. Subclasses may override. + *

    + * + * @param parent + * the button bar composite + */ + protected void createButtonsForButtonBar(Composite parent) { + // create OK and Cancel buttons by default + // Create input text + // input text + ((GridLayout) parent.getLayout()).numColumns++; + addToListText = new Text(parent, getInputTextStyle()); + setButtonLayoutData(addToListText); + addToListText.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING + | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL)); + + // Create a Button + ((GridLayout) parent.getLayout()).numColumns++; + Button button = new Button(parent, SWT.PUSH); + button.setText("add"); + button.setFont(JFaceResources.getDialogFont()); + button.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent event) { + addPressed(); + } + }); + setButtonLayoutData(button); + + // remove + ((GridLayout) parent.getLayout()).numColumns++; + button = new Button(parent, SWT.PUSH); + button.setText("-"); + button.setFont(JFaceResources.getDialogFont()); + button.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent event) { + removedPressed(); + } + }); + setButtonLayoutData(button); + + // up + ((GridLayout) parent.getLayout()).numColumns++; + button = new Button(parent, SWT.PUSH); + button.setText("^"); + button.setFont(JFaceResources.getDialogFont()); + button.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent event) { + upPressed(); + } + }); + setButtonLayoutData(button); + + // down + ((GridLayout) parent.getLayout()).numColumns++; + button = new Button(parent, SWT.PUSH); + button.setText("v"); + button.setFont(JFaceResources.getDialogFont()); + button.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent event) { + downPressed(); + } + }); + setButtonLayoutData(button); + + + } + + /** + * Called when add button is pressed. + */ + protected void addPressed() { + System.out.println("add pressed " + addToListText.getText()); + String msg = addToListText.getText(); + if (msg.length() == 0) { + return; + } + + msg.trim(); + listWidget.add(msg); + // listWidget.pack(true); + } + + protected void upPressed() { + System.out.println("up pressed"); + int selectionIndex = listWidget.getSelectionIndex(); + + if (selectionIndex > 0) { + swapItems(selectionIndex - 1, selectionIndex); + listWidget.setSelection(selectionIndex - 1); + } + } + + /** + * Swap items in the list + * + * @param down + * @param up + */ + private void swapItems(int down, int up) { + String tmp = listWidget.getItem(down); + listWidget.setItem(down, listWidget.getItem(up)); + listWidget.setItem(up, tmp); + } + + protected void downPressed() { + System.out.println("down pressed"); + int selectionIndex = listWidget.getSelectionIndex(); + + if (selectionIndex < listWidget.getItemCount() - 1) { + swapItems(selectionIndex, selectionIndex + 1); + listWidget.setSelection(selectionIndex + 1); + } + } + + + protected void removedPressed() { + System.out.println("removed pressed"); + int selectionIndex = listWidget.getSelectionIndex(); + + String old = listWidget.getItem(selectionIndex); + listWidget.remove(selectionIndex); + addToListText.setText(old); + } + + + /** + * Set the layout data of the button to a GridData with appropriate heights + * and widths. + * + * @param button + */ + protected void setButtonLayoutData(Control button) { + GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); + // int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); + Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); + // data.widthHint = Math.max(widthHint, minSize.x); + data.widthHint = minSize.x; + button.setLayoutData(data); + } + + + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/ReverseCodeDialog.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/ReverseCodeDialog.java new file mode 100644 index 00000000000..d21b20de12d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dialog/ReverseCodeDialog.java @@ -0,0 +1,281 @@ +/** + * + */ +package org.eclipse.papyrus.java.reverse.ui.dialog; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javagen.umlparser.CreationPackageCatalog; + +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.dialogs.InputDialog; +import org.eclipse.papyrus.java.reverse.ui.Activator; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; + +/** + * @author dumoulin + * + */ +public class ReverseCodeDialog extends InputDialog { + + /** Internal dialog to show list of searchpaths */ + private InputListDialog listDialog; + + /** Internal dialog to show list of creation paths */ + private InputListDialog creationPathsDialog; + + /** Returned searchpaths */ + private String[] searchPath; + /** creationPaths read by the list. One line pattern by element */ + private String[] creationPaths; + /** splitted creationPaths. pattern lines are splitted in small path */ + private List splittedCreationPaths; + + private String SEARCHPATHS_UID = ":searchpaths"; + private String CREATIONPATHS_UID = ":creationpaths"; + private static String DEFAULT_PACKAGE_NAME_UID = ":defaultpackagename"; + protected String MODEL_UID = "nomodeluid"; + + private static String textMsg = "Default creation package."; + @SuppressWarnings("unused") + private static String creationPackageTooltips = "The default creation package is used when no matching creation package are found."; + + + private static String dialogTitle = "Reverse Code"; + + private static String listMsg = "search paths - list of model packages used to search for already existing classes (ex: p1/p2)"; + private static String listTooltips = "search paths - list of model packages used to search for already existing classes (ex: p1/p2)"; + + private static String creationPathMsg = "creation paths \n" + + "pattern: includePath ; excludePath ; destination (use ';' as separator)\n"; + + private static String creationPathTooltips = "creation paths - list of path describing the models inside which reversed classes will be generated.\n" + + "pattern: includeJavaPackage ; excludeJavaPackage ; destinationPath (use ';' as separator)\n" + + "includeJavaPackage: the java package that should be mapped. Can contain a '*'.\n" + + "excludeJavaPackage: the java package that should be excluded. Can contain a '*'.\n" + + "destinationPath: the uml model inside which matching java packages will be created. Can contain a '*'.\n" + + "if destinationPath contains a '*', it will be replaced by the partname found at the place of '*'\n" + + "in the includeJavaPackage\n" + + "\n" + + "ex: eclipse.org.* ; eclipse.org.papyrus ; *"; + + + /** + * @param parentShell + * @param dialogTitle + * @param dialogMessage + * @param initialValue + * @param validator + */ + public ReverseCodeDialog(Shell parentShell, String modelUid, String initialValue, List searchPathsInitialValues) { + super(parentShell, dialogTitle, textMsg, getInitialValue(modelUid, initialValue), null); + // TODO Auto-generated constructor stub + IDialogSettings settings = Activator.getDefault().getDialogSettings(); + + MODEL_UID = modelUid; + + // Look for generationPackageName if none is provided. + // if(initialValue == null) + // { + // String generationPackageName = settings.get("generationPackageName"); + // getText().setText(generationPackageName); + // + // } + // Look for saved searchpaths if none is provided. + if (searchPathsInitialValues == null) { + String[] savedSearchPath = settings.getArray(MODEL_UID + SEARCHPATHS_UID); + if (savedSearchPath != null) { + searchPathsInitialValues = Arrays.asList(savedSearchPath); + } else + { + searchPathsInitialValues = CreationPackageCatalog.getDefaultSearchPath(); + } + } + + // Look for saved creationPaths if none is provided. + if (creationPaths == null) { + String[] savedSearchPath = settings.getArray(MODEL_UID + CREATIONPATHS_UID); + if (savedSearchPath != null) { + creationPaths = savedSearchPath; + } else { + creationPaths = CreationPackageCatalog.getDefaultPackageCreationPatterns(" ; "); + } + } + + listDialog = new InputListDialog(listMsg, searchPathsInitialValues); + listDialog.setTooltips(listTooltips); + creationPathsDialog = new InputListDialog(creationPathMsg, Arrays.asList(creationPaths)); + creationPathsDialog.setTooltips(creationPathTooltips); + } + + /** + * + * @param modelUid + * @param initialValue + * @return + */ + private static String getInitialValue(String modelUid, String initialValue) { + IDialogSettings settings = Activator.getDefault().getDialogSettings(); + + // Look for generationPackageName if none is provided. + if (initialValue == null) { + // String generationPackageName = settings.get(MODEL_UID + SEARCHPATH_UID); + String generationPackageName = settings.get(modelUid + DEFAULT_PACKAGE_NAME_UID); + return generationPackageName; + + } + return initialValue; + } + + /** + * Allows resizing. + */ + @Override + protected boolean isResizable() { + // TODO Auto-generated method stub + return true; + } + + /** + * Get the returned searchpaths. + * + * @return + */ + public String[] getSearchPath() { + return searchPath; + } + + /** + * Get the returned creationPaths, one pattern for each entry, separated by ';'. + * + * @return + */ + public List getCreationPaths() { + + return splittedCreationPaths; + } + + + /** + * Create additional list of searchpaths. + */ + @Override + protected Control createDialogArea(Composite parent) { + // create composite + Composite composite = (Composite) super.createDialogArea(parent); + + listDialog.createDialogArea(composite); + creationPathsDialog.createDialogArea(composite); + return composite; + } + + /** + * Save the searchpath after the button is pressed. + */ + @Override + protected void okPressed() { + // Save the list before the control is disposed + searchPath = listDialog.getList(); + creationPaths = creationPathsDialog.getList(); + String defaultCreationPath = getValue(); + if (defaultCreationPath == null || defaultCreationPath.length() == 0) { + defaultCreationPath = CreationPackageCatalog.getDefaultCreationPath(); + } + + // Check inputs + try { + // Check paths + splittedCreationPaths = computeCreationPaths(creationPaths); + CreationPackageCatalog.validateCreationPath(splittedCreationPaths); + // add default searchPaths + searchPath = addDefaultSearchPaths(Arrays.asList(searchPath), splittedCreationPaths).toArray(new String[0]); + + } catch (Exception e) { + // TODO Auto-generated catch block + showError(e.getMessage()); + return; + } + + + // save values + IDialogSettings settings = Activator.getDefault().getDialogSettings(); + settings.put(MODEL_UID + SEARCHPATHS_UID, searchPath); + settings.put(MODEL_UID + CREATIONPATHS_UID, creationPaths); + settings.put(MODEL_UID + DEFAULT_PACKAGE_NAME_UID, getValue()); + + + super.okPressed(); + } + + + /** + * Add the defaultSearchPath extracted from the splittedCreationPath to the searchPath. + * + * @param splittedCreationPaths2 + */ + private List addDefaultSearchPaths(List searchPath, List splittedCreationPaths) { + + + List result = new ArrayList(searchPath.size() + splittedCreationPaths.size()); + result.addAll(searchPath); + + List additionalPaths = CreationPackageCatalog.extractCreationPaths(splittedCreationPaths.toArray(new String[0])); + for (String toAdd : additionalPaths) { + if (!result.contains(toAdd)) { + result.add(toAdd); + } + } + + return result; + } + + /** + * Show an error message + * + * @param message + */ + private void showError(String message) { + System.err.println("Error: " + message); + + } + + + /** + * Compute and check the creationsPaths + * + * @param creationPaths + * An array with one creationPattern by element + * @return An array with one path by elements + * @throws Exception + */ + private List computeCreationPaths(String[] creationPaths) throws Exception { + + List result = new ArrayList(); + + // Iterate line by line + // For each line, separate the 3 patterns + // If a pattern is empty, put a null + for (String line : creationPaths) { + String[] eles = line.split(";"); + if (eles.length != 3) { + throw new Exception("A line must contains 3 pattern separated by ';' :" + line); + } + for (String ele : eles) + { + ele = ele.trim(); + if (ele.length() == 0) { + ele = null; + } + // add ele + result.add(ele); + } + } + return result; + } + + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseCommand.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseCommand.java new file mode 100755 index 00000000000..9fdb9fb8505 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseCommand.java @@ -0,0 +1,103 @@ +/***************************************************************************** + * Copyright (c) 2014 Jonathan Geoffroy. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Jonathan Geoffroy geoffroy.jonathan@gmail.com - initial implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.reverse.ui.dnd; + +import java.util.List; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IProject; +import org.eclipse.gef.Request; +import org.eclipse.gef.commands.Command; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.papyrus.java.reverse.ui.DndReverseCodeHandler; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PlatformUI; + +/** + * Command called when user drop Java Elements into diagram model (on Papyrus editor). + * Check for selected elements, and run reverse handler if all selected files are reversible. + * + * This command implements a Singleton Pattern. You should use ReverseCommand.getInstance() to receive a Singleton of this Command. + * + * @author Jonathan Geoffroy + * + */ +public class DropReverseCommand extends Command { + + /** + * Singleton implementation of ReverseCommand + * Always return this instance of Reverse Command when ask for instance + * + * @see {getInstance()} + */ + private static DropReverseCommand instance; + + /** + * Constructor. Initialize the request for this ReverseCommand + */ + private DropReverseCommand() { + super(); + } + + @Override + public boolean canExecute() { + // Find the type of each selected file (CompilationUnit, packages ...) + List selected; // The selected files from JDT + + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + ISelection selection = page.getSelection(); + if (!(selection instanceof IStructuredSelection)) { + return false; + } + IStructuredSelection structuredSelection = (IStructuredSelection) selection; + selected = structuredSelection.toList(); + + // For each selected object, check if it's reversible. + for (Object s : selected) { + // We can only reverse Java Elements. Moreover, reversing projects is not available yet + if (!(s instanceof IJavaElement) || s instanceof IProject) { + return false; + } + } + return true; + } + + @Override + public void execute() { + DndReverseCodeHandler reverse = new DndReverseCodeHandler(); + try { + reverse.execute(null); + } catch (ExecutionException e) { + e.printStackTrace(); + } + } + + /** + * return a singleton of this command + * Change the request if it differ from the previous calling + * + * + * @return a singleton of this command + */ + public static DropReverseCommand getInstance(Request request) { + if (instance == null) { + instance = new DropReverseCommand(); + } + + return instance; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseStrategy.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseStrategy.java new file mode 100755 index 00000000000..a302a6d3418 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/DropReverseStrategy.java @@ -0,0 +1,60 @@ +/***************************************************************************** + * Copyright (c) 2014 Jonathan Geoffroy. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Jonathan Geoffroy geoffroy.jonathan@gmail.com - initial implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.reverse.ui.dnd; + +import org.eclipse.gef.EditPart; +import org.eclipse.gef.Request; +import org.eclipse.gef.commands.Command; +import org.eclipse.papyrus.infra.gmfdiag.dnd.strategy.DropStrategy; +import org.eclipse.swt.graphics.Image; + + +public class DropReverseStrategy implements DropStrategy { + public DropReverseStrategy() { + } + + @Override + public String getLabel() { + return Messages.DropReverseStrategy_LABEL; + } + + @Override + public String getDescription() { + return Messages.DropReverseStrategy_DESCRIPTION; + } + + @Override + public Image getImage() { + // No image to display + return null; + } + + @Override + public String getID() { + return "org.eclipse.papyrus.java.reverse.ui.dnd.reversedropstrategy"; //$NON-NLS-1$ + } + + @Override + public Command getCommand(final Request request, final EditPart targetEditPart) { + return DropReverseCommand.getInstance(request); + + } + + @Override + public int getPriority() { + return 0; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/Messages.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/Messages.java new file mode 100644 index 00000000000..3253c5eb40a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/Messages.java @@ -0,0 +1,19 @@ +package org.eclipse.papyrus.java.reverse.ui.dnd; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + + private static final String BUNDLE_NAME = "org.eclipse.papyrus.java.reverse.ui.dnd.messages"; //$NON-NLS-1$ + + public static String DropReverseStrategy_DESCRIPTION; + + public static String DropReverseStrategy_LABEL; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/messages.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/messages.properties new file mode 100644 index 00000000000..753937a59b2 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/dnd/messages.properties @@ -0,0 +1,2 @@ +DropReverseStrategy_DESCRIPTION=Reverse all dropped classes into model +DropReverseStrategy_LABEL=Reverse diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/handlers/CreateAssociationFromPropertyHandler.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/handlers/CreateAssociationFromPropertyHandler.java new file mode 100644 index 00000000000..848f5ea6cbc --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/handlers/CreateAssociationFromPropertyHandler.java @@ -0,0 +1,286 @@ +/** + * + */ +package org.eclipse.papyrus.java.reverse.ui.handlers; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.TreeSelection; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers; +import org.eclipse.papyrus.java.reverse.utils.TypeOperationsEnhanced; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; +import org.eclipse.uml2.uml.AggregationKind; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Type; + + +/** + * An handler getting the selected element and reporting them in console. + * + * @author Cedric dumoulin + * + */ +public class CreateAssociationFromPropertyHandler extends AbstractHandler implements IHandler { + + + /** + * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) + * @param event + * @return + * @throws ExecutionException + * + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + List objects = lookupSelectedElements(); + List selectedProperties = getAllSelectionOfType(event, Property.class); + if (objects == null) { + + showErrorDialog(event, "No object selected", "Can't create association. Please select a Property First."); + return null; + } + + // Try creation + try { + doExecute(selectedProperties); + } catch (ServiceException e) { + showErrorDialog(event, "Can't get TransactionalEditingDomain", e.getMessage()); + e.printStackTrace(); + } catch (Exception e) { + showErrorDialog(event, "Can't Create Association", e.getMessage()); + e.printStackTrace(); + } + + return null; + } + + /** + * Get all selected element of the specified type. + * + * @param expectedType + * @return + * @throws ExecutionException + */ + private List getAllSelectionOfType(ExecutionEvent event, Class expectedType) throws ExecutionException { + + ISelection selection = HandlerUtil.getCurrentSelectionChecked(event); + // IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + // ISelection selection = page.getSelection(); + System.out.println("check " + selection); + if (selection instanceof IStructuredSelection) + { + IStructuredSelection structuredSelection = (IStructuredSelection) selection; + return getAllElementOfType(structuredSelection.toList(), expectedType); + } + else if (selection instanceof TreeSelection) { + TreeSelection treeSelection = (TreeSelection) selection; + return getAllElementOfType(treeSelection.toList(), expectedType); + + } + return null; + } + + /** + * Filter the list, and only retain objects that can be adapted to the specified type + * + * @param objects + * @param class1 + * @return + */ + private List getAllElementOfType(List list, Class expectedClassType) { + + List res = new ArrayList(); + + for (Object cur : list) { + + T adapted = adapt(cur, expectedClassType); + if (adapted != null) { + res.add(adapted); + } + } + return res; + } + + /** + * Adapt the specified object to the requested type, if possible. + * Return null if the object can't be adapted. + * + * @param object + * @param expectedClassType + * @return The adapted object, or null. + */ + private T adapt(Object object, Class expectedClassType) { + + if (object instanceof IAdaptable) { + @SuppressWarnings("unchecked") + T ele = (T) ((IAdaptable) object).getAdapter(expectedClassType); + if (ele != null) { + return ele; + } + // Try as EObject if the expectedClasType is sub-type of EObject. + if (EObject.class.isAssignableFrom(expectedClassType)) { + // to EObject + EObject eobject = (EObject) ((IAdaptable) object).getAdapter(EObject.class); + + if (eobject != null && expectedClassType.isInstance(eobject)) { + return (T) eobject; + } + } + } + + // Try global mechanism + { + @SuppressWarnings("unchecked") + T ele = (T) Platform.getAdapterManager().getAdapter(object, expectedClassType); + if (ele != null) { + return ele; + } + // Try as EObject if the expectedClasType is sub-type of EObject. + if (EObject.class.isAssignableFrom(expectedClassType)) { + // to EObject + EObject eobject = (EObject) Platform.getAdapterManager().getAdapter(object, EObject.class); + + if (eobject != null && expectedClassType.isInstance(eobject)) { + + return (T) eobject; + } + } + } + // Can't be adapted + return null; + + } + + /** + * + * @param event + * @param errorMessage + * @throws ExecutionException + */ + private void showErrorDialog(ExecutionEvent event, String title, String errorMessage) throws ExecutionException { + IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); + MessageDialog.openError( + window.getShell(), + title, + errorMessage); + } + + + /** + * Get the name used in the {@link RecordingCommand}. This name will be visible in + * undo/redo. + * + * @return The command name to show. + */ + public String getCommandName() { + return "Create Association"; + } + + /** + * Do the execution of the command. + * + * @param objects + * List of object to generate Java code from. + * @throws ServiceException + */ + protected void doExecute(final List objects) throws ServiceException { + + // Execute the reverse with provided paramters + TransactionalEditingDomain editingDomain = getEditingDomain(); + RecordingCommand command = new RecordingCommand(editingDomain, getCommandName()) { + + @Override + protected void doExecute() { + System.out.println(" Selections:"); + + for (Object obj : objects) { + + System.out.println("found '" + obj + "'."); + createAssociationFromProperty((Property) obj); + } + } + + }; + + editingDomain.getCommandStack().execute(command); + + + } + + + /** + * Create an association from the specified Property. The association is created + * in the property's nearest package. + * + * @param p + * The property to use to create an association. + */ + protected void createAssociationFromProperty(Property p) { + + Element owner = p.getOwner(); + + if (owner instanceof Type) { + + Type classOwner = (Type) owner; + + // Compute other end name + String name = classOwner.getName(); + String newname = name.substring(0, 1).toLowerCase() + name.substring(1); + // Create + TypeOperationsEnhanced.createAssociationFromProperty(p, true, AggregationKind.COMPOSITE_LITERAL, + false, AggregationKind.NONE_LITERAL, newname, 0, 1); + } + } + + /** + * Lookup selected objects in UI. + * + * @return + */ + private List lookupSelectedElements() { + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + ISelection selection = page.getSelection(); + System.out.println("check " + selection); + if (selection instanceof IStructuredSelection) + { + IStructuredSelection structuredSelection = (IStructuredSelection) selection; + return structuredSelection.toList(); + } + else if (selection instanceof TreeSelection) { + TreeSelection treeSelection = (TreeSelection) selection; + return treeSelection.toList(); + + } + return null; + } + + /** + * Get the main editing doamin. + * + * @return + * @throws ServiceException + */ + protected TransactionalEditingDomain getEditingDomain() throws ServiceException { + return ServiceUtilsForActionHandlers.getInstance().getTransactionalEditingDomain(); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/messages.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/messages.properties new file mode 100644 index 00000000000..a754ab7df2a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui/src/org/eclipse/papyrus/java/reverse/ui/messages.properties @@ -0,0 +1,2 @@ +ReverseCodeHandler_NoModelError_Message=No model selected for Reverse. Please open a model where you want to add the reverse result. +ReverseCodeHandler_NoModelError_Title=No model selected diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.classpath b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.project b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.project new file mode 100644 index 00000000000..9f8df991a34 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.java.reverse + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..bb2e8d708bb --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/META-INF/MANIFEST.MF @@ -0,0 +1,17 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.uml2.uml;visibility:=reexport +Export-Package: japa.parser, + japa.parser.ast, + javagen.umlparser, + org.eclipse.papyrus.java.reverse.utils +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.java.reverse.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.java.reverse;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/about.html b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/build.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/build.properties new file mode 100644 index 00000000000..d012a1e3eec --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + about.html +src.includes = about.html,\ + build.properties diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/plugin.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/plugin.properties new file mode 100644 index 00000000000..4baa6d1eeda --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/plugin.properties @@ -0,0 +1,16 @@ + +################################################################################# +# Copyright (c) 2010-2013 Cedric Dumoulin. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API +# +################################################################################# + +pluginName=Java Reverse (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/pom.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/pom.xml new file mode 100644 index 00000000000..4ea411b632b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.java.reverse + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParser.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParser.java new file mode 100644 index 00000000000..9eeb4b984c4 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParser.java @@ -0,0 +1,10321 @@ +/* Generated By:JavaCC: Do not edit this line. ASTParser.java */ +/* + * Copyright (C) 2008 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +package japa.parser; + +import japa.parser.ast.Comment; +import japa.parser.ast.CompilationUnit; +import japa.parser.ast.ImportDeclaration; +import japa.parser.ast.PackageDeclaration; +import japa.parser.ast.TypeParameter; +import japa.parser.ast.body.AnnotationDeclaration; +import japa.parser.ast.body.AnnotationMemberDeclaration; +import japa.parser.ast.body.BodyDeclaration; +import japa.parser.ast.body.ClassOrInterfaceDeclaration; +import japa.parser.ast.body.ConstructorDeclaration; +import japa.parser.ast.body.EmptyMemberDeclaration; +import japa.parser.ast.body.EmptyTypeDeclaration; +import japa.parser.ast.body.EnumConstantDeclaration; +import japa.parser.ast.body.EnumDeclaration; +import japa.parser.ast.body.FieldDeclaration; +import japa.parser.ast.body.InitializerDeclaration; +import japa.parser.ast.body.JavadocComment; +import japa.parser.ast.body.MethodDeclaration; +import japa.parser.ast.body.ModifierSet; +import japa.parser.ast.body.Parameter; +import japa.parser.ast.body.TypeDeclaration; +import japa.parser.ast.body.VariableDeclarator; +import japa.parser.ast.body.VariableDeclaratorId; +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.expr.ArrayAccessExpr; +import japa.parser.ast.expr.ArrayCreationExpr; +import japa.parser.ast.expr.ArrayInitializerExpr; +import japa.parser.ast.expr.AssignExpr; +import japa.parser.ast.expr.BinaryExpr; +import japa.parser.ast.expr.BooleanLiteralExpr; +import japa.parser.ast.expr.CastExpr; +import japa.parser.ast.expr.CharLiteralExpr; +import japa.parser.ast.expr.ClassExpr; +import japa.parser.ast.expr.ConditionalExpr; +import japa.parser.ast.expr.DoubleLiteralExpr; +import japa.parser.ast.expr.EnclosedExpr; +import japa.parser.ast.expr.Expression; +import japa.parser.ast.expr.FieldAccessExpr; +import japa.parser.ast.expr.InstanceOfExpr; +import japa.parser.ast.expr.IntegerLiteralExpr; +import japa.parser.ast.expr.IntegerLiteralMinValueExpr; +import japa.parser.ast.expr.LongLiteralExpr; +import japa.parser.ast.expr.LongLiteralMinValueExpr; +import japa.parser.ast.expr.MarkerAnnotationExpr; +import japa.parser.ast.expr.MemberValuePair; +import japa.parser.ast.expr.MethodCallExpr; +import japa.parser.ast.expr.NameExpr; +import japa.parser.ast.expr.NormalAnnotationExpr; +import japa.parser.ast.expr.NullLiteralExpr; +import japa.parser.ast.expr.ObjectCreationExpr; +import japa.parser.ast.expr.QualifiedNameExpr; +import japa.parser.ast.expr.SingleMemberAnnotationExpr; +import japa.parser.ast.expr.StringLiteralExpr; +import japa.parser.ast.expr.SuperExpr; +import japa.parser.ast.expr.ThisExpr; +import japa.parser.ast.expr.UnaryExpr; +import japa.parser.ast.expr.VariableDeclarationExpr; +import japa.parser.ast.stmt.AssertStmt; +import japa.parser.ast.stmt.BlockStmt; +import japa.parser.ast.stmt.BreakStmt; +import japa.parser.ast.stmt.CatchClause; +import japa.parser.ast.stmt.ContinueStmt; +import japa.parser.ast.stmt.DoStmt; +import japa.parser.ast.stmt.EmptyStmt; +import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; +import japa.parser.ast.stmt.ExpressionStmt; +import japa.parser.ast.stmt.ForStmt; +import japa.parser.ast.stmt.ForeachStmt; +import japa.parser.ast.stmt.IfStmt; +import japa.parser.ast.stmt.LabeledStmt; +import japa.parser.ast.stmt.ReturnStmt; +import japa.parser.ast.stmt.Statement; +import japa.parser.ast.stmt.SwitchEntryStmt; +import japa.parser.ast.stmt.SwitchStmt; +import japa.parser.ast.stmt.SynchronizedStmt; +import japa.parser.ast.stmt.ThrowStmt; +import japa.parser.ast.stmt.TryStmt; +import japa.parser.ast.stmt.TypeDeclarationStmt; +import japa.parser.ast.stmt.WhileStmt; +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.type.PrimitiveType; +import japa.parser.ast.type.ReferenceType; +import japa.parser.ast.type.Type; +import japa.parser.ast.type.VoidType; +import japa.parser.ast.type.WildcardType; + +import java.io.InputStream; +import java.util.LinkedList; +import java.util.List; + +/** + *

    + * This class was generated automatically by javacc, do not edit. + *

    + * + * @author Júlio Vilmar Gesser + */ +final class ASTParser implements ASTParserConstants { + + void reset(InputStream in, String encoding) { + ReInit(in, encoding); + token_source.clearComments(); + } + + private List add(List list, Object obj) { + if (list == null) { + list = new LinkedList(); + } + list.add(obj); + return list; + } + + private List add(int pos, List list, Object obj) { + if (list == null) { + list = new LinkedList(); + } + list.add(pos, obj); + return list; + } + + private class Modifier { + + final int modifiers; + + final List annotations; + + final int beginLine; + + final int beginColumn; + + public Modifier(int beginLine, int beginColumn, int modifiers, List annotations) { + this.beginLine = beginLine; + this.beginColumn = beginColumn; + this.modifiers = modifiers; + this.annotations = annotations; + } + } + + public int addModifier(int modifiers, int mod, Token token) throws ParseException { + if ((ModifierSet.hasModifier(modifiers, mod))) { + throwParseException(token, "Duplicated modifier"); + } + return ModifierSet.addModifier(modifiers, mod); + } + + private void pushJavadoc() { + token_source.pushJavadoc(); + } + + private JavadocComment popJavadoc() { + return token_source.popJavadoc(); + } + + private List getComments() { + return token_source.getComments(); + } + + private void throwParseException(Token token, String message) throws ParseException { + StringBuilder buf = new StringBuilder(); + buf.append(message); + buf.append(": \""); + buf.append(token.image); + buf.append("\" at line "); + buf.append(token.beginLine); + buf.append(", column "); + buf.append(token.beginColumn); + ParseException e = new ParseException(buf.toString()); + e.currentToken = token; + throw e; + } + + static final class GTToken extends Token { + + int realKind = ASTParserConstants.GT; + + GTToken(int kind, String image) { + this.kind = kind; + this.image = image; + } + + public static Token newToken(int kind, String image) { + return new GTToken(kind, image); + } + } + + /***************************************** + * THE JAVA LANGUAGE GRAMMAR STARTS HERE * + *****************************************/ + + /* + * Program structuring syntax follows. + */ + final public CompilationUnit CompilationUnit() throws ParseException { + PackageDeclaration pakage = null; + List imports = null; + ImportDeclaration in = null; + List types = null; + TypeDeclaration tn = null; + int line = -1; + int column = 0; + if (jj_2_1(2147483647)) { + pakage = PackageDeclaration(); + line = pakage.getBeginLine(); + column = pakage.getBeginColumn(); + } else { + ; + } + label_1: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IMPORT: + ; + break; + default: + jj_la1[0] = jj_gen; + break label_1; + } + in = ImportDeclaration(); + if (line == -1) { + line = in.getBeginLine(); + column = in.getBeginColumn(); + } + imports = add(imports, in); + } + label_2: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ABSTRACT: + case CLASS: + case ENUM: + case FINAL: + case INTERFACE: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case SEMICOLON: + case AT: + ; + break; + default: + jj_la1[1] = jj_gen; + break label_2; + } + tn = TypeDeclaration(); + if (line == -1) { + line = tn.getBeginLine(); + column = tn.getBeginColumn(); + } + types = add(types, tn); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case 0: + jj_consume_token(0); + break; + case 128: + jj_consume_token(128); + break; + default: + jj_la1[2] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return new CompilationUnit(line == -1 ? 0 : line, column, token.endLine, token.endColumn, pakage, imports, types, getComments()); + } + } + throw new Error("Missing return statement in function"); + } + + final public PackageDeclaration PackageDeclaration() throws ParseException { + List annotations = null; + AnnotationExpr ann; + NameExpr name; + int line; + int column; + label_3: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case AT: + ; + break; + default: + jj_la1[3] = jj_gen; + break label_3; + } + ann = Annotation(); + annotations = add(annotations, ann); + } + jj_consume_token(PACKAGE); + line = token.beginLine; + column = token.beginColumn; + name = Name(); + jj_consume_token(SEMICOLON); + { + if (true) { + return new PackageDeclaration(line, column, token.endLine, token.endColumn, annotations, name); + } + } + throw new Error("Missing return statement in function"); + } + + final public ImportDeclaration ImportDeclaration() throws ParseException { + NameExpr name; + boolean isStatic = false; + boolean isAsterisk = false; + int line; + int column; + jj_consume_token(IMPORT); + line = token.beginLine; + column = token.beginColumn; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case STATIC: + jj_consume_token(STATIC); + isStatic = true; + break; + default: + jj_la1[4] = jj_gen; + ; + } + name = Name(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case DOT: + jj_consume_token(DOT); + jj_consume_token(STAR); + isAsterisk = true; + break; + default: + jj_la1[5] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + { + if (true) { + return new ImportDeclaration(line, column, token.endLine, token.endColumn, name, isStatic, isAsterisk); + } + } + throw new Error("Missing return statement in function"); + } + + /* + * Modifiers. We match all modifiers in a single rule to reduce the chances of + * syntax errors for simple modifier mistakes. It will also enable us to give + * better error messages. + */ + final public Modifier Modifiers() throws ParseException { + int beginLine = -1; + int beginColumn = -1; + int modifiers = 0; + List annotations = null; + AnnotationExpr ann; + label_4: while (true) { + if (jj_2_2(2)) { + ; + } else { + break label_4; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PUBLIC: + jj_consume_token(PUBLIC); + modifiers = addModifier(modifiers, ModifierSet.PUBLIC, token); + if (beginLine == -1) { + beginLine = token.beginLine; + beginColumn = token.beginColumn; + } + break; + case STATIC: + jj_consume_token(STATIC); + modifiers = addModifier(modifiers, ModifierSet.STATIC, token); + if (beginLine == -1) { + beginLine = token.beginLine; + beginColumn = token.beginColumn; + } + break; + case PROTECTED: + jj_consume_token(PROTECTED); + modifiers = addModifier(modifiers, ModifierSet.PROTECTED, token); + if (beginLine == -1) { + beginLine = token.beginLine; + beginColumn = token.beginColumn; + } + break; + case PRIVATE: + jj_consume_token(PRIVATE); + modifiers = addModifier(modifiers, ModifierSet.PRIVATE, token); + if (beginLine == -1) { + beginLine = token.beginLine; + beginColumn = token.beginColumn; + } + break; + case FINAL: + jj_consume_token(FINAL); + modifiers = addModifier(modifiers, ModifierSet.FINAL, token); + if (beginLine == -1) { + beginLine = token.beginLine; + beginColumn = token.beginColumn; + } + break; + case ABSTRACT: + jj_consume_token(ABSTRACT); + modifiers = addModifier(modifiers, ModifierSet.ABSTRACT, token); + if (beginLine == -1) { + beginLine = token.beginLine; + beginColumn = token.beginColumn; + } + break; + case SYNCHRONIZED: + jj_consume_token(SYNCHRONIZED); + modifiers = addModifier(modifiers, ModifierSet.SYNCHRONIZED, token); + if (beginLine == -1) { + beginLine = token.beginLine; + beginColumn = token.beginColumn; + } + break; + case NATIVE: + jj_consume_token(NATIVE); + modifiers = addModifier(modifiers, ModifierSet.NATIVE, token); + if (beginLine == -1) { + beginLine = token.beginLine; + beginColumn = token.beginColumn; + } + break; + case TRANSIENT: + jj_consume_token(TRANSIENT); + modifiers = addModifier(modifiers, ModifierSet.TRANSIENT, token); + if (beginLine == -1) { + beginLine = token.beginLine; + beginColumn = token.beginColumn; + } + break; + case VOLATILE: + jj_consume_token(VOLATILE); + modifiers = addModifier(modifiers, ModifierSet.VOLATILE, token); + if (beginLine == -1) { + beginLine = token.beginLine; + beginColumn = token.beginColumn; + } + break; + case STRICTFP: + jj_consume_token(STRICTFP); + modifiers = addModifier(modifiers, ModifierSet.STRICTFP, token); + if (beginLine == -1) { + beginLine = token.beginLine; + beginColumn = token.beginColumn; + } + break; + case AT: + ann = Annotation(); + annotations = add(annotations, ann); + if (beginLine == -1) { + beginLine = ann.getBeginLine(); + beginColumn = ann.getBeginColumn(); + } + break; + default: + jj_la1[6] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + { + if (true) { + return new Modifier(beginLine, beginColumn, modifiers, annotations); + } + } + throw new Error("Missing return statement in function"); + } + + /* + * Declaration syntax follows. + */ + final public TypeDeclaration TypeDeclaration() throws ParseException { + Modifier modifier; + TypeDeclaration ret; + pushJavadoc(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case SEMICOLON: + jj_consume_token(SEMICOLON); + ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); + break; + case ABSTRACT: + case CLASS: + case ENUM: + case FINAL: + case INTERFACE: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case AT: + modifier = Modifiers(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case CLASS: + case INTERFACE: + ret = ClassOrInterfaceDeclaration(modifier); + break; + case ENUM: + ret = EnumDeclaration(modifier); + break; + case AT: + ret = AnnotationTypeDeclaration(modifier); + break; + default: + jj_la1[7] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + default: + jj_la1[8] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public ClassOrInterfaceDeclaration ClassOrInterfaceDeclaration(Modifier modifier) throws ParseException { + boolean isInterface = false; + String name; + List typePar = null; + List extList = null; + List impList = null; + List members; + int line = modifier.beginLine; + int column = modifier.beginColumn; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case CLASS: + jj_consume_token(CLASS); + break; + case INTERFACE: + jj_consume_token(INTERFACE); + isInterface = true; + break; + default: + jj_la1[9] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + if (line == -1) { + line = token.beginLine; + column = token.beginColumn; + } + jj_consume_token(IDENTIFIER); + name = token.image; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LT: + typePar = TypeParameters(); + typePar.remove(0); + break; + default: + jj_la1[10] = jj_gen; + ; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case EXTENDS: + extList = ExtendsList(isInterface); + break; + default: + jj_la1[11] = jj_gen; + ; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IMPLEMENTS: + impList = ImplementsList(isInterface); + break; + default: + jj_la1[12] = jj_gen; + ; + } + members = ClassOrInterfaceBody(isInterface); + { + if (true) { + return new ClassOrInterfaceDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, isInterface, name, typePar, extList, impList, members); + } + } + throw new Error("Missing return statement in function"); + } + + final public List ExtendsList(boolean isInterface) throws ParseException { + boolean extendsMoreThanOne = false; + List ret = new LinkedList(); + ClassOrInterfaceType cit; + jj_consume_token(EXTENDS); + cit = ClassOrInterfaceType(); + ret.add(cit); + label_5: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[13] = jj_gen; + break label_5; + } + jj_consume_token(COMMA); + cit = ClassOrInterfaceType(); + ret.add(cit); + extendsMoreThanOne = true; + } + if (extendsMoreThanOne && !isInterface) { + throwParseException(token, "A class cannot extend more than one other class"); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public List ImplementsList(boolean isInterface) throws ParseException { + List ret = new LinkedList(); + ClassOrInterfaceType cit; + jj_consume_token(IMPLEMENTS); + cit = ClassOrInterfaceType(); + ret.add(cit); + label_6: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[14] = jj_gen; + break label_6; + } + jj_consume_token(COMMA); + cit = ClassOrInterfaceType(); + ret.add(cit); + } + if (isInterface) { + throwParseException(token, "An interface cannot implement other interfaces"); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public EnumDeclaration EnumDeclaration(Modifier modifier) throws ParseException { + String name; + List impList = null; + EnumConstantDeclaration entry; + List entries = null; + BodyDeclaration member; + List members = null; + int line = modifier.beginLine; + int column = modifier.beginColumn; + jj_consume_token(ENUM); + if (line == -1) { + line = token.beginLine; + column = token.beginColumn; + } + jj_consume_token(IDENTIFIER); + name = token.image; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IMPLEMENTS: + impList = ImplementsList(false); + break; + default: + jj_la1[15] = jj_gen; + ; + } + jj_consume_token(LBRACE); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENTIFIER: + case AT: + entries = new LinkedList(); + entry = EnumConstantDeclaration(); + entries.add(entry); + label_7: while (true) { + if (jj_2_3(2)) { + ; + } else { + break label_7; + } + jj_consume_token(COMMA); + entry = EnumConstantDeclaration(); + entries.add(entry); + } + break; + default: + jj_la1[16] = jj_gen; + ; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + jj_consume_token(COMMA); + break; + default: + jj_la1[17] = jj_gen; + ; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case SEMICOLON: + jj_consume_token(SEMICOLON); + label_8: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOID: + case VOLATILE: + case IDENTIFIER: + case LBRACE: + case SEMICOLON: + case AT: + case LT: + ; + break; + default: + jj_la1[18] = jj_gen; + break label_8; + } + member = ClassOrInterfaceBodyDeclaration(false); + members = add(members, member); + } + break; + default: + jj_la1[19] = jj_gen; + ; + } + jj_consume_token(RBRACE); + { + if (true) { + return new EnumDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, name, impList, entries, members); + } + } + throw new Error("Missing return statement in function"); + } + + final public EnumConstantDeclaration EnumConstantDeclaration() throws ParseException { + List annotations = null; + AnnotationExpr ann; + String name; + List args = null; + List classBody = null; + int line = -1; + int column = -1; + pushJavadoc(); + label_9: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case AT: + ; + break; + default: + jj_la1[20] = jj_gen; + break label_9; + } + ann = Annotation(); + annotations = add(annotations, ann); + if (line == -1) { + line = ann.getBeginLine(); + column = ann.getBeginColumn(); + } + } + jj_consume_token(IDENTIFIER); + name = token.image; + if (line == -1) { + line = token.beginLine; + column = token.beginColumn; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LPAREN: + args = Arguments(); + break; + default: + jj_la1[21] = jj_gen; + ; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACE: + classBody = ClassOrInterfaceBody(false); + break; + default: + jj_la1[22] = jj_gen; + ; + } + { + if (true) { + return new EnumConstantDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), annotations, name, args, classBody); + } + } + throw new Error("Missing return statement in function"); + } + + final public List TypeParameters() throws ParseException { + List ret = new LinkedList(); + TypeParameter tp; + jj_consume_token(LT); + ret.add(new int[] { token.beginLine, token.beginColumn }); + tp = TypeParameter(); + ret.add(tp); + label_10: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[23] = jj_gen; + break label_10; + } + jj_consume_token(COMMA); + tp = TypeParameter(); + ret.add(tp); + } + jj_consume_token(GT); + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public TypeParameter TypeParameter() throws ParseException { + String name; + List typeBound = null; + int line; + int column; + jj_consume_token(IDENTIFIER); + name = token.image; + line = token.beginLine; + column = token.beginColumn; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case EXTENDS: + typeBound = TypeBound(); + break; + default: + jj_la1[24] = jj_gen; + ; + } + { + if (true) { + return new TypeParameter(line, column, token.endLine, token.endColumn, name, typeBound); + } + } + throw new Error("Missing return statement in function"); + } + + final public List TypeBound() throws ParseException { + List ret = new LinkedList(); + ClassOrInterfaceType cit; + jj_consume_token(EXTENDS); + cit = ClassOrInterfaceType(); + ret.add(cit); + label_11: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BIT_AND: + ; + break; + default: + jj_la1[25] = jj_gen; + break label_11; + } + jj_consume_token(BIT_AND); + cit = ClassOrInterfaceType(); + ret.add(cit); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public List ClassOrInterfaceBody(boolean isInterface) throws ParseException { + List ret = new LinkedList(); + BodyDeclaration member; + jj_consume_token(LBRACE); + label_12: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOID: + case VOLATILE: + case IDENTIFIER: + case LBRACE: + case SEMICOLON: + case AT: + case LT: + ; + break; + default: + jj_la1[26] = jj_gen; + break label_12; + } + member = ClassOrInterfaceBodyDeclaration(isInterface); + ret.add(member); + } + jj_consume_token(RBRACE); + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public BodyDeclaration ClassOrInterfaceBodyDeclaration(boolean isInterface) throws ParseException { + boolean isNestedInterface = false; + Modifier modifier; + BodyDeclaration ret; + pushJavadoc(); + if (jj_2_6(2)) { + ret = InitializerDeclaration(); + if (isInterface) { + throwParseException(token, "An interface cannot have initializers"); + } + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOID: + case VOLATILE: + case IDENTIFIER: + case AT: + case LT: + modifier = Modifiers(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case CLASS: + case INTERFACE: + ret = ClassOrInterfaceDeclaration(modifier); + break; + case ENUM: + ret = EnumDeclaration(modifier); + break; + case AT: + ret = AnnotationTypeDeclaration(modifier); + break; + default: + jj_la1[27] = jj_gen; + if (jj_2_4(2147483647)) { + ret = ConstructorDeclaration(modifier); + } else if (jj_2_5(2147483647)) { + ret = FieldDeclaration(modifier); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case VOID: + case IDENTIFIER: + case LT: + ret = MethodDeclaration(modifier); + break; + default: + jj_la1[28] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + break; + case SEMICOLON: + jj_consume_token(SEMICOLON); + ret = new EmptyMemberDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); + break; + default: + jj_la1[29] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public FieldDeclaration FieldDeclaration(Modifier modifier) throws ParseException { + Type type; + List variables = new LinkedList(); + VariableDeclarator val; + // Modifiers are already matched in the caller + type = Type(); + val = VariableDeclarator(); + variables.add(val); + label_13: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[30] = jj_gen; + break label_13; + } + jj_consume_token(COMMA); + val = VariableDeclarator(); + variables.add(val); + } + jj_consume_token(SEMICOLON); + int line = modifier.beginLine; + int column = modifier.beginColumn; + if (line == -1) { + line = type.getBeginLine(); + column = type.getBeginColumn(); + } + { + if (true) { + return new FieldDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, type, variables); + } + } + throw new Error("Missing return statement in function"); + } + + final public VariableDeclarator VariableDeclarator() throws ParseException { + VariableDeclaratorId id; + Expression init = null; + id = VariableDeclaratorId(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ASSIGN: + jj_consume_token(ASSIGN); + init = VariableInitializer(); + break; + default: + jj_la1[31] = jj_gen; + ; + } + { + if (true) { + return new VariableDeclarator(id.getBeginLine(), id.getBeginColumn(), token.endLine, token.endColumn, id, init); + } + } + throw new Error("Missing return statement in function"); + } + + final public VariableDeclaratorId VariableDeclaratorId() throws ParseException { + String name; + int arrayCount = 0; + int line; + int column; + jj_consume_token(IDENTIFIER); + name = token.image; + line = token.beginLine; + column = token.beginColumn; + label_14: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + ; + break; + default: + jj_la1[32] = jj_gen; + break label_14; + } + jj_consume_token(LBRACKET); + jj_consume_token(RBRACKET); + arrayCount++; + } + { + if (true) { + return new VariableDeclaratorId(line, column, token.endLine, token.endColumn, name, arrayCount); + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression VariableInitializer() throws ParseException { + Expression ret; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACE: + ret = ArrayInitializer(); + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + ret = Expression(); + break; + default: + jj_la1[33] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public ArrayInitializerExpr ArrayInitializer() throws ParseException { + List values = null; + Expression val; + int line; + int column; + jj_consume_token(LBRACE); + line = token.beginLine; + column = token.beginColumn; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LBRACE: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + val = VariableInitializer(); + values = add(values, val); + label_15: while (true) { + if (jj_2_7(2)) { + ; + } else { + break label_15; + } + jj_consume_token(COMMA); + val = VariableInitializer(); + values = add(values, val); + } + break; + default: + jj_la1[34] = jj_gen; + ; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + jj_consume_token(COMMA); + break; + default: + jj_la1[35] = jj_gen; + ; + } + jj_consume_token(RBRACE); + { + if (true) { + return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn, values); + } + } + throw new Error("Missing return statement in function"); + } + + final public MethodDeclaration MethodDeclaration(Modifier modifier) throws ParseException { + List typeParameters = null; + Type type; + String name; + List parameters; + int arrayCount = 0; + List throws_ = null; + BlockStmt block = null; + int line = modifier.beginLine; + int column = modifier.beginColumn; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LT: + typeParameters = TypeParameters(); + int[] lineCol = (int[]) typeParameters.remove(0); + if (line == -1) { + line = lineCol[0]; + column = lineCol[1]; + } + break; + default: + jj_la1[36] = jj_gen; + ; + } + type = ResultType(); + if (line == -1) { + line = type.getBeginLine(); + column = type.getBeginColumn(); + } + jj_consume_token(IDENTIFIER); + name = token.image; + parameters = FormalParameters(); + label_16: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + ; + break; + default: + jj_la1[37] = jj_gen; + break label_16; + } + jj_consume_token(LBRACKET); + jj_consume_token(RBRACKET); + arrayCount++; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case THROWS: + jj_consume_token(THROWS); + throws_ = NameList(); + break; + default: + jj_la1[38] = jj_gen; + ; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACE: + block = Block(); + break; + case SEMICOLON: + jj_consume_token(SEMICOLON); + break; + default: + jj_la1[39] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return new MethodDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, typeParameters, type, name, parameters, arrayCount, throws_, block); + } + } + throw new Error("Missing return statement in function"); + } + + final public List FormalParameters() throws ParseException { + List ret = null; + Parameter par; + jj_consume_token(LPAREN); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FINAL: + case FLOAT: + case INT: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case IDENTIFIER: + case AT: + par = FormalParameter(); + ret = add(ret, par); + label_17: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[40] = jj_gen; + break label_17; + } + jj_consume_token(COMMA); + par = FormalParameter(); + ret = add(ret, par); + } + break; + default: + jj_la1[41] = jj_gen; + ; + } + jj_consume_token(RPAREN); + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Parameter FormalParameter() throws ParseException { + Modifier modifier; + Type type; + boolean isVarArg = false; + VariableDeclaratorId id; + modifier = Modifiers(); + type = Type(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ELLIPSIS: + jj_consume_token(ELLIPSIS); + isVarArg = true; + break; + default: + jj_la1[42] = jj_gen; + ; + } + id = VariableDeclaratorId(); + int line = modifier.beginLine; + int column = modifier.beginColumn; + if (line == -1) { + line = type.getBeginLine(); + column = type.getBeginColumn(); + } + { + if (true) { + return new Parameter(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, isVarArg, id); + } + } + throw new Error("Missing return statement in function"); + } + + final public ConstructorDeclaration ConstructorDeclaration(Modifier modifier) throws ParseException { + List typeParameters = null; + String name; + List parameters; + List throws_ = null; + ExplicitConstructorInvocationStmt exConsInv = null; + List stmts; + int line = modifier.beginLine; + int column = modifier.beginColumn; + int bbLine = 0; + int bbColumn = 0; + int beLine = 0; + int beColumn = 0; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LT: + typeParameters = TypeParameters(); + int[] lineCol = (int[]) typeParameters.remove(0); + if (line == -1) { + line = lineCol[0]; + column = lineCol[1]; + } + break; + default: + jj_la1[43] = jj_gen; + ; + } + jj_consume_token(IDENTIFIER); + name = token.image; + if (line == -1) { + line = token.beginLine; + column = token.beginColumn; + } + parameters = FormalParameters(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case THROWS: + jj_consume_token(THROWS); + throws_ = NameList(); + break; + default: + jj_la1[44] = jj_gen; + ; + } + jj_consume_token(LBRACE); + bbLine = token.beginLine; + bbColumn = token.beginColumn; + if (jj_2_8(2147483647)) { + exConsInv = ExplicitConstructorInvocation(); + } else { + ; + } + stmts = Statements(); + jj_consume_token(RBRACE); + if (exConsInv != null) { + stmts = add(0, stmts, exConsInv); + } + { + if (true) { + return new ConstructorDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, typeParameters, name, parameters, throws_, new BlockStmt(bbLine, bbColumn, token.endLine, token.endColumn, + stmts)); + } + } + throw new Error("Missing return statement in function"); + } + + final public ExplicitConstructorInvocationStmt ExplicitConstructorInvocation() throws ParseException { + boolean isThis = false; + List args; + Expression expr = null; + List typeArgs = null; + int line = -1; + int column = 0; + if (jj_2_10(2147483647)) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LT: + typeArgs = TypeArguments(); + int[] lineCol = (int[]) typeArgs.remove(0); + line = lineCol[0]; + column = lineCol[1]; + break; + default: + jj_la1[45] = jj_gen; + ; + } + jj_consume_token(THIS); + if (line == -1) { + line = token.beginLine; + column = token.beginColumn; + } + isThis = true; + args = Arguments(); + jj_consume_token(SEMICOLON); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LT: + if (jj_2_9(2147483647)) { + expr = PrimaryExpressionWithoutSuperSuffix(); + jj_consume_token(DOT); + line = expr.getBeginLine(); + column = expr.getBeginColumn(); + } else { + ; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LT: + typeArgs = TypeArguments(); + int[] lineCol = (int[]) typeArgs.remove(0); + if (line == -1) { + line = lineCol[0]; + column = lineCol[1]; + } + break; + default: + jj_la1[46] = jj_gen; + ; + } + jj_consume_token(SUPER); + if (line == -1) { + line = token.beginLine; + column = token.beginColumn; + } + args = Arguments(); + jj_consume_token(SEMICOLON); + break; + default: + jj_la1[47] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + { + if (true) { + return new ExplicitConstructorInvocationStmt(line, column, token.endLine, token.endColumn, typeArgs, isThis, expr, args); + } + } + throw new Error("Missing return statement in function"); + } + + final public List Statements() throws ParseException { + List ret = null; + Statement stmt; + label_18: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ABSTRACT: + case ASSERT: + case BOOLEAN: + case BREAK: + case BYTE: + case CHAR: + case CLASS: + case CONTINUE: + case DO: + case DOUBLE: + case FALSE: + case FINAL: + case FLOAT: + case FOR: + case IF: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case NEW: + case NULL: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case RETURN: + case SHORT: + case STATIC: + case STRICTFP: + case SUPER: + case SWITCH: + case SYNCHRONIZED: + case THIS: + case THROW: + case TRANSIENT: + case TRUE: + case TRY: + case VOID: + case VOLATILE: + case WHILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LBRACE: + case SEMICOLON: + case AT: + case INCR: + case DECR: + ; + break; + default: + jj_la1[48] = jj_gen; + break label_18; + } + stmt = BlockStatement(); + ret = add(ret, stmt); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public InitializerDeclaration InitializerDeclaration() throws ParseException { + BlockStmt block; + int line = -1; + int column = 0; + boolean isStatic = false; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case STATIC: + jj_consume_token(STATIC); + isStatic = true; + line = token.beginLine; + column = token.beginColumn; + break; + default: + jj_la1[49] = jj_gen; + ; + } + block = Block(); + if (line == -1) { + line = block.getBeginLine(); + column = block.getBeginColumn(); + } + { + if (true) { + return new InitializerDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), isStatic, block); + } + } + throw new Error("Missing return statement in function"); + } + + /* + * Type, name and expression syntax follows. + */ + final public Type Type() throws ParseException { + Type ret; + if (jj_2_11(2)) { + ret = ReferenceType(); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + ret = PrimitiveType(); + break; + default: + jj_la1[50] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public ReferenceType ReferenceType() throws ParseException { + Type type; + int arrayCount = 0; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + type = PrimitiveType(); + label_19: while (true) { + jj_consume_token(LBRACKET); + jj_consume_token(RBRACKET); + arrayCount++; + if (jj_2_12(2)) { + ; + } else { + break label_19; + } + } + break; + case IDENTIFIER: + type = ClassOrInterfaceType(); + label_20: while (true) { + if (jj_2_13(2)) { + ; + } else { + break label_20; + } + jj_consume_token(LBRACKET); + jj_consume_token(RBRACKET); + arrayCount++; + } + break; + default: + jj_la1[51] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return new ReferenceType(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type, arrayCount); + } + } + throw new Error("Missing return statement in function"); + } + + final public ClassOrInterfaceType ClassOrInterfaceType() throws ParseException { + ClassOrInterfaceType ret; + String name; + List typeArgs = null; + int line; + int column; + jj_consume_token(IDENTIFIER); + line = token.beginLine; + column = token.beginColumn; + name = token.image; + if (jj_2_14(2)) { + typeArgs = TypeArguments(); + typeArgs.remove(0); + } else { + ; + } + ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn, null, name, typeArgs); + label_21: while (true) { + if (jj_2_15(2)) { + ; + } else { + break label_21; + } + jj_consume_token(DOT); + jj_consume_token(IDENTIFIER); + name = token.image; + if (jj_2_16(2)) { + typeArgs = TypeArguments(); + typeArgs.remove(0); + } else { + ; + } + ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn, ret, name, typeArgs); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public List TypeArguments() throws ParseException { + List ret = new LinkedList(); + Type type; + jj_consume_token(LT); + ret.add(new int[] { token.beginLine, token.beginColumn }); + type = TypeArgument(); + ret.add(type); + label_22: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[52] = jj_gen; + break label_22; + } + jj_consume_token(COMMA); + type = TypeArgument(); + ret.add(type); + } + jj_consume_token(GT); + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Type TypeArgument() throws ParseException { + Type ret; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case IDENTIFIER: + ret = ReferenceType(); + break; + case HOOK: + ret = Wildcard(); + break; + default: + jj_la1[53] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public WildcardType Wildcard() throws ParseException { + ReferenceType ext = null; + ReferenceType sup = null; + int line; + int column; + jj_consume_token(HOOK); + line = token.beginLine; + column = token.beginColumn; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case EXTENDS: + case SUPER: + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case EXTENDS: + jj_consume_token(EXTENDS); + ext = ReferenceType(); + break; + case SUPER: + jj_consume_token(SUPER); + sup = ReferenceType(); + break; + default: + jj_la1[54] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + default: + jj_la1[55] = jj_gen; + ; + } + { + if (true) { + return new WildcardType(line, column, token.endLine, token.endColumn, ext, sup); + } + } + throw new Error("Missing return statement in function"); + } + + final public PrimitiveType PrimitiveType() throws ParseException { + PrimitiveType ret; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + jj_consume_token(BOOLEAN); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Boolean); + break; + case CHAR: + jj_consume_token(CHAR); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Char); + break; + case BYTE: + jj_consume_token(BYTE); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Byte); + break; + case SHORT: + jj_consume_token(SHORT); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Short); + break; + case INT: + jj_consume_token(INT); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Int); + break; + case LONG: + jj_consume_token(LONG); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Long); + break; + case FLOAT: + jj_consume_token(FLOAT); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Float); + break; + case DOUBLE: + jj_consume_token(DOUBLE); + ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Double); + break; + default: + jj_la1[56] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Type ResultType() throws ParseException { + Type ret; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case VOID: + jj_consume_token(VOID); + ret = new VoidType(token.beginLine, token.beginColumn, token.endLine, token.endColumn); + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case IDENTIFIER: + ret = Type(); + break; + default: + jj_la1[57] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public NameExpr Name() throws ParseException { + NameExpr ret; + jj_consume_token(IDENTIFIER); + ret = new NameExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); + label_23: while (true) { + if (jj_2_17(2)) { + ; + } else { + break label_23; + } + jj_consume_token(DOT); + jj_consume_token(IDENTIFIER); + ret = new QualifiedNameExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, token.image); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public List NameList() throws ParseException { + List ret = new LinkedList(); + NameExpr name; + name = Name(); + ret.add(name); + label_24: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[58] = jj_gen; + break label_24; + } + jj_consume_token(COMMA); + name = Name(); + ret.add(name); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + /* + * Expression syntax follows. + */ + final public Expression Expression() throws ParseException { + Expression ret; + AssignExpr.Operator op; + Expression value; + ret = ConditionalExpression(); + if (jj_2_18(2)) { + op = AssignmentOperator(); + value = Expression(); + ret = new AssignExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, value, op); + } else { + ; + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public AssignExpr.Operator AssignmentOperator() throws ParseException { + AssignExpr.Operator ret; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ASSIGN: + jj_consume_token(ASSIGN); + ret = AssignExpr.Operator.assign; + break; + case STARASSIGN: + jj_consume_token(STARASSIGN); + ret = AssignExpr.Operator.star; + break; + case SLASHASSIGN: + jj_consume_token(SLASHASSIGN); + ret = AssignExpr.Operator.slash; + break; + case REMASSIGN: + jj_consume_token(REMASSIGN); + ret = AssignExpr.Operator.rem; + break; + case PLUSASSIGN: + jj_consume_token(PLUSASSIGN); + ret = AssignExpr.Operator.plus; + break; + case MINUSASSIGN: + jj_consume_token(MINUSASSIGN); + ret = AssignExpr.Operator.minus; + break; + case LSHIFTASSIGN: + jj_consume_token(LSHIFTASSIGN); + ret = AssignExpr.Operator.lShift; + break; + case RSIGNEDSHIFTASSIGN: + jj_consume_token(RSIGNEDSHIFTASSIGN); + ret = AssignExpr.Operator.rSignedShift; + break; + case RUNSIGNEDSHIFTASSIGN: + jj_consume_token(RUNSIGNEDSHIFTASSIGN); + ret = AssignExpr.Operator.rUnsignedShift; + break; + case ANDASSIGN: + jj_consume_token(ANDASSIGN); + ret = AssignExpr.Operator.and; + break; + case XORASSIGN: + jj_consume_token(XORASSIGN); + ret = AssignExpr.Operator.xor; + break; + case ORASSIGN: + jj_consume_token(ORASSIGN); + ret = AssignExpr.Operator.or; + break; + default: + jj_la1[59] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression ConditionalExpression() throws ParseException { + Expression ret; + Expression left; + Expression right; + ret = ConditionalOrExpression(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case HOOK: + jj_consume_token(HOOK); + left = Expression(); + jj_consume_token(COLON); + right = ConditionalExpression(); + ret = new ConditionalExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, left, right); + break; + default: + jj_la1[60] = jj_gen; + ; + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression ConditionalOrExpression() throws ParseException { + Expression ret; + Expression right; + ret = ConditionalAndExpression(); + label_25: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case SC_OR: + ; + break; + default: + jj_la1[61] = jj_gen; + break label_25; + } + jj_consume_token(SC_OR); + right = ConditionalAndExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.or); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression ConditionalAndExpression() throws ParseException { + Expression ret; + Expression right; + ret = InclusiveOrExpression(); + label_26: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case SC_AND: + ; + break; + default: + jj_la1[62] = jj_gen; + break label_26; + } + jj_consume_token(SC_AND); + right = InclusiveOrExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.and); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression InclusiveOrExpression() throws ParseException { + Expression ret; + Expression right; + ret = ExclusiveOrExpression(); + label_27: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BIT_OR: + ; + break; + default: + jj_la1[63] = jj_gen; + break label_27; + } + jj_consume_token(BIT_OR); + right = ExclusiveOrExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binOr); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression ExclusiveOrExpression() throws ParseException { + Expression ret; + Expression right; + ret = AndExpression(); + label_28: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case XOR: + ; + break; + default: + jj_la1[64] = jj_gen; + break label_28; + } + jj_consume_token(XOR); + right = AndExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.xor); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression AndExpression() throws ParseException { + Expression ret; + Expression right; + ret = EqualityExpression(); + label_29: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BIT_AND: + ; + break; + default: + jj_la1[65] = jj_gen; + break label_29; + } + jj_consume_token(BIT_AND); + right = EqualityExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binAnd); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression EqualityExpression() throws ParseException { + Expression ret; + Expression right; + BinaryExpr.Operator op; + ret = InstanceOfExpression(); + label_30: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case EQ: + case NE: + ; + break; + default: + jj_la1[66] = jj_gen; + break label_30; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case EQ: + jj_consume_token(EQ); + op = BinaryExpr.Operator.equals; + break; + case NE: + jj_consume_token(NE); + op = BinaryExpr.Operator.notEquals; + break; + default: + jj_la1[67] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + right = InstanceOfExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression InstanceOfExpression() throws ParseException { + Expression ret; + Type type; + ret = RelationalExpression(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case INSTANCEOF: + jj_consume_token(INSTANCEOF); + type = Type(); + ret = new InstanceOfExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, type); + break; + default: + jj_la1[68] = jj_gen; + ; + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression RelationalExpression() throws ParseException { + Expression ret; + Expression right; + BinaryExpr.Operator op; + ret = ShiftExpression(); + label_31: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LT: + case LE: + case GE: + case GT: + ; + break; + default: + jj_la1[69] = jj_gen; + break label_31; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LT: + jj_consume_token(LT); + op = BinaryExpr.Operator.less; + break; + case GT: + jj_consume_token(GT); + op = BinaryExpr.Operator.greater; + break; + case LE: + jj_consume_token(LE); + op = BinaryExpr.Operator.lessEquals; + break; + case GE: + jj_consume_token(GE); + op = BinaryExpr.Operator.greaterEquals; + break; + default: + jj_la1[70] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + right = ShiftExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression ShiftExpression() throws ParseException { + Expression ret; + Expression right; + BinaryExpr.Operator op; + ret = AdditiveExpression(); + label_32: while (true) { + if (jj_2_19(1)) { + ; + } else { + break label_32; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LSHIFT: + jj_consume_token(LSHIFT); + op = BinaryExpr.Operator.lShift; + break; + default: + jj_la1[71] = jj_gen; + if (jj_2_20(1)) { + RSIGNEDSHIFT(); + op = BinaryExpr.Operator.rSignedShift; + } else if (jj_2_21(1)) { + RUNSIGNEDSHIFT(); + op = BinaryExpr.Operator.rUnsignedShift; + } else { + jj_consume_token(-1); + throw new ParseException(); + } + } + right = AdditiveExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression AdditiveExpression() throws ParseException { + Expression ret; + Expression right; + BinaryExpr.Operator op; + ret = MultiplicativeExpression(); + label_33: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PLUS: + case MINUS: + ; + break; + default: + jj_la1[72] = jj_gen; + break label_33; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PLUS: + jj_consume_token(PLUS); + op = BinaryExpr.Operator.plus; + break; + case MINUS: + jj_consume_token(MINUS); + op = BinaryExpr.Operator.minus; + break; + default: + jj_la1[73] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + right = MultiplicativeExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression MultiplicativeExpression() throws ParseException { + Expression ret; + Expression right; + BinaryExpr.Operator op; + ret = UnaryExpression(); + label_34: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case STAR: + case SLASH: + case REM: + ; + break; + default: + jj_la1[74] = jj_gen; + break label_34; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case STAR: + jj_consume_token(STAR); + op = BinaryExpr.Operator.times; + break; + case SLASH: + jj_consume_token(SLASH); + op = BinaryExpr.Operator.divide; + break; + case REM: + jj_consume_token(REM); + op = BinaryExpr.Operator.remainder; + break; + default: + jj_la1[75] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + right = UnaryExpression(); + ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression UnaryExpression() throws ParseException { + Expression ret; + UnaryExpr.Operator op; + int line = 0; + int column = 0; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PLUS: + case MINUS: + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case PLUS: + jj_consume_token(PLUS); + op = UnaryExpr.Operator.positive; + line = token.beginLine; + column = token.beginColumn; + break; + case MINUS: + jj_consume_token(MINUS); + op = UnaryExpr.Operator.negative; + line = token.beginLine; + column = token.beginColumn; + break; + default: + jj_la1[76] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + ret = UnaryExpression(); + if (op == UnaryExpr.Operator.negative) { + if (ret instanceof IntegerLiteralExpr && ((IntegerLiteralExpr) ret).isMinValue()) { + ret = new IntegerLiteralMinValueExpr(line, column, token.endLine, token.endColumn); + } else if (ret instanceof LongLiteralExpr && ((LongLiteralExpr) ret).isMinValue()) { + ret = new LongLiteralMinValueExpr(line, column, token.endLine, token.endColumn); + } else { + ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, op); + } + } else { + ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, op); + } + break; + case INCR: + ret = PreIncrementExpression(); + break; + case DECR: + ret = PreDecrementExpression(); + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + ret = UnaryExpressionNotPlusMinus(); + break; + default: + jj_la1[77] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression PreIncrementExpression() throws ParseException { + Expression ret; + int line; + int column; + jj_consume_token(INCR); + line = token.beginLine; + column = token.beginColumn; + ret = PrimaryExpression(); + ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, UnaryExpr.Operator.preIncrement); + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression PreDecrementExpression() throws ParseException { + Expression ret; + int line; + int column; + jj_consume_token(DECR); + line = token.beginLine; + column = token.beginColumn; + ret = PrimaryExpression(); + ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, UnaryExpr.Operator.preDecrement); + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression UnaryExpressionNotPlusMinus() throws ParseException { + Expression ret; + UnaryExpr.Operator op; + int line = 0; + int column = 0; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BANG: + case TILDE: + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case TILDE: + jj_consume_token(TILDE); + op = UnaryExpr.Operator.inverse; + line = token.beginLine; + column = token.beginColumn; + break; + case BANG: + jj_consume_token(BANG); + op = UnaryExpr.Operator.not; + line = token.beginLine; + column = token.beginColumn; + break; + default: + jj_la1[78] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + ret = UnaryExpression(); + ret = new UnaryExpr(line, column, token.endLine, token.endColumn, ret, op); + break; + default: + jj_la1[79] = jj_gen; + if (jj_2_22(2147483647)) { + ret = CastExpression(); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + ret = PostfixExpression(); + break; + default: + jj_la1[80] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + // This production is to determine lookahead only. The LOOKAHEAD specifications + // below are not used, but they are there just to indicate that we know about + // this. + final public void CastLookahead() throws ParseException { + if (jj_2_23(2147483647)) { + jj_consume_token(LPAREN); + Type(); + jj_consume_token(LBRACKET); + jj_consume_token(RBRACKET); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LPAREN: + jj_consume_token(LPAREN); + Type(); + jj_consume_token(RPAREN); + UnaryExpression(); + break; + default: + jj_la1[81] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + + final public Expression PostfixExpression() throws ParseException { + Expression ret; + UnaryExpr.Operator op; + ret = PrimaryExpression(); + if (jj_2_24(2)) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case INCR: + jj_consume_token(INCR); + op = UnaryExpr.Operator.posIncrement; + break; + case DECR: + jj_consume_token(DECR); + op = UnaryExpr.Operator.posDecrement; + break; + default: + jj_la1[82] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + ret = new UnaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, op); + } else { + ; + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression CastExpression() throws ParseException { + Expression ret; + Type type; + int line; + int column; + jj_consume_token(LPAREN); + line = token.beginLine; + column = token.beginColumn; + type = Type(); + jj_consume_token(RPAREN); + ret = UnaryExpression(); + ret = new CastExpr(line, column, token.endLine, token.endColumn, type, ret); + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression PrimaryExpression() throws ParseException { + Expression ret; + Expression inner; + ret = PrimaryPrefix(); + label_35: while (true) { + if (jj_2_25(2)) { + ; + } else { + break label_35; + } + ret = PrimarySuffix(ret); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression PrimaryExpressionWithoutSuperSuffix() throws ParseException { + Expression ret; + Expression inner; + ret = PrimaryPrefix(); + label_36: while (true) { + if (jj_2_26(2147483647)) { + ; + } else { + break label_36; + } + ret = PrimarySuffixWithoutSuper(ret); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression PrimaryPrefix() throws ParseException { + Expression ret; + String name; + List typeArgs = null; + List args = null; + boolean hasArgs = false; + Type type; + int line; + int column; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case FALSE: + case NULL: + case TRUE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + ret = Literal(); + break; + case THIS: + jj_consume_token(THIS); + ret = new ThisExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); + break; + case SUPER: + jj_consume_token(SUPER); + ret = new SuperExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); + jj_consume_token(DOT); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LT: + typeArgs = TypeArguments(); + typeArgs.remove(0); + break; + default: + jj_la1[83] = jj_gen; + ; + } + jj_consume_token(IDENTIFIER); + name = token.image; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LPAREN: + args = Arguments(); + hasArgs = true; + break; + default: + jj_la1[84] = jj_gen; + ; + } + ret = hasArgs + ? new MethodCallExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, name, args) + : new FieldAccessExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, null, name); + break; + case LPAREN: + jj_consume_token(LPAREN); + line = token.beginLine; + column = token.beginColumn; + ret = Expression(); + jj_consume_token(RPAREN); + ret = new EnclosedExpr(line, column, token.endLine, token.endColumn, ret); + break; + case NEW: + ret = AllocationExpression(null); + break; + default: + jj_la1[86] = jj_gen; + if (jj_2_27(2147483647)) { + type = ResultType(); + jj_consume_token(DOT); + jj_consume_token(CLASS); + ret = new ClassExpr(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENTIFIER: + jj_consume_token(IDENTIFIER); + name = token.image; + line = token.beginLine; + column = token.beginColumn; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LPAREN: + args = Arguments(); + hasArgs = true; + break; + default: + jj_la1[85] = jj_gen; + ; + } + ret = hasArgs + ? new MethodCallExpr(line, column, token.endLine, token.endColumn, null, null, name, args) + : new NameExpr(line, column, token.endLine, token.endColumn, name); + break; + default: + jj_la1[87] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression PrimarySuffix(Expression scope) throws ParseException { + Expression ret; + if (jj_2_28(2)) { + ret = PrimarySuffixWithoutSuper(scope); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case DOT: + jj_consume_token(DOT); + jj_consume_token(SUPER); + ret = new SuperExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); + break; + default: + jj_la1[88] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression PrimarySuffixWithoutSuper(Expression scope) throws ParseException { + Expression ret; + List typeArgs = null; + List args = null; + boolean hasArgs = false; + String name; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case DOT: + jj_consume_token(DOT); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case THIS: + jj_consume_token(THIS); + ret = new ThisExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); + break; + case NEW: + ret = AllocationExpression(scope); + break; + default: + jj_la1[91] = jj_gen; + if (jj_2_29(2147483647)) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LT: + typeArgs = TypeArguments(); + typeArgs.remove(0); + break; + default: + jj_la1[89] = jj_gen; + ; + } + jj_consume_token(IDENTIFIER); + name = token.image; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LPAREN: + args = Arguments(); + hasArgs = true; + break; + default: + jj_la1[90] = jj_gen; + ; + } + ret = hasArgs + ? new MethodCallExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, name, args) + : new FieldAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, name); + } else { + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + case LBRACKET: + jj_consume_token(LBRACKET); + ret = Expression(); + jj_consume_token(RBRACKET); + ret = new ArrayAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, ret); + break; + default: + jj_la1[92] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression Literal() throws ParseException { + Expression ret; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case INTEGER_LITERAL: + jj_consume_token(INTEGER_LITERAL); + ret = new IntegerLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); + break; + case LONG_LITERAL: + jj_consume_token(LONG_LITERAL); + ret = new LongLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); + break; + case FLOATING_POINT_LITERAL: + jj_consume_token(FLOATING_POINT_LITERAL); + ret = new DoubleLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); + break; + case CHARACTER_LITERAL: + jj_consume_token(CHARACTER_LITERAL); + ret = new CharLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length() - 1)); + break; + case STRING_LITERAL: + jj_consume_token(STRING_LITERAL); + ret = new StringLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length() - 1)); + break; + case FALSE: + case TRUE: + ret = BooleanLiteral(); + break; + case NULL: + ret = NullLiteral(); + break; + default: + jj_la1[93] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression BooleanLiteral() throws ParseException { + Expression ret; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case TRUE: + jj_consume_token(TRUE); + ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, true); + break; + case FALSE: + jj_consume_token(FALSE); + ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, false); + break; + default: + jj_la1[94] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression NullLiteral() throws ParseException { + jj_consume_token(NULL); + { + if (true) { + return new NullLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn); + } + } + throw new Error("Missing return statement in function"); + } + + final public List Arguments() throws ParseException { + List ret = null; + jj_consume_token(LPAREN); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + ret = ArgumentList(); + break; + default: + jj_la1[95] = jj_gen; + ; + } + jj_consume_token(RPAREN); + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public List ArgumentList() throws ParseException { + List ret = new LinkedList(); + Expression expr; + expr = Expression(); + ret.add(expr); + label_37: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[96] = jj_gen; + break label_37; + } + jj_consume_token(COMMA); + expr = Expression(); + ret.add(expr); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression AllocationExpression(Expression scope) throws ParseException { + Expression ret; + Type type; + Object[] arr = null; + List typeArgs = null; + List anonymousBody = null; + List args; + int line; + int column; + jj_consume_token(NEW); + if (scope == null) { + line = token.beginLine; + column = token.beginColumn; + } else { + line = scope.getBeginLine(); + column = scope.getBeginColumn(); + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + type = PrimitiveType(); + arr = ArrayDimsAndInits(); + if (arr[0] instanceof Integer) { + ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer) arr[0]).intValue(), (ArrayInitializerExpr) arr[1]); + } else { + ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List) arr[0], ((Integer) arr[1]).intValue()); + } + break; + default: + jj_la1[98] = jj_gen; + if (jj_2_31(2147483647)) { + type = ClassOrInterfaceType(); + arr = ArrayDimsAndInits(); + if (arr[0] instanceof Integer) { + ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer) arr[0]).intValue(), (ArrayInitializerExpr) arr[1]); + } else { + ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List) arr[0], ((Integer) arr[1]).intValue()); + } + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENTIFIER: + case LT: + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LT: + typeArgs = TypeArguments(); + typeArgs.remove(0); + break; + default: + jj_la1[97] = jj_gen; + ; + } + type = ClassOrInterfaceType(); + args = Arguments(); + if (jj_2_30(2)) { + anonymousBody = ClassOrInterfaceBody(false); + } else { + ; + } + ret = new ObjectCreationExpr(line, column, token.endLine, token.endColumn, scope, (ClassOrInterfaceType) type, typeArgs, args, anonymousBody); + break; + default: + jj_la1[99] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + /* + * The third LOOKAHEAD specification below is to parse to PrimarySuffix + * if there is an expression between the "[...]". + */ + final public Object[] ArrayDimsAndInits() throws ParseException { + Object[] ret = new Object[2]; + Expression expr; + List inits = null; + int i = 0; + if (jj_2_34(2)) { + label_38: while (true) { + jj_consume_token(LBRACKET); + expr = Expression(); + inits = add(inits, expr); + jj_consume_token(RBRACKET); + if (jj_2_32(2)) { + ; + } else { + break label_38; + } + } + label_39: while (true) { + if (jj_2_33(2)) { + ; + } else { + break label_39; + } + jj_consume_token(LBRACKET); + jj_consume_token(RBRACKET); + i++; + } + ret[0] = inits; + ret[1] = new Integer(i); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + label_40: while (true) { + jj_consume_token(LBRACKET); + jj_consume_token(RBRACKET); + i++; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case LBRACKET: + ; + break; + default: + jj_la1[100] = jj_gen; + break label_40; + } + } + expr = ArrayInitializer(); + ret[0] = new Integer(i); + ret[1] = expr; + break; + default: + jj_la1[101] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + /* + * Statement syntax follows. + */ + final public Statement Statement() throws ParseException { + Statement ret; + if (jj_2_35(2)) { + ret = LabeledStatement(); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ASSERT: + ret = AssertStatement(); + break; + case LBRACE: + ret = Block(); + break; + case SEMICOLON: + ret = EmptyStatement(); + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case INCR: + case DECR: + ret = StatementExpression(); + break; + case SWITCH: + ret = SwitchStatement(); + break; + case IF: + ret = IfStatement(); + break; + case WHILE: + ret = WhileStatement(); + break; + case DO: + ret = DoStatement(); + break; + case FOR: + ret = ForStatement(); + break; + case BREAK: + ret = BreakStatement(); + break; + case CONTINUE: + ret = ContinueStatement(); + break; + case RETURN: + ret = ReturnStatement(); + break; + case THROW: + ret = ThrowStatement(); + break; + case SYNCHRONIZED: + ret = SynchronizedStatement(); + break; + case TRY: + ret = TryStatement(); + break; + default: + jj_la1[102] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public AssertStmt AssertStatement() throws ParseException { + Expression check; + Expression msg = null; + int line; + int column; + jj_consume_token(ASSERT); + line = token.beginLine; + column = token.beginColumn; + check = Expression(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COLON: + jj_consume_token(COLON); + msg = Expression(); + break; + default: + jj_la1[103] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + { + if (true) { + return new AssertStmt(line, column, token.endLine, token.endColumn, check, msg); + } + } + throw new Error("Missing return statement in function"); + } + + final public LabeledStmt LabeledStatement() throws ParseException { + String label; + Statement stmt; + int line; + int column; + jj_consume_token(IDENTIFIER); + line = token.beginLine; + column = token.beginColumn; + label = token.image; + jj_consume_token(COLON); + stmt = Statement(); + { + if (true) { + return new LabeledStmt(line, column, token.endLine, token.endColumn, label, stmt); + } + } + throw new Error("Missing return statement in function"); + } + + final public BlockStmt Block() throws ParseException { + List stmts; + int beginLine; + int beginColumn; + jj_consume_token(LBRACE); + beginLine = token.beginLine; + beginColumn = token.beginColumn; + stmts = Statements(); + jj_consume_token(RBRACE); + { + if (true) { + return new BlockStmt(beginLine, beginColumn, token.endLine, token.endColumn, stmts); + } + } + throw new Error("Missing return statement in function"); + } + + /* + * Classes inside block stametents can only be abstract or final. The semantic must check it. + */ + final public Statement BlockStatement() throws ParseException { + Statement ret; + Expression expr; + ClassOrInterfaceDeclaration typeDecl; + Modifier modifier; + if (jj_2_36(2147483647)) { + pushJavadoc(); + modifier = Modifiers(); + typeDecl = ClassOrInterfaceDeclaration(modifier); + ret = new TypeDeclarationStmt(typeDecl.getBeginLine(), typeDecl.getBeginColumn(), token.endLine, token.endColumn, typeDecl); + } else if (jj_2_37(2147483647)) { + expr = VariableDeclarationExpression(); + jj_consume_token(SEMICOLON); + ret = new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ASSERT: + case BOOLEAN: + case BREAK: + case BYTE: + case CHAR: + case CONTINUE: + case DO: + case DOUBLE: + case FALSE: + case FLOAT: + case FOR: + case IF: + case INT: + case LONG: + case NEW: + case NULL: + case RETURN: + case SHORT: + case SUPER: + case SWITCH: + case SYNCHRONIZED: + case THIS: + case THROW: + case TRUE: + case TRY: + case VOID: + case WHILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LBRACE: + case SEMICOLON: + case INCR: + case DECR: + ret = Statement(); + break; + default: + jj_la1[104] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public VariableDeclarationExpr VariableDeclarationExpression() throws ParseException { + Modifier modifier; + Type type; + List vars = new LinkedList(); + VariableDeclarator var; + modifier = Modifiers(); + type = Type(); + var = VariableDeclarator(); + vars.add(var); + label_41: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[105] = jj_gen; + break label_41; + } + jj_consume_token(COMMA); + var = VariableDeclarator(); + vars.add(var); + } + int line = modifier.beginLine; + int column = modifier.beginColumn; + if (line == -1) { + line = type.getBeginLine(); + column = type.getBeginColumn(); + } + { + if (true) { + return new VariableDeclarationExpr(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, vars); + } + } + throw new Error("Missing return statement in function"); + } + + final public EmptyStmt EmptyStatement() throws ParseException { + jj_consume_token(SEMICOLON); + { + if (true) { + return new EmptyStmt(token.beginLine, token.beginColumn, token.endLine, token.endColumn); + } + } + throw new Error("Missing return statement in function"); + } + + final public ExpressionStmt StatementExpression() throws ParseException { + Expression expr; + AssignExpr.Operator op; + Expression value; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case INCR: + expr = PreIncrementExpression(); + break; + case DECR: + expr = PreDecrementExpression(); + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + expr = PrimaryExpression(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ASSIGN: + case INCR: + case DECR: + case PLUSASSIGN: + case MINUSASSIGN: + case STARASSIGN: + case SLASHASSIGN: + case ANDASSIGN: + case ORASSIGN: + case XORASSIGN: + case REMASSIGN: + case LSHIFTASSIGN: + case RSIGNEDSHIFTASSIGN: + case RUNSIGNEDSHIFTASSIGN: + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case INCR: + jj_consume_token(INCR); + expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posIncrement); + break; + case DECR: + jj_consume_token(DECR); + expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posDecrement); + break; + case ASSIGN: + case PLUSASSIGN: + case MINUSASSIGN: + case STARASSIGN: + case SLASHASSIGN: + case ANDASSIGN: + case ORASSIGN: + case XORASSIGN: + case REMASSIGN: + case LSHIFTASSIGN: + case RSIGNEDSHIFTASSIGN: + case RUNSIGNEDSHIFTASSIGN: + op = AssignmentOperator(); + value = Expression(); + expr = new AssignExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, value, op); + break; + default: + jj_la1[106] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + break; + default: + jj_la1[107] = jj_gen; + ; + } + break; + default: + jj_la1[108] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + jj_consume_token(SEMICOLON); + { + if (true) { + return new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); + } + } + throw new Error("Missing return statement in function"); + } + + final public SwitchStmt SwitchStatement() throws ParseException { + Expression selector; + SwitchEntryStmt entry; + List entries = null; + int line; + int column; + jj_consume_token(SWITCH); + line = token.beginLine; + column = token.beginColumn; + jj_consume_token(LPAREN); + selector = Expression(); + jj_consume_token(RPAREN); + jj_consume_token(LBRACE); + label_42: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case CASE: + case _DEFAULT: + ; + break; + default: + jj_la1[109] = jj_gen; + break label_42; + } + entry = SwitchEntry(); + entries = add(entries, entry); + } + jj_consume_token(RBRACE); + { + if (true) { + return new SwitchStmt(line, column, token.endLine, token.endColumn, selector, entries); + } + } + throw new Error("Missing return statement in function"); + } + + final public SwitchEntryStmt SwitchEntry() throws ParseException { + Expression label = null; + List stmts; + int line; + int column; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case CASE: + jj_consume_token(CASE); + line = token.beginLine; + column = token.beginColumn; + label = Expression(); + break; + case _DEFAULT: + jj_consume_token(_DEFAULT); + line = token.beginLine; + column = token.beginColumn; + break; + default: + jj_la1[110] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + jj_consume_token(COLON); + stmts = Statements(); + { + if (true) { + return new SwitchEntryStmt(line, column, token.endLine, token.endColumn, label, stmts); + } + } + throw new Error("Missing return statement in function"); + } + + final public IfStmt IfStatement() throws ParseException { + Expression condition; + Statement thenStmt; + Statement elseStmt = null; + int line; + int column; + jj_consume_token(IF); + line = token.beginLine; + column = token.beginColumn; + jj_consume_token(LPAREN); + condition = Expression(); + jj_consume_token(RPAREN); + thenStmt = Statement(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ELSE: + jj_consume_token(ELSE); + elseStmt = Statement(); + break; + default: + jj_la1[111] = jj_gen; + ; + } + { + if (true) { + return new IfStmt(line, column, token.endLine, token.endColumn, condition, thenStmt, elseStmt); + } + } + throw new Error("Missing return statement in function"); + } + + final public WhileStmt WhileStatement() throws ParseException { + Expression condition; + Statement body; + int line; + int column; + jj_consume_token(WHILE); + line = token.beginLine; + column = token.beginColumn; + jj_consume_token(LPAREN); + condition = Expression(); + jj_consume_token(RPAREN); + body = Statement(); + { + if (true) { + return new WhileStmt(line, column, token.endLine, token.endColumn, condition, body); + } + } + throw new Error("Missing return statement in function"); + } + + final public DoStmt DoStatement() throws ParseException { + Expression condition; + Statement body; + int line; + int column; + jj_consume_token(DO); + line = token.beginLine; + column = token.beginColumn; + body = Statement(); + jj_consume_token(WHILE); + jj_consume_token(LPAREN); + condition = Expression(); + jj_consume_token(RPAREN); + jj_consume_token(SEMICOLON); + { + if (true) { + return new DoStmt(line, column, token.endLine, token.endColumn, body, condition); + } + } + throw new Error("Missing return statement in function"); + } + + final public Statement ForStatement() throws ParseException { + String id = null; + VariableDeclarationExpr varExpr = null; + Expression expr = null; + List init = null; + List update = null; + Statement body; + int line; + int column; + jj_consume_token(FOR); + line = token.beginLine; + column = token.beginColumn; + jj_consume_token(LPAREN); + if (jj_2_38(2147483647)) { + varExpr = VariableDeclarationExpression(); + jj_consume_token(COLON); + expr = Expression(); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FINAL: + case FLOAT: + case INT: + case LONG: + case NATIVE: + case NEW: + case NULL: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SUPER: + case SYNCHRONIZED: + case THIS: + case TRANSIENT: + case TRUE: + case VOID: + case VOLATILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case SEMICOLON: + case AT: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FINAL: + case FLOAT: + case INT: + case LONG: + case NATIVE: + case NEW: + case NULL: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SUPER: + case SYNCHRONIZED: + case THIS: + case TRANSIENT: + case TRUE: + case VOID: + case VOLATILE: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case AT: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + init = ForInit(); + break; + default: + jj_la1[112] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + expr = Expression(); + break; + default: + jj_la1[113] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + update = ForUpdate(); + break; + default: + jj_la1[114] = jj_gen; + ; + } + break; + default: + jj_la1[115] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + jj_consume_token(RPAREN); + body = Statement(); + if (varExpr != null) { + { + if (true) { + return new ForeachStmt(line, column, token.endLine, token.endColumn, varExpr, expr, body); + } + } + } + { + if (true) { + return new ForStmt(line, column, token.endLine, token.endColumn, init, expr, update, body); + } + } + throw new Error("Missing return statement in function"); + } + + final public List ForInit() throws ParseException { + List ret; + Expression expr; + if (jj_2_39(2147483647)) { + expr = VariableDeclarationExpression(); + ret = new LinkedList(); + ret.add(expr); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + ret = ExpressionList(); + break; + default: + jj_la1[116] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public List ExpressionList() throws ParseException { + List ret = new LinkedList(); + Expression expr; + expr = Expression(); + ret.add(expr); + label_43: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[117] = jj_gen; + break label_43; + } + jj_consume_token(COMMA); + expr = Expression(); + ret.add(expr); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public List ForUpdate() throws ParseException { + List ret; + ret = ExpressionList(); + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public BreakStmt BreakStatement() throws ParseException { + String id = null; + int line; + int column; + jj_consume_token(BREAK); + line = token.beginLine; + column = token.beginColumn; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENTIFIER: + jj_consume_token(IDENTIFIER); + id = token.image; + break; + default: + jj_la1[118] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + { + if (true) { + return new BreakStmt(line, column, token.endLine, token.endColumn, id); + } + } + throw new Error("Missing return statement in function"); + } + + final public ContinueStmt ContinueStatement() throws ParseException { + String id = null; + int line; + int column; + jj_consume_token(CONTINUE); + line = token.beginLine; + column = token.beginColumn; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENTIFIER: + jj_consume_token(IDENTIFIER); + id = token.image; + break; + default: + jj_la1[119] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + { + if (true) { + return new ContinueStmt(line, column, token.endLine, token.endColumn, id); + } + } + throw new Error("Missing return statement in function"); + } + + final public ReturnStmt ReturnStatement() throws ParseException { + Expression expr = null; + int line; + int column; + jj_consume_token(RETURN); + line = token.beginLine; + column = token.beginColumn; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + expr = Expression(); + break; + default: + jj_la1[120] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + { + if (true) { + return new ReturnStmt(line, column, token.endLine, token.endColumn, expr); + } + } + throw new Error("Missing return statement in function"); + } + + final public ThrowStmt ThrowStatement() throws ParseException { + Expression expr; + int line; + int column; + jj_consume_token(THROW); + line = token.beginLine; + column = token.beginColumn; + expr = Expression(); + jj_consume_token(SEMICOLON); + { + if (true) { + return new ThrowStmt(line, column, token.endLine, token.endColumn, expr); + } + } + throw new Error("Missing return statement in function"); + } + + final public SynchronizedStmt SynchronizedStatement() throws ParseException { + Expression expr; + BlockStmt block; + int line; + int column; + jj_consume_token(SYNCHRONIZED); + line = token.beginLine; + column = token.beginColumn; + jj_consume_token(LPAREN); + expr = Expression(); + jj_consume_token(RPAREN); + block = Block(); + { + if (true) { + return new SynchronizedStmt(line, column, token.endLine, token.endColumn, expr, block); + } + } + throw new Error("Missing return statement in function"); + } + + final public TryStmt TryStatement() throws ParseException { + BlockStmt tryBlock; + BlockStmt finallyBlock = null; + List catchs = null; + Parameter except; + BlockStmt catchBlock; + int line; + int column; + int cLine; + int cColumn; + jj_consume_token(TRY); + line = token.beginLine; + column = token.beginColumn; + tryBlock = Block(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case CATCH: + label_44: while (true) { + jj_consume_token(CATCH); + cLine = token.beginLine; + cColumn = token.beginColumn; + jj_consume_token(LPAREN); + except = FormalParameter(); + jj_consume_token(RPAREN); + catchBlock = Block(); + catchs = add(catchs, new CatchClause(cLine, cColumn, token.endLine, token.endColumn, except, catchBlock)); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case CATCH: + ; + break; + default: + jj_la1[121] = jj_gen; + break label_44; + } + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case FINALLY: + jj_consume_token(FINALLY); + finallyBlock = Block(); + break; + default: + jj_la1[122] = jj_gen; + ; + } + break; + case FINALLY: + jj_consume_token(FINALLY); + finallyBlock = Block(); + break; + default: + jj_la1[123] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return new TryStmt(line, column, token.endLine, token.endColumn, tryBlock, catchs, finallyBlock); + } + } + throw new Error("Missing return statement in function"); + } + + /* + * We use productions to match >>>, >> and > so that we can keep the + * type declaration syntax with generics clean + */ + final public void RUNSIGNEDSHIFT() throws ParseException { + if (getToken(1).kind == GT && + ((GTToken) getToken(1)).realKind == RUNSIGNEDSHIFT) { + + } else { + jj_consume_token(-1); + throw new ParseException(); + } + jj_consume_token(GT); + jj_consume_token(GT); + jj_consume_token(GT); + } + + final public void RSIGNEDSHIFT() throws ParseException { + if (getToken(1).kind == GT && + ((GTToken) getToken(1)).realKind == RSIGNEDSHIFT) { + + } else { + jj_consume_token(-1); + throw new ParseException(); + } + jj_consume_token(GT); + jj_consume_token(GT); + } + + /* Annotation syntax follows. */ + final public AnnotationExpr Annotation() throws ParseException { + AnnotationExpr ret; + if (jj_2_40(2147483647)) { + ret = NormalAnnotation(); + } else if (jj_2_41(2147483647)) { + ret = SingleMemberAnnotation(); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case AT: + ret = MarkerAnnotation(); + break; + default: + jj_la1[124] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public NormalAnnotationExpr NormalAnnotation() throws ParseException { + NameExpr name; + List pairs = null; + int line; + int column; + jj_consume_token(AT); + line = token.beginLine; + column = token.beginColumn; + name = Name(); + jj_consume_token(LPAREN); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case IDENTIFIER: + pairs = MemberValuePairs(); + break; + default: + jj_la1[125] = jj_gen; + ; + } + jj_consume_token(RPAREN); + { + if (true) { + return new NormalAnnotationExpr(line, column, token.endLine, token.endColumn, name, pairs); + } + } + throw new Error("Missing return statement in function"); + } + + final public MarkerAnnotationExpr MarkerAnnotation() throws ParseException { + NameExpr name; + int line; + int column; + jj_consume_token(AT); + line = token.beginLine; + column = token.beginColumn; + name = Name(); + { + if (true) { + return new MarkerAnnotationExpr(line, column, token.endLine, token.endColumn, name); + } + } + throw new Error("Missing return statement in function"); + } + + final public SingleMemberAnnotationExpr SingleMemberAnnotation() throws ParseException { + NameExpr name; + Expression memberVal; + int line; + int column; + jj_consume_token(AT); + line = token.beginLine; + column = token.beginColumn; + name = Name(); + jj_consume_token(LPAREN); + memberVal = MemberValue(); + jj_consume_token(RPAREN); + { + if (true) { + return new SingleMemberAnnotationExpr(line, column, token.endLine, token.endColumn, name, memberVal); + } + } + throw new Error("Missing return statement in function"); + } + + final public List MemberValuePairs() throws ParseException { + List ret = new LinkedList(); + MemberValuePair pair; + pair = MemberValuePair(); + ret.add(pair); + label_45: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + ; + break; + default: + jj_la1[126] = jj_gen; + break label_45; + } + jj_consume_token(COMMA); + pair = MemberValuePair(); + ret.add(pair); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public MemberValuePair MemberValuePair() throws ParseException { + String name; + Expression value; + int line; + int column; + jj_consume_token(IDENTIFIER); + name = token.image; + line = token.beginLine; + column = token.beginColumn; + jj_consume_token(ASSIGN); + value = MemberValue(); + { + if (true) { + return new MemberValuePair(line, column, token.endLine, token.endColumn, name, value); + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression MemberValue() throws ParseException { + Expression ret; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case AT: + ret = Annotation(); + break; + case LBRACE: + ret = MemberValueArrayInitializer(); + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + ret = ConditionalExpression(); + break; + default: + jj_la1[127] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression MemberValueArrayInitializer() throws ParseException { + List ret = new LinkedList(); + Expression member; + int line; + int column; + jj_consume_token(LBRACE); + line = token.beginLine; + column = token.beginColumn; + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FALSE: + case FLOAT: + case INT: + case LONG: + case NEW: + case NULL: + case SHORT: + case SUPER: + case THIS: + case TRUE: + case VOID: + case LONG_LITERAL: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case CHARACTER_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case LBRACE: + case AT: + case BANG: + case TILDE: + case INCR: + case DECR: + case PLUS: + case MINUS: + member = MemberValue(); + ret.add(member); + label_46: while (true) { + if (jj_2_42(2)) { + ; + } else { + break label_46; + } + jj_consume_token(COMMA); + member = MemberValue(); + ret.add(member); + } + break; + default: + jj_la1[128] = jj_gen; + ; + } + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case COMMA: + jj_consume_token(COMMA); + break; + default: + jj_la1[129] = jj_gen; + ; + } + jj_consume_token(RBRACE); + { + if (true) { + return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn, ret); + } + } + throw new Error("Missing return statement in function"); + } + + /* Annotation Types. */ + final public AnnotationDeclaration AnnotationTypeDeclaration(Modifier modifier) throws ParseException { + String name; + List members; + int line = modifier.beginLine; + int column = modifier.beginColumn; + jj_consume_token(AT); + if (line == -1) { + line = token.beginLine; + column = token.beginColumn; + } + jj_consume_token(INTERFACE); + jj_consume_token(IDENTIFIER); + name = token.image; + members = AnnotationTypeBody(); + { + if (true) { + return new AnnotationDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, name, members); + } + } + throw new Error("Missing return statement in function"); + } + + final public List AnnotationTypeBody() throws ParseException { + List ret = null; + BodyDeclaration member; + jj_consume_token(LBRACE); + label_47: while (true) { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case IDENTIFIER: + case SEMICOLON: + case AT: + ; + break; + default: + jj_la1[130] = jj_gen; + break label_47; + } + member = AnnotationBodyDeclaration(); + ret = add(ret, member); + } + jj_consume_token(RBRACE); + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public BodyDeclaration AnnotationBodyDeclaration() throws ParseException { + Modifier modifier; + BodyDeclaration ret; + pushJavadoc(); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case SEMICOLON: + jj_consume_token(SEMICOLON); + ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); + break; + case ABSTRACT: + case BOOLEAN: + case BYTE: + case CHAR: + case CLASS: + case DOUBLE: + case ENUM: + case FINAL: + case FLOAT: + case INT: + case INTERFACE: + case LONG: + case NATIVE: + case PRIVATE: + case PROTECTED: + case PUBLIC: + case SHORT: + case STATIC: + case STRICTFP: + case SYNCHRONIZED: + case TRANSIENT: + case VOLATILE: + case IDENTIFIER: + case AT: + modifier = Modifiers(); + if (jj_2_43(2147483647)) { + ret = AnnotationTypeMemberDeclaration(modifier); + } else { + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case CLASS: + case INTERFACE: + ret = ClassOrInterfaceDeclaration(modifier); + break; + case ENUM: + ret = EnumDeclaration(modifier); + break; + case AT: + ret = AnnotationTypeDeclaration(modifier); + break; + case BOOLEAN: + case BYTE: + case CHAR: + case DOUBLE: + case FLOAT: + case INT: + case LONG: + case SHORT: + case IDENTIFIER: + ret = FieldDeclaration(modifier); + break; + default: + jj_la1[131] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + break; + default: + jj_la1[132] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + final public AnnotationMemberDeclaration AnnotationTypeMemberDeclaration(Modifier modifier) throws ParseException { + Type type; + String name; + Expression defaultVal = null; + type = Type(); + jj_consume_token(IDENTIFIER); + name = token.image; + jj_consume_token(LPAREN); + jj_consume_token(RPAREN); + switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { + case _DEFAULT: + defaultVal = DefaultValue(); + break; + default: + jj_la1[133] = jj_gen; + ; + } + jj_consume_token(SEMICOLON); + int line = modifier.beginLine; + int column = modifier.beginColumn; + { + if (line == -1) { + line = type.getBeginLine(); + column = type.getBeginColumn(); + } + } + { + if (true) { + return new AnnotationMemberDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, type, name, defaultVal); + } + } + throw new Error("Missing return statement in function"); + } + + final public Expression DefaultValue() throws ParseException { + Expression ret; + jj_consume_token(_DEFAULT); + ret = MemberValue(); + { + if (true) { + return ret; + } + } + throw new Error("Missing return statement in function"); + } + + private boolean jj_2_1(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_1(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(0, xla); + } + } + + private boolean jj_2_2(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_2(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(1, xla); + } + } + + private boolean jj_2_3(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_3(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(2, xla); + } + } + + private boolean jj_2_4(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_4(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(3, xla); + } + } + + private boolean jj_2_5(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_5(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(4, xla); + } + } + + private boolean jj_2_6(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_6(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(5, xla); + } + } + + private boolean jj_2_7(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_7(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(6, xla); + } + } + + private boolean jj_2_8(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_8(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(7, xla); + } + } + + private boolean jj_2_9(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_9(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(8, xla); + } + } + + private boolean jj_2_10(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_10(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(9, xla); + } + } + + private boolean jj_2_11(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_11(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(10, xla); + } + } + + private boolean jj_2_12(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_12(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(11, xla); + } + } + + private boolean jj_2_13(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_13(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(12, xla); + } + } + + private boolean jj_2_14(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_14(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(13, xla); + } + } + + private boolean jj_2_15(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_15(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(14, xla); + } + } + + private boolean jj_2_16(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_16(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(15, xla); + } + } + + private boolean jj_2_17(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_17(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(16, xla); + } + } + + private boolean jj_2_18(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_18(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(17, xla); + } + } + + private boolean jj_2_19(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_19(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(18, xla); + } + } + + private boolean jj_2_20(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_20(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(19, xla); + } + } + + private boolean jj_2_21(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_21(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(20, xla); + } + } + + private boolean jj_2_22(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_22(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(21, xla); + } + } + + private boolean jj_2_23(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_23(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(22, xla); + } + } + + private boolean jj_2_24(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_24(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(23, xla); + } + } + + private boolean jj_2_25(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_25(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(24, xla); + } + } + + private boolean jj_2_26(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_26(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(25, xla); + } + } + + private boolean jj_2_27(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_27(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(26, xla); + } + } + + private boolean jj_2_28(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_28(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(27, xla); + } + } + + private boolean jj_2_29(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_29(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(28, xla); + } + } + + private boolean jj_2_30(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_30(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(29, xla); + } + } + + private boolean jj_2_31(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_31(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(30, xla); + } + } + + private boolean jj_2_32(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_32(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(31, xla); + } + } + + private boolean jj_2_33(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_33(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(32, xla); + } + } + + private boolean jj_2_34(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_34(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(33, xla); + } + } + + private boolean jj_2_35(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_35(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(34, xla); + } + } + + private boolean jj_2_36(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_36(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(35, xla); + } + } + + private boolean jj_2_37(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_37(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(36, xla); + } + } + + private boolean jj_2_38(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_38(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(37, xla); + } + } + + private boolean jj_2_39(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_39(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(38, xla); + } + } + + private boolean jj_2_40(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_40(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(39, xla); + } + } + + private boolean jj_2_41(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_41(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(40, xla); + } + } + + private boolean jj_2_42(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_42(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(41, xla); + } + } + + private boolean jj_2_43(int xla) { + jj_la = xla; + jj_lastpos = jj_scanpos = token; + try { + return !jj_3_43(); + } catch (LookaheadSuccess ls) { + return true; + } finally { + jj_save(42, xla); + } + } + + private boolean jj_3R_100() { + if (jj_3R_145()) { + return true; + } + return false; + } + + private boolean jj_3R_168() { + if (jj_scan_token(ASSIGN)) { + return true; + } + if (jj_3R_66()) { + return true; + } + return false; + } + + private boolean jj_3R_207() { + if (jj_scan_token(CHARACTER_LITERAL)) { + return true; + } + return false; + } + + private boolean jj_3R_206() { + if (jj_scan_token(FLOATING_POINT_LITERAL)) { + return true; + } + return false; + } + + private boolean jj_3R_66() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_100()) { + jj_scanpos = xsp; + if (jj_3R_101()) { + return true; + } + } + return false; + } + + private boolean jj_3R_205() { + if (jj_scan_token(LONG_LITERAL)) { + return true; + } + return false; + } + + private boolean jj_3R_361() { + if (jj_3R_372()) { + return true; + } + return false; + } + + private boolean jj_3R_204() { + if (jj_scan_token(INTEGER_LITERAL)) { + return true; + } + return false; + } + + private boolean jj_3R_83() { + if (jj_3R_71()) { + return true; + } + return false; + } + + private boolean jj_3R_167() { + if (jj_scan_token(IDENTIFIER)) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_200()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3_29() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_83()) { + jj_scanpos = xsp; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + return false; + } + + private boolean jj_3R_64() { + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + return false; + } + + private boolean jj_3R_184() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_204()) { + jj_scanpos = xsp; + if (jj_3R_205()) { + jj_scanpos = xsp; + if (jj_3R_206()) { + jj_scanpos = xsp; + if (jj_3R_207()) { + jj_scanpos = xsp; + if (jj_3R_208()) { + jj_scanpos = xsp; + if (jj_3R_209()) { + jj_scanpos = xsp; + if (jj_3R_210()) { + return true; + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_128() { + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_3R_73()) { + return true; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + return false; + } + + private boolean jj_3R_196() { + if (jj_3R_147()) { + return true; + } + return false; + } + + private boolean jj_3R_195() { + if (jj_3R_71()) { + return true; + } + return false; + } + + private boolean jj_3R_133() { + if (jj_3R_167()) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_168()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3R_164() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_195()) { + jj_scanpos = xsp; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + xsp = jj_scanpos; + if (jj_3R_196()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3R_163() { + if (jj_3R_187()) { + return true; + } + return false; + } + + private boolean jj_3R_173() { + if (jj_3R_201()) { + return true; + } + return false; + } + + private boolean jj_3R_162() { + if (jj_scan_token(THIS)) { + return true; + } + return false; + } + + private boolean jj_3R_321() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_133()) { + return true; + } + return false; + } + + private boolean jj_3_5() { + if (jj_3R_63()) { + return true; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_64()) { + jj_scanpos = xsp; + break; + } + } + xsp = jj_scanpos; + if (jj_scan_token(87)) { + jj_scanpos = xsp; + if (jj_scan_token(90)) { + jj_scanpos = xsp; + if (jj_scan_token(86)) { + return true; + } + } + } + return false; + } + + private boolean jj_3R_62() { + if (jj_3R_96()) { + return true; + } + return false; + } + + private boolean jj_3R_127() { + if (jj_scan_token(DOT)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_162()) { + jj_scanpos = xsp; + if (jj_3R_163()) { + jj_scanpos = xsp; + if (jj_3R_164()) { + return true; + } + } + } + return false; + } + + private boolean jj_3_4() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_62()) { + jj_scanpos = xsp; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + return false; + } + + private boolean jj_3R_247() { + if (jj_3R_63()) { + return true; + } + if (jj_3R_133()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_321()) { + jj_scanpos = xsp; + break; + } + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_226() { + if (jj_3R_248()) { + return true; + } + return false; + } + + private boolean jj_3R_81() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_127()) { + jj_scanpos = xsp; + if (jj_3R_128()) { + return true; + } + } + return false; + } + + private boolean jj_3R_198() { + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_225() { + if (jj_3R_247()) { + return true; + } + return false; + } + + private boolean jj_3R_224() { + if (jj_3R_246()) { + return true; + } + return false; + } + + private boolean jj_3R_372() { + if (jj_scan_token(_DEFAULT)) { + return true; + } + if (jj_3R_92()) { + return true; + } + return false; + } + + private boolean jj_3R_223() { + if (jj_3R_245()) { + return true; + } + return false; + } + + private boolean jj_3R_126() { + if (jj_scan_token(DOT)) { + return true; + } + if (jj_scan_token(SUPER)) { + return true; + } + return false; + } + + private boolean jj_3R_222() { + if (jj_3R_244()) { + return true; + } + return false; + } + + private boolean jj_3_28() { + if (jj_3R_81()) { + return true; + } + return false; + } + + private boolean jj_3R_221() { + if (jj_3R_243()) { + return true; + } + return false; + } + + private boolean jj_3R_188() { + if (jj_3R_147()) { + return true; + } + return false; + } + + private boolean jj_3R_80() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_28()) { + jj_scanpos = xsp; + if (jj_3R_126()) { + return true; + } + } + return false; + } + + private boolean jj_3_27() { + if (jj_3R_82()) { + return true; + } + if (jj_scan_token(DOT)) { + return true; + } + if (jj_scan_token(CLASS)) { + return true; + } + return false; + } + + private boolean jj_3R_197() { + if (jj_3R_88()) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_221()) { + jj_scanpos = xsp; + if (jj_3R_222()) { + jj_scanpos = xsp; + if (jj_3R_223()) { + jj_scanpos = xsp; + if (jj_3R_224()) { + jj_scanpos = xsp; + if (jj_3R_225()) { + jj_scanpos = xsp; + if (jj_3R_226()) { + return true; + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_156() { + if (jj_scan_token(IDENTIFIER)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_188()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3R_360() { + if (jj_3R_63()) { + return true; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_scan_token(RPAREN)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_361()) { + jj_scanpos = xsp; + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3_43() { + if (jj_3R_63()) { + return true; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + return false; + } + + private boolean jj_3R_356() { + if (jj_3R_247()) { + return true; + } + return false; + } + + private boolean jj_3_6() { + if (jj_3R_65()) { + return true; + } + return false; + } + + private boolean jj_3R_355() { + if (jj_3R_245()) { + return true; + } + return false; + } + + private boolean jj_3R_155() { + if (jj_3R_82()) { + return true; + } + if (jj_scan_token(DOT)) { + return true; + } + if (jj_scan_token(CLASS)) { + return true; + } + return false; + } + + private boolean jj_3R_354() { + if (jj_3R_244()) { + return true; + } + return false; + } + + private boolean jj_3R_154() { + if (jj_3R_187()) { + return true; + } + return false; + } + + private boolean jj_3R_353() { + if (jj_3R_243()) { + return true; + } + return false; + } + + private boolean jj_3R_153() { + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_3R_73()) { + return true; + } + if (jj_scan_token(RPAREN)) { + return true; + } + return false; + } + + private boolean jj_3R_352() { + if (jj_3R_360()) { + return true; + } + return false; + } + + private boolean jj_3R_165() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_6()) { + jj_scanpos = xsp; + if (jj_3R_197()) { + jj_scanpos = xsp; + if (jj_3R_198()) { + return true; + } + } + } + return false; + } + + private boolean jj_3_42() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_92()) { + return true; + } + return false; + } + + private boolean jj_3_26() { + if (jj_3R_81()) { + return true; + } + return false; + } + + private boolean jj_3R_186() { + if (jj_3R_147()) { + return true; + } + return false; + } + + private boolean jj_3R_185() { + if (jj_3R_71()) { + return true; + } + return false; + } + + private boolean jj_3R_131() { + if (jj_3R_165()) { + return true; + } + return false; + } + + private boolean jj_3R_346() { + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_347() { + if (jj_3R_88()) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_352()) { + jj_scanpos = xsp; + if (jj_3R_353()) { + jj_scanpos = xsp; + if (jj_3R_354()) { + jj_scanpos = xsp; + if (jj_3R_355()) { + jj_scanpos = xsp; + if (jj_3R_356()) { + return true; + } + } + } + } + } + return false; + } + + private boolean jj_3R_152() { + if (jj_scan_token(SUPER)) { + return true; + } + if (jj_scan_token(DOT)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_185()) { + jj_scanpos = xsp; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + xsp = jj_scanpos; + if (jj_3R_186()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3R_151() { + if (jj_scan_token(THIS)) { + return true; + } + return false; + } + + private boolean jj_3R_84() { + if (jj_scan_token(LBRACE)) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_131()) { + jj_scanpos = xsp; + break; + } + } + if (jj_scan_token(RBRACE)) { + return true; + } + return false; + } + + private boolean jj_3R_150() { + if (jj_3R_184()) { + return true; + } + return false; + } + + private boolean jj_3R_105() { + if (jj_3R_81()) { + return true; + } + return false; + } + + private boolean jj_3R_341() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_346()) { + jj_scanpos = xsp; + if (jj_3R_347()) { + return true; + } + } + return false; + } + + private boolean jj_3_3() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_61()) { + return true; + } + return false; + } + + private boolean jj_3R_228() { + if (jj_scan_token(BIT_AND)) { + return true; + } + if (jj_3R_85()) { + return true; + } + return false; + } + + private boolean jj_3R_330() { + if (jj_3R_341()) { + return true; + } + return false; + } + + private boolean jj_3R_201() { + if (jj_scan_token(EXTENDS)) { + return true; + } + if (jj_3R_85()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_228()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_104() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_150()) { + jj_scanpos = xsp; + if (jj_3R_151()) { + jj_scanpos = xsp; + if (jj_3R_152()) { + jj_scanpos = xsp; + if (jj_3R_153()) { + jj_scanpos = xsp; + if (jj_3R_154()) { + jj_scanpos = xsp; + if (jj_3R_155()) { + jj_scanpos = xsp; + if (jj_3R_156()) { + return true; + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3_25() { + if (jj_3R_80()) { + return true; + } + return false; + } + + private boolean jj_3R_317() { + if (jj_scan_token(LBRACE)) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_330()) { + jj_scanpos = xsp; + break; + } + } + if (jj_scan_token(RBRACE)) { + return true; + } + return false; + } + + private boolean jj_3R_141() { + if (jj_scan_token(IDENTIFIER)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_173()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3R_340() { + if (jj_3R_84()) { + return true; + } + return false; + } + + private boolean jj_3R_68() { + if (jj_3R_104()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_105()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_245() { + if (jj_scan_token(AT)) { + return true; + } + if (jj_scan_token(INTERFACE)) { + return true; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_3R_317()) { + return true; + } + return false; + } + + private boolean jj_3R_142() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_141()) { + return true; + } + return false; + } + + private boolean jj_3R_96() { + if (jj_scan_token(LT)) { + return true; + } + if (jj_3R_141()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_142()) { + jj_scanpos = xsp; + break; + } + } + if (jj_scan_token(GT)) { + return true; + } + return false; + } + + private boolean jj_3R_265() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_264()) { + return true; + } + return false; + } + + private boolean jj_3R_238() { + if (jj_3R_104()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_25()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_283() { + if (jj_3R_92()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_42()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_227() { + if (jj_3R_249()) { + return true; + } + return false; + } + + private boolean jj_3R_169() { + if (jj_scan_token(LBRACE)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_283()) { + jj_scanpos = xsp; + } + xsp = jj_scanpos; + if (jj_scan_token(87)) { + jj_scanpos = xsp; + } + if (jj_scan_token(RBRACE)) { + return true; + } + return false; + } + + private boolean jj_3R_339() { + if (jj_3R_147()) { + return true; + } + return false; + } + + private boolean jj_3R_329() { + if (jj_3R_165()) { + return true; + } + return false; + } + + private boolean jj_3R_95() { + if (jj_3R_94()) { + return true; + } + return false; + } + + private boolean jj_3R_258() { + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_3R_63()) { + return true; + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_3R_161()) { + return true; + } + return false; + } + + private boolean jj_3R_137() { + if (jj_3R_121()) { + return true; + } + return false; + } + + private boolean jj_3R_61() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_95()) { + jj_scanpos = xsp; + break; + } + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + xsp = jj_scanpos; + if (jj_3R_339()) { + jj_scanpos = xsp; + } + xsp = jj_scanpos; + if (jj_3R_340()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3R_136() { + if (jj_3R_169()) { + return true; + } + return false; + } + + private boolean jj_3R_135() { + if (jj_3R_94()) { + return true; + } + return false; + } + + private boolean jj_3R_316() { + if (jj_scan_token(SEMICOLON)) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_329()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_79() { + if (jj_scan_token(DECR)) { + return true; + } + return false; + } + + private boolean jj_3_24() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_78()) { + jj_scanpos = xsp; + if (jj_3R_79()) { + return true; + } + } + return false; + } + + private boolean jj_3R_78() { + if (jj_scan_token(INCR)) { + return true; + } + return false; + } + + private boolean jj_3R_92() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_135()) { + jj_scanpos = xsp; + if (jj_3R_136()) { + jj_scanpos = xsp; + if (jj_3R_137()) { + return true; + } + } + } + return false; + } + + private boolean jj_3R_259() { + if (jj_3R_238()) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3_24()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3_23() { + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_3R_63()) { + return true; + } + if (jj_scan_token(LBRACKET)) { + return true; + } + return false; + } + + private boolean jj_3R_315() { + if (jj_3R_61()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_3()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_264() { + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_scan_token(ASSIGN)) { + return true; + } + if (jj_3R_92()) { + return true; + } + return false; + } + + private boolean jj_3_22() { + if (jj_3R_77()) { + return true; + } + return false; + } + + private boolean jj_3R_125() { + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_3R_63()) { + return true; + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_3R_161()) { + return true; + } + return false; + } + + private boolean jj_3R_314() { + if (jj_3R_328()) { + return true; + } + return false; + } + + private boolean jj_3R_124() { + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_3R_63()) { + return true; + } + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + return false; + } + + private boolean jj_3R_77() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_124()) { + jj_scanpos = xsp; + if (jj_3R_125()) { + return true; + } + } + return false; + } + + private boolean jj_3R_244() { + if (jj_scan_token(ENUM)) { + return true; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_314()) { + jj_scanpos = xsp; + } + if (jj_scan_token(LBRACE)) { + return true; + } + xsp = jj_scanpos; + if (jj_3R_315()) { + jj_scanpos = xsp; + } + xsp = jj_scanpos; + if (jj_scan_token(87)) { + jj_scanpos = xsp; + } + xsp = jj_scanpos; + if (jj_3R_316()) { + jj_scanpos = xsp; + } + if (jj_scan_token(RBRACE)) { + return true; + } + return false; + } + + private boolean jj_3R_241() { + if (jj_3R_259()) { + return true; + } + return false; + } + + private boolean jj_3R_249() { + if (jj_3R_264()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_265()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_240() { + if (jj_3R_258()) { + return true; + } + return false; + } + + private boolean jj_3R_257() { + if (jj_scan_token(BANG)) { + return true; + } + return false; + } + + private boolean jj_3R_256() { + if (jj_scan_token(TILDE)) { + return true; + } + return false; + } + + private boolean jj_3R_239() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_256()) { + jj_scanpos = xsp; + if (jj_3R_257()) { + return true; + } + } + if (jj_3R_161()) { + return true; + } + return false; + } + + private boolean jj_3R_171() { + if (jj_scan_token(AT)) { + return true; + } + if (jj_3R_90()) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_3R_92()) { + return true; + } + if (jj_scan_token(RPAREN)) { + return true; + } + return false; + } + + private boolean jj_3R_338() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_85()) { + return true; + } + return false; + } + + private boolean jj_3R_219() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_239()) { + jj_scanpos = xsp; + if (jj_3R_240()) { + jj_scanpos = xsp; + if (jj_3R_241()) { + return true; + } + } + } + return false; + } + + private boolean jj_3R_91() { + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_scan_token(ASSIGN)) { + return true; + } + return false; + } + + private boolean jj_3R_328() { + if (jj_scan_token(IMPLEMENTS)) { + return true; + } + if (jj_3R_85()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_338()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_172() { + if (jj_scan_token(AT)) { + return true; + } + if (jj_3R_90()) { + return true; + } + return false; + } + + private boolean jj_3R_218() { + if (jj_scan_token(DECR)) { + return true; + } + if (jj_3R_238()) { + return true; + } + return false; + } + + private boolean jj_3R_337() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_85()) { + return true; + } + return false; + } + + private boolean jj_3_41() { + if (jj_scan_token(AT)) { + return true; + } + if (jj_3R_90()) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + return false; + } + + private boolean jj_3R_327() { + if (jj_scan_token(EXTENDS)) { + return true; + } + if (jj_3R_85()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_337()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3_40() { + if (jj_scan_token(AT)) { + return true; + } + if (jj_3R_90()) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_91()) { + jj_scanpos = xsp; + if (jj_scan_token(81)) { + return true; + } + } + return false; + } + + private boolean jj_3R_170() { + if (jj_scan_token(AT)) { + return true; + } + if (jj_3R_90()) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_227()) { + jj_scanpos = xsp; + } + if (jj_scan_token(RPAREN)) { + return true; + } + return false; + } + + private boolean jj_3R_217() { + if (jj_scan_token(INCR)) { + return true; + } + if (jj_3R_238()) { + return true; + } + return false; + } + + private boolean jj_3R_261() { + if (jj_scan_token(INTERFACE)) { + return true; + } + return false; + } + + private boolean jj_3R_140() { + if (jj_3R_172()) { + return true; + } + return false; + } + + private boolean jj_3R_194() { + if (jj_3R_219()) { + return true; + } + return false; + } + + private boolean jj_3R_139() { + if (jj_3R_171()) { + return true; + } + return false; + } + + private boolean jj_3R_193() { + if (jj_3R_218()) { + return true; + } + return false; + } + + private boolean jj_3R_313() { + if (jj_3R_328()) { + return true; + } + return false; + } + + private boolean jj_3R_138() { + if (jj_3R_170()) { + return true; + } + return false; + } + + private boolean jj_3R_312() { + if (jj_3R_327()) { + return true; + } + return false; + } + + private boolean jj_3R_192() { + if (jj_3R_217()) { + return true; + } + return false; + } + + private boolean jj_3R_311() { + if (jj_3R_96()) { + return true; + } + return false; + } + + private boolean jj_3R_243() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(20)) { + jj_scanpos = xsp; + if (jj_3R_261()) { + return true; + } + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + xsp = jj_scanpos; + if (jj_3R_311()) { + jj_scanpos = xsp; + } + xsp = jj_scanpos; + if (jj_3R_312()) { + jj_scanpos = xsp; + } + xsp = jj_scanpos; + if (jj_3R_313()) { + jj_scanpos = xsp; + } + if (jj_3R_84()) { + return true; + } + return false; + } + + private boolean jj_3R_94() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_138()) { + jj_scanpos = xsp; + if (jj_3R_139()) { + jj_scanpos = xsp; + if (jj_3R_140()) { + return true; + } + } + } + return false; + } + + private boolean jj_3R_122() { + return false; + } + + private boolean jj_3R_216() { + if (jj_scan_token(MINUS)) { + return true; + } + return false; + } + + private boolean jj_3R_215() { + if (jj_scan_token(PLUS)) { + return true; + } + return false; + } + + private boolean jj_3R_191() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_215()) { + jj_scanpos = xsp; + if (jj_3R_216()) { + return true; + } + } + if (jj_3R_161()) { + return true; + } + return false; + } + + private boolean jj_3R_123() { + return false; + } + + private boolean jj_3R_75() { + jj_lookingAhead = true; + jj_semLA = getToken(1).kind == GT && + ((GTToken) getToken(1)).realKind == RSIGNEDSHIFT; + jj_lookingAhead = false; + if (!jj_semLA || jj_3R_122()) { + return true; + } + if (jj_scan_token(GT)) { + return true; + } + if (jj_scan_token(GT)) { + return true; + } + return false; + } + + private boolean jj_3R_161() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_191()) { + jj_scanpos = xsp; + if (jj_3R_192()) { + jj_scanpos = xsp; + if (jj_3R_193()) { + jj_scanpos = xsp; + if (jj_3R_194()) { + return true; + } + } + } + } + return false; + } + + private boolean jj_3R_378() { + if (jj_scan_token(CATCH)) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_3R_342()) { + return true; + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_3R_99()) { + return true; + } + return false; + } + + private boolean jj_3R_379() { + if (jj_scan_token(FINALLY)) { + return true; + } + if (jj_3R_99()) { + return true; + } + return false; + } + + private boolean jj_3R_371() { + if (jj_scan_token(FINALLY)) { + return true; + } + if (jj_3R_99()) { + return true; + } + return false; + } + + private boolean jj_3R_76() { + jj_lookingAhead = true; + jj_semLA = getToken(1).kind == GT && + ((GTToken) getToken(1)).realKind == RUNSIGNEDSHIFT; + jj_lookingAhead = false; + if (!jj_semLA || jj_3R_123()) { + return true; + } + if (jj_scan_token(GT)) { + return true; + } + if (jj_scan_token(GT)) { + return true; + } + if (jj_scan_token(GT)) { + return true; + } + return false; + } + + private boolean jj_3R_359() { + if (jj_scan_token(REM)) { + return true; + } + return false; + } + + private boolean jj_3R_358() { + if (jj_scan_token(SLASH)) { + return true; + } + return false; + } + + private boolean jj_3R_357() { + if (jj_scan_token(STAR)) { + return true; + } + return false; + } + + private boolean jj_3R_349() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_357()) { + jj_scanpos = xsp; + if (jj_3R_358()) { + jj_scanpos = xsp; + if (jj_3R_359()) { + return true; + } + } + } + if (jj_3R_161()) { + return true; + } + return false; + } + + private boolean jj_3R_369() { + if (jj_3R_73()) { + return true; + } + return false; + } + + private boolean jj_3R_370() { + Token xsp; + if (jj_3R_378()) { + return true; + } + while (true) { + xsp = jj_scanpos; + if (jj_3R_378()) { + jj_scanpos = xsp; + break; + } + } + xsp = jj_scanpos; + if (jj_3R_379()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3R_325() { + if (jj_3R_161()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_349()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_368() { + if (jj_scan_token(IDENTIFIER)) { + return true; + } + return false; + } + + private boolean jj_3R_351() { + if (jj_scan_token(MINUS)) { + return true; + } + return false; + } + + private boolean jj_3R_350() { + if (jj_scan_token(PLUS)) { + return true; + } + return false; + } + + private boolean jj_3R_60() { + if (jj_3R_94()) { + return true; + } + return false; + } + + private boolean jj_3R_345() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_350()) { + jj_scanpos = xsp; + if (jj_3R_351()) { + return true; + } + } + if (jj_3R_325()) { + return true; + } + return false; + } + + private boolean jj_3R_59() { + if (jj_scan_token(STRICTFP)) { + return true; + } + return false; + } + + private boolean jj_3R_297() { + if (jj_scan_token(TRY)) { + return true; + } + if (jj_3R_99()) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_370()) { + jj_scanpos = xsp; + if (jj_3R_371()) { + return true; + } + } + return false; + } + + private boolean jj_3R_58() { + if (jj_scan_token(VOLATILE)) { + return true; + } + return false; + } + + private boolean jj_3R_57() { + if (jj_scan_token(TRANSIENT)) { + return true; + } + return false; + } + + private boolean jj_3R_56() { + if (jj_scan_token(NATIVE)) { + return true; + } + return false; + } + + private boolean jj_3R_367() { + if (jj_scan_token(IDENTIFIER)) { + return true; + } + return false; + } + + private boolean jj_3R_307() { + if (jj_3R_325()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_345()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_55() { + if (jj_scan_token(SYNCHRONIZED)) { + return true; + } + return false; + } + + private boolean jj_3R_54() { + if (jj_scan_token(ABSTRACT)) { + return true; + } + return false; + } + + private boolean jj_3R_53() { + if (jj_scan_token(FINAL)) { + return true; + } + return false; + } + + private boolean jj_3_21() { + if (jj_3R_76()) { + return true; + } + return false; + } + + private boolean jj_3_20() { + if (jj_3R_75()) { + return true; + } + return false; + } + + private boolean jj_3R_52() { + if (jj_scan_token(PRIVATE)) { + return true; + } + return false; + } + + private boolean jj_3R_74() { + if (jj_scan_token(LSHIFT)) { + return true; + } + return false; + } + + private boolean jj_3R_51() { + if (jj_scan_token(PROTECTED)) { + return true; + } + return false; + } + + private boolean jj_3_19() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_74()) { + jj_scanpos = xsp; + if (jj_3_20()) { + jj_scanpos = xsp; + if (jj_3_21()) { + return true; + } + } + } + if (jj_3R_307()) { + return true; + } + return false; + } + + private boolean jj_3R_50() { + if (jj_scan_token(STATIC)) { + return true; + } + return false; + } + + private boolean jj_3R_49() { + if (jj_scan_token(PUBLIC)) { + return true; + } + return false; + } + + private boolean jj_3R_308() { + if (jj_scan_token(INSTANCEOF)) { + return true; + } + if (jj_3R_63()) { + return true; + } + return false; + } + + private boolean jj_3R_296() { + if (jj_scan_token(SYNCHRONIZED)) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_3R_73()) { + return true; + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_3R_99()) { + return true; + } + return false; + } + + private boolean jj_3_2() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_49()) { + jj_scanpos = xsp; + if (jj_3R_50()) { + jj_scanpos = xsp; + if (jj_3R_51()) { + jj_scanpos = xsp; + if (jj_3R_52()) { + jj_scanpos = xsp; + if (jj_3R_53()) { + jj_scanpos = xsp; + if (jj_3R_54()) { + jj_scanpos = xsp; + if (jj_3R_55()) { + jj_scanpos = xsp; + if (jj_3R_56()) { + jj_scanpos = xsp; + if (jj_3R_57()) { + jj_scanpos = xsp; + if (jj_3R_58()) { + jj_scanpos = xsp; + if (jj_3R_59()) { + jj_scanpos = xsp; + if (jj_3R_60()) { + return true; + } + } + } + } + } + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_305() { + if (jj_3R_307()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_19()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_88() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_2()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_336() { + if (jj_scan_token(GE)) { + return true; + } + return false; + } + + private boolean jj_3R_335() { + if (jj_scan_token(LE)) { + return true; + } + return false; + } + + private boolean jj_3R_334() { + if (jj_scan_token(GT)) { + return true; + } + return false; + } + + private boolean jj_3R_333() { + if (jj_scan_token(LT)) { + return true; + } + return false; + } + + private boolean jj_3R_326() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_333()) { + jj_scanpos = xsp; + if (jj_3R_334()) { + jj_scanpos = xsp; + if (jj_3R_335()) { + jj_scanpos = xsp; + if (jj_3R_336()) { + return true; + } + } + } + } + if (jj_3R_305()) { + return true; + } + return false; + } + + private boolean jj_3R_295() { + if (jj_scan_token(THROW)) { + return true; + } + if (jj_3R_73()) { + return true; + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_303() { + if (jj_3R_305()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_326()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_294() { + if (jj_scan_token(RETURN)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_369()) { + jj_scanpos = xsp; + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_390() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_73()) { + return true; + } + return false; + } + + private boolean jj_3R_304() { + if (jj_scan_token(BIT_AND)) { + return true; + } + if (jj_3R_281()) { + return true; + } + return false; + } + + private boolean jj_3R_298() { + if (jj_3R_303()) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_308()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3R_364() { + if (jj_scan_token(ELSE)) { + return true; + } + if (jj_3R_250()) { + return true; + } + return false; + } + + private boolean jj_3R_293() { + if (jj_scan_token(CONTINUE)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_368()) { + jj_scanpos = xsp; + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_93() { + if (jj_3R_94()) { + return true; + } + return false; + } + + private boolean jj_3R_48() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_93()) { + jj_scanpos = xsp; + break; + } + } + if (jj_scan_token(PACKAGE)) { + return true; + } + if (jj_3R_90()) { + return true; + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_310() { + if (jj_scan_token(NE)) { + return true; + } + return false; + } + + private boolean jj_3_1() { + if (jj_3R_48()) { + return true; + } + return false; + } + + private boolean jj_3R_309() { + if (jj_scan_token(EQ)) { + return true; + } + return false; + } + + private boolean jj_3R_306() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_309()) { + jj_scanpos = xsp; + if (jj_3R_310()) { + return true; + } + } + if (jj_3R_298()) { + return true; + } + return false; + } + + private boolean jj_3R_377() { + if (jj_3R_386()) { + return true; + } + return false; + } + + private boolean jj_3R_299() { + if (jj_scan_token(XOR)) { + return true; + } + if (jj_3R_255()) { + return true; + } + return false; + } + + private boolean jj_3R_292() { + if (jj_scan_token(BREAK)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_367()) { + jj_scanpos = xsp; + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_282() { + if (jj_scan_token(BIT_OR)) { + return true; + } + if (jj_3R_237()) { + return true; + } + return false; + } + + private boolean jj_3R_281() { + if (jj_3R_298()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_306()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_260() { + if (jj_scan_token(SC_AND)) { + return true; + } + if (jj_3R_214()) { + return true; + } + return false; + } + + private boolean jj_3R_386() { + if (jj_3R_389()) { + return true; + } + return false; + } + + private boolean jj_3R_255() { + if (jj_3R_281()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_304()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_242() { + if (jj_scan_token(SC_OR)) { + return true; + } + if (jj_3R_190()) { + return true; + } + return false; + } + + private boolean jj_3_39() { + if (jj_3R_88()) { + return true; + } + if (jj_3R_63()) { + return true; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + return false; + } + + private boolean jj_3R_389() { + if (jj_3R_73()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_390()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_237() { + if (jj_3R_255()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_299()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_388() { + if (jj_3R_389()) { + return true; + } + return false; + } + + private boolean jj_3R_376() { + if (jj_3R_73()) { + return true; + } + return false; + } + + private boolean jj_3R_387() { + if (jj_3R_89()) { + return true; + } + return false; + } + + private boolean jj_3R_214() { + if (jj_3R_237()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_282()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_385() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_387()) { + jj_scanpos = xsp; + if (jj_3R_388()) { + return true; + } + } + return false; + } + + private boolean jj_3R_190() { + if (jj_3R_214()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_260()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3_38() { + if (jj_3R_89()) { + return true; + } + if (jj_scan_token(COLON)) { + return true; + } + return false; + } + + private boolean jj_3R_375() { + if (jj_3R_385()) { + return true; + } + return false; + } + + private boolean jj_3R_160() { + if (jj_3R_190()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_242()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_366() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_375()) { + jj_scanpos = xsp; + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + xsp = jj_scanpos; + if (jj_3R_376()) { + jj_scanpos = xsp; + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + xsp = jj_scanpos; + if (jj_3R_377()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3R_365() { + if (jj_3R_89()) { + return true; + } + if (jj_scan_token(COLON)) { + return true; + } + if (jj_3R_73()) { + return true; + } + return false; + } + + private boolean jj_3R_220() { + if (jj_scan_token(HOOK)) { + return true; + } + if (jj_3R_73()) { + return true; + } + if (jj_scan_token(COLON)) { + return true; + } + if (jj_3R_121()) { + return true; + } + return false; + } + + private boolean jj_3R_291() { + if (jj_scan_token(FOR)) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_365()) { + jj_scanpos = xsp; + if (jj_3R_366()) { + return true; + } + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_3R_250()) { + return true; + } + return false; + } + + private boolean jj_3R_121() { + if (jj_3R_160()) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_220()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3R_120() { + if (jj_scan_token(ORASSIGN)) { + return true; + } + return false; + } + + private boolean jj_3R_119() { + if (jj_scan_token(XORASSIGN)) { + return true; + } + return false; + } + + private boolean jj_3R_118() { + if (jj_scan_token(ANDASSIGN)) { + return true; + } + return false; + } + + private boolean jj_3R_117() { + if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) { + return true; + } + return false; + } + + private boolean jj_3R_116() { + if (jj_scan_token(RSIGNEDSHIFTASSIGN)) { + return true; + } + return false; + } + + private boolean jj_3R_115() { + if (jj_scan_token(LSHIFTASSIGN)) { + return true; + } + return false; + } + + private boolean jj_3R_114() { + if (jj_scan_token(MINUSASSIGN)) { + return true; + } + return false; + } + + private boolean jj_3R_113() { + if (jj_scan_token(PLUSASSIGN)) { + return true; + } + return false; + } + + private boolean jj_3R_290() { + if (jj_scan_token(DO)) { + return true; + } + if (jj_3R_250()) { + return true; + } + if (jj_scan_token(WHILE)) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_3R_73()) { + return true; + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_112() { + if (jj_scan_token(REMASSIGN)) { + return true; + } + return false; + } + + private boolean jj_3R_111() { + if (jj_scan_token(SLASHASSIGN)) { + return true; + } + return false; + } + + private boolean jj_3R_110() { + if (jj_scan_token(STARASSIGN)) { + return true; + } + return false; + } + + private boolean jj_3R_109() { + if (jj_scan_token(ASSIGN)) { + return true; + } + return false; + } + + private boolean jj_3R_72() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_109()) { + jj_scanpos = xsp; + if (jj_3R_110()) { + jj_scanpos = xsp; + if (jj_3R_111()) { + jj_scanpos = xsp; + if (jj_3R_112()) { + jj_scanpos = xsp; + if (jj_3R_113()) { + jj_scanpos = xsp; + if (jj_3R_114()) { + jj_scanpos = xsp; + if (jj_3R_115()) { + jj_scanpos = xsp; + if (jj_3R_116()) { + jj_scanpos = xsp; + if (jj_3R_117()) { + jj_scanpos = xsp; + if (jj_3R_118()) { + jj_scanpos = xsp; + if (jj_3R_119()) { + jj_scanpos = xsp; + if (jj_3R_120()) { + return true; + } + } + } + } + } + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_344() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_90()) { + return true; + } + return false; + } + + private boolean jj_3R_289() { + if (jj_scan_token(WHILE)) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_3R_73()) { + return true; + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_3R_250()) { + return true; + } + return false; + } + + private boolean jj_3_18() { + if (jj_3R_72()) { + return true; + } + if (jj_3R_73()) { + return true; + } + return false; + } + + private boolean jj_3R_73() { + if (jj_3R_121()) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3_18()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3R_288() { + if (jj_scan_token(IF)) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_3R_73()) { + return true; + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_3R_250()) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_364()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3R_134() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_133()) { + return true; + } + return false; + } + + private boolean jj_3R_384() { + if (jj_scan_token(_DEFAULT)) { + return true; + } + return false; + } + + private boolean jj_3R_383() { + if (jj_scan_token(CASE)) { + return true; + } + if (jj_3R_73()) { + return true; + } + return false; + } + + private boolean jj_3R_374() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_383()) { + jj_scanpos = xsp; + if (jj_3R_384()) { + return true; + } + } + if (jj_scan_token(COLON)) { + return true; + } + if (jj_3R_144()) { + return true; + } + return false; + } + + private boolean jj_3R_332() { + if (jj_3R_90()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_344()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3_17() { + if (jj_scan_token(DOT)) { + return true; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + return false; + } + + private boolean jj_3R_363() { + if (jj_3R_374()) { + return true; + } + return false; + } + + private boolean jj_3R_90() { + if (jj_scan_token(IDENTIFIER)) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_17()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_287() { + if (jj_scan_token(SWITCH)) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + if (jj_3R_73()) { + return true; + } + if (jj_scan_token(RPAREN)) { + return true; + } + if (jj_scan_token(LBRACE)) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_363()) { + jj_scanpos = xsp; + break; + } + } + if (jj_scan_token(RBRACE)) { + return true; + } + return false; + } + + private boolean jj_3R_130() { + if (jj_3R_63()) { + return true; + } + return false; + } + + private boolean jj_3R_129() { + if (jj_scan_token(VOID)) { + return true; + } + return false; + } + + private boolean jj_3R_382() { + if (jj_3R_72()) { + return true; + } + if (jj_3R_73()) { + return true; + } + return false; + } + + private boolean jj_3R_381() { + if (jj_scan_token(DECR)) { + return true; + } + return false; + } + + private boolean jj_3R_380() { + if (jj_scan_token(INCR)) { + return true; + } + return false; + } + + private boolean jj_3R_373() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_380()) { + jj_scanpos = xsp; + if (jj_3R_381()) { + jj_scanpos = xsp; + if (jj_3R_382()) { + return true; + } + } + } + return false; + } + + private boolean jj_3R_82() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_129()) { + jj_scanpos = xsp; + if (jj_3R_130()) { + return true; + } + } + return false; + } + + private boolean jj_3R_302() { + if (jj_3R_238()) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_373()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3R_301() { + if (jj_3R_218()) { + return true; + } + return false; + } + + private boolean jj_3R_300() { + if (jj_3R_217()) { + return true; + } + return false; + } + + private boolean jj_3R_181() { + if (jj_scan_token(DOUBLE)) { + return true; + } + return false; + } + + private boolean jj_3R_180() { + if (jj_scan_token(FLOAT)) { + return true; + } + return false; + } + + private boolean jj_3R_179() { + if (jj_scan_token(LONG)) { + return true; + } + return false; + } + + private boolean jj_3R_286() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_300()) { + jj_scanpos = xsp; + if (jj_3R_301()) { + jj_scanpos = xsp; + if (jj_3R_302()) { + return true; + } + } + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_178() { + if (jj_scan_token(INT)) { + return true; + } + return false; + } + + private boolean jj_3R_177() { + if (jj_scan_token(SHORT)) { + return true; + } + return false; + } + + private boolean jj_3R_176() { + if (jj_scan_token(BYTE)) { + return true; + } + return false; + } + + private boolean jj_3R_157() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_108()) { + return true; + } + return false; + } + + private boolean jj_3R_254() { + if (jj_scan_token(SUPER)) { + return true; + } + if (jj_3R_70()) { + return true; + } + return false; + } + + private boolean jj_3R_175() { + if (jj_scan_token(CHAR)) { + return true; + } + return false; + } + + private boolean jj_3R_362() { + if (jj_scan_token(COLON)) { + return true; + } + if (jj_3R_73()) { + return true; + } + return false; + } + + private boolean jj_3R_236() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_253()) { + jj_scanpos = xsp; + if (jj_3R_254()) { + return true; + } + } + return false; + } + + private boolean jj_3R_253() { + if (jj_scan_token(EXTENDS)) { + return true; + } + if (jj_3R_70()) { + return true; + } + return false; + } + + private boolean jj_3R_174() { + if (jj_scan_token(BOOLEAN)) { + return true; + } + return false; + } + + private boolean jj_3R_143() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_174()) { + jj_scanpos = xsp; + if (jj_3R_175()) { + jj_scanpos = xsp; + if (jj_3R_176()) { + jj_scanpos = xsp; + if (jj_3R_177()) { + jj_scanpos = xsp; + if (jj_3R_178()) { + jj_scanpos = xsp; + if (jj_3R_179()) { + jj_scanpos = xsp; + if (jj_3R_180()) { + jj_scanpos = xsp; + if (jj_3R_181()) { + return true; + } + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_285() { + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_189() { + if (jj_scan_token(HOOK)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_236()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3_37() { + if (jj_3R_89()) { + return true; + } + return false; + } + + private boolean jj_3R_89() { + if (jj_3R_88()) { + return true; + } + if (jj_3R_63()) { + return true; + } + if (jj_3R_133()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_134()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3_36() { + if (jj_3R_88()) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(20)) { + jj_scanpos = xsp; + if (jj_scan_token(40)) { + return true; + } + } + return false; + } + + private boolean jj_3R_231() { + if (jj_3R_250()) { + return true; + } + return false; + } + + private boolean jj_3R_159() { + if (jj_3R_189()) { + return true; + } + return false; + } + + private boolean jj_3R_230() { + if (jj_3R_89()) { + return true; + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_158() { + if (jj_3R_70()) { + return true; + } + return false; + } + + private boolean jj_3R_319() { + if (jj_scan_token(THROWS)) { + return true; + } + if (jj_3R_332()) { + return true; + } + return false; + } + + private boolean jj_3R_108() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_158()) { + jj_scanpos = xsp; + if (jj_3R_159()) { + return true; + } + } + return false; + } + + private boolean jj_3R_229() { + if (jj_3R_88()) { + return true; + } + if (jj_3R_243()) { + return true; + } + return false; + } + + private boolean jj_3_13() { + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + return false; + } + + private boolean jj_3R_71() { + if (jj_scan_token(LT)) { + return true; + } + if (jj_3R_108()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_157()) { + jj_scanpos = xsp; + break; + } + } + if (jj_scan_token(GT)) { + return true; + } + return false; + } + + private boolean jj_3R_202() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_229()) { + jj_scanpos = xsp; + if (jj_3R_230()) { + jj_scanpos = xsp; + if (jj_3R_231()) { + return true; + } + } + } + return false; + } + + private boolean jj_3_16() { + if (jj_3R_71()) { + return true; + } + return false; + } + + private boolean jj_3_15() { + if (jj_scan_token(DOT)) { + return true; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3_16()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3_12() { + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + return false; + } + + private boolean jj_3_14() { + if (jj_3R_71()) { + return true; + } + return false; + } + + private boolean jj_3_33() { + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + return false; + } + + private boolean jj_3R_85() { + if (jj_scan_token(IDENTIFIER)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3_14()) { + jj_scanpos = xsp; + } + while (true) { + xsp = jj_scanpos; + if (jj_3_15()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_99() { + if (jj_scan_token(LBRACE)) { + return true; + } + if (jj_3R_144()) { + return true; + } + if (jj_scan_token(RBRACE)) { + return true; + } + return false; + } + + private boolean jj_3R_87() { + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_scan_token(COLON)) { + return true; + } + if (jj_3R_250()) { + return true; + } + return false; + } + + private boolean jj_3R_107() { + if (jj_3R_85()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_13()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_106() { + if (jj_3R_143()) { + return true; + } + Token xsp; + if (jj_3_12()) { + return true; + } + while (true) { + xsp = jj_scanpos; + if (jj_3_12()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_70() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_106()) { + jj_scanpos = xsp; + if (jj_3R_107()) { + return true; + } + } + return false; + } + + private boolean jj_3R_284() { + if (jj_scan_token(ASSERT)) { + return true; + } + if (jj_3R_73()) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_362()) { + jj_scanpos = xsp; + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_97() { + if (jj_3R_143()) { + return true; + } + return false; + } + + private boolean jj_3R_280() { + if (jj_3R_297()) { + return true; + } + return false; + } + + private boolean jj_3_11() { + if (jj_3R_70()) { + return true; + } + return false; + } + + private boolean jj_3R_279() { + if (jj_3R_296()) { + return true; + } + return false; + } + + private boolean jj_3R_63() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_11()) { + jj_scanpos = xsp; + if (jj_3R_97()) { + return true; + } + } + return false; + } + + private boolean jj_3R_278() { + if (jj_3R_295()) { + return true; + } + return false; + } + + private boolean jj_3R_277() { + if (jj_3R_294()) { + return true; + } + return false; + } + + private boolean jj_3R_276() { + if (jj_3R_293()) { + return true; + } + return false; + } + + private boolean jj_3R_275() { + if (jj_3R_292()) { + return true; + } + return false; + } + + private boolean jj_3R_274() { + if (jj_3R_291()) { + return true; + } + return false; + } + + private boolean jj_3R_273() { + if (jj_3R_290()) { + return true; + } + return false; + } + + private boolean jj_3R_98() { + if (jj_scan_token(STATIC)) { + return true; + } + return false; + } + + private boolean jj_3R_272() { + if (jj_3R_289()) { + return true; + } + return false; + } + + private boolean jj_3R_65() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_98()) { + jj_scanpos = xsp; + } + if (jj_3R_99()) { + return true; + } + return false; + } + + private boolean jj_3R_271() { + if (jj_3R_288()) { + return true; + } + return false; + } + + private boolean jj_3R_270() { + if (jj_3R_287()) { + return true; + } + return false; + } + + private boolean jj_3R_182() { + if (jj_3R_202()) { + return true; + } + return false; + } + + private boolean jj_3R_269() { + if (jj_3R_286()) { + return true; + } + return false; + } + + private boolean jj_3R_144() { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_182()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_268() { + if (jj_3R_285()) { + return true; + } + return false; + } + + private boolean jj_3_9() { + if (jj_3R_68()) { + return true; + } + if (jj_scan_token(DOT)) { + return true; + } + return false; + } + + private boolean jj_3R_267() { + if (jj_3R_99()) { + return true; + } + return false; + } + + private boolean jj_3R_266() { + if (jj_3R_284()) { + return true; + } + return false; + } + + private boolean jj_3_35() { + if (jj_3R_87()) { + return true; + } + return false; + } + + private boolean jj_3R_69() { + if (jj_3R_71()) { + return true; + } + return false; + } + + private boolean jj_3R_149() { + if (jj_3R_71()) { + return true; + } + return false; + } + + private boolean jj_3_7() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_66()) { + return true; + } + return false; + } + + private boolean jj_3_10() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_69()) { + jj_scanpos = xsp; + } + if (jj_scan_token(THIS)) { + return true; + } + if (jj_scan_token(LPAREN)) { + return true; + } + return false; + } + + private boolean jj_3R_148() { + if (jj_3R_68()) { + return true; + } + if (jj_scan_token(DOT)) { + return true; + } + return false; + } + + private boolean jj_3R_103() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_148()) { + jj_scanpos = xsp; + } + xsp = jj_scanpos; + if (jj_3R_149()) { + jj_scanpos = xsp; + } + if (jj_scan_token(SUPER)) { + return true; + } + if (jj_3R_147()) { + return true; + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_250() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_35()) { + jj_scanpos = xsp; + if (jj_3R_266()) { + jj_scanpos = xsp; + if (jj_3R_267()) { + jj_scanpos = xsp; + if (jj_3R_268()) { + jj_scanpos = xsp; + if (jj_3R_269()) { + jj_scanpos = xsp; + if (jj_3R_270()) { + jj_scanpos = xsp; + if (jj_3R_271()) { + jj_scanpos = xsp; + if (jj_3R_272()) { + jj_scanpos = xsp; + if (jj_3R_273()) { + jj_scanpos = xsp; + if (jj_3R_274()) { + jj_scanpos = xsp; + if (jj_3R_275()) { + jj_scanpos = xsp; + if (jj_3R_276()) { + jj_scanpos = xsp; + if (jj_3R_277()) { + jj_scanpos = xsp; + if (jj_3R_278()) { + jj_scanpos = xsp; + if (jj_3R_279()) { + jj_scanpos = xsp; + if (jj_3R_280()) { + return true; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_146() { + if (jj_3R_71()) { + return true; + } + return false; + } + + private boolean jj_3R_102() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_146()) { + jj_scanpos = xsp; + } + if (jj_scan_token(THIS)) { + return true; + } + if (jj_3R_147()) { + return true; + } + if (jj_scan_token(SEMICOLON)) { + return true; + } + return false; + } + + private boolean jj_3R_166() { + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + return false; + } + + private boolean jj_3R_132() { + Token xsp; + if (jj_3R_166()) { + return true; + } + while (true) { + xsp = jj_scanpos; + if (jj_3R_166()) { + jj_scanpos = xsp; + break; + } + } + if (jj_3R_145()) { + return true; + } + return false; + } + + private boolean jj_3_32() { + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_3R_73()) { + return true; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + return false; + } + + private boolean jj_3_34() { + Token xsp; + if (jj_3_32()) { + return true; + } + while (true) { + xsp = jj_scanpos; + if (jj_3_32()) { + jj_scanpos = xsp; + break; + } + } + while (true) { + xsp = jj_scanpos; + if (jj_3_33()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3_30() { + if (jj_3R_84()) { + return true; + } + return false; + } + + private boolean jj_3R_67() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_102()) { + jj_scanpos = xsp; + if (jj_3R_103()) { + return true; + } + } + return false; + } + + private boolean jj_3R_86() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_34()) { + jj_scanpos = xsp; + if (jj_3R_132()) { + return true; + } + } + return false; + } + + private boolean jj_3R_322() { + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + return false; + } + + private boolean jj_3R_343() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_342()) { + return true; + } + return false; + } + + private boolean jj_3_8() { + if (jj_3R_67()) { + return true; + } + return false; + } + + private boolean jj_3R_348() { + if (jj_scan_token(ELLIPSIS)) { + return true; + } + return false; + } + + private boolean jj_3R_235() { + if (jj_3R_71()) { + return true; + } + return false; + } + + private boolean jj_3R_320() { + if (jj_3R_67()) { + return true; + } + return false; + } + + private boolean jj_3R_213() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_235()) { + jj_scanpos = xsp; + } + if (jj_3R_85()) { + return true; + } + if (jj_3R_147()) { + return true; + } + xsp = jj_scanpos; + if (jj_3_30()) { + jj_scanpos = xsp; + } + return false; + } + + private boolean jj_3_31() { + if (jj_3R_85()) { + return true; + } + if (jj_3R_86()) { + return true; + } + return false; + } + + private boolean jj_3R_262() { + if (jj_3R_96()) { + return true; + } + return false; + } + + private boolean jj_3R_232() { + if (jj_scan_token(COMMA)) { + return true; + } + if (jj_3R_73()) { + return true; + } + return false; + } + + private boolean jj_3R_246() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_262()) { + jj_scanpos = xsp; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_3R_318()) { + return true; + } + xsp = jj_scanpos; + if (jj_3R_319()) { + jj_scanpos = xsp; + } + if (jj_scan_token(LBRACE)) { + return true; + } + xsp = jj_scanpos; + if (jj_3R_320()) { + jj_scanpos = xsp; + } + if (jj_3R_144()) { + return true; + } + if (jj_scan_token(RBRACE)) { + return true; + } + return false; + } + + private boolean jj_3R_212() { + if (jj_3R_85()) { + return true; + } + if (jj_3R_86()) { + return true; + } + return false; + } + + private boolean jj_3R_200() { + if (jj_scan_token(LBRACKET)) { + return true; + } + if (jj_scan_token(RBRACKET)) { + return true; + } + return false; + } + + private boolean jj_3R_211() { + if (jj_3R_143()) { + return true; + } + if (jj_3R_86()) { + return true; + } + return false; + } + + private boolean jj_3R_199() { + if (jj_3R_66()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_7()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_187() { + if (jj_scan_token(NEW)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_211()) { + jj_scanpos = xsp; + if (jj_3R_212()) { + jj_scanpos = xsp; + if (jj_3R_213()) { + return true; + } + } + } + return false; + } + + private boolean jj_3R_342() { + if (jj_3R_88()) { + return true; + } + if (jj_3R_63()) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_348()) { + jj_scanpos = xsp; + } + if (jj_3R_167()) { + return true; + } + return false; + } + + private boolean jj_3R_331() { + if (jj_3R_342()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_343()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_318() { + if (jj_scan_token(LPAREN)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_331()) { + jj_scanpos = xsp; + } + if (jj_scan_token(RPAREN)) { + return true; + } + return false; + } + + private boolean jj_3R_203() { + if (jj_3R_73()) { + return true; + } + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_232()) { + jj_scanpos = xsp; + break; + } + } + return false; + } + + private boolean jj_3R_183() { + if (jj_3R_203()) { + return true; + } + return false; + } + + private boolean jj_3R_324() { + if (jj_3R_99()) { + return true; + } + return false; + } + + private boolean jj_3R_323() { + if (jj_scan_token(THROWS)) { + return true; + } + if (jj_3R_332()) { + return true; + } + return false; + } + + private boolean jj_3R_147() { + if (jj_scan_token(LPAREN)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_183()) { + jj_scanpos = xsp; + } + if (jj_scan_token(RPAREN)) { + return true; + } + return false; + } + + private boolean jj_3R_263() { + if (jj_3R_96()) { + return true; + } + return false; + } + + private boolean jj_3R_248() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_263()) { + jj_scanpos = xsp; + } + if (jj_3R_82()) { + return true; + } + if (jj_scan_token(IDENTIFIER)) { + return true; + } + if (jj_3R_318()) { + return true; + } + while (true) { + xsp = jj_scanpos; + if (jj_3R_322()) { + jj_scanpos = xsp; + break; + } + } + xsp = jj_scanpos; + if (jj_3R_323()) { + jj_scanpos = xsp; + } + xsp = jj_scanpos; + if (jj_3R_324()) { + jj_scanpos = xsp; + if (jj_scan_token(86)) { + return true; + } + } + return false; + } + + private boolean jj_3R_234() { + if (jj_scan_token(NULL)) { + return true; + } + return false; + } + + private boolean jj_3R_252() { + if (jj_scan_token(FALSE)) { + return true; + } + return false; + } + + private boolean jj_3R_251() { + if (jj_scan_token(TRUE)) { + return true; + } + return false; + } + + private boolean jj_3R_233() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_251()) { + jj_scanpos = xsp; + if (jj_3R_252()) { + return true; + } + } + return false; + } + + private boolean jj_3R_210() { + if (jj_3R_234()) { + return true; + } + return false; + } + + private boolean jj_3R_145() { + if (jj_scan_token(LBRACE)) { + return true; + } + Token xsp; + xsp = jj_scanpos; + if (jj_3R_199()) { + jj_scanpos = xsp; + } + xsp = jj_scanpos; + if (jj_scan_token(87)) { + jj_scanpos = xsp; + } + if (jj_scan_token(RBRACE)) { + return true; + } + return false; + } + + private boolean jj_3R_209() { + if (jj_3R_233()) { + return true; + } + return false; + } + + private boolean jj_3R_101() { + if (jj_3R_73()) { + return true; + } + return false; + } + + private boolean jj_3R_208() { + if (jj_scan_token(STRING_LITERAL)) { + return true; + } + return false; + } + + /** Generated Token Manager. */ + public ASTParserTokenManager token_source; + + JavaCharStream jj_input_stream; + + /** Current token. */ + public Token token; + + /** Next token. */ + public Token jj_nt; + + private int jj_ntk; + + private Token jj_scanpos, jj_lastpos; + + private int jj_la; + + /** Whether we are looking ahead. */ + private boolean jj_lookingAhead = false; + + private boolean jj_semLA; + + private int jj_gen; + + final private int[] jj_la1 = new int[134]; + + static private int[] jj_la1_0; + + static private int[] jj_la1_1; + + static private int[] jj_la1_2; + + static private int[] jj_la1_3; + + static private int[] jj_la1_4; + static { + jj_la1_init_0(); + jj_la1_init_1(); + jj_la1_init_2(); + jj_la1_init_3(); + jj_la1_init_4(); + } + + private static void jj_la1_init_0() { + jj_la1_0 = new int[] { 0x0, 0x48101000, 0x1, 0x0, 0x0, 0x0, 0x40001000, 0x8100000, 0x48101000, 0x100000, 0x0, 0x10000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4a195000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000, 0x0, 0x4a195000, 0x8100000, 0x2094000, 0x4a195000, + 0x0, 0x0, 0x0, 0x22094000, 0x22094000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x42095000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x22094000, 0x6359f000, 0x0, 0x2094000, 0x2094000, 0x0, 0x2094000, 0x10000000, 0x10000000, 0x2094000, 0x2094000, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x22094000, 0x0, 0x0, 0x22094000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20000000, 0x20000000, 0x22094000, 0x0, 0x0, 0x2094000, 0x0, 0x0, 0x0, + 0x2349e000, 0x0, 0x2349e000, 0x0, 0x0, 0x0, 0x22094000, 0x820000, 0x820000, 0x4000000, 0x62095000, 0x22094000, 0x22094000, 0x62095000, 0x22094000, 0x0, 0x0, 0x0, 0x22094000, 0x40000, 0x80000000, 0x80040000, 0x0, 0x0, 0x0, 0x22094000, + 0x22094000, 0x0, 0x4a195000, 0xa194000, 0x4a195000, 0x800000, }; + } + + private static void jj_la1_init_1() { + jj_la1_1 = new int[] { 0x20, 0x8899c500, 0x0, 0x0, 0x80000, 0x0, 0x8899c400, 0x100, 0x8899c500, 0x100, 0x0, 0x0, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0xc89dc781, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc89dc781, 0x100, 0x40040281, 0xc89dc781, 0x0, 0x0, 0x0, + 0x51241a81, 0x51241a81, 0x0, 0x0, 0x0, 0x4000000, 0x0, 0x0, 0x889dc681, 0x0, 0x0, 0x4000000, 0x0, 0x0, 0x51241a81, 0xfbffdf8b, 0x80000, 0x40281, 0x40281, 0x0, 0x40281, 0x200000, 0x200000, 0x40281, 0x40040281, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x51241a81, 0x0, 0x0, 0x51241a81, 0x0, 0x0, 0x0, 0x0, 0x0, 0x11201800, 0x0, 0x0, 0x0, 0x0, 0x1000800, 0x0, 0x10001000, 0x10000000, 0x51241a81, 0x0, 0x0, 0x40281, 0x0, 0x0, 0x0, + 0x73e61a8b, 0x0, 0x73e61a8b, 0x0, 0x0, 0x0, 0x51241a81, 0x0, 0x0, 0x0, 0xd9bdde81, 0x51241a81, 0x51241a81, 0xd9bdde81, 0x51241a81, 0x0, 0x0, 0x0, 0x51241a81, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x51241a81, 0x51241a81, 0x0, 0x889dc781, 0x40381, + 0x889dc781, 0x0, }; + } + + private static void jj_la1_init_2() { + jj_la1_2 = new int[] { 0x0, 0x2400000, 0x0, 0x2000000, 0x0, 0x1000000, 0x2000000, 0x2000000, 0x2400000, 0x0, 0x8000000, 0x0, 0x0, 0x800000, 0x800000, 0x0, 0x2002000, 0x800000, 0xa442000, 0x400000, 0x2000000, 0x10000, 0x40000, 0x800000, 0x0, 0x0, + 0xa442000, 0x2000000, 0x8002000, 0xa402000, 0x800000, 0x4000000, 0x100000, 0x30053846, 0x30053846, 0x800000, 0x8000000, 0x100000, 0x0, 0x440000, 0x800000, 0x2002000, 0x0, 0x8000000, 0x0, 0x8000000, 0x8000000, 0x8013846, 0x2453847, 0x0, 0x0, + 0x2000, 0x800000, 0x40002000, 0x0, 0x0, 0x0, 0x2000, 0x800000, 0x4000000, 0x40000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8000000, 0x8000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x30013846, 0x30000000, 0x30000000, 0x13846, 0x10000, 0x0, + 0x8000000, 0x10000, 0x10000, 0x11846, 0x2000, 0x1000000, 0x8000000, 0x10000, 0x0, 0x1100000, 0x1846, 0x0, 0x30013846, 0x800000, 0x8000000, 0x0, 0x8002000, 0x100000, 0x100000, 0x453847, 0x80000000, 0x453847, 0x800000, 0x4000000, 0x4000000, + 0x13846, 0x0, 0x0, 0x0, 0x32013846, 0x30013846, 0x30013846, 0x32413846, 0x30013846, 0x800000, 0x2000, 0x2000, 0x30013846, 0x0, 0x0, 0x0, 0x2000000, 0x2000, 0x800000, 0x32053846, 0x32053846, 0x800000, 0x2402000, 0x2002000, 0x2402000, 0x0, }; + } + + private static void jj_la1_init_3() { + jj_la1_3 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3c0, 0x3c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10000000, + 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffe0000, 0x0, 0x10, 0x20, 0x2000, 0x4000, 0x1000, 0x9, 0x9, 0x0, 0x80000006, 0x80000006, 0x10000, 0x300, 0x300, 0x8c00, 0x8c00, 0x300, 0x3c0, 0x0, 0x0, 0x0, + 0x0, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0, 0x0, 0xc0, 0x0, 0xffe00c0, 0xffe00c0, 0xc0, 0x0, 0x0, 0x0, 0x3c0, 0x3c0, 0x3c0, 0x3c0, 0x3c0, 0x0, 0x0, 0x0, 0x3c0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x3c0, 0x3c0, 0x0, 0x0, 0x0, 0x0, 0x0, }; + } + + private static void jj_la1_init_4() { + jj_la1_4 = new int[] { 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }; + } + + final private JJCalls[] jj_2_rtns = new JJCalls[43]; + + private boolean jj_rescan = false; + + private int jj_gc = 0; + + /** Constructor with InputStream. */ + public ASTParser(java.io.InputStream stream) { + this(stream, null); + } + + /** Constructor with InputStream and supplied encoding */ + public ASTParser(java.io.InputStream stream, String encoding) { + try { + jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); + } catch (java.io.UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + token_source = new ASTParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 134; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJCalls(); + } + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream stream) { + ReInit(stream, null); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream stream, String encoding) { + try { + jj_input_stream.ReInit(stream, encoding, 1, 1); + } catch (java.io.UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 134; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJCalls(); + } + } + + /** Constructor. */ + public ASTParser(java.io.Reader stream) { + jj_input_stream = new JavaCharStream(stream, 1, 1); + token_source = new ASTParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 134; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJCalls(); + } + } + + /** Reinitialise. */ + public void ReInit(java.io.Reader stream) { + jj_input_stream.ReInit(stream, 1, 1); + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 134; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJCalls(); + } + } + + /** Constructor with generated Token Manager. */ + public ASTParser(ASTParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 134; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJCalls(); + } + } + + /** Reinitialise. */ + public void ReInit(ASTParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 134; i++) { + jj_la1[i] = -1; + } + for (int i = 0; i < jj_2_rtns.length; i++) { + jj_2_rtns[i] = new JJCalls(); + } + } + + private Token jj_consume_token(int kind) throws ParseException { + Token oldToken; + if ((oldToken = token).next != null) { + token = token.next; + } else { + token = token.next = token_source.getNextToken(); + } + jj_ntk = -1; + if (token.kind == kind) { + jj_gen++; + if (++jj_gc > 100) { + jj_gc = 0; + for (int i = 0; i < jj_2_rtns.length; i++) { + JJCalls c = jj_2_rtns[i]; + while (c != null) { + if (c.gen < jj_gen) { + c.first = null; + } + c = c.next; + } + } + } + return token; + } + token = oldToken; + jj_kind = kind; + throw generateParseException(); + } + + static private final class LookaheadSuccess extends java.lang.Error { + } + + final private LookaheadSuccess jj_ls = new LookaheadSuccess(); + + private boolean jj_scan_token(int kind) { + if (jj_scanpos == jj_lastpos) { + jj_la--; + if (jj_scanpos.next == null) { + jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); + } else { + jj_lastpos = jj_scanpos = jj_scanpos.next; + } + } else { + jj_scanpos = jj_scanpos.next; + } + if (jj_rescan) { + int i = 0; + Token tok = token; + while (tok != null && tok != jj_scanpos) { + i++; + tok = tok.next; + } + if (tok != null) { + jj_add_error_token(kind, i); + } + } + if (jj_scanpos.kind != kind) { + return true; + } + if (jj_la == 0 && jj_scanpos == jj_lastpos) { + throw jj_ls; + } + return false; + } + + + /** Get the next Token. */ + final public Token getNextToken() { + if (token.next != null) { + token = token.next; + } else { + token = token.next = token_source.getNextToken(); + } + jj_ntk = -1; + jj_gen++; + return token; + } + + /** Get the specific Token. */ + final public Token getToken(int index) { + Token t = jj_lookingAhead ? jj_scanpos : token; + for (int i = 0; i < index; i++) { + if (t.next != null) { + t = t.next; + } else { + t = t.next = token_source.getNextToken(); + } + } + return t; + } + + private int jj_ntk() { + if ((jj_nt = token.next) == null) { + return (jj_ntk = (token.next = token_source.getNextToken()).kind); + } else { + return (jj_ntk = jj_nt.kind); + } + } + + private java.util.List jj_expentries = new java.util.ArrayList(); + + private int[] jj_expentry; + + private int jj_kind = -1; + + private int[] jj_lasttokens = new int[100]; + + private int jj_endpos; + + private void jj_add_error_token(int kind, int pos) { + if (pos >= 100) { + return; + } + if (pos == jj_endpos + 1) { + jj_lasttokens[jj_endpos++] = kind; + } else if (jj_endpos != 0) { + jj_expentry = new int[jj_endpos]; + for (int i = 0; i < jj_endpos; i++) { + jj_expentry[i] = jj_lasttokens[i]; + } + jj_entries_loop: for (java.util.Iterator it = jj_expentries.iterator(); it.hasNext();) { + int[] oldentry = (int[]) (it.next()); + if (oldentry.length == jj_expentry.length) { + for (int i = 0; i < jj_expentry.length; i++) { + if (oldentry[i] != jj_expentry[i]) { + continue jj_entries_loop; + } + } + jj_expentries.add(jj_expentry); + break jj_entries_loop; + } + } + if (pos != 0) { + jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } + } + } + + /** Generate ParseException. */ + public ParseException generateParseException() { + jj_expentries.clear(); + boolean[] la1tokens = new boolean[129]; + if (jj_kind >= 0) { + la1tokens[jj_kind] = true; + jj_kind = -1; + } + for (int i = 0; i < 134; i++) { + if (jj_la1[i] == jj_gen) { + for (int j = 0; j < 32; j++) { + if ((jj_la1_0[i] & (1 << j)) != 0) { + la1tokens[j] = true; + } + if ((jj_la1_1[i] & (1 << j)) != 0) { + la1tokens[32 + j] = true; + } + if ((jj_la1_2[i] & (1 << j)) != 0) { + la1tokens[64 + j] = true; + } + if ((jj_la1_3[i] & (1 << j)) != 0) { + la1tokens[96 + j] = true; + } + if ((jj_la1_4[i] & (1 << j)) != 0) { + la1tokens[128 + j] = true; + } + } + } + } + for (int i = 0; i < 129; i++) { + if (la1tokens[i]) { + jj_expentry = new int[1]; + jj_expentry[0] = i; + jj_expentries.add(jj_expentry); + } + } + jj_endpos = 0; + jj_rescan_token(); + jj_add_error_token(0, 0); + int[][] exptokseq = new int[jj_expentries.size()][]; + for (int i = 0; i < jj_expentries.size(); i++) { + exptokseq[i] = jj_expentries.get(i); + } + return new ParseException(token, exptokseq, tokenImage); + } + + /** Enable tracing. */ + final public void enable_tracing() { + } + + /** Disable tracing. */ + final public void disable_tracing() { + } + + private void jj_rescan_token() { + jj_rescan = true; + for (int i = 0; i < 43; i++) { + try { + JJCalls p = jj_2_rtns[i]; + do { + if (p.gen > jj_gen) { + jj_la = p.arg; + jj_lastpos = jj_scanpos = p.first; + switch (i) { + case 0: + jj_3_1(); + break; + case 1: + jj_3_2(); + break; + case 2: + jj_3_3(); + break; + case 3: + jj_3_4(); + break; + case 4: + jj_3_5(); + break; + case 5: + jj_3_6(); + break; + case 6: + jj_3_7(); + break; + case 7: + jj_3_8(); + break; + case 8: + jj_3_9(); + break; + case 9: + jj_3_10(); + break; + case 10: + jj_3_11(); + break; + case 11: + jj_3_12(); + break; + case 12: + jj_3_13(); + break; + case 13: + jj_3_14(); + break; + case 14: + jj_3_15(); + break; + case 15: + jj_3_16(); + break; + case 16: + jj_3_17(); + break; + case 17: + jj_3_18(); + break; + case 18: + jj_3_19(); + break; + case 19: + jj_3_20(); + break; + case 20: + jj_3_21(); + break; + case 21: + jj_3_22(); + break; + case 22: + jj_3_23(); + break; + case 23: + jj_3_24(); + break; + case 24: + jj_3_25(); + break; + case 25: + jj_3_26(); + break; + case 26: + jj_3_27(); + break; + case 27: + jj_3_28(); + break; + case 28: + jj_3_29(); + break; + case 29: + jj_3_30(); + break; + case 30: + jj_3_31(); + break; + case 31: + jj_3_32(); + break; + case 32: + jj_3_33(); + break; + case 33: + jj_3_34(); + break; + case 34: + jj_3_35(); + break; + case 35: + jj_3_36(); + break; + case 36: + jj_3_37(); + break; + case 37: + jj_3_38(); + break; + case 38: + jj_3_39(); + break; + case 39: + jj_3_40(); + break; + case 40: + jj_3_41(); + break; + case 41: + jj_3_42(); + break; + case 42: + jj_3_43(); + break; + } + } + p = p.next; + } while (p != null); + } catch (LookaheadSuccess ls) { + } + } + jj_rescan = false; + } + + private void jj_save(int index, int xla) { + JJCalls p = jj_2_rtns[index]; + while (p.gen > jj_gen) { + if (p.next == null) { + p = p.next = new JJCalls(); + break; + } + p = p.next; + } + p.gen = jj_gen + xla - jj_la; + p.first = token; + p.arg = xla; + } + + static final class JJCalls { + + int gen; + + Token first; + + int arg; + + JJCalls next; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserConstants.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserConstants.java new file mode 100644 index 00000000000..c17a56d91e0 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserConstants.java @@ -0,0 +1,531 @@ +/* Generated By:JavaCC: Do not edit this line. ASTParserConstants.java */ +/* + * Copyright (C) 2008 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +package japa.parser; + + +/** + * Token literal values and constants. + * Generated by org.javacc.parser.OtherFilesGen#start() + */ +public interface ASTParserConstants { + + /** End of File. */ + int EOF = 0; + + /** RegularExpression Id. */ + int SINGLE_LINE_COMMENT = 6; + + /** RegularExpression Id. */ + int JAVA_DOC_COMMENT = 9; + + /** RegularExpression Id. */ + int MULTI_LINE_COMMENT = 10; + + /** RegularExpression Id. */ + int ABSTRACT = 12; + + /** RegularExpression Id. */ + int ASSERT = 13; + + /** RegularExpression Id. */ + int BOOLEAN = 14; + + /** RegularExpression Id. */ + int BREAK = 15; + + /** RegularExpression Id. */ + int BYTE = 16; + + /** RegularExpression Id. */ + int CASE = 17; + + /** RegularExpression Id. */ + int CATCH = 18; + + /** RegularExpression Id. */ + int CHAR = 19; + + /** RegularExpression Id. */ + int CLASS = 20; + + /** RegularExpression Id. */ + int CONST = 21; + + /** RegularExpression Id. */ + int CONTINUE = 22; + + /** RegularExpression Id. */ + int _DEFAULT = 23; + + /** RegularExpression Id. */ + int DO = 24; + + /** RegularExpression Id. */ + int DOUBLE = 25; + + /** RegularExpression Id. */ + int ELSE = 26; + + /** RegularExpression Id. */ + int ENUM = 27; + + /** RegularExpression Id. */ + int EXTENDS = 28; + + /** RegularExpression Id. */ + int FALSE = 29; + + /** RegularExpression Id. */ + int FINAL = 30; + + /** RegularExpression Id. */ + int FINALLY = 31; + + /** RegularExpression Id. */ + int FLOAT = 32; + + /** RegularExpression Id. */ + int FOR = 33; + + /** RegularExpression Id. */ + int GOTO = 34; + + /** RegularExpression Id. */ + int IF = 35; + + /** RegularExpression Id. */ + int IMPLEMENTS = 36; + + /** RegularExpression Id. */ + int IMPORT = 37; + + /** RegularExpression Id. */ + int INSTANCEOF = 38; + + /** RegularExpression Id. */ + int INT = 39; + + /** RegularExpression Id. */ + int INTERFACE = 40; + + /** RegularExpression Id. */ + int LONG = 41; + + /** RegularExpression Id. */ + int NATIVE = 42; + + /** RegularExpression Id. */ + int NEW = 43; + + /** RegularExpression Id. */ + int NULL = 44; + + /** RegularExpression Id. */ + int PACKAGE = 45; + + /** RegularExpression Id. */ + int PRIVATE = 46; + + /** RegularExpression Id. */ + int PROTECTED = 47; + + /** RegularExpression Id. */ + int PUBLIC = 48; + + /** RegularExpression Id. */ + int RETURN = 49; + + /** RegularExpression Id. */ + int SHORT = 50; + + /** RegularExpression Id. */ + int STATIC = 51; + + /** RegularExpression Id. */ + int STRICTFP = 52; + + /** RegularExpression Id. */ + int SUPER = 53; + + /** RegularExpression Id. */ + int SWITCH = 54; + + /** RegularExpression Id. */ + int SYNCHRONIZED = 55; + + /** RegularExpression Id. */ + int THIS = 56; + + /** RegularExpression Id. */ + int THROW = 57; + + /** RegularExpression Id. */ + int THROWS = 58; + + /** RegularExpression Id. */ + int TRANSIENT = 59; + + /** RegularExpression Id. */ + int TRUE = 60; + + /** RegularExpression Id. */ + int TRY = 61; + + /** RegularExpression Id. */ + int VOID = 62; + + /** RegularExpression Id. */ + int VOLATILE = 63; + + /** RegularExpression Id. */ + int WHILE = 64; + + /** RegularExpression Id. */ + int LONG_LITERAL = 65; + + /** RegularExpression Id. */ + int INTEGER_LITERAL = 66; + + /** RegularExpression Id. */ + int DECIMAL_LITERAL = 67; + + /** RegularExpression Id. */ + int HEX_LITERAL = 68; + + /** RegularExpression Id. */ + int OCTAL_LITERAL = 69; + + /** RegularExpression Id. */ + int FLOATING_POINT_LITERAL = 70; + + /** RegularExpression Id. */ + int DECIMAL_FLOATING_POINT_LITERAL = 71; + + /** RegularExpression Id. */ + int DECIMAL_EXPONENT = 72; + + /** RegularExpression Id. */ + int HEXADECIMAL_FLOATING_POINT_LITERAL = 73; + + /** RegularExpression Id. */ + int HEXADECIMAL_EXPONENT = 74; + + /** RegularExpression Id. */ + int CHARACTER_LITERAL = 75; + + /** RegularExpression Id. */ + int STRING_LITERAL = 76; + + /** RegularExpression Id. */ + int IDENTIFIER = 77; + + /** RegularExpression Id. */ + int LETTER = 78; + + /** RegularExpression Id. */ + int PART_LETTER = 79; + + /** RegularExpression Id. */ + int LPAREN = 80; + + /** RegularExpression Id. */ + int RPAREN = 81; + + /** RegularExpression Id. */ + int LBRACE = 82; + + /** RegularExpression Id. */ + int RBRACE = 83; + + /** RegularExpression Id. */ + int LBRACKET = 84; + + /** RegularExpression Id. */ + int RBRACKET = 85; + + /** RegularExpression Id. */ + int SEMICOLON = 86; + + /** RegularExpression Id. */ + int COMMA = 87; + + /** RegularExpression Id. */ + int DOT = 88; + + /** RegularExpression Id. */ + int AT = 89; + + /** RegularExpression Id. */ + int ASSIGN = 90; + + /** RegularExpression Id. */ + int LT = 91; + + /** RegularExpression Id. */ + int BANG = 92; + + /** RegularExpression Id. */ + int TILDE = 93; + + /** RegularExpression Id. */ + int HOOK = 94; + + /** RegularExpression Id. */ + int COLON = 95; + + /** RegularExpression Id. */ + int EQ = 96; + + /** RegularExpression Id. */ + int LE = 97; + + /** RegularExpression Id. */ + int GE = 98; + + /** RegularExpression Id. */ + int NE = 99; + + /** RegularExpression Id. */ + int SC_OR = 100; + + /** RegularExpression Id. */ + int SC_AND = 101; + + /** RegularExpression Id. */ + int INCR = 102; + + /** RegularExpression Id. */ + int DECR = 103; + + /** RegularExpression Id. */ + int PLUS = 104; + + /** RegularExpression Id. */ + int MINUS = 105; + + /** RegularExpression Id. */ + int STAR = 106; + + /** RegularExpression Id. */ + int SLASH = 107; + + /** RegularExpression Id. */ + int BIT_AND = 108; + + /** RegularExpression Id. */ + int BIT_OR = 109; + + /** RegularExpression Id. */ + int XOR = 110; + + /** RegularExpression Id. */ + int REM = 111; + + /** RegularExpression Id. */ + int LSHIFT = 112; + + /** RegularExpression Id. */ + int PLUSASSIGN = 113; + + /** RegularExpression Id. */ + int MINUSASSIGN = 114; + + /** RegularExpression Id. */ + int STARASSIGN = 115; + + /** RegularExpression Id. */ + int SLASHASSIGN = 116; + + /** RegularExpression Id. */ + int ANDASSIGN = 117; + + /** RegularExpression Id. */ + int ORASSIGN = 118; + + /** RegularExpression Id. */ + int XORASSIGN = 119; + + /** RegularExpression Id. */ + int REMASSIGN = 120; + + /** RegularExpression Id. */ + int LSHIFTASSIGN = 121; + + /** RegularExpression Id. */ + int RSIGNEDSHIFTASSIGN = 122; + + /** RegularExpression Id. */ + int RUNSIGNEDSHIFTASSIGN = 123; + + /** RegularExpression Id. */ + int ELLIPSIS = 124; + + /** RegularExpression Id. */ + int RUNSIGNEDSHIFT = 125; + + /** RegularExpression Id. */ + int RSIGNEDSHIFT = 126; + + /** RegularExpression Id. */ + int GT = 127; + + /** Lexical state. */ + int DEFAULT = 0; + + /** Lexical state. */ + int IN_JAVA_DOC_COMMENT = 1; + + /** Lexical state. */ + int IN_MULTI_LINE_COMMENT = 2; + + /** Literal token values. */ + String[] tokenImage = { + "", + "\" \"", + "\"\\t\"", + "\"\\n\"", + "\"\\r\"", + "\"\\f\"", + "", + "", + "\"/*\"", + "\"*/\"", + "\"*/\"", + "", + "\"abstract\"", + "\"assert\"", + "\"boolean\"", + "\"break\"", + "\"byte\"", + "\"case\"", + "\"catch\"", + "\"char\"", + "\"class\"", + "\"const\"", + "\"continue\"", + "\"default\"", + "\"do\"", + "\"double\"", + "\"else\"", + "\"enum\"", + "\"extends\"", + "\"false\"", + "\"final\"", + "\"finally\"", + "\"float\"", + "\"for\"", + "\"goto\"", + "\"if\"", + "\"implements\"", + "\"import\"", + "\"instanceof\"", + "\"int\"", + "\"interface\"", + "\"long\"", + "\"native\"", + "\"new\"", + "\"null\"", + "\"package\"", + "\"private\"", + "\"protected\"", + "\"public\"", + "\"return\"", + "\"short\"", + "\"static\"", + "\"strictfp\"", + "\"super\"", + "\"switch\"", + "\"synchronized\"", + "\"this\"", + "\"throw\"", + "\"throws\"", + "\"transient\"", + "\"true\"", + "\"try\"", + "\"void\"", + "\"volatile\"", + "\"while\"", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "\"(\"", + "\")\"", + "\"{\"", + "\"}\"", + "\"[\"", + "\"]\"", + "\";\"", + "\",\"", + "\".\"", + "\"@\"", + "\"=\"", + "\"<\"", + "\"!\"", + "\"~\"", + "\"?\"", + "\":\"", + "\"==\"", + "\"<=\"", + "\">=\"", + "\"!=\"", + "\"||\"", + "\"&&\"", + "\"++\"", + "\"--\"", + "\"+\"", + "\"-\"", + "\"*\"", + "\"/\"", + "\"&\"", + "\"|\"", + "\"^\"", + "\"%\"", + "\"<<\"", + "\"+=\"", + "\"-=\"", + "\"*=\"", + "\"/=\"", + "\"&=\"", + "\"|=\"", + "\"^=\"", + "\"%=\"", + "\"<<=\"", + "\">>=\"", + "\">>>=\"", + "\"...\"", + "\">>>\"", + "\">>\"", + "\">\"", + "\"\\u001a\"", + }; + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserTokenManager.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserTokenManager.java new file mode 100644 index 00000000000..dad38f6ece0 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ASTParserTokenManager.java @@ -0,0 +1,2579 @@ +/* Generated By:JavaCC: Do not edit this line. ASTParserTokenManager.java */ +/* + * Copyright (C) 2008 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +package japa.parser; + +import japa.parser.ast.BlockComment; +import japa.parser.ast.Comment; +import japa.parser.ast.LineComment; +import japa.parser.ast.body.JavadocComment; + +import java.util.LinkedList; +import java.util.List; +import java.util.Stack; + +/** Token Manager. */ +public class ASTParserTokenManager implements ASTParserConstants { + + private List comments; + + private final Stack javadocStack = new Stack(); + + private JavadocComment lastJavadoc; + + void pushJavadoc() { + javadocStack.push(lastJavadoc); + } + + JavadocComment popJavadoc() { + return javadocStack.pop(); + } + + List getComments() { + return comments; + } + + void clearComments() { + comments = null; + javadocStack.clear(); + lastJavadoc = null; + } + + private void CommonTokenAction(Token token) { + lastJavadoc = null; + if (token.specialToken != null) { + if (comments == null) { + comments = new LinkedList(); + } + Token special = token.specialToken; + if (special.kind == JAVA_DOC_COMMENT) { + lastJavadoc = new JavadocComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(3, special.image.length() - 2)); + comments.add(lastJavadoc); + } else if (special.kind == SINGLE_LINE_COMMENT) { + LineComment comment = new LineComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2)); + comments.add(comment); + } else if (special.kind == MULTI_LINE_COMMENT) { + BlockComment comment = new BlockComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2, special.image.length() - 2)); + comments.add(comment); + } + } + } + + /** Debug output. */ + public java.io.PrintStream debugStream = System.out; + + /** Set debug output. */ + public void setDebugStream(java.io.PrintStream ds) { + debugStream = ds; + } + + private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1, long active2) { + switch (pos) { + case 0: + if ((active0 & 0xfffffffffffff000L) != 0L || (active1 & 0x1L) != 0L) { + jjmatchedKind = 77; + return 37; + } + if ((active1 & 0x1000000001000000L) != 0L) { + return 1; + } + if ((active0 & 0x100L) != 0L || (active1 & 0x10080000000000L) != 0L) { + return 54; + } + return -1; + case 1: + if ((active0 & 0x100L) != 0L) { + return 59; + } + if ((active0 & 0x803000000L) != 0L) { + return 37; + } + if ((active0 & 0xfffffff7fcfff000L) != 0L || (active1 & 0x1L) != 0L) { + if (jjmatchedPos != 1) { + jjmatchedKind = 77; + jjmatchedPos = 1; + } + return 37; + } + return -1; + case 2: + if ((active0 & 0xdffff675fefff000L) != 0L || (active1 & 0x1L) != 0L) { + if (jjmatchedPos != 2) { + jjmatchedKind = 77; + jjmatchedPos = 2; + } + return 37; + } + if ((active0 & 0x2000098200000000L) != 0L) { + return 37; + } + return -1; + case 3: + if ((active0 & 0x8effe571f2f4f000L) != 0L || (active1 & 0x1L) != 0L) { + jjmatchedKind = 77; + jjmatchedPos = 3; + return 37; + } + if ((active0 & 0x510012040c0b0000L) != 0L) { + return 37; + } + return -1; + case 4: + if ((active0 & 0x88dbe57012c07000L) != 0L) { + if (jjmatchedPos != 4) { + jjmatchedKind = 77; + jjmatchedPos = 4; + } + return 37; + } + if ((active0 & 0x6240001e0348000L) != 0L || (active1 & 0x1L) != 0L) { + return 37; + } + return -1; + case 5: + if ((active0 & 0x8890e15090c05000L) != 0L) { + jjmatchedKind = 77; + jjmatchedPos = 5; + return 37; + } + if ((active0 & 0x44b042002002000L) != 0L) { + return 37; + } + return -1; + case 6: + if ((active0 & 0x8890815000401000L) != 0L) { + jjmatchedKind = 77; + jjmatchedPos = 6; + return 37; + } + if ((active0 & 0x600090804000L) != 0L) { + return 37; + } + return -1; + case 7: + if ((active0 & 0x880815000000000L) != 0L) { + jjmatchedKind = 77; + jjmatchedPos = 7; + return 37; + } + if ((active0 & 0x8010000000401000L) != 0L) { + return 37; + } + return -1; + case 8: + if ((active0 & 0x800810000000000L) != 0L) { + return 37; + } + if ((active0 & 0x80005000000000L) != 0L) { + jjmatchedKind = 77; + jjmatchedPos = 8; + return 37; + } + return -1; + case 9: + if ((active0 & 0x80000000000000L) != 0L) { + jjmatchedKind = 77; + jjmatchedPos = 9; + return 37; + } + if ((active0 & 0x5000000000L) != 0L) { + return 37; + } + return -1; + case 10: + if ((active0 & 0x80000000000000L) != 0L) { + jjmatchedKind = 77; + jjmatchedPos = 10; + return 37; + } + return -1; + default: + return -1; + } + } + + private final int jjStartNfa_0(int pos, long active0, long active1, long active2) { + return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1, active2), pos + 1); + } + + private int jjStopAtPos(int pos, int kind) { + jjmatchedKind = kind; + jjmatchedPos = pos; + return pos + 1; + } + + private int jjMoveStringLiteralDfa0_0() { + switch (curChar) { + case 26: + return jjStopAtPos(0, 128); + case 33: + jjmatchedKind = 92; + return jjMoveStringLiteralDfa1_0(0x0L, 0x800000000L); + case 37: + jjmatchedKind = 111; + return jjMoveStringLiteralDfa1_0(0x0L, 0x100000000000000L); + case 38: + jjmatchedKind = 108; + return jjMoveStringLiteralDfa1_0(0x0L, 0x20002000000000L); + case 40: + return jjStopAtPos(0, 80); + case 41: + return jjStopAtPos(0, 81); + case 42: + jjmatchedKind = 106; + return jjMoveStringLiteralDfa1_0(0x0L, 0x8000000000000L); + case 43: + jjmatchedKind = 104; + return jjMoveStringLiteralDfa1_0(0x0L, 0x2004000000000L); + case 44: + return jjStopAtPos(0, 87); + case 45: + jjmatchedKind = 105; + return jjMoveStringLiteralDfa1_0(0x0L, 0x4008000000000L); + case 46: + jjmatchedKind = 88; + return jjMoveStringLiteralDfa1_0(0x0L, 0x1000000000000000L); + case 47: + jjmatchedKind = 107; + return jjMoveStringLiteralDfa1_0(0x100L, 0x10000000000000L); + case 58: + return jjStopAtPos(0, 95); + case 59: + return jjStopAtPos(0, 86); + case 60: + jjmatchedKind = 91; + return jjMoveStringLiteralDfa1_0(0x0L, 0x201000200000000L); + case 61: + jjmatchedKind = 90; + return jjMoveStringLiteralDfa1_0(0x0L, 0x100000000L); + case 62: + jjmatchedKind = 127; + return jjMoveStringLiteralDfa1_0(0x0L, 0x6c00000400000000L); + case 63: + return jjStopAtPos(0, 94); + case 64: + return jjStopAtPos(0, 89); + case 91: + return jjStopAtPos(0, 84); + case 93: + return jjStopAtPos(0, 85); + case 94: + jjmatchedKind = 110; + return jjMoveStringLiteralDfa1_0(0x0L, 0x80000000000000L); + case 97: + return jjMoveStringLiteralDfa1_0(0x3000L, 0x0L); + case 98: + return jjMoveStringLiteralDfa1_0(0x1c000L, 0x0L); + case 99: + return jjMoveStringLiteralDfa1_0(0x7e0000L, 0x0L); + case 100: + return jjMoveStringLiteralDfa1_0(0x3800000L, 0x0L); + case 101: + return jjMoveStringLiteralDfa1_0(0x1c000000L, 0x0L); + case 102: + return jjMoveStringLiteralDfa1_0(0x3e0000000L, 0x0L); + case 103: + return jjMoveStringLiteralDfa1_0(0x400000000L, 0x0L); + case 105: + return jjMoveStringLiteralDfa1_0(0x1f800000000L, 0x0L); + case 108: + return jjMoveStringLiteralDfa1_0(0x20000000000L, 0x0L); + case 110: + return jjMoveStringLiteralDfa1_0(0x1c0000000000L, 0x0L); + case 112: + return jjMoveStringLiteralDfa1_0(0x1e00000000000L, 0x0L); + case 114: + return jjMoveStringLiteralDfa1_0(0x2000000000000L, 0x0L); + case 115: + return jjMoveStringLiteralDfa1_0(0xfc000000000000L, 0x0L); + case 116: + return jjMoveStringLiteralDfa1_0(0x3f00000000000000L, 0x0L); + case 118: + return jjMoveStringLiteralDfa1_0(0xc000000000000000L, 0x0L); + case 119: + return jjMoveStringLiteralDfa1_0(0x0L, 0x1L); + case 123: + return jjStopAtPos(0, 82); + case 124: + jjmatchedKind = 109; + return jjMoveStringLiteralDfa1_0(0x0L, 0x40001000000000L); + case 125: + return jjStopAtPos(0, 83); + case 126: + return jjStopAtPos(0, 93); + default: + return jjMoveNfa_0(0, 0); + } + } + + private int jjMoveStringLiteralDfa1_0(long active0, long active1) { + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + jjStopStringLiteralDfa_0(0, active0, active1, 0L); + return 1; + } + switch (curChar) { + case 38: + if ((active1 & 0x2000000000L) != 0L) { + return jjStopAtPos(1, 101); + } + break; + case 42: + if ((active0 & 0x100L) != 0L) { + return jjStartNfaWithStates_0(1, 8, 59); + } + break; + case 43: + if ((active1 & 0x4000000000L) != 0L) { + return jjStopAtPos(1, 102); + } + break; + case 45: + if ((active1 & 0x8000000000L) != 0L) { + return jjStopAtPos(1, 103); + } + break; + case 46: + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x1000000000000000L); + case 60: + if ((active1 & 0x1000000000000L) != 0L) { + jjmatchedKind = 112; + jjmatchedPos = 1; + } + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x200000000000000L); + case 61: + if ((active1 & 0x100000000L) != 0L) { + return jjStopAtPos(1, 96); + } else if ((active1 & 0x200000000L) != 0L) { + return jjStopAtPos(1, 97); + } else if ((active1 & 0x400000000L) != 0L) { + return jjStopAtPos(1, 98); + } else if ((active1 & 0x800000000L) != 0L) { + return jjStopAtPos(1, 99); + } else if ((active1 & 0x2000000000000L) != 0L) { + return jjStopAtPos(1, 113); + } else if ((active1 & 0x4000000000000L) != 0L) { + return jjStopAtPos(1, 114); + } else if ((active1 & 0x8000000000000L) != 0L) { + return jjStopAtPos(1, 115); + } else if ((active1 & 0x10000000000000L) != 0L) { + return jjStopAtPos(1, 116); + } else if ((active1 & 0x20000000000000L) != 0L) { + return jjStopAtPos(1, 117); + } else if ((active1 & 0x40000000000000L) != 0L) { + return jjStopAtPos(1, 118); + } else if ((active1 & 0x80000000000000L) != 0L) { + return jjStopAtPos(1, 119); + } else if ((active1 & 0x100000000000000L) != 0L) { + return jjStopAtPos(1, 120); + } + break; + case 62: + if ((active1 & 0x4000000000000000L) != 0L) { + jjmatchedKind = 126; + jjmatchedPos = 1; + } + return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x2c00000000000000L); + case 97: + return jjMoveStringLiteralDfa2_0(active0, 0x240020060000L, active1, 0L); + case 98: + return jjMoveStringLiteralDfa2_0(active0, 0x1000L, active1, 0L); + case 101: + return jjMoveStringLiteralDfa2_0(active0, 0x2080000800000L, active1, 0L); + case 102: + if ((active0 & 0x800000000L) != 0L) { + return jjStartNfaWithStates_0(1, 35, 37); + } + break; + case 104: + return jjMoveStringLiteralDfa2_0(active0, 0x704000000080000L, active1, 0x1L); + case 105: + return jjMoveStringLiteralDfa2_0(active0, 0xc0000000L, active1, 0L); + case 108: + return jjMoveStringLiteralDfa2_0(active0, 0x104100000L, active1, 0L); + case 109: + return jjMoveStringLiteralDfa2_0(active0, 0x3000000000L, active1, 0L); + case 110: + return jjMoveStringLiteralDfa2_0(active0, 0x1c008000000L, active1, 0L); + case 111: + if ((active0 & 0x1000000L) != 0L) { + jjmatchedKind = 24; + jjmatchedPos = 1; + } + return jjMoveStringLiteralDfa2_0(active0, 0xc000020602604000L, active1, 0L); + case 114: + return jjMoveStringLiteralDfa2_0(active0, 0x3800c00000008000L, active1, 0L); + case 115: + return jjMoveStringLiteralDfa2_0(active0, 0x2000L, active1, 0L); + case 116: + return jjMoveStringLiteralDfa2_0(active0, 0x18000000000000L, active1, 0L); + case 117: + return jjMoveStringLiteralDfa2_0(active0, 0x21100000000000L, active1, 0L); + case 119: + return jjMoveStringLiteralDfa2_0(active0, 0x40000000000000L, active1, 0L); + case 120: + return jjMoveStringLiteralDfa2_0(active0, 0x10000000L, active1, 0L); + case 121: + return jjMoveStringLiteralDfa2_0(active0, 0x80000000010000L, active1, 0L); + case 124: + if ((active1 & 0x1000000000L) != 0L) { + return jjStopAtPos(1, 100); + } + break; + default: + break; + } + return jjStartNfa_0(0, active0, active1, 0L); + } + + private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1) { + if (((active0 &= old0) | (active1 &= old1)) == 0L) { + return jjStartNfa_0(0, old0, old1, 0L); + } + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + jjStopStringLiteralDfa_0(1, active0, active1, 0L); + return 2; + } + switch (curChar) { + case 46: + if ((active1 & 0x1000000000000000L) != 0L) { + return jjStopAtPos(2, 124); + } + break; + case 61: + if ((active1 & 0x200000000000000L) != 0L) { + return jjStopAtPos(2, 121); + } else if ((active1 & 0x400000000000000L) != 0L) { + return jjStopAtPos(2, 122); + } + break; + case 62: + if ((active1 & 0x2000000000000000L) != 0L) { + jjmatchedKind = 125; + jjmatchedPos = 2; + } + return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x800000000000000L); + case 97: + return jjMoveStringLiteralDfa3_0(active0, 0x808000000180000L, active1, 0L); + case 98: + return jjMoveStringLiteralDfa3_0(active0, 0x1000000000000L, active1, 0L); + case 99: + return jjMoveStringLiteralDfa3_0(active0, 0x200000000000L, active1, 0L); + case 101: + return jjMoveStringLiteralDfa3_0(active0, 0x8000L, active1, 0L); + case 102: + return jjMoveStringLiteralDfa3_0(active0, 0x800000L, active1, 0L); + case 105: + return jjMoveStringLiteralDfa3_0(active0, 0x4140400000000000L, active1, 0x1L); + case 108: + return jjMoveStringLiteralDfa3_0(active0, 0x8000100020000000L, active1, 0L); + case 110: + return jjMoveStringLiteralDfa3_0(active0, 0x800200c0600000L, active1, 0L); + case 111: + return jjMoveStringLiteralDfa3_0(active0, 0x4800100004000L, active1, 0L); + case 112: + return jjMoveStringLiteralDfa3_0(active0, 0x20003000000000L, active1, 0L); + case 114: + if ((active0 & 0x200000000L) != 0L) { + return jjStartNfaWithStates_0(2, 33, 37); + } + return jjMoveStringLiteralDfa3_0(active0, 0x610000000000000L, active1, 0L); + case 115: + return jjMoveStringLiteralDfa3_0(active0, 0x4004023000L, active1, 0L); + case 116: + if ((active0 & 0x8000000000L) != 0L) { + jjmatchedKind = 39; + jjmatchedPos = 2; + } + return jjMoveStringLiteralDfa3_0(active0, 0x2050410050000L, active1, 0L); + case 117: + return jjMoveStringLiteralDfa3_0(active0, 0x100000000a000000L, active1, 0L); + case 119: + if ((active0 & 0x80000000000L) != 0L) { + return jjStartNfaWithStates_0(2, 43, 37); + } + break; + case 121: + if ((active0 & 0x2000000000000000L) != 0L) { + return jjStartNfaWithStates_0(2, 61, 37); + } + break; + default: + break; + } + return jjStartNfa_0(1, active0, active1, 0L); + } + + private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1) { + if (((active0 &= old0) | (active1 &= old1)) == 0L) { + return jjStartNfa_0(1, old0, old1, 0L); + } + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + jjStopStringLiteralDfa_0(2, active0, active1, 0L); + return 3; + } + switch (curChar) { + case 61: + if ((active1 & 0x800000000000000L) != 0L) { + return jjStopAtPos(3, 123); + } + break; + case 97: + return jjMoveStringLiteralDfa4_0(active0, 0x80000001c0808000L, active1, 0L); + case 98: + return jjMoveStringLiteralDfa4_0(active0, 0x2000000L, active1, 0L); + case 99: + return jjMoveStringLiteralDfa4_0(active0, 0x80000000040000L, active1, 0L); + case 100: + if ((active0 & 0x4000000000000000L) != 0L) { + return jjStartNfaWithStates_0(3, 62, 37); + } + break; + case 101: + if ((active0 & 0x10000L) != 0L) { + return jjStartNfaWithStates_0(3, 16, 37); + } else if ((active0 & 0x20000L) != 0L) { + return jjStartNfaWithStates_0(3, 17, 37); + } else if ((active0 & 0x4000000L) != 0L) { + return jjStartNfaWithStates_0(3, 26, 37); + } else if ((active0 & 0x1000000000000000L) != 0L) { + return jjStartNfaWithStates_0(3, 60, 37); + } + return jjMoveStringLiteralDfa4_0(active0, 0x20010010002000L, active1, 0L); + case 103: + if ((active0 & 0x20000000000L) != 0L) { + return jjStartNfaWithStates_0(3, 41, 37); + } + break; + case 105: + return jjMoveStringLiteralDfa4_0(active0, 0x10040000000000L, active1, 0L); + case 107: + return jjMoveStringLiteralDfa4_0(active0, 0x200000000000L, active1, 0L); + case 108: + if ((active0 & 0x100000000000L) != 0L) { + return jjStartNfaWithStates_0(3, 44, 37); + } + return jjMoveStringLiteralDfa4_0(active0, 0x1001000004000L, active1, 0x1L); + case 109: + if ((active0 & 0x8000000L) != 0L) { + return jjStartNfaWithStates_0(3, 27, 37); + } + break; + case 110: + return jjMoveStringLiteralDfa4_0(active0, 0x800000000000000L, active1, 0L); + case 111: + if ((active0 & 0x400000000L) != 0L) { + return jjStartNfaWithStates_0(3, 34, 37); + } + return jjMoveStringLiteralDfa4_0(active0, 0x600002000000000L, active1, 0L); + case 114: + if ((active0 & 0x80000L) != 0L) { + return jjStartNfaWithStates_0(3, 19, 37); + } + return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000L, active1, 0L); + case 115: + if ((active0 & 0x100000000000000L) != 0L) { + return jjStartNfaWithStates_0(3, 56, 37); + } + return jjMoveStringLiteralDfa4_0(active0, 0x20300000L, active1, 0L); + case 116: + return jjMoveStringLiteralDfa4_0(active0, 0x48804000401000L, active1, 0L); + case 117: + return jjMoveStringLiteralDfa4_0(active0, 0x2000000000000L, active1, 0L); + case 118: + return jjMoveStringLiteralDfa4_0(active0, 0x400000000000L, active1, 0L); + default: + break; + } + return jjStartNfa_0(2, active0, active1, 0L); + } + + private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1) { + if (((active0 &= old0) | (active1 &= old1)) == 0L) { + return jjStartNfa_0(2, old0, old1, 0L); + } + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + jjStopStringLiteralDfa_0(3, active0, active1, 0L); + return 4; + } + switch (curChar) { + case 97: + return jjMoveStringLiteralDfa5_0(active0, 0x604000000000L, active1, 0L); + case 99: + return jjMoveStringLiteralDfa5_0(active0, 0x50000000000000L, active1, 0L); + case 101: + if ((active0 & 0x20000000L) != 0L) { + return jjStartNfaWithStates_0(4, 29, 37); + } else if ((active1 & 0x1L) != 0L) { + return jjStartNfaWithStates_0(4, 64, 37); + } + return jjMoveStringLiteralDfa5_0(active0, 0x801000004000L, active1, 0L); + case 104: + if ((active0 & 0x40000L) != 0L) { + return jjStartNfaWithStates_0(4, 18, 37); + } + return jjMoveStringLiteralDfa5_0(active0, 0x80000000000000L, active1, 0L); + case 105: + return jjMoveStringLiteralDfa5_0(active0, 0x9000000400000L, active1, 0L); + case 107: + if ((active0 & 0x8000L) != 0L) { + return jjStartNfaWithStates_0(4, 15, 37); + } + break; + case 108: + if ((active0 & 0x40000000L) != 0L) { + jjmatchedKind = 30; + jjmatchedPos = 4; + } + return jjMoveStringLiteralDfa5_0(active0, 0x82000000L, active1, 0L); + case 110: + return jjMoveStringLiteralDfa5_0(active0, 0x10000000L, active1, 0L); + case 114: + if ((active0 & 0x20000000000000L) != 0L) { + return jjStartNfaWithStates_0(4, 53, 37); + } + return jjMoveStringLiteralDfa5_0(active0, 0x2012000003000L, active1, 0L); + case 115: + if ((active0 & 0x100000L) != 0L) { + return jjStartNfaWithStates_0(4, 20, 37); + } + return jjMoveStringLiteralDfa5_0(active0, 0x800000000000000L, active1, 0L); + case 116: + if ((active0 & 0x200000L) != 0L) { + return jjStartNfaWithStates_0(4, 21, 37); + } else if ((active0 & 0x100000000L) != 0L) { + return jjStartNfaWithStates_0(4, 32, 37); + } else if ((active0 & 0x4000000000000L) != 0L) { + return jjStartNfaWithStates_0(4, 50, 37); + } + return jjMoveStringLiteralDfa5_0(active0, 0x8000000000000000L, active1, 0L); + case 117: + return jjMoveStringLiteralDfa5_0(active0, 0x800000L, active1, 0L); + case 118: + return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0L); + case 119: + if ((active0 & 0x200000000000000L) != 0L) { + jjmatchedKind = 57; + jjmatchedPos = 4; + } + return jjMoveStringLiteralDfa5_0(active0, 0x400000000000000L, active1, 0L); + default: + break; + } + return jjStartNfa_0(3, active0, active1, 0L); + } + + private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1) { + if (((active0 &= old0) | (active1 &= old1)) == 0L) { + return jjStartNfa_0(3, old0, old1, 0L); + } + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + jjStopStringLiteralDfa_0(4, active0, 0L, 0L); + return 5; + } + switch (curChar) { + case 97: + return jjMoveStringLiteralDfa6_0(active0, 0x5000L); + case 99: + if ((active0 & 0x1000000000000L) != 0L) { + return jjStartNfaWithStates_0(5, 48, 37); + } else if ((active0 & 0x8000000000000L) != 0L) { + return jjStartNfaWithStates_0(5, 51, 37); + } + return jjMoveStringLiteralDfa6_0(active0, 0x800000000000L); + case 100: + return jjMoveStringLiteralDfa6_0(active0, 0x10000000L); + case 101: + if ((active0 & 0x2000000L) != 0L) { + return jjStartNfaWithStates_0(5, 25, 37); + } else if ((active0 & 0x40000000000L) != 0L) { + return jjStartNfaWithStates_0(5, 42, 37); + } + break; + case 102: + return jjMoveStringLiteralDfa6_0(active0, 0x10000000000L); + case 103: + return jjMoveStringLiteralDfa6_0(active0, 0x200000000000L); + case 104: + if ((active0 & 0x40000000000000L) != 0L) { + return jjStartNfaWithStates_0(5, 54, 37); + } + break; + case 105: + return jjMoveStringLiteralDfa6_0(active0, 0x8800000000000000L); + case 108: + return jjMoveStringLiteralDfa6_0(active0, 0x80800000L); + case 109: + return jjMoveStringLiteralDfa6_0(active0, 0x1000000000L); + case 110: + if ((active0 & 0x2000000000000L) != 0L) { + return jjStartNfaWithStates_0(5, 49, 37); + } + return jjMoveStringLiteralDfa6_0(active0, 0x4000400000L); + case 114: + return jjMoveStringLiteralDfa6_0(active0, 0x80000000000000L); + case 115: + if ((active0 & 0x400000000000000L) != 0L) { + return jjStartNfaWithStates_0(5, 58, 37); + } + break; + case 116: + if ((active0 & 0x2000L) != 0L) { + return jjStartNfaWithStates_0(5, 13, 37); + } else if ((active0 & 0x2000000000L) != 0L) { + return jjStartNfaWithStates_0(5, 37, 37); + } + return jjMoveStringLiteralDfa6_0(active0, 0x10400000000000L); + default: + break; + } + return jjStartNfa_0(4, active0, 0L, 0L); + } + + private int jjMoveStringLiteralDfa6_0(long old0, long active0) { + if (((active0 &= old0)) == 0L) { + return jjStartNfa_0(4, old0, 0L, 0L); + } + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + jjStopStringLiteralDfa_0(5, active0, 0L, 0L); + return 6; + } + switch (curChar) { + case 97: + return jjMoveStringLiteralDfa7_0(active0, 0x10000000000L); + case 99: + return jjMoveStringLiteralDfa7_0(active0, 0x4000001000L); + case 101: + if ((active0 & 0x200000000000L) != 0L) { + return jjStartNfaWithStates_0(6, 45, 37); + } else if ((active0 & 0x400000000000L) != 0L) { + return jjStartNfaWithStates_0(6, 46, 37); + } + return jjMoveStringLiteralDfa7_0(active0, 0x800001000000000L); + case 102: + return jjMoveStringLiteralDfa7_0(active0, 0x10000000000000L); + case 108: + return jjMoveStringLiteralDfa7_0(active0, 0x8000000000000000L); + case 110: + if ((active0 & 0x4000L) != 0L) { + return jjStartNfaWithStates_0(6, 14, 37); + } + break; + case 111: + return jjMoveStringLiteralDfa7_0(active0, 0x80000000000000L); + case 115: + if ((active0 & 0x10000000L) != 0L) { + return jjStartNfaWithStates_0(6, 28, 37); + } + break; + case 116: + if ((active0 & 0x800000L) != 0L) { + return jjStartNfaWithStates_0(6, 23, 37); + } + return jjMoveStringLiteralDfa7_0(active0, 0x800000000000L); + case 117: + return jjMoveStringLiteralDfa7_0(active0, 0x400000L); + case 121: + if ((active0 & 0x80000000L) != 0L) { + return jjStartNfaWithStates_0(6, 31, 37); + } + break; + default: + break; + } + return jjStartNfa_0(5, active0, 0L, 0L); + } + + private int jjMoveStringLiteralDfa7_0(long old0, long active0) { + if (((active0 &= old0)) == 0L) { + return jjStartNfa_0(5, old0, 0L, 0L); + } + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + jjStopStringLiteralDfa_0(6, active0, 0L, 0L); + return 7; + } + switch (curChar) { + case 99: + return jjMoveStringLiteralDfa8_0(active0, 0x10000000000L); + case 101: + if ((active0 & 0x400000L) != 0L) { + return jjStartNfaWithStates_0(7, 22, 37); + } else if ((active0 & 0x8000000000000000L) != 0L) { + return jjStartNfaWithStates_0(7, 63, 37); + } + return jjMoveStringLiteralDfa8_0(active0, 0x804000000000L); + case 110: + return jjMoveStringLiteralDfa8_0(active0, 0x880001000000000L); + case 112: + if ((active0 & 0x10000000000000L) != 0L) { + return jjStartNfaWithStates_0(7, 52, 37); + } + break; + case 116: + if ((active0 & 0x1000L) != 0L) { + return jjStartNfaWithStates_0(7, 12, 37); + } + break; + default: + break; + } + return jjStartNfa_0(6, active0, 0L, 0L); + } + + private int jjMoveStringLiteralDfa8_0(long old0, long active0) { + if (((active0 &= old0)) == 0L) { + return jjStartNfa_0(6, old0, 0L, 0L); + } + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + jjStopStringLiteralDfa_0(7, active0, 0L, 0L); + return 8; + } + switch (curChar) { + case 100: + if ((active0 & 0x800000000000L) != 0L) { + return jjStartNfaWithStates_0(8, 47, 37); + } + break; + case 101: + if ((active0 & 0x10000000000L) != 0L) { + return jjStartNfaWithStates_0(8, 40, 37); + } + break; + case 105: + return jjMoveStringLiteralDfa9_0(active0, 0x80000000000000L); + case 111: + return jjMoveStringLiteralDfa9_0(active0, 0x4000000000L); + case 116: + if ((active0 & 0x800000000000000L) != 0L) { + return jjStartNfaWithStates_0(8, 59, 37); + } + return jjMoveStringLiteralDfa9_0(active0, 0x1000000000L); + default: + break; + } + return jjStartNfa_0(7, active0, 0L, 0L); + } + + private int jjMoveStringLiteralDfa9_0(long old0, long active0) { + if (((active0 &= old0)) == 0L) { + return jjStartNfa_0(7, old0, 0L, 0L); + } + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + jjStopStringLiteralDfa_0(8, active0, 0L, 0L); + return 9; + } + switch (curChar) { + case 102: + if ((active0 & 0x4000000000L) != 0L) { + return jjStartNfaWithStates_0(9, 38, 37); + } + break; + case 115: + if ((active0 & 0x1000000000L) != 0L) { + return jjStartNfaWithStates_0(9, 36, 37); + } + break; + case 122: + return jjMoveStringLiteralDfa10_0(active0, 0x80000000000000L); + default: + break; + } + return jjStartNfa_0(8, active0, 0L, 0L); + } + + private int jjMoveStringLiteralDfa10_0(long old0, long active0) { + if (((active0 &= old0)) == 0L) { + return jjStartNfa_0(8, old0, 0L, 0L); + } + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + jjStopStringLiteralDfa_0(9, active0, 0L, 0L); + return 10; + } + switch (curChar) { + case 101: + return jjMoveStringLiteralDfa11_0(active0, 0x80000000000000L); + default: + break; + } + return jjStartNfa_0(9, active0, 0L, 0L); + } + + private int jjMoveStringLiteralDfa11_0(long old0, long active0) { + if (((active0 &= old0)) == 0L) { + return jjStartNfa_0(9, old0, 0L, 0L); + } + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + jjStopStringLiteralDfa_0(10, active0, 0L, 0L); + return 11; + } + switch (curChar) { + case 100: + if ((active0 & 0x80000000000000L) != 0L) { + return jjStartNfaWithStates_0(11, 55, 37); + } + break; + default: + break; + } + return jjStartNfa_0(10, active0, 0L, 0L); + } + + private int jjStartNfaWithStates_0(int pos, int kind, int state) { + jjmatchedKind = kind; + jjmatchedPos = pos; + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + return pos + 1; + } + return jjMoveNfa_0(state, pos + 1); + } + + static final long[] jjbitVec0 = { + 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL + }; + + static final long[] jjbitVec2 = { + 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL + }; + + static final long[] jjbitVec3 = { + 0xfff0000000200002L, 0xffffffffffffdfffL, 0xfffff00f7fffffffL, 0x12000000007fffffL + }; + + static final long[] jjbitVec4 = { + 0x0L, 0x0L, 0x420043c00000000L, 0xff7fffffff7fffffL + }; + + static final long[] jjbitVec5 = { + 0x7fffffffffffffL, 0xffffffffffff0000L, 0xffffffffffffffffL, 0x401f0003ffc3L + }; + + static final long[] jjbitVec6 = { + 0x0L, 0x400000000000000L, 0xfffffffbffffd740L, 0xfbfffffffff7fffL + }; + + static final long[] jjbitVec7 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc03L, 0x33fffffffff7fffL + }; + + static final long[] jjbitVec8 = { + 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xffL, 0x707ffffff0000L + }; + + static final long[] jjbitVec9 = { + 0x7fffffe00000000L, 0xfffec000000007ffL, 0xffffffffffffffffL, 0x9c00c060002fffffL + }; + + static final long[] jjbitVec10 = { + 0xfffffffd0000L, 0xe000L, 0x2003fffffffffL, 0x0L + }; + + static final long[] jjbitVec11 = { + 0x23fffffffffffff0L, 0x3ff010000L, 0x23c5fdfffff99fe0L, 0xf0003b0000000L + }; + + static final long[] jjbitVec12 = { + 0x36dfdfffff987e0L, 0x1c00005e000000L, 0x23edfdfffffbbfe0L, 0x2000300010000L + }; + + static final long[] jjbitVec13 = { + 0x23edfdfffff99fe0L, 0x20003b0000000L, 0x3bfc718d63dc7e8L, 0x200000000000000L + }; + + static final long[] jjbitVec14 = { + 0x3effdfffffddfe0L, 0x300000000L, 0x23effdfffffddfe0L, 0x340000000L + }; + + static final long[] jjbitVec15 = { + 0x3fffdfffffddfe0L, 0x300000000L, 0x2ffbfffffc7fffe0L, 0x7fL + }; + + static final long[] jjbitVec16 = { + 0x800dfffffffffffeL, 0x7fL, 0x200decaefef02596L, 0x3000005fL + }; + + static final long[] jjbitVec17 = { + 0x1L, 0x7fffffffeffL, 0xf00L, 0x0L + }; + + static final long[] jjbitVec18 = { + 0x6fbffffffffL, 0x3f0000L, 0xffffffff00000000L, 0x1ffffffffff003fL + }; + + static final long[] jjbitVec19 = { + 0xffffffffffffffffL, 0xffffffff83ffffffL, 0xffffff07ffffffffL, 0x3ffffffffffffffL + }; + + static final long[] jjbitVec20 = { + 0xffffffffffffff7fL, 0xffffffff3d7f3d7fL, 0x7f3d7fffffff3d7fL, 0xffff7fffff7f7f3dL + }; + + static final long[] jjbitVec21 = { + 0xffffffff7f3d7fffL, 0x7ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL + }; + + static final long[] jjbitVec22 = { + 0xffffffffffffffffL, 0x7f9fffffffffffL, 0xffffffff07fffffeL, 0x1c7ffffffffffL + }; + + static final long[] jjbitVec23 = { + 0x3ffff0003dfffL, 0x1dfff0003ffffL, 0xfffffffffffffL, 0x18800000L + }; + + static final long[] jjbitVec24 = { + 0xffffffff00000000L, 0xffffffffffffffL, 0x1ffffffffffL, 0x0L + }; + + static final long[] jjbitVec25 = { + 0x1fffffffL, 0x1f3fffffff0000L, 0x0L, 0x0L + }; + + static final long[] jjbitVec26 = { + 0xffffffffffffffffL, 0xfffffffffffL, 0x0L, 0x0L + }; + + static final long[] jjbitVec27 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffff0fffffffL, 0x3ffffffffffffffL + }; + + static final long[] jjbitVec28 = { + 0xffffffff3f3fffffL, 0x3fffffffaaff3f3fL, 0x5fdfffffffffffffL, 0x1fdc1fff0fcf1fdcL + }; + + static final long[] jjbitVec29 = { + 0x8000000000000000L, 0x8002000000100001L, 0x3ffff00000000L, 0x0L + }; + + static final long[] jjbitVec30 = { + 0xe3fbbd503e2ffc84L, 0xffffffff000003e0L, 0xfL, 0x0L + }; + + static final long[] jjbitVec31 = { + 0x1f3e03fe000000e0L, 0xfffffffffffffffeL, 0xfffffffee07fffffL, 0xffffffffffffffffL + }; + + static final long[] jjbitVec32 = { + 0xfffe1fffffffffe0L, 0xffffffffffffffffL, 0xffffff00007fffL, 0xffff000000000000L + }; + + static final long[] jjbitVec33 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffffffL, 0x0L + }; + + static final long[] jjbitVec34 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0x3fffffffffL, 0x0L + }; + + static final long[] jjbitVec35 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0x1fffL, 0x0L + }; + + static final long[] jjbitVec36 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffL, 0x0L + }; + + static final long[] jjbitVec37 = { + 0x6L, 0x0L, 0x0L, 0x0L + }; + + static final long[] jjbitVec38 = { + 0xffff3fffffffffffL, 0x7ffffffffffL, 0x0L, 0x0L + }; + + static final long[] jjbitVec39 = { + 0x5f7ffdffa0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L + }; + + static final long[] jjbitVec40 = { + 0x3fffffffffffffffL, 0xffffffffffff0000L, 0xfffffffffffcffffL, 0x1fff0000000000ffL + }; + + static final long[] jjbitVec41 = { + 0x18000000000000L, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x1fffffffffffffffL + }; + + static final long[] jjbitVec42 = { + 0x87fffffe00000010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0x631cfcfcfcL + }; + + static final long[] jjbitVec43 = { + 0x0L, 0x0L, 0x420243cffffffffL, 0xff7fffffff7fffffL + }; + + static final long[] jjbitVec44 = { + 0xffffffffffffffffL, 0x400ffffe0ffffffL, 0xfffffffbffffd740L, 0xfbfffffffff7fffL + }; + + static final long[] jjbitVec45 = { + 0xffffffffffffffffL, 0xffffffffffffffffL, 0xfffffffffffffc7bL, 0x33fffffffff7fffL + }; + + static final long[] jjbitVec46 = { + 0xfffe00000000ffffL, 0xfffffffe027fffffL, 0xbbfffffbfffe00ffL, 0x707ffffff0016L + }; + + static final long[] jjbitVec47 = { + 0x7fffffe003f000fL, 0xffffc3ff01ffffffL, 0xffffffffffffffffL, 0x9ffffdffbfefffffL + }; + + static final long[] jjbitVec48 = { + 0xffffffffffff8000L, 0xe7ffL, 0x3ffffffffffffL, 0x0L + }; + + static final long[] jjbitVec49 = { + 0xf3fffffffffffffeL, 0xffcfff1f3fffL, 0xf3c5fdfffff99feeL, 0xfffcfb080399fL + }; + + static final long[] jjbitVec50 = { + 0xd36dfdfffff987eeL, 0x1fffc05e003987L, 0xf3edfdfffffbbfeeL, 0x2ffcf00013bbfL + }; + + static final long[] jjbitVec51 = { + 0xf3edfdfffff99feeL, 0x2ffc3b0c0398fL, 0xc3bfc718d63dc7ecL, 0x200ff8000803dc7L + }; + + static final long[] jjbitVec52 = { + 0xc3effdfffffddfeeL, 0xffc300603ddfL, 0xf3effdfffffddfecL, 0xffc340603ddfL + }; + + static final long[] jjbitVec53 = { + 0xc3fffdfffffddfecL, 0xffc300803dcfL, 0x2ffbfffffc7fffecL, 0xc0000ff5f847fL + }; + + static final long[] jjbitVec54 = { + 0x87fffffffffffffeL, 0x3ff7fffL, 0x3bffecaefef02596L, 0x33ff3f5fL + }; + + static final long[] jjbitVec55 = { + 0xc2a003ff03000001L, 0xfffe07fffffffeffL, 0x1ffffffffeff0fdfL, 0x40L + }; + + static final long[] jjbitVec56 = { + 0x3c7f6fbffffffffL, 0x3ff03ffL, 0xffffffff00000000L, 0x1ffffffffff003fL + }; + + static final long[] jjbitVec57 = { + 0xffffffff7f3d7fffL, 0x3fe0007ffff7fL, 0xffffffff00000000L, 0x1fffffffffffffL + }; + + static final long[] jjbitVec58 = { + 0x1fffff001fdfffL, 0xddfff000fffffL, 0xffffffffffffffffL, 0x3ff388fffffL + }; + + static final long[] jjbitVec59 = { + 0xffffffff03ff3800L, 0xffffffffffffffL, 0x3ffffffffffL, 0x0L + }; + + static final long[] jjbitVec60 = { + 0xfff0fff1fffffffL, 0x1f3fffffffffc0L, 0x0L, 0x0L + }; + + static final long[] jjbitVec61 = { + 0x80007c000000f000L, 0x8002fc0f00100001L, 0x3ffff00000000L, 0x7e21fff0000L + }; + + static final long[] jjbitVec62 = { + 0x1f3efffe000000e0L, 0xfffffffffffffffeL, 0xfffffffee67fffffL, 0xffffffffffffffffL + }; + + static final long[] jjbitVec63 = { + 0x10000000000006L, 0x0L, 0x0L, 0x0L + }; + + static final long[] jjbitVec64 = { + 0x3L, 0x0L, 0x0L, 0x0L + }; + + static final long[] jjbitVec65 = { + 0x0L, 0x800000000000000L, 0x0L, 0x0L + }; + + static final long[] jjbitVec66 = { + 0x5f7ffdffe0f8007fL, 0xffffffffffffffdbL, 0x3ffffffffffffL, 0xfffffffffff80000L + }; + + static final long[] jjbitVec67 = { + 0x18000f0000ffffL, 0xffdf02000000e000L, 0xffffffffffffffffL, 0x9fffffffffffffffL + }; + + static final long[] jjbitVec68 = { + 0x87fffffe03ff0010L, 0xffffffe007fffffeL, 0x7fffffffffffffffL, 0xe0000631cfcfcfcL + }; + + private int jjMoveNfa_0(int startState, int curPos) { + int startsAt = 0; + jjnewStateCnt = 86; + int i = 1; + jjstateSet[0] = startState; + int kind = 0x7fffffff; + for (;;) { + if (++jjround == 0x7fffffff) { + ReInitRounds(); + } + if (curChar < 64) { + long l = 1L << curChar; + do { + switch (jjstateSet[--i]) { + case 54: + if (curChar == 42) { + jjstateSet[jjnewStateCnt++] = 59; + } else if (curChar == 47) { + if (kind > 6) { + kind = 6; + } + jjCheckNAddStates(0, 2); + } + break; + case 0: + if ((0x3ff000000000000L & l) != 0L) { + jjCheckNAddStates(3, 9); + } else if (curChar == 47) { + jjAddStates(10, 11); + } else if (curChar == 36) { + if (kind > 77) { + kind = 77; + } + jjCheckNAdd(37); + } else if (curChar == 34) { + jjCheckNAddStates(12, 15); + } else if (curChar == 39) { + jjAddStates(16, 18); + } else if (curChar == 46) { + jjCheckNAdd(1); + } + if ((0x3fe000000000000L & l) != 0L) { + if (kind > 66) { + kind = 66; + } + jjCheckNAddStates(19, 21); + } else if (curChar == 48) { + if (kind > 66) { + kind = 66; + } + jjCheckNAddStates(22, 28); + } + break; + case 1: + if ((0x3ff000000000000L & l) == 0L) { + break; + } + if (kind > 70) { + kind = 70; + } + jjCheckNAddStates(29, 31); + break; + case 3: + if ((0x280000000000L & l) != 0L) { + jjCheckNAdd(4); + } + break; + case 4: + if ((0x3ff000000000000L & l) == 0L) { + break; + } + if (kind > 70) { + kind = 70; + } + jjCheckNAddTwoStates(4, 5); + break; + case 6: + if (curChar == 39) { + jjAddStates(16, 18); + } + break; + case 7: + if ((0xffffff7fffffdbffL & l) != 0L) { + jjCheckNAdd(8); + } + break; + case 8: + if (curChar == 39 && kind > 75) { + kind = 75; + } + break; + case 10: + if ((0x8400000000L & l) != 0L) { + jjCheckNAdd(8); + } + break; + case 11: + if ((0xff000000000000L & l) != 0L) { + jjCheckNAddTwoStates(12, 8); + } + break; + case 12: + if ((0xff000000000000L & l) != 0L) { + jjCheckNAdd(8); + } + break; + case 13: + if ((0xf000000000000L & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 14; + } + break; + case 14: + if ((0xff000000000000L & l) != 0L) { + jjCheckNAdd(12); + } + break; + case 16: + if ((0x3ff000000000000L & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 17; + } + break; + case 17: + if ((0x3ff000000000000L & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 18; + } + break; + case 18: + if ((0x3ff000000000000L & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 19; + } + break; + case 19: + if ((0x3ff000000000000L & l) != 0L) { + jjCheckNAdd(8); + } + break; + case 21: + if (curChar == 34) { + jjCheckNAddStates(12, 15); + } + break; + case 22: + if ((0xfffffffbffffdbffL & l) != 0L) { + jjCheckNAddStates(12, 15); + } + break; + case 24: + if ((0x8400000000L & l) != 0L) { + jjCheckNAddStates(12, 15); + } + break; + case 26: + if ((0x3ff000000000000L & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 27; + } + break; + case 27: + if ((0x3ff000000000000L & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 28; + } + break; + case 28: + if ((0x3ff000000000000L & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 29; + } + break; + case 29: + if ((0x3ff000000000000L & l) != 0L) { + jjCheckNAddStates(12, 15); + } + break; + case 31: + if (curChar == 34 && kind > 76) { + kind = 76; + } + break; + case 32: + if ((0xff000000000000L & l) != 0L) { + jjCheckNAddStates(32, 36); + } + break; + case 33: + if ((0xff000000000000L & l) != 0L) { + jjCheckNAddStates(12, 15); + } + break; + case 34: + if ((0xf000000000000L & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 35; + } + break; + case 35: + if ((0xff000000000000L & l) != 0L) { + jjCheckNAdd(33); + } + break; + case 36: + if (curChar != 36) { + break; + } + if (kind > 77) { + kind = 77; + } + jjCheckNAdd(37); + break; + case 37: + if ((0x3ff00100fffc1ffL & l) == 0L) { + break; + } + if (kind > 77) { + kind = 77; + } + jjCheckNAdd(37); + break; + case 38: + if ((0x3ff000000000000L & l) != 0L) { + jjCheckNAddStates(3, 9); + } + break; + case 39: + if ((0x3ff000000000000L & l) != 0L) { + jjCheckNAddStates(37, 39); + } + break; + case 41: + if ((0x280000000000L & l) != 0L) { + jjCheckNAdd(42); + } + break; + case 42: + if ((0x3ff000000000000L & l) != 0L) { + jjCheckNAddTwoStates(42, 5); + } + break; + case 43: + if ((0x3ff000000000000L & l) != 0L) { + jjCheckNAddTwoStates(43, 44); + } + break; + case 45: + if ((0x280000000000L & l) != 0L) { + jjCheckNAdd(46); + } + break; + case 46: + if ((0x3ff000000000000L & l) == 0L) { + break; + } + if (kind > 70) { + kind = 70; + } + jjCheckNAddTwoStates(46, 5); + break; + case 47: + if ((0x3ff000000000000L & l) != 0L) { + jjCheckNAddTwoStates(47, 48); + } + break; + case 48: + if (curChar != 46) { + break; + } + if (kind > 70) { + kind = 70; + } + jjCheckNAddStates(40, 42); + break; + case 49: + if ((0x3ff000000000000L & l) == 0L) { + break; + } + if (kind > 70) { + kind = 70; + } + jjCheckNAddStates(40, 42); + break; + case 51: + if ((0x280000000000L & l) != 0L) { + jjCheckNAdd(52); + } + break; + case 52: + if ((0x3ff000000000000L & l) == 0L) { + break; + } + if (kind > 70) { + kind = 70; + } + jjCheckNAddTwoStates(52, 5); + break; + case 53: + if (curChar == 47) { + jjAddStates(10, 11); + } + break; + case 55: + if ((0xffffffffffffdbffL & l) == 0L) { + break; + } + if (kind > 6) { + kind = 6; + } + jjCheckNAddStates(0, 2); + break; + case 56: + if ((0x2400L & l) != 0L && kind > 6) { + kind = 6; + } + break; + case 57: + if (curChar == 10 && kind > 6) { + kind = 6; + } + break; + case 58: + if (curChar == 13) { + jjstateSet[jjnewStateCnt++] = 57; + } + break; + case 59: + if (curChar == 42) { + jjstateSet[jjnewStateCnt++] = 60; + } + break; + case 60: + if ((0xffff7fffffffffffL & l) != 0L && kind > 7) { + kind = 7; + } + break; + case 61: + if (curChar == 42) { + jjstateSet[jjnewStateCnt++] = 59; + } + break; + case 62: + if ((0x3fe000000000000L & l) == 0L) { + break; + } + if (kind > 66) { + kind = 66; + } + jjCheckNAddStates(19, 21); + break; + case 63: + if ((0x3ff000000000000L & l) != 0L) { + jjCheckNAddTwoStates(63, 64); + } + break; + case 65: + if ((0x3ff000000000000L & l) == 0L) { + break; + } + if (kind > 66) { + kind = 66; + } + jjCheckNAdd(65); + break; + case 66: + if (curChar != 48) { + break; + } + if (kind > 66) { + kind = 66; + } + jjCheckNAddStates(22, 28); + break; + case 68: + if ((0x3ff000000000000L & l) != 0L) { + jjCheckNAddTwoStates(68, 64); + } + break; + case 69: + if ((0xff000000000000L & l) != 0L) { + jjCheckNAddTwoStates(69, 64); + } + break; + case 71: + if ((0x3ff000000000000L & l) == 0L) { + break; + } + if (kind > 66) { + kind = 66; + } + jjstateSet[jjnewStateCnt++] = 71; + break; + case 72: + if ((0xff000000000000L & l) == 0L) { + break; + } + if (kind > 66) { + kind = 66; + } + jjCheckNAdd(72); + break; + case 74: + if ((0x3ff000000000000L & l) != 0L) { + jjAddStates(43, 44); + } + break; + case 75: + if (curChar == 46) { + jjCheckNAdd(76); + } + break; + case 76: + if ((0x3ff000000000000L & l) != 0L) { + jjCheckNAddTwoStates(76, 77); + } + break; + case 78: + if ((0x280000000000L & l) != 0L) { + jjCheckNAdd(79); + } + break; + case 79: + if ((0x3ff000000000000L & l) == 0L) { + break; + } + if (kind > 70) { + kind = 70; + } + jjCheckNAddTwoStates(79, 5); + break; + case 81: + if ((0x3ff000000000000L & l) != 0L) { + jjCheckNAddStates(45, 47); + } + break; + case 82: + if (curChar == 46) { + jjCheckNAdd(83); + } + break; + case 84: + if ((0x280000000000L & l) != 0L) { + jjCheckNAdd(85); + } + break; + case 85: + if ((0x3ff000000000000L & l) == 0L) { + break; + } + if (kind > 70) { + kind = 70; + } + jjCheckNAddTwoStates(85, 5); + break; + default: + break; + } + } while (i != startsAt); + } else if (curChar < 128) { + long l = 1L << (curChar & 077); + do { + switch (jjstateSet[--i]) { + case 0: + if ((0x7fffffe87fffffeL & l) == 0L) { + break; + } + if (kind > 77) { + kind = 77; + } + jjCheckNAdd(37); + break; + case 2: + if ((0x2000000020L & l) != 0L) { + jjAddStates(48, 49); + } + break; + case 5: + if ((0x5000000050L & l) != 0L && kind > 70) { + kind = 70; + } + break; + case 7: + if ((0xffffffffefffffffL & l) != 0L) { + jjCheckNAdd(8); + } + break; + case 9: + if (curChar == 92) { + jjAddStates(50, 52); + } + break; + case 10: + if ((0x14404410000000L & l) != 0L) { + jjCheckNAdd(8); + } + break; + case 15: + if (curChar == 117) { + jjstateSet[jjnewStateCnt++] = 16; + } + break; + case 16: + if ((0x7e0000007eL & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 17; + } + break; + case 17: + if ((0x7e0000007eL & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 18; + } + break; + case 18: + if ((0x7e0000007eL & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 19; + } + break; + case 19: + if ((0x7e0000007eL & l) != 0L) { + jjCheckNAdd(8); + } + break; + case 20: + if (curChar == 92) { + jjstateSet[jjnewStateCnt++] = 15; + } + break; + case 22: + if ((0xffffffffefffffffL & l) != 0L) { + jjCheckNAddStates(12, 15); + } + break; + case 23: + if (curChar == 92) { + jjAddStates(53, 55); + } + break; + case 24: + if ((0x14404410000000L & l) != 0L) { + jjCheckNAddStates(12, 15); + } + break; + case 25: + if (curChar == 117) { + jjstateSet[jjnewStateCnt++] = 26; + } + break; + case 26: + if ((0x7e0000007eL & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 27; + } + break; + case 27: + if ((0x7e0000007eL & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 28; + } + break; + case 28: + if ((0x7e0000007eL & l) != 0L) { + jjstateSet[jjnewStateCnt++] = 29; + } + break; + case 29: + if ((0x7e0000007eL & l) != 0L) { + jjCheckNAddStates(12, 15); + } + break; + case 30: + if (curChar == 92) { + jjstateSet[jjnewStateCnt++] = 25; + } + break; + case 37: + if ((0x87fffffe87fffffeL & l) == 0L) { + break; + } + if (kind > 77) { + kind = 77; + } + jjCheckNAdd(37); + break; + case 40: + if ((0x2000000020L & l) != 0L) { + jjAddStates(56, 57); + } + break; + case 44: + if ((0x2000000020L & l) != 0L) { + jjAddStates(58, 59); + } + break; + case 50: + if ((0x2000000020L & l) != 0L) { + jjAddStates(60, 61); + } + break; + case 55: + if (kind > 6) { + kind = 6; + } + jjAddStates(0, 2); + break; + case 60: + if (kind > 7) { + kind = 7; + } + break; + case 64: + if ((0x100000001000L & l) != 0L && kind > 65) { + kind = 65; + } + break; + case 67: + if ((0x100000001000000L & l) != 0L) { + jjCheckNAdd(68); + } + break; + case 68: + if ((0x7e0000007eL & l) != 0L) { + jjCheckNAddTwoStates(68, 64); + } + break; + case 70: + if ((0x100000001000000L & l) != 0L) { + jjCheckNAdd(71); + } + break; + case 71: + if ((0x7e0000007eL & l) == 0L) { + break; + } + if (kind > 66) { + kind = 66; + } + jjCheckNAdd(71); + break; + case 73: + if ((0x100000001000000L & l) != 0L) { + jjCheckNAddTwoStates(74, 75); + } + break; + case 74: + if ((0x7e0000007eL & l) != 0L) { + jjCheckNAddTwoStates(74, 75); + } + break; + case 76: + if ((0x7e0000007eL & l) != 0L) { + jjAddStates(62, 63); + } + break; + case 77: + if ((0x1000000010000L & l) != 0L) { + jjAddStates(64, 65); + } + break; + case 80: + if ((0x100000001000000L & l) != 0L) { + jjCheckNAdd(81); + } + break; + case 81: + if ((0x7e0000007eL & l) != 0L) { + jjCheckNAddStates(45, 47); + } + break; + case 83: + if ((0x1000000010000L & l) != 0L) { + jjAddStates(66, 67); + } + break; + default: + break; + } + } while (i != startsAt); + } else { + int hiByte = curChar >> 8; + int i1 = hiByte >> 6; + long l1 = 1L << (hiByte & 077); + int i2 = (curChar & 0xff) >> 6; + long l2 = 1L << (curChar & 077); + do { + switch (jjstateSet[--i]) { + case 0: + if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) { + break; + } + if (kind > 77) { + kind = 77; + } + jjCheckNAdd(37); + break; + case 7: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { + jjstateSet[jjnewStateCnt++] = 8; + } + break; + case 22: + if (jjCanMove_0(hiByte, i1, i2, l1, l2)) { + jjAddStates(12, 15); + } + break; + case 37: + if (!jjCanMove_2(hiByte, i1, i2, l1, l2)) { + break; + } + if (kind > 77) { + kind = 77; + } + jjCheckNAdd(37); + break; + case 55: + if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) { + break; + } + if (kind > 6) { + kind = 6; + } + jjAddStates(0, 2); + break; + case 60: + if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 7) { + kind = 7; + } + break; + default: + break; + } + } while (i != startsAt); + } + if (kind != 0x7fffffff) { + jjmatchedKind = kind; + jjmatchedPos = curPos; + kind = 0x7fffffff; + } + ++curPos; + if ((i = jjnewStateCnt) == (startsAt = 86 - (jjnewStateCnt = startsAt))) { + return curPos; + } + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + return curPos; + } + } + } + + private int jjMoveStringLiteralDfa0_2() { + switch (curChar) { + case 42: + return jjMoveStringLiteralDfa1_2(0x400L); + default: + return 1; + } + } + + private int jjMoveStringLiteralDfa1_2(long active0) { + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + return 1; + } + switch (curChar) { + case 47: + if ((active0 & 0x400L) != 0L) { + return jjStopAtPos(1, 10); + } + break; + default: + return 2; + } + return 2; + } + + private int jjMoveStringLiteralDfa0_1() { + switch (curChar) { + case 42: + return jjMoveStringLiteralDfa1_1(0x200L); + default: + return 1; + } + } + + private int jjMoveStringLiteralDfa1_1(long active0) { + try { + curChar = input_stream.readChar(); + } catch (java.io.IOException e) { + return 1; + } + switch (curChar) { + case 47: + if ((active0 & 0x200L) != 0L) { + return jjStopAtPos(1, 9); + } + break; + default: + return 2; + } + return 2; + } + + static final int[] jjnextStates = { + 55, 56, 58, 39, 40, 5, 43, 44, 47, 48, 54, 61, 22, 23, 30, 31, + 7, 9, 20, 63, 64, 65, 67, 69, 64, 70, 72, 73, 80, 1, 2, 5, + 22, 23, 33, 30, 31, 39, 40, 5, 49, 50, 5, 74, 75, 81, 82, 83, + 3, 4, 10, 11, 13, 24, 32, 34, 41, 42, 45, 46, 51, 52, 76, 77, + 78, 79, 84, 85, + }; + + private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) { + switch (hiByte) { + case 0: + return ((jjbitVec2[i2] & l2) != 0L); + default: + if ((jjbitVec0[i1] & l1) != 0L) { + return true; + } + return false; + } + } + + private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2) { + switch (hiByte) { + case 0: + return ((jjbitVec4[i2] & l2) != 0L); + case 2: + return ((jjbitVec5[i2] & l2) != 0L); + case 3: + return ((jjbitVec6[i2] & l2) != 0L); + case 4: + return ((jjbitVec7[i2] & l2) != 0L); + case 5: + return ((jjbitVec8[i2] & l2) != 0L); + case 6: + return ((jjbitVec9[i2] & l2) != 0L); + case 7: + return ((jjbitVec10[i2] & l2) != 0L); + case 9: + return ((jjbitVec11[i2] & l2) != 0L); + case 10: + return ((jjbitVec12[i2] & l2) != 0L); + case 11: + return ((jjbitVec13[i2] & l2) != 0L); + case 12: + return ((jjbitVec14[i2] & l2) != 0L); + case 13: + return ((jjbitVec15[i2] & l2) != 0L); + case 14: + return ((jjbitVec16[i2] & l2) != 0L); + case 15: + return ((jjbitVec17[i2] & l2) != 0L); + case 16: + return ((jjbitVec18[i2] & l2) != 0L); + case 17: + return ((jjbitVec19[i2] & l2) != 0L); + case 18: + return ((jjbitVec20[i2] & l2) != 0L); + case 19: + return ((jjbitVec21[i2] & l2) != 0L); + case 20: + return ((jjbitVec0[i2] & l2) != 0L); + case 22: + return ((jjbitVec22[i2] & l2) != 0L); + case 23: + return ((jjbitVec23[i2] & l2) != 0L); + case 24: + return ((jjbitVec24[i2] & l2) != 0L); + case 25: + return ((jjbitVec25[i2] & l2) != 0L); + case 29: + return ((jjbitVec26[i2] & l2) != 0L); + case 30: + return ((jjbitVec27[i2] & l2) != 0L); + case 31: + return ((jjbitVec28[i2] & l2) != 0L); + case 32: + return ((jjbitVec29[i2] & l2) != 0L); + case 33: + return ((jjbitVec30[i2] & l2) != 0L); + case 48: + return ((jjbitVec31[i2] & l2) != 0L); + case 49: + return ((jjbitVec32[i2] & l2) != 0L); + case 77: + return ((jjbitVec33[i2] & l2) != 0L); + case 159: + return ((jjbitVec34[i2] & l2) != 0L); + case 164: + return ((jjbitVec35[i2] & l2) != 0L); + case 215: + return ((jjbitVec36[i2] & l2) != 0L); + case 216: + return ((jjbitVec37[i2] & l2) != 0L); + case 250: + return ((jjbitVec38[i2] & l2) != 0L); + case 251: + return ((jjbitVec39[i2] & l2) != 0L); + case 253: + return ((jjbitVec40[i2] & l2) != 0L); + case 254: + return ((jjbitVec41[i2] & l2) != 0L); + case 255: + return ((jjbitVec42[i2] & l2) != 0L); + default: + if ((jjbitVec3[i1] & l1) != 0L) { + return true; + } + return false; + } + } + + private static final boolean jjCanMove_2(int hiByte, int i1, int i2, long l1, long l2) { + switch (hiByte) { + case 0: + return ((jjbitVec43[i2] & l2) != 0L); + case 2: + return ((jjbitVec5[i2] & l2) != 0L); + case 3: + return ((jjbitVec44[i2] & l2) != 0L); + case 4: + return ((jjbitVec45[i2] & l2) != 0L); + case 5: + return ((jjbitVec46[i2] & l2) != 0L); + case 6: + return ((jjbitVec47[i2] & l2) != 0L); + case 7: + return ((jjbitVec48[i2] & l2) != 0L); + case 9: + return ((jjbitVec49[i2] & l2) != 0L); + case 10: + return ((jjbitVec50[i2] & l2) != 0L); + case 11: + return ((jjbitVec51[i2] & l2) != 0L); + case 12: + return ((jjbitVec52[i2] & l2) != 0L); + case 13: + return ((jjbitVec53[i2] & l2) != 0L); + case 14: + return ((jjbitVec54[i2] & l2) != 0L); + case 15: + return ((jjbitVec55[i2] & l2) != 0L); + case 16: + return ((jjbitVec56[i2] & l2) != 0L); + case 17: + return ((jjbitVec19[i2] & l2) != 0L); + case 18: + return ((jjbitVec20[i2] & l2) != 0L); + case 19: + return ((jjbitVec57[i2] & l2) != 0L); + case 20: + return ((jjbitVec0[i2] & l2) != 0L); + case 22: + return ((jjbitVec22[i2] & l2) != 0L); + case 23: + return ((jjbitVec58[i2] & l2) != 0L); + case 24: + return ((jjbitVec59[i2] & l2) != 0L); + case 25: + return ((jjbitVec60[i2] & l2) != 0L); + case 29: + return ((jjbitVec26[i2] & l2) != 0L); + case 30: + return ((jjbitVec27[i2] & l2) != 0L); + case 31: + return ((jjbitVec28[i2] & l2) != 0L); + case 32: + return ((jjbitVec61[i2] & l2) != 0L); + case 33: + return ((jjbitVec30[i2] & l2) != 0L); + case 48: + return ((jjbitVec62[i2] & l2) != 0L); + case 49: + return ((jjbitVec32[i2] & l2) != 0L); + case 77: + return ((jjbitVec33[i2] & l2) != 0L); + case 159: + return ((jjbitVec34[i2] & l2) != 0L); + case 164: + return ((jjbitVec35[i2] & l2) != 0L); + case 215: + return ((jjbitVec36[i2] & l2) != 0L); + case 216: + return ((jjbitVec63[i2] & l2) != 0L); + case 220: + return ((jjbitVec64[i2] & l2) != 0L); + case 221: + return ((jjbitVec65[i2] & l2) != 0L); + case 250: + return ((jjbitVec38[i2] & l2) != 0L); + case 251: + return ((jjbitVec66[i2] & l2) != 0L); + case 253: + return ((jjbitVec40[i2] & l2) != 0L); + case 254: + return ((jjbitVec67[i2] & l2) != 0L); + case 255: + return ((jjbitVec68[i2] & l2) != 0L); + default: + if ((jjbitVec3[i1] & l1) != 0L) { + return true; + } + return false; + } + } + + /** Token literal values. */ + public static final String[] jjstrLiteralImages = { + "", null, null, null, null, null, null, null, null, null, null, null, + "\141\142\163\164\162\141\143\164", "\141\163\163\145\162\164", "\142\157\157\154\145\141\156", + "\142\162\145\141\153", "\142\171\164\145", "\143\141\163\145", "\143\141\164\143\150", + "\143\150\141\162", "\143\154\141\163\163", "\143\157\156\163\164", + "\143\157\156\164\151\156\165\145", "\144\145\146\141\165\154\164", "\144\157", "\144\157\165\142\154\145", + "\145\154\163\145", "\145\156\165\155", "\145\170\164\145\156\144\163", "\146\141\154\163\145", + "\146\151\156\141\154", "\146\151\156\141\154\154\171", "\146\154\157\141\164", "\146\157\162", + "\147\157\164\157", "\151\146", "\151\155\160\154\145\155\145\156\164\163", + "\151\155\160\157\162\164", "\151\156\163\164\141\156\143\145\157\146", "\151\156\164", + "\151\156\164\145\162\146\141\143\145", "\154\157\156\147", "\156\141\164\151\166\145", "\156\145\167", + "\156\165\154\154", "\160\141\143\153\141\147\145", "\160\162\151\166\141\164\145", + "\160\162\157\164\145\143\164\145\144", "\160\165\142\154\151\143", "\162\145\164\165\162\156", + "\163\150\157\162\164", "\163\164\141\164\151\143", "\163\164\162\151\143\164\146\160", + "\163\165\160\145\162", "\163\167\151\164\143\150", + "\163\171\156\143\150\162\157\156\151\172\145\144", "\164\150\151\163", "\164\150\162\157\167", "\164\150\162\157\167\163", + "\164\162\141\156\163\151\145\156\164", "\164\162\165\145", "\164\162\171", "\166\157\151\144", + "\166\157\154\141\164\151\154\145", "\167\150\151\154\145", null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, "\50", "\51", "\173", "\175", "\133", "\135", + "\73", "\54", "\56", "\100", "\75", "\74", "\41", "\176", "\77", "\72", "\75\75", + "\74\75", "\76\75", "\41\75", "\174\174", "\46\46", "\53\53", "\55\55", "\53", "\55", + "\52", "\57", "\46", "\174", "\136", "\45", "\74\74", "\53\75", "\55\75", "\52\75", + "\57\75", "\46\75", "\174\75", "\136\75", "\45\75", "\74\74\75", "\76\76\75", + "\76\76\76\75", "\56\56\56", "\76\76\76", "\76\76", "\76", "\32", }; + + /** Lexer state names. */ + public static final String[] lexStateNames = { + "DEFAULT", + "IN_JAVA_DOC_COMMENT", + "IN_MULTI_LINE_COMMENT", + }; + + /** Lex State array. */ + public static final int[] jjnewLexState = { + -1, -1, -1, -1, -1, -1, -1, 1, 2, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, + }; + + static final long[] jjtoToken = { + 0xfffffffffffff001L, 0xffffffffffff3847L, 0x1L, + }; + + static final long[] jjtoSkip = { + 0x67eL, 0x0L, 0x0L, + }; + + static final long[] jjtoSpecial = { + 0x640L, 0x0L, 0x0L, + }; + + static final long[] jjtoMore = { + 0x980L, 0x0L, 0x0L, + }; + + protected JavaCharStream input_stream; + + private final int[] jjrounds = new int[86]; + + private final int[] jjstateSet = new int[172]; + + private final StringBuilder jjimage = new StringBuilder(); + + private StringBuilder image = jjimage; + + private int jjimageLen; + + private int lengthOfMatch; + + protected char curChar; + + /** Constructor. */ + public ASTParserTokenManager(JavaCharStream stream) { + if (JavaCharStream.staticFlag) { + throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); + } + input_stream = stream; + } + + /** Constructor. */ + public ASTParserTokenManager(JavaCharStream stream, int lexState) { + this(stream); + SwitchTo(lexState); + } + + /** Reinitialise parser. */ + public void ReInit(JavaCharStream stream) { + jjmatchedPos = jjnewStateCnt = 0; + curLexState = defaultLexState; + input_stream = stream; + ReInitRounds(); + } + + private void ReInitRounds() { + int i; + jjround = 0x80000001; + for (i = 86; i-- > 0;) { + jjrounds[i] = 0x80000000; + } + } + + /** Reinitialise parser. */ + public void ReInit(JavaCharStream stream, int lexState) { + ReInit(stream); + SwitchTo(lexState); + } + + /** Switch to specified lex state. */ + public void SwitchTo(int lexState) { + if (lexState >= 3 || lexState < 0) { + throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); + } else { + curLexState = lexState; + } + } + + protected Token jjFillToken() { + final Token t; + final String curTokenImage; + final int beginLine; + final int endLine; + final int beginColumn; + final int endColumn; + String im = jjstrLiteralImages[jjmatchedKind]; + curTokenImage = (im == null) ? input_stream.GetImage() : im; + beginLine = input_stream.getBeginLine(); + beginColumn = input_stream.getBeginColumn(); + endLine = input_stream.getEndLine(); + endColumn = input_stream.getEndColumn(); + t = ASTParser.GTToken.newToken(jjmatchedKind, curTokenImage); + + t.beginLine = beginLine; + t.endLine = endLine; + t.beginColumn = beginColumn; + t.endColumn = endColumn; + + return t; + } + + int curLexState = 0; + + int defaultLexState = 0; + + int jjnewStateCnt; + + int jjround; + + int jjmatchedPos; + + int jjmatchedKind; + + /** Get the next Token. */ + public Token getNextToken() { + Token specialToken = null; + Token matchedToken; + int curPos = 0; + + EOFLoop: for (;;) { + try { + curChar = input_stream.BeginToken(); + } catch (java.io.IOException e) { + jjmatchedKind = 0; + matchedToken = jjFillToken(); + matchedToken.specialToken = specialToken; + CommonTokenAction(matchedToken); + return matchedToken; + } + image = jjimage; + image.setLength(0); + jjimageLen = 0; + + for (;;) { + switch (curLexState) { + case 0: + try { + input_stream.backup(0); + while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) { + curChar = input_stream.BeginToken(); + } + } catch (java.io.IOException e1) { + continue EOFLoop; + } + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_0(); + break; + case 1: + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_1(); + if (jjmatchedPos == 0 && jjmatchedKind > 11) { + jjmatchedKind = 11; + } + break; + case 2: + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_2(); + if (jjmatchedPos == 0 && jjmatchedKind > 11) { + jjmatchedKind = 11; + } + break; + } + if (jjmatchedKind != 0x7fffffff) { + if (jjmatchedPos + 1 < curPos) { + input_stream.backup(curPos - jjmatchedPos - 1); + } + if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { + matchedToken = jjFillToken(); + matchedToken.specialToken = specialToken; + TokenLexicalActions(matchedToken); + if (jjnewLexState[jjmatchedKind] != -1) { + curLexState = jjnewLexState[jjmatchedKind]; + } + CommonTokenAction(matchedToken); + return matchedToken; + } else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { + if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) { + matchedToken = jjFillToken(); + if (specialToken == null) { + specialToken = matchedToken; + } else { + matchedToken.specialToken = specialToken; + specialToken = (specialToken.next = matchedToken); + } + SkipLexicalActions(matchedToken); + } else { + SkipLexicalActions(null); + } + if (jjnewLexState[jjmatchedKind] != -1) { + curLexState = jjnewLexState[jjmatchedKind]; + } + continue EOFLoop; + } + MoreLexicalActions(); + if (jjnewLexState[jjmatchedKind] != -1) { + curLexState = jjnewLexState[jjmatchedKind]; + } + curPos = 0; + jjmatchedKind = 0x7fffffff; + try { + curChar = input_stream.readChar(); + continue; + } catch (java.io.IOException e1) { + } + } + int error_line = input_stream.getEndLine(); + int error_column = input_stream.getEndColumn(); + String error_after = null; + boolean EOFSeen = false; + try { + input_stream.readChar(); + input_stream.backup(1); + } catch (java.io.IOException e1) { + EOFSeen = true; + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + if (curChar == '\n' || curChar == '\r') { + error_line++; + error_column = 0; + } else { + error_column++; + } + } + if (!EOFSeen) { + input_stream.backup(1); + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + } + throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); + } + } + } + + void SkipLexicalActions(Token matchedToken) { + switch (jjmatchedKind) { + default: + break; + } + } + + void MoreLexicalActions() { + jjimageLen += (lengthOfMatch = jjmatchedPos + 1); + switch (jjmatchedKind) { + case 7: + image.append(input_stream.GetSuffix(jjimageLen)); + jjimageLen = 0; + input_stream.backup(1); + break; + default: + break; + } + } + + void TokenLexicalActions(Token matchedToken) { + switch (jjmatchedKind) { + case 125: + image.append(jjstrLiteralImages[125]); + lengthOfMatch = jjstrLiteralImages[125].length(); + matchedToken.kind = GT; + ((ASTParser.GTToken) matchedToken).realKind = RUNSIGNEDSHIFT; + input_stream.backup(2); + break; + case 126: + image.append(jjstrLiteralImages[126]); + lengthOfMatch = jjstrLiteralImages[126].length(); + matchedToken.kind = GT; + ((ASTParser.GTToken) matchedToken).realKind = RSIGNEDSHIFT; + input_stream.backup(1); + break; + default: + break; + } + } + + private void jjCheckNAdd(int state) { + if (jjrounds[state] != jjround) { + jjstateSet[jjnewStateCnt++] = state; + jjrounds[state] = jjround; + } + } + + private void jjAddStates(int start, int end) { + do { + jjstateSet[jjnewStateCnt++] = jjnextStates[start]; + } while (start++ != end); + } + + private void jjCheckNAddTwoStates(int state1, int state2) { + jjCheckNAdd(state1); + jjCheckNAdd(state2); + } + + private void jjCheckNAddStates(int start, int end) { + do { + jjCheckNAdd(jjnextStates[start]); + } while (start++ != end); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaCharStream.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaCharStream.java new file mode 100644 index 00000000000..b094f6dbaf4 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaCharStream.java @@ -0,0 +1,599 @@ +/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 4.1 */ +/* JavaCCOptions:STATIC=false */ +/* + * Copyright (C) 2008 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +package japa.parser; + +/** + * An implementation of interface CharStream, where the stream is assumed to + * contain only ASCII characters (with java-like unicode escape processing). + */ + +public class JavaCharStream { + + /** Whether parser is static. */ + public static final boolean staticFlag = false; + + static final int hexval(char c) throws java.io.IOException { + switch (c) { + case '0': + return 0; + case '1': + return 1; + case '2': + return 2; + case '3': + return 3; + case '4': + return 4; + case '5': + return 5; + case '6': + return 6; + case '7': + return 7; + case '8': + return 8; + case '9': + return 9; + + case 'a': + case 'A': + return 10; + case 'b': + case 'B': + return 11; + case 'c': + case 'C': + return 12; + case 'd': + case 'D': + return 13; + case 'e': + case 'E': + return 14; + case 'f': + case 'F': + return 15; + } + + throw new java.io.IOException(); // Should never come here + } + + /** Position in buffer. */ + public int bufpos = -1; + + int bufsize; + + int available; + + int tokenBegin; + + protected int bufline[]; + + protected int bufcolumn[]; + + protected int column = 0; + + protected int line = 1; + + protected boolean prevCharIsCR = false; + + protected boolean prevCharIsLF = false; + + protected java.io.Reader inputStream; + + protected char[] nextCharBuf; + + protected char[] buffer; + + protected int maxNextCharInd = 0; + + protected int nextCharInd = -1; + + protected int inBuf = 0; + + protected int tabSize = 8; + + protected void setTabSize(int i) { + tabSize = i; + } + + protected int getTabSize(int i) { + return tabSize; + } + + protected void ExpandBuff(boolean wrapAround) { + char[] newbuffer = new char[bufsize + 2048]; + int newbufline[] = new int[bufsize + 2048]; + int newbufcolumn[] = new int[bufsize + 2048]; + + try { + if (wrapAround) { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + System.arraycopy(buffer, 0, newbuffer, + bufsize - tokenBegin, bufpos); + buffer = newbuffer; + + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); + bufline = newbufline; + + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); + bufcolumn = newbufcolumn; + + bufpos += (bufsize - tokenBegin); + } else { + System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); + buffer = newbuffer; + + System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); + bufline = newbufline; + + System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); + bufcolumn = newbufcolumn; + + bufpos -= tokenBegin; + } + } catch (Throwable t) { + throw new Error(t.getMessage()); + } + + available = (bufsize += 2048); + tokenBegin = 0; + } + + protected void FillBuff() throws java.io.IOException { + int i; + if (maxNextCharInd == 4096) { + maxNextCharInd = nextCharInd = 0; + } + + try { + if ((i = inputStream.read(nextCharBuf, maxNextCharInd, + 4096 - maxNextCharInd)) == -1) { + inputStream.close(); + throw new java.io.IOException(); + } else { + maxNextCharInd += i; + } + return; + } catch (java.io.IOException e) { + if (bufpos != 0) { + --bufpos; + backup(0); + } else { + bufline[bufpos] = line; + bufcolumn[bufpos] = column; + } + throw e; + } + } + + protected char ReadByte() throws java.io.IOException { + if (++nextCharInd >= maxNextCharInd) { + FillBuff(); + } + + return nextCharBuf[nextCharInd]; + } + + /** @return starting character for token. */ + public char BeginToken() throws java.io.IOException { + if (inBuf > 0) { + --inBuf; + + if (++bufpos == bufsize) { + bufpos = 0; + } + + tokenBegin = bufpos; + return buffer[bufpos]; + } + + tokenBegin = 0; + bufpos = -1; + + return readChar(); + } + + protected void AdjustBuffSize() { + if (available == bufsize) { + if (tokenBegin > 2048) { + bufpos = 0; + available = tokenBegin; + } else { + ExpandBuff(false); + } + } else if (available > tokenBegin) { + available = bufsize; + } else if ((tokenBegin - available) < 2048) { + ExpandBuff(true); + } else { + available = tokenBegin; + } + } + + protected void UpdateLineColumn(char c) { + column++; + + if (prevCharIsLF) { + prevCharIsLF = false; + line += (column = 1); + } else if (prevCharIsCR) { + prevCharIsCR = false; + if (c == '\n') { + prevCharIsLF = true; + } else { + line += (column = 1); + } + } + + switch (c) { + case '\r': + prevCharIsCR = true; + break; + case '\n': + prevCharIsLF = true; + break; + case '\t': + column--; + column += (tabSize - (column % tabSize)); + break; + default: + break; + } + + bufline[bufpos] = line; + bufcolumn[bufpos] = column; + } + + /** Read a character. */ + public char readChar() throws java.io.IOException { + if (inBuf > 0) { + --inBuf; + + if (++bufpos == bufsize) { + bufpos = 0; + } + + return buffer[bufpos]; + } + + char c; + + if (++bufpos == available) { + AdjustBuffSize(); + } + + if ((buffer[bufpos] = c = ReadByte()) == '\\') { + UpdateLineColumn(c); + + int backSlashCnt = 1; + + for (;;) // Read all the backslashes + { + if (++bufpos == available) { + AdjustBuffSize(); + } + + try { + if ((buffer[bufpos] = c = ReadByte()) != '\\') { + UpdateLineColumn(c); + // found a non-backslash char. + if ((c == 'u') && ((backSlashCnt & 1) == 1)) { + if (--bufpos < 0) { + bufpos = bufsize - 1; + } + + break; + } + + backup(backSlashCnt); + return '\\'; + } + } catch (java.io.IOException e) { + if (backSlashCnt > 1) { + backup(backSlashCnt - 1); + } + + return '\\'; + } + + UpdateLineColumn(c); + backSlashCnt++; + } + + // Here, we have seen an odd number of backslash's followed by a 'u' + try { + while ((c = ReadByte()) == 'u') { + ++column; + } + + buffer[bufpos] = c = (char) (hexval(c) << 12 | + hexval(ReadByte()) << 8 | + hexval(ReadByte()) << 4 | + hexval(ReadByte())); + + column += 4; + } catch (java.io.IOException e) { + throw new Error("Invalid escape character at line " + line + + " column " + column + "."); + } + + if (backSlashCnt == 1) { + return c; + } else { + backup(backSlashCnt - 1); + return '\\'; + } + } else { + UpdateLineColumn(c); + return c; + } + } + + @Deprecated + /** + * @deprecated + * @see #getEndColumn + */ + public int getColumn() { + return bufcolumn[bufpos]; + } + + @Deprecated + /** + * @deprecated + * @see #getEndLine + */ + public int getLine() { + return bufline[bufpos]; + } + + /** Get end column. */ + public int getEndColumn() { + return bufcolumn[bufpos]; + } + + /** Get end line. */ + public int getEndLine() { + return bufline[bufpos]; + } + + /** @return column of token start */ + public int getBeginColumn() { + return bufcolumn[tokenBegin]; + } + + /** @return line number of token start */ + public int getBeginLine() { + return bufline[tokenBegin]; + } + + /** Retreat. */ + public void backup(int amount) { + + inBuf += amount; + if ((bufpos -= amount) < 0) { + bufpos += bufsize; + } + } + + /** Constructor. */ + public JavaCharStream(java.io.Reader dstream, + int startline, int startcolumn, int buffersize) { + inputStream = dstream; + line = startline; + column = startcolumn - 1; + + available = bufsize = buffersize; + buffer = new char[buffersize]; + bufline = new int[buffersize]; + bufcolumn = new int[buffersize]; + nextCharBuf = new char[4096]; + } + + /** Constructor. */ + public JavaCharStream(java.io.Reader dstream, + int startline, int startcolumn) { + this(dstream, startline, startcolumn, 4096); + } + + /** Constructor. */ + public JavaCharStream(java.io.Reader dstream) { + this(dstream, 1, 1, 4096); + } + + /** Reinitialise. */ + public void ReInit(java.io.Reader dstream, + int startline, int startcolumn, int buffersize) { + inputStream = dstream; + line = startline; + column = startcolumn - 1; + + if (buffer == null || buffersize != buffer.length) { + available = bufsize = buffersize; + buffer = new char[buffersize]; + bufline = new int[buffersize]; + bufcolumn = new int[buffersize]; + nextCharBuf = new char[4096]; + } + prevCharIsLF = prevCharIsCR = false; + tokenBegin = inBuf = maxNextCharInd = 0; + nextCharInd = bufpos = -1; + } + + /** Reinitialise. */ + public void ReInit(java.io.Reader dstream, + int startline, int startcolumn) { + ReInit(dstream, startline, startcolumn, 4096); + } + + /** Reinitialise. */ + public void ReInit(java.io.Reader dstream) { + ReInit(dstream, 1, 1, 4096); + } + + /** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException { + this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); + } + + /** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, int startline, + int startcolumn, int buffersize) { + this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096); + } + + /** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, + int startcolumn) throws java.io.UnsupportedEncodingException { + this(dstream, encoding, startline, startcolumn, 4096); + } + + /** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, int startline, + int startcolumn) { + this(dstream, startline, startcolumn, 4096); + } + + /** Constructor. */ + public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException { + this(dstream, encoding, 1, 1, 4096); + } + + /** Constructor. */ + public JavaCharStream(java.io.InputStream dstream) { + this(dstream, 1, 1, 4096); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, String encoding, int startline, + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException { + ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, int startline, + int startcolumn, int buffersize) { + ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, String encoding, int startline, + int startcolumn) throws java.io.UnsupportedEncodingException { + ReInit(dstream, encoding, startline, startcolumn, 4096); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, int startline, + int startcolumn) { + ReInit(dstream, startline, startcolumn, 4096); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException { + ReInit(dstream, encoding, 1, 1, 4096); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream dstream) { + ReInit(dstream, 1, 1, 4096); + } + + /** @return token image as String */ + public String GetImage() { + if (bufpos >= tokenBegin) { + return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); + } else { + return new String(buffer, tokenBegin, bufsize - tokenBegin) + + new String(buffer, 0, bufpos + 1); + } + } + + /** @return suffix */ + public char[] GetSuffix(int len) { + char[] ret = new char[len]; + + if ((bufpos + 1) >= len) { + System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); + } else { + System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, + len - bufpos - 1); + System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); + } + + return ret; + } + + /** Set buffers back to null when finished. */ + public void Done() { + nextCharBuf = null; + buffer = null; + bufline = null; + bufcolumn = null; + } + + /** + * Method to adjust line and column numbers for the start of a token. + */ + public void adjustBeginLineColumn(int newLine, int newCol) { + int start = tokenBegin; + int len; + + if (bufpos >= tokenBegin) { + len = bufpos - tokenBegin + inBuf + 1; + } else { + len = bufsize - tokenBegin + bufpos + 1 + inBuf; + } + + int i = 0, j = 0, k = 0; + int nextColDiff = 0, columnDiff = 0; + + while (i < len && + bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) { + bufline[j] = newLine; + nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; + bufcolumn[j] = newCol + columnDiff; + columnDiff = nextColDiff; + i++; + } + + if (i < len) { + bufline[j] = newLine++; + bufcolumn[j] = newCol + columnDiff; + + while (i++ < len) { + if (bufline[j = start % bufsize] != bufline[++start % bufsize]) { + bufline[j] = newLine++; + } else { + bufline[j] = newLine; + } + } + } + + line = bufline[j]; + column = bufcolumn[j]; + } + +} +/* JavaCC - OriginalChecksum=69daf7a8766456321bf569ae1edca171 (do not edit this line) */ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaParser.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaParser.java new file mode 100644 index 00000000000..18f98ec9a1e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/JavaParser.java @@ -0,0 +1,173 @@ +/* + * Copyright (C) 2008 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser; + +import japa.parser.ast.CompilationUnit; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; + +/** + *

    + * This class was generated automatically by javacc, do not edit. + *

    + *

    + * Parse Java 1.5 source code and creates Abstract Syntax Tree classes. + *

    + *

    + * Note: To use this parser asynchronously, disable de parser cache by calling the method {@link setCacheParser} with false as argument. + *

    + * + * @author Júlio Vilmar Gesser + */ +public final class JavaParser { + + private static ASTParser parser; + + private static boolean cacheParser = true; + + private JavaParser() { + // hide the constructor + } + + /** + * Changes the way that the parser acts when starts to parse. If the + * parser cache is enabled, only one insance of this object will be + * used in every call to parse methods. + * If this parser is intend to be used asynchonously, the cache must + * be disabled setting this flag to false. + * By default, the cache is enabled. + * + * @param value + * false to disable the parser instance cache. + */ + public static void setCacheParser(boolean value) { + cacheParser = value; + if (!value) { + parser = null; + } + } + + /** + * Parses the Java code contained in the {@link InputStream} and returns + * a {@link CompilationUnit} that represents it. + * + * @param in + * {@link InputStream} containing Java source code + * @param encoding + * encoding of the source code + * @return CompilationUnit representing the Java source code + * @throws ParseException + * if the source code has parser errors + */ + public static CompilationUnit parse(InputStream in, String encoding) throws ParseException { + if (cacheParser) { + if (parser == null) { + parser = new ASTParser(in, encoding); + } else { + parser.reset(in, encoding); + } + return parser.CompilationUnit(); + } + return new ASTParser(in, encoding).CompilationUnit(); + } + + /** + * Parses the Java code contained in the {@link InputStream} and returns + * a {@link CompilationUnit} that represents it. + * + * @param in + * {@link InputStream} containing Java source code + * @return CompilationUnit representing the Java source code + * @throws ParseException + * if the source code has parser errors + */ + public static CompilationUnit parse(InputStream in) throws ParseException { + return parse(in, null); + } + + /** + * Parses the Java code contained in a {@link File} and returns + * a {@link CompilationUnit} that represents it. + * + * @param file + * {@link File} containing Java source code + * @param encoding + * encoding of the source code + * @return CompilationUnit representing the Java source code + * @throws ParseException + * if the source code has parser errors + * @throws IOException + */ + public static CompilationUnit parse(File file, String encoding) throws ParseException, IOException { + FileInputStream in = new FileInputStream(file); + try { + return parse(in, encoding); + } finally { + in.close(); + } + } + + /** + * Parses the Java code contained in a {@link File} and returns + * a {@link CompilationUnit} that represents it. + * + * @param file + * {@link File} containing Java source code + * @return CompilationUnit representing the Java source code + * @throws ParseException + * if the source code has parser errors + * @throws IOException + */ + public static CompilationUnit parse(File file) throws ParseException, IOException { + return parse(file, null); + } + + /** + * Parses the Java code contained in the {@link InputStream} and returns + * a {@link CompilationUnit} that represents it. + * + * @param in + * {@link InputStream} containing Java source code + * @param encoding + * encoding of the source code + * @return CompilationUnit representing the Java source code + * @throws ParseException + * if the source code has parser errors + */ + public static CompilationUnit parse(Reader in) throws ParseException { + if (cacheParser) { + if (parser == null) { + parser = new ASTParser(in); + } else { + parser.ReInit(in); + } + return parser.CompilationUnit(); + } + return new ASTParser(in).CompilationUnit(); + } + + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ParseException.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ParseException.java new file mode 100644 index 00000000000..adbf212f98b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ParseException.java @@ -0,0 +1,216 @@ +/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 4.1 */ +/* JavaCCOptions:KEEP_LINE_COL=null */ +/* + * Copyright (C) 2008 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +package japa.parser; + +/** + * This exception is thrown when parse errors are encountered. + * You can explicitly create objects of this exception type by + * calling the method generateParseException in the generated + * parser. + * + * You can modify this class to customize your error reporting + * mechanisms so long as you retain the public fields. + */ +public class ParseException extends Exception { + + /** + * This constructor is used by the method "generateParseException" + * in the generated parser. Calling this constructor generates + * a new object of this type with the fields "currentToken", + * "expectedTokenSequences", and "tokenImage" set. The boolean + * flag "specialConstructor" is also set to true to indicate that + * this constructor was used to create this object. + * This constructor calls its super class with the empty string + * to force the "toString" method of parent class "Throwable" to + * print the error message in the form: + * ParseException: + */ + public ParseException(Token currentTokenVal, + int[][] expectedTokenSequencesVal, + String[] tokenImageVal) { + super(""); + specialConstructor = true; + currentToken = currentTokenVal; + expectedTokenSequences = expectedTokenSequencesVal; + tokenImage = tokenImageVal; + } + + /** + * The following constructors are for use by you for whatever + * purpose you can think of. Constructing the exception in this + * manner makes the exception behave in the normal way - i.e., as + * documented in the class "Throwable". The fields "errorToken", + * "expectedTokenSequences", and "tokenImage" do not contain + * relevant information. The JavaCC generated code does not use + * these constructors. + */ + + public ParseException() { + super(); + specialConstructor = false; + } + + /** Constructor with message. */ + public ParseException(String message) { + super(message); + specialConstructor = false; + } + + /** + * This variable determines which constructor was used to create + * this object and thereby affects the semantics of the + * "getMessage" method (see below). + */ + protected boolean specialConstructor; + + /** + * This is the last token that has been consumed successfully. If + * this object has been created due to a parse error, the token + * followng this token will (therefore) be the first error token. + */ + public Token currentToken; + + /** + * Each entry in this array is an array of integers. Each array + * of integers represents a sequence of tokens (by their ordinal + * values) that is expected at this point of the parse. + */ + public int[][] expectedTokenSequences; + + /** + * This is a reference to the "tokenImage" array of the generated + * parser within which the parse error occurred. This array is + * defined in the generated ...Constants interface. + */ + public String[] tokenImage; + + /** + * This method has the standard behavior when this object has been + * created using the standard constructors. Otherwise, it uses + * "currentToken" and "expectedTokenSequences" to generate a parse + * error message and returns it. If this object has been created + * due to a parse error, and you do not catch it (it gets thrown + * from the parser), then this method is called during the printing + * of the final stack trace, and hence the correct error message + * gets displayed. + */ + @Override + public String getMessage() { + if (!specialConstructor) { + return super.getMessage(); + } + StringBuffer expected = new StringBuffer(); + int maxSize = 0; + for (int i = 0; i < expectedTokenSequences.length; i++) { + if (maxSize < expectedTokenSequences[i].length) { + maxSize = expectedTokenSequences[i].length; + } + for (int j = 0; j < expectedTokenSequences[i].length; j++) { + expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' '); + } + if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) { + expected.append("..."); + } + expected.append(eol).append(" "); + } + String retval = "Encountered \""; + Token tok = currentToken.next; + for (int i = 0; i < maxSize; i++) { + if (i != 0) { + retval += " "; + } + if (tok.kind == 0) { + retval += tokenImage[0]; + break; + } + retval += " " + tokenImage[tok.kind]; + retval += " \""; + retval += add_escapes(tok.image); + retval += " \""; + tok = tok.next; + } + retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn; + retval += "." + eol; + if (expectedTokenSequences.length == 1) { + retval += "Was expecting:" + eol + " "; + } else { + retval += "Was expecting one of:" + eol + " "; + } + retval += expected.toString(); + return retval; + } + + /** + * The end of line string for this machine. + */ + protected String eol = System.getProperty("line.separator", "\n"); + + /** + * Used to convert raw characters to their escaped version + * when these raw version cannot be used as part of an ASCII + * string literal. + */ + protected String add_escapes(String str) { + StringBuffer retval = new StringBuffer(); + char ch; + for (int i = 0; i < str.length(); i++) { + switch (str.charAt(i)) { + case 0: + continue; + case '\b': + retval.append("\\b"); + continue; + case '\t': + retval.append("\\t"); + continue; + case '\n': + retval.append("\\n"); + continue; + case '\f': + retval.append("\\f"); + continue; + case '\r': + retval.append("\\r"); + continue; + case '\"': + retval.append("\\\""); + continue; + case '\'': + retval.append("\\\'"); + continue; + case '\\': + retval.append("\\\\"); + continue; + default: + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { + String s = "0000" + Integer.toString(ch, 16); + retval.append("\\u" + s.substring(s.length() - 4, s.length())); + } else { + retval.append(ch); + } + continue; + } + } + return retval.toString(); + } + +} +/* JavaCC - OriginalChecksum=4beea1df20cd4144443abe59f34118d0 (do not edit this line) */ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/Token.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/Token.java new file mode 100644 index 00000000000..9a885a1f69c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/Token.java @@ -0,0 +1,142 @@ +/* Generated By:JavaCC: Do not edit this line. Token.java Version 4.1 */ +/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null */ +/* + * Copyright (C) 2008 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +package japa.parser; + +/** + * Describes the input token stream. + */ + +public class Token { + + /** + * An integer that describes the kind of this token. This numbering + * system is determined by JavaCCParser, and a table of these numbers is + * stored in the file ...Constants.java. + */ + public int kind; + + /** The line number of the first character of this Token. */ + public int beginLine; + + /** The column number of the first character of this Token. */ + public int beginColumn; + + /** The line number of the last character of this Token. */ + public int endLine; + + /** The column number of the last character of this Token. */ + public int endColumn; + + /** + * The string image of the token. + */ + public String image; + + /** + * A reference to the next regular (non-special) token from the input + * stream. If this is the last token from the input stream, or if the + * token manager has not read tokens beyond this one, this field is + * set to null. This is true only if this token is also a regular + * token. Otherwise, see below for a description of the contents of + * this field. + */ + public Token next; + + /** + * This field is used to access special tokens that occur prior to this + * token, but after the immediately preceding regular (non-special) token. + * If there are no such special tokens, this field is set to null. + * When there are more than one such special token, this field refers + * to the last of these special tokens, which in turn refers to the next + * previous special token through its specialToken field, and so on + * until the first special token (whose specialToken field is null). + * The next fields of special tokens refer to other special tokens that + * immediately follow it (without an intervening regular token). If there + * is no such token, this field is null. + */ + public Token specialToken; + + /** + * An optional attribute value of the Token. + * Tokens which are not used as syntactic sugar will often contain + * meaningful values that will be used later on by the compiler or + * interpreter. This attribute value is often different from the image. + * Any subclass of Token that actually wants to return a non-null value can + * override this method as appropriate. + */ + public Object getValue() { + return null; + } + + /** + * No-argument constructor + */ + public Token() { + } + + /** + * Constructs a new token for the specified Image. + */ + public Token(int kind) { + this(kind, null); + } + + /** + * Constructs a new token for the specified Image and Kind. + */ + public Token(int kind, String image) { + this.kind = kind; + this.image = image; + } + + /** + * Returns the image. + */ + @Override + public String toString() { + return image; + } + + /** + * Returns a new Token object, by default. However, if you want, you + * can create and return subclass objects based on the value of ofKind. + * Simply add the cases to the switch for all those special cases. + * For example, if you have a subclass of Token called IDToken that + * you want to create if ofKind is ID, simply add something like : + * + * case MyParserConstants.ID : return new IDToken(ofKind, image); + * + * to the following switch statement. Then you can cast matchedToken + * variable to the appropriate type and use sit in your lexical actions. + */ + public static Token newToken(int ofKind, String image) { + switch (ofKind) { + default: + return new Token(ofKind, image); + } + } + + public static Token newToken(int ofKind) { + return newToken(ofKind, null); + } + +} +/* JavaCC - OriginalChecksum=36e116391da53a8cb5fc7d23289ae0c7 (do not edit this line) */ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/TokenMgrError.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/TokenMgrError.java new file mode 100644 index 00000000000..4f46a2efcad --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/TokenMgrError.java @@ -0,0 +1,158 @@ +/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 4.1 */ +/* JavaCCOptions: */ +/* + * Copyright (C) 2008 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +package japa.parser; + +/** Token Manager Error. */ +@SuppressWarnings("serial") +public class TokenMgrError extends Error { + + /* + * Ordinals for various reasons why an Error of this type can be thrown. + */ + + /** + * Lexical error occurred. + */ + static final int LEXICAL_ERROR = 0; + + /** + * An attempt was made to create a second instance of a static token manager. + */ + static final int STATIC_LEXER_ERROR = 1; + + /** + * Tried to change to an invalid lexical state. + */ + static final int INVALID_LEXICAL_STATE = 2; + + /** + * Detected (and bailed out of) an infinite loop in the token manager. + */ + static final int LOOP_DETECTED = 3; + + /** + * Indicates the reason why the exception is thrown. It will have + * one of the above 4 values. + */ + int errorCode; + + /** + * Replaces unprintable characters by their escaped (or unicode escaped) + * equivalents in the given string + */ + protected static final String addEscapes(String str) { + StringBuffer retval = new StringBuffer(); + char ch; + for (int i = 0; i < str.length(); i++) { + switch (str.charAt(i)) { + case 0: + continue; + case '\b': + retval.append("\\b"); + continue; + case '\t': + retval.append("\\t"); + continue; + case '\n': + retval.append("\\n"); + continue; + case '\f': + retval.append("\\f"); + continue; + case '\r': + retval.append("\\r"); + continue; + case '\"': + retval.append("\\\""); + continue; + case '\'': + retval.append("\\\'"); + continue; + case '\\': + retval.append("\\\\"); + continue; + default: + if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { + String s = "0000" + Integer.toString(ch, 16); + retval.append("\\u" + s.substring(s.length() - 4, s.length())); + } else { + retval.append(ch); + } + continue; + } + } + return retval.toString(); + } + + /** + * Returns a detailed message for the Error when it is thrown by the + * token manager to indicate a lexical error. + * Parameters : + * EOFSeen : indicates if EOF caused the lexical error + * curLexState : lexical state in which this error occurred + * errorLine : line number when the error occurred + * errorColumn : column number when the error occurred + * errorAfter : prefix that was seen before this error occurred + * curchar : the offending character + * Note: You can customize the lexical error message by modifying this method. + */ + protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { + return ("Lexical error at line " + + errorLine + ", column " + + errorColumn + ". Encountered: " + + (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int) curChar + "), ") + + "after : \"" + addEscapes(errorAfter) + "\""); + } + + /** + * You can also modify the body of this method to customize your error messages. + * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not + * of end-users concern, so you can return something like : + * + * "Internal Error : Please file a bug report .... " + * + * from this method for such cases in the release version of your parser. + */ + @Override + public String getMessage() { + return super.getMessage(); + } + + /* + * Constructors of various flavors follow. + */ + + /** No arg constructor. */ + public TokenMgrError() { + } + + /** Constructor with message and reason. */ + public TokenMgrError(String message, int reason) { + super(message); + errorCode = reason; + } + + /** Full Constructor. */ + public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { + this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); + } +} +/* JavaCC - OriginalChecksum=f513119adae97f8c53113edb988c2492 (do not edit this line) */ diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/BlockComment.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/BlockComment.java new file mode 100644 index 00000000000..ac8b4dd5310 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/BlockComment.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 23/05/2008 + */ +package japa.parser.ast; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + *

    + * AST node that represent block comments. + *

    + * + * Block comments can has multi lines and are delimited + * by "/*" and "*/". + * + * @author Julio Vilmar Gesser + */ +public final class BlockComment extends Comment { + + public BlockComment() { + } + + public BlockComment(int beginLine, int beginColumn, int endLine, int endColumn, String content) { + super(beginLine, beginColumn, endLine, endColumn, content); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Comment.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Comment.java new file mode 100644 index 00000000000..c01837cc87b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Comment.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 23/05/2008 + */ +package japa.parser.ast; + +import japa.parser.ast.body.JavadocComment; + +/** + * Abstract class for all AST nodes that represent comments. + * + * @see BlockComment + * @see LineComment + * @see JavadocComment + * @author Julio Vilmar Gesser + */ +public abstract class Comment extends Node { + + private String content; + + public Comment() { + } + + public Comment(int beginLine, int beginColumn, int endLine, int endColumn, String content) { + super(beginLine, beginColumn, endLine, endColumn); + this.content = content; + } + + /** + * Return the text of the comment. + * + * @return text of the comment + */ + public final String getContent() { + return content; + } + + /** + * Sets the text of the comment. + * + * @param content + * the text of the comment to set + */ + public void setContent(String content) { + this.content = content; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/CompilationUnit.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/CompilationUnit.java new file mode 100644 index 00000000000..f2ab3a88f90 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/CompilationUnit.java @@ -0,0 +1,177 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast; + +import japa.parser.ast.body.AnnotationDeclaration; +import japa.parser.ast.body.ClassOrInterfaceDeclaration; +import japa.parser.ast.body.EmptyTypeDeclaration; +import japa.parser.ast.body.EnumDeclaration; +import japa.parser.ast.body.JavadocComment; +import japa.parser.ast.body.TypeDeclaration; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + *

    + * This class represents the entire compilation unit. Each java file denotes a compilation unit. + *

    + * + * The CompilationUnit is constructed following the syntax:
    + * + * + * + * + * + * + * + *
    CompilationUnit::= + * ( {@link PackageDeclaration} )?
    + * ( {@link ImportDeclaration} )*
    + * ( {@link TypeDeclaration} )*
    + *
    + *
    + * + * @author Julio Vilmar Gesser + */ +public final class CompilationUnit extends Node { + + private PackageDeclaration pakage; + + private List imports; + + private List types; + + private List comments; + + public CompilationUnit() { + } + + public CompilationUnit(int beginLine, int beginColumn, int endLine, int endColumn, PackageDeclaration pakage, List imports, List types, List comments) { + super(beginLine, beginColumn, endLine, endColumn); + this.pakage = pakage; + this.imports = imports; + this.types = types; + this.comments = comments; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public
    void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + /** + * Return a list containing all comments declared in this compilation unit. + * Including javadocs, line comments and block comments of all types, + * inner-classes and other members.
    + * If there is no comment, null is returned. + * + * @return list with all comments of this compilation unit or null + * @see JavadocComment + * @see LineComment + * @see BlockComment + */ + public List getComments() { + return comments; + } + + /** + * Retrieves the list of imports declared in this compilation unit or null if there is no import. + * + * @return the list of imports or null if there is no import + */ + public List getImports() { + return imports; + } + + /** + * Retrieves the package declaration of this compilation unit.
    + * If this compilation unit has no package declaration (default package), null is returned. + * + * @return the package declaration or null + */ + public PackageDeclaration getPakage() { + return pakage; + } + + /** + * Return the list of types declared in this compilation unit.
    + * If there is no types declared, null is returned. + * + * @return the list of types or null null if there is no type + * @see AnnotationDeclaration + * @see ClassOrInterfaceDeclaration + * @see EmptyTypeDeclaration + * @see EnumDeclaration + */ + public List getTypes() { + return types; + } + + /** + * Sets the list of comments of this compilation unit. + * + * @param comments + * the list of comments + */ + public void setComments(List comments) { + this.comments = comments; + } + + /** + * Sets the list of imports of this compilation unit. + * The list is initially null. + * + * @param imports + * the list of imports + */ + public void setImports(List imports) { + this.imports = imports; + } + + /** + * Sets or clear the package declarations of this compilation unit. + * + * @param pakage + * the pakage declaration to set or null to default package + */ + public void setPakage(PackageDeclaration pakage) { + this.pakage = pakage; + } + + /** + * Sets the list of types declared in this compilation unit. + * + * @param types + * the lis of types + */ + public void setTypes(List types) { + this.types = types; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/ImportDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/ImportDeclaration.java new file mode 100644 index 00000000000..d4bf38a08cb --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/ImportDeclaration.java @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast; + +import japa.parser.ast.expr.NameExpr; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + *

    + * This class represents a import declaration. Imports are optional for the {@link CompilationUnit}. + *

    + * + * The ImportDeclaration is constructed following the syntax:
    + * + * + * + * + * + * + * + *
    ImportDeclaration::= + * "import" ( "static" )? {@link NameExpr} ( "." "*" )? ";" + *
    + *
    + * + * @author Julio Vilmar Gesser + */ +public final class ImportDeclaration extends Node { + + private NameExpr name; + + private boolean static_; + + private boolean asterisk; + + public ImportDeclaration() { + } + + public ImportDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr name, boolean isStatic, boolean isAsterisk) { + super(beginLine, beginColumn, endLine, endColumn); + this.name = name; + this.static_ = isStatic; + this.asterisk = isAsterisk; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public
    void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + /** + * Retrieves the name of the import. + * + * @return the name of the import + */ + public NameExpr getName() { + return name; + } + + /** + * Return if the import ends with "*". + * + * @return true if the import ends with "*", false otherwise + */ + public boolean isAsterisk() { + return asterisk; + } + + /** + * Return if the import is static. + * + * @return true if the import is static, false otherwise + */ + public boolean isStatic() { + return static_; + } + + /** + * Sets if this import is asterisk. + * + * @param asterisk + * true if this import is asterisk + */ + public void setAsterisk(boolean asterisk) { + this.asterisk = asterisk; + } + + /** + * Sets the name this import. + * + * @param name + * the name to set + */ + public void setName(NameExpr name) { + this.name = name; + } + + /** + * Sets if this import is static. + * + * @param static_ + * true if this import is static + */ + public void setStatic(boolean static_) { + this.static_ = static_; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/LineComment.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/LineComment.java new file mode 100644 index 00000000000..83636a74d7e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/LineComment.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 23/05/2008 + */ +package japa.parser.ast; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + *

    + * AST node that represent line comments. + *

    + * + * Line comments are started with "//" and finish at + * the end of the line ("\n"). + * + * @author Julio Vilmar Gesser + */ +public final class LineComment extends Comment { + + public LineComment() { + } + + public LineComment(int beginLine, int beginColumn, int endLine, int endColumn, String content) { + super(beginLine, beginColumn, endLine, endColumn, content); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public
    void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Node.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Node.java new file mode 100644 index 00000000000..3d396b3777f --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/Node.java @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast; + +import japa.parser.ast.visitor.DumpVisitor; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * Abstract class for all nodes of the AST. + * + * @author Julio Vilmar Gesser + */ +public abstract class Node { + + private int beginLine; + + private int beginColumn; + + private int endLine; + + private int endColumn; + + /** + * This attribute can store additional information from semantic analysis. + */ + private Object data; + + public Node() { + } + + public Node(int beginLine, int beginColumn, int endLine, int endColumn) { + this.beginLine = beginLine; + this.beginColumn = beginColumn; + this.endLine = endLine; + this.endColumn = endColumn; + } + + /** + * Accept method for visitor support. + * + * @param + * the type the return value of the visitor + * @param + * the type the argument passed for the visitor + * @param v + * the visitor implementation + * @param arg + * any value relevant for the visitor + * @return the result of the visit + */ + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + /** + * Accept method for visitor support. + * + * @param + * the type the argument passed for the visitor + * @param v + * the visitor implementation + * @param arg + * any value relevant for the visitor + */ + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + /** + * Return the begin column of this node. + * + * @return the begin column of this node + */ + public final int getBeginColumn() { + return beginColumn; + } + + /** + * Return the begin line of this node. + * + * @return the begin line of this node + */ + public final int getBeginLine() { + return beginLine; + } + + /** + * Use this to retrieve additional information associated to this node. + */ + public final Object getData() { + return data; + } + + /** + * Return the end column of this node. + * + * @return the end column of this node + */ + public final int getEndColumn() { + return endColumn; + } + + /** + * Return the end line of this node. + * + * @return the end line of this node + */ + public final int getEndLine() { + return endLine; + } + + /** + * Sets the begin column of this node. + * + * @param beginColumn + * the begin column of this node + */ + public final void setBeginColumn(int beginColumn) { + this.beginColumn = beginColumn; + } + + /** + * Sets the begin line of this node. + * + * @param beginLine + * the begin line of this node + */ + public final void setBeginLine(int beginLine) { + this.beginLine = beginLine; + } + + /** + * Use this to store additional information to this node. + */ + public final void setData(Object data) { + this.data = data; + } + + /** + * Sets the end column of this node. + * + * @param endColumn + * the end column of this node + */ + public final void setEndColumn(int endColumn) { + this.endColumn = endColumn; + } + + /** + * Sets the end line of this node. + * + * @param endLine + * the end line of this node + */ + public final void setEndLine(int endLine) { + this.endLine = endLine; + } + + /** + * Return the String representation of this node. + * + * @return the String representation of this node + */ + @Override + public final String toString() { + DumpVisitor visitor = new DumpVisitor(); + accept(visitor, null); + return visitor.getSource(); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/PackageDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/PackageDeclaration.java new file mode 100644 index 00000000000..cc910afe4f6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/PackageDeclaration.java @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 17/10/2007 + */ +package japa.parser.ast; + +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.expr.NameExpr; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + *

    + * This class represents the package declaration. The package declaration is optional for the {@link CompilationUnit}. + *

    + * + * The PackageDeclaration is constructed following the syntax:
    + * + * + * + * + * + * + * + *
    PackageDeclaration::= + * ( {@link AnnotationExpr} )* "package" {@link NameExpr} ) ";" + *
    + *
    + * + * @author Julio Vilmar Gesser + */ +public final class PackageDeclaration extends Node { + + private List annotations; + + private NameExpr name; + + public PackageDeclaration() { + } + + public PackageDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, List annotations, NameExpr name) { + super(beginLine, beginColumn, endLine, endColumn); + this.annotations = annotations; + this.name = name; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public
    void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + /** + * Retrieves the list of annotations declared before the package + * declaration. Return null if there are no annotations. + * + * @return list of annotations or null + */ + public List getAnnotations() { + return annotations; + } + + /** + * Return the name of the package. + * + * @return the name of the package + */ + public NameExpr getName() { + return name; + } + + /** + * + * @param annotations + * the annotations to set + */ + public void setAnnotations(List annotations) { + this.annotations = annotations; + } + + /** + * Sets the name of this package declaration. + * + * @param name + * the name to set + */ + public void setName(NameExpr name) { + this.name = name; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/TypeParameter.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/TypeParameter.java new file mode 100644 index 00000000000..6d5006fb1b9 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/TypeParameter.java @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast; + +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + *

    + * This class represents the declaration of a genetics argument. + *

    + * + * The TypeParameter is constructed following the syntax:
    + * + * + * + * + * + * + * + *
    TypeParameter::= + * <IDENTIFIER> ( "extends" {@link ClassOrInterfaceType} ( "&" {@link ClassOrInterfaceType} )* )? + *
    + *
    + * + * @author Julio Vilmar Gesser + */ +public final class TypeParameter extends Node { + + private String name; + + private List typeBound; + + public TypeParameter() { + } + + public TypeParameter(int beginLine, int beginColumn, int endLine, int endColumn, String name, List typeBound) { + super(beginLine, beginColumn, endLine, endColumn); + this.name = name; + this.typeBound = typeBound; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public
    void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + /** + * Return the name of the paramenter. + * + * @return the name of the paramenter + */ + public String getName() { + return name; + } + + /** + * Return the list of {@link ClassOrInterfaceType} that this parameter + * extends. Return null null if there are no type. + * + * @return list of types that this paramente extends or null + */ + public List getTypeBound() { + return typeBound; + } + + /** + * Sets the name of this type parameter. + * + * @param name + * the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * Sets the list o types. + * + * @param typeBound + * the typeBound to set + */ + public void setTypeBound(List typeBound) { + this.typeBound = typeBound; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationDeclaration.java new file mode 100644 index 00000000000..07ad2b8a3c6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationDeclaration.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 21/11/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class AnnotationDeclaration extends TypeDeclaration { + + public AnnotationDeclaration() { + } + + public AnnotationDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, String name, List members) { + super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc, name, modifiers, members); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationMemberDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationMemberDeclaration.java new file mode 100644 index 00000000000..e453f0a3903 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/AnnotationMemberDeclaration.java @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 21/11/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.expr.Expression; +import japa.parser.ast.type.Type; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class AnnotationMemberDeclaration extends BodyDeclaration { + + private int modifiers; + + private Type type; + + private String name; + + private Expression defaultValue; + + public AnnotationMemberDeclaration() { + } + + public AnnotationMemberDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, Type type, String name, Expression defaultValue) { + super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); + this.modifiers = modifiers; + this.type = type; + this.name = name; + this.defaultValue = defaultValue; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getDefaultValue() { + return defaultValue; + } + + public int getModifiers() { + return modifiers; + } + + public String getName() { + return name; + } + + public Type getType() { + return type; + } + + public void setDefaultValue(Expression defaultValue) { + this.defaultValue = defaultValue; + } + + public void setModifiers(int modifiers) { + this.modifiers = modifiers; + } + + public void setName(String name) { + this.name = name; + } + + public void setType(Type type) { + this.type = type; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/BodyDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/BodyDeclaration.java new file mode 100644 index 00000000000..af540c292f2 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/BodyDeclaration.java @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.Node; +import japa.parser.ast.expr.AnnotationExpr; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public abstract class BodyDeclaration extends Node { + + private JavadocComment javaDoc; + + private List annotations; + + public BodyDeclaration() { + } + + public BodyDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, List annotations, JavadocComment javaDoc) { + super(beginLine, beginColumn, endLine, endColumn); + this.javaDoc = javaDoc; + this.annotations = annotations; + } + + public final JavadocComment getJavaDoc() { + return javaDoc; + } + + public final List getAnnotations() { + return annotations; + } + + public final void setJavaDoc(JavadocComment javaDoc) { + this.javaDoc = javaDoc; + } + + public final void setAnnotations(List annotations) { + this.annotations = annotations; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ClassOrInterfaceDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ClassOrInterfaceDeclaration.java new file mode 100644 index 00000000000..473bb244159 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ClassOrInterfaceDeclaration.java @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.TypeParameter; +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class ClassOrInterfaceDeclaration extends TypeDeclaration { + + private boolean interface_; + + private List typeParameters; + + private List extendsList; + + private List implementsList; + + public ClassOrInterfaceDeclaration() { + } + + public ClassOrInterfaceDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, boolean isInterface, String name, List typeParameters, + List extendsList, List implementsList, List members) { + super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc, name, modifiers, members); + this.interface_ = isInterface; + this.typeParameters = typeParameters; + this.extendsList = extendsList; + this.implementsList = implementsList; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public List getExtends() { + return extendsList; + } + + public List getImplements() { + return implementsList; + } + + public List getTypeParameters() { + return typeParameters; + } + + public boolean isInterface() { + return interface_; + } + + public void setExtends(List extendsList) { + this.extendsList = extendsList; + } + + public void setImplements(List implementsList) { + this.implementsList = implementsList; + } + + public void setInterface(boolean interface_) { + this.interface_ = interface_; + } + + public void setTypeParameters(List typeParameters) { + this.typeParameters = typeParameters; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ConstructorDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ConstructorDeclaration.java new file mode 100644 index 00000000000..8af73d596f4 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ConstructorDeclaration.java @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.TypeParameter; +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.expr.NameExpr; +import japa.parser.ast.stmt.BlockStmt; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class ConstructorDeclaration extends BodyDeclaration { + + private int modifiers; + + private List typeParameters; + + private String name; + + private List parameters; + + private List throws_; + + private BlockStmt block; + + public ConstructorDeclaration() { + } + + public ConstructorDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, List typeParameters, String name, List parameters, + List throws_, BlockStmt block) { + super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); + this.modifiers = modifiers; + this.typeParameters = typeParameters; + this.name = name; + this.parameters = parameters; + this.throws_ = throws_; + this.block = block; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public BlockStmt getBlock() { + return block; + } + + public int getModifiers() { + return modifiers; + } + + public String getName() { + return name; + } + + public List getParameters() { + return parameters; + } + + public List getThrows() { + return throws_; + } + + public List getTypeParameters() { + return typeParameters; + } + + public void setBlock(BlockStmt block) { + this.block = block; + } + + public void setModifiers(int modifiers) { + this.modifiers = modifiers; + } + + public void setName(String name) { + this.name = name; + } + + public void setParameters(List parameters) { + this.parameters = parameters; + } + + public void setThrows(List throws_) { + this.throws_ = throws_; + } + + public void setTypeParameters(List typeParameters) { + this.typeParameters = typeParameters; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyMemberDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyMemberDeclaration.java new file mode 100644 index 00000000000..79f1c7601d5 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyMemberDeclaration.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 07/11/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class EmptyMemberDeclaration extends BodyDeclaration { + + public EmptyMemberDeclaration() { + } + + public EmptyMemberDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc) { + super(beginLine, beginColumn, endLine, endColumn, null, javaDoc); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyTypeDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyTypeDeclaration.java new file mode 100644 index 00000000000..7090017fde2 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EmptyTypeDeclaration.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 20/01/2007 + */ +package japa.parser.ast.body; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class EmptyTypeDeclaration extends TypeDeclaration { + + public EmptyTypeDeclaration() { + } + + public EmptyTypeDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc) { + super(beginLine, beginColumn, endLine, endColumn, null, javaDoc, null, 0, null); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumConstantDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumConstantDeclaration.java new file mode 100644 index 00000000000..814bd2e3ced --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumConstantDeclaration.java @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/11/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.expr.Expression; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class EnumConstantDeclaration extends BodyDeclaration { + + private String name; + + private List args; + + private List classBody; + + public EnumConstantDeclaration() { + } + + public EnumConstantDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, List annotations, String name, List args, List classBody) { + super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); + this.name = name; + this.args = args; + this.classBody = classBody; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public List getArgs() { + return args; + } + + public List getClassBody() { + return classBody; + } + + public String getName() { + return name; + } + + public void setArgs(List args) { + this.args = args; + } + + public void setClassBody(List classBody) { + this.classBody = classBody; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumDeclaration.java new file mode 100644 index 00000000000..b1185537641 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/EnumDeclaration.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class EnumDeclaration extends TypeDeclaration { + + private List implementsList; + + private List entries; + + public EnumDeclaration() { + } + + public EnumDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, String name, List implementsList, List entries, + List members) { + super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc, name, modifiers, members); + this.implementsList = implementsList; + this.entries = entries; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public List getEntries() { + return entries; + } + + public List getImplements() { + return implementsList; + } + + public void setEntries(List entries) { + this.entries = entries; + } + + public void setImplements(List implementsList) { + this.implementsList = implementsList; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/FieldDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/FieldDeclaration.java new file mode 100644 index 00000000000..e868e7a7320 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/FieldDeclaration.java @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.type.Type; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class FieldDeclaration extends BodyDeclaration { + + private int modifiers; + + private Type type; + + private List variables; + + public FieldDeclaration() { + } + + public FieldDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, Type type, List variables) { + super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); + this.modifiers = modifiers; + this.type = type; + this.variables = variables; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public int getModifiers() { + return modifiers; + } + + public Type getType() { + return type; + } + + public List getVariables() { + return variables; + } + + public void setModifiers(int modifiers) { + this.modifiers = modifiers; + } + + public void setType(Type type) { + this.type = type; + } + + public void setVariables(List variables) { + this.variables = variables; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/InitializerDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/InitializerDeclaration.java new file mode 100644 index 00000000000..0f3882b3845 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/InitializerDeclaration.java @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 07/11/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.stmt.BlockStmt; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class InitializerDeclaration extends BodyDeclaration { + + private boolean isStatic; + + private BlockStmt block; + + public InitializerDeclaration() { + } + + public InitializerDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, boolean isStatic, BlockStmt block) { + super(beginLine, beginColumn, endLine, endColumn, null, javaDoc); + this.isStatic = isStatic; + this.block = block; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public BlockStmt getBlock() { + return block; + } + + public boolean isStatic() { + return isStatic; + } + + public void setBlock(BlockStmt block) { + this.block = block; + } + + public void setStatic(boolean isStatic) { + this.isStatic = isStatic; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/JavadocComment.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/JavadocComment.java new file mode 100644 index 00000000000..5241b3cf22b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/JavadocComment.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 23/05/2008 + */ +package japa.parser.ast.body; + +import japa.parser.ast.Comment; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class JavadocComment extends Comment { + + public JavadocComment() { + } + + public JavadocComment(int beginLine, int beginColumn, int endLine, int endColumn, String content) { + super(beginLine, beginColumn, endLine, endColumn, content); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/MethodDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/MethodDeclaration.java new file mode 100644 index 00000000000..1337198d173 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/MethodDeclaration.java @@ -0,0 +1,144 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.TypeParameter; +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.expr.NameExpr; +import japa.parser.ast.stmt.BlockStmt; +import japa.parser.ast.type.Type; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class MethodDeclaration extends BodyDeclaration { + + private int modifiers; + + private List typeParameters; + + private Type type; + + private String name; + + private List parameters; + + private int arrayCount; + + private List throws_; + + private BlockStmt body; + + public MethodDeclaration() { + } + + public MethodDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, JavadocComment javaDoc, int modifiers, List annotations, List typeParameters, Type type, String name, List parameters, + int arrayCount, List throws_, BlockStmt block) { + super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); + this.modifiers = modifiers; + this.typeParameters = typeParameters; + this.type = type; + this.name = name; + this.parameters = parameters; + this.arrayCount = arrayCount; + this.throws_ = throws_; + this.body = block; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public int getArrayCount() { + return arrayCount; + } + + public BlockStmt getBody() { + return body; + } + + public int getModifiers() { + return modifiers; + } + + public String getName() { + return name; + } + + public List getParameters() { + return parameters; + } + + public List getThrows() { + return throws_; + } + + public Type getType() { + return type; + } + + public List getTypeParameters() { + return typeParameters; + } + + public void setArrayCount(int arrayCount) { + this.arrayCount = arrayCount; + } + + public void setBody(BlockStmt body) { + this.body = body; + } + + public void setModifiers(int modifiers) { + this.modifiers = modifiers; + } + + public void setName(String name) { + this.name = name; + } + + public void setParameters(List parameters) { + this.parameters = parameters; + } + + public void setThrows(List throws_) { + this.throws_ = throws_; + } + + public void setType(Type type) { + this.type = type; + } + + public void setTypeParameters(List typeParameters) { + this.typeParameters = typeParameters; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ModifierSet.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ModifierSet.java new file mode 100644 index 00000000000..ad2dfaa7253 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/ModifierSet.java @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +package japa.parser.ast.body; + +/** + * Class to hold modifiers. + */ +public final class ModifierSet { + + /* Definitions of the bits in the modifiers field. */ + public static final int PUBLIC = 0x0001; + + public static final int PROTECTED = 0x0002; + + public static final int PRIVATE = 0x0004; + + public static final int ABSTRACT = 0x0008; + + public static final int STATIC = 0x0010; + + public static final int FINAL = 0x0020; + + public static final int SYNCHRONIZED = 0x0040; + + public static final int NATIVE = 0x0080; + + public static final int TRANSIENT = 0x0100; + + public static final int VOLATILE = 0x0200; + + public static final int STRICTFP = 0x1000; + + /** + * Adds the given modifier. + */ + public static int addModifier(int modifiers, int mod) { + return modifiers |= mod; + } + + public static boolean hasModifier(int modifiers, int modifier) { + return (modifiers & modifier) != 0; + } + + public static boolean isAbstract(int modifiers) { + return (modifiers & ABSTRACT) != 0; + } + + public static boolean isFinal(int modifiers) { + return (modifiers & FINAL) != 0; + } + + public static boolean isNative(int modifiers) { + return (modifiers & NATIVE) != 0; + } + + public static boolean isPrivate(int modifiers) { + return (modifiers & PRIVATE) != 0; + } + + public static boolean isProtected(int modifiers) { + return (modifiers & PROTECTED) != 0; + } + + /** + * A set of accessors that indicate whether the specified modifier + * is in the set. + */ + + public static boolean isPublic(int modifiers) { + return (modifiers & PUBLIC) != 0; + } + + public static boolean isStatic(int modifiers) { + return (modifiers & STATIC) != 0; + } + + public static boolean isStrictfp(int modifiers) { + return (modifiers & STRICTFP) != 0; + } + + public static boolean isSynchronized(int modifiers) { + return (modifiers & SYNCHRONIZED) != 0; + } + + public static boolean isTransient(int modifiers) { + return (modifiers & TRANSIENT) != 0; + } + + public static boolean isVolatile(int modifiers) { + return (modifiers & VOLATILE) != 0; + } + + /** + * Removes the given modifier. + */ + public static int removeModifier(int modifiers, int mod) { + return modifiers &= ~mod; + } + + private ModifierSet() { + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/Parameter.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/Parameter.java new file mode 100644 index 00000000000..faa4c8fff26 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/Parameter.java @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 03/11/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.Node; +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.type.Type; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class Parameter extends Node { + + private int modifiers; + + private List annotations; + + private Type type; + + private boolean isVarArgs; + + private VariableDeclaratorId id; + + public Parameter() { + } + + public Parameter(int beginLine, int beginColumn, int endLine, int endColumn, int modifiers, List annotations, Type type, boolean isVarArgs, VariableDeclaratorId id) { + super(beginLine, beginColumn, endLine, endColumn); + this.modifiers = modifiers; + this.annotations = annotations; + this.type = type; + this.isVarArgs = isVarArgs; + this.id = id; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public List getAnnotations() { + return annotations; + } + + public VariableDeclaratorId getId() { + return id; + } + + public int getModifiers() { + return modifiers; + } + + public Type getType() { + return type; + } + + public boolean isVarArgs() { + return isVarArgs; + } + + public void setAnnotations(List annotations) { + this.annotations = annotations; + } + + public void setId(VariableDeclaratorId id) { + this.id = id; + } + + public void setModifiers(int modifiers) { + this.modifiers = modifiers; + } + + public void setType(Type type) { + this.type = type; + } + + public void setVarArgs(boolean isVarArgs) { + this.isVarArgs = isVarArgs; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/TypeDeclaration.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/TypeDeclaration.java new file mode 100644 index 00000000000..79107a962ed --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/TypeDeclaration.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.expr.AnnotationExpr; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public abstract class TypeDeclaration extends BodyDeclaration { + + private String name; + + private int modifiers; + + private List members; + + public TypeDeclaration() { + } + + public TypeDeclaration(int beginLine, int beginColumn, int endLine, int endColumn, List annotations, JavadocComment javaDoc, String name, int modifiers, List members) { + super(beginLine, beginColumn, endLine, endColumn, annotations, javaDoc); + this.name = name; + this.modifiers = modifiers; + this.members = members; + } + + public final List getMembers() { + return members; + } + + public final int getModifiers() { + return modifiers; + } + + public final String getName() { + return name; + } + + public void setMembers(List members) { + this.members = members; + } + + public final void setModifiers(int modifiers) { + this.modifiers = modifiers; + } + + public final void setName(String name) { + this.name = name; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclarator.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclarator.java new file mode 100644 index 00000000000..d5ecc164f09 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclarator.java @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.Node; +import japa.parser.ast.expr.Expression; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class VariableDeclarator extends Node { + + private VariableDeclaratorId id; + + private Expression init; + + public VariableDeclarator() { + } + + public VariableDeclarator(int beginLine, int beginColumn, int endLine, int endColumn, VariableDeclaratorId id, Expression init) { + super(beginLine, beginColumn, endLine, endColumn); + this.id = id; + this.init = init; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public VariableDeclaratorId getId() { + return id; + } + + public Expression getInit() { + return init; + } + + public void setId(VariableDeclaratorId id) { + this.id = id; + } + + public void setInit(Expression init) { + this.init = init; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclaratorId.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclaratorId.java new file mode 100644 index 00000000000..98bdd8c040c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/body/VariableDeclaratorId.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.body; + +import japa.parser.ast.Node; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class VariableDeclaratorId extends Node { + + private String name; + + private int arrayCount; + + public VariableDeclaratorId() { + } + + public VariableDeclaratorId(int beginLine, int beginColumn, int endLine, int endColumn, String name, int arrayCount) { + super(beginLine, beginColumn, endLine, endColumn); + this.name = name; + this.arrayCount = arrayCount; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public int getArrayCount() { + return arrayCount; + } + + public String getName() { + return name; + } + + public void setArrayCount(int arrayCount) { + this.arrayCount = arrayCount; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AnnotationExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AnnotationExpr.java new file mode 100644 index 00000000000..a0cb8e270bf --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AnnotationExpr.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 21/11/2006 + */ +package japa.parser.ast.expr; + +/** + * @author Julio Vilmar Gesser + */ +public abstract class AnnotationExpr extends Expression { + + public AnnotationExpr() { + } + + public AnnotationExpr(int beginLine, int beginColumn, int endLine, int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayAccessExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayAccessExpr.java new file mode 100644 index 00000000000..2b3ceb92b03 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayAccessExpr.java @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class ArrayAccessExpr extends Expression { + + private Expression name; + + private Expression index; + + public ArrayAccessExpr() { + } + + public ArrayAccessExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression name, Expression index) { + super(beginLine, beginColumn, endLine, endColumn); + this.name = name; + this.index = index; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getIndex() { + return index; + } + + public Expression getName() { + return name; + } + + public void setIndex(Expression index) { + this.index = index; + } + + public void setName(Expression name) { + this.name = name; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayCreationExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayCreationExpr.java new file mode 100644 index 00000000000..94e379150ae --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayCreationExpr.java @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.type.Type; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class ArrayCreationExpr extends Expression { + + private Type type; + + private int arrayCount; + + private ArrayInitializerExpr initializer; + + private List dimensions; + + public ArrayCreationExpr() { + } + + public ArrayCreationExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type, int arrayCount, ArrayInitializerExpr initializer) { + super(beginLine, beginColumn, endLine, endColumn); + this.type = type; + this.arrayCount = arrayCount; + this.initializer = initializer; + this.dimensions = null; + } + + public ArrayCreationExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type, List dimensions, int arrayCount) { + super(beginLine, beginColumn, endLine, endColumn); + this.type = type; + this.arrayCount = arrayCount; + this.dimensions = dimensions; + this.initializer = null; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public int getArrayCount() { + return arrayCount; + } + + public List getDimensions() { + return dimensions; + } + + public ArrayInitializerExpr getInitializer() { + return initializer; + } + + public Type getType() { + return type; + } + + + public void setArrayCount(int arrayCount) { + this.arrayCount = arrayCount; + } + + public void setDimensions(List dimensions) { + this.dimensions = dimensions; + } + + public void setInitializer(ArrayInitializerExpr initializer) { + this.initializer = initializer; + } + + public void setType(Type type) { + this.type = type; + } + + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayInitializerExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayInitializerExpr.java new file mode 100644 index 00000000000..9f38c589759 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ArrayInitializerExpr.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class ArrayInitializerExpr extends Expression { + + private List values; + + public ArrayInitializerExpr() { + } + + public ArrayInitializerExpr(int beginLine, int beginColumn, int endLine, int endColumn, List values) { + super(beginLine, beginColumn, endLine, endColumn); + this.values = values; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AssignExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AssignExpr.java new file mode 100644 index 00000000000..6b9c715f212 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/AssignExpr.java @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class AssignExpr extends Expression { + + public static enum Operator { + assign, // = + plus, // += + minus, // -= + star, // *= + slash, // /= + and, // &= + or, // |= + xor, // ^= + rem, // %= + lShift, // <<= + rSignedShift, // >>= + rUnsignedShift, // >>>= + } + + private Expression target; + + private Expression value; + + private Operator op; + + public AssignExpr() { + } + + public AssignExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression target, Expression value, Operator op) { + super(beginLine, beginColumn, endLine, endColumn); + this.target = target; + this.value = value; + this.op = op; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Operator getOperator() { + return op; + } + + public Expression getTarget() { + return target; + } + + public Expression getValue() { + return value; + } + + public void setOperator(Operator op) { + this.op = op; + } + + public void setTarget(Expression target) { + this.target = target; + } + + public void setValue(Expression value) { + this.value = value; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BinaryExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BinaryExpr.java new file mode 100644 index 00000000000..7742be65b5e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BinaryExpr.java @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class BinaryExpr extends Expression { + + public static enum Operator { + or, // || + and, // && + binOr, // | + binAnd, // & + xor, // ^ + equals, // == + notEquals, // != + less, // < + greater, // > + lessEquals, // <= + greaterEquals, // >= + lShift, // << + rSignedShift, // >> + rUnsignedShift, // >>> + plus, // + + minus, // - + times, // * + divide, // / + remainder, // % + } + + private Expression left; + + private Expression right; + + private Operator op; + + public BinaryExpr() { + } + + public BinaryExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression left, Expression right, Operator op) { + super(beginLine, beginColumn, endLine, endColumn); + this.left = left; + this.right = right; + this.op = op; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getLeft() { + return left; + } + + public Operator getOperator() { + return op; + } + + public Expression getRight() { + return right; + } + + public void setLeft(Expression left) { + this.left = left; + } + + public void setOperator(Operator op) { + this.op = op; + } + + public void setRight(Expression right) { + this.right = right; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BooleanLiteralExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BooleanLiteralExpr.java new file mode 100644 index 00000000000..4f614b88bed --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/BooleanLiteralExpr.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 02/03/2007 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class BooleanLiteralExpr extends LiteralExpr { + + private boolean value; + + public BooleanLiteralExpr() { + } + + public BooleanLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, boolean value) { + super(beginLine, beginColumn, endLine, endColumn); + this.value = value; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public boolean getValue() { + return value; + } + + public void setValue(boolean value) { + this.value = value; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CastExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CastExpr.java new file mode 100644 index 00000000000..85e4fbf8007 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CastExpr.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.type.Type; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class CastExpr extends Expression { + + private Type type; + + private Expression expr; + + public CastExpr() { + } + + public CastExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type, Expression expr) { + super(beginLine, beginColumn, endLine, endColumn); + this.type = type; + this.expr = expr; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getExpr() { + return expr; + } + + public Type getType() { + return type; + } + + public void setExpr(Expression expr) { + this.expr = expr; + } + + public void setType(Type type) { + this.type = type; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CharLiteralExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CharLiteralExpr.java new file mode 100644 index 00000000000..09c9372fd41 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/CharLiteralExpr.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 02/03/2007 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class CharLiteralExpr extends StringLiteralExpr { + + public CharLiteralExpr() { + } + + public CharLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { + super(beginLine, beginColumn, endLine, endColumn, value); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ClassExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ClassExpr.java new file mode 100644 index 00000000000..c3e59ee3755 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ClassExpr.java @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.type.Type; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class ClassExpr extends Expression { + + private Type type; + + public ClassExpr() { + } + + public ClassExpr(int beginLine, int beginColumn, int endLine, int endColumn, Type type) { + super(beginLine, beginColumn, endLine, endColumn); + this.type = type; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Type getType() { + return type; + } + + public void setType(Type type) { + this.type = type; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ConditionalExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ConditionalExpr.java new file mode 100644 index 00000000000..de616bbe851 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ConditionalExpr.java @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class ConditionalExpr extends Expression { + + private Expression condition; + + private Expression thenExpr; + + private Expression elseExpr; + + public ConditionalExpr() { + } + + public ConditionalExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression condition, Expression thenExpr, Expression elseExpr) { + super(beginLine, beginColumn, endLine, endColumn); + this.condition = condition; + this.thenExpr = thenExpr; + this.elseExpr = elseExpr; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getCondition() { + return condition; + } + + public Expression getElseExpr() { + return elseExpr; + } + + public Expression getThenExpr() { + return thenExpr; + } + + public void setCondition(Expression condition) { + this.condition = condition; + } + + public void setElseExpr(Expression elseExpr) { + this.elseExpr = elseExpr; + } + + public void setThenExpr(Expression thenExpr) { + this.thenExpr = thenExpr; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/DoubleLiteralExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/DoubleLiteralExpr.java new file mode 100644 index 00000000000..02df5bbc474 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/DoubleLiteralExpr.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 02/03/2007 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class DoubleLiteralExpr extends StringLiteralExpr { + + public DoubleLiteralExpr() { + } + + public DoubleLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { + super(beginLine, beginColumn, endLine, endColumn, value); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/EnclosedExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/EnclosedExpr.java new file mode 100644 index 00000000000..90a0f0882af --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/EnclosedExpr.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class EnclosedExpr extends Expression { + + private Expression inner; + + public EnclosedExpr() { + } + + public EnclosedExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression inner) { + super(beginLine, beginColumn, endLine, endColumn); + this.inner = inner; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getInner() { + return inner; + } + + public void setInner(Expression inner) { + this.inner = inner; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/Expression.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/Expression.java new file mode 100644 index 00000000000..f4813ee2ed2 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/Expression.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 10/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.Node; + +/** + * @author Julio Vilmar Gesser + */ +public abstract class Expression extends Node { + + public Expression() { + } + + public Expression(int beginLine, int beginColumn, int endLine, int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/FieldAccessExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/FieldAccessExpr.java new file mode 100644 index 00000000000..444956e1bdb --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/FieldAccessExpr.java @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.type.Type; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class FieldAccessExpr extends Expression { + + private Expression scope; + + private List typeArgs; + + private String field; + + public FieldAccessExpr() { + } + + public FieldAccessExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression scope, List typeArgs, String field) { + super(beginLine, beginColumn, endLine, endColumn); + this.scope = scope; + this.typeArgs = typeArgs; + this.field = field; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public String getField() { + return field; + } + + public Expression getScope() { + return scope; + } + + public List getTypeArgs() { + return typeArgs; + } + + public void setField(String field) { + this.field = field; + } + + public void setScope(Expression scope) { + this.scope = scope; + } + + public void setTypeArgs(List typeArgs) { + this.typeArgs = typeArgs; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/InstanceOfExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/InstanceOfExpr.java new file mode 100644 index 00000000000..cf2954c3a27 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/InstanceOfExpr.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.type.Type; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class InstanceOfExpr extends Expression { + + private Expression expr; + + private Type type; + + public InstanceOfExpr() { + } + + public InstanceOfExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr, Type type) { + super(beginLine, beginColumn, endLine, endColumn); + this.expr = expr; + this.type = type; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getExpr() { + return expr; + } + + public Type getType() { + return type; + } + + public void setExpr(Expression expr) { + this.expr = expr; + } + + public void setType(Type type) { + this.type = type; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralExpr.java new file mode 100644 index 00000000000..ff362ace5f1 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralExpr.java @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 02/03/2007 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public class IntegerLiteralExpr extends StringLiteralExpr { + + public IntegerLiteralExpr() { + } + + public IntegerLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { + super(beginLine, beginColumn, endLine, endColumn, value); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public final boolean isMinValue() { + return value != null && // + value.length() == 10 && // + value.equals("2147483648"); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralMinValueExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralMinValueExpr.java new file mode 100644 index 00000000000..c4a14c6389d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/IntegerLiteralMinValueExpr.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 09/03/2007 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class IntegerLiteralMinValueExpr extends IntegerLiteralExpr { + + public IntegerLiteralMinValueExpr() { + this.value = "-2147483648"; + } + + public IntegerLiteralMinValueExpr(int beginLine, int beginColumn, int endLine, int endColumn) { + super(beginLine, beginColumn, endLine, endColumn, "-2147483648"); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LiteralExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LiteralExpr.java new file mode 100644 index 00000000000..e2fe637eb35 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LiteralExpr.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +/** + * @author Julio Vilmar Gesser + */ +public abstract class LiteralExpr extends Expression { + + public LiteralExpr() { + } + + public LiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralExpr.java new file mode 100644 index 00000000000..f5009c15038 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralExpr.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 02/03/2007 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public class LongLiteralExpr extends StringLiteralExpr { + + public LongLiteralExpr() { + } + + public LongLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { + super(beginLine, beginColumn, endLine, endColumn, value); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public final boolean isMinValue() { + return value != null && // + value.length() == 20 && // + value.startsWith("9223372036854775808") && // + (value.charAt(19) == 'L' || value.charAt(19) == 'l'); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralMinValueExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralMinValueExpr.java new file mode 100644 index 00000000000..fc26b305378 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/LongLiteralMinValueExpr.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 09/03/2007 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class LongLiteralMinValueExpr extends LongLiteralExpr { + + public LongLiteralMinValueExpr() { + this.value = "-9223372036854775808L"; + } + + public LongLiteralMinValueExpr(int beginLine, int beginColumn, int endLine, int endColumn) { + super(beginLine, beginColumn, endLine, endColumn, "-9223372036854775808L"); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MarkerAnnotationExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MarkerAnnotationExpr.java new file mode 100644 index 00000000000..36d76f9ff6d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MarkerAnnotationExpr.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 21/11/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class MarkerAnnotationExpr extends AnnotationExpr { + + private NameExpr name; + + public MarkerAnnotationExpr() { + } + + public MarkerAnnotationExpr(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr name) { + super(beginLine, beginColumn, endLine, endColumn); + this.name = name; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public NameExpr getName() { + return name; + } + + public void setName(NameExpr name) { + this.name = name; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MemberValuePair.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MemberValuePair.java new file mode 100644 index 00000000000..c309831ee79 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MemberValuePair.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 21/11/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.Node; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class MemberValuePair extends Node { + + private String name; + + private Expression value; + + public MemberValuePair() { + } + + public MemberValuePair(int beginLine, int beginColumn, int endLine, int endColumn, String name, Expression value) { + super(beginLine, beginColumn, endLine, endColumn); + this.name = name; + this.value = value; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public String getName() { + return name; + } + + public Expression getValue() { + return value; + } + + public void setName(String name) { + this.name = name; + } + + public void setValue(Expression value) { + this.value = value; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MethodCallExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MethodCallExpr.java new file mode 100644 index 00000000000..577833afb9a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/MethodCallExpr.java @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.type.Type; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class MethodCallExpr extends Expression { + + private Expression scope; + + private List typeArgs; + + private String name; + + private List args; + + public MethodCallExpr() { + } + + public MethodCallExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression scope, List typeArgs, String name, List args) { + super(beginLine, beginColumn, endLine, endColumn); + this.scope = scope; + this.typeArgs = typeArgs; + this.name = name; + this.args = args; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public List getArgs() { + return args; + } + + public String getName() { + return name; + } + + public Expression getScope() { + return scope; + } + + public List getTypeArgs() { + return typeArgs; + } + + public void setArgs(List args) { + this.args = args; + } + + public void setName(String name) { + this.name = name; + } + + public void setScope(Expression scope) { + this.scope = scope; + } + + public void setTypeArgs(List typeArgs) { + this.typeArgs = typeArgs; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NameExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NameExpr.java new file mode 100644 index 00000000000..b265fc516ea --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NameExpr.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public class NameExpr extends Expression { + + private String name; + + public NameExpr() { + } + + public NameExpr(int beginLine, int beginColumn, int endLine, int endColumn, String name) { + super(beginLine, beginColumn, endLine, endColumn); + this.name = name; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public final String getName() { + return name; + } + + public final void setName(String name) { + this.name = name; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NormalAnnotationExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NormalAnnotationExpr.java new file mode 100644 index 00000000000..3dd6642aace --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NormalAnnotationExpr.java @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 21/11/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class NormalAnnotationExpr extends AnnotationExpr { + + private NameExpr name; + + private List pairs; + + public NormalAnnotationExpr() { + } + + public NormalAnnotationExpr(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr name, List pairs) { + super(beginLine, beginColumn, endLine, endColumn); + this.name = name; + this.pairs = pairs; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public NameExpr getName() { + return name; + } + + public List getPairs() { + return pairs; + } + + public void setName(NameExpr name) { + this.name = name; + } + + public void setPairs(List pairs) { + this.pairs = pairs; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NullLiteralExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NullLiteralExpr.java new file mode 100644 index 00000000000..3b225fd94b4 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/NullLiteralExpr.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 02/03/2007 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class NullLiteralExpr extends LiteralExpr { + + public NullLiteralExpr() { + } + + public NullLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ObjectCreationExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ObjectCreationExpr.java new file mode 100644 index 00000000000..59c7ee4f3fa --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ObjectCreationExpr.java @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.body.BodyDeclaration; +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.type.Type; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class ObjectCreationExpr extends Expression { + + private Expression scope; + + private ClassOrInterfaceType type; + + private List typeArgs; + + private List args; + + private List anonymousClassBody; + + public ObjectCreationExpr() { + } + + public ObjectCreationExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression scope, ClassOrInterfaceType type, List typeArgs, List args, List anonymousBody) { + super(beginLine, beginColumn, endLine, endColumn); + this.scope = scope; + this.type = type; + this.typeArgs = typeArgs; + this.args = args; + this.anonymousClassBody = anonymousBody; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public List getAnonymousClassBody() { + return anonymousClassBody; + } + + public List getArgs() { + return args; + } + + public Expression getScope() { + return scope; + } + + public ClassOrInterfaceType getType() { + return type; + } + + public List getTypeArgs() { + return typeArgs; + } + + public void setAnonymousClassBody(List anonymousClassBody) { + this.anonymousClassBody = anonymousClassBody; + } + + public void setArgs(List args) { + this.args = args; + } + + public void setScope(Expression scope) { + this.scope = scope; + } + + public void setType(ClassOrInterfaceType type) { + this.type = type; + } + + public void setTypeArgs(List typeArgs) { + this.typeArgs = typeArgs; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/QualifiedNameExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/QualifiedNameExpr.java new file mode 100644 index 00000000000..a265e6ffc2b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/QualifiedNameExpr.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class QualifiedNameExpr extends NameExpr { + + private NameExpr qualifier; + + public QualifiedNameExpr() { + } + + public QualifiedNameExpr(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr scope, String name) { + super(beginLine, beginColumn, endLine, endColumn, name); + this.qualifier = scope; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public NameExpr getQualifier() { + return qualifier; + } + + public void setQualifier(NameExpr qualifier) { + this.qualifier = qualifier; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SingleMemberAnnotationExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SingleMemberAnnotationExpr.java new file mode 100644 index 00000000000..68a013d0691 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SingleMemberAnnotationExpr.java @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 21/11/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class SingleMemberAnnotationExpr extends AnnotationExpr { + + private NameExpr name; + + private Expression memberValue; + + public SingleMemberAnnotationExpr() { + } + + public SingleMemberAnnotationExpr(int beginLine, int beginColumn, int endLine, int endColumn, NameExpr name, Expression memberValue) { + super(beginLine, beginColumn, endLine, endColumn); + this.name = name; + this.memberValue = memberValue; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getMemberValue() { + return memberValue; + } + + public NameExpr getName() { + return name; + } + + public void setMemberValue(Expression memberValue) { + this.memberValue = memberValue; + } + + public void setName(NameExpr name) { + this.name = name; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/StringLiteralExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/StringLiteralExpr.java new file mode 100644 index 00000000000..2cf2e0f0608 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/StringLiteralExpr.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 02/03/2007 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public class StringLiteralExpr extends LiteralExpr { + + protected String value; + + public StringLiteralExpr() { + } + + public StringLiteralExpr(int beginLine, int beginColumn, int endLine, int endColumn, String value) { + super(beginLine, beginColumn, endLine, endColumn); + this.value = value; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public final String getValue() { + return value; + } + + public final void setValue(String value) { + this.value = value; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SuperExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SuperExpr.java new file mode 100644 index 00000000000..7c65800ccd3 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/SuperExpr.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 20/01/2007 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class SuperExpr extends Expression { + + private Expression classExpr; + + public SuperExpr() { + } + + public SuperExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression classExpr) { + super(beginLine, beginColumn, endLine, endColumn); + this.classExpr = classExpr; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getClassExpr() { + return classExpr; + } + + public void setClassExpr(Expression classExpr) { + this.classExpr = classExpr; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ThisExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ThisExpr.java new file mode 100644 index 00000000000..bff1d408766 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/ThisExpr.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class ThisExpr extends Expression { + + private Expression classExpr; + + public ThisExpr() { + } + + public ThisExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression classExpr) { + super(beginLine, beginColumn, endLine, endColumn); + this.classExpr = classExpr; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getClassExpr() { + return classExpr; + } + + public void setClassExpr(Expression classExpr) { + this.classExpr = classExpr; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/UnaryExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/UnaryExpr.java new file mode 100644 index 00000000000..d8607f05723 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/UnaryExpr.java @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class UnaryExpr extends Expression { + + public static enum Operator { + positive, // + + negative, // - + preIncrement, // ++ + preDecrement, // -- + not, // ! + inverse, // ~ + posIncrement, // ++ + posDecrement, // -- + } + + private Expression expr; + + private Operator op; + + public UnaryExpr() { + } + + public UnaryExpr(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr, Operator op) { + super(beginLine, beginColumn, endLine, endColumn); + this.expr = expr; + this.op = op; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getExpr() { + return expr; + } + + public Operator getOperator() { + return op; + } + + public void setExpr(Expression expr) { + this.expr = expr; + } + + public void setOperator(Operator op) { + this.op = op; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/VariableDeclarationExpr.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/VariableDeclarationExpr.java new file mode 100644 index 00000000000..32e0272a2b6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/expr/VariableDeclarationExpr.java @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 03/11/2006 + */ +package japa.parser.ast.expr; + +import japa.parser.ast.body.VariableDeclarator; +import japa.parser.ast.type.Type; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class VariableDeclarationExpr extends Expression { + + private int modifiers; + + private List annotations; + + private Type type; + + private List vars; + + public VariableDeclarationExpr() { + } + + public VariableDeclarationExpr(int beginLine, int beginColumn, int endLine, int endColumn, int modifiers, List annotations, Type type, List vars) { + super(beginLine, beginColumn, endLine, endColumn); + this.modifiers = modifiers; + this.annotations = annotations; + this.type = type; + this.vars = vars; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public List getAnnotations() { + return annotations; + } + + public int getModifiers() { + return modifiers; + } + + public Type getType() { + return type; + } + + public List getVars() { + return vars; + } + + public void setAnnotations(List annotations) { + this.annotations = annotations; + } + + public void setModifiers(int modifiers) { + this.modifiers = modifiers; + } + + public void setType(Type type) { + this.type = type; + } + + public void setVars(List vars) { + this.vars = vars; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/AssertStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/AssertStmt.java new file mode 100644 index 00000000000..0f184cd1e59 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/AssertStmt.java @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 04/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.expr.Expression; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class AssertStmt extends Statement { + + private Expression check; + + private Expression msg; + + public AssertStmt() { + } + + public AssertStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression check, Expression msg) { + super(beginLine, beginColumn, endLine, endColumn); + this.check = check; + this.msg = msg; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getCheck() { + return check; + } + + public Expression getMessage() { + return msg; + } + + public void setCheck(Expression check) { + this.check = check; + } + + public void setMessage(Expression msg) { + this.msg = msg; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BlockStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BlockStmt.java new file mode 100644 index 00000000000..1ac9d534ca1 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BlockStmt.java @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 04/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class BlockStmt extends Statement { + + private List stmts; + + public BlockStmt() { + } + + public BlockStmt(int beginLine, int beginColumn, int endLine, int endColumn, List stmts) { + super(beginLine, beginColumn, endLine, endColumn); + this.stmts = stmts; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public List getStmts() { + return stmts; + } + + public void setStmts(List stmts) { + this.stmts = stmts; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BreakStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BreakStmt.java new file mode 100644 index 00000000000..2388f620786 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/BreakStmt.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 04/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class BreakStmt extends Statement { + + private String id; + + public BreakStmt() { + } + + public BreakStmt(int beginLine, int beginColumn, int endLine, int endColumn, String id) { + super(beginLine, beginColumn, endLine, endColumn); + this.id = id; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/CatchClause.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/CatchClause.java new file mode 100644 index 00000000000..8ccbc320e72 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/CatchClause.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 18/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.Node; +import japa.parser.ast.body.Parameter; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class CatchClause extends Node { + + private Parameter except; + + private BlockStmt catchBlock; + + public CatchClause() { + } + + public CatchClause(int beginLine, int beginColumn, int endLine, int endColumn, Parameter except, BlockStmt catchBlock) { + super(beginLine, beginColumn, endLine, endColumn); + this.except = except; + this.catchBlock = catchBlock; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public BlockStmt getCatchBlock() { + return catchBlock; + } + + public Parameter getExcept() { + return except; + } + + public void setCatchBlock(BlockStmt catchBlock) { + this.catchBlock = catchBlock; + } + + public void setExcept(Parameter except) { + this.except = except; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ContinueStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ContinueStmt.java new file mode 100644 index 00000000000..de6a07d2b35 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ContinueStmt.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 07/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class ContinueStmt extends Statement { + + private String id; + + public ContinueStmt() { + } + + public ContinueStmt(int beginLine, int beginColumn, int endLine, int endColumn, String id) { + super(beginLine, beginColumn, endLine, endColumn); + this.id = id; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/DoStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/DoStmt.java new file mode 100644 index 00000000000..2660f385c46 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/DoStmt.java @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 07/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.expr.Expression; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class DoStmt extends Statement { + + private Statement body; + + private Expression condition; + + public DoStmt() { + } + + public DoStmt(int beginLine, int beginColumn, int endLine, int endColumn, Statement body, Expression condition) { + super(beginLine, beginColumn, endLine, endColumn); + this.body = body; + this.condition = condition; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Statement getBody() { + return body; + } + + public Expression getCondition() { + return condition; + } + + public void setBody(Statement body) { + this.body = body; + } + + public void setCondition(Expression condition) { + this.condition = condition; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/EmptyStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/EmptyStmt.java new file mode 100644 index 00000000000..121bfa34e78 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/EmptyStmt.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 04/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class EmptyStmt extends Statement { + + public EmptyStmt() { + } + + public EmptyStmt(int beginLine, int beginColumn, int endLine, int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExplicitConstructorInvocationStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExplicitConstructorInvocationStmt.java new file mode 100644 index 00000000000..b0176fafe72 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExplicitConstructorInvocationStmt.java @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 03/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.expr.Expression; +import japa.parser.ast.type.Type; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class ExplicitConstructorInvocationStmt extends Statement { + + private List typeArgs; + + private boolean isThis; + + private Expression expr; + + private List args; + + public ExplicitConstructorInvocationStmt() { + } + + public ExplicitConstructorInvocationStmt(int beginLine, int beginColumn, int endLine, int endColumn, List typeArgs, boolean isThis, Expression expr, List args) { + super(beginLine, beginColumn, endLine, endColumn); + this.typeArgs = typeArgs; + this.isThis = isThis; + this.expr = expr; + this.args = args; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public List getArgs() { + return args; + } + + public Expression getExpr() { + return expr; + } + + public List getTypeArgs() { + return typeArgs; + } + + public boolean isThis() { + return isThis; + } + + public void setArgs(List args) { + this.args = args; + } + + public void setExpr(Expression expr) { + this.expr = expr; + } + + public void setThis(boolean isThis) { + this.isThis = isThis; + } + + public void setTypeArgs(List typeArgs) { + this.typeArgs = typeArgs; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExpressionStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExpressionStmt.java new file mode 100644 index 00000000000..3413a2199f1 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ExpressionStmt.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 04/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.expr.Expression; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class ExpressionStmt extends Statement { + + private Expression expr; + + public ExpressionStmt() { + } + + public ExpressionStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr) { + super(beginLine, beginColumn, endLine, endColumn); + this.expr = expr; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getExpression() { + return expr; + } + + public void setExpression(Expression expr) { + this.expr = expr; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForStmt.java new file mode 100644 index 00000000000..a3f465a6b14 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForStmt.java @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 07/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.expr.Expression; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class ForStmt extends Statement { + + private List init; + + private Expression compare; + + private List update; + + private Statement body; + + public ForStmt() { + } + + public ForStmt(int beginLine, int beginColumn, int endLine, int endColumn, List init, Expression compare, List update, Statement body) { + super(beginLine, beginColumn, endLine, endColumn); + this.compare = compare; + this.init = init; + this.update = update; + this.body = body; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Statement getBody() { + return body; + } + + public Expression getCompare() { + return compare; + } + + public List getInit() { + return init; + } + + public List getUpdate() { + return update; + } + + public void setBody(Statement body) { + this.body = body; + } + + public void setCompare(Expression compare) { + this.compare = compare; + } + + public void setInit(List init) { + this.init = init; + } + + public void setUpdate(List update) { + this.update = update; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForeachStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForeachStmt.java new file mode 100644 index 00000000000..8d3f6a156a1 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ForeachStmt.java @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 07/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.expr.Expression; +import japa.parser.ast.expr.VariableDeclarationExpr; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class ForeachStmt extends Statement { + + private VariableDeclarationExpr var; + + private Expression iterable; + + private Statement body; + + public ForeachStmt() { + } + + public ForeachStmt(int beginLine, int beginColumn, int endLine, int endColumn, VariableDeclarationExpr var, Expression iterable, Statement body) { + super(beginLine, beginColumn, endLine, endColumn); + this.var = var; + this.iterable = iterable; + this.body = body; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Statement getBody() { + return body; + } + + public Expression getIterable() { + return iterable; + } + + public VariableDeclarationExpr getVariable() { + return var; + } + + public void setBody(Statement body) { + this.body = body; + } + + public void setIterable(Expression iterable) { + this.iterable = iterable; + } + + public void setVariable(VariableDeclarationExpr var) { + this.var = var; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/IfStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/IfStmt.java new file mode 100644 index 00000000000..1a8d237efd8 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/IfStmt.java @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 07/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.expr.Expression; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class IfStmt extends Statement { + + private Expression condition; + + private Statement thenStmt; + + private Statement elseStmt; + + public IfStmt() { + } + + public IfStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression condition, Statement thenStmt, Statement elseStmt) { + super(beginLine, beginColumn, endLine, endColumn); + this.condition = condition; + this.thenStmt = thenStmt; + this.elseStmt = elseStmt; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getCondition() { + return condition; + } + + public Statement getElseStmt() { + return elseStmt; + } + + public Statement getThenStmt() { + return thenStmt; + } + + public void setCondition(Expression condition) { + this.condition = condition; + } + + public void setElseStmt(Statement elseStmt) { + this.elseStmt = elseStmt; + } + + public void setThenStmt(Statement thenStmt) { + this.thenStmt = thenStmt; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/LabeledStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/LabeledStmt.java new file mode 100644 index 00000000000..737f1626b52 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/LabeledStmt.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 04/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class LabeledStmt extends Statement { + + private String label; + + private Statement stmt; + + public LabeledStmt() { + } + + public LabeledStmt(int beginLine, int beginColumn, int endLine, int endColumn, String label, Statement stmt) { + super(beginLine, beginColumn, endLine, endColumn); + this.label = label; + this.stmt = stmt; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public String getLabel() { + return label; + } + + public Statement getStmt() { + return stmt; + } + + public void setLabel(String label) { + this.label = label; + } + + public void setStmt(Statement stmt) { + this.stmt = stmt; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ReturnStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ReturnStmt.java new file mode 100644 index 00000000000..598f73a24d1 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ReturnStmt.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 04/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.expr.Expression; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class ReturnStmt extends Statement { + + private Expression expr; + + public ReturnStmt() { + } + + public ReturnStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr) { + super(beginLine, beginColumn, endLine, endColumn); + this.expr = expr; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getExpr() { + return expr; + } + + public void setExpr(Expression expr) { + this.expr = expr; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/Statement.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/Statement.java new file mode 100644 index 00000000000..386746d8629 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/Statement.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 03/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.Node; + +/** + * @author Julio Vilmar Gesser + */ +public abstract class Statement extends Node { + + public Statement() { + } + + public Statement(int beginLine, int beginColumn, int endLine, int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchEntryStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchEntryStmt.java new file mode 100644 index 00000000000..8ff7e3f25a6 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchEntryStmt.java @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 04/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.expr.Expression; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class SwitchEntryStmt extends Statement { + + private Expression label; + + private List stmts; + + public SwitchEntryStmt() { + } + + public SwitchEntryStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression label, List stmts) { + super(beginLine, beginColumn, endLine, endColumn); + this.label = label; + this.stmts = stmts; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getLabel() { + return label; + } + + public List getStmts() { + return stmts; + } + + public void setLabel(Expression label) { + this.label = label; + } + + public void setStmts(List stmts) { + this.stmts = stmts; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchStmt.java new file mode 100644 index 00000000000..d18eaa975a3 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SwitchStmt.java @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 04/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.expr.Expression; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class SwitchStmt extends Statement { + + private Expression selector; + + private List entries; + + public SwitchStmt() { + } + + public SwitchStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression selector, List entries) { + super(beginLine, beginColumn, endLine, endColumn); + this.selector = selector; + this.entries = entries; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public List getEntries() { + return entries; + } + + public Expression getSelector() { + return selector; + } + + public void setEntries(List entries) { + this.entries = entries; + } + + public void setSelector(Expression selector) { + this.selector = selector; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SynchronizedStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SynchronizedStmt.java new file mode 100644 index 00000000000..25de6c6a157 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/SynchronizedStmt.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 18/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.expr.Expression; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class SynchronizedStmt extends Statement { + + private Expression expr; + + private BlockStmt block; + + public SynchronizedStmt() { + } + + public SynchronizedStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr, BlockStmt block) { + super(beginLine, beginColumn, endLine, endColumn); + this.expr = expr; + this.block = block; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public BlockStmt getBlock() { + return block; + } + + public Expression getExpr() { + return expr; + } + + public void setBlock(BlockStmt block) { + this.block = block; + } + + public void setExpr(Expression expr) { + this.expr = expr; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ThrowStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ThrowStmt.java new file mode 100644 index 00000000000..d329cb078e7 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/ThrowStmt.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 18/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.expr.Expression; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class ThrowStmt extends Statement { + + private Expression expr; + + public ThrowStmt() { + } + + public ThrowStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression expr) { + super(beginLine, beginColumn, endLine, endColumn); + this.expr = expr; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Expression getExpr() { + return expr; + } + + public void setExpr(Expression expr) { + this.expr = expr; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TryStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TryStmt.java new file mode 100644 index 00000000000..7ec39e6bad3 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TryStmt.java @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 18/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class TryStmt extends Statement { + + private BlockStmt tryBlock; + + private List catchs; + + private BlockStmt finallyBlock; + + public TryStmt() { + } + + public TryStmt(int beginLine, int beginColumn, int endLine, int endColumn, BlockStmt tryBlock, List catchs, BlockStmt finallyBlock) { + super(beginLine, beginColumn, endLine, endColumn); + this.tryBlock = tryBlock; + this.catchs = catchs; + this.finallyBlock = finallyBlock; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public List getCatchs() { + return catchs; + } + + public BlockStmt getFinallyBlock() { + return finallyBlock; + } + + public BlockStmt getTryBlock() { + return tryBlock; + } + + public void setCatchs(List catchs) { + this.catchs = catchs; + } + + public void setFinallyBlock(BlockStmt finallyBlock) { + this.finallyBlock = finallyBlock; + } + + public void setTryBlock(BlockStmt tryBlock) { + this.tryBlock = tryBlock; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TypeDeclarationStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TypeDeclarationStmt.java new file mode 100644 index 00000000000..a578dd811ee --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/TypeDeclarationStmt.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 04/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.body.TypeDeclaration; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class TypeDeclarationStmt extends Statement { + + private TypeDeclaration typeDecl; + + public TypeDeclarationStmt() { + } + + public TypeDeclarationStmt(int beginLine, int beginColumn, int endLine, int endColumn, TypeDeclaration typeDecl) { + super(beginLine, beginColumn, endLine, endColumn); + this.typeDecl = typeDecl; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public TypeDeclaration getTypeDeclaration() { + return typeDecl; + } + + public void setTypeDeclaration(TypeDeclaration typeDecl) { + this.typeDecl = typeDecl; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/WhileStmt.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/WhileStmt.java new file mode 100644 index 00000000000..0a2c96efd3a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/stmt/WhileStmt.java @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 07/11/2006 + */ +package japa.parser.ast.stmt; + +import japa.parser.ast.expr.Expression; +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class WhileStmt extends Statement { + + private Expression condition; + + private Statement body; + + public WhileStmt() { + } + + public WhileStmt(int beginLine, int beginColumn, int endLine, int endColumn, Expression condition, Statement body) { + super(beginLine, beginColumn, endLine, endColumn); + this.condition = condition; + this.body = body; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Statement getBody() { + return body; + } + + public Expression getCondition() { + return condition; + } + + public void setBody(Statement body) { + this.body = body; + } + + public void setCondition(Expression condition) { + this.condition = condition; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ClassOrInterfaceType.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ClassOrInterfaceType.java new file mode 100644 index 00000000000..a233bc1fa93 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ClassOrInterfaceType.java @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.type; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ +public final class ClassOrInterfaceType extends Type { + + private ClassOrInterfaceType scope; + + private String name; + + private List typeArgs; + + public ClassOrInterfaceType() { + } + + public ClassOrInterfaceType(int beginLine, int beginColumn, int endLine, int endColumn, ClassOrInterfaceType scope, String name, List typeArgs) { + super(beginLine, beginColumn, endLine, endColumn); + this.scope = scope; + this.name = name; + this.typeArgs = typeArgs; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public String getName() { + return name; + } + + public ClassOrInterfaceType getScope() { + return scope; + } + + public List getTypeArgs() { + return typeArgs; + } + + public void setName(String name) { + this.name = name; + } + + public void setScope(ClassOrInterfaceType scope) { + this.scope = scope; + } + + public void setTypeArgs(List typeArgs) { + this.typeArgs = typeArgs; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/PrimitiveType.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/PrimitiveType.java new file mode 100644 index 00000000000..06b5dcf1601 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/PrimitiveType.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.type; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class PrimitiveType extends Type { + + public enum Primitive { + Boolean, Char, Byte, Short, Int, Long, Float, Double + } + + private Primitive type; + + public PrimitiveType() { + } + + public PrimitiveType(int beginLine, int beginColumn, int endLine, int endColumn, Primitive type) { + super(beginLine, beginColumn, endLine, endColumn); + this.type = type; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public Primitive getType() { + return type; + } + + public void setType(Primitive type) { + this.type = type; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ReferenceType.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ReferenceType.java new file mode 100644 index 00000000000..f19afbb0c4c --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/ReferenceType.java @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.type; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class ReferenceType extends Type { + + private Type type; + + private int arrayCount; + + public ReferenceType() { + } + + public ReferenceType(int beginLine, int beginColumn, int endLine, int endColumn, Type type, int arrayCount) { + super(beginLine, beginColumn, endLine, endColumn); + this.type = type; + this.arrayCount = arrayCount; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public int getArrayCount() { + return arrayCount; + } + + public Type getType() { + return type; + } + + public void setArrayCount(int arrayCount) { + this.arrayCount = arrayCount; + } + + public void setType(Type type) { + this.type = type; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/Type.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/Type.java new file mode 100644 index 00000000000..ad0afadff96 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/Type.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.type; + +import japa.parser.ast.Node; + +/** + * @author Julio Vilmar Gesser + */ +public abstract class Type extends Node { + + public Type() { + } + + public Type(int beginLine, int beginColumn, int endLine, int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/VoidType.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/VoidType.java new file mode 100644 index 00000000000..1502105620f --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/VoidType.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.type; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class VoidType extends Type { + + public VoidType() { + } + + public VoidType(int beginLine, int beginColumn, int endLine, int endColumn) { + super(beginLine, beginColumn, endLine, endColumn); + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/WildcardType.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/WildcardType.java new file mode 100644 index 00000000000..e1af38fbf7b --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/type/WildcardType.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.type; + +import japa.parser.ast.visitor.GenericVisitor; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * @author Julio Vilmar Gesser + */ +public final class WildcardType extends Type { + + private ReferenceType ext; + + private ReferenceType sup; + + public WildcardType() { + } + + public WildcardType(int beginLine, int beginColumn, int endLine, int endColumn, ReferenceType ext, ReferenceType sup) { + super(beginLine, beginColumn, endLine, endColumn); + assert ext == null || sup == null; + this.ext = ext; + this.sup = sup; + } + + @Override + public R accept(GenericVisitor v, A arg) { + return v.visit(this, arg); + } + + @Override + public void accept(VoidVisitor v, A arg) { + v.visit(this, arg); + } + + public ReferenceType getExtends() { + return ext; + } + + public ReferenceType getSuper() { + return sup; + } + + public void setExtends(ReferenceType ext) { + this.ext = ext; + } + + public void setSuper(ReferenceType sup) { + this.sup = sup; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/DumpVisitor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/DumpVisitor.java new file mode 100644 index 00000000000..8b10b6c85f9 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/DumpVisitor.java @@ -0,0 +1,1387 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.visitor; + +import japa.parser.ast.BlockComment; +import japa.parser.ast.CompilationUnit; +import japa.parser.ast.ImportDeclaration; +import japa.parser.ast.LineComment; +import japa.parser.ast.Node; +import japa.parser.ast.PackageDeclaration; +import japa.parser.ast.TypeParameter; +import japa.parser.ast.body.AnnotationDeclaration; +import japa.parser.ast.body.AnnotationMemberDeclaration; +import japa.parser.ast.body.BodyDeclaration; +import japa.parser.ast.body.ClassOrInterfaceDeclaration; +import japa.parser.ast.body.ConstructorDeclaration; +import japa.parser.ast.body.EmptyMemberDeclaration; +import japa.parser.ast.body.EmptyTypeDeclaration; +import japa.parser.ast.body.EnumConstantDeclaration; +import japa.parser.ast.body.EnumDeclaration; +import japa.parser.ast.body.FieldDeclaration; +import japa.parser.ast.body.InitializerDeclaration; +import japa.parser.ast.body.JavadocComment; +import japa.parser.ast.body.MethodDeclaration; +import japa.parser.ast.body.ModifierSet; +import japa.parser.ast.body.Parameter; +import japa.parser.ast.body.TypeDeclaration; +import japa.parser.ast.body.VariableDeclarator; +import japa.parser.ast.body.VariableDeclaratorId; +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.expr.ArrayAccessExpr; +import japa.parser.ast.expr.ArrayCreationExpr; +import japa.parser.ast.expr.ArrayInitializerExpr; +import japa.parser.ast.expr.AssignExpr; +import japa.parser.ast.expr.BinaryExpr; +import japa.parser.ast.expr.BooleanLiteralExpr; +import japa.parser.ast.expr.CastExpr; +import japa.parser.ast.expr.CharLiteralExpr; +import japa.parser.ast.expr.ClassExpr; +import japa.parser.ast.expr.ConditionalExpr; +import japa.parser.ast.expr.DoubleLiteralExpr; +import japa.parser.ast.expr.EnclosedExpr; +import japa.parser.ast.expr.Expression; +import japa.parser.ast.expr.FieldAccessExpr; +import japa.parser.ast.expr.InstanceOfExpr; +import japa.parser.ast.expr.IntegerLiteralExpr; +import japa.parser.ast.expr.IntegerLiteralMinValueExpr; +import japa.parser.ast.expr.LongLiteralExpr; +import japa.parser.ast.expr.LongLiteralMinValueExpr; +import japa.parser.ast.expr.MarkerAnnotationExpr; +import japa.parser.ast.expr.MemberValuePair; +import japa.parser.ast.expr.MethodCallExpr; +import japa.parser.ast.expr.NameExpr; +import japa.parser.ast.expr.NormalAnnotationExpr; +import japa.parser.ast.expr.NullLiteralExpr; +import japa.parser.ast.expr.ObjectCreationExpr; +import japa.parser.ast.expr.QualifiedNameExpr; +import japa.parser.ast.expr.SingleMemberAnnotationExpr; +import japa.parser.ast.expr.StringLiteralExpr; +import japa.parser.ast.expr.SuperExpr; +import japa.parser.ast.expr.ThisExpr; +import japa.parser.ast.expr.UnaryExpr; +import japa.parser.ast.expr.VariableDeclarationExpr; +import japa.parser.ast.stmt.AssertStmt; +import japa.parser.ast.stmt.BlockStmt; +import japa.parser.ast.stmt.BreakStmt; +import japa.parser.ast.stmt.CatchClause; +import japa.parser.ast.stmt.ContinueStmt; +import japa.parser.ast.stmt.DoStmt; +import japa.parser.ast.stmt.EmptyStmt; +import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; +import japa.parser.ast.stmt.ExpressionStmt; +import japa.parser.ast.stmt.ForStmt; +import japa.parser.ast.stmt.ForeachStmt; +import japa.parser.ast.stmt.IfStmt; +import japa.parser.ast.stmt.LabeledStmt; +import japa.parser.ast.stmt.ReturnStmt; +import japa.parser.ast.stmt.Statement; +import japa.parser.ast.stmt.SwitchEntryStmt; +import japa.parser.ast.stmt.SwitchStmt; +import japa.parser.ast.stmt.SynchronizedStmt; +import japa.parser.ast.stmt.ThrowStmt; +import japa.parser.ast.stmt.TryStmt; +import japa.parser.ast.stmt.TypeDeclarationStmt; +import japa.parser.ast.stmt.WhileStmt; +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.type.PrimitiveType; +import japa.parser.ast.type.ReferenceType; +import japa.parser.ast.type.Type; +import japa.parser.ast.type.VoidType; +import japa.parser.ast.type.WildcardType; + +import java.util.Iterator; +import java.util.List; + +/** + * @author Julio Vilmar Gesser + */ + +public final class DumpVisitor implements VoidVisitor { + + private class SourcePrinter { + + private int level = 0; + + private boolean indented = false; + + private final StringBuilder buf = new StringBuilder(); + + public void indent() { + level++; + } + + public void unindent() { + level--; + } + + private void makeIndent() { + for (int i = 0; i < level; i++) { + buf.append(" "); + } + } + + public void print(String arg) { + if (!indented) { + makeIndent(); + indented = true; + } + buf.append(arg); + } + + public void printLn(String arg) { + print(arg); + printLn(); + } + + public void printLn() { + buf.append("\n"); + indented = false; + } + + public String getSource() { + return buf.toString(); + } + + @Override + public String toString() { + return getSource(); + } + } + + private final SourcePrinter printer = new SourcePrinter(); + + public String getSource() { + return printer.getSource(); + } + + private void printModifiers(int modifiers) { + if (ModifierSet.isPrivate(modifiers)) { + printer.print("private "); + } + if (ModifierSet.isProtected(modifiers)) { + printer.print("protected "); + } + if (ModifierSet.isPublic(modifiers)) { + printer.print("public "); + } + if (ModifierSet.isAbstract(modifiers)) { + printer.print("abstract "); + } + if (ModifierSet.isStatic(modifiers)) { + printer.print("static "); + } + if (ModifierSet.isFinal(modifiers)) { + printer.print("final "); + } + if (ModifierSet.isNative(modifiers)) { + printer.print("native "); + } + if (ModifierSet.isStrictfp(modifiers)) { + printer.print("strictfp "); + } + if (ModifierSet.isSynchronized(modifiers)) { + printer.print("synchronized "); + } + if (ModifierSet.isTransient(modifiers)) { + printer.print("transient "); + } + if (ModifierSet.isVolatile(modifiers)) { + printer.print("volatile "); + } + } + + private void printMembers(List members, Object arg) { + for (BodyDeclaration member : members) { + printer.printLn(); + member.accept(this, arg); + printer.printLn(); + } + } + + private void printMemberAnnotations(List annotations, Object arg) { + if (annotations != null) { + for (AnnotationExpr a : annotations) { + a.accept(this, arg); + printer.printLn(); + } + } + } + + private void printAnnotations(List annotations, Object arg) { + if (annotations != null) { + for (AnnotationExpr a : annotations) { + a.accept(this, arg); + printer.print(" "); + } + } + } + + private void printTypeArgs(List args, Object arg) { + if (args != null) { + printer.print("<"); + for (Iterator i = args.iterator(); i.hasNext();) { + Type t = i.next(); + t.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + printer.print(">"); + } + } + + private void printTypeParameters(List args, Object arg) { + if (args != null) { + printer.print("<"); + for (Iterator i = args.iterator(); i.hasNext();) { + TypeParameter t = i.next(); + t.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + printer.print(">"); + } + } + + private void printArguments(List args, Object arg) { + printer.print("("); + if (args != null) { + for (Iterator i = args.iterator(); i.hasNext();) { + Expression e = i.next(); + e.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(")"); + } + + private void printJavadoc(JavadocComment javadoc, Object arg) { + if (javadoc != null) { + javadoc.accept(this, arg); + } + } + + @Override + public void visit(CompilationUnit n, Object arg) { + if (n.getPakage() != null) { + n.getPakage().accept(this, arg); + } + if (n.getImports() != null) { + for (ImportDeclaration i : n.getImports()) { + i.accept(this, arg); + } + printer.printLn(); + } + if (n.getTypes() != null) { + for (Iterator i = n.getTypes().iterator(); i.hasNext();) { + i.next().accept(this, arg); + printer.printLn(); + if (i.hasNext()) { + printer.printLn(); + } + } + } + } + + @Override + public void visit(PackageDeclaration n, Object arg) { + printAnnotations(n.getAnnotations(), arg); + printer.print("package "); + n.getName().accept(this, arg); + printer.printLn(";"); + printer.printLn(); + } + + @Override + public void visit(NameExpr n, Object arg) { + printer.print(n.getName()); + } + + @Override + public void visit(QualifiedNameExpr n, Object arg) { + n.getQualifier().accept(this, arg); + printer.print("."); + printer.print(n.getName()); + } + + @Override + public void visit(ImportDeclaration n, Object arg) { + printer.print("import "); + if (n.isStatic()) { + printer.print("static "); + } + n.getName().accept(this, arg); + if (n.isAsterisk()) { + printer.print(".*"); + } + printer.printLn(";"); + } + + @Override + public void visit(ClassOrInterfaceDeclaration n, Object arg) { + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + if (n.isInterface()) { + printer.print("interface "); + } else { + printer.print("class "); + } + + printer.print(n.getName()); + + printTypeParameters(n.getTypeParameters(), arg); + + if (n.getExtends() != null) { + printer.print(" extends "); + for (Iterator i = n.getExtends().iterator(); i.hasNext();) { + ClassOrInterfaceType c = i.next(); + c.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + + if (n.getImplements() != null) { + printer.print(" implements "); + for (Iterator i = n.getImplements().iterator(); i.hasNext();) { + ClassOrInterfaceType c = i.next(); + c.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + + printer.printLn(" {"); + printer.indent(); + if (n.getMembers() != null) { + printMembers(n.getMembers(), arg); + } + printer.unindent(); + printer.print("}"); + } + + @Override + public void visit(EmptyTypeDeclaration n, Object arg) { + printJavadoc(n.getJavaDoc(), arg); + printer.print(";"); + } + + @Override + public void visit(JavadocComment n, Object arg) { + printer.print("/**"); + printer.print(n.getContent()); + printer.printLn("*/"); + } + + @Override + public void visit(ClassOrInterfaceType n, Object arg) { + if (n.getScope() != null) { + n.getScope().accept(this, arg); + printer.print("."); + } + printer.print(n.getName()); + printTypeArgs(n.getTypeArgs(), arg); + } + + @Override + public void visit(TypeParameter n, Object arg) { + printer.print(n.getName()); + if (n.getTypeBound() != null) { + printer.print(" extends "); + for (Iterator i = n.getTypeBound().iterator(); i.hasNext();) { + ClassOrInterfaceType c = i.next(); + c.accept(this, arg); + if (i.hasNext()) { + printer.print(" & "); + } + } + } + } + + @Override + public void visit(PrimitiveType n, Object arg) { + switch (n.getType()) { + case Boolean: + printer.print("boolean"); + break; + case Byte: + printer.print("byte"); + break; + case Char: + printer.print("char"); + break; + case Double: + printer.print("double"); + break; + case Float: + printer.print("float"); + break; + case Int: + printer.print("int"); + break; + case Long: + printer.print("long"); + break; + case Short: + printer.print("short"); + break; + } + } + + @Override + public void visit(ReferenceType n, Object arg) { + n.getType().accept(this, arg); + for (int i = 0; i < n.getArrayCount(); i++) { + printer.print("[]"); + } + } + + @Override + public void visit(WildcardType n, Object arg) { + printer.print("?"); + if (n.getExtends() != null) { + printer.print(" extends "); + n.getExtends().accept(this, arg); + } + if (n.getSuper() != null) { + printer.print(" super "); + n.getSuper().accept(this, arg); + } + } + + @Override + public void visit(FieldDeclaration n, Object arg) { + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + n.getType().accept(this, arg); + + printer.print(" "); + for (Iterator i = n.getVariables().iterator(); i.hasNext();) { + VariableDeclarator var = i.next(); + var.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + + printer.print(";"); + } + + @Override + public void visit(VariableDeclarator n, Object arg) { + n.getId().accept(this, arg); + if (n.getInit() != null) { + printer.print(" = "); + n.getInit().accept(this, arg); + } + } + + @Override + public void visit(VariableDeclaratorId n, Object arg) { + printer.print(n.getName()); + for (int i = 0; i < n.getArrayCount(); i++) { + printer.print("[]"); + } + } + + @Override + public void visit(ArrayInitializerExpr n, Object arg) { + printer.print("{"); + if (n.getValues() != null) { + printer.print(" "); + for (Iterator i = n.getValues().iterator(); i.hasNext();) { + Expression expr = i.next(); + expr.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + printer.print(" "); + } + printer.print("}"); + } + + @Override + public void visit(VoidType n, Object arg) { + printer.print("void"); + } + + @Override + public void visit(ArrayAccessExpr n, Object arg) { + n.getName().accept(this, arg); + printer.print("["); + n.getIndex().accept(this, arg); + printer.print("]"); + } + + @Override + public void visit(ArrayCreationExpr n, Object arg) { + printer.print("new "); + n.getType().accept(this, arg); + + if (n.getDimensions() != null) { + for (Expression dim : n.getDimensions()) { + printer.print("["); + dim.accept(this, arg); + printer.print("]"); + } + for (int i = 0; i < n.getArrayCount(); i++) { + printer.print("[]"); + } + } else { + for (int i = 0; i < n.getArrayCount(); i++) { + printer.print("[]"); + } + printer.print(" "); + n.getInitializer().accept(this, arg); + } + } + + @Override + public void visit(AssignExpr n, Object arg) { + n.getTarget().accept(this, arg); + printer.print(" "); + switch (n.getOperator()) { + case assign: + printer.print("="); + break; + case and: + printer.print("&="); + break; + case or: + printer.print("|="); + break; + case xor: + printer.print("^="); + break; + case plus: + printer.print("+="); + break; + case minus: + printer.print("-="); + break; + case rem: + printer.print("%="); + break; + case slash: + printer.print("/="); + break; + case star: + printer.print("*="); + break; + case lShift: + printer.print("<<="); + break; + case rSignedShift: + printer.print(">>="); + break; + case rUnsignedShift: + printer.print(">>>="); + break; + } + printer.print(" "); + n.getValue().accept(this, arg); + } + + @Override + public void visit(BinaryExpr n, Object arg) { + n.getLeft().accept(this, arg); + printer.print(" "); + switch (n.getOperator()) { + case or: + printer.print("||"); + break; + case and: + printer.print("&&"); + break; + case binOr: + printer.print("|"); + break; + case binAnd: + printer.print("&"); + break; + case xor: + printer.print("^"); + break; + case equals: + printer.print("=="); + break; + case notEquals: + printer.print("!="); + break; + case less: + printer.print("<"); + break; + case greater: + printer.print(">"); + break; + case lessEquals: + printer.print("<="); + break; + case greaterEquals: + printer.print(">="); + break; + case lShift: + printer.print("<<"); + break; + case rSignedShift: + printer.print(">>"); + break; + case rUnsignedShift: + printer.print(">>>"); + break; + case plus: + printer.print("+"); + break; + case minus: + printer.print("-"); + break; + case times: + printer.print("*"); + break; + case divide: + printer.print("/"); + break; + case remainder: + printer.print("%"); + break; + } + printer.print(" "); + n.getRight().accept(this, arg); + } + + @Override + public void visit(CastExpr n, Object arg) { + printer.print("("); + n.getType().accept(this, arg); + printer.print(") "); + n.getExpr().accept(this, arg); + } + + @Override + public void visit(ClassExpr n, Object arg) { + n.getType().accept(this, arg); + printer.print(".class"); + } + + @Override + public void visit(ConditionalExpr n, Object arg) { + n.getCondition().accept(this, arg); + printer.print(" ? "); + n.getThenExpr().accept(this, arg); + printer.print(" : "); + n.getElseExpr().accept(this, arg); + } + + @Override + public void visit(EnclosedExpr n, Object arg) { + printer.print("("); + n.getInner().accept(this, arg); + printer.print(")"); + } + + @Override + public void visit(FieldAccessExpr n, Object arg) { + n.getScope().accept(this, arg); + printer.print("."); + printer.print(n.getField()); + } + + @Override + public void visit(InstanceOfExpr n, Object arg) { + n.getExpr().accept(this, arg); + printer.print(" instanceof "); + n.getType().accept(this, arg); + } + + @Override + public void visit(CharLiteralExpr n, Object arg) { + printer.print("'"); + printer.print(n.getValue()); + printer.print("'"); + } + + @Override + public void visit(DoubleLiteralExpr n, Object arg) { + printer.print(n.getValue()); + } + + @Override + public void visit(IntegerLiteralExpr n, Object arg) { + printer.print(n.getValue()); + } + + @Override + public void visit(LongLiteralExpr n, Object arg) { + printer.print(n.getValue()); + } + + @Override + public void visit(IntegerLiteralMinValueExpr n, Object arg) { + printer.print(n.getValue()); + } + + @Override + public void visit(LongLiteralMinValueExpr n, Object arg) { + printer.print(n.getValue()); + } + + @Override + public void visit(StringLiteralExpr n, Object arg) { + printer.print("\""); + printer.print(n.getValue()); + printer.print("\""); + } + + @Override + public void visit(BooleanLiteralExpr n, Object arg) { + printer.print(String.valueOf(n.getValue())); + } + + @Override + public void visit(NullLiteralExpr n, Object arg) { + printer.print("null"); + } + + @Override + public void visit(ThisExpr n, Object arg) { + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + printer.print("."); + } + printer.print("this"); + } + + @Override + public void visit(SuperExpr n, Object arg) { + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + printer.print("."); + } + printer.print("super"); + } + + @Override + public void visit(MethodCallExpr n, Object arg) { + if (n.getScope() != null) { + n.getScope().accept(this, arg); + printer.print("."); + } + printTypeArgs(n.getTypeArgs(), arg); + printer.print(n.getName()); + printArguments(n.getArgs(), arg); + } + + @Override + public void visit(ObjectCreationExpr n, Object arg) { + if (n.getScope() != null) { + n.getScope().accept(this, arg); + printer.print("."); + } + + printer.print("new "); + + printTypeArgs(n.getTypeArgs(), arg); + n.getType().accept(this, arg); + + printArguments(n.getArgs(), arg); + + if (n.getAnonymousClassBody() != null) { + printer.printLn(" {"); + printer.indent(); + printMembers(n.getAnonymousClassBody(), arg); + printer.unindent(); + printer.print("}"); + } + } + + @Override + public void visit(UnaryExpr n, Object arg) { + switch (n.getOperator()) { + case positive: + printer.print("+"); + break; + case negative: + printer.print("-"); + break; + case inverse: + printer.print("~"); + break; + case not: + printer.print("!"); + break; + case preIncrement: + printer.print("++"); + break; + case preDecrement: + printer.print("--"); + break; + } + + n.getExpr().accept(this, arg); + + switch (n.getOperator()) { + case posIncrement: + printer.print("++"); + break; + case posDecrement: + printer.print("--"); + break; + } + } + + @Override + public void visit(ConstructorDeclaration n, Object arg) { + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + printTypeParameters(n.getTypeParameters(), arg); + if (n.getTypeParameters() != null) { + printer.print(" "); + } + printer.print(n.getName()); + + printer.print("("); + if (n.getParameters() != null) { + for (Iterator i = n.getParameters().iterator(); i.hasNext();) { + Parameter p = i.next(); + p.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(")"); + + if (n.getThrows() != null) { + printer.print(" throws "); + for (Iterator i = n.getThrows().iterator(); i.hasNext();) { + NameExpr name = i.next(); + name.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(" "); + n.getBlock().accept(this, arg); + } + + @Override + public void visit(MethodDeclaration n, Object arg) { + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + printTypeParameters(n.getTypeParameters(), arg); + if (n.getTypeParameters() != null) { + printer.print(" "); + } + + n.getType().accept(this, arg); + printer.print(" "); + printer.print(n.getName()); + + printer.print("("); + if (n.getParameters() != null) { + for (Iterator i = n.getParameters().iterator(); i.hasNext();) { + Parameter p = i.next(); + p.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(")"); + + for (int i = 0; i < n.getArrayCount(); i++) { + printer.print("[]"); + } + + if (n.getThrows() != null) { + printer.print(" throws "); + for (Iterator i = n.getThrows().iterator(); i.hasNext();) { + NameExpr name = i.next(); + name.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + if (n.getBody() == null) { + printer.print(";"); + } else { + printer.print(" "); + n.getBody().accept(this, arg); + } + } + + @Override + public void visit(Parameter n, Object arg) { + printAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + n.getType().accept(this, arg); + if (n.isVarArgs()) { + printer.print("..."); + } + printer.print(" "); + n.getId().accept(this, arg); + } + + @Override + public void visit(ExplicitConstructorInvocationStmt n, Object arg) { + if (n.isThis()) { + printTypeArgs(n.getTypeArgs(), arg); + printer.print("this"); + } else { + if (n.getExpr() != null) { + n.getExpr().accept(this, arg); + printer.print("."); + } + printTypeArgs(n.getTypeArgs(), arg); + printer.print("super"); + } + printArguments(n.getArgs(), arg); + printer.print(";"); + } + + @Override + public void visit(VariableDeclarationExpr n, Object arg) { + printAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + n.getType().accept(this, arg); + printer.print(" "); + + for (Iterator i = n.getVars().iterator(); i.hasNext();) { + VariableDeclarator v = i.next(); + v.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + + @Override + public void visit(TypeDeclarationStmt n, Object arg) { + n.getTypeDeclaration().accept(this, arg); + } + + @Override + public void visit(AssertStmt n, Object arg) { + printer.print("assert "); + n.getCheck().accept(this, arg); + if (n.getMessage() != null) { + printer.print(" : "); + n.getMessage().accept(this, arg); + } + printer.print(";"); + } + + @Override + public void visit(BlockStmt n, Object arg) { + printer.printLn("{"); + if (n.getStmts() != null) { + printer.indent(); + for (Statement s : n.getStmts()) { + s.accept(this, arg); + printer.printLn(); + } + printer.unindent(); + } + printer.print("}"); + + } + + @Override + public void visit(LabeledStmt n, Object arg) { + printer.print(n.getLabel()); + printer.print(": "); + n.getStmt().accept(this, arg); + } + + @Override + public void visit(EmptyStmt n, Object arg) { + printer.print(";"); + } + + @Override + public void visit(ExpressionStmt n, Object arg) { + n.getExpression().accept(this, arg); + printer.print(";"); + } + + @Override + public void visit(SwitchStmt n, Object arg) { + printer.print("switch("); + n.getSelector().accept(this, arg); + printer.printLn(") {"); + if (n.getEntries() != null) { + printer.indent(); + for (SwitchEntryStmt e : n.getEntries()) { + e.accept(this, arg); + } + printer.unindent(); + } + printer.print("}"); + + } + + @Override + public void visit(SwitchEntryStmt n, Object arg) { + if (n.getLabel() != null) { + printer.print("case "); + n.getLabel().accept(this, arg); + printer.print(":"); + } else { + printer.print("default:"); + } + printer.printLn(); + printer.indent(); + if (n.getStmts() != null) { + for (Statement s : n.getStmts()) { + s.accept(this, arg); + printer.printLn(); + } + } + printer.unindent(); + } + + @Override + public void visit(BreakStmt n, Object arg) { + printer.print("break"); + if (n.getId() != null) { + printer.print(" "); + printer.print(n.getId()); + } + printer.print(";"); + } + + @Override + public void visit(ReturnStmt n, Object arg) { + printer.print("return"); + if (n.getExpr() != null) { + printer.print(" "); + n.getExpr().accept(this, arg); + } + printer.print(";"); + } + + @Override + public void visit(EnumDeclaration n, Object arg) { + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + printer.print("enum "); + printer.print(n.getName()); + + if (n.getImplements() != null) { + printer.print(" implements "); + for (Iterator i = n.getImplements().iterator(); i.hasNext();) { + ClassOrInterfaceType c = i.next(); + c.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + + printer.printLn(" {"); + printer.indent(); + if (n.getEntries() != null) { + printer.printLn(); + for (Iterator i = n.getEntries().iterator(); i.hasNext();) { + EnumConstantDeclaration e = i.next(); + e.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + if (n.getMembers() != null) { + printer.printLn(";"); + printMembers(n.getMembers(), arg); + } else { + if (n.getEntries() != null) { + printer.printLn(); + } + } + printer.unindent(); + printer.print("}"); + } + + @Override + public void visit(EnumConstantDeclaration n, Object arg) { + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printer.print(n.getName()); + + if (n.getArgs() != null) { + printArguments(n.getArgs(), arg); + } + + if (n.getClassBody() != null) { + printer.printLn(" {"); + printer.indent(); + printMembers(n.getClassBody(), arg); + printer.unindent(); + printer.printLn("}"); + } + } + + @Override + public void visit(EmptyMemberDeclaration n, Object arg) { + printJavadoc(n.getJavaDoc(), arg); + printer.print(";"); + } + + @Override + public void visit(InitializerDeclaration n, Object arg) { + printJavadoc(n.getJavaDoc(), arg); + if (n.isStatic()) { + printer.print("static "); + } + n.getBlock().accept(this, arg); + } + + @Override + public void visit(IfStmt n, Object arg) { + printer.print("if ("); + n.getCondition().accept(this, arg); + printer.print(") "); + n.getThenStmt().accept(this, arg); + if (n.getElseStmt() != null) { + printer.print(" else "); + n.getElseStmt().accept(this, arg); + } + } + + @Override + public void visit(WhileStmt n, Object arg) { + printer.print("while ("); + n.getCondition().accept(this, arg); + printer.print(") "); + n.getBody().accept(this, arg); + } + + @Override + public void visit(ContinueStmt n, Object arg) { + printer.print("continue"); + if (n.getId() != null) { + printer.print(" "); + printer.print(n.getId()); + } + printer.print(";"); + } + + @Override + public void visit(DoStmt n, Object arg) { + printer.print("do "); + n.getBody().accept(this, arg); + printer.print(" while ("); + n.getCondition().accept(this, arg); + printer.print(");"); + } + + @Override + public void visit(ForeachStmt n, Object arg) { + printer.print("for ("); + n.getVariable().accept(this, arg); + printer.print(" : "); + n.getIterable().accept(this, arg); + printer.print(") "); + n.getBody().accept(this, arg); + } + + @Override + public void visit(ForStmt n, Object arg) { + printer.print("for ("); + if (n.getInit() != null) { + for (Iterator i = n.getInit().iterator(); i.hasNext();) { + Expression e = i.next(); + e.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print("; "); + if (n.getCompare() != null) { + n.getCompare().accept(this, arg); + } + printer.print("; "); + if (n.getUpdate() != null) { + for (Iterator i = n.getUpdate().iterator(); i.hasNext();) { + Expression e = i.next(); + e.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(") "); + n.getBody().accept(this, arg); + } + + @Override + public void visit(ThrowStmt n, Object arg) { + printer.print("throw "); + n.getExpr().accept(this, arg); + printer.print(";"); + } + + @Override + public void visit(SynchronizedStmt n, Object arg) { + printer.print("synchronized ("); + n.getExpr().accept(this, arg); + printer.print(") "); + n.getBlock().accept(this, arg); + } + + @Override + public void visit(TryStmt n, Object arg) { + printer.print("try "); + n.getTryBlock().accept(this, arg); + if (n.getCatchs() != null) { + for (CatchClause c : n.getCatchs()) { + c.accept(this, arg); + } + } + if (n.getFinallyBlock() != null) { + printer.print(" finally "); + n.getFinallyBlock().accept(this, arg); + } + } + + @Override + public void visit(CatchClause n, Object arg) { + printer.print(" catch ("); + n.getExcept().accept(this, arg); + printer.print(") "); + n.getCatchBlock().accept(this, arg); + + } + + @Override + public void visit(AnnotationDeclaration n, Object arg) { + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + printer.print("@interface "); + printer.print(n.getName()); + printer.printLn(" {"); + printer.indent(); + if (n.getMembers() != null) { + printMembers(n.getMembers(), arg); + } + printer.unindent(); + printer.print("}"); + } + + @Override + public void visit(AnnotationMemberDeclaration n, Object arg) { + printJavadoc(n.getJavaDoc(), arg); + printMemberAnnotations(n.getAnnotations(), arg); + printModifiers(n.getModifiers()); + + n.getType().accept(this, arg); + printer.print(" "); + printer.print(n.getName()); + printer.print("()"); + if (n.getDefaultValue() != null) { + printer.print(" default "); + n.getDefaultValue().accept(this, arg); + } + printer.print(";"); + } + + @Override + public void visit(MarkerAnnotationExpr n, Object arg) { + printer.print("@"); + n.getName().accept(this, arg); + } + + @Override + public void visit(SingleMemberAnnotationExpr n, Object arg) { + printer.print("@"); + n.getName().accept(this, arg); + printer.print("("); + n.getMemberValue().accept(this, arg); + printer.print(")"); + } + + @Override + public void visit(NormalAnnotationExpr n, Object arg) { + printer.print("@"); + n.getName().accept(this, arg); + printer.print("("); + if (n.getPairs() != null) { + for (Iterator i = n.getPairs().iterator(); i.hasNext();) { + MemberValuePair m = i.next(); + m.accept(this, arg); + if (i.hasNext()) { + printer.print(", "); + } + } + } + printer.print(")"); + } + + @Override + public void visit(MemberValuePair n, Object arg) { + printer.print(n.getName()); + printer.print(" = "); + n.getValue().accept(this, arg); + } + + @Override + public void visit(LineComment n, Object arg) { + printer.print("//"); + printer.printLn(n.getContent()); + } + + @Override + public void visit(BlockComment n, Object arg) { + printer.print("/*"); + printer.print(n.getContent()); + printer.printLn("*/"); + } + + @Override + public void visit(Node n, Object arg) { + throw new IllegalStateException(n.getClass().getName()); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitor.java new file mode 100644 index 00000000000..8041649a27f --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitor.java @@ -0,0 +1,280 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.visitor; + +import japa.parser.ast.BlockComment; +import japa.parser.ast.CompilationUnit; +import japa.parser.ast.ImportDeclaration; +import japa.parser.ast.LineComment; +import japa.parser.ast.Node; +import japa.parser.ast.PackageDeclaration; +import japa.parser.ast.TypeParameter; +import japa.parser.ast.body.AnnotationDeclaration; +import japa.parser.ast.body.AnnotationMemberDeclaration; +import japa.parser.ast.body.ClassOrInterfaceDeclaration; +import japa.parser.ast.body.ConstructorDeclaration; +import japa.parser.ast.body.EmptyMemberDeclaration; +import japa.parser.ast.body.EmptyTypeDeclaration; +import japa.parser.ast.body.EnumConstantDeclaration; +import japa.parser.ast.body.EnumDeclaration; +import japa.parser.ast.body.FieldDeclaration; +import japa.parser.ast.body.InitializerDeclaration; +import japa.parser.ast.body.JavadocComment; +import japa.parser.ast.body.MethodDeclaration; +import japa.parser.ast.body.Parameter; +import japa.parser.ast.body.VariableDeclarator; +import japa.parser.ast.body.VariableDeclaratorId; +import japa.parser.ast.expr.ArrayAccessExpr; +import japa.parser.ast.expr.ArrayCreationExpr; +import japa.parser.ast.expr.ArrayInitializerExpr; +import japa.parser.ast.expr.AssignExpr; +import japa.parser.ast.expr.BinaryExpr; +import japa.parser.ast.expr.BooleanLiteralExpr; +import japa.parser.ast.expr.CastExpr; +import japa.parser.ast.expr.CharLiteralExpr; +import japa.parser.ast.expr.ClassExpr; +import japa.parser.ast.expr.ConditionalExpr; +import japa.parser.ast.expr.DoubleLiteralExpr; +import japa.parser.ast.expr.EnclosedExpr; +import japa.parser.ast.expr.FieldAccessExpr; +import japa.parser.ast.expr.InstanceOfExpr; +import japa.parser.ast.expr.IntegerLiteralExpr; +import japa.parser.ast.expr.IntegerLiteralMinValueExpr; +import japa.parser.ast.expr.LongLiteralExpr; +import japa.parser.ast.expr.LongLiteralMinValueExpr; +import japa.parser.ast.expr.MarkerAnnotationExpr; +import japa.parser.ast.expr.MemberValuePair; +import japa.parser.ast.expr.MethodCallExpr; +import japa.parser.ast.expr.NameExpr; +import japa.parser.ast.expr.NormalAnnotationExpr; +import japa.parser.ast.expr.NullLiteralExpr; +import japa.parser.ast.expr.ObjectCreationExpr; +import japa.parser.ast.expr.QualifiedNameExpr; +import japa.parser.ast.expr.SingleMemberAnnotationExpr; +import japa.parser.ast.expr.StringLiteralExpr; +import japa.parser.ast.expr.SuperExpr; +import japa.parser.ast.expr.ThisExpr; +import japa.parser.ast.expr.UnaryExpr; +import japa.parser.ast.expr.VariableDeclarationExpr; +import japa.parser.ast.stmt.AssertStmt; +import japa.parser.ast.stmt.BlockStmt; +import japa.parser.ast.stmt.BreakStmt; +import japa.parser.ast.stmt.CatchClause; +import japa.parser.ast.stmt.ContinueStmt; +import japa.parser.ast.stmt.DoStmt; +import japa.parser.ast.stmt.EmptyStmt; +import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; +import japa.parser.ast.stmt.ExpressionStmt; +import japa.parser.ast.stmt.ForStmt; +import japa.parser.ast.stmt.ForeachStmt; +import japa.parser.ast.stmt.IfStmt; +import japa.parser.ast.stmt.LabeledStmt; +import japa.parser.ast.stmt.ReturnStmt; +import japa.parser.ast.stmt.SwitchEntryStmt; +import japa.parser.ast.stmt.SwitchStmt; +import japa.parser.ast.stmt.SynchronizedStmt; +import japa.parser.ast.stmt.ThrowStmt; +import japa.parser.ast.stmt.TryStmt; +import japa.parser.ast.stmt.TypeDeclarationStmt; +import japa.parser.ast.stmt.WhileStmt; +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.type.PrimitiveType; +import japa.parser.ast.type.ReferenceType; +import japa.parser.ast.type.VoidType; +import japa.parser.ast.type.WildcardType; + +/** + * @author Julio Vilmar Gesser + */ +public interface GenericVisitor { + + public R visit(Node n, A arg); + + // - Compilation Unit ---------------------------------- + + public R visit(CompilationUnit n, A arg); + + public R visit(PackageDeclaration n, A arg); + + public R visit(ImportDeclaration n, A arg); + + public R visit(TypeParameter n, A arg); + + public R visit(LineComment n, A arg); + + public R visit(BlockComment n, A arg); + + // - Body ---------------------------------------------- + + public R visit(ClassOrInterfaceDeclaration n, A arg); + + public R visit(EnumDeclaration n, A arg); + + public R visit(EmptyTypeDeclaration n, A arg); + + public R visit(EnumConstantDeclaration n, A arg); + + public R visit(AnnotationDeclaration n, A arg); + + public R visit(AnnotationMemberDeclaration n, A arg); + + public R visit(FieldDeclaration n, A arg); + + public R visit(VariableDeclarator n, A arg); + + public R visit(VariableDeclaratorId n, A arg); + + public R visit(ConstructorDeclaration n, A arg); + + public R visit(MethodDeclaration n, A arg); + + public R visit(Parameter n, A arg); + + public R visit(EmptyMemberDeclaration n, A arg); + + public R visit(InitializerDeclaration n, A arg); + + public R visit(JavadocComment n, A arg); + + // - Type ---------------------------------------------- + + public R visit(ClassOrInterfaceType n, A arg); + + public R visit(PrimitiveType n, A arg); + + public R visit(ReferenceType n, A arg); + + public R visit(VoidType n, A arg); + + public R visit(WildcardType n, A arg); + + // - Expression ---------------------------------------- + + public R visit(ArrayAccessExpr n, A arg); + + public R visit(ArrayCreationExpr n, A arg); + + public R visit(ArrayInitializerExpr n, A arg); + + public R visit(AssignExpr n, A arg); + + public R visit(BinaryExpr n, A arg); + + public R visit(CastExpr n, A arg); + + public R visit(ClassExpr n, A arg); + + public R visit(ConditionalExpr n, A arg); + + public R visit(EnclosedExpr n, A arg); + + public R visit(FieldAccessExpr n, A arg); + + public R visit(InstanceOfExpr n, A arg); + + public R visit(StringLiteralExpr n, A arg); + + public R visit(IntegerLiteralExpr n, A arg); + + public R visit(LongLiteralExpr n, A arg); + + public R visit(IntegerLiteralMinValueExpr n, A arg); + + public R visit(LongLiteralMinValueExpr n, A arg); + + public R visit(CharLiteralExpr n, A arg); + + public R visit(DoubleLiteralExpr n, A arg); + + public R visit(BooleanLiteralExpr n, A arg); + + public R visit(NullLiteralExpr n, A arg); + + public R visit(MethodCallExpr n, A arg); + + public R visit(NameExpr n, A arg); + + public R visit(ObjectCreationExpr n, A arg); + + public R visit(QualifiedNameExpr n, A arg); + + public R visit(ThisExpr n, A arg); + + public R visit(SuperExpr n, A arg); + + public R visit(UnaryExpr n, A arg); + + public R visit(VariableDeclarationExpr n, A arg); + + public R visit(MarkerAnnotationExpr n, A arg); + + public R visit(SingleMemberAnnotationExpr n, A arg); + + public R visit(NormalAnnotationExpr n, A arg); + + public R visit(MemberValuePair n, A arg); + + // - Statements ---------------------------------------- + + public R visit(ExplicitConstructorInvocationStmt n, A arg); + + public R visit(TypeDeclarationStmt n, A arg); + + public R visit(AssertStmt n, A arg); + + public R visit(BlockStmt n, A arg); + + public R visit(LabeledStmt n, A arg); + + public R visit(EmptyStmt n, A arg); + + public R visit(ExpressionStmt n, A arg); + + public R visit(SwitchStmt n, A arg); + + public R visit(SwitchEntryStmt n, A arg); + + public R visit(BreakStmt n, A arg); + + public R visit(ReturnStmt n, A arg); + + public R visit(IfStmt n, A arg); + + public R visit(WhileStmt n, A arg); + + public R visit(ContinueStmt n, A arg); + + public R visit(DoStmt n, A arg); + + public R visit(ForeachStmt n, A arg); + + public R visit(ForStmt n, A arg); + + public R visit(ThrowStmt n, A arg); + + public R visit(SynchronizedStmt n, A arg); + + public R visit(TryStmt n, A arg); + + public R visit(CatchClause n, A arg); + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitorAdapter.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitorAdapter.java new file mode 100644 index 00000000000..5140baac26e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/GenericVisitorAdapter.java @@ -0,0 +1,910 @@ +/* + * Copyright (C) 2008 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 09/06/2008 + */ +package japa.parser.ast.visitor; + +import japa.parser.ast.BlockComment; +import japa.parser.ast.CompilationUnit; +import japa.parser.ast.ImportDeclaration; +import japa.parser.ast.LineComment; +import japa.parser.ast.Node; +import japa.parser.ast.PackageDeclaration; +import japa.parser.ast.TypeParameter; +import japa.parser.ast.body.AnnotationDeclaration; +import japa.parser.ast.body.AnnotationMemberDeclaration; +import japa.parser.ast.body.BodyDeclaration; +import japa.parser.ast.body.ClassOrInterfaceDeclaration; +import japa.parser.ast.body.ConstructorDeclaration; +import japa.parser.ast.body.EmptyMemberDeclaration; +import japa.parser.ast.body.EmptyTypeDeclaration; +import japa.parser.ast.body.EnumConstantDeclaration; +import japa.parser.ast.body.EnumDeclaration; +import japa.parser.ast.body.FieldDeclaration; +import japa.parser.ast.body.InitializerDeclaration; +import japa.parser.ast.body.JavadocComment; +import japa.parser.ast.body.MethodDeclaration; +import japa.parser.ast.body.Parameter; +import japa.parser.ast.body.TypeDeclaration; +import japa.parser.ast.body.VariableDeclarator; +import japa.parser.ast.body.VariableDeclaratorId; +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.expr.ArrayAccessExpr; +import japa.parser.ast.expr.ArrayCreationExpr; +import japa.parser.ast.expr.ArrayInitializerExpr; +import japa.parser.ast.expr.AssignExpr; +import japa.parser.ast.expr.BinaryExpr; +import japa.parser.ast.expr.BooleanLiteralExpr; +import japa.parser.ast.expr.CastExpr; +import japa.parser.ast.expr.CharLiteralExpr; +import japa.parser.ast.expr.ClassExpr; +import japa.parser.ast.expr.ConditionalExpr; +import japa.parser.ast.expr.DoubleLiteralExpr; +import japa.parser.ast.expr.EnclosedExpr; +import japa.parser.ast.expr.Expression; +import japa.parser.ast.expr.FieldAccessExpr; +import japa.parser.ast.expr.InstanceOfExpr; +import japa.parser.ast.expr.IntegerLiteralExpr; +import japa.parser.ast.expr.IntegerLiteralMinValueExpr; +import japa.parser.ast.expr.LongLiteralExpr; +import japa.parser.ast.expr.LongLiteralMinValueExpr; +import japa.parser.ast.expr.MarkerAnnotationExpr; +import japa.parser.ast.expr.MemberValuePair; +import japa.parser.ast.expr.MethodCallExpr; +import japa.parser.ast.expr.NameExpr; +import japa.parser.ast.expr.NormalAnnotationExpr; +import japa.parser.ast.expr.NullLiteralExpr; +import japa.parser.ast.expr.ObjectCreationExpr; +import japa.parser.ast.expr.QualifiedNameExpr; +import japa.parser.ast.expr.SingleMemberAnnotationExpr; +import japa.parser.ast.expr.StringLiteralExpr; +import japa.parser.ast.expr.SuperExpr; +import japa.parser.ast.expr.ThisExpr; +import japa.parser.ast.expr.UnaryExpr; +import japa.parser.ast.expr.VariableDeclarationExpr; +import japa.parser.ast.stmt.AssertStmt; +import japa.parser.ast.stmt.BlockStmt; +import japa.parser.ast.stmt.BreakStmt; +import japa.parser.ast.stmt.CatchClause; +import japa.parser.ast.stmt.ContinueStmt; +import japa.parser.ast.stmt.DoStmt; +import japa.parser.ast.stmt.EmptyStmt; +import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; +import japa.parser.ast.stmt.ExpressionStmt; +import japa.parser.ast.stmt.ForStmt; +import japa.parser.ast.stmt.ForeachStmt; +import japa.parser.ast.stmt.IfStmt; +import japa.parser.ast.stmt.LabeledStmt; +import japa.parser.ast.stmt.ReturnStmt; +import japa.parser.ast.stmt.Statement; +import japa.parser.ast.stmt.SwitchEntryStmt; +import japa.parser.ast.stmt.SwitchStmt; +import japa.parser.ast.stmt.SynchronizedStmt; +import japa.parser.ast.stmt.ThrowStmt; +import japa.parser.ast.stmt.TryStmt; +import japa.parser.ast.stmt.TypeDeclarationStmt; +import japa.parser.ast.stmt.WhileStmt; +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.type.PrimitiveType; +import japa.parser.ast.type.ReferenceType; +import japa.parser.ast.type.Type; +import japa.parser.ast.type.VoidType; +import japa.parser.ast.type.WildcardType; + +/** + * @author Julio Vilmar Gesser + */ +public class GenericVisitorAdapter implements GenericVisitor { + + @Override + public R visit(AnnotationDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getMembers() != null) { + for (BodyDeclaration member : n.getMembers()) { + member.accept(this, arg); + } + } + return null; + } + + @Override + public R visit(AnnotationMemberDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getType().accept(this, arg); + if (n.getDefaultValue() != null) { + n.getDefaultValue().accept(this, arg); + } + return null; + } + + @Override + public R visit(ArrayAccessExpr n, A arg) { + n.getName().accept(this, arg); + n.getIndex().accept(this, arg); + return null; + } + + @Override + public R visit(ArrayCreationExpr n, A arg) { + n.getType().accept(this, arg); + if (n.getDimensions() != null) { + for (Expression dim : n.getDimensions()) { + dim.accept(this, arg); + } + } else { + n.getInitializer().accept(this, arg); + } + return null; + } + + @Override + public R visit(ArrayInitializerExpr n, A arg) { + if (n.getValues() != null) { + for (Expression expr : n.getValues()) { + expr.accept(this, arg); + } + } + return null; + } + + @Override + public R visit(AssertStmt n, A arg) { + n.getCheck().accept(this, arg); + if (n.getMessage() != null) { + n.getMessage().accept(this, arg); + } + return null; + } + + @Override + public R visit(AssignExpr n, A arg) { + n.getTarget().accept(this, arg); + n.getValue().accept(this, arg); + return null; + } + + @Override + public R visit(BinaryExpr n, A arg) { + n.getLeft().accept(this, arg); + n.getRight().accept(this, arg); + return null; + } + + @Override + public R visit(BlockStmt n, A arg) { + if (n.getStmts() != null) { + for (Statement s : n.getStmts()) { + s.accept(this, arg); + } + } + return null; + + } + + @Override + public R visit(BooleanLiteralExpr n, A arg) { + return null; + } + + @Override + public R visit(BreakStmt n, A arg) { + return null; + } + + @Override + public R visit(CastExpr n, A arg) { + n.getType().accept(this, arg); + n.getExpr().accept(this, arg); + return null; + } + + @Override + public R visit(CatchClause n, A arg) { + n.getExcept().accept(this, arg); + n.getCatchBlock().accept(this, arg); + return null; + + } + + @Override + public R visit(CharLiteralExpr n, A arg) { + return null; + } + + @Override + public R visit(ClassExpr n, A arg) { + n.getType().accept(this, arg); + return null; + } + + @Override + public R visit(ClassOrInterfaceDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getTypeParameters() != null) { + for (TypeParameter t : n.getTypeParameters()) { + t.accept(this, arg); + } + } + if (n.getExtends() != null) { + for (ClassOrInterfaceType c : n.getExtends()) { + c.accept(this, arg); + } + } + + if (n.getImplements() != null) { + for (ClassOrInterfaceType c : n.getImplements()) { + c.accept(this, arg); + } + } + if (n.getMembers() != null) { + for (BodyDeclaration member : n.getMembers()) { + member.accept(this, arg); + } + } + return null; + } + + @Override + public R visit(ClassOrInterfaceType n, A arg) { + if (n.getScope() != null) { + n.getScope().accept(this, arg); + } + if (n.getTypeArgs() != null) { + for (Type t : n.getTypeArgs()) { + t.accept(this, arg); + } + } + return null; + } + + @Override + public R visit(CompilationUnit n, A arg) { + if (n.getPakage() != null) { + n.getPakage().accept(this, arg); + } + if (n.getImports() != null) { + for (ImportDeclaration i : n.getImports()) { + i.accept(this, arg); + } + } + if (n.getTypes() != null) { + for (TypeDeclaration typeDeclaration : n.getTypes()) { + typeDeclaration.accept(this, arg); + } + } + return null; + } + + @Override + public R visit(ConditionalExpr n, A arg) { + n.getCondition().accept(this, arg); + n.getThenExpr().accept(this, arg); + n.getElseExpr().accept(this, arg); + return null; + } + + @Override + public R visit(ConstructorDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getTypeParameters() != null) { + for (TypeParameter t : n.getTypeParameters()) { + t.accept(this, arg); + } + } + if (n.getParameters() != null) { + for (Parameter p : n.getParameters()) { + p.accept(this, arg); + } + } + if (n.getThrows() != null) { + for (NameExpr name : n.getThrows()) { + name.accept(this, arg); + } + } + n.getBlock().accept(this, arg); + return null; + } + + @Override + public R visit(ContinueStmt n, A arg) { + return null; + } + + @Override + public R visit(DoStmt n, A arg) { + n.getBody().accept(this, arg); + n.getCondition().accept(this, arg); + return null; + } + + @Override + public R visit(DoubleLiteralExpr n, A arg) { + return null; + } + + @Override + public R visit(EmptyMemberDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + return null; + } + + @Override + public R visit(EmptyStmt n, A arg) { + return null; + } + + @Override + public R visit(EmptyTypeDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + return null; + } + + @Override + public R visit(EnclosedExpr n, A arg) { + n.getInner().accept(this, arg); + return null; + } + + @Override + public R visit(EnumConstantDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getArgs() != null) { + for (Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + if (n.getClassBody() != null) { + for (BodyDeclaration member : n.getClassBody()) { + member.accept(this, arg); + } + } + return null; + } + + @Override + public R visit(EnumDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getImplements() != null) { + for (ClassOrInterfaceType c : n.getImplements()) { + c.accept(this, arg); + } + } + if (n.getEntries() != null) { + for (EnumConstantDeclaration e : n.getEntries()) { + e.accept(this, arg); + } + } + if (n.getMembers() != null) { + for (BodyDeclaration member : n.getMembers()) { + member.accept(this, arg); + } + } + return null; + } + + @Override + public R visit(ExplicitConstructorInvocationStmt n, A arg) { + if (!n.isThis()) { + if (n.getExpr() != null) { + n.getExpr().accept(this, arg); + } + } + if (n.getTypeArgs() != null) { + for (Type t : n.getTypeArgs()) { + t.accept(this, arg); + } + } + if (n.getArgs() != null) { + for (Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + return null; + } + + @Override + public R visit(ExpressionStmt n, A arg) { + n.getExpression().accept(this, arg); + return null; + } + + @Override + public R visit(FieldAccessExpr n, A arg) { + n.getScope().accept(this, arg); + return null; + } + + @Override + public R visit(FieldDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getType().accept(this, arg); + for (VariableDeclarator var : n.getVariables()) { + var.accept(this, arg); + } + return null; + } + + @Override + public R visit(ForeachStmt n, A arg) { + n.getVariable().accept(this, arg); + n.getIterable().accept(this, arg); + n.getBody().accept(this, arg); + return null; + } + + @Override + public R visit(ForStmt n, A arg) { + if (n.getInit() != null) { + for (Expression e : n.getInit()) { + e.accept(this, arg); + } + } + if (n.getCompare() != null) { + n.getCompare().accept(this, arg); + } + if (n.getUpdate() != null) { + for (Expression e : n.getUpdate()) { + e.accept(this, arg); + } + } + n.getBody().accept(this, arg); + return null; + } + + @Override + public R visit(IfStmt n, A arg) { + n.getCondition().accept(this, arg); + n.getThenStmt().accept(this, arg); + if (n.getElseStmt() != null) { + n.getElseStmt().accept(this, arg); + } + return null; + } + + @Override + public R visit(ImportDeclaration n, A arg) { + n.getName().accept(this, arg); + return null; + } + + @Override + public R visit(InitializerDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + n.getBlock().accept(this, arg); + return null; + } + + @Override + public R visit(InstanceOfExpr n, A arg) { + n.getExpr().accept(this, arg); + n.getType().accept(this, arg); + return null; + } + + @Override + public R visit(IntegerLiteralExpr n, A arg) { + return null; + } + + @Override + public R visit(IntegerLiteralMinValueExpr n, A arg) { + return null; + } + + @Override + public R visit(JavadocComment n, A arg) { + return null; + } + + @Override + public R visit(LabeledStmt n, A arg) { + n.getStmt().accept(this, arg); + return null; + } + + @Override + public R visit(LongLiteralExpr n, A arg) { + return null; + } + + @Override + public R visit(LongLiteralMinValueExpr n, A arg) { + return null; + } + + @Override + public R visit(MarkerAnnotationExpr n, A arg) { + n.getName().accept(this, arg); + return null; + } + + @Override + public R visit(MemberValuePair n, A arg) { + n.getValue().accept(this, arg); + return null; + } + + @Override + public R visit(MethodCallExpr n, A arg) { + if (n.getScope() != null) { + n.getScope().accept(this, arg); + } + if (n.getTypeArgs() != null) { + for (Type t : n.getTypeArgs()) { + t.accept(this, arg); + } + } + if (n.getArgs() != null) { + for (Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + return null; + } + + @Override + public R visit(MethodDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getTypeParameters() != null) { + for (TypeParameter t : n.getTypeParameters()) { + t.accept(this, arg); + } + } + n.getType().accept(this, arg); + if (n.getParameters() != null) { + for (Parameter p : n.getParameters()) { + p.accept(this, arg); + } + } + if (n.getThrows() != null) { + for (NameExpr name : n.getThrows()) { + name.accept(this, arg); + } + } + if (n.getBody() != null) { + n.getBody().accept(this, arg); + } + return null; + } + + @Override + public R visit(NameExpr n, A arg) { + return null; + } + + @Override + public R visit(NormalAnnotationExpr n, A arg) { + n.getName().accept(this, arg); + if (n.getPairs() != null) { + for (MemberValuePair m : n.getPairs()) { + m.accept(this, arg); + } + } + return null; + } + + @Override + public R visit(NullLiteralExpr n, A arg) { + return null; + } + + @Override + public R visit(ObjectCreationExpr n, A arg) { + if (n.getScope() != null) { + n.getScope().accept(this, arg); + } + if (n.getTypeArgs() != null) { + for (Type t : n.getTypeArgs()) { + t.accept(this, arg); + } + } + n.getType().accept(this, arg); + if (n.getArgs() != null) { + for (Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + if (n.getAnonymousClassBody() != null) { + for (BodyDeclaration member : n.getAnonymousClassBody()) { + member.accept(this, arg); + } + } + return null; + } + + @Override + public R visit(PackageDeclaration n, A arg) { + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getName().accept(this, arg); + return null; + } + + @Override + public R visit(Parameter n, A arg) { + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getType().accept(this, arg); + n.getId().accept(this, arg); + return null; + } + + @Override + public R visit(PrimitiveType n, A arg) { + return null; + } + + @Override + public R visit(QualifiedNameExpr n, A arg) { + n.getQualifier().accept(this, arg); + return null; + } + + @Override + public R visit(ReferenceType n, A arg) { + n.getType().accept(this, arg); + return null; + } + + @Override + public R visit(ReturnStmt n, A arg) { + if (n.getExpr() != null) { + n.getExpr().accept(this, arg); + } + return null; + } + + @Override + public R visit(SingleMemberAnnotationExpr n, A arg) { + n.getName().accept(this, arg); + n.getMemberValue().accept(this, arg); + return null; + } + + @Override + public R visit(StringLiteralExpr n, A arg) { + return null; + } + + @Override + public R visit(SuperExpr n, A arg) { + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + } + return null; + } + + @Override + public R visit(SwitchEntryStmt n, A arg) { + if (n.getLabel() != null) { + n.getLabel().accept(this, arg); + } + if (n.getStmts() != null) { + for (Statement s : n.getStmts()) { + s.accept(this, arg); + } + } + return null; + } + + @Override + public R visit(SwitchStmt n, A arg) { + n.getSelector().accept(this, arg); + if (n.getEntries() != null) { + for (SwitchEntryStmt e : n.getEntries()) { + e.accept(this, arg); + } + } + return null; + + } + + @Override + public R visit(SynchronizedStmt n, A arg) { + n.getExpr().accept(this, arg); + n.getBlock().accept(this, arg); + return null; + } + + @Override + public R visit(ThisExpr n, A arg) { + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + } + return null; + } + + @Override + public R visit(ThrowStmt n, A arg) { + n.getExpr().accept(this, arg); + return null; + } + + @Override + public R visit(TryStmt n, A arg) { + n.getTryBlock().accept(this, arg); + if (n.getCatchs() != null) { + for (CatchClause c : n.getCatchs()) { + c.accept(this, arg); + } + } + if (n.getFinallyBlock() != null) { + n.getFinallyBlock().accept(this, arg); + } + return null; + } + + @Override + public R visit(TypeDeclarationStmt n, A arg) { + n.getTypeDeclaration().accept(this, arg); + return null; + } + + @Override + public R visit(TypeParameter n, A arg) { + if (n.getTypeBound() != null) { + for (ClassOrInterfaceType c : n.getTypeBound()) { + c.accept(this, arg); + } + } + return null; + } + + @Override + public R visit(UnaryExpr n, A arg) { + n.getExpr().accept(this, arg); + return null; + } + + @Override + public R visit(VariableDeclarationExpr n, A arg) { + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getType().accept(this, arg); + for (VariableDeclarator v : n.getVars()) { + v.accept(this, arg); + } + return null; + } + + @Override + public R visit(VariableDeclarator n, A arg) { + n.getId().accept(this, arg); + if (n.getInit() != null) { + n.getInit().accept(this, arg); + } + return null; + } + + @Override + public R visit(VariableDeclaratorId n, A arg) { + return null; + } + + @Override + public R visit(VoidType n, A arg) { + return null; + } + + @Override + public R visit(WhileStmt n, A arg) { + n.getCondition().accept(this, arg); + n.getBody().accept(this, arg); + return null; + } + + @Override + public R visit(WildcardType n, A arg) { + if (n.getExtends() != null) { + n.getExtends().accept(this, arg); + } + if (n.getSuper() != null) { + n.getSuper().accept(this, arg); + } + return null; + } + + @Override + public R visit(BlockComment n, A arg) { + return null; + } + + @Override + public R visit(LineComment n, A arg) { + return null; + } + + @Override + public R visit(Node n, A arg) { + throw new IllegalStateException(n.getClass().getName()); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitor.java new file mode 100644 index 00000000000..4996631b4be --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitor.java @@ -0,0 +1,280 @@ +/* + * Copyright (C) 2007 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 05/10/2006 + */ +package japa.parser.ast.visitor; + +import japa.parser.ast.BlockComment; +import japa.parser.ast.CompilationUnit; +import japa.parser.ast.ImportDeclaration; +import japa.parser.ast.LineComment; +import japa.parser.ast.Node; +import japa.parser.ast.PackageDeclaration; +import japa.parser.ast.TypeParameter; +import japa.parser.ast.body.AnnotationDeclaration; +import japa.parser.ast.body.AnnotationMemberDeclaration; +import japa.parser.ast.body.ClassOrInterfaceDeclaration; +import japa.parser.ast.body.ConstructorDeclaration; +import japa.parser.ast.body.EmptyMemberDeclaration; +import japa.parser.ast.body.EmptyTypeDeclaration; +import japa.parser.ast.body.EnumConstantDeclaration; +import japa.parser.ast.body.EnumDeclaration; +import japa.parser.ast.body.FieldDeclaration; +import japa.parser.ast.body.InitializerDeclaration; +import japa.parser.ast.body.JavadocComment; +import japa.parser.ast.body.MethodDeclaration; +import japa.parser.ast.body.Parameter; +import japa.parser.ast.body.VariableDeclarator; +import japa.parser.ast.body.VariableDeclaratorId; +import japa.parser.ast.expr.ArrayAccessExpr; +import japa.parser.ast.expr.ArrayCreationExpr; +import japa.parser.ast.expr.ArrayInitializerExpr; +import japa.parser.ast.expr.AssignExpr; +import japa.parser.ast.expr.BinaryExpr; +import japa.parser.ast.expr.BooleanLiteralExpr; +import japa.parser.ast.expr.CastExpr; +import japa.parser.ast.expr.CharLiteralExpr; +import japa.parser.ast.expr.ClassExpr; +import japa.parser.ast.expr.ConditionalExpr; +import japa.parser.ast.expr.DoubleLiteralExpr; +import japa.parser.ast.expr.EnclosedExpr; +import japa.parser.ast.expr.FieldAccessExpr; +import japa.parser.ast.expr.InstanceOfExpr; +import japa.parser.ast.expr.IntegerLiteralExpr; +import japa.parser.ast.expr.IntegerLiteralMinValueExpr; +import japa.parser.ast.expr.LongLiteralExpr; +import japa.parser.ast.expr.LongLiteralMinValueExpr; +import japa.parser.ast.expr.MarkerAnnotationExpr; +import japa.parser.ast.expr.MemberValuePair; +import japa.parser.ast.expr.MethodCallExpr; +import japa.parser.ast.expr.NameExpr; +import japa.parser.ast.expr.NormalAnnotationExpr; +import japa.parser.ast.expr.NullLiteralExpr; +import japa.parser.ast.expr.ObjectCreationExpr; +import japa.parser.ast.expr.QualifiedNameExpr; +import japa.parser.ast.expr.SingleMemberAnnotationExpr; +import japa.parser.ast.expr.StringLiteralExpr; +import japa.parser.ast.expr.SuperExpr; +import japa.parser.ast.expr.ThisExpr; +import japa.parser.ast.expr.UnaryExpr; +import japa.parser.ast.expr.VariableDeclarationExpr; +import japa.parser.ast.stmt.AssertStmt; +import japa.parser.ast.stmt.BlockStmt; +import japa.parser.ast.stmt.BreakStmt; +import japa.parser.ast.stmt.CatchClause; +import japa.parser.ast.stmt.ContinueStmt; +import japa.parser.ast.stmt.DoStmt; +import japa.parser.ast.stmt.EmptyStmt; +import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; +import japa.parser.ast.stmt.ExpressionStmt; +import japa.parser.ast.stmt.ForStmt; +import japa.parser.ast.stmt.ForeachStmt; +import japa.parser.ast.stmt.IfStmt; +import japa.parser.ast.stmt.LabeledStmt; +import japa.parser.ast.stmt.ReturnStmt; +import japa.parser.ast.stmt.SwitchEntryStmt; +import japa.parser.ast.stmt.SwitchStmt; +import japa.parser.ast.stmt.SynchronizedStmt; +import japa.parser.ast.stmt.ThrowStmt; +import japa.parser.ast.stmt.TryStmt; +import japa.parser.ast.stmt.TypeDeclarationStmt; +import japa.parser.ast.stmt.WhileStmt; +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.type.PrimitiveType; +import japa.parser.ast.type.ReferenceType; +import japa.parser.ast.type.VoidType; +import japa.parser.ast.type.WildcardType; + +/** + * @author Julio Vilmar Gesser + */ +public interface VoidVisitor { + + public void visit(Node n, A arg); + + // - Compilation Unit ---------------------------------- + + public void visit(CompilationUnit n, A arg); + + public void visit(PackageDeclaration n, A arg); + + public void visit(ImportDeclaration n, A arg); + + public void visit(TypeParameter n, A arg); + + public void visit(LineComment n, A arg); + + public void visit(BlockComment n, A arg); + + // - Body ---------------------------------------------- + + public void visit(ClassOrInterfaceDeclaration n, A arg); + + public void visit(EnumDeclaration n, A arg); + + public void visit(EmptyTypeDeclaration n, A arg); + + public void visit(EnumConstantDeclaration n, A arg); + + public void visit(AnnotationDeclaration n, A arg); + + public void visit(AnnotationMemberDeclaration n, A arg); + + public void visit(FieldDeclaration n, A arg); + + public void visit(VariableDeclarator n, A arg); + + public void visit(VariableDeclaratorId n, A arg); + + public void visit(ConstructorDeclaration n, A arg); + + public void visit(MethodDeclaration n, A arg); + + public void visit(Parameter n, A arg); + + public void visit(EmptyMemberDeclaration n, A arg); + + public void visit(InitializerDeclaration n, A arg); + + public void visit(JavadocComment n, A arg); + + // - Type ---------------------------------------------- + + public void visit(ClassOrInterfaceType n, A arg); + + public void visit(PrimitiveType n, A arg); + + public void visit(ReferenceType n, A arg); + + public void visit(VoidType n, A arg); + + public void visit(WildcardType n, A arg); + + // - Expression ---------------------------------------- + + public void visit(ArrayAccessExpr n, A arg); + + public void visit(ArrayCreationExpr n, A arg); + + public void visit(ArrayInitializerExpr n, A arg); + + public void visit(AssignExpr n, A arg); + + public void visit(BinaryExpr n, A arg); + + public void visit(CastExpr n, A arg); + + public void visit(ClassExpr n, A arg); + + public void visit(ConditionalExpr n, A arg); + + public void visit(EnclosedExpr n, A arg); + + public void visit(FieldAccessExpr n, A arg); + + public void visit(InstanceOfExpr n, A arg); + + public void visit(StringLiteralExpr n, A arg); + + public void visit(IntegerLiteralExpr n, A arg); + + public void visit(LongLiteralExpr n, A arg); + + public void visit(IntegerLiteralMinValueExpr n, A arg); + + public void visit(LongLiteralMinValueExpr n, A arg); + + public void visit(CharLiteralExpr n, A arg); + + public void visit(DoubleLiteralExpr n, A arg); + + public void visit(BooleanLiteralExpr n, A arg); + + public void visit(NullLiteralExpr n, A arg); + + public void visit(MethodCallExpr n, A arg); + + public void visit(NameExpr n, A arg); + + public void visit(ObjectCreationExpr n, A arg); + + public void visit(QualifiedNameExpr n, A arg); + + public void visit(ThisExpr n, A arg); + + public void visit(SuperExpr n, A arg); + + public void visit(UnaryExpr n, A arg); + + public void visit(VariableDeclarationExpr n, A arg); + + public void visit(MarkerAnnotationExpr n, A arg); + + public void visit(SingleMemberAnnotationExpr n, A arg); + + public void visit(NormalAnnotationExpr n, A arg); + + public void visit(MemberValuePair n, A arg); + + // - Statements ---------------------------------------- + + public void visit(ExplicitConstructorInvocationStmt n, A arg); + + public void visit(TypeDeclarationStmt n, A arg); + + public void visit(AssertStmt n, A arg); + + public void visit(BlockStmt n, A arg); + + public void visit(LabeledStmt n, A arg); + + public void visit(EmptyStmt n, A arg); + + public void visit(ExpressionStmt n, A arg); + + public void visit(SwitchStmt n, A arg); + + public void visit(SwitchEntryStmt n, A arg); + + public void visit(BreakStmt n, A arg); + + public void visit(ReturnStmt n, A arg); + + public void visit(IfStmt n, A arg); + + public void visit(WhileStmt n, A arg); + + public void visit(ContinueStmt n, A arg); + + public void visit(DoStmt n, A arg); + + public void visit(ForeachStmt n, A arg); + + public void visit(ForStmt n, A arg); + + public void visit(ThrowStmt n, A arg); + + public void visit(SynchronizedStmt n, A arg); + + public void visit(TryStmt n, A arg); + + public void visit(CatchClause n, A arg); + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitorAdapter.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitorAdapter.java new file mode 100644 index 00000000000..ed7af7e364a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/ast/visitor/VoidVisitorAdapter.java @@ -0,0 +1,828 @@ +/* + * Copyright (C) 2008 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +/* + * Created on 09/06/2008 + */ +package japa.parser.ast.visitor; + +import japa.parser.ast.BlockComment; +import japa.parser.ast.CompilationUnit; +import japa.parser.ast.ImportDeclaration; +import japa.parser.ast.LineComment; +import japa.parser.ast.Node; +import japa.parser.ast.PackageDeclaration; +import japa.parser.ast.TypeParameter; +import japa.parser.ast.body.AnnotationDeclaration; +import japa.parser.ast.body.AnnotationMemberDeclaration; +import japa.parser.ast.body.BodyDeclaration; +import japa.parser.ast.body.ClassOrInterfaceDeclaration; +import japa.parser.ast.body.ConstructorDeclaration; +import japa.parser.ast.body.EmptyMemberDeclaration; +import japa.parser.ast.body.EmptyTypeDeclaration; +import japa.parser.ast.body.EnumConstantDeclaration; +import japa.parser.ast.body.EnumDeclaration; +import japa.parser.ast.body.FieldDeclaration; +import japa.parser.ast.body.InitializerDeclaration; +import japa.parser.ast.body.JavadocComment; +import japa.parser.ast.body.MethodDeclaration; +import japa.parser.ast.body.Parameter; +import japa.parser.ast.body.TypeDeclaration; +import japa.parser.ast.body.VariableDeclarator; +import japa.parser.ast.body.VariableDeclaratorId; +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.expr.ArrayAccessExpr; +import japa.parser.ast.expr.ArrayCreationExpr; +import japa.parser.ast.expr.ArrayInitializerExpr; +import japa.parser.ast.expr.AssignExpr; +import japa.parser.ast.expr.BinaryExpr; +import japa.parser.ast.expr.BooleanLiteralExpr; +import japa.parser.ast.expr.CastExpr; +import japa.parser.ast.expr.CharLiteralExpr; +import japa.parser.ast.expr.ClassExpr; +import japa.parser.ast.expr.ConditionalExpr; +import japa.parser.ast.expr.DoubleLiteralExpr; +import japa.parser.ast.expr.EnclosedExpr; +import japa.parser.ast.expr.Expression; +import japa.parser.ast.expr.FieldAccessExpr; +import japa.parser.ast.expr.InstanceOfExpr; +import japa.parser.ast.expr.IntegerLiteralExpr; +import japa.parser.ast.expr.IntegerLiteralMinValueExpr; +import japa.parser.ast.expr.LongLiteralExpr; +import japa.parser.ast.expr.LongLiteralMinValueExpr; +import japa.parser.ast.expr.MarkerAnnotationExpr; +import japa.parser.ast.expr.MemberValuePair; +import japa.parser.ast.expr.MethodCallExpr; +import japa.parser.ast.expr.NameExpr; +import japa.parser.ast.expr.NormalAnnotationExpr; +import japa.parser.ast.expr.NullLiteralExpr; +import japa.parser.ast.expr.ObjectCreationExpr; +import japa.parser.ast.expr.QualifiedNameExpr; +import japa.parser.ast.expr.SingleMemberAnnotationExpr; +import japa.parser.ast.expr.StringLiteralExpr; +import japa.parser.ast.expr.SuperExpr; +import japa.parser.ast.expr.ThisExpr; +import japa.parser.ast.expr.UnaryExpr; +import japa.parser.ast.expr.VariableDeclarationExpr; +import japa.parser.ast.stmt.AssertStmt; +import japa.parser.ast.stmt.BlockStmt; +import japa.parser.ast.stmt.BreakStmt; +import japa.parser.ast.stmt.CatchClause; +import japa.parser.ast.stmt.ContinueStmt; +import japa.parser.ast.stmt.DoStmt; +import japa.parser.ast.stmt.EmptyStmt; +import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; +import japa.parser.ast.stmt.ExpressionStmt; +import japa.parser.ast.stmt.ForStmt; +import japa.parser.ast.stmt.ForeachStmt; +import japa.parser.ast.stmt.IfStmt; +import japa.parser.ast.stmt.LabeledStmt; +import japa.parser.ast.stmt.ReturnStmt; +import japa.parser.ast.stmt.Statement; +import japa.parser.ast.stmt.SwitchEntryStmt; +import japa.parser.ast.stmt.SwitchStmt; +import japa.parser.ast.stmt.SynchronizedStmt; +import japa.parser.ast.stmt.ThrowStmt; +import japa.parser.ast.stmt.TryStmt; +import japa.parser.ast.stmt.TypeDeclarationStmt; +import japa.parser.ast.stmt.WhileStmt; +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.type.PrimitiveType; +import japa.parser.ast.type.ReferenceType; +import japa.parser.ast.type.Type; +import japa.parser.ast.type.VoidType; +import japa.parser.ast.type.WildcardType; + +/** + * @author Julio Vilmar Gesser + */ +public class VoidVisitorAdapter implements VoidVisitor { + + @Override + public void visit(AnnotationDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getMembers() != null) { + for (BodyDeclaration member : n.getMembers()) { + member.accept(this, arg); + } + } + } + + @Override + public void visit(AnnotationMemberDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getType().accept(this, arg); + if (n.getDefaultValue() != null) { + n.getDefaultValue().accept(this, arg); + } + } + + @Override + public void visit(ArrayAccessExpr n, A arg) { + n.getName().accept(this, arg); + n.getIndex().accept(this, arg); + } + + @Override + public void visit(ArrayCreationExpr n, A arg) { + n.getType().accept(this, arg); + if (n.getDimensions() != null) { + for (Expression dim : n.getDimensions()) { + dim.accept(this, arg); + } + } else { + n.getInitializer().accept(this, arg); + } + } + + @Override + public void visit(ArrayInitializerExpr n, A arg) { + if (n.getValues() != null) { + for (Expression expr : n.getValues()) { + expr.accept(this, arg); + } + } + } + + @Override + public void visit(AssertStmt n, A arg) { + n.getCheck().accept(this, arg); + if (n.getMessage() != null) { + n.getMessage().accept(this, arg); + } + } + + @Override + public void visit(AssignExpr n, A arg) { + n.getTarget().accept(this, arg); + n.getValue().accept(this, arg); + } + + @Override + public void visit(BinaryExpr n, A arg) { + n.getLeft().accept(this, arg); + n.getRight().accept(this, arg); + } + + @Override + public void visit(BlockComment n, A arg) { + } + + @Override + public void visit(BlockStmt n, A arg) { + if (n.getStmts() != null) { + for (Statement s : n.getStmts()) { + s.accept(this, arg); + } + } + } + + @Override + public void visit(BooleanLiteralExpr n, A arg) { + } + + @Override + public void visit(BreakStmt n, A arg) { + } + + @Override + public void visit(CastExpr n, A arg) { + n.getType().accept(this, arg); + n.getExpr().accept(this, arg); + } + + @Override + public void visit(CatchClause n, A arg) { + n.getExcept().accept(this, arg); + n.getCatchBlock().accept(this, arg); + } + + @Override + public void visit(CharLiteralExpr n, A arg) { + } + + @Override + public void visit(ClassExpr n, A arg) { + n.getType().accept(this, arg); + } + + @Override + public void visit(ClassOrInterfaceDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getTypeParameters() != null) { + for (TypeParameter t : n.getTypeParameters()) { + t.accept(this, arg); + } + } + if (n.getExtends() != null) { + for (ClassOrInterfaceType c : n.getExtends()) { + c.accept(this, arg); + } + } + + if (n.getImplements() != null) { + for (ClassOrInterfaceType c : n.getImplements()) { + c.accept(this, arg); + } + } + if (n.getMembers() != null) { + for (BodyDeclaration member : n.getMembers()) { + member.accept(this, arg); + } + } + } + + @Override + public void visit(ClassOrInterfaceType n, A arg) { + if (n.getScope() != null) { + n.getScope().accept(this, arg); + } + if (n.getTypeArgs() != null) { + for (Type t : n.getTypeArgs()) { + t.accept(this, arg); + } + } + } + + @Override + public void visit(CompilationUnit n, A arg) { + if (n.getPakage() != null) { + n.getPakage().accept(this, arg); + } + if (n.getImports() != null) { + for (ImportDeclaration i : n.getImports()) { + i.accept(this, arg); + } + } + if (n.getTypes() != null) { + for (TypeDeclaration typeDeclaration : n.getTypes()) { + typeDeclaration.accept(this, arg); + } + } + } + + @Override + public void visit(ConditionalExpr n, A arg) { + n.getCondition().accept(this, arg); + n.getThenExpr().accept(this, arg); + n.getElseExpr().accept(this, arg); + } + + @Override + public void visit(ConstructorDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getTypeParameters() != null) { + for (TypeParameter t : n.getTypeParameters()) { + t.accept(this, arg); + } + } + if (n.getParameters() != null) { + for (Parameter p : n.getParameters()) { + p.accept(this, arg); + } + } + if (n.getThrows() != null) { + for (NameExpr name : n.getThrows()) { + name.accept(this, arg); + } + } + n.getBlock().accept(this, arg); + } + + @Override + public void visit(ContinueStmt n, A arg) { + } + + @Override + public void visit(DoStmt n, A arg) { + n.getBody().accept(this, arg); + n.getCondition().accept(this, arg); + } + + @Override + public void visit(DoubleLiteralExpr n, A arg) { + } + + @Override + public void visit(EmptyMemberDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + } + + @Override + public void visit(EmptyStmt n, A arg) { + } + + @Override + public void visit(EmptyTypeDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + } + + @Override + public void visit(EnclosedExpr n, A arg) { + n.getInner().accept(this, arg); + } + + @Override + public void visit(EnumConstantDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getArgs() != null) { + for (Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + if (n.getClassBody() != null) { + for (BodyDeclaration member : n.getClassBody()) { + member.accept(this, arg); + } + } + } + + @Override + public void visit(EnumDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getImplements() != null) { + for (ClassOrInterfaceType c : n.getImplements()) { + c.accept(this, arg); + } + } + if (n.getEntries() != null) { + for (EnumConstantDeclaration e : n.getEntries()) { + e.accept(this, arg); + } + } + if (n.getMembers() != null) { + for (BodyDeclaration member : n.getMembers()) { + member.accept(this, arg); + } + } + } + + @Override + public void visit(ExplicitConstructorInvocationStmt n, A arg) { + if (!n.isThis()) { + if (n.getExpr() != null) { + n.getExpr().accept(this, arg); + } + } + if (n.getTypeArgs() != null) { + for (Type t : n.getTypeArgs()) { + t.accept(this, arg); + } + } + if (n.getArgs() != null) { + for (Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + } + + @Override + public void visit(ExpressionStmt n, A arg) { + n.getExpression().accept(this, arg); + } + + @Override + public void visit(FieldAccessExpr n, A arg) { + n.getScope().accept(this, arg); + } + + @Override + public void visit(FieldDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getType().accept(this, arg); + for (VariableDeclarator var : n.getVariables()) { + var.accept(this, arg); + } + } + + @Override + public void visit(ForeachStmt n, A arg) { + n.getVariable().accept(this, arg); + n.getIterable().accept(this, arg); + n.getBody().accept(this, arg); + } + + @Override + public void visit(ForStmt n, A arg) { + if (n.getInit() != null) { + for (Expression e : n.getInit()) { + e.accept(this, arg); + } + } + if (n.getCompare() != null) { + n.getCompare().accept(this, arg); + } + if (n.getUpdate() != null) { + for (Expression e : n.getUpdate()) { + e.accept(this, arg); + } + } + n.getBody().accept(this, arg); + } + + @Override + public void visit(IfStmt n, A arg) { + n.getCondition().accept(this, arg); + n.getThenStmt().accept(this, arg); + if (n.getElseStmt() != null) { + n.getElseStmt().accept(this, arg); + } + } + + @Override + public void visit(ImportDeclaration n, A arg) { + n.getName().accept(this, arg); + } + + @Override + public void visit(InitializerDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + n.getBlock().accept(this, arg); + } + + @Override + public void visit(InstanceOfExpr n, A arg) { + n.getExpr().accept(this, arg); + n.getType().accept(this, arg); + } + + @Override + public void visit(IntegerLiteralExpr n, A arg) { + } + + @Override + public void visit(IntegerLiteralMinValueExpr n, A arg) { + } + + @Override + public void visit(JavadocComment n, A arg) { + } + + @Override + public void visit(LabeledStmt n, A arg) { + n.getStmt().accept(this, arg); + } + + @Override + public void visit(LineComment n, A arg) { + } + + @Override + public void visit(LongLiteralExpr n, A arg) { + } + + @Override + public void visit(LongLiteralMinValueExpr n, A arg) { + } + + @Override + public void visit(MarkerAnnotationExpr n, A arg) { + n.getName().accept(this, arg); + } + + @Override + public void visit(MemberValuePair n, A arg) { + n.getValue().accept(this, arg); + } + + @Override + public void visit(MethodCallExpr n, A arg) { + if (n.getScope() != null) { + n.getScope().accept(this, arg); + } + if (n.getTypeArgs() != null) { + for (Type t : n.getTypeArgs()) { + t.accept(this, arg); + } + } + if (n.getArgs() != null) { + for (Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + } + + @Override + public void visit(MethodDeclaration n, A arg) { + if (n.getJavaDoc() != null) { + n.getJavaDoc().accept(this, arg); + } + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + if (n.getTypeParameters() != null) { + for (TypeParameter t : n.getTypeParameters()) { + t.accept(this, arg); + } + } + n.getType().accept(this, arg); + if (n.getParameters() != null) { + for (Parameter p : n.getParameters()) { + p.accept(this, arg); + } + } + if (n.getThrows() != null) { + for (NameExpr name : n.getThrows()) { + name.accept(this, arg); + } + } + if (n.getBody() != null) { + n.getBody().accept(this, arg); + } + } + + @Override + public void visit(NameExpr n, A arg) { + } + + @Override + public void visit(Node n, A arg) { + throw new IllegalStateException(n.getClass().getName()); + } + + @Override + public void visit(NormalAnnotationExpr n, A arg) { + n.getName().accept(this, arg); + if (n.getPairs() != null) { + for (MemberValuePair m : n.getPairs()) { + m.accept(this, arg); + } + } + } + + @Override + public void visit(NullLiteralExpr n, A arg) { + } + + @Override + public void visit(ObjectCreationExpr n, A arg) { + if (n.getScope() != null) { + n.getScope().accept(this, arg); + } + if (n.getTypeArgs() != null) { + for (Type t : n.getTypeArgs()) { + t.accept(this, arg); + } + } + n.getType().accept(this, arg); + if (n.getArgs() != null) { + for (Expression e : n.getArgs()) { + e.accept(this, arg); + } + } + if (n.getAnonymousClassBody() != null) { + for (BodyDeclaration member : n.getAnonymousClassBody()) { + member.accept(this, arg); + } + } + } + + @Override + public void visit(PackageDeclaration n, A arg) { + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getName().accept(this, arg); + } + + @Override + public void visit(Parameter n, A arg) { + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getType().accept(this, arg); + n.getId().accept(this, arg); + } + + @Override + public void visit(PrimitiveType n, A arg) { + } + + @Override + public void visit(QualifiedNameExpr n, A arg) { + n.getQualifier().accept(this, arg); + } + + @Override + public void visit(ReferenceType n, A arg) { + n.getType().accept(this, arg); + } + + @Override + public void visit(ReturnStmt n, A arg) { + if (n.getExpr() != null) { + n.getExpr().accept(this, arg); + } + } + + @Override + public void visit(SingleMemberAnnotationExpr n, A arg) { + n.getName().accept(this, arg); + n.getMemberValue().accept(this, arg); + } + + @Override + public void visit(StringLiteralExpr n, A arg) { + } + + @Override + public void visit(SuperExpr n, A arg) { + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + } + } + + @Override + public void visit(SwitchEntryStmt n, A arg) { + if (n.getLabel() != null) { + n.getLabel().accept(this, arg); + } + if (n.getStmts() != null) { + for (Statement s : n.getStmts()) { + s.accept(this, arg); + } + } + } + + @Override + public void visit(SwitchStmt n, A arg) { + n.getSelector().accept(this, arg); + if (n.getEntries() != null) { + for (SwitchEntryStmt e : n.getEntries()) { + e.accept(this, arg); + } + } + } + + @Override + public void visit(SynchronizedStmt n, A arg) { + n.getExpr().accept(this, arg); + n.getBlock().accept(this, arg); + + } + + @Override + public void visit(ThisExpr n, A arg) { + if (n.getClassExpr() != null) { + n.getClassExpr().accept(this, arg); + } + } + + @Override + public void visit(ThrowStmt n, A arg) { + n.getExpr().accept(this, arg); + } + + @Override + public void visit(TryStmt n, A arg) { + n.getTryBlock().accept(this, arg); + if (n.getCatchs() != null) { + for (CatchClause c : n.getCatchs()) { + c.accept(this, arg); + } + } + if (n.getFinallyBlock() != null) { + n.getFinallyBlock().accept(this, arg); + } + } + + @Override + public void visit(TypeDeclarationStmt n, A arg) { + n.getTypeDeclaration().accept(this, arg); + } + + @Override + public void visit(TypeParameter n, A arg) { + if (n.getTypeBound() != null) { + for (ClassOrInterfaceType c : n.getTypeBound()) { + c.accept(this, arg); + } + } + } + + @Override + public void visit(UnaryExpr n, A arg) { + n.getExpr().accept(this, arg); + } + + @Override + public void visit(VariableDeclarationExpr n, A arg) { + if (n.getAnnotations() != null) { + for (AnnotationExpr a : n.getAnnotations()) { + a.accept(this, arg); + } + } + n.getType().accept(this, arg); + for (VariableDeclarator v : n.getVars()) { + v.accept(this, arg); + } + } + + @Override + public void visit(VariableDeclarator n, A arg) { + n.getId().accept(this, arg); + if (n.getInit() != null) { + n.getInit().accept(this, arg); + } + } + + @Override + public void visit(VariableDeclaratorId n, A arg) { + } + + @Override + public void visit(VoidType n, A arg) { + } + + @Override + public void visit(WhileStmt n, A arg) { + n.getCondition().accept(this, arg); + n.getBody().accept(this, arg); + } + + @Override + public void visit(WildcardType n, A arg) { + if (n.getExtends() != null) { + n.getExtends().accept(this, arg); + } + if (n.getSuper() != null) { + n.getSuper().accept(this, arg); + } + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/java_1_5.jj b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/java_1_5.jj new file mode 100644 index 00000000000..f35074082d9 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/japa/parser/java_1_5.jj @@ -0,0 +1,3006 @@ +/* + * Copyright (C) 2008 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ + +options { + LOOKAHEAD=1; + STATIC=false; + JAVA_UNICODE_ESCAPE=true; + COMMON_TOKEN_ACTION=true; + //SUPPORT_CLASS_VISIBILITY_PUBLIC=false; + JDK_VERSION = "1.5"; + TOKEN_FACTORY = "ASTParser.GTToken"; +} + +PARSER_BEGIN(ASTParser) +/* + * Copyright (C) 2008 Júlio Vilmar Gesser. + * + * This file is part of Java 1.5 parser and Abstract Syntax Tree. + * + * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Java 1.5 parser and Abstract Syntax Tree. If not, see . + */ +package japa.parser; + +import java.io.*; +import java.util.*; +import japa.parser.ast.*; +import japa.parser.ast.body.*; +import japa.parser.ast.expr.*; +import japa.parser.ast.stmt.*; +import japa.parser.ast.type.*; + +/** + *

    This class was generated automatically by javacc, do not edit.

    + * @author Júlio Vilmar Gesser + */ +final class ASTParser { + + void reset(InputStream in, String encoding) { + ReInit(in, encoding); + token_source.clearComments(); + } + + private List add(List list, Object obj) { + if (list == null) { + list = new LinkedList(); + } + list.add(obj); + return list; + } + + private List add(int pos, List list, Object obj) { + if (list == null) { + list = new LinkedList(); + } + list.add(pos, obj); + return list; + } + + private class Modifier { + + final int modifiers; + final List annotations; + final int beginLine; + final int beginColumn; + + public Modifier(int beginLine, int beginColumn, int modifiers, List annotations) { + this.beginLine = beginLine; + this.beginColumn = beginColumn; + this.modifiers = modifiers; + this.annotations = annotations; + } + } + + public int addModifier(int modifiers, int mod, Token token) throws ParseException { + if ((ModifierSet.hasModifier(modifiers, mod))) { + throwParseException(token, "Duplicated modifier"); + } + return ModifierSet.addModifier(modifiers, mod); + } + + private void pushJavadoc() { + token_source.pushJavadoc(); + } + + private JavadocComment popJavadoc() { + return token_source.popJavadoc(); + } + + private List getComments() { + return token_source.getComments(); + } + + private void throwParseException(Token token, String message) throws ParseException { + StringBuilder buf = new StringBuilder(); + buf.append(message); + buf.append(": \""); + buf.append(token.image); + buf.append("\" at line "); + buf.append(token.beginLine); + buf.append(", column "); + buf.append(token.beginColumn); + ParseException e = new ParseException(buf.toString()); + e.currentToken = token; + throw e; + } + + static final class GTToken extends Token { + + int realKind = ASTParserConstants.GT; + + GTToken(int kind, String image) { + this.kind = kind; + this.image = image; + } + + public static Token newToken(int kind, String image) { + return new GTToken(kind, image); + } + } +} + +PARSER_END(ASTParser) + +/* WHITE SPACE */ + +SKIP : +{ + " " +| "\t" +| "\n" +| "\r" +| "\f" +} + +/* COMMENTS */ + +TOKEN_MGR_DECLS : +{ + private List comments; + private final Stack javadocStack = new Stack(); + private JavadocComment lastJavadoc; + + void pushJavadoc() { + javadocStack.push(lastJavadoc); + } + + JavadocComment popJavadoc() { + return javadocStack.pop(); + } + + List getComments() { + return comments; + } + + void clearComments() { + comments = null; + javadocStack.clear(); + lastJavadoc = null; + } + + private void CommonTokenAction(Token token) { + lastJavadoc = null; + if (token.specialToken != null) { + if(comments == null) { + comments = new LinkedList(); + } + Token special = token.specialToken; + if(special.kind == JAVA_DOC_COMMENT) { + lastJavadoc = new JavadocComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(3, special.image.length()-2)); + comments.add(lastJavadoc); + } else if(special.kind == SINGLE_LINE_COMMENT) { + LineComment comment = new LineComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2)); + comments.add(comment); + } else if(special.kind == MULTI_LINE_COMMENT) { + BlockComment comment = new BlockComment(special.beginLine, special.beginColumn, special.endLine, special.endColumn, special.image.substring(2, special.image.length()-2)); + comments.add(comment); + } + } + } +} + +SPECIAL_TOKEN : +{ + +} + +MORE : +{ + <"/**" ~["/"]> { input_stream.backup(1); } : IN_JAVA_DOC_COMMENT +| + <"/*"> : IN_MULTI_LINE_COMMENT +} + + +SPECIAL_TOKEN : +{ + : DEFAULT +} + + +SPECIAL_TOKEN : +{ + : DEFAULT +} + + +MORE : +{ + < ~[] > +} + +/* RESERVED WORDS AND LITERALS */ + +TOKEN : +{ + < ABSTRACT: "abstract" > +| < ASSERT: "assert" > +| < BOOLEAN: "boolean" > +| < BREAK: "break" > +| < BYTE: "byte" > +| < CASE: "case" > +| < CATCH: "catch" > +| < CHAR: "char" > +| < CLASS: "class" > +| < CONST: "const" > +| < CONTINUE: "continue" > +| < _DEFAULT: "default" > +| < DO: "do" > +| < DOUBLE: "double" > +| < ELSE: "else" > +| < ENUM: "enum" > +| < EXTENDS: "extends" > +| < FALSE: "false" > +| < FINAL: "final" > +| < FINALLY: "finally" > +| < FLOAT: "float" > +| < FOR: "for" > +| < GOTO: "goto" > +| < IF: "if" > +| < IMPLEMENTS: "implements" > +| < IMPORT: "import" > +| < INSTANCEOF: "instanceof" > +| < INT: "int" > +| < INTERFACE: "interface" > +| < LONG: "long" > +| < NATIVE: "native" > +| < NEW: "new" > +| < NULL: "null" > +| < PACKAGE: "package"> +| < PRIVATE: "private" > +| < PROTECTED: "protected" > +| < PUBLIC: "public" > +| < RETURN: "return" > +| < SHORT: "short" > +| < STATIC: "static" > +| < STRICTFP: "strictfp" > +| < SUPER: "super" > +| < SWITCH: "switch" > +| < SYNCHRONIZED: "synchronized" > +| < THIS: "this" > +| < THROW: "throw" > +| < THROWS: "throws" > +| < TRANSIENT: "transient" > +| < TRUE: "true" > +| < TRY: "try" > +| < VOID: "void" > +| < VOLATILE: "volatile" > +| < WHILE: "while" > +} + +/* LITERALS */ + +TOKEN : +{ + < LONG_LITERAL: + (["l","L"]) + | (["l","L"]) + | (["l","L"]) + > +| + < INTEGER_LITERAL: + + | + | + > +| + < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* > +| + < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ > +| + < #OCTAL_LITERAL: "0" (["0"-"7"])* > +| + < FLOATING_POINT_LITERAL: + + | + > +| + < #DECIMAL_FLOATING_POINT_LITERAL: + (["0"-"9"])+ "." (["0"-"9"])* ()? (["f","F","d","D"])? + | "." (["0"-"9"])+ ()? (["f","F","d","D"])? + | (["0"-"9"])+ (["f","F","d","D"])? + | (["0"-"9"])+ ()? ["f","F","d","D"] + > +| + < #DECIMAL_EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ > +| + < #HEXADECIMAL_FLOATING_POINT_LITERAL: + "0" ["x", "X"] (["0"-"9","a"-"f","A"-"F"])+ (".")? (["f","F","d","D"])? + | "0" ["x", "X"] (["0"-"9","a"-"f","A"-"F"])* "." (["0"-"9","a"-"f","A"-"F"])+ (["f","F","d","D"])? + > +| + < #HEXADECIMAL_EXPONENT: ["p","P"] (["+","-"])? (["0"-"9"])+ > +| + < CHARACTER_LITERAL: + "'" + ( (~["'","\\","\n","\r"]) + | ("\\" + ( ["n","t","b","r","f","\\","'","\""] + | ["0"-"7"] ( ["0"-"7"] )? + | ["0"-"3"] ["0"-"7"] ["0"-"7"] + ) + ) + | ("\\u" + ["0"-"9","A"-"F","a"-"f"] + ["0"-"9","A"-"F","a"-"f"] + ["0"-"9","A"-"F","a"-"f"] + ["0"-"9","A"-"F","a"-"f"] + ) + ) + "'" + > +| + < STRING_LITERAL: + "\"" + ( (~["\"","\\","\n","\r"]) + | ("\\" + ( ["n","t","b","r","f","\\","'","\""] + | ["0"-"7"] ( ["0"-"7"] )? + | ["0"-"3"] ["0"-"7"] ["0"-"7"] + ) + ) + | ("\\u" + ["0"-"9","A"-"F","a"-"f"] + ["0"-"9","A"-"F","a"-"f"] + ["0"-"9","A"-"F","a"-"f"] + ["0"-"9","A"-"F","a"-"f"] + ) + )* + "\"" + > +} + +/* IDENTIFIERS */ + +TOKEN : +{ + < IDENTIFIER: ()* > +| + < #LETTER: + [ // all chars for which Character.isIdentifierStart is true + "\u0024", // "$" + "\u0041"-"\u005a", // "A"-"Z" + "\u005f", // "_" + "\u0061"-"\u007a", // "a"-"z" + "\u00a2"-"\u00a5", + "\u00aa", + "\u00b5", + "\u00ba", + "\u00c0"-"\u00d6", + "\u00d8"-"\u00f6", + "\u00f8"-"\u0236", + "\u0250"-"\u02c1", + "\u02c6"-"\u02d1", + "\u02e0"-"\u02e4", + "\u02ee", + "\u037a", + "\u0386", + "\u0388"-"\u038a", + "\u038c", + "\u038e"-"\u03a1", + "\u03a3"-"\u03ce", + "\u03d0"-"\u03f5", + "\u03f7"-"\u03fb", + "\u0400"-"\u0481", + "\u048a"-"\u04ce", + "\u04d0"-"\u04f5", + "\u04f8"-"\u04f9", + "\u0500"-"\u050f", + "\u0531"-"\u0556", + "\u0559", + "\u0561"-"\u0587", + "\u05d0"-"\u05ea", + "\u05f0"-"\u05f2", + "\u0621"-"\u063a", + "\u0640"-"\u064a", + "\u066e"-"\u066f", + "\u0671"-"\u06d3", + "\u06d5", + "\u06e5"-"\u06e6", + "\u06ee"-"\u06ef", + "\u06fa"-"\u06fc", + "\u06ff", + "\u0710", + "\u0712"-"\u072f", + "\u074d"-"\u074f", + "\u0780"-"\u07a5", + "\u07b1", + "\u0904"-"\u0939", + "\u093d", + "\u0950", + "\u0958"-"\u0961", + "\u0985"-"\u098c", + "\u098f"-"\u0990", + "\u0993"-"\u09a8", + "\u09aa"-"\u09b0", + "\u09b2", + "\u09b6"-"\u09b9", + "\u09bd", + "\u09dc"-"\u09dd", + "\u09df"-"\u09e1", + "\u09f0"-"\u09f3", + "\u0a05"-"\u0a0a", + "\u0a0f"-"\u0a10", + "\u0a13"-"\u0a28", + "\u0a2a"-"\u0a30", + "\u0a32"-"\u0a33", + "\u0a35"-"\u0a36", + "\u0a38"-"\u0a39", + "\u0a59"-"\u0a5c", + "\u0a5e", + "\u0a72"-"\u0a74", + "\u0a85"-"\u0a8d", + "\u0a8f"-"\u0a91", + "\u0a93"-"\u0aa8", + "\u0aaa"-"\u0ab0", + "\u0ab2"-"\u0ab3", + "\u0ab5"-"\u0ab9", + "\u0abd", + "\u0ad0", + "\u0ae0"-"\u0ae1", + "\u0af1", + "\u0b05"-"\u0b0c", + "\u0b0f"-"\u0b10", + "\u0b13"-"\u0b28", + "\u0b2a"-"\u0b30", + "\u0b32"-"\u0b33", + "\u0b35"-"\u0b39", + "\u0b3d", + "\u0b5c"-"\u0b5d", + "\u0b5f"-"\u0b61", + "\u0b71", + "\u0b83", + "\u0b85"-"\u0b8a", + "\u0b8e"-"\u0b90", + "\u0b92"-"\u0b95", + "\u0b99"-"\u0b9a", + "\u0b9c", + "\u0b9e"-"\u0b9f", + "\u0ba3"-"\u0ba4", + "\u0ba8"-"\u0baa", + "\u0bae"-"\u0bb5", + "\u0bb7"-"\u0bb9", + "\u0bf9", + "\u0c05"-"\u0c0c", + "\u0c0e"-"\u0c10", + "\u0c12"-"\u0c28", + "\u0c2a"-"\u0c33", + "\u0c35"-"\u0c39", + "\u0c60"-"\u0c61", + "\u0c85"-"\u0c8c", + "\u0c8e"-"\u0c90", + "\u0c92"-"\u0ca8", + "\u0caa"-"\u0cb3", + "\u0cb5"-"\u0cb9", + "\u0cbd", + "\u0cde", + "\u0ce0"-"\u0ce1", + "\u0d05"-"\u0d0c", + "\u0d0e"-"\u0d10", + "\u0d12"-"\u0d28", + "\u0d2a"-"\u0d39", + "\u0d60"-"\u0d61", + "\u0d85"-"\u0d96", + "\u0d9a"-"\u0db1", + "\u0db3"-"\u0dbb", + "\u0dbd", + "\u0dc0"-"\u0dc6", + "\u0e01"-"\u0e30", + "\u0e32"-"\u0e33", + "\u0e3f"-"\u0e46", + "\u0e81"-"\u0e82", + "\u0e84", + "\u0e87"-"\u0e88", + "\u0e8a", + "\u0e8d", + "\u0e94"-"\u0e97", + "\u0e99"-"\u0e9f", + "\u0ea1"-"\u0ea3", + "\u0ea5", + "\u0ea7", + "\u0eaa"-"\u0eab", + "\u0ead"-"\u0eb0", + "\u0eb2"-"\u0eb3", + "\u0ebd", + "\u0ec0"-"\u0ec4", + "\u0ec6", + "\u0edc"-"\u0edd", + "\u0f00", + "\u0f40"-"\u0f47", + "\u0f49"-"\u0f6a", + "\u0f88"-"\u0f8b", + "\u1000"-"\u1021", + "\u1023"-"\u1027", + "\u1029"-"\u102a", + "\u1050"-"\u1055", + "\u10a0"-"\u10c5", + "\u10d0"-"\u10f8", + "\u1100"-"\u1159", + "\u115f"-"\u11a2", + "\u11a8"-"\u11f9", + "\u1200"-"\u1206", + "\u1208"-"\u1246", + "\u1248", + "\u124a"-"\u124d", + "\u1250"-"\u1256", + "\u1258", + "\u125a"-"\u125d", + "\u1260"-"\u1286", + "\u1288", + "\u128a"-"\u128d", + "\u1290"-"\u12ae", + "\u12b0", + "\u12b2"-"\u12b5", + "\u12b8"-"\u12be", + "\u12c0", + "\u12c2"-"\u12c5", + "\u12c8"-"\u12ce", + "\u12d0"-"\u12d6", + "\u12d8"-"\u12ee", + "\u12f0"-"\u130e", + "\u1310", + "\u1312"-"\u1315", + "\u1318"-"\u131e", + "\u1320"-"\u1346", + "\u1348"-"\u135a", + "\u13a0"-"\u13f4", + "\u1401"-"\u166c", + "\u166f"-"\u1676", + "\u1681"-"\u169a", + "\u16a0"-"\u16ea", + "\u16ee"-"\u16f0", + "\u1700"-"\u170c", + "\u170e"-"\u1711", + "\u1720"-"\u1731", + "\u1740"-"\u1751", + "\u1760"-"\u176c", + "\u176e"-"\u1770", + "\u1780"-"\u17b3", + "\u17d7", + "\u17db"-"\u17dc", + "\u1820"-"\u1877", + "\u1880"-"\u18a8", + "\u1900"-"\u191c", + "\u1950"-"\u196d", + "\u1970"-"\u1974", + "\u1d00"-"\u1d6b", + "\u1e00"-"\u1e9b", + "\u1ea0"-"\u1ef9", + "\u1f00"-"\u1f15", + "\u1f18"-"\u1f1d", + "\u1f20"-"\u1f45", + "\u1f48"-"\u1f4d", + "\u1f50"-"\u1f57", + "\u1f59", + "\u1f5b", + "\u1f5d", + "\u1f5f"-"\u1f7d", + "\u1f80"-"\u1fb4", + "\u1fb6"-"\u1fbc", + "\u1fbe", + "\u1fc2"-"\u1fc4", + "\u1fc6"-"\u1fcc", + "\u1fd0"-"\u1fd3", + "\u1fd6"-"\u1fdb", + "\u1fe0"-"\u1fec", + "\u1ff2"-"\u1ff4", + "\u1ff6"-"\u1ffc", + "\u203f"-"\u2040", + "\u2054", + "\u2071", + "\u207f", + "\u20a0"-"\u20b1", + "\u2102", + "\u2107", + "\u210a"-"\u2113", + "\u2115", + "\u2119"-"\u211d", + "\u2124", + "\u2126", + "\u2128", + "\u212a"-"\u212d", + "\u212f"-"\u2131", + "\u2133"-"\u2139", + "\u213d"-"\u213f", + "\u2145"-"\u2149", + "\u2160"-"\u2183", + "\u3005"-"\u3007", + "\u3021"-"\u3029", + "\u3031"-"\u3035", + "\u3038"-"\u303c", + "\u3041"-"\u3096", + "\u309d"-"\u309f", + "\u30a1"-"\u30ff", + "\u3105"-"\u312c", + "\u3131"-"\u318e", + "\u31a0"-"\u31b7", + "\u31f0"-"\u31ff", + "\u3400"-"\u4db5", + "\u4e00"-"\u9fa5", + "\ua000"-"\ua48c", + "\uac00"-"\ud7a3", + "\ud801", //for supplementary characters suport + "\ud802", //for supplementary characters suport + "\uf900"-"\ufa2d", + "\ufa30"-"\ufa6a", + "\ufb00"-"\ufb06", + "\ufb13"-"\ufb17", + "\ufb1d", + "\ufb1f"-"\ufb28", + "\ufb2a"-"\ufb36", + "\ufb38"-"\ufb3c", + "\ufb3e", + "\ufb40"-"\ufb41", + "\ufb43"-"\ufb44", + "\ufb46"-"\ufbb1", + "\ufbd3"-"\ufd3d", + "\ufd50"-"\ufd8f", + "\ufd92"-"\ufdc7", + "\ufdf0"-"\ufdfc", + "\ufe33"-"\ufe34", + "\ufe4d"-"\ufe4f", + "\ufe69", + "\ufe70"-"\ufe74", + "\ufe76"-"\ufefc", + "\uff04", + "\uff21"-"\uff3a", + "\uff3f", + "\uff41"-"\uff5a", + "\uff65"-"\uffbe", + "\uffc2"-"\uffc7", + "\uffca"-"\uffcf", + "\uffd2"-"\uffd7", + "\uffda"-"\uffdc", + "\uffe0"-"\uffe1", + "\uffe5"-"\uffe6" + ] + > +| + < #PART_LETTER: + [ // all chars for which Character.isIdentifierPart is true + "\u0000"-"\u0008", + "\u000e"-"\u001b", + "\u0024", // "$" + "\u0030"-"\u0039", // "0"-"9" + "\u0041"-"\u005a", // "A"-"Z" + "\u005f", // "_" + "\u0061"-"\u007a", // "a"-"z" + "\u007f"-"\u009f", + "\u00a2"-"\u00a5", + "\u00aa", + "\u00ad", + "\u00b5", + "\u00ba", + "\u00c0"-"\u00d6", + "\u00d8"-"\u00f6", + "\u00f8"-"\u0236", + "\u0250"-"\u02c1", + "\u02c6"-"\u02d1", + "\u02e0"-"\u02e4", + "\u02ee", + "\u0300"-"\u0357", + "\u035d"-"\u036f", + "\u037a", + "\u0386", + "\u0388"-"\u038a", + "\u038c", + "\u038e"-"\u03a1", + "\u03a3"-"\u03ce", + "\u03d0"-"\u03f5", + "\u03f7"-"\u03fb", + "\u0400"-"\u0481", + "\u0483"-"\u0486", + "\u048a"-"\u04ce", + "\u04d0"-"\u04f5", + "\u04f8"-"\u04f9", + "\u0500"-"\u050f", + "\u0531"-"\u0556", + "\u0559", + "\u0561"-"\u0587", + "\u0591"-"\u05a1", + "\u05a3"-"\u05b9", + "\u05bb"-"\u05bd", + "\u05bf", + "\u05c1"-"\u05c2", + "\u05c4", + "\u05d0"-"\u05ea", + "\u05f0"-"\u05f2", + "\u0600"-"\u0603", + "\u0610"-"\u0615", + "\u0621"-"\u063a", + "\u0640"-"\u0658", + "\u0660"-"\u0669", + "\u066e"-"\u06d3", + "\u06d5"-"\u06dd", + "\u06df"-"\u06e8", + "\u06ea"-"\u06fc", + "\u06ff", + "\u070f"-"\u074a", + "\u074d"-"\u074f", + "\u0780"-"\u07b1", + "\u0901"-"\u0939", + "\u093c"-"\u094d", + "\u0950"-"\u0954", + "\u0958"-"\u0963", + "\u0966"-"\u096f", + "\u0981"-"\u0983", + "\u0985"-"\u098c", + "\u098f"-"\u0990", + "\u0993"-"\u09a8", + "\u09aa"-"\u09b0", + "\u09b2", + "\u09b6"-"\u09b9", + "\u09bc"-"\u09c4", + "\u09c7"-"\u09c8", + "\u09cb"-"\u09cd", + "\u09d7", + "\u09dc"-"\u09dd", + "\u09df"-"\u09e3", + "\u09e6"-"\u09f3", + "\u0a01"-"\u0a03", + "\u0a05"-"\u0a0a", + "\u0a0f"-"\u0a10", + "\u0a13"-"\u0a28", + "\u0a2a"-"\u0a30", + "\u0a32"-"\u0a33", + "\u0a35"-"\u0a36", + "\u0a38"-"\u0a39", + "\u0a3c", + "\u0a3e"-"\u0a42", + "\u0a47"-"\u0a48", + "\u0a4b"-"\u0a4d", + "\u0a59"-"\u0a5c", + "\u0a5e", + "\u0a66"-"\u0a74", + "\u0a81"-"\u0a83", + "\u0a85"-"\u0a8d", + "\u0a8f"-"\u0a91", + "\u0a93"-"\u0aa8", + "\u0aaa"-"\u0ab0", + "\u0ab2"-"\u0ab3", + "\u0ab5"-"\u0ab9", + "\u0abc"-"\u0ac5", + "\u0ac7"-"\u0ac9", + "\u0acb"-"\u0acd", + "\u0ad0", + "\u0ae0"-"\u0ae3", + "\u0ae6"-"\u0aef", + "\u0af1", + "\u0b01"-"\u0b03", + "\u0b05"-"\u0b0c", + "\u0b0f"-"\u0b10", + "\u0b13"-"\u0b28", + "\u0b2a"-"\u0b30", + "\u0b32"-"\u0b33", + "\u0b35"-"\u0b39", + "\u0b3c"-"\u0b43", + "\u0b47"-"\u0b48", + "\u0b4b"-"\u0b4d", + "\u0b56"-"\u0b57", + "\u0b5c"-"\u0b5d", + "\u0b5f"-"\u0b61", + "\u0b66"-"\u0b6f", + "\u0b71", + "\u0b82"-"\u0b83", + "\u0b85"-"\u0b8a", + "\u0b8e"-"\u0b90", + "\u0b92"-"\u0b95", + "\u0b99"-"\u0b9a", + "\u0b9c", + "\u0b9e"-"\u0b9f", + "\u0ba3"-"\u0ba4", + "\u0ba8"-"\u0baa", + "\u0bae"-"\u0bb5", + "\u0bb7"-"\u0bb9", + "\u0bbe"-"\u0bc2", + "\u0bc6"-"\u0bc8", + "\u0bca"-"\u0bcd", + "\u0bd7", + "\u0be7"-"\u0bef", + "\u0bf9", + "\u0c01"-"\u0c03", + "\u0c05"-"\u0c0c", + "\u0c0e"-"\u0c10", + "\u0c12"-"\u0c28", + "\u0c2a"-"\u0c33", + "\u0c35"-"\u0c39", + "\u0c3e"-"\u0c44", + "\u0c46"-"\u0c48", + "\u0c4a"-"\u0c4d", + "\u0c55"-"\u0c56", + "\u0c60"-"\u0c61", + "\u0c66"-"\u0c6f", + "\u0c82"-"\u0c83", + "\u0c85"-"\u0c8c", + "\u0c8e"-"\u0c90", + "\u0c92"-"\u0ca8", + "\u0caa"-"\u0cb3", + "\u0cb5"-"\u0cb9", + "\u0cbc"-"\u0cc4", + "\u0cc6"-"\u0cc8", + "\u0cca"-"\u0ccd", + "\u0cd5"-"\u0cd6", + "\u0cde", + "\u0ce0"-"\u0ce1", + "\u0ce6"-"\u0cef", + "\u0d02"-"\u0d03", + "\u0d05"-"\u0d0c", + "\u0d0e"-"\u0d10", + "\u0d12"-"\u0d28", + "\u0d2a"-"\u0d39", + "\u0d3e"-"\u0d43", + "\u0d46"-"\u0d48", + "\u0d4a"-"\u0d4d", + "\u0d57", + "\u0d60"-"\u0d61", + "\u0d66"-"\u0d6f", + "\u0d82"-"\u0d83", + "\u0d85"-"\u0d96", + "\u0d9a"-"\u0db1", + "\u0db3"-"\u0dbb", + "\u0dbd", + "\u0dc0"-"\u0dc6", + "\u0dca", + "\u0dcf"-"\u0dd4", + "\u0dd6", + "\u0dd8"-"\u0ddf", + "\u0df2"-"\u0df3", + "\u0e01"-"\u0e3a", + "\u0e3f"-"\u0e4e", + "\u0e50"-"\u0e59", + "\u0e81"-"\u0e82", + "\u0e84", + "\u0e87"-"\u0e88", + "\u0e8a", + "\u0e8d", + "\u0e94"-"\u0e97", + "\u0e99"-"\u0e9f", + "\u0ea1"-"\u0ea3", + "\u0ea5", + "\u0ea7", + "\u0eaa"-"\u0eab", + "\u0ead"-"\u0eb9", + "\u0ebb"-"\u0ebd", + "\u0ec0"-"\u0ec4", + "\u0ec6", + "\u0ec8"-"\u0ecd", + "\u0ed0"-"\u0ed9", + "\u0edc"-"\u0edd", + "\u0f00", + "\u0f18"-"\u0f19", + "\u0f20"-"\u0f29", + "\u0f35", + "\u0f37", + "\u0f39", + "\u0f3e"-"\u0f47", + "\u0f49"-"\u0f6a", + "\u0f71"-"\u0f84", + "\u0f86"-"\u0f8b", + "\u0f90"-"\u0f97", + "\u0f99"-"\u0fbc", + "\u0fc6", + "\u1000"-"\u1021", + "\u1023"-"\u1027", + "\u1029"-"\u102a", + "\u102c"-"\u1032", + "\u1036"-"\u1039", + "\u1040"-"\u1049", + "\u1050"-"\u1059", + "\u10a0"-"\u10c5", + "\u10d0"-"\u10f8", + "\u1100"-"\u1159", + "\u115f"-"\u11a2", + "\u11a8"-"\u11f9", + "\u1200"-"\u1206", + "\u1208"-"\u1246", + "\u1248", + "\u124a"-"\u124d", + "\u1250"-"\u1256", + "\u1258", + "\u125a"-"\u125d", + "\u1260"-"\u1286", + "\u1288", + "\u128a"-"\u128d", + "\u1290"-"\u12ae", + "\u12b0", + "\u12b2"-"\u12b5", + "\u12b8"-"\u12be", + "\u12c0", + "\u12c2"-"\u12c5", + "\u12c8"-"\u12ce", + "\u12d0"-"\u12d6", + "\u12d8"-"\u12ee", + "\u12f0"-"\u130e", + "\u1310", + "\u1312"-"\u1315", + "\u1318"-"\u131e", + "\u1320"-"\u1346", + "\u1348"-"\u135a", + "\u1369"-"\u1371", + "\u13a0"-"\u13f4", + "\u1401"-"\u166c", + "\u166f"-"\u1676", + "\u1681"-"\u169a", + "\u16a0"-"\u16ea", + "\u16ee"-"\u16f0", + "\u1700"-"\u170c", + "\u170e"-"\u1714", + "\u1720"-"\u1734", + "\u1740"-"\u1753", + "\u1760"-"\u176c", + "\u176e"-"\u1770", + "\u1772"-"\u1773", + "\u1780"-"\u17d3", + "\u17d7", + "\u17db"-"\u17dd", + "\u17e0"-"\u17e9", + "\u180b"-"\u180d", + "\u1810"-"\u1819", + "\u1820"-"\u1877", + "\u1880"-"\u18a9", + "\u1900"-"\u191c", + "\u1920"-"\u192b", + "\u1930"-"\u193b", + "\u1946"-"\u196d", + "\u1970"-"\u1974", + "\u1d00"-"\u1d6b", + "\u1e00"-"\u1e9b", + "\u1ea0"-"\u1ef9", + "\u1f00"-"\u1f15", + "\u1f18"-"\u1f1d", + "\u1f20"-"\u1f45", + "\u1f48"-"\u1f4d", + "\u1f50"-"\u1f57", + "\u1f59", + "\u1f5b", + "\u1f5d", + "\u1f5f"-"\u1f7d", + "\u1f80"-"\u1fb4", + "\u1fb6"-"\u1fbc", + "\u1fbe", + "\u1fc2"-"\u1fc4", + "\u1fc6"-"\u1fcc", + "\u1fd0"-"\u1fd3", + "\u1fd6"-"\u1fdb", + "\u1fe0"-"\u1fec", + "\u1ff2"-"\u1ff4", + "\u1ff6"-"\u1ffc", + "\u200c"-"\u200f", + "\u202a"-"\u202e", + "\u203f"-"\u2040", + "\u2054", + "\u2060"-"\u2063", + "\u206a"-"\u206f", + "\u2071", + "\u207f", + "\u20a0"-"\u20b1", + "\u20d0"-"\u20dc", + "\u20e1", + "\u20e5"-"\u20ea", + "\u2102", + "\u2107", + "\u210a"-"\u2113", + "\u2115", + "\u2119"-"\u211d", + "\u2124", + "\u2126", + "\u2128", + "\u212a"-"\u212d", + "\u212f"-"\u2131", + "\u2133"-"\u2139", + "\u213d"-"\u213f", + "\u2145"-"\u2149", + "\u2160"-"\u2183", + "\u3005"-"\u3007", + "\u3021"-"\u302f", + "\u3031"-"\u3035", + "\u3038"-"\u303c", + "\u3041"-"\u3096", + "\u3099"-"\u309a", + "\u309d"-"\u309f", + "\u30a1"-"\u30ff", + "\u3105"-"\u312c", + "\u3131"-"\u318e", + "\u31a0"-"\u31b7", + "\u31f0"-"\u31ff", + "\u3400"-"\u4db5", + "\u4e00"-"\u9fa5", + "\ua000"-"\ua48c", + "\uac00"-"\ud7a3", + "\ud801", //for supplementary characters suport + "\ud802", //for supplementary characters suport + "\ud834", //for supplementary characters suport + "\udc00", //for supplementary characters suport + "\udc01", //for supplementary characters suport + "\udd7b", //for supplementary characters suport + "\uf900"-"\ufa2d", + "\ufa30"-"\ufa6a", + "\ufb00"-"\ufb06", + "\ufb13"-"\ufb17", + "\ufb1d"-"\ufb28", + "\ufb2a"-"\ufb36", + "\ufb38"-"\ufb3c", + "\ufb3e", + "\ufb40"-"\ufb41", + "\ufb43"-"\ufb44", + "\ufb46"-"\ufbb1", + "\ufbd3"-"\ufd3d", + "\ufd50"-"\ufd8f", + "\ufd92"-"\ufdc7", + "\ufdf0"-"\ufdfc", + "\ufe00"-"\ufe0f", + "\ufe20"-"\ufe23", + "\ufe33"-"\ufe34", + "\ufe4d"-"\ufe4f", + "\ufe69", + "\ufe70"-"\ufe74", + "\ufe76"-"\ufefc", + "\ufeff", + "\uff04", + "\uff10"-"\uff19", + "\uff21"-"\uff3a", + "\uff3f", + "\uff41"-"\uff5a", + "\uff65"-"\uffbe", + "\uffc2"-"\uffc7", + "\uffca"-"\uffcf", + "\uffd2"-"\uffd7", + "\uffda"-"\uffdc", + "\uffe0"-"\uffe1", + "\uffe5"-"\uffe6", + "\ufff9"-"\ufffb" + ] + > +} + +/* SEPARATORS */ + +TOKEN : +{ + < LPAREN: "(" > +| < RPAREN: ")" > +| < LBRACE: "{" > +| < RBRACE: "}" > +| < LBRACKET: "[" > +| < RBRACKET: "]" > +| < SEMICOLON: ";" > +| < COMMA: "," > +| < DOT: "." > +| < AT: "@" > +} + +/* OPERATORS */ + +TOKEN : +{ + < ASSIGN: "=" > +| < LT: "<" > +| < BANG: "!" > +| < TILDE: "~" > +| < HOOK: "?" > +| < COLON: ":" > +| < EQ: "==" > +| < LE: "<=" > +| < GE: ">=" > +| < NE: "!=" > +| < SC_OR: "||" > +| < SC_AND: "&&" > +| < INCR: "++" > +| < DECR: "--" > +| < PLUS: "+" > +| < MINUS: "-" > +| < STAR: "*" > +| < SLASH: "/" > +| < BIT_AND: "&" > +| < BIT_OR: "|" > +| < XOR: "^" > +| < REM: "%" > +| < LSHIFT: "<<" > +| < PLUSASSIGN: "+=" > +| < MINUSASSIGN: "-=" > +| < STARASSIGN: "*=" > +| < SLASHASSIGN: "/=" > +| < ANDASSIGN: "&=" > +| < ORASSIGN: "|=" > +| < XORASSIGN: "^=" > +| < REMASSIGN: "%=" > +| < LSHIFTASSIGN: "<<=" > +| < RSIGNEDSHIFTASSIGN: ">>=" > +| < RUNSIGNEDSHIFTASSIGN: ">>>=" > +| < ELLIPSIS: "..." > +} + +/* >'s need special attention due to generics syntax. */ +TOKEN : +{ + < RUNSIGNEDSHIFT: ">>>" > + { + matchedToken.kind = GT; + ((ASTParser.GTToken)matchedToken).realKind = RUNSIGNEDSHIFT; + input_stream.backup(2); + } +| < RSIGNEDSHIFT: ">>" > + { + matchedToken.kind = GT; + ((ASTParser.GTToken)matchedToken).realKind = RSIGNEDSHIFT; + input_stream.backup(1); + } +| < GT: ">" > +} + + +/***************************************** + * THE JAVA LANGUAGE GRAMMAR STARTS HERE * + *****************************************/ + +/* + * Program structuring syntax follows. + */ + +CompilationUnit CompilationUnit(): +{ + PackageDeclaration pakage = null; + List imports = null; + ImportDeclaration in = null; + List types = null; + TypeDeclaration tn = null; + int line = -1; + int column = 0; +} +{ + [ LOOKAHEAD(PackageDeclaration()) pakage = PackageDeclaration() {line = pakage.getBeginLine(); column = pakage.getBeginColumn();} ] + ( in = ImportDeclaration() { if(line==-1){line = in.getBeginLine(); column = in.getBeginColumn();} imports = add(imports, in); } )* + ( tn = TypeDeclaration() { if(line==-1){line = tn.getBeginLine(); column = tn.getBeginColumn();} types = add(types, tn); } )* + ( | "\u001A" /** ctrl+z char **/) + { return new CompilationUnit(line == -1 ? 0 : line, column, token.endLine, token.endColumn,pakage, imports, types, getComments()); } +} + +PackageDeclaration PackageDeclaration(): +{ + List annotations = null; + AnnotationExpr ann; + NameExpr name; + int line; + int column; +} +{ +( ann = Annotation() { annotations = add(annotations, ann); } )* + "package" {line=token.beginLine; column=token.beginColumn;} name = Name() ";" + { return new PackageDeclaration(line, column, token.endLine, token.endColumn,annotations, name); } +} + +ImportDeclaration ImportDeclaration(): +{ + NameExpr name; + boolean isStatic = false; + boolean isAsterisk = false; + int line; + int column; +} +{ + "import" {line=token.beginLine; column=token.beginColumn;} [ "static" { isStatic = true; } ] name = Name() [ "." "*" { isAsterisk = true; } ] ";" + { return new ImportDeclaration(line, column, token.endLine, token.endColumn,name, isStatic, isAsterisk); } +} + +/* + * Modifiers. We match all modifiers in a single rule to reduce the chances of + * syntax errors for simple modifier mistakes. It will also enable us to give + * better error messages. + */ + +Modifier Modifiers(): +{ + int beginLine = -1; + int beginColumn = -1; + int modifiers = 0; + List annotations = null; + AnnotationExpr ann; +} +{ + ( + LOOKAHEAD(2) + ( + "public" { modifiers = addModifier(modifiers, ModifierSet.PUBLIC, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } + | + "static" { modifiers = addModifier(modifiers, ModifierSet.STATIC, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } + | + "protected" { modifiers = addModifier(modifiers, ModifierSet.PROTECTED, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } + | + "private" { modifiers = addModifier(modifiers, ModifierSet.PRIVATE, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } + | + "final" { modifiers = addModifier(modifiers, ModifierSet.FINAL, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } + | + "abstract" { modifiers = addModifier(modifiers, ModifierSet.ABSTRACT, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } + | + "synchronized" { modifiers = addModifier(modifiers, ModifierSet.SYNCHRONIZED, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } + | + "native" { modifiers = addModifier(modifiers, ModifierSet.NATIVE, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } + | + "transient" { modifiers = addModifier(modifiers, ModifierSet.TRANSIENT, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } + | + "volatile" { modifiers = addModifier(modifiers, ModifierSet.VOLATILE, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } + | + "strictfp" { modifiers = addModifier(modifiers, ModifierSet.STRICTFP, token); if(beginLine==-1) {beginLine=token.beginLine; beginColumn=token.beginColumn;} } + | + ann = Annotation() { annotations = add(annotations, ann); if(beginLine==-1) {beginLine=ann.getBeginLine(); beginColumn=ann.getBeginColumn();} } + ) + )* + + { + return new Modifier(beginLine, beginColumn, modifiers, annotations); + } +} + +/* + * Declaration syntax follows. + */ +TypeDeclaration TypeDeclaration(): +{ + Modifier modifier; + TypeDeclaration ret; +} +{ + { pushJavadoc(); } + ( + ";" { ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); } + | + modifier = Modifiers() + ( + ret = ClassOrInterfaceDeclaration(modifier) + | + ret = EnumDeclaration(modifier) + | + ret = AnnotationTypeDeclaration(modifier) + ) + ) + { return ret; } +} + + +ClassOrInterfaceDeclaration ClassOrInterfaceDeclaration(Modifier modifier): +{ + boolean isInterface = false; + String name; + List typePar = null; + List extList = null; + List impList = null; + List members; + int line = modifier.beginLine; + int column = modifier.beginColumn; +} +{ + ( "class" | "interface" { isInterface = true; } ) { if (line == -1) {line=token.beginLine; column=token.beginColumn;} } + { name = token.image; } + [ typePar = TypeParameters() {typePar.remove(0);} ] + [ extList = ExtendsList(isInterface) ] + [ impList = ImplementsList(isInterface) ] + members = ClassOrInterfaceBody(isInterface) + + { return new ClassOrInterfaceDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, isInterface, name, typePar, extList, impList, members); } +} + +List ExtendsList(boolean isInterface): +{ + boolean extendsMoreThanOne = false; + List ret = new LinkedList(); + ClassOrInterfaceType cit; +} +{ + "extends" cit = ClassOrInterfaceType() { ret.add(cit); } + ( "," cit = ClassOrInterfaceType() { ret.add(cit); extendsMoreThanOne = true; } )* + { + if (extendsMoreThanOne && !isInterface) + throwParseException(token, "A class cannot extend more than one other class"); + } + { return ret; } +} + +List ImplementsList(boolean isInterface): +{ + List ret = new LinkedList(); + ClassOrInterfaceType cit; +} +{ + "implements" cit = ClassOrInterfaceType() { ret.add(cit); } + ( "," cit = ClassOrInterfaceType() { ret.add(cit); } )* + { + if (isInterface) + throwParseException(token, "An interface cannot implement other interfaces"); + } + { return ret; } +} + +EnumDeclaration EnumDeclaration(Modifier modifier): +{ + String name; + List impList = null; + EnumConstantDeclaration entry; + List entries = null; + BodyDeclaration member; + List members = null; + int line = modifier.beginLine; + int column = modifier.beginColumn; +} +{ + "enum" { if (line == -1) {line=token.beginLine; column=token.beginColumn;} } + { name = token.image; } + [ impList = ImplementsList(false) ] + "{" + [ + { entries = new LinkedList(); } + entry = EnumConstantDeclaration() { entries.add(entry); } ( LOOKAHEAD(2) "," entry = EnumConstantDeclaration() { entries.add(entry); } )* + ] + [ "," ] + [ + ( ";" ( member = ClassOrInterfaceBodyDeclaration(false) { members = add(members, member); } )* ) + ] + "}" + + { return new EnumDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, name, impList, entries, members); } +} + + +EnumConstantDeclaration EnumConstantDeclaration(): +{ + List annotations = null; + AnnotationExpr ann; + String name; + List args = null; + List classBody = null; + int line = -1; + int column = -1; +} +{ + { pushJavadoc(); } + ( ann = Annotation() { annotations = add(annotations, ann); if(line==-1){line=ann.getBeginLine(); column=ann.getBeginColumn();} } )* + { name = token.image; if(line==-1){line=token.beginLine; column=token.beginColumn;} } + [ args = Arguments() ] [ classBody = ClassOrInterfaceBody(false) ] + { return new EnumConstantDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), annotations, name, args, classBody); } +} + +List TypeParameters(): +{ + List ret = new LinkedList(); + TypeParameter tp; +} +{ + "<" { ret.add(new int[]{token.beginLine, token.beginColumn}); } + tp = TypeParameter() { ret.add(tp); } + ( "," tp = TypeParameter() { ret.add(tp); } )* + ">" + { return ret; } +} + +TypeParameter TypeParameter(): +{ + String name; + List typeBound = null; + int line; + int column; +} +{ + { name = token.image; line=token.beginLine; column=token.beginColumn;} [ typeBound = TypeBound() ] + { return new TypeParameter(line, column, token.endLine, token.endColumn,name, typeBound); } +} + +List TypeBound(): +{ + List ret = new LinkedList(); + ClassOrInterfaceType cit; +} +{ + "extends" cit = ClassOrInterfaceType() { ret.add(cit); } + ( "&" cit = ClassOrInterfaceType() { ret.add(cit); } )* + { return ret; } +} + +List ClassOrInterfaceBody(boolean isInterface): +{ + List ret = new LinkedList(); + BodyDeclaration member; +} +{ + "{" ( member = ClassOrInterfaceBodyDeclaration(isInterface) { ret.add(member); } )* "}" + { return ret; } +} + +BodyDeclaration ClassOrInterfaceBodyDeclaration(boolean isInterface): +{ + boolean isNestedInterface = false; + Modifier modifier; + BodyDeclaration ret; +} +{ + { pushJavadoc(); } + ( + LOOKAHEAD(2) + ret = InitializerDeclaration() + { + if (isInterface) + throwParseException(token, "An interface cannot have initializers"); + } + | + modifier = Modifiers() // Just get all the modifiers out of the way. If you want to do + // more checks, pass the modifiers down to the member + ( + ret = ClassOrInterfaceDeclaration(modifier) + | + ret = EnumDeclaration(modifier) + | + ret = AnnotationTypeDeclaration(modifier) + | + LOOKAHEAD( [ TypeParameters() ] "(" ) + ret = ConstructorDeclaration(modifier) + | + LOOKAHEAD( Type() ( "[" "]" )* ( "," | "=" | ";" ) ) + ret = FieldDeclaration(modifier) + | + ret = MethodDeclaration(modifier) + ) + | + ";" { ret = new EmptyMemberDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); } + ) + { return ret; } +} + +FieldDeclaration FieldDeclaration(Modifier modifier): +{ + Type type; + List variables = new LinkedList(); + VariableDeclarator val; +} +{ + // Modifiers are already matched in the caller + type = Type() + val = VariableDeclarator() { variables.add(val); } + ( "," val = VariableDeclarator() { variables.add(val); } )* ";" + + { + int line = modifier.beginLine; + int column = modifier.beginColumn; + if (line == -1) { line=type.getBeginLine(); column=type.getBeginColumn(); } + return new FieldDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, type, variables); + } +} + +VariableDeclarator VariableDeclarator(): +{ + VariableDeclaratorId id; + Expression init = null; +} +{ + id = VariableDeclaratorId() [ "=" init = VariableInitializer() ] + { return new VariableDeclarator(id.getBeginLine(), id.getBeginColumn(), token.endLine, token.endColumn, id, init); } +} + +VariableDeclaratorId VariableDeclaratorId(): +{ + String name; + int arrayCount = 0; + int line; + int column; +} +{ + { name = token.image; line=token.beginLine; column=token.beginColumn;} ( "[" "]" { arrayCount++; } )* + { return new VariableDeclaratorId(line, column, token.endLine, token.endColumn,name, arrayCount); } +} + +Expression VariableInitializer(): +{ + Expression ret; +} +{ + ( + ret = ArrayInitializer() + | + ret = Expression() + ) + { return ret;} +} + +ArrayInitializerExpr ArrayInitializer(): +{ + List values = null; + Expression val; + int line; + int column; +} +{ + "{" {line=token.beginLine; column=token.beginColumn;} [ val = VariableInitializer() { values = add(values, val); } ( LOOKAHEAD(2) "," val = VariableInitializer() { values = add(values, val); } )* ] [ "," ] "}" + { return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn,values); } +} + +MethodDeclaration MethodDeclaration(Modifier modifier): +{ + List typeParameters = null; + Type type; + String name; + List parameters; + int arrayCount = 0; + List throws_ = null; + BlockStmt block = null; + int line = modifier.beginLine; + int column = modifier.beginColumn; +} +{ + // Modifiers already matched in the caller! + [ typeParameters = TypeParameters() { int[] lineCol=(int[])typeParameters.remove(0); if(line==-1){ line=lineCol[0]; column=lineCol[1];} } ] + type = ResultType() { if(line==-1){line=type.getBeginLine(); column=type.getBeginColumn();}} + { name = token.image; } parameters = FormalParameters() ( "[" "]" { arrayCount++; } )* + [ "throws" throws_ = NameList() ] + ( block = Block() | ";" ) + + { return new MethodDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, typeParameters, type, name, parameters, arrayCount, throws_, block); } +} + +List FormalParameters(): +{ + List ret = null; + Parameter par; +} +{ + "(" [ par = FormalParameter() { ret = add(ret, par); } ( "," par = FormalParameter() { ret = add(ret, par); } )* ] ")" + + { return ret; } +} + +Parameter FormalParameter(): +{ + Modifier modifier; + Type type; + boolean isVarArg = false; + VariableDeclaratorId id; +} +{ + modifier = Modifiers() type = Type() [ "..." { isVarArg = true;} ] id = VariableDeclaratorId() + + { + int line = modifier.beginLine; + int column = modifier.beginColumn; + if(line==-1){ line=type.getBeginLine(); column=type.getBeginColumn(); } + return new Parameter(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, isVarArg, id); + } +} + +ConstructorDeclaration ConstructorDeclaration(Modifier modifier): +{ + List typeParameters = null; + String name; + List parameters; + List throws_ = null; + ExplicitConstructorInvocationStmt exConsInv = null; + List stmts; + int line = modifier.beginLine; + int column = modifier.beginColumn; + int bbLine = 0; + int bbColumn = 0; + int beLine = 0; + int beColumn = 0; +} +{ + [ typeParameters = TypeParameters() { int[] lineCol=(int[])typeParameters.remove(0); if(line==-1){ line=lineCol[0]; column=lineCol[1];} } ] + // Modifiers matched in the caller + { name = token.image; if(line==-1){line=token.beginLine; column=token.beginColumn;}} parameters = FormalParameters() [ "throws" throws_ = NameList() ] + "{" { bbLine=token.beginLine; bbColumn=token.beginColumn; } + [ LOOKAHEAD(ExplicitConstructorInvocation()) exConsInv = ExplicitConstructorInvocation() ] + stmts = Statements() + "}" + + { + if (exConsInv != null) { + stmts = add(0, stmts, exConsInv); + } + return new ConstructorDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, typeParameters, name, parameters, throws_, new BlockStmt(bbLine, bbColumn, token.endLine, token.endColumn, stmts)); + } +} + +ExplicitConstructorInvocationStmt ExplicitConstructorInvocation(): +{ + boolean isThis = false; + List args; + Expression expr = null; + List typeArgs = null; + int line = -1; + int column = 0; +} +{ + ( + LOOKAHEAD([ TypeArguments() ] "this" "(") + [ typeArgs = TypeArguments() { int[] lineCol=(int[])typeArgs.remove(0); line=lineCol[0]; column=lineCol[1]; } ] + "this" { if (line == -1) {line=token.beginLine; column=token.beginColumn;} isThis = true; } + args = Arguments() ";" + | + [ + LOOKAHEAD( PrimaryExpressionWithoutSuperSuffix() "." ) + expr = PrimaryExpressionWithoutSuperSuffix() "." + { line=expr.getBeginLine(); column=expr.getBeginColumn(); } + ] + [ typeArgs = TypeArguments() {int[] lineCol=(int[])typeArgs.remove(0); if (line == -1) {line=lineCol[0]; column=lineCol[1];}} ] + "super" {if (line == -1) {line=token.beginLine; column=token.beginColumn;}} + args = Arguments() ";" + ) + { return new ExplicitConstructorInvocationStmt(line, column, token.endLine, token.endColumn,typeArgs, isThis, expr, args); } +} + +List Statements(): +{ + List ret = null; + Statement stmt; +} +{ + ( stmt = BlockStatement() { ret = add(ret, stmt); } )* + { return ret; } +} + +InitializerDeclaration InitializerDeclaration(): +{ + BlockStmt block; + int line = -1; + int column = 0; + boolean isStatic = false; +} +{ + [ "static" { isStatic = true; line=token.beginLine; column=token.beginColumn;} ] block = Block() {if(line==-1){line=block.getBeginLine(); column=block.getBeginColumn();}} + { return new InitializerDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), isStatic, block); } +} + + +/* + * Type, name and expression syntax follows. + */ + +Type Type(): +{ + Type ret; +} +{ + ( + LOOKAHEAD(2) ret = ReferenceType() + | + ret = PrimitiveType() + ) + { return ret; } +} + +ReferenceType ReferenceType(): +{ + Type type; + int arrayCount = 0; +} +{ + ( + type = PrimitiveType() ( LOOKAHEAD(2) "[" "]" { arrayCount++; } )+ + | + type = ClassOrInterfaceType() ( LOOKAHEAD(2) "[" "]" { arrayCount++; } )* + ) + { return new ReferenceType(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type, arrayCount); } +} + +ClassOrInterfaceType ClassOrInterfaceType(): +{ + ClassOrInterfaceType ret; + String name; + List typeArgs = null; + int line; + int column; +} +{ + {line=token.beginLine; column=token.beginColumn;} { name = token.image; } + [ LOOKAHEAD(2) typeArgs = TypeArguments() {typeArgs.remove(0);} ] + { ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,null, name, typeArgs); } + ( + LOOKAHEAD(2) "." { name = token.image; } + [ LOOKAHEAD(2) typeArgs = TypeArguments() {typeArgs.remove(0);} ] { ret = new ClassOrInterfaceType(line, column, token.endLine, token.endColumn,ret, name, typeArgs); } + )* + { return ret; } +} + +List TypeArguments(): +{ + List ret = new LinkedList(); + Type type; +} +{ + "<" { ret.add(new int[]{token.beginLine, token.beginColumn}); } + type = TypeArgument() { ret.add(type); } ( "," type = TypeArgument() { ret.add(type); } )* + ">" + { return ret; } +} + +Type TypeArgument(): +{ + Type ret; +} +{ + ( + ret = ReferenceType() + | + ret = Wildcard() + ) + { return ret; } +} + +WildcardType Wildcard(): +{ + ReferenceType ext = null; + ReferenceType sup = null; + int line; + int column; +} +{ + "?" {line=token.beginLine; column=token.beginColumn;} + [ + "extends" ext = ReferenceType() + | + "super" sup = ReferenceType() + ] + { return new WildcardType(line, column, token.endLine, token.endColumn,ext, sup); } +} + +PrimitiveType PrimitiveType(): +{ + PrimitiveType ret; +} +{ +( + "boolean" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Boolean); } +| + "char" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Char); } +| + "byte" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Byte); } +| + "short" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Short); } +| + "int" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Int); } +| + "long" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Long); } +| + "float" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Float); } +| + "double" { ret = new PrimitiveType(token.beginLine, token.beginColumn, token.endLine, token.endColumn, PrimitiveType.Primitive.Double); } +) +{ return ret; } +} + +Type ResultType(): +{ + Type ret; +} +{ + ( + "void" { ret = new VoidType(token.beginLine, token.beginColumn, token.endLine, token.endColumn); } + | + ret = Type() + ) + { return ret; } +} + +NameExpr Name(): +/* + * A lookahead of 2 is required below since "Name" can be followed + * by a ".*" when used in the context of an "ImportDeclaration". + */ +{ + NameExpr ret; +} +{ + { ret = new NameExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); } + ( LOOKAHEAD(2) "." { ret = new QualifiedNameExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, token.image); } )* + { return ret; } +} + +List NameList(): +{ + List ret = new LinkedList(); + NameExpr name; +} +{ + name = Name() { ret.add(name); } ( "," name = Name() { ret.add(name); } )* + + { return ret; } +} + + +/* + * Expression syntax follows. + */ + +Expression Expression(): +/* + * This expansion has been written this way instead of: + * Assignment() | ConditionalExpression() + * for performance reasons. + * However, it is a weakening of the grammar for it allows the LHS of + * assignments to be any conditional expression whereas it can only be + * a primary expression. Consider adding a semantic predicate to work + * around this. + */ +{ + Expression ret; + AssignExpr.Operator op; + Expression value; +} +{ + ret = ConditionalExpression() + [ + LOOKAHEAD(2) + op = AssignmentOperator() value = Expression() { ret = new AssignExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, value, op); } + ] + { return ret; } +} + +AssignExpr.Operator AssignmentOperator(): +{ + AssignExpr.Operator ret; +} +{ + ( + "=" { ret = AssignExpr.Operator.assign; } + | "*=" { ret = AssignExpr.Operator.star; } + | "/=" { ret = AssignExpr.Operator.slash; } + | "%=" { ret = AssignExpr.Operator.rem; } + | "+=" { ret = AssignExpr.Operator.plus; } + | "-=" { ret = AssignExpr.Operator.minus; } + | "<<=" { ret = AssignExpr.Operator.lShift; } + | ">>=" { ret = AssignExpr.Operator.rSignedShift; } + | ">>>=" { ret = AssignExpr.Operator.rUnsignedShift; } + | "&=" { ret = AssignExpr.Operator.and; } + | "^=" { ret = AssignExpr.Operator.xor; } + | "|=" { ret = AssignExpr.Operator.or; } + ) + { return ret; } +} + +Expression ConditionalExpression(): +{ + Expression ret; + Expression left; + Expression right; +} +{ + ret = ConditionalOrExpression() + [ "?" left = Expression() ":" right = ConditionalExpression() { ret = new ConditionalExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, left, right); } ] + { return ret; } +} + +Expression ConditionalOrExpression(): +{ + Expression ret; + Expression right; +} +{ + ret = ConditionalAndExpression() ( "||" right = ConditionalAndExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.or); } )* + { return ret; } +} + +Expression ConditionalAndExpression(): +{ + Expression ret; + Expression right; +} +{ + ret = InclusiveOrExpression() ( "&&" right = InclusiveOrExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.and); } )* + { return ret; } +} + +Expression InclusiveOrExpression(): +{ + Expression ret; + Expression right; +} +{ + ret = ExclusiveOrExpression() ( "|" right = ExclusiveOrExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binOr); } )* + { return ret; } +} + +Expression ExclusiveOrExpression(): +{ + Expression ret; + Expression right; +} +{ + ret = AndExpression() ( "^" right = AndExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.xor); } )* + { return ret; } +} + +Expression AndExpression(): +{ + Expression ret; + Expression right; +} +{ + ret = EqualityExpression() ( "&" right = EqualityExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, BinaryExpr.Operator.binAnd); } )* + { return ret; } +} + +Expression EqualityExpression(): +{ + Expression ret; + Expression right; + BinaryExpr.Operator op; +} +{ + ret = InstanceOfExpression() + ( + ( "==" { op = BinaryExpr.Operator.equals; } | + "!=" { op = BinaryExpr.Operator.notEquals; } + ) right = InstanceOfExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } + )* + { return ret; } +} + +Expression InstanceOfExpression(): +{ + Expression ret; + Type type; +} +{ + ret = RelationalExpression() [ "instanceof" type = Type() { ret = new InstanceOfExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, type); } ] + { return ret; } +} + +Expression RelationalExpression(): +{ + Expression ret; + Expression right; + BinaryExpr.Operator op; +} +{ + ret = ShiftExpression() + ( + ( "<" { op = BinaryExpr.Operator.less; } | + ">" { op = BinaryExpr.Operator.greater; } | + "<=" { op = BinaryExpr.Operator.lessEquals; } | + ">=" { op = BinaryExpr.Operator.greaterEquals; } + ) right = ShiftExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } + )* + { return ret; } +} + +Expression ShiftExpression(): +{ + Expression ret; + Expression right; + BinaryExpr.Operator op; +} +{ + ret = AdditiveExpression() + ( + ( "<<" { op = BinaryExpr.Operator.lShift; } | + RSIGNEDSHIFT() { op = BinaryExpr.Operator.rSignedShift; } | + RUNSIGNEDSHIFT() { op = BinaryExpr.Operator.rUnsignedShift; } + ) right = AdditiveExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } + )* + { return ret; } +} + +Expression AdditiveExpression(): +{ + Expression ret; + Expression right; + BinaryExpr.Operator op; +} +{ + ret = MultiplicativeExpression() + ( + ( "+" { op = BinaryExpr.Operator.plus; } | + "-" { op = BinaryExpr.Operator.minus; } + ) right = MultiplicativeExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } + )* + { return ret; } +} + +Expression MultiplicativeExpression(): +{ + Expression ret; + Expression right; + BinaryExpr.Operator op; +} +{ + ret = UnaryExpression() + ( + ( "*" { op = BinaryExpr.Operator.times; } | + "/" { op = BinaryExpr.Operator.divide; } | + "%" { op = BinaryExpr.Operator.remainder; } + ) right = UnaryExpression() { ret = new BinaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, right, op); } + )* + { return ret; } +} + +Expression UnaryExpression(): +{ + Expression ret; + UnaryExpr.Operator op; + int line = 0; + int column = 0; +} +{ + ( + ( "+" { op = UnaryExpr.Operator.positive; line=token.beginLine; column=token.beginColumn;} | + "-" { op = UnaryExpr.Operator.negative; line=token.beginLine; column=token.beginColumn;} + ) ret = UnaryExpression() + { + if(op == UnaryExpr.Operator.negative) { + if (ret instanceof IntegerLiteralExpr && ((IntegerLiteralExpr)ret).isMinValue()) { + ret = new IntegerLiteralMinValueExpr(line, column, token.endLine, token.endColumn); + } else if (ret instanceof LongLiteralExpr && ((LongLiteralExpr)ret).isMinValue()) { + ret = new LongLiteralMinValueExpr(line, column, token.endLine, token.endColumn); + } else { + ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); + } + } else { + ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); + } + } + | + ret = PreIncrementExpression() + | + ret = PreDecrementExpression() + | + ret = UnaryExpressionNotPlusMinus() + ) + { return ret; } +} + +Expression PreIncrementExpression(): +{ + Expression ret; + int line; + int column; +} +{ + "++" {line=token.beginLine; column=token.beginColumn;} ret = PrimaryExpression() { ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, UnaryExpr.Operator.preIncrement); } + { return ret; } +} + +Expression PreDecrementExpression(): +{ + Expression ret; + int line; + int column; +} +{ + "--" {line=token.beginLine; column=token.beginColumn;} ret = PrimaryExpression() { ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, UnaryExpr.Operator.preDecrement); } + { return ret; } +} + +Expression UnaryExpressionNotPlusMinus(): +{ + Expression ret; + UnaryExpr.Operator op; + int line = 0; + int column = 0; +} +{ + ( + ( "~" { op = UnaryExpr.Operator.inverse; line=token.beginLine; column=token.beginColumn;} | + "!" { op = UnaryExpr.Operator.not; line=token.beginLine; column=token.beginColumn;} + ) ret = UnaryExpression() { ret = new UnaryExpr(line, column, token.endLine, token.endColumn,ret, op); } + | + LOOKAHEAD( CastLookahead() ) + ret = CastExpression() + | + ret = PostfixExpression() + ) + { return ret; } +} + +// This production is to determine lookahead only. The LOOKAHEAD specifications +// below are not used, but they are there just to indicate that we know about +// this. +void CastLookahead(): +{} +{ + LOOKAHEAD("(" Type() "[") + "(" Type() "[" "]" +| + "(" Type() ")" UnaryExpression() +} + +Expression PostfixExpression(): +{ + Expression ret; + UnaryExpr.Operator op; +} +{ + ret = PrimaryExpression() + [ + LOOKAHEAD(2) + ( "++" { op = UnaryExpr.Operator.posIncrement; } | + "--" { op = UnaryExpr.Operator.posDecrement; } + ) { ret = new UnaryExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, op); } + ] + { return ret; } +} + +Expression CastExpression(): +{ + Expression ret; + Type type; + int line; + int column; +} +{ + "(" {line=token.beginLine; column=token.beginColumn;} type = Type() ")" ret = UnaryExpression() { ret = new CastExpr(line, column, token.endLine, token.endColumn,type, ret); } + { return ret; } +} + +Expression PrimaryExpression(): +{ + Expression ret; + Expression inner; +} +{ + ret = PrimaryPrefix() ( LOOKAHEAD(2) ret = PrimarySuffix(ret) )* + { return ret; } +} + +Expression PrimaryExpressionWithoutSuperSuffix(): +{ + Expression ret; + Expression inner; +} +{ + ret = PrimaryPrefix() ( LOOKAHEAD( PrimarySuffixWithoutSuper(null) ) ret = PrimarySuffixWithoutSuper(ret) )* + { return ret; } +} + +Expression PrimaryPrefix(): +{ + Expression ret; + String name; + List typeArgs = null; + List args = null; + boolean hasArgs = false; + Type type; + int line; + int column; +} +{ + ( + ret = Literal() + | + "this" { ret = new ThisExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); } + | + "super" { ret = new SuperExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, null); } + "." + [ typeArgs = TypeArguments() {typeArgs.remove(0);} ] + { name = token.image; } + [ args = Arguments() {hasArgs=true;} ] + { + ret = hasArgs + ? new MethodCallExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, typeArgs, name, args) + : new FieldAccessExpr(ret.getBeginLine(), ret.getBeginColumn(), token.endLine, token.endColumn, ret, null, name); + } + | + "(" {line=token.beginLine; column=token.beginColumn;} ret = Expression() ")" { ret = new EnclosedExpr(line, column, token.endLine, token.endColumn,ret); } + | + ret = AllocationExpression(null) + | + LOOKAHEAD( ResultType() "." "class" ) + type = ResultType() "." "class" { ret = new ClassExpr(type.getBeginLine(), type.getBeginColumn(), token.endLine, token.endColumn, type); } + | + { name = token.image; line=token.beginLine; column=token.beginColumn; } + [ args = Arguments() {hasArgs=true;} ] + { + ret = hasArgs + ? new MethodCallExpr(line, column, token.endLine, token.endColumn, null, null, name, args) + : new NameExpr(line, column, token.endLine, token.endColumn, name); + } + ) + { return ret; } +} + +Expression PrimarySuffix(Expression scope): +{ + Expression ret; +} +{ + ( + LOOKAHEAD(2) + ret = PrimarySuffixWithoutSuper(scope) + | + "." "super" { ret = new SuperExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); } + ) + { return ret; } +} + +Expression PrimarySuffixWithoutSuper(Expression scope): +{ + Expression ret; + List typeArgs = null; + List args = null; + boolean hasArgs = false; + String name; +} +{ + ( + "." + ( + // TODO: está deixando passar "this.this", verificar na JLS se é possível + "this" { ret = new ThisExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope); } + | + ret = AllocationExpression(scope) + | + LOOKAHEAD( [ TypeArguments() ] ) + [ typeArgs = TypeArguments() {typeArgs.remove(0);} ] + { name = token.image; } + [ args = Arguments() {hasArgs=true;} ] + { + ret = hasArgs + ? new MethodCallExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, name, args) + : new FieldAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, typeArgs, name); + } + ) + | + "["ret = Expression() "]" { ret = new ArrayAccessExpr(scope.getBeginLine(), scope.getBeginColumn(), token.endLine, token.endColumn, scope, ret); } + ) + { return ret; } +} + +Expression Literal(): +{ + Expression ret; +} +{ + ( + { + ret = new IntegerLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); + } + | + { + ret = new LongLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); + } + | + { + ret = new DoubleLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image); + } + | + { + ret = new CharLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length()-1)); + } + | + { + ret = new StringLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, token.image.substring(1, token.image.length()-1)); + } + | + ret = BooleanLiteral() + | + ret = NullLiteral() + ) + { return ret; } +} + +Expression BooleanLiteral(): +{ + Expression ret; +} +{ + ( + "true" { ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, true); } + | + "false" { ret = new BooleanLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn, false); } + ) + { return ret; } +} + +Expression NullLiteral(): +{} +{ + "null" + { return new NullLiteralExpr(token.beginLine, token.beginColumn, token.endLine, token.endColumn); } +} + +List Arguments(): +{ + List ret = null; +} +{ + "(" [ ret = ArgumentList() ] ")" + { return ret; } +} + +List ArgumentList(): +{ + List ret = new LinkedList(); + Expression expr; +} +{ + expr = Expression() { ret.add(expr); } ( "," expr = Expression() { ret.add(expr); } )* + { return ret; } +} + +Expression AllocationExpression(Expression scope): +{ + Expression ret; + Type type; + Object[] arr = null; + List typeArgs = null; + List anonymousBody = null; + List args; + int line; + int column; +} +{ + "new" { if(scope==null) {line=token.beginLine; column=token.beginColumn;} else {line=scope.getBeginLine(); column=scope.getBeginColumn();} } + ( + type = PrimitiveType() + arr = ArrayDimsAndInits() + { + if (arr[0] instanceof Integer) { + ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer)arr[0]).intValue(), (ArrayInitializerExpr)arr[1]); + } else { + ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List)arr[0], ((Integer)arr[1]).intValue()); + } + } + | + LOOKAHEAD(ClassOrInterfaceType() ArrayDimsAndInits()) + type = ClassOrInterfaceType() + arr = ArrayDimsAndInits() + { + if (arr[0] instanceof Integer) { + ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, ((Integer)arr[0]).intValue(), (ArrayInitializerExpr)arr[1]); + } else { + ret = new ArrayCreationExpr(line, column, token.endLine, token.endColumn, type, (List)arr[0], ((Integer)arr[1]).intValue()); + } + } + | + [ typeArgs = TypeArguments() {typeArgs.remove(0);} ] + type = ClassOrInterfaceType() + args = Arguments() [ LOOKAHEAD(2) anonymousBody = ClassOrInterfaceBody(false) ] + { ret = new ObjectCreationExpr(line, column, token.endLine, token.endColumn, scope, (ClassOrInterfaceType) type, typeArgs, args, anonymousBody); } + ) + { return ret; } +} + +/* + * The third LOOKAHEAD specification below is to parse to PrimarySuffix + * if there is an expression between the "[...]". + */ +Object[] ArrayDimsAndInits(): +{ + Object[] ret = new Object[2]; + Expression expr; + List inits = null; + int i = 0; +} +{ + ( + LOOKAHEAD(2) + ( LOOKAHEAD(2) "[" expr = Expression() { inits = add(inits, expr); } "]" )+ ( LOOKAHEAD(2) "[" "]" { i++; } )* { ret[0] = inits; ret[1] = new Integer(i); } + | + ( "[" "]" { i++; } )+ expr = ArrayInitializer() { ret[0] = new Integer(i); ret[1] = expr; } + ) + { return ret; } +} + + +/* + * Statement syntax follows. + */ + +Statement Statement(): +{ + Statement ret; +} +{ + ( + LOOKAHEAD(2) + ret = LabeledStatement() + | + ret = AssertStatement() + | + ret = Block() + | + ret = EmptyStatement() + | + ret = StatementExpression() + | + ret = SwitchStatement() + | + ret = IfStatement() + | + ret = WhileStatement() + | + ret = DoStatement() + | + ret = ForStatement() + | + ret = BreakStatement() + | + ret = ContinueStatement() + | + ret = ReturnStatement() + | + ret = ThrowStatement() + | + ret = SynchronizedStatement() + | + ret = TryStatement() + ) + { return ret; } +} + +AssertStmt AssertStatement(): +{ + Expression check; + Expression msg = null; + int line; + int column; +} +{ + "assert" {line=token.beginLine; column=token.beginColumn;} check = Expression() [ ":" msg = Expression() ] ";" + { return new AssertStmt(line, column, token.endLine, token.endColumn,check, msg); } +} + +LabeledStmt LabeledStatement(): +{ + String label; + Statement stmt; + int line; + int column; +} +{ + {line=token.beginLine; column=token.beginColumn;} { label = token.image; } ":" stmt = Statement() + { return new LabeledStmt(line, column, token.endLine, token.endColumn,label, stmt); } +} + +BlockStmt Block(): +{ + List stmts; + int beginLine; + int beginColumn; +} +{ + "{" {beginLine=token.beginLine; beginColumn=token.beginColumn;} + stmts = Statements() + "}" + { return new BlockStmt(beginLine, beginColumn, token.endLine, token.endColumn, stmts); } +} + +/* + * Classes inside block stametents can only be abstract or final. The semantic must check it. + */ +Statement BlockStatement(): +{ + Statement ret; + Expression expr; + ClassOrInterfaceDeclaration typeDecl; + Modifier modifier; +} +{ + ( + LOOKAHEAD( Modifiers() ("class" | "interface") ) + { pushJavadoc(); } + modifier = Modifiers() + typeDecl = ClassOrInterfaceDeclaration(modifier) { ret = new TypeDeclarationStmt(typeDecl.getBeginLine(), typeDecl.getBeginColumn(), token.endLine, token.endColumn, typeDecl); } + | + LOOKAHEAD(VariableDeclarationExpression() ) + expr = VariableDeclarationExpression() ";" + { ret = new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); } + | + ret = Statement() + ) + { return ret; } +} + +VariableDeclarationExpr VariableDeclarationExpression(): +{ + Modifier modifier; + Type type; + List vars = new LinkedList(); + VariableDeclarator var; +} +{ + modifier = Modifiers() type = Type() var = VariableDeclarator() { vars.add(var); } ( "," var = VariableDeclarator() { vars.add(var); } )* + { + int line = modifier.beginLine; + int column = modifier.beginColumn; + if(line==-1) {line=type.getBeginLine(); column=type.getBeginColumn(); } + return new VariableDeclarationExpr(line, column, token.endLine, token.endColumn, modifier.modifiers, modifier.annotations, type, vars); + } +} + +EmptyStmt EmptyStatement(): +{} +{ + ";" + { return new EmptyStmt(token.beginLine, token.beginColumn, token.endLine, token.endColumn); } +} + +ExpressionStmt StatementExpression(): +/* + * The last expansion of this production accepts more than the legal + * Java expansions for StatementExpression. This expansion does not + * use PostfixExpression for performance reasons. + */ +{ + Expression expr; + AssignExpr.Operator op; + Expression value; +} +{ + ( + expr = PreIncrementExpression() + | + expr = PreDecrementExpression() + | + expr = PrimaryExpression() + [ + "++" { expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posIncrement); } + | + "--" { expr = new UnaryExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, UnaryExpr.Operator.posDecrement); } + | + op = AssignmentOperator() value = Expression() { expr = new AssignExpr(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr, value, op); } + ] + ) + ";" + { return new ExpressionStmt(expr.getBeginLine(), expr.getBeginColumn(), token.endLine, token.endColumn, expr); } +} + +SwitchStmt SwitchStatement(): +{ + Expression selector; + SwitchEntryStmt entry; + List entries = null; + int line; + int column; +} +{ + "switch" {line=token.beginLine; column=token.beginColumn;} "(" selector = Expression() ")" "{" + ( entry = SwitchEntry() { entries = add(entries, entry); } )* + "}" + + { return new SwitchStmt(line, column, token.endLine, token.endColumn,selector, entries); } +} + +SwitchEntryStmt SwitchEntry(): +{ + Expression label = null; + List stmts; + int line; + int column; +} +{ + ( + "case" {line=token.beginLine; column=token.beginColumn;} label = Expression() + | + "default" {line=token.beginLine; column=token.beginColumn;} + ) + ":" stmts = Statements() + + { return new SwitchEntryStmt(line, column, token.endLine, token.endColumn,label, stmts); } +} + +IfStmt IfStatement(): +/* + * The disambiguating algorithm of JavaCC automatically binds dangling + * else's to the innermost if statement. The LOOKAHEAD specification + * is to tell JavaCC that we know what we are doing. + */ +{ + Expression condition; + Statement thenStmt; + Statement elseStmt = null; + int line; + int column; +} +{ + "if" {line=token.beginLine; column=token.beginColumn;} "(" condition = Expression() ")" thenStmt = Statement() [ LOOKAHEAD(1) "else" elseStmt = Statement() ] + { return new IfStmt(line, column, token.endLine, token.endColumn,condition, thenStmt, elseStmt); } +} + +WhileStmt WhileStatement(): +{ + Expression condition; + Statement body; + int line; + int column; +} +{ + "while" {line=token.beginLine; column=token.beginColumn;} "(" condition = Expression() ")" body = Statement() + { return new WhileStmt(line, column, token.endLine, token.endColumn,condition, body); } +} + +DoStmt DoStatement(): +{ + Expression condition; + Statement body; + int line; + int column; +} +{ + "do" {line=token.beginLine; column=token.beginColumn;} body = Statement() "while" "(" condition = Expression() ")" ";" + { return new DoStmt(line, column, token.endLine, token.endColumn,body, condition); } +} + +Statement ForStatement(): +{ + String id = null; + VariableDeclarationExpr varExpr = null; + Expression expr = null; + List init = null; + List update = null; + Statement body; + int line; + int column; +} +{ + "for" {line=token.beginLine; column=token.beginColumn;} "(" + + ( + LOOKAHEAD(VariableDeclarationExpression() ":") + varExpr = VariableDeclarationExpression() ":" expr = Expression() + | + [ init = ForInit() ] ";" [ expr = Expression() ] ";" [ update = ForUpdate() ] + ) + + ")" body = Statement() + + { + if (varExpr != null) { + return new ForeachStmt(line, column, token.endLine, token.endColumn,varExpr, expr, body); + } + return new ForStmt(line, column, token.endLine, token.endColumn,init, expr, update, body); + } +} + +List ForInit(): +{ + List ret; + Expression expr; +} +{ + ( + LOOKAHEAD( Modifiers() Type() ) + expr = VariableDeclarationExpression() { ret = new LinkedList(); ret.add(expr); } + | + ret = ExpressionList() + ) + { return ret; } +} + +List ExpressionList(): +{ + List ret = new LinkedList(); + Expression expr; +} +{ + expr = Expression() { ret.add(expr); } ( "," expr = Expression() { ret.add(expr); } )* + + { return ret; } +} + +List ForUpdate(): +{ + List ret; +} +{ + ret = ExpressionList() + + { return ret; } +} + +BreakStmt BreakStatement(): +{ + String id = null; + int line; + int column; +} +{ + "break" {line=token.beginLine; column=token.beginColumn;} [ { id = token.image; } ] ";" + { return new BreakStmt(line, column, token.endLine, token.endColumn,id); } +} + +ContinueStmt ContinueStatement(): +{ + String id = null; + int line; + int column; +} +{ + "continue" {line=token.beginLine; column=token.beginColumn;} [ { id = token.image; } ] ";" + { return new ContinueStmt(line, column, token.endLine, token.endColumn,id); } +} + +ReturnStmt ReturnStatement(): +{ + Expression expr = null; + int line; + int column; +} +{ + "return" {line=token.beginLine; column=token.beginColumn;} [ expr = Expression() ] ";" + { return new ReturnStmt(line, column, token.endLine, token.endColumn,expr); } +} + +ThrowStmt ThrowStatement(): +{ + Expression expr; + int line; + int column; +} +{ + "throw" {line=token.beginLine; column=token.beginColumn;} expr = Expression() ";" + { return new ThrowStmt(line, column, token.endLine, token.endColumn,expr); } +} + +SynchronizedStmt SynchronizedStatement(): +{ + Expression expr; + BlockStmt block; + int line; + int column; +} +{ + "synchronized" {line=token.beginLine; column=token.beginColumn;} "(" expr = Expression() ")" block = Block() + { return new SynchronizedStmt(line, column, token.endLine, token.endColumn,expr, block); } +} + +TryStmt TryStatement(): +/* + * Semantic check required here to make sure that at least one + * finally/catch is present. + */ +{ + BlockStmt tryBlock; + BlockStmt finallyBlock = null; + List catchs = null; + Parameter except; + BlockStmt catchBlock; + int line; + int column; + int cLine; + int cColumn; +} +{ + "try" {line=token.beginLine; column=token.beginColumn;} tryBlock = Block() + ( + ( + "catch" {cLine=token.beginLine; cColumn=token.beginColumn;} + "(" except = FormalParameter() ")" catchBlock = Block() + { catchs = add(catchs, new CatchClause(cLine, cColumn, token.endLine, token.endColumn, except, catchBlock)); } + )+ + [ "finally" finallyBlock = Block() ] + | + "finally" finallyBlock = Block() + ) + { return new TryStmt(line, column, token.endLine, token.endColumn,tryBlock, catchs, finallyBlock); } +} + + + +/* We use productions to match >>>, >> and > so that we can keep the + * type declaration syntax with generics clean + */ + +void RUNSIGNEDSHIFT(): +{} +{ + ( LOOKAHEAD({ getToken(1).kind == GT && + ((GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT} ) + ">" ">" ">" + ) +} + +void RSIGNEDSHIFT(): +{} +{ + ( LOOKAHEAD({ getToken(1).kind == GT && + ((GTToken)getToken(1)).realKind == RSIGNEDSHIFT} ) + ">" ">" + ) +} + +/* Annotation syntax follows. */ + +AnnotationExpr Annotation(): +{ + AnnotationExpr ret; +} +{ + ( + LOOKAHEAD( "@" Name() "(" ( "=" | ")" )) + ret = NormalAnnotation() + | + LOOKAHEAD( "@" Name() "(" ) + ret = SingleMemberAnnotation() + | + ret = MarkerAnnotation() + ) + { return ret; } +} + +NormalAnnotationExpr NormalAnnotation(): +{ + NameExpr name; + List pairs = null; + int line; + int column; +} +{ + "@" {line=token.beginLine; column=token.beginColumn;} name = Name() "(" [ pairs = MemberValuePairs() ] ")" + { return new NormalAnnotationExpr(line, column, token.endLine, token.endColumn,name, pairs); } +} + +MarkerAnnotationExpr MarkerAnnotation(): +{ + NameExpr name; + int line; + int column; +} +{ + "@" {line=token.beginLine; column=token.beginColumn;} name = Name() + { return new MarkerAnnotationExpr(line, column, token.endLine, token.endColumn,name); } +} + +SingleMemberAnnotationExpr SingleMemberAnnotation(): +{ + NameExpr name; + Expression memberVal; + int line; + int column; +} +{ + "@" {line=token.beginLine; column=token.beginColumn;} name = Name() "(" memberVal = MemberValue() ")" + { return new SingleMemberAnnotationExpr(line, column, token.endLine, token.endColumn,name, memberVal); } +} + +List MemberValuePairs(): +{ + List ret = new LinkedList(); + MemberValuePair pair; +} +{ + pair = MemberValuePair() { ret.add(pair); } ( "," pair = MemberValuePair() { ret.add(pair); } )* + { return ret; } +} + +MemberValuePair MemberValuePair(): +{ + String name; + Expression value; + int line; + int column; +} +{ + { name = token.image; line=token.beginLine; column=token.beginColumn;} "=" value = MemberValue() + { return new MemberValuePair(line, column, token.endLine, token.endColumn,name, value); } +} + +Expression MemberValue(): +{ + Expression ret; +} +{ + ( + ret = Annotation() + | + ret = MemberValueArrayInitializer() + | + ret = ConditionalExpression() + ) + { return ret; } +} + +Expression MemberValueArrayInitializer(): +{ + List ret = new LinkedList(); + Expression member; + int line; + int column; +} +{ + "{" {line=token.beginLine; column=token.beginColumn;} + ( member = MemberValue() { ret.add(member); } ( LOOKAHEAD(2) "," member = MemberValue() { ret.add(member); } )* )? [ "," ] + "}" + { return new ArrayInitializerExpr(line, column, token.endLine, token.endColumn,ret); } +} + + +/* Annotation Types. */ + +AnnotationDeclaration AnnotationTypeDeclaration(Modifier modifier): +{ + String name; + List members; + int line = modifier.beginLine; + int column = modifier.beginColumn; +} +{ + "@" { if (line == -1) {line=token.beginLine; column=token.beginColumn;} } + "interface" { name = token.image; } members = AnnotationTypeBody() + + { return new AnnotationDeclaration(line, column, token.endLine, token.endColumn,popJavadoc(), modifier.modifiers, modifier.annotations, name, members); } +} + +List AnnotationTypeBody(): +{ + List ret = null; + BodyDeclaration member; +} +{ + "{" ( member = AnnotationBodyDeclaration() { ret = add(ret, member); } )* "}" + + { return ret; } +} + +BodyDeclaration AnnotationBodyDeclaration(): +{ + Modifier modifier; + BodyDeclaration ret; +} +{ + { pushJavadoc(); } + ( + ";" { ret = new EmptyTypeDeclaration(token.beginLine, token.beginColumn, token.endLine, token.endColumn, popJavadoc()); } + | + modifier = Modifiers() + ( + LOOKAHEAD(Type() "(") + ret = AnnotationTypeMemberDeclaration(modifier) + | + ret = ClassOrInterfaceDeclaration(modifier) + | + ret = EnumDeclaration(modifier) + | + ret = AnnotationTypeDeclaration(modifier) + | + ret = FieldDeclaration(modifier) + ) + ) + { return ret; } +} + +AnnotationMemberDeclaration AnnotationTypeMemberDeclaration(Modifier modifier): +{ + Type type; + String name; + Expression defaultVal = null; +} +{ + type = Type() { name = token.image; } "(" ")" [ defaultVal = DefaultValue() ] ";" + + { + int line = modifier.beginLine; + int column = modifier.beginColumn; + { if (line == -1) {line=type.getBeginLine(); column=type.getBeginColumn();} } + return new AnnotationMemberDeclaration(line, column, token.endLine, token.endColumn, popJavadoc(), modifier.modifiers, modifier.annotations, type, name, defaultVal); + } +} + +Expression DefaultValue(): +{ + Expression ret; +} +{ + "default" ret = MemberValue() + { return ret; } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ClassifierCatalog.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ClassifierCatalog.java new file mode 100644 index 00000000000..f7777787f1e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ClassifierCatalog.java @@ -0,0 +1,393 @@ +/** + * + */ +package javagen.umlparser; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Package; + +/** + * Instance of this class allows to lookup for a Classifier. + * Lookup is done in the provided paths. + * Classifier or Package are not created. An error is thrown when not found. + * + * @author dumoulin + * + * @TODO rename to ClasspathCatalog + */ +public class ClassifierCatalog { + + public static final String WILDCARD = "*"; + + /** Model containing the paths */ + protected Resource model; + + /** model Package used as root of all searchpaths */ + private Package modelRootPackage; + + /** The package containing the current compilation unit. First package searched */ + private Package currentCompilationUnitPackage; + + /** + * List of packages from where the lookup is done. + */ + protected List paths = new ArrayList();; + + /** + * Constructor. + */ + public ClassifierCatalog(Resource model) { + this.model = model; + paths.add(new ResourceSearchPackage()); + } + + /** + * Constructor. + * Not used anymore + * + * @param model + * The Resource containing the packages + */ + public ClassifierCatalog(Resource model, List packageNames) { + this.model = model; + for (String name : packageNames) { + if ("/".equals(name)) { + paths.add(new ResourceSearchPackage()); + } else { + List qualifiedName = dirToQualifiedName(name); + // Get corresponding package if any + paths.add(new ResourceRelativeSearchPackage(qualifiedName)); + } + + } + } + + /** + * Constructor. + * search paths are relative to the specified package. + * + * @param modelRootPackage + * The model Package used as root. + */ + public ClassifierCatalog(Package modelRootPackage, List packageNames) { + this.modelRootPackage = modelRootPackage; + for (String name : packageNames) { + if ("/".equals(name)) { + paths.add(new ResourceSearchPackage()); + } else { + List qualifiedName = dirToQualifiedName(name); + if (name.contains(WILDCARD)) { + // Use search path with wildcard + paths.add(new RelativeSearchPackageWithWildcard(qualifiedName)); + } + else { + // Get corresponding package if any + paths.add(new RelativeSearchPackage(qualifiedName)); + } + + + } + + } + } + + /** + * @param currentCompilationUnitPackage + * the currentCompilationUnitPackage to set + */ + public void setCurrentCompilationUnitPackage(Package currentCompilationUnitPackage) { + this.currentCompilationUnitPackage = currentCompilationUnitPackage; + } + + /** + * Get the qualified name from a directory like name. + * Name is splitted arround '/' + * + * @param name + * @return + */ + private List dirToQualifiedName(String qname) { + String[] splittedName = qname.split("/"); + return Arrays.asList(splittedName); + } + + + /** + * Get the classifier by its qname. + * + * @param qualifiedName + * @return + */ + public Classifier getClassifier(String qualifiedName) { + List qname = UmlUtils.toQualifiedName(qualifiedName); + return getClassifier(qname); + } + + /** + * Get the classifier by its qualified name. + * + * @param qualifiedName + * @return + */ + public Classifier getClassifier(List qualifiedName) { + return lookupNamedElement(qualifiedName, null); + // for( Package path : paths) + // { + // NamedElement res = getNamedElement(path, qualifiedName); + // if(res != null ) + // return (Classifier)res; + // } + // + // return null; + } + + /** + * Look for the specified element in each of the path of the model. + * Return the first corresponding element found in paths. + * + * @param qualifiedName + * Expected name. + * @param type + * Expected type or null. + * @return + */ + private Classifier lookupNamedElement(List qualifiedName, EClass type) { + + // search on current CU + if (currentCompilationUnitPackage != null) { + Classifier res = UmlUtils.lookupClassifier(currentCompilationUnitPackage, qualifiedName, type); + if (res != null) { + return res; + } + } + + // loop on searchpaths + for (SearchPackage path : paths) { + Classifier res = path.getUmlClassifier(qualifiedName, type); + if (res != null) { + return res; + } + } + + return null; + } + + + /** + * Class corresponding to one searchpath. + * + * @author dumoulin + * + */ + abstract private class SearchPackage { + + /** + * Cached value. Can be null. + */ + protected Package umlPackage; + + /** + * Search path + */ + protected List packageQualifiedName; + + /** + * @param qualifiedName + */ + public SearchPackage(List qualifiedName) { + super(); + this.packageQualifiedName = qualifiedName; + } + + abstract public Classifier getUmlClassifier(List qualifiedName, EClass expectedType); + } + + /** + * This class allows to search for uml element in specified packages relative to the Resource. + * + * @author dumoulin + * + */ + private class ResourceRelativeSearchPackage extends SearchPackage { + + public ResourceRelativeSearchPackage(List qualifiedName) { + super(qualifiedName); + } + + /** + * Get the uml package corresponding to the path. + * + * @return + */ + private Package getPathPackage() { + + // Check if in cache + if (umlPackage != null) { + return umlPackage; + } + + // No, Try to find package using the resource + umlPackage = UmlUtils.lookupPackage(model, packageQualifiedName); + return umlPackage; + } + + /** + * lookup for the classifier in this searchpath. + */ + @Override + public Classifier getUmlClassifier(List qualifiedName, EClass expectedType) { + Package p = getPathPackage(); + if (p == null) { + return null; + } + + return UmlUtils.lookupClassifier(p, qualifiedName, expectedType); + } + } + + /** + * This class allows to search for uml element in packages relative to the modelRootPackage. + * + * @author dumoulin + * + */ + private class RelativeSearchPackage extends SearchPackage { + + public RelativeSearchPackage(List qualifiedName) { + super(qualifiedName); + } + + /** + * Get the uml package corresponding to the path. + * Search from the modelRootPackage. + * + * @return + */ + private Package getPathPackage() { + // Check if in cache + if (umlPackage != null) { + return umlPackage; + } + + // No, Try to find package using the root package + umlPackage = UmlUtils.lookupPackage(modelRootPackage, packageQualifiedName); + return umlPackage; + } + + /** + * lookup for the classifier in this searchpath. + */ + @Override + public Classifier getUmlClassifier(List qualifiedName, EClass expectedType) { + Package p = getPathPackage(); + if (p == null) { + return null; + } + + return UmlUtils.lookupClassifier(p, qualifiedName, expectedType); + } + + } + + /** + * This class allows to search for uml element in packages relative to the modelRootPackage. + * + * @author dumoulin + * + */ + private class RelativeSearchPackageWithWildcard extends SearchPackage { + + /** + * + * Constructor. + * + * @param searchpath + * Search path, with a wildcard. + */ + public RelativeSearchPackageWithWildcard(List searchpath) { + super(searchpath); + } + + /** + * Lookup the uml package corresponding to the path with WILDCARD. + * Search from the modelRootPackage. + * + * @return + */ + private List lookupExistingPackages() { + + + // Lookup the package containing the wildcard, and put it in cache + if (umlPackage == null) { + umlPackage = UmlUtils.lookupPackageBeforeWildcard(modelRootPackage, packageQualifiedName); + } + + if (umlPackage == null) { + return Collections.emptyList(); + } + + // No, Try to find package using the root package + // Look for existing packages at the place of the wildcard. + List existingPackages = umlPackage.getNestedPackages(); + + return existingPackages; + } + + /** + * lookup for the classifier in this searchpath. + */ + @Override + public Classifier getUmlClassifier(List qualifiedName, EClass expectedType) { + + // Iterate on possible searchpaths + int wildcardIndex = packageQualifiedName.indexOf(WILDCARD); + // Get existing packages for the path, untill the wildcard + List existingPackages = lookupExistingPackages(); + + // Get the remaining path from ]index, size] + List remainingPath = qualifiedName.subList(wildcardIndex + 1, qualifiedName.size()); + // Now do searching from the existing packages + for (Package nestedPackage : existingPackages) { + + Classifier res = UmlUtils.lookupClassifier(nestedPackage, qualifiedName, expectedType); + if (res != null) { + return res; + } + } + + // Not found + return null; + } + + } + + /** + * This class allows to search for uml element in the resource. + * + * @author dumoulin + * + */ + private class ResourceSearchPackage extends SearchPackage { + + public ResourceSearchPackage() { + super(null); + // TODO Auto-generated constructor stub + } + + /** + * lookup for the classifier in this searchpath. + */ + @Override + public Classifier getUmlClassifier(List qualifiedName, EClass expectedType) { + return UmlUtils.lookupClassifier(model, qualifiedName, expectedType); + } + + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CompilationUnitAnalyser.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CompilationUnitAnalyser.java new file mode 100644 index 00000000000..78a09f7764e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CompilationUnitAnalyser.java @@ -0,0 +1,1245 @@ +/** + * + */ +package javagen.umlparser; + +import japa.parser.ast.CompilationUnit; +import japa.parser.ast.ImportDeclaration; +import japa.parser.ast.Node; +import japa.parser.ast.PackageDeclaration; +import japa.parser.ast.body.BodyDeclaration; +import japa.parser.ast.body.ClassOrInterfaceDeclaration; +import japa.parser.ast.body.FieldDeclaration; +import japa.parser.ast.body.JavadocComment; +import japa.parser.ast.body.MethodDeclaration; +import japa.parser.ast.body.ModifierSet; +import japa.parser.ast.body.Parameter; +import japa.parser.ast.body.TypeDeclaration; +import japa.parser.ast.body.VariableDeclarator; +import japa.parser.ast.expr.AnnotationExpr; +import japa.parser.ast.expr.NameExpr; +import japa.parser.ast.expr.QualifiedNameExpr; +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.type.PrimitiveType; +import japa.parser.ast.type.ReferenceType; +import japa.parser.ast.type.VoidType; +import japa.parser.ast.type.WildcardType; +import japa.parser.ast.visitor.VoidVisitorAdapter; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javagen.umlparser.TypeAnalyserAndTranslator.TranslatedTypeData; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.uml2.uml.BehavioredClassifier; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Comment; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Feature; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Namespace; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.ParameterDirectionKind; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.VisibilityKind; + +/** + * A visitor filling the provided UML model + * + * @author dumoulin + * + */ +public class CompilationUnitAnalyser { + + + public static String DEFAULT_GENERATION_PACKAGE_NAME = "generated"; + + public static String DEFAULT_ROOT_PACKAGE_NAME = "model"; + + private List generationPackageQualifiedName; + + /** + * Root package of the generation. All generated elements will be added to this package, or one of + * its subpackages + */ + private org.eclipse.uml2.uml.Package defaultGenerationPackage; + + /** + * Catalog used to get the package needed for a creation. + */ + private CreationPackageCatalog creationPackageCatalog; + + /** + * Catalog used to lookup for a classifier. The catalog specifies a collection of models + * containing the java packages + */ + private ClassifierCatalog classifierCatalog; + + /** + * Catalog used to store the imports and to lookup for the qualified name of an element. + */ + private ImportedTypeCatalog importedTypes; + + /** + * The Package containing the current compilation unit. + * Initialized at the beginning of exploreCompilationUnit() + */ + private Package currentCompilationUnitPackage; + + /** + * Enclosing namespaces of the currently processed class. + * The first element is always the current package. + */ + private List enclosingNamespaces = new ArrayList(); + + /** + * Visitor used to parse qualified names. + */ + private QualifiedNameParser qualifiedNameParser = new QualifiedNameParser(); + + private TypeAnalyserAndTranslator typeAnalyser; + + /** Model where all element are created */ + + /** + * Constructor. + */ + public CompilationUnitAnalyser(Resource model) { + + this(model, DEFAULT_ROOT_PACKAGE_NAME, DEFAULT_GENERATION_PACKAGE_NAME, null); + } + + /** + * + * Constructor. + */ + public CompilationUnitAnalyser(Resource model, String generatePackageName, List searchPaths) { + + this(model, DEFAULT_ROOT_PACKAGE_NAME, generatePackageName, searchPaths); + } + + /** + * + * Constructor. + */ + public CompilationUnitAnalyser(Resource model, String modelRootPackageName, String generatePackageName, List searchPaths) { + + Package modelRootPackage = UmlUtils.getPackage(model, dirToQualifiedName(modelRootPackageName)); + initCompilationUnitAnalyser(modelRootPackage, generatePackageName, searchPaths); + } + + /** + * + * Constructor. + * All provided paths and searchpaths are relative to the specified modelRootPackage. + */ + public CompilationUnitAnalyser(Package modelRootPackage, String generatePackageName, List searchPaths) { + + // this.model = model; + + initCompilationUnitAnalyser(modelRootPackage, generatePackageName, searchPaths); + } + + /** + * Initialize the class. Called by constructors. + * + * @param modelRootPackage + * @param generatePackageName + * @param searchPaths + */ + private void initCompilationUnitAnalyser(Package modelRootPackage, String generatePackageName, List searchPaths) { + if (generatePackageName == null) { + generatePackageName = DEFAULT_GENERATION_PACKAGE_NAME; + } + + this.generationPackageQualifiedName = dirToQualifiedName(generatePackageName); + + + // Copy searchpath in order to be able to change it. + if (searchPaths != null) { + searchPaths = new ArrayList(searchPaths); + } else { + searchPaths = new ArrayList(); + } + + // Add generation package in search paths + if (!searchPaths.contains(generatePackageName)) { + searchPaths.add(generatePackageName); + } + + System.out.println(this.getClass().getSimpleName() + ".CT(" + generationPackageQualifiedName + ", sarchpaths=" + searchPaths + ")"); + + + createDefaultGenerationPackage(modelRootPackage); + + classifierCatalog = new ClassifierCatalog(modelRootPackage, searchPaths); + importedTypes = new ImportedTypeCatalog(); + creationPackageCatalog = new CreationPackageCatalog(modelRootPackage, defaultGenerationPackage, null); + + typeAnalyser = new TypeAnalyserAndTranslator(importedTypes); + } + + + + /** + * Get the qualified name from a directory like name. + * Name is splitted arround '/' + * + * @param name + * @return + */ + private List dirToQualifiedName(String qname) { + String[] splittedName = qname.split("/"); + return Arrays.asList(splittedName); + } + + /** + * Create the root element in which all element will be created. + */ + private void createDefaultGenerationPackage(Resource model) { + + Package p = UmlUtils.getPackage(model, generationPackageQualifiedName); + defaultGenerationPackage = p; + } + + /** + * Create the root element in which all element will be created. + */ + private void createDefaultGenerationPackage(Package rootModelElement) { + + // Package p = UmlUtils.getPackage(rootModelElement, generationPackageQualifiedName); + Package p = UmlUtils.getModel(rootModelElement, generationPackageQualifiedName); + defaultGenerationPackage = p; + } + + /** + * Explore the CU and create the declared types + * + * @param cu + */ + public void processCompilationUnit(CompilationUnit cu) { + + // First, find the parent Package + currentCompilationUnitPackage = getCuPackage(cu.getPakage()); + ; + classifierCatalog.setCurrentCompilationUnitPackage(currentCompilationUnitPackage); + + // Add imports + importedTypes.clear(); + if (cu.getImports() != null) { + addImports(importedTypes, cu.getImports()); + } + + // Now, explore each type declared type in the cu + if (cu.getTypes() != null) { + // for (Iterator i = cu.getTypes().iterator(); + // i.hasNext();) + // Process all types + for (TypeDeclaration typeDecl : cu.getTypes()) { + // Build the enclosing namespaces. Add the package as parent + enclosingNamespaces.add(currentCompilationUnitPackage); + processTypedeclaration(enclosingNamespaces, typeDecl); + // Reset the list of enclosing parents, in case of errors + enclosingNamespaces.clear(); + } // end loop + } // end if + + } + + /** + * Process Typedeclaration 2 Classifier. + * Process common parts : modifiers, members, ... + * + * @param enclosingParents + * The package, followed by nested classes if any. + * @param typeDecl + */ + private void processTypedeclaration(final List enclosingParents, TypeDeclaration typeDecl) { + Classifier classifier; + + // Process right type + // Create the corresponding type. + classifier = new GenericSwitchVisitor>() { + + @Override + public Classifier visit(ClassOrInterfaceDeclaration n, List enclosingParents) { + return processClassOrInterfaceDeclaration(n, enclosingParents); + } + + // TODO Other kind of types + }.doSwitch(typeDecl, enclosingParents); + + // Set Visibility + createModifiers(classifier, typeDecl.getModifiers()); + + // Template parameters + // TODO + + // Explore members + if (typeDecl.getMembers() != null) { + for (BodyDeclaration member : typeDecl.getMembers()) { + new SwitchVisitor() { + + @Override + public void visit(FieldDeclaration n, Type classifier) { + createAttributes(n, classifier); + } + + @Override + public void visit(MethodDeclaration n, Type classifier) { + processMethod(n, (Classifier) classifier); + } + + /** + * Inner classes ? + * + * @param n + * @param arg + */ + @Override + public void visit(ClassOrInterfaceDeclaration n, Type classifier) { + System.out.println("Found nested class (ClassOrInterface)'" + n.getName() + "'"); + + // Process nested classifier, and create it in its nested namespace + // So, increase the enclosing parents. + enclosingParents.add((Classifier) classifier); + processTypedeclaration(enclosingParents, n); + enclosingParents.remove(classifier); + // processClassOrInterfaceDeclaration(n, parent) + super.visit(n, classifier); + } + // TODO Other kind of members + }.doSwitch(member, classifier); + } + + } + } + + /** + * Add all the imports to the manager. + * + * @param importedTypes2 + * @param imports + */ + private void addImports(ImportedTypeCatalog importedTypes, List imports) { + + + for (ImportDeclaration decl : imports) { + List qualifiedName = qualifiedNameParser.getImportQualifiedName(decl); + if (decl.isAsterisk()) { + qualifiedName.add("*"); + } + importedTypes.addImport(qualifiedName); + } + + } + + /** + * Get (lookup or create) the specified classifier. + * Translate the qualifiedName according to imports, and lookup in classifierCatalog . + * If nothing is found and provided name is not qualified, create/get in parent, otherwise create/get in root + * using the qualified name. + * + * @param qualifiedName + * @param isInterface + * What should be created if nothing is found ? An interface or a Class ? + * @return + */ + private Classifier getUmlClassifier(List qualifiedName, boolean isInterface) { + // Get the corresponding type + // TODO specify requested type + // Lookup if it exist in the catalog (under one of the specified path) + Classifier foundClass = classifierCatalog.getClassifier(qualifiedName); + + // If nothing found, create it + if (foundClass == null) {// Not yet created. + EClass expectedType; + if (isInterface) { + expectedType = UMLPackage.eINSTANCE.getInterface(); + } else { + expectedType = UMLPackage.eINSTANCE.getClass_(); + } + + // Check where to create + if (importedTypes.isImportedType(qualifiedName)) { + // This is an imported type, create it in its dedicated model + // First get the package where to create it, according to its name + Package creationPackage = creationPackageCatalog.getCreationPackage(qualifiedName); + // Now, create it. + foundClass = UmlUtils.getClassifier(creationPackage, qualifiedName, expectedType); + } else { + // The qualified name is relative to one of the enclosing namespace. + // Check if it exist, or create it. + foundClass = UmlUtils.getGuessedClassifier(enclosingNamespaces, qualifiedName, expectedType); + } + + + + // if(qualifiedName.size() == 1 && currentCompilationUnitPackage != null) { + // // No scope in qname, create it in current namespace. + // // TODO use current namespace instead of current package. + // + // // TODO change to create (avoid second lookup) + // // foundClass = UmlUtils.getClassifier(currentCompilationUnitPackage, qualifiedName, expectedType); + // foundClass = UmlUtils.getGuessedClassifier(enclosingNamespaces, qualifiedName.get(0), expectedType); + // } else { + // //create with specified qname + // // First get the package where to create it, according to its name + // Package creationPackage = creationPackageCatalog.getCreationPackage(qualifiedName); + // // Now, create it. + // foundClass = UmlUtils.getClassifier(creationPackage, qualifiedName, expectedType); + // } + } + return foundClass; + } + + /** + * Get the type qualified name from its ast description + * + * @param astType + * @return + */ + private List getQualifiedName(ClassOrInterfaceType astType) { + QualifiedNameParser visitor = new QualifiedNameParser(); + + List res = visitor.getClassOrInterfaceQualifiedName(astType); + return res; + } + + /** + * Create all attributes and add it to the parent. + * + * @param n + * @param parent + */ + protected void createAttributes(FieldDeclaration n, Type parent) { + + System.out.println("getAttributeType( from:" + n.getType().getClass().getName() + ")"); + + // Get data about the type + // Get the qualified name, and other info on type + TranslatedTypeData typeData = processType(n.getType()); + // Get the uml element from the qualified name + Type umlType = getUmlType(typeData); + + // walk on variable declarations. + for (VariableDeclarator var : n.getVariables()) { + if (parent instanceof Classifier) { + createAttribute(n, var, (Classifier) parent, umlType, typeData); + } + } + } + + /** + * Get the qualified name, and other info on type. + * Lookup in imports to resolve names. + * + * @param n + * @return + */ + private TranslatedTypeData processType(japa.parser.ast.type.Type astType) { + TranslatedTypeData data = typeAnalyser.getTranslatedTypeData(astType); + + return data; + } + + /** + * Get the uml type from the translated type. + * + * @param data + * @return + */ + private Type getUmlType(TranslatedTypeData data) { + // Get the uml type + Type umlType = null; + if (data.isPrimitive) { + umlType = classifierCatalog.getClassifier(data.qualifiedName); + if (umlType == null) { + Package creationPackage = creationPackageCatalog.getCreationPackage(data.qualifiedName); + umlType = UmlUtils.getPrimitive(creationPackage, data.qualifiedName); + } + } else if (data.isVoid || data.isWildcard) { + return null; + } else { + // Look for existing classifier of any type. + // Take the first letter of the name as an hint. IXxxx + List qualifiedName = data.getTranslatedQualifiedName(); + boolean isInterface = false; + String shortName = qualifiedName.get(qualifiedName.size() - 1); + + // Try to guess if it is an interface. + if (shortName.length() > 2 && shortName.startsWith("I") && Character.isUpperCase(shortName.charAt(1))) { + isInterface = true; + } + + // Get or create type. + umlType = getUmlClassifier(qualifiedName, isInterface); + } + return umlType; + } + + /** + * Get the Type from an ast.Type node. + * + * @param astType + * @return + */ + protected TypeData getAttributeType(japa.parser.ast.type.Type astType) { + + TypeData res = new TypeData(); + + new SwitchVisitor() { + + /** + * Get type from a class. + */ + @Override + public void visit(ClassOrInterfaceType n, TypeData data) { + List qnameBefore = getQualifiedName(n); + List qname = importedTypes.getQualifiedName(qnameBefore); + + data.qualifiedName = qname; + // Check for generic parameters + if (n.getTypeArgs() != null) { + data.genericData = new ArrayList(); + for (japa.parser.ast.type.Type arg : n.getTypeArgs()) { + TypeData argData = new TypeData(); + arg.accept(this, argData); + data.genericData.add(argData); + } + } + } + + @Override + public void visit(ReferenceType n, TypeData data) { + // skip the reference node and process the child. + // Should not appear in an type use (in Attribute or method) + data.arrayCount = n.getArrayCount(); + n.getType().accept(this, data); + } + + @Override + public void visit(PrimitiveType n, TypeData data) { + String qnameBefore = getPrimitiveName(n); + List qname = importedTypes.getQualifiedName(qnameBefore); + + data.qualifiedName = qname; + data.isPrimitive = true; + } + + @Override + public void visit(WildcardType n, TypeData data) { + data.isWildcard = true; + if (n.getExtends() != null) { + data.extends_ = new TypeData(); + n.getExtends().accept(this, data.extends_); + } + if (n.getSuper() != null) { + data.super_ = new TypeData(); + n.getSuper().accept(this, data.super_); + } + + } + + @Override + public void visit(VoidType n, TypeData data) { + // TODO Auto-generated method stub + data.isVoid = true; + } + + }.doSwitch(astType, res); + + return res; + } + + /** + * Data structure to return data about a Declared type. + * + * @author dumoulin + * + */ + protected class TypeData { + + List qualifiedName; + + /** template parameters */ + protected List genericData; + + boolean isInterface = false; + + /** PrimitiveType */ + boolean isPrimitive = false; + + /** ReferenceType */ + protected int arrayCount; + + /** For Wildcard */ + protected boolean isWildcard = false; + + protected TypeData extends_; + + protected TypeData super_; + + /** VoidType */ + protected boolean isVoid = false; + } + + /** + * Create the uml2.primitivetype denoted by the specified PrimitiveType + * + * @param n + * @return + */ + protected String getPrimitiveName(PrimitiveType n) { + String typeName = null; + + switch (n.getType()) { + case Boolean: + typeName = "Boolean"; + break; + case Byte: + typeName = "Byte"; + break; + case Char: + typeName = "Char"; + break; + case Double: + typeName = "Double"; + break; + case Float: + typeName = "Float"; + break; + case Int: + typeName = "Integer"; + break; + case Long: + typeName = "Long"; + break; + case Short: + typeName = "Short"; + break; + } + + return typeName; + } + + /** + * Create an attribute and add it to the parent. + * + * @param n + * node declaring type and modifiers + * @param var + * @param parent + * @param type + */ + protected void createAttribute(FieldDeclaration n, VariableDeclarator var, Classifier parent, Type type, TranslatedTypeData typeData) { + + // get with no type, and then update type. + Property property = UmlUtils.createProperty(parent, null, var.getId().getName(), var.getId().getArrayCount()); + property.setType(type); + processJavadoc(n.getJavaDoc(), property); + processModifiers(n.getModifiers(), property); + if (typeData.isCollection()) { + property.setLower(typeData.getTranslatedLower()); + property.setUpper(typeData.getTranslatedUpper()); + } + } + + /** + * Process modifiers for Operation + * + * @param modifiers + * @param property + */ + private void processModifiers(int modifiers, Operation property) { + if (ModifierSet.isAbstract(modifiers)) { + property.setIsAbstract(true); + } + processModifiers(modifiers, (Feature) property); + } + + /** + * Process modifiers + * + * @param modifiers + * @param property + */ + private void processModifiers(int modifiers, Feature property) { + // TODO Auto-generated method stub + if (ModifierSet.isPrivate(modifiers)) { + property.setVisibility(VisibilityKind.PRIVATE_LITERAL); + } + if (ModifierSet.isProtected(modifiers)) { + property.setVisibility(VisibilityKind.PROTECTED_LITERAL); + } + if (ModifierSet.isPublic(modifiers)) { + property.setVisibility(VisibilityKind.PUBLIC_LITERAL); + } + if (ModifierSet.isStatic(modifiers)) { + property.setIsStatic(true); + } + if (ModifierSet.isFinal(modifiers)) { + property.setIsLeaf(true); + } + // if (ModifierSet.isNative(modifiers)) { + // printer.print("native "); + // } + // if (ModifierSet.isStrictfp(modifiers)) { + // printer.print("strictfp "); + // } + // if (ModifierSet.isSynchronized(modifiers)) { + // printer.print("synchronized "); + // } + // if (ModifierSet.isTransient(modifiers)) { + // property.set(true); + // } + // if (ModifierSet.isVolatile(modifiers)) { + // printer.print("volatile "); + // } + } + + /** + * Process modifiers + * + * @param modifiers + * @param property + */ + private void processModifiers(int modifiers, org.eclipse.uml2.uml.Parameter property) { + // TODO Auto-generated method stub + if (ModifierSet.isPrivate(modifiers)) { + property.setVisibility(VisibilityKind.PRIVATE_LITERAL); + } + if (ModifierSet.isProtected(modifiers)) { + property.setVisibility(VisibilityKind.PROTECTED_LITERAL); + } + if (ModifierSet.isPublic(modifiers)) { + property.setVisibility(VisibilityKind.PUBLIC_LITERAL); + } + if (ModifierSet.isFinal(modifiers)) { + property.setDirection(ParameterDirectionKind.IN_LITERAL); + } + } + + private class MethodParameterData { + + TranslatedTypeData dataType; + + Type umlType; + + Parameter astParameter; + } + + /** + * Process method to be added to the provided classifier. + * + * @param n + * @param classifier + */ + protected void processMethod(MethodDeclaration n, Classifier classifier) { + + // Get parameters to have a signature + // Parameters + List signature = new ArrayList(); + + if (n.getParameters() != null) { + List paramDatas = new ArrayList(); + + for (Parameter param : n.getParameters()) { + MethodParameterData data = new MethodParameterData(); + data.dataType = processType(param.getType()); + data.umlType = getUmlType(data.dataType); + data.astParameter = param; + paramDatas.add(data); + signature.add(data.umlType); + } + } + + // Operation method = UmlUtils.getOperation(classifier, n.getName()); + Operation method = getUmlOperation(classifier, n.getName(), signature); + + processJavadoc(n.getJavaDoc(), method); + processAnnotation(n.getAnnotations(), method); + processModifiers(n.getModifiers(), method); + TranslatedTypeData typeData = processType(n.getType()); + Type methodType = getUmlType(typeData); + + if (methodType != null) { + method.setType(methodType); + if (typeData.isCollection()) { + method.setLower(typeData.getTranslatedLower()); + method.setUpper(typeData.getTranslatedUpper()); + } + } + + // Parameters + if (n.getParameters() != null) { + for (Parameter param : n.getParameters()) { + processMethodParameter(param, method); + } + } + } + + /** + * Get an operation by its signature + * + * @param classifier + * @param name + * @param signature + * @return + */ + private Operation getUmlOperation(Classifier classifier, String name, List signature) { + List list = classifier.getOperations(); + + // walk all operations with the same name. + // Check signature matching + for (Operation oper : list) { + + if (isSameOperation(oper, name, signature)) { + return oper; + } + } + // Not found, create a new one (without signature) + return UmlUtils.createOperation(classifier, name); + } + + /** + * @param oper + * @param name + * @param signature + */ + private boolean isSameOperation(Operation oper, String name, List signature) { + + // check name + if (!name.equals(oper.getName())) { + return false; + } + + // Check parameters + List umlParams = oper.getOwnedParameters(); + // Check signature + if (signature == null) { + return true; + } else if (umlParams == null) { + if (signature.size() == 0) { + return true; + } else { + return false; + } + } else if ( /* signature!= null && */umlParams != null) { + int umlParamIndex = 0; + for (Type signatureType : signature) { + try { + // Compare type + org.eclipse.uml2.uml.Parameter param = umlParams.get(umlParamIndex++); + // skip return parameter + while (param.getDirection() == ParameterDirectionKind.RETURN_LITERAL) { + param = umlParams.get(umlParamIndex++); + } + + // Check types, skip if existing type is null + Type existingType = param.getType(); + if (existingType != null && !(existingType.getName().equals(signatureType.getName()))) { + // umlParamIndex > umlParams.getSize() + return false; + } + } catch (IndexOutOfBoundsException e) { + + return false; + } + } + // Check if there still some type in umlParams + // if index is the last one: ok + // otherwise, check if remaining arguments are only returns. + while (umlParamIndex < umlParams.size()) { + if (umlParams.get(umlParamIndex++).getDirection() != ParameterDirectionKind.RETURN_LITERAL) { + return false; + } + } + // same + return true; + } + + return false; + } + + /** + * Process a parameter. + * + * @param param + * @param method + */ + private void processMethodParameter(Parameter param, Operation method) { + + TranslatedTypeData typeData = processType(param.getType()); + Type type = getUmlType(typeData); + + System.out.println("getOwnedParameter(" + method.getName() + "= " + param.getId().getName() + ", " + type + " )"); + org.eclipse.uml2.uml.Parameter umlParameter = method.getOwnedParameter(param.getId().getName(), type, true, true); + + if (typeData.isCollection()) { + umlParameter.setLower(typeData.getTranslatedLower()); + umlParameter.setUpper(typeData.getTranslatedUpper()); + } + processModifiers(param.getModifiers(), umlParameter); + processAnnotation(param.getAnnotations(), method); + + } + + /** + * Process annotation. + * + * @param annotations + * @param method + */ + private void processAnnotation(List annotations, Element method) { + // TODO Auto-generated method stub + // Set annotation as stereotype ? + } + + /** + * Process javadoc. + * + * @param javaDoc + * @param method + */ + private void processJavadoc(JavadocComment javaDoc, Element umlElement) { + if (javaDoc == null) { + return; + } + + Comment comment; + // Check if a comment already exists. + List ownedComments = umlElement.getOwnedComments(); + if (ownedComments != null && ownedComments.size() > 0) { + comment = ownedComments.get(0); + } else { // Create a new comment + comment = umlElement.createOwnedComment(); + } + + // Set the body + comment.setBody(javaDoc.getContent()); + } + + /** + * Create an interface and return it. + * The Classifier is created exactly in the directly enclosing namespace. + * First, a lookup is done to check if it has been created elsewhere in the namespaces. If true, correct the location + * and maybe the type. + * + * Only need to create the object and fill it with data available at this level. + * + * @param enclosingParents + * enclosing parent, Package included, in case of nested declaration. + * @param n + * @return + */ + protected Class createClass(List enclosingParents, ClassOrInterfaceDeclaration n) { + System.out.println("getClass( " + n.getName() + " )"); + return UmlUtils.getClass(enclosingParents, n.getName()); + } + + /** + * Create an interface and return it. + * The Classifier is created exactly in the directly enclosing namespace. + * First, a lookup is done to check if it has been created elsewhere in the namespaces. If true, correct the location + * and maybe the type. + * + * Only need to create the object and fill it with data available at this level. + * + * @param parent + * @param n + * @return + */ + protected Interface createInterface(List enclosingParents, ClassOrInterfaceDeclaration n) { + System.out.println("getInterface( " + n.getName() + " )"); + return UmlUtils.getInterface(enclosingParents, n.getName()); + } + + /** + * get (lookup or create) the packages containing the CU. + * + * @param cu + * @return + */ + private Package getCuPackage(PackageDeclaration packageDecl) { + + // If null, return the generation root + if (packageDecl == null) { + return defaultGenerationPackage; + } + + // Get the name + List qualifiedName = qualifiedNameParser.getPackageQualifiedName(packageDecl); + // Get the creation model + Package creationPackage = creationPackageCatalog.getCreationPackage(qualifiedName); + // Get the current unit package (where the element are created) + Package p = UmlUtils.getPackage(creationPackage, qualifiedName); + + return p; + // question + // How to let the creationPackageCatalog create the package for a specified name ? + // CreatePackage visitor = new CreatePackage(); + // Package res = visitor.getPackage(packageDecl, defaultGenerationPackage); + + // return res; + } + + private void createModifiers(Classifier c, int modifiers) { + // TODO Auto-generated method stub + if (ModifierSet.isPrivate(modifiers)) { + c.setVisibility(VisibilityKind.PRIVATE_LITERAL); + } + if (ModifierSet.isProtected(modifiers)) { + c.setVisibility(VisibilityKind.PROTECTED_LITERAL); + } + if (ModifierSet.isPublic(modifiers)) { + c.setVisibility(VisibilityKind.PUBLIC_LITERAL); + } + if (ModifierSet.isAbstract(modifiers)) { + c.setIsAbstract(true); + } + // if (ModifierSet.isStatic(modifiers)) { + // c.get + // } + if (ModifierSet.isFinal(modifiers)) { + c.setIsLeaf(true); + } + // if (ModifierSet.isNative(modifiers)) { + // printer.print("native "); + // } + // if (ModifierSet.isStrictfp(modifiers)) { + // printer.print("strictfp "); + // } + // if (ModifierSet.isSynchronized(modifiers)) { + // printer.print("synchronized "); + // } + // if (ModifierSet.isTransient(modifiers)) { + // printer.print("transient "); + // } + // if (ModifierSet.isVolatile(modifiers)) { + // printer.print("volatile "); + // } + + } + + + + /** + * Process Class or Interface declaration (only the head of the class, not the members). + * + * @param n + * @param parent + * @return + */ + private Classifier processClassOrInterfaceDeclaration(ClassOrInterfaceDeclaration n, List enclosingParents) { + + Classifier processedClass; + if (n.isInterface()) { + processedClass = createInterface(enclosingParents, n); + } else { + processedClass = createClass(enclosingParents, n); + } + + // Comments + processJavadoc(n.getJavaDoc(), processedClass); + + // Extends parameters + if (n.getExtends() != null) { + for (ClassOrInterfaceType type : n.getExtends()) { // Get the type + List qualifiedName = getQualifiedName(type); + qualifiedName = importedTypes.getQualifiedName(qualifiedName); + Classifier generalization = getUmlClassifier(qualifiedName, n.isInterface()); + // create the generalization + UmlUtils.getGeneralization(processedClass, generalization); + } + } + + // implements parameters + if (n.getImplements() != null) { + for (ClassOrInterfaceType type : n.getImplements()) { + List qualifiedName = getQualifiedName(type); + qualifiedName = importedTypes.getQualifiedName(qualifiedName); + Classifier generalization = getUmlClassifier(qualifiedName, true); + // create the generalization + Package parentPackage = (Package) enclosingParents.get(0); + // TODO use InterfaceRealization instead of Realization + // Need to store the InterfaceRealization in the right parent + // UmlUtils.getRealization(parentPackage, processedClass, generalization); + if (generalization instanceof Interface && processedClass instanceof BehavioredClassifier) { + UmlUtils.getInterfaceRealization((BehavioredClassifier) processedClass, (Interface) generalization); + } else + { + // should not happen + UmlUtils.getGeneralization(processedClass, generalization); + } + } + } + + + return processedClass; + } + + + /** + * Visitor used to create Package from a qualified names + * Example : javagen.parser + * trace : + * - visitQualifiedName( parser ) + * - visitName( javagen ) + * + * @author dumoulin + * + */ + protected class CreatePackage extends VoidVisitorAdapter> { + + + /** + * Create or find the packages corresponding to the qualified name. + * This is the main method to be called + * + * @param decl + * @param parent + * @return + */ + public Package getPackage(PackageDeclaration decl, Package parent) { + List names = new ArrayList(); + + // Create a list of names in proper order. + decl.accept(this, names); + + Package p = parent; + // iterate on names + for (String packageName : names) { + p = UmlUtils.getPackage(p, packageName); + } + return p; + } + + /** + * Create the package part + */ + @Override + public void visit(NameExpr n, List names) { + // System.out.println("visitName( " + n.getName() + " )"); + // Add in head, because elements are found in reverse order. + names.add(0, n.getName()); + super.visit(n, names); + } + + /** + * + */ + @Override + public void visit(QualifiedNameExpr n, List names) { + // System.out.println("visitQualifiedName( " + n.getName() + " )"); + // Add in head, because elements are found in reverse order. + names.add(0, n.getName()); + super.visit(n, names); + } + } + + /** + * Visitor used to create a qualified name from ClassOrInterfaceType + * + * @author dumoulin + * + */ + protected class QualifiedNameParser extends VoidVisitorAdapter> { + + /** + * Get the qualified name from the specified ast type + * + * @param n + * @return + */ + public List getClassOrInterfaceQualifiedName(ClassOrInterfaceType n) { + List res = new ArrayList(); + n.accept(this, res); + return res; + } + + /** + * Get the qualified name from the specified ast type + * + * @param n + * @return + */ + public List getPackageQualifiedName(PackageDeclaration n) { + List res = new ArrayList(); + n.accept(this, res); + return res; + } + + /** + * Get the qualified name from the specified ast type + * + * @param n + * @return + */ + public List getImportQualifiedName(ImportDeclaration n) { + // Imports are ordered from rootPackage to Type. + // So, names should be added in before visiting childs. + return getQualifiedName(n); + } + + /** + * Get the qualified name from the specified ast type + * + * @param n + * @return + */ + private List getQualifiedName(Node n) { + List res = new ArrayList(); + n.accept(this, res); + return res; + } + + /** + * Create the package part + */ + @Override + public void visit(ClassOrInterfaceType n, List names) { + // System.out.println("visitName( " + n.getName() + " )"); + // Add in head, because elements are found in reverse order. + // super.visit(n, names); + names.add(0, n.getName()); + if (n.getScope() != null) { + n.getScope().accept(this, names); + } + } + + /** + * Create the package part + */ + @Override + public void visit(NameExpr n, List names) { + // Add in head, because elements are found in reverse order. + // System.out.println("addName( " + n.getName() + " )"); + names.add(0, n.getName()); + // super.visit(n, names); + } + + /** + * + */ + @Override + public void visit(QualifiedNameExpr n, List names) { + // Add in head, because elements are found in reverse order. + // System.out.println("addQualifiedName( " + n.getName() + " )"); + names.add(0, n.getName()); + if (n.getQualifier() != null) + { + n.getQualifier().accept(this, names); + // super.visit(n, names); + } + } + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CreationPackageCatalog.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CreationPackageCatalog.java new file mode 100644 index 00000000000..5266bb2df21 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CreationPackageCatalog.java @@ -0,0 +1,639 @@ +/** + * + */ +package javagen.umlparser; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.uml2.uml.Package; + +/** + * Catalog used to find the package where an element should be created. + * The catalog maintain a map of (java package prefixes, creation prefixes). + * If no mapping is specified, the default creation package is used. + * The catalog can be configured with: + *
      + *
    • defaultCreationPackage - The default path where packages are created when no matching creation Paths can be found.
    • + *
    • packageCreationPatterns - Pattern indicating in where a java package should be created according to its name.
    • + *
    • packageSearchPatterns - Patterns used to search for an existing java patterns. Used by {@link ClassifierCatalog}
    • + *
    + *
    + * A packageCreationPatterns is made like that: + *
      + *
    • packageCreationPatterns: includePattern excludePatterns creationPath
    • + *
    • includePattern: pathPattern | null
    • + *
    • excludePatterns: pathPattern*
    • + *
    • creationPath: pathPattern
    • + *
    • pathPattern: path*.'*' | path | '*'.path | path'.*.'path
    • + *
    • path: pathPart['.'pathPart]*
    • + *
    • pathPart: name
    • + *
    + * A defaultCreationPackage is made like that: + *
      + *
    • defaultCreationPackage: path
    • + *
    + * A packageSearchPatterns is made like that: + *
      + *
    • defaultCreationPackage: path*.'*'
    • + *
    creationPatterns; + + /** + * Default package returned when no mapping is found. + */ + private Package defaultCreationPackage; + + private static String defaultCreationPath = "default"; + + /** The model root package. Used to create mapped packages */ + private Package modelRootPackage; + + /** + * Default packageCreationPatterns. + */ + private static String[] defaultPackageCreationPatterns = { + "java.*", null, "java", + "org.eclipse.papyrus.*", null, "*", + // "org.eclipse.*", "org.eclipse.papyrus.*", "eclipse.*", + "org.eclipse.*", "org.eclipse.papyrus.*", "*", + "org.osgi.*", null, "osgi.*", + "datatype.*", null, "datatype" + }; + + + /** + * Constructor. + * Init the mappings + * format: ("p1.p2.p3", "p1.p2.p3", "pa/pb/pc") + * format: (include javaPackage, exclude javaPackage(or null), umlPackage) + * include and exclude package can start or (xor) end with '*' + * + * @param modelRootPackage + * Package used to create mapped packages + * @param defaultPackage + * Default package returned when no mapping is found + * @param creationPatterns + * mappings. + */ + public CreationPackageCatalog(Package modelRootPackage, Package defaultPackage, List packageCreationPatterns) { + this.defaultCreationPackage = defaultPackage; + this.modelRootPackage = modelRootPackage; + creationPatterns = new ArrayList(); + + if (packageCreationPatterns == null || packageCreationPatterns.size() == 0) + { + // use default + initPackageCreationPatterns(creationPatterns, defaultPackageCreationPatterns); + } + else { + // Use provided array + try { + validateCreationPath(packageCreationPatterns); + } catch (Exception e) { + throw new IllegalArgumentException("Parameter initialMappings has bad format:", e); + } + initPackageCreationPatterns(creationPatterns, packageCreationPatterns.toArray(new String[] {})); + + } + + } + + /** + * @param defaultPackage + * the defaultPackage to set + */ + public void setDefaultPackage(Package defaultPackage) { + this.defaultCreationPackage = defaultPackage; + } + + /** + * Init the mappings + * format: ("p1.p2.p3", "p1.p2.p3", "pa/pb/pc") + * format: (include javaPackage, exclude javaPackage(or null), umlPackage) + * + * @param mappings + */ + private void initPackageCreationPatterns(List mappings, String[] initialMappings) { + if (initialMappings == null) { + return; + } + + for (int i = 0; i < initialMappings.length; i += 3) { + String qname = initialMappings[i + 2]; + String excludeKey = initialMappings[i + 1]; + String[] excludeKeys = null; + if (excludeKey != null) { + excludeKeys = excludeKey.split(","); + } + mappings.add(new CreationPattern(initialMappings[i], excludeKeys, qname)); + } + } + + /** + * Get the creation Package for the specified qualifiedName. + * The returned package is the Model from where the specified element should be created. + * The package denoted by the qualifiedName are not created. + * + * The modelPath is the model where specified element should be created.
    + * Create any missing intermediate packages or models. + * + * @param qualifiedName + * The fully qualified name of the element to create. + * @return The package where the element should be created, according to its qualified name. The + */ + public Package getCreationPackage(List qualifiedName) { + String qname = toFlatQualifiedName(qualifiedName); + for (CreationPattern p : creationPatterns) { + if (p.isFor(qname)) { + return p.getPackage(qualifiedName); + } + } + + // not found + return defaultCreationPackage; + } + + + /** + * Used by the UI to show the default values. + * Return one line for each packageCreationPatterns + * + * @return the defaultPackageCreationPatterns + */ + public static String[] getDefaultPackageCreationPatterns(String separator) { + + return toLineCreationPattern(defaultPackageCreationPatterns, separator); + } + + + /** + * @return the defaultCreationPath + */ + public static String getDefaultCreationPath() { + return defaultCreationPath; + } + + /** + * Transform a String with dot in a List of String + * + * @param key + * @return + */ + private List dotToListOfString(String key) { + return Arrays.asList(key.split("\\.")); + } + + /** + * Transform the qname into a string representation. + * + * @param qualifiedName + * @return + */ + private String toFlatQualifiedName(List qualifiedName) { + if (qualifiedName.size() == 1) { + return qualifiedName.get(0); + } + // Compute full name + StringBuffer buff = new StringBuffer(); + + buff.append(qualifiedName.get(0)); + for (int i = 1; i < qualifiedName.size(); i++) { + String part = qualifiedName.get(i); + buff.append(".").append(part); + } + return buff.toString(); + } + + /** + * A pattern mapping java packages to path representing the model where the java package should be created + * + * @author dumoulin + * + */ + protected class CreationPattern { + + private CreationModelPathEntry creationModelPathEntry; + + private StringFilter includeFilter; + + private StringFilter[] excludeFilters; + + /** + * + * @param key + * @param excludekey + * comma separated list of keys to exclude. + * @param qualifiedName + */ + public CreationPattern(String key, String[] excludekeys, String qualifiedName) { + this.includeFilter = createFilter(key); + this.excludeFilters = createFilters(excludekeys); + this.creationModelPathEntry = createCreationModelPathEntry(key, qualifiedName); + } + + + /** + * Create a list of filters + * + * @param excludekeys + * @return + */ + private StringFilter[] createFilters(String[] excludekeys) { + if (excludekeys == null) { + return null; + } + + StringFilter[] filters = new StringFilter[excludekeys.length]; + + for (int i = 0; i < excludekeys.length; i++) { + filters[i] = createFilter(excludekeys[i]); + } + return null; + } + + + /** + * Create appropriate filter by looking up the stars positions. + * + * @param name + * @return + */ + private StringFilter createFilter(String name) { + if (name.startsWith("*")) { + return new EndWithFilter(name.substring(1, name.length())); + } else if (name.endsWith("*")) { + return new StartWithFilter(name.substring(0, name.length() - 1)); + } else { + return new IsEqualsFilter(name); + } + + } + + /** + * Create appropriate CreationModelPathEntry by looking up the #WILDCARD positions. + * + * @param name + * @return + */ + private CreationModelPathEntry createCreationModelPathEntry(String key, String qualifiedNameWithDot) { + + List qname = dotToListOfString(qualifiedNameWithDot); + + // Create the appropriate QualifiedNameGenerator + if (qname.contains("*")) { + if (key.contains("*")) { + // Both string contains '*' + return new PatternCreationModelPathEntry(key, qname); + } else { + // key have no pattern, but qualified name has. + // No solution: remove '*' from qualifiedName + qname.remove("*"); + return new SimpleCreationModelPathEntry(qname); + } + } else { + // the qualified name has no pattern + return new SimpleCreationModelPathEntry(qname); + } + + + } + + /** + * Return true if this mapping is for the provided qname. + * + * @param packageQualifiedName + * @return + */ + public boolean isFor(String flatQualifiedName) { + // System.out.println("isFor(" + filter.filter + "==" + flatQualifiedName + ")"); + if (includeFilter.accept(flatQualifiedName)) { + if (!isExcluded(flatQualifiedName)) { + return true; + } + } + + + return false; + } + + /** + * Is the name in the exclude list ? + * + * @param flatQualifiedName + * @return + */ + private boolean isExcluded(String flatQualifiedName) { + if (excludeFilters == null) { + return false; + } + + for (StringFilter exclude : excludeFilters) { + if (exclude.accept(flatQualifiedName)) { + return true; + } + } + + return false; + } + + /** + * Get the uml Package. Create it if needed. + * Create a Model that will contains the created elements + * + * @param proposedPath + * The proposedPath for which the creation Package is requested. + * @return + */ + public Package getPackage(List proposedPath) { + + // umlPackage = UmlUtils.getPackage(modelRootPackage, qualifiedName); + Package cachedPackage = UmlUtils.getModel(modelRootPackage, creationModelPathEntry.getCreationModelPath(proposedPath)); + return cachedPackage; + } + } + + abstract private class StringFilter { + + protected String filter; + + /** + * @param filter + */ + public StringFilter(String filter) { + this.filter = filter; + } + + abstract public boolean accept(String name); + } + + private class StartWithFilter extends StringFilter { + + public StartWithFilter(String filter) { + super(filter); + } + + @Override + public boolean accept(String name) { + return name.startsWith(filter); + } + + } + + private class EndWithFilter extends StringFilter { + + public EndWithFilter(String filter) { + super(filter); + } + + @Override + public boolean accept(String name) { + return name.endsWith(filter); + } + + } + + private class IsEqualsFilter extends StringFilter { + + public IsEqualsFilter(String filter) { + super(filter); + } + + @Override + public boolean accept(String name) { + return name.equals(filter); + } + + } + + /** + * A CreationModelPathEntry is used get the model path for a given elementPath. + * + * @author dumoulin + * + */ + private abstract class CreationModelPathEntry { + + /** + * Return the path for the model in wich the specified element should be created. + * + * @param elementName + * The fully qualified name of the element to create. + * @return + */ + abstract public List getCreationModelPath(List pattern); + } + + /** + * A {@link CreationModelPathEntry} returning the registered path. + * The path should not contain {@value #WILDCARD} + * + * @author dumoulin + * + */ + private class SimpleCreationModelPathEntry extends CreationModelPathEntry { + + /** + * The qualified name of the model where element are created + */ + private List modelPath; + + /** + * + * Constructor. + * + * @param modelPath + * The qualified name of the model where element are created + */ + public SimpleCreationModelPathEntry(List modelPath) { + this.modelPath = modelPath; + } + + /** + * Return the patt for the model in wich the specified element should be created. + * + * @see javagen.umlparser.CreationPackageCatalog.CreationModelPathEntry#getCreationModelPath(java.util.List) + * + * @param elementName + * The fully qualified name of the element to create. + * @return + */ + @Override + public List getCreationModelPath(List elementName) { + // Return the registered path + return modelPath; + } + + } + + /** + * This {@link CreationModelPathEntry} allows to create Models giving a pattern containing a wildcard. + * + * @author dumoulin + * + */ + private class PatternCreationModelPathEntry extends CreationModelPathEntry { + + private List qname; + + private int srcPartIndex; + + private int targetPartIndex; + + public PatternCreationModelPathEntry(String key, List qname) { + + // + List qualifiedKey = dotToListOfString(key); + // Get the index of the '*' + srcPartIndex = qualifiedKey.indexOf("*"); + targetPartIndex = qname.indexOf("*"); + if (targetPartIndex < 0 || srcPartIndex < 0) + { + System.err.println("getCreationModelPath() - index problem for " + key + ", " + qname); + } + this.qname = qname; + } + + /** + * Return the name of the model for the specified qualifiedname. + * + * @see javagen.umlparser.CreationPackageCatalog.CreationModelPathEntry#getCreationModelPath(java.util.List) + * + * @param elementName + * The fully qualified name of the element to create. + * @return + */ + @Override + public List getCreationModelPath(List elementName) { + List result = new ArrayList(qname); + // Replace the '*' in the requested path by the name found at the star index in the provided pattern + if (targetPartIndex < 0 || srcPartIndex < 0) + { + System.err.println("getCreationModelPath() - index problem for " + elementName); + } + result.set(targetPartIndex, elementName.get(srcPartIndex)); + return result; + } + + } + + /** + * Validate the creation paths. The list contains one pattern by element + * + * @param paths + * @throws Exception + * If the path is not valid. The message describes the error. + */ + public static void validateCreationPath(List paths) throws Exception { + + for (int i = 0; i < paths.size(); i += 3) + { + String includePattern = paths.get(i); + String excludePattern = paths.get(i + 1); + String targetPath = paths.get(i + 2); + String errorLine = "[" + includePattern + " ; " + excludePattern + " ; " + targetPath + "]"; + checkNotEmptyPattern(includePattern, errorLine); + checkNotEmptyPattern(targetPath, errorLine); + checkSizeNotZero(excludePattern, errorLine); + } + + } + + private static void checkSizeNotZero(String pattern, String errorLine) throws Exception { + if (!(pattern == null) && pattern.length() == 0) { + throw new Exception("Pattern should not be null or empty" + errorLine); + } + } + + private static void checkNotEmptyPattern(String pattern, String errorLine) throws Exception { + + if (pattern == null || pattern.length() == 0) { + throw new Exception("Pattern should not be null or empty" + errorLine); + } + + } + + /** + * Transform a creation package with one single pattern by element to + * an array of creationPatterns (one creationPattern by line). + * + * @return the defaultPackageCreationPatterns + */ + public static String[] toLineCreationPattern(String[] elements, String separator) { + + int size = elements.length / 3; + String[] result = new String[size]; + + int index = 0; + for (int i = 0; i < elements.length; i += 3) { + String includePattern = elements[i]; + String excludePattern = elements[i + 1]; + String creationPath = elements[i + 2]; + + if (excludePattern == null) { + excludePattern = ""; + } + + result[index] = includePattern + separator + excludePattern + separator + creationPath; + index++; + } + return result; + } + + /** + * Get all the creationPath of the specified creation patterns (one path by element); + * + * @param creationPattern + * A splitted creation pattern array + * @return + */ + public static List extractCreationPaths(String[] creationPattern) { + + int size = creationPattern.length / 3; + List result = new ArrayList(size); + + for (int i = 0; i < creationPattern.length; i += 3) { + String element = creationPattern[i + 2]; + if (!result.contains(element)) { + result.add(element); + } + } + return result; + } + + /** + * Get an array containing the specified colon of the provided array + * + * @return the defaultPackageCreationPatterns + */ + private static String[] extractColumn(String[] inputArray, int columnCount, int extractedColumn) { + + int size = inputArray.length / columnCount; + String[] result = new String[size]; + + int index = 0; + for (int i = 0; i < inputArray.length; i += 3) { + String element = inputArray[i + extractedColumn]; + result[index] = element; + index++; + } + return result; + } + + public static List getDefaultSearchPath() { + // TODO Auto-generated method stub + return extractCreationPaths(defaultPackageCreationPatterns); + } + + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CuPrinter.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CuPrinter.java new file mode 100644 index 00000000000..a0a4271eeac --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/CuPrinter.java @@ -0,0 +1,72 @@ +/** + * + */ +package javagen.umlparser; + +import japa.parser.JavaParser; +import japa.parser.ParseException; +import japa.parser.ast.CompilationUnit; + +import java.io.FileInputStream; + +/** + * @author dumoulin + * + */ +public class CuPrinter { + + public static void main(String args[]) { + CompilationUnit cu; + + try { + + if (args.length == 0) { + System.out.println("Java Parser Version 1.1: Reading from standard input . . ."); + cu = JavaParser.parse(System.in); + } else if (args.length == 1) { + System.out.println("Java Parser Version 1.1: Reading from file " + args[0] + " . . ."); + try { + cu = JavaParser.parse(new java.io.FileInputStream(args[0])); + System.out.println("Java Parser Version 1.1: Java program parsed successfully."); + // prints the resulting compilation unit to default system output + System.out.println(cu.toString()); + + } catch (java.io.FileNotFoundException e) { + System.out.println("Java Parser Version 1.1: File " + args[0] + " not found."); + return; + } + } else { + System.out.println("Java Parser Version 1.1: Usage is one of:"); + System.out.println(" java JavaParser < inputfile"); + System.out.println("OR"); + System.out.println(" java JavaParser inputfile"); + return; + } + + } catch (ParseException e) { + System.out.println(e.getMessage()); + System.out.println("Java Parser Version 1.1: Encountered errors during parse."); + } finally { + // in.close(); + } + + } + + + public static void main2(String[] args) throws Exception { + // creates an input stream for the file to be parsed + FileInputStream in = new FileInputStream("test.java"); + + CompilationUnit cu; + try { + // parse the file + cu = JavaParser.parse(in); + } finally { + in.close(); + } + + // prints the resulting compilation unit to default system output + System.out.println(cu.toString()); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericSwitchVisitor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericSwitchVisitor.java new file mode 100644 index 00000000000..96fc7f91e97 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericSwitchVisitor.java @@ -0,0 +1,665 @@ +/** + * + */ +package javagen.umlparser; + +import japa.parser.ast.BlockComment; +import japa.parser.ast.CompilationUnit; +import japa.parser.ast.ImportDeclaration; +import japa.parser.ast.LineComment; +import japa.parser.ast.Node; +import japa.parser.ast.PackageDeclaration; +import japa.parser.ast.TypeParameter; +import japa.parser.ast.body.AnnotationDeclaration; +import japa.parser.ast.body.AnnotationMemberDeclaration; +import japa.parser.ast.body.ClassOrInterfaceDeclaration; +import japa.parser.ast.body.ConstructorDeclaration; +import japa.parser.ast.body.EmptyMemberDeclaration; +import japa.parser.ast.body.EmptyTypeDeclaration; +import japa.parser.ast.body.EnumConstantDeclaration; +import japa.parser.ast.body.EnumDeclaration; +import japa.parser.ast.body.FieldDeclaration; +import japa.parser.ast.body.InitializerDeclaration; +import japa.parser.ast.body.JavadocComment; +import japa.parser.ast.body.MethodDeclaration; +import japa.parser.ast.body.Parameter; +import japa.parser.ast.body.VariableDeclarator; +import japa.parser.ast.body.VariableDeclaratorId; +import japa.parser.ast.expr.ArrayAccessExpr; +import japa.parser.ast.expr.ArrayCreationExpr; +import japa.parser.ast.expr.ArrayInitializerExpr; +import japa.parser.ast.expr.AssignExpr; +import japa.parser.ast.expr.BinaryExpr; +import japa.parser.ast.expr.BooleanLiteralExpr; +import japa.parser.ast.expr.CastExpr; +import japa.parser.ast.expr.CharLiteralExpr; +import japa.parser.ast.expr.ClassExpr; +import japa.parser.ast.expr.ConditionalExpr; +import japa.parser.ast.expr.DoubleLiteralExpr; +import japa.parser.ast.expr.EnclosedExpr; +import japa.parser.ast.expr.FieldAccessExpr; +import japa.parser.ast.expr.InstanceOfExpr; +import japa.parser.ast.expr.IntegerLiteralExpr; +import japa.parser.ast.expr.IntegerLiteralMinValueExpr; +import japa.parser.ast.expr.LongLiteralExpr; +import japa.parser.ast.expr.LongLiteralMinValueExpr; +import japa.parser.ast.expr.MarkerAnnotationExpr; +import japa.parser.ast.expr.MemberValuePair; +import japa.parser.ast.expr.MethodCallExpr; +import japa.parser.ast.expr.NameExpr; +import japa.parser.ast.expr.NormalAnnotationExpr; +import japa.parser.ast.expr.NullLiteralExpr; +import japa.parser.ast.expr.ObjectCreationExpr; +import japa.parser.ast.expr.QualifiedNameExpr; +import japa.parser.ast.expr.SingleMemberAnnotationExpr; +import japa.parser.ast.expr.StringLiteralExpr; +import japa.parser.ast.expr.SuperExpr; +import japa.parser.ast.expr.ThisExpr; +import japa.parser.ast.expr.UnaryExpr; +import japa.parser.ast.expr.VariableDeclarationExpr; +import japa.parser.ast.stmt.AssertStmt; +import japa.parser.ast.stmt.BlockStmt; +import japa.parser.ast.stmt.BreakStmt; +import japa.parser.ast.stmt.CatchClause; +import japa.parser.ast.stmt.ContinueStmt; +import japa.parser.ast.stmt.DoStmt; +import japa.parser.ast.stmt.EmptyStmt; +import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; +import japa.parser.ast.stmt.ExpressionStmt; +import japa.parser.ast.stmt.ForStmt; +import japa.parser.ast.stmt.ForeachStmt; +import japa.parser.ast.stmt.IfStmt; +import japa.parser.ast.stmt.LabeledStmt; +import japa.parser.ast.stmt.ReturnStmt; +import japa.parser.ast.stmt.SwitchEntryStmt; +import japa.parser.ast.stmt.SwitchStmt; +import japa.parser.ast.stmt.SynchronizedStmt; +import japa.parser.ast.stmt.ThrowStmt; +import japa.parser.ast.stmt.TryStmt; +import japa.parser.ast.stmt.TypeDeclarationStmt; +import japa.parser.ast.stmt.WhileStmt; +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.type.PrimitiveType; +import japa.parser.ast.type.ReferenceType; +import japa.parser.ast.type.VoidType; +import japa.parser.ast.type.WildcardType; +import japa.parser.ast.visitor.GenericVisitor; + +/** + * A base class used to do switching. + * The class must be subclassed, and methods corresponding to needed cases should be subclassed. + * + * @author dumoulin + * + */ +public class GenericSwitchVisitor implements GenericVisitor { + + /** + * Do switching according to the real type of the node. + * + * @param n + * @param arg + * @return + */ + public R doSwitch(Node n, A arg) { + return n.accept(this, arg); + } + + @Override + public R visit(Node n, A arg) { + // TODO Auto-generated method stub + return null; + } + + @Override + public R visit(CompilationUnit n, A arg) { + // TODO Auto-generated method stub + return null; + } + + @Override + public R visit(PackageDeclaration n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ImportDeclaration n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(TypeParameter n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(LineComment n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(BlockComment n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ClassOrInterfaceDeclaration n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(EnumDeclaration n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(EmptyTypeDeclaration n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(EnumConstantDeclaration n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(AnnotationDeclaration n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(AnnotationMemberDeclaration n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(FieldDeclaration n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(VariableDeclarator n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(VariableDeclaratorId n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ConstructorDeclaration n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(MethodDeclaration n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(Parameter n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(EmptyMemberDeclaration n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(InitializerDeclaration n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(JavadocComment n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ClassOrInterfaceType n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(PrimitiveType n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ReferenceType n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(VoidType n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(WildcardType n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ArrayAccessExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ArrayCreationExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ArrayInitializerExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(AssignExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(BinaryExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(CastExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ClassExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ConditionalExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(EnclosedExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(FieldAccessExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(InstanceOfExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(StringLiteralExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(IntegerLiteralExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(LongLiteralExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(IntegerLiteralMinValueExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(LongLiteralMinValueExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(CharLiteralExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(DoubleLiteralExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(BooleanLiteralExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(NullLiteralExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(MethodCallExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(NameExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ObjectCreationExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(QualifiedNameExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ThisExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(SuperExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(UnaryExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(VariableDeclarationExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(MarkerAnnotationExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(SingleMemberAnnotationExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(NormalAnnotationExpr n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(MemberValuePair n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ExplicitConstructorInvocationStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(TypeDeclarationStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(AssertStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(BlockStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(LabeledStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(EmptyStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ExpressionStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(SwitchStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(SwitchEntryStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(BreakStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ReturnStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(IfStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(WhileStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ContinueStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(DoStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ForeachStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ForStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(ThrowStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(SynchronizedStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(TryStmt n, A arg) { + // TODO Auto-generated method stub + return null; + } + + + @Override + public R visit(CatchClause n, A arg) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericTransformer.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericTransformer.java new file mode 100644 index 00000000000..49ac5b4e7ca --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/GenericTransformer.java @@ -0,0 +1,269 @@ +/*************************************************** + * Copyright (c) 2010 Atos Origin. + + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Atos Origin - Initial API and implementation + * + ****************************************************/ +package javagen.umlparser; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.ECrossReferenceAdapter; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.EcoreUtil.UsageCrossReferencer; +import org.eclipse.emf.ecore.util.FeatureMapUtil; + +/** + * The Class GenericTransformer. Permits to transform an eobject of eclass to + * another eclass + */ +public class GenericTransformer { + + /** element to transform */ + private EObject element; + + /** + * Instantiates a new generic transformer. + * + * @param currentEobject + * the current eobject + */ + public GenericTransformer(EObject currentEobject) { + this.element = currentEobject; + } + + /** + * Transform the element to the given eclass. + * + * @param requestedType + * the targeted eclass + */ + public EObject transform(EClass requestedType) { + + // Create the result + EObject result = requestedType.getEPackage().getEFactoryInstance() + .create(requestedType); + + try { + // Copy features + copyAllFeatures(element, result); + // Change parent + // EcoreUtil.replace(element, result); + changeReferences(element, result); + + // Change references on the old objet to references on the new + // object. + + // drop caches about input element + ECrossReferenceAdapter cross = ECrossReferenceAdapter + .getCrossReferenceAdapter(element); + if (cross != null) { + cross.unsetTarget(element); + } + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return result; + } + + /** + * Copy the feature of the source into the target + * + * @param element2 + * @param result + */ + private void copyAllFeatures(EObject source, EObject target) { + EClass eclass = source.eClass(); + if (eclass != null) { + EList eAllStructuralFeatures = eclass + .getEAllStructuralFeatures(); + for (EStructuralFeature structuralFeature : eAllStructuralFeatures) { + if (contains(target.eClass(), structuralFeature)) { + copyFeature(source, target, structuralFeature); + } + } + } + + } + + /** + * check if the target eclass contains a estructuralfeature with the same + * name less rigorous can work for many cases + * + * @param target + * the target + * @param e + * the e + * + * @return true, if successful + */ + private boolean contains(EClass target, EStructuralFeature e) { + EList features = target.getEAllStructuralFeatures(); + for (EStructuralFeature f : features) { + if (f.getName().equals(e.getName())) { + return true; + } + } + return false; + } + + /** + * Copy specified feature from source to target. + * + * @param mixedDomain + * the mixed domain + * @param source + * the source + * @param target + * the target + * @param feature + * the e + */ + @SuppressWarnings("unchecked") + private void copyFeature(EObject source, EObject target, + EStructuralFeature feature) { + Collection alreadyManaged = new ArrayList(); + + // Get the target feature + EStructuralFeature targetFeature = getFeature(target, feature.getName()); + + if (feature.getUpperBound() <= targetFeature.getUpperBound() + && feature.getLowerBound() >= targetFeature.getLowerBound()) { + if (feature.isChangeable() && !feature.isDerived()) { + Object value = source.eGet(feature); + + if (feature.isMany() && targetFeature.isMany()) { + // Collection to collection + Collection values = (Collection) value; + if (values != null && !values.isEmpty()) { + Collection newList = new ArrayList(); + newList.addAll(values); + if (feature instanceof EReference + && !((EReference) feature).isContainment()) { + // references + setFeatureValue(target, targetFeature, newList); + // add(new SetValueCommand(new + // SetRequest(editingDomain, target, targetFeature, + // newList))); + } else if (feature instanceof EReference + && ((EReference) feature).isContainment()) { + // Containement feature + Collection toTreat = new ArrayList(); + for (Object o : newList) { + if (!alreadyManaged.contains(o)) { + toTreat.add(o); + alreadyManaged.add(o); + } + } + + setFeatureValue(target, targetFeature, newList); + } + } + } else if (!feature.isMany() && !targetFeature.isMany()) { + // Copy one to one + if (value != null) { + if (!alreadyManaged.contains(value)) { + alreadyManaged.add(value); + setFeatureValue(target, targetFeature, value); + } + } + } + } + } + + } + + /** + * + * Set the value of the specified feature + * + * @param elementToEdit + * @param feature + * @param value + */ + protected void setFeatureValue(EObject elementToEdit, + EStructuralFeature feature, Object value) { + + boolean many = FeatureMapUtil.isMany(elementToEdit, feature); + if (many) { + Collection collection = ((Collection) elementToEdit.eGet(feature)); + if (value instanceof List) { + List values = (List) value; + collection.clear(); + collection.addAll(values); + } else { + collection.add(value); + } + } else { + elementToEdit.eSet(feature, value); + } + } + + /** + * Gets a feature from a name + * + * @param eobject + * the eobject + * @param name + * the name + * + * @return the feature + */ + private EStructuralFeature getFeature(EObject eobject, String name) { + return eobject.eClass().getEStructuralFeature(name); + } + + /** + * Replace all references on source by references on target Deletes the + * object from its {@link EObject#eResource containing} resource and/or its {@link EObject#eContainer containing} object as well as from any other + * feature that references it within the enclosing resource set, resource, + * or root object. + * + * @param eObject + * the object to delete. + * @copyright org.eclipse.emf.ecore.util.EcoreUtil + */ + private void changeReferences(EObject source, EObject target) { + EObject rootEObject = EcoreUtil.getRootContainer(source); + Resource resource = rootEObject.eResource(); + + Collection usages; + if (resource == null) { + usages = UsageCrossReferencer.find(source, rootEObject); + } else { + ResourceSet resourceSet = resource.getResourceSet(); + if (resourceSet == null) { + usages = UsageCrossReferencer.find(source, resource); + } else { + usages = UsageCrossReferencer.find(source, resourceSet); + } + } + + for (EStructuralFeature.Setting setting : usages) { + if (setting.getEStructuralFeature().isChangeable()) { + EcoreUtil.replace(setting, source, target); + } + } + + EcoreUtil.replace(source, target); + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ImportedTypeCatalog.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ImportedTypeCatalog.java new file mode 100644 index 00000000000..de8ededd8e5 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ImportedTypeCatalog.java @@ -0,0 +1,167 @@ +/** + * + */ +package javagen.umlparser; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Catalog managing the imports names. + * This catalog allows to lookup the qualified name of a type. + * + * @author dumoulin + * + */ +public class ImportedTypeCatalog { + + private Map> map = new HashMap>(); + + /** + * Default mapping to be set + */ + public String[] defaultMappingNames = { + "String", "java.lang.String", + "Class", "java.lang.Class", + "Object", "java.lang.Object", + "Exception", "java.lang.Exception", + "Integer", "datatype.Integer", + "Boolean", "datatype.Boolean", + "Long", "datatype.Long", + "Char", "datatype.Char", + "Byte", "datatype.Byte", + "Runnable", "java.lang.Runnable", + "Throwable", "java.lang.Throwable", + "Thread", "java.lang.Thread", + }; + + + /** + * Constructor. + */ + public ImportedTypeCatalog() { + // Set default mapping + setDefaultMapping(defaultMappingNames); + } + + /** + * Set the default mappings + * + * @param defaultMappingNames + */ + private void setDefaultMapping(String[] defaultMappingNames) { + for (int i = 0; i < defaultMappingNames.length; i += 2) { + map.put(defaultMappingNames[i], UmlUtils.toQualifiedName(defaultMappingNames[i + 1])); + System.out.println("setDefaultMapping().add(" + defaultMappingNames[i] + ", " + UmlUtils.toQualifiedName(defaultMappingNames[i + 1]) + ")"); + } + } + + /** + * Get the associated qualified name from the imports. + * Return the translation or the name itself, as a qualifiedName. + * + * @param name + * @return + */ + public List getQualifiedName(String name) { + + List res = map.get(name); + if (res == null) { + res = UmlUtils.toQualifiedName(name); + } + return res; + } + + /** + * Lookup the associated qualified name from the imports. + * + * @param name + * @return + */ + private List lookupQualifiedName(String name) { + + List res = map.get(name); + return res; + } + + /** + * Get the qualified name of the provided [qualifiedName]. + * If the provided name size is one, lookup for its full name. + * Otherwise, return the imput. + * + * @param typeQualifiedName + * @return + */ + public List getQualifiedName(List possiblyQualifiedName) { + if (possiblyQualifiedName.size() == 1) { + List res = lookupQualifiedName(possiblyQualifiedName.get(0)); + if (res == null) { + res = possiblyQualifiedName; + } + return res; + } else { + return possiblyQualifiedName; + } + } + + /** + * Return true if the specified qualifiedName denote an imported name. + * Return false otherwise. + * + * @param qualifiedName + * @return + */ + public boolean isImportedType(List qualifiedName) { + + String lastName = qualifiedName.get(qualifiedName.size() - 1); + + // Check if the last name is in the catalog, and compare package names + List found = map.get(lastName); + if (found != null && found.equals(qualifiedName)) { + return true; + } + + return false; + } + + + /** + * Add an import + * + * @param qualifiedName + */ + public void addImport(List qualifiedName) { + + String lastName = qualifiedName.get(qualifiedName.size() - 1); + System.out.println("ImportedCatalog.add(" + qualifiedName + ")"); + if ("*".equals(lastName)) { + addPackageClasses(qualifiedName); + } else { + map.put(lastName, qualifiedName); + } + } + + /** + * Add all the class from the package. + * Last name is '*' + * + * @param qualifiedName + */ + private void addPackageClasses(List qualifiedName) { + // TODO Auto-generated method stub + // throw new UnsupportedOperationException("not yet implmeented"); + System.err.println(this.getClass().getName() + + ".addPackageClasses() - Not yet implemented - can't process import with 'p1.p2.*;'"); + } + + /** + * Clear all mappings + */ + public void clear() { + map.clear(); + setDefaultMapping(defaultMappingNames); + + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ModelManager.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ModelManager.java new file mode 100644 index 00000000000..56cae4aa276 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/ModelManager.java @@ -0,0 +1,103 @@ +/** + * + */ +package javagen.umlparser; + +import java.io.File; +import java.io.IOException; +import java.util.Collections; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.uml2.uml.UMLFactory; +import org.eclipse.uml2.uml.resource.UMLResource; + +/** + * This class is responsible of the life cycle of the model. + * + * @author dumoulin + * + */ +public class ModelManager { + + private Resource model; + + private ResourceSet resourceSet; + + /** + * @return the resourceSet + */ + public ResourceSet getResourceSet() { + return resourceSet; + } + + /** + * @return the model + */ + public Resource getModel() { + return model; + } + + /** + * + * @param filename + */ + protected void createModel(String filename) { + // Create a resource set. + resourceSet = new ResourceSetImpl(); + + + // Register the default resource factory -- only needed for stand-alone! + // resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE); + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.Factory.Registry.DEFAULT_EXTENSION, UMLResource.Factory.INSTANCE); + + // Get the URI of the model file. + URI fileURI = URI.createFileURI(new File(filename).getAbsolutePath()); + + System.out.println("URI= " + fileURI); + // Create a resource for this file. + model = resourceSet.createResource(fileURI); + + } + + /** + * + * @param filename + */ + protected void loadModel(String filename) { + UMLFactory.eINSTANCE.createActor(); + // Create a resource set. + resourceSet = new ResourceSetImpl(); + + + // Register the default resource factory -- only needed for stand-alone! + // resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE); + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.Factory.Registry.DEFAULT_EXTENSION, UMLResource.Factory.INSTANCE); + + // Get the URI of the model file. + URI fileURI = URI.createFileURI(new File(filename).getAbsolutePath()); + + System.out.println("URI= " + fileURI); + // Create a resource for this file. + model = resourceSet.getResource(fileURI, true); + + } + + public void save() { + try { + System.out.println("Save model."); + + model.save(Collections.EMPTY_MAP); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/QualifiedName.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/QualifiedName.java new file mode 100644 index 00000000000..7b549cc8868 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/QualifiedName.java @@ -0,0 +1,48 @@ +/** + * + */ +package javagen.umlparser; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * Instance of this class denote a qualified name of a type. + * + * @author dumoulin + * + */ +@SuppressWarnings("serial") +public class QualifiedName extends ArrayList { + + /** + * + */ + public QualifiedName() { + } + + /** + * @param initialCapacity + */ + public QualifiedName(int initialCapacity) { + super(initialCapacity); + } + + /** + * @param c + */ + public QualifiedName(Collection c) { + super(c); + } + + /** + * Return the last name of the qualified name. + * This is usually the short name. + * + * @return + */ + public String getName() { + + return get(size() - 1); + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/SwitchVisitor.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/SwitchVisitor.java new file mode 100644 index 00000000000..5c06cc5c95a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/SwitchVisitor.java @@ -0,0 +1,661 @@ +/** + * + */ +package javagen.umlparser; + +import japa.parser.ast.BlockComment; +import japa.parser.ast.CompilationUnit; +import japa.parser.ast.ImportDeclaration; +import japa.parser.ast.LineComment; +import japa.parser.ast.Node; +import japa.parser.ast.PackageDeclaration; +import japa.parser.ast.TypeParameter; +import japa.parser.ast.body.AnnotationDeclaration; +import japa.parser.ast.body.AnnotationMemberDeclaration; +import japa.parser.ast.body.ClassOrInterfaceDeclaration; +import japa.parser.ast.body.ConstructorDeclaration; +import japa.parser.ast.body.EmptyMemberDeclaration; +import japa.parser.ast.body.EmptyTypeDeclaration; +import japa.parser.ast.body.EnumConstantDeclaration; +import japa.parser.ast.body.EnumDeclaration; +import japa.parser.ast.body.FieldDeclaration; +import japa.parser.ast.body.InitializerDeclaration; +import japa.parser.ast.body.JavadocComment; +import japa.parser.ast.body.MethodDeclaration; +import japa.parser.ast.body.Parameter; +import japa.parser.ast.body.VariableDeclarator; +import japa.parser.ast.body.VariableDeclaratorId; +import japa.parser.ast.expr.ArrayAccessExpr; +import japa.parser.ast.expr.ArrayCreationExpr; +import japa.parser.ast.expr.ArrayInitializerExpr; +import japa.parser.ast.expr.AssignExpr; +import japa.parser.ast.expr.BinaryExpr; +import japa.parser.ast.expr.BooleanLiteralExpr; +import japa.parser.ast.expr.CastExpr; +import japa.parser.ast.expr.CharLiteralExpr; +import japa.parser.ast.expr.ClassExpr; +import japa.parser.ast.expr.ConditionalExpr; +import japa.parser.ast.expr.DoubleLiteralExpr; +import japa.parser.ast.expr.EnclosedExpr; +import japa.parser.ast.expr.FieldAccessExpr; +import japa.parser.ast.expr.InstanceOfExpr; +import japa.parser.ast.expr.IntegerLiteralExpr; +import japa.parser.ast.expr.IntegerLiteralMinValueExpr; +import japa.parser.ast.expr.LongLiteralExpr; +import japa.parser.ast.expr.LongLiteralMinValueExpr; +import japa.parser.ast.expr.MarkerAnnotationExpr; +import japa.parser.ast.expr.MemberValuePair; +import japa.parser.ast.expr.MethodCallExpr; +import japa.parser.ast.expr.NameExpr; +import japa.parser.ast.expr.NormalAnnotationExpr; +import japa.parser.ast.expr.NullLiteralExpr; +import japa.parser.ast.expr.ObjectCreationExpr; +import japa.parser.ast.expr.QualifiedNameExpr; +import japa.parser.ast.expr.SingleMemberAnnotationExpr; +import japa.parser.ast.expr.StringLiteralExpr; +import japa.parser.ast.expr.SuperExpr; +import japa.parser.ast.expr.ThisExpr; +import japa.parser.ast.expr.UnaryExpr; +import japa.parser.ast.expr.VariableDeclarationExpr; +import japa.parser.ast.stmt.AssertStmt; +import japa.parser.ast.stmt.BlockStmt; +import japa.parser.ast.stmt.BreakStmt; +import japa.parser.ast.stmt.CatchClause; +import japa.parser.ast.stmt.ContinueStmt; +import japa.parser.ast.stmt.DoStmt; +import japa.parser.ast.stmt.EmptyStmt; +import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt; +import japa.parser.ast.stmt.ExpressionStmt; +import japa.parser.ast.stmt.ForStmt; +import japa.parser.ast.stmt.ForeachStmt; +import japa.parser.ast.stmt.IfStmt; +import japa.parser.ast.stmt.LabeledStmt; +import japa.parser.ast.stmt.ReturnStmt; +import japa.parser.ast.stmt.SwitchEntryStmt; +import japa.parser.ast.stmt.SwitchStmt; +import japa.parser.ast.stmt.SynchronizedStmt; +import japa.parser.ast.stmt.ThrowStmt; +import japa.parser.ast.stmt.TryStmt; +import japa.parser.ast.stmt.TypeDeclarationStmt; +import japa.parser.ast.stmt.WhileStmt; +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.type.PrimitiveType; +import japa.parser.ast.type.ReferenceType; +import japa.parser.ast.type.VoidType; +import japa.parser.ast.type.WildcardType; +import japa.parser.ast.visitor.VoidVisitor; + +/** + * A base class used to do switching. + * The class must be subclassed, and methods corresponding to needed cases should be subclassed. + * + * @author dumoulin + * + */ +public class SwitchVisitor implements VoidVisitor { + + public void doSwitch(Node n, A arg) { + n.accept(this, arg); + } + + + @Override + public void visit(Node n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(CompilationUnit n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(PackageDeclaration n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ImportDeclaration n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(TypeParameter n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(LineComment n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(BlockComment n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ClassOrInterfaceDeclaration n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(EnumDeclaration n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(EmptyTypeDeclaration n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(EnumConstantDeclaration n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(AnnotationDeclaration n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(AnnotationMemberDeclaration n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(FieldDeclaration n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(VariableDeclarator n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(VariableDeclaratorId n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ConstructorDeclaration n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(MethodDeclaration n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(Parameter n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(EmptyMemberDeclaration n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(InitializerDeclaration n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(JavadocComment n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ClassOrInterfaceType n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(PrimitiveType n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ReferenceType n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(VoidType n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(WildcardType n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ArrayAccessExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ArrayCreationExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ArrayInitializerExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(AssignExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(BinaryExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(CastExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ClassExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ConditionalExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(EnclosedExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(FieldAccessExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(InstanceOfExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(StringLiteralExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(IntegerLiteralExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(LongLiteralExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(IntegerLiteralMinValueExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(LongLiteralMinValueExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(CharLiteralExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(DoubleLiteralExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(BooleanLiteralExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(NullLiteralExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(MethodCallExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(NameExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ObjectCreationExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(QualifiedNameExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ThisExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(SuperExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(UnaryExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(VariableDeclarationExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(MarkerAnnotationExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(SingleMemberAnnotationExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(NormalAnnotationExpr n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(MemberValuePair n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ExplicitConstructorInvocationStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(TypeDeclarationStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(AssertStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(BlockStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(LabeledStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(EmptyStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ExpressionStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(SwitchStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(SwitchEntryStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(BreakStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ReturnStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(IfStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(WhileStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ContinueStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(DoStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ForeachStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ForStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(ThrowStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(SynchronizedStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(TryStmt n, A arg) { + // TODO Auto-generated method stub + + } + + + @Override + public void visit(CatchClause n, A arg) { + // TODO Auto-generated method stub + + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyser.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyser.java new file mode 100644 index 00000000000..c49c9828c10 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyser.java @@ -0,0 +1,219 @@ +/** + * + */ +package javagen.umlparser; + +import japa.parser.ast.type.ClassOrInterfaceType; +import japa.parser.ast.type.PrimitiveType; +import japa.parser.ast.type.ReferenceType; +import japa.parser.ast.type.VoidType; +import japa.parser.ast.type.WildcardType; + +import java.util.ArrayList; +import java.util.List; + + +/** + * Data structure to return data about a Declared type. + * + * @author dumoulin + * + */ +public class TypeAnalyser { + + /** + * Data structure returned after type analyse + * + * @author dumoulin + * + */ + public class TypeData { + + List qualifiedName; + + /** template parameters */ + protected List genericData; + + boolean isInterface = false; + + /** PrimitiveType */ + boolean isPrimitive = false; + + /** ReferenceType */ + protected int arrayCount; + + /** For Wildcard */ + protected boolean isWildcard = false; + + protected TypeData extends_; + + protected TypeData super_; + + /** VoidType */ + protected boolean isVoid = false; + + } + + /** Catalog of imported types. Used to translate short name to QualifiedNames */ + private ImportedTypeCatalog importedTypes; + + /** + * Constructor. + * + * @param importedType + */ + public TypeAnalyser(ImportedTypeCatalog importedType) { + this.importedTypes = importedType; + } + + /** + * Get the Type from an ast.Type node. + * + * @param astType + * @return + */ + public TypeData getTypeData(japa.parser.ast.type.Type astType) { + + TypeData res = createTypeData(); + + new SwitchVisitor() { + + /** + * Get type from a class. + */ + @Override + public void visit(ClassOrInterfaceType n, TypeData data) { + List qnameBefore = getQualifiedName(n); + List qname = importedTypes.getQualifiedName(qnameBefore); + + data.qualifiedName = qname; + // Check for generic parameters + if (n.getTypeArgs() != null) { + data.genericData = new ArrayList(); + for (japa.parser.ast.type.Type arg : n.getTypeArgs()) { + TypeData argData = createTypeData(); + arg.accept(this, argData); + data.genericData.add(argData); + } + } + } + + @Override + public void visit(ReferenceType n, TypeData data) { + // skip the reference node and process the child. + // Should not appear in an type use (in Attribute or method) + data.arrayCount = n.getArrayCount(); + n.getType().accept(this, data); + } + + @Override + public void visit(PrimitiveType n, TypeData data) { + String qnameBefore = getPrimitiveName(n); + List qname = importedTypes.getQualifiedName(qnameBefore); + + data.qualifiedName = qname; + data.isPrimitive = true; + } + + @Override + public void visit(WildcardType n, TypeData data) { + data.isWildcard = true; + if (n.getExtends() != null) { + data.extends_ = createTypeData(); + n.getExtends().accept(this, data.extends_); + } + if (n.getSuper() != null) { + data.super_ = createTypeData(); + n.getSuper().accept(this, data.super_); + } + + } + + @Override + public void visit(VoidType n, TypeData data) { + // TODO Auto-generated method stub + data.isVoid = true; + } + + }.doSwitch(astType, res); + + return res; + } + + /** + * Create a new instance. + * Can be subclassed to use another type. + * + * @return + */ + protected TypeData createTypeData() { + return new TypeData(); + } + + /** + * Get the qualified name from the provided type. + * + * @param n + * @return + */ + private List getQualifiedName(ClassOrInterfaceType n) { + List qname = new ArrayList(); + + getQualifiedName(n, qname); + return qname; + } + + /** + * Walk each part of the name and put it in the resulting List. + * + * @param n + * @param qname + */ + private void getQualifiedName(ClassOrInterfaceType n, List qname) { + if (n.getScope() != null) { + getQualifiedName(n.getScope(), qname); + } + qname.add(n.getName()); + } + + /** + * Create the uml2.primitivetype denoted by the specified PrimitiveType + * + * @param n + * @return + */ + private String getPrimitiveName(PrimitiveType n) { + String typeName = null; + + switch (n.getType()) { + case Boolean: + typeName = "Boolean"; + break; + case Byte: + typeName = "Byte"; + break; + case Char: + typeName = "Char"; + break; + case Double: + typeName = "Double"; + break; + case Float: + typeName = "Float"; + break; + case Int: + typeName = "Integer"; + break; + case Long: + typeName = "Long"; + break; + case Short: + typeName = "Short"; + break; + } + + return typeName; + } + + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyserAndTranslator.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyserAndTranslator.java new file mode 100644 index 00000000000..d551fde8532 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/TypeAnalyserAndTranslator.java @@ -0,0 +1,151 @@ +/** + * + */ +package javagen.umlparser; + +import japa.parser.ast.type.Type; + +import java.util.ArrayList; +import java.util.List; + +/** + * Allows to analyse an ast type, and to translate it according to recognized + * patterns. + * For example, this allow to translate from List to Xxx[0..1]. + * TODO : improve to take into account Map, Set, ... + * Use an enum rather than a boolean. Allow to create association class specifying the real type used. + * + * @author dumoulin + * + */ +public class TypeAnalyserAndTranslator extends TypeAnalyser { + + private List> translationList = new ArrayList>(); + + private static String[] defaultTranslatedType = { + "java.util.List", + "java.util.ArrayList", + "java.util.Collection", + "java.util.OrderedSet", + }; + + + /** + * Constructor. + * + * @param importedType + */ + public TypeAnalyserAndTranslator(ImportedTypeCatalog importedType) { + super(importedType); + initDefaultTranslatedTypes(defaultTranslatedType); + } + + /** + * Get the translated type data from the astType. + * + * @param astType + * @return + */ + public TranslatedTypeData getTranslatedTypeData(Type astType) { + TranslatedTypeData typeData = (TranslatedTypeData) getTypeData(astType); + // Does the type correspond to a list ? + translate(typeData); + return typeData; + } + + /** + * Return the TRanslatedTypeData + */ + @Override + protected TypeData createTypeData() { + return new TranslatedTypeData(); + } + + /** + * Translate the type if it is a collection type. + * + * @param data + */ + private void translate(TranslatedTypeData data) { + List qname = data.qualifiedName; + if (translationList.contains(qname)) { + // Check for one and only one template parameter + if (data.genericData != null && data.genericData.size() == 1) { + System.out.println("translate '" + qname + "'"); + // Set translatable if it is a valide inner type (i.e. not a wildcard) + if (!data.genericData.get(0).isWildcard) { + data.isTranslatable = true; + } + data.isCollection = true; + } else if (data.genericData == null) { // Collection type, with nospecified type :-( + data.isCollection = true; + } + } else if (data.arrayCount > 0) { + data.isCollection = true; + } + + // not translatable + } + + + /** + * Data structure returned + * + * @author dumoulin + * + */ + public class TranslatedTypeData extends TypeData { + + /** is the type translatable (can we use the generic's one) ? */ + public boolean isTranslatable = false; + + /** is the type denoting a collection ? */ + public boolean isCollection = false; + + /** + * Get the Real name, taking into account if it is a generic. + * + * @return + */ + public List getTranslatedQualifiedName() { + if (isTranslatable) { + return genericData.get(0).qualifiedName; + } else { + return qualifiedName; + } + } + + public int getTranslatedUpper() { + if (isCollection) { + return -1; + } else { + return 1; + } + } + + public int getTranslatedLower() { + if (isCollection) { + return 0; + } else { + return 0; + } + } + + public boolean isCollection() { + return isCollection; + } + } + + /** + * Set the default mappings + * + * @param defaultMappingNames + */ + private void initDefaultTranslatedTypes(String[] defaultTranslatedTypes) { + for (int i = 0; i < defaultTranslatedTypes.length; i++) { + translationList.add(UmlUtils.toQualifiedName(defaultTranslatedTypes[i])); + } + } + + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlParser.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlParser.java new file mode 100644 index 00000000000..51bf3d209a5 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlParser.java @@ -0,0 +1,163 @@ +/** + * + */ +package javagen.umlparser; + +import japa.parser.JavaParser; +import japa.parser.ParseException; +import japa.parser.ast.CompilationUnit; + +import java.io.File; +import java.io.IOException; +import java.util.Arrays; + +/** + * @author dumoulin + * + */ +public class UmlParser { + + /** + * The visitor used to collect model. + */ + protected CompilationUnitAnalyser visitor; + + public UmlParser() { + } + + /** + * Select the appropriate parsing method according to the file type. + * + * @param file + * @throws ParseException + * @throws IOException + */ + public void parseResource(File file) throws ParseException, IOException { + if (file.isDirectory()) { + System.out.println(" '" + file.getAbsolutePath() + " is a directory"); + parsePackage(file); + } else if (file.isFile()) { + System.out.println(" '" + file.getAbsolutePath() + " is a file"); + // Parse only file ending in .java + if (file.getName().endsWith(".java")) { + parseFile(file); + } else { + System.out.println("skip non java file '" + file.getAbsolutePath() + "'"); + } + } else { + System.out.println(" '" + file.getAbsolutePath() + " can't be identified - " + file); + } + } + + /** + * Explore the package to call parse on classes + * + * @param file + * @throws ParseException + * @throws IOException + */ + public void parsePackage(File file) throws ParseException, IOException { + for (File f : file.listFiles()) { + parseResource(f); + } + } + + /** + * Parse the specified file + * + * @param filename + * @throws IOException + * @throws ParseException + */ + protected void parseFile(File file) throws ParseException, IOException { + CompilationUnit cu = JavaParser.parse(file); + // prints the resulting compilation unit to default system output + // System.out.println(cu.toString()); + + // visitor.visit(cu, null); + + visitor.processCompilationUnit(cu); + } + + /** + * Select the appropriate parse method according to the type of the + * resource denoted by the name. + * + * @param resourceName + * @throws IOException + * @throws ParseException + */ + public void parseResource(String resourceName) throws ParseException, IOException { + File file = new File(resourceName); + parseResource(file); + } + + public void execute(String resourcePath, String outputModelName) throws ParseException, IOException { + System.out.println("resource=" + resourcePath); + // Load model + ModelManager modelManager = new ModelManager(); + modelManager.createModel(outputModelName); + // modelManager.getModel().load(null); + // Create visitor + visitor = new CompilationUnitAnalyser(modelManager.getModel()); + // parse all file using the visitor + parseResource(resourcePath); + + // Save the model + modelManager.save(); + + } + + public void executeTest(String resourcePath, String outputModelName) throws ParseException, IOException { + System.out.println("resource=" + resourcePath); + // Load model + ModelManager modelManager = new ModelManager(); + modelManager.createModel(outputModelName); + // modelManager.getModel().load(null); + // Create visitor + String javaccDir = "H:/temp/papyrus/papyrus-gmf-head2/org.eclipse.papyrus.java.reverse/src/japa/parser"; + String javagenDir = "H:/temp/papyrus/papyrus-gmf-head2/org.eclipse.papyrus.java.reverse/src/javagen/umlparser"; + ; + + String[] paths = { + "javagen", + "javacc", + }; + visitor = new CompilationUnitAnalyser(modelManager.getModel(), "javacc", null); + // parse all file using the visitor + parseResource(javaccDir); + + // Second parsing with same model + visitor = new CompilationUnitAnalyser(modelManager.getModel(), "javagen", Arrays.asList(paths)); + // parse all file using the visitor + parseResource(javagenDir); + + // Save the model + modelManager.save(); + + } + + public static void main(String args[]) { + + if (args.length == 1) { + try { + UmlParser p = new UmlParser(); + p.execute(args[0], "myfile.uml"); + // p.executeTest(args[0], "myfile.uml"); + } catch (IOException e) { + e.printStackTrace(); + } catch (ParseException e) { + System.out.println("Problems encountered during parsing."); + e.printStackTrace(); + } + + } else { + System.out.println("Please select a file or directory to parse"); + return; + } + + + } + + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlUtils.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlUtils.java new file mode 100644 index 00000000000..327cbb3c828 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/javagen/umlparser/UmlUtils.java @@ -0,0 +1,1054 @@ +/** + * + */ +package javagen.umlparser; + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.uml2.uml.BehavioredClassifier; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.DataType; +import org.eclipse.uml2.uml.Dependency; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.InterfaceRealization; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Namespace; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.PrimitiveType; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Realization; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.UMLFactory; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * Utility methods. + *
      + *
    • getXxx() methods lookup for the element and create it if not found.
    • + *
    • lookup() methods lookup for the element.
    • + *
    • xxx( Resource, ...) methods lookup from the model container.
    • + *
    • xxx( Package, ...) methods lookup from the specified package?
    • + *
    + * + * The following methods can be used: + *
      + *
    • package.getPackagedElement( name, b, type, createOnDemand) : PackageableElement
    • + *
    • package.getNestPacke()
    • + *
    • package.getOwnedType(name, b, type, createOnDemand) : Type
    • + *
    + * + * @author dumoulin + * + */ +public class UmlUtils { + + private static final String WILDCARD = "*"; + + /** + * Get the qualified name from a name. + * Name is splitted arround '.' + * + * @param name + * @return + */ + public static List toQualifiedName(String qname) { + String[] splittedName = qname.split("\\."); + return Arrays.asList(splittedName); + } + + /** + * Get the qualified name from a name. + * Name is splitted arround '/' + * + * @param name + * @return + */ + public static List slashNameToQualifiedName(String qname) { + String[] splittedName = qname.split("/"); + return Arrays.asList(splittedName); + } + + /** + * Lookup for the specified package in the parent package. Create it if not found. + * + * @param parent + * the containing package + * @param name + * Package to get + * @return The requested package (never null) + */ + public static Package getPackage(Package parent, String name) { + // Get or create an instance of the specified package. + Package p = (Package) parent.getPackagedElement(name, false, UMLPackage.eINSTANCE.getPackage(), true); + return p; + } + + /** + * Lookup for the specified package in the parent package. Create it if not found. + * + * @param parent + * the containing package + * @param name + * Package to get + * @return The requested package (never null) + */ + public static Package getModel(Package parent, String name) { + + Package p = lookupPackage(parent, name); + if (p == null) + { + // Create as model + p = (Package) parent.getPackagedElement(name, false, UMLPackage.eINSTANCE.getModel(), true); + } + return p; + } + + /** + * Lookup for the specified package in the parent package. Do not create it. + * + * @param parent + * the containing package + * @param name + * Package to get + * @return The requested package (never null) + */ + private static Package lookupPackage(Package parent, String name) { + // Get or create an instance of the specified package. + Package p = (Package) parent.getPackagedElement(name, false, UMLPackage.eINSTANCE.getPackage(), false); + return p; + } + + /** + * Lookup for the specified Namespace in the parent Namespace. Do not create it. + * + * @param parent + * the containing package + * @param name + * Package to get + * @return The requested package (never null) + */ + private static Namespace lookupNamespace(Namespace parent, String name) { + // Get or create an instance of the specified package. + NamedElement foundElement = parent.getOwnedMember(name); + if (foundElement instanceof Namespace) { + return (Namespace) foundElement; + } + // Not found + return null; + } + + + /** + * Get the package containing the last package of the qualifiedName. + * Create any missing package if needed + * Do not lookup for the last element. + * If there is no scope package in the qualifiedName, return the root. + * + * @param root + * @param qualifiedName + * @return The containing package (never null) + */ + public static Package getContainingPackage(Package root, List qualifiedName) { + Package cur = root; + for (int i = 0; i < qualifiedName.size() - 1; i++) { + String name = qualifiedName.get(i); + cur = getPackage(cur, name); + // if(cur==null) + // return null; + } + return cur; + } + + /** + * Get the package containing the last package of the qualifiedName. + * Create any missing package if needed + * Do not lookup for the last element. + * If there is no scope package in the qualifiedName, return the root. + * + * @param root + * @param qualifiedName + * @return The containing package (never null) + */ + private static Package lookupContainingPackage(Package root, List qualifiedName) { + Package cur = root; + for (int i = 0; i < qualifiedName.size() - 1; i++) { + String name = qualifiedName.get(i); + cur = lookupPackage(cur, name); + if (cur == null) { + return null; + } + } + return cur; + } + + /** + * Get the Namespace containing the last namespace of the qualifiedName. + * Do not lookup for the last element. + * If there is no scope package in the qualifiedName, return the root. + * + * @param parent + * @param qualifiedName + * @return The containing package (never null) + */ + private static Namespace lookupContainingNamespace(Namespace parent, List qualifiedName) { + Namespace cur = parent; + for (int i = 0; i < qualifiedName.size() - 1; i++) { + String name = qualifiedName.get(i); + cur = lookupNamespace(parent, name); + if (cur == null) { + return null; + } + } + return cur; + } + + /** + * Get the package containing the {@value #WILDCARD}. + * Do not create intermediate packages. + * Do not lookup for the last element. + * The qualified name contains a {@value #WILDCARD}, lookup the package just before it. + * + * @param root + * @param qualifiedName + * @return The containing package or null if not found. + */ + public static Package lookupPackageBeforeWildcard(Package root, List qualifiedName) { + Package cur = root; + for (int i = 0; i < qualifiedName.size(); i++) { + String name = qualifiedName.get(i); + // Stop if we encounter the wilcard. + if (WILDCARD.equals(name)) { + break; + } + + cur = lookupPackage(cur, name); + if (cur == null) { + return null; + } + } + return cur; + } + + + /** + * Get the package containing the last package of the qualifiedName. + * Create any missing package if needed + * Do not lookup for the last element. + * If there is no scope package in the qualifiedName, return the root. + * + * @param model + * @param qualifiedName + * @return The containing package (never null) + */ + public static Package getContainingPackage(Resource model, List qualifiedName) { + Package cur = getNamedElement(model, UMLPackage.eINSTANCE.getPackage(), qualifiedName.get(0)); + + for (int i = 1; i < qualifiedName.size() - 1; i++) { + String name = qualifiedName.get(i); + cur = getPackage(cur, name); + // if(cur==null) + // return null; + } + return cur; + } + + /** + * Get the package containing the last package of the qualifiedName. + * Create any missing package if needed + * Do not lookup for the last element. + * If there is no scope package in the qualifiedName, return the root. + * + * @param model + * @param qualifiedName + * @return The containing package or null if not found. + */ + private static Package lookupContainingPackage(Resource model, List qualifiedName) { + Package cur = lookupNamedElement(model, UMLPackage.eINSTANCE.getPackage(), qualifiedName.get(0)); + if (cur == null) { + return null; + } + + for (int i = 1; i < qualifiedName.size() - 1; i++) { + String name = qualifiedName.get(i); + cur = lookupPackage(cur, name); + if (cur == null) { + return null; + } + } + return cur; + } + + /** + * Get the Package corresponding to the qname. + * Create all missing package + * + * @param qualifiedName + * @return The requested package (never null) + */ + public static Package getPackage(Resource model, List qualifiedName) { + Package cur = getNamedElement(model, UMLPackage.eINSTANCE.getPackage(), qualifiedName.get(0)); + + for (int i = 1; i < qualifiedName.size(); i++) { + String name = qualifiedName.get(i); + cur = getPackage(cur, name); + // if(cur==null) + // return null; + } + return cur; + } + + /** + * Lookup the Package corresponding to the qname in specified model resource.. + * + * @param qualifiedName + * @return The requested package or null if not found + */ + public static Package lookupPackage(Resource model, List qualifiedName) { + Package cur = lookupNamedElement(model, UMLPackage.eINSTANCE.getPackage(), qualifiedName.get(0)); + if (cur == null) { + return null; + } + + for (int i = 1; i < qualifiedName.size(); i++) { + String name = qualifiedName.get(i); + cur = lookupPackage(cur, name); + if (cur == null) { + return null; + } + } + return cur; + } + + /** + * Get the Package corresponding to the qname. + * Create all missing package + * + * @param parent + * @param qualifiedName + * @return The requested package (never null) + */ + public static Package getPackage(Package parent, List qualifiedName) { + Package cur = parent; + for (int i = 0; i < qualifiedName.size(); i++) { + String name = qualifiedName.get(i); + cur = getPackage(cur, name); + // if(cur==null) + // return null; + } + return cur; + } + + /** + * Get the Model corresponding to the qname. + * Create all missing package. + * + * @param parent + * @param qualifiedName + * @return The requested package (never null) + */ + public static Package getModel(Package parent, List qualifiedName) { + Package cur = parent; + + // Get the intermediate as Package + int i = 0; + for (i = 0; i < qualifiedName.size() - 1; i++) { + String name = qualifiedName.get(i); + cur = getPackage(cur, name); + } + // Get the last one as Model + String name = qualifiedName.get(i); + cur = getModel(cur, name); + + return cur; + } + + /** + * Get the Package corresponding to the qname. + * + * @param parent + * @param qualifiedName + * @return The requested package or null if not found + */ + public static Package lookupPackage(Package parent, List qualifiedName) { + Package cur = parent; + for (int i = 0; i < qualifiedName.size(); i++) { + String name = qualifiedName.get(i); + cur = lookupPackage(cur, name); + if (cur == null) { + return null; + } + } + return cur; + } + + /** + * get (lookup or create) the specified NamedElement with the requested type + * + * @param + * should be equals to expected type. + * @param model + * @param expectedType + * @param name + * @return + */ + protected static R getNamedElement(Resource model, EClass expectedType, String name) { + + for (Object cur : model.getContents()) { + // System.out.println("Compare " + cur.getClass().getName() + "-->" + name ); + if (expectedType.getInstanceClass().isInstance(cur) && name.equals(((NamedElement) cur).getName())) { + // System.out.println("found !!!"); + return (R) cur; + } + } + + // Create it + R res = (R) UMLFactory.eINSTANCE.create(expectedType); + res.setName(name); + model.getContents().add(res); + return res; + } + + /** + * Lookup for the specified NamedElement with the requested type from the model container. + * + * @param + * @param model + * @param expectedType + * @param name + * @return + */ + protected static R lookupNamedElement(Resource model, EClass expectedType, String name) { + + for (Object cur : model.getContents()) { + if (expectedType.isInstance(cur) && name.equals(((NamedElement) cur).getName())) { + return (R) cur; + } + } + + return null; + } + + + /** + * Lookup or create the requested qualifiedName. Create it with the specified type. + * + * @param parentPackage + * @param generalQualifiedName + * @param expectedType + * @return + */ + public static R getClassifier(Package parent, List qualifiedName, EClass expectedType) { + // Get or create containing packages + Package p = getContainingPackage(parent, qualifiedName); + // Use the last name to create the element + return (R) p.getOwnedType(qualifiedName.get(qualifiedName.size() - 1), false, expectedType, true); + } + + /** + * Lookup the corresponding classifier to the qname in specified model resource.. + * + * @param qualifiedName + * @return The requested package or null if not found + */ + public static R lookupClassifier(Resource model, List qualifiedName, EClass expectedType) { + Package p = lookupContainingPackage(model, qualifiedName); + if (p == null) { + return null; + } + + return (R) p.getOwnedType(qualifiedName.get(qualifiedName.size() - 1), false, expectedType, false); + } + + /** + * Lookup for the classifier with specified qualifiedName in specified model resource.. + * + * @param qualifiedName + * @return The requested package or null if not found + */ + public static R lookupClassifierWithWildcard(Resource model, List qualifiedName, EClass expectedType) { + Package p = lookupContainingPackage(model, qualifiedName); + if (p == null) { + return null; + } + + return (R) p.getOwnedType(qualifiedName.get(qualifiedName.size() - 1), false, expectedType, false); + } + + + /** + * Lookup for the classifier with specified qualifiedName in specified model resource.. + * Don't Create it . + * The qualifiedName can contain a wildcard "*". + * + * @param parentPackage + * @param generalQualifiedName + * @param expectedType + * @return Found classifier or null + */ + public static R lookupClassifierWithWildcard(Package parent, List qualifiedName, EClass expectedType) { + + int wildcardIndex = qualifiedName.indexOf(WILDCARD); + // If there is no wildcard, use more simple implementation. + if (wildcardIndex < 0) { + return lookupClassifier(parent, qualifiedName, expectedType); + } + + // Get containing package till the WILDCARD + Package p = lookupPackageBeforeWildcard(parent, qualifiedName); + // If not found, return + if (p == null) { + return null; + } + + // Use the last name to lookup the element + // Look for existing packages at the place of the wildcard. + List existingPackages = p.getNestedPackages(); + // Get the remaining path from ]index, size] + List remainingPath = qualifiedName.subList(wildcardIndex + 1, qualifiedName.size()); + // Now continue searching from the existing packages + for (Package nestedPackage : existingPackages) { + + R r = lookupClassifier(nestedPackage, qualifiedName, expectedType); + if (r != null) { + return r; + } + } + + // Nothing found + return null; + } + + /** + * Lookup the requested qualifiedName. Don't Create it . + * + * @param parentPackage + * @param generalQualifiedName + * @param expectedType + * @return Found classifier or null + */ + public static R lookupClassifier(Package parent, List qualifiedName, EClass expectedType) { + // Get containing package + Package p = lookupContainingPackage(parent, qualifiedName); + if (p == null) { + return null; + } + // Use the last name to create the element + return (R) p.getOwnedType(qualifiedName.get(qualifiedName.size() - 1), false, expectedType, false); + } + + /** + * Lookup the requested qualifiedName. Don't Create it . + * + * @param parentPackage + * @param generalQualifiedName + * @param expectedType + * @return Found classifier or null + */ + public static R lookupClassifier(Namespace parent, List qualifiedName, EClass expectedType) { + // Get containing package + Namespace p = lookupContainingNamespace(parent, qualifiedName); + if (p == null) { + return null; + } + + parent = p; + String shortname = qualifiedName.get(qualifiedName.size() - 1); + Classifier result; + + if (parent instanceof Package) + { + result = (Classifier) ((Package) parent).getOwnedType(shortname, false, expectedType, false); + + } + else if (parent instanceof Interface) + { + result = ((Interface) parent).getNestedClassifier(shortname, false, expectedType, false); + } + else if (parent instanceof Class) + { + result = ((Class) parent).getNestedClassifier(shortname, false, expectedType, false); + } + else + { + // Should never happen ! + return null; + } + + return (R) result; + } + + /** + * Lookup for the specified package in the parent package. Create it if not found. + * + * @param parent + * @param name + * Package to found + * @return + */ + public static Class getClass(Package parent, String name) { + // Get or create an instance of the specified package. + Class p = (Class) parent.getOwnedType(name, false, UMLPackage.eINSTANCE.getClass_(), true); + return p; + } + + /** + * Get the specified class from the specified parent. + * Missing package and the class are created if needed. + * + * @param parent + * @param qualifiedName + * @return + */ + public static Class getClass(Package parent, List qualifiedName) { + Package p = getContainingPackage(parent, qualifiedName); + // Use the last name to create the element + return getClass(p, qualifiedName.get(qualifiedName.size() - 1)); + } + + /** + * + * @param enclosingParents + * list of enclosing parent, from the most outerside to the most inner side. + * @param name + * @return + */ + public static Class getClass(List enclosingParents, String name) { + + EClass type = UMLPackage.eINSTANCE.getClass_(); + Class result = (Class) getClassifier(enclosingParents, name, type); + + return result; + } + + /** + * Get or create a Classifier by its name. The type of the classifier can be Class or Interface + * Lookup is done in the provided namespaces, using the short name. + * The classifier is expected to be in the directly enclosing parent, but lookup is done in all enclosing parents. + * If the position is not the one expected, the found classifier is moved to the enclosing parent. + * + * If not found, create the classifier in the directly enclosing namespace. + * If found, correct the classifier parent to be the directly enclosing namespace. Eventually correct the type + * if it doesn't match. + * + * @param enclosingParents + * @param name + * @param type + * @return + */ + private static Classifier getClassifier(List enclosingParents, String name, EClass type) { + Classifier result = null; + int parentsCount = enclosingParents.size(); + // Get the direct parent + Namespace parent = enclosingParents.get(parentsCount - 1); + + // Look in enclosing parents + for (int i = parentsCount - 1; i >= 0; i--) + { + Namespace namespace = enclosingParents.get(i); + + // Lookup for the exact type + result = (Classifier) namespace.getOwnedMember(name, false, type); + if (result == null) + { + // Lookup for the other type + result = (Classifier) namespace.getOwnedMember(name, false, UMLPackage.eINSTANCE.getClassifier()); + } + + // Here, the result should have the correct type + if (result != null) + { + // Change type if needed + if (result.eClass() != type) { + System.err.println("Classifier type need to be corrected for (" + result.getQualifiedName() + ")"); + // Correct the classifier type + result = (Classifier) transformInto(result, type); + } + // Check if parent need to be corrected + if (result.getOwner() != parent) { + + // Correct the parent + setClassifierOwner(result, parent); + // Get the transformed element. + } + + // Found, return it + return result; + } + } + + // Not found, create in the direct parent. + + if (parent instanceof Package) + { + result = (Classifier) ((Package) parent).getOwnedType(name, false, type, true); + + } + else if (parent instanceof Interface) + { + result = ((Interface) parent).createNestedClassifier(name, type); + } + else if (parent instanceof Class) + { + result = ((Class) parent).createNestedClassifier(name, type); + } + else + { + // Should never happen ! + // The first namespace is always the package. + Package parentPackage = (Package) enclosingParents.get(0); + result = (Classifier) parentPackage.getOwnedType(name, false, type, true); + } + return result; + } + + /** + * Change the owner of the classifier + * + * @param classifier + * The classifier to change the parent + * @param newParent + * The parent to set. + */ + private static void setClassifierOwner(Classifier classifier, Namespace newParent) { + // Not found, create in the direct parent. + if (newParent instanceof Package) + { + classifier.setPackage((Package) newParent); + + } + else if (newParent instanceof Interface) + { + + ((Interface) newParent).getNestedClassifiers().add(classifier); + } + else if (newParent instanceof Class) + { + ((Class) newParent).getNestedClassifiers().add(classifier); + } + else + { + // Should never happen ! + // The first namespace is always the package. + System.err.println("Don't know how to change classifier owner for " + newParent); + } + } + + /** + * Transform the element into the specified type + * + * @param toTransform + * Classifier to transform (Class or interface) + * @param type + * Type to transform into + */ + private static EObject transformInto(Classifier toTransform, EClass type) { + + GenericTransformer transformer = new GenericTransformer(toTransform); + EObject result = transformer.transform(type); + return result; + + } + + /** + * Get or create a guessed Classifier by its name. The type of the classifier can be Class or Interface. + * A guessed classifier is a classifier specified by an attribute, a parameter, a return type ... + * First, lookup for a Classifier with the same name, and return it regardless of its type. + * If nothing is found, create a classifier with the specified type. + * + * + * If not found, create the classifier in the package (enclosingParent[0]). + * If found, return it. + * + * @param enclosingParents + * @param name + * The short name + * @param type + * the proposed type to use as a hint for creation. + * @return + */ + public static Classifier getGuessedClassifier(List enclosingParents, List name, EClass type) { + Classifier result = null; + int parentsCount = enclosingParents.size(); + // Get the direct parent + Namespace parent = enclosingParents.get(parentsCount - 1); + + // Look in enclosing parents + for (int i = parentsCount - 1; i >= 0; i--) + { + Namespace namespace = enclosingParents.get(i); + + // Lookup for any type + result = lookupClassifier(namespace, name, UMLPackage.eINSTANCE.getClassifier()); + // result = (Classifier)namespace.getOwnedMember(name, false, UMLPackage.eINSTANCE.getClassifier()); + if (result != null) + { + return result; + } + } + + // Not found, create in the direct parent. + // The first namespace is always the package. + Package parentPackage = (Package) enclosingParents.get(0); + result = (Classifier) getClassifier(parentPackage, name, type); + // result = (Classifier) ((Package)parentPackage).getOwnedType(name, false, type, true); + + return result; + } + + /** + * + * @param parent + * @param name + * @return + */ + public static Interface getInterface(Package parent, String name) { + Interface p = (Interface) parent.getOwnedType(name, false, UMLPackage.eINSTANCE.getInterface(), true); + return p; + } + + /** + * + * @param enclosingParents + * list of enclosing parent, from the most outerside to the most inner side. + * @param name + * @return + */ + public static Interface getInterface(List enclosingParents, String name) { + return (Interface) getClassifier(enclosingParents, name, UMLPackage.eINSTANCE.getInterface()); + } + + /** + * Create a Property and add it to the parent. + * + * @param parent + * @param name + * @param arrayCount + * @return + */ + public static Property createProperty(Classifier parent, Type type, String name, int arrayCount) { + Property p; + if (parent instanceof Class) { + p = createProperty((Class) parent, type, name, arrayCount); + } else if (parent instanceof Interface) { + p = createProperty((Interface) parent, type, name, arrayCount); + } else { + return null; + } + + p.setIsUnique(false); + return p; + } + + /** + * Create a property for the Class + * + * @param parent + * @param type + * @param name + * @param arrayCount + * @return + */ + public static Property createProperty(Class parent, Type type, String name, int arrayCount) { + return parent.getOwnedAttribute(name, type, false, UMLPackage.eINSTANCE.getProperty(), true); + } + + /** + * Create a property for the Class + * + * @param parent + * @param type + * @param name + * @param arrayCount + * @return + */ + public static Property createProperty(Interface parent, Type type, String name, int arrayCount) { + return parent.getOwnedAttribute(name, type, false, UMLPackage.eINSTANCE.getProperty(), true); + } + + /** + * Create a Generalization relation between the specified Classifier + * + * @param child + * @param general + */ + public static void getGeneralization(Classifier child, Classifier general) { + child.getGeneralization(general, true); + // child.createGeneralization(general); + } + + /** + * Create a InterfaceRealization relation between the specified Classifier + * + * @param child + * @param general + */ + public static void getInterfaceRealization(BehavioredClassifier child, Interface general) { + Realization res = lookupInterfaceRealization(child, general); + if (res == null) { + createInterfaceRealization(child, general); + } + } + + /** + * Lookup for the specified realization inside the package + * + * @param parent + * @param child + * @param general + * @return + */ + private static InterfaceRealization lookupInterfaceRealization(Classifier child, Classifier general) { + for (Dependency ele : child.getClientDependencies()) { + if (ele instanceof InterfaceRealization) { + InterfaceRealization real = (InterfaceRealization) ele; + if (real.getClients().contains(child) && real.getSuppliers().contains(general)) { + return real; + } + } + } + return null; + } + + /** + * Create a Generalization relation between the specified Classifier + * + * @param child + * @param general + */ + public static void createInterfaceRealization(BehavioredClassifier child, Interface general) { + InterfaceRealization res = UMLFactory.eINSTANCE.createInterfaceRealization(); + + res.setContract(general); + res.setImplementingClassifier(child); + + // res.getClients().add(child); + // res.getSuppliers().add(general); + res.setName(child.getName() + " implements " + general.getName()); + // child.createGeneralization(general); + // child.getClientDependencies().add(res); + } + + + /** + * Create a Generalization relation between the specified Classifier + * + * @param child + * @param general + */ + public static void getRealization(Package parent, Classifier child, Classifier general) { + Realization res = lookupRealization(parent, child, general); + if (res == null) { + createRealization(parent, child, general); + } + } + + /** + * Lookup for the specified realization inside the package + * + * @param parent + * @param child + * @param general + * @return + */ + private static Realization lookupRealization(Package parent, Classifier child, Classifier general) { + for (PackageableElement ele : parent.getPackagedElements()) { + if (ele instanceof Realization) { + Realization real = (Realization) ele; + if (real.getClients().contains(child) && real.getSuppliers().contains(general)) { + return real; + } + } + } + return null; + } + + /** + * Create a Generalization relation between the specified Classifier + * + * @param child + * @param general + */ + public static void createRealization(Package parent, Classifier child, Classifier general) { + Realization res = UMLFactory.eINSTANCE.createRealization(); + res.getClients().add(child); + res.getSuppliers().add(general); + res.setName(child.getName() + " extends " + general.getName()); + parent.getPackagedElements().add(res); + } + + /** + * Create a primitive type. + * + * @param root + * @param typeName + */ + public static PrimitiveType getPrimitive(Package parent, String typeName) { + return (PrimitiveType) parent.getOwnedType(typeName, true, UMLPackage.eINSTANCE.getPrimitiveType(), true); + + } + + /** + * Get the specified class from the specified parent. + * Missing package and the class are created if needed. + * + * @param parent + * @param qualifiedName + * @return + */ + public static PrimitiveType getPrimitive(Package parent, List qualifiedName) { + Package p = getContainingPackage(parent, qualifiedName); + // Use the last name to create the element + return getPrimitive(p, qualifiedName.get(qualifiedName.size() - 1)); + } + + /** + * Get the specified operation from the provided type. + * + * @param classifier + * @param name + * @return + */ + public static Operation getOperation(Classifier classifier, String name) { + // TODO Auto-generated method stub + List opers = classifier.getOperations(); + for (Operation op : opers) { + if (name.equals(op.getName())) { + return op; + } + } + + Operation res = createOperation(classifier, name); + return res; + } + + /** + * Create an operation with the specified name. + * + * @param classifier + * @param name + * @return + */ + public static Operation createOperation(Classifier classifier, String name) { + // Not found, create it + Operation res = UMLFactory.eINSTANCE.createOperation(); + res.setName(name); + if (classifier instanceof Class) { + ((Class) classifier).getOwnedOperations().add(res); + } else if (classifier instanceof Interface) { + ((Interface) classifier).getOwnedOperations().add(res); + } else if (classifier instanceof DataType) { + ((DataType) classifier).getOwnedOperations().add(res); + } + return res; + } + + + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/Activator.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/Activator.java new file mode 100644 index 00000000000..eea09e53942 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.java.reverse; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.java.reverse"; + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/utils/TypeOperationsEnhanced.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/utils/TypeOperationsEnhanced.java new file mode 100644 index 00000000000..55a0f3132b3 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse/src/org/eclipse/papyrus/java/reverse/utils/TypeOperationsEnhanced.java @@ -0,0 +1,184 @@ +/***************************************************************************** + * Copyright (c) 2012 Cedric Dumoulin. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.java.reverse.utils; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.uml2.uml.AggregationKind; +import org.eclipse.uml2.uml.Association; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.internal.operations.TypeOperations; + + +/** + * + * A static utility class that provides operations related to 'Type' model objects. + * + * + *

    + * The following operations are supported: + *

      + *
    • {@link org.eclipse.uml2.uml.Type#createAssociation(boolean, org.eclipse.uml2.uml.AggregationKind, java.lang.String, int, int, org.eclipse.uml2.uml.Type, boolean, org.eclipse.uml2.uml.AggregationKind, java.lang.String, int, int) Create Association + * }
    • + *
    • {@link org.eclipse.uml2.uml.Type#getAssociations() Get Associations}
    • + *
    • {@link org.eclipse.uml2.uml.Type#conformsTo(org.eclipse.uml2.uml.Type) Conforms To}
    • + *
    + *

    + * + * @copyright copied from org.eclipse.uml2.uml.internal.operations.TypeOperations + */ +public class TypeOperationsEnhanced extends TypeOperations { + + /** + * + * + * + * @generated + */ + protected TypeOperationsEnhanced() { + super(); + } + + protected static Property setAssociationEnd(Property property, + Association association, boolean isNavigable, + AggregationKind aggregation) { + + Property associationEnd = property; + + associationEnd.setAggregation(aggregation); + + if (isNavigable) { + association.getMemberEnds().add(associationEnd); + } + + return associationEnd; + } + + + /** + * + * + * + * Creates a(n) (binary) association between this type and the specified other type, with the specified navigabilities, aggregations, names, lower bounds, and upper bounds, and owned by this type's nearest package. + * + * @param type + * The receiving 'Type' model object. + * @param end1IsNavigable + * The navigability for the first end of the new association. + * @param end1Aggregation + * The aggregation for the first end of the new association. + * @param end1Name + * The name for the first end of the new association. + * @param end1Lower + * The lower bound for the first end of the new association. + * @param end1Upper + * The upper bound for the first end of the new association. + * @param end1Type + * The type for the first end of the new association. + * @param end2IsNavigable + * The navigability for the second end of the new association. + * @param end2Aggregation + * The aggregation for the second end of the new association. + * @param end2Name + * The name for the second end of the new association. + * @param end2Lower + * The lower bound for the second end of the new association. + * @param end2Upper + * The upper bound for the second end of the new association. + * + * @generated NOT + */ + public static Association createAssociationFromProperty(Property property, + boolean end1IsNavigable, AggregationKind end1Aggregation, + boolean end2IsNavigable, AggregationKind end2Aggregation, + String end2Name, int end2Lower, int end2Upper) { + return createAssociationFromProperty(property, end1IsNavigable, end1Aggregation, + end2IsNavigable, end2Aggregation, + end2Name, end2Lower, end2Upper, + UMLPackage.Literals.ASSOCIATION); + } + + /** + * + * @param property + * @param end1IsNavigable + * @param end1Aggregation + * @param end2IsNavigable + * @param end2Aggregation + * @param end2Name + * @param end2Lower + * @param end2Upper + * @param eClass + * @return + */ + protected static Association createAssociationFromProperty(Property property, + boolean end1IsNavigable, AggregationKind end1Aggregation, + boolean end2IsNavigable, AggregationKind end2Aggregation, + String end2Name, int end2Lower, int end2Upper, + EClass eClass) { + + // Check if there the property is already part of an association + if (property.getAssociation() != null) { + return property.getAssociation(); + } + + // Get owner (end2Type) + Type type; + try { + type = (Type) property.getOwner(); + } catch (ClassCastException e) { + throw new IllegalArgumentException("Property's owner should be a Type"); + } + + Type end1Type = property.getType(); + // Validate end1 + validateTypeAndBounds(end1Type, end2Lower, end2Upper); + + + org.eclipse.uml2.uml.Package package_ = type.getNearestPackage(); + + if (package_ == null) { + throw new IllegalStateException(); + } + + if (end1Aggregation == null) { + throw new IllegalArgumentException(String.valueOf(end1Aggregation)); + } + + if (end2Aggregation == null) { + throw new IllegalArgumentException(String.valueOf(end2Aggregation)); + } + + Association association = (Association) package_.createOwnedType(null, eClass); + association.setName("A_" + property.getName() + "_" + end2Name); + + // Set end1 + // createAssociationEnd(type, association, end1IsNavigable, + // end1Aggregation, end1Name, end1Lower, end1Upper, end1Type); + setAssociationEnd(property, association, end1IsNavigable, + end1Aggregation); + + createAssociationEnd(end1Type, association, end2IsNavigable, + end2Aggregation, end2Name, end2Lower, end2Upper, type); + + + + + + return association; + } + +} // TypeOperations \ No newline at end of file diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.classpath b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.classpath new file mode 100644 index 00000000000..2d1a4302f04 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.project b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.project new file mode 100644 index 00000000000..4bfadfe48b4 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.java.template + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..4759947300a --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..9c471179c14 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.jface.text, + org.eclipse.jdt.core, + org.eclipse.jdt.ui, + org.eclipse.pde.core, + org.eclipse.ui +Bundle-Vendor: Atos Origin +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Name: Java Template +Bundle-Activator: org.eclipse.papyrus.java.template.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.java.template;singleton:=true +Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/about.html b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/about.html new file mode 100644 index 00000000000..a80e9697355 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/about.html @@ -0,0 +1,26 @@ + + + + + +About + +

    About This Content

    + +

    June 5, 2006

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + \ No newline at end of file diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/build.properties b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/build.properties new file mode 100644 index 00000000000..534691f258d --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/build.properties @@ -0,0 +1,6 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml +src.includes = about.html diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/plugin.xml b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/plugin.xml new file mode 100644 index 00000000000..f34d144cb6e --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/plugin.xml @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/Activator.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/Activator.java new file mode 100644 index 00000000000..dc84187efd2 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/Activator.java @@ -0,0 +1,63 @@ +/**************************************************************************** + * Copyright (c) 2009 Atos Origin. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *****************************************************************************/ +package org.eclipse.papyrus.java.template; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.java.template"; + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/BundleActivatorResolver.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/BundleActivatorResolver.java new file mode 100644 index 00000000000..fddd864d9eb --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/BundleActivatorResolver.java @@ -0,0 +1,110 @@ +/**************************************************************************** + * Copyright (c) 2009 Atos Origin. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *****************************************************************************/ +package org.eclipse.papyrus.java.template.resolvers; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.internal.corext.template.java.CompilationUnitContext; +import org.eclipse.jdt.internal.corext.template.java.JavaContext; +import org.eclipse.jface.text.templates.TemplateContext; +import org.eclipse.jface.text.templates.TemplateVariable; +import org.eclipse.jface.text.templates.TemplateVariableResolver; +import org.eclipse.pde.core.plugin.IPluginModelBase; +import org.eclipse.pde.core.plugin.PluginRegistry; +import org.osgi.framework.Bundle; +import org.osgi.framework.Constants; + +/** + * This class creates a new variable which resolve the activator class of the compilation unit. + * + * @author tlandre + * + */ +public class BundleActivatorResolver extends TemplateVariableResolver { + + public BundleActivatorResolver() { + super("activatorLog", "Static field log in the activator containing the current compilation unit"); //$NON-NLS-1$ //$NON-NLS-2$ + } + + /** + * + * {@inheritDoc} + * + * @see TemplateVariableResolver#resolve(org.eclipse.jface.text.templates.TemplateContext) + * + */ + @SuppressWarnings("restriction") + @Override + public void resolve(TemplateVariable variable, TemplateContext pContext) { + variable.setUnambiguous(true); + variable.setValue(""); //$NON-NLS-1$ + if (pContext instanceof JavaContext) { + final JavaContext context = (JavaContext) pContext; + final IPluginModelBase pluginModelBase = PluginRegistry.findModel(getProject(context)); + Bundle bundle = getBundle(pluginModelBase); + if (bundle != null) { + Object obj = bundle.getHeaders().get(Constants.BUNDLE_ACTIVATOR); + if (obj instanceof String) { + StringBuffer qualifiedName = new StringBuffer((String) obj); + qualifiedName.append(".log"); + context.addStaticImport(qualifiedName.toString()); + } + } + } + + } + + /** + * Get the bundle associated with the IPluginModelBase + * + * @param pluginModelBase + * a pluginModelBase. May be null. + * @return the bundle found or null. + */ + private Bundle getBundle(IPluginModelBase pluginModelBase) { + Bundle bundle = null; + if (pluginModelBase != null && pluginModelBase.getBundleDescription() != null) { + bundle = Platform.getBundle(pluginModelBase.getBundleDescription().getSymbolicName()); + } + return bundle; + } + + /** + * Get the project of the compilation unit (if any) associated with the given JavaContext + * + * @param context + * the JavaContext. Must be not null. + * @return the project found or null + */ + @SuppressWarnings("restriction") + private IProject getProject(CompilationUnitContext context) { + IProject project = null; + ICompilationUnit compilationUnit = context.getCompilationUnit(); + if (compilationUnit != null) { + IJavaProject javaProject = compilationUnit.getJavaProject(); + if (javaProject != null) { + project = javaProject.getProject(); + } + } + return project; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.text.templates.TemplateVariableResolver#resolveAll(org.eclipse.jface.text.templates.TemplateContext) + */ + @Override + protected String[] resolveAll(TemplateContext context) { + return new String[0]; + } +} diff --git a/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/RegisterResolver.java b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/RegisterResolver.java new file mode 100644 index 00000000000..95c0461ac39 --- /dev/null +++ b/extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.template/src/org/eclipse/papyrus/java/template/resolvers/RegisterResolver.java @@ -0,0 +1,90 @@ +/**************************************************************************** + * Copyright (c) 2009 Atos Origin. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *****************************************************************************/ +package org.eclipse.papyrus.java.template.resolvers; + +import java.util.Iterator; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.jdt.internal.corext.template.java.CompilationUnitContextType; +import org.eclipse.jdt.internal.ui.JavaPlugin; +import org.eclipse.jface.text.templates.ContextTypeRegistry; +import org.eclipse.papyrus.java.template.Activator; +import org.eclipse.ui.IStartup; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.BundleEvent; +import org.osgi.framework.BundleListener; + +/** + * This class registers the resolver into the ContextTypeRegistry + * + * @author tlandre + * + */ +public class RegisterResolver implements IStartup { + + /** + * + * {@inheritDoc} + * + * @see IStartup#earlyStartup() + * + */ + public void earlyStartup() { + // check if plug-in org.eclipse.jdt.ui is already active + Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID); + if (bundle != null && bundle.getState() == Bundle.ACTIVE) { + // register resolvers + registerResolvers(); + } else { + // register listener to get informed, when plug-in becomes active + final BundleContext bundleContext = Activator.getDefault().getBundle().getBundleContext(); + if (bundleContext != null) { + bundleContext.addBundleListener(new BundleListener() { + + /* + * (non-Javadoc) + * + * @see org.osgi.framework.BundleListener#bundleChanged(org.osgi.framework.BundleEvent) + */ + public void bundleChanged(final BundleEvent pEvent) { + Bundle bundle = pEvent.getBundle(); + if (!Activator.PLUGIN_ID.equals(bundle.getSymbolicName())) { + return; + } + if (bundle.getState() == Bundle.ACTIVE) { + // register resolvers + registerResolvers(); + bundleContext.removeBundleListener(this); + } + } + }); + } + } + } + + /** + * + * Internal method to register resolvers with all context types. + * + */ + private void registerResolvers() { + final ContextTypeRegistry codeTemplateContextRegistry = JavaPlugin.getDefault().getTemplateContextRegistry(); + final Iterator ctIter = codeTemplateContextRegistry.contextTypes(); + while (ctIter.hasNext()) { + Object object = ctIter.next(); + if (object instanceof CompilationUnitContextType) { + CompilationUnitContextType contextType = (CompilationUnitContextType) object; + // Add the bundle activator resolver + contextType.addResolver(new BundleActivatorResolver()); + } + } + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.classpath b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.project b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.project new file mode 100644 index 00000000000..f710852782a --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.codegen.base + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..a09b81b1fc6 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/META-INF/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.uml2.uml;bundle-version="4.0.2", + org.eclipse.core.filesystem;bundle-version="1.3.200", + org.eclipse.core.resources;bundle-version="3.9.1", + org.eclipse.papyrus.infra.core;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", + org.eclipse.emf.transaction;bundle-version="1.8.0" +Export-Package: org.eclipse.papyrus.codegen.base, + org.eclipse.papyrus.codegen.base.codesync +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.codegen.base.Activator +Bundle-SymbolicName: org.eclipse.papyrus.codegen.base;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/about.html b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/build.properties b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/build.properties new file mode 100644 index 00000000000..db71331cf59 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties,\ + icons/ +src.includes = about.html diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/icons/codegen-16x16.gif b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/icons/codegen-16x16.gif new file mode 100644 index 00000000000..d7c1a7365f5 Binary files /dev/null and b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/icons/codegen-16x16.gif differ diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/plugin.properties b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/plugin.properties new file mode 100644 index 00000000000..1e85d2491da --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Basic code-generation functions (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/pom.xml b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/pom.xml new file mode 100644 index 00000000000..956ac30859b --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../releng/extra + + org.eclipse.papyrus.codegen.base + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Activator.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Activator.java new file mode 100644 index 00000000000..b4c1e58de7f --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Activator.java @@ -0,0 +1,44 @@ +package org.eclipse.papyrus.codegen.base; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator implements BundleActivator { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.codegen.base"; //$NON-NLS-1$ + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + public static LogHelper log; + + /* + * (non-Javadoc) + * + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + log = new LogHelper(); + } + + /* + * (non-Javadoc) + * + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + log = null; + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/GenUtils.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/GenUtils.java new file mode 100644 index 00000000000..bf1304e37cb --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/GenUtils.java @@ -0,0 +1,731 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2013 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.codegen.base; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.UniqueEList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Comment; +import org.eclipse.uml2.uml.Dependency; +import org.eclipse.uml2.uml.DirectedRelationship; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Namespace; +import org.eclipse.uml2.uml.OpaqueBehavior; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.ParameterDirectionKind; +import org.eclipse.uml2.uml.ParameterableElement; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.TemplateParameter; +import org.eclipse.uml2.uml.TemplateSignature; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.util.UMLUtil; + + +/** + * Some utilities: a set of static methods for Acceleo based code generation + * + * @author wassim, ansgar + * + */ +public class GenUtils { + + public static final String NL = System.getProperties().getProperty("line.separator"); //$NON-NLS-1$ + + /** + * Retrieve first template binding from list of template bindings, if + * exactly one exists. Return null otherwise. + * + * @param current + * Class on which the template binding is searched + * @return the template binding of current Class + */ + public static TemplateBinding getTemplateBinding(Classifier current) { + TemplateBinding binding = null; + if (current.getTemplateBindings().size() == 1) { + binding = current.getTemplateBindings().get(0); + } + + return binding; + } + + /** + * Check whether the passed classifier has a template binding with itself as bound element + * + * @param cl + * @return + */ + public static boolean isTemplateBoundElement(Classifier cl) { + boolean result = false; + EList tbs = cl.getTemplateBindings(); + if (tbs.size() > 0) { + for (TemplateBinding tb : tbs) { + // TODO: will only work for single element in template binding list + result = tb.getBoundElement() == cl; + } + } + return result; + } + + /** + * Get the name of a template parameter or undefined, if it is not set + * + * @param templateParam + * @return + */ + public static String getTemplateName(TemplateParameter templateParam) { + String name = ""; //$NON-NLS-1$ + ParameterableElement pElt = templateParam.getParameteredElement(); + if ((pElt != null) && (pElt instanceof NamedElement)) { + name = ((NamedElement) pElt).getName(); + } else { + name = "undefined"; //$NON-NLS-1$ + } + + return name; + } + + + /** + * + * @param classifier + * a classifier owning a template signature + * @return the list of (formal) parameters defined within a template signature + */ + public static Collection getTemplateParameters(Classifier classifier) { + + Collection params = new ArrayList(); + TemplateSignature ts = classifier.getOwnedTemplateSignature(); + if (ts != null) { + params.addAll(ts.getOwnedParameters()); + } + + return params; + } + + /** + * + * @param classifier + * @return + */ + public static Collection getTemplateParameteredElements(Classifier classifier) { + + Collection params = new ArrayList(); + TemplateSignature ts = classifier.getOwnedTemplateSignature(); + if (ts != null) { + for (TemplateParameter tp : ts.getOwnedParameters()) { + if (tp != null) { + params.add(tp.getParameteredElement()); + } + } + } + return params; + } + + /** + * Retrieve a list of types that belong to by a classifier in the current class + * + * @param current + * Class on which the attributes are searched + * @return collection of classes which are the type of the attributes + */ + public static EList getOwnedAttributeTypes(Classifier current) { + EList result = new UniqueEList(); + + Iterator attributes; + attributes = current.getAttributes().iterator(); + while (attributes.hasNext()) { + Property currentAttribute = attributes.next(); + Type type = currentAttribute.getType(); + addFarthestOwnerType(type, result); + } + return result; + } + + /** + * Retrieve a list of types that belong to by a classifier in the current class + * + * @param current + * Class on which the attributes are searched + * @return collection of classes which are the type of the attributes + */ + public static EList getTypesViaAttributes(Classifier current) { + EList result = new UniqueEList(); + + for (Property currentAttribute : current.getAttributes()) { + Type type = currentAttribute.getType(); + addFarthestOwnerType(type, result); + } + return result; + } + + /** + * Retrieve the operations in the current class. For each + * operation collected the classifier type. This class thus finds types, on + * which the signature depends. + * + * @param current + * Class on which the attributes are searched + * @return collection of classes which are the types of the operations parameters + */ + public static EList getTypesViaOperations(Classifier current) { + EList result = new UniqueEList(); + for (Operation operation : current.getOperations()) { + for (Parameter param : operation.getOwnedParameters()) { + Type type = param.getType(); + addFarthestOwnerType(type, result); + } + } + return result; + } + + /** + * Retrieves a list of types used by inner classifiers of the current classifier + * + * @param current + * Class on which the attributes are searched + * @return collection of classes which are the types of the operations parameters + */ + public static EList getInnerClassifierTypes(Classifier current) { + EList result = new UniqueEList(); + for (Element ownedElement : current.allOwnedElements()) { + if (ownedElement instanceof Classifier) { + result.addAll(getOwnedAttributeTypes((Classifier) ownedElement)); + result.addAll(getTypesViaOperations((Classifier) ownedElement)); + } + } + return result; + } + + /** + * Return a list of classifiers that are referenced by relationships, i.e. + * dependencies or associations + * + * @param current + * @return + */ + public static EList getTypesViaRelationships(Classifier current) { + EList classifiers = new UniqueEList(); + + for (DirectedRelationship relationship : current.getSourceDirectedRelationships()) { + + if (relationship.getTargets().size() > 0) { + // there should always be at least one element in the target + // list and it should be a classifier, but better check. + Element element = relationship.getTargets().get(0); + addFarthestOwnerType(element, classifiers); + } + } + return classifiers; + } + + /** + * Return a list of classifiers that are referenced via dependencies + * + * @param current + * @return + */ + public static EList getTypesViaDependencies(Classifier current) { + EList classifiers = new UniqueEList(); + + for (DirectedRelationship relationship : current.getSourceDirectedRelationships()) { + if (relationship instanceof Dependency) { + if (relationship.getTargets().size() > 0) { + // there should always be at least one element in the target + // list and it should be a classifier, but better check. + Element element = relationship.getTargets().get(0); + addFarthestOwnerType(element, classifiers); + } + } + } + return classifiers; + } + + /** + * Return a list of classifiers that are referenced via all kinds of relations except + * dependencies + * + * @param current + * @return + */ + public static EList getTypesViaRelationshipsNoDeps(Classifier current) { + EList classifiers = new UniqueEList(); + + for (DirectedRelationship relationship : current.getSourceDirectedRelationships()) { + if (!(relationship instanceof Dependency)) { + if (relationship.getTargets().size() > 0) { + // there should always be at least one element in the target + // list and it should be a classifier, but better check. + Element element = relationship.getTargets().get(0); + addFarthestOwnerType(element, classifiers); + } + } + } + return classifiers; + } + + + /** + * Return the qualified name of a named element, but use "_" instead of "::" as separator + * + * @param ne + * a named element + * @return the fully qualified name with "_" as separator character + */ + public static String getFullName(NamedElement ne) { + return ne.getQualifiedName().replace("::", "_"); //$NON-NLS-1$ //$NON-NLS-2$ + } + + /** + * return the full name in upper case + * + * @param ne + * @return + */ + public static String getFullNameUC(NamedElement ne) { + return ne.getQualifiedName().replace("::", "_").toUpperCase(); //$NON-NLS-1$ //$NON-NLS-2$ + } + + + /** + * Retrieve the comments associated with an element + * TODO: check whether comment's annotated element link belongs to element in question + * + * @param element + * @return + */ + public static String getComments(Element element) { + String commentText = ""; //$NON-NLS-1$ + for (Comment comment : element.getOwnedComments()) { + // remove eventual CRs (avoid confusion in Acceleo template which adds " *" after line breaks) + commentText += cleanCR(comment.getBody()); + } + return commentText; + } + + /** + * Return a list of dependent package (the list of dependent + * elements filtered for packages) + * + * @param pkg + * @return + */ + public static EList getUsedPackages(Package pkg) { + EList result = new UniqueEList(); + for (Element depElement : pkg.getClientDependencies()) { + if (depElement instanceof Package) { + result.add((Package) depElement); + } + } + return result; + } + + /** + * Return a list of dependent classifiers (the list of dependent + * elements filtered for classifiers) + * + * @param pkg + * @return + */ + public static EList getUsedClassifiers(Classifier cls) { + EList result = new BasicEList(); + for (Element depElement : cls.getClientDependencies()) { + addFarthestOwnerType(depElement, result); + } + return result; + } + + /** + * Adds the first element owned by a package in a classifier's namespace + * + * @param classifier + * @return + */ + private static void addFarthestOwnerType(Element element, EList result) { + if (element == null || result == null) { + return; + } + + if (element.getOwner() instanceof Package && element instanceof Classifier) { + result.add((Classifier) element); + } else { // Type is an inner class. We want to return a classifier C directly owned by a package since it is "C.h" that should be included + addFarthestOwnerType(element.getOwner(), result); + } + } + + /** + * Get the namespace of the farthest classifier owner that owns an operation + * + * @param op + * @return + */ + public static String getNestedOperationFarthestClassifierOwnerNamespace(Operation op) { + StringBuffer buffer = new StringBuffer(""); + if (op != null && op.getOwner() instanceof Classifier) { + getFarthestOwnerNamespace(op.getOwner(), buffer); + } + return buffer.toString(); + } + + /** + * Get the namespace of the farthest classifier owner that owns an operation + * + * @param behavior + * @return + */ + public static String getNestedBehaviorFarthestClassifierOwnerNamespace(OpaqueBehavior behavior) { + StringBuffer buffer = new StringBuffer(""); + if (behavior != null && behavior.getOwner() instanceof Classifier) { + getFarthestOwnerNamespace(behavior.getOwner(), buffer); + } + return buffer.toString(); + } + + /** + * Build a namespace to the farthest owner (i.e. owned by a package) of some element + * + * @param element + * @param result + */ + private static void getFarthestOwnerNamespace(Element element, StringBuffer result) { + if (element == null || result == null) { + return; + } + + if (element.getOwner() instanceof Package) { + result.insert(0, ((Classifier) element).getName()); + } else { + result.insert(0, "::" + ((Classifier) element).getName()); + getFarthestOwnerNamespace(element.getOwner(), result); + } + } + + /** + * Return the qualified name of a package, but use "/" instead of "::" as separator + * + * @param pkg + * @return + */ + public static String getFullPath(Package pkg) { + return pkg.getQualifiedName().replace("::", "/"); //$NON-NLS-1$//$NON-NLS-2$ + } + + /** + * Is a certain stereotype applied? + * + * @param element + * @param stereotype + * fully qualified stereotype name + * @return + */ + public static boolean hasStereotype(Element element, String stereotName) { + return element.getAppliedStereotype(stereotName) != null; + } + + /** + * Is a certain stereotype applied? + * + * @param element + * a UML element + * @param stereotype + * The class of an element of a static profile + * @return + */ + public static boolean hasStereotype(Element element, java.lang.Class clazz) { + for (EObject stereoApplication : element.getStereotypeApplications()) { + // check whether the stereotype is a super-class of the passed parameter clazz + if (clazz.isAssignableFrom(stereoApplication.getClass())) { + return true; + } + } + return false; + } + + + /** + * Is a certain stereotype applied? + * In case of Java, we use the class above (without the A) prefix. In case of Acceleo, a stereotype + * such as C_Cpp::Include is passed as EClass and we therefore use this operation from Acceleo. + * + * @param element + * @param definition + * The eClass associated with the stereotype name (its definition) + * @return + */ + public static boolean hasStereotypeA(Element element, EClass definition) { + if (element == null) { + // make query more robust + return false; + } + for (EObject stereoApplication : element.getStereotypeApplications()) { + // check whether the stereotype application has the right eClass + if (stereoApplication.eClass() == definition) { + return true; + } + } + return false; + } + + /** + * Verify if an Element or its parent Elements have a stereotype. Pass the class associated with a stereotype + * + * @param elt + * Element used. + * @param clazz + * the class associated with a stereotype in a static profile + * + * @return true if found. false otherwise + */ + public static boolean hasStereotypeTree(Element elt, java.lang.Class clazz) + { + + if (hasStereotype(elt, clazz)) { + return true; + } + else { + Element owner = elt.getOwner(); + if (owner != null) { + return hasStereotypeTree(owner, clazz); + } + else { + return false; + } + } + } + + + /** + * Verify if an Element or its parent Elements have a stereotype. Pass the definition of the stereotype + * + * @param elt + * Element used. + * @param definition + * The stereotype definition + * @return true if found. false otherwise + */ + public static boolean hasStereotypeTree(Element elt, EClass definition) + { + Element owner; + + if (hasStereotypeA(elt, definition)) { + return true; + } else if ((owner = elt.getOwner()) != null) { + return hasStereotypeTree(owner, definition); + } else { + return false; + } + } + + + /** + * return the first occurrence of a stereotype application in the ownership tree + * + * @param elt + * an element + * @param definition + * the definition of a stereotype (its eClass) + * @return + */ + @SuppressWarnings("unchecked") + public static T getApplicationTree(Element elt, java.lang.Class clazz) + { + EObject application = UMLUtil.getStereotypeApplication(elt, clazz); + if (application != null) { + return (T) application; + } + else { + Element owner = elt.getOwner(); + if (owner != null) { + return getApplicationTree(owner, clazz); + } + else { + return null; + } + } + } + + + /** + * return the first occurrence of a stereotype application in the ownership tree + * Variant of @see getApplicationTree that is useful for Acceleo + * + * @param elt + * an element + * @param definition + * the definition of a stereotype (its eClass) + * @return + */ + public static EObject getApplicationTreeA(Element elt, EClass definition) + { + EObject application = getApplicationA(elt, definition); + if (application != null) { + return application; + } + else { + Element owner = elt.getOwner(); + if (owner != null) { + return getApplicationTreeA(owner, definition); + } + else { + return null; + } + } + } + + + /** + * Return a stereotype application when given the eClass of that application. + * In case of Java, we use the class above (without the A) prefix. In case of Acceleo, a stereotype + * such as C_Cpp::Include is passed as EClass and we therefore use this operation from Acceleo. + * + * @param element + * the UML model element + * @param eClass + * the eClass of the stereotype application + * @return + */ + public static EObject getApplicationA(Element element, EClass eClass) { + for (EObject stereoApplication : element.getStereotypeApplications()) { + // check whether the stereotype is an instance of the passed parameter clazz + if (stereoApplication.eClass() == eClass) { + return stereoApplication; + } + } + return null; + } + + + /** + * @param operation + * the operation + * @param selectedLanguage + * the selected language + * @return Return the first body of a selected language that is provided by + * one of the operation's methods + */ + public static String getBody(Operation operation, Pattern selectedLanguages) { + for (Behavior behavior : operation.getMethods()) { + if (behavior instanceof OpaqueBehavior) { + return getBodyFromOB((OpaqueBehavior) behavior, selectedLanguages); + } + } + return ""; //$NON-NLS-1$ + } + + + /** + * @param ob + * an opaque behavior + * @param selectedLanguage + * the selected language, this may be a regular expression + * @return Return the first body of a selected language that is provided by + * one of the operation's methods + */ + public static String getBodyFromOB(OpaqueBehavior ob, Pattern selectedLanguages) { + Iterator bodies = ob.getBodies().iterator(); + for (String language : ob.getLanguages()) { + // additional sanity check: number of languages and number of bodies should be synchronized, + // but there is no guarantee that this is the case + if (bodies.hasNext()) { + String body = bodies.next(); + Matcher matcher = selectedLanguages.matcher(language); + if (matcher.matches()) { + // additional "\r" confuses Acceleo + return cleanCR(body); + } + } + } + return ""; //$NON-NLS-1$ + } + + /** + * Remove from a String. These confuse Acceleo's indentation + * + * @param str + * @return + */ + public static String cleanCR(String str) { + if (str == null) { + return "// "; //$NON-NLS-1$ + } + return str.replace("\r", ""); //$NON-NLS-1$ //$NON-NLS-2$ + } + + + /** + * Avoid null strings, i.e. replace null strings by empty strings + * + * @param str + * @return + */ + public static String maskNull(String str) { + if (str == null) { + return ""; //$NON-NLS-1$ + } + return str; + } + + /** + * Return the relative path of ne2 as seen from ne1 + * (might not always be useful, if includes are always done from a common root) + * TODO: incomplete, currently unused + * + * @param ne1 + * a named element + * @param ne2 + * a named element + * @return + */ + public static String getRelativePath(NamedElement ne1, NamedElement ne2) { + // get common prefix + EList ne1namespaces = ne1.allNamespaces(); + String path = ""; //$NON-NLS-1$ + for (Namespace ns : ne2.allNamespaces()) { + if (ne1namespaces.contains(ns)) { + // ns is a common prefix + return ne2.getName(); + } + path += "../"; //$NON-NLS-1$ + } + return path; + } + + /** + * Return the type of a behavior, i.e. the type of the first parameter with + * "return" direction + * + * @param behavior + * a behavior + * @return the associated type + */ + public static Parameter returnResult(Behavior behavior) { + for (Parameter parameter : behavior.getOwnedParameters()) { + if (parameter.getDirection() == ParameterDirectionKind.RETURN_LITERAL) { + return parameter; + } + } + return null; + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/HierarchyLocationStrategy.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/HierarchyLocationStrategy.java new file mode 100644 index 00000000000..fdb90709689 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/HierarchyLocationStrategy.java @@ -0,0 +1,46 @@ +package org.eclipse.papyrus.codegen.base; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Namespace; + +public class HierarchyLocationStrategy implements ILocationStrategy { + + /** + * Always use / instead of File.separationChar + */ + public static final String SEP_CHAR = "/"; //$NON-NLS-1$ + + /** + * Return the filename for a given named element. + * + * @param element + * a named element + * @return filename for this element + */ + public String getFolder(NamedElement element) { + // IContainer baseContainer = getFolder(project, subFolderName); + EList namespaces = element.allNamespaces(); + String fileName = ""; //$NON-NLS-1$ + for (int i = namespaces.size() - 1; i >= 0; i--) { + Namespace ns = namespaces.get(i); + fileName += ns.getName() + SEP_CHAR; + } + return fileName; + } + + /** + * Return the filename for a given named element. + * + * @param element + * a named element + * @return filename for this element + */ + public String getFileName(NamedElement element) { + String folder = getFolder(element); + if (folder.length() > 0) { + folder += SEP_CHAR; + } + return getFolder(element) + element.getName(); + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ILocationStrategy.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ILocationStrategy.java new file mode 100644 index 00000000000..7820bdece18 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ILocationStrategy.java @@ -0,0 +1,14 @@ +package org.eclipse.papyrus.codegen.base; + +import org.eclipse.uml2.uml.NamedElement; + +/** + * A location strategy defines the location of a file associated with a model element + * depending on the namespaces of this model element (package hierarchy). + */ +public interface ILocationStrategy { + + public String getFolder(NamedElement element); + + public String getFileName(NamedElement element); +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/IPFileSystemAccess.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/IPFileSystemAccess.java new file mode 100644 index 00000000000..e72057135b4 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/IPFileSystemAccess.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2014 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + * + *******************************************************************************/ + +package org.eclipse.papyrus.codegen.base; + + +/** + * Simple interface inspired from IFileSystemAccess in xtext.generator. + * The prefix 'P' should avoid confusions with the latter. We do not the xbase class + * directly to avoid a dependency to xtext (not all potential generators are xtend/xtext based). + */ +public interface IPFileSystemAccess { + + /** + * @param fileName using '/' as file separator + * @param contents the to-be-written contents. + */ + public void generateFile(String fileName, String contents); + + /** + * @param fileName using '/' as file separator + */ + public void deleteFile(String fileName); +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/JavaIoFileSystemAccess.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/JavaIoFileSystemAccess.java new file mode 100644 index 00000000000..e10e9ad2566 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/JavaIoFileSystemAccess.java @@ -0,0 +1,136 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.codegen.base; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.file.Files; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Namespace; + +/** + * A simple class providing access to the file system, if the project is known + * + */ +public class JavaIoFileSystemAccess implements IPFileSystemAccess { + + File baseFolder; + + String subFolderName; + + boolean force = true; + + + /** + * @see org.eclipse.IPFileSystemAccess.generator.IFileSystemAccess#generateFile(java.lang.String, java.lang.String) + * + * @param fileName The filename + * @param content The content that is written to a file + */ + public void generateFile(String fileName, String content) { + File file = getFile(fileName); + try { + if (!file.exists()) { + // the file does not exists + file.createNewFile(); + } + BufferedWriter writer = Files.newBufferedWriter(file.toPath(), Charset.defaultCharset()); + writer.write(content); + } + catch (IOException e) { + throw new RuntimeException("Code generation: " + e.getMessage()); //$NON-NLS-1$ + } + } + + /** + * @see org.eclipse.IPFileSystemAccess.generator.IFileSystemAccess#deleteFile(java.lang.String) + * + * @param fileName + */ + public void deleteFile(String fileName) { + File file = getFile(fileName); + file.delete(); + } + + public void setOutputPath(File baseFolder) { + this.baseFolder = baseFolder; + } + + public void setOutputPath(File baseFolder, String folderName) { + this.baseFolder = baseFolder; + this.subFolderName = folderName; + } + + /** + * Return a container (folder) for a given named element. The folder is embedded into a set + * of folders that correspond to the namespaces of the element. These folders will be + * created, if the do not exist (comparable to "mkdir -p" in Unix). + * + * @param element + * a named element + * @return folder for this element + */ + public File getContainer(NamedElement element) { + try { + File folder = getFile(baseFolder, subFolderName); + EList namespaces = element.allNamespaces(); + for (int i = namespaces.size() - 1; i >= 0; i--) { + Namespace ns = namespaces.get(i); + folder = getFile(folder, ns.getName()); + if (!folder.exists()) { + // if packageContainer is a Project, it necessarily exists + folder.createNewFile(); + } + } + return folder; + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * Return a container (folder) for a given filename. + * Folders will be created, if the do not exist (comparable to "mkdir -p" in Unix). + * + * @param filename + * a filename with the '/' as separation character + * @return file for this element + */ + public File getFile(String filename) { + String paths[] = filename.split("/"); //$NON-NLS-1$ + File folder = getFile(baseFolder, subFolderName); + try { + for (int i = 0; i < paths.length - 1; i++) { + String path = paths[i]; + folder = getFile(folder, path); + if (!folder.exists()) { + // if packageContainer is a Project, it necessarily exists + folder.createNewFile(); + } + } + String last = paths[paths.length - 1]; + return getFile(folder, last); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public File getFile(File folder, String fileName) { + return new File(folder, fileName); + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Messages.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Messages.java new file mode 100644 index 00000000000..3d66d4250c7 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/Messages.java @@ -0,0 +1,15 @@ +package org.eclipse.papyrus.codegen.base; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.acceleo.messages"; //$NON-NLS-1$ + public static String ModelElementsCreator_UnsupportedModelElement; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ModelElementsCreator.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ModelElementsCreator.java new file mode 100644 index 00000000000..ed1acce196a --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ModelElementsCreator.java @@ -0,0 +1,141 @@ +/******************************************************************************* + * Copyright (c) 2006 - 2012 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.codegen.base; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; + + +/** + * Main class of code generator. This is an abstract class that is supposed to be overriden by language specific code generators + */ +abstract public class ModelElementsCreator { + + protected ILocationStrategy locStrategy; + + protected IPFileSystemAccess fileSystemAccess; + + /** + * + * Constructor. + * + * @param project + * the project in which the generated code should be placed + * @param fileSystemAccess + * a file system access implementation + * @param locStrategy + * a strategy that chooses suitable file names for generated code. + */ + public ModelElementsCreator(IPFileSystemAccess fileSystemAccess, ILocationStrategy locStrategy) { + this.fileSystemAccess = fileSystemAccess; + this.locStrategy = locStrategy; + } + + /** + * Obtain fileName of file(s) generated for a named element. Delegates to location strategy. + * Caller must eventually add extensions. + * + * @param element + * a named element. + * @return + */ + public String getFileName(NamedElement element) { + return locStrategy.getFileName(element); + } + + /** + * Creates the file(s) corresponding to a packageable element. This class needs to be + * implemented by language specific model elements + * + * @param folder + * @param classifier + * @throws CoreException + */ + abstract protected void createPackageableElementFile(PackageableElement classifier, IProgressMonitor monitor); + + /** + * Return true, if no code should be generated for a certain element + * + * @param element + * @return + */ + abstract protected boolean noCodeGen(Element element); + + + /** + * Main function for user calls. Creates code for a packageable element. In case of a passed package, the contained elements + * are generated recursively. + * + * @param monitor + * a progress monitor + * @param element + * the element for which code should be generated + * @throws CoreException + */ + public void createPackageableElement(PackageableElement element, IProgressMonitor monitor) { + createPackageableElement(element, monitor, true); + } + + /** + * Variant of main function: user may supply explicit container (also used by internal function to avoid + * re-calculating the entry container for each element). + * + * @param packageContainer + * The container (directory), in which code should be created + * @param monitor + * a progress monitor + * @param element + * the element for which code should be generated + * @throws CoreException + */ + public void createPackageableElement(PackageableElement element, IProgressMonitor monitor, boolean recursive) + { + if (noCodeGen(element)) { + return; + } + + if (element instanceof Package) { + Package pkg = (Package) element; + if (monitor != null) { + monitor.subTask("generate package " + element.getQualifiedName()); //$NON-NLS-1$ + } + + createPackageableElementFile(element, monitor); + + if (recursive) { + // Continue generation parsing package contents + for (PackageableElement subElement : pkg.getPackagedElements()) { + createPackageableElement(subElement, monitor, recursive); + } + } + } + else { + createPackageableElementFile(element, monitor); + } + } + + /** + * Remove elements (used for differential code generation) + * + * @param monitor + * @param element + * @throws CoreException + */ + public void removePackageableElement(PackageableElement element, IProgressMonitor monitor) { + String fileName = getFileName(element); + fileSystemAccess.deleteFile(fileName); // need recursion support? + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ProjectBasedFileAccess.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ProjectBasedFileAccess.java new file mode 100644 index 00000000000..17b6e97948c --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/ProjectBasedFileAccess.java @@ -0,0 +1,158 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.codegen.base; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; + +/** + * A simple class providing access to the file system, if the project is known + * + */ +public class ProjectBasedFileAccess implements IPFileSystemAccess { + + IProject project; + + String subFolderName; + + boolean force = true; + + /** + * Create a project based file access for a specific project. + * + * @param project + * the project for which file system access is provided + */ + public ProjectBasedFileAccess(IProject project) { + this.project = project; + subFolderName = null; + } + + /** + * Create a project based file access for a specific project. + * + * @param project + * the project for which file system access is provided + */ + public ProjectBasedFileAccess(IProject project, String subFolderName) { + this.project = project; + this.subFolderName = subFolderName; + } + + /** + * @see org.eclipse.IPFileSystemAccess.generator.IFileSystemAccess#generateFile(java.lang.String, java.lang.CharSequence) + * + * @param fileName + * @param contents + */ + public void generateFile(String fileName, String content) { + IFile file = getFile(fileName); + InputStream contentStream = new ByteArrayInputStream(content.getBytes()); + try { + if (file.exists()) { + if (force) { + file.setContents(contentStream, true, false, null); + } + // else - file is not updated + } + else { + // the file does not exists + file.create(contentStream, true, null); + } + // Refresh the container for the newly created files. This needs to be done even + // during error because of the possibility for partial results. + file.refreshLocal(IResource.DEPTH_INFINITE, null); + } catch (CoreException e) { + throw new RuntimeException("Code generation: " + e.getMessage()); //$NON-NLS-1$ + } + } + + /** + * @see org.eclipse.IPFileSystemAccess.generator.IFileSystemAccess#deleteFile(java.lang.String) + * + * @param fileName + */ + public void deleteFile(String fileName) { + // TODO Auto-generated method stub + + } + + public void setProject(IProject project) { + this.project = project; + } + + public void setProject(IProject project, String subFolderName) { + this.project = project; + this.subFolderName = subFolderName; + } + + + + /** + * Return a container (folder) for a given filename. + * Folders will be created, if the do not exist (comparable to "mkdir -p" in Unix). + * + * @param filename + * a filename with the '/' as separation character + * @return file for this element + */ + public IFile getFile(String filename) { + String paths[] = filename.split("/"); //$NON-NLS-1$ + IContainer packageContainer = getFolder(project, subFolderName); + try { + for (int i = 0; i < paths.length - 1; i++) { + String path = paths[i]; + packageContainer = getFolder(packageContainer, path); + if (!packageContainer.exists()) { + // if packageContainer is a Project, it necessarily exists + ((IFolder) packageContainer).create(false, true, null); + } + } + String last = paths[paths.length - 1]; + return getFile(packageContainer, last); + } catch (CoreException e) { + throw new RuntimeException(e); + } + } + + public IContainer getFolder(IContainer container, String folderName) { + if (folderName == null) { + return container; + } + if (container instanceof IFolder) { + return ((IFolder) container).getFolder(folderName); + } + else if (container instanceof IProject) { + return ((IProject) container).getFolder(folderName); + } + return null; + } + + public IFile getFile(IContainer container, String fileName) { + if (container instanceof IFolder) { + return ((IFolder) container).getFile(fileName); + } + else if (container instanceof IProject) { + return ((IProject) container).getFile(fileName); + } + return null; + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ChangeObject.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ChangeObject.java new file mode 100644 index 00000000000..e380ed65c45 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ChangeObject.java @@ -0,0 +1,32 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.codegen.base.codesync; + +import org.eclipse.emf.ecore.EObject; + +/** + * Simple data type that stores the tuple of event-type and associated e-Object + */ +public class ChangeObject { + /** + * The eventType. @link org.eclipse.emf.common.notify.Notification + */ + public int eventType; + + /** + * The associated EObject + */ + public EObject eObject; +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ManageChangeEvents.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ManageChangeEvents.java new file mode 100644 index 00000000000..fdac34742d7 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/ManageChangeEvents.java @@ -0,0 +1,137 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) Ansgar.Radermacher@cea.fr - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.codegen.base.codesync; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.papyrus.codegen.base.Activator; +import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor; +import org.eclipse.papyrus.infra.core.services.EditorLifecycleEventListener; +import org.eclipse.papyrus.infra.core.services.EditorLifecycleManager; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.services.ServicesRegistry; +import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForResourceSet; + +/** + * Manage and update change events for incremental code generation + */ +public class ManageChangeEvents { + + protected static Map registeredListeners = + new HashMap(); + + /** + * An internal listener for life cycle events of Papyrus + */ + protected static class LifeCycleListener implements EditorLifecycleEventListener { + + TransactionalEditingDomain domain; + + LifeCycleListener(TransactionalEditingDomain domain) { + this.domain = domain; + } + + public void postInit(IMultiDiagramEditor editor) { + } + + public void postDisplay(IMultiDiagramEditor editor) { + } + + /** + * Executed before an editor will close => stop recording for this editing domain + */ + public void beforeClose(IMultiDiagramEditor editor) { + stopRecording(domain); + } + } + + /** + * Start recording changes for an editing domain + * + * @param domain + * a transactional editing domain. Can be obtained via TransactionUtil from an EObject + */ + public static void startRecording(TransactionalEditingDomain domain) { + if (!registeredListeners.containsKey(domain)) { + RecordEventsListener recordEvents = new RecordEventsListener(); + registeredListeners.put(domain, recordEvents); + // register a listener that records events + domain.addResourceSetListener(recordEvents); + + // register a listener for editor lifecycle events, in order to + // cleanup the set of registered listeners after the editor is closed. + try { + ServicesRegistry registry = ServiceUtilsForResourceSet.getInstance().getServiceRegistry( + domain.getResourceSet()); + EditorLifecycleManager lifecycleManager = registry.getService(EditorLifecycleManager.class); + lifecycleManager.addEditorLifecycleEventsListener(new LifeCycleListener(domain)); + } catch (ServiceException e) { + Activator.log.error(e); + } + } + + } + + /** + * Stop recording changes for an editing domain + * + * @param domain + * a transactional editing domain. Can be obtained via TransactionUtil from an EObject + */ + public static void stopRecording(TransactionalEditingDomain domain) { + RecordEventsListener recordEvents = registeredListeners.get(domain); + if (recordEvents != null) { + domain.removeResourceSetListener(recordEvents); + } + registeredListeners.remove(domain); + } + + /** + * Get the list of changes for an editing domain + * + * @param domain + * a transactional editing domain. Can be obtained via TransactionUtil from an EObject + * @return the list of changes or null, if there is currently no event listener (which means + * typcially, that event recording has not been started yet) + */ + public static EList getChangeList(TransactionalEditingDomain domain) { + RecordEventsListener recordEvents = registeredListeners.get(domain); + if (recordEvents != null) { + return recordEvents.getChangeList(); + } + return null; + } + + /** + * initialize the difference list for an editing domain + * + * @param domain + * a transactional editing domain. Can be obtained via TransactionUtil from an EObject + * @param startAutomatically + * if true, start event recording, if there is currently no event recording active + */ + public static void initChangeList(TransactionalEditingDomain domain, boolean startAutomatically) { + RecordEventsListener recordEvents = registeredListeners.get(domain); + if (recordEvents != null) { + recordEvents.initChangeList(); + } + else if (startAutomatically) { + startRecording(domain); + } + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/RecordEventsListener.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/RecordEventsListener.java new file mode 100644 index 00000000000..8ae6ee95b1d --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/codesync/RecordEventsListener.java @@ -0,0 +1,110 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.codegen.base.codesync; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EAnnotation; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.NotificationFilter; +import org.eclipse.emf.transaction.ResourceSetChangeEvent; +import org.eclipse.emf.transaction.ResourceSetListener; +import org.eclipse.emf.transaction.RollbackException; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * This listener is used to register ADD ant SET about in the diff model during + * the launch of the revision mode. It also create review element in the review + * model. See package commands for specification of review creation commands. + * + */ +public class RecordEventsListener implements ResourceSetListener { + + protected EList changeList; + + /** + * constructor + * + * @param reviewResourceManager + */ + public RecordEventsListener() { + changeList = new BasicEList(); + } + + public NotificationFilter getFilter() { + return null; + } + + /** + * @return the list of recorded change events + */ + public EList getChangeList() { + return changeList; + } + + /** + * initialize (reset) the list of recorded changes + */ + public void initChangeList() { + changeList.clear(); + } + + @Override + public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException { + for (Notification notification : event.getNotifications()) { + int eventType = notification.getEventType(); + if (notification.getNotifier() instanceof EObject) { + EObject notifier = (EObject) notification.getNotifier(); + + EObject baseElement = UMLUtil.getBaseElement(notifier); + if (baseElement != null) { + notifier = baseElement; + } + if ((eventType != Notification.REMOVING_ADAPTER) && (eventType != Notification.RESOLVE)) { + if ((notifier instanceof Element) || (notifier instanceof EAnnotation)) { + ChangeObject changeObject = new ChangeObject(); + changeObject.eventType = notification.getEventType(); + changeObject.eObject = notifier; + changeList.add(changeObject); + } + } + } + } + return null; + } + + @Override + public void resourceSetChanged(ResourceSetChangeEvent event) { + + } + + @Override + public boolean isAggregatePrecommitListener() { + return false; + } + + @Override + public boolean isPrecommitOnly() { + return false; + } + + @Override + public boolean isPostcommitOnly() { + return false; + } + +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/messages.properties b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/messages.properties new file mode 100644 index 00000000000..ad6e5a9fa79 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base/src/org/eclipse/papyrus/codegen/base/messages.properties @@ -0,0 +1 @@ +ModelElementsCreator_UnsupportedModelElement=code generator: unsupported model element %s diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/.classpath b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/.project b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/.project new file mode 100644 index 00000000000..24d01935406 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.codegen.extensionpoints + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c537b63063c --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..ac580de577f --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/META-INF/MANIFEST.MF @@ -0,0 +1,17 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.uml2.uml;bundle-version="4.0.2", + org.eclipse.core.filesystem;bundle-version="1.3.200", + org.eclipse.core.resources, + org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0" +Export-Package: org.eclipse.papyrus.codegen.extensionpoints +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.codegen.extensionpoints.Activator +Bundle-SymbolicName: org.eclipse.papyrus.codegen.extensionpoints;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/about.html b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/build.properties b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/build.properties new file mode 100644 index 00000000000..7e6b2a43702 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties,\ + schema/,\ + plugin.xml +src.includes = about.html diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.properties b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.properties new file mode 100644 index 00000000000..d7801588e2c --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Code generation extensionpoints (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.xml b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.xml new file mode 100644 index 00000000000..95044cba2e2 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/plugin.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/pom.xml b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/pom.xml new file mode 100644 index 00000000000..d5ec9f7c45a --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../releng/extra + + org.eclipse.papyrus.codegen.extensionpoints + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageCodegen.exsd b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageCodegen.exsd new file mode 100644 index 00000000000..7b60f913ef4 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageCodegen.exsd @@ -0,0 +1,84 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ID of a code generator, currently optional for backward compatibility. + + + + + + + Programming language supported by the code generator + + + + + + + A class that provides access to the code generator. It must implement the ILangCodegen interface. + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageProject.exsd b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageProject.exsd new file mode 100644 index 00000000000..c631741cac1 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/schema/languageProject.exsd @@ -0,0 +1,71 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/AbstractSettings.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/AbstractSettings.java new file mode 100644 index 00000000000..75d82ca546b --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/AbstractSettings.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2015 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.codegen.extensionpoints; + +/** + * Abstract superclass for project settings. It is empty to allow for arbitrary + * project specific settings + */ +public abstract class AbstractSettings { + /** + * the operating system for which code should be produced (will have a + * project specific effect, e.g. in case of CDT it will result in a #define) + */ + public String targetOS; +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Activator.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Activator.java new file mode 100644 index 00000000000..c8bcb71a91f --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.codegen.extensionpoints; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.codegen.extensionpoints"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GenerationConstants.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GenerationConstants.java new file mode 100644 index 00000000000..45d46b12c70 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GenerationConstants.java @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.codegen.extensionpoints; + +public class GenerationConstants { + /** + * Constant indicating that generated code follows. Code generators should use this text in bodies, if bodies contain + * generated code (besides the contents of the opaque behaviors. Code generators need to prefix this string with the + * language specific comment symbol, e.g. // in case of C/C++ or Java. + */ + public static final String GENERATED_START = "the following code has been generated"; //$NON-NLS-1$ + + /** + * Constant indicating that generated code ends. Code generators should use this text in bodies, if bodies contain + * generated code (besides the contents of the opaque behaviors. Code generators need to prefix this string with the + * language specific comment symbol, e.g. // in case of C/C++ or Java. + */ + public static final String GENERATED_END = "generated code ends"; //$NON-NLS-1$ +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GeneratorSelectionDialog.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GeneratorSelectionDialog.java new file mode 100644 index 00000000000..fd3066b0ddf --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/GeneratorSelectionDialog.java @@ -0,0 +1,122 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.codegen.extensionpoints; + + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.dialogs.AbstractElementListSelectionDialog; + +/** + * Select a generator from a list of eligible generators + */ +public class GeneratorSelectionDialog extends AbstractElementListSelectionDialog { + + protected Text m_description; + + ILangCodegen generators[]; + + public GeneratorSelectionDialog(Shell parent, List generatorList) { + super(parent, new LabelProvider() { + public String getText(Object element) { + return LanguageCodegen.getID((ILangCodegen) element); + } + }); + generators = generatorList.toArray(new ILangCodegen[0]); + setMultipleSelection(false); + setTitle(Messages.GeneratorSelectionDialog_SelectGenerator); + } + + @Override + public Control createDialogArea(Composite parent) { + Composite contents = (Composite) super.createDialogArea(parent); + createMessageArea(contents); + // createLabel(contents, "Connector type"); + // GridData gridData = DialogUtils.createFillGridData(); + // gridData.heightHint = 200; + + createFilteredList(contents); + createFilterText(contents); + + fFilteredList.setElements(generators); + + Label info = createMessageArea(contents); + info.setText(Messages.GeneratorSelectionDialog_infoCodeGen); + // m_description = createMessageArea(contents); + + fFilteredList.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + int index = fFilteredList.getSelectionIndex(); + updateDescription(getElement(index)); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + GridData descriptionGD = new GridData(); + descriptionGD.horizontalAlignment = GridData.FILL; + descriptionGD.grabExcessHorizontalSpace = true; + descriptionGD.heightHint = 80; + descriptionGD.grabExcessVerticalSpace = true; + descriptionGD.verticalAlignment = GridData.FILL; + + m_description = new Text(contents, SWT.NONE | SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY); + m_description.setLayoutData(descriptionGD); + updateDescription(getElement(0)); + + return contents; + } + + protected void updateDescription(ILangCodegen codegen) { + if (codegen instanceof ILangCodegen2) { + m_description.setText(((ILangCodegen2) codegen).getDescription()); + } + else { + m_description.setText("not available"); //$NON-NLS-1$ + } + } + + /** + * Obtain ILangCodegen object via index. Note that we need to access the data from the filtered list + * since the order might not be the same as the local "generators" array (the filtered list sorts) + * @param index + * @return + */ + ILangCodegen getElement(int index) { + return (ILangCodegen) fFilteredList.getFoldedElements(index)[0]; + } + + @Override + protected void computeResult() { + int index = fFilteredList.getSelectionIndex(); + Object[] result = new Object[] { getElement(index) }; + setResult(Arrays.asList(result)); + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen.java new file mode 100644 index 00000000000..9c1c5fa8371 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright (c) 2015 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.codegen.extensionpoints; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.PackageableElement; + +/** + * Extension point that is implemented by a code generator for a specific + * programming language + */ +public interface ILangCodegen { + + /** + * FILE KIND enumeration. It supports two distinction options (this might + * need revision in the future, but is sufficient for all currently + * supported languages) + */ + public enum FILE_KIND { + HEADER, BODY + } + + /** + * Generate code for a specific language + * + * @param project + * a project into which code is generated. if null, project is + * determined automatically (see getTargetProject below) + * @param element + * a packageable element, typically a classifier or a package + * @param monitor + * a progress monitor + */ + public void generateCode(IProject project, PackageableElement element, IProgressMonitor monitor); + + /** + * Code might be generated into a specific project. It might be the project + * that hosts the UML file, but it may also be another project that is + * determined for instance by means of a naming convention (such as a common + * prefix and the name of the model). This functions locates and returns the + * target project for the given packageable element. If the project exists, + * but does not have the nature that is required by the language specific + * editor, the user is asked whether the nature should be added. + * + * Ensures that the target project is correctly setup to contain generated + * C/C++ code. Does not create a new project, but may modify existing ones. + * + * @param pe + * a packageable element within a model + * @param createIfMissing + * if true, a new project is created if it does not exist yet. if + * false, null is returned if the project does not exist. + * @return the associated project (or null) + */ + public IProject getTargetProject(PackageableElement pe, boolean createIfMissing); + + /** + * Obtain fileName of file(s) generated for a named element. Delegates to + * location strategy. Caller must eventually add extensions. + * + * @param project + * a project into which code is generated. if null, project is + * determined automatically + * @param element + * a named element. + * @return a project relative file name + */ + public String getFileName(IProject project, NamedElement element); + + /** + * Clean the code for a certain element, i.e. remove code that has + * previously generated for this element This code is required for + * differential code generation which needs to remove elements for instance + * after they have been renamed. + * + * @param project + * project in which code should be generated + * @param element + * the element for which the generate code should be removed + */ + public void cleanCode(IProject project, PackageableElement element, IProgressMonitor monitor); +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen2.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen2.java new file mode 100644 index 00000000000..1cf48b4455a --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangCodegen2.java @@ -0,0 +1,58 @@ +package org.eclipse.papyrus.codegen.extensionpoints; + +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; + +public interface ILangCodegen2 extends ILangCodegen { + + /** + * Provide a user friendly description of the generator + */ + public String getDescription(); + + /** + * Some code generators use a non-trivial mapping from behaviors to methods + * in the generated code or add methods that are not part of a existing + * behavior in the model. This is a problem for code synchronization (update + * of model from code) as done for instance with the CDT editor integration. + * + * @param methodName + * the name of the method as in the code + * @param body + * the body + * @return the associated synchronization information. Null indicates that a + * default mapping is used + */ + public SyncInformation getSyncInformation(String methodName, String body); + + /** + * Return true, if the generator is eligible for a certain element within a + * model. The code generator may check the element itself, but also for + * instance whether a certain profile (such as UML-RT) has been applied. + * Generators are allowed to return true for all models, if they do not have + * specific (profile related) requirements. + * + * @param modelRoot + * the root of a UML model (for which code should be generated) + * @return true, iff the generator is eligible for this model + */ + public boolean isEligible(Element modelElement); + + /** + * Return the suffix of a code generator. Some languages use different + * suffixes depending on the file kind, e.g. C distinguishes between HEADER + * and BODY languages. Other languages can ignore this parameter. + * + * @param FILE_KIND + * The file kind + * @return + */ + public String getSuffix(FILE_KIND fileKind); + + /** + * return additional information about the method that has been generated + * for a UML behavior. This information is used by the CDT editor + * integration to locate the method in the code. + */ + public MethodInfo getMethodInfo(NamedElement operationOrBehavior); +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangProjectSupport.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangProjectSupport.java new file mode 100644 index 00000000000..883ba90b22a --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/ILangProjectSupport.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (c) 2011 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - ansgar.radermacher@cea.fr initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.codegen.extensionpoints; + +import org.eclipse.core.resources.IProject; +import org.eclipse.uml2.uml.Class; + +/** + * Common interface to create projects for a specific programming language. + */ +public interface ILangProjectSupport { + + /** + * Create a project for a specific language and configure it (according to + * gathered configuration data before). In case of C/C++ for instance, a CDT + * project should be created, in case of Java, a JDT project. An + * implementation should call setProject and setSettings before returning + * the project + * + * @param projectName + * the named of the project + * @return the created project + */ + public IProject createProject(String projectName); + + /** + * Write the project settings from the passed project specific settings. + * (which may be obtained via gatherConfigData). + * + * @param the + * operating system for which code should be produced + */ + public void setSettings(IProject project, AbstractSettings settings); + + /** + * Create an initial (empty) configuration. + * @return the project specific configuration. + */ + public AbstractSettings initialConfigurationData(); + + /** + * Gather configuration data from implementations, e.g. required include + * paths or libraries. It will enrich the project specific settings. + * + * @param implementation + * a class copied to the target + */ + public void gatherConfigData(Class implementation, AbstractSettings settings); +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageCodegen.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageCodegen.java new file mode 100644 index 00000000000..2bb0796017c --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageCodegen.java @@ -0,0 +1,214 @@ +/******************************************************************************* + * Copyright (c) 2015 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - ansgar.radermacher@cea.fr initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.codegen.extensionpoints; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.uml2.uml.Classifier; + +/** + * Common interface to generate code. Supports for multiple target languages via + * the Eclipse extension mechanism + */ +public class LanguageCodegen { + + private static final String CLASS = "class"; //$NON-NLS-1$ + + private static final String LANGUAGE = "language";//$NON-NLS-1$ + + private static final String ID = "id";//$NON-NLS-1$ + + public static final String ILANG_SUPPORT_ID = Activator.PLUGIN_ID + ".languageCodegen"; //$NON-NLS-1$ + + /** + * Interactively choose a generator for a given set of languages (pattern). + * If only one generator is available, it returns this generator + * immediately. + * + * @param languagePattern + * @param classifier + * @return + */ + public static ILangCodegen chooseGenerator(Pattern languagePattern, Classifier classifier) { + List eligibleGenerators = getEligibleGeneratorList(languagePattern, classifier); + + if (eligibleGenerators.size() == 1) { + return eligibleGenerators.get(0); + } + Shell shell = Display.getDefault().getActiveShell(); + if (eligibleGenerators.size() > 1) { + GeneratorSelectionDialog dialog = new GeneratorSelectionDialog(shell, eligibleGenerators); + if (dialog.open() == IDialogConstants.OK_ID) { + return (ILangCodegen) dialog.getResult()[0]; + } + } + else { + // echo language pattern in a more readible way: without escape characters that are used for + // the "+" in C++ + String pattern = languagePattern.pattern().replace("\\", ""); //$NON-NLS-1$ //$NON-NLS-2$ + MessageDialog.openError(shell, Messages.LanguageCodegen_NoGeneratorsFound, + String.format(Messages.LanguageCodegen_NoGeneratorsFoundLong, pattern)); + } + + return null; + } + + /** + * Get a code generator via language and ID. + * + * @param languagePattern + * a pattern containing a list of supported languages + * @return a code generator + */ + public static ILangCodegen getGenerator(String language) { + // compile language into a pattern, escape "+" + return getGenerator(Pattern.compile(language.replace("+", "\\+")), null); //$NON-NLS-1$//$NON-NLS-2$ + } + + /** + * Get a code generator via language and ID. + * + * @param languagePattern + * a pattern containing a list of supported languages + * @return a code generator + */ + public static ILangCodegen getGenerator(String language, String id) { + return getGenerator(Pattern.compile(language), id); + } + + /** + * Get a code generator via language and ID. + * + * @param languagePattern + * a pattern containing a list of supported languages + * @param id + * a string determining the id of the code generator. If null, + * the first available generator is returned. + * @return a code generator + */ + public static ILangCodegen getGenerator(Pattern languagePattern, String id) { + List generators = getCodegenList(languagePattern); + for (ILangCodegen generator : generators) { + if ((id == null) || generatorIDs.get(generator).equals(id)) { + return generator; + } + } + throw new RuntimeException(String.format(Messages.LanguageSupport_LanguageNotSupported, languagePattern)); + } + + /** + * Get a list of generators that conform a language patterns and are + * eligible for a passe classifier + * + * @param languagePattern + * a language pattern + * @param classifier + * a classifier + * @return + */ + public static List getEligibleGeneratorList(Pattern languagePattern, Classifier classifier) { + List eligibleGenerators = new ArrayList(); + for (ILangCodegen generator : getCodegenList(languagePattern)) { + if (generator instanceof ILangCodegen2) { + if (((ILangCodegen2) generator).isEligible(classifier)) { + eligibleGenerators.add(generator); + } + } + else { + eligibleGenerators.add(generator); + } + } + return eligibleGenerators; + } + + /** + * retrieve a list of code generators for a given language. The language may + * be a regular expression + * + * @param language + * @return + */ + public static List getCodegenList(Pattern languagePattern) { + IExtensionRegistry reg = Platform.getExtensionRegistry(); + IConfigurationElement[] configElements = reg.getConfigurationElementsFor(ILANG_SUPPORT_ID); + List generators = new ArrayList(); + + for (IConfigurationElement configElement : configElements) { + try { + final String id = configElement.getAttribute(ID); + final String extLanguage = configElement.getAttribute(LANGUAGE); + Matcher m = languagePattern.matcher(extLanguage); + if (m.matches()) { + final Object obj = configElement.createExecutableExtension(CLASS); + if (obj instanceof ILangCodegen) { + ILangCodegen generator = (ILangCodegen) obj; + if (!generatorIDs.containsKey(generator)) { + generatorIDs.put(generator, id); + } + generators.add((ILangCodegen) obj); + } + } + } catch (CoreException exception) { + exception.printStackTrace(); + } + } + return generators; + } + + /** + * Get a code generator for a given language + * @param language + * @return + * @deprecated This method is deprecated and kept for compatibility, since there could be more than one generator + * for a given programming language. + */ + @Deprecated + public static ILangCodegen getCodegen(String language) + { + IExtensionRegistry reg = Platform.getExtensionRegistry(); + IConfigurationElement[] configElements = reg.getConfigurationElementsFor(ILANG_SUPPORT_ID); + for (IConfigurationElement configElement : configElements) { + try { + final String extLanguage = configElement.getAttribute(LANGUAGE); + if (extLanguage.equals(language)) { + // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) + final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ + if (obj instanceof ILangCodegen) { + return (ILangCodegen) obj; + } + } + } catch (CoreException exception) { + exception.printStackTrace(); + } + } + throw new RuntimeException(String.format(Messages.LanguageSupport_LanguageNotSupported, language)); + } + + public static String getID(ILangCodegen generator) { + return generatorIDs.get(generator); + } + + static Map generatorIDs = new HashMap(); +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageProjectSupport.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageProjectSupport.java new file mode 100644 index 00000000000..031993d2adb --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/LanguageProjectSupport.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2015 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - ansgar.radermacher@cea.fr initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.codegen.extensionpoints; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; + +/** + * Support for multiple target languages via the Eclipse extension mechanism + */ +public class LanguageProjectSupport { + + public static final String ILANG_SUPPORT_ID = Activator.PLUGIN_ID + ".languageProjectSupport"; //$NON-NLS-1$ + + /** + * Get the project support for a given language editor. + * + * @param language + * a programming language + * @return the project support + */ + public static ILangProjectSupport getProjectSupport(String language) { + IExtensionRegistry reg = Platform.getExtensionRegistry(); + IConfigurationElement[] configElements = reg.getConfigurationElementsFor(ILANG_SUPPORT_ID); + for (IConfigurationElement configElement : configElements) { + try { + final String extLanguage = configElement.getAttribute("language"); //$NON-NLS-1$ + if (extLanguage.equals(language)) { + final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ + if (obj instanceof ILangProjectSupport) { + return (ILangProjectSupport) obj; + } + } + } catch (CoreException exception) { + exception.printStackTrace(); + } + } + throw new RuntimeException(String.format(Messages.LanguageSupport_LanguageNotSupported, language)); + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Messages.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Messages.java new file mode 100644 index 00000000000..7ef890e1a85 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/Messages.java @@ -0,0 +1,20 @@ +package org.eclipse.papyrus.codegen.extensionpoints; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.codegen.extensionpoints.messages"; //$NON-NLS-1$ + public static String GeneratorSelectionDialog_infoCodeGen; + public static String GeneratorSelectionDialog_SelectGenerator; + public static String LanguageCodegen_NoGeneratorsFound; + public static String LanguageCodegen_NoGeneratorsFoundLong; + public static String LanguageSupport_LanguageNotSupported; + public static String ModelElementsCreator_UnsupportedModelElement; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/MethodInfo.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/MethodInfo.java new file mode 100644 index 00000000000..3886c365d17 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/MethodInfo.java @@ -0,0 +1,124 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.codegen.extensionpoints; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.ParameterDirectionKind; + +/** + * Additional information about a method that has been generated for a UML behavior. + * This information is used by the CDT editor integration to locate the method in the code, but might be useful + * for other languages as well. + */ +public class MethodInfo { + + /** + * Create a new method info with a given name. The parameter list is initially empty. + * Parameter types can be added with the method addParameterType + * can be initialized later. + * @param name + */ + public MethodInfo(String name) { + this.name = name; + this.parameterTypes = new ArrayList(); + } + + /** + * Create a new method info + * @param name + * @param parameterTypes + */ + public MethodInfo(String name, List parameterTypes) { + this.name = name; + this.parameterTypes = parameterTypes; + } + + /** + * constructor creating a default method information instance from a given behavior + * @param behavior + */ + public static MethodInfo fromBehavior(Behavior behavior) { + MethodInfo mi = new MethodInfo(behavior.getName()); + for (Parameter parameter : behavior.getOwnedParameters()) { + if (parameter.getDirection() != ParameterDirectionKind.RETURN_LITERAL) { + if (parameter.getType() != null) { + mi.addParameterType(parameter.getType().getQualifiedName()); + } + } + else { + mi.addParameterType("undefined"); //$NON-NLS-1$ + } + } + return mi; + } + + /** + * default initializer from a method + * @param behavior + */ + public static MethodInfo fromOperation(Operation operation) { + MethodInfo mi = new MethodInfo(operation.getName()); + for (Parameter parameter : operation.getOwnedParameters()) { + if (parameter.getDirection() != ParameterDirectionKind.RETURN_LITERAL) { + if (parameter.getType() != null) { + mi.addParameterType(parameter.getType().getQualifiedName()); + } + } + else { + mi.addParameterType("undefined"); //$NON-NLS-1$ + } + } + return mi; + } + + /** + * Add a parameter type + * + * @param parameterType the parameter type + */ + public void addParameterType(String parameterType) { + parameterTypes.add(parameterType); + } + + /** + * @return method name + */ + public String getName() { + return name; + } + + /** + * @return list of parameters types (in form of strings). These might contain additional + * modifiers, e.g. { "const char*" } + */ + public List getParameterTypes() { + return parameterTypes; + } + + /** + * The name of the generated method. + */ + protected String name; + + /** + * The names of parameter types + */ + protected List parameterTypes; +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/SyncInformation.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/SyncInformation.java new file mode 100644 index 00000000000..82f5d4e4af9 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/SyncInformation.java @@ -0,0 +1,39 @@ +package org.eclipse.papyrus.codegen.extensionpoints; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Behavior; + +/** + * Some code generators map behaviors in a non-trivial way or add methods that have not been generated. + * The following information allows (generic) synchronization code, as within the CDT editor to + * make a useful update of the source model. + */ +public class SyncInformation { + /** + * true, iff the method has been added by the generator and does not need synchronization. + */ + public boolean isGenerated; + + /** + * the associated behavior within the source model, in case of a non-trivial method. + * If the element does not exist yet in the source model, it may be null. + */ + public Behavior behavior; + + /* + * The qualified name of a behavior to create in the model. This is used, if there should be an associated behavior in the + * model, but it does not exist yet. Only one of the two attributes (behavior and createBehaviorName) must be set. + */ + public String createBehaviorName; + + /** + * the element for which the CDT editor has been opened. This may for instance be the class that is edited. + */ + public EObject editedElement; + + /** + * The method body gets filtered during default synchronization (text between generation markers is removed), but the filtered information might be + * important for customized back-synchronization. + */ + public String unfilteredBody; +} \ No newline at end of file diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/messages.properties b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/messages.properties new file mode 100644 index 00000000000..72942846feb --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints/src/org/eclipse/papyrus/codegen/extensionpoints/messages.properties @@ -0,0 +1,6 @@ +GeneratorSelectionDialog_infoCodeGen=Information about code generator: +GeneratorSelectionDialog_SelectGenerator=Select a code generator +LanguageCodegen_NoGeneratorsFound=No code generators found +LanguageCodegen_NoGeneratorsFoundLong=No eligible code generators can be found for the language pattern %s +LanguageSupport_LanguageNotSupported=Support for language "%s" not configured +ModelElementsCreator_UnsupportedModelElement=code generator: unsupported model element "%s" diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/.classpath b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/.project b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/.project new file mode 100644 index 00000000000..166c5980713 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.texteditor.model + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..4b8a8b4deec --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport +Export-Package: org.eclipse.papyrus.texteditor.model.texteditormodel, + org.eclipse.papyrus.texteditor.model.texteditormodel.impl, + org.eclipse.papyrus.texteditor.model.texteditormodel.util +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-ManifestVersion: 2 +Bundle-Description: %pluginDescription +Bundle-SymbolicName: org.eclipse.papyrus.texteditor.model;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/about.html b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/build.properties b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/build.properties new file mode 100644 index 00000000000..83183307edb --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/build.properties @@ -0,0 +1,22 @@ +# Copyright (c) 2012 CEA LIST. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation +# + +bin.includes = .,\ + model/,\ + META-INF/,\ + plugin.xml,\ + about.html,\ + plugin.properties,\ + build.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ +src.includes = about.html diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.ecore b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.ecore new file mode 100644 index 00000000000..9a9647a4907 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.ecore @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.genmodel b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.genmodel new file mode 100644 index 00000000000..37ae28a3a40 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/model/texteditormodel.genmodel @@ -0,0 +1,19 @@ + + + texteditormodel.ecore + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/plugin.properties b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/plugin.properties new file mode 100644 index 00000000000..8f2b155a923 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/plugin.properties @@ -0,0 +1,15 @@ +# Copyright (c) 2012 CEA LIST. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation +# (with the help of examining table support from Vincent Lorenzo) +# +pluginName = Ecore model for text editors (Incubation) +providerName = Eclipse Modeling Project + +pluginDescription=This plugin provides the content model for the papyrus text editor diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/plugin.xml b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/plugin.xml new file mode 100644 index 00000000000..444ce844d4c --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/plugin.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/pom.xml b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/pom.xml new file mode 100644 index 00000000000..44e5f92bb71 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../releng/extra + + org.eclipse.papyrus.texteditor.model + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModel.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModel.java new file mode 100644 index 00000000000..bc2a6b449b1 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModel.java @@ -0,0 +1,191 @@ +/** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + */ +package org.eclipse.papyrus.texteditor.model.texteditormodel; + +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Text Editor Model'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getEditedObject Edited Object}
    • + *
    • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getType Type}
    • + *
    • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getName Name}
    • + *
    • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getSelectedObject Selected Object}
    • + *
    • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getLineNumber Line Number}
    • + *
    • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getGeneratorID Generator ID}
    • + *
    + * + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel() + * @model + * @generated + */ +public interface TextEditorModel extends EModelElement { + /** + * Returns the value of the 'Edited Object' reference. + * + *

    + * If the meaning of the 'Edited Object' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Edited Object' reference. + * @see #setEditedObject(EObject) + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel_EditedObject() + * @model + * @generated + */ + EObject getEditedObject(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getEditedObject Edited Object}' reference. + * + * + * @param value the new value of the 'Edited Object' reference. + * @see #getEditedObject() + * @generated + */ + void setEditedObject(EObject value); + + /** + * Returns the value of the 'Type' attribute. + * + *

    + * If the meaning of the 'Type' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Type' attribute. + * @see #setType(String) + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel_Type() + * @model + * @generated + */ + String getType(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getType Type}' attribute. + * + * + * @param value the new value of the 'Type' attribute. + * @see #getType() + * @generated + */ + void setType(String value); + + /** + * Returns the value of the 'Name' attribute. + * + *

    + * If the meaning of the 'Name' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Selected Object' reference. + * + *

    + * If the meaning of the 'Selected Object' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Selected Object' reference. + * @see #setSelectedObject(EObject) + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel_SelectedObject() + * @model + * @generated + */ + EObject getSelectedObject(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getSelectedObject Selected Object}' reference. + * + * + * @param value the new value of the 'Selected Object' reference. + * @see #getSelectedObject() + * @generated + */ + void setSelectedObject(EObject value); + + /** + * Returns the value of the 'Line Number' attribute. + * + *

    + * If the meaning of the 'Line Number' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Line Number' attribute. + * @see #setLineNumber(int) + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel_LineNumber() + * @model + * @generated + */ + int getLineNumber(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getLineNumber Line Number}' attribute. + * + * + * @param value the new value of the 'Line Number' attribute. + * @see #getLineNumber() + * @generated + */ + void setLineNumber(int value); + + /** + * Returns the value of the 'Generator ID' attribute. + * + *

    + * If the meaning of the 'Generator ID' attribute isn't clear, + * there really should be more of a description here... + *

    + * + * @return the value of the 'Generator ID' attribute. + * @see #setGeneratorID(String) + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#getTextEditorModel_GeneratorID() + * @model + * @generated + */ + String getGeneratorID(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getGeneratorID Generator ID}' attribute. + * + * + * @param value the new value of the 'Generator ID' attribute. + * @see #getGeneratorID() + * @generated + */ + void setGeneratorID(String value); + +} // TextEditorModel diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelFactory.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelFactory.java new file mode 100644 index 00000000000..705f79b8b40 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelFactory.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + */ +package org.eclipse.papyrus.texteditor.model.texteditormodel; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage + * @generated + */ +public interface TextEditorModelFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + TextEditorModelFactory eINSTANCE = org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelFactoryImpl.init(); + + /** + * Returns a new object of class 'Text Editor Model'. + * + * + * @return a new object of class 'Text Editor Model'. + * @generated + */ + TextEditorModel createTextEditorModel(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + TextEditorModelPackage getTextEditorModelPackage(); + +} // TextEditorModelFactory diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelPackage.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelPackage.java new file mode 100644 index 00000000000..25da2ea1bf8 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/TextEditorModelPackage.java @@ -0,0 +1,310 @@ +/** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + */ +package org.eclipse.papyrus.texteditor.model.texteditormodel; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EcorePackage; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
      + *
    • each class,
    • + *
    • each feature of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelFactory + * @model kind="package" + * @generated + */ +public interface TextEditorModelPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "texteditormodel"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.eclipse.org/Papyrus/TextEditor/0.10.0/texteditormodel"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "texteditormodel"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + TextEditorModelPackage eINSTANCE = org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl Text Editor Model}' class. + * + * + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelPackageImpl#getTextEditorModel() + * @generated + */ + int TEXT_EDITOR_MODEL = 0; + + /** + * The feature id for the 'EAnnotations' containment reference list. + * + * + * @generated + * @ordered + */ + int TEXT_EDITOR_MODEL__EANNOTATIONS = EcorePackage.EMODEL_ELEMENT__EANNOTATIONS; + + /** + * The feature id for the 'Edited Object' reference. + * + * + * @generated + * @ordered + */ + int TEXT_EDITOR_MODEL__EDITED_OBJECT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Type' attribute. + * + * + * @generated + * @ordered + */ + int TEXT_EDITOR_MODEL__TYPE = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int TEXT_EDITOR_MODEL__NAME = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 2; + + /** + * The feature id for the 'Selected Object' reference. + * + * + * @generated + * @ordered + */ + int TEXT_EDITOR_MODEL__SELECTED_OBJECT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 3; + + /** + * The feature id for the 'Line Number' attribute. + * + * + * @generated + * @ordered + */ + int TEXT_EDITOR_MODEL__LINE_NUMBER = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 4; + + /** + * The feature id for the 'Generator ID' attribute. + * + * + * @generated + * @ordered + */ + int TEXT_EDITOR_MODEL__GENERATOR_ID = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 5; + + /** + * The number of structural features of the 'Text Editor Model' class. + * + * + * @generated + * @ordered + */ + int TEXT_EDITOR_MODEL_FEATURE_COUNT = EcorePackage.EMODEL_ELEMENT_FEATURE_COUNT + 6; + + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel Text Editor Model}'. + * + * + * @return the meta object for class 'Text Editor Model'. + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel + * @generated + */ + EClass getTextEditorModel(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getEditedObject Edited Object}'. + * + * + * @return the meta object for the reference 'Edited Object'. + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getEditedObject() + * @see #getTextEditorModel() + * @generated + */ + EReference getTextEditorModel_EditedObject(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getType Type}'. + * + * + * @return the meta object for the attribute 'Type'. + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getType() + * @see #getTextEditorModel() + * @generated + */ + EAttribute getTextEditorModel_Type(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getName() + * @see #getTextEditorModel() + * @generated + */ + EAttribute getTextEditorModel_Name(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getSelectedObject Selected Object}'. + * + * + * @return the meta object for the reference 'Selected Object'. + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getSelectedObject() + * @see #getTextEditorModel() + * @generated + */ + EReference getTextEditorModel_SelectedObject(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getLineNumber Line Number}'. + * + * + * @return the meta object for the attribute 'Line Number'. + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getLineNumber() + * @see #getTextEditorModel() + * @generated + */ + EAttribute getTextEditorModel_LineNumber(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getGeneratorID Generator ID}'. + * + * + * @return the meta object for the attribute 'Generator ID'. + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel#getGeneratorID() + * @see #getTextEditorModel() + * @generated + */ + EAttribute getTextEditorModel_GeneratorID(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + TextEditorModelFactory getTextEditorModelFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
      + *
    • each class,
    • + *
    • each feature of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl Text Editor Model}' class. + * + * + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelPackageImpl#getTextEditorModel() + * @generated + */ + EClass TEXT_EDITOR_MODEL = eINSTANCE.getTextEditorModel(); + + /** + * The meta object literal for the 'Edited Object' reference feature. + * + * + * @generated + */ + EReference TEXT_EDITOR_MODEL__EDITED_OBJECT = eINSTANCE.getTextEditorModel_EditedObject(); + + /** + * The meta object literal for the 'Type' attribute feature. + * + * + * @generated + */ + EAttribute TEXT_EDITOR_MODEL__TYPE = eINSTANCE.getTextEditorModel_Type(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute TEXT_EDITOR_MODEL__NAME = eINSTANCE.getTextEditorModel_Name(); + + /** + * The meta object literal for the 'Selected Object' reference feature. + * + * + * @generated + */ + EReference TEXT_EDITOR_MODEL__SELECTED_OBJECT = eINSTANCE.getTextEditorModel_SelectedObject(); + + /** + * The meta object literal for the 'Line Number' attribute feature. + * + * + * @generated + */ + EAttribute TEXT_EDITOR_MODEL__LINE_NUMBER = eINSTANCE.getTextEditorModel_LineNumber(); + + /** + * The meta object literal for the 'Generator ID' attribute feature. + * + * + * @generated + */ + EAttribute TEXT_EDITOR_MODEL__GENERATOR_ID = eINSTANCE.getTextEditorModel_GeneratorID(); + + } + +} // TextEditorModelPackage diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelFactoryImpl.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelFactoryImpl.java new file mode 100644 index 00000000000..997f6ff4c0b --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelFactoryImpl.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + */ +package org.eclipse.papyrus.texteditor.model.texteditormodel.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.impl.EFactoryImpl; +import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.eclipse.papyrus.texteditor.model.texteditormodel.*; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelFactory; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class TextEditorModelFactoryImpl extends EFactoryImpl implements TextEditorModelFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static TextEditorModelFactory init() { + try { + TextEditorModelFactory theTextEditorModelFactory = (TextEditorModelFactory)EPackage.Registry.INSTANCE.getEFactory(TextEditorModelPackage.eNS_URI); + if (theTextEditorModelFactory != null) { + return theTextEditorModelFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new TextEditorModelFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public TextEditorModelFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case TextEditorModelPackage.TEXT_EDITOR_MODEL: return createTextEditorModel(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public TextEditorModel createTextEditorModel() { + TextEditorModelImpl textEditorModel = new TextEditorModelImpl(); + return textEditorModel; + } + + /** + * + * + * @generated + */ + @Override + public TextEditorModelPackage getTextEditorModelPackage() { + return (TextEditorModelPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static TextEditorModelPackage getPackage() { + return TextEditorModelPackage.eINSTANCE; + } + +} // TextEditorModelFactoryImpl diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelImpl.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelImpl.java new file mode 100644 index 00000000000..c11dafff246 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelImpl.java @@ -0,0 +1,464 @@ +/** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + */ +package org.eclipse.papyrus.texteditor.model.texteditormodel.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.EModelElementImpl; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage; + +/** + * + * An implementation of the model object 'Text Editor Model'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl#getEditedObject Edited Object}
    • + *
    • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl#getType Type}
    • + *
    • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl#getName Name}
    • + *
    • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl#getSelectedObject Selected Object}
    • + *
    • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl#getLineNumber Line Number}
    • + *
    • {@link org.eclipse.papyrus.texteditor.model.texteditormodel.impl.TextEditorModelImpl#getGeneratorID Generator ID}
    • + *
    + * + * @generated + */ +public class TextEditorModelImpl extends EModelElementImpl implements TextEditorModel { + /** + * The cached value of the '{@link #getEditedObject() Edited Object}' reference. + * + * + * @see #getEditedObject() + * @generated + * @ordered + */ + protected EObject editedObject; + + /** + * The default value of the '{@link #getType() Type}' attribute. + * + * + * @see #getType() + * @generated + * @ordered + */ + protected static final String TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getType() Type}' attribute. + * + * + * @see #getType() + * @generated + * @ordered + */ + protected String type = TYPE_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The cached value of the '{@link #getSelectedObject() Selected Object}' reference. + * + * + * @see #getSelectedObject() + * @generated + * @ordered + */ + protected EObject selectedObject; + + /** + * The default value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected static final int LINE_NUMBER_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected int lineNumber = LINE_NUMBER_EDEFAULT; + + /** + * The default value of the '{@link #getGeneratorID() Generator ID}' attribute. + * + * + * @see #getGeneratorID() + * @generated + * @ordered + */ + protected static final String GENERATOR_ID_EDEFAULT = null; + + /** + * The cached value of the '{@link #getGeneratorID() Generator ID}' attribute. + * + * + * @see #getGeneratorID() + * @generated + * @ordered + */ + protected String generatorID = GENERATOR_ID_EDEFAULT; + + /** + * + * + * @generated + */ + protected TextEditorModelImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return TextEditorModelPackage.Literals.TEXT_EDITOR_MODEL; + } + + /** + * + * + * @generated + */ + @Override + public EObject getEditedObject() { + if (editedObject != null && editedObject.eIsProxy()) { + InternalEObject oldEditedObject = (InternalEObject)editedObject; + editedObject = eResolveProxy(oldEditedObject); + if (editedObject != oldEditedObject) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, TextEditorModelPackage.TEXT_EDITOR_MODEL__EDITED_OBJECT, oldEditedObject, editedObject)); + } + } + return editedObject; + } + + /** + * + * + * @generated + */ + public EObject basicGetEditedObject() { + return editedObject; + } + + /** + * + * + * @generated + */ + @Override + public void setEditedObject(EObject newEditedObject) { + EObject oldEditedObject = editedObject; + editedObject = newEditedObject; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, TextEditorModelPackage.TEXT_EDITOR_MODEL__EDITED_OBJECT, oldEditedObject, editedObject)); + } + + /** + * + * + * @generated + */ + @Override + public String getType() { + return type; + } + + /** + * + * + * @generated + */ + @Override + public void setType(String newType) { + String oldType = type; + type = newType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, TextEditorModelPackage.TEXT_EDITOR_MODEL__TYPE, oldType, type)); + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, TextEditorModelPackage.TEXT_EDITOR_MODEL__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public EObject getSelectedObject() { + if (selectedObject != null && selectedObject.eIsProxy()) { + InternalEObject oldSelectedObject = (InternalEObject)selectedObject; + selectedObject = eResolveProxy(oldSelectedObject); + if (selectedObject != oldSelectedObject) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, TextEditorModelPackage.TEXT_EDITOR_MODEL__SELECTED_OBJECT, oldSelectedObject, selectedObject)); + } + } + return selectedObject; + } + + /** + * + * + * @generated + */ + public EObject basicGetSelectedObject() { + return selectedObject; + } + + /** + * + * + * @generated + */ + @Override + public void setSelectedObject(EObject newSelectedObject) { + EObject oldSelectedObject = selectedObject; + selectedObject = newSelectedObject; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, TextEditorModelPackage.TEXT_EDITOR_MODEL__SELECTED_OBJECT, oldSelectedObject, selectedObject)); + } + + /** + * + * + * @generated + */ + @Override + public int getLineNumber() { + return lineNumber; + } + + /** + * + * + * @generated + */ + @Override + public void setLineNumber(int newLineNumber) { + int oldLineNumber = lineNumber; + lineNumber = newLineNumber; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, TextEditorModelPackage.TEXT_EDITOR_MODEL__LINE_NUMBER, oldLineNumber, lineNumber)); + } + + /** + * + * + * @generated + */ + public String getGeneratorID() { + return generatorID; + } + + /** + * + * + * @generated + */ + public void setGeneratorID(String newGeneratorID) { + String oldGeneratorID = generatorID; + generatorID = newGeneratorID; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, TextEditorModelPackage.TEXT_EDITOR_MODEL__GENERATOR_ID, oldGeneratorID, generatorID)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case TextEditorModelPackage.TEXT_EDITOR_MODEL__EDITED_OBJECT: + if (resolve) return getEditedObject(); + return basicGetEditedObject(); + case TextEditorModelPackage.TEXT_EDITOR_MODEL__TYPE: + return getType(); + case TextEditorModelPackage.TEXT_EDITOR_MODEL__NAME: + return getName(); + case TextEditorModelPackage.TEXT_EDITOR_MODEL__SELECTED_OBJECT: + if (resolve) return getSelectedObject(); + return basicGetSelectedObject(); + case TextEditorModelPackage.TEXT_EDITOR_MODEL__LINE_NUMBER: + return getLineNumber(); + case TextEditorModelPackage.TEXT_EDITOR_MODEL__GENERATOR_ID: + return getGeneratorID(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case TextEditorModelPackage.TEXT_EDITOR_MODEL__EDITED_OBJECT: + setEditedObject((EObject)newValue); + return; + case TextEditorModelPackage.TEXT_EDITOR_MODEL__TYPE: + setType((String)newValue); + return; + case TextEditorModelPackage.TEXT_EDITOR_MODEL__NAME: + setName((String)newValue); + return; + case TextEditorModelPackage.TEXT_EDITOR_MODEL__SELECTED_OBJECT: + setSelectedObject((EObject)newValue); + return; + case TextEditorModelPackage.TEXT_EDITOR_MODEL__LINE_NUMBER: + setLineNumber((Integer)newValue); + return; + case TextEditorModelPackage.TEXT_EDITOR_MODEL__GENERATOR_ID: + setGeneratorID((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case TextEditorModelPackage.TEXT_EDITOR_MODEL__EDITED_OBJECT: + setEditedObject((EObject)null); + return; + case TextEditorModelPackage.TEXT_EDITOR_MODEL__TYPE: + setType(TYPE_EDEFAULT); + return; + case TextEditorModelPackage.TEXT_EDITOR_MODEL__NAME: + setName(NAME_EDEFAULT); + return; + case TextEditorModelPackage.TEXT_EDITOR_MODEL__SELECTED_OBJECT: + setSelectedObject((EObject)null); + return; + case TextEditorModelPackage.TEXT_EDITOR_MODEL__LINE_NUMBER: + setLineNumber(LINE_NUMBER_EDEFAULT); + return; + case TextEditorModelPackage.TEXT_EDITOR_MODEL__GENERATOR_ID: + setGeneratorID(GENERATOR_ID_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case TextEditorModelPackage.TEXT_EDITOR_MODEL__EDITED_OBJECT: + return editedObject != null; + case TextEditorModelPackage.TEXT_EDITOR_MODEL__TYPE: + return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); + case TextEditorModelPackage.TEXT_EDITOR_MODEL__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case TextEditorModelPackage.TEXT_EDITOR_MODEL__SELECTED_OBJECT: + return selectedObject != null; + case TextEditorModelPackage.TEXT_EDITOR_MODEL__LINE_NUMBER: + return lineNumber != LINE_NUMBER_EDEFAULT; + case TextEditorModelPackage.TEXT_EDITOR_MODEL__GENERATOR_ID: + return GENERATOR_ID_EDEFAULT == null ? generatorID != null : !GENERATOR_ID_EDEFAULT.equals(generatorID); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (type: "); + result.append(type); + result.append(", name: "); + result.append(name); + result.append(", lineNumber: "); + result.append(lineNumber); + result.append(", generatorID: "); + result.append(generatorID); + result.append(')'); + return result.toString(); + } + +} // TextEditorModelImpl diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelPackageImpl.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelPackageImpl.java new file mode 100644 index 00000000000..8e10c9e3320 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/impl/TextEditorModelPackageImpl.java @@ -0,0 +1,255 @@ +/** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + */ +package org.eclipse.papyrus.texteditor.model.texteditormodel.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EcorePackage; +import org.eclipse.emf.ecore.impl.EPackageImpl; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelFactory; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class TextEditorModelPackageImpl extends EPackageImpl implements TextEditorModelPackage { + /** + * + * + * @generated + */ + private EClass textEditorModelEClass = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

    Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage#eNS_URI + * @see #init() + * @generated + */ + private TextEditorModelPackageImpl() { + super(eNS_URI, TextEditorModelFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

    + * This method is used to initialize {@link TextEditorModelPackage#eINSTANCE} when that field is accessed. Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static TextEditorModelPackage init() { + if (isInited) return (TextEditorModelPackage)EPackage.Registry.INSTANCE.getEPackage(TextEditorModelPackage.eNS_URI); + + // Obtain or create and register package + TextEditorModelPackageImpl theTextEditorModelPackage = (TextEditorModelPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof TextEditorModelPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new TextEditorModelPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + EcorePackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theTextEditorModelPackage.createPackageContents(); + + // Initialize created meta-data + theTextEditorModelPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theTextEditorModelPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(TextEditorModelPackage.eNS_URI, theTextEditorModelPackage); + return theTextEditorModelPackage; + } + + /** + * + * + * @generated + */ + @Override + public EClass getTextEditorModel() { + return textEditorModelEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getTextEditorModel_EditedObject() { + return (EReference)textEditorModelEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTextEditorModel_Type() { + return (EAttribute)textEditorModelEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTextEditorModel_Name() { + return (EAttribute)textEditorModelEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTextEditorModel_SelectedObject() { + return (EReference)textEditorModelEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTextEditorModel_LineNumber() { + return (EAttribute)textEditorModelEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + public EAttribute getTextEditorModel_GeneratorID() { + return (EAttribute)textEditorModelEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public TextEditorModelFactory getTextEditorModelFactory() { + return (TextEditorModelFactory)getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + textEditorModelEClass = createEClass(TEXT_EDITOR_MODEL); + createEReference(textEditorModelEClass, TEXT_EDITOR_MODEL__EDITED_OBJECT); + createEAttribute(textEditorModelEClass, TEXT_EDITOR_MODEL__TYPE); + createEAttribute(textEditorModelEClass, TEXT_EDITOR_MODEL__NAME); + createEReference(textEditorModelEClass, TEXT_EDITOR_MODEL__SELECTED_OBJECT); + createEAttribute(textEditorModelEClass, TEXT_EDITOR_MODEL__LINE_NUMBER); + createEAttribute(textEditorModelEClass, TEXT_EDITOR_MODEL__GENERATOR_ID); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + textEditorModelEClass.getESuperTypes().add(theEcorePackage.getEModelElement()); + + // Initialize classes and features; add operations and parameters + initEClass(textEditorModelEClass, TextEditorModel.class, "TextEditorModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getTextEditorModel_EditedObject(), theEcorePackage.getEObject(), null, "editedObject", null, 0, 1, TextEditorModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTextEditorModel_Type(), ecorePackage.getEString(), "type", null, 0, 1, TextEditorModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTextEditorModel_Name(), ecorePackage.getEString(), "name", null, 0, 1, TextEditorModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTextEditorModel_SelectedObject(), theEcorePackage.getEObject(), null, "selectedObject", null, 0, 1, TextEditorModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTextEditorModel_LineNumber(), ecorePackage.getEInt(), "lineNumber", null, 0, 1, TextEditorModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTextEditorModel_GeneratorID(), ecorePackage.getEString(), "generatorID", null, 0, 1, TextEditorModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + } + +} // TextEditorModelPackageImpl diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelAdapterFactory.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelAdapterFactory.java new file mode 100644 index 00000000000..073c23deb57 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelAdapterFactory.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + */ +package org.eclipse.papyrus.texteditor.model.texteditormodel.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.texteditor.model.texteditormodel.*; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage + * @generated + */ +public class TextEditorModelAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static TextEditorModelPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public TextEditorModelAdapterFactory() { + if (modelPackage == null) { + modelPackage = TextEditorModelPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected TextEditorModelSwitch modelSwitch = + new TextEditorModelSwitch() { + @Override + public Adapter caseTextEditorModel(TextEditorModel object) { + return createTextEditorModelAdapter(); + } + @Override + public Adapter caseEModelElement(EModelElement object) { + return createEModelElementAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel Text Editor Model}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel + * @generated + */ + public Adapter createTextEditorModelAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecore.EModelElement EModel Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.emf.ecore.EModelElement + * @generated + */ + public Adapter createEModelElementAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} // TextEditorModelAdapterFactory diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelSwitch.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelSwitch.java new file mode 100644 index 00000000000..2e8d35c8cea --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model/src/org/eclipse/papyrus/texteditor/model/texteditormodel/util/TextEditorModelSwitch.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) 2012 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + */ +package org.eclipse.papyrus.texteditor.model.texteditormodel.util; + +import org.eclipse.emf.ecore.EModelElement; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.util.Switch; +import org.eclipse.papyrus.texteditor.model.texteditormodel.*; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModelPackage + * @generated + */ +public class TextEditorModelSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static TextEditorModelPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public TextEditorModelSwitch() { + if (modelPackage == null) { + modelPackage = TextEditorModelPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case TextEditorModelPackage.TEXT_EDITOR_MODEL: { + TextEditorModel textEditorModel = (TextEditorModel)theEObject; + T result = caseTextEditorModel(textEditorModel); + if (result == null) result = caseEModelElement(textEditorModel); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Text Editor Model'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Text Editor Model'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTextEditorModel(TextEditorModel object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EModel Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EModel Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEModelElement(EModelElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} // TextEditorModelSwitch diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.classpath b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.project b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.project new file mode 100644 index 00000000000..81eff2e0ed5 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.texteditor.modelexplorer + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/META-INF/MANIFEST.MF b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..f3e062e8080 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/META-INF/MANIFEST.MF @@ -0,0 +1,25 @@ +Manifest-Version: 1.0 +Export-Package: org.eclipse.papyrus.texteditor.modelexplorer, + org.eclipse.papyrus.texteditor.modelexplorer.queries +Bundle-ActivationPolicy: lazy +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.papyrus.views.modelexplorer;bundle-version="1.2.0", + com.google.guava;bundle-version="11.0.0", + org.eclipse.papyrus.texteditor.model;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", + org.eclipse.papyrus.emf.facet.query.java.core;bundle-version="1.2.0", + org.eclipse.papyrus.emf.facet.custom.core;bundle-version="1.2.0", + org.eclipse.papyrus.emf.facet.custom.ui;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.sasheditor.di;bundle-version="1.2.0" +Bundle-Vendor: %pluginProvider +Bundle-Version: 1.2.0.qualifier +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.texteditor.modelexplorer.Activator +Bundle-SymbolicName: org.eclipse.papyrus.texteditor.modelexplorer;singleton:=true +Import-Package: org.eclipse.papyrus.infra.core.editorsfactory, + org.eclipse.papyrus.infra.viewpoints.policy diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/about.html b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    June 5, 2007

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/build.properties b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/build.properties new file mode 100644 index 00000000000..a42c291785a --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + resources/,\ + about.html,\ + plugin.xml,\ + plugin.properties +src.includes = resources/ diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.properties b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.properties new file mode 100644 index 00000000000..e3cf0949e64 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.properties @@ -0,0 +1,13 @@ +# Copyright (c) 2012 CEA LIST. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation +# (with the help of examining table support from Vincent Lorenzo) +# +pluginProvider = Eclipse Modeling Project +pluginName = Text Editor Customization For Model Explorer (Incubation) \ No newline at end of file diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.xml b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.xml new file mode 100644 index 00000000000..d9537fda209 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/plugin.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/pom.xml b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/pom.xml new file mode 100644 index 00000000000..e5345634035 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../releng/extra + + org.eclipse.papyrus.texteditor.modelexplorer + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/resources/TextEditorFacet.custom b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/resources/TextEditorFacet.custom new file mode 100644 index 00000000000..8566b496c67 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/resources/TextEditorFacet.custom @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/Activator.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/Activator.java new file mode 100644 index 00000000000..d37acadb2ff --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/Activator.java @@ -0,0 +1,73 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation + * (with the help of examining table support from Vincent Lorenzo) + * + *****************************************************************************/ + +package org.eclipse.papyrus.texteditor.modelexplorer; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.texteditor.modelexplorer"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + public static LogHelper log; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + log = new LogHelper(this); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/adapters/TextEditorAdapterFactory.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/adapters/TextEditorAdapterFactory.java new file mode 100644 index 00000000000..b3b416be9c9 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/adapters/TextEditorAdapterFactory.java @@ -0,0 +1,40 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - ansgar.radermacher@cea.fr - Initial API and implementation + * (derived from DiagramAdapterFactory) + * + *****************************************************************************/ +package org.eclipse.papyrus.texteditor.modelexplorer.adapters; + +import org.eclipse.core.runtime.IAdapterFactory; +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IOpenable; +import org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.IOpenableWithContainer; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; + +@SuppressWarnings("rawtypes") +public class TextEditorAdapterFactory implements IAdapterFactory { + + @Override + public Object getAdapter(Object adaptableObject, Class adapterType) { + if (adapterType == IOpenable.class) { + if (adaptableObject instanceof TextEditorModel) { + TextEditorModel textEditorModel = (TextEditorModel) adaptableObject; + return new IOpenableWithContainer.Openable(adaptableObject, textEditorModel.getEditedObject()); + } + } + return null; + } + + @Override + public Class[] getAdapterList() { + return new Class[] { IOpenable.class }; + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetContainedTextEditors.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetContainedTextEditors.java new file mode 100644 index 00000000000..eae3a2f2554 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetContainedTextEditors.java @@ -0,0 +1,58 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation + * (with the help of examining table support from Vincent Lorenzo) + * + *****************************************************************************/ + +package org.eclipse.papyrus.texteditor.modelexplorer.queries; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager; +import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException; +import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2; +import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; +import org.eclipse.papyrus.views.modelexplorer.NavigatorUtils; +import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery; + +/** Get the collection of all contained text editors */ +public class GetContainedTextEditors extends AbstractEditorContainerQuery implements IJavaQuery2> { + + /** + * {@inheritDoc} + */ + @Override + public Collection evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager manager) throws DerivedTypedElementException { + + List result = new ArrayList(); + Iterator roots = NavigatorUtils.getNotationRoots(source); + if (roots == null) { + return result; + } + + while (roots.hasNext()) { + EObject root = roots.next(); + if (root instanceof TextEditorModel) { + TextEditorModel textEditorModel = (TextEditorModel) root; + if (textEditorModel.getEditedObject() == source) { + result.add(textEditorModel); + } + } + } + return result; + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorIcon.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorIcon.java new file mode 100644 index 00000000000..7fb77ffdcbd --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorIcon.java @@ -0,0 +1,35 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation + * (with the help of examining table support from Vincent Lorenzo) + * + *****************************************************************************/ +package org.eclipse.papyrus.texteditor.modelexplorer.queries; + +import org.eclipse.papyrus.emf.facet.custom.metamodel.custompt.IImage; +import org.eclipse.papyrus.emf.facet.custom.ui.ImageUtils; +import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager; +import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2; +import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; +import org.eclipse.papyrus.views.modelexplorer.queries.AbstractGetEditorIconQuery; + +/** Return the path to the icon of the corresponding table */ +public class GetTextEditorIcon extends AbstractGetEditorIconQuery implements IJavaQuery2 { + + /** + * {@inheritDoc} + */ + @Override + public IImage evaluate(TextEditorModel textInstance, IParameterValueList2 parameterValues, IFacetManager manager) { + IImage image = ImageUtils.wrap("platform:/plugin/" + getEditorRegistry(textInstance).getEditorURLIcon(textInstance)); //$NON-NLS-1$ + return image; + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorName.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorName.java new file mode 100644 index 00000000000..d7d4e826ef6 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/GetTextEditorName.java @@ -0,0 +1,35 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation + * (with the help of examining table support from Vincent Lorenzo) + * + *****************************************************************************/ + +package org.eclipse.papyrus.texteditor.modelexplorer.queries; + +import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager; +import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException; +import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2; +import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; + +/** Return the name for the table */ +public class GetTextEditorName implements IJavaQuery2 { + + /** + * {@inheritDoc} + */ + @Override + public String evaluate(TextEditorModel context, IParameterValueList2 parameterValues, IFacetManager manager) + throws DerivedTypedElementException { + return context.getName(); + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/IsTextEditorContainer.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/IsTextEditorContainer.java new file mode 100644 index 00000000000..f6d3c9d35f4 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/IsTextEditorContainer.java @@ -0,0 +1,35 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation + * (with the help of examining table support from Vincent Lorenzo) + * + *****************************************************************************/ +package org.eclipse.papyrus.texteditor.modelexplorer.queries; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager; +import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException; +import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2; +import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; +import org.eclipse.papyrus.views.modelexplorer.queries.AbstractEditorContainerQuery; + +/** Returns true if the element contains a Table */ +public class IsTextEditorContainer extends AbstractEditorContainerQuery implements IJavaQuery2 { + + /** + * {@inheritDoc} + */ + @Override + public Boolean evaluate(EObject context, IParameterValueList2 parameterValues, IFacetManager manager) + throws DerivedTypedElementException { + return false; + } +} diff --git a/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java new file mode 100644 index 00000000000..609afc7abd2 --- /dev/null +++ b/extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer/src/org/eclipse/papyrus/texteditor/modelexplorer/queries/NotVisibleStructuralFeatureQuery.java @@ -0,0 +1,30 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + /*****************************************************************************/ +package org.eclipse.papyrus.texteditor.modelexplorer.queries; + +import org.eclipse.papyrus.emf.facet.efacet.core.IFacetManager; +import org.eclipse.papyrus.emf.facet.efacet.core.exception.DerivedTypedElementException; +import org.eclipse.papyrus.emf.facet.query.java.core.IJavaQuery2; +import org.eclipse.papyrus.emf.facet.query.java.core.IParameterValueList2; +import org.eclipse.papyrus.texteditor.model.texteditormodel.TextEditorModel; + +public class NotVisibleStructuralFeatureQuery implements IJavaQuery2 { + public Boolean evaluate(final TextEditorModel context, + final IParameterValueList2 parameterValues, + final IFacetManager facetManager) + throws DerivedTypedElementException { + // All sub-elements are invisible. EditedObject may eventually be useful, but text editor + // is already shown as a child of edited object within the model explorer + return false; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/.classpath b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/.classpath new file mode 100644 index 00000000000..098194ca4b7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/.project b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/.project new file mode 100644 index 00000000000..856e4c4cd85 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.fcm.profile + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f42de363afa --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/META-INF/MANIFEST.MF b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..fd139e5c660 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/META-INF/MANIFEST.MF @@ -0,0 +1,24 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.eclipse.uml2.uml;visibility:=reexport, + org.eclipse.uml2.types;visibility:=reexport, + org.eclipse.emf.transaction;bundle-version="1.4.0", + org.eclipse.papyrus.infra.core;bundle-version="1.2.0", + org.eclipse.gmf.runtime.common.core;bundle-version="1.4.1", + org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0", + org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0", + org.eclipse.ui;bundle-version="3.105.0" +Export-Package: org.eclipse.papyrus.FCM, + org.eclipse.papyrus.FCM.impl, + org.eclipse.papyrus.FCM.util +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.fcm.profile;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/about.html b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    November 14, 2008

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/build.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/build.properties new file mode 100644 index 00000000000..cb863c1cf51 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/build.properties @@ -0,0 +1,19 @@ + +# +# +# +# $Id$ + +bin.includes = .,\ + model/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties,\ + icons/,\ + palettes/,\ + about.html,\ + schema/ +jars.compile.order = . +source.. = src/ +output.. = bin/ +src.includes = about.html diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/connector.png b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/connector.png new file mode 100644 index 00000000000..975629baeaa Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/connector.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/connector.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/connector.svg new file mode 100644 index 00000000000..c56fadbf37d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/connector.svg @@ -0,0 +1,80 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/deploy.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/deploy.gif new file mode 100644 index 00000000000..7a7ced35f3d Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/deploy.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/fcm.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/fcm.gif new file mode 100644 index 00000000000..ec21c358e2f Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/fcm.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/hires/connector.png b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/hires/connector.png new file mode 100644 index 00000000000..e2be455d487 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/hires/connector.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/port.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/port.gif new file mode 100644 index 00000000000..4aea611efe7 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/port.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/target.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/target.gif new file mode 100644 index 00000000000..92b10039973 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/icons/target.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.ecore b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.ecore new file mode 100644 index 00000000000..dda5a4bf17e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.ecore @@ -0,0 +1,301 @@ + + + + +
    + + + + + + +
    + + + + + +
    + + + + + +
    + + + + + +
    + + + + + +
    + + + + + +
    + + + + + +
    + + + + + +
    + + + + + + + +
    + + + + + + + +
    + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + +
    + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.genmodel b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.genmodel new file mode 100644 index 00000000000..d14164bedca --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.genmodel @@ -0,0 +1,176 @@ + + + FCM.ecore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.di b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.di new file mode 100644 index 00000000000..375842f73a9 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.di @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.notation new file mode 100644 index 00000000000..273d8fcf69a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.notation @@ -0,0 +1,2897 @@ + + + + + +
    + + + + + +
    + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + name + derived + multiplicity + type + + + + + + + name + derived + type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + name + derived + multiplicity + type + + + + + + + name + derived + type + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + name + derived + type + + + + + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + name + derived + type + + + + + + + name + derived + type + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + +
    +
    +
    +
    +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + +
    +
    +
    +
    +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + name + derived + multiplicity + type + + + + + + +
    + + + name + derived + multiplicity + type + + + + + + +
    + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + name + derived + multiplicity + type + + + + + + + name + type + derived + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + +
    + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + +
    + + + +
    + + + name + derived + multiplicity + type + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + name + derived + type + + + + + + + name + derived + multiplicity + type + + + + + + + name + derived + type + + + + + + + name + derived + type + + + + + + + name + derived + type + + + + + + + name + derived + multiplicity + type + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + +
    + + + + + + + +
    + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.uml new file mode 100644 index 00000000000..1e2517210f2 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/model/FCM.profile.uml @@ -0,0 +1,679 @@ + + + + + The associations between PortKind and Operation simply denote the fact that we want to target something that encapsulates the definition of interface mapping rules (i.e. the rules that determine the interfaces that are provided/required on a port +of a particular PortKind). Further experiments are still needed to confirm that the Operation metaclass is the right metaclass to encapsulate this definition. + + + The template parameters list defines the parameters that are passed to the Acceleo template. If empty, the formal parameter list of the package template is used. + + + LateEvaluation is more a tempalte binding rather than a template definition. In + + + This stereotype indicuates that the attribute does not only store values but needs to be configured initially be the user. It corresponds to the automatic creation of an entry (slot+nstance specification) in the deployment plan + + + A group of interaction components should apply both stereotypes. Each member of such a group must be an interaction component, but this is not enforced by the meta-model + + + A rule that is applied to a package applies automatically to all elements that are contained within + + + Assembly and FlatComposite are components whose parts are allocated to different nodes. +Both may not have a behavior + + + An assembly is a collection of (interconnected) parts. During distribution, a variant of the assembly is created for each node, that contains only a subset of the parts. This requires that +(1) no inheritance +(2) all instances of the assembly on a node must be split in an identical way +The system component is also an assembly + + + A composite that will get flattened during distribution. This means that it vanishes and its parts are added to the composite in which the flat composite is defined. A flat composite may not have assembly connections. It is primarily used by interaction components + + + We assume that a model library defines a set of supported programming languages as well as a set of provided component to mappings. We do not use a fixed enumeration defined in the profile to assure extensibility + + + This information on a package tells the code generators which programming language and which component-to-OO mapping should be used + + + An interaction component is responsible for realization the communication between two components. It typically owns conjugated ports. It might be defined within a package template to enable the adaption of ports to those used by the interacting components + + + Indicate that this component is instantiated only once within the system. It also implies that this component is automatically instantiated by a generated bootloader + + + This stereotype references the interaction component that should realize the communication. It can be applied to UML connectors as well as to properties. The former is used, if there are two communication partners, the latter is more flexible. For instance, in case of a DDS interaction, a publisher does not know the consumers, it therefore communicates with a part (property) representing the publisher part of the interaction component + + + Use a dedicated component that that is responsible for configuring component instances. The concept is primarily intented for container extensions. For instance, a container extension might provide reflection data about a component. In this case, the instance configuration would create the value specifications using data available in the model + + + Apply a set of container rules. It can be applied to a single class or to a package, implying that all components within the package apply the specified rule. + + + A container rule, i.e. a specification of extension or interception within a container. Beside the two options, a container rule is basically a composite class whose parts are added to the container. + + + Template ports are ports that enable the binding of an extended port with an actual parameter: the resulting port kind is the port kind bound to the current port type. +For instance, we cound type a port with "MyType" and use an extended port Writer with a template with formal parameter T. Resulting port would be Writer with T bound to MyType. + + + A binding helper is responsible for creating sub-elements. For instance, if the formal parameter of a template is an interface, it might be required to instantiate an operation for each operation of the interface. + + + Condition whether an interceptor should be used within a container. +- "Some" = set of ports defined in interception rule +- "AllOut/AllIn" = ports with required/provided ports only +- "Matching" = kind of interceptor and component port need to match + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/palettes/palette-classdep.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/palettes/palette-classdep.xml new file mode 100644 index 00000000000..2352951986c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/palettes/palette-classdep.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/palettes/palette-composite.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/palettes/palette-composite.xml new file mode 100644 index 00000000000..d5afbd294a9 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/palettes/palette-composite.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/plugin.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/plugin.properties new file mode 100644 index 00000000000..f15495b325f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus extra: profile for flexible component model - FCM (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/plugin.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/plugin.xml new file mode 100644 index 00000000000..fd9d5ec828a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/plugin.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/pom.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/pom.xml new file mode 100644 index 00000000000..ae9c10ff8a4 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../releng/extra + + org.eclipse.papyrus.fcm.profile + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/schema/fcmBindingHelper.exsd b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/schema/fcmBindingHelper.exsd new file mode 100644 index 00000000000..e51291f98af --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/schema/fcmBindingHelper.exsd @@ -0,0 +1,99 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/schema/fcmEmbeddingRule.exsd b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/schema/fcmEmbeddingRule.exsd new file mode 100644 index 00000000000..82aa794425b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/schema/fcmEmbeddingRule.exsd @@ -0,0 +1,99 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/schema/fcmPortMappingRule.exsd b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/schema/fcmPortMappingRule.exsd new file mode 100644 index 00000000000..77f6e9cb5e4 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/schema/fcmPortMappingRule.exsd @@ -0,0 +1,99 @@ + + + + + + + + + A port mapping rule, i.e. a rule that maps port kinds to a provider and/or required interface + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Activator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Activator.java new file mode 100644 index 00000000000..2d60ac344ee --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Activator.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.FCM; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.fcm.profile"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Assembly.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Assembly.java new file mode 100644 index 00000000000..1d4189e3920 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Assembly.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Assembly'. + * + * + * + * An assembly is a collection of (interconnected) parts. During distribution, a variant of the assembly is created for each node, that contains only a subset of the parts. This requires that + * (1) no inheritance + * (2) all instances of the assembly on a node must be split in an identical way + * The system component is also an assembly + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.Assembly#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getAssembly() + * @model + * @generated + */ +public interface Assembly extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getAssembly_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Assembly#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // Assembly diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndex.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndex.java new file mode 100644 index 00000000000..40a23903437 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndex.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Property; + +/** + * + * A representation of the model object 'Auto Index'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.AutoIndex#getBase_Property Base Property}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getAutoIndex() + * @model + * @generated + */ +public interface AutoIndex extends EObject { + /** + * Returns the value of the 'Base Property' reference. + * + *

    + * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Property' reference. + * @see #setBase_Property(Property) + * @see org.eclipse.papyrus.FCM.FCMPackage#getAutoIndex_Base_Property() + * @model required="true" ordered="false" + * @generated + */ + Property getBase_Property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.AutoIndex#getBase_Property Base Property}' reference. + * + * + * @param value the new value of the 'Base Property' reference. + * @see #getBase_Property() + * @generated + */ + void setBase_Property(Property value); + +} // AutoIndex diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndexPerNode.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndexPerNode.java new file mode 100644 index 00000000000..d986de382f4 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/AutoIndexPerNode.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + + +/** + * + * A representation of the model object 'Auto Index Per Node'. + * + * + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getAutoIndexPerNode() + * @model + * @generated + */ +public interface AutoIndexPerNode extends AutoIndex { +} // AutoIndexPerNode diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindTemplate.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindTemplate.java new file mode 100644 index 00000000000..94380f0d970 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindTemplate.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Type; + +/** + * + * A representation of the model object 'Bind Template'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.BindTemplate#getActual Actual}
    • + *
    • {@link org.eclipse.papyrus.FCM.BindTemplate#getBase_Property Base Property}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getBindTemplate() + * @model + * @generated + */ +public interface BindTemplate extends EObject { + /** + * Returns the value of the 'Actual' reference list. + * The list contents are of type {@link org.eclipse.uml2.uml.Type}. + * + *

    + * If the meaning of the 'Actual' reference list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Actual' reference list. + * @see org.eclipse.papyrus.FCM.FCMPackage#getBindTemplate_Actual() + * @model ordered="false" + * @generated + */ + EList getActual(); + + /** + * Returns the value of the 'Base Property' reference. + * + *

    + * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Property' reference. + * @see #setBase_Property(Property) + * @see org.eclipse.papyrus.FCM.FCMPackage#getBindTemplate_Base_Property() + * @model required="true" ordered="false" + * @generated + */ + Property getBase_Property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.BindTemplate#getBase_Property Base Property}' reference. + * + * + * @param value the new value of the 'Base Property' reference. + * @see #getBase_Property() + * @generated + */ + void setBase_Property(Property value); + +} // BindTemplate diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindingHelper.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindingHelper.java new file mode 100644 index 00000000000..901e429efb1 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/BindingHelper.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Binding Helper'. + * + * + * + * A binding helper is responsible for creating sub-elements. For instance, if the formal parameter of a template is an interface, it might be required to instantiate an operation for each operation of the interface. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.BindingHelper#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getBindingHelper() + * @model + * @generated + */ +public interface BindingHelper extends EObject { + + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getBindingHelper_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.BindingHelper#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); +} // BindingHelper diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CodeGenOptions.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CodeGenOptions.java new file mode 100644 index 00000000000..a0554816e52 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CodeGenOptions.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Code Gen Options'. + * + * + * + * This information on a package tells the code generators which programming language and which component-to-OO mapping should be used + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.CodeGenOptions#getBase_Package Base Package}
    • + *
    • {@link org.eclipse.papyrus.FCM.CodeGenOptions#getCompToOOmapping Comp To OOmapping}
    • + *
    • {@link org.eclipse.papyrus.FCM.CodeGenOptions#getProgLanguage Prog Language}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getCodeGenOptions() + * @model + * @generated + */ +public interface CodeGenOptions extends EObject { + /** + * Returns the value of the 'Base Package' reference. + * + *

    + * If the meaning of the 'Base Package' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Package' reference. + * @see #setBase_Package(org.eclipse.uml2.uml.Package) + * @see org.eclipse.papyrus.FCM.FCMPackage#getCodeGenOptions_Base_Package() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Package getBase_Package(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.CodeGenOptions#getBase_Package Base Package}' reference. + * + * + * @param value the new value of the 'Base Package' reference. + * @see #getBase_Package() + * @generated + */ + void setBase_Package(org.eclipse.uml2.uml.Package value); + + /** + * Returns the value of the 'Comp To OOmapping' reference. + * + *

    + * If the meaning of the 'Comp To OOmapping' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Comp To OOmapping' reference. + * @see #setCompToOOmapping(CompToOOmapping) + * @see org.eclipse.papyrus.FCM.FCMPackage#getCodeGenOptions_CompToOOmapping() + * @model required="true" ordered="false" + * @generated + */ + CompToOOmapping getCompToOOmapping(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.CodeGenOptions#getCompToOOmapping Comp To OOmapping}' reference. + * + * + * @param value the new value of the 'Comp To OOmapping' reference. + * @see #getCompToOOmapping() + * @generated + */ + void setCompToOOmapping(CompToOOmapping value); + + /** + * Returns the value of the 'Prog Language' reference. + * + *

    + * If the meaning of the 'Prog Language' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Prog Language' reference. + * @see #setProgLanguage(ProgLanguage) + * @see org.eclipse.papyrus.FCM.FCMPackage#getCodeGenOptions_ProgLanguage() + * @model required="true" ordered="false" + * @generated + */ + ProgLanguage getProgLanguage(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.CodeGenOptions#getProgLanguage Prog Language}' reference. + * + * + * @param value the new value of the 'Prog Language' reference. + * @see #getProgLanguage() + * @generated + */ + void setProgLanguage(ProgLanguage value); + +} // CodeGenOptions diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompImplTemplate.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompImplTemplate.java new file mode 100644 index 00000000000..25ff298bda8 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompImplTemplate.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Comp Impl Template'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.CompImplTemplate#getTemplateDefs Template Defs}
    • + *
    • {@link org.eclipse.papyrus.FCM.CompImplTemplate#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getCompImplTemplate() + * @model + * @generated + */ +public interface CompImplTemplate extends EObject { + /** + * Returns the value of the 'Template Defs' attribute. + * + *

    + * If the meaning of the 'Template Defs' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Template Defs' attribute. + * @see #setTemplateDefs(String) + * @see org.eclipse.papyrus.FCM.FCMPackage#getCompImplTemplate_TemplateDefs() + * @model unique="false" dataType="org.eclipse.uml2.types.String" ordered="false" + * @generated + */ + String getTemplateDefs(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.CompImplTemplate#getTemplateDefs Template Defs}' attribute. + * + * + * @param value the new value of the 'Template Defs' attribute. + * @see #getTemplateDefs() + * @generated + */ + void setTemplateDefs(String value); + + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getCompImplTemplate_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.CompImplTemplate#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // CompImplTemplate diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompToOOmapping.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompToOOmapping.java new file mode 100644 index 00000000000..45a6ac2a439 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompToOOmapping.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Comp To OOmapping'. + * + * + * + * We assume that a model library defines a set of supported programming languages as well as a set of provided component to mappings. We do not use a fixed enumeration defined in the profile to assure extensibility + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.CompToOOmapping#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getCompToOOmapping() + * @model + * @generated + */ +public interface CompToOOmapping extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getCompToOOmapping_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.CompToOOmapping#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // CompToOOmapping diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompilerChain.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompilerChain.java new file mode 100644 index 00000000000..c788bf107d5 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CompilerChain.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Compiler Chain'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.CompilerChain#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getCompilerChain() + * @model + * @generated + */ +public interface CompilerChain extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getCompilerChain_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.CompilerChain#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // CompilerChain diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigOption.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigOption.java new file mode 100644 index 00000000000..18537c5d33b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigOption.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Config Option'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.ConfigOption#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getConfigOption() + * @model + * @generated + */ +public interface ConfigOption extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getConfigOption_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.ConfigOption#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // ConfigOption diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurableElementInstance.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurableElementInstance.java new file mode 100644 index 00000000000..480e38b98fb --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurableElementInstance.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.InstanceSpecification; + +/** + * + * A representation of the model object 'Configurable Element Instance'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.ConfigurableElementInstance#getConfiguration Configuration}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getConfigurableElementInstance() + * @model abstract="true" + * @generated + */ +public interface ConfigurableElementInstance extends EObject { + /** + * Returns the value of the 'Configuration' reference. + * + *

    + * If the meaning of the 'Configuration' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Configuration' reference. + * @see #setConfiguration(InstanceSpecification) + * @see org.eclipse.papyrus.FCM.FCMPackage#getConfigurableElementInstance_Configuration() + * @model ordered="false" + * @generated + */ + InstanceSpecification getConfiguration(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.ConfigurableElementInstance#getConfiguration Configuration}' reference. + * + * + * @param value the new value of the 'Configuration' reference. + * @see #getConfiguration() + * @generated + */ + void setConfiguration(InstanceSpecification value); + +} // ConfigurableElementInstance diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Configuration.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Configuration.java new file mode 100644 index 00000000000..af652b2f3de --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Configuration.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Configuration'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.Configuration#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.Configuration#getConfigOptions Config Options}
    • + *
    • {@link org.eclipse.papyrus.FCM.Configuration#getDeploymentPlan Deployment Plan}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getConfiguration() + * @model + * @generated + */ +public interface Configuration extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getConfiguration_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Configuration#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + + /** + * Returns the value of the 'Config Options' reference list. + * The list contents are of type {@link org.eclipse.papyrus.FCM.ConfigOption}. + * + *

    + * If the meaning of the 'Config Options' reference list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Config Options' reference list. + * @see org.eclipse.papyrus.FCM.FCMPackage#getConfiguration_ConfigOptions() + * @model ordered="false" + * @generated + */ + EList getConfigOptions(); + + /** + * Returns the value of the 'Deployment Plan' reference. + * + *

    + * If the meaning of the 'Deployment Plan' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Deployment Plan' reference. + * @see #setDeploymentPlan(DeploymentPlan) + * @see org.eclipse.papyrus.FCM.FCMPackage#getConfiguration_DeploymentPlan() + * @model required="true" ordered="false" + * @generated + */ + DeploymentPlan getDeploymentPlan(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Configuration#getDeploymentPlan Deployment Plan}' reference. + * + * + * @param value the new value of the 'Deployment Plan' reference. + * @see #getDeploymentPlan() + * @generated + */ + void setDeploymentPlan(DeploymentPlan value); + +} // Configuration diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurationProperty.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurationProperty.java new file mode 100644 index 00000000000..505e9ad4b84 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConfigurationProperty.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Property; + +/** + * + * A representation of the model object 'Configuration Property'. + * + * + * + * This stereotype indicuates that the attribute does not only store values but needs to be configured initially be the user. It corresponds to the automatic creation of an entry (slot+nstance specification) in the deployment plan + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.ConfigurationProperty#getBase_Property Base Property}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getConfigurationProperty() + * @model + * @generated + */ +public interface ConfigurationProperty extends EObject { + /** + * Returns the value of the 'Base Property' reference. + * + *

    + * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Property' reference. + * @see #setBase_Property(Property) + * @see org.eclipse.papyrus.FCM.FCMPackage#getConfigurationProperty_Base_Property() + * @model required="true" ordered="false" + * @generated + */ + Property getBase_Property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.ConfigurationProperty#getBase_Property Base Property}' reference. + * + * + * @param value the new value of the 'Base Property' reference. + * @see #getBase_Property() + * @generated + */ + void setBase_Property(Property value); + +} // ConfigurationProperty diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Connector.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Connector.java new file mode 100644 index 00000000000..e8ad70be248 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Connector.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.uml2.uml.Property; + +/** + * + * A representation of the model object 'Connector'. + * + * + * + * This stereotype references the interaction component that should realize the communication. It can be applied to UML connectors as well as to properties. The former is used, if there are two communication partners, the latter is more flexible. For instance, in case of a DDS interaction, a publisher does not know the consumers, it therefore communicates with a part (property) representing the publisher part of the interaction component + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.Connector#getBase_Connector Base Connector}
    • + *
    • {@link org.eclipse.papyrus.FCM.Connector#getIc Ic}
    • + *
    • {@link org.eclipse.papyrus.FCM.Connector#getBase_Property Base Property}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getConnector() + * @model + * @generated + */ +public interface Connector extends ConfigurableElementInstance { + /** + * Returns the value of the 'Base Connector' reference. + * + *

    + * If the meaning of the 'Base Connector' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Connector' reference. + * @see #setBase_Connector(org.eclipse.uml2.uml.Connector) + * @see org.eclipse.papyrus.FCM.FCMPackage#getConnector_Base_Connector() + * @model ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Connector getBase_Connector(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Connector#getBase_Connector Base Connector}' reference. + * + * + * @param value the new value of the 'Base Connector' reference. + * @see #getBase_Connector() + * @generated + */ + void setBase_Connector(org.eclipse.uml2.uml.Connector value); + + /** + * Returns the value of the 'Ic' reference. + * + *

    + * If the meaning of the 'Ic' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Ic' reference. + * @see #setIc(InteractionComponent) + * @see org.eclipse.papyrus.FCM.FCMPackage#getConnector_Ic() + * @model ordered="false" + * @generated + */ + InteractionComponent getIc(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Connector#getIc Ic}' reference. + * + * + * @param value the new value of the 'Ic' reference. + * @see #getIc() + * @generated + */ + void setIc(InteractionComponent value); + + /** + * Returns the value of the 'Base Property' reference. + * + *

    + * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Property' reference. + * @see #setBase_Property(Property) + * @see org.eclipse.papyrus.FCM.FCMPackage#getConnector_Base_Property() + * @model ordered="false" + * @generated + */ + Property getBase_Property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Connector#getBase_Property Base Property}' reference. + * + * + * @param value the new value of the 'Base Property' reference. + * @see #getBase_Property() + * @generated + */ + void setBase_Property(Property value); + +} // Connector diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConnectorConfiguration.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConnectorConfiguration.java new file mode 100644 index 00000000000..cd7bb6bcd19 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ConnectorConfiguration.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Slot; + +/** + * + * A representation of the model object 'Connector Configuration'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.ConnectorConfiguration#getBase_Slot Base Slot}
    • + *
    • {@link org.eclipse.papyrus.FCM.ConnectorConfiguration#getConnector Connector}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getConnectorConfiguration() + * @model + * @generated + */ +public interface ConnectorConfiguration extends EObject { + /** + * Returns the value of the 'Base Slot' reference. + * + *

    + * If the meaning of the 'Base Slot' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Slot' reference. + * @see #setBase_Slot(Slot) + * @see org.eclipse.papyrus.FCM.FCMPackage#getConnectorConfiguration_Base_Slot() + * @model required="true" ordered="false" + * @generated + */ + Slot getBase_Slot(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.ConnectorConfiguration#getBase_Slot Base Slot}' reference. + * + * + * @param value the new value of the 'Base Slot' reference. + * @see #getBase_Slot() + * @generated + */ + void setBase_Slot(Slot value); + + /** + * Returns the value of the 'Connector' reference. + * + *

    + * If the meaning of the 'Connector' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Connector' reference. + * @see #setConnector(Connector) + * @see org.eclipse.papyrus.FCM.FCMPackage#getConnectorConfiguration_Connector() + * @model required="true" ordered="false" + * @generated + */ + Connector getConnector(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.ConnectorConfiguration#getConnector Connector}' reference. + * + * + * @param value the new value of the 'Connector' reference. + * @see #getConnector() + * @generated + */ + void setConnector(Connector value); + +} // ConnectorConfiguration diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRule.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRule.java new file mode 100644 index 00000000000..4b4ad0161f8 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRule.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Container Rule'. + * + * + * + * A container rule, i.e. a specification of extension or interception within a container. Beside the two options, a container rule is basically a composite class whose parts are added to the container. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.ContainerRule#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.ContainerRule#getForConfig For Config}
    • + *
    • {@link org.eclipse.papyrus.FCM.ContainerRule#getKind Kind}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getContainerRule() + * @model + * @generated + */ +public interface ContainerRule extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getContainerRule_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.ContainerRule#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + + /** + * Returns the value of the 'For Config' reference list. + * The list contents are of type {@link org.eclipse.papyrus.FCM.ConfigOption}. + * + *

    + * If the meaning of the 'For Config' reference list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'For Config' reference list. + * @see org.eclipse.papyrus.FCM.FCMPackage#getContainerRule_ForConfig() + * @model ordered="false" + * @generated + */ + EList getForConfig(); + + /** + * Returns the value of the 'Kind' attribute. + * The literals are from the enumeration {@link org.eclipse.papyrus.FCM.ContainerRuleKind}. + * + *

    + * If the meaning of the 'Kind' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Kind' attribute. + * @see org.eclipse.papyrus.FCM.ContainerRuleKind + * @see #setKind(ContainerRuleKind) + * @see org.eclipse.papyrus.FCM.FCMPackage#getContainerRule_Kind() + * @model required="true" ordered="false" + * @generated + */ + ContainerRuleKind getKind(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.ContainerRule#getKind Kind}' attribute. + * + * + * @param value the new value of the 'Kind' attribute. + * @see org.eclipse.papyrus.FCM.ContainerRuleKind + * @see #getKind() + * @generated + */ + void setKind(ContainerRuleKind value); + +} // ContainerRule diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRuleKind.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRuleKind.java new file mode 100644 index 00000000000..6366f1cc62a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ContainerRuleKind.java @@ -0,0 +1,225 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Container Rule Kind', + * and utility methods for working with them. + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getContainerRuleKind() + * @model + * @generated + */ +public enum ContainerRuleKind implements Enumerator { + /** + * The 'Component Rule' literal object. + * + * + * @see #COMPONENT_RULE_VALUE + * @generated + * @ordered + */ + COMPONENT_RULE(0, "ComponentRule", "ComponentRule"), //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Light Weight OO Rule' literal object. + * + * + * @see #LIGHT_WEIGHT_OO_RULE_VALUE + * @generated + * @ordered + */ + LIGHT_WEIGHT_OO_RULE(1, "LightWeightOORule", "LightWeightOORule"); //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Component Rule' literal value. + * + *

    + * If the meaning of 'Component Rule' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #COMPONENT_RULE + * @model name="ComponentRule" + * @generated + * @ordered + */ + public static final int COMPONENT_RULE_VALUE = 0; + + /** + * The 'Light Weight OO Rule' literal value. + * + *

    + * If the meaning of 'Light Weight OO Rule' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #LIGHT_WEIGHT_OO_RULE + * @model name="LightWeightOORule" + * @generated + * @ordered + */ + public static final int LIGHT_WEIGHT_OO_RULE_VALUE = 1; + + /** + * An array of all the 'Container Rule Kind' enumerators. + * + * + * @generated + */ + private static final ContainerRuleKind[] VALUES_ARRAY = + new ContainerRuleKind[] { + COMPONENT_RULE, + LIGHT_WEIGHT_OO_RULE, + }; + + /** + * A public read-only list of all the 'Container Rule Kind' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Container Rule Kind' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static ContainerRuleKind get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ContainerRuleKind result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Container Rule Kind' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static ContainerRuleKind getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + ContainerRuleKind result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Container Rule Kind' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static ContainerRuleKind get(int value) { + switch (value) { + case COMPONENT_RULE_VALUE: return COMPONENT_RULE; + case LIGHT_WEIGHT_OO_RULE_VALUE: return LIGHT_WEIGHT_OO_RULE; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private ContainerRuleKind(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} // ContainerRuleKind diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CopyAttributeValue.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CopyAttributeValue.java new file mode 100644 index 00000000000..414ccb88e3d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/CopyAttributeValue.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Property; + +/** + * + * A representation of the model object 'Copy Attribute Value'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.CopyAttributeValue#getSource Source}
    • + *
    • {@link org.eclipse.papyrus.FCM.CopyAttributeValue#getBase_Property Base Property}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getCopyAttributeValue() + * @model + * @generated + */ +public interface CopyAttributeValue extends EObject { + /** + * Returns the value of the 'Source' reference. + * + *

    + * If the meaning of the 'Source' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Source' reference. + * @see #setSource(Property) + * @see org.eclipse.papyrus.FCM.FCMPackage#getCopyAttributeValue_Source() + * @model required="true" ordered="false" + * @generated + */ + Property getSource(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.CopyAttributeValue#getSource Source}' reference. + * + * + * @param value the new value of the 'Source' reference. + * @see #getSource() + * @generated + */ + void setSource(Property value); + + /** + * Returns the value of the 'Base Property' reference. + * + *

    + * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Property' reference. + * @see #setBase_Property(Property) + * @see org.eclipse.papyrus.FCM.FCMPackage#getCopyAttributeValue_Base_Property() + * @model required="true" ordered="false" + * @generated + */ + Property getBase_Property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.CopyAttributeValue#getBase_Property Base Property}' reference. + * + * + * @param value the new value of the 'Base Property' reference. + * @see #getBase_Property() + * @generated + */ + void setBase_Property(Property value); + +} // CopyAttributeValue diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DeploymentPlan.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DeploymentPlan.java new file mode 100644 index 00000000000..7a0d9dc3d44 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DeploymentPlan.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.InstanceSpecification; + +/** + * + * A representation of the model object 'Deployment Plan'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.DeploymentPlan#getMainInstance Main Instance}
    • + *
    • {@link org.eclipse.papyrus.FCM.DeploymentPlan#getBase_Package Base Package}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getDeploymentPlan() + * @model + * @generated + */ +public interface DeploymentPlan extends EObject { + /** + * Returns the value of the 'Main Instance' reference. + * + *

    + * If the meaning of the 'Main Instance' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Main Instance' reference. + * @see #setMainInstance(InstanceSpecification) + * @see org.eclipse.papyrus.FCM.FCMPackage#getDeploymentPlan_MainInstance() + * @model required="true" ordered="false" + * @generated + */ + InstanceSpecification getMainInstance(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.DeploymentPlan#getMainInstance Main Instance}' reference. + * + * + * @param value the new value of the 'Main Instance' reference. + * @see #getMainInstance() + * @generated + */ + void setMainInstance(InstanceSpecification value); + + /** + * Returns the value of the 'Base Package' reference. + * + *

    + * If the meaning of the 'Base Package' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Package' reference. + * @see #setBase_Package(org.eclipse.uml2.uml.Package) + * @see org.eclipse.papyrus.FCM.FCMPackage#getDeploymentPlan_Base_Package() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Package getBase_Package(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.DeploymentPlan#getBase_Package Base Package}' reference. + * + * + * @param value the new value of the 'Base Package' reference. + * @see #getBase_Package() + * @generated + */ + void setBase_Package(org.eclipse.uml2.uml.Package value); + +} // DeploymentPlan diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DerivedElement.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DerivedElement.java new file mode 100644 index 00000000000..58ff9aee3ba --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/DerivedElement.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Element; + +/** + * + * A representation of the model object 'Derived Element'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.DerivedElement#getBase_Element Base Element}
    • + *
    • {@link org.eclipse.papyrus.FCM.DerivedElement#getSource Source}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getDerivedElement() + * @model + * @generated + */ +public interface DerivedElement extends EObject { + /** + * Returns the value of the 'Base Element' reference. + * + *

    + * If the meaning of the 'Base Element' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Element' reference. + * @see #setBase_Element(Element) + * @see org.eclipse.papyrus.FCM.FCMPackage#getDerivedElement_Base_Element() + * @model required="true" ordered="false" + * @generated + */ + Element getBase_Element(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.DerivedElement#getBase_Element Base Element}' reference. + * + * + * @param value the new value of the 'Base Element' reference. + * @see #getBase_Element() + * @generated + */ + void setBase_Element(Element value); + + /** + * Returns the value of the 'Source' reference. + * + *

    + * If the meaning of the 'Source' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Source' reference. + * @see #setSource(Element) + * @see org.eclipse.papyrus.FCM.FCMPackage#getDerivedElement_Source() + * @model required="true" ordered="false" + * @generated + */ + Element getSource(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.DerivedElement#getSource Source}' reference. + * + * + * @param value the new value of the 'Source' reference. + * @see #getSource() + * @generated + */ + void setSource(Element value); + +} // DerivedElement diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMFactory.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMFactory.java new file mode 100644 index 00000000000..907c2d5b4e3 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMFactory.java @@ -0,0 +1,376 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see org.eclipse.papyrus.FCM.FCMPackage + * @generated + */ +public interface FCMFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + FCMFactory eINSTANCE = org.eclipse.papyrus.FCM.impl.FCMFactoryImpl.init(); + + /** + * Returns a new object of class 'Template'. + * + * + * @return a new object of class 'Template'. + * @generated + */ + Template createTemplate(); + + /** + * Returns a new object of class 'Binding Helper'. + * + * + * @return a new object of class 'Binding Helper'. + * @generated + */ + BindingHelper createBindingHelper(); + + /** + * Returns a new object of class 'Configuration Property'. + * + * + * @return a new object of class 'Configuration Property'. + * @generated + */ + ConfigurationProperty createConfigurationProperty(); + + /** + * Returns a new object of class 'Implementation Group'. + * + * + * @return a new object of class 'Implementation Group'. + * @generated + */ + ImplementationGroup createImplementationGroup(); + + /** + * Returns a new object of class 'Assembly'. + * + * + * @return a new object of class 'Assembly'. + * @generated + */ + Assembly createAssembly(); + + /** + * Returns a new object of class 'Flatten'. + * + * + * @return a new object of class 'Flatten'. + * @generated + */ + Flatten createFlatten(); + + /** + * Returns a new object of class 'Comp To OOmapping'. + * + * + * @return a new object of class 'Comp To OOmapping'. + * @generated + */ + CompToOOmapping createCompToOOmapping(); + + /** + * Returns a new object of class 'Prog Language'. + * + * + * @return a new object of class 'Prog Language'. + * @generated + */ + ProgLanguage createProgLanguage(); + + /** + * Returns a new object of class 'Code Gen Options'. + * + * + * @return a new object of class 'Code Gen Options'. + * @generated + */ + CodeGenOptions createCodeGenOptions(); + + /** + * Returns a new object of class 'Interaction Component'. + * + * + * @return a new object of class 'Interaction Component'. + * @generated + */ + InteractionComponent createInteractionComponent(); + + /** + * Returns a new object of class 'Singleton'. + * + * + * @return a new object of class 'Singleton'. + * @generated + */ + Singleton createSingleton(); + + /** + * Returns a new object of class 'Connector'. + * + * + * @return a new object of class 'Connector'. + * @generated + */ + Connector createConnector(); + + /** + * Returns a new object of class 'Use Instance Configurator'. + * + * + * @return a new object of class 'Use Instance Configurator'. + * @generated + */ + UseInstanceConfigurator createUseInstanceConfigurator(); + + /** + * Returns a new object of class 'Instance Configurator'. + * + * + * @return a new object of class 'Instance Configurator'. + * @generated + */ + InstanceConfigurator createInstanceConfigurator(); + + /** + * Returns a new object of class 'Rule Application'. + * + * + * @return a new object of class 'Rule Application'. + * @generated + */ + RuleApplication createRuleApplication(); + + /** + * Returns a new object of class 'Container Rule'. + * + * + * @return a new object of class 'Container Rule'. + * @generated + */ + ContainerRule createContainerRule(); + + /** + * Returns a new object of class 'Config Option'. + * + * + * @return a new object of class 'Config Option'. + * @generated + */ + ConfigOption createConfigOption(); + + /** + * Returns a new object of class 'Template Port'. + * + * + * @return a new object of class 'Template Port'. + * @generated + */ + TemplatePort createTemplatePort(); + + /** + * Returns a new object of class 'Port'. + * + * + * @return a new object of class 'Port'. + * @generated + */ + Port createPort(); + + /** + * Returns a new object of class 'Port Kind'. + * + * + * @return a new object of class 'Port Kind'. + * @generated + */ + PortKind createPortKind(); + + /** + * Returns a new object of class 'Deployment Plan'. + * + * + * @return a new object of class 'Deployment Plan'. + * @generated + */ + DeploymentPlan createDeploymentPlan(); + + /** + * Returns a new object of class 'Derived Element'. + * + * + * @return a new object of class 'Derived Element'. + * @generated + */ + DerivedElement createDerivedElement(); + + /** + * Returns a new object of class 'Comp Impl Template'. + * + * + * @return a new object of class 'Comp Impl Template'. + * @generated + */ + CompImplTemplate createCompImplTemplate(); + + /** + * Returns a new object of class 'Implementation Properties'. + * + * + * @return a new object of class 'Implementation Properties'. + * @generated + */ + ImplementationProperties createImplementationProperties(); + + /** + * Returns a new object of class 'Operating System'. + * + * + * @return a new object of class 'Operating System'. + * @generated + */ + OperatingSystem createOperatingSystem(); + + /** + * Returns a new object of class 'Target Architecture'. + * + * + * @return a new object of class 'Target Architecture'. + * @generated + */ + TargetArchitecture createTargetArchitecture(); + + /** + * Returns a new object of class 'Configuration'. + * + * + * @return a new object of class 'Configuration'. + * @generated + */ + Configuration createConfiguration(); + + /** + * Returns a new object of class 'Interception Rule'. + * + * + * @return a new object of class 'Interception Rule'. + * @generated + */ + InterceptionRule createInterceptionRule(); + + /** + * Returns a new object of class 'Target'. + * + * + * @return a new object of class 'Target'. + * @generated + */ + Target createTarget(); + + /** + * Returns a new object of class 'Compiler Chain'. + * + * + * @return a new object of class 'Compiler Chain'. + * @generated + */ + CompilerChain createCompilerChain(); + + /** + * Returns a new object of class 'Fragment'. + * + * + * @return a new object of class 'Fragment'. + * @generated + */ + Fragment createFragment(); + + /** + * Returns a new object of class 'Copy Attribute Value'. + * + * + * @return a new object of class 'Copy Attribute Value'. + * @generated + */ + CopyAttributeValue createCopyAttributeValue(); + + /** + * Returns a new object of class 'Auto Index'. + * + * + * @return a new object of class 'Auto Index'. + * @generated + */ + AutoIndex createAutoIndex(); + + /** + * Returns a new object of class 'Auto Index Per Node'. + * + * + * @return a new object of class 'Auto Index Per Node'. + * @generated + */ + AutoIndexPerNode createAutoIndexPerNode(); + + /** + * Returns a new object of class 'Init Precedence'. + * + * + * @return a new object of class 'Init Precedence'. + * @generated + */ + InitPrecedence createInitPrecedence(); + + /** + * Returns a new object of class 'Connector Configuration'. + * + * + * @return a new object of class 'Connector Configuration'. + * @generated + */ + ConnectorConfiguration createConnectorConfiguration(); + + /** + * Returns a new object of class 'Bind Template'. + * + * + * @return a new object of class 'Bind Template'. + * @generated + */ + BindTemplate createBindTemplate(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + FCMPackage getFCMPackage(); + +} // FCMFactory diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMPackage.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMPackage.java new file mode 100644 index 00000000000..1dc5cea5fed --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/FCMPackage.java @@ -0,0 +1,3911 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
      + *
    • each class,
    • + *
    • each feature of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMFactory + * @model kind="package" + * @generated + */ +public interface FCMPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "FCM"; //$NON-NLS-1$ + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.eclipse.org/papyrus/FCM/1"; //$NON-NLS-1$ + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "FCM"; //$NON-NLS-1$ + + /** + * The singleton instance of the package. + * + * + * @generated + */ + FCMPackage eINSTANCE = org.eclipse.papyrus.FCM.impl.FCMPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.TemplateImpl Template}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.TemplateImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTemplate() + * @generated + */ + int TEMPLATE = 0; + + /** + * The feature id for the 'Base Element' reference. + * + * + * @generated + * @ordered + */ + int TEMPLATE__BASE_ELEMENT = 0; + + /** + * The feature id for the 'Helper' reference. + * + * + * @generated + * @ordered + */ + int TEMPLATE__HELPER = 1; + + /** + * The number of structural features of the 'Template' class. + * + * + * @generated + * @ordered + */ + int TEMPLATE_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.BindingHelperImpl Binding Helper}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.BindingHelperImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getBindingHelper() + * @generated + */ + int BINDING_HELPER = 1; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int BINDING_HELPER__BASE_CLASS = 0; + + /** + * The number of structural features of the 'Binding Helper' class. + * + * + * @generated + * @ordered + */ + int BINDING_HELPER_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ConfigurationPropertyImpl Configuration Property}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ConfigurationPropertyImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfigurationProperty() + * @generated + */ + int CONFIGURATION_PROPERTY = 2; + + /** + * The feature id for the 'Base Property' reference. + * + * + * @generated + * @ordered + */ + int CONFIGURATION_PROPERTY__BASE_PROPERTY = 0; + + /** + * The number of structural features of the 'Configuration Property' class. + * + * + * @generated + * @ordered + */ + int CONFIGURATION_PROPERTY_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ImplementationGroupImpl Implementation Group}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ImplementationGroupImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getImplementationGroup() + * @generated + */ + int IMPLEMENTATION_GROUP = 3; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int IMPLEMENTATION_GROUP__BASE_CLASS = 0; + + /** + * The number of structural features of the 'Implementation Group' class. + * + * + * @generated + * @ordered + */ + int IMPLEMENTATION_GROUP_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.AssemblyImpl Assembly}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.AssemblyImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getAssembly() + * @generated + */ + int ASSEMBLY = 4; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int ASSEMBLY__BASE_CLASS = 0; + + /** + * The number of structural features of the 'Assembly' class. + * + * + * @generated + * @ordered + */ + int ASSEMBLY_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.FlattenImpl Flatten}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.FlattenImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getFlatten() + * @generated + */ + int FLATTEN = 5; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int FLATTEN__BASE_CLASS = 0; + + /** + * The number of structural features of the 'Flatten' class. + * + * + * @generated + * @ordered + */ + int FLATTEN_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.CompToOOmappingImpl Comp To OOmapping}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.CompToOOmappingImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCompToOOmapping() + * @generated + */ + int COMP_TO_OOMAPPING = 6; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int COMP_TO_OOMAPPING__BASE_CLASS = 0; + + /** + * The number of structural features of the 'Comp To OOmapping' class. + * + * + * @generated + * @ordered + */ + int COMP_TO_OOMAPPING_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ProgLanguageImpl Prog Language}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ProgLanguageImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getProgLanguage() + * @generated + */ + int PROG_LANGUAGE = 7; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int PROG_LANGUAGE__BASE_CLASS = 0; + + /** + * The number of structural features of the 'Prog Language' class. + * + * + * @generated + * @ordered + */ + int PROG_LANGUAGE_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl Code Gen Options}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCodeGenOptions() + * @generated + */ + int CODE_GEN_OPTIONS = 8; + + /** + * The feature id for the 'Base Package' reference. + * + * + * @generated + * @ordered + */ + int CODE_GEN_OPTIONS__BASE_PACKAGE = 0; + + /** + * The feature id for the 'Comp To OOmapping' reference. + * + * + * @generated + * @ordered + */ + int CODE_GEN_OPTIONS__COMP_TO_OOMAPPING = 1; + + /** + * The feature id for the 'Prog Language' reference. + * + * + * @generated + * @ordered + */ + int CODE_GEN_OPTIONS__PROG_LANGUAGE = 2; + + /** + * The number of structural features of the 'Code Gen Options' class. + * + * + * @generated + * @ordered + */ + int CODE_GEN_OPTIONS_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.InteractionComponentImpl Interaction Component}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.InteractionComponentImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInteractionComponent() + * @generated + */ + int INTERACTION_COMPONENT = 9; + + /** + * The feature id for the 'For Distribution' attribute. + * + * + * @generated + * @ordered + */ + int INTERACTION_COMPONENT__FOR_DISTRIBUTION = 0; + + /** + * The feature id for the 'Connection Pattern' reference. + * + * + * @generated + * @ordered + */ + int INTERACTION_COMPONENT__CONNECTION_PATTERN = 1; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int INTERACTION_COMPONENT__BASE_CLASS = 2; + + /** + * The number of structural features of the 'Interaction Component' class. + * + * + * @generated + * @ordered + */ + int INTERACTION_COMPONENT_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.SingletonImpl Singleton}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.SingletonImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getSingleton() + * @generated + */ + int SINGLETON = 10; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int SINGLETON__BASE_CLASS = 0; + + /** + * The number of structural features of the 'Singleton' class. + * + * + * @generated + * @ordered + */ + int SINGLETON_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ConfigurableElementInstanceImpl Configurable Element Instance}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ConfigurableElementInstanceImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfigurableElementInstance() + * @generated + */ + int CONFIGURABLE_ELEMENT_INSTANCE = 12; + + /** + * The feature id for the 'Configuration' reference. + * + * + * @generated + * @ordered + */ + int CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION = 0; + + /** + * The number of structural features of the 'Configurable Element Instance' class. + * + * + * @generated + * @ordered + */ + int CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ConnectorImpl Connector}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ConnectorImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConnector() + * @generated + */ + int CONNECTOR = 11; + + /** + * The feature id for the 'Configuration' reference. + * + * + * @generated + * @ordered + */ + int CONNECTOR__CONFIGURATION = CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION; + + /** + * The feature id for the 'Base Connector' reference. + * + * + * @generated + * @ordered + */ + int CONNECTOR__BASE_CONNECTOR = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Ic' reference. + * + * + * @generated + * @ordered + */ + int CONNECTOR__IC = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Base Property' reference. + * + * + * @generated + * @ordered + */ + int CONNECTOR__BASE_PROPERTY = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Connector' class. + * + * + * @generated + * @ordered + */ + int CONNECTOR_FEATURE_COUNT = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.UseInstanceConfiguratorImpl Use Instance Configurator}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.UseInstanceConfiguratorImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getUseInstanceConfigurator() + * @generated + */ + int USE_INSTANCE_CONFIGURATOR = 13; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int USE_INSTANCE_CONFIGURATOR__BASE_CLASS = 0; + + /** + * The feature id for the 'Configurator' reference. + * + * + * @generated + * @ordered + */ + int USE_INSTANCE_CONFIGURATOR__CONFIGURATOR = 1; + + /** + * The number of structural features of the 'Use Instance Configurator' class. + * + * + * @generated + * @ordered + */ + int USE_INSTANCE_CONFIGURATOR_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.InstanceConfiguratorImpl Instance Configurator}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.InstanceConfiguratorImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInstanceConfigurator() + * @generated + */ + int INSTANCE_CONFIGURATOR = 14; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int INSTANCE_CONFIGURATOR__BASE_CLASS = 0; + + /** + * The feature id for the 'On Node Model' attribute. + * + * + * @generated + * @ordered + */ + int INSTANCE_CONFIGURATOR__ON_NODE_MODEL = 1; + + /** + * The number of structural features of the 'Instance Configurator' class. + * + * + * @generated + * @ordered + */ + int INSTANCE_CONFIGURATOR_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.RuleApplicationImpl Rule Application}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.RuleApplicationImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getRuleApplication() + * @generated + */ + int RULE_APPLICATION = 15; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int RULE_APPLICATION__BASE_CLASS = 0; + + /** + * The feature id for the 'Container Rule' reference list. + * + * + * @generated + * @ordered + */ + int RULE_APPLICATION__CONTAINER_RULE = 1; + + /** + * The feature id for the 'Base Package' reference. + * + * + * @generated + * @ordered + */ + int RULE_APPLICATION__BASE_PACKAGE = 2; + + /** + * The number of structural features of the 'Rule Application' class. + * + * + * @generated + * @ordered + */ + int RULE_APPLICATION_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ContainerRuleImpl Container Rule}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ContainerRuleImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getContainerRule() + * @generated + */ + int CONTAINER_RULE = 16; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int CONTAINER_RULE__BASE_CLASS = 0; + + /** + * The feature id for the 'For Config' reference list. + * + * + * @generated + * @ordered + */ + int CONTAINER_RULE__FOR_CONFIG = 1; + + /** + * The feature id for the 'Kind' attribute. + * + * + * @generated + * @ordered + */ + int CONTAINER_RULE__KIND = 2; + + /** + * The number of structural features of the 'Container Rule' class. + * + * + * @generated + * @ordered + */ + int CONTAINER_RULE_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ConfigOptionImpl Config Option}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ConfigOptionImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfigOption() + * @generated + */ + int CONFIG_OPTION = 17; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int CONFIG_OPTION__BASE_CLASS = 0; + + /** + * The number of structural features of the 'Config Option' class. + * + * + * @generated + * @ordered + */ + int CONFIG_OPTION_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.PortImpl Port}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.PortImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getPort() + * @generated + */ + int PORT = 19; + + /** + * The feature id for the 'Configuration' reference. + * + * + * @generated + * @ordered + */ + int PORT__CONFIGURATION = CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION; + + /** + * The feature id for the 'Base Port' reference. + * + * + * @generated + * @ordered + */ + int PORT__BASE_PORT = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Kind' reference. + * + * + * @generated + * @ordered + */ + int PORT__KIND = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Type' reference. + * + * + * @generated + * @ordered + */ + int PORT__TYPE = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Port' class. + * + * + * @generated + * @ordered + */ + int PORT_FEATURE_COUNT = CONFIGURABLE_ELEMENT_INSTANCE_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.TemplatePortImpl Template Port}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.TemplatePortImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTemplatePort() + * @generated + */ + int TEMPLATE_PORT = 18; + + /** + * The feature id for the 'Configuration' reference. + * + * + * @generated + * @ordered + */ + int TEMPLATE_PORT__CONFIGURATION = PORT__CONFIGURATION; + + /** + * The feature id for the 'Base Port' reference. + * + * + * @generated + * @ordered + */ + int TEMPLATE_PORT__BASE_PORT = PORT__BASE_PORT; + + /** + * The feature id for the 'Kind' reference. + * + * + * @generated + * @ordered + */ + int TEMPLATE_PORT__KIND = PORT__KIND; + + /** + * The feature id for the 'Type' reference. + * + * + * @generated + * @ordered + */ + int TEMPLATE_PORT__TYPE = PORT__TYPE; + + /** + * The feature id for the 'Bound Type' reference. + * + * + * @generated + * @ordered + */ + int TEMPLATE_PORT__BOUND_TYPE = PORT_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Template Port' class. + * + * + * @generated + * @ordered + */ + int TEMPLATE_PORT_FEATURE_COUNT = PORT_FEATURE_COUNT + 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.PortKindImpl Port Kind}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.PortKindImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getPortKind() + * @generated + */ + int PORT_KIND = 20; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int PORT_KIND__BASE_CLASS = 0; + + /** + * The feature id for the 'Provided Interface' reference. + * + * + * @generated + * @ordered + */ + int PORT_KIND__PROVIDED_INTERFACE = 1; + + /** + * The feature id for the 'Required Interface' reference. + * + * + * @generated + * @ordered + */ + int PORT_KIND__REQUIRED_INTERFACE = 2; + + /** + * The feature id for the 'Extended Port' attribute. + * + * + * @generated + * @ordered + */ + int PORT_KIND__EXTENDED_PORT = 3; + + /** + * The number of structural features of the 'Port Kind' class. + * + * + * @generated + * @ordered + */ + int PORT_KIND_FEATURE_COUNT = 4; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.DeploymentPlanImpl Deployment Plan}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.DeploymentPlanImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getDeploymentPlan() + * @generated + */ + int DEPLOYMENT_PLAN = 21; + + /** + * The feature id for the 'Main Instance' reference. + * + * + * @generated + * @ordered + */ + int DEPLOYMENT_PLAN__MAIN_INSTANCE = 0; + + /** + * The feature id for the 'Base Package' reference. + * + * + * @generated + * @ordered + */ + int DEPLOYMENT_PLAN__BASE_PACKAGE = 1; + + /** + * The number of structural features of the 'Deployment Plan' class. + * + * + * @generated + * @ordered + */ + int DEPLOYMENT_PLAN_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.DerivedElementImpl Derived Element}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.DerivedElementImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getDerivedElement() + * @generated + */ + int DERIVED_ELEMENT = 22; + + /** + * The feature id for the 'Base Element' reference. + * + * + * @generated + * @ordered + */ + int DERIVED_ELEMENT__BASE_ELEMENT = 0; + + /** + * The feature id for the 'Source' reference. + * + * + * @generated + * @ordered + */ + int DERIVED_ELEMENT__SOURCE = 1; + + /** + * The number of structural features of the 'Derived Element' class. + * + * + * @generated + * @ordered + */ + int DERIVED_ELEMENT_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.CompImplTemplateImpl Comp Impl Template}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.CompImplTemplateImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCompImplTemplate() + * @generated + */ + int COMP_IMPL_TEMPLATE = 23; + + /** + * The feature id for the 'Template Defs' attribute. + * + * + * @generated + * @ordered + */ + int COMP_IMPL_TEMPLATE__TEMPLATE_DEFS = 0; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int COMP_IMPL_TEMPLATE__BASE_CLASS = 1; + + /** + * The number of structural features of the 'Comp Impl Template' class. + * + * + * @generated + * @ordered + */ + int COMP_IMPL_TEMPLATE_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl Implementation Properties}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getImplementationProperties() + * @generated + */ + int IMPLEMENTATION_PROPERTIES = 24; + + /** + * The feature id for the 'Size RAM' attribute. + * + * + * @generated + * @ordered + */ + int IMPLEMENTATION_PROPERTIES__SIZE_RAM = 0; + + /** + * The feature id for the 'Supported OS' reference list. + * + * + * @generated + * @ordered + */ + int IMPLEMENTATION_PROPERTIES__SUPPORTED_OS = 1; + + /** + * The feature id for the 'Arch' reference list. + * + * + * @generated + * @ordered + */ + int IMPLEMENTATION_PROPERTIES__ARCH = 2; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int IMPLEMENTATION_PROPERTIES__BASE_CLASS = 3; + + /** + * The feature id for the 'Size ROM' attribute. + * + * + * @generated + * @ordered + */ + int IMPLEMENTATION_PROPERTIES__SIZE_ROM = 4; + + /** + * The feature id for the 'Supported Target Arch' reference. + * + * + * @generated + * @ordered + */ + int IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH = 5; + + /** + * The number of structural features of the 'Implementation Properties' class. + * + * + * @generated + * @ordered + */ + int IMPLEMENTATION_PROPERTIES_FEATURE_COUNT = 6; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.OperatingSystemImpl Operating System}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.OperatingSystemImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getOperatingSystem() + * @generated + */ + int OPERATING_SYSTEM = 25; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int OPERATING_SYSTEM__BASE_CLASS = 0; + + /** + * The number of structural features of the 'Operating System' class. + * + * + * @generated + * @ordered + */ + int OPERATING_SYSTEM_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.TargetArchitectureImpl Target Architecture}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.TargetArchitectureImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTargetArchitecture() + * @generated + */ + int TARGET_ARCHITECTURE = 26; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int TARGET_ARCHITECTURE__BASE_CLASS = 0; + + /** + * The number of structural features of the 'Target Architecture' class. + * + * + * @generated + * @ordered + */ + int TARGET_ARCHITECTURE_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ConfigurationImpl Configuration}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ConfigurationImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfiguration() + * @generated + */ + int CONFIGURATION = 27; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int CONFIGURATION__BASE_CLASS = 0; + + /** + * The feature id for the 'Config Options' reference list. + * + * + * @generated + * @ordered + */ + int CONFIGURATION__CONFIG_OPTIONS = 1; + + /** + * The feature id for the 'Deployment Plan' reference. + * + * + * @generated + * @ordered + */ + int CONFIGURATION__DEPLOYMENT_PLAN = 2; + + /** + * The number of structural features of the 'Configuration' class. + * + * + * @generated + * @ordered + */ + int CONFIGURATION_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl Interception Rule}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInterceptionRule() + * @generated + */ + int INTERCEPTION_RULE = 28; + + /** + * The feature id for the 'Interception Kind' attribute. + * + * + * @generated + * @ordered + */ + int INTERCEPTION_RULE__INTERCEPTION_KIND = 0; + + /** + * The feature id for the 'Interception Set' reference list. + * + * + * @generated + * @ordered + */ + int INTERCEPTION_RULE__INTERCEPTION_SET = 1; + + /** + * The feature id for the 'Base Property' reference. + * + * + * @generated + * @ordered + */ + int INTERCEPTION_RULE__BASE_PROPERTY = 2; + + /** + * The feature id for the 'Base Operation' reference. + * + * + * @generated + * @ordered + */ + int INTERCEPTION_RULE__BASE_OPERATION = 3; + + /** + * The number of structural features of the 'Interception Rule' class. + * + * + * @generated + * @ordered + */ + int INTERCEPTION_RULE_FEATURE_COUNT = 4; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.TargetImpl Target}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.TargetImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTarget() + * @generated + */ + int TARGET = 29; + + /** + * The feature id for the 'Target Arch' reference. + * + * + * @generated + * @ordered + */ + int TARGET__TARGET_ARCH = 0; + + /** + * The feature id for the 'Options' reference list. + * + * + * @generated + * @ordered + */ + int TARGET__OPTIONS = 1; + + /** + * The feature id for the 'Base Node' reference. + * + * + * @generated + * @ordered + */ + int TARGET__BASE_NODE = 2; + + /** + * The feature id for the 'Used OS' reference. + * + * + * @generated + * @ordered + */ + int TARGET__USED_OS = 3; + + /** + * The feature id for the 'Avail RAM' attribute. + * + * + * @generated + * @ordered + */ + int TARGET__AVAIL_RAM = 4; + + /** + * The feature id for the 'Avail ROM' attribute. + * + * + * @generated + * @ordered + */ + int TARGET__AVAIL_ROM = 5; + + /** + * The feature id for the 'Compiler' reference. + * + * + * @generated + * @ordered + */ + int TARGET__COMPILER = 6; + + /** + * The number of structural features of the 'Target' class. + * + * + * @generated + * @ordered + */ + int TARGET_FEATURE_COUNT = 7; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.CompilerChainImpl Compiler Chain}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.CompilerChainImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCompilerChain() + * @generated + */ + int COMPILER_CHAIN = 30; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int COMPILER_CHAIN__BASE_CLASS = 0; + + /** + * The number of structural features of the 'Compiler Chain' class. + * + * + * @generated + * @ordered + */ + int COMPILER_CHAIN_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.FragmentImpl Fragment}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.FragmentImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getFragment() + * @generated + */ + int FRAGMENT = 31; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int FRAGMENT__BASE_CLASS = 0; + + /** + * The number of structural features of the 'Fragment' class. + * + * + * @generated + * @ordered + */ + int FRAGMENT_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.CopyAttributeValueImpl Copy Attribute Value}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.CopyAttributeValueImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCopyAttributeValue() + * @generated + */ + int COPY_ATTRIBUTE_VALUE = 32; + + /** + * The feature id for the 'Source' reference. + * + * + * @generated + * @ordered + */ + int COPY_ATTRIBUTE_VALUE__SOURCE = 0; + + /** + * The feature id for the 'Base Property' reference. + * + * + * @generated + * @ordered + */ + int COPY_ATTRIBUTE_VALUE__BASE_PROPERTY = 1; + + /** + * The number of structural features of the 'Copy Attribute Value' class. + * + * + * @generated + * @ordered + */ + int COPY_ATTRIBUTE_VALUE_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.AutoIndexImpl Auto Index}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.AutoIndexImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getAutoIndex() + * @generated + */ + int AUTO_INDEX = 33; + + /** + * The feature id for the 'Base Property' reference. + * + * + * @generated + * @ordered + */ + int AUTO_INDEX__BASE_PROPERTY = 0; + + /** + * The number of structural features of the 'Auto Index' class. + * + * + * @generated + * @ordered + */ + int AUTO_INDEX_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.AutoIndexPerNodeImpl Auto Index Per Node}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.AutoIndexPerNodeImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getAutoIndexPerNode() + * @generated + */ + int AUTO_INDEX_PER_NODE = 34; + + /** + * The feature id for the 'Base Property' reference. + * + * + * @generated + * @ordered + */ + int AUTO_INDEX_PER_NODE__BASE_PROPERTY = AUTO_INDEX__BASE_PROPERTY; + + /** + * The number of structural features of the 'Auto Index Per Node' class. + * + * + * @generated + * @ordered + */ + int AUTO_INDEX_PER_NODE_FEATURE_COUNT = AUTO_INDEX_FEATURE_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl Init Precedence}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInitPrecedence() + * @generated + */ + int INIT_PRECEDENCE = 35; + + /** + * The feature id for the 'Invoke After' reference list. + * + * + * @generated + * @ordered + */ + int INIT_PRECEDENCE__INVOKE_AFTER = 0; + + /** + * The feature id for the 'Invoke Before' reference list. + * + * + * @generated + * @ordered + */ + int INIT_PRECEDENCE__INVOKE_BEFORE = 1; + + /** + * The feature id for the 'Base Class' reference. + * + * + * @generated + * @ordered + */ + int INIT_PRECEDENCE__BASE_CLASS = 2; + + /** + * The number of structural features of the 'Init Precedence' class. + * + * + * @generated + * @ordered + */ + int INIT_PRECEDENCE_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.ConnectorConfigurationImpl Connector Configuration}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ConnectorConfigurationImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConnectorConfiguration() + * @generated + */ + int CONNECTOR_CONFIGURATION = 36; + + /** + * The feature id for the 'Base Slot' reference. + * + * + * @generated + * @ordered + */ + int CONNECTOR_CONFIGURATION__BASE_SLOT = 0; + + /** + * The feature id for the 'Connector' reference. + * + * + * @generated + * @ordered + */ + int CONNECTOR_CONFIGURATION__CONNECTOR = 1; + + /** + * The number of structural features of the 'Connector Configuration' class. + * + * + * @generated + * @ordered + */ + int CONNECTOR_CONFIGURATION_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.impl.BindTemplateImpl Bind Template}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.BindTemplateImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getBindTemplate() + * @generated + */ + int BIND_TEMPLATE = 37; + + /** + * The feature id for the 'Actual' reference list. + * + * + * @generated + * @ordered + */ + int BIND_TEMPLATE__ACTUAL = 0; + + /** + * The feature id for the 'Base Property' reference. + * + * + * @generated + * @ordered + */ + int BIND_TEMPLATE__BASE_PROPERTY = 1; + + /** + * The number of structural features of the 'Bind Template' class. + * + * + * @generated + * @ordered + */ + int BIND_TEMPLATE_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.ContainerRuleKind Container Rule Kind}' enum. + * + * + * @see org.eclipse.papyrus.FCM.ContainerRuleKind + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getContainerRuleKind() + * @generated + */ + int CONTAINER_RULE_KIND = 38; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.FCM.InterceptionKind Interception Kind}' enum. + * + * + * @see org.eclipse.papyrus.FCM.InterceptionKind + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInterceptionKind() + * @generated + */ + int INTERCEPTION_KIND = 39; + + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Template Template}'. + * + * + * @return the meta object for class 'Template'. + * @see org.eclipse.papyrus.FCM.Template + * @generated + */ + EClass getTemplate(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Template#getBase_Element Base Element}'. + * + * + * @return the meta object for the reference 'Base Element'. + * @see org.eclipse.papyrus.FCM.Template#getBase_Element() + * @see #getTemplate() + * @generated + */ + EReference getTemplate_Base_Element(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Template#getHelper Helper}'. + * + * + * @return the meta object for the reference 'Helper'. + * @see org.eclipse.papyrus.FCM.Template#getHelper() + * @see #getTemplate() + * @generated + */ + EReference getTemplate_Helper(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.BindingHelper Binding Helper}'. + * + * + * @return the meta object for class 'Binding Helper'. + * @see org.eclipse.papyrus.FCM.BindingHelper + * @generated + */ + EClass getBindingHelper(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.BindingHelper#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.BindingHelper#getBase_Class() + * @see #getBindingHelper() + * @generated + */ + EReference getBindingHelper_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ConfigurationProperty Configuration Property}'. + * + * + * @return the meta object for class 'Configuration Property'. + * @see org.eclipse.papyrus.FCM.ConfigurationProperty + * @generated + */ + EClass getConfigurationProperty(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ConfigurationProperty#getBase_Property Base Property}'. + * + * + * @return the meta object for the reference 'Base Property'. + * @see org.eclipse.papyrus.FCM.ConfigurationProperty#getBase_Property() + * @see #getConfigurationProperty() + * @generated + */ + EReference getConfigurationProperty_Base_Property(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ImplementationGroup Implementation Group}'. + * + * + * @return the meta object for class 'Implementation Group'. + * @see org.eclipse.papyrus.FCM.ImplementationGroup + * @generated + */ + EClass getImplementationGroup(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ImplementationGroup#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.ImplementationGroup#getBase_Class() + * @see #getImplementationGroup() + * @generated + */ + EReference getImplementationGroup_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Assembly Assembly}'. + * + * + * @return the meta object for class 'Assembly'. + * @see org.eclipse.papyrus.FCM.Assembly + * @generated + */ + EClass getAssembly(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Assembly#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.Assembly#getBase_Class() + * @see #getAssembly() + * @generated + */ + EReference getAssembly_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Flatten Flatten}'. + * + * + * @return the meta object for class 'Flatten'. + * @see org.eclipse.papyrus.FCM.Flatten + * @generated + */ + EClass getFlatten(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Flatten#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.Flatten#getBase_Class() + * @see #getFlatten() + * @generated + */ + EReference getFlatten_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.CompToOOmapping Comp To OOmapping}'. + * + * + * @return the meta object for class 'Comp To OOmapping'. + * @see org.eclipse.papyrus.FCM.CompToOOmapping + * @generated + */ + EClass getCompToOOmapping(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CompToOOmapping#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.CompToOOmapping#getBase_Class() + * @see #getCompToOOmapping() + * @generated + */ + EReference getCompToOOmapping_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ProgLanguage Prog Language}'. + * + * + * @return the meta object for class 'Prog Language'. + * @see org.eclipse.papyrus.FCM.ProgLanguage + * @generated + */ + EClass getProgLanguage(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ProgLanguage#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.ProgLanguage#getBase_Class() + * @see #getProgLanguage() + * @generated + */ + EReference getProgLanguage_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.CodeGenOptions Code Gen Options}'. + * + * + * @return the meta object for class 'Code Gen Options'. + * @see org.eclipse.papyrus.FCM.CodeGenOptions + * @generated + */ + EClass getCodeGenOptions(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CodeGenOptions#getBase_Package Base Package}'. + * + * + * @return the meta object for the reference 'Base Package'. + * @see org.eclipse.papyrus.FCM.CodeGenOptions#getBase_Package() + * @see #getCodeGenOptions() + * @generated + */ + EReference getCodeGenOptions_Base_Package(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CodeGenOptions#getCompToOOmapping Comp To OOmapping}'. + * + * + * @return the meta object for the reference 'Comp To OOmapping'. + * @see org.eclipse.papyrus.FCM.CodeGenOptions#getCompToOOmapping() + * @see #getCodeGenOptions() + * @generated + */ + EReference getCodeGenOptions_CompToOOmapping(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CodeGenOptions#getProgLanguage Prog Language}'. + * + * + * @return the meta object for the reference 'Prog Language'. + * @see org.eclipse.papyrus.FCM.CodeGenOptions#getProgLanguage() + * @see #getCodeGenOptions() + * @generated + */ + EReference getCodeGenOptions_ProgLanguage(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.InteractionComponent Interaction Component}'. + * + * + * @return the meta object for class 'Interaction Component'. + * @see org.eclipse.papyrus.FCM.InteractionComponent + * @generated + */ + EClass getInteractionComponent(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.InteractionComponent#isForDistribution For Distribution}'. + * + * + * @return the meta object for the attribute 'For Distribution'. + * @see org.eclipse.papyrus.FCM.InteractionComponent#isForDistribution() + * @see #getInteractionComponent() + * @generated + */ + EAttribute getInteractionComponent_ForDistribution(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.InteractionComponent#getConnectionPattern Connection Pattern}'. + * + * + * @return the meta object for the reference 'Connection Pattern'. + * @see org.eclipse.papyrus.FCM.InteractionComponent#getConnectionPattern() + * @see #getInteractionComponent() + * @generated + */ + EReference getInteractionComponent_ConnectionPattern(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.InteractionComponent#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.InteractionComponent#getBase_Class() + * @see #getInteractionComponent() + * @generated + */ + EReference getInteractionComponent_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Singleton Singleton}'. + * + * + * @return the meta object for class 'Singleton'. + * @see org.eclipse.papyrus.FCM.Singleton + * @generated + */ + EClass getSingleton(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Singleton#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.Singleton#getBase_Class() + * @see #getSingleton() + * @generated + */ + EReference getSingleton_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Connector Connector}'. + * + * + * @return the meta object for class 'Connector'. + * @see org.eclipse.papyrus.FCM.Connector + * @generated + */ + EClass getConnector(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Connector#getBase_Connector Base Connector}'. + * + * + * @return the meta object for the reference 'Base Connector'. + * @see org.eclipse.papyrus.FCM.Connector#getBase_Connector() + * @see #getConnector() + * @generated + */ + EReference getConnector_Base_Connector(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Connector#getIc Ic}'. + * + * + * @return the meta object for the reference 'Ic'. + * @see org.eclipse.papyrus.FCM.Connector#getIc() + * @see #getConnector() + * @generated + */ + EReference getConnector_Ic(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Connector#getBase_Property Base Property}'. + * + * + * @return the meta object for the reference 'Base Property'. + * @see org.eclipse.papyrus.FCM.Connector#getBase_Property() + * @see #getConnector() + * @generated + */ + EReference getConnector_Base_Property(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ConfigurableElementInstance Configurable Element Instance}'. + * + * + * @return the meta object for class 'Configurable Element Instance'. + * @see org.eclipse.papyrus.FCM.ConfigurableElementInstance + * @generated + */ + EClass getConfigurableElementInstance(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ConfigurableElementInstance#getConfiguration Configuration}'. + * + * + * @return the meta object for the reference 'Configuration'. + * @see org.eclipse.papyrus.FCM.ConfigurableElementInstance#getConfiguration() + * @see #getConfigurableElementInstance() + * @generated + */ + EReference getConfigurableElementInstance_Configuration(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.UseInstanceConfigurator Use Instance Configurator}'. + * + * + * @return the meta object for class 'Use Instance Configurator'. + * @see org.eclipse.papyrus.FCM.UseInstanceConfigurator + * @generated + */ + EClass getUseInstanceConfigurator(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.UseInstanceConfigurator#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.UseInstanceConfigurator#getBase_Class() + * @see #getUseInstanceConfigurator() + * @generated + */ + EReference getUseInstanceConfigurator_Base_Class(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.UseInstanceConfigurator#getConfigurator Configurator}'. + * + * + * @return the meta object for the reference 'Configurator'. + * @see org.eclipse.papyrus.FCM.UseInstanceConfigurator#getConfigurator() + * @see #getUseInstanceConfigurator() + * @generated + */ + EReference getUseInstanceConfigurator_Configurator(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.InstanceConfigurator Instance Configurator}'. + * + * + * @return the meta object for class 'Instance Configurator'. + * @see org.eclipse.papyrus.FCM.InstanceConfigurator + * @generated + */ + EClass getInstanceConfigurator(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.InstanceConfigurator#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.InstanceConfigurator#getBase_Class() + * @see #getInstanceConfigurator() + * @generated + */ + EReference getInstanceConfigurator_Base_Class(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.InstanceConfigurator#isOnNodeModel On Node Model}'. + * + * + * @return the meta object for the attribute 'On Node Model'. + * @see org.eclipse.papyrus.FCM.InstanceConfigurator#isOnNodeModel() + * @see #getInstanceConfigurator() + * @generated + */ + EAttribute getInstanceConfigurator_OnNodeModel(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.RuleApplication Rule Application}'. + * + * + * @return the meta object for class 'Rule Application'. + * @see org.eclipse.papyrus.FCM.RuleApplication + * @generated + */ + EClass getRuleApplication(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.RuleApplication#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.RuleApplication#getBase_Class() + * @see #getRuleApplication() + * @generated + */ + EReference getRuleApplication_Base_Class(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.RuleApplication#getContainerRule Container Rule}'. + * + * + * @return the meta object for the reference list 'Container Rule'. + * @see org.eclipse.papyrus.FCM.RuleApplication#getContainerRule() + * @see #getRuleApplication() + * @generated + */ + EReference getRuleApplication_ContainerRule(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.RuleApplication#getBase_Package Base Package}'. + * + * + * @return the meta object for the reference 'Base Package'. + * @see org.eclipse.papyrus.FCM.RuleApplication#getBase_Package() + * @see #getRuleApplication() + * @generated + */ + EReference getRuleApplication_Base_Package(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ContainerRule Container Rule}'. + * + * + * @return the meta object for class 'Container Rule'. + * @see org.eclipse.papyrus.FCM.ContainerRule + * @generated + */ + EClass getContainerRule(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ContainerRule#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.ContainerRule#getBase_Class() + * @see #getContainerRule() + * @generated + */ + EReference getContainerRule_Base_Class(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.ContainerRule#getForConfig For Config}'. + * + * + * @return the meta object for the reference list 'For Config'. + * @see org.eclipse.papyrus.FCM.ContainerRule#getForConfig() + * @see #getContainerRule() + * @generated + */ + EReference getContainerRule_ForConfig(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.ContainerRule#getKind Kind}'. + * + * + * @return the meta object for the attribute 'Kind'. + * @see org.eclipse.papyrus.FCM.ContainerRule#getKind() + * @see #getContainerRule() + * @generated + */ + EAttribute getContainerRule_Kind(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ConfigOption Config Option}'. + * + * + * @return the meta object for class 'Config Option'. + * @see org.eclipse.papyrus.FCM.ConfigOption + * @generated + */ + EClass getConfigOption(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ConfigOption#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.ConfigOption#getBase_Class() + * @see #getConfigOption() + * @generated + */ + EReference getConfigOption_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.TemplatePort Template Port}'. + * + * + * @return the meta object for class 'Template Port'. + * @see org.eclipse.papyrus.FCM.TemplatePort + * @generated + */ + EClass getTemplatePort(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.TemplatePort#getBoundType Bound Type}'. + * + * + * @return the meta object for the reference 'Bound Type'. + * @see org.eclipse.papyrus.FCM.TemplatePort#getBoundType() + * @see #getTemplatePort() + * @generated + */ + EReference getTemplatePort_BoundType(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Port Port}'. + * + * + * @return the meta object for class 'Port'. + * @see org.eclipse.papyrus.FCM.Port + * @generated + */ + EClass getPort(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Port#getBase_Port Base Port}'. + * + * + * @return the meta object for the reference 'Base Port'. + * @see org.eclipse.papyrus.FCM.Port#getBase_Port() + * @see #getPort() + * @generated + */ + EReference getPort_Base_Port(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Port#getKind Kind}'. + * + * + * @return the meta object for the reference 'Kind'. + * @see org.eclipse.papyrus.FCM.Port#getKind() + * @see #getPort() + * @generated + */ + EReference getPort_Kind(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Port#getType Type}'. + * + * + * @return the meta object for the reference 'Type'. + * @see org.eclipse.papyrus.FCM.Port#getType() + * @see #getPort() + * @generated + */ + EReference getPort_Type(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.PortKind Port Kind}'. + * + * + * @return the meta object for class 'Port Kind'. + * @see org.eclipse.papyrus.FCM.PortKind + * @generated + */ + EClass getPortKind(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.PortKind#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.PortKind#getBase_Class() + * @see #getPortKind() + * @generated + */ + EReference getPortKind_Base_Class(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.PortKind#getProvidedInterface Provided Interface}'. + * + * + * @return the meta object for the reference 'Provided Interface'. + * @see org.eclipse.papyrus.FCM.PortKind#getProvidedInterface() + * @see #getPortKind() + * @generated + */ + EReference getPortKind_ProvidedInterface(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.PortKind#getRequiredInterface Required Interface}'. + * + * + * @return the meta object for the reference 'Required Interface'. + * @see org.eclipse.papyrus.FCM.PortKind#getRequiredInterface() + * @see #getPortKind() + * @generated + */ + EReference getPortKind_RequiredInterface(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.PortKind#isExtendedPort Extended Port}'. + * + * + * @return the meta object for the attribute 'Extended Port'. + * @see org.eclipse.papyrus.FCM.PortKind#isExtendedPort() + * @see #getPortKind() + * @generated + */ + EAttribute getPortKind_ExtendedPort(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.DeploymentPlan Deployment Plan}'. + * + * + * @return the meta object for class 'Deployment Plan'. + * @see org.eclipse.papyrus.FCM.DeploymentPlan + * @generated + */ + EClass getDeploymentPlan(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.DeploymentPlan#getMainInstance Main Instance}'. + * + * + * @return the meta object for the reference 'Main Instance'. + * @see org.eclipse.papyrus.FCM.DeploymentPlan#getMainInstance() + * @see #getDeploymentPlan() + * @generated + */ + EReference getDeploymentPlan_MainInstance(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.DeploymentPlan#getBase_Package Base Package}'. + * + * + * @return the meta object for the reference 'Base Package'. + * @see org.eclipse.papyrus.FCM.DeploymentPlan#getBase_Package() + * @see #getDeploymentPlan() + * @generated + */ + EReference getDeploymentPlan_Base_Package(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.DerivedElement Derived Element}'. + * + * + * @return the meta object for class 'Derived Element'. + * @see org.eclipse.papyrus.FCM.DerivedElement + * @generated + */ + EClass getDerivedElement(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.DerivedElement#getBase_Element Base Element}'. + * + * + * @return the meta object for the reference 'Base Element'. + * @see org.eclipse.papyrus.FCM.DerivedElement#getBase_Element() + * @see #getDerivedElement() + * @generated + */ + EReference getDerivedElement_Base_Element(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.DerivedElement#getSource Source}'. + * + * + * @return the meta object for the reference 'Source'. + * @see org.eclipse.papyrus.FCM.DerivedElement#getSource() + * @see #getDerivedElement() + * @generated + */ + EReference getDerivedElement_Source(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.CompImplTemplate Comp Impl Template}'. + * + * + * @return the meta object for class 'Comp Impl Template'. + * @see org.eclipse.papyrus.FCM.CompImplTemplate + * @generated + */ + EClass getCompImplTemplate(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.CompImplTemplate#getTemplateDefs Template Defs}'. + * + * + * @return the meta object for the attribute 'Template Defs'. + * @see org.eclipse.papyrus.FCM.CompImplTemplate#getTemplateDefs() + * @see #getCompImplTemplate() + * @generated + */ + EAttribute getCompImplTemplate_TemplateDefs(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CompImplTemplate#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.CompImplTemplate#getBase_Class() + * @see #getCompImplTemplate() + * @generated + */ + EReference getCompImplTemplate_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ImplementationProperties Implementation Properties}'. + * + * + * @return the meta object for class 'Implementation Properties'. + * @see org.eclipse.papyrus.FCM.ImplementationProperties + * @generated + */ + EClass getImplementationProperties(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSizeRAM Size RAM}'. + * + * + * @return the meta object for the attribute 'Size RAM'. + * @see org.eclipse.papyrus.FCM.ImplementationProperties#getSizeRAM() + * @see #getImplementationProperties() + * @generated + */ + EAttribute getImplementationProperties_SizeRAM(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedOS Supported OS}'. + * + * + * @return the meta object for the reference list 'Supported OS'. + * @see org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedOS() + * @see #getImplementationProperties() + * @generated + */ + EReference getImplementationProperties_SupportedOS(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getArch Arch}'. + * + * + * @return the meta object for the reference list 'Arch'. + * @see org.eclipse.papyrus.FCM.ImplementationProperties#getArch() + * @see #getImplementationProperties() + * @generated + */ + EReference getImplementationProperties_Arch(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.ImplementationProperties#getBase_Class() + * @see #getImplementationProperties() + * @generated + */ + EReference getImplementationProperties_Base_Class(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSizeROM Size ROM}'. + * + * + * @return the meta object for the attribute 'Size ROM'. + * @see org.eclipse.papyrus.FCM.ImplementationProperties#getSizeROM() + * @see #getImplementationProperties() + * @generated + */ + EAttribute getImplementationProperties_SizeROM(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedTargetArch Supported Target Arch}'. + * + * + * @return the meta object for the reference 'Supported Target Arch'. + * @see org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedTargetArch() + * @see #getImplementationProperties() + * @generated + */ + EReference getImplementationProperties_SupportedTargetArch(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.OperatingSystem Operating System}'. + * + * + * @return the meta object for class 'Operating System'. + * @see org.eclipse.papyrus.FCM.OperatingSystem + * @generated + */ + EClass getOperatingSystem(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.OperatingSystem#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.OperatingSystem#getBase_Class() + * @see #getOperatingSystem() + * @generated + */ + EReference getOperatingSystem_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.TargetArchitecture Target Architecture}'. + * + * + * @return the meta object for class 'Target Architecture'. + * @see org.eclipse.papyrus.FCM.TargetArchitecture + * @generated + */ + EClass getTargetArchitecture(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.TargetArchitecture#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.TargetArchitecture#getBase_Class() + * @see #getTargetArchitecture() + * @generated + */ + EReference getTargetArchitecture_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Configuration Configuration}'. + * + * + * @return the meta object for class 'Configuration'. + * @see org.eclipse.papyrus.FCM.Configuration + * @generated + */ + EClass getConfiguration(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Configuration#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.Configuration#getBase_Class() + * @see #getConfiguration() + * @generated + */ + EReference getConfiguration_Base_Class(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.Configuration#getConfigOptions Config Options}'. + * + * + * @return the meta object for the reference list 'Config Options'. + * @see org.eclipse.papyrus.FCM.Configuration#getConfigOptions() + * @see #getConfiguration() + * @generated + */ + EReference getConfiguration_ConfigOptions(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Configuration#getDeploymentPlan Deployment Plan}'. + * + * + * @return the meta object for the reference 'Deployment Plan'. + * @see org.eclipse.papyrus.FCM.Configuration#getDeploymentPlan() + * @see #getConfiguration() + * @generated + */ + EReference getConfiguration_DeploymentPlan(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.InterceptionRule Interception Rule}'. + * + * + * @return the meta object for class 'Interception Rule'. + * @see org.eclipse.papyrus.FCM.InterceptionRule + * @generated + */ + EClass getInterceptionRule(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionKind Interception Kind}'. + * + * + * @return the meta object for the attribute 'Interception Kind'. + * @see org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionKind() + * @see #getInterceptionRule() + * @generated + */ + EAttribute getInterceptionRule_InterceptionKind(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionSet Interception Set}'. + * + * + * @return the meta object for the reference list 'Interception Set'. + * @see org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionSet() + * @see #getInterceptionRule() + * @generated + */ + EReference getInterceptionRule_InterceptionSet(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.InterceptionRule#getBase_Property Base Property}'. + * + * + * @return the meta object for the reference 'Base Property'. + * @see org.eclipse.papyrus.FCM.InterceptionRule#getBase_Property() + * @see #getInterceptionRule() + * @generated + */ + EReference getInterceptionRule_Base_Property(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.InterceptionRule#getBase_Operation Base Operation}'. + * + * + * @return the meta object for the reference 'Base Operation'. + * @see org.eclipse.papyrus.FCM.InterceptionRule#getBase_Operation() + * @see #getInterceptionRule() + * @generated + */ + EReference getInterceptionRule_Base_Operation(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Target Target}'. + * + * + * @return the meta object for class 'Target'. + * @see org.eclipse.papyrus.FCM.Target + * @generated + */ + EClass getTarget(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Target#getTargetArch Target Arch}'. + * + * + * @return the meta object for the reference 'Target Arch'. + * @see org.eclipse.papyrus.FCM.Target#getTargetArch() + * @see #getTarget() + * @generated + */ + EReference getTarget_TargetArch(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.Target#getOptions Options}'. + * + * + * @return the meta object for the reference list 'Options'. + * @see org.eclipse.papyrus.FCM.Target#getOptions() + * @see #getTarget() + * @generated + */ + EReference getTarget_Options(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Target#getBase_Node Base Node}'. + * + * + * @return the meta object for the reference 'Base Node'. + * @see org.eclipse.papyrus.FCM.Target#getBase_Node() + * @see #getTarget() + * @generated + */ + EReference getTarget_Base_Node(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Target#getUsedOS Used OS}'. + * + * + * @return the meta object for the reference 'Used OS'. + * @see org.eclipse.papyrus.FCM.Target#getUsedOS() + * @see #getTarget() + * @generated + */ + EReference getTarget_UsedOS(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.Target#getAvailRAM Avail RAM}'. + * + * + * @return the meta object for the attribute 'Avail RAM'. + * @see org.eclipse.papyrus.FCM.Target#getAvailRAM() + * @see #getTarget() + * @generated + */ + EAttribute getTarget_AvailRAM(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.FCM.Target#getAvailROM Avail ROM}'. + * + * + * @return the meta object for the attribute 'Avail ROM'. + * @see org.eclipse.papyrus.FCM.Target#getAvailROM() + * @see #getTarget() + * @generated + */ + EAttribute getTarget_AvailROM(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Target#getCompiler Compiler}'. + * + * + * @return the meta object for the reference 'Compiler'. + * @see org.eclipse.papyrus.FCM.Target#getCompiler() + * @see #getTarget() + * @generated + */ + EReference getTarget_Compiler(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.CompilerChain Compiler Chain}'. + * + * + * @return the meta object for class 'Compiler Chain'. + * @see org.eclipse.papyrus.FCM.CompilerChain + * @generated + */ + EClass getCompilerChain(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CompilerChain#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.CompilerChain#getBase_Class() + * @see #getCompilerChain() + * @generated + */ + EReference getCompilerChain_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.Fragment Fragment}'. + * + * + * @return the meta object for class 'Fragment'. + * @see org.eclipse.papyrus.FCM.Fragment + * @generated + */ + EClass getFragment(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.Fragment#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.Fragment#getBase_Class() + * @see #getFragment() + * @generated + */ + EReference getFragment_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.CopyAttributeValue Copy Attribute Value}'. + * + * + * @return the meta object for class 'Copy Attribute Value'. + * @see org.eclipse.papyrus.FCM.CopyAttributeValue + * @generated + */ + EClass getCopyAttributeValue(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CopyAttributeValue#getSource Source}'. + * + * + * @return the meta object for the reference 'Source'. + * @see org.eclipse.papyrus.FCM.CopyAttributeValue#getSource() + * @see #getCopyAttributeValue() + * @generated + */ + EReference getCopyAttributeValue_Source(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.CopyAttributeValue#getBase_Property Base Property}'. + * + * + * @return the meta object for the reference 'Base Property'. + * @see org.eclipse.papyrus.FCM.CopyAttributeValue#getBase_Property() + * @see #getCopyAttributeValue() + * @generated + */ + EReference getCopyAttributeValue_Base_Property(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.AutoIndex Auto Index}'. + * + * + * @return the meta object for class 'Auto Index'. + * @see org.eclipse.papyrus.FCM.AutoIndex + * @generated + */ + EClass getAutoIndex(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.AutoIndex#getBase_Property Base Property}'. + * + * + * @return the meta object for the reference 'Base Property'. + * @see org.eclipse.papyrus.FCM.AutoIndex#getBase_Property() + * @see #getAutoIndex() + * @generated + */ + EReference getAutoIndex_Base_Property(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.AutoIndexPerNode Auto Index Per Node}'. + * + * + * @return the meta object for class 'Auto Index Per Node'. + * @see org.eclipse.papyrus.FCM.AutoIndexPerNode + * @generated + */ + EClass getAutoIndexPerNode(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.InitPrecedence Init Precedence}'. + * + * + * @return the meta object for class 'Init Precedence'. + * @see org.eclipse.papyrus.FCM.InitPrecedence + * @generated + */ + EClass getInitPrecedence(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.InitPrecedence#getInvokeAfter Invoke After}'. + * + * + * @return the meta object for the reference list 'Invoke After'. + * @see org.eclipse.papyrus.FCM.InitPrecedence#getInvokeAfter() + * @see #getInitPrecedence() + * @generated + */ + EReference getInitPrecedence_InvokeAfter(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.InitPrecedence#getInvokeBefore Invoke Before}'. + * + * + * @return the meta object for the reference list 'Invoke Before'. + * @see org.eclipse.papyrus.FCM.InitPrecedence#getInvokeBefore() + * @see #getInitPrecedence() + * @generated + */ + EReference getInitPrecedence_InvokeBefore(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.InitPrecedence#getBase_Class Base Class}'. + * + * + * @return the meta object for the reference 'Base Class'. + * @see org.eclipse.papyrus.FCM.InitPrecedence#getBase_Class() + * @see #getInitPrecedence() + * @generated + */ + EReference getInitPrecedence_Base_Class(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.ConnectorConfiguration Connector Configuration}'. + * + * + * @return the meta object for class 'Connector Configuration'. + * @see org.eclipse.papyrus.FCM.ConnectorConfiguration + * @generated + */ + EClass getConnectorConfiguration(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ConnectorConfiguration#getBase_Slot Base Slot}'. + * + * + * @return the meta object for the reference 'Base Slot'. + * @see org.eclipse.papyrus.FCM.ConnectorConfiguration#getBase_Slot() + * @see #getConnectorConfiguration() + * @generated + */ + EReference getConnectorConfiguration_Base_Slot(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.ConnectorConfiguration#getConnector Connector}'. + * + * + * @return the meta object for the reference 'Connector'. + * @see org.eclipse.papyrus.FCM.ConnectorConfiguration#getConnector() + * @see #getConnectorConfiguration() + * @generated + */ + EReference getConnectorConfiguration_Connector(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.FCM.BindTemplate Bind Template}'. + * + * + * @return the meta object for class 'Bind Template'. + * @see org.eclipse.papyrus.FCM.BindTemplate + * @generated + */ + EClass getBindTemplate(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.FCM.BindTemplate#getActual Actual}'. + * + * + * @return the meta object for the reference list 'Actual'. + * @see org.eclipse.papyrus.FCM.BindTemplate#getActual() + * @see #getBindTemplate() + * @generated + */ + EReference getBindTemplate_Actual(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.FCM.BindTemplate#getBase_Property Base Property}'. + * + * + * @return the meta object for the reference 'Base Property'. + * @see org.eclipse.papyrus.FCM.BindTemplate#getBase_Property() + * @see #getBindTemplate() + * @generated + */ + EReference getBindTemplate_Base_Property(); + + /** + * Returns the meta object for enum '{@link org.eclipse.papyrus.FCM.ContainerRuleKind Container Rule Kind}'. + * + * + * @return the meta object for enum 'Container Rule Kind'. + * @see org.eclipse.papyrus.FCM.ContainerRuleKind + * @generated + */ + EEnum getContainerRuleKind(); + + /** + * Returns the meta object for enum '{@link org.eclipse.papyrus.FCM.InterceptionKind Interception Kind}'. + * + * + * @return the meta object for enum 'Interception Kind'. + * @see org.eclipse.papyrus.FCM.InterceptionKind + * @generated + */ + EEnum getInterceptionKind(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + FCMFactory getFCMFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
      + *
    • each class,
    • + *
    • each feature of each class,
    • + *
    • each enum,
    • + *
    • and each data type
    • + *
    + * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.TemplateImpl Template}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.TemplateImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTemplate() + * @generated + */ + EClass TEMPLATE = eINSTANCE.getTemplate(); + + /** + * The meta object literal for the 'Base Element' reference feature. + * + * + * @generated + */ + EReference TEMPLATE__BASE_ELEMENT = eINSTANCE.getTemplate_Base_Element(); + + /** + * The meta object literal for the 'Helper' reference feature. + * + * + * @generated + */ + EReference TEMPLATE__HELPER = eINSTANCE.getTemplate_Helper(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.BindingHelperImpl Binding Helper}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.BindingHelperImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getBindingHelper() + * @generated + */ + EClass BINDING_HELPER = eINSTANCE.getBindingHelper(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference BINDING_HELPER__BASE_CLASS = eINSTANCE.getBindingHelper_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ConfigurationPropertyImpl Configuration Property}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ConfigurationPropertyImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfigurationProperty() + * @generated + */ + EClass CONFIGURATION_PROPERTY = eINSTANCE.getConfigurationProperty(); + + /** + * The meta object literal for the 'Base Property' reference feature. + * + * + * @generated + */ + EReference CONFIGURATION_PROPERTY__BASE_PROPERTY = eINSTANCE.getConfigurationProperty_Base_Property(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ImplementationGroupImpl Implementation Group}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ImplementationGroupImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getImplementationGroup() + * @generated + */ + EClass IMPLEMENTATION_GROUP = eINSTANCE.getImplementationGroup(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference IMPLEMENTATION_GROUP__BASE_CLASS = eINSTANCE.getImplementationGroup_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.AssemblyImpl Assembly}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.AssemblyImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getAssembly() + * @generated + */ + EClass ASSEMBLY = eINSTANCE.getAssembly(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference ASSEMBLY__BASE_CLASS = eINSTANCE.getAssembly_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.FlattenImpl Flatten}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.FlattenImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getFlatten() + * @generated + */ + EClass FLATTEN = eINSTANCE.getFlatten(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference FLATTEN__BASE_CLASS = eINSTANCE.getFlatten_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.CompToOOmappingImpl Comp To OOmapping}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.CompToOOmappingImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCompToOOmapping() + * @generated + */ + EClass COMP_TO_OOMAPPING = eINSTANCE.getCompToOOmapping(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference COMP_TO_OOMAPPING__BASE_CLASS = eINSTANCE.getCompToOOmapping_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ProgLanguageImpl Prog Language}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ProgLanguageImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getProgLanguage() + * @generated + */ + EClass PROG_LANGUAGE = eINSTANCE.getProgLanguage(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference PROG_LANGUAGE__BASE_CLASS = eINSTANCE.getProgLanguage_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl Code Gen Options}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCodeGenOptions() + * @generated + */ + EClass CODE_GEN_OPTIONS = eINSTANCE.getCodeGenOptions(); + + /** + * The meta object literal for the 'Base Package' reference feature. + * + * + * @generated + */ + EReference CODE_GEN_OPTIONS__BASE_PACKAGE = eINSTANCE.getCodeGenOptions_Base_Package(); + + /** + * The meta object literal for the 'Comp To OOmapping' reference feature. + * + * + * @generated + */ + EReference CODE_GEN_OPTIONS__COMP_TO_OOMAPPING = eINSTANCE.getCodeGenOptions_CompToOOmapping(); + + /** + * The meta object literal for the 'Prog Language' reference feature. + * + * + * @generated + */ + EReference CODE_GEN_OPTIONS__PROG_LANGUAGE = eINSTANCE.getCodeGenOptions_ProgLanguage(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.InteractionComponentImpl Interaction Component}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.InteractionComponentImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInteractionComponent() + * @generated + */ + EClass INTERACTION_COMPONENT = eINSTANCE.getInteractionComponent(); + + /** + * The meta object literal for the 'For Distribution' attribute feature. + * + * + * @generated + */ + EAttribute INTERACTION_COMPONENT__FOR_DISTRIBUTION = eINSTANCE.getInteractionComponent_ForDistribution(); + + /** + * The meta object literal for the 'Connection Pattern' reference feature. + * + * + * @generated + */ + EReference INTERACTION_COMPONENT__CONNECTION_PATTERN = eINSTANCE.getInteractionComponent_ConnectionPattern(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference INTERACTION_COMPONENT__BASE_CLASS = eINSTANCE.getInteractionComponent_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.SingletonImpl Singleton}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.SingletonImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getSingleton() + * @generated + */ + EClass SINGLETON = eINSTANCE.getSingleton(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference SINGLETON__BASE_CLASS = eINSTANCE.getSingleton_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ConnectorImpl Connector}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ConnectorImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConnector() + * @generated + */ + EClass CONNECTOR = eINSTANCE.getConnector(); + + /** + * The meta object literal for the 'Base Connector' reference feature. + * + * + * @generated + */ + EReference CONNECTOR__BASE_CONNECTOR = eINSTANCE.getConnector_Base_Connector(); + + /** + * The meta object literal for the 'Ic' reference feature. + * + * + * @generated + */ + EReference CONNECTOR__IC = eINSTANCE.getConnector_Ic(); + + /** + * The meta object literal for the 'Base Property' reference feature. + * + * + * @generated + */ + EReference CONNECTOR__BASE_PROPERTY = eINSTANCE.getConnector_Base_Property(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ConfigurableElementInstanceImpl Configurable Element Instance}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ConfigurableElementInstanceImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfigurableElementInstance() + * @generated + */ + EClass CONFIGURABLE_ELEMENT_INSTANCE = eINSTANCE.getConfigurableElementInstance(); + + /** + * The meta object literal for the 'Configuration' reference feature. + * + * + * @generated + */ + EReference CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION = eINSTANCE.getConfigurableElementInstance_Configuration(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.UseInstanceConfiguratorImpl Use Instance Configurator}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.UseInstanceConfiguratorImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getUseInstanceConfigurator() + * @generated + */ + EClass USE_INSTANCE_CONFIGURATOR = eINSTANCE.getUseInstanceConfigurator(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference USE_INSTANCE_CONFIGURATOR__BASE_CLASS = eINSTANCE.getUseInstanceConfigurator_Base_Class(); + + /** + * The meta object literal for the 'Configurator' reference feature. + * + * + * @generated + */ + EReference USE_INSTANCE_CONFIGURATOR__CONFIGURATOR = eINSTANCE.getUseInstanceConfigurator_Configurator(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.InstanceConfiguratorImpl Instance Configurator}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.InstanceConfiguratorImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInstanceConfigurator() + * @generated + */ + EClass INSTANCE_CONFIGURATOR = eINSTANCE.getInstanceConfigurator(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference INSTANCE_CONFIGURATOR__BASE_CLASS = eINSTANCE.getInstanceConfigurator_Base_Class(); + + /** + * The meta object literal for the 'On Node Model' attribute feature. + * + * + * @generated + */ + EAttribute INSTANCE_CONFIGURATOR__ON_NODE_MODEL = eINSTANCE.getInstanceConfigurator_OnNodeModel(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.RuleApplicationImpl Rule Application}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.RuleApplicationImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getRuleApplication() + * @generated + */ + EClass RULE_APPLICATION = eINSTANCE.getRuleApplication(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference RULE_APPLICATION__BASE_CLASS = eINSTANCE.getRuleApplication_Base_Class(); + + /** + * The meta object literal for the 'Container Rule' reference list feature. + * + * + * @generated + */ + EReference RULE_APPLICATION__CONTAINER_RULE = eINSTANCE.getRuleApplication_ContainerRule(); + + /** + * The meta object literal for the 'Base Package' reference feature. + * + * + * @generated + */ + EReference RULE_APPLICATION__BASE_PACKAGE = eINSTANCE.getRuleApplication_Base_Package(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ContainerRuleImpl Container Rule}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ContainerRuleImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getContainerRule() + * @generated + */ + EClass CONTAINER_RULE = eINSTANCE.getContainerRule(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference CONTAINER_RULE__BASE_CLASS = eINSTANCE.getContainerRule_Base_Class(); + + /** + * The meta object literal for the 'For Config' reference list feature. + * + * + * @generated + */ + EReference CONTAINER_RULE__FOR_CONFIG = eINSTANCE.getContainerRule_ForConfig(); + + /** + * The meta object literal for the 'Kind' attribute feature. + * + * + * @generated + */ + EAttribute CONTAINER_RULE__KIND = eINSTANCE.getContainerRule_Kind(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ConfigOptionImpl Config Option}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ConfigOptionImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfigOption() + * @generated + */ + EClass CONFIG_OPTION = eINSTANCE.getConfigOption(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference CONFIG_OPTION__BASE_CLASS = eINSTANCE.getConfigOption_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.TemplatePortImpl Template Port}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.TemplatePortImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTemplatePort() + * @generated + */ + EClass TEMPLATE_PORT = eINSTANCE.getTemplatePort(); + + /** + * The meta object literal for the 'Bound Type' reference feature. + * + * + * @generated + */ + EReference TEMPLATE_PORT__BOUND_TYPE = eINSTANCE.getTemplatePort_BoundType(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.PortImpl Port}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.PortImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getPort() + * @generated + */ + EClass PORT = eINSTANCE.getPort(); + + /** + * The meta object literal for the 'Base Port' reference feature. + * + * + * @generated + */ + EReference PORT__BASE_PORT = eINSTANCE.getPort_Base_Port(); + + /** + * The meta object literal for the 'Kind' reference feature. + * + * + * @generated + */ + EReference PORT__KIND = eINSTANCE.getPort_Kind(); + + /** + * The meta object literal for the 'Type' reference feature. + * + * + * @generated + */ + EReference PORT__TYPE = eINSTANCE.getPort_Type(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.PortKindImpl Port Kind}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.PortKindImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getPortKind() + * @generated + */ + EClass PORT_KIND = eINSTANCE.getPortKind(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference PORT_KIND__BASE_CLASS = eINSTANCE.getPortKind_Base_Class(); + + /** + * The meta object literal for the 'Provided Interface' reference feature. + * + * + * @generated + */ + EReference PORT_KIND__PROVIDED_INTERFACE = eINSTANCE.getPortKind_ProvidedInterface(); + + /** + * The meta object literal for the 'Required Interface' reference feature. + * + * + * @generated + */ + EReference PORT_KIND__REQUIRED_INTERFACE = eINSTANCE.getPortKind_RequiredInterface(); + + /** + * The meta object literal for the 'Extended Port' attribute feature. + * + * + * @generated + */ + EAttribute PORT_KIND__EXTENDED_PORT = eINSTANCE.getPortKind_ExtendedPort(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.DeploymentPlanImpl Deployment Plan}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.DeploymentPlanImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getDeploymentPlan() + * @generated + */ + EClass DEPLOYMENT_PLAN = eINSTANCE.getDeploymentPlan(); + + /** + * The meta object literal for the 'Main Instance' reference feature. + * + * + * @generated + */ + EReference DEPLOYMENT_PLAN__MAIN_INSTANCE = eINSTANCE.getDeploymentPlan_MainInstance(); + + /** + * The meta object literal for the 'Base Package' reference feature. + * + * + * @generated + */ + EReference DEPLOYMENT_PLAN__BASE_PACKAGE = eINSTANCE.getDeploymentPlan_Base_Package(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.DerivedElementImpl Derived Element}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.DerivedElementImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getDerivedElement() + * @generated + */ + EClass DERIVED_ELEMENT = eINSTANCE.getDerivedElement(); + + /** + * The meta object literal for the 'Base Element' reference feature. + * + * + * @generated + */ + EReference DERIVED_ELEMENT__BASE_ELEMENT = eINSTANCE.getDerivedElement_Base_Element(); + + /** + * The meta object literal for the 'Source' reference feature. + * + * + * @generated + */ + EReference DERIVED_ELEMENT__SOURCE = eINSTANCE.getDerivedElement_Source(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.CompImplTemplateImpl Comp Impl Template}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.CompImplTemplateImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCompImplTemplate() + * @generated + */ + EClass COMP_IMPL_TEMPLATE = eINSTANCE.getCompImplTemplate(); + + /** + * The meta object literal for the 'Template Defs' attribute feature. + * + * + * @generated + */ + EAttribute COMP_IMPL_TEMPLATE__TEMPLATE_DEFS = eINSTANCE.getCompImplTemplate_TemplateDefs(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference COMP_IMPL_TEMPLATE__BASE_CLASS = eINSTANCE.getCompImplTemplate_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl Implementation Properties}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getImplementationProperties() + * @generated + */ + EClass IMPLEMENTATION_PROPERTIES = eINSTANCE.getImplementationProperties(); + + /** + * The meta object literal for the 'Size RAM' attribute feature. + * + * + * @generated + */ + EAttribute IMPLEMENTATION_PROPERTIES__SIZE_RAM = eINSTANCE.getImplementationProperties_SizeRAM(); + + /** + * The meta object literal for the 'Supported OS' reference list feature. + * + * + * @generated + */ + EReference IMPLEMENTATION_PROPERTIES__SUPPORTED_OS = eINSTANCE.getImplementationProperties_SupportedOS(); + + /** + * The meta object literal for the 'Arch' reference list feature. + * + * + * @generated + */ + EReference IMPLEMENTATION_PROPERTIES__ARCH = eINSTANCE.getImplementationProperties_Arch(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference IMPLEMENTATION_PROPERTIES__BASE_CLASS = eINSTANCE.getImplementationProperties_Base_Class(); + + /** + * The meta object literal for the 'Size ROM' attribute feature. + * + * + * @generated + */ + EAttribute IMPLEMENTATION_PROPERTIES__SIZE_ROM = eINSTANCE.getImplementationProperties_SizeROM(); + + /** + * The meta object literal for the 'Supported Target Arch' reference feature. + * + * + * @generated + */ + EReference IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH = eINSTANCE.getImplementationProperties_SupportedTargetArch(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.OperatingSystemImpl Operating System}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.OperatingSystemImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getOperatingSystem() + * @generated + */ + EClass OPERATING_SYSTEM = eINSTANCE.getOperatingSystem(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference OPERATING_SYSTEM__BASE_CLASS = eINSTANCE.getOperatingSystem_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.TargetArchitectureImpl Target Architecture}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.TargetArchitectureImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTargetArchitecture() + * @generated + */ + EClass TARGET_ARCHITECTURE = eINSTANCE.getTargetArchitecture(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference TARGET_ARCHITECTURE__BASE_CLASS = eINSTANCE.getTargetArchitecture_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ConfigurationImpl Configuration}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ConfigurationImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConfiguration() + * @generated + */ + EClass CONFIGURATION = eINSTANCE.getConfiguration(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference CONFIGURATION__BASE_CLASS = eINSTANCE.getConfiguration_Base_Class(); + + /** + * The meta object literal for the 'Config Options' reference list feature. + * + * + * @generated + */ + EReference CONFIGURATION__CONFIG_OPTIONS = eINSTANCE.getConfiguration_ConfigOptions(); + + /** + * The meta object literal for the 'Deployment Plan' reference feature. + * + * + * @generated + */ + EReference CONFIGURATION__DEPLOYMENT_PLAN = eINSTANCE.getConfiguration_DeploymentPlan(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl Interception Rule}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInterceptionRule() + * @generated + */ + EClass INTERCEPTION_RULE = eINSTANCE.getInterceptionRule(); + + /** + * The meta object literal for the 'Interception Kind' attribute feature. + * + * + * @generated + */ + EAttribute INTERCEPTION_RULE__INTERCEPTION_KIND = eINSTANCE.getInterceptionRule_InterceptionKind(); + + /** + * The meta object literal for the 'Interception Set' reference list feature. + * + * + * @generated + */ + EReference INTERCEPTION_RULE__INTERCEPTION_SET = eINSTANCE.getInterceptionRule_InterceptionSet(); + + /** + * The meta object literal for the 'Base Property' reference feature. + * + * + * @generated + */ + EReference INTERCEPTION_RULE__BASE_PROPERTY = eINSTANCE.getInterceptionRule_Base_Property(); + + /** + * The meta object literal for the 'Base Operation' reference feature. + * + * + * @generated + */ + EReference INTERCEPTION_RULE__BASE_OPERATION = eINSTANCE.getInterceptionRule_Base_Operation(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.TargetImpl Target}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.TargetImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getTarget() + * @generated + */ + EClass TARGET = eINSTANCE.getTarget(); + + /** + * The meta object literal for the 'Target Arch' reference feature. + * + * + * @generated + */ + EReference TARGET__TARGET_ARCH = eINSTANCE.getTarget_TargetArch(); + + /** + * The meta object literal for the 'Options' reference list feature. + * + * + * @generated + */ + EReference TARGET__OPTIONS = eINSTANCE.getTarget_Options(); + + /** + * The meta object literal for the 'Base Node' reference feature. + * + * + * @generated + */ + EReference TARGET__BASE_NODE = eINSTANCE.getTarget_Base_Node(); + + /** + * The meta object literal for the 'Used OS' reference feature. + * + * + * @generated + */ + EReference TARGET__USED_OS = eINSTANCE.getTarget_UsedOS(); + + /** + * The meta object literal for the 'Avail RAM' attribute feature. + * + * + * @generated + */ + EAttribute TARGET__AVAIL_RAM = eINSTANCE.getTarget_AvailRAM(); + + /** + * The meta object literal for the 'Avail ROM' attribute feature. + * + * + * @generated + */ + EAttribute TARGET__AVAIL_ROM = eINSTANCE.getTarget_AvailROM(); + + /** + * The meta object literal for the 'Compiler' reference feature. + * + * + * @generated + */ + EReference TARGET__COMPILER = eINSTANCE.getTarget_Compiler(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.CompilerChainImpl Compiler Chain}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.CompilerChainImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCompilerChain() + * @generated + */ + EClass COMPILER_CHAIN = eINSTANCE.getCompilerChain(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference COMPILER_CHAIN__BASE_CLASS = eINSTANCE.getCompilerChain_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.FragmentImpl Fragment}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.FragmentImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getFragment() + * @generated + */ + EClass FRAGMENT = eINSTANCE.getFragment(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference FRAGMENT__BASE_CLASS = eINSTANCE.getFragment_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.CopyAttributeValueImpl Copy Attribute Value}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.CopyAttributeValueImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getCopyAttributeValue() + * @generated + */ + EClass COPY_ATTRIBUTE_VALUE = eINSTANCE.getCopyAttributeValue(); + + /** + * The meta object literal for the 'Source' reference feature. + * + * + * @generated + */ + EReference COPY_ATTRIBUTE_VALUE__SOURCE = eINSTANCE.getCopyAttributeValue_Source(); + + /** + * The meta object literal for the 'Base Property' reference feature. + * + * + * @generated + */ + EReference COPY_ATTRIBUTE_VALUE__BASE_PROPERTY = eINSTANCE.getCopyAttributeValue_Base_Property(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.AutoIndexImpl Auto Index}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.AutoIndexImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getAutoIndex() + * @generated + */ + EClass AUTO_INDEX = eINSTANCE.getAutoIndex(); + + /** + * The meta object literal for the 'Base Property' reference feature. + * + * + * @generated + */ + EReference AUTO_INDEX__BASE_PROPERTY = eINSTANCE.getAutoIndex_Base_Property(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.AutoIndexPerNodeImpl Auto Index Per Node}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.AutoIndexPerNodeImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getAutoIndexPerNode() + * @generated + */ + EClass AUTO_INDEX_PER_NODE = eINSTANCE.getAutoIndexPerNode(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl Init Precedence}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInitPrecedence() + * @generated + */ + EClass INIT_PRECEDENCE = eINSTANCE.getInitPrecedence(); + + /** + * The meta object literal for the 'Invoke After' reference list feature. + * + * + * @generated + */ + EReference INIT_PRECEDENCE__INVOKE_AFTER = eINSTANCE.getInitPrecedence_InvokeAfter(); + + /** + * The meta object literal for the 'Invoke Before' reference list feature. + * + * + * @generated + */ + EReference INIT_PRECEDENCE__INVOKE_BEFORE = eINSTANCE.getInitPrecedence_InvokeBefore(); + + /** + * The meta object literal for the 'Base Class' reference feature. + * + * + * @generated + */ + EReference INIT_PRECEDENCE__BASE_CLASS = eINSTANCE.getInitPrecedence_Base_Class(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.ConnectorConfigurationImpl Connector Configuration}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.ConnectorConfigurationImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getConnectorConfiguration() + * @generated + */ + EClass CONNECTOR_CONFIGURATION = eINSTANCE.getConnectorConfiguration(); + + /** + * The meta object literal for the 'Base Slot' reference feature. + * + * + * @generated + */ + EReference CONNECTOR_CONFIGURATION__BASE_SLOT = eINSTANCE.getConnectorConfiguration_Base_Slot(); + + /** + * The meta object literal for the 'Connector' reference feature. + * + * + * @generated + */ + EReference CONNECTOR_CONFIGURATION__CONNECTOR = eINSTANCE.getConnectorConfiguration_Connector(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.impl.BindTemplateImpl Bind Template}' class. + * + * + * @see org.eclipse.papyrus.FCM.impl.BindTemplateImpl + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getBindTemplate() + * @generated + */ + EClass BIND_TEMPLATE = eINSTANCE.getBindTemplate(); + + /** + * The meta object literal for the 'Actual' reference list feature. + * + * + * @generated + */ + EReference BIND_TEMPLATE__ACTUAL = eINSTANCE.getBindTemplate_Actual(); + + /** + * The meta object literal for the 'Base Property' reference feature. + * + * + * @generated + */ + EReference BIND_TEMPLATE__BASE_PROPERTY = eINSTANCE.getBindTemplate_Base_Property(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.ContainerRuleKind Container Rule Kind}' enum. + * + * + * @see org.eclipse.papyrus.FCM.ContainerRuleKind + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getContainerRuleKind() + * @generated + */ + EEnum CONTAINER_RULE_KIND = eINSTANCE.getContainerRuleKind(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.FCM.InterceptionKind Interception Kind}' enum. + * + * + * @see org.eclipse.papyrus.FCM.InterceptionKind + * @see org.eclipse.papyrus.FCM.impl.FCMPackageImpl#getInterceptionKind() + * @generated + */ + EEnum INTERCEPTION_KIND = eINSTANCE.getInterceptionKind(); + + } + +} // FCMPackage diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Flatten.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Flatten.java new file mode 100644 index 00000000000..9a89c91f924 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Flatten.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Flatten'. + * + * + * + * A composite that will get flattened during distribution. This means that it vanishes and its parts are added to the composite in which the flat composite is defined. A flat composite may not have assembly connections. It is primarily used by interaction components + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.Flatten#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getFlatten() + * @model + * @generated + */ +public interface Flatten extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getFlatten_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Flatten#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // Flatten diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Fragment.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Fragment.java new file mode 100644 index 00000000000..53f4baac33e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Fragment.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Fragment'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.Fragment#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getFragment() + * @model + * @generated + */ +public interface Fragment extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getFragment_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Fragment#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // Fragment diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationGroup.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationGroup.java new file mode 100644 index 00000000000..fc79e9d0ea6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationGroup.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Implementation Group'. + * + * + * + * A group of interaction components should apply both stereotypes. Each member of such a group must be an interaction component, but this is not enforced by the meta-model + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.ImplementationGroup#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationGroup() + * @model + * @generated + */ +public interface ImplementationGroup extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationGroup_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.ImplementationGroup#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // ImplementationGroup diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationProperties.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationProperties.java new file mode 100644 index 00000000000..8a3bd56e5bc --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ImplementationProperties.java @@ -0,0 +1,170 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Implementation Properties'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.ImplementationProperties#getSizeRAM Size RAM}
    • + *
    • {@link org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedOS Supported OS}
    • + *
    • {@link org.eclipse.papyrus.FCM.ImplementationProperties#getArch Arch}
    • + *
    • {@link org.eclipse.papyrus.FCM.ImplementationProperties#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.ImplementationProperties#getSizeROM Size ROM}
    • + *
    • {@link org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedTargetArch Supported Target Arch}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties() + * @model + * @generated + */ +public interface ImplementationProperties extends EObject { + /** + * Returns the value of the 'Size RAM' attribute. + * + *

    + * If the meaning of the 'Size RAM' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Size RAM' attribute. + * @see #setSizeRAM(int) + * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties_SizeRAM() + * @model unique="false" dataType="org.eclipse.uml2.types.Integer" required="true" ordered="false" + * @generated + */ + int getSizeRAM(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSizeRAM Size RAM}' attribute. + * + * + * @param value the new value of the 'Size RAM' attribute. + * @see #getSizeRAM() + * @generated + */ + void setSizeRAM(int value); + + /** + * Returns the value of the 'Supported OS' reference list. + * The list contents are of type {@link org.eclipse.papyrus.FCM.OperatingSystem}. + * + *

    + * If the meaning of the 'Supported OS' reference list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Supported OS' reference list. + * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties_SupportedOS() + * @model ordered="false" + * @generated + */ + EList getSupportedOS(); + + /** + * Returns the value of the 'Arch' reference list. + * The list contents are of type {@link org.eclipse.papyrus.FCM.TargetArchitecture}. + * + *

    + * If the meaning of the 'Arch' reference list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Arch' reference list. + * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties_Arch() + * @model ordered="false" + * @generated + */ + EList getArch(); + + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + + /** + * Returns the value of the 'Size ROM' attribute. + * + *

    + * If the meaning of the 'Size ROM' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Size ROM' attribute. + * @see #setSizeROM(int) + * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties_SizeROM() + * @model dataType="org.eclipse.uml2.types.Integer" required="true" ordered="false" + * @generated + */ + int getSizeROM(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSizeROM Size ROM}' attribute. + * + * + * @param value the new value of the 'Size ROM' attribute. + * @see #getSizeROM() + * @generated + */ + void setSizeROM(int value); + + /** + * Returns the value of the 'Supported Target Arch' reference. + * + *

    + * If the meaning of the 'Supported Target Arch' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Supported Target Arch' reference. + * @see #setSupportedTargetArch(TargetArchitecture) + * @see org.eclipse.papyrus.FCM.FCMPackage#getImplementationProperties_SupportedTargetArch() + * @model required="true" ordered="false" + * @generated + */ + TargetArchitecture getSupportedTargetArch(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.ImplementationProperties#getSupportedTargetArch Supported Target Arch}' reference. + * + * + * @param value the new value of the 'Supported Target Arch' reference. + * @see #getSupportedTargetArch() + * @generated + */ + void setSupportedTargetArch(TargetArchitecture value); + +} // ImplementationProperties diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InitPrecedence.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InitPrecedence.java new file mode 100644 index 00000000000..8c6af695105 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InitPrecedence.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Init Precedence'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.InitPrecedence#getInvokeAfter Invoke After}
    • + *
    • {@link org.eclipse.papyrus.FCM.InitPrecedence#getInvokeBefore Invoke Before}
    • + *
    • {@link org.eclipse.papyrus.FCM.InitPrecedence#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getInitPrecedence() + * @model + * @generated + */ +public interface InitPrecedence extends EObject { + /** + * Returns the value of the 'Invoke After' reference list. + * The list contents are of type {@link org.eclipse.uml2.uml.Class}. + * + *

    + * If the meaning of the 'Invoke After' reference list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Invoke After' reference list. + * @see org.eclipse.papyrus.FCM.FCMPackage#getInitPrecedence_InvokeAfter() + * @model ordered="false" + * @generated + */ + EList getInvokeAfter(); + + /** + * Returns the value of the 'Invoke Before' reference list. + * The list contents are of type {@link org.eclipse.uml2.uml.Class}. + * + *

    + * If the meaning of the 'Invoke Before' reference list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Invoke Before' reference list. + * @see org.eclipse.papyrus.FCM.FCMPackage#getInitPrecedence_InvokeBefore() + * @model ordered="false" + * @generated + */ + EList getInvokeBefore(); + + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getInitPrecedence_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.InitPrecedence#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // InitPrecedence diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InstanceConfigurator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InstanceConfigurator.java new file mode 100644 index 00000000000..bb463ad5340 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InstanceConfigurator.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Instance Configurator'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.InstanceConfigurator#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.InstanceConfigurator#isOnNodeModel On Node Model}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getInstanceConfigurator() + * @model + * @generated + */ +public interface InstanceConfigurator extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getInstanceConfigurator_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.InstanceConfigurator#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + + /** + * Returns the value of the 'On Node Model' attribute. + * + *

    + * If the meaning of the 'On Node Model' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'On Node Model' attribute. + * @see #setOnNodeModel(boolean) + * @see org.eclipse.papyrus.FCM.FCMPackage#getInstanceConfigurator_OnNodeModel() + * @model dataType="org.eclipse.uml2.types.Boolean" ordered="false" + * @generated + */ + boolean isOnNodeModel(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.InstanceConfigurator#isOnNodeModel On Node Model}' attribute. + * + * + * @param value the new value of the 'On Node Model' attribute. + * @see #isOnNodeModel() + * @generated + */ + void setOnNodeModel(boolean value); + +} // InstanceConfigurator diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InteractionComponent.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InteractionComponent.java new file mode 100644 index 00000000000..cbef19b172b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InteractionComponent.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Collaboration; + +/** + * + * A representation of the model object 'Interaction Component'. + * + * + * + * An interaction component is responsible for realization the communication between two components. It typically owns conjugated ports. It might be defined within a package template to enable the adaption of ports to those used by the interacting components + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.InteractionComponent#isForDistribution For Distribution}
    • + *
    • {@link org.eclipse.papyrus.FCM.InteractionComponent#getConnectionPattern Connection Pattern}
    • + *
    • {@link org.eclipse.papyrus.FCM.InteractionComponent#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getInteractionComponent() + * @model + * @generated + */ +public interface InteractionComponent extends EObject { + /** + * Returns the value of the 'For Distribution' attribute. + * The default value is "false". + * + *

    + * If the meaning of the 'For Distribution' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'For Distribution' attribute. + * @see #setForDistribution(boolean) + * @see org.eclipse.papyrus.FCM.FCMPackage#getInteractionComponent_ForDistribution() + * @model default="false" unique="false" dataType="org.eclipse.uml2.types.Boolean" required="true" ordered="false" + * @generated + */ + boolean isForDistribution(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.InteractionComponent#isForDistribution For Distribution}' attribute. + * + * + * @param value the new value of the 'For Distribution' attribute. + * @see #isForDistribution() + * @generated + */ + void setForDistribution(boolean value); + + /** + * Returns the value of the 'Connection Pattern' reference. + * + *

    + * If the meaning of the 'Connection Pattern' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Connection Pattern' reference. + * @see #setConnectionPattern(Collaboration) + * @see org.eclipse.papyrus.FCM.FCMPackage#getInteractionComponent_ConnectionPattern() + * @model ordered="false" + * @generated + */ + Collaboration getConnectionPattern(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.InteractionComponent#getConnectionPattern Connection Pattern}' reference. + * + * + * @param value the new value of the 'Connection Pattern' reference. + * @see #getConnectionPattern() + * @generated + */ + void setConnectionPattern(Collaboration value); + + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getInteractionComponent_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.InteractionComponent#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // InteractionComponent diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionKind.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionKind.java new file mode 100644 index 00000000000..24de3ce829e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionKind.java @@ -0,0 +1,310 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Interception Kind', + * and utility methods for working with them. + * + * + * Condition whether an interceptor should be used within a container. + * - "Some" = set of ports defined in interception rule + * - "AllOut/AllIn" = ports with required/provided ports only + * - "Matching" = kind of interceptor and component port need to match + * + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getInterceptionKind() + * @model + * @generated + */ +public enum InterceptionKind implements Enumerator { + /** + * The 'Intercept Some' literal object. + * + * + * @see #INTERCEPT_SOME_VALUE + * @generated + * @ordered + */ + INTERCEPT_SOME(0, "InterceptSome", "InterceptSome"), //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Intercept All' literal object. + * + * + * @see #INTERCEPT_ALL_VALUE + * @generated + * @ordered + */ + INTERCEPT_ALL(1, "InterceptAll", "InterceptAll"), //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Intercept All Out' literal object. + * + * + * @see #INTERCEPT_ALL_OUT_VALUE + * @generated + * @ordered + */ + INTERCEPT_ALL_OUT(2, "InterceptAllOut", "InterceptAllOut"), //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Intercept All In' literal object. + * + * + * @see #INTERCEPT_ALL_IN_VALUE + * @generated + * @ordered + */ + INTERCEPT_ALL_IN(3, "InterceptAllIn", "InterceptAllIn"), //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Intercept Matching' literal object. + * + * + * @see #INTERCEPT_MATCHING_VALUE + * @generated + * @ordered + */ + INTERCEPT_MATCHING(4, "InterceptMatching", "InterceptMatching"); //$NON-NLS-1$ //$NON-NLS-2$ + + /** + * The 'Intercept Some' literal value. + * + *

    + * If the meaning of 'Intercept Some' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #INTERCEPT_SOME + * @model name="InterceptSome" + * @generated + * @ordered + */ + public static final int INTERCEPT_SOME_VALUE = 0; + + /** + * The 'Intercept All' literal value. + * + *

    + * If the meaning of 'Intercept All' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #INTERCEPT_ALL + * @model name="InterceptAll" + * @generated + * @ordered + */ + public static final int INTERCEPT_ALL_VALUE = 1; + + /** + * The 'Intercept All Out' literal value. + * + *

    + * If the meaning of 'Intercept All Out' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #INTERCEPT_ALL_OUT + * @model name="InterceptAllOut" + * @generated + * @ordered + */ + public static final int INTERCEPT_ALL_OUT_VALUE = 2; + + /** + * The 'Intercept All In' literal value. + * + *

    + * If the meaning of 'Intercept All In' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #INTERCEPT_ALL_IN + * @model name="InterceptAllIn" + * @generated + * @ordered + */ + public static final int INTERCEPT_ALL_IN_VALUE = 3; + + /** + * The 'Intercept Matching' literal value. + * + *

    + * If the meaning of 'Intercept Matching' literal object isn't clear, there really should be more of a description here... + *

    + * + * @see #INTERCEPT_MATCHING + * @model name="InterceptMatching" + * @generated + * @ordered + */ + public static final int INTERCEPT_MATCHING_VALUE = 4; + + /** + * An array of all the 'Interception Kind' enumerators. + * + * + * @generated + */ + private static final InterceptionKind[] VALUES_ARRAY = + new InterceptionKind[] { + INTERCEPT_SOME, + INTERCEPT_ALL, + INTERCEPT_ALL_OUT, + INTERCEPT_ALL_IN, + INTERCEPT_MATCHING, + }; + + /** + * A public read-only list of all the 'Interception Kind' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Interception Kind' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static InterceptionKind get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + InterceptionKind result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Interception Kind' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static InterceptionKind getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + InterceptionKind result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Interception Kind' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static InterceptionKind get(int value) { + switch (value) { + case INTERCEPT_SOME_VALUE: return INTERCEPT_SOME; + case INTERCEPT_ALL_VALUE: return INTERCEPT_ALL; + case INTERCEPT_ALL_OUT_VALUE: return INTERCEPT_ALL_OUT; + case INTERCEPT_ALL_IN_VALUE: return INTERCEPT_ALL_IN; + case INTERCEPT_MATCHING_VALUE: return INTERCEPT_MATCHING; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private InterceptionKind(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} // InterceptionKind diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionRule.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionRule.java new file mode 100644 index 00000000000..44adb8c7700 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/InterceptionRule.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Feature; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Property; + +/** + * + * A representation of the model object 'Interception Rule'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionKind Interception Kind}
    • + *
    • {@link org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionSet Interception Set}
    • + *
    • {@link org.eclipse.papyrus.FCM.InterceptionRule#getBase_Property Base Property}
    • + *
    • {@link org.eclipse.papyrus.FCM.InterceptionRule#getBase_Operation Base Operation}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getInterceptionRule() + * @model + * @generated + */ +public interface InterceptionRule extends EObject { + /** + * Returns the value of the 'Interception Kind' attribute. + * The literals are from the enumeration {@link org.eclipse.papyrus.FCM.InterceptionKind}. + * + *

    + * If the meaning of the 'Interception Kind' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Interception Kind' attribute. + * @see org.eclipse.papyrus.FCM.InterceptionKind + * @see #setInterceptionKind(InterceptionKind) + * @see org.eclipse.papyrus.FCM.FCMPackage#getInterceptionRule_InterceptionKind() + * @model unique="false" required="true" ordered="false" + * @generated + */ + InterceptionKind getInterceptionKind(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.InterceptionRule#getInterceptionKind Interception Kind}' attribute. + * + * + * @param value the new value of the 'Interception Kind' attribute. + * @see org.eclipse.papyrus.FCM.InterceptionKind + * @see #getInterceptionKind() + * @generated + */ + void setInterceptionKind(InterceptionKind value); + + /** + * Returns the value of the 'Interception Set' reference list. + * The list contents are of type {@link org.eclipse.uml2.uml.Feature}. + * + *

    + * If the meaning of the 'Interception Set' reference list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Interception Set' reference list. + * @see org.eclipse.papyrus.FCM.FCMPackage#getInterceptionRule_InterceptionSet() + * @model ordered="false" + * @generated + */ + EList getInterceptionSet(); + + /** + * Returns the value of the 'Base Property' reference. + * + *

    + * If the meaning of the 'Base Property' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Property' reference. + * @see #setBase_Property(Property) + * @see org.eclipse.papyrus.FCM.FCMPackage#getInterceptionRule_Base_Property() + * @model required="true" ordered="false" + * @generated + */ + Property getBase_Property(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.InterceptionRule#getBase_Property Base Property}' reference. + * + * + * @param value the new value of the 'Base Property' reference. + * @see #getBase_Property() + * @generated + */ + void setBase_Property(Property value); + + /** + * Returns the value of the 'Base Operation' reference. + * + *

    + * If the meaning of the 'Base Operation' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Operation' reference. + * @see #setBase_Operation(Operation) + * @see org.eclipse.papyrus.FCM.FCMPackage#getInterceptionRule_Base_Operation() + * @model required="true" ordered="false" + * @generated + */ + Operation getBase_Operation(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.InterceptionRule#getBase_Operation Base Operation}' reference. + * + * + * @param value the new value of the 'Base Operation' reference. + * @see #getBase_Operation() + * @generated + */ + void setBase_Operation(Operation value); + +} // InterceptionRule diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/OperatingSystem.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/OperatingSystem.java new file mode 100644 index 00000000000..e9dc05079f7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/OperatingSystem.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Operating System'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.OperatingSystem#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getOperatingSystem() + * @model + * @generated + */ +public interface OperatingSystem extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getOperatingSystem_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.OperatingSystem#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // OperatingSystem diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Port.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Port.java new file mode 100644 index 00000000000..0f1da61cd0c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Port.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Type; + +/** + * + * A representation of the model object 'Port'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.Port#getBase_Port Base Port}
    • + *
    • {@link org.eclipse.papyrus.FCM.Port#getKind Kind}
    • + *
    • {@link org.eclipse.papyrus.FCM.Port#getType Type}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getPort() + * @model + * @generated + */ +public interface Port extends ConfigurableElementInstance { + /** + * Returns the value of the 'Base Port' reference. + * + *

    + * If the meaning of the 'Base Port' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Port' reference. + * @see #setBase_Port(org.eclipse.uml2.uml.Port) + * @see org.eclipse.papyrus.FCM.FCMPackage#getPort_Base_Port() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Port getBase_Port(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Port#getBase_Port Base Port}' reference. + * + * + * @param value the new value of the 'Base Port' reference. + * @see #getBase_Port() + * @generated + */ + void setBase_Port(org.eclipse.uml2.uml.Port value); + + /** + * Returns the value of the 'Kind' reference. + * + *

    + * If the meaning of the 'Kind' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Kind' reference. + * @see #setKind(PortKind) + * @see org.eclipse.papyrus.FCM.FCMPackage#getPort_Kind() + * @model ordered="false" + * @generated + */ + PortKind getKind(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Port#getKind Kind}' reference. + * + * + * @param value the new value of the 'Kind' reference. + * @see #getKind() + * @generated + */ + void setKind(PortKind value); + + /** + * Returns the value of the 'Type' reference. + * + *

    + * If the meaning of the 'Type' reference isn't clear, + * there really should be more of a description here... + *

    + * + * @return the value of the 'Type' reference. + * @see #setType(Type) + * @see org.eclipse.papyrus.FCM.FCMPackage#getPort_Type() + * @model required="true" ordered="false" + * @generated + */ + Type getType(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Port#getType Type}' reference. + * + * + * @param value the new value of the 'Type' reference. + * @see #getType() + * @generated + */ + void setType(Type value); + + /** + * Update the derived interfaces of a port. Manually added method + */ + void update(); +} // Port diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/PortKind.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/PortKind.java new file mode 100644 index 00000000000..82ad56f8cf7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/PortKind.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Interface; + +/** + * + * A representation of the model object 'Port Kind'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.PortKind#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.PortKind#getProvidedInterface Provided Interface}
    • + *
    • {@link org.eclipse.papyrus.FCM.PortKind#getRequiredInterface Required Interface}
    • + *
    • {@link org.eclipse.papyrus.FCM.PortKind#isExtendedPort Extended Port}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getPortKind() + * @model + * @generated + */ +public interface PortKind extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getPortKind_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.PortKind#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + + /** + * Returns the value of the 'Provided Interface' reference. + * + *

    + * If the meaning of the 'Provided Interface' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Provided Interface' reference. + * @see #setProvidedInterface(Interface) + * @see org.eclipse.papyrus.FCM.FCMPackage#getPortKind_ProvidedInterface() + * @model ordered="false" + * @generated + */ + Interface getProvidedInterface(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.PortKind#getProvidedInterface Provided Interface}' reference. + * + * + * @param value the new value of the 'Provided Interface' reference. + * @see #getProvidedInterface() + * @generated + */ + void setProvidedInterface(Interface value); + + /** + * Returns the value of the 'Required Interface' reference. + * + *

    + * If the meaning of the 'Required Interface' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Required Interface' reference. + * @see #setRequiredInterface(Interface) + * @see org.eclipse.papyrus.FCM.FCMPackage#getPortKind_RequiredInterface() + * @model ordered="false" + * @generated + */ + Interface getRequiredInterface(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.PortKind#getRequiredInterface Required Interface}' reference. + * + * + * @param value the new value of the 'Required Interface' reference. + * @see #getRequiredInterface() + * @generated + */ + void setRequiredInterface(Interface value); + + /** + * Returns the value of the 'Extended Port' attribute. + * + *

    + * If the meaning of the 'Extended Port' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Extended Port' attribute. + * @see #isSetExtendedPort() + * @see org.eclipse.papyrus.FCM.FCMPackage#getPortKind_ExtendedPort() + * @model unsettable="true" dataType="org.eclipse.uml2.types.Boolean" required="true" transient="true" changeable="false" volatile="true" derived="true" ordered="false" + * @generated + */ + boolean isExtendedPort(); + + /** + * Returns whether the value of the '{@link org.eclipse.papyrus.FCM.PortKind#isExtendedPort Extended Port}' attribute is set. + * + * + * @return whether the value of the 'Extended Port' attribute is set. + * @see #isExtendedPort() + * @generated + */ + boolean isSetExtendedPort(); + +} // PortKind diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ProgLanguage.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ProgLanguage.java new file mode 100644 index 00000000000..8458d640c94 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/ProgLanguage.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Prog Language'. + * + * + * + * We assume that a model library defines a set of supported programming languages as well as a set of provided component to mappings. We do not use a fixed enumeration defined in the profile to assure extensibility + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.ProgLanguage#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getProgLanguage() + * @model + * @generated + */ +public interface ProgLanguage extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getProgLanguage_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.ProgLanguage#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // ProgLanguage diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/RuleApplication.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/RuleApplication.java new file mode 100644 index 00000000000..5fedd0d9a3a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/RuleApplication.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Rule Application'. + * + * + * + * Apply a set of container rules. It can be applied to a single class or to a package, implying that all components within the package apply the specified rule. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.RuleApplication#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.RuleApplication#getContainerRule Container Rule}
    • + *
    • {@link org.eclipse.papyrus.FCM.RuleApplication#getBase_Package Base Package}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getRuleApplication() + * @model + * @generated + */ +public interface RuleApplication extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getRuleApplication_Base_Class() + * @model ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.RuleApplication#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + + /** + * Returns the value of the 'Container Rule' reference list. + * The list contents are of type {@link org.eclipse.papyrus.FCM.ContainerRule}. + * + *

    + * If the meaning of the 'Container Rule' reference list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Container Rule' reference list. + * @see org.eclipse.papyrus.FCM.FCMPackage#getRuleApplication_ContainerRule() + * @model ordered="false" + * @generated + */ + EList getContainerRule(); + + /** + * Returns the value of the 'Base Package' reference. + * + *

    + * If the meaning of the 'Base Package' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Package' reference. + * @see #setBase_Package(org.eclipse.uml2.uml.Package) + * @see org.eclipse.papyrus.FCM.FCMPackage#getRuleApplication_Base_Package() + * @model ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Package getBase_Package(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.RuleApplication#getBase_Package Base Package}' reference. + * + * + * @param value the new value of the 'Base Package' reference. + * @see #getBase_Package() + * @generated + */ + void setBase_Package(org.eclipse.uml2.uml.Package value); + +} // RuleApplication diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Singleton.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Singleton.java new file mode 100644 index 00000000000..097280acf11 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Singleton.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Singleton'. + * + * + * + * Indicate that this component is instantiated only once within the system. It also implies that this component is automatically instantiated by a generated bootloader + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.Singleton#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getSingleton() + * @model + * @generated + */ +public interface Singleton extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getSingleton_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Singleton#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // Singleton diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Target.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Target.java new file mode 100644 index 00000000000..41bf2accb32 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Target.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Node; + +/** + * + * A representation of the model object 'Target'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.Target#getTargetArch Target Arch}
    • + *
    • {@link org.eclipse.papyrus.FCM.Target#getOptions Options}
    • + *
    • {@link org.eclipse.papyrus.FCM.Target#getBase_Node Base Node}
    • + *
    • {@link org.eclipse.papyrus.FCM.Target#getUsedOS Used OS}
    • + *
    • {@link org.eclipse.papyrus.FCM.Target#getAvailRAM Avail RAM}
    • + *
    • {@link org.eclipse.papyrus.FCM.Target#getAvailROM Avail ROM}
    • + *
    • {@link org.eclipse.papyrus.FCM.Target#getCompiler Compiler}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget() + * @model + * @generated + */ +public interface Target extends EObject { + /** + * Returns the value of the 'Target Arch' reference. + * + *

    + * If the meaning of the 'Target Arch' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Target Arch' reference. + * @see #setTargetArch(TargetArchitecture) + * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_TargetArch() + * @model required="true" ordered="false" + * @generated + */ + TargetArchitecture getTargetArch(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Target#getTargetArch Target Arch}' reference. + * + * + * @param value the new value of the 'Target Arch' reference. + * @see #getTargetArch() + * @generated + */ + void setTargetArch(TargetArchitecture value); + + /** + * Returns the value of the 'Options' reference list. + * The list contents are of type {@link org.eclipse.papyrus.FCM.ConfigOption}. + * + *

    + * If the meaning of the 'Options' reference list isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Options' reference list. + * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_Options() + * @model ordered="false" + * @generated + */ + EList getOptions(); + + /** + * Returns the value of the 'Base Node' reference. + * + *

    + * If the meaning of the 'Base Node' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Node' reference. + * @see #setBase_Node(Node) + * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_Base_Node() + * @model required="true" ordered="false" + * @generated + */ + Node getBase_Node(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Target#getBase_Node Base Node}' reference. + * + * + * @param value the new value of the 'Base Node' reference. + * @see #getBase_Node() + * @generated + */ + void setBase_Node(Node value); + + /** + * Returns the value of the 'Used OS' reference. + * + *

    + * If the meaning of the 'Used OS' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Used OS' reference. + * @see #setUsedOS(OperatingSystem) + * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_UsedOS() + * @model required="true" ordered="false" + * @generated + */ + OperatingSystem getUsedOS(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Target#getUsedOS Used OS}' reference. + * + * + * @param value the new value of the 'Used OS' reference. + * @see #getUsedOS() + * @generated + */ + void setUsedOS(OperatingSystem value); + + /** + * Returns the value of the 'Avail RAM' attribute. + * + *

    + * If the meaning of the 'Avail RAM' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Avail RAM' attribute. + * @see #setAvailRAM(int) + * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_AvailRAM() + * @model dataType="org.eclipse.uml2.types.Integer" required="true" ordered="false" + * @generated + */ + int getAvailRAM(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Target#getAvailRAM Avail RAM}' attribute. + * + * + * @param value the new value of the 'Avail RAM' attribute. + * @see #getAvailRAM() + * @generated + */ + void setAvailRAM(int value); + + /** + * Returns the value of the 'Avail ROM' attribute. + * + *

    + * If the meaning of the 'Avail ROM' attribute isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Avail ROM' attribute. + * @see #setAvailROM(int) + * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_AvailROM() + * @model dataType="org.eclipse.uml2.types.Integer" required="true" ordered="false" + * @generated + */ + int getAvailROM(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Target#getAvailROM Avail ROM}' attribute. + * + * + * @param value the new value of the 'Avail ROM' attribute. + * @see #getAvailROM() + * @generated + */ + void setAvailROM(int value); + + /** + * Returns the value of the 'Compiler' reference. + * + *

    + * If the meaning of the 'Compiler' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Compiler' reference. + * @see #setCompiler(CompilerChain) + * @see org.eclipse.papyrus.FCM.FCMPackage#getTarget_Compiler() + * @model ordered="false" + * @generated + */ + CompilerChain getCompiler(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Target#getCompiler Compiler}' reference. + * + * + * @param value the new value of the 'Compiler' reference. + * @see #getCompiler() + * @generated + */ + void setCompiler(CompilerChain value); + +} // Target diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TargetArchitecture.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TargetArchitecture.java new file mode 100644 index 00000000000..9d5c63c871a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TargetArchitecture.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Target Architecture'. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.TargetArchitecture#getBase_Class Base Class}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getTargetArchitecture() + * @model + * @generated + */ +public interface TargetArchitecture extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getTargetArchitecture_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.TargetArchitecture#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + +} // TargetArchitecture diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Template.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Template.java new file mode 100644 index 00000000000..bf444e4e4b9 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/Template.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.uml2.uml.Element; + +/** + * + * A representation of the model object 'Template'. + * + * + * + * The template parameters list defines the parameters that are passed to the Acceleo template. If empty, the formal parameter list of the package template is used. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.Template#getBase_Element Base Element}
    • + *
    • {@link org.eclipse.papyrus.FCM.Template#getHelper Helper}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getTemplate() + * @model + * @generated + */ +public interface Template extends EObject { + /** + * Returns the value of the 'Base Element' reference. + * + *

    + * If the meaning of the 'Base Element' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Element' reference. + * @see #setBase_Element(Element) + * @see org.eclipse.papyrus.FCM.FCMPackage#getTemplate_Base_Element() + * @model required="true" ordered="false" + * @generated + */ + Element getBase_Element(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Template#getBase_Element Base Element}' reference. + * + * + * @param value the new value of the 'Base Element' reference. + * @see #getBase_Element() + * @generated + */ + void setBase_Element(Element value); + + /** + * Returns the value of the 'Helper' reference. + * + *

    + * If the meaning of the 'Helper' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Helper' reference. + * @see #setHelper(BindingHelper) + * @see org.eclipse.papyrus.FCM.FCMPackage#getTemplate_Helper() + * @model ordered="false" + * @generated + */ + BindingHelper getHelper(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.Template#getHelper Helper}' reference. + * + * + * @param value the new value of the 'Helper' reference. + * @see #getHelper() + * @generated + */ + void setHelper(BindingHelper value); + +} // Template diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TemplatePort.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TemplatePort.java new file mode 100644 index 00000000000..77f0d02222f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/TemplatePort.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + + +/** + * + * A representation of the model object 'Template Port'. + * + * + * + * Template ports are ports that enable the binding of an extended port with an actual parameter: the resulting port kind is the port kind bound to the current port type. + * For instance, we cound type a port with "MyType" and use an extended port Writer with a template with formal parameter T. Resulting port would be Writer with T bound to MyType. + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.TemplatePort#getBoundType Bound Type}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getTemplatePort() + * @model + * @generated + */ +public interface TemplatePort extends Port { + /** + * Returns the value of the 'Bound Type' reference. + * + *

    + * If the meaning of the 'Bound Type' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Bound Type' reference. + * @see #isSetBoundType() + * @see #unsetBoundType() + * @see #setBoundType(PortKind) + * @see org.eclipse.papyrus.FCM.FCMPackage#getTemplatePort_BoundType() + * @model unsettable="true" transient="true" volatile="true" derived="true" ordered="false" + * @generated + */ + PortKind getBoundType(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.TemplatePort#getBoundType Bound Type}' reference. + * + * + * @param value the new value of the 'Bound Type' reference. + * @see #isSetBoundType() + * @see #unsetBoundType() + * @see #getBoundType() + * @generated + */ + void setBoundType(PortKind value); + + /** + * Unsets the value of the '{@link org.eclipse.papyrus.FCM.TemplatePort#getBoundType Bound Type}' reference. + * + * + * @see #isSetBoundType() + * @see #getBoundType() + * @see #setBoundType(PortKind) + * @generated + */ + void unsetBoundType(); + + /** + * Returns whether the value of the '{@link org.eclipse.papyrus.FCM.TemplatePort#getBoundType Bound Type}' reference is set. + * + * + * @return whether the value of the 'Bound Type' reference is set. + * @see #unsetBoundType() + * @see #getBoundType() + * @see #setBoundType(PortKind) + * @generated + */ + boolean isSetBoundType(); + +} // TemplatePort diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/UseInstanceConfigurator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/UseInstanceConfigurator.java new file mode 100644 index 00000000000..f0232d7637f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/UseInstanceConfigurator.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Use Instance Configurator'. + * + * + * + * Use a dedicated component that that is responsible for configuring component instances. The concept is primarily intented for container extensions. For instance, a container extension might provide reflection data about a component. In this case, the instance configuration would create the value specifications using data available in the model + * + * + *

    + * The following features are supported: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.UseInstanceConfigurator#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.UseInstanceConfigurator#getConfigurator Configurator}
    • + *
    + * + * @see org.eclipse.papyrus.FCM.FCMPackage#getUseInstanceConfigurator() + * @model + * @generated + */ +public interface UseInstanceConfigurator extends EObject { + /** + * Returns the value of the 'Base Class' reference. + * + *

    + * If the meaning of the 'Base Class' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Base Class' reference. + * @see #setBase_Class(org.eclipse.uml2.uml.Class) + * @see org.eclipse.papyrus.FCM.FCMPackage#getUseInstanceConfigurator_Base_Class() + * @model required="true" ordered="false" + * @generated + */ + org.eclipse.uml2.uml.Class getBase_Class(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.UseInstanceConfigurator#getBase_Class Base Class}' reference. + * + * + * @param value the new value of the 'Base Class' reference. + * @see #getBase_Class() + * @generated + */ + void setBase_Class(org.eclipse.uml2.uml.Class value); + + /** + * Returns the value of the 'Configurator' reference. + * + *

    + * If the meaning of the 'Configurator' reference isn't clear, there really should be more of a description here... + *

    + * + * @return the value of the 'Configurator' reference. + * @see #setConfigurator(InstanceConfigurator) + * @see org.eclipse.papyrus.FCM.FCMPackage#getUseInstanceConfigurator_Configurator() + * @model required="true" ordered="false" + * @generated + */ + InstanceConfigurator getConfigurator(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.FCM.UseInstanceConfigurator#getConfigurator Configurator}' reference. + * + * + * @param value the new value of the 'Configurator' reference. + * @see #getConfigurator() + * @generated + */ + void setConfigurator(InstanceConfigurator value); + +} // UseInstanceConfigurator diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AssemblyImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AssemblyImpl.java new file mode 100644 index 00000000000..8d53df41fe1 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AssemblyImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.Assembly; +import org.eclipse.papyrus.FCM.FCMPackage; + +/** + * + * An implementation of the model object 'Assembly'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.AssemblyImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class AssemblyImpl extends EObjectImpl implements Assembly { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected AssemblyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.ASSEMBLY; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.ASSEMBLY__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.ASSEMBLY__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.ASSEMBLY__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.ASSEMBLY__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.ASSEMBLY__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.ASSEMBLY__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + +} // AssemblyImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexImpl.java new file mode 100644 index 00000000000..9379bae368d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexImpl.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.AutoIndex; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.uml2.uml.Property; + +/** + * + * An implementation of the model object 'Auto Index'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.AutoIndexImpl#getBase_Property Base Property}
    • + *
    + * + * @generated + */ +public class AutoIndexImpl extends EObjectImpl implements AutoIndex { + /** + * The cached value of the '{@link #getBase_Property() Base Property}' reference. + * + * + * @see #getBase_Property() + * @generated + * @ordered + */ + protected Property base_Property; + + /** + * + * + * @generated + */ + protected AutoIndexImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.AUTO_INDEX; + } + + /** + * + * + * @generated + */ + @Override + public Property getBase_Property() { + if (base_Property != null && base_Property.eIsProxy()) { + InternalEObject oldBase_Property = (InternalEObject)base_Property; + base_Property = (Property)eResolveProxy(oldBase_Property); + if (base_Property != oldBase_Property) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.AUTO_INDEX__BASE_PROPERTY, oldBase_Property, base_Property)); + } + } + return base_Property; + } + + /** + * + * + * @generated + */ + public Property basicGetBase_Property() { + return base_Property; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Property(Property newBase_Property) { + Property oldBase_Property = base_Property; + base_Property = newBase_Property; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.AUTO_INDEX__BASE_PROPERTY, oldBase_Property, base_Property)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.AUTO_INDEX__BASE_PROPERTY: + if (resolve) return getBase_Property(); + return basicGetBase_Property(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.AUTO_INDEX__BASE_PROPERTY: + setBase_Property((Property)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.AUTO_INDEX__BASE_PROPERTY: + setBase_Property((Property)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.AUTO_INDEX__BASE_PROPERTY: + return base_Property != null; + } + return super.eIsSet(featureID); + } + +} // AutoIndexImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexPerNodeImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexPerNodeImpl.java new file mode 100644 index 00000000000..ca4713734be --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/AutoIndexPerNodeImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.papyrus.FCM.AutoIndexPerNode; +import org.eclipse.papyrus.FCM.FCMPackage; + +/** + * + * An implementation of the model object 'Auto Index Per Node'. + * + * + * @generated + */ +public class AutoIndexPerNodeImpl extends AutoIndexImpl implements AutoIndexPerNode { + /** + * + * + * @generated + */ + protected AutoIndexPerNodeImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.AUTO_INDEX_PER_NODE; + } + +} // AutoIndexPerNodeImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindTemplateImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindTemplateImpl.java new file mode 100644 index 00000000000..84097ab7ee5 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindTemplateImpl.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.papyrus.FCM.BindTemplate; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Type; + +/** + * + * An implementation of the model object 'Bind Template'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.BindTemplateImpl#getActual Actual}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.BindTemplateImpl#getBase_Property Base Property}
    • + *
    + * + * @generated + */ +public class BindTemplateImpl extends EObjectImpl implements BindTemplate { + /** + * The cached value of the '{@link #getActual() Actual}' reference list. + * + * + * @see #getActual() + * @generated + * @ordered + */ + protected EList actual; + + /** + * The cached value of the '{@link #getBase_Property() Base Property}' reference. + * + * + * @see #getBase_Property() + * @generated + * @ordered + */ + protected Property base_Property; + + /** + * + * + * @generated + */ + protected BindTemplateImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.BIND_TEMPLATE; + } + + /** + * + * + * @generated + */ + @Override + public EList getActual() { + if (actual == null) { + actual = new EObjectResolvingEList(Type.class, this, FCMPackage.BIND_TEMPLATE__ACTUAL); + } + return actual; + } + + /** + * + * + * @generated + */ + @Override + public Property getBase_Property() { + if (base_Property != null && base_Property.eIsProxy()) { + InternalEObject oldBase_Property = (InternalEObject)base_Property; + base_Property = (Property)eResolveProxy(oldBase_Property); + if (base_Property != oldBase_Property) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.BIND_TEMPLATE__BASE_PROPERTY, oldBase_Property, base_Property)); + } + } + return base_Property; + } + + /** + * + * + * @generated + */ + public Property basicGetBase_Property() { + return base_Property; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Property(Property newBase_Property) { + Property oldBase_Property = base_Property; + base_Property = newBase_Property; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.BIND_TEMPLATE__BASE_PROPERTY, oldBase_Property, base_Property)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.BIND_TEMPLATE__ACTUAL: + return getActual(); + case FCMPackage.BIND_TEMPLATE__BASE_PROPERTY: + if (resolve) return getBase_Property(); + return basicGetBase_Property(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.BIND_TEMPLATE__ACTUAL: + getActual().clear(); + getActual().addAll((Collection)newValue); + return; + case FCMPackage.BIND_TEMPLATE__BASE_PROPERTY: + setBase_Property((Property)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.BIND_TEMPLATE__ACTUAL: + getActual().clear(); + return; + case FCMPackage.BIND_TEMPLATE__BASE_PROPERTY: + setBase_Property((Property)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.BIND_TEMPLATE__ACTUAL: + return actual != null && !actual.isEmpty(); + case FCMPackage.BIND_TEMPLATE__BASE_PROPERTY: + return base_Property != null; + } + return super.eIsSet(featureID); + } + +} // BindTemplateImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindingHelperImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindingHelperImpl.java new file mode 100644 index 00000000000..cca6f30bf16 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/BindingHelperImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.BindingHelper; +import org.eclipse.papyrus.FCM.FCMPackage; + +/** + * + * An implementation of the model object 'Binding Helper'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.BindingHelperImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class BindingHelperImpl extends EObjectImpl implements BindingHelper { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected BindingHelperImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.BINDING_HELPER; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.BINDING_HELPER__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.BINDING_HELPER__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.BINDING_HELPER__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.BINDING_HELPER__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.BINDING_HELPER__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.BINDING_HELPER__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + +} // BindingHelperImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CodeGenOptionsImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CodeGenOptionsImpl.java new file mode 100644 index 00000000000..87c4df5de26 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CodeGenOptionsImpl.java @@ -0,0 +1,291 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.CodeGenOptions; +import org.eclipse.papyrus.FCM.CompToOOmapping; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.ProgLanguage; + +/** + * + * An implementation of the model object 'Code Gen Options'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl#getBase_Package Base Package}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl#getCompToOOmapping Comp To OOmapping}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.CodeGenOptionsImpl#getProgLanguage Prog Language}
    • + *
    + * + * @generated + */ +public class CodeGenOptionsImpl extends EObjectImpl implements CodeGenOptions { + /** + * The cached value of the '{@link #getBase_Package() Base Package}' reference. + * + * + * @see #getBase_Package() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Package base_Package; + + /** + * The cached value of the '{@link #getCompToOOmapping() Comp To OOmapping}' reference. + * + * + * @see #getCompToOOmapping() + * @generated + * @ordered + */ + protected CompToOOmapping compToOOmapping; + + /** + * The cached value of the '{@link #getProgLanguage() Prog Language}' reference. + * + * + * @see #getProgLanguage() + * @generated + * @ordered + */ + protected ProgLanguage progLanguage; + + /** + * + * + * @generated + */ + protected CodeGenOptionsImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.CODE_GEN_OPTIONS; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Package getBase_Package() { + if (base_Package != null && base_Package.eIsProxy()) { + InternalEObject oldBase_Package = (InternalEObject)base_Package; + base_Package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_Package); + if (base_Package != oldBase_Package) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CODE_GEN_OPTIONS__BASE_PACKAGE, oldBase_Package, base_Package)); + } + } + return base_Package; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Package basicGetBase_Package() { + return base_Package; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { + org.eclipse.uml2.uml.Package oldBase_Package = base_Package; + base_Package = newBase_Package; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CODE_GEN_OPTIONS__BASE_PACKAGE, oldBase_Package, base_Package)); + } + + /** + * + * + * @generated + */ + @Override + public CompToOOmapping getCompToOOmapping() { + if (compToOOmapping != null && compToOOmapping.eIsProxy()) { + InternalEObject oldCompToOOmapping = (InternalEObject)compToOOmapping; + compToOOmapping = (CompToOOmapping)eResolveProxy(oldCompToOOmapping); + if (compToOOmapping != oldCompToOOmapping) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CODE_GEN_OPTIONS__COMP_TO_OOMAPPING, oldCompToOOmapping, compToOOmapping)); + } + } + return compToOOmapping; + } + + /** + * + * + * @generated + */ + public CompToOOmapping basicGetCompToOOmapping() { + return compToOOmapping; + } + + /** + * + * + * @generated + */ + @Override + public void setCompToOOmapping(CompToOOmapping newCompToOOmapping) { + CompToOOmapping oldCompToOOmapping = compToOOmapping; + compToOOmapping = newCompToOOmapping; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CODE_GEN_OPTIONS__COMP_TO_OOMAPPING, oldCompToOOmapping, compToOOmapping)); + } + + /** + * + * + * @generated + */ + @Override + public ProgLanguage getProgLanguage() { + if (progLanguage != null && progLanguage.eIsProxy()) { + InternalEObject oldProgLanguage = (InternalEObject)progLanguage; + progLanguage = (ProgLanguage)eResolveProxy(oldProgLanguage); + if (progLanguage != oldProgLanguage) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CODE_GEN_OPTIONS__PROG_LANGUAGE, oldProgLanguage, progLanguage)); + } + } + return progLanguage; + } + + /** + * + * + * @generated + */ + public ProgLanguage basicGetProgLanguage() { + return progLanguage; + } + + /** + * + * + * @generated + */ + @Override + public void setProgLanguage(ProgLanguage newProgLanguage) { + ProgLanguage oldProgLanguage = progLanguage; + progLanguage = newProgLanguage; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CODE_GEN_OPTIONS__PROG_LANGUAGE, oldProgLanguage, progLanguage)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.CODE_GEN_OPTIONS__BASE_PACKAGE: + if (resolve) return getBase_Package(); + return basicGetBase_Package(); + case FCMPackage.CODE_GEN_OPTIONS__COMP_TO_OOMAPPING: + if (resolve) return getCompToOOmapping(); + return basicGetCompToOOmapping(); + case FCMPackage.CODE_GEN_OPTIONS__PROG_LANGUAGE: + if (resolve) return getProgLanguage(); + return basicGetProgLanguage(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.CODE_GEN_OPTIONS__BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package)newValue); + return; + case FCMPackage.CODE_GEN_OPTIONS__COMP_TO_OOMAPPING: + setCompToOOmapping((CompToOOmapping)newValue); + return; + case FCMPackage.CODE_GEN_OPTIONS__PROG_LANGUAGE: + setProgLanguage((ProgLanguage)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.CODE_GEN_OPTIONS__BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package)null); + return; + case FCMPackage.CODE_GEN_OPTIONS__COMP_TO_OOMAPPING: + setCompToOOmapping((CompToOOmapping)null); + return; + case FCMPackage.CODE_GEN_OPTIONS__PROG_LANGUAGE: + setProgLanguage((ProgLanguage)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.CODE_GEN_OPTIONS__BASE_PACKAGE: + return base_Package != null; + case FCMPackage.CODE_GEN_OPTIONS__COMP_TO_OOMAPPING: + return compToOOmapping != null; + case FCMPackage.CODE_GEN_OPTIONS__PROG_LANGUAGE: + return progLanguage != null; + } + return super.eIsSet(featureID); + } + +} // CodeGenOptionsImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompImplTemplateImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompImplTemplateImpl.java new file mode 100644 index 00000000000..ef442c13a78 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompImplTemplateImpl.java @@ -0,0 +1,235 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.CompImplTemplate; +import org.eclipse.papyrus.FCM.FCMPackage; + +/** + * + * An implementation of the model object 'Comp Impl Template'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.CompImplTemplateImpl#getTemplateDefs Template Defs}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.CompImplTemplateImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class CompImplTemplateImpl extends EObjectImpl implements CompImplTemplate { + /** + * The default value of the '{@link #getTemplateDefs() Template Defs}' attribute. + * + * + * @see #getTemplateDefs() + * @generated + * @ordered + */ + protected static final String TEMPLATE_DEFS_EDEFAULT = null; + + /** + * The cached value of the '{@link #getTemplateDefs() Template Defs}' attribute. + * + * + * @see #getTemplateDefs() + * @generated + * @ordered + */ + protected String templateDefs = TEMPLATE_DEFS_EDEFAULT; + + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected CompImplTemplateImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.COMP_IMPL_TEMPLATE; + } + + /** + * + * + * @generated + */ + @Override + public String getTemplateDefs() { + return templateDefs; + } + + /** + * + * + * @generated + */ + @Override + public void setTemplateDefs(String newTemplateDefs) { + String oldTemplateDefs = templateDefs; + templateDefs = newTemplateDefs; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.COMP_IMPL_TEMPLATE__TEMPLATE_DEFS, oldTemplateDefs, templateDefs)); + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.COMP_IMPL_TEMPLATE__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.COMP_IMPL_TEMPLATE__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.COMP_IMPL_TEMPLATE__TEMPLATE_DEFS: + return getTemplateDefs(); + case FCMPackage.COMP_IMPL_TEMPLATE__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.COMP_IMPL_TEMPLATE__TEMPLATE_DEFS: + setTemplateDefs((String)newValue); + return; + case FCMPackage.COMP_IMPL_TEMPLATE__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.COMP_IMPL_TEMPLATE__TEMPLATE_DEFS: + setTemplateDefs(TEMPLATE_DEFS_EDEFAULT); + return; + case FCMPackage.COMP_IMPL_TEMPLATE__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.COMP_IMPL_TEMPLATE__TEMPLATE_DEFS: + return TEMPLATE_DEFS_EDEFAULT == null ? templateDefs != null : !TEMPLATE_DEFS_EDEFAULT.equals(templateDefs); + case FCMPackage.COMP_IMPL_TEMPLATE__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (templateDefs: "); //$NON-NLS-1$ + result.append(templateDefs); + result.append(')'); + return result.toString(); + } + +} // CompImplTemplateImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompToOOmappingImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompToOOmappingImpl.java new file mode 100644 index 00000000000..c8337d11912 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompToOOmappingImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.CompToOOmapping; +import org.eclipse.papyrus.FCM.FCMPackage; + +/** + * + * An implementation of the model object 'Comp To OOmapping'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.CompToOOmappingImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class CompToOOmappingImpl extends EObjectImpl implements CompToOOmapping { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected CompToOOmappingImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.COMP_TO_OOMAPPING; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.COMP_TO_OOMAPPING__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.COMP_TO_OOMAPPING__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.COMP_TO_OOMAPPING__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.COMP_TO_OOMAPPING__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.COMP_TO_OOMAPPING__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.COMP_TO_OOMAPPING__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + +} // CompToOOmappingImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompilerChainImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompilerChainImpl.java new file mode 100644 index 00000000000..9f1edb84aa1 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CompilerChainImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.CompilerChain; +import org.eclipse.papyrus.FCM.FCMPackage; + +/** + * + * An implementation of the model object 'Compiler Chain'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.CompilerChainImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class CompilerChainImpl extends EObjectImpl implements CompilerChain { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected CompilerChainImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.COMPILER_CHAIN; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.COMPILER_CHAIN__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.COMPILER_CHAIN__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.COMPILER_CHAIN__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.COMPILER_CHAIN__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.COMPILER_CHAIN__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.COMPILER_CHAIN__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + +} // CompilerChainImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigOptionImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigOptionImpl.java new file mode 100644 index 00000000000..ddf33cb0dbc --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigOptionImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.ConfigOption; +import org.eclipse.papyrus.FCM.FCMPackage; + +/** + * + * An implementation of the model object 'Config Option'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.ConfigOptionImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class ConfigOptionImpl extends EObjectImpl implements ConfigOption { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected ConfigOptionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.CONFIG_OPTION; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONFIG_OPTION__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONFIG_OPTION__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.CONFIG_OPTION__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.CONFIG_OPTION__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.CONFIG_OPTION__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.CONFIG_OPTION__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + +} // ConfigOptionImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurableElementInstanceImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurableElementInstanceImpl.java new file mode 100644 index 00000000000..fb9e509e607 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurableElementInstanceImpl.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.ConfigurableElementInstance; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.uml2.uml.InstanceSpecification; + +/** + * + * An implementation of the model object 'Configurable Element Instance'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.ConfigurableElementInstanceImpl#getConfiguration Configuration}
    • + *
    + * + * @generated + */ +public abstract class ConfigurableElementInstanceImpl extends EObjectImpl implements ConfigurableElementInstance { + /** + * The cached value of the '{@link #getConfiguration() Configuration}' reference. + * + * + * @see #getConfiguration() + * @generated + * @ordered + */ + protected InstanceSpecification configuration; + + /** + * + * + * @generated + */ + protected ConfigurableElementInstanceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.CONFIGURABLE_ELEMENT_INSTANCE; + } + + /** + * + * + * @generated + */ + @Override + public InstanceSpecification getConfiguration() { + if (configuration != null && configuration.eIsProxy()) { + InternalEObject oldConfiguration = (InternalEObject)configuration; + configuration = (InstanceSpecification)eResolveProxy(oldConfiguration); + if (configuration != oldConfiguration) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION, oldConfiguration, configuration)); + } + } + return configuration; + } + + /** + * + * + * @generated + */ + public InstanceSpecification basicGetConfiguration() { + return configuration; + } + + /** + * + * + * @generated + */ + @Override + public void setConfiguration(InstanceSpecification newConfiguration) { + InstanceSpecification oldConfiguration = configuration; + configuration = newConfiguration; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION, oldConfiguration, configuration)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION: + if (resolve) return getConfiguration(); + return basicGetConfiguration(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION: + setConfiguration((InstanceSpecification)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION: + setConfiguration((InstanceSpecification)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION: + return configuration != null; + } + return super.eIsSet(featureID); + } + +} // ConfigurableElementInstanceImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationImpl.java new file mode 100644 index 00000000000..b4910abb934 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationImpl.java @@ -0,0 +1,269 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.papyrus.FCM.ConfigOption; +import org.eclipse.papyrus.FCM.Configuration; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.FCM.FCMPackage; + +/** + * + * An implementation of the model object 'Configuration'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.ConfigurationImpl#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.ConfigurationImpl#getConfigOptions Config Options}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.ConfigurationImpl#getDeploymentPlan Deployment Plan}
    • + *
    + * + * @generated + */ +public class ConfigurationImpl extends EObjectImpl implements Configuration { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * The cached value of the '{@link #getConfigOptions() Config Options}' reference list. + * + * + * @see #getConfigOptions() + * @generated + * @ordered + */ + protected EList configOptions; + + /** + * The cached value of the '{@link #getDeploymentPlan() Deployment Plan}' reference. + * + * + * @see #getDeploymentPlan() + * @generated + * @ordered + */ + protected DeploymentPlan deploymentPlan; + + /** + * + * + * @generated + */ + protected ConfigurationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.CONFIGURATION; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONFIGURATION__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONFIGURATION__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public EList getConfigOptions() { + if (configOptions == null) { + configOptions = new EObjectResolvingEList(ConfigOption.class, this, FCMPackage.CONFIGURATION__CONFIG_OPTIONS); + } + return configOptions; + } + + /** + * + * + * @generated + */ + @Override + public DeploymentPlan getDeploymentPlan() { + if (deploymentPlan != null && deploymentPlan.eIsProxy()) { + InternalEObject oldDeploymentPlan = (InternalEObject)deploymentPlan; + deploymentPlan = (DeploymentPlan)eResolveProxy(oldDeploymentPlan); + if (deploymentPlan != oldDeploymentPlan) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONFIGURATION__DEPLOYMENT_PLAN, oldDeploymentPlan, deploymentPlan)); + } + } + return deploymentPlan; + } + + /** + * + * + * @generated + */ + public DeploymentPlan basicGetDeploymentPlan() { + return deploymentPlan; + } + + /** + * + * + * @generated + */ + @Override + public void setDeploymentPlan(DeploymentPlan newDeploymentPlan) { + DeploymentPlan oldDeploymentPlan = deploymentPlan; + deploymentPlan = newDeploymentPlan; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONFIGURATION__DEPLOYMENT_PLAN, oldDeploymentPlan, deploymentPlan)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.CONFIGURATION__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + case FCMPackage.CONFIGURATION__CONFIG_OPTIONS: + return getConfigOptions(); + case FCMPackage.CONFIGURATION__DEPLOYMENT_PLAN: + if (resolve) return getDeploymentPlan(); + return basicGetDeploymentPlan(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.CONFIGURATION__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + case FCMPackage.CONFIGURATION__CONFIG_OPTIONS: + getConfigOptions().clear(); + getConfigOptions().addAll((Collection)newValue); + return; + case FCMPackage.CONFIGURATION__DEPLOYMENT_PLAN: + setDeploymentPlan((DeploymentPlan)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.CONFIGURATION__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + case FCMPackage.CONFIGURATION__CONFIG_OPTIONS: + getConfigOptions().clear(); + return; + case FCMPackage.CONFIGURATION__DEPLOYMENT_PLAN: + setDeploymentPlan((DeploymentPlan)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.CONFIGURATION__BASE_CLASS: + return base_Class != null; + case FCMPackage.CONFIGURATION__CONFIG_OPTIONS: + return configOptions != null && !configOptions.isEmpty(); + case FCMPackage.CONFIGURATION__DEPLOYMENT_PLAN: + return deploymentPlan != null; + } + return super.eIsSet(featureID); + } + +} // ConfigurationImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationPropertyImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationPropertyImpl.java new file mode 100644 index 00000000000..38eab69aac7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConfigurationPropertyImpl.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.ConfigurationProperty; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.uml2.uml.Property; + +/** + * + * An implementation of the model object 'Configuration Property'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.ConfigurationPropertyImpl#getBase_Property Base Property}
    • + *
    + * + * @generated + */ +public class ConfigurationPropertyImpl extends EObjectImpl implements ConfigurationProperty { + /** + * The cached value of the '{@link #getBase_Property() Base Property}' reference. + * + * + * @see #getBase_Property() + * @generated + * @ordered + */ + protected Property base_Property; + + /** + * + * + * @generated + */ + protected ConfigurationPropertyImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.CONFIGURATION_PROPERTY; + } + + /** + * + * + * @generated + */ + @Override + public Property getBase_Property() { + if (base_Property != null && base_Property.eIsProxy()) { + InternalEObject oldBase_Property = (InternalEObject)base_Property; + base_Property = (Property)eResolveProxy(oldBase_Property); + if (base_Property != oldBase_Property) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONFIGURATION_PROPERTY__BASE_PROPERTY, oldBase_Property, base_Property)); + } + } + return base_Property; + } + + /** + * + * + * @generated + */ + public Property basicGetBase_Property() { + return base_Property; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Property(Property newBase_Property) { + Property oldBase_Property = base_Property; + base_Property = newBase_Property; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONFIGURATION_PROPERTY__BASE_PROPERTY, oldBase_Property, base_Property)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.CONFIGURATION_PROPERTY__BASE_PROPERTY: + if (resolve) return getBase_Property(); + return basicGetBase_Property(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.CONFIGURATION_PROPERTY__BASE_PROPERTY: + setBase_Property((Property)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.CONFIGURATION_PROPERTY__BASE_PROPERTY: + setBase_Property((Property)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.CONFIGURATION_PROPERTY__BASE_PROPERTY: + return base_Property != null; + } + return super.eIsSet(featureID); + } + +} // ConfigurationPropertyImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorConfigurationImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorConfigurationImpl.java new file mode 100644 index 00000000000..21bc4a77305 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorConfigurationImpl.java @@ -0,0 +1,229 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.Connector; +import org.eclipse.papyrus.FCM.ConnectorConfiguration; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.uml2.uml.Slot; + +/** + * + * An implementation of the model object 'Connector Configuration'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.ConnectorConfigurationImpl#getBase_Slot Base Slot}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.ConnectorConfigurationImpl#getConnector Connector}
    • + *
    + * + * @generated + */ +public class ConnectorConfigurationImpl extends EObjectImpl implements ConnectorConfiguration { + /** + * The cached value of the '{@link #getBase_Slot() Base Slot}' reference. + * + * + * @see #getBase_Slot() + * @generated + * @ordered + */ + protected Slot base_Slot; + + /** + * The cached value of the '{@link #getConnector() Connector}' reference. + * + * + * @see #getConnector() + * @generated + * @ordered + */ + protected Connector connector; + + /** + * + * + * @generated + */ + protected ConnectorConfigurationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.CONNECTOR_CONFIGURATION; + } + + /** + * + * + * @generated + */ + @Override + public Slot getBase_Slot() { + if (base_Slot != null && base_Slot.eIsProxy()) { + InternalEObject oldBase_Slot = (InternalEObject)base_Slot; + base_Slot = (Slot)eResolveProxy(oldBase_Slot); + if (base_Slot != oldBase_Slot) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONNECTOR_CONFIGURATION__BASE_SLOT, oldBase_Slot, base_Slot)); + } + } + return base_Slot; + } + + /** + * + * + * @generated + */ + public Slot basicGetBase_Slot() { + return base_Slot; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Slot(Slot newBase_Slot) { + Slot oldBase_Slot = base_Slot; + base_Slot = newBase_Slot; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONNECTOR_CONFIGURATION__BASE_SLOT, oldBase_Slot, base_Slot)); + } + + /** + * + * + * @generated + */ + @Override + public Connector getConnector() { + if (connector != null && connector.eIsProxy()) { + InternalEObject oldConnector = (InternalEObject)connector; + connector = (Connector)eResolveProxy(oldConnector); + if (connector != oldConnector) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONNECTOR_CONFIGURATION__CONNECTOR, oldConnector, connector)); + } + } + return connector; + } + + /** + * + * + * @generated + */ + public Connector basicGetConnector() { + return connector; + } + + /** + * + * + * @generated + */ + @Override + public void setConnector(Connector newConnector) { + Connector oldConnector = connector; + connector = newConnector; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONNECTOR_CONFIGURATION__CONNECTOR, oldConnector, connector)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.CONNECTOR_CONFIGURATION__BASE_SLOT: + if (resolve) return getBase_Slot(); + return basicGetBase_Slot(); + case FCMPackage.CONNECTOR_CONFIGURATION__CONNECTOR: + if (resolve) return getConnector(); + return basicGetConnector(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.CONNECTOR_CONFIGURATION__BASE_SLOT: + setBase_Slot((Slot)newValue); + return; + case FCMPackage.CONNECTOR_CONFIGURATION__CONNECTOR: + setConnector((Connector)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.CONNECTOR_CONFIGURATION__BASE_SLOT: + setBase_Slot((Slot)null); + return; + case FCMPackage.CONNECTOR_CONFIGURATION__CONNECTOR: + setConnector((Connector)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.CONNECTOR_CONFIGURATION__BASE_SLOT: + return base_Slot != null; + case FCMPackage.CONNECTOR_CONFIGURATION__CONNECTOR: + return connector != null; + } + return super.eIsSet(featureID); + } + +} // ConnectorConfigurationImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorImpl.java new file mode 100644 index 00000000000..fc4c4381033 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ConnectorImpl.java @@ -0,0 +1,290 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.papyrus.FCM.Connector; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.uml2.uml.Property; + +/** + * + * An implementation of the model object 'Connector'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.ConnectorImpl#getBase_Connector Base Connector}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.ConnectorImpl#getIc Ic}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.ConnectorImpl#getBase_Property Base Property}
    • + *
    + * + * @generated + */ +public class ConnectorImpl extends ConfigurableElementInstanceImpl implements Connector { + /** + * The cached value of the '{@link #getBase_Connector() Base Connector}' reference. + * + * + * @see #getBase_Connector() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Connector base_Connector; + + /** + * The cached value of the '{@link #getIc() Ic}' reference. + * + * + * @see #getIc() + * @generated + * @ordered + */ + protected InteractionComponent ic; + + /** + * The cached value of the '{@link #getBase_Property() Base Property}' reference. + * + * + * @see #getBase_Property() + * @generated + * @ordered + */ + protected Property base_Property; + + /** + * + * + * @generated + */ + protected ConnectorImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.CONNECTOR; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Connector getBase_Connector() { + if (base_Connector != null && base_Connector.eIsProxy()) { + InternalEObject oldBase_Connector = (InternalEObject)base_Connector; + base_Connector = (org.eclipse.uml2.uml.Connector)eResolveProxy(oldBase_Connector); + if (base_Connector != oldBase_Connector) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONNECTOR__BASE_CONNECTOR, oldBase_Connector, base_Connector)); + } + } + return base_Connector; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Connector basicGetBase_Connector() { + return base_Connector; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Connector(org.eclipse.uml2.uml.Connector newBase_Connector) { + org.eclipse.uml2.uml.Connector oldBase_Connector = base_Connector; + base_Connector = newBase_Connector; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONNECTOR__BASE_CONNECTOR, oldBase_Connector, base_Connector)); + } + + /** + * + * + * @generated + */ + @Override + public InteractionComponent getIc() { + if (ic != null && ic.eIsProxy()) { + InternalEObject oldIc = (InternalEObject)ic; + ic = (InteractionComponent)eResolveProxy(oldIc); + if (ic != oldIc) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONNECTOR__IC, oldIc, ic)); + } + } + return ic; + } + + /** + * + * + * @generated + */ + public InteractionComponent basicGetIc() { + return ic; + } + + /** + * + * + * @generated + */ + @Override + public void setIc(InteractionComponent newIc) { + InteractionComponent oldIc = ic; + ic = newIc; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONNECTOR__IC, oldIc, ic)); + } + + /** + * + * + * @generated + */ + @Override + public Property getBase_Property() { + if (base_Property != null && base_Property.eIsProxy()) { + InternalEObject oldBase_Property = (InternalEObject)base_Property; + base_Property = (Property)eResolveProxy(oldBase_Property); + if (base_Property != oldBase_Property) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONNECTOR__BASE_PROPERTY, oldBase_Property, base_Property)); + } + } + return base_Property; + } + + /** + * + * + * @generated + */ + public Property basicGetBase_Property() { + return base_Property; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Property(Property newBase_Property) { + Property oldBase_Property = base_Property; + base_Property = newBase_Property; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONNECTOR__BASE_PROPERTY, oldBase_Property, base_Property)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.CONNECTOR__BASE_CONNECTOR: + if (resolve) return getBase_Connector(); + return basicGetBase_Connector(); + case FCMPackage.CONNECTOR__IC: + if (resolve) return getIc(); + return basicGetIc(); + case FCMPackage.CONNECTOR__BASE_PROPERTY: + if (resolve) return getBase_Property(); + return basicGetBase_Property(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.CONNECTOR__BASE_CONNECTOR: + setBase_Connector((org.eclipse.uml2.uml.Connector)newValue); + return; + case FCMPackage.CONNECTOR__IC: + setIc((InteractionComponent)newValue); + return; + case FCMPackage.CONNECTOR__BASE_PROPERTY: + setBase_Property((Property)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.CONNECTOR__BASE_CONNECTOR: + setBase_Connector((org.eclipse.uml2.uml.Connector)null); + return; + case FCMPackage.CONNECTOR__IC: + setIc((InteractionComponent)null); + return; + case FCMPackage.CONNECTOR__BASE_PROPERTY: + setBase_Property((Property)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.CONNECTOR__BASE_CONNECTOR: + return base_Connector != null; + case FCMPackage.CONNECTOR__IC: + return ic != null; + case FCMPackage.CONNECTOR__BASE_PROPERTY: + return base_Property != null; + } + return super.eIsSet(featureID); + } + +} // ConnectorImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ContainerRuleImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ContainerRuleImpl.java new file mode 100644 index 00000000000..8b705f5b4fb --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ContainerRuleImpl.java @@ -0,0 +1,277 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.papyrus.FCM.ConfigOption; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.ContainerRuleKind; +import org.eclipse.papyrus.FCM.FCMPackage; + +/** + * + * An implementation of the model object 'Container Rule'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.ContainerRuleImpl#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.ContainerRuleImpl#getForConfig For Config}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.ContainerRuleImpl#getKind Kind}
    • + *
    + * + * @generated + */ +public class ContainerRuleImpl extends EObjectImpl implements ContainerRule { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * The cached value of the '{@link #getForConfig() For Config}' reference list. + * + * + * @see #getForConfig() + * @generated + * @ordered + */ + protected EList forConfig; + + /** + * The default value of the '{@link #getKind() Kind}' attribute. + * + * + * @see #getKind() + * @generated + * @ordered + */ + protected static final ContainerRuleKind KIND_EDEFAULT = ContainerRuleKind.COMPONENT_RULE; + + /** + * The cached value of the '{@link #getKind() Kind}' attribute. + * + * + * @see #getKind() + * @generated + * @ordered + */ + protected ContainerRuleKind kind = KIND_EDEFAULT; + + /** + * + * + * @generated + */ + protected ContainerRuleImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.CONTAINER_RULE; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.CONTAINER_RULE__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONTAINER_RULE__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public EList getForConfig() { + if (forConfig == null) { + forConfig = new EObjectResolvingEList(ConfigOption.class, this, FCMPackage.CONTAINER_RULE__FOR_CONFIG); + } + return forConfig; + } + + /** + * + * + * @generated + */ + @Override + public ContainerRuleKind getKind() { + return kind; + } + + /** + * + * + * @generated + */ + @Override + public void setKind(ContainerRuleKind newKind) { + ContainerRuleKind oldKind = kind; + kind = newKind == null ? KIND_EDEFAULT : newKind; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.CONTAINER_RULE__KIND, oldKind, kind)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.CONTAINER_RULE__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + case FCMPackage.CONTAINER_RULE__FOR_CONFIG: + return getForConfig(); + case FCMPackage.CONTAINER_RULE__KIND: + return getKind(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.CONTAINER_RULE__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + case FCMPackage.CONTAINER_RULE__FOR_CONFIG: + getForConfig().clear(); + getForConfig().addAll((Collection)newValue); + return; + case FCMPackage.CONTAINER_RULE__KIND: + setKind((ContainerRuleKind)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.CONTAINER_RULE__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + case FCMPackage.CONTAINER_RULE__FOR_CONFIG: + getForConfig().clear(); + return; + case FCMPackage.CONTAINER_RULE__KIND: + setKind(KIND_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.CONTAINER_RULE__BASE_CLASS: + return base_Class != null; + case FCMPackage.CONTAINER_RULE__FOR_CONFIG: + return forConfig != null && !forConfig.isEmpty(); + case FCMPackage.CONTAINER_RULE__KIND: + return kind != KIND_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (kind: "); //$NON-NLS-1$ + result.append(kind); + result.append(')'); + return result.toString(); + } + +} // ContainerRuleImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CopyAttributeValueImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CopyAttributeValueImpl.java new file mode 100644 index 00000000000..bc73efb61af --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/CopyAttributeValueImpl.java @@ -0,0 +1,228 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.CopyAttributeValue; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.uml2.uml.Property; + +/** + * + * An implementation of the model object 'Copy Attribute Value'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.CopyAttributeValueImpl#getSource Source}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.CopyAttributeValueImpl#getBase_Property Base Property}
    • + *
    + * + * @generated + */ +public class CopyAttributeValueImpl extends EObjectImpl implements CopyAttributeValue { + /** + * The cached value of the '{@link #getSource() Source}' reference. + * + * + * @see #getSource() + * @generated + * @ordered + */ + protected Property source; + + /** + * The cached value of the '{@link #getBase_Property() Base Property}' reference. + * + * + * @see #getBase_Property() + * @generated + * @ordered + */ + protected Property base_Property; + + /** + * + * + * @generated + */ + protected CopyAttributeValueImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.COPY_ATTRIBUTE_VALUE; + } + + /** + * + * + * @generated + */ + @Override + public Property getSource() { + if (source != null && source.eIsProxy()) { + InternalEObject oldSource = (InternalEObject)source; + source = (Property)eResolveProxy(oldSource); + if (source != oldSource) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.COPY_ATTRIBUTE_VALUE__SOURCE, oldSource, source)); + } + } + return source; + } + + /** + * + * + * @generated + */ + public Property basicGetSource() { + return source; + } + + /** + * + * + * @generated + */ + @Override + public void setSource(Property newSource) { + Property oldSource = source; + source = newSource; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.COPY_ATTRIBUTE_VALUE__SOURCE, oldSource, source)); + } + + /** + * + * + * @generated + */ + @Override + public Property getBase_Property() { + if (base_Property != null && base_Property.eIsProxy()) { + InternalEObject oldBase_Property = (InternalEObject)base_Property; + base_Property = (Property)eResolveProxy(oldBase_Property); + if (base_Property != oldBase_Property) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.COPY_ATTRIBUTE_VALUE__BASE_PROPERTY, oldBase_Property, base_Property)); + } + } + return base_Property; + } + + /** + * + * + * @generated + */ + public Property basicGetBase_Property() { + return base_Property; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Property(Property newBase_Property) { + Property oldBase_Property = base_Property; + base_Property = newBase_Property; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.COPY_ATTRIBUTE_VALUE__BASE_PROPERTY, oldBase_Property, base_Property)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.COPY_ATTRIBUTE_VALUE__SOURCE: + if (resolve) return getSource(); + return basicGetSource(); + case FCMPackage.COPY_ATTRIBUTE_VALUE__BASE_PROPERTY: + if (resolve) return getBase_Property(); + return basicGetBase_Property(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.COPY_ATTRIBUTE_VALUE__SOURCE: + setSource((Property)newValue); + return; + case FCMPackage.COPY_ATTRIBUTE_VALUE__BASE_PROPERTY: + setBase_Property((Property)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.COPY_ATTRIBUTE_VALUE__SOURCE: + setSource((Property)null); + return; + case FCMPackage.COPY_ATTRIBUTE_VALUE__BASE_PROPERTY: + setBase_Property((Property)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.COPY_ATTRIBUTE_VALUE__SOURCE: + return source != null; + case FCMPackage.COPY_ATTRIBUTE_VALUE__BASE_PROPERTY: + return base_Property != null; + } + return super.eIsSet(featureID); + } + +} // CopyAttributeValueImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DeploymentPlanImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DeploymentPlanImpl.java new file mode 100644 index 00000000000..eeec84970e5 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DeploymentPlanImpl.java @@ -0,0 +1,228 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.uml2.uml.InstanceSpecification; + +/** + * + * An implementation of the model object 'Deployment Plan'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.DeploymentPlanImpl#getMainInstance Main Instance}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.DeploymentPlanImpl#getBase_Package Base Package}
    • + *
    + * + * @generated + */ +public class DeploymentPlanImpl extends EObjectImpl implements DeploymentPlan { + /** + * The cached value of the '{@link #getMainInstance() Main Instance}' reference. + * + * + * @see #getMainInstance() + * @generated + * @ordered + */ + protected InstanceSpecification mainInstance; + + /** + * The cached value of the '{@link #getBase_Package() Base Package}' reference. + * + * + * @see #getBase_Package() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Package base_Package; + + /** + * + * + * @generated + */ + protected DeploymentPlanImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.DEPLOYMENT_PLAN; + } + + /** + * + * + * @generated + */ + @Override + public InstanceSpecification getMainInstance() { + if (mainInstance != null && mainInstance.eIsProxy()) { + InternalEObject oldMainInstance = (InternalEObject)mainInstance; + mainInstance = (InstanceSpecification)eResolveProxy(oldMainInstance); + if (mainInstance != oldMainInstance) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.DEPLOYMENT_PLAN__MAIN_INSTANCE, oldMainInstance, mainInstance)); + } + } + return mainInstance; + } + + /** + * + * + * @generated + */ + public InstanceSpecification basicGetMainInstance() { + return mainInstance; + } + + /** + * + * + * @generated + */ + @Override + public void setMainInstance(InstanceSpecification newMainInstance) { + InstanceSpecification oldMainInstance = mainInstance; + mainInstance = newMainInstance; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.DEPLOYMENT_PLAN__MAIN_INSTANCE, oldMainInstance, mainInstance)); + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Package getBase_Package() { + if (base_Package != null && base_Package.eIsProxy()) { + InternalEObject oldBase_Package = (InternalEObject)base_Package; + base_Package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_Package); + if (base_Package != oldBase_Package) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.DEPLOYMENT_PLAN__BASE_PACKAGE, oldBase_Package, base_Package)); + } + } + return base_Package; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Package basicGetBase_Package() { + return base_Package; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { + org.eclipse.uml2.uml.Package oldBase_Package = base_Package; + base_Package = newBase_Package; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.DEPLOYMENT_PLAN__BASE_PACKAGE, oldBase_Package, base_Package)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.DEPLOYMENT_PLAN__MAIN_INSTANCE: + if (resolve) return getMainInstance(); + return basicGetMainInstance(); + case FCMPackage.DEPLOYMENT_PLAN__BASE_PACKAGE: + if (resolve) return getBase_Package(); + return basicGetBase_Package(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.DEPLOYMENT_PLAN__MAIN_INSTANCE: + setMainInstance((InstanceSpecification)newValue); + return; + case FCMPackage.DEPLOYMENT_PLAN__BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.DEPLOYMENT_PLAN__MAIN_INSTANCE: + setMainInstance((InstanceSpecification)null); + return; + case FCMPackage.DEPLOYMENT_PLAN__BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.DEPLOYMENT_PLAN__MAIN_INSTANCE: + return mainInstance != null; + case FCMPackage.DEPLOYMENT_PLAN__BASE_PACKAGE: + return base_Package != null; + } + return super.eIsSet(featureID); + } + +} // DeploymentPlanImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DerivedElementImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DerivedElementImpl.java new file mode 100644 index 00000000000..3217b6ff94e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/DerivedElementImpl.java @@ -0,0 +1,228 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.uml2.uml.Element; + +/** + * + * An implementation of the model object 'Derived Element'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.DerivedElementImpl#getBase_Element Base Element}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.DerivedElementImpl#getSource Source}
    • + *
    + * + * @generated + */ +public class DerivedElementImpl extends EObjectImpl implements DerivedElement { + /** + * The cached value of the '{@link #getBase_Element() Base Element}' reference. + * + * + * @see #getBase_Element() + * @generated + * @ordered + */ + protected Element base_Element; + + /** + * The cached value of the '{@link #getSource() Source}' reference. + * + * + * @see #getSource() + * @generated + * @ordered + */ + protected Element source; + + /** + * + * + * @generated + */ + protected DerivedElementImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.DERIVED_ELEMENT; + } + + /** + * + * + * @generated + */ + @Override + public Element getBase_Element() { + if (base_Element != null && base_Element.eIsProxy()) { + InternalEObject oldBase_Element = (InternalEObject)base_Element; + base_Element = (Element)eResolveProxy(oldBase_Element); + if (base_Element != oldBase_Element) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.DERIVED_ELEMENT__BASE_ELEMENT, oldBase_Element, base_Element)); + } + } + return base_Element; + } + + /** + * + * + * @generated + */ + public Element basicGetBase_Element() { + return base_Element; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Element(Element newBase_Element) { + Element oldBase_Element = base_Element; + base_Element = newBase_Element; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.DERIVED_ELEMENT__BASE_ELEMENT, oldBase_Element, base_Element)); + } + + /** + * + * + * @generated + */ + @Override + public Element getSource() { + if (source != null && source.eIsProxy()) { + InternalEObject oldSource = (InternalEObject)source; + source = (Element)eResolveProxy(oldSource); + if (source != oldSource) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.DERIVED_ELEMENT__SOURCE, oldSource, source)); + } + } + return source; + } + + /** + * + * + * @generated + */ + public Element basicGetSource() { + return source; + } + + /** + * + * + * @generated + */ + @Override + public void setSource(Element newSource) { + Element oldSource = source; + source = newSource; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.DERIVED_ELEMENT__SOURCE, oldSource, source)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.DERIVED_ELEMENT__BASE_ELEMENT: + if (resolve) return getBase_Element(); + return basicGetBase_Element(); + case FCMPackage.DERIVED_ELEMENT__SOURCE: + if (resolve) return getSource(); + return basicGetSource(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.DERIVED_ELEMENT__BASE_ELEMENT: + setBase_Element((Element)newValue); + return; + case FCMPackage.DERIVED_ELEMENT__SOURCE: + setSource((Element)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.DERIVED_ELEMENT__BASE_ELEMENT: + setBase_Element((Element)null); + return; + case FCMPackage.DERIVED_ELEMENT__SOURCE: + setSource((Element)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.DERIVED_ELEMENT__BASE_ELEMENT: + return base_Element != null; + case FCMPackage.DERIVED_ELEMENT__SOURCE: + return source != null; + } + return super.eIsSet(featureID); + } + +} // DerivedElementImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMFactoryImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMFactoryImpl.java new file mode 100644 index 00000000000..9cd6ea0b76d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMFactoryImpl.java @@ -0,0 +1,652 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.impl.EFactoryImpl; +import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.eclipse.papyrus.FCM.*; +import org.eclipse.papyrus.FCM.Assembly; +import org.eclipse.papyrus.FCM.AutoIndex; +import org.eclipse.papyrus.FCM.AutoIndexPerNode; +import org.eclipse.papyrus.FCM.BindTemplate; +import org.eclipse.papyrus.FCM.BindingHelper; +import org.eclipse.papyrus.FCM.CodeGenOptions; +import org.eclipse.papyrus.FCM.CompImplTemplate; +import org.eclipse.papyrus.FCM.CompToOOmapping; +import org.eclipse.papyrus.FCM.CompilerChain; +import org.eclipse.papyrus.FCM.ConfigOption; +import org.eclipse.papyrus.FCM.Configuration; +import org.eclipse.papyrus.FCM.ConfigurationProperty; +import org.eclipse.papyrus.FCM.Connector; +import org.eclipse.papyrus.FCM.ConnectorConfiguration; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.ContainerRuleKind; +import org.eclipse.papyrus.FCM.CopyAttributeValue; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.FCM.FCMFactory; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.Flatten; +import org.eclipse.papyrus.FCM.Fragment; +import org.eclipse.papyrus.FCM.ImplementationGroup; +import org.eclipse.papyrus.FCM.ImplementationProperties; +import org.eclipse.papyrus.FCM.InitPrecedence; +import org.eclipse.papyrus.FCM.InstanceConfigurator; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.FCM.InterceptionKind; +import org.eclipse.papyrus.FCM.InterceptionRule; +import org.eclipse.papyrus.FCM.OperatingSystem; +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.PortKind; +import org.eclipse.papyrus.FCM.ProgLanguage; +import org.eclipse.papyrus.FCM.RuleApplication; +import org.eclipse.papyrus.FCM.Singleton; +import org.eclipse.papyrus.FCM.Target; +import org.eclipse.papyrus.FCM.TargetArchitecture; +import org.eclipse.papyrus.FCM.Template; +import org.eclipse.papyrus.FCM.TemplatePort; +import org.eclipse.papyrus.FCM.UseInstanceConfigurator; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class FCMFactoryImpl extends EFactoryImpl implements FCMFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static FCMFactory init() { + try { + FCMFactory theFCMFactory = (FCMFactory)EPackage.Registry.INSTANCE.getEFactory(FCMPackage.eNS_URI); + if (theFCMFactory != null) { + return theFCMFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new FCMFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public FCMFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case FCMPackage.TEMPLATE: return createTemplate(); + case FCMPackage.BINDING_HELPER: return createBindingHelper(); + case FCMPackage.CONFIGURATION_PROPERTY: return createConfigurationProperty(); + case FCMPackage.IMPLEMENTATION_GROUP: return createImplementationGroup(); + case FCMPackage.ASSEMBLY: return createAssembly(); + case FCMPackage.FLATTEN: return createFlatten(); + case FCMPackage.COMP_TO_OOMAPPING: return createCompToOOmapping(); + case FCMPackage.PROG_LANGUAGE: return createProgLanguage(); + case FCMPackage.CODE_GEN_OPTIONS: return createCodeGenOptions(); + case FCMPackage.INTERACTION_COMPONENT: return createInteractionComponent(); + case FCMPackage.SINGLETON: return createSingleton(); + case FCMPackage.CONNECTOR: return createConnector(); + case FCMPackage.USE_INSTANCE_CONFIGURATOR: return createUseInstanceConfigurator(); + case FCMPackage.INSTANCE_CONFIGURATOR: return createInstanceConfigurator(); + case FCMPackage.RULE_APPLICATION: return createRuleApplication(); + case FCMPackage.CONTAINER_RULE: return createContainerRule(); + case FCMPackage.CONFIG_OPTION: return createConfigOption(); + case FCMPackage.TEMPLATE_PORT: return createTemplatePort(); + case FCMPackage.PORT: return createPort(); + case FCMPackage.PORT_KIND: return createPortKind(); + case FCMPackage.DEPLOYMENT_PLAN: return createDeploymentPlan(); + case FCMPackage.DERIVED_ELEMENT: return createDerivedElement(); + case FCMPackage.COMP_IMPL_TEMPLATE: return createCompImplTemplate(); + case FCMPackage.IMPLEMENTATION_PROPERTIES: return createImplementationProperties(); + case FCMPackage.OPERATING_SYSTEM: return createOperatingSystem(); + case FCMPackage.TARGET_ARCHITECTURE: return createTargetArchitecture(); + case FCMPackage.CONFIGURATION: return createConfiguration(); + case FCMPackage.INTERCEPTION_RULE: return createInterceptionRule(); + case FCMPackage.TARGET: return createTarget(); + case FCMPackage.COMPILER_CHAIN: return createCompilerChain(); + case FCMPackage.FRAGMENT: return createFragment(); + case FCMPackage.COPY_ATTRIBUTE_VALUE: return createCopyAttributeValue(); + case FCMPackage.AUTO_INDEX: return createAutoIndex(); + case FCMPackage.AUTO_INDEX_PER_NODE: return createAutoIndexPerNode(); + case FCMPackage.INIT_PRECEDENCE: return createInitPrecedence(); + case FCMPackage.CONNECTOR_CONFIGURATION: return createConnectorConfiguration(); + case FCMPackage.BIND_TEMPLATE: return createBindTemplate(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + + /** + * + * + * @generated + */ + @Override + public Object createFromString(EDataType eDataType, String initialValue) { + switch (eDataType.getClassifierID()) { + case FCMPackage.CONTAINER_RULE_KIND: + return createContainerRuleKindFromString(eDataType, initialValue); + case FCMPackage.INTERCEPTION_KIND: + return createInterceptionKindFromString(eDataType, initialValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + + /** + * + * + * @generated + */ + @Override + public String convertToString(EDataType eDataType, Object instanceValue) { + switch (eDataType.getClassifierID()) { + case FCMPackage.CONTAINER_RULE_KIND: + return convertContainerRuleKindToString(eDataType, instanceValue); + case FCMPackage.INTERCEPTION_KIND: + return convertInterceptionKindToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + + /** + * + * + * @generated + */ + @Override + public Template createTemplate() { + TemplateImpl template = new TemplateImpl(); + return template; + } + + /** + * + * + * @generated + */ + @Override + public BindingHelper createBindingHelper() { + BindingHelperImpl bindingHelper = new BindingHelperImpl(); + return bindingHelper; + } + + /** + * + * + * @generated + */ + @Override + public ConfigurationProperty createConfigurationProperty() { + ConfigurationPropertyImpl configurationProperty = new ConfigurationPropertyImpl(); + return configurationProperty; + } + + /** + * + * + * @generated + */ + @Override + public ImplementationGroup createImplementationGroup() { + ImplementationGroupImpl implementationGroup = new ImplementationGroupImpl(); + return implementationGroup; + } + + /** + * + * + * @generated + */ + @Override + public Assembly createAssembly() { + AssemblyImpl assembly = new AssemblyImpl(); + return assembly; + } + + /** + * + * + * @generated + */ + @Override + public Flatten createFlatten() { + FlattenImpl flatten = new FlattenImpl(); + return flatten; + } + + /** + * + * + * @generated + */ + @Override + public CompToOOmapping createCompToOOmapping() { + CompToOOmappingImpl compToOOmapping = new CompToOOmappingImpl(); + return compToOOmapping; + } + + /** + * + * + * @generated + */ + @Override + public ProgLanguage createProgLanguage() { + ProgLanguageImpl progLanguage = new ProgLanguageImpl(); + return progLanguage; + } + + /** + * + * + * @generated + */ + @Override + public CodeGenOptions createCodeGenOptions() { + CodeGenOptionsImpl codeGenOptions = new CodeGenOptionsImpl(); + return codeGenOptions; + } + + /** + * + * + * @generated + */ + @Override + public InteractionComponent createInteractionComponent() { + InteractionComponentImpl interactionComponent = new InteractionComponentImpl(); + return interactionComponent; + } + + /** + * + * + * @generated + */ + @Override + public Singleton createSingleton() { + SingletonImpl singleton = new SingletonImpl(); + return singleton; + } + + /** + * + * + * @generated + */ + @Override + public Connector createConnector() { + ConnectorImpl connector = new ConnectorImpl(); + return connector; + } + + /** + * + * + * @generated + */ + @Override + public UseInstanceConfigurator createUseInstanceConfigurator() { + UseInstanceConfiguratorImpl useInstanceConfigurator = new UseInstanceConfiguratorImpl(); + return useInstanceConfigurator; + } + + /** + * + * + * @generated + */ + @Override + public InstanceConfigurator createInstanceConfigurator() { + InstanceConfiguratorImpl instanceConfigurator = new InstanceConfiguratorImpl(); + return instanceConfigurator; + } + + /** + * + * + * @generated + */ + @Override + public RuleApplication createRuleApplication() { + RuleApplicationImpl ruleApplication = new RuleApplicationImpl(); + return ruleApplication; + } + + /** + * + * + * @generated + */ + @Override + public ContainerRule createContainerRule() { + ContainerRuleImpl containerRule = new ContainerRuleImpl(); + return containerRule; + } + + /** + * + * + * @generated + */ + @Override + public ConfigOption createConfigOption() { + ConfigOptionImpl configOption = new ConfigOptionImpl(); + return configOption; + } + + /** + * + * + * @generated + */ + @Override + public TemplatePort createTemplatePort() { + TemplatePortImpl templatePort = new TemplatePortImpl(); + return templatePort; + } + + /** + * + * + * @generated + */ + @Override + public Port createPort() { + PortImpl port = new PortImpl(); + return port; + } + + /** + * + * + * @generated + */ + @Override + public PortKind createPortKind() { + PortKindImpl portKind = new PortKindImpl(); + return portKind; + } + + /** + * + * + * @generated + */ + @Override + public DeploymentPlan createDeploymentPlan() { + DeploymentPlanImpl deploymentPlan = new DeploymentPlanImpl(); + return deploymentPlan; + } + + /** + * + * + * @generated + */ + @Override + public DerivedElement createDerivedElement() { + DerivedElementImpl derivedElement = new DerivedElementImpl(); + return derivedElement; + } + + /** + * + * + * @generated + */ + @Override + public CompImplTemplate createCompImplTemplate() { + CompImplTemplateImpl compImplTemplate = new CompImplTemplateImpl(); + return compImplTemplate; + } + + /** + * + * + * @generated + */ + @Override + public ImplementationProperties createImplementationProperties() { + ImplementationPropertiesImpl implementationProperties = new ImplementationPropertiesImpl(); + return implementationProperties; + } + + /** + * + * + * @generated + */ + @Override + public OperatingSystem createOperatingSystem() { + OperatingSystemImpl operatingSystem = new OperatingSystemImpl(); + return operatingSystem; + } + + /** + * + * + * @generated + */ + @Override + public TargetArchitecture createTargetArchitecture() { + TargetArchitectureImpl targetArchitecture = new TargetArchitectureImpl(); + return targetArchitecture; + } + + /** + * + * + * @generated + */ + @Override + public Configuration createConfiguration() { + ConfigurationImpl configuration = new ConfigurationImpl(); + return configuration; + } + + /** + * + * + * @generated + */ + @Override + public InterceptionRule createInterceptionRule() { + InterceptionRuleImpl interceptionRule = new InterceptionRuleImpl(); + return interceptionRule; + } + + /** + * + * + * @generated + */ + @Override + public Target createTarget() { + TargetImpl target = new TargetImpl(); + return target; + } + + /** + * + * + * @generated + */ + @Override + public CompilerChain createCompilerChain() { + CompilerChainImpl compilerChain = new CompilerChainImpl(); + return compilerChain; + } + + /** + * + * + * @generated + */ + @Override + public Fragment createFragment() { + FragmentImpl fragment = new FragmentImpl(); + return fragment; + } + + /** + * + * + * @generated + */ + @Override + public CopyAttributeValue createCopyAttributeValue() { + CopyAttributeValueImpl copyAttributeValue = new CopyAttributeValueImpl(); + return copyAttributeValue; + } + + /** + * + * + * @generated + */ + @Override + public AutoIndex createAutoIndex() { + AutoIndexImpl autoIndex = new AutoIndexImpl(); + return autoIndex; + } + + /** + * + * + * @generated + */ + @Override + public AutoIndexPerNode createAutoIndexPerNode() { + AutoIndexPerNodeImpl autoIndexPerNode = new AutoIndexPerNodeImpl(); + return autoIndexPerNode; + } + + /** + * + * + * @generated + */ + @Override + public InitPrecedence createInitPrecedence() { + InitPrecedenceImpl initPrecedence = new InitPrecedenceImpl(); + return initPrecedence; + } + + /** + * + * + * @generated + */ + @Override + public ConnectorConfiguration createConnectorConfiguration() { + ConnectorConfigurationImpl connectorConfiguration = new ConnectorConfigurationImpl(); + return connectorConfiguration; + } + + /** + * + * + * @generated + */ + @Override + public BindTemplate createBindTemplate() { + BindTemplateImpl bindTemplate = new BindTemplateImpl(); + return bindTemplate; + } + + /** + * + * + * @generated + */ + public ContainerRuleKind createContainerRuleKindFromString(EDataType eDataType, String initialValue) { + ContainerRuleKind result = ContainerRuleKind.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + return result; + } + + /** + * + * + * @generated + */ + public String convertContainerRuleKindToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public InterceptionKind createInterceptionKindFromString(EDataType eDataType, String initialValue) { + InterceptionKind result = InterceptionKind.get(initialValue); + if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + return result; + } + + /** + * + * + * @generated + */ + public String convertInterceptionKindToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + @Override + public FCMPackage getFCMPackage() { + return (FCMPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static FCMPackage getPackage() { + return FCMPackage.eINSTANCE; + } + +} // FCMFactoryImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMPackageImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMPackageImpl.java new file mode 100644 index 00000000000..c59952dab6e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FCMPackageImpl.java @@ -0,0 +1,2002 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.impl.EPackageImpl; +import org.eclipse.papyrus.FCM.Assembly; +import org.eclipse.papyrus.FCM.AutoIndex; +import org.eclipse.papyrus.FCM.AutoIndexPerNode; +import org.eclipse.papyrus.FCM.BindTemplate; +import org.eclipse.papyrus.FCM.BindingHelper; +import org.eclipse.papyrus.FCM.CodeGenOptions; +import org.eclipse.papyrus.FCM.CompImplTemplate; +import org.eclipse.papyrus.FCM.CompToOOmapping; +import org.eclipse.papyrus.FCM.CompilerChain; +import org.eclipse.papyrus.FCM.ConfigOption; +import org.eclipse.papyrus.FCM.ConfigurableElementInstance; +import org.eclipse.papyrus.FCM.Configuration; +import org.eclipse.papyrus.FCM.ConfigurationProperty; +import org.eclipse.papyrus.FCM.Connector; +import org.eclipse.papyrus.FCM.ConnectorConfiguration; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.ContainerRuleKind; +import org.eclipse.papyrus.FCM.CopyAttributeValue; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.FCM.FCMFactory; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.Flatten; +import org.eclipse.papyrus.FCM.Fragment; +import org.eclipse.papyrus.FCM.ImplementationGroup; +import org.eclipse.papyrus.FCM.ImplementationProperties; +import org.eclipse.papyrus.FCM.InitPrecedence; +import org.eclipse.papyrus.FCM.InstanceConfigurator; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.FCM.InterceptionKind; +import org.eclipse.papyrus.FCM.InterceptionRule; +import org.eclipse.papyrus.FCM.OperatingSystem; +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.PortKind; +import org.eclipse.papyrus.FCM.ProgLanguage; +import org.eclipse.papyrus.FCM.RuleApplication; +import org.eclipse.papyrus.FCM.Singleton; +import org.eclipse.papyrus.FCM.Target; +import org.eclipse.papyrus.FCM.TargetArchitecture; +import org.eclipse.papyrus.FCM.Template; +import org.eclipse.papyrus.FCM.TemplatePort; +import org.eclipse.papyrus.FCM.UseInstanceConfigurator; +import org.eclipse.uml2.types.TypesPackage; +import org.eclipse.uml2.uml.UMLPackage; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class FCMPackageImpl extends EPackageImpl implements FCMPackage { + /** + * + * + * @generated + */ + private EClass templateEClass = null; + + /** + * + * + * @generated + */ + private EClass bindingHelperEClass = null; + + /** + * + * + * @generated + */ + private EClass configurationPropertyEClass = null; + + /** + * + * + * @generated + */ + private EClass implementationGroupEClass = null; + + /** + * + * + * @generated + */ + private EClass assemblyEClass = null; + + /** + * + * + * @generated + */ + private EClass flattenEClass = null; + + /** + * + * + * @generated + */ + private EClass compToOOmappingEClass = null; + + /** + * + * + * @generated + */ + private EClass progLanguageEClass = null; + + /** + * + * + * @generated + */ + private EClass codeGenOptionsEClass = null; + + /** + * + * + * @generated + */ + private EClass interactionComponentEClass = null; + + /** + * + * + * @generated + */ + private EClass singletonEClass = null; + + /** + * + * + * @generated + */ + private EClass connectorEClass = null; + + /** + * + * + * @generated + */ + private EClass configurableElementInstanceEClass = null; + + /** + * + * + * @generated + */ + private EClass useInstanceConfiguratorEClass = null; + + /** + * + * + * @generated + */ + private EClass instanceConfiguratorEClass = null; + + /** + * + * + * @generated + */ + private EClass ruleApplicationEClass = null; + + /** + * + * + * @generated + */ + private EClass containerRuleEClass = null; + + /** + * + * + * @generated + */ + private EClass configOptionEClass = null; + + /** + * + * + * @generated + */ + private EClass templatePortEClass = null; + + /** + * + * + * @generated + */ + private EClass portEClass = null; + + /** + * + * + * @generated + */ + private EClass portKindEClass = null; + + /** + * + * + * @generated + */ + private EClass deploymentPlanEClass = null; + + /** + * + * + * @generated + */ + private EClass derivedElementEClass = null; + + /** + * + * + * @generated + */ + private EClass compImplTemplateEClass = null; + + /** + * + * + * @generated + */ + private EClass implementationPropertiesEClass = null; + + /** + * + * + * @generated + */ + private EClass operatingSystemEClass = null; + + /** + * + * + * @generated + */ + private EClass targetArchitectureEClass = null; + + /** + * + * + * @generated + */ + private EClass configurationEClass = null; + + /** + * + * + * @generated + */ + private EClass interceptionRuleEClass = null; + + /** + * + * + * @generated + */ + private EClass targetEClass = null; + + /** + * + * + * @generated + */ + private EClass compilerChainEClass = null; + + /** + * + * + * @generated + */ + private EClass fragmentEClass = null; + + /** + * + * + * @generated + */ + private EClass copyAttributeValueEClass = null; + + /** + * + * + * @generated + */ + private EClass autoIndexEClass = null; + + /** + * + * + * @generated + */ + private EClass autoIndexPerNodeEClass = null; + + /** + * + * + * @generated + */ + private EClass initPrecedenceEClass = null; + + /** + * + * + * @generated + */ + private EClass connectorConfigurationEClass = null; + + /** + * + * + * @generated + */ + private EClass bindTemplateEClass = null; + + /** + * + * + * @generated + */ + private EEnum containerRuleKindEEnum = null; + + /** + * + * + * @generated + */ + private EEnum interceptionKindEEnum = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

    Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.papyrus.FCM.FCMPackage#eNS_URI + * @see #init() + * @generated + */ + private FCMPackageImpl() { + super(eNS_URI, FCMFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

    This method is used to initialize {@link FCMPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static FCMPackage init() { + if (isInited) return (FCMPackage)EPackage.Registry.INSTANCE.getEPackage(FCMPackage.eNS_URI); + + // Obtain or create and register package + FCMPackageImpl theFCMPackage = (FCMPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FCMPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FCMPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + UMLPackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theFCMPackage.createPackageContents(); + + // Initialize created meta-data + theFCMPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theFCMPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(FCMPackage.eNS_URI, theFCMPackage); + return theFCMPackage; + } + + /** + * + * + * @generated + */ + @Override + public EClass getTemplate() { + return templateEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getTemplate_Base_Element() { + return (EReference)templateEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTemplate_Helper() { + return (EReference)templateEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBindingHelper() { + return bindingHelperEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getBindingHelper_Base_Class() { + return (EReference)bindingHelperEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getConfigurationProperty() { + return configurationPropertyEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getConfigurationProperty_Base_Property() { + return (EReference)configurationPropertyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getImplementationGroup() { + return implementationGroupEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getImplementationGroup_Base_Class() { + return (EReference)implementationGroupEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getAssembly() { + return assemblyEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getAssembly_Base_Class() { + return (EReference)assemblyEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getFlatten() { + return flattenEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getFlatten_Base_Class() { + return (EReference)flattenEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCompToOOmapping() { + return compToOOmappingEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCompToOOmapping_Base_Class() { + return (EReference)compToOOmappingEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getProgLanguage() { + return progLanguageEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getProgLanguage_Base_Class() { + return (EReference)progLanguageEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCodeGenOptions() { + return codeGenOptionsEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCodeGenOptions_Base_Package() { + return (EReference)codeGenOptionsEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCodeGenOptions_CompToOOmapping() { + return (EReference)codeGenOptionsEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCodeGenOptions_ProgLanguage() { + return (EReference)codeGenOptionsEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getInteractionComponent() { + return interactionComponentEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getInteractionComponent_ForDistribution() { + return (EAttribute)interactionComponentEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInteractionComponent_ConnectionPattern() { + return (EReference)interactionComponentEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInteractionComponent_Base_Class() { + return (EReference)interactionComponentEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getSingleton() { + return singletonEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getSingleton_Base_Class() { + return (EReference)singletonEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getConnector() { + return connectorEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getConnector_Base_Connector() { + return (EReference)connectorEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getConnector_Ic() { + return (EReference)connectorEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getConnector_Base_Property() { + return (EReference)connectorEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getConfigurableElementInstance() { + return configurableElementInstanceEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getConfigurableElementInstance_Configuration() { + return (EReference)configurableElementInstanceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getUseInstanceConfigurator() { + return useInstanceConfiguratorEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getUseInstanceConfigurator_Base_Class() { + return (EReference)useInstanceConfiguratorEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getUseInstanceConfigurator_Configurator() { + return (EReference)useInstanceConfiguratorEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getInstanceConfigurator() { + return instanceConfiguratorEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getInstanceConfigurator_Base_Class() { + return (EReference)instanceConfiguratorEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getInstanceConfigurator_OnNodeModel() { + return (EAttribute)instanceConfiguratorEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getRuleApplication() { + return ruleApplicationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getRuleApplication_Base_Class() { + return (EReference)ruleApplicationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getRuleApplication_ContainerRule() { + return (EReference)ruleApplicationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getRuleApplication_Base_Package() { + return (EReference)ruleApplicationEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getContainerRule() { + return containerRuleEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getContainerRule_Base_Class() { + return (EReference)containerRuleEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getContainerRule_ForConfig() { + return (EReference)containerRuleEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getContainerRule_Kind() { + return (EAttribute)containerRuleEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getConfigOption() { + return configOptionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getConfigOption_Base_Class() { + return (EReference)configOptionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTemplatePort() { + return templatePortEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getTemplatePort_BoundType() { + return (EReference)templatePortEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPort() { + return portEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getPort_Base_Port() { + return (EReference)portEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getPort_Kind() { + return (EReference)portEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getPort_Type() { + return (EReference)portEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getPortKind() { + return portKindEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getPortKind_Base_Class() { + return (EReference)portKindEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getPortKind_ProvidedInterface() { + return (EReference)portKindEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getPortKind_RequiredInterface() { + return (EReference)portKindEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getPortKind_ExtendedPort() { + return (EAttribute)portKindEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDeploymentPlan() { + return deploymentPlanEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getDeploymentPlan_MainInstance() { + return (EReference)deploymentPlanEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDeploymentPlan_Base_Package() { + return (EReference)deploymentPlanEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getDerivedElement() { + return derivedElementEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getDerivedElement_Base_Element() { + return (EReference)derivedElementEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getDerivedElement_Source() { + return (EReference)derivedElementEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCompImplTemplate() { + return compImplTemplateEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCompImplTemplate_TemplateDefs() { + return (EAttribute)compImplTemplateEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCompImplTemplate_Base_Class() { + return (EReference)compImplTemplateEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getImplementationProperties() { + return implementationPropertiesEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getImplementationProperties_SizeRAM() { + return (EAttribute)implementationPropertiesEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getImplementationProperties_SupportedOS() { + return (EReference)implementationPropertiesEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getImplementationProperties_Arch() { + return (EReference)implementationPropertiesEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getImplementationProperties_Base_Class() { + return (EReference)implementationPropertiesEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getImplementationProperties_SizeROM() { + return (EAttribute)implementationPropertiesEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getImplementationProperties_SupportedTargetArch() { + return (EReference)implementationPropertiesEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EClass getOperatingSystem() { + return operatingSystemEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getOperatingSystem_Base_Class() { + return (EReference)operatingSystemEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTargetArchitecture() { + return targetArchitectureEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getTargetArchitecture_Base_Class() { + return (EReference)targetArchitectureEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getConfiguration() { + return configurationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getConfiguration_Base_Class() { + return (EReference)configurationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getConfiguration_ConfigOptions() { + return (EReference)configurationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getConfiguration_DeploymentPlan() { + return (EReference)configurationEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getInterceptionRule() { + return interceptionRuleEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getInterceptionRule_InterceptionKind() { + return (EAttribute)interceptionRuleEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInterceptionRule_InterceptionSet() { + return (EReference)interceptionRuleEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInterceptionRule_Base_Property() { + return (EReference)interceptionRuleEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInterceptionRule_Base_Operation() { + return (EReference)interceptionRuleEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getTarget() { + return targetEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getTarget_TargetArch() { + return (EReference)targetEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTarget_Options() { + return (EReference)targetEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTarget_Base_Node() { + return (EReference)targetEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTarget_UsedOS() { + return (EReference)targetEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTarget_AvailRAM() { + return (EAttribute)targetEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getTarget_AvailROM() { + return (EAttribute)targetEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EReference getTarget_Compiler() { + return (EReference)targetEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCompilerChain() { + return compilerChainEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCompilerChain_Base_Class() { + return (EReference)compilerChainEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getFragment() { + return fragmentEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getFragment_Base_Class() { + return (EReference)fragmentEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCopyAttributeValue() { + return copyAttributeValueEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCopyAttributeValue_Source() { + return (EReference)copyAttributeValueEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCopyAttributeValue_Base_Property() { + return (EReference)copyAttributeValueEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getAutoIndex() { + return autoIndexEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getAutoIndex_Base_Property() { + return (EReference)autoIndexEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EClass getAutoIndexPerNode() { + return autoIndexPerNodeEClass; + } + + /** + * + * + * @generated + */ + @Override + public EClass getInitPrecedence() { + return initPrecedenceEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getInitPrecedence_InvokeAfter() { + return (EReference)initPrecedenceEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInitPrecedence_InvokeBefore() { + return (EReference)initPrecedenceEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInitPrecedence_Base_Class() { + return (EReference)initPrecedenceEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getConnectorConfiguration() { + return connectorConfigurationEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getConnectorConfiguration_Base_Slot() { + return (EReference)connectorConfigurationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getConnectorConfiguration_Connector() { + return (EReference)connectorConfigurationEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getBindTemplate() { + return bindTemplateEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getBindTemplate_Actual() { + return (EReference)bindTemplateEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getBindTemplate_Base_Property() { + return (EReference)bindTemplateEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EEnum getContainerRuleKind() { + return containerRuleKindEEnum; + } + + /** + * + * + * @generated + */ + @Override + public EEnum getInterceptionKind() { + return interceptionKindEEnum; + } + + /** + * + * + * @generated + */ + @Override + public FCMFactory getFCMFactory() { + return (FCMFactory)getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + templateEClass = createEClass(TEMPLATE); + createEReference(templateEClass, TEMPLATE__BASE_ELEMENT); + createEReference(templateEClass, TEMPLATE__HELPER); + + bindingHelperEClass = createEClass(BINDING_HELPER); + createEReference(bindingHelperEClass, BINDING_HELPER__BASE_CLASS); + + configurationPropertyEClass = createEClass(CONFIGURATION_PROPERTY); + createEReference(configurationPropertyEClass, CONFIGURATION_PROPERTY__BASE_PROPERTY); + + implementationGroupEClass = createEClass(IMPLEMENTATION_GROUP); + createEReference(implementationGroupEClass, IMPLEMENTATION_GROUP__BASE_CLASS); + + assemblyEClass = createEClass(ASSEMBLY); + createEReference(assemblyEClass, ASSEMBLY__BASE_CLASS); + + flattenEClass = createEClass(FLATTEN); + createEReference(flattenEClass, FLATTEN__BASE_CLASS); + + compToOOmappingEClass = createEClass(COMP_TO_OOMAPPING); + createEReference(compToOOmappingEClass, COMP_TO_OOMAPPING__BASE_CLASS); + + progLanguageEClass = createEClass(PROG_LANGUAGE); + createEReference(progLanguageEClass, PROG_LANGUAGE__BASE_CLASS); + + codeGenOptionsEClass = createEClass(CODE_GEN_OPTIONS); + createEReference(codeGenOptionsEClass, CODE_GEN_OPTIONS__BASE_PACKAGE); + createEReference(codeGenOptionsEClass, CODE_GEN_OPTIONS__COMP_TO_OOMAPPING); + createEReference(codeGenOptionsEClass, CODE_GEN_OPTIONS__PROG_LANGUAGE); + + interactionComponentEClass = createEClass(INTERACTION_COMPONENT); + createEAttribute(interactionComponentEClass, INTERACTION_COMPONENT__FOR_DISTRIBUTION); + createEReference(interactionComponentEClass, INTERACTION_COMPONENT__CONNECTION_PATTERN); + createEReference(interactionComponentEClass, INTERACTION_COMPONENT__BASE_CLASS); + + singletonEClass = createEClass(SINGLETON); + createEReference(singletonEClass, SINGLETON__BASE_CLASS); + + connectorEClass = createEClass(CONNECTOR); + createEReference(connectorEClass, CONNECTOR__BASE_CONNECTOR); + createEReference(connectorEClass, CONNECTOR__IC); + createEReference(connectorEClass, CONNECTOR__BASE_PROPERTY); + + configurableElementInstanceEClass = createEClass(CONFIGURABLE_ELEMENT_INSTANCE); + createEReference(configurableElementInstanceEClass, CONFIGURABLE_ELEMENT_INSTANCE__CONFIGURATION); + + useInstanceConfiguratorEClass = createEClass(USE_INSTANCE_CONFIGURATOR); + createEReference(useInstanceConfiguratorEClass, USE_INSTANCE_CONFIGURATOR__BASE_CLASS); + createEReference(useInstanceConfiguratorEClass, USE_INSTANCE_CONFIGURATOR__CONFIGURATOR); + + instanceConfiguratorEClass = createEClass(INSTANCE_CONFIGURATOR); + createEReference(instanceConfiguratorEClass, INSTANCE_CONFIGURATOR__BASE_CLASS); + createEAttribute(instanceConfiguratorEClass, INSTANCE_CONFIGURATOR__ON_NODE_MODEL); + + ruleApplicationEClass = createEClass(RULE_APPLICATION); + createEReference(ruleApplicationEClass, RULE_APPLICATION__BASE_CLASS); + createEReference(ruleApplicationEClass, RULE_APPLICATION__CONTAINER_RULE); + createEReference(ruleApplicationEClass, RULE_APPLICATION__BASE_PACKAGE); + + containerRuleEClass = createEClass(CONTAINER_RULE); + createEReference(containerRuleEClass, CONTAINER_RULE__BASE_CLASS); + createEReference(containerRuleEClass, CONTAINER_RULE__FOR_CONFIG); + createEAttribute(containerRuleEClass, CONTAINER_RULE__KIND); + + configOptionEClass = createEClass(CONFIG_OPTION); + createEReference(configOptionEClass, CONFIG_OPTION__BASE_CLASS); + + templatePortEClass = createEClass(TEMPLATE_PORT); + createEReference(templatePortEClass, TEMPLATE_PORT__BOUND_TYPE); + + portEClass = createEClass(PORT); + createEReference(portEClass, PORT__BASE_PORT); + createEReference(portEClass, PORT__KIND); + createEReference(portEClass, PORT__TYPE); + + portKindEClass = createEClass(PORT_KIND); + createEReference(portKindEClass, PORT_KIND__BASE_CLASS); + createEReference(portKindEClass, PORT_KIND__PROVIDED_INTERFACE); + createEReference(portKindEClass, PORT_KIND__REQUIRED_INTERFACE); + createEAttribute(portKindEClass, PORT_KIND__EXTENDED_PORT); + + deploymentPlanEClass = createEClass(DEPLOYMENT_PLAN); + createEReference(deploymentPlanEClass, DEPLOYMENT_PLAN__MAIN_INSTANCE); + createEReference(deploymentPlanEClass, DEPLOYMENT_PLAN__BASE_PACKAGE); + + derivedElementEClass = createEClass(DERIVED_ELEMENT); + createEReference(derivedElementEClass, DERIVED_ELEMENT__BASE_ELEMENT); + createEReference(derivedElementEClass, DERIVED_ELEMENT__SOURCE); + + compImplTemplateEClass = createEClass(COMP_IMPL_TEMPLATE); + createEAttribute(compImplTemplateEClass, COMP_IMPL_TEMPLATE__TEMPLATE_DEFS); + createEReference(compImplTemplateEClass, COMP_IMPL_TEMPLATE__BASE_CLASS); + + implementationPropertiesEClass = createEClass(IMPLEMENTATION_PROPERTIES); + createEAttribute(implementationPropertiesEClass, IMPLEMENTATION_PROPERTIES__SIZE_RAM); + createEReference(implementationPropertiesEClass, IMPLEMENTATION_PROPERTIES__SUPPORTED_OS); + createEReference(implementationPropertiesEClass, IMPLEMENTATION_PROPERTIES__ARCH); + createEReference(implementationPropertiesEClass, IMPLEMENTATION_PROPERTIES__BASE_CLASS); + createEAttribute(implementationPropertiesEClass, IMPLEMENTATION_PROPERTIES__SIZE_ROM); + createEReference(implementationPropertiesEClass, IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH); + + operatingSystemEClass = createEClass(OPERATING_SYSTEM); + createEReference(operatingSystemEClass, OPERATING_SYSTEM__BASE_CLASS); + + targetArchitectureEClass = createEClass(TARGET_ARCHITECTURE); + createEReference(targetArchitectureEClass, TARGET_ARCHITECTURE__BASE_CLASS); + + configurationEClass = createEClass(CONFIGURATION); + createEReference(configurationEClass, CONFIGURATION__BASE_CLASS); + createEReference(configurationEClass, CONFIGURATION__CONFIG_OPTIONS); + createEReference(configurationEClass, CONFIGURATION__DEPLOYMENT_PLAN); + + interceptionRuleEClass = createEClass(INTERCEPTION_RULE); + createEAttribute(interceptionRuleEClass, INTERCEPTION_RULE__INTERCEPTION_KIND); + createEReference(interceptionRuleEClass, INTERCEPTION_RULE__INTERCEPTION_SET); + createEReference(interceptionRuleEClass, INTERCEPTION_RULE__BASE_PROPERTY); + createEReference(interceptionRuleEClass, INTERCEPTION_RULE__BASE_OPERATION); + + targetEClass = createEClass(TARGET); + createEReference(targetEClass, TARGET__TARGET_ARCH); + createEReference(targetEClass, TARGET__OPTIONS); + createEReference(targetEClass, TARGET__BASE_NODE); + createEReference(targetEClass, TARGET__USED_OS); + createEAttribute(targetEClass, TARGET__AVAIL_RAM); + createEAttribute(targetEClass, TARGET__AVAIL_ROM); + createEReference(targetEClass, TARGET__COMPILER); + + compilerChainEClass = createEClass(COMPILER_CHAIN); + createEReference(compilerChainEClass, COMPILER_CHAIN__BASE_CLASS); + + fragmentEClass = createEClass(FRAGMENT); + createEReference(fragmentEClass, FRAGMENT__BASE_CLASS); + + copyAttributeValueEClass = createEClass(COPY_ATTRIBUTE_VALUE); + createEReference(copyAttributeValueEClass, COPY_ATTRIBUTE_VALUE__SOURCE); + createEReference(copyAttributeValueEClass, COPY_ATTRIBUTE_VALUE__BASE_PROPERTY); + + autoIndexEClass = createEClass(AUTO_INDEX); + createEReference(autoIndexEClass, AUTO_INDEX__BASE_PROPERTY); + + autoIndexPerNodeEClass = createEClass(AUTO_INDEX_PER_NODE); + + initPrecedenceEClass = createEClass(INIT_PRECEDENCE); + createEReference(initPrecedenceEClass, INIT_PRECEDENCE__INVOKE_AFTER); + createEReference(initPrecedenceEClass, INIT_PRECEDENCE__INVOKE_BEFORE); + createEReference(initPrecedenceEClass, INIT_PRECEDENCE__BASE_CLASS); + + connectorConfigurationEClass = createEClass(CONNECTOR_CONFIGURATION); + createEReference(connectorConfigurationEClass, CONNECTOR_CONFIGURATION__BASE_SLOT); + createEReference(connectorConfigurationEClass, CONNECTOR_CONFIGURATION__CONNECTOR); + + bindTemplateEClass = createEClass(BIND_TEMPLATE); + createEReference(bindTemplateEClass, BIND_TEMPLATE__ACTUAL); + createEReference(bindTemplateEClass, BIND_TEMPLATE__BASE_PROPERTY); + + // Create enums + containerRuleKindEEnum = createEEnum(CONTAINER_RULE_KIND); + interceptionKindEEnum = createEEnum(INTERCEPTION_KIND); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + UMLPackage theUMLPackage = (UMLPackage)EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI); + TypesPackage theTypesPackage = (TypesPackage)EPackage.Registry.INSTANCE.getEPackage(TypesPackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + connectorEClass.getESuperTypes().add(this.getConfigurableElementInstance()); + templatePortEClass.getESuperTypes().add(this.getPort()); + portEClass.getESuperTypes().add(this.getConfigurableElementInstance()); + autoIndexPerNodeEClass.getESuperTypes().add(this.getAutoIndex()); + + // Initialize classes and features; add operations and parameters + initEClass(templateEClass, Template.class, "Template", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getTemplate_Base_Element(), theUMLPackage.getElement(), null, "base_Element", null, 1, 1, Template.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getTemplate_Helper(), this.getBindingHelper(), null, "helper", null, 0, 1, Template.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(bindingHelperEClass, BindingHelper.class, "BindingHelper", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getBindingHelper_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, BindingHelper.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(configurationPropertyEClass, ConfigurationProperty.class, "ConfigurationProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getConfigurationProperty_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 1, 1, ConfigurationProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(implementationGroupEClass, ImplementationGroup.class, "ImplementationGroup", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getImplementationGroup_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, ImplementationGroup.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(assemblyEClass, Assembly.class, "Assembly", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getAssembly_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, Assembly.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(flattenEClass, Flatten.class, "Flatten", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getFlatten_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, Flatten.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(compToOOmappingEClass, CompToOOmapping.class, "CompToOOmapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getCompToOOmapping_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, CompToOOmapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(progLanguageEClass, ProgLanguage.class, "ProgLanguage", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getProgLanguage_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, ProgLanguage.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(codeGenOptionsEClass, CodeGenOptions.class, "CodeGenOptions", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getCodeGenOptions_Base_Package(), theUMLPackage.getPackage(), null, "base_Package", null, 1, 1, CodeGenOptions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getCodeGenOptions_CompToOOmapping(), this.getCompToOOmapping(), null, "compToOOmapping", null, 1, 1, CodeGenOptions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getCodeGenOptions_ProgLanguage(), this.getProgLanguage(), null, "progLanguage", null, 1, 1, CodeGenOptions.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(interactionComponentEClass, InteractionComponent.class, "InteractionComponent", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEAttribute(getInteractionComponent_ForDistribution(), theTypesPackage.getBoolean(), "forDistribution", "false", 1, 1, InteractionComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ //$NON-NLS-2$ + initEReference(getInteractionComponent_ConnectionPattern(), theUMLPackage.getCollaboration(), null, "connectionPattern", null, 0, 1, InteractionComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getInteractionComponent_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, InteractionComponent.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(singletonEClass, Singleton.class, "Singleton", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getSingleton_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, Singleton.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(connectorEClass, Connector.class, "Connector", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getConnector_Base_Connector(), theUMLPackage.getConnector(), null, "base_Connector", null, 0, 1, Connector.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getConnector_Ic(), this.getInteractionComponent(), null, "ic", null, 0, 1, Connector.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getConnector_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 0, 1, Connector.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(configurableElementInstanceEClass, ConfigurableElementInstance.class, "ConfigurableElementInstance", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getConfigurableElementInstance_Configuration(), theUMLPackage.getInstanceSpecification(), null, "configuration", null, 0, 1, ConfigurableElementInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(useInstanceConfiguratorEClass, UseInstanceConfigurator.class, "UseInstanceConfigurator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getUseInstanceConfigurator_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, UseInstanceConfigurator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getUseInstanceConfigurator_Configurator(), this.getInstanceConfigurator(), null, "configurator", null, 1, 1, UseInstanceConfigurator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(instanceConfiguratorEClass, InstanceConfigurator.class, "InstanceConfigurator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getInstanceConfigurator_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, InstanceConfigurator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEAttribute(getInstanceConfigurator_OnNodeModel(), theTypesPackage.getBoolean(), "onNodeModel", null, 0, 1, InstanceConfigurator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(ruleApplicationEClass, RuleApplication.class, "RuleApplication", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getRuleApplication_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 0, 1, RuleApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getRuleApplication_ContainerRule(), this.getContainerRule(), null, "containerRule", null, 0, -1, RuleApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getRuleApplication_Base_Package(), theUMLPackage.getPackage(), null, "base_Package", null, 0, 1, RuleApplication.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(containerRuleEClass, ContainerRule.class, "ContainerRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getContainerRule_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, ContainerRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getContainerRule_ForConfig(), this.getConfigOption(), null, "forConfig", null, 0, -1, ContainerRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEAttribute(getContainerRule_Kind(), this.getContainerRuleKind(), "kind", null, 1, 1, ContainerRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(configOptionEClass, ConfigOption.class, "ConfigOption", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getConfigOption_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, ConfigOption.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(templatePortEClass, TemplatePort.class, "TemplatePort", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getTemplatePort_BoundType(), this.getPortKind(), null, "boundType", null, 0, 1, TemplatePort.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(portEClass, Port.class, "Port", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getPort_Base_Port(), theUMLPackage.getPort(), null, "base_Port", null, 1, 1, Port.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getPort_Kind(), this.getPortKind(), null, "kind", null, 0, 1, Port.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getPort_Type(), theUMLPackage.getType(), null, "type", null, 1, 1, Port.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(portKindEClass, PortKind.class, "PortKind", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getPortKind_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, PortKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getPortKind_ProvidedInterface(), theUMLPackage.getInterface(), null, "providedInterface", null, 0, 1, PortKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getPortKind_RequiredInterface(), theUMLPackage.getInterface(), null, "requiredInterface", null, 0, 1, PortKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEAttribute(getPortKind_ExtendedPort(), theTypesPackage.getBoolean(), "extendedPort", null, 1, 1, PortKind.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(deploymentPlanEClass, DeploymentPlan.class, "DeploymentPlan", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getDeploymentPlan_MainInstance(), theUMLPackage.getInstanceSpecification(), null, "mainInstance", null, 1, 1, DeploymentPlan.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getDeploymentPlan_Base_Package(), theUMLPackage.getPackage(), null, "base_Package", null, 1, 1, DeploymentPlan.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(derivedElementEClass, DerivedElement.class, "DerivedElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getDerivedElement_Base_Element(), theUMLPackage.getElement(), null, "base_Element", null, 1, 1, DerivedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getDerivedElement_Source(), theUMLPackage.getElement(), null, "source", null, 1, 1, DerivedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(compImplTemplateEClass, CompImplTemplate.class, "CompImplTemplate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEAttribute(getCompImplTemplate_TemplateDefs(), theTypesPackage.getString(), "templateDefs", null, 0, 1, CompImplTemplate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getCompImplTemplate_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, CompImplTemplate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(implementationPropertiesEClass, ImplementationProperties.class, "ImplementationProperties", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEAttribute(getImplementationProperties_SizeRAM(), theTypesPackage.getInteger(), "sizeRAM", null, 1, 1, ImplementationProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getImplementationProperties_SupportedOS(), this.getOperatingSystem(), null, "supportedOS", null, 0, -1, ImplementationProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getImplementationProperties_Arch(), this.getTargetArchitecture(), null, "arch", null, 0, -1, ImplementationProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getImplementationProperties_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, ImplementationProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEAttribute(getImplementationProperties_SizeROM(), theTypesPackage.getInteger(), "sizeROM", null, 1, 1, ImplementationProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getImplementationProperties_SupportedTargetArch(), this.getTargetArchitecture(), null, "supportedTargetArch", null, 1, 1, ImplementationProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(operatingSystemEClass, OperatingSystem.class, "OperatingSystem", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getOperatingSystem_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, OperatingSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(targetArchitectureEClass, TargetArchitecture.class, "TargetArchitecture", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getTargetArchitecture_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, TargetArchitecture.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(configurationEClass, Configuration.class, "Configuration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getConfiguration_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, Configuration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getConfiguration_ConfigOptions(), this.getConfigOption(), null, "configOptions", null, 0, -1, Configuration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getConfiguration_DeploymentPlan(), this.getDeploymentPlan(), null, "deploymentPlan", null, 1, 1, Configuration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(interceptionRuleEClass, InterceptionRule.class, "InterceptionRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEAttribute(getInterceptionRule_InterceptionKind(), this.getInterceptionKind(), "interceptionKind", null, 1, 1, InterceptionRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getInterceptionRule_InterceptionSet(), theUMLPackage.getFeature(), null, "interceptionSet", null, 0, -1, InterceptionRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getInterceptionRule_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 1, 1, InterceptionRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getInterceptionRule_Base_Operation(), theUMLPackage.getOperation(), null, "base_Operation", null, 1, 1, InterceptionRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(targetEClass, Target.class, "Target", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getTarget_TargetArch(), this.getTargetArchitecture(), null, "targetArch", null, 1, 1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getTarget_Options(), this.getConfigOption(), null, "options", null, 0, -1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getTarget_Base_Node(), theUMLPackage.getNode(), null, "base_Node", null, 1, 1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getTarget_UsedOS(), this.getOperatingSystem(), null, "usedOS", null, 1, 1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEAttribute(getTarget_AvailRAM(), theTypesPackage.getInteger(), "availRAM", null, 1, 1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEAttribute(getTarget_AvailROM(), theTypesPackage.getInteger(), "availROM", null, 1, 1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getTarget_Compiler(), this.getCompilerChain(), null, "compiler", null, 0, 1, Target.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(compilerChainEClass, CompilerChain.class, "CompilerChain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getCompilerChain_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, CompilerChain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(fragmentEClass, Fragment.class, "Fragment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getFragment_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, Fragment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(copyAttributeValueEClass, CopyAttributeValue.class, "CopyAttributeValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getCopyAttributeValue_Source(), theUMLPackage.getProperty(), null, "source", null, 1, 1, CopyAttributeValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getCopyAttributeValue_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 1, 1, CopyAttributeValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(autoIndexEClass, AutoIndex.class, "AutoIndex", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getAutoIndex_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 1, 1, AutoIndex.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(autoIndexPerNodeEClass, AutoIndexPerNode.class, "AutoIndexPerNode", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + + initEClass(initPrecedenceEClass, InitPrecedence.class, "InitPrecedence", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getInitPrecedence_InvokeAfter(), theUMLPackage.getClass_(), null, "invokeAfter", null, 0, -1, InitPrecedence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getInitPrecedence_InvokeBefore(), theUMLPackage.getClass_(), null, "invokeBefore", null, 0, -1, InitPrecedence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getInitPrecedence_Base_Class(), theUMLPackage.getClass_(), null, "base_Class", null, 1, 1, InitPrecedence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(connectorConfigurationEClass, ConnectorConfiguration.class, "ConnectorConfiguration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getConnectorConfiguration_Base_Slot(), theUMLPackage.getSlot(), null, "base_Slot", null, 1, 1, ConnectorConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getConnectorConfiguration_Connector(), this.getConnector(), null, "connector", null, 1, 1, ConnectorConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + initEClass(bindTemplateEClass, BindTemplate.class, "BindTemplate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getBindTemplate_Actual(), theUMLPackage.getType(), null, "actual", null, 0, -1, BindTemplate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + initEReference(getBindTemplate_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 1, 1, BindTemplate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); //$NON-NLS-1$ + + // Initialize enums and add enum literals + initEEnum(containerRuleKindEEnum, ContainerRuleKind.class, "ContainerRuleKind"); //$NON-NLS-1$ + addEEnumLiteral(containerRuleKindEEnum, ContainerRuleKind.COMPONENT_RULE); + addEEnumLiteral(containerRuleKindEEnum, ContainerRuleKind.LIGHT_WEIGHT_OO_RULE); + + initEEnum(interceptionKindEEnum, InterceptionKind.class, "InterceptionKind"); //$NON-NLS-1$ + addEEnumLiteral(interceptionKindEEnum, InterceptionKind.INTERCEPT_SOME); + addEEnumLiteral(interceptionKindEEnum, InterceptionKind.INTERCEPT_ALL); + addEEnumLiteral(interceptionKindEEnum, InterceptionKind.INTERCEPT_ALL_OUT); + addEEnumLiteral(interceptionKindEEnum, InterceptionKind.INTERCEPT_ALL_IN); + addEEnumLiteral(interceptionKindEEnum, InterceptionKind.INTERCEPT_MATCHING); + + // Create resource + createResource(eNS_URI); + } + +} // FCMPackageImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FlattenImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FlattenImpl.java new file mode 100644 index 00000000000..df03b58b1df --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FlattenImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.Flatten; + +/** + * + * An implementation of the model object 'Flatten'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.FlattenImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class FlattenImpl extends EObjectImpl implements Flatten { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected FlattenImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.FLATTEN; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.FLATTEN__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.FLATTEN__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.FLATTEN__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.FLATTEN__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.FLATTEN__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.FLATTEN__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + +} // FlattenImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FragmentImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FragmentImpl.java new file mode 100644 index 00000000000..3b0f821b496 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/FragmentImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.Fragment; + +/** + * + * An implementation of the model object 'Fragment'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.FragmentImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class FragmentImpl extends EObjectImpl implements Fragment { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected FragmentImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.FRAGMENT; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.FRAGMENT__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.FRAGMENT__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.FRAGMENT__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.FRAGMENT__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.FRAGMENT__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.FRAGMENT__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + +} // FragmentImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationGroupImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationGroupImpl.java new file mode 100644 index 00000000000..42d65ff5e31 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationGroupImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.ImplementationGroup; + +/** + * + * An implementation of the model object 'Implementation Group'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.ImplementationGroupImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class ImplementationGroupImpl extends EObjectImpl implements ImplementationGroup { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected ImplementationGroupImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.IMPLEMENTATION_GROUP; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.IMPLEMENTATION_GROUP__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.IMPLEMENTATION_GROUP__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.IMPLEMENTATION_GROUP__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.IMPLEMENTATION_GROUP__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.IMPLEMENTATION_GROUP__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.IMPLEMENTATION_GROUP__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + +} // ImplementationGroupImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationPropertiesImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationPropertiesImpl.java new file mode 100644 index 00000000000..7f86201abbf --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ImplementationPropertiesImpl.java @@ -0,0 +1,430 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.ImplementationProperties; +import org.eclipse.papyrus.FCM.OperatingSystem; +import org.eclipse.papyrus.FCM.TargetArchitecture; + +/** + * + * An implementation of the model object 'Implementation Properties'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl#getSizeRAM Size RAM}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl#getSupportedOS Supported OS}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl#getArch Arch}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl#getSizeROM Size ROM}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.ImplementationPropertiesImpl#getSupportedTargetArch Supported Target Arch}
    • + *
    + * + * @generated + */ +public class ImplementationPropertiesImpl extends EObjectImpl implements ImplementationProperties { + /** + * The default value of the '{@link #getSizeRAM() Size RAM}' attribute. + * + * + * @see #getSizeRAM() + * @generated + * @ordered + */ + protected static final int SIZE_RAM_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getSizeRAM() Size RAM}' attribute. + * + * + * @see #getSizeRAM() + * @generated + * @ordered + */ + protected int sizeRAM = SIZE_RAM_EDEFAULT; + + /** + * The cached value of the '{@link #getSupportedOS() Supported OS}' reference list. + * + * + * @see #getSupportedOS() + * @generated + * @ordered + */ + protected EList supportedOS; + + /** + * The cached value of the '{@link #getArch() Arch}' reference list. + * + * + * @see #getArch() + * @generated + * @ordered + */ + protected EList arch; + + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * The default value of the '{@link #getSizeROM() Size ROM}' attribute. + * + * + * @see #getSizeROM() + * @generated + * @ordered + */ + protected static final int SIZE_ROM_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getSizeROM() Size ROM}' attribute. + * + * + * @see #getSizeROM() + * @generated + * @ordered + */ + protected int sizeROM = SIZE_ROM_EDEFAULT; + + /** + * The cached value of the '{@link #getSupportedTargetArch() Supported Target Arch}' reference. + * + * + * @see #getSupportedTargetArch() + * @generated + * @ordered + */ + protected TargetArchitecture supportedTargetArch; + + /** + * + * + * @generated + */ + protected ImplementationPropertiesImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.IMPLEMENTATION_PROPERTIES; + } + + /** + * + * + * @generated + */ + @Override + public int getSizeRAM() { + return sizeRAM; + } + + /** + * + * + * @generated + */ + @Override + public void setSizeRAM(int newSizeRAM) { + int oldSizeRAM = sizeRAM; + sizeRAM = newSizeRAM; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_RAM, oldSizeRAM, sizeRAM)); + } + + /** + * + * + * @generated + */ + @Override + public EList getSupportedOS() { + if (supportedOS == null) { + supportedOS = new EObjectResolvingEList(OperatingSystem.class, this, FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_OS); + } + return supportedOS; + } + + /** + * + * + * @generated + */ + @Override + public EList getArch() { + if (arch == null) { + arch = new EObjectResolvingEList(TargetArchitecture.class, this, FCMPackage.IMPLEMENTATION_PROPERTIES__ARCH); + } + return arch; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.IMPLEMENTATION_PROPERTIES__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.IMPLEMENTATION_PROPERTIES__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public int getSizeROM() { + return sizeROM; + } + + /** + * + * + * @generated + */ + @Override + public void setSizeROM(int newSizeROM) { + int oldSizeROM = sizeROM; + sizeROM = newSizeROM; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_ROM, oldSizeROM, sizeROM)); + } + + /** + * + * + * @generated + */ + @Override + public TargetArchitecture getSupportedTargetArch() { + if (supportedTargetArch != null && supportedTargetArch.eIsProxy()) { + InternalEObject oldSupportedTargetArch = (InternalEObject)supportedTargetArch; + supportedTargetArch = (TargetArchitecture)eResolveProxy(oldSupportedTargetArch); + if (supportedTargetArch != oldSupportedTargetArch) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH, oldSupportedTargetArch, supportedTargetArch)); + } + } + return supportedTargetArch; + } + + /** + * + * + * @generated + */ + public TargetArchitecture basicGetSupportedTargetArch() { + return supportedTargetArch; + } + + /** + * + * + * @generated + */ + @Override + public void setSupportedTargetArch(TargetArchitecture newSupportedTargetArch) { + TargetArchitecture oldSupportedTargetArch = supportedTargetArch; + supportedTargetArch = newSupportedTargetArch; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH, oldSupportedTargetArch, supportedTargetArch)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_RAM: + return getSizeRAM(); + case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_OS: + return getSupportedOS(); + case FCMPackage.IMPLEMENTATION_PROPERTIES__ARCH: + return getArch(); + case FCMPackage.IMPLEMENTATION_PROPERTIES__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_ROM: + return getSizeROM(); + case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH: + if (resolve) return getSupportedTargetArch(); + return basicGetSupportedTargetArch(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_RAM: + setSizeRAM((Integer)newValue); + return; + case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_OS: + getSupportedOS().clear(); + getSupportedOS().addAll((Collection)newValue); + return; + case FCMPackage.IMPLEMENTATION_PROPERTIES__ARCH: + getArch().clear(); + getArch().addAll((Collection)newValue); + return; + case FCMPackage.IMPLEMENTATION_PROPERTIES__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_ROM: + setSizeROM((Integer)newValue); + return; + case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH: + setSupportedTargetArch((TargetArchitecture)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_RAM: + setSizeRAM(SIZE_RAM_EDEFAULT); + return; + case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_OS: + getSupportedOS().clear(); + return; + case FCMPackage.IMPLEMENTATION_PROPERTIES__ARCH: + getArch().clear(); + return; + case FCMPackage.IMPLEMENTATION_PROPERTIES__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_ROM: + setSizeROM(SIZE_ROM_EDEFAULT); + return; + case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH: + setSupportedTargetArch((TargetArchitecture)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_RAM: + return sizeRAM != SIZE_RAM_EDEFAULT; + case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_OS: + return supportedOS != null && !supportedOS.isEmpty(); + case FCMPackage.IMPLEMENTATION_PROPERTIES__ARCH: + return arch != null && !arch.isEmpty(); + case FCMPackage.IMPLEMENTATION_PROPERTIES__BASE_CLASS: + return base_Class != null; + case FCMPackage.IMPLEMENTATION_PROPERTIES__SIZE_ROM: + return sizeROM != SIZE_ROM_EDEFAULT; + case FCMPackage.IMPLEMENTATION_PROPERTIES__SUPPORTED_TARGET_ARCH: + return supportedTargetArch != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (sizeRAM: "); //$NON-NLS-1$ + result.append(sizeRAM); + result.append(", sizeROM: "); //$NON-NLS-1$ + result.append(sizeROM); + result.append(')'); + return result.toString(); + } + +} // ImplementationPropertiesImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InitPrecedenceImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InitPrecedenceImpl.java new file mode 100644 index 00000000000..f3912aed57b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InitPrecedenceImpl.java @@ -0,0 +1,240 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.InitPrecedence; + +/** + * + * An implementation of the model object 'Init Precedence'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl#getInvokeAfter Invoke After}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl#getInvokeBefore Invoke Before}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.InitPrecedenceImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class InitPrecedenceImpl extends EObjectImpl implements InitPrecedence { + /** + * The cached value of the '{@link #getInvokeAfter() Invoke After}' reference list. + * + * + * @see #getInvokeAfter() + * @generated + * @ordered + */ + protected EList invokeAfter; + + /** + * The cached value of the '{@link #getInvokeBefore() Invoke Before}' reference list. + * + * + * @see #getInvokeBefore() + * @generated + * @ordered + */ + protected EList invokeBefore; + + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected InitPrecedenceImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.INIT_PRECEDENCE; + } + + /** + * + * + * @generated + */ + @Override + public EList getInvokeAfter() { + if (invokeAfter == null) { + invokeAfter = new EObjectResolvingEList(org.eclipse.uml2.uml.Class.class, this, FCMPackage.INIT_PRECEDENCE__INVOKE_AFTER); + } + return invokeAfter; + } + + /** + * + * + * @generated + */ + @Override + public EList getInvokeBefore() { + if (invokeBefore == null) { + invokeBefore = new EObjectResolvingEList(org.eclipse.uml2.uml.Class.class, this, FCMPackage.INIT_PRECEDENCE__INVOKE_BEFORE); + } + return invokeBefore; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.INIT_PRECEDENCE__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INIT_PRECEDENCE__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.INIT_PRECEDENCE__INVOKE_AFTER: + return getInvokeAfter(); + case FCMPackage.INIT_PRECEDENCE__INVOKE_BEFORE: + return getInvokeBefore(); + case FCMPackage.INIT_PRECEDENCE__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.INIT_PRECEDENCE__INVOKE_AFTER: + getInvokeAfter().clear(); + getInvokeAfter().addAll((Collection)newValue); + return; + case FCMPackage.INIT_PRECEDENCE__INVOKE_BEFORE: + getInvokeBefore().clear(); + getInvokeBefore().addAll((Collection)newValue); + return; + case FCMPackage.INIT_PRECEDENCE__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.INIT_PRECEDENCE__INVOKE_AFTER: + getInvokeAfter().clear(); + return; + case FCMPackage.INIT_PRECEDENCE__INVOKE_BEFORE: + getInvokeBefore().clear(); + return; + case FCMPackage.INIT_PRECEDENCE__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.INIT_PRECEDENCE__INVOKE_AFTER: + return invokeAfter != null && !invokeAfter.isEmpty(); + case FCMPackage.INIT_PRECEDENCE__INVOKE_BEFORE: + return invokeBefore != null && !invokeBefore.isEmpty(); + case FCMPackage.INIT_PRECEDENCE__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + +} // InitPrecedenceImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InstanceConfiguratorImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InstanceConfiguratorImpl.java new file mode 100644 index 00000000000..98c39d1bb77 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InstanceConfiguratorImpl.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.InstanceConfigurator; + +/** + * + * An implementation of the model object 'Instance Configurator'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.InstanceConfiguratorImpl#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.InstanceConfiguratorImpl#isOnNodeModel On Node Model}
    • + *
    + * + * @generated + */ +public class InstanceConfiguratorImpl extends EObjectImpl implements InstanceConfigurator { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * The default value of the '{@link #isOnNodeModel() On Node Model}' attribute. + * + * + * @see #isOnNodeModel() + * @generated + * @ordered + */ + protected static final boolean ON_NODE_MODEL_EDEFAULT = false; + /** + * The cached value of the '{@link #isOnNodeModel() On Node Model}' attribute. + * + * + * @see #isOnNodeModel() + * @generated + * @ordered + */ + protected boolean onNodeModel = ON_NODE_MODEL_EDEFAULT; + + /** + * + * + * @generated + */ + protected InstanceConfiguratorImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.INSTANCE_CONFIGURATOR; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.INSTANCE_CONFIGURATOR__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INSTANCE_CONFIGURATOR__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isOnNodeModel() { + return onNodeModel; + } + + /** + * + * + * @generated + */ + @Override + public void setOnNodeModel(boolean newOnNodeModel) { + boolean oldOnNodeModel = onNodeModel; + onNodeModel = newOnNodeModel; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INSTANCE_CONFIGURATOR__ON_NODE_MODEL, oldOnNodeModel, onNodeModel)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.INSTANCE_CONFIGURATOR__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + case FCMPackage.INSTANCE_CONFIGURATOR__ON_NODE_MODEL: + return isOnNodeModel(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.INSTANCE_CONFIGURATOR__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + case FCMPackage.INSTANCE_CONFIGURATOR__ON_NODE_MODEL: + setOnNodeModel((Boolean)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.INSTANCE_CONFIGURATOR__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + case FCMPackage.INSTANCE_CONFIGURATOR__ON_NODE_MODEL: + setOnNodeModel(ON_NODE_MODEL_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.INSTANCE_CONFIGURATOR__BASE_CLASS: + return base_Class != null; + case FCMPackage.INSTANCE_CONFIGURATOR__ON_NODE_MODEL: + return onNodeModel != ON_NODE_MODEL_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (onNodeModel: "); //$NON-NLS-1$ + result.append(onNodeModel); + result.append(')'); + return result.toString(); + } + +} // InstanceConfiguratorImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InteractionComponentImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InteractionComponentImpl.java new file mode 100644 index 00000000000..eda594ff7b3 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InteractionComponentImpl.java @@ -0,0 +1,298 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.uml2.uml.Collaboration; + +/** + * + * An implementation of the model object 'Interaction Component'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.InteractionComponentImpl#isForDistribution For Distribution}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.InteractionComponentImpl#getConnectionPattern Connection Pattern}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.InteractionComponentImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class InteractionComponentImpl extends EObjectImpl implements InteractionComponent { + /** + * The default value of the '{@link #isForDistribution() For Distribution}' attribute. + * + * + * @see #isForDistribution() + * @generated + * @ordered + */ + protected static final boolean FOR_DISTRIBUTION_EDEFAULT = false; + + /** + * The cached value of the '{@link #isForDistribution() For Distribution}' attribute. + * + * + * @see #isForDistribution() + * @generated + * @ordered + */ + protected boolean forDistribution = FOR_DISTRIBUTION_EDEFAULT; + + /** + * The cached value of the '{@link #getConnectionPattern() Connection Pattern}' reference. + * + * + * @see #getConnectionPattern() + * @generated + * @ordered + */ + protected Collaboration connectionPattern; + + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected InteractionComponentImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.INTERACTION_COMPONENT; + } + + /** + * + * + * @generated + */ + @Override + public boolean isForDistribution() { + return forDistribution; + } + + /** + * + * + * @generated + */ + @Override + public void setForDistribution(boolean newForDistribution) { + boolean oldForDistribution = forDistribution; + forDistribution = newForDistribution; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INTERACTION_COMPONENT__FOR_DISTRIBUTION, oldForDistribution, forDistribution)); + } + + /** + * + * + * @generated + */ + @Override + public Collaboration getConnectionPattern() { + if (connectionPattern != null && connectionPattern.eIsProxy()) { + InternalEObject oldConnectionPattern = (InternalEObject)connectionPattern; + connectionPattern = (Collaboration)eResolveProxy(oldConnectionPattern); + if (connectionPattern != oldConnectionPattern) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.INTERACTION_COMPONENT__CONNECTION_PATTERN, oldConnectionPattern, connectionPattern)); + } + } + return connectionPattern; + } + + /** + * + * + * @generated + */ + public Collaboration basicGetConnectionPattern() { + return connectionPattern; + } + + /** + * + * + * @generated + */ + @Override + public void setConnectionPattern(Collaboration newConnectionPattern) { + Collaboration oldConnectionPattern = connectionPattern; + connectionPattern = newConnectionPattern; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INTERACTION_COMPONENT__CONNECTION_PATTERN, oldConnectionPattern, connectionPattern)); + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.INTERACTION_COMPONENT__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INTERACTION_COMPONENT__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.INTERACTION_COMPONENT__FOR_DISTRIBUTION: + return isForDistribution(); + case FCMPackage.INTERACTION_COMPONENT__CONNECTION_PATTERN: + if (resolve) return getConnectionPattern(); + return basicGetConnectionPattern(); + case FCMPackage.INTERACTION_COMPONENT__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.INTERACTION_COMPONENT__FOR_DISTRIBUTION: + setForDistribution((Boolean)newValue); + return; + case FCMPackage.INTERACTION_COMPONENT__CONNECTION_PATTERN: + setConnectionPattern((Collaboration)newValue); + return; + case FCMPackage.INTERACTION_COMPONENT__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.INTERACTION_COMPONENT__FOR_DISTRIBUTION: + setForDistribution(FOR_DISTRIBUTION_EDEFAULT); + return; + case FCMPackage.INTERACTION_COMPONENT__CONNECTION_PATTERN: + setConnectionPattern((Collaboration)null); + return; + case FCMPackage.INTERACTION_COMPONENT__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.INTERACTION_COMPONENT__FOR_DISTRIBUTION: + return forDistribution != FOR_DISTRIBUTION_EDEFAULT; + case FCMPackage.INTERACTION_COMPONENT__CONNECTION_PATTERN: + return connectionPattern != null; + case FCMPackage.INTERACTION_COMPONENT__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (forDistribution: "); //$NON-NLS-1$ + result.append(forDistribution); + result.append(')'); + return result.toString(); + } + +} // InteractionComponentImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InterceptionRuleImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InterceptionRuleImpl.java new file mode 100644 index 00000000000..5c061d96327 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/InterceptionRuleImpl.java @@ -0,0 +1,341 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.InterceptionKind; +import org.eclipse.papyrus.FCM.InterceptionRule; +import org.eclipse.uml2.uml.Feature; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Property; + +/** + * + * An implementation of the model object 'Interception Rule'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl#getInterceptionKind Interception Kind}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl#getInterceptionSet Interception Set}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl#getBase_Property Base Property}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.InterceptionRuleImpl#getBase_Operation Base Operation}
    • + *
    + * + * @generated + */ +public class InterceptionRuleImpl extends EObjectImpl implements InterceptionRule { + /** + * The default value of the '{@link #getInterceptionKind() Interception Kind}' attribute. + * + * + * @see #getInterceptionKind() + * @generated + * @ordered + */ + protected static final InterceptionKind INTERCEPTION_KIND_EDEFAULT = InterceptionKind.INTERCEPT_SOME; + + /** + * The cached value of the '{@link #getInterceptionKind() Interception Kind}' attribute. + * + * + * @see #getInterceptionKind() + * @generated + * @ordered + */ + protected InterceptionKind interceptionKind = INTERCEPTION_KIND_EDEFAULT; + + /** + * The cached value of the '{@link #getInterceptionSet() Interception Set}' reference list. + * + * + * @see #getInterceptionSet() + * @generated + * @ordered + */ + protected EList interceptionSet; + + /** + * The cached value of the '{@link #getBase_Property() Base Property}' reference. + * + * + * @see #getBase_Property() + * @generated + * @ordered + */ + protected Property base_Property; + + /** + * The cached value of the '{@link #getBase_Operation() Base Operation}' reference. + * + * + * @see #getBase_Operation() + * @generated + * @ordered + */ + protected Operation base_Operation; + + /** + * + * + * @generated + */ + protected InterceptionRuleImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.INTERCEPTION_RULE; + } + + /** + * + * + * @generated + */ + @Override + public InterceptionKind getInterceptionKind() { + return interceptionKind; + } + + /** + * + * + * @generated + */ + @Override + public void setInterceptionKind(InterceptionKind newInterceptionKind) { + InterceptionKind oldInterceptionKind = interceptionKind; + interceptionKind = newInterceptionKind == null ? INTERCEPTION_KIND_EDEFAULT : newInterceptionKind; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INTERCEPTION_RULE__INTERCEPTION_KIND, oldInterceptionKind, interceptionKind)); + } + + /** + * + * + * @generated + */ + @Override + public EList getInterceptionSet() { + if (interceptionSet == null) { + interceptionSet = new EObjectResolvingEList(Feature.class, this, FCMPackage.INTERCEPTION_RULE__INTERCEPTION_SET); + } + return interceptionSet; + } + + /** + * + * + * @generated + */ + @Override + public Property getBase_Property() { + if (base_Property != null && base_Property.eIsProxy()) { + InternalEObject oldBase_Property = (InternalEObject)base_Property; + base_Property = (Property)eResolveProxy(oldBase_Property); + if (base_Property != oldBase_Property) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.INTERCEPTION_RULE__BASE_PROPERTY, oldBase_Property, base_Property)); + } + } + return base_Property; + } + + /** + * + * + * @generated + */ + public Property basicGetBase_Property() { + return base_Property; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Property(Property newBase_Property) { + Property oldBase_Property = base_Property; + base_Property = newBase_Property; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INTERCEPTION_RULE__BASE_PROPERTY, oldBase_Property, base_Property)); + } + + /** + * + * + * @generated + */ + @Override + public Operation getBase_Operation() { + if (base_Operation != null && base_Operation.eIsProxy()) { + InternalEObject oldBase_Operation = (InternalEObject)base_Operation; + base_Operation = (Operation)eResolveProxy(oldBase_Operation); + if (base_Operation != oldBase_Operation) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.INTERCEPTION_RULE__BASE_OPERATION, oldBase_Operation, base_Operation)); + } + } + return base_Operation; + } + + /** + * + * + * @generated + */ + public Operation basicGetBase_Operation() { + return base_Operation; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Operation(Operation newBase_Operation) { + Operation oldBase_Operation = base_Operation; + base_Operation = newBase_Operation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.INTERCEPTION_RULE__BASE_OPERATION, oldBase_Operation, base_Operation)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_KIND: + return getInterceptionKind(); + case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_SET: + return getInterceptionSet(); + case FCMPackage.INTERCEPTION_RULE__BASE_PROPERTY: + if (resolve) return getBase_Property(); + return basicGetBase_Property(); + case FCMPackage.INTERCEPTION_RULE__BASE_OPERATION: + if (resolve) return getBase_Operation(); + return basicGetBase_Operation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_KIND: + setInterceptionKind((InterceptionKind)newValue); + return; + case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_SET: + getInterceptionSet().clear(); + getInterceptionSet().addAll((Collection)newValue); + return; + case FCMPackage.INTERCEPTION_RULE__BASE_PROPERTY: + setBase_Property((Property)newValue); + return; + case FCMPackage.INTERCEPTION_RULE__BASE_OPERATION: + setBase_Operation((Operation)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_KIND: + setInterceptionKind(INTERCEPTION_KIND_EDEFAULT); + return; + case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_SET: + getInterceptionSet().clear(); + return; + case FCMPackage.INTERCEPTION_RULE__BASE_PROPERTY: + setBase_Property((Property)null); + return; + case FCMPackage.INTERCEPTION_RULE__BASE_OPERATION: + setBase_Operation((Operation)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_KIND: + return interceptionKind != INTERCEPTION_KIND_EDEFAULT; + case FCMPackage.INTERCEPTION_RULE__INTERCEPTION_SET: + return interceptionSet != null && !interceptionSet.isEmpty(); + case FCMPackage.INTERCEPTION_RULE__BASE_PROPERTY: + return base_Property != null; + case FCMPackage.INTERCEPTION_RULE__BASE_OPERATION: + return base_Operation != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (interceptionKind: "); //$NON-NLS-1$ + result.append(interceptionKind); + result.append(')'); + return result.toString(); + } + +} // InterceptionRuleImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/OperatingSystemImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/OperatingSystemImpl.java new file mode 100644 index 00000000000..f102dd9fd32 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/OperatingSystemImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.OperatingSystem; + +/** + * + * An implementation of the model object 'Operating System'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.OperatingSystemImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class OperatingSystemImpl extends EObjectImpl implements OperatingSystem { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected OperatingSystemImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.OPERATING_SYSTEM; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.OPERATING_SYSTEM__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.OPERATING_SYSTEM__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.OPERATING_SYSTEM__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.OPERATING_SYSTEM__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.OPERATING_SYSTEM__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.OPERATING_SYSTEM__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + +} // OperatingSystemImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortImpl.java new file mode 100644 index 00000000000..474cdf56684 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortImpl.java @@ -0,0 +1,334 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.PortKind; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Image; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Stereotype; +import org.eclipse.uml2.uml.Type; + +/** + * + * An implementation of the model object 'Port'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.PortImpl#getBase_Port Base Port}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.PortImpl#getKind Kind}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.PortImpl#getType Type}
    • + *
    + * + * @generated + */ +public class PortImpl extends ConfigurableElementInstanceImpl implements Port { + + /** + * The cached value of the '{@link #getBase_Port() Base Port}' reference. + * + * + * @see #getBase_Port() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Port base_Port; + + /** + * The cached value of the '{@link #getKind() Kind}' reference. + * + * + * @see #getKind() + * @generated + * @ordered + */ + protected PortKind kind; + + /** + * The cached value of the '{@link #getType() Type}' reference. + * + * + * @see #getType() + * @generated + * @ordered + */ + protected Type type; + + /** + * + * + * @generated + */ + protected PortImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.PORT; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Port getBase_Port() { + if (base_Port != null && base_Port.eIsProxy()) { + InternalEObject oldBase_Port = (InternalEObject)base_Port; + base_Port = (org.eclipse.uml2.uml.Port)eResolveProxy(oldBase_Port); + if (base_Port != oldBase_Port) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PORT__BASE_PORT, oldBase_Port, base_Port)); + } + } + return base_Port; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Port basicGetBase_Port() { + return base_Port; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Port(org.eclipse.uml2.uml.Port newBase_Port) { + org.eclipse.uml2.uml.Port oldBase_Port = base_Port; + base_Port = newBase_Port; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PORT__BASE_PORT, oldBase_Port, base_Port)); + } + + /** + * + * + * @generated + */ + @Override + public PortKind getKind() { + if (kind != null && kind.eIsProxy()) { + InternalEObject oldKind = (InternalEObject)kind; + kind = (PortKind)eResolveProxy(oldKind); + if (kind != oldKind) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PORT__KIND, oldKind, kind)); + } + } + return kind; + } + + /** + * + * + * @generated + */ + public PortKind basicGetKind() { + return kind; + } + + /** + * + * + * @generated + */ + @Override + public void setKind(PortKind newKind) { + PortKind oldKind = kind; + kind = newKind; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PORT__KIND, oldKind, kind)); + } + + /** + * + * + * @generated + */ + public Type getType() { + if (type != null && type.eIsProxy()) { + InternalEObject oldType = (InternalEObject)type; + type = (Type)eResolveProxy(oldType); + if (type != oldType) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PORT__TYPE, oldType, type)); + } + } + return type; + } + + /** + * + * + * @generated + */ + public Type basicGetType() { + return type; + } + + /** + * + * + * @generated + */ + public void setType(Type newType) { + Type oldType = type; + type = newType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PORT__TYPE, oldType, type)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.PORT__BASE_PORT: + if (resolve) return getBase_Port(); + return basicGetBase_Port(); + case FCMPackage.PORT__KIND: + if (resolve) return getKind(); + return basicGetKind(); + case FCMPackage.PORT__TYPE: + if (resolve) return getType(); + return basicGetType(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.PORT__BASE_PORT: + setBase_Port((org.eclipse.uml2.uml.Port)newValue); + return; + case FCMPackage.PORT__KIND: + setKind((PortKind)newValue); + return; + case FCMPackage.PORT__TYPE: + setType((Type)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.PORT__BASE_PORT: + setBase_Port((org.eclipse.uml2.uml.Port)null); + return; + case FCMPackage.PORT__KIND: + setKind((PortKind)null); + return; + case FCMPackage.PORT__TYPE: + setType((Type)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.PORT__BASE_PORT: + return base_Port != null; + case FCMPackage.PORT__KIND: + return kind != null; + case FCMPackage.PORT__TYPE: + return type != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * * @generated NOT + */ + static EList emptyList = new BasicEList(); + + /** + * @return icon (serialized in port kind) + * @generated NOT + */ + public Image getIcon() + { + if (getKind() != null) { + Class clazz = getKind().getBase_Class(); + + if (clazz instanceof Stereotype) { + EList icons = ((Stereotype) clazz).getIcons(); + if (base_Port.isConjugated()) { + if (icons.size() > 1) { + // standard position for conjugated icon + return icons.get(1); + } + } + else { + if (icons.size() > 0) { + return icons.get(0); + } + } + } + } + return null; + } + + @Override + public void update() { + MapUtil.update(this); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortKindImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortKindImpl.java new file mode 100644 index 00000000000..eb480f3a3fc --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/PortKindImpl.java @@ -0,0 +1,351 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.PortKind; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Image; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Stereotype; + +/** + * + * An implementation of the model object 'Port Kind'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.PortKindImpl#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.PortKindImpl#getProvidedInterface Provided Interface}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.PortKindImpl#getRequiredInterface Required Interface}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.PortKindImpl#isExtendedPort Extended Port}
    • + *
    + * + * @generated + */ +public class PortKindImpl extends EObjectImpl implements PortKind { + + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * The cached value of the '{@link #getProvidedInterface() Provided Interface}' reference. + * + * + * @see #getProvidedInterface() + * @generated + * @ordered + */ + protected Interface providedInterface; + + /** + * The cached value of the '{@link #getRequiredInterface() Required Interface}' reference. + * + * + * @see #getRequiredInterface() + * @generated + * @ordered + */ + protected Interface requiredInterface; + + /** + * The default value of the '{@link #isExtendedPort() Extended Port}' attribute. + * + * + * @see #isExtendedPort() + * @generated + * @ordered + */ + protected static final boolean EXTENDED_PORT_EDEFAULT = false; + + /** + * + * + * @generated + */ + protected PortKindImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.PORT_KIND; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PORT_KIND__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PORT_KIND__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Interface getProvidedInterface() { + if (providedInterface != null && providedInterface.eIsProxy()) { + InternalEObject oldProvidedInterface = (InternalEObject)providedInterface; + providedInterface = (Interface)eResolveProxy(oldProvidedInterface); + if (providedInterface != oldProvidedInterface) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PORT_KIND__PROVIDED_INTERFACE, oldProvidedInterface, providedInterface)); + } + } + return providedInterface; + } + + /** + * + * + * @generated + */ + public Interface basicGetProvidedInterface() { + return providedInterface; + } + + /** + * + * + * @generated + */ + @Override + public void setProvidedInterface(Interface newProvidedInterface) { + Interface oldProvidedInterface = providedInterface; + providedInterface = newProvidedInterface; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PORT_KIND__PROVIDED_INTERFACE, oldProvidedInterface, providedInterface)); + } + + /** + * + * + * @generated + */ + @Override + public Interface getRequiredInterface() { + if (requiredInterface != null && requiredInterface.eIsProxy()) { + InternalEObject oldRequiredInterface = (InternalEObject)requiredInterface; + requiredInterface = (Interface)eResolveProxy(oldRequiredInterface); + if (requiredInterface != oldRequiredInterface) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PORT_KIND__REQUIRED_INTERFACE, oldRequiredInterface, requiredInterface)); + } + } + return requiredInterface; + } + + /** + * + * + * @generated + */ + public Interface basicGetRequiredInterface() { + return requiredInterface; + } + + /** + * + * + * @generated + */ + @Override + public void setRequiredInterface(Interface newRequiredInterface) { + Interface oldRequiredInterface = requiredInterface; + requiredInterface = newRequiredInterface; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PORT_KIND__REQUIRED_INTERFACE, oldRequiredInterface, requiredInterface)); + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isExtendedPort() { + if (getBase_Class() != null) { + return getBase_Class().getOwnedPorts().size() > 0; + } + return false; + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isSetExtendedPort() { + return true; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.PORT_KIND__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + case FCMPackage.PORT_KIND__PROVIDED_INTERFACE: + if (resolve) return getProvidedInterface(); + return basicGetProvidedInterface(); + case FCMPackage.PORT_KIND__REQUIRED_INTERFACE: + if (resolve) return getRequiredInterface(); + return basicGetRequiredInterface(); + case FCMPackage.PORT_KIND__EXTENDED_PORT: + return isExtendedPort(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.PORT_KIND__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + case FCMPackage.PORT_KIND__PROVIDED_INTERFACE: + setProvidedInterface((Interface)newValue); + return; + case FCMPackage.PORT_KIND__REQUIRED_INTERFACE: + setRequiredInterface((Interface)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.PORT_KIND__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + case FCMPackage.PORT_KIND__PROVIDED_INTERFACE: + setProvidedInterface((Interface)null); + return; + case FCMPackage.PORT_KIND__REQUIRED_INTERFACE: + setRequiredInterface((Interface)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.PORT_KIND__BASE_CLASS: + return base_Class != null; + case FCMPackage.PORT_KIND__PROVIDED_INTERFACE: + return providedInterface != null; + case FCMPackage.PORT_KIND__REQUIRED_INTERFACE: + return requiredInterface != null; + case FCMPackage.PORT_KIND__EXTENDED_PORT: + return isSetExtendedPort(); + } + return super.eIsSet(featureID); + } + + /** + * @return icon (serialized in port kind) + * @generated NOT + */ + public Image getIcon() + { + Class clazz = getBase_Class(); + + if (clazz instanceof Stereotype) { + EList icons = ((Stereotype) clazz).getIcons(); + if (icons.size() > 0) { + return icons.get(0); + } + } + return null; + } +} // PortKindImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ProgLanguageImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ProgLanguageImpl.java new file mode 100644 index 00000000000..367900b37a8 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/ProgLanguageImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.ProgLanguage; + +/** + * + * An implementation of the model object 'Prog Language'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.ProgLanguageImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class ProgLanguageImpl extends EObjectImpl implements ProgLanguage { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected ProgLanguageImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.PROG_LANGUAGE; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.PROG_LANGUAGE__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.PROG_LANGUAGE__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.PROG_LANGUAGE__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.PROG_LANGUAGE__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.PROG_LANGUAGE__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.PROG_LANGUAGE__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + +} // ProgLanguageImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/RuleApplicationImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/RuleApplicationImpl.java new file mode 100644 index 00000000000..8e9183bee71 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/RuleApplicationImpl.java @@ -0,0 +1,268 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.RuleApplication; + +/** + * + * An implementation of the model object 'Rule Application'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.RuleApplicationImpl#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.RuleApplicationImpl#getContainerRule Container Rule}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.RuleApplicationImpl#getBase_Package Base Package}
    • + *
    + * + * @generated + */ +public class RuleApplicationImpl extends EObjectImpl implements RuleApplication { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * The cached value of the '{@link #getContainerRule() Container Rule}' reference list. + * + * + * @see #getContainerRule() + * @generated + * @ordered + */ + protected EList containerRule; + + /** + * The cached value of the '{@link #getBase_Package() Base Package}' reference. + * + * + * @see #getBase_Package() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Package base_Package; + + /** + * + * + * @generated + */ + protected RuleApplicationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.RULE_APPLICATION; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.RULE_APPLICATION__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.RULE_APPLICATION__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public EList getContainerRule() { + if (containerRule == null) { + containerRule = new EObjectResolvingEList(ContainerRule.class, this, FCMPackage.RULE_APPLICATION__CONTAINER_RULE); + } + return containerRule; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Package getBase_Package() { + if (base_Package != null && base_Package.eIsProxy()) { + InternalEObject oldBase_Package = (InternalEObject)base_Package; + base_Package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_Package); + if (base_Package != oldBase_Package) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.RULE_APPLICATION__BASE_PACKAGE, oldBase_Package, base_Package)); + } + } + return base_Package; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Package basicGetBase_Package() { + return base_Package; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) { + org.eclipse.uml2.uml.Package oldBase_Package = base_Package; + base_Package = newBase_Package; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.RULE_APPLICATION__BASE_PACKAGE, oldBase_Package, base_Package)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.RULE_APPLICATION__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + case FCMPackage.RULE_APPLICATION__CONTAINER_RULE: + return getContainerRule(); + case FCMPackage.RULE_APPLICATION__BASE_PACKAGE: + if (resolve) return getBase_Package(); + return basicGetBase_Package(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.RULE_APPLICATION__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + case FCMPackage.RULE_APPLICATION__CONTAINER_RULE: + getContainerRule().clear(); + getContainerRule().addAll((Collection)newValue); + return; + case FCMPackage.RULE_APPLICATION__BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.RULE_APPLICATION__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + case FCMPackage.RULE_APPLICATION__CONTAINER_RULE: + getContainerRule().clear(); + return; + case FCMPackage.RULE_APPLICATION__BASE_PACKAGE: + setBase_Package((org.eclipse.uml2.uml.Package)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.RULE_APPLICATION__BASE_CLASS: + return base_Class != null; + case FCMPackage.RULE_APPLICATION__CONTAINER_RULE: + return containerRule != null && !containerRule.isEmpty(); + case FCMPackage.RULE_APPLICATION__BASE_PACKAGE: + return base_Package != null; + } + return super.eIsSet(featureID); + } + +} // RuleApplicationImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/SingletonImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/SingletonImpl.java new file mode 100644 index 00000000000..80a515a8d12 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/SingletonImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.Singleton; + +/** + * + * An implementation of the model object 'Singleton'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.SingletonImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class SingletonImpl extends EObjectImpl implements Singleton { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected SingletonImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.SINGLETON; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.SINGLETON__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.SINGLETON__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.SINGLETON__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.SINGLETON__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.SINGLETON__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.SINGLETON__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + +} // SingletonImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetArchitectureImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetArchitectureImpl.java new file mode 100644 index 00000000000..5af10b34478 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetArchitectureImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.TargetArchitecture; + +/** + * + * An implementation of the model object 'Target Architecture'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.TargetArchitectureImpl#getBase_Class Base Class}
    • + *
    + * + * @generated + */ +public class TargetArchitectureImpl extends EObjectImpl implements TargetArchitecture { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * + * + * @generated + */ + protected TargetArchitectureImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.TARGET_ARCHITECTURE; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TARGET_ARCHITECTURE__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET_ARCHITECTURE__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.TARGET_ARCHITECTURE__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.TARGET_ARCHITECTURE__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.TARGET_ARCHITECTURE__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.TARGET_ARCHITECTURE__BASE_CLASS: + return base_Class != null; + } + return super.eIsSet(featureID); + } + +} // TargetArchitectureImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetImpl.java new file mode 100644 index 00000000000..512c44b434d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TargetImpl.java @@ -0,0 +1,522 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.papyrus.FCM.CompilerChain; +import org.eclipse.papyrus.FCM.ConfigOption; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.OperatingSystem; +import org.eclipse.papyrus.FCM.Target; +import org.eclipse.papyrus.FCM.TargetArchitecture; +import org.eclipse.uml2.uml.Node; + +/** + * + * An implementation of the model object 'Target'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getTargetArch Target Arch}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getOptions Options}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getBase_Node Base Node}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getUsedOS Used OS}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getAvailRAM Avail RAM}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getAvailROM Avail ROM}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.TargetImpl#getCompiler Compiler}
    • + *
    + * + * @generated + */ +public class TargetImpl extends EObjectImpl implements Target { + /** + * The cached value of the '{@link #getTargetArch() Target Arch}' reference. + * + * + * @see #getTargetArch() + * @generated + * @ordered + */ + protected TargetArchitecture targetArch; + + /** + * The cached value of the '{@link #getOptions() Options}' reference list. + * + * + * @see #getOptions() + * @generated + * @ordered + */ + protected EList options; + + /** + * The cached value of the '{@link #getBase_Node() Base Node}' reference. + * + * + * @see #getBase_Node() + * @generated + * @ordered + */ + protected Node base_Node; + + /** + * The cached value of the '{@link #getUsedOS() Used OS}' reference. + * + * + * @see #getUsedOS() + * @generated + * @ordered + */ + protected OperatingSystem usedOS; + + /** + * The default value of the '{@link #getAvailRAM() Avail RAM}' attribute. + * + * + * @see #getAvailRAM() + * @generated + * @ordered + */ + protected static final int AVAIL_RAM_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getAvailRAM() Avail RAM}' attribute. + * + * + * @see #getAvailRAM() + * @generated + * @ordered + */ + protected int availRAM = AVAIL_RAM_EDEFAULT; + + /** + * The default value of the '{@link #getAvailROM() Avail ROM}' attribute. + * + * + * @see #getAvailROM() + * @generated + * @ordered + */ + protected static final int AVAIL_ROM_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getAvailROM() Avail ROM}' attribute. + * + * + * @see #getAvailROM() + * @generated + * @ordered + */ + protected int availROM = AVAIL_ROM_EDEFAULT; + + /** + * The cached value of the '{@link #getCompiler() Compiler}' reference. + * + * + * @see #getCompiler() + * @generated + * @ordered + */ + protected CompilerChain compiler; + + /** + * + * + * @generated + */ + protected TargetImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.TARGET; + } + + /** + * + * + * @generated + */ + @Override + public TargetArchitecture getTargetArch() { + if (targetArch != null && targetArch.eIsProxy()) { + InternalEObject oldTargetArch = (InternalEObject)targetArch; + targetArch = (TargetArchitecture)eResolveProxy(oldTargetArch); + if (targetArch != oldTargetArch) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TARGET__TARGET_ARCH, oldTargetArch, targetArch)); + } + } + return targetArch; + } + + /** + * + * + * @generated + */ + public TargetArchitecture basicGetTargetArch() { + return targetArch; + } + + /** + * + * + * @generated + */ + @Override + public void setTargetArch(TargetArchitecture newTargetArch) { + TargetArchitecture oldTargetArch = targetArch; + targetArch = newTargetArch; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET__TARGET_ARCH, oldTargetArch, targetArch)); + } + + /** + * + * + * @generated + */ + @Override + public EList getOptions() { + if (options == null) { + options = new EObjectResolvingEList(ConfigOption.class, this, FCMPackage.TARGET__OPTIONS); + } + return options; + } + + /** + * + * + * @generated + */ + @Override + public Node getBase_Node() { + if (base_Node != null && base_Node.eIsProxy()) { + InternalEObject oldBase_Node = (InternalEObject)base_Node; + base_Node = (Node)eResolveProxy(oldBase_Node); + if (base_Node != oldBase_Node) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TARGET__BASE_NODE, oldBase_Node, base_Node)); + } + } + return base_Node; + } + + /** + * + * + * @generated + */ + public Node basicGetBase_Node() { + return base_Node; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Node(Node newBase_Node) { + Node oldBase_Node = base_Node; + base_Node = newBase_Node; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET__BASE_NODE, oldBase_Node, base_Node)); + } + + /** + * + * + * @generated + */ + @Override + public OperatingSystem getUsedOS() { + if (usedOS != null && usedOS.eIsProxy()) { + InternalEObject oldUsedOS = (InternalEObject)usedOS; + usedOS = (OperatingSystem)eResolveProxy(oldUsedOS); + if (usedOS != oldUsedOS) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TARGET__USED_OS, oldUsedOS, usedOS)); + } + } + return usedOS; + } + + /** + * + * + * @generated + */ + public OperatingSystem basicGetUsedOS() { + return usedOS; + } + + /** + * + * + * @generated + */ + @Override + public void setUsedOS(OperatingSystem newUsedOS) { + OperatingSystem oldUsedOS = usedOS; + usedOS = newUsedOS; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET__USED_OS, oldUsedOS, usedOS)); + } + + /** + * + * + * @generated + */ + @Override + public int getAvailRAM() { + return availRAM; + } + + /** + * + * + * @generated + */ + @Override + public void setAvailRAM(int newAvailRAM) { + int oldAvailRAM = availRAM; + availRAM = newAvailRAM; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET__AVAIL_RAM, oldAvailRAM, availRAM)); + } + + /** + * + * + * @generated + */ + @Override + public int getAvailROM() { + return availROM; + } + + /** + * + * + * @generated + */ + @Override + public void setAvailROM(int newAvailROM) { + int oldAvailROM = availROM; + availROM = newAvailROM; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET__AVAIL_ROM, oldAvailROM, availROM)); + } + + /** + * + * + * @generated + */ + @Override + public CompilerChain getCompiler() { + if (compiler != null && compiler.eIsProxy()) { + InternalEObject oldCompiler = (InternalEObject)compiler; + compiler = (CompilerChain)eResolveProxy(oldCompiler); + if (compiler != oldCompiler) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TARGET__COMPILER, oldCompiler, compiler)); + } + } + return compiler; + } + + /** + * + * + * @generated + */ + public CompilerChain basicGetCompiler() { + return compiler; + } + + /** + * + * + * @generated + */ + @Override + public void setCompiler(CompilerChain newCompiler) { + CompilerChain oldCompiler = compiler; + compiler = newCompiler; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TARGET__COMPILER, oldCompiler, compiler)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.TARGET__TARGET_ARCH: + if (resolve) return getTargetArch(); + return basicGetTargetArch(); + case FCMPackage.TARGET__OPTIONS: + return getOptions(); + case FCMPackage.TARGET__BASE_NODE: + if (resolve) return getBase_Node(); + return basicGetBase_Node(); + case FCMPackage.TARGET__USED_OS: + if (resolve) return getUsedOS(); + return basicGetUsedOS(); + case FCMPackage.TARGET__AVAIL_RAM: + return getAvailRAM(); + case FCMPackage.TARGET__AVAIL_ROM: + return getAvailROM(); + case FCMPackage.TARGET__COMPILER: + if (resolve) return getCompiler(); + return basicGetCompiler(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.TARGET__TARGET_ARCH: + setTargetArch((TargetArchitecture)newValue); + return; + case FCMPackage.TARGET__OPTIONS: + getOptions().clear(); + getOptions().addAll((Collection)newValue); + return; + case FCMPackage.TARGET__BASE_NODE: + setBase_Node((Node)newValue); + return; + case FCMPackage.TARGET__USED_OS: + setUsedOS((OperatingSystem)newValue); + return; + case FCMPackage.TARGET__AVAIL_RAM: + setAvailRAM((Integer)newValue); + return; + case FCMPackage.TARGET__AVAIL_ROM: + setAvailROM((Integer)newValue); + return; + case FCMPackage.TARGET__COMPILER: + setCompiler((CompilerChain)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.TARGET__TARGET_ARCH: + setTargetArch((TargetArchitecture)null); + return; + case FCMPackage.TARGET__OPTIONS: + getOptions().clear(); + return; + case FCMPackage.TARGET__BASE_NODE: + setBase_Node((Node)null); + return; + case FCMPackage.TARGET__USED_OS: + setUsedOS((OperatingSystem)null); + return; + case FCMPackage.TARGET__AVAIL_RAM: + setAvailRAM(AVAIL_RAM_EDEFAULT); + return; + case FCMPackage.TARGET__AVAIL_ROM: + setAvailROM(AVAIL_ROM_EDEFAULT); + return; + case FCMPackage.TARGET__COMPILER: + setCompiler((CompilerChain)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.TARGET__TARGET_ARCH: + return targetArch != null; + case FCMPackage.TARGET__OPTIONS: + return options != null && !options.isEmpty(); + case FCMPackage.TARGET__BASE_NODE: + return base_Node != null; + case FCMPackage.TARGET__USED_OS: + return usedOS != null; + case FCMPackage.TARGET__AVAIL_RAM: + return availRAM != AVAIL_RAM_EDEFAULT; + case FCMPackage.TARGET__AVAIL_ROM: + return availROM != AVAIL_ROM_EDEFAULT; + case FCMPackage.TARGET__COMPILER: + return compiler != null; + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (availRAM: "); //$NON-NLS-1$ + result.append(availRAM); + result.append(", availROM: "); //$NON-NLS-1$ + result.append(availROM); + result.append(')'); + return result.toString(); + } + +} // TargetImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplateImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplateImpl.java new file mode 100644 index 00000000000..9bae3f5d98c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplateImpl.java @@ -0,0 +1,229 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.BindingHelper; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.Template; +import org.eclipse.uml2.uml.Element; + +/** + * + * An implementation of the model object 'Template'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.TemplateImpl#getBase_Element Base Element}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.TemplateImpl#getHelper Helper}
    • + *
    + * + * @generated + */ +public class TemplateImpl extends EObjectImpl implements Template { + /** + * The cached value of the '{@link #getBase_Element() Base Element}' reference. + * + * + * @see #getBase_Element() + * @generated + * @ordered + */ + protected Element base_Element; + + /** + * The cached value of the '{@link #getHelper() Helper}' reference. + * + * + * @see #getHelper() + * @generated + * @ordered + */ + protected BindingHelper helper; + + /** + * + * + * @generated + */ + protected TemplateImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.TEMPLATE; + } + + /** + * + * + * @generated + */ + @Override + public Element getBase_Element() { + if (base_Element != null && base_Element.eIsProxy()) { + InternalEObject oldBase_Element = (InternalEObject)base_Element; + base_Element = (Element)eResolveProxy(oldBase_Element); + if (base_Element != oldBase_Element) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TEMPLATE__BASE_ELEMENT, oldBase_Element, base_Element)); + } + } + return base_Element; + } + + /** + * + * + * @generated + */ + public Element basicGetBase_Element() { + return base_Element; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Element(Element newBase_Element) { + Element oldBase_Element = base_Element; + base_Element = newBase_Element; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TEMPLATE__BASE_ELEMENT, oldBase_Element, base_Element)); + } + + /** + * + * + * @generated + */ + @Override + public BindingHelper getHelper() { + if (helper != null && helper.eIsProxy()) { + InternalEObject oldHelper = (InternalEObject)helper; + helper = (BindingHelper)eResolveProxy(oldHelper); + if (helper != oldHelper) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.TEMPLATE__HELPER, oldHelper, helper)); + } + } + return helper; + } + + /** + * + * + * @generated + */ + public BindingHelper basicGetHelper() { + return helper; + } + + /** + * + * + * @generated + */ + @Override + public void setHelper(BindingHelper newHelper) { + BindingHelper oldHelper = helper; + helper = newHelper; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.TEMPLATE__HELPER, oldHelper, helper)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.TEMPLATE__BASE_ELEMENT: + if (resolve) return getBase_Element(); + return basicGetBase_Element(); + case FCMPackage.TEMPLATE__HELPER: + if (resolve) return getHelper(); + return basicGetHelper(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.TEMPLATE__BASE_ELEMENT: + setBase_Element((Element)newValue); + return; + case FCMPackage.TEMPLATE__HELPER: + setHelper((BindingHelper)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.TEMPLATE__BASE_ELEMENT: + setBase_Element((Element)null); + return; + case FCMPackage.TEMPLATE__HELPER: + setHelper((BindingHelper)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.TEMPLATE__BASE_ELEMENT: + return base_Element != null; + case FCMPackage.TEMPLATE__HELPER: + return helper != null; + } + return super.eIsSet(featureID); + } + +} // TemplateImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplatePortImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplatePortImpl.java new file mode 100644 index 00000000000..60fcc261168 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/TemplatePortImpl.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.PortKind; +import org.eclipse.papyrus.FCM.TemplatePort; +import org.eclipse.papyrus.FCM.util.MapUtil; + +/** + * + * An implementation of the model object 'Template Port'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.TemplatePortImpl#getBoundType Bound Type}
    • + *
    + * + * @generated + */ +public class TemplatePortImpl extends PortImpl implements TemplatePort { + /** + * + * + * @generated + */ + protected TemplatePortImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.TEMPLATE_PORT; + } + + /** + * + * + * @generated + */ + @Override + public PortKind getBoundType() { + PortKind boundType = basicGetBoundType(); + return boundType != null && boundType.eIsProxy() ? (PortKind)eResolveProxy((InternalEObject)boundType) : boundType; + } + + /** + * + * + * + * @generated NOT + */ + public PortKind basicGetBoundType() { + if(base_Port == null) { + return null; + } + if(base_Port.isConjugated()) { + return MapUtil.getBoundType(this); + } + else { + return MapUtil.getBoundType(this); + } + + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void setBoundType(PortKind newBoundType) { + // TODO: implement this method to set the 'Bound Type' reference + // Ensure that you remove @generated or mark it @generated NOT + } + + /** + * + * + * + * @generated NOT + */ + @Override + public void unsetBoundType() { + // TODO: implement this method to unset the 'Bound Type' reference + // Ensure that you remove @generated or mark it @generated NOT + } + + /** + * + * + * + * @generated NOT + */ + @Override + public boolean isSetBoundType() { + // TODO: implement this method to return whether the 'Bound Type' reference is set + // Ensure that you remove @generated or mark it @generated NOT + return false; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.TEMPLATE_PORT__BOUND_TYPE: + if (resolve) return getBoundType(); + return basicGetBoundType(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.TEMPLATE_PORT__BOUND_TYPE: + setBoundType((PortKind)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.TEMPLATE_PORT__BOUND_TYPE: + unsetBoundType(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.TEMPLATE_PORT__BOUND_TYPE: + return isSetBoundType(); + } + return super.eIsSet(featureID); + } + +} // TemplatePortImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/UseInstanceConfiguratorImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/UseInstanceConfiguratorImpl.java new file mode 100644 index 00000000000..21b2bcece52 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/impl/UseInstanceConfiguratorImpl.java @@ -0,0 +1,228 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.InstanceConfigurator; +import org.eclipse.papyrus.FCM.UseInstanceConfigurator; + +/** + * + * An implementation of the model object 'Use Instance Configurator'. + * + *

    + * The following features are implemented: + *

    + *
      + *
    • {@link org.eclipse.papyrus.FCM.impl.UseInstanceConfiguratorImpl#getBase_Class Base Class}
    • + *
    • {@link org.eclipse.papyrus.FCM.impl.UseInstanceConfiguratorImpl#getConfigurator Configurator}
    • + *
    + * + * @generated + */ +public class UseInstanceConfiguratorImpl extends EObjectImpl implements UseInstanceConfigurator { + /** + * The cached value of the '{@link #getBase_Class() Base Class}' reference. + * + * + * @see #getBase_Class() + * @generated + * @ordered + */ + protected org.eclipse.uml2.uml.Class base_Class; + + /** + * The cached value of the '{@link #getConfigurator() Configurator}' reference. + * + * + * @see #getConfigurator() + * @generated + * @ordered + */ + protected InstanceConfigurator configurator; + + /** + * + * + * @generated + */ + protected UseInstanceConfiguratorImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return FCMPackage.Literals.USE_INSTANCE_CONFIGURATOR; + } + + /** + * + * + * @generated + */ + @Override + public org.eclipse.uml2.uml.Class getBase_Class() { + if (base_Class != null && base_Class.eIsProxy()) { + InternalEObject oldBase_Class = (InternalEObject)base_Class; + base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class); + if (base_Class != oldBase_Class) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.USE_INSTANCE_CONFIGURATOR__BASE_CLASS, oldBase_Class, base_Class)); + } + } + return base_Class; + } + + /** + * + * + * @generated + */ + public org.eclipse.uml2.uml.Class basicGetBase_Class() { + return base_Class; + } + + /** + * + * + * @generated + */ + @Override + public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) { + org.eclipse.uml2.uml.Class oldBase_Class = base_Class; + base_Class = newBase_Class; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.USE_INSTANCE_CONFIGURATOR__BASE_CLASS, oldBase_Class, base_Class)); + } + + /** + * + * + * @generated + */ + @Override + public InstanceConfigurator getConfigurator() { + if (configurator != null && configurator.eIsProxy()) { + InternalEObject oldConfigurator = (InternalEObject)configurator; + configurator = (InstanceConfigurator)eResolveProxy(oldConfigurator); + if (configurator != oldConfigurator) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, FCMPackage.USE_INSTANCE_CONFIGURATOR__CONFIGURATOR, oldConfigurator, configurator)); + } + } + return configurator; + } + + /** + * + * + * @generated + */ + public InstanceConfigurator basicGetConfigurator() { + return configurator; + } + + /** + * + * + * @generated + */ + @Override + public void setConfigurator(InstanceConfigurator newConfigurator) { + InstanceConfigurator oldConfigurator = configurator; + configurator = newConfigurator; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, FCMPackage.USE_INSTANCE_CONFIGURATOR__CONFIGURATOR, oldConfigurator, configurator)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case FCMPackage.USE_INSTANCE_CONFIGURATOR__BASE_CLASS: + if (resolve) return getBase_Class(); + return basicGetBase_Class(); + case FCMPackage.USE_INSTANCE_CONFIGURATOR__CONFIGURATOR: + if (resolve) return getConfigurator(); + return basicGetConfigurator(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case FCMPackage.USE_INSTANCE_CONFIGURATOR__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)newValue); + return; + case FCMPackage.USE_INSTANCE_CONFIGURATOR__CONFIGURATOR: + setConfigurator((InstanceConfigurator)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case FCMPackage.USE_INSTANCE_CONFIGURATOR__BASE_CLASS: + setBase_Class((org.eclipse.uml2.uml.Class)null); + return; + case FCMPackage.USE_INSTANCE_CONFIGURATOR__CONFIGURATOR: + setConfigurator((InstanceConfigurator)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case FCMPackage.USE_INSTANCE_CONFIGURATOR__BASE_CLASS: + return base_Class != null; + case FCMPackage.USE_INSTANCE_CONFIGURATOR__CONFIGURATOR: + return configurator != null; + } + return super.eIsSet(featureID); + } + +} // UseInstanceConfiguratorImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ConnectorTypeUtil.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ConnectorTypeUtil.java new file mode 100644 index 00000000000..919a7fcbff1 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ConnectorTypeUtil.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ + +package org.eclipse.papyrus.FCM.util; + +import java.util.ArrayList; + +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.uml2.uml.Collaboration; + +public class ConnectorTypeUtil { + + protected Collaboration connectionPattern = null; + + protected InteractionComponent connectorComp = null; + + protected FCMUtil.RoleBindingTable bindingTable = null; + + public FCMUtil.RoleBindingTable getRoleBindings(org.eclipse.papyrus.FCM.Connector connector) { + if (connector.getIc() instanceof InteractionComponent) { + connectorComp = connector.getIc(); + connectionPattern = connectorComp.getConnectionPattern(); + bindingTable = new FCMUtil.RoleBindingTable(); + for (org.eclipse.uml2.uml.ConnectableElement role : connectionPattern.getRoles()) { + bindingTable.addEntry(role, new ArrayList()); + } + return bindingTable; + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMAdapterFactory.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMAdapterFactory.java new file mode 100644 index 00000000000..ae3a258af53 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMAdapterFactory.java @@ -0,0 +1,832 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.FCM.*; +import org.eclipse.papyrus.FCM.Assembly; +import org.eclipse.papyrus.FCM.AutoIndex; +import org.eclipse.papyrus.FCM.AutoIndexPerNode; +import org.eclipse.papyrus.FCM.BindTemplate; +import org.eclipse.papyrus.FCM.BindingHelper; +import org.eclipse.papyrus.FCM.CodeGenOptions; +import org.eclipse.papyrus.FCM.CompImplTemplate; +import org.eclipse.papyrus.FCM.CompToOOmapping; +import org.eclipse.papyrus.FCM.CompilerChain; +import org.eclipse.papyrus.FCM.ConfigOption; +import org.eclipse.papyrus.FCM.ConfigurableElementInstance; +import org.eclipse.papyrus.FCM.Configuration; +import org.eclipse.papyrus.FCM.ConfigurationProperty; +import org.eclipse.papyrus.FCM.Connector; +import org.eclipse.papyrus.FCM.ConnectorConfiguration; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.CopyAttributeValue; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.Flatten; +import org.eclipse.papyrus.FCM.Fragment; +import org.eclipse.papyrus.FCM.ImplementationGroup; +import org.eclipse.papyrus.FCM.ImplementationProperties; +import org.eclipse.papyrus.FCM.InitPrecedence; +import org.eclipse.papyrus.FCM.InstanceConfigurator; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.FCM.InterceptionRule; +import org.eclipse.papyrus.FCM.OperatingSystem; +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.PortKind; +import org.eclipse.papyrus.FCM.ProgLanguage; +import org.eclipse.papyrus.FCM.RuleApplication; +import org.eclipse.papyrus.FCM.Singleton; +import org.eclipse.papyrus.FCM.Target; +import org.eclipse.papyrus.FCM.TargetArchitecture; +import org.eclipse.papyrus.FCM.Template; +import org.eclipse.papyrus.FCM.TemplatePort; +import org.eclipse.papyrus.FCM.UseInstanceConfigurator; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see org.eclipse.papyrus.FCM.FCMPackage + * @generated + */ +public class FCMAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static FCMPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public FCMAdapterFactory() { + if (modelPackage == null) { + modelPackage = FCMPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected FCMSwitch modelSwitch = + new FCMSwitch() { + @Override + public Adapter caseTemplate(Template object) { + return createTemplateAdapter(); + } + @Override + public Adapter caseBindingHelper(BindingHelper object) { + return createBindingHelperAdapter(); + } + @Override + public Adapter caseConfigurationProperty(ConfigurationProperty object) { + return createConfigurationPropertyAdapter(); + } + @Override + public Adapter caseImplementationGroup(ImplementationGroup object) { + return createImplementationGroupAdapter(); + } + @Override + public Adapter caseAssembly(Assembly object) { + return createAssemblyAdapter(); + } + @Override + public Adapter caseFlatten(Flatten object) { + return createFlattenAdapter(); + } + @Override + public Adapter caseCompToOOmapping(CompToOOmapping object) { + return createCompToOOmappingAdapter(); + } + @Override + public Adapter caseProgLanguage(ProgLanguage object) { + return createProgLanguageAdapter(); + } + @Override + public Adapter caseCodeGenOptions(CodeGenOptions object) { + return createCodeGenOptionsAdapter(); + } + @Override + public Adapter caseInteractionComponent(InteractionComponent object) { + return createInteractionComponentAdapter(); + } + @Override + public Adapter caseSingleton(Singleton object) { + return createSingletonAdapter(); + } + @Override + public Adapter caseConnector(Connector object) { + return createConnectorAdapter(); + } + @Override + public Adapter caseConfigurableElementInstance(ConfigurableElementInstance object) { + return createConfigurableElementInstanceAdapter(); + } + @Override + public Adapter caseUseInstanceConfigurator(UseInstanceConfigurator object) { + return createUseInstanceConfiguratorAdapter(); + } + @Override + public Adapter caseInstanceConfigurator(InstanceConfigurator object) { + return createInstanceConfiguratorAdapter(); + } + @Override + public Adapter caseRuleApplication(RuleApplication object) { + return createRuleApplicationAdapter(); + } + @Override + public Adapter caseContainerRule(ContainerRule object) { + return createContainerRuleAdapter(); + } + @Override + public Adapter caseConfigOption(ConfigOption object) { + return createConfigOptionAdapter(); + } + @Override + public Adapter caseTemplatePort(TemplatePort object) { + return createTemplatePortAdapter(); + } + @Override + public Adapter casePort(Port object) { + return createPortAdapter(); + } + @Override + public Adapter casePortKind(PortKind object) { + return createPortKindAdapter(); + } + @Override + public Adapter caseDeploymentPlan(DeploymentPlan object) { + return createDeploymentPlanAdapter(); + } + @Override + public Adapter caseDerivedElement(DerivedElement object) { + return createDerivedElementAdapter(); + } + @Override + public Adapter caseCompImplTemplate(CompImplTemplate object) { + return createCompImplTemplateAdapter(); + } + @Override + public Adapter caseImplementationProperties(ImplementationProperties object) { + return createImplementationPropertiesAdapter(); + } + @Override + public Adapter caseOperatingSystem(OperatingSystem object) { + return createOperatingSystemAdapter(); + } + @Override + public Adapter caseTargetArchitecture(TargetArchitecture object) { + return createTargetArchitectureAdapter(); + } + @Override + public Adapter caseConfiguration(Configuration object) { + return createConfigurationAdapter(); + } + @Override + public Adapter caseInterceptionRule(InterceptionRule object) { + return createInterceptionRuleAdapter(); + } + @Override + public Adapter caseTarget(Target object) { + return createTargetAdapter(); + } + @Override + public Adapter caseCompilerChain(CompilerChain object) { + return createCompilerChainAdapter(); + } + @Override + public Adapter caseFragment(Fragment object) { + return createFragmentAdapter(); + } + @Override + public Adapter caseCopyAttributeValue(CopyAttributeValue object) { + return createCopyAttributeValueAdapter(); + } + @Override + public Adapter caseAutoIndex(AutoIndex object) { + return createAutoIndexAdapter(); + } + @Override + public Adapter caseAutoIndexPerNode(AutoIndexPerNode object) { + return createAutoIndexPerNodeAdapter(); + } + @Override + public Adapter caseInitPrecedence(InitPrecedence object) { + return createInitPrecedenceAdapter(); + } + @Override + public Adapter caseConnectorConfiguration(ConnectorConfiguration object) { + return createConnectorConfigurationAdapter(); + } + @Override + public Adapter caseBindTemplate(BindTemplate object) { + return createBindTemplateAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Template Template}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.Template + * @generated + */ + public Adapter createTemplateAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.BindingHelper Binding Helper}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.BindingHelper + * @generated + */ + public Adapter createBindingHelperAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ConfigurationProperty Configuration Property}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.ConfigurationProperty + * @generated + */ + public Adapter createConfigurationPropertyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ImplementationGroup Implementation Group}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.ImplementationGroup + * @generated + */ + public Adapter createImplementationGroupAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Assembly Assembly}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.Assembly + * @generated + */ + public Adapter createAssemblyAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Flatten Flatten}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.Flatten + * @generated + */ + public Adapter createFlattenAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.CompToOOmapping Comp To OOmapping}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.CompToOOmapping + * @generated + */ + public Adapter createCompToOOmappingAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ProgLanguage Prog Language}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.ProgLanguage + * @generated + */ + public Adapter createProgLanguageAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.CodeGenOptions Code Gen Options}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.CodeGenOptions + * @generated + */ + public Adapter createCodeGenOptionsAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.InteractionComponent Interaction Component}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.InteractionComponent + * @generated + */ + public Adapter createInteractionComponentAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Singleton Singleton}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.Singleton + * @generated + */ + public Adapter createSingletonAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Connector Connector}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.Connector + * @generated + */ + public Adapter createConnectorAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ConfigurableElementInstance Configurable Element Instance}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.ConfigurableElementInstance + * @generated + */ + public Adapter createConfigurableElementInstanceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.UseInstanceConfigurator Use Instance Configurator}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.UseInstanceConfigurator + * @generated + */ + public Adapter createUseInstanceConfiguratorAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.InstanceConfigurator Instance Configurator}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.InstanceConfigurator + * @generated + */ + public Adapter createInstanceConfiguratorAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.RuleApplication Rule Application}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.RuleApplication + * @generated + */ + public Adapter createRuleApplicationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ContainerRule Container Rule}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.ContainerRule + * @generated + */ + public Adapter createContainerRuleAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ConfigOption Config Option}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.ConfigOption + * @generated + */ + public Adapter createConfigOptionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.TemplatePort Template Port}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.TemplatePort + * @generated + */ + public Adapter createTemplatePortAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Port Port}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.Port + * @generated + */ + public Adapter createPortAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.PortKind Port Kind}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.PortKind + * @generated + */ + public Adapter createPortKindAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.DeploymentPlan Deployment Plan}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.DeploymentPlan + * @generated + */ + public Adapter createDeploymentPlanAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.DerivedElement Derived Element}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.DerivedElement + * @generated + */ + public Adapter createDerivedElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.CompImplTemplate Comp Impl Template}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.CompImplTemplate + * @generated + */ + public Adapter createCompImplTemplateAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ImplementationProperties Implementation Properties}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.ImplementationProperties + * @generated + */ + public Adapter createImplementationPropertiesAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.OperatingSystem Operating System}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.OperatingSystem + * @generated + */ + public Adapter createOperatingSystemAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.TargetArchitecture Target Architecture}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.TargetArchitecture + * @generated + */ + public Adapter createTargetArchitectureAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Configuration Configuration}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.Configuration + * @generated + */ + public Adapter createConfigurationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.InterceptionRule Interception Rule}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.InterceptionRule + * @generated + */ + public Adapter createInterceptionRuleAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Target Target}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.Target + * @generated + */ + public Adapter createTargetAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.CompilerChain Compiler Chain}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.CompilerChain + * @generated + */ + public Adapter createCompilerChainAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.Fragment Fragment}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.Fragment + * @generated + */ + public Adapter createFragmentAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.CopyAttributeValue Copy Attribute Value}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.CopyAttributeValue + * @generated + */ + public Adapter createCopyAttributeValueAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.AutoIndex Auto Index}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.AutoIndex + * @generated + */ + public Adapter createAutoIndexAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.AutoIndexPerNode Auto Index Per Node}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.AutoIndexPerNode + * @generated + */ + public Adapter createAutoIndexPerNodeAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.InitPrecedence Init Precedence}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.InitPrecedence + * @generated + */ + public Adapter createInitPrecedenceAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.ConnectorConfiguration Connector Configuration}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.ConnectorConfiguration + * @generated + */ + public Adapter createConnectorConfigurationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.FCM.BindTemplate Bind Template}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see org.eclipse.papyrus.FCM.BindTemplate + * @generated + */ + public Adapter createBindTemplateAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} // FCMAdapterFactory diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceFactoryImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceFactoryImpl.java new file mode 100644 index 00000000000..5a422f9f93f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceFactoryImpl.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.util; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; +import org.eclipse.emf.ecore.xmi.XMLResource; + +/** + * + * The Resource Factory associated with the package. + * + * @see org.eclipse.papyrus.FCM.util.FCMResourceImpl + * @generated + */ +public class FCMResourceFactoryImpl extends ResourceFactoryImpl { + /** + * Creates an instance of the resource factory. + * + * + * @generated + */ + public FCMResourceFactoryImpl() { + super(); + } + + /** + * Creates an instance of the resource. + * + * + * @generated + */ + @Override + public Resource createResource(URI uri) { + Resource result = new FCMResourceImpl(uri); + return result; + } + +} // FCMResourceFactoryImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceImpl.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceImpl.java new file mode 100644 index 00000000000..44226971798 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMResourceImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.util; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; + +/** + * + * The Resource associated with the package. + * + * @see org.eclipse.papyrus.FCM.util.FCMResourceFactoryImpl + * @generated + */ +public class FCMResourceImpl extends XMLResourceImpl { + /** + * Creates an instance of the resource. + * + * + * @param uri the URI of the new resource. + * @generated + */ + public FCMResourceImpl(URI uri) { + super(uri); + } + +} // FCMResourceImpl diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMSwitch.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMSwitch.java new file mode 100644 index 00000000000..8850265f42a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMSwitch.java @@ -0,0 +1,938 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.util.Switch; +import org.eclipse.papyrus.FCM.*; +import org.eclipse.papyrus.FCM.Assembly; +import org.eclipse.papyrus.FCM.AutoIndex; +import org.eclipse.papyrus.FCM.AutoIndexPerNode; +import org.eclipse.papyrus.FCM.BindTemplate; +import org.eclipse.papyrus.FCM.BindingHelper; +import org.eclipse.papyrus.FCM.CodeGenOptions; +import org.eclipse.papyrus.FCM.CompImplTemplate; +import org.eclipse.papyrus.FCM.CompToOOmapping; +import org.eclipse.papyrus.FCM.CompilerChain; +import org.eclipse.papyrus.FCM.ConfigOption; +import org.eclipse.papyrus.FCM.ConfigurableElementInstance; +import org.eclipse.papyrus.FCM.Configuration; +import org.eclipse.papyrus.FCM.ConfigurationProperty; +import org.eclipse.papyrus.FCM.Connector; +import org.eclipse.papyrus.FCM.ConnectorConfiguration; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.CopyAttributeValue; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.FCM.FCMPackage; +import org.eclipse.papyrus.FCM.Flatten; +import org.eclipse.papyrus.FCM.Fragment; +import org.eclipse.papyrus.FCM.ImplementationGroup; +import org.eclipse.papyrus.FCM.ImplementationProperties; +import org.eclipse.papyrus.FCM.InitPrecedence; +import org.eclipse.papyrus.FCM.InstanceConfigurator; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.FCM.InterceptionRule; +import org.eclipse.papyrus.FCM.OperatingSystem; +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.PortKind; +import org.eclipse.papyrus.FCM.ProgLanguage; +import org.eclipse.papyrus.FCM.RuleApplication; +import org.eclipse.papyrus.FCM.Singleton; +import org.eclipse.papyrus.FCM.Target; +import org.eclipse.papyrus.FCM.TargetArchitecture; +import org.eclipse.papyrus.FCM.Template; +import org.eclipse.papyrus.FCM.TemplatePort; +import org.eclipse.papyrus.FCM.UseInstanceConfigurator; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see org.eclipse.papyrus.FCM.FCMPackage + * @generated + */ +public class FCMSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static FCMPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public FCMSwitch() { + if (modelPackage == null) { + modelPackage = FCMPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case FCMPackage.TEMPLATE: { + Template template = (Template)theEObject; + T result = caseTemplate(template); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.BINDING_HELPER: { + BindingHelper bindingHelper = (BindingHelper)theEObject; + T result = caseBindingHelper(bindingHelper); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.CONFIGURATION_PROPERTY: { + ConfigurationProperty configurationProperty = (ConfigurationProperty)theEObject; + T result = caseConfigurationProperty(configurationProperty); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.IMPLEMENTATION_GROUP: { + ImplementationGroup implementationGroup = (ImplementationGroup)theEObject; + T result = caseImplementationGroup(implementationGroup); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.ASSEMBLY: { + Assembly assembly = (Assembly)theEObject; + T result = caseAssembly(assembly); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.FLATTEN: { + Flatten flatten = (Flatten)theEObject; + T result = caseFlatten(flatten); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.COMP_TO_OOMAPPING: { + CompToOOmapping compToOOmapping = (CompToOOmapping)theEObject; + T result = caseCompToOOmapping(compToOOmapping); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.PROG_LANGUAGE: { + ProgLanguage progLanguage = (ProgLanguage)theEObject; + T result = caseProgLanguage(progLanguage); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.CODE_GEN_OPTIONS: { + CodeGenOptions codeGenOptions = (CodeGenOptions)theEObject; + T result = caseCodeGenOptions(codeGenOptions); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.INTERACTION_COMPONENT: { + InteractionComponent interactionComponent = (InteractionComponent)theEObject; + T result = caseInteractionComponent(interactionComponent); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.SINGLETON: { + Singleton singleton = (Singleton)theEObject; + T result = caseSingleton(singleton); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.CONNECTOR: { + Connector connector = (Connector)theEObject; + T result = caseConnector(connector); + if (result == null) result = caseConfigurableElementInstance(connector); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.CONFIGURABLE_ELEMENT_INSTANCE: { + ConfigurableElementInstance configurableElementInstance = (ConfigurableElementInstance)theEObject; + T result = caseConfigurableElementInstance(configurableElementInstance); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.USE_INSTANCE_CONFIGURATOR: { + UseInstanceConfigurator useInstanceConfigurator = (UseInstanceConfigurator)theEObject; + T result = caseUseInstanceConfigurator(useInstanceConfigurator); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.INSTANCE_CONFIGURATOR: { + InstanceConfigurator instanceConfigurator = (InstanceConfigurator)theEObject; + T result = caseInstanceConfigurator(instanceConfigurator); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.RULE_APPLICATION: { + RuleApplication ruleApplication = (RuleApplication)theEObject; + T result = caseRuleApplication(ruleApplication); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.CONTAINER_RULE: { + ContainerRule containerRule = (ContainerRule)theEObject; + T result = caseContainerRule(containerRule); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.CONFIG_OPTION: { + ConfigOption configOption = (ConfigOption)theEObject; + T result = caseConfigOption(configOption); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.TEMPLATE_PORT: { + TemplatePort templatePort = (TemplatePort)theEObject; + T result = caseTemplatePort(templatePort); + if (result == null) result = casePort(templatePort); + if (result == null) result = caseConfigurableElementInstance(templatePort); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.PORT: { + Port port = (Port)theEObject; + T result = casePort(port); + if (result == null) result = caseConfigurableElementInstance(port); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.PORT_KIND: { + PortKind portKind = (PortKind)theEObject; + T result = casePortKind(portKind); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.DEPLOYMENT_PLAN: { + DeploymentPlan deploymentPlan = (DeploymentPlan)theEObject; + T result = caseDeploymentPlan(deploymentPlan); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.DERIVED_ELEMENT: { + DerivedElement derivedElement = (DerivedElement)theEObject; + T result = caseDerivedElement(derivedElement); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.COMP_IMPL_TEMPLATE: { + CompImplTemplate compImplTemplate = (CompImplTemplate)theEObject; + T result = caseCompImplTemplate(compImplTemplate); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.IMPLEMENTATION_PROPERTIES: { + ImplementationProperties implementationProperties = (ImplementationProperties)theEObject; + T result = caseImplementationProperties(implementationProperties); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.OPERATING_SYSTEM: { + OperatingSystem operatingSystem = (OperatingSystem)theEObject; + T result = caseOperatingSystem(operatingSystem); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.TARGET_ARCHITECTURE: { + TargetArchitecture targetArchitecture = (TargetArchitecture)theEObject; + T result = caseTargetArchitecture(targetArchitecture); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.CONFIGURATION: { + Configuration configuration = (Configuration)theEObject; + T result = caseConfiguration(configuration); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.INTERCEPTION_RULE: { + InterceptionRule interceptionRule = (InterceptionRule)theEObject; + T result = caseInterceptionRule(interceptionRule); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.TARGET: { + Target target = (Target)theEObject; + T result = caseTarget(target); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.COMPILER_CHAIN: { + CompilerChain compilerChain = (CompilerChain)theEObject; + T result = caseCompilerChain(compilerChain); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.FRAGMENT: { + Fragment fragment = (Fragment)theEObject; + T result = caseFragment(fragment); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.COPY_ATTRIBUTE_VALUE: { + CopyAttributeValue copyAttributeValue = (CopyAttributeValue)theEObject; + T result = caseCopyAttributeValue(copyAttributeValue); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.AUTO_INDEX: { + AutoIndex autoIndex = (AutoIndex)theEObject; + T result = caseAutoIndex(autoIndex); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.AUTO_INDEX_PER_NODE: { + AutoIndexPerNode autoIndexPerNode = (AutoIndexPerNode)theEObject; + T result = caseAutoIndexPerNode(autoIndexPerNode); + if (result == null) result = caseAutoIndex(autoIndexPerNode); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.INIT_PRECEDENCE: { + InitPrecedence initPrecedence = (InitPrecedence)theEObject; + T result = caseInitPrecedence(initPrecedence); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.CONNECTOR_CONFIGURATION: { + ConnectorConfiguration connectorConfiguration = (ConnectorConfiguration)theEObject; + T result = caseConnectorConfiguration(connectorConfiguration); + if (result == null) result = defaultCase(theEObject); + return result; + } + case FCMPackage.BIND_TEMPLATE: { + BindTemplate bindTemplate = (BindTemplate)theEObject; + T result = caseBindTemplate(bindTemplate); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Template'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Template'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTemplate(Template object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Binding Helper'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Binding Helper'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBindingHelper(BindingHelper object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Configuration Property'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Configuration Property'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConfigurationProperty(ConfigurationProperty object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Implementation Group'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Implementation Group'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseImplementationGroup(ImplementationGroup object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Assembly'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Assembly'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseAssembly(Assembly object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Flatten'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Flatten'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFlatten(Flatten object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Comp To OOmapping'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Comp To OOmapping'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCompToOOmapping(CompToOOmapping object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Prog Language'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Prog Language'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseProgLanguage(ProgLanguage object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Code Gen Options'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Code Gen Options'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCodeGenOptions(CodeGenOptions object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Interaction Component'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Interaction Component'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInteractionComponent(InteractionComponent object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Singleton'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Singleton'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseSingleton(Singleton object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Connector'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Connector'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConnector(Connector object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Configurable Element Instance'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Configurable Element Instance'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConfigurableElementInstance(ConfigurableElementInstance object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Use Instance Configurator'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Use Instance Configurator'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseUseInstanceConfigurator(UseInstanceConfigurator object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Instance Configurator'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Instance Configurator'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInstanceConfigurator(InstanceConfigurator object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Rule Application'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Rule Application'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRuleApplication(RuleApplication object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Container Rule'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Container Rule'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseContainerRule(ContainerRule object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Config Option'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Config Option'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConfigOption(ConfigOption object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Template Port'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Template Port'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTemplatePort(TemplatePort object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Port'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Port'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePort(Port object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Port Kind'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Port Kind'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePortKind(PortKind object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Deployment Plan'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Deployment Plan'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDeploymentPlan(DeploymentPlan object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Derived Element'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Derived Element'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDerivedElement(DerivedElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Comp Impl Template'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Comp Impl Template'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCompImplTemplate(CompImplTemplate object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Implementation Properties'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Implementation Properties'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseImplementationProperties(ImplementationProperties object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Operating System'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Operating System'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseOperatingSystem(OperatingSystem object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Target Architecture'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Target Architecture'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTargetArchitecture(TargetArchitecture object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Configuration'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Configuration'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConfiguration(Configuration object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Interception Rule'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Interception Rule'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInterceptionRule(InterceptionRule object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Target'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Target'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTarget(Target object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Compiler Chain'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Compiler Chain'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCompilerChain(CompilerChain object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Fragment'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Fragment'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFragment(Fragment object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Copy Attribute Value'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Copy Attribute Value'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCopyAttributeValue(CopyAttributeValue object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Auto Index'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Auto Index'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseAutoIndex(AutoIndex object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Auto Index Per Node'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Auto Index Per Node'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseAutoIndexPerNode(AutoIndexPerNode object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Init Precedence'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Init Precedence'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInitPrecedence(InitPrecedence object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Connector Configuration'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Connector Configuration'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConnectorConfiguration(ConnectorConfiguration object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Bind Template'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Bind Template'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseBindTemplate(BindTemplate object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} // FCMSwitch diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMUtil.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMUtil.java new file mode 100644 index 00000000000..70d93d48d1b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMUtil.java @@ -0,0 +1,240 @@ +package org.eclipse.papyrus.FCM.util; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.UniqueEList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.FCM.Connector; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.FCM.RuleApplication; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.CollaborationUse; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.UMLFactory; +import org.eclipse.uml2.uml.ValueSpecification; + + +public class FCMUtil { + + /** + * @param specification + * @param configPropertyName + * @return + */ + public static EList getConfigurationValue(InstanceSpecification specification, String configPropertyName) { + if (specification != null) { + for (Iterator i = specification.getSlots().iterator(); i.hasNext();) { + Slot currentSlot = i.next(); + if (currentSlot.getDefiningFeature() != null && + currentSlot.getDefiningFeature().getName().equals(configPropertyName)) { + return currentSlot.getValues(); + } + } + } + return null; + } + + /** + * @param interfaces + * @param interfaceName + * @return + */ + public static Interface findInterfaceByName(EList interfaces, String interfaceName) { + for (Iterator i = interfaces.iterator(); i.hasNext();) { + Interface currentInterface = i.next(); + if (currentInterface.getName().equals(interfaceName)) { + return currentInterface; + } + } + return null; + } + + /** + * A data structure to be used for the specification of how the roles of the collaboration associated with + * the type of param "connector" are bound to actual elements of the composite containing param "connector". + * This data structure contains an hashmap>: + * - keys must be roles of a Collaboration + * - values must be list of elements playing this role in the context of a particular composite + * + * @author ac221913 + * + */ + public static final class RoleBindingTable { + + private HashMap> table; + + public RoleBindingTable() { + this.table = new HashMap>(); + } + + public void addEntry(org.eclipse.uml2.uml.ConnectableElement role, + List playedBy) { + table.put(role, playedBy); + } + + public List getEntry(org.eclipse.uml2.uml.ConnectableElement role) { + return table.get(role); + } + + public Iterator iterator() { + return table.keySet().iterator(); + } + + public HashMap> getTable() { + return table; + } + + public ConnectableElement getRoleKeyByName(String roleName) { + for (ConnectableElement role : table.keySet()) { + if (role.getName().equals(roleName)) { + return role; + } + } + return null; + } + } + + /** + * Generate a connection pattern. Currently unused + * + * @param connectorComp + */ + public static void generateDefaultConnectionPattern(InteractionComponent connectorComp) { + org.eclipse.uml2.uml.Collaboration connectionPattern = + UMLFactory.eINSTANCE.createCollaboration(); + + // ((org.eclipse.uml2.uml.Package)connectorComp.getBase_Class().getOwner()).getPackagedElements().add(connectionPattern) ; + connectorComp.getBase_Class().getNestedClassifiers().add(connectionPattern); + connectionPattern.setName(connectorComp.getBase_Class().getName() + "ConnectionPattern"); //$NON-NLS-1$ + + org.eclipse.uml2.uml.Property connectorRole = + connectionPattern.createOwnedAttribute("connector", connectorComp.getBase_Class(), 1, 1); //$NON-NLS-1$ + for (Iterator i = connectorComp.getBase_Class().getOwnedPorts().iterator(); i.hasNext();) { + org.eclipse.uml2.uml.Port port = i.next(); + org.eclipse.uml2.uml.Property role; + org.eclipse.uml2.uml.Connector connector; + role = connectionPattern.createOwnedAttribute(port.getName(), null); + connector = connectionPattern.createOwnedConnector(""); //$NON-NLS-1$ + org.eclipse.uml2.uml.ConnectorEnd source, target; + source = connector.createEnd(); + source.setRole(port); + source.setPartWithPort(connectorRole); + target = connector.createEnd(); + target.setRole(role); + } + + connectorComp.setConnectionPattern(connectionPattern); + } + + /** + * TODO Move this method in ConnectorReification.java + * + * @author ac221913 + * + */ + public static void generateCollaborationUse(Connector connector) { + + InteractionComponent connectorCompGen = connector.getIc(); + + if (!(connectorCompGen instanceof InteractionComponent)) { + return; + } + InteractionComponent connectorComp = connectorCompGen; + org.eclipse.uml2.uml.Collaboration connectionPattern = + connectorComp.getConnectionPattern(); + + if (connectionPattern == null) { + FCMUtil.generateDefaultConnectionPattern(connectorComp); + connectionPattern = connectorComp.getConnectionPattern(); + } + + Class composite = (Class) connector.getBase_Connector().getOwner(); + CollaborationUse collaborationUse; + RoleBindingTable bindingTable = getConnectorRoleBindings(connector); + + if (bindingTable == null) { + return; + } + + collaborationUse = composite.createCollaborationUse("useOf" + connectionPattern.getName()); //$NON-NLS-1$ + collaborationUse.setType(connectionPattern); + for (Iterator i = bindingTable.iterator(); i.hasNext();) { + org.eclipse.uml2.uml.ConnectableElement role = i.next(); + org.eclipse.uml2.uml.Dependency roleBinding; + roleBinding = collaborationUse.createRoleBinding(role.getName() + "RoleBinding"); //$NON-NLS-1$ + roleBinding.getSuppliers().add(role); + for (Iterator j = bindingTable.getEntry(role).iterator(); j.hasNext();) { + roleBinding.getClients().add(j.next()); + } + } + } + + /** + * Computes a RoleBindingTable for a given ConnectorComp + * Implies that a java class has been defined in FCMProfile.util for this ConnectorComp, + * and that it encapsulates corresponding role binding rule + * + * @author ac221913 + * + */ + public static RoleBindingTable getConnectorRoleBindings(Connector connector) { + InteractionComponent connectorCompGen = connector.getIc(); + + if (!(connectorCompGen instanceof InteractionComponent)) { + return null; + } + InteractionComponent type = connectorCompGen; + + IExtensionRegistry reg = Platform.getExtensionRegistry(); + IConfigurationElement[] configElements = reg.getConfigurationElementsFor("fcmEmbeddingRule"); //$NON-NLS-1$ + for (IConfigurationElement configElement : configElements) { + try { + final String extConnName = configElement.getAttribute("connectorName"); //$NON-NLS-1$ + if (extConnName.equals(type.getBase_Class().getName())) { + final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ + if (obj instanceof IEmbeddingRule) { + return ((IEmbeddingRule) obj).getRoleBindings(connector); + } + } + } catch (CoreException exception) { + exception.printStackTrace(); + } + } + return null; + } + + /* + * return a list of all rules based on containment packages of rules + * from owning elements + */ + public static EList getAllContainerRules(Element element) { + EList list = new UniqueEList(); + if (element != null) { + for (EObject eObj : element.getStereotypeApplications()) { + if (eObj instanceof RuleApplication) { + list.addAll(((RuleApplication) eObj).getContainerRule()); + break; + } + } + element = element.getOwner(); + if (element != null) { + list.addAll(getAllContainerRules(element)); + } + } + return list; + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMXMLProcessor.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMXMLProcessor.java new file mode 100644 index 00000000000..c529e27f558 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/FCMXMLProcessor.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ +package org.eclipse.papyrus.FCM.util; + +import java.util.Map; + +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.xmi.util.XMLProcessor; +import org.eclipse.papyrus.FCM.FCMPackage; + +/** + * This class contains helper methods to serialize and deserialize XML documents + * + * + * @generated + */ +public class FCMXMLProcessor extends XMLProcessor { + + /** + * Public constructor to instantiate the helper. + * + * + * @generated + */ + public FCMXMLProcessor() { + super((EPackage.Registry.INSTANCE)); + FCMPackage.eINSTANCE.eClass(); + } + + /** + * Register for "*" and "xml" file extensions the FCMResourceFactoryImpl factory. + * + * + * @generated + */ + @Override + protected Map getRegistrations() { + if (registrations == null) { + super.getRegistrations(); + registrations.put(XML_EXTENSION, new FCMResourceFactoryImpl()); + registrations.put(STAR_EXTENSION, new FCMResourceFactoryImpl()); + } + return registrations; + } + +} // FCMXMLProcessor diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IBindingHelper.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IBindingHelper.java new file mode 100644 index 00000000000..b512b1e5b11 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IBindingHelper.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ + +package org.eclipse.papyrus.FCM.util; + +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.TemplateBinding; + +/** + * BindingHelper interface. The interface is intentionally left empty. Implementations + * (such as Qompass designer) might check for subclasses. + * + */ +public interface IBindingHelper { + public void handleElement(TemplateBinding binding, Element object); +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IEmbeddingRule.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IEmbeddingRule.java new file mode 100644 index 00000000000..8489c5377cc --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IEmbeddingRule.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ + +package org.eclipse.papyrus.FCM.util; + +import org.eclipse.papyrus.FCM.Connector; + +/** + * Interface used by extension point for embedding rules + */ +public interface IEmbeddingRule { + /** + * Return a role binding table for a given connector + * + * @param connector + * the connector + * @return role binding table + */ + public FCMUtil.RoleBindingTable getRoleBindings(Connector connector); + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IMappingRule.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IMappingRule.java new file mode 100644 index 00000000000..f5b37646df5 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/IMappingRule.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ + +package org.eclipse.papyrus.FCM.util; + +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.uml2.uml.Type; + +/** + * Interface used by extension point for evaluation of interface mappings + * + */ +public interface IMappingRule { + /** + * Calculate the derived portType + * + * @param p + * the port + * @param update + * if true, make model updates during calculation of derived interface + * @return the list of provided interfaces + */ + public Type calcDerivedType(Port p, boolean update); + + /** + * check whether a port needs to be updated (recalculation of its derived interfaces) + * + * @return true, if update is required, false otherwise + */ + public boolean needsUpdate(Port p); +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ITemplateMappingRule.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ITemplateMappingRule.java new file mode 100644 index 00000000000..2b9ef6487db --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/ITemplateMappingRule.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ + +package org.eclipse.papyrus.FCM.util; + +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.PortKind; + + +/** + * A specific mapping rule for template ports, i.e. ports that facilitate the + * use of bound ports: i.e. instead of creating explicitly a binding for an extended + * port, the type of the port is used as actual and the kind points to an extended + * port + */ +public interface ITemplateMappingRule extends IMappingRule { + + /** + * Update the created binding + */ + public void updateBinding(Port port); + + /** + * Return the bound type + * + * @param port + * @return + */ + public PortKind getBoundType(Port port); +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/MapUtil.java b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/MapUtil.java new file mode 100644 index 00000000000..c6e4699fb8e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile/src/org/eclipse/papyrus/FCM/util/MapUtil.java @@ -0,0 +1,530 @@ +/** + * Copyright (c) 2013 CEA LIST + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher - Initial API and implementation + * + */ + +package org.eclipse.papyrus.FCM.util; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.FCM.Activator; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.PortKind; +import org.eclipse.papyrus.FCM.TemplatePort; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Namespace; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageMerge; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.Stereotype; +import org.eclipse.uml2.uml.TemplateSignature; +import org.eclipse.uml2.uml.TemplateableElement; +import org.eclipse.uml2.uml.Type; + + +/** + * This class is responsible for creating derived types associated with ports. The derived + * type is the class that will type the port and contain imported and used interfaces depending + * on the FCM type and kind. + * A particular question related to the derived types is into which package we can place them + * within the type hierarchy: + * (1) Of course, the package must be writable. That means, it must not belong to an imported library. + * (2) The source type must be clearly identifiable. + * (3) If a template get's instantiated, derived types within (if we place them there) might + * need (re-) instantiation. Imagine AMI_ interface that contains some of I's method. The creation of an AMI_I type within the template + * + * Therefore, a global "derived types" package is created within the model that owns the port. This + * package contains the full folder hierarchy of the original type and places the elements there. + * TODO: Align with package template instantiation => create type specific sub-folder, e.g. kind_type. Use package specific side-folders. + * Need specific solution for elements within template (placing into same template is finally not a good idea). + * Idea of package template (and the possibility to extend) was, that common elements are instantiated once. Thus, we will have interfaceBased_/UseInterface/Use.cpp, + * not UseInterface_/Use.cpp + * [Users choice to define template with additional package or not?] + */ +public class MapUtil { + + private static final String DERIVED_TYPES = "derivedTypes"; //$NON-NLS-1$ + + // specific treatment of "root" model that is created by eC3M for deployment + // It avoids that copies of derived interfaces are created at different places + // [better alternative: avoid problem by using set of models instead of single large one] + // [other option?: no-update flag?] + public static final String rootModelName = "root"; //$NON-NLS-1$ + + public static final String MAPPING_RULE_ID = "fcmPortMappingRule"; //$NON-NLS-1$ + + public enum CREATE_KIND { + CLASS, INTERFACE, NONE + } + + /** + * Get the template signature of a templateable element (typically a package). The class must + * (1) either own the signature + * (2) or merge with a package which owns the signature. + * Qompass enables the "extension" of existing packages via the package merge mechanism + * + * @param template + * The potential template + * @return the signature or null, if none can be found. + */ + public static TemplateSignature getSignature(TemplateableElement template) { + for (Element element : template.getOwnedElements()) { + if (element instanceof TemplateSignature) { + return (TemplateSignature) element; + } + } + + // enable multiple package templates sharing the same signature. + if (template instanceof Package) { + Package pkg = (Package) template; + for (PackageMerge pkgImport : pkg.getPackageMerges()) { + Package importedPkg = pkgImport.getMergedPackage(); + return getSignature(importedPkg); + } + } + return null; + } + + /** + * Return the top-level owner of an element. This function returns the same value + * as getModel, if the top-level element is a model and not contained in a template + * While this is the case for models, model libraries have a top-level package (not + * a model). In this case, getTop returns the top-level package whereas getModel + * would return null. + * In case of a package owning a signature, it returns this package instead of the + * top level package. The reason is that the derived types might reference elements + * of the template signature which would be undefined outside. + * + * @param element + * An element of which we want to query + * @return the top-level owning package + */ + public static Package getTop(Element element) { + while (element != null) { + Element owner = element.getOwner(); + if (owner == null) { + if (element instanceof Package) { + return (Package) element; + } + } else if ((owner instanceof Package) && (owner.getOwner() == null) && + ((Package) owner).getName().equals(rootModelName)) { + // Hack: assure that no new derived interface folder is created in "root" model + // that eC3M creates for deployment + if (element instanceof Package) { + // return (Package)element; + } + } + if ((element instanceof Package) && (getSignature((Package) element) != null)) { + return (Package) element; + } + element = owner; + } + return null; + } + + /** + * Apply the derived element stereotype to a model element + * + * @param element + * @return + */ + public static DerivedElement applyDE(Element element) { + Stereotype stereotype = element.getApplicableStereotype("FCM::DerivedElement"); //$NON-NLS-1$ + if (stereotype != null) { + EObject alreadyApplied = element.getStereotypeApplication(stereotype); + if (alreadyApplied instanceof DerivedElement) { + return (DerivedElement) alreadyApplied; + } + alreadyApplied = element.applyStereotype(stereotype); + if (alreadyApplied instanceof DerivedElement) { + return (DerivedElement) alreadyApplied; + } + } + return null; + } + + /** + * Get or create a package within another package (often the root of a model), i.e. return + * a package with the passed name, if it exists or create a new one of this name + * + * @param root + * a package potentially owning a certain element + * @param name + * the name of a package that should be be returned. + * @return a package + */ + public static Package getAndCreate(Package root, String name, boolean createOnDemand) { + NamedElement pkg = root.getOwnedMember(name); + if ((pkg == null) && createOnDemand) { + pkg = root.createNestedPackage(name); + } + return (Package) pkg; + } + + /** + * Get or create a derived interface for a port using a fixed prefix + * type name + * + * @param port + * The port + * @param prefix + * prefix string + * @param type + * type name + * @return the derived interface or null (if it cannot be created) + */ + public static Class getDerivedClass(Port port, String prefix) { + Type type = getOrCreateDerivedTypeIntern(port, prefix, port.getType(), CREATE_KIND.NONE); + return type instanceof Class ? (Class) type : null; + } + + /** + * Get or create a derived interface for a port using a fixed prefix + * type name + * + * @param port + * The port + * @param prefix + * prefix string + * @param type + * type name + * @return the derived interface or null (if it cannot be created) + */ + public static Class getDerivedClass(Port port, String prefix, boolean update) { + return update ? getOrCreateDerivedClass(port, prefix) : getDerivedClass(port, prefix); + } + + /** + * Get a derived interface of a port. The interface is searched within the derived types + * folder based on the passed prefix + * + * @param port + * The port + * @param prefix + * prefix string + * @param type + * FCM port type + * @return the derived interface or null (if it cannot be created) + */ + public static Interface getDerivedInterface(Port port, String prefix) { + Type type = getOrCreateDerivedTypeIntern(port, prefix, port.getType(), CREATE_KIND.NONE); + return type instanceof Interface ? (Interface) type : null; + } + + /** + * Get or create a derived interface for a port using a fixed prefix + * type name + * + * @param port + * The port + * @param prefix + * prefix string + * @param type + * type name + * @return the derived interface or null (if it cannot be created) + */ + public static Interface getDerivedInterface(Port port, String prefix, boolean update) { + return update ? getOrCreateDerivedInterface(port, prefix) : getDerivedInterface(port, prefix); + } + + /** + * Get or create a derived interface for a port using a fixed prefix + * type name + * + * @param port + * The port + * @param prefix + * prefix string + * @param type + * type name + * @param createKind + * if non NONE, create either an interfaces or a class, if it does not exist yet + * @return the derived interface or null (if it cannot be created) + */ + public static Class getOrCreateDerivedClass(Port port, String prefix) { + Type type = getOrCreateDerivedTypeIntern(port, prefix, port.getType(), CREATE_KIND.CLASS); + return type instanceof Class ? (Class) type : null; + } + + /** + * Get or create a derived interface for a port using a fixed prefix + * type name + * + * @param port + * The port + * @param prefix + * prefix string + * @param type + * type name + * @return the derived interface or null (if it cannot be created) + */ + public static Interface getOrCreateDerivedInterface(Port port, String prefix) { + Type type = getOrCreateDerivedTypeIntern(port, prefix, port.getType(), CREATE_KIND.INTERFACE); + return type instanceof Interface ? (Interface) type : null; + } + + + + /** + * This function returns a Package reference that corresponds to a qualified name. + * Packages are created, if not existing yet - the function is thus a bit similar to + * the unix "mkdir -p" command. Note that the main model within the list of name-spaces is + * ignored, in order to avoid that a sub-package within a model starts with the name + * of the model. + * + * @param model + * a model + * @param list + * a list of namespace elements (as can be obtained via allNamespaces), + * the top-level element is the last within the list. + * @param skipTop + * if true, skip top level namespace element + * @return + */ + public static Package getAndCreate(Package root, EList list, boolean createOnDemand) { + boolean first = true; + for (int i = list.size() - 1; i >= 0; i--) { + Namespace ns = list.get(i); + + if (first) { + first = false; + // Hack: if rootModel is used, skip top + // (avoid that new derived interface with "root" prefix is created) + if (ns.getName().equals(rootModelName)) { + continue; + } + } + NamedElement pkg = root.getOwnedMember(ns.getName()); + if ((pkg == null) && createOnDemand) { + // package does not exist => create it. + pkg = root.createNestedPackage(ns.getName()); + // copy stereotype to create package + } + if (!(pkg instanceof Package)) { + break; + } + root = (Package) pkg; + } + return root; + } + + /** + * Get or create a derived interface for a port using the name given by concatenation of prefix and + * type name + * + * @param port + * The port for which to create a derived interface. Only used to determine the place where the + * derived interface is placed + * @param prefix + * prefix string + * @param type + * type name + * @param createKind + * if non NONE, create either an interfaces or a class, if it does not exist yet + * @return + */ + private static Type getOrCreateDerivedTypeIntern(Port port, String prefix, Type type, CREATE_KIND createKind) { + String typeName = prefix + type.getName(); + + // create derived element in "derivedInterface" package within the model owning + // the port (which must be an FCM model, since the port carries the FCM stereotype) + Package baseModelOfPort = getTop(port.getBase_Port()); + // handle specific case of type within template. Place derived type into same template. + Package derivedTypes = getAndCreate(baseModelOfPort, DERIVED_TYPES, createKind != CREATE_KIND.NONE); + if (derivedTypes != null) { + Package owner = getAndCreate(derivedTypes, type.allNamespaces(), createKind != CREATE_KIND.NONE); + Interface intf = null; + + PackageableElement pe = owner.getPackagedElement(typeName); + if (pe instanceof Type) { + // type already exists + return (Type) pe; + } else if (createKind == CREATE_KIND.INTERFACE) { + // System.out.println ("Derived port types: create new interface " + typeName + " in package " + owner.getQualifiedName ()); + intf = owner.createOwnedInterface(typeName); + + // System.out.println ("Derived port types: Apply derived stereotype annotation to interface: " + intf.getQualifiedName()); + DerivedElement de = applyDE(intf); + if (de != null) { + // de may be null, if FCM is not properly applied + de.setSource(type); + } + return intf; + } else if (createKind == CREATE_KIND.CLASS) { + // System.out.println ("Derived port types: create new interface " + typeName + " in package " + owner.getQualifiedName ()); + Class newType = owner.createOwnedClass(typeName, false); + + // System.out.println ("Derived port types: Apply derived stereotype annotation to interface: " + intf.getQualifiedName()); + DerivedElement de = applyDE(newType); + if (de != null) { + // de may be null, if FCM is not properly applied + de.setSource(type); + } + return newType; + } + } + + // instead of returning null, return a dummy interface that indicates the user that an element needs updating. + PackageableElement portKinds = baseModelOfPort.getImportedMember("PortKinds"); //$NON-NLS-1$ + if (portKinds instanceof Package) { + PackageableElement pe = ((Package) portKinds).getPackagedElement("Please update derived elements"); //$NON-NLS-1$ + if (pe instanceof Interface) { + // dummy interface exists + return (Interface) pe; + } + } + return null; + } + + public static void addRealization(Class portType, Interface providedInterface) { + if (!portType.getImplementedInterfaces().contains(providedInterface)) { + portType.createInterfaceRealization(null, providedInterface); + } + } + + public static void addUsage(Class portType, Interface usedInterface) { + if (!portType.getUsedInterfaces().contains(usedInterface)) { + portType.createUsage(usedInterface); + } + } + + /** + * Calculate derived required interface in function of port type and kind + * + * @param port + * the port, for which the calculation should be done + * @return + */ + public static Type getDerivedType(final Port port) { + if (port.getBase_Port() == null) { + // should not happen, but can occur in case of corrupted XMI files + return null; + } + PortKind portKind = port.getKind(); + if (portKind != null) { + String ruleName = portKind.isExtendedPort() ? "ExtendedPort" : portKind.getBase_Class().getName(); //$NON-NLS-1$ + final IMappingRule mappingRule = getMappingRule(ruleName); + if (mappingRule != null) { + return mappingRule.calcDerivedType(port, false); + } + } + return null; + } + + + /** + * Obtain the mapping rule for a port when the name of the portKind is given + * + * @param portKindName + * the name of the port-kind + * + * @return the mapping rule or null, if no rule could be found + */ + public static IMappingRule getMappingRule(String portKindName) { + IExtensionRegistry reg = Platform.getExtensionRegistry(); + IConfigurationElement[] configElements = reg.getConfigurationElementsFor(Activator.PLUGIN_ID + "." + MAPPING_RULE_ID); //$NON-NLS-1$ + for (IConfigurationElement configElement : configElements) { + try { + final String extPortKindName = configElement.getAttribute("portKindName"); //$NON-NLS-1$ + if (extPortKindName.equals(portKindName)) { + final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ + if (obj instanceof IMappingRule) { + return (IMappingRule) obj; + } + } + } catch (CoreException exception) { + exception.printStackTrace(); + } + } + return null; + } + + /** + * Get the mapping rule for a port + * + * @param port + * the FCM port + * @return the mapping rule or null, if no rule could be found + */ + public static IMappingRule getMappingRule(final Port port) { + if (port.getBase_Port() == null) { + // should not happen, but can occur in case of corrupted XMI files + return null; + } + PortKind portKind = port.getKind(); + if (portKind == null) { + return null; + } + if (portKind.getBase_Class() != null) { + String ruleName = portKind.isExtendedPort() ? "ExtendedPort" : portKind.getBase_Class().getName(); //$NON-NLS-1$ + if (port instanceof TemplatePort) { + ruleName = "TemplatePort"; //$NON-NLS-1$ + } + return getMappingRule(ruleName); + } + return null; + } + + public static PortKind getBoundType(final Port port) { + if (port.getBase_Port() == null) { + // should not happen, but can occur in case of corrupted XMI files + return null; + } else { + String ruleName = "TemplatePort"; //$NON-NLS-1$ + final IMappingRule mappingRule = getMappingRule(ruleName); + if (mappingRule instanceof ITemplateMappingRule) { + return ((ITemplateMappingRule) mappingRule).getBoundType(port); + } + } + return null; + } + + /** + * Update the derived interfaces of a port this operation needs to be + * called in the context of an update command (transaction). + * + * @param port + */ + public static void update(final Port port) { + final IMappingRule mappingRule = getMappingRule(port); + + if (mappingRule != null) { + Type type = mappingRule.calcDerivedType(port, true); + port.getBase_Port().setType(type); + if (mappingRule instanceof ITemplateMappingRule) { + ((ITemplateMappingRule) mappingRule).updateBinding(port); + } + } + } + + /** + * Check whether a port needs to be updated, since its derived interfaces + * are either not existing or out of date. + * + * @param port + * @return + */ + public static boolean needsUpdate(final Port port) { + final IMappingRule mappingRule = getMappingRule(port); + if (mappingRule != null) { + return mappingRule.needsUpdate(port); + } + return false; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/.classpath b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/.classpath new file mode 100644 index 00000000000..098194ca4b7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/.project b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/.project new file mode 100644 index 00000000000..65c53f6af96 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/.project @@ -0,0 +1,46 @@ + + + org.eclipse.papyrus.qompass.designer.core + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.acceleo.ide.ui.acceleoBuilder + + + compilation.kind + compilation.absolute.path + + + compliance + pragmatic + + + resource.kind + xmi + + + + + + org.eclipse.acceleo.ide.ui.acceleoNature + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f42de363afa --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/META-INF/MANIFEST.MF b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..9228e09c908 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/META-INF/MANIFEST.MF @@ -0,0 +1,47 @@ +Manifest-Version: 1.0 +Export-Package: org.eclipse.papyrus.qompass.designer.core, + org.eclipse.papyrus.qompass.designer.core.commands, + org.eclipse.papyrus.qompass.designer.core.deployment, + org.eclipse.papyrus.qompass.designer.core.extensions, + org.eclipse.papyrus.qompass.designer.core.generate, + org.eclipse.papyrus.qompass.designer.core.listeners, + org.eclipse.papyrus.qompass.designer.core.preferences, + org.eclipse.papyrus.qompass.designer.core.sync, + org.eclipse.papyrus.qompass.designer.core.templates, + org.eclipse.papyrus.qompass.designer.core.transformations, + org.eclipse.papyrus.qompass.designer.core.transformations.connector, + org.eclipse.papyrus.qompass.designer.core.transformations.container, + org.eclipse.papyrus.qompass.designer.core.transformations.filters +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.emf.ecore, + org.eclipse.uml2.uml, + org.eclipse.ui.ide, + org.eclipse.core.resources, + org.eclipse.papyrus.fcm.profile;bundle-version="1.2.0", + org.eclipse.papyrus.marte.static.profile;bundle-version="1.2.0", + org.eclipse.papyrus.qompass.designer.vsl;bundle-version="1.2.0", + org.eclipse.papyrus.uml.modelexplorer.widgets;bundle-version="1.2.0", + org.eclipse.papyrus.uml.tools;bundle-version="1.2.0", + org.eclipse.acceleo.engine;bundle-version="3.1.0", + org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core;bundle-version="1.2.0", + org.eclipse.gmf.runtime.common.core;bundle-version="1.7.0", + org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0", + org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.labelprovider;bundle-version="1.2.0", + org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", + org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", + org.eclipse.ui, + org.eclipse.papyrus.codegen.extensionpoints;bundle-version="1.2.0", + org.eclipse.uml2.uml.profile.standard;bundle-version="1.0.100" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.qompass.designer.core.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.core;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/about.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    November 14, 2008

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/about.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/about.properties new file mode 100644 index 00000000000..c06246d0761 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/about.properties @@ -0,0 +1,12 @@ +# about.properties +# contains externalized strings for about.ini +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# fill-ins are supplied by about.mappings +# This file should be translated. + +featureText=Qompass \n\ +\n\ +Copyright (c) 2010 CEA LIST +\n\ +Qompass is a component oriented model based on the connector and container patterns. The implementation produces executable +models a user model and a set of imported model libraries. \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/build.acceleo b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/build.acceleo new file mode 100644 index 00000000000..f1dfcddd5ce --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/build.acceleo @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/build.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/build.properties new file mode 100644 index 00000000000..064ad77eb48 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/build.properties @@ -0,0 +1,12 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + about.properties,\ + build.acceleo,\ + about.html,\ + plugin.properties,\ + schema/ +customBuildCallbacks = build.acceleo +src.includes = about.html diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/plugin.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/plugin.properties new file mode 100644 index 00000000000..25c07e8c396 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus extra: Qompass Designer core (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/plugin.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/plugin.xml new file mode 100644 index 00000000000..48a64c5147e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/plugin.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/pom.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/pom.xml new file mode 100644 index 00000000000..b567a2458a0 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../releng/extra + + org.eclipse.papyrus.qompass.designer.core + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/externalGenerator.exsd b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/externalGenerator.exsd new file mode 100644 index 00000000000..f91f9c1ce35 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/externalGenerator.exsd @@ -0,0 +1,109 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/instanceConfig.exsd b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/instanceConfig.exsd new file mode 100644 index 00000000000..9ebd4f01529 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/instanceConfig.exsd @@ -0,0 +1,109 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/language.exsd b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/language.exsd new file mode 100644 index 00000000000..9e7e950f59b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/language.exsd @@ -0,0 +1,109 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/ooTransformation.exsd b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/ooTransformation.exsd new file mode 100644 index 00000000000..ade738bcc04 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/ooTransformation.exsd @@ -0,0 +1,109 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/xtendGenerator.exsd b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/xtendGenerator.exsd new file mode 100644 index 00000000000..33e2446c5f2 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/schema/xtendGenerator.exsd @@ -0,0 +1,109 @@ + + + + + + + + + [Enter description of this extension point.] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Activator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Activator.java new file mode 100644 index 00000000000..faee3a17083 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Activator.java @@ -0,0 +1,60 @@ +package org.eclipse.papyrus.qompass.designer.core; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.core"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + public static LogHelper log; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + + // register the login helper + log = new LogHelper(plugin); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CORBAtypeNames.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CORBAtypeNames.java new file mode 100644 index 00000000000..641fb676985 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CORBAtypeNames.java @@ -0,0 +1,23 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +public class CORBAtypeNames { + public static final String Octet = "corba::Octet"; //$NON-NLS-1$ + public static final String Long = "corba::Long"; //$NON-NLS-1$ + public static final String UnsignedLong = "corba::UnsignedLong"; //$NON-NLS-1$ + public static final String Short = "corba::Short"; //$NON-NLS-1$ + public static final String UnsignedShort = "corba::UnsignedShort"; //$NON-NLS-1$ +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CommandSupport.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CommandSupport.java new file mode 100644 index 00000000000..1ec058df103 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CommandSupport.java @@ -0,0 +1,118 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import java.util.Collections; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.operations.IOperationHistory; +import org.eclipse.core.commands.operations.IUndoableOperation; +import org.eclipse.core.commands.operations.OperationHistoryFactory; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForHandlers; + +/** + * Utility function. Allow execution of commands on a transactional command stack + * + * @author ansgar + * + */ +public class CommandSupport { + + /** + * Execute the passed Runnable within a command + * + * @param label + * @param command + */ + public static void exec(String label, ExecutionEvent event, final Runnable command) { + ServiceUtilsForHandlers serviceUtils = ServiceUtilsForHandlers.getInstance(); + try { + exec(serviceUtils.getTransactionalEditingDomain(event), label, command); + } catch (ServiceException e) { + Log.log(IStatus.ERROR, Log.UTILS, Messages.CommandSupport_NoEditingDomain, e); + } + } + + /** + * Execute the passed Runnable with result within a command + * + * @param label + * @param command + */ + public static void exec(String label, ExecutionEvent event, final RunnableWithResult command) { + // ServiceUtilsForActionHandlers serviceUtils = ServiceUtilsForActionHandlers.getInstance(); + ServiceUtilsForHandlers serviceUtils = ServiceUtilsForHandlers.getInstance(); + IOperationHistory history = OperationHistoryFactory.getOperationHistory(); + try { + history.execute(new AbstractTransactionalCommand(serviceUtils.getTransactionalEditingDomain(event), + label, Collections.EMPTY_LIST) { + + @Override + public CommandResult doExecuteWithResult(IProgressMonitor dummy, IAdaptable info) { + return command.run(); + } + }, null, null); + } catch (ExecutionException e) { + Log.log(IStatus.ERROR, Log.UTILS, Messages.CommandSupport_ErrorDuringCmdExec, e); + } catch (ServiceException e) { + Log.log(IStatus.ERROR, Log.UTILS, Messages.CommandSupport_NoEditingDomain, e); + } + } + + /** + * Execute the passed Runnable within a command + * + * @param label + * @param command + */ + public static void exec(TransactionalEditingDomain domain, String label, final Runnable command) { + if (domain == null) { + command.run(); + } + else { + IOperationHistory history = OperationHistoryFactory.getOperationHistory(); + try { + history.execute(new AbstractTransactionalCommand(domain, label, Collections.EMPTY_LIST) { + + @Override + public CommandResult doExecuteWithResult(IProgressMonitor dummy, IAdaptable info) { + command.run(); + return CommandResult.newOKCommandResult(); + } + }, null, null); + } catch (ExecutionException e) { + Activator.log.error(e); + } + } + } + + public static void exec(IUndoableOperation command) { + IOperationHistory history = OperationHistoryFactory.getOperationHistory(); + try { + history.execute(command, new NullProgressMonitor(), null); + } catch (ExecutionException e) { + Activator.log.error(e); + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ConfigUtils.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ConfigUtils.java new file mode 100644 index 00000000000..ccd34b07609 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ConfigUtils.java @@ -0,0 +1,93 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.ConfigurationProperty; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Type; + +public class ConfigUtils { + + /** + * Get the configuration properties of a class + * + * @param component + * @return + */ + public static EList getConfigAttributes(Classifier component) { + + EList list = new BasicEList(); + + for (Property part : component.getAllAttributes()) { + if (part instanceof Port) { + continue; + } + Element owner = part.getOwner(); + + if (Utils.allAttributesAreConfigAttributs()) { + // return all attributes + list.add(part); + } + // add all attributes of component types + else if (owner instanceof Class && Utils.isCompType((Class) owner)) { + list.add(part); + } + // otherwise add only attributes tagged as configuration properties + else if (StereotypeUtil.isApplied(part, ConfigurationProperty.class)) { + list.add(part); + } + } + return list; + } + + /** + * Get the configuration attributes behind a container rule + * TODO: rule might not be active - should we still configure it?? + * + * @param aRule + * @return + * @throws TransformationException + */ + public static EList getConfigAttributes(ContainerRule rule) throws TransformationException { + EList list = new BasicEList(); + Class composite = rule.getBase_Class(); // a rule should always have a base class, unless malformed + if (composite == null) { + throw new TransformationException(Messages.ConfigUtils_RuleWithoutBaseClass); + } + for (Property part : composite.getAttributes()) { + if (part instanceof Port) { + continue; + } + Type type = part.getType(); + if (StereotypeUtil.isApplied(part, ConfigurationProperty.class)) { + list.add(part); + } + if (type instanceof Class) { + list.addAll(getConfigAttributes((Class) type)); + } + } + + return list; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CreationUtils.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CreationUtils.java new file mode 100644 index 00000000000..517d8822117 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/CreationUtils.java @@ -0,0 +1,81 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Namespace; +import org.eclipse.uml2.uml.Package; + +public class CreationUtils { + + /** + * This function returns a Package reference that corresponds to a qualified name. + * Packages are created, if not existing yet - the function is thus a bit similar to + * the unix mkdir -p command. Note that the main model within the list of name-spaces is + * ignored, in order to avoid that a sub-package within a model starts with the name + * of the model. + * + * Caveat: imported elements must be checked beforehand. In case of a package import, + * getMembers (and getImportedMembers) will not return the name of the imported model + * but the elements (directly) owned by the imported model. + * Example: getMember ("BasicTypes") will return null whereas getMember ("CORBA") + * returns a package (CORBA is a package within the model library BasicTypes) + * + * @param model + * a model + * @param list + * a list of namespace elements (as can be obtained via allNamespaces), + * the top-level element is the last within the list. + * @param skipTop + * if true, skip top level namespace element + * @return + */ + public static Package getAndCreate(Package root, EList list, boolean skipTop) { + int offset = (skipTop ? 2 : 1); + for (int i = list.size() - offset; i >= 0; i--) { + Namespace ns = list.get(i); + Log.log(IStatus.INFO, Log.UTILS, "getAndCreate:" + ns.getName()); //$NON-NLS-1$ + + NamedElement pkg = root.getOwnedMember(ns.getName()); + if (pkg == null) { + // package does not exist => create it. + pkg = root.createNestedPackage(ns.getName()); + LazyCopier.copyID(ns, pkg); + // copy stereotype to create package + StUtils.copyStereotypes(ns, pkg); + } + if (!(pkg instanceof Package)) { + break; + } + root = (Package) pkg; + } + return root; + } + + public static Package getAndCreate(Package root, EList list) { + return getAndCreate(root, list, true); + } + + public static Package getAndCreate(Package root, String name) { + NamedElement pkg = root.getMember(name); + if (pkg == null) { + pkg = root.createNestedPackage(name); + } + return (Package) pkg; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Description.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Description.java new file mode 100644 index 00000000000..58868c69112 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Description.java @@ -0,0 +1,83 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import org.eclipse.uml2.uml.Comment; +import org.eclipse.uml2.uml.Element; + +public class Description { + + /** + * Return a description of an element. By default search comments that are + * owned by this elements owner (e.g. the class, if we search for a description of a property or the owning package, + * if we search for a description of a class) + * + * @param element + * the element for which to obtain a description + * @return the description of the element + */ + public static String getDescription(Element element) { + return getDescription(element.getOwner(), element); + } + + /** + * Convenience function: Return a description of an element. It will delegate to + * default getDescription, but returns a user specified text, if a description is + * not available in the model. + * + * @param element + * @param unavailable + * The text that is return, if no description is available + * @return + */ + public static String getDescription(Element element, String unavailable) { + String description = getDescription(element); + if (description != null) { + return description; + } + else { + return unavailable; + } + } + + /** + * Return a description or implementation description of an element, i.e. the + * first owned comment that annotated the passed element + * + * @param the + * owner of the comment + * the element for which to obtain a description + * @param annotated + * element + * the element for which to obtain a description + * @return the description of the element + */ + public static String getDescription(Element owner, Element annotatedElement) { + if (owner == null) { + return null; + } + // loop over all owned comments, check those that begins with + // "description" + for (Comment comment : owner.getOwnedComments()) { + // identify "right" comment via annotated element ref (to a specific + // class of the BasicCalls library) instead? + if (comment.getAnnotatedElements().contains(annotatedElement)) { + return comment.getBody(); + } + + } + return Messages.Description_NoAvail; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ElementFilter.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ElementFilter.java new file mode 100644 index 00000000000..297433c35a6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ElementFilter.java @@ -0,0 +1,7 @@ +package org.eclipse.papyrus.qompass.designer.core; + +import org.eclipse.uml2.uml.Element; + +public interface ElementFilter { + public boolean acceptElement(Element element); +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/EnumService.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/EnumService.java new file mode 100644 index 00000000000..0062ec0809f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/EnumService.java @@ -0,0 +1,151 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Dependency; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Enumeration; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.UMLPackage; + + +/** + * Manage enumerations within Acceleo code + */ +public class EnumService { + + private static final String GLOBALENUMS = "globalenums"; //$NON-NLS-1$ + + public static void init() { + enumHash.clear(); + } + + /** + * Return qualified name of enum package which is used to prefix enumerations (namespace) + * + * @param dummy + * @return + */ + public static String enumSvcPrefix() { + return enumPkg.getQualifiedName(); + } + + public static String literalKey(Element dummy, String enumName, String literalKey) { + String prefix = "ID_"; //$NON-NLS-1$ + String literal = ""; //$NON-NLS-1$ + if (literalKey.equals("Port")) { //$NON-NLS-1$ + literal = prefix + TransformationContext.port.getName(); + } + else if (literalKey.equals("Formal")) { //$NON-NLS-1$ + literal = prefix + TransformationContext.formalParameter.getName(); + } + else if (literalKey.equals("Instance")) { //$NON-NLS-1$ + literal = prefix + TransformationContext.instance.getName(); + } + else if (literalKey.equals("Interface")) { //$NON-NLS-1$ + literal = prefix + TransformationContext.classifier.getName(); + } + return literal(enumName, literal); + } + + public static String quoteLiteral(Element dummy, String enumName, String literal) { + return Utils.quoteString(literal(enumName, literal)); + } + + /** + * Create a literal within an enumeration. Both, the literal and the enumeration may be an + * Acceleo template. If the name of the enumeration starts with "L", it is considered as a + * local enumeration, i.e. a nested classifier within the classifier (it has to be a class) + * from the transformation context. + * + * @param enumName + * the name of an enumeration + * @param literal + * the name of a literal within that enumeration. + * @return + */ + public static String literal(String enumName, String literal) { + Enumeration enumeration = enumHash.get(enumName); + if (enumPkg == null) { + return literal; + } + if (enumeration == null) { + if (enumName.startsWith("L")) { //$NON-NLS-1$ + // magic prefix for class local + enumeration = (Enumeration) + ((Class) TransformationContext.classifier).createNestedClassifier(enumName, UMLPackage.eINSTANCE.getEnumeration()); + } + else { + enumeration = enumPkg.createOwnedEnumeration(enumName); + } + enumHash.put(enumName, enumeration); + } + if (enumeration.getOwnedLiteral(literal) == null) { + enumeration.createOwnedLiteral(literal); + } + // declare a dependency to the enumeration from the current classifier + checkAndCreateDependency(TransformationContext.classifier, enumeration); + + if (enumName.startsWith("L")) { //$NON-NLS-1$ + return literal; + } + else { + return GLOBALENUMS + "::" + literal; //$NON-NLS-1$ + } + } + + /** + * Create a dependency between the passed classifier, target pair. The objective + * of this function is that code generators do the necessary to assure that the + * target is known within the classifier (e.g. include directives) + * + * @param classifier + * a classifier + * @param target + * a target, on which the classifier or its code depends. + */ + public static void checkAndCreateDependency(Classifier classifier, NamedElement target) { + boolean found = false; + for (Dependency dep : classifier.getClientDependencies()) { + if (dep.getSuppliers().contains(target)) { + found = true; + } + } + if (!found) { + Dependency dep = classifier.createDependency(target); + dep.setName(String.format("from %s to %s", classifier.getName(), target.getName())); //$NON-NLS-1$ + } + } + + public static void createEnumPackage(Package root) { + init(); + enumPkg = root.createNestedPackage(GLOBALENUMS); + } + + public static Package enumPkg; + + public static void createEnums() { + + } + + private static Map enumHash = new HashMap(); +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Log.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Log.java new file mode 100644 index 00000000000..27777c02ea8 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Log.java @@ -0,0 +1,99 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; + +/** + * Very simple message logging class + * + * @author ansgar + * + */ +public class Log { + + public static final int TRAFO_CONNECTOR = 1; + + public static final int TRAFO_CONTAINER = 2; + + public static final int TRAFO_COPY = 4; + + public static final int TRAFO_SYNC = 8; + + public static final int TEMPLATE_BINDING = 0x10; + + public static final int TEMPLATE_INSTANTIATION = 0x20; + + public static final int DEPLOYMENT = 0x40; + + public static final int DIALOGS = 0x80; + + public static final int UTILS = 0x100; + + public static final int CODEGEN = 0x200; + + public static final int CALC_PORTKIND = 0x400; + + static Map moduleMap; + + static String getModuleInfo(int moduleKind) { + if (moduleMap == null) { + moduleMap = new HashMap(); + moduleMap.put(TRAFO_CONNECTOR, "Trafo connector"); //$NON-NLS-1$ + moduleMap.put(TRAFO_CONTAINER, "Trafo container"); //$NON-NLS-1$ + moduleMap.put(TRAFO_COPY, "Trafo copy"); //$NON-NLS-1$ + moduleMap.put(TRAFO_SYNC, "Synchronization"); //$NON-NLS-1$ + moduleMap.put(TEMPLATE_BINDING, "Template binding"); //$NON-NLS-1$ + moduleMap.put(TEMPLATE_INSTANTIATION, "Template instantiation"); //$NON-NLS-1$ + moduleMap.put(DEPLOYMENT, "Template binding"); //$NON-NLS-1$ + moduleMap.put(DIALOGS, "Qompass dialogs"); //$NON-NLS-1$ + moduleMap.put(UTILS, "Utils"); //$NON-NLS-1$ + moduleMap.put(CODEGEN, "Code generation"); //$NON-NLS-1$ + moduleMap.put(CALC_PORTKIND, "Calculate portkind"); //$NON-NLS-1$ + } + return "Module " + moduleMap.get(moduleKind) + ": "; //$NON-NLS-1$ //$NON-NLS-2$ + } + + public static void log(int msgKind, int moduleKind, String message) { + if (msgKind == IStatus.INFO) { + // only show info messages that match a filter criterion + if ((moduleKind & moduleFilter) != 0) { + Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, message)); + } + } + else { + Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, message)); + } + } + + public static void log(int msgKind, int moduleKind, String message, Exception exception) { + if (msgKind == IStatus.INFO) { + // only show info messages that match a filter criterion + if ((moduleKind & moduleFilter) != 0) { + Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, exception.getMessage(), exception)); + } + } + else { + Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, exception.getMessage(), exception)); + } + } + + // TODO: make it a configuration property + static int moduleFilter = 0; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Messages.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Messages.java new file mode 100644 index 00000000000..645e06be789 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Messages.java @@ -0,0 +1,128 @@ +package org.eclipse.papyrus.qompass.designer.core; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.qompass.designer.core.messages"; //$NON-NLS-1$ + + public static String BootLoaderGen_AtLeastOneBlockingCall; + + public static String BootLoaderGen_CannotApplyCppInclude; + + public static String BootLoaderGen_CannotRetrieveTemplate; + + public static String CommandSupport_NoEditingDomain; + public static String CommandSupport_ErrorDuringCmdExec; + public static String ConfigUtils_RuleWithoutBaseClass; + public static String DepCreation_SingletonExistsAlready; + + public static String DepCreation_CannotFindImplementation; + + public static String DepCreation_CircularReference; + + public static String DepCreation_DefiningFeatureNull; + + public static String DepCreation_FCMconnectorWithoutBaseClass; + + public static String DepCreation_InfoCreateDepPlan; + + public static String DepCreation_TypeInAttributeUndefined; + + public static String Deploy_0; + + public static String Description_NoAvail; + + public static String LWContainerTrafo_CannotApplyRule; + + public static String ConnectorBinding_CannotFindBinding; + public static String ConnectorBinding_CannotFindBindingForPort; + public static String ConnectorBinding_CannotFindConsistentBinding; + public static String ConnectorBinding_ConnectorsPort; + public static String ConnectorBinding_FormalAlreadyBound; + public static String ConnectorBinding_InfoActualReturnIntfIs; + public static String ConnectorBinding_InfoConnPortConnectedVia; + public static String ConnectorBinding_InfoConnectsPort; + public static String ConnectorBinding_InfoCreateBoundPackage; + + public static String ConnectorBinding_InfoMatchOtherEnd; + + public static String ConnectorBinding_InfoProvidedPortTypeMatches; + public static String ConnectorBinding_NoTemplateSignature; + + public static String ConnectorReification_CannotFindMatchingPort; + public static String ConnectorReification_CouldNotBind; + public static String ConnectorReification_CouldNotConnectPort; + public static String ConnectorReification_CouldNotConnectPortOfType; + public static String ConnectorReification_InfoAddConnectorPart; + public static String ConnectorReification_InfoPortTypes; + public static String ConnectorReification_RequiresUseOfPorts; + public static String ConnectorReification_TemplateTypeNotClass; + + public static String GenerateCode_CouldNotDeleteOldCode; + public static String GenerateCode_GeneratingCodeForNode; + public static String GenerateCode_GeneratingCode; + + public static String TemplateUtils_InfoCreateBoundPackage; + public static String TemplateUtils_InfoGetActualFrom; + public static String TemplateUtils_NoTemplateSignature; + + public static String TemplateInstantiation_TemplateIsNull; + public static String TemplateInstantiationListener_TrafoException; + + public static String CompImplTrafos_CannotFindType; + public static String CompImplTrafos_IntfNotImplemented; + public static String CompTypeTrafos_CannotFindType; + + public static String ContainerTrafo_CannotApplyRule; + public static String ContainerTrafo_CannotFindDelegationConn; + public static String ContainerTrafo_InterceptionRuleButNoInterceptor; + + public static String ContainerTrafo_RecursiveLWnotSupported; + + public static String InstanceConfigurator_InvalidPluginExtension; + + public static String InstantiateDepPlan_AcceleoErrors; + public static String InstantiateDepPlan_AcceleoErrorsCheckLog; + public static String InstantiateDepPlan_CannotGenModel; + public static String InstantiateDepPlan_CheckInputImportPkg; + public static String InstantiateDepPlan_CheckInputImportPkgNoRes; + public static String InstantiateDepPlan_CheckInputModelProfile3; + public static String InstantiateDepPlan_CheckInputModelProfileNoRes; + public static String InstantiateDepPlan_CheckInputModelProfileNoResNoName; + public static String InstantiateDepPlan_ConsultConsole; + public static String InstantiateDepPlan_DepPlanStereotypeNotInitialized; + public static String InstantiateDepPlan_ErrorsDuringTransformation; + public static String InstantiateDepPlan_IllegalArgumentDuringCopy; + public static String InstantiateDepPlan_InfoApplyProfile; + public static String InstantiateDepPlan_InfoDeployingForNode; + public static String InstantiateDepPlan_InfoExpandingConnectors; + public static String InstantiateDepPlan_InfoGeneratingModel; + public static String InstantiateDepPlan_InfoImportPackage; + public static String InstantiateDepPlan_InfoNoneAllocated; + public static String InstantiateDepPlan_TransformationException; + + public static String MainModelTrafo_ChangePartType; + public static String MainModelTrafo_NoDefiningFeature; + public static String MainModelTrafo_NoInstanceAssociated; + + public static String CompImplSync_InfoSyncIntf; + public static String CompImplSync_InfoSyncViaImpl; + public static String CompImplSync_InfoSyncViaType; + + public static String DepPlanUtils_CannotFindAttribute; + public static String DepPlanUtils_ConfigOfPropertyFailed; + + public static String UpdateUtils_CannotApplyFCMstereo; + + public static String XtendTemplateBinding_TemplateNotFound; + + public static String XtendTemplateBinding_TemplateResultIsNotAString; + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ModelManagement.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ModelManagement.java new file mode 100644 index 00000000000..2971bbff614 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ModelManagement.java @@ -0,0 +1,174 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import java.io.IOException; +import java.util.Iterator; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.uml2.common.util.UML2Util; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Model; +import org.eclipse.uml2.uml.UMLFactory; +import org.eclipse.uml2.uml.UMLPackage; + + +/** + * Manages a model (and the associated resource). Allows saving this model. It uses its own static resource set. + * + */ +public class ModelManagement { + + /** + * Create a new model and associate it with a temporary + * resource + */ + public ModelManagement() { + getResourceSet(); + model = UMLFactory.eINSTANCE.createModel(); + resource = resourceSet.createResource(URI.createURI("temp.uml")); //$NON-NLS-1$ + resource.getContents().add(model); + } + + public void dispose() { + if (model != null) { + model.destroy(); + model = null; + } + resourceSet.getResources().remove(resource); + } + + /** + * provide access to the model + * @return the model amanaged by this instance of model manager + */ + public Model getModel() { + return model; + } + + /** + * Save a model within the given project at a default location. + * This location is [model.name/].uml within the project root. + * @link ModelManagement.getPath + * + * @param project + * an existing project + */ + public void saveModel(IProject project) { + saveModel(getPath(project, null, null)); + } + + /** + * Save the model within a given project, folder and postfix + * @param project + * @param modelFolder + * @param modelPostfix + */ + public void saveModel(IProject project, String modelFolder, String modelPostfix) { + String path = this.getPath(project, modelFolder, this.getModel().getName() + modelPostfix); + this.saveModel(path); + } + + /** + * Save a model using the passed path + * + * @param path A string representation of the path. It will be converted into a URI + */ + public void saveModel(String path) { + + try { + URI uri = URI.createURI(path); + + ResourceSetImpl resourceSet = new ResourceSetImpl(); + resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE); + + resource.setURI(uri); + EList contents = resource.getContents(); + + for (Iterator allContents = UML2Util.getAllContents(model, true, false); allContents.hasNext();) { + EObject eObject = allContents.next(); + + if (eObject instanceof Element) { + contents.addAll(((Element) eObject).getStereotypeApplications()); + } + } + resource.save(null); + } + catch (IOException e) { + Activator.log.error(e); + } + } + + /** + * Return a path based on project, folder and file name + * + * @param project + * an existing project + * @param subFolder + * a subfolder within the project (will be created, if it does not exist) + * if null, the project will be saved in the root of the project + * @param filename + * the name of the file or null (in his case, the name of the + * model with the postfix .uml is used) + * + * @return The access path to a file + */ + public String getPath(IProject project, String subFolder, String filename) { + IFile file; + if (filename == null) { + filename = model.getName() + ".uml"; //$NON-NLS-1$ + } + if (subFolder != null) { + IFolder ifolder = project.getFolder(subFolder); + if (!ifolder.exists()) { + try { + ifolder.create(false, true, null); + } catch (CoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + file = ifolder.getFile(filename); + } else { + file = project.getFile(filename); + } + return file.getFullPath().toString(); + } + + /** + * return the used resource set (a singleton) + */ + public static ResourceSet getResourceSet() { + if (resourceSet == null) { + resourceSet = new ResourceSetImpl(); + } + return resourceSet; + } + + private static ResourceSet resourceSet = null; + + private Model model; + + private Resource resource; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/OperationUtils.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/OperationUtils.java new file mode 100644 index 00000000000..cdd17f48716 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/OperationUtils.java @@ -0,0 +1,166 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import java.util.Iterator; + +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Type; + +public class OperationUtils { + + /** + * Search an identical operation within a class. + * This function is useful to identify (and synchronize) operations. + * + * @param op + * The operation that should be compared. + * @param owner + * @return + */ + public static Operation getSameOperation(Operation op, Class owner) { + for (Operation ownedOp : owner.getOwnedOperations()) { + if (isSameOperation(op, ownedOp)) { + return ownedOp; + } + } + return null; + } + + /** + * Returns true, if two operations are identical. + * An operation is considered identical, if the operation name as well as all + * parameter names and types are equal. Type equality is checked via names only, to + * avoid that identical types within a source and a copy model would yield false. + * + * @param op1 + * first operation + * @param op2 + * second operation + * @return true, if operations are identical + */ + public static boolean isSameOperation(Operation op1, Operation op2) { + return isSameOperation(op1, op2, true); + } + + + /** + * Returns true, if two operations are identical with optional name check. + * An operation is considered identical, if the operation name (optional) as well as all + * parameter names and types are equal. Type equality is checked via names only, to + * avoid that identical types within a source and a copy model would yield false. + * + * @param op1 + * first operation + * @param op2 + * second operation + * @param checkName + * if true, require that operation names are identical + * @return true, if operations are identical + */ + public static boolean isSameOperation(Operation op1, Operation op2, boolean checkName) { + + if (checkName) { + String op1Name = op1.getName(); + String op2Name = op2.getName(); + // one of the names might be null + if (op1Name == null) { + if (op2Name != null) { + return false; + } + } else if (!op1Name.equals(op2Name)) { + return false; + } + } + Iterator parameters1 = op1.getOwnedParameters().iterator(); + Iterator parameters2 = op2.getOwnedParameters().iterator(); + while (parameters1.hasNext() && parameters2.hasNext()) { + Parameter parameter1 = parameters1.next(); + Parameter parameter2 = parameters2.next(); + String par1Name = parameter1.getName(); + Type par1Type = parameter1.getType(); + String par2Name = parameter2.getName(); + Type par2Type = parameter2.getType(); + + // one of the names might be null + if (par1Name == null) { + if (par2Name != null) { + return false; + } + } else if (!par1Name.equals(par2Name)) { + return false; + } + if ((par1Type != null) && (par2Type != null)) { + // the names might be null. Return false, if only one of these is set + if (par1Type.getName() == null) { + if (par2Type.getName() != null) { + return false; + } + } + else if (!par1Type.getName().equals(par2Type.getName())) { + return false; + } + } else if (par1Type != par2Type) { + // at least one of the two must be null due to earlier check + // return false, if they are different, i.e. not both null + return false; + } + if ((parameter1.getUpper() != parameter2.getUpper()) || + (parameter1.getLower() != parameter2.getLower())) { + return false; + } + } + // true, if operations have same number of parameters + return (parameters1.hasNext() == parameters2.hasNext()); + } + + + /** + * synchronize source and target operation + * (remove all parameters, copy afterwards) + * + * @param sourceOp + * the source operation + * @param targetOp + * the target operation + * @param newRoot + * a new root package (e.g. another model). Ensure that types referenced by the + * parameter exist within this root package (copy, if not). Null indicates that no copying + * should be done. + * @return + */ + public static void syncOperation(Operation sourceOp, Operation targetOp) { + if (targetOp != null) { + LazyCopier.copyFeatureModifiers(sourceOp, targetOp); + // ordered and unique are derived from ret-parameter + targetOp.setIsQuery(sourceOp.isQuery()); + targetOp.setIsAbstract(sourceOp.isAbstract()); + targetOp.setName(sourceOp.getName()); + targetOp.getOwnedParameters().clear(); + for (Parameter parameter : sourceOp.getOwnedParameters()) { + Type type = parameter.getType(); + Parameter newParameter = + targetOp.createOwnedParameter(parameter.getLabel(), type); + newParameter.setDirection(parameter.getDirection()); + LazyCopier.copyMultElemModifiers(parameter, newParameter); + StUtils.copyStereotypes(parameter, newParameter); + } + } + StUtils.copyStereotypes(sourceOp, targetOp); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortInfo.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortInfo.java new file mode 100644 index 00000000000..ad70a8b6ce0 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortInfo.java @@ -0,0 +1,139 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Port; + +/** + * Information about a port that might belong to an extended port + * It provides information about that port while taking the (optional) parent + * port into account + */ +public class PortInfo { + /** + * Create a new portInfo. + * + * @param port + * @param parentPort + * optional parent port (null, if no parent port exist, i.e. if this is not an extended port) + */ + public PortInfo(Port port, Port parentPort) { + this.port = port; + this.parentPort = parentPort; + } + + /** + * Create a new port info for a combination of Port and sub-port. Compared to the constructor, + * the order of sub and parent port is inverted. The function is useful, if the sub-port is optional + * + * @param port + * a port + * @param subPort + * an optional supPort. + * @return + */ + public static PortInfo fromSubPort(Port port, Port subPort) { + if (subPort != null) { + return new PortInfo(subPort, port); + } + else { + return new PortInfo(port, null); + } + } + + /** + * @return The name of a port. Might be a composite name in case of an extended port + */ + public String getName() { + if (parentPort != null) { + return parentPort.getName() + "_" + port.getName(); //$NON-NLS-1$ + } + else { + return port.getName(); + } + } + + /** + * @return the interface provided by a port or sub-port. Takes conjugation of the parent port into account + */ + public Interface getProvided() { + if ((parentPort != null) && parentPort.isConjugated()) { + return PortUtils.getRequired(port); + } + else { + return PortUtils.getProvided(port); + } + } + + /** + * @return the interface required by a port or sub-port. Takes conjugation of the parent port into account + */ + public Interface getRequired() { + if ((parentPort != null) && parentPort.isConjugated()) { + return PortUtils.getProvided(port); + } + else { + return PortUtils.getRequired(port); + } + } + + /** + * @return true, if port is conjugated. Takes conjugation of the parent port into account + */ + public boolean isConjugated() { + if (parentPort != null) { + return port.isConjugated() != parentPort.isConjugated(); + } + else { + return port.isConjugated(); + } + } + + /** + * TODO: take multiplicity of parent-port into account + * + * @return upper multiplicity of port + */ + public int getUpper() { + return port.getUpper(); + } + + /** + * @return the described port or sub-port + */ + public Port getPort() { + return port; + } + + /** + * @return Return the port of the original model, i.e. the parent port, if the port is actually + * a sub-port or the original port, if it is not. + * This function is useful for testing delegation relationships (which could not exist for a + * sub-port) + */ + public Port getModelPort() { + if (parentPort != null) { + return parentPort; + } + else { + return port; + } + } + + protected Port port; + + protected Port parentPort; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortUtils.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortUtils.java new file mode 100644 index 00000000000..9c60af571ef --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/PortUtils.java @@ -0,0 +1,312 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.PortKind; +import org.eclipse.papyrus.FCM.TemplatePort; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.EncapsulatedClassifier; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.util.UMLUtil; + +public class PortUtils { + + /** + * Return the provided interface associated with the UML port, i.e. + * the derived attribute of the FCM profile + * + * @param port + * the UML port + * @return the provided interface + */ + public static Interface getProvided(Port port) { + if (port.getProvideds().size() > 0) { + // return first standard UML provided port + return port.getProvideds().get(0); + } + return null; + } + + /** + * Return the required interface associated with the UML port, i.e. + * the derived attribute of the FCM profile + * + * @param port + * the UML port + * @return the required interface + */ + public static Interface getRequired(Port port) { + if (port.getRequireds().size() > 0) { + // return first standard UML required port + return port.getRequireds().get(0); + } + return null; + } + + /** + * Return the FCM port (static profile) from a given UML port + * + * @param port + * @return + */ + public static org.eclipse.papyrus.FCM.Port getFCMport(Port port) { + return UMLUtil.getStereotypeApplication(port, org.eclipse.papyrus.FCM.Port.class); + } + + /** + * Return the value of the FCM stereotype attribute "type" + * @param port a UML port + * @return the value of the type attribute + */ + public static Type getFCMType(Port port) { + org.eclipse.papyrus.FCM.Port fcmPort = getFCMport(port); + if (fcmPort != null) { + return fcmPort.getType(); + } + return null; + } + + /** + * Returns all ports (including inherited ones) for an encapsulated classifier + * It will also flatten extended ports + * + * @param ec + * @return + */ + public static EList getAllPorts(EncapsulatedClassifier ec) { + EList ports = new BasicEList(); + for (Property attribute : ec.getAllAttributes()) { + if (attribute instanceof Port) { + ports.add((Port) attribute); + } + } + + // TODO: for the moment, don't add aggregated ports to list. + /* + * ComponentType compType = = UMLUtil.getStereotypeApplication (ec, ComponentType.class); + * for (ContainerRule rule : compType.getContainerRule ()) + * { + * if ((rule.getExtensionKind () == ContainerExtKind.AGGREGATION) && + * (rule.getExtension () != null)) { + * ports.addAll (getAllPorts (rule.getExtension ().getBase_Class ())); + * } + * } + */ + + return ports; + } + + /** + * Returns all ports for an encapsulated classifier. Inherited ports are + * included, except if the superclass is already a component implementation. + * The motivation for this function is that ports inherited by a + * component implementation have already corresponding operations/attributes, + * only ports inherited by types need these definitions in subclasses. + * TODO: support for abstract implementations that partially implement ports + * + * @param ec + * @return + */ + public static EList getAllPorts2(EncapsulatedClassifier ec) { + EList ports = new BasicEList(); + + ports.addAll(ec.getOwnedPorts()); + + for (Classifier general : ec.getGenerals()) { + if ((general instanceof EncapsulatedClassifier) && (!Utils.isCompImpl(general))) { + ports.addAll(getAllPorts2((EncapsulatedClassifier) general)); + } + } + return ports; + } + + /** + * When given a list of ports, flatten the extended ports within this list + * and return a list of port-infos, i.e. information about ports. + * + * @param ports + * A list of ports + * @return A list of port-infos + */ + public static EList flattenExtendedPorts(EList ports) { + EList portInfos = new BasicEList(); + for (Port port : ports) { + portInfos.addAll(flattenExtendedPort(port)); + } + return portInfos; + } + + + /** + * Flatten the given extended port and return a list of port-infos. + * + * @param port + * @return + */ + public static EList flattenExtendedPort(Port port) { + EList portInfos = new BasicEList(); + if (isExtendedPort(port)) { + org.eclipse.papyrus.FCM.Port fcmPort = getFCMport(port); + org.eclipse.uml2.uml.Class cl; + if (isTemplatePort(port)) { + TemplatePort tp = UMLUtil.getStereotypeApplication(port, TemplatePort.class); + if (tp.getBoundType() == null) { + Activator.log.debug("Bound type of template port is null, choosing base class of kind instead"); //$NON-NLS-1$ + cl = fcmPort.getKind().getBase_Class(); + } + else { + cl = tp.getBoundType().getBase_Class(); + } + } + else { + cl = fcmPort.getKind().getBase_Class(); + } + if ((cl != null) && (getAllPorts(cl).size() > 0)) { + EList extendedPorts = getAllPorts(cl); + for (Port extendedPort : extendedPorts) { + portInfos.add(new PortInfo(extendedPort, port)); + } + } + } + else { + portInfos.add(new PortInfo(port, null)); + } + return portInfos; + } + + /** + * Return true, if the passed port is an extended port + * + * @param port + * @return + */ + public static boolean isExtendedPort(Port port) { + org.eclipse.papyrus.FCM.Port fcmPort = getFCMport(port); + if ((fcmPort != null) && (fcmPort.getKind() != null)) { + org.eclipse.uml2.uml.Class cl = fcmPort.getKind().getBase_Class(); + return ((cl != null) && (getAllPorts(cl).size() > 0)); + } + return false; + } + + /** + * Return true, if the passed port is an extended port + * + * @param port + * @return + */ + public static boolean isTemplatePort(Port port) { + return StereotypeUtil.isApplied(port, TemplatePort.class); + } + + /** + * Return the port kind, an element of the static profile + * + * @param port + * @return + */ + public static PortKind getKind(Port port) { + org.eclipse.papyrus.FCM.Port fcmPort = getFCMport(port); + if (fcmPort != null) { + return fcmPort.getKind(); + } + return null; + } + + /** + * Check whether two ports have the same port kind. Since different models apparently + * use different Java instances for the same port kind, the check is therefore based + * on the equality of full qualified name. + * + * @param portA + * @param portB + * @return true, if port kinds are identical + */ + public static boolean sameKinds(Port portA, Port portB) { + PortKind kindA = getKind(portA); + PortKind kindB = getKind(portB); + return kindA == kindB; + } + + /** + * Check whether two ports match, i.e. have the same kind but different conjugation (assembly) + * or same (delegation) + * + * @param portA + * first port + * @param portB + * second port + * @param isAssembly + * true, if the ports should be connected by an assembly connector (i.e. no delegation) + * @return true, if ports match + */ + public static boolean matches(Port portA, Port portB, boolean isAssembly) { + if (isAssembly) { + return ((portA.getType() == portB.getType()) && sameKinds(portA, portB) && (portA.isConjugated() != portB.isConjugated())); + } else { + // delegation + return ((portA.getType() == portB.getType()) && sameKinds(portA, portB) && (portA.isConjugated() == portB.isConjugated())); + } + } + + /** + * Check whether two ports are compatible. i.e. either match or are compatible interface wise + * + * @param portA + * @param portB + * @param isAssembly + * true, if the ports should be connected by an assembly connector (i.e. no delegation) + * @return + */ + public static boolean isCompatible(Port portA, Port portB, boolean isAssembly) { + if (matches(portA, portB, isAssembly)) { + return true; + } + // no match found, try weaker condition: find 1st match for provided ... + if (isAssembly) { + Interface reqA = PortUtils.getRequired(portA); + Interface reqB = PortUtils.getRequired(portB); + Interface prodA = PortUtils.getProvided(portA); + Interface prodB = PortUtils.getProvided(portB); + return (((reqA == null) && isSubInterface(prodA, reqB)) + || ((reqB == null) && isSubInterface(prodB, reqA)) + || (isSubInterface(prodA, reqB) && isSubInterface(prodB, reqA))); + } + else { + return (PortUtils.getProvided(portA) == PortUtils.getProvided(portB)) && + (PortUtils.getRequired(portB) == PortUtils.getRequired(portA)); + } + } + + /** + * return true, if intfA is a sub-interface of intfB, i.e. either both interfaces are identical or one of the + * super-classes (generalizations of intfA) is identical to B. + * more general than interfaceB. + * + * @param intfA + * @param intfB + * @return + */ + public static boolean isSubInterface(Interface intfA, Interface intfB) { + return (intfA == intfB) || (intfA != null && intfA.getGeneralizations().contains(intfB)); + } +} + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ProjectManagement.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ProjectManagement.java new file mode 100644 index 00000000000..3f66f3752a2 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/ProjectManagement.java @@ -0,0 +1,55 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IFileEditorInput; +import org.eclipse.ui.PlatformUI; + +// TODO: mixture of model and Eclipse project management. Move parts depending on CDT into +// a separate plugin + +public class ProjectManagement { + + /** + * Retrieve current project from active editor + * + * @return + */ + public static IProject getCurrentProject() { + IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); + // Maybe null, if opened via model explorer + if (editorPart == null) { + return null; + } + IEditorInput editorInput = editorPart.getEditorInput(); + if (editorInput instanceof IFileEditorInput) { + return ((IFileEditorInput) editorInput).getFile().getProject(); + } + return null; + } + + public static IProject getNamedProject(String projectName) { + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + if (root != null) { + return root.getProject(projectName); + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/RunnableWithResult.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/RunnableWithResult.java new file mode 100644 index 00000000000..6ebca20a768 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/RunnableWithResult.java @@ -0,0 +1,29 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import org.eclipse.gmf.runtime.common.core.command.CommandResult; + +public interface RunnableWithResult { + + /** + * Execute a command + * + * @return CommandResult.newOKCommandResult() if successful + * CommandResult.newErrorCommandResult(..) or + * CommandReuslt.newCancelCommandResult(..) otherwise + */ + public CommandResult run(); +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/StUtils.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/StUtils.java new file mode 100644 index 00000000000..b58b188edc5 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/StUtils.java @@ -0,0 +1,170 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Extension; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Stereotype; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Some functions around stereotype usage. + * + * @author ansgar + * + */ +public class StUtils { + + /** + * Copy the stereotype application from a source to a destination element. The + * function will also copy the stereotype attributes. + * + * @param source + * @param destination + * @return + */ + public static void copyStereotypes(LazyCopier copy, Element source, Element destination) { + for (Stereotype stereotype : source.getAppliedStereotypes()) { + copyAttributes(copy, stereotype.getQualifiedName(), source, destination); + } + } + + public static void copyStereotypes(Element source, Element destination) { + copyStereotypes(null, source, destination); + } + + /** + * copy stereotype attributes. + * + * TODO: verify if it is necessary to distinguish between stereoSource and stereoDest + * (they should be identical, if the resource sets are). + * => simplify code + * + * @param stereotypeName + * @param source + * @param destination + * @return + */ + @SuppressWarnings({ "unchecked" }) + public static boolean copyAttributes(LazyCopier copy, String stereotypeName, Element source, Element destination) { + Stereotype stereoSource = source.getAppliedStereotype(stereotypeName); + Stereotype stereoDest = destination.getApplicableStereotype(stereotypeName); + + if ((stereoSource == null) || (stereoDest == null)) { + return false; + } + Stereotype alreadyApplied = destination.getAppliedStereotype(stereotypeName); + if (alreadyApplied == null) { + // only apply stereotype, if not already applied + destination.applyStereotype(stereoDest); + } + + // getAllAttributes? (but have to avoid attribute base_Class which resets stereotype application) + for (Property attribute : stereoSource.getAllAttributes()) { + String attrName = attribute.getName(); + + if (attrName.length() >= 5) { + // do not copy base_ stereotypes (base_class, base_package and base_PackageImport) + if (attrName.startsWith(Extension.METACLASS_ROLE_PREFIX)) { + continue; + } + } + // do not copy derived attributes + if (attribute.isDerived()) { + continue; + } + + Object value = source.getValue(stereoSource, attrName); + // handle specific case: need to copy referenced containerExt, since it points to element + // in the original model. + /* + * if ((value instanceof EObject) && (attrName.equals ("containerExt"))) { + * continue; + * } + */ + + if (value instanceof EList) { + // copy list + EList newList = new BasicEList(); + for (Object valueEl : (EList) value) { + if ((copy != null) && (valueEl instanceof Element)) { + newList.add(copy.getCopy((Element) valueEl)); + } else { + newList.add(valueEl); + } + } + if (newList.size() > 0) { + destination.setValue(stereoDest, attrName, newList); + } + } else if ((copy != null) && (value instanceof EObject)) { + if (value instanceof Element) { + destination.setValue(stereoDest, attrName, copy.getCopy((Element) value)); + } + // TODO: remove hack: the template port references directly an element of a package template + // the package template should not be copied, but instantiated as done in class TemplatePort + else if (!stereotypeName.endsWith("TemplatePort")) { //$NON-NLS-1$ + // value is likely a stereotype application. If copy does a package-template instantiation, it would + // check whether the passed element is within the package template. This would fail if we pass + // a stereotype application. (could also do check within copy??) + EObject eValue = (EObject) value; + Element base = UMLUtil.getBaseElement(eValue); + EClass eClass = eValue.eClass(); + Element newBase = copy.getCopy(base); + for (EObject stereoApp : newBase.getStereotypeApplications()) { + if (stereoApp.eClass() == eClass) { + destination.setValue(stereoDest, attrName, stereoApp); + break; + } + } + } + else { + destination.setValue(stereoDest, attrName, value); + } + } + else { + destination.setValue(stereoDest, attrName, value); + } + } + + return true; + } + + public static boolean copyAttribute(String stereotypeName, String attribute, Element source, Element destination) { + Stereotype stereotype = source.getAppliedStereotype(stereotypeName); + if (stereotype == null) { + return false; + } + Object value = source.getValue(stereotype, attribute); + destination.applyStereotype(stereotype); + destination.setValue(stereotype, attribute, value); + return true; + } + + public static org.eclipse.papyrus.FCM.Connector getConnector(Connector connector) { + return UMLUtil.getStereotypeApplication(connector, org.eclipse.papyrus.FCM.Connector.class); + } + + public static boolean isConnector(Connector candidate) { + return StereotypeUtil.isApplied(candidate, org.eclipse.papyrus.FCM.Connector.class); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Stereotypes.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Stereotypes.java new file mode 100644 index 00000000000..fdaefbed703 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Stereotypes.java @@ -0,0 +1,27 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +/** + * Specific stereotypes. This file should not be used any more + */ +@Deprecated +public class Stereotypes { + + // FT stereotypes + public final static String activeWithVoting = "FTRedundancy::FTActiveWithVotingReplicationStyle"; //$NON-NLS-1$ + + public final static String replicationInfo = "DP::Replication"; //$NON-NLS-1$ +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/UMLTool.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/UMLTool.java new file mode 100644 index 00000000000..448fc15a77c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/UMLTool.java @@ -0,0 +1,410 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * Christophe JOUVRAY + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.common.util.UniqueEList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.papyrus.C_Cpp.External; +import org.eclipse.papyrus.C_Cpp.NoCodeGen; +import org.eclipse.papyrus.C_Cpp.Typedef; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.BehavioredClassifier; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Dependency; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.InterfaceRealization; +import org.eclipse.uml2.uml.Model; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Namespace; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.ParameterDirectionKind; +import org.eclipse.uml2.uml.PrimitiveType; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Relationship; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.util.UMLUtil; + + +/** + * Collection of utility functions. In contrast to core.Utils, it is chiefly used by xtend classes + */ +public class UMLTool { + + private static final String UNDERSCORE = "_"; //$NON-NLS-1$ + + public static EList reverse(EList list) { + EList reverseList = new BasicEList(); + for (int i=list.size()-1; i>=0; i--) { + reverseList.add(list.get(i)); + } + return reverseList; + } + + /** + * @param operation + * @return all in and inout parameters of an operation + */ + public static EList parametersInInout(Operation operation) { + EList list = new BasicEList(); + for (Parameter parameter : operation.getOwnedParameters()) { + if ((parameter.getDirection().getValue() == ParameterDirectionKind.IN) || + (parameter.getDirection().getValue() == ParameterDirectionKind.INOUT)) { + list.add(parameter); + } + } + return list; + } + + /** + * @param operation + * @return all out, inout and return parameters of an operation + */ + public static EList parametersOutInout(Operation operation) { + EList list = new BasicEList(); + for (Parameter parameter : operation.getOwnedParameters()) { + if ((parameter.getDirection().getValue() == ParameterDirectionKind.OUT) || + (parameter.getDirection().getValue() == ParameterDirectionKind.RETURN) || + (parameter.getDirection().getValue() == ParameterDirectionKind.INOUT)) { + list.add(parameter); + } + } + return list; + } + + /** + * @param operation + * @return all non-return parameters of an operation + */ + public static EList parametersNonRet(Operation operation) { + EList list = new BasicEList(); + for (Parameter parameter : operation.getOwnedParameters()) { + if (parameter.getDirection().getValue() != ParameterDirectionKind.RETURN) { + list.add(parameter); + } + } + return list; + } + + /** + * A small helper function that makes names compliant with variable + * names in programming languages such as C++ or Java + * Unlike varName2, replace scoping signs as well + */ + public static String varName(NamedElement element) { + return varName(element.getName()); + } + + /** + * A small helper function that makes names compliant with variable + * names in programming languages such as C++ or Java + * Unlike varName2, replace scoping signs as well + */ + public static String varName(String umlName) { + umlName = umlName.replace(".", UNDERSCORE); //$NON-NLS-1$ + umlName = umlName.replace(NamedElement.SEPARATOR, UNDERSCORE); + return varName2(umlName); + } + + /** + * A small helper function that makes names compliant with variable + * names in programming languages such as C++ or Java + * TODO: obviously, it is not complete (e.g. in case of "$", national characters ("ä", "é", ...) , ...) + */ + public static String varName2(NamedElement element) { + String umlName = element.getName(); + return varName2(umlName); + } + + /** + * Like varName, but does not replace "." with "_" + * + * @param umlName + * @return + */ + public static String varName2(String umlName) { + umlName = umlName.replace(" ", UNDERSCORE); //$NON-NLS-1$ + umlName = umlName.replace("-", UNDERSCORE); //$NON-NLS-1$ + umlName = umlName.replace("+", UNDERSCORE); //$NON-NLS-1$ + umlName = umlName.replace("?", UNDERSCORE); //$NON-NLS-1$ + return umlName; + } + + public static EList usedNamespaces(NamedElement element) { + EList list = new BasicEList(element.allNamespaces()); + + if (list.size() < 1) { + return null; + } + list.remove(list.size() - 1); // remove last element (top-level) + return list; + } + + /** + * Return a sequence of namespaces for a given element, starting from the "bottom" + * one, i.e. the one in which the element is contained. It will end before the + * searchNS namespace is reached. Returns null, if the element is not contained + * within the search namespace. + * + * @param element + * @param searchNS + * @return + */ + public static EList relativePath(Element element, Namespace searchNS) { + EList pathList = new BasicEList(); + Element owner = element.getOwner(); + if (!(owner instanceof Namespace)) { + // happens, if element is contained in a template signature + return null; + } + Namespace ns = (Namespace) owner; + while (ns != null) { + if (ns == searchNS) { + return pathList; + } + pathList.add(ns); + + ns = (Namespace) ns.getOwner(); + } + return null; + } + + /** + * This method returns all types that are referenced by a classifier. This includes + * attribute types, types within operations as well as inherited types. + * This is useful to generate the #includes + * (which is used by the Acceleo code within the packaging plugin) + */ + public static EList getReferencedClassifiers(Classifier classifier) { + EList list = new UniqueEList(); + list.addAll(classifier.parents()); + + if (classifier instanceof Class) { + // get classifiers referenced by attributes + for (Operation operation : ((Class) classifier).getOwnedOperations()) { + for (Parameter parameter : operation.getOwnedParameters()) { + Type type = parameter.getType(); + if (type instanceof Classifier) { + list.add((Classifier) type); + } + } + } + + // get classifiers referenced by attributes + for (Property attribute : ((Class) classifier).getOwnedAttributes()) { + Type type = attribute.getType(); + if (type instanceof Classifier) { + list.add((Classifier) type); + } + } + } + return list; + } + + /** + * TODO: copy&paste from C++ generator (& specific for C++) + * + * @param ne + * @return + */ + public static String cppQName(NamedElement ne) { + if ((StereotypeUtil.isApplied(ne, External.class)) || (StereotypeUtil.isApplied(ne, NoCodeGen.class))) { + return ne.getName(); + } else { + String qName = ne.getName(); + for (Namespace ns : ne.allNamespaces()) { + if (!(ns instanceof Model)) { + qName = ns.getName() + "::" + qName; //$NON-NLS-1$ + } + } + return qName; + } + } + + /** + * Return the name of a parameter. In case of a return parameter, always return the name + * "retValue". This is quite useful for marshalling operations (which need to assign a + * value to the return parameter, which is sometimes not initialized) + * + * @param parameter + * @return + */ + public static String paramName(Parameter parameter) { + if (parameter.getDirection().getValue() == ParameterDirectionKind.RETURN) { + return "retValue"; //$NON-NLS-1$ + } else { + return parameter.getName(); + } + } + + /** + * Return the interface which owns an operation that is implemented by a class. + * Context: a class might implement several interfaces by defining their operations. + * The operation is useful in the context of state-machines: when a transition is triggered by + * the call of an operation of the class, we'd like to know which interceptor (for which interface) + * belongs to it (since the operations are enumerated within each interface). + * TODO: move operation into state-chart java code + * TODO: would not work for ROOM ports typed with a collaboration + * + * @param operation + * @return the interface which the operation belongs + */ + public static Interface implementsInterface(Operation operation) { + Element owner = operation.getOwner(); + if (owner instanceof BehavioredClassifier) { + String name = operation.getName(); + EList types = new BasicEList(); + for (Parameter parameter : operation.getOwnedParameters()) { + types.add(parameter.getType()); + } + // loop over implemented realizations. Do not rely on FCM derivedElement information + // as it might be missing on some models (it would point from an operation of the class + // to the associated operation of the interface) + for (InterfaceRealization ir : ((BehavioredClassifier) owner).getInterfaceRealizations()) { + // check for types to allow for overloading + Operation candidate = ir.getContract().getOwnedOperation(name, null, types); + if (candidate != null) { + return ir.getContract(); + } + } + } + else if (owner instanceof Interface) { + return (Interface) owner; + } + return null; + } + + /** + * Convenience function: Declare a dependency from source to destination. The function checks, + * if a dependency already exists to avoid double dependencies. + * + * @param source + * source type of the dependency + * @param dest + * destination of the dependency + */ + public static void declareDependency(Type source, Type dest) { + // check, if a relationship already exists + for (Relationship dependency : source.getRelationships(UMLPackage.eINSTANCE.getDependency())) { + if (((Dependency) dependency).getSuppliers().contains(dest)) { + return; + } + } + source.createDependency(dest); + } + + /** + * Get the URI fragment of an element within your model + * Useful for transmitting model references + * + * @param element + * a UML element + * @return + */ + public static String fragment(Element element) { + Resource resource = element.eResource(); + // TODO: use EcoreUtil getURI (InternalEObject) instead? + + if (resource instanceof XMLResource) { + XMLResource xmlResource = (XMLResource) resource; + return "\"" + xmlResource.getURIFragment(element) + "\""; //$NON-NLS-1$//$NON-NLS-2$ + } + return null; + } + + /** + * Get the XML (URI) Id of an element within your model + * Useful for transmitting model references + * + * @param element + * a UML element + * @return + */ + public static String xmlID(Element element) { + Resource resource = element.eResource(); + // TODO: use EcoreUtil getURI (InternalEObject) instead? + + if (resource instanceof XMLResource) { + XMLResource xmlResource = (XMLResource) resource; + return xmlResource.getID(element); + } + return null; + } + + public static String getURI(Element element) { + Resource resource = element.eResource(); + if (resource != null) { + URI uri = resource.getURI(); + return uri.toString(); + } + return null; + } + + /** + * + * TODO: Specific to C++ + * + * @param type + * a type + * @return return the definition of a typedef, if the type has been defined via + * the stereotype CppType of the Cpp profile + */ + public static String dereferenceTypedef(Type type) { + if (type instanceof PrimitiveType) { + Typedef cppType = UMLUtil.getStereotypeApplication(type, Typedef.class); + if (cppType != null) { + return cppType.getDefinition(); + } + } + return type.getQualifiedName(); + + } + + public static String encodeID(String uri) { + // _ becomes escape character. original _ is __, '-' becomes _M + return uri. + replace(UNDERSCORE, UNDERSCORE + UNDERSCORE). + replace("-", "_M"); //$NON-NLS-1$ //$NON-NLS-2$ + } + + public static String decodeID(String encodedURI) { + String result = ""; //$NON-NLS-1$ + for (int i = 0; i < encodedURI.length(); i++) { + char c = encodedURI.charAt(i); + if (c == '_') { + char next = encodedURI.charAt(i + 1); + if (next == 'M') { + result += '-'; + } else if (next == '_') { + result += '_'; + } + i++; + } + else { + result += c; + } + } + return result; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Utils.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Utils.java new file mode 100644 index 00000000000..ea3a43f07c7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/Utils.java @@ -0,0 +1,471 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Iterator; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.UniqueEList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.FCM.Assembly; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.FCM.Singleton; +import org.eclipse.papyrus.qompass.designer.core.preferences.QompassPreferenceConstants; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.AggregationKind; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.util.UMLUtil; + +public class Utils { + + public static final String QUOTE = "\""; //$NON-NLS-1$ + + /** + * Retrieve an element from a list of named elements via its name + * + * @param namedElementList + * @param name + * @return + */ + public static NamedElement getNamedElementFromList( + EList namedElementList, String name) { + Iterator namedElements = namedElementList + .iterator(); + while (namedElements.hasNext()) { + NamedElement namedElement = namedElements.next(); + if (namedElement.getName().equals(name)) { + return namedElement; + } + } + return null; + } + + /** + * return the top-level owner of an element. This function returns the same + * value as getModel, if the top-level element is a model. While this is the + * case for models, model libraries have a top-level package (not a model). + * In this case, getTop returns the top-level package whereas getModel would + * return null. + * + * @param element + * @return the top-level owning package + * @deprecated Use getRootPackage method in oep.uml.tools.utils.PackageUtil + */ + @Deprecated + public static Package getTop(Element element) { + while (element != null) { + Element owner = element.getOwner(); + if (owner == null) { + if (element instanceof Package) { + return (Package) element; + } + } + element = owner; + } + return null; + } + + /** + * Return package at first level. Useful, since last model transformation + * will put elements under a new "root" + * + * @param element + * @return + */ + public static Package getFirstLevel(Element element) { + Element lastElement = element; + while (element != null) { + Element owner = element.getOwner(); + if (owner == null) { + if (lastElement instanceof Package) { + return (Package) lastElement; + } + } + lastElement = element; + element = owner; + } + return null; + } + + /** + * @param element + * an element which is owned by a model. + * @param subfolder + * the name of a sub-folder within root (created, if not + * existent) + * @return a reference to the sub folder within the root of the model that + * belongs to the passed element. + */ + public static Package getRoot(Element element, String subfolder) { + Package root = getTop(element); + if (root.getNestedPackage(subfolder) != null) { + return root.getNestedPackage(subfolder); + } else { + return root.createNestedPackage(subfolder); + } + } + + /** + * Convenience method enabling to apply getOwnedOperation equally to classes + * and interfaces + * + * @param cl + * @param name + * @param paramNames + * @param paramTypes + * @return + */ + public static Operation createOwnedOperation(Classifier cl, String name, + EList paramNames, EList paramTypes, Type retType) { + if (cl instanceof Class) { + return ((Class) cl).createOwnedOperation(name, paramNames, + paramTypes, retType); + } else if (cl instanceof Interface) { + return ((Interface) cl).createOwnedOperation(name, paramNames, + paramTypes, retType); + } else { + return null; + } + } + + public static Operation getOwnedOperation(Classifier cl, String name, + EList paramNames, EList paramTypes) { + if (cl instanceof Class) { + return ((Class) cl).getOwnedOperation(name, paramNames, paramTypes); + } else if (cl instanceof Interface) { + return ((Interface) cl).getOwnedOperation(name, paramNames, + paramTypes); + } else { + return null; + } + } + + /** + * this method returns the component type of an implementation. It is based + * on the modeling convention that implementations inherit from types. + */ + public static Class componentType(Class implementation) { + if (Utils.isCompImpl(implementation)) { + Iterator superclasses = implementation.getSuperClasses() + .iterator(); + while (superclasses.hasNext()) { + Class componentType = superclasses.next(); + if (Utils.isCompType(componentType)) { + return componentType; + } + } + } + return null; + } + + /** + * return true, if a component (implementation) is a composite, i.e. has + * inner parts + */ + public static boolean isComposite(Class implementation) { + return Utils.isCompImpl(implementation) + && (getParts(implementation).size() > 0); + } + + public static EList getParts(Class implementation) { + if (treatNoneAsComposite()) { + EList parts = new BasicEList(); + for (Property part : implementation.getAttributes()) { + if (part.getAggregation() != AggregationKind.SHARED_LITERAL) { + parts.add(part); + } + } + return parts; + } + else { + return implementation.getParts(); + } + } + + + /** + * @param attribute + * an attribute + * @return true, if the aggregation kind is considered as a composition + */ + public static boolean isComposition(Property attribute) { + if (treatNoneAsComposite()) { + return (attribute.getAggregation() != AggregationKind.SHARED_LITERAL); + } + else { + return (attribute.getAggregation() == AggregationKind.COMPOSITE_LITERAL); + } + } + + /** + * return true, if an instance specification is a composite, i.e. has > 1 + * slots TODO: distinguish parts and configuration attributes + */ + + public static boolean isComposite(InstanceSpecification is) { + return (is.getSlots().size() > 0); + } + + /** + * Get an element via its qualified name. Will find elements from the root + * model and elements in imported models. Also supports target model in + * which imports have been copied (while keeping the top-level name) + * + * @param root + * @param qualifiedName + * @return + */ + public static NamedElement getQualifiedElement(Package root, + String qualifiedName) { + NamedElement namedElement = null; + int index = qualifiedName.indexOf("::"); //$NON-NLS-1$ + if (index != -1) { + // first try using a path without top element (since + // getQualifiedElement is typically used for + // imported elements) + String remainder = qualifiedName.substring(index + 2); + namedElement = getQualifiedElement(root, remainder, qualifiedName); + } + if (namedElement == null) { + // try with complete name as path name, but assume that the element + // has been copied into the model, + // i.e. qualifiedName is prefixed by model name + namedElement = getQualifiedElement(root, qualifiedName, + root.getName() + "::" + qualifiedName); //$NON-NLS-1$ + } + return namedElement; + } + + /** + * Retrieve an element via its qualified name within a package The segments + * of the package may be non unique due to imports + * + * @return the found element, if it exists + */ + public static NamedElement getQualifiedElement(Package root, + String remainingPath, String qualifiedName) { + if (root == null) { + return null; + } + if (!remainingPath.contains(NamedElement.SEPARATOR)) { + for (NamedElement candidate : root.getMembers()) { + String name = candidate.getName(); + if ((name != null) && name.equals(remainingPath)) { + if (candidate.getQualifiedName().equals(qualifiedName)) { + return candidate; + } + } + } + } else { + String segment = remainingPath.split(NamedElement.SEPARATOR)[0]; + String remainder = remainingPath.substring(segment.length() + 2); + for (Element element : root.getMembers()) { + if (element instanceof Package) { + if (((NamedElement) element).getName().equals(segment)) { + NamedElement foundElement = getQualifiedElement( + (Package) element, remainder, qualifiedName); + // return, if not found + if (foundElement != null) { + return foundElement; + } + } + } + } + } + return null; + } + + /** + * Simple check whether an element is in a different model than the passed + * package It will return true, whenever the the top elements do not match. + * This is always true, if the 2nd belongs to a different model, whether + * imported or not. This distinction is however not required in our context. + */ + public static boolean isElementInDifferentModel(Package model, + NamedElement namedElement) { + return model != getTop(namedElement); + } + + /** + * /** + * Check whether a class contains a non-port attribute of a given name + * + * @param cl + * @return + */ + public static boolean hasNonPortOwnedAttribute(Class cl, String name) { + for (Property p : cl.getOwnedAttributes()) { + if (!(p instanceof Port)) { + if (p.getName().equals(name)) { + return true; + } + } + } + return false; + } + + public static EList getAllElementsOfType(Element examineElement, java.lang.Class clazz) + { + EList visitedPackages = new BasicEList(); + return getAllElementsOfType(examineElement, clazz, visitedPackages); + } + + @SuppressWarnings("unchecked") + public static EList getAllElementsOfType(Element examineElement, java.lang.Class clazz, EList visitedPackages) + { + EList list = new UniqueEList(); + for (Element element : examineElement.allOwnedElements()) { + if (element instanceof Package) { + if (!visitedPackages.contains(element)) { + visitedPackages.add(element); + list.addAll(getAllElementsOfType(element, clazz, + visitedPackages)); + } + } else if (clazz.isInstance(element)) { + list.add((T) element); + } + } + return list; + } + + /** + * @param a + * potential implementation + * @return true, if passed classifier is an implementation (i.e. declared + * via stereotypes as component or connector implementation (a sub-type of component implementations, + * therefore no additional check is required) + */ + public static boolean isCompImpl(Classifier implementation) { + return !implementation.isAbstract(); + } + + /** + * Check whether the passed class is a component type (and not a component implementation). + * This includes connector and container types as well. + * + * @param component + * @return + */ + public static boolean isCompType(Class component) { + return component.isAbstract(); + } + + public static boolean isInteractionComponent(Classifier component) { + return StereotypeUtil.isApplied(component, InteractionComponent.class); + } + + public static boolean isSingleton(Class component) { + return StereotypeUtil.isApplied(component, Singleton.class); + } + + public static boolean isAssembly(Class component) { + return StereotypeUtil.isApplied(component, Assembly.class); + } + + public static boolean treatNoneAsComposite() { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + return store.getBoolean(QompassPreferenceConstants.P_TREAT_NONE_AS_COMPOSITE); + } + + public static boolean allAttributesAreConfigAttributs() { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + return store.getBoolean(QompassPreferenceConstants.P_ALL_ATTRIBUTES_ARE_CONFIG_ATTRIBUTES); + } + + /** + * True, if either a component implementation or a type + * + * @param component + * @return + */ + public static boolean isComponent(Class component) { + return (isCompType(component) || isCompImpl(component)); + } + + /** + * Return the absolute file name to a file name given e.g. in the form platform:/plugin/xxx + * + * @param fileName + * the file name using eclipse elements such as platform:/plugin + * @return the absolute file name + */ + public static String getAbsoluteFN(String fileName) { + try { + URL absoluteURL = FileLocator.toFileURL(new URL(fileName)); + return absoluteURL.getFile(); + } catch (MalformedURLException e) { + } catch (IOException e) { + } + return null; + } + + // TODO: need a generic utility function for getting all elements obeying a certain + // criteria from a model + public static EList getAllRules(Package pkg) { + EList visitedPackages = new BasicEList(); + EList contRuleList = new BasicEList(); + getAllRules(pkg, visitedPackages, contRuleList); + return contRuleList; + } + + public static void getAllRules(Package pkg, EList visitedPackages, EList contRuleList) { + for (Element el : pkg.getMembers()) { + if (el instanceof Package) { + if (!visitedPackages.contains(el)) { + visitedPackages.add((Package) el); + getAllRules((Package) el, visitedPackages, contRuleList); + } + } + else if (el instanceof Class) { + if (StereotypeUtil.isApplied(el, ContainerRule.class)) { + ContainerRule rule = UMLUtil.getStereotypeApplication(el, ContainerRule.class); + contRuleList.add(rule); + } + } + } + } + + /** + * Put quotes around a string, unless string already starts with a quote. + * + * @param str + * @return + */ + public static String quoteString(String str) { + if (str.startsWith(QUOTE)) { + return str; + } + else { + return QUOTE + str + QUOTE; + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddMarteAndFcmProfile.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddMarteAndFcmProfile.java new file mode 100644 index 00000000000..8371706e9c7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddMarteAndFcmProfile.java @@ -0,0 +1,148 @@ +/******************************************************************************* + * Copyright (c) 2011 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ +package org.eclipse.papyrus.qompass.designer.core.commands; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.workspace.AbstractEMFOperation; +import org.eclipse.papyrus.qompass.designer.core.Activator; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.Profile; + +/** + * This class adds the FCM profile, parts of the MARTE profile and required package imports to your model. + */ +public class AddMarteAndFcmProfile extends AbstractEMFOperation { + + public AddMarteAndFcmProfile(Package selectedPkg, int applyCode, TransactionalEditingDomain domain) { + super(domain, CMD_LABEL); + this.selectedPkg = selectedPkg; + this.applyCode = applyCode; + } + + public static final String CMD_LABEL = "Add MARTE/FCM profiles"; //$NON-NLS-1$ + + public static final String FCM_PROFILE_URI = "pathmap://FCM_PROFILES/FCM.profile.uml"; //$NON-NLS-1$ + + public static final String MARTE_PROFILE_URI = "pathmap://Papyrus_PROFILES/MARTE.profile.uml";//$NON-NLS-1$ + + static final String MARTE_FOUNDATIONS = "MARTE_Foundations"; //$NON-NLS-1$ + + static final String MARTE_F_ALLOC = "Alloc"; //$NON-NLS-1$ + + static final String MARTE_DESIGN_MODEL = "MARTE_DesignModel"; //$NON-NLS-1$ + + static final String MARTE_DM_HLAM = "HLAM"; //$NON-NLS-1$ + + static final String MARTE_DM_GCM = "GCM"; //$NON-NLS-1$ + + public static final int APPLY_FCM = 1; + + public static final int APPLY_ALLOC = 2; + + public static final int APPLY_HLAM_GCM = 4; + + Package selectedPkg; + + int applyCode; + + public static Element getContent(URI uri, ResourceSet rs) { + // Resource resource = getTransactionalEditingDomain ().getResourceSet().getResource (uri, true); + Resource resource = rs.getResource(uri, true); + return getContent(resource); + } + + public static Element getContent(Resource resource) { + EList contentObj = resource.getContents(); + if ((contentObj.size() > 0) && (contentObj.get(0) instanceof Element)) { + return (Element) contentObj.get(0); + } + return null; + } + + @Override + protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) + throws ExecutionException { + final ResourceSet resourceSet = selectedPkg.eResource().getResourceSet(); + + try { + /* + * // Apply UML Standard profile + * // Retrieve standard profile + * Profile umlStdProfile = + * (Profile) getContent (URI.createURI(UMLResource.STANDARD_PROFILE_URI)); + * // Apply to new model + * umlModel.applyProfile(umlStdProfile); + */ + + if ((applyCode & APPLY_FCM) != 0) { + // Retrieve FCM profile + Profile fcmProfile = + (Profile) getContent(URI.createURI(FCM_PROFILE_URI), resourceSet); + + // Apply FCM profile and its nested profiles to new model + if (fcmProfile instanceof Profile) { + Profile profile = selectedPkg.getAppliedProfile(fcmProfile.getQualifiedName()); + if ((profile == null) && (!fcmProfile.getOwnedStereotypes().isEmpty())) { + selectedPkg.applyProfile(fcmProfile); + } + } + else { + Activator.log.debug("The FCM profile is not available."); //$NON-NLS-1$ + } + } + + if ((applyCode & (APPLY_ALLOC | APPLY_HLAM_GCM)) != 0) { + // Retrieve MARTE profile + Profile marteProfile = + (Profile) getContent(URI.createURI(MARTE_PROFILE_URI), resourceSet); + + // Apply MARTE::MARTE_DesignModel::HLAM + // & MARTE::MARTE_DesignModel::GCM + if (marteProfile != null) { + PackageableElement foundationModel = marteProfile.getPackagedElement(MARTE_FOUNDATIONS); + if ((foundationModel instanceof Package) && ((applyCode & APPLY_ALLOC) != 0)) { + PackageableElement alloc = ((Package) foundationModel).getPackagedElement(MARTE_F_ALLOC); + selectedPkg.applyProfile((Profile) alloc); + } + PackageableElement designModel = marteProfile.getPackagedElement(MARTE_DESIGN_MODEL); + if ((designModel instanceof Package) && ((applyCode & APPLY_HLAM_GCM) != 0)) { + PackageableElement hlam = ((Package) designModel).getPackagedElement(MARTE_DM_HLAM); + if (hlam instanceof Profile) { + selectedPkg.applyProfile((Profile) hlam); + } + PackageableElement gcm = ((Package) designModel).getPackagedElement(MARTE_DM_GCM); + if (gcm instanceof Profile) { + selectedPkg.applyProfile((Profile) gcm); + } + } + } + else { + Activator.log.debug("The MARTE profile is not available."); //$NON-NLS-1$ + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return Status.OK_STATUS; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddQompassModelLibs.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddQompassModelLibs.java new file mode 100644 index 00000000000..94c6d34f0b9 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/commands/AddQompassModelLibs.java @@ -0,0 +1,202 @@ +/******************************************************************************* + * Copyright (c) 2013 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ +package org.eclipse.papyrus.qompass.designer.core.commands; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.workspace.AbstractEMFOperation; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageImport; +import org.eclipse.uml2.uml.UMLFactory; + +/** + * This class adds the FCM profile, parts of the MARTE profile and required package imports to your model. + */ +public class AddQompassModelLibs extends AbstractEMFOperation { + + public AddQompassModelLibs(Package pkg, TransactionalEditingDomain domain) { + super(domain, CMD_LABEL); + selectedPkg = pkg; + availableImportPackages = null; + importList = null; + } + + public static final String CMD_LABEL = "Add Qompass CORE libraries"; //$NON-NLS-1$ + + public static final String EC3M_BASIC_CALLS_URI = "pathmap://QML_CORE/core.uml"; //$NON-NLS-1$ + + public static final String EC3M_MARTE_CALLS_URI = "pathmap://QML_MARTE/marte.uml"; //$NON-NLS-1$ + + protected EList importList; + + protected EList availableImportPackages; + + protected Package selectedPkg; + + /** + * Retrieve a model library from the repository + * + * @param uri + * the URI of the repository + * + * @return + */ + public PackageImport getModelLibraryImportFromURI(URI uri, ResourceSet resourceSet) { + // Try to reach model + Element root = getContent(uri, resourceSet); + if (root instanceof Package) { + + // Import model library + Package libToImport = (Package) root; + // create import package + PackageImport modelLibImport = UMLFactory.eINSTANCE.createPackageImport(); + modelLibImport.setImportedPackage(libToImport); + + return modelLibImport; + } + return null; + } + + public static Element getContent(URI uri, ResourceSet rs) { + // Resource resource = getTransactionalEditingDomain ().getResourceSet().getResource (uri, true); + Resource resource = rs.getResource(uri, true); + return getContent(resource); + } + + public static Element getContent(Resource resource) { + EList contentObj = resource.getContents(); + if ((contentObj.size() > 0) && (contentObj.get(0) instanceof Element)) { + return (Element) contentObj.get(0); + } + return null; + } + + /** + * Check whether a package import is already done + * + * @param selectedPkg + * @param pi + * @return + */ + boolean isAlreadyImported(Package selectedPkg, PackageImport pi) { + for (PackageImport existingPI : selectedPkg.getPackageImports()) { + if ((existingPI.getImportedPackage() == null) || + (pi.getImportedPackage() == null)) { + // import package are null (should not happen?!) + continue; + } + if ((existingPI.getImportedPackage().getName() == null) || + (pi.getImportedPackage().getName() == null)) { + // import package name not set (should not happen?!) + continue; + } else if (existingPI.getImportedPackage().getName().equals(pi.getImportedPackage().getName())) { + return true; + } + } + return false; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) + */ + + /** + * Return a list of package-imports for standard Qompass model libraries + * + * @return + * @throws ExecutionException + */ + public EList getAvailableImportPackages() { + if (availableImportPackages != null) { + return availableImportPackages; + } + final ResourceSet resourceSet = selectedPkg.eResource().getResourceSet(); + availableImportPackages = new BasicEList(); + + PackageImport pi = getModelLibraryImportFromURI(URI.createURI(EC3M_BASIC_CALLS_URI), resourceSet); + if (pi != null) { + availableImportPackages.add(pi); + } + pi = getModelLibraryImportFromURI(URI.createURI(EC3M_MARTE_CALLS_URI), resourceSet); + if (pi != null) { + availableImportPackages.add(pi); + } + return availableImportPackages; + } + + /** + * @return a list of package-imports that are already imported (within the selected pkg). + */ + public EList getAlreadyImportedPackages() { + EList availablePackages = getAvailableImportPackages(); + EList selection = new BasicEList(); + for (PackageImport pi : availablePackages) { + if (isAlreadyImported(selectedPkg, pi)) { + selection.add(pi); + } + } + return selection; + } + + /** + * Initialize import list. Must be called, before the command gets executed. + * + * @param importList + * a list of package-imports that will be added to the selectedPkg when + * the command gets executed. + */ + public void setImportList(EList importList) { + this.importList = importList; + } + + + /** + * Initialize import list. Must be called, before the command gets executed. + * Convenience method for dialogs that return an array. + * + * @param importArray + * an array of objects (which must contain package-imports) that will + * be added to the selectedPkg when the command gets executed. + */ + public void setImportList(Object importArray[]) { + importList = new BasicEList(); + for (Object importPkg : importArray) { + if (importPkg instanceof PackageImport) { + importList.add((PackageImport) importPkg); + } + } + } + + @Override + protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) + throws ExecutionException { + + for (PackageImport pi : importList) { + if (!isAlreadyImported(selectedPkg, pi)) { + selectedPkg.getPackageImports().add(pi); + } + } + return Status.OK_STATUS; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/AllocUtils.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/AllocUtils.java new file mode 100644 index 00000000000..c66d45918b5 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/AllocUtils.java @@ -0,0 +1,373 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.deployment; + +import java.util.Collection; +import java.util.Iterator; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.UniqueEList; +import org.eclipse.papyrus.FCM.Fragment; +import org.eclipse.papyrus.MARTE.MARTE_DesignModel.SRM.SW_Concurrency.SwSchedulableResource; +import org.eclipse.papyrus.MARTE.MARTE_Foundations.Alloc.Allocate; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Abstraction; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.ConnectorEnd; +import org.eclipse.uml2.uml.DirectedRelationship; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Node; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.util.UMLUtil; + +public class AllocUtils { + + public static final String startPortName = "start"; //$NON-NLS-1$ + + public static final String startPortType = "IStart"; //$NON-NLS-1$ + + /** + * Retrieve a list of nodes to which the instance is allocated to *or* + * to which one of the contained instances is allocated to (recursively) + * + * @param instance + * @return a list of nodes + */ + public static EList getAllNodes(InstanceSpecification instance) { + EList nodeList = getNodes(instance); + for (Slot slot : instance.getSlots()) { + if (!DepUtils.isShared(slot)) { + InstanceSpecification containedInstance = DepUtils.getInstance(slot); + if (containedInstance != null) { + nodeList.addAll(getAllNodes(containedInstance)); + } + } + } + return nodeList; + } + + /** + * Retrieve a list of nodes to which the set of passed instance is allocated to *or* + * to which one of the contained instances is allocated to (recursively) + * + * @param instanceList a list of instances + * @return a list of nodes + */ + public static EList getAllNodes(Collection instances) { + EList nodeList = new UniqueEList(); + for (InstanceSpecification instance : instances) { + nodeList.addAll(getAllNodes(instance)); + } + return nodeList; + } + /** + * Retrieve a list of nodes to which the instance is allocated to *or* + * to which one of the contained instances is allocated to (recursively) + * + * @param instanceAttribute + * an attribute within a composite that represents a component instance + * or a set thereof, if the composite itself is instantiated multiple times) + * @return a list of nodes + */ + public static Property getThreadAlloc(Property instanceAttribute) { + for (DirectedRelationship relation : instanceAttribute.getSourceDirectedRelationships()) { + if (StereotypeUtil.isApplied(relation, Allocate.class)) { + if (relation.getTargets().size() != 1) { + continue; + } + Element targetElem = relation.getTargets().get(0); + if (!(targetElem instanceof Property)) { + continue; + } + Property target = (Property) targetElem; + if (StereotypeUtil.isApplied(target.getType(), SwSchedulableResource.class)) { + return target; + } + } + } + return null; + } + + + /** + * Retrieve a list of nodes to which the instance is allocated to *or* + * to which one of the containing instances is explicitly allocated + * + * @param instance + * @return a list of nodes + */ + public static EList getAllNodesOrThreadsParent(InstanceSpecification instance) { + EList nodeList = getNodesOrThreads(instance); + Package cdp = instance.getNearestPackage(); + // TODO: not very efficient: loop each time over all instance specifications + for (NamedElement parentNE : cdp.getMembers()) { + if (parentNE instanceof InstanceSpecification) { + // possible parent instance specification + InstanceSpecification parentIS = (InstanceSpecification) parentNE; + if (DepUtils.getContainedInstances(parentIS).contains(instance)) { + nodeList.addAll(getAllNodesOrThreadsParent(parentIS)); + } + } + } + return nodeList; + } + + public static InstanceSpecification getNode(InstanceSpecification instance) { + EList nodeList = getNodes(instance); + if (nodeList.size() != 0) { + return nodeList.get(0); + } + return null; + } + + public static InstanceSpecification getNodeOrThread(InstanceSpecification instanceOrThread) { + EList nodeList = getNodesOrThreads(instanceOrThread); + if (nodeList.size() != 0) { + return nodeList.get(0); + } + return null; + } + + /** + * This method returns a list of nodes (or threads) to which the passed instance is allocated. + * It is based on MARTE Allocation (a stereotyped abstraction) which is a generic + * mechanism to deploy UML elements to nodes. + * + * @param instanceOrThread + * The instance for which we like to know the allocation information + * @return + */ + public static EList getNodesOrThreads(InstanceSpecification instanceOrThread) { + EList nodeList = new UniqueEList(); + + for (DirectedRelationship relationship : instanceOrThread.getSourceDirectedRelationships(UMLPackage.eINSTANCE.getAbstraction())) { + Abstraction abstraction = (Abstraction) relationship; + if (StereotypeUtil.isApplied(abstraction, Allocate.class)) { + for (Element target : abstraction.getTargets()) { + if (target instanceof InstanceSpecification) { + nodeList.add((InstanceSpecification) target); + } + } + } + } + return nodeList; + } + + /** + * This method returns a list of nodes to which the passed instance is allocated. If + * the instance is allocated directly to a node, this node is returned. If the instance + * is allocated to a thread, the allocation of the thread to a node is returned. + * + * @param instanceOrThread + * The instance that should be deployed + * @return + */ + public static EList getNodes(InstanceSpecification instanceOrThread) { + EList nodeList = new UniqueEList(); + EList nodeOrThreads = getNodesOrThreads(instanceOrThread); + for (InstanceSpecification nodeOrThread : nodeOrThreads) + { + Classifier nodeOrThreadC = DepUtils.getClassifier(nodeOrThread); + if (StereotypeUtil.isApplied(nodeOrThreadC, SwSchedulableResource.class)) { + // treat case that instance is allocated to a thread + // follow allocation of Thread + nodeList.add(getNode(nodeOrThread)); + } + else { + nodeList.add(nodeOrThread); + } + } + return nodeList; + } + + /** + * This method updates (and optionally removes) the allocations of an instance + * + * @param instance + * The instance that should be deployed + * @param oldNode + * the old node allocation + * @param newNode + * the new node allocation, may be null to indicate removal + * @return + */ + public static EList updateAllocation(InstanceSpecification instance, InstanceSpecification oldNode, InstanceSpecification newNode) { + EList nodeList = new UniqueEList(); + + Iterator relShipIt = + instance.getSourceDirectedRelationships(UMLPackage.eINSTANCE.getAbstraction()).iterator(); + + while (relShipIt.hasNext()) { + Abstraction abstraction = (Abstraction) relShipIt.next(); + if (StereotypeUtil.isApplied(abstraction, Allocate.class)) { + EList suppliers = abstraction.getSuppliers(); // use suppliers instead of targets (derived) + for (int index = 0; index < suppliers.size(); index++) { + if (suppliers.get(index) == oldNode) { + if (newNode == null) { + // remove relationship completely, since we assume a single target + // (cannot call remove on relShipIt, since list is derived) + abstraction.destroy(); + } else { + suppliers.set(index, newNode); + } + break; + } + } + } + } + return nodeList; + } + + /** + * Retrieve a list of nodes to which the instance is allocated to *or* + * to which one of the contained instances is allocated to (recursively) + * + * @param instance + * @param A + * port of the composite. Contained instances are examined only if + * they have a connection with this port. + * @return a list of nodes + */ + public static EList getAllNodesForPort(InstanceSpecification instance, Port port) { + EList nodeList = getNodes(instance); + Classifier composite = DepUtils.getClassifier(instance); + if (composite instanceof Class) { + Class compositeCL = (Class) composite; + for (Slot slot : instance.getSlots()) { + Property containedProperty = (Property) slot.getDefiningFeature(); + + for (Connector connection : compositeCL.getOwnedConnectors()) { + // is one connector end targeted at the containedProperty ? + ConnectorEnd end = ConnectorUtil.connEndForPart(connection, containedProperty); + if (end == null) { + continue; + } + + // does the connector at the same connect the composite's port? + if (ConnectorUtil.connectsPort(connection, port)) { + Port containedPort = (Port) end.getRole(); + nodeList.addAll(getAllNodesForPort(DepUtils.getInstance(slot), containedPort)); + } + } + } + } + return nodeList; + } + + public static boolean allocate(InstanceSpecification instance, InstanceSpecification node) { + Package cdp = (Package) instance.getOwner(); + Abstraction allocation = (Abstraction) + cdp.createPackagedElement("allocate " + instance.getName() + //$NON-NLS-1$ + " to " + node.getName(), UMLPackage.eINSTANCE.getAbstraction()); //$NON-NLS-1$ + if (StereotypeUtil.apply(allocation, Allocate.class) == null) { + // stereotype application failed + allocation.destroy(); + return false; + } + allocation.getClients().add(instance); + allocation.getSuppliers().add(node); + return true; + } + + /** + * Assign node name to leafs + * + * @param instance + * @param A + * port of the composite. Contained instances are examined only if the + * have a connection with this port. If null, no sub-instances are examined + * @param nodes + * A list of nodes to which leafs are allocated + */ + public static void propagateNodesViaPort(InstanceSpecification instance, Port port, EList nodes) { + if (instance == null) { + return; + } + EList slots = instance.getSlots(); + Class composite = DepUtils.getImplementation(instance); + + // Only set allocation on leafs (TODO: assure that components with configuration attributes are not considered as leafs) + // if(composite.getParts().size() == 0) { + for (InstanceSpecification node : nodes) { + AllocUtils.allocate(instance, node); + } + + if ((composite != null) && (port != null)) { + Class compositeCL = composite; + for (Slot slot : slots) { + Property containedProperty = (Property) slot.getDefiningFeature(); + + Fragment fragment = UMLUtil.getStereotypeApplication(containedProperty, Fragment.class); + if (fragment != null) { + // TODO + /* + * EList colocateWithPort = fragment.getColocateWithPort(); + * // is the port within the list? + * if(Utils.getNamedElementFromList(colocateWithPort, port.getName()) != null) { + * // compare qualified name, since containedPort (stereotype attribute) + * // points to a source model element + * propagateNodesViaPort(DepUtils.getInstance(slot), port, nodes); + * continue; + * } + */ + } + for (Connector connection : compositeCL.getOwnedConnectors()) { + if (ConnectorUtil.connectsPort(connection, port)) { + Log.log(IStatus.INFO, Log.TRAFO_CONNECTOR, "connector: " + connection.getName()); //$NON-NLS-1$ + Log.log(IStatus.INFO, Log.TRAFO_CONNECTOR, "end1: " + connection.getEnds().get(0).getPartWithPort()); //$NON-NLS-1$ + Log.log(IStatus.INFO, Log.TRAFO_CONNECTOR, "end2: " + connection.getEnds().get(1).getPartWithPort()); //$NON-NLS-1$ + ConnectorEnd end = ConnectorUtil.connEndForPart(connection, containedProperty); + // other connector end targeted at containedProperty? + if (end != null) { + Port containedPort = (Port) end.getRole(); + propagateNodesViaPort(DepUtils.getInstance(slot), containedPort, nodes); + } + } + } + } + } + } + + /** + * Return the start Port of a component, i.e. a port that corresponds to the "magic" port name + * start and is typed with the interface IStart + * + * @param component + * a component implementation + * @return The start port or null + */ + public static Port getStartPort(Class component) { + Element startPortElem = Utils.getNamedElementFromList(component.getAllAttributes(), startPortName); + if (startPortElem instanceof Port) { + Port startPort = (Port) startPortElem; + if (startPort.getType().getName().equals(startPortType)) { + return startPort; + } + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/BootLoaderGen.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/BootLoaderGen.java new file mode 100644 index 00000000000..595e5aba037 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/BootLoaderGen.java @@ -0,0 +1,546 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.deployment; + +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; +import java.util.Stack; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.C_Cpp.Include; +import org.eclipse.papyrus.FCM.InitPrecedence; +import org.eclipse.papyrus.MARTE.MARTE_DesignModel.SRM.SW_Concurrency.SwSchedulableResource; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.StUtils; +import org.eclipse.papyrus.qompass.designer.core.UMLTool; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.transformations.ExecuteOOTrafo; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.ConnectorEnd; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.OpaqueBehavior; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.StructuralFeature; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.ValueSpecification; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * The task of the boot-loader is twofold: create the instances of all + * implementations (non-recursive). + * - create Connections: what should be done? + * + * TODO: factor out common code (TemplateInstantiation mechanism & createConnections below) + * Split between C++ specific and C++ independent aspects + */ +public class BootLoaderGen { + + private static final String EMPTYSTR = ""; //$NON-NLS-1$ + + final public static String NODE_INFO = "NodeInfo"; //$NON-NLS-1$ + + final public static String INIT_OP_NAME = "init"; //$NON-NLS-1$ + + final public static String NL = "\n"; //$NON-NLS-1$ + + final public static String EOL = ";\n"; //$NON-NLS-1$ + + final public static String BOOTLOADER_NAME = "BootLoader"; //$NON-NLS-1$ + + /** + * Create a new boot-loader in a specific package + * (which represents a node of the system). + * + * @param copier a lazy copier + * @param nodeIndex the index of the node + * @param numberOfNodes the number of nodes + * @throws TransformationException + */ + public BootLoaderGen(LazyCopier copier, int nodeIndex, int numberOfNodes) + throws TransformationException { + // Class composite = (Class) ut.getClassifier (mainInstance); + // place in root (getModel()) to avoid the problem that the declaration of the bootLoader + // instance is within a namespace (a static attribute on the model level would not solve the + // problem as it must be accessed by function main). + + Class nodeInfo = copier.target.createOwnedClass(NODE_INFO, false); + String headerStr = + "const int nodeIndex = " + nodeIndex + ";" + NL + //$NON-NLS-1$//$NON-NLS-2$ + "const int numberOfNodes = " + numberOfNodes + ";" + NL; //$NON-NLS-1$ //$NON-NLS-2$ + Include cppIncludeNodeInfo = StereotypeUtil.applyApp(nodeInfo, Include.class); + if (cppIncludeNodeInfo == null) { + throw new TransformationException("Can not apply C++ stereotypes during bootloader generation. Please apply the C++ profile to the source model"); + } + cppIncludeNodeInfo.setHeader(headerStr); + + // bootLoader.createOwnedAttribute (mainInstance.getName (), composite); + + m_bootLoader = copier.target.createOwnedClass(BOOTLOADER_NAME, false); + outputSizeof = false; + m_copy = copier; + Class template = (Class) Utils.getQualifiedElement(copier.source, bootloaderQNAME); + if (template == null) { + throw new TransformationException(String.format( + Messages.BootLoaderGen_CannotRetrieveTemplate, bootloaderQNAME)); + } + // TODO: currently, only stereotypes are copied from template + StUtils.copyStereotypes(template, m_bootLoader); + + + // TODO: commented code below already fixed? + /* + * Problem: defaultValue not taken into account by code generator + * => use global variables via cppInclude instead (see below: "bodyStr = ...") + * NamedElement corba_long = Utils.getQualifiedElement (owner, "CORBA::Long"); + * if (corba_long instanceof Type) { + * Property nodeNumber = + * m_bootLoader.createOwnedAttribute ("nodeNumber", (Type) corba_long); + * nodeNumber.setIsStatic (true); + * nodeNumber.setDefault ("0"); // for testing + * Property numberOfNodes = + * m_bootLoader.createOwnedAttribute ("numberOfNodes", (Type) corba_long); + * numberOfNodes.setIsStatic (true); + * numberOfNodes.setDefault ("2"); + * } + */ + Include cppInclude = StereotypeUtil.applyApp(m_bootLoader, Include.class); + if (cppInclude == null) { + throw new TransformationException(Messages.BootLoaderGen_CannotApplyCppInclude); + } + String existingBody = cppInclude.getBody(); + String bodyStr = EMPTYSTR; + + if (outputSizeof) { + bodyStr += + "#include " + NL + //$NON-NLS-1$ + "using namespace std;" + NL; //$NON-NLS-1$ + } + cppInclude.setBody(existingBody + bodyStr); + + // bootLoader.createOwnedAttribute (mainInstance.getName (), composite); + + m_initCode = EMPTYSTR; + m_initCodeRun = EMPTYSTR; + m_activation = new HashMap>(); + m_initCodeCConnections = EMPTYSTR; + m_initCodeCConfig = EMPTYSTR; + + if (outputSizeof) { + m_initCode += "cout << \"sizeof bootloader: \" << sizeof (bootloader) << endl;" + EOL; //$NON-NLS-1$ + } + // indexMap = new HashMap(); + } + + /** + * Return the path from the main instance towards a sub-instance using the proper dereference + * operators, i.e. ".", if the sub-instance is enclosed via composition or "->" if the sub-instance + * is a pointer (since created by the bootloader). + * + * @param slotPath + * @param instance + * @param accessName + * return the name to access the feature. Returns access path to instance, not + * the name of the variable for this instance (if instantiated by bootloader) + * @return + */ + public String getPath(Stack slotPath, InstanceSpecification instance, boolean accessName) { + if (slotPath.size() > 0) { + // start with first instance + String path = slotPath.get(0).getOwningInstance().getName(); + boolean previousInstantiatedByBL = false; + for (Slot pathElement : slotPath) { + if (pathElement != null) { + if (previousInstantiatedByBL && accessName) { + // If an instance is instantiated by the bootloader, it is only referenced via its type in the + // owning composite. Thus, configuration (and activation calls) might fail as the type might not + // have these configuration properties or operations. + // Therefore, configuration and initial calls use + // - the path, if instantiated by the composite + // - the variable name, if done by the bootloader + path = UMLTool.varName(path); // use variable name instead. + } + path += "." + pathElement.getDefiningFeature().getName(); //$NON-NLS-1$ + previousInstantiatedByBL = ExecuteOOTrafo.instantiateViaBootloader(pathElement.getDefiningFeature()); + } + } + if (previousInstantiatedByBL && !accessName) { + // name of the variable for this expression instantiated by the bootloader + path = UMLTool.varName(path); + } + return path; + } + else { + return instance.getName(); // instance has no path via slots, it is a top level instance + } + } + + public Property addInstance(Stack slotPath, InstanceSpecification instance, Class implementation, InstanceSpecification node) + throws TransformationException + { + // TODO: comments not clear. seems unnecessary complex. Problem in general is that access to + // shared instances needs to be configured. + // It should always be possible to configure this instance via a path w/o sharing. + String accessName = getPath(slotPath, instance, true); + String varName = getPath(slotPath, instance, false); + + Property implemPart = null; + + // containing instance not null (=> neither main instance nor singleton) + Slot containerSlot = null; + if (slotPath.size() > 0) { + containerSlot = slotPath.peek(); + + // initialize part/property in containing instance. The containing instance itself is accessed + // via the naming of the associated instance, the part itself via the name of the defining feature. + if (DepUtils.isShared(containerSlot)) { + // we need to initialize the property (a reference) with the given instance + Stack referencePath = DepUtils.getAccessPath(instance); + String referenceVarName = getPath(referencePath, instance, false); + + // add code for initialization + m_initCode += accessName + " = &" + referenceVarName + EOL; //$NON-NLS-1$ + // is a reference which should not be called via activation & start + // return now and skip code below + return implemPart; + } + else if (ExecuteOOTrafo.instantiateViaBootloader(containerSlot.getDefiningFeature())) { + // let bootloader instantiate + implemPart = m_bootLoader.createOwnedAttribute(/* "i_" + */varName, implementation); + // add code for initialization + m_initCode += accessName + " = &" + varName + EOL; //$NON-NLS-1$ + implemPart.setIsComposite(true); + } + } + else { + // top level, either main instance or singleton => bootloader instantiates, create attribute + implemPart = m_bootLoader.createOwnedAttribute(/* "i_" + */varName, implementation); + implemPart.setIsComposite(true); + } + if (outputSizeof) { + m_initCode += "cout << \"sizeof " + implementation.getName() + ": \" << sizeof (" + varName + ") << endl;" + EOL; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ + } + + // if start thread => existing thread activation interceptor? Connection? + if (StereotypeUtil.isApplied(implementation, SwSchedulableResource.class)) { + // yes, but is the thread instance part of the deployment plan?? [mmh, probably yes...] + // call threads start routine here? (via main thread?) which in turn will activate the start routine? + } + + // implementation contains get_start operation => has start port + // which is called automatically + String get_start = PrefixConstants.getP_Prefix + "start"; //$NON-NLS-1$ + + // Need to check whether implementation is an executor which is encapsulated in a container. In this case, only + // the method of the container and not the method of the executor (which owns the same port) maybe called. + // Currently, this check is based on the use of "executor" as reserved part name (validation checks that the + // user does not use this name for application components) + if (hasUnconnectedStartRoutine(m_copy, implementation, containerSlot)) { + if (m_initCodeRun.equals(EMPTYSTR)) { + // call start's run method + // TODO: Need path that uses the right dereference operator ("->" or ".") + m_initCodeRun = varName + "." + get_start + "()->run()" + EOL; //$NON-NLS-1$ //$NON-NLS-2$ + } else { + throw new TransformationException(String.format( + Messages.BootLoaderGen_AtLeastOneBlockingCall, + varName, m_initCodeRun)); + } + } + if (hasUnconnectedLifeCycle(m_copy, implementation, containerSlot)) { + // precedence is checked below (when code is actually produced) + // multiple varNames might share the same implementation. Put a list of variable names into the table + EList varNameList = m_activation.get(implementation); + if (varNameList == null) { + varNameList = new BasicEList(); + } + varNameList.add(varName + "."); //$NON-NLS-1$ + m_activation.put(implementation, varNameList); + } + + // check, if implementation contains a composite if (implementation.getOwnedOperation (StaticOOTrafo.CREATE_CONNECTIONS, null, null) != null) { + boolean bCreateConn = false; + for (Connector connector : implementation.getOwnedConnectors()) { + if (ConnectorUtil.isAssembly(connector)) { + bCreateConn = true; + break; + } + } + + if (bCreateConn) { + m_initCodeCConnections += varName + "." + ExecuteOOTrafo.CREATE_CONNECTIONS +"();\n"; //$NON-NLS-1$ //$NON-NLS-2$ + } + return implemPart; + } + + /** + * Check whether the passed implementation has an unconnected start port. + * This information is required, since only unconnected start ports are automatically called by the + * bootloader, in particular we want to avoid calling a start port of an executor (which is connected) + * and its container. + * + * @param implementation + * @param containerSlot + * @return + */ + public static boolean hasUnconnectedStartRoutine(LazyCopier copy, Class implementation, Slot containerSlot) { + if (implementation != null) { + Port startPort = AllocUtils.getStartPort(implementation); + if (startPort != null) { + return !isConnected(copy, containerSlot, startPort); + } + } + return false; + } + + /** + * Check, if the passed implementation has an unconnected life-cycle interface (activate/deactivate). + * This information is required, since only unconnected life cycle ports are automatically called by the + * bootloader, in particular we want to avoid calling a life cycle port of an executor (which is connected) + * and its container. + * + * @param implementation + * @param name + * @return + */ + public static boolean hasUnconnectedLifeCycle(LazyCopier copy, Class implementation, Slot containerSlot) { + if (implementation != null) { + Element lcPortElem = Utils.getNamedElementFromList(implementation.getAllAttributes(), "lc"); //$NON-NLS-1$ + if (lcPortElem instanceof Port) { + Port lcPort = (Port) lcPortElem; + // check, if port typed with ILifeCycle interface + if (lcPort.getType().getName().equals("ILifeCycle")) { //$NON-NLS-1$ + return !isConnected(copy, containerSlot, lcPort); + } + } + + } + return false; + } + + /** + * The check verifies whether the passed port is connected within + * the context of the composite represented by the passed slot + * + * @param containerSlot + * a slot within an instance that represents a composite class + * @Param a port that is checked for being connected + * @return true, if connected + */ + private static boolean isConnected(LazyCopier copy, Slot containerSlot, Port port) { + if (containerSlot != null) { + StructuralFeature sf = containerSlot.getDefiningFeature(); + if (sf instanceof Property) { + // instance still points to a part in the tmp-model (there are no + // instance specifications in the final model). Therefore, we use copy to + // obtain the mapped instance. + Property part = (Property) copy.copy(sf); + Class composite = part.getClass_(); + for (Connector connector : composite.getOwnedConnectors()) { + // must assure same connector end connects part & port + ConnectorEnd end = ConnectorUtil.connEndForPart(connector, part); + if ((end != null) && (end.getRole() == port)) { + return true; + } + } + } + } + return false; + } + + public void instanceConfig(Stack slotPath, InstanceSpecification instance) throws TransformationException { + Slot slot = slotPath.peek(); + // String varName = getPath(slotPath, instance, false); + StructuralFeature sf = slot.getDefiningFeature(); + if (sf == null) { + throw new TransformationException(String.format("A slot for instance %s has no defining feature", instance.getName())); //$NON-NLS-1$ + } + + String varName = instance.getName() + "." + sf.getName(); //$NON-NLS-1$ + for (ValueSpecification value : slot.getValues()) { + + // only set value, if not null + if (value.stringValue() != null) { + m_initCodeCConfig += varName + " = " + value.stringValue() + EOL; //$NON-NLS-1$ + } + } + } + + public void addCreateConnections() { + // code generators do not handle connectors in a suitable way. Remove + // (alternative: no-code-gen tag, as available for C++) + m_bootLoader.getOwnedConnectors().clear(); + } + + /** + * add the initialize operation. Must be called after a set of addInstance invocations + * @param mainInstance + */ + public void addInit(String language) { + // TODO: use template + Operation init = m_bootLoader.createOwnedOperation(INIT_OP_NAME, null, null); + OpaqueBehavior initBehavior = (OpaqueBehavior) + m_bootLoader.createOwnedBehavior(INIT_OP_NAME, UMLPackage.eINSTANCE.getOpaqueBehavior()); + init.getMethods().add(initBehavior); + + initBehavior.getLanguages().add(language); + String code = m_initCode + "\n"; //$NON-NLS-1$ + if (m_initCodeCConfig.length() > 0) { + code += "\n// instance configuration\n" + //$NON-NLS-1$ + m_initCodeCConfig + "\n"; //$NON-NLS-1$ + } + if (m_initCodeCConnections.length() > 0) { + code += "\n// create connections between instances\n" + //$NON-NLS-1$ + m_initCodeCConnections + "\n"; //$NON-NLS-1$ + } + Comparator comparator = new Comparator() { + + @Override + public int compare(Class clazz1, Class clazz2) { + + InitPrecedence precedenceC1 = UMLUtil.getStereotypeApplication(clazz1, InitPrecedence.class); + InitPrecedence precedenceC2 = UMLUtil.getStereotypeApplication(clazz2, InitPrecedence.class); + if (precedenceC1 != null) { + // need to use named comparison instead of precedenceC1.getInvokeAfter ().contains (clazz2) + // since class referenced by stereotype attribute still points to element in source model + if (Utils.getNamedElementFromList(precedenceC1.getInvokeAfter(), clazz2.getName()) != null) { + return 1; + } + else if (Utils.getNamedElementFromList(precedenceC1.getInvokeBefore(), clazz2.getName()) != null) { + return -1; + } + } + else if (precedenceC2 != null) { + if (Utils.getNamedElementFromList(precedenceC2.getInvokeAfter(), clazz1.getName()) != null) { + return -1; + } + else if (Utils.getNamedElementFromList(precedenceC2.getInvokeBefore(), clazz1.getName()) != null) { + return 1; + } + } + // singletons have precedence over "normal" classes + boolean ci1IsSingleton = Utils.isSingleton(clazz1); + boolean ci2IsSingleton = Utils.isSingleton(clazz2); + if (ci1IsSingleton) { + if (!ci2IsSingleton) { + // not both are singletons + return -1; + } + } + else if (ci2IsSingleton) { + return 1; + } + return 0; + } + }; + Class[] activationKeys = m_activation.keySet().toArray(new Class[0]); + String get_lc = PrefixConstants.getP_Prefix + "lc"; //$NON-NLS-1$ + if (activationKeys.length > 0) { + Arrays.sort(activationKeys, comparator); + code += "// activation code\n"; //$NON-NLS-1$ + for (Class implementation : activationKeys) { + EList varNameList = m_activation.get(implementation); + for (String varName : varNameList) { + code += varName + get_lc + "()->activate();\n"; //$NON-NLS-1$ + } + } + } + + Include cppInclude = UMLUtil.getStereotypeApplication(m_bootLoader, Include.class); + if (m_initCodeRun.length() > 0) { + code += "// initial user start\n" + m_initCodeRun; //$NON-NLS-1$ + } else { + // no component implements the initial start, therefore enter a sleep + // unistd is required (at least on unix systems) for sleep + cppInclude.setPreBody("#include // for sleep\n"); //$NON-NLS-1$ + + code += "// sleep forever\n"; //$NON-NLS-1$ + code += "for (;;) { sleep(100); }\n"; //$NON-NLS-1$ + // throw new TransformationRTException("no component implements the initial start. Assure that one component inherits from the CStart component"); + } + if (activationKeys.length > 0) { + code += "// deactivation code (reverse order)\n"; //$NON-NLS-1$ + + // traverse in reverse order + for (int i = activationKeys.length - 1; i >= 0; i--) { + Class implementation = activationKeys[i]; + EList varNameList = m_activation.get(implementation); + for (String varName : varNameList) { + code += varName + get_lc + "()->deactivate();\n"; //$NON-NLS-1$ + } + } + } + + initBehavior.getBodies().add(code); + } + + public Class getUML() { + return m_bootLoader; + } + + private Class m_bootLoader; + + private final static String bootloaderQNAME = "core::composites::BootLoader"; //$NON-NLS-1$ + + /** + * Initialization code, in particular assignment of part properties within composites + */ + private String m_initCode; + + /** + * Init code for create connections calls in composites with at least one assembly + * connector + */ + private String m_initCodeCConfig; + + /** + * Init code for create connections calls in composites with at least one assembly + * connector + */ + private String m_initCodeCConnections; + + /** + * Init code for blocking "run" calls (related to CStart system component) + */ + private String m_initCodeRun; + + /** + * Map containing activations/de-activations + */ + private Map> m_activation; + + private boolean outputSizeof; + + /** + * copy variable (instances still point to non-copied classes) + */ + private LazyCopier m_copy; + + /** + * Store a map with index values to manage configuration of arrays + */ + // protected Map indexMap; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepCreation.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepCreation.java new file mode 100644 index 00000000000..a712642e584 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepCreation.java @@ -0,0 +1,646 @@ +package org.eclipse.papyrus.qompass.designer.core.deployment; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Stack; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.AutoIndex; +import org.eclipse.papyrus.FCM.AutoIndexPerNode; +import org.eclipse.papyrus.FCM.ConfigurationProperty; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.CopyAttributeValue; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.FCM.util.FCMUtil; +import org.eclipse.papyrus.qompass.designer.core.CORBAtypeNames; +import org.eclipse.papyrus.qompass.designer.core.ConfigUtils; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationRTException; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.AggregationKind; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.Enumeration; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.InstanceValue; +import org.eclipse.uml2.uml.LiteralInteger; +import org.eclipse.uml2.uml.Node; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.StructuralFeature; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.ValueSpecification; +import org.eclipse.uml2.uml.util.UMLUtil; + +public class DepCreation { + + private static Map map; + + public static final String valueFor = "value for "; //$NON-NLS-1$ + + /** + * Create a slot and add an instance value associated with a part instance + * specification. + * + * @param is + * the instance specification for which a slot should be created + * @param partIS + * the instance specification associated with the slot (to be + * precise with slot's instance value) + * @param part + * the part associated with the slot, i.e. its defining feature + * @return The created slot + */ + public static Slot createSlot(InstanceSpecification is, + InstanceSpecification partIS, Property part) { + // the instance specification of the composite has a slot for each part + // and it points + // to the instance specification associated with the part. + Slot slot = is.createSlot(); + slot.setDefiningFeature(part); + + InstanceValue iv = (InstanceValue) slot.createValue(null, null, + UMLPackage.eINSTANCE.getInstanceValue()); + iv.setInstance(partIS); + return slot; + + } + + /** + * Create a Slot and a value for a configuration attribute + * + * @param attribute + */ + public static Slot createSlotForConfigProp(InstanceSpecification is, + Property attribute) { + + Slot slot = is.createSlot(); + slot.setDefiningFeature(attribute); + // For primitive types, the UML type does not provide sufficient information to decide + // whether it is a string or a numerical value. In case of the C++ profile, primitive + // UML types denote a language specific type, but we want to avoid C++ specific code, if + // possible. + // => pragmatic solution: use LiteralString as default, unless a check for some known numerical + // primitive types holds (in particular the UML as well as Qompass CORBA types) + // In addition, string values are not automatically quoted, i.e. it is possible to enter e.g. + // a float value as a string expression (it also means that a "real" string value must be quoted + // by the user). + Type type = attribute.getType(); + if (type != null) { + String name = type.getName(); + String qname = type.getQualifiedName(); + if (type instanceof Enumeration) { + slot.createValue(valueFor + attribute.getName(), type, UMLPackage.eINSTANCE.getInstanceValue()); + } else if (name.equals("Integer") || qname.equals(CORBAtypeNames.Octet) //$NON-NLS-1$ + || qname.equals(CORBAtypeNames.Long) + || qname.equals(CORBAtypeNames.UnsignedLong) + || qname.equals(CORBAtypeNames.Short) + || qname.equals(CORBAtypeNames.UnsignedShort)) { + slot.createValue(valueFor + attribute.getName(), type, + UMLPackage.eINSTANCE.getLiteralInteger()); + } else if (name.equals("Boolean")) { //$NON-NLS-1$ + slot.createValue(valueFor + attribute.getName(), type, + UMLPackage.eINSTANCE.getLiteralBoolean()); + } else { + slot.createValue(valueFor + attribute.getName(), type, + UMLPackage.eINSTANCE.getLiteralString()); + } + } + return slot; + } + + /** + * Create a string slot and a value for a configuration attribute + * + * @param attribute + */ + public static Slot createStringSlotForConfigProp(InstanceSpecification is, + Property attribute) { + + Slot slot = is.createSlot(); + slot.setDefiningFeature(attribute); + Type type = attribute.getType(); + if (type != null) { + slot.createValue(valueFor + attribute.getName(), type, + UMLPackage.eINSTANCE.getLiteralString()); + } + return slot; + } + + /** + * create a deployment plan, i.e. a set of instances that correspond to an + * implementation which is potentially a composite. In case of the latter, + * this function is called recursively to create deployment plans for the + * parts. Since a composite implementation may optionally specify only the + * type of parts (not the concrete implementation), this function also + * supports that a type is passed. In this case, an implementation is + * automatically assigned. + * + * @param cdp + * the deployment plan (package) in which to create instances + * @param typeOrImplem + * the type + * @param nane + * the name of the instance + * @param createSlotsForConfigValues + * if true, create slots for configuration values + */ + public static InstanceSpecification createDepPlan(Package cdp, + Class typeOrImplem, String name, boolean createSlotsForConfigValues) + throws TransformationException { + return createDepPlan(cdp, typeOrImplem, name, createSlotsForConfigValues, new Stack()); + } + + public static InstanceSpecification createDepPlan(Package cdp, + Class typeOrImplem, String name, boolean createSlotsForConfigValues, Stack visitedClassifiers) + throws TransformationException { + // create an instance specification for the composite + if (visitedClassifiers.contains(typeOrImplem)) { + String path = ""; //$NON-NLS-1$ + for (Classifier cl : visitedClassifiers) { + if (path.length() > 0) { + path += ", "; //$NON-NLS-1$ + } + path += cl.getName(); + } + path += ", " + typeOrImplem.getName(); //$NON-NLS-1$ + throw new TransformationException(String.format( + Messages.DepCreation_CircularReference, + typeOrImplem.getQualifiedName(), path)); + } + visitedClassifiers.push(typeOrImplem); + + InstanceSpecification is; + // treat singleton + if (Utils.isSingleton(typeOrImplem)) { + // is a singleton - exactly one instance exists + InstanceSpecification mainInstance = DepUtils.getMainInstance(cdp); + + // use canonical name for singleton instance - lower case for type-name + String partName = DeployConstants.singletonPrefix + typeOrImplem.getName().toLowerCase(); + name = mainInstance.getName() + DeployConstants.SEP_CHAR + partName; + PackageableElement pe = cdp.getPackagedElement(name); + + if (pe == null) { + // instance specification for singleton does not exist yet => create + + Classifier system = DepUtils.getClassifier(mainInstance); + Property singletonAttr = system.getAttribute(partName, typeOrImplem); + if ((singletonAttr == null) && system instanceof Class) { + singletonAttr = ((Class) system).createOwnedAttribute(partName, typeOrImplem); + singletonAttr.setAggregation(AggregationKind.COMPOSITE_LITERAL); + } + + is = (InstanceSpecification) cdp.createPackagedElement(name, UMLPackage.eINSTANCE.getInstanceSpecification()); + // create slot within main instance + createSlot(mainInstance, is, singletonAttr); + } else if (pe instanceof InstanceSpecification) { + // exists already, return it without recursing into its sub-specifications + return (InstanceSpecification) pe; + } else { + // unlikely case that a packaged element with the name + // exists already, but is not an instance specification + throw new TransformationException(String.format( + Messages.DepCreation_SingletonExistsAlready, name)); + } + } else { + is = (InstanceSpecification) cdp.createPackagedElement(name, UMLPackage.eINSTANCE.getInstanceSpecification()); + } + + if (name.equals(DeployConstants.MAIN_INSTANCE)) { + DepUtils.setMainInstance(cdp, is); + } + + Class implementation = null; + + // treat HW architecture or nodes as implementations + if (Utils.isCompImpl(typeOrImplem) + || typeOrImplem instanceof Node) { + // implementation is known => must be able to do this. + if (typeOrImplem instanceof Class) { + implementation = typeOrImplem; + } + } else { + // problem? further tree expansion might depend on chosen + // implementation) + // TODO: don't know node yet => implementation choice is more + // general than necessary + implementation = DepUtils.chooseImplementation(typeOrImplem, null, null); + } + + if (!(implementation instanceof Class)) { + throw new TransformationException(String.format( + Messages.DepCreation_CannotFindImplementation, + name, typeOrImplem.getName())); + } + // else implementation is instance of Class (and not null) + + is.getClassifiers().add(implementation); + // add connector and container implementations + if (createSlotsForConfigValues) { + EList rules = FCMUtil.getAllContainerRules(implementation); + for (ContainerRule rule : rules) { + addConfigurationOfContainer(rule, is); + } + } + + for (Connector connector : implementation.getOwnedConnectors()) { + org.eclipse.papyrus.FCM.Connector fcmConn = UMLUtil.getStereotypeApplication(connector, org.eclipse.papyrus.FCM.Connector.class); + if (fcmConn != null) { + String partName = name + "." + connector.getName(); //$NON-NLS-1$ + InteractionComponent connectorComp = fcmConn.getIc(); + if (connectorComp != null) { + Class cl = fcmConn.getIc().getBase_Class(); + if (cl == null) { + throw new TransformationException(Messages.DepCreation_FCMconnectorWithoutBaseClass); + } + // create sub-instance for connector. It is not possible to + // create a slot in the owning instance specification, + // since the connector cannot be referenced as a defining-feature + createDepPlan(cdp, cl, partName, createSlotsForConfigValues, visitedClassifiers); + } + } + } + + for (Property attribute : implementation.getAllAttributes()) { + // loop over all attributes (not only parts, since we need to + // capture singletons) + if (attribute instanceof Port) { + continue; + } + Type type = attribute.getType(); + + if (Utils.isComposition(attribute)) { + // composition, attribute is a part + if (((type instanceof Class) && Utils.isComponent((Class) type)) || type instanceof Node) { + Class cl = (Class) type; + + // TODO: ad-hoc replication support. Better solution via design patterns + int upper = attribute.getUpper(); + String infix = ""; //$NON-NLS-1$ + + // TODO: check validation constraints + for (int i = 0; i < upper; i++) { + String partName = name + "." + attribute.getName(); //$NON-NLS-1$ + if (upper > 1) { + partName += "_" + infix + i; //$NON-NLS-1$ + } + InstanceSpecification partIS = createDepPlan(cdp, cl, + partName, createSlotsForConfigValues, visitedClassifiers); + // may not create slot for singleton, since automatically done + if (!Utils.isSingleton((Class) type)) { + createSlot(is, partIS, attribute); + } + } + } else if (StereotypeUtil.isApplied(attribute, ConfigurationProperty.class) + && createSlotsForConfigValues) { + // is a configuration property, create slot + // TODO: implicit assumption that configuration attributes + // are not components + createSlotForConfigProp(is, attribute); + } + } else if (type instanceof Class) { + // no composition - only create slot, if a singleton + // (otherwise, it's not clear with which instance the slot + // should be associated) + Log.log(IStatus.INFO, Log.DEPLOYMENT, String.format( + Messages.DepCreation_InfoCreateDepPlan, type.getQualifiedName())); + if (Utils.isSingleton((Class) type)) { + // is a singleton - exactly one instance exists + // recursive call - pass empty name, since name for singletons is re-calculated. + InstanceSpecification singletonIS = createDepPlan(cdp, + (Class) type, "", createSlotsForConfigValues, visitedClassifiers); //$NON-NLS-1$ + createSlot(is, singletonIS, attribute); + } + } else if (type == null) { + throw new TransformationException(String.format(Messages.DepCreation_TypeInAttributeUndefined, + attribute.getName(), implementation.getName())); + } + } + visitedClassifiers.pop(); + return is; + } + + /** + * Create slot for configuration properties that come from container rules + * + * @param aRule + * @param is + * @throws TransformationException + */ + private static void addConfigurationOfContainer(ContainerRule rule, + InstanceSpecification is) throws TransformationException { + boolean first = true; + for (Property attribute : ConfigUtils.getConfigAttributes(rule)) { + Type type = attribute.getType(); + if ((StereotypeUtil.isApplied(attribute, ConfigurationProperty.class)) + && (type instanceof Classifier)) { + Classifier aggregateOrInterceptor; + if (type instanceof Class) { + aggregateOrInterceptor = DepUtils.chooseImplementation( + (Class) type, new BasicEList(), + null); + } else { + aggregateOrInterceptor = (Classifier) type; + } + // is a configuration property, create slot + if (first) { + // add contExtImpl to list of classifiers that the instance + // specification describes + is.getClassifiers().add(aggregateOrInterceptor); + first = false; + } + // CAVEAT: + // - single value specification for all occurrences of an interceptor + // - Could be done, but: how to know whether user wants single + // vs. interceptor specific configuration? + // - two different interceptors may not share the same type with + // a configuration attribute + createSlotForConfigProp(is, attribute); + } + } + } + + /** + * create a deployment plan, i.e. a set of instances that correspond to an + * implementation which is potentially a composite. In case of the latter, + * this function is called recursively to create deployment plans for the + * parts. Since a composite implementation may optionally specify only the + * type of parts (not the concrete implementation), this function also + * supports that a type is passed. In this case, an implementation is + * automatically assigned. + * + * @param cdp + * the deployment plan (package) in which to create instances + * @param typeOrImplem + * the type + * @param nane + * the name of the instance + * @param createSlotsForConfigValues + * if true, create slots for configuration values + */ + public static InstanceSpecification createPlatformInstances( + Package platform, Class implementation, String name) + throws TransformationException { + // create an instance specification for the composite + InstanceSpecification is = null; + is = (InstanceSpecification) platform.createPackagedElement(name, + UMLPackage.eINSTANCE.getInstanceSpecification()); + is.getClassifiers().add(implementation); + + // add connector and container implementations + + for (Property attribute : implementation.getAllAttributes()) { + // loop over all attributes (not only parts, since we need to + // capture singletons) + if (attribute instanceof Port) { + continue; + } + Type type = attribute.getType(); + + if (Utils.isComposition(attribute)) { + // composition, attribute is a part + if (type instanceof Class) { // should be a node, but do not require it + Class cl = (Class) type; + + int upper = attribute.getUpper(); + String infix = ""; //$NON-NLS-1$ + // TODO: check validation constraints + for (int i = 0; i < upper; i++) { + // prefix with name, unless null + String partName = (name != null) ? name + DeployConstants.SEP_CHAR : ""; //$NON-NLS-1$ + partName += attribute.getName(); + if (upper > 1) { + partName += "_" + infix + i; //$NON-NLS-1$ + } + InstanceSpecification partIS = createPlatformInstances( + platform, cl, partName); + + if (is != null) { + createSlot(is, partIS, attribute); + } + } + } else if (StereotypeUtil.isApplied(attribute, + ConfigurationProperty.class)) { + // is a configuration property, create slot + // TODO: implicit assumption that configuration attributes + // are not components + createSlotForConfigProp(is, attribute); + } + } + } + return is; + } + + /** + * Initialize the automatic values within a deployment plan - and the update + * eventual copies of these values. + * + * @param is + * the main instance of the deployment plan + */ + public static void initAutoValues(InstanceSpecification is) { + Collection isList = new ArrayList(); + isList.add(is); + initAutoValues(isList); + } + + /** + * Initialize the automatic values within a deployment plan - and the update + * eventual copies of these values. + * + * @param is + * the main instance of the deployment plan + */ + public static void initAutoValues(Collection isList) { + map = new HashMap(); + for (InstanceSpecification is : isList) { + initAutoValuesHelper(is); + } + Stack isStack = new Stack(); + for (InstanceSpecification is : isList) { + copyAutoValues(isStack, is); + } + } + + /** + * Initialize the automatic values within a deployment plan. + * + * @param is + * the main instance of the deployment plan + */ + public static void initAutoValuesHelper(InstanceSpecification is) { + for (Slot slot : is.getSlots()) { + StructuralFeature sf = slot.getDefiningFeature(); + if (sf == null) { + throw new RuntimeException(String.format(Messages.DepCreation_DefiningFeatureNull, + slot.getOwningInstance().getName())); + } + if (StereotypeUtil.isApplied(sf, AutoIndex.class)) { + Integer value = null; + Object key; + if (StereotypeUtil.isApplied(sf, AutoIndexPerNode.class)) { + InstanceSpecification nodeOrThread = AllocUtils.getNode(is); + key = sf.getName() + nodeOrThread.getName(); + } else { + key = sf; + } + if (!map.containsKey(key)) { + map.put(key, new Integer(0)); + } + value = map.get(key); + value++; // no need to put incremented value back into map, + // since Integer is a reference => value is updated + + // create slot and value specification (literal-integer) for the + // auto index + LiteralInteger li = (LiteralInteger) slot.createValue( + sf.getName() + DeployConstants.AUTO_POSTFIX, sf.getType(), + UMLPackage.eINSTANCE.getLiteralInteger()); + li.setValue(value); + + // recursion in case of values that are instance values + for (ValueSpecification vs : slot.getValues()) { + if (vs instanceof InstanceValue) { + InstanceSpecification subIS = ((InstanceValue) vs).getInstance(); + initAutoValues(subIS); + } + } + } + } + } + + /** + * Copy automatic values within a deployment plan. + * Attributes can apply the CopyAttributeValue stereotype. The stereotype can point + * to another attribute (source). If the other attribute has a configuration value, it gets + * copied. + * The function takes into account that the source attribute might be in a component that is + * instantiated several times with different configuration values. The attribute that gets the + * copy must use the "nearest" value which means that there must be a common composite that + * contains both attribute (indirectly). + * The main use case is that connector fragments need to have common configuration attributes + * (e-g- server fragment has automatic index value, client fragment needs to copy this value) + * + * @param is + * the main instance of the deployment plan + */ + public static void copyAutoValues(Stack isStack, + InstanceSpecification is) { + isStack.push(is); + for (Slot slot : is.getSlots()) { + StructuralFeature sf = slot.getDefiningFeature(); + if (sf == null) { + throw new TransformationRTException(is.getName() + " has a slot without defining feature"); //$NON-NLS-1$ + } + if (StereotypeUtil.isApplied(sf, CopyAttributeValue.class)) { + CopyAttributeValue cav = UMLUtil.getStereotypeApplication(sf, + CopyAttributeValue.class); + Property source = cav.getSource(); + ValueSpecification vs = getNearestValue(isStack, source); + if (vs instanceof LiteralInteger) { + LiteralInteger liCopy = (LiteralInteger) slot.createValue( + sf.getName() + "_copy", sf.getType(), //$NON-NLS-1$ + UMLPackage.eINSTANCE.getLiteralInteger()); + int value = ((LiteralInteger) vs).getValue(); + liCopy.setValue(value); + } + } + + // recursion in case of values that are instance values + for (ValueSpecification vs : slot.getValues()) { + if (vs instanceof InstanceValue) { + InstanceSpecification subIS = ((InstanceValue) vs).getInstance(); + if (subIS != null) { + copyAutoValues(isStack, subIS); + } + } + } + } + isStack.pop(); + } + + /** + * try to find a value (ValueSpecification) for the passed source element, + * beginning a the "deepest" instance specification of the passed stack. If + * not found, continue at elements higher up in the hierarchy + * + * @param isStack + * a stack of instance specifications corresponding to a path + * within an instance tree + * @param source + * a property (defining feature) for which we search an instance + * specification + * @return The value specifications for the passed source property or null + */ + public static ValueSpecification getNearestValue( + Stack isStack, Property source) { + Stack copy = new Stack(); + copy.addAll(isStack); + while (!copy.isEmpty()) { + InstanceSpecification pop = copy.pop(); + ValueSpecification vs = getNearestValueHelper(isStack, pop, source); + if (vs != null) { + return vs; + } + } + return null; + } + + /** + * Helper for getNearestValue: search for an instance specification that has + * source as defining feature. Start at the passed instance specification, + * but do not recurse into elements that are contained in the stack. + * + * @param isStack + * A stack of instance specifications corresponding to a path + * within an instance tree + * @param is + * the starting instance specification + * @param source + * source a property (defining feature) for which we search an + * instance specification + * @return The value specifications for the passed source property or null + */ + public static ValueSpecification getNearestValueHelper( + Stack isStack, InstanceSpecification is, + Property source) { + for (Slot slot : is.getSlots()) { + StructuralFeature sf = slot.getDefiningFeature(); + if (sf == source) { + // found property, now return first value specification + for (ValueSpecification vs : slot.getValues()) { + return vs; + } + return null; + } + + // recursion in case of values that are instance values + for (ValueSpecification vs : slot.getValues()) { + if (vs instanceof InstanceValue) { + InstanceSpecification subIS = ((InstanceValue) vs) + .getInstance(); + if (!isStack.contains(subIS)) { + // only recurse, if not contained in stack of instance + // specifications (avoid traversing + // the same elements multiple times) + return getNearestValueHelper(isStack, subIS, source); + } + } + } + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepPlanUtils.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepPlanUtils.java new file mode 100644 index 00000000000..f1f9b08d475 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepPlanUtils.java @@ -0,0 +1,375 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.deployment; + +import java.util.Iterator; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.Enumerator; +import org.eclipse.emf.ecore.ENamedElement; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Enumeration; +import org.eclipse.uml2.uml.EnumerationLiteral; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.InstanceValue; +import org.eclipse.uml2.uml.LiteralInteger; +import org.eclipse.uml2.uml.LiteralString; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.StructuralFeature; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.ValueSpecification; + +public class DepPlanUtils { + + /** + * Return the package in which deployment plans are stored. Caveat: needs to be executed within a + * transition, since the deployment plan package will be created, if it does not exist yet. + * + * @param element + * an arbitrary element of the source model (i.e. the model that will + * store the deployment plan + * @return package in which deployment plans are stored + */ + public static Package getDepPlanRoot(Element element) { + return Utils.getRoot(element, DeployConstants.depPlanFolder); + } + + /** + * Return all deployment plans + * + * @param element + * an arbitrary element of the source model (i.e. the model that will + * store the deployment plan + * @return + */ + public static EList getAllDepPlans(Element element) { + Package root = PackageUtil.getRootPackage(element); + Package depPlanRoot = root.getNestedPackage(DeployConstants.depPlanFolder); + EList depPlanList = new BasicEList(); + if (depPlanRoot != null) { + for (Package pkg : depPlanRoot.getNestedPackages()) { + if (StereotypeUtil.isApplied(pkg, DeploymentPlan.class)) { + depPlanList.add(pkg); + } + } + } + return depPlanList; + } + + public static void delDepPlan(InstanceSpecification is) { + Iterator slots = is.getSlots().iterator(); + while (slots.hasNext()) { + Slot slot = slots.next(); + InstanceSpecification subInstance = getInstance(slot); + if (subInstance != null) { + delDepPlan(subInstance); + } + } + Element owner = is.getOwner(); + if (owner instanceof Package) { + ((Package) owner).getPackagedElements().remove(is); + } + } + + /** + * Return the instance that is defined by a slot value + * + * @param slot + * @return the first slot that corresponds to an instance specification + */ + public static InstanceSpecification getInstance(Slot slot) { + Iterator values = slot.getValues().iterator(); + while (values.hasNext()) { + ValueSpecification value = values.next(); + // instances are accessible via ValueSpecification subclass InstanceValue + if (value instanceof InstanceValue) { + return ((InstanceValue) value).getInstance(); + } + } + return null; + } + + /** + * create a slot for a given sub-instance specification. + * + * @param cdp + * a deployment plan + * @param is + * an instance specification for a composite class + * @param partIS + * the instance specification of a part within the composite + * @param part + * the part within the composite + */ + public static Slot createSlot(Package cdp, InstanceSpecification is, InstanceSpecification partIS, Property part) { + // the instance specification of the composite has a slot for each part and it points + // to the instance specification associated with the part. + Slot slot = is.createSlot(); + slot.setDefiningFeature(part); + + InstanceValue iv = (InstanceValue) + slot.createValue(null, null, UMLPackage.eINSTANCE.getInstanceValue()); + iv.setInstance(partIS); + return slot; + + } + + /** + * Apply the stereotype deployment plan and set the mainInstance value + * + * @param cdp + * the deployment plan + * @param main + * instance the top-level instance specification of the plan + */ + public static void setMainInstance(Package cdp, InstanceSpecification mainInstance) { + DeploymentPlan cdpApp = StereotypeUtil.applyApp(cdp, DeploymentPlan.class); + if (cdpApp != null) { + cdpApp.setMainInstance(mainInstance); + } + } + + /** + * Automatically choose an implementation, i.e. choose the first implementation + * within the component model that implements a given component type. + */ + public static Class autoChooseImplementation(Classifier componentType) { + // choose implementation automatically: get the first one that implements the passed type + // (problem: further tree expansion might depend on chosen implementation) + // get reference to component model, then search all classes contained in it. + Package compModel = Utils.getRoot(componentType, DeployConstants.COMPONENT_MODEL); + Iterator elements = compModel.allOwnedElements().iterator(); + while (elements.hasNext()) { + Element element = elements.next(); + if (element instanceof Class) { + Class candidate = (Class) element; + if (candidate.getSuperClass(componentType.getName()) != null) { + return candidate; + } + } + } + return null; + } + + /** + * Configure an attribute of an instance specification + * + * @param instance + * the instance specification + * @param property + * An ENamedElement denoting the name of an attribute of a classifier that + * is in the classifier list of the instance specification + * @param value + * the string value. An enumeration can be configured via the name of the literal + */ + public static void configureProperty(InstanceSpecification instance, ENamedElement property, String value) { + configureProperty(instance, property.getName(), value); + } + + /** + * Configure an attribute of an instance specification + * + * @param instance + * the instance specification + * @param propertyName + * the name of an attribute of a classifier that is in the classifier list + * of the instance specification + * @param value + * the string value. An enumeration can be configured via the name of the literal + */ + public static void configureProperty(InstanceSpecification instance, String propertyName, String value) { + Classifier extension = DepUtils.getClassifier(instance); + Property attribute = (Property) Utils.getNamedElementFromList(extension.getAllAttributes(), propertyName); + if (attribute == null) { + throw new RuntimeException(String.format(Messages.DepPlanUtils_CannotFindAttribute, propertyName, extension.getName())); + } + configureProperty(instance, attribute, value); + } + + /** + * Configure an attribute of an instance specification + * + * @param instance + * the instance specification + * @param attribute + * an attribute of a classifier that is in the classifier list of the instance specification + * @param value + * the string value. An enumeration can be configured via the name of the literal + */ + public static void configureProperty(InstanceSpecification instance, Property attribute, String value) { + if (attribute.getType() instanceof Enumeration) { + configureEnumProperty(instance, attribute, value); + } + else { + // create a slot for a string value + Slot slotStringVal = DepCreation.createSlotForConfigProp(instance, attribute); + if (slotStringVal.getValues().get(0) instanceof LiteralString) { + ((LiteralString) slotStringVal.getValues().get(0)).setValue(value); + } + else { + // indicates that operation has been called although types do not match + throw new RuntimeException(String.format(Messages.DepPlanUtils_ConfigOfPropertyFailed, attribute.getName())); + } + } + } + + /** + * Configure an attribute of an instance specification + * + * @param instance + * the instance specification + * @param property + * An ENamedElement denoting the name of an attribute of a classifier that + * is in the classifier list of the instance specification + * @param value + * the integer value. + */ + public static void configureProperty(InstanceSpecification instance, ENamedElement property, int value) { + configureProperty(instance, property.getName(), value); + } + + /** + * Configure an attribute of an instance specification + * + * @param instance + * the instance specification + * @param propertyName + * the name of an attribute of a classifier that is in the classifier list + * of the instance specification + * @param value + * the integer value. + */ + public static void configureProperty(InstanceSpecification instance, String propertyName, int value) { + Classifier extension = DepUtils.getClassifier(instance); + Property attribute = (Property) Utils.getNamedElementFromList(extension.getAllAttributes(), propertyName); + if (attribute == null) { + throw new RuntimeException(String.format(Messages.DepPlanUtils_CannotFindAttribute, propertyName, extension.getName())); + } + configureProperty(instance, attribute, value); + } + + /** + * Configure an attribute of an instance specification + * + * @param instance + * the instance specification + * @param attribute + * an attribute of a classifier that is in the classifier list of the instance specification + * @param value + * the integer value. + */ + public static void configureProperty(InstanceSpecification instance, Property attribute, int value) { + Slot slotIntVal = instance.createSlot(); + slotIntVal.setDefiningFeature(attribute); + LiteralInteger intValue = (LiteralInteger) + slotIntVal.createValue("value for " + attribute.getName(), attribute.getType(), UMLPackage.eINSTANCE.getLiteralInteger()); //$NON-NLS-1$ + intValue.setValue(value); + } + + /** + * Convenience function: allow that an ECore named element is passed instead of a property name. This is useful if the + * parameter that should be configured stems from a static profile + * + * @param instance + * The instance of which an attribute should be configured. + * @param property + * The name of the property (denoted by an ENamedElement) that should be configured + * @param value + * its value in form of an element of an ECore enumerator value + */ + public static void configureProperty(InstanceSpecification instance, ENamedElement property, Enumerator value) { + configureProperty(instance, property.getName(), value); + } + + /** + * Configure a property for an enumeration. Enumerations are a bit difficult to handle, since the enumeration literal itself + * must be created first in form of an instance specification + * + * @param instance + * The instance of which an attribute should be configured. + * @param propertyName + * The name of the property that should be configured + * @param value + * its value in form of an element of an ECore enumerator value + */ + public static void configureProperty(InstanceSpecification instance, String propertyName, Enumerator value) { + configureProperty(instance, propertyName, value.getName()); + } + + /** + * Configure a property for an enumeration. Enumerations are a bit difficult to handle, since the enumeration literal itself + * must be created first in form of an instance specification. + * + * @param instance + * The instance of which an attribute should be configured. + * @param propertyName + * The name of the property that should be configured + * @param value + * its value in form of an String. The function does nothing, if no literal corresponds to the passed + * String + */ + public static void configureEnumProperty(InstanceSpecification instance, String propertyName, String literalName) { + Classifier extension = DepUtils.getClassifier(instance); + Property attribute = (Property) Utils.getNamedElementFromList(extension.getAllAttributes(), propertyName); + if (attribute == null) { + throw new RuntimeException(String.format(Messages.DepPlanUtils_CannotFindAttribute, propertyName, extension.getName())); + } + configureEnumProperty(instance, attribute, literalName); + } + + public static void configureEnumProperty(InstanceSpecification instance, Property attribute, String literalName) { + if (attribute.getType() instanceof Enumeration) { + Enumeration enumeration = (Enumeration) attribute.getType(); + for (EnumerationLiteral enumLiteral : enumeration.getOwnedLiterals()) { + if (enumLiteral.getLabel().equals(literalName)) { + Slot slotEnumVal = instance.createSlot(); + slotEnumVal.setDefiningFeature(attribute); + InstanceValue enumLitValue = (InstanceValue) + slotEnumVal.createValue("value for " + attribute.getName(), attribute.getType(), UMLPackage.eINSTANCE.getInstanceValue()); //$NON-NLS-1$ + enumLitValue.setInstance(enumLiteral); + break; + } + } + } + } + + /** + * Update the names of instances within a deployment plan to correspond to changes + * in the hierarchy. In particular, flattening of interaction components requires this update. + * + * @param composite + * System composite + */ + public static void updateInstanceNames(InstanceSpecification instance, String name) { + instance.setName(name); + for (Slot slot : instance.getSlots()) { + InstanceSpecification subInstance = DepUtils.getInstance(slot); + StructuralFeature sf = slot.getDefiningFeature(); + if ((subInstance != null) && !DepUtils.isShared(slot)) { + updateInstanceNames(subInstance, name + DeployConstants.SEP_CHAR + sf.getName()); + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepUtils.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepUtils.java new file mode 100644 index 00000000000..9d687ed40d1 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DepUtils.java @@ -0,0 +1,564 @@ +package org.eclipse.papyrus.qompass.designer.core.deployment; + +import java.util.Iterator; +import java.util.Stack; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.UniqueEList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature.Setting; +import org.eclipse.papyrus.FCM.CodeGenOptions; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.FCM.ImplementationGroup; +import org.eclipse.papyrus.FCM.ImplementationProperties; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.FCM.Target; +import org.eclipse.papyrus.qompass.designer.core.ElementFilter; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.common.util.UML2Util; +import org.eclipse.uml2.uml.AggregationKind; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.DirectedRelationship; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Generalization; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.InstanceValue; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.StructuralFeature; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.ValueSpecification; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Utilities around instances (within deployment plan) + * [DepPlanUtils?] + * [but missing: creation, ..., allocation?] + * Structuration ?? + * + * @author ansgar + * + */ +public class DepUtils { + + /** + * Check whether a class is an eligible implementation for a certain node, i.e. + * has compatible requirements. + * Requires that setCurrentNode has been called earlier + * TODO: how does that work with connector reification between distributeToNode has been + * called??! + * + * @param implemCandidate + * @return + */ + public static boolean isImplEligible(Class implemCandidate, EList nodes) { + if (!Utils.isCompImpl(implemCandidate)) { + return false; + } + if (nodes != null) { + // now check properties + if (nodes.size() > 1) { + // indicates distribution + InteractionComponent connImpl = UMLUtil.getStereotypeApplication(implemCandidate, InteractionComponent.class); + // if a connector implementation, it must support distribution (in case of multiple nodes) + // TODO: criteria is not optimal, since a composite may be deployed on multiple nodes, + // but a contained connector might still only connect local parts. + if (connImpl != null) { + if (!connImpl.isForDistribution()) { + return false; + } + } + } + // must fit requirements of all nodes + for (InstanceSpecification nodeInstance : nodes) { + Target target = UMLUtil.getStereotypeApplication(nodeInstance, Target.class); + if (target == null) { + // no target information on instance => try to get this + // information from the node referenced by the instance + target = UMLUtil.getStereotypeApplication(DepUtils.getClassifier(nodeInstance), Target.class); + } + if (target != null) { + ImplementationProperties implProps = UMLUtil.getStereotypeApplication(implemCandidate, ImplementationProperties.class); + if (implProps != null) { + if (!implProps.getArch().contains(target.getTargetArch())) { + return false; + } + // TODO: check OS and size as well! + } + } + } + } + return true; + } + + /** + * Find a sub instance via its name. This is in particular useful for connectors that cannot be + * found via a slot, since UML only supports structural features (a connector is only a feature) + * in the definingFeature attribute of a slot. + * + * @param owningInstance + * an owning instance + * @param name + * name of the sub-element (unqualified) + * @return the found sub-instance or null + */ + public static InstanceSpecification getNamedSubInstance(InstanceSpecification owningInstance, String name) { + Element cdp = owningInstance.getOwner(); + String candidateName = owningInstance.getName() + "." + name; //$NON-NLS-1$ + if (cdp instanceof Package) { + for (PackageableElement instance : ((Package) cdp).getPackagedElements()) { + if (instance instanceof InstanceSpecification) { + InstanceSpecification candidate = (InstanceSpecification) instance; + + if (candidateName != null) { + if (candidateName.equals(candidate.getName())) { + return candidate; + } + } + } + } + } + return null; + } + + /** + * Automatically choose an implementation, i.e. if the passed classifier + * (1) is already an implementation, simply return it + * (2) is an implementation group, choose the first implementation that fits the requirements + * (3) is a type: choose the first implementation among the heirs that fits the requirements + * + * @param componentType + * a component type or implementation (class, optionally abstract) + * @param nodes + * a set of instance specification representing nodes on which this component will be allocated + * @param chooser + * A chooser for an implementation in case of multiple candidates + * @return a suitable implementation + */ + public static Class chooseImplementation(Class componentType, EList nodes, ImplementationChooser chooser) { + // choose implementation automatically: get the first one that implements the passed type + // get reference to component model, then search all classes contained in it. + // TODO: assumption that implementations are in same package as type; + + EList implList = new BasicEList(); + if (StereotypeUtil.isApplied(componentType, ImplementationGroup.class)) { + for (Property groupAttribute : componentType.getAttributes()) { + Type implClass = groupAttribute.getType(); + if ((implClass instanceof Class) && isImplEligible((Class) implClass, nodes)) { + InteractionComponent connImpl = UMLUtil.getStereotypeApplication(implClass, InteractionComponent.class); + if ((connImpl != null) && connImpl.isForDistribution()) { + // only add distributed connector, if distributed + // don't put check into + if (nodes.size() > 1) { + implList.add((Class) implClass); + } + } + else { + implList.add((Class) implClass); + } + } + } + } else if (Utils.isCompImpl(componentType)) { + // check this after implementation group, since the latter inherits from component implementation + return componentType; + } else if (Utils.isCompType(componentType)) { + for (DirectedRelationship relship : componentType.getTargetDirectedRelationships()) { + if (relship instanceof Generalization) { + Classifier source = ((Generalization) relship).getSpecific(); + if (source instanceof Class) { + Class implClass = (Class) source; + if (isImplEligible(implClass, nodes)) { + implList.add(implClass); + } + } + } + } + } + if (implList.size() == 0) { + return null; + } else if (implList.size() == 1) { + return implList.get(0); + } else if (chooser != null) { + Class impl = chooser.chooseImplementation(componentType, implList); + if (impl != null) { + return impl; + } + } else if (implList.size() > 0) { + return implList.get(0); + } + return null; + } + + /** + * return an instance specification for the main instance within + * a package. + * + * @param cdp + * the deployment plan + */ + public static InstanceSpecification getMainInstance(Package cdp) { + DeploymentPlan dp = UMLUtil.getStereotypeApplication(cdp, DeploymentPlan.class); + return dp.getMainInstance(); + } + + /** + * Check whether an instance specification is a top-level instance, i.e. not referenced + * by another one. + * @param is an instance specification + */ + public static boolean isTopLevelInstance(InstanceSpecification is) { + return getReferencingSlots(is).size() == 0; + } + + /** + * Apply the stereotype deployment plan and set the mainInstance value + * + * @param cdp + * the deployment plan + * @param main + * instance the top-level instance specification of the plan + */ + public static void setMainInstance(Package cdp, InstanceSpecification mainInstance) { + StereotypeUtil.apply(cdp, DeploymentPlan.class); + DeploymentPlan dp = UMLUtil.getStereotypeApplication(cdp, DeploymentPlan.class); + dp.setMainInstance(mainInstance); + } + + /** + * return the implementation associated with an instance specification, i.e. a + * Class. + * + * @param instance + * @return + */ + public static Class getImplementation(InstanceSpecification instance) { + Classifier cl = getClassifier(instance); + if (cl instanceof Class) { + return (Class) cl; + } + return null; + } + + /** + * Small helper function + * + * @param instance + * an instance specification + * @return returns true, if the stereotype ConnectorComp + * is applied to the classifier associated with an instance specification + */ + public static boolean isConnector(InstanceSpecification instance) { + Classifier cl = getClassifier(instance); + return StereotypeUtil.isApplied(cl, InteractionComponent.class); + } + + /** + * Return the first classifier referenced by an instance specification. Whereas UML supports + * a set of classifiers, we assume that that an instance specification has only one. + * + * @param instance + * the instance, for which we are interested in type information + */ + public static Classifier getClassifier(InstanceSpecification instance) { + Iterator classifierIt = instance.getClassifiers().iterator(); + // simply return the first element (if there is any) + if (classifierIt.hasNext()) { + return classifierIt.next(); + } + return null; + } + + /** + * Return the first instance specification within a deployment plan that instantiates a given + * classifier + * + * @param cdp + * the deployment plan + * @param cl + * the classifier + * @return + */ + public static InstanceSpecification getInstanceForClassifier(Package cdp, Classifier cl) { + for (PackageableElement pe : cdp.getPackagedElements()) { + if (pe instanceof InstanceSpecification) { + InstanceSpecification is = (InstanceSpecification) pe; + if (getClassifier(is) == cl) { + return is; + } + } + } + return null; + } + + /** + * Return the (unique) list of implementations that are contained within an + * instance specification + */ + public static EList getContainedImplementations(InstanceSpecification is) { + Iterator instances = getContainedInstances(is).iterator(); + EList list = new UniqueEList(); + while (instances.hasNext()) { + Classifier implementation = getClassifier(instances.next()); + list.add(implementation); + } + return list; + } + + /** + * Return the slot that is associated with a property + * + * @param is + * an instance specification (of a class having properties) + * @param property + * A property of the classifier associated with the passed instance specification + * @return the associated slot or null, if it does not exist + */ + public static Slot getSlot(InstanceSpecification is, Property property) { + for (Slot slot : is.getSlots()) { + if (slot.getDefiningFeature() == property) { + return slot; + } + } + return null; + } + + /** + * Return the instance referenced by a slot value, i.e. the first instance value associated + * with a slot + * + * @param slot + * @return + */ + public static InstanceSpecification getInstance(Slot slot) { + for (ValueSpecification value : slot.getValues()) { + // instances are accessible via ValueSpecification subclass InstanceValue + if (value instanceof InstanceValue) { + return ((InstanceValue) value).getInstance(); + } + } + return null; + } + + /** + * This method returns the instances contained within a composite instance + * specification for an assembly. + */ + public static EList getContainedInstances(InstanceSpecification is) { + EList contained = new BasicEList(); + for (Slot slot : is.getSlots()) { + InstanceSpecification instance = getInstance(slot); + if (instance != null) { + contained.add(instance); + } + } + return contained; + } + + /** + * This method returns the instances contained within a composite instance + * specification for an assembly. Unlike @see getContainedInstances, this method only + * returns contained instances that are not shared. + */ + public static EList getContainedNonSharedInstances(InstanceSpecification is) { + EList contained = new BasicEList(); + for (Slot slot : is.getSlots()) { + InstanceSpecification instance = getInstance(slot); + if ((instance != null) && !DepUtils.isShared(slot)) { + contained.add(instance); + } + } + return contained; + } + + /** + * return all slots that reference an instance specification + * + * @param is + * @return + */ + public static EList getReferencingSlots(InstanceSpecification is) { + EList list = new BasicEList(); + for (Setting setting : UML2Util.getNonNavigableInverseReferences(is)) { + EObject eObj = setting.getEObject(); + if (eObj instanceof ValueSpecification) { + ValueSpecification vs = (ValueSpecification) eObj; + Element owner = vs.getOwner(); + if (owner instanceof Slot) { + list.add((Slot) owner); + } + } + } + return list; + } + + /** + * Return a slot for a given instance specification. The slot is the first one in a list of slots + * whose value points to the passed instance. + * + * @param is + * an instance that is contained within an composite (i.e. that + * belongs to a part of this composite). + * @return + */ + public static Slot getParentSlot(InstanceSpecification is) { + for (Slot slot : getReferencingSlots(is)) { + if (slot.getDefiningFeature() instanceof Property) { + if (((Property) slot.getDefiningFeature()).getAggregation() == AggregationKind.COMPOSITE_LITERAL) { + return slot; + } + } + } + return null; + } + + /** + * Return an instance specification that refers to the composite in which the + * passed instance is contained + * + * @param is + * an instance that is contained within an composite (i.e. that + * belongs to a part of this composite). + * @return + */ + public static InstanceSpecification getParentIS(InstanceSpecification is) { + Slot parentSlot = getParentSlot(is); + if (parentSlot != null) { + return parentSlot.getOwningInstance(); + } + return null; + } + + /** + * Return the access path in terms of slots to an instance specification, i.e. the + * set of slots starting with the slot within the main instance that identifies the next + * instance until arriving at the passed instance. + * + * @param is + * @return + */ + public static Stack getAccessPath(InstanceSpecification is) { + Stack path = new Stack(); + while (is != null) { + Slot parentSlot = getParentSlot(is); + if (parentSlot == null) { + break; + } + path.insertElementAt(parentSlot, 0); + is = parentSlot.getOwningInstance(); + } + return path; + } + + /** + * Return true, if an instance is shared + * + * @param slot + * @return + */ + public static boolean isShared(Slot slot) { + StructuralFeature df = slot.getDefiningFeature(); + if (df instanceof Property) { + return ((Property) df).getAggregation() == AggregationKind.SHARED_LITERAL; + } + return false; + } + + /** + * Determine which programming language should be generated for a classifier. The + * stereotype CodeGenOptions (which could be on any owning package) is evaluated. + * + * @param pkg + * a classifier + * @return the programming language + */ + public static String getLanguageFromPackage(Package pkg) { + CodeGenOptions codeGenOpt = UMLUtil.getStereotypeApplication(pkg, CodeGenOptions.class); + if ((codeGenOpt != null) && (codeGenOpt.getProgLanguage() != null)) { + return codeGenOpt.getProgLanguage().getBase_Class().getName(); + } + else if (pkg.getOwner() instanceof Package) { + return getLanguageFromPackage((Package) pkg.getOwner()); + } + else { + return null; + } + } + + /** + * Return the target language when given the mainInstance + * @param mainInstance the mainInstance of an application + * @return target language + */ + public static String getTargetLanguage(InstanceSpecification mainInstance) { + Classifier cl = DepUtils.getClassifier(mainInstance); + String targetLanguage = DepUtils.getLanguageFromPackage(cl.getNearestPackage()); + if (targetLanguage == null) { + targetLanguage = "C++"; //$NON-NLS-1$ + } + return targetLanguage; + } + + /** + * Determine the component to OO language. The stereotype CodeGenOptions + * (which could be on any owning package) is evaluated. + * + * @param pkg + * a classifier + * @return the programming language + */ + public static String getOOTransformationFromPackage(Package pkg) { + CodeGenOptions codeGenOpt = UMLUtil.getStereotypeApplication(pkg, CodeGenOptions.class); + if ((codeGenOpt != null) && (codeGenOpt.getProgLanguage() != null)) { + return codeGenOpt.getCompToOOmapping().getBase_Class().getName(); + } + else if (pkg.getOwner() instanceof Package) { + return getLanguageFromPackage((Package) pkg.getOwner()); + } + else { + return null; + } + } + + /** + * Get all instances within a package that comply with a filter criterion. Recurse into sub-packages. + * + * @param pkg + * Starting package for search + * @param instanceList + * list of instances + * @param filter + * filter criterion. + */ + public static void getAllInstances(Package pkg, EList instanceList, ElementFilter filter) { + for (PackageableElement el : pkg.getPackagedElements()) { + if (el instanceof Package) { + getAllInstances((Package) el, instanceList, filter); + } + else if (el instanceof InstanceSpecification) { + InstanceSpecification instance = (InstanceSpecification) el; + if (filter.acceptElement(instance)) { + instanceList.add(instance); + } + } + } + } + + /** + * Return the first value for a slot. + * + * @param slot + * the slot for which the first value should be returned. + * @return + */ + public static ValueSpecification firstValue(Slot slot) { + if (slot.getValues().size() > 0) { + return slot.getValues().get(0); + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/Deploy.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/Deploy.java new file mode 100644 index 00000000000..45ae01fc3db --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/Deploy.java @@ -0,0 +1,188 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.deployment; + +import java.util.Stack; + +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.extensions.InstanceConfigurator; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.StructuralFeature; + +/* + * This file is part of Qompass GenTools + * Copyright (C) 2008 CEA LIST (http://www-list.cea.fr/) + + * initial developer : Ansgar Radermacher, Christophe JOUVRAY from CEA LIST + */ + +public class Deploy { + + /** + * distribute an instance, its contained sub-instances and the referenced + * classifiers to a certain target node + * + * @param copier + * lazy copier from intermediate to target model + * @param gatherConfigData + * an implementation that is able to gather configuration data (e.g. information about dependencies to external libraries) that will be used for project configuration + * @param node + * the instance specification of the target node + * @param nodeIndex + * the index of the target node (used for bootloader generation) + * @param numberOfNodes + * the total number of indexes (used for bootloader generation) + * @throws TransformationException + */ + public Deploy(LazyCopier copier, GatherConfigData gatherConfigData, InstanceSpecification node, + int nodeIndex, int numberOfNodes) + throws TransformationException { + bootLoaderGen = new BootLoaderGen(copier, nodeIndex, numberOfNodes); + bootLoaderGen.addCreateConnections(); + + this.node = node; + + // change to flat copy eventually later (not yet working) + depInstance = new PartialCopy(); + + depInstance.init(copier, bootLoaderGen, node); + + // set a copy listener in order to assure that indirectly added classes + // are taken into account as well + this.copier = copier; + copier.preCopyListeners.add(gatherConfigData); + } + + public void finalize(String language) { + bootLoaderGen.addInit(language); + } + + /** + * distribute an instance, its contained sub-instances and the referenced + * classifiers to a certain node + * + * @param instance + * the specification of the instance to distribute + * @return the instance specification in the target model + * @throws TransformationException + */ + public InstanceSpecification distributeToNode(InstanceSpecification instance) + throws TransformationException { + Stack slotPath = new Stack(); + InstanceSpecification newIS = distributeToNode(false, slotPath, instance); + + return newIS; + } + + /** + * Distribute an instance specification to the node by this + * + * @param allocAll + * @param slotPath + * @param instance + * @throws TransformationException + */ + public InstanceSpecification distributeToNode(boolean allocAll, Stack slotPath, InstanceSpecification instance) + throws TransformationException { + + // once an instance is explicitly allocated on a partition (use of getNodes instead of getAllNodes) + // all of its sub-instances are allocated on the node as well + + if (AllocUtils.getNodesOrThreads(instance).contains(node)) { + allocAll = true; + } + + // obtain implementation within source model + Classifier smImplementation = DepUtils.getClassifier(instance); + if (smImplementation == null) { + throw new TransformationException(String.format( + Messages.Deploy_0, instance.getName())); + } + + // copy implementation into node specific model + InstanceSpecification tmInstance = depInstance.deployInstance(instance, slotPath); + Classifier tmImplementation = DepUtils.getClassifier(tmInstance); + // Classifier tmImplementation = copy.getCopy(smImplementation); + + for (Slot slot : instance.getSlots()) { + InstanceSpecification containedInstance = DepUtils.getInstance(slot); + + if (containedInstance != null) { + if (!DepUtils.isShared(slot)) { + StructuralFeature sf = slot.getDefiningFeature(); + boolean viaAllocAll = allocAll; + if (allocAll && (sf instanceof Property)) { + // only take allocation of parent instance into account, if composition + // However, problematic, since code gets copied anyway. + // viaAllocAll = (((Property) sf).getAggregation() == AggregationKind.COMPOSITE_LITERAL); + } + if (viaAllocAll || AllocUtils.getAllNodes(containedInstance).contains(node)) { + slotPath.push(slot); + if (sf instanceof Property) { + // place configurator before recursive call. Otherwise + // values put here would be ignored. + // TODO: instances are not copied to node model. Thus, the instances here are the same as in the + // configuration on the intermediate model. + // TODO: MIX of bootloaderGeneration and splitting. + InstanceConfigurator.configureInstance(containedInstance, (Property) sf, tmInstance); + } + // distribute subInstance + distributeToNode(allocAll, slotPath, containedInstance); + slotPath.pop(); + } + } else if (allocAll || AllocUtils.getAllNodes(containedInstance).contains(node)) { + slotPath.push(slot); + // bootLoaderGen.instanceConfig(slotPath, instance); + bootLoaderGen.addInstance(slotPath, containedInstance, null, node); + slotPath.pop(); + } + } else { + // slot contains configuration of primitive attribute (no + // sub-instance, but primitive value) + slotPath.push(slot); + bootLoaderGen.instanceConfig(slotPath, instance); + slotPath.pop(); + } + } + + // ... and add the instance to the bootloader (this is done after + // copying the slots to + // ensure that the bootloader generator has the information about + // contained parts & connectors + // TODO: really necessary? + if (tmImplementation instanceof Class) { + bootLoaderGen.addInstance(slotPath, instance, (Class) tmImplementation, node); + } + return tmInstance; + } + + public Class getBootloader() { + return bootLoaderGen.getUML(); + } + + protected BootLoaderGen bootLoaderGen; + + protected InstanceSpecification node; + + protected InstanceDeployer depInstance; + + protected LazyCopier copier; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DeployConstants.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DeployConstants.java new file mode 100644 index 00000000000..0c087999818 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/DeployConstants.java @@ -0,0 +1,14 @@ +package org.eclipse.papyrus.qompass.designer.core.deployment; + +public class DeployConstants { + + public static final String singletonPrefix = "singleton_"; //$NON-NLS-1$ + public static final String COMPONENT_MODEL = "ComponentModel"; //$NON-NLS-1$ + public static final String depPlanFolder = "deployment"; //$NON-NLS-1$ + public static final String depPlanFolderHw = "platform"; //$NON-NLS-1$ + public static final String DepPlanPostfix = "DepPlan"; //$NON-NLS-1$ + public static final String DepPlanPostfixHw = "Platform"; //$NON-NLS-1$ + public static final String MAIN_INSTANCE = "mainInstance"; //$NON-NLS-1$ + public static final String SEP_CHAR = "."; //$NON-NLS-1$ + public static final String AUTO_POSTFIX = "_auto"; //$NON-NLS-1$ +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/GatherConfigData.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/GatherConfigData.java new file mode 100644 index 00000000000..62574661a24 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/GatherConfigData.java @@ -0,0 +1,64 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.deployment; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.codegen.extensionpoints.AbstractSettings; +import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; +import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.uml2.uml.Class; + +/** + * Gather configuration data for a code generation project + * In particular, a class might be stereotyped to provide additional information + * about required compilation options (in case of C++ include paths, libraries, ...) + * + * @author ansgar + */ +public class GatherConfigData implements PreCopyListener { + + /** + * Gather configuration data for a code generation project + * Constructor. + * + * @param projectSupport + * A reference to a class providing the language support interface + */ + public GatherConfigData(ILangProjectSupport projectSupport) { + this.projectSupport = projectSupport; + settings = projectSupport.initialConfigurationData(); + } + + @Override + public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { + if (sourceEObj instanceof Class) { + projectSupport.gatherConfigData((Class) sourceEObj, settings); + } + return sourceEObj; + } + + /** + * Return the settings that have been gathered + * @return + */ + public AbstractSettings getSettings() { + return settings; + } + + protected ILangProjectSupport projectSupport; + + protected AbstractSettings settings; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/ImplementationChooser.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/ImplementationChooser.java new file mode 100644 index 00000000000..a80a4d4a5df --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/ImplementationChooser.java @@ -0,0 +1,34 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.deployment; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.uml2.uml.Class; + +/** + * Choose a component implementation for a given component type + */ +public interface ImplementationChooser { + /** + * Choose a component implementation from a list of available implementations + * + * @param componentType + * a (abstract) component + * @param implList + * a list of available component implementations + * @return the chosen implementation. + */ + public Class chooseImplementation(Class componentType, EList implList); +}; diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/InstanceDeployer.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/InstanceDeployer.java new file mode 100644 index 00000000000..eaf07e3b0a7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/InstanceDeployer.java @@ -0,0 +1,63 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.deployment; + +import java.util.Stack; + +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Slot; + +/** + * Deploy an instance (on a certain node). This operation is specifically non recursive + * + * @author ansgar + * + */ +public interface InstanceDeployer { + + /** + * Initialize the deployment + * + * @param sat + * information about source and target model + * @param bootloader + * the bootloader generator, which will contain instance information + * @param node + * the node onto which the allocation should be done. + */ + public void init(LazyCopier sat, BootLoaderGen bootloader, InstanceSpecification node); + + /** + * Deploy an instance and copy the required classes into the target model. + * In case of a composite (assembly) class that is partially deployed on a target node + * (i.e. a subset of its parts is deployed on the target node, but not composite itself), + * this function may only partially copy the class or omit it completely. + * Parts and connections are not copied in the first place to take care of partially + * deployed composites and added when needed. + * Therefore, this function is also responsible for creating the part associated with the + * instance in the owning composite class and eventually complete connections within the + * composites. + * + * @param is + * an instance (UML instance specification) within the deployment plan + * @param slotPath + * a list (stack) of slots starting from the main instance + * @return the classifier modified for deployment + * @throws TransformationException + */ + public InstanceSpecification deployInstance(InstanceSpecification is, Stack slotPath) throws TransformationException; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/PartialCopy.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/PartialCopy.java new file mode 100644 index 00000000000..6e8f10248fc --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/deployment/PartialCopy.java @@ -0,0 +1,126 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.deployment; + +import java.util.Stack; + +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.ConnectorEnd; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; + +/** + * Copy a composite class while taking into account node allocation, i.e. only + * copy parts that are deployed on a certain node (properties that are not typed + * by a component are always copied). This function may be called several times + * and will successively add parts that are required. If the same composite + * (class level) is used in two different contexts, e.g. a socket connector + * serving as client and server on the same node (for the same interface), the + * resulting composite will be complete. On the instance level however, such as + * composite is sub-optimal, since their are two different instances that use a + * different subset. These cases are not very critical, since unused parts are + * not instantiated (overhead = pointer) + * + * The function will change assembly composites + * + * @author ansgar + * + */ +public class PartialCopy implements InstanceDeployer { + + @Override + public void init(LazyCopier copy, BootLoaderGen bootloader, + InstanceSpecification node) { + this.copy = copy; + this.node = node; // only needed for debug output + // add copy listeners --- + // 1. only add required parts + // does nothing for the moment + } + + @Override + public InstanceSpecification deployInstance(InstanceSpecification is, Stack slotPath) throws TransformationException { + Classifier classifier = DepUtils.getClassifier(is); + + // only make a partial copy of the system class (slotPath size 0) for the moment. + if (!(classifier instanceof Class) || slotPath.size() > 0) { + return copy.getCopy(is); + } + if (AllocUtils.getNodes(is).contains(node)) { + return copy.getCopy(is); + } + + Class smCl = (Class) classifier; + + // create parts in target model, if allocated. + for (Slot slot : is.getSlots()) { + copyPart(smCl, slot); + } + // since we copied some of its attributes, the copy class created a shallow copy of the class itself + InstanceSpecification tmIS = (InstanceSpecification) copy.get(is); + return tmIS; + } + + /** + * copy a part of a classifier, without being recursive [shouldn't that be in the generic deploy part?] + * This function is called, whenever a sub-instance is deployed + * Brainstorming: add containing composite to deployInstance? (in this case, deployInstance could create the + * part in the containing composite, if it does not exist yet) + * + * @param cl + * @param newCl + * @param slot + * @param allocAll + * @throws TransformationException + */ + protected void copyPart(Class smCl, Slot slot) throws TransformationException { + Property smPart = (Property) slot.getDefiningFeature(); + // Log.log(Status.INFO, Log.DEPLOYMENT, "smCl:" + smCl.getQualifiedName ()); + // Log.log(Status.INFO, Log.DEPLOYMENT, "tmCl:" + tmCl.getQualifiedName ()); + + // String partName = smPart.getName(); + InstanceSpecification instanceOrThread = DepUtils.getInstance(slot); + // instance may be null, if slot refers to a basic type, e.g. a string + if ((instanceOrThread == null) || AllocUtils.getNodes(instanceOrThread).contains(node)) { + copy.copy(slot); + + // add connectors when possible, i.e. connectors that target the newly added part + for (Connector smConnector : smCl.getOwnedConnectors()) { + // check whether the newly added property enables the addition of connectors + // that connect this port. + if (ConnectorUtil.connectsPart(smConnector, smPart)) { + ConnectorEnd otherEnd = ConnectorUtil.connEndNotPart(smConnector, smPart); + // check whether the part references by the other end (i.e. that not connected with the part) + // TODO: take connections without port into account + Property otherPart = otherEnd.getPartWithPort(); + // compare part names, since connector points to parts within the source model + if ((otherPart == null) || (copy.get(otherPart) != null)) { + copy.copy(smConnector); + } + } + } + } + } + + private InstanceSpecification node; + + private LazyCopier copy; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/BindingHelperExt.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/BindingHelperExt.java new file mode 100644 index 00000000000..b62aa607bfe --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/BindingHelperExt.java @@ -0,0 +1,98 @@ +/******************************************************************************* + * Copyright (c) 2011 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.extensions; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.FCM.BindingHelper; +import org.eclipse.papyrus.FCM.util.IBindingHelper; +import org.eclipse.papyrus.qompass.designer.core.listeners.PostCopyListener; +import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationRTException; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.TemplateBinding; + + +/** + * Support for binding helper + */ +public class BindingHelperExt { + + public static final String IBINDING_HELPER_ID = org.eclipse.papyrus.FCM.Activator.PLUGIN_ID + ".fcmBindingHelper"; //$NON-NLS-1$ + + /** + * + * @param iConfiguratorName + * @param component + * containing composite (container) + * @param instance + */ + public static EObject applyPreHelper(BindingHelper helper, LazyCopier copier, TemplateBinding binding, EObject sourceEObj) { + IBindingHelper ihelper = getBindingHelper(helper.getBase_Class().getName()); + if (sourceEObj instanceof Element) { + ihelper.handleElement(binding, (Element) sourceEObj); + } + if (ihelper instanceof PreCopyListener) { + return ((PreCopyListener) ihelper).preCopyEObject(copier, sourceEObj); + } + return sourceEObj; + } + + /** + * + * @param iConfiguratorName + * @param component + * containing composite (container) + * @param instance + */ + public static void applyPostHelper(BindingHelper helper, LazyCopier copier, TemplateBinding binding, EObject targetEObj) { + IBindingHelper ihelper = getBindingHelper(helper.getBase_Class().getName()); + if (targetEObj instanceof Element) { + ihelper.handleElement(binding, (Element) targetEObj); + } + if (ihelper instanceof PostCopyListener) { + ((PostCopyListener) ihelper).postCopyEObject(copier, targetEObj); + } + } + + public static IBindingHelper getBindingHelper(BindingHelper helper) { + if (helper != null) { + return getBindingHelper(helper.getBase_Class().getName()); + } + return null; + } + + public static IBindingHelper getBindingHelper(String helperName) { + IExtensionRegistry reg = Platform.getExtensionRegistry(); + IConfigurationElement[] configElements = reg.getConfigurationElementsFor(IBINDING_HELPER_ID); + for (IConfigurationElement configElement : configElements) { + try { + final String configHelperName = configElement.getAttribute("bindingHelperName"); //$NON-NLS-1$ + if (configHelperName.equals(helperName)) { + // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) + final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ + if (obj instanceof IBindingHelper) { + return (IBindingHelper) obj; + } + } + } catch (CoreException exception) { + exception.printStackTrace(); + } + } + throw new TransformationRTException( + String.format("Cannot find binding helper <%s>", helperName)); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/EmbeddingRule.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/EmbeddingRule.java new file mode 100644 index 00000000000..7427a38a21f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/EmbeddingRule.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * Copyright (c) 2011 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.extensions; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.papyrus.qompass.designer.core.Activator; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Port; + + +/** + * Support for embedding rules. + * CAVEAT: Currently not used, unclear if kept + */ +@Deprecated +public class EmbeddingRule { + + public static final String IEMBEDDING_RULE_ID = Activator.PLUGIN_ID + ".embeddingRule"; //$NON-NLS-1$ + + /** + * + * @param iConfiguratorName + * @param component + * containing composite (container) + * @param instance + */ + public static void embeddExtension(String embeddingRuleID, InstanceSpecification executorIS, InstanceSpecification instance, Port port) { + IEmbeddingRule iEmbeddingRule = getEmbeddingRule(embeddingRuleID); + if (iEmbeddingRule != null) { + iEmbeddingRule.embeddExtension(executorIS, instance, port); + } + } + + private static IEmbeddingRule getEmbeddingRule(String embeddingRuleID) { + IExtensionRegistry reg = Platform.getExtensionRegistry(); + IConfigurationElement[] configElements = reg.getConfigurationElementsFor(IEMBEDDING_RULE_ID); + for (IConfigurationElement configElement : configElements) { + try { + final String iConfiguratorIDext = configElement.getAttribute("configuratorID"); //$NON-NLS-1$ + if (iConfiguratorIDext.equals(embeddingRuleID)) { + // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) + final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ + if (obj instanceof IEmbeddingRule) { + return (IEmbeddingRule) obj; + } + } + } catch (CoreException exception) { + exception.printStackTrace(); + } + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/ExternalGenerator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/ExternalGenerator.java new file mode 100644 index 00000000000..2094a2239f8 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/ExternalGenerator.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (c) 2011 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.extensions; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.qompass.designer.core.Activator; +import org.eclipse.uml2.uml.Classifier; + + +/** + * Support for multiple target languages via the Eclipse extension mechanism + */ +public class ExternalGenerator { + + public static final String IEXTERNAL_GENERATOR_ID = Activator.PLUGIN_ID + ".externalGenerator"; //$NON-NLS-1$ + + /** + * + * @param iConfiguratorName + * @param component + * containing composite (container) + * @param instance + */ + public static EList generate(String iGeneratorID, Classifier source) { + IExternalGenerator iExternalGenerator = getExternalGenerator(iGeneratorID); + if (iExternalGenerator != null) { + return iExternalGenerator.generate(source); + } + return null; + } + + private static IExternalGenerator getExternalGenerator(String iGeneratorID) { + IExtensionRegistry reg = Platform.getExtensionRegistry(); + IConfigurationElement[] configElements = reg.getConfigurationElementsFor(IEXTERNAL_GENERATOR_ID); + for (IConfigurationElement configElement : configElements) { + try { + final String iConfiguratorIDext = configElement.getAttribute("extGeneratorID"); //$NON-NLS-1$ + if (iConfiguratorIDext.equals(iGeneratorID)) { + // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) + final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ + if (obj instanceof IExternalGenerator) { + return (IExternalGenerator) obj; + } + } + } catch (CoreException exception) { + exception.printStackTrace(); + } + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IEmbeddingRule.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IEmbeddingRule.java new file mode 100644 index 00000000000..72b573222ad --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IEmbeddingRule.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2011 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.extensions; + +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Port; + +/** + * Interface used by Qompass extensions that supports specific embedding rules. + * CAVEAT: Currently not used, unclear if kept + */ +@Deprecated +public interface IEmbeddingRule { + + // TODO: application order? + /** + * configure an instance (within a container) + * + * @param executorIS + * the instance specification of the component that is used as basis for configuring the instance + * @param instance + * the instance of an element of the container. + * @param port + * the port within a container transformation for which the instance is used as an interceptor. + * Is null for "normal" connectors or container extensions is configured. + */ + public void embeddExtension(InstanceSpecification executorIS, InstanceSpecification instance, Port port); +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IExternalGenerator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IExternalGenerator.java new file mode 100644 index 00000000000..df578fec3de --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IExternalGenerator.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2011 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.extensions; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.uml2.uml.Classifier; + +/** + * Interface used by Qompass extensions that supports specific external code generators, e.g. CORBA and DDS + */ +public interface IExternalGenerator { + + /** + * generate a class by means of an external generator + * + * @param source + * A source element for the generator, e.g. an interface for a CORBA generator + * @returns a list of generated classifiers: + * Even, if the external generator produces code directly, the Java wrapper should return a set + * model elements (may be incomplete) that represent the generated elements. For instance, in case + * of C++, an empty class with the stereotype "extern C" could be returned + */ + public EList generate(Classifier source); +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IInstanceConfigurator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IInstanceConfigurator.java new file mode 100644 index 00000000000..fd2231f525d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IInstanceConfigurator.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2011 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.extensions; + +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Property; + +/** + * Interface used by Qompass extensions that supports specific instance configurators, + * used for containers. + */ +public interface IInstanceConfigurator { + + /** + * configure an instance (within a container) + * + * @param instance + * the instance of an element which should be configured. + * @param componentPart + * the property that represents the component within the enclosing composite. May be null, if the instance + * that should be configured is the main instance. + * @param parentInstance + * the instance specification of the parent, i.e. the enclosing composite. If the instance that should be + * configured has a container, the parent instance corresponds to the instance specification of this + * container. This instance specification provides thus access to additional infromation available on the + * container level. + */ + public void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance); +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IOOTrafo.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IOOTrafo.java new file mode 100644 index 00000000000..df62ee1300a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IOOTrafo.java @@ -0,0 +1,97 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ +package org.eclipse.papyrus.qompass.designer.core.extensions; + +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.uml2.uml.Class; + +/** + * An interface that must be implemented by classes that realize the transformation + * from component-based to object-oriented models. It includes the replacement of + * ports and connectors. Ports are + * replaced with attributes and access operations, connectors within a composite + * by an operation that creates the initial setup. + * + * 1. add an operation that allows to retrieve the reference to an interface provided + * by a port. This operation has a mapping specific name, e.g. get_ + * 2. add an operation that allows to connect a specific port. + * the connect_q operation (*including a + * storage attribute*) for a port with a required interface + * 3. add an implementation for the getcnx_q operation for a port + * with a required interface (the operation itself has been added before) + * + * Problems: need to align bootloader creation with this mapping, since + * the bootloader may be responsible for instantiation + * + * Caveat: Assure that the folder derivedInterfaces already exists in a model. + * Otherwise the call to getProvided/getRequired interface might trigger its + * creation resulting in the corruption of list iterators (ConcurrentAccess + * exception) + * + * New considerations: could the OO trafo be seen as a specific form of the + * LwContainerTrafo? + * [if yes, would that be useful?] Problem: it's not only a merge and operation + * interception, but additional operation(s) for ports. But, it might well + * be based on similar mechanisms as in merging in a template + Java code instead + * of Java code only. Also possible: still have OOTrafo, but there is a collaboration + * between the OO trafo and a LW container rule. + */ +public interface IOOTrafo { + + /** + * Initialize the transformation. Pass the copier and the bootloader to the + * transformation in case it is needed by an implementation of this interface. + * @param copier an instance of the lazy copier that copies from source (intermediate) model to the OO model. + * @param bootloader + */ + public void init(LazyCopier copier, Class bootloader); + + /** + * Transformations adds operations for accessing ports. A common but not necessary + * code generation pattern is to associate different operations with ports that + * provide services (access operations) and ports requiring services (connection operations) + * + * @param implementation + * A component implementation + */ + public void addPortOperations(Class implementation); + + + /** + * Add an operation that connects the parts within a composite class based on the + * UML connector information. + * + * @param compositeImplementation + * A (composite) component implementation + * @throws TransformationException + */ + public void addConnectionOperation(Class compositeImplementation) + throws TransformationException; + + /** + * Transform parts if necessary. This transformation is for target programming languages + * like C++ that support different ways of composition for attributes, i.e. references/pointers + * versus values. In case of the latter, the instantiation of a composite directly implies + * the instantiation of its sub-components. In case of the former, parts need to be instantiated + * by a different mechanism, e.g. by the constructor (which is still a valid correspondence for + * composition in UML at a logical level). + * Another possible use is the support of a more dynamic deployment: it is for instance possible + * to use a use a part-list (single attribute) instead of fixed named attributes. + * + * @param compositeImplementation + * A (composite) component implementation + */ + public void transformParts(Class compositeImplementation); +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IXtend.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IXtend.java new file mode 100644 index 00000000000..1028f6f2ac6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/IXtend.java @@ -0,0 +1,15 @@ +/******************************************************************************* + * Copyright (c) 2011 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.extensions; + +public interface IXtend { +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/InstanceConfigurator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/InstanceConfigurator.java new file mode 100644 index 00000000000..709c8236cd2 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/InstanceConfigurator.java @@ -0,0 +1,121 @@ +/******************************************************************************* + * Copyright (c) 2011 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.extensions; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.UseInstanceConfigurator; +import org.eclipse.papyrus.qompass.designer.core.Activator; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.util.UMLUtil; + + +/** + * Support for the configuration of instances via the Eclipse extension mechanism + */ +public class InstanceConfigurator { + + public static final String IINSTANCE_CONFIG_ID = Activator.PLUGIN_ID + ".instanceConfig"; //$NON-NLS-1$ + + public static boolean onNodeModel = false; + + /** + * Configure an instance. The configurator is selected by means of a stereotype on the classifier of + * the passed instance. + * + * @see org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator + * @param instance + * the specification of instance that should be configured + * @param componentPart + * the part representing the instance (before container expansion) + * @param port + * a port within the context of container + */ + public static void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) { + Classifier component = DepUtils.getClassifier(instance); + UseInstanceConfigurator useInstanceConfigurator = UMLUtil.getStereotypeApplication(component, UseInstanceConfigurator.class); + configureInstance(useInstanceConfigurator, instance, componentPart, parentInstance); + } + + /** + * Configure an instance. The configurator is selected by means of a stereotype on the passed container rule. + * + * @see org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator + * @param rule + * the applied container rule + * @param instance + * the specification of instance that should be configured + * @param componentPart + * the part representing the instance (before container expansion) + * @param port + * a port within the context of container + */ + public static void configureInstance(ContainerRule rule, InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) { + UseInstanceConfigurator useInstanceConfigurator = UMLUtil.getStereotypeApplication(rule.getBase_Class(), UseInstanceConfigurator.class); + configureInstance(useInstanceConfigurator, instance, componentPart, parentInstance); + } + + /** + * Configure an instance with a given configurator + * + * @param useInstanceConfigurator + * @param instance + * @param componentPart + * @param containerContext + */ + public static void configureInstance(UseInstanceConfigurator useInstanceConfigurator, InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) { + if (useInstanceConfigurator != null) { + org.eclipse.papyrus.FCM.InstanceConfigurator instanceConfigurator = useInstanceConfigurator.getConfigurator(); + if (instanceConfigurator.isOnNodeModel() == onNodeModel) { + if (instanceConfigurator != null) { + String id = instanceConfigurator.getBase_Class().getName(); + IInstanceConfigurator iConfigurator = getInstanceConfigurator(id); + if (iConfigurator != null) { + iConfigurator.configureInstance(instance, componentPart, parentInstance); + + } + } + } + } + } + + protected static IInstanceConfigurator getInstanceConfigurator(String iConfiguratorID) { + IExtensionRegistry reg = Platform.getExtensionRegistry(); + IConfigurationElement[] configElements = reg.getConfigurationElementsFor(IINSTANCE_CONFIG_ID); + for (IConfigurationElement configElement : configElements) { + try { + final String iConfiguratorIDext = configElement.getAttribute("configuratorID"); //$NON-NLS-1$ + if (iConfiguratorIDext == null) { + throw new RuntimeException(String.format( + Messages.InstanceConfigurator_InvalidPluginExtension, iConfiguratorID)); + } + if (iConfiguratorIDext.equals(iConfiguratorID)) { + // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) + final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ + if (obj instanceof IInstanceConfigurator) { + return (IInstanceConfigurator) obj; + } + } + } catch (CoreException exception) { + exception.printStackTrace(); + } + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/OOTrafo.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/OOTrafo.java new file mode 100644 index 00000000000..f96ccad4765 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/OOTrafo.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * Copyright (c) 2011 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.extensions; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.papyrus.qompass.designer.core.Activator; +import org.eclipse.papyrus.qompass.designer.core.Messages; + +/** + * Support for different OO transformation via the Eclipse extension + * mechanism + */ +public class OOTrafo { + + public static final String IOO_TRANSFORMATION_ID = Activator.PLUGIN_ID + ".ooTransformation"; //$NON-NLS-1$ + + /** + * Get an OOTransformation for a given ID (language) + * + * @param iOOTrafoID + * the ID of an OO Transformation + * @return + */ + public static IOOTrafo getOOTrafo(String iOOTrafoID) { + IExtensionRegistry reg = Platform.getExtensionRegistry(); + IConfigurationElement[] configElements = reg.getConfigurationElementsFor(IOO_TRANSFORMATION_ID); + for (IConfigurationElement configElement : configElements) { + try { + final String iOOTrafoIDext = configElement.getAttribute("ooTrafoID"); //$NON-NLS-1$ + if (iOOTrafoIDext == null) { + throw new RuntimeException(String.format(Messages.InstanceConfigurator_InvalidPluginExtension, + iOOTrafoID)); + } + if (iOOTrafoIDext.endsWith("." + iOOTrafoID)) { //$NON-NLS-1$ + // TODO: cache returned instance (avoid creating a new + // instance each time => more efficient, no need for static + // attributes) + final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ + if (obj instanceof IOOTrafo) { + return (IOOTrafo) obj; + } + } + } catch (CoreException exception) { + exception.printStackTrace(); + } + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/XtendGenerator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/XtendGenerator.java new file mode 100644 index 00000000000..9737559803b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/extensions/XtendGenerator.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2011 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.extensions; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.papyrus.qompass.designer.core.Activator; + + +/** + * Support for embedding rules. + * CAVEAT: Currently not used, unclear if kept + */ +public class XtendGenerator { + + public static final String ITEMPLATE_ID = Activator.PLUGIN_ID + ".xtendGenerator"; //$NON-NLS-1$ + + public static IXtend getXtendGenerator(String generatorID) { + IExtensionRegistry reg = Platform.getExtensionRegistry(); + IConfigurationElement[] configElements = reg.getConfigurationElementsFor(ITEMPLATE_ID); + for (IConfigurationElement configElement : configElements) { + try { + final String iTemplateID = configElement.getAttribute("templateID"); //$NON-NLS-1$ + if (iTemplateID.equals(generatorID)) { + // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) + final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ + if (obj instanceof IXtend) { + return (IXtend) obj; + } + } + } catch (CoreException exception) { + exception.printStackTrace(); + } + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerateCode.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerateCode.java new file mode 100644 index 00000000000..1b948ff0cb6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerateCode.java @@ -0,0 +1,195 @@ +package org.eclipse.papyrus.qompass.designer.core.generate; + +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +// deactivated differential code generation for the moment. +/* + import org.eclipse.emf.compare.diff.metamodel.AttributeChange; + import org.eclipse.emf.compare.diff.metamodel.DiffElement; + import org.eclipse.emf.compare.diff.metamodel.DiffModel; + import org.eclipse.emf.compare.diff.metamodel.DifferenceKind; + import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeLeftTarget; + import org.eclipse.emf.compare.diff.metamodel.ModelElementChangeRightTarget; + import org.eclipse.emf.compare.diff.service.DiffService; + import org.eclipse.emf.compare.match.MatchOptions; + import org.eclipse.emf.compare.match.metamodel.MatchModel; + import org.eclipse.emf.compare.match.service.MatchService; + import org.eclipse.emf.compare.util.ModelUtils; + */ +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.ModelManagement; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; + +public class GenerateCode { + + public GenerateCode(IProject genProject, ILangCodegen codegen, ModelManagement genMM, IProgressMonitor monitor) { + this.genProject = genProject; + this.genMM = genMM; + this.monitor = monitor; + this.codegen = codegen; + } + + public void generate(InstanceSpecification node, String targetLanguage, boolean differential) + throws TransformationException, InterruptedException + { + String path = genMM.getPath(genProject, "model", null); //$NON-NLS-1$ + Package genModel = genMM.getModel(); + EObject oldGenModel = null; + if (differential) { + /* + * try { + * oldGenModel = ModelUtils.load(URI.createURI(path), ModelManagement.getResourceSet()); + * } catch (IOException io) { + * } + */ + } + genMM.saveModel(path); + + monitor.worked(1); + + if (genProject == null) { + return; + } + + if (oldGenModel != null) { + // Matching model elements + /* + * Map options = new HashMap(); + * options.put(MatchOptions.OPTION_IGNORE_XMI_ID, true); + * monitor.setTaskName("generating " + targetLanguage + " code for node " + node.getName()); + * monitor.subTask("create difference model for node " + node.getName()); + * monitor.worked(1); + * MatchModel match = MatchService.doMatch(genModel, oldGenModel, options); + * // Computing differences + * DiffModel diffModel = DiffService.doDiff(match, false); + * deleteRemovedClasses(diffModel); + * + * Map alreadyGenerated = new HashMap(); + * monitor.subTask("generate code"); + * + * for(DiffElement diff : diffModel.getDifferences()) { + * if((diff.getKind() == DifferenceKind.ADDITION) || + * (diff.getKind() == DifferenceKind.CHANGE)) { + * EObject modifiedEObj = null; + * if(diff instanceof AttributeChange) { + * modifiedEObj = ((AttributeChange)diff).getLeftElement(); + * } + * else if(diff instanceof ModelElementChangeLeftTarget) { + * modifiedEObj = ((ModelElementChangeLeftTarget)diff).getLeftElement(); + * } + * if(modifiedEObj instanceof Element) { + * PackageableElement modifiedPElement = getNearestClassifierOrPackage((Element)modifiedEObj); + * Element modifiedElement = modifiedPElement; + * // check whether code has already been generated for a parent + * boolean found = false; + * while(modifiedElement != null) { + * modifiedElement = modifiedElement.getOwner(); + * if(alreadyGenerated.containsKey(modifiedElement)) { + * found = true; + * } + * } + * // TODO: re-create code for elements that depend on this one (e.g. if the modified element is a + * // class and its name has changed, caller have to use a different name, even if the model reference + * // has not changed. + * if(!found) { + * alreadyGenerated.put(modifiedPElement, true); + * langSupport.generateCode(monitor, modifiedPElement); + * } + * } + * } + * } + */ + } + else { + if (node == null) { + monitor.setTaskName(String.format(Messages.GenerateCode_GeneratingCode, targetLanguage)); + } + else { + monitor.setTaskName(String.format(Messages.GenerateCode_GeneratingCodeForNode, targetLanguage, node.getName())); + } + IFolder folder = genProject.getFolder(genModel.getName()); + try { + folder.delete(true, null); + } catch (CoreException e) { + throw new TransformationException(String.format(Messages.GenerateCode_CouldNotDeleteOldCode, e.getMessage())); + } + codegen.generateCode(genProject, genModel, monitor); + } + if (monitor.isCanceled()) { + return; + } + monitor.worked(1); + } + + /** + * @param element + * @return + */ + public PackageableElement getNearestClassifierOrPackage(Element element) { + while (element != null) { + if (element instanceof Classifier) { + return (Classifier) element; + } + if (element instanceof Package) { + return (Package) element; + } + element = element.getOwner(); + } + return null; + } + + /* + * public void deleteRemovedClasses(EObject diffModelOrElement) throws TransformationException { + * EList diffs; + * if(diffModelOrElement instanceof DiffModel) { + * diffs = ((DiffModel)diffModelOrElement).getDifferences(); + * } + * else if(diffModelOrElement instanceof DiffElement) { + * diffs = ((DiffElement)diffModelOrElement).getSubDiffElements(); + * } + * else { + * return; + * } + * for(DiffElement diff : diffs) { + * EObject modifiedEObj = null; + * + * if(diff.getKind() == DifferenceKind.DELETION) { + * if(diff instanceof AttributeChange) { + * modifiedEObj = ((AttributeChange)diff).getRightElement();- + * } + * else if(diff instanceof ModelElementChangeRightTarget) { + * modifiedEObj = ((ModelElementChangeRightTarget)diff).getRightElement(); + * } + * } + * else if(diff.getKind() == DifferenceKind.CHANGE) { + * if(diff instanceof AttributeChange) { + * modifiedEObj = ((AttributeChange)diff).getRightElement(); + * } + * } + * if(modifiedEObj instanceof PackageableElement) { + * // => delete tree + * langSupport.cleanCode(monitor, (PackageableElement)modifiedEObj); + * } + * // no recursion needed? + * // deleteRemovedClasses(diff); + * } + * } + */ + + private ModelManagement genMM; + + private IProject genProject; + + private IProgressMonitor monitor; + + private ILangCodegen codegen; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerationOptions.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerationOptions.java new file mode 100644 index 00000000000..48230b2b987 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/generate/GenerationOptions.java @@ -0,0 +1,19 @@ +package org.eclipse.papyrus.qompass.designer.core.generate; + +/** + * Constants for generation options (must be powers of 2) + * + * @author ansgar + * + */ +public interface GenerationOptions { + + final public static int REWRITE_SETTINGS = 1; + + final public static int ONLY_CHANGED = 2; + + final public static int MODEL_ONLY = 4; + + final public static int CAC_ONLY = 8; + +}; diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/DepPlanListener.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/DepPlanListener.java new file mode 100644 index 00000000000..f6773177432 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/DepPlanListener.java @@ -0,0 +1,59 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.listeners; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * A model listener that updates a deployment plan, e.g. add, remove or + * rename instance specifications , if the composites referenced + * by a deployment plan change. Since the code is very incomplete, it is + * currently not used. It needs to be clarified what changes are useful, + * in particular whether delete operations in a composite should immediately + * remove the associate slot in instance specifications of the composite and the + * referenced instance specifications. + * + * @author ansgar + * + */ +public class DepPlanListener implements IPapyrusListener { + + @Override + public void notifyChanged(Notification notification) { + // TODO Auto-generated method stub + int evtType = notification.getEventType(); + Object notifier = notification.getNotifier(); + // String name = ""; + + if (evtType == Notification.SET) { + // Object oldValue = notification.getOldValue (); + if (notifier instanceof Package) { + DeploymentPlan de = UMLUtil.getStereotypeApplication((Package) notifier, DeploymentPlan.class); + Object mainInstance = (de != null) ? de.getMainInstance() : null; + if (mainInstance instanceof InstanceSpecification) { + // TODO user wants to declare the system component, the instance specification should be created + // automatically + + } + // if ((oldValue instanceof ) && (notifier instanceof Class)) { + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/InterfaceListener.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/InterfaceListener.java new file mode 100644 index 00000000000..a7d4f962536 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/InterfaceListener.java @@ -0,0 +1,64 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.listeners; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.sync.CompImplSync; +import org.eclipse.uml2.uml.BehavioralFeature; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Interface; + +public class InterfaceListener implements IPapyrusListener { + + public static InterfaceListener getInstance() { + if (instance == null) { + instance = new InterfaceListener(); + } + return instance; + } + + private static InterfaceListener instance = null; + + @Override + public void notifyChanged(Notification notification) { + Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Interface adapter"); //$NON-NLS-1$ + int evtType = notification.getEventType(); + Object notifier = notification.getNotifier(); + if (evtType == Notification.SET) { + if (notifier instanceof Class) { + // UMLExecutor.addCCM_intf ((Class) notifier); + } + } else if (evtType == Notification.ADD) { + + if (notifier instanceof Interface) { + // Interface intf = (Interface) notifier; + + // never executed since name is always unset when + // an operation is newly added + } + } else if (evtType == Notification.REMOVE) { + Object oldValue = notification.getOldValue(); + if (oldValue instanceof BehavioralFeature) { + BehavioralFeature toBeRemoved = (BehavioralFeature) oldValue; + + Interface intf = (Interface) notifier; + CompImplSync.syncViaInterface(intf, toBeRemoved); + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ModelListener.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ModelListener.java new file mode 100644 index 00000000000..786dcd051c9 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ModelListener.java @@ -0,0 +1,56 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.listeners; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Port; + +/** + * Main listener for model changes (registered via plugin.xml). It will delegate + * to the sub-listeners for specific sub-elements (type, operation, port, ...) that + * can be found in this package + * + * @author ansgar + * + */ +public class ModelListener implements IPapyrusListener { + + @Override + public void notifyChanged(Notification notification) { + Log.log(IStatus.INFO, Log.TRAFO_SYNC, String.format("ModelListener.notifyChanged: %s", notification.getFeature())); + Object notifier = notification.getNotifier(); + if (notifier instanceof NamedElement) { + String name = ((NamedElement) notifier).getName(); + Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Change notification for element: " + name); + } + + if (notifier instanceof Operation) { + OperationListener.getInstance().notifyChanged(notification); + } else if (notifier instanceof Parameter) { + ParameterListener.getInstance().notifyChanged(notification); + } else if (notifier instanceof Interface) { + InterfaceListener.getInstance().notifyChanged(notification); + } else if (notifier instanceof Port) { + PortListener.getInstance().notifyChanged(notification); + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/OperationListener.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/OperationListener.java new file mode 100644 index 00000000000..4444a92fa73 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/OperationListener.java @@ -0,0 +1,71 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.listeners; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.sync.CompImplSync; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Operation; + +/** + * Track changes of an operation, typically within an interface provided + * by a port. This is used to update derived oeprations, e.g. when parameters + * are added or removed. + * + * @author ansgar + * + */ +public class OperationListener implements IPapyrusListener { + + // TODO: used by TypeAdapter (useful??) + public static OperationListener getInstance() { + if (instance == null) { + instance = new OperationListener(); + } + return instance; + } + + private static OperationListener instance = null; + + @Override + public void notifyChanged(Notification notification) { + int evtType = notification.getEventType(); + Object notifier = notification.getNotifier(); + String name = ""; //$NON-NLS-1$ + if (notifier instanceof NamedElement) { + name = ((NamedElement) notifier).getName(); + } + if ((evtType == Notification.SET) || (evtType == Notification.ADD)) { + Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Operation.adapter, set " + name); + + if (notifier instanceof Operation) { + Operation operation = (Operation) notifier; + + Element owner = operation.getOwner(); + if (owner instanceof Interface) { + Interface intf = (Interface) owner; + CompImplSync.syncViaInterface(intf); + } + } + } else { + Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Operation.adapter, code: " + notification.getEventType() + ", name: " + name); + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ParameterListener.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ParameterListener.java new file mode 100644 index 00000000000..c810970ed15 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/ParameterListener.java @@ -0,0 +1,63 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.listeners; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.sync.CompImplSync; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; + +public class ParameterListener implements IPapyrusListener { + + public static ParameterListener getInstance() { + if (instance == null) { + instance = new ParameterListener(); + } + return instance; + } + + private static ParameterListener instance = null; + + @Override + public void notifyChanged(Notification notification) { + int evtType = notification.getEventType(); + Object notifier = notification.getNotifier(); + String name = ""; //$NON-NLS-1$ + if (notifier instanceof NamedElement) { + name = ((NamedElement) notifier).getName(); + } + if ((evtType == Notification.SET) || (evtType == Notification.ADD)) { + Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Parameter.adapter, set " + name); + + if (notifier instanceof Parameter) { + Element owner = ((Parameter) notifier).getOwner(); + if (owner instanceof Operation) { + owner = owner.getOwner(); + if (owner instanceof Interface) { + CompImplSync.syncViaInterface((Interface) owner); + } + } + } + } else { + Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Parameter.adapter, code: " + notification.getEventType() + ", name: " + name); + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PortListener.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PortListener.java new file mode 100644 index 00000000000..09039013ee7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PortListener.java @@ -0,0 +1,77 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.listeners; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.ecore.ENamedElement; +import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.sync.CompTypeSync; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Port; + +public class PortListener implements IPapyrusListener { + + public Notifier getTarget() { + // TODO Auto-generated method stub + return null; + } + + public static PortListener getInstance() { + if (instance == null) { + instance = new PortListener(); + } + return instance; + } + + private static PortListener instance; + + + public boolean isAdapterForType(Object type) { + // TODO Auto-generated method stub + return false; + } + + @Override + public void notifyChanged(Notification notification) { + int evtType = notification.getEventType(); + Object notifier = notification.getNotifier(); + + if (evtType == Notification.SET) { + Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Port adapter, set: " + ((NamedElement) notifier).getName()); + Object obj = notification.getFeature(); + if (notifier instanceof Port) { + Port port = (Port) notifier; + if (obj instanceof ENamedElement) { + ENamedElement ne = (ENamedElement) obj; + if (ne.getName().equals("name")) { + String oldName = notification.getOldStringValue(); + CompTypeSync.renamePort((Class) port.getOwner(), port, oldName); + // profile modifications are also be indicated as name changes, but might imply a change + // of provided and required interfaces. + CompTypeSync.syncPort((Class) port.getOwner(), port); + } else if (ne.getName().equals("type")) { + // CompTypeSync.syncPort((Class) port.getOwner(), port); + } + } + } + } else { + Log.log(IStatus.INFO, Log.TRAFO_SYNC, "Port adapter, code: " + notification.getEventType() + ", " + notifier); + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PostCopyListener.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PostCopyListener.java new file mode 100644 index 00000000000..967d4765bf0 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PostCopyListener.java @@ -0,0 +1,35 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.listeners; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; + +/** + * Interface for listeners that are notified when an eObject + * is copied + * + * @see org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier + */ +public interface PostCopyListener { + + /** + * Is called for each EObject after is has been copied. + * + * @param targetEObj + * the EObject that has been copied + */ + public void postCopyEObject(LazyCopier copy, EObject targetEObj); +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PreCopyListener.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PreCopyListener.java new file mode 100644 index 00000000000..d865c4a586e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/listeners/PreCopyListener.java @@ -0,0 +1,38 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.listeners; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; + +/** + * Interface for listeners that are notified when an eObject + * is copied + * + * @see org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier + */ +public interface PreCopyListener { + + /** + * Is called for each EObject that is copied. If it returns null, the + * indicated object should not be copied. If it returns a different object + * than the passed EObject, this object is used (the returned object of the + * first listener is used). + * + * @param sourceEObj + * the added classifier + */ + public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj); +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/GenerateMakefile.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/GenerateMakefile.java new file mode 100644 index 00000000000..e2c88564887 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/GenerateMakefile.java @@ -0,0 +1,118 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Manel Fredj + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.make; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; + +import org.eclipse.papyrus.qompass.designer.core.Activator; + +/* + * TODO: + * - Currently not used (and unclear, if useful) + * + * - Determination of root folder + * - files within fileList have relative folder names? (if not assure) + * - supporting def file (not only for Accord) + * - integration with execution + */ + +/** + * Generate a makefile based on found source files, i.e. .cpp files + * + * @author manel + * + */ +@Deprecated +public class GenerateMakefile { + + /** + * Makefile Generation Algorithm: + * For each Node + * include $(ROOT_PATH)/Makefile.defs + * NAME = Util + * SRCS =\ + * File1.cpp\ + * File2.cpp\ + * ... + * FileN.cpp + * include $(ROOT_PATH)/Makefile.rules + */ + public static void generate() { + ArrayList fileList = new ArrayList(); + ArrayList folderList = new ArrayList(); + ArrayList nodeList = new ArrayList(); + ArrayList nodeSources = new ArrayList(); + + ShowFiles showFiles = new ShowFiles("/local/home/ansgar/workspace-v3.3/TestCppProject/AluSocketGen"); //$NON-NLS-1$ + + showFiles.getFilesRec(fileList, folderList); + nodeList = showFiles.findNodesDir(folderList); + for (String node : nodeList) { + nodeSources = showFiles.getNodeSources(fileList, node); + String nodePath = showFiles.getRootPath() + File.pathSeparator + node + File.pathSeparator + "Makefile"; //$NON-NLS-1$ + createFileList(nodePath, nodeSources, node); + } + } + + /** + * Create a list of .cpp files + * + * @param fileName + * @param cppFileList + * @param NodeName + */ + public static void createFileList(String fileName, ArrayList cppFileList, String NodeName) { + // create the makefile + try { + java.io.File makefile = new java.io.File(fileName); + + makefile.createNewFile(); + // not avail in Java 1.5? + // makefile.setWritable(true); + + FileOutputStream writer = new java.io.FileOutputStream(makefile); + + writer.write("include $(ACCORD_ROOT)/Makefile.defs\n\n".getBytes()); //$NON-NLS-1$ + writer.write(("NAME=" + NodeName + "\n\n").getBytes()); //$NON-NLS-1$ //$NON-NLS-2$ + + // Calculate list of sources + writer.write("SRCS=\\\n".getBytes()); //$NON-NLS-1$ + + if (cppFileList != null && cppFileList.size() != 0) { + + // Calculate list of .cpp files + for (int i = 0; i < cppFileList.size(); i++) { + writer.write(("\t" + cppFileList.get(i)).getBytes()); //$NON-NLS-1$ + if (i < cppFileList.size() - 1) { + // add \ to all but last item + writer.write("\\".getBytes()); //$NON-NLS-1$ + } + writer.write("\n".getBytes()); //$NON-NLS-1$ + } + } + writer.write("\n".getBytes()); //$NON-NLS-1$ + + writer.write("include $(ACCORD_ROOT)/Makefile.rules".getBytes()); //$NON-NLS-1$ + + writer.flush(); + writer.close(); + } catch (IOException e) { + Activator.log.error(e); + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/ShowFiles.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/ShowFiles.java new file mode 100644 index 00000000000..2568c45a61d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/make/ShowFiles.java @@ -0,0 +1,104 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.make; + +import java.io.File; +import java.util.ArrayList; + +@Deprecated +public class ShowFiles { + + /** + * Initialize the ShowFiles class + * + * @param rootPath + * the path of a folder, that in turn contains a set of folders. It is assume that the + * latter contain code related to a specific node + */ + public ShowFiles(String rootPath) { + m_rootPath = rootPath; + } + + private String m_rootPath; + + public String getRootPath() { + return m_rootPath; + } + + /** + * takes as input the list of all directories that are included under a root path (allDir), and + * the root path (in case different from ACCORD_ROOT), and potentially, a list of (non empty) files, + * which will be enriched with the set of source files (.cpp) under all directories under the root path + */ + public void getFilesRec(ArrayList allFiles, ArrayList allDir) { + getFilesRec(allFiles, allDir, m_rootPath); + } + + + public void getFilesRec(ArrayList fileList, ArrayList folderList, String root) { + File f = new File(root); + File[] listFiles = f.listFiles(); + for (File file : listFiles) { + if (file.isDirectory()) { + // call recursively with + getFilesRec(fileList, folderList, file.toString()); + folderList.add(file.toString()); + } else { + if (file.toString().endsWith(".cpp")) { //$NON-NLS-1$ + // found a C++ file + fileList.add(file.toString()); + } + } + } + } + + /** + * takes as input the list of all directories that are included under a root path (folderList), + * in order to provide as a result the subset of directories, corresponding to the nodes + */ + public ArrayList findNodesDir(ArrayList folderList) { + ArrayList allNodes = new ArrayList(); + for (String dir : folderList) { + String tmp = dir.replaceFirst(m_rootPath, ""); //$NON-NLS-1$ + // all the nodes are at the level (ACCORD_ROOT + 1) + tmp = tmp.trim().replaceFirst(File.pathSeparator, ""); //$NON-NLS-1$ + if (!tmp.contains(File.pathSeparator)) { + allNodes.add(tmp.trim()); + } + } + return allNodes; + } + + /** + * takes as input the list of all files that are included under ACCORD_ROOT path (allFiles), and + * the node name (nodeName) in order to provide as a result the subset of files, corresponding to the + * sources of the node (NodeName) + */ + public ArrayList getNodeSources(ArrayList allFiles, String nodeName) { + ArrayList sourceFilesPath = new ArrayList(); + + for (String filePath : allFiles) { + if (filePath.contains(nodeName)) { + // path is related to given node + int index = filePath.indexOf(nodeName); + String tmp = filePath.substring(index); + index = tmp.indexOf(File.pathSeparator); + tmp = tmp.substring(index + 1); + sourceFilesPath.add(tmp.trim()); + } + } + return sourceFilesPath; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/messages.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/messages.properties new file mode 100644 index 00000000000..332fca3462d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/messages.properties @@ -0,0 +1,91 @@ +BootLoaderGen_AtLeastOneBlockingCall=There must be at most one blocking "run" operation per node. Not adding "run" call for component instance %s. Existing invocations: %s +BootLoaderGen_CannotApplyCppInclude=Cannot apply cppInclude stereotype. Make sure that C/C++ profile is applied to your model +BootLoaderGen_CannotRetrieveTemplate=Cannot retrieve bootLoader template (should be in %s) +CommandSupport_NoEditingDomain=Can not get editing domain +CommandSupport_ErrorDuringCmdExec=Error during command execution +ConfigUtils_RuleWithoutBaseClass=A container rule has no base class (broken model library?) +DepCreation_SingletonExistsAlready=singleton instantiation: element with name %s exists already in deployment plan, but is not an instance specification +DepCreation_CannotFindImplementation=cannot find suitable implementation for instance <%s> (given type <%s>) +DepCreation_CircularReference=Class %s is referenced in a circle\! Thus, an infinite number of instance specifications would be required.\nrecursion path: +DepCreation_DefiningFeatureNull=The defining feature of a slot of instance %s is null +DepCreation_FCMconnectorWithoutBaseClass=An FCM connector has no base class. Check for broken model library +DepCreation_InfoCreateDepPlan=DepCreation.createDepPlan: %s +DepCreation_TypeInAttributeUndefined=type of attribute %s within class %s is not defined +Deploy_0=Cannot find implementation for instance %s +Description_NoAvail=not available + +LWContainerTrafo_CannotApplyRule=Cannot apply container rule <%s>, since the type of one of its parts is undefined. Check for unresolved proxies in imports + +TemplateUtils_InfoCreateBoundPackage=create bound package (fixed binding): %s within %s +TemplateUtils_InfoGetActualFrom=TemplateInstantiation.getActualFromBinding: substitution formal = %s +TemplateUtils_NoTemplateSignature=no template signature found for %s + +ConnectorBinding_InfoConnPortConnectedVia=connector port <%s> is connected via <%s> +ConnectorBinding_CannotFindBinding=error: can not find a binding for formal parameter %s in the context of composite %s, connector %s and (connector) template %s. +ConnectorBinding_CannotFindBindingForPort=Cannot find a binding for port %s of connector %s. +ConnectorBinding_CannotFindConsistentBinding=cannot find a consistent binding for port %s of connector %s (in %s). Formal already bound to type %s +ConnectorBinding_ConnectorsPort=connects port, otherInterface = %s +ConnectorBinding_FormalAlreadyBound=Formal already bound to type %s +ConnectorBinding_InfoActualReturnIntfIs=actual return interface: %s +ConnectorBinding_InfoConnectsPort=connects port, otherInterface = %s +ConnectorBinding_InfoCreateBoundPackage=create bound package %s within %s +ConnectorBinding_InfoMatchOtherEnd=matchOtherEnd: port %s +ConnectorBinding_InfoProvidedPortTypeMatches=getActual: provided port type matches, port %s. +ConnectorBinding_NoTemplateSignature=ConnectorBinding: no template signature found for %s +ConnectorReification_CannotFindMatchingPort=Connector reification: cannot find a matching port on reified connector %s for port %s. This should not happen and indicates an internal tool chain error. +ConnectorReification_CouldNotBind=could not bind connector implementation template <%s> +ConnectorReification_CouldNotConnectPort=Error: could not connect connector port <%s>. +ConnectorReification_CouldNotConnectPortOfType=Error: could not connect connector port <%s> of type <%s>. +ConnectorReification_InfoAddConnectorPart=ConnectorReification, add part with connector implementation template <%s> and implementation <%s> +ConnectorReification_InfoPortTypes=ConnectorReification: otherPort type: <%s> - port <%s>. +ConnectorReification_RequiresUseOfPorts=Connector reification requires the use of ports (otherwise, the ports of the reified connector can not be assigned unambiguously +ConnectorReification_TemplateTypeNotClass=template type is not a class +GenerateCode_CouldNotDeleteOldCode=Could not delete old code: %s +GenerateCode_GeneratingCode=generating %s code +GenerateCode_GeneratingCodeForNode=generating %s code for node %s + +TemplateInstantiation_TemplateIsNull=Passed template element is null + +TemplateInstantiationListener_TrafoException=TransformationException: %s + +CompImplTrafos_CannotFindType=Can not find type %s. Thus, unable to create suitable connect operation in component to OO transformation. +CompImplTrafos_IntfNotImplemented=Interface <%s> provided by port <%s> of class <%s> is not implemented by the component itself nor does the port delegate to a part +CompTypeTrafos_CannotFindType=Can not find type <%s>. Thus, unable to create suitable connect operation in component to OO transformation + +ContainerTrafo_CannotApplyRule=Cannot apply container rule <%s>, since the type of one of its parts is undefined. Check for unresolved proxies in imports +ContainerTrafo_CannotFindDelegationConn=(during interceptor transformation for container): cannot find existing delegation connector +ContainerTrafo_InterceptionRuleButNoInterceptor=The part %s in rule %s has an interceptionRule, but is not typed with an interaction component +ContainerTrafo_RecursiveLWnotSupported=Recursive lightweight container rules currently not supported +InstanceConfigurator_InvalidPluginExtension=InstanceConfigurator: plugin extension for id %s is invalid +InstantiateDepPlan_AcceleoErrors=Acceleo errors occured +InstantiateDepPlan_AcceleoErrorsCheckLog=Acceleo errors occured during code generation. Please check the error log +InstantiateDepPlan_CannotGenModel=Cannot generate model +InstantiateDepPlan_CheckInputImportPkg=An imported package is null. Verify the imported packages +InstantiateDepPlan_CheckInputImportPkgNoRes=An imported package has no eResource. Verify imported packages +InstantiateDepPlan_CheckInputModelProfile3=Check input model: profile <%s> is not contained in a resource +InstantiateDepPlan_CheckInputModelProfileNoRes=Check input model: the applied profile with URI <%s> has no name and is not contained in a resource +InstantiateDepPlan_CheckInputModelProfileNoResNoName=Check input model: one of the applied profiles has no name and is not contained in a resource +InstantiateDepPlan_ConsultConsole=Consult error log or console for details +InstantiateDepPlan_DepPlanStereotypeNotInitialized=The stereotype attribute of configuration <%s> is not initialized. +InstantiateDepPlan_ErrorsDuringTransformation=An error occurred during transformation +InstantiateDepPlan_IllegalArgumentDuringCopy=An Illegal argument exception occured during the copy of profile applications. This may indicate that the original model contains an invalid profile application\n\n +InstantiateDepPlan_InfoApplyProfile=apply profile +InstantiateDepPlan_InfoDeployingForNode=deploying for node %s +InstantiateDepPlan_InfoExpandingConnectors=expanding connectors and containers +InstantiateDepPlan_InfoGeneratingModel=Generating deployment model ... +InstantiateDepPlan_InfoImportPackage=import package %s +InstantiateDepPlan_InfoNoneAllocated=None of the instances in the deployment plan is allocated to a node. Verify the node allocation. +InstantiateDepPlan_TransformationException=A transformation exception occurred +MainModelTrafo_ChangePartType=change type of part <%s> due to container trafo +MainModelTrafo_NoDefiningFeature=Error: no defining feature associated with <%s>. +MainModelTrafo_NoInstanceAssociated=Error: no instance is associated with slot for feature <%s>. + +CompImplSync_InfoSyncIntf=interface rel-ship %s +CompImplSync_InfoSyncViaImpl=Sync. type and implementation +CompImplSync_InfoSyncViaType=syncViaType => implementation %s + +DepPlanUtils_CannotFindAttribute=cannot find attribute %s in classifier %s +DepPlanUtils_ConfigOfPropertyFailed=configuration of property %s failed: type is not a string +UpdateUtils_CannotApplyFCMstereo=cannot apply FCM stereotype. Check whether profile is applied +XtendTemplateBinding_TemplateNotFound=template with reference <%s.%s> can not be found. Verify whether the reference is correctly spelled, the template has been registered and implements the interface (in oep.designer.core.extensions). +XtendTemplateBinding_TemplateResultIsNotAString=bind template: return result is not a string diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/preferences/QompassPreferenceConstants.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/preferences/QompassPreferenceConstants.java new file mode 100644 index 00000000000..3b3f3c7d2a4 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/preferences/QompassPreferenceConstants.java @@ -0,0 +1,33 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.qompass.designer.core.preferences; + +/** + * Constant definitions for plug-in preferences + */ +public class QompassPreferenceConstants { + + /** + * For attributes, the default "aggregation kind" value is "none". When this option is set + * it will be treated as composite + */ + public static final String P_TREAT_NONE_AS_COMPOSITE = "treatNoneAsComposite"; //$NON-NLS-1$ + + public static final String P_ALL_ATTRIBUTES_ARE_CONFIG_ATTRIBUTES = "allAttributesAreConfigAttributes"; //$NON-NLS-1$ + + public static final String P_SHOW_PROV_REQ_AS_PORT_ICONS = "showProvReqAsPortIcons"; //$NON-NLS-1$ + + public static final String P_CODE_GEN_PREFIX = "codeGenPrefix"; //$NON-NLS-1$ + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompImplSync.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompImplSync.java new file mode 100644 index 00000000000..89659d326da --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompImplSync.java @@ -0,0 +1,451 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.sync; + +import java.util.Iterator; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.qompass.designer.core.CommandSupport; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.OperationUtils; +import org.eclipse.papyrus.qompass.designer.core.PortInfo; +import org.eclipse.papyrus.qompass.designer.core.PortUtils; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants; +import org.eclipse.papyrus.qompass.designer.core.transformations.UpdateUtils; +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.BehavioralFeature; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.ConnectorEnd; +import org.eclipse.uml2.uml.DirectedRelationship; +import org.eclipse.uml2.uml.Generalization; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.InterfaceRealization; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Synchronize component implementation classes. + * An implementation depends on the component type in the following way: + * (1) It has to realize the interfaces that are provided by the components ports, unless + * the port is delegated + * (1b) For each realized interface, its operations need to be implemented (the tool should detect and report + * double entries which can be resolved via delegation) + * (2) It can use interface that are required by the component ports. These changes are reflected in the + * context object, but are currently not propagated on an implementation level. + * + * The first aspect may be triggered by + * (a) modification of the port (name, kind or type) + * (b) modification due to changes of the interface: rename the interface itself or add, remove or rename operations + * and add, remove or rename parameters. + * + * InterfaceRealizations are implemented by means of stereotyped generalizations. This has the advantage + * that the operation itself is inherited and does not have to be synchronized. + * + * @author ansgar + * + */ +public class CompImplSync { + + public static void syncViaInterface(Interface intf) { + syncViaInterface(intf, null); + } + + /** + * Delegate a synchronization operation to one or more implementations when an interface + * (which may have changed) is given. I.e. this operation is called when an operation + * of an implemented interface is added, removed or modified. + * + * @param an + * interface which may be implemented by a set of component implementations. + * @param port + */ + public static void syncViaInterface(Interface intf, BehavioralFeature toBeRemoved) { + // find all implementations of this interface + for (DirectedRelationship relationship : intf.getTargetDirectedRelationships(UMLPackage.eINSTANCE.getInterfaceRealization())) { + InterfaceRealization ir = (InterfaceRealization) relationship; + Classifier cl = ir.getImplementingClassifier(); + if (cl instanceof Class) { + Log.log(IStatus.INFO, Log.TRAFO_SYNC, String.format(Messages.CompImplSync_InfoSyncIntf, cl.getName())); + Class implementation = (Class) cl; + // syncRealizations (implementation); + CompImplSync.interfaceModifications(implementation, toBeRemoved); + } + } + } + + /** + * Delegate a synchronization operation to one or more implementations when a component + * type is given. + * The function will in particular handle realization operations due to provided + * ports and the behaviors associated with it (e.g. opaque-behaviors implementing the provided + * operations of a component) + * + * @param a + * component type or a realized interface + * @param port + */ + public static boolean syncViaType(Class compType, boolean addOnly) { + // find all implementations ... + boolean foundGeneralization = false; + for (DirectedRelationship relationship : compType.getTargetDirectedRelationships(UMLPackage.eINSTANCE.getGeneralization())) { + if (relationship instanceof Generalization) { + foundGeneralization = true; + Classifier cl = ((Generalization) relationship).getSpecific(); + if (cl instanceof Class) { + Log.log(IStatus.INFO, Log.TRAFO_SYNC, String.format(Messages.CompImplSync_InfoSyncViaType, cl.getName())); + Class implementation = (Class) cl; + updatePorts(implementation); + if (Utils.isCompImpl(cl)) { + // add realization relationship only for implementations + if (addOnly) { + addRealizations(implementation); + // syncContextOps (implementation, false); + } else { + syncRealizations(implementation); + // syncContextOps (implementation, true); + } + } + } + } + } + return foundGeneralization; + } + + /* + * public static void renamePortViaType (Class compType, Port port, String oldName) + * { + * // find all implementations ... + * for (DirectedRelationship relationship : + * compType.getTargetDirectedRelationships (UMLPackage.eINSTANCE.getGeneralization ())) + * { + * if (relationship instanceof Generalization) { + * Classifier cl = ((Generalization) relationship).getSpecific (); + * if (cl instanceof Class) { + * renamePort ((Class) cl, port, oldName); + * } + * } + * } + * } + */ + + /** + * Update the ports of a class, i.e. recalculate its derived interfaces + * + * @param component + * @param port + */ + public static void updatePorts(Class implementation) { + for (Port port : PortUtils.getAllPorts(implementation)) { + org.eclipse.papyrus.FCM.Port fcmPort = UMLUtil.getStereotypeApplication(port, org.eclipse.papyrus.FCM.Port.class); + // verify if in same eResource (= editable) + if ((fcmPort != null) && (port.eResource() == implementation.eResource())) { + fcmPort.update(); + } + } + } + + /** + * Add an interface realization relationship from an implementation (Class) towards an interface + * + * @param implementation + * A component implementation + * @param providedIntf + * The interface that is provided at one of its port + */ + protected static void addRealization(final Class implementation, final Interface providedIntf) { + if (!hasRealization(implementation, providedIntf)) { + InterfaceRealization ir = + implementation.createInterfaceRealization(calcRealizationName(providedIntf), providedIntf); + ir.getClients().add(implementation); + ir.getSuppliers().add(providedIntf); + } + } + + /** + * Calculate the name of an interface realization towards an interface that is + * provided at one of its ports + * + * @param providedIntf + * an interface provided by a component + * @return the calculated name + */ + protected static String calcRealizationName(Interface providedIntf) { + String name = providedIntf.getName(); + if (name == null) { + name = "undefined"; //$NON-NLS-1$ + } + return "derived realization of " + name; //$NON-NLS-1$ + } + + /** + * return existing interface-realization relationship + * + * @param implementation + * @param intf + * @return + */ + protected static InterfaceRealization getRealization(Class implementation, Interface intf) { + return implementation.getInterfaceRealization(null, intf); + } + + /** + * check, whether an interface-realization relationship already exists + * + * @param implementation + * @param intf + * @return + */ + protected static boolean hasRealization(Class implementation, Interface intf) { + return getRealization(implementation, intf) != null; + } + + /** + * Synchronize realization (generalization) relationship. + * + * @param implementation + * @param port + */ + public static void syncRealizations(Class implementation) { + EList providedIntfs = addRealizations(implementation); + removeRealizations(providedIntfs, implementation); + } + + /** + * add derived realization relationships of a component implementation + * due to provided interfaces of its ports + * + * TODO: depends on OOTrafo, duplicate functionality + * + * @param implementation a component implementation + */ + public static EList addRealizations(Class implementation) { + // create a list of all provided interfaces and check whether realization relationship + // exists. If not, create + EList providedIntfs = new BasicEList(); + for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { + Interface providedIntf = portInfo.getProvided(); + // check, if there is a getter already. In this case, we assume that we should not synchronize + // operations + String opName = PrefixConstants.getP_Prefix + portInfo.getName(); + if (implementation.getOwnedOperation(opName, null, null) != null) { + continue; + } + ConnectorEnd connEnd = ConnectorUtil.getDelegation(implementation, portInfo.getPort()); + // check that there is no delegation to a part which in turn has to implement the operations. + if ((providedIntf != null) && (connEnd == null)) { + if (providedIntfs.contains(providedIntf)) { + // emit warning that more than one provider for same interface + Log.log(IStatus.WARNING, Log.TRAFO_SYNC, "The interface " + providedIntf.getName() + //$NON-NLS-1$ + " is provided by more than one port of class <" + implementation.getQualifiedName() + //$NON-NLS-1$ + ">, inputs would therefore be undistinguishable"); //$NON-NLS-1$ + } + providedIntfs.add(providedIntf); + InterfaceRealization ir = getRealization(implementation, providedIntf); + if (ir == null) { + addRealization(implementation, providedIntf); + } else { + String name = calcRealizationName(providedIntf); + if (!name.equals(ir.getName())) { + ir.setName(name); + } + } + } + } + return providedIntfs; + } + + /** + * remove derived realization relationships of a component implementation + * due to provided interfaces of its ports, i.e. remove those for which the + * port no longer provides the interface. + * + * @param implementation + */ + private static void removeRealizations(EList providedIntfs, final Class implementation) { + // now loop through all interface realization relations and remove those that are not + // related to a provided port. + final EList toBeRemoved = new BasicEList(); + for (InterfaceRealization ir : implementation.getInterfaceRealizations()) { + String name = ir.getName(); + // automatically added interface realization is identified via its name (simpler + // compared to use of stereotype) + if ((name != null) && name.startsWith("derived")) { //$NON-NLS-1$ + Interface inheritedIntf = ir.getContract(); + if (!providedIntfs.contains(inheritedIntf)) { + toBeRemoved.add(ir); + } + } + } + if (toBeRemoved.size() > 0) { + // remove InterfaceRealization, since not part of provided interfaces + CommandSupport.exec(TransactionUtil.getEditingDomain(implementation), Messages.CompImplSync_InfoSyncViaImpl, new Runnable() { + + @Override + public void run() { + // implCopy = implementation; + for (InterfaceRealization ir : toBeRemoved) { + ir.destroy(); + } + } + }); + } + } + + /** + * The interface that types a port has been modified. Subsequently, the names of + * methods have to be adapted accordingly, methods have to be removed or added + * + * @param implementation + * @param port + * @param newName + */ + public static void interfaceModifications(Class implementation, BehavioralFeature toBeRemoved) { + syncDerivedOperations(implementation); + + EList ownedOperations = implementation.getOwnedOperations(); + // loop through all methods, adapt name according to specification name. + Iterator behaviors = implementation.getOwnedBehaviors().iterator(); + while (behaviors.hasNext()) { + Behavior behavior = behaviors.next(); + BehavioralFeature bf = behavior.getSpecification(); + if ((bf != null) && ownedOperations.contains(bf)) { + BehavioralFeature sourceBf = (BehavioralFeature) + UpdateUtils.getSource(bf); + + // if an operation is scheduled for deletion, it still exists at this + // point (This operation is called by an InterfaceListener which gets called + // before the deletion takes place) and the specification of associated behaviors + // still point to it. Therefore the check toBeRemoved is added. + if (sourceBf != toBeRemoved) { + String name = calcBehaviorName(sourceBf, implementation); + if (!name.equals(behavior.getName())) { + behavior.setName(name); + } + } + } + } + } + + public static void syncDerivedOperations(Class implementation) { + // check for unimplemented operations + // EList relShips = implementation.getSourceDirectedRelationships (UMLPackage.eINSTANCE.getInterfaceRealization ()); + EList realizedInterfaces = new BasicEList(); + // implementation.getInterfaceRealizations returns wrong value?? + + EList ownedOperations = implementation.getOwnedOperations(); + for (InterfaceRealization ir : implementation.getInterfaceRealizations()) { + /* + * for (DirectedRelationship relShip : relShips) + * if (relShip instanceof InterfaceRealization) { + * InterfaceRealization ir = (InterfaceRealization) relShip; + */ + Interface intf = ir.getContract(); + if (intf == null) { + // should not happen? + continue; + } + realizedInterfaces.add(intf); + + for (Operation operation : intf.getAllOperations()) { + Operation copiedOperation = (Operation) + UpdateUtils.getDerivedElement(ownedOperations, operation); + if (copiedOperation == null) { + // no owned operation derived from the interface operation found. + // Would indicate normally that there is no suitable owned operation. + // However: stereotype values may not be available during model load, check + // whether there is an identical operation, before copying one. + copiedOperation = OperationUtils.getSameOperation(operation, implementation); + if (copiedOperation == null) { + copiedOperation = implementation.createOwnedOperation(operation.getName(), null, null); + OperationUtils.syncOperation(operation, copiedOperation); + copiedOperation.setIsAbstract(false); + } + UpdateUtils.setSource(copiedOperation, operation); + } else if (!OperationUtils.isSameOperation(operation, copiedOperation)) { + OperationUtils.syncOperation(operation, copiedOperation); + copiedOperation.setIsAbstract(false); + } + } + } + for (Behavior method : implementation.getOwnedBehaviors()) { + SyncBehaviorParameters.syncParameters(method); + } + + // remove operations that are no longer provided via an interface of a port (and + // that are derived elements, i.e. have a source attribute) + Iterator ownedOpsIter = ownedOperations.iterator(); + while (ownedOpsIter.hasNext()) { + Operation ownedOp = ownedOpsIter.next(); + + DerivedElement de = UMLUtil.getStereotypeApplication(ownedOp, DerivedElement.class); + if (de != null) { + if (de.getSource() instanceof Operation) { + + Operation sourceOp = (Operation) de.getSource(); + // check, whether sourceOp is offered by one of the realized interfaces + boolean contains = false; + for (Interface realizedIntf : realizedInterfaces) { + if (realizedIntf.getAllOperations().contains(sourceOp)) { + contains = true; + } + } + if (!contains) { + // operation belongs to an interface which is not implemented => remove + ownedOpsIter.remove(); + ownedOp.destroy(); + } + } + else if (de.getSource() == null) { + // source element does not exist => remove + ownedOpsIter.remove(); + ownedOp.destroy(); + } + } + } + } + + + + /** + * Calculate the name of a behavior for a given operation + * TODO better handling of overloading (better representation of signature) + * + * @param operation + * @return + */ + private static String calcBehaviorName(BehavioralFeature bf, Classifier cl) { + /* + * Iterator operations = cl.getOperations ().iterator (); + * while (operations.hasNext ()) { + * Operation op = operations.next (); + * if ((op.getName () == bf.getName ()) && (op != bf)) { + * // at least one other operation with same name, return long name + * return bf.getName () + bf.getOwnedParameters ().toString (); + * } + * } + */ + return bf.getName(); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompTypeSync.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompTypeSync.java new file mode 100644 index 00000000000..4bb5070b757 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/CompTypeSync.java @@ -0,0 +1,55 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.sync; + +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Port; + +/** + * Create a UML like executor, i.e. + * for each port p with a provided interface I, add a get_p to the executor + * for each port q with a required interface I, add an attribute q to the executor. This + * attribute is manipulated by the container. + * + * @author ansgar + * + */ +public class CompTypeSync { + + /** + * Rename the operations/attributes associated with a port, if the ports + * name or type has changed. + * TODO: obsolete, since the port-operations aren't there yet. + * + * @param component + * @param port + */ + public static void renamePort(Class component, Port port, String oldName) { + // CompImplSync.renamePortViaType (component, port, oldName); + // CompImplSync.renamePort(component, port, oldName); + } + + + /** + * Synchronizes the operations/attributes associated with a port + * + * @param component + * @param port + */ + public static void syncPort(Class component, Port port) { + CompImplSync.syncViaType(component, false); + // CompImplSync.syncContextOps (component, true); + } +}; diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/DepPlanSync.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/DepPlanSync.java new file mode 100644 index 00000000000..6dd0266179a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/DepPlanSync.java @@ -0,0 +1,147 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.sync; + +import java.util.Iterator; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationRTException; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.InstanceValue; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.ValueSpecification; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Currently unused synchronization for deployment plans. + * + * @see comp.cea.ec3m.gentools.core.listeners.DepPlanListener + * + * @author ansgar + */ +public class DepPlanSync { + + /** + * Synchronize a deployment plan: remove slots that refer to properties that exist no longer + * and add those that do not exist yet + * + * @param element + * an arbitrary element of the source model (i.e. the model that will + * store the deployment plan + * @throws TransformationException + */ + public static void syncAllDepPlans(Element element) { + for (Package depPlan : DepPlanUtils.getAllDepPlans(element)) { + syncDepPlan(depPlan); + } + } + + /** + * Synchronize a deployment plan: remove slots that refer to properties that exist no longer + * and add those that do not exist yet + * + * @param depPlan + * @throws TransformationException + */ + public static void syncDepPlan(Package depPlan) { + removeUnusedSlots(depPlan); + // EList list = new BasicEList(); + DeploymentPlan cdp = UMLUtil.getStereotypeApplication(depPlan, DeploymentPlan.class); + if (cdp == null) { + return; + } + InstanceSpecification mainInstance = cdp.getMainInstance(); + addCDP(depPlan, mainInstance, mainInstance.getName()); + // now add elements that are not in the plan - although they should + // avoid to replicate code already in dep-creation. => createDepPlan(top) + // strategy: create new dep-plan and compare? + } + + private static void addCDP(Package depPlan, InstanceSpecification instance, String canonicalName) + { + Class implementation = DepUtils.getImplementation(instance); + if (!instance.getName().equals(canonicalName)) { + instance.setName(canonicalName); + } + // check sub-instances + for (Slot slot : instance.getSlots()) { + InstanceSpecification subInstance = DepUtils.getInstance(slot); + if (subInstance != null) { + addCDP(depPlan, subInstance, canonicalName + "." + slot.getDefiningFeature().getName()); //$NON-NLS-1$ + } + } + for (Property attribute : Utils.getParts(implementation)) { + Type type = attribute.getType(); + if (type instanceof Class) { + if (!hasSlot(instance, attribute)) { + try { + InstanceSpecification partIS = + DepCreation.createDepPlan(depPlan, (Class) type, instance.getName() + "." + attribute.getName(), true); //$NON-NLS-1$ + DepPlanUtils.createSlot(depPlan, instance, partIS, attribute); + } catch (TransformationException e) { + Log.log(IStatus.ERROR, Log.DEPLOYMENT, e.getMessage()); + throw new TransformationRTException(e.getMessage()); + } + } + } + } + } + + private static boolean hasSlot(InstanceSpecification instance, Property attribute) { + for (Slot slot : instance.getSlots()) { + if (slot.getDefiningFeature() == attribute) { + return true; + } + } + return false; + } + + public static void removeUnusedSlots(Package depPlan) { + // remove elements that are no longer in the plan + for (NamedElement member : depPlan.getMembers()) { + if (member instanceof InstanceSpecification) { + InstanceSpecification instance = (InstanceSpecification) member; + Iterator slotIt = instance.getSlots().iterator(); + while (slotIt.hasNext()) { + Slot slot = slotIt.next(); + if (slot.getDefiningFeature() == null) { + // property has been removed => remove associated slot + for (ValueSpecification value : slot.getValues()) { + if (value instanceof InstanceValue) { + InstanceSpecification is = ((InstanceValue) value).getInstance(); + DepPlanUtils.delDepPlan(is); + } + } + slot.destroy(); + slotIt.remove(); + } + } + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/InterfaceSync.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/InterfaceSync.java new file mode 100644 index 00000000000..66e85da0cb6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/InterfaceSync.java @@ -0,0 +1,141 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.sync; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.qompass.designer.core.OperationUtils; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Generalization; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Reception; +import org.eclipse.uml2.uml.Signal; +import org.eclipse.uml2.uml.UMLFactory; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Synchronize the use of a common superclass for signal reception with the + * question whether an interface has at least one owned reception. + */ +public class InterfaceSync { + + public static final String SIG_PREFIX = "SIG_"; //$NON-NLS-1$ + + /** + * Name of an interface for generic reception support within the Qompass + * sysinterfaces modeling library + */ + private static final String SIGNAL_RECEPTION_QN = "sysinterfaces::SignalReception"; //$NON-NLS-1$ + + protected static boolean useGenericSigInterface = false; + + public static void syncSignalReceptionSupport(Interface intf) { + if (useGenericSigInterface) { + syncGenericSignalReceptionSupport(intf); + } else { + syncSpecificSignalReceptionSupport(intf); + } + } + + public static void syncSpecificSignalReceptionSupport(Interface intf) { + for (Reception reception : intf.getOwnedReceptions()) { + Signal signal = reception.getSignal(); + if (signal != null) { + String opName = SIG_PREFIX + signal.getName(); + Operation existingOperation = intf.getOwnedOperation(opName, null, null); + Operation newOperation = UMLFactory.eINSTANCE.createOperation(); + newOperation.setName(opName); + for (Property attribute : signal.getAttributes()) { + Parameter parameter = newOperation.createOwnedParameter(attribute.getName(), attribute.getType()); + parameter.setLower(attribute.getLower()); + parameter.setUpper(attribute.getUpper()); + } + if (existingOperation == null) { + intf.getOwnedOperations().add(newOperation); + } else if (!OperationUtils.isSameOperation(existingOperation, newOperation)) { + OperationUtils.syncOperation(newOperation, existingOperation); + } + DerivedElement de = StereotypeUtil.applyApp(newOperation, DerivedElement.class); + if (de != null) { + de.setSource(reception); + } + } + } + // now remove derived operations that are no longer needed. + EList ownedOperations = new BasicEList(); + ownedOperations.addAll(intf.getOwnedOperations()); + for (Operation operation : ownedOperations) { + DerivedElement de = UMLUtil.getStereotypeApplication(operation, DerivedElement.class); + if (de != null) { + if (de.getSource() instanceof Reception) { + Reception reception = (Reception) de.getSource(); + Signal signal = reception.getSignal(); + if ((signal == null) || !(SIG_PREFIX + signal.getName()).equals(operation.getName())) { + // reception exists, but has no signal or another signal + operation.destroy(); + } + } else { + // reception does not exist any more + operation.destroy(); + } + } + } + } + + public static void syncGenericSignalReceptionSupport(Interface intf) { + + NamedElement genericReceptionNE = Utils.getQualifiedElement(PackageUtil.getRootPackage(intf), SIGNAL_RECEPTION_QN); + if (genericReceptionNE instanceof Interface) { + Interface genericReceptionIntf = (Interface) genericReceptionNE; + if (intf.getOwnedReceptions().size() > 0) { + if (!hasReceptionSupport(intf, genericReceptionIntf)) { + addReceptionSupport(intf, genericReceptionIntf); + } + } else if (hasReceptionSupport(intf, genericReceptionIntf)) { + removeReceptionSupport(intf, genericReceptionIntf); + } + } + } + + public static boolean hasReceptionSupport(Interface intf, Interface genericReceptionIntf) { + // TODO: does it find an indirect reception? + for (Classifier general : intf.getGenerals()) { + if (general == genericReceptionIntf) { + return true; + } + } + return false; + } + + public static void addReceptionSupport(Interface intf, Interface genericReceptionIntf) { + intf.createGeneralization(genericReceptionIntf); + } + + public static void removeReceptionSupport(Interface intf, Interface genericReceptionIntf) { + for (Generalization generalization : intf.getGeneralizations()) { + if (generalization.getGeneral() == genericReceptionIntf) { + generalization.destroy(); + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/SyncBehaviorParameters.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/SyncBehaviorParameters.java new file mode 100644 index 00000000000..8cc35234e1d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/sync/SyncBehaviorParameters.java @@ -0,0 +1,44 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.sync; + +import org.eclipse.papyrus.qompass.designer.core.StUtils; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.BehavioralFeature; +import org.eclipse.uml2.uml.Parameter; + +/** + * Synchronize behavior parameters + * + * A behavior is often a method for a behavioral feature. In this case, UML validation checks that the number and type + * of parameters of the behavior and the behavioral feature match. + * This class synchronizes the parameters of the behavior with that of the behavioral feature. + */ +public class SyncBehaviorParameters { + public static final void syncParameters(Behavior method) { + + BehavioralFeature bf = method.getSpecification(); + if (bf != null) { + method.getOwnedParameters().clear(); + for (Parameter parameter : bf.getOwnedParameters()) { + Parameter newParameter = method.createOwnedParameter(parameter.getName(), parameter.getType()); + newParameter.setDirection(parameter.getDirection()); + LazyCopier.copyMultElemModifiers(parameter, newParameter); + StUtils.copyStereotypes(parameter, newParameter); + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/BindingUtils.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/BindingUtils.java new file mode 100644 index 00000000000..1a138465cb1 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/BindingUtils.java @@ -0,0 +1,150 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + */ + +package org.eclipse.papyrus.qompass.designer.core.templates; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.papyrus.C_Cpp.ConstInit; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.PortUtils; +import org.eclipse.papyrus.qompass.designer.core.StUtils; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.OpaqueBehavior; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.util.UMLUtil; + +public class BindingUtils { + + /** + * Bind an operation by copying the signature from the actual. + * + * @param copy + * the copier + * @param actual + * the actual. If an operation, its signature is copied to the template + * @param operation + * The operation template + * @return + */ + public static Operation instantiateOperation(LazyCopier copy, Element actual, Operation operation) { + try { + Operation newOperation = copy.getCopy(operation); + if (actual instanceof Operation) { + for (Parameter parameter : ((Operation) actual).getOwnedParameters()) { + Parameter newParam = EcoreUtil.copy(parameter); // copy parameter via EcoreUtil + newParam.setType(copy.getCopy(parameter.getType())); + newOperation.getOwnedParameters().add(newParam); + StUtils.copyStereotypes(parameter, newParam); // copy stereotypes of the parameter + } + } + TransformationContext.classifier = newOperation.getClass_(); + if (actual instanceof Classifier) { + bindOperation(newOperation, (Classifier) actual); + } + String newName = TextTemplateBinding.bind(operation.getName(), actual, null); + newOperation.setName(newName); + + return newOperation; + } catch (TransformationException e) { + // throw runtime exception + throw new RuntimeException(String.format(Messages.TemplateInstantiationListener_TrafoException, e.getMessage())); + } + } + + /** + * Instantiate a behavior + * + * @param copy + * copier + * @param actual + * actual in template instantiation + * @param opaqueBehavior + * behavior with body in form of an Acceleo template. + * @return instantiated (bound) behavior. + * @throws TransformationException + */ + public static OpaqueBehavior instantiateBehavior(LazyCopier copy, Element actual, OpaqueBehavior opaqueBehavior) throws TransformationException { + OpaqueBehavior newBehavior = copy.getCopy(opaqueBehavior); + if (actual instanceof NamedElement) { + String newName = TextTemplateBinding.bind(opaqueBehavior.getName(), actual, null); + newBehavior.setName(newName); + } + EList bodyList = newBehavior.getBodies(); + for (int i = 0; i < bodyList.size(); i++) { + String body = bodyList.get(i); + TransformationContext.classifier = (Classifier) newBehavior.getOwner(); + // pass qualified operation name as template name. Used to identify script in case of an error + String newBody = TextTemplateBinding.bind(body, actual); + bodyList.set(i, newBody); + } + return newBehavior; + } + + + + /** + * Bind C++ const initializer + * + * @param operation + * @param actual + * @throws TransformationException + */ + public static void bindOperation(Operation operation, Classifier actual) throws TransformationException { + // perform binding in case of C++ initializer + ConstInit cppConstInit = UMLUtil.getStereotypeApplication(operation, ConstInit.class); + if (cppConstInit != null) { + // TODO: specific to C++ + String init = cppConstInit.getInitialisation(); + String newInit = TextTemplateBinding.bind(init, actual); + cppConstInit.setInitialisation(newInit); + } + } + + /** + * @param actual + * the actual template parameter + * @param boundClass + * the bound class + * @param provides + * true, if the provided interface should be returned + * @return the provided or required interface of a port (of the passed + * boundClass) that is typed with the the actual. + */ + public static Interface getInterfaceFromPortTypedWithActual(Type actual, Class boundClass, boolean provided) { + for (Port port : PortUtils.getAllPorts(boundClass)) { + Interface provOrReqIntf; + if (provided) { + provOrReqIntf = PortUtils.getProvided(port); + } else { + provOrReqIntf = PortUtils.getRequired(port); + } + + if ((port.getType() == actual) && (provOrReqIntf != null)) { + return provOrReqIntf; + } + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/ConnectorBinding.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/ConnectorBinding.java new file mode 100644 index 00000000000..dca6f447db3 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/ConnectorBinding.java @@ -0,0 +1,455 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.templates; + +import java.util.Iterator; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.qompass.designer.core.CreationUtils; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.PortUtils; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.ConnectorEnd; +import org.eclipse.uml2.uml.Feature; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Namespace; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.ParameterableElement; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.TemplateParameter; +import org.eclipse.uml2.uml.TemplateParameterSubstitution; +import org.eclipse.uml2.uml.TemplateSignature; +import org.eclipse.uml2.uml.Type; + +/** + * Create an automatic template binding for a connector, i.e. a binding that assures + * that the ports of an interaction component match those of an application component + * (if possible) + */ +public class ConnectorBinding { + + /** + * Helper function for getActual + * + * @param port + * a port of the the connector template (not evaluated except for debugging output) + * @param connector + * the connector that is checked for reification + * @param composite + * a composite class + * @param actual + * the current candidate for an actual, i.e. result of previous attempts to bind (at different connector ends) + * @param isProvided + * is an interface provided or required. + * @return the type at the "other" (makes sense for property connector only) end of a connector + * @throws TransformationException + */ + private static Type matchOtherEnd(Port port, Feature connector, Type actual, boolean isProvided) + throws TransformationException { + if (connector instanceof Connector) { + return matchOtherEnd(port, (Connector) connector, actual, isProvided); + } + else if (connector instanceof Property) { + return matchOtherEnd(port, (Property) connector, actual, isProvided); + } + return null; + } + + private static Type matchOtherEnd(Port port, Connector connector, Type actual, boolean isProvided) + throws TransformationException { + // the template provides the formal parameter at one of its ports. Now examine + // with whom this port is connected, i.e. examine all connectorEnds + // The type of the connected port determines the binding. + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format("", port.getName())); //$NON-NLS-1$ + boolean found = false; + for (ConnectorEnd connEnd : connector.getEnds()) { + // the connector end targets a port of a part or the composite (in case of delegation) + ConnectableElement connElem = connEnd.getRole(); + if (connElem instanceof Port) { + Port otherPort = (Port) connElem; + Interface otherInterface; + + // distinction between assembly or delegation (other end is null) connectors + boolean isAssembly = (connEnd.getPartWithPort() != null); + + if (isProvided == isAssembly) { + // need required for other, if first port isProvided and assembly, or if first port isRequired and delegation + otherInterface = PortUtils.getRequired(otherPort); + } else { + otherInterface = PortUtils.getProvided(otherPort); + } + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format(Messages.ConnectorBinding_ConnectorsPort, otherInterface)); + if (otherInterface != null) { + if (actual == null || actual == otherInterface) { + actual = otherInterface; + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( + Messages.ConnectorBinding_InfoActualReturnIntfIs, actual.getQualifiedName())); + found = true; + } else if (actual != otherInterface) { + continue; + } + } + } + } + if (!found) { + throw new TransformationException(String.format( + Messages.ConnectorBinding_CannotFindConsistentBinding, + port.getName(), connector.getName(), connector.getNamespace().getName(), actual.getName())); + } + return actual; + } + + + private static Type matchOtherEnd(Port port, Property partConnector, Type actual, boolean isProvided) + throws TransformationException { + // the template provides the formal parameter at one of its ports. Now examine + // with whom this port is connected, i.e. examine all connectors of the + // composite. The type of the connected port determines the binding. + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( + Messages.ConnectorBinding_InfoMatchOtherEnd, port.getName())); + + for (Connector connector : partConnector.getClass_().getOwnedConnectors()) { + if (ConnectorUtil.connectsPart(connector, partConnector)) { + // the connector end targets a port of a part or the composite (in case of delegation) + ConnectorEnd connEnd = ConnectorUtil.connEndNotPart(connector, partConnector); + ConnectableElement connElem = connEnd.getRole(); + if (connElem instanceof Port) { + Port otherPort = (Port) connElem; + Interface otherInterface; + + // distinction between assembly or delegation (other end is null) connectors + boolean isAssembly = (connEnd.getPartWithPort() != null); + + if (isProvided == isAssembly) { + // need required for other, if first port isProvided and assembly, or if first port isRequired and delegation + otherInterface = PortUtils.getRequired(otherPort); + } else { + otherInterface = PortUtils.getProvided(otherPort); + } + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format(Messages.ConnectorBinding_InfoConnectsPort, otherInterface)); + if (otherInterface != null) { + if (actual == null) { + actual = otherInterface; + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( + Messages.ConnectorBinding_InfoActualReturnIntfIs, actual.getQualifiedName())); + } else if (actual != otherInterface) { + throw new TransformationException(String.format( + Messages.ConnectorBinding_CannotFindConsistentBinding, + port.getName(), connector.getName(), connector.getNamespace().getName(), actual.getName())); + } + } + } + } + } + return actual; + } + + + /** + * This function tries to bind a formal template parameter to an "actual". The criterion + * for a successful binding is that the (primitive) connections of the reified connector + * part have a matching port kind. + * The function makes a matching based on (1) either provided and required interfaces (2) + * or identical portKinds and different conjugations + * + * @param composite + * The composite in which a binding should be determined. + * @param part + * the part within the composite for which we try to find a binding, + * The information about the part is used to determine which connection + * end belongs to the template part and which to another part/port (which + * determines the binding). + * @param template + * A template class + * @param formal + * the formal template parameter + * @throws TransformationException + * if no consistent binding can be found + * @return the actual + */ + public static Type getActual(Feature partOrConnector, Class template, ParameterableElement formal) + throws TransformationException { + Type actual = null; + + // loop through all ports of the template, use getAllPorts to include inherited ports as well. + for (Port port : PortUtils.getAllPorts(template)) { + Interface providedIntf = PortUtils.getProvided(port); + + // need to check, if the port at the opposite connector is matching, provided that we use a specific + // value for the the formal. Typically, ports of the template are typed with the formal parameter. Thus, + // we would have to infer the formal from a given provided or required interface. This is not possible + // in general (no inverse mapping operation), but the simple case that either the provided or required + // interface is identical to the formal parameter are checked. + // + // 1. provided interface is formal + if (providedIntf == formal) { + actual = matchOtherEnd(port, partOrConnector, actual, true); + } + + // 2. required interface is formal + Interface requiredIntf = PortUtils.getRequired(port); + if (requiredIntf == formal) { + actual = matchOtherEnd(port, partOrConnector, actual, false); + } + + // 3. port type is formal (but none of the two cases above) + // this check is stronger than the first two, since it requires port kind identity. + // If none of the first two variants holds, the port is translating interfaces + // for which this stronger condition holds. + Type type = PortUtils.getFCMType(port); + if ((providedIntf != formal) && (requiredIntf != formal) && (type == formal)) { + // the template provides the formal parameter at one of its ports. Now examine + // with whom this port is connected, i.e. examine all ends of the + // connector. The type of the connected port determines the binding. + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( + Messages.ConnectorBinding_InfoProvidedPortTypeMatches, port.getName())); + boolean found = false; + + if (partOrConnector instanceof Property) { + Property partConnector = (Property) partOrConnector; + // iterate over the connectors of the composite containing the part + for (Connector connector : partConnector.getClass_().getOwnedConnectors()) { + if (ConnectorUtil.connectsPart(connector, partConnector)) { + // the connector end targets a port of a part or the composite (in case of delegation) + ConnectorEnd connEnd = ConnectorUtil.connEndNotPart(connector, partConnector); + actual = matchViaEnd(connEnd, port, partOrConnector, actual); + if (actual != null) { + found = true; + break; + } + } + } + } + else { + for (ConnectorEnd connEnd : ((Connector) partOrConnector).getEnds()) { + actual = matchViaEnd(connEnd, port, partOrConnector, actual); + if (actual != null) { + found = true; + break; + } + } + } + if (!found) { + String errorMsg = createErrorMsg(port, partOrConnector); + throw new TransformationException(errorMsg); + } + } + } + return actual; + } + + protected static String createErrorMsg(Port port, Feature partOrConnector) { + String errorMsg = String.format( + Messages.ConnectorBinding_CannotFindBindingForPort, + port.getName(), partOrConnector.getName()); + for (Classifier cl : partOrConnector.getFeaturingClassifiers()) { + errorMsg += " of class '" + cl.getName() + "'"; //$NON-NLS-1$ //$NON-NLS-2$ + } + errorMsg += ". "; //$NON-NLS-1$ + return errorMsg; + } + + private static Type matchViaEnd(ConnectorEnd connEnd, Port port, Feature partOrConnector, Type actual) throws + TransformationException { + String errorMsg = createErrorMsg(port, partOrConnector); + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, "port: " + port); //$NON-NLS-1$ + // Log.log(Status.INFO, Log.TEMPLATE_BINDING, "role1: " + connector.getEnds().get(0).getRole()); + // Log.log(Status.INFO, Log.TEMPLATE_BINDING, "role2: " + connector.getEnds().get(1).getRole()); + + ConnectableElement connElem = connEnd.getRole(); + if (connElem instanceof Port) { + Port otherPort = (Port) connElem; + + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( + Messages.ConnectorBinding_InfoConnPortConnectedVia, + port.getName(), partOrConnector.getName())); + Type otherType = PortUtils.getFCMType(otherPort); + + + // type must be the same, kind as well. But depending on delegation or not, one of the ports + // must be conjugated + // TODO: isAssembly check will wrongly return false, if no port is connected [well, in this case, the role is not a port but a part] + boolean isAssembly = (connEnd.getPartWithPort() != null); + boolean sameConjugation = (otherPort.isConjugated() == port.isConjugated()); + // if assembly connection, conjugations must be different. + if (isAssembly == sameConjugation) { + return actual; // was: continue + } + + // now compare kinds + if (!PortUtils.sameKinds(port, otherPort)) { + // no match, try next end + return actual; // was: continue + } + + if (otherType != null) { + if (actual == null) { + actual = otherType; + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( + Messages.ConnectorBinding_InfoActualReturnIntfIs, actual.getQualifiedName())); + } else if (actual != otherType) { + throw new TransformationException(errorMsg + " " + String.format( //$NON-NLS-1$ + Messages.ConnectorBinding_FormalAlreadyBound, actual.getName())); + } + } + } + return actual; + } + + /** + * The objective of this function is to find a suitable binding for a part + * typed with a template class (connector) based compatible port types. The binding + * is obtained by examining the connections between the composite and the contained + * part. + * + * @param composite + * the composite which owns the part + * @param containedPart + * the part which represents the connector + * @param template + * an element within a package template (might be deeply nested) which + * has ports that depend on a template parameter. This method tries to find a binding + * for the template parameters that renders the ports of this element compatible with + * the ports of the composition context. + * @return the bound package + * ? binding information, i.e. information about the bound package, whether already bound and the binding. + */ + public static TemplateBinding obtainBinding(Class composite, + Feature connector, Class template, boolean createBinding) throws TransformationException { + // obtain the signature of an element within a package template. + + TemplateSignature signature = TemplateUtils.getSignature(template); + if (signature == null) { + // not a template. This is not an exception, caller need to handle "null" a return + // value indicating that no template instantiation needs to be done. + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( + Messages.ConnectorBinding_NoTemplateSignature, template.getName())); + return null; + } + + // list of actuals (must be ParameterableElements, in our case always a named element as well. + EList actuals = new BasicEList(); + + Package pkgTemplate = (Package) signature.getOwner(); + String name = pkgTemplate.getName(); + + /* + * Signature extension - useful?? (since binding has to be made as well) + * Stereotype sigExtSt = signature.getAppliedStereotype ("FCM::SignatureExt"); + * SignatureExt sigExt = null; + * if (sigExtSt != null) { + * sigExt = (SignatureExt) signature.getStereotypeApplication (sigExtSt); + * } + * + * for (TemplateSignature sig : sigExt.getExtension ()) { + * bindFormal (); + * } + */ + + // loop on template parameters + boolean firstTP = true; + for (TemplateParameter parameter : signature.getParameters()) { + ParameterableElement formal = parameter.getParameteredElement(); + + // now obtain suitable binding for this parameter - look for ports that are typed with + // the formal template parameter + ParameterableElement actual = null; + if (firstTP) { + // only try to match the first template parameter based on ports. + actual = getActual(connector, template, formal); + firstTP = false; + } else { + // additional template parameters that are bound automatically based on their name + // (this might be considered as a hack, it is merely a convention for automatic template + // binding within the Qompass context. + if (formal instanceof NamedElement) { + NamedElement formalNE = (NamedElement) formal; + if ((formal instanceof Class) && (formalNE.getName().equals("T"))) { //$NON-NLS-1$ + actual = composite; + } + if ((formal instanceof Port) && (formalNE.getName().equals("P"))) { //$NON-NLS-1$ + // port (but not available?) + actual = TransformationContext.port; + } + } + } + if (actual instanceof NamedElement) { + actuals.add(actual); + name = name + "_" + ((NamedElement) actual).getName(); //$NON-NLS-1$ + } else { + String reason = String.format( + Messages.ConnectorBinding_CannotFindBinding, + ((NamedElement) formal).getName(), composite.getName(), connector.getName(), template.getName()); + throw new TransformationException(reason); + } + } + + // the bound package is instantiated in the same model, in which the + // composite can be found (avoid modifying an imported model). + + if (!createBinding) { + return null; + } + + Namespace owner = (Namespace) pkgTemplate.getOwner(); + owner = CreationUtils.getAndCreate(composite.getModel(), owner.allNamespaces()); + + Package boundPackage = (Package) owner.getMember(name); + if (boundPackage == null) { + // class does not exist yet, needs to be created. + boundPackage = ((Package) owner).createNestedPackage(name); + + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( + Messages.ConnectorBinding_InfoCreateBoundPackage, name, owner.getName())); + } + + TemplateBinding binding = boundPackage.getTemplateBinding(signature); + if (binding == null) { + // binding is not existing yet (should normally only happen, if the class has + // just been created - but it's better to re-check, even if the bound package + // was already there) + binding = boundPackage.createTemplateBinding(signature); + + Iterator actualsIter = actuals.iterator(); + + // loop on template parameters; + for (TemplateParameter parameter : signature.getParameters()) { + TemplateParameterSubstitution substitution = binding.createParameterSubstitution(); + substitution.setFormal(parameter); + + // now obtain suitable binding for this parameter - look for ports that are typed with + // the formal template parameter + ParameterableElement actual = actualsIter.next(); + // for UML <= 2.1 + // substitution.getActuals ().add ((ParameterableElement) actual); + // for UML > 2.2 + substitution.setActual(actual); + } + } + return binding; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PostTemplateInstantiationListener.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PostTemplateInstantiationListener.java new file mode 100644 index 00000000000..7fbbc0387db --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PostTemplateInstantiationListener.java @@ -0,0 +1,62 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.templates; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.FCM.BindingHelper; +import org.eclipse.papyrus.FCM.Template; +import org.eclipse.papyrus.qompass.designer.core.extensions.BindingHelperExt; +import org.eclipse.papyrus.qompass.designer.core.listeners.PostCopyListener; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Specific tweaking of template instantiation is implemented by means of a PostCopyListener that + * evaluates the template stereotype. + * Chiefly used for text templates + */ +public class PostTemplateInstantiationListener implements PostCopyListener { + + public static PostTemplateInstantiationListener getInstance() { + if (postTemplateInstantiationListener == null) { + postTemplateInstantiationListener = new PostTemplateInstantiationListener(); + } + return postTemplateInstantiationListener; + } + + public void init(LazyCopier copy, TemplateBinding binding) { + this.binding = binding; + } + + private TemplateBinding binding; + + private static PostTemplateInstantiationListener postTemplateInstantiationListener; + + @Override + public void postCopyEObject(LazyCopier copy, EObject targetEObj) { + if (targetEObj instanceof Element) { + + Template template = UMLUtil.getStereotypeApplication((Element) targetEObj, Template.class); + if ((template != null)) { + BindingHelper helper = template.getHelper(); + if (helper != null) { + BindingHelperExt.applyPostHelper(helper, copy, binding, targetEObj); + } + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PreTemplateInstantiationListener.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PreTemplateInstantiationListener.java new file mode 100644 index 00000000000..eed7c3ddbb6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/PreTemplateInstantiationListener.java @@ -0,0 +1,94 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.templates; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.FCM.BindingHelper; +import org.eclipse.papyrus.FCM.Template; +import org.eclipse.papyrus.qompass.designer.core.extensions.BindingHelperExt; +import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.uml2.uml.BehavioralFeature; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.OpaqueBehavior; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Template instantiation is implemented by means of an CopyListener that + * evaluates the template stereotype. + */ + +public class PreTemplateInstantiationListener implements PreCopyListener { + + public static PreTemplateInstantiationListener getInstance() { + if (preTemplateInstantiationListener == null) { + preTemplateInstantiationListener = new PreTemplateInstantiationListener(); + preTemplateInstantiationListener.treatTemplate = false; + } + return preTemplateInstantiationListener; + } + + public void init(LazyCopier copy, TemplateBinding binding) { + this.binding = binding; + preTemplateInstantiationListener.treatTemplate = false; + } + + private TemplateBinding binding; + + private boolean treatTemplate; + + private static PreTemplateInstantiationListener preTemplateInstantiationListener; + + @Override + public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { + if (treatTemplate) { + return sourceEObj; + } + treatTemplate = true; + EObject targetEObj = checkEObject(copy, sourceEObj); + treatTemplate = false; + return targetEObj; + } + + protected EObject checkEObject(LazyCopier copy, EObject sourceEObj) { + + // Specific treatment of OpaqueBehaviors: Template instantiations are typically managed + // by the associated operation which instantiates operation and behavior. In this case, the + // behavior should not be instantiated. + if (sourceEObj instanceof OpaqueBehavior) { + OpaqueBehavior behavior = (OpaqueBehavior) sourceEObj; + BehavioralFeature bf = behavior.getSpecification(); + if (bf != null) { + Template template = UMLUtil.getStereotypeApplication(bf, Template.class); + if (template != null) { + return null; + } + } + } + + if (sourceEObj instanceof Element) { + + Template template = UMLUtil.getStereotypeApplication((Element) sourceEObj, Template.class); + if ((template != null)) { + BindingHelper helper = template.getHelper(); + if (helper != null) { + return BindingHelperExt.applyPreHelper(helper, copy, binding, sourceEObj); + } + } + } + return sourceEObj; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateInstantiation.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateInstantiation.java new file mode 100644 index 00000000000..2caa5bb8464 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateInstantiation.java @@ -0,0 +1,284 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.templates; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.BindingHelper; +import org.eclipse.papyrus.FCM.Template; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FilterSignatures; +import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FilterTemplate; +import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FixTemplateSync; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Namespace; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.ParameterableElement; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.TemplateParameter; +import org.eclipse.uml2.uml.TemplateParameterSubstitution; +import org.eclipse.uml2.uml.TemplateSignature; +import org.eclipse.uml2.uml.TemplateableElement; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * This class encapsulates functions around template instantiation. + * + * With respect to composite structures, we need to consider two different + * cases: (1) the type of a property is a template class itself (2) the type of + * a property is a sub-class (nesting) of the template class. We consider that + * such a class inherits the template signature of its owner, i.e. it can access + * formal parameters of the owning template class. (3) the type of a property is + * a normal class + */ + +public class TemplateInstantiation { + + public TemplateInstantiation(LazyCopier copy, TemplateBinding binding) throws TransformationException { + this(copy, binding, null); + } + + /** + * + * @param copier_ + * copier + * @param binding + * UML template binding + * @param args + * currently unused + * @throws TransformationException + */ + public TemplateInstantiation(final LazyCopier copier_, final TemplateBinding binding, Object args[]) throws TransformationException { + if (binding == null) { + // user should never see this exception + throw new TransformationException("Passed binding is null"); //$NON-NLS-1$ + } + signature = binding.getSignature(); + if (signature == null) { + throw new TransformationException("Passed template binding does not have a signature"); //$NON-NLS-1$ + } + packageTemplate = (Package) signature.getOwner(); + /* + * copy = (Copy)copy_.clone(); + * // make copy of copy listeners (clone alone does not duplicate contained lists) + * copy.preCopyListeners = new BasicEList(); + * copy.preCopyListeners.addAll(copy_.preCopyListeners); + * copy.postCopyListeners = new BasicEList(); + * copy.postCopyListeners.addAll(copy_.postCopyListeners); + */ + copier = copier_; + + Package boundPackage = (Package) binding.getBoundElement(); + // set template instantiation parameter. Used by Acceleo templates to get relation between + // formal and actual parameters + TransformationContext.setTemplateInstantiation(this); + TransformationContext.copier = copier; + + copier.setPackageTemplate(packageTemplate, boundPackage); + // some parameters of the package template may not be owned. Thus, an additional package + // template is involved in the instantiation + for (TemplateParameter parameter : signature.getParameters()) { + // + if (parameter.getSignature() != signature) { + Package addedPkgTemplate = parameter.getSignature().getNearestPackage(); + copier.setPackageTemplate(addedPkgTemplate, boundPackage); + } + } + + if (boundPackage.getPackagedElements() != null) { + // bound package is not empty, but copy does not know about it. Fill copyMap with information about the relation + // This happens, if the original model already contains template instantiations, e.g. for template ports + if (copier.getMap(signature).keySet().size() == 0) { + syncCopyMap(packageTemplate, boundPackage); + } + } + + this.binding = binding; + + // register a combination of formal/actual in the hashmap + // => copy will replace actual with formal + for (TemplateParameterSubstitution substitution : binding.getParameterSubstitutions()) { + ParameterableElement formal = substitution.getFormal().getParameteredElement(); + ParameterableElement actual = substitution.getActual(); + copier.putPair(formal, actual); + } + + // add copy listeners --- + // remove template signature + if (!copier.preCopyListeners.contains(FilterSignatures.getInstance())) { + copier.preCopyListeners.add(FilterSignatures.getInstance()); + } + + // 2a. special treatment for elements stereotyped with template parameter + if (!copier.preCopyListeners.contains(PreTemplateInstantiationListener.getInstance())) { + copier.preCopyListeners.add(PreTemplateInstantiationListener.getInstance()); + } + PreTemplateInstantiationListener.getInstance().init(copier, binding); + // 2b. special treatment for elements stereotyped with template parameter + if (!copier.postCopyListeners.contains(PostTemplateInstantiationListener.getInstance())) { + copier.postCopyListeners.add(PostTemplateInstantiationListener.getInstance()); + } + PostTemplateInstantiationListener.getInstance().init(copier, binding); + + if (!copier.postCopyListeners.contains(FixTemplateSync.getInstance())) { + copier.postCopyListeners.add(FixTemplateSync.getInstance()); + } + } + + /** + * Synchronize the copy map, i.e. put the correspondences between existing source and target elements into the map. + * Otherwise, a new binding would produce duplicates. + * TODO: A more efficient way would be to cache the copy function and only re-sync, if a new model has been loaded. + * On the other hand, the bound package is normally not very large + * + * @param sourcePkg + * The package template (source) + * @param targetPkg + * The bound package (target) + */ + public void syncCopyMap(Package sourcePkg, Package targetPkg) { + copier.put(sourcePkg, targetPkg); + for (PackageableElement target : targetPkg.getPackagedElements()) { + if (target instanceof NamedElement) { + String targetName = ((NamedElement) target).getName(); + PackageableElement source = sourcePkg.getPackagedElement(targetName); + if ((source instanceof Package) && (target instanceof Package)) { + syncCopyMap((Package) source, (Package) target); + } + else { + copier.put(source, target); + } + } + } + + } + + Package packageTemplate; + + public TemplateBinding binding; + + public LazyCopier copier; + + TemplateSignature signature; + + /** + * Bind a named element. Besides of binding the passed element, this + * operation will bind all elements that are referenced (required) by the + * passed element. + * + * In consequence, typically only a small part of a package template is + * actually created within the bound package. We call this mechanism lazy + * instantiation/binding + * + * @param copier + * Source and target model + * @param namedElement + * A member within the package template which should be bound, + * i.e. for which template instantiation should be performed. + * @param binding + * The binding between the bound package and the package template + */ + @SuppressWarnings("unchecked") + public T bindElement(T namedElement) throws TransformationException { + if (namedElement == null) { + // user should never see this exception + throw new TransformationException(Messages.TemplateInstantiation_TemplateIsNull); + } + + Package boundPackage = (Package) binding.getBoundElement(); + EList path = TemplateUtils.relativePathWithMerge(namedElement, packageTemplate); + Template template = UMLUtil.getStereotypeApplication(namedElement, Template.class); + BindingHelper helper = (template != null) ? + template.getHelper() : null; + + /* + * if((templateKind == TemplateKind.ACCUMULATE) || (templateKind == TemplateKind.LATE_EVALUATION)) { + * // TODO: not very clean yet + * path = TemplateUtils.relativePathWithMerge(namedElement, copy.source); + * if(path == null) { + * // element is imported + * path = namedElement.allNamespaces(); + * } + * boundPackage = copy.target; // CreationUtils.getAndCreate + * // (sat.target, "accumulate"); + * } + */ + + if (path != null) { + // register owning package template (template can be defined in + // multiple packages) + Element owner = TemplateUtils.getTemplateOwner(namedElement, signature); + if (owner != null) { + // note that we might overwrite an existing value + copier.put(owner, boundPackage); + } + } + else { + // element is not part of the package template referenced by the + // binding + if (namedElement instanceof TemplateableElement) { + // check whether the referenced element is part of another + // package template, + // (for which we allow for implicit binding with the first + // template parameter) + TemplateSignature signatureOfNE = TemplateUtils.getSignature((TemplateableElement) namedElement); + if ((signatureOfNE != null) && (signature != signatureOfNE)) { + TemplateBinding subBinding = TemplateUtils.getSubBinding(copier.target, (TemplateableElement) namedElement, binding); + TemplateInstantiation ti = new TemplateInstantiation(copier, subBinding); + Element ret = ti.bindElement(namedElement); + return (T) ret; + } + } + + // => nothing to do with respect to template instantiation, but + // since the template is potentially instantiated in another model, + // the referenced element might need to be copied. + + return copier.getCopy(namedElement); + } + // element is contained in the template package, examine whether it + // already exists in the + // bound package. + + NamedElement existingMember = (NamedElement) copier.get(namedElement); + /* + * if((existingMember != null) && (templateKind != TemplateKind.ACCUMULATE)) { + * // element is already existing (and thus bound), nothing to do + * // additional check, whether the ACCUMULATE information is unset) + * // however: if the element is a package, existence is not sufficient + * // since it might have been created via getAndCreate above + * + * //if(namedElement instanceof Package) { + * // bindPackage((Package)namedElement); + * //} + * return (T)existingMember; + * } + */ + if (existingMember == null) { + FilterTemplate.getInstance().setActive(false); + T copiedElement = copier.getCopy(namedElement); + FilterTemplate.getInstance().setActive(true); + copier.setPackageTemplate(null, null); + return copiedElement; + } + + return (T) existingMember; + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateUtils.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateUtils.java new file mode 100644 index 00000000000..0b31ae7efaf --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TemplateUtils.java @@ -0,0 +1,395 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.templates; + +import java.util.Iterator; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.qompass.designer.core.CreationUtils; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.PortUtils; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.ConnectorEnd; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.EncapsulatedClassifier; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Namespace; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageMerge; +import org.eclipse.uml2.uml.ParameterableElement; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.StructuredClassifier; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.TemplateParameter; +import org.eclipse.uml2.uml.TemplateParameterSubstitution; +import org.eclipse.uml2.uml.TemplateSignature; +import org.eclipse.uml2.uml.TemplateableElement; +import org.eclipse.uml2.uml.Type; + +public class TemplateUtils { + + /** + * Get the template signature of a classifier. If the classifier does not + * have a signature, examine if the owning class provides one + * + * @param template + * The potential template + * @return the signature or null, if none can be found. + */ + public static TemplateSignature getSignature(TemplateableElement template) { + TemplateSignature signature = getSignatureDirect(template); + if (signature != null) { + return signature; + } + + // no signature found, try signature of owning classifier (nested class) + // or package + Element owner = template.getOwner(); + if (owner instanceof TemplateableElement) { + // owned by a classifier, not a package + return getSignature((TemplateableElement) owner); + } else { + return null; + } + } + + public static Element getTemplateOwner(Element ne, TemplateSignature signature) { + if ((ne instanceof TemplateableElement) && getSignatureDirect((TemplateableElement) ne) == signature) { + return ne; + } + Element owner = ne.getOwner(); + if (owner != null) { + return getTemplateOwner(owner, signature); + } + return null; + } + + /** + * Get the template signature of a templateable element (typically a package). The class must + * (1) either own the signature + * (2) or merge with a package which owns the signature. + * Qompass enables the "extension" of existing packages via the package merge mechanism + * + * @param template + * The potential template + * @return the signature or null, if none can be found. + */ + + public static TemplateSignature getSignatureDirect(TemplateableElement template) { + for (Element element : template.getOwnedElements()) { + if (element instanceof TemplateSignature) { + return (TemplateSignature) element; + } + } + + // enable multiple package templates sharing the same signature. + if (template instanceof Package) { + Package pkg = (Package) template; + for (PackageMerge pkgImport : pkg.getPackageMerges()) { + Package importedPkg = pkgImport.getMergedPackage(); + return getSignature(importedPkg); + } + } + return null; + } + + /** + * Create a template binding by using a single, fixed actual (used within + * Qompass for the binding of container extensions depending on the component + * executor) + * + * @param model + * : target model in which to create the bound package + * @param template + * @param fixedActual + * @return + * @throws TransformationException + */ + public static TemplateBinding fixedBinding(Package model, TemplateableElement template, Classifier fixedActual) + throws TransformationException { + // obtain the signature of an element within a package template. + + TemplateSignature signature = getSignature(template); + if (signature == null) { + // not a template, retain original name + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( + Messages.TemplateUtils_NoTemplateSignature, (template instanceof NamedElement ? + ((NamedElement) template).getName() : "undef"))); //$NON-NLS-1$ + return null; + } + + EList actuals = new BasicEList(); + + Package pkgTemplate = (Package) signature.getOwner(); + String name = pkgTemplate.getName(); + + // loop on template parameters; + // for (TemplateParameter parameter : signature.getOwnedParameters ()) { + // ParameterableElement formal = parameter.getParameteredElement(); + + // now obtain suitable binding for this parameter - look for ports that + // are typed with the formal template parameter + + actuals.add(fixedActual); + name = name + "_" + fixedActual.getName(); //$NON-NLS-1$ + // } + + // the bound package is instantiated in the same model, in which the + // composite can be found (avoid modifying an imported model). + // todo: root model as an additional parameter? + Namespace owner = (Namespace) pkgTemplate.getOwner(); + owner = CreationUtils.getAndCreate(model, owner.allNamespaces()); + + Package boundPackage = (Package) owner.getMember(name); + if (boundPackage == null) { + // class does not exist yet, needs to be created. + boundPackage = ((Package) owner).createNestedPackage(name); + + Log.log(IStatus.INFO, Log.TEMPLATE_BINDING, String.format( + Messages.TemplateUtils_InfoCreateBoundPackage, name, owner.getName())); + } + + TemplateBinding binding = boundPackage.getTemplateBinding(signature); + if (binding == null) { + // binding is not existing yet (should normally only happen, if the class has + // just been created - but it's better to re-check, even if the bound package + // was already there) + binding = boundPackage.createTemplateBinding(signature); + + Iterator actualsIter = actuals.iterator(); + + // loop on template parameters; + for (TemplateParameter parameter : signature.getOwnedParameters()) { + + TemplateParameterSubstitution substitution = + binding.createParameterSubstitution(); + substitution.setFormal(parameter); + + // now obtain suitable binding for this parameter - look for + // ports that are typed with + // the formal template parameter + Type actual = actualsIter.next(); + substitution.setActual(actual); + } + } + return binding; + } + + /** + * create a "sub" binding in which the first parameter of type Cl is assumed + * to bind the sub-signature TODO: compared type and name of parameters in + * two signatures TODO: support more than one template parameter + * + * @param model + * @param te + * @param existingBinding + * @return + * @throws TransformationException + */ + public static TemplateBinding getSubBinding(Package model, + TemplateableElement te, TemplateBinding existingBinding) + throws TransformationException { + + for (TemplateParameterSubstitution tps : existingBinding.getParameterSubstitutions()) { + ParameterableElement pe = tps.getActual(); + if (pe instanceof Classifier) { + return fixedBinding(model, te, (Classifier) pe); + } + } + return null; + } + + /** + * Adapt the actuals within the binding (which correspond either to an + * element of the source model or an imported element) to the target model. + * + * @param sat + * @param binding + */ + public static void adaptActualsToTargetModel(LazyCopier copy, TemplateBinding binding) { + for (TemplateParameterSubstitution substitution : binding.getParameterSubstitutions()) { + substitution.setActual(copy.getCopy(substitution.getActual())); + } + } + + /** + * Return the actual for a potential formal parameter within a + * templateBinding (move to TemplateUtils?) + * + * @param binding + * a template binding + * @param formal + * a potential formal parameter, i.e. a parameter for which we + * check, if it really corresponds to a formal parameter within + * the template binding. + * @return the actual parameter that is associated with the potential formal + * parameter, or null if the 2nd parameter does not correspond to a + * formal parameter of the binding. + */ + public static Classifier getActualFromBinding(TemplateBinding binding, Type formal) { + for (TemplateParameterSubstitution substitution : binding.getParameterSubstitutions()) { + ParameterableElement pe = substitution.getFormal().getParameteredElement(); + if (pe == formal) { + Log.log(IStatus.INFO, Log.TEMPLATE_INSTANTIATION, String.format( + Messages.TemplateUtils_InfoGetActualFrom, pe)); + return (Classifier) substitution.getActual(); + } + } + return null; + } + + public static Classifier getActualFromBinding(TemplateBinding binding, String formalName) { + for (TemplateParameterSubstitution substitution : binding.getParameterSubstitutions()) { + ParameterableElement pe = substitution.getFormal().getParameteredElement(); + Log.log(IStatus.INFO, Log.TEMPLATE_INSTANTIATION, String.format( + Messages.TemplateUtils_InfoGetActualFrom, pe)); + if ((pe instanceof NamedElement) + && ((NamedElement) pe).getName().equals(formalName)) { + return (Classifier) substitution.getActual(); + } + } + return null; + } + + /** + * Get the first actual from the binding. + * + * @param binding + * the template binding + * @return the first actual. + */ + public static Classifier getFirstActualFromBinding(TemplateBinding binding) { + for (TemplateParameterSubstitution substitution : binding.getParameterSubstitutions()) { + ParameterableElement pe = substitution.getFormal().getParameteredElement(); + Log.log(IStatus.INFO, Log.TEMPLATE_INSTANTIATION, String.format( + Messages.TemplateUtils_InfoGetActualFrom, pe)); + return (Classifier) substitution.getActual(); + } + return null; + } + + /** + * Return a sequence of namespaces for a given element, starting from the "bottom" + * one, i.e. the one in which the element is contained. It will end before the + * searchNS namespace is reached. Returns null, if the element is not contained + * within the search namespace. + * This function will put a merged package into the path (instead of the owner), enabling + * the extension of existing packages. + * + * @param element + * @param searchNS + * @return + */ + public static EList relativePathWithMerge(Element element, Namespace searchNS) { + EList pathList = new BasicEList(); + Element owner = element.getOwner(); + if (!(owner instanceof Namespace)) { + // happens, if element is contained in a template signature + return null; + } + Namespace ns = (Namespace) owner; + while (ns != null) { + if (ns == searchNS) { + return pathList; + } + pathList.add(ns); + + if (ns instanceof Package) { + Package pkg = (Package) ns; + Iterator pkgMerges = pkg.getPackageMerges().iterator(); + // if package merge exists, get first merged package and add it to path + if (pkgMerges.hasNext()) { + PackageMerge pkgImport = pkgMerges.next(); + ns = pkgImport.getMergedPackage(); + continue; + } + } + + ns = (Namespace) ns.getOwner(); + } + return null; + } + + /** + * Re-target connectors after a part has changed its type from template to an instantiation + * of this template. In this case, the roles of the connector ends still reference the port + * of the template instead of the bound template binding. + * The new roles are assigned based on an equal name, assuming that template instantiation + * does not change the name of the ports. + * + * @param composite + * a composite containing connectors + * @param part + * a part within the composite whose type has changed. + */ + public static void retargetConnectors(StructuredClassifier composite, Property part) { + Type partType = part.getType(); + if (partType instanceof EncapsulatedClassifier) { + EncapsulatedClassifier partTypeEC = (EncapsulatedClassifier) partType; + for (Connector connector : composite.getOwnedConnectors()) { + if (ConnectorUtil.connectsPart(connector, part)) { + // the connector end targets a port of a part or the composite (in case of delegation) + ConnectorEnd connEnd = ConnectorUtil.connEndForPart(connector, part); + // redirect role, if pointing to port + if (connEnd.getRole() instanceof Port) { + Port connectedTemplatePort = (Port) connEnd.getRole(); + Port connectedBoundPort = (Port) Utils.getNamedElementFromList( + PortUtils.getAllPorts(partTypeEC), connectedTemplatePort.getName()); + connEnd.setRole(connectedBoundPort); + } + } + } + } + } + + /** + * Re-target connectors after an unknown number of parts have changed their type from template + * to an instantiation of this template. In this case, the roles of the connector ends still + * reference the port of the template instead of the bound template binding. + * The new roles are assigned based on an equal name, assuming that template instantiation + * does not change the name of the ports. + * + * @param composite + * a composite containing connectors + */ + public static void retargetConnectors(StructuredClassifier composite) { + for (Connector connector : composite.getOwnedConnectors()) { + // the connector end targets a port of a part or the composite (in case of delegation) + for (ConnectorEnd connEnd : connector.getEnds()) { + Property part = connEnd.getPartWithPort(); + if ((part != null) && (part.getType() instanceof EncapsulatedClassifier)) { + EncapsulatedClassifier partTypeEC = (EncapsulatedClassifier) part.getType(); + ConnectableElement role = connEnd.getRole(); + EList ports = PortUtils.getAllPorts(partTypeEC); + if ((role instanceof Port) && !ports.contains(role)) { + // role is not in list of ports + Port connectedBoundPort = (Port) Utils.getNamedElementFromList(ports, role.getName()); + connEnd.setRole(connectedBoundPort); + } + } + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TextTemplateBinding.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TextTemplateBinding.java new file mode 100644 index 00000000000..aa89bc58c8e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/TextTemplateBinding.java @@ -0,0 +1,80 @@ +/** + * Copyright CEA-LIST 2009 + * available under EPL 1.0 licence + * + * This file is part of the Qompass tool chain (www.ec3m.net) + * + * http://www.eclipse.org/legal/epl-v10.html + * + * $Id$ + */ + +package org.eclipse.papyrus.qompass.designer.core.templates; + +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; + +/** + * Wrap different ways to bind a template. This may be either a reference to an + * Xtend template or a specific name template. + */ +public class TextTemplateBinding { + + /** + * Simple template expression that is replaced with the name of a named + * element. Uses an Acceleo syntax + * The objective is that the access to an element name is very common and does + * not need an xtend script behind. + */ + private static final String NAME_IN_BRACKETS = "[name/]"; //$NON-NLS-1$ + + /** + * Simple template expression that is replaced with the name of a named + * element. Slight variation of the Acceleo syntax + */ + private static final String NAME_IN_BRACKETS_SIMPLE = "[name]"; //$NON-NLS-1$ + + /** + * Execute a script passed as parameter. It will be executed in the context + * of a base script that declares the meta-model (UML2) and has additional + * imports (currently none). + * + * @param template + * The template in string form + * @param element + * The UML element to which the template is applied + * @return the evaluated template + */ + public static String bind(String templateStr, Element element) throws TransformationException { + return bind(templateStr, element, null); + } + + /** + * Execute a script passed as parameter. It will be executed in the context + * of a base script that declares the meta-model (UML2). It allows for + * additional arguments + * + * @param template + * The template in string form + * @param element + * The UML element to which the template is applied + * @return the evaluated template + */ + public static String bind(String templateStr, Element element, Object args[]) throws TransformationException { + if (templateStr.startsWith(XtendTemplateBinding.XTEND_MAGIC)) { + return XtendTemplateBinding.bind(templateStr, element, args); + } + else if (element instanceof NamedElement) { + String name = ((NamedElement) element).getName(); + if (templateStr.contains(NAME_IN_BRACKETS)) { + return templateStr.replace(NAME_IN_BRACKETS, name); + } + else if (templateStr.contains(NAME_IN_BRACKETS_SIMPLE)) { + return templateStr.replace(NAME_IN_BRACKETS_SIMPLE, name); + } + } + return templateStr; + // throw new TransformationException("Template is not supported"); //$NON-NLS-1$ + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/XtendTemplateBinding.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/XtendTemplateBinding.java new file mode 100644 index 00000000000..14527c6aa23 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/templates/XtendTemplateBinding.java @@ -0,0 +1,84 @@ +package org.eclipse.papyrus.qompass.designer.core.templates; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.extensions.IXtend; +import org.eclipse.papyrus.qompass.designer.core.extensions.XtendGenerator; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.uml2.uml.Element; + +public class XtendTemplateBinding { + + public static final String XTEND_MAGIC = "!xtend"; //$NON-NLS-1$ + + /** + * Execute a script passed as parameter. It will be executed in the context + * of a base script that declares the meta-model (UML2) and has additional + * imports (currently none). + * + * @param template + * The template in string form + * @param element + * The UML element to which the template is applied + * @return the evaluated template + */ + public static String bind(String templateStr, Element element) throws TransformationException { + return bind(templateStr, element, null); + } + + /** + * Execute a script passed as parameter. It will be executed in the context + * of a base script that declares the meta-model (UML2) and has additional + * imports (currently none). + * + * @param template + * The template in string form + * @param element + * The UML element to which the template is applied + * @return the evaluated template + */ + public static String bind(String templateStr, Element element, Object args[]) throws TransformationException { + String[] templateRef = templateStr.substring(XTEND_MAGIC.length() + 1).split("\\."); //$NON-NLS-1$ + String templateId = templateRef[0].trim(); + String methodName = templateRef[1].trim(); + IXtend generator = XtendGenerator.getXtendGenerator(templateId); + if (generator == null) { + throw new TransformationException(String.format(Messages.XtendTemplateBinding_TemplateNotFound, templateId, methodName)); + } + + try { + Object result; + if (args != null) { + Method method = getMethod(generator, methodName, 1+args.length); + result = method.invoke(generator, element, args); + } + else { + Method method = getMethod(generator, methodName, 1); + result = method.invoke(generator, element); + } + if (result instanceof String) { + return (String) result; + } + else if (result instanceof CharSequence) { + return result.toString(); + } + else { + throw new TransformationException(Messages.XtendTemplateBinding_TemplateResultIsNotAString); + } + } catch (SecurityException | IllegalAccessException + | IllegalArgumentException | InvocationTargetException | NullPointerException e) { + throw new TransformationException(e.getMessage()); + } + } + + public static Method getMethod(IXtend generator, String methodName, int numberOfArguments) { + for (Method method : generator.getClass().getMethods()) { + if (method.getName().equals(methodName) && method.getParameterTypes().length == numberOfArguments) { + return method; + } + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AbstractContainerTrafo.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AbstractContainerTrafo.java new file mode 100644 index 00000000000..75dd752b1df --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AbstractContainerTrafo.java @@ -0,0 +1,114 @@ +/*******************************************************************import java.util.HashMap; +import java.util.Map; + +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Package; +s distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Package; + + +public abstract class AbstractContainerTrafo { + + public static void init() { + containers = new HashMap(); + } + + /** + * return the container trafo associated with the tmComponent + * + * @param tmComponent + * @return Container-trafo instance of null + */ + public static AbstractContainerTrafo get(Class tmComponent) { + return containers.get(tmComponent); + } + + /** + * Hash map used to identify for which components we already created a container. + * Indexed with components in target model (but before container expansion) + */ + protected static Map containers; + + public abstract void createContainer(Class smComponent, Class tmComponent) throws TransformationException; + + /** + * Create an instance of the container (UML instance specification) + * + * @param tmComponent + * the component within the target model for which we want to create an instance + * + * @param tmIS + * the existing instance specification for the component before container expansion. + * @param context + * Additional information about the container that is used by instance configurators + */ + public abstract InstanceSpecification createContainerInstance(Class tmComponent, InstanceSpecification tmIS) + throws TransformationException; + + /** + * apply a container rule, i.e. add either a container extension or an + * interceptor to the container + * + * @param smContainerRule + * An container rule + * @param smComponent + * the application component in the source model + * @param tmComponent + * the application component in the target model + * @throws TransformationException + */ + public abstract void applyRule(ContainerRule smContainerRule, Class smComponent, Class tmComponent) + throws TransformationException; + + /** + * The instance specification of the created container + */ + // protected InstanceSpecification containerIS; + + /** + * Copy class from source to target model + */ + protected LazyCopier copier; + + + /** + * Is called after a set of rule applications. + * Does nothing by default + */ + @Override + public void finalize() { + } + + /** + * The created container implementation (prefixed with tm, since part of + * target model) + */ + protected Class tmClass; + + /** + * deployment plan within source model + */ + protected Package smCDP; + + /** + * deployment plan within target model + */ + protected Package tmCDP; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AllocTransfo.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AllocTransfo.java new file mode 100644 index 00000000000..60f563cdb58 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/AllocTransfo.java @@ -0,0 +1,93 @@ +package org.eclipse.papyrus.qompass.designer.core.transformations; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EStructuralFeature.Setting; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; +import org.eclipse.uml2.common.util.UML2Util; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.ConnectorEnd; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.Type; + +/** + * Transform the allocations towards an execution resource (thread) into a suitable connection + * Current restriction: a thread needs to be defined the same composite as the component which + * is allocated to this thread. + */ +public class AllocTransfo { + public static final String MAIN = "main"; //$NON-NLS-1$ + + /** + * + * @param copy + * The copy class. Currently unused + * @param composite + * A composite. We analyze the allocations of the properties within this + * Composite. The composite must be an element of the target model that can be modified. + */ + public void transformAllocs(LazyCopier copy, Class composite) { + EList attributeList = new BasicEList(); + attributeList.addAll(composite.getOwnedAttributes()); // use a copy, since the loop eventually destroys an element of the list. + for (Property attribute : attributeList) { + Type type = attribute.getType(); + if (!(type instanceof Class)) { + continue; + } + Property thread = AllocUtils.getThreadAlloc(attribute); + if (thread != null) { + // this attribute represents a thread. + if (thread.getName().equals(MAIN)) { + // TODO: currently, no support for setting up the priority of the main thread. + // we need to get a cleaner solution for the main thread. + // destroy eventual connector and associated thread => thread as component with unconnected start thread + Connector conn = ConnectorUtil.getConnector(composite, attribute, thread); + // Connector targetConn = copy.getCopy(conn); + // Property targetThread = copy.getCopy(thread); + if (conn != null) { + conn.destroy(); + } + // destroy not only the thread, but also the slot within the composites instance specification + // (that references the thread via its defining feature). + for (Setting setting : UML2Util.getInverseReferences(thread)) { + if (setting.getEObject() instanceof Slot) { + ((Element) setting.getEObject()).destroy(); + } + } + thread.destroy(); + } + // check, if there is already a connector between the attribute and the thread + else if (!ConnectorUtil.existsConnector(composite, attribute, thread)) { + // no connector => create; + Class component = (Class) type; + Connector c = composite.createOwnedConnector("alloc to " + thread.getName()); //$NON-NLS-1$ + ConnectorEnd ce1 = c.createEnd(); + ce1.setPartWithPort(attribute); + // TODO: should really use start port instead... + // ce1.setRole(AllocUtils.getStartPort(component)); + NamedElement ne = Utils.getNamedElementFromList(component.getAllAttributes(), "lc"); //$NON-NLS-1$ + if (ne instanceof Property) { + ce1.setRole((Property) ne); + } + ConnectorEnd ce2 = c.createEnd(); + ce2.setPartWithPort(thread); + Type threadT = thread.getType(); + if (threadT instanceof Class) { + // TODO: nicer way to obtain port ... + Property rLC = ((Class) threadT).getAttribute("rLC", null); //$NON-NLS-1$ + if (rLC instanceof Port) { + ce2.setRole(rLC); + } + } + } + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CompTypeTrafos.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CompTypeTrafos.java new file mode 100644 index 00000000000..4fa6256b36a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CompTypeTrafos.java @@ -0,0 +1,127 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.papyrus.C_Cpp.Ptr; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.PortUtils; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.ParameterDirectionKind; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Type; + +/** + * A collection of transformations related to component-types (or abstract implementations) + * + * 1. Add access operations for ports, i.e. operations that return a reference of a port + * (if port provides interface) and/or allow to connect a port with a given reference + * (if port requires an interface) + * 2. Remove ports (after ports have been replaced with standard properties) + * + * TODO: transformation is specific to C++ + * TODO: currently unused + * + * @author ansgar + * + */ +@Deprecated +public class CompTypeTrafos { + + public static final String INDEX_TYPE_FOR_MULTI_RECEPTACLE = "corba::Long"; //$NON-NLS-1$ + + /** + * Complete access operations recursively, i.e. traverse all packageable + * elements and apply the completeAccessOps operation on classes + * + * @param pkg + * the package for which the completion should start + * @see completeAccessOps(Class) + */ + public static void completeAccessOps(Package pkg) { + for (PackageableElement element : new BasicEList(pkg.getPackagedElements())) { + if (element instanceof Package) { + completeAccessOps((Package) element); + } else if (element instanceof Class) { + completeAccessOps((Class) element); + } + } + } + + /** + * Complete access operations that return the reference. This function is a completion, + * since the access operations have already been added for component implementations + * (partly, if implementation was abstract). + * + * @param component + * the component for which access operation should be completed. + * @return + */ + private static void completeAccessOps(Class component) { + // only owned ports => since the operation is also applied on inherited types. + for (Port port : component.getOwnedPorts()) { + Interface providedIntf = PortUtils.getProvided(port); + if (providedIntf != null) { + // add operation CCM_<%type%> get_ + String getName = PrefixConstants.getP_Prefix + port.getName(); + + // create unless already existing + if (component.getOwnedOperation(getName, null, null) == null) { + Operation op = component.createOwnedOperation(getName, null, null); + op.setIsAbstract(true); + Parameter retParam = op.createOwnedParameter("ret", providedIntf); //$NON-NLS-1$ + retParam.setDirection(ParameterDirectionKind.RETURN_LITERAL); + StereotypeUtil.apply(retParam, Ptr.class); + // StereotypeUtil.apply(op, CppVirtual.class); + } + } + Interface requiredIntf = PortUtils.getRequired(port); + if (requiredIntf != null) { + // add operation CCM_<%type%> connect_q + String connName = PrefixConstants.connectQ_Prefix + port.getName(); + + // create unless already existing + if (component.getOwnedOperation(connName, null, null) == null) { + Operation op = component.createOwnedOperation(connName, null, null); + op.setIsAbstract(true); + boolean multiPort = (port.getUpper() > 1) || (port.getUpper() == -1); // -1 indicates "*" + if (multiPort) { + // add index parameter + Element eLong = Utils.getQualifiedElement(PackageUtil.getRootPackage(component), INDEX_TYPE_FOR_MULTI_RECEPTACLE); + if (eLong instanceof Type) { + op.createOwnedParameter("index", (Type) eLong); //$NON-NLS-1$ + } + else { + throw new RuntimeException(String.format(Messages.CompTypeTrafos_CannotFindType, INDEX_TYPE_FOR_MULTI_RECEPTACLE)); + } + } + Parameter refParam = op.createOwnedParameter("ref", requiredIntf); //$NON-NLS-1$ + refParam.setDirection(ParameterDirectionKind.IN_LITERAL); + StereotypeUtil.apply(refParam, Ptr.class); + // StereotypeUtil.apply(op, CppVirtual.class); + } + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CopyTo.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CopyTo.java new file mode 100644 index 00000000000..7aa54599ebd --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/CopyTo.java @@ -0,0 +1,35 @@ +package org.eclipse.papyrus.qompass.designer.core.transformations; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.util.EcoreUtil.Copier; +import org.eclipse.uml2.uml.Element; + +/** + * This class enables the copy from a source to a given target element. + * It assumes that a copy has already been created, but will just not copy it... + * Unlike the @see Copy class, the element might be copied to a different place + */ +public class CopyTo { + /** + * Copy an element from the source to a target + * + * @param source + * The element that should be copied + * @param targetContainer + * The container into which it the source should be copied + * @return the copied object + */ + @SuppressWarnings("unchecked") + public static T copyTo(T source, Element targetContainer) { + Copier copier = new Copier(); + EObject sourceContainer = source.eContainer(); + if (sourceContainer != null) { + copier.put(sourceContainer, targetContainer); + } + + EObject copy = copier.copy(source); + copier.copyAll(source.getStereotypeApplications()); + copier.copyReferences(); + return (T) copy; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/ExecuteOOTrafo.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/ExecuteOOTrafo.java new file mode 100644 index 00000000000..17ae079d584 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/ExecuteOOTrafo.java @@ -0,0 +1,175 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.PortKind; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.papyrus.qompass.designer.core.extensions.IOOTrafo; +import org.eclipse.papyrus.qompass.designer.core.extensions.OOTrafo; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.EncapsulatedClassifier; +import org.eclipse.uml2.uml.Model; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.StructuralFeature; +import org.eclipse.uml2.uml.StructuredClassifier; + +public class ExecuteOOTrafo { + + IOOTrafo ooTrafo; + + ExecuteOOTrafo(IOOTrafo ooTrafo) { + this.ooTrafo = ooTrafo; + } + + /** + * Execute the OO transformation for a package, include removal of connectors + * + * @param pkg + * @throws TransformationException + */ + public void transformPackage(Package pkg) throws TransformationException { + recursiveOOTransformation(pkg); + // transformation and removal is not done in same loop. Otherwise it would be possible + // that inherited ports have already been removed. + recursiveRemoval(pkg); + } + + /** + * Execute the OO transformation for a package + * + * @param pkg + * @throws TransformationException + */ + public void recursiveOOTransformation(Package pkg) throws TransformationException { + EList peList = new BasicEList(); + peList.addAll(pkg.getPackagedElements()); + for (PackageableElement element : peList) { + if (element instanceof Package) { + recursiveOOTransformation((Package) element); + } else if (element instanceof Class) { + Class implementation = (Class) element; + // do not apply transformation to port-kinds + if (!StereotypeUtil.isApplied(implementation, PortKind.class)) { + ooTrafo.addPortOperations(implementation); + ooTrafo.addConnectionOperation(implementation); + ooTrafo.transformParts(implementation); + } + } + } + } + + /** + * Remove connectors and ports from elements within a package + * + * @param pkg + * @throws TransformationException + */ + public void recursiveRemoval(Package pkg) throws TransformationException { + EList peList = new BasicEList(); + peList.addAll(pkg.getPackagedElements()); + for (PackageableElement element : peList) { + if (element instanceof Package) { + recursiveRemoval((Package) element); + } + else { + // delete connectors and ports + if (element instanceof StructuredClassifier) { + removeConnectors((StructuredClassifier) element); + } + if (element instanceof EncapsulatedClassifier) { + removePorts((EncapsulatedClassifier) element); + } + } + } + } + + /** + * Helper: remove connectors from a structured classifier (in most cases a + * class) + * + * @param implementation + * A component + */ + public void removeConnectors(StructuredClassifier implementation) { + EList connectors = new BasicEList(); + connectors.addAll(implementation.getOwnedConnectors()); + for (Connector connector : connectors) { + connector.destroy(); + } + } + + /** + * Helper: remove ports from a from an encapsulated classifier (in most + * cases a class) + * + * @param implementation + * A component + */ + public void removePorts(EncapsulatedClassifier implementation) { + EList portListCopy = new BasicEList(); + portListCopy.addAll(implementation.getOwnedPorts()); + // avoid dangling references by calling destroy on the port list + for (Port port : portListCopy) { + port.destroy(); + } + } + + /** + * Transform a component model into an object oriented model. + * + * @param copier a copier + * @param bootloader the generated bootloader + * @param genModel the model to generate into + * @param OOmodel ignored. + * @throws TransformationException + * @deprecated use variant with ignored parameter + */ + @Deprecated + public static void transform(LazyCopier copier, Class bootloader, Model genModel, boolean OOmodel) + throws TransformationException { + transform(copier, bootloader, genModel); + } + + public static void transform(LazyCopier copier, Class bootloader, Model genModel) + throws TransformationException { + String ooTransformation = DepUtils.getOOTransformationFromPackage(genModel); + if (ooTransformation == null) { + // default OO transformation + ooTransformation = "StaticCpp"; //$NON-NLS-1$ + } + IOOTrafo ooTrafo = OOTrafo.getOOTrafo(ooTransformation); + ooTrafo.init(copier, bootloader); + ExecuteOOTrafo executeOOTrafo = new ExecuteOOTrafo(ooTrafo); + executeOOTrafo.transformPackage(genModel); + + // complete access operations? + } + + // TODO: always false. Is it really task of OO trafo to decide whether + // something is + // instantiated by bootloader or not? + public static boolean instantiateViaBootloader(StructuralFeature slot) { + return false; + } + + // TODO: currently used by BOOTLOADER generator. Why needed? + public static final String CREATE_CONNECTIONS = "createConnections"; //$NON-NLS-1$ +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/FlattenInteractionComponents.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/FlattenInteractionComponents.java new file mode 100644 index 00000000000..1d9cabc87c0 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/FlattenInteractionComponents.java @@ -0,0 +1,224 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.ConnectorEnd; +import org.eclipse.uml2.uml.DirectedRelationship; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.StructuralFeature; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Deploy instances in a flat way, i.e. only deploy leaves. "Normal" composites + * still need to be deployed (since they might have a behavior of their own). + * However, composites tagged as assemblies (FCM stereotype attribute) may be + * not be deployed, instead their contents is deployed. + * + * A composite that is not deployed implies that + * - assembly connections within this composite need to move up one or more levels + * in the composite hierarchy + * - re-targeting connections from/to a composite to the inner part (along delegation connections inside + * the composite) + * [Need to stop at a composite] + * + * Problems: need to do that on instance level. It could be that the same composite is instantiated + * at different places in the tree with a different implementation choices => would require different + * variants of the sub-type. + * Solution: a. completely flatten except system of which we know that a single + * instance exists) + * b. forbid that different implementation variants are used by different instances of same composant + * + * CAVEAT: function not yet properly working, + * function currently not used + * + * @author ansgar + * + * + */ +public class FlattenInteractionComponents { + + private static final String FLATTEN_SEP = "_"; //$NON-NLS-1$ + + public static FlattenInteractionComponents getInstance() { + return instance; + } + + private static FlattenInteractionComponents instance = new FlattenInteractionComponents(); + + /** + * flatten an assembly, i.e. remove the passed containedPart (which must be a part within the passed containing + * composite) + * + * @param containingComposite + * @param containedPart + * a part within the passed containing composite + * @param containedComposite + * the type (implementation) of the passed part + */ + public void flattenAssembly(InstanceSpecification instance, Slot slot) + { + Classifier cl = DepUtils.getClassifier(instance); + if ((cl instanceof Class) && (slot != null)) { + InteractionComponent ic = UMLUtil.getStereotypeApplication(cl, InteractionComponent.class); + if ((ic != null) && ic.isForDistribution()) { + Slot containingSlot = DepUtils.getParentSlot(instance); + InstanceSpecification containingInstance = containingSlot.getOwningInstance(); + flattenAssembly((Class) cl, instance, containingInstance, containingSlot); + } + } + // loop over sub-instances and apply flatten recursively. + // create a copy of the slots, since the recursive flatten call might modify + // the number of slots + EList slots = new BasicEList(instance.getSlots()); + for (Slot subISslot : slots) { + InstanceSpecification subIS = DepUtils.getInstance(subISslot); + if (subIS != null) { + flattenAssembly(subIS, subISslot); + } + } + } + + /** + * + * Flatten a composite interaction component, i.e. replace it by the containing fragments. This includes the following actions + * 1. Parts typed with the interaction component must be replaced with a set of parts typed with the fragment. + * 2. Connectors must be redirected. + * + * Please note that we do not delete the original interaction component, but it will not appear in a model generated for a specific node. + * TODO: We need to re-target connectors in all containing composites, but the same containingComposite might have several instances within an application. In this case, + * we only need to move slots. + * + * Well, there are different classes: first: the flattened interaction component and other components that reference the flattened interaction component. + * + * @param composite + * a composite class + * @param instance + * the instance associated with the composite class (1st parameter) + * @param containingInstance + * an instance of the containing composite + * @param containingSlot + * the slot associated with the instance (2nd parameter) + */ + public void flattenAssembly(Class composite, InstanceSpecification instance, InstanceSpecification containingInstance, Slot containingSlot) + { + Classifier containingCompositeCl = DepUtils.getClassifier(containingInstance); + StructuralFeature sfForIA = containingSlot.getDefiningFeature(); + Map replaceParts = new HashMap(); + if ((containingCompositeCl instanceof Class) && (sfForIA instanceof Property)) { + Class containingComposite = (Class) containingCompositeCl; + Property partForIA = (Property) sfForIA; + + for (Property fragmentPart : composite.getAllAttributes()) { + if (fragmentPart instanceof Port) { + continue; + } + String partName = partForIA.getName() + FLATTEN_SEP + fragmentPart.getName(); + // create a new part in the containing composite + Property newPartForFragment = containingComposite.createOwnedAttribute(partName, fragmentPart.getType()); + replaceParts.put(fragmentPart, newPartForFragment); + + boolean foundConnector = false; + // now redirect connectors: find whether a port delegates to the fragment + for (Connector connector : composite.getOwnedConnectors()) { + if (ConnectorUtil.connectsPart(connector, fragmentPart)) { + foundConnector = true; + // internal connector for the part, check whether delegation + ConnectorEnd ce = ConnectorUtil.connEndNotPart(connector, fragmentPart); + if ((ce != null) && (ce.getPartWithPort() == null)) { + // delegation connector, need to re-targed connections to external port + Port port = (Port) ce.getRole(); + // now look for connections to this port in the containingComposite and shortcut these ... + retargetConnections(containingComposite, port, partForIA, newPartForFragment); + } else { + // assembly: assembly connection between fragments are not authorized + } + } + } + if (!foundConnector) { + throw new RuntimeException("the part <" + fragmentPart.getName() + "> within composite <" + composite.getName() + "> is not connected with any of its ports"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } + } + // on instance level: move slots from instance to containingInstance + EList slots = instance.getSlots(); + containingInstance.getSlots().addAll(slots); + // replace defining feature + for (Slot slot : containingInstance.getSlots()) { + StructuralFeature sf = slot.getDefiningFeature(); + if (replaceParts.containsKey(sf)) { + slot.setDefiningFeature(replaceParts.get(sf)); + // assure naming convention for instances: here, we update the name of the instance + // and its sub-instances with the name of the containingInstance + InstanceSpecification subInstance = DepUtils.getInstance(slot); + if ((subInstance != null) && !DepUtils.isShared(slot)) { + DepPlanUtils.updateInstanceNames(subInstance, instance.getName() + FLATTEN_SEP + sf.getName()); + } + } + } + + containingSlot.destroy(); + // destroy relationships of flattened instance, in particular allocation + for (DirectedRelationship dr : instance.getSourceDirectedRelationships()) { + dr.destroy(); + } + instance.destroy(); + partForIA.destroy(); + + // move is + /* + * InstanceSpecification partIS; + * DepUtils.createSlot (cdp, newIS, partIS, newPart); + */ + } + } + + /** + * Find a connection within a connecting + * + * @param containingComposite + * @param port + * A port which delegates to a fragment + * @param part + * the part within the containing composite (1st parameter) point to the interactionComponent + * @param subPart + * a newly created part corresponding to the fragment + */ + public void retargetConnections(Class containingComposite, Port port, Property part, Property subPart) { + for (Connector connector : containingComposite.getOwnedConnectors()) { + if (ConnectorUtil.connectsPart(connector, part) && ConnectorUtil.connectsPort(connector, port)) { + ConnectorEnd ce = ConnectorUtil.connEndForPart(connector, part); + if (ce != null) { + // TODO: only with with connections targeting a port of a part, not with + // those targeting directly a part + ce.setPartWithPort(subPart); + } + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/InstantiateDepPlan.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/InstantiateDepPlan.java new file mode 100644 index 00000000000..f0a2d6c3a7d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/InstantiateDepPlan.java @@ -0,0 +1,619 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.common.util.WrappedException; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.papyrus.FCM.Configuration; +import org.eclipse.papyrus.FCM.OperatingSystem; +import org.eclipse.papyrus.FCM.Target; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.papyrus.codegen.extensionpoints.AbstractSettings; +import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; +import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; +import org.eclipse.papyrus.codegen.extensionpoints.LanguageCodegen; +import org.eclipse.papyrus.codegen.extensionpoints.LanguageProjectSupport; +import org.eclipse.papyrus.qompass.designer.core.EnumService; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.ModelManagement; +import org.eclipse.papyrus.qompass.designer.core.ProjectManagement; +import org.eclipse.papyrus.qompass.designer.core.StUtils; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.Deploy; +import org.eclipse.papyrus.qompass.designer.core.deployment.DeployConstants; +import org.eclipse.papyrus.qompass.designer.core.deployment.GatherConfigData; +import org.eclipse.papyrus.qompass.designer.core.extensions.InstanceConfigurator; +import org.eclipse.papyrus.qompass.designer.core.generate.GenerateCode; +import org.eclipse.papyrus.qompass.designer.core.generate.GenerationOptions; +import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FilterRuleApplication; +import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FilterStateMachines; +import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FilterTemplate; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Model; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.Profile; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * This class executes all transformations during the instantiation of a + * deployment plan, i.e. 1. The reification of connectors (including template + * instantiation). This transformation targets a new model 2. Adding + * get_p/connect_q operations to a class (transformation within same model) 3. + * Remove all component types 4. distribute to nodes + * + * @author ansgar + * + */ +public class InstantiateDepPlan { + + /** + * The location of the temporary model (relative to current project). TODO: + * make configurable? + */ + public static final String TEMP_MODEL_FOLDER = "tmpModel"; //$NON-NLS-1$ + + /** + * Postfix of the temporary model (prefix = name of top-level package). + * TODO: make configurable? + */ + public static final String TEMP_MODEL_POSTFIX = "Tmp.uml"; //$NON-NLS-1$ + + /** + * Progress monitor of Eclipse. + */ + protected IProgressMonitor monitor = null; + + protected int generationOptions; + + protected boolean generateCode; + + protected boolean generateCACOnly; + + protected Package srcModelComponentDeploymentPlan = null; + + protected Configuration configuration = null; + + protected IProject project; + + protected IProject genProject; + + public void instantiate(Configuration configuration, + IProgressMonitor monitor, IProject project, int genOptions) { + this.configuration = configuration; + srcModelComponentDeploymentPlan = configuration + .getDeploymentPlan().getBase_Package(); + // + if (srcModelComponentDeploymentPlan == null) { + String message = String + .format(Messages.InstantiateDepPlan_DepPlanStereotypeNotInitialized, + configuration.getBase_Class().getName()); + displayError(Messages.InstantiateDepPlan_TransformationException, + message); + } + + this.project = project; + if (project == null) { + String projectName = configuration.getBase_Class().eResource() + .getURI().toString(); + this.project = ResourcesPlugin.getWorkspace().getRoot() + .getProject(projectName); + } + // + instantiate(monitor, genOptions); + } + + public void instantiate(Package pkg, IProgressMonitor monitor, + IProject project, int genOptions) { + configuration = null; + srcModelComponentDeploymentPlan = pkg; + // + this.project = project; + if (project == null) { + String projectName = pkg.eResource().getURI().toString(); + this.project = ResourcesPlugin.getWorkspace().getRoot() + .getProject(projectName); + } + + // + instantiate(monitor, genOptions); + } + + /** + * Instantiate a deployment plan, i.e. generate an intermediate model via a + * sequence of transformations + * + * @param umlElement + * a deployment plan (UML package) or a configuration (UML class) + * @param monitor + * a progress monitor. + * + * @param project + * the current project. This information is used to store the + * intermediate model in a subfolder (tmpModel) of the current + * project + * @param genOptions + * select whether to produce an intermediate model only, also + * code, ... @see GenerationOptions + */ + private void instantiate(IProgressMonitor monitor, int genOptions) { + try { + initialize(monitor, genOptions); + executeTransformation(); + } catch (final TransformationException e) { + printAndDisplayErrorMessage(e, + Messages.InstantiateDepPlan_TransformationException, false); + } catch (final Exception e) { + printAndDisplayErrorMessage(e, + Messages.InstantiateDepPlan_ErrorsDuringTransformation, + true); + } + } + + private void initialize(IProgressMonitor monitor, int genOptions) + throws TransformationException { + this.monitor = monitor; + this.generationOptions = genOptions; + this.generateCode = (genOptions & GenerationOptions.MODEL_ONLY) == 0; + this.generateCACOnly = (genOptions & GenerationOptions.CAC_ONLY) != 0; + + RuleManagement.setConfiguration(configuration); + } + + protected void executeTransformation() throws Exception { + ModelManagement intermediateModelManagement = null; + + // 1a: create a new model (and applies same profiles / imports) + Model existingModel = srcModelComponentDeploymentPlan.getModel(); + TransformationContext.sourceRoot = existingModel; + + intermediateModelManagement = createTargetModel(existingModel, + existingModel.getName(), true); + + // get the temporary model + Model intermediateModel = intermediateModelManagement.getModel(); + + // create a package for global enumerations that are used by Acceleo code + EnumService.createEnumPackage(intermediateModel); + + // create a lazy copier towards the intermediate model + LazyCopier intermediateModelCopier = new LazyCopier(existingModel, intermediateModel, false, true); + // add pre-copy and post-copy listeners to the copier + intermediateModelCopier.preCopyListeners.add(FilterTemplate.getInstance()); + + // 1b: reify the connectors "into" the new model + monitor.subTask(Messages.InstantiateDepPlan_InfoExpandingConnectors); + + // obtain the component deployment plan in target model + Package intermediateModelComponentDeploymentPlan = (Package) intermediateModelCopier + .shallowCopy(srcModelComponentDeploymentPlan); + intermediateModelCopier.createShallowContainer(srcModelComponentDeploymentPlan); + + AbstractContainerTrafo.init(); + InstanceConfigurator.onNodeModel = false; + MainModelTrafo mainModelTrafo = new MainModelTrafo(intermediateModelCopier, + intermediateModelComponentDeploymentPlan); + + Map instanceMap = + new HashMap(); + for (PackageableElement pe : srcModelComponentDeploymentPlan.getPackagedElements()) { + if (pe instanceof InstanceSpecification) { + InstanceSpecification instance = (InstanceSpecification) pe; + // check whether a top level instance and not an instance specification of a connector. The latter + // is added, since interaction components might have configuration parameters that appear in the + // deployment plan. Since the container transformation is not executed at this moment, the interaction is + // not represented by a part yet. + if (DepUtils.isTopLevelInstance(instance) && !Utils.isInteractionComponent(DepUtils.getClassifier(instance))) { + InstanceSpecification newInstance = mainModelTrafo.transformInstance(instance, null); + + // -------------------------------------------------------------------- + checkProgressStatus(); + // -------------------------------------------------------------------- + + TransformationUtil.applyInstanceConfigurators(newInstance); + + FlattenInteractionComponents.getInstance().flattenAssembly( + newInstance, null); + TransformationUtil.propagateAllocation(newInstance); + instanceMap.put(instance, newInstance); + } + } + } + + if (!generateCACOnly) { + deployOnNodes(instanceMap, existingModel, intermediateModel); + } + + intermediateModelManagement.saveModel(project, TEMP_MODEL_FOLDER, + TEMP_MODEL_POSTFIX); + + // -------------------------------------------------------------------- + checkProgressStatus(); + // -------------------------------------------------------------------- + + intermediateModelManagement.dispose(); + } + +private void deployOnNodes(Map instanceMap, + Model existingModel, Model tmpModel) + throws TransformationException, InterruptedException { + + // not deploy on each node + DepCreation.initAutoValues(instanceMap.values()); + + EList nodes = AllocUtils.getAllNodes(instanceMap.values()); + if (nodes.size() > 0) { + InstanceConfigurator.onNodeModel = true; + for (int nodeIndex = 0; nodeIndex < nodes.size(); nodeIndex++) { + InstanceSpecification node = nodes.get(nodeIndex); + + deployNode(instanceMap, existingModel, tmpModel, nodes, nodeIndex, node); + } + } else { + throw new TransformationException( + Messages.InstantiateDepPlan_InfoNoneAllocated); + } + } + + private void deployNode(Map instanceMap, + Model existingModel, Model tmpModel, + EList nodes, int nodeIndex, InstanceSpecification node) + throws TransformationException, InterruptedException { + ModelManagement genModelManagement = createTargetModel(existingModel, + MapUtil.rootModelName, false); + Model generatedModel = genModelManagement.getModel(); + + // -------------------------------------------------------------------- + checkProgressStatus(); + // -------------------------------------------------------------------- + + // new model has name "root" and contains a package with the + // existing model + // Package originalRoot = genModel.createNestedPackage + // (existingModel.getName ()); + LazyCopier targetCopy = new LazyCopier(tmpModel, generatedModel, true, true); + // TODO: distribution to nodes is currently not done. How + // can it be realized with a copy filter ? + targetCopy.preCopyListeners.add(FilterStateMachines.getInstance()); + targetCopy.preCopyListeners.add(FilterRuleApplication.getInstance()); + + monitor.setTaskName(String.format( + Messages.InstantiateDepPlan_InfoDeployingForNode, + node.getName())); + + if (instanceMap.isEmpty()) { + return; + } + // get first language (restricted to single target language, acceptable?) + String targetLanguage = DepUtils.getTargetLanguage(instanceMap.keySet().iterator().next()); + ILangProjectSupport projectSupport = configureLanguageSupport(targetLanguage, + existingModel, node); + if (projectSupport == null) { + return; + } + + GatherConfigData gatherConfigData = new GatherConfigData(projectSupport); + Deploy deployment = new Deploy(targetCopy, gatherConfigData, node, + nodeIndex, nodes.size()); + + for (InstanceSpecification topLevelInstance : instanceMap.keySet()) { + InstanceSpecification newTopLevelInstance = instanceMap.get(topLevelInstance); + InstanceSpecification nodeRootIS = deployment.distributeToNode(newTopLevelInstance); + TransformationUtil.updateDerivedInterfaces(nodeRootIS); + } + deployment.finalize(targetLanguage); + if ((generationOptions & GenerationOptions.REWRITE_SETTINGS) != 0) { + projectSupport.setSettings(genProject, gatherConfigData.getSettings()); + } + + // -------------------------------------------------------------------- + checkProgressStatus(); + // -------------------------------------------------------------------- + + removeDerivedInterfacesInRoot(generatedModel); + + ExecuteOOTrafo.transform(targetCopy, deployment.getBootloader(), generatedModel); + + // -------------------------------------------------------------------- + checkProgressStatus(); + // -------------------------------------------------------------------- + + destroyDeploymentPlanFolder(generatedModel); + + if (generateCode) { + ILangCodegen codegen = LanguageCodegen.getGenerator(targetLanguage); + GenerateCode codeGenerator = new GenerateCode(genProject, codegen, genModelManagement, + monitor); + boolean option = (generationOptions & GenerationOptions.ONLY_CHANGED) != 0; + codeGenerator.generate(node, targetLanguage, option); + } + + genModelManagement.dispose(); + } + + /** + * + * @param mainInstance + * @param existingModel + * @param node + * @return null, if no language support is available or no project could be created. + * @throws TransformationException + */ + private ILangProjectSupport configureLanguageSupport( + String targetLanguage, Model existingModel, + InstanceSpecification node) throws TransformationException { + ILangProjectSupport projectSupport = LanguageProjectSupport.getProjectSupport(targetLanguage); + AbstractSettings settings = projectSupport.initialConfigurationData(); + settings.targetOS = getTargetOS(node); + + String modelName = getModelName(existingModel, node); + genProject = ProjectManagement.getNamedProject(modelName); + if ((genProject == null) || !genProject.exists()) { + genProject = projectSupport.createProject(modelName); + // project is new, force re-write of settings + generationOptions |= GenerationOptions.REWRITE_SETTINGS; + } + return projectSupport; + } + + protected String getTargetOS(InstanceSpecification node) { + Target target = UMLUtil.getStereotypeApplication(node, Target.class); + if (target == null) { + // get information from node referenced by the instance + target = UMLUtil.getStereotypeApplication(DepUtils.getClassifier(node), Target.class); + } + if (target != null) { + OperatingSystem os = target.getUsedOS(); + if (os != null) { + return os.getBase_Class().getName(); + } + } + return null; + } + + private void destroyDeploymentPlanFolder(Model generatedModel) { + PackageableElement deploymentPlanFolder = generatedModel + .getPackagedElement(DeployConstants.depPlanFolderHw); + if (deploymentPlanFolder != null) { + deploymentPlanFolder.destroy(); + } + } + + private void removeDerivedInterfacesInRoot(Model generatedModel) { + // 2b: remove derived interfaces in root: derived interfaces + // that can not be placed in the same package as the port type (e.g. + // since read-only type from system library), are put in a top-level + // package called "derivedInterfaces". Due to the copying of imports, + // the top-level package has changed which implies that new derived + // interfaces are put into a different package and the derivedInterfaces + // package in the original root becomes obsolete. Delete this obsolete + // package, if existing. + for (PackageableElement packagedElement : generatedModel + .getPackagedElements()) { + if (packagedElement instanceof Package) { + NamedElement derivedInterfaces = ((Package) packagedElement) + .getPackagedElement("derivedInterfaces"); //$NON-NLS-1$ + if (derivedInterfaces instanceof Package) { + derivedInterfaces.destroy(); + } + } + } + } + + private String getModelName(Model existingModel, InstanceSpecification node) { + String modelName = existingModel.getName() + "_" + node.getName(); //$NON-NLS-1$ + if (configuration != null) { + modelName += "_" + configuration.getBase_Class().getName(); //$NON-NLS-1$ + } else { + modelName += "_" + srcModelComponentDeploymentPlan.getName(); //$NON-NLS-1$ + } + return modelName; + } + + private void initiateProgressMonitor(boolean generateCode, + EList nodes) { + // -- calc # of steps for progress monitor + // 1 (tmpModel creation) + 1 (reification) + 1 (tmpModel save) + // 5x on each deployed node (see below) + // problem? Connector reification is a single, relatively long step + int steps = 3; + steps += 5 * nodes.size(); + if (generateCode) { + steps += nodes.size(); + } + monitor.beginTask(Messages.InstantiateDepPlan_InfoGeneratingModel, + steps); + } + + private void checkProgressStatus() throws InterruptedException { + if (monitor.isCanceled()) { + throw new InterruptedException(); + } + monitor.worked(1); + } + + private void printAndDisplayErrorMessage(Exception e, final String title, + final boolean consultConsole) { + String message = e.toString(); + if (consultConsole) { + message = message + "\n\n" //$NON-NLS-1$ + + Messages.InstantiateDepPlan_ConsultConsole; + } + + printAndDisplayErrorMessage(e, title, message, consultConsole); + } + + private void printAndDisplayErrorMessage(Exception e, final String title, + final String message, final boolean consultConsole) { + e.printStackTrace(); + displayError(title, message); + Log.log(IStatus.ERROR, Log.DEPLOYMENT, "", e); //$NON-NLS-1$ + } + + private void displayError(final String title, final String message) { + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + Shell shell = Display.getDefault().getActiveShell(); + MessageDialog.openInformation(shell, title, message); + } + }); + } + + /** + * Create a new empty model from an existing model that applies the same + * profiles and has the same imports + * + * @param existingModel + * @return + */ + public ModelManagement createTargetModel(Model existingModel, String name, + boolean copyImports) throws TransformationException { + ModelManagement mm = new ModelManagement(); + Model newModel = mm.getModel(); + newModel.setName(name); + + try { + // copy profile application + for (Profile profile : existingModel.getAppliedProfiles()) { + // reload profile in resource of new model + monitor.subTask(Messages.InstantiateDepPlan_InfoApplyProfile + + profile.getQualifiedName()); + + if (profile.eResource() == null) { + String profileName = profile.getQualifiedName(); + if (profileName == null) { + if (profile instanceof MinimalEObjectImpl.Container) { + URI uri = ((MinimalEObjectImpl.Container) profile) + .eProxyURI(); + if (uri != null) { + throw new TransformationException( + String.format( + Messages.InstantiateDepPlan_CheckInputModelProfileNoRes, + uri)); + } + } + throw new TransformationException( + Messages.InstantiateDepPlan_CheckInputModelProfileNoResNoName); + } + throw new TransformationException( + String.format( + Messages.InstantiateDepPlan_CheckInputModelProfile3, + profileName)); + } + + Resource profileResource = null; + try { + profileResource = ModelManagement.getResourceSet() + .getResource(profile.eResource().getURI(), true); + } catch (WrappedException e) { + // read 2nd time (some diagnostic errors are raised only + // once) + Log.log(IStatus.WARNING, + Log.DEPLOYMENT, + "Warning: exception in profile.eResource() " + e.getMessage()); //$NON-NLS-1$ + profileResource = ModelManagement.getResourceSet() + .getResource(profile.eResource().getURI(), true); + } + Profile newProfileTop = (Profile) profileResource.getContents().get(0); + Profile newProfile; + String qname = profile.getQualifiedName(); + if ((qname != null) && qname.contains("::")) { //$NON-NLS-1$ + // profile is a sub-profile within same resource + // TODO: should Copy class copy profile applications? + // Should be handled in shallowContainer class. + // if we put profile/newProfile pair into copy map, copy + // would find (and copy profile + // applications in sub-folders + qname = qname.substring(qname.indexOf("::") + 2); //$NON-NLS-1$ + newProfile = (Profile) Utils.getQualifiedElement( + newProfileTop, qname); + } else { + newProfile = newProfileTop; + } + newProfile.getMember("dummy"); // force profile loading //$NON-NLS-1$ + newModel.applyProfile(newProfile); + } + } catch (IllegalArgumentException e) { + throw new TransformationException( + Messages.InstantiateDepPlan_IllegalArgumentDuringCopy + + e.toString()); + } + + // copy imports (and load resources associated - TODO: might not be + // necessary) + // While this is useful in general, it implies that code for imported + // models + // has been generated and compiled (for the right target) into a + // library. This may be + // quite tedious, unless automatically managed. + // Therefore we do not activate this option in a first pass of the model + // transformations. + if (copyImports) { + for (Package importedPackage : existingModel.getImportedPackages()) { + if (importedPackage == null) { + throw new TransformationException( + Messages.InstantiateDepPlan_CheckInputImportPkg); + } + if (importedPackage.eResource() == null) { + String errorMsg = Messages.InstantiateDepPlan_CheckInputImportPkgNoRes; + if (importedPackage instanceof MinimalEObjectImpl.Container) { + URI uri = ((MinimalEObjectImpl.Container) importedPackage) + .eProxyURI(); + if (uri != null) { + errorMsg += " - URI: " + uri.devicePath(); //$NON-NLS-1$ + } + } + throw new TransformationException(errorMsg); + } + newModel.createPackageImport(importedPackage); + monitor.subTask(String.format( + Messages.InstantiateDepPlan_InfoImportPackage, + importedPackage.getName())); + + try { + importedPackage.eResource().load(null); + newModel.getMember("dummy"); // force loading of model //$NON-NLS-1$ + } catch (IOException e) { + throw new TransformationException(e.getMessage()); + } + + } + } + + StUtils.copyStereotypes(existingModel, newModel); + + return mm; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/LazyCopier.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/LazyCopier.java new file mode 100644 index 00000000000..9ce3514fce5 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/LazyCopier.java @@ -0,0 +1,1044 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Stack; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.util.EcoreUtil.Copier; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.listeners.PostCopyListener; +import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Feature; +import org.eclipse.uml2.uml.LiteralBoolean; +import org.eclipse.uml2.uml.LiteralInteger; +import org.eclipse.uml2.uml.LiteralNull; +import org.eclipse.uml2.uml.LiteralString; +import org.eclipse.uml2.uml.LiteralUnlimitedNatural; +import org.eclipse.uml2.uml.MultiplicityElement; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Namespace; +import org.eclipse.uml2.uml.OpaqueExpression; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.Stereotype; +import org.eclipse.uml2.uml.ValueSpecification; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * A specific copier that enables to make iterative and shallow copies of model elements + * from a source to a target model. It also supports copy-listeners, i.e. listeners that + * might apply modifications before and after an element is copied. + * This class is very useful for model transformations that make a lazy copy of elements, + * i.e. copy only elements that are needed in the target model. + * + * Iterative means that you can copy one element after another, i.e. you do not need + * to copy all elements in a single call. + * Shallow means that some elements are incomplete copies. For instance, if you copy an + * attribute of a class into the target model, the copy routine will create the attribute within + * a shallow copy of the original class. The created class is a kind of shallow "container". It + * is required, since we can't create the attribute without having a class, but it would initially + * only contain the attribute that we copy. This class would have the same qualified name as the + * original, i.e. it would be created within shallow packages. + * A shallow copy can be transformed into a "real" copy + * by explicitly copying it. + * + */ +public class LazyCopier extends Copier { + + public enum CopyStatus { + /** + * The status is not known, in most cases this indicates that the object has not yet been copied. + */ + UNKNOWN, + + /** + * A full copy obtained via the copy function. Full means that the contained features have been completely + * copied + */ + FULL, + + /** + * A full copy in progress. Intermediate state of a target element after creation within the copy function, + * before all attributes & references have been copied. + */ + INPROGRESS, + + /** + * A shallow copy, i.e. a copy only containing a subset of the original element. These are typically containers + * for copied objects and avoids that the copies are not enclosed in an object. A shallow copy may become a full + * copy later on. + */ + SHALLOW + } + + /** + * + * @param source + * source package (root) + * @param target + * target package (root) + * @param copyExtResources_ + * copy elements that are not within the same resource instead of referencing them. + * @param copyID + * copyID true, if XML IDs should be copied as well. + */ + public LazyCopier(Package source, Package target, boolean copyExtResources_, boolean copyID) { + this.source = source; + this.target = target; + // useOriginalReferences = false; + copyExtReferences = copyExtResources_; + preCopyListeners = new BasicEList(); + postCopyListeners = new BasicEList(); + templateMapInfo = new HashMap>(); + standardMap = new HashMap(); + statusMap = new HashMap(); + boundPackages = new Stack(); + if (copyExtReferences) { + // original source package becomes a sub-package in the target model + Package newSourceRoot = target.createNestedPackage(source.getName()); + put(source, newSourceRoot); + setStatus(newSourceRoot, CopyStatus.SHALLOW); + } + else { + put(source, target); + setStatus(target, CopyStatus.SHALLOW); + } + this.copyID = copyID; + if (copyID) { + copyID(source, target); + } + }; + + /** + * + */ + private static final long serialVersionUID = -1664013545661635289L; + + /** + * Source model within a transformation + */ + + public Package source; + + /** + * Target model within a transformation + */ + public Package target; + + /** + * if true, copy packages or elements that are imported into the target + * model + */ + public boolean copyExtReferences; + + /** + * Bound package template + */ + protected Namespace boundPackage; + + /** + * Map to identify target objects when given source objects + */ + protected Map standardMap; + + /** + * Map to identify target objects when given source objects + */ + protected Map templateMap; + + /** + * Set of maps for template instantiations + */ + protected Map> templateMapInfo; + + /** + * Map using a target EObject as key + */ + protected Map statusMap; + + protected boolean copyID; + + /** + * Elements within package templates must be treated differently, we have to ensure that: + * (1) several instantiations with same binding of the same package template do not lead to double copies + * (yet, it may be possible that a 2nd instantiation adds contents, e.g. the trace package template could be + * instantiated containing only OTF trace (and superclasses), a second instantiation might add a different trace + * implementation) + * (2) several instantiations with different binding do not prevent classes from being copied that have already + * been copied earlier. + * The solution is to use a different map for the elements with package template. This map is instantiated once + * for each binding (managed by the TemplateInstantiation class) + */ + public Map getMap(EObject sourceEObj) { + boolean withinTemplate = withinTemplate(sourceEObj); + return withinTemplate ? + templateMap : + standardMap; + } + + @Override + public EObject get(Object sourceEObj) { + if (sourceEObj instanceof EObject) { + Map map = getMap((EObject) sourceEObj); + return map.get(sourceEObj); + } + return null; + } + + @Override + public EObject put(EObject sourceEObj, EObject targetEObj) { + if (sourceEObj instanceof EObject) { + Map map = getMap(sourceEObj); + return map.put(sourceEObj, targetEObj); + } + return null; + } + + /** + * Put a pair into the copy map. Unlike the standard put operation, + * the target object is marked as full copy. + * Just using the put operation lead to bug 422899 - [QDesigner] Regression in + * template instantiation + * + * @return + */ + public EObject putPair(EObject sourceEObj, EObject targetEObj) { + EObject target = put(sourceEObj, targetEObj); + setStatus(targetEObj, CopyStatus.FULL); + return target; + } + + @Override + public boolean containsKey(Object sourceEObj) { + if (sourceEObj instanceof EObject) { + Map map = getMap((EObject) sourceEObj); + return map.containsKey(sourceEObj); + } + return false; + } + + @Override + public EObject remove(Object sourceEObj) { + if (sourceEObj instanceof EObject) { + Map map = getMap((EObject) sourceEObj); + return map.remove(sourceEObj); + } + return null; + } + + /** + * Set the status of a copy object + * + * @param targetEObj + * @param status + */ + public void setStatus(EObject targetEObj, CopyStatus status) { + statusMap.put(targetEObj, status); + } + + /** + * return true, if a shallow copy of the passed EObject exists + * + * @param sourceEObj + * @return + */ + public CopyStatus getStatus(EObject targetEObj) { + if (targetEObj != null) { + CopyStatus status = statusMap.get(targetEObj); + if (status != null) { + return status; + } + } + return CopyStatus.UNKNOWN; + } + + /** + * Set the reference of a bound package template. It must be a member of the target model. + * Setting the package template is required to assure that elements that are part of a different + * resource get copied (if the copyExtReferences flag is set to false, copying would not be done otherwise) + * + * @param packageTemplate + * Reference to package (with a template signature) in source model that should be instantiated + * @param boundPackage + * Reference to (an initially empty) package in which the packate template will be instantiated + * during the copy process + */ + public void setPackageTemplate(Namespace packageTemplate, Namespace boundPackage) { + this.boundPackage = boundPackage; + if (packageTemplate == null) { + return; + } + templateMap = + templateMapInfo.get(boundPackage); + if (templateMap == null) { + templateMap = new HashMap(); + templateMapInfo.put(boundPackage, templateMap); + } + // declare relation between packageTemplate and bound package + // but: the owner of the package template is not equal to the packageTemplate (e.g. perClass) + // since we can extend package templates in different models. + standardMap.put(packageTemplate, boundPackage); + } + + public void pushPackageTemplate() { + boundPackages.push(boundPackage); + } + + public void popPackageTemplate() { + boundPackage = boundPackages.pop(); + templateMap = + templateMapInfo.get(boundPackage); + } + + private Stack boundPackages; + + /** + * Remove an element and its children from the map to enable subsequent copies, in particular if the + * same element (e.g. an operation) is bound multiple times within a template instantiation. + * TODO: there must be a better way to do this. + * + * @param element + */ + public void removeForCopy(EObject element) { + templateMap.remove(element); + if (element instanceof Element) { + // also remove applied stereotypes + for (EObject stereoApplication : ((Element) element).getStereotypeApplications()) { + removeForCopy(stereoApplication); + } + } + EClass eClass = element.eClass(); + for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i) + { + EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); + if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) + { + if (eStructuralFeature instanceof EAttribute) { + // copyAttribute((EAttribute)eStructuralFeature, sourceEObj, targetEObj); + } + else { + EReference eReference = (EReference) eStructuralFeature; + if (eReference.isContainment()) { + for (EObject ref : getRefs(eReference, element)) { + removeForCopy(ref); + } + } + else if (!eReference.isContainer()) { + // not contained, but copy reference as well + + } + } + } + } + } + + @SuppressWarnings("unchecked") + public EList getRefs(EReference eReference, EObject eObject) { + EList refs = new BasicEList(); + if (eObject.eIsSet(eReference)) { + if (eReference.isMany()) { + // @SuppressWarnings("unchecked") + refs.addAll((List) eObject.eGet(eReference)); + } else { + refs.add((EObject) eObject.eGet(eReference)); + } + } + return refs; + } + + /** + * Check whether the passed element (within the source model) is within a + * a template, i.e. one of is owners is mapped towards the bound package in + * the target model. Note that multiple owners in the source model may be + * mapped to the same bound package. + * + * @param element + * @return + */ + public boolean withinTemplate(EObject element) { + if (boundPackage != null) { + EObject owner = element; + if ((element.eContainer() == null) && + !(element instanceof Element)) { // has no eContainer and is not a UML element => likely to be a be a stereotype application. + // it is important not to call getBaseElement for all eobjects, since its execution can take + // quite a while (in particular, if not called on a stereotype application) + Element base = UMLUtil.getBaseElement(owner); + if (base != null) { + owner = base; // containment check is done with base element + } + } + while (owner != null) { + owner = owner.eContainer(); + if (get(owner) == boundPackage) { + return true; + } + } + } + return false; + } + + /** + * Returns a copy of the given eObject. + * + * Normally, we do not want to copy elements that are from a different + * resource. There are two exceptions (1) if this is explicitly specified + * (for producing "complete" models) (2) if we want to copy elements from a + * template into the target model. + * + * @param sourceEObj + * the object to copy. + * @return the copy. + */ + @SuppressWarnings("unchecked") + @Override + public EObject copy(EObject sourceEObj) { + if (sourceEObj == null) { + // this case may happen, if elements are systematically copied without checking for + // null references in the application code (e.g. if we copy a part-with-port which might + // be null in case of delegation or connectors without ports + return null; + } + + + EObject targetEObj = get(sourceEObj); + + CopyStatus status = getStatus(targetEObj); + + if (status == CopyStatus.FULL || status == CopyStatus.INPROGRESS) { + // copy already exists, return targetEObj + return targetEObj; + } + + boolean withinTemplate = withinTemplate(sourceEObj); + boolean sameResource = (sourceEObj.eResource() == source.eResource()); + if (!sameResource && !copyExtReferences && !withinTemplate) { + // do not copy if within different resource, unless + // 1. copyImports + // 2. within package template + return sourceEObj; + } + + if (sourceEObj instanceof Stereotype) { + // do not copy Stereotypes, as it would imply copying meta-model elements (the base_X + // attribute of the stereotype is typed with a meta-model element) + return sourceEObj; + } + + for (PreCopyListener listener : preCopyListeners) { + EObject result = listener.preCopyEObject(this, sourceEObj); + if (result != sourceEObj) { + return result; + } + } + + if (sourceEObj instanceof NamedElement) { + String name = ((NamedElement) sourceEObj).getQualifiedName(); + if ((name != null) && name.startsWith("uml::")) { //$NON-NLS-1$ + Log.log(IStatus.ERROR, Log.TRAFO_COPY, "copy for meta-model element \"" + name + //$NON-NLS-1$ + "\" requested. Return original element"); //$NON-NLS-1$ + return sourceEObj; + } + } + // additional sanity check: want to avoid copying (instead of instantiating) elements + // of a package template + if ((sourceEObj instanceof Package) && (!withinTemplate)) { + if (((Package) sourceEObj).getOwnedTemplateSignature() != null) { + Log.log(IStatus.WARNING, Log.TRAFO_COPY, "warning: copying a package template without instantiating a template"); //$NON-NLS-1$ + } + } + + if (status == CopyStatus.SHALLOW) { + // copy exists, but was a shallow copy, change status to INPROGRESS + setStatus(targetEObj, CopyStatus.INPROGRESS); + } + else { + targetEObj = createCopy(sourceEObj); + put(sourceEObj, targetEObj); + setStatus(targetEObj, CopyStatus.INPROGRESS); + if (copyID) { + copyID(sourceEObj, targetEObj); + } + // creates a shallow copy of the container. This container will update containment references (such as packagedElement) + // and thus update links + createShallowContainer(sourceEObj); + } + EClass eClass = sourceEObj.eClass(); + for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i) + { + EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); + if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) + { + if (eStructuralFeature instanceof EAttribute) { + copyAttribute((EAttribute) eStructuralFeature, sourceEObj, targetEObj); + } + else { + EReference eReference = (EReference) eStructuralFeature; + if (eReference.isContainment()) { + copyContainment(eReference, sourceEObj, targetEObj); + } + // some containment relationships require copying the container completely + // e.g. if an owned template signature is referenced, we need to follow the "template" + // reference, which subsets the "owner" relationship. + // e.g. if an operation is referenced, we need to copy the whole interface + // Currently: only the standard owning reference is not copied recursively. + + else if (!eReference.getName().equals("owner") && //$NON-NLS-1$ + (!eReference.getName().equals("owningInstance"))) { //$NON-NLS-1$ + Object feature = sourceEObj.eGet(eStructuralFeature); + if (feature instanceof Element) { + copy((Element) feature); + } else if (feature instanceof EList) { + copyAll((EList) feature); + } + copyReference(eReference, sourceEObj, targetEObj); + } + } + } + else if ((eStructuralFeature instanceof EReference)) { + if (eStructuralFeature.getName().equals("clientDependency")) { //$NON-NLS-1$ + Object feature = sourceEObj.eGet(eStructuralFeature); + + if (feature instanceof Element) { + copy((Element) feature); + } else if (feature instanceof EList) { + copyAll((EList) feature); + } + } + } + } + copyProxyURI(sourceEObj, targetEObj); + copyID(sourceEObj, targetEObj); + copyStereotypes(sourceEObj); + setStatus(targetEObj, CopyStatus.FULL); + + for (PostCopyListener listener : postCopyListeners) { + listener.postCopyEObject(this, targetEObj); + } + + return targetEObj; + } + + /** + * @param sourceEObj + * @return a copy, if it already exists. If it does not exist, return the + * source object itself, if no copy is required, otherwise return null. + */ + public EObject noCopy(EObject sourceEObj) { + boolean withinTemplate = withinTemplate(sourceEObj); + boolean sameResource = (sourceEObj.eResource() == source.eResource()); + if (!sameResource && !copyExtReferences && !withinTemplate) { + return sourceEObj; + } + else { + return get(sourceEObj); + } + } + + /** + * Copy stereotype applications. Since stereotype applications are not part of the containment of an eObject, they are not copied by the + * generic function. + * A problem of copying stereotypes is that it may drag whole hierarchies with it, for instance if we copy the base_ attributes, + * we transform a shallow copy into a normal copy. + * => always make shallow copies of packages, never shallow copies of classes? [the split into fragments is solved, but the split of the system component???] + */ + public void copyStereotypes(EObject sourceEObj, boolean duringShallow) { + if (sourceEObj instanceof Element) { + + for (EObject stereoApplication : ((Element) sourceEObj).getStereotypeApplications()) { + EObject copiedStereoApplication = (duringShallow) ? + shallowCopy(stereoApplication) : + copy(stereoApplication); + + if (copiedStereoApplication != null) { + // UMLUtil.setBaseElement(copiedStereoApplication, (Element) get(sourceEObj)); + // add copied stereotype application to the resource (as top-level objects). + if (!target.eResource().getContents().contains(copiedStereoApplication)) { + target.eResource().getContents().add(copiedStereoApplication); + } + } + } + } + } + + public void copyStereotypes(EObject sourceEObj) { + copyStereotypes(sourceEObj, false); + } + + public void shallowCopyStereotypes(EObject sourceEObj) { + copyStereotypes(sourceEObj, true); + } + + /** + * Copy the containment of an element with respect to a certain reference + * + * @see org.eclipse.emf.ecore.util.EcoreUtil.Copier#copyContainment(org.eclipse.emf.ecore.EReference, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject) + * Differences to referenced function in ECoreUtil + * - If an element in copyAll is null, it is not added + * - List elements are always cleared before copying, since the list elements may already have been + * partially filled by a previous shallow copy + * + * @param eReference + * a reference, such as for instance packagedElement (the + * caller needs to check, is this reference is a containment reference). + * @param eObject + * the source eObject + * @param copyEObject + * the copy of this eObject + */ + @Override + protected void copyContainment(EReference eReference, EObject eObject, EObject copyEObject) { + if (eObject.eIsSet(eReference)) { + if (eReference.isMany()) { + @SuppressWarnings("unchecked") + List source = (List) eObject.eGet(eReference); + @SuppressWarnings("unchecked") + List target = (List) copyEObject.eGet(getTarget(eReference)); + // do not clear (would remove elements that are added by copy listeners) + // But: better enforce exact copy? (listeners could only add in a post-copy step) + // target.clear(); + if (!source.isEmpty()) { + for (EObject copyEObj : copyAll(source)) { + if (copyEObj != null) { + target.add(copyEObj); + } + } + } + } else { + EObject childEObject = (EObject) eObject.eGet(eReference); + copyEObject.eSet(getTarget(eReference), childEObject == null ? null : copy(childEObject)); + } + } + } + + /** + * Copy the containment in a "shallow" way, i.e. copy references to contained objects, if these exist already. + * If called for instance for a package, it will add those elements to the packagedElements list of the + * target package, that have already been copied. + * + * @param eReference + * @param eObject + * @param copyEObject + */ + protected void shallowCopyContainment(EReference eReference, EObject eObject, EObject copyEObject) { + if (eObject.eIsSet(eReference)) { + if (eReference.isMany()) { + @SuppressWarnings("unchecked") + List source = (List) eObject.eGet(eReference); + @SuppressWarnings("unchecked") + List target = (List) copyEObject.eGet(getTarget(eReference)); + if (source.isEmpty()) { + target.clear(); + } else { + for (EObject sourceEObj : source) { + // if eObject has already been copied, add it to target + // don't add, if copyEObj is identical to sourceEObj. This would imply manipulating an + // element of the source model. + EObject copyEObj = noCopy(sourceEObj); + if ((copyEObj != null) && (copyEObj != sourceEObj) && (!target.contains(copyEObj))) { + try { + target.add(copyEObj); + } + catch (Exception e) { + System.err.println(e); + } + } + } + } + } else { + EObject childEObject = (EObject) eObject.eGet(eReference); + // get will return null, if object should not be copied. In this case, we do not want to replace + copyEObject.eSet(getTarget(eReference), childEObject == null ? null : noCopy(childEObject)); + } + } + } + + /** + * Create a "shallow" container for an object, i.e. create (recursively) the owner without + * adding all other children of this owner (e.g. in case of a package, the package itself will + * be created, but not all elements within that package). + * + * @param sourceEObj + */ + public void createShallowContainer(EObject sourceEObj) { + EObject owner = sourceEObj.eContainer(); + EObject copy = null; + EObject lastSource = null; + EList copyStereoList = new BasicEList(); + while (owner != null) { + if (containsKey(owner)) { + // owner is in map, still need to re-copy (update) the containment + // references, since one of the children did not exist before + // + shallowCopy(owner); + if (lastSource != null) { + // StUtils.copyStereotypes(this, (Element)lastSource, (Element)copy); + } + return; + // break; + } + copy = shallowCopy(owner); + // copyStereoList.add(sourceEObj); + owner = owner.eContainer(); + } + // copy the stereotypes after the container has been created completely + for (EObject copyStereo : copyStereoList) { + copyStereotypes(copyStereo); + } + if (copy instanceof PackageableElement) { + // if we copy external resources, we might reach the "top" on the source level + // which becomes a sub-package of the new model. + target.getPackagedElements().add((PackageableElement) copy); + } + } + + /** + * Make a shallow copy of an element, i.e. only create the element itself and not + * all of its contents. If a subset of the containing elements already exist in the copied + * model, update the containment references pointing to these. The function may be called + * multiple times in order to add elements to the containment references that + * have been copied since the previous call (i.e. it is possible to make a shallow copy + * of a package after a single class within it has been copied. It may be called again, + * once a second class within the package has been copied => the packagedElements reference + * of the package will be updated). + * + * It is important that the implementation of this object does not make recursive calls. + * In particular, stereotypes are based on shallow copy as well. This means that stereotype + * attributes that reference other model elements will only be initialized if these elements + * exist already. + * + * @param sourceEObj + * @return + */ + public EObject shallowCopy(EObject sourceEObj) { + boolean first = false; + EObject targetEObj = get(sourceEObj); + if (targetEObj == null) { + targetEObj = createCopy(sourceEObj); + put(sourceEObj, targetEObj); + setStatus(targetEObj, CopyStatus.SHALLOW); + if (copyID) { + copyID(sourceEObj, targetEObj); + } + first = true; + } + else if (getStatus(targetEObj) == CopyStatus.FULL) { + // object has already been completely copied. Nothing to do, return targetEObj. + // Note that this implies that the update of references below is called for full copies + // in progress and shallow copies. The former assures that all copied elements have an + // eContainer during the call of pre-copy listeners (example: if a class is copied, its + // operations are recursively copied, the ownedOperation relationship is only updated + // *afterwards* by the code within the (full) copy operation). + return targetEObj; + } + + shallowCopyStereotypes(sourceEObj); + + EClass eClass = sourceEObj.eClass(); + + for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i) { + EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i); + if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived()) { + if (eStructuralFeature instanceof EAttribute) { + // copy all attributes during first pass after creation of target object + if (first) { + copyAttribute((EAttribute) eStructuralFeature, sourceEObj, targetEObj); + } + } else { + EReference eReference = (EReference) eStructuralFeature; + // create a shallow copy of the containment: update only references already in the copy map + if (sourceEObj != targetEObj) { + shallowCopyContainment(eReference, sourceEObj, targetEObj); + } + } + } + } + return targetEObj; + } + + @SuppressWarnings("unchecked") + public T getCopy(T source) { + return (T) copy(source); + } + + public EList preCopyListeners; + + public EList postCopyListeners; + + /** + * Called to handle the copying of a cross reference; + * this adds values or sets a single value as appropriate for the multiplicity + * while omitting any bidirectional reference that isn't in the copy map. + * + * @param eReference + * the reference to copy. + * @param eObject + * the object from which to copy. + * @param copyEObject + * the object to copy to. + */ + @Override + protected void copyReference(EReference eReference, EObject eObject, EObject copyEObject) + { + if (eObject.eIsSet(eReference)) { + if (eReference.isMany()) { + @SuppressWarnings("unchecked") + InternalEList source = (InternalEList) eObject.eGet(eReference); + @SuppressWarnings("unchecked") + InternalEList target = (InternalEList) copyEObject.eGet(getTarget(eReference)); + if (source.isEmpty()) { + target.clear(); + } + else { + boolean isBidirectional = eReference.getEOpposite() != null; + int index = 0; + for (Iterator k = resolveProxies ? source.iterator() : source.basicIterator(); k.hasNext();) { + EObject referencedEObject = k.next(); + EObject copyReferencedEObject = get(referencedEObject); + // check filters (modification compared to method in superclass) + boolean noCopy = false; + for (PreCopyListener listener : preCopyListeners) { + EObject result = listener.preCopyEObject(this, referencedEObject); + if (result != referencedEObject) { + copyReferencedEObject = result; + noCopy = (result == null); + break; + } + } + if (noCopy) { + continue; + } + if (copyReferencedEObject == null) { + if (useOriginalReferences && !isBidirectional) { + target.addUnique(index, referencedEObject); + ++index; + } + } + else { + if (isBidirectional) { + int position = target.indexOf(copyReferencedEObject); + if (position == -1) { + target.addUnique(index, copyReferencedEObject); + } + else if (index != position) { + target.move(index, copyReferencedEObject); + } + } + else if (!target.contains(copyReferencedEObject)) { + // TODO: does not allow multiple identical elements in the list. Problematic? + // Check above is necessary, since some references that are not + // part of the containment may have already been copied (e.g. in case of + // a TemplateSignature "ownedParameter" subsets "parameter", thus copying + // ownedParameter as part of the containment adds a template parameter) + target.addUnique(index, copyReferencedEObject); + } + ++index; + } + } + } + } + else { + Object referencedEObject = eObject.eGet(eReference, resolveProxies); + if (referencedEObject == null) { + copyEObject.eSet(getTarget(eReference), null); + } + else if (referencedEObject instanceof EObject) { + // difference to original code in EcoreUtil: we obtain a copy (which might be null or the + // source object) of the referenced EObject. This assures that we only set a value of a + // reference to something we actually want to have in the target model. + // Specific problematic case in original code: classifierBehavior is a reference, but assigning such + // a behavior will also add an owned behavior. If we assign a referencedEObject (a behavior) from the + // source model in the target, we will actually remove it from the source model (as it is uniquely owned). + EObject copyReferencedEObject = copy((EObject) referencedEObject); + if (copyReferencedEObject != null) { + copyEObject.eSet(getTarget(eReference), copyReferencedEObject); + } + } + } + } + } + + /** + * Copy all methods from the passed source-model class. + * This function is useful, if the passed class only exist + * as a shallow copy. + * + * @param source + * A class within the source model + */ + public void copyMethods(Class source) { + for (Behavior method : source.getOwnedBehaviors()) { + getCopy(method); + } + } + + /** + * Copy all attributes from the source-model classifier + * This function is useful, if the passed class only exist + * as a shallow copy. + * + * @param source + * A classifier within the source model + */ + public void copyAttributes(Classifier source) { + for (Property attribute : source.getAttributes()) { + getCopy(attribute); + } + } + + /** + * copy all operations from the source-model classifier. + * This function is useful, if the passed class only exist + * as a shallow copy. + * + * @param source + * A classifier within the source model + */ + public void copyOperations(Classifier source) { + for (Operation operation : source.getOperations()) { + getCopy(operation); + } + } + + // TODO: the functions that follow are static and should not be part of this class + // as they use a different way of copying things. + + + public static void copyFeatureModifiers(Feature source, Feature target) { + target.setIsStatic(source.isStatic()); + target.setIsLeaf(source.isLeaf()); + } + + public static void copyMultElemModifiers(MultiplicityElement source, MultiplicityElement target) { + target.setIsOrdered(source.isOrdered()); + target.setIsUnique(source.isUnique()); + target.setLower(source.getLower()); + target.setUpper(source.getUpper()); + } + + /** + * Copy a value to a target slot + * + * @param smValue + * @param target + * @return + */ + public static ValueSpecification copyValue(ValueSpecification value, Slot target) { + ValueSpecification newValue = target.createValue(value.getName(), value.getType(), value.eClass()); + return copyValue(value, newValue); + } + + public static ValueSpecification copyDefaultValue(Property source, Property target) { + ValueSpecification value = source.getDefaultValue(); + if (value != null) { + ValueSpecification newValue = target.createDefaultValue(value.getName(), value.getType(), value.eClass()); + return copyValue(value, newValue); + } else { + return null; + } + } + + public static ValueSpecification copyValue(ValueSpecification smValue, ValueSpecification tmValue) { + if (smValue instanceof OpaqueExpression) { + OpaqueExpression oeValue = (OpaqueExpression) smValue; + OpaqueExpression noeValue = (OpaqueExpression) tmValue; + for (String language : oeValue.getLanguages()) { + noeValue.getLanguages().add(language); + } + for (String body : oeValue.getBodies()) { + noeValue.getBodies().add(body); + } + } else if (smValue instanceof LiteralString) { + ((LiteralString) tmValue).setValue(((LiteralString) smValue).getValue()); + } else if (smValue instanceof LiteralInteger) { + ((LiteralInteger) tmValue).setValue(((LiteralInteger) smValue).getValue()); + } else if (smValue instanceof LiteralUnlimitedNatural) { + ((LiteralUnlimitedNatural) tmValue).setValue(((LiteralUnlimitedNatural) smValue).getValue()); + } else if (smValue instanceof LiteralBoolean) { + ((LiteralBoolean) tmValue).setValue(((LiteralBoolean) smValue).booleanValue()); + } else if (smValue instanceof LiteralNull) { + } + return tmValue; + } + + /** + * Copy the (XML) ID from the source to the destination model element. This + * is useful, if you want to create a diagram for (parts of) the generated + * target model. Otherwise, the IDs would change with each generation and + * references from the diagram to model elements would break (of course, + * they could still break, for instance if structural modifications of the + * source model are made). + * + * @param source + * source model element + * @param dest + * corresponding target model element + */ + public static void copyID(EObject source, EObject target) { + copyID(source, target, ""); //$NON-NLS-1$ + } + + /** + * Copy the (XML) ID from the source to the destination model element. + * Prefix the ID with a string passed as parameter + * + * @param source + * source model element + * @param dest + * corresponding target model element + * @param prefix + * a prefix for the target model ID + */ + @SuppressWarnings("deprecation") + public static void copyID(EObject source, EObject target, String prefix) { + Resource resourceSource = source.eResource(); + Resource resourceTarget = target.eResource(); + // TODO: use EcoreUtil getURI (InternalEObject) instead? + + if ((resourceSource instanceof XMLResource) && (resourceTarget instanceof XMLResource)) { + XMLResource xmlResSource = (XMLResource) resourceSource; + XMLResource xmlResTarget = (XMLResource) resourceTarget; + String id = prefix + xmlResSource.getID(source); + int counter = 0; + String uniqueID = id; + while (xmlResTarget.getIDToEObjectMap().containsKey(uniqueID)) { + uniqueID = id + counter; + counter++; + } + xmlResTarget.setID(target, uniqueID); + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/MainModelTrafo.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/MainModelTrafo.java new file mode 100644 index 00000000000..f89e9dd930d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/MainModelTrafo.java @@ -0,0 +1,479 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations; + +/** + * This file is part of Qompass GenTools + * Copyright (C) 2008 CEA LIST (http://www-list.cea.fr/) + + * initial developer : Christophe JOUVRAY from CEA LIST + * Major contributions: Ansgar Radermacher from CEA LIST + */ + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.ContainerRuleKind; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.FCM.util.FCMUtil; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.PortUtils; +import org.eclipse.papyrus.qompass.designer.core.StUtils; +import org.eclipse.papyrus.qompass.designer.core.UMLTool; +import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateInstantiation; +import org.eclipse.papyrus.qompass.designer.core.transformations.connector.ConnectorReification; +import org.eclipse.papyrus.qompass.designer.core.transformations.container.ContainerTrafo; +import org.eclipse.papyrus.qompass.designer.core.transformations.container.LWContainerTrafo; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.EncapsulatedClassifier; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.InstanceValue; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.StructuralFeature; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.ValueSpecification; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * This class executes the main model transformation. It traverses the + * instances of a deployment plan in a recursive way and executes + * connector reification and container expansion. + */ +public class MainModelTrafo { + + + public static final String HW_COMP_PREFIX = "Hwc"; //$NON-NLS-1$ + + /** + * Create a new instance of main-model-transformation + * + * @param copy + * Copier + * @param tmCDP + * deployment plan in target model + */ + public MainModelTrafo(LazyCopier copy, Package tmCDP) { + nodeHandled = new HashMap(); + this.copy = copy; + this.tmCDP = tmCDP; + } + + /** + * Return an instance specification that corresponds to a part. This + * function is useful in the connector context, since it allows to retrieve + * the instance specification that is reference by a connection end-point + * (which points to the part). + * + * @param system + * the instance specification for the assembly + * @param part + * the part within a class + * @return The instance specification for the passed part + */ + public static InstanceSpecification getInstanceForPart( + InstanceSpecification system, Property part) { + for (Slot slot : system.getSlots()) { + if (slot.getDefiningFeature() == part) { + for (ValueSpecification value : slot.getValues()) { + // instances are accessible via ValueSpecification subclass + // InstanceValue + if (value instanceof InstanceValue) { + return (((InstanceValue) value).getInstance()); + } + } + } + } + return null; + } + + /** + * Find a port that would match a connection + * + * @param connectorType + * a connector type, i.e. a component with ports + * @param the + * port on the other side of the connection + * @return the first port (of all ports owned or inherited by the type) that + * is compatible with the passed otherPort. + */ + public static Port getConnectorPort(EncapsulatedClassifier connectorType, + Port otherPort, boolean isAssembly) { + EList ports = PortUtils.getAllPorts(connectorType); + // try to find match via kind + for (Port port : ports) { + if (PortUtils.matches(port, otherPort, isAssembly)) { + return port; + } + } + // no match found, try weaker condition: find 1st match for provided ... + boolean otherEndProvides = PortUtils.getProvided(otherPort) != null; + for (Port port : ports) { + Interface intf; + // if isAssembly: take "opposite" port + if (otherEndProvides != isAssembly) { + intf = PortUtils.getProvided(port); + } else { + intf = PortUtils.getRequired(port); + } + if (intf != null) { + return port; + } + } + return null; + } + + + /** + * This method performs a model transformation that replaces an Qompass + * connector by a property and a set of simple connectors. The type of the + * newly added connector must be instantiated from its template definition + * in order to adapt the connector to its context. This is done in a + * recursive manner on a compositeInstance. The result is a (composite) + * class which has the added connector. The function will also trigger + * container expansion, if necessary. Please note that we use the naming + * convention to prefix elements of the source model (wrt. to the + * transformation) with sm and elements of the target model with tm. + * + * @param smIS + * source model instance specification + * @param smDF + * source model defining feature (null for top-level instance). + * @param inheritedRules + * container rules inherited from containing composite + * @return new instance specification in traget model + * + * @throws TransformationException + */ + public InstanceSpecification transformInstance( + InstanceSpecification smIS, StructuralFeature smDF) throws TransformationException { + Class smComponent = null; + Classifier smCl = DepUtils.getClassifier(smIS); + if (smCl instanceof Class) { + smComponent = (Class) smCl; + } else { + // should not happen + return null; + } + + String instName = smIS.getName(); + // first check, if instance specification exists already. This may be the case for explicitly modeled singleton instances. + InstanceSpecification tmIS = (InstanceSpecification) + tmCDP.getPackagedElement(instName); + if (tmIS == null) { + tmIS = (InstanceSpecification) + tmCDP.createPackagedElement(instName, UMLPackage.eINSTANCE.getInstanceSpecification()); + } + if (smDF == null) { + // no defining feature => must be main instance + // => apply deployment plan stereotype and set main instance + DeploymentPlan newCDP = StereotypeUtil.applyApp(tmCDP, DeploymentPlan.class); + newCDP.setMainInstance(tmIS); + } + + Class tmComponent = copy.getCopy(smComponent); + if (tmComponent == null) { + return null; + } + tmIS.getClassifiers().add(tmComponent); + + // retrieve the component type object from the static profile (in order + // to process rules) + EList rules = FCMUtil.getAllContainerRules(smComponent); + + // get container trafo instance, if already existing + AbstractContainerTrafo containerTrafo = AbstractContainerTrafo.get(tmComponent); + + // general idea: an instance of class ContainerTafo is responsible for a specific component. + // the method createContainerInstance must be called for each instance of the application component + // (caveat: don't mix-up with instance of Java classes of the development tool) + // TODO: since we support multiple container kinds, we need to keep their container map separate! + InstanceSpecification containerIS = null; + if (containerTrafo == null) { + // no container exists, check rules and create eventually + for (ContainerRule rule : rules) { + if (RuleManagement.isRuleActive(rule)) { + // at least one active rule => create container (or get previously instantiated)) + if (containerTrafo == null) { + if (rule.getKind() == ContainerRuleKind.LIGHT_WEIGHT_OO_RULE) { + containerTrafo = new LWContainerTrafo(copy, tmCDP); + } + else { + containerTrafo = new ContainerTrafo(copy, tmCDP, tmIS); + } + containerTrafo.createContainer(smComponent, tmComponent); + } + else { + // configure only?? + } + containerTrafo.applyRule(rule, smComponent, tmComponent); + } + } + if (containerTrafo != null) { + containerTrafo.finalize(); + } + } + if (containerTrafo != null) { + // create instance of container. This is done after rule application, since + // elements that are added by the rules need to be instantiated as well. + // TODO: Cannot mix both rules. + containerIS = containerTrafo.createContainerInstance(tmComponent, tmIS); + } + // ------------------- end of container handling of SW nodes + + // copy node allocation + for (InstanceSpecification smNode : AllocUtils.getNodes(smIS)) { + InstanceSpecification tmNode = copy.getCopy(smNode); + if (containerIS != null) { + // allocate container instead of executor. + AllocUtils.allocate(containerIS, tmNode); + } + else { + AllocUtils.allocate(tmIS, tmNode); + } + + if (!nodeHandled.containsKey(tmNode)) { + // check if node (on an instance level) has already been treated. This is required, since many + // instances might be allocated to the same node. + nodeHandled.put(tmNode, true); + + // check, whether a container rule is applied on the tmNode + Classifier tmCS = DepUtils.getClassifier(tmNode); + if (tmCS instanceof Class) { + // --------------------------- + EList hwRules = FCMUtil.getAllContainerRules(tmCS); + + if (hwRules.size() > 0) { + + ContainerTrafo nodeContainerTrafo = (ContainerTrafo) AbstractContainerTrafo.get((Class) tmCS); + + // issues + // - unlike SW component container, don't update references pointing towards the HW node + // - create additional part in system (top-level) component for the node container + // - container (_cc class) appears in platform component (same package as HW node) + // - port copying and creation of delegation connectors does not make much sense, creation of + // executor itself does not make much sense, additional operation "createHwContainer" + + // obtain property related to node instance + Package smCDP = smIS.getNearestPackage(); + DeploymentPlan smFCM_CDP = UMLUtil.getStereotypeApplication(smCDP, DeploymentPlan.class); + + if (nodeContainerTrafo == null) { + // container does not exist, check rules and create eventually + for (ContainerRule rule : hwRules) { + if (RuleManagement.isRuleActive(rule)) { + if (nodeContainerTrafo == null) { + // at least one active rule => create container (or get previously instantiated)) + nodeContainerTrafo = new ContainerTrafo(copy, tmCDP, tmIS); + nodeContainerTrafo.createHwContainer((Class) tmCS); + nodeContainerTrafo.applyRule(rule, smComponent, tmComponent); + } + } + } + } + if (nodeContainerTrafo != null) { + InstanceSpecification hwContainerIS = + nodeContainerTrafo.createHwContainerInstance(tmComponent, tmNode); + // now add attribute in system (obtain via classifier of main instance in smCDP) + if (smFCM_CDP != null) { + InstanceSpecification smMI = smFCM_CDP.getMainInstance(); + Classifier smSystem = DepUtils.getClassifier(smMI); + Classifier tmSystem = copy.getCopy(smSystem); + InstanceSpecification tmMI = DepUtils.getInstanceForClassifier(tmCDP, tmSystem); + if (tmSystem instanceof Class) { + Property hwcPart = + ((Class) tmSystem).createOwnedAttribute(smNode.getName() + HW_COMP_PREFIX, nodeContainerTrafo.getContainer()); + // and now create a slot for the created instance. + DepPlanUtils.createSlot(tmCDP, tmMI, hwContainerIS, hwcPart); + } + + // now allocate instance + AllocUtils.allocate(hwContainerIS, tmNode); + } + } + } + } + } + } // ------------------- end of container handling of HW nodes + + + // reread instName (may have been changed by container transformation). + instName = tmIS.getName(); + + // copy parts, i.e. referenced slots + // loop on instances (instead of parts), since reification needs to be + // based on used implementations. + for (Slot slot : smIS.getSlots()) { + if (slot.getDefiningFeature() == null) { + throw new TransformationException( + String.format(Messages.MainModelTrafo_NoDefiningFeature, smIS.getName())); + } + StructuralFeature smPartDF = slot.getDefiningFeature(); + if (StereotypeUtil.isApplied(smPartDF.getType(), InteractionComponent.class)) { + if (smPartDF instanceof Property) { + Property tmPart = ConnectorReification.reifyConnector(copy, tmComponent, (Property) smPartDF, tmIS); + // update value specification (to the one just created) + Type type = tmPart.getType(); + InstanceSpecification tmPartIS = EcoreUtil.copy(DepUtils.getInstance(slot)); + tmCDP.getPackagedElements().add(tmPartIS); + if (type instanceof Classifier) { + if (tmPartIS.getClassifiers().size() > 0) { + tmPartIS.getClassifiers().set(0, (Classifier) type); + } + } + DepCreation.createSlot(tmIS, tmPartIS, tmPart); + } + } + else if (smPartDF.getType() instanceof Class) { + + InstanceSpecification smPartIS = DepUtils.getInstance(slot); + if (smPartIS == null) { + throw new TransformationException( + String.format(Messages.MainModelTrafo_NoInstanceAssociated, smPartDF.getName())); + } + + // recursive reification + // returned instance specification in target model is an instance specification for the part + // or for a container for that part. + InstanceSpecification tmPartIS = transformInstance(smPartIS, smPartDF); + // AllocUtils.propagateNodesViaPort (tmPartIS, null, AllocUtils.getNodes(containedInstance)); + + // retrieve part in the target model (it has been created during + // the copyClassifier operation before) + // TODO: avoid cast (use StructuralFeature instead) + Property tmPart = (Property) copy.getCopy(smPartDF); + + // check whether the instance specification has been modified + // (due to a container transformation) + // modification would not be required, if + if ((tmPartIS != null) && (DepUtils.getClassifier(tmPartIS) != tmPart.getType())) { + Log.log(IStatus.INFO, Log.TRAFO_CONNECTOR, String.format(Messages.MainModelTrafo_ChangePartType, tmPart.getName())); + tmPart.setType(DepUtils.getClassifier(tmPartIS)); + } + DepCreation.createSlot(tmIS, tmPartIS, tmPart); + } else { + // assume primitive type, copy slot values + // don't use "copy" to avoid duplicate entries (since not all instance specification created + // before are correctly inserted into the map of "copy"). + Slot tmSlot = EcoreUtil.copy(slot); + tmSlot.setDefiningFeature(copy.getCopy(slot.getDefiningFeature())); + tmIS.getSlots().add(tmSlot); + } + + } + + // NamedElement socket = Utils.getQualifiedElement(smComponent.getModel(), "SocketRuntime::Socket"); + // NamedElement socketCopy = copy.getCopy(socket); + + // loop on connectors + // TODO: check, if true (no instance specification exists for these - unlike a connector which is explicitly specified via a part) + // TODO: quite inefficient (and likely wrong), if same composite is instantiated several times (re-reification of connectors) + for (Connector smConnector : smComponent.getOwnedConnectors()) { + if (StUtils.isConnector(smConnector)) { + org.eclipse.papyrus.FCM.Connector fcmConn = StUtils.getConnector(smConnector); + if (fcmConn != null) { + // found an Qompass connector, connector type is specified. + // => Reify the connector within the target component, i.e. create a new part and + // additional connections for it. + Property connectorPart = ConnectorReification.reifyConnector(copy, tmComponent, + UMLTool.varName(smConnector), smConnector, tmIS); + + if (connectorPart == null) { + continue; + } + + // remove simple connector from composite in target model + Connector tmConnector = copy.getCopy(smConnector); + tmConnector.destroy(); + + // Now create an instance specification for the reified connector + InstanceSpecification tmReifiedConnectorIS = DepCreation.createDepPlan( + tmCDP, (Class) connectorPart.getType(), + instName + "." + smConnector.getName(), false); //$NON-NLS-1$ + + // copy slots from the source deployment plan that are related to connector configuration + InstanceSpecification smConnectorIS = DepUtils.getNamedSubInstance(smIS, smConnector.getName()); + if (smConnectorIS != null) { + // use putPair instead of put only - see bug 426748, avoid that classifier attribute points + // to two classifiers (bound and unbound) + copy.putPair(smConnectorIS, tmReifiedConnectorIS); + // problem: the defining feature of the slot points to the original connector which we don't + // want to copy (would have to be done in context of template binding) + TemplateInstantiation ti = new TemplateInstantiation(copy, ConnectorReification.binding); + for (Slot smSlot : smConnectorIS.getSlots()) { + ti.bindElement(smSlot); + } + } + + Slot partSlot = + DepCreation.createSlot(tmIS, tmReifiedConnectorIS, connectorPart); + + ConnectorReification.propagateNodeAllocation(tmComponent, tmIS, partSlot); + } + } + } + /* + * for(Property part : smComponent.getOwnedAttributes()) { + * Type type = part.getType(); + * if(type != null) { + * if(StereotypeUtil.isApplied(type, InteractionComponent.class)) { + * ConnectorReification.reifyConnector(copy, tmComponent, part, tmIS, null); + * } + * } + * } + */ + + // needs to be called independently + // propagateNodeAllocation (cdp, compositeInstance); + AllocTransfo at = new AllocTransfo(); + at.transformAllocs(copy, tmComponent); + + if (containerIS != null) { + // return containerIS + return containerIS; + } else { + return tmIS; + } + } + + protected Map nodeHandled; + + /** + * Copier from source to target model + */ + protected LazyCopier copy; + + /** + * deployment plan within target model + */ + protected Package tmCDP; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/PrefixConstants.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/PrefixConstants.java new file mode 100644 index 00000000000..8cab7ddf4cf --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/PrefixConstants.java @@ -0,0 +1,57 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations; + +/** + * A set of constants used for the CIF. In particular prefixes for the operations + * to access the implementation of a provided interface and connect a required interface + * + */ +public class PrefixConstants { + + public static String getP_Prefix = "get_"; //$NON-NLS-1$ + + public static String getConnQ_Prefix = ""; //$NON-NLS-1$ + + public static String connectQ_Prefix = "connect_"; //$NON-NLS-1$ + + public static String attributePrefix = ""; //$NON-NLS-1$ + + enum CIFvariant { + UML, CCM + }; + + /** + * Initialize a specific CIF variant + * + * TODO currently unused + * + * @param cif + * Which CIF variant should used? + */ + void init(CIFvariant cif) { + if (cif == CIFvariant.UML) { + getP_Prefix = "get_"; //$NON-NLS-1$ + getConnQ_Prefix = ""; //$NON-NLS-1$ + connectQ_Prefix = "connect_"; //$NON-NLS-1$ + attributePrefix = ""; //$NON-NLS-1$ + } else if (cif == CIFvariant.CCM) { + getP_Prefix = "get_"; //$NON-NLS-1$ + getConnQ_Prefix = "getconnection_"; //$NON-NLS-1$ + connectQ_Prefix = "connect_"; //$NON-NLS-1$ + attributePrefix = "m_"; //$NON-NLS-1$ + } + } +}; diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/RuleManagement.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/RuleManagement.java new file mode 100644 index 00000000000..2692e06cb5a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/RuleManagement.java @@ -0,0 +1,32 @@ +package org.eclipse.papyrus.qompass.designer.core.transformations; + +import org.eclipse.papyrus.FCM.ConfigOption; +import org.eclipse.papyrus.FCM.Configuration; +import org.eclipse.papyrus.FCM.ContainerRule; + +public class RuleManagement { + private static Configuration m_config; + + public static void setConfiguration(Configuration config) { + m_config = config; + } + + /** + * check whether a rule is active in a given configuration + * + * @param aRule + * @return + */ + public static boolean isRuleActive(ContainerRule rule) { + if (m_config != null) { + for (ConfigOption option : m_config.getConfigOptions()) { + if (rule.getForConfig().contains(option)) { + return true; + } + } + } + // not already true via specific configuration. + // => Also turn on rules by default that are not for a specific configuration option + return (rule.getForConfig().size() == 0); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TrafoAndCodegenPackage.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TrafoAndCodegenPackage.java new file mode 100644 index 00000000000..9b68a2474e6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TrafoAndCodegenPackage.java @@ -0,0 +1,351 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations; + +import java.io.IOException; + +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.common.util.WrappedException; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.ContainerRuleKind; +import org.eclipse.papyrus.FCM.util.FCMUtil; +import org.eclipse.papyrus.codegen.extensionpoints.ILangCodegen; +import org.eclipse.papyrus.codegen.extensionpoints.ILangProjectSupport; +import org.eclipse.papyrus.codegen.extensionpoints.LanguageCodegen; +import org.eclipse.papyrus.codegen.extensionpoints.LanguageProjectSupport; +import org.eclipse.papyrus.qompass.designer.core.EnumService; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.ModelManagement; +import org.eclipse.papyrus.qompass.designer.core.StUtils; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.papyrus.qompass.designer.core.generate.GenerateCode; +import org.eclipse.papyrus.qompass.designer.core.transformations.container.LWContainerTrafo; +import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FilterTemplate; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Model; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.Profile; + +/** + * This class executes all transformations during the instantiation of a + * deployment plan, i.e. + * 1. The reification of connectors (including template instantiation). This transformation targets a new model + * 2. Adding get_p/connect_q operations to a class (transformation within same model) + * 3. Remove all component types + * 4. distribute to nodes + * + * @author ansgar + * + */ +public class TrafoAndCodegenPackage { + + /** + * Iterate over source model and apply transformation + * + * @param copy + * @param pkg + * @throws TransformationException + */ + public static void applyTrafo(LazyCopier copy, Package pkg) throws TransformationException { + EList peList = new BasicEList(); + peList.addAll(pkg.getPackagedElements()); + for (PackageableElement element : peList) { + if (element instanceof Package) { + applyTrafo(copy, (Package) element); + } + else if (element instanceof Class) { + + Class smImplementation = (Class) element; + Class tmImplementation = copy.getCopy(smImplementation); + + // get container trafo instance, if already existing + AbstractContainerTrafo containerTrafo = AbstractContainerTrafo.get(tmImplementation); + + // we may not apply the transformation to the boot-loader itself, in particular it would transform + // singletons into pointers. + EList rules = FCMUtil.getAllContainerRules(smImplementation); + for (ContainerRule rule : rules) { + // if(RuleManagement.isRuleActive(rule)) { + // at least one active rule => create container (or get previously instantiated)) + if (rule.getKind() == ContainerRuleKind.LIGHT_WEIGHT_OO_RULE) { + if (containerTrafo == null) { + // container does not exist yet, create + containerTrafo = new LWContainerTrafo(copy, null); + containerTrafo.createContainer(smImplementation, tmImplementation); + } + containerTrafo.applyRule(rule, smImplementation, tmImplementation); + } + } + // } + } + } + } + + /** + * Instantiate a deployment plan, i.e. generate an intermediate model via a sequence of transformations + * + * @param cdpOrConfig + * a deployment plan (UML package) or a configuration (UML class) + * @param monitor + * a progress monitor. + * + * @param project + * the current project. This information is used to store the intermediate model in + * a subfolder (tmpModel) of the current project + * @param genOptions + * select whether to produce an intermediate model only, also code, ... @see GenerationOptions + */ + public static void instantiate(Element cdpOrConfig, IProgressMonitor monitor, IProject project) { + if (project == null) { + String projectName = cdpOrConfig.eResource().getURI().toString(); + project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); + } + Model tmpModel = null; + ModelManagement tmpMM = null; + + Package selectedPkg; + if (cdpOrConfig instanceof Package) { + selectedPkg = (Package) cdpOrConfig; + RuleManagement.setConfiguration(null); + } + else { + return; + } + + try { + EnumService.init(); + // Package copyCDP = dt.getCopyCDT (selectedCDP); + + // -- calc # of steps for progress monitor + // 1 (tmpModel creation) + 1 (reification) + 1 (tmpModel save) + // 5x on each deployed node (see below) + // problem? Connector reification is a single, relatively long step + int steps = 3; + + monitor.beginTask(Messages.InstantiateDepPlan_InfoGeneratingModel, steps); + if (monitor.isCanceled()) { + return; + } + + // 1a: create a new model (and applies same profiles / imports) + Model existingModel = selectedPkg.getModel(); + TransformationContext.sourceRoot = existingModel; + tmpMM = createTargetModel(existingModel, monitor, existingModel.getName(), true); + tmpModel = tmpMM.getModel(); + // Declare that the new model is a derivedElement (kind of hack, since the source + // element (attribute of derive element) remains undefined). This is used to + // de-activate automatic transformations that should not be applied to the generated + // model. + monitor.worked(1); + if (monitor.isCanceled()) { + return; + } + + // LateEval.clear(); + + EnumService.createEnumPackage(tmpModel); + + LazyCopier tmpCopy = new LazyCopier(existingModel, tmpModel, false, true); + tmpCopy.preCopyListeners.add(FilterTemplate.getInstance()); + + // 1b: reify the connectors "into" the new model + monitor.subTask(Messages.InstantiateDepPlan_InfoExpandingConnectors); + + // obtain reference to CDP in target model + + AbstractContainerTrafo.init(); + monitor.worked(1); + + // create recursive copy of selectedPackage + tmpCopy.getCopy(selectedPkg); + + // apply container transformation + applyTrafo(tmpCopy, selectedPkg); + + // 1c: late bindings + // LateEval.bindLateOperations(); + // 3: distribute to nodes + + String tmpPath = tmpMM.getPath(project, InstantiateDepPlan.TEMP_MODEL_FOLDER, tmpModel.getName() + InstantiateDepPlan.TEMP_MODEL_POSTFIX); + tmpMM.saveModel(tmpPath); + + String targetLanguage = DepUtils.getLanguageFromPackage(selectedPkg); + if (targetLanguage == null) { + targetLanguage = "C++"; //$NON-NLS-1$ + } + // genProject = project + ModelManagement genMM = tmpMM; + IProject genProject = project; + ILangProjectSupport projectSupport = LanguageProjectSupport.getProjectSupport(targetLanguage); + ILangCodegen codegen = LanguageCodegen.getGenerator(targetLanguage); + + GenerateCode codeGen = new GenerateCode(genProject, codegen, genMM, monitor); + codeGen.generate(null, targetLanguage, false); + + genMM.dispose(); + + if (monitor.isCanceled()) { + return; + } + monitor.worked(1); + + } catch (TransformationException te) { + // Get UI thread to show dialog + final TransformationException teFinal = te; + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + Shell shell = Display.getDefault().getActiveShell(); + MessageDialog.openError(shell, Messages.InstantiateDepPlan_TransformationException, teFinal.getMessage()); + } + }); + Log.log(IStatus.ERROR, Log.DEPLOYMENT, "", teFinal); //$NON-NLS-1$ + } catch (Exception e) { + final Exception eFinal = e; + e.printStackTrace(); + Display.getDefault().syncExec(new Runnable() { + + @Override + public void run() { + Shell shell = Display.getDefault().getActiveShell(); + String msg = eFinal.toString() + "\n\n" + //$NON-NLS-1$ + Messages.InstantiateDepPlan_ConsultConsole; + MessageDialog.openError(shell, Messages.InstantiateDepPlan_ErrorsDuringTransformation, msg); + } + }); + Log.log(IStatus.ERROR, Log.DEPLOYMENT, "", e); //$NON-NLS-1$ + } + if (tmpMM != null) { + tmpMM.dispose(); + } + } + + + /** + * Create a new empty model from an existing model that applies the same + * profiles and has the same imports + * + * @param existingModel + * @return + */ + public static ModelManagement createTargetModel(Model existingModel, IProgressMonitor monitor, String name, boolean copyImports) throws TransformationException { + ModelManagement mm = new ModelManagement(); + Model newModel = mm.getModel(); + newModel.setName(name); + + try { + // copy profile application + for (Profile profile : existingModel.getAppliedProfiles()) { + // reload profile in resource of new model + monitor.subTask(Messages.InstantiateDepPlan_InfoApplyProfile + profile.getQualifiedName()); + + if (profile.eResource() == null) { + String profileName = profile.getQualifiedName(); + if (profileName == null) { + if (profile instanceof MinimalEObjectImpl.Container) { + URI uri = ((MinimalEObjectImpl.Container) profile).eProxyURI(); + if (uri != null) { + throw new TransformationException(String.format(Messages.InstantiateDepPlan_CheckInputModelProfileNoRes, uri)); + } + } + throw new TransformationException(Messages.InstantiateDepPlan_CheckInputModelProfileNoResNoName); + } + throw new TransformationException(String.format(Messages.InstantiateDepPlan_CheckInputModelProfile3, profileName)); + } + + Resource profileResource = null; + try { + profileResource = ModelManagement.getResourceSet().getResource(profile.eResource().getURI(), true); + } catch (WrappedException e) { + // read 2nd time (some diagnostic errors are raised only once) + Log.log(IStatus.WARNING, Log.DEPLOYMENT, "Warning: exception in profile.eResource() " + e.getMessage()); //$NON-NLS-1$ + profileResource = ModelManagement.getResourceSet().getResource(profile.eResource().getURI(), true); + } + Profile newProfileTop = (Profile) profileResource.getContents().get(0); + Profile newProfile; + String qname = profile.getQualifiedName(); + if ((qname != null) && qname.contains("::")) { //$NON-NLS-1$ + // profile is a sub-profile within same resource + // TODO: should Copy class copy profile applications? + // Should be handled in shallowContainer class. + // if we put profile/newProfile pair into copy map, copy would find (and copy profile + // applications in sub-folders + qname = qname.substring(qname.indexOf("::") + 2); //$NON-NLS-1$ + newProfile = (Profile) Utils.getQualifiedElement(newProfileTop, qname); + } + else { + newProfile = newProfileTop; + } + newProfile.getMember("dummy"); // force profile loading //$NON-NLS-1$ + newModel.applyProfile(newProfile); + } + } catch (IllegalArgumentException e) { + throw new TransformationException(Messages.InstantiateDepPlan_IllegalArgumentDuringCopy + e.toString()); + } + + // copy imports (and load resources associated - TODO: might not be necessary) + // While this is useful in general, it implies that code for imported models + // has been generated and compiled (for the right target) into a library. This may be + // quite tedious, unless automatically managed. + // Therefore we do not activate this option in a first pass of the model transformations. + if (copyImports) { + for (Package importedPackage : existingModel.getImportedPackages()) { + if (importedPackage == null) { + throw new TransformationException(Messages.InstantiateDepPlan_CheckInputImportPkg); + } + if (importedPackage.eResource() == null) { + String errorMsg = Messages.InstantiateDepPlan_CheckInputImportPkgNoRes; + if (importedPackage instanceof MinimalEObjectImpl.Container) { + URI uri = ((MinimalEObjectImpl.Container) importedPackage).eProxyURI(); + if (uri != null) { + errorMsg += " - URI: " + uri.devicePath(); //$NON-NLS-1$ + } + } + throw new TransformationException(errorMsg); + } + newModel.createPackageImport(importedPackage); + monitor.subTask(String.format(Messages.InstantiateDepPlan_InfoImportPackage, importedPackage.getName())); + + try { + importedPackage.eResource().load(null); + newModel.getMember("dummy"); // force loading of model //$NON-NLS-1$ + } catch (IOException e) { + throw new TransformationException(e.getMessage()); + } + + } + } + + StUtils.copyStereotypes(existingModel, newModel); + + return mm; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationContext.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationContext.java new file mode 100644 index 00000000000..81f1b2a6bea --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationContext.java @@ -0,0 +1,106 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations; + +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateInstantiation; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.TemplateBinding; + +/** + * Return information about the current values in the context of a transformation + * e.g. the current instance, the current port (container transformation), ... + * + * TODO: clean separation ContainerContext? (e.g. port should only be in the latter) + * + * @author ansgar + * + */ +public class TransformationContext { + + public static InstanceSpecification instance; + + public static InstanceSpecification getInstance() { + return instance; + } + + public static Port port; + + public static Port getPort() { + return port; + } + + public static Package sourceRoot; + + public static Package getSourceRoot() { + return sourceRoot; + } + + public static LazyCopier copier; + + public static LazyCopier getCopier() { + return copier; + }; + + public static Classifier formalParameter; + + public static Classifier getFormalParameter() { + return formalParameter; + } + + // the element, to which transformations are currently applied. + public static Classifier classifier; + + public static Classifier getClassifier() { + return classifier; + } + + /** + * Set sat and binding context for pkgTemplateParameter function + * + * @param sat + * @param binding + */ + public static void setTemplateInstantiation(TemplateInstantiation ti) { + TransformationContext.ti = ti; + } + + public static TemplateInstantiation ti; + + /** + * Return actual (in the current binding context) from a named package template parameter + * Used during template instantiation: code can access actual template parameter via formal + * + * @param formal + * the name of the formal parameter + * @return the actual + */ + public static String pkgTemplateParameter(String formal) { + Classifier actual = TemplateUtils.getActualFromBinding(ti.binding, formal); + if (actual != null) { + return actual.getQualifiedName(); + } + else { + return ""; //$NON-NLS-1$ + } + } + + public static TemplateBinding getBinding() { + return ti.binding; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationException.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationException.java new file mode 100644 index 00000000000..b0331d9e98a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationException.java @@ -0,0 +1,28 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations; + +/** + * Main exception class that is used to represent errors during model transformations + */ +public class TransformationException extends Exception { + + public TransformationException(String reason) { + super(reason); + } + + // String m_reason; + final static long serialVersionUID = 1234; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationRTException.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationRTException.java new file mode 100644 index 00000000000..776cd6b3239 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationRTException.java @@ -0,0 +1,33 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations; + +/** + * Variant of the transformation exception that extends RuntimeException. This + * is sometimes useful, since it avoids to declare exceptions specifically + * + */ +public class TransformationRTException extends RuntimeException { + + public TransformationRTException(String reason) { + super(reason); + } + + /** + * + */ + private static final long serialVersionUID = 1235L; + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationUtil.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationUtil.java new file mode 100644 index 00000000000..d696183686e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/TransformationUtil.java @@ -0,0 +1,81 @@ +package org.eclipse.papyrus.qompass.designer.core.transformations; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.UniqueEList; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.papyrus.qompass.designer.core.extensions.InstanceConfigurator; +import org.eclipse.papyrus.qompass.designer.core.sync.CompImplSync; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; + +public class TransformationUtil { + public static void applyInstanceConfigurators(InstanceSpecification instance) { + for (Slot slot : instance.getSlots()) { + InstanceSpecification subInstance = DepUtils.getInstance(slot); + if (!DepUtils.isShared(slot) && (subInstance != null)) { + if (slot.getDefiningFeature() instanceof Property) { + InstanceConfigurator.configureInstance(subInstance, (Property) slot.getDefiningFeature(), instance); + } + applyInstanceConfigurators(subInstance); + } + } + } + + public static void propagateAllocation(InstanceSpecification instance) { + propagateAllocation(instance, new UniqueEList()); + } + + public static void propagateAllocation(InstanceSpecification instance, EList nodes) { + // create copy of node (otherwise, more and more nodes get aggregated. + UniqueEList nodesCopy = new UniqueEList(); + nodesCopy.addAll(nodes); + nodesCopy.addAll(AllocUtils.getNodes(instance)); + for (Slot slot : instance.getSlots()) { + InstanceSpecification subInstance = DepUtils.getInstance(slot); + if (subInstance != null) { + if (DepUtils.isShared(slot)) { + for (InstanceSpecification node : nodesCopy) { + Log.log(IStatus.INFO, Log.DEPLOYMENT, String.format("Propagate node allocation: %s to %s", subInstance.getName(), node.getName())); //$NON-NLS-1$ + AllocUtils.allocate(subInstance, node); + } + } + else { + propagateAllocation(subInstance, nodesCopy); + } + } + } + } + + /** + * Update derived interfaces of ports. This is required, since the Copier does not follow references + * that are referenced via a derived attribute. Derived attributes are used for provided and required + * interfaces in the stereotype attributes of an FCM port. Thus, required (derived) interfaces would be + * unavailable in the copy, if not explicitly updated. + * However, the provided interface is not concerned as it appears in an "implements" relation. If the + * port is connected, the used interface of one port is the provided interface of the port counter part. + * Thus, the explicit update done by this function is not needed in most cases. + * + * see also FixTemplateSync (remove the latter?) + */ + public static void updateDerivedInterfaces(InstanceSpecification instance) { + Classifier cl = DepUtils.getClassifier(instance); + if (cl instanceof Class) { + Class implementation = (Class) cl; + CompImplSync.updatePorts(implementation); + CompImplSync.syncRealizations(implementation); + } + for (Slot slot : instance.getSlots()) { + InstanceSpecification subInstance = DepUtils.getInstance(slot); + if (!DepUtils.isShared(slot) && (subInstance != null)) { + updateDerivedInterfaces(subInstance); + } + } + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/UpdateUtils.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/UpdateUtils.java new file mode 100644 index 00000000000..cdf8175be25 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/UpdateUtils.java @@ -0,0 +1,84 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations; + +import java.util.Iterator; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Utility functions for the update derived elements, e.g. operations of a component + * that depend on the operations of an interface that is offered by the component. + */ +public class UpdateUtils { + + public static EList getDerivedElements(Package pkg, NamedElement source) { + EList list = new BasicEList(); + Iterator members = pkg.getOwnedMembers().iterator(); + while (members.hasNext()) { + NamedElement member = members.next(); + if (getSource(member) == source) { + list.add(member); + } + if (member instanceof Package) { + EList subList = getDerivedElements((Package) member, source); + list.addAll(subList); + } + } + return list; + } + + public static Element getDerivedElement(EList list, Element source) { + Iterator elements = list.iterator(); + while (elements.hasNext()) { + Element element = elements.next(); + if (StereotypeUtil.isApplied(element, DerivedElement.class)) { + DerivedElement de = UMLUtil.getStereotypeApplication(element, DerivedElement.class); + if ((de != null) && (de.getSource() == source)) { + return element; + } + } + } + return null; + } + + public static void setSource(Element derivedElement, Element source) { + DerivedElement de = StereotypeUtil.applyApp(derivedElement, DerivedElement.class); + if (de != null) { + de.setSource(source); + } + else { + throw new TransformationRTException(Messages.UpdateUtils_CannotApplyFCMstereo); + } + } + + public static Element getSource(Element element) { + if (StereotypeUtil.isApplied(element, DerivedElement.class)) { + DerivedElement de = UMLUtil.getStereotypeApplication(element, DerivedElement.class); + if (de != null) { + return de.getSource(); + } + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/connector/ConnectorReification.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/connector/ConnectorReification.java new file mode 100644 index 00000000000..14511d3627f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/connector/ConnectorReification.java @@ -0,0 +1,400 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations.connector; + +/** + * This file is part of Qompass GenTools + * Copyright (C) 2008 CEA LIST (http://www-list.cea.fr/) + + * initial developer : Christophe JOUVRAY from CEA LIST + * Major contributions: Ansgar Radermacher from CEA LIST + */ + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.infra.core.Activator; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.PortUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.papyrus.qompass.designer.core.templates.ConnectorBinding; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateInstantiation; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.ConnectorEnd; +import org.eclipse.uml2.uml.EncapsulatedClassifier; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * This class enables the reification of connectors, i.e. the replacement of + * a UML connector with an interaction component. Reification is primarily + * done on the level of a composite class, the + */ +public class ConnectorReification { + + /** + * Find a port that would match a connection + * + * @param connectorType + * a connector type, i.e. a component with ports + * @param the + * port on the other side of the connection + * @return the first port (of all ports owned or inherited by the type) that + * is compatible with the passed otherPort. + */ + public static Port getConnectorPort(EncapsulatedClassifier connectorType, + Port otherPort, boolean isAssembly) { + EList ports = PortUtils.getAllPorts(connectorType); + // try to find matching port + for (Port port : ports) { + if (PortUtils.isCompatible(port, otherPort, isAssembly)) { + return port; + } + } + throw new RuntimeException(String.format(Messages.ConnectorReification_CannotFindMatchingPort, + connectorType.getName(), otherPort.getQualifiedName())); + } + + /** + * Reify a connector already represented in form of a part (useful for n-ary connectors) + * + * @param copier + * a lazy copier + * @param tmComponent + * containing composite in target target model + * @param smConnectorPart + * Part representing the connector + * @param tmIS + * target instance specification of the composite passed as 2nd parameter + * (required for obtaining node allocation and choosing the right implementation. + * Main use: decide whether a distributed implementation of an interaction component needs to be used) + * @return The created part within tmComponent that represents the reified + * connector + * @throws TransformationException + */ + public static Property reifyConnector(LazyCopier copier, Class tmComponent, + Property smConnectorPart, InstanceSpecification tmIS) + throws TransformationException { + + if (!(smConnectorPart.getType() instanceof Class)) { + // can not happen since caller checks whether type is stereotyped as ConnectorComp + // which extends class + Log.log(IStatus.ERROR, Log.TRAFO_CONNECTOR, Messages.ConnectorReification_TemplateTypeNotClass); + return null; + } + // choose an implementation + Class connectorImplemTemplate = DepUtils.chooseImplementation( + (Class) smConnectorPart.getType(), AllocUtils.getAllNodes(tmIS), null); + + TemplateBinding binding = ConnectorBinding.obtainBinding(tmComponent, + smConnectorPart, connectorImplemTemplate, true); + Class connectorImplem; + + if (binding != null) { + TemplateUtils.adaptActualsToTargetModel(copier, binding); + TemplateInstantiation ti = new TemplateInstantiation(copier, binding); + connectorImplem = ti.bindElement(connectorImplemTemplate); + } else { + // no binding, class is not a template => copy as it is + connectorImplem = copier.getCopy(connectorImplemTemplate); + } + Property tmConnectorPart = copier.getCopy(smConnectorPart); + tmConnectorPart.setType(connectorImplem); + // now re-target connectors towards this part + TemplateUtils.retargetConnectors(tmComponent, tmConnectorPart); + return tmConnectorPart; + } + + /** + * Reify a connector + * + * @param copier + * The coper from source to target mode + * @param tmComponent + * containing composite in target target + * @param name + * name of the connector + * @param smConnector + * connector element within the source model + * @param tmIS + * target instance specification of the composite passed as 2nd parameter + * (required for obtaining node allocation and choosing the right implementation. + * Main use: decide whether a distributed implementation of an interaction component needs to be used) + * @return the created part within tmComponent + * @throws TransformationException + */ + public static Property reifyConnector(LazyCopier copier, Class tmComponent, + String name, Connector smConnector, InstanceSpecification tmIS) + throws TransformationException { + + org.eclipse.papyrus.FCM.Connector fcmConn = UMLUtil.getStereotypeApplication(smConnector, org.eclipse.papyrus.FCM.Connector.class); + + InteractionComponent connType = fcmConn.getIc(); + if (connType == null) { + return null; + } + + // choose an implementation + Class connectorImplemTemplate = DepUtils.chooseImplementation(connType.getBase_Class(), AllocUtils.getAllNodes(tmIS), null); + + // ---- obtain binding & instantiate template type ... + binding = ConnectorBinding.obtainBinding(tmComponent, + smConnector, connectorImplemTemplate, true); + Class connectorImplem; + + if (binding != null) { + TemplateUtils.adaptActualsToTargetModel(copier, binding); + // make copy of bound package and restore it later. Required for nested template instantiations, in particular + // the bound package is set within container transformations and is (by default) restored to "null" afterwards. + // TODO: TemplateInstantiation should do this automatically + copier.pushPackageTemplate(); + TemplateInstantiation ti = new TemplateInstantiation(copier, binding); + connectorImplem = ti.bindElement(connectorImplemTemplate); + copier.popPackageTemplate(); + } else { + // no binding, class is not a template => copy as it is + connectorImplem = copier.getCopy(connectorImplemTemplate); + } + + if (connectorImplem == null) { + throw new TransformationException( + String.format(Messages.ConnectorReification_CouldNotBind, connectorImplemTemplate.getName())); + } + + Property tmConnectorPart = tmComponent.createOwnedAttribute(name, connectorImplemTemplate); + // copy id, but prefix it with "p" (for part) + LazyCopier.copyID(smConnector, tmConnectorPart, "p"); //$NON-NLS-1$ + tmConnectorPart.setIsComposite(true); + + Log.log(IStatus.INFO, Log.TRAFO_CONNECTOR, + String.format(Messages.ConnectorReification_InfoAddConnectorPart, + connectorImplemTemplate.getName(), connectorImplem.getName())); + + // now create (simple) connections towards the new part + int i = 0; + for (ConnectorEnd smEnd : smConnector.getEnds()) { + Connector tmConnector = tmComponent.createOwnedConnector("c " //$NON-NLS-1$ + + name + " " + String.valueOf(i)); //$NON-NLS-1$ + LazyCopier.copyID(smConnector, tmConnector); + i++; + // the new connector connects the existing end with an end of the + // reified connector (the newly created property.) + + // --- first end, connected with the existing end (of another non-connector part) + ConnectorEnd tmEnd1 = tmConnector.createEnd(); + Property smPartWithPort = smEnd.getPartWithPort(); + Property tmPartWithPort = copier.getCopy(smPartWithPort); + ConnectableElement smRole = smEnd.getRole(); + ConnectableElement tmRole = copier.getCopy(smRole); + tmEnd1.setPartWithPort(tmPartWithPort); + tmEnd1.setRole(tmRole); + + // --- 2nd end, connected with the reified connector (new part) + ConnectorEnd tmEnd2 = tmConnector.createEnd(); + tmEnd2.setPartWithPort(tmConnectorPart); + // inheritance between connector type and implementation (ports should be identical) + // TODO: check whether filter condition is unique? (first returned by getConnectorPort is "good" one) + if (tmRole instanceof Port) { + tmEnd2.setRole(getConnectorPort(connectorImplem, (Port) tmRole, (tmPartWithPort != null))); + } else { + throw new TransformationException( + Messages.ConnectorReification_RequiresUseOfPorts); + } + } + + tmConnectorPart.setType(connectorImplem); + // updatePorts(tmComponent, connectorPart, connectorImplem); + // connectContainerPorts(tmComponent, connectorPart); + + return tmConnectorPart; + } + + public static TemplateBinding binding; + + /** + * Simple helper function + * + * @param part + * @param connection + * @return the connector end that is associated with the "other" end of a + * connection, i.e. the end that is not connected with the part + * passed as parameter. + */ + public static ConnectorEnd oppositeConnEnd(Connector connection, + ConnectorEnd myEnd) { + // look for the other end (connectedEnd != myEnd) + for (ConnectorEnd end : connection.getEnds()) { + if (end != myEnd) { + return end; + } + } + return null; + } + + /** + * Components can contain additional ports that are inherited via the + * container extension. These ports should typically be connected with + * additional ports of the (reified) connector. This connection is based on + * equal port types and is done automatically by this function, i.e. it + * cannot be done by the developer. + * + * @param composite + * the composite in which a connector has been reified. + * @param reifiedConnector + * the part associated with the reifiedConnector + */ + static void connectContainerPorts(Class composite, Property reifiedConnector) { + // This function is based on the assumption that the additional ports of the reified + // connector need to be connected with a port of a component that is already + // connected via the "normal" connectors (explicitly modeled by the user). + // For instance, in case of ACCORD-calls, the server component provides the additional + // RTU port via its container. + + // Create a subset of connectors that are connected with the reified connector + EList connSubset = new BasicEList(); + for (Connector connector : composite.getOwnedConnectors()) { + if (ConnectorUtil.connectsPart(connector, reifiedConnector)) { + connSubset.add(connector); + } + } + + for (Port port : PortUtils.getAllPorts((Class) reifiedConnector + .getType())) { + // check, if port is unconnected. + boolean connected = false; + // check whether a port of the reified connector is not yet + // connected. + for (Connector connector : connSubset) { + if (ConnectorUtil.connectsPort(connector, port)) { + connected = true; + } + } + if (!connected) { + // port is not connected yet. Check to find a connectable port + // among all ports of connected parts. + // In the moment, we assume the processes is stopped, as soon as + // the port is connected, i.e. we do not want to connect the port to + // potentially set of ports (todo: restriction always useful?) + for (Connector connector : connSubset) { + ConnectorEnd connEnd = ConnectorUtil.connEndNotPart( + connector, reifiedConnector); + Property otherPart = connEnd.getPartWithPort(); + // this is a part which is connected with the reified + // connector check whether one of its ports is compatible with the + // non-connected port. + if (!(otherPart.getType() instanceof EncapsulatedClassifier)) { + continue; + } + + for (Port otherPort : PortUtils.getAllPorts((EncapsulatedClassifier) otherPart.getType())) { + Log.log(IStatus.INFO, Log.TRAFO_CONNECTOR, String.format( + Messages.ConnectorReification_InfoPortTypes, + otherPort.getType().getQualifiedName(), + port.getType().getQualifiedName())); + if (otherPort.getType() == port.getType()) { + Connector newConnector = composite.createOwnedConnector("connector - container of " //$NON-NLS-1$ + + otherPart.getName()); + ConnectorEnd end1 = newConnector.createEnd(); + ConnectorEnd end2 = newConnector.createEnd(); + end1.setPartWithPort(reifiedConnector); + end1.setRole(port); + end2.setPartWithPort(otherPart); + end2.setRole(otherPort); + connected = true; + break; + } + } + if (connected) { + break; + } + } + if (!connected) { + if (port.getType() == null) { + Activator.log.debug( + String.format(Messages.ConnectorReification_CouldNotConnectPort, port.getName())); + } else { + Activator.log.debug( + String.format(Messages.ConnectorReification_CouldNotConnectPortOfType, port.getName(), port.getType().getName())); + } + } + } + } + } + + /** + * Propagate node allocation into a reified connector (identified via its part) + * + * The allocation algorithm works as follows. + * - get a connector (simple) originating from the passed part + * - get the opposite end of this simple connector and identify the connected part + * (other part, e.g. a part typed with an application component) + * - obtain the nodes to which this other part is allocated: + * - in case of a composite, connections are followed up to a monolithic component + * - propagate the node allocation into the connector (propagation will finally + * allocate leafs within a (composite) connector. + * + * @param composite + * the composite class (e.g. system) in which a connector is reified + * @param compositeIS + * the associated instance specification + * @param partSlot + * the slot associated with the part for which nodes are + * allocated. + */ + public static void propagateNodeAllocation(Class composite, + InstanceSpecification compositeIS, Slot partSlot) { + Property part = (Property) partSlot.getDefiningFeature(); + + // loop over connectors of composite that originate from passed part. + for (Connector connector : composite.getOwnedConnectors()) { + ConnectorEnd myEnd = ConnectorUtil.connEndForPart(connector, part); + if (myEnd == null) { + // the connector does not connect this part + continue; + } + ConnectorEnd otherEnd = ConnectorUtil.connEndNotPart(connector, + part); + + Property otherPart = otherEnd.getPartWithPort(); + Port otherPort = (Port) otherEnd.getRole(); + // Property myPart = myEnd.getPartWithPort(); + Port myPort = (Port) myEnd.getRole(); + + // find instance that is associated with other part. + for (Slot slot : compositeIS.getSlots()) { + if (slot.getDefiningFeature() == otherPart) { + InstanceSpecification containedInstance = DepUtils.getInstance(slot); + EList nodes = AllocUtils.getAllNodesForPort(containedInstance, otherPort); + AllocUtils.propagateNodesViaPort( + DepUtils.getInstance(partSlot), myPort, nodes); + break; + } + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/container/ContainerTrafo.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/container/ContainerTrafo.java new file mode 100644 index 00000000000..927dee07143 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/container/ContainerTrafo.java @@ -0,0 +1,770 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations.container; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.papyrus.FCM.BindTemplate; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.ContainerRuleKind; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.FCM.InterceptionKind; +import org.eclipse.papyrus.FCM.InterceptionRule; +import org.eclipse.papyrus.FCM.Singleton; +import org.eclipse.papyrus.FCM.util.FCMUtil; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.PortUtils; +import org.eclipse.papyrus.qompass.designer.core.StUtils; +import org.eclipse.papyrus.qompass.designer.core.UMLTool; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateInstantiation; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; +import org.eclipse.papyrus.qompass.designer.core.transformations.AbstractContainerTrafo; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.RuleManagement; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.qompass.designer.core.transformations.connector.ConnectorReification; +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Association; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.ConnectorEnd; +import org.eclipse.uml2.uml.EncapsulatedClassifier; +import org.eclipse.uml2.uml.Feature; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.TemplateParameter; +import org.eclipse.uml2.uml.TemplateSignature; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.ValueSpecification; +import org.eclipse.uml2.uml.VisibilityKind; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Make the container transformation, i.e. add elements into a container + * + */ +public class ContainerTrafo extends AbstractContainerTrafo { + + public static final String executorPartName = "_executor"; //$NON-NLS-1$ + + public static final String interceptorName = "intercept "; //$NON-NLS-1$ + + public static final String containerPostfix = "_cc"; //$NON-NLS-1$ + + public static final String hwContainerPostfix = "_hwcc"; //$NON-NLS-1$ + + /** + * Constructor + * + * @param sat + * information about source and target model + * @param tmCDP + * deployment plan within target model + */ + public ContainerTrafo(LazyCopier copier, Package tmCDP, InstanceSpecification executorIS) { + this.copier = copier; + this.tmCDP = tmCDP; + this.executorIS = executorIS; + portInfo = new HashMap(); + } + + /** + * creates the executor. Needs to be called *before* the other operations of + * this class. + * + * @param tmComponent + * the implementation of a component + * + * @throws TransformationException + */ + @Override + public void createContainer(Class smComponent, Class tmComponent) throws TransformationException { + Package tmPkgOwner; + if (tmComponent.eResource() == tmCDP.eResource()) { + // tmComponent is in same model as tmContainer + tmPkgOwner = tmComponent.getNearestPackage(); + } + else { + // tmComponent is not a member of the target model. This is the case, if tmComponent is + // in an imported model that has not been copied during the transformation towards an intermediate + // model. + tmPkgOwner = MapUtil.getAndCreate(PackageUtil.getRootPackage(tmCDP), tmComponent.allNamespaces(), true); + } + // create a container with the suitable postfix + tmContainerImpl = tmPkgOwner.createOwnedClass(tmComponent.getName() + containerPostfix, false); + + // Apply singleton to container, if original class is a singleton + boolean isSingleton = StereotypeUtil.isApplied(smComponent, Singleton.class); + if (isSingleton) { + StereotypeUtil.apply(tmContainerImpl, Singleton.class); + } + LazyCopier.copyID(tmComponent, tmContainerImpl, containerPostfix); + + // add part and slot corresponding to component; + executorPart = tmContainerImpl.createOwnedAttribute(executorPartName, tmComponent); + LazyCopier.copyID(tmComponent, executorPart, "e"); //$NON-NLS-1$ + + executorPart.setIsComposite(true); + + // copy ports from the executor (tmComponent) to the container + // (tmContainerImpl) + // TODO: connectors still point to the ports of the executor, implying a non-well-formed + // model. Yet code generation works, as port names are identical + for (Port port : PortUtils.getAllPorts(tmComponent)) { + // copy port + if (port.getVisibility() == VisibilityKind.PUBLIC_LITERAL) { + Port newPort = EcoreUtil.copy(port); // don't use Qompass copy, since this is not a copy from source to target model + tmContainerImpl.getOwnedAttributes().add(newPort); + StUtils.copyStereotypes(port, newPort); + + // create delegation for application port + Connector containerDelegation = tmContainerImpl.createOwnedConnector("delegation " + port.getName()); //$NON-NLS-1$ + LazyCopier.copyID(tmContainerImpl, containerDelegation); + ConnectorEnd end1 = containerDelegation.createEnd(); + end1.setRole(newPort); + ConnectorEnd end2 = containerDelegation.createEnd(); + end2.setPartWithPort(executorPart); + end2.setRole(port); + } + } + + // Inheritance issues: + // currently: container never copies inheritance relationships, but copies inherited ports into container + // Problem: polymorphism would stop working. + // Objective: use inheritance, if possible, but avoid that container inherits from an original non-abstract class (avoid duplication of attributes, ...) + // Option: container inherits from fully abstract super-classes (might have to consider indirect super-classes). + // All connectors and container extension remain within container (i.e. no inheritance of connectors and container extensions) + // Remaining problems: Imagine that component A inherits from component B and both have state-charts. + // => containers of A and B would define a state-Machine and an event pool. + // => No shared pool (but anyway: semantics of this construct is not very clear). + containers.put(tmComponent, this); + } + + /** + * Create a container for a HW class. This is an additional software class + * within the system. There is no executor part, i.e. executorPart remains + * + * @param tmComponent + * the implementation of a component + * + * @throws TransformationException + */ + public void createHwContainer(Class tmComponent) throws TransformationException { + Package tmPkgOwner = (Package) tmComponent.getOwner(); + tmContainerImpl = tmPkgOwner.createOwnedClass(tmComponent.getName() + hwContainerPostfix, false); + LazyCopier.copyID(tmComponent, tmContainerImpl, hwContainerPostfix); + + // register created container + containers.put(tmComponent, this); + } + + /** + * Create an instance of the container (UML instance specification) + * + * @param tmComponent + * the component within the target model for which we want to create an instance + * + * @param tmIS + * the existing instance specification for the component before container expansion. This + * instance specification becomes the new instance specification of the executor. + * @param context + * Additional information about the container that is used by instance configurators + */ + @Override + public InstanceSpecification createContainerInstance(Class tmComponent, InstanceSpecification tmIS) throws TransformationException { + // create an instance specification for the container + InstanceSpecification containerIS = + (InstanceSpecification) tmCDP.createPackagedElement(tmIS.getName(), UMLPackage.eINSTANCE.getInstanceSpecification()); + // assign new name to original instance specification which reflects + // role within containment hierarchy + tmIS.setName(tmIS.getName() + "." + executorPartName); //$NON-NLS-1$ + containerIS.getClassifiers().add(tmContainerImpl); + // existing instance specification (tmIS) is the executor instance specification + DepCreation.createSlot(containerIS, tmIS, executorPart); + counter = 0; + // containers.put(tmComponent, this); + EList connectorSlots = new BasicEList(); + + executorIS = tmIS; + // now create instances for the contained elements + for (Property extensionPart : tmContainerImpl.getAttributes()) { + Type tmContainerExtImpl = extensionPart.getType(); + if (tmContainerExtImpl instanceof Class) { + if (DepUtils.getSlot(containerIS, extensionPart) == null) { + // no slot for part exists => assume that the part has been added by the container and create an instance specification for it. + InstanceSpecification containerExtIS = null; + + String isName = containerIS.getName() + "." + extensionPart.getName(); //$NON-NLS-1$ + + // create sub-instance and slot for extensions + if (containerExtIS == null) { + containerExtIS = DepCreation.createDepPlan(tmCDP, (Class) tmContainerExtImpl, isName, false); + } + Slot partSlot = DepCreation.createSlot(containerIS, containerExtIS, extensionPart); + if (StereotypeUtil.isApplied(tmContainerExtImpl, InteractionComponent.class)) { + connectorSlots.add(partSlot); + } + } + } + } + + // handle propagation of node allocation for connectors. Do that in 2nd loop, since the allocation + // of parts might be incomplete before. + for (Slot connectorSlot : connectorSlots) { + ConnectorReification.propagateNodeAllocation(tmContainerImpl, containerIS, connectorSlot); + } + moveSlots(executorIS); + return containerIS; + } + + /** + * Create an instance of the container (UML instance specification) + * + * @param tmComponent + * @param tmIS + */ + public InstanceSpecification createHwContainerInstance(Class tmComponent, InstanceSpecification tmNode) { + // create an instance specification for the container + InstanceSpecification containerIS = + (InstanceSpecification) tmCDP.createPackagedElement(tmNode.getName() + hwContainerPostfix, UMLPackage.eINSTANCE.getInstanceSpecification()); + // assign new name to original instance specification which reflects + // role within containment hierarchy + containerIS.getClassifiers().add(tmContainerImpl); + // containers.put(tmComponent, this); + counter = 0; + executorIS = tmNode; + // copy slots from HW instance specification + for (Slot slot : tmNode.getSlots()) { + Slot slotCopy = containerIS.createSlot(); + slotCopy.setDefiningFeature(slot.getDefiningFeature()); + // copy values (use CopyTo.copyTo(slot, containerIS) instead?) + for (ValueSpecification value : slot.getValues()) { + LazyCopier.copyValue(value, slotCopy); + } + } + return containerIS; + } + + /** + * return the reference of the created container class + * + * @return + */ + public Class getContainer() { + return tmContainerImpl; + } + + /** + * apply a container rule, i.e. add either a container extension or an + * interceptor to the container + * + * @param smContainerRule + * An container rule + * @param smComponent + * the application component in the source model + * @param tmComponent + * the application component in the target model + * @param tmIS + * the instance specification for the application component in the target model + * @throws TransformationException + */ + @Override + public void applyRule(ContainerRule smContainerRule, Class smComponent, Class tmComponent) + throws TransformationException + { + Map> interceptorPartsMap = new HashMap>(); + + for (Property part : smContainerRule.getBase_Class().getAllAttributes()) { + Type type = part.getType(); + if (type == null) { + String ruleName = (smContainerRule.getBase_Class() != null) ? smContainerRule.getBase_Class().getName() : "undefined"; //$NON-NLS-1$ + throw new TransformationException(String.format( + Messages.ContainerTrafo_CannotApplyRule, ruleName)); + } + if (part instanceof Port) { + Port newPort = tmContainerImpl.createOwnedPort(part.getName(), part.getType()); + StUtils.copyStereotypes(part, newPort); + } + else if (type instanceof Class) { + Class extOrInterceptor = (Class) type; + // DepUtils.chooseImplementation((Class) type, + // new BasicEList(), false); + + if (StereotypeUtil.isApplied(part, InterceptionRule.class)) { + if (StereotypeUtil.isApplied(extOrInterceptor, InteractionComponent.class)) { + + InterceptionRule interceptionRule = UMLUtil.getStereotypeApplication(part, InterceptionRule.class); + InterceptionKind interceptionKind = interceptionRule.getInterceptionKind(); + EList interceptFeatures = interceptionRule.getInterceptionSet(); + EList interceptorParts = + expandInterceptorExtension(interceptionKind, interceptFeatures, extOrInterceptor, tmComponent); + interceptorPartsMap.put(part, interceptorParts); + } + else { + throw new TransformationException(String.format( + Messages.ContainerTrafo_InterceptionRuleButNoInterceptor, + part.getName(), smContainerRule.getBase_Class().getName())); + } + } + else { + Property extensionPart = + expandAggregationExtension(part, extOrInterceptor, tmComponent); + // register relation to facilitate connector copy + copier.setPackageTemplate(smContainerRule.getBase_Class(), tmContainerImpl); + copier.putPair(part, extensionPart); + copier.setPackageTemplate(null, null); + } + } + } + createConnectorForAssociations(); + + // tell copier that tmcontainerImpl is associated with the smContainerRule + // register a package template (although it is not a template) to assure that the connectors + // get copied, although they are in a different resource (only the connectors are copied, not + // the types of the referenced parts). + // [main issue here: properties of container rule are not copies in the sense of identical + // copies] + copier.setPackageTemplate(smContainerRule.getBase_Class(), tmContainerImpl); + + for (Connector connector : smContainerRule.getBase_Class().getOwnedConnectors()) { + Property ruleInterceptorPart = null; + for (Property part : interceptorPartsMap.keySet()) { + if (ConnectorUtil.connectsPart(connector, part)) { + // this connector is a connection between an interceptor (and another part which may not + // be an interceptor => TODO: validation rule yet to write + // we need to copy this connector multiple times, once for each associated interceptor part + ruleInterceptorPart = part; + break; + } + } + if (ruleInterceptorPart != null) { + for (Property interceptorPart : interceptorPartsMap.get(ruleInterceptorPart)) { + // map an interceptor part within rule successively to to an interceptor part + // within the container + copier.putPair(ruleInterceptorPart, interceptorPart); + copier.removeForCopy(connector); + copier.getCopy(connector); + } + } + else { + // check whether FCM connector + org.eclipse.papyrus.FCM.Connector fcmConn = StUtils.getConnector(connector); + if (fcmConn != null) { + ConnectorReification.reifyConnector(copier, tmContainerImpl, + UMLTool.varName(connector), connector, executorIS); + } + else { + copier.remove(connector); + copier.getCopy(connector); + } + } + } + copier.setPackageTemplate(null, null); + + TemplateUtils.retargetConnectors(tmContainerImpl); + } + + /** + * This container expansion does not create a new composite. Instead, it + * adds the extension as a part to the copied application component. The + * application component also inherits from the type of the container + * extension in order to avoid copying ports. + */ + Property expandAggregationExtension(Property smExtensionPart, Class smContainerExtImpl, Class tmComponent) throws TransformationException { + Property extensionPart; + String name = smExtensionPart.getName(); + Class tmContainerExtImpl = null; + + TemplateSignature signature = TemplateUtils.getSignature(smContainerExtImpl); + if (signature == null) { + // no template signature, just copy the container extension into the target model + tmContainerExtImpl = copier.getCopy(smContainerExtImpl); + } + else { + // template signature found, instantiate container extension via template binding mechanism + Classifier actual; + if (StereotypeUtil.isApplied(smExtensionPart, BindTemplate.class)) { + BindTemplate bt = UMLUtil.getStereotypeApplication(smExtensionPart, BindTemplate.class); + // use explicit binding from stereotype + actual = (Classifier) bt.getActual().get(0); + } + else { + // use executor component as actual + actual = tmComponent; + } + // template signature and instantiate container extension via the + // template binding mechanism, use executor component as actual + TemplateBinding binding = TemplateUtils.fixedBinding(copier.target, smContainerExtImpl, actual); + TemplateInstantiation ti = new TemplateInstantiation(copier, binding); + tmContainerExtImpl = ti.bindElement(smContainerExtImpl); + } + + // -------------------------------------------------- + // a container extension could be subject to container rules as well, i.e. need + // to handle recursive rule application. + EList rules = FCMUtil.getAllContainerRules(smContainerExtImpl); + + // get container trafo instance, if already existing + AbstractContainerTrafo containerTrafo = AbstractContainerTrafo.get(tmContainerExtImpl); + + if (containerTrafo == null) { + // no container exists, check rules and create eventually + for (ContainerRule rule : rules) { + if (RuleManagement.isRuleActive(rule)) { + // at least one active rule => create container (or get previously instantiated)) + if (containerTrafo == null) { + if (rule.getKind() == ContainerRuleKind.LIGHT_WEIGHT_OO_RULE) { + throw new TransformationException(Messages.ContainerTrafo_RecursiveLWnotSupported); + } + else { + containerTrafo = new ContainerTrafo(copier, tmCDP, null); + } + containerTrafo.createContainer(smContainerExtImpl, tmContainerExtImpl); + } + else { + // configure only?? + } + containerTrafo.applyRule(rule, smContainerExtImpl, tmContainerExtImpl); + } + } + if (containerTrafo != null) { + containerTrafo.finalize(); + tmContainerExtImpl = ((ContainerTrafo) containerTrafo).getContainer(); + } + } + // -------------------------------------------------- + + // add part associated with the extension to the container + extensionPart = tmContainerImpl.createOwnedAttribute(name, tmContainerExtImpl); + + // Copy.copyID(tmComponent, extensionPart, "a"); + extensionPart.setAggregation(smExtensionPart.getAggregation()); + LazyCopier.copyMultElemModifiers(smExtensionPart, extensionPart); + LazyCopier.copyFeatureModifiers(smExtensionPart, extensionPart); + + return extensionPart; + } + + /** + * Expand an interceptor definition between the container and the executor. + * + * @param extKind + * the interception kind (intercept which ports: all, some, out, ...) + * @param featureList + * The set of ports to intercept (In case of "some" above) + * @param smContainerConnImpl + * The connector (interceptor) implementation in the source model + * @param tmComponent + * the application component (executor) in the target model + * @return + * @throws TransformationException + */ + EList expandInterceptorExtension(InterceptionKind extKind, EList featureList, Class smContainerConnImpl, Class tmComponent) + throws TransformationException + { + EList connectorParts = new BasicEList(); + // replace delegation connectors with extension connector + for (Port port : PortUtils.getAllPorts(tmComponent)) { + // delegate to component via connector + boolean match = true; + if (extKind == InterceptionKind.INTERCEPT_ALL_IN) { + // IN-PORT = provided port + match = (PortUtils.getProvided(port) != null); + } + else if (extKind == InterceptionKind.INTERCEPT_ALL_OUT) { + // IN-PORT = provided port + match = (PortUtils.getRequired(port) != null); + } + else if (extKind == InterceptionKind.INTERCEPT_SOME) { + // comparison based on name, since in different models + match = (Utils.getNamedElementFromList(featureList, port.getName()) != null); + } + else if (extKind == InterceptionKind.INTERCEPT_MATCHING) { + EList interceptorPorts = PortUtils.getAllPorts(smContainerConnImpl); + match = false; + // get first port from interception connector that is typed with a template parameter + for (Port interceptorPort : interceptorPorts) { + if (interceptorPort.getType().getOwner() instanceof TemplateParameter) { + match = (PortUtils.getKind(port) == PortUtils.getKind(interceptorPort)); + break; + } + } + } + + // else INTERCEPT_ALL_PORT => match remains true + if (!match) { + // port does not match criterion, continue with next port + continue; + } + + Property connectorPart; + String interceptionName = interceptorName + port.getName() + counter; + Connector interceptionConnector = null; + // get delegation connector + for (Connector connector : tmContainerImpl.getOwnedConnectors()) { + if (ConnectorUtil.connectsPort(connector, port)) { + interceptionConnector = connector; + break; + } + } + // interceptionConnector = tmContainerImpl.getOwnedConnector + // ("delegation " + port.getName ()); + if (interceptionConnector == null) { + throw new TransformationException(Messages.ContainerTrafo_CannotFindDelegationConn); + } + + interceptionConnector.setName(interceptionName); + org.eclipse.papyrus.FCM.Connector fcmConn = StereotypeUtil.applyApp(interceptionConnector, org.eclipse.papyrus.FCM.Connector.class); + InteractionComponent fcmConnType = UMLUtil.getStereotypeApplication(smContainerConnImpl, InteractionComponent.class); + fcmConn.setIc(fcmConnType); + + // pass target component and port to interceptor (not clean, define + // suitable template signature as for instance in methodCall_comp + TransformationContext.instance = executorIS; + TransformationContext.port = port; + connectorPart = ConnectorReification.reifyConnector(copier, tmContainerImpl, UMLTool.varName(interceptionConnector), interceptionConnector, executorIS); + connectorParts.add(connectorPart); + TransformationContext.port = null; + portInfo.put(connectorPart, port); + // delete intermediate connector (has been replaced by two + // connections to the reified connector) + interceptionConnector.destroy(); + } + counter++; + return connectorParts; + } + + /** + * Move a slot from the executor instance specification to an instance + * specification of an extension/interceptor. This is required, since + * users cannot configure containers directly. The modification is done in + * the target model, i.e. the user model is not affected. + * + * Configuration is based on the idea that we can have multiple classifiers for an + * instance specification and that we add additional slots for attributes of the 2nd + * classifier which becomes "visible" after container transformation. + * Main use: configure priority of thread within container. + * + * TODO: Not clear, whether we should keep this operation, since configuration of elements that are not + * (directly) part of the user model is confusing. Application was: configuration + * of thread priorities within container. + */ + public void moveSlots(InstanceSpecification containerIS) { + // Log.log(Status.INFO, Log.TRAFO_CONTAINER, String.format(Messages.ContainerTrafo_InfoMoveSlots, executorIS.getQualifiedName())); + Classifier mainCl = DepUtils.getClassifier(executorIS); + Iterator slotIt = executorIS.getSlots().iterator(); + while (slotIt.hasNext()) { + Slot slot = slotIt.next(); + String featureName = slot.getDefiningFeature().getName(); + if (!mainCl.getAllAttributes().contains(slot.getDefiningFeature())) { + // defining feature does not belong to main classifier + // => move it to first matching instance specification + for (InstanceSpecification is : DepUtils.getContainedInstances(containerIS)) { + Classifier containedCl = DepUtils.getClassifier(is); + if (Utils.getNamedElementFromList(containedCl.getAllAttributes(), featureName) != null) { + if (executorIS != is) { + // remove slot first from iterator, as addition below removes it from the list (slots are owned) + slotIt.remove(); + is.getSlots().add(slot); + break; + } + } + } + } + } + } + + /** + * Create an connector for parts that have an association. The rationale + * behind this is support connections between the state machine in the container + * and the executor. + * + */ + public void createConnectorForAssociations() { + // TODO: keep list of added parts, only re-check those! + + for (Property part : Utils.getParts(tmContainerImpl)) { + if (part.getType() == null) { + continue; + } + for (Association association : part.getType().getAssociations()) { + // Part has an association. Check if the other association end + // targets one of + // other parts within the container + for (Property end : association.getMemberEnds()) { + Type type = end.getType(); + if ((type != null) && (type != part.getType())) { + // end is not typed with the part we are currently + // examining + // thus, it might belong to another part of the + // composite + for (Property checkPart : Utils.getParts(tmContainerImpl)) { + if (type == checkPart.getType()) { + // found an association between two parts of the + // container => create connection, + // unless already existing. + if (!ConnectorUtil.existsConnector(tmContainerImpl, part, checkPart)) { + Connector conn = tmContainerImpl.createOwnedConnector(part.getName() + "_" + checkPart.getName()); //$NON-NLS-1$ + conn.setType(association); + conn.createEnd().setRole(part); + conn.createEnd().setRole(checkPart); + } + } + } + } + } + } + } + } + + @Override + public void finalize() { + discoverServices(); + } + + /** + * Connector ports of executor with compatible ports offered by container extensions + * (runtime system) + */ + public void discoverServices() { + Type executorType = executorPart.getType(); + if (!(executorType instanceof EncapsulatedClassifier)) { + return; + } + EncapsulatedClassifier ec = (EncapsulatedClassifier) executorType; + for (Port executorPort : ec.getOwnedPorts()) { + for (Property svcPart : tmContainerImpl.getOwnedAttributes()) { + if (svcPart == executorPart) { + continue; + } + Type containerSvcType = svcPart.getType(); + if (containerSvcType instanceof EncapsulatedClassifier) { + EncapsulatedClassifier containerSvc = (EncapsulatedClassifier) containerSvcType; + for (Port svcPort : containerSvc.getOwnedPorts()) { + if (PortUtils.matches(executorPort, svcPort, true)) { + // create connector + Connector c = tmContainerImpl.createOwnedConnector( + String.format("auto from %s to %s", executorPart.getName(), svcPart.getName())); //$NON-NLS-1$ + ConnectorEnd ce1 = c.createEnd(); + ConnectorEnd ce2 = c.createEnd(); + ce1.setPartWithPort(executorPart); + ce1.setRole(executorPort); + ce2.setPartWithPort(svcPart); + ce2.setRole(svcPort); + } + } + } + } + } + } + + /** + * Return the containerTrafo associated with a container. This operation is useful for instance + * configurators that need more information about the container context, in particular to associate + * a part with a port that is intercepted. + * + * @param containerInstance + * the container instance (the parent instance of an instance of a container extension)ight be a container instance) + * @return the containerTrafo info, if found. + */ + public static ContainerTrafo getContainerTrafo(InstanceSpecification containerInstance) { + Classifier containerCandidate = DepUtils.getClassifier(containerInstance); + Property executorPart = containerCandidate.getAttribute(executorPartName, null); + if ((executorPart != null) && executorPart.getType() instanceof Class) { + AbstractContainerTrafo containerTrafo = AbstractContainerTrafo.get((Class) executorPart.getType()); + if (containerTrafo instanceof ContainerTrafo) { + return (ContainerTrafo) containerTrafo; + } + } + return null; + } + + /** + * Utility function to retrieve the executor slot, when given the container instance. + * Needs to be called, after a container instance has been created. + * + * @param containerInstance + * the instance of a container specification + * @return the associated executor slot, or null, if it cannot be found + */ + public static Slot getExecutorSlot(InstanceSpecification containerInstance) { + for (Slot slot : containerInstance.getSlots()) { + if (slot.getDefiningFeature().getName().equals(ContainerTrafo.executorPartName)) { + return slot; + } + } + return null; + } + + /** + * Return the port that is intercepted when given a part + * + * @param containerPart + * a part that participates in a port interception + * @return intercepted port + */ + public Port getInterceptedPort(Property containerPart) { + return portInfo.get(containerPart); + } + + /** + * The attribute within the container that holds the executor, i.e. the + * original component + */ + protected Property executorPart; + + /** + * An instance specification of the executor in the target model (todo: should be source model instead?), i.e. + * of the component before container expansion + */ + protected InstanceSpecification executorIS; + + /** + * The created container implementation (prefixed with tm, since part of + * target model) + */ + protected Class tmContainerImpl; + + /** + * A counter which is used to manage unique names for interceptors (if + * multiple interceptors are applied) + */ + protected int counter; + + /** + * Store information about intercepted port. The map contains a mapping from the part representing + * a reified connector to the port that was intercepted. It is stored, since it might be used by instance + * configurators that configure the container instance. + */ + protected Map portInfo; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/container/LWContainerTrafo.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/container/LWContainerTrafo.java new file mode 100644 index 00000000000..adcba9d75fe --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/container/LWContainerTrafo.java @@ -0,0 +1,438 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations.container; + +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.InterceptionRule; +import org.eclipse.papyrus.FCM.Template; +import org.eclipse.papyrus.qompass.designer.core.Messages; +import org.eclipse.papyrus.qompass.designer.core.StUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.papyrus.qompass.designer.core.extensions.InstanceConfigurator; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateInstantiation; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; +import org.eclipse.papyrus.qompass.designer.core.templates.TextTemplateBinding; +import org.eclipse.papyrus.qompass.designer.core.transformations.AbstractContainerTrafo; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier.CopyStatus; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Dependency; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.OpaqueBehavior; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.TemplateSignature; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.profile.standard.Create; +import org.eclipse.uml2.uml.profile.standard.Destroy; + +/** + * A light-weight container transformation. Unlike the standard component-based transformation, this transformation does not add a new class. + * It is target for standard object-oriented architecture, enabling in particular to intercept the methods of a class (instead of + * adding interceptors to ports). + * + */ +public class LWContainerTrafo extends AbstractContainerTrafo { + + public final String origOpPrefix = "orig_"; //$NON-NLS-1$ + + /** + * Constructor + * + * @param sat + * information about source and target model + * @param tmCDP + * deployment plan within target model + */ + public LWContainerTrafo(LazyCopier copy, Package tmCDP) { + this.copier = copy; + this.tmCDP = tmCDP; + interceptionOpMap = new HashMap(); + } + + /** + * creates the executor. Needs to be called *before* the other operations of + * this class. + * + * @param tmComponent + * the implementation of a component + * + * @throws TransformationException + */ + @Override + public void createContainer(Class smClass, Class tmClass) throws TransformationException { + + // for non-components: create a delegation operation for all operations that are provided by a class (excluding those derived by ports) + // Calls on model level use CallOperationAction, will point to existing operation, unless changed. + // If deployed dynamically (no static component deployment), need to change factories as well. + // Pragmatic: rename/add existing operations (as Accord has done), do some renaming and clever model handling (assure + // that code referencing classes via name automatically uses the new class. + // => container with name of existing class, rename existing class. + // possible: move operations into container, existing class gets copy (and update behaviors) + + // TODO: need something simple ... + // requirements: + // - existing creation operations create container (separation activity CreateAction: needs to change.) + // trivially in this case case, since container is no separate entity. + // - => references could be exchanged during copy operation with a suitable copyFilter (=> container transfo becomes a copy filter) + // [in case of ports: quite difficult to handle: if port belongs to abstract components, it may be inherited by multiple components that + // might or might-not have a container => only some references need to be changed] + // => clarify, how container handles super-classes, i.e. if it inherits ports as well (from a container of the abstract component) or not (not trivial at all!) + // TODO: don't copy derived operations + + this.smClass = smClass; + this.tmClass = tmClass; + // create a copy of all operations + operations = new BasicEList(smClass.getOperations()); + } + + public void createInstance() { + } + + /** + * original operation => operation gets interception prefix + * + * Objectives: existing call operations call interception operation. Existing operations include CallOperationActions as well as calls within + * opaque behavior + * This is assured by keeping same model reference for the operation, but associating a new interception behavior, existing behavior will be + * associated + * with a new renamed operation + * + * @param operation + */ + protected Operation createInterceptionOperation(Operation operation) throws TransformationException { + // create copy of operation + Operation copiedOperation = EcoreUtil.copy(operation); + tmClass.getOwnedOperations().add(copiedOperation); + StUtils.copyStereotypes(operation, copiedOperation); + + copiedOperation.setName(origOpPrefix + operation.getName()); + + // create interception code + // TODO: this is Java/C++ specific! + OpaqueBehavior b = (OpaqueBehavior) tmClass.createOwnedBehavior(operation.getName(), UMLPackage.eINSTANCE.getOpaqueBehavior()); + // TODO: this is defined in modellibs.core, no dependency + // String body = CppUtils.cppCall(copiedOperation); + String body = "testBody"; + // TODO: solution is specific to C++ + b.getLanguages().add("C/C++"); //$NON-NLS-1$ + b.getBodies().add(body); + // copy existing methods into new operation, copy method list, + // since adding the method to copied operation will remove these from original operation) + EList methods = new BasicEList(operation.getMethods()); + for (Behavior behavior : methods) { + copiedOperation.getMethods().add(behavior); + } + // new behavior is associated with existing call. + b.setSpecification(operation); + return copiedOperation; + } + + /** + * return the reference of the created container class + * + * @return + */ + public Class getContainer() { + return tmClass; + } + + /** + * apply a container rule, i.e. add either a container extension or an + * interceptor to the container. + * + * @param smContainerRule + * An container rule + * @param smComponent + * the application component in the source model + * @param tmComponent + * the application component in the target model + * @param tmIS + * the instance specification for the application component in the target model + * @throws TransformationException + */ + @Override + public void applyRule(ContainerRule smContainerRule, Class smComponent, Class tmComponent) + throws TransformationException + { + // dependencies of the rule become dependencies of he class. These dependencies must be instantiated + for (Dependency dependency : smContainerRule.getBase_Class().getClientDependencies()) { + // + for (Element target : dependency.getTargets()) { + // target may, or may not be in a template + if (target instanceof Classifier) { + Classifier targetCl = (Classifier) target; + Class extClass = expandAggregationDep((Class) targetCl, smComponent); + tmComponent.createDependency(extClass); + // if(TemplateUtils.getSignature(targetCl) != null) { + // } + } + } + } + + boolean hasConstructor = isOperationStereotypeApplied(Create.class); + boolean hasDestructor = isOperationStereotypeApplied(Destroy.class); + + // register relation to facilitate connector copy + copier.setPackageTemplate(smContainerRule.getBase_Class(), tmClass); + // reset status to in-progress. Otherwise, the copier will not properly add new + // elements. + copier.setStatus(tmClass, CopyStatus.INPROGRESS); + + for (Operation templateOperation : smContainerRule.getBase_Class().getOperations()) { + // Need a specific treatment of Constructor/destructor: if original class has a + // constructor, must add to all constructors, if it has none, copy constructor + boolean templateIsConstructor = StereotypeUtil.isApplied(templateOperation, Create.class); + boolean templateIsDestructor = StereotypeUtil.isApplied(templateOperation, Destroy.class); + + boolean needsMerge = (templateIsConstructor && hasConstructor) || (templateIsDestructor && hasDestructor); + if (needsMerge || StereotypeUtil.isApplied(templateOperation, InterceptionRule.class)) { + // operation is an interceptor: add its content to the methods of the + // original class + expandInterceptorExtension(smContainerRule, templateOperation); + } + else { + // normal operation. Copy from container to class + Operation newOperation = copier.getCopy(templateOperation); + if (StereotypeUtil.isApplied(templateOperation, Template.class)) { + String opBody = getBody(templateOperation); + // operation is not an interceptor, assume binding with class itself + TransformationContext.classifier = tmClass; + opBody = TextTemplateBinding.bind(opBody, smClass, null); + setBody(newOperation, opBody); + } + if (templateIsConstructor) { + newOperation.setName(tmClass.getName()); + } + else if (templateIsConstructor) { + newOperation.setName("~" + tmClass.getName()); + } + } + } + + for (Property part : smContainerRule.getBase_Class().getAllAttributes()) { + Type type = part.getType(); + if (type == null) { + String ruleName = (smContainerRule.getBase_Class() != null) ? smContainerRule.getBase_Class().getName() : "undefined"; //$NON-NLS-1$ + throw new TransformationException(String.format(Messages.LWContainerTrafo_CannotApplyRule, ruleName)); + } + if (part instanceof Port) { + Port newPort = tmClass.createOwnedPort(part.getName(), part.getType()); + StUtils.copyStereotypes(part, newPort); + } + else if (type instanceof Class) { + Class extOrInterceptor = (Class) type; + // DepUtils.chooseImplementation((Class) type, + // new BasicEList(), false); + + if (StereotypeUtil.isApplied(part, InterceptionRule.class)) { + // port.filter + // + } + else { + Property extensionPart = + expandAggregationExtension(part.getName(), extOrInterceptor, tmComponent); + copier.put(part, extensionPart); + copier.setPackageTemplate(null, null); + } + } + else { + Property newAttribute = EcoreUtil.copy(part); + tmClass.getOwnedAttributes().add(newAttribute); + } + } + + // tell copy that tmcontainerImpl is associated with the smContainerRule + // register a package template (although it is not a template) to assure that the connectors + // get copied, although they are in a different resource (only the connectors are copied, not + // the types of the referenced parts). + // [main issue here: properties of container rule are not copies in the sense of identical + // copies] + + // copy.setPackageTemplate(smContainerRule.getBase_Class(), tmClass); + // copy.setPackageTemplate(null, null); + } + + protected boolean isOperationStereotypeApplied(java.lang.Class stereotype) { + for (Operation op : tmClass.getOwnedOperations()) { + if (StereotypeUtil.isApplied(op, stereotype)) { + return true; + } + } + return false; + } + + /** + * This container expansion does not create a new composite. Instead, it + * adds the extension as a part to the copied application component. The + * application component also inherits from the type of the container + * extension in order to avoid copying ports. + */ + Property expandAggregationExtension(String name, Class smContainerExtImpl, Class tmComponent) throws TransformationException { + Class tmContainerExtImpl = expandAggregationDep(smContainerExtImpl, tmComponent); + + // add part associated with the extension to the container + Property extensionPart = tmClass.createOwnedAttribute(name, tmContainerExtImpl); + + // problem: would not be unique in case of multiple extensions + // Copy.copyID(tmComponent, extensionPart, "a"); + extensionPart.setIsComposite(true); + + return extensionPart; + } + + Class expandAggregationDep(Class smContainerExtImpl, Class tmComponent) throws TransformationException { + Class tmContainerExtImpl = null; + + TemplateSignature signature = TemplateUtils.getSignature(smContainerExtImpl); + if (signature == null) { + // no template signature, just copy the container extension into the target model + tmContainerExtImpl = copier.getCopy(smContainerExtImpl); + } else { + // template signature found, instantiate container extension via the + // template binding mechanism + TemplateBinding binding = TemplateUtils.fixedBinding(copier.target, smContainerExtImpl, tmComponent); + Object[] args = new Object[] {}; + TemplateInstantiation ti = new TemplateInstantiation(copier, binding, args); + tmContainerExtImpl = ti.bindElement(smContainerExtImpl); + } + + return tmContainerExtImpl; + } + + /** + * Expand an interceptor definition between the container and the executor. + * Can be called several times with different interception operations (which will then be concatenated) + * + * @throws TransformationException + */ + EList expandInterceptorExtension(ContainerRule smContainerRule, Operation interceptionOperationInRule) + throws TransformationException + { + for (Operation smOperation : operations) { + Operation tmOperation = copier.getCopy(smOperation); + String interceptionBody = getBody(interceptionOperationInRule); + if (StereotypeUtil.isApplied(interceptionOperationInRule, Create.class) != + StereotypeUtil.isApplied(smOperation, Create.class)) { + // if the intercepting operation is a constructor, the intercepted operation must also be a constructor + continue; + } + if (StereotypeUtil.isApplied(interceptionOperationInRule, Destroy.class) != + StereotypeUtil.isApplied(smOperation, Destroy.class)) { + // if the intercepting operation is a destructor, the intercepted operation must also be a destructor + continue; + } + if (StereotypeUtil.isApplied(interceptionOperationInRule, Template.class)) { + // pass operation in source model, since this enables Xtend code to check + // for markers on model + interceptionBody = TextTemplateBinding.bind(interceptionBody, smOperation, null); + } + if (interceptionBody.length() > 0) { + // only add interception operation, if the interception is not empty + interceptionBody = "// --- interception code from rule <" + smContainerRule.getBase_Class().getName() + "> ---\n" + //$NON-NLS-1$ //$NON-NLS-2$ + interceptionBody; + Operation interceptionOpInClass = interceptionOpMap.get(tmOperation); + if (interceptionOpInClass == null) { + createInterceptionOperation(tmOperation); + // existing operation becomes interception operation (by assigning it a new behavior and moving its behavior to a new operation + interceptionOpInClass = tmOperation; + interceptionOpMap.put(tmOperation, interceptionOpInClass); + } + String newBody = interceptionBody + "\n" + //$NON-NLS-1$ + getBody(interceptionOpInClass); + setBody(interceptionOpInClass, newBody); + } + } + return null; + } + + public static String getBody(Operation op) { + for (Behavior behavior : op.getMethods()) { + if (behavior instanceof OpaqueBehavior) { + EList bodies = ((OpaqueBehavior) behavior).getBodies(); + if (bodies.size() > 0) { + // always take first + return bodies.get(0); + } + } + } + return ""; //$NON-NLS-1$ + } + + public static void setBody(Operation op, String body) { + for (Behavior behavior : op.getMethods()) { + if (behavior instanceof OpaqueBehavior) { + EList bodies = ((OpaqueBehavior) behavior).getBodies(); + if (bodies.size() > 0) { + // always take first + bodies.set(0, body); + break; + } + } + } + } + + // protected InstanceSpecification tmClassIS; + protected Class smClass; + + protected EList operations; + + protected Map interceptionOpMap; + + /** + * @see AbstractContainerTrafo.createContainerInstance + */ + @Override + public InstanceSpecification createContainerInstance(Class tmComponent, InstanceSpecification executorIS) throws TransformationException { + InstanceSpecification containerIS = executorIS; + // TODO ... incomplete! + // InstanceConfigurator.configureInstance(smContainerRule, containerIS, null, context); + + // now create instances for the contained elements + for (Property extensionPart : tmComponent.getAttributes()) { + Type tmContainerExtImpl = extensionPart.getType(); + if (tmContainerExtImpl instanceof Class) { + if (DepUtils.getSlot(executorIS, extensionPart) == null) { + // no slot for part exists => assume that the part has been added by the container and create an instance specification for it. + + InstanceSpecification containerExtIS = DepCreation.createDepPlan(tmCDP, (Class) tmContainerExtImpl, containerIS.getName() + "." + //$NON-NLS-1$ + extensionPart.getName(), false); + // configure extension + InstanceConfigurator.configureInstance(containerExtIS, extensionPart, null); + DepCreation.createSlot(containerIS, containerExtIS, extensionPart); + } + } + } + return containerIS; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterRuleApplication.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterRuleApplication.java new file mode 100644 index 00000000000..93173286910 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterRuleApplication.java @@ -0,0 +1,46 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations.filters; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.FCM.RuleApplication; +import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; + +/** + * Filter the rule application stereotype. The rule application stereotype is not + * required in the target model (per node). It is harmful, since the container rule + * can contain interceptors which typically reference elements from package templates. + * These elements should not should be copied into the target model. + */ +public class FilterRuleApplication implements PreCopyListener { + + public static FilterRuleApplication getInstance() { + if (instance == null) { + instance = new FilterRuleApplication(); + } + return instance; + } + + @Override + public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { + if (sourceEObj instanceof RuleApplication) { + return null; + } + return sourceEObj; + } + + private static FilterRuleApplication instance = null; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterSignatures.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterSignatures.java new file mode 100644 index 00000000000..69e040f9676 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterSignatures.java @@ -0,0 +1,50 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations.filters; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.uml2.uml.TemplateSignature; + + +/** + * Remove signatures from package template (only remove signatures within the + * template, not others) + * + * @author ansgar + * + */ +public class FilterSignatures implements PreCopyListener { + + public static FilterSignatures getInstance() { + if (instance == null) { + instance = new FilterSignatures(); + } + return instance; + } + + @Override + public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { + if (sourceEObj instanceof TemplateSignature) { + if (copy.withinTemplate(sourceEObj)) { + return null; + } + } + return sourceEObj; + } + + private static FilterSignatures instance = null; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterStateMachines.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterStateMachines.java new file mode 100644 index 00000000000..3111104d984 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterStateMachines.java @@ -0,0 +1,95 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations.filters; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.papyrus.qompass.designer.core.StUtils; +import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.Region; +import org.eclipse.uml2.uml.StateMachine; +import org.eclipse.uml2.uml.Transition; + +/** + * This filter copies the effect of transitions to the class level. + */ +public class FilterStateMachines implements PreCopyListener { + + public static FilterStateMachines getInstance() { + if (instance == null) { + instance = new FilterStateMachines(); + } + return instance; + } + + @Override + public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { + if (sourceEObj instanceof StateMachine) { + StateMachine sm = (StateMachine) sourceEObj; + Class tmClass = getTargetClass(copy, sm); + + // copy opaque behavior in state machine to class level + for (Region region : sm.getRegions()) { + for (Transition transition : region.getTransitions()) { + Behavior effect = transition.getEffect(); + if (effect != null) { + if (tmClass != null) { + String newName = sm.getName() + "_" + transition.getName() //$NON-NLS-1$ + + "_" + effect.getName(); //$NON-NLS-1$ + moveBehavior(newName, tmClass, effect); + } + } + } + } + // remove state machine + return null; + } + return sourceEObj; + } + + public Class getTargetClass(LazyCopier copy, StateMachine sm) { + Element smOwner = sm.getOwner(); + EObject tmOwner = copy.getMap(smOwner).get(smOwner); + if (tmOwner instanceof Class) { + return (Class) tmOwner; + } + return null; + } + + public void moveBehavior(String newName, Class tmClass, Behavior effect) { + Behavior copiedEffect = EcoreUtil.copy(effect); + if (tmClass.getOwnedOperation(newName, null, null) != null) { + // has already been added + return; + } + Operation operation = tmClass.createOwnedOperation(newName, null, null); + for (Parameter parameter : effect.getOwnedParameters()) { + Parameter newParameter = EcoreUtil.copy(parameter); + operation.getOwnedParameters().add(newParameter); + StUtils.copyStereotypes(parameter, newParameter); + } + copiedEffect.setSpecification(operation); + copiedEffect.setName(newName); + tmClass.getOwnedBehaviors().add(copiedEffect); + } + + private static FilterStateMachines instance = null; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterTemplate.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterTemplate.java new file mode 100644 index 00000000000..288fc1ab64a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FilterTemplate.java @@ -0,0 +1,75 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations.filters; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.Element; + + +/** + * Do not copy connector related elements, i.e. + * 1. UML connectors with stereotype FCM.Connector + * The rationale behind this is that we want to avoid copying a FCM connector from the source model + * into the target model since the target model should only contain the reified form of the connector + * + * 2. UML classes that are stereotyped as interaction components + * We do not want to copy interaction components, since they typically need to be instantiated. + * TODO: there is no check whether we are actually in a template. An interaction component might be fixed (i.e. not + * depend on template instantiation) and needs to be copied in this case. + * (in most cases, these are not copied anyway, since these are in a different model, + * but we do not want to exclude the case of defining model-local connectors) + * + */ +public class FilterTemplate implements PreCopyListener { + + public FilterTemplate() { + active = true; + } + + public static FilterTemplate getInstance() { + if (instance == null) { + instance = new FilterTemplate(); + } + return instance; + } + + @Override + public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { + if (active && (sourceEObj instanceof Element)) { + Element sourceElem = (Element) sourceEObj; + if ((sourceEObj instanceof Connector) && StereotypeUtil.isApplied(sourceElem, org.eclipse.papyrus.FCM.Connector.class)) { + // return null; + } + if ((sourceEObj instanceof Class) && StereotypeUtil.isApplied(sourceElem, InteractionComponent.class)) { + return null; + } + } + return sourceEObj; + } + + public void setActive(boolean active) { + this.active = active; + } + + private boolean active; + + private static FilterTemplate instance = null; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FixTemplateSync.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FixTemplateSync.java new file mode 100644 index 00000000000..fdb7c64d06d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core/src/org/eclipse/papyrus/qompass/designer/core/transformations/filters/FixTemplateSync.java @@ -0,0 +1,56 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.core.transformations.filters; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.listeners.PostCopyListener; +import org.eclipse.papyrus.qompass.designer.core.sync.CompImplSync; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Class; + +/** + * Synchronize derived realizations (after copying). If re-synchronization is not done, the + * relationship would point to wrong interface, if it is derived and depending on a formal parameter. + * (e.g. derived push interface with formal parameter T would be at wrong location). + * TODO: need better explanation. Solution is quite a hack. + */ +public class FixTemplateSync implements PostCopyListener { + + public static FixTemplateSync getInstance() { + if (instance == null) { + instance = new FixTemplateSync(); + } + return instance; + } + + @Override + public void postCopyEObject(LazyCopier copy, EObject targetEObj) { + // if (copy.get(sourceEObj) isWithinTemplate) + if (!(targetEObj instanceof Behavior)) { + if ((targetEObj instanceof Class) && Utils.isCompImpl((Class) targetEObj)) { + Class implementation = (Class) targetEObj; + CompImplSync.updatePorts(implementation); + CompImplSync.syncRealizations(implementation); + // commented out, since it causes dangling references + // TODO: why needed originally? ( + // CompImplSync.syncDerivedOperations(implementation); + } + } + } + + private static FixTemplateSync instance = null; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/.classpath b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/.classpath new file mode 100644 index 00000000000..248b4c5dc7a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/.project b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/.project new file mode 100644 index 00000000000..e75a53b4f3e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/.project @@ -0,0 +1,34 @@ + + + org.eclipse.papyrus.qompass.designer.cpp + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f42de363afa --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/META-INF/MANIFEST.MF b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..a104bc94858 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + com.google.guava;bundle-version="11.0.0", + org.eclipse.xtext.xbase.lib, + org.eclipse.xtend.lib, + org.eclipse.xtend.lib.macro, + org.eclipse.papyrus.qompass.designer.core;bundle-version="1.2.0", + org.eclipse.uml2.uml;bundle-version="5.0.1", + org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", + org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", + org.eclipse.papyrus.uml.tools;bundle-version="1.2.0" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.qompass.designer.cpp.Activator +Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.cpp;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/about.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    November 14, 2008

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/build.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/build.properties new file mode 100644 index 00000000000..3fa3c740b2b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/build.properties @@ -0,0 +1,8 @@ +source.. = src/,\ + xtend-gen/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties,\ + plugin.xml diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.properties new file mode 100644 index 00000000000..41efca52119 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus extra: Qompass Designer C++ support (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.xml new file mode 100644 index 00000000000..7e269f6b934 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/plugin.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/pom.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/pom.xml new file mode 100644 index 00000000000..7ac5e5e3409 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../releng/extra + + org.eclipse.papyrus.qompass.designer.cpp + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-clean-plugin + + + + xtend-gen + + **/* + + + .gitignore + + + + + + + org.eclipse.xtend + xtend-maven-plugin + + + generate-sources + + compile + + + + + xtend-gen + ${project.build.directory}/xtend-gen/test + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Activator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Activator.java new file mode 100644 index 00000000000..8d1c38fcd87 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Activator.java @@ -0,0 +1,50 @@ +package org.eclipse.papyrus.qompass.designer.cpp; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.cpp"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Constants.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Constants.java new file mode 100644 index 00000000000..546144c98e5 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Constants.java @@ -0,0 +1,9 @@ +package org.eclipse.papyrus.qompass.designer.cpp; + +public class Constants { + public static final String CREATE_CONNECTIONS = "createConnections"; //$NON-NLS-1$ + + public static final String progLang = "C/C++"; //$NON-NLS-1$ + + public static final String retParamName = "ret"; //$NON-NLS-1$ +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Messages.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Messages.java new file mode 100644 index 00000000000..ae3f8380e5b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/Messages.java @@ -0,0 +1,19 @@ +package org.eclipse.papyrus.qompass.designer.cpp; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.qompass.designer.cpp.messages"; //$NON-NLS-1$ + + public static String CompImplTrafos_CannotFindType; + public static String CompImplTrafos_IntfNotImplemented; + public static String CompTypeTrafos_CannotFindType; + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/messages.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/messages.properties new file mode 100644 index 00000000000..c4c2141c7e6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/messages.properties @@ -0,0 +1,3 @@ +CompImplTrafos_CannotFindType=Can not find type %s. Thus, unable to create suitable connect operation in component to OO transformation. +CompImplTrafos_IntfNotImplemented=Interface <%s> provided by port <%s> of class <%s> is not implemented by the component itself nor does the port delegate to a part +CompTypeTrafos_CannotFindType=Can not find type <%s>. Thus, unable to create suitable connect operation in component to OO transformation diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppPortMapping.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppPortMapping.xtend new file mode 100644 index 00000000000..05dd7c50459 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppPortMapping.xtend @@ -0,0 +1,553 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ +package org.eclipse.papyrus.qompass.designer.cpp.xtend + +import org.eclipse.papyrus.qompass.designer.core.extensions.IOOTrafo +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier +import org.eclipse.uml2.uml.Class +import org.eclipse.uml2.uml.Property +import org.eclipse.uml2.uml.Port +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException +import org.eclipse.papyrus.qompass.designer.core.PortInfo +import org.eclipse.papyrus.qompass.designer.core.PortUtils +import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants +import org.eclipse.papyrus.qompass.designer.core.Utils +import org.eclipse.papyrus.qompass.designer.core.transformations.CompTypeTrafos +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil +import org.eclipse.uml2.uml.AggregationKind +import org.eclipse.uml2.uml.UMLPackage +import org.eclipse.uml2.uml.OpaqueBehavior +import org.eclipse.uml2.uml.ConnectorEnd +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil +import org.eclipse.papyrus.C_Cpp.Ptr +import org.eclipse.uml2.uml.Type +import java.util.HashMap +import java.util.Map +import org.eclipse.uml2.uml.Connector +import org.eclipse.emf.common.util.EList +import org.eclipse.uml2.uml.StructuralFeature +import org.eclipse.papyrus.qompass.designer.cpp.Messages +import org.eclipse.papyrus.qompass.designer.cpp.Constants +import static extension org.eclipse.papyrus.qompass.designer.cpp.xtend.CppUtils.nameRef; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil + +/** + * This class realizes the transformation from component-based to object-oriented + * models. It includes the replacement of ports and connectors. Ports are + * replaced with attributes and access operations, connectors within a composite + * by an operation that creates the initial setup. + * + * 1. add an operation that allows to retrieve the reference to an interface provided + * by a port. This operation has a mapping specific name, e.g. get_ + * 2. add an operation that allows to connect a specific port. + * the connect_q operation (*including a + * storage attribute*) for a port with a required interface + * 3. add an implementation for the getcnx_q operation for a port + * with a required interface (the operation itself has been added before) + * + * TODO: C++ specific, support different "component to OO" mappings + * + * Problems: need to align bootloader creation with this mapping, since + * the bootloader may be responsible for instantiation + * + * Caveat: Assure that the folder derivedInterfaces already exists in a model. + * Otherwise the call to getProvided/getRequired interface might trigger its + * creation resulting in the corruption of list iterators (ConcurrentAccess + * exception) + * + */ +class CppPortMapping implements IOOTrafo { + + // protected LazyCopier copier + + def override init(LazyCopier copier, Class bootloader) { + // this.copier = copier + } + + override addPortOperations(Class implementation) { + addGetPortOperation(implementation) + addConnectPortOperation(implementation) + } + + /** + * Add the get_p operation for each port with a provided interface. It also + * adds a suitable implementation that evaluates delegation connectors from + * the port to a property within the composite. The delegation target could + * either be a normal class (no port) or an inner component. + * + * @param implementation + */ + def addGetPortOperation(Class implementation) { + for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { + val providedIntf = portInfo.getProvided() + if (providedIntf != null) { + + // port provides an interface, add "get_p" operation & + // implementation + val opName = PrefixConstants.getP_Prefix + portInfo.name + var op = implementation.getOwnedOperation(opName, null, null) + if (op != null) { + + // operation already exists. Assume that user wants to + // override standard delegation + if (op.type != providedIntf) { + op.createOwnedParameter(Constants.retParamName, providedIntf) + } + } else { + op = implementation.createOwnedOperation(opName, null, null, providedIntf) + val retParam = op.getOwnedParameters().get(0) + retParam.setName(Constants.retParamName) + StereotypeUtil.apply(retParam, Ptr) + + val behavior = implementation.createOwnedBehavior(opName, UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + op.getMethods().add(behavior) + + val ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) + + // if there is an delegation to an inner property, delegate to + // it + // Make distinction between delegation to component (with a + // port) or + // "normal" class (without). + var String body + if (ce != null) { + val part = ce.partWithPort + val role = ce.role + + body = "return " + if (role instanceof Port) { + + // check whether the part exists within the implementation (might not be the case + // due to partially copied composites). + // Check is based on names, since the connector points to elements within another + // model (copyClassifier does not make a proper connector copy) + // TODO: this will NOT work for extended ports! + body += '''«part.nameRef»«PrefixConstants.getP_Prefix»«role.name»();''' + } else { + + // role is not a port: connector connects directly to a + // structural feature + // without passing via a port + // TODO: check whether structural feature exists + body += role.name + } + } else { + + // no delegation, check whether port implements provided interface + var implementsIntf = implementation.getInterfaceRealization(null, providedIntf) != null + if (!implementsIntf) { + // TODO: This is a hack/workaround. Fix on level of extended port. + // The extended port itself is not copied to the target + // model (since referenced via a stereotype). Therefore, + // a port of an extended port still points to the + // original model. We try whether the providedIntf + // within the target model is within the interface + // realizations. + + // val providedIntfInCopy = copier.getCopy(providedIntf) + // implementsIntf = implementation.getInterfaceRealization(null, providedIntfInCopy) != null + } + if (implementsIntf) { + body = "return this;" + } else { + throw new RuntimeException( + String.format(Messages.CompImplTrafos_IntfNotImplemented, providedIntf.name, + portInfo.port.name, implementation.name)) + } + } + behavior.getLanguages().add(Constants.progLang) + behavior.getBodies().add(body) + } + } + } + } + + /** + * Add a connect_ operation for ports with a required interface. + * Whereas operation and a behavior is added for each owned port, a behavior + * (method) is needed for ports inherited from a component type (the + * behavior is implementation specific, as it needs to take delegation to + * parts into account) + * + * @param implementation + */ + static def addConnectPortOperation(Class implementation) { + for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { + val requiredIntf = portInfo.getRequired() + if (requiredIntf != null) { + + // port requires an interface, add "connect_p" operation & + // implementation + val opName = PrefixConstants.connectQ_Prefix + portInfo.name + + if (implementation.getOwnedOperation(opName, null, null) != null) { + // do not add the operation, if it already exists. This means that the + // user wants to override it with custom behavior. In case of extended + // ports, we may have to do that. + } else { + var op = implementation.createOwnedOperation(opName, null, null) + val boolean multiPort = (portInfo.getUpper() > 1) || (portInfo.getUpper() == -1) // -1 indicates "*" + if (multiPort) { + + // add index parameter + val eLong = Utils.getQualifiedElement(PackageUtil.getRootPackage(implementation), + CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE) + if (eLong instanceof Type) { + op.createOwnedParameter("index", eLong as Type) + } else { + throw new RuntimeException( + String.format(Messages.CompImplTrafos_CannotFindType, + CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE)) + } + } + val refParam = op.createOwnedParameter("ref", requiredIntf) + StereotypeUtil.apply(refParam, Ptr) + + val behavior = implementation.createOwnedBehavior(opName, UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + + op.getMethods().add(behavior) + + val ConnectorEnd ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) + + // if there is an delegation to an inner property, delegate to it + // Make distinction between delegation to component (with a port) or + // "normal" class (without). + var String body + if (ce != null) { + val part = ce.partWithPort + body = part.name + val role = ce.role + if (role instanceof Port) { + // in case of a delegation, use name of target port which might be different + val targetOpName = PrefixConstants.connectQ_Prefix + role.name + body = '''«part.nameRef»«targetOpName»''' + + // TODO: no check that multiplicity of both port matches + if ((portInfo.getUpper() > 1) || (portInfo.getUpper() == -1)) { + body += "(index, ref);"; + } + else { + body += "(ref);"; + } + + } else { + // TODO: does this case make sense? + body += '''«part.name»;''' + } + } else { + // no delegation - create attribute for port + val attributeName = PrefixConstants.attributePrefix + portInfo.name + if (!Utils.hasNonPortOwnedAttribute(implementation, attributeName)) { + val attr = implementation.createOwnedAttribute(attributeName, requiredIntf) + LazyCopier.copyMultElemModifiers(portInfo.port, attr) + + // is shared (should store a reference) + attr.setAggregation(AggregationKind.SHARED_LITERAL) + } + body = attributeName + if(multiPort) body += "[index]" + body += " = ref;" + } + + // TODO: defined by template + behavior.getLanguages().add(Constants.progLang) + behavior.getBodies().add(body) + + // ------------------------- + // add body to get-connection operation (which exists already if the port is also + // owned, since it is synchronized automatically during model edit) + // getConnQ prefix may be empty to indicate that the port is accessed directly + // TODO: reconsider optimization that delegated required ports do not have a + // local attribute & associated operation (an inner class may delegate, but the + // composite may be using it as well). + if ((PrefixConstants.getConnQ_Prefix.length() > 0) && (ce != null)) { + val getConnOpName = PrefixConstants.getConnQ_Prefix + portInfo.name + var getConnOp = implementation.getOwnedOperation(getConnOpName, null, null) + if (getConnOp == null) { + getConnOp = implementation.createOwnedOperation(getConnOpName, null, null, requiredIntf) + val retParam = op.getOwnedParameters().get(0) + retParam.setName(Constants.retParamName) + StereotypeUtil.apply(retParam, Ptr) + } + val getConnBehavior = implementation.createOwnedBehavior(getConnOpName, + UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + getConnOp.getMethods().add(getConnBehavior) + + // no delegation + val String name = PrefixConstants.attributePrefix + portInfo.name + body = '''return «name»;''' + behavior.getLanguages().add(Constants.progLang) + behavior.getBodies().add(body) + } + } + } + } + } + + /** + * Add an operation "createConnections" that implements the connections + * between composite parts. It only takes the assembly connections into + * account, since delegation connectors are handled by the get_ and connect_ + * port operations above. + * + * @param implementation + */ + override addConnectionOperation(Class compositeImplementation) throws TransformationException { + var createConnBody = "" + val Map indexMap = new HashMap() + + for (Connector connector : compositeImplementation.getOwnedConnectors()) { + if (ConnectorUtil.isAssembly(connector)) { + + // Boolean associationBased = false + if (connector.ends.size() != 2) { + throw new TransformationException( + '''Connector <«connector.name»> does not have two ends. This is currently not supported''') + } + val end1 = connector.ends.get(0) + val end2 = connector.ends.get(1) + var cmd = '''// realization of connector <«connector.name»>\n''' + if ((end1.role instanceof Port) && PortUtils.isExtendedPort(end1.role as Port)) { + val port = end1.role as Port + val EList subPorts = PortUtils.flattenExtendedPort(port) + for (PortInfo subPort : subPorts) { + cmd += ''' // realization of connection for sub-port «subPort.port.name»\n''' + cmd += connectPorts(indexMap, connector, end1, end2, subPort.port) + cmd += connectPorts(indexMap, connector, end2, end1, subPort.port) + } + } else { + cmd += connectPorts(indexMap, connector, end1, end2, null) + cmd += connectPorts(indexMap, connector, end2, end1, null) + } + createConnBody += cmd + "\n" + } + } + + // TODO: use template, as in bootloader + if (createConnBody.length() > 0) { + val operation = compositeImplementation.createOwnedOperation(Constants.CREATE_CONNECTIONS, null, null) + + val behavior = compositeImplementation.createOwnedBehavior("b:" + operation.name, + UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + behavior.getLanguages().add(Constants.progLang) + behavior.getBodies().add(createConnBody) + behavior.setSpecification(operation) + } + } + + /** + * Create the body C++ code code that creates a connection between the two ends + * of a connector. This function checks whether the first end really is a receptacle + * and the second really is a facet. + * TODO: cleaner rewrite in xtend + * + * @param indexMap + * a map of indices that are used in case of multiplex + * receptacles + * @param connector + * a connector + * @param receptacleEnd + * an end of the connector that may point to a receptacle port + * @param facetEnd + * an end of the connector that may point to a facet port + * @param subPort + * a sub-port in case of extended ports + * @return + * @throws TransformationException + */ + static def connectPorts(Map indexMap, Connector connector, ConnectorEnd receptacleEnd, + ConnectorEnd facetEnd, Port subPort) throws TransformationException { + val association = connector.type + if ((receptacleEnd.role instanceof Port) && (facetEnd.role instanceof Port)) { + val facetPort = facetEnd.role as Port + val receptaclePort = receptacleEnd.role as Port + val facetPI = PortInfo.fromSubPort(facetPort, subPort) + val receptaclePI = PortInfo.fromSubPort(receptaclePort, subPort) + + if ((facetPI.getProvided() != null) && (receptaclePI.getRequired() != null)) { + val facetPart = facetEnd.partWithPort + val receptaclePart = receptacleEnd.partWithPort + + var subPortName = "" + if(subPort != null) subPortName += "_" + subPort.name + val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) + val setter = '''«receptaclePart.nameRef»connect_«receptaclePort.name» «subPortName»;''' + val getter = '''«facetPart.nameRef»get_«facetPort.name» «subPortName»()''' + return '''«setter»(«indexName»«getter»);\n''' + } + + } else if (receptacleEnd.role instanceof Port) { + + // only the receptacle end is of type port. + val Port receptaclePort = receptacleEnd.role as Port + if (PortUtils.getRequired(receptaclePort) != null) { + val facetPart = facetEnd.role as Property + val receptaclePart = facetEnd.partWithPort + + val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) + val setter = '''«receptaclePart.nameRef»connect_«receptaclePort.name»''' + val getter = '''&«facetPart.name»''' + return '''«setter»(«indexName»«getter»);\n''' + } + } else if (facetEnd.role instanceof Port) { + + // only the facet end is of type port. Unsupported combination + val facetPort = facetEnd.role as Port + if (PortUtils.getProvided(facetPort) != null) { + val facetPart = facetEnd.partWithPort + val receptaclePart = facetEnd.role as Property + + val setter = receptaclePart.name + val getter = '''«facetPart.nameRef»get_«facetPort.name»();''' + return '''«setter» = «getter»;\n''' + } + } else if (association != null) { + + // both connector ends do not target ports. In this case, we require that the connector is typed + // with an association. We use this association to find out which end is navigable and assume that + // the part pointed to by the other end is a pointer that gets initialized with the part of the + // navigable end. + val facetPart = facetEnd.role as Property + val receptaclePart = receptacleEnd.role as Property + + val assocProp1 = association.getMemberEnd(null, facetPart.type) + + // Property assocProp2 = facetPart.getOtherEnd() + if ((assocProp1 != null) && assocProp1.isNavigable) { + val setter = '''«receptaclePart.nameRef»«assocProp1.name»''' + val getter = '''&«facetPart.name»''' + return '''«setter» = «getter»;\n''' + } + } else { + + // not handled (a connector not targeting a port must be typed) + throw new TransformationException( + "Connector <" + connector.name + + "> does not use ports, but it is not typed (only connectors between ports should not be typed)") + } + return "" + } + + /** + * Handle ports with multiplicity > 1. The idea is that we could have + * multiple connections targeting a receptacle. The first connection would + * start with index 0. Implementations can make no assumption which + * connection is associated with a certain index. [want to avoid associative + * array in runtime]. + * + * @param port + * @param end + * @return + */ + static def getIndexName(Map indexMap, Port port, ConnectorEnd end) { + if ((port.getUpper() > 1) || (port.getUpper() == -1)) { + + // index depends of combination of property and port, use connector + // end as key + var indexValue = indexMap.get(end) + if (indexValue == null) { + indexValue = 0 + indexMap.put(end, indexValue) + } + var index = indexValue + ", " + indexValue++ + indexMap.put(end, indexValue) + return index + } + return "" + } + + /** + * Return true, if the bootloader is responsible for the instantiation of a + * part. [Structual difference: bootloader can decide instance based - and + * instances are deployed] + * + * If a part is a component type or an abstract implementation, it cannot be + * instantiated. Thus, a heir has to be selected in the deployment plan. + * Since the selection might be different for different instances of the + * composite, the instantiation is not done by the component itself, but by + * the bootloader. The bootloader also has to instantiate, if different + * allocation variants are required. (this is for instance the case for + * distribution connectors and for the system itself) + * + * If possible, we want to let composites instantiate sub-components, since + * this eases the transition to systems which support reconfiguration. + * + * [TODO: optimization: analyze whether the deployment plan selects a single + * implementation. If yes, let the composite instantiate] + * + * [TODO: elements within an assembly need to be instantiated by composite - + * if System - by bootloader. assembly also need to be instantiated by + * composite!! + * + * @param implementation + * @return + */ + static def instantiateViaBootloader(Class implementation) { + return implementation.isAbstract() || Utils.isAssembly(implementation) + } + + /** + * Return whether a part needs to be instantiated by the bootloader instead + * by the composite in which it is contained. The criteria is based on the + * question whether the containing composite is flattened, as it is the case + * for the system component and the interaction components for distribution. + * + * @param part + * @return + */ + static def instantiateViaBootloader(StructuralFeature part) { + if (part != null) { + if (part.type instanceof Class) { + val implementation = part.type as Class + + // TODO: wrong criteria? (must be shared or not?) + return instantiateViaBootloader(implementation) + } else { + + // not a class, assume primitive type instantiated by composite + return false + } + } + return false + } + + /** + * Transform parts if necessary. + * + * If the bootloader is responsible for creating an instance (if it is a + * abstract type), mark the associated part as a C++ pointer. We do not want + * to change the aggregation kind, since it remains logically a composition, + * it is merely an implementation issue that it must be a pointer for C++ if + * the concrete type is not yet known. + * + * @param compositeImplementation + * a (composite) component + */ + override transformParts(Class compositeImplementation) { + + for (Property attribute : Utils.getParts(compositeImplementation)) { + val type = attribute.type + if (type instanceof Class) { + val cl = type as Class + + // => requires adaptations of boot-loader which is then only + // responsible for creating instances corresponding to types + if (instantiateViaBootloader(cl)) { + StereotypeUtil.apply(attribute, Ptr) + } + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppUtils.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppUtils.xtend new file mode 100644 index 00000000000..1d568623d14 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/CppUtils.xtend @@ -0,0 +1,26 @@ +package org.eclipse.papyrus.qompass.designer.cpp.xtend + +import org.eclipse.uml2.uml.Property ; +import org.eclipse.uml2.uml.AggregationKind +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil +import org.eclipse.papyrus.C_Cpp.Ptr + +public class CppUtils { + public static def nameRef(Property part) { + part.name + refOp(part) + } + + /** + * return the operator for (de-) referencing a part. If the part is + * instantiate via the bootloader, it becomes a pointer. If it is + * instantiated by the composite itself, it is not a pointer, it will be + * instantiated along with the composite + * + * @param part + * @return + */ + public static def refOp(Property part) { + if((part.getAggregation() == AggregationKind.SHARED_LITERAL) || StereotypeUtil.isApplied(part, Ptr)) "->" else "." + } + +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/DynamicCpptoOO.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/DynamicCpptoOO.xtend new file mode 100644 index 00000000000..15a4477e2e4 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/DynamicCpptoOO.xtend @@ -0,0 +1,505 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ +package org.eclipse.papyrus.qompass.designer.cpp.xtend + +import org.eclipse.papyrus.qompass.designer.core.extensions.IOOTrafo +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier +import org.eclipse.uml2.uml.Class +import org.eclipse.uml2.uml.Property +import org.eclipse.uml2.uml.Port +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException +import org.eclipse.papyrus.qompass.designer.core.PortInfo +import org.eclipse.papyrus.qompass.designer.core.PortUtils +import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants +import org.eclipse.papyrus.qompass.designer.core.Utils +import org.eclipse.papyrus.qompass.designer.core.transformations.CompTypeTrafos +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil +import org.eclipse.uml2.uml.AggregationKind +import org.eclipse.uml2.uml.UMLPackage +import org.eclipse.uml2.uml.OpaqueBehavior +import org.eclipse.uml2.uml.ConnectorEnd +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil +import org.eclipse.papyrus.C_Cpp.Ptr +import org.eclipse.uml2.uml.Type +import java.util.HashMap +import java.util.Map +import org.eclipse.uml2.uml.Connector +import org.eclipse.emf.common.util.EList +import org.eclipse.papyrus.qompass.designer.cpp.Messages +import org.eclipse.papyrus.qompass.designer.cpp.Constants +import static extension org.eclipse.papyrus.qompass.designer.cpp.xtend.CppUtils.nameRef; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil + +/** + * This class realizes the dynamic variant of the OO-transformation + * + */ +class DynamicCppToOO implements IOOTrafo { + + protected LazyCopier copier + + val static final String PART_MANAGER = "services::PartManager" + + val static final String INIT_PARTS = "initParts" + + // name of generic "parts" attribute for dynamic deployment (TODO: should be inherited) + val static final String PARTS = "parts" + + val static final String progLang = "C/C++" + + protected Class bootloader // why required? + + def override init(LazyCopier copier, Class bootloader) { + this.copier = copier + this.bootloader = bootloader + } + + override addPortOperations(Class implementation) { + addGetPortOperation(implementation) + addConnectPortOperation(implementation) + } + + /** + * Add the get_p operation for each port with a provided interface. It also + * adds a suitable implementation that evaluates delegation connectors from + * the port to a property within the composite. The delegation target could + * either be a normal class (no port) or an inner component. + * + * @param implementation + */ + def addGetPortOperation(Class implementation) { + for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { + val providedIntf = portInfo.getProvided() + if (providedIntf != null) { + + // port provides an interface, add "get_p" operation & + // implementation + val opName = PrefixConstants.getP_Prefix + portInfo.name + var op = implementation.getOwnedOperation(opName, null, null) + if (op != null) { + + // operation already exists. Assume that user wants to + // override standard delegation + if (op.type != providedIntf) { + op.createOwnedParameter(Constants.retParamName, providedIntf) + } + } else { + op = implementation.createOwnedOperation(opName, null, null, providedIntf) + val retParam = op.getOwnedParameters().get(0) + retParam.setName(Constants.retParamName) + StereotypeUtil.apply(retParam, Ptr) + + val behavior = implementation.createOwnedBehavior(opName, UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + op.getMethods().add(behavior) + + val ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) + + // if there is an delegation to an inner property, delegate to + // it + // Make distinction between delegation to component (with a + // port) or + // "normal" class (without). + var String body + if (ce != null) { + val part = ce.partWithPort + val role = ce.role + + body = "return " + if (role instanceof Port) { + + // check whether the part exists within the implementation (might not be the case + // due to partially copied composites). + // Check is based on names, since the connector points to elements within another + // model (copyClassifier does not make a proper connector copy) + // TODO: this will NOT work for extended ports! + body += '''«part.nameRef»«PrefixConstants.getP_Prefix»«role.name»();''' + } else { + + // role is not a port: connector connects directly to a + // structural feature + // without passing via a port + // TODO: check whether structural feature exists + body += role.name + } + } else { + + // no delegation, check whether port implements provided interface + var implementsIntf = implementation.getInterfaceRealization(null, providedIntf) != null + if (!implementsIntf) { + + // The extended port itself is not copied to the target + // model (since referenced via a stereotype). Therefore, + // a port of an extended port still points to the + // original model. We try whether the providedIntf + // within + // the target model is within the interface + // realizations. + val providedIntfInCopy = copier.getCopy(providedIntf) + implementsIntf = implementation.getInterfaceRealization(null, providedIntfInCopy) != null + } + if (implementsIntf) { + body = "return this;" + } else { + throw new RuntimeException( + String.format(Messages.CompImplTrafos_IntfNotImplemented, providedIntf.name, + portInfo.port.name, implementation.name)) + } + } + behavior.getLanguages().add(Constants.progLang) + behavior.getBodies().add(body) + } + } + } + } + + /** + * Add a connect_ operation for ports with a required interface. + * Whereas operation and a behavior is added for each owned port, a behavior + * (method) is needed for ports inherited from a component type (the + * behavior is implementation specific, as it needs to take delegation to + * parts into account) + * + * @param implementation + */ + static def addConnectPortOperation(Class implementation) { + for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { + val requiredIntf = portInfo.getRequired() + if (requiredIntf != null) { + + // port requires an interface, add "connect_p" operation & + // implementation + val opName = PrefixConstants.connectQ_Prefix + portInfo.name + + if (implementation.getOwnedOperation(opName, null, null) != null) { + // do not add the operation, if it already exists. This means that the + // user wants to override it with custom behavior. In case of extended + // ports, we may have to do that. + } else { + var op = implementation.createOwnedOperation(opName, null, null) + val boolean multiPort = (portInfo.getUpper() > 1) || (portInfo.getUpper() == -1) // -1 indicates "*" + if (multiPort) { + + // add index parameter + val eLong = Utils.getQualifiedElement(PackageUtil.getRootPackage(implementation), + CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE) + if (eLong instanceof Type) { + op.createOwnedParameter("index", eLong as Type) + } else { + throw new RuntimeException( + String.format(Messages.CompImplTrafos_CannotFindType, + CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE)) + } + } + val refParam = op.createOwnedParameter("ref", requiredIntf) + StereotypeUtil.apply(refParam, Ptr) + + val behavior = implementation.createOwnedBehavior(opName, UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + + op.getMethods().add(behavior) + + val ConnectorEnd ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) + + // if there is an delegation to an inner property, delegate to it + // Make distinction between delegation to component (with a port) or + // "normal" class (without). + var String body + if (ce != null) { + val part = ce.partWithPort + body = part.name + val role = ce.role + if (role instanceof Port) { + // in case of a delegation, use name of target port which might be different + val targetOpName = PrefixConstants.connectQ_Prefix + role.name + body = '''«part.nameRef»«targetOpName»''' + + // TODO: no check that multiplicity of both port matches + if ((portInfo.getUpper() > 1) || (portInfo.getUpper() == -1)) { + body += "(index, ref);"; + } + else { + body += "(ref);"; + } + + } else { + // TODO: does this case make sense? + body += '''«part.name»;''' + } + } else { + // no delegation - create attribute for port + val attributeName = PrefixConstants.attributePrefix + portInfo.name + if (!Utils.hasNonPortOwnedAttribute(implementation, attributeName)) { + val attr = implementation.createOwnedAttribute(attributeName, requiredIntf) + LazyCopier.copyMultElemModifiers(portInfo.port, attr) + + // is shared (should store a reference) + attr.setAggregation(AggregationKind.SHARED_LITERAL) + } + body = attributeName + if(multiPort) body += "[index]" + body += " = ref;" + } + + // TODO: defined by template + behavior.getLanguages().add(Constants.progLang) + behavior.getBodies().add(body) + + // ------------------------- + // add body to get-connection operation (which exists already if the port is also + // owned, since it is synchronized automatically during model edit) + // getConnQ prefix may be empty to indicate that the port is accessed directly + // TODO: reconsider optimization that delegated required ports do not have a + // local attribute & associated operation (an inner class may delegate, but the + // composite may be using it as well). + if ((PrefixConstants.getConnQ_Prefix.length() > 0) && (ce != null)) { + val getConnOpName = PrefixConstants.getConnQ_Prefix + portInfo.name + var getConnOp = implementation.getOwnedOperation(getConnOpName, null, null) + if (getConnOp == null) { + getConnOp = implementation.createOwnedOperation(getConnOpName, null, null, requiredIntf) + val retParam = op.getOwnedParameters().get(0) + retParam.setName(Constants.retParamName) + StereotypeUtil.apply(retParam, Ptr) + } + val getConnBehavior = implementation.createOwnedBehavior(getConnOpName, + UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + getConnOp.getMethods().add(getConnBehavior) + + // no delegation + val String name = PrefixConstants.attributePrefix + portInfo.name + body = '''return «name»;''' + behavior.getLanguages().add(Constants.progLang) + behavior.getBodies().add(body) + } + } + } + } + } + + /** + * Add an operation "createConnections" that implements the connections + * between composite parts. It only takes the assembly connections into + * account, since delegation connectors are handled by the get_ and connect_ + * port operations above. + * + * @param implementation + */ + override addConnectionOperation(Class compositeImplementation) throws TransformationException { + var createConnBody = "" + val Map indexMap = new HashMap() + + for (Connector connector : compositeImplementation.getOwnedConnectors()) { + if (ConnectorUtil.isAssembly(connector)) { + + // Boolean associationBased = false + if (connector.ends.size() != 2) { + throw new TransformationException( + '''Connector <«connector.name»> does not have two ends. This is currently not supported''') + } + val end1 = connector.ends.get(0) + val end2 = connector.ends.get(1) + var cmd = '''// realization of connector <«connector.name»>\n''' + if ((end1.role instanceof Port) && PortUtils.isExtendedPort(end1.role as Port)) { + val port = end1.role as Port + val EList subPorts = PortUtils.flattenExtendedPort(port) + for (PortInfo subPort : subPorts) { + cmd += ''' // realization of connection for sub-port «subPort.port.name»\n''' + cmd += connectPorts(indexMap, connector, end1, end2, subPort.port) + cmd += connectPorts(indexMap, connector, end2, end1, subPort.port) + } + } else { + cmd += connectPorts(indexMap, connector, end1, end2, null) + cmd += connectPorts(indexMap, connector, end2, end1, null) + } + createConnBody += cmd + "\n" + } + } + + // TODO: use template, as in bootloader + if (createConnBody.length() > 0) { + val operation = compositeImplementation.createOwnedOperation(Constants.CREATE_CONNECTIONS, null, null) + + val behavior = compositeImplementation.createOwnedBehavior("b:" + operation.name, + UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + behavior.getLanguages().add(Constants.progLang) + behavior.getBodies().add(createConnBody) + behavior.setSpecification(operation) + } + } + + /** + * Create the body C++ code code that creates a connection between the two ends + * of a connector. This function checks whether the first end really is a receptacle + * and the second really is a facet. + * TODO: cleaner rewrite in xtend + * + * @param indexMap + * a map of indices that are used in case of multiplex + * receptacles + * @param connector + * a connector + * @param receptacleEnd + * an end of the connector that may point to a receptacle port + * @param facetEnd + * an end of the connector that may point to a facet port + * @param subPort + * a sub-port in case of extended ports + * @return + * @throws TransformationException + */ + static def connectPorts(Map indexMap, Connector connector, ConnectorEnd receptacleEnd, + ConnectorEnd facetEnd, Port subPort) throws TransformationException { + val association = connector.type + if ((receptacleEnd.role instanceof Port) && (facetEnd.role instanceof Port)) { + val facetPort = facetEnd.role as Port + val receptaclePort = receptacleEnd.role as Port + val facetPI = PortInfo.fromSubPort(facetPort, subPort) + val receptaclePI = PortInfo.fromSubPort(receptaclePort, subPort) + + if ((facetPI.getProvided() != null) && (receptaclePI.getRequired() != null)) { + val facetPart = facetEnd.partWithPort + val receptaclePart = receptacleEnd.partWithPort + + var subPortName = "" + if(subPort != null) subPortName += "_" + subPort.name + val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) + val setter = '''«receptaclePart.nameRef»connect_«receptaclePort.name» «subPortName»;''' + val getter = '''«facetPart.nameRef»get_«facetPort.name» «subPortName»()''' + return '''«setter»(«indexName»«getter»);\n''' + } + + } else if (receptacleEnd.role instanceof Port) { + + // only the receptacle end is of type port. + val Port receptaclePort = receptacleEnd.role as Port + if (PortUtils.getRequired(receptaclePort) != null) { + val facetPart = facetEnd.role as Property + val receptaclePart = facetEnd.partWithPort + + val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) + val setter = '''«receptaclePart.nameRef»connect_«receptaclePort.name»''' + val getter = '''&«facetPart.name»''' + return '''«setter»(«indexName»«getter»);\n''' + } + } else if (facetEnd.role instanceof Port) { + + // only the facet end is of type port. Unsupported combination + val facetPort = facetEnd.role as Port + if (PortUtils.getProvided(facetPort) != null) { + val facetPart = facetEnd.partWithPort + val receptaclePart = facetEnd.role as Property + + val setter = receptaclePart.name + val getter = '''«facetPart.nameRef»get_«facetPort.name»();''' + return '''«setter» = «getter»;\n''' + } + } else if (association != null) { + + // both connector ends do not target ports. In this case, we require that the connector is typed + // with an association. We use this association to find out which end is navigable and assume that + // the part pointed to by the other end is a pointer that gets initialized with the part of the + // navigable end. + val facetPart = facetEnd.role as Property + val receptaclePart = receptacleEnd.role as Property + + val assocProp1 = association.getMemberEnd(null, facetPart.type) + + // Property assocProp2 = facetPart.getOtherEnd() + if ((assocProp1 != null) && assocProp1.isNavigable) { + val setter = '''«receptaclePart.nameRef»«assocProp1.name»''' + val getter = '''&«facetPart.name»''' + return '''«setter» = «getter»;\n''' + } + } else { + + // not handled (a connector not targeting a port must be typed) + throw new TransformationException( + "Connector <" + connector.name + + "> does not use ports, but it is not typed (only connectors between ports should not be typed)") + } + return "" + } + + /** + * Handle ports with multiplicity > 1. The idea is that we could have + * multiple connections targeting a receptacle. The first connection would + * start with index 0. Implementations can make no assumption which + * connection is associated with a certain index. [want to avoid associative + * array in runtime]. + * + * @param port + * @param end + * @return + */ + static def getIndexName(Map indexMap, Port port, ConnectorEnd end) { + if ((port.getUpper() > 1) || (port.getUpper() == -1)) { + + // index depends of combination of property and port, use connector + // end as key + var indexValue = indexMap.get(end) + if (indexValue == null) { + indexValue = 0 + indexMap.put(end, indexValue) + } + var index = indexValue + ", " + indexValue++ + indexMap.put(end, indexValue) + return index + } + return "" + } + + /** + * Transform parts if necessary. + * + * @param compositeImplementation + * a (composite) component + */ + override transformParts(Class compositeImplementation) { + +/* + for (Property attribute : Utils.getParts(compositeImplementation)) { + val type = attribute.type + if (type instanceof Class) { + val cl = type as Class + + // always transform into pointer (enable dynamic creation) + StereotypeUtil.apply(attribute, Ptr) + } + } +*/ + var String initPartsBody = "" + for (Property attribute : Utils.getParts(compositeImplementation)) { + val type = attribute.type; + if (type instanceof Class) { + initPartsBody += initPartBody(attribute); + attribute.destroy(); + } + } + + val partManager = Utils.getQualifiedElement(PackageUtil.getRootPackage(compositeImplementation), PART_MANAGER); + if (partManager instanceof Type) { + compositeImplementation.createOwnedAttribute(PARTS, partManager as Type); + } + + val operation = compositeImplementation.createOwnedOperation(INIT_PARTS, null, null); + + val behavior = compositeImplementation.createOwnedBehavior("b:" + operation.name, UMLPackage.eINSTANCE.opaqueBehavior) + as OpaqueBehavior + behavior.getLanguages().add(progLang); + behavior.getBodies().add(initPartsBody); + } + + def initPartBody(Property part) { + "parts.add(" + part.getName() + ", " + part.getType() + ")" + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/StaticCppToOO.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/StaticCppToOO.xtend new file mode 100644 index 00000000000..4788177ede6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/src/org/eclipse/papyrus/qompass/designer/cpp/xtend/StaticCppToOO.xtend @@ -0,0 +1,550 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ +package org.eclipse.papyrus.qompass.designer.cpp.xtend + +import org.eclipse.papyrus.qompass.designer.core.extensions.IOOTrafo +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier +import org.eclipse.uml2.uml.Class +import org.eclipse.uml2.uml.Property +import org.eclipse.uml2.uml.Port +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException +import org.eclipse.papyrus.qompass.designer.core.PortInfo +import org.eclipse.papyrus.qompass.designer.core.PortUtils +import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants +import org.eclipse.papyrus.qompass.designer.core.Utils +import org.eclipse.papyrus.qompass.designer.core.transformations.CompTypeTrafos +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil +import org.eclipse.uml2.uml.AggregationKind +import org.eclipse.uml2.uml.UMLPackage +import org.eclipse.uml2.uml.OpaqueBehavior +import org.eclipse.uml2.uml.ConnectorEnd +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil +import org.eclipse.papyrus.C_Cpp.Ptr +import org.eclipse.uml2.uml.Type +import java.util.HashMap +import java.util.Map +import org.eclipse.uml2.uml.Connector +import org.eclipse.emf.common.util.EList +import org.eclipse.uml2.uml.StructuralFeature +import org.eclipse.papyrus.qompass.designer.cpp.Messages +import org.eclipse.papyrus.qompass.designer.cpp.Constants +import static extension org.eclipse.papyrus.qompass.designer.cpp.xtend.CppUtils.nameRef; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil + +/** + * This class realizes the transformation from component-based to object-oriented + * models. It includes the replacement of ports and connectors. Ports are + * replaced with attributes and access operations, connectors within a composite + * by an operation that creates the initial setup. + * + * 1. add an operation that allows to retrieve the reference to an interface provided + * by a port. This operation has a mapping specific name, e.g. get_ + * 2. add an operation that allows to connect a specific port. + * the connect_q operation (*including a + * storage attribute*) for a port with a required interface + * 3. add an implementation for the getcnx_q operation for a port + * with a required interface (the operation itself has been added before) + * + * Problems: need to align bootloader creation with this mapping, since + * the bootloader may be responsible for instantiation + * + * Caveat: Assure that the folder derivedInterfaces already exists in a model. + * Otherwise the call to getProvided/getRequired interface might trigger its + * creation resulting in the corruption of list iterators (ConcurrentAccess + * exception) + */ +class StaticCppToOO implements IOOTrafo { + + protected LazyCopier copier + + def override init(LazyCopier copier, Class bootloader) { + this.copier = copier + } + + override addPortOperations(Class implementation) { + // only implementations (non abstract classes) have get operations for ports + if (Utils.isCompImpl(implementation)) { + addGetPortOperation(implementation) + } + // but all classes need a connection operation, since it does not rely on an implementation + addConnectPortOperation(implementation) + } + + /** + * Add the get_p operation for each port with a provided interface. It also + * adds a suitable implementation that evaluates delegation connectors from + * the port to a property within the composite. The delegation target could + * either be a normal class (no port) or an inner component. + * + * @param implementation + */ + def addGetPortOperation(Class implementation) { + for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { + val providedIntf = portInfo.getProvided() + if (providedIntf != null) { + + // port provides an interface, add "get_p" operation & + // implementation + val opName = PrefixConstants.getP_Prefix + portInfo.name + var op = implementation.getOwnedOperation(opName, null, null) + if (op != null) { + + // operation already exists. Assume that user wants to + // override standard delegation + if (op.type != providedIntf) { + op.createOwnedParameter(Constants.retParamName, providedIntf) + } + } else { + op = implementation.createOwnedOperation(opName, null, null, providedIntf) + val retParam = op.getOwnedParameters().get(0) + retParam.setName(Constants.retParamName) + StereotypeUtil.apply(retParam, Ptr) + + val behavior = implementation.createOwnedBehavior(opName, + UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + op.getMethods().add(behavior) + + val ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) + + // if there is an delegation to an inner property, delegate to it + // Make distinction between delegation to component (with a port) or + // "normal" class (without). + var String body + if (ce != null) { + val part = ce.partWithPort + val role = ce.role + + body = "return " + if (role instanceof Port) { + + // check whether the part exists within the implementation (might not be the case + // due to partially copied composites). + // Check is based on names, since the connector points to elements within another + // model (copyClassifier does not make a proper connector copy) + // TODO: this will NOT work for extended ports! + body += '''«part.nameRef»«PrefixConstants.getP_Prefix»«role.name»();''' + } else { + + // role is not a port: connector connects directly to a + // structural feature + // without passing via a port + // TODO: check whether structural feature exists + body += role.name + } + } else { + + // no delegation, check whether port implements provided interface + var implementsIntf = implementation.getInterfaceRealization(null, providedIntf) != null + if (!implementsIntf) { + + // The extended port itself is not copied to the target + // model (since referenced via a stereotype). Therefore, + // a port of an extended port still points to the + // original model. We try whether the providedIntf + // within + // the target model is within the interface + // realizations. + val providedIntfInCopy = copier.getCopy(providedIntf) + implementsIntf = implementation.getInterfaceRealization(null, providedIntfInCopy) != null + } + if (implementsIntf) { + body = "return this;" + } else { + throw new RuntimeException( + String.format(Messages.CompImplTrafos_IntfNotImplemented, providedIntf.name, + portInfo.port.name, implementation.name)) + } + } + behavior.getLanguages().add(Constants.progLang) + behavior.getBodies().add(body) + } + } + } + } + + /** + * Add a connect_ operation for ports with a required interface. + * Whereas operation and a behavior is added for each owned port, a behavior + * (method) is needed for ports inherited from a component type (the + * behavior is implementation specific, as it needs to take delegation to + * parts into account) + * + * @param implementation + */ + static def addConnectPortOperation(Class implementation) { + for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { + val requiredIntf = portInfo.getRequired() + if (requiredIntf != null) { + + // port requires an interface, add "connect_p" operation & + // implementation + val opName = PrefixConstants.connectQ_Prefix + portInfo.name + + if (implementation.getOwnedOperation(opName, null, null) != null) { + // do not add the operation, if it already exists. This means that the + // user wants to override it with custom behavior. In case of extended + // ports, we may have to do that. + } else { + var op = implementation.createOwnedOperation(opName, null, null) + val boolean multiPort = (portInfo.getUpper() > 1) || (portInfo.getUpper() == -1) // -1 indicates "*" + if (multiPort) { + + // add index parameter + val eLong = Utils.getQualifiedElement(PackageUtil.getRootPackage(implementation), + CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE) + if (eLong instanceof Type) { + op.createOwnedParameter("index", eLong as Type) + } else { + throw new RuntimeException( + String.format(Messages.CompImplTrafos_CannotFindType, + CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE)) + } + } + val refParam = op.createOwnedParameter("ref", requiredIntf) + StereotypeUtil.apply(refParam, Ptr) + + val behavior = implementation.createOwnedBehavior(opName, + UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + + op.getMethods().add(behavior) + + val ConnectorEnd ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) + + // if there is an delegation to an inner property, delegate to it + // Make distinction between delegation to component (with a port) or + // "normal" class (without). + var String body + if (ce != null) { + val part = ce.partWithPort + body = part.name + val role = ce.role + if (role instanceof Port) { + // in case of a delegation, use name of target port which might be different + val targetOpName = PrefixConstants.connectQ_Prefix + role.name + body = '''«part.nameRef»«targetOpName»''' + + // TODO: no check that multiplicity of both port matches + if ((portInfo.getUpper() > 1) || (portInfo.getUpper() == -1)) { + body += "(index, ref);" + } else { + body += "(ref);" + } + + } else { + // TODO: does this case make sense? + body += '''«part.name»;''' + } + } else { + // no delegation - create attribute for port + val attributeName = PrefixConstants.attributePrefix + portInfo.name + if (!Utils.hasNonPortOwnedAttribute(implementation, attributeName)) { + val attr = implementation.createOwnedAttribute(attributeName, requiredIntf) + LazyCopier.copyMultElemModifiers(portInfo.port, attr) + + // is shared (should store a reference) + attr.setAggregation(AggregationKind.SHARED_LITERAL) + } + body = attributeName + if(multiPort) body += "[index]" + body += " = ref;" + } + + // TODO: defined by template + behavior.getLanguages().add(Constants.progLang) + behavior.getBodies().add(body) + + // ------------------------- + // add body to get-connection operation (which exists already if the port is also + // owned, since it is synchronized automatically during model edit) + // getConnQ prefix may be empty to indicate that the port is accessed directly + // TODO: reconsider optimization that delegated required ports do not have a + // local attribute & associated operation (an inner class may delegate, but the + // composite may be using it as well). + if ((PrefixConstants.getConnQ_Prefix.length() > 0) && (ce != null)) { + val getConnOpName = PrefixConstants.getConnQ_Prefix + portInfo.name + var getConnOp = implementation.getOwnedOperation(getConnOpName, null, null) + if (getConnOp == null) { + getConnOp = implementation.createOwnedOperation(getConnOpName, null, null, requiredIntf) + val retParam = op.getOwnedParameters().get(0) + retParam.setName(Constants.retParamName) + StereotypeUtil.apply(retParam, Ptr) + } + val getConnBehavior = implementation.createOwnedBehavior(getConnOpName, + UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + getConnOp.getMethods().add(getConnBehavior) + + // no delegation + val String name = PrefixConstants.attributePrefix + portInfo.name + body = '''return «name»;''' + behavior.getLanguages().add(Constants.progLang) + behavior.getBodies().add(body) + } + } + } + } + } + + /** + * Add an operation "createConnections" that implements the connections + * between composite parts. It only takes the assembly connections into + * account, since delegation connectors are handled by the get_ and connect_ + * port operations above. + * + * @param implementation + */ + override addConnectionOperation(Class compositeImplementation) throws TransformationException { + var createConnBody = "" + val Map indexMap = new HashMap() + + for (Connector connector : compositeImplementation.getOwnedConnectors()) { + if (ConnectorUtil.isAssembly(connector)) { + + // Boolean associationBased = false + if (connector.ends.size() != 2) { + throw new TransformationException( + '''Connector <«connector.name»> does not have two ends. This is currently not supported''') + } + val end1 = connector.ends.get(0) + val end2 = connector.ends.get(1) + var cmd = '''// realization of connector <«connector.name»>''' + "\n" + if ((end1.role instanceof Port) && PortUtils.isExtendedPort(end1.role as Port)) { + val port = end1.role as Port + val EList subPorts = PortUtils.flattenExtendedPort(port) + for (PortInfo subPort : subPorts) { + cmd += ''' // realization of connection for sub-port «subPort.port.name»''' + "\n" + cmd += connectPorts(indexMap, connector, end1, end2, subPort.port) + cmd += connectPorts(indexMap, connector, end2, end1, subPort.port) + } + } else { + cmd += connectPorts(indexMap, connector, end1, end2, null) + cmd += connectPorts(indexMap, connector, end2, end1, null) + } + createConnBody += cmd + "\n" + } + } + + // TODO: use template, as in bootloader + if (createConnBody.length() > 0) { + val operation = compositeImplementation.createOwnedOperation(Constants.CREATE_CONNECTIONS, null, null) + + val behavior = compositeImplementation.createOwnedBehavior("b:" + operation.name, + UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + behavior.getLanguages().add(Constants.progLang) + behavior.getBodies().add(createConnBody) + behavior.setSpecification(operation) + } + } + + /** + * Create the body C++ code code that creates a connection between the two ends + * of a connector. This function checks whether the first end really is a receptacle + * and the second really is a facet. + * + * @param indexMap + * a map of indices that are used in case of multiplex + * receptacles + * @param connector + * a connector + * @param receptacleEnd + * an end of the connector that may point to a receptacle port + * @param facetEnd + * an end of the connector that may point to a facet port + * @param subPort + * a sub-port in case of extended ports + * @return + * @throws TransformationException + */ + static def connectPorts(Map indexMap, Connector connector, ConnectorEnd receptacleEnd, + ConnectorEnd facetEnd, Port subPort) throws TransformationException { + val association = connector.type + if ((receptacleEnd.role instanceof Port) && (facetEnd.role instanceof Port)) { + val facetPort = facetEnd.role as Port + val receptaclePort = receptacleEnd.role as Port + val facetPI = PortInfo.fromSubPort(facetPort, subPort) + val receptaclePI = PortInfo.fromSubPort(receptaclePort, subPort) + + if ((facetPI.getProvided() != null) && (receptaclePI.getRequired() != null)) { + val facetPart = facetEnd.partWithPort + val receptaclePart = receptacleEnd.partWithPort + + var subPortName = "" + if(subPort != null) subPortName += "_" + subPort.name + val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) + val setter = '''«receptaclePart.nameRef»connect_«receptaclePort.name» «subPortName»''' + val getter = '''«facetPart.nameRef»get_«facetPort.name» «subPortName»()''' + return '''«setter»(«indexName»«getter»);''' + "\n" + } + + } else if (receptacleEnd.role instanceof Port) { + + // only the receptacle end is of type port. + val Port receptaclePort = receptacleEnd.role as Port + if (PortUtils.getRequired(receptaclePort) != null) { + val facetPart = facetEnd.role as Property + val receptaclePart = facetEnd.partWithPort + + val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) + val setter = '''«receptaclePart.nameRef»connect_«receptaclePort.name»''' + val getter = '''&«facetPart.name»''' + return '''«setter»(«indexName»«getter»);''' + "\n" + } + } else if (facetEnd.role instanceof Port) { + + // only the facet end is of type port. Unsupported combination + val facetPort = facetEnd.role as Port + if (PortUtils.getProvided(facetPort) != null) { + val facetPart = facetEnd.partWithPort + val receptaclePart = facetEnd.role as Property + + val setter = receptaclePart.name + val getter = '''«facetPart.nameRef»get_«facetPort.name»();''' + return '''«setter» = «getter»;''' + "\n" + } + } else if (association != null) { + + // both connector ends do not target ports. In this case, we require that the connector is typed + // with an association. We use this association to find out which end is navigable and assume that + // the part pointed to by the other end is a pointer that gets initialized with the part of the + // navigable end. + val facetPart = facetEnd.role as Property + val receptaclePart = receptacleEnd.role as Property + + val assocProp1 = association.getMemberEnd(null, facetPart.type) + + // Property assocProp2 = facetPart.getOtherEnd() + if ((assocProp1 != null) && assocProp1.isNavigable) { + val setter = '''«receptaclePart.nameRef»«assocProp1.name»''' + val getter = '''&«facetPart.name»''' + return '''«setter» = «getter»;''' + "\n" + } + } else { + + // not handled (a connector not targeting a port must be typed) + throw new TransformationException("Connector <" + connector.name + + "> does not use ports, but it is not typed (only connectors between ports should not be typed)") + } + return "" + } + + /** + * Handle ports with multiplicity > 1. The idea is that we could have + * multiple connections targeting a receptacle. The first connection would + * start with index 0. Implementations can make no assumption which + * connection is associated with a certain index. [want to avoid associative + * array in runtime]. + * + * @param port + * @param end + * @return + */ + static def getIndexName(Map indexMap, Port port, ConnectorEnd end) { + if ((port.getUpper() > 1) || (port.getUpper() == -1)) { + + // index depends of combination of property and port, use connector + // end as key + var indexValue = indexMap.get(end) + if (indexValue == null) { + indexValue = 0 + indexMap.put(end, indexValue) + } + var index = indexValue + ", " + indexValue++ + indexMap.put(end, indexValue) + return index + } + return "" + } + + /** + * Return true, if the bootloader is responsible for the instantiation of a + * part. [Structual difference: bootloader can decide instance based - and + * instances are deployed] + * + * If a part is a component type or an abstract implementation, it cannot be + * instantiated. Thus, a heir has to be selected in the deployment plan. + * Since the selection might be different for different instances of the + * composite, the instantiation is not done by the component itself, but by + * the bootloader. The bootloader also has to instantiate, if different + * allocation variants are required. (this is for instance the case for + * distribution connectors and for the system itself) + * + * If possible, we want to let composites instantiate sub-components, since + * this eases the transition to systems which support reconfiguration. + * + * [TODO: optimization: analyze whether the deployment plan selects a single + * implementation. If yes, let the composite instantiate] + * + * [TODO: elements within an assembly need to be instantiated by composite - + * if System - by bootloader. assembly also need to be instantiated by + * composite!! + * + * @param implementation + * @return + */ + static def instantiateViaBootloader(Class implementation) { + return implementation.isAbstract() || Utils.isAssembly(implementation) + } + + /** + * Return whether a part needs to be instantiated by the bootloader instead + * by the composite in which it is contained. The criteria is based on the + * question whether the containing composite is flattened, as it is the case + * for the system component and the interaction components for distribution. + * + * @param part + * @return + */ + static def instantiateViaBootloader(StructuralFeature part) { + if (part != null) { + if (part.type instanceof Class) { + val implementation = part.type as Class + // TODO: wrong criteria? (must be shared or not?) + return instantiateViaBootloader(implementation) + } else { + + // not a class, assume primitive type instantiated by composite + return false + } + } + return false + } + + /** + * Transform parts if necessary. + * + * If the bootloader is responsible for creating an instance (if it is a + * abstract type), mark the associated part as a C++ pointer. We do not want + * to change the aggregation kind, since it remains logically a composition, + * it is merely an implementation issue that it must be a pointer for C++ if + * the concrete type is not yet known. + * + * @param compositeImplementation + * a (composite) component + */ + override transformParts(Class compositeImplementation) { + + for (Property attribute : Utils.getParts(compositeImplementation)) { + val type = attribute.type + if (type instanceof Class) { + val cl = type as Class + + // => requires adaptations of boot-loader which is then only + // responsible for creating instances corresponding to types + if (instantiateViaBootloader(cl)) { + StereotypeUtil.apply(attribute, Ptr) + } + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/xtend-gen/.gitignore b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/xtend-gen/.gitignore new file mode 100644 index 00000000000..c96a04f008e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp/xtend-gen/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/.classpath b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/.project b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/.project new file mode 100644 index 00000000000..95ded03ad32 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.qompass.designer.doc + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c537b63063c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/META-INF/MANIFEST.MF b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..d043db34c31 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.help;bundle-version="3.5.0", + org.eclipse.ui.cheatsheets;bundle-version="3.4.0" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.qompass.designer.doc.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.doc;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/about.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

    About This Content

    + +

    November 14, 2008

    +

    License

    + +

    The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

    + +

    If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

    + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/build.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/build.properties new file mode 100644 index 00000000000..7ea784f3854 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/build.properties @@ -0,0 +1,12 @@ +source.. = src/ +output.. = bin/ +bin.includes = .,\ + plugin.xml,\ + help/,\ + cheatsheet/,\ + html/,\ + toc.xml,\ + about.html,\ + plugin.properties,\ + META-INF/ +src.includes = about.html diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/AddPorts.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/AddPorts.xml new file mode 100644 index 00000000000..59c01e6c693 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/AddPorts.xml @@ -0,0 +1,109 @@ + + + + + Model the ports of a component + + + + + + + + Select a port from the "Palette", under "Nodes", and create a new + port on a component type or implementation.
    +
    + Note: a port of a component type is implicitly included in all + component implementations inheriting from it
    + Note: inherited ports are not shown by default. In order to visualize these, do + not create a new port, but drag and drop the inherited port from the + model explorer on the component that inherits the port. +
    +
    + + + + Your ports need to be named and a port kind (see below) needs to be chosen. + There are several ways to change a port name: either via the + "Properties" view or via a textual dialog that is shown once F2 is pressed. + + An Qompass (FCM) port has an additional parameter: it is characterized by a + port kind. The latter defines for instance if the port + provides or requires an interface or consumes a data-type.
    + A port kind may require a certain variant of a type: data-flow oriented kinds + require a datatype, client/server port kinds require an interface as port type. The user can + verify the suitability of the port type by observing the derived attributes provided and + required interface. If both are not set, the port is wrongly typed. This rule is part of + a set of Qompass related constraints that can be validated at any time. +
    +
    + Assign the port kind attribute: + "Properties" view > Profile > under "Port" and "kind". + Select the value of the port kind. The shown list is a collection of all PortKinds that are + defined in the model itself or one of the libraries it imports. For example, if the ports + requires an interface, the value of the port kind is "BasicCalls::PortKind::UseInterface"
    + Note that the stereotype "Port" from the profile FCM is applied automatically + on all the ports you add to your model. +
    +
    + + + + As for the name, this can be either be done via the "Properties" view or via + a textual dialog that is shown once F2 is pressed. But before a type can be selected, it may have to + be created first. + In our example we want to type the port with an interface which is stored in an additional + package called "interfaces". + + As a good practice, you can group interfaces that are referenced by multiple components in a + package called "interfaces" + "model explorer" view > Right-click on + "ComponentModel" package > New child > Package > Name it "interfaces"
    +
    + Then, under "interfaces" package, create a new class diagram: + "model explorer" view > Right-click on + "interfaces" package > New diagram > Create a new Class Diagram.
    +
    + Open your class diagram and add an interface and operation in standard Papyrus way. +
    +
    + + + + The component that is executed at system startup has to be clearly defined. + Such a component has to inherit from the component type "Cstart" that is defined + in the "BasicCalls" library in the package "StdPorts". It has the port "start" with the provided interface + "IStart", containing the operation run. This operation is called at application start.

    + The addition of Cstart to your composite diagram is performed in 5 steps:
    + 1 - Expand the imports in the "Outline" view > Expand the library + "BasicCalls" > "StdPorts" >. Select "Cstart" component type.
    + 2 - Drag and drop the component type "Cstart" in your composite diagram.
    + 3 - (Optionally) If you want to visualize the port in the diagram, drag and drop the port + "start" on the newly added "Cstart" component.
    + 4 - Add a "Generalization" link that points from your component (type/implementation), + to "Cstart".
    + 5 - (Optionally) If you want to visualize the port in the diagram, drag and drop the port + "start" to the application component + + + + + + A component may want to perform actions directly after instantiation and before destruction. + Such a component has to inherit from the component type "LifeCycle" that is defined + in the "BasicCalls" library in the package "StdPorts". It has the port + "lc" with the provided interface "ILifeCycle", containing the operations + activate and deactivate. + The addition of LifeCycle to your composite diagram is performed in 5 steps:
    + 1 - Expand the imports in the "Outline" view > Expand the library + "BasicCalls" > "StdPorts" >. Select "LifeCylce" component type.
    + 2 - Drag and drop the component type "LifeCycle" in your composite diagram.
    + 3 - (Optionally) If you want to visualize the port in the diagram, drag and drop the port + "lc" on the newly added "LifeCylce" component.
    + 4 - Add a "Generalization" link that points from your component (type/implementation), + to "Cstart".
    + 5 - (Optionally) If you want to visualize the port in the diagram, drag and drop the port + "lc" to the application component +
    +
    + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeCompilation.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeCompilation.xml new file mode 100644 index 00000000000..a8de088de93 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeCompilation.xml @@ -0,0 +1,22 @@ + + + + + Finally, compile the generated code on each node. + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeGeneration.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeGeneration.xml new file mode 100644 index 00000000000..3de326cbd43 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/CodeGeneration.xml @@ -0,0 +1,30 @@ + + + + + Once the allocation is specified, the Qompass plug-in applies a sequence of model transformations to generate the code required on each node. + + + + + Select a deployment plan. Right click and choose "Qompass: generate deployment models and code from plan". Choose among + the available options: (1) only generate a target model and not code, (2) re-create compilations settings and (3) only + generate code for types that have changed. The first option is useful for testing purposes or if the intermediate + models produced by Qompass are inputs for other models. + The second option is useful, if additional container or connector elements require additional libraries that would not + found otherwise. But it overrides user settings. + The last option aims to reduce the time for generating an executable: for each elements that is re-generated, the associated + file need to be re-compiled. + The Qompass plug-in applies a sequence of model transformations that
    + (1) add and adapt connectors and containers as required by the application, + (2) transform the component model into an object-oriented model, i.e. replace ports with attributes and suitable access operations, + (3) create boot-code that instantiates the components and + (4) calculate the sub-set of the resulting model that is required on each node. + Qompass produces a new plugin for each node of the platform model. It contains a suitable project + definition (Eclipse CDT) in the sense that the build settings (macros, include and library paths) + should be configured for the application needs. It also contains a folder "model" along with + the generated model (called "root.uml") and applies the standard UML model-to-code generators + (currently C++) to produce the code required on each node and " +
    +
    +
    diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentDev.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentDev.xml new file mode 100644 index 00000000000..242e723f337 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentDev.xml @@ -0,0 +1,76 @@ + + + + + In this step, you model a component within a composite diagram. + + + + + + The first decision is whether you want to define a component type or a component implementation. + A component type is useful, if you anticipate that more than one implementation are required sooner or later. + The decision is comparable to the decision whether interfaces should be used in an object-oriented + approach: it is more flexible, but requires an additional definition (beside this reflection, there is nothing to do + in this step). + + + + + + As a good practice, we recommend to create a package for each component which will group all + component-related elements e.g. type, implementation(s) and associated diagrams.
    + ModelExplorer > Right-click on your "ComponentModel" package > Add child > Package. + Name the created package according to your application needs. A convention (not enforced) used in Qompass is + to use the same name for the package and component type, add the post-fix "Impl" in case of a + component implementation. + Show View > Papyrus > Model Explorer (or select Papyrus perspective)" skip="true"> + + +
    +
    + + + + Select the package created in the previous step (or the top-level package). Create a composite diagram and open it. Right-click on your package in the + model explorer > new diagram > Create a new Composite Diagram. + + + + + + Create a class. Make it abstract (via the properties view) if it is a component type. + Choose a name which suits your application needs. If you created a type, you + might also want to add an implementation. Convention (not compulsory): use the same name as for the type + and add the postfix "Impl". The link between component type and implementation is manifested by means + of generalization relationship. Use the standard Papyrus mechanisms to create this relationship. + (The realization of an implementation is described in more detail in step 4). + + + + + + A component is optionally enclosed by a so-called container which can perform additional processing. + So called container extensions either intercept incoming port request or perform additional processing. + For further information, consult the Qompass online help. From a user perspective, the choice of a + certain container option is controlled by the application of an ordered set of container rules. + which select the extension or interceptor to use and optionally restrict the use of the rule to + a specific configuration (see deployment)

    + + Qompass provides a specific dialog to selected a container extension. This can be found in the context + menu of a component. +
    +
    + + + + A specific component is typically called "System". It is the main component that will be instantiated + later on. This component is the root of the composition hierarchy, your application components are + parts within it - it is a composite or assembly implementation and further information is therefore + available in the next section. It must not have any ports. + + + +
    diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentImplementation.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentImplementation.xml new file mode 100644 index 00000000000..335fb27986a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentImplementation.xml @@ -0,0 +1,85 @@ + + + + + A component implementation has to realize the operations of interfaces that are provided by + its ports. For each port, there are two options: either the component implements the interface + itself, or it delegates the port to a part which has to implement the interface. + If a component does not have any parts, we call it primitive (or monolithic). + + + + + + If order to implement the operations of a provided interface, these operations have to be + added to the component first. Since it would be tedious to copy an operation signature manually + and keep it synchronized, Qompass offers an operation "Synchronize derived elements" in the + context menu of a component. It will automatically add an "interface realization" + relationship and the operations of the provided interfaces - as long as there is no delegation + to an internal component. These relationships carry the FCM stereotype "DerivedElement" + in order to indicate that these have been added automatically. + + + + + + The implementation could use either the UML action language or a programming language specific + implementation in form of an opaque behavior definition (not yet supported). Here, we will cover + the case of C++
    + Activate the C/C++ view (Views > Papyrus > C/C++). Then, select the operation in the + model explorer or diagram. Enter your code. Note that you can call operations of required ports + by using the port name as a property, i.e. in case of C++ use "portName" -> "operation name" +
    + + + + + + +
    + + + + An component implementation may have an internal structure, i.e. if may contain other components + via composition. Please note that the containment does not mean that a new component is defined + in an existing one, but that the composite component contains an attribute typed with another + component. If this attribute has the "composition" aggregation style, the creation of + an instance of the composite component implies creating an instance of the contained component.
    +
    + The "System" component is a specific composite implementation of your system. + It does not have any implementation of its own but is a kind of aggregation container of your + application components and defines how these are connected (see next step). +
    + + + + +
    + + + + Once the inner parts have been added, the may be connected. Connectors may either delegate + from the composite towards an inner part or connect (assemble) two (or more) internal parts. + A connector may connect either the ports of internal parts or directly an internal part. For the + moment, Qompass supports only the first option. It may be required to drag and drop ports first from + the model explorer to a part (whose type owns the port).
    +
    + A major concept in Qompass is that of a connector. Instead of simply being a "line" between + parts, a connector may be realized a specific interaction component. Which interaction component + is used, is defined by an FCM stereotype attribute owned by the connector. The Qompass palette allows + you to add a connector with the appropriate FCM stereotype directly to your component.
    +
    + In addition, Qompass provides a specific dialog for the selection of an interaction component. + (open the context menu, once a connector is selected). +
    +
    +
    diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentModel.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentModel.xml new file mode 100644 index 00000000000..7af6183b976 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/ComponentModel.xml @@ -0,0 +1,75 @@ + + + + + A component model consists of a set of component definitions. Each component may be either a + primitive (or monolithic) component or a composite component. Whereas the latter contains one + or more parts typed with other components, the former does not contain other components. + Typically, a composite component delegates services provided by some of its ports to inner + components while a primitive component implements the services itself. + There are different strategies, in which order components are implemented, e.g. starting + with the composite components and then defining the sub-components (top-down) or vice-versa + (bottom-up). Both strategies could be mixed. + + + + + In this step, you start by modeling your system in a composite diagram. +

    Start modeling the system type and implementation. +

    A component defines a type when it has more that one implementation, + or when the evolution of the component envisions to group a set of implementations using a type definition. + Optionally, a component may be abstract, i.e. does not provide an implementation. +

    As a good practice, we recommend to define component type only when necessary. +

    In the following, we will define a component type for the components that we will create. +
    + + + + + + + + + + + + + + + + + + + + +
    + + + In this step, you model the monolithic components that your system includes (i.e., the internal parts of your system). +

    Start by modeling the components type, implementation, and their ports in a "component diagram" then model their interfaces in "class diagrams". +
    +
    +
    diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/DeploymentPlan.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/DeploymentPlan.xml new file mode 100644 index 00000000000..726d08968d4 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/DeploymentPlan.xml @@ -0,0 +1,57 @@ + + + + + Generate the instance specification of the system and its internal parts, specify values for configuration attributes and finally + allocate to nodes + + + + + + Up to now, we have modeled components and their composition, but we have not yet instantiated these. + The convention in Qompass is that a single component, typically called System, is the primary + instance. The instantiation of this component implies an instantiation of its parts which + in turn will instantiate their parts (if composites). This instantiation process is + automated by Qompass. The generated instances are part of a package which we call deployment plan + in the sequence. +
    + The automatic generation of the initial deployment plan is performed as follows: + Right click on your "system" component > Qompass: Instantiate system (create deployment plan). + As a result, a "newDeploymentPlan" package is created within "DeploymentPlans". Note that a + deployment plan is a stereotyped UML package serving as a container for the instance + specifications. A stereotype attribute points to the main instance. +
    +
    + + + + The initial deployment plan contains information about the instances within their system (along with their allocation + to a node, see next step). Each instance may have a set of attributes that are subject to configuration, e.g. a FIFO + component might have an attribute that denotes its size or the application of a specific policy. By default, all + attributes that are part of a component type, are considered as configuration attributes, attributes of implementations + need to be marked explicitly by the stereotype FCM::ConfigProperty. UML supports the specification of values via slots. + This is done in Qompass as well, a custom dialog facilitates this configuration: + Right click on your "system" component > Qompass: Configure instantiate properties. + The dialog displays a set of instance specifications that are associated with the property. The + previous operation should have created these instances (there should be one instance per deployment plan). + Once an instance is selected, the user can select a configuration attribute and provide a value for it. If the attribute + has an attached comment, it is assumed to be a description of the configuration attribute and displayed in the dialog + (this is the case for elements of the Qompass library). + + + + + + In order to deploy the system, the instances created before need to be allocated to a + node. The allocation relationship is transitive in two directions: if a composite component + instance is allocated to a node, all sub-instances (= instances of contained parts) are + implicitly also allocated on this node. Vice versa, a composite needs to exist on all + instances where its sub-instances are allocated. +

    + Qompass supports the allocation by means of a specific dialog. It is available in the + context menu of a deployment plan. +
    +
    + +
    diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Main.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Main.xml new file mode 100644 index 00000000000..7196d1103ef --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Main.xml @@ -0,0 +1,69 @@ + + + + + Introduction + This guide will walk you though the process of creating an "Qompass-supported" model and generate the code related to your model. + You will create an empty model and build it gradually to finally generate the related code. + + If you need help at any step, click the (?) to the right. Let's get started! + + + + + Either create a new Qompass model or start with a working example + + + + + + + + + + + + + + + + + + + + + + + + + + Conclusion + + + + + + + + + + + + + + + + Conclusion + + + + + + + Conclusion + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddComponents.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddComponents.xml new file mode 100644 index 00000000000..f7ec40e7aa4 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddComponents.xml @@ -0,0 +1,31 @@ + + + + + + In this step, you model the application components as forseen by MARTE GCM & HLAM. + + + + + + Use the model explorer to create a new composite diagram within the "ComponentModel" package + + + + + Select an element from the MARTE/HLAM palette, i.e. a RtUnit or a PpUnit. These are available, + if the MARTE profile is applied (which should be the case, if you have chosen the Qompass for MARTE template + during model creation). + Now create the GCM component in the diagram. Mapping rules in Qompass will automatically add the FCM implementation + stereotype and set its container rule attribute appropriately to support the two component variants.
    + Verify stereotype application/attribute values in the properties/profile view. Alternatively, right click on + the created component and call the "Qompass show/choose container rules" dialog. +
    +
    + + + Click on the "?" on right to open the online html help + + +
    diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddPorts.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddPorts.xml new file mode 100644 index 00000000000..38233bc7312 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteAddPorts.xml @@ -0,0 +1,21 @@ + + + + + + In this step you will add ports to your MARTE/GCM components + + + + + Use the model explorer to create a new composite diagram within the "components" package + Use the standard MARTE mechanism to add ports, i.e. client/server or flow ports - the associated + FCM stereotypes will be set automatically. + + + + + Click on "?" on the right to open the online html help + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteMain.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteMain.xml new file mode 100644 index 00000000000..e32ef8326fe --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteMain.xml @@ -0,0 +1,81 @@ + + + + + Introduction + This guide will walk you though the process of creating a MARTE model with "Qompass-support" + and generate the code related to your model. + You will create an empty model and build it gradually to finally generate the related code. + If you need help at any step, click the (?) to the right. Let's get started! + + + + + Either create a new Qompass model or start with a working example + + + + + + + + + + + + + + + + + + + + + + + + + + Conclusion + You have now created a MARTE component which has at the same time FCM annotations. You can now + proceed with implementation and deployment as for a standard FCM component + + + + + + + Conclusion
    + You have now created a MARTE component which has at the same time FCM annotations. You can now + proceed with implementation and deployment as for a standard FCM component +
    + +
    + + + + + + + + + + + + Conclusion
    + You have now a project, a model and source code for each target. +
    + +
    + + + + Conclusion
    + You have now a binary per target which is ready for deployment. The actual transfer + to the target is out of Qompass's scope. +
    + +
    +
    +
    diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteNewModel.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteNewModel.xml new file mode 100644 index 00000000000..dbbe1802e86 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/MarteNewModel.xml @@ -0,0 +1,29 @@ + + + + + + In this step you will create a new Qompass Model for MARTE, i.e. a MODEL that applied MARTE GCM as well as the + FCM profile. + + + + Start setting up your environment's perspective. + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/NewModel.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/NewModel.xml new file mode 100644 index 00000000000..68c3c72b990 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/NewModel.xml @@ -0,0 +1,31 @@ + + + + + In this step you will create a new Qompass Model which applies the profile and optionally MARTE GCM + + + Start setting up your environment's perspective. + + + + + Start creating the project that will host your model or create a new model within an existing project. + File > New > Project > Papyrus project > Enter your project name, then select UML as diagram language. On the next page, choose one of the Qompass templates + (currently two, one including MARTE and one without) + + + + + + If you need to create additional models within a project, you can do this at any time using the + Papyrus model wizard. In the context of this tutorial, you can simply skip this step. + Enter your model name, then select UML as diagram language. On the next page, choose one of the Qompass templates + (currently two, one including MARTE and one without) + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/OpenExample.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/OpenExample.xml new file mode 100644 index 00000000000..e6e0d5537a6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/OpenExample.xml @@ -0,0 +1,31 @@ + + + + + In this step you will create a new Qompass model from an example + + + Start setting up your environment's perspective. + + + + + Creating the project that will host your model. You can skip this step, if you want to create the model + in an existing project. + File > New > Project. Enter your project name. + + + + + + Create a new model from an example. + File > New > Example. Choose an Qompass example. Select the parent folder (it is not possible + to change the name of the example, since the model files reference each other. Use File > Save As after opening, + if required). + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/PlatformModel.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/PlatformModel.xml new file mode 100644 index 00000000000..894c7172939 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/PlatformModel.xml @@ -0,0 +1,51 @@ + + + + + The platform modeling consists in specifying the set of nodes on which the system + will be deployed. + + + + + + The platform definition contains a set of nodes. Each node represents a computation resource on a type level. + The specification of a platform is quite similar to the specification of a composite component: it is done by + means of a component (class) whose parts represent the nodes. Each of the parts is typed with a node. Since a + node is a class as well, the inner structure of a node can be equally modeled via parts. Thus, a hardware + specification can be organized hierarchically. + As for software components, we are in the end interested in the instances of our computation resources. An + operation of the Qompass context menu will create this hardware instances from the class representing the hardware + in a similar way as a deployment plan is created. + + Use the FCM stereotype "Target" on nodes to provide information about supported operating system and + available RAM and ROM (currently only the supported operation system information is evaluated). + A node represents a certain type of a computing resource, UML instance specifications represent a concrete + node instance. This concept is useful, if several identical nodes are used within a system. + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Validation.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Validation.xml new file mode 100644 index 00000000000..d9822313b5d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/cheatsheet/Validation.xml @@ -0,0 +1,35 @@ + + + + + Model validation enables the verification of a certain set of rules. Besides the standard UML rules, + Qompass defines a dozen of additional rules, for instance a validation of the typing rules for + ports. + + + + + Verify the validation settings, i.e. the currently active validation rules (constraints). + Open the entry "Model Validation" within Window/Preferences and verify the active constraints. + Qompass related constraints are grouped. + + + + + Validate your model. Click right on an element within the model explorer. Choose + the option "Validate model". Erroneous elements will appear in the Problem view, + will be marked in the model explorer and in the diagrams. Caveat: the model explorer + creates a visual marker for problems found within a child whereas this is not the case for + diagrams. + + + + + Window > Show View > Problems + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/index.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/index.xml new file mode 100644 index 00000000000..6ca8880c3dc --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/index.xml @@ -0,0 +1 @@ + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/tocconcepts.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/tocconcepts.xml new file mode 100644 index 00000000000..a70c9f0c946 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/tocconcepts.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/tocdevguide.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/tocdevguide.xml new file mode 100644 index 00000000000..254dbf34b5d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/tocdevguide.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/tocreference.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/tocreference.xml new file mode 100644 index 00000000000..7f27d062c18 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/help/tocreference.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/bibliography.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/bibliography.html new file mode 100644 index 00000000000..a5bec374c1b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/bibliography.html @@ -0,0 +1,60 @@ + + + + + Bibliography + Qompass + + + +Qompass logo +

    Bibliography

    + +
    +
    +[1] +
    +E. Bruneton, T. Coupaye, and J. Stefani. +The Fractal Component Model, 2004, +Fractal specification. + +
    +[2] +
    +OMG, CORBA Component Model Specification, V3.3 (part 3 of the + CORBA specification), 2012, +OMG Document formal/2012-11-16. CORBA 3.3 + +
    +[3] +
    +OMG, UML Profile for MARTE: Modeling and Analysis of Real-Time + Embedded systems, Version 1.0, 2009. +OMG document ptc/2009-11-02.MARTE 1.1 + +
    +[4] +
    +S. Robert, A. Radermacher, V. Seignole, S. Gérard, V. Watine, and F. Terrier, +Enhancing Interaction Support in the CORBA Component Model. +In A. Rettberg, M. C. Zanella, and F. J. Rammig, editors, From + Specification to Embedded Systems Application, IFIP TC10 Working Conference: + International Embedded Systems Symposium (IESS). Springer, 2005. + +
    +[5] +
    +S. Robert, A. Radermacher, V. Seignole, S. Gérard, V. Watine, and F. Terrier. +The CORBA Connector Model. +In Proceedings of the 5th International Workshop on Software Engineering and Middleware. ACM Digital Library, 2005. + +
    +[6] +
    +M. Shaw and D. Garlan, Software Architecture: Perspectives on an Emerging Discipline, Prentice Hall, 1995. +
    + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/codegen.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/codegen.html new file mode 100644 index 00000000000..37adce760f1 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/codegen.html @@ -0,0 +1,60 @@ + + + + + Code generation + + + +Qompass logo + +

    Code generation

    + +The result of the previous phase is a component model of the application, enriched with reified connectors and expanded containers. +The code generation starting from this model requires two actions: (1) the realization of the component deployment consisting of a +splitting the global model into sub models for each execution node and (2) the transformation of ports and connectors that do not have +a direct equivalent concepts in object-oriented programming languages. + +

    +The former is not as trivial as it may seem since dependencies have to be taken into account and composites may have to be +deployed on multiple nodes due to allocations of theirs parts. This imposes constraints such as only read-only attributes in +these composites to ensure consistency. We do not discuss this issue further in the context of this paper and focus on the +second aspect, the transformation of ports and connectors. + +

    +Ports and connectors do not possess a direct equivalent in an object-oriented programming language. +Thus, it is necessary to relate component-oriented concepts to object-oriented concepts, i.e. classes, interfaces, attributes +and operations. +We distinguish ports with provided interfaces and ports with required interfaces (a port might also have both). +A port providing an interface is an access point to a service and a caller needs to obtain a reference to this service, in +our implementation pattern via a specific operation. For instance, if a component owns a port "p" providing interface "I", +the realization of a component needs an operation "get_p" returning a reference to the service. The implementation of this +operation is determined automatically: in case of a delegation connector between the port and an internal part of a component, +this reference is returned, otherwise a reference to the component reference itself is returned. + +

    +A port with a required interface is an interaction point which requires a reference of another component that provides the +interface. Thus, the component needs to store this reference and provide an operation to initialize the reference in the moment +of instantiation. For instance, a port "q" with an required interface is transformed into an attribute which stores a reference +to a port providing the interface and an operation "connect_q" which initializes this reference. + +

    +Connectors within a composite are transformed into a realization of a specific operation that creates the connections between +parts, i.e. contains suitable combinations of some-part.connect_some-port other-part.get_other-port. + +

    +Once the transformation of component-based models to object-oriented models is done, a "classical" code generator taking an +object-oriented UML model as input is sufficient for the code generation (in our case C++). +For each class or interface, a C++ class is generated. The UML packages are transformed into C++ name spaces. The organization +of the files follows the same as in Java. A name space corresponds to a directory and thus reflects the package structure in UML. + +

    +The dependencies to the external packages are translated into include directives to libraries. The generated code can now +be compiled, for instance in the context of the Eclipse CDT environment. + +

    + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/connector-container.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/connector-container.html new file mode 100644 index 00000000000..057bf4612d1 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/connector-container.html @@ -0,0 +1,114 @@ + + + + + Connector and container pattern + + + + +Qompass logo +

    Connector and container pattern

    + +

    +The connector pattern is based on the idea of Garlan and Shaw that a realization of an interaction must be +a first class citizen of the application model. It must be possible that an interaction - like an +application component - has multiple realizations and can be configured. The idea of connectors has been +formalized in the context of UML in [4] and [5]: a UML connector - a "line" within a composite class - is replaced by an + interaction component as shown in the left part of Fig. 3. + +

    +The interaction component is typically defined in a model library in form of a template. This is required, +since the interaction component must be able to adapt to the context in which it is used. For instance, in case of +an operation call of a component, the interaction component must provide the same operation as the component. +In most cases, the formal parameter of the template is either an interface or a data-type. The implementation of +the interaction component must be adapted as well, in order to correspond to the interface. The implementation body +is thus provided in a form a a template of a typical model-to-text (M2T) language, in our case Acceleo. + +

    +The container pattern may be used to modify the way a component interacts with its environment. This pattern has been +identified by existing middleware solutions, such as +CCM[2] and +Fractal[1]. +The container encapsulates an object (component) and can provide additional service and observer or manipulate the +interactions with the component. In order to enhance flexibility (and readability) of the application model, it is +preferable to add information about the container (in form of rules) to the model, but not the container itself. +Thus, a transformation step adds the container to the model. + +

    + +

    + +
    +Connector reification and container expansion +
    + +

    +The right side of Figure 3 shows this principle: a component "C" is enriched with rules +to apply. This information is evaluated by a transformation that creates the container and adds the elements that are +associated with the rule. The component becomes an executor, i.e the business code behind a component. It is possible +to distinguish two different types of elements within the container: the interceptor and the extensions. The +interceptor is placed on a delegation connection between a port of the container and the executor. The extension is +an additional element which can be connected with external ports of the container. +

    + +

    + +
    +Container rule for a state machine +
    + +

    +The current container libraries offer for instance the production of execution traces or the realization of mutual access. +An interesting feature is the support for state-machines. Its realization requires three elements within the container: +the state-machine itself, an event pool and an interceptor which feeds the pool (e.g. each time an operation is called, +an associated call event is produced). These elements are captured by the rule shown in Figure 4. + +

    +In a similar way as the FIFO interaction component, the state machine and the interceptor are defined in a package template. +The model of the state machine is defined for a component (class). The implementation of the state machines depends on the +formal parameter which is instantiated with a class. The message interceptor is typed with an interface, since it primarily +captures call-events. + +

    +The following code fragment describes the template of an operation which manages the execution of a state-machine. +The code, here using the C++ language, is modeled by an UML opaque behavior. The access to the model element is embedded +between [ and /], i.e. [name/] allows to access the name of a UML element. This excerpt shows +the power to adapt the behavior of embedded components via the container to add new functionality that is well separated +of the business code. + +

    +

    +[for (sm : StateMachine | ownedBehavior->select(oclIsKindOf(StateMachine)))]
    +switch(m_currentState)
    +{
    +    [for (state : State | sm.region.subvertex->select(oclIsKindOf(State)))]
    +    case [clazz.name/]_[state.name/]:
    +    ...
    +    [/for] ...
    +
    + +

    +The instantiation of the template with a fictive class "A" is shown in the next code fragment. This class contains a +state machine with the state "state1", which appears in the code's "switch" statement. In each state, the events defined +as triggers for transitions are compared with the event read from the pool (in which a timer or interceptor write). + +

    +

    +switch(m_currentState) 
    +{
    +    case A_state1:
    +    ...
    +
    + +

    + +

    +


    + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/input-models.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/input-models.html new file mode 100644 index 00000000000..1d910b4c70c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/input-models.html @@ -0,0 +1,67 @@ + + + + + Qompass + + + +Qompass logo +

    Input models

    + +The set of input models contains three sub-models that are shortly described in the sequel: +
      +
    1. the software component model, +
    2. the hardware platform and +
    3. the deployment model. +
    + +In the context of this page, the input models are discussed without referring to a specific example. Sample models are available via the Qompass +online help or via the "create-new example" dialog of Eclipse. + +

    Component model

    + +We use the UML MARTE component model that describes components (with their internal behavior), and the interaction points (ports) +characterized by the transferred data or by the provided/required services. Interactions are realized by the design patterns described +in section Connector/Container. +The concurrent behavior is specified via the HLAM (High Level Application Modeling) sub-profile of MARTE. This concurrency model +identifies the components that possesses execution resources (RtUnit) and the shared ones (PpUnit) which do not have execution resources, +but resources that manage the concurrent access. + +

    Platform model

    + +A hardware architecture is described in a similar way as the logical architecture by composition of elements. A class called +"HWArchitecture" represents the complete platform. The attributes of this class represent nodes. Each node is typed with a class +that captures the properties of this node. Each node can have a further internal structure, a hierarchical structure +can thus be modeled. +

    + + +

    Deployment model

    + +The deployment of an application consists to define the component instance, their configuration and their allocation to an +execution node. The UML composite structure defines the roles that are played by each component of the system. The deployed +component is always an instance of a component that has a specfied allocation to an execution resource (node or thread) and +a specific configuration. In UML, an instance is defined by an "InstanceSpecification", the values of properties are given via +"slots". In case that the property represents a sub-component, the associated value is a further instance specification. The +resulting hierarchical structure is quite difficult to maintain and is automatically generated and maintained by tools. + +A component-based system requires a configuration. The configuration attribute of a timer for instance define its frequency. The +values of this configuration attribute can be defined at two different levels. +
      +
    • on declaration level by associating a default value with an attribute +
    • on instance level, by specify a corresponding slot value +
    +Once all component are instantiated and configured, they can be allocated. + +The allocation phase consists of defining the relation between the the instances of software components and those of the platform elements. +The Figure below describes the deployment of the component DeviceControlMonitor and PGController on the hardware platform. The MARTE +"Allocate" relationship is used to describe the allocation model. + +The allocation can be refined by introducing local resources of the platform between the application the hardware platforms -- in +MARTE via the concept of a "SwSchedulableResource". + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/overview.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/overview.html new file mode 100644 index 00000000000..9148d7e6230 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/concepts/overview.html @@ -0,0 +1,55 @@ + + + + + Qompass + + + +Qompass logo + +OMG MARTE + +

    Overview

    + +Qompass Designer is a component based modeling approach that supports the code generation from embedded +systems. Theses systems are characterized by timing and resource constraints - sometimes also +denoted as non-functional properties. Since these systems get more and more complex, it is important +that the non-functional properties are not just specified in the documentation and respected by the +implemented system, but that these are explicitly modeled and suitable code is derived from the model. + +Qompass Designer is part of the Qompass tool-suite integrated into Papyrus. The separation of concerns between +the two tools is that +
      +
    • Qompass analyzer analyzes a system, in particular with respect to schedulability + analysis. It enables the validation of several variants to allocate software components to execution + resources and thus provides an architectural exploration +
    • Qompass designer supports the code generation for a specified architecture. It enables this code + generation by means of a sequence of transformations steps and a final code generation step as + shown in the figure below. +
    + +
    +Tool Chain overview +
    +

    + +Qompass is integrated into the open source UML editor Papyrus, +The UML profile MARTE is used for non-functional properties. +Parts of the component model were developed in the context of the French national project Flex-eWare. + +In the sequel, you find information about the +

    + +We also recommend the examples section in the documentation index as a starting point for using Qompass, as well as the Qompass wiki page. + +

    + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/DefineNewPortKinds.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/DefineNewPortKinds.html new file mode 100644 index 00000000000..44b6609371a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/DefineNewPortKinds.html @@ -0,0 +1,34 @@ + + + + + Qompass + + + +

    How-to create your own port-kinds

    + +A port kind characterizes a port. Simple examples of port kinds are (1) the UseInterface and +ProvideInterface kinds which describe client/server ports and (2) PushPublisher which describe a data +publisher port for a given data type. In the first case, the port is typed with the interface that is +provided or required, in the second case, the port is typed with datatype.

    +Although it does not formally define its semantics, each port kind should be associated with a +description of the intention behind it. A port kind is always associated with a mapping rule +that describes which interface a port provides and/or requires when in function +of its type (and/or additional information, e.g. coming from a MARTE stereotype). +On the model level, a port kind is first a stereotyped class. It can be created with the Qompass palette. +

    +The associated mapping rule is defined defined by means of Java code. You have to create a plugin +that defines the (plug-in) extension port-mapping provided by the FCM profile plugin. The extension +contains the (unqualified) name of the port kind and associated rules for the mapping.

    + +The class must implement the interface FCM.util.IMappingRule, i.e. the operations getProvided, +getRequired and needsTransaction. The former two return the provided (required) interface in function +of the port type. The latter indicates whether the calculation of one of these (potentially) modifies +the model by creating/or updating a derived interface and thus requires a transaction. +Examples can be found in the plug-in org.eclipse.papyrus.qompass.designer.stdmappingRules. + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createContainers.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createContainers.html new file mode 100644 index 00000000000..7c9b1ec491e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createContainers.html @@ -0,0 +1,44 @@ + + + + + Qompass + + + +

    Qompass container development

    + +A container encapsules a component, i.e. it encloses an existing components and delegates ports to +it. The following figure depicts a container enclosing an component. The principal idea is that the +container handles the treatment of non-functional properties. Therefore, the existing component can +focus on the implementation of the business logic. It is therefore also called executor, a term +introduced by the OMG standard CORBA component model (CCM).

    +There are two different ways how a container can influence the execution of an executor. Either via +interception or via extension. The two variants are shown in the sequel. + +

    How to create a container interceptor

    + +A container interceptor is basically a connector between a port of the . Thus, it can be defined in the same way as a +connector, but needs to carry the stereotype interceptor. + +

    How to create a container extension

    + +A container extension is a + +

    How to create a container rule

    + +Before you create a container rule, you typically create either a interceptor or a container +extension (see above). + +There are two different kinds of rules: +
      +
    1. local rules that are only visible to a component owning them +
    2. global rules that are visible for all models that import the model library. In both + cases, the container rule is principally a stereotyped UML class. In the first case, it is a + sub-class owned by the component, which is typically created by the container rule dialog available + for the package. In the second the container rule is a normal class owned by a package; use the Qompass + palette to create the rule. Then, right on the rule to edit its properties. + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createInteractionComponents.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createInteractionComponents.html new file mode 100644 index 00000000000..d6a0c24d682 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/createInteractionComponents.html @@ -0,0 +1,58 @@ + + + + + Qompass + + + +

      Connector Development

      + +The definition of a connector is quite similar to that of a component. Thus, its development is +quite similar as well. The major differences are: +
        +
      • The type of ports are typically generic, i.e. template parameters. +
      • A connector is often distributed, i.e. the connector itself is an assembly of connector fragments +
      • It may be required to define additional port kinds +
      + +In the following steps, we address the issues above in addition to the normal development of a component. + +

      Integration into a package template

      + +The ports of a connector are often generic, since the connector should connect a large variety of +components. Therefore, the type of the ports often refer to a template parameter. For instance, in +case of ports providing or requiring an interface, the BasicCalls model library defines a package +template with the template parameter "I" which denotes an arbitrary interface. +When a new connector is defined, the developer should first verify if a suitable package template +already exists. +The use of a package import declares the extension of a existing package. +It is possible to extend this package template by eds to refer to a generic port type - a port whose type adapts that refers to template parameters +

      + +In the context of a new interaction component definition, it may be necessary to define new port kinds. A port kind associates a semantics (informally) with a port. It consists of a rule for the provided and required interface in function of the port type. +The rule is currently coded in Java and provided via an (Eclipse) extension point defined by the FCM plugin. This extension point is called fcmPortMappingRule and associates the name of a port kind with a class.<br> +The class must implement the interface FCM.util.IMappingRule, i.e. the operations getProvided, getRequired and needsTransaction. The former two return the provided (required) interface in function of the port type. The latter indicates whether the calculation of one of these (potentially) modifies the model by creating/or updating a derived interface and thus requires a transaction. + +

      +An interaction component is the realization of an interaction pattern which is defined by an abstract interaction +component. There are two cases, +

        +
      1. You want to create a new implementation of an existing interaction mechanism +
      2. You want to create an additional interaction mechanism +
      + +A particularity of a connector is that it is typically defined in a package template. In the first case, i.e. +the creation of an existing implementation. +Instead of creating a new package template for each new connector, an existing package template should be +extended - provided that the formal parameters are identical. This favors reuse, e.g. the existing package +template for method calls contains the definition of (a)synchronous connector types as well an enumeration +over all the operation within the interface (template parameter).
      + +There is no means in UML of extending an existing package. In Qompass, a package is extending an existing package +template, if it merges with the existing package template. + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/developer.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/developer.html new file mode 100644 index 00000000000..419936e9f52 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/developer.html @@ -0,0 +1,57 @@ + + + + + + Main Topic + + + + +

      Qompass developer guide

      + +The objective of this guide is to provide information about the architecture of Qompass designer and enable developers to +contribute to its development, i.e. it is not intend for people that want to develop applications with Qompass designer. +This guide is currently quite incomplete and should give a rough overview of the Qompass plug-ins. + +In general, there is a separation between the generic transformation mechanisms and the model libraries defining +interaction components and container extensions. It is quite likely that a contribution only focusses on one of these two, +for instance on a model library for a dedicated interaction mechanism. + +The transformation mechanisms consists of the following plug.ins: +
        +
      • org.eclipse.papyrus.qompass.designer.feature This plugin contains the definition of the Qompass feature +

        +

      • org.eclipse.papyrus.qompass.designer.core: The main Qompass plugin +
      • org.eclipse.papyrus.qompass.designer.validation: A set of validation rules that check the well-formedness of models, + for instance, whether a connection betwee ports if syntactically valid. + The validation plug-ins defines a set of EMF validation rules in form of Java code. + +
      • org.eclipse.papyrus.qompass.designer.cpp: A plugin with support for C++, in particular (1) for the creation + and configuration of Eclipse CDT projects and (2) the interaction with the C++ code generator. +
      • org.eclipse.papyrus.fcm.profile: A plugin container the Flex-eware component model in form of a static profile +
      • org.eclipse.papyrus.codegen.cpp: C++ code generator and simple C++ view + +
      + +

      +In addition to the generation plugins, Qompass contains a set of model libraries that are +dedicated for a specific domain and/or interaction mechanisms. + +

        +
      • org.eclipse.papyrus.qompass.designer.modellibs.core: A set of basic interaction mechanisms and container rules as well + as port kinds along with the calculation of provided and required interface from the port type + and kind ("mapping rules"). +
      • org.eclipse.papyrus.qompass.designer.modellibs.marte: A modeling library for MARTE, contains a set of FCM port kinds + suitable for MARTE (client/server and flow ports) and model elements for RtUnit and PpUnit. + A model listener performs automatic synchronization between MARTE and FCM stereotypes, e.g. + will automatically initialize the FCM port kind attribute with the kind that corresponds to + the MARTE stereotype and apply container rules associated with Rtunit and Ppunit. +
      • org.eclipse.papyrus.qompass.designer.modellibs.distribution: Distribution support via sockets +
      • org.eclipse.papyrus.qompass.designer.modellibs.tracing: Tracing support (container rule and interceptor) for OTF +
      + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/org.eclipse.papyrus.qompass.designer.core.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/org.eclipse.papyrus.qompass.designer.core.html new file mode 100644 index 00000000000..2136ae652a7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/developer-guide/org.eclipse.papyrus.qompass.designer.core.html @@ -0,0 +1,34 @@ + + + + + + Main Topic + + + + +

      org.eclipse.papyrus.qompass.designer.core

      + +This is the main Qompass plugin. It contains the dialogs and model transformations code as well as a +set of utilities classes. +Qompass consists of a set of package (oepqd is an abbreviation for the path org.eclipse.papyrus.qompass.designer): +
        +
      • ccegc.acceleo a driver for the versoin 2.7.x of Acceleo. This driver is used to instantiate text +templates that refer to model elements. These are primarily used for the connector instantiation (since +the implementations given in form of Opaque behaviors need to be instantiated as well. + +
      • oepqd.deployment +
      • oepqd.transformation + Main transformation code +
      • oepqd.synchronization + A part of the utilities that synchronize derived elements, in particular the implementation of + a component which has for instance +
          +
        • implement the interfaces provided by a component port +
        +
      + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/arrow.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/arrow.png new file mode 100644 index 00000000000..1c66a6d427d Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/arrow.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-after-trafo.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-after-trafo.png new file mode 100644 index 00000000000..aae501c9e90 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-after-trafo.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-before-trafo.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-before-trafo.png new file mode 100644 index 00000000000..04595b063cb Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-before-trafo.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-selection.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-selection.png new file mode 100644 index 00000000000..3e60881270c Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/connector-selection.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-aggregation.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-aggregation.png new file mode 100644 index 00000000000..9f98f79e705 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-aggregation.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-connector.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-connector.png new file mode 100644 index 00000000000..73cbaea6fa4 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-connector.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor.png new file mode 100644 index 00000000000..88d630ba405 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor2.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor2.png new file mode 100644 index 00000000000..82a0a5031f3 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-interceptor2.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-selection.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-selection.png new file mode 100644 index 00000000000..0ee528ca514 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/container-selection.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.pdf b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.pdf new file mode 100644 index 00000000000..7fd5e843362 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.pdf differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.png new file mode 100644 index 00000000000..b0ae3117501 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/deployment.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-flex-eWare-small.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-flex-eWare-small.png new file mode 100644 index 00000000000..42ad4899399 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-flex-eWare-small.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-marte.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-marte.png new file mode 100644 index 00000000000..d33ef562b5f Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-marte.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-papyrus.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-papyrus.png new file mode 100644 index 00000000000..f85045926f3 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/logo-papyrus.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.odg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.odg new file mode 100644 index 00000000000..a38a594fb7b Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.odg differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.pdf b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.pdf new file mode 100644 index 00000000000..a615fa7ce91 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.pdf differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.png new file mode 100644 index 00000000000..d22ad2fb51c Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.vsd b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.vsd new file mode 100644 index 00000000000..a274050ab84 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/overview-eng.vsd differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass-0.33.jpg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass-0.33.jpg new file mode 100644 index 00000000000..8c429f9dc5e Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass-0.33.jpg differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass.jpg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass.jpg new file mode 100644 index 00000000000..26807d913e4 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/qompass.jpg differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-after-trafo.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-after-trafo.png new file mode 100644 index 00000000000..c19b14f091a Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-after-trafo.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-before-trafo.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-before-trafo.png new file mode 100644 index 00000000000..3568e8e8e08 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-before-trafo.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-selection.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-selection.png new file mode 100644 index 00000000000..0cf9151893c Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/connector-selection.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-aggregation.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-aggregation.png new file mode 100644 index 00000000000..2f260c5498b Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-aggregation.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor.png new file mode 100644 index 00000000000..43c3f8b4edf Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor2.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor2.png new file mode 100644 index 00000000000..10b73141e50 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-interceptor2.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-selection.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-selection.png new file mode 100644 index 00000000000..b8a372f44cd Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/scaled/container-selection.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/statemachine-rule.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/statemachine-rule.png new file mode 100644 index 00000000000..2754cb16625 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/statemachine-rule.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.odg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.odg new file mode 100644 index 00000000000..c752e963472 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.odg differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.png new file mode 100644 index 00000000000..68442484be3 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/toolchain.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/trace2.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/trace2.png new file mode 100644 index 00000000000..e8c9820c4c7 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/img/trace2.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/component.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/component.html new file mode 100644 index 00000000000..fb6364efedb --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/component.html @@ -0,0 +1,33 @@ + + + + + Qompass + + + +

      Components

      + +An Qompass component is a UML class (you might also use a UML component), since classes +contain essential properties we require of a component: +
        +
      • they own a set of ports and may interact through these ports. On the port level, a component needs to declare explicitly, + which services it offers and which it requires from other others. It is important that a component does not know which + other component will provide a required service, it only states the required services (interfaces or data-types). Thus, compared + to an element of a classical library, dependencies on other elements are limited and the components are loosely coupled with + their environment +
      • A class may have an explicit internal structure: a set of parts that are typed with other components (UML classes). + The ports of the parts may be connected (assembly), a port of the component itself might delegate to a port of a part. + These components are also called assembly components. +
      + +A component might either be a type or an implementation. The former is mainly an abstract class with a set of ports +and no internal structure. It may inherit from other component types, but not from implementations. +The latter has to realize at least a subset of the services that are provided at its ports (if it does not define all, it +needs to be declared as abstract). The realization could be either done by an implementation written in a specific programming +language or the UML action language or by a delegation to an inner part. + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/container.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/container.html new file mode 100644 index 00000000000..73aaa3d3443 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/container.html @@ -0,0 +1,54 @@ + + + + + Qompass + + + +

      Qompass container development

      + +A container encapsules a component, i.e. it encloses an existing components and delegates ports to +it. The following figure depicts a container enclosing an component. The principal idea is that the +container handles the treatment of non-functional properties. Therefore, the existing component can +focus on the implementation of the business logic. It is therefore also called executor, a term +introduced by the OMG standard CORBA component model (CCM).

      +There are two different ways how a container can influence the execution of an executor. Either via +interception or via extension. The two variants are shown in the sequel. + +

      How to create a container interceptor

      + +A container interceptor is basically a delegation connector between a port of the container and the +executor. Thus, it can be defined in the same way as a connector, but needs to carry the stereotype +interceptor.
      + +An example of a container interceptor + +Further expansion + +

      +Further expansion as for a connector + +

      Container rules

      + +A container rule defines which container extensions and/or interceptors should be applied. The +concept of a container rule has been introduced, since some aggregation/interceptor combinations +depend on each other. Their independ selection would be error prone, instead a single container +rule selects the combination. + +There are two different kinds of rules: +
        +
      1. local rules that are only visible to a component owning them +
      2. global rules that are visible for all models that import the model library. In both + cases, the container rule is principally a stereotyped UML class. In the first case, it is a + sub-class owned by the component, which is typically created by the container rule dialog available + for the package. In the second the container rule is a normal class owned by a package; use the Qompass + palette to create the rule. Then, right on the rule to edit its properties. +
      + +container selection + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/interactionComponent.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/interactionComponent.html new file mode 100644 index 00000000000..98391302fba --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/interactionComponent.html @@ -0,0 +1,61 @@ + + + + + Interaction components and connectors + + + +

      Interaction components and connectors

      + +An interaction component is a component that is responsible for realizing an interaction between two or more +components.
      + +A UML connector denotes a link between two components, or more precisely between two or more parts (or ports of parts) +within a composition. In UML, the connector only denotes that there is a connection, it does not carry further +annotations that characterize the interaction or how it is implemented. + +
      +In Qompass, a connector carries additional information (via the FCM profile) about a type or implementation +used for its realization, the interaction component.
      + +An interaction component is quite similar to a standard component: there is an optional separation +between its type and its implementation, it owns ports, it may be a composition of parts typed with +other components. +The main difference is that it needs to be generic, since the interaction component has to adapt itself +to the environment in which it is used, e.g. to the interfaces of ports it connectors. +The following figure shows a connector and the referenced connector component. The tool chain +reifies a connector to a connector component during deployment, as shown in the following figure: + +connector before transformation + +connector after transformation + +

      Connector matching algorithm

      + +In order to check whether a connector can be applied, we need to find a binding of its formal template +parameter(s) for which all ports of the connector match a port of the application components with which +it is connected. Of course, a single binding must establish matching for all connector ports at the same +time. A match is fulfilled, if either +
        +
      1. The ports have an identical kind and type, and one of the ports is conjugated (i.e its provided and + required interfaces are swapped). The connector port is typically typed with the formal parameter, i.e. + matching is reached if the formal is bound to the same type as the application port. +
      2. The provided interface of one port has a matching required interface of the opposite port and vice versa. + Assuming again,that a port of the connector is typed with the formal parameter of the template, the + calculation is limited to the case of mapping rules that expose the formal parameter directly as + provided or required interface, i.e. that do not create a derived interface that depends on the + formal parameter. Otherwise, + the calculation of the formal parameter would require a reverse execution of the mapping rule + (calculation of port type when a provided or required interface is given). This implies in practice + that connectors with simple ports using ProvideInterface or UseInterface match: the rule is actually + less strong that the first, since it is possible to match ports that have not specifically be designed + for each other. For instance, the PushProducer port for a dataype DT has a required interface with an + operation "push(in data : DT)". A port with the generic UseInterface kind can match the PushProducer + port. Thus, a synchronous call connector s compatible with a PushProducer/PushConsumer port combination. +
      + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/port.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/port.html new file mode 100644 index 00000000000..dc0c832a6c7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/port.html @@ -0,0 +1,26 @@ + + + + + Qompass + + + +

      Ports

      + +Ports are interaction points of components. A component may execute operation calls via a port when +it requires a service. When a component provides a service, a operation of a port is called when the +service is invoked. In Qompass, this abstraction is also used for data oriented ports, as calls are flexible +and well handled by the underlying programming language. For instance, data consumption via polling might +correspond to the call of an "getData" operation (component calls, required interface), +consumption via push the call of an pushData operation (environment calls, provided interface). +

      +From the user view point, the provision or use of a specific interface is an implementation aspect. Therefore, +these two interfaces or not specified, but they are calculated or derived from two other port properties: +its type and its kind. For instance, a "PullConsumer" port kind could be used in +conjunction with a data type and would define the "getData" operation above. + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/portKind.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/portKind.html new file mode 100644 index 00000000000..983c6983f58 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/portKind.html @@ -0,0 +1,27 @@ + + + + + Qompass + + + +

      Port kinds

      + +A port kind characterizes a port. Simple examples of port kinds are (1) the UseInterface and +ProvideInterface kinds which describe client/server ports and (2) PushPublisher which describe a data +publisher port for a given data type. In the first case, the port is typed with the interface that is +provided or required, in the second case, the port is typed with datatype.

      +Although it does not formally define its semantics, each port kind should be associated with a +description of the intention behind it. A port kind is always associated with a mapping rule +that describes which interface a port provides and/or requires when in function +of its type (and/or additional information, e.g. coming from a MARTE stereotype). + +On the model level, a port kind is first a stereotyped class. In Qompass, the associated mapping rule +is defined defined by means of Java code. but this is mainly an implementation issue. +Examples can be found in the plug-in org.eclipse.papyrus.qompass.designer.stdmappingRules. + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/trafos.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/trafos.html new file mode 100644 index 00000000000..27ad089bcb9 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/reference/trafos.html @@ -0,0 +1,40 @@ + + + + + Qompass + + + +

      Transformations

      + +Before an Qompass component can be deployed, there is a set of transformations that is applied + +
        +
      1. Each port is translated into a tripel of a property, an operation returning a reference to the interface + provided by the port (if any) and an operation allowing to connect the port (if port has a required + interface). + +
      2. Parts: if a part is typed with an abstract component implementation or a component type, it cannot + directly be instantiated in some programming languages, notably C++ (in Java, attributes typed + with a class are always implictly references). For these, there are basically two options: +
          +
        • Change the type of the part and replace it by a concrete implementation. Obviously, this can only + work, if the deployment uses always the same implementaiton for the part. +
        • Assure that the composite only holds a reference to the part, i.e. make the part a pointer and + let the bootloader instantiate the sub-parts. The advantage is that it always works, but would not + do something useful in the context of variable systems. +
        +
      3. +
      + +A component might either be a type or an implementation. The former is mainly a class with a set of ports +and no internal structure. It may inherit from other component types, but not from implementations. +The latter has to realize at least a subset of the services that are provided at its ports (if it does not define all, it +needs to be declared as abstract). The realization could be either done by an implementation written in a specific programming +language or the UML action language or by a delegation to an inner part. + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/sitestyle.css b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/sitestyle.css new file mode 100644 index 00000000000..4f5bb078d99 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/html/sitestyle.css @@ -0,0 +1,13 @@ +BODY { font-family: "Helvetica", sans-serif; + background-color: white +} + +A:link { color: #4040c0 } +A:active { color: #909090 } +A:visited { color: #9090f0 } + +TT { + background-color: #d0f8f0; + /* font-family: monospace; */ + /* font-size: 100% */ +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.di new file mode 100644 index 00000000000..63bf1a9db4a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.di @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.notation new file mode 100644 index 00000000000..5c943021045 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.notation @@ -0,0 +1,669 @@ + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.uml new file mode 100644 index 00000000000..30494c484ee --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/model/ec3m-transformations.uml @@ -0,0 +1,173 @@ + + + + Declarative information about container elements + + + + Delegation connector: interception + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Additional information about interaction component + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/plugin.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/plugin.properties new file mode 100644 index 00000000000..1fccb2ec96f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus extra: Qompass designer documentation (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/plugin.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/plugin.xml new file mode 100644 index 00000000000..860a13a3743 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/plugin.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/pom.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/pom.xml new file mode 100644 index 00000000000..623d0668a17 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../releng/extra + + org.eclipse.papyrus.qompass.designer.doc + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/src/org/eclipse/papyrus/qompass/designer/doc/Activator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/src/org/eclipse/papyrus/qompass/designer/doc/Activator.java new file mode 100644 index 00000000000..dd7f6fbd95a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/src/org/eclipse/papyrus/qompass/designer/doc/Activator.java @@ -0,0 +1,53 @@ +package org.eclipse.papyrus.qompass.designer.doc; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.doc"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/toc.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/toc.xml new file mode 100644 index 00000000000..1f47f46e81f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc/toc.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/.classpath b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/.classpath new file mode 100644 index 00000000000..248b4c5dc7a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/.project b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/.project new file mode 100644 index 00000000000..49ba9131ad8 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/.project @@ -0,0 +1,34 @@ + + + org.eclipse.papyrus.qompass.designer.java + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f42de363afa --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/META-INF/MANIFEST.MF b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..9a5c0239ad2 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/META-INF/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.uml2.uml;bundle-version="5.0.1", + org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", + org.eclipse.papyrus.qompass.designer.core;bundle-version="1.2.0", + com.google.guava, + org.eclipse.xtext.xbase.lib, + org.eclipse.xtend.lib, + org.eclipse.xtend.lib.macro, + org.eclipse.papyrus.uml.tools;bundle-version="1.2.0" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.qompass.designer.java.Activator +Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.java;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/about.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

      About This Content

      + +

      November 14, 2008

      +

      License

      + +

      The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

      + +

      If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

      + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/build.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/build.properties new file mode 100644 index 00000000000..3fa3c740b2b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/build.properties @@ -0,0 +1,8 @@ +source.. = src/,\ + xtend-gen/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties,\ + plugin.xml diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/plugin.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/plugin.properties new file mode 100644 index 00000000000..5c6ac578195 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus extra: Qompass Designer Java support (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/plugin.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/plugin.xml new file mode 100644 index 00000000000..325c6bd80d0 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/plugin.xml @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/pom.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/pom.xml new file mode 100644 index 00000000000..1bfee6eff52 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../releng/extra + + org.eclipse.papyrus.qompass.designer.java + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-clean-plugin + + + + xtend-gen + + **/* + + + .gitignore + + + + + + + org.eclipse.xtend + xtend-maven-plugin + + + generate-sources + + compile + + + + + xtend-gen + ${project.build.directory}/xtend-gen/test + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Activator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Activator.java new file mode 100644 index 00000000000..1e7d5e25650 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Activator.java @@ -0,0 +1,50 @@ +package org.eclipse.papyrus.qompass.designer.java; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.cpp"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Messages.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Messages.java new file mode 100644 index 00000000000..070d1956590 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/Messages.java @@ -0,0 +1,19 @@ +package org.eclipse.papyrus.qompass.designer.java; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.qompass.designer.cpp.messages"; //$NON-NLS-1$ + + public static String CompImplTrafos_CannotFindType; + public static String CompImplTrafos_IntfNotImplemented; + public static String CompTypeTrafos_CannotFindType; + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/messages.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/messages.properties new file mode 100644 index 00000000000..c4c2141c7e6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/messages.properties @@ -0,0 +1,3 @@ +CompImplTrafos_CannotFindType=Can not find type %s. Thus, unable to create suitable connect operation in component to OO transformation. +CompImplTrafos_IntfNotImplemented=Interface <%s> provided by port <%s> of class <%s> is not implemented by the component itself nor does the port delegate to a part +CompTypeTrafos_CannotFindType=Can not find type <%s>. Thus, unable to create suitable connect operation in component to OO transformation diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/xtend/JavaToOO.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/xtend/JavaToOO.xtend new file mode 100644 index 00000000000..ef368eb0d76 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/src/org/eclipse/papyrus/qompass/designer/java/xtend/JavaToOO.xtend @@ -0,0 +1,548 @@ +/***************************************************************************** + * Copyright (c) 2015 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ +package org.eclipse.papyrus.qompass.designer.java.xtend + +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier +import org.eclipse.uml2.uml.Class +import org.eclipse.uml2.uml.Property +import org.eclipse.uml2.uml.Port +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException +import org.eclipse.papyrus.qompass.designer.core.PortInfo +import org.eclipse.papyrus.qompass.designer.core.PortUtils +import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants +import org.eclipse.papyrus.qompass.designer.core.Utils +import org.eclipse.papyrus.qompass.designer.core.transformations.CompTypeTrafos +import org.eclipse.uml2.uml.AggregationKind +import org.eclipse.uml2.uml.UMLPackage +import org.eclipse.uml2.uml.OpaqueBehavior +import org.eclipse.uml2.uml.ConnectorEnd +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil +import org.eclipse.uml2.uml.Type +import java.util.HashMap +import java.util.Map +import org.eclipse.uml2.uml.Connector +import org.eclipse.emf.common.util.EList +import org.eclipse.uml2.uml.StructuralFeature +import org.eclipse.papyrus.qompass.designer.java.Messages +import org.eclipse.papyrus.qompass.designer.core.extensions.IOOTrafo +import org.eclipse.papyrus.uml.tools.utils.PackageUtil + +/** + * This class realizes the transformation from component-based to object-oriented + * models. It includes the replacement of ports and connectors. Ports are + * replaced with attributes and access operations, connectors within a composite + * by an operation that creates the initial setup. + * + * 1. add an operation that allows to retrieve the reference to an interface provided + * by a port. This operation has a mapping specific name, e.g. get_ + * 2. add an operation that allows to connect a specific port. + * the connect_q operation (*including a + * storage attribute*) for a port with a required interface + * 3. add an implementation for the getcnx_q operation for a port + * with a required interface (the operation itself has been added before) + * + * TODO: C++ specific, support different "component to OO" mappings + * + * Problems: need to align bootloader creation with this mapping, since + * the bootloader may be responsible for instantiation + * + * Caveat: Assure that the folder derivedInterfaces already exists in a model. + * Otherwise the call to getProvided/getRequired interface might trigger its + * creation resulting in the corruption of list iterators (ConcurrentAccess + * exception) + * + */ +class JavaToOO implements IOOTrafo { + + public static final String CREATE_CONNECTIONS = "createConnections" + + protected LazyCopier copier + + protected Class bootloader // why required? + + override init(LazyCopier copier, Class bootloader) { + this.copier = copier + this.bootloader = bootloader + } + + public static final String retParamName = "ret" + + public static final String progLang = "JAVA" + + override addPortOperations(Class implementation) { + addGetPortOperation(implementation) + addConnectPortOperation(implementation) + } + + /** + * Add the get_p operation for each port with a provided interface. It also + * adds a suitable implementation that evaluates delegation connectors from + * the port to a property within the composite. The delegation target could + * either be a normal class (no port) or an inner component. + * + * @param implementation + */ + def addGetPortOperation(Class implementation) { + for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { + val providedIntf = portInfo.getProvided() + if (providedIntf != null) { + + // port provides an interface, add "get_p" operation & + // implementation + val opName = PrefixConstants.getP_Prefix + portInfo.name + var op = implementation.getOwnedOperation(opName, null, null) + if (op != null) { + + // operation already exists. Assume that user wants to + // override standard delegation + if (op.type != providedIntf) { + op.createOwnedParameter(retParamName, providedIntf) + } + } else { + op = implementation.createOwnedOperation(opName, null, null, providedIntf) + val retParam = op.getOwnedParameters().get(0) + retParam.setName(retParamName) + + val behavior = implementation.createOwnedBehavior(opName, UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + op.getMethods().add(behavior) + + val ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) + + // if there is an delegation to an inner property, delegate to + // it + // Make distinction between delegation to component (with a + // port) or + // "normal" class (without). + var String body + if (ce != null) { + val part = ce.partWithPort + val role = ce.role + + body = "return " + if (role instanceof Port) { + + // check whether the part exists within the + // implementation (might not be the case + // due to partially copied composites). + // Check is based on names, since the connector points + // to elements within another + // model (copyClassifier does not make a proper + // connector copy) + // body += part.name + refOp(part) + opName + "();" + // TODO: this will NOT work for extended ports! + body += '''«part.name».«PrefixConstants.getP_Prefix»«role.name»();''' + } else { + + // role is not a port: connector connects directly to a + // structural feature + // without passing via a port + // TODO: check whether structural feature exists + body += role.name + } + } else { + + // no delegation, check whether port implements provided interface + var implementsIntf = implementation.getInterfaceRealization(null, providedIntf) != null + if (!implementsIntf) { + + // The extended port itself is not copied to the target + // model (since referenced via a stereotype). Therefore, + // a port of an extended port still points to the + // original model. We try whether the providedIntf + // within + // the target model is within the interface + // realizations. + val providedIntfInCopy = copier.getCopy(providedIntf) + implementsIntf = implementation.getInterfaceRealization(null, providedIntfInCopy) != null + } + if (implementsIntf) { + body = "return this;" + } else { + throw new RuntimeException( + String.format(Messages.CompImplTrafos_IntfNotImplemented, providedIntf.name, + portInfo.port.name, implementation.name)) + } + } + behavior.getLanguages().add(progLang) + behavior.getBodies().add(body) + } + } + } + } + + /** + * Add a connect_ operation for ports with a required interface. + * Whereas operation and a behavior is added for each owned port, a behavior + * (method) is needed for ports inherited from a component type (the + * behavior is implementation specific, as it needs to take delegation to + * parts into account) + * + * @param implementation + */ + static def addConnectPortOperation(Class implementation) { + for (PortInfo portInfo : PortUtils.flattenExtendedPorts(PortUtils.getAllPorts2(implementation))) { + val requiredIntf = portInfo.getRequired() + if (requiredIntf != null) { + + // port requires an interface, add "connect_p" operation & + // implementation + val opName = PrefixConstants.connectQ_Prefix + portInfo.name + + if (implementation.getOwnedOperation(opName, null, null) != null) { + // do not add the operation, if it already exists. This means that the + // user wants to override it with custom behavior. In case of extended + // ports, we may have to do that. + } else { + var op = implementation.createOwnedOperation(opName, null, null) + val boolean multiPort = (portInfo.getUpper() > 1) || (portInfo.getUpper() == -1) // -1 indicates "*" + if (multiPort) { + + // add index parameter + val eLong = Utils.getQualifiedElement(PackageUtil.getRootPackage(implementation), + CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE) + if (eLong instanceof Type) { + op.createOwnedParameter("index", eLong as Type) + } else { + throw new RuntimeException( + String.format(Messages.CompImplTrafos_CannotFindType, + CompTypeTrafos.INDEX_TYPE_FOR_MULTI_RECEPTACLE)) + } + } + val refParam = op.createOwnedParameter("ref", requiredIntf) + + val behavior = implementation.createOwnedBehavior(opName, UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + + op.getMethods().add(behavior) + + val ConnectorEnd ce = ConnectorUtil.getDelegation(implementation, portInfo.getModelPort()) + + // if there is an delegation to an inner property, delegate to it + // Make distinction between delegation to component (with a port) or + // "normal" class (without). + var String body + if (ce != null) { + val part = ce.partWithPort + body = part.name + val role = ce.role + if (role instanceof Port) { + // in case of a delegation, use name of target port which might be different + val targetOpName = PrefixConstants.connectQ_Prefix + role.name + body = '''«part.name».«targetOpName»''' + + // TODO: no check that multiplicity of both port matches + if ((portInfo.getUpper() > 1) || (portInfo.getUpper() == -1)) { + body += "(index, ref);"; + } + else { + body += "(ref);"; + } + + } else { + // TODO: does this case make sense? + body += '''«part.name»;''' + } + } else { + // no delegation - create attribute for port + val attributeName = PrefixConstants.attributePrefix + portInfo.name + if (!Utils.hasNonPortOwnedAttribute(implementation, attributeName)) { + val attr = implementation.createOwnedAttribute(attributeName, requiredIntf) + LazyCopier.copyMultElemModifiers(portInfo.port, attr) + + // is shared (should store a reference) + attr.setAggregation(AggregationKind.SHARED_LITERAL) + } + body = attributeName + if(multiPort) body += "[index]" + body += " = ref" + } + + // TODO: defined by template + behavior.getLanguages().add(progLang) + behavior.getBodies().add(body) + + // ------------------------- + // add body to get-connection operation (which exists already if the port is also + // owned, since it is synchronized automatically during model edit) + // getConnQ prefix may be empty to indicate that the port is accessed directly + // TODO: reconsider optimization that delegated required ports do not have a + // local attribute & associated operation (an inner class may delegate, but the + // composite may be using it as well). + if ((PrefixConstants.getConnQ_Prefix.length() > 0) && (ce != null)) { + val getConnOpName = PrefixConstants.getConnQ_Prefix + portInfo.name + var getConnOp = implementation.getOwnedOperation(getConnOpName, null, null) + if (getConnOp == null) { + getConnOp = implementation.createOwnedOperation(getConnOpName, null, null, requiredIntf) + val retParam = op.getOwnedParameters().get(0) + retParam.setName(retParamName) + } + val getConnBehavior = implementation.createOwnedBehavior(getConnOpName, + UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + getConnOp.getMethods().add(getConnBehavior) + + // no delegation + val String name = PrefixConstants.attributePrefix + portInfo.name + body = '''return «name»;''' + behavior.getLanguages().add(progLang) + behavior.getBodies().add(body) + } + } + } + } + } + + /** + * Add an operation "createConnections" that implements the connections + * between composite parts. It only takes the assembly connections into + * account, since delegation connectors are handled by the get_ and connect_ + * port operations above. + * + * @param implementation + */ + override addConnectionOperation(Class compositeImplementation) throws TransformationException { + var createConnBody = "" + val Map indexMap = new HashMap() + + for (Connector connector : compositeImplementation.getOwnedConnectors()) { + if (ConnectorUtil.isAssembly(connector)) { + + // Boolean associationBased = false + if (connector.ends.size() != 2) { + throw new TransformationException( + '''Connector <«connector.name»> does not have two ends. This is currently not supported''') + } + val end1 = connector.ends.get(0) + val end2 = connector.ends.get(1) + var cmd = '''// realization of connector <«connector.name»>\n''' + if ((end1.role instanceof Port) && PortUtils.isExtendedPort(end1.role as Port)) { + val port = end1.role as Port + val EList subPorts = PortUtils.flattenExtendedPort(port) + for (PortInfo subPort : subPorts) { + cmd += ''' // realization of connection for sub-port «subPort.port.name»\n''' + cmd += connectPorts(indexMap, connector, end1, end2, subPort.port) + cmd += connectPorts(indexMap, connector, end2, end1, subPort.port) + } + } else { + cmd += connectPorts(indexMap, connector, end1, end2, null) + cmd += connectPorts(indexMap, connector, end2, end1, null) + } + createConnBody += cmd + "\n" + } + } + + // TODO: use template, as in bootloader + if (createConnBody.length() > 0) { + val operation = compositeImplementation.createOwnedOperation(CREATE_CONNECTIONS, null, null) + + val behavior = compositeImplementation.createOwnedBehavior("b:" + operation.name, + UMLPackage.eINSTANCE.getOpaqueBehavior()) as OpaqueBehavior + behavior.getLanguages().add(progLang) + behavior.getBodies().add(createConnBody) + behavior.setSpecification(operation) + } + } + + /** + * Create the body C++ code code that creates a connection between the two ends + * of a connector. This function checks whether the first end really is a receptacle + * and the second really is a facet. + * TODO: cleaner rewrite in xtend + * + * @param indexMap + * a map of indices that are used in case of multiplex + * receptacles + * @param connector + * a connector + * @param receptacleEnd + * an end of the connector that may point to a receptacle port + * @param facetEnd + * an end of the connector that may point to a facet port + * @param subPort + * a sub-port in case of extended ports + * @return + * @throws TransformationException + */ + static def connectPorts(Map indexMap, Connector connector, ConnectorEnd receptacleEnd, + ConnectorEnd facetEnd, Port subPort) throws TransformationException { + val association = connector.type + if ((receptacleEnd.role instanceof Port) && (facetEnd.role instanceof Port)) { + val facetPort = facetEnd.role as Port + val receptaclePort = receptacleEnd.role as Port + val facetPI = PortInfo.fromSubPort(facetPort, subPort) + val receptaclePI = PortInfo.fromSubPort(receptaclePort, subPort) + + if ((facetPI.getProvided() != null) && (receptaclePI.getRequired() != null)) { + val facetPart = facetEnd.partWithPort + val receptaclePart = receptacleEnd.partWithPort + + var subPortName = "" + if(subPort != null) subPortName += "_" + subPort.name + val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) + val setter = '''«receptaclePart.name».connect_«receptaclePort.name» «subPortName»;''' + val getter = '''«facetPart.name».get_«facetPort.name» «subPortName»()''' + return '''«setter»(«indexName»«getter»);\n''' + } + + } else if (receptacleEnd.role instanceof Port) { + + // only the receptacle end is of type port. + val Port receptaclePort = receptacleEnd.role as Port + if (PortUtils.getRequired(receptaclePort) != null) { + val facetPart = facetEnd.role as Property + val receptaclePart = facetEnd.partWithPort + + val indexName = getIndexName(indexMap, receptaclePort, receptacleEnd) + val setter = '''«receptaclePart.name».connect_«receptaclePort.name»''' + val getter = '''&«facetPart.name»''' + return '''«setter»(«indexName»«getter»);\n''' + } + } else if (facetEnd.role instanceof Port) { + + // only the facet end is of type port. Unsupported combination + val facetPort = facetEnd.role as Port + if (PortUtils.getProvided(facetPort) != null) { + val facetPart = facetEnd.partWithPort + val receptaclePart = facetEnd.role as Property + + val setter = receptaclePart.name + val getter = '''«facetPart.name».get_«facetPort.name»();''' + return '''«setter» = «getter»;\n''' + } + } else if (association != null) { + + // both connector ends do not target ports. In this case, we require that the connector is typed + // with an association. We use this association to find out which end is navigable and assume that + // the part pointed to by the other end is a pointer that gets initialized with the part of the + // navigable end. + val facetPart = facetEnd.role as Property + val receptaclePart = receptacleEnd.role as Property + + val assocProp1 = association.getMemberEnd(null, facetPart.type) + + // Property assocProp2 = facetPart.getOtherEnd() + if ((assocProp1 != null) && assocProp1.isNavigable) { + val setter = '''«receptaclePart.name».«assocProp1.name»''' + val getter = '''&«facetPart.name»''' + return '''«setter» = «getter»;\n''' + } + } else { + + // not handled (a connector not targeting a port must be typed) + throw new TransformationException( + "Connector <" + connector.name + + "> does not use ports, but it is not typed (only connectors between ports should not be typed)") + } + return "" + } + + /** + * Handle ports with multiplicity > 1. The idea is that we could have + * multiple connections targeting a receptacle. The first connection would + * start with index 0. Implementations can make no assumption which + * connection is associated with a certain index. [want to avoid associative + * array in runtime]. + * + * @param port + * @param end + * @return + */ + static def getIndexName(Map indexMap, Port port, ConnectorEnd end) { + if ((port.getUpper() > 1) || (port.getUpper() == -1)) { + + // index depends of combination of property and port, use connector + // end as key + var indexValue = indexMap.get(end) + if (indexValue == null) { + indexValue = 0 + indexMap.put(end, indexValue) + } + var index = indexValue + ", " + indexValue++ + indexMap.put(end, indexValue) + return index + } + return "" + } + + /** + * Return true, if the bootloader is responsible for the instantiation of a + * part. [Structual difference: bootloader can decide instance based - and + * instances are deployed] + * + * If a part is a component type or an abstract implementation, it cannot be + * instantiated. Thus, a heir has to be selected in the deployment plan. + * Since the selection might be different for different instances of the + * composite, the instantiation is not done by the component itself, but by + * the bootloader. The bootloader also has to instantiate, if different + * allocation variants are required. (this is for instance the case for + * distribution connectors and for the system itself) + * + * If possible, we want to let composites instantiate sub-components, since + * this eases the transition to systems which support reconfiguration. + * + * [TODO: optimization: analyze whether the deployment plan selects a single + * implementation. If yes, let the composite instantiate] + * + * [TODO: elements within an assembly need to be instantiated by composite - + * if System - by bootloader. assembly also need to be instantiated by + * composite!! + * + * @param implementation + * @return + */ + static def instantiateViaBootloader(Class implementation) { + return implementation.isAbstract() || Utils.isAssembly(implementation) + } + + /** + * Return whether a part needs to be instantiated by the bootloader instead + * by the composite in which it is contained. The criteria is based on the + * question whether the containing composite is flattened, as it is the case + * for the system component and the interaction components for distribution. + * + * @param part + * @return + */ + static def instantiateViaBootloader(StructuralFeature part) { + if (part != null) { + if (part.type instanceof Class) { + val implementation = part.type as Class + + // TODO: wrong criteria? (must be shared or not?) + return instantiateViaBootloader(implementation) + } else { + + // not a class, assume primitive type instantiated by composite + return false + } + } + return false + } + + /** + * Transform parts if necessary. + * + * If the bootloader is responsible for creating an instance (if it is a + * abstract type), mark the associated part as a C++ pointer. We do not want + * to change the aggregation kind, since it remains logically a composition, + * it is merely an implementation issue that it must be a pointer for C++ if + * the concrete type is not yet known. + * + * @param compositeImplementation + * a (composite) component + */ + override transformParts(Class compositeImplementation) { + + // TODO + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/xtend-gen/.gitignore b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/xtend-gen/.gitignore new file mode 100644 index 00000000000..c96a04f008e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java/xtend-gen/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/.classpath b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/.classpath new file mode 100644 index 00000000000..098194ca4b7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/.project b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/.project new file mode 100644 index 00000000000..ee60ec6da05 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.qompass.designer.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f42de363afa --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/META-INF/MANIFEST.MF b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..e34e95512eb --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/META-INF/MANIFEST.MF @@ -0,0 +1,33 @@ +Manifest-Version: 1.0 +Export-Package: org.eclipse.papyrus.qompass.designer.ui.handlers +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.emf.ecore, + org.eclipse.uml2.uml, + org.eclipse.core.resources, + org.eclipse.ui.ide, + org.eclipse.papyrus.fcm.profile;bundle-version="1.2.0", + org.eclipse.papyrus.marte.static.profile;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.common;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.widgets;bundle-version="1.2.0", + org.eclipse.gef;bundle-version="3.8.0", + org.eclipse.papyrus.uml.profile;bundle-version="1.2.0", + org.eclipse.papyrus.uml.properties;bundle-version="1.2.0", + org.eclipse.papyrus.uml.tools;bundle-version="1.2.0", + org.eclipse.gmf.runtime.common.core;bundle-version="1.7.0", + org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0", + org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", + org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", + org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="1.2.0", + org.eclipse.papyrus.qompass.designer.core;bundle-version="1.2.0", + org.eclipse.papyrus.qompass.ui;bundle-version="1.2.0" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.qompass.designer.ui.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.ui;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/about.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

      About This Content

      + +

      November 14, 2008

      +

      License

      + +

      The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

      + +

      If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

      + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/build.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/build.properties new file mode 100644 index 00000000000..f1e29af020a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + about.html,\ + icons/,\ + plugin.xml +src.includes = about.html diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/ADLInFlowPort.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/ADLInFlowPort.gif new file mode 100644 index 00000000000..e2b32c65cac Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/ADLInFlowPort.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/Qompass-16x16.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/Qompass-16x16.gif new file mode 100644 index 00000000000..c47d52ad211 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/Qompass-16x16.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/Stereotype.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/Stereotype.gif new file mode 100644 index 00000000000..145e5d589d8 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/Stereotype.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/allocation.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/allocation.gif new file mode 100644 index 00000000000..ced634f9c9c Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/allocation.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/depPlan.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/depPlan.gif new file mode 100644 index 00000000000..712a2485f8d Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/depPlan.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/deploy.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/deploy.gif new file mode 100644 index 00000000000..7a7ced35f3d Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/deploy.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-16x16.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-16x16.gif new file mode 100644 index 00000000000..327caa73f59 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-16x16.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-32x32.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-32x32.gif new file mode 100644 index 00000000000..9e1527b778f Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/ec3m-32x32.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/sample.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/sample.gif new file mode 100644 index 00000000000..34fb3c9d8cb Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/sample.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/selConnector.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/selConnector.gif new file mode 100644 index 00000000000..e47528e5447 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/selConnector.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/selContainer.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/selContainer.gif new file mode 100644 index 00000000000..c16516c624b Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/selContainer.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/sync.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/sync.gif new file mode 100644 index 00000000000..5935eb3cbba Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/icons/sync.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/plugin.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/plugin.properties new file mode 100644 index 00000000000..09415057ea6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus extra: Qompass Designer UI (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/plugin.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/plugin.xml new file mode 100644 index 00000000000..a90ac73c900 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/plugin.xml @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/pom.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/pom.xml new file mode 100644 index 00000000000..c6fffb7c021 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../releng/extra + + org.eclipse.papyrus.qompass.designer.ui + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Activator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Activator.java new file mode 100644 index 00000000000..54b1369473a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.qompass.designer.ui; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.ui"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Messages.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Messages.java new file mode 100644 index 00000000000..53794a9743b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/Messages.java @@ -0,0 +1,43 @@ +package org.eclipse.papyrus.qompass.designer.ui; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.qompass.designer.ui.messages"; //$NON-NLS-1$ + + public static String ConfigurePortHandler_ConfigurePorts; + public static String ConfigurePortHandler_ConfigurePortsOfComponent; + public static String ConfigurePortHandler_ConfigureInstance; + + public static String ConfigurePortDialog_AvailPorts; + public static String ConfigurePortDialog_PortConfig; + public static String ConfigurePortDialog_NotAvail; + public static String ConfigurePortDialog_Kind; + public static String ConfigurePortDialog_None; + public static String ConfigurePortDialog_Type; + public static String ConfigurePortDialog_ChangeType; + public static String ConfigurePortDialog_IntfDerived; + public static String ConfigurePortDialog_Provided; + public static String ConfigurePortDialog_Required; + public static String ConfigurePortDialog_Undef; + + public static String CreateDepPlanHandler_CreateDPs; + public static String CreateDepPlanHandler_Sync; + public static String CreateDepPlanHandler_CreateNew; + public static String CreateDepPlanHandler_WhatShouldIDo; + public static String CreateDepPlanHandler_DPwithNameExistsAlready; + public static String CreateDepPlanHandler_DPwithNameExistsNoPackage; + public static String CreateDepPlanHandler_CannotSync; + public static String CreateDepPlanHandler_Cancel; + public static String CreateDepPlanHandler_CreateDP; + public static String CreateDepPlanHandler_CannotCreateDP; + public static String CreateDepPlanHandler_StereoApplicationFailed; + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AllocationDialog.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AllocationDialog.java new file mode 100644 index 00000000000..14a3e457d49 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AllocationDialog.java @@ -0,0 +1,311 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import org.eclipse.draw2d.Label; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.emf.workspace.AbstractEMFOperation; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.MARTE.MARTE_DesignModel.SRM.SW_Concurrency.SwSchedulableResource; +import org.eclipse.papyrus.infra.widgets.toolbox.utils.DialogUtils; +import org.eclipse.papyrus.qompass.designer.core.CommandSupport; +import org.eclipse.papyrus.qompass.designer.core.ElementFilter; +import org.eclipse.papyrus.qompass.designer.core.commands.AddMarteAndFcmProfile; +import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.BootLoaderGen; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.swt.widgets.TreeColumn; +import org.eclipse.swt.widgets.TreeItem; +import org.eclipse.ui.dialogs.SelectionStatusDialog; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Allocate elements in a deployment plan to a node or thread + * + */ +public class AllocationDialog extends SelectionStatusDialog { + + private DeploymentPlan m_cdp; + + private Tree fTree; + + private Label fLabel; + + private Combo fAlloc; + + private InstanceSpecification currentIS; + + private EList nodeOrThreadList; + + public AllocationDialog(Shell parent, Package cdp) { + super(parent); + m_cdp = UMLUtil.getStereotypeApplication(cdp, DeploymentPlan.class); + nodeOrThreadList = new BasicEList(); + nodeOrThreadList.add(null); // dummy entry for no allocation + DepUtils.getAllInstances(cdp.getModel(), nodeOrThreadList, new ElementFilter() { + + @Override + public boolean acceptElement(Element element) { + if (element instanceof InstanceSpecification) { + InstanceSpecification instance = (InstanceSpecification) element; + if (instance.getName() == null) { + // donn't allocate to root element (detectable via the empty name) + return false; + } + Classifier cl = DepUtils.getClassifier(instance); + if (cl instanceof Class) { + if (StereotypeUtil.isApplied(cl, SwSchedulableResource.class)) { + // threads are valid allocation targets. Therefore, threads are always added to + // list, even if within a deployment plan. + return true; + } + if (StereotypeUtil.isApplied(instance.getNearestPackage(), DeploymentPlan.class)) { + // instance is part of a deployment plan => don't add to list. + return false; + } + return true; + } + } + return false; + } + }); + } + + /** + * @see SelectionStatusDialog#computeResult() + */ + @Override + protected void computeResult() { + // nothing to do + } + + @Override + public Control createDialogArea(Composite parent) { + Composite contents = (Composite) super.createDialogArea(parent); + // (parent, "Container rules", "Avail. extensions/interceptors"); + + fTree = new Tree(contents, SWT.H_SCROLL | SWT.BORDER); + fTree.setHeaderVisible(true); + GridData data = new GridData(GridData.FILL_BOTH); + fTree.setLayoutData(data); + data.heightHint = 150; + // data.widthHint = 200; + + // Turn off drawing to avoid flicker + fTree.setRedraw(false); + + TreeColumn instances = new TreeColumn(fTree, SWT.LEFT); + instances.setText("Instance"); + instances.setWidth(200); + TreeColumn explicitAlloc = new TreeColumn(fTree, SWT.LEFT); + explicitAlloc.setText("explicit allocation"); + explicitAlloc.setWidth(150); + TreeColumn implicitAlloc = new TreeColumn(fTree, SWT.LEFT); + implicitAlloc.setText("implicit allocation"); + implicitAlloc.setWidth(150); + + fillTree(fTree, null, m_cdp.getMainInstance()); + + // Turn drawing back on! + fTree.setRedraw(true); + + fTree.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + if (fTree.getSelection().length > 0) { + selectInstance(fTree.getSelection()[0]); + } + } + }); + + Label label = new Label(); + label.setText("seletected instance:"); + fLabel = new Label(); + + createAllocInfo(contents); + return contents; + } + + /** + * Helper method to fill a tree with data + * + * @param tree + * the tree to fill + */ + private void fillTree(Tree tree, TreeItem treeItem, InstanceSpecification is) { + TreeItem item; + if (treeItem != null) { + item = new TreeItem(treeItem, SWT.NONE); + } else { + item = new TreeItem(tree, SWT.NONE); + } + item.setData(is); + setTextFromData(item); + + // create children + for (InstanceSpecification subIS : DepUtils.getContainedNonSharedInstances(is)) { + fillTree(tree, item, subIS); + } + } + + // obtain name and explicit/implicit node Allocation + protected void setTextFromData(TreeItem ti) { + Object data = ti.getData(); + if (data instanceof InstanceSpecification) { + InstanceSpecification is = (InstanceSpecification) data; + + String name = is.getName(); + int index = name.lastIndexOf("."); //$NON-NLS-1$ + if (index != -1) { + name = name.substring(index + 1); + } + InstanceSpecification explicitNodeOrThread = AllocUtils.getNodeOrThread(is); + Classifier cl = DepUtils.getClassifier(is); + String nodeName; + if (explicitNodeOrThread == null) { + nodeName = "-"; //$NON-NLS-1$ + } else { + nodeName = getAllocName(explicitNodeOrThread); + } + if (cl instanceof Class) { + if (BootLoaderGen.hasUnconnectedStartRoutine(null, (Class) cl, null)) { + nodeName += " (main)"; //$NON-NLS-1$ + } + } + EList implicitNodes = AllocUtils.getAllNodesOrThreadsParent(is); + implicitNodes.addAll(AllocUtils.getAllNodesOrThreadsParent(is)); + String list = ""; //$NON-NLS-1$ + for (InstanceSpecification node : implicitNodes) { + if (list.equals("")) { //$NON-NLS-1$ + list = getAllocName(node); + } else { + list += ", " + getAllocName(node); //$NON-NLS-1$ + } + } + ti.setText(new String[] { name, nodeName, "[" + list + "]" }); //$NON-NLS-1$//$NON-NLS-2$ + } + } + + protected void refreshTree(TreeItem ti) { + setTextFromData(ti); + for (TreeItem subItem : ti.getItems()) { + refreshTree(subItem); + } + } + + private String getAllocName(InstanceSpecification nodeOrThread) { + if (nodeOrThread == null) { + return "no explicit allocation"; + } else { + String name = nodeOrThread.getName(); + InstanceSpecification threadNode = AllocUtils.getNode(nodeOrThread); + return name + (threadNode != null ? " on " + threadNode.getName() : ""); + } + } + + protected void createAllocInfo(Composite parent) { + // create extension kind combo + fAlloc = DialogUtils.createComboWithText(parent, "Alloc to node:", + SWT.DROP_DOWN | SWT.READ_ONLY, SWT.NONE); + + String items[] = new String[nodeOrThreadList.size()]; + int i = 0; + for (InstanceSpecification nodeOrThread : nodeOrThreadList) { + items[i++] = getAllocName(nodeOrThread); + } + fAlloc.setItems(items); + fAlloc.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent event) { + if (currentIS != null) { + updateAllocation(currentIS, fAlloc.getSelectionIndex()); + // selectionCount should always be 1 + for (TreeItem ti : fTree.getSelection()) { + refreshTree(ti); + } + } + } + }); + + fAlloc.setEnabled(false); + } + + /** + * Select a rule, i.e. update the visual representation from the rule + * + * @param rule + */ + protected void selectInstance(TreeItem item) { + // for (Port port : rule.getPortSet ()) { + // fPorts.setSelection() + // } + currentIS = (InstanceSpecification) item.getData(); + fLabel.setText(currentIS.getName()); + + fAlloc.setEnabled(true); + InstanceSpecification nodeOrThread = AllocUtils.getNodeOrThread(currentIS); + + for (int i = 0; i < nodeOrThreadList.size(); i++) { + if (nodeOrThreadList.get(i) == nodeOrThread) { + fAlloc.select(i); + } + } + } + + private void updateAllocation(InstanceSpecification is, int index) { + InstanceSpecification oldNode = AllocUtils.getNodeOrThread(is); + InstanceSpecification newNode = nodeOrThreadList.get(index); + + if (oldNode == newNode) { + return; + } + + // add or update + if (oldNode == null) { + if (!AllocUtils.allocate(is, newNode)) { + if (MessageDialog.openQuestion(Display.getDefault().getActiveShell(), "Error", + "Stereotype application failed. The profile MARTE::Allocation is probably not applied. Try to apply it?")) { + AbstractEMFOperation applyProfile = new AddMarteAndFcmProfile(PackageUtil.getRootPackage(is), AddMarteAndFcmProfile.APPLY_ALLOC, TransactionUtil.getEditingDomain(is)); + CommandSupport.exec(applyProfile); + AllocUtils.allocate(is, newNode); + } + } + } else { + AllocUtils.updateAllocation(is, oldNode, newNode); + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AttributeLabelProvider.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AttributeLabelProvider.java new file mode 100644 index 00000000000..568acd2541f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/AttributeLabelProvider.java @@ -0,0 +1,36 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Type; + +public class AttributeLabelProvider extends LabelProvider { + + @Override + public String getText(Object element) { + if (element instanceof Property) { + Property p = (Property) element; + Type type = p.getType(); + return p.getClass_().getName() + "." + p.getName() + ((type != null) ? + " : " + type.getQualifiedName() : + ""); + } + else { + return "invalid"; + } + } +}; diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChooseConfigOpt.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChooseConfigOpt.java new file mode 100644 index 00000000000..8c2b5f6cda9 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChooseConfigOpt.java @@ -0,0 +1,245 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import java.util.ArrayList; +import java.util.Collections; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.ConfigOption; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.uml.profile.ui.dialogs.AlphabeticalViewerSorter; +import org.eclipse.papyrus.uml.profile.ui.dialogs.ChooseSetAssistedDialog; +import org.eclipse.papyrus.uml.profile.ui.dialogs.IChooseDialog; +import org.eclipse.papyrus.uml.properties.profile.ui.dialogs.StereotypeQualifiedLabelProvider; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Package; + + +public class ChooseConfigOpt extends ChooseSetAssistedDialog implements IChooseDialog { + + protected EList visitedPackages; + + /** + * LabelProvider for stereotype completion proposal provider with qualified names. + */ + final private StereotypeQualifiedLabelProvider qualifiedLabelProvider = new StereotypeQualifiedLabelProvider(); + + /** + * Default Constructor. + * + * @param parentShell + * the parent shell + * @param theElement + * the UML element to be modified + */ + public ChooseConfigOpt(Shell parentShell, Package model, ContainerRule rule) { + super(parentShell, + "Available configuration options: ", + "Applied configuration options: "); + labelProvider = new ConfigOptionLabelProvider(); + decoratedContentProposalProvider = new ConfigOptContentProposalProvider(); + + for (ConfigOption option : rule.getForConfig()) { + selectedElementList.addElement(option.getBase_Class()); + } + + visitedPackages = new BasicEList(); + EList configOptList = new BasicEList(); + getAvailConfigOpts(model, configOptList); + for (Class current : configOptList) { + if (!selectedElementList.contains(current)) { + possibleElementList.addElement(current); + } + } + } + + private void getAvailConfigOpts(Package pkg, EList configOptList) { + for (Element el : pkg.getMembers()) { + if (el instanceof Package) { + if (!visitedPackages.contains(el)) { + visitedPackages.add((Package) el); + getAvailConfigOpts((Package) el, configOptList); + } + } else if (el instanceof Class) { + if (StereotypeUtil.isApplied(el, ConfigOption.class)) { + configOptList.add((Class) el); + } + } + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog#createDialogArea(org.eclipse.swt.widgets.Composite) + */ + /** + * Creates the dialog area. + * + * @param parent + * the parent + * + * @return the control + */ + @Override + protected Control createDialogArea(Composite parent) { + Control composite = super.createDialogArea(parent); + + // Add 2 columns to the table area + // possibleElementsTable.setLinesVisible(true); + possibleElementsTable.setHeaderVisible(true); + + // 1st column with image/checkboxes - NOTE: The SWT.CENTER has no effect!! + TableColumn column = new TableColumn(possibleElementsTable, SWT.CENTER, 0); + column.setText("Option"); + column.setWidth(100); + column.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + possibleElementsTableViewer.setSorter(new AlphabeticalViewerSorter(0)); + } + }); + + // 2nd column with task Description + column = new TableColumn(possibleElementsTable, SWT.LEFT, 1); + column.setText("Information"); + column.setWidth(165); + // Add listener to column so tasks are sorted by description when clicked + column.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + possibleElementsTableViewer.setSorter(new AlphabeticalViewerSorter(1)); + } + }); + + // set sorter to the possible element table viewer + possibleElementsTableViewer.setSorter(new AlphabeticalViewerSorter(0)); + + return composite; + } + + /* + * (non-Javadoc) + * + * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog#runAddElement(java.lang.String) + */ + /** + * Run add element. + * + * @param name + * the name + */ + @Override + protected void runAddElement(String name) { + // find the stereotype in the list + Class option = null; + for (Object possibleElement : possibleElementList.getElements()) { + Class element = (Class) possibleElement; + if (name.equalsIgnoreCase(element.getName()) || + name.equalsIgnoreCase(element.getQualifiedName())) { + option = element; + } + } + if (option != null) { + runActionAdd(option); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog#isSelectableElement(java.lang.String) + */ + /** + * Checks if is selectable element. + * + * @param text + * the text + * + * @return true, if is selectable element + */ + @Override + protected boolean isSelectableElement(String text) { + // iterate through all possibilities and return true if text corresponds + for (Object possibleElement : possibleElementList.getElements()) { + Class element = (Class) possibleElement; + if (text.equalsIgnoreCase(element.getName()) || text.equalsIgnoreCase(element.getQualifiedName())) { + return true; + } + } + return false; + } + + /** + * Content Proposal provider for stereotypes dialog. Propose the simple + * name of the stereotype and its qualified name. + * + * @author Remi Schnekenburger + */ + public class ConfigOptContentProposalProvider extends DecoratedContentProposalProvider { + + /* + * (non-Javadoc) + * + * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog.DecoratedContentProposalProvider#getProposals(java.lang.String, int) + */ + /** + * Gets the proposals. + * + * @param contents + * the contents + * @param position + * the position + * + * @return the proposals + */ + @Override + public DecoratedContentProposal[] getProposals(String contents, int position) { + ArrayList proposals = new ArrayList(); + + if (possibleElementList != null) { + for (Object configOptObj : possibleElementList.getElements()) { + final Class configOpt = (Class) configOptObj; + final String simpleName = configOpt.getName(); + final String qualifiedName = configOpt.getQualifiedName(); + + if (position < simpleName.length() && contents.substring(0, position).equalsIgnoreCase(simpleName.substring(0, position))) { + proposals.add(new DecoratedContentProposal(configOpt, labelProvider)); + } + + if (position < qualifiedName.length() && contents.substring(0, position).equalsIgnoreCase(qualifiedName.substring(0, position))) { + proposals.add(new DecoratedContentProposal(configOpt, qualifiedLabelProvider)); + } + } + } + + Collections.sort(proposals); + return proposals.toArray(new DecoratedContentProposal[proposals.size()]); + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChoosePorts.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChoosePorts.java new file mode 100644 index 00000000000..df3f4e3e44f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ChoosePorts.java @@ -0,0 +1,244 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import java.util.ArrayList; +import java.util.Collections; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.InterceptionRule; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.uml.profile.ui.dialogs.AlphabeticalViewerSorter; +import org.eclipse.papyrus.uml.profile.ui.dialogs.ChooseSetAssistedDialog; +import org.eclipse.papyrus.uml.profile.ui.dialogs.IChooseDialog; +import org.eclipse.papyrus.uml.properties.profile.ui.dialogs.StereotypeQualifiedLabelProvider; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Feature; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; + + +public class ChoosePorts extends ChooseSetAssistedDialog implements IChooseDialog { + + protected EList visitedPackages; + + /** + * LabelProvider for stereotype completion proposal provider with qualified names. + */ + final private StereotypeQualifiedLabelProvider qualifiedLabelProvider = new StereotypeQualifiedLabelProvider(); + + /** + * Default Constructor. + * + * @param parentShell + * the parent shell + * @param theElement + * the UML element to be modified + */ + public ChoosePorts(Shell parentShell, Class component, InterceptionRule rule) { + super(parentShell, "Available features", "Intercepted features"); + labelProvider = new PortLabelProvider(); + decoratedContentProposalProvider = new ConfigOptContentProposalProvider(); + + for (Feature feature : rule.getInterceptionSet()) { + selectedElementList.addElement(feature); + } + + visitedPackages = new BasicEList(); + if (component != null) { + // local rule with intercept some policy: choose executor ports + for (Property current : component.getOwnedAttributes()) { + if (!selectedElementList.contains(current)) { + possibleElementList.addElement(current); + } + } + for (Feature current : Utils.getAllElementsOfType(component, Feature.class)) { + if (!selectedElementList.contains(current)) { + possibleElementList.addElement(current); + } + } + } else { + // global rule with intercept some policy + // choose all ports vs. ports of "standard components" + Package top = PackageUtil.getRootPackage(rule.getBase_Property()); + for (Feature current : Utils.getAllElementsOfType(top, Feature.class)) { + if (!selectedElementList.contains(current)) { + possibleElementList.addElement(current); + } + } + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog#createDialogArea(org.eclipse.swt.widgets.Composite) + */ + /** + * Creates the dialog area. + * + * @param parent + * the parent + * + * @return the control + */ + @Override + protected Control createDialogArea(Composite parent) { + Control composite = super.createDialogArea(parent); + + // Add 2 columns to the table area + // possibleElementsTable.setLinesVisible(true); + possibleElementsTable.setHeaderVisible(true); + + // 1st column with image/checkboxes - NOTE: The SWT.CENTER has no effect!! + TableColumn column = new TableColumn(possibleElementsTable, SWT.CENTER, 0); + column.setText("Port"); + column.setWidth(60); + column.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + possibleElementsTableViewer.setSorter(new AlphabeticalViewerSorter(0)); + } + }); + + // 2nd column with task Description + column = new TableColumn(possibleElementsTable, SWT.LEFT, 1); + column.setText("Type"); + column.setWidth(100); + // Add listener to column so tasks are sorted by description when clicked + column.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + possibleElementsTableViewer.setSorter(new AlphabeticalViewerSorter(1)); + } + }); + + // set sorter to the possible element table viewer + possibleElementsTableViewer.setSorter(new AlphabeticalViewerSorter(0)); + + return composite; + } + + /* + * (non-Javadoc) + * + * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog#runAddElement(java.lang.String) + */ + /** + * Run add element. + * + * @param name + * the name + */ + @Override + protected void runAddElement(String name) { + // find the stereotype in the list + Port port = null; + for (Object possibleElement : possibleElementList.getElements()) { + Port element = (Port) possibleElement; + if (name.equalsIgnoreCase(element.getName()) || name.equalsIgnoreCase(element.getQualifiedName())) { + port = element; + } + } + if (port != null) { + runActionAdd(port); + } + } + + /* + * (non-Javadoc) + * + * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog#isSelectableElement(java.lang.String) + */ + /** + * Checks if is selectable element. + * + * @param text + * the text + * + * @return true, if is selectable element + */ + @Override + protected boolean isSelectableElement(String text) { + // iterate through all possibilities and return true if text corresponds + for (Object possibleElement : possibleElementList.getElements()) { + Port element = (Port) possibleElement; + if (text.equalsIgnoreCase(element.getName()) || text.equalsIgnoreCase(element.getQualifiedName())) { + return true; + } + } + return false; + } + + /** + * Content Proposal provider for stereotypes dialog. Propose the simple + * name of the stereotype and its qualified name. + * + * @author Remi Schnekenburger + */ + public class ConfigOptContentProposalProvider extends DecoratedContentProposalProvider { + + /* + * (non-Javadoc) + * + * @see com.cea.papyrus.ui.dialogs.ChooseSetAssistedDialog.DecoratedContentProposalProvider#getProposals(java.lang.String, int) + */ + /** + * Gets the proposals. + * + * @param contents + * the contents + * @param position + * the position + * + * @return the proposals + */ + @Override + public DecoratedContentProposal[] getProposals(String contents, int position) { + ArrayList proposals = new ArrayList(); + + if (possibleElementList != null) { + for (Object portObj : possibleElementList.getElements()) { + final Port port = (Port) portObj; + final String simpleName = port.getName(); + final String qualifiedName = port.getQualifiedName(); + + if (position < simpleName.length() && contents.substring(0, position).equalsIgnoreCase(simpleName.substring(0, position))) { + proposals.add(new DecoratedContentProposal(port, labelProvider)); + } + + if (position < qualifiedName.length() && contents.substring(0, position).equalsIgnoreCase(qualifiedName.substring(0, position))) { + proposals.add(new DecoratedContentProposal(port, qualifiedLabelProvider)); + } + } + } + + Collections.sort(proposals); + return proposals.toArray(new DecoratedContentProposal[proposals.size()]); + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigOptionLabelProvider.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigOptionLabelProvider.java new file mode 100644 index 00000000000..ec588505f20 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigOptionLabelProvider.java @@ -0,0 +1,50 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.papyrus.qompass.designer.core.Description; +import org.eclipse.swt.graphics.Image; +import org.eclipse.uml2.uml.Class; + +public class ConfigOptionLabelProvider extends LabelProvider implements ITableLabelProvider { + + @Override + public String getText(Object element) { + return ((Class) element).getName(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) + */ + @Override + public String getColumnText(Object element, int columnIndex) { + if (columnIndex == 0) { + return getText(element); + } else if (columnIndex == 1) { + return Description.getDescription((Class) element); + } + return null; + } + + @Override + public Image getColumnImage(Object element, int columnIndex) { + // TODO Auto-generated method stub + return null; + } +}; diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigureInstanceDialog.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigureInstanceDialog.java new file mode 100644 index 00000000000..f5deb6de56c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigureInstanceDialog.java @@ -0,0 +1,642 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.util.FCMUtil; +import org.eclipse.papyrus.infra.widgets.toolbox.utils.DialogUtils; +import org.eclipse.papyrus.qompass.designer.core.ConfigUtils; +import org.eclipse.papyrus.qompass.designer.core.Description; +import org.eclipse.papyrus.qompass.designer.core.ElementFilter; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.papyrus.qompass.designer.core.sync.DepPlanSync; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.FocusListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.layout.RowLayout; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.swt.widgets.TreeItem; +import org.eclipse.ui.dialogs.SelectionStatusDialog; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Enumeration; +import org.eclipse.uml2.uml.EnumerationLiteral; +import org.eclipse.uml2.uml.Feature; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.InstanceValue; +import org.eclipse.uml2.uml.LiteralBoolean; +import org.eclipse.uml2.uml.LiteralInteger; +import org.eclipse.uml2.uml.LiteralString; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.ValueSpecification; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Select container rules, either from a list of globally defined rules or from + * local rules which may be created "on the fly" by this dialog. + * + * TODO: extend rule application to instances (problematic, since rules + * transformation is done on type level) + */ +public class ConfigureInstanceDialog extends SelectionStatusDialog { + + protected Class m_component; + + protected Label fDescriptionLabel; + + protected Text fDescription; + + protected TreeViewer fInstanceList; + + protected TableViewer fPropertyList; + + protected Property m_currentAttribute; + + protected final String valueLabelPrefix = "Value:"; //$NON-NLS-1$ + + protected Label fValueLabel; + + protected Text fValue; + + protected Combo fComboValue; + + protected Package m_model; + + protected Feature m_feature; + + protected EList visitedPackages; + + protected boolean m_rulePropertiesOnly; + + protected InstanceSpecification m_instance; + + EList m_instanceList; + + public ConfigureInstanceDialog(Shell parent) { + super(parent); + } + + public boolean init(Class component, ExecutionEvent from) { + // visitedPackages = new BasicEList (); + DepPlanSync.syncAllDepPlans(component); + m_component = component; + m_instance = null; + m_feature = null; + m_model = PackageUtil.getUserModel(from); + if (m_model == null) { + return false; + } + return checkAndGetInstances(); + } + + public boolean init(InstanceSpecification instance, ExecutionEvent from) { + // visitedPackages = new BasicEList (); + DepPlanSync.syncDepPlan(instance.getNearestPackage()); + m_component = DepUtils.getImplementation(instance); + m_instance = instance; + m_feature = null; + m_model = PackageUtil.getUserModel(from); + return checkAndGetInstances(); + } + + public boolean init(Feature feature, ExecutionEvent from) { + // visitedPackages = new BasicEList (); + m_feature = feature; + m_model = PackageUtil.getUserModel(from); + if (m_model == null) { + m_model = PackageUtil.getRootPackage(feature); + } + m_instance = null; + if (feature instanceof Connector) { + org.eclipse.papyrus.FCM.Connector fcmConn = UMLUtil.getStereotypeApplication(feature, + org.eclipse.papyrus.FCM.Connector.class); + if ((fcmConn != null) && (fcmConn.getIc() != null)) { + m_component = fcmConn.getIc().getBase_Class(); + return checkAndGetInstances(); + } + } else if (feature instanceof Property) { + Type type = ((Property) feature).getType(); + if (type instanceof Class) { + m_component = (Class) type; + return checkAndGetInstances(); + } + } + return false; + } + + /** + * A filter class that selects instances associated with the selected feature or component + */ + class InstanceFilter implements ElementFilter { + + private String featureCandidateName; + + @Override + public boolean acceptElement(Element element) { + if (element instanceof InstanceSpecification) { + InstanceSpecification instance = (InstanceSpecification) element; + if (m_feature instanceof Property) { + EList slots = DepUtils.getReferencingSlots(instance); + for (Slot slot : slots) { + if (slot.getDefiningFeature() == m_feature) { + return true; + } + } + } + else if (m_feature instanceof Connector) { + // Connector instances cannot be found via a slot. Since a connector is not a structural feature, + // it cannot be referenced via the "definingFeature" property of a slot. Therefore, the deployment + // plan creation (@see DepCreation.createDepPlan) simply omits slots, but still creates instances + // for the interaction components referenced by an FCM connector. + // TODO: the following code relies on specific order of instances and might not always work. + Element owner = m_feature.getOwner(); + if (DepUtils.getImplementation(instance) == owner) { + // instance is for owner of feature: examine name + featureCandidateName = instance.getName() + "." + m_feature.getName(); //$NON-NLS-1$ + } + else if (featureCandidateName != null) { + if (featureCandidateName.equals(instance.getName())) { + return true; + } + } + } else if (DepUtils.getImplementation(instance) == m_component) { + return true; + } + } + return false; + } + } + + + /** + * retrieve the instance list. Returns false, if no deployment plan could be found. + * + * @return + */ + public boolean checkAndGetInstances() { + visitedPackages = new BasicEList(); + m_instanceList = new BasicEList(); + + ElementFilter filter = new InstanceFilter(); + DepUtils.getAllInstances(m_model, m_instanceList, filter); + + if (m_instanceList.size() == 0) { + Shell shell = Display.getDefault().getActiveShell(); + if (DepPlanUtils.getAllDepPlans(m_model).size() == 0) { + MessageDialog.openInformation(shell, "Instance configuration", + "No deployment plans are defined. Create a deployment plan before configuring instances"); + return false; + } + else if (MessageDialog.openConfirm(shell, "Instance configuration", + "The list of available instances is empty. Synchronize deployment plans?")) { + DepPlanSync.syncAllDepPlans(m_model); + visitedPackages = new BasicEList(); + DepUtils.getAllInstances(m_model, m_instanceList, filter); + + if (m_instanceList.size() == 0) { + MessageDialog + .openInformation( + shell, + "Instance configuration", + "There are still no instances available\n. Check whether you created already a deployment plan for your system. Check as well, if the parts in your a composite use \"composite\" as aggregation kind. (Results of deployment plan synchronizations will be unrolled)"); + return false; + } + } + } + return true; + } + + /** + * @see SelectionStatusDialog#computeResult() + */ + @Override + protected void computeResult() { + // nothing to do + } + + @Override + public Control createDialogArea(Composite parent) { + Composite contents = (Composite) super.createDialogArea(parent); + // (parent, "Container rules", "Avail. extensions/interceptors"); + + createInstanceSelectionGroup(contents); + createInstanceConfigurationGroup(contents); + return contents; + } + + protected void createInstanceSelectionGroup(Composite parent) { + Composite instanceSelection = new Composite(parent, SWT.NONE); + GridLayout grid = new GridLayout(1, true); + GridData groupGridData = new GridData(); + + groupGridData.grabExcessVerticalSpace = true; + groupGridData.grabExcessHorizontalSpace = true; + groupGridData.horizontalAlignment = GridData.FILL; + groupGridData.verticalAlignment = GridData.FILL; + instanceSelection.setLayout(grid); + instanceSelection.setLayoutData(groupGridData); + + /* + * fRules = DialogUtils.createFilteredList (ruleSelGroup, new + * RuleLabelProvider(), 200, 200, SWT.BORDER | SWT.V_SCROLL | + * SWT.H_SCROLL); + */ + + // + // --------------- instance selection ------------------- + // + Group instanceSelGroup = new Group(instanceSelection, SWT.BORDER); + instanceSelGroup.setText(addSpaces("associated instance specifications")); + // ruleGroup.setLayout(new RowLayout (SWT.VERTICAL)); + instanceSelGroup.setLayout(new GridLayout(1, false)); + instanceSelGroup.setLayoutData(groupGridData); + + fInstanceList = new TreeViewer(instanceSelGroup, SWT.BORDER); + + GridData data = new GridData(GridData.FILL_BOTH); + data.heightHint = 100; + data.widthHint = 350; + + fInstanceList.getTree().setLayoutData(data); + fInstanceList.setLabelProvider(new InstanceLabelProvider()); + fInstanceList.setContentProvider(new ITreeContentProvider() { + + @Override + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + } + + @Override + public void dispose() { + } + + @Override + public boolean hasChildren(Object element) { + return getChildren(element).length > 0; + } + + @Override + public Object getParent(Object element) { + return null; + } + + @Override + public Object[] getElements(Object inputElement) { + return (Object[]) inputElement; + } + + @Override + public Object[] getChildren(Object parentElement) { + if (parentElement instanceof InstanceSpecification) { + return DepUtils.getContainedInstances((InstanceSpecification) parentElement).toArray(); + } + return new Object[0]; + } + }); + + fInstanceList.setInput(m_instanceList.toArray()); + fInstanceList.addSelectionChangedListener(new ISelectionChangedListener() { + + @Override + public void selectionChanged(SelectionChangedEvent event) { + ISelection selection = fInstanceList.getSelection(); + if (selection instanceof StructuredSelection) { + Object[] selected = ((StructuredSelection) selection) + .toArray(); + if ((selected.length == 1) + && (selected[0] instanceof InstanceSpecification)) { + m_instance = (InstanceSpecification) selected[0]; + Classifier cl = DepUtils.getClassifier(m_instance); + fPropertyList.setInput(getConfigAttributes(cl).toArray()); + selectProperty(m_currentAttribute); + } + } + } + }); + if (m_instance != null) { + int index = m_instanceList.indexOf(m_instance); + if (index != -1) { + TreeItem treeItem = fInstanceList.getTree().getItem(index); + fInstanceList.getTree().setSelection(treeItem); + } + } + } + + // create instance configuration group + protected void createInstanceConfigurationGroup(Composite parent) { + GridData groupGridData = DialogUtils.createFillGridData(); + + Group instanceConfigurationGroup = new Group(parent, SWT.BORDER); + instanceConfigurationGroup.setText(addSpaces("Configuration")); + instanceConfigurationGroup.setLayout(new RowLayout(SWT.VERTICAL)); + instanceConfigurationGroup.setLayout(new GridLayout(1, false)); + instanceConfigurationGroup.setLayoutData(groupGridData); + + // fRuleName = new Text (ruleInfoGroup, SWT.NONE); + Label configL = new Label(instanceConfigurationGroup, SWT.NONE); + configL.setText("Available properties:"); + + fPropertyList = new TableViewer(instanceConfigurationGroup, SWT.BORDER); + fPropertyList.setLabelProvider(new AttributeLabelProvider()); + fPropertyList.setContentProvider(new ArrayContentProvider()); + fPropertyList.setInput(getConfigAttributes(m_component).toArray()); + fPropertyList + .addSelectionChangedListener(new ISelectionChangedListener() { + + @Override + public void selectionChanged(SelectionChangedEvent event) { + ISelection selection = fPropertyList.getSelection(); + if (selection instanceof StructuredSelection) { + Object[] selected = ((StructuredSelection) selection) + .toArray(); + if ((selected.length == 1) + && (selected[0] instanceof Property)) { + selectProperty((Property) selected[0]); + } + } + } + }); + + fValueLabel = new Label(instanceConfigurationGroup, SWT.NONE); + + GridData span2 = new GridData(); + span2.horizontalAlignment = GridData.FILL; + span2.grabExcessHorizontalSpace = true; + span2.heightHint = 70; + fPropertyList.getTable().setLayoutData(span2); + + fValue = new Text(instanceConfigurationGroup, SWT.WRAP); + span2 = new GridData(); + span2.horizontalAlignment = GridData.FILL; + span2.grabExcessHorizontalSpace = true; + fValue.setLayoutData(span2); + + fValue.addFocusListener(new FocusListener() { + + @Override + public void focusLost(FocusEvent e) { + // store value, once focus is lost (different element is + // selected) + String valueStr = fValue.getText(); + Slot valueSlot = null; + if (m_instance == null) { + // no instance has been selected + // (field should be inactive, if not selected) + return; + } + for (Slot slot : m_instance.getSlots()) { + if (slot.getDefiningFeature() == m_currentAttribute) { + valueSlot = slot; + } + } + if (valueSlot == null) { + // slot does not exist yet, create + valueSlot = DepCreation.createSlotForConfigProp(m_instance, + m_currentAttribute); + } + for (ValueSpecification value : valueSlot.getValues()) { + if (value instanceof LiteralString) { + ((LiteralString) value).setValue(valueStr); + } else if (value instanceof LiteralInteger) { + ((LiteralInteger) value).setValue(Integer + .parseInt(valueStr)); + } else if (value instanceof LiteralBoolean) { + ((LiteralBoolean) value).setValue(Boolean + .parseBoolean(valueStr)); + } + } + } + + @Override + public void focusGained(FocusEvent e) { + } + }); + + fComboValue = new Combo(instanceConfigurationGroup, SWT.NONE); + span2 = new GridData(); + span2.horizontalAlignment = GridData.FILL; + span2.grabExcessHorizontalSpace = true; + fComboValue.setLayoutData(span2); + + fComboValue.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent event) { + // store value, once focus is lost (different element is + // selected) + int index = fComboValue.getSelectionIndex(); + if (m_instance == null) { + // no instance has been selected + // (field should be inactive, if not selected) + return; + } + Slot valueSlot = null; + for (Slot slot : m_instance.getSlots()) { + if (slot.getDefiningFeature() == m_currentAttribute) { + // slot for enumerations can only be configured with instanceValues. + // Destroy slots with do not contain at least one instanceValue + boolean destroySlot = true; + for (ValueSpecification value : slot.getValues()) { + if (value instanceof InstanceValue) { + destroySlot = false; + } + } + if (destroySlot) { + slot.destroy(); + } + else { + valueSlot = slot; + } + break; + } + } + if (valueSlot == null) { + // slot does not exist yet, create + valueSlot = DepCreation.createSlotForConfigProp(m_instance, + m_currentAttribute); + } + Enumeration enumeration = (Enumeration) m_currentAttribute.getType(); + for (ValueSpecification value : valueSlot.getValues()) { + if (value instanceof InstanceValue) { + ((InstanceValue) value).setInstance(enumeration.getOwnedLiterals().get(index)); + } + } + } + }); + + fDescriptionLabel = new Label(instanceConfigurationGroup, SWT.NONE); + fDescriptionLabel.setText("Description:"); + fDescriptionLabel.setLayoutData(span2); + + span2 = new GridData(); + span2.horizontalAlignment = GridData.FILL; + span2.grabExcessHorizontalSpace = true; + span2.grabExcessVerticalSpace = true; + span2.verticalAlignment = GridData.FILL; + span2.heightHint = 80; + + fDescription = new Text(instanceConfigurationGroup, SWT.NONE | SWT.WRAP + | SWT.V_SCROLL | SWT.READ_ONLY); + fDescription.setLayoutData(span2); + // createMessageArea (ruleInfoGroup); + instanceConfigurationGroup.pack(); + setEnabled(false); + } + + /** + * Select a rule, i.e. update the visual representation from the rule + * + * @param rule + */ + protected void selectProperty(Property attribute) { + m_currentAttribute = attribute; + if ((attribute == null) || (fValue == null)) { + setEnabled(false); + return; + } + setEnabled(true); + fDescription.setText(Description.getDescription(attribute, "not available")); + fValueLabel.setText(getValueLabel(attribute)); + boolean isEnum = m_currentAttribute.getType() instanceof Enumeration; + fValue.setVisible(!isEnum); + fComboValue.setVisible(isEnum); + if (isEnum) { + Enumeration enumeration = (Enumeration) m_currentAttribute.getType(); + EList literals = enumeration.getOwnedLiterals(); + String items[] = new String[literals.size()]; + for (int i = 0; i < literals.size(); i++) { + items[i] = literals.get(i).getName(); + } + fComboValue.setItems(items); + } + + for (Slot slot : m_instance.getSlots()) { + if (slot.getDefiningFeature() == m_currentAttribute) { + for (ValueSpecification value : slot.getValues()) { + if (value instanceof LiteralInteger) { + Integer intVal = ((LiteralInteger) value).getValue(); + fValue.setText(intVal.toString()); + return; + } + if (value instanceof InstanceValue) { + InstanceSpecification enumIS = ((InstanceValue) value).getInstance(); + if (enumIS instanceof EnumerationLiteral) { + EnumerationLiteral literal = (EnumerationLiteral) enumIS; + int index = literal.getEnumeration().getOwnedLiterals().indexOf(literal); + if (index != -1) { + fComboValue.select(index); + } + } + return; + } + else if (value instanceof LiteralBoolean) { + Boolean boolVal = ((LiteralBoolean) value).booleanValue(); + fValue.setText(boolVal.toString()); + return; + } + else if (value instanceof LiteralString) { + fValue.setText(((LiteralString) value).getValue()); + return; + } + } + } + } + fValue.setText(""); //$NON-NLS-1$ + } + + private void setEnabled(boolean enabled) { + fDescriptionLabel.setEnabled(enabled); + fDescription.setEnabled(enabled); + fValueLabel.setEnabled(enabled); + fValue.setEnabled(enabled); + if (!enabled) { + fValue.setText(""); //$NON-NLS-1$ + fDescription.setText(""); //$NON-NLS-1$ + fValueLabel.setText(valueLabelPrefix); + } + } + + private String getValueLabel(Property attribute) { + String label = valueLabelPrefix; + if (attribute.getDefault() != null) { + return label + " " + String.format("(default = %s)", attribute.getDefault()); //$NON-NLS-1$ //$NON-NLS-2$ + } + return label; + } + + private EList getConfigAttributes(Classifier component) { + EList list = new BasicEList(); + // add properties of component + list.addAll(ConfigUtils.getConfigAttributes(component)); + // now add properties of container rules + // TODO: is it possible that multiple container extensions of the same + // type exist, and if yes, how do we configure these? + if (component instanceof Class) { + EList rules = FCMUtil.getAllContainerRules((Class) component); + if (rules != null) { + for (ContainerRule aRule : rules) { + // (many, in case of a composite rule) + try { + list.addAll(ConfigUtils.getConfigAttributes(aRule)); + } catch (TransformationException e) { + } + } + } + } + return list; + } + + /** + * Add a space before and after + * + * @param text + * @return + */ + public static String addSpaces(String text) { + return " " + text + " "; //$NON-NLS-1$ //$NON-NLS-2$ + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigurePortDialog.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigurePortDialog.java new file mode 100644 index 00000000000..7f8bc62475a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConfigurePortDialog.java @@ -0,0 +1,388 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import java.util.Collections; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.UniqueEList; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.papyrus.FCM.PortKind; +import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog; +import org.eclipse.papyrus.infra.widgets.toolbox.utils.DialogUtils; +import org.eclipse.papyrus.qompass.designer.core.Description; +import org.eclipse.papyrus.qompass.designer.core.PortUtils; +import org.eclipse.papyrus.qompass.designer.ui.Messages; +import org.eclipse.papyrus.uml.tools.providers.ServiceEditFilteredContentProvider; +import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.dialogs.SelectionStatusDialog; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Select container rules, either from a list of globally defined rules or from + * local rules which may be created "on the fly" by this dialog. + * + * TODO: extend rule application to instances (problematic, since rules + * transformation is done on type level) + * + */ +public class ConfigurePortDialog extends SelectionStatusDialog { + + protected Class m_component; + + protected Text fDescription; + + protected TableViewer fPortList; + + protected Port m_currentPort; + + protected Combo fKindCombo; + + protected EList portKindList; + + protected Label fType; + + protected Button fTypeButton; + + protected Label fProvided; + + protected Label fRequired; + + protected Package m_model; + + protected EList m_ports; + + public static final String COLON = ":"; //$NON-NLS-1$ + + public ConfigurePortDialog(Shell parent) { + super(parent); + } + + public boolean init(Port port) { + // visitedPackages = new BasicEList (); + m_component = port.getClass_(); + m_currentPort = port; // preselect port (don't call selectPort before initialization of dialog area); + m_model = PackageUtil.getRootPackage(m_component); + m_ports = PortUtils.getAllPorts(m_component); + return true; + } + + public boolean init(Class clazz) { + // visitedPackages = new BasicEList (); + m_component = clazz; + m_model = PackageUtil.getRootPackage(m_component); + m_currentPort = null; + m_ports = PortUtils.getAllPorts(m_component); + return true; + } + + + /** + * @see SelectionStatusDialog#computeResult() + */ + @Override + protected void computeResult() { + // nothing to do + } + + @Override + public Control createDialogArea(Composite parent) { + Composite contents = (Composite) super.createDialogArea(parent); + // (parent, "Container rules", "Avail. extensions/interceptors"); + + createPortConfigurationGroup(contents); + if (m_currentPort != null) { + int index = m_ports.indexOf(m_currentPort); + if (index != -1) { + fPortList.getTable().setSelection(index); + selectPort(m_currentPort); + } + } + return contents; + } + + // create instance configuration group + protected void createPortConfigurationGroup(Composite parent) { + GridData groupGridData = DialogUtils.createFillGridData(); + + // create grid data + GridData gridData = DialogUtils.createFillGridData(); + GridData gridDataH80Span2 = DialogUtils.createFillGridData(); + gridDataH80Span2.horizontalSpan = 2; + gridDataH80Span2.heightHint = 80; + GridData gridDataH25Span2 = DialogUtils.createFillGridData(); + gridDataH25Span2.horizontalSpan = 2; + gridDataH25Span2.heightHint = 25; + GridData gridDataH60 = DialogUtils.createFillGridData(); + gridDataH60.heightHint = 60; + GridData gridDataSpan2 = DialogUtils.createFillGridData(); + gridDataSpan2.horizontalSpan = 2; + + // fRuleName = new Text (ruleInfoGroup, SWT.NONE); + Group portSelection = new Group(parent, SWT.BORDER); + portSelection.setLayout(new GridLayout(1, false)); + // configL.setLayout(new RowLayout()); + + portSelection.setText(" " + Messages.ConfigurePortDialog_AvailPorts + " "); //$NON-NLS-1$ //$NON-NLS-2$ + portSelection.setLayoutData(gridDataH60); + + fPortList = new TableViewer(portSelection, SWT.BORDER); + fPortList.setLabelProvider(new PortLabelProvider()); + fPortList.setContentProvider(new ArrayContentProvider()); + fPortList.setInput(m_ports.toArray()); + fPortList.getTable().setLayoutData(gridDataH60); + fPortList.addSelectionChangedListener(new ISelectionChangedListener() { + + @Override + public void selectionChanged(SelectionChangedEvent event) { + ISelection selection = fPortList.getSelection(); + if (selection instanceof StructuredSelection) { + Object[] selected = ((StructuredSelection) selection) + .toArray(); + if ((selected.length == 1) + && (selected[0] instanceof Port)) { + selectPort((Port) selected[0]); + } + } + } + }); + portSelection.pack(); + + Group instanceConfigurationGroup = new Group(parent, SWT.BORDER); + instanceConfigurationGroup.setText(" " + Messages.ConfigurePortDialog_AvailPorts + " "); //$NON-NLS-1$ //$NON-NLS-2$ + instanceConfigurationGroup.setLayout(new GridLayout(2, false)); + instanceConfigurationGroup.setLayoutData(groupGridData); + + Label kindText = new Label(instanceConfigurationGroup, SWT.NONE); + kindText.setText(Messages.ConfigurePortDialog_Kind + COLON); + + fKindCombo = new Combo(instanceConfigurationGroup, SWT.NONE); + portKindList = getAvailableKinds(m_model); + if (portKindList.size() == 0) { + MessageDialog.openInformation(Display.getDefault().getActiveShell(), "No port kinds founds", "No port kinds are available. Please import a Qompass model library"); + } + String[] portKindStrList = new String[portKindList.size() + 1]; + portKindStrList[0] = Messages.ConfigurePortDialog_None; + for (int i = 0; i < portKindList.size(); i++) { + portKindStrList[i + 1] = portKindList.get(i).getBase_Class().getName(); + } + fKindCombo.setItems(portKindStrList); + fKindCombo.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + // changePortKind + org.eclipse.papyrus.FCM.Port fcmPort = StereotypeUtil.applyApp(m_currentPort, org.eclipse.papyrus.FCM.Port.class); + if (fcmPort != null) + { + int index = fKindCombo.getSelectionIndex(); + if (index > 0) { + PortKind kind = portKindList.get(index - 1); + fcmPort.setKind(kind); + selectPort(m_currentPort); + } + else { + StereotypeUtil.unapply(m_currentPort, org.eclipse.papyrus.FCM.Port.class); + selectPort(m_currentPort); + } + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + Label fTypeLabel = new Label(instanceConfigurationGroup, SWT.NONE); + fTypeLabel.setText(Messages.ConfigurePortDialog_Type + COLON); + fTypeLabel.setLayoutData(gridData); + + fType = new Label(instanceConfigurationGroup, SWT.NONE); + fType.setLayoutData(gridData); + + fTypeButton = new Button(instanceConfigurationGroup, SWT.NONE); + fTypeButton.setText(Messages.ConfigurePortDialog_ChangeType); + fTypeButton.setLayoutData(gridDataH25Span2); + fTypeButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + // use Papyrus type selection dialog ... + TreeSelectorDialog tsd = new TreeSelectorDialog(Display.getDefault().getActiveShell()); + + EStructuralFeature feature = UMLPackage.eINSTANCE.getTypedElement_Type(); + ServiceEditFilteredContentProvider contentProvider = + new ServiceEditFilteredContentProvider(m_currentPort, feature, new EObject[] { m_model }); + + EList wantedMetaClasses = new BasicEList(); + wantedMetaClasses.add(feature.getEType()); + // creates (indirect) dependency to org.eclipse.emf.facet.infra.browser.uicore.CustomizableModelContentProvider + contentProvider.setWantedMetaclasses(wantedMetaClasses); + contentProvider.setNotWantedMetaclasses(Collections.EMPTY_LIST); + tsd.setContentProvider(contentProvider); + tsd.setLabelProvider(new UMLLabelProvider()); + tsd.open(); + Object result[] = tsd.getResult(); + if ((result != null) && (result.length == 1)) { + // if(result[0] instanceof IAdaptable) { + // Object type = ((IAdaptable)result[0]).getAdapter(EObject.class); + Object type = result[0]; + if (type instanceof Type) { + m_currentPort.setType((Type) type); + selectPort(m_currentPort); + } + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + // Label emptySpace = new Label(instanceConfigurationGroup, SWT.NONE); + // emptySpace.setLayoutData(gridDataSpan2); + + + // Composite derivedInterfaces = new Composite(instanceConfigurationGroup, SWT.NONE); + Group derivedInterfaces = new Group(instanceConfigurationGroup, SWT.NONE); + derivedInterfaces.setLayout(new GridLayout(2, false)); + + // Label dil = new Label(derivedInterfaces, SWT.NONE); + // dil.setText("Interfaces derived from port kind"); + derivedInterfaces.setText(Messages.ConfigurePortDialog_IntfDerived); + // dil.setLayoutData(gridDataSpan2); + derivedInterfaces.setLayoutData(gridDataSpan2); + + Label fProvidedLabel = new Label(derivedInterfaces, SWT.NONE); + fProvidedLabel.setText(Messages.ConfigurePortDialog_Provided + COLON); + fProvided = new Label(derivedInterfaces, SWT.NONE); + fProvided.setLayoutData(gridData); + + Label fRequiredLabel = new Label(derivedInterfaces, SWT.NONE); + fRequiredLabel.setText(Messages.ConfigurePortDialog_Required + COLON); + fRequired = new Label(derivedInterfaces, SWT.NONE); + fRequired.setLayoutData(gridData); + derivedInterfaces.pack(); + + fDescription = new Text(instanceConfigurationGroup, SWT.NONE | SWT.WRAP + | SWT.V_SCROLL | SWT.READ_ONLY); + fDescription.setLayoutData(gridDataH80Span2); + // createMessageArea (ruleInfoGroup); + instanceConfigurationGroup.pack(); + setEnabled(false); + } + + /** + * Select a rule, i.e. update the visual representation from the rule + * + * @param rule + */ + protected void selectPort(Port port) { + m_currentPort = port; + if (port == null) { + setEnabled(false); + return; + } + setEnabled(true); + org.eclipse.papyrus.FCM.Port fcmPort = UMLUtil.getStereotypeApplication(port, org.eclipse.papyrus.FCM.Port.class); + if (port.getType() != null) { + fType.setText(port.getType().getQualifiedName()); + } + else { + fType.setText(Messages.ConfigurePortDialog_Undef); + } + if ((fcmPort != null) && (fcmPort.getKind() != null)) { + PortKind kind = fcmPort.getKind(); + if (portKindList.contains(kind)) { + int index = portKindList.indexOf(kind) + 1; + fKindCombo.select(index); + } + fDescription.setText(Description.getDescription(kind.getBase_Class(), Messages.ConfigurePortDialog_NotAvail)); + Interface providedI = PortUtils.getProvided(port); + Interface requiredI = PortUtils.getRequired(port); + fProvided.setText(providedI != null ? providedI.getQualifiedName() : Messages.ConfigurePortDialog_None); + fRequired.setText(requiredI != null ? requiredI.getQualifiedName() : Messages.ConfigurePortDialog_None); + } + else { + fProvided.setText(port.getProvideds().size() > 0 ? port.getProvideds().get(0).getQualifiedName() : Messages.ConfigurePortDialog_None); + fRequired.setText(port.getRequireds().size() > 0 ? port.getRequireds().get(0).getQualifiedName() : Messages.ConfigurePortDialog_None); + fKindCombo.select(0); + fDescription.setText(""); //$NON-NLS-1$ + } + } + + private void setEnabled(boolean enabled) { + fDescription.setEnabled(enabled); + if (!enabled) { + fDescription.setText(""); //$NON-NLS-1$ + } + } + + protected EList getAvailableKinds(Package pkg) { + EList portKindList = new UniqueEList(); + EList visitedPackages = new BasicEList(); + getAvailableKinds(pkg, portKindList, visitedPackages); + return portKindList; + } + + protected void getAvailableKinds(Package pkg, EList portKindList, EList visitedPackages) { + for (Element el : pkg.getMembers()) { + if (el instanceof Package) { + if (!visitedPackages.contains(el)) { + visitedPackages.add((Package) el); + getAvailableKinds((Package) el, portKindList, visitedPackages); + } + } else if (el instanceof Class) { + PortKind portKind = UMLUtil.getStereotypeApplication(el, PortKind.class); + if (portKind != null) { + portKindList.add(portKind); + } + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConnectorSelectionDialog.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConnectorSelectionDialog.java new file mode 100644 index 00000000000..1652acc7663 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ConnectorSelectionDialog.java @@ -0,0 +1,371 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + + +import java.util.Arrays; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.UniqueEList; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.infra.widgets.toolbox.utils.DialogUtils; +import org.eclipse.papyrus.qompass.designer.core.Description; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.templates.ConnectorBinding; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.dialogs.AbstractElementListSelectionDialog; +import org.eclipse.ui.dialogs.FilteredList; +import org.eclipse.ui.dialogs.SelectionStatusDialog; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Feature; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Select a connector type and implementation (group) + * TODO: show information about the used connector [usage, implem properties, ...] + * similar help for ports? + * + * @author ansgar + * + */ +public class ConnectorSelectionDialog extends AbstractElementListSelectionDialog { + + protected Package m_model; + + protected EList visitedPackages; + + protected Text m_description; + + protected Button fTypeOnly; + + private EList connectorList; + + private Feature m_selectedConnector; + + private Object[] fUpperElements; + + protected FilteredList fUpper; + + protected FilteredList fLower; + + private InteractionComponent initialSelection = null; + + public ConnectorSelectionDialog(Shell parent, Package model, Feature selectedConnector) { + super(parent, new QNameLabelProvider()); + connectorList = new BasicEList(); + visitedPackages = new BasicEList(); + getAllConnectors(model, selectedConnector, connectorList); + m_selectedConnector = selectedConnector; + setMultipleSelection(false); + m_model = model; + } + + @Override + public Control createDialogArea(Composite parent) { + Composite contents = (Composite) super.createDialogArea(parent); + createMessageArea(contents); + // createLabel(contents, "Connector type"); + GridData gridData = DialogUtils.createFillGridData(); + gridData.heightHint = 200; + + Group fUpperGroup = new Group(contents, SWT.NONE); + fUpperGroup.setLayout(new GridLayout()); + fUpperGroup.setLayoutData(gridData); + fUpperGroup.setText(" Abstract interaction components "); //$NON-NLS-1$ + createFilterText(fUpperGroup); + fUpper = createFilteredList(fUpperGroup); + + final Group fLowerGroup = new Group(contents, SWT.NONE); + fLowerGroup.setLayout(new GridLayout()); + fLowerGroup.setLayoutData(gridData); + fLowerGroup.setText(" Realizations/groups of interaction components "); //$NON-NLS-1$ + // createLabel(contents, lowerLabel); + fLower = createFilteredList(fLowerGroup); + fFilteredList = fUpper; + org.eclipse.papyrus.FCM.Connector fcmConnector = UMLUtil.getStereotypeApplication(m_selectedConnector, org.eclipse.papyrus.FCM.Connector.class); + if (fcmConnector != null) { + // getInitialElementSelections(); + initialSelection = fcmConnector.getIc(); + } else { + initialSelection = null; + } + + fTypeOnly = new Button(contents, SWT.CHECK); + fTypeOnly.setText("Select type only"); //$NON-NLS-1$ + SelectionListener fTypeOnlySL = new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + if (fTypeOnly.getSelection()) { + fLower.setEnabled(false); + fLowerGroup.setEnabled(false); + fLower.setSelection(new int[0]); + fLower.setElements(null); + } + else { + fLower.setEnabled(true); + fLowerGroup.setEnabled(true); + handleSelectionChanged(); + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }; + fTypeOnly.addSelectionListener(fTypeOnlySL); + + fUpper.setElements(connectorList.toArray()); + + // create initial selections + if (initialSelection instanceof InteractionComponent) { + InteractionComponent componentComp = initialSelection; + Class componentCompBase = componentComp.getBase_Class(); + if (!componentCompBase.isAbstract()) { + // get first superclass that is a component type + Class componentTypeBase = Utils.componentType(componentCompBase); + componentComp = UMLUtil.getStereotypeApplication(componentTypeBase, InteractionComponent.class); + } else { + // fLower.setEnabled (false); + // fLowerGroup.setEnabled(false); + fTypeOnly.setSelection(true); + } + // update status (listener does not evaluate passed data) + fTypeOnlySL.widgetSelected(null); + + // set initial selections + fUpper.setSelection(new Object[] { componentComp.getBase_Class() }); + } + + Label info = createMessageArea(contents); + info.setText("Information about connector implementation:"); //$NON-NLS-1$ + // m_description = createMessageArea(contents); + + GridData descriptionGD = new GridData(); + descriptionGD.horizontalAlignment = GridData.FILL; + descriptionGD.grabExcessHorizontalSpace = true; + descriptionGD.heightHint = 80; + descriptionGD.grabExcessVerticalSpace = true; + descriptionGD.verticalAlignment = GridData.FILL; + + m_description = new Text(contents, SWT.NONE | SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY); + m_description.setLayoutData(descriptionGD); + + fLower.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + Object[] selected = fLower.getSelection(); + if ((selected.length > 0) && (selected[0] instanceof NamedElement)) { + NamedElement selectedNE = (NamedElement) selected[0]; + m_description.setText(Description.getDescription(selectedNE)); + } + else { + m_description.setText(""); + updateOkState(); + } + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + + return contents; + } + + @Override + /** + * Update the enablement of the OK button based on whether or not there + * is a selection. + * + */ + protected void updateOkState() { + if (fTypeOnly.getSelection()) { + super.updateOkState(); + } else { + Button okButton = getOkButton(); + if (okButton != null) { + okButton.setEnabled(fLower.getSelection().length != 0); + } + } + } + + + protected Label createLabel(Composite parent, String name) { + if (name == null) { + return null; + } + Label label = new Label(parent, SWT.NONE); + label.setText(name); + label.setFont(parent.getFont()); + return label; + } + + /** + * Creates a label if name was not null. + * + * @param parent + * the parent composite. + * @param name + * the name of the label. + * @return returns a label if a name was given, null otherwise. + */ + + + /** + * @see SelectionStatusDialog#computeResult() + */ + @Override + protected void computeResult() { + Object[] result = new Object[] { getSelectedElement(fTypeOnly.getSelection()) }; + setResult(Arrays.asList(result)); + } + + /** + * @see AbstractElementListSelectionDialog#handleDefaultSelected() + */ + @Override + protected void handleDefaultSelected() { + if (validateCurrentSelection() && (getSelectedElement(false) != null)) { + buttonPressed(IDialogConstants.OK_ID); + } + } + + /** + * @see AbstractElementListSelectionDialog#handleSelectionChanged() + */ + @Override + protected void handleSelectionChanged() { + handleUpperSelectionChanged(); + } + + private void handleUpperSelectionChanged() { + int index = getSelectionIndex(); + if (index >= 0) { + fUpperElements = getFoldedElements(index); + + if ((fUpperElements == null) || fTypeOnly.getSelection()) { + // lower list remains empty, if typeOnly is true + fLower.setElements(new Object[] {}); + } else { + fLower.setElements(getLowerList(fUpperElements[0])); + if (initialSelection instanceof InteractionComponent) { + // select existing selection in lower section + fLower.setSelection(new Object[] { initialSelection }); + // do not try to set it again. + initialSelection = null; + } + } + } + validateCurrentSelection(); + } + + /** + * Returns the selected element from the upper or lower pane. + * + * @return Object + */ + protected Object getSelectedElement(boolean upper) { + Object[] selection; + if (upper) { + selection = fFilteredList.getSelection(); + } else { + selection = fLower.getSelection(); + } + if (selection.length > 0) { + return selection[0]; + } + return null; + } + + protected Object[] getLowerList(Object selectedUpperObj) { + EList connectorList = new UniqueEList(); + if (selectedUpperObj instanceof Class) { + visitedPackages = new BasicEList(); + getImplGroups(m_model, (Class) selectedUpperObj, connectorList); + } + return connectorList.toArray(); + } + + void getAllConnectors(Package pkg, Feature selectedConnector, EList connectorList) { + for (Element el : pkg.getMembers()) { + if (el instanceof Package) { + if (!visitedPackages.contains(el)) { + visitedPackages.add((Package) el); + getAllConnectors((Package) el, selectedConnector, connectorList); + } + } else if (el instanceof Class) { + if (StereotypeUtil.isApplied(el, InteractionComponent.class) && Utils.isCompType((Class) el)) { + + if (selectedConnector == null) { + connectorList.add((Class) el); + } else { + try { + Element owner = selectedConnector.getOwner(); + if (owner instanceof Class) { + Class composite = (Class) owner; + Log.log(IStatus.INFO, Log.DIALOGS, "ConnectorSelectionDialog.getAllConnectors: try to bind connector " + //$NON-NLS-1$ + ((Class) el).getQualifiedName()); + ConnectorBinding.obtainBinding(composite, selectedConnector, (Class) el, false); + connectorList.add((Class) el); + } else { + connectorList.add((Class) el); + } + } catch (TransformationException e) { + // silently ignore exception: it is normal that we cannot find a binding for some connectors + } + } + } + } + } + } + + void getImplGroups(Package pkg, Class selectedConnType, EList implGroupList) { + for (Element el : pkg.getMembers()) { + if (el instanceof Package) { + if (!visitedPackages.contains(el)) { + visitedPackages.add((Package) el); + getImplGroups((Package) el, selectedConnType, implGroupList); + } + } else if (el instanceof Class) { + Class class_ = (Class) el; + if (class_.getGeneralization(selectedConnType) != null) { + implGroupList.add((Class) el); + } + } + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ContainerDialog.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ContainerDialog.java new file mode 100644 index 00000000000..32a4bc5881d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/ContainerDialog.java @@ -0,0 +1,309 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.CheckStateChangedEvent; +import org.eclipse.jface.viewers.CheckboxTableViewer; +import org.eclipse.jface.viewers.ICheckStateListener; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.RuleApplication; +import org.eclipse.papyrus.infra.widgets.toolbox.utils.DialogUtils; +import org.eclipse.papyrus.qompass.designer.core.Description; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.dialogs.SelectionStatusDialog; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Select container rules, either from a list of globally defined rules + * or from local rules which may be created "on the fly" by this dialog. + * + * TODO: extend rule application to instances (problematic, since rules transformation + * is done on type level) + * + */ +public class ContainerDialog extends SelectionStatusDialog { + + protected Class m_component; + + // protected EList visitedPackages; + protected Text fDescription; + + // protected FilteredList fRules; + protected CheckboxTableViewer fRules; + + // protected Combo fInterceptionKind; + + // protected Button fInterButton; + + // protected Label fPortLabel; + // protected Text fRuleName; + // protected Button fOptionButton; + + // protected Button fPortButton; + + protected ContainerRule m_currentRule; + + protected Package m_model; + + protected boolean m_rulePropertiesOnly; + + public ContainerDialog(Shell parent, Class componentOrRule) { + super(parent); + // visitedPackages = new BasicEList (); + m_rulePropertiesOnly = StereotypeUtil.isApplied(componentOrRule, ContainerRule.class); + if (m_rulePropertiesOnly) { + // m_currentRule = UMLUtil.getStereotypeApplication(componentOrRule, ContainerRule.class); + } else { + m_component = componentOrRule; + } + m_model = PackageUtil.getRootPackage(componentOrRule); + } + + /** + * @see SelectionStatusDialog#computeResult() + */ + @Override + protected void computeResult() { + // nothing to do + } + + @Override + public Control createDialogArea(Composite parent) { + Composite contents = (Composite) super.createDialogArea(parent); + // (parent, "Container rules", "Avail. extensions/interceptors"); + + if (m_rulePropertiesOnly) { + createRuleInfoGroup(contents); + selectRule(m_currentRule); + } else { + createRuleSelectionGroup(contents); + createRuleInfoGroup(contents); + } + return contents; + } + + protected void createRuleSelectionGroup(Composite parent) { + Composite ruleSelections = new Composite(parent, SWT.NONE); + GridLayout grid = new GridLayout(1, true); + GridData groupGridData = new GridData(); + // data3.widthHint = 400; + // data3.heightHint = 300; + groupGridData.grabExcessVerticalSpace = true; + groupGridData.grabExcessHorizontalSpace = true; + groupGridData.horizontalAlignment = GridData.FILL; + groupGridData.verticalAlignment = GridData.FILL; + ruleSelections.setLayout(grid); + ruleSelections.setLayoutData(groupGridData); + ruleSelections.setSize(400, 300); + + /* + * fRules = DialogUtils.createFilteredList (ruleSelGroup, new RuleLabelProvider(), 200, 200, + * SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); + */ + GridData data = new GridData(GridData.FILL_BOTH); + data.heightHint = 150; + data.widthHint = 200; + + ICheckStateListener checkListener = new ICheckStateListener() { + + @Override + public void checkStateChanged(CheckStateChangedEvent event) { + Object obj = event.getElement(); + if (obj instanceof ContainerRule) { + ContainerRule rule = (ContainerRule) obj; + if (event.getChecked()) { + applyRule(rule); + } + else { + unapplyRule(rule); + } + } + } + }; + + // + // --------------- global rules ------------------- + // + Group gRuleSelGroup = new Group(ruleSelections, SWT.BORDER); + gRuleSelGroup.setText(" available rules "); + // ruleGroup.setLayout(new RowLayout (SWT.VERTICAL)); + gRuleSelGroup.setLayout(new GridLayout(1, false)); + gRuleSelGroup.setLayoutData(groupGridData); + + EList globalRuleList = Utils.getAllRules(m_model); + // Table table = new Table(gRuleSelGroup, SWT.CHECK); + fRules = CheckboxTableViewer.newCheckList(gRuleSelGroup, SWT.BORDER); + // fRules = new CheckboxTableViewer(table); + + + GridData data2 = new GridData(GridData.FILL_BOTH); + data2.heightHint = 200; + // data.widthHint = 200; + fRules.getTable().setLayoutData(data); + fRules.setLabelProvider(new RuleLabelProvider()); + fRules.setContentProvider(new ArrayContentProvider()); + + fRules.setInput(globalRuleList.toArray()); + for (ContainerRule rule : globalRuleList) { + if (isRuleApplied(rule)) { + fRules.setChecked(rule, true); + } + } + fRules.addSelectionChangedListener(new ISelectionChangedListener() { + + @Override + public void selectionChanged(SelectionChangedEvent event) { + ISelection selection = fRules.getSelection(); + if (selection instanceof StructuredSelection) { + Object[] selected = ((StructuredSelection) selection).toArray(); + if ((selected.length == 1) && (selected[0] instanceof ContainerRule)) { + if (m_currentRule != selected[0]) { + selectRule((ContainerRule) selected[0]); + } + } + } + } + }); + fRules.addCheckStateListener(checkListener); + } + + protected void createRuleInfoGroup(Composite parent) { + GridData groupGridData = DialogUtils.createFillGridData(); + // data3.widthHint = 400; + // data3.heightHint = 300; + + Group ruleInfoGroup = new Group(parent, SWT.BORDER); + ruleInfoGroup.setText(" rule information "); + // ruleGroup.setLayout(new RowLayout (SWT.VERTICAL)); + ruleInfoGroup.setLayout(new GridLayout(2, false)); + ruleInfoGroup.setLayoutData(groupGridData); + + GridData span2 = new GridData(); + span2.horizontalSpan = 2; + span2.horizontalAlignment = GridData.FILL; + span2.grabExcessHorizontalSpace = true; + span2.grabExcessVerticalSpace = true; + span2.verticalAlignment = GridData.FILL; + span2.heightHint = 80; + + + fDescription = new Text(ruleInfoGroup, SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY); + fDescription.setLayoutData(span2); + // createMessageArea (ruleInfoGroup); + ruleInfoGroup.pack(); + // fPortLabel = new Label (ruleInfoGroup, SWT.NONE); + // fPortLabel.setText ("for Ports"); + // fPortLabel.setEnabled (false); + } + + /** + * Select a rule, i.e. update the visual representation from the rule + * + * @param rule + */ + protected void selectRule(ContainerRule rule) { + m_currentRule = rule; + fDescription.setText(Description.getDescription(rule.getBase_Class())); + } + + /** + * Helper: add a local container rule to the current class + * + * @param name + * the name of the local rule + * @return + */ + ContainerRule addRule(String name) { + Class ruleCl = (Class) + m_component.createNestedClassifier(name, UMLPackage.eINSTANCE.getClass_()); + StereotypeUtil.apply(ruleCl, ContainerRule.class); + return UMLUtil.getStereotypeApplication(ruleCl, ContainerRule.class); + } + + /** + * Helper function: delete a container rule from a class + * + * @param rule + */ + void deleteRule(ContainerRule rule) { + Classifier ruleCl = m_component.getNestedClassifier(rule.getBase_Class().getName()); + if (ruleCl instanceof Class) { + ruleCl.destroy(); + } + } + + /** + * Helper: apply a container rule to current component + * + * @param rule + */ + void applyRule(ContainerRule rule) { + if (!StereotypeUtil.isApplied(m_component, RuleApplication.class)) { + StereotypeUtil.apply(m_component, RuleApplication.class); + } + RuleApplication containerConfig = + UMLUtil.getStereotypeApplication(m_component, RuleApplication.class); + containerConfig.getContainerRule().add(rule); + } + + /** + * Helper: apply a container rule to current component + * + * @param rule + */ + void unapplyRule(ContainerRule rule) { + RuleApplication containerConfig = + UMLUtil.getStereotypeApplication(m_component, RuleApplication.class); + int index = containerConfig.getContainerRule().indexOf(rule); + if ((index >= 0) && (index < containerConfig.getContainerRule().size())) { + containerConfig.getContainerRule().remove(index); + } + } + + /** + * check whether a container rule is applied + * h * @param rule + * + * @return true, if container rule is applied + */ + boolean isRuleApplied(ContainerRule rule) { + RuleApplication containerConfig = + UMLUtil.getStereotypeApplication(m_component, RuleApplication.class); + if (containerConfig != null) { + return containerConfig.getContainerRule().contains(rule); + } + return false; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/GenerationOptionsDialog.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/GenerationOptionsDialog.java new file mode 100644 index 00000000000..fd6fc3d2116 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/GenerationOptionsDialog.java @@ -0,0 +1,138 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import java.util.Arrays; + +import org.eclipse.papyrus.qompass.designer.core.generate.GenerationOptions; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.dialogs.SelectionStatusDialog; + +/** + * Select options for code generation. + * + * @author ansgar + */ +public class GenerationOptionsDialog extends SelectionStatusDialog implements GenerationOptions { + + protected Button fButtonModelOnly; + + protected Button fButtonRewriteSettings; + + protected Button fButtonOnlyChanged; + + protected Button fButtonCACOnly; + + public static int oldResultInt = 0; + + public GenerationOptionsDialog(Shell parent) { + super(parent); + } + + /** + * @see SelectionStatusDialog#computeResult() + */ + @Override + protected void computeResult() { + int resultInt = (isRewriteSettings() ? REWRITE_SETTINGS : 0) + + (isOnlyChanged() ? ONLY_CHANGED : 0) + + (isModelOnly() ? MODEL_ONLY : 0) + + (isCACOnly() ? CAC_ONLY : 0); + oldResultInt = resultInt; + Object[] result = new Object[] { + resultInt + }; + setResult(Arrays.asList(result)); + } + + @Override + public Control createDialogArea(Composite parent) { + Composite contents = (Composite) super.createDialogArea(parent); + // (parent, "Container rules", "Avail. extensions/interceptors"); + + fButtonCACOnly = new Button(contents, SWT.CHECK); + fButtonCACOnly.setText("Only perform container and connector expansion (intermediate model without code generation)"); + fButtonCACOnly.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + updateButtonEnableStatus(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + fButtonCACOnly.setSelection((oldResultInt & CAC_ONLY) != 0); + + fButtonModelOnly = new Button(contents, SWT.CHECK); + fButtonModelOnly.setText("Only generate model (not code)"); + fButtonModelOnly.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + // only write types that have changed does not make sense, if the whole directory is cleaned + boolean modelOnly = fButtonModelOnly.getSelection(); + fButtonOnlyChanged.setEnabled(!modelOnly); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }); + fButtonModelOnly.setSelection((oldResultInt & MODEL_ONLY) != 0); + + fButtonRewriteSettings = new Button(contents, SWT.CHECK); + fButtonRewriteSettings.setText("Rewrite project settings, if project exists already (may overwrite user settings)"); + fButtonRewriteSettings.setSelection((oldResultInt & REWRITE_SETTINGS) != 0); + + fButtonOnlyChanged = new Button(contents, SWT.CHECK); + fButtonOnlyChanged.setText("Experimental: only write types that have changed (based on a difference model via EMF compare)"); + fButtonOnlyChanged.setSelection((oldResultInt & ONLY_CHANGED) != 0); + + updateButtonEnableStatus(); + return contents; + } + + protected void updateButtonEnableStatus() { + boolean onlyCAC = fButtonCACOnly.getSelection(); + boolean modelOnly = fButtonModelOnly.getSelection(); + fButtonModelOnly.setEnabled(!onlyCAC); + fButtonOnlyChanged.setEnabled(!modelOnly && !onlyCAC); + fButtonRewriteSettings.setEnabled(!onlyCAC); + } + + public boolean isRewriteSettings() { + return fButtonRewriteSettings.getSelection(); + } + + public boolean isOnlyChanged() { + return fButtonOnlyChanged.getSelection(); + } + + public boolean isModelOnly() { + return fButtonModelOnly.getSelection(); + } + + public boolean isCACOnly() { + return fButtonCACOnly.getSelection(); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InstanceLabelProvider.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InstanceLabelProvider.java new file mode 100644 index 00000000000..72ed1a737f8 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InstanceLabelProvider.java @@ -0,0 +1,39 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; + +public class InstanceLabelProvider extends LabelProvider { + + @Override + public String getText(Object element) { + if (element instanceof NamedElement) { + String instanceName = ((NamedElement) element).getName(); + Element owner = ((Element) element).getOwner(); + if (owner instanceof NamedElement) { + return "Plan " + ((NamedElement) owner).getName() + ": " + instanceName; + } + else { + return instanceName; + } + } + else { + return "not a named element"; + } + } +}; diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InteractiveImplementationChooser.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InteractiveImplementationChooser.java new file mode 100644 index 00000000000..bfdcf2d7040 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/InteractiveImplementationChooser.java @@ -0,0 +1,55 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.papyrus.qompass.designer.core.deployment.ImplementationChooser; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.dialogs.ElementListSelectionDialog; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.NamedElement; + +public class InteractiveImplementationChooser implements ImplementationChooser { + + @Override + public Class chooseImplementation(Class componentType, EList implList) { + // SelectionDialog = SelectionDialog. + ILabelProvider ilabel = new LabelProvider() { + + @Override + public String getText(Object element) { + return ((NamedElement) element).getQualifiedName(); + } + }; + ElementListSelectionDialog dialog = + new ElementListSelectionDialog(Display.getDefault().getActiveShell(), ilabel); + + dialog.setTitle("Multiple implementations found"); + dialog.setMessage("Select an implementation for component type " + componentType.getName()); + + dialog.setElements(implList.toArray()); + + dialog.open(); + Object[] selection = dialog.getResult(); + if (selection.length == 1) { + if (selection[0] instanceof Class) { + return (Class) selection[0]; + } + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/NameLabelProvider.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/NameLabelProvider.java new file mode 100644 index 00000000000..fcf8a51c82c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/NameLabelProvider.java @@ -0,0 +1,26 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.uml2.uml.NamedElement; + +public class NameLabelProvider extends LabelProvider { + + @Override + public String getText(Object element) { + return ((NamedElement) element).getName(); + } +}; diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/PortLabelProvider.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/PortLabelProvider.java new file mode 100644 index 00000000000..b94bcf1bfca --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/PortLabelProvider.java @@ -0,0 +1,80 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.swt.graphics.Image; +import org.eclipse.uml2.uml.Port; + +/** + * A label provider for either UML or FCM ports + * + * @author ansgar + * + */ +public class PortLabelProvider extends LabelProvider implements ITableLabelProvider { + + /** + * small helper function: simply retrieval of port (element might be either a port or an FCM port) + * + * @param element + * @return + */ + private Port getUMLport(Object element) { + if (element instanceof org.eclipse.papyrus.FCM.Port) { + org.eclipse.papyrus.FCM.Port port = (org.eclipse.papyrus.FCM.Port) element; + if (port != null) { + return port.getBase_Port(); + } + } else if (element instanceof Port) { + return (Port) element; + } + return null; + } + + @Override + public String getText(Object element) { + Port umlPort = getUMLport(element); + if (umlPort != null) { + return umlPort.getName(); + } + return ""; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) + */ + @Override + public String getColumnText(Object element, int columnIndex) { + if (columnIndex == 0) { + return getText(element); + } else if (columnIndex == 1) { + Port umlPort = getUMLport(element); + if (umlPort != null) { + return umlPort.getType().getName(); + } + } + return ""; + } + + @Override + public Image getColumnImage(Object element, int columnIndex) { + // TODO Auto-generated method stub + return null; + } +}; diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/QNameLabelProvider.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/QNameLabelProvider.java new file mode 100644 index 00000000000..0bc904fc210 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/QNameLabelProvider.java @@ -0,0 +1,26 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.uml2.uml.NamedElement; + +public class QNameLabelProvider extends LabelProvider { + + @Override + public String getText(Object element) { + return ((NamedElement) element).getQualifiedName(); + } +}; diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/RuleLabelProvider.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/RuleLabelProvider.java new file mode 100644 index 00000000000..853eaa092b7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/dialogs/RuleLabelProvider.java @@ -0,0 +1,39 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.dialogs; + +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.papyrus.FCM.ContainerRule; + +/** + * Return a label for ContainerRules. Since the name of the rule itself, is not + * really interesting for the user, the returned name is based on the interceptor + * (or extension) + * + * @author ansgar + * + */ +public class RuleLabelProvider extends LabelProvider { + + @Override + public String getText(Object element) { + if (element instanceof ContainerRule) { + ContainerRule rule = (ContainerRule) element; + // TODO? Add information about contained parts? + return rule.getBase_Class().getName(); + } + return null; + } +}; diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AddProfileAndModelLibsHandler.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AddProfileAndModelLibsHandler.java new file mode 100644 index 00000000000..588f0bc84de --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AddProfileAndModelLibsHandler.java @@ -0,0 +1,92 @@ +/******************************************************************************* + * Copyright (c) 2011 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ +package org.eclipse.papyrus.qompass.designer.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.viewers.ArrayContentProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.papyrus.qompass.designer.core.CommandSupport; +import org.eclipse.papyrus.qompass.designer.core.commands.AddMarteAndFcmProfile; +import org.eclipse.papyrus.qompass.designer.core.commands.AddQompassModelLibs; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.dialogs.ListSelectionDialog; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageImport; + +/** + * This class adds the FCM profile, parts of the MARTE profile and required package imports to your model. + */ +public class AddProfileAndModelLibsHandler extends CmdHandler { + + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled() { + updateSelectedEObject(); + if (selectedEObject instanceof Package) { + return true; + } + return false; + } + + /** + * {@inheritDoc} + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + if (!(selectedEObject instanceof Package)) { + return null; + } + final Package selectedPkg = (Package) selectedEObject; + + final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(selectedPkg); + AddMarteAndFcmProfile addProfiles = new AddMarteAndFcmProfile(selectedPkg, + AddMarteAndFcmProfile.APPLY_FCM | AddMarteAndFcmProfile.APPLY_ALLOC | AddMarteAndFcmProfile.APPLY_HLAM_GCM, + domain); + AddQompassModelLibs addModelLibs = new AddQompassModelLibs(selectedPkg, domain); + + final ListSelectionDialog dialog = new ListSelectionDialog(Display.getDefault().getActiveShell(), + addModelLibs.getAvailableImportPackages().toArray(), + new ArrayContentProvider(), + new LabelProvider() { + + @Override + public String getText(Object pi) { + return ((PackageImport) pi).getImportedPackage().getName(); + } + }, + "Select Qompass model libraries for package import.\n" + //$NON-NLS-1$ + "Libraries that are already imported, are selected. Please note that additional\n" + //$NON-NLS-1$ + "Qompass model library might be loaded with the standard \"import registered library\" option\n" + //$NON-NLS-1$ + "\n" + //$NON-NLS-1$ + "Pressing \"Ok\" will continue with the application of the FCM profile and (parts of) the MARTE profile\n");//$NON-NLS-1$ + + dialog.setTitle("Select import library"); //$NON-NLS-1$ + dialog.setInitialElementSelections(addModelLibs.getAlreadyImportedPackages()); + // dialog.setElements (list.toArray ()); + int result = dialog.open(); + if (result == IDialogConstants.OK_ID) { + addModelLibs.setImportList(dialog.getResult()); + CommandSupport.exec(addModelLibs); + CommandSupport.exec(addProfiles); + // open dialog? + // MessageDialog.openWarning(Display.getDefault().getActiveShell(), + // "Warning", "The MARTE profile is not available."); //$NON-NLS-1$ //$NON-NLS-2$ + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AllocateHandler.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AllocateHandler.java new file mode 100644 index 00000000000..dd517e153c9 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/AllocateHandler.java @@ -0,0 +1,90 @@ +/******************************************************************************* + * All rights reserved. This program and the accompanying materials + * are property of the CEA, their use is subject to specific agreement + * with the CEA. + * + * Contributors: + * Ansgar Radermacher (CEA LIST) ansgar.radermacher@cea.fr - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.qompass.designer.core.CommandSupport; +import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.papyrus.qompass.designer.ui.dialogs.AllocationDialog; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.uml2.uml.Package; + +/** + * Implementation class for ClassAction action + */ +public class AllocateHandler extends CmdHandler { + + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled() { + updateSelectedEObject(); + if (selectedEObject instanceof Package) { + return (StereotypeUtil.isApplied((Package) selectedEObject, DeploymentPlan.class)); + } + return false; + } + + /** + * {@inheritDoc} + */ + @Override + public Object execute(ExecutionEvent event) + throws ExecutionException { + if (!(selectedEObject instanceof Package)) { + return null; + } + + final Package cdp = (Package) selectedEObject; + final Shell shell = Display.getDefault().getActiveShell(); + + // org.eclipse.papyrus.qompass.designer.vsl.ParseVSL.test(); + if (DepUtils.getMainInstance(cdp) == null) { + MessageDialog.openInformation(shell, "Error", + "Deployment plan has no main instance (check stereotype attribute mainInstance)"); + return null; + } + + // 1. select possible connectors according to port types + // (only show compatible connectors check-box?) + // 2. select implementation group according to connector type + + // container dialog: either extension, rule or interceptor + // howto select? which? (and howto add/remove?) - Std - dialog is good? + CommandSupport.exec("Instance allocation", event, new RunnableWithResult() { + + @Override + public CommandResult run() { + AllocationDialog allocDialog = + new AllocationDialog(shell, cdp); + allocDialog.setTitle("Allocate instances"); + allocDialog.open(); + if (allocDialog.getReturnCode() == IDialogConstants.OK_ID) { + return CommandResult.newOKCommandResult(); + } + else { + return CommandResult.newCancelledCommandResult(); + } + } + }); + + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigureInstanceHandler.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigureInstanceHandler.java new file mode 100644 index 00000000000..969ecd1d367 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigureInstanceHandler.java @@ -0,0 +1,129 @@ +/******************************************************************************* + * All rights reserved. This program and the accompanying materials + * are property of the CEA, their use is subject to specific agreement + * with the CEA. + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.papyrus.qompass.designer.core.CommandSupport; +import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult; +import org.eclipse.papyrus.qompass.designer.ui.dialogs.ConfigureInstanceDialog; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.Feature; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Property; + +/** + * Implementation class for ClassAction action + */ +public class ConfigureInstanceHandler extends CmdHandler { + + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled() { + updateSelectedEObject(); + if ((selectedEObject instanceof Class) || + (selectedEObject instanceof Connector) || + (selectedEObject instanceof Property) || + (selectedEObject instanceof InstanceSpecification)) { + return true; + } + return false; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + if (!(selectedEObject instanceof NamedElement)) { + return null; + } + + final NamedElement element = (NamedElement) selectedEObject; + final Shell shell = Display.getDefault().getActiveShell(); + final ExecutionEvent from = event; + + // 1. select possible connectors according to port types + // (only show compatible connectors check-box?) + // 2. select implementation group according to connector type + + if (element instanceof Class) { + // container dialog: either extension, rule or interceptor + // how-to select? which? (and how-to add/remove?) - is standard dialog sufficient? + CommandSupport.exec("Configure associated component instance", event, new RunnableWithResult() { //$NON-NLS-1$ + + @Override + public CommandResult run() { + ConfigureInstanceDialog configureInstanceDialog = + new ConfigureInstanceDialog(shell); + if (configureInstanceDialog.init((Class) element, from)) { + configureInstanceDialog.setTitle("Configure instance"); //$NON-NLS-1$ + configureInstanceDialog.setMessage("Configure instance for component " + element.getName()); //$NON-NLS-1$ + configureInstanceDialog.open(); + if (configureInstanceDialog.getReturnCode() == IDialogConstants.OK_ID) { + return CommandResult.newOKCommandResult(); + } + } + return CommandResult.newCancelledCommandResult(); + } + }); + } else if (element instanceof Feature) { + CommandSupport.exec("Configure associated instance", event, new RunnableWithResult() { //$NON-NLS-1$ + + @Override + public CommandResult run() { + ConfigureInstanceDialog configureInstanceDialog = + new ConfigureInstanceDialog(shell); + if (configureInstanceDialog.init((Feature) element, from)) { + configureInstanceDialog.setTitle("Configure instance"); //$NON-NLS-1$ + configureInstanceDialog.setMessage("Configure instance for property/connector " + element.getName()); //$NON-NLS-1$ + configureInstanceDialog.open(); + if (configureInstanceDialog.getReturnCode() == IDialogConstants.OK_ID) { + return CommandResult.newOKCommandResult(); + } + } + return CommandResult.newCancelledCommandResult(); + } + }); + + + } else if (element instanceof InstanceSpecification) { + + CommandSupport.exec("Configure instance", event, new RunnableWithResult() { //$NON-NLS-1$ + + @Override + public CommandResult run() { + ConfigureInstanceDialog configureInstanceDialog = + new ConfigureInstanceDialog(shell); + if (configureInstanceDialog.init((InstanceSpecification) element, from)) { + configureInstanceDialog.setMessage("Configure instance " + element.getName()); //$NON-NLS-1$ + configureInstanceDialog.open(); + if (configureInstanceDialog.getReturnCode() == IDialogConstants.OK_ID) { + return CommandResult.newOKCommandResult(); + } + } + return CommandResult.newCancelledCommandResult(); + } + }); + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java new file mode 100644 index 00000000000..3dcbc83e054 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/ConfigurePortHandler.java @@ -0,0 +1,102 @@ +/******************************************************************************* + * All rights reserved. This program and the accompanying materials + * are property of the CEA, their use is subject to specific agreement + * with the CEA. + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.papyrus.qompass.designer.core.CommandSupport; +import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult; +import org.eclipse.papyrus.qompass.designer.ui.Messages; +import org.eclipse.papyrus.qompass.designer.ui.dialogs.ConfigurePortDialog; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Port; + +/** + * Implementation class for ClassAction action + */ +public class ConfigurePortHandler extends CmdHandler { + + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled() { + updateSelectedEObject(); + if ((selectedEObject instanceof Class) || + (selectedEObject instanceof Port)) { + return true; + } + return false; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + if (!(selectedEObject instanceof NamedElement)) { + return null; + } + + final NamedElement element = (NamedElement) selectedEObject; + final Shell shell = Display.getDefault().getActiveShell(); + + // 1. select possible connectors according to port types + // (only show compatible connectors check-box?) + // 2. select implementation group according to connector type + + if (element instanceof Class) { + CommandSupport.exec(Messages.ConfigurePortHandler_ConfigurePorts, event, new RunnableWithResult() { + + @Override + public CommandResult run() { + ConfigurePortDialog configurePortDialog = + new ConfigurePortDialog(shell); + if (configurePortDialog.init((Class) element)) { + configurePortDialog.setTitle(Messages.ConfigurePortHandler_ConfigurePorts); + configurePortDialog.setMessage(Messages.ConfigurePortHandler_ConfigurePortsOfComponent + " " + element.getName()); //$NON-NLS-1$ + configurePortDialog.open(); + if (configurePortDialog.getReturnCode() == IDialogConstants.OK_ID) { + return CommandResult.newOKCommandResult(); + } + } + return CommandResult.newCancelledCommandResult(); + } + }); + } else if (element instanceof Port) { + CommandSupport.exec(Messages.ConfigurePortHandler_ConfigurePorts, event, new RunnableWithResult() { + + @Override + public CommandResult run() { + ConfigurePortDialog configurePortDialog = + new ConfigurePortDialog(shell); + if (configurePortDialog.init((Port) element)) { + configurePortDialog.setTitle(Messages.ConfigurePortHandler_ConfigurePorts); + configurePortDialog.setMessage(Messages.ConfigurePortHandler_ConfigurePorts + " " + element.getName()); //$NON-NLS-1$ + configurePortDialog.open(); + if (configurePortDialog.getReturnCode() == IDialogConstants.OK_ID) { + return CommandResult.newOKCommandResult(); + } + } + return CommandResult.newCancelledCommandResult(); + } + }); + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreateDepPlanHandler.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreateDepPlanHandler.java new file mode 100644 index 00000000000..6ff9c26c533 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreateDepPlanHandler.java @@ -0,0 +1,144 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.papyrus.qompass.designer.core.CommandSupport; +import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DeployConstants; +import org.eclipse.papyrus.qompass.designer.core.sync.DepPlanSync; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.qompass.designer.ui.Messages; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Stereotype; + +public class CreateDepPlanHandler extends CmdHandler { + + private Package depPlans; + + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled() { + updateSelectedEObject(); + if ((selectedEObject instanceof Class) && Utils.isCompImpl((Class) selectedEObject)) { + return true; + } + return false; + } + + /** + * {@inheritDoc} + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + if (!(selectedEObject instanceof Class)) { + return null; + } + final Class selectedComposite = (Class) selectedEObject; + + CommandSupport.exec(Messages.CreateDepPlanHandler_CreateDPs, event, new Runnable() { + + @Override + public void run() { + // execute with transaction support + depPlans = DepPlanUtils.getDepPlanRoot(selectedComposite); + } + }); + + try { + String name = selectedComposite.getName() + DeployConstants.DepPlanPostfix; + if (depPlans.getMember(name) != null) { + Shell shell = Display.getDefault().getActiveShell(); + String dialogButtonLabels[] = new String[] { + Messages.CreateDepPlanHandler_Cancel, + Messages.CreateDepPlanHandler_Sync, + Messages.CreateDepPlanHandler_CreateNew + }; + MessageDialog dialog = new MessageDialog(shell, Messages.CreateDepPlanHandler_WhatShouldIDo, null, + String.format(Messages.CreateDepPlanHandler_DPwithNameExistsAlready, name), + MessageDialog.QUESTION, dialogButtonLabels, 0); + int result = dialog.open(); + if (result == 0) { + return null; + } + else if (result == 1) { + NamedElement existing = depPlans.getMember(name); + if (existing instanceof Package) { + DepPlanSync.syncDepPlan((Package) existing); + } + else { + MessageDialog.openError(shell, Messages.CreateDepPlanHandler_CannotSync, + String.format(Messages.CreateDepPlanHandler_DPwithNameExistsNoPackage, name)); + } + } + else { + for (int i = 2;; i++) { + name = selectedComposite.getName() + DeployConstants.DepPlanPostfix + i; + if (depPlans.getMember(name) == null) { + break; + } + } + + } + } + final String depPlanName = name; + + CommandSupport.exec(Messages.CreateDepPlanHandler_CreateDP, event, new RunnableWithResult() { + + @Override + public CommandResult run() { + Package cdp = depPlans.createNestedPackage(depPlanName); + Stereotype st = StereotypeUtil.apply(cdp, org.eclipse.papyrus.FCM.DeploymentPlan.class); + if (st == null) { + MessageDialog.openInformation(Display.getDefault().getActiveShell(), + Messages.CreateDepPlanHandler_CannotCreateDP, + Messages.CreateDepPlanHandler_StereoApplicationFailed); + return CommandResult.newErrorCommandResult(Messages.CreateDepPlanHandler_CannotCreateDP); + } + try { + InstanceSpecification newRootIS = + DepCreation.createDepPlan(cdp, selectedComposite, DeployConstants.MAIN_INSTANCE, true); + DepCreation.initAutoValues(newRootIS); + return CommandResult.newOKCommandResult(); + } + catch (TransformationException e) { + MessageDialog.openInformation(Display.getDefault().getActiveShell(), Messages.CreateDepPlanHandler_CannotCreateDP, + e.getMessage()); + return CommandResult.newErrorCommandResult(e.getMessage()); + } + } + }); + + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreatePlatformHandler.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreatePlatformHandler.java new file mode 100644 index 00000000000..22dc6281a47 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/CreatePlatformHandler.java @@ -0,0 +1,94 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.papyrus.qompass.designer.core.CommandSupport; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepCreation; +import org.eclipse.papyrus.qompass.designer.core.deployment.DeployConstants; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationRTException; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Package; + +public class CreatePlatformHandler extends CmdHandler { + + private Package platform; + + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled() { + updateSelectedEObject(); + if (selectedEObject instanceof Class) { + return true; + } + return false; + } + + /** + * {@inheritDoc} + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + if (!(selectedEObject instanceof Class)) { + return null; + } + final Class selectedComposite = (Class) selectedEObject; + + CommandSupport.exec("Create platform model", event, new Runnable() { //$NON-NLS-1$ + + @Override + public void run() { + // execute with transaction support + platform = Utils.getRoot(selectedComposite, DeployConstants.depPlanFolderHw); + } + }); + + final String newPlatform = selectedComposite.getName() + DeployConstants.DepPlanPostfixHw; + + try { + if (platform.getMember(newPlatform) != null) { + Shell shell = Display.getDefault().getActiveShell(); + MessageDialog.openInformation(shell, "Error", //$NON-NLS-1$ + "Platform definition \"" + newPlatform + "\" exists already"); //$NON-NLS-1$ //$NON-NLS-2$ + } else { + CommandSupport.exec("Create platform definition", event, new Runnable() { //$NON-NLS-1$ + + @Override + public void run() { + Package platformPkg = platform.createNestedPackage(newPlatform); + try { + DepCreation.createPlatformInstances(platformPkg, selectedComposite, null); + } + catch (TransformationException e) { + throw new TransformationRTException(e.getMessage()); + } + } + }); + } + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenCollaborationUseHandler.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenCollaborationUseHandler.java new file mode 100644 index 00000000000..614bc5b139e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenCollaborationUseHandler.java @@ -0,0 +1,38 @@ +package org.eclipse.papyrus.qompass.designer.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.jface.action.IAction; +import org.eclipse.papyrus.FCM.Connector; +import org.eclipse.papyrus.FCM.util.FCMUtil; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * TODO: for testing, currently unused + */ +@Deprecated +public class GenCollaborationUseHandler extends CmdHandler { + + /** + * {@inheritDoc} + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + return null; + } + + /** + * /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) + */ + public void run(IAction action) { + updateSelectedEObject(); + + org.eclipse.uml2.uml.Connector selectedConnector = (org.eclipse.uml2.uml.Connector) selectedEObject; + Connector fcmConn = UMLUtil.getStereotypeApplication(selectedConnector, Connector.class); + FCMUtil.generateCollaborationUse(fcmConn); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenConnectionPatternHandler.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenConnectionPatternHandler.java new file mode 100644 index 00000000000..5b56d15f739 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/GenConnectionPatternHandler.java @@ -0,0 +1,49 @@ +package org.eclipse.papyrus.qompass.designer.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.jface.action.IAction; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.FCM.util.FCMUtil; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.ui.IViewPart; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * TODO: for testing, currently unused + */ +@Deprecated +public class GenConnectionPatternHandler extends CmdHandler { + + /** + * {@inheritDoc} + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + return null; + } + + /** + * (non-Javadoc) + * + * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) + */ + public void init(IViewPart view) { + } + + /** + * (non-Javadoc) + * + * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) + */ + public void run(IAction action) { + // only one model is selected + Class selectedClass = (Class) selectedEObject; + Log.log(IStatus.INFO, Log.DIALOGS, "GenConnectionPattern.run: " + selectedClass.getName()); + InteractionComponent connType = UMLUtil.getStereotypeApplication(selectedClass, InteractionComponent.class); + FCMUtil.generateDefaultConnectionPattern(connType); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/InstantiateDepPlanHandler.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/InstantiateDepPlanHandler.java new file mode 100644 index 00000000000..0c16e370d42 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/InstantiateDepPlanHandler.java @@ -0,0 +1,97 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.papyrus.FCM.Configuration; +import org.eclipse.papyrus.qompass.designer.core.ProjectManagement; +import org.eclipse.papyrus.qompass.designer.core.transformations.InstantiateDepPlan; +import org.eclipse.papyrus.qompass.designer.ui.dialogs.GenerationOptionsDialog; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.swt.widgets.Display; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * handler for instantiating a deployment plan + */ +public class InstantiateDepPlanHandler extends CmdHandler { + + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled() { + updateSelectedEObject(); + if ((selectedEObject instanceof Package) || (selectedEObject instanceof Class)) { + return true; + } + return false; + } + + /** + * {@inheritDoc} + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + // only one model is selected + selectedCDP = null; + if ((selectedEObject instanceof Package) || (selectedEObject instanceof Class)) { + selectedCDP = (NamedElement) selectedEObject; + } else { + return null; + } + project = ProjectManagement.getCurrentProject(); + + GenerationOptionsDialog optionsDialog = new GenerationOptionsDialog(Display.getDefault().getActiveShell()); + optionsDialog.open(); + if (optionsDialog.getReturnCode() == IDialogConstants.OK_ID) { + + final int genOptions = (Integer) optionsDialog.getResult()[0]; + Job job = new Job("Create deployment model (OO)") { + + @Override + protected IStatus run(IProgressMonitor monitor) { + // execute the task ... + if (selectedCDP instanceof Package) { + new InstantiateDepPlan().instantiate((Package) selectedCDP, monitor, project, genOptions); + } else if (StereotypeUtil.isApplied(selectedCDP, Configuration.class)) { + Configuration configuration = UMLUtil.getStereotypeApplication(selectedCDP, Configuration.class); + new InstantiateDepPlan().instantiate(configuration, monitor, project, genOptions); + } + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + } + + return null; + } + + private NamedElement selectedCDP; + + private IProject project; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectConnectorHandler.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectConnectorHandler.java new file mode 100644 index 00000000000..0dc3eb1607f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectConnectorHandler.java @@ -0,0 +1,88 @@ +/******************************************************************************* + * All rights reserved. This program and the accompanying materials + * are property of the CEA, their use is subject to specific agreement + * with the CEA. + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.qompass.designer.core.CommandSupport; +import org.eclipse.papyrus.qompass.designer.ui.dialogs.ConnectorSelectionDialog; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.Feature; +import org.eclipse.uml2.uml.Model; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Implementation class for ClassAction action + */ +public class SelectConnectorHandler extends CmdHandler { + + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled() { + updateSelectedEObject(); + if ((selectedEObject instanceof Connector) || (selectedEObject instanceof Property)) { + return true; + } + return false; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + // feature is a common superclass of Connector and Property + if (!(selectedEObject instanceof Feature)) { + return null; + } + // get selected connector + final Feature selectedFeature = (Feature) selectedEObject; + Shell shell = Display.getDefault().getActiveShell(); + + // 1. select possible connectors according to port types + // (only show compatible connectors check-box?) + // 2. select implementation group according to connector type + + Model model = selectedFeature.getModel(); + + ConnectorSelectionDialog elementSelector = + new ConnectorSelectionDialog(shell, model, selectedFeature); + elementSelector.setTitle("Select connector"); + elementSelector.setMessage("Select an implementation for connector " + selectedFeature.getName()); + elementSelector.open(); + if (elementSelector.getReturnCode() == IDialogConstants.OK_ID) { + final Object[] result = elementSelector.getResult(); + if ((result.length == 1) && (result[0] instanceof Class)) { + CommandSupport.exec("Select connector", event, new Runnable() { + + @Override + public void run() { + org.eclipse.papyrus.FCM.Connector fcmSelectedConnector = StereotypeUtil.applyApp(selectedFeature, org.eclipse.papyrus.FCM.Connector.class); + InteractionComponent newConnType = UMLUtil.getStereotypeApplication((Class) result[0], InteractionComponent.class); + fcmSelectedConnector.setIc(newConnType); + } + }); + } + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectContainerHandler.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectContainerHandler.java new file mode 100644 index 00000000000..dd7771eea86 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SelectContainerHandler.java @@ -0,0 +1,120 @@ +/******************************************************************************* + * All rights reserved. This program and the accompanying materials + * are property of the CEA, their use is subject to specific agreement + * with the CEA. + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.papyrus.qompass.designer.core.CommandSupport; +import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult; +import org.eclipse.papyrus.qompass.designer.ui.dialogs.ContainerDialog; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Type; + +/** + * Call the dialogs for selecting a container rule + */ +public class SelectContainerHandler extends CmdHandler { + + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled() { + updateSelectedEObject(); + if ((selectedEObject instanceof Class) || + (selectedEObject instanceof InstanceSpecification)) { + return true; + } + if (selectedEObject instanceof Property) { + Type type = ((Property) selectedEObject).getType(); + if (type instanceof Class) { + return true; + } + } + return false; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + if (!(selectedEObject instanceof NamedElement)) { + return null; + } + + NamedElement ne = (NamedElement) selectedEObject; + final Shell shell = Display.getDefault().getActiveShell(); + + if (ne instanceof Property) { + // treat property as the associated type + Type type = ((Property) ne).getType(); + if (type instanceof Class) { + ne = type; + } + } + final NamedElement element = ne; + + // 1. select possible connectors according to port types + // (only show compatible connectors check-box?) + // 2. select implementation group according to connector type + + if (element instanceof Class) { + // container dialog: either extension, rule or interceptor + // howto select? which? (and howto add/remove?) - Std - dialog is good? + CommandSupport.exec("Select container", event, new RunnableWithResult() { + + @Override + public CommandResult run() { + ContainerDialog elementSelector = + new ContainerDialog(shell, (Class) element); + elementSelector.setTitle("Select container rules for component " + element.getName()); + elementSelector.open(); + if (elementSelector.getReturnCode() == IDialogConstants.OK_ID) { + return CommandResult.newOKCommandResult(); + } + else { + return CommandResult.newCancelledCommandResult(); + } + } + }); + } else if (element instanceof InstanceSpecification) { + /* + * ConnectorSelectionDialog elementSelector = + * new ConnectorSelectionDialog (shell, model, (InstanceSpecification) element); + * elementSelector.setTitle("Select connector"); + * elementSelector.setMessage("Select an implementation for connector " + selectedConnector.getName ()); + * elementSelector.open(); + * if (elementSelector.getReturnCode () == IDialogConstants.OK_ID) { + * final Object[] result = elementSelector.getResult (); + * if ((result.length == 2) && (result[0] instanceof Class) && (result[1] instanceof Class)) { + * CommandSupport.exec ("Select connector", new Runnable () { + * public void run () { + * Object newConnType = StereotypeUtil.getApplication ((Class) result[0], ConnectorType.class); + * Object newConnImpl = StereotypeUtil.getApplication ((Class) result[1], ConnectorImpl.class); + * } + * }); + * } + * } + */ + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SyncHandler.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SyncHandler.java new file mode 100644 index 00000000000..93708d5888e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/SyncHandler.java @@ -0,0 +1,147 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.qompass.designer.core.CommandSupport; +import org.eclipse.papyrus.qompass.designer.core.RunnableWithResult; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.sync.CompImplSync; +import org.eclipse.papyrus.qompass.designer.core.sync.DepPlanSync; +import org.eclipse.papyrus.qompass.designer.core.sync.InterfaceSync; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationRTException; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Property; + +/** + * Handler for synchronizing derived elements. Will do different + * things, depending on the currently selected object. + */ +public class SyncHandler extends CmdHandler { + + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled() { + updateSelectedEObject(); + // if a property is selected, use the associated type + if (selectedEObject instanceof Property) { + selectedEObject = ((Property) selectedEObject).getType(); + } + + if (selectedEObject instanceof Interface) { + return true; + } + if (selectedEObject instanceof Class) { + if (Utils.isComponent((Class) selectedEObject)) { + return true; + } + } + else if (selectedEObject instanceof Package) { + if (StereotypeUtil.isApplied((Package) selectedEObject, DeploymentPlan.class)) { + return true; + } + } + return false; + } + + /** + * {@inheritDoc} + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + // if a property is selected, use the associated type + if (selectedEObject instanceof Property) { + selectedEObject = ((Property) selectedEObject).getType(); + } + + if (selectedEObject instanceof Interface) { + final Interface selectedIntf = (Interface) selectedEObject; + CommandSupport.exec("Synchronize interface", event, new Runnable() { + + @Override + public void run() { + InterfaceSync.syncSignalReceptionSupport(selectedIntf); + } + }); + } + + else if (selectedEObject instanceof Class) { + final Class selectedClass = (Class) selectedEObject; + if (Utils.isCompImpl(selectedClass)) { + CommandSupport.exec("Synchronize component via implementation", event, new RunnableWithResult() { + + @Override + public CommandResult run() { + CompImplSync.updatePorts(selectedClass); + try { + CompImplSync.syncRealizations(selectedClass); + } + catch (TransformationRTException e) { + MessageDialog.openWarning(Display.getDefault().getActiveShell(), "Problems during synchronization", e.getMessage()); + return CommandResult.newErrorCommandResult(e.getMessage()); + } + + // CompImplSync.syncContextOps (selectedClass, true); + CompImplSync.interfaceModifications(selectedClass, null); + return CommandResult.newOKCommandResult(); + } + }); + } else if (Utils.isCompType(selectedClass)) { + CommandSupport.exec("Synchronize component via type", event, new Runnable() { + + @Override + public void run() { + if (!CompImplSync.syncViaType(selectedClass, false)) { + MessageDialog.openWarning(Display.getDefault().getActiveShell(), "Warning: ineffective command", + "Synchronization applied on a component type (abstract class) will synchronize all implementations, i.e. non-abstract classes inheriting from it. However, the selected type has no implementations"); + } + // CompImplSync.syncContextOps (selectedClass, true); + } + }); + } + } + else if (selectedEObject instanceof Package) { + final Package selectedPkg = (Package) selectedEObject; + CommandSupport.exec("Synchronize deployment plan", event, new RunnableWithResult() { + + @Override + public CommandResult run() { + try { + DepPlanSync.syncDepPlan(selectedPkg); + return CommandResult.newOKCommandResult(); + } + catch (TransformationRTException e) { + Shell shell = Display.getDefault().getActiveShell(); + MessageDialog.openError(shell, "Can not synchronize deployment plan", e.getMessage()); + return CommandResult.newErrorCommandResult(e.getMessage()); + } + } + }); + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/TrafoAndCodegenHandler.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/TrafoAndCodegenHandler.java new file mode 100644 index 00000000000..f129bdaa807 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/handlers/TrafoAndCodegenHandler.java @@ -0,0 +1,58 @@ +package org.eclipse.papyrus.qompass.designer.ui.handlers; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.papyrus.qompass.designer.core.ProjectManagement; +import org.eclipse.papyrus.qompass.designer.core.transformations.TrafoAndCodegenPackage; +import org.eclipse.papyrus.uml.diagram.common.handlers.CmdHandler; +import org.eclipse.uml2.uml.Package; + +public class TrafoAndCodegenHandler extends CmdHandler { + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled() { + updateSelectedEObject(); + return (selectedEObject instanceof Package); + } + + /** + * {@inheritDoc} + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + // only one model is selected + selectedPkg = null; + if (selectedEObject instanceof Package) { + selectedPkg = (Package) selectedEObject; + } else { + return null; + } + project = ProjectManagement.getCurrentProject(); + + Job job = new Job("Execute transformations and generate code") { + + @Override + protected IStatus run(IProgressMonitor monitor) { + // execute the task ... + TrafoAndCodegenPackage.instantiate(selectedPkg, monitor, project); + monitor.done(); + return Status.OK_STATUS; + } + }; + job.setUser(true); + job.schedule(); + + return null; + } + + protected Package selectedPkg; + + protected IProject project; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/messages.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/messages.properties new file mode 100644 index 00000000000..40a457cfc83 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/messages.properties @@ -0,0 +1,27 @@ +ConfigurePortHandler_ConfigurePorts=Configure ports +ConfigurePortHandler_ConfigurePortsOfComponent=Configure ports of component +ConfigurePortHandler_ConfigureInstance=Configure instance + +ConfigurePortDialog_AvailPorts=Available Ports +ConfigurePortDialog_PortConfig=Port configuration +ConfigurePortDialog_NotAvail=not available +ConfigurePortDialog_Kind=Kind +ConfigurePortDialog_None=none +ConfigurePortDialog_Type=Type +ConfigurePortDialog_ChangeType=change type +ConfigurePortDialog_IntfDerived=Interfaces derived from kind and type +ConfigurePortDialog_Provided=Provided +ConfigurePortDialog_Required=Required +ConfigurePortDialog_Undef=undefined + +CreateDepPlanHandler_CreateDPs=Create deployment plans +CreateDepPlanHandler_Sync=Synchronize +CreateDepPlanHandler_CreateNew=create new (auto number name) +CreateDepPlanHandler_WhatShouldIDo=What should I do? +CreateDepPlanHandler_DPwithNameExistsAlready=Deployment plan with name %s exists already. You can always synchronize an existing deployment plan via the context menu "Synchronize derived elements" +CreateDepPlanHandler_DPwithNameExistsNoPackage=Element with name %s exists, but is not a package +CreateDepPlanHandler_CannotSync=Cannot synchronize +CreateDepPlanHandler_Cancel=Cancel +CreateDepPlanHandler_CreateDP=Create deployment plan +CreateDepPlanHandler_CannotCreateDP=Cannot create deployment plan +CreateDepPlanHandler_StereoApplicationFailed=Application of stereotype "FCM::DeploymentPlan" failed. Check, if FCM profile is applied diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferenceInitializer.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferenceInitializer.java new file mode 100644 index 00000000000..f28c634a309 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferenceInitializer.java @@ -0,0 +1,39 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.qompass.designer.ui.preferences; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.qompass.designer.core.preferences.QompassPreferenceConstants; + +/** + * Class used to initialize default preference values. + */ +public class QompassPreferenceInitializer extends AbstractPreferenceInitializer { + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() + */ + @Override + public void initializeDefaultPreferences() { + IPreferenceStore store = org.eclipse.papyrus.qompass.designer.core.Activator.getDefault().getPreferenceStore(); + store.setDefault(QompassPreferenceConstants.P_SHOW_PROV_REQ_AS_PORT_ICONS, false); + store.setDefault(QompassPreferenceConstants.P_ALL_ATTRIBUTES_ARE_CONFIG_ATTRIBUTES, false); + store.setDefault(QompassPreferenceConstants.P_TREAT_NONE_AS_COMPOSITE, false); + store.setDefault(QompassPreferenceConstants.P_CODE_GEN_PREFIX, "// generated with Qompass toolchain"); + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferencePage.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferencePage.java new file mode 100644 index 00000000000..c5552e6020b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui/src/org/eclipse/papyrus/qompass/designer/ui/preferences/QompassPreferencePage.java @@ -0,0 +1,76 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.qompass.designer.ui.preferences; + +import org.eclipse.jface.preference.BooleanFieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.jface.preference.StringFieldEditor; +import org.eclipse.papyrus.qompass.designer.core.Activator; +import org.eclipse.papyrus.qompass.designer.core.preferences.QompassPreferenceConstants; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; + +/** + * This class represents the EC3M preference page + *

      + * This page is used to modify preferences only. They are stored in the preference store that belongs to the main plug-in class. That way, preferences can be accessed directly via the preference store. + */ + +public class QompassPreferencePage + extends FieldEditorPreferencePage + implements IWorkbenchPreferencePage { + + public QompassPreferencePage() { + super(GRID); + setPreferenceStore(Activator.getDefault().getPreferenceStore()); + setDescription("Qompass options"); + } + + /** + * Creates the field editors. Field editors are abstractions of + * the common GUI blocks needed to manipulate various types + * of preferences. Each field editor knows how to save and + * restore itself. + */ + @Override + public void createFieldEditors() { + addField(new BooleanFieldEditor( + QompassPreferenceConstants.P_SHOW_PROV_REQ_AS_PORT_ICONS, + "&Show icons associated with derived provided/required interfaces instead of kind", + getFieldEditorParent())); + + addField(new BooleanFieldEditor( + QompassPreferenceConstants.P_TREAT_NONE_AS_COMPOSITE, + "Treat aggregation kind \"&None\" as \"Composite\"", + getFieldEditorParent())); + + addField(new BooleanFieldEditor( + QompassPreferenceConstants.P_ALL_ATTRIBUTES_ARE_CONFIG_ATTRIBUTES, + "Treat all attributes as configuration attributes (if false, only attributes of abstract classes and attributes explicitly tagged as FCM::ConfigurationProperty will be considered as configuration attribute", + getFieldEditorParent())); + + addField(new StringFieldEditor( + QompassPreferenceConstants.P_CODE_GEN_PREFIX, + "Code generation prefix: ", getFieldEditorParent())); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) + */ + @Override + public void init(IWorkbench workbench) { + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/.classpath b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/.project b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/.project new file mode 100644 index 00000000000..896877fb61f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.qompass.designer.validation + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/META-INF/MANIFEST.MF b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..d110843ec77 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/META-INF/MANIFEST.MF @@ -0,0 +1,17 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.uml2.uml;bundle-version="3.0.1", + org.eclipse.emf.validation;bundle-version="1.3.0", + org.eclipse.papyrus.qompass.designer.core;bundle-version="1.2.0", + org.eclipse.papyrus.fcm.profile;bundle-version="1.2.0", + org.eclipse.ui, + org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.qompass.designer.validation.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.validation;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/about.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

      About This Content

      + +

      November 14, 2008

      +

      License

      + +

      The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

      + +

      If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

      + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/build.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/build.properties new file mode 100644 index 00000000000..1d9f30169a4 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/build.properties @@ -0,0 +1,11 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + .classpath,\ + .project,\ + about.html,\ + icons/,\ + plugin.properties +src.includes = about.html diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/icons/validate.gif b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/icons/validate.gif new file mode 100644 index 00000000000..6efaebec95b Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/icons/validate.gif differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/plugin.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/plugin.properties new file mode 100644 index 00000000000..348b2b9b363 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus extra: Qompass designer validation rules (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/plugin.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/plugin.xml new file mode 100644 index 00000000000..96f6b43d98c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/plugin.xml @@ -0,0 +1,290 @@ + + + + + + + + + + + + + + + "Qompass: {0}" + + + The system component (main instance within deployment plan) may not have ports. + + + + + + + "Qompass: {0}" + + + Is there a slot for all properties of a component within an instance specification? + + + + + + + "Qompass: {0}" + + + Verify that a connection does not originate from a caller with to a server with the server multiplicity > 1 + + + + + + + "Qompass: {0}" + + + Verify that at exactly one blocking start routine is defined. + + + + + + + "Qompass: {0}" + + + Check whether a provided port is not connected. Typically, this is not problematic. Therefore, the rule is disabled by default. + + + + + + + "Qompass: {0}" + + + Check whether a required port is not connected. This would result in an error, if the component owning the port tries to invoke a service through that port. + + + + + + + "Qompass: {0}" + + + Operation is not implemented + + + + + + + "Qompass: {0}" + + + Port is not correctly typed + + + + + + + "Qompass: {0}" + + + Behavior without specification + + + + + + + "Qompass: {0}" + + + Verify that a connector can be instantiated, i.e. a consistent connector binding can be found. + + + + + + + "Qompass: {0}" + + + Check whether aggregation kind is consistent with singleton information + + + + + + + "Qompass: {0}" + + + Check whether configuration attributes have a value in the deployment plans + + + + + + + "Qompass: {0}" + + + Check whether an operation contains more than one return parameter + + + + + + + "Qompass: {0}" + + + Check whether a template parameter is referenced out of scope + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/pom.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/pom.xml new file mode 100644 index 00000000000..e98e82171b2 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../releng/extra + + org.eclipse.papyrus.qompass.designer.validation + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/Activator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/Activator.java new file mode 100644 index 00000000000..00051315823 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.qompass.designer.validation; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.validation"; + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/ValidationDelegateClientSelector.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/ValidationDelegateClientSelector.java new file mode 100644 index 00000000000..2bea425443b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/ValidationDelegateClientSelector.java @@ -0,0 +1,25 @@ +package org.eclipse.papyrus.qompass.designer.validation; + +import org.eclipse.emf.validation.model.IClientSelector; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.PackageImport; + +public class ValidationDelegateClientSelector implements IClientSelector { + + /** + * Queries whether to select the specified object, which indicates that it + * belongs to this client context. + * + * @param object + * a model element of some kind + * @return true if the object matches my client + * context; false, otherwise + */ + @Override + public boolean selects(Object object) { + if (object instanceof PackageImport) { + // return false; + } + return (object instanceof Element); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/AggregationKindValid.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/AggregationKindValid.java new file mode 100644 index 00000000000..60364005ae4 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/AggregationKindValid.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * Copyright (c) 2008-2010 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are property of the CEA, their use is subject to specific agreement + * with the CEA. + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.papyrus.FCM.ConfigurationProperty; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.AggregationKind; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Type; + +/** + * Verify that aggregation kinds are used well. General rule: + * attributes of a components should have aggregation kind "composite" unless + * (1) the are singletons (implementation property), i.e. there is exactly one instance. + * + * (2) they are *shared*. In this case an enclosing component has to define a property of same type + * and name (open if "same name" restriction is kept, since it implies an implicit relationship + * that would break after name changes. But it allows for having multiple shared properties of same type) + * [it does not make a difference, whether "aggregation" or "none" is used as aggregation kind] + * Alternative? give user a fine control in the instantiation model? Fractal: no need for a single + * composed property? + * + * Rule has been made specific to Qompass, since we verify that configurationProperty is applicable (implying that the + * FCM profile is applied) + * + * @author ansgar + * + */ +public class AggregationKindValid extends AbstractModelConstraint { + + @Override + public IStatus validate(IValidationContext ctx) + { + Property attribute = (Property) ctx.getTarget(); + Type type = attribute.getType(); + if (type instanceof Class) { + AggregationKind aggKind = attribute.getAggregation(); + if (aggKind != AggregationKind.COMPOSITE_LITERAL) { + if (StereotypeUtil.isApplicable(attribute, ConfigurationProperty.class) && !Utils.isSingleton((Class) type)) { + // no composition, but not singleton: warn user to make up a proper deployment plan + // validation has been made Qompass specific by checking whether the Configuration attribute is applicable + + // first check, if the attribute is referenced by an instance specification (via + // the defining feature attribute). Otherwise, do not continue, since the warnings might lead to false + // alerts + return ctx.createFailureStatus("The attribute '" + attribute.getName() + "' has a non-composition aggregation kind, but the referenced type ('" + + type.getName() + "') is not a singleton. The associated instance specifications have to be set-up manually"); + } + } + } + return ctx.createSuccessStatus(); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/BehaviorsWithoutSpecification.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/BehaviorsWithoutSpecification.java new file mode 100644 index 00000000000..87d2b7457f6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/BehaviorsWithoutSpecification.java @@ -0,0 +1,65 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.OpaqueBehavior; + +/** + * Check whether all behaviors have a specification. This happens for instance, if the user + * deletes a specification and "forgets" to delete the associated behavior. + * + * @author ansgar + * + */ +public class BehaviorsWithoutSpecification extends AbstractModelConstraint { + + @Override + public IStatus validate(IValidationContext ctx) { + + OpaqueBehavior behavior = (OpaqueBehavior) ctx.getTarget(); + + if (behavior.getSpecification() == null) { + Element class_ = behavior.getOwner(); + if (StereotypeUtil.isApplicable(class_, DerivedElement.class)) { + // check whether DerivedElement is applicable => indirect check whether FCM is applied (make rule specific to Qompass) + // TODO alternative? check whether behavior is referenced from either an activity, since that is possible in general? + /* + * boolean hasRef = false; + * for (Setting setting : UML2Util.getNonNavigableInverseReferences(behavior)) { + * if (setting.getEObject() ... + * hasRefFromIS = true; + * break; + * } + * } + */ + if (class_ instanceof NamedElement) { + return ctx.createFailureStatus("The behavior '" + behavior.getName() + "' of '" + + ((NamedElement) class_).getQualifiedName() + "' has no specification"); + } + else { + return ctx.createFailureStatus("The behavior '" + behavior.getName() + "' has no specification"); + } + } + } + return ctx.createSuccessStatus(); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConfigurationAttributeNotSet.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConfigurationAttributeNotSet.java new file mode 100644 index 00000000000..87c6f1cb141 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConfigurationAttributeNotSet.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2008-2010 CEA LIST. + * All rights reserved. This program and the accompanying materials + * are property of the CEA, their use is subject to specific agreement + * with the CEA. + * + * Contributors: + * CEA LIST - initial API and implementation + *******************************************************************************/ +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.papyrus.FCM.ConfigurationProperty; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Slot; +import org.eclipse.uml2.uml.StructuralFeature; + +/** + * Verify if all configuration attribute have a (user-provided) value. + * + * @author ansgar + * + * TODO: implementation assumes that at least the slot exists + */ +public class ConfigurationAttributeNotSet extends AbstractModelConstraint { + + @Override + public IStatus validate(IValidationContext ctx) + { + Slot slot = (Slot) ctx.getTarget(); + StructuralFeature feature = slot.getDefiningFeature(); + if ((feature != null) && (StereotypeUtil.isApplied(feature, ConfigurationProperty.class))) { + if (slot.getValues().size() == 0) { + return ctx.createFailureStatus("The attribute '" + feature.getName() + "' is tagged as a configuration property, but the associated slot has no value."); + } + } + return ctx.createSuccessStatus(); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorCallMultiplicity.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorCallMultiplicity.java new file mode 100644 index 00000000000..104f433063d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorCallMultiplicity.java @@ -0,0 +1,82 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; + +/** + * Check whether the multiplicity of the ports (of a part) are consistent with the defined connectors, in particular whether a + * port with a required interface is not connected with more connectors than its own multiplicity + * + * @author ansgar + * + * TODO: does not find violation on composite side (partWithPort = null), simplify? (loop over connectors) + */ +public class ConnectorCallMultiplicity extends AbstractModelConstraint +{ + @Override + public IStatus validate(IValidationContext ctx) + { + String portsStr = ""; //$NON-NLS-1$ + + Property part = (Property) ctx.getTarget(); + if (!StereotypeUtil.isApplicable(part, DerivedElement.class)) { + // make rule Qompass specific: only perform check, if the FCM profile is applied (checked via applicability + // the DerviedElement stereotype) + return ctx.createSuccessStatus(); + } + Class owner = part.getClass_(); + if (owner != null) { + if (part.getType() instanceof Class) { + Class class_ = (Class) part.getType(); + for (Port port : class_.getOwnedPorts()) { + if (port.getRequireds().size() > 0) { + int connections = 0; + for (Connector connector : owner.getOwnedConnectors()) { + if (ConnectorUtil.connectsPort(connector, port)) { + connections++; + break; + } + } + if (connections > port.getUpper()) { + if (portsStr.length() != 0) { + portsStr += ", "; //$NON-NLS-1$ + } + portsStr += port.getName(); + } + } + } + } + } + if (portsStr.length() > 0) { + return ctx.createFailureStatus(String.format( + "The port(s) %s with a required interface of part %s have more connections than their multiplicty within composite %s", + portsStr, part.getName(), owner.getQualifiedName())); + + } + else { + return ctx.createSuccessStatus(); + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorConnectable.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorConnectable.java new file mode 100644 index 00000000000..922347bee07 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ConnectorConnectable.java @@ -0,0 +1,56 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.papyrus.FCM.InteractionComponent; +import org.eclipse.papyrus.qompass.designer.core.templates.ConnectorBinding; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Check whether a connector is connectable, i.e. whether the ports of application parts match with those + * of the connector types that are chosen. + * + * @author ansgar + * + */ +public class ConnectorConnectable extends AbstractModelConstraint +{ + + @Override + public IStatus validate(IValidationContext ctx) + { + Connector connector = (Connector) ctx.getTarget(); + Class class_ = (Class) connector.getOwner(); + + org.eclipse.papyrus.FCM.Connector fcmConnector = UMLUtil.getStereotypeApplication(connector, org.eclipse.papyrus.FCM.Connector.class); + if (fcmConnector != null) { + InteractionComponent connectorComp = fcmConnector.getIc(); + if (connectorComp != null) { + try { + ConnectorBinding.obtainBinding(class_, connector, connectorComp.getBase_Class(), false); + } catch (TransformationException e) { + return ctx.createFailureStatus("The connector '" + connector.getName() + "' within composite '" + class_.getName() + "' cannot be instantiated: " + e.getMessage()); + } + } + } + return ctx.createSuccessStatus(); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/DuplicateOperation.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/DuplicateOperation.java new file mode 100644 index 00000000000..5989e9ce81f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/DuplicateOperation.java @@ -0,0 +1,27 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +/** + * Check whether two operations have the same name *and* have indistinguishable parameter lists + * + * While UML demands that all members of a name-space have a unique name, this is more strict than + * the requirements of programming languages. Many OO languages allow for identical operation names + * if the operation can be uniquely identified via the type and number of parameters. + * + */ +public class DuplicateOperation { + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ExecutorIsNotUsedAsPartName.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ExecutorIsNotUsedAsPartName.java new file mode 100644 index 00000000000..a9fe37c6179 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/ExecutorIsNotUsedAsPartName.java @@ -0,0 +1,48 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.papyrus.FCM.RuleApplication; +import org.eclipse.papyrus.qompass.designer.core.transformations.container.ContainerTrafo; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Property; + +/** + * Check whether an attribute used the name that is reserved for executors within a container + * + * + */ +public class ExecutorIsNotUsedAsPartName extends AbstractModelConstraint +{ + @Override + public IStatus validate(IValidationContext ctx) { + + Class class_ = (Class) ctx.getTarget(); + + if (StereotypeUtil.isApplied(class_, RuleApplication.class)) { + // limit check to classes applying a container rule. + for (Property attribute : class_.getOwnedAttributes()) { + if (attribute.getName().equals(ContainerTrafo.executorPartName)) { + return ctx.createFailureStatus("A property may not use the reserved name \"_executor\""); + } + } + } + return ctx.createSuccessStatus(); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InitialEntryPoints.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InitialEntryPoints.java new file mode 100644 index 00000000000..ab3bca9e717 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InitialEntryPoints.java @@ -0,0 +1,79 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.qompass.designer.core.deployment.BootLoaderGen; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Verify that at exactly one blocking start routine is defined. + * + * @author ansgar + * + */ +public class InitialEntryPoints extends AbstractModelConstraint { + + @Override + public IStatus validate(IValidationContext ctx) + { + Package pkg = (Package) ctx.getTarget(); + + DeploymentPlan cdp = UMLUtil.getStereotypeApplication(pkg, DeploymentPlan.class); + if (cdp != null) { + InstanceSpecification initIS = cdp.getMainInstance(); + if (initIS != null) { + entryPoints = new BasicEList(); + validate(initIS); + if (entryPoints.size() > 1) { + String msg = ""; //$NON-NLS-1$ + for (String entryPoint : entryPoints) { + if (msg.length() > 0) { + msg += ", "; //$NON-NLS-1$ + } + msg += entryPoint; + } + return ctx.createFailureStatus(String.format("The deployment plan '%s' contains more than one start entry point: %s", pkg.getName(), msg)); //$NON-NLS-1$ + } + } + } + return ctx.createSuccessStatus(); + } + + public void validate(InstanceSpecification is) { + Classifier cl = DepUtils.getClassifier(is); + if (cl instanceof Class) { + Class implementation = (Class) cl; + if (BootLoaderGen.hasUnconnectedStartRoutine(null, implementation, null)) { + entryPoints.add(implementation.getName()); + } + } + for (InstanceSpecification subIS : DepUtils.getContainedInstances(is)) { + validate(subIS); + } + } + + private EList entryPoints; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InstanceSpecificationSlotForAllProperties.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InstanceSpecificationSlotForAllProperties.java new file mode 100644 index 00000000000..a3552545253 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/InstanceSpecificationSlotForAllProperties.java @@ -0,0 +1,63 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.papyrus.FCM.ConfigurationProperty; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Property; +import org.eclipse.uml2.uml.Slot; + +/** + * check whether an instance specification for a classifier defines slots for + * each configuration attribute. This rule is specific to Qompass, since only + * attributes with the ConfigurationProperty stereotypes are checked. + */ +public class InstanceSpecificationSlotForAllProperties extends AbstractModelConstraint { + + @Override + public IStatus validate(IValidationContext ctx) + { + InstanceSpecification is = (InstanceSpecification) ctx.getTarget(); + + if (is.getClassifiers().size() > 0) { + Classifier cl = is.getClassifiers().get(0); + if (cl instanceof Class) { + Class class_ = (Class) cl; + + for (Property attribute : class_.getOwnedAttributes()) { + boolean foundAttribute = false; + if (StereotypeUtil.isApplied(attribute, ConfigurationProperty.class)) { + for (Slot slot : is.getSlots()) { + if (slot.getDefiningFeature() == attribute) { + foundAttribute = true; + break; + } + } + if (foundAttribute == false) { + return ctx.createFailureStatus("The instance specification '" + is.getName() + "' has no slot for property '" + attribute.getName() + "'"); + } + } + } + } + } + return ctx.createSuccessStatus(); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsAreImplemented.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsAreImplemented.java new file mode 100644 index 00000000000..5c14d09c256 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsAreImplemented.java @@ -0,0 +1,47 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Operation; + +/** + * Check whether a non abstract operation has an implementation. + * Whereas this rule would make sense in general, it has been made specific to + * Qompass by verifying whether FCM is applied (check if DerivedElement stereotype + * is applicable) + */ +public class OperationsAreImplemented extends AbstractModelConstraint +{ + @Override + public IStatus validate(IValidationContext ctx) { + + Operation operation = (Operation) ctx.getTarget(); + if (operation.getNamespace() instanceof Interface) { + // operations within an interface are always abstract + return ctx.createSuccessStatus(); + } + if ((!operation.isAbstract() && operation.getMethods().size() == 0) && StereotypeUtil.isApplicable(operation, DerivedElement.class)) { + return ctx.createFailureStatus("The operation '" + operation.getName() + + " has no implementation (and is not marked as abstract)"); + } + return ctx.createSuccessStatus(); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsWithTwoReturnValues.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsWithTwoReturnValues.java new file mode 100644 index 00000000000..a08f010803c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/OperationsWithTwoReturnValues.java @@ -0,0 +1,57 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.ParameterDirectionKind; + +/** + * Verify that an operation has at most one return parameter + * + * Whereas this rule would make sense in general, it has been made specific to + * Qompass by verifying whether FCM is applied (check if DerivedElement stereotype + * is applicable) + */ +public class OperationsWithTwoReturnValues extends AbstractModelConstraint +{ + @Override + public IStatus validate(IValidationContext ctx) + { + Operation operation = (Operation) ctx.getTarget(); + boolean firstReturn = true; + for (Parameter parameter : operation.getOwnedParameters()) { + if (parameter.getDirection() == ParameterDirectionKind.RETURN_LITERAL) { + if (firstReturn) { + firstReturn = false; + } + else { + if (StereotypeUtil.isApplicable(operation, DerivedElement.class)) { + return ctx.createFailureStatus("The operation '" + operation.getName() + "' has more than one return parameter. It must have at most one"); + } + else { + break; + } + } + } + } + return ctx.createSuccessStatus(); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortIsCorrectlyTyped.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortIsCorrectlyTyped.java new file mode 100644 index 00000000000..345678cc7df --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortIsCorrectlyTyped.java @@ -0,0 +1,45 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Port; + +/** + * Check whether the port is not correctly typed, e.g. the port kind ProvideInterface is used in + * conjunction with a data type. + * Technically, the criterion will be that not both, derived provided and derived required interfaces + * are empty. + * + */ +public class PortIsCorrectlyTyped extends AbstractModelConstraint { + + @Override + public IStatus validate(IValidationContext ctx) + { + Port port = (Port) ctx.getTarget(); + + if ((port.getProvideds().size() == 0) && (port.getRequireds().size() == 0)) { + Class class_ = port.getClass_(); + return ctx.createFailureStatus("The port '" + port.getName() + "' owned by class '" + class_.getQualifiedName() + //$NON-NLS-1$ //$NON-NLS-2$ + "' is not correctly typed, since derived provided and required interface is null"); //$NON-NLS-1$ + } + return ctx.createSuccessStatus(); + + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortKindUnset.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortKindUnset.java new file mode 100644 index 00000000000..3aefcba3cd7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/PortKindUnset.java @@ -0,0 +1,43 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Check whether the attribute port-kind of the FCM stereotype port is set + * + */ +public class PortKindUnset extends AbstractModelConstraint { + + @Override + public IStatus validate(IValidationContext ctx) + { + Port port = (Port) ctx.getTarget(); + org.eclipse.papyrus.FCM.Port fcmPort = UMLUtil.getStereotypeApplication(port, org.eclipse.papyrus.FCM.Port.class); + if (fcmPort != null) { + + if (fcmPort.getKind() == null) { + return ctx.createFailureStatus("The stereotype attribute 'portKind' of port '" + port.getName() + "' is unset"); + } + } + return ctx.createSuccessStatus(); + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/SystemHasNoPorts.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/SystemHasNoPorts.java new file mode 100644 index 00000000000..dd2bcc2a892 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/SystemHasNoPorts.java @@ -0,0 +1,51 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.papyrus.FCM.DeploymentPlan; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepUtils; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Check whether the specific system class. This class can be identified, since it is the + * classifier of the "main-instance" referenced by a deployment plan. + * + */ +public class SystemHasNoPorts extends AbstractModelConstraint { + + @Override + public IStatus validate(IValidationContext ctx) + { + Package pkg = (Package) ctx.getTarget(); + + DeploymentPlan cdp = UMLUtil.getStereotypeApplication(pkg, DeploymentPlan.class); + + if (cdp != null) { + InstanceSpecification mi = cdp.getMainInstance(); + Class class_ = (Class) DepUtils.getClassifier(mi); + + if (class_.getOwnedPorts().size() > 0) { + return ctx.createFailureStatus("The main instance (class '" + class_.getName() + "') of deployment plan '" + pkg.getName() + "' owns ports. It should not, since these ports remain unconnected."); + } + } + return ctx.createSuccessStatus(); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/TemplateRefWithoutBinding.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/TemplateRefWithoutBinding.java new file mode 100644 index 00000000000..77fd10d61e6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/TemplateRefWithoutBinding.java @@ -0,0 +1,81 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.papyrus.FCM.DerivedElement; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.TypedElement; + +/** + * Check whether an element within a package template is referenced via a type from the outside, i.e. an element that is not + * within this package template. This reference is only valid in the context of a template binding. + * (within Qompass, binding is done implicitly via stereotypes - which was perhaps not the best way of doing it) + * + * The rule has been made specific to Qompass by checking whether FCM is applied (check DerivedElement stereotype). + * + */ +public class TemplateRefWithoutBinding extends AbstractModelConstraint { + + @Override + public IStatus validate(IValidationContext ctx) + { + TypedElement te = (TypedElement) ctx.getTarget(); + Type type = te.getType(); + if (type != null) { + Element owner = type.getNearestPackage(); + while (owner != null) { + if (owner instanceof Package) { + Package pkg = (Package) owner; + if (TemplateUtils.getSignatureDirect(pkg) != null) { + if (StereotypeUtil.isApplicable(pkg, DerivedElement.class) && !isWithin(pkg, te)) { + // the type of an element is defined within a package template (pkg), but the typed element (te) itself + // is defined outside of this package + return ctx.createFailureStatus("This element is typed with '" + type.getQualifiedName() + "', but defined outside the package template '" + //$NON-NLS-1$ //$NON-NLS-2$ + pkg.getQualifiedName() + "'"); //$NON-NLS-1$ + } + } + } + owner = owner.getOwner(); + } + } + + return ctx.createSuccessStatus(); + } + + /** + * @param pkg + * A UML package + * @param e + * an element that is eventually part of the package + * @return if passed element is part of the given package + */ + public boolean isWithin(Package pkg, Element e) { + Element owner = e; + while (owner != null) { + owner = owner.getOwner(); + if (owner == pkg) { + return true; + } + } + return false; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedPorts.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedPorts.java new file mode 100644 index 00000000000..34a4672aa66 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedPorts.java @@ -0,0 +1,95 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.AbstractModelConstraint; +import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.papyrus.uml.tools.utils.ConnectorUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Connector; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; + +/** + * Check whether a port of a part remains without connection. Whereas it is typically problematic + * for ports with a required interface, we also raise an info for those with a provided interface + * + */ +abstract public class UnconnectedPorts extends AbstractModelConstraint +{ + /** + * Called by one of the sub-classes (does not override a superclass method) + * + * @param ctx + * the validation context + * @param required + * if true, examine required ports, if false provided ports + * @return + */ + public IStatus validatePorts(IValidationContext ctx, boolean required) + { + String portsStr = ""; //$NON-NLS-1$ + + Property attribute = (Property) ctx.getTarget(); + Class owner = attribute.getClass_(); + if (owner != null) { + if (attribute.getType() instanceof Class) { + Class class_ = (Class) attribute.getType(); + for (Port port : class_.getOwnedPorts()) { + if ((port.getRequireds().size() > 0 && required) || + (port.getProvideds().size() > 0 && !required)) { + { + boolean found = false; + for (Connector connector : owner.getOwnedConnectors()) { + if (ConnectorUtil.connectsPort(connector, port)) { + found = true; + break; + } + } + if (!found) { + if (portsStr.length() != 0) { + portsStr += ", "; //$NON-NLS-1$ + } + portsStr += port.getName(); + } + } + } + } + } + } + if (portsStr.length() > 0) { + return ctx.createFailureStatus("The port(s) '" + portsStr + "' of part '" + attribute.getName() + "' remains unconnected within composite class '" + owner.getQualifiedName() + "'"); + + } + else { + return ctx.createSuccessStatus(); + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedProvPorts.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedProvPorts.java new file mode 100644 index 00000000000..81bf5bc64b6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedProvPorts.java @@ -0,0 +1,27 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.IValidationContext; + + +public class UnconnectedProvPorts extends UnconnectedPorts { + + @Override + public IStatus validate(IValidationContext ctx) { + return super.validatePorts(ctx, false); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedReqPorts.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedReqPorts.java new file mode 100644 index 00000000000..d24a9f3f9f2 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation/src/org/eclipse/papyrus/qompass/designer/validation/constraints/UnconnectedReqPorts.java @@ -0,0 +1,27 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.designer.validation.constraints; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.validation.IValidationContext; + + +public class UnconnectedReqPorts extends UnconnectedPorts { + + @Override + public IStatus validate(IValidationContext ctx) { + return super.validatePorts(ctx, true); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/.classpath b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/.classpath new file mode 100644 index 00000000000..098194ca4b7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/.project b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/.project new file mode 100644 index 00000000000..65bf34f1f4e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/.project @@ -0,0 +1,35 @@ + + + org.eclipse.papyrus.qompass.designer.vsl + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.acceleo.ide.ui.acceleoBuilder + + + + + + org.eclipse.acceleo.ide.ui.acceleoNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f42de363afa --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/META-INF/MANIFEST.MF b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..7f958871f83 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Export-Package: org.eclipse.papyrus.qompass.designer.vsl +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.papyrus.marte.vsl;bundle-version="1.2.0", + org.eclipse.xtext;bundle-version="2.4.0", + org.eclipse.papyrus.marte.static.profile;bundle-version="1.2.0" +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.qompass.designer.vsl.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.qompass.designer.vsl +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/about.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

      About This Content

      + +

      November 14, 2008

      +

      License

      + +

      The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

      + +

      If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

      + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/build.acceleo b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/build.acceleo new file mode 100644 index 00000000000..fb14dcfe540 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/build.acceleo @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/build.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/build.properties new file mode 100644 index 00000000000..2db90a70738 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/build.properties @@ -0,0 +1,10 @@ +# +#Sun Dec 02 23:00:20 CET 2012 +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties +output..=bin/ +source..=src/ +customBuildCallbacks=build.acceleo +src.includes = about.html diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/plugin.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/plugin.properties new file mode 100644 index 00000000000..e8db6a299e0 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus extra: Qompass designer VSL support (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/pom.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/pom.xml new file mode 100644 index 00000000000..2ca86b4cb50 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../releng/extra + + org.eclipse.papyrus.qompass.designer.vsl + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Activator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Activator.java new file mode 100644 index 00000000000..d69dc572821 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Activator.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.qompass.designer.vsl; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.designer.vsl"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Messages.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Messages.java new file mode 100644 index 00000000000..548e47b0be1 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/Messages.java @@ -0,0 +1,17 @@ +package org.eclipse.papyrus.qompass.designer.vsl; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.qompass.designer.vsl.messages"; //$NON-NLS-1$ + public static String ParseVSL_ErrorInExp_SIZE; + public static String ParseVSL_ErrorInExp_TIME; + public static String ParseVSL_ErrotInExp_FREQ; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.emtl b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.emtl new file mode 100644 index 00000000000..7e3a06641ae --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.emtl @@ -0,0 +1,432 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + +
      +
      +
      + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.java new file mode 100644 index 00000000000..a4e1c54e504 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.java @@ -0,0 +1,185 @@ +package org.eclipse.papyrus.qompass.designer.vsl; + +import java.util.Collections; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.papyrus.MARTE.utils.MarteUtils; +import org.eclipse.papyrus.MARTE_Library.MeasurementUnits.DataSizeUnitKind; +import org.eclipse.papyrus.MARTE_Library.MeasurementUnits.FrequencyUnitKind; +import org.eclipse.papyrus.MARTE_Library.MeasurementUnits.TimeUnitKind; +import org.eclipse.papyrus.marte.vsl.VSLStandaloneSetupGenerated; +import org.eclipse.xtext.IGrammarAccess; +import org.eclipse.xtext.resource.IResourceFactory; +import org.eclipse.xtext.resource.XtextResource; +import org.eclipse.xtext.util.StringInputStream; + +import com.google.inject.Injector; + + +public class ParseVSL { + + private static final String UNIT = "unit"; //$NON-NLS-1$ + + private static final String VALUE = "value"; //$NON-NLS-1$ + + private Injector injector; + + private static final String SYNTHETIC_SCHEME = "synthetic"; //$NON-NLS-1$ + + + /** + * Parse a VSL expression and return an xtext resource. Users should check for parsing + * errors (getErrors). The resulting set of eObjects is available via the getContents + * operations (as usual). + * + * @param expression + * a VSL expression + * @return a resource relating to the expression. + */ + public XtextResource getXtextResource(String expression) { + if (injector == null) { + VSLStandaloneSetupGenerated setup = new VSLStandaloneSetupGenerated(); + injector = setup.createInjectorAndDoEMFRegistration(); + } + ; + IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); + IGrammarAccess grammarAccess = injector.getInstance(IGrammarAccess.class); + + XtextResource xtextResource = (XtextResource) resourceFactory.createResource( + URI.createURI(SYNTHETIC_SCHEME + ":/" + grammarAccess.getGrammar().getName() + ".vsl")); //$NON-NLS-1$ //$NON-NLS-2$ + + try { + xtextResource.load(new StringInputStream(expression, xtextResource.getEncoding()), Collections.emptyMap()); + } catch (Exception e) { + throw new RuntimeException(e); + } + return xtextResource; + } + + /** + * test function (currently unused) + * + * @param expression + * a VSL expression + */ + public static void parseTest(String expression) { + /* + * ParseVSL parseVSL = new ParseVSL(); + * XtextResource xtextResource = parseVSL.getXtextResource(expression); + * if(xtextResource.getErrors().size() > 0) { + * for(Resource.Diagnostic error : xtextResource.getErrors()) { + * System.err.println(error); + * } + * return; + * } + * EList contents = xtextResource.getContents(); + * System.out.println("contents.size: " + contents.size()); + */ + } + + public static int getSizeFromVSL(String nfpDatasize) { + if (nfpDatasize != null) { + String unit = MarteUtils.getValueFromTuple(nfpDatasize, UNIT); + String value = MarteUtils.getValueFromTuple(nfpDatasize, VALUE); + return Float.valueOf(value).intValue() * getMultiplicatorFromSizeUnit(unit); + } + return 0; + } + + // >>> TODO: from here: ad-hoc functions to retrieve values via simple parser + + /** + * Get the duration in micro-seconds + * + * + * @param nfpDuration + * @return + */ + public static long getDurationFromVSL(String nfpDuration) { + if (nfpDuration != null) { + String unit = MarteUtils.getValueFromTuple(nfpDuration, UNIT); + String value = MarteUtils.getValueFromTuple(nfpDuration, VALUE); + return Float.valueOf(value).intValue() * getMultiplicatorFromTimeUnit(unit); + } + return 0; + } + + /** + * Get the frequency in HZ + * + * @param + * @return + */ + public static long getFrequencyFromVSL(String nfpFrequency) { + if (nfpFrequency != null) { + String unit = MarteUtils.getValueFromTuple(nfpFrequency, UNIT); + String value = MarteUtils.getValueFromTuple(nfpFrequency, VALUE); + return (int) (Float.valueOf(value) * getMultiplicatorFromFrequencyUnit(unit)); + } + return 0; + } + + public static long getPeriodFromArrivalPattern(String arrivalPattern) { + if (arrivalPattern != null) { + String period = MarteUtils.getValueFromTuple(arrivalPattern, "period"); //$NON-NLS-1$ + return getDurationFromVSL(period); + } + return 0; + } + + public static int getMultiplicatorFromSizeUnit(String unit) { + DataSizeUnitKind dsuk = DataSizeUnitKind.get(unit); + if (dsuk == DataSizeUnitKind.BYTE) { + return 1; + } else if (dsuk == DataSizeUnitKind.KB) { + return 1024; + } else if (dsuk == DataSizeUnitKind.MB) { + return 1024 * 1024; + } else if (dsuk == DataSizeUnitKind.GB) { + return 1024 * 1024 * 1024; + } else { + // do not support bits here. + throw new RuntimeException(String.format(Messages.ParseVSL_ErrorInExp_SIZE, unit)); + } + } + + /** + * return the time multiplicator based on micro-seconds unit + * + * @param unit + * @return + */ + public static long getMultiplicatorFromTimeUnit(String unit) { + TimeUnitKind tuk = TimeUnitKind.get(unit); + if (tuk == TimeUnitKind.US) { + return 1; + } + if (tuk == TimeUnitKind.MS) { + return 1000; + } else if (tuk == TimeUnitKind.S) { + return 1000 * 1000; + } else if (tuk == TimeUnitKind.MIN) { + return 60 * 1000 * 1000; + } else { + throw new RuntimeException(String.format(Messages.ParseVSL_ErrorInExp_TIME, unit)); + } + } + + public static float getMultiplicatorFromFrequencyUnit(String unit) { + FrequencyUnitKind fuk = FrequencyUnitKind.get(unit); + if (fuk == FrequencyUnitKind.HZ) { + return 1; + } else if (fuk == FrequencyUnitKind.KHZ) { + return 1000; + } else if (fuk == FrequencyUnitKind.MHZ) { + return 1000 * 1000; + } else if (fuk == FrequencyUnitKind.GHZ) { + return 1000 * 1000 * 1000; + } else if (fuk == FrequencyUnitKind.RPM) { + return 1 / 60; + } else { + // do not support bits here. + throw new RuntimeException(String.format(Messages.ParseVSL_ErrotInExp_FREQ, unit)); + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.mtl b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.mtl new file mode 100644 index 00000000000..9713fa32611 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/ParseVSL.mtl @@ -0,0 +1,23 @@ +[module ParseVSL('http://www.eclipse.org/uml2/5.0.0/UML')/] + +[comment Copyright (c) 2012 CEA List./] + +[query public getSizeFromVSL(nfpDatasize : String) : Integer = + invoke('org.eclipse.papyrus.qompass.designer.vsl.ParseVSL', + 'getSizeFromVSL(java.lang.String)', + Sequence{nfpDatasize}) /] + +[query public getDurationFromVSL(nfpDuration : String) : Integer = + invoke('org.eclipse.papyrus.qompass.designer.vsl.ParseVSL', + 'getDurationFromVSL(java.lang.String)', + Sequence{nfpDuration}) /] + +[query public implementsInterface2(operation : Operation) : Interface = + invoke('org.eclipse.papyrus.qompass.designer.core.acceleo.UMLTool', + 'implementsInterface(org.eclipse.uml2.uml.Operation)', + Sequence{operation}) /] + +[query public implementsInterface3(str : String) : Interface = + invoke('org.eclipse.papyrus.qompass.designer.core.acceleo.UMLTool', + 'implementsInterface(org.eclipse.uml2.uml.Operation)', + Sequence{str}) /] diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/messages.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/messages.properties new file mode 100644 index 00000000000..115d3394041 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl/src/org/eclipse/papyrus/qompass/designer/vsl/messages.properties @@ -0,0 +1,3 @@ +ParseVSL_ErrorInExp_SIZE=Error parsing VSL expression, unexpected size unit (expecting byte, kb, mb, or gb): '%s' +ParseVSL_ErrorInExp_TIME=Error parsing VSL expression, unexpected duration unit (expecting us, ms, s or min): '%s' +ParseVSL_ErrotInExp_FREQ=Error parsing VSL expression, unexpected frequency unit (expecting Hz, KHz, MHz, GHz or rpm: '%s' diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.classpath b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.classpath new file mode 100644 index 00000000000..358df1bc1d1 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.gitignore b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.gitignore new file mode 100644 index 00000000000..5500bf75774 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.gitignore @@ -0,0 +1 @@ +tmpModel diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.project b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.project new file mode 100644 index 00000000000..748b00bc5a7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.project @@ -0,0 +1,40 @@ + + + org.eclipse.papyrus.qompass.modellibs.core + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.acceleo.ide.ui.acceleoBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.acceleo.ide.ui.acceleoNature + org.eclipse.jdt.core.javanature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c537b63063c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/ExtendedPort.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/ExtendedPort.java new file mode 100644 index 00000000000..7227b1bdcc7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/ExtendedPort.java @@ -0,0 +1,127 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; + +import org.eclipse.papyrus.FCM.util.IMappingRule; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.papyrus.qompass.designer.core.OperationUtils; +import org.eclipse.papyrus.qompass.designer.core.PortUtils; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Type; + + +/** + * An extended Port in the sense of the DDS4CCM standard: a port typed with a component + * type. Since the component typing the port can have multiple provided and required + * ports, the ports are implicitly owned by the port. Conjugation on the level of an extended + * port level will conjugate all ports of the component typing the port. + * + * The derived interface that is provided will concatenate provided port names within the + * extended port with the port name and provided a "big" interface. + * The derived interface that is required is identical, except for a conjugation on the + * extended port level. + * + * Creates a fixed template binding that binds T (of the extended Port) to the used data type + * + * Here, the idea is that the port type is a classifier, e.g. the data type that is + * transported by a DDS port. The port kind is the extended port, e.g. DDSWrite. + * + * The derived property isExtended of FCM port-kind is true, if the class representing the port-kind owns at least one + * port + * + * @author ansgar + * + */ +public class ExtendedPort implements IMappingRule { + + public Interface getProvided(org.eclipse.papyrus.FCM.Port p, InstanceSpecification config, boolean update) + { + return getDerived(p, false, config, update); + } + + public Interface getRequired(org.eclipse.papyrus.FCM.Port p, InstanceSpecification config, boolean update) + { + return getDerived(p, true, config, update); + } + + public Interface getDerived(org.eclipse.papyrus.FCM.Port extPort, boolean isRequired, InstanceSpecification config, boolean update) + { + Type type = extPort.getBase_Port().getType(); + if(!(type instanceof Classifier)) { + return null; + } + Class extendedPort = extPort.getKind().getBase_Class(); + + String prefix = extendedPort.getName() + "_" + (isRequired ? "R_" : "P_"); + Interface derivedInterface = MapUtil.getOrCreateDerivedInterfaceFP(extPort, prefix, type, update); + if (!update) { + return derivedInterface; + } + if(derivedInterface == null) { + return null; + } + /* + TemplateSignature signature = TemplateUtils.getSignature(type.getNearestPackage()); + if(signature != null) { + Package model = Utils.getTop(derivedInterface); + try { + TemplateBinding binding = + TemplateUtils.fixedBinding(model, extendedPort, (Classifier)type); + Copy copy = new Copy(model, model, false); + TemplateInstantiation ti = new TemplateInstantiation(copy, binding); + // create a bound element of the extended port. Add bound class to derived interface class + Class boundClass = ti.bindNamedElement(extendedPort); + derivedInterface.getNearestPackage().getPackagedElements().add(boundClass); + } catch (TransformationException e) { + return null; + } + } + */ + // obtain first template parameter = port type + // kind.getBase_Class().getNearestPackage().getTemplateParameter(); + + for(Port port : extendedPort.getOwnedPorts()) { + Interface derivedIntf = (isRequired) ? + PortUtils.getRequired(port) : + PortUtils.getProvided(port); + + if(derivedIntf != null) { + for(Operation op : derivedIntf.getAllOperations()) { + String name = port.getName() + "_" + op.getName(); //$NON-NLS-1$ + + // check whether operation already exists. Create, if not + Operation derivedOperation = derivedInterface.getOperation(name, null, null); + if(derivedOperation == null) { + derivedOperation = derivedInterface.createOwnedOperation(name, null, null); + OperationUtils.syncOperation(op, derivedOperation); + derivedOperation.setName(name); + } + else { + if (!OperationUtils.isSameOperation(derivedOperation, op, false)) { + OperationUtils.syncOperation(op, derivedOperation); + derivedOperation.setName(name); + } + } + } + } + } + return derivedInterface; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/META-INF/MANIFEST.MF b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..40d9df64cb6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/META-INF/MANIFEST.MF @@ -0,0 +1,28 @@ +Manifest-Version: 1.0 +Export-Package: org.eclipse.papyrus.qompass.modellibs.core, + org.eclipse.papyrus.qompass.modellibs.core.xtend +Require-Bundle: org.eclipse.ui, + org.eclipse.ui.ide;bundle-version="3.8.0", + org.eclipse.core.runtime, + org.eclipse.papyrus.fcm.profile;bundle-version="1.2.0", + org.eclipse.papyrus.qompass.designer.core;bundle-version="1.2.0", + org.eclipse.papyrus.qompass.designer.vsl;bundle-version="1.2.0", + org.eclipse.uml2.uml;bundle-version="4.0.0", + org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", + org.eclipse.core.resources, + org.eclipse.papyrus.cpp.profile;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.wizards;bundle-version="1.2.0", + com.google.guava;bundle-version="11.0.0", + org.eclipse.xtext.xbase.lib, + org.eclipse.xtend.lib, + org.eclipse.xtend.lib.macro +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.qompass.modellibs.core.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.qompass.modellibs.core;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/about.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

      About This Content

      + +

      November 14, 2008

      +

      License

      + +

      The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

      + +

      If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

      + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/build.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/build.properties new file mode 100644 index 00000000000..4454371265c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/build.properties @@ -0,0 +1,17 @@ +# +#Thu Jun 28 15:46:18 CEST 2012 +bin.includes = META-INF/,\ + .,\ + models/,\ + plugin.xml,\ + .classpath,\ + .project,\ + html/,\ + help/,\ + about.html,\ + plugin.properties +output..=bin/ +src.includes = models/,\ + about.html +source.. = src/,\ + xtend-gen/ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-examples.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-examples.xml new file mode 100644 index 00000000000..8e2820fd43f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-examples.xml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-library.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-library.xml new file mode 100644 index 00000000000..78e5563a605 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/help/modellibs-core-library.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/hello-world.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/hello-world.html new file mode 100644 index 00000000000..a8aacf1106c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/hello-world.html @@ -0,0 +1,174 @@ + + + + + Hello world example with Qompass + + + + +

      Hello world example with Qompass

      + +In the sequel, we outline a simple hello world example using qompass designer. Please note that the example +can be found via File->New->Example in the category Qompass examples. There are also two cheat-sheets that explain how +to create your own example from scratch. +

      + +As for all Qompass examples, there are three different parts that needs to be modeled +

        +
      1. The software components +
      2. An abstraction of the hardware platform +
      3. A so-called deployment plan, i.e. a set of component instance definitions along with their configuration and + allocation of software components to hardware nodes +
      + +In the sequel, we will go through all of these items with a focus on the the definition of the software components. + +

      Definition of software components

      + +The example consists of two components, detailed below + +

      The hello-world component

      + +The hello-world component is shown in the following screen shot. + +
      +The Hello World component +
      +
      +The hello world component inherits from a component called CStart. This is an abstract component defined in the +Qompass core model library. It owns a port (called start) that provides the pre-defined interface IStart. This +interface has a single operation run. Components that provide an interface via a port need to implement this +interface. This include ports that are inherited. In our case, the hello world component needs to implement the IStart +interface, i.e. contain an operation "run" as well as a behavior for this operation.
      +Qompass supports the user by automatically creating derived operations for interfaceS provided via a port, i.e. the operation +signature is copied (and synchronized on demand) from the interface. The developer needs to provide behavior. In UML, behavior +can be specified either via activities or by embedding code in a programming language (opaque behavior) into the model. +Currently, Qompass focuses on the latter,in particular in form of embedded C++ code. A simple C/C++ view allows to enter +the code, as shown in the following screenshot (there is ongoing work concerning a CDT editor integration) + +

      +

      +C/C++ view +
      +

      + +The code outputs "Hello World" and an additional message that is an attribute of the hello world component. The attribute message +is declared as a UML String, but it does not have a particular contents on the level of the component definition. We will +see in the section explaining deployment plans how this contents can be defined. +

      +The specific start port enables a component to get the initial control. Its run operation is called at system +start-up by a generated boot-loader. + +

      A system component

      + +All Qompass applications need to define a top-level component, typically called System that aggregates its components, +in our case the hello-world component. It is defined by means of a composite class, contained components are +modeled via attributes (use composite aggregation for these) typed by the contained components. Note that we define a role (or part) +within a composition, the hello world component declaration is not part of the system class. This role corresponds to an +instance of a class in the deployment plan below.
      +In our simple hello world example, there is a single component only. Thus, there are no connections between components (so called assembly). take a look at the +producer-consumer example to see how the assembly can be done. +

      +

      +The System component +
      + + +

      Definition of an abstract hardware platform

      + +In parallel to the software component, the hardware platform or merely an abstraction thereof can be defined. The main objective +of this step is to define computational nodes on which the software can be allocated. A node isa stereotyped class that defines +for the moment only quite basic information about a computational node, such as the provided memory and operating system. + +

      + +The following screenshot defines a platform for the Hello World component. The HWArchitecture class has a similar +function for the platform as the System class has for the software: it represents the used notes and their interconnections. +In this simple example, the hardware architecture contains a single node.
      +

      +A platform for the Hello World component +
      + +

      Definition of a deployment plan

      + +A deployment plan is a collection of instance specifications, stored within a UML package. It has two objectives. The first is +to configure an instance of a component, i.e. to provide values for configuration attributes. The second is to allocate +instance to processing resources such as threads or directly to a node of the platform definition. + +In case of the hello world component, the message that should be written is a configuration attribute. Qompass provides a +dialog that simplifies the configuration of this attribute. The dialog lists instances and their configuration attributes and +enables the user to provide a value in a text field. On the model level, a corresponding slot and a value specification are +produced.
      + +
      +configure instance dialog +
      + +The allocation is also simplified by means of a custom dialog. The instances of a system are shown by means of a tree structure +and the user can either allocate leafs or a parent node. In our case, the whole system should be allocated to node "monoNode", as +shown in the screenshot below. On the model level, allocation is a MARTE relationship.
      +
      +allocation dialog +
      + +The last screenshot shows the resulting deployment plan, the package containing two instance specifications and the slots along +with the configured values. You also see the allocation of the system component. Note, that the visualization of all instances +in a diagram is often not useful for larger applications, since the graphical visualization does not provide additional +information compared to the tree structure depicted by the dedicated dialog.
      + +
      +resulting deployment plan +
      + +The last step is the code generation which can be executed via the context menu of a deployment plan. The code generation creates an CDT project +which can be compiled and executed. + +

      Compilation, Execution and Debugging

      + +

      For Windows users

      + +If you are using Windows and it is the first time you are running C++ project using Eclipse CDT, +you can face some problems during compilation, execution and debugging of the generated code. + +First of all, be sure that you have defined the environment variable for your C++ compiler. To do so, open a command line window (cmd.exe) and type "gdb". +You should see an output like below. + +
      +command line without error +
      + +If you do not see this output and see the error below, + +
      +command line with error +
      + + +go to "My Computer -> Properties -> Advanced System Parameters". Edit the variable named "PATH" and add the following to the end of its value ";C:\MinGW\bin\" +

      +Moreover, another problem you can face can be having no console output after a successful run of the code. In this case, +

      +Right-click on your project. Select "Properties". +

      +Select the "Run/Debug Settings" Property on the left of the new window. +

      +In the right window, click on your executable to highlight (ie - Test.exe) and click "Edit". +

      +In the Environment tab, hit "New" +

      +Name: PATH +
      +Value: Path to your MinGW bin directory (For example: C:\MinGW\bin) +

      +Click "OK" on all windows to close down. +

      +Try running again, it should print output to the screen. +

      +See this link! + + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/producer-consumer.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/producer-consumer.html new file mode 100644 index 00000000000..c7a619f5516 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/producer-consumer.html @@ -0,0 +1,125 @@ + + + + + Producer-consumer example with Qompass + + + + +

      A simple producer-consumer example

      + +In the sequel, we outline a simple producer consumer example using Qompass designer. Please note that the example +can be found via File->New->Example in the category Qompass examples. It follows the same principles as the +Hello World example, i.e. a separation between components, platform and deployment plan. +

      + +

      Definition of software components

      + +The example consists of three components, a producer, a consumer and the enclosing system component. These components are outlined +in the sequel. + +

      The producer

      + +A data producer needs flow port of type "out" to communicate the data to other components. The following screenshot shows its +definition. + +
      +The push producer +
      + +The producer is the main active component in our system. Therefore, it inherits (as the hello world component) from +the CStart component within the Qompass "core" modeling library and gets an initial execution thread. This thread executes the +component's "run" method is shown below. It executes 20 periods with a length of 200ms (we use only the simple POSIX call usleep +instead of the OS abstraction library to ensure that this example runs on most machines). In each period, an instance of type +PubData is send to the port q. +

      +

      +cout << "publish a value via port q;" << endl;
      +ComponentModel::interfaces::PubData data;
      +data.x = 2;
      +data.y = 3;
      +for (int i = 0; i<20; i++) {
      +    q->push(data);
      +    cout << "." << flush;
      +    // wait 200ms
      +    usleep(200*1000);
      +}
      +
      + +

      The consumer

      + +There are (at least) two different variants to consume data. The first is to actively pull for new data, the second is being notified (pushed) +whenever new data arrives. Although both consumers have a flow-port of type in, the mapping towards provided and required +interfaces is quite different. Whereas the pull consumer calls a pull operation, the push consumer is called from the outside. +This also implies that the pull consumer has its own thread of control, which typically performs the poll with a certain period. + +The following screenshot shows the push variant of the consumer. Since the component is inactive, no additional thread is required. +Data consumption at an "push-in" flow ports corresponds to the implementation of an interface with a push method. This interface +is automatically calculated and a derived (calculated) attribute of the port stereotyped with the FCM profile. + +
      +The push consumer +
      +

      + +The next screenshot shows the pull variant of the consumer. This components inherits from the abstract LifeCycle component that +provides the lifecycle port. The interface associated with this port contains the two operations activate and deactivate. The +lifecycle operations are called after creation, but -- unlike the start call -- should return the control immediately (or after +a very short time).
      +Since we want that the consumer executes a periodic pull operation, we need to launch a new thread in the activation call and let +this thread execute the pull loop. One way to achieve this Qompass is to use a container service that intercepts the +activation call. This service is call runStartThread and is visible in the context menu of the class. + +

      +The pull consumer +
      +

      + +

      The system

      + +Since we use two different variants of a consumer, we need to have two different variants of the system component. +The first variant uses a push consumer. In this case, producer and consumer can be connected directly, since the producer +calls the push operation that is provided by the consumer. + +
      +The System component with a push consumer +
      + +The variant with a pull consumer is a bit more complicated. In this case, both producer and consumer call operations (push and +pull respectively) and we need a mediator between this. A suitable choice is the use of a FIFO queue. The producer pushes data +into the FIFO and the consumer polls for data "at the other end". Instead of explicitly introducing an additional part for the +queue in the system, Qompass supports annotating UML connectors. In this case, we add the information to the connector between +producer and consumer that a FIFO connector should be used. When the code for this system is generated, Qompass replaces the +connection by a reified connector, as shown in the +reference guide + +
      +The System component with a pull consumer +
      + + +

      Definition of an abstract hardware platform

      + +The hardware platform is the same monolithic platform as for the hello world example + +
      +The push consumer +
      + +

      Definition of a deployment plan

      + +There are two deployment plans corresponding to the two variants to consume data. The screenshots below shows both plans +without detailing the contained instance specifications.
      +In addition to the two plans, there are two Configurations that enable activation of container extension. For +instance, the tracing rules are only active in a trace configuration. A configuration refers to a set of configuration +options and a deployment plan, as shown in screenshots. + +
      +The push consumer +
      + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_with_error.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_with_error.png new file mode 100644 index 00000000000..b239ab329eb Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_with_error.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_without_error.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_without_error.png new file mode 100644 index 00000000000..a03d922c087 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/cmd_without_error.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/allocate.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/allocate.png new file mode 100644 index 00000000000..43f70204412 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/allocate.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/c-cpp-view.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/c-cpp-view.png new file mode 100644 index 00000000000..c4cc6730243 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/c-cpp-view.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/configure-instance.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/configure-instance.png new file mode 100644 index 00000000000..a77b9c3cbcf Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/configure-instance.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/deployment-plan.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/deployment-plan.png new file mode 100644 index 00000000000..969c3b0d62c Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/deployment-plan.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/hello-world.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/hello-world.png new file mode 100644 index 00000000000..78d176b6fa7 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/hello-world.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/platform.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/platform.png new file mode 100644 index 00000000000..93f8f332b2a Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/platform.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/system.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/system.png new file mode 100644 index 00000000000..10446c73b5c Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/hw/system.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/dep-plans.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/dep-plans.png new file mode 100644 index 00000000000..9d5c201fd60 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/dep-plans.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/generated-container.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/generated-container.png new file mode 100644 index 00000000000..4eb00727977 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/generated-container.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/pull-consumer.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/pull-consumer.png new file mode 100644 index 00000000000..950ad42d68c Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/pull-consumer.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-consumer.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-consumer.png new file mode 100644 index 00000000000..83065ace195 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-consumer.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-producer.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-producer.png new file mode 100644 index 00000000000..580db31e964 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/push-producer.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-pull.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-pull.png new file mode 100644 index 00000000000..08d5286e66a Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-pull.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-push.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-push.png new file mode 100644 index 00000000000..1c3ce96ad33 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/examples/screenshots/pc/system-push.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/corba.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/corba.html new file mode 100644 index 00000000000..266c64ef4d2 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/corba.html @@ -0,0 +1,16 @@ + + + + + CORBA basic types (model library) + + + + +

      A collection of CORBA base types

      + + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/core.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/core.html new file mode 100644 index 00000000000..038fd213f27 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/core.html @@ -0,0 +1,16 @@ + + + + + Core model library + + + + +

      A simple producer-consumer example

      + + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/osal.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/osal.html new file mode 100644 index 00000000000..038fd213f27 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/osal.html @@ -0,0 +1,16 @@ + + + + + Core model library + + + + +

      A simple producer-consumer example

      + + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/statemachine.html b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/statemachine.html new file mode 100644 index 00000000000..038fd213f27 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/html/library/statemachine.html @@ -0,0 +1,16 @@ + + + + + Core model library + + + + +

      A simple producer-consumer example

      + + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.di new file mode 100644 index 00000000000..bf9abab340f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.di @@ -0,0 +1,2 @@ + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.notation new file mode 100644 index 00000000000..f2f19151607 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.notation @@ -0,0 +1,1221 @@ + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.uml new file mode 100644 index 00000000000..55d57426110 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ClientServerTimer.uml @@ -0,0 +1,395 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + cout << "server: got add request for a=" << a << " and b=" << b << endl; +return a+b; + + + + + + + + + + + + + + + + + + C/C++ + cout << "server: got mult request for a=" << a << " and b=" << b << endl; +return a*b; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Additional "tick" port. The contained tick operation is called by the timer. See composite diagram of system for the assembly + + + + + + + + + + + + + + + + + + + C/C++ + cout << "call via port q: add(2, 3);" << endl; +cout << "result: " << q->add(2, 3) << endl; +cout << "now sleeping 10 seconds" << endl; +sleep(10); +cout << "finishing CClient_impl::run" << endl; + + + C/C++ + cout << "call via port tick: mult(4, 5);" << endl; +cout << "result: " << q->mult(4, 5) << endl; + + + + + + + + + + Period of timer can be configured via +"configure instance properties" popup (once timer attribute is selected) + + + Part of Qompasss modeling library + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Linux and cygwin require different deployment plans, since we use different target platforms + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.di new file mode 100644 index 00000000000..bf9abab340f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.di @@ -0,0 +1,2 @@ + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.notation new file mode 100644 index 00000000000..78d43a4a70a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.notation @@ -0,0 +1,968 @@ + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + multiplicity + name + type + derived + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + multiplicity + name + type + derived + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + +
      + + + + + + + name + type + derived + + + + + + name + type + derived + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + +
      +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + +
      +
      + + + +
      + + + + + + + + + + + name + type + derived + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.uml new file mode 100644 index 00000000000..d46ef6abf65 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorld.uml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + Simple HelloWorld component that prints a message in its "run" operation that is provided via the "start" port + + + + + Part of the Qompass core model library. Provides the specific port "start". The "run" operation (defined within interface IStart) of this port is called by generated boot-code after instantiation and configuration of a component. + + + + Configuration attribute within the Hello World component. Its value is configured on the instance level. + + + The operation "run" is defined in interface IRunnnable that is provided by the IStart port. The synchronisation mechanism in Qompass ("Sync. derived element", needs to be triggered by user) adds a corresponding "derived" operation to the class + + + + + + + + + + + + + + + + + + C/C++ + cout << "Hello world: " << message << endl; + + + + + + + + + + + + + + + + Simple single node configuration. TargetOS is set to Linux, but will work on any OS, since this simple example does not use the OS abstraction layer + + + + + + + + + + + + + + + + + + This configuration requires the installation of the OTF trace library.<br /> + + + Cross references to composite diagram + + + Deployment plan for system, i.e. set of instance specification along with configuration and allocation + + + + Value mainInstance.hello is a UML instance-value, i.e. a reference to the instance specification on the left. +"Test message" is a StringValue initializing the message attribute + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.di new file mode 100644 index 00000000000..c651eaf4315 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.di @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.notation new file mode 100644 index 00000000000..d8404d0904b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.notation @@ -0,0 +1,528 @@ + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.uml new file mode 100644 index 00000000000..a02dc7a2a5f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldC.uml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + Simple HelloWorld component that prints a message in its "run" operation that is provided via the "start" port + + + + + Part of the Qompass core model library. Provides the specific port "start". The "run" operation (defined within interface IStart) of this port is called by generated boot-code after instantiation and configuration of a component. + + + + Configuration attribute within the Hello World component. Its value is configured on the instance level. + + + + + + + + + + + + + + + + + + C/C++ + printf ("Hello world: %s", message); + + + + + + + + + + + + + + + + Simple single node configuration. TargetOS is set to Linux, but will work on any OS, since this simple example does not use the OS abstraction layer + + + + + + + + + + + + + + + + + + This configuration requires the installation of the OTF trace library.<br /> + + + Cross references to composite diagram + + + Deployment plan for system, i.e. set of instance specification along with configuration and allocation + + + + Value mainInstance.hello is a UML instance-value, i.e. a reference to the instance specification on the left. +"Test message" is a StringValue initializing the message attribute + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.di new file mode 100644 index 00000000000..670de7fb972 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.di @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.notation new file mode 100644 index 00000000000..83d0bb6c94c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.notation @@ -0,0 +1,574 @@ + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + multiplicity + name + type + derived + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + multiplicity + name + type + derived + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + +
      +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + +
      + + +
      + + +
      + + +
      +
      + + + +
      + + + + + + + + name + type + derived + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.uml new file mode 100644 index 00000000000..f0ce2f36f68 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/HelloWorldJava.uml @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + Simple HelloWorld component that prints a message in its "run" operation that is provided via the "start" port + + + + + Part of the Qompass core model library. Provides the specific port "start". The "run" operation (defined within interface IStart) of this port is called by generated boot-code after instantiation and configuration of a component. + + + + Configuration attribute within the Hello World component. Its value is configured on the instance level. + + + + + + + + + + + + + + + + + + C/C++ + JAVA + cout << "Hello world: " << message << endl; + System.out.println("Hello"); + + + + + + + + + + + + + + + + Simple single node configuration. TargetOS is set to Linux, but will work on any OS, since this simple example does not use the OS abstraction layer + + + + + + + + + + + + + + + + + + This configuration requires the installation of the OTF trace library.<br /> + + + Cross references to composite diagram + + + Deployment plan for system, i.e. set of instance specification along with configuration and allocation + + + + Value mainInstance.hello is a UML instance-value, i.e. a reference to the instance specification on the left. +"Test message" is a StringValue initializing the message attribute + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.di new file mode 100644 index 00000000000..bf9abab340f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.di @@ -0,0 +1,2 @@ + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.notation new file mode 100644 index 00000000000..cbbd906bbaf --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.notation @@ -0,0 +1,1541 @@ + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + name + derived + type + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + name + derived + type + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + name + derived + type + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + name + derived + type + + + + + + + + + name + derived + type + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + name + derived + type + + + + + + + + + name + derived + type + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + name + derived + type + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + name + derived + type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + +
      + + +
      + + +
      + + +
      + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + name + derived + type + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + name + derived + type + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + name + derived + type + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.uml new file mode 100644 index 00000000000..6f14b85b526 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerConsumer.uml @@ -0,0 +1,453 @@ + + + + + + + + + + + + + + + + + + + Variant of the consumper component that uses a "pull style", i.e. actively demands whether new data is available. Since the component is active, it needs to have its own thread. This is realized by the combination of the lifecycle port with a container rule that intercepts the lifecycle operations and executes the activation operation in its own thread. +Use the context menu to find out that the PullConsumer supports the "runStartThread" interceptor which intercepts the lifecycle port. + + + + Part of the Qompass model library. Provides the specific port "lc" (short for lifecycle). The "activate" operation of this port is called by generated boot-code after instantiation and configuration of a component. The deactivation is called before disposing a component + + + + + + + + + + + + C/C++ + cout << "wait for data on port p" << endl; +for (int i = 0; i<25; i++) { + if (p->hasData ()) { + components::interfaces::PubData data = p->pull (); + cout << "received data: x = " << data.x << " y = " << data.y << endl; + } + usleep (100*1000); +} +cout << "finished waiting" << endl; + + + + C/C++ + + + + C/C++ + + + + + + + + + + Push variant of a consumer, i.e. the consumer is called whenever new data is availble. It is not itself active. + + + A MARTE flow port. The synchronisation between MARTE and FCM stereotype is automatic, yet it is possible to refine on FCM level, whether the port uses a push or pull style. In this case, the port uses a push style by setting the port kind to "PushConsumer". + + + The dependency assures that the type PubData is known within the generated code for PushConsumer_impl + + + + + + + + + + + + + C/C++ + cout << "initialization of push consumer" << endl; + + + + + + + + C/C++ + cout << "received data: x = " << data.x << " y = " << data.y << endl; + + + C/C++ + + + + C/C++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Let the producer instance execute by the main thread by realising the specific port "start", inherited from CStart (part of the Qompass "core" model library). + + + + + + + + + + + + + C/C++ + cout << "publish a value via port q;" << endl; +components::interfaces::PubData data; +data.x = 2; +data.y = 3; +for (int i = 0; i<20; i++) { + q->push (data); + cout << "." << flush; + // wait 200ms + usleep (200*1000); +} + + + + + + + + + + Pull consumer is executed by its own thread. This is specified via a container service (runStartThread) + + + Since producer and consumer call operations (the latter to actively retrieve data), the two ports would be incompatible without using a specific interaction component, in this case. a FIFO. +Use the context menu on a selected connector to specify the interaction component. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The push consumer provides the interface that the producer uses (requires), no specific connector is required + + + + + + + + + + + + + + + + + + + + + + + + + + + Simple single node configuration. TargetOS is set to Linux, but will work on other OS (supporting POSIX threads) + + + + + + + + + + + + + + + + + + This configuration requires the installation of the OTF trace library.<br /> + + + Cross references to diagrams + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.di new file mode 100644 index 00000000000..17cff76e5d5 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.di @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.notation new file mode 100644 index 00000000000..6e4bd7a2591 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.notation @@ -0,0 +1,1655 @@ + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.uml new file mode 100644 index 00000000000..4690ec8712c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/ProducerTwoConsumers.uml @@ -0,0 +1,532 @@ + + + + + + + + + + + + + + + + + + + + + + Variant of the consumper component that uses a "pull style", i.e. actively demands whether new data is available. Since the component is active, it needs to have its own thread. This is realized by the combination of the lifecycle port with a container rule that intercepts the lifecycle operations and executes the activation operation in its own thread. +Use the context menu to find out that the PullConsumer supports the "runStartThread" interceptor which intercepts the lifecycle port. + + + + Part of the Qompass model library. Provides the specific port "lc" (short for lifecycle). The "activate" operation of this port is called by generated boot-code after instantiation and configuration of a component. The deactivation is called before disposing a component + + + + + + + + + + + + + + + + + C/C++ + cout << "wait for data on port p" << endl; +for (int i = 0; i<25; i++) { + if (p->hasData ()) { + components::interfaces::PubData data = p->pull (); + cout << "Componenent " << name << " received data: x = " << data.x << " y = " << data.y << endl; + } + usleep (100*1000); +} +cout << "finished waiting" << endl; + + + + + + + + + Push variant of a consumer, i.e. the consumer is called whenever new data is availble. It is not itself active. + + + A MARTE flow port. The synchronisation between MARTE and FCM stereotype is automatic, yet it is possible to refine on FCM level, whether the port uses a push or pull style. In this case, the port uses a push style by setting the port kind to "PushConsumer". + + + + + + + + + + + + + C/C++ + cout << "initialization of push consumer" << endl; + + + + C/C++ + cout << "received data: x = " << data.x << " y = " << data.y << endl; + + + + + + + + + + + + + + + + + + + + + + + + + Let the producer instance execute by the main thread by realising the specific port "start", inherited from CStart (part of the Qompass "BasicCalls" model library). + + + + + + + + + + + + + + + + C/C++ + cout << "publish a value via port q;" << endl; +components::interfaces::PubData data; +data.x = 2; +data.y = 3; +for (int i = 0; i<20; i++) { + q->push (data); + cout << "." << flush; + // wait 200ms + usleep (200*1000); +} + + + + + + + + + Two consumers use the same queue. In this case, it is arbitrary which one gets which data + + + in this case, the connector is modeled explicitly in order to specify that a single connector instance is used + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The push consumer provides the interface that the producer uses (requires), no specific connector is required, but we need to multiply data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simple single node configuration. TargetOS is set to Linux, but will work on other OS (supporting POSIX threads) + + + + + + + + + + + + + + + + + + + + + + + + This configuration requires the installation of the OTF trace library.<br /> + + + Cross references to diagrams + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-CDTeditor.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-CDTeditor.png new file mode 100644 index 00000000000..fc3d356a890 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-CDTeditor.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-OpenCDTeditor.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-OpenCDTeditor.png new file mode 100644 index 00000000000..2d035823791 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-OpenCDTeditor.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-classdiag.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-classdiag.png new file mode 100644 index 00000000000..243f412cdf9 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-classdiag.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-component.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-component.png new file mode 100644 index 00000000000..88c03612ba9 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-component.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-component.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-component.svg new file mode 100644 index 00000000000..0170b7235ea --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-component.svg @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +HelloWorld + +«ConfigurationProperty» + + message: String [1] + + + + + + + + start: IStart [1] + +Simple HelloWorld component that prints a +message in its "run" operation that is +provided via the "start" port + + + + + + + + + +Part of the Qompass core model library. +Provides the specific port "start". The "run" +operation (defined within interface IStart) of +this port is called by generated boot-code +after instantiation and configuration of a +component. + + + + + + + + + +Configuration attribute within the Hello +World component. Its value is configured on +the instance level. + + + + + + + + + +Cstart + + + + + start: IStart [1] + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-deployment.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-deployment.png new file mode 100644 index 00000000000..a53b6fdf43d Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-deployment.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-deployment.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-deployment.svg new file mode 100644 index 00000000000..e69c7837eee --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-deployment.svg @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +HelloWorldComponent + +Cross references to composite +diagram + + + + + + + + + + + + + + + +«DeploymentPlan» +SystemDepPlan + +mainInstance: System +hello : HelloWorld = mainInstance.hello + + + +mainInstance.hello: HelloWorld +message : String = "Test message" + + + +monoNode: MonoNode + + +Value mainInstance.hello is a UML +instance-value, i.e. a reference to +the instance specification on the +left. +"Test message" is a StringValue +initializing the message attribute + + + + + + + + + + +Deployment plan for system, i.e. +set of instance specification +along with configuration and +allocation + + + + + + + + + +«Allocate» + + + + + + +«Allocate» + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-platform.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-platform.png new file mode 100644 index 00000000000..b13395ea580 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-platform.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-platform.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-platform.svg new file mode 100644 index 00000000000..a2b99233272 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-platform.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Platform + + monoNode: MonoNode + + + + + + +«Node» +MonoNode +«Target» +targetArch=StandardPC +availRAM +availROM + + + + +Simple single node configuration. +TargetOS is set to Linux, but will work on +any OS, since this simple example does +not use the OS abstraction layer + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-system.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-system.png new file mode 100644 index 00000000000..18b6c1ac5d2 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-system.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-system.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-system.svg new file mode 100644 index 00000000000..3d1b27ed68f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/HelloWorld-system.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +System + + hello: HelloWorld + + + + + + + start: IStart + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.png new file mode 100644 index 00000000000..b624fed7ea6 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.svg new file mode 100644 index 00000000000..4336e615b78 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-pullcon.svg @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +PullConsumer_impl + + + + + + + + lc: ILifeCycle + + + + p: PubData +kind=PullConsumer,requiredInterface=D_PullConsumer_PubData + + +LifeCycle + + + + + + lc: ILifeCycle + +Variant of the consumper component that uses a "pull +style", i.e. actively demands whether new data is +available. Since the component is active, it needs to +have its own thread. This is realized by the combination +of the lifecycle port with a container rule that intercepts +the lifecycle operations and executes the activation +operation in its own thread. +Use the context menu to find out that the PullConsumer +supports the "runStartThread" interceptor which +intercepts the lifecycle port. + + + + + + + + + +Part of the Qompass model library. Provides the specific +port "lc" (short for lifecycle). The "activate" operation of +this port is called by generated boot-code after +instantiation and configuration of a component. The +deactivation is called before disposing a component + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.pdf b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.pdf new file mode 100644 index 00000000000..4a05698fb4f Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.pdf differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.png new file mode 100644 index 00000000000..f1b72e82fa3 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.svg new file mode 100644 index 00000000000..aa89a2be691 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/examples/figs/ProducerConsumer-sys.svg @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +SystemPull_impl + + con: PullConsumer_impl + + + + + + + + p: PubData + + prod: Producer_impl + + + + + + q: PubData + +Pull consumer is executed by its +own thread. This is specified via a +container service (runStartThread) + + + + + + + + + +Since producer and consumer call operations (the latter to actively +retrieve data), the two ports would be incompatible without using +a specific interaction component, in this case. a FIFO. +Use the context menu on a selected connector to specify the +interaction component. + + + + + + + + + + + +«connector» +{ic=FIFO_impl} + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.di new file mode 100644 index 00000000000..4af45b41bca --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.di @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.notation new file mode 100644 index 00000000000..52a0b8e9ee1 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.notation @@ -0,0 +1,256 @@ + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.uml new file mode 100644 index 00000000000..16504ba6e28 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corba.uml @@ -0,0 +1,75 @@ + + + + + The CORBA primitive types are defined by means of the C++ profile. For portability, they rely on the (C99) standard include file stdint.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.di new file mode 100644 index 00000000000..c60a23070a9 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.di @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.notation new file mode 100644 index 00000000000..a64f663c8c1 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.notation @@ -0,0 +1,5392 @@ + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + +
      + + + + + + + + +
      + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      +
      +
      +
      +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + +
      + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.uml new file mode 100644 index 00000000000..f028cc3615c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/core.uml @@ -0,0 +1,1369 @@ + + + + + + + + + + + + + + + + + + + + + + A template for the bootloader generation. + + + This C++ implementation of the template contains principally the definition of the +"main" function and the declaration of the bootloader instance + + + C/C++ + <%createInstances%> + + + + + + + + + Main package template for all call based connectors. The formal parameter is the interface I (which is bound to the actual interface used in a call). +This package is virtually extended by other model libraries who import it. + + + Inheritance hierarchy for (A)SyncCall component types. Separate types for required (rconn) and provided (fconn) ports enable re-use via inheritance ain multiple places (e.g. for AMI ports that use an unmodified provided port and different variants of a required port). +Note that ports on connector side are conjugated + + + + + + + + + + + + + + Description: A simple implementation of asynchronous calls. It will execution requests by means of a single dispatcher thread + + + Simple asynchronous call implementation: returns immediately and executes request in new thread + + + Uses buffer and ASN marshalling. +TODO: configurable buffer size, use data structure (CppParameterStorage) + + + + + + + + + + + + + C/C++ + !xtend AsyncCalls.asyncCall + + + C/C++ + ((AsyncCall_impl *) arg)->dispatch (); +return NULL; + + + + C/C++ + !xtend AsyncCalls.dispatch_ + + + + + + + + + + + + + + + + + + + + (untested) implementation of an asynchronous invocation that uses a thread pool for +spawning new requests + + + + + + + + + + + + + C/C++ + !xtend AsyncCalls.asyncCall + + + C/C++ + ((AsyncCall_impl *) arg)->dispatch (); +return NULL; + + + + C/C++ + !xtend AsyncCalls.dispatchWithThreadPool + + + + + + + + + + + + + + + + + + + + Description: A simple implementation of asynchronous calls. It will execution requests by means of a single dispatcher thread + + + Polling variant of CORBAs asynchronous messaging (AMI), enables asynchronous calls while reading +return values (also called deferred synchronous): +Instead of specified return values, functions return a poller object which may be queried for +the result. +TODO: complete, move into model of Qompass AMI plugin + + + + + + + + + + + + + C/C++ + !xtend AMIPull.operation + + + C/C++ + ((AsyncCall_impl *) arg)->dispatch (); +return NULL; + + + + C/C++ + !xtend AsyncCall.dispatch_ + + + + + + + + + + + + + + + + + + + + + + C/C++ + !xtend MultipleReceptacle.operation_ + + + + + + + + + + + + + + + + + + + + + + + Needs completion: +good(?) write buffer event? +Call operations of buffer component? +[could have done in an identical way for EventPool] + + + Marshalling is done at two levels: +(1) In case of a shared address space, only a callEvent is created. It can be passed between threads within a process. +(2) For remote communication, marshalling into a buffer is done. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + !xtend StructBasedMarshalling.marshall + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Description: This connector is a kind of dummy connector, since it only passes incoming requests to its caller port + + + Minimal connector implementation that does nothing (but passing requests) + + + + + + + + C/C++ + !xtend SyncCalls.syncCall + + + + + + + + + + C/C++ + cout << "this is a sample pre-call interception" << endl; +rconn-><%cppCall%>; +cout << "this is a sample post-call interception" << endl; + + + + + + + A set of Leader followers is instantiated. Each has its own thread and a semaphore. The LF instance waits on its semaphore. When selectLeader is called, a follower is signaled (semaphore is posted) and will become leader. The leader waits for a resource (e.g. a socket) and becomes executor. + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + for (;;) { + // wait to be become active + m_state = FOLLOWER; + sem_wait (&m_sema); + m_state = LEADER; + listener->select(); // no loop, single select + selectLeader (); + m_state = EXECUTOR; + listener->exec(); +} + + + + + C/C++ + // select a new leader from the followers +for (int i = currentIndex+1, j=0; j<POOL_SIZE; i++, j++) +{ + if (i == POOL_SIZE) { + i = 0; + } + if (sr[i].state == FOLLOWER) { + sem_post (&sr[i].m_sema); + break; + } +} + + + C/C++ + sem_init (&m_sema, 0, 0); +m_state = FOLLOWER; + + + C/C++ + for (int i=0; i<POOL_SIZE; i++) { + pthread_create (&m_sr.m_tID, 0, runStatic, &m_sr[i]); +} + + + C/C++ + ((LeaderFollower *) arg)->run(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Data Flow oriented communication: consume passively: provided push operation is called + + + Data Flow oriented communication: produce data via pushing these (calling the required operation) + + + Data Flow oriented communication: produce data via pushing these (calling the required operation) + + + Data Flow oriented communication: produce data via pushing these (calling the required operation) + + + Data Flow oriented communication: consumer data actively by calling the required poll operation + + + In order to support icons, all port kinds are stereotypes, but for Qompass they are classes stereotyped as "PortKind" + + + A bidirectional flow port combining a push-producer and a pull consumer + + + Dummy interface returned by ports who need to update derived interfaces (but can only do so in the context of a transaction). + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + + + + + + Simple provision of typing interface as provided interface + + + Simple provision of typing interface as required interface + + + CORBA asynchronous messaging (AMI): Provision of poller variant of typing interface. Allows client to continue without waiting for the result + + + CORBA asynchronous messaging (AMI): Provision of callback variant of typing interface. Allows client Allows client to continue without waiting for the result + + + + + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + + + + + + + + + Is called during component activation & deactivation. The two functions may not block i.e. return control to the caller after "a very short" period + + + Is called during startup. Expected to block. Only one component instance per node may define it. + + + + + + + + + + + + A thread service supporting the LifeCycle port. Once started, it calls the activate operation (via the required port rLC) of a connected component in a new thread of a specific priority (a configuration attribute). This C++ implementation is based on the POSIX pthread library. It will further assume that the execution is done with root privileges, since these are required to set the thread priority. The thread properties assume round-robin (SCHED_RR) scheduling. + + + + Interceptor variant of thread (inherits all, only difference to Thread superclass: tagged as connector) + + + + Priority of the thread. The interpretation of the value is OS specific. In case of POSIX; priorities are only taken into accound for threads with a FIFO and round-robin scheduliung policy. + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + ((Thread*) arg)->rLC->activate(); +return NULL; + + + + C/C++ + // create thread +pthread_t pt; +pthread_create (&pt, NULL, staticAct, (void *) this); + +// set priority of thread +struct sched_param schedParam; +schedParam.sched_priority = priority; +pthread_setschedparam (pt, SCHED_RR, &schedParam); +// TODO: check return code (in particular, SCHED_RR only works for root) + + + + C/C++ + + + + C/C++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + if (m_size < POOL_SIZE) { + events[writeIndex] = event; + writeIndex = (writeIndex + 1) % POOL_SIZE; + m_size++; + if (m_size == 1) { + // was 0 before, notify waiting clients + m_cond.signal(); + } +} + + + + + + + + + + C/C++ + return m_size; + + + + + + + + + + + + C/C++ + if (m_size == 0) { + // no element is in pool. Wait until it is placed inside + // TODO: potential race condition + OS_AL::Time::TimeVal wakeup = OS_AL::Time::TimeVal::current(); + wakeup += timeout; + int retCode = m_cond.waitUpto (wakeup); + if (retCode == ETIMEDOUT) { + CallEvent_ event; + event.operationID = ID_TIMEOUT; + return event; + } +} +int current = readIndex; +readIndex = (readIndex+1) % POOL_SIZE; +m_size--; +return events[current]; + + + C/C++ + m_cond.lock(); +readIndex = 0; +writeIndex = 0; +m_size = 0; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <<TextualRepresentation>>public abstract writeEvent (in event:BasicCalls::ContainerServices::Event) ; + + + + + + + + + + + + + + + + + + <<TextualRepresentation>>public abstract size () : BasicCalls::Long ; + + + + + + + + + + + + <<TextualRepresentation>>public abstract readEvent(in timeout : BasicCalls::Long) : BasicCalls::ContainerServices::Event ; + + + + + + + + + + + + + + + + + + The period length of the perdioci timer in ticks. Currently, a tick corresponds to 1 ms (simulation time in the underlying OS abstraction layer). It is planned to support VSL expressions, i.e. a value/unit pair. + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + OS_AL::Time::Timer timer; +OS_AL::Time::TimeVal time = OS_AL::Time::TimeVal::current(); +OS_AL::Time::TimeVal period(periodLength); +for (;;) { + tick->tick(); + time += period; + timer.wakeUp(time); +} + + + C/C++ + + + + C/C++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This rule adds an interceptor for the lifecycle (lc) port. It will use the Thread implementation that executes the activate method in a new thread of a given priority (property of the interceptor implementation) + + + Adds a periodic timer to the container + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Use for distributed applications + + + + + Use for debugging in general + + + + + Use for tracing. + + + + + + + + + + + + + + + + + + + Elements in this package depend not only on the Interface I (which is a non-owned template parameter taken from the methodCall signature), but also on a class parameter T, which is bound to the component within a container binding. +Be aware that the number of instantiated template packages will be considerably larger compared to a dependency of the interface only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pthread + rt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.di new file mode 100644 index 00000000000..b319be2de9c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.di @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.notation new file mode 100644 index 00000000000..ce60a488a78 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.notation @@ -0,0 +1,3896 @@ + + + + + + + + + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      +
      +
      +
      +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + +
      +
      +
      +
      +
      + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      +
      +
      +
      +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.uml new file mode 100644 index 00000000000..1570093713d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corec.uml @@ -0,0 +1,1507 @@ + + + + + + + + + + + + + + + + + + + + + + currently unused, not sure whether really needed + + + C/C++ + [template (clazz: Class)] +/* --- create internal connections --- */ +[for (connector : Connector | clazz.getOwnedConnectors())]%> + [comment call createConnection (this = connector instance) define in utils /] + // connector [connector.name/] + [createConnection(connector)/] +[/for] +[/template] + + + C/C++ + [template (clazz: Class)] +// createParts +// assign implementations fixed at component design time +[for (Property part | clazz.part)] + [if (type.isImplementation)] + [part.name/] = &m_[part.name/]_impl; + [/if] +[/for] + +// assign implementation fixed at deployment time +[for (Property part | clazz.part)] + [if (type.isImplementation)] +m_[part.name/] = [part.name/] + [/if] +[/for] +[/template] + + + + + + + A template for the bootloader generation. + + + This C++ implementation of the template contains principally the definition of the +"main" function and the declaration of the bootloader instance + + + C/C++ + <%createInstances%> + + + + + + + + + Main package template for all call based connectors. The formal parameter is the interface I (which is bound to the actual interface used in a call). +This package is virtually extended by other model libraries who import it. + + + Inheritance hierarchy for (A)SyncCall component types. Separate types for required (rconn) and provided (fconn) ports enable re-use via inheritance ain multiple places (e.g. for AMI ports that use an unmodified provided port and different variants of a required port). +Note that ports on connector side are conjugated + + + + + + + + + + + + + + Description: A simple implementation of asynchronous calls. It will execution requests by means of a single dispatcher thread + + + Simple asynchronous call implementation: returns immediately and executes request in new thread + + + Uses buffer and ASN marshalling. +TODO: configurable buffer size, use data structure (CppParameterStorage) + + + + + + + + + + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] +[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public op(operation : Operation)] +// TODO: need suitable constant dimensioning +pBuffer = &buffer['['/]500[']'/]; // grows backwards +int operationID = ID_[operation.name/]; + +// now marshall in and inout parameters via ASN.1 +[for (parameter : Parameter | operation.parametersInInout())] +{ + [parameter.type.cppType()/] varName_ASN = [parameter.name/]; + BEncAsnContent (&pBuffer, &varName_ASN); +} +[/for] +BEncAsnContent (&pBuffer, &operationID); + +pthread_t pt; +pthread_create (&pt, NULL, staticDispatch, (void *) this); +// TODO: add semaphore which assures that subsequent calls to [operation.name/] are not executed before dispatch +// has removed the parameters from the pBuffer stack (pBuffer can be corrupted). +[/template] + + + C/C++ + ((AsyncCall_impl *) arg)->dispatch (); +return NULL; + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] +[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public dispatch(clazz : Class)] +int operationID; +BDecAsnContent (&pBuffer, operationID); +switch (operationID) +{ +[for (operation : Operation | clazz.ownedOperation)] + case ID_[operation.name/] + { + [for (parameter : Parameter | operation.parametersInInout()->reverse())] + [parameter.type.cppType()/] [parameter.name/] + { + [parameter.type.cppType()/] varName_ASN; + BDecAsnContent (&pBuffer, &varName_ASN); + [parameter.name/] = varName_ASN; + } + [/for] + // delegate call to executor + rconn->[operation.cppCall()/]; + break; + } +[/for] +} +[/template] + + + + + + + + + + + + + + + + + + + + (untested) implementation of an asynchronous invocation that uses a thread pool for +spawning new requests + + + + + + + + + + + + + C/C++ + [template marshall(operation: Operation)] +// TODO: need suitable constant dimensioning +pBuffer = &buffer[500]; // grows backwards +int operationID = ID_[operation.name/]; + +// now marshall in and inout parameters via ASN.1 +for (parameter : Parameter | parametersInInout(operation)] +{ + [cppType(parameter.type)/] varName_ASN = [parameter.name/]; + BEncAsnContent (&pBuffer, &varName_ASN); +} +[/for] +BEncAsnContent (&pBuffer, &operationID); + +// find associated thread and signal its semaphore +// pass "this" to access buffer +// pthread_t pt; +// pthread_create (&pt, NULL, staticDispatch, (void *) this); +// TODO: add semaphore which assures that 2 snd calls to [operation.name/] is not done before dispatch +// is executed +[/template] + + + + C/C++ + ((AsyncCall_impl *) arg)->dispatch (); +return NULL; + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] +[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public dispatch(clazz : Class)] +int operationID; +BDecAsnContent (&pBuffer, operationID); +switch (operationID) +{ +[for (operation : Operation | clazz.ownedOperation)] + case ID_[operation.name/] + { + [for (parameter : Parameter | operation.parametersInInout()->reverse())] + [parameter.type.cppType()/] [parameter.name/] + { + [cppType(parameter.type)/] varName_ASN; + BDecAsnContent (&pBuffer, &varName_ASN); + [parameter.name/] = varName_ASN; + } + [/for] + // delegate call to executor + [if (not (type = null))] [operation.type.cppType()/] ret = [/if]rconn->[operation.cppCall()/]; + [for (parameter : Parameter | operation.parametersOutInout())] + { + [parameter.type.cppType()/] varName_ASN = [parameter.name/]; + BEncAsnContent (&pBuffer, &varName_ASN); + } + [/for] + resultsReady = 1; + break; + } +[/for] +} +[/template] + + + + + + + + + + + + + + + + + + + + + Description: A simple implementation of asynchronous calls. It will execution requests by means of a single dispatcher thread + + + Polling variant of corbas asynchronous messaging (AMI), enables asynchronous calls while reading +return values (also called deferred synchronous): +Instead of specified return values, functions return a poller object which may be queried for +the result. +TODO: complete, move into model of Qompass AMI plugin + + + + + + + + + + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] +[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public marshall(operation : Operation)] +[if (operation.name.oclAsType(String).endsWith('Poll'))] +[comment polling function/] +if (!resultArrived) { + // wait for result, condition will be fired upon arrival + TimeVal timeVal = TimeVal::current () + timeout; + m_cond.waitUpto (timeout); +} + [for (parameter : Parameter | operation.parametersInInout()->reverse())] + [parameter.type.cppType()/] [parameter.name/]; + { + [parameter.type.cppType()/] varName_ASN; + BDecAsnContent (&pBuffer, &varName_ASN); + [parameter.name/] = varName_ASN; + } + [/for] +} +[if (not (type = null))]return retValue;[/if] +[else] +// TODO: need suitable constant dimensioning +pBuffer = &buffer['['/]500[']'/]; // grows backwards +int operationID = ID_[operation.name/]; + +// now marshall in and inout parameters via ASN.1 +[for (parameter : Parameter | operation.parametersInInout())] + [parameter.type.cppType()/] [parameter.name/]; + { + [parameter.type.cppType()/] varName_ASN = [parameter.name/]; + BEncAsnContent (&pBuffer, &varName_ASN); + } +[/for] +BEncAsnContent (&pBuffer, &operationID); + +pthread_t pt; +pthread_create (&pt, NULL, staticDispatch, (void *) this); +// TODO: add semaphore which assures that subsequent calls to [operation.name/] are not executed before dispatch +// has removed the parameters from the pBuffer stack (pBuffer can be corrupted). +// even worse: buffer will be deallocated even without a 2nd call! +[/if] +[/template] + + + C/C++ + ((AsyncCall_impl *) arg)->dispatch (); +return NULL; + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] +[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public dispatch(clazz : Class)] +int operationID; +BDecAsnContent (&pBuffer, operationID); +switch (operationID) +{ +[for (operation : Operation | clazz.ownedOperation)] + case ID_[operation.name/] + { + [for (parameter : Parameter | operation.parametersInInout()->reverse())] + [parameter.type.cppType()/] [parameter.name/] + { + [cppType(parameter.type)/] varName_ASN; + BDecAsnContent (&pBuffer, &varName_ASN); + [parameter.name/] = varName_ASN; + } + [/for] + // delegate call to executor + [if (not (type = null))] [operation.type.cppType()/] ret = [/if]rconn->[operation.cppCall()/]; + [for (parameter : Parameter | operation.parametersOutInout())] + { + [parameter.type.cppType()/] varName_ASN = [parameter.name/]; + BEncAsnContent (&pBuffer, &varName_ASN); + } + [/for] + resultsReady = 1; + break; + } +[/for] +} +[/template] + + + + + + + + + + + + + + + + + + + + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] +[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public multiply(operation : Operation)] +for (int i=0; i<9; i++) { + if (rconn['['/]i[']'/] != 0) { + rconn['['/]i[']'/]->[operation.cppCall()/]; + } +} +[/template] + + + + + + + + + + + + + + + + + + + + + + + + + + Needs completion: +good(?) write buffer event? +Call operations of buffer component? +[could have done in an identical way for EventPool] + + + Marshalling is done at two levels: +(1) In case of a shared address space, only a callEvent is created. It can be passed between threads within a process. +(2) For remote communication, marshalling into a buffer is done. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + [template marshallStruct(operation : Operation)] +struct ParamData { +[for (parameter : Parameter | parametersInInout(operation))] + int [cppType(name)/]; +[/for] +}; +Event event; +event.ID = [operation.name/]; +event.kind = CallEvent; +ParamData * data = &event.params; +[for (parameter : Parameter | parametersInInout(operation))] + data->[parameter.name/] = [parameter.name/]; +[/for] +out->dispatch(event); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Description: This connector is a kind of dummy connector, since it only passes incoming requests to its caller port + + + Minimal connector implementation that does nothing (but passing requests) + + + + + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public methodCall(operation : Operation)] +// put pre-interceptors here +[comment type is a derived property containing the operations return type/] +[if not (operation.type = null)]return [/if]rconn->[operation.cppCall()/]; +// put post-interceptors here +[/template] + + + + + + + + + + C/C++ + cout << "this is a sample pre-call interception" << endl; +rconn-><%cppCall%>; +cout << "this is a sample post-call interception" << endl; + + + + + + + A set of Leader followers is instantiated. Each has its own thread and a semaphore. The LF instance waits on its semaphore. When selectLeader is called, a follower is signaled (semaphore is posted) and will become leader. The leader waits for a resource (e.g. a socket) and becomes executor. + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + for (;;) { + // wait to be become active + m_state = FOLLOWER; + sem_wait (&m_sema); + m_state = LEADER; + listener->select(); // no loop, single select + selectLeader (); + m_state = EXECUTOR; + listener->exec(); +} + + + + + C/C++ + // select a new leader from the followers +for (int i = currentIndex+1, j=0; j<POOL_SIZE; i++, j++) +{ + if (i == POOL_SIZE) { + i = 0; + } + if (sr[i].state == FOLLOWER) { + sem_post (&sr[i].m_sema); + break; + } +} + + + C/C++ + sem_init (&m_sema, 0, 0); +m_state = FOLLOWER; + + + C/C++ + for (int i=0; i<POOL_SIZE; i++) { + pthread_create (&m_sr.m_tID, 0, runStatic, &m_sr[i]); +} + + + C/C++ + ((LeaderFollower *) arg)->run(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simple provision of typing interface as provided interface + + + Simple provision of typing interface as required interface + + + corba asynchronous messaging (AMI): Provision of poller variant of typing interface. Allows client to continue without waiting for the result + + + corba asynchronous messaging (AMI): Provision of callback variant of typing interface. Allows client Allows client to continue without waiting for the result + + + Data Flow oriented communication: consume passively: provided push operation is called + + + Data Flow oriented communication: produce data via pushing these (calling the required operation) + + + Data Flow oriented communication: produce data via pushing these (calling the required operation) + + + Data Flow oriented communication: produce data via pushing these (calling the required operation) + + + Data Flow oriented communication: consumer data actively by calling the required poll operation + + + In order to support icons, all port kinds are stereotypes, but for Qompass they are classes stereotyped as "PortKind" + + + A bidirectional flow port combining a push-producer and a pull consumer + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + + + + + + + + + + Is called during component activation & deactivation. The two functions may not block i.e. return control to the caller after "a very short" period + + + Is called during startup. Expected to block. Only one component instance per node may define it. + + + + + + + + + + + + A thread service supporting the LifeCycle port. Once started, it calls the activate operation (via the required port rLC) of a connected component in a new thread of a specific priority (a configuration attribute). This C++ implementation is based on the POSIX pthread library. It will further assume that the execution is done with root privileges, since these are required to set the thread priority. The thread properties assume round-robin (SCHED_RR) scheduling. + + + + Interceptor variant of thread (inherits all, only difference to Thread superclass: tagged as connector) + + + + Priority of the thread. The interpretation of the value is OS specific. In case of POSIX; priorities are only taken into accound for threads with a FIFO and round-robin scheduliung policy. + + + + + + + + + + + + + + + + + + + C/C++ + ((Thread*) arg)->rLC->activate(); +return NULL; + + + + C/C++ + // create thread +pthread_t pt; +pthread_create (&pt, NULL, staticAct, (void *) this); + +// set priority of thread +struct sched_param schedParam; +schedParam.sched_priority = priority; +pthread_setschedparam (pt, SCHED_RR, &schedParam); +// TODO: check return code (in particular, SCHED_RR only works for root) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + events[0] = event; +m_size = 1; +m_cond.signal(); + + + + C/C++ + return m_size; + + + C/C++ + OS_AL::Time::TimeVal wakeup = OS_AL::Time::TimeVal::current(); +wakeup += timeout; +int retCode = m_cond.waitUpto (wakeup); +if (retCode == ETIMEDOUT) { + CallEvent_ event; + event.operationID = ID_TIMEOUT; + return event; +} +m_size = 0; +return events[0]; + + + C/C++ + m_cond.lock(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <<TextualRepresentation>>public abstract writeEvent (in event:BasicCalls::ContainerServices::Event) ; + + + + + + + + + + + + + + + + + + <<TextualRepresentation>>public abstract size () : BasicCalls::Long ; + + + + + + + + + + + + <<TextualRepresentation>>public abstract readEvent(in timeout : BasicCalls::Long) : BasicCalls::ContainerServices::Event ; + + + + + + + + + + + + + + + + + + The period length of the perdioci timer in ticks. Currently, a tick corresponds to 1 ms (simulation time in the underlying OS abstraction layer). It is planned to support VSL expressions, i.e. a value/unit pair. + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + OS_AL::Time::Timer timer; +OS_AL::Time::TimeVal time = OS_AL::Time::TimeVal::current(); +OS_AL::Time::TimeVal period(periodLength); +for (;;) { + tick->tick(); + time += period; + timer.wakeUp(time); +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This rule adds an interceptor for the lifecycle (lc) port. It will use the Thread implementation that executes the activate method in a new thread of a given priority (property of the interceptor implementation) + + + Adds a periodic timer to the container + + + + + + + + + + + + + + + + + + + + + + + + + + + Use for distributed applications + + + + + Use for debugging in general + + + + + Use for tracing. + + + + + + + + + + + + + + + + + + + Elements in this package depend not only on the Interface I (which is a non-owned template parameter taken from the methodCall signature), but also on a class parameter T, which is bound to the component within a container binding. +Be aware that the number of instantiated template packages will be considerably larger compared to a dependency of the interface only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pthread + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pthread + rt + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.di new file mode 100644 index 00000000000..bbc117e6eff --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.di @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.notation new file mode 100644 index 00000000000..3af00ab51ac --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.notation @@ -0,0 +1,3896 @@ + + + + + + + + + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      +
      +
      +
      +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + +
      +
      +
      +
      +
      + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      +
      +
      +
      +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.uml new file mode 100644 index 00000000000..1570093713d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/corecpp.uml @@ -0,0 +1,1507 @@ + + + + + + + + + + + + + + + + + + + + + + currently unused, not sure whether really needed + + + C/C++ + [template (clazz: Class)] +/* --- create internal connections --- */ +[for (connector : Connector | clazz.getOwnedConnectors())]%> + [comment call createConnection (this = connector instance) define in utils /] + // connector [connector.name/] + [createConnection(connector)/] +[/for] +[/template] + + + C/C++ + [template (clazz: Class)] +// createParts +// assign implementations fixed at component design time +[for (Property part | clazz.part)] + [if (type.isImplementation)] + [part.name/] = &m_[part.name/]_impl; + [/if] +[/for] + +// assign implementation fixed at deployment time +[for (Property part | clazz.part)] + [if (type.isImplementation)] +m_[part.name/] = [part.name/] + [/if] +[/for] +[/template] + + + + + + + A template for the bootloader generation. + + + This C++ implementation of the template contains principally the definition of the +"main" function and the declaration of the bootloader instance + + + C/C++ + <%createInstances%> + + + + + + + + + Main package template for all call based connectors. The formal parameter is the interface I (which is bound to the actual interface used in a call). +This package is virtually extended by other model libraries who import it. + + + Inheritance hierarchy for (A)SyncCall component types. Separate types for required (rconn) and provided (fconn) ports enable re-use via inheritance ain multiple places (e.g. for AMI ports that use an unmodified provided port and different variants of a required port). +Note that ports on connector side are conjugated + + + + + + + + + + + + + + Description: A simple implementation of asynchronous calls. It will execution requests by means of a single dispatcher thread + + + Simple asynchronous call implementation: returns immediately and executes request in new thread + + + Uses buffer and ASN marshalling. +TODO: configurable buffer size, use data structure (CppParameterStorage) + + + + + + + + + + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] +[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public op(operation : Operation)] +// TODO: need suitable constant dimensioning +pBuffer = &buffer['['/]500[']'/]; // grows backwards +int operationID = ID_[operation.name/]; + +// now marshall in and inout parameters via ASN.1 +[for (parameter : Parameter | operation.parametersInInout())] +{ + [parameter.type.cppType()/] varName_ASN = [parameter.name/]; + BEncAsnContent (&pBuffer, &varName_ASN); +} +[/for] +BEncAsnContent (&pBuffer, &operationID); + +pthread_t pt; +pthread_create (&pt, NULL, staticDispatch, (void *) this); +// TODO: add semaphore which assures that subsequent calls to [operation.name/] are not executed before dispatch +// has removed the parameters from the pBuffer stack (pBuffer can be corrupted). +[/template] + + + C/C++ + ((AsyncCall_impl *) arg)->dispatch (); +return NULL; + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] +[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public dispatch(clazz : Class)] +int operationID; +BDecAsnContent (&pBuffer, operationID); +switch (operationID) +{ +[for (operation : Operation | clazz.ownedOperation)] + case ID_[operation.name/] + { + [for (parameter : Parameter | operation.parametersInInout()->reverse())] + [parameter.type.cppType()/] [parameter.name/] + { + [parameter.type.cppType()/] varName_ASN; + BDecAsnContent (&pBuffer, &varName_ASN); + [parameter.name/] = varName_ASN; + } + [/for] + // delegate call to executor + rconn->[operation.cppCall()/]; + break; + } +[/for] +} +[/template] + + + + + + + + + + + + + + + + + + + + (untested) implementation of an asynchronous invocation that uses a thread pool for +spawning new requests + + + + + + + + + + + + + C/C++ + [template marshall(operation: Operation)] +// TODO: need suitable constant dimensioning +pBuffer = &buffer[500]; // grows backwards +int operationID = ID_[operation.name/]; + +// now marshall in and inout parameters via ASN.1 +for (parameter : Parameter | parametersInInout(operation)] +{ + [cppType(parameter.type)/] varName_ASN = [parameter.name/]; + BEncAsnContent (&pBuffer, &varName_ASN); +} +[/for] +BEncAsnContent (&pBuffer, &operationID); + +// find associated thread and signal its semaphore +// pass "this" to access buffer +// pthread_t pt; +// pthread_create (&pt, NULL, staticDispatch, (void *) this); +// TODO: add semaphore which assures that 2 snd calls to [operation.name/] is not done before dispatch +// is executed +[/template] + + + + C/C++ + ((AsyncCall_impl *) arg)->dispatch (); +return NULL; + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] +[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public dispatch(clazz : Class)] +int operationID; +BDecAsnContent (&pBuffer, operationID); +switch (operationID) +{ +[for (operation : Operation | clazz.ownedOperation)] + case ID_[operation.name/] + { + [for (parameter : Parameter | operation.parametersInInout()->reverse())] + [parameter.type.cppType()/] [parameter.name/] + { + [cppType(parameter.type)/] varName_ASN; + BDecAsnContent (&pBuffer, &varName_ASN); + [parameter.name/] = varName_ASN; + } + [/for] + // delegate call to executor + [if (not (type = null))] [operation.type.cppType()/] ret = [/if]rconn->[operation.cppCall()/]; + [for (parameter : Parameter | operation.parametersOutInout())] + { + [parameter.type.cppType()/] varName_ASN = [parameter.name/]; + BEncAsnContent (&pBuffer, &varName_ASN); + } + [/for] + resultsReady = 1; + break; + } +[/for] +} +[/template] + + + + + + + + + + + + + + + + + + + + + Description: A simple implementation of asynchronous calls. It will execution requests by means of a single dispatcher thread + + + Polling variant of corbas asynchronous messaging (AMI), enables asynchronous calls while reading +return values (also called deferred synchronous): +Instead of specified return values, functions return a poller object which may be queried for +the result. +TODO: complete, move into model of Qompass AMI plugin + + + + + + + + + + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] +[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public marshall(operation : Operation)] +[if (operation.name.oclAsType(String).endsWith('Poll'))] +[comment polling function/] +if (!resultArrived) { + // wait for result, condition will be fired upon arrival + TimeVal timeVal = TimeVal::current () + timeout; + m_cond.waitUpto (timeout); +} + [for (parameter : Parameter | operation.parametersInInout()->reverse())] + [parameter.type.cppType()/] [parameter.name/]; + { + [parameter.type.cppType()/] varName_ASN; + BDecAsnContent (&pBuffer, &varName_ASN); + [parameter.name/] = varName_ASN; + } + [/for] +} +[if (not (type = null))]return retValue;[/if] +[else] +// TODO: need suitable constant dimensioning +pBuffer = &buffer['['/]500[']'/]; // grows backwards +int operationID = ID_[operation.name/]; + +// now marshall in and inout parameters via ASN.1 +[for (parameter : Parameter | operation.parametersInInout())] + [parameter.type.cppType()/] [parameter.name/]; + { + [parameter.type.cppType()/] varName_ASN = [parameter.name/]; + BEncAsnContent (&pBuffer, &varName_ASN); + } +[/for] +BEncAsnContent (&pBuffer, &operationID); + +pthread_t pt; +pthread_create (&pt, NULL, staticDispatch, (void *) this); +// TODO: add semaphore which assures that subsequent calls to [operation.name/] are not executed before dispatch +// has removed the parameters from the pBuffer stack (pBuffer can be corrupted). +// even worse: buffer will be deallocated even without a 2nd call! +[/if] +[/template] + + + C/C++ + ((AsyncCall_impl *) arg)->dispatch (); +return NULL; + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] +[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public dispatch(clazz : Class)] +int operationID; +BDecAsnContent (&pBuffer, operationID); +switch (operationID) +{ +[for (operation : Operation | clazz.ownedOperation)] + case ID_[operation.name/] + { + [for (parameter : Parameter | operation.parametersInInout()->reverse())] + [parameter.type.cppType()/] [parameter.name/] + { + [cppType(parameter.type)/] varName_ASN; + BDecAsnContent (&pBuffer, &varName_ASN); + [parameter.name/] = varName_ASN; + } + [/for] + // delegate call to executor + [if (not (type = null))] [operation.type.cppType()/] ret = [/if]rconn->[operation.cppCall()/]; + [for (parameter : Parameter | operation.parametersOutInout())] + { + [parameter.type.cppType()/] varName_ASN = [parameter.name/]; + BEncAsnContent (&pBuffer, &varName_ASN); + } + [/for] + resultsReady = 1; + break; + } +[/for] +} +[/template] + + + + + + + + + + + + + + + + + + + + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] +[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public multiply(operation : Operation)] +for (int i=0; i<9; i++) { + if (rconn['['/]i[']'/] != 0) { + rconn['['/]i[']'/]->[operation.cppCall()/]; + } +} +[/template] + + + + + + + + + + + + + + + + + + + + + + + + + + Needs completion: +good(?) write buffer event? +Call operations of buffer component? +[could have done in an identical way for EventPool] + + + Marshalling is done at two levels: +(1) In case of a shared address space, only a callEvent is created. It can be passed between threads within a process. +(2) For remote communication, marshalling into a buffer is done. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + [template marshallStruct(operation : Operation)] +struct ParamData { +[for (parameter : Parameter | parametersInInout(operation))] + int [cppType(name)/]; +[/for] +}; +Event event; +event.ID = [operation.name/]; +event.kind = CallEvent; +ParamData * data = &event.params; +[for (parameter : Parameter | parametersInInout(operation))] + data->[parameter.name/] = [parameter.name/]; +[/for] +out->dispatch(event); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Description: This connector is a kind of dummy connector, since it only passes incoming requests to its caller port + + + Minimal connector implementation that does nothing (but passing requests) + + + + + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public methodCall(operation : Operation)] +// put pre-interceptors here +[comment type is a derived property containing the operations return type/] +[if not (operation.type = null)]return [/if]rconn->[operation.cppCall()/]; +// put post-interceptors here +[/template] + + + + + + + + + + C/C++ + cout << "this is a sample pre-call interception" << endl; +rconn-><%cppCall%>; +cout << "this is a sample post-call interception" << endl; + + + + + + + A set of Leader followers is instantiated. Each has its own thread and a semaphore. The LF instance waits on its semaphore. When selectLeader is called, a follower is signaled (semaphore is posted) and will become leader. The leader waits for a resource (e.g. a socket) and becomes executor. + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + for (;;) { + // wait to be become active + m_state = FOLLOWER; + sem_wait (&m_sema); + m_state = LEADER; + listener->select(); // no loop, single select + selectLeader (); + m_state = EXECUTOR; + listener->exec(); +} + + + + + C/C++ + // select a new leader from the followers +for (int i = currentIndex+1, j=0; j<POOL_SIZE; i++, j++) +{ + if (i == POOL_SIZE) { + i = 0; + } + if (sr[i].state == FOLLOWER) { + sem_post (&sr[i].m_sema); + break; + } +} + + + C/C++ + sem_init (&m_sema, 0, 0); +m_state = FOLLOWER; + + + C/C++ + for (int i=0; i<POOL_SIZE; i++) { + pthread_create (&m_sr.m_tID, 0, runStatic, &m_sr[i]); +} + + + C/C++ + ((LeaderFollower *) arg)->run(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simple provision of typing interface as provided interface + + + Simple provision of typing interface as required interface + + + corba asynchronous messaging (AMI): Provision of poller variant of typing interface. Allows client to continue without waiting for the result + + + corba asynchronous messaging (AMI): Provision of callback variant of typing interface. Allows client Allows client to continue without waiting for the result + + + Data Flow oriented communication: consume passively: provided push operation is called + + + Data Flow oriented communication: produce data via pushing these (calling the required operation) + + + Data Flow oriented communication: produce data via pushing these (calling the required operation) + + + Data Flow oriented communication: produce data via pushing these (calling the required operation) + + + Data Flow oriented communication: consumer data actively by calling the required poll operation + + + In order to support icons, all port kinds are stereotypes, but for Qompass they are classes stereotyped as "PortKind" + + + A bidirectional flow port combining a push-producer and a pull consumer + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + +
      +
      + + + + +
      +
      + + + + + + + + + + + + + + + Is called during component activation & deactivation. The two functions may not block i.e. return control to the caller after "a very short" period + + + Is called during startup. Expected to block. Only one component instance per node may define it. + + + + + + + + + + + + A thread service supporting the LifeCycle port. Once started, it calls the activate operation (via the required port rLC) of a connected component in a new thread of a specific priority (a configuration attribute). This C++ implementation is based on the POSIX pthread library. It will further assume that the execution is done with root privileges, since these are required to set the thread priority. The thread properties assume round-robin (SCHED_RR) scheduling. + + + + Interceptor variant of thread (inherits all, only difference to Thread superclass: tagged as connector) + + + + Priority of the thread. The interpretation of the value is OS specific. In case of POSIX; priorities are only taken into accound for threads with a FIFO and round-robin scheduliung policy. + + + + + + + + + + + + + + + + + + + C/C++ + ((Thread*) arg)->rLC->activate(); +return NULL; + + + + C/C++ + // create thread +pthread_t pt; +pthread_create (&pt, NULL, staticAct, (void *) this); + +// set priority of thread +struct sched_param schedParam; +schedParam.sched_priority = priority; +pthread_setschedparam (pt, SCHED_RR, &schedParam); +// TODO: check return code (in particular, SCHED_RR only works for root) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + events[0] = event; +m_size = 1; +m_cond.signal(); + + + + C/C++ + return m_size; + + + C/C++ + OS_AL::Time::TimeVal wakeup = OS_AL::Time::TimeVal::current(); +wakeup += timeout; +int retCode = m_cond.waitUpto (wakeup); +if (retCode == ETIMEDOUT) { + CallEvent_ event; + event.operationID = ID_TIMEOUT; + return event; +} +m_size = 0; +return events[0]; + + + C/C++ + m_cond.lock(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <<TextualRepresentation>>public abstract writeEvent (in event:BasicCalls::ContainerServices::Event) ; + + + + + + + + + + + + + + + + + + <<TextualRepresentation>>public abstract size () : BasicCalls::Long ; + + + + + + + + + + + + <<TextualRepresentation>>public abstract readEvent(in timeout : BasicCalls::Long) : BasicCalls::ContainerServices::Event ; + + + + + + + + + + + + + + + + + + The period length of the perdioci timer in ticks. Currently, a tick corresponds to 1 ms (simulation time in the underlying OS abstraction layer). It is planned to support VSL expressions, i.e. a value/unit pair. + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + OS_AL::Time::Timer timer; +OS_AL::Time::TimeVal time = OS_AL::Time::TimeVal::current(); +OS_AL::Time::TimeVal period(periodLength); +for (;;) { + tick->tick(); + time += period; + timer.wakeUp(time); +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This rule adds an interceptor for the lifecycle (lc) port. It will use the Thread implementation that executes the activate method in a new thread of a given priority (property of the interceptor implementation) + + + Adds a periodic timer to the container + + + + + + + + + + + + + + + + + + + + + + + + + + + Use for distributed applications + + + + + Use for debugging in general + + + + + Use for tracing. + + + + + + + + + + + + + + + + + + + Elements in this package depend not only on the Interface I (which is a non-owned template parameter taken from the methodCall signature), but also on a class parameter T, which is bound to the component within a container binding. +Be aware that the number of instantiated template packages will be considerably larger compared to a dependency of the interface only + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pthread + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pthread + rt + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.di new file mode 100644 index 00000000000..169236cea8a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.di @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.notation new file mode 100644 index 00000000000..d1c8d75a52d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.notation @@ -0,0 +1,1865 @@ + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.uml new file mode 100644 index 00000000000..9b65b43823d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/fifo.uml @@ -0,0 +1,432 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Implementation stores an attribute (fixed size array) of template data type + + + This is an implementation of a FIFO of a fixed size (20 elements of the data type it carries). + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + if (m_filled > 0) { + int current_pos = m_pull_pos; + + m_pull_pos ++; + m_filled --; + if (m_pull_pos == m_size) { + m_pull_pos = 0; + } + return m_fifo [current_pos]; +} + + + C/C++ + // copy passed parameters ... +if (m_filled < m_size) { + m_fifo [m_push_pos] = data; + m_push_pos ++; + m_filled ++; + if (m_push_pos == m_size) { + m_push_pos = 0; + } +} + + + C/C++ + return (m_filled > 0); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Simple storage of last data that has been received. Unlike FIFO, data can be read several times. + + + This is an implementation of a FIFO of a configurable size (default: 20 elements). + + + + Configuration attribute: the size of the FIFO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + if (m_filled > 0) { + int current_pos = m_pull_pos; + + m_pull_pos ++; + m_filled --; + if (m_pull_pos == m_size) { + m_pull_pos = 0; + } + return m_fifo [current_pos]; +} + + + + + + + C/C++ + // copy passed parameters ... +if (m_filled < m_size) { + m_fifo [m_push_pos] = data; + m_push_pos ++; + m_filled ++; + if (m_push_pos == m_size) { + m_push_pos = 0; + } +} + + + + + + + + C/C++ + return (m_filled > 0); + + + C/C++ + !xtend FIFO.activate + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + return m_data; + + + C/C++ + // copy passed parameter ... +m_data = data; + + + + C/C++ + // only return true, once first data has been received +return true; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + return m_data; + + + C/C++ + // copy passed parameter ... +m_data = data; + + + + C/C++ + // only return true, once first data has been received +return true; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.png new file mode 100644 index 00000000000..74dfe916ca6 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.svg new file mode 100644 index 00000000000..42b2257c295 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/In.svg @@ -0,0 +1,64 @@ + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.png new file mode 100644 index 00000000000..75ba94039ae Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.svg new file mode 100644 index 00000000000..bc6bba9e681 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/InOut.svg @@ -0,0 +1,64 @@ + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.png new file mode 100644 index 00000000000..5fb219bc960 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.svg new file mode 100644 index 00000000000..ef00466fc55 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Out.svg @@ -0,0 +1,58 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.png new file mode 100644 index 00000000000..f84ec4584ea Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.svg new file mode 100644 index 00000000000..3d3f1f8259f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Provided.svg @@ -0,0 +1,105 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.png new file mode 100644 index 00000000000..b89b982bf35 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.svg new file mode 100644 index 00000000000..7572b29a6d6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/ProvidedRequired.svg @@ -0,0 +1,124 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.png new file mode 100644 index 00000000000..81cf72f17b5 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.svg new file mode 100644 index 00000000000..0b555b8f3fc --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/Required.svg @@ -0,0 +1,108 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/In.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/In.png new file mode 100644 index 00000000000..74dfe916ca6 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/In.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/InOut.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/InOut.png new file mode 100644 index 00000000000..75ba94039ae Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/InOut.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Out.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Out.png new file mode 100644 index 00000000000..5fb219bc960 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Out.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Provided.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Provided.png new file mode 100644 index 00000000000..f84ec4584ea Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Provided.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/ProvidedRequired.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/ProvidedRequired.png new file mode 100644 index 00000000000..b89b982bf35 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/ProvidedRequired.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Required.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Required.png new file mode 100644 index 00000000000..81cf72f17b5 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/hires/Required.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/In.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/In.png new file mode 100644 index 00000000000..6a58521116d Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/In.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/InOut.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/InOut.png new file mode 100644 index 00000000000..f054cdefbc2 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/InOut.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Out.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Out.png new file mode 100644 index 00000000000..91c7eef436d Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Out.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Provided.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Provided.png new file mode 100644 index 00000000000..9403c7fc698 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Provided.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/ProvidedRequired.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/ProvidedRequired.png new file mode 100644 index 00000000000..6b26d4fcaf6 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/ProvidedRequired.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Required.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Required.png new file mode 100644 index 00000000000..569d4d982e9 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/lowres/Required.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/port-kinds.png b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/port-kinds.png new file mode 100644 index 00000000000..d96987f2286 Binary files /dev/null and b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/port-kinds.png differ diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/port-kinds.svg b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/port-kinds.svg new file mode 100644 index 00000000000..82afdbab647 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/figs/port-kinds.svg @@ -0,0 +1,551 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +«PortKind» +PullConsumer + + + + +«PortKind» +PushConsumer + + +«PortKind» +PushProducer + + +Data Flow oriented communication: consume passively: provided push +operation is called + + + + + + + + + +Data Flow oriented communication: produce data via pushing these +(calling the required operation) + + + + + + + + + +Data Flow oriented communication: consumer data actively by calling +the required poll operation + + + + + + + + + +In order to support icons, all port kinds are stereotypes, but for Qompass they are classes +stereotyped as "PortKind" + + + + + + + + + +«PortKind» +PushProdPullCons + + + A bidirectional flow port combining a push-producer and a pull +consumer + + + + + + + + + +«Interface» + +Please update derived elements + + + +Dummy interface returned by ports who need +to update derived interfaces (but can only do +so in the context of a transaction). + + + + + + + + + + + + + + + + +interfaceBased + +«PortKind» +ProvideInterface + + +«PortKind» +UseInterface + + +«PortKind» +AMIpoll + + +«PortKind» +AMIcallback + + +Simple provision of typing interface as provided interface + + + + + + + + + +Simple provision of typing interface as required interface + + + + + + + + + +CORBA asynchronous messaging (AMI): Provision of poller variant of +typing interface. Allows client to continue without waiting for the result + + + + + + + + + +CORBA asynchronous messaging (AMI): Provision of callback variant of +typing interface. Allows client Allows client to continue without waiting +for the result + + + + + + + + + +«Interface» + +I + + + +I: Interface + + + + + + + +use + + + + + + + + + + + + + + + + + + + + + +use + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.di new file mode 100644 index 00000000000..a91f94ef62c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.di @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.notation new file mode 100644 index 00000000000..8686e2eff0d --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.notation @@ -0,0 +1,7725 @@ + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      +
      +
      +
      + + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.uml new file mode 100644 index 00000000000..f5f50bfcf69 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/osal.uml @@ -0,0 +1,11645 @@ + + + + + + + + + + + + Declared in MessageBuffer.h, +but outside of the class Section + + + + The message buffer is used to store different data types that can be +added to (read from) the buffer by means of overloaded << (>>) operators. + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + m_data_start = m_buffer; + + + + + + + + C/C++ + return (m_reader_ptr - m_data_start); + + + + + + + + C/C++ + return (m_writer_ptr - m_data_start); + + + C/C++ + m_reader_ptr = m_data_start; + + + C/C++ + m_writer_ptr = m_data_start; + + + C/C++ + resetReader (); + resetWriter (); + + + + C/C++ + m_data_start = m_buffer; + reset (); + + + + + + + + C/C++ + memcpy (m_buffer, msgBuf.m_buffer, MAX_MESSAGE_SIZE); + // m_data_start is modified by a subclass, thus, we cannot simply + // reset m_data_start to m_buffer + m_data_start = m_buffer + (msgBuf.m_data_start - msgBuf.m_buffer); + m_reader_ptr = m_buffer + (msgBuf.m_reader_ptr - msgBuf.m_buffer); + m_writer_ptr = m_buffer + (msgBuf.m_writer_ptr - msgBuf.m_buffer); + + + + + + + + + + + + + + C/C++ + if (m_writer_ptr + size > m_buffer + MAX_MESSAGE_SIZE) { + OSAL_ERROR("Message buffer too small"); + } + memcpy (m_writer_ptr, ptr, size); + // keep alignment of pointers + m_writer_ptr += (size + MB_ALIGNMENT - 1) & (- MB_ALIGNMENT); + + + + + + + + + + + + + + C/C++ + if (m_reader_ptr + size > m_buffer + MAX_MESSAGE_SIZE) { + OSAL_ERROR("read past end of buffer"); + } + memcpy (ptr, m_reader_ptr, size); + m_reader_ptr += (size + MB_ALIGNMENT - 1) & (- MB_ALIGNMENT); + + + + + + + + + + + + + + + + C/C++ + msg.addToBuffer( &bstr.nbytes, sizeof (size_t)); +msg.addToBuffer( bstr.charTable, bstr.nbytes+1); +return msg; + + + + + + + + + + + + + + + + C/C++ + unsigned int length; +msg.getFromBuffer (&length, sizeof (size_t)); +if (length < bstr.charTableSize) { + msg.getFromBuffer (bstr.charTable, length+1); + bstr.nbytes = length; + bstr.current = bstr.charTable; +} +return msg; + + + + + Copy constructor for a message buffer. Needed to adjust + read and write pointers after copying + + + + + + + + + + Reset the reader pointer into the message buffer + + + + + Reset the writer pointer into the message buffer + + + + + Reset the reader and writer pointer into the message buffer + + + + + + + + + + + + + + + + + + + Method used to add a value to the buffer. Don't use this + method but the overloaded << operator. + + + + + + + + + + + + + + + Method used retrieve a value from the buffer. Don't use this + method but the overloaded >> operator. + + + + + + + + + + + + + + + This constructor is there fore efficiency reasons: it does not + initialize the reader and writer pointers. It is used by subclasses + that modify the data_start and therefore need to invoke reset + afterwards. Thus, it prevents that reset is called multiple times. + + + + + + + + + declare specific marshalling operators for BString, since +(1) this is more efficient +(2) a memory copy based marshalling would copy pointers that become + bogus in a different address space. + + + + + + + + + + + + + + + + + + + + + + + + + + + A Message Header that is prefixed to all messages + + + + + + + + + + + + + + + + + + + + + + + + + This subtype of MessageBuffer adds a MessageHeader at the beginning. +For the sake of efficiency, the storage of the header is mapped directly +into the buffer (works only for homogeneous architectures). + + + + + + + + C/C++ + return (MessageHeader *) m_buffer; + + + + + + + + C/C++ + getHeader ()->msgType = msgType; + + + + + + + + C/C++ + return (getHeader ()->sender == ProDesc::getZoneNumber ()); + + + C/C++ + m_data_start += sizeof (MessageHeader); + reset (); + + + + + + + + C/C++ + m_data_start += sizeof (MessageHeader); + + + + + + + C/C++ + + + + C/C++ + getHeader ()->sender = ProDesc::getZoneNumber (); + + + + + define a copy constructor (which does nothing besides calling the + copy constructor of the super class) + + + + + + + + + needs to be called for each allocated instance. The initialization of + the zone number has been removed from the constructor, since the zone + number is not defined at compile time [todo: would that be a good + idea?] and its initialization would not work for statically declared + messages. + initZoneNumber is called by Message's init function. + + + + + set the message type (see MsgType constant definition in + ToChannel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + start of the shared memory section + + + + + + + + start for user data within the shared memory section (after Mutex) + + + + + + + + current address for new allocations + + + + + + + + + + + + C/C++ + return m_address0; + + + + + + + C/C++ + return &m_name; + + + + + + + C/C++ + return m_mutex; + + + + + + + + C/C++ + return m_key; + + + + + + + + C/C++ + return m_id; + + + + + + + + C/C++ + return shmSize; + + + + + + + + C/C++ + shmSize = cr_operand; + + + C/C++ + set_shmSize (-1); + // constructor without args is useful e.g. for use as element of an array + + + + + + + + + + + + + + + + + + + + + + + C/C++ + set_shmSize (-1); + + int r; + +#ifdef SYNCHRO_VxWorks + r = openIntern (char1, 0, 0, size, synchro); +#else + r = openIntern (char1, O_RDWR | O_CREAT, 0777, size, synchro); +#endif + if (r == -1) + OSAL_ERROR ("ON open(O_RDWR | O_CREAT, ...)"); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + int r; + + m_name = name; +#ifdef SYNCHRO_VxWorks + r = openIntern (char1, 0, 0, size, synchro); +#else + r = openIntern (char1, O_RDWR | O_CREAT, 0777, size, synchro); +#endif + + return r; + + + + + + + + + + + + + + C/C++ + void * r; + + r = (void *) m_address; + char * newAddr; + + newAddr = m_address + itemSize; + if (newAddr - m_address0 > shmSize) + { + BString500 s1 ("allocation fails: shared memory '"); + OSAL_ERROR (s1 << m_name.data () + << "' : shmSize= " << shmSize << " is too small"); + } + + m_address = newAddr; + + return r; + + + + + + + + + C/C++ + int r = 0; + +#if defined SYNCHRO_Linux + //cout<<"SHM name : "<<m_name.data()<<endl; + r = shm_unlink (m_name.data ()); + //if(r == -1) + // PRINTerr("ON shm_unlink"); + +#elif defined SYNCHRO_Solaris || defined SYNCHRO_Cygwin + if (m_id != -1) + { + r = shmdt (m_address00); // detach + if (r == -1) + PRINTerr ("ON shmdt (m_address)"); + else + { + struct shmid_ds semStat; + r = shmctl (m_id, IPC_STAT, &semStat); + if (r == -1) + PRINTerr ("ON shmctl(m_id, IPC_STAT, )"); + else if (semStat.shm_nattch == 0) + { /**** Only for the last process coming here ****/ + r = shmctl (m_id, IPC_RMID, NULL); + if (r == -1) + PRINTerr ("ON shmctl( ,IPC_RMID, )"); + //essai DS 7/11/02 pour virer les fichiers *.shmKey + //mais n'a pas l'air de marcher en Solaris 2.7 + // et gnu + //::unlink(m_name.data()); // remove the file system entry, + // BUT so, 'key' would not be const + } + } + } +#endif + + return r; + + + + C/C++ + if (m_mutex != NULL) { + delete m_mutex; + } + unlink (); + + + + + + + + + + + + + + + + + + + C/C++ + if (creator) + { + /**** Only for the 1st process coming here ****/ + // 4-- check if shared memory is filled with 0 + for (int i = 0; i < size; ++i) +#ifndef SYNCHRO_VxWorks + if (m_address00[i]) + { + BString500 s1 ("shm zone not clean. DO : ipcrm -M "); + OSAL_ERROR (s1 << (long) m_key); + } +#else + m_address00[i] = '\0'; +#endif + // 5- If access synchronisation is wanted, use of a shared mutex + if (synchro) + { + // a mutex needs to be allocated in shared memory + // and initialised once + m_mutex = new (allocate (sizeof (SM_Mutex))) SM_Mutex (); + m_address0 = m_address; // Hide this first item + } + } + else + { + /**** for next processes : allocate, but not initialize ****/ + // we need a semaphore to block up to the end of the + // zone memory initialuzation + // 5- If access synchronisation is wanted, use of a shared m_mutex + if (synchro) + { + // a mutex needs to be allocated in shared memory + m_mutex = (SM_Mutex *) allocate (sizeof (SM_Mutex)); + m_address0 = m_address; // Hide this first item + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + TRACEpr (VM); + PR (showI); + + int r = 0; + + shmSize = size; // required size + if (synchro) + size += sizeof (SM_Mutex); // useful size + +//============================================================ +#if defined SYNCHRO_Linux + // creation of a new segment + r = m_id = shm_open (m_name.data (), oflag, 00777); + if (m_id == -1) + { + OSAL_ERROR ("ON shm_open"); + } + // the returned id is a file descriptor. Thus, the size of the + // memory identified by the descriptor can be set via ftruncate + if (ftruncate (m_id, size) == -1) + OSAL_ERROR ("ON ftruncate"); + // mapping memory + m_address00 = + (char *) mmap (0, size, PROT_READ | PROT_WRITE, MAP_SHARED, m_id, 0); + + if (m_address00 == MAP_FAILED) + OSAL_ERROR ("ON mmap"); + // creation of a mutex at the address m_address00 + m_mutex = (SM_Mutex *) m_address00; + // address0 : adress of the start of the available segment + m_address0 = m_address00 + sizeof (SM_Mutex); + //address : current adress + m_address = m_address0; + +//============================================================ + +#elif SYNCHRO_VxWorks + + // 'm_name' specified a physical address visiable for the CPU + /* currently not used + long memPart; // memory partition + m_name.setBase (16); + m_name >> memPart; + */ + + #ifdef MultiCPU // for multi CPU, with optional VxMP component + //--- See VxWorks5.3.1 Programmer's Guide, Example 6-3 ------- + // [todo the system partition is preallocated, but where du we see + // the generation of the kernel? sysMemTop()?] + { + SEM_ID localSemId; + typedef struct shared_buff + { + SEM_ID semSmId; + char buff[]; // [size CHUNK_SIZE ?] + } SHARED_BUFF; + SHARED_BUFF *laOfAlSMB; // local address of shared memory block + SHARED_BUFF *gaOfAlSMB; // global address of shared Memory block + int objType; + + // is this the first demand of the 'shared memory block' of the + // system partition? + r = smNameFind (m_name.data (), (void **) &gaOfAlSMB, &objType, + WAIT_FOREVER); + if (r == -1 && errno != S_smNameLib_NAME_NOT_FOUND) + OSAL_ERROR ("ON smNameFind()"); + if (r == OK) + { + // CREATION + laOfAlSMB = (SHARED_BUFF *) smMemMalloc (size); + if (laOfAlSMB == NULL) + OSAL_ERROR ("ON smMemMalloc()"); + m_address = m_address0 = m_address00 = laOfAlSMB; + + if (synchro) + { + localSemId = semBSmCreate (SEM_QFIFO, SEM_EMPTY); + if (localSemId == NULL) + OSAL_ERROR ("ON semBSmCreate()"); + laOfAlSMB->semSmId = (SEM_ID) htonl ((int) localSemId); + } + + r = (char *) smNameAdd (m_name.data (), + (void *) smObjLocalToGlobal (laOfAlSMB), + T_SM_BLOCK); + if (r == -1) + OSAL_ERROR ("ON smNameAdd()"); + + if (synchro) + { + r = semGive (localSemId); + if (r == -1) + OSAL_ERROR ("ON semGive()"); + } + init1 (TRUE, synchro, size); + } + else + { + // RE-UTILISATION + laOfAlSMB = (SHARED_BUFF *) smObjGlobalToLocal (gaOfAlSMB); + m_address = m_address0 = m_address00 = laOfAlSMB; + localSemId = (SEM_ID) ntohl ((int) laOfAlSMB->semSmId); + if (synchro) + { + r = semTake (localSemId, WAIT_FOREVER); + if (r == -1) + OSAL_ERROR ("ON semTake()"); + } + } + // --------------------------------------------------------------- + } + #else // monoCPU + #ifdef OutOfHeap + id = (int) memPartCreate (m_address00, size); + if (id == NULL) + OSAL_ERROR ("ON memPartCreate()"); + m_address00 = memPartAlloc (m_id, size /* -?? */ ); + if (m_address00 == NULL) + OSAL_ERROR ("ON memPartAlloc()"); + #else + m_address00 = new char[size]; + #endif + m_address = m_address0 = m_address00; + init1 (TRUE, synchro, size); // 1 seul process (createur) + #endif + + // ============================================================ + +#elif defined SYNCHRO_Solaris || defined SYNCHRO_Cygwin + m_name << ".shmKey"; // add a suffix to recognize it with Ipcrm + + // 1- Get the key from the name ---------------------------------------- + + // #define GET_KEY 1 //--- version proposed by SUN, BUT + // the key returned by ftok() is: 0xCHMMMINO + // CH is the character char1 + // INO is the inodenumber of the file & 0xFFF + // MMM is the minor unit number of the file system, but if the file + // system is mounted via NFS, it is not guaranted to find the + // same minor number after a reboot which prevents us to conserve + // this number within a script for its destruction +// #define GET_KEY 2 //--- version perso +#define GET_KEY 1 +#if GET_KEY == 1 + while (m_key == -1) + { + m_key = ftok (m_name.data (), char1); + if (m_key == -1) + { + int fd =::creat (m_name.data (), 00777); + if (fd == -1) + { + BString500 s1 ("ON ::creat('"); + OSAL_ERROR (s1 << m_name << "', 00777)"); + } + close (fd); + } + } +#else // GET_KEY == 2 + int fd =::creat (m_name.data (), 00777); + if (fd == -1) + { + BString500 s1 ("ON ::creat('"); + OSAL_ERROR (s1 << m_name.data () << "', 00777)"); + } + struct stat st; + if (fstat (fd, &st) == -1) { + OSAL_ERROR ("ON fstat(fd, &st)"); + } + + // inode number is unique inside a filesystem + m_key = (st.st_ino + classKey) & 0xFFFFFF; + // (st_ino,st_dev) uniquely identifies regular files + // but ino_t and dev_t are of type ulong_t: too large for a m_key ! + + m_key |= ((char1 & 0xFF) << 24); + // m_key = 0xCHINODEI does not guarantee uniqueness for the same inode on + // two file systems + // but ftok() guarantees less (+ dependency de mount NFS ...) + close (fd); + +#endif //--- GET_KEY + +#define ATT_SHM 2 + // 1 shmget(IPC_CREAT | IPC_EXCL): in case of no error + // it is for the creator, who makes initializations + // although it is not the first attached. + + // 2- Get the shared memory identifier --------------------------------- + +#if ATT_SHM == 1 + r = m_id = shmget (m_key, size, 00777 | IPC_CREAT); + if (r == -1) + OSAL_ERROR ("ON shmget(m_key, size, 00777 | IPC_CREAT)"); + + // 3 - Attach the shared memory to an address in the calling + // address-space (zone) + m_address = m_address0 = m_address00 = (char *) shmat (m_id, 0, 0); + if ((int) m_address0 == -1) + OSAL_ERROR ("ON shmat(m_id, )"); + + { + // CriticalSection. Who is taking it? + struct shmid_ds stat; + r = shmctl (m_id, IPC_STAT, &stat); + if (r == -1) + OSAL_ERROR ("ON shmctl(shmId, IPC_STAT, )"); + init1 (stat.shm_nattch < 2, synchro, size); + } + +#else // ATT_SHM == 2 -------------------------------------------------- + bool creator; + errno = 0; + r = m_id = shmget (m_key, size, 00777 | IPC_CREAT | IPC_EXCL); + if (r == -1) + { + if (errno == EEXIST) + { + r = m_id = shmget (m_key, size, 0); + // we know we are not the creator (first who demands) of the zone + creator = FALSE; + if (r == -1) + OSAL_ERROR ("ON shmget(m_key, size, 0)"); + } + else + OSAL_ERROR ("ON shmget(m_key, size, IPC_CREAT | IPC_EXCL)"); + } + else + { + // For the creator of this shared memory: + creator = TRUE; + } + + // 3 - Attach the shared memory to an address in the calling + // address-space (zone) + m_address = m_address0 = m_address00 = (char *) shmat (m_id, 0, 0); + if ((int) m_address0 == -1) + OSAL_ERROR ("ON shmat(m_id, )"); + + init1 (creator, synchro, size); +#endif // ATT_SHM + +#endif // SYNCHRO_Solaris || SYNCHRO_Cygwin + // ============================================================ + + PR ("for " << m_name << " , m_key= " << (long) m_key + << ", required size= " << shmSize << ", effective size= " + << size << showI + << ", adr00 = " << (void *) m_address00 + << ", adr0 = " << (void *) m_address0 + << ", adr = " << (void *) m_address << showI); + + return r; + + + + + + create a new shared memory segment. The constructor will call the + method open. See open for a description of the parameters. + + + + + + + + + + + + + + + + + + + + + + + + + + The passed name is a path name (which must refer to an existing, + accessible file). Together with the least significant 8 bits of + char1 (which must be nonzero) a key for the access is generated. + + oflag is not used. + + If synchro is TRUE, an instance of class SM_Mutex is place at the + begin of the segment, increasing its size. The first process + establishing a connection that to ensure that the segment is + initialized with zeros. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + return the segment address (if existent) of the current process + This address is might not be the same for all processes, but all + addresses point to the same place. + + + + + + + + + + + + + + + + Returns the address of an element of size itemSize. If the sequence + of successive allocate calls is the same for all communicating + processes, they share the same view of the segment organization. + If there is not enough space for the item, the process is stopped + with an error message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dependency is problematic, since pthread is not used by all OS + + + + Abstraction of an operating system thread. It is possible to control +priorities and the thread's lifecycle (suspend/resume/exit). + +\code +Example: + +class Run { +void run (); +static void run_fct (void * arg); +} + +void Run::run_fct (void * arg) +{ +((Run*) myThreadCode)->run (); +} + +void Run::run () +{ +// do something ... +} + +Thread myThread ("MyThread"); +myThread.exec (myThreadCode); +\endcode + + + + + + + + + + + + + + A thread also has a name that should be provided by the constructor +It is primarily used to enhance the readability of the trace output. + + + + + + + The semaphore is used for different purposes in vxWorks and +Linux/Solaris, respectively. + + + + + + + + + + + + + + + + + + + + in case, of a joinable thread, this attribute indicates whether the +thread has already been joined. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + return m_threadAttributes; + + + + + + + + C/C++ + return m_threadAttributes.getDetached (); + + + + + + + C/C++ + m_name = name; + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + TRACEpr (VM); + PR ("Thread::Thread (...)" << showI); + + if (attrPtr != NULL) { + m_threadAttributes = *attrPtr; + } + int r = exec (startRoutine, arg, exPrio); + + if (r < 0) { + OSAL_ERROR ("could not exec thread"); + } + + set_of_threads.append (this); + + + + + + + + + + + + C/C++ + if (attrPtr != NULL) { + m_threadAttributes = *attrPtr; + } + + set_of_threads.append (this); + + + + C/C++ + TRACEpr (VM); + PR ("Thread::~Thread () : isDetached () = " << isDetached () + << ", m_joined= " << m_joined << showI); + + if (!isDetached () && !m_joined) { + // don't join, if thread hasn't been executed yet. + if (m_threadId != 0) { + PR ("really delete thread, m_threadId: " << m_threadId << showI); + join (); + } + } + set_of_threads.eraseValue (this); + + + + C/C++ + TRACEpr (VM); + PR ("Thread::initZ ()" << showI); + +#if defined THREAD_VxWorks + bool stackFill = ProDesc::isEnvTrue ("A_StackFill"); + m_vx_options = VX_FP_TASK | (stackFill ? 0 : VX_NO_STACK_FILL); +#elif defined THREAD_Linux || defined THREAD_POSIX4 + m_suspendPriority = 1; // lowest priority for SCHED_RR/SCHED_FIFO +#endif + + + + + + + + + + + + + + C/C++ + // blocked by default +modifySigMask (SIG_BLOCK, SIGRTMIN); +((Thread*) arg)->entryRoutine (); + + + + + + + + C/C++ + #if defined THREAD_POSIX4 + return pthread_self (); + +#elif defined THREAD_Solaris + return thr_self (); + +#elif defined THREAD_VxWorks //-VxW + return taskIdSelf (); +#endif + + + + + + + + C/C++ + ThreadId id = getId (); + for (int i = 0; i < set_of_threads.size (); i++) { + if (set_of_threads.get(i)->m_threadId == id) { + return set_of_threads.get(i)->m_name; + } + } + return threadName_main; + + + + + + + + + C/C++ + TRACEpr (VM); + PR ("Thread::getPriority ()" << showI); + + int priority; + +#if defined THREAD_POSIX4 + SchedParam schedParam; + int policy; + if (pthread_getschedparam (getId (), &policy, &schedParam)) { + OSAL_ERROR ("ON pthread_getschedparam(...)"); + } + priority = schedParam.sched_priority; + +#elif defined THREAD_Solaris + + // errno= thr_getprio(thr_self(), &pri); + // if (errno) OSAL_ERROR("ON thr_getprio()"); + + pcparms_t params; + params.pc_cid = PC_CLNULL; + long l; + l = priocntl (P_LWPID, _lwp_self (), PC_GETPARMS, (caddr_t) & params); + if (l == -1L) + OSAL_ERROR ("ON priocntl( , PC_GETPARMS, )"); + + rtparms_t *rtParms = (rtparms_t *) params.pc_clparms; + prio = rtParms->rt_pri; + +#elif defined THREAD_VxWorks + if (taskPriorityGet (taskIdSelf (), &prio)) //-VxW + OSAL_ERROR ("ON taskPriorityGet()"); +#endif + + return priority; + + + + + + + + + C/C++ + TRACEpr (VM); + PR ("Thread::setPriority (" << prio << "), old prio: " + << getPriority () << showI); + +#if defined THREAD_POSIX4 + SchedParam schedParam; + schedParam.sched_priority = prio; + + if (pthread_setschedparam (getId (), m_policy, &schedParam)) { + OSAL_ERROR ("ON pthread_setschedparam (...)"); + } + +#elif defined THREAD_Solaris + pcparms_t params; + params.pc_cid = ProDesc::_classId (); + long l; + + rtparms_t *rtParms = (rtparms_t *) params.pc_clparms; + rtParms->rt_pri = prio; + rtParms->rt_tqsecs = 0; + rtParms->rt_tqnsecs = RT_NOCHANGE; + l = priocntl (P_LWPID, _lwp_self (), PC_SETPARMS, (caddr_t) & params); + if (l == -1L) + { + BString500 tmp ("to pri= "); + tmp << prio << ", ON priocntl( , PC_SETPARMS, )"; + OSAL_ERROR (tmp); + } + +#elif defined THREAD_VxWorks + if (taskPrioritySet (taskIdSelf (), prio)) //-VxW + OSAL_ERROR ("ON taskPrioritySet()"); +#endif + PR (" after setting, prio= " << getPriority () << showI); + + + + + + + + + C/C++ + return ProDesc::getPrioMax (); + + + + + + + + + + + + + + + + C/C++ + TRACEpr (VM); + PR ("Thread::changeSigMask (...)" << showI); + +#if defined THREAD_POSIX4 || defined THREAD_Linux + errno = pthread_sigmask (how, newSet, oldSet); + if (errno) { + OSAL_ERROR ("ON pthread_sigmask()"); + } +#elif defined THREAD_Solaris + errno = thr_sigsetmask (how, newSet, oldSet); + if (errno) { + OSAL_ERROR ("ON thr_sigsetmask()"); + } +#elif defined THREAD_VxWorks + if (sigprocmask (how, newSet, oldSet)) { //-VxW + OSAL_ERROR ("ON sigprocmask()"); + } +#endif + + + + + + + + + + + + + + C/C++ + sigset_t sigSet; + if (sigemptyset (&sigSet) == -1) { + OSAL_ERROR ("ON sigemptyset( )"); + } + if (sigaddset (&sigSet, signalID) == -1) { // add 'sig' as a signal + OSAL_ERROR ("ON sigaddset( )"); + } + + Thread::changeSigMask (how, &sigSet, NULL); // modify signal mask + + + + C/C++ + sigset_t sigSet; + changeSigMask (SIG_UNBLOCK, NULL, &sigSet); // get current signal mask + + PRINTpr ("signals to block for current thread "); + PR (" : \n\t\t"); + + for (int s = 1; s < SIGRTMAX; ++s) { + if (sigismember (&sigSet, s)) + { +#ifdef SYSTEM_VxWorks + PR (s << ", "); +#else + PR (strsignal (s) << ", "); +#endif + } + } + + PR (showI); + + + + + + + + + C/C++ + TRACEpr (VM); + PR ("Thread::exit ()" << showI); + +#if defined THREAD_POSIX4 || defined THREAD_Linux + throw ("Thread::exit() : throw()"); // an attempt for exception catching + pthread_exit (status); + +#elif defined THREAD_Solaris + throw ("Thread::exit() : throw()"); // an attempt for exception catching + thr_exit (status); + +#elif defined THREAD_VxWorks + // throw("Thread::exit(): throw()"); => 'use -fhandle-exceptions to enable' + // but VxWorks does not support C/C++ exceptions + int code = status ? *(int *) status : 0; + ::exit (code); +#endif + + + + + + + + + + + + + + + + + + + + + + + C/C++ + // NEW 3/01 : added argument execPrio +m_startRoutine = startRoutine; // save pointer for entryRoutine +m_startArg = arg; // save pointer for entryRoutine +m_execPrio = execPrio; // demanded priority + +m_threadAttributes.getDetached (); + +#if defined THREAD_POSIX4 + + pthread_attr_t attributes; + pthread_attr_init (&attributes); + pthread_attr_setdetachstate (&attributes, + (isDetached () ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE)); + if (m_threadAttributes.getStackAddr () != NULL) { +#ifdef THREAD_LINUX + pthread_attr_setstack (&attributes, + m_threadAttributes.getStackAddr (), + m_threadAttributes.getStackSize ()); +#endif + } + else if (m_threadAttributes.getStackSize () != 0) { + pthread_attr_setstacksize (&attributes, + m_threadAttributes.getStackSize ()); + } + + if (execPrio != DefaultExecPrio) { + if (m_RTthreads) { + pthread_attr_setinheritsched (&attributes, PTHREAD_EXPLICIT_SCHED); + } + pthread_attr_setschedpolicy (&attributes, m_policy); + sched_param sp; + sp.sched_priority = execPrio; + pthread_attr_setschedparam (&attributes, &sp); + } + + errno = pthread_create (&m_threadId, &attributes, + entryRoutC, (void *) this); // , startRoutine, arg + +#elif defined THREAD_Solaris + long flags = THR_BOUND; // THR_NEW_LWP leads to SIGLWP; + if (ProDesc::existEnv ("A_ThreadFlags")) + { + OS_AL::Util::BString500 s (ProDesc::getEnv ("A_ThreadFlags")); + if (s == "THR_BOUND") + flags = THR_BOUND; + else if (s == "THR_NEW_LWP") + flags = THR_NEW_LWP; + else + OSAL_ERROR + ("Recognised values for A_ThreadFlags : THR_BOUND, THR_NEW_LWP."); + } + if (isDetached ()) { + flags |= THR_DETACHED; + } + errno = thr_create ( + m_threadAttributes.getStackAddr (), + m_threadAttributes.getStackSize (), + (PfAvpRvp) entryRoutC, (void *) this, // , startRoutine, arg + flags, &thrId); + +#elif defined THREAD_VxWorks + if (execPrio == DefaultExecPrio) + { + // priority of this tasks inherits by current tasks + if (taskPriorityGet (taskIdSelf (), &m_execPrio)) //-VxW + PRINTerr ("ON taskPriorityGet()"); + } + m_threadId = + taskSpawn (NULL, m_execPrio, m_vx_options, + (int) m_threadAttributes.getStackSize (), + (FUNCPTR) entryRoutC, (int) this, 0, 0, 0, 0, 0, 0, 0, 0, 0); + if (m_threadId != -1) + errno = 0; // OK + +#endif + if ((errno && (errno != EINTR))) { + if (errno == EPERM) { + OS_AL::Util::Print warning; + warning << "warning: insufficient permission to create rt-thread (must be root)" << showI; + if (m_RTthreads) + { + warning << "falling back to non-rt threads" << showI; + m_RTthreads = false; + // retry exec + // use "return" to avoid that semaphore wait is executed twice + return exec (startRoutine, arg, execPrio); + } + } + else { + OSAL_ERROR (OS_AL::Util::BString50 ("thread_create() failed with code ") << errno); + } + } + +#if defined THREAD_POSIX4 || THREAD_Linux || THREAD_Solaris + // No error on thread_create... continue + m_semaphore.wait(); + +#endif +TRACEpr (VM); +PR ("return." << showI); +return errno; + + + + C/C++ + #if defined THREAD_Solaris + lwpId = _lwp_self (); +#endif +#if !defined THREAD_VxWorks // else done in taskSpawn () + // synchronization to force the system to start this thread + // [todo: necessary?] + m_semaphore.post (); +#endif + +m_startRoutine (m_startArg); // go to user function + +#ifdef THREAD_VxWorks + if (!isDetached ()) + m_semaphore.post (); +#endif + +m_threadId = (pthread_t) ThExecOUT; // quasi completed + + + + + + + + + C/C++ + pthread_t currentId; + +#if defined THREAD_POSIX4 || defined THREAD_Linux + currentId = pthread_self (); + +#elif defined THREAD_Solaris + currentId = thr_self (); + +#elif defined THREAD_VxWorks + currentId = taskIdSelf (); //-VxW +#endif + +return (currentId == m_threadId); + + + + + + + + + + + + + C/C++ + return (otherThread.m_threadId == m_threadId); + + + + + + + + C/C++ + TRACEpr (VM); +PR ("Thread::resume ()" << showI); + +OS_AL::Util::Print pr2; +pr2 << "in resume" << showI; +int r = 0; + +if (m_threadId == 0) + OSAL_ERROR ("call exec() first"); + +if ((int) m_threadId != ThExecOUT) +{ // Execution not completed +#if defined THREAD_POSIX4 + // version that uses priority modification + SchedParam schedParam; + schedParam.sched_priority = m_execPrio; + r = pthread_setschedparam (m_threadId, m_policy, &schedParam); + + if (r && r != ESRCH) { + OS_AL::Util::Print pr; + pr << "Thread::resume: cannot change thread priority. Are you root?" + << showI; + } + +#elif defined THREAD_Solaris + r = thr_continue (m_threadId); + // only ESRCH is possible + +#elif defined THREAD_VxWorks + if (taskResume (m_threadId) == -1) { //-VxW + r = errno; + } + else { + r = 0; + } + +#endif +} +else { + r = 0; // Execution has been completed +} + +return r; + + + + + + + + + C/C++ + TRACEpr (VM); +PR ("Thread::suspend ()" << showI); + +int r = 0; + +if (m_threadId == 0) { + OSAL_ERROR ("Thread::suspend (): call exec() first"); +} +OS_AL::Util::Print pr2; +pr2 << "in suspend" << showI; + +if ((int) m_threadId != ThExecOUT) +{ +#if defined THREAD_POSIX4 || defined THREAD_Linux + // suspend by setting priority to a low value. Only works for root + SchedParam schedParam; + schedParam.sched_priority = m_suspendPriority; + + if (pthread_setschedparam (m_threadId, m_policy, &schedParam) != 0) { + OS_AL::Util::Print pr2; + pr2 << "Thread::suspend: cannot change thread priority. Are you root?" + << showI; + } +#elif defined THREAD_Solaris + // version with real suspension: + r = thr_suspend (m_threadId); + // only ESRCH is possible +#elif defined THREAD_VxWorks + if (taskSuspend (m_threadId) == -1) { //-VxW + r = errno; + } + else { + r = 0; + } +#endif +} +else { + OSAL_ERROR ("Execution has been completed."); +} +return r; + + + + C/C++ + TRACEpr (VM); +PR ("Thread::runBackground ()" << showI); + +OS_AL::Util::Print pr2; +pr2 << "run background" << showI; +if (m_threadId == 0) { + OSAL_ERROR ("Tread::runBackground (): call exec() first"); +} + +if ((int) m_threadId != ThExecOUT) { + int backgroundPriority = 0; // background priority + setPriority (backgroundPriority); +} +else { + OSAL_ERROR ("Execution has been completed."); +} + + + + + + + + + C/C++ + TRACEpr (VM); +PR ("Thread::join (...)" << showI); + +if ((int) m_threadId != ThExecOUT) +{ + int r; + + if (isDetached ()) { + errno = EINVAL; // join is forbiden (and not necessary) + } + else { // attached + if (m_joined) { + errno = EINVAL; // already joined + } + else { +#if defined THREAD_POSIX4 || defined THREAD_Linux + PR ("join thread 1" << showI); + // if (pthread_equal (m_threadId, pthread_self ()) == 0) + { + PR ("join thread 2" << showI); + r = errno = pthread_join (m_threadId, status); + } +#elif defined THREAD_Solaris + errno = 0; + r = errno = thr_join (m_threadId, NULL, status); + +#elif defined THREAD_VxWorks + m_semaphore.wait (); + m_joined = true; +#endif + +#if defined THREAD_POSIX4 || defined THREAD_Linux || defined THREAD_Solaris + if (r == 0) { + m_joined = true; + } +#endif + } + } + if (errno && (errno != ESRCH)) { + OSAL_ERROR ("join of threads failed"); + } +} +// else Execution has been completed. OK. + + + + + + + + + C/C++ + TRACEpr (VM); + PR ("Thread::cancel ()" << showI); + + int r; + + if (m_threadId == 0) + OSAL_ERROR ("call exec() firstly."); + + if ((int) m_threadId != ThExecOUT) + { +#if defined THREAD_POSIX4 || defined THREAD_Linux + // treat as well? setCancelState(), setCancelType(), testCancel(), + // cleanupPush(), cleanupPop() ?? + r = errno = pthread_cancel (m_threadId); +#elif defined THREAD_Solaris + r = errno = thr_kill (m_threadId, CancelThSIG); + +#elif defined THREAD_VxWorks + // use taskSafe() and taskUnsafe() ?? + r = taskDelete (m_threadId); + +#endif + + if (errno) + { + OS_AL::Util::BString500 tmp ("m_threadId= "); + tmp << m_threadId; + OSAL_ERROR (tmp); + } + } + else + r = 0; // Execution has been completed. OK. + + return r; + + + + + create a new thread. The passed parameter @param name is used to +identify the thread in the trace files. + +By default, the Thread will block the SIGRTMIN signal which is +used by class Timer + + + + + + + + + + + + + + + + + + + + + + + + + + + + create a new thread by passing its name and optionally a +pointer to ThreadAttributes. + +By default, the Thread will block the SIGRTMIN signal which is +used by class Timer + + + + + + + + + + C++ + NULL + + + + + + + initialize the suspend priority of threads in this zone +and the suspension mode (static method). This method has to +be called during the application startup. + + + + + This routine wraps the thread execution (static method) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + provides access to the thread attributes (also for modification) + + + + + + + + + denotes whether the thread is detached or joinable + + + + + + + + + + changes the signal mask for the calling thread as described by +the how and newmask arguments. If oldmask is not NULL, the previous +signal mask is stored in the location pointed to by oldmask. + +The meaning of the how and newmask arguments is the same as for +sig-procmask(2). If how is SIG_SETMASK, the signal mask is set to +newmask. +If how is SIG_BLOCK, the signals specified to newmask are added to +the current signal mask. +If how is SIG_UNBLOCK, the signals specified to newmask are removed +from the current signal mask. +Recall that signal masks are set on a per-thread basis, but signal +actions and signal handlers, as set with sigaction(2), are shared +between all threads. + + + + + + + + + + + + + + + + + + similar changeSigMask, used by Main and ServiceRequest classes. +Compared to changeSigMask, it is more convenient to use if a single +signal is modified, since the user does not have to create a set and +add the signal to it. + + + + + + + + + + + + + + + + + + + + + + + This method initiates the execution of a new thread. The new thread +will start the entryRoutine, which acts as a wrapper for the execution +of the passed startRoutine. The parameter arg will be passed to it +(often a "this" pointer, if a static method is passed). + +The last parameter is the Tasks priority. It is optional, if not +given, the priority has a default value. + +Don't confuse this method with the Task::exec which will execute +periodic tasks. + + + + + + + + + + + + + + + + + + + + + + + + + + checks whether the currently executing thread has the same ID as +the one for which this operation is called + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Attributes of a thread, i.e. stack information and whether a thread +is detached (becomes independent from initiator) or joinable (it +can be/has to be explicitly joined by the thread initiator). + +=> see pthread documentation + + + + + + + + + + + + + + + + + + + + + + + C/C++ + return m_stackSize; + + + + + + + + C/C++ + m_stackAddress = stackAddress; + + + + + + + + C/C++ + return m_stackAddress; + + + + + + + + C/C++ + m_detached = detached; + + + + + + + + C/C++ + return m_detached; + + + C/C++ + m_stackAddress = NULL; +#if defined THREAD_POSIX4 || THREAD_Linux + m_stackSize = 0; // use defaults from system +#else + m_stackSize = 0x10000; // default values : 64 Kbytes +#endif + m_detached = true; + + + + + + + + + + + + + + C/C++ + #ifdef THREAD_LINUX + if (stackSize != 0 && stackSize < PTHREAD_STACK_MIN) { +#else + if (stackSize != 0) { +#endif + return -EINVAL; + } + else + { + m_stackSize = stackSize; + return 0; + } + + + + + create a thread with default attributes: +- a stack address chosen by the system +- a stack size of 64K in case of Solaris and vxWorks + or the system default, in case of Linux +- detached + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + return m_argc; + + + + + + + + C/C++ + return m_argv; + + + + + + + + + + + + + C/C++ + return m_argv[pos]; + + + + + + + C/C++ + m_zoneName = zoneName; + + + + + + + C/C++ + return m_zoneName; + + + + + + + + C/C++ + #if defined SYSTEM_POSIX4 + return getpid (); +#elif defined SYSTEM_Solaris + return getpid (); +#elif defined SYSTEM_VxWorks + return Thread::getMyId (); +#else + SYSTEM_x_not_defined; + return -1; +#endif + + + + + + + + + C/C++ + #if defined SYSTEM_POSIX4 + return getppid (); +#elif defined SYSTEM_Solaris + return getppid (); +#elif defined SYSTEM_VxWorks + return -1; +#else + SYSTEM_x_not_defined; + return -1; +#endif + + + + + + + + + C/C++ + return m_pauseOnErr; + + + + + + + + C/C++ + return m_classId; + + + + + + + + C/C++ + return m_numberOfProcesses; + + + + + + + + C/C++ + return m_policy; + + + + + + + + C/C++ + TRACEpr (F9); +m_sigOnErr = errSig; + +m_pauseOnErr = isEnvTrue ("A_PauseOnErr"); +errno = 0; + +if (existEnv ("A_NumberOfProcesses")) +{ + m_numberOfProcesses = atoi (getEnv ("A_NumberOfProcesses")); + if (m_numberOfProcesses < 1) + { + OSAL_ERROR + ("The environment variable 'A_NumberOfProcesses' must be > 0"); + } +} + +#if defined SYSTEM_Solaris + pcparms_t params; + params.pc_cid = PC_CLNULL; // To force update of pc_cid + long l; + l = priocntl (P_PID, getPid (), PC_GETPARMS, (caddr_t) & params); + if (l == -1L) + OSAL_ERROR ("ON priocntl( , PC_GETPARMS, )"); + classId = params.pc_cid; + + pcinfo_t infos; + infos.pc_cid = classId; // Infos about current process + l = priocntl ((idtype_t) 0, (id_t) 0, PC_GETCLINFO, (caddr_t) & infos); + if (l == -1L) + OSAL_ERROR ("ON priocntl( , PC_GETCLINFO, )"); + + m_prioMax = 59; + m_prioMin = 0; + +#else // SYSTEM_POSIX4, SYSTEM_Linux and SYSTEM_VxWorks + + m_policy = sched_getscheduler (getPid ()); + if (m_policy == -1) + OSAL_ERROR ("ON sched_getscheduler(myPid)"); + PR (" Current scheduling policy is "); + PR ((m_policy == SCHED_FIFO ? "SCHED_FIFO" : + (m_policy == SCHED_RR ? "SCHED_RR" : "SCHED_OTHER"))); + + posixPriorityNumbering = true; // for VxWorks, otherwise number inversion + + m_prioMax = sched_get_priority_max (m_policy); + if (m_prioMax == -1) + OSAL_ERROR ("ON sched_get_priority_max()"); + m_prioMin = sched_get_priority_min (m_policy); + if (m_prioMin == -1) + OSAL_ERROR ("ON sched_get_priority_min()"); + +#endif + +PR (", priority mini for a thread =" << m_prioMin); +PR (", priority maxi for a thread =" << m_prioMax << showI); + + + + + + + + + + + + + + C/C++ + bool r = false; +const char *p =::getenv (name); +if (p && *p != '\0') + r = true; + +return r; + + + + + + + + + + + + + + C/C++ + // a call to getenv(3C) is standard UNIX +const char *p =::getenv (name); + +// result is "" if name is not found in environment + +return (p ? p : ""); + + + + + + + + + + + + + + + + + + + C/C++ + int r = 0; // default return value 0 (variable does not exist or empty) + +const char *p = ::getenv (name); +if (p && *p != '\0') +{ + char *pEnd; + r = (int) strtol (p, &pEnd, base); + if (pEnd == p) { + // the variable exists, but is not numeric + OS_AL::Util::BString200 s ("Environment variable '"); + s << name << "' should be integer."; + OSAL_ERROR (s); + } +} + +return r; + + + + + + + + + + + + + + C/C++ + bool r = false; // if variable does not exist +const char *p = ::getenv (name); +if (p) { + char c = *p; + if (c == 't' || c == 'T' || // true or TRUE or True or ... + c == 'y' || c == 'Y') { // yes or YES or Yes or ... + r = true; + } + else if (c == 'f' || c == 'F' || c == 'n' || c == 'N') { + // false is already assigned + } + else { + OS_AL::Util::BString200 str (name); + OSAL_ERROR (str << " is not boolean."); + } +} + +return r; + + + + + + + + + C/C++ + if (m_sigOnErr == 0) { + init (); +} + +return m_numberOfProcesses; + + + + + + + + + + + + + + C/C++ + m_argc = argc; +m_argv = argv; + + + + + + + + + C/C++ + if ((zoneNumber < 0) || (zoneNumber >= m_numberOfProcesses)) { + OSAL_ERROR ("requires : 0 <= number < numberOfProcesses"); +} +m_zoneNumber = zoneNumber; + + + + + + + + C/C++ + if (m_zoneNumber == -1) { + OSAL_ERROR ("zone number not yet assigned"); +} + +return m_zoneNumber; + + + + + + + + C/C++ + if (m_sigOnErr == 0) { + init (); +} + +return m_prioMax; + + + + + + + + C/C++ + if (m_sigOnErr == 0) { + init (); +} + +return m_prioMin; + + + + + + + + C/C++ + int r = 0; + +if (prio < getPrioMin () || prio > getPrioMax ()) +{ + OS_AL::Util::BString200 s ("priority = "); + s << prio << " out of range [" << getPrioMin () + << ", " << getPrioMax () << "]"; + OSAL_ERROR (s); +} + +#ifdef SYSTEM_VxWorks +OSAL_ERROR ("Not available with VxWorks"); //-VxW +// sched_setparam() set a task's priority for VxWorks +// for us, a task is a thread +// VxWorks is mono-process (only 1 address space) +// so inter-process facilities like this one should not be required + +#elif defined SYSTEM_POSIX4 +struct sched_param params; +params.sched_priority = prio; + +r = sched_setparam (0, &params); +if (r == -1) + OSAL_ERROR ("ON sched_setparam()"); + +#elif defined SYSTEM_Linux +if (getPolicy () != SCHED_OTHER) +{ + // SCHED_RR or SCHED_FIFO: use POSIX functions to change static priority + struct sched_param params; + params.sched_priority = prio; + r = sched_setparam (0, &params); + if (r == -1) + OSAL_ERROR ("ON sched_setparam()"); +} +else +{ + // TIME-SHARING + // We have to be super-user to modify the priority +} +#else +if (getPolicy () != SCHED_OTHER) +{ // REAL-TIME + pcparms_t params; + params.pc_cid = classId; + long l; + + rtparms_t *rtParms = (rtparms_t *) params.pc_clparms; + rtParms->rt_pri = pri; + rtParms->rt_tqsecs = 0; + rtParms->rt_tqnsecs = RT_NOCHANGE; + l = priocntl (P_PID, getPid (), PC_SETPARMS, (caddr_t) & params); + if (l == -1L) + OSAL_ERROR ("ON priocntl( , PC_SETPARMS, )"); +} +else { + // TIME-SHARING + // We have to be super-user to modify the priority +} +#endif + + + + + + + + C/C++ + TRACEpr (F9); + +int prio = getMyPriority (); +PR ("old priority = " << prio); + +#ifdef SYSTEM_VxWorks + prio = -1; + OSAL_ERROR ("Not available with VxWorks"); //-VxW + +#elif defined SYSTEM_POSIX4 + setMyPriority (prio - decrement); + +#else + // Linux or other + if (getPolicy () != SCHED_OTHER) + { // REAL-TIME + setMyPriority (prio - decrement); + } + else + { // TIME-SHARING + if (nice (decrement) == -1) + OSAL_ERROR ("ON nice()"); + } + PR (", new = " << getMyPriority() << showI); +#endif + + + + + + + + C/C++ + int prio; + +#if defined SYSTEM_VxWorks + prio = -1; + OSAL_ERROR ("Not available with VxWorks"); //-VxW + +#elif defined SYSTEM_POSIX4 + struct sched_param params; + int r; + + r = sched_getparam (0, &params); + if (r == -1) + OSAL_ERROR ("ON sched_getparam()"); + prio = params.sched_priority; + + +#elif defined SYSTEM_Linux + if (getPolicy () != SCHED_OTHER) + { + // SCHED_RR or SCHED_FIFO: use POSIX functions to get static priority + struct sched_param params; + int r; + + r = sched_getparam (0, &params); + if (r == -1) + OSAL_ERROR ("ON sched_getparam()"); + prio = params.sched_priority; + } + else + { + // SCHED_OTHER: i.e. time-sharing like for Solaris: dynamic priority + errno = 0; + prio = getpriority (PRIO_PROCESS, getPid ()); + if ((prio == -1) && (errno != 0)) + OSAL_ERROR ("ON getpriority()"); + } +#else + pcparms_t params; + params.pc_cid = classId; + long l; + l = priocntl (P_PID, P_MYID, PC_GETPARMS, (caddr_t) & params); + if (l == -1L) + OSAL_ERROR ("ON priocntl( , PC_GETPARMS, )"); + + if (isRealTime ()) + { // REAL-TIME + rtparms_t *rtParms = (rtparms_t *) params.pc_clparms; + prio = rtParms->rt_pri; + } + else + { // TIME-SHARING + tsparms_t *tsParms = (tsparms_t *) params.pc_clparms; + prio = tsParms->ts_upri; + } +#endif + + return prio; + + + + + + + + + + + + + + + + + + C/C++ + OS_AL::Util::BString500 str0 ("error in "); +exitErrP (str0 << file << ":" << line << " : " << str); + + + + + + + + + + + + + + + + + + C/C++ + OS_AL::Util::BString500 str0 ("error in "); +exitErrP (str0 << file << ":" << line << " : " << str); + + + + + + + + C/C++ + if (m_sigOnErr == 0) + init (); + +OS_AL::Util::Print pr1; +pr1 << str << showErr; + +if (errno) + pr1 << " - error code/msg: " << strerror (errno); +errno = 0; + +if (m_pauseOnErr) { + OS_AL::Util::Print pr2; + pr2 << "\n\t pausing due to error!" << showI; + pause (); // or for(;;) for debugger: debug appliX pid +} + +// removed code that sends a signal instead of exiting +// [todo: reason might have been clean-up?] +exit (1); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Provide information about the system, mainly UTS information +(uname), as well as the number of processors, the number of message +queues. +Only partially used. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + return m_cpuNb; + + + + + + + + C/C++ + m_cpuNb = cpuNb; + + + + + + + + C/C++ + return m_mqMax; + + + + + + + + C/C++ + m_mqMax = mqMax; + + + + + + + + C/C++ + return m_semsMax; + + + + + + + + C/C++ + m_semsMax = semsMax; + + + + + + + + C/C++ + return m_hostId; + + + + + + + + C/C++ + return m_hostName; + + + + + + + + C/C++ + return m_machine; + + + + + + + + C/C++ + return m_release; + + + + + + + + C/C++ + return m_sysname; + + + + + + + + C/C++ + return m_version; + + + C/C++ + m_hostName = m_machine = m_release = m_sysname = m_version = ""; + + // ======================================================================= +#if defined SYSTEM_Cygwin + m_cpuNb = 1; // default value + + // Max number of opened MQ + m_mqMax = _SC_MQ_OPEN_MAX; + // Max number of semaphores + m_semsMax = _SC_SEM_NSEMS_MAX; + + // other system infos + m_hostId = gethostid (); + int hostIndex = 0; + +#elif defined SYSTEM_POSIX4 || defined SYSTEM_Linux + m_cpuNb = 1; // default value + + //*** Max number of Message Queues ***// + errno = 0; + m_mqMax = _POSIX_MQ_OPEN_MAX; + + errno = 0; + m_semsMax = _POSIX_SEM_NSEMS_MAX; + + // other system infos + m_hostId = gethostid (); + + // ======================================================================= +#elif defined SYSTEM_Solaris + // Number of configured CPUs + // or? _SC_NPROCESSORS_ONLN (see sysconf(3C) ) + m_cpuNb = sysconf (_SC_NPROCESSORS_CONF); + + //*** Max number of Message Queues ***// + errno = 0; + m_mqMax = sysconf (_SC_OPEN_MAX); // _SC_MQ_OPEN_MAX 'not defined...' + + if (m_mqMax == -1) + OSAL_ERROR ("ON sysconf(_SC_OPEN_MAX)"); + + //*** Max number of Semaphores ***// + /* + semsMax= sysconf(_SC_SEM_NSEMS_MAX); + Extract of sysconf(3C) : If sysconf() fails due to + a value of name that is not defined on the system, the func- + tion will return a value of -1 without changing the value of + errno + */ + + /* in which library is _sysconf() ? + #include <sys/sysconfig.h> + int _sysconf(int); + + semsMax = _sysconf(_CONFIG_SEM_NSEMS_MAX); + if (semsMax == -1) + OSAL_ERROR("ON sysconf(SEM_NSEMS_MAX)"); + */ + m_semsMax = 25; // semget( ) --> EINVAL au dela de 25 + + // ======================================================================= + +#elif defined SYSTEM_VxWorks + m_cpuNb = 1; // default value + + //*** Max number of Message Queues ***// + errno = 0; + m_mqMax = SM_OBJ_MAX_MSG_Q; + + //*** Max number of Semaphores ***// + errno = 0; + m_semsMax = SM_OBJ_MAX_SEM; + + // ======================================================================= +#endif + + +#if defined SYSTEM_Linux || defined SYSTEM_Solaris + struct utsname names; + if (uname (&names) < 0) + OSAL_ERROR ("ON uname( )"); + + m_hostName = names.nodename; + m_sysname = names.sysname; + m_release = names.release; + m_version = names.version; + m_machine = names.machine; +#endif + +#ifdef DEBUG + activateDebugTimer (); +#endif + + + + + + returns the number of CPUs + + + + + + + + + + + + + + + + + returns the number of message queues (useful?) + + + + + + + + + + + + + + + + + returns the number of semaphores + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Provide a context for storing pointers (get/savePtr). +There is currently only one use of this class in SRcompeting (and the +getPtr part is commented out => reconsider whether this class is needed) + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + return key; + + + + + + + + C/C++ + key = cr_operand; + + + + + + + C/C++ + return dataPtr; + + + + + + + C/C++ + dataPtr = cr_operand; + + + C/C++ + set_dataPtr (NULL); + + TRACEpr (VM); + PR (showI); + + if (++instanceNb > 1) + { + OSAL_ERROR ("in ThreadContext::ThreadContext: ++instanceNb > 1"); + } + + // puisque seulement 1 instance , key peut être non 'static' + // et pas de précaution par mutex +#if defined THREAD_POSIX4 + errno = pthread_key_create (&key, NULL); + if (errno) { + OSAL_ERROR ("ON pthread_key_create()"); + } + +#elif defined THREAD_Solaris + errno = thr_keycreate (&key, NULL); + if (errno) { + OSAL_ERROR ("ON thr_keycreate()"); + } + +#elif defined THREAD_VxWorks //-VxW + ; +#endif + + + + + + + + C/C++ + // A utiliser au début du code exécuté par un thread nouveau susceptible + // d'avoir besoin du pointeur (spécifique de ce thread) + // via une variable globale (cf. operateur -> surchargé) + + TRACEpr (VM); + PR (showI); + + dataPtr = ptr; +#if defined THREAD_POSIX4 + errno = pthread_setspecific (key, dataPtr); + if (errno) { + OSAL_ERROR ("ON pthread_setspecific()"); + } + +#elif defined THREAD_Solaris + errno = thr_setspecific (key, dataPtr); + if (errno) { + OSAL_ERROR ("ON thr_setspecific()"); + } + +#elif defined THREAD_VxWorks //-VxW + errno = taskVarAdd (0, (int *) &dataPtr); + if (errno) { + OSAL_ERROR ("ON taskVarAdd()"); + } +#endif + + + + + + + + C/C++ + // useful to allow check : + // if (globalVar.getPtr() ==NULL) // in client side, + // before globalVar->memberOfCLASS + + // Get the thread specific pointer +#if defined THREAD_POSIX4 + dataPtr = (CLASS *) pthread_getspecific (key); + +#elif defined THREAD_Solaris + errno = thr_getspecific (key, (void **) &dataPtr); + if (errno) { + OSAL_ERROR ("ON thr_getspecific()"); + } + +#elif defined THREAD_VxWorks //-VxW + // l'attribut 'dataPtr' doit être restauré par le système + // pour ce thread à chaque fois qu'il est réélu pour la CPU + ; +#endif + + return dataPtr; + + + + + + + + C/C++ + // Overload of -> + // since the unique instance of ThrCtxt<CLASS> is a global variable + // directly accessed (not via a pointer) + // operator-> can't be confused with access to members of ThrCtxt<CLASS> + // globalVar.savePtr(...) + // globalVar->memberOfCLASS // to Access to the thread specific data + + TRACEpr (VM); + PR (showI); + + CLASS *dataP = getPtr (); + + if (dataP == NULL) { + OSAL_ERROR ("lack of previous 'globalVar.savePtr(...)'"); + } + + return dataP; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + must be stereotyped CppFriend ()not availbale for the moment for classes) + + + + The class BOL (Bounded ordered list) is a template class applied to a +certain type element type (ELType). The list consists of cells of type +ListCell<ELType>: the elements are stored by value in each cell. The +element type must have a default constructor. + +The element type has to fulfill two criterions: + - It has to define a comparison relation to enable the insertion of an + element at the right position within the list. It requires the existence + of the operators ElType::operator>= and ElType::operator!= + + - the second criterion rests on the identity of data of two elements, + independently of the value being used for their scheduling. It makes it + possible to compare two elements or to seek an element in the list and to + modify it. It requires l'existence of the method ElType::sameAs() and + possibly of the operator ElType::operator= + +These two criteria can be independent. The super class of BOL, SMO, +redefines the new operator to allows for specifying an address where to +the instance should be located in memory. The class BOL can be used for +any management * of ordered lists according to specified comparison +criterions'. A list of unlimited size has to create and release memory +dynamicylly, which is expensive. Moreover, one list divided between +several processes and established in a shared memory segment of fixed +size must itself be of a limited size that has to be known at creation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + TRACEpr (F7); + + ListCell *cur = beginning, *lstCelPtr = NULL; + for (; cur->next; cur = cur->next) { + if (element.sameAs (cur->next->value)) + { + lstCelPtr = cur; + break; + } + } + PR ("BOL< ElType >::findElement"); + + + return (lstCelPtr); + + + + + + + + + + + + C/C++ + TRACEpr (F7); + PR ("BOL< ElType >::findPrevious"); + + ListCell *cur = beginning; + for (; cur->next && element >= cur->next->value; cur = cur->next); + + return (cur); + + + + + + + + + + + + C/C++ + // Recherche de la place de la cellule dans la liste : + if (!(element >= beginning->value)) // C'est le premier. + { + cellule->next = beginning; + beginning = cellule; + // Il y avait au départ plus d'un élément, + // le dernier et le premier sont donc différents, + // endElement est donc à jour. + } + else if (element >= endElement->value) // Dernier élément + { + endElement->next = cellule; + endElement = cellule; + cellule->next = NULL; + } + else // Autres cas : + { + ListCell *newPrevCel = findPrevious (element); + + // Réinsertion de la cellule : + cellule->next = newPrevCel->next; + newPrevCel->next = cellule; + } + + + + + + + + C/C++ + return current; + + + + + + + C/C++ + current = cr_operand; + + + + + + + C/C++ + return beginning; + + + + + + + C/C++ + beginning = cr_operand; + + + + + + + C/C++ + return endElement; + + + + + + + C/C++ + endElement = cr_operand; + + + + + + + C/C++ + return freeMemory; + + + + + + + C/C++ + freeMemory = cr_operand; + + + + + + + C/C++ + return endOfMemory; + + + + + + + C/C++ + endOfMemory = cr_operand; + + + + + + + C/C++ + return firstFreeCellule; + + + + + + + C/C++ + firstFreeCellule = cr_operand; + + + + + + + + C/C++ + TRACEpr (F7); + PR (" $$$ endOfMemory : " << (void *) endOfMemory); + PR (" - freeMemory : " << (void *) freeMemory); + PR (" = " << (int) endOfMemory - (int) freeMemory << showI); + + + + + + + + + + + + C/C++ + TRACEpr (F7); + ElType *elementPtr = NULL; + + ListCell *newCellule = new (this) ListCell (element); + + PR ("newCellule=" << (void *) newCellule << showI); + + if (newCellule) + { + PR ("beginning=" << (void *) beginning); + PR (", endElement=" << (void *) endElement << showI); + + if (!beginning) + { // Cas liste vide : + current = endElement = beginning = newCellule; + PR (element << " : single element."); + } + else if (!(element >= beginning->value)) + { // Cas élément plus petit que tous les autres (plus petit que le premier) : + newCellule->next = beginning; + beginning = newCellule; + PR (element << " : element stored ahead."); + } + else if (element >= endElement->value) + { // Cas élément plus grand que tous les autres, ou égal au(x) plus grand(s), + // (supérieur ou égal au dernier de la liste): + endElement->next = newCellule; + endElement = newCellule; + PR (element << " : element stored at bottom."); + } + else + { + // Cas général, élément à insérer en milieu de liste: + ListCell *prevCel = findPrevious (element); + PR ("prevCel=" << (void *) prevCel << showI); + newCellule->next = prevCel->next; + prevCel->next = newCellule; + PR (element << " : element stored after : " << prevCel->value); + } + + elementPtr = &(newCellule->value); + } + PR (showI); + + return elementPtr; + + + + + + + + + + + + + C/C++ + TRACEpr (F7); + PR (showI); + bool result = FALSE; + + if (beginning) + { // List not empty. + if (element.sameAs (beginning->value)) + { // Cas où l'élément est le premier de la liste : + ListCell *nextBeginning = beginning->next; + + if (endElement == beginning) + endElement = NULL; + + beginning->free (this); + + current = beginning = nextBeginning; + // Sinon, current risque d'indiquer un élément inexistant ; + + result = TRUE; + } + else + { // Autres cas : + ListCell *prevCel = findElement (element); + + if (prevCel) + { // L'élément est trouvé. + // prevCel->next est toujours non NULL, car c'est + // le précédent. S'il n'y en a pas, c'est soit que la + // liste est vide (beginning == NULL), soit qu'elle n'a + // qu'un élément, c'est alors aussi le premier et c'est + // traité avant ! + ListCell *destroyedCel = prevCel->next; + + if (prevCel->next->next) + prevCel->next = prevCel->next->next; + else // prevCel->next == endElement + { + prevCel->next = NULL; + endElement = prevCel; + } + + if (current == destroyedCel) + current = beginning; + // Sinon, current risque d'indiquer un élément inexistant. + destroyedCel->free (this); + result = TRUE; + } + else + OSAL_ERROR ("Element not found !"); + // ERROR ( "HORREUR, Element inexistant..." ) ; + } + } + else + OSAL_ERROR ("empty list !"); + // ERROR ( "HORREUR, Retrait d'un element dans une liste vide..." ) ; + + return result; + + + + + + + + C/C++ + TRACEpr (F7); + PR (showI); + + ElType *element = NULL; + + if (beginning) + element = &(beginning->value); + else + OSAL_ERROR ("empty list !"); +// ERROR ( "HORREUR, Demande du premier élément d'une liste vide..." ) ; + + return ((element)); + + + + + + + + C/C++ + TRACEpr (F7); + PR (showI); + + ElType *element = NULL; + + if (endElement) + element = &(endElement->value); + else + OSAL_ERROR ("empty list !"); +// ERROR ("HORREUR, Demande du dernier élément d'une liste vide...") ; + + return ((element)); + + + + + + + + C/C++ + TRACEpr (F7); + PR (showI); + + ElType *element = NULL; + + if (beginning) + { + element = &(beginning->value); + current = beginning; + } + else + OSAL_ERROR ("empty list !"); + + return element; + + + + + + + + C/C++ + TRACEpr (F7); + PR (showI); + + ElType *element = NULL; + + if (endElement) + { + element = &(endElement->value); + current = endElement; + } + else { + OSAL_ERROR ("empty list !"); + } + + return element; + + + + + + + + + + + + + C/C++ + TRACEpr (F7); + PR (showI); + + ElType *element = NULL; + + while (current != NULL && (index--) > 0) + { + if (current->next != NULL) + { + element = &(current->next->value); + current = current->next; + } + else { + // current->next == NULL + current = NULL; + } + } + + return element; + + + + + + + + + + + + C/C++ + TRACEpr (F7); + PR (showI); + + ElType *elementPtr = NULL; + + if (beginning) + { // List not empty + if (element.sameAs (beginning->value)) + { // Cas où l'élément est le premier : + elementPtr = &(beginning->value); + + if (element != (*elementPtr)) + { // Sa valeur est différente + beginning->value = element; + if (beginning->next) + { // La liste contient plus d'un élément + if (element >= beginning->next->value) + modifyFirst (element); + // else, on ne modifie pas la place, il reste le premier. + } + // else, la liste n'a qu'un élément, c'est donc le premier. + } + // else, sa valeur est la même que celle qu'on veut mettre, + // on ne fait donc rien. + } + + else { + ListCell *prevCel = findElement (element); + + if (prevCel) + { // L'élément est trouvé + // prevCel->next est toujours non NULL, + // car c'est le "précédent". S'il n'y en a pas, + // c'est soit que la la liste est vide (beginning == NULL), + // soit qu'elle n'a qu'un élément qui est alors aussi le + // premier et cela a été traité avant ! + + elementPtr = &(prevCel->next->value); + + if (element != (*elementPtr)) + { // Valeur différente. + // Mémorisation et mise à jour de la cellule : + ListCell *cellule = prevCel->next; + cellule->value = element; + + // Retrait de la cellule de la liste : + if (cellule == endElement) + endElement = prevCel; + prevCel->next = prevCel->next->next; + + // Recherche de la place de la cellule dans la liste : + modifyCellule (element, cellule); + + + } + // else, sa valeur est la même que celle qu'on veut mettre, + // on ne fait donc rien. + } + else + OSAL_ERROR ("Element not found !"); + } + } + else { + OSAL_ERROR ("empty list !"); + } + + return elementPtr; + + + + + + + + + + + + C/C++ + TRACEpr (F7); + PR (showI); + + ElType *elementPtr = NULL; + + if (beginning) + { // List not empty + if (element.sameAs (beginning->value)) + // This is the first element + elementPtr = &(beginning->value); + else + { + ListCell *prevCel = findElement (element); + + if (prevCel) + elementPtr = &(prevCel->next->value); + //else + // ERROR ( "Element not found !" ) ; + } + } + else { + OSAL_ERROR ("empty list !"); + } + + return elementPtr; + + + + + + + + + C/C++ + TRACEpr (F7); + PR (showI); + + return (beginning ? FALSE : TRUE); + + + + C/C++ + current = beginning; + ListCell *destroyedCel; + while (current) + { + destroyedCel = current; + current = current->next; + destroyedCel->free (this); + } + + current = beginning = endElement = NULL; + + + + + + + + C/C++ + // Retrait de la cellule : + + ListCell *oldBeginning = beginning; + beginning = beginning->next; + + if (element >= endElement->value) + { + // if this element is bigger than the others: + endElement->next = oldBeginning; + endElement = oldBeginning; + oldBeginning->next = NULL; + } + else + { + // general case, element is inserted in the middle + ListCell *prevCel = findPrevious (element); + + oldBeginning->next = prevCel->next; + prevCel->next = oldBeginning; + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + ListCell *allocatedCellule = NULL; + + if (currentList->firstFreeCellule) + { + allocatedCellule = currentList->firstFreeCellule; + currentList->firstFreeCellule = + currentList->firstFreeCellule->next; + } + else if (currentList->freeMemory) + { + allocatedCellule = currentList->freeMemory; + + if (currentList->freeMemory < currentList->endOfMemory) { + currentList->freeMemory++; + } + else if (currentList->freeMemory == currentList->endOfMemory) { + currentList->freeMemory = NULL; + } + else { + OSAL_ERROR ("Bad allocation pointers !"); + } + } + else { + OSAL_ERROR ("Bounded list is full !"); + } + + return allocatedCellule; + + + + + + + + C/C++ + next = currentList->firstFreeCellule; + currentList->firstFreeCellule = this; + + delete this; + + + + + + + + C/C++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + declare the standard new-operator as private, since its invocation +should be replaced by the call to the new operator defined above +(with the additional parameter currentList). +I.e. don't use "new ListCell", use "new (this) ListCell" instead + + + + + + + + + + + + + + + + + A circular buffer - seems to be unused (besides the tests). +[todo:] missing the possibility to delete elements from the buffer + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + + + + + + + + + C/C++ + return (full ? nbElem : current); + + + + + + + + C/C++ + return nbElem; + + + + + + + C/C++ + vector[current++] = el; + +if (current == nbElem) +{ + current = 0; // if end is reached, start add the beginning + full = TRUE; // only useful the first time +} + + + + + + + + + + + + C/C++ + int index = -1; + + if ((relativeIndex >= 0) && (relativeIndex < nbElem)) + { + if (full) + { + index = current + relativeIndex; + if (index >= nbElem) { + index -= nbElem; + } + } + } + else if ((relativeIndex < 0) && (relativeIndex >= -nbElem)) + { + if (full || (relativeIndex >= -current)) + { + index = current + relativeIndex; + if (index < 0) { + index += nbElem; + } + } + } + + if (index != -1) { + return vector + index; + } + else { + return NULL; + } + + + + Create a circular buffer containing a certain number of objects of type +ElType. The type and the number of elements are template parameters. + + + + + + + + + + + Get an element from the buffer. The index is relative to the last +addition to the buffer: negative values address "backward" elements +(-1 addresses the last added), positive values "forward" elements +(only useful, if the buffer has already been completely filled). + +Thus, values in the range [-m_nbElem, m_nbElem] are possible. +Returns NULL, if index is out of bounds or no element stored so far +under this index. + + + + + + + + + + + + + + returns the number of elements currently in the buffer. + + + + + + + + + + returns the size of the buffer. + + + + + + + + + + + Manage a set of pointers to an element type (passed as template instance) +This class roughly resembles Objecteering's set_of macro and is used to +migrate existing code easily to other case tools. + +The second class for the template instantiation needs to be a +"const variant" of the first class. + +Caveat: this class uses dynamic memory allocation +=> todo: create a purely static variant + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + return cardinal_number; + + + + + + + + + + + + C/C++ + return content[index]; + + + + + + + + + + + + + C/C++ + int size = 0x10; + +while (size < desired_size) +{ + if (size < size_block) { + size = size*2; + } + else { + size += size_block; + } +} +return size; + + + + + + + + + + + + + + C/C++ + size_block = init_size_block; +real_size = adjust_size(init_size); +content = new T [real_size]; +cardinal_number = 0; + + + + C/C++ + delete [] content; + + + + + + + + + + + + C/C++ + for (int i = 0; i < cardinal_number; i++) { + if (content[i] == entry) { + return i; + } +} + +return -1; + + + + + + + + C/C++ + if (cardinal_number >= real_size) +{ + real_size = adjust_size(cardinal_number + 1); + T * new_content = new T [real_size]; + memcpy(new_content, content, cardinal_number * sizeof(T)); + delete [] content; + content = new_content; +} +content[cardinal_number++] = (T) entry; + + + + + + + + + + + + + C/C++ + if (cardinal_number >= real_size) +{ + real_size = adjust_size(cardinal_number + 1); + T * new_content = new T [real_size]; + memcpy(new_content, content, cardinal_number * sizeof(T)); + delete [] content; + content = new_content; +} +if (index < cardinal_number) { + memmove( + &(content[index+1]), + &(content[index]), + (cardinal_number-index) * sizeof(T)); +} +content[index] = (T) entry; +cardinal_number++; + + + + + + + + + + + + C/C++ + for (int i = 0; i < cardinal_number; i++) { + if (content[i] == entry) { + erase(i); + return true; // only erase first entry + } +} +return false; + + + + + + + + + + + + + + C/C++ + if (index_to == -1) { + index_to = index_from; +} + +if (index_to >= cardinal_number) { + // out of bounds + return; +} +int remaining_elements = cardinal_number - (index_to + 1); +cardinal_number -= (index_to - index_from + 1); + +if (remaining_elements > 0) +{ + memmove( + &(content[index_from]), + &(content[index_to+1]), + remaining_elements * sizeof(T)); +} + + + + + + + + + + + + + + + + + + + + Return the number of elements currently in the set + + + + + + + + + + Retrieve an element at index from the set + + + + + + + + + + + + + + find. Find an element in the set. The index of the first element that +matches is returned. If the element cannot be found, -1 is returned. + + + + + + + + + + + + + + Insert an element at position given by index into the set. + + + + + + + + + + + + + + append an element to the set, it will occupy the last index. + + + + + + + + + erase an element from the set based on its value. The first element +with a matching value (not further elements that might match as well) +will be removed from the list. Returns true, if a matching value is +be found. + + + + + + + + + + + + + + Erase entries from the set based on an "from" and "to" index. If +the latter is not supplied, only one element is erased (to = from). +Please note that subsequent entries change their position. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TODO : +Incomplete attribute and operation definitions + + + + Manages system semaphores with counters (mainly based on Posix semaphores) + + + + + + + + + + + + C/C++ + TRACEpr (F7); + PR ("Semaphore::Semaphore (" << initValue << ")" << showI); + + errno = 0; +#if defined SYNCHRO_Solaris + errno = sema_init (&m_sema, initValue, USYNC_THREAD, NULL); +#else + sem_init (&m_sema, 0, initValue); // function sets errno on error +#endif + + if (errno) { + OSAL_ERROR ("Semaphore init failed"); + } + + + + C/C++ + TRACEpr (F7); + PR ("Semaphore::~Semaphore ()" << showI); + + errno = 0; +#if defined SYNCHRO_Solaris + errno = sema_destroy (&m_sema); +#else + sem_destroy (&m_sema); // function sets errno on error +#endif + + if (errno) { + OSAL_ERROR (""); + } + + + + + + + + + C/C++ + TRACEpr (F7); + PR ("Semaphore::post ()" << showI); + + errno = 0; + +#if defined SYNCHRO_Solaris + errno = sema_post (&m_sema); +#else + sem_post (&m_sema); // function sets errno if r not 0 +#endif + + if (errno) { + OSAL_ERROR (""); } + + return errno; + + + + + + + + + C/C++ + TRACEpr (F7); + PR ("Semaphore::wait ()" << showI); + int r; + errno = 0; + for (;;) + { +#if defined SYNCHRO_Solaris + errno = sema_wait (&m_sema); + if ((errno == 0) || (errno == EBUSY)) + break; +#elif defined SYNCHRO_POSIX4 || defined SYNCHRO_VxWorks + r = sem_wait (&m_sema); // sem_wait sets errno if r not 0 + if ((r == 0) || (errno == EAGAIN)) + break; +#else + #error define synchronization strategy +#endif + if (errno != EINTR) + OSAL_ERROR ("wait returned error code"); + errno = 0; + } + + return errno; + + + + + + + + + C/C++ + TRACEpr (F7); + PR ("Semaphore::trywait ()" << showI); + int r; + errno = 0; + + for (;;) + { +#if defined SYNCHRO_Solaris + errno = sema_trywait (&m_sema); + if ((errno == 0) || (errno == EBUSY)) + break; +#elif defined SYNCHRO_POSIX4 || defined SYNCHRO_VxWorks + r = sem_trywait (&m_sema); // sem_trywait sets errno if r not 0 + if ((r == 0) || (errno == EAGAIN)) + break; +#else + #error define synchronization strategy +#endif + if (errno != EINTR) + OSAL_ERROR ("tryWait returned error code"); + errno = 0; + } + PR ("Semaphore::tryWait () - returns value (errno): " << errno << showI); + + return errno; + + + + + + + + + C/C++ + TRACEpr (F7); + PR ("Semaphore::getValue ()" << showI); + + int value; + sem_getvalue ((sem_t*) &m_sema, &value); + return value; + + + + + + + + + + + + + + This operation unlocks the semaphore. + It increments atomically the counter and if other threads are + blocked waiting, it unblocks one of these. + + + + + + + + + + This operation locks the semaphore only if that semaphore is currently + not locked - that is, if the semaphore value is currently positive. + + The underlying posix function is executed in a loop, since it could + legally return with an error code, if it is interrupted by a + signal (EINTR). + + Returns 0 on success or the error code + + + + + + + + + + This operation locks the semaphore. + If the counter is zero, this method blocks the current thread until the + counter is positive. Afterwords it decrements the counter atomically. + + The underlying posix function is executed in a loop, since it could + legally return with an error code, if it is interrupted by a + signal (EINTR). + + Returns 0 on success or the error code + + + + + + + + + + Provide access to the semaphore counter + + + + + + + + + + + Allows to synchronize N threads: N-1 threads arriving at the barrier +are blocked, the last arriving thread unblocks all threads. + +Only one thread creates the barrier, other threads should only use +references. +In addition to an inefficient (file based!) implementation, we use +directly the pthread barrier. + + + + + + + C/C++ + return m_name; +} + + + + + + + + + + + + + + + + + + + + + + + block, until the number of threads specified in the constructor + invoke this method + + + + + + Interface to lock a file (like flock in POSIX) +This class is currently a candidate for being removed from the +virtual machine, since file based locking is seldom relevant in +embedded system. Its main use is the inefficient fallback implementation +variant of the barrier (if Posix functions are not available) + + + + + + + + + + + + + + + + + + + + + + C/C++ + m_fd = fd; + + + + + + + + + + + + + C/C++ + TRACEpr (VM); + PR ("Lock::Lock (...)" << showI); + + // probably not a good idea to reset a global error variable here + // errno = 0; + +/* #if defined SYNCHRO_VxWorks // it compiles on VxWorks + OSAL_ERROR ("Not implemented for VxWorks"); + #endif */ + + + + C/C++ + TRACEpr (VM); + PR ("Lock::take" << showI); + + m_flock.l_type = m_lockType; + m_flock.l_whence = 0; + m_flock.l_start = (off_t) 0; + m_flock.l_len = (off_t) 0; + + if (fcntl (m_fd, F_SETLKW, &m_flock) < 0) { // wait if hold + OSAL_ERROR ("ON fcntl(m_fd, F_SETLKW:F_WRLCK) "); + } + + + + + + + + + C/C++ + TRACEpr (VM); + + int r; + m_flock.l_type = m_lockType; + m_flock.l_whence = 0; + m_flock.l_start = (off_t) 0; + m_flock.l_len = (off_t) 0; + + while ((r = fcntl (m_fd, F_SETLK, &m_flock)) < 0) // NO wait if hold + { + if (errno == 0 || errno == EAGAIN) + break; + if (errno != EINTR) + OSAL_ERROR (""); + errno = 0; + } + + PR ("Lock::tryTake () - return value (errno): " << errno << showI); + return errno; + + + + C/C++ + TRACEpr (VM); + PR ("Lock::release ()" << showI); + + m_flock.l_type = F_UNLCK; + m_flock.l_whence = 0; + m_flock.l_start = (off_t) 0; + m_flock.l_len = (off_t) 0; + + if (fcntl (m_fd, F_SETLK, &m_flock) < 0) { + OSAL_ERROR (""); + } + + + + + + + + + + + + + C/C++ + TRACEpr (VM); + PR ("Lock::getInfo" << showI); + + infoP->l_whence = 0; + infoP->l_start = 0L; + infoP->l_len = 0L; + infoP->l_type = m_lockType; + if (fcntl (m_fd, F_GETLK, infoP) == -1) { + OSAL_ERROR (""); + } + + // return TRUE, if lock busy + return (infoP->l_type != F_UNLCK); + + + + + Create a lock for a file that is identified by a file descriptor. This + descriptor can be obtained for instance using the "open". The second, + optional parameter denotes whether the lock is also exclusive for + reading (otherwise, only the write access is protected). The default + value "true" guarantees exlusive read and write access. + + + + + + + + + + + + + + + + this method can be called to initialize the file descriptor, if it + is not yet known at creation time. This should only be called once + after construction (and before take/release). + + + + + + + + + + take a lock. This method blocks, until the lock is available + + + + + a non-blocking variant of take. It returns the error code of the + underlying function fcntl or 0, if take was successfull + + + + + + + + + + release the lock + + + + + + + + + + + + + + + + + + + + + + + + + + Allows to manage system locks to prevent threads from simultaneous +execution of the same section (see CriticalSection) + + + + + + + C/C++ + creatEff (IntraProcess); + + + C/C++ + TRACEpr (F7); +PR ("before Mutex::lock()" << showI); +#if defined SYNCHRO_POSIX4 + int error = pthread_mutex_lock (&m_mutexS); + +#elif defined SYNCHRO_Solaris + int error = mutex_lock (&m_mutexS); + +#elif defined SYNCHRO_VxWorks + int error = 0; + if (semTake (m_mutexS, WAIT_FOREVER) != OK) + OSAL_ERROR ("ON semTake()"); +#endif + + if (error) { // == EDEADLK : the current thread already owns the mutex + OSAL_ERROR ("can't lock mutex"); + } + + + + C/C++ + TRACEpr (F7); +PR ("Mutex::unlock ()" << showI); + +#if defined SYNCHRO_POSIX4 + int error = pthread_mutex_unlock (&m_mutexS); + +#elif defined SYNCHRO_Solaris + int error = mutex_unlock (&m_mutexS); + +#elif defined SYNCHRO_VxWorks + int error = 0; + if (semGive (m_mutexS) != OK) + OSAL_ERROR ("ON semGive()"); +#endif + +if (error) { // == EPERM : the current thread does not own the mutex + OSAL_ERROR ("can't unlock mutex"); +} + + + + + + + + C/C++ + TRACEpr (F7); +PR ("before Mutex::trylock()"<< showI); + +#define Nretry 3 // re-try N times if EINTR + +int i; +int error; +for (i = 0; i < Nretry; ++i) +{ +#if defined SYNCHRO_POSIX4 + error = pthread_mutex_trylock (&m_mutexS); + +#elif defined SYNCHRO_Solaris + error = mutex_trylock (&m_mutexS); + +#elif defined SYNCHRO_VxWorks + error = semTake (m_mutexS, NO_WAIT); + if (error == S_objLib_OBJ_UNAVAILABLE) { + error = EBUSY; + } + +#endif + if (error == 0 || error == EBUSY) { + break; + } + if (error != EINTR) { + OSAL_ERROR (""); + } +} +if (i == Nretry) { + OSAL_ERROR ("EINTR Nretry times"); +} + +// errno == EBUSY : the mutex could not be acquired because it was already +// locked +return error; + + + + C/C++ + int error; +#if defined SYNCHRO_POSIX4 + TRACEpr (F7); + PR ("Mutex::~Mutex: m_mutexS = " << &m_mutexS << showI); + error = pthread_mutex_destroy (&m_mutexS); + +#elif defined SYNCHRO_Solaris + error = mutex_destroy (&m_mutexS); + +#elif defined SYNCHRO_VxWorks + if (semDelete (m_mutexS) == OK) { + error = 0; + } + else { + error = -1; + } +#endif + +if (error) { + OSAL_ERROR ("cannot delete Mutex"); +} + + + + + + + + + C/C++ + // any value is equally valable as argument +// inutile d'avoir une portee InterProcess couteuse si le process est seul. + +creatEff (OS_AL::ProcessingResources::ProDesc::getNumerOfProcesses() > 1 ? InterProcess : IntraProcess); + + + + + + + + C/C++ + // -------------------------------------------- +#if defined SYNCHRO_POSIX4 +pthread_mutexattr_t attr; // mutex attributes object +int result = pthread_mutexattr_init (&attr); // and initialized by only 1 process +// ?? comment savoir que je suis le premier ?? ..................... +if (result != 0) { + OSAL_ERROR ("ON pthread_mutexattr_init()"); +} +if (scope == InterProcess) { + result = pthread_mutexattr_setpshared (&attr, PTHREAD_PROCESS_SHARED); + if (errno != 0) { + OSAL_ERROR ("ON pthread_mutexattr_setpshared()"); + } +} +result = pthread_mutex_init (&m_mutexS, &attr); +if (result != 0) { + OSAL_ERROR ("ON pthread_mutex_init()"); +} + +// pthread_mutexattr_destroy(&attr); // required? + +// -------------------------------------------- +#elif defined SYNCHRO_Solaris +if (scope != InterProcess) { + // initial RAZ, with only 1 thread + // #include <string.h> + // memset(&m_mutexS, 0, sizeof(MutexStruc)); + char *pc = (char *) &m_mutexS; + for (int k = 0; k < sizeof (MutexStruc); ++k) { + *pC/C++ = '\0'; // initial reset + } +} + //else + // only 1 process must reset this structure + +int result = mutex_init ((MutexStruc *) & m_mutexS, + (scope == InterProcess) ? USYNC_PROCESS : USYNC_THREAD, NULL); +if (result != 0) { + OSAL_ERROR ("ON mutex_init()"); +} + +// -------------------------------------------- +#elif defined SYNCHRO_VxWorks +if (scope == InterProcess) { + OSAL_ERROR ("Only 1 processus for VxWorks"); +} +#if defined SYNCHRO_VxWorks_MES +m_mutexS = semMCreate (SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE); +#else +m_mutexS = semBCreate (SEM_Q_PRIORITY, SEM_FULL); +#endif +if (m_mutexS == NULL) { + OSAL_ERROR ("ON semaphore create()"); +} + +// -------------------------------------------- +#else +#error SYNCHRO_?? not defined +#endif + +TRACEpr (F7); +PR ("after Mutex::createEff()" << showI); + + + + + + + + + C/C++ + TRACEpr (F7); +PR ("Mutex::print (" << label << "), errno= " << errno << showI); + +unsigned short *pc1; +int size; +#if defined SYNCHRO_VxWorks + if (m_mutexS == NULL) { + OSAL_ERROR ("m_mutexS == NULL"); + } + pc1 = (unsigned short *) m_mutexS; + size = 40; // sizeof(class semaphore); + + semShow (m_mutexS, 1); // dump of system structure + //-- errno= 0; +#else + pc1 = (unsigned short *) &m_mutexS; + size = sizeof (MutexId); +#endif + +char buffer[200]; +char *pb = buffer; +unsigned short *pc = pc1; +for (int k = 0; k < size; k += 2) +{ + if (k % 16 == 0) + pb += sprintf (pb, "\n\t"); + pb += sprintf (pb, "%4.4x ", *pc++); + if ((pb - buffer) > (int) sizeof (buffer)) + OSAL_ERROR ("Enlarge size of buffer."); +} + +PR (", dump of m_mutexS at 0x" << pc1 << ": " << buffer << showI); + + + + + + + Locks the mutex. If the mutex is currently unlocked, it becomes locked + and owned by the calling thread, and returns immediately. + If the mutex is already locked by another thread, "lock" suspends the + calling thread until the mutex is unlocked. + + + + + Unlocks the given mutex. The mutex is assumed to be locked and owned + by the calling thread on entrance to unlock. + unlock always returns the mutex to the unlocked state (we do not use the + pthread option "recursive", which decrements the locking count of the mutex + [number of lock operations performed on it by the calling thread], and + only when this count reaches zero is the mutex actually unlocked). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Protects the code following a declaration of an instance of this class +against an interruption for signal handling and against reentrance of +this code. It is associated with an instance of class Mutex (passed in +the constructor). + +Example: +Management of a list (see class SR_List) that can be accessed by multiple +threads. To assure data integrity, each list instance contains a mutex, +all public methods look like: +SR_Liste::append() +{ + CriticalSection cs(mutex); + ... +} // end of critical section. + + + + + + + + + + + + + + + + + + + C/C++ + m_mutex = mutex; + + sigfillset (&m_maskAll); + Thread::changeSigMask (SIG_SETMASK, &m_maskAll, &m_oldMask); + + m_mutex->lock (); + + + + + + + + C/C++ + m_mutex = shmPtr->getMutex (); + + sigfillset (&m_maskAll); + Thread::changeSigMask (SIG_SETMASK, &m_maskAll, &m_oldMask); + m_mutex->lock (); + + + + C/C++ + if (m_mutex) { + m_mutex->unlock (); + } + + Thread::changeSigMask (SIG_SETMASK, &m_oldMask, NULL); + + + + + Create a Critical section using the passed mutex pointer + + + + + + + + + Create a critical section using the mutex provided by the SharedMemory + + + + + + + + + The destructor will release the mutex. + + + + + + + + + + + + + + + + + + Allows to authorize the access to data shared between multiple threads. +Access can be shared by multiple reades, but there can only be one writer. + + + + + + + + + + + C/C++ + return rwl; + + + + + + + C/C++ + rwl = cr_operand; + + + C/C++ + #if defined SYNCHRO_Solaris + errno = rwlock_init (&rwl, USYNC_THREAD, NULL); + +#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux + errno = pthread_rwlock_init (&rwl, NULL); + +#elif defined SYNCHRO_VxWorks + rwl.readers = 0; // pas de lecteur au début + rwl.writers = 0; // pas d'écrivain au début + + rwl.readersMut = semBCreate (SEM_Q_FIFO, SEM_FULL); //initialisation + rwl.writersMut = semBCreate (SEM_Q_FIFO, SEM_FULL); //des + rwl.readMut = semBCreate (SEM_Q_FIFO, SEM_FULL); //mutexes + rwl.writeSem = semCCreate (SEM_Q_FIFO, 1); //et des + rwl.readSem = semCCreate (SEM_Q_FIFO, 1); //semaphores + + if ((rwl.readersMut != NULL) && (rwl.writersMut != NULL) + && (rwl.readMut != NULL) + && (rwl.writeSem != NULL) && (rwl.readSem != NULL)) + errno = 0; + else + errno = ENOMEM; // semBCreate et semCCreate ne positionnent pas errno + + +#else // RWLock_Simulation + rwl.readers = 0; //pas de lecteur au début + rwl.writers = 0; //pas d'écrivain au début + errno = 0; +#endif + + if (errno) { + OSAL_ERROR (""); + } + + + + C/C++ + #if defined SYNCHRO_Solaris + errno = rwlock_destroy (&rwl); + +#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux + errno = pthread_rwlock_destroy (&rwl); + + +#elif defined SYNCHRO_VxWorks //-VxW + errno = 0; // je suppose qu'1 exécution OK ne touche pas errno + semDelete (rwl.readersMut); + semDelete (rwl.writersMut); + semDelete (rwl.readMut); + semDelete (rwl.readSem); + semDelete (rwl.writeSem); + +#else + errno = 0; +#endif + + if (errno) { + OSAL_ERROR (""); + } + + + + C/C++ + #if defined SYNCHRO_Solaris + errno = rw_rdlock (&rwl); + +#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux + errno = pthread_rwlock_rdlock (&rwl); + +#elif defined SYNCHRO_VxWorks + errno = 0; + if (semTake (rwl.readMut, WAIT_FOREVER) == OK) + if (semTake (rwl.readSem, WAIT_FOREVER) == OK) + if (semTake (rwl.readersMut, WAIT_FOREVER) == OK) //début de section critique + { + rwl.readers++; //incremente nb de lecteurs + if (rwl.readers == 1) //si premier lecteur alors il + semTake (rwl.writeSem, WAIT_FOREVER); //bloque l'ecriture + if (semGive (rwl.readersMut) == OK) //fin de section critique + if (semGive (rwl.readSem) == OK) + semGive (rwl.readMut); + } + +#else // RWLock_Simulation + errno = 0; + rwl.readMut.lock (); + rwl.readSem.wait (); + rwl.readersMut.lock (); // début de section critique + { + rwl.readers++; //incrémente nb de lecteurs + if (rwl.readers == 1) //si premier lecteur alors il + rwl.writeSem.wait (); //bloque l'ecriture + } + rwl.readersMut.unlock (); // fin de section critique + rwl.readSem.post (); + rwl.readMut.unlock (); + +#endif + + if (errno) { + OSAL_ERROR (""); + } + + + + C/C++ + #if defined SYNCHRO_Solaris + errno = rw_wrlock (&rwl); + +#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux + errno = pthread_rwlock_wrlock (&rwl); + +#elif defined SYNCHRO_VxWorks + errno = 0; + if (semTake (rwl.writersMut, WAIT_FOREVER) == OK) //début de section critique + { + if (++rwl.writers == 1) //si premier écrivain, alors + semTake (rwl.readSem, WAIT_FOREVER); // attendre fin des lecteurs et les bloquer + if (semGive (rwl.writersMut) == OK) //fin de section critique + semTake (rwl.writeSem, WAIT_FOREVER); //verrouille acces en ecriture/lecture pour autres + } + +#else // RWLock_Simulation + errno = 0; + rwl.writersMut.lock (); // début de section critique + if (++rwl.writers == 1) //si premier écrivain, alors + rwl.readSem.wait (); // attendre fin des lecteurs et les bloquer + rwl.writersMut.unlock (); // fin de section critique + rwl.writeSem.wait (); // demande à écrire seul +#endif + + if (errno) { + OSAL_ERROR (""); + } + + + + C/C++ + #if defined SYNCHRO_Solaris + errno = rw_unlock (&rwl); + +#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux + errno = pthread_rwlock_unlock (&rwl); + +#elif defined SYNCHRO_VxWorks + errno = 0; + // test, if a reader or writer requires end + if (rwl.readers) + { + if (semTake (rwl.readersMut, WAIT_FOREVER) == OK) + { + // entered critical section (through semTake) + if (--rwl.readers == 0) // if last reader, authorize writers + semGive (rwl.writeSem); + semGive (rwl.readersMut); // end of critical section + } + } + else if (rwl.writers) + { + if (semGive (rwl.writeSem) == OK) // authorize other writers + if (semTake (rwl.writersMut, WAIT_FOREVER) == OK) + { + // entered critical section (through semTake) + if (--rwl.writers == 0) // if last writer, authorize readers + semGive (rwl.readSem); + semGive (rwl.writersMut); // end of critical section + } + } + else + OSAL_ERROR ("readers==0 && writers==0"); + +#else // RWLock_Simulation + errno = 0; + // test, if a reader or writer requires end + if (rwl.readers) + { + rwl.readersMut.lock (); // enter ciritical section + if (--rwl.readers == 0) // if last reader, authorize writers + rwl.writeSem.post (); + rwl.readersMut.unlock (); // end of critical section + } + else if (rwl.writers) + { + rwl.writeSem.post (); // authorize other writer + rwl.writersMut.lock (); // enter critical section + if (--rwl.writers == 0) // if last writer, authorize readers + rwl.readSem.post (); + rwl.writersMut.unlock (); // end of critical section + } + else + OSAL_ERROR ("readers==0 && writers==0"); +#endif + + if (errno) + OSAL_ERROR (""); + + + + + + + + + C/C++ + #if defined SYNCHRO_Solaris + errno = rw_tryrdlock (&rwl); + +#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux + errno = pthread_rwlock_tryrdlock (&rwl); + + +#elif defined SYNCHRO_VxWorks + if (semTake (rwl.readMut, WAIT_FOREVER) == OK) + if (semTake (rwl.readSem, WAIT_FOREVER) == OK) // VERIFIER ??????????? + if (semTake (rwl.readersMut, WAIT_FOREVER) == OK) + { + // entered critical section (through semTake) + rwl.readers++; // increment number of readers + if (rwl.readers == 1) // if first reader, ... + semTake (rwl.writeSem, NO_WAIT); // ... block writer // VERIFIER ??????????? + if (semGive (rwl.readersMut) == OK) // end of critical section + if (semGive (rwl.readSem) == OK) + semGive (rwl.readMut); + } + +#else // RWLock_Simulation + errno = 0; + rwl.readMut.lock (); + if (rwl.readSem.tryWait () == 0) + { + rwl.readersMut.lock (); // begin of critical section + { + rwl.readers++; // increment number of readers + if (rwl.readers == 1) // if first reader, ... + rwl.writeSem.wait (); // ... block writer + } + rwl.readersMut.unlock (); // end of critical section + rwl.readSem.post (); + } + rwl.readMut.unlock (); +#endif + + if (errno && errno != EBUSY) + OSAL_ERROR (""); + + return errno; + + + + + + + + + C/C++ + #if defined SYNCHRO_Solaris + errno = rw_trywrlock (&rwl); + +#elif defined SYNCHRO_POSIX4 || SYNCHRO_Linux + errno = pthread_rwlock_trywrlock (&rwl); + +#elif defined SYNCHRO_VxWorks + errno = 0; + if (semTake (rwl.writeSem, NO_WAIT) == OK) // request write access + { + if (semTake (rwl.writersMut, WAIT_FOREVER) == OK) + { + // entered critical section (through semTake) + if (++rwl.writers == 1) //si premier ecrivain alors il + semTake (rwl.readSem, WAIT_FOREVER); //bloque les lecteurs + semGive (rwl.writersMut); //fin de section critique + } + } + else + { + if (errno == S_objLib_OBJ_UNAVAILABLE) + errno = EBUSY; + } + +#else // RWLock_Simulation + errno = 0; + rwl.writersMut.lock (); // begin of critical section + { + rwl.writers++; // increment number of readers + if (rwl.writers == 1) // if first reader, ... + rwl.readSem.wait (); // ... block writers + } + rwl.writersMut.unlock (); // end of critical section + rwl.writeSem.wait (); // lock write/read access for others +#endif + + if (errno && errno != EBUSY) + OSAL_ERROR (""); + + return errno; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From the Posix man page: +A condition (short for ``condition variable'') is a synchronization +device that allows threads to suspend execution and relinquish the +processors until some predicate on shared data is satisfied. The basic +operations on conditions are: signal the condition (when the predicate +becomes true), and wait for the condition, suspending the thread +execution until another thread signals the condition. + +A condition variable must always be associated with a mutex, to avoid +the race condition where a thread prepares to wait on a condition +variable and another thread signals the condition just before the +first thread actually waits on it. + + + + + + + + + + + + + + + + C/C++ + #if defined SYNCHRO_POSIX4 + int error = pthread_cond_init (&m_condition, NULL); + +#elif defined SYNCHRO_Solaris + int error = cond_init (&m_condition, USYNC_THREAD, 0); + +#elif defined SYNCHRO_VxWorks + OSAL_ERROR ("Not available with VxWorks"); + // maybe a mechanism can be implemented by means of a signal pendants + +#else + #error SYNCHRO_???? not defined +#endif + +if (error) { + OSAL_ERROR ("Condition constructor failed"); +} + + + C/C++ + if (m_isLocked) { + unlock (); +} + +#if defined SYNCHRO_POSIX4 || defined SYNCHRO_Linux + int error = pthread_cond_destroy (&m_condition); +#elif defined SYNCHRO_Solaris + int error = cond_destroy (&m_condition); +#endif + +if (error) { + OSAL_ERROR ("destructor failed"); +} + + + C/C++ + m_mutex.lock (); +m_isLocked = true; + + + + C/C++ + if (!m_isLocked) { + // OSAL_ERROR ("already unlocked"); +} +m_mutex.unlock (); +m_isLocked = false; + + + + + + + + + C/C++ + for (;;) { +#if defined SYNCHRO_POSIX4 + /* + * POSIX man page: + * The pthread_cond_timedwait() and pthread_cond_wait() functions shall + * block on a condition variable. They shall be called with mutex locked + * by the calling thread or undefined behavior results. + */ + + int result = pthread_cond_wait (&m_condition, &m_mutex.m_mutexS); + +#elif defined SYNCHRO_Solaris + int result = cond_wait (&m_condition, &m_mutex.m_mutexS); + +#endif + if (result == 0) { + // upon successful return, the lock is re-locked + m_isLocked = true; + return result; + } + if (result == EPERM) { + OSAL_ERROR ("wait failed (EPERM - operation not permitted)"); + } + else if (result != EINTR) { + OSAL_ERROR ("wait failed"); + } +} + + + + + + + + + + + + C/C++ + TRACEpr (VM); +PR ("Condition::waitUpTo ()" << showI); + +int result; +if (date.hasPassed ()) { + result = ERANGE; // it is too late ! +} +else { + result = 0; + + m_isLocked = false; // cond_timedwait will unlock the lock + OS_AL::Time::TimeVal absTime = date + OS_AL::Time::TimeVal::sysStartTime(); +#if defined SYNCHRO_POSIX4 + struct timespec finalDate; // final date in standard type + finalDate.tv_sec = absTime.getSec(); + finalDate.tv_nsec = absTime.getUsec() * 1000; + + for (;;) { + result = pthread_cond_timedwait (&m_condition, &m_mutex.m_mutexS, &finalDate); +#elif defined SYNCHRO_Solaris + timestruc_t finalDate; // final date in standard type + finalDate.tv_sec = absTime.getSec(); + finalDate.tv_nsec = absTime.getUsec() * 1000; + + for (;;) { + result = cond_timedwait (&m_condition, &m_mutex.m_mutexS, &finalDate); +#else + // not supported in vxWorks, open loop to satisfy the compilers + for (;;) { + result = 0; +#endif + if ((result == 0) || (result == ETIMEDOUT)) { + break; + } + if (result != EINTR) { + OS_AL::Util::BString500 s1 ("date="); + OSAL_ERROR (s1 << finalDate.tv_sec << " sec. , " << finalDate.tv_nsec); + } + } +} + +// upon successful return, the lock is re-locked +if (result == 0) { + m_isLocked = true; +} +return result; + + + + + + + + + C/C++ + #if defined SYNCHRO_POSIX4 || defined SYNCHRO_Linux +int result = pthread_cond_signal (&m_condition); + +#elif defined SYNCHRO_Solaris +int result = cond_signal (&m_condition); + +#endif + +if (result != 0) { + OSAL_ERROR ("could not signal condition"); +} + +return result; + + + + + + + + C/C++ + #if defined SYNCHRO_POSIX4 || defined SYNCHRO_Linux +int result = pthread_cond_broadcast (&m_condition); + +#elif defined SYNCHRO_Solaris +int result = cond_broadcast (&m_condition); + +#endif + +if (result != 0) { + OSAL_ERROR (""); +} + +return result; + + + + + + + + + wait, until the condition variable is signaled. + + The associated mutex must be locked before calling waitUpto. It will + be re-locked at the end of the call. + + + + + + + + + + wait, until the condition variable is signaled or the given date + has pased. + + The associated mutex must be locked before calling waitUpto. It will + be re-locked at the end of the call. + + + + + + + + + + + + + + signal the condition. A thread that is currently waiting for the + condition will continue. If multiple threads are waiting, only one + of these will continue. + + + + + + + + + + signal the condition. Other threads that are currently waiting for the + condition will continue. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + int receivedSigID; + sigset_t sigset; + sigemptyset (&sigset); + sigaddset (&sigset, SIGRTMIN); + for (;;) { + sigwait (&sigset, &receivedSigID); + int overruns = debugTimer.getOverrun (); + if (overruns > 0) { + TRACEpr (F6); + PR ("detected return from debugger" << showI); + TimeVal delta; + overruns++; // the actual delay is between overruns and overruns+1 + delta.setSec ((overruns / DBG_TICKS_PER_SECOND)); + delta.setUsec ((overruns % DBG_TICKS_PER_SECOND) * + DBG_RESOLUTION_MS * 1000); + TimeVal::adjustTime (delta); + PR ("adjusted time" << showI); + } + } + return NULL; + + + C/C++ + itimerspec its = { + {0, DBG_RESOLUTION_MS*1000*1000}, + {0, DBG_RESOLUTION_MS*1000*1000} + }; + + // need high priority (1) + Thread::modifySigMask (SIG_BLOCK, SIGRTMIN); + // not declared globally, since initialization order of gcc is incorrect + // (set_of_threads is initialized after) + overrunCheckThread = new Thread ("dbg-check"); + overrunCheckThread->exec (checkOverruns, NULL, 10); + + debugTimer.setTime (0, &its); + + + + + todo: need to use thread abstraction + + + + + + + + + + + + + + + + Abstraction of a Timer + +This class serves two different functions: if an instance is +created via the constructor, it provides a (posix) timer. The configuration +of this timer is done by means of the method settime, which allows +principally to configure a period length and the initial delay. + +In addtion, the timer class offers the possibility to use system +functions for waiting a specific time: + + - sleep + - wakeup + - wakePeriodicforZero + +In order to use These, it is not necessary to create a timer instance, +these operations are static. + + + + + + + C/C++ + m_id = TimerNotAssigned; + +#if defined TIMER_POSIX4 + #define ITIMER CLOCK_REALTIME // or CLOCK_MONOTONIC + + // With evp==NULL and SA_SIGINFO set , + // SIGALRM will be sent to the process (or to the thread + // not masked for this signal) + // replace SIG_IGN by a handleSigAlarm() ?????? + // mask other signals !! + + // initialisation of sigaction structure + struct sigaction act; + //act.sa_handler = (VOIDFUNCPTR) sigHandler; + //act.sa_mask = 0; + //act.sa_flags = 0; + // we have to define a handler with the following arguments: + // void sigHandler(int sig, int code, SIGCONTEXT *sigContext) {}; + + if (sigaction (SIGALRM, &act, NULL)) + OSAL_ERROR ("ON sigaction()"); + + struct sigevent sig_event; + sig_event.sigev_notify = SIGEV_SIGNAL; + sig_event.sigev_value.sival_ptr = this; + sig_event.sigev_signo = SIGRTMIN; + // sig_event.sigev_notify_function = SysTimer_impl::handler_fct; + // sig_event.sigev_notify_attributes = NULL; + + int r = timer_create (ITIMER, &sig_event, &m_id); + if (r == -1) + OSAL_ERROR ("ON timer_create()"); + +#elif defined TIMER_Solaris + #define ITIMER ITIMER_REAL // PAS CONSEILLÉ par Doc SunOS5.5 + //#define ITIMER ITIMER_VIRTUAL ??? + #define SIG_ITIMER SIGALRM // or SIGVTALRM + + // + // Si la Realtime Library de Solaris ne marche vraiment pas pour les timers + // masquer ce thread contre les autres signaux !! + // faire la methode de classe handleTimerSignal() contenant seulement : + // flag= 1; + // + //**** Prepare signal receiving + // struct sigaction sigAct; + // sigAct.sa_handler= (VOIDFUNCPTR) sigHandler); + // sigAct.sa_mask= 0; + // sigAct.sa_flags= 0; + // sigaction(SIGALRM, &sigAct, NULL); + // + // void (*f)(int); + // f= sigset(SIG_ITIMER, (void(*)(int))handleTimerSignal); + // if (f == SIG_ERR) + // OSAL_ERROR("ON sigset(SIG_ITIMER, )"); + + PRINTpr ("not yet implemented."); + pr << shErr; +#else + #error Timer_??? not defined +#endif + + + + C/C++ + int r; + +#if defined TIMER_POSIX4 + if (m_id != TimerNotAssigned) + { + r = timer_delete (m_id); + if (r == -1) { + OSAL_ERROR ("ON timer_delete()"); + } + } +#elif defined TIMER_Solaris + // [todo: resource leak?] +#else + #error Timer_??? not defined +#endif + + + + + + + + + + + + + + + + + + C/C++ + int count = 0; + + OS_AL::Util::Print pr2; + pr2 << txt; + + while (*intPtr) // while pointed integer is not zero + { + if (txt.length () != 0) // print if txt string is not empty + { + pr2 << "value *intPtr = " << *intPtr << " - wait " << duration + << " timetick(s)" << showI; + } + count ++; + Timer::sleep (duration); + + if (!(errno == EINTR || errno == ETIME)) + OSAL_ERROR (""); + } + pr2.clean (); + + TRACEpr (F7); + PR (txt << "> return after " << count + << " * " << duration << " timeticks" << showI); + + + + + + + + + + + + + + + + + + + + + + C/C++ + int r = 0; + +#if defined TIMER_POSIX4 || defined TIMER_Linux + // flags == TIMER_RELTIME ou TIMER_ABSTIME + r = timer_settime (m_id, flags, value, oldValue); + if (r == -1) + OSAL_ERROR ("ON timer_settime()"); + +#elif defined TIMER_Solaris + struct itimerval val, oldVal; + val.it_interval.tv_sec = value->it_interval.tv_sec; + val.it_interval.tv_usec = value->it_interval.tv_nsec / 1000; + val.it_value.tv_sec = value->it_value.tv_sec; + val.it_value.tv_usec = value->it_value.tv_nsec / 1000; + + if (setitimer (ITIMER, &val, &oldVal)) + OSAL_ERROR ("ON setitimer()"); + + if (oldValue) + { + oldValue->it_interval.tv_sec = oldVal.it_interval.tv_sec; + oldValue->it_interval.tv_nsec = oldVal.it_interval.tv_usec * 1000; + oldValue->it_value.tv_sec = oldVal.it_value.tv_sec; + oldValue->it_value.tv_nsec = oldVal.it_value.tv_usec * 1000; + } +#else + #error Timer_??? not defined +#endif + + return r; + + + + + + + + + + + + + C/C++ + int r = 0; + +#if defined TIMER_POSIX4 || defined TIMER_Linux + r = timer_gettime (m_id, value); + if (r == -1) + OSAL_ERROR ("ON timer_gettime()"); + +#elif defined TIMER_Solaris + struct itimerval val; + val.it_interval.tv_sec = value->it_interval.tv_sec; + val.it_interval.tv_usec = value->it_interval.tv_nsec / 1000; + val.it_value.tv_sec = value->it_value.tv_sec; + val.it_value.tv_usec = value->it_value.tv_nsec / 1000; + + if (getitimer (ITIMER, &val)) + OSAL_ERROR ("ON getitimer()"); +#else + #error Timer_??? not defined +#endif + + return r; + + + + + + + + + C/C++ + int r; + +#if defined TIMER_Linux + r = timer_getoverrun (m_id); + if (r == -1) + OSAL_ERROR ("ON timer_getoverrun()"); + +#elif defined TIMER_Cygwin || defined TIMER_Solaris + // not supported + r = 0; +#else + #error Timer_??? not defined +#endif + + return r; + + + + + + + + + + + + + + C/C++ + int r = 0; + + if (duration > 0) + { + TimeVal finalDate = TimeVal::current () + TimeVal (duration); + r = wakeUp (finalDate); + } + + return r; + + + + + + + + + + + + + C/C++ + int r = 0; + + if (!date.hasPassed ()) { + TimeVal remainder; + do { + r = waitDate (date, remainder); + } while (remainder > 0); + } + return r; + + + + + + + + + + + + + + + + + C/C++ + int r; + +#ifdef SYSTEM_Solaris + mutex_t sleepLock = DEFAULTMUTEX; // without init(), requires zeroed memory + cond_t sleepCond = DEFAULTCV; // this condition variable will never be unblocked + struct timespec final; // final date in standard type + TimeVal absTime = finalDate + TimeVal::sysStartTime (); + final.tv_sec = absTime.getSec (); + final.tv_nsec = absTime.getUsec () * 1000; + + mutex_lock (&sleepLock); + errno = r = cond_timedwait (&sleepCond, &sleepLock, &final); + mutex_unlock (&sleepLock); + // cond_destroy(&sleepCond); + // mutex_destroy(&sleepLock); + + if (errno == ETIME || errno == 0) { + r = 0; + remainder.setSec (0); + remainder.setNSec (0); + } + else if (errno == EINTR) { + // call has been interrupted by signal + r = 1; + remainder = finalDate - TimeVal::current (); + } + else { + OSAL_ERROR ("ON cond_timedwait()"); + } +#else + struct timespec delay, remainingTime; + TimeVal delayTime = finalDate - TimeVal::current (); +// #define PRECISE_WAIT +#ifdef PRECISE_WAIT + // idea: wait some ms less with nanosleep, perform busy wait after + // [todo:] does not work for remainingTime + TimeVal some_ms; + some_ms.setUsec (5*1000); + + TimeVal sleepTime = delayTime - some_ms; + delay.tv_sec = sleepTime.getSec (); + delay.tv_nsec = sleepTime.getNsec (); + r = 0; + if (sleepTime > 0) { + r = nanosleep (&delay, &remainingTime); + } + // perform busy wait for last (upto) 10 ms + do { + delayTime = finalDate - TimeVal::current (); + } + while (delayTime > 0); +#else + delay.tv_sec = delayTime.getSec (); + delay.tv_nsec = delayTime.getNsec (); + r = nanosleep (&delay, &remainingTime); +#endif + if (r == 0) + { + remainder = 0; + } + else + { + if (errno != EINTR) + OSAL_ERROR ("ON nanosleep()"); + r = 1; + // todo: remainder not used? + remainder.setSec (remainingTime.tv_sec); + remainder.setNsec (remainingTime.tv_nsec); + } +#endif + + return r; + + + + + + + activate the timer, i.e. pass an itimerspec value with initial delay +and period length. In addition, the first parameter flags is a bit +vector. If it includes TIMER_ABSTIME, it denotes that an absolute +time value for is passed as initial delay. +[Todo: would be more consistent to pass two Accord TimeVals] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + if the signal associated with a timer expiration is not handled, +an overrun counter is increased with each expiration. It can be used +to detect an overload + + + + + + + + + + sleep for a certain duration (defined in time units, see +TimeVal::_moduleSec) + +If the process receives a signal, the OS sleep is interrupted +(e.g. nanosleep in case of Posix). This sleep method will recall the +OS sleep function until the specified time has passed. + + + + + + + + + + + + + + + continue computation after the (absolute) date has passed. This +function shares other properties with the sleep function. + + + + + + + + + + + + + + wait, until the variable *intPtr becomes zero, The parameter duration +determines the interval in which the variable is checked. If the +parameter txt is not empty, its contents is printed out during each +check. + +Should be considered as deprecated? (not used) + + + + + + + + + + + + + + + + + + + + used by wakeUp and sleep + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + return m_timeScale; + + + + + + + + C/C++ + return m_timespec.tv_sec; + + + + + + + + C/C++ + return m_timespec.tv_nsec / 1000; + + + + + + + + C/C++ + return m_timespec.tv_nsec; + + + + + + + + C/C++ + m_timespec.tv_sec = sec; + + + + + + + + C/C++ + m_timespec.tv_nsec = usec * 1000; + + + + + + + + C/C++ + m_timespec.tv_nsec = nsec; + + + + + + + C/C++ + return m_sysStartTime; + + + + + + + + C/C++ + int s = OS_AL::ProcessingResources::ProDesc::getEnvInt ("A_TimeScale"); +if (s <= 0) +{ + OS_AL::Util::BString500 bstr ( + "--- Environment variable 'A_TimeScale' must be positive (length of ticks in microseconds)"); + OSAL_ERROR (bstr); +} +else { + s = 1000; // default value 1000 µs = 1 ms + + OS_AL::Util::Print print; + print << + " --- Environment variable 'A_TimeScale' not found. Time intervals are assumed expressed in milliseconds." << showI; +} + +return s; + + + C/C++ + this->ticks(); +reset (); + + + + + + + C/C++ + this->ticks(); +m_timespec = t2.m_timespec; + + + + + + + + + C/C++ + this->ticks(); +setSec (ticks / m_moduloSec); +setUsec ((ticks % m_moduloSec) * m_timeScale); + + + + + + + + C/C++ + TimeVal current; +current.update (); +return current; + + + + C/C++ + /* +if (m_bFrozen) { + *this = m_freezeTime; +} +else { +*/ + *this = systemTime () - m_sysStartTime; +// } + + + + + + + + C/C++ + TimeVal current; +clock_gettime (CLOCK_REALTIME, &current.m_timespec); + +return current; + + + + + + + + + + + + C/C++ + m_timespec = tv2.m_timespec; + +return *this; + + + + + + + + + + + + C/C++ + m_timespec.tv_sec += incr.m_timespec.tv_sec; +m_timespec.tv_nsec += incr.m_timespec.tv_nsec; + +if (m_timespec.tv_nsec >= 1000*1000*1000) +{ + m_timespec.tv_sec ++; + m_timespec.tv_nsec -= 1000*1000*1000; +} + +return *this; + + + + + + + + + + + + C/C++ + m_timespec.tv_sec -= incr.m_timespec.tv_sec; +m_timespec.tv_nsec -= incr.m_timespec.tv_nsec; + +if (m_timespec.tv_nsec < 0) +{ + m_timespec.tv_sec --; + m_timespec.tv_nsec += 1000*1000*1000; +} + +return *this; + + + + + + + + + + + + C/C++ + TimeVal r (*this); +r += tv2; + +return r; + + + + + + + + + + + + C/C++ + TimeVal r (*this); +r -= tv2; + +return r; + + + + + + + + + + + + + C/C++ + return ( + (getSec () < tv2.getSec ()) || + (getSec () == tv2.getSec () && getNsec () < tv2.getNsec ())); + + + + + + + + + + + + + C/C++ + return ( + (getSec () < tv2.getSec ()) || + (getSec () == tv2.getSec () && getNsec () <= tv2.getNsec ())); + + + + + + + + + + + + + C/C++ + return ( + (getSec () == tv2.getSec ()) && (getNsec () == tv2.getNsec ())); + + + + + + + + + + + + C/C++ + return (!(*this == tv2)); + + + + + + + + + + + + C/C++ + return ( + (getSec () > tv2.getSec ()) || + (getSec () == tv2.getSec () && getNsec () >= tv2.getNsec ())); + + + + + + + + + + + + + C/C++ + return ( + (getSec () > tv2.getSec ()) || + (getSec () == tv2.getSec () && getNsec () > tv2.getNsec ())); + + + + + + + + + C/C++ + TimeVal current = TimeVal::current (); + +return ( + (getSec () < current.getSec ()) || + (getSec () == current.getSec () && getNsec () <= current.getNsec ())); + + + + C/C++ + m_timespec.tv_sec = 0; +m_timespec.tv_nsec = 0; + + + + + + + + + C/C++ + // m_moduloSec is 1000000 / m_timeScale +return + (getSec () * m_moduloSec) + + (getUsec () / m_timeScale); + + + + + + + + C/C++ + // adjust startTime +m_sysStartTime += delta; + + + + + create a new TimeVal and initilize it with 0 + + + + + copy constructor + + + + + + + + + create a TimeValue when given a number of ticks + + + + + + + + + + + + + + + + + update with current "accord" time, returned time is relative to +start of system and can be frozen (useful for debugging) + + + + + return current time (see update) + + + + + + + + + return current system time + + + + + + + + + + + + + + + + + + + increase/decrease time by increment/decrement + + + + + + + + + + + + + + + + + + + + + + + +/- operators that adds/substracts another timeval + + + + + + + + + + + + + + + + + + + + + + + all kinds of comparisons ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + return the number of ticks represented by the timevalue + + + + + + + + + + returns true, if the current system time is later than this timeValue. +The method is called "hasPassed", since it can be used as a test +whether a deadline has passed - assuming that the stored timevalue +represents this deadline. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + set seconds and µ-seconds to zero + + + + + + + + + + + + + + + + + + adjust the current time after the execution has been stopped +(principally for debugging). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Incomplete. Without LeftShiftTrace + + + + The class Trace supports tracing. It should by instantiated +by passing a value of type Flag. These flags specify the trace +category (for instance traces related to an abstract object) and +are defined in class FlagSet. An environment variable controls +at execution time which trace categories are actually producing +output. + +Instead of directly creating instances of class Trace (on the stack), +the developer should use the macro TRACEpr which respects the compile +time flag ENABLE_TRACING. It creates the instance "pr" on the stack, +if ENABLE_TRACING is set. + +Messages to the instance "pr" are sent via the overloaded operator<<, +the supported datatypes are the same as for class Print (in fact, +the operators delegate the calls to an internal object of type print). +As for class Trace, the developer should use the macro PR to do this. +Don't forget to pass at least one "showI" to the trace instance before +it gets out of scope - otherwise the output would be empty. + +\code +Example: + function f () + { + TRACEpr (AO); // if ENABLE_TRACING => Trace pr (Flag_AO); + PR ("Function f << showI"); + PR ("This is message number " << number << showI); + } +\endcode + + + + + + + + + + + + + + + + + + + + + + C/C++ + return m_status; + + + + + + + C/C++ + if (!m_status) + PRINTerr ("NO Print for this Trace instance"); + + return (*m_prt); + + + + + + + + C/C++ + m_traceMark = traceMark; + + + + + + + + + + + + + + + + + query status + should not be called by user code (only used by overloaded operators) + + + + + + + + + + modify status + should not be called by user code (only used by overloaded operators) + + + + + + + + + + + + + + + + + + This class contains some static methods that manage a set of flags. +It is possible to add, substract or setup flags. + + + + + + + + + + + + + + + + + + C/C++ + return (f & current); + + + + + + + + + + + C/C++ + Flag old = (Flag) current; + current |= f; + + return old; + + + + + + + + + + + + C/C++ + Flag old = (Flag) current; + current = current & (~f); + + return old; + + + + + + + + + + + + C/C++ + Flag old = (Flag) current; + current = f; + + return old; + + + + + + + + + + + + C/C++ + int flags = 0; + for (unsigned int i = 0; i < fStr.length (); ++i) + { + const char f = fStr[i]; + switch (f) + { + case 'A': + flags |= FLAG_Ap; + break; + case 'C': + flags |= FLAG_Ch; + break; + case 'G': + flags |= FLAG_Gr; + break; + case 'O': + flags |= FLAG_AO; + break; + case 'R': + flags |= FLAG_RB; + break; + case 'S': + flags |= FLAG_Sc; + break; + case 'T': + flags |= FLAG_Ti; + break; + case 'U': + flags |= FLAG_Ut; + break; + case 'V': + flags |= FLAG_VM; + break; + case 'Z': + flags |= FLAG_Z; + break; + case '1': + flags |= FLAG_F1; + break; + case '2': + flags |= FLAG_F2; + break; + case '3': + flags |= FLAG_F3; + break; + case '4': + flags |= FLAG_F4; + break; + case '5': + flags |= FLAG_F5; + break; + case '6': + flags |= FLAG_F6; + break; + case '7': + flags |= FLAG_F7; + break; + case '8': + flags |= FLAG_F8; + break; + case '9': + flags |= FLAG_F9; + break; + case 'a': + flags |= FLAG_Fa; + break; + case 'b': + flags |= FLAG_Fb; + break; + case 'c': + flags |= FLAG_Fc; + break; + case 'd': + flags |= FLAG_Fd; + break; + case 'e': + flags |= FLAG_Fe; + break; + case 'f': + flags |= FLAG_Ff; + break; + case 'g': + flags |= FLAG_Fg; + break; + case 'h': + flags |= FLAG_Fh; + break; + case 'i': + flags |= FLAG_Fi; + break; + default: + PRINTpr ("unknown flag : "); + pr << f << showErr; + break; + } + } + Flag old = setUp ((Flag) flags); + + return old; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * An enumeration of flags that is used for tracing (at different places) + * It forms a bit vector. In the list below, we list the flags that + * are available, together with the letter in the A_Trace<zone-nr> + * environment variable that is used to activate the tracing. + * (if one zone is used, A_Trace0 defines the tracing that is + * activated) + * + * * FLAG_Ap 'A': appliation tracing + * * FLAG_Ch 'C': Message channel/queue (in case of distribution) + * * FLAG_Gr 'G': currently unused + * * FLAG_AO 'O': active object + * * FLAG_RB 'R': rbox - used for passing out and return parameters + * back to a caller + * * FLAG_Sc 'S': Scheduling + * * FLAG_Ti 'T': Task related + * * FLAG_Ut 'U': currently unused + * * FLAG_VM 'V': virtual machine (now OS abstraction layer), i.e. for + * Threads, SharedMemory and synchronisation classes + * such as Lock, Barrier and Condition + * * FLAG_Z 'Z': Related to zone aspects, used by ZoneController and + * in class Main. + * * FLAG_F1 '1': currently unused (used by a test program) + * * FLAG_F2 '2': currently unused + * * FLAG_F3 '3': currently unused + * * FLAG_F4 '4': currently unused + * * FLAG_F5 '5': currently unused (used by a test program) + * * FLAG_F6 '6': Indicates "return from debugger detection" in + * Time/DebugTimer and deadline violations + * * FLAG_F7 '7': Related to "container" classes, i.e. class + * CircularBuffer and BOL (Bounded ordered list) + * * FLAG_F8 '8': used for class SR_List (list of service requests) + * * FLAG_F9 '9': used for class ProDesc + * * FLAG_Fa 'a': currently unused + * * FLAG_Fb 'b': currently unused + * * FLAG_Fc 'c': currently unused + * * FLAG_Fd 'd': deadline control + * * FLAG_Fe 'e': currently unused + * * FLAG_Ff 'f': currently unused + * * FLAG_Fg 'g': currently unused + * * FLAG_Fh 'h': currently unused + * * FLAG_Fi 'i': currently unused + * * FLAG_Fj 'j': currently unused + * * FLAG_Fk 'k': currently unused + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A template for bounded string of arbitrary size. Most common functions +are factored out to the superclass BString. Constructors and the +storage - who cannot be defined in the superclass - are defined here. + + + + + + + + + + + + + + C/C++ + charTable = m_charStorage; +charTableSize = maxSize; +commonInit (); + + + + + + + + + + + + + + C/C++ + charTable = m_charStorage; +charTableSize = maxSize; +commonInit (); + +concat (ch, nChar); + + + + + + + + C/C++ + charTable = m_charStorage; +charTableSize = maxSize; +commonInit (); + +concat (bString.data()); + + + + + + + + C/C++ + charTable = m_charStorage; +charTableSize = maxSize; +commonInit (); + +concat (bString.data()); + + + + + + + + + C/C++ + charTable = m_charStorage; +charTableSize = maxSize; +commonInit (); + +concat (constCharP); + + + + + + Initialize a BString with a specific character and optionally a +number of repetitions. + + + + + + + + + + + + + + Create a BStringT given another bounded string of arbitrary size. + + + + + + The copy constructor. +Although it would be always ok to use the constructor above, this copy +constructor is necessary to avoid that the compiler implicitly +inserts a default copy constructor. + + + + + + Initialize a bounded string with a character pointer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A superclass for the template class BStringT. It factors out +all functions that do not depend on the template parameter. +Since it does not provide storage for the string, never instantiate +this class but BStringT instead (to enforce this, the constructor +is protected) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + the amount of memory allocated for the string table + + + + + + + + the length of the string in bytes (not the amount of memory allocated) + + + + + + + + + + + + + + + + + C/C++ + return charTable[index]; + + + + + + + + + + + + C/C++ + *this += d; +return *this; + + + + + + + + C/C++ + return charTableSize; + + + + + + + + + + + + + C/C++ + return !strcmp (charTable, constCharP); + + + + + + + + + + + + C/C++ + return !strcmp (charTable, bString.charTable); + + + + + + + + + + + + + C/C++ + return strcmp (charTable, consCharP); + + + + + + + + + + + + C/C++ + return strcmp (charTable, bString.charTable); + + + + + + + + C/C++ + return charTable; + + + + + + + + C/C++ + return nbytes; + + + + + + + + + + + + + C/C++ + unsigned int old = numBase; +numBase = newBase; + +return old; + + + + + + + + + C/C++ + return current - charTable; + + + + + + + + C/C++ + return m_scanOk; + + + + + + + + C/C++ + return m_separator; + + + + + + + + C/C++ + m_separator = separator; + + + + + + + + C/C++ + charTable = current = (char*) charP; +numBase = 0; +m_separator = StdSeparators; +charTableSize = 0; +nbytes = strlen(charP); + + + + + + + + + C/C++ + nbytes = 0; +concat (constCharP); +current = charTable; + + + + + + + + C/C++ + nbytes = 0; +concat (bString.charTable); +current = charTable; + + + + + + + + + C/C++ + char buffer[sizeof(unsigned int)*2+1]; + +sprintf (buffer, "%x", (unsigned int) 0 /*vp*/); +concat (buffer); + + + + + + + + + C/C++ + concat (constCharP); + + + + + + + + C/C++ + concat (c, 1); + + + + + + + + C/C++ + concat (bStr2.data()); + + + + + + + + + C/C++ + // actually, we would need a calculation of the needed buffer size: +// round-up the log10 of maxint + 2 bytes for the sign and the +// trailing 0, but it is simpler to come up with something "big enough" +char buffer[30]; +sprintf (buffer, "%i", i); +concat (buffer); + + + + + + + + + C/C++ + char buffer[30]; +sprintf (buffer, "%d", (int) l); +concat (buffer); + + + + + + + + + C/C++ + char buffer[30]; +sprintf (buffer, "%g", d); +concat (buffer); + + + + + + + + + C/C++ + char buffer[30]; +sprintf (buffer, "%f", f); +concat (buffer); + + + + + + + + + C/C++ + char buffer[30]; +sprintf (buffer, "%u", ui); +concat (buffer); + + + + + + + + + C/C++ + char buffer[30]; +sprintf (buffer, "%u", (unsigned int) ul); +concat (buffer); + + + + + + + + + + + + + + + + + + + C/C++ + unsigned int n = 0; + +for (; current < charTable + nbytes; ++current) +{ + if (strrchr (m_separator, *current) != NULL) + { // *current IS a separator + if (n > 0) + break; // end of word + // else // separators before word + } + else + { // *current IS a character of word + if (n >= sizeBuff - 1) + { + break; // truncate if word too long + } + // with NO WARNING ! but caller may test : + // if (n == sizeBuff-1) ... + buff[n++] = *current; // store a character of word + } +} + +buff[n] = '\0'; // append a null terminator + +return n; + + + + + + + + + + + + + C/C++ + char buff[2]; +if (getWord (buff, sizeof (buff)) > 0) +{ + c = buff[0]; +} +m_scanOk = (current < charTable + nbytes); +return *this; + + + + + + + + + + + + + C/C++ + char *lastP; +//double k= strtol(current, &lastP, numBase); +double k = strtod (current, &lastP); + +m_scanOk = (current != lastP); +if (m_scanOk) { + d = k; // don't modify arg, if extraction failed + current = lastP; +} +return *this; + + + + + + + + + + + + + C/C++ + char *lastP; +//float k= strtol(current, &lastP, numBase); + #ifdef SYSTEM_VxWorks +// strtof seems to be missin in vxWorks +float k = strtod (current, &lastP); + #else +float k = strtof (current, &lastP); + #endif + +m_scanOk = (current != lastP); +if (m_scanOk) { + f = k; // don't modify arg, if extraction failed + current = lastP; +} +return *this; + + + + + + + + + + + + + C/C++ + char *lastP; +int k = strtol (current, &lastP, numBase); + +m_scanOk = (current != lastP); +if (m_scanOk) { + i = k; // don't modify arg, if extraction failed + current = lastP; +} +return *this; + + + + + + + + + + + + + C/C++ + char *lastP; +long k = strtol (current, &lastP, numBase); + +m_scanOk = (current != lastP); +if (m_scanOk) { + l = k; // don't modify arg, if extraction failed + current = lastP; +} +return *this; + + + + + + + + + + + + + C/C++ + char *lastP; +long k = strtol (current, &lastP, numBase); + +m_scanOk = (current != lastP); +if (m_scanOk) { + ui = k; // don't modify arg, if extraction failed + current = lastP; +} +return *this; + + + + + + + + + + + + + C/C++ + char *lastP; +unsigned long k = strtol (current, &lastP, numBase); + +m_scanOk = (current != lastP); +if (m_scanOk) { + ul = k; // don't modify arg, if extraction failed + current = lastP; +} +return *this; + + + + + + + + + C/C++ + char *target = charTable + nbytes; +char *bound = charTable + charTableSize; +while (target != bound && *constCharP != '\0') +{ + *target++ = *constCharP++; + nbytes++; +} +if (target == bound) + OSAL_ERROR ("Bounded character table too short"); +*target = '\0'; + + + + + + + + + + + + + + C/C++ + char *target = charTable + nbytes; +char *bound = charTable + charTableSize; +unsigned int i = 0; +while (target != bound && i < size) +{ + *target++ = *constCharP++; + nbytes++; + i++; +} +if (target == bound) + OSAL_ERROR ("Bounded character table too short"); +*target = '\0'; + + + + + + + + + + + + + + C/C++ + if (nbytes + nChar >= charTableSize) { + OSAL_ERROR ("Bounded character table too short"); +} + +unsigned int i; +char *cP = charTable + nbytes; +for (i = 0; i < nChar; i++) { // concat stops on terminating zero + *cP++ = ch; +} +*cP = '\0'; +nbytes += nChar; + + + + C/C++ + numBase = 0; +current = charTable; + +m_separator = StdSeparators; + +charTable[0] = '\0'; +nbytes = 0; + + + + + + + + + C/C++ + if (pos > (unsigned int) (current - charTable + nbytes)) { + OSAL_ERROR ("BString::setPosition pos > current-begin"); +} + +current = charTable + pos; + + + + + + + + + + + + + C/C++ + *this += vp; +return *this; + + + + + + + + + + + + C/C++ + *this += constCharP; +return *this; + + + + + + + + + + + + C/C++ + *this += c; +return *this; + + + + + + + + + + + + C/C++ + *this += i; +return *this; + + + + + + + + + + + + C/C++ + *this += l; +return *this; + + + + + + + + + + + + C/C++ + *this += ui; +return *this; + + + + + + + + + + + + C/C++ + *this += ul; +return *this; + + + + + + + + + + + + C/C++ + *this += f; +return *this; + + + + + + + + + + + C/C++ + *this += bStr; +return *this; + + + + forbid the creation of an BString without storage. + + + + + forbid the implicit copying of a BString without storage. +If the copying to a BStringT type should be avoided for the sake +of efficiency, an assignment to a reference type (BString&) should be +used explicitly. +The constructor is declared private to avoid that the default +copy constructor of a subclass will based on it (which won't work, +since it is empty). Effectively, we force that the subclass declares +its own copy constructor. + + + + + + + + + create a string wrapper for a const char* +A string initialized with this pointer has a size of 0 (allocated +memory) and cannot be modified. It is a convenient way to pass +C-strings directly to functions that have a const BString & +parameter. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Scan string to retrieve one of the following types. If the scanning +was successfull (see operation scanOk), the current scan position +is set just behind the input consumed. Therefore, a successive +invocation of this operator will continue scanning at the new +position (see get/setPosition) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + the standard index operator + + + + + + + + + + + + + + + Indicates, whether the last scan (via operator >>) was successfull + + + + + + + + + + Set numerical base for the scanning of longs and integer) +(the default value 0 indicates base 10) + + + + + + + + + + + + + + + Get the current position within the string for scanning +(via operator >>). + + + + + + + + + + Set the current position within the string for scanning +(via operator >>). + + + + + + + + comparison operators with the obvious semantics ... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Provide access to the memory location of the string. Use with care, +since it allows a caller to corrupt the string contents. + + + + + + + + + + get the string containing separator characters that are used by +getWord and during the scanning of characters. + + + + + + + + set the string containing separator characters. Only the address of +the passed string is stored (no copy is made). Therefore, the passed +string may not be a local variable that might run out of scope. + + + + + + + + retrieve a pointer to a part of the character string + + + + + + + + + + + + + + returns the size of the allocated memory (i.e. the maximum length +of the string) + + + + + + + + returns the length of the string + + + + + + + + + internal function that appends (concatenates) a string to the +character table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + return middle; + + + + + + + + C/C++ + return middle; + + + + + + + + C/C++ + m_mark = mark; + + + + + + + + + + + + C/C++ + middle = str; +return *this; + + + + + + + + + + + + + C/C++ + middle = ccp; +return *this; + + + + + + + + + + + + C/C++ + middle << str; +return *this; + + + + + + + + + + + + + C/C++ + middle << ccp; +return *this; + + + + C/C++ + + + + + + + + + + C/C++ + m_initFlag = 1; +m_head = ccp; + + + + + + + + C/C++ + return m_head; + + + + + + + + + C/C++ + BString500 bstr; +bstr << OS_AL::ProcessingResources::Thread::getName () << " "; +bstr << OS_AL::Time::TimeVal::current ().ticks () << " "; + +if (m_initFlag) { + bstr << m_head; +} +bstr << ErrMark << ccp; +if (errno) + bstr << " - error " << errno + << " (" << strerror (errno) << ")"; +cout << bstr.data () << endl; +errno = 0; + + + + + + + + + + + + + + + + + + + C/C++ + BString500 str (file); +str << line << charP; +printErr (str.data ()); + + + + + + + + + + + + + + C/C++ + BString500 prefix; +// prefix << "ID: " << (void*) Thread::getId () << " "; +prefix << OS_AL::ProcessingResources::Thread::getName () << " "; +prefix << OS_AL::Time::TimeVal::current ().ticks () << " "; +if (m_initFlag) { + prefix << m_head; +} +prefix << mark << begin; + +if (log) { + // messages with file stamp + clog << prefix.data () << middle.data() << endl; +} +else { + cout << prefix.data () << middle.data() << endl; +} +m_shown = 1; + + + + C/C++ + middle = ""; +m_shown = 1; // allows to avoid showing empty instances + + + + + + + + + + + + + C/C++ + middle << ch; +return *this; + + + + + + + + + + + C/C++ + print (StdMark); +clean (); +return *this; + + + + C/C++ + if (m_shown == 0) { + print (m_mark.data ()); // print residual middle text + printErr ("Instance of print destroyed, before it was shown (missing \"showI\"). Stored text is: "); + print (" <<"); +#if StopIfNeverShown == 1 + exit(1); +#endif +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Predefined types and variables to provoke output). The (dummy) types are +used to overload the << operator and statically choose the associated +method if an instance (declared below) is passed. +Show: output the whole line immediately and reset the output string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pthread + rt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.di new file mode 100644 index 00000000000..6432ab900ff --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.di @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.notation new file mode 100644 index 00000000000..66345951ba3 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.notation @@ -0,0 +1,2575 @@ + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
      + + + + + +
      + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.uml new file mode 100644 index 00000000000..af9181b76ac --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/statemachine.uml @@ -0,0 +1,516 @@ + + + + + Call event interceptor, interacts with state-machine. It will handle in particular call events that are intercepted by the port operations + + + Container rule for state machine realization. It consists of a collaboration of a call event interceptor, an event pool, the state-machine itself and a thread for this state-machine. The latter means that the state-machine will execute in its own thread and poll the pool for new events. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + !xtend StateMachineGen.eventInterceptor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + !xtend StateMachineGen.processEvents + + + + + C/C++ + !xtend StateMachineGen.activate + + + + + + + + + + + + + + + + + + + + + + + + + + + Animation service configurator takes care of allocating the RemoveAnimService on the "right" node and to connect local and remote service configurators. + + + + + + + + + + + + + C/C++ + if (outAnimSvc != 0) { + outAnimSvc->leaveState(stateEnum, eInstance); +} + + + + C/C++ + if (outAnimSvc != 0) { + outAnimSvc->enterState(stateEnum, eInstance); +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <<TextualRepresentation>>public abstract enterState (in stateEnum : StateMachine::Short, in eInstance : String) ; + + + + + + + + + + + + + + + <<TextualRepresentation>>public abstract leaveState(in eState : StateMachine::Short, in eInstance : String) ; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Container rule for an OO state machine. The main difference is that we use OO variants of the contained elements and replace the interception connector by an interception operation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + !xtend StateMachineGen.eventInterceptorOO + + + C/C++ + // create connection between thread and this class +thread.connect_rLC(get_lc()); + + + C/C++ + !xtend StateMachineGen.processEvents + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.di new file mode 100644 index 00000000000..dbd0aabd9ce --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.di @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.notation new file mode 100644 index 00000000000..0122891b2b9 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.notation @@ -0,0 +1,269 @@ + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + parametersName + parametersDirection + name + parametersType + returnType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.uml new file mode 100644 index 00000000000..35fb7fa4914 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/library/sysinterfaces.uml @@ -0,0 +1,94 @@ + + + + + Support for Signal Reception. Interfaces that have at least one signal reception should also inherit from this interface in order to allow for signal reception. +Currently not clear whether that should be done as part of the component to OO transformation or within the application model on user demand. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <<TextualRepresentation>>public addEvent () { } + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.di new file mode 100644 index 00000000000..61f9c2fac17 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.di @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.notation new file mode 100644 index 00000000000..989a0923956 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.notation @@ -0,0 +1,119 @@ + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.uml new file mode 100644 index 00000000000..aec9cff4984 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassModel.uml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.di b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.di new file mode 100644 index 00000000000..9ff5520aae6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.di @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.notation b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.notation new file mode 100644 index 00000000000..57b432f3a65 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.notation @@ -0,0 +1,51 @@ + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.uml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.uml new file mode 100644 index 00000000000..b90cad4bdad --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/models/wizardTemplates/QompassSimple.uml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.properties b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.properties new file mode 100644 index 00000000000..2e655ccb549 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus extra: Qompass core model library (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.xml new file mode 100644 index 00000000000..ed77d369a14 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/plugin.xml @@ -0,0 +1,156 @@ + + + + + + class="org.eclipse.papyrus.qompass.designer.gentools.cpp.CppLanguageSupport" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/pom.xml b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/pom.xml new file mode 100644 index 00000000000..e44092312e0 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../releng/extra + + org.eclipse.papyrus.qompass.modellibs.core + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-clean-plugin + + + + xtend-gen + + **/* + + + .gitignore + + + + + + + org.eclipse.xtend + xtend-maven-plugin + + + generate-sources + + compile + + + + + xtend-gen + ${project.build.directory}/xtend-gen/test + + + + + diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/Activator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/Activator.java new file mode 100644 index 00000000000..8859e978d40 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/Activator.java @@ -0,0 +1,60 @@ +package org.eclipse.papyrus.qompass.modellibs.core; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.modellibs.core"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + public static LogHelper log; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + + // register the login helper + log = new LogHelper(plugin); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java new file mode 100644 index 00000000000..5972200b5ff --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/HelloWorldModelWizard.java @@ -0,0 +1,27 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core; + +import org.eclipse.papyrus.uml.diagram.wizards.ModelCopyWizard; + +/** + * Copy wizard for the HelloWorld example + */ +public class HelloWorldModelWizard extends ModelCopyWizard { + + public HelloWorldModelWizard() { + super("HelloWorld"); //$NON-NLS-1$ + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java new file mode 100644 index 00000000000..38ae39a4204 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/ProducerConsumerModelWizard.java @@ -0,0 +1,27 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core; + +import org.eclipse.papyrus.uml.diagram.wizards.ModelCopyWizard; + +/** + * Copy wizard for the ProducerConsumer example + */ +public class ProducerConsumerModelWizard extends ModelCopyWizard { + + public ProducerConsumerModelWizard() { + super("ProducerConsumer"); //$NON-NLS-1$ + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindCppIncludeToFirstActual.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindCppIncludeToFirstActual.java new file mode 100644 index 00000000000..a8e25cbbf12 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindCppIncludeToFirstActual.java @@ -0,0 +1,73 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.bindinghelpers; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.C_Cpp.Include; +import org.eclipse.papyrus.FCM.util.IBindingHelper; +import org.eclipse.papyrus.qompass.designer.core.listeners.PostCopyListener; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; +import org.eclipse.papyrus.qompass.designer.core.templates.TextTemplateBinding; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Instantiate (bind Acceleo template) the text within a C++Include stereotype. + * + * The actual is the first actual within the template binding. This function does not check + * whether the classifier has the template stereotype. + * + * Note: this function is C++ specific, but many parts of the model library are C++ specific as well + * + */ +public class BindCppIncludeToFirstActual implements PostCopyListener, IBindingHelper { + + @Override + public void postCopyEObject(LazyCopier copy, EObject targetEObj) { + // if (copy.get(sourceEObj) isWithinTemplate) + if (targetEObj instanceof Classifier) { + + Classifier targetCl = (Classifier) targetEObj; + try { + Classifier actual = TemplateUtils.getFirstActualFromBinding(binding); + Include cppInclude = UMLUtil.getStereotypeApplication(targetCl, Include.class); + if ((actual != null) && (cppInclude != null)) { + TransformationContext.classifier = targetCl; + String newBody = TextTemplateBinding.bind(cppInclude.getBody(), actual, null); + String newPreBody = TextTemplateBinding.bind(cppInclude.getPreBody(), actual, null); + String newHeader = TextTemplateBinding.bind(cppInclude.getHeader(), actual, null); + cppInclude.setBody(newBody); + cppInclude.setPreBody(newPreBody); + cppInclude.setHeader(newHeader); + } + } catch (TransformationException e) { + // create nested exception + throw new RuntimeException(e); + } + } + } + + protected TemplateBinding binding; + + @Override + public void handleElement(TemplateBinding binding, Element object) { + this.binding = binding; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindOperation.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindOperation.java new file mode 100644 index 00000000000..6b2d352e1ee --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/BindOperation.java @@ -0,0 +1,54 @@ +package org.eclipse.papyrus.qompass.modellibs.core.bindinghelpers; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.FCM.util.IBindingHelper; +import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; +import org.eclipse.papyrus.qompass.designer.core.templates.BindingUtils; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.qompass.modellibs.core.Activator; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.OpaqueBehavior; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.TemplateBinding; + +/** + * Bind an operation to an actual, i.e. evaluate the Acceleo template within the opaque behavior associated with + * the operation. + */ +public class BindOperation implements IBindingHelper, PreCopyListener { + + private TemplateBinding binding; + + @Override + public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { + + if (sourceEObj instanceof Operation) { + Operation operation = (Operation) sourceEObj; + Classifier actual = TemplateUtils.getFirstActualFromBinding(binding); + + Operation newOperation = BindingUtils.instantiateOperation(copy, actual, operation); + for (Behavior method : operation.getMethods()) { + if (method instanceof OpaqueBehavior) { + try { + Behavior newBehavior = + BindingUtils.instantiateBehavior(copy, actual, (OpaqueBehavior) method); + newBehavior.setSpecification(newOperation); + } catch (TransformationException e) { + Activator.log.error(e); + } + } + } + return newOperation; + } + return sourceEObj; + } + + @Override + public void handleElement(TemplateBinding binding, Element object) { + this.binding = binding; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/InstantiateCppIncludeWithItSelf.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/InstantiateCppIncludeWithItSelf.java new file mode 100644 index 00000000000..cd4a730ee30 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/InstantiateCppIncludeWithItSelf.java @@ -0,0 +1,74 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.bindinghelpers; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.C_Cpp.Include; +import org.eclipse.papyrus.FCM.Template; +import org.eclipse.papyrus.FCM.util.IBindingHelper; +import org.eclipse.papyrus.qompass.designer.core.listeners.PostCopyListener; +import org.eclipse.papyrus.qompass.designer.core.templates.TextTemplateBinding; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Instantiate (bind Acceleo template) the text within a C++Include stereotype. + * + * Difference to InstantiateCppInclude: This function does not obtain the actual from a template + * binding. Instead it takes the classifier having the Template stereotype as actual. + * TODO: What's the use of this function. The classifier is known at this time - unless in a template? + * + * Note: this function is C++ specific, but many parts of the model library are C++ specific as well + * + */ +@Deprecated +public class InstantiateCppIncludeWithItSelf implements PostCopyListener, IBindingHelper { + + @Override + public void postCopyEObject(LazyCopier copy, EObject targetEObj) { + // if (copy.get(sourceEObj) isWithinTemplate) + if (targetEObj instanceof Classifier) { + // TODO: C++ specific code! + Classifier targetCl = (Classifier) targetEObj; + Template template = UMLUtil.getStereotypeApplication(targetCl, Template.class); + // apply, in case of pass-classifier + if ((template != null) && (template.getHelper() == null)) { + try { + Include cppInclude = UMLUtil.getStereotypeApplication(targetCl, Include.class); + TransformationContext.classifier = targetCl; + String newBody = TextTemplateBinding.bind(cppInclude.getBody(), targetCl, null); + String newPreBody = TextTemplateBinding.bind(cppInclude.getPreBody(), targetCl, null); + String newHeader = TextTemplateBinding.bind(cppInclude.getHeader(), targetCl, null); + cppInclude.setBody(newBody); + cppInclude.setPreBody(newPreBody); + cppInclude.setHeader(newHeader); + } catch (TransformationException e) { + // create nested exception + throw new RuntimeException(e); + } + } + } + } + + @Override + public void handleElement(TemplateBinding binding, Element object) { + // don't need to handle binding + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/LoopOperations.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/LoopOperations.java new file mode 100644 index 00000000000..996363af3dd --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/bindinghelpers/LoopOperations.java @@ -0,0 +1,130 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.bindinghelpers; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.FCM.util.IBindingHelper; +import org.eclipse.papyrus.qompass.designer.core.listeners.PreCopyListener; +import org.eclipse.papyrus.qompass.designer.core.templates.BindingUtils; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; +import org.eclipse.papyrus.qompass.designer.core.templates.TextTemplateBinding; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.qompass.modellibs.core.Activator; +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.EnumerationLiteral; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.OpaqueBehavior; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.Type; + +/** + * This binding helper loops over all operations of the actual template parameter + * (typically an interface) + * + */ +public class LoopOperations implements IBindingHelper, PreCopyListener { + + private TemplateBinding binding; + + @Override + public EObject preCopyEObject(LazyCopier copy, EObject sourceEObj) { + + if (sourceEObj instanceof Operation) { + Operation operation = (Operation) sourceEObj; + + Classifier actual = TemplateUtils.getFirstActualFromBinding(binding); + + if (!(actual instanceof Interface)) { + return sourceEObj; + } + Interface passedActualIntf = (Interface) actual; + Operation last = null; + EList removalList = new BasicEList(); + for (Operation intfOperation : passedActualIntf.getAllOperations()) { + for (Element removalElement : removalList) { + copy.removeForCopy(removalElement); // enable subsequent instantiations + } + removalList.clear(); + last = BindingUtils.instantiateOperation(copy, intfOperation, operation); + removalList.add(operation); + for (Behavior method : operation.getMethods()) { + if (method instanceof OpaqueBehavior) { + try { + Behavior newBehavior = + BindingUtils.instantiateBehavior(copy, intfOperation, (OpaqueBehavior) method); + newBehavior.setSpecification(last); + } catch (TransformationException e) { + Activator.log.error(e); + ; + } + // removalList.add(method); + copy.removeForCopy(method); // enable subsequent instantiations + } + } + } + // from a logical viewpoint, we need to copy parameters & name, but not the + // operation identity. + copy.put(operation, last); + return last; + /* + * else { // not LOOP_OPERATIONS + * Operation newOperation = instantiateOperation(actual, template, operation, boundClass); + * for(Behavior method : operation.getMethods()) { + * if(method instanceof OpaqueBehavior) { + * Behavior newBehavior = + * instantiateBehavior(actual, template, (OpaqueBehavior)method); + * newBehavior.setSpecification(newOperation); + * } + * } + * return newOperation; + */ + } + else if (sourceEObj instanceof EnumerationLiteral) { + EnumerationLiteral literal = (EnumerationLiteral) sourceEObj; + Classifier actual = TemplateUtils.getFirstActualFromBinding(binding); + // Type passedActual = getPassedActual(template, actual, boundClass); + Type passedActual = actual; + if (!(passedActual instanceof Interface)) { + return sourceEObj; + } + Interface passedActualIntf = (Interface) passedActual; + EnumerationLiteral newLiteral = null; + for (Operation intfOperation : passedActualIntf.getAllOperations()) { + copy.removeForCopy(literal); + newLiteral = copy.getCopy(literal); + try { + String newName = TextTemplateBinding.bind(literal.getName(), intfOperation, null); + newLiteral.setName(newName); + } catch (TransformationException e) { + Activator.log.error(e); + newLiteral.setName("none"); //$NON-NLS-1$ + } + } + return newLiteral; + } + return null; + } + + @Override + public void handleElement(TemplateBinding binding, Element object) { + this.binding = binding; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/embeddingrules/AccordCall.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/embeddingrules/AccordCall.java new file mode 100644 index 00000000000..e76e284f645 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/embeddingrules/AccordCall.java @@ -0,0 +1,95 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.embeddingrules; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.papyrus.FCM.Connector; +import org.eclipse.papyrus.FCM.util.ConnectorTypeUtil; +import org.eclipse.papyrus.FCM.util.FCMUtil; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.ConnectableElement; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.util.UMLUtil; + +/** + * Embedding rule + * TODO: currently unused + * + */ +// @unused +public class AccordCall extends ConnectorTypeUtil { + + private ConnectableElement clientRole = null; + private ConnectableElement serverRole = null; + private ConnectableElement rtuRole = null; + private ConnectableElement connectorRole = null; + + @Override + public FCMUtil.RoleBindingTable getRoleBindings(Connector connector) { + super.getRoleBindings(connector); + + clientRole = bindingTable.getRoleKeyByName("client"); + serverRole = bindingTable.getRoleKeyByName("server"); + rtuRole = bindingTable.getRoleKeyByName("rtu"); + connectorRole = bindingTable.getRoleKeyByName("connector"); + + for (org.eclipse.uml2.uml.ConnectorEnd end : connector.getBase_Connector().getEnds()) { + if (end.getRole() instanceof org.eclipse.uml2.uml.Port) { + org.eclipse.uml2.uml.Port port = (org.eclipse.uml2.uml.Port) end.getRole(); + org.eclipse.uml2.uml.Property part = end.getPartWithPort(); + if (StereotypeUtil.isApplied(port, org.eclipse.papyrus.FCM.Port.class)) { + org.eclipse.papyrus.FCM.Port fcmPort = UMLUtil.getStereotypeApplication(port, org.eclipse.papyrus.FCM.Port.class); + if (fcmPort.getKind().getBase_Class().getName().equals("UseInterfaceWithRtf")) { + // => elements associated with the connector end play the client role + List clientActors = new ArrayList(); + clientActors.add(port); + clientActors.add(part); + bindingTable.addEntry(clientRole, clientActors); + } + else if (fcmPort.getKind().getBase_Class().getName().equals("ProvideInterface")) { + // => elements associated with the connector end play the server role + List serverActors = new ArrayList(); + serverActors.add(port); + serverActors.add(part); + bindingTable.addEntry(serverRole, serverActors); + // the property playing the server role must also play the rtu role + port = ((org.eclipse.uml2.uml.Class) part.getType()).getOwnedPort("rtu", null); + if (port == null) { + if (((org.eclipse.uml2.uml.Class) part.getType()).getInheritedMember("rtu") != null && + ((org.eclipse.uml2.uml.Class) part.getType()).getInheritedMember("rtu") instanceof org.eclipse.uml2.uml.Port) { + port = (org.eclipse.uml2.uml.Port) ((org.eclipse.uml2.uml.Class) part.getType()).getInheritedMember("rtu"); + } + else { + System.out.println("Could not find a port rtu on part " + part.getName() + " : " + part.getType()); + } + } + if (port != null) { + List rtuActors = new ArrayList(); + rtuActors.add(port); + rtuActors.add(part); + bindingTable.addEntry(rtuRole, rtuActors); + } + } + } + } + } + List connectorActors = new ArrayList(); + connectorActors.add(connector.getBase_Connector()); + bindingTable.addEntry(connectorRole, connectorActors); + return bindingTable; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/AnimServiceConfigurator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/AnimServiceConfigurator.java new file mode 100644 index 00000000000..b33d4053ed2 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/AnimServiceConfigurator.java @@ -0,0 +1,68 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.iconfigurators; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.qompass.designer.core.deployment.AllocUtils; +import org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Property; + +/** + * Configurator for the Eclipse animation server. This instance is systematically + * allocated to a node named "Eclipse" call event (for a state machine): it sets the + * portID attribute of the call event interceptor. The interceptor uses this + * attribute to initialize the portID attribute within the produced CallEvent + * data structure. + * + * @author ansgar + * + */ +public class AnimServiceConfigurator implements IInstanceConfigurator { + + public final static String eclipseAnimService = "Eclipse"; //$NON-NLS-1$ + + /** + * Configure the instance of a CallEvent interceptor. The configuration parameter is the + * index of the port which gets intercepted. It is obtained via an enumeration + * + * @see org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator#configureInstance(org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.Port) + * + * @param instance + * the instance that should be configured + * @param componentPart + * the part representing this instance + * @param context + * container context + */ + @Override + public void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) + { + EList nodes = AllocUtils.getAllNodesOrThreadsParent(parentInstance); + if (nodes.size() > 0) { + InstanceSpecification node = nodes.get(0); + // problem: instance specification is within intermediate model, thus incomplete. + // option: explicitly pre-create singletons (and allocate these?) + NamedElement animService = node.getNearestPackage().getMember(eclipseAnimService); + if (animService instanceof InstanceSpecification) { + AllocUtils.allocate(instance, (InstanceSpecification) animService); + return; + } + } + // throw new TransformationRTException(String.format("Cannot find node <%s> in platform definition", eclipseAnimService)); + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/CallEventConfigurator.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/CallEventConfigurator.java new file mode 100644 index 00000000000..db9831cd43a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/iconfigurators/CallEventConfigurator.java @@ -0,0 +1,61 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.iconfigurators; + +import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; +import org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Property; + +/** + * Configurator of a call event (for a state machine): it sets the + * portID attribute of the call event interceptor. The interceptor uses this + * attribute to initialize the portID attribute within the produced CallEvent + * data structure. + * + * @author ansgar + * + */ +public class CallEventConfigurator implements IInstanceConfigurator { + + public final static String portAttribute = "portID"; //$NON-NLS-1$ + + /** + * Configure the instance of a CallEvent interceptor. The configuration parameter is the + * index of the port which gets intercepted. It is obtained via an enumeration + * + * @see org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator#configureInstance(org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.InstanceSpecification, org.eclipse.uml2.uml.Port) + * + * @param instance + * the instance that should be configured + * @param componentPart + * the part representing this instance + * @param context + * container context + */ + @Override + public void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) + { + if (parentInstance != null) { + // make sure that there is an enum par port + // String literalName = "port_" + UMLTool.varName(context.port); //$NON-NLS-1$ + + // the associated enumeration is declared by the statemachine (which is included by the bootloader as well) + + DepPlanUtils.configureProperty(instance, portAttribute, 0); + } + } + +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIcallback.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIcallback.java new file mode 100644 index 00000000000..74809d9cc9b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIcallback.java @@ -0,0 +1,162 @@ +package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; + +import java.util.Iterator; + +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.util.IMappingRule; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.ParameterDirectionKind; +import org.eclipse.uml2.uml.Type; + + +public class AMIcallback implements IMappingRule { + + private static final String _REPLY = "_reply_"; //$NON-NLS-1$ + private static final String _REQUEST = "_request_"; //$NON-NLS-1$ + private static final String AMI_CB = "AMI_CB"; //$NON-NLS-1$ + + @Override + public Type calcDerivedType(Port p, boolean update) { + Type type = p.getType(); + if (!(type instanceof Interface)) { + return null; + } + + Interface typingInterface = (Interface) type; + Class derivedType = MapUtil.getDerivedClass(p, AMI_CB); + Interface derivedRequestInterface = MapUtil.getDerivedInterface(p, _REQUEST); + Interface derivedReplyInterface = MapUtil.getDerivedInterface(p, _REPLY); + MapUtil.addUsage(derivedType, derivedRequestInterface); // caller can use (require) the request interface + MapUtil.addRealization(derivedType, derivedReplyInterface); // callers must implement (provide) the reply interface + + if (!update) { + return derivedType; + } + + // ----------------------------------------------- + // calculate "request" interface (OUT parameter are removed) + // ----------------------------------------------- + for (Operation operation : typingInterface.getOwnedOperations()) { + String name = operation.getName(); + + // check whether operation already exists. Create, if not + Operation derivedOperation = derivedRequestInterface.getOperation(name, null, null); + if (derivedOperation == null) { + derivedOperation = derivedRequestInterface.createOwnedOperation(name, null, null); + } + + // request operation contains only in and inout parameters + for (Parameter parameter : operation.getOwnedParameters()) { + if ((parameter.getDirection() == ParameterDirectionKind.IN_LITERAL) || + (parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL)) { + + String paramName = parameter.getName(); + Type paramType = parameter.getType(); + if (derivedOperation.getOwnedParameter(paramName, paramType) == null) { + Parameter newParameter = derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType()); + newParameter.setDirection(parameter.getDirection()); + newParameter.setLower(parameter.getLower()); + newParameter.setUpper(parameter.getUpper()); + } + } + } + + // remove those parameters that exist in derived, but not original interface. + Iterator derivedParameters = derivedOperation.getOwnedParameters().iterator(); + while (derivedParameters.hasNext()) { + Parameter parameter = derivedParameters.next(); + String paramName = parameter.getName(); + Type paramType = parameter.getType(); + if (operation.getOwnedParameter(paramName, paramType) == null) { + // not on in original interface, remove from derived as well + derivedParameters.remove(); + } + } + } + + // check whether operations in derived interface exist in original interface + // (remove, if not) + Iterator derivedRequestOperations = derivedRequestInterface.getOwnedOperations().iterator(); + while (derivedRequestOperations.hasNext()) { + Operation derivedOperation = derivedRequestOperations.next(); + String name = derivedOperation.getName(); + if (name == null) { + continue; + } + if (typingInterface.getOperation(name, null, null) == null) { + // not in typing interface, remove + derivedRequestOperations.remove(); + } + } + + // ----------------------------------------------- + // calculate "reply" interface (with OUT and INOUT parameter transformed into in parameters) + // ----------------------------------------------- + for (Operation operation : typingInterface.getOwnedOperations()) { + String name = operation.getName(); + + if (AMIpoll.hasOutParameters(operation)) { + + // check whether operation already exists. Create, if not + Operation derivedOperation = derivedReplyInterface.getOperation(name, null, null); + if (derivedOperation == null) { + derivedOperation = derivedReplyInterface.createOwnedOperation(name, null, null); + } + + // each non-in parameter is in the poll operation. + for (Parameter parameter : operation.getOwnedParameters()) { + if (parameter.getDirection() != ParameterDirectionKind.IN_LITERAL) { // OUT and INOUT + + String paramName = parameter.getName(); + Type paramType = parameter.getType(); + if (derivedOperation.getOwnedParameter(paramName, paramType) == null) { + Parameter newParameter = derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType()); + newParameter.setDirection(ParameterDirectionKind.IN_LITERAL); + newParameter.setLower(parameter.getLower()); + newParameter.setUpper(parameter.getUpper()); + } + } + } + + // remove those parameters that exist in derived, but not original interface. + Iterator derivedParameters = derivedOperation.getOwnedParameters().iterator(); + while (derivedParameters.hasNext()) { + Parameter parameter = derivedParameters.next(); + String paramName = parameter.getName(); + Type paramType = parameter.getType(); + if (operation.getOwnedParameter(paramName, paramType) == null) { + // not on in original interface, remove from derived as well + derivedParameters.remove(); + } + } + } + } + + // check whether operations in derived interface exist in original interface + // (remove, if not) + Iterator derivedReplyOperations = derivedReplyInterface.getOwnedOperations().iterator(); + while (derivedRequestOperations.hasNext()) { + Operation derivedOperation = derivedReplyOperations.next(); + String name = derivedOperation.getName(); + if (name == null) { + continue; + } + if (typingInterface.getOperation(name, null, null) == null) { + // not in typing interface, remove + derivedReplyOperations.remove(); + } + } + + return derivedType; + } + + @Override + public boolean needsUpdate(Port p) { + // TODO: insufficient condition + return (calcDerivedType(p, false) == null); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIpoll.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIpoll.java new file mode 100644 index 00000000000..220f2021465 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/AMIpoll.java @@ -0,0 +1,161 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; + +import java.util.Iterator; + +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.util.IMappingRule; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.ParameterDirectionKind; +import org.eclipse.uml2.uml.Type; + + +/** + * Implement a CORBA AMI style polling interface + * This is defined in the CORBA 3 standard in section 22.6.2 + * A difference is that we do not return the poller object, but the client uses the original port. + * This has the consequence that it is not possible to make multiple asynchronous requests. + * + * A second difference is that we do not keep the normal methods in the same interface and prefix the + * new ones. (which would probably be a good idea). + * + */ +public class AMIpoll implements IMappingRule { + + private static final String IAMI_POLL = "IAMIPoll_"; //$NON-NLS-1$ + private static final String AMI_POLL = "AMIPoll_"; //$NON-NLS-1$ + + @Override + public Type calcDerivedType(Port p, boolean update) { + Type type = p.getType(); + if (!(type instanceof Interface)) { + return null; + } + + Class derivedType = MapUtil.getDerivedClass(p, AMI_POLL); + Interface typingInterface = (Interface) type; + Interface derivedInterface = MapUtil.getDerivedInterface(p, IAMI_POLL); + MapUtil.addUsage(derivedType, derivedInterface); + + if (!update) { + return derivedType; + } + + for (Operation operation : typingInterface.getOwnedOperations()) { + String name = operation.getName(); + + // check whether operation already exists. Create, if not + Operation derivedOperation = derivedInterface.getOperation(name, null, null); + if (derivedOperation == null) { + derivedOperation = derivedInterface.createOwnedOperation(name, null, null); + } + + if (hasOutParameters(operation)) { + String pollName = name + "Poll"; //$NON-NLS-1$ + Operation derivedPollOperation = derivedInterface.getOperation(pollName, null, null); + if (derivedPollOperation == null) { + derivedPollOperation = derivedInterface.createOwnedOperation(pollName, null, null); + } + + // each non-in parameter is in the poll operation. + derivedPollOperation.createOwnedParameter("timeout", null); //$NON-NLS-1$ + + for (Parameter parameter : operation.getOwnedParameters()) { + if (parameter.getDirection() != ParameterDirectionKind.IN_LITERAL) { + + String paramName = parameter.getName(); + Type paramType = parameter.getType(); + if (derivedPollOperation.getOwnedParameter(paramName, paramType) == null) { + Parameter newParameter = + derivedPollOperation.createOwnedParameter(parameter.getName(), parameter.getType()); + newParameter.setDirection(parameter.getDirection()); + newParameter.setLower(parameter.getLower()); + newParameter.setUpper(parameter.getUpper()); + } + } + } + } + // each in and inout parameter is in the request operation. + for (Parameter parameter : operation.getOwnedParameters()) { + if ((parameter.getDirection() == ParameterDirectionKind.IN_LITERAL) || + (parameter.getDirection() == ParameterDirectionKind.INOUT_LITERAL)) { + + String paramName = parameter.getName(); + Type paramType = parameter.getType(); + if (derivedOperation.getOwnedParameter(paramName, paramType) == null) { + Parameter newParameter = + derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType()); + newParameter.setDirection(parameter.getDirection()); + newParameter.setLower(parameter.getLower()); + newParameter.setUpper(parameter.getUpper()); + } + } + } + // remove those parameters that exist in derived, but not original interface. + Iterator derivedParameters = derivedOperation.getOwnedParameters().iterator(); + while (derivedParameters.hasNext()) { + Parameter parameter = derivedParameters.next(); + String paramName = parameter.getName(); + Type paramType = parameter.getType(); + if ((!paramName.equals("timeout")) && //$NON-NLS-1$ + (operation.getOwnedParameter(paramName, paramType) == null)) { + // not on in original interface, remove from derived as well + derivedParameters.remove(); + } + } + } + + // check whether operations in derived interface exist in original interface + // (remove, if not) + Iterator derivedOperations = derivedInterface.getOwnedOperations().iterator(); + while (derivedOperations.hasNext()) { + Operation derivedOperation = derivedOperations.next(); + String name = derivedOperation.getName(); + if (name == null) { + continue; + } + if (name.endsWith("Poll")) { //$NON-NLS-1$ + // remove Poll postfix + name = name.substring(0, name.length() - 4); + } + if (typingInterface.getOperation(name, null, null) == null) { + // not in typing interface, remove + derivedOperations.remove(); + } + } + + return derivedType; + } + + public static boolean hasOutParameters(Operation operation) { + for (Parameter parameter : operation.getOwnedParameters()) { + if (parameter.getDirection() != ParameterDirectionKind.IN_LITERAL) { + return true; + } + } + return false; + } + + @Override + public boolean needsUpdate(Port p) { + // TODO: insufficient condition + return (calcDerivedType(p, false) == null); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort.java new file mode 100644 index 00000000000..3d08ffae8bf --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort.java @@ -0,0 +1,132 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; + +import org.eclipse.papyrus.FCM.util.IMappingRule; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.papyrus.qompass.designer.core.OperationUtils; +import org.eclipse.papyrus.qompass.designer.core.PortUtils; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Type; + + +/** + * An extended Port in the sense of the DDS4CCM standard: a port typed with a component + * type. Since the component typing the port can have multiple provided and required + * ports, the ports are implicitly owned by the port. Conjugation on the level of an extended + * port level will conjugate all ports of the component typing the port. + * + * The derived interface that is provided will concatenate provided port names within the + * extended port with the port name and provided a "big" interface. + * The derived interface that is required is identical, except for a conjugation on the + * extended port level. + * + * Creates a fixed template binding that binds T (of the extended Port) to the used data type + * + * Here, the idea is that the port type is a classifier, e.g. the data type that is + * transported by a DDS port. The port kind is the extended port, e.g. DDSWrite. + * + * The derived property isExtended of FCM port-kind is true, if the class representing the port-kind owns at least one + * port + * + * TODO: This class has become obsolete now, since extended DDS ports are now supported via flattening + * + */ +@Deprecated +public class ExtendedPort implements IMappingRule { + + public static final String PROV_PREFIX = "P_"; //$NON-NLS-1$ + + public static final String REQ_PREFIX = "R_"; //$NON-NLS-1$ + + @Override + public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p) { + return needsUpdate(p, false) || + needsUpdate(p, true); + } + + public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p, boolean isRequired) { + return true; + } + + @Override + public Type calcDerivedType(org.eclipse.papyrus.FCM.Port p, boolean update) + { + Type type = p.getType(); + if (!(type instanceof Classifier)) { + return null; + } + Class extendedPort = p.getKind().getBase_Class(); + + String prefix = extendedPort.getName() + "_" + (p.getBase_Port().isConjugated() ? REQ_PREFIX : PROV_PREFIX); //$NON-NLS-1$ + Interface derivedInterface = MapUtil.getDerivedInterface(p, prefix, true); + if (!update) { + return derivedInterface; + } + if (derivedInterface == null) { + return null; + } + /* + * TemplateSignature signature = TemplateUtils.getSignature(type.getNearestPackage()); + * if(signature != null) { + * Package model = Utils.getTop(derivedInterface); + * try { + * TemplateBinding binding = + * TemplateUtils.fixedBinding(model, extendedPort, (Classifier)type); + * Copy copy = new Copy(model, model, false); + * TemplateInstantiation ti = new TemplateInstantiation(copy, binding); + * // create a bound element of the extended port. Add bound class to derived interface class + * Class boundClass = ti.bindNamedElement(extendedPort); + * derivedInterface.getNearestPackage().getPackagedElements().add(boundClass); + * } catch (TransformationException e) { + * return null; + * } + * } + */ + // obtain first template parameter = port type + // kind.getBase_Class().getNearestPackage().getTemplateParameter(); + + for (Port port : extendedPort.getOwnedPorts()) { + Interface derivedIntf = (p.getBase_Port().isConjugated()) ? + PortUtils.getRequired(port) : + PortUtils.getProvided(port); + + if (derivedIntf != null) { + for (Operation op : derivedIntf.getAllOperations()) { + String name = port.getName() + "_" + op.getName(); //$NON-NLS-1$ + + // check whether operation already exists. Create, if not + Operation derivedOperation = derivedInterface.getOperation(name, null, null); + if (derivedOperation == null) { + derivedOperation = derivedInterface.createOwnedOperation(name, null, null); + OperationUtils.syncOperation(op, derivedOperation); + derivedOperation.setName(name); + } + else { + if (!OperationUtils.isSameOperation(derivedOperation, op, false)) { + OperationUtils.syncOperation(op, derivedOperation); + derivedOperation.setName(name); + } + } + } + } + } + return derivedInterface; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort2.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort2.java new file mode 100644 index 00000000000..f12eadcdc4c --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ExtendedPort2.java @@ -0,0 +1,138 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; + +import org.eclipse.papyrus.FCM.util.IMappingRule; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.papyrus.qompass.designer.core.PortUtils; +import org.eclipse.papyrus.qompass.designer.core.transformations.PrefixConstants; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Type; + + +/** + * An extended Port in the sense of the DDS4CCM standard: a port typed with a component + * type (the extended port, not the data type that is transported). Since the component typing + * the port can have multiple provided and required + * ports, the ports are implicitly owned by the port. Conjugation on the level of an extended + * port level will conjugate all ports of the component typing the port. + * + * The derived interface that is provided will allow a caller to access individual ports. It + * is therefore a reference to the interfaces get_ operations provided by a + * component. + * The derived interface that is required is identical, except for a conjugation on the + * extended port level. + * + * What is the difference to ExtendedPort? + * + */ +public class ExtendedPort2 implements IMappingRule { + + public static final String CONJ_PREFIX = "C2_"; //$NON-NLS-1$ + + public static final String NORM_PREFIX = "N2_"; //$NON-NLS-1$ + + @Override + public Type calcDerivedType(org.eclipse.papyrus.FCM.Port p, boolean update) { + + Type type = p.getType(); + if (!(type instanceof Class)) { + return null; + } + + Class extendedPort = (Class) type; + boolean isConjugated = p.getBase_Port().isConjugated(); + String prefix = isConjugated ? CONJ_PREFIX : NORM_PREFIX; + Class derivedClass = MapUtil.getDerivedClass(p, prefix, update); + Interface providedInterface = MapUtil.getDerivedInterface(p, prefix, update); + Interface requiredInterface = MapUtil.getDerivedInterface(p, prefix, update); + if (!update) { + return derivedClass; + } + if (derivedClass == null) { + return null; + } + for (Port port : extendedPort.getOwnedPorts()) { + // if the extended port is conjugated, each of the provided/required are (implicitly) + // conjugated [TODO: is PortUtils aware of it? - probably yes] + Interface reqIntf = PortUtils.getRequired(port); + + if (reqIntf != null) { + String name = PrefixConstants.getP_Prefix + port.getName(); + + // check whether operation already exists. Create, if not + Operation derivedOperation = requiredInterface.getOperation(name, null, null); + if (derivedOperation == null) { + derivedOperation = requiredInterface.createOwnedOperation(name, null, null); + } + } + + Interface provIntf = PortUtils.getProvided(port); + + if (provIntf != null) { + String name = PrefixConstants.getConnQ_Prefix + port.getName(); + + // check whether operation already exists. Create, if not + Operation derivedOperation = providedInterface.getOperation(name, null, null); + if (derivedOperation == null) { + derivedOperation = providedInterface.createOwnedOperation(name, null, null); + } + } + } + return derivedClass; + } + + @Override + public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p) { + return needsUpdate(p, false) || + needsUpdate(p, true); + } + + public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p, boolean isConjugated) { + Type type = p.getBase_Port().getType(); + if (!(type instanceof Class)) { + return false; + } + + Class extendedPort = (Class) type; + String prefix = isConjugated ? CONJ_PREFIX : NORM_PREFIX; + Interface derivedInterface = MapUtil.getDerivedInterface(p, prefix); + + if (derivedInterface == null) { + return true; + } + for (Port port : extendedPort.getOwnedPorts()) { + // if the extended port is conjugated, each of the provided/required are (implicitly) + // conjugated [TODO: is PortUtils aware of it? - probably yes] + Interface provIntf = (isConjugated) ? + PortUtils.getRequired(port) : + PortUtils.getProvided(port); + + if (provIntf != null) { + String name = PrefixConstants.getP_Prefix + port.getName(); + + // check whether operation already exists. Create, if not + Operation derivedOperation = derivedInterface.getOperation(name, null, null); + if (derivedOperation == null) { + return true; + } + } + } + return false; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ProvideInterface.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ProvideInterface.java new file mode 100644 index 00000000000..2432ddcdc42 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/ProvideInterface.java @@ -0,0 +1,37 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; + +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.util.IMappingRule; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Type; + +public class ProvideInterface implements IMappingRule +{ + @Override + public Type calcDerivedType(Port p, boolean update) { + Type type = p.getBase_Port().getType(); + if (type instanceof Interface) { + return ((Interface) type); + } + return null; + } + + @Override + public boolean needsUpdate(Port p) { + return false; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PullConsumer.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PullConsumer.java new file mode 100644 index 00000000000..84c73d33c96 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PullConsumer.java @@ -0,0 +1,162 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.util.IMappingRule; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.DataType; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.PrimitiveType; +import org.eclipse.uml2.uml.Signal; +import org.eclipse.uml2.uml.Type; + +/** + * Will generate a suitable callable interface pulling consumer. The port is typed with a primitive type + * or data type. The generated interface has a " pull as well as a "boolean hasData()" operation). + */ +public class PullConsumer implements IMappingRule { + + public static String PULL_I_PREFIX = "PullConsumer_"; //$NON-NLS-1$ + + public static String PULL_C_PREFIX = "CPullConsumer_"; //$NON-NLS-1$ + + public static String PULL_OP_NAME = "pull"; //$NON-NLS-1$ + + public static String HASDATA_OP_NAME = "hasData"; //$NON-NLS-1$ + + public static String RET_PAR_NAME = "ret"; //$NON-NLS-1$ + + public static String BOOL_QNAME = "corba::Boolean"; //$NON-NLS-1$ + + @Override + public boolean needsUpdate(Port p) { + Type type = p.getType(); + + if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { + + Interface derivedInterface = MapUtil.getDerivedInterface(p, PULL_I_PREFIX); + if (derivedInterface == null) { + return true; + } + Operation derivedOperation = derivedInterface.getOperation(PULL_OP_NAME, null, null); + if (derivedOperation == null) { + return true; + } + EList parameters = derivedOperation.getOwnedParameters(); + if (parameters.size() != 1) { + return true; + } else { + Parameter parameter = parameters.get(0); + if (!parameter.getName().equals(RET_PAR_NAME)) { + return true; + } + if (parameter.getType() != type) { + return true; + } + } + } + return false; + } + + public static PullConsumer getInstance() { + if (instance == null) { + instance = new PullConsumer(); + } + return instance; + } + + @Override + public Type calcDerivedType(Port p, boolean update) { + org.eclipse.uml2.uml.Port umlPort = p.getBase_Port(); + Element owner = umlPort.getOwner(); + String ownerStr = ""; //$NON-NLS-1$ + if (owner instanceof NamedElement) { + ownerStr = " of class " + ((NamedElement) owner).getQualifiedName(); //$NON-NLS-1$ + } + Log.log(IStatus.INFO, Log.CALC_PORTKIND, + p.getKind().getBase_Class().getName() + " => GetRequired on " + umlPort.getName() + ownerStr); + Type type = p.getType(); + + if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { + + Class derivedClass = MapUtil.getDerivedClass(p, PULL_C_PREFIX, update); + Interface derivedInterface = MapUtil.getDerivedInterface(p, PULL_I_PREFIX, update); + MapUtil.addUsage(derivedClass, derivedInterface); + if (!update) { + return derivedClass; + } + if (derivedInterface == null) { + return null; + } + // check whether operation already exists. Create, if not + Operation derivedOperationPull = derivedInterface.getOperation(PULL_OP_NAME, null, null); + if (derivedOperationPull == null) { + derivedOperationPull = derivedInterface.createOwnedOperation(PULL_OP_NAME, null, null, type); + } + EList parameters = derivedOperationPull.getOwnedParameters(); + if (parameters.size() > 0) { + Parameter parameter = parameters.get(0); + if ((parameter.getName() == null) || (!parameter.getName().equals(RET_PAR_NAME))) { + parameter.setName(RET_PAR_NAME); + } + if (parameter.getType() != type) { + parameter.setType(type); + } + } + Package model = PackageUtil.getRootPackage(umlPort); + Element element = Utils.getQualifiedElement(model, BOOL_QNAME); + Type booleanType = null; + if (element instanceof Type) { + booleanType = (Type) element; + } + + // check whether operation already exists. Create, if not + Operation derivedOperationHasData = derivedInterface.getOperation(HASDATA_OP_NAME, null, null); + if (derivedOperationHasData == null) { + derivedOperationHasData = derivedInterface.createOwnedOperation(HASDATA_OP_NAME, null, null, booleanType); + } + + parameters = derivedOperationHasData.getOwnedParameters(); + if (parameters.size() > 0) { + Parameter parameter = parameters.get(0); + if ((parameter.getName() == null) || (!parameter.getName().equals(RET_PAR_NAME))) { + parameter.setName(RET_PAR_NAME); + } + if ((booleanType != null) && (parameter.getType() != booleanType)) { + // added != null check + parameter.setType(booleanType); + } + } + + return derivedClass; + } else { + return null; + } + } + + protected static PullConsumer instance; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushConsumer.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushConsumer.java new file mode 100644 index 00000000000..f0375f8840e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushConsumer.java @@ -0,0 +1,110 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.util.IMappingRule; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.uml2.uml.DataType; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.PrimitiveType; +import org.eclipse.uml2.uml.Signal; +import org.eclipse.uml2.uml.Type; + +/** + * Will generate a suitable called interface push consumer. The port is typed with a primitive type + * or data type. The generated interface has a "push (data )" operation ). + * + * The interface is identical to that of a PushProducer (and will be shared). + * + * @author ansgar + */ +public class PushConsumer implements IMappingRule { + + public static String PUSH_OP_PREFIX = "push"; //$NON-NLS-1$ + + public static String PUSH_OP_PARNAME = "data"; //$NON-NLS-1$ + + @Override + public boolean needsUpdate(Port p) { + Type type = p.getBase_Port().getType(); + + if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { + + Interface derivedInterface = MapUtil.getDerivedInterface(p, PushProducer.PUSH_I_PREFIX); + if (derivedInterface == null) { + return true; + } + + Operation derivedOperation = derivedInterface.getOperation(PUSH_OP_PREFIX, null, null); + if (derivedOperation == null) { + return true; + } + EList parameters = derivedOperation.getOwnedParameters(); + if (parameters.size() != 1) { + return true; + } else { + Parameter parameter = parameters.get(0); + if (!parameter.getName().equals(PUSH_OP_PARNAME)) { + return true; + } + if (parameter.getType() != type) { + return true; + } + } + } + return false; + } + + @Override + public Type calcDerivedType(Port p, boolean update) { + Log.log(IStatus.INFO, Log.CALC_PORTKIND, + p.getKind().getBase_Class().getName() + " => GetProvided on " + p.getBase_Port().getName()); + Type type = p.getType(); + + if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { + + Interface derivedInterface = MapUtil.getDerivedInterface(p, PushProducer.PUSH_I_PREFIX, update); + if (!update) { + return derivedInterface; + } + if (derivedInterface == null) { + // may happen, if within template (do not want creation of derived interfaces in template) + return null; + } + + // check whether operation already exists. Create, if not + Operation derivedOperation = derivedInterface.getOperation(PUSH_OP_PREFIX, null, null); + if (derivedOperation == null) { + derivedOperation = derivedInterface.createOwnedOperation(PUSH_OP_PREFIX, null, null); + } + EList parameters = derivedOperation.getOwnedParameters(); + if (parameters.size() == 0) { + derivedOperation.createOwnedParameter(PUSH_OP_PARNAME, type); + } else { + parameters.get(0).setName(PUSH_OP_PARNAME); + parameters.get(0).setType(type); + } + return derivedInterface; + } else { + return null; + } + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java new file mode 100644 index 00000000000..d719977a2db --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProdPullCons.java @@ -0,0 +1,75 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; + +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.util.IMappingRule; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.DataType; +import org.eclipse.uml2.uml.PrimitiveType; +import org.eclipse.uml2.uml.Signal; +import org.eclipse.uml2.uml.Type; + +/** + * Create a bidirectional port with a push producer and a pull consumer + * TODO: Objective is not clear + * Will generate a suitable callable interface pulling consumer. The port is typed with a primitive type + * or data type. The generated interface has a " pull as well as a "boolean hasData()" operation). + */ +public class PushProdPullCons implements IMappingRule { + + @Override + public Type calcDerivedType(Port p, boolean update) { + Type type = p.getType(); + + if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { + + Class derivedClass = MapUtil.getDerivedClass(p, "PushProdPullcons", update); + if (!update) { + return derivedClass; + } + + // obtain derived interface for other port kind (Caveat: some rules get the prefix from the + // name of the port kind attached to port "p" which would produce wrong results. + Type derivedInterfacePushProd = PushProducer.getInstance().calcDerivedType(p, update); + Type derivedInterfacePullCons = PullConsumer.getInstance().calcDerivedType(p, update); + + /* + if (derivedInterface == null) { + return null; + } + + if (!derivedInterface.getGenerals().contains(derivedInterfacePushProd)) { + derivedInterface.createGeneralization(derivedInterfacePushProd); + } + if (!derivedInterface.getGenerals().contains(derivedInterfacePullCons)) { + derivedInterface.createGeneralization(derivedInterfacePullCons); + } + return derivedInterface; + */ + return null; + } + else { + return null; + } + } + + @Override + public boolean needsUpdate(Port p) { + return PushProducer.getInstance().needsUpdate(p) || + PullConsumer.getInstance().needsUpdate(p); + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProducer.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProducer.java new file mode 100644 index 00000000000..e7933346b8f --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/PushProducer.java @@ -0,0 +1,130 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.util.IMappingRule; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.DataType; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.PrimitiveType; +import org.eclipse.uml2.uml.Signal; +import org.eclipse.uml2.uml.Type; + +/** + * Will generate a suitable callable interface push provider. The port is typed with a primitive type + * or data type. The generated interface has a "push (data )" operation + * + * The interface is identical to that of a PushConsumer (and will be shared). + * + * @author ansgar + */ +public class PushProducer implements IMappingRule { + + public static String PUSH_I_PREFIX = "Push_"; //$NON-NLS-1$ + + public static String PUSH_C_PREFIX = "CPush_"; //$NON-NLS-1$ + + public static String PUSH_OP_NAME = "push"; //$NON-NLS-1$ + + public static String PUSH_OP_PARNAME = "data"; //$NON-NLS-1$ + + public static PushProducer getInstance() { + if (instance == null) { + instance = new PushProducer(); + } + return instance; + } + + @Override + public boolean needsUpdate(Port p) { + Type type = p.getBase_Port().getType(); + + if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { + + Interface derivedInterface = MapUtil.getDerivedInterface(p, PUSH_I_PREFIX); + if (derivedInterface == null) { + return true; + } + + Operation derivedOperation = derivedInterface.getOperation(PUSH_OP_NAME, null, null); + if (derivedOperation == null) { + return true; + } + EList parameters = derivedOperation.getOwnedParameters(); + if (parameters.size() != 1) { + return true; + } else { + Parameter parameter = parameters.get(0); + if (!parameter.getName().equals(PUSH_OP_PARNAME)) { + return true; + } + if (parameter.getType() != type) { + return true; + } + } + } + return false; + } + + @Override + public Type calcDerivedType(Port p, boolean update) { + Log.log(IStatus.INFO, Log.CALC_PORTKIND, p.getKind().getBase_Class().getName() + " => GetRequired on " + p.getBase_Port().getName()); + Type type = p.getType(); + + if ((type instanceof PrimitiveType) || (type instanceof DataType) || (type instanceof Signal)) { + + Interface derivedInterface = MapUtil.getDerivedInterface(p, PUSH_I_PREFIX, update); + Class derivedType = MapUtil.getDerivedClass(p, PUSH_C_PREFIX, update); + MapUtil.addUsage(derivedType, derivedInterface); + if (!update) { + return derivedType; + } + if (derivedInterface == null) { + // may happen, if within template (do not want creation of derived interfaces in template) + return null; + } + + // check whether operation already exists. Create, if not + Operation derivedOperation = derivedInterface.getOperation(PUSH_OP_NAME, null, null); + if (derivedOperation == null) { + derivedOperation = derivedInterface.createOwnedOperation(PUSH_OP_NAME, null, null); + } + EList parameters = derivedOperation.getOwnedParameters(); + if (parameters.size() == 0) { + derivedOperation.createOwnedParameter(PUSH_OP_PARNAME, type); + } else { + Parameter parameter = parameters.get(0); + if (!parameter.getName().equals(PUSH_OP_PARNAME)) { + parameter.setName(PUSH_OP_PARNAME); + } + if (parameter.getType() != type) { + parameter.setType(type); + } + } + return derivedType; + } else { + return null; + } + } + + protected static PushProducer instance; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/TemplatePort.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/TemplatePort.java new file mode 100644 index 00000000000..62dce7e7709 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/TemplatePort.java @@ -0,0 +1,183 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.FCM.PortKind; +import org.eclipse.papyrus.FCM.util.ITemplateMappingRule; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateInstantiation; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; +import org.eclipse.papyrus.qompass.designer.core.transformations.LazyCopier; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException; +import org.eclipse.papyrus.qompass.designer.core.transformations.filters.FixTemplateSync; +import org.eclipse.papyrus.qompass.modellibs.core.Activator; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Classifier; +import org.eclipse.uml2.uml.Namespace; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.TemplateSignature; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.util.UMLUtil; + + +/** + * An extended Port in the sense of the DDS4CCM standard: a port typed with a component + * type. Since the component typing the port can have multiple provided and required + * ports, the ports are implicitly owned by the port. Conjugation on the level of an extended + * port level will conjugate all ports of the component typing the port. + * + * The derived interface that is provided will concatenate provided port names within the + * extended port with the port name and provided a "big" interface. + * The derived interface that is required is identical, except for a conjugation on the + * extended port level. + * + * Creates a fixed template binding that binds T (of the extended Port) to the used data type + * + * Here, the idea is that the port type is a classifier, e.g. the data type that is + * transported by a DDS port. The port kind is the extended port, e.g. DDSWrite. + * + * The derived property isExtended of FCM port-kind is true, if the class representing the port-kind owns at least one + * port + * + * @author ansgar + * + */ +public class TemplatePort implements ITemplateMappingRule { + + @Override + public Type calcDerivedType(org.eclipse.papyrus.FCM.Port p, boolean update) { + // TODO: unify template mapping rule and normal one. + return null; + } + + @Override + public PortKind getBoundType(org.eclipse.papyrus.FCM.Port p) + { + Port port = p.getBase_Port(); + Type type = port.getType(); + if (!(type instanceof Classifier)) { + return null; + } + if (p.getKind() == null) { + return null; + } + Class extendedPort = p.getKind().getBase_Class(); + TemplateSignature signature = TemplateUtils.getSignature(extendedPort.getNearestPackage()); + Package pkgTemplate = signature.getNearestPackage(); + if (pkgTemplate != null) { + EList path = TemplateUtils.relativePathWithMerge(extendedPort, pkgTemplate); + + String name = pkgTemplate.getName() + "_" + type.getName(); //$NON-NLS-1$ + Package model = PackageUtil.getRootPackage(port); + Package pkg = model.getNestedPackage(name); + if (pkg == null) { + model = Utils.getFirstLevel(port); // try whether package template exists here + // required for target model with additional "root" folder + pkg = model.getNestedPackage(name); + } + if (pkg != null) { + for (Namespace pathElem : path) { + pkg = pkg.getNestedPackage(pathElem.getName()); + if (pkg == null) { + return null; + } + } + PackageableElement boundClass = pkg.getPackagedElement(extendedPort.getName()); + if (boundClass != null) { + return UMLUtil.getStereotypeApplication(boundClass, PortKind.class); + } + } + } + return null; + } + + @Override + public void updateBinding(org.eclipse.papyrus.FCM.Port p) { + Port port = p.getBase_Port(); + Type type = port.getType(); + if (!(type instanceof Classifier)) { + return; + } + Class extendedPort = p.getKind().getBase_Class(); + + TemplateSignature signature = TemplateUtils.getSignature(extendedPort.getNearestPackage()); + if (signature != null) { + Package model = PackageUtil.getRootPackage(port); + try { + TemplateBinding binding = + TemplateUtils.fixedBinding(model, extendedPort, (Classifier) type); + LazyCopier copy = new LazyCopier(model, model, false, true); + TemplateInstantiation ti = new TemplateInstantiation(copy, binding); + // remove listener synchronizing implementation, since it would add derived + // elements for the extended port itself (e.g. provided operations) + if (copy.postCopyListeners.contains(FixTemplateSync.getInstance())) { + copy.postCopyListeners.remove(FixTemplateSync.getInstance()); + } + + // create a bound element of the extended port. Add bound class to derived interface class + ti.bindElement(extendedPort); + } catch (TransformationException e) { + Activator.log.error("Could not create template binding", e); + } + } + } + + @Override + public boolean needsUpdate(org.eclipse.papyrus.FCM.Port p) { + Port port = p.getBase_Port(); + Type type = port.getType(); + if (!(type instanceof Classifier)) { + return false; + } + if (p.getKind() == null) { + return false; + } + Class extendedPort = p.getKind().getBase_Class(); + TemplateSignature signature = TemplateUtils.getSignature(extendedPort.getNearestPackage()); + Package pkgTemplate = signature.getNearestPackage(); + if (pkgTemplate != null) { + EList path = TemplateUtils.relativePathWithMerge(extendedPort, pkgTemplate); + + String name = pkgTemplate.getName() + "_" + type.getName(); //$NON-NLS-1$ + Package model = PackageUtil.getRootPackage(port); + Package pkg = model.getNestedPackage(name); + if (pkg == null) { + model = Utils.getFirstLevel(port); // try whether package template exists here + // required for target model with additional "root" folder + pkg = model.getNestedPackage(name); + } + if (pkg != null) { + for (Namespace pathElem : path) { + pkg = pkg.getNestedPackage(pathElem.getName()); + if (pkg == null) { + return true; + } + } + PackageableElement boundClass = pkg.getPackagedElement(extendedPort.getName()); + if (boundClass != null) { + if (UMLUtil.getStereotypeApplication(boundClass, PortKind.class) != null) { + return false; + } + } + } + } + return true; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseConjIntf.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseConjIntf.java new file mode 100644 index 00000000000..cee9f055d01 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseConjIntf.java @@ -0,0 +1,187 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; + +import java.util.Iterator; + +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.util.IMappingRule; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.ParameterDirectionKind; +import org.eclipse.uml2.uml.Type; + +/** + * Use a conjugated interface (!= conjugated port), i.e. an interface in which the roles "in" and "out" + * of each parameter of an operation are inversed. This transformation is useful in the context of transforming + * a "push" interface into a "pull" interface, i.e. instead of calling and providing values values to the + * called component via "in", the called components queries us and obtains these values as out parameters. + * TODO: This rules is currently not used, since data flow operation are currently either based on a datatype + * or a MARTE FlowPort + * + * @author ansgar + * + */ +public class UseConjIntf implements IMappingRule { + + private static final String CONJ_INTF_TYPE = "ConjIntfType_"; //$NON-NLS-1$ + private static final String CONJ_INTF = "ConjIntf_"; //$NON-NLS-1$ + + @Override + public Type calcDerivedType(Port p, boolean update) { + Type type = p.getBase_Port().getType(); + if (!(type instanceof Interface)) { + return null; + } + + Interface typingInterface = (Interface) type; + Interface derivedInterface = MapUtil.getDerivedInterface(p, CONJ_INTF, update); + Class derivedType = MapUtil.getDerivedClass(p, CONJ_INTF_TYPE, update); + if (!update) { + return derivedType; + } + if (derivedInterface == null) { + return null; + } + MapUtil.addUsage(derivedType, derivedInterface); + for (Operation operation : typingInterface.getOwnedOperations()) { + String name = operation.getName(); + + // check whether operation already exists. Create, if not + Operation derivedOperation = derivedInterface.getOperation(name, null, null); + if (derivedOperation == null) { + derivedOperation = derivedInterface.createOwnedOperation(name, null, null); + } + + // TODO: move to Copy (factor code, ensure that these values are handled in case of model copies ...) + derivedOperation.setIsAbstract(operation.isAbstract()); + derivedOperation.setIsStatic(operation.isStatic()); // (does not make sense for an interface, if true) + derivedOperation.setIsUnique(operation.isUnique()); + derivedOperation.setIsQuery(operation.isQuery()); + + for (Parameter parameter : operation.getOwnedParameters()) { + String paramName = parameter.getName(); + Type paramType = parameter.getType(); + if (derivedOperation.getOwnedParameter(paramName, paramType) == null) { + Parameter newParameter = + derivedOperation.createOwnedParameter(parameter.getName(), parameter.getType()); + ParameterDirectionKind direction = parameter.getDirection(); + if (direction == ParameterDirectionKind.IN_LITERAL) { + newParameter.setDirection(ParameterDirectionKind.OUT_LITERAL); + } + else if (direction == ParameterDirectionKind.OUT_LITERAL) { + newParameter.setDirection(ParameterDirectionKind.IN_LITERAL); + } + else { + newParameter.setDirection(direction); + } + newParameter.setLower(parameter.getLower()); + newParameter.setUpper(parameter.getUpper()); + } + } + // remove those parameters that exist in derived, but not original interface. + Iterator derivedParameters = derivedOperation.getOwnedParameters().iterator(); + while (derivedParameters.hasNext()) { + Parameter parameter = derivedParameters.next(); + String paramName = parameter.getName(); + Type paramType = parameter.getType(); + if (operation.getOwnedParameter(paramName, paramType) == null) { + // not on in original interface, remove from derived as well + derivedParameters.remove(); + } + } + } + + // check whether operations in derived interface exist in original interface + // (remove, if not) + Iterator derivedOperations = derivedInterface.getOwnedOperations().iterator(); + while (derivedOperations.hasNext()) { + Operation derivedOperation = derivedOperations.next(); + String name = derivedOperation.getName(); + if (typingInterface.getOperation(name, null, null) == null) { + // not in typing interface, remove + if (derivedInterface.getOperations().remove(derivedOperation)) { + derivedOperations = derivedInterface.getOwnedOperations().iterator(); + } + } + } + return derivedType; + } + + @Override + public boolean needsUpdate(Port p) { + Type type = p.getType(); + if (!(type instanceof Interface)) { + return false; + } + + Interface typingInterface = (Interface) type; + Interface derivedInterface = MapUtil.getOrCreateDerivedInterface(p, CONJ_INTF); + Class derivedType = MapUtil.getOrCreateDerivedClass(p, CONJ_INTF_TYPE); + if ((derivedInterface == null) || (derivedType == null)) { + return true; + } + for (Operation operation : typingInterface.getOwnedOperations()) { + String name = operation.getName(); + + // check whether operation already exists. Create, if not + Operation derivedOperation = derivedInterface.getOperation(name, null, null); + if (derivedOperation == null) { + return true; + } + + // TODO: move to Copy (factor code, ensure that these values are handled in case of model copies ...) + derivedOperation.setIsAbstract(operation.isAbstract()); + derivedOperation.setIsStatic(operation.isStatic()); // (does not make sense for an interface, if true) + derivedOperation.setIsUnique(operation.isUnique()); + derivedOperation.setIsQuery(operation.isQuery()); + + for (Parameter parameter : operation.getOwnedParameters()) { + String paramName = parameter.getName(); + Type paramType = parameter.getType(); + if (derivedOperation.getOwnedParameter(paramName, paramType) == null) { + return true; + } + } + // remove those parameters that exist in derived, but not original interface. + Iterator derivedParameters = derivedOperation.getOwnedParameters().iterator(); + while (derivedParameters.hasNext()) { + Parameter parameter = derivedParameters.next(); + String paramName = parameter.getName(); + Type paramType = parameter.getType(); + if (operation.getOwnedParameter(paramName, paramType) == null) { + // not on in original operation + return true; + } + } + } + + // check whether operations in derived interface exist in original interface + // (remove, if not) + Iterator derivedOperations = derivedInterface.getOwnedOperations().iterator(); + while (derivedOperations.hasNext()) { + Operation derivedOperation = derivedOperations.next(); + String name = derivedOperation.getName(); + if (typingInterface.getOperation(name, null, null) == null) { + // not in typing interface + return true; + } + } + return false; + } +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseInterface.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseInterface.java new file mode 100644 index 00000000000..26af9111517 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/mappingrules/UseInterface.java @@ -0,0 +1,42 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher ansgar.radermacher@cea.fr + * + *****************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.mappingrules; + +import org.eclipse.papyrus.FCM.Port; +import org.eclipse.papyrus.FCM.util.IMappingRule; +import org.eclipse.papyrus.FCM.util.MapUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Type; + + +public class UseInterface implements IMappingRule +{ + @Override + public Type calcDerivedType(Port p, boolean update) { + Type type = p.getType(); + if (type instanceof Interface) { + Class useType = MapUtil.getDerivedClass(p, "Use_", update); //$NON-NLS-1$ + MapUtil.addUsage(useType, (Interface) type); + return useType; + } + return null; + } + + @Override + public boolean needsUpdate(Port p) { + return false; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AMIPull.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AMIPull.xtend new file mode 100644 index 00000000000..d1e1fb28303 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AMIPull.xtend @@ -0,0 +1,34 @@ +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +import org.eclipse.uml2.uml.Operation +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.Marshalling.* + +class AMIPull { + def operation_(Operation operation) ''' + «IF operation.name.endsWith("Poll")» + // comment polling function + if (!resultArrived) { + // wait for result, condition will be fired upon arrival + TimeVal timeVal = TimeVal::current () + timeout; + m_cond.waitUpto (timeout); + } + «operation.unmarshall» + } + «IF operation.type != null»return retValue;«ENDIF» + «ELSE» + // TODO: need suitable constant dimensioning + pBuffer = &buffer[500]; // grows backwards + int operationID = ID_[operation.name/]; + + // now marshall in and inout parameters via ASN.1 + «operation.marshall» + BEncAsnContent (&pBuffer, &operationID); + + pthread_t pt; + pthread_create (&pt, NULL, staticDispatch, (void *) this); + // TODO: add semaphore which assures that subsequent calls to [operation.name/] are not executed before dispatch + // has removed the parameters from the pBuffer stack (pBuffer can be corrupted). + // even worse: buffer will be deallocated even without a 2nd call! + «ENDIF» + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AsyncCalls.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AsyncCalls.xtend new file mode 100644 index 00000000000..fa7cb846212 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/AsyncCalls.xtend @@ -0,0 +1,57 @@ +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +import org.eclipse.uml2.uml.Operation +import org.eclipse.uml2.uml.Class +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.* +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.Marshalling.* + +class AsyncCalls { + def asyncCall(Operation operation) ''' + // TODO: need suitable constant dimensioning + pBuffer = &buffer[500]; // grows backwards + «operation.marshall» + int operationID = ID_[operation.name/]; + BEncAsnContent (&pBuffer, &operationID); + + pthread_t pt; + pthread_create (&pt, NULL, staticDispatch, (void *) this); + // TODO: add semaphore which assures that subsequent calls to «operation.name» are not executed before dispatch + // has removed the parameters from the pBuffer stack (pBuffer can be corrupted). + ''' + + def dispatch_(Class clazz) ''' + int operationID; + BDecAsnContent (&pBuffer, operationID); + switch (operationID) { + «FOR operation : clazz.ownedOperations» + case ID_«operation.name» + { + + // delegate call to executor + rconn->«operation.cppCall»; + break; + } + «ENDFOR» + } + ''' + + def dispatchWithThreadPool(Class clazz) ''' + int operationID; + BDecAsnContent (&pBuffer, operationID); + switch (operationID) { + «FOR operation : clazz.ownedOperations» + case ID_«operation.name» + { + «operation.unmarshall» + // delegate call to executor + rconn->«operation.cppCall»; + «IF operation.type != null»«operation.type.cppType» ret = «ENDIF»rconn->«operation.cppCall»; + «operation.marshallOutInout» + resultsReady = 1; + break; + } + «ENDFOR» + } + } + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/BehaviorUtil.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/BehaviorUtil.java new file mode 100644 index 00000000000..e815c2c332b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/BehaviorUtil.java @@ -0,0 +1,111 @@ +package org.eclipse.papyrus.qompass.modellibs.core.xtend; + +import org.eclipse.uml2.uml.Behavior; +import org.eclipse.uml2.uml.BehavioredClassifier; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Constraint; +import org.eclipse.uml2.uml.OpaqueBehavior; +import org.eclipse.uml2.uml.OpaqueExpression; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Parameter; +import org.eclipse.uml2.uml.ParameterDirectionKind; +import org.eclipse.uml2.uml.Transition; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.UMLPackage; + +public class BehaviorUtil { + private static final String DEFAULT_LANGUAGE = "C++"; //$NON-NLS-1$ + + public static void set(Behavior behavior, String selectLanguage, String textblock) { + if (behavior instanceof OpaqueBehavior) { + OpaqueBehavior ob = (OpaqueBehavior) behavior; + if (ob.getLanguages().size() == 0) { + ob.getLanguages().add(DEFAULT_LANGUAGE); + ob.getBodies().add(textblock); + } + else { + int i = 0; + for (String language : ob.getLanguages()) { + if (selectLanguage.equals(language)) { + if (i < ob.getBodies().size()) { + ob.getBodies().set(i, textblock); + } + break; + } + } + } + } + } + + public static void set(Behavior behavior, String textblock) { + set(behavior, DEFAULT_LANGUAGE, textblock); + } + + public static OpaqueBehavior createOpaqueBehavior(BehavioredClassifier clazz, Operation operation) { + OpaqueBehavior ob = (OpaqueBehavior) + clazz.createOwnedBehavior(operation.getName(), UMLPackage.eINSTANCE.getOpaqueBehavior()); + ob.setSpecification(operation); + return ob; + } + + public static OpaqueBehavior createOpaqueEffect(Transition transition) { + OpaqueBehavior ob = (OpaqueBehavior) + transition.createEffect("", UMLPackage.eINSTANCE.getOpaqueBehavior()); //$NON-NLS-1$ + return ob; + } + + public static OpaqueExpression createOpaqueExpression(Constraint constraint, String guardCode) { + OpaqueExpression oe = (OpaqueExpression) + constraint.createSpecification("", null, UMLPackage.eINSTANCE.getOpaqueExpression()); //$NON-NLS-1$ + oe.getLanguages().add(DEFAULT_LANGUAGE); + oe.getBodies().add(guardCode); + return oe; + } + + public static String body(Constraint constraint) { + if (constraint.getSpecification() instanceof OpaqueExpression) { + OpaqueExpression oe = (OpaqueExpression) constraint.getSpecification(); + if (oe.getBodies().size() > 0) { + return oe.getBodies().get(0); + } + } + return constraint.getSpecification().stringValue(); + } + + /** + * Create an operation with an operation return type + * + * @param clazz + * @param name + * @param retType + * @return + */ + public static Operation createOperation(Class clazz, String name, Type retType) { + Operation operation = clazz.createOwnedOperation(name, null, null); + if (retType != null) { + Parameter parameter = operation.createOwnedParameter("ret", retType); //$NON-NLS-1$ + parameter.setDirection(ParameterDirectionKind.RETURN_LITERAL); + } + return operation; + } + + public static String body(Behavior behavior) { + return body(behavior, DEFAULT_LANGUAGE); + } + + public static String body(Behavior behavior, String selectLanguage) { + if (behavior instanceof OpaqueBehavior) { + OpaqueBehavior ob = (OpaqueBehavior) behavior; + int i = 0; + for (String language : ob.getLanguages()) { + if (selectLanguage.equals(language)) { + if (i < ob.getBodies().size()) { + return ob.getBodies().get(i); + } + break; + } + } + } + return null; + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/CppUtils.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/CppUtils.xtend new file mode 100644 index 00000000000..fb028cc5f16 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/CppUtils.xtend @@ -0,0 +1,81 @@ +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +import org.eclipse.papyrus.qompass.designer.core.UMLTool +import org.eclipse.uml2.uml.NamedElement +import org.eclipse.uml2.uml.Operation +import org.eclipse.uml2.uml.Parameter +import org.eclipse.uml2.uml.ParameterDirectionKind +import org.eclipse.uml2.uml.Type + +class CppUtils { + + /** + * create the C++ signature for an operation (including parenthesis) + */ + public static def cppSignature(Operation operation) ''' + «operation.name»(«FOR parameter : operation.ownedParameters SEPARATOR(', ')» + «parameter.cppParameter» + «ENDFOR» + ''' + + + /** + * make a C++ call, pass all parameters except the return parameter + */ + public static def cppCall(Operation operation) ''' + «operation.name»(«FOR parameter : UMLTool.parametersNonRet(operation) SEPARATOR(', ')» + «parameter.name» + «ENDFOR») + ''' + + /** + * make a C++ call, pass all parameters except the return parameter, prefix with "return", + * if there is a return type in the operations declaration + */ + public static def returnCppCall(Operation operation) ''' + «IF (operation.type != null)»return «ENDIF»«operation.cppCall» + ''' + + public static def cppParameter(Parameter parameter) ''' + «parameter.type»«IF (parameter.direction == ParameterDirectionKind.OUT)»_out«ENDIF» «parameter.name» + ''' + + public static def cppType(Type type) ''' + «IF (type.qualifiedName == 'UMLPrimitiveTypes::Boolean')» + bool + «ELSEIF (type.qualifiedName == 'UMLPrimitiveTypes::Integer')» + int + «ELSE» + «UMLTool.dereferenceTypedef(type)» + «ENDIF» + ''' + + + public static def cppRetType(Operation operation) ''' + «IF (operation.type == null)» + void + «ELSE» + «operation.type.cppType» + «ENDIF» + ''' + + /** + * Open a set of C++ namespaces associated with the packages of of the passed named element + * TODO: use indentTab? => requires making this script recursive + * Need to include referenced types (assuming a naming convention? + */ + public static def openNamespace(NamedElement namedElement) ''' + «FOR ns : UMLTool.usedNamespaces(namedElement).reverse» + namespace «ns.name» + «ENDFOR» + ''' + + /** + * Close a set of C++ namespaces associated with the packages of of the passed named element + */ + public static def closeNamespace(NamedElement namedElement) ''' + «FOR ns : UMLTool.usedNamespaces(namedElement)» + }; // of namespace [ns.name/] + «ENDFOR» + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/FIFO.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/FIFO.xtend new file mode 100644 index 00000000000..59440deec7b --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/FIFO.xtend @@ -0,0 +1,13 @@ +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +import org.eclipse.uml2.uml.DataType +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext + +class FIFO { + def activate(DataType datatype) ''' + if (m_size == 0) { + cerr << "Warning: size of FIFO is not properly configured (size = 0)" << endl; + } + m_fifo = new «TransformationContext.pkgTemplateParameter("T")»[m_size]; + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/GlobalConstants.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/GlobalConstants.xtend new file mode 100644 index 00000000000..b2a19cce408 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/GlobalConstants.xtend @@ -0,0 +1,56 @@ +/******************************************************************************* +* Copyright (c) 2014 Zeligsoft (2009) Limited and others. +* All rights reserved. This program and the accompanying materials +* are made available under the terms of the Eclipse Public License v1.0 +* which accompanies this distribution, and is available at +* http://www.eclipse.org/legal/epl-v10.html +*******************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +class GlobalConstants { + public static val QUAL_NAME_SEP = "." + public static val FUNC_NAME_QUAL_NAME_SEP = "__" + public static val FUNC_NAME_PART_SEP = "____" + public static val INJECT_FUNC_NAME = "inject" + public static val INITIALIZE_FUNC_NAME = "initialize" + public static val STATE_FUNC_PREFIX = "state_" + public static val JUNCTION_FUNC_PREFIX = "junction_" + public static val CHOICE_FUNC_PREFIX = "choice_" + public static val ACTION_CHAIN_FUNC_PREFIX = "actionchain_" + public static val ACTION_FUNC_PREFIX = "action_" + public static val GUARD_FUNC_PREFIX = "guard_" + public static val USER_ACTION_FUNC_PREFIX = "useraction_" + public static val USER_GUARD_FUNC_PREFIX = "userguard_" + public static val EXIT_ACTION_FUNC_PREFIX = "exitaction_" + public static val ENTRY_ACTION_FUNC_PREFIX = "entryaction_" + public static val TRANS_ACTION_FUNC_PREFIX = "transitionaction_" + public static val SAVE_HISTORY_FUNC_NAME = "save_history" + public static val CHECK_HISTORY_FUNC_NAME = "check_history" + public static val CHECK_HISTORY_FUNC_PREFIX = "checkhistory_" + public static val CURRENT_STATE_FIELD_NAME = "currentState" + public static val HISTORY_TABLE_NAME = "history" + public static val UNDEFINED = "SPECIAL_INTERNAL_STATE_UNDEFINED" + public static val UNVISITED = "SPECIAL_INTERNAL_STATE_UNVISITED" + public static val STATE_TYPE_NAME = "State" + public static val PORT_TYPE_NAME = "Port" + public static val SIGNAL_TYPE_NAME = "Signal" + public static val INJECT_FUNC_PARAM = "msg" + public static val INITIALIZE_FUNC_PARAM = "msg" + public static val STATE_FUNC_PARAM = "msg" + public static val JUNC_FUNC_PARAM = "msg" + public static val CHOICE_FUNC_PARAM = "msg" + public static val CHAIN_FUNC_PARAM = "msg" + public static val ACTION_FUNC_PARAM = "msg" + public static val ACTION_DATA_VARIABLE = "rtdata" + public static val EMPTY_ACTION_COMMENT = "// (Automatically generated stub for an empty action)" + public static val MISSING_CODE_COMMENT = "// (No C++ code found for this action)" + public static val MISSING_CONSTRAINT_BODY = "false" + public static val FRESH_NAME_PREFIX = "new_" + public static val FRESH_ENTRYPOINT_NAME_PREFIX = "new_entrypoint_" + public static val FRESH_EXITPOINT_NAME_PREFIX = "new_exitpoint_" + public static val FRESH_CHOICEPOINT_NAME_PREFIX = "new_choice_" + public static val FRESH_JUNCTIONPOINT_NAME_PREFIX = "new_junction_" + public static var FRESH_TRANSITION_NAME_PREFIX = "new_transition_" + +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/Marshalling.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/Marshalling.xtend new file mode 100644 index 00000000000..02d93031b6a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/Marshalling.xtend @@ -0,0 +1,51 @@ +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +import org.eclipse.uml2.uml.Operation +import static extension org.eclipse.papyrus.qompass.designer.core.UMLTool.* +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.cppType +import org.eclipse.uml2.uml.Parameter + +class Marshalling { + def static marshall(Operation operation) ''' + // now marshall in and inout parameters via ASN.1 + «FOR parameter : operation.parametersInInout» + «parameter.marshall» + «ENDFOR» + ''' + + def static marshallOutInout(Operation operation) ''' + // now marshall out and inout parameters via ASN.1 + «FOR parameter : operation.parametersOutInout» + «parameter.marshall» + «ENDFOR» + ''' + + def static marshall(Parameter parameter) ''' + { + «parameter.type.cppType» varName_ASN = «parameter.name»; + BEncAsnContent (&pBuffer, &varName_ASN); + } + ''' + + def static unmarshall(Operation operation) ''' + «FOR parameter : operation.parametersInInout.reverse» + «parameter.unmarshall» + «ENDFOR» + ''' + + def static unmarshallOutInout(Operation operation) ''' + «FOR parameter : operation.parametersOutInout.reverse» + «parameter.unmarshall» + «ENDFOR» + ''' + + def static unmarshall(Parameter parameter) ''' + «parameter.type.cppType» «parameter.name» + { + «parameter.type.cppType» varName_ASN; + BDecAsnContent (&pBuffer, &varName_ASN); + «parameter.name» = varName_ASN; + } + ''' + +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/MultipleReceptacle.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/MultipleReceptacle.xtend new file mode 100644 index 00000000000..0f73ff273e2 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/MultipleReceptacle.xtend @@ -0,0 +1,14 @@ +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +import org.eclipse.uml2.uml.Operation +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.cppCall + +class MultipleReceptacle { + def operation_(Operation operation) ''' + for (int i=0; i<9; i++) { + if (rconn[i] != 0) { + rconn[i]->«operation.cppCall»; + } + } + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineGen.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineGen.xtend new file mode 100644 index 00000000000..310526b1998 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineGen.xtend @@ -0,0 +1,412 @@ +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +import org.eclipse.emf.common.util.BasicEList +import org.eclipse.emf.common.util.EList +import org.eclipse.emf.ecore.util.EcoreUtil +import org.eclipse.papyrus.C_Cpp.Ptr +import org.eclipse.papyrus.FCM.DerivedElement +import org.eclipse.papyrus.qompass.designer.core.StUtils +import org.eclipse.papyrus.qompass.designer.core.Utils +import org.eclipse.papyrus.qompass.designer.core.UMLTool +import org.eclipse.papyrus.qompass.designer.core.extensions.IXtend +import org.eclipse.papyrus.qompass.designer.core.sync.InterfaceSync +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationException +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil +import org.eclipse.uml2.uml.Behavior +import org.eclipse.uml2.uml.BehavioredClassifier +import org.eclipse.uml2.uml.CallEvent +import org.eclipse.uml2.uml.Class +import org.eclipse.uml2.uml.OpaqueExpression +import org.eclipse.uml2.uml.Operation +import org.eclipse.uml2.uml.Pseudostate +import org.eclipse.uml2.uml.PseudostateKind +import org.eclipse.uml2.uml.Reception +import org.eclipse.uml2.uml.Signal +import org.eclipse.uml2.uml.SignalEvent +import org.eclipse.uml2.uml.State +import org.eclipse.uml2.uml.StateMachine +import org.eclipse.uml2.uml.TimeEvent +import org.eclipse.uml2.uml.Transition +import org.eclipse.uml2.uml.Trigger +import org.eclipse.uml2.uml.Type +import org.eclipse.uml2.uml.ValueSpecification +import org.eclipse.uml2.uml.Vertex +import org.eclipse.uml2.uml.util.UMLUtil + +import static org.eclipse.papyrus.qompass.designer.core.EnumService.* +import static org.eclipse.papyrus.qompass.designer.vsl.ParseVSL.* + +import static extension org.eclipse.papyrus.qompass.designer.core.UMLTool.* +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.BehaviorUtil.* +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.cppCall +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.StateMachineUtil.* +import org.eclipse.papyrus.uml.tools.utils.PackageUtil +import org.eclipse.uml2.uml.UMLPackage +import org.eclipse.uml2.uml.Enumeration + +class StateMachineGen implements IXtend { + + Class clazz + + boolean ooPattern = true; + + def getStateMachine(Class clazz) { + // organized in a loop. But effectively supports single state machine + for (smBehavior : (clazz as BehavioredClassifier).ownedBehaviors.filter[it instanceof StateMachine]) { + return smBehavior as StateMachine + } + return null + } + + def activate(Class clazz) { + val sm = clazz.stateMachine + val flattener = new UMLFlattener + flattener.transform(sm) + activate(clazz, sm) + } + + def activate(Class clazz, StateMachine sm) ''' + m_currentState = STATE_«sm.region.initialState.name»; +#ifdef SM_VERBOSE + cout << "SM «clazz.name»: in state «sm.region.initialState.name»" << endl; +#endif + for (;;) { + processEvents(); + } + ''' + + def processEvents(Class clazz) { + val sm = clazz.stateMachine + // - Option to put processElements into original class (but, would need to copy dependencies & attributes) + // create new operation in class owning the state machine. + // val operation = clazz.createOperation("processEvents", null) + // val ob = clazz.createOpaqueBehavior(operation) + // ob.set(clazz.processEventsSM(sm).toString) + // return "executor->processEvents();" + this.clazz = clazz + return clazz.processEventsSM(sm) + } + + def eventInterceptor(Operation operation) ''' + «/*TODO: need better way to detect signal*/» + «operation.eventInterceptorCommon» + event.portID = portID; + out->writeEvent(event); + + «IF (operation.type != null)»return «ENDIF»rconn->«operation.cppCall»; + ''' + + /** + * OO variant of event interceptor. Adds call event to pool and + * then calls the original method (handled by LW container) + */ + def eventInterceptorOO(Operation operation) ''' + «operation.eventInterceptorCommon» + ''' + + def eventInterceptorCommon(Operation operation) ''' + «val derivedElement = UMLUtil.getStereotypeApplication(operation, DerivedElement)» + «IF (derivedElement != null) && (derivedElement.source instanceof Reception)» + «val signal = (derivedElement.source as Reception).signal» + // create event with global signal ID + core::ContainerServices::CallEvent_ event; + event.operationID = «literal(SIGNAL_ENUM, operation.name)»; + // map signal into value-buffer and copy attributes + ::«signal.qualifiedName» * signal = (::«signal.qualifiedName» *) &event.params; + «FOR attribute : signal.ownedAttributes» + signal->«attribute.name» = «attribute.name»; + «ENDFOR» + «PackageUtil.getRootPackage(operation).declareDependencyToSignalIDs» + «UMLTool.declareDependency(TransformationContext.classifier, signal)» + «ELSE» + // create event with operationID/portID and pass call + core::ContainerServices::CallEvent_ event; + «IF ooPattern» + event.operationID = OP_ID_«operation.name»; + «ELSE» + event.operationID = ID_«operation.name»; + «ENDIF» + «ENDIF» + ''' + + def processEventsSM(BehavioredClassifier clazz, StateMachine sm) ''' + // processEvents body - generated by Qompass + // + // supports ports «FOR port : (clazz as Class).ownedPorts» «literal('PortEnum_'+clazz.name, 'port_'+clazz.name+'_'+port.name)»«ENDFOR» + + core::ContainerServices::CallEvent_ event; + int timeout; + int newState; + bool needsTrigger; + + switch(m_currentState) { + «FOR state : sm.region.subvertices» + case «literal('LStateIDs_'+clazz.name, 'STATE_'+state.name)»: + // -------- treatment of accepted events + «state.acceptableEvents» + break; + «ENDFOR» + default: + OSAL_ERROR ("Inconsistent state"); + break; + } + if (animOut != 0) { + animOut->enterState(newState, «clazz.fragment»); + } + ''' + + /* + * Pass the actual to which the port is bound. In case of a CallEvent, pass the implemented interface + * (Not the class to which the state machine is bound). This is useful in the context of components + * whose ports implement an interface + */ + def cetrigger(Operation operation) { + val intf = operation.implementsInterface + if (intf != null) { + val packageRef = intf.boundPackageRef + // declare dependency to OperationIDs enumeration + packageRef.declareDependencyToOperationIDs + '''«packageRef.qualifiedName»::ID_«operation.name»''' + } + else { + // create operationIDs literal + literal("LOperationIDs", '''OP_ID_«operation.name»''') + } + } + + // Use service for global enumerations + def setrigger(Trigger trigger) { + val se = trigger.event as SignalEvent + literal(SIGNAL_ENUM, InterfaceSync.SIG_PREFIX + se.signal.name) + } + + /** + * create code for acceptable events + * + * big restriction: will only analyse first of possibly multiple triggers + */ + def acceptableEvents(Vertex state) ''' + // loop on state + // execute action ... + timeout = -1; // no timeout by default + «FOR transition : state.outgoings» + «IF transition.triggers.size > 0» + «val trigger = transition.triggers.get(0)» + «IF (trigger.event instanceof TimeEvent)» + «val timeEvent = trigger.event as TimeEvent» + // transition «transition.name» - trigger: TimeEvent, expression «(timeEvent.when.expr as OpaqueExpression).bodies.get(0)». + timeout = «getDurationFromVSL((timeEvent.when.expr as OpaqueExpression).bodies.get(0))»/1000; + «ENDIF» + «ENDIF» + «ENDFOR» + + «IF ((state instanceof State) && (state as State).entry != null)» + // execute entry action + executor->«(state as State).entry.name»(); + «ENDIF» + + needsTrigger = true; + + «IF hasTransitionWithoutTrigger(state)» + «FOR transition : state.outgoings» + «IF transition.triggers.size == 0» + «IF transition.guard != null» + «transition.guard.specification.createGuardFct(null)» + if (executor->«transition.guard.specification.name»()) { + «ENDIF» + newState = STATE_«transition.target.name»; +#ifdef SM_VERBOSE + cout << "SM «clazz.name»: transition to state «transition.target.name»" << endl; +#endif + «IF (transition.effect != null)» + executor->«effectName(transition)»(); + «ENDIF» + needsTrigger = false; + «IF transition.guard != null» + } + «ENDIF» + «ENDIF» + «ENDFOR» + «ENDIF» + + if (needsTrigger) { + // get an event from the pool. + «IF ooPattern» + event = eventPool.readEvent(timeout); + «ELSE» + event = ep->readEvent(timeout); + «ENDIF» + } + else { + event.operationID = -1; + } + + «val allOutgoings = state.outgoings» + «FOR transition : allOutgoings» + «IF transition.triggers.size > 0» + // has «transition.triggers.size» outgoing transitions + «val trigger = transition.triggers.get(0)» + «IF (trigger.event instanceof TimeEvent)» + // transition «transition.name» - trigger: TimeEvent (there should be at most one outgoing timed transition per state). + if (event.operationID == core::ContainerServices::EventPool::ID_TIMEOUT) { + «IF transition.guard != null» + «transition.guard.specification.createGuardFct(null)» + if (executor->«transition.guard.specification.name»()) { + «ENDIF» + newState = STATE_«transition.target.name»; +#ifdef SM_VERBOSE + cout << "SM «clazz.name»: transition to state «transition.target.name»" << endl; +#endif + «IF (transition.effect != null)» + executor->«effectName(transition)»(); + «ENDIF» + «IF transition.guard != null» + } + «ENDIF» + } + «ENDIF» + «IF (trigger.event instanceof CallEvent)» + // transition «trigger.name» - trigger: CallEvent («trigger.event.name»), operation «(trigger.event as CallEvent).operation.name» + if (event.operationID == «cetrigger((trigger.event as CallEvent).operation)») { + newState = STATE_«transition.target.name»; +#ifdef SM_VERBOSE + cout << "SM «clazz.name»: transition to state «transition.target.name»" << endl; +#endif + «IF (transition.effect != null)» + executor->«effectName(transition)»(); + «ENDIF» + } + «ENDIF» + «IF (trigger.event instanceof SignalEvent)» + «val signalEvent = trigger.event as SignalEvent» + // transition «trigger.name» - trigger: SignalEvent («signalEvent.name»), signal «signalEvent.signal.name» + if (event.operationID == «setrigger(trigger)») { + «IF (transition.effect != null) || (transition.guard != null)» + // map signal to parameter section + ::«signalEvent.signal.qualifiedName» * signal = (::«signalEvent.signal.qualifiedName» *) &event.params; + «ENDIF» + «IF transition.guard != null» + «transition.guard.specification.createGuardFct(signalEvent)» + if (executor->«transition.guard.specification.name»(signal)) { + «ENDIF» + newState = STATE_«transition.target.name»; +#ifdef SM_VERBOSE + cout << "SM «clazz.name»: transition to state «transition.target.name» (due to signal «signalEvent.signal.name»)" << endl; +#endif + «IF (transition.effect != null)» + «transition.effect.addSignalParameter(signalEvent.signal)» + executor->«effectName(transition)»(«IF signalEvent.signal.attributes.size > 0»signal«ENDIF»); + «ENDIF» + // ok = EvQUEUE ; + «IF transition.guard != null» + } + «ENDIF» + } + «ENDIF» + «ENDIF» + «ENDFOR» + + if (newState != m_currentState) { + m_currentState = newState; + «IF ((state instanceof State) && (state as State).exit != null)» + // execute exit action + executor->«(state as State).exit.name»(); + «ENDIF» + + + } + ''' + + def boolean hasTransitionWithoutTrigger(Vertex state) { + for (transition : state.outgoings) { + if (transition.triggers.size == 0) { + return true; + } + } + return false; + } + + def EList calculateTransitions(Vertex state) { + val allOutgoings = new BasicEList + allOutgoings.addAll(state.outgoings) + for (transition : state.outgoings) { + if (transition.target instanceof Pseudostate) { + val ps = transition.target as Pseudostate + if (ps.kind == PseudostateKind.JUNCTION_LITERAL) { + allOutgoings.addAll(ps.outgoings.clone) + } + } + } + return allOutgoings + } + + /** + * Effects are moved from behaviors embedded into transitions towards behaviors of the class. Calculate the name of these + * effects. The class FilterStateMachines moves the effects (TODO: single name calculation) + */ + def effectName(Transition transition) { + // transition.containingStateMachine.name + "_" + transition.effect.name + if (transition.effect.name == null) { + throw new TransformationException( + String.format("effect of transition has no name (in SM %s)", transition.containingStateMachine.name)) + } + transition.effect.name + } + + def void addSignalParameter(Behavior behavior, Signal signal) { + if (behavior.ownedParameters.size == 0) { + val parameter = behavior.createOwnedParameter("signal", signal) + StereotypeUtil.apply(parameter, Ptr) + } + } + + def void moveBehavior(String newName, Class tmClass, Behavior effect) { + val copiedEffect = EcoreUtil.copy(effect) + if (tmClass.getOwnedOperation(newName, null, null) != null) { + // has already been added + return; + } + val operation = tmClass.createOwnedOperation(newName, null, null); + for (parameter : effect.getOwnedParameters()) { + val newParameter = EcoreUtil.copy(parameter); + operation.getOwnedParameters().add(newParameter); + StUtils.copyStereotypes(parameter, newParameter); + } + copiedEffect.setSpecification(operation); + copiedEffect.setName(newName); + tmClass.getOwnedBehaviors().add(copiedEffect); + } + + static final String CLIB_BOOL = "AnsiCLibrary::bool" + + def void createGuardFct(ValueSpecification specification, SignalEvent event) { + val name = specification.getName() + + if (clazz.getOwnedBehavior(name) != null) { + return + } + var booleanNamedElement = Utils.getQualifiedElement(TransformationContext.sourceRoot, CLIB_BOOL); + + if (booleanNamedElement instanceof Type) { + val booleanType = TransformationContext.copier.getCopy(booleanNamedElement) as Type + val operation = clazz.createOperation(name, booleanType as Type) + if (event != null) { + val sigParam = operation.createOwnedParameter("signal", event.signal) + StereotypeUtil.apply(sigParam, Ptr) + } + val ob = clazz.createOpaqueBehavior(operation) + if (specification instanceof OpaqueExpression) { + ob.getLanguages().addAll(specification.getLanguages()); + for (String body : specification.getBodies()) { + ob.getBodies().add("return " + body + ";"); + } + } + } + else { + System.out.println("was"); + } + // if (tmClass.getOwnedOperation(newName, null, null) != null) { + // copiedEffect.setSpecification(operation); + } +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineUtil.java b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineUtil.java new file mode 100644 index 00000000000..d33d2a0c9fb --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StateMachineUtil.java @@ -0,0 +1,260 @@ +package org.eclipse.papyrus.qompass.modellibs.core.xtend; + +import java.util.Collection; + +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.papyrus.qompass.designer.core.UMLTool; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.qompass.designer.core.templates.TemplateUtils; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.PackageableElement; +import org.eclipse.uml2.uml.Pseudostate; +import org.eclipse.uml2.uml.PseudostateKind; +import org.eclipse.uml2.uml.Region; +import org.eclipse.uml2.uml.State; +import org.eclipse.uml2.uml.StateMachine; +import org.eclipse.uml2.uml.TemplateBinding; +import org.eclipse.uml2.uml.Transition; +import org.eclipse.uml2.uml.Type; +import org.eclipse.uml2.uml.UMLPackage; +import org.eclipse.uml2.uml.Vertex; + + +public class StateMachineUtil { + public static Region region(State state) { + EList regions = state.getRegions(); + if (regions.size() > 0) { + return regions.get(0); + } + return null; + } + + public static Region region(StateMachine stateMachine) { + EList regions = stateMachine.getRegions(); + if (regions.size() > 0) { + return regions.get(0); + } + return null; + } + + public static EList subStates(State state) { + Region region = region(state); + return (region != null) ? states(region) : new BasicEList(); + } + + public static EList states(StateMachine stateMachine) { + Region region = region(stateMachine); + return (region != null) ? states(region) : new BasicEList(); + } + + public static EList states(Region region) { + EList states = new BasicEList(); + for (org.eclipse.uml2.uml.Vertex vertex : region.getSubvertices()) { + if (vertex instanceof State) { + states.add((State) vertex); + } + } + return states; + } + + public static EList entryPoints(State state) { + EList pseudoStates = new BasicEList(); + for (Pseudostate pseudoState : state.getConnectionPoints()) { + if (pseudoState.getKind() == PseudostateKind.ENTRY_POINT_LITERAL) { + pseudoStates.add(pseudoState); + } + } + return pseudoStates; + } + + public static EList exitPoints(State state) { + EList pseudoStates = new BasicEList(); + for (Pseudostate pseudoState : state.getConnectionPoints()) { + if (pseudoState.getKind() == PseudostateKind.EXIT_POINT_LITERAL) { + pseudoStates.add(pseudoState); + } + } + return pseudoStates; + } + + public static EList junctionPoints(Region region) { + return filteredPseudoStates(region, PseudostateKind.JUNCTION_LITERAL); + } + + public static EList choicePoints(Region region) { + return filteredPseudoStates(region, PseudostateKind.CHOICE_LITERAL); + } + + public static EList filteredPseudoStates(Region region, PseudostateKind kind) { + EList pseudoStates = new BasicEList(); + for (Vertex vertex : region.getSubvertices()) { + if (vertex instanceof Pseudostate) { + Pseudostate pseudoState = (Pseudostate) vertex; + if (pseudoState.getKind() == kind) { + pseudoStates.add(pseudoState); + } + } + } + return pseudoStates; + } + + public static Pseudostate firstPseudoState(Region region, PseudostateKind kind) { + for (Vertex vertex : region.getSubvertices()) { + if (vertex instanceof Pseudostate) { + Pseudostate pseudoState = (Pseudostate) vertex; + if (pseudoState.getKind() == kind) { + return pseudoState; + } + } + } + return null; + } + + /** + * @return The set of all transitions ending indirectly on the state. + * This is, those which end on one of the state's entry points. + */ + public static Collection indirectIncomings(State state) { + EList indirectIncoming = new BasicEList(); + for (Pseudostate p : entryPoints(state)) { + for (Transition t : p.getIncomings()) { + indirectIncoming.add(t); + } + } + return indirectIncoming; + } + + /** + * @return The set of all transitions ending indirectly on the state. + * This is, those which end on one of the state's entry points. + */ + public static Collection indirectOutgoings(State state) { + EList indirectIncoming = new BasicEList(); + for (Pseudostate p : entryPoints(state)) { + for (Transition t : p.getIncomings()) { + indirectIncoming.add(t); + } + } + return indirectIncoming; + } + + + /** + * @return The set of all direct and indirect incoming transitions to the state. + */ + public static Collection allIncomings(State state) { + EList allIncoming = new BasicEList(); + for (Transition t : state.getIncomings()) { + allIncoming.add(t); + } + allIncoming.addAll(indirectIncomings(state)); + return allIncoming; + } + + /** + * @return The set of all direct and indirect incoming transitions to the state. + */ + public static Collection allOutgoings(State state) { + EList allIncoming = new BasicEList(); + for (Transition t : state.getIncomings()) { + allIncoming.add(t); + } + allIncoming.addAll(indirectOutgoings(state)); + return allIncoming; + } + + /** + * Adds all the inner elements of a composite state to self, except for the + * initial, entry, exit and history pseudo-states. + * + * This operation moves those elements, as it removes them from their + * original container and sets their owner to the recipient. + */ + public static void moveContents(Region targetRegion, State source) { + Region sourceRegion = region(source); + EList vertices = new BasicEList(sourceRegion.getSubvertices()); + for (Vertex v : vertices) { + // move states and pseudostates + targetRegion.getSubvertices().add(v); + } + EList transitions = new BasicEList(sourceRegion.getTransitions()); + for (Transition t : transitions) { + targetRegion.getTransitions().add(t); + } + } + + public static Pseudostate initialState(Region region) { + return firstPseudoState(region, PseudostateKind.INITIAL_LITERAL); + } + + public static Pseudostate deepHistory(Region region) { + return firstPseudoState(region, PseudostateKind.DEEP_HISTORY_LITERAL); + } + + public static State createState(Region region, String name) { + return (State) region.createSubvertex(name, UMLPackage.eINSTANCE.getState()); + } + + public static Pseudostate createPseudostate(Region region, String name) { + return (Pseudostate) region.createSubvertex(name, UMLPackage.eINSTANCE.getPseudostate()); + } + + /** + * Return the bound package in the context of template instantiation for a given actual. + * + * This is required by the state machine template which needs to access operation IDs + * provided by the call interceptor. + * + * @param actual + * The actual for template binding + * @return + */ + public static Package boundPackageRef(Type actual) { + for (Package nestedPkg : PackageUtil.getRootPackage(actual).getNestedPackages()) { + // search for bound package templates who are bound to the same actual + // TODO: search is ambiguous, if same actual is used more than once + if (nestedPkg.getTemplateBindings().size() > 0) { + TemplateBinding binding = nestedPkg.getTemplateBindings().get(0); + if (actual == TemplateUtils.getFirstActualFromBinding(binding)) { + return nestedPkg; + } + } + } + return null; + } + + /** + * Declares a dependency from the current classifier which is produced by template instantiation + * to the element (enum) "OperationIDs", if found within the passed package. + * + * @param pkg + * @return + */ + public static void declareDependencyToOperationIDs(Package pkg) { + PackageableElement type = pkg.getPackagedElement("OperationIDs"); //$NON-NLS-1$ + if (type instanceof Type) { + UMLTool.declareDependency(TransformationContext.classifier, (Type) type); + } + } + + /** + * Declares a dependency from the current classifier which is produced by template instantiation + * to the element (enum) "SignalIDs", if found within the passed package. + * + * @param pkg + * the package in which an enumeration is looked up + * @return + */ + public static void declareDependencyToSignalIDs(Package pkg) { + NamedElement type = Utils.getQualifiedElement(pkg, "globalenums::" + SIGNAL_ENUM); //$NON-NLS-1$ + if (type instanceof Type) { + UMLTool.declareDependency(TransformationContext.classifier, (Type) type); + } + } + + static final String SIGNAL_ENUM = "SignalIDs"; +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StructBasedMarshalling.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StructBasedMarshalling.xtend new file mode 100644 index 00000000000..89d085b3937 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/StructBasedMarshalling.xtend @@ -0,0 +1,25 @@ +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +import org.eclipse.uml2.uml.Operation +import static extension org.eclipse.papyrus.qompass.designer.core.UMLTool.* +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.cppType + +// TODO: original model code does effectively do more than marshalling +class StructBasedMarshalling { + def static marshall(Operation operation) ''' + struct ParamData { + «FOR parameter : operation.parametersInInout» + «parameter.type.cppType» «parameter.name»; + «ENDFOR» + }; + Event event; + event.ID = [operation.name/]; + event.kind = CallEvent; + ParamData * data = &event.params; + «FOR parameter : operation.parametersInInout» + data->[parameter.name/] = [parameter.name/]; + «ENDFOR» + out->dispatch(event); + ''' + +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/SyncCalls.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/SyncCalls.xtend new file mode 100644 index 00000000000..96952f2f8d1 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/SyncCalls.xtend @@ -0,0 +1,13 @@ +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +import org.eclipse.uml2.uml.Operation +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.* + +class SyncCalls { + def syncCall(Operation operation) ''' + // put pre-interceptors here + [comment type is a derived property containing the operations return type/] + «IF operation.type != null»return «ENDIF»rconn->«operation.cppCall»; + // put post-interceptors here + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLAction.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLAction.xtend new file mode 100644 index 00000000000..3cbc6f2da3a --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLAction.xtend @@ -0,0 +1,58 @@ +/******************************************************************************* +* Copyright (c) 2014 Zeligsoft, CEA and others. +* All rights reserved. This program and the accompanying materials +* are made available under the terms of the Eclipse Public License v1.0 +* which accompanies this distribution, and is available at +* http://www.eclipse.org/legal/epl-v10.html +*******************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +import org.eclipse.xtend.lib.annotations.Accessors +import org.eclipse.uml2.uml.Behavior +import java.util.List +import java.util.ArrayList + +/** + * An action in the sense of the invocation of a behavior. + * This means that the actual behavior is not described here. The action + * is referencing the behavior and providing information how to invoke the + * behavior. + * The action has no prefix: the name of the referenced behavior needs to be prefixed, if necessary + * + * @author Ansgar (based on code from eposse) + * + */ +class UMLAction { + + /** Source UMLRT model element. */ + @Accessors Behavior origin + + // list of parameters for a call, simply a list of strings. if null => no parameters + public List callParams; + + new(Behavior origin) { + this.origin = origin + } + + /** + * Add a parameter + */ + def addParam(String parameter) { + if (callParams == null) { + callParams = new ArrayList() + } + callParams.add = parameter + } + + def getSpecification() { + origin.specification + } + + def getFuncName() { + origin.name + } + + override toString() '''Action(«origin.name»)''' + +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLChain.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLChain.xtend new file mode 100644 index 00000000000..05bf596b9a6 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLChain.xtend @@ -0,0 +1,91 @@ +/******************************************************************************* +* Copyright (c) 2014 Zeligsoft (2009) Limited and others. +* All rights reserved. This program and the accompanying materials +* are made available under the terms of the Eclipse Public License v1.0 +* which accompanies this distribution, and is available at +* http://www.eclipse.org/legal/epl-v10.html +*******************************************************************************/ + +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +import java.util.HashMap +import java.util.List +import java.util.Map +import org.eclipse.uml2.uml.Behavior +import org.eclipse.uml2.uml.Transition +import org.eclipse.xtend.lib.annotations.Accessors + +/** + * A chain of state entry, exit and transition actions for a "flat" + * {@link Transition}. + * + * @author eposse + * + */ +class UMLChain { + + @Accessors List actions + @Accessors Transition owner + + static Map chains; + + new () { + actions = newArrayList + } + + new (List actions) { + this.actions = newArrayList(actions) // We need this to be mutable. + } + + def static void initChains() { + chains = new HashMap(); + } + + /** + * Return the chain of behaviors associated with a transition + * IF the chain does not exist yet, it will be created (and stored in a hash map) + * @param t + * @return + */ + def static UMLChain chain(Transition t) { + var UMLChain chain = chains.get(t) + if (chain == null) { + chain = new UMLChain() + chain.setOwner(t) + chains.put(t, chain) + } + return chain + } + + def append(UMLAction action) { + actions.add(action) + return this + } + + def append(Behavior behavior) { + if (behavior != null) { + append(new UMLAction(behavior)) + } + return this + } + + def prepend(UMLAction action) { + actions.add(0, action) + return this + } + + def prepend(Behavior behavior) { + prepend(new UMLAction(behavior)) + return this + } + + def getOwner() { + owner + } + + def setOwner(Transition t) { + owner = t + // add transition effect to action list + append(t.effect) + } +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlatModel2Cpp.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlatModel2Cpp.xtend new file mode 100644 index 00000000000..fe1b522e4bf --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlatModel2Cpp.xtend @@ -0,0 +1,667 @@ +/******************************************************************************* +* Copyright (c) 2014 Zeligsoft, CEA and others. +* All rights reserved. This program and the accompanying materials +* are made available under the terms of the Eclipse Public License v1.0 +* which accompanies this distribution, and is available at +* http://www.eclipse.org/legal/epl-v10.html +*******************************************************************************/ +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +import org.eclipse.uml2.uml.Port +import org.eclipse.uml2.uml.Class +import org.eclipse.uml2.uml.Property +import org.eclipse.uml2.uml.State +import org.eclipse.uml2.uml.StateMachine +import org.eclipse.uml2.uml.Transition +import java.util.Map +import org.eclipse.uml2.uml.NamedElement +import java.util.Collection +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.StateMachineUtil.* +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.BehaviorUtil.* +import org.eclipse.uml2.uml.UMLPackage +import org.eclipse.uml2.uml.Enumeration +import org.eclipse.uml2.uml.EnumerationLiteral +import org.eclipse.uml2.uml.Pseudostate +import org.eclipse.uml2.uml.PseudostateKind +import org.eclipse.uml2.uml.Operation +import org.eclipse.uml2.uml.OpaqueBehavior +import org.eclipse.uml2.uml.Parameter +import org.eclipse.uml2.uml.CallEvent +import org.eclipse.uml2.uml.Stereotype +import org.eclipse.uml2.uml.Type +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.UMLChain.chain +import java.util.List +import org.eclipse.papyrus.qompass.designer.core.EnumService + +/** + * This class contains the transformation from flat UML-RT state machines to the + * C/C++ language model. + * + * It implements the algorithms described in the technical report + * + * E. Posse. "Transforming flat UML-RT State Machines to a C/C++ language model". + * Technical Report ZTR-2014-EP-002, Version 2, Zeligsoft, Sep 2014. + * + * Ansgar Radermacher (CEA): translation to UML transformation + * @author eposse + */ +class UMLFlatModel2Cpp { + + /** + * The CppCodePattern that is being used for this transformation operation. + */ + + /** The source state machine to transform */ + StateMachine machine + Class clazz + + /** Elements that go into the generated model. */ + Enumeration statesDeclaration + Property currentStateField + Map stateEnumerators + Property historyTableDeclaration + Operation saveHistoryFunction + Map actionChainFunctions + Map junctionPointFunctions + Map choicePointFunctions + Map stateFunctions + Operation injectFunc + Operation initializeFunc + Stereotype refStereo + Stereotype constStereo + + new() { + stateEnumerators = newHashMap + // userActionFunctions = newHashMap + actionChainFunctions = newHashMap + junctionPointFunctions = newHashMap + choicePointFunctions = newHashMap + stateFunctions = newHashMap + } + + /** + * This is the main method of the transformation. It performs the + * transformation by invoking methods that generate each part of the + * target language model. + */ + def transform(StateMachine m) { + machine = m + clazz = m.owner as Class + + generateStatesDeclaration + generateCurrentStateField + generateHistoryTableDeclaration + generateSaveHistoryFunction + // generateAllUserActionFunctions + generateAllActionChainFunctions + generateAllJunctionFunctions + generateAllChoicePointFunctions + generateAllStateFunctions + generateInjectFunc + generateInitializeFunc + } + + /** + * Builds an enum type for the states of the state machine. + * + * The generated code would be something like: + * + *

      +     * enum State { s0, s1, s1_s0, s1_s1, s2, ... };
      +     * 
      + */ + def generateStatesDeclaration() { + + val clazz = machine.owner as Class + statesDeclaration = clazz.createNestedClassifier(GlobalConstants.STATE_TYPE_NAME, + UMLPackage.eINSTANCE.getEnumeration) as Enumeration + for (s : machine.states) { + if (s.name == null) { + s.name = "undefined" + } + val stateLiteral = statesDeclaration.createOwnedLiteral(s.name) + stateEnumerators.put(s, stateLiteral) + } + statesDeclaration.createOwnedLiteral(GlobalConstants.UNVISITED) + + // stateEnumerators.put(State.UNVISITED, unvisitedStateLiteral) + } + + /** + * Generates a field to hold the current state. + * + * The generated code would be something like: +-- * + *

      +     * 
      +     * State currentState;
      +     * 
      +     * 
      + */ + def generateCurrentStateField() { + currentStateField = clazz.createOwnedAttribute(GlobalConstants.CURRENT_STATE_FIELD_NAME, statesDeclaration) + } + + /** + * Generates a declaration for the history table for the state machine. + * + * The generated code would be something like: + * + *

      + * State[] history = { UNDEFINED, ..., UNDEFINED }; + */ + def generateHistoryTableDeclaration() { + + // TODO: currentStateField already used (probably wrong!) + historyTableDeclaration = clazz.createOwnedAttribute(GlobalConstants.HISTORY_TABLE_NAME, statesDeclaration) + val numStates = machine.states.size + + // use CppArray instead? + // TODO + // currentStateField.upper = numStates + + // get constructor TODO + var ctor = clazz.getOwnedOperation(clazz.getName(), null, null) + var OpaqueBehavior ctorOB + if (ctor != null) { + ctorOB = ctor.methods.get(0) as OpaqueBehavior + } + if (ctor == null) { + ctor = clazz.createOperation(clazz.getName(), null) + ctorOB = clazz.createOpaqueBehavior(ctor) + } + + // TODO: might be more than one constructor + ctorOB.set(''' + int i = 0; + while (i<«numStates») { + «GlobalConstants.HISTORY_TABLE_NAME»[i++] = «GlobalConstants.UNVISITED»; + }''') + } + + /** + * Generates a function that saves history. + * + * The code generated is as follows: + * + *

      +     * 
      +     * void saveHistory(State compositeState, State subState) {
      +     *     history[compositeState] = subState;
      +     * }
      +     * 
      +     * 
      + * + * where State is the capsule's state type (an enum) and + * history is the capsule's history table. + * + *

      Note: The current implementation generates this as a normal + * function but it should be either a macro or an inline function. + * However the C/C++ language model does not currently support these. + * + * @see + * #generateStatesDeclaration + * #generateHistoryTableDeclaration + */ + def generateSaveHistoryFunction() { + + // Create the operation programmatically. Yet, it would be better + // to provide a model template for this + // [LW container-transformation + // saveHist(State compositeState, State subState) { + // historyTable[param1] = param2; + // } + saveHistoryFunction = clazz.createOwnedOperation(GlobalConstants.SAVE_HISTORY_FUNC_NAME, null, null) + saveHistoryFunction.createOwnedParameter("compositeState", stateType) + saveHistoryFunction.createOwnedParameter("subState", stateType) + // behavior might exist already (created by flattener) + var funcOB = clazz.getOwnedBehavior(GlobalConstants.SAVE_HISTORY_FUNC_NAME) + if (funcOB == null) { + funcOB = clazz.createOpaqueBehavior(saveHistoryFunction) + } + else { + funcOB.specification = saveHistoryFunction + } + funcOB.set("history[compositeState] = subState;") + } + + /** + * Generate function declarations for transition action chains. + * + *

      Each function generated will have a sequence of calls, invoking either + * the action functions generated by {@link generateActionFunc} for + * transition, state entry and state exit actions, as well as invoking + * "save history" actions produced by the flattening transformation. + */ + def generateAllActionChainFunctions() { + for (t : machine.region.transitions) { + val f = generateActionFunc(t) + actionChainFunctions.put(t, f) + } + } + + /** + * Generates the function declaration for a single action chain. + */ + def generateActionFunc(Transition t) { + val transitionFuncName = GlobalConstants.TRANS_ACTION_FUNC_PREFIX + "__" + t.name + val transitionFunc = clazz.createOwnedOperation(transitionFuncName, null, null) + transitionFunc.createRTMessageParam(GlobalConstants.CHAIN_FUNC_PARAM) + var transitionFuncOB = t.effect + if (transitionFuncOB == null) { + transitionFuncOB = clazz.createOpaqueBehavior(transitionFunc); + } + else { + transitionFuncOB.specification = transitionFunc + clazz.ownedBehaviors.add(transitionFuncOB) + } + + val chainFuncName = GlobalConstants.ACTION_FUNC_PREFIX + "__" + t.name + val chainFunc = clazz.createOwnedOperation(chainFuncName, null, null) + chainFunc.createRTMessageParam(GlobalConstants.CHAIN_FUNC_PARAM) + val chainFuncOB = clazz.createOpaqueBehavior(chainFunc); + + // now examine chain (separate function generateActionInvocation in original code) + // Generates a call to an action, either user action or action generated by + // the transformation. + var code = "" + for (action : t.chain.actions) { + code += call(action.specification, action.callParams) + } + chainFuncOB.set(code) + return chainFuncOB as OpaqueBehavior + } + + // def Enumerator getEnum(CppEnum enum1, String string) { + // throw new UnsupportedOperationException("TODO: auto-generated method stub") + // } + /** + * Generates all functions corresponding to choice points. + */ + def generateAllChoicePointFunctions() { + for (c : machine.region.choicePoints) { + val f = generateChoiceFunc(c) + choicePointFunctions.put(c, f) + } + } + + /** + * Generates the function corresponding to a given choice point. + */ + def generateChoiceFunc(Pseudostate p) { + val funcName = GlobalConstants.CHOICE_FUNC_PREFIX + p.name + val funcDecl = clazz.createOperation(funcName, null) + val param = funcDecl.createRTMessageParam(GlobalConstants.CHOICE_FUNC_PARAM) + val funcDeclOB = clazz.createOpaqueBehavior(funcDecl) + + // if (generateGuard) { [actFunc/](param); [DestStatement] + var code = "" + for (t : p.outgoings) { + code += ''' + if («t.guard.body») { + «call(actionChainFunctions.get(t), param.name)» + // TODO: return instead + «currentStateField.name» = «getDestination(t, false)»; + } + ''' + } + funcDeclOB.set(code) + return funcDeclOB + } + + /** + * Generates all functions corresponding to junction points. + */ + def generateAllJunctionFunctions() { + for (j : machine.region.junctionPoints) { + val f = generateJunctionFunc(j) + junctionPointFunctions.put(j, f) + } + } + + /** + * Generates the function corresponding to a specific junction point. + */ + def generateJunctionFunc( + Pseudostate p + ) { + val funcName = GlobalConstants.JUNCTION_FUNC_PREFIX + p.name + val funcDecl = clazz.createOperation(funcName, null) + val funcDeclOB = clazz.createOpaqueBehavior(funcDecl) + funcDecl.createRTMessageParam(GlobalConstants.JUNC_FUNC_PARAM) + val t = p.outgoings.get(0) // There should be only one. + var code = "" + if (t != null) { + val actFunc = actionChainFunctions.get(t) + code += call(actFunc, GlobalConstants.JUNC_FUNC_PARAM) + } + code += getDestination(t, false) + funcDeclOB.set(code) + funcDeclOB + } + + /** + * Generates all functions corresponding to states. + */ + def generateAllStateFunctions() { + for (s : machine.states) { + val f = generateStateFunc(s) + stateFunctions.put(s, f) + } + } + + /** + * Generates the function corresponding to a given state. + */ + def generateStateFunc(State state) { + val name = GlobalConstants.STATE_FUNC_PREFIX + state.name + val retType = statesDeclaration + val func = clazz.createOperation(name, retType) + val param = func.createRTMessageParam(GlobalConstants.STATE_FUNC_PARAM) + val funcOB = clazz.createOpaqueBehavior(func) + val table = getPortTransitionsTable(state) + + val code = ''' + switch («getPortCond(param)») { + «FOR port : table.keySet» + case «enumeratorFor(port)»: + switch(«getSigCond(param)») { + «FOR t : table.get(port)» + «FOR trigger : t.triggers.filter[it.ports.contains(port)]» + case «enumeratorFor(trigger.event as CallEvent)»: + «IF (t.guard != null)»if (t.guard) { «ENDIF» + «actionChainFunctions.get(t).name»(«param.name»); + return «getDestination(t, false)»; + «IF (t.guard != null)»}«ENDIF» + «ENDFOR» + «ENDFOR» + } + «ENDFOR» + } + ''' + funcOB.set(code) + funcOB + } + + /** + * Builds a table that contains for each port, all the outgoing transitions + * of a given state whose trigger has that port. + * + * @param s a {@link State} + * @return a table T indexed by {@link Port}s such that for each port p, the + * entry T[p] contains all outgoing {@link Transition}s from s + * whose trigger has port p. + */ + private def getPortTransitionsTable(State s) { + val table = newHashMap + for (t : s.outgoings) { + for (trigger : t.triggers) { + for (p : trigger.ports) { + if (!table.containsKey(p)) { + table.put(p, newHashSet) + } + table.get(p).add(t) + } + } + } + return table + } + + /** + * Obtains the function call corresponding to a transition's destination. + * + * @param t - The {@link Transition} + * @param init - Whether we are looking for the destination to be obtained + * in the ized method or in the inject method. + */ + private def getDestination(Transition t, boolean init) { + var String retVal + if (t.target instanceof Pseudostate) { + val ps = t.target as Pseudostate + if (ps.kind == PseudostateKind.CHOICE_LITERAL) { + val func = choicePointFunctions.get(ps) + retVal = func.getName() + "();" + } else if (ps.kind == PseudostateKind.JUNCTION_LITERAL) { + val func = junctionPointFunctions.get(ps) + retVal = func.getName() + "();" + } + } else { + retVal = stateEnumerators.get(t.target).name + } + if (init) { + // currentStateField = << code >> + retVal = '''«currentStateField.name» = «retVal»;''' + } + retVal + } + + /** + * Generates the main 'inject' function that receives and handles events. + */ + def generateInjectFunc() { + injectFunc = clazz.createOperation(GlobalConstants.INJECT_FUNC_NAME, null) + + // injectFunc.setVirtual() + injectFunc.createRTMessageParam(GlobalConstants.INJECT_FUNC_PARAM) + val injectFuncOB = clazz.createOpaqueBehavior(injectFunc) + val code = ''' + switch(stateCond) { + «FOR s : machine.states» + case «enumFor(s)»: + «currentStateField.name» = «call(stateFunctions.get(s), GlobalConstants.INJECT_FUNC_PARAM)» + break; + «ENDFOR» + } + ''' + injectFuncOB.set(code) + injectFunc + } + + + /** + * Build the initialize function which performs the initial transition. + * + *

      This assumes that the top level of the state machine must have an + * initial pseudo-state, and that there is exactly one outgoing transition + * from such initial point. + * + *

      If there is no initial point, the body of the initialize method is + * empty. + */ + def generateInitializeFunc() { + initializeFunc = clazz.createOperation(GlobalConstants.INITIALIZE_FUNC_NAME, null) + + // initializeFunc.setVirtual() + initializeFunc.createRTMessageParam(GlobalConstants.INITIALIZE_FUNC_PARAM) + val initializeFuncOB = clazz.createOpaqueBehavior(initializeFunc) + + var code = "" + if (machine.region.initialState != null) { + val initialTransition = machine.region.initialState.outgoings.get(0); + if (initialTransition != null) { + val actFunc = actionChainFunctions.get(initialTransition) + if (actFunc != null) { + code += call(actFunc, GlobalConstants.INITIALIZE_FUNC_PARAM) + } + } + code += getDestination(initialTransition, true) + initializeFuncOB.set(code) + } + } + + def call(NamedElement fct, String param) ''' + «fct.name»(«param»); + ''' + + def call(NamedElement fct, List params) ''' + «IF params != null» + «fct.name»(«FOR param : params SEPARATOR ', '»«param»«ENDFOR»); + «ELSE» + «fct.name»(); + «ENDIF» + ''' + + /** + * Generates the compilation unit for the state machine (*) + * + *

      Notes: This implementation generates only a list of elements + * to be consumed by the capsule generator which is assumed to be + * responsible for putting together the full compilation unit. + */ + /* + def generateCompilationUnit() { + // already added? + + cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, statesDeclaration); + cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, currentStateField) + cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, historyTableDeclaration) + cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, saveHistoryFunction) + for (action : userActionFunctions.keySet) { + cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, userActionFunctions.get(action)) + } + for (chain : actionChainFunctions.keySet) { + cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, actionChainFunctions.get(chain)) + } + for (junction : junctionPointFunctions.keySet) { + cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, junctionPointFunctions.get(junction)) + } + for (choice : choicePointFunctions.keySet) { + cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, choicePointFunctions.get(choice)) + } + for (state : stateFunctions.keySet) { + cppCapsuleClass.addMember(CppClass.Visibility.PRIVATE, stateFunctions.get(state)) + } + + return generatedModel + } + */ + /** + * Auxiliary methods + */ + private def getStateType() { + statesDeclaration + } + + private def getRTMessageType() { + // TODO: import umlrts instead of declaring it in model + val umlrts = clazz.getModel().getPackagedElement("umlrts") as org.eclipse.uml2.uml.Package + umlrts.getPackagedElement("RTMessage") as org.eclipse.uml2.uml.Type; + } + + private def createRTMessageParam(Operation operation, String paramName) { + val param = operation.createOwnedParameter(paramName, RTMessageType) + if (refStereo == null) { + refStereo = param.getApplicableStereotype("C_Cpp::Ref") + } + if (refStereo != null) { + param.applyStereotype(refStereo) + } + if (constStereo == null) { + constStereo = param.getApplicableStereotype("C_Cpp::Const") + } + if (constStereo != null) { + param.applyStereotype(constStereo) + } + param + } + + // TODO - why not used any more? + private def getRTDataType(Transition t) { + var Type rtdataType = null + val Collection types = newHashSet + for (trigger : t.triggers) { + val evt = trigger.event as CallEvent + val params = evt.operation.ownedParameters + if (! params.empty) { + val first = params.get(0) + types.add(first.type) + } + } + if (types.size == 1) { + val type = types.get(0) + // TODO - was - createType + rtdataType = type + } + rtdataType + } + + private def enumFor(State s) { + stateEnumerators.get(s).label + } + + private def dispatch enumeratorFor(Port port) { + val enumerator = EnumService.literal('PortID', port.name) + enumerator + } + + private def dispatch enumeratorFor(CallEvent ce) { + val operation = ce.operation + val protocolCls = EnumService.literal('ProtocolClass', (operation.getInterface().owner as NamedElement).name); + '''«protocolCls»::signal_«ce.name»''' + } + + /** + * Builds an expression to obtain the port enum id for the switch. + * + *

      It assumes that the message parameter to the inject function is a + * pointer to the RTMessage type, as returned by {@link #getRTMessageType}, + * this is, the signature of the inject function must be: + * + *

      +     * void inject(UMLRTMessage * msg)
      +     * 
      + * + *

      It also assumes that the port id and signal id are accessible from + * this type. Basically the assumption is that the relevant definitions are + * as follows: + * + *

      + *

      +     * 
      +     * class UMLRTMessage : ... {
      +     * public:
      +     *     UMLRTPort * destPort;
      +     *     UMLRTSignal * signal;
      +     * }
      +     *
      +     * struct UMLRTPort {
      +     *     int id;
      +     *     // ...
      +     * }
      +     *
      +     * class UMLRTSignal {
      +     * public:
      +     *     int id;
      +     *     // ...
      +     * }
      +     * 
      +     * 
      + * + *

      ... where the typed UMLRTPortId and + * UMLRTSignalId can be cast to the Port and + * Signal enum types generated in the state machine's class. + * + *

      Given this assumptions, the port condition generated has the form: + * + *

      (Port)(msg->destPort)->id
      + * + *

      and the signal condition is: + * + *

      (ProtocolX::Signal)(msg->signal)->getId()
      + * + *

      where ProtocolX is the name of the port's protocol + */ + private def getPortCond(Parameter param) { + //val messagePortField = UMLRTMessage.destPort() + //val portIdField = UMLRTCommsPort.id() + //'''«param.name».«messagePortField.name»->«portIdField.name»''' + '''TODO''' + } + + private def getSigCond(Parameter param) { + //val messageSignalField = UMLRTMessage.signal() + //val signalIdAccessor = UMLRTSignal.getId() + //'''«param.name»->«messageSignalField.name»->«signalIdAccessor.name»()''' + '''TODO''' + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlattener.xtend b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlattener.xtend new file mode 100644 index 00000000000..002469ae5b0 --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/src/org/eclipse/papyrus/qompass/modellibs/core/xtend/UMLFlattener.xtend @@ -0,0 +1,556 @@ +/******************************************************************************* +* Copyright (c) 2014 Zeligsoft, CEA and others. +* All rights reserved. This program and the accompanying materials +* are made available under the terms of the Eclipse Public License v1.0 +* which accompanies this distribution, and is available at +* http://www.eclipse.org/legal/epl-v10.html +*******************************************************************************/ +package org.eclipse.papyrus.qompass.modellibs.core.xtend + +import org.eclipse.uml2.uml.Behavior +import org.eclipse.uml2.uml.Class +import org.eclipse.uml2.uml.NamedElement +import org.eclipse.uml2.uml.Pseudostate +import org.eclipse.uml2.uml.PseudostateKind +import org.eclipse.uml2.uml.Region +import org.eclipse.uml2.uml.State +import org.eclipse.uml2.uml.StateMachine +import org.eclipse.uml2.uml.Transition +import org.eclipse.uml2.uml.UMLPackage +import org.eclipse.uml2.uml.Vertex + +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.BehaviorUtil.* +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.StateMachineUtil.* +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.UMLChain.chain +import org.eclipse.uml2.uml.OpaqueBehavior + +/** + * This class contains the transformation for flattening UML-RT state machines + * + * It implements the algorithms described in the technical report + * + * E. Posse. "Flattening UML-RT State Machines". + * Technical Report ZTR-2014-EP-001, Version 2, Zeligsoft, Sep 2014. + * + * @author eposse + */ +class UMLFlattener { + + val FRESH_NAME_PREFIX = "p" + val FRESH_ENTRYPOINT_NAME_PREFIX = "entrypoint_" + val FRESH_EXITPOINT_NAME_PREFIX = "exitpoint_" + val FRESH_CHOICEPOINT_NAME_PREFIX = "c" + val FRESH_JUNCTIONPOINT_NAME_PREFIX = "j" + var FRESH_TRANSITION_NAME_PREFIX = "transition_" + + var freshNameCounter = 0 + var freshEntryPointNameCounter = 0 + var freshExitPointNameCounter = 0 + var freshChoicePointNameCounter = 0 + var freshJunctionPointNameCounter = 0 + var freshTransitionNameCounter = 0 + + var Behavior saveHistoryBehavior = null + var Class clazz + + /** + * Flattens a UML-RT state machine, removing composite states, and making + * explicit transitions implied by group transitions, history points and + * initial points. + * + * This is the 'main' method of the transformer. It performs the + * transformation in-place. + * + * @param m a {@link StateMachine} + * @return the flat {@link StateMachine} m with all composite states, group + * transitions, history and initial pseudo-states removed. + */ + def StateMachine transform(StateMachine m) { + var StateMachine intermediateModel + clazz = m.owner as Class + UMLChain.initChains + phase0QualifyNames(m.region, m.name) + phase1(m) + intermediateModel = phase2(m) + return intermediateModel + } + + /** + * Change the names of states and transitions: prefix them with the names + * of the stateMachine and composite states. + */ + protected def void phase0QualifyNames(Region region, String parentName) { + for (Transition transition : region.transitions) { + transition.name = parentName + '_' + transition.name + } + for (Vertex vertex : region.subvertices) { + vertex.name = parentName + '_' + vertex.name + if (vertex instanceof State) { + val State state = vertex as State + for (subRegion : state.regions) { + phase0QualifyNames(subRegion, vertex.name) + } + } + } + } + + + /** + * Makes explicit transitions implied by group transitions, history points + * and initial points. + */ + protected def StateMachine phase1(StateMachine m) { + for (State s : m.states) { + phase1ProcessState(s) + } + return m + } + + def void phase1ProcessState(State state) { + phase1ProcessSimpleState(state) + if (!state.regions.empty) { + phase1ProcessCompositeState(state) + } + } + + /** + * Moves a simple state's entry actions to its incoming transitions and + * the state's exit actions to its outgoing transitions. + * + */ + def void phase1ProcessSimpleState(State state) { + // TODO: should that be done in UML2FlatBody (need chain?) + if (state.entry != null) { + val entryOp = clazz.createOperation(entryFctName(state), null); + state.entry.name = entryFctName(state) + // add specification + state.entry.specification = entryOp; + // clazz.ownedBehaviors.add(state.entry) + for (Transition t : state.incomings) { + t.chain.append(state.entry) + } + } + if (state.exit != null) { + val exitOp = clazz.createOperation(exitFctName(state), null); + state.exit.name = exitFctName(state) + // add specification + state.exit.specification = exitOp; + // clazz.ownedBehaviors.add(state.exit) + for (Transition t : state.allOutgoings) { + t.chain.prepend(state.exit) + } + } + } + + def entryFctName(State state) { + GlobalConstants.ENTRY_ACTION_FUNC_PREFIX + GlobalConstants.FUNC_NAME_QUAL_NAME_SEP + state.name + GlobalConstants.FUNC_NAME_QUAL_NAME_SEP + state.entry.name + } + + def exitFctName(State state) { + GlobalConstants.EXIT_ACTION_FUNC_PREFIX + GlobalConstants.FUNC_NAME_QUAL_NAME_SEP + state.name + GlobalConstants.FUNC_NAME_QUAL_NAME_SEP + state.exit.name + } + + /** + * Creates entry transitions for incoming arrows ending at the composite + * state's boundary or history pseudo-state. Creates exit transitions + * implied by group transitions. + */ + def void phase1ProcessCompositeState(State state) { + + // if (state.substates.empty) { + // replaceBySimpleState(state) + // return + // } + // Deal with incoming transitions + // TODO (ar): such a state can have entry and exit as well, no? + annotateExplicitEntryTransitions(state) + createEntryPoints(state) + var historyChoicePoint = replaceHistoryPoint(state) + removeInitialTransition(state, historyChoicePoint) + + // Deal with outgoing transitions + annotateExplicitExitTransitions(state) + createExitPoints(state) + createExitTransitions(state) + + // Process sub-states + for (State subState : state.subStates) { + phase1ProcessState(subState) + } + } + + /** + * Prepends the state's entry action to each explicit entry transition + * (transition from an entry point to a sub-state). + */ + def annotateExplicitEntryTransitions(State state) { + for (Pseudostate p : state.entryPoints) { + if (!p.outgoings.empty) { + for (Transition t : p.outgoings) { + t.chain.append(state.entry) + } + } + } + } + + /** + * Creates entry points for every direct incoming transition (transition + * ending directly on the state's boundary). + */ + def createEntryPoints(State state) { + for (Transition t : state.incomings) { + val p = state.createConnectionPoint(state.newFreshEntryPointName) + p.kind = PseudostateKind.ENTRY_POINT_LITERAL + t.target = p + } //TODO: maybe remove all directIncomming? + } + + /** + * Replaces the (deep)history pseudo-state with a choice point with transitions + * to each sub-state with conditions checking the value of the history table + * entry for this composite-state. + */ + def Pseudostate replaceHistoryPoint(State state) { + + // transform history state into a choice point + val c = state.region.deepHistory; + + if (c != null) { + // No need to redirect incoming transitions, since we transform the history + // state with a choice point + c.kind = PseudostateKind.CHOICE_LITERAL; + } + else { + return null; + } + + // Create transitions from the choice point to each sub-state with the + // appropriate guard. + for (State subState : state.subStates) { + var Vertex targetVertex + if (subState.regions.size() == 0) { + targetVertex = subState + } + else { + targetVertex = subState.region.deepHistory + if (targetVertex == null) { + targetVertex = subState + } + } + + val newTransition = state.region.createTransition(state.newFreshTransitionName) + newTransition.source = c; + newTransition.target = targetVertex; + val guard = newTransition.createGuard("CheckHistory"); + guard.createOpaqueExpression('''history[«state.name»] == «subState.name»''') + if (state.entry != null) { + newTransition.chain.append(state.entry) + } + } + // If there was an initial pseudo-state, create a transition from the + // choice point to the initial state where the guard will be true if + // the composite state has not been visited before. + val initialState = state.region.initialState + if (initialState != null) { + val initialTransition = initialState.outgoings.get(0) + + val newTransition = state.region.createTransition(state.newFreshTransitionName) + newTransition.source = c; + newTransition.target = initialTransition.target; + val guard = newTransition.createGuard("CheckHistory"); + guard.createOpaqueExpression('''history[«state.name»] == «GlobalConstants.UNVISITED»''') + // TODO: not sure, if semantics is the same. + if (initialTransition.effect != null) { + // caveat: assigining the effect to the new transition will remove it from the original + // (initial will be removed later on => not a problem?) + newTransition.effect = initialTransition.effect; + newTransition.chain.append(newTransition.effect) + } + newTransition.chain.append(state.entry) + } + // If there was no initial pseudo-state, create a 'dummy' simple state + // representing "staying at the boundary", and create a transition from + // the choice point to this dummy state, where the guard is true if + // the state has not been visited before. + else { + // The name should be different name because one of the sub-states + // may have the same name as the composite. + val border = state.region.createState(state.newFreshName); + + val newTransition = state.region.createTransition(state.newFreshTransitionName); + newTransition.source = c; + newTransition.target = border; + val guard = newTransition.createGuard("Check History") + guard.createOpaqueExpression('''history[«state.name»] == «GlobalConstants.UNVISITED»''') + if (state.entry != null) { + newTransition.chain.append(state.entry) + } + } + return c + } + + /** + * Remove the initial pseudo-state and transition and create a transition + * from each entry point which does not have an explicit entry transition + * to a sub-state, to the initial state. + */ + def removeInitialTransition(State state, Pseudostate historyChoicePoint) { + val initialState = state.region.initialState + if (initialState != null) { + val initialTransition = initialState.outgoings.get(0) // There should be exactly one initial transition + for (Pseudostate p : state.entryPoints) { + if (p.outgoings.empty) { + val newTransition = + state.region.createTransition(state.newFreshTransitionName) + newTransition.source = p + newTransition.target = initialTransition.target + newTransition.chain.append(state.entry) + newTransition.chain.append(initialTransition.effect); + } + } + state.region.transitions.remove(initialTransition) + // initialTransition.targetVertex.incomingTransitions.remove(initialTransition) // TODO: this might not be enough if the initial transition ends in a pseudo-state + // state.removeInitial + } + else { + for (Pseudostate p : state.entryPoints) { + if (p.outgoings.empty) { + val newTransition = + state.region.createTransition(state.newFreshTransitionName) + newTransition.setSource(p) + newTransition.setTarget(historyChoicePoint) + newTransition.effect = state.entry; + } + } + } + } + + /** + * Annotate explicit exit transitions (transitions from a sub-state to an + * exit point) with a "history saving action", an action that sets the + * history table entry for the composite state according to the sub-state + * that is exited. + */ + def annotateExplicitExitTransitions(State state) { + for (Pseudostate p : state.exitPoints) { + if (!p.incomings.empty) { + for (Transition t : p.incomings) { + if (saveHistoryBehavior == null) { + createSaveHistoryBehavior + } + // Actions can have specific subclasses in the Zeligsoft model. Here we use a single generic class. + // Therefore we add call information explicitly. + val UMLAction saveHistoryAction = new UMLAction(saveHistoryBehavior) + saveHistoryAction.addParam = state.name + saveHistoryAction.addParam = t.source.name + t.chain.append = saveHistoryAction + if (state.exit != null) { + t.chain.append(state.exit) + } + } + } + } + } + + /** + * Create exit points for each direct outgoing transition (transition leaving + * directly from the composite state's boundary). + */ + def createExitPoints(State state) { + for (Transition t : state.outgoings) { + val p = state.createConnectionPoint(state.newFreshExitPointName); + p.kind = PseudostateKind.EXIT_POINT_LITERAL + t.source = p; + } + } + + def createSaveHistoryBehavior() { + // create an opaque behavior without body. This will be added later in the UMLFlat2Cpp operation + saveHistoryBehavior = clazz.createOwnedBehavior(GlobalConstants.SAVE_HISTORY_FUNC_NAME, + UMLPackage.eINSTANCE.getOpaqueBehavior() + ); + } + + /** + * Create explicit exit transitions implied by group transitions. For each + * group transition creates a transition from every sub-state to the + * group-transitions's source exit point. It annotates these transitions + * with a "history saving action", an action which stores the sub-state + * in the history table entry for this composite state. + */ + def createExitTransitions(State state) { + + // Iterate over exit points, looking for group transitions. + for (Pseudostate p : state.exitPoints) { + + // If the exit point doesn't have incoming transitions then there + // is at least one group transition from it. + if (p.incomings.empty) { + + // Create explicit transitions from every sub-state to this + // exit point... + for (State subState : state.subStates) { + + // ...for each group transition leaving the exit point. + for (Transition t : p.outgoings) { + + if (saveHistoryBehavior == null) { + createSaveHistoryBehavior + } + // Append the history saving action and the state's + // exit action. + val newTransition = state.region.createTransition(state.newFreshTransitionName) + newTransition.source = subState + newTransition.target = p + // make a copy (adding it to triggers list would remove it from original transition). + for (trigger : t.triggers) { + val newTrigger = newTransition.createTrigger(trigger.name) + newTrigger.event = trigger.event + } + // newTransition.triggers.addAll(t.triggers) + newTransition.guard = t.guard + val UMLAction saveHistoryAction = new UMLAction(saveHistoryBehavior) + saveHistoryAction.addParam = state.name + saveHistoryAction.addParam = subState.name + newTransition.chain.append(saveHistoryAction) + newTransition.chain.append(state.exit) + // make a copy of the effect (but: quite bad, since we might create several copies of same effect) + if (t.effect instanceof OpaqueBehavior) { + val newBehavior = newTransition.createOpaqueEffect + newBehavior.name = t.effect.name + newBehavior.set = t.effect.body + } + } + } + + // Remove the trigger and guard from the old group transition, + // but leave the transition. + // TODO: we must replace the direct group transition with an indirect group transition leaving from the exit point + for (Transition t : p.outgoings) { + t.triggers.clear + t.guard = null + t.effect = null + } + } + } + } + + /** + * Flatten composite states. + */ + protected def StateMachine phase2(StateMachine m) { + for (State s : m.states.clone) { + phase2ProcessState(s) + if (!s.subStates.empty) { + m.region.moveContents(s) + // remove regions from composite state + s.regions.clear + } + } + return m + } + + /** + * Removes entry and exit points of a simple state, making all transitions + * to and from it, direct. + */ + def dispatch void phase2ProcessState(State state) { + if (state.regions.empty) { + phase2ProcessSimpleState(state) + } + else { + phase2ProcessComplexState(state) + } + // change name afterwards (avoid that new names are taken into account recursively) + } + + /** + * Removes entry and exit points of a simple state, making all transitions + * to and from it, direct. + */ + def dispatch void phase2ProcessSimpleState(State state) { + for (Transition t : state.indirectIncomings) { + t.target = state // TODO: Potential problem: depending on the set implementation we may be modifying the iterator + } + for (Transition t : state.outgoings) { + t.source = state + } + for (Pseudostate p : state.entryPoints) { + state.connectionPoints.remove(p) + } + for (Pseudostate p : state.exitPoints) { + state.connectionPoints.remove(p) + } + } + + /** + * Replaces all entry and exit points of the composite state with junction + * points, and recursively apply this to sub-states. + */ + def dispatch void phase2ProcessComplexState(State state) { + // Replace connection points with junction points + for (Pseudostate p : state.connectionPoints.clone) { + var j = state.region.createPseudostate(GlobalConstants.JUNCTION_FUNC_PREFIX + p.name) + j.kind = PseudostateKind.JUNCTION_LITERAL + + for (Transition t : p.incomings) { + t.target = j + } + for (Transition t : p.outgoings) { + t.source = j + } + if (p.kind == PseudostateKind.ENTRY_POINT_LITERAL) { + state.connectionPoints.remove(p) + } + else if (p.kind == PseudostateKind.EXIT_POINT_LITERAL) { + state.connectionPoints.remove(p) + } + } + + // Process substates + for (State subState : state.subStates.clone) { + phase2ProcessState(subState) + if (!subState.regions.empty) { + state.region.moveContents(subState) + subState.regions.clear + } + } + } + + /** + * Auxiliary methods + */ + def String getNewFreshName(NamedElement parent) { + freshNameCounter ++ + return parent.namePrefix + FRESH_NAME_PREFIX + freshNameCounter + } + + def String getNewFreshEntryPointName(NamedElement parent) { + freshEntryPointNameCounter ++ + return parent.namePrefix + FRESH_ENTRYPOINT_NAME_PREFIX + freshEntryPointNameCounter + } + + def String getNewFreshExitPointName(NamedElement parent) { + freshExitPointNameCounter ++ + return parent.namePrefix + FRESH_EXITPOINT_NAME_PREFIX + freshExitPointNameCounter + } + + def String getNewFreshChoicePointName(NamedElement parent) { + freshChoicePointNameCounter ++ + return parent.namePrefix + FRESH_CHOICEPOINT_NAME_PREFIX + freshChoicePointNameCounter + } + + def String getNewFreshJunctionPointName(NamedElement parent) { + freshJunctionPointNameCounter ++ + return parent.namePrefix + FRESH_JUNCTIONPOINT_NAME_PREFIX + freshJunctionPointNameCounter + } + + def String getNewFreshTransitionName(NamedElement parent) { + freshTransitionNameCounter ++ + return parent.namePrefix + FRESH_TRANSITION_NAME_PREFIX + freshTransitionNameCounter + } + + def namePrefix(NamedElement ne) { + return ne.name + "_" + } +} diff --git a/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/xtend-gen/.gitignore b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/xtend-gen/.gitignore new file mode 100644 index 00000000000..c96a04f008e --- /dev/null +++ b/extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core/xtend-gen/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracebreakpoints.ui/.project b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracebreakpoints.ui/.project new file mode 100644 index 00000000000..0e99cc63a9e --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracebreakpoints.ui/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.infra.services.tracebreakpoints.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracebreakpoints/.project b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracebreakpoints/.project new file mode 100644 index 00000000000..be89f0cf7f2 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracebreakpoints/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.infra.services.tracebreakpoints + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.classpath b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.classpath new file mode 100644 index 00000000000..098194ca4b7 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.project b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.project new file mode 100644 index 00000000000..07350fea43f --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.infra.services.tracepoints + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f42de363afa --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/META-INF/MANIFEST.MF b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..36e9fe9b7ba --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/META-INF/MANIFEST.MF @@ -0,0 +1,30 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.emf;bundle-version="2.6.0", + org.eclipse.emf.ecore;bundle-version="2.6.1", + org.eclipse.core.resources;bundle-version="3.6.0", + org.apache.commons.lang;bundle-version="2.3.0", + org.eclipse.emf.edit.ui;bundle-version="2.6.0", + org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.0.100", + org.eclipse.papyrus.infra.core;bundle-version="1.2.0", + org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.decoration;bundle-version="1.2.0", + org.eclipse.uml2.uml;bundle-version="4.0.0", + org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", + org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.markerlistener;bundle-version="1.2.0" +Export-Package: org.eclipse.papyrus.infra.services.tracepoints, + org.eclipse.papyrus.infra.services.tracepoints.commands, + org.eclipse.papyrus.infra.services.tracepoints.dialogs, + org.eclipse.papyrus.infra.services.tracepoints.preferences +Bundle-Vendor: %pluginProvider +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.infra.services.tracepoints.Activator +Bundle-SymbolicName: org.eclipse.papyrus.infra.services.tracepoints;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/about.html b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

      About This Content

      + +

      November 14, 2008

      +

      License

      + +

      The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

      + +

      If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

      + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/build.properties b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/build.properties new file mode 100644 index 00000000000..8e1f07ccf86 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/build.properties @@ -0,0 +1,13 @@ +# +#Mon Sep 12 09:30:24 CEST 2011 +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties,\ + plugin.xml,\ + icons/,\ + schema/ +output..=bin/ +src.includes = about.html +source..=src/ +bin..=bin/ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_16x16.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_16x16.gif new file mode 100644 index 00000000000..a831fe72782 Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_16x16.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_9x9.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_9x9.gif new file mode 100644 index 00000000000..3678b09c6bf Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_9x9.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp.gif new file mode 100644 index 00000000000..173661c5df7 Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp_disabled.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp_disabled.gif new file mode 100644 index 00000000000..5ea466bcb2a Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkp_grp_disabled.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_16x16.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_16x16.gif new file mode 100644 index 00000000000..74b26c31a4d Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_16x16.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_9x9.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_9x9.gif new file mode 100644 index 00000000000..d6d8d31b06f Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/brkpd_9x9.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/debug.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/debug.gif new file mode 100644 index 00000000000..d90a29fead8 Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/debug.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/properties.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/properties.gif new file mode 100644 index 00000000000..1dc19a31a0f Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/properties.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_11x12.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_11x12.gif new file mode 100644 index 00000000000..c04edf8e83e Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_11x12.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_16x16.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_16x16.gif new file mode 100644 index 00000000000..29ec606076f Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcp_16x16.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_11x12.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_11x12.gif new file mode 100644 index 00000000000..f3e7b3d6791 Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_11x12.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_16x16.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_16x16.gif new file mode 100644 index 00000000000..76c65b6196f Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/icons/etool16/trcpd_16x16.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.properties b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.properties new file mode 100644 index 00000000000..3cabfa42274 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2010 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus Tracepoint Integration (Incubation) +pluginProvider=Eclipse Modeling Project diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.xml b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.xml new file mode 100644 index 00000000000..80dceda93de --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/plugin.xml @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/pom.xml b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/pom.xml new file mode 100644 index 00000000000..5c3b2b2129a --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.infra.services.tracepoints + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/schema/traceMechanism.exsd b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/schema/traceMechanism.exsd new file mode 100644 index 00000000000..ba8ed1aca6d --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/schema/traceMechanism.exsd @@ -0,0 +1,109 @@ + + + + + + + + + Possibility to add implementations of a trace mechanism + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [Enter the first release in which this extension point appears.] + + + + + + + + + [Enter extension point usage example here.] + + + + + + + + + [Enter API information here.] + + + + + + + + + [Enter information about supplied implementation of this extension point.] + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Activator.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Activator.java new file mode 100644 index 00000000000..8054e407ef6 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Activator.java @@ -0,0 +1,90 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +// TODO: Auto-generated Javadoc +/** + * The activator class controls the plug-in life cycle. + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + /** The Constant PLUGIN_ID. */ + public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.services.tracepoints"; //$NON-NLS-1$ + + // The shared instance + /** The plugin. */ + private static Activator plugin; + + /** The log service. */ + public static LogHelper log; + + /** + * The constructor. + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + /** + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + * + * @param context + * @throws Exception + */ + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + log = new LogHelper(plugin); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + /** + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + * + * @param context + * @throws Exception + */ + + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + log = null; + super.stop(context); + } + + /** + * Returns the shared instance. + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/ITraceMechanism.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/ITraceMechanism.java new file mode 100644 index 00000000000..17ef8dd24f1 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/ITraceMechanism.java @@ -0,0 +1,74 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; + + +/** + * The trace mechanism itself is not specific for specific implementations such + * as instrumenting code generators. Thus, the following interface may be defined + * by extensions that provide an implementation of a trace point. + * The first operation gets a set of available trace implementations that are supplied + * by the extension (in conjunction with other mechanisms). + * This interface is used for mechanisms that have a way of implementing trace point + * + * @author ansgar + * + */ +public interface ITraceMechanism { + + /** + * @param eObj + * the element on which tracing is applied. It is passed, since the + * list of available trace mechanisms may depend on this object + * @return a list of IDs corresponding to available trace mechanisms + */ + EList getTraceMechanismIDs(EObject eObj); + + /** + * Provide a description of the trace mechanism + * + * @param id + * the id of the trace mechanism + * @return its description + */ + String getTraceMechanismDescription(EObject eObj, String id); + + /** + * Apply the tracing. This usually means that an implementation specific + * mechanism will add additional information to the EObject, for instance + * in form of additional markings or stereotypes (there is no assumption + * how this is actually done). The idea is that these markings will be + * evaluated during code generation to produce the right result. + * + * @param id + * the ID of a trace mechanism + * @param element + * the element that should be trace + * @param traceOption + * an encoded trace option. e.g. that only the called operation + * should be trace and not the values of the passed parameters. + */ + boolean applyTraceMechanism(EObject eObj, String id, int traceOption); + + /** + * Configure the trace mechanisms for runtime, in particular evaluate activate/inactive + * tracepoint settings to obtain a suitable runtime configuration. + * + * @return + */ + boolean configureTraceMechanisms(); +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/MarkerUtils.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/MarkerUtils.java new file mode 100644 index 00000000000..a96b35d64f2 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/MarkerUtils.java @@ -0,0 +1,84 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.services.tracepoints; + +import java.util.MissingResourceException; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.papyrus.infra.core.markers.MarkerConstants; + +/** + * Utilities for Markers (TODO: some of these are generic marker services (move to infra core markers) and not specific to tracepoints). + * + * @author ansgar + * + */ +public class MarkerUtils { + + public static URI getURI(IMarker marker) { + String uriOfMarkerStr = marker.getAttribute(MarkerConstants.uri, null); + if (uriOfMarkerStr != null) { + return URI.createURI(uriOfMarkerStr); + } + return null; + } + + /** + * return the EObject of a marker (provided that it is a marker with a URI) + * + * @param marker + * @return the associated EObject + */ + public static EObject getEObjectOfMarker(IMarker marker) { + return getEObjectOfMarker(resourceSet, marker); + } + + /** + * return the EObject of a marker (provided that it is a marker with a URI) + * + * @param pResourceSet + * : the resourceSet into which the model associated with the eObject should + * be loaded + * @param marker + * @return the associated EObject + */ + public static EObject getEObjectOfMarker(ResourceSet pResourceSet, IMarker marker) { + URI uriOfMarker = getURI(marker); + if (uriOfMarker != null) { + try { + pResourceSet.getResource(uriOfMarker.trimFragment(), true); + return pResourceSet.getEObject(uriOfMarker, true); + } catch (MissingResourceException e) { + throw new RuntimeException("MarkerUtils.getEObjectOfMarker: " + e.getMessage()); //$NON-NLS-1$ + } + } + return null; + } + + public static boolean isActive(IMarker marker) { + return marker.getAttribute(TracepointConstants.isActive, false); + } + + /** + * our own copy of resource set + * we do not use the Papyrus resourceSet, since every editor keeps his own copy of the resource set (which is probably + * quite bad) and thus no resourceSet would be available, if Papyrus is not open. + */ + public static ResourceSet resourceSet = new ResourceSetImpl(); +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Messages.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Messages.java new file mode 100644 index 00000000000..3db820e80cb --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Messages.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.infra.services.tracepoints; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.infra.services.tracepoints.messages"; //$NON-NLS-1$ + + public static String TraceActionSelection_ClassOptions; + public static String TraceActionSelection_ImplementationOptions; + public static String TraceActionSelection_NoPluginsProvideTraceExt; + public static String TraceActionSelection_NotAvail; + public static String TraceActionSelection_OperationOptions; + public static String TraceActionSelection_SelectTraceAction; + public static String TraceActionSelection_StateOptions; + + public static String TPPreferencePage_ClassOptions; + public static String TPPreferencePage_OperationOptions; + public static String TPPreferencePage_StateOptions; + public static String TPPreferencePage_TMforOperations; + public static String TPPreferencePage_TMforPorts; + public static String TPPreferencePage_TMforStateMachines; + public static String TPPreferencePage_TraceOptions; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceActions.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceActions.java new file mode 100644 index 00000000000..9935817b45b --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceActions.java @@ -0,0 +1,206 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.infra.services.tracepoints.preferences.TPPreferenceConstants; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.State; + +/** + * Set of enumerations that indicates what we want to trace. + * + * @author ansgar + * + */ +public class TraceActions { + + public enum TraceScope { + clazz, + operation, + state, + activity, + }; + + /** + * Options for tracing a class. Note that some options need additional information, e.g. "all operations" + * needs additional information how operations are traced + */ + public enum TAClass { + Creation, + Destruction, + AllOperations, + AllPorts, + AllStates + // +(?) all properties/all operations + // +(all ports?) + // +all state changes? (hierarchical propagation?) + + }; + + /** + * Different ways to trace operations: put only the call itself or the values of the parameters into + * a trace event. + */ + public enum TAOperation { + OnlyCall, + ParameterValues, // here exclusive (parameter values and OnlyCall may not be selected at the same time) + }; + + /** + * Not used for the moment + */ + public enum TAAttribute { + PropertyRead, + PropertyWrite; // write old and new value + }; + + /** + * Options to trace state + */ + public enum TAState { + StateEnter, // add incoming transition to trace? + StateLeave, // add outgoing transition to trace? + Transition // nothing (?) (triggers are known? - no, could be one out of many triggers) + }; + + /** + * Not used for the moment + */ + public enum TAActivity { + activity // (i.e. call operation action) explicit choice of (named attribute?) + }; + + public static String[][] getStringFields(Enum[] enumValues) { + int i = 0; + String[][] taOptions = new String[enumValues.length][2]; + for (Enum tLiteral : enumValues) { + taOptions[i][1] = tLiteral.name(); + taOptions[i][0] = tLiteral.name(); + i++; + } + return taOptions; + } + + public enum TraceFeature { + Class, + Port, + State, + Operation + }; + + /** + * Obtain the definition of a trace option in case of traces on classes + * + * @param traceAction + * @param subFeature + * the trace feature which we want to obtain, i.e. class, state or operation + * from a composite action string in case of class trace points + * @return + */ + public static String getOptions(String traceAction, TraceFeature subFeature) { + String prefix = getStringPrefix(subFeature); + int pos = traceAction.indexOf(prefix); + if (pos == -1) { + return null; + } else { + // comma is used as separation character. + pos += prefix.length(); + int endPos = traceAction.indexOf(',', pos); + if (endPos == -1) { + return traceAction.substring(pos); + } + return traceAction.substring(pos, endPos); + } + } + + /** + * Get the prefix that is used in each case of a class action to distinguish class, state and operation actions. + * + * @param feature + * The trace feature for which we set an action + * @return + */ + public static String getStringPrefix(TraceFeature feature) { + if (feature == TraceFeature.Class) { + return "C:"; //$NON-NLS-1$ + } + if (feature == TraceFeature.Port) { + return "P:"; //$NON-NLS-1$ + } + else if (feature == TraceFeature.State) { + return "S:"; //$NON-NLS-1$ + } + else if (feature == TraceFeature.Operation) { + return "O:"; //$NON-NLS-1$ + } + return null; + } + + /** + * Initialize an action string that will be stored in the trace marker from the configured actions + * in the preferences. In case of a class, the value is a combination of different options + * that are prefixed to enable a unique classification + * + * @param feature + * The trace feature for which we set an action + * @return + */ + public static String actionFromPreferences(TraceFeature feature) { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + if (feature == TraceFeature.Class) { + return compositeClassOption(store.getInt(TPPreferenceConstants.P_TRACE_OPTION_CLASS), + store.getInt(TPPreferenceConstants.P_TRACE_OPTION_STATE), + store.getInt(TPPreferenceConstants.P_TRACE_OPTION_OP)); + } + else if (feature == TraceFeature.State) { + return store.getString(TPPreferenceConstants.P_TRACE_OPTION_STATE); + } + else if (feature == TraceFeature.Operation) { + return store.getString(TPPreferenceConstants.P_TRACE_OPTION_OP); + } + return ""; //$NON-NLS-1$ + } + + public static String compositeClassOption(int classOption, int stateOption, int operationOption) { + return getStringPrefix(TraceFeature.Class) + classOption + "," + //$NON-NLS-1$ + getStringPrefix(TraceFeature.State) + stateOption + "," + //$NON-NLS-1$ + getStringPrefix(TraceFeature.Operation) + operationOption; + } + + /** + * Convenience function, return the action defined in the preferences in function of the model element + * + * @param element + * @return + */ + public static String actionFromPreferences(EObject element) { + return actionFromPreferences(getTraceFeature(element)); + } + + + public static TraceFeature getTraceFeature(EObject element) { + if (element instanceof State) { + return TraceFeature.State; + } + else if (element instanceof Operation) { + return TraceFeature.Operation; + } + else if (element instanceof org.eclipse.uml2.uml.Class) { + return TraceFeature.Class; + } + return null; + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceFunctions.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceFunctions.java new file mode 100644 index 00000000000..a0a62b30f80 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceFunctions.java @@ -0,0 +1,125 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.emf.common.util.EList; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.papyrus.infra.services.decoration.IDecorationSpecificFunctions; +import org.eclipse.papyrus.infra.services.decoration.util.Decoration.PreferedPosition; +import org.eclipse.papyrus.infra.services.decoration.util.IPapyrusDecoration; +import org.eclipse.papyrus.infra.services.markerlistener.IPapyrusMarker; + + +public class TraceFunctions implements IDecorationSpecificFunctions { + + public static final String activeBreakpoint16 = "icons/etool16/brkp_16x16.gif"; //$NON-NLS-1$ + + public static final String inActiveBreakpoint16 = "icons/etool16/brkpd_16x16.gif"; //$NON-NLS-1$ + + public static final String activeTracepoint16 = "icons/etool16/trcp_16x16.gif"; //$NON-NLS-1$ + + public static final String inActiveTracepoint16 = "icons/etool16/trcpd_16x16.gif"; //$NON-NLS-1$ + + public static final String activeBreakpoint9 = "icons/etool16/brkp_9x9.gif"; //$NON-NLS-1$ + + public static final String inActiveBreakpoint9 = "icons/etool16/brkpd_9x9.gif"; //$NON-NLS-1$ + + public static final String activeTracepoint11 = "icons/etool16/trcp_11x12.gif"; //$NON-NLS-1$ + + public static final String inActiveTracepoint11 = "icons/etool16/trcp_11x12.gif"; //$NON-NLS-1$ + + /** + * Return the image descriptor associated with a trace or breakpoint marker + */ + @Override + public ImageDescriptor getImageDescriptorForGE(IPapyrusMarker marker) { + + + org.eclipse.papyrus.infra.widgets.Activator widgetsActivator = + org.eclipse.papyrus.infra.widgets.Activator.getDefault(); + ImageDescriptor overlay = null; + boolean isActive = marker.getAttribute(TracepointConstants.isActive, false); + boolean isTracepoint = marker.getAttribute(TracepointConstants.isTracepoint, false); + if (isTracepoint) { + overlay = isActive ? + widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, activeTracepoint16) : + widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, inActiveTracepoint16); + } + else { + overlay = isActive ? + widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, activeBreakpoint16) : + widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, inActiveBreakpoint16); + } + + return overlay; + } + + /** + * Return the image descriptor associated with a trace or breakpoint marker + */ + @Override + public ImageDescriptor getImageDescriptorForME(IPapyrusMarker marker) { + org.eclipse.papyrus.infra.widgets.Activator widgetsActivator = + org.eclipse.papyrus.infra.widgets.Activator.getDefault(); + ImageDescriptor overlay = null; + boolean isActive = marker.getAttribute(TracepointConstants.isActive, false); + boolean isTracepoint = marker.getAttribute(TracepointConstants.isTracepoint, false); + if (isTracepoint) { + overlay = isActive ? + widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, activeTracepoint11) : + widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, inActiveTracepoint11); + } + else { + overlay = isActive ? + widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, activeBreakpoint9) : + widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, inActiveBreakpoint9); + } + + return overlay; + } + + @Override + public PreferedPosition getPreferedPosition(IPapyrusMarker marker) { + return PreferedPosition.SOUTH_EAST; + } + + @Override + public String getMessage(IPapyrusMarker marker) { + boolean isActive = marker.getAttribute(TracepointConstants.isActive, false); + boolean isTracepoint = marker.getAttribute(TracepointConstants.isTracepoint, false); + return (isActive ? "active" : "inactive") + " " + //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ + (isTracepoint ? "trace point" : "break point"); //$NON-NLS-1$//$NON-NLS-2$ + } + + public int getPriority(IMarker marker) { + return 0; // all markers have same priority (and we should not have multiple markers on the same model element). + } + + @Override + public IPapyrusDecoration markerPropagation(EList childDecorations) { + return null; + } + + @Override + public MarkChildren supportsMarkerPropagation() { + return MarkChildren.NO; + } + + @Override + public int getPriority(IPapyrusMarker marker) { + // TODO Auto-generated method stub + return 0; + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceMechanism.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceMechanism.java new file mode 100644 index 00000000000..3d64bbdc4bb --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceMechanism.java @@ -0,0 +1,88 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TraceFeature; +import org.eclipse.papyrus.infra.services.tracepoints.preferences.TPPreferenceConstants; + + +/** + * Support for multiple trace mechanisms via the Eclipse extension mechanism + */ + +public class TraceMechanism { + + public static final String ITRACE_MECHANISM_ID = Activator.PLUGIN_ID + ".traceMechanism"; //$NON-NLS-1$ + + public static EList getTraceMechanisms() + { + EList mechanisms = new BasicEList(); + IExtensionRegistry reg = Platform.getExtensionRegistry(); + IConfigurationElement[] configElements = reg.getConfigurationElementsFor(ITRACE_MECHANISM_ID); + for (IConfigurationElement configElement : configElements) { + try { + // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) + final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ + if (obj instanceof ITraceMechanism) { + mechanisms.add((ITraceMechanism) obj); + } + } catch (CoreException exception) { + exception.printStackTrace(); + } + } + return mechanisms; + } + + /** + * get the ID of the default realization mechanism. In case of classes, need to store multiple mechanisms (how to trace states, how to trace + * operations) + * + * @return + */ + public static String getMechanismFromPreferences(TraceFeature feature) { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + if (store != null) { + if (feature == TraceFeature.Class) { + return TraceActions.getStringPrefix(TraceFeature.Port) + store.getInt(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_PORT) + "," + //$NON-NLS-1$ + TraceActions.getStringPrefix(TraceFeature.State) + store.getInt(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM) + "," + //$NON-NLS-1$ + TraceActions.getStringPrefix(TraceFeature.Operation) + store.getInt(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP); + } + else if (feature == TraceFeature.State) { + return store.getString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM); + } + else if (feature == TraceFeature.Operation) { + return store.getString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP); + } + } + return ""; //$NON-NLS-1$ + } + + /** + * Convenience function. Return defaultTraceMechanisms in function of the element being traced. + * + * @param element + * @return + */ + public static String getDefaultMechanism(EObject element) { + return getMechanismFromPreferences(TraceActions.getTraceFeature(element)); + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceState.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceState.java new file mode 100644 index 00000000000..f6e98d06d71 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceState.java @@ -0,0 +1,20 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints; + + +public class TraceState { + + public static boolean skipAllTracepoints = false; +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TracepointConstants.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TracepointConstants.java new file mode 100644 index 00000000000..2246147467b --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TracepointConstants.java @@ -0,0 +1,35 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints; + + + +public class TracepointConstants { + + /** + * The id of the marker used for tracepoints and breakpoints + */ + public static final String tpOrbpMarker = "org.eclipse.papyrus.tporbpmarker"; //$NON-NLS-1$ + + public static final String isActive = "isActive"; //$NON-NLS-1$ + + /** + * if true, marker is a tracepoint. Otherwise it is a breakpoint. + */ + public static final String isTracepoint = "isTracepoint"; //$NON-NLS-1$ + + public static final String traceAction = "traceAction"; //$NON-NLS-1$ + + public static final String traceMechanism = "traceMechanism"; //$NON-NLS-1$ +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/AbstractTracepointCommand.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/AbstractTracepointCommand.java new file mode 100644 index 00000000000..aaece766bed --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/AbstractTracepointCommand.java @@ -0,0 +1,167 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermarcher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints.commands; + +import java.util.Collections; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; +import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.infra.core.markers.MarkerConstants; +import org.eclipse.papyrus.infra.services.tracepoints.Activator; +import org.eclipse.papyrus.infra.services.tracepoints.ITraceMechanism; +import org.eclipse.papyrus.infra.services.tracepoints.TraceMechanism; +import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; +import org.eclipse.papyrus.infra.services.tracepoints.preferences.TPPreferenceConstants; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.State; + +/** + * Action used for pasting either a model element or a shape (i.e. the model element represented + * by the shape). Delegates to PasteShapeOrElementCommand + * + * @author Ansgar Radermacher (CEA LIST) + */ +abstract public class AbstractTracepointCommand extends AbstractTransactionalCommand { + + protected TransactionalEditingDomain domain; + + protected EObject selectedElement; + + /** + * Creates a new ImportLibraryFromRepositoryCommand + * + * @param editingDomain + * editing domain that manages the changed objects + * @param runnable + * process that executes the modifications + * @param label + * the label of the command + * @param description + * description of the command + */ + + public AbstractTracepointCommand(String label, TransactionalEditingDomain domain, EObject selectedElement) { + super(domain, label, Collections.EMPTY_LIST); + this.domain = domain; + this.selectedElement = selectedElement; + } + + protected void updateResourceAndURI() { + resource = selectedElement.eResource(); + uri = resource.getURI() + "#" + resource.getURIFragment(selectedElement); //$NON-NLS-1$ + iresource = WorkspaceSynchronizer.getFile(selectedElement.eResource()); + } + + protected IMarker findMarker(String type) { + + if (iresource != null) { + try { + for (IMarker marker : iresource.findMarkers(type, false, IResource.DEPTH_INFINITE)) { + String markerURI = marker.getAttribute(MarkerConstants.uri, ""); //$NON-NLS-1$ + if ((markerURI != null) && markerURI.equals(uri)) { + return marker; + } + } + } catch (CoreException ce) { + } + } + return null; + } + + protected IMarker toggleMarker() { + try { + if (iresource != null) { + IMarker marker = findMarker(TracepointConstants.tpOrbpMarker); + if (marker == null) { // marker does not exist => create + marker = iresource.createMarker(TracepointConstants.tpOrbpMarker); + marker.setAttribute(MarkerConstants.uri, uri); + marker.setAttribute(TracepointConstants.isActive, true); + return marker; + } + else { + // marker exists => delete + marker.delete(); + } + } + } catch (CoreException ce) { + } + return null; + } + + protected void toggleMarkerActivation() { + try { + if (iresource != null) { + IMarker marker = findMarker(TracepointConstants.tpOrbpMarker); + if (marker == null) { // marker does not exist => create + marker = iresource.createMarker(TracepointConstants.tpOrbpMarker); + marker.setAttribute(MarkerConstants.uri, uri); + marker.setAttribute(TracepointConstants.isActive, true); + + // apply trace mechanism according to default in preferences + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + String id = null; + if (selectedElement instanceof Operation) { + id = store.getDefaultString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP); + } + else if (selectedElement instanceof Port) { + id = store.getDefaultString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_PORT); + } + else if (selectedElement instanceof State) { + id = store.getDefaultString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM); + } + if (id != null) { + EList mechanisms = TraceMechanism.getTraceMechanisms(); + for (ITraceMechanism mechanism : mechanisms) { + for (String providedID : mechanism.getTraceMechanismIDs(selectedElement)) { + if (id.equals(providedID)) { + mechanism.applyTraceMechanism(selectedElement, id, 0); + } + } + } + } + } + else { + // marker exists => change activation status + boolean isSet = marker.getAttribute(TracepointConstants.isActive, false); + marker.setAttribute(TracepointConstants.isActive, !isSet); + } + } + } catch (CoreException ce) { + throw new RuntimeException(ce); + } + } + + /** + * {@inheritDoc} + */ + @Override + public boolean canExecute() { + return (selectedElement != null); + } + + protected Resource resource; + + protected IResource iresource; + + protected String uri; +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointActivationCommand.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointActivationCommand.java new file mode 100644 index 00000000000..5fc0cce53ae --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointActivationCommand.java @@ -0,0 +1,40 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.services.tracepoints.commands; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; + + +public class ToggleBreakpointActivationCommand extends AbstractTracepointCommand { + + public ToggleBreakpointActivationCommand(EObject selectedElement) { + super("Toggle Breakpoint activation", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ + } + + /** + * {@inheritDoc} + */ + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + updateResourceAndURI(); + toggleMarkerActivation(); + return null; + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointCommand.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointCommand.java new file mode 100644 index 00000000000..f5d0b1df3aa --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointCommand.java @@ -0,0 +1,41 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.services.tracepoints.commands; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; + + +public class ToggleBreakpointCommand extends AbstractTracepointCommand { + + public ToggleBreakpointCommand(EObject selectedElement) { + super("Toggle Breakpoint", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ + } + + /** + * {@inheritDoc} + */ + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException + { + updateResourceAndURI(); + toggleMarker(); + return null; + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointActivationCommand.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointActivationCommand.java new file mode 100644 index 00000000000..60d3fc81eb4 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointActivationCommand.java @@ -0,0 +1,41 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.services.tracepoints.commands; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; + + +public class ToggleTracepointActivationCommand extends AbstractTracepointCommand { + + public ToggleTracepointActivationCommand(EObject selectedElement) { + super("Toggle tracepoint activation", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ + } + + /** + * {@inheritDoc} + */ + @Override + public CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + + updateResourceAndURI(); + toggleMarkerActivation(); + return null; + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointCommand.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointCommand.java new file mode 100644 index 00000000000..f1353a264e0 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointCommand.java @@ -0,0 +1,54 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints.commands; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.papyrus.infra.services.tracepoints.TraceActions; +import org.eclipse.papyrus.infra.services.tracepoints.TraceMechanism; +import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; + + +public class ToggleTracepointCommand extends AbstractTracepointCommand { + + public ToggleTracepointCommand(EObject selectedElement) { + super("Toggle tracepoint", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ + } + + /** + * {@inheritDoc} + */ + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { + updateResourceAndURI(); + try { + IMarker marker = toggleMarker(); + if (marker != null) { + marker.setAttribute(TracepointConstants.isTracepoint, true); + // set default options from preferences + marker.setAttribute(TracepointConstants.traceAction, TraceActions.actionFromPreferences(selectedElement)); + marker.setAttribute(TracepointConstants.traceMechanism, TraceMechanism.getDefaultMechanism(selectedElement)); + } + } catch (CoreException e) { + + } + return null; + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java new file mode 100644 index 00000000000..c61c0834ce1 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java @@ -0,0 +1,82 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.services.tracepoints.commands; + +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gmf.runtime.common.core.command.CommandResult; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; +import org.eclipse.papyrus.infra.services.tracepoints.dialogs.TraceActionSelection; +import org.eclipse.swt.widgets.Display; +import org.eclipse.uml2.uml.Element; + + +public class TracepointPropertiesCommand extends AbstractTracepointCommand { + + public TracepointPropertiesCommand(EObject selectedElement) { + super("Tracepoint properties", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ + } + + /** + * {@inheritDoc} + */ + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException + { + updateResourceAndURI(); + selectTraceActions(); + return null; + } + + protected void selectTraceActions() { + IMarker marker = findMarker(TracepointConstants.tpOrbpMarker); + if (marker != null) { + // should normally always hold, since this is checked in canExecute + TraceActionSelection tad = new TraceActionSelection(Display.getDefault().getActiveShell(), marker, (Element) selectedElement); + tad.open(); + if (tad.getReturnCode() == IDialogConstants.OK_ID) { + Object[] result = tad.getResult(); + String traceAction = (String) result[0]; + String traceMechanism = (String) result[1]; + try { + marker.setAttribute(TracepointConstants.traceAction, traceAction); + marker.setAttribute(TracepointConstants.traceMechanism, traceMechanism); + } catch (CoreException e) { + } + } + } + } + + /** + * {@inheritDoc} + */ + @Override + public boolean canExecute() { + if (selectedElement != null) { + updateResourceAndURI(); + IMarker marker = findMarker(TracepointConstants.tpOrbpMarker); + if (marker != null) { + return marker.getAttribute(TracepointConstants.isTracepoint, false); + } + } + return false; + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/dialogs/TraceActionSelection.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/dialogs/TraceActionSelection.java new file mode 100644 index 00000000000..ce47f430c72 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/dialogs/TraceActionSelection.java @@ -0,0 +1,304 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.services.tracepoints.dialogs; + +import java.util.Arrays; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.jface.viewers.CheckStateChangedEvent; +import org.eclipse.jface.viewers.CheckboxTableViewer; +import org.eclipse.jface.viewers.ICheckStateListener; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.papyrus.infra.services.tracepoints.ITraceMechanism; +import org.eclipse.papyrus.infra.services.tracepoints.Messages; +import org.eclipse.papyrus.infra.services.tracepoints.TraceActions; +import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAClass; +import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAOperation; +import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAState; +import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TraceFeature; +import org.eclipse.papyrus.infra.services.tracepoints.TraceMechanism; +import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; +import org.eclipse.papyrus.infra.services.tracepoints.preferences.BinaryEncodedMChoiceFieldEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; +import org.eclipse.swt.widgets.TreeItem; +import org.eclipse.ui.dialogs.SelectionStatusDialog; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.State; + +public class TraceActionSelection extends SelectionStatusDialog { + + protected CheckboxTableViewer fTraceImplementations; + + protected Text fDescription; + + IMarker m_marker; + + BinaryEncodedMChoiceFieldEditor classOptions; + + BinaryEncodedMChoiceFieldEditor operationOptions; + + BinaryEncodedMChoiceFieldEditor stateOptions; + + /** + * The model element that has a trace marker + */ + private Element m_me; + + public TraceActionSelection(Shell parent, IMarker marker, Element me) { + super(parent); + m_me = me; + m_marker = marker; + // int traceAction = marker.getAttribute(TracepointConstants.traceAction, 0); + } + + + /** + * @see SelectionStatusDialog#computeResult() + * need to return two values: trace action & mechanism + */ + @Override + protected void computeResult() { + // nothing to do + String traceActionValue = null; + if (m_me instanceof State) { + traceActionValue = stateOptions.getResult(); + } + else if (m_me instanceof Class) { + traceActionValue = TraceActions.compositeClassOption( + classOptions.getIntResult(), + stateOptions.getIntResult(), + operationOptions.getIntResult()); + } + else if (m_me instanceof State) { + traceActionValue = stateOptions.getResult(); + } + else if (m_me instanceof Operation) { + traceActionValue = operationOptions.getResult(); + } + String traceMechanism = ""; //$NON-NLS-1$ + for (Object tableElement : fTraceImplementations.getCheckedElements()) { + traceMechanism = (String) tableElement; + } + ; + + Object[] result = new Object[] { + traceActionValue, + traceMechanism + }; + setResult(Arrays.asList(result)); + } + + class EnumLabelProvider extends LabelProvider implements ITableLabelProvider { + + @Override + public String getColumnText(Object obj, int index) { + if (obj instanceof Enum) { + return ((Enum) obj).name(); + } + return obj.toString(); + } + + @Override + public Image getColumnImage(Object obj, int index) { + return null; + } + } + + class TraceMechanismsCP implements IStructuredContentProvider { + + @Override + public void inputChanged(Viewer v, Object oldInput, Object newInput) { + } + + @Override + public void dispose() { + } + + @Override + public Object[] getElements(Object parent) { + Object items[] = null; + // + // Implementations of a tracing mechanism are depending on the injection mechanism and (likely) on the + // programming language. Therefore, they are not part of this plugin shipped with Papyrus, but use an + // extension mechanism. + + EList mechanisms = TraceMechanism.getTraceMechanisms(); + if (mechanisms.size() == 0) { + items = new String[] { Messages.TraceActionSelection_NoPluginsProvideTraceExt }; + } + else { + EList idList = new BasicEList(); + for (ITraceMechanism mechanism : mechanisms) { + for (String id : mechanism.getTraceMechanismIDs(m_me)) { + idList.add(id); + } + } + items = idList.toArray(new String[0]); + } + return items; + } + } + + @Override + public Control createDialogArea(Composite parent) { + Composite contents = (Composite) super.createDialogArea(parent); + + Label label = new Label(contents, SWT.NONE); + label.setText(Messages.TraceActionSelection_SelectTraceAction); + + // need context dependent dialogs on options + // we may need more than one options (e.g. AllOperations + OperationsWithParameters + (begin/end or both?)) + // clean way: accumulate all options, distribute them automatically accordingly. Better (even if less efficient, if strings) + + String[][] taClassOptions = TraceActions.getStringFields(TAClass.values()); + String[][] taStateOptions = TraceActions.getStringFields(TAState.values()); + String[][] taOperationOptions = TraceActions.getStringFields(TAOperation.values()); + String actionString = m_marker.getAttribute(TracepointConstants.traceAction, ""); //$NON-NLS-1$ + String mechanismID = m_marker.getAttribute(TracepointConstants.traceMechanism, ""); //$NON-NLS-1$ + + if (m_me instanceof State) { + stateOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_StateOptions, 3, taStateOptions, contents, true); + stateOptions.setupViaString(actionString); + } + else if (m_me instanceof Class) { + classOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_ClassOptions, 3, taClassOptions, contents, true); + stateOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_StateOptions, 3, taStateOptions, contents, true); + operationOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_OperationOptions, 3, taOperationOptions, contents, true); + classOptions.setupViaString(TraceActions.getOptions(actionString, TraceFeature.Class)); + stateOptions.setupViaString(TraceActions.getOptions(actionString, TraceFeature.State)); + operationOptions.setupViaString(TraceActions.getOptions(actionString, TraceFeature.Operation)); + } + else if (m_me instanceof Operation) { + operationOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_OperationOptions, 3, taOperationOptions, contents, true); + operationOptions.setupViaString(actionString); + } + + Group implementationGroup = new Group(parent, SWT.NONE); + implementationGroup.setText(Messages.TraceActionSelection_ImplementationOptions); + + // need additional item how the trace mechanism should be realized, i.e. available tracing mechanisms + fTraceImplementations = CheckboxTableViewer.newCheckList(implementationGroup, SWT.H_SCROLL | SWT.V_SCROLL); + + fTraceImplementations.setContentProvider(new TraceMechanismsCP()); + fTraceImplementations.setInput(this); + fTraceImplementations.setChecked(mechanismID, true); // TODO: likely not to work + + fTraceImplementations.addCheckStateListener(new ICheckStateListener() { + + @Override + public void checkStateChanged(CheckStateChangedEvent event) { + Object element = event.getElement(); + boolean isChecked = event.getChecked(); + // assure radio button functionality + if (isChecked) { + for (Object checkedElement : fTraceImplementations.getCheckedElements()) { + if (checkedElement != element) { + fTraceImplementations.setChecked(checkedElement, false); + } + } + } + } + }); + + fTraceImplementations.addSelectionChangedListener(new ISelectionChangedListener() { + + @Override + public void selectionChanged(SelectionChangedEvent event) { + ISelection selection = event.getSelection(); + if (selection instanceof IStructuredSelection) { + Object first = ((IStructuredSelection) selection).getFirstElement(); + if (first instanceof String) { + EList mechanisms = TraceMechanism.getTraceMechanisms(); + boolean noDesc = true; + for (ITraceMechanism mechanism : mechanisms) { + String description = mechanism.getTraceMechanismDescription(m_me, (String) first); + if (description != null) { + fDescription.setText(description); + noDesc = false; + break; + } + } + if (noDesc) { + fDescription.setText(Messages.TraceActionSelection_NotAvail); + } + } + } + } + }); + + fDescription = new Text(implementationGroup, SWT.WRAP | SWT.V_SCROLL | SWT.READ_ONLY); + + GridData span = new GridData(); + span.horizontalAlignment = GridData.FILL; + span.grabExcessHorizontalSpace = true; + span.grabExcessVerticalSpace = true; + span.verticalAlignment = GridData.FILL; + span.heightHint = 250; + + // fTraceActions.getTable().setLayoutData(span); + implementationGroup.setLayout(new GridLayout()); + implementationGroup.setLayoutData(span); + + GridData span2 = new GridData(); + span2.horizontalAlignment = GridData.FILL; + span2.grabExcessHorizontalSpace = true; + span2.grabExcessVerticalSpace = true; + span2.verticalAlignment = GridData.FILL; + span2.heightHint = 80; + fDescription.setLayoutData(span2); + fTraceImplementations.getTable().setLayoutData(span2); + + // ruleGroup.setLayout(new RowLayout (SWT.VERTICAL)); + parent.setLayout(new GridLayout(1, false)); + // parent.setLayoutData(groupGridData); + return contents; + } + + // obtain name and explicit/implicit node Allocation + protected void setTextFromData(TreeItem ti) { + Object data = ti.getData(); + if (data instanceof InstanceSpecification) { + // ti.setText(new String[]{ name, nodeName, "[" + list + "]" }); + } + } + + protected void refreshTree(TreeItem ti) { + setTextFromData(ti); + for (TreeItem subItem : ti.getItems()) { + refreshTree(subItem); + } + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/AbstractCommandHandler.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/AbstractCommandHandler.java new file mode 100644 index 00000000000..5f4c6281690 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/AbstractCommandHandler.java @@ -0,0 +1,166 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints.handler; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.emf.utils.BusinessModelResolver; +import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForHandlers; +import org.eclipse.papyrus.infra.services.tracepoints.Activator; +import org.eclipse.ui.PlatformUI; + +/** + *
      + *
      + * This abstract command handler manages:
      + * - current selection in order to build a list of the selected {@link EObject}
      + * - execute the command (returned by children) in Papyrus {@link TransactionalEditingDomain}
      + * - calculate the command enablement and visibility regarding the command executability
      + * (the command is now shown in menu if not executable).
      + *
      + * 
      + */ +public abstract class AbstractCommandHandler extends AbstractHandler { + + /** + *
      +	 *
      +	 * Returns the command to execute (to be implemented
      +	 * in children implementing this class)
      +	 *
      +	 * @return the command to execute
      +	 *
      +	 * 
      + */ + protected abstract Command getCommand(); + + /** + *
      +	 * Get the selected element, the first selected element if several are selected or null
      +	 * if no selection or the selection is not an {@link EObject}.
      +	 *
      +	 * @return selected {@link EObject} or null
      +	 * 
      + * + */ + protected EObject getSelectedElement() { + EObject eObject = null; + Object selection = null; + + // Get current selection + selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(); + + // Get first element if the selection is an IStructuredSelection + if (selection instanceof IStructuredSelection) { + IStructuredSelection structuredSelection = (IStructuredSelection) selection; + selection = structuredSelection.getFirstElement(); + } + + // Treat non-null selected object (try to adapt and return EObject) + if (selection != null) { + Object businessObject = BusinessModelResolver.getInstance().getBusinessModel(selection); + if (businessObject instanceof EObject) { + eObject = (EObject) businessObject; + } + } + return eObject; + } + + /** + *
      +	 * Parse current selection and extract the list of {@link EObject} from
      +	 * this selection.
      +	 *
      +	 * This also tries to adapt selected element into {@link EObject}
      +	 * (for example to get the {@link EObject} from a selection in the ModelExplorer).
      +	 *
      +	 * @return a list of currently selected {@link EObject}
      +	 * 
      + * + */ + protected List getSelectedElements() { + + List selectedEObjects = new ArrayList(); + + // Parse current selection + ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(); + if (selection instanceof IStructuredSelection) { + IStructuredSelection structuredSelection = (IStructuredSelection) selection; + for (Object current : structuredSelection.toArray()) { + // Adapt current selection to EObject + if (current instanceof IAdaptable) { + selectedEObjects.add((EObject) ((IAdaptable) current).getAdapter(EObject.class)); + } + } + } else { // Not a IStructuredSelection + if (selection != null) { + // Adapt current selection to EObject + if (selection instanceof IAdaptable) { + selectedEObjects.add((EObject) ((IAdaptable) selection).getAdapter(EObject.class)); + } + } + } + + return selectedEObjects; + } + + /** + * + * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) + * + * @param event + * @return null + * @throws ExecutionException + */ + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + try { + ServiceUtilsForHandlers util = ServiceUtilsForHandlers.getInstance(); + util.getTransactionalEditingDomain(event).getCommandStack().execute(getCommand()); + } catch (ServiceException e) { + Activator.log.error("Unexpected error while executing command.", e); //$NON-NLS-1$ + } + + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean isEnabled() { + return getCommand().canExecute(); + } + + /** + * + * @return true (visible) when the command can be executed. + */ + public boolean isVisible() { + return getCommand().canExecute(); + } + + +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointActivationHandler.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointActivationHandler.java new file mode 100644 index 00000000000..2d79fc944ac --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointActivationHandler.java @@ -0,0 +1,33 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.services.tracepoints.handler; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; +import org.eclipse.papyrus.infra.services.tracepoints.commands.ToggleBreakpointActivationCommand; + +/** + * Handler for toggling breakpoint activation. Delegates to associated command + * + * @author Ansgar Radermacher (CEA LIST) + */ +public class ToggleBreakpointActivationHandler extends AbstractCommandHandler { + + @Override + protected Command getCommand() { + // not useful to cache command, since selected element may change + return new GMFtoEMFCommandWrapper(new ToggleBreakpointActivationCommand(getSelectedElement())); + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointHandler.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointHandler.java new file mode 100644 index 00000000000..30a64d1f7aa --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleBreakpointHandler.java @@ -0,0 +1,33 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.services.tracepoints.handler; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; +import org.eclipse.papyrus.infra.services.tracepoints.commands.ToggleBreakpointCommand; + +/** + * Handler for toggling a break point. Delegates to associated command + * + * @author Ansgar Radermacher (CEA LIST) + */ +public class ToggleBreakpointHandler extends AbstractCommandHandler { + + @Override + protected Command getCommand() { + // not useful to cache command, since selected element may change + return new GMFtoEMFCommandWrapper(new ToggleBreakpointCommand(getSelectedElement())); + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointActivationHandler.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointActivationHandler.java new file mode 100644 index 00000000000..778ff6f23ba --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointActivationHandler.java @@ -0,0 +1,33 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.services.tracepoints.handler; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; +import org.eclipse.papyrus.infra.services.tracepoints.commands.ToggleTracepointActivationCommand; + +/** + * Handler for toggling tracepoint activation. Delegates to associated command + * + * @author Ansgar Radermacher (CEA LIST) + */ +public class ToggleTracepointActivationHandler extends AbstractCommandHandler { + + @Override + protected Command getCommand() { + // not useful to cache command, since selected element may change + return new GMFtoEMFCommandWrapper(new ToggleTracepointActivationCommand(getSelectedElement())); + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointHandler.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointHandler.java new file mode 100644 index 00000000000..b1334b8f784 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/ToggleTracepointHandler.java @@ -0,0 +1,33 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.services.tracepoints.handler; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; +import org.eclipse.papyrus.infra.services.tracepoints.commands.ToggleTracepointCommand; + +/** + * Handler for toggling a tracepoint. Delegates to associated command + * + * @author Ansgar Radermacher (CEA LIST) + */ +public class ToggleTracepointHandler extends AbstractCommandHandler { + + @Override + protected Command getCommand() { + // not useful to cache command, since selected element may change + return new GMFtoEMFCommandWrapper(new ToggleTracepointCommand(getSelectedElement())); + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/TracepointPropertiesHandler.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/TracepointPropertiesHandler.java new file mode 100644 index 00000000000..b191d9bb6c4 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/handler/TracepointPropertiesHandler.java @@ -0,0 +1,33 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.services.tracepoints.handler; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper; +import org.eclipse.papyrus.infra.services.tracepoints.commands.TracepointPropertiesCommand; + +/** + * Handler for changing the properties of a tracepoint. Delegates to associated command + * + * @author Ansgar Radermacher (CEA LIST) + */ +public class TracepointPropertiesHandler extends AbstractCommandHandler { + + @Override + protected Command getCommand() { + // not useful to cache command, since selected element may change + return new GMFtoEMFCommandWrapper(new TracepointPropertiesCommand(getSelectedElement())); + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/messages.properties b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/messages.properties new file mode 100644 index 00000000000..94ce99780de --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/messages.properties @@ -0,0 +1,15 @@ +TPPreferencePage_ClassOptions=Class options +TPPreferencePage_OperationOptions=Operations options +TPPreferencePage_StateOptions=State options +TPPreferencePage_TMforOperations=Trace Mechanism for operations (+construction/destruction) +TPPreferencePage_TMforPorts=Trace Mechanism for ports +TPPreferencePage_TMforStateMachines=Trace Mechanism for state machines +TPPreferencePage_TraceOptions=Trace options + +TraceActionSelection_ClassOptions=Class options +TraceActionSelection_ImplementationOptions=Implementation options +TraceActionSelection_NoPluginsProvideTraceExt=no plugins provide trace extension mechanism +TraceActionSelection_NotAvail= +TraceActionSelection_OperationOptions=Operation options +TraceActionSelection_SelectTraceAction=Select trace action for this element +TraceActionSelection_StateOptions=State options \ No newline at end of file diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/BinaryEncodedMChoiceFieldEditor.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/BinaryEncodedMChoiceFieldEditor.java new file mode 100644 index 00000000000..f0889b96393 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/BinaryEncodedMChoiceFieldEditor.java @@ -0,0 +1,134 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.infra.services.tracepoints.preferences; + +import org.eclipse.swt.widgets.Composite; + + +/** + * A class derived from the MultipleChoiceFieldEditor. + * It encodes a multiple choice value in a binary way, i.e. bit I is set in the result, if the i-th choice is active. + * This class can also be used outside a preference page + * + * @author ansgar + * + */ +public class BinaryEncodedMChoiceFieldEditor extends MultipleChoiceFieldEditor { + + /** + * @param name + * The preference ID + * @param labeltext + * the label text + * @param numColumns + * the number of columns + * @param labelsAndValues + * a two dimensional array containing the labels and values + * @param parent + * the parent SWT composite (field editor parent) + * @param useGroup + * display contents within a group + */ + public BinaryEncodedMChoiceFieldEditor(String name, String labeltext, int numColumns, String[][] labelsAndValues, Composite parent, boolean useGroup) { + super(name, labeltext, numColumns, labelsAndValues, parent, useGroup); + } + + + /** + * Convenience constructor, if used outside a preference page + * + * @param labeltext + * the label text + * @param numColumns + * the number of columns + * @param labelsAndValues + * a two dimensional array containing the labels and values + * @param parent + * the parent SWT composite (field editor parent) + * @param useGroup + * display contents within a group + */ + public BinaryEncodedMChoiceFieldEditor(String labeltext, int numColumns, String[][] labelsAndValues, Composite parent, boolean useGroup) { + super("", labeltext, numColumns, labelsAndValues, parent, useGroup); //$NON-NLS-1$ + } + + /** + * Use this function to initialize the set/non-set flags within the dialog from a binary encoded value, + * if you use the dialog outside a preference page + * + * @param currentValue + */ + public void setupViaString(String currentValue) { + setupControls(currentValue); + } + + /** + * Use this function to get the results, + * if you use the dialog outside a preference page + * + * @return the result + */ + public String getResult() { + result = gatherSettings(); + return result; + } + + /** + * Convenience function returning an integer result instead of a String result + * (requires double conversion that is difficult to avoid, since calculateResults needs to return + * a string); + * + * @return + */ + public int getIntResult() { + if (getResult() == null) { + return 0; + } + return Integer.parseInt(getResult()); + } + + @Override + protected String calculateResult(String[][] settings) { + int traceActionValue = 0; + int index = 0; + for (String setting[] : settings) { + // [0] = name, [1] = value [2] = checked + if (setting[2].equals("true")) { //$NON-NLS-1$ + traceActionValue += 1 << index; + } + index++; + } + ; + return String.valueOf(traceActionValue); + } + + @Override + protected boolean isSelected(String fieldName, String valueToSet) { + try { + int value = new Integer(valueToSet); + int index = 0; + for (String setting[] : labelsAndValues) { + // [0] = name, [1] = value [2] = checked + if (setting[0].equals(fieldName)) { + return (value & (1 << index)) > 0; + } + index++; + } + ; + } catch (NumberFormatException e) { + } + return false; + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/MultipleChoiceFieldEditor.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/MultipleChoiceFieldEditor.java new file mode 100644 index 00000000000..2bd41aadfa5 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/MultipleChoiceFieldEditor.java @@ -0,0 +1,235 @@ +/******************************************************************************* + * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + *******************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints.preferences; + +import org.eclipse.jface.preference.FieldEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; + + +/** + * @author Dennis Hübner - Initial contribution and API + * [used within Papyrus to avoid dependency to Xtext, minor visibility modification] + * + */ +public abstract class MultipleChoiceFieldEditor extends FieldEditor { + + private Composite checkBoxBox; + + private final boolean useGroup; + + protected final String[][] labelsAndValues; + + private final int numColumns; + + private Button[] checkBoxButtons; + + protected String result; + + public MultipleChoiceFieldEditor(String name, String labeltext, int numColumns, String[][] labelsAndValues, + Composite fieldEditorParent, boolean useGroup) { + init(name, labeltext); + this.numColumns = numColumns; + this.labelsAndValues = labelsAndValues.clone(); + this.useGroup = useGroup; + createControl(fieldEditorParent); + } + + /** + * @param settings + * String[][fieldName,fieldValue,isChecked] + * @return value as String + */ + protected abstract String calculateResult(String[][] settings); + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int) + */ + @Override + protected void adjustForNumColumns(int numColumns) { + Control control = getLabelControl(); + if (control != null) { + ((GridData) control.getLayoutData()).horizontalSpan = numColumns; + } + ((GridData) checkBoxBox.getLayoutData()).horizontalSpan = numColumns; + } + + /* + * (non-Javadoc) + * + * @see + * org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt + * .widgets.Composite, int) + */ + @Override + protected void doFillIntoGrid(Composite parent, int numColumns) { + if (useGroup) { + Control control = getCheckBoxControl(parent); + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + control.setLayoutData(gd); + } + else { + Control control = getLabelControl(parent); + GridData gd = new GridData(); + gd.horizontalSpan = numColumns; + control.setLayoutData(gd); + control = getCheckBoxControl(parent); + gd = new GridData(); + gd.horizontalSpan = numColumns; + control.setLayoutData(gd); + } + } + + private Control getCheckBoxControl(Composite parent) { + if (checkBoxBox == null) { + Font font = parent.getFont(); + if (useGroup) { + Group group = new Group(parent, SWT.NONE); + group.setFont(font); + String text = getLabelText(); + if (text != null) { + group.setText(text); + } + checkBoxBox = group; + GridLayout layout = new GridLayout(); + layout.horizontalSpacing = HORIZONTAL_GAP; + layout.numColumns = numColumns; + checkBoxBox.setLayout(layout); + } + else { + checkBoxBox = new Composite(parent, SWT.NONE); + GridLayout layout = new GridLayout(); + layout.marginWidth = 0; + layout.marginHeight = 0; + layout.horizontalSpacing = HORIZONTAL_GAP; + layout.numColumns = numColumns; + checkBoxBox.setLayout(layout); + checkBoxBox.setFont(font); + } + + checkBoxButtons = new Button[labelsAndValues.length]; + for (int i = 0; i < labelsAndValues.length; i++) { + Button checkBox = new Button(checkBoxBox, SWT.CHECK | SWT.LEFT); + checkBoxButtons[i] = checkBox; + String[] labelAndValue = labelsAndValues[i]; + checkBox.setText(labelAndValue[0]); + checkBox.setData(labelAndValue[1]); + checkBox.setFont(font); + checkBox.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent event) { + setPresentsDefaultValue(false); + String oldResult = result; + result = gatherSettings(); + fireValueChanged(VALUE, oldResult, result); + } + }); + } + checkBoxBox.addDisposeListener(new DisposeListener() { + + @Override + public void widgetDisposed(DisposeEvent event) { + checkBoxBox = null; + checkBoxButtons = null; + } + }); + } + else { + checkParent(checkBoxBox, parent); + } + return checkBoxBox; + } + + protected String gatherSettings() { + String[][] settings = new String[checkBoxButtons.length][3]; + for (int i = 0; i < checkBoxButtons.length; i++) { + Button currentCheckBox = checkBoxButtons[i]; + String name = currentCheckBox.getText(); + String value = (String) currentCheckBox.getData(); + String checked = String.valueOf(currentCheckBox.getSelection()); + settings[i] = new String[] { name, value, checked }; + } + return calculateResult(settings); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.preference.FieldEditor#doLoad() + */ + @Override + public void doLoad() { + setupControls(getPreferenceStore().getString(getPreferenceName())); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault() + */ + @Override + protected void doLoadDefault() { + setupControls(getPreferenceStore().getDefaultString(getPreferenceName())); + } + + protected void setupControls(String valueToSet) { + for (int i = 0; i < checkBoxButtons.length; i++) { + Button currentCheckBox = checkBoxButtons[i]; + currentCheckBox.setSelection(isSelected(currentCheckBox.getText(), valueToSet)); + } + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.preference.FieldEditor#doStore() + */ + @Override + protected void doStore() { + if (result == null) { + return; + } + getPreferenceStore().setValue(getPreferenceName(), result); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls() + */ + @Override + public int getNumberOfControls() { + return 1; + } + + @Override + public void setEnabled(boolean enabled, Composite parent) { + if (!useGroup) { + super.setEnabled(enabled, parent); + } + for (Button button : checkBoxButtons) { + button.setEnabled(enabled); + } + } + + abstract protected boolean isSelected(String fieldName, String valueToSet); +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceConstants.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceConstants.java new file mode 100644 index 00000000000..805ae8a3b87 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceConstants.java @@ -0,0 +1,51 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints.preferences; + +/** + * Constant definitions for plug-in preferences + */ +public class TPPreferenceConstants { + + /** + * The trace mechanism that should be used by default + */ + public static final String P_TRACE_IMPLEMENTATION_PORT = "papyrus.trace.implementation.port"; //$NON-NLS-1$ + + /** + * The trace mechanism that should be used by default + */ + public static final String P_TRACE_IMPLEMENTATION_OP = "papyrus.trace.implementation.op"; //$NON-NLS-1$ + + /** + * The trace mechanism that should be used by default + */ + public static final String P_TRACE_IMPLEMENTATION_SM = "papyrus.trace.implementation.sm"; //$NON-NLS-1$ + + + /** + * Options for trace implementation via state machines + */ + public static final String P_TRACE_OPTION_CLASS = "papyrus.trace.option.class"; //$NON-NLS-1$ + + /** + * Options for trace implementation for operations + */ + public static final String P_TRACE_OPTION_STATE = "papyrus.trace.option.state"; //$NON-NLS-1$ + + /** + * Options for trace implementation via state machines + */ + public static final String P_TRACE_OPTION_OP = "papyrus.trace.option.op"; //$NON-NLS-1$ +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceInitializer.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceInitializer.java new file mode 100644 index 00000000000..4280caa8c4e --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceInitializer.java @@ -0,0 +1,54 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints.preferences; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.emf.common.util.EList; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.papyrus.infra.services.tracepoints.Activator; +import org.eclipse.papyrus.infra.services.tracepoints.ITraceMechanism; +import org.eclipse.papyrus.infra.services.tracepoints.TraceMechanism; + +/** + * Class used to initialize default preference values. + */ +public class TPPreferenceInitializer extends AbstractPreferenceInitializer { + + /* + * (non-Javadoc) + * + * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() + */ + @Override + public void initializeDefaultPreferences() { + IPreferenceStore store = Activator.getDefault().getPreferenceStore(); + EList mechanisms = TraceMechanism.getTraceMechanisms(); + String mechanismID = ""; //$NON-NLS-1$ + if (mechanisms.size() > 0) { + ITraceMechanism mechanism = mechanisms.get(0); + // TODO: function need to support null object + EList mechanismIDs = mechanism.getTraceMechanismIDs(null); + if (mechanismIDs.size() > 0) { + mechanismID = mechanismIDs.get(0); + } + } + store.setDefault(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_PORT, mechanismID); + store.setDefault(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP, mechanismID); + store.setDefault(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM, mechanismID); + + store.setDefault(TPPreferenceConstants.P_TRACE_OPTION_CLASS, 3); + store.setDefault(TPPreferenceConstants.P_TRACE_OPTION_STATE, 0); + store.setDefault(TPPreferenceConstants.P_TRACE_OPTION_OP, 0); + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferencePage.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferencePage.java new file mode 100644 index 00000000000..eb4008a2308 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferencePage.java @@ -0,0 +1,108 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.services.tracepoints.preferences; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.jface.preference.ComboFieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.jface.preference.RadioGroupFieldEditor; +import org.eclipse.papyrus.infra.services.tracepoints.Activator; +import org.eclipse.papyrus.infra.services.tracepoints.ITraceMechanism; +import org.eclipse.papyrus.infra.services.tracepoints.Messages; +import org.eclipse.papyrus.infra.services.tracepoints.TraceActions; +import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAClass; +import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAOperation; +import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAState; +import org.eclipse.papyrus.infra.services.tracepoints.TraceMechanism; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; + +/** + * This class represents the TracePoint preference page + *

      + * This page is used to modify preferences only. They are stored in the preference store that belongs to the main plug-in class. That way, preferences can be accessed directly via the preference store. + */ + +public class TPPreferencePage + extends FieldEditorPreferencePage + implements IWorkbenchPreferencePage { + + public TPPreferencePage() { + super(GRID); + setPreferenceStore(Activator.getDefault().getPreferenceStore()); + setDescription(Messages.TPPreferencePage_TraceOptions); + } + + /** + * Creates the field editors. Field editors are abstractions of + * the common GUI blocks needed to manipulate various types + * of preferences. Each field editor knows how to save and + * restore itself. + */ + @Override + public void createFieldEditors() { + EList mechanisms = TraceMechanism.getTraceMechanisms(); + int elements = 0; + for (ITraceMechanism mechanism : mechanisms) { + // TODO: function need to support null object + EList mechanismIDs = mechanism.getTraceMechanismIDs(null); + elements += mechanismIDs.size(); + } + String[][] mechList = new String[elements][2]; + elements = 0; + for (ITraceMechanism mechanism : mechanisms) { + // TODO: function need to support null object + EList mechanismIDs = mechanism.getTraceMechanismIDs(null); + for (String id : mechanismIDs) { + mechList[elements][1] = id; + mechList[elements][0] = mechanism.getTraceMechanismDescription(null, id); + elements++; + } + } + + String[][] taClassOptions = TraceActions.getStringFields(TAClass.values()); + String[][] taStateOptions = TraceActions.getStringFields(TAState.values()); + String[][] taOperationOptions = TraceActions.getStringFields(TAOperation.values()); + + addField(new BinaryEncodedMChoiceFieldEditor(TPPreferenceConstants.P_TRACE_OPTION_CLASS, Messages.TPPreferencePage_ClassOptions, 3, taClassOptions, getFieldEditorParent(), true)); + + addField(new BinaryEncodedMChoiceFieldEditor(TPPreferenceConstants.P_TRACE_OPTION_STATE, Messages.TPPreferencePage_StateOptions, 3, taStateOptions, getFieldEditorParent(), true)); + + addField(new RadioGroupFieldEditor( + TPPreferenceConstants.P_TRACE_OPTION_OP, + Messages.TPPreferencePage_OperationOptions, 3, taOperationOptions, getFieldEditorParent(), true)); + + addField(new ComboFieldEditor( + TPPreferenceConstants.P_TRACE_IMPLEMENTATION_PORT, + Messages.TPPreferencePage_TMforPorts, mechList, getFieldEditorParent())); + + addField(new ComboFieldEditor( + TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP, + Messages.TPPreferencePage_TMforOperations, mechList, getFieldEditorParent())); + + addField(new ComboFieldEditor( + TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM, + Messages.TPPreferencePage_TMforStateMachines, mechList, getFieldEditorParent())); + + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) + */ + @Override + public void init(IWorkbench workbench) { + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.classpath b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.classpath new file mode 100644 index 00000000000..248b4c5dc7a --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.gitignore b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.gitignore new file mode 100644 index 00000000000..5500bf75774 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.gitignore @@ -0,0 +1 @@ +tmpModel diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.project b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.project new file mode 100644 index 00000000000..e5477bc69be --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.project @@ -0,0 +1,47 @@ + + + org.eclipse.papyrus.qompass.modellibs.tracing + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.acceleo.ide.ui.acceleoBuilder + + + compilation.kind + compilation.absolute.path + + + compliance + pragmatic + + + resource.kind + xmi + + + + + + org.eclipse.pde.PluginNature + org.eclipse.acceleo.ide.ui.acceleoNature + org.eclipse.jdt.core.javanature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f42de363afa --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/META-INF/MANIFEST.MF b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..6908c801140 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/META-INF/MANIFEST.MF @@ -0,0 +1,28 @@ +Manifest-Version: 1.0 +Export-Package: org.eclipse.papyrus.qompass.modellibs.tracing, + org.eclipse.papyrus.qompass.modellibs.tracing.acceleo +Require-Bundle: org.eclipse.papyrus.fcm.profile;bundle-version="1.2.0", + org.eclipse.papyrus.qompass.modellibs.core;bundle-version="1.2.0", + org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.papyrus.qompass.designer.core;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.tracepoints;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core;bundle-version="1.2.0", + org.eclipse.emf.workspace;bundle-version="1.5.0", + org.eclipse.uml2.uml;bundle-version="4.0.0", + org.eclipse.papyrus.uml.tools.utils;bundle-version="1.2.0", + org.eclipse.papyrus.qompass.designer.ui;bundle-version="1.2.0", + org.eclipse.papyrus.uml.diagram.wizards;bundle-version="1.2.0", + com.google.guava;bundle-version="11.0.0", + org.eclipse.xtext.xbase.lib, + org.eclipse.xtend.lib, + org.eclipse.xtend.lib.macro +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.qompass.modellibs.tracing.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.qompass.modellibs.tracing;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/about.html b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

      About This Content

      + +

      November 14, 2008

      +

      License

      + +

      The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

      + +

      If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

      + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo new file mode 100644 index 00000000000..9ce34a99746 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.properties b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.properties new file mode 100644 index 00000000000..a9d7f6eeed9 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.properties @@ -0,0 +1,14 @@ +source.. = src/,\ + xtend-gen/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + models/,\ + build.properties,\ + help/,\ + html/,\ + about.html,\ + plugin.properties +customBuildCallbacks = build.acceleo +src.includes = about.html diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/help/tocconcepts.xml b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/help/tocconcepts.xml new file mode 100644 index 00000000000..0344ca208f3 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/help/tocconcepts.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image001.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image001.gif new file mode 100755 index 00000000000..5271b605b82 Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image001.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image002.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image002.gif new file mode 100755 index 00000000000..d82c319e550 Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image002.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image003.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image003.gif new file mode 100755 index 00000000000..fae2ca8952f Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image003.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image004.jpg b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image004.jpg new file mode 100755 index 00000000000..864120f480a Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image004.jpg differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image005.jpg b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image005.jpg new file mode 100755 index 00000000000..9c9d1935d00 Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image005.jpg differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image006.jpg b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image006.jpg new file mode 100755 index 00000000000..d732917a0fc Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image006.jpg differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image007.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image007.gif new file mode 100755 index 00000000000..2a26c4ddaa7 Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image007.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image008.jpg b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image008.jpg new file mode 100755 index 00000000000..a332638c7e5 Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image008.jpg differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image009.jpg b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image009.jpg new file mode 100755 index 00000000000..bb1eed8a3b3 Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/images/image009.jpg differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/userguide.htm b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/userguide.htm new file mode 100644 index 00000000000..b2f52da6ea1 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/html/userguide.htm @@ -0,0 +1,213 @@ + + +Model-Based Tracing of UML models in Papyrus + + +

      Model-Based Tracing of UML models in Papyrus

      +

      +
      +

      1. Introduction

      +

      +The Papyrus Trace Framework allows +annotating UML model elements with a trace annotation. Different kind of model +elements can be annotated, such as operations or ports. These annotations are +shown by means of a decoration icon. When the code of the application is +generated, the trace declaration must lead to an instrumentation of the +generated code for a specific trace implementation, in our case primarily +LTTng.

      +

      2. Annotating Model elements

      +

      Several model elements can be annotated +with trace information. In the sequel, we list these and outline the different +trace options.

      +

      1. Class/component itself. When a class is annotated, by default its +creation and destruction is traced. In addition, a class has several features +(such as operations and attributes). These can be traced without having to +place a tracepoint on the feature itself. The user can choose whether he wants +to trace in addition all attributes, all operations or all states. This choice +is available in the tracing context menu, after the tracepoint has been +applied.

      +

      2. Port of a component

      +

      +If a port of a component is traced, an interceptor is placed within the components container. The +interceptor traces the operations that are associated with a port. For +instance, a data-flow port is associated with push or pull operations that take +the concerned data type as parameter.

      +

      +

      3. Operation of a class

      +

      A tracepoint may +be placed on an operation of a class. This means that an interceptor (on class +level) will create a trace event before and/or after the operation has been +called. In addition, there is the option to add the operation name and the +model reference into the trace point, or ' in addition ' all of the operations +parameters. If the trace event is produced before the application invocation, +out parameters and return values are not part of the trace event.

      +

      +

      4. Property of a class

      +

      Properties +(attributes) of a class can be traced, if the attribute's type is itself a +class. In this case, the tracepoint is interpreted as a trace on the instance. +It implies activating tracing on the attributes type, but restricting the +production of a trace to the role (instance) that the type plays within the class +declaring the attribute. This mechanism can be realized within the framework, +but is not implemented at the moment.

      +

      5. +Trace +an instance specification

      +

      Putting a trace +point on an instance specification is quite similar to putting a trace point to +an attribute: the classifier referenced by the instance specification will have +trace support but actual tracing is restricted to concrete instance. Not implemented (planned for 2013)

      +

      +

      6. +State +(within a statechart)

      +

      If a class defines a state-chart, the +states can be annotated with a trace marker. A trace event is produced, if the +state is entered and/or left (configurable via option). Not implemented +(planned for 2013)

      +

      7. +Transition: +A transition can be annotated. A trace event is produced, when the transition +is fired.

      +

      +

      +

      Code produced for a trace +annotation

      +

      2.1 +Trace declaration

      +

      In LTTng, a trace events need to have a +declaration. We distinguish events that have a generic declaration and those +requiring a specific declaration. For instance, a call event for an operation +has a generic declaration, if parameters are not included: all that is needed +is the operation name (or identifier). Although we could always use a generic +declaration with the operation name as parameter, we declare the name (and URI +reference) in the events declaration, i.e. in its meta-data. Thus, an event +instance does not include the model URI and is therefore quite lcompact on the +expense of a potentially large number of different events.

      +

      In general, the event declaration includes +a model reference, e.g. ref. to port or operation and event data. In case of an +operation call, the event data corresponds to the values of parameter and an +identification of the associated instance. The following code fragment shows, +how a tracepoint is declared in case of a port interception. Here, the port 'p', +typed with interface ICompute is traced, these are the actual of a package +template with the two formal parameters interface and port.

      +

      We use a canonical name for the event type +which is composed of the model name, the name of a package template and the +actual variables for the template. In our example, the model is called +ClientServerTraceTest, the package methodCall_port_ICompute_p (the underlying package +template is called methodCall_port, the actual for the two formals Interface +and port are 'ICompute' and 'p', respectively). The second parameter for the +event declaration is the elements name, e.g. the operation name ('add' in the +example) in case of a traced operation.

      +
      +

      TRACEPOINT_EVENT(ClientServerTraceTest_methodCall_port_ICompute_p, +add,

      +

      +TP_ARGS(const char *, instanceName, int, a, int, b),

      +

      +TP_FIELDS(

      +

      +ctf_string(instanceName, instanceName)

      +

      +ctf_integer(int, a, a)

      +

      +ctf_integer(int, b, b)

      +

      )

      +

      )

      +

      TRACEPOINT_MODEL_EMF_URI(ClientServerTraceTest_methodCall_port_ICompute_p, +add, "platform:/resource/org.eclipse.papyrus.qompass.designer.examples/model/ClientServerTraceTest.uml#_4KiE8DLbEd2qeKRLMdIx_A")

      +
      +

      +

      For each trace event, the added +instrumentation code with invoke the tracepoint, in case of the example above +by

      +
      +

      tracepoint(ClientServerTraceTest_methodCall_port_ICompute_p, add, instanceName, a, b);

      +
      +

      Note that instanceName is an attribute of the interception +class, i.e. not a fixed string, a and b are the actual parameters of an +operation.

      +

      3. Example

      +

      This section demonstrates the use of the trace +mechanism by means of a very simple application, called client/server trace +test. The model is available via the 'new example' menu. Select the example +from the 'Qompass examples' folder.

      +

      trace4.png

      +

      Figure 1: Tracepoint on operation, shown in model +explorer, diagram and trace view

      +

      Figure 1 shows a +small test application. A tracepoint is placed on an operation testOp. The +tracepoint is also visible in the tracepoint view (first selected entry) and in +the model explorer and the left. The tracepoint view is an additional view that +can be shown via the Eclipse standard 'show view' dialog, appearing in the +Papyrus category.

      +

      +

      +

      trace9.png

      +

      Figure 2: Set trace points via context menu

      +

      Figure 2 shows a +part of the context menu of a model element in the model explorer or a diagram. +It contains a sub-menu called 'Tracing' that contains trace related functions. +In particular, it is possible to toggle a tracepoint, i.e. add or remove a +tracepoint. A tracepoint can be active or inactive. While the instrumentation +is always added, i.e. also when the tracepoint is inactive, trace events should +only be produced for an active tracepoint. This sould be done via the LTTng +runtime control mechanisms.

      +

      +

      +

      Figure 4: Preference dialog for tracing

      +

      Figure 4 shows the +preference dialog for tracing within the Papyrus category. The dialog captures +the different options how a tracepoint of a class, a state and on an operation +should be interpreted, e.g. whether an operation is be trace with or without +parameter values.

      +

      In addition to these options, the +instrumentation has a modular realization mechanism and the default +implementation among available implementations can be chosen. The Qompass model +library contains for instance not only an LTTng based trace implementation, but +also one based on OTF (open trace format).

      +

      +

      +

      +

      Figure 5: Trace event view via TMF

      +

      Once the tracepoints are set, an +application can be compiled and executed. Currently, the runtime trace options +must be set manually (e.g. enable all events). The generated trace can be +imported by means of the TMF (trace monitoring framework) which is part of the +LTTng linux-tools. Figure 5 +shows the event view of this framework (note that the view will be replaced by +an editor from version 2.0 on) displaying the trace of the client/server trace +test model. The screenshot shows the event timestamp, type and content. It +depicts that the type corresponds to a qualified name in the model element and +that the contents contains parameter values.

      +

      +

      +

      Figure 6: Trace event view, filtered (only 'testOp' +is shown)

      +

      In Figure 6, the event view has been restricted +to the operation 'testOp' by means of a context operation of an element in the +model explorer or diagram. In this case, only events for the operation testOp +are shown.

      +
      + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.di b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.di new file mode 100644 index 00000000000..de6e71c6b4a --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.di @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.notation b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.notation new file mode 100644 index 00000000000..0a038c23221 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.notation @@ -0,0 +1,1600 @@ + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + + + + +
      + + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + +
      + + + +
      + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.uml b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.uml new file mode 100644 index 00000000000..58b4c73f332 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ClientServerTraceTest.uml @@ -0,0 +1,398 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + cout << "a=" << a << " b=" << b << " a+b=" << a+b << endl; +return a+b; + + + + + + + + + + + + + + + + + + C/C++ + cout << "a*b=" << a*b; +return a*b; + + + + + + C++ + My opaque behavior + + + + + + C++ + // This is a C++ operation body + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This interface contains services that are used by the client and provided by the server component + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The client component inherits a specific port from the Cstart componen type: the port "start" which provides interface IRunnable containing a single operation "run". By implementing this operation, the client gets initial control, comparable to a function "main" in classificla programming languages. + + + This realization relationship has been added automatically by Qompass, it is derived from the fact that class CClient_impl implements the port "start" which provides the interface "IStart" + + + The operation "run" (not the associated behavior) has been added automatically by Qompass in order to implement the operations of interfaces provided by ports, in this case of the operations of the "IStart" interface. It would be tedious to manually copy operations from an interface, as it would imply copying the complete signature with all parameters. The component developper has to provide a suitable behavior. A validation rule verifies if operations without behavior exist. + + + + + These two interface are part of the "BasicCalls" Qompass model library. The IStart interface is "special", since the Qompass model transformations check for it existance in order to pass the "main" control to this component. A validation rule checks, if exactly one component instance provides this interface via the "start" port. + + + + + + + + + + + + C/C++ + cout << "call via port q: add (2, 3);" << endl; +for (int i=0; i<20; i++) { + cout << "result: " << q->add (2, (i+3)) << endl; + usleep((i+10)*5*1000); + cout << "result: " << q->mult (3.0, 7.0) << endl; + usleep(20*1000); + testOp(i*2); + usleep(30*1000); +} + + + C/C++ + cout << "This is a test operation" << endl; + + + + + + + + + + + A composite class in which two attributes represent the component instances client and server, respectively. The assembly between ports is done on this level. +A single class represents the complete application, typically called "System" or "System_impl". Such a class provides the information to calculate a tree of instance specifications, a so-called deployment plan. Check out the context menu. can be generated from the + + + This connection between ports is stereotyped. The "connector" provides information which specific interaction component is responsible for realising this connection. The interaction component is part of an Qompass model library. Select the connection and check out the Qompass pop "Show/choose connector type or implementation". In this case an group of implementations has been chosen, which contains a socket connection in case of distribution and a direct connection, if co-localized + + + + + + + + + + + + + + + + + + + + The hardware architecture is also defined by means of a composite class (comparable to the software architecture). The types (NodeA and NodeB) can be stereotyped with information about the used target platform (FCM stereotype target). As for software architecture, instances specification for nodes are derived from this class. Use "Qompass: create platform definition" in the context menu. + + + The physical connection between two nodes is represented by a UML connector. Currently, this information is not evaluated by Qompass, but it is planned to analyze for instance whether the throughput (specified by means of MARTE) is sufficient with requirements of the software + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A deployment configuration that activates the tracing container rule which will provide OTF tracing. The deployment configuration is linked with the "monolithic" deployment plan + + + deployment plan (= set of instances along with their configuration and allocation) "monolithic". All instances are allocated to node instance "monoNode". Check out the node allocation with the pop-up "Qompass: allocate to node". +Initiate the deployment and code generation with the pop-up "Qompass: generate deployment model and code from plan". + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.di b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.di new file mode 100644 index 00000000000..8ead0589857 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.di @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.notation b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.notation new file mode 100644 index 00000000000..8d26d0ae915 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.notation @@ -0,0 +1,1090 @@ + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + +
      +
      +
      +
      +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + +
      +
      +
      +
      +
      + + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + +
      + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.uml b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.uml new file mode 100644 index 00000000000..dec7c68c5a4 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/ProducerConsumer.uml @@ -0,0 +1,457 @@ + + + + + + + + + + + + + + + + + + + + + + Variant of the consumper component that uses a "pull style", i.e. actively demands whether new data is available. Since the component is active, it needs to have its own thread. This is realized by the combination of the lifecycle port with a container rule that intercepts the lifecycle operations and executes the activation operation in its own thread. +Use the context menu to find out that the PullConsumer supports the "runStartThread" interceptor which intercepts the lifecycle port. + + + + Part of the Qompass model library. Provides the specific port "lc" (short for lifecycle). The "activate" operation of this port is called by generated boot-code after instantiation and configuration of a component. The deactivation is called before disposing a component + + + + + + + + + + + + C/C++ + cout << "wait for data on port p" << endl; +for (int i = 0; i<25; i++) { + if (p->hasData ()) { + ComponentModel::interfaces::PubData data = p->pull (); + cout << "received data: x = " << data.x << " y = " << data.y << endl; + } + usleep (100*1000); +} +cout << "finished waiting" << endl; + + + + + + + + + Push variant of a consumer, i.e. the consumer is called whenever new data is availble. It is not itself active. + + + A MARTE flow port. The synchronisation between MARTE and FCM stereotype is automatic, yet it is possible to refine on FCM level, whether the port uses a push or pull style. In this case, the port uses a push style by setting the port kind to "PushConsumer". + + + + + + + + + + + + + C/C++ + cout << "initialization of push consumer" << endl; + + + + C/C++ + cout << "received data: x = " << data.x << " y = " << data.y << endl; + + + + + + + + + + + + + + + + + + + + + + + + + Let the producer instance execute by the main thread by realising the specific port "start", inherited from CStart (part of the Qompass "core" model library). + + + + + + + + + + + + + C/C++ + cout << "publish a value via port q;" << endl; +ComponentModel::interfaces::PubData data; +data.x = 2; +data.y = 3; +for (int i = 0; i<20; i++) { + q->push (data); + cout << "." << flush; + // wait 200ms + usleep (200*1000); +} + + + + + + + + + Pull consumer is executed by its own thread. This is specified via a container service (runStartThread) + + + Since producer and consumer call operations (the latter to actively retrieve data), the two ports would be incompatible without using a specific interaction component, in this case. a FIFO. +Use the context menu on a selected connector to specify the interaction component. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The push consumer provides the interface that the producer uses (requires), no specific connector is required + + + + + + + + + + + + + + + + + + + + + + + + + Simple single node configuration. TargetOS is set to Linux, but will work on other OS (supporting POSIX threads) + + + + + + + + + + + + + + + + + + + + + + + + This configuration requires the installation of the OTF trace library.<br /> + + + Cross references to diagrams + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + false + + + + false + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.di b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.di new file mode 100644 index 00000000000..4b69336c601 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.di @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.notation b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.notation new file mode 100644 index 00000000000..62727ee1920 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.notation @@ -0,0 +1,410 @@ + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + +
      +
      +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + +
      + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.uml b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.uml new file mode 100644 index 00000000000..99e6bd2e3e9 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.uml @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + cout << "a=" << a << " b=" << b << " a+b=" << a+b << endl; +return a+b; + + + + + + + + + + + + + + + + + + C/C++ + cout << "a*b=" << a*b; +return a*b; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This interface contains services that are used by the client and provided by the server component + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The operation "run" (not the associated behavior) has been added automatically by Qompass in order to implement the operations of interfaces provided by ports, in this case of the operations of the "IStart" interface. It would be tedious to manually copy operations from an interface, as it would imply copying the complete signature with all parameters. The component developper has to provide a suitable behavior. A validation rule verifies if operations without behavior exist. + + + + + + + + C/C++ + cout << "call via port q: add (2, 3);" << endl; +for (int i=0; i<20; i++) { + cout << "result: " << q->add (2, (i+3)) << endl; + usleep((i+10)*5*1000); + cout << "result: " << q->mult (3.0, 7.0) << endl; + usleep(20*1000); + testOp(i*2); + usleep(30*1000); +} + + + C/C++ + cout << "This is a test operation" << endl; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.di b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.di new file mode 100644 index 00000000000..ebdd073cf33 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.di @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.notation b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.notation new file mode 100644 index 00000000000..f71f3401d51 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.notation @@ -0,0 +1,1684 @@ + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + +
      + + +
      + + +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.uml b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.uml new file mode 100644 index 00000000000..73635b6b22a --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/library/tracing.uml @@ -0,0 +1,750 @@ + + + + + + + + + + + + + + + + + + + + + + Variant of OTF trace that only reports values that change. + + + A prior variant had a link with the methodCall_comp signature, since the operationIDs should be different, depending on the called component. This leads to a large number of generated classes. Current solution: configure the IDs on an instance level via ths InstanceConfigurator + + + + Trace implementation based on OTF trace library. Aggregates singleton TraceInit + + + + + + + + + + + + + + + + + + + + C/C++ + [import org::eclipse::papyrus::qompass::designer::core::acceleo::UMLTool/] +[import org::eclipse::papyrus::qompass::designer::core::acceleo::utils_cpp/] + +[template public traceOp(operation: Operation)] + +// <instance>_<port>_<operation> +// easier: <component>_<port>_<operation> +updateTimestamp (); +if (!hasDeclaredFunctions) { + declareFunctions(); + hasDeclaredFunctions = true; +} +Tracing::TraceInit::wait(); +int processID = Tracing::TraceInit::getProcessID(); +OTF_Writer * writer = Tracing::TraceInit::getWriter(); +OTF_Writer_writeEnter (writer, timestamp.ticks(), <%enumSvcPrefix%>::id_<%owner.varName%>_<%varName%>, processID, 0); +OTF_Writer_writeEventComment (writer, timestamp.ticks(), processID, portName); +OTF_Writer_writeEventComment (writer, timestamp.ticks(), processID, instanceName); +Tracing::TraceInit::post(); +[if not (type = null)] [type.cppType()/] ret = [/if]rconn->[operation.cppCall()/]; +updateTimestamp (); +Tracing::TraceInit::wait(); +OTF_Writer_writeLeave (writer, timestamp.ticks(), <%enumSvcPrefix%>::id_<%owner.varName%>_<%varName%>, processID, 0); +Tracing::TraceInit::post(); +[if not (type = null)] return ret;[/if] +[/template] + + + C/C++ + timestamp = OS_AL::Time::TimeVal::current (); +// gettimeofday (&currentTime, NULL); +// timestamp = ... + + + C/C++ + // function groups are badly supported in OTF, since writeEnter/Leave do not support them +// thus intial plan that each interface corresponds to a function group has not been implemented +int fctGroupID = 0; +int streamNr = 0; +OTF_Writer * writer = Tracing::TraceInit::getWriter(); +<%for (getAllOperations) {%> +OTF_Writer_writeDefFunction (writer, streamNr, <%enumSvcPrefix%>::id_<%owner.varName%>_<%varName%>, <%quoteLiteral("InterfaceEnum", "id_<%owner.varName%>_<%varName%>")%>, fctGroupID, 0); +<%}%> + + + + <<TextualRepresentation>>public '<%name%>' () { } + + + + + + + + + + + +
      + + + + + + + + + + + + + + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + // <instance>_<port>_<operation> +// easier: <component>_<port>_<operation> +OTF_Writer * writer = Tracing::Trace::TraceInit::getWriter(); +int processID = Tracing::Trace::TraceInit::getProcessID(); +updateTimestamp (); +// need to store parameter values, but that is not simple, as we are not in the data-flow context +// => need specific data-flow trace +// (costly) solution? string comparison? [string has which size?] howto get string representation of each parameter?? (in particular for structs) +// too complicated... +// three specific data_flow trace, offering identical (but conjugated ports). PushP/PushP, PullC/PullC, PushC/PushC => three interceptors, howto select? + +/* +if (m_first) { + m_first = false; + doTrace = true; +} +else +*/ +bool doTrace = true; +OS_AL::Util::BString200 parameters; +parameters << "port=" << portName << " "; +if (doTrace) { + Tracing::Trace::TraceInit::wait(); + <%for (parametersInInout) {%> + <%if (filter("DataType")) {%> + <%for (ownedAttribute) {%> + parameters << <%name%> << "#"; + <%}%> + <%} else {%> + parameters << <%name%> << "#"; + <%}%> + <%}%> + OTF_Writer_writeEnter (writer, timestamp.ticks(), Tracing::Trace::ID_<%args(0).varName%>_<%varName%>, processID, 0); + Tracing::Trace::TraceInit::post(); +} +<%if (type != null) {%><%type.cppType%> ret = <%}%>rconn-><%cppCall%>; +<%if (type != null) {%>parameters << "r=" + <%if (type.filter("DataType")) {%> + <%for (type.ownedAttribute) {%> + << ret.<%name%> << "#" + <%}%>; + <%}else{%> + << ret; + <%}%> +<%}%> +updateTimestamp (); +if (doTrace) { + Tracing::Trace::TraceInit::wait(); + OTF_Writer_writeEventComment (writer, timestamp.ticks(), processID, parameters.data()); + OTF_Writer_writeLeave (writer, timestamp.ticks(), Tracing::Trace::ID_<%args(0).varName%>_<%varName%>, processID, 0); + Tracing::Trace::TraceInit::post(); +} +<%if (type != null) {%>return ret;<%}%> + + + C/C++ + m_first = true; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OTF (Open trace format) tracing mechanism + + + An OTF based trace mechanism that tracks value changes + + + LTTng based trace mechanism for port interception + + + LTTng LW mechanism for operations + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + [import org::eclipse::papyrus::qompass::modellibs::tracing::acceleo::traceLTTng/] + +[template public anOperation(operation : Operation)] +[operation.invokeTP()/] +[/template] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + const char *filename= "trace.otf"; + +//OTF_FileManager* manager; + +uint32_t streams= 1; + +/* file handles available */ +uint32_t files= 10; + +/* per-stream buffer size */ +uint32_t buffersize= 10*1024; + +/* compression on/off, test without compression to look at ASCII trace files */ +// int compression= 0; + +/************************************* +* INIT * +*************************************/ +manager= OTF_FileManager_open( files ); +// assert( NULL != manager ); + +writer = OTF_Writer_open( filename, streams, manager ); +OTF_Writer_setBufferSizes( writer, buffersize ); + +streamNr = 1; + +OTF_Writer_writeDefTimerResolution( writer, + streamNr /* uint32_t stream */, + 1e3 /* uint64_t ticksPerSecond */ ); + +// initial post +sema.post(); + + + C/C++ + return writer; + + + C/C++ + + + + C/C++ + // do not close in deactivate, since additional calls to OTF_write may occur later. +OTF_Writer_close(writer); + + + + C/C++ + int id = OS_AL::ProcessingResources::Thread::getId (); +for (int i = 0; i < processSet.size (); i++) { + if (processSet.get(i) == id) { + return i+1; + } +} +// not known yet => add +processSet.append(id); +int processID = processSet.size(); +char name[16]; +sprintf(name, "id: %x", id); +OTF_Writer_writeDefProcess(writer, streamNr, processID, name, 0); +// OS_AL name only valid for threads created with OS_AL +// OTF_Writer_writeDefProcess(writer, streamNr, processID, OS_AL::ProcessingResources::Thread::getName().data(), 0); +// not required +// OTF_Writer_assignProcess(writer, processID, streamNr); +// OTF_Writer_mapProcess(writer, processID); +OTF_Writer_writeBeginProcess (writer, 0, processID); +return processID; + + + C/C++ + sema.wait(); + + + C/C++ + sema.post(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + OTF_Writer_writeDefFunctionGroup (writer, 0, "application functions"); +<%for (ownedLiteral) {%> + OTF_Writer_writeDefFunction (writer, 0, <%name%>, "<%name%>", 0, 0); +<%}%> + + + + + + + + + + + + + C/C++ + !xtend TraceLTTng.declareTracepointEventCreateClass + + + C/C++ + !xtend TraceLTTng.declareTracepointEventDestroyClass + + + + + + + + + + + + + Interceptor for LTTng calls + + + Trace Provider class. Delegates to LTTng xtend file for code generation + + + + + + C/C++ + !xtend TraceLTTng.invokeTP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.properties b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.properties new file mode 100644 index 00000000000..3909dafe6fc --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus extra: Qompass model library for tracing (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.xml b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.xml new file mode 100644 index 00000000000..7a1427bd9c9 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/plugin.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/pom.xml b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/pom.xml new file mode 100644 index 00000000000..26d9859be7e --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.qompass.modellibs.tracing + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-clean-plugin + + + + xtend-gen + + **/* + + + .gitignore + + + + + + + org.eclipse.xtend + xtend-maven-plugin + + + generate-sources + + compile + + + + + xtend-gen + ${project.build.directory}/xtend-gen/test + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/Activator.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/Activator.java new file mode 100644 index 00000000000..bd40f7d0f5b --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/Activator.java @@ -0,0 +1,53 @@ +package org.eclipse.papyrus.qompass.modellibs.tracing; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.modellibs.tracing"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java new file mode 100644 index 00000000000..ad9530592fc --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java @@ -0,0 +1,14 @@ +package org.eclipse.papyrus.qompass.modellibs.tracing; + +import org.eclipse.papyrus.uml.diagram.wizards.ModelCopyWizard; + +/** + * Copy wizard for the ClientServerTraceTest example + */ + +public class ClientServerTraceTestModelWizard extends ModelCopyWizard { + + public ClientServerTraceTestModelWizard() { + super("ClientServerTraceTest"); //$NON-NLS-1$ + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorOTF.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorOTF.java new file mode 100644 index 00000000000..64cdef2bc3c --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorOTF.java @@ -0,0 +1,59 @@ +package org.eclipse.papyrus.qompass.modellibs.tracing; + +import org.eclipse.papyrus.qompass.designer.core.PortUtils; +import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; +import org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator; +import org.eclipse.papyrus.qompass.designer.core.transformations.container.ContainerTrafo; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Interface; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; + + +public class IConfiguratorOTF implements IInstanceConfigurator { + + static final String PROP_PORT_NAME = "portName"; //$NON-NLS-1$ + + static final String PROP_INSTANCE_NAME = "instanceName"; //$NON-NLS-1$ + + /** + * Configure the passed trace instance + * + * @see org.eclipse.papyrus.qompass.designer.gentools.core.extensions.IInstanceConfigurator + */ + @Override + public void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) { + // The tracing code needs informations about the component instance and port. + + DepPlanUtils.configureProperty(instance, PROP_INSTANCE_NAME, StringConstants.QUOTE + instance.getName() + StringConstants.QUOTE); + + // port in context => interception of port => provide information about port and interface + ContainerTrafo containerTrafo = ContainerTrafo.getContainerTrafo(parentInstance); + if (containerTrafo == null) { + return; + } + Port port = containerTrafo.getInterceptedPort(componentPart); + if (port != null) { + // obtain required or provided interface (TODO: will fail, if both are provided!) + Interface intf = PortUtils.getProvided(port); + if (intf == null) { + intf = PortUtils.getRequired(port); + } + + DepPlanUtils.configureProperty(instance, PROP_PORT_NAME, StringConstants.QUOTE + port.getName() + StringConstants.QUOTE); + if (intf != null) { + // this is specific for OTF: + // each container contains an attribute (id_) for each operation. This is configured here, + // since we add instance information to the trace (is that useful??, seems like a hack) + // TODO: originally, we used executorIS *in source model* + for (Operation op : intf.getOperations()) { + String id = PackageUtil.getRootPackage(instance).getName() + "::Tracing::Trace::ID_" + //$NON-NLS-1$ + instance.getName().replace(".", "_") + "_" + op.getName(); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ + DepPlanUtils.configureProperty(instance, "id_" + op.getName(), id); //$NON-NLS-1$ + } + } + } + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorTrace.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorTrace.java new file mode 100644 index 00000000000..4f7eaaf41d6 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorTrace.java @@ -0,0 +1,45 @@ +package org.eclipse.papyrus.qompass.modellibs.tracing; + +import org.eclipse.papyrus.qompass.designer.core.deployment.DepPlanUtils; +import org.eclipse.papyrus.qompass.designer.core.extensions.IInstanceConfigurator; +import org.eclipse.papyrus.qompass.designer.core.transformations.container.ContainerTrafo; +import org.eclipse.uml2.uml.InstanceSpecification; +import org.eclipse.uml2.uml.Port; +import org.eclipse.uml2.uml.Property; + +public class IConfiguratorTrace implements IInstanceConfigurator { + + static final String PROP_PORT_NAME = "portName"; //$NON-NLS-1$ + + static final String PROP_INSTANCE_NAME = "instanceName"; //$NON-NLS-1$ + + /** + * Configure the passed trace instance + * + * @see org.eclipse.papyrus.qompass.designer.gentools.core.extensions.IInstanceConfigurator + */ + @Override + public void configureInstance(InstanceSpecification instance, Property componentPart, InstanceSpecification parentInstance) { + // The tracing code needs informations about the component instance and port. + + String instanceName = instance.getName(); + int index = instanceName.lastIndexOf("."); //$NON-NLS-1$ + if (index != -1) { + String lastSegment = instanceName.substring(index + 1); + if (lastSegment.startsWith(ContainerTrafo.interceptorName)) { + instanceName = instanceName.substring(0, index); + } + } + + DepPlanUtils.configureProperty(instance, PROP_INSTANCE_NAME, StringConstants.QUOTE + instanceName + StringConstants.QUOTE); + + // port in context => interception of port => provide information about port and interface + ContainerTrafo containerTrafo = ContainerTrafo.getContainerTrafo(parentInstance); + if (containerTrafo != null) { + Port port = containerTrafo.getInterceptedPort(componentPart); + if (port != null) { + DepPlanUtils.configureProperty(instance, PROP_PORT_NAME, StringConstants.QUOTE + port.getName() + StringConstants.QUOTE); + } + } + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/QompassTraceMechanism.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/QompassTraceMechanism.java new file mode 100644 index 00000000000..8e286a6792e --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/QompassTraceMechanism.java @@ -0,0 +1,188 @@ +package org.eclipse.papyrus.qompass.modellibs.tracing; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.BasicEList; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.papyrus.FCM.ConfigOption; +import org.eclipse.papyrus.FCM.ContainerRule; +import org.eclipse.papyrus.FCM.RuleApplication; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.services.ServiceException; +import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers; +import org.eclipse.papyrus.infra.services.tracepoints.ITraceMechanism; +import org.eclipse.papyrus.infra.services.tracepoints.MarkerUtils; +import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAOperation; +import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; +import org.eclipse.papyrus.qompass.designer.core.Description; +import org.eclipse.papyrus.qompass.designer.core.Log; +import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.uml.tools.utils.PackageUtil; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; +import org.eclipse.uml2.uml.Class; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; +import org.eclipse.uml2.uml.Operation; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Property; + +public class QompassTraceMechanism implements ITraceMechanism { + + public static final String EC3M_TRACING_URI = "pathmap://QML_TRACE/tracing.uml"; //$NON-NLS-1$ + + public static final URI tracingURI = URI.createURI(EC3M_TRACING_URI); + + @Override + public EList getTraceMechanismIDs(EObject eObj) { + EList ids = new BasicEList(); + // obtain list of all available container rules via Utils. Restrict to those doing tracing. + EList containerRules = getContainerRules(eObj); + for (ContainerRule containerRule : containerRules) { + if (isForTracing(containerRule)) { + Class clazz = containerRule.getBase_Class(); + ids.add(clazz.getName()); + } + } + if (ids.size() == 0) { + ids.add("dummy qompass rule"); + } + return ids; + } + + @Override + public String getTraceMechanismDescription(EObject eObj, String id) { + EList containerRules = getContainerRules(eObj); + for (ContainerRule containerRule : containerRules) { + if (isForTracing(containerRule)) { + Class clazz = containerRule.getBase_Class(); + if (clazz.getName().equals(id)) { + return Description.getDescription(clazz); + } + } + } + return null; + } + + /** + * Apply the trace mechanism, i.e. set or unset the appropriate ContainerRule for tracing. + * Currently handles trace on class. + * + * Basic idea: always apply same container rule. But container rule expansion is different in function of set tracepoints. + * Need to unapply, if there is no longer a trace needing it. + */ + @Override + public boolean applyTraceMechanism(EObject eObj, String id, int traceOption) { + Class clazzContext = getClassContext(eObj); + if (clazzContext == null) { + return false; + } + EList containerRules = getContainerRules(eObj); + for (ContainerRule containerRule : containerRules) { + if (isForTracing(containerRule)) { + Class clazz = containerRule.getBase_Class(); + + if (clazz.getName().equals(id)) { + if (traceOption == TAOperation.OnlyCall.ordinal()) { + // yes => what do we then (i.e. how is mapping done??) + } + RuleApplication ruleApplication = StereotypeUtil.applyApp(clazzContext, RuleApplication.class); + if ((ruleApplication != null) && !ruleApplication.getContainerRule().contains(containerRule)) { + ruleApplication.getContainerRule().add(containerRule); + return true; + } + } + } + } + return false; + } + + // QompassTraceMechanism + + public boolean isForTracing(ContainerRule rule) { + for (ConfigOption co : rule.getForConfig()) { + // TODO: not very clean to used fixed string + if (co.getBase_Class().getName().equals("Trace")) { //$NON-NLS-1$ + return true; + } + } + return false; + } + + /** + * Return the class (component) for which we need to apply a container rule + * to enable the tracing of the passed eObject. This eObject may be + * (1) A class, in this case it could be returned directly + * (2) An operation. In this case, the owning class is returned (caveat: operation might belong to an interface) + * (3) A property of the class (including ports). + * + * @param eObj + * see description above + * @return the class to a container rule may be applied + */ + public Class getClassContext(EObject eObj) { + if (eObj instanceof Class) { + return (Class) eObj; + } else if (eObj instanceof Operation) { + return ((Operation) eObj).getClass_(); + } else if (eObj instanceof Property) { + return ((Property) eObj).getClass_(); + } else { + return null; + } + } + + public EList getContainerRules(EObject eObj) { + if (eObj == null) { + // load rules of registered Tracing model library + try { + ModelSet ms = ServiceUtilsForActionHandlers.getInstance().getModelSet(); + Resource rs = ms.getResource(tracingURI, true); + EList contents = rs.getContents(); + if ((contents.size() > 0) && (contents.get(0) instanceof Package)) { + return Utils.getAllRules((Package) contents.get(0)); + } + } catch (ServiceException e) { + Log.log(IStatus.ERROR, Log.TRAFO_CONTAINER, e.getMessage()); + } + return new BasicEList(); + } else { + Package top = PackageUtil.getRootPackage((Element) eObj); + return Utils.getAllRules(top); + } + } + + @Override + public boolean configureTraceMechanisms() { + String config = ""; //$NON-NLS-1$ + // TODO: config is never evaluated + try { + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + + if (root != null) { + Object tracePoints[] = root.findMarkers(TracepointConstants.tpOrbpMarker, true, IResource.DEPTH_INFINITE); + for (Object tracePointObj : tracePoints) { + if (tracePointObj instanceof IMarker) { + IMarker tracePoint = (IMarker) tracePointObj; + EObject eobj = MarkerUtils.getEObjectOfMarker(tracePoint); + if (MarkerUtils.isActive(tracePoint)) { + if (eobj instanceof NamedElement) { + config += ((NamedElement) eobj).getQualifiedName(); + } + } + } + } + } + } catch (CoreException e) { + Log.log(IStatus.ERROR, Log.TRAFO_CONTAINER, e.getMessage()); + } + return true; + } + +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/StringConstants.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/StringConstants.java new file mode 100644 index 00000000000..d3ced2536a6 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/StringConstants.java @@ -0,0 +1,5 @@ +package org.eclipse.papyrus.qompass.modellibs.tracing; + +public class StringConstants { + public static final String QUOTE = "\""; //$NON-NLS-1$ +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceCout.xtend b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceCout.xtend new file mode 100644 index 00000000000..396d9860fb6 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceCout.xtend @@ -0,0 +1,18 @@ +package org.eclipse.papyrus.qompass.modellibs.tracing.acceleo + +import org.eclipse.uml2.uml.Operation +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.* +import org.eclipse.papyrus.qompass.designer.core.extensions.IXtend + +class TraceCout implements IXtend { + + public def traceOp(Operation operation) ''' + // declare operation & use it directly. Problem: declaration can not be within the scope of an operation + updateTimestamp(); + cout << "enter operation: " << «operation.name» << " at " << timestamp.ticks() << " parameters: " + «FOR parameter : operation.ownedParameters» << "«parameter.name» (of type «parameter.type.name») "«ENDFOR» << endl; + + «IF (operation.type != null)» type.cppType ret = «ENDIF»rconn->«operation.cppCall»; + «IF (operation.type != null)» return ret;«ENDIF» + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceLTTng.xtend b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceLTTng.xtend new file mode 100644 index 00000000000..be837094ae1 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceLTTng.xtend @@ -0,0 +1,198 @@ +package org.eclipse.papyrus.qompass.modellibs.tracing.acceleo + +import org.eclipse.uml2.uml.Classifier +import org.eclipse.uml2.uml.Parameter +import org.eclipse.uml2.uml.DataType +import org.eclipse.uml2.uml.Type +import org.eclipse.uml2.uml.Operation + +import static extension org.eclipse.papyrus.qompass.modellibs.tracing.acceleo.TraceUtils.* +import static extension org.eclipse.papyrus.qompass.designer.core.UMLTool.* +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.* +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext +import org.eclipse.papyrus.qompass.designer.core.extensions.IXtend +import org.eclipse.uml2.uml.PrimitiveType + +class TraceLTTng implements IXtend { + + public def declareTP(Classifier cl) ''' + #if !defined(HFILENAME_H) || defined(TRACEPOINT_HEADER_MULTI_READ) + #define HFILENAME_H + + #ifdef __cplusplus + extern "C" { + #endif + + #include + «FOR operation : cl.getAllOperations()» + «IF TraceUtils.hasTrace(operation)» + «declareTPop(tpName1(), operation)» + «ENDIF» + «ENDFOR» + + #undef TRACEPOINT_PROVIDER + #define TRACEPOINT_PROVIDER «tpName1» + + #undef TRACEPOINT_INCLUDE_FILE + #define TRACEPOINT_INCLUDE_FILE «TransformationContext.classifier.getQualifiedName().replaceAll('::', '/')».h + + #include + + #ifdef __cplusplus + } + #endif + + #endif + ''' + + public def declareEMF_URI(Classifier cl) ''' + #include + + TRACEPOINT_MODEL_EMF_URI(UMLmodel, starting, "«TransformationContext.sourceRoot.getURI»") + ''' + + public def declareTPop(String tpName, Operation operation) ''' + #include + + // declare trace point + TRACEPOINT_EVENT(«tpName1()», «operation.tpName2», + TP_ARGS(const char *, instanceName«IF (operation.parametersInInout.size > 0)», «ENDIF»«FOR parameter : operation.parametersInInout SEPARATOR(', ')»«parameter.flattenParNameAndType»«ENDFOR»), + TP_FIELDS( + ctf_string(instanceName, instanceName) + «FOR parameter : operation.parametersInInout» + «TransformationContext.classifier.declareDependency(parameter.type)»«flattenCtfType(parameter.type, parameter.name)» + «ENDFOR» + ) + ) + TRACEPOINT_MODEL_EMF_URI(«tpName1», «operation.tpName2», "«operation.modelRef»") + ''' + + public def declareTracepointEventCreateClass(Classifier clazz) ''' + TRACEPOINT_EVENT(«tpName1», createClass, «clazz.qualifiedName») + ''' + + public def declareTracepointEventDestroyClass(Classifier clazz) ''' + TRACEPOINT_EVENT(«tpName1», destroyClass, «clazz.qualifiedName») + ''' + + public def declareCreateDestroy(String tpName) ''' + TRACEPOINT_EVENT(«tpName», createClass, + TP_ARGS(const char *, classURI), + TP_FIELDS( + ctf_string(classURI, classURI) + ) + ) + TRACEPOINT_EVENT(«tpName», destroyClass, + TP_ARGS(const char *, className), + TP_FIELDS( + ctf_string(xmdID, className) + ) + ) + ''' + + /** + * The name that is used for the trace provider + */ + def tpName1() { + TransformationContext.binding.getNearestPackage.qualifiedName.varName + } + + + /** + * The name that is used for the type + */ + def tpName2(Operation operation) { + operation.name + } + + /** + * Reference either the port (if available in the context) or the operation that is traced + */ + def modelRef(Operation operation) { + val uri = TransformationContext.sourceRoot.eResource.URI + if (TransformationContext.port == null) { + uri + "#" + operation.xmlID() + } + else { + uri + "#" + TransformationContext.port.xmlID() + } + } + + public def declareTraceOp(Operation operation) { + } + + public def invokeTP(Operation operation) ''' + // create event with operationID/portID and pass call + «IF (operation.hasTrace)» + // use (call) tracepoint + tracepoint(«tpName1()», «operation.tpName2()», instanceName«IF (operation.parametersInInout.size > 0)», «ENDIF»«FOR parameter : operation.parametersInInout() SEPARATOR(', ')»«parameter.flattenParName.toString.trim»«ENDFOR»); + «ENDIF» + «IF (operation.type != null)»return «ENDIF»rconn->«operation.cppCall»; + ''' + + + def flattenParNameAndType(Parameter parameter) ''' + «IF (parameter.type instanceof DataType) && !(parameter.type instanceof PrimitiveType)» + «FOR attribute : (parameter.type as DataType).attributes SEPARATOR(', ')»«attribute.type.cppTypeWB.toString.trim», «parameter.name + '_' + attribute.name»«ENDFOR» + «ELSE» + «parameter.type.cppTypeWB.toString.trim», «parameter.name» + «ENDIF» + ''' + + def flattenParName(Parameter parameter) ''' + «IF (parameter.type instanceof DataType) && !(parameter.type instanceof PrimitiveType)» + «FOR attribute : (parameter.type as DataType).attributes SEPARATOR(', ')»«parameter.name».«attribute.name»«ENDFOR» + «ELSE» + «parameter.name» + «ENDIF» + ''' + + + def flattenCtfType(Type type, String name) ''' + «IF (type instanceof DataType) && !(type instanceof PrimitiveType)» + «FOR attribute : (type as DataType).attributes SEPARATOR('\n')» + «ctfType(attribute.type, name + '_' + attribute.name)» + «ENDFOR» + «ELSE» + «ctfType(type, name)» + «ENDIF» + ''' + + + /** + * Support for C++ types with boolean + */ + def cppTypeWB(Type type) ''' + «IF + (type.qualifiedName == 'UMLPrimitiveTypes::Boolean') || + (type.qualifiedName == 'PrimitiveTypes::Boolean') || + (type.qualifiedName == 'CORBA::Boolean')» + /* bool */ unsigned char + «ELSE» + «type.cppType» + «ENDIF» + ''' + + + /** + * Calculate the typename, defaulting to ctf_integer + * TODO: treat pointer & ref stereotypes (can only evaulate on parameter or attribute, not on Type) + * + */ + def ctfType(Type type, String name) ''' + «IF + (type.qualifiedName == 'CORBA::String') || + (type.qualifiedName == 'PrimitiveTypes::String') || + (type.qualifiedName == 'UMLPrimitiveTypes::String')» + ctf_string(«name», «name») + «ELSEIF + (type.qualifiedName == 'CORBA::Float') || + (type.qualifiedName == 'CORBA::Double') || + (type.qualifiedName == 'AnsiCLibrary::float') || + (type.qualifiedName == 'AnsiCLibrary::double')» + ctf_float(«type.cppType», «name», «name») + «ELSE» + ctf_integer(«type.cppTypeWB», «name», «name») + «ENDIF» + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceOTF.xtend b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceOTF.xtend new file mode 100644 index 00000000000..39d65986c6a --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceOTF.xtend @@ -0,0 +1,33 @@ +package org.eclipse.papyrus.qompass.modellibs.tracing.acceleo + +import org.eclipse.uml2.uml.Operation +import static extension org.eclipse.papyrus.qompass.designer.core.UMLTool.* +import static extension org.eclipse.papyrus.qompass.modellibs.core.xtend.CppUtils.* +import org.eclipse.papyrus.qompass.designer.core.EnumService +import org.eclipse.uml2.uml.NamedElement +import org.eclipse.papyrus.qompass.designer.core.extensions.IXtend + +class TraceOTF implements IXtend { + public def traceOp(Operation operation) ''' + // __ + // easier: __ + updateTimestamp (); + if (!hasDeclaredFunctions) { + declareFunctions(); + hasDeclaredFunctions = true; + } + Tracing::TraceInit::wait(); + int processID = Tracing::TraceInit::getProcessID(); + OTF_Writer * writer = Tracing::TraceInit::getWriter(); + OTF_Writer_writeEnter (writer, timestamp.ticks(), «EnumService.enumSvcPrefix»::id_«(operation.owner as NamedElement).varName»_«operation.varName», processID, 0); + OTF_Writer_writeEventComment (writer, timestamp.ticks(), processID, portName); + OTF_Writer_writeEventComment (writer, timestamp.ticks(), processID, instanceName); + Tracing::TraceInit::post(); + «IF (operation.type != null)» type.cppType ret = «ENDIF»rconn->«operation.cppCall»; + updateTimestamp (); + Tracing::TraceInit::wait(); + OTF_Writer_writeLeave (writer, timestamp.ticks(), «EnumService.enumSvcPrefix»::id_«(operation.owner as NamedElement).varName»_«operation.varName», processID, 0); + Tracing::TraceInit::post(); + «IF (operation.type != null)» return ret;«ENDIF» + ''' +} \ No newline at end of file diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceUtils.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceUtils.java new file mode 100644 index 00000000000..7e20fb3019f --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/TraceUtils.java @@ -0,0 +1,45 @@ +package org.eclipse.papyrus.qompass.modellibs.tracing.acceleo; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; +import org.eclipse.papyrus.infra.services.tracepoints.MarkerUtils; +import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; +import org.eclipse.papyrus.qompass.designer.core.transformations.TransformationContext; +import org.eclipse.uml2.uml.Element; + +public class TraceUtils { + + public static IMarker[] getMarkersForEObject(EObject eObject, String markerType) { + Resource resource = eObject.eResource(); + IFile file = WorkspaceSynchronizer.getFile(resource); + if (file != null) { + try { + return file.findMarkers(markerType, true, IResource.DEPTH_INFINITE); + } catch (CoreException e) { + } + } + return new IMarker[0]; + } + + public static boolean hasTrace(Element eObject) { + IMarker markers[] = getMarkersForEObject(eObject, TracepointConstants.tpOrbpMarker); + for (IMarker marker : markers) { + // explicitly pass resourceSet of eObject we want to compare. Otherwise, the marker utils would + // load resources into its own resource set (leading to non-comparable eObjects) + EObject eObjOfMarker = MarkerUtils.getEObjectOfMarker(eObject.eResource().getResourceSet(), marker); + if (eObjOfMarker == eObject) { + return true; + } + } + // TODO: testing workaround (always return true for port based transformations) + if (TransformationContext.getPort() != null) { + return true; + } + return false; + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/xtend-gen/.gitignore b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/xtend-gen/.gitignore new file mode 100644 index 00000000000..c96a04f008e --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/xtend-gen/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/.classpath b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/.classpath new file mode 100644 index 00000000000..098194ca4b7 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/.project b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/.project new file mode 100644 index 00000000000..657d2f7a65c --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.views.tracepoints + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..f42de363afa --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/META-INF/MANIFEST.MF b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..a5d9938325c --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/META-INF/MANIFEST.MF @@ -0,0 +1,25 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.papyrus.infra.services.tracepoints;bundle-version="1.2.0", + org.eclipse.core.resources;bundle-version="3.7.0", + org.eclipse.emf.ecore;bundle-version="2.8.0", + org.eclipse.gef;bundle-version="3.8.0", + org.eclipse.uml2.uml;bundle-version="4.0.0", + org.eclipse.papyrus.infra.core;bundle-version="1.2.0", + org.eclipse.papyrus.infra.widgets;bundle-version="1.2.0", + org.eclipse.emf.transaction;bundle-version="1.4.0", + org.eclipse.gmf.runtime.common.core;bundle-version="1.4.1", + org.eclipse.gmf.runtime.common.ui;bundle-version="1.5.0", + org.eclipse.ui.ide;bundle-version="3.8.100", + org.eclipse.papyrus.infra.services.markerlistener;bundle-version="1.2.0", + org.eclipse.papyrus.infra.services.decoration;bundle-version="1.2.0" +Bundle-Vendor: %pluginProvider +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Localization: plugin +Bundle-Name: %pluginName +Bundle-Activator: org.eclipse.papyrus.views.tracepoints.Activator +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: org.eclipse.papyrus.views.tracepoints;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/about.html b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/about.html new file mode 100644 index 00000000000..209103075a7 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

      About This Content

      + +

      November 14, 2008

      +

      License

      + +

      The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

      + +

      If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

      + + + \ No newline at end of file diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/build.properties b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/build.properties new file mode 100644 index 00000000000..379a4d0a4b0 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + icons/,\ + about.html,\ + plugin.properties +src.includes = about.html diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/breakpoint_view.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/breakpoint_view.gif new file mode 100644 index 00000000000..f529c5a4225 Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/breakpoint_view.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/gotoobj_tsk.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/gotoobj_tsk.gif new file mode 100644 index 00000000000..cf62b63ae3e Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/gotoobj_tsk.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/skip_brkp.gif b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/skip_brkp.gif new file mode 100644 index 00000000000..c1751c3ff4f Binary files /dev/null and b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/icons/skip_brkp.gif differ diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.properties b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.properties new file mode 100644 index 00000000000..b02f21505bc --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Papyrus Tracepoint View (Incubation) +pluginProvider=Eclipse Modeling Project diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.xml b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.xml new file mode 100644 index 00000000000..208df21df9f --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/plugin.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/pom.xml b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/pom.xml new file mode 100644 index 00000000000..ca0d8d002fd --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../../../releng/extra + + org.eclipse.papyrus.views.tracepoints + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/Activator.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/Activator.java new file mode 100644 index 00000000000..9be427595b3 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/Activator.java @@ -0,0 +1,80 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.views.tracepoints; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.views.tracepoints"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + /** + * Returns an image descriptor for the image file at the given + * plug-in relative path + * + * @param path + * the path + * @return the image descriptor + */ + public static ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(PLUGIN_ID, path); + } +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TraceViewImages.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TraceViewImages.java new file mode 100644 index 00000000000..52e0379c5bd --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TraceViewImages.java @@ -0,0 +1,44 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.views.tracepoints.views; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.papyrus.views.tracepoints.Activator; +import org.eclipse.swt.graphics.Image; + + +public class TraceViewImages { + + public static ImageDescriptor getGotoObjID() { + org.eclipse.papyrus.infra.widgets.Activator widgetsActivator = + org.eclipse.papyrus.infra.widgets.Activator.getDefault(); + return widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, "icons/gotoobj_tsk.gif"); + } + + public static ImageDescriptor getSkipAllID() { + org.eclipse.papyrus.infra.widgets.Activator widgetsActivator = + org.eclipse.papyrus.infra.widgets.Activator.getDefault(); + return widgetsActivator.getImageDescriptor(Activator.PLUGIN_ID, "icons/skip_brkp.gif"); + } + + public static Image getSkipAllImage() { + if (skipAllImage == null) { + skipAllImage = getSkipAllID().createImage(); + } + return skipAllImage; + } + + protected static Image skipAllImage = null; +} diff --git a/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TracepointView.java b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TracepointView.java new file mode 100644 index 00000000000..d628a81b917 --- /dev/null +++ b/extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints/src/org/eclipse/papyrus/views/tracepoints/views/TracepointView.java @@ -0,0 +1,540 @@ +/***************************************************************************** + * Copyright (c) 2012 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ansgar Radermacher (CEA LIST) - Initial API and implementation + * + *****************************************************************************/ + +package org.eclipse.papyrus.views.tracepoints.views; + + +import java.util.Map; + +import javax.swing.text.View; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gef.GraphicalEditPart; +import org.eclipse.gmf.runtime.common.ui.resources.FileChangeManager; +import org.eclipse.gmf.runtime.common.ui.resources.IFileObserver; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.util.OpenStrategy; +import org.eclipse.jface.viewers.CheckStateChangedEvent; +import org.eclipse.jface.viewers.CheckboxTableViewer; +import org.eclipse.jface.viewers.DoubleClickEvent; +import org.eclipse.jface.viewers.ICheckStateListener; +import org.eclipse.jface.viewers.ICheckStateProvider; +import org.eclipse.jface.viewers.IDoubleClickListener; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerSorter; +import org.eclipse.papyrus.infra.services.markerlistener.IPapyrusMarker; +import org.eclipse.papyrus.infra.services.tracepoints.MarkerUtils; +import org.eclipse.papyrus.infra.services.tracepoints.TraceFunctions; +import org.eclipse.papyrus.infra.services.tracepoints.TraceState; +import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; +import org.eclipse.papyrus.infra.services.tracepoints.dialogs.TraceActionSelection; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.ISelectionListener; +import org.eclipse.ui.ISharedImages; +import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.ide.IDE; +import org.eclipse.ui.ide.IGotoMarker; +import org.eclipse.ui.part.ViewPart; +import org.eclipse.uml2.uml.Element; +import org.eclipse.uml2.uml.NamedElement; + + +/** + * This sample class demonstrates how to plug-in a new + * workbench view. The view shows data obtained from the + * model. The sample creates a dummy model on the fly, + * but a real implementation would connect to the model + * available either in this or another plug-in (e.g. the workspace). + * The view is connected to the model using a content provider. + *

      + * The view uses a label provider to define how model objects should be presented in the view. Each view can present the same model objects using different labels and icons, if needed. Alternatively, a single label provider can be shared between views in order + * to ensure that objects of the same type are presented in the same way everywhere. + *

      + */ + +public class TracepointView extends ViewPart implements ISelectionListener { + + /** + * The ID of the view as specified by the extension. + */ + public static final String ID = "org.eclipse.papyrus.views.tracepoints.views.Tracepoints"; + + + private CheckboxTableViewer viewer; + + protected Action actionDelete; + + protected Action actionDeleteAll; + + protected Action actionGoto; + + protected Action actionSkip; + + protected Action actionTraceSelect; + + private Action doubleClickAction; + + private IFileObserver fileObserver = null; + + protected TraceActionSelection tas; + + /** + * The content provider class is responsible for + * providing objects to the view. It can wrap + * existing objects in adapters or simply return + * objects as-is. These objects may be sensitive + * to the current input of the view, or ignore + * it and always show the same content + * (like Task List, for example). + */ + class ViewContentProvider implements IStructuredContentProvider { + + @Override + public void inputChanged(Viewer v, Object oldInput, Object newInput) { + } + + @Override + public void dispose() { + } + + @Override + public Object[] getElements(Object parent) { + try { + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + if (root != null) { + return root.findMarkers(TracepointConstants.tpOrbpMarker, true, IResource.DEPTH_INFINITE); + } + } catch (CoreException e) { + } + return new String[] {}; + } + } + + + + class ViewLabelProvider extends LabelProvider implements ITableLabelProvider { + + public ViewLabelProvider() { + this.traceImage = new TraceFunctions(); + } + + @Override + public String getColumnText(Object obj, int index) { + if (obj instanceof IMarker) { + EObject eobj = MarkerUtils.getEObjectOfMarker((IMarker) obj); + if (eobj instanceof NamedElement) { + return ((NamedElement) eobj).getQualifiedName(); + } else if (eobj != null) { + return eobj.toString(); + } + } + return getText(obj); + + } + + @Override + public Image getColumnImage(Object obj, int index) { + if (TraceState.skipAllTracepoints) { + return TraceViewImages.getSkipAllImage(); + } + if (obj instanceof IPapyrusMarker) { + IPapyrusMarker marker = (IPapyrusMarker) obj; + ImageDescriptor id = traceImage.getImageDescriptorForGE(marker); + if (id != null) { + // TODO: leaks! + return id.createImage(); + } + } + return null; + } + + private TraceFunctions traceImage; + } + + class NameSorter extends ViewerSorter { + } + + /** + * The constructor. + */ + public TracepointView() { + } + + /** + * This is a callback that will allow us + * to create the viewer and initialize it. + */ + @Override + public void createPartControl(Composite parent) { + viewer = CheckboxTableViewer.newCheckList(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); + viewer.setContentProvider(new ViewContentProvider()); + viewer.setLabelProvider(new ViewLabelProvider()); + viewer.setCheckStateProvider(new ICheckStateProvider() { + + @Override + public boolean isGrayed(Object element) { + return false; + } + + @Override + public boolean isChecked(Object element) { + if (element instanceof IMarker) { + IMarker marker = (IMarker) element; + return marker.getAttribute(TracepointConstants.isActive, false); + } + return false; + } + }); + + viewer.setSorter(new NameSorter()); + viewer.setInput(getViewSite()); + + getViewSite().getPage().addSelectionListener(this); + + + // Create the help context id for the viewer's control + PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "org.eclipse.papyrus.views.tracepoints.viewer"); + makeActions(); + hookContextMenu(); + hookDoubleClickAction(); + contributeToActionBars(); + viewer.addCheckStateListener(new ICheckStateListener() { + + @Override + public void checkStateChanged(CheckStateChangedEvent event) { + Object element = event.getElement(); + boolean isChecked = event.getChecked(); + if (element instanceof IMarker) { + IMarker marker = (IMarker) element; + try { + marker.setAttribute(TracepointConstants.isActive, isChecked); + switchUI(); + } catch (CoreException e) { + } + } + } + }); + + fileObserver = new IFileObserver() { + + @Override + public void handleMarkerDeleted(IMarker marker, @SuppressWarnings("rawtypes") Map attributes) { + switchUI(); + } + + @Override + public void handleMarkerChanged(IMarker marker) { + switchUI(); + } + + @Override + public void handleMarkerAdded(IMarker marker) { + switchUI(); + } + + // TODO need to handle? + @Override + public void handleFileRenamed(IFile oldFile, IFile file) { + } + + @Override + public void handleFileMoved(IFile oldFile, IFile file) { + } + + @Override + public void handleFileDeleted(IFile file) { + } + + @Override + public void handleFileChanged(IFile file) { + } + }; + + FileChangeManager.getInstance().addFileObserver(fileObserver); + } + + @Override + public void dispose() { + if (fileObserver != null) { + FileChangeManager.getInstance().addFileObserver(fileObserver); + } + super.dispose(); + } + + public void switchUI() { + Display.getDefault().asyncExec(new Runnable() { + + @Override + public void run() { + // ... do any work that updates the screen ... + viewer.refresh(); + } + }); + } + + private void hookContextMenu() { + MenuManager menuMgr = new MenuManager("#PopupMenu"); + menuMgr.setRemoveAllWhenShown(true); + menuMgr.addMenuListener(new IMenuListener() { + + @Override + public void menuAboutToShow(IMenuManager manager) { + TracepointView.this.fillContextMenu(manager); + } + }); + Menu menu = menuMgr.createContextMenu(viewer.getControl()); + viewer.getControl().setMenu(menu); + getSite().registerContextMenu(menuMgr, viewer); + } + + private void contributeToActionBars() { + IActionBars bars = getViewSite().getActionBars(); + fillLocalPullDown(bars.getMenuManager()); + fillLocalToolBar(bars.getToolBarManager()); + } + + protected void fillLocalPullDown(IMenuManager manager) { + manager.add(actionDelete); + manager.add(new Separator()); + manager.add(actionGoto); + } + + protected void fillContextMenu(IMenuManager manager) { + manager.add(actionDelete); + manager.add(actionGoto); + // Other plug-ins can contribute there actions here + manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); + } + + protected void fillLocalToolBar(IToolBarManager manager) { + manager.add(actionDelete); + manager.add(actionDeleteAll); + manager.add(actionGoto); + manager.add(actionSkip); + manager.add(actionTraceSelect); + } + + protected void makeActions() { + actionSkip = new Action("Skip all", IAction.AS_CHECK_BOX) { + + @Override + public void run() { + TraceState.skipAllTracepoints = !TraceState.skipAllTracepoints; + switchUI(); + } + }; + actionSkip.setChecked(TraceState.skipAllTracepoints); + + actionSkip.setImageDescriptor(TraceViewImages.getSkipAllID()); + actionSkip.setToolTipText("Toggle skipping all trace/break points"); + + actionDelete = new Action("Delete") { + + @Override + public void run() { + ISelection selection = viewer.getSelection(); + Object obj = ((IStructuredSelection) selection).getFirstElement(); + if (obj instanceof IMarker) { + IMarker marker = (IMarker) obj; + try { + marker.delete(); + } catch (CoreException e) { + } + } + } + }; + actionDelete.setToolTipText("Delete trace/breakpoint"); + actionDelete.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ELCL_REMOVE)); + + actionDeleteAll = new Action() { + + @Override + public void run() { + + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + if (root != null) { + try { + root.deleteMarkers(TracepointConstants.tpOrbpMarker, true, 0); + } catch (CoreException e) { + } + } + } + }; + actionDeleteAll.setText("Delete all"); + actionDeleteAll.setToolTipText("Delete all trace/breakpoint"); + actionDeleteAll.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_ELCL_REMOVEALL)); + + actionGoto = new Action() { + + @Override + public void run() { + ISelection selection = viewer.getSelection(); + Object obj = ((IStructuredSelection) selection).getFirstElement(); + if (obj instanceof IMarker) { + IMarker marker = (IMarker) obj; + boolean onlyNavigatoToActiveEditor = false; + IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + if (onlyNavigatoToActiveEditor) { + IEditorPart part = activePage.getActiveEditor(); + if (part instanceof IGotoMarker) { + ((IGotoMarker) part).gotoMarker(marker); + } + } else { + try { + IDE.openEditor(activePage, marker, OpenStrategy.activateOnOpen()); + } catch (PartInitException e) { + + } + } + } + } + }; + actionGoto.setText("Goto"); + actionGoto.setToolTipText("Navigate to trace/breakpoint"); + actionGoto.setImageDescriptor(TraceViewImages.getGotoObjID()); + doubleClickAction = actionGoto; + + actionTraceSelect = new Action() { + + @Override + public void run() { + ISelection selection = viewer.getSelection(); + Object obj = ((IStructuredSelection) selection).getFirstElement(); + if (obj instanceof IMarker) { + // EditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(input, null); + IMarker marker = (IMarker) obj; + EObject eobj = MarkerUtils.getEObjectOfMarker(marker); + if (eobj instanceof Element) { + TraceActionSelection tad = new TraceActionSelection(Display.getDefault().getActiveShell(), (IMarker) obj, (Element) eobj); + tad.open(); + if (tad.getReturnCode() == IDialogConstants.OK_ID) { + Object[] result = tad.getResult(); + int traceAction = (Integer) result[0]; + String traceMechanism = (String) result[1]; + try { + marker.setAttribute(TracepointConstants.traceAction, traceAction); + marker.setAttribute(TracepointConstants.traceMechanism, traceMechanism); + } catch (CoreException e) { + } + } + } + } + } + + }; + actionTraceSelect.setText("trace action"); + actionTraceSelect.setToolTipText("Select trace action"); + actionTraceSelect.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD)); + } + + protected void hookDoubleClickAction() { + viewer.addDoubleClickListener(new IDoubleClickListener() { + + @Override + public void doubleClick(DoubleClickEvent event) { + doubleClickAction.run(); + } + }); + } + + /** + * Passing the focus request to the viewer's control. + */ + @Override + public void setFocus() { + viewer.getControl().setFocus(); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, + * org.eclipse.jface.viewers.ISelection) + */ + // TODO: function not used currently + @Override + public void selectionChanged(IWorkbenchPart part, ISelection selection) { + + IStructuredSelection sSelection = null; + if (selection instanceof IStructuredSelection) { + sSelection = (IStructuredSelection) selection; + } + + // exclude case of an empty selection which is not a Tree selection, since changing views provokes an + // empty selection (selection gets lost, although same element remains selected) + if ((selection != null) && (sSelection != null) && sSelection.isEmpty()) { + return; + } + currentElement = null; + + // No available selection: switch to default panel + if ((sSelection == null) || (sSelection.size() != 1)) { + switchUI(); + return; + } + + // Retrieve selected object + Object currentObject = sSelection.getFirstElement(); + // If the object is an edit part, try to get semantic bridge + if (currentObject instanceof GraphicalEditPart) { + GraphicalEditPart editPart = (GraphicalEditPart) currentObject; + if (editPart.getModel() instanceof View) { + View view = (View) editPart.getModel(); + if (view.getElement() instanceof Element) { + currentObject = view.getElement(); + } + } + } else if (currentObject instanceof IAdaptable) { + // modisco ModelElementItem supports IAdaptable (cleaner than cast / dependency with modisco) + currentObject = ((IAdaptable) currentObject).getAdapter(EObject.class); + } + + if (currentObject instanceof Element) { + currentElement = (Element) currentObject; + // switchUI(); + } + } + + protected Element currentElement; +} diff --git a/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.classpath b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.classpath new file mode 100644 index 00000000000..098194ca4b7 --- /dev/null +++ b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.project b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.project new file mode 100644 index 00000000000..63174709d26 --- /dev/null +++ b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.project @@ -0,0 +1,28 @@ + + + org.eclipse.papyrus.qompass.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.settings/org.eclipse.jdt.core.prefs b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..94d61f00da6 --- /dev/null +++ b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,291 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=260 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=260 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=5 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.settings/org.eclipse.jdt.ui.prefs b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..954281dbc31 --- /dev/null +++ b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,68 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup.use_type_arguments=false +cleanup_profile=_Papyrus +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_Papyrus +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/META-INF/MANIFEST.MF b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..950b3e10c67 --- /dev/null +++ b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.uml2.uml;bundle-version="4.0.2", + org.eclipse.core.filesystem;bundle-version="1.3.200", + org.eclipse.core.resources;bundle-version="3.9.1", + org.eclipse.papyrus.infra.core;bundle-version="1.2.0", + org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0", + org.eclipse.papyrus.infra.emf;bundle-version="1.2.0", + org.eclipse.emf.transaction;bundle-version="1.8.0" +Export-Package: org.eclipse.papyrus.qompass.ui +Bundle-Vendor: %providerName +Bundle-ActivationPolicy: lazy +Bundle-Version: 1.2.0.qualifier +Bundle-Name: %pluginName +Bundle-Localization: plugin +Bundle-ManifestVersion: 2 +Bundle-Activator: org.eclipse.papyrus.qompass.ui.Activator +Bundle-SymbolicName: org.eclipse.papyrus.qompass.ui;singleton:=true +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 diff --git a/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/about.html b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/about.html new file mode 100644 index 00000000000..82d49bf5f81 --- /dev/null +++ b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

      About This Content

      + +

      June 5, 2007

      +

      License

      + +

      The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

      + +

      If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

      + + + diff --git a/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/build.properties b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/build.properties new file mode 100644 index 00000000000..6c551f66003 --- /dev/null +++ b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + about.html,\ + plugin.properties,\ + plugin.xml,\ + icons/ +src.includes = about.html diff --git a/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/icons/qompass-16x16.gif b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/icons/qompass-16x16.gif new file mode 100644 index 00000000000..c47d52ad211 Binary files /dev/null and b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/icons/qompass-16x16.gif differ diff --git a/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/plugin.properties b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/plugin.properties new file mode 100644 index 00000000000..1e85d2491da --- /dev/null +++ b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +pluginName=Basic code-generation functions (Incubation) +providerName=Eclipse Modeling Project diff --git a/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/plugin.xml b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/plugin.xml new file mode 100644 index 00000000000..02f515567bf --- /dev/null +++ b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/plugin.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/pom.xml b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/pom.xml new file mode 100644 index 00000000000..565d394a597 --- /dev/null +++ b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../releng/extra + + org.eclipse.papyrus.qompass.ui + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-plugin + diff --git a/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/src/org/eclipse/papyrus/qompass/ui/Activator.java b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/src/org/eclipse/papyrus/qompass/ui/Activator.java new file mode 100644 index 00000000000..0ca60ed8fae --- /dev/null +++ b/extraplugins/qompass/org.eclipse.papyrus.qompass.ui/src/org/eclipse/papyrus/qompass/ui/Activator.java @@ -0,0 +1,44 @@ +package org.eclipse.papyrus.qompass.ui; + +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator implements BundleActivator { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.qompass.ui"; //$NON-NLS-1$ + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + public static LogHelper log; + + /* + * (non-Javadoc) + * + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + */ + @Override + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + log = new LogHelper(); + } + + /* + * (non-Javadoc) + * + * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + @Override + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + log = null; + } +} diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/.project b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/.project new file mode 100644 index 00000000000..0c0c76c63e7 --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/.project @@ -0,0 +1,17 @@ + + + org.eclipse.papyrus.extra.codegen.cpp.feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/build.properties b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/build.properties new file mode 100644 index 00000000000..cff2bd50c57 --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/build.properties @@ -0,0 +1,6 @@ +bin.includes = feature.xml,\ + epl-v10.html,\ + license.html,\ + feature.properties +src.includes = epl-v10.html,\ + license.html diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/epl-v10.html b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/epl-v10.html new file mode 100644 index 00000000000..cb1073a4bad --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/epl-v10.html @@ -0,0 +1,304 @@ + + + + + + +Eclipse Public License - Version 1.0 + + + + + +
      + +

      Eclipse Public License - v 1.0 +

      + +

      THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.

      + +

      1. DEFINITIONS

      + +

      "Contribution" means:

      + +

      a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and
      +b) in the case of each subsequent Contributor:

      + +

      i) +changes to the Program, and

      + +

      ii) +additions to the Program;

      + +

      where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program.

      + +

      "Contributor" means any person or +entity that distributes the Program.

      + +

      "Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program.

      + +

      "Program" means the Contributions +distributed in accordance with this Agreement.

      + +

      "Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.

      + +

      2. GRANT OF RIGHTS

      + +

      a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.

      + +

      b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder.

      + +

      c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.

      + +

      d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement.

      + +

      3. REQUIREMENTS

      + +

      A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that: +

      + +

      a) +it complies with the terms and conditions of this Agreement; and

      + +

      b) +its license agreement:

      + +

      i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose;

      + +

      ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits;

      + +

      iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and

      + +

      iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.

      + +

      When the Program is made available in source +code form:

      + +

      a) +it must be made available under this Agreement; and

      + +

      b) a +copy of this Agreement must be included with each copy of the Program.

      + +

      Contributors may not remove or alter any +copyright notices contained within the Program.

      + +

      Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution.

      + +

      4. COMMERCIAL DISTRIBUTION

      + +

      Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.

      + +

      For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.

      + +

      5. NO WARRANTY

      + +

      EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations.

      + +

      6. DISCLAIMER OF LIABILITY

      + +

      EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.

      + +

      7. GENERAL

      + +

      If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.

      + +

      If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed.

      + +

      All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive.

      + +

      Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.

      + +

      This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.

      + +

      + +
      + + + + \ No newline at end of file diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/feature.properties b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/feature.properties new file mode 100644 index 00000000000..0defcd92ec8 --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/feature.properties @@ -0,0 +1,143 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +featureName=Papyrus C++ profile, view and code generation (Incubation) +providerName=Eclipse Modeling Project + +# "licenseURL" property - URL of the "Feature License" +# do not translate value - just change to point to a locale-specific HTML page +licenseURL=license.html + +# "license" property - text of the "Feature Update License" +# should be plain text version of license agreement pointed to be "licenseURL" +license=\ +Eclipse Foundation Software User Agreement\n\ +April 9, 2014\n\ +\n\ +Usage Of Content\n\ +\n\ +THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ +OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ +USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ +AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ +NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ +AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ +AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ +OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ +TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ +OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ +BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ +\n\ +Applicable Licenses\n\ +\n\ +Unless otherwise indicated, all Content made available by the\n\ +Eclipse Foundation is provided to you under the terms and conditions of\n\ +the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ +provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ +For purposes of the EPL, "Program" will mean the Content.\n\ +\n\ +Content includes, but is not limited to, source code, object code,\n\ +documentation and other files maintained in the Eclipse Foundation source code\n\ +repository ("Repository") in software modules ("Modules") and made available\n\ +as downloadable archives ("Downloads").\n\ +\n\ +\t- Content may be structured and packaged into modules to facilitate delivering,\n\ +\t extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ +\t plug-in fragments ("Fragments"), and features ("Features").\n\ +\t- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ +\t in a directory named "plugins".\n\ +\t- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ +\t Each Feature may be packaged as a sub-directory in a directory named "features".\n\ +\t Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ +\t numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ +\t- Features may also include other Features ("Included Features"). Within a Feature, files\n\ +\t named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ +\n\ +The terms and conditions governing Plug-ins and Fragments should be\n\ +contained in files named "about.html" ("Abouts"). The terms and\n\ +conditions governing Features and Included Features should be contained\n\ +in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ +Licenses may be located in any directory of a Download or Module\n\ +including, but not limited to the following locations:\n\ +\n\ +\t- The top-level (root) directory\n\ +\t- Plug-in and Fragment directories\n\ +\t- Inside Plug-ins and Fragments packaged as JARs\n\ +\t- Sub-directories of the directory named "src" of certain Plug-ins\n\ +\t- Feature directories\n\ +\n\ +Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ +Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ +Update License") during the installation process. If the Feature contains\n\ +Included Features, the Feature Update License should either provide you\n\ +with the terms and conditions governing the Included Features or inform\n\ +you where you can locate them. Feature Update Licenses may be found in\n\ +the "license" property of files named "feature.properties" found within a Feature.\n\ +Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ +terms and conditions (or references to such terms and conditions) that\n\ +govern your use of the associated Content in that directory.\n\ +\n\ +THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ +TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ +SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ +\n\ +\t- Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ +\t- Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ +\t- Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ +\t- Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ +\t- Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ +\n\ +IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ +TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ +is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ +govern that particular Content.\n\ +\n\ +\n\Use of Provisioning Technology\n\ +\n\ +The Eclipse Foundation makes available provisioning software, examples of which include,\n\ +but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ +the purpose of allowing users to install software, documentation, information and/or\n\ +other materials (collectively "Installable Software"). This capability is provided with\n\ +the intent of allowing such users to install, extend and update Eclipse-based products.\n\ +Information about packaging Installable Software is available at\n\ +http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ +\n\ +You may use Provisioning Technology to allow other parties to install Installable Software.\n\ +You shall be responsible for enabling the applicable license agreements relating to the\n\ +Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ +in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ +making it available in accordance with the Specification, you further acknowledge your\n\ +agreement to, and the acquisition of all necessary rights to permit the following:\n\ +\n\ +\t1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ +\t the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ +\t extending or updating the functionality of an Eclipse-based product.\n\ +\t2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ +\t Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ +\t3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ +\t govern the use of the Installable Software ("Installable Software Agreement") and such\n\ +\t Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ +\t with the Specification. Such Installable Software Agreement must inform the user of the\n\ +\t terms and conditions that govern the Installable Software and must solicit acceptance by\n\ +\t the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ +\t indication of agreement by the user, the provisioning Technology will complete installation\n\ +\t of the Installable Software.\n\ +\n\ +Cryptography\n\ +\n\ +Content may contain encryption software. The country in which you are\n\ +currently may have restrictions on the import, possession, and use,\n\ +and/or re-export to another country, of encryption software. BEFORE\n\ +using any encryption software, please check the country's laws,\n\ +regulations and policies concerning the import, possession, or use, and\n\ +re-export of encryption software, to see if this is permitted.\n\ +\n\ +Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n +########### end of license property ########################################## diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/feature.xml b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/feature.xml new file mode 100644 index 00000000000..8ddae27aa42 --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/feature.xml @@ -0,0 +1,107 @@ + + + + + C++ code generation from Papyrus. The feature includes +- A C++ profile, enabling the specification for C++ features, for instance: pointers, friends, constructor initializers +- A code generator from UML enriched with the C++ profile +- A C++ view allowing simple editing of opaque behaviors and manipulation of C++ profile attributes +- An experimental CDT integration + + + + Copyright (c) 2012 CEA LIST +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License +v1.0 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl-v10.html + + + + %license + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/license.html b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/license.html new file mode 100644 index 00000000000..0fd3dd13aac --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/license.html @@ -0,0 +1,107 @@ + + + + + +Eclipse Foundation Software User Agreement + + + +

      Eclipse Foundation Software User Agreement

      +

      April 9, 2014

      + +

      Usage Of Content

      + +

      THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE + OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR + NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND + CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.

      + +

      Applicable Licenses

      + +

      Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 + ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html. + For purposes of the EPL, "Program" will mean the Content.

      + +

      Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code + repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").

      + +
        +
      • Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").
      • +
      • Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".
      • +
      • A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins + and/or Fragments associated with that Feature.
      • +
      • Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.
      • +
      + +

      The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and +Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module +including, but not limited to the following locations:

      + +
        +
      • The top-level (root) directory
      • +
      • Plug-in and Fragment directories
      • +
      • Inside Plug-ins and Fragments packaged as JARs
      • +
      • Sub-directories of the directory named "src" of certain Plug-ins
      • +
      • Feature directories
      • +
      + +

      Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the +installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or +inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature. +Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in +that directory.

      + +

      THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE +OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):

      + + + +

      IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please +contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.

      + + +

      Use of Provisioning Technology

      + +

      The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about packaging Installable Software is available at http://eclipse.org/equinox/p2/repository_packaging.html + ("Specification").

      + +

      You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology + in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the + Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:

      + +
        +
      1. A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based + product.
      2. +
      3. During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.
      4. +
      5. Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern + the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such + indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.
      6. +
      + +

      Cryptography

      + +

      Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to + another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, + possession, or use, and re-export of encryption software, to see if this is permitted.

      + +

      Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.

      + + diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/pom.xml b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/pom.xml new file mode 100644 index 00000000000..b6266e92efe --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../releng/extra + + org.eclipse.papyrus.extra.codegen.cpp.feature + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-feature + diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/.project b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/.project new file mode 100644 index 00000000000..ffde1a35948 --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/.project @@ -0,0 +1,17 @@ + + + org.eclipse.papyrus.extra.codegen.feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/build.properties b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/build.properties new file mode 100644 index 00000000000..cff2bd50c57 --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/build.properties @@ -0,0 +1,6 @@ +bin.includes = feature.xml,\ + epl-v10.html,\ + license.html,\ + feature.properties +src.includes = epl-v10.html,\ + license.html diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/epl-v10.html b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/epl-v10.html new file mode 100644 index 00000000000..cb1073a4bad --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/epl-v10.html @@ -0,0 +1,304 @@ + + + + + + +Eclipse Public License - Version 1.0 + + + + + +
      + +

      Eclipse Public License - v 1.0 +

      + +

      THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.

      + +

      1. DEFINITIONS

      + +

      "Contribution" means:

      + +

      a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and
      +b) in the case of each subsequent Contributor:

      + +

      i) +changes to the Program, and

      + +

      ii) +additions to the Program;

      + +

      where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program.

      + +

      "Contributor" means any person or +entity that distributes the Program.

      + +

      "Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program.

      + +

      "Program" means the Contributions +distributed in accordance with this Agreement.

      + +

      "Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.

      + +

      2. GRANT OF RIGHTS

      + +

      a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.

      + +

      b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder.

      + +

      c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.

      + +

      d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement.

      + +

      3. REQUIREMENTS

      + +

      A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that: +

      + +

      a) +it complies with the terms and conditions of this Agreement; and

      + +

      b) +its license agreement:

      + +

      i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose;

      + +

      ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits;

      + +

      iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and

      + +

      iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.

      + +

      When the Program is made available in source +code form:

      + +

      a) +it must be made available under this Agreement; and

      + +

      b) a +copy of this Agreement must be included with each copy of the Program.

      + +

      Contributors may not remove or alter any +copyright notices contained within the Program.

      + +

      Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution.

      + +

      4. COMMERCIAL DISTRIBUTION

      + +

      Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.

      + +

      For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.

      + +

      5. NO WARRANTY

      + +

      EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations.

      + +

      6. DISCLAIMER OF LIABILITY

      + +

      EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.

      + +

      7. GENERAL

      + +

      If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.

      + +

      If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed.

      + +

      All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive.

      + +

      Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.

      + +

      This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.

      + +

      + +
      + + + + \ No newline at end of file diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/feature.properties b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/feature.properties new file mode 100644 index 00000000000..c4dc0e1e27f --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/feature.properties @@ -0,0 +1,143 @@ +############################################################################### +# Copyright (c) 2013 CEA LIST. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# CEA LIST - initial API and implementation +############################################################################### +featureName=Papyrus base elements for code generation (Incubation) +providerName=Eclipse Modeling Project + +# "licenseURL" property - URL of the "Feature License" +# do not translate value - just change to point to a locale-specific HTML page +licenseURL=license.html + +# "license" property - text of the "Feature Update License" +# should be plain text version of license agreement pointed to be "licenseURL" +license=\ +Eclipse Foundation Software User Agreement\n\ +April 9, 2014\n\ +\n\ +Usage Of Content\n\ +\n\ +THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ +OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ +USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ +AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ +NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ +AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ +AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ +OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ +TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ +OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ +BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ +\n\ +Applicable Licenses\n\ +\n\ +Unless otherwise indicated, all Content made available by the\n\ +Eclipse Foundation is provided to you under the terms and conditions of\n\ +the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ +provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ +For purposes of the EPL, "Program" will mean the Content.\n\ +\n\ +Content includes, but is not limited to, source code, object code,\n\ +documentation and other files maintained in the Eclipse Foundation source code\n\ +repository ("Repository") in software modules ("Modules") and made available\n\ +as downloadable archives ("Downloads").\n\ +\n\ +\t- Content may be structured and packaged into modules to facilitate delivering,\n\ +\t extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ +\t plug-in fragments ("Fragments"), and features ("Features").\n\ +\t- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ +\t in a directory named "plugins".\n\ +\t- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ +\t Each Feature may be packaged as a sub-directory in a directory named "features".\n\ +\t Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ +\t numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ +\t- Features may also include other Features ("Included Features"). Within a Feature, files\n\ +\t named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ +\n\ +The terms and conditions governing Plug-ins and Fragments should be\n\ +contained in files named "about.html" ("Abouts"). The terms and\n\ +conditions governing Features and Included Features should be contained\n\ +in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ +Licenses may be located in any directory of a Download or Module\n\ +including, but not limited to the following locations:\n\ +\n\ +\t- The top-level (root) directory\n\ +\t- Plug-in and Fragment directories\n\ +\t- Inside Plug-ins and Fragments packaged as JARs\n\ +\t- Sub-directories of the directory named "src" of certain Plug-ins\n\ +\t- Feature directories\n\ +\n\ +Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ +Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ +Update License") during the installation process. If the Feature contains\n\ +Included Features, the Feature Update License should either provide you\n\ +with the terms and conditions governing the Included Features or inform\n\ +you where you can locate them. Feature Update Licenses may be found in\n\ +the "license" property of files named "feature.properties" found within a Feature.\n\ +Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ +terms and conditions (or references to such terms and conditions) that\n\ +govern your use of the associated Content in that directory.\n\ +\n\ +THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ +TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ +SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ +\n\ +\t- Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ +\t- Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ +\t- Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ +\t- Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ +\t- Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ +\n\ +IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ +TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ +is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ +govern that particular Content.\n\ +\n\ +\n\Use of Provisioning Technology\n\ +\n\ +The Eclipse Foundation makes available provisioning software, examples of which include,\n\ +but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ +the purpose of allowing users to install software, documentation, information and/or\n\ +other materials (collectively "Installable Software"). This capability is provided with\n\ +the intent of allowing such users to install, extend and update Eclipse-based products.\n\ +Information about packaging Installable Software is available at\n\ +http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ +\n\ +You may use Provisioning Technology to allow other parties to install Installable Software.\n\ +You shall be responsible for enabling the applicable license agreements relating to the\n\ +Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ +in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ +making it available in accordance with the Specification, you further acknowledge your\n\ +agreement to, and the acquisition of all necessary rights to permit the following:\n\ +\n\ +\t1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ +\t the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ +\t extending or updating the functionality of an Eclipse-based product.\n\ +\t2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ +\t Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ +\t3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ +\t govern the use of the Installable Software ("Installable Software Agreement") and such\n\ +\t Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ +\t with the Specification. Such Installable Software Agreement must inform the user of the\n\ +\t terms and conditions that govern the Installable Software and must solicit acceptance by\n\ +\t the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ +\t indication of agreement by the user, the provisioning Technology will complete installation\n\ +\t of the Installable Software.\n\ +\n\ +Cryptography\n\ +\n\ +Content may contain encryption software. The country in which you are\n\ +currently may have restrictions on the import, possession, and use,\n\ +and/or re-export to another country, of encryption software. BEFORE\n\ +using any encryption software, please check the country's laws,\n\ +regulations and policies concerning the import, possession, or use, and\n\ +re-export of encryption software, to see if this is permitted.\n\ +\n\ +Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n +########### end of license property ########################################## diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/feature.xml b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/feature.xml new file mode 100644 index 00000000000..b296a9d4189 --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/feature.xml @@ -0,0 +1,56 @@ + + + + + Base elements for code generation +- Extension points +- Manage file location (in which folders are generated files placed) +- Support for text editors in model explorer + + + + Copyright (c) 2012 CEA LIST +All rights reserved. This program and the accompanying materials +are made available under the terms of the Eclipse Public License +v1.0 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl-v10.html + + + + %license + + + + + + + + + + + diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/license.html b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/license.html new file mode 100644 index 00000000000..0fd3dd13aac --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/license.html @@ -0,0 +1,107 @@ + + + + + +Eclipse Foundation Software User Agreement + + + +

      Eclipse Foundation Software User Agreement

      +

      April 9, 2014

      + +

      Usage Of Content

      + +

      THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE + OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR + NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND + CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.

      + +

      Applicable Licenses

      + +

      Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 + ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html. + For purposes of the EPL, "Program" will mean the Content.

      + +

      Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code + repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").

      + +
        +
      • Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").
      • +
      • Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".
      • +
      • A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins + and/or Fragments associated with that Feature.
      • +
      • Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.
      • +
      + +

      The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and +Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module +including, but not limited to the following locations:

      + +
        +
      • The top-level (root) directory
      • +
      • Plug-in and Fragment directories
      • +
      • Inside Plug-ins and Fragments packaged as JARs
      • +
      • Sub-directories of the directory named "src" of certain Plug-ins
      • +
      • Feature directories
      • +
      + +

      Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the +installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or +inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature. +Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in +that directory.

      + +

      THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE +OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):

      + + + +

      IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please +contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.

      + + +

      Use of Provisioning Technology

      + +

      The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about packaging Installable Software is available at http://eclipse.org/equinox/p2/repository_packaging.html + ("Specification").

      + +

      You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology + in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the + Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:

      + +
        +
      1. A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based + product.
      2. +
      3. During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.
      4. +
      5. Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern + the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such + indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.
      6. +
      + +

      Cryptography

      + +

      Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to + another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, + possession, or use, and re-export of encryption software, to see if this is permitted.

      + +

      Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.

      + + diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/pom.xml b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/pom.xml new file mode 100644 index 00000000000..a9404e66e7b --- /dev/null +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + org.eclipse.papyrus.extra.releng + org.eclipse.papyrus + 1.2.0-SNAPSHOT + ../../../releng/extra + + org.eclipse.papyrus.extra.codegen.feature + org.eclipse.papyrus + 1.2.0-SNAPSHOT + eclipse-feature + diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/.project b/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/.project deleted file mode 100644 index 8bcfc0d3202..00000000000 --- a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - org.eclipse.papyrus.extra.cpp.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/build.properties b/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/build.properties deleted file mode 100644 index cff2bd50c57..00000000000 --- a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -bin.includes = feature.xml,\ - epl-v10.html,\ - license.html,\ - feature.properties -src.includes = epl-v10.html,\ - license.html diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/epl-v10.html b/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/epl-v10.html deleted file mode 100644 index cb1073a4bad..00000000000 --- a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/epl-v10.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - -Eclipse Public License - Version 1.0 - - - - - -
      - -

      Eclipse Public License - v 1.0 -

      - -

      THE ACCOMPANYING PROGRAM IS PROVIDED UNDER -THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, -REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE -OF THIS AGREEMENT.

      - -

      1. DEFINITIONS

      - -

      "Contribution" means:

      - -

      a) -in the case of the initial Contributor, the initial code and documentation -distributed under this Agreement, and
      -b) in the case of each subsequent Contributor:

      - -

      i) -changes to the Program, and

      - -

      ii) -additions to the Program;

      - -

      where -such changes and/or additions to the Program originate from and are distributed -by that particular Contributor. A Contribution 'originates' from a Contributor -if it was added to the Program by such Contributor itself or anyone acting on -such Contributor's behalf. Contributions do not include additions to the -Program which: (i) are separate modules of software distributed in conjunction -with the Program under their own license agreement, and (ii) are not derivative -works of the Program.

      - -

      "Contributor" means any person or -entity that distributes the Program.

      - -

      "Licensed Patents " mean patent -claims licensable by a Contributor which are necessarily infringed by the use -or sale of its Contribution alone or when combined with the Program.

      - -

      "Program" means the Contributions -distributed in accordance with this Agreement.

      - -

      "Recipient" means anyone who -receives the Program under this Agreement, including all Contributors.

      - -

      2. GRANT OF RIGHTS

      - -

      a) -Subject to the terms of this Agreement, each Contributor hereby grants Recipient -a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly -display, publicly perform, distribute and sublicense the Contribution of such -Contributor, if any, and such derivative works, in source code and object code -form.

      - -

      b) -Subject to the terms of this Agreement, each Contributor hereby grants -Recipient a non-exclusive, worldwide, royalty-free -patent license under Licensed Patents to make, use, sell, offer to sell, import -and otherwise transfer the Contribution of such Contributor, if any, in source -code and object code form. This patent license shall apply to the combination -of the Contribution and the Program if, at the time the Contribution is added -by the Contributor, such addition of the Contribution causes such combination -to be covered by the Licensed Patents. The patent license shall not apply to -any other combinations which include the Contribution. No hardware per se is -licensed hereunder.

      - -

      c) -Recipient understands that although each Contributor grants the licenses to its -Contributions set forth herein, no assurances are provided by any Contributor -that the Program does not infringe the patent or other intellectual property -rights of any other entity. Each Contributor disclaims any liability to Recipient -for claims brought by any other entity based on infringement of intellectual -property rights or otherwise. As a condition to exercising the rights and -licenses granted hereunder, each Recipient hereby assumes sole responsibility -to secure any other intellectual property rights needed, if any. For example, -if a third party patent license is required to allow Recipient to distribute -the Program, it is Recipient's responsibility to acquire that license before -distributing the Program.

      - -

      d) -Each Contributor represents that to its knowledge it has sufficient copyright -rights in its Contribution, if any, to grant the copyright license set forth in -this Agreement.

      - -

      3. REQUIREMENTS

      - -

      A Contributor may choose to distribute the -Program in object code form under its own license agreement, provided that: -

      - -

      a) -it complies with the terms and conditions of this Agreement; and

      - -

      b) -its license agreement:

      - -

      i) -effectively disclaims on behalf of all Contributors all warranties and -conditions, express and implied, including warranties or conditions of title -and non-infringement, and implied warranties or conditions of merchantability -and fitness for a particular purpose;

      - -

      ii) -effectively excludes on behalf of all Contributors all liability for damages, -including direct, indirect, special, incidental and consequential damages, such -as lost profits;

      - -

      iii) -states that any provisions which differ from this Agreement are offered by that -Contributor alone and not by any other party; and

      - -

      iv) -states that source code for the Program is available from such Contributor, and -informs licensees how to obtain it in a reasonable manner on or through a -medium customarily used for software exchange.

      - -

      When the Program is made available in source -code form:

      - -

      a) -it must be made available under this Agreement; and

      - -

      b) a -copy of this Agreement must be included with each copy of the Program.

      - -

      Contributors may not remove or alter any -copyright notices contained within the Program.

      - -

      Each Contributor must identify itself as the -originator of its Contribution, if any, in a manner that reasonably allows -subsequent Recipients to identify the originator of the Contribution.

      - -

      4. COMMERCIAL DISTRIBUTION

      - -

      Commercial distributors of software may -accept certain responsibilities with respect to end users, business partners -and the like. While this license is intended to facilitate the commercial use -of the Program, the Contributor who includes the Program in a commercial -product offering should do so in a manner which does not create potential -liability for other Contributors. Therefore, if a Contributor includes the -Program in a commercial product offering, such Contributor ("Commercial -Contributor") hereby agrees to defend and indemnify every other -Contributor ("Indemnified Contributor") against any losses, damages and -costs (collectively "Losses") arising from claims, lawsuits and other -legal actions brought by a third party against the Indemnified Contributor to -the extent caused by the acts or omissions of such Commercial Contributor in -connection with its distribution of the Program in a commercial product -offering. The obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. In order -to qualify, an Indemnified Contributor must: a) promptly notify the Commercial -Contributor in writing of such claim, and b) allow the Commercial Contributor -to control, and cooperate with the Commercial Contributor in, the defense and -any related settlement negotiations. The Indemnified Contributor may participate -in any such claim at its own expense.

      - -

      For example, a Contributor might include the -Program in a commercial product offering, Product X. That Contributor is then a -Commercial Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance claims and -warranties are such Commercial Contributor's responsibility alone. Under this -section, the Commercial Contributor would have to defend claims against the -other Contributors related to those performance claims and warranties, and if a -court requires any other Contributor to pay any damages as a result, the -Commercial Contributor must pay those damages.

      - -

      5. NO WARRANTY

      - -

      EXCEPT AS EXPRESSLY SET FORTH IN THIS -AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, -WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, -MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and distributing the -Program and assumes all risks associated with its exercise of rights under this -Agreement , including but not limited to the risks and costs of program errors, -compliance with applicable laws, damage to or loss of data, programs or -equipment, and unavailability or interruption of operations.

      - -

      6. DISCLAIMER OF LIABILITY

      - -

      EXCEPT AS EXPRESSLY SET FORTH IN THIS -AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF -THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGES.

      - -

      7. GENERAL

      - -

      If any provision of this Agreement is invalid -or unenforceable under applicable law, it shall not affect the validity or -enforceability of the remainder of the terms of this Agreement, and without -further action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable.

      - -

      If Recipient institutes patent litigation -against any entity (including a cross-claim or counterclaim in a lawsuit) -alleging that the Program itself (excluding combinations of the Program with -other software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of the date -such litigation is filed.

      - -

      All Recipient's rights under this Agreement -shall terminate if it fails to comply with any of the material terms or -conditions of this Agreement and does not cure such failure in a reasonable -period of time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use and -distribution of the Program as soon as reasonably practicable. However, -Recipient's obligations under this Agreement and any licenses granted by -Recipient relating to the Program shall continue and survive.

      - -

      Everyone is permitted to copy and distribute -copies of this Agreement, but in order to avoid inconsistency the Agreement is -copyrighted and may only be modified in the following manner. The Agreement -Steward reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement Steward has -the right to modify this Agreement. The Eclipse Foundation is the initial -Agreement Steward. The Eclipse Foundation may assign the responsibility to -serve as the Agreement Steward to a suitable separate entity. Each new version -of the Agreement will be given a distinguishing version number. The Program -(including Contributions) may always be distributed subject to the version of -the Agreement under which it was received. In addition, after a new version of -the Agreement is published, Contributor may elect to distribute the Program -(including its Contributions) under the new version. Except as expressly stated -in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to -the intellectual property of any Contributor under this Agreement, whether -expressly, by implication, estoppel or otherwise. All rights in the Program not -expressly granted under this Agreement are reserved.

      - -

      This Agreement is governed by the laws of the -State of New York and the intellectual property laws of the United States of -America. No party to this Agreement will bring a legal action under this -Agreement more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation.

      - -

      - -
      - - - - \ No newline at end of file diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/feature.properties b/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/feature.properties deleted file mode 100644 index 0defcd92ec8..00000000000 --- a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/feature.properties +++ /dev/null @@ -1,143 +0,0 @@ -############################################################################### -# Copyright (c) 2013 CEA LIST. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# CEA LIST - initial API and implementation -############################################################################### -featureName=Papyrus C++ profile, view and code generation (Incubation) -providerName=Eclipse Modeling Project - -# "licenseURL" property - URL of the "Feature License" -# do not translate value - just change to point to a locale-specific HTML page -licenseURL=license.html - -# "license" property - text of the "Feature Update License" -# should be plain text version of license agreement pointed to be "licenseURL" -license=\ -Eclipse Foundation Software User Agreement\n\ -April 9, 2014\n\ -\n\ -Usage Of Content\n\ -\n\ -THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ -OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ -USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ -AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ -NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ -AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ -AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ -OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ -TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ -OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ -BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ -\n\ -Applicable Licenses\n\ -\n\ -Unless otherwise indicated, all Content made available by the\n\ -Eclipse Foundation is provided to you under the terms and conditions of\n\ -the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ -provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ -For purposes of the EPL, "Program" will mean the Content.\n\ -\n\ -Content includes, but is not limited to, source code, object code,\n\ -documentation and other files maintained in the Eclipse Foundation source code\n\ -repository ("Repository") in software modules ("Modules") and made available\n\ -as downloadable archives ("Downloads").\n\ -\n\ -\t- Content may be structured and packaged into modules to facilitate delivering,\n\ -\t extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ -\t plug-in fragments ("Fragments"), and features ("Features").\n\ -\t- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ -\t in a directory named "plugins".\n\ -\t- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ -\t Each Feature may be packaged as a sub-directory in a directory named "features".\n\ -\t Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ -\t numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ -\t- Features may also include other Features ("Included Features"). Within a Feature, files\n\ -\t named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ -\n\ -The terms and conditions governing Plug-ins and Fragments should be\n\ -contained in files named "about.html" ("Abouts"). The terms and\n\ -conditions governing Features and Included Features should be contained\n\ -in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ -Licenses may be located in any directory of a Download or Module\n\ -including, but not limited to the following locations:\n\ -\n\ -\t- The top-level (root) directory\n\ -\t- Plug-in and Fragment directories\n\ -\t- Inside Plug-ins and Fragments packaged as JARs\n\ -\t- Sub-directories of the directory named "src" of certain Plug-ins\n\ -\t- Feature directories\n\ -\n\ -Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ -Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ -Update License") during the installation process. If the Feature contains\n\ -Included Features, the Feature Update License should either provide you\n\ -with the terms and conditions governing the Included Features or inform\n\ -you where you can locate them. Feature Update Licenses may be found in\n\ -the "license" property of files named "feature.properties" found within a Feature.\n\ -Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ -terms and conditions (or references to such terms and conditions) that\n\ -govern your use of the associated Content in that directory.\n\ -\n\ -THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ -TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ -SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ -\n\ -\t- Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ -\t- Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ -\t- Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ -\t- Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ -\t- Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ -\n\ -IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ -TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ -is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ -govern that particular Content.\n\ -\n\ -\n\Use of Provisioning Technology\n\ -\n\ -The Eclipse Foundation makes available provisioning software, examples of which include,\n\ -but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ -the purpose of allowing users to install software, documentation, information and/or\n\ -other materials (collectively "Installable Software"). This capability is provided with\n\ -the intent of allowing such users to install, extend and update Eclipse-based products.\n\ -Information about packaging Installable Software is available at\n\ -http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ -\n\ -You may use Provisioning Technology to allow other parties to install Installable Software.\n\ -You shall be responsible for enabling the applicable license agreements relating to the\n\ -Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ -in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ -making it available in accordance with the Specification, you further acknowledge your\n\ -agreement to, and the acquisition of all necessary rights to permit the following:\n\ -\n\ -\t1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ -\t the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ -\t extending or updating the functionality of an Eclipse-based product.\n\ -\t2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ -\t Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ -\t3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ -\t govern the use of the Installable Software ("Installable Software Agreement") and such\n\ -\t Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ -\t with the Specification. Such Installable Software Agreement must inform the user of the\n\ -\t terms and conditions that govern the Installable Software and must solicit acceptance by\n\ -\t the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ -\t indication of agreement by the user, the provisioning Technology will complete installation\n\ -\t of the Installable Software.\n\ -\n\ -Cryptography\n\ -\n\ -Content may contain encryption software. The country in which you are\n\ -currently may have restrictions on the import, possession, and use,\n\ -and/or re-export to another country, of encryption software. BEFORE\n\ -using any encryption software, please check the country's laws,\n\ -regulations and policies concerning the import, possession, or use, and\n\ -re-export of encryption software, to see if this is permitted.\n\ -\n\ -Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n -########### end of license property ########################################## diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/feature.xml b/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/feature.xml deleted file mode 100644 index 1dbca413afb..00000000000 --- a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/feature.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - C++ code generation from Papyrus. The feature includes -- A C++ profile, enabling the specification for C++ features, for instance: pointers, friends, constructor initializers -- A code generator from UML enriched with the C++ profile -- A C++ view allowing simple editing of opaque behaviors and manipulation of C++ profile attributes -- An experimental CDT integration - - - - Copyright (c) 2012 CEA LIST -All rights reserved. This program and the accompanying materials -are made available under the terms of the Eclipse Public License -v1.0 -which accompanies this distribution, and is available at -http://www.eclipse.org/legal/epl-v10.html - - - - %license - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/license.html b/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/license.html deleted file mode 100644 index 0fd3dd13aac..00000000000 --- a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/license.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - -Eclipse Foundation Software User Agreement - - - -

      Eclipse Foundation Software User Agreement

      -

      April 9, 2014

      - -

      Usage Of Content

      - -

      THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS - (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND - CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE - OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR - NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND - CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.

      - -

      Applicable Licenses

      - -

      Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 - ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html. - For purposes of the EPL, "Program" will mean the Content.

      - -

      Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code - repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").

      - -
        -
      • Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").
      • -
      • Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".
      • -
      • A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins - and/or Fragments associated with that Feature.
      • -
      • Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.
      • -
      - -

      The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and -Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module -including, but not limited to the following locations:

      - -
        -
      • The top-level (root) directory
      • -
      • Plug-in and Fragment directories
      • -
      • Inside Plug-ins and Fragments packaged as JARs
      • -
      • Sub-directories of the directory named "src" of certain Plug-ins
      • -
      • Feature directories
      • -
      - -

      Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the -installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or -inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature. -Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in -that directory.

      - -

      THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE -OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):

      - - - -

      IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please -contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.

      - - -

      Use of Provisioning Technology

      - -

      The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse - Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or - other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to - install, extend and update Eclipse-based products. Information about packaging Installable Software is available at http://eclipse.org/equinox/p2/repository_packaging.html - ("Specification").

      - -

      You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the - applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology - in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the - Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:

      - -
        -
      1. A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology - on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based - product.
      2. -
      3. During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be - accessed and copied to the Target Machine.
      4. -
      5. Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable - Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target - Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern - the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such - indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.
      6. -
      - -

      Cryptography

      - -

      Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to - another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, - possession, or use, and re-export of encryption software, to see if this is permitted.

      - -

      Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.

      - - diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/pom.xml b/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/pom.xml deleted file mode 100644 index 7fa0cbb9f7b..00000000000 --- a/features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature/pom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - 4.0.0 - - org.eclipse.papyrus.extra.releng - org.eclipse.papyrus - 1.2.0-SNAPSHOT - ../../../releng/extra - - org.eclipse.papyrus.extra.cpp.feature - org.eclipse.papyrus - 1.2.0-SNAPSHOT - eclipse-feature - \ No newline at end of file diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.feature/feature.xml b/features/papyrus-extra-features/org.eclipse.papyrus.extra.feature/feature.xml index 6957e49a20b..36affe70477 100644 --- a/features/papyrus-extra-features/org.eclipse.papyrus.extra.feature/feature.xml +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.feature/feature.xml @@ -85,7 +85,11 @@ http://www.eclipse.org/legal/epl-v10.html version="0.0.0"/> + + + + The Qompass tool suite is a component based design methodology @@ -30,22 +35,64 @@ http://www.eclipse.org/legal/epl-v10.html %license - + - + - + - + - + - + - + - + - + - \ No newline at end of file + diff --git a/features/papyrus-extra-features/org.eclipse.papyrus.extra.sources.feature/feature.xml b/features/papyrus-extra-features/org.eclipse.papyrus.extra.sources.feature/feature.xml index 4bb9028c8fd..d1062f9cee6 100644 --- a/features/papyrus-extra-features/org.eclipse.papyrus.extra.sources.feature/feature.xml +++ b/features/papyrus-extra-features/org.eclipse.papyrus.extra.sources.feature/feature.xml @@ -49,7 +49,9 @@ http://www.eclipse.org/legal/epl-v10.html - + + + @@ -57,4 +59,4 @@ http://www.eclipse.org/legal/epl-v10.html - \ No newline at end of file + diff --git a/releng/extra/pom.xml b/releng/extra/pom.xml index 7d547132d8b..09691ca5398 100644 --- a/releng/extra/pom.xml +++ b/releng/extra/pom.xml @@ -14,7 +14,6 @@ ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.cdo.feature - ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.cpp.feature ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.diagramtemplate.feature ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.dsml.validation.feature ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.eastadl.feature @@ -23,14 +22,9 @@ ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.marte.properties.feature ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.marte.textedit.feature ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.migration.feature - ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.qompass.designer.basic.feature - ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.qompass.designer.tracing.feature ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.robotml.feature ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.uml.compare.feature ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.umlrt.feature - ../../features/papyrus-extra-features/org.eclipse.papyrus.java.generator.feature - ../../features/papyrus-extra-features/org.eclipse.papyrus.java.profile.feature - ../../features/papyrus-extra-features/org.eclipse.papyrus.java.reverse.feature ../../features/papyrus-extra-features/org.eclipse.papyrus.layers.feature ../../features/papyrus-extra-features/org.eclipse.papyrus.robotml.generators.intempora.rtmaps.feature ../../features/papyrus-extra-features/org.eclipse.papyrus.uml.export.feature @@ -41,9 +35,6 @@ ../../features/papyrus-extra-features/org.eclipse.papyrus.effbd.feature - ../../extraplugins/codegen/org.eclipse.papyrus.acceleo - ../../extraplugins/codegen/org.eclipse.papyrus.acceleo.debug - ../../extraplugins/codegen/org.eclipse.papyrus.acceleo.ui ../../extraplugins/cdo/org.eclipse.papyrus.cdo.core ../../extraplugins/cdo/org.eclipse.papyrus.cdo.ui ../../extraplugins/cdo/org.eclipse.papyrus.cdo.ui.customization.properties @@ -53,13 +44,6 @@ ../../extraplugins/cdo/org.eclipse.papyrus.cdo.uml.ui ../../extraplugins/cdo/org.eclipse.papyrus.cdo.validation.problems ../../extraplugins/cdo/org.eclipse.papyrus.cdo.validation.problems.edit - ../../extraplugins/codegen/org.eclipse.papyrus.codegen.base - ../../extraplugins/codegen/org.eclipse.papyrus.codegen.extensionpoints - ../../extraplugins/codegen/org.eclipse.papyrus.cpp.cdtproject - ../../extraplugins/codegen/org.eclipse.papyrus.cpp.codegen - ../../extraplugins/codegen/org.eclipse.papyrus.cpp.codegen.ui - ../../extraplugins/codegen/org.eclipse.papyrus.cpp.examples - ../../extraplugins/codegen/org.eclipse.papyrus.cpp.profile ../../plugins/customization/org.eclipse.papyrus.customization ../../extraplugins/diagramtemplate/org.eclipse.papyrus.diagramtemplate ../../extraplugins/diagramtemplate/org.eclipse.papyrus.diagramtemplate.edit @@ -76,19 +60,6 @@ ../../extraplugins/eastadl/org.eclipse.papyrus.eastadl.nattable.allocation.config ../../extraplugins/eastadl/org.eclipse.papyrus.eastadl.nattable.menu ../../extraplugins/eastadl/org.eclipse.papyrus.eastadl.service.types - ../../extraplugins/qompass-designer/org.eclipse.papyrus.fcm.profile - ../../extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints - ../../extraplugins/java/org.eclipse.papyrus.java.generator.jdtsynchronizer - ../../extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt - ../../extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit - ../../extraplugins/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor - ../../extraplugins/java/org.eclipse.papyrus.java.generator.transfo.umltojdt - ../../extraplugins/java/org.eclipse.papyrus.java.generator.ui - ../../extraplugins/java/org.eclipse.papyrus.java.profile - ../../extraplugins/java/org.eclipse.papyrus.java.profile.edit - ../../extraplugins/java/org.eclipse.papyrus.java.profile.editor - ../../extraplugins/java/org.eclipse.papyrus.java.reverse - ../../extraplugins/java/org.eclipse.papyrus.java.reverse.ui ../../extraplugins/layers/org.eclipse.papyrus.layers.notationmodel.edit ../../extraplugins/layers/org.eclipse.papyrus.layers.runtime ../../extraplugins/layers/org.eclipse.papyrus.layers.stackmodel @@ -105,15 +76,65 @@ ../../extraplugins/marte/org.eclipse.papyrus.marte.vsl ../../extraplugins/marte/org.eclipse.papyrus.marte.vsl.ui ../../extraplugins/migration/org.eclipse.papyrus.migration.properties.model - ../../extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.core - ../../extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.cpp - ../../extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.java - ../../extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.doc - ../../extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.ui - ../../extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.validation - ../../extraplugins/qompass-designer/org.eclipse.papyrus.qompass.designer.vsl - ../../extraplugins/qompass-designer/org.eclipse.papyrus.qompass.modellibs.core - ../../extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing + + + ../../extraplugins/qompass/org.eclipse.papyrus.qompass.ui + + + ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.feature + ../../extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.base + ../../extraplugins/qompass/codegen/org.eclipse.papyrus.codegen.extensionpoints + ../../extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.model + ../../extraplugins/qompass/codegen/org.eclipse.papyrus.texteditor.modelexplorer + + + ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.codegen.cpp.feature + ../../extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.cdtproject + ../../extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen + ../../extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.codegen.ui + ../../extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.examples + ../../extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile + ../../extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.profile.ui + ../../extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library + ../../extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.cpp.library.ui + ../../extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.texteditor.cdt + ../../extraplugins/qompass/codegen/cpp/org.eclipse.papyrus.views.cpp + + + ../../features/papyrus-extra-features/org.eclipse.papyrus.java.generator.feature + ../../features/papyrus-extra-features/org.eclipse.papyrus.java.profile.feature + ../../features/papyrus-extra-features/org.eclipse.papyrus.java.reverse.feature + ../../extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.jdtsynchronizer + ../../extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt + ../../extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.edit + ../../extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.metamodel.jdt.editor + ../../extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.transfo.umltojdt + ../../extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.generator.ui + ../../extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile + ../../extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.edit + ../../extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.profile.editor + ../../extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse + ../../extraplugins/qompass/codegen/java/org.eclipse.papyrus.java.reverse.ui + + + ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.qompass.designer.basic.feature + ../../extraplugins/qompass/designer/org.eclipse.papyrus.fcm.profile + + ../../extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.core + ../../extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.cpp + ../../extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.java + ../../extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.doc + ../../extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.ui + ../../extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.validation + ../../extraplugins/qompass/designer/org.eclipse.papyrus.qompass.designer.vsl + ../../extraplugins/qompass/designer/org.eclipse.papyrus.qompass.modellibs.core + ../../extraplugins/qompass/designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing + + ../../features/papyrus-extra-features/org.eclipse.papyrus.extra.qompass.designer.tracing.feature + ../../extraplugins/qompass/designer/tracing/org.eclipse.papyrus.views.tracepoints + ../../extraplugins/qompass/designer/tracing/org.eclipse.papyrus.infra.services.tracepoints + + ../../extraplugins/robotml/org.eclipse.papyrus.robotml ../../extraplugins/robotml/org.eclipse.papyrus.robotml.deployment ../../extraplugins/robotml/org.eclipse.papyrus.robotml.diagram.common @@ -125,9 +146,6 @@ ../../extraplugins/robotml/org.eclipse.papyrus.robotml.perspective ../../extraplugins/robotml/org.eclipse.papyrus.robotml.templaterepository ../../extraplugins/robotml/org.eclipse.papyrus.robotml.validation - ../../extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt - ../../extraplugins/codegen/org.eclipse.papyrus.texteditor.model - ../../extraplugins/codegen/org.eclipse.papyrus.texteditor.modelexplorer ../../extraplugins/uml/compare/org.eclipse.papyrus.uml.compare ../../extraplugins/uml/org.eclipse.papyrus.uml.export ../../extraplugins/uml/org.eclipse.papyrus.uml.diagram.dnd.smart @@ -153,8 +171,6 @@ ../../extraplugins/migration/org.eclipse.papyrus.m2m.qvto ../../extraplugins/migration/org.eclipse.papyrus.migration.rsa - ../../extraplugins/codegen/org.eclipse.papyrus.views.cpp - ../../extraplugins/qompass-designer/tracing/org.eclipse.papyrus.views.tracepoints ../../extraplugins/papyrus4ecore/org.eclipse.papyrus.uml.diagram.ecore ../../features/papyrus-extra-features/org.eclipse.papyrus.uml.diagram.ecore.feature diff --git a/releng/extra/site/category.xml b/releng/extra/site/category.xml index b53462dceec..06db34d62bf 100644 --- a/releng/extra/site/category.xml +++ b/releng/extra/site/category.xml @@ -66,7 +66,10 @@ - + + + + @@ -99,7 +102,10 @@ - + + + + -- cgit v1.2.3